From 26ade35fdfdf37b6fdf0e54e9ea8f0b428e0a16c Mon Sep 17 00:00:00 2001 From: prabhataravind <108555774+prabhataravind@users.noreply.github.com> Date: Wed, 22 Nov 2023 15:02:17 -0800 Subject: [PATCH 001/419] [image_config]: Update DHCP rate-limit (#17132) Change DHCP rate limit in SONiC copp configuration to 100 PPS as this is necessary to ensure that DHCP flood does not cause LACP/BGP flaps in all scenarios This is an extension to the change in image_config: copp: Enable rate limiting for bgp, lacp, dhcp, lldp, macsec and udld #14859 and sonic-mgmt change in [tests/copp]: Update copp mgmt tests to support new rate-limits sonic-mgmt#8199 Why I did it 300 PPS is not sufficient to prevent LACP/BGP flaps in all cases. 100 PPS seems to provide better resiliency against DHCP traffic flood to CPU. Microsoft ADO 25776614: Send DHCP broadcast packets to DUT and verify that they are trapped to CPU at 100 PPS. Signed-off-by: Prabhat Aravind --- files/image_config/copp/copp_cfg.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/image_config/copp/copp_cfg.j2 b/files/image_config/copp/copp_cfg.j2 index 08366e57f647..f3550677d760 100755 --- a/files/image_config/copp/copp_cfg.j2 +++ b/files/image_config/copp/copp_cfg.j2 @@ -34,8 +34,8 @@ "queue": "4", "meter_type":"packets", "mode":"sr_tcm", - "cir":"300", - "cbs":"300", + "cir":"100", + "cbs":"100", "red_action":"drop" }, "queue1_group1": { From c0963db5a3a39a3f64d33769c051ece91d7e47bd Mon Sep 17 00:00:00 2001 From: Shashanka Balakuntala <135858627+shbalaku-microsoft@users.noreply.github.com> Date: Thu, 23 Nov 2023 04:35:32 +0530 Subject: [PATCH 002/419] [dhcp-relay]: Modify dhcp relay to pick primary address (#17012) This is change taken as part of the HLD: sonic-net/SONiC#1470 and this is a follow up on the PR #16827 where in the docker-dhcp we pick the value of primary gateway of the interface from the VLAN_Interface table which has "secondary" flag set in the config_db Microsoft ADO (number only): 16784946 How did I do it - Changes in the j2 file to add a new "-pg" parameter in the dhcpv4-relay.agents.j2, the ip would be retrieved from the config db's vlan_interface table such that the interface which are picked will have secondary field set. - Changes in isc-dhcp to re-order the addresses of the discovered interface and which has the ip which has the passed parameter. --- .../docker-dhcp-relay/dhcpv4-relay.agents.j2 | 3 + ...-to-set-primary-address-in-interface.patch | 114 ++++++++++++++++++ src/isc-dhcp/patch/series | 1 + src/sonic-config-engine/sonic-cfggen | 23 ++++ 4 files changed, 141 insertions(+) create mode 100644 src/isc-dhcp/patch/0015-option-to-set-primary-address-in-interface.patch diff --git a/dockers/docker-dhcp-relay/dhcpv4-relay.agents.j2 b/dockers/docker-dhcp-relay/dhcpv4-relay.agents.j2 index bf756ff63817..42fac7980586 100644 --- a/dockers/docker-dhcp-relay/dhcpv4-relay.agents.j2 +++ b/dockers/docker-dhcp-relay/dhcpv4-relay.agents.j2 @@ -24,6 +24,9 @@ command=/usr/sbin/dhcrelay -d -m discard -a %%h:%%p %%P --name-alias-map-file /t {% for (name, prefix) in PORTCHANNEL_INTERFACE|pfx_filter %} {% if prefix | ipv4 %} -iu {{ name }}{% endif -%} {% endfor %} +{% for (name, gateway) in VLAN_INTERFACE|get_primary_addr %} +{% if gateway | ipv4 and name == vlan_name %} -pg {{ gateway }}{% endif -%} +{% endfor %} {% for dhcp_server in VLAN[vlan_name]['dhcp_servers'] %} {%- if dhcp_server | ipv4 %} {{ dhcp_server }}{% endif -%} {% endfor %} diff --git a/src/isc-dhcp/patch/0015-option-to-set-primary-address-in-interface.patch b/src/isc-dhcp/patch/0015-option-to-set-primary-address-in-interface.patch new file mode 100644 index 000000000000..67283ba02c0a --- /dev/null +++ b/src/isc-dhcp/patch/0015-option-to-set-primary-address-in-interface.patch @@ -0,0 +1,114 @@ +diff --git a/common/discover.c b/common/discover.c +index ab50234..40e13f5 100644 +--- a/common/discover.c ++++ b/common/discover.c +@@ -1614,3 +1614,16 @@ void interface_snorf (struct interface_info *tmp, int ir) + } + interface_reference (&interfaces, tmp, MDL); + } ++ ++void set_primary_addr_in_intf (struct in_addr primary_addr) { ++ for (struct interface_info *tmp = interfaces; tmp; tmp = tmp->next) { ++ for (int i = 0; i < tmp->address_count; i++) { ++ if (tmp->addresses[i].s_addr == primary_addr.s_addr) { ++ struct in_addr tmp_ip = tmp->addresses[0]; ++ tmp->addresses[0] = primary_addr; ++ tmp->addresses[i] = tmp_ip; ++ break; ++ } ++ } ++ } ++} +\ No newline at end of file +diff --git a/includes/dhcpd.h b/includes/dhcpd.h +index 257b31e..e7f9f06 100644 +--- a/includes/dhcpd.h ++++ b/includes/dhcpd.h +@@ -2873,6 +2873,7 @@ extern int interface_count; + extern int interface_max; + isc_result_t interface_initialize(omapi_object_t *, const char *, int); + void discover_interfaces(int); ++void set_primary_addr_in_intf (struct in_addr ); + int setup_fallback (struct interface_info **, const char *, int); + int if_readsocket (omapi_object_t *); + void reinitialize_interfaces (void); +diff --git a/relay/dhcrelay.c b/relay/dhcrelay.c +index ff0ad17..31fe61b 100644 +--- a/relay/dhcrelay.c ++++ b/relay/dhcrelay.c +@@ -92,6 +92,11 @@ struct downstream_intf_list { + struct interface_info *interface; + } *downstream_intfs = NULL; + ++struct primary_gw_list { ++ struct primary_gw_list *next; ++ struct in_addr gateway_addr; ++} *primary_gws = NULL; ++ + #ifdef DHCPv6 + /* Force use of DHCPv6 interface-id option. */ + isc_boolean_t use_if_id = ISC_FALSE; +@@ -199,6 +204,7 @@ char *progname; + " [-i interface0 [ ... -i interfaceN]\n" \ + " [-iu interface0 [ ... -iu interfaceN]\n" \ + " [-id interface0 [ ... -id interfaceN]\n" \ ++" [-pg ip-address0 [ ... -pg ip-addressN]]\n" \ + " [-U interface]\n" \ + " [-dt]\n"\ + " server0 [ ... serverN]\n\n" \ +@@ -221,6 +227,7 @@ char *progname; + " [-i interface0 [ ... -i interfaceN]\n" \ + " [-iu interface0 [ ... -iu interfaceN]\n" \ + " [-id interface0 [ ... -id interfaceN]\n" \ ++" [-pg ip-address0 [ ... -pg ip-addressN]]\n" \ + " [-U interface]\n" \ + " [-dt]\n"\ + " server0 [ ... serverN]\n\n" \ +@@ -649,6 +656,34 @@ main(int argc, char **argv) { + usage(use_noarg, argv[i-1]); + path_dhcrelay_pid = argv[i]; + no_dhcrelay_pid = ISC_TRUE; ++ } else if (!strcmp(argv[i], "-pg")) { ++ if (++i == argc) ++ usage(use_noarg, argv[i-1]); ++#ifdef DHCPv6 ++ if (local_family_set && (local_family == AF_INET6)) { ++ usage(use_v4command, argv[i]); ++ } ++ local_family_set = 1; ++ local_family = AF_INET; ++#endif ++ struct in_addr gw = {0}; ++ if (inet_pton(AF_INET, argv[i], &gw) <= 0) { ++ usage("Invalid gateway address '%s'", argv[i]); ++ } else { ++ struct primary_gw_list *pg = ((struct primary_gw_list *)dmalloc(sizeof(struct primary_gw_list), MDL)); ++ pg->gateway_addr = gw; ++ pg->next = NULL; ++ ++ if (primary_gws == NULL) { ++ primary_gws = pg; ++ } else { ++ struct primary_gw_list *tmp = primary_gws; ++ while (tmp->next != NULL) { ++ tmp = tmp->next; ++ } ++ tmp->next = pg; ++ } ++ } + } else if (!strcmp(argv[i], "--no-pid")) { + no_pid_file = ISC_TRUE; + } else if (!strcmp(argv[i], "--name-alias-map-file")) { +@@ -818,6 +853,12 @@ main(int argc, char **argv) { + /* Discover all the network interfaces. */ + discover_interfaces(DISCOVER_RELAY); + ++ struct primary_gw_list *tmp = primary_gws; ++ while (tmp != NULL) { ++ set_primary_addr_in_intf(tmp->gateway_addr); ++ tmp = tmp->next; ++ } ++ + #ifdef DHCPv6 + if (local_family == AF_INET6) + setup_streams(); diff --git a/src/isc-dhcp/patch/series b/src/isc-dhcp/patch/series index 3550c1345a40..07f78949ae0b 100644 --- a/src/isc-dhcp/patch/series +++ b/src/isc-dhcp/patch/series @@ -13,3 +13,4 @@ 0012-add-option-si-to-support-using-src-intf-ip-in-relay.patch 0013-Fix-dhcrelay-agent-option-buffer-pointer-logic.patch 0014-enable-parallel-build.patch +0015-option-to-set-primary-address-in-interface.patch diff --git a/src/sonic-config-engine/sonic-cfggen b/src/sonic-config-engine/sonic-cfggen index 287640d8a119..243cc3ac2a87 100755 --- a/src/sonic-config-engine/sonic-cfggen +++ b/src/sonic-config-engine/sonic-cfggen @@ -25,6 +25,7 @@ import netaddr import os import sys import yaml +import ipaddress from collections import OrderedDict from config_samples import generate_sample_config, get_available_config @@ -137,6 +138,27 @@ def ip_network(value): return "Invalid ip address %s" % value return r_v.network +def get_primary_addr(value): + if not value: + return "" + table = pfx_filter(value) + primary_gateways = OrderedDict() + intf_with_secondary = set() + for key, val in table.items(): + name, prefix = key + if "secondary" in val: + intf_with_secondary.add(name) + for key, val in table.items(): + name, prefix = key + if name in intf_with_secondary and "secondary" not in val: + if PY3x: + network_def = ipaddress.ip_network(prefix, strict=False) + else: + network_def = ipaddress.ip_network(unicode(prefix), strict=False) + primary_gateways[(name, network_def[1])] = {} + intf_with_secondary.remove(name) + return primary_gateways + def load_namespace_config(asic_name): if not SonicDBConfig.isInit(): if is_multi_asic(): @@ -247,6 +269,7 @@ def _get_jinja2_env(paths): env.filters['unique_name'] = unique_name env.filters['pfx_filter'] = pfx_filter env.filters['ip_network'] = ip_network + env.filters['get_primary_addr'] = get_primary_addr for attr in ['ip', 'network', 'prefixlen', 'netmask', 'broadcast']: env.filters[attr] = partial(prefix_attr, attr) From fad1081b2f93e2d8714da33c9978e88b0368b675 Mon Sep 17 00:00:00 2001 From: Shashanka Balakuntala <135858627+shbalaku-microsoft@users.noreply.github.com> Date: Thu, 23 Nov 2023 04:36:20 +0530 Subject: [PATCH 003/419] [minigraph]: Adding new secondary field to VLAN_INTERFACE table (#16827) This is change taken as part of the HLD: sonic-net/SONiC#1470. In this PR we add the logic to parse the SecondarySubnets field in the minigraph and add a flag in "secondary" in the vlan_interface table of the config db. Microsoft ADO (number only): 16784946 How I did it Made changes in the minigraph.py to parse the xml entry and add the parsed value to the config db How to verify it Added python tests in the sonic-config-engine folder to test the config db entries. --- src/sonic-config-engine/minigraph.py | 17 +++++++++++++++++ .../tests/simple-sample-graph-case.xml | 6 ++++++ .../tests/test_minigraph_case.py | 8 +++++++- .../yang-models/sonic-vlan.yang | 5 +++++ 4 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index 0bee0171c5bc..1cadd297e527 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -686,6 +686,17 @@ def parse_dpg(dpg, hname): if vlanmac is not None and vlanmac.text is not None: vlan_attributes['mac'] = vlanmac.text + vintf_node = vintf.find(str(QName(ns, "SecondarySubnets"))) + if vintf_node is not None and vintf_node.text is not None: + subnets = vintf_node.text.split(';') + for subnet in subnets: + if sys.version_info >= (3, 0): + network_def = ipaddress.ip_network(subnet, strict=False) + else: + network_def = ipaddress.ip_network(unicode(subnet), strict=False) + prefix = str(network_def[1]) + "/" + str(network_def.prefixlen) + intfs[(vintfname, prefix)]["secondary"] = "true" + sonic_vlan_name = "Vlan%s" % vlanid if sonic_vlan_name != vintfname: vlan_attributes['alias'] = vintfname @@ -1729,6 +1740,9 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw if intf[0][0:4] == 'Vlan': vlan_intfs[intf] = {} + if "secondary" in intfs[intf]: + vlan_intfs[intf]["secondary"] = "true" + if bool(results['PEER_SWITCH']): vlan_intfs[intf[0]] = { 'proxy_arp': 'enabled', @@ -1739,6 +1753,9 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw elif intf[0] in vlan_invert_mapping: vlan_intfs[(vlan_invert_mapping[intf[0]], intf[1])] = {} + if "secondary" in intfs[intf]: + vlan_intfs[(vlan_invert_mapping[intf[0]], intf[1])]["secondary"] = "true" + if bool(results['PEER_SWITCH']): vlan_intfs[vlan_invert_mapping[intf[0]]] = { 'proxy_arp': 'enabled', diff --git a/src/sonic-config-engine/tests/simple-sample-graph-case.xml b/src/sonic-config-engine/tests/simple-sample-graph-case.xml index cfcb8559ef2f..ddb5f03c58b5 100644 --- a/src/sonic-config-engine/tests/simple-sample-graph-case.xml +++ b/src/sonic-config-engine/tests/simple-sample-graph-case.xml @@ -138,6 +138,7 @@ 1000 1000 192.168.0.0/27 + 192.168.1.0/27 00:aa:bb:cc:dd:ee @@ -176,6 +177,11 @@ ab1 192.168.0.1/27 + + + ab1 + 192.168.1.1/27 + diff --git a/src/sonic-config-engine/tests/test_minigraph_case.py b/src/sonic-config-engine/tests/test_minigraph_case.py index 45ca5cdcce86..70c5c410332e 100644 --- a/src/sonic-config-engine/tests/test_minigraph_case.py +++ b/src/sonic-config-engine/tests/test_minigraph_case.py @@ -139,7 +139,10 @@ def test_minigraph_vlan_members(self): def test_minigraph_vlan_interfaces_keys(self): argument = ['-m', self.sample_graph, '-p', self.port_config, '-v', "VLAN_INTERFACE.keys()|list"] output = self.run_script(argument) - self.assertEqual(output.strip(), "[('Vlan1000', '192.168.0.1/27'), 'Vlan1000']") + expected_list_dict = { + 'list': ['Vlan1000', 'Vlan1000|192.168.0.1/27', 'Vlan1000|192.168.1.1/27'] + } + self.assertEqual(utils.liststr_to_dict(output.strip()), expected_list_dict) def test_minigraph_vlan_interfaces(self): argument = ['-m', self.sample_graph, '-p', self.port_config, '-v', "VLAN_INTERFACE"] @@ -149,6 +152,9 @@ def test_minigraph_vlan_interfaces(self): 'Vlan1000': { 'proxy_arp': 'enabled', 'grat_arp': 'enabled' + }, + 'Vlan1000|192.168.1.1/27': { + 'secondary': 'true' } } self.assertEqual(utils.to_dict(output.strip()), expected_table) diff --git a/src/sonic-yang-models/yang-models/sonic-vlan.yang b/src/sonic-yang-models/yang-models/sonic-vlan.yang index 77fd29c0f47d..ad1ab8d743f3 100644 --- a/src/sonic-yang-models/yang-models/sonic-vlan.yang +++ b/src/sonic-yang-models/yang-models/sonic-vlan.yang @@ -158,6 +158,11 @@ module sonic-vlan { (contains(../ip-prefix, '.') and current()='IPv4')"; type stypes:ip-family; } + + leaf secondary { + description "Optional field to specify if the prefix is secondary subnet"; + type boolean; + } } /* end of VLAN_INTERFACE_LIST */ } From 2f3b48fe647535b911c4c493ad8dd1cdfe6aa2cf Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Wed, 22 Nov 2023 23:01:13 -0800 Subject: [PATCH 004/419] [FRR] Fixing zebra to handle non notification of better admin won (#17184) * [FRR]Fixing zebra to handle non notification of better admin won * Updating the patch with latest changes from FRR --- ...non-notification-of-better-admin-won.patch | 70 +++++++++++++++++++ src/sonic-frr/patch/series | 1 + 2 files changed, 71 insertions(+) create mode 100644 src/sonic-frr/patch/0027-zebra-Fix-non-notification-of-better-admin-won.patch diff --git a/src/sonic-frr/patch/0027-zebra-Fix-non-notification-of-better-admin-won.patch b/src/sonic-frr/patch/0027-zebra-Fix-non-notification-of-better-admin-won.patch new file mode 100644 index 000000000000..a1e06a7f5f21 --- /dev/null +++ b/src/sonic-frr/patch/0027-zebra-Fix-non-notification-of-better-admin-won.patch @@ -0,0 +1,70 @@ +From 41b759505afb261211f40e386a30f6cf3870a094 Mon Sep 17 00:00:00 2001 +From: dgsudharsan +Date: Tue, 21 Nov 2023 17:55:24 +0000 +Subject: [PATCH] zebra: Fix non-notification of better admin won If there + happens to be a entry in the zebra rib that has a lower admin distance then a + newly received re, zebra would not notify the upper level protocol about this + happening. Imagine a case where there is a connected route for say a /32 and + bgp receives a route from a peer that is the same route as the connected. + Since BGP has no network statement and perceives the route as being `good` + bgp will install the route into zebra. Zebra will look at the new bgp re and + correctly identify that the re is not something that it will use and do + nothing. This change notices this and sends up a BETTER_ADMIN_WON route + notification. + + +diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c +index 039c44cc09..f2f20bcf7b 100644 +--- a/zebra/zebra_rib.c ++++ b/zebra/zebra_rib.c +@@ -1209,6 +1209,7 @@ static void rib_process(struct route_node *rn) + rib_dest_t *dest; + struct zebra_vrf *zvrf = NULL; + struct vrf *vrf; ++ struct route_entry *proto_re_changed = NULL; + + vrf_id_t vrf_id = VRF_UNKNOWN; + +@@ -1278,6 +1279,7 @@ static void rib_process(struct route_node *rn) + * skip it. + */ + if (CHECK_FLAG(re->status, ROUTE_ENTRY_CHANGED)) { ++ proto_re_changed = re; + if (!nexthop_active_update(rn, re)) { + const struct prefix *p; + struct rib_table_info *info; +@@ -1363,6 +1365,8 @@ static void rib_process(struct route_node *rn) + * new_selected --- RE entry that is newly SELECTED + * old_fib --- RE entry currently in kernel FIB + * new_fib --- RE entry that is newly to be in kernel FIB ++ * proto_re_changed -- RE that is the last changed entry in the ++ * list of RE's. + * + * new_selected will get SELECTED flag, and is going to be redistributed + * the zclients. new_fib (which can be new_selected) will be installed +@@ -1417,6 +1421,22 @@ static void rib_process(struct route_node *rn) + } + } + ++ /* ++ * If zebra has a new_selected and a proto_re_changed ++ * entry that was not the old selected and the protocol ++ * is different, zebra should notify the upper level ++ * protocol that the sent down entry was not selected ++ */ ++ if (new_selected && proto_re_changed && ++ proto_re_changed != old_selected && ++ new_selected->type != proto_re_changed->type) { ++ struct rib_table_info *info = srcdest_rnode_table_info(rn); ++ ++ zsend_route_notify_owner(rn, proto_re_changed, ++ ZAPI_ROUTE_BETTER_ADMIN_WON, info->afi, ++ info->safi); ++ } ++ + /* Update fib according to selection results */ + if (new_fib && old_fib) + rib_process_update_fib(zvrf, rn, old_fib, new_fib); +-- +2.17.1 + diff --git a/src/sonic-frr/patch/series b/src/sonic-frr/patch/series index d914370a70f2..c057585d64fe 100644 --- a/src/sonic-frr/patch/series +++ b/src/sonic-frr/patch/series @@ -26,3 +26,4 @@ cross-compile-changes.patch 0024-bgpd-Do-not-process-NLRIs-if-the-attribute-length-is.patch 0025-bgpd-Use-treat-as-withdraw-for-tunnel-encapsulation-.patch 0026-zebra-Add-encap-type-when-building-packet-for-FPM.patch +0027-zebra-Fix-non-notification-of-better-admin-won.patch From 8c1bd85830aac6bb2bc3b68bff62b1a656cc3825 Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Thu, 23 Nov 2023 04:59:31 -0800 Subject: [PATCH 005/419] [yang]Fixing sonic-cfg-help to handle nested container (#17260) Why I did it Fixing sonic-cfg-help to handle nested container scenario. In case of nested container, the inner container name acts as key for the table. For e.g. "AUTO_TECHSUPPORT": { "GLOBAL": { } } Previous output AUTO_TECHSUPPORT Description: AUTO_TECHSUPPORT part of config_db.json +-------------------------+----------------------------------------------------+-------------+-----------+-------------+ | Field | Description | Mandatory | Default | Reference | +=========================+====================================================+=============+===========+=============+ | state | Knob to make techsupport invocation event-driven | | | | | | based on core-dump generation | | | | +-------------------------+----------------------------------------------------+-------------+-----------+-------------+ | rate_limit_interval | Minimum time in seconds between two successive | | | | | | techsupport invocations. Configure 0 to explicitly | | | | | | disable | | | | +-------------------------+----------------------------------------------------+-------------+-----------+-------------+ | max_techsupport_limit | Max Limit in percentage for the cummulative size | | | | | | of ts dumps. No cleanup is performed if the value | | | | | | isn't configured or is 0.0 | | | | +-------------------------+----------------------------------------------------+-------------+-----------+-------------+ | max_core_limit | Max Limit in percentage for the cummulative size | | | | | | of core dumps. No cleanup is performed if the | | | | | | value isn't congiured or is 0.0 | | | | +-------------------------+----------------------------------------------------+-------------+-----------+-------------+ | available_mem_threshold | Memory threshold; 0 to disable techsupport | | 10.0 | | | | invocation on memory usage threshold crossing | | | | +-------------------------+----------------------------------------------------+-------------+-----------+-------------+ | min_available_mem | Minimum Free memory (in MB) that should be | | 200 | | | | available for the techsupport execution to start | | | | +-------------------------+----------------------------------------------------+-------------+-----------+-------------+ | since | Only collect the logs & core-dumps generated since | | | | | | the time provided. A default value of '2 days ago' | | | | | | is used if this value is not set explicitly or a | | | | | | non-valid string is provided | | | | +-------------------------+----------------------------------------------------+-------------+-----------+-------------+ New output AUTO_TECHSUPPORT Description: AUTO_TECHSUPPORT part of config_db.json key - GLOBAL +-------------------------+----------------------------------------------------+-------------+-----------+-------------+ | Field | Description | Mandatory | Default | Reference | +=========================+====================================================+=============+===========+=============+ | state | Knob to make techsupport invocation event-driven | | | | | | based on core-dump generation | | | | +-------------------------+----------------------------------------------------+-------------+-----------+-------------+ | rate_limit_interval | Minimum time in seconds between two successive | | | | | | techsupport invocations. Configure 0 to explicitly | | | | | | disable | | | | +-------------------------+----------------------------------------------------+-------------+-----------+-------------+ | max_techsupport_limit | Max Limit in percentage for the cummulative size | | | | | | of ts dumps. No cleanup is performed if the value | | | | | | isn't configured or is 0.0 | | | | +-------------------------+----------------------------------------------------+-------------+-----------+-------------+ | max_core_limit | Max Limit in percentage for the cummulative size | | | | | | of core dumps. No cleanup is performed if the | | | | | | value isn't congiured or is 0.0 | | | | +-------------------------+----------------------------------------------------+-------------+-----------+-------------+ | available_mem_threshold | Memory threshold; 0 to disable techsupport | | 10.0 | | | | invocation on memory usage threshold crossing | | | | +-------------------------+----------------------------------------------------+-------------+-----------+-------------+ | min_available_mem | Minimum Free memory (in MB) that should be | | 200 | | | | available for the techsupport execution to start | | | | +-------------------------+----------------------------------------------------+-------------+-----------+-------------+ | since | Only collect the logs & core-dumps generated since | | | | | | the time provided. A default value of '2 days ago' | | | | | | is used if this value is not set explicitly or a | | | | | | non-valid string is provided | | | | +-------------------------+----------------------------------------------------+-------------+-----------+-------------+ Work item tracking Microsoft ADO (number only): How I did it Fixing sonic-cfg-help tool to handle nested container How to verify it Added UT to verify it. --- src/sonic-yang-mgmt/sonic-cfg-help | 9 +++++++- src/sonic-yang-mgmt/tests/test_cfghelp.py | 26 +++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/sonic-yang-mgmt/sonic-cfg-help b/src/sonic-yang-mgmt/sonic-cfg-help index 4c14cebc44b8..bd842b3c4dcd 100755 --- a/src/sonic-yang-mgmt/sonic-cfg-help +++ b/src/sonic-yang-mgmt/sonic-cfg-help @@ -54,7 +54,14 @@ class SonicCfgDescriber: self.print_field_desc(table['list'], field) print() elif table.get('container') is not None: - self.print_field_desc(table.get('container'), field) + if isinstance(table['container'], dict): + print("key - " + table['container'].get('@name')) + self.print_field_desc(table.get('container'), field) + elif isinstance(table['container'], list): + for c in table['container']: + print("key - " + c.get('@name')) + self.print_field_desc(c, field) + print() def get_referenced_table_field(self, ref): diff --git a/src/sonic-yang-mgmt/tests/test_cfghelp.py b/src/sonic-yang-mgmt/tests/test_cfghelp.py index 2eebebe7be3b..70b3a1edb10a 100644 --- a/src/sonic-yang-mgmt/tests/test_cfghelp.py +++ b/src/sonic-yang-mgmt/tests/test_cfghelp.py @@ -25,6 +25,7 @@ AUTO_TECHSUPPORT Description: AUTO_TECHSUPPORT part of config_db.json +key - GLOBAL +-------------------------+----------------------------------------------------+-------------+-----------+-------------+ | Field | Description | Mandatory | Default | Reference | +=========================+====================================================+=============+===========+=============+ @@ -62,6 +63,7 @@ AUTO_TECHSUPPORT Description: AUTO_TECHSUPPORT part of config_db.json +key - GLOBAL +---------+--------------------------------------------------+-------------+-----------+-------------+ | Field | Description | Mandatory | Default | Reference | +=========+==================================================+=============+===========+=============+ @@ -118,6 +120,25 @@ """ +snmp_table_output="""\ + +SNMP + +key - CONTACT ++---------+----------------------+-------------+-----------+-------------+ +| Field | Description | Mandatory | Default | Reference | ++=========+======================+=============+===========+=============+ +| Contact | SNMP System Contact. | | | | ++---------+----------------------+-------------+-----------+-------------+ +key - LOCATION ++----------+-----------------------+-------------+-----------+-------------+ +| Field | Description | Mandatory | Default | Reference | ++==========+=======================+=============+===========+=============+ +| Location | SNMP System Location. | | | | ++----------+-----------------------+-------------+-----------+-------------+ + +""" + class TestCfgHelp(TestCase): def setUp(self): @@ -167,3 +188,8 @@ def test_when_condition(self): argument = ['-t', 'ACL_RULE', '-f', 'ICMP_TYPE'] output = self.run_script(argument) self.assertEqual(output, acl_rule_table_field_output) + + def test_nested_container(self): + argument = ['-t', 'SNMP'] + output = self.run_script(argument) + self.assertEqual(output, snmp_table_output) From f96742fb98e20a2da46c2cd573c3bfe5276970ec Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Mon, 27 Nov 2023 19:23:04 +0800 Subject: [PATCH 006/419] [Mellanox] Revert LPM implementation to the old way (#17096) - Why I did it The current low power mode setting implementation requests the user to set the port to admin down first before toggling LP mode, this is not backward compatible, now revert it to the old way so that the user can toggle the LP mode regardless of the port admin status. - How I did it Revert the recent changes related to LPM in PR #14130 and #16545 - How to verify it Run all sfputil and SFP platform API related tests on all the Mellanox platforms. Signed-off-by: Kebo Liu --- .../sonic_platform/chassis.py | 4 + .../mlnx-platform-api/sonic_platform/sfp.py | 272 +++++++++++++++++- .../mlnx-platform-api/tests/test_sfp.py | 52 ++-- 3 files changed, 297 insertions(+), 31 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py b/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py index 0d723ebfa916..105fc48d8499 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py @@ -130,6 +130,10 @@ def __del__(self): if self.sfp_event: self.sfp_event.deinitialize() + if self._sfp_list: + if self.sfp_module.SFP.shared_sdk_handle: + self.sfp_module.deinitialize_sdk_handle(self.sfp_module.SFP.shared_sdk_handle) + @property def RJ45_port_list(self): if not self._RJ45_port_inited: diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index 76c841713f80..a4dd7a8fc842 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -35,6 +35,16 @@ except ImportError as e: raise ImportError (str(e) + "- required module not found") +try: + # python_sdk_api does not support python3 for now. Daemons like thermalctld or psud + # also import this file without actually use the sdk lib. So we catch the ImportError + # and ignore it here. Meanwhile, we have to trigger xcvrd using python2 now because it + # uses the sdk lib. + from python_sdk_api.sxd_api import * + from python_sdk_api.sx_api import * +except ImportError as e: + pass + # Define the sdk constants SX_PORT_MODULE_STATUS_INITIALIZING = 0 SX_PORT_MODULE_STATUS_PLUGGED = 1 @@ -42,6 +52,15 @@ SX_PORT_MODULE_STATUS_PLUGGED_WITH_ERROR = 3 SX_PORT_MODULE_STATUS_PLUGGED_DISABLED = 4 +try: + if os.environ["PLATFORM_API_UNIT_TESTING"] == "1": + # Unable to import SDK constants under unit test + # Define them here + SX_PORT_ADMIN_STATUS_UP = True + SX_PORT_ADMIN_STATUS_DOWN = False +except KeyError: + pass + # identifier value of xSFP module which is in the first byte of the EEPROM # if the identifier value falls into SFP_TYPE_CODE_LIST the module is treated as a SFP module and parsed according to 8472 # for QSFP_TYPE_CODE_LIST the module is treated as a QSFP module and parsed according to 8436/8636 @@ -160,12 +179,52 @@ logger = Logger() +# SDK initializing stuff, called from chassis +def initialize_sdk_handle(): + rc, sdk_handle = sx_api_open(None) + if (rc != SX_STATUS_SUCCESS): + logger.log_warning("Failed to open api handle, please check whether SDK is running.") + sdk_handle = None + + return sdk_handle + + +def deinitialize_sdk_handle(sdk_handle): + if sdk_handle is not None: + rc = sx_api_close(sdk_handle) + if (rc != SX_STATUS_SUCCESS): + logger.log_warning("Failed to close api handle.") + + return rc == SXD_STATUS_SUCCESS + else: + logger.log_warning("Sdk handle is none") + return False + +class SdkHandleContext(object): + def __init__(self): + self.sdk_handle = None + + def __enter__(self): + self.sdk_handle = initialize_sdk_handle() + return self.sdk_handle + + def __exit__(self, exc_type, exc_val, exc_tb): + deinitialize_sdk_handle(self.sdk_handle) + class NvidiaSFPCommon(SfpOptoeBase): def __init__(self, sfp_index): super(NvidiaSFPCommon, self).__init__() self.index = sfp_index + 1 self.sdk_index = sfp_index + @property + def sdk_handle(self): + if not SFP.shared_sdk_handle: + SFP.shared_sdk_handle = initialize_sdk_handle() + if not SFP.shared_sdk_handle: + logger.log_error('Failed to open SDK handle') + return SFP.shared_sdk_handle + @classmethod def _get_module_info(self, sdk_index): """ @@ -185,6 +244,7 @@ def _get_module_info(self, sdk_index): class SFP(NvidiaSFPCommon): """Platform-specific SFP class""" + shared_sdk_handle = None SFP_MLNX_ERROR_DESCRIPTION_LONGRANGE_NON_MLNX_CABLE = 'Long range for non-Mellanox cable or module' SFP_MLNX_ERROR_DESCRIPTION_ENFORCE_PART_NUMBER_LIST = 'Enforce part number list' SFP_MLNX_ERROR_DESCRIPTION_PMD_TYPE_NOT_ENABLED = 'PMD type not enabled' @@ -311,6 +371,24 @@ def write_eeprom(self, offset, num_bytes, write_buffer): return False return True + @classmethod + def mgmt_phy_mod_pwr_attr_get(cls, power_attr_type, sdk_handle, sdk_index, slot_id): + sx_mgmt_phy_mod_pwr_attr_p = new_sx_mgmt_phy_mod_pwr_attr_t_p() + sx_mgmt_phy_mod_pwr_attr = sx_mgmt_phy_mod_pwr_attr_t() + sx_mgmt_phy_mod_pwr_attr.power_attr_type = power_attr_type + sx_mgmt_phy_mod_pwr_attr_t_p_assign(sx_mgmt_phy_mod_pwr_attr_p, sx_mgmt_phy_mod_pwr_attr) + module_id_info = sx_mgmt_module_id_info_t() + module_id_info.slot_id = slot_id + module_id_info.module_id = sdk_index + try: + rc = sx_mgmt_phy_module_pwr_attr_get(sdk_handle, module_id_info, sx_mgmt_phy_mod_pwr_attr_p) + assert SX_STATUS_SUCCESS == rc, "sx_mgmt_phy_module_pwr_attr_get failed {}".format(rc) + sx_mgmt_phy_mod_pwr_attr = sx_mgmt_phy_mod_pwr_attr_t_p_value(sx_mgmt_phy_mod_pwr_attr_p) + pwr_mode_attr = sx_mgmt_phy_mod_pwr_attr.pwr_mode_attr + return pwr_mode_attr.admin_pwr_mode_e, pwr_mode_attr.oper_pwr_mode_e + finally: + delete_sx_mgmt_phy_mod_pwr_attr_t_p(sx_mgmt_phy_mod_pwr_attr_p) + def get_lpmode(self): """ Retrieves the lpmode (low power mode) status of this SFP @@ -318,9 +396,36 @@ def get_lpmode(self): Returns: A Boolean, True if lpmode is enabled, False if disabled """ - file_path = SFP_SDK_MODULE_SYSFS_ROOT_TEMPLATE.format(self.sdk_index) + SFP_SYSFS_POWER_MODE - power_mode = utils.read_int_from_file(file_path) - return power_mode == POWER_MODE_LOW + if utils.is_host(): + # To avoid performance issue, + # call class level method to avoid initialize the whole sonic platform API + get_lpmode_code = 'from sonic_platform import sfp;\n' \ + 'with sfp.SdkHandleContext() as sdk_handle:' \ + 'print(sfp.SFP._get_lpmode(sdk_handle, {}, {}))'.format(self.sdk_index, self.slot_id) + lpm_cmd = ["docker", "exec", "pmon", "python3", "-c", get_lpmode_code] + try: + output = subprocess.check_output(lpm_cmd, universal_newlines=True) + return 'True' in output + except subprocess.CalledProcessError as e: + print("Error! Unable to get LPM for {}, rc = {}, err msg: {}".format(self.sdk_index, e.returncode, e.output)) + return False + else: + return self._get_lpmode(self.sdk_handle, self.sdk_index, self.slot_id) + + @classmethod + def _get_lpmode(cls, sdk_handle, sdk_index, slot_id): + """Class level method to get low power mode. + + Args: + sdk_handle: SDK handle + sdk_index (integer): SDK port index + slot_id (integer): Slot ID + + Returns: + [boolean]: True if low power mode is on else off + """ + _, oper_pwr_mode = cls.mgmt_phy_mod_pwr_attr_get(SX_MGMT_PHY_MOD_PWR_ATTR_PWR_MODE_E, sdk_handle, sdk_index, slot_id) + return oper_pwr_mode == SX_MGMT_PHY_MOD_PWR_MODE_LOW_E def reset(self): """ @@ -334,6 +439,128 @@ def reset(self): file_path = SFP_SDK_MODULE_SYSFS_ROOT_TEMPLATE.format(self.sdk_index) + SFP_SYSFS_RESET return utils.write_file(file_path, '1') + + @classmethod + def is_nve(cls, port): + return (port & NVE_MASK) != 0 + + + @classmethod + def is_cpu(cls, port): + return (port & CPU_MASK) != 0 + + + @classmethod + def _fetch_port_status(cls, sdk_handle, log_port): + oper_state_p = new_sx_port_oper_state_t_p() + admin_state_p = new_sx_port_admin_state_t_p() + module_state_p = new_sx_port_module_state_t_p() + rc = sx_api_port_state_get(sdk_handle, log_port, oper_state_p, admin_state_p, module_state_p) + assert rc == SXD_STATUS_SUCCESS, "sx_api_port_state_get failed, rc = %d" % rc + + admin_state = sx_port_admin_state_t_p_value(admin_state_p) + oper_state = sx_port_oper_state_t_p_value(oper_state_p) + + delete_sx_port_oper_state_t_p(oper_state_p) + delete_sx_port_admin_state_t_p(admin_state_p) + delete_sx_port_module_state_t_p(module_state_p) + + return oper_state, admin_state + + + @classmethod + def is_port_admin_status_up(cls, sdk_handle, log_port): + _, admin_state = cls._fetch_port_status(sdk_handle, log_port); + return admin_state == SX_PORT_ADMIN_STATUS_UP + + + @classmethod + def set_port_admin_status_by_log_port(cls, sdk_handle, log_port, admin_status): + rc = sx_api_port_state_set(sdk_handle, log_port, admin_status) + if SX_STATUS_SUCCESS != rc: + logger.log_error("sx_api_port_state_set failed, rc = %d" % rc) + + return SX_STATUS_SUCCESS == rc + + + @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_cnt_p = new_uint32_t_p() + 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 + + port_cnt = uint32_t_p_value(port_cnt_p) + log_port_list = [] + for i in range(0, port_cnt): + port_attributes = sx_port_attributes_t_arr_getitem(port_attributes_list, i) + if not cls.is_nve(int(port_attributes.log_port)) \ + and not cls.is_cpu(int(port_attributes.log_port)) \ + and port_attributes.port_mapping.module_port == sdk_index \ + and port_attributes.port_mapping.slot == slot_id \ + and cls.is_port_admin_status_up(sdk_handle, port_attributes.log_port): + log_port_list.append(port_attributes.log_port) + + delete_sx_port_attributes_t_arr(port_attributes_list) + delete_uint32_t_p(port_cnt_p) + return log_port_list + + + @classmethod + def mgmt_phy_mod_pwr_attr_set(cls, sdk_handle, sdk_index, slot_id, power_attr_type, admin_pwr_mode): + result = False + sx_mgmt_phy_mod_pwr_attr = sx_mgmt_phy_mod_pwr_attr_t() + sx_mgmt_phy_mod_pwr_mode_attr = sx_mgmt_phy_mod_pwr_mode_attr_t() + sx_mgmt_phy_mod_pwr_attr.power_attr_type = power_attr_type + sx_mgmt_phy_mod_pwr_mode_attr.admin_pwr_mode_e = admin_pwr_mode + sx_mgmt_phy_mod_pwr_attr.pwr_mode_attr = sx_mgmt_phy_mod_pwr_mode_attr + sx_mgmt_phy_mod_pwr_attr_p = new_sx_mgmt_phy_mod_pwr_attr_t_p() + sx_mgmt_phy_mod_pwr_attr_t_p_assign(sx_mgmt_phy_mod_pwr_attr_p, sx_mgmt_phy_mod_pwr_attr) + module_id_info = sx_mgmt_module_id_info_t() + module_id_info.slot_id = slot_id + module_id_info.module_id = sdk_index + try: + rc = sx_mgmt_phy_module_pwr_attr_set(sdk_handle, SX_ACCESS_CMD_SET, module_id_info, sx_mgmt_phy_mod_pwr_attr_p) + if SX_STATUS_SUCCESS != rc: + logger.log_error("Error occurred when setting power mode for SFP module {}, slot {}, error code {}".format(sdk_index, slot_id, rc)) + result = False + else: + result = True + finally: + delete_sx_mgmt_phy_mod_pwr_attr_t_p(sx_mgmt_phy_mod_pwr_attr_p) + + return result + + + @classmethod + def _set_lpmode_raw(cls, sdk_handle, sdk_index, slot_id, ports, attr_type, power_mode): + result = False + # Check if the module already works in the same mode + admin_pwr_mode, oper_pwr_mode = cls.mgmt_phy_mod_pwr_attr_get(attr_type, sdk_handle, sdk_index, slot_id) + if (power_mode == SX_MGMT_PHY_MOD_PWR_MODE_LOW_E and oper_pwr_mode == SX_MGMT_PHY_MOD_PWR_MODE_LOW_E) \ + or (power_mode == SX_MGMT_PHY_MOD_PWR_MODE_AUTO_E and admin_pwr_mode == SX_MGMT_PHY_MOD_PWR_MODE_AUTO_E): + return True + try: + # Bring the port down + for port in ports: + cls.set_port_admin_status_by_log_port(sdk_handle, port, SX_PORT_ADMIN_STATUS_DOWN) + # Set the desired power mode + result = cls.mgmt_phy_mod_pwr_attr_set(sdk_handle, sdk_index, slot_id, attr_type, power_mode) + finally: + # Bring the port up + for port in ports: + cls.set_port_admin_status_by_log_port(sdk_handle, port, SX_PORT_ADMIN_STATUS_UP) + + return result + + def set_lpmode(self, lpmode): """ Sets the lpmode (low power mode) of SFP @@ -345,14 +572,38 @@ def set_lpmode(self, lpmode): Returns: A boolean, True if lpmode is set successfully, False if not """ - print('\nNotice: please set port admin status to down before setting power mode, ignore this message if already set') - file_path = SFP_SDK_MODULE_SYSFS_ROOT_TEMPLATE.format(self.sdk_index) + SFP_SYSFS_POWER_MODE_POLICY - target_admin_mode = POWER_MODE_POLICY_AUTO if lpmode else POWER_MODE_POLICY_HIGH - current_admin_mode = utils.read_int_from_file(file_path) - if current_admin_mode == target_admin_mode: - return True + if utils.is_host(): + # To avoid performance issue, + # call class level method to avoid initialize the whole sonic platform API + set_lpmode_code = 'from sonic_platform import sfp;\n' \ + 'with sfp.SdkHandleContext() as sdk_handle:' \ + 'print(sfp.SFP._set_lpmode({}, sdk_handle, {}, {}))' \ + .format('True' if lpmode else 'False', self.sdk_index, self.slot_id) + lpm_cmd = ["docker", "exec", "pmon", "python3", "-c", set_lpmode_code] + + # Set LPM + try: + output = subprocess.check_output(lpm_cmd, universal_newlines=True) + return 'True' in output + except subprocess.CalledProcessError as e: + print("Error! Unable to set LPM for {}, rc = {}, err msg: {}".format(self.sdk_index, e.returncode, e.output)) + return False + else: + return self._set_lpmode(lpmode, self.sdk_handle, self.sdk_index, self.slot_id) + - return utils.write_file(file_path, str(target_admin_mode)) + @classmethod + def _set_lpmode(cls, lpmode, sdk_handle, sdk_index, slot_id): + log_port_list = cls.get_logical_ports(sdk_handle, sdk_index, slot_id) + sdk_lpmode = SX_MGMT_PHY_MOD_PWR_MODE_LOW_E if lpmode else SX_MGMT_PHY_MOD_PWR_MODE_AUTO_E + cls._set_lpmode_raw(sdk_handle, + sdk_index, + slot_id, + log_port_list, + SX_MGMT_PHY_MOD_PWR_ATTR_PWR_MODE_E, + sdk_lpmode) + logger.log_info("{} low power mode for module {}, slot {}".format("Enabled" if lpmode else "Disabled", sdk_index, slot_id)) + return True def is_replaceable(self): """ @@ -552,6 +803,7 @@ def __init__(self, sfp_index): def get_presence(self): """ Retrieves the presence of the device + For RJ45 ports, it always return True Returns: bool: True if device is present, False if not diff --git a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py index 4f5d4f160008..b9edc6838998 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py @@ -55,6 +55,7 @@ def test_sfp_index(self, mock_max_port): assert sfp.index == 5 @mock.patch('sonic_platform.sfp.SFP.read_eeprom', mock.MagicMock(return_value=None)) + @mock.patch('sonic_platform.sfp.SFP.shared_sdk_handle', mock.MagicMock(return_value=2)) @mock.patch('sonic_platform.sfp.SFP._get_module_info') @mock.patch('sonic_platform.chassis.Chassis.get_num_sfps', mock.MagicMock(return_value=2)) @mock.patch('sonic_platform.chassis.extract_RJ45_ports_index', mock.MagicMock(return_value=[])) @@ -142,6 +143,14 @@ def test_sfp_read_eeprom(self, mock_get_page): handle.read.side_effect = OSError('') assert sfp.read_eeprom(0, 1) is None + @mock.patch('sonic_platform.sfp.SFP._fetch_port_status') + def test_is_port_admin_status_up(self, mock_port_status): + mock_port_status.return_value = (0, True) + assert SFP.is_port_admin_status_up(None, None) + + mock_port_status.return_value = (0, False) + assert not SFP.is_port_admin_status_up(None, None) + @mock.patch('sonic_platform.sfp.SFP._get_eeprom_path', mock.MagicMock(return_value = None)) @mock.patch('sonic_platform.sfp.SFP._get_sfp_type_str') def test_is_write_protected(self, mock_get_type_str): @@ -247,27 +256,6 @@ def test_reset(self, mock_write): assert sfp.reset() mock_write.assert_called_with('/sys/module/sx_core/asic0/module0/reset', '1') - @mock.patch('sonic_platform.utils.read_int_from_file') - def test_get_lpmode(self, mock_read_int): - sfp = SFP(0) - mock_read_int.return_value = 1 - assert sfp.get_lpmode() - mock_read_int.assert_called_with('/sys/module/sx_core/asic0/module0/power_mode') - - mock_read_int.return_value = 2 - assert not sfp.get_lpmode() - - @mock.patch('sonic_platform.utils.write_file') - @mock.patch('sonic_platform.utils.read_int_from_file') - def test_set_lpmode(self, mock_read_int, mock_write): - sfp = SFP(0) - mock_read_int.return_value = 1 - assert sfp.set_lpmode(False) - assert mock_write.call_count == 0 - - assert sfp.set_lpmode(True) - mock_write.assert_called_with('/sys/module/sx_core/asic0/module0/power_mode_policy', '2') - @mock.patch('sonic_platform.sfp.SFP.read_eeprom') def test_get_xcvr_api(self, mock_read): sfp = SFP(0) @@ -289,3 +277,25 @@ def test_rj45_basic(self): assert sfp.get_transceiver_bulk_status() assert sfp.get_transceiver_threshold_info() sfp.reinit() + + @mock.patch('sonic_platform.utils.is_host', mock.MagicMock(side_effect = [True, True, False, False])) + @mock.patch('subprocess.check_output', mock.MagicMock(side_effect = ['True', 'False'])) + @mock.patch('sonic_platform.sfp.SFP._get_lpmode', mock.MagicMock(side_effect = [True, False])) + @mock.patch('sonic_platform.sfp.SFP.sdk_handle', mock.MagicMock(return_value = None)) + def test_get_lpmode(self): + sfp = SFP(0) + assert sfp.get_lpmode() + assert not sfp.get_lpmode() + assert sfp.get_lpmode() + assert not sfp.get_lpmode() + + @mock.patch('sonic_platform.utils.is_host', mock.MagicMock(side_effect = [True, True, False, False])) + @mock.patch('subprocess.check_output', mock.MagicMock(side_effect = ['True', 'False'])) + @mock.patch('sonic_platform.sfp.SFP._set_lpmode', mock.MagicMock(side_effect = [True, False])) + @mock.patch('sonic_platform.sfp.SFP.sdk_handle', mock.MagicMock(return_value = None)) + def test_set_lpmode(self): + sfp = SFP(0) + assert sfp.set_lpmode(True) + assert not sfp.set_lpmode(True) + assert sfp.set_lpmode(False) + assert not sfp.set_lpmode(False) From e86ceaac907dd2f3d72ebf34417a09ef014dd567 Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Mon, 27 Nov 2023 05:32:39 -0800 Subject: [PATCH 007/419] [FRR]Fixing CVEs CVE-2023-46752 CVE-2023-46753 CVE-2023-47234 CVE-2023-47235 (#17259) Why I did it Fixing CVEs CVE-2023-46752 CVE-2023-46753 CVE-2023-47234 CVE-2023-47235 Work item tracking Microsoft ADO (number only): How I did it Porting the fixes in the below PRs FRRouting/frr#14645 FRRouting/frr#14716 How to verify it Running regression --- ...tory-attributes-more-carefully-for-U.patch | 112 +++++++++++++++++ ...EACH_NLRI-malformed-packets-with-ses.patch | 118 ++++++++++++++++++ ...s-withdrawn-to-avoid-unwanted-handli.patch | 106 ++++++++++++++++ ...ling-NLRIs-if-we-received-MP_UNREACH.patch | 88 +++++++++++++ src/sonic-frr/patch/series | 4 + 5 files changed, 428 insertions(+) create mode 100644 src/sonic-frr/patch/0028-bgpd-Check-mandatory-attributes-more-carefully-for-U.patch create mode 100644 src/sonic-frr/patch/0029-bgpd-Handle-MP_REACH_NLRI-malformed-packets-with-ses.patch create mode 100644 src/sonic-frr/patch/0030-bgpd-Treat-EOR-as-withdrawn-to-avoid-unwanted-handli.patch create mode 100644 src/sonic-frr/patch/0031-bgpd-Ignore-handling-NLRIs-if-we-received-MP_UNREACH.patch diff --git a/src/sonic-frr/patch/0028-bgpd-Check-mandatory-attributes-more-carefully-for-U.patch b/src/sonic-frr/patch/0028-bgpd-Check-mandatory-attributes-more-carefully-for-U.patch new file mode 100644 index 000000000000..7dbf3a85e738 --- /dev/null +++ b/src/sonic-frr/patch/0028-bgpd-Check-mandatory-attributes-more-carefully-for-U.patch @@ -0,0 +1,112 @@ +From fcc818160be57a1304481402c08962454e1dee5b Mon Sep 17 00:00:00 2001 +From: Donatas Abraitis +Date: Mon, 23 Oct 2023 23:34:10 +0300 +Subject: [PATCH 1/4] bgpd: Check mandatory attributes more carefully for + UPDATE message + +If we send a crafted BGP UPDATE message without mandatory attributes, we do +not check if the length of the path attributes is zero or not. We only check +if attr->flag is at least set or not. Imagine we send only unknown transit +attribute, then attr->flag is always 0. Also, this is true only if graceful-restart +capability is received. + +A crash: + +``` +bgpd[7834]: [TJ23Y-GY0RH] 127.0.0.1 Unknown attribute is received (type 31, length 16) +bgpd[7834]: [PCFFM-WMARW] 127.0.0.1(donatas-pc) rcvd UPDATE wlen 0 attrlen 20 alen 17 +BGP[7834]: Received signal 11 at 1698089639 (si_addr 0x0, PC 0x55eefd375b4a); aborting... +BGP[7834]: /usr/local/lib/libfrr.so.0(zlog_backtrace_sigsafe+0x6d) [0x7f3205ca939d] +BGP[7834]: /usr/local/lib/libfrr.so.0(zlog_signal+0xf3) [0x7f3205ca9593] +BGP[7834]: /usr/local/lib/libfrr.so.0(+0xf5181) [0x7f3205cdd181] +BGP[7834]: /lib/x86_64-linux-gnu/libpthread.so.0(+0x12980) [0x7f3204ff3980] +BGP[7834]: /usr/lib/frr/bgpd(+0x18ab4a) [0x55eefd375b4a] +BGP[7834]: /usr/local/lib/libfrr.so.0(route_map_apply_ext+0x310) [0x7f3205cd1290] +BGP[7834]: /usr/lib/frr/bgpd(+0x163610) [0x55eefd34e610] +BGP[7834]: /usr/lib/frr/bgpd(bgp_update+0x9a5) [0x55eefd35c1d5] +BGP[7834]: /usr/lib/frr/bgpd(bgp_nlri_parse_ip+0xb7) [0x55eefd35e867] +BGP[7834]: /usr/lib/frr/bgpd(+0x1555e6) [0x55eefd3405e6] +BGP[7834]: /usr/lib/frr/bgpd(bgp_process_packet+0x747) [0x55eefd345597] +BGP[7834]: /usr/local/lib/libfrr.so.0(event_call+0x83) [0x7f3205cef4a3] +BGP[7834]: /usr/local/lib/libfrr.so.0(frr_run+0xc0) [0x7f3205ca10a0] +BGP[7834]: /usr/lib/frr/bgpd(main+0x409) [0x55eefd2dc979] +``` + +Sending: + +``` +import socket +import time + +OPEN = (b"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" +b"\xff\xff\x00\x62\x01\x04\xfd\xea\x00\x5a\x0a\x00\x00\x01\x45\x02" +b"\x06\x01\x04\x00\x01\x00\x01\x02\x02\x02\x00\x02\x02\x46\x00\x02" +b"\x06\x41\x04\x00\x00\xfd\xea\x02\x02\x06\x00\x02\x06\x45\x04\x00" +b"\x01\x01\x03\x02\x0e\x49\x0c\x0a\x64\x6f\x6e\x61\x74\x61\x73\x2d" +b"\x70\x63\x00\x02\x04\x40\x02\x00\x78\x02\x09\x47\x07\x00\x01\x01" +b"\x80\x00\x00\x00") + +KEEPALIVE = (b"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" +b"\xff\xff\xff\xff\xff\xff\x00\x13\x04") + +UPDATE = bytearray.fromhex("ffffffffffffffffffffffffffffffff003c0200000014ff1f001000040146464646460004464646464646664646f50d05800100010200ffff000000") + +s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +s.connect(('127.0.0.2', 179)) +s.send(OPEN) +data = s.recv(1024) +s.send(KEEPALIVE) +data = s.recv(1024) +s.send(UPDATE) +data = s.recv(1024) +time.sleep(1000) +s.close() +``` + +Reported-by: Iggy Frankovic +Signed-off-by: Donatas Abraitis +(cherry picked from commit d8482bf011cb2b173e85b65b4bf3d5061250cdb9) + +diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c +index ee20da3326..3a2d93ccd9 100644 +--- a/bgpd/bgp_attr.c ++++ b/bgpd/bgp_attr.c +@@ -3429,13 +3429,15 @@ bgp_attr_unknown(struct bgp_attr_parser_args *args) + } + + /* Well-known attribute check. */ +-static int bgp_attr_check(struct peer *peer, struct attr *attr) ++static int bgp_attr_check(struct peer *peer, struct attr *attr, ++ bgp_size_t length) + { + uint8_t type = 0; + + /* BGP Graceful-Restart End-of-RIB for IPv4 unicast is signaled as an + * empty UPDATE. */ +- if (CHECK_FLAG(peer->cap, PEER_CAP_RESTART_RCV) && !attr->flag) ++ if (CHECK_FLAG(peer->cap, PEER_CAP_RESTART_RCV) && !attr->flag && ++ !length) + return BGP_ATTR_PARSE_PROCEED; + + /* "An UPDATE message that contains the MP_UNREACH_NLRI is not required +@@ -3487,7 +3489,7 @@ enum bgp_attr_parse_ret bgp_attr_parse(struct peer *peer, struct attr *attr, + enum bgp_attr_parse_ret ret; + uint8_t flag = 0; + uint8_t type = 0; +- bgp_size_t length; ++ bgp_size_t length = 0; + uint8_t *startp, *endp; + uint8_t *attr_endp; + uint8_t seen[BGP_ATTR_BITMAP_SIZE]; +@@ -3812,7 +3814,7 @@ enum bgp_attr_parse_ret bgp_attr_parse(struct peer *peer, struct attr *attr, + } + + /* Check all mandatory well-known attributes are present */ +- ret = bgp_attr_check(peer, attr); ++ ret = bgp_attr_check(peer, attr, length); + if (ret < 0) + goto done; + +-- +2.17.1 + diff --git a/src/sonic-frr/patch/0029-bgpd-Handle-MP_REACH_NLRI-malformed-packets-with-ses.patch b/src/sonic-frr/patch/0029-bgpd-Handle-MP_REACH_NLRI-malformed-packets-with-ses.patch new file mode 100644 index 000000000000..a1f848f12706 --- /dev/null +++ b/src/sonic-frr/patch/0029-bgpd-Handle-MP_REACH_NLRI-malformed-packets-with-ses.patch @@ -0,0 +1,118 @@ +From 971f8684efceb2453accc5dcb5cbd8e4266c906d Mon Sep 17 00:00:00 2001 +From: Donatas Abraitis +Date: Fri, 20 Oct 2023 17:49:18 +0300 +Subject: [PATCH 2/4] bgpd: Handle MP_REACH_NLRI malformed packets with session + reset + +Avoid crashing bgpd. + +``` +(gdb) +bgp_mp_reach_parse (args=, mp_update=0x7fffffffe140) at bgpd/bgp_attr.c:2341 +2341 stream_get(&attr->mp_nexthop_global, s, IPV6_MAX_BYTELEN); +(gdb) +stream_get (dst=0x7fffffffe1ac, s=0x7ffff0006e80, size=16) at lib/stream.c:320 +320 { +(gdb) +321 STREAM_VERIFY_SANE(s); +(gdb) +323 if (STREAM_READABLE(s) < size) { +(gdb) +34 return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest)); +(gdb) + +Thread 1 "bgpd" received signal SIGSEGV, Segmentation fault. +0x00005555556e37be in route_set_aspath_prepend (rule=0x555555aac0d0, prefix=0x7fffffffe050, + object=0x7fffffffdb00) at bgpd/bgp_routemap.c:2282 +2282 if (path->attr->aspath->refcnt) +(gdb) +``` + +With the configuration: + +``` + neighbor 127.0.0.1 remote-as external + neighbor 127.0.0.1 passive + neighbor 127.0.0.1 ebgp-multihop + neighbor 127.0.0.1 disable-connected-check + neighbor 127.0.0.1 update-source 127.0.0.2 + neighbor 127.0.0.1 timers 3 90 + neighbor 127.0.0.1 timers connect 1 + address-family ipv4 unicast + redistribute connected + neighbor 127.0.0.1 default-originate + neighbor 127.0.0.1 route-map RM_IN in + exit-address-family +! +route-map RM_IN permit 10 + set as-path prepend 200 +exit +``` + +Reported-by: Iggy Frankovic +Signed-off-by: Donatas Abraitis +(cherry picked from commit b08afc81c60607a4f736f418f2e3eb06087f1a35) + +diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c +index 3a2d93ccd9..a3fee07058 100644 +--- a/bgpd/bgp_attr.c ++++ b/bgpd/bgp_attr.c +@@ -2418,7 +2418,7 @@ int bgp_mp_reach_parse(struct bgp_attr_parser_args *args, + + mp_update->afi = afi; + mp_update->safi = safi; +- return BGP_ATTR_PARSE_EOR; ++ return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_MAL_ATTR, 0); + } + + mp_update->afi = afi; +@@ -3739,10 +3739,6 @@ enum bgp_attr_parse_ret bgp_attr_parse(struct peer *peer, struct attr *attr, + goto done; + } + +- if (ret == BGP_ATTR_PARSE_EOR) { +- goto done; +- } +- + if (ret == BGP_ATTR_PARSE_ERROR) { + flog_warn(EC_BGP_ATTRIBUTE_PARSE_ERROR, + "%s: Attribute %s, parse error", peer->host, +diff --git a/bgpd/bgp_attr.h b/bgpd/bgp_attr.h +index 33283f4bf6..ba8d4fc735 100644 +--- a/bgpd/bgp_attr.h ++++ b/bgpd/bgp_attr.h +@@ -379,7 +379,6 @@ enum bgp_attr_parse_ret { + /* only used internally, send notify + convert to BGP_ATTR_PARSE_ERROR + */ + BGP_ATTR_PARSE_ERROR_NOTIFYPLS = -3, +- BGP_ATTR_PARSE_EOR = -4, + }; + + struct bpacket_attr_vec_arr; +diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c +index a02d548941..5e0312a72d 100644 +--- a/bgpd/bgp_packet.c ++++ b/bgpd/bgp_packet.c +@@ -2060,8 +2060,7 @@ static int bgp_update_receive(struct peer *peer, bgp_size_t size) + * Non-MP IPv4/Unicast EoR is a completely empty UPDATE + * and MP EoR should have only an empty MP_UNREACH + */ +- if ((!update_len && !withdraw_len && nlris[NLRI_MP_UPDATE].length == 0) +- || (attr_parse_ret == BGP_ATTR_PARSE_EOR)) { ++ if (!update_len && !withdraw_len && nlris[NLRI_MP_UPDATE].length == 0) { + afi_t afi = 0; + safi_t safi; + struct graceful_restart_info *gr_info; +@@ -2082,9 +2081,6 @@ static int bgp_update_receive(struct peer *peer, bgp_size_t size) + && nlris[NLRI_MP_WITHDRAW].length == 0) { + afi = nlris[NLRI_MP_WITHDRAW].afi; + safi = nlris[NLRI_MP_WITHDRAW].safi; +- } else if (attr_parse_ret == BGP_ATTR_PARSE_EOR) { +- afi = nlris[NLRI_MP_UPDATE].afi; +- safi = nlris[NLRI_MP_UPDATE].safi; + } + + if (afi && peer->afc[afi][safi]) { +-- +2.17.1 + diff --git a/src/sonic-frr/patch/0030-bgpd-Treat-EOR-as-withdrawn-to-avoid-unwanted-handli.patch b/src/sonic-frr/patch/0030-bgpd-Treat-EOR-as-withdrawn-to-avoid-unwanted-handli.patch new file mode 100644 index 000000000000..4639e8c87cd4 --- /dev/null +++ b/src/sonic-frr/patch/0030-bgpd-Treat-EOR-as-withdrawn-to-avoid-unwanted-handli.patch @@ -0,0 +1,106 @@ +From 621f2efd64b305e96bb2941110e93bfbe5f9eda2 Mon Sep 17 00:00:00 2001 +From: Donatas Abraitis +Date: Fri, 27 Oct 2023 11:56:45 +0300 +Subject: [PATCH 3/4] bgpd: Treat EOR as withdrawn to avoid unwanted handling + of malformed attrs + +Treat-as-withdraw, otherwise if we just ignore it, we will pass it to be +processed as a normal UPDATE without mandatory attributes, that could lead +to harmful behavior. In this case, a crash for route-maps with the configuration +such as: + +``` +router bgp 65001 + no bgp ebgp-requires-policy + neighbor 127.0.0.1 remote-as external + neighbor 127.0.0.1 passive + neighbor 127.0.0.1 ebgp-multihop + neighbor 127.0.0.1 disable-connected-check + neighbor 127.0.0.1 update-source 127.0.0.2 + neighbor 127.0.0.1 timers 3 90 + neighbor 127.0.0.1 timers connect 1 + ! + address-family ipv4 unicast + neighbor 127.0.0.1 addpath-tx-all-paths + neighbor 127.0.0.1 default-originate + neighbor 127.0.0.1 route-map RM_IN in + exit-address-family +exit +! +route-map RM_IN permit 10 + set as-path prepend 200 +exit +``` + +Send a malformed optional transitive attribute: + +``` +import socket +import time + +OPEN = (b"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" +b"\xff\xff\x00\x62\x01\x04\xfd\xea\x00\x5a\x0a\x00\x00\x01\x45\x02" +b"\x06\x01\x04\x00\x01\x00\x01\x02\x02\x02\x00\x02\x02\x46\x00\x02" +b"\x06\x41\x04\x00\x00\xfd\xea\x02\x02\x06\x00\x02\x06\x45\x04\x00" +b"\x01\x01\x03\x02\x0e\x49\x0c\x0a\x64\x6f\x6e\x61\x74\x61\x73\x2d" +b"\x70\x63\x00\x02\x04\x40\x02\x00\x78\x02\x09\x47\x07\x00\x01\x01" +b"\x80\x00\x00\x00") + +KEEPALIVE = (b"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" +b"\xff\xff\xff\xff\xff\xff\x00\x13\x04") + +UPDATE = bytearray.fromhex("ffffffffffffffffffffffffffffffff002b0200000003c0ff00010100eb00ac100b0b001ad908ac100b0b") + +s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +s.connect(('127.0.0.2', 179)) +s.send(OPEN) +data = s.recv(1024) +s.send(KEEPALIVE) +data = s.recv(1024) +s.send(UPDATE) +data = s.recv(1024) +time.sleep(100) +s.close() +``` + +Reported-by: Iggy Frankovic +Signed-off-by: Donatas Abraitis + +diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c +index a3fee07058..bdf078e7c8 100644 +--- a/bgpd/bgp_attr.c ++++ b/bgpd/bgp_attr.c +@@ -3435,10 +3435,13 @@ static int bgp_attr_check(struct peer *peer, struct attr *attr, + uint8_t type = 0; + + /* BGP Graceful-Restart End-of-RIB for IPv4 unicast is signaled as an +- * empty UPDATE. */ ++ * empty UPDATE. Treat-as-withdraw, otherwise if we just ignore it, ++ * we will pass it to be processed as a normal UPDATE without mandatory ++ * attributes, that could lead to harmful behavior. ++ */ + if (CHECK_FLAG(peer->cap, PEER_CAP_RESTART_RCV) && !attr->flag && + !length) +- return BGP_ATTR_PARSE_PROCEED; ++ return BGP_ATTR_PARSE_WITHDRAW; + + /* "An UPDATE message that contains the MP_UNREACH_NLRI is not required + to carry any other path attributes.", though if MP_REACH_NLRI or NLRI +@@ -3866,7 +3869,13 @@ done: + aspath_unintern(&as4_path); + + transit = bgp_attr_get_transit(attr); +- if (ret != BGP_ATTR_PARSE_ERROR) { ++ /* If we received an UPDATE with mandatory attributes, then ++ * the unrecognized transitive optional attribute of that ++ * path MUST be passed. Otherwise, it's an error, and from ++ * security perspective it might be very harmful if we continue ++ * here with the unrecognized attributes. ++ */ ++ if (ret == BGP_ATTR_PARSE_PROCEED) { + /* Finally intern unknown attribute. */ + if (transit) + bgp_attr_set_transit(attr, transit_intern(transit)); +-- +2.17.1 + diff --git a/src/sonic-frr/patch/0031-bgpd-Ignore-handling-NLRIs-if-we-received-MP_UNREACH.patch b/src/sonic-frr/patch/0031-bgpd-Ignore-handling-NLRIs-if-we-received-MP_UNREACH.patch new file mode 100644 index 000000000000..12f1d909509f --- /dev/null +++ b/src/sonic-frr/patch/0031-bgpd-Ignore-handling-NLRIs-if-we-received-MP_UNREACH.patch @@ -0,0 +1,88 @@ +From 4f75184ed110ffb002b0125797e0395cfa6e9ce8 Mon Sep 17 00:00:00 2001 +From: Donatas Abraitis +Date: Sun, 29 Oct 2023 22:44:45 +0200 +Subject: [PATCH 4/4] bgpd: Ignore handling NLRIs if we received + MP_UNREACH_NLRI + +If we receive MP_UNREACH_NLRI, we should stop handling remaining NLRIs if +no mandatory path attributes received. + +In other words, if MP_UNREACH_NLRI received, the remaining NLRIs should be handled +as a new data, but without mandatory attributes, it's a malformed packet. + +In normal case, this MUST not happen at all, but to avoid crashing bgpd, we MUST +handle that. + +Reported-by: Iggy Frankovic +Signed-off-by: Donatas Abraitis + +diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c +index bdf078e7c8..43a3cc91af 100644 +--- a/bgpd/bgp_attr.c ++++ b/bgpd/bgp_attr.c +@@ -3443,15 +3443,6 @@ static int bgp_attr_check(struct peer *peer, struct attr *attr, + !length) + return BGP_ATTR_PARSE_WITHDRAW; + +- /* "An UPDATE message that contains the MP_UNREACH_NLRI is not required +- to carry any other path attributes.", though if MP_REACH_NLRI or NLRI +- are present, it should. Check for any other attribute being present +- instead. +- */ +- if ((!CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_MP_REACH_NLRI)) && +- CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_MP_UNREACH_NLRI)))) +- return BGP_ATTR_PARSE_PROCEED; +- + if (!CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_ORIGIN))) + type = BGP_ATTR_ORIGIN; + +@@ -3470,6 +3461,16 @@ static int bgp_attr_check(struct peer *peer, struct attr *attr, + && !CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_LOCAL_PREF))) + type = BGP_ATTR_LOCAL_PREF; + ++ /* An UPDATE message that contains the MP_UNREACH_NLRI is not required ++ * to carry any other path attributes. Though if MP_REACH_NLRI or NLRI ++ * are present, it should. Check for any other attribute being present ++ * instead. ++ */ ++ if (!CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_MP_REACH_NLRI)) && ++ CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_MP_UNREACH_NLRI))) ++ return type ? BGP_ATTR_PARSE_MISSING_MANDATORY ++ : BGP_ATTR_PARSE_PROCEED; ++ + /* If any of the well-known mandatory attributes are not present + * in an UPDATE message, then "treat-as-withdraw" MUST be used. + */ +diff --git a/bgpd/bgp_attr.h b/bgpd/bgp_attr.h +index ba8d4fc735..275965fe62 100644 +--- a/bgpd/bgp_attr.h ++++ b/bgpd/bgp_attr.h +@@ -379,6 +379,7 @@ enum bgp_attr_parse_ret { + /* only used internally, send notify + convert to BGP_ATTR_PARSE_ERROR + */ + BGP_ATTR_PARSE_ERROR_NOTIFYPLS = -3, ++ BGP_ATTR_PARSE_MISSING_MANDATORY = -4, + }; + + struct bpacket_attr_vec_arr; +diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c +index 5e0312a72d..59f895ac58 100644 +--- a/bgpd/bgp_packet.c ++++ b/bgpd/bgp_packet.c +@@ -1983,7 +1983,12 @@ static int bgp_update_receive(struct peer *peer, bgp_size_t size) + /* Network Layer Reachability Information. */ + update_len = end - stream_pnt(s); + +- if (update_len && attribute_len) { ++ /* If we received MP_UNREACH_NLRI attribute, but also NLRIs, then ++ * NLRIs should be handled as a new data. Though, if we received ++ * NLRIs without mandatory attributes, they should be ignored. ++ */ ++ if (update_len && attribute_len && ++ attr_parse_ret != BGP_ATTR_PARSE_MISSING_MANDATORY) { + /* Set NLRI portion to structure. */ + nlris[NLRI_UPDATE].afi = AFI_IP; + nlris[NLRI_UPDATE].safi = SAFI_UNICAST; +-- +2.17.1 + diff --git a/src/sonic-frr/patch/series b/src/sonic-frr/patch/series index c057585d64fe..a2689c1529ca 100644 --- a/src/sonic-frr/patch/series +++ b/src/sonic-frr/patch/series @@ -27,3 +27,7 @@ cross-compile-changes.patch 0025-bgpd-Use-treat-as-withdraw-for-tunnel-encapsulation-.patch 0026-zebra-Add-encap-type-when-building-packet-for-FPM.patch 0027-zebra-Fix-non-notification-of-better-admin-won.patch +0028-bgpd-Check-mandatory-attributes-more-carefully-for-U.patch +0029-bgpd-Handle-MP_REACH_NLRI-malformed-packets-with-ses.patch +0030-bgpd-Treat-EOR-as-withdrawn-to-avoid-unwanted-handli.patch +0031-bgpd-Ignore-handling-NLRIs-if-we-received-MP_UNREACH.patch From f48e8b61cfecd5d191d80aa7620b7341c43a8abf Mon Sep 17 00:00:00 2001 From: Yaqiang Zhu Date: Mon, 27 Nov 2023 12:30:01 -0500 Subject: [PATCH 008/419] [dhcp_relay] Use dhcprelayd to manage critical processes (#17236) Modify j2 template files in docker-dhcp-relay. Add dhcprelayd to group dhcp-relay instead of isc-dhcp-relay-VlanXXX, which would make dhcprelayd to become critical process. In dhcprelayd, subscribe FEATURE table to check whether dhcp_server feature is enabled. 2.1 If dhcp_server feature is disabled, means we need original dhcp_relay functionality, dhcprelayd would do nothing. Because dhcrelay/dhcpmon configuration is generated in supervisord configuration, they will automatically run. 2.2 If dhcp_server feature is enabled, dhcprelayd will stop dhcpmon/dhcrelay processes started by supervisord and subscribe dhcp_server related tables in config_db to start dhcpmon/dhcrelay processes. 2.3 While dhcprelayd running, it will regularly check feature status (by default per 5s) and would encounter below 4 state change about dhcp_server feature: A) disabled -> enabled In this scenario, dhcprelayd will subscribe dhcp_server related tables and stop dhcpmon/dhcrelay processes started by supervisord and start new pair of dhcpmon/dhcrelay processes. After this, dhcpmon/dhcrelay processes are totally managed by dhcprelayd. B) enabled -> enabled In this scenaro, dhcprelayd will monitor db changes in dhcp_server related tables to determine whether to restart dhcpmon/dhrelay processes. C) enabled -> disabled In this scenario, dhcprelayd would unsubscribe dhcp_server related tables and kill dhcpmon/dhcrelay processes started by itself. And then dhcprelayd will start dhcpmon/dhcrelay processes via supervisorctl. D) disabled -> disabled dhcprelayd will check whether dhcrelay processes running status consistent with supervisord configuration file. If they are not consistent, dhcprelayd will kill itself, then dhcp_relay container will stop because dhcprelayd is critical process. --- dockers/docker-dhcp-relay/Dockerfile.j2 | 10 +- .../docker-dhcp-relay/dhcp-relay.programs.j2 | 10 +- .../docker-dhcp-relay.supervisord.conf.j2 | 13 +- rules/docker-dhcp-relay.mk | 2 - rules/sonic-dhcp-server.mk | 2 - .../dhcp-relay-enable-dhcp-server-sample.json | 7 - ...-relay-enable-dhcp-server.supervisord.conf | 1 - ...r-dhcp-relay-no-ip-helper.supervisord.conf | 12 +- .../py2/docker-dhcp-relay.supervisord.conf | 12 +- ...r-dhcp-relay-no-ip-helper.supervisord.conf | 12 +- .../py3/docker-dhcp-relay.supervisord.conf | 12 +- src/sonic-config-engine/tests/test_j2files.py | 20 --- .../dhcp_server/common/dhcp_db_monitor.py | 94 +++++++++--- .../dhcp_server/common/utils.py | 16 ++ .../dhcp_server/dhcprelayd/dhcprelayd.py | 143 ++++++++++++++++-- src/sonic-dhcp-server/tests/common_utils.py | 5 + .../test_data/dhcp_db_monitor_test_data.json | 47 ++++++ .../tests/test_data/supervisor.conf} | 32 +++- .../tests/test_dhcp_db_monitor.py | 49 +++++- .../tests/test_dhcprelayd.py | 117 +++++++++++++- src/sonic-dhcp-server/tests/test_utils.py | 9 +- 21 files changed, 506 insertions(+), 119 deletions(-) delete mode 100644 src/sonic-config-engine/tests/dhcp-relay-enable-dhcp-server-sample.json delete mode 120000 src/sonic-config-engine/tests/sample_output/py2/docker-dhcp-relay-enable-dhcp-server.supervisord.conf rename src/{sonic-config-engine/tests/sample_output/py3/docker-dhcp-relay-enable-dhcp-server.supervisord.conf => sonic-dhcp-server/tests/test_data/supervisor.conf} (61%) diff --git a/dockers/docker-dhcp-relay/Dockerfile.j2 b/dockers/docker-dhcp-relay/Dockerfile.j2 index ddcc23819bf5..8b0753f288c3 100644 --- a/dockers/docker-dhcp-relay/Dockerfile.j2 +++ b/dockers/docker-dhcp-relay/Dockerfile.j2 @@ -13,13 +13,11 @@ ENV IMAGE_VERSION=$image_version # Update apt's cache of available packages RUN apt-get update -RUN apt-get install -y libjsoncpp-dev {%- if INCLUDE_DHCP_SERVER == "y" %}\ - python3-dev \ - build-essential{%- endif %} +RUN apt-get install -y libjsoncpp-dev \ + python3-dev \ + build-essential -{% if INCLUDE_DHCP_SERVER == "y" -%} RUN pip3 install psutil -{%- endif %} RUN apt-get install -y libjsoncpp-dev @@ -40,10 +38,8 @@ RUN apt-get install -y libjsoncpp-dev {% endif %} # Clean up -{% if INCLUDE_DHCP_SERVER == "y" -%} RUN apt-get remove -y build-essential \ python3-dev -{%- endif %} RUN apt-get clean -y && \ apt-get autoclean -y && \ apt-get autoremove -y && \ diff --git a/dockers/docker-dhcp-relay/dhcp-relay.programs.j2 b/dockers/docker-dhcp-relay/dhcp-relay.programs.j2 index b1295a803be8..94f6adf76510 100644 --- a/dockers/docker-dhcp-relay/dhcp-relay.programs.j2 +++ b/dockers/docker-dhcp-relay/dhcp-relay.programs.j2 @@ -1,18 +1,10 @@ [group:dhcp-relay] -programs= +programs=dhcprelayd, {%- set relay_for_ipv6 = { 'flag': False } %} {%- set add_preceding_comma = { 'flag': False } %} {% if dhcp_server_ipv4_enabled %} -{% set _dummy = add_preceding_comma.update({'flag': True}) %} -dhcprelayd {%- endif %} {% for vlan_name in VLAN_INTERFACE %} -{# Append DHCPv4 agents #} -{% if not dhcp_server_ipv4_enabled and VLAN and vlan_name in VLAN and 'dhcp_servers' in VLAN[vlan_name] and VLAN[vlan_name]['dhcp_servers']|length > 0 %} -{% if add_preceding_comma.flag %},{% endif %} -{% set _dummy = add_preceding_comma.update({'flag': True}) %} -isc-dhcpv4-relay-{{ vlan_name }} -{%- endif %} {% if DHCP_RELAY and vlan_name in DHCP_RELAY and DHCP_RELAY[vlan_name]['dhcpv6_servers']|length > 0 %} {% set _dummy = relay_for_ipv6.update({'flag': True}) %} {%- endif %} diff --git a/dockers/docker-dhcp-relay/docker-dhcp-relay.supervisord.conf.j2 b/dockers/docker-dhcp-relay/docker-dhcp-relay.supervisord.conf.j2 index 6868fa566d9b..308997575a04 100644 --- a/dockers/docker-dhcp-relay/docker-dhcp-relay.supervisord.conf.j2 +++ b/dockers/docker-dhcp-relay/docker-dhcp-relay.supervisord.conf.j2 @@ -39,10 +39,6 @@ stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=rsyslogd:running -{% set dhcp_server_ipv4_enabled = False %} -{% if FEATURE and 'dhcp_server' in FEATURE and 'state' in FEATURE['dhcp_server'] and FEATURE['dhcp_server']['state'] == 'enabled' %} -{% set dhcp_server_ipv4_enabled = True %} -{% endif %} {# If our configuration has VLANs... #} {% if VLAN_INTERFACE %} {# Count how many VLANs require a DHCP relay agent... #} @@ -63,16 +59,14 @@ dependent_startup_wait_for=rsyslogd:running {# Create a program entry for each DHCP relay agent instance #} {% set relay_for_ipv4 = { 'flag': False } %} {% set relay_for_ipv6 = { 'flag': False } %} -{% if not dhcp_server_ipv4_enabled %} {% for vlan_name in VLAN_INTERFACE %} {% include 'dhcpv4-relay.agents.j2' %} {% endfor %} -{% endif %} {% include 'dhcpv6-relay.agents.j2' %} -{% if not dhcp_server_ipv4_enabled %} {% include 'dhcp-relay.monitors.j2' %} -{% else %} +{% endif %} +{% endif %} [program:dhcprelayd] command=/usr/local/bin/dhcprelayd priority=3 @@ -82,6 +76,3 @@ stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=start:exited -{% endif %} -{% endif %} -{% endif %} \ No newline at end of file diff --git a/rules/docker-dhcp-relay.mk b/rules/docker-dhcp-relay.mk index 6e2e5d5434b9..82b4533950ad 100644 --- a/rules/docker-dhcp-relay.mk +++ b/rules/docker-dhcp-relay.mk @@ -17,9 +17,7 @@ $(DOCKER_DHCP_RELAY)_LOAD_DOCKERS = $(DOCKER_CONFIG_ENGINE_BULLSEYE) $(DOCKER_DHCP_RELAY)_INSTALL_PYTHON_WHEELS = $(SONIC_UTILITIES_PY3) $(DOCKER_DHCP_RELAY)_INSTALL_DEBS = $(PYTHON3_SWSSCOMMON) -ifeq ($(INCLUDE_DHCP_SERVER), y) $(DOCKER_DHCP_RELAY)_PYTHON_WHEELS += $(SONIC_DHCP_SERVER_PY3) -endif $(DOCKER_DHCP_RELAY)_VERSION = 1.0.0 $(DOCKER_DHCP_RELAY)_PACKAGE_NAME = dhcp-relay diff --git a/rules/sonic-dhcp-server.mk b/rules/sonic-dhcp-server.mk index 941127204c3c..1ef05545b98a 100644 --- a/rules/sonic-dhcp-server.mk +++ b/rules/sonic-dhcp-server.mk @@ -5,6 +5,4 @@ $(SONIC_DHCP_SERVER_PY3)_SRC_PATH = $(SRC_PATH)/sonic-dhcp-server $(SONIC_DHCP_SERVER_PY3)_DEPENDS += $(SONIC_PY_COMMON_PY3) $(SONIC_DHCP_SERVER_PY3)_DEBS_DEPENDS = $(LIBSWSSCOMMON) $(PYTHON3_SWSSCOMMON) $(SONIC_DHCP_SERVER_PY3)_PYTHON_VERSION = 3 -ifeq ($(INCLUDE_DHCP_SERVER), y) SONIC_PYTHON_WHEELS += $(SONIC_DHCP_SERVER_PY3) -endif diff --git a/src/sonic-config-engine/tests/dhcp-relay-enable-dhcp-server-sample.json b/src/sonic-config-engine/tests/dhcp-relay-enable-dhcp-server-sample.json deleted file mode 100644 index c74b0dec3627..000000000000 --- a/src/sonic-config-engine/tests/dhcp-relay-enable-dhcp-server-sample.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "FEATURE": { - "dhcp_server": { - "state": "enabled" - } - } -} diff --git a/src/sonic-config-engine/tests/sample_output/py2/docker-dhcp-relay-enable-dhcp-server.supervisord.conf b/src/sonic-config-engine/tests/sample_output/py2/docker-dhcp-relay-enable-dhcp-server.supervisord.conf deleted file mode 120000 index f814d764a9f2..000000000000 --- a/src/sonic-config-engine/tests/sample_output/py2/docker-dhcp-relay-enable-dhcp-server.supervisord.conf +++ /dev/null @@ -1 +0,0 @@ -../py3/docker-dhcp-relay-enable-dhcp-server.supervisord.conf \ No newline at end of file diff --git a/src/sonic-config-engine/tests/sample_output/py2/docker-dhcp-relay-no-ip-helper.supervisord.conf b/src/sonic-config-engine/tests/sample_output/py2/docker-dhcp-relay-no-ip-helper.supervisord.conf index a12bbef319bd..c5882ad148c7 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/docker-dhcp-relay-no-ip-helper.supervisord.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/docker-dhcp-relay-no-ip-helper.supervisord.conf @@ -40,7 +40,7 @@ dependent_startup=true dependent_startup_wait_for=rsyslogd:running [group:dhcp-relay] -programs=isc-dhcpv4-relay-Vlan1000,dhcp6relay +programs=dhcprelayd,dhcp6relay [program:isc-dhcpv4-relay-Vlan1000] command=/usr/sbin/dhcrelay -d -m discard -a %%h:%%p %%P --name-alias-map-file /tmp/port-name-alias-map.txt -id Vlan1000 -iu Vlan2000 -iu PortChannel02 -iu PortChannel03 -iu PortChannel04 -iu PortChannel01 192.0.0.1 192.0.0.2 @@ -76,4 +76,12 @@ stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=isc-dhcpv4-relay-Vlan1000:running - +[program:dhcprelayd] +command=/usr/local/bin/dhcprelayd +priority=3 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=start:exited diff --git a/src/sonic-config-engine/tests/sample_output/py2/docker-dhcp-relay.supervisord.conf b/src/sonic-config-engine/tests/sample_output/py2/docker-dhcp-relay.supervisord.conf index 6ea09feb7c30..d2b6e4a5637b 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/docker-dhcp-relay.supervisord.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/docker-dhcp-relay.supervisord.conf @@ -40,7 +40,7 @@ dependent_startup=true dependent_startup_wait_for=rsyslogd:running [group:dhcp-relay] -programs=isc-dhcpv4-relay-Vlan1000,isc-dhcpv4-relay-Vlan2000,dhcp6relay +programs=dhcprelayd,dhcp6relay [program:isc-dhcpv4-relay-Vlan1000] command=/usr/sbin/dhcrelay -d -m discard -a %%h:%%p %%P --name-alias-map-file /tmp/port-name-alias-map.txt -id Vlan1000 -iu Vlan2000 -iu PortChannel02 -iu PortChannel03 -iu PortChannel04 -iu PortChannel01 192.0.0.1 192.0.0.2 @@ -96,4 +96,12 @@ stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=isc-dhcpv4-relay-Vlan2000:running - +[program:dhcprelayd] +command=/usr/local/bin/dhcprelayd +priority=3 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=start:exited diff --git a/src/sonic-config-engine/tests/sample_output/py3/docker-dhcp-relay-no-ip-helper.supervisord.conf b/src/sonic-config-engine/tests/sample_output/py3/docker-dhcp-relay-no-ip-helper.supervisord.conf index 7d43878f267a..80a26d8e6601 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/docker-dhcp-relay-no-ip-helper.supervisord.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/docker-dhcp-relay-no-ip-helper.supervisord.conf @@ -40,7 +40,7 @@ dependent_startup=true dependent_startup_wait_for=rsyslogd:running [group:dhcp-relay] -programs=isc-dhcpv4-relay-Vlan1000,dhcp6relay +programs=dhcprelayd,dhcp6relay [program:isc-dhcpv4-relay-Vlan1000] command=/usr/sbin/dhcrelay -d -m discard -a %%h:%%p %%P --name-alias-map-file /tmp/port-name-alias-map.txt -id Vlan1000 -iu Vlan2000 -iu PortChannel01 -iu PortChannel02 -iu PortChannel03 -iu PortChannel04 192.0.0.1 192.0.0.2 @@ -76,4 +76,12 @@ stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=isc-dhcpv4-relay-Vlan1000:running - +[program:dhcprelayd] +command=/usr/local/bin/dhcprelayd +priority=3 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=start:exited diff --git a/src/sonic-config-engine/tests/sample_output/py3/docker-dhcp-relay.supervisord.conf b/src/sonic-config-engine/tests/sample_output/py3/docker-dhcp-relay.supervisord.conf index 5cdee13b3c4b..dd8371b59443 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/docker-dhcp-relay.supervisord.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/docker-dhcp-relay.supervisord.conf @@ -40,7 +40,7 @@ dependent_startup=true dependent_startup_wait_for=rsyslogd:running [group:dhcp-relay] -programs=isc-dhcpv4-relay-Vlan1000,isc-dhcpv4-relay-Vlan2000,dhcp6relay +programs=dhcprelayd,dhcp6relay [program:isc-dhcpv4-relay-Vlan1000] command=/usr/sbin/dhcrelay -d -m discard -a %%h:%%p %%P --name-alias-map-file /tmp/port-name-alias-map.txt -id Vlan1000 -iu Vlan2000 -iu PortChannel01 -iu PortChannel02 -iu PortChannel03 -iu PortChannel04 192.0.0.1 192.0.0.2 @@ -96,4 +96,12 @@ stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=isc-dhcpv4-relay-Vlan2000:running - +[program:dhcprelayd] +command=/usr/local/bin/dhcprelayd +priority=3 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=start:exited diff --git a/src/sonic-config-engine/tests/test_j2files.py b/src/sonic-config-engine/tests/test_j2files.py index 97ad63441f9e..125668f24a80 100644 --- a/src/sonic-config-engine/tests/test_j2files.py +++ b/src/sonic-config-engine/tests/test_j2files.py @@ -154,36 +154,16 @@ def test_ports_json(self): def test_dhcp_relay(self): # Test generation of wait_for_intf.sh dhc_sample_data = os.path.join(self.test_dir, "dhcp-relay-sample.json") - enable_dhcp_server_sample_data = os.path.join(self.test_dir, "dhcp-relay-enable-dhcp-server-sample.json") template_path = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-dhcp-relay', 'wait_for_intf.sh.j2') argument = ['-m', self.t0_minigraph, '-j', dhc_sample_data, '-p', self.t0_port_config, '-t', template_path] self.run_script(argument, output_file=self.output_file) self.assertTrue(utils.cmp(os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'wait_for_intf.sh'), self.output_file)) - # Test generation of docker-dhcp-relay.supervisord.conf witout dhcp_server feature entry template_path = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-dhcp-relay', 'docker-dhcp-relay.supervisord.conf.j2') argument = ['-m', self.t0_minigraph, '-p', self.t0_port_config, '-t', template_path] self.run_script(argument, output_file=self.output_file) self.assertTrue(utils.cmp(os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'docker-dhcp-relay.supervisord.conf'), self.output_file)) - # Test generation of docker-dhcp-relay.supervisord.conf with disabled dhcp_server feature - template_path = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-dhcp-relay', - 'docker-dhcp-relay.supervisord.conf.j2') - argument = ['-m', self.t0_minigraph, '-j', dhc_sample_data, '-p', self.t0_port_config, '-t', template_path] - self.run_script(argument, output_file=self.output_file) - self.assertTrue(utils.cmp(os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, - 'docker-dhcp-relay.supervisord.conf'), self.output_file)) - - # Test generation of docker-dhcp-relay.supervisord.conf with enabled dhcp_server feature - template_path = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-dhcp-relay', - 'docker-dhcp-relay.supervisord.conf.j2') - argument = ['-m', self.t0_minigraph, '-j', enable_dhcp_server_sample_data, '-p', self.t0_port_config, '-t', - template_path] - self.run_script(argument, output_file=self.output_file) - self.assertTrue(utils.cmp(os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, - 'docker-dhcp-relay-enable-dhcp-server.supervisord.conf'), - self.output_file)) - # Test generation of docker-dhcp-relay.supervisord.conf when a vlan is missing ip/ipv6 helpers template_path = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-dhcp-relay', 'docker-dhcp-relay.supervisord.conf.j2') diff --git a/src/sonic-dhcp-server/dhcp_server/common/dhcp_db_monitor.py b/src/sonic-dhcp-server/dhcp_server/common/dhcp_db_monitor.py index 799acabbcc4f..e2caab826f4f 100644 --- a/src/sonic-dhcp-server/dhcp_server/common/dhcp_db_monitor.py +++ b/src/sonic-dhcp-server/dhcp_server/common/dhcp_db_monitor.py @@ -12,6 +12,7 @@ VLAN = "VLAN" VLAN_MEMBER = "VLAN_MEMBER" VLAN_INTERFACE = "VLAN_INTERFACE" +FEATURE = "FEATURE" class ConfigDbEventChecker(object): @@ -343,6 +344,60 @@ def _process_check(self, key, op, entry, enabled_dhcp_interfaces): return False +class DhcpServerFeatureStateChecker(ConfigDbEventChecker): + """ + This event checker interested in dhcp_server feature state change in FEATURE table + """ + table_name = FEATURE + + def __init__(self, sel, db): + self.table_name = FEATURE + ConfigDbEventChecker.__init__(self, sel, db) + + def _get_parameter(self, db_snapshot): + return ConfigDbEventChecker.get_parameter_by_name(db_snapshot, "dhcp_server_feature_enabled") + + def _process_check(self, key, op, entry, dhcp_server_feature_enabled): + if key != "dhcp_server": + return False + if op == "DEL": + return dhcp_server_feature_enabled + for field, value in entry: + if field != "state": + continue + return value == "enabled" and not dhcp_server_feature_enabled or \ + value == "disabled" and dhcp_server_feature_enabled + return False + + +def _enable_monitor_checkers(checker_names, checker_dict): + """ + Enable checkers + Args: + checker_names: set of tables checker to be enable + checker_dict: check_dict in monitor + """ + for checker in checker_names: + if checker not in checker_dict: + syslog.syslog(syslog.LOG_ERR, "Cannot find checker for {} in checker_dict".format(checker)) + continue + checker_dict[checker].enable() + + +def _disable_monitor_checkers(checker_names, checker_dict): + """ + Disable checkers + Args: + checker_names: set contains name of tables need to be disable + checker_dict: check_dict in monitor + """ + for checker in checker_names: + if checker not in checker_dict: + syslog.syslog(syslog.LOG_ERR, "Cannot find checker for {} in checker_dict".format(checker)) + continue + checker_dict[checker].disable() + + class DhcpRelaydDbMonitor(object): checker_dict = {} @@ -354,17 +409,21 @@ def __init__(self, db_connector, sel, checkers, select_timeout=DEFAULT_SELECT_TI for checker in checkers: self.checker_dict[checker.get_class_name()] = checker - def enable_checker(self, checker_names): + def enable_checkers(self, checker_names): """ Enable checkers Args: checker_names: set of tables checker to be enable """ - for table in checker_names: - if table not in self.checker_dict: - syslog.syslog(syslog.LOG_ERR, "Cannot find checker for {} in checker_dict".format(table)) - continue - self.checker_dict[table].enable() + _enable_monitor_checkers(checker_names, self.checker_dict) + + def disable_checkers(self, checker_names): + """ + Disable checkers + Args: + checker_names: set contains name of tables need to be disable + """ + _disable_monitor_checkers(checker_names, self.checker_dict) def check_db_update(self, db_snapshot): """ @@ -376,10 +435,13 @@ def check_db_update(self, db_snapshot): """ state, _ = self.sel.select(self.select_timeout) if state == swsscommon.Select.TIMEOUT or state != swsscommon.Select.OBJECT: - return (False, False, False) - return (self.checker_dict["DhcpServerTableIntfEnablementEventChecker"].check_update_event(db_snapshot), - self.checker_dict["VlanTableEventChecker"].check_update_event(db_snapshot), - self.checker_dict["VlanIntfTableEventChecker"].check_update_event(db_snapshot)) + return {} + check_res = {} + for name, checker in self.checker_dict.items(): + if not checker.is_enabled(): + continue + check_res[name] = checker.check_update_event(db_snapshot) + return check_res class DhcpServdDbMonitor(object): @@ -399,11 +461,7 @@ def disable_checkers(self, checker_names): Args: checker_names: set contains name of tables need to be disable """ - for table in checker_names: - if table not in self.checker_dict: - syslog.syslog(syslog.LOG_ERR, "Cannot find checker for {} in checker_dict".format(table)) - continue - self.checker_dict[table].disable() + _disable_monitor_checkers(checker_names, self.checker_dict) def enable_checkers(self, checker_names): """ @@ -411,11 +469,7 @@ def enable_checkers(self, checker_names): Args: checker_names: set contains name of tables need to be enable """ - for table in checker_names: - if table not in self.checker_dict: - syslog.syslog(syslog.LOG_ERR, "Cannot find checker for {} in checker_dict".format(table)) - continue - self.checker_dict[table].enable() + _enable_monitor_checkers(checker_names, self.checker_dict) def check_db_update(self, db_snapshot): """ diff --git a/src/sonic-dhcp-server/dhcp_server/common/utils.py b/src/sonic-dhcp-server/dhcp_server/common/utils.py index 1b3268683c2e..c92936bfc1bd 100644 --- a/src/sonic-dhcp-server/dhcp_server/common/utils.py +++ b/src/sonic-dhcp-server/dhcp_server/common/utils.py @@ -1,4 +1,5 @@ import ipaddress +import psutil import string from swsscommon import swsscommon @@ -147,3 +148,18 @@ def _parse_table_to_dict(table): new_entry[field] = value.split(",") ret[key] = new_entry return ret + + +def get_target_process_cmds(process_name): + """ + Get running process cmds + Args: + process_name: name of process + Returns: + List of cmds list + """ + res = [] + for proc in psutil.process_iter(): + if proc.name() == process_name: + res.append(proc.cmdline()) + return res diff --git a/src/sonic-dhcp-server/dhcp_server/dhcprelayd/dhcprelayd.py b/src/sonic-dhcp-server/dhcp_server/dhcprelayd/dhcprelayd.py index fcf32fd71635..6eded1c3505a 100644 --- a/src/sonic-dhcp-server/dhcp_server/dhcprelayd/dhcprelayd.py +++ b/src/sonic-dhcp-server/dhcp_server/dhcprelayd/dhcprelayd.py @@ -2,22 +2,27 @@ # Currently if we run multiple dhcrelay processes, except for the last running process, # others will not relay dhcp_release packet. import psutil +import re import subprocess import sys import syslog import time from swsscommon import swsscommon -from dhcp_server.common.utils import DhcpDbConnector, terminate_proc +from dhcp_server.common.utils import DhcpDbConnector, terminate_proc, get_target_process_cmds from dhcp_server.common.dhcp_db_monitor import DhcpRelaydDbMonitor, DhcpServerTableIntfEnablementEventChecker, \ - VlanTableEventChecker, VlanIntfTableEventChecker + VlanTableEventChecker, VlanIntfTableEventChecker, DhcpServerFeatureStateChecker REDIS_SOCK_PATH = "/var/run/redis/redis.sock" +SUPERVISORD_CONF_PATH = "/etc/supervisor/conf.d/docker-dhcp-relay.supervisord.conf" DHCP_SERVER_IPV4_SERVER_IP = "DHCP_SERVER_IPV4_SERVER_IP" DHCP_SERVER_IPV4 = "DHCP_SERVER_IPV4" VLAN = "VLAN" DEFAULT_SELECT_TIMEOUT = 5000 # millisecond DHCP_SERVER_INTERFACE = "eth0" -DEFAULT_CHECKER = ["DhcpServerTableIntfEnablementEventChecker", "VlanTableEventChecker", "VlanIntfTableEventChecker"] +FEATURE_CHECKER = "DhcpServerFeatureStateChecker" +DHCP_SERVER_CHECKER = "DhcpServerTableIntfEnablementEventChecker" +VLAN_CHECKER = "VlanTableEventChecker" +VLAN_INTF_CHECKER = "VlanIntfTableEventChecker" KILLED_OLD = 1 NOT_KILLED = 2 NOT_FOUND_PROC = 3 @@ -25,8 +30,11 @@ class DhcpRelayd(object): enabled_dhcp_interfaces = set() + dhcp_server_feature_enabled = None + dhcp_relay_supervisor_config = {} + supervisord_conf_path = "" - def __init__(self, db_connector, db_monitor): + def __init__(self, db_connector, db_monitor, supervisord_conf_path=SUPERVISORD_CONF_PATH): """ Args: db_connector: db connector obj @@ -36,12 +44,21 @@ def __init__(self, db_connector, db_monitor): self.last_refresh_time = None self.dhcp_relayd_monitor = db_monitor self.enabled_dhcp_interfaces = set() + self.dhcp_server_feature_enabled = None + self.supervisord_conf_path = supervisord_conf_path def start(self): """ Start function """ - self.refresh_dhcrelay() + self.dhcp_relay_supervisor_config = self._get_dhcp_relay_config() + self.dhcp_server_feature_enabled = self._is_dhcp_server_enabled() + # Sleep to wait dhcrelay process start + time.sleep(5) + if self.dhcp_server_feature_enabled: + # If dhcp_server is enabled, need to stop related relay processes start by supervisord + self._execute_supervisor_dhcp_relay_process("stop") + self.dhcp_relayd_monitor.enable_checkers([DHCP_SERVER_CHECKER, VLAN_CHECKER, VLAN_INTF_CHECKER]) def refresh_dhcrelay(self, force_kill=False): """ @@ -74,13 +91,112 @@ def wait(self): Wait function, check db change here """ while True: - res = (self.dhcp_relayd_monitor.check_db_update({"enabled_dhcp_interfaces": self.enabled_dhcp_interfaces})) - (dhcp_server_res, vlan_res, vlan_intf_res) = res - # vlan ip change require kill old dhcp_relay related processes - if vlan_intf_res: - self.refresh_dhcrelay(True) - elif dhcp_server_res or vlan_res: - self.refresh_dhcrelay(False) + check_param = { + "enabled_dhcp_interfaces": self.enabled_dhcp_interfaces, + "dhcp_server_feature_enabled": self.dhcp_server_feature_enabled + } + res = (self.dhcp_relayd_monitor.check_db_update(check_param)) + dhcp_feature_statue_changed = False + if FEATURE_CHECKER in res: + dhcp_feature_statue_changed = res[FEATURE_CHECKER] + self.dhcp_server_feature_enabled = not self.dhcp_server_feature_enabled if dhcp_feature_statue_changed \ + else self.dhcp_server_feature_enabled + # If dhcp_server feature is enabled, dhcprelayd will manage dhcpmon/dhcrelay process + if self.dhcp_server_feature_enabled: + # disabled -> enabled, we need to enable dhcp_server related checkers and do refresh processes + if dhcp_feature_statue_changed: + self.dhcp_relayd_monitor.enable_checkers([DHCP_SERVER_CHECKER, VLAN_CHECKER, VLAN_INTF_CHECKER]) + # Stop dhcrelay process + self._execute_supervisor_dhcp_relay_process("stop") + self.refresh_dhcrelay() + # enabled -> enabled, just need to check dhcp_server related tables to see whether need to refresh + else: + # Check vlan_interface table change, if it changed, need to refresh with force kill + if res.get(VLAN_INTF_CHECKER, False): + self.refresh_dhcrelay(True) + elif res.get(VLAN_CHECKER, False) or res.get(DHCP_SERVER_CHECKER, False): + self.refresh_dhcrelay(False) + + # If dhcp_server feature is disabled, dhcprelayd will checke whether dhcpmon/dhcrelay processes, + # if they are not running as expected, dhcprelayd will kill itself to make dhcp_relay container restart. + else: + # enabled -> disabled, we need to disable dhcp_server related checkers and start dhcrelay/dhcpmon + # processes follow supervisord configuration + if dhcp_feature_statue_changed: + self.dhcp_relayd_monitor.disable_checkers([DHCP_SERVER_CHECKER, VLAN_CHECKER, VLAN_INTF_CHECKER]) + self._kill_exist_relay_releated_process([], "dhcpmon", True) + self._kill_exist_relay_releated_process([], "dhcrelay", True) + self._execute_supervisor_dhcp_relay_process("start") + # disabled -> disabled, to check whether dhcpmon/dhcrelay running status consistent with supervisord + # configuration + else: + self._check_dhcp_relay_processes() + + def _is_dhcp_server_enabled(self): + """ + Check whether dhcp_server feature is enabled via running config_db + Returns: + If dhcp_server feature is enabled, return True. Else, return False + """ + feature_table = self.db_connector.get_config_db_table("FEATURE") + return feature_table.get("dhcp_server", {}).get("state", "disabled") == "enabled" + + def _execute_supervisor_dhcp_relay_process(self, op): + """ + Start or stop relay releated processes managed by supervisord + Args: + op: string of operation, require to be "start" or "stop" + """ + if op not in ["stop", "start"]: + syslog.syslog(syslog.LOG_ERR, "Error operation: {}".format(op)) + sys.exit(1) + for program in self.dhcp_relay_supervisor_config.keys(): + cmds = ["supervisorctl", op, program] + syslog.syslog(syslog.LOG_INFO, "Starting stop {} by: {}".format(program, cmds)) + res = subprocess.run(cmds, check=True) + if res.returncode != 0: + syslog.syslog(syslog.LOG_ERR, "Error in execute: {}".format(res)) + sys.exit(1) + syslog.syslog(syslog.LOG_INFO, "Program {} stopped successfully".format(program)) + + def _check_dhcp_relay_processes(self): + """ + Check whether dhcrelay running as expected, if not, dhcprelayd will exit with code 1 + """ + running_cmds = get_target_process_cmds("dhcrelay") + running_cmds.sort() + expected_cmds = [value for key, value in self.dhcp_relay_supervisor_config.items() if "isc-dhcpv4-relay" in key] + expected_cmds.sort() + if running_cmds != expected_cmds: + syslog.syslog(syslog.LOG_ERR, "Running processes is not as expected! Runnning: {}. Expected: {}" + .format(running_cmds, expected_cmds)) + sys.exit(1) + + def _get_dhcp_relay_config(self): + """ + Get supervisord configuration for dhcrelay/dhcpmon + Returns: + Dict of cmds, sample:{ + 'isc-dhcpv4-relay-Vlan1000': [ + '/usr/sbin/dhcrelay', '-d', '-m', 'discard', '-a', '%h:%p', '%P', '--name-alias-map-file', + '/tmp/port-name-alias-map.txt', '-id', 'Vlan1000', '-iu', 'PortChannel101', '-iu', + 'PortChannel102', '-iu', 'PortChannel103', '-iu', 'PortChannel104', '192.0.0.1', '192.0.0.2', + '192.0.0.3', '192.0.0.4' + ], + 'dhcpmon-Vlan1000': [ + '/usr/sbin/dhcpmon', '-id', 'Vlan1000', '-iu', 'PortChannel101', '-iu', 'PortChannel102', '-iu', + 'PortChannel103', '-iu', 'PortChannel104', '-im', 'eth0' + ] + } + """ + res = {} + with open(self.supervisord_conf_path, "r") as conf_file: + content = conf_file.read() + cmds = re.findall(r"\[program:((isc-dhcpv4-relay|dhcpmon)-.+)\]\ncommand=(.+)", content) + for cmd in cmds: + key = "dhcpmon:{}".format(cmd[0]) if "dhcpmon" in cmd[0] else cmd[0] + res[key] = cmd[2].replace("%%", "%").split(" ") + return res def _start_dhcrelay_process(self, new_dhcp_interfaces, dhcp_server_ip, force_kill): # To check whether need to kill dhcrelay process @@ -184,8 +300,9 @@ def main(): checkers.append(DhcpServerTableIntfEnablementEventChecker(sel, dhcp_db_connector.config_db)) checkers.append(VlanIntfTableEventChecker(sel, dhcp_db_connector.config_db)) checkers.append(VlanTableEventChecker(sel, dhcp_db_connector.config_db)) + checkers.append(DhcpServerFeatureStateChecker(sel, dhcp_db_connector.config_db)) db_monitor = DhcpRelaydDbMonitor(dhcp_db_connector, sel, checkers, DEFAULT_SELECT_TIMEOUT) - db_monitor.enable_checker(DEFAULT_CHECKER) + db_monitor.enable_checkers([FEATURE_CHECKER]) dhcprelayd = DhcpRelayd(dhcp_db_connector, db_monitor) dhcprelayd.start() dhcprelayd.wait() diff --git a/src/sonic-dhcp-server/tests/common_utils.py b/src/sonic-dhcp-server/tests/common_utils.py index 1b3323c7e120..bf88117293b8 100644 --- a/src/sonic-dhcp-server/tests/common_utils.py +++ b/src/sonic-dhcp-server/tests/common_utils.py @@ -108,3 +108,8 @@ def get_subscribe_table_tested_data(test_name): data["table"][i][2] = tuple(data["table"][i][2]) data["table"][i] = tuple(data["table"][i]) return tested_data + + +class MockSubprocessRes(object): + def __init__(self, returncode): + self.returncode = returncode diff --git a/src/sonic-dhcp-server/tests/test_data/dhcp_db_monitor_test_data.json b/src/sonic-dhcp-server/tests/test_data/dhcp_db_monitor_test_data.json index cbc132ecd70d..db3b328fa84c 100644 --- a/src/sonic-dhcp-server/tests/test_data/dhcp_db_monitor_test_data.json +++ b/src/sonic-dhcp-server/tests/test_data/dhcp_db_monitor_test_data.json @@ -242,5 +242,52 @@ ], "exp_res": false } + ], + "test_feature_update": [ + { + "table": [ + ["dhcp_server", "SET", [["state", "disabled"]]] + ], + "exp_res": { + "pre_enabled": true, + "pre_disabled": false + } + }, + { + "table": [ + ["dhcp_server", "SET", [["state", "enabled"]]] + ], + "exp_res": { + "pre_enabled": false, + "pre_disabled": true + } + }, + { + "table": [ + ["dhcp_server", "SET", [["states", "enabled"]]] + ], + "exp_res": { + "pre_enabled": false, + "pre_disabled": false + } + }, + { + "table": [ + ["dhcp_server", "DEL", [[]]] + ], + "exp_res": { + "pre_enabled": true, + "pre_disabled": false + } + }, + { + "table": [ + ["dhcp_relay", "SET", [["state", "disabled"]]] + ], + "exp_res": { + "pre_enabled": false, + "pre_disabled": false + } + } ] } \ No newline at end of file diff --git a/src/sonic-config-engine/tests/sample_output/py3/docker-dhcp-relay-enable-dhcp-server.supervisord.conf b/src/sonic-dhcp-server/tests/test_data/supervisor.conf similarity index 61% rename from src/sonic-config-engine/tests/sample_output/py3/docker-dhcp-relay-enable-dhcp-server.supervisord.conf rename to src/sonic-dhcp-server/tests/test_data/supervisor.conf index 350e302ce9e1..e958fa35fb56 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/docker-dhcp-relay-enable-dhcp-server.supervisord.conf +++ b/src/sonic-dhcp-server/tests/test_data/supervisor.conf @@ -39,11 +39,9 @@ stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=rsyslogd:running -[group:dhcp-relay] -programs=dhcprelayd,dhcp6relay -[program:dhcp6relay] -command=/usr/sbin/dhcp6relay +[program:isc-dhcpv4-relay-Vlan1000] +command=/usr/sbin/dhcrelay -d -m discard -a %%h:%%p %%P --name-alias-map-file /tmp/port-name-alias-map.txt -id Vlan1000 -iu PortChannel101 -iu PortChannel102 -iu PortChannel103 -iu PortChannel104 192.0.0.1 192.0.0.2 192.0.0.3 192.0.0.4 priority=3 autostart=false autorestart=false @@ -60,5 +58,31 @@ autorestart=false stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true +dependent_startup_wait_for=isc-dhcpv4-relay-Vlan1000:running + +[program:dhcp6relay] +command=/usr/sbin/dhcp6relay +priority=3 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true dependent_startup_wait_for=start:exited +[group:dhcp-relay] +programs=dhcprelayd,dhcp6relay + + +[group:dhcpmon] +programs=dhcpmon-Vlan1000 + +[program:dhcpmon-Vlan1000] +command=/usr/sbin/dhcpmon -id Vlan1000 -iu PortChannel101 -iu PortChannel102 -iu PortChannel103 -iu PortChannel104 -im eth0 +priority=4 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=isc-dhcpv4-relay-Vlan1000:running diff --git a/src/sonic-dhcp-server/tests/test_dhcp_db_monitor.py b/src/sonic-dhcp-server/tests/test_dhcp_db_monitor.py index d6830b274e76..a51988145e22 100644 --- a/src/sonic-dhcp-server/tests/test_dhcp_db_monitor.py +++ b/src/sonic-dhcp-server/tests/test_dhcp_db_monitor.py @@ -5,16 +5,18 @@ from dhcp_server.common.dhcp_db_monitor import DhcpRelaydDbMonitor, DhcpServdDbMonitor, ConfigDbEventChecker, \ DhcpServerTableIntfEnablementEventChecker, DhcpServerTableCfgChangeEventChecker, \ DhcpPortTableEventChecker, DhcpRangeTableEventChecker, DhcpOptionTableEventChecker, \ - VlanTableEventChecker, VlanMemberTableEventChecker, VlanIntfTableEventChecker + VlanTableEventChecker, VlanMemberTableEventChecker, VlanIntfTableEventChecker, DhcpServerFeatureStateChecker from dhcp_server.common.utils import DhcpDbConnector from swsscommon import swsscommon from unittest.mock import patch, ANY, PropertyMock, MagicMock +@pytest.mark.parametrize("checker_enabled", [True, False]) @pytest.mark.parametrize("select_result", [swsscommon.Select.TIMEOUT, swsscommon.Select.OBJECT]) -def test_dhcp_relayd_monitor_check_db_update(mock_swsscommon_dbconnector_init, select_result): +def test_dhcp_relayd_monitor_check_db_update(mock_swsscommon_dbconnector_init, select_result, checker_enabled): with patch.object(DhcpServerTableIntfEnablementEventChecker, "check_update_event") \ as mock_check_update_event, \ + patch.object(ConfigDbEventChecker, "is_enabled", return_value=checker_enabled), \ patch.object(VlanTableEventChecker, "check_update_event") as mock_check_vlan_update, \ patch.object(VlanIntfTableEventChecker, "check_update_event") as mock_check_vlan_intf_update, \ patch.object(swsscommon.Select, "select", return_value=(select_result, None)), \ @@ -25,13 +27,13 @@ def test_dhcp_relayd_monitor_check_db_update(mock_swsscommon_dbconnector_init, s dhcp_relayd_db_monitor = DhcpRelaydDbMonitor(db_connector, swsscommon.Select(), checkers) tested_db_snapshot = {"enabled_dhcp_interfaces": "dummy"} dhcp_relayd_db_monitor.check_db_update(tested_db_snapshot) - if select_result == swsscommon.Select.OBJECT: - mock_check_update_event.assert_called_once_with(tested_db_snapshot) + if select_result == swsscommon.Select.OBJECT and checker_enabled: mock_check_vlan_update.assert_called_once_with(tested_db_snapshot) + mock_check_update_event.assert_called_once_with(tested_db_snapshot) mock_check_vlan_intf_update.assert_called_once_with(tested_db_snapshot) else: - mock_check_update_event.assert_not_called() mock_check_vlan_update.assert_not_called() + mock_check_update_event.assert_not_called() mock_check_vlan_intf_update.assert_not_called() @@ -40,13 +42,27 @@ def test_dhcp_relayd_enable_checker(tables, mock_swsscommon_dbconnector_init): with patch.object(ConfigDbEventChecker, "enable") as mock_enable: db_connector = DhcpDbConnector() dhcp_relayd_db_monitor = DhcpRelaydDbMonitor(db_connector, None, [VlanTableEventChecker(None, None)]) - dhcp_relayd_db_monitor.enable_checker(set(tables)) + dhcp_relayd_db_monitor.enable_checkers(set(tables)) if "VlanTableEventChecker" in tables: mock_enable.assert_called_once() else: mock_enable.assert_not_called() +@pytest.mark.parametrize("tables", [["VlanTableEventChecker"], ["dummy"]]) +def test_dhcp_relayd_disable_checker(tables, mock_swsscommon_dbconnector_init): + with patch.object(ConfigDbEventChecker, "disable") as mock_disable: + db_connector = DhcpDbConnector() + checker = VlanTableEventChecker(None, None) + checker.is_enabled = True + dhcp_relayd_db_monitor = DhcpRelaydDbMonitor(db_connector, None, [checker]) + dhcp_relayd_db_monitor.disable_checkers(set(tables)) + if "VlanTableEventChecker" in tables: + mock_disable.assert_called_once() + else: + mock_disable.assert_not_called() + + @pytest.mark.parametrize("select_result", [swsscommon.Select.TIMEOUT, swsscommon.Select.OBJECT]) @pytest.mark.parametrize("is_checker_enabled", [True, False]) def test_dhcp_servd_monitor_check_db_update(mock_swsscommon_dbconnector_init, select_result, @@ -349,3 +365,24 @@ def test_vlan_member_table_checker(mock_swsscommon_dbconnector_init, tested_data assert check_res else: assert expected_res == check_res + + +@pytest.mark.parametrize("tested_db_snapshot", [{"dhcp_server_feature_enabled": True}, + {"dhcp_server_feature_enabled": False}, {}]) +@pytest.mark.parametrize("tested_data", get_subscribe_table_tested_data("test_feature_update")) +@pytest.mark.parametrize("enabled", [True, False]) +def test_feature_table_checker(mock_swsscommon_dbconnector_init, tested_data, tested_db_snapshot, enabled): + with patch.object(ConfigDbEventChecker, "enable"), \ + patch.object(ConfigDbEventChecker, "subscriber_state_table", + return_value=MockSubscribeTable(tested_data["table"]), new_callable=PropertyMock), \ + patch.object(ConfigDbEventChecker, "enabled", return_value=enabled, new_callable=PropertyMock), \ + patch.object(sys, "exit"): + sel = swsscommon.Select() + db_event_checker = DhcpServerFeatureStateChecker(sel, MagicMock()) + check_res = db_event_checker.check_update_event(tested_db_snapshot) + if "dhcp_server_feature_enabled" not in tested_db_snapshot: + assert check_res + else: + expected_res = tested_data["exp_res"]["pre_enabled"] if tested_db_snapshot["dhcp_server_feature_enabled"] \ + else tested_data["exp_res"]["pre_disabled"] + assert expected_res == check_res diff --git a/src/sonic-dhcp-server/tests/test_dhcprelayd.py b/src/sonic-dhcp-server/tests/test_dhcprelayd.py index 7681f5d3a39d..1ff0d240239a 100644 --- a/src/sonic-dhcp-server/tests/test_dhcprelayd.py +++ b/src/sonic-dhcp-server/tests/test_dhcprelayd.py @@ -3,21 +3,32 @@ import subprocess import sys import time -from common_utils import mock_get_config_db_table, MockProc, MockPopen +from common_utils import mock_get_config_db_table, MockProc, MockPopen, MockSubprocessRes, mock_exit_func from dhcp_server.common.utils import DhcpDbConnector -from dhcp_server.common.dhcp_db_monitor import ConfigDbEventChecker +from dhcp_server.common.dhcp_db_monitor import ConfigDbEventChecker, DhcpRelaydDbMonitor from dhcp_server.dhcprelayd.dhcprelayd import DhcpRelayd, KILLED_OLD, NOT_KILLED, NOT_FOUND_PROC from swsscommon import swsscommon -from unittest.mock import patch, call +from unittest.mock import patch, call, ANY, PropertyMock -def test_start(mock_swsscommon_dbconnector_init): - with patch.object(DhcpRelayd, "refresh_dhcrelay", return_value=None) as mock_refresh, \ - patch.object(ConfigDbEventChecker, "enable"): +@pytest.mark.parametrize("dhcp_server_enabled", [True, False]) +def test_start(mock_swsscommon_dbconnector_init, dhcp_server_enabled): + with patch.object(DhcpRelayd, "_get_dhcp_relay_config") as mock_get_config, \ + patch.object(DhcpRelayd, "_is_dhcp_server_enabled", return_value=dhcp_server_enabled) as mock_enabled, \ + patch.object(DhcpRelayd, "_execute_supervisor_dhcp_relay_process") as mock_execute, \ + patch.object(DhcpRelaydDbMonitor, "enable_checkers") as mock_enable_checkers, \ + patch.object(time, "sleep"): dhcp_db_connector = DhcpDbConnector() - dhcprelayd = DhcpRelayd(dhcp_db_connector, None) + dhcprelayd = DhcpRelayd(dhcp_db_connector, DhcpRelaydDbMonitor) dhcprelayd.start() - mock_refresh.assert_called_once_with() + mock_get_config.assert_called_once_with() + mock_enabled.assert_called_once_with() + if dhcp_server_enabled: + mock_execute.assert_called_once_with("stop") + mock_enable_checkers.assert_called_once_with([ANY, ANY, ANY]) + else: + mock_execute.assert_not_called() + mock_enable_checkers.assert_not_called() def test_refresh_dhcrelay(mock_swsscommon_dbconnector_init): @@ -131,3 +142,93 @@ def test_get_dhcp_server_ip(mock_swsscommon_dbconnector_init, mock_swsscommon_ta else: mock_exit.assert_called_once_with(1) mock_sleep.assert_has_calls([call(10) for _ in range(10)]) + + +tested_feature_table = [ + { + "dhcp_server": { + "delayed": "True" + } + }, + { + "dhcp_server": { + "state": "enabled" + } + }, + { + "dhcp_server": { + "state": "disabled" + } + }, + {} +] + + +@pytest.mark.parametrize("feature_table", tested_feature_table) +def test_is_dhcp_server_enabled(mock_swsscommon_dbconnector_init, mock_swsscommon_table_init, feature_table): + with patch.object(DhcpDbConnector, "get_config_db_table", return_value=feature_table): + dhcp_db_connector = DhcpDbConnector() + dhcprelayd = DhcpRelayd(dhcp_db_connector, None) + res = dhcprelayd._is_dhcp_server_enabled() + if "dhcp_server" in feature_table and "state" in feature_table["dhcp_server"] and \ + feature_table["dhcp_server"]["state"] == "enabled": + assert res + else: + assert not res + + +@pytest.mark.parametrize("op", ["stop", "start", "starts"]) +@pytest.mark.parametrize("return_code", [0, -1]) +def test_execute_supervisor_dhcp_relay_process(mock_swsscommon_dbconnector_init, mock_swsscommon_table_init, op, + return_code): + with patch.object(sys, "exit", side_effect=mock_exit_func) as mock_exit, \ + patch.object(subprocess, "run", return_value=MockSubprocessRes(return_code)) as mock_run, \ + patch.object(DhcpRelayd, "dhcp_relay_supervisor_config", return_value={"dhcpmon-Vlan1000": ""}, + new_callable=PropertyMock): + dhcp_db_connector = DhcpDbConnector() + dhcprelayd = DhcpRelayd(dhcp_db_connector, None) + try: + dhcprelayd._execute_supervisor_dhcp_relay_process(op) + except SystemExit: + mock_exit.assert_called_once_with(1) + assert op == "starts" or return_code != 0 + else: + mock_run.assert_called_once_with(["supervisorctl", op, "dhcpmon-Vlan1000"], check=True) + + +@pytest.mark.parametrize("target_cmds", [[["/usr/bin/dhcrelay"]], [["/usr/bin/dhcpmon"]]]) +def test_check_dhcp_relay_process(mock_swsscommon_dbconnector_init, mock_swsscommon_table_init, target_cmds): + exp_config = {"isc-dhcpv4-relay-Vlan1000": ["/usr/bin/dhcrelay"]} + with patch("dhcp_server.dhcprelayd.dhcprelayd.get_target_process_cmds", return_value=target_cmds), \ + patch.object(DhcpRelayd, "dhcp_relay_supervisor_config", + return_value=exp_config, new_callable=PropertyMock), \ + patch.object(sys, "exit", mock_exit_func): + dhcp_db_connector = DhcpDbConnector() + dhcprelayd = DhcpRelayd(dhcp_db_connector, None) + exp_cmds = [value for key, value in exp_config.items() if "isc-dhcpv4-relay" in key] + exp_cmds.sort() + try: + dhcprelayd._check_dhcp_relay_processes() + except SystemExit: + assert exp_cmds != target_cmds + else: + assert exp_cmds == target_cmds + + +def test_get_dhcp_relay_config(mock_swsscommon_dbconnector_init, mock_swsscommon_table_init): + with patch.object(DhcpRelayd, "supervisord_conf_path", return_value="tests/test_data/supervisor.conf", + new_callable=PropertyMock): + dhcp_db_connector = DhcpDbConnector() + dhcprelayd = DhcpRelayd(dhcp_db_connector, None) + res = dhcprelayd._get_dhcp_relay_config() + assert res == { + "isc-dhcpv4-relay-Vlan1000": [ + "/usr/sbin/dhcrelay", "-d", "-m", "discard", "-a", "%h:%p", "%P", "--name-alias-map-file", + "/tmp/port-name-alias-map.txt", "-id", "Vlan1000", "-iu", "PortChannel101", "-iu", "PortChannel102", + "-iu", "PortChannel103", "-iu", "PortChannel104", "192.0.0.1", "192.0.0.2", "192.0.0.3", "192.0.0.4" + ], + "dhcpmon:dhcpmon-Vlan1000": [ + "/usr/sbin/dhcpmon", "-id", "Vlan1000", "-iu", "PortChannel101", "-iu", "PortChannel102", "-iu", + "PortChannel103", "-iu", "PortChannel104", "-im", "eth0" + ] + } diff --git a/src/sonic-dhcp-server/tests/test_utils.py b/src/sonic-dhcp-server/tests/test_utils.py index a8f4feb36a4d..129f2faf7f7c 100644 --- a/src/sonic-dhcp-server/tests/test_utils.py +++ b/src/sonic-dhcp-server/tests/test_utils.py @@ -1,8 +1,10 @@ import dhcp_server.common.utils as utils import ipaddress +import psutil import pytest from swsscommon import swsscommon -from unittest.mock import patch, call +from common_utils import MockProc +from unittest.mock import patch, call, PropertyMock interval_test_data = { "ordered_with_overlap": { @@ -137,3 +139,8 @@ def convert_ip_address_intervals(intervals): def test_validate_ttr_type(test_data): res = utils.validate_str_type(test_data[0], test_data[1]) assert res == test_data[2] + + +def test_get_target_process_cmds(): + with patch.object(psutil, "process_iter", return_value=[MockProc("dhcrelay", 1), MockProc("dhcpmon", 2)], new_callable=PropertyMock): + res = utils.get_target_process_cmds("dhcrelay") \ No newline at end of file From 5c36732f3b12e074186483d88db3f800946de681 Mon Sep 17 00:00:00 2001 From: Vivek Date: Mon, 27 Nov 2023 09:56:54 -0800 Subject: [PATCH 009/419] [lldp] Clean up service start logic owing to port init start optimization (#17268) Signed-off-by: Vivek Reddy --- files/build_templates/lldp.timer.j2 | 1 - files/scripts/syncd.sh | 11 ----------- 2 files changed, 12 deletions(-) delete mode 120000 files/build_templates/lldp.timer.j2 diff --git a/files/build_templates/lldp.timer.j2 b/files/build_templates/lldp.timer.j2 deleted file mode 120000 index 8e6950d6f3bc..000000000000 --- a/files/build_templates/lldp.timer.j2 +++ /dev/null @@ -1 +0,0 @@ -per_namespace/lldp.timer.j2 \ No newline at end of file diff --git a/files/scripts/syncd.sh b/files/scripts/syncd.sh index 357c44ff6ccb..e9c2cfd494ba 100755 --- a/files/scripts/syncd.sh +++ b/files/scripts/syncd.sh @@ -105,17 +105,6 @@ function waitplatform() { debug "Started pmon service" fi fi - if [[ x"$BOOT_TYPE" = @(x"fast"|x"warm"|x"fastfast") ]]; then - debug "LLDP service is delayed by a timer for better fast/warm boot performance" - else - lldp_state=$(systemctl is-enabled lldp.timer) - if [[ $lldp_state == "enabled" ]] - then - debug "Starting lldp service..." - /bin/systemctl start lldp - debug "Started lldp service" - fi - fi } function stopplatform1() { From 6020fbfac3ac2b3c3fbf97ace7660da0000bfb4a Mon Sep 17 00:00:00 2001 From: Pavan-Nokia <120486223+Pavan-Nokia@users.noreply.github.com> Date: Mon, 27 Nov 2023 14:00:12 -0500 Subject: [PATCH 010/419] [armhf][Nokia-7215] Remove platform reboot (#17010) --- .../nokia/armhf-nokia_ixs7215_52x-r0/platform_reboot | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 device/nokia/armhf-nokia_ixs7215_52x-r0/platform_reboot diff --git a/device/nokia/armhf-nokia_ixs7215_52x-r0/platform_reboot b/device/nokia/armhf-nokia_ixs7215_52x-r0/platform_reboot deleted file mode 100644 index 83fc5d8028f2..000000000000 --- a/device/nokia/armhf-nokia_ixs7215_52x-r0/platform_reboot +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -function SafePwrCycle() { - sync ; sync - umount -fa > /dev/null 2&>1 - - # Write CPLD register to initiate cold reboot - sudo i2cset -f -y 0 0x41 0x10 0x00 -} - -SafePwrCycle From 7764805aa8d9e0ff05952dbabffca0c8b7ee3440 Mon Sep 17 00:00:00 2001 From: Yaqiang Zhu Date: Tue, 28 Nov 2023 00:44:41 -0500 Subject: [PATCH 011/419] [dhcp_server] Add support for only configures 1 ip in dhcp_server range (#17280) How I did it Add support for only configures 1 ip in dhcp_server range. Treat range with value out of order as invalid range. --- .../dhcp_server/dhcpservd/dhcp_cfggen.py | 16 +++++++++------- .../tests/test_data/mock_config_db.json | 3 +++ src/sonic-dhcp-server/tests/test_dhcp_cfggen.py | 6 +++--- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/sonic-dhcp-server/dhcp_server/dhcpservd/dhcp_cfggen.py b/src/sonic-dhcp-server/dhcp_server/dhcpservd/dhcp_cfggen.py index ae2dd2e4670e..c5017a5d220a 100755 --- a/src/sonic-dhcp-server/dhcp_server/dhcpservd/dhcp_cfggen.py +++ b/src/sonic-dhcp-server/dhcp_server/dhcpservd/dhcp_cfggen.py @@ -251,15 +251,17 @@ def _parse_range(self, range_ipv4): ranges = {} for range in list(range_ipv4.keys()): curr_range = range_ipv4.get(range, {}).get("range", {}) - if len(curr_range) != 2: - syslog.syslog(syslog.LOG_WARNING, f"Length of {curr_range} != 2") + list_length = len(curr_range) + if list_length == 0 or list_length > 2: + syslog.syslog(syslog.LOG_WARNING, f"Length of {curr_range} is {list_length}, which is invalid!") continue - address_1 = ipaddress.ip_address(curr_range[0]) - address_2 = ipaddress.ip_address(curr_range[1]) + address_start = ipaddress.ip_address(curr_range[0]) + address_end = ipaddress.ip_address(curr_range[1] if list_length == 2 else curr_range[0]) # To make sure order of range is correct - range_start = address_1 if address_1 < address_2 else address_2 - range_end = address_2 if address_1 < address_2 else address_1 - ranges[range] = [range_start, range_end] + if address_start > address_end: + syslog.syslog(syslog.LOG_WARNING, f"Start of {curr_range} is greater than end, skip it") + continue + ranges[range] = [address_start, address_end] return ranges diff --git a/src/sonic-dhcp-server/tests/test_data/mock_config_db.json b/src/sonic-dhcp-server/tests/test_data/mock_config_db.json index 004ae6131a46..1afb7c7e8054 100644 --- a/src/sonic-dhcp-server/tests/test_data/mock_config_db.json +++ b/src/sonic-dhcp-server/tests/test_data/mock_config_db.json @@ -123,6 +123,9 @@ "192.168.8.2", "192.168.8.3" ] + }, + "range5": { + "range": [] } }, "DHCP_SERVER_IPV4_PORT": { diff --git a/src/sonic-dhcp-server/tests/test_dhcp_cfggen.py b/src/sonic-dhcp-server/tests/test_dhcp_cfggen.py index b3ec371a96b9..64a0e9904e9d 100644 --- a/src/sonic-dhcp-server/tests/test_dhcp_cfggen.py +++ b/src/sonic-dhcp-server/tests/test_dhcp_cfggen.py @@ -140,7 +140,7 @@ } } expected_parsed_range = { - "range2": [ipaddress.IPv4Address("192.168.0.3"), ipaddress.IPv4Address("192.168.0.6")], + "range4": [ipaddress.IPv4Address("192.168.0.1"), ipaddress.IPv4Address("192.168.0.1")], "range3": [ipaddress.IPv4Address("192.168.0.10"), ipaddress.IPv4Address("192.168.0.10")], "range1": [ipaddress.IPv4Address("192.168.0.2"), ipaddress.IPv4Address("192.168.0.5")], "range0": [ipaddress.IPv4Address("192.168.8.2"), ipaddress.IPv4Address("192.168.8.3")] @@ -164,7 +164,7 @@ expected_parsed_port = { "Vlan1000": { "192.168.0.1/21": { - "etp8": [["192.168.0.2", "192.168.0.6"], ["192.168.0.10", "192.168.0.10"]], + "etp8": [["192.168.0.2", "192.168.0.5"], ["192.168.0.10", "192.168.0.10"]], "etp7": [["192.168.0.7", "192.168.0.7"]] } } @@ -318,7 +318,7 @@ def test_parse_port(test_config_db, mock_swsscommon_dbconnector_init, mock_get_r parsed_port, used_ranges = dhcp_cfg_generator._parse_port(ipv4_port, tested_vlan_interfaces, vlan_members, tested_ranges) assert parsed_port == (expected_parsed_port if test_config_db == "mock_config_db.json" else {}) - assert used_ranges == ({"range2", "range1", "range0", "range3"} + assert used_ranges == ({"range1", "range0", "range3"} if test_config_db == "mock_config_db.json" else set()) From ab8af94a2c68fe9a76889d2a6a32a351cb2b13d9 Mon Sep 17 00:00:00 2001 From: Yaqiang Zhu Date: Tue, 28 Nov 2023 00:47:59 -0500 Subject: [PATCH 012/419] [dhcp_server] Mark dhcp_server docker as Bullseyse docker (#17290) How I did it Mark dhcp_server docker as Bullseyse docker How to verify it Set INCLUDE_DHCP_SERVER to y and build image, build successfully --- rules/docker-dhcp-server.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rules/docker-dhcp-server.mk b/rules/docker-dhcp-server.mk index 280983a4798f..d72e49461f53 100644 --- a/rules/docker-dhcp-server.mk +++ b/rules/docker-dhcp-server.mk @@ -18,7 +18,9 @@ $(DOCKER_DHCP_SERVER)_PYTHON_WHEELS += $(SONIC_DHCP_SERVER_PY3) $(DOCKER_DHCP_SERVER)_INSTALL_PYTHON_WHEELS = $(SONIC_UTILITIES_PY3) SONIC_DOCKER_IMAGES += $(DOCKER_DHCP_SERVER) +SONIC_BULLSEYE_DOCKERS += $(DOCKER_DHCP_SERVER) SONIC_DOCKER_DBG_IMAGES += $(DOCKER_DHCP_SERVER_DBG) +SONIC_BULLSEYE_DBG_DOCKERS += $(DOCKER_DHCP_SERVER_DBG) ifeq ($(INCLUDE_KUBERNETES),y) $(DOCKER_DHCP_SERVER)_DEFAULT_FEATURE_OWNER = kube From a40daff8835d79aba4264d22c5dd019560c228b4 Mon Sep 17 00:00:00 2001 From: Mai Bui Date: Tue, 28 Nov 2023 14:35:22 +0700 Subject: [PATCH 013/419] [docker-sonic-mgmt-framework] limit privileged flag for mgmt-framework container (#17217) Why I did it HLD implementation: Container Hardening (sonic-net/SONiC#1364) Work item tracking Microsoft ADO (number only): 14807420 How I did it Reduce linux capabilities in privileged flag How to verify it Check container's settings: Privileged is false and container only has default Linux caps, does not have extended caps. --- rules/docker-sonic-mgmt-framework.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules/docker-sonic-mgmt-framework.mk b/rules/docker-sonic-mgmt-framework.mk index 7985f8e9be9d..1f26de396141 100644 --- a/rules/docker-sonic-mgmt-framework.mk +++ b/rules/docker-sonic-mgmt-framework.mk @@ -29,7 +29,7 @@ SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_MGMT_FRAMEWORK_DBG) endif $(DOCKER_MGMT_FRAMEWORK)_CONTAINER_NAME = mgmt-framework -$(DOCKER_MGMT_FRAMEWORK)_RUN_OPT += --privileged -t +$(DOCKER_MGMT_FRAMEWORK)_RUN_OPT += -t $(DOCKER_MGMT_FRAMEWORK)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro $(DOCKER_MGMT_FRAMEWORK)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro $(DOCKER_MGMT_FRAMEWORK)_RUN_OPT += -v /etc:/host_etc:ro From 82cebcd69020d6e2c44945f062e471c62f089b46 Mon Sep 17 00:00:00 2001 From: Yaqiang Zhu Date: Tue, 28 Nov 2023 16:28:16 -0500 Subject: [PATCH 014/419] [dhcp_server] Rename sonic_dhcp_server to sonic_dhcp_utilities (#17276) Why I did it sonic_dhcp_server.whl contains not only dhcp_server functionality but also part of dhcp_relay functionality, the existing naming is not appropriate. --- rules/docker-dhcp-relay.mk | 2 +- rules/docker-dhcp-server.mk | 2 +- rules/sonic-dhcp-server.dep | 10 ---------- rules/sonic-dhcp-server.mk | 8 -------- rules/sonic-dhcp-utilities.dep | 10 ++++++++++ rules/sonic-dhcp-utilities.mk | 8 ++++++++ src/sonic-dhcp-server/.gitignore | 4 ---- src/sonic-dhcp-utilities/.gitignore | 4 ++++ .../dhcp_utilities}/common/__init__.py | 0 .../dhcp_utilities}/common/dhcp_db_monitor.py | 0 .../dhcp_utilities}/common/utils.py | 0 .../dhcp_utilities}/dhcprelayd/dhcprelayd.py | 4 ++-- .../dhcp_utilities}/dhcpservd/dhcp_cfggen.py | 2 +- .../dhcp_utilities}/dhcpservd/dhcp_lease.py | 0 .../dhcp_utilities}/dhcpservd/dhcp_option.csv | 0 .../dhcp_utilities}/dhcpservd/dhcpservd.py | 4 ++-- .../setup.cfg | 2 +- .../setup.py | 16 ++++++++-------- .../tests/common_utils.py | 0 .../tests/conftest.py | 8 ++++---- .../test_data/dhcp_db_monitor_test_data.json | 0 .../tests/test_data/kea-dhcp4.conf.j2 | 0 .../tests/test_data/kea-lease.csv | 0 .../tests/test_data/mock_config_db.json | 0 .../mock_config_db_without_port_config.json | 0 .../tests/test_data/port-name-alias-map.txt | 0 .../tests/test_data/supervisor.conf | 0 .../tests/test_dhcp_cfggen.py | 4 ++-- .../tests/test_dhcp_db_monitor.py | 4 ++-- .../tests/test_dhcp_lease.py | 6 +++--- .../tests/test_dhcprelayd.py | 12 ++++++------ .../tests/test_dhcpservd.py | 12 ++++++------ .../tests/test_utils.py | 2 +- 33 files changed, 62 insertions(+), 62 deletions(-) delete mode 100644 rules/sonic-dhcp-server.dep delete mode 100644 rules/sonic-dhcp-server.mk create mode 100644 rules/sonic-dhcp-utilities.dep create mode 100644 rules/sonic-dhcp-utilities.mk delete mode 100644 src/sonic-dhcp-server/.gitignore create mode 100644 src/sonic-dhcp-utilities/.gitignore rename src/{sonic-dhcp-server/dhcp_server => sonic-dhcp-utilities/dhcp_utilities}/common/__init__.py (100%) rename src/{sonic-dhcp-server/dhcp_server => sonic-dhcp-utilities/dhcp_utilities}/common/dhcp_db_monitor.py (100%) rename src/{sonic-dhcp-server/dhcp_server => sonic-dhcp-utilities/dhcp_utilities}/common/utils.py (100%) rename src/{sonic-dhcp-server/dhcp_server => sonic-dhcp-utilities/dhcp_utilities}/dhcprelayd/dhcprelayd.py (98%) rename src/{sonic-dhcp-server/dhcp_server => sonic-dhcp-utilities/dhcp_utilities}/dhcpservd/dhcp_cfggen.py (99%) rename src/{sonic-dhcp-server/dhcp_server => sonic-dhcp-utilities/dhcp_utilities}/dhcpservd/dhcp_lease.py (100%) rename src/{sonic-dhcp-server/dhcp_server => sonic-dhcp-utilities/dhcp_utilities}/dhcpservd/dhcp_option.csv (100%) rename src/{sonic-dhcp-server/dhcp_server => sonic-dhcp-utilities/dhcp_utilities}/dhcpservd/dhcpservd.py (96%) rename src/{sonic-dhcp-server => sonic-dhcp-utilities}/setup.cfg (91%) rename src/{sonic-dhcp-server => sonic-dhcp-utilities}/setup.py (69%) rename src/{sonic-dhcp-server => sonic-dhcp-utilities}/tests/common_utils.py (100%) rename src/{sonic-dhcp-server => sonic-dhcp-utilities}/tests/conftest.py (81%) rename src/{sonic-dhcp-server => sonic-dhcp-utilities}/tests/test_data/dhcp_db_monitor_test_data.json (100%) rename src/{sonic-dhcp-server => sonic-dhcp-utilities}/tests/test_data/kea-dhcp4.conf.j2 (100%) rename src/{sonic-dhcp-server => sonic-dhcp-utilities}/tests/test_data/kea-lease.csv (100%) rename src/{sonic-dhcp-server => sonic-dhcp-utilities}/tests/test_data/mock_config_db.json (100%) rename src/{sonic-dhcp-server => sonic-dhcp-utilities}/tests/test_data/mock_config_db_without_port_config.json (100%) rename src/{sonic-dhcp-server => sonic-dhcp-utilities}/tests/test_data/port-name-alias-map.txt (100%) rename src/{sonic-dhcp-server => sonic-dhcp-utilities}/tests/test_data/supervisor.conf (100%) rename src/{sonic-dhcp-server => sonic-dhcp-utilities}/tests/test_dhcp_cfggen.py (99%) rename src/{sonic-dhcp-server => sonic-dhcp-utilities}/tests/test_dhcp_db_monitor.py (99%) rename src/{sonic-dhcp-server => sonic-dhcp-utilities}/tests/test_dhcp_lease.py (94%) rename src/{sonic-dhcp-server => sonic-dhcp-utilities}/tests/test_dhcprelayd.py (95%) rename src/{sonic-dhcp-server => sonic-dhcp-utilities}/tests/test_dhcpservd.py (92%) rename src/{sonic-dhcp-server => sonic-dhcp-utilities}/tests/test_utils.py (99%) diff --git a/rules/docker-dhcp-relay.mk b/rules/docker-dhcp-relay.mk index 82b4533950ad..63631c19171e 100644 --- a/rules/docker-dhcp-relay.mk +++ b/rules/docker-dhcp-relay.mk @@ -17,7 +17,7 @@ $(DOCKER_DHCP_RELAY)_LOAD_DOCKERS = $(DOCKER_CONFIG_ENGINE_BULLSEYE) $(DOCKER_DHCP_RELAY)_INSTALL_PYTHON_WHEELS = $(SONIC_UTILITIES_PY3) $(DOCKER_DHCP_RELAY)_INSTALL_DEBS = $(PYTHON3_SWSSCOMMON) -$(DOCKER_DHCP_RELAY)_PYTHON_WHEELS += $(SONIC_DHCP_SERVER_PY3) +$(DOCKER_DHCP_RELAY)_PYTHON_WHEELS += $(SONIC_DHCP_UTILITIES_PY3) $(DOCKER_DHCP_RELAY)_VERSION = 1.0.0 $(DOCKER_DHCP_RELAY)_PACKAGE_NAME = dhcp-relay diff --git a/rules/docker-dhcp-server.mk b/rules/docker-dhcp-server.mk index d72e49461f53..004888b68f22 100644 --- a/rules/docker-dhcp-server.mk +++ b/rules/docker-dhcp-server.mk @@ -14,7 +14,7 @@ $(DOCKER_DHCP_SERVER)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_DB $(DOCKER_DHCP_SERVER)_LOAD_DOCKERS = $(DOCKER_CONFIG_ENGINE_BULLSEYE) $(DOCKER_DHCP_SERVER)_INSTALL_DEBS = $(PYTHON3_SWSSCOMMON) -$(DOCKER_DHCP_SERVER)_PYTHON_WHEELS += $(SONIC_DHCP_SERVER_PY3) +$(DOCKER_DHCP_SERVER)_PYTHON_WHEELS += $(SONIC_DHCP_UTILITIES_PY3) $(DOCKER_DHCP_SERVER)_INSTALL_PYTHON_WHEELS = $(SONIC_UTILITIES_PY3) SONIC_DOCKER_IMAGES += $(DOCKER_DHCP_SERVER) diff --git a/rules/sonic-dhcp-server.dep b/rules/sonic-dhcp-server.dep deleted file mode 100644 index 891fffbe2052..000000000000 --- a/rules/sonic-dhcp-server.dep +++ /dev/null @@ -1,10 +0,0 @@ -SPATH := $($(SONIC_DHCPSERVD)_SRC_PATH) -DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic-dhcp-server.mk rules/sonic-dhcp-server.dep -DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) -SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files)) - -$(SONIC_DHCPSERVD)_CACHE_MODE := GIT_CONTENT_SHA -$(SONIC_DHCPSERVD)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) -$(SONIC_DHCPSERVD)_DEP_FILES := $(DEP_FILES) -$(SONIC_DHCPSERVD)_SMDEP_FILES := $(SMDEP_FILES) -$(SONIC_DHCPSERVD)_SMDEP_PATHS := $(SPATH) diff --git a/rules/sonic-dhcp-server.mk b/rules/sonic-dhcp-server.mk deleted file mode 100644 index 1ef05545b98a..000000000000 --- a/rules/sonic-dhcp-server.mk +++ /dev/null @@ -1,8 +0,0 @@ -# sonic-dhcp-server package - -SONIC_DHCP_SERVER_PY3 = sonic_dhcp_server-1.0-py3-none-any.whl -$(SONIC_DHCP_SERVER_PY3)_SRC_PATH = $(SRC_PATH)/sonic-dhcp-server -$(SONIC_DHCP_SERVER_PY3)_DEPENDS += $(SONIC_PY_COMMON_PY3) -$(SONIC_DHCP_SERVER_PY3)_DEBS_DEPENDS = $(LIBSWSSCOMMON) $(PYTHON3_SWSSCOMMON) -$(SONIC_DHCP_SERVER_PY3)_PYTHON_VERSION = 3 -SONIC_PYTHON_WHEELS += $(SONIC_DHCP_SERVER_PY3) diff --git a/rules/sonic-dhcp-utilities.dep b/rules/sonic-dhcp-utilities.dep new file mode 100644 index 000000000000..cc257ca6e412 --- /dev/null +++ b/rules/sonic-dhcp-utilities.dep @@ -0,0 +1,10 @@ +SPATH := $($(SONIC_DHCP_UTILITIES_PY3)_SRC_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic-dhcp-utilities.mk rules/sonic-dhcp-utilities.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files)) + +$(SONIC_DHCP_UTILITIES_PY3)_CACHE_MODE := GIT_CONTENT_SHA +$(SONIC_DHCP_UTILITIES_PY3)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SONIC_DHCP_UTILITIES_PY3)_DEP_FILES := $(DEP_FILES) +$(SONIC_DHCP_UTILITIES_PY3)_SMDEP_FILES := $(SMDEP_FILES) +$(SONIC_DHCP_UTILITIES_PY3)_SMDEP_PATHS := $(SPATH) diff --git a/rules/sonic-dhcp-utilities.mk b/rules/sonic-dhcp-utilities.mk new file mode 100644 index 000000000000..dae1fc22b818 --- /dev/null +++ b/rules/sonic-dhcp-utilities.mk @@ -0,0 +1,8 @@ +# sonic-dhcp-utilities package + +SONIC_DHCP_UTILITIES_PY3 = sonic_dhcp_utilities-1.0-py3-none-any.whl +$(SONIC_DHCP_UTILITIES_PY3)_SRC_PATH = $(SRC_PATH)/sonic-dhcp-utilities +$(SONIC_DHCP_UTILITIES_PY3)_DEPENDS += $(SONIC_PY_COMMON_PY3) +$(SONIC_DHCP_UTILITIES_PY3)_DEBS_DEPENDS = $(LIBSWSSCOMMON) $(PYTHON3_SWSSCOMMON) +$(SONIC_DHCP_UTILITIES_PY3)_PYTHON_VERSION = 3 +SONIC_PYTHON_WHEELS += $(SONIC_DHCP_UTILITIES_PY3) diff --git a/src/sonic-dhcp-server/.gitignore b/src/sonic-dhcp-server/.gitignore deleted file mode 100644 index 8f5a21dd7620..000000000000 --- a/src/sonic-dhcp-server/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -.eggs/ -build/ -dist/ -sonic_dhcpservd.egg-info/ diff --git a/src/sonic-dhcp-utilities/.gitignore b/src/sonic-dhcp-utilities/.gitignore new file mode 100644 index 000000000000..409d322ac7f4 --- /dev/null +++ b/src/sonic-dhcp-utilities/.gitignore @@ -0,0 +1,4 @@ +.eggs/ +build/ +dist/ +sonic_dhcp_utilities.egg-info/ diff --git a/src/sonic-dhcp-server/dhcp_server/common/__init__.py b/src/sonic-dhcp-utilities/dhcp_utilities/common/__init__.py similarity index 100% rename from src/sonic-dhcp-server/dhcp_server/common/__init__.py rename to src/sonic-dhcp-utilities/dhcp_utilities/common/__init__.py diff --git a/src/sonic-dhcp-server/dhcp_server/common/dhcp_db_monitor.py b/src/sonic-dhcp-utilities/dhcp_utilities/common/dhcp_db_monitor.py similarity index 100% rename from src/sonic-dhcp-server/dhcp_server/common/dhcp_db_monitor.py rename to src/sonic-dhcp-utilities/dhcp_utilities/common/dhcp_db_monitor.py diff --git a/src/sonic-dhcp-server/dhcp_server/common/utils.py b/src/sonic-dhcp-utilities/dhcp_utilities/common/utils.py similarity index 100% rename from src/sonic-dhcp-server/dhcp_server/common/utils.py rename to src/sonic-dhcp-utilities/dhcp_utilities/common/utils.py diff --git a/src/sonic-dhcp-server/dhcp_server/dhcprelayd/dhcprelayd.py b/src/sonic-dhcp-utilities/dhcp_utilities/dhcprelayd/dhcprelayd.py similarity index 98% rename from src/sonic-dhcp-server/dhcp_server/dhcprelayd/dhcprelayd.py rename to src/sonic-dhcp-utilities/dhcp_utilities/dhcprelayd/dhcprelayd.py index 6eded1c3505a..92249e8b9ccd 100644 --- a/src/sonic-dhcp-server/dhcp_server/dhcprelayd/dhcprelayd.py +++ b/src/sonic-dhcp-utilities/dhcp_utilities/dhcprelayd/dhcprelayd.py @@ -8,8 +8,8 @@ import syslog import time from swsscommon import swsscommon -from dhcp_server.common.utils import DhcpDbConnector, terminate_proc, get_target_process_cmds -from dhcp_server.common.dhcp_db_monitor import DhcpRelaydDbMonitor, DhcpServerTableIntfEnablementEventChecker, \ +from dhcp_utilities.common.utils import DhcpDbConnector, terminate_proc, get_target_process_cmds +from dhcp_utilities.common.dhcp_db_monitor import DhcpRelaydDbMonitor, DhcpServerTableIntfEnablementEventChecker, \ VlanTableEventChecker, VlanIntfTableEventChecker, DhcpServerFeatureStateChecker REDIS_SOCK_PATH = "/var/run/redis/redis.sock" diff --git a/src/sonic-dhcp-server/dhcp_server/dhcpservd/dhcp_cfggen.py b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py similarity index 99% rename from src/sonic-dhcp-server/dhcp_server/dhcpservd/dhcp_cfggen.py rename to src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py index c5017a5d220a..438a6e814713 100755 --- a/src/sonic-dhcp-server/dhcp_server/dhcpservd/dhcp_cfggen.py +++ b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py @@ -5,7 +5,7 @@ import syslog from jinja2 import Environment, FileSystemLoader -from dhcp_server.common.utils import merge_intervals, validate_str_type +from dhcp_utilities.common.utils import merge_intervals, validate_str_type PORT_MAP_PATH = "/tmp/port-name-alias-map.txt" UNICODE_TYPE = str diff --git a/src/sonic-dhcp-server/dhcp_server/dhcpservd/dhcp_lease.py b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_lease.py similarity index 100% rename from src/sonic-dhcp-server/dhcp_server/dhcpservd/dhcp_lease.py rename to src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_lease.py diff --git a/src/sonic-dhcp-server/dhcp_server/dhcpservd/dhcp_option.csv b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_option.csv similarity index 100% rename from src/sonic-dhcp-server/dhcp_server/dhcpservd/dhcp_option.csv rename to src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_option.csv diff --git a/src/sonic-dhcp-server/dhcp_server/dhcpservd/dhcpservd.py b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcpservd.py similarity index 96% rename from src/sonic-dhcp-server/dhcp_server/dhcpservd/dhcpservd.py rename to src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcpservd.py index 997628276d58..8911a3341637 100644 --- a/src/sonic-dhcp-server/dhcp_server/dhcpservd/dhcpservd.py +++ b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcpservd.py @@ -6,8 +6,8 @@ import syslog from .dhcp_cfggen import DhcpServCfgGenerator from .dhcp_lease import LeaseManager -from dhcp_server.common.utils import DhcpDbConnector -from dhcp_server.common.dhcp_db_monitor import DhcpServdDbMonitor, DhcpServerTableCfgChangeEventChecker, \ +from dhcp_utilities.common.utils import DhcpDbConnector +from dhcp_utilities.common.dhcp_db_monitor import DhcpServdDbMonitor, DhcpServerTableCfgChangeEventChecker, \ DhcpOptionTableEventChecker, DhcpRangeTableEventChecker, DhcpPortTableEventChecker, VlanIntfTableEventChecker, \ VlanMemberTableEventChecker, VlanTableEventChecker from swsscommon import swsscommon diff --git a/src/sonic-dhcp-server/setup.cfg b/src/sonic-dhcp-utilities/setup.cfg similarity index 91% rename from src/sonic-dhcp-server/setup.cfg rename to src/sonic-dhcp-utilities/setup.cfg index a9cd7dd6a1a0..ea271363caa9 100644 --- a/src/sonic-dhcp-server/setup.cfg +++ b/src/sonic-dhcp-utilities/setup.cfg @@ -7,7 +7,7 @@ testpaths = tests [coverage:run] branch = True -source = dhcp_server +source = dhcp_utilities [coverage:report] exclude_lines = diff --git a/src/sonic-dhcp-server/setup.py b/src/sonic-dhcp-utilities/setup.py similarity index 69% rename from src/sonic-dhcp-server/setup.py rename to src/sonic-dhcp-utilities/setup.py index caf69e920d60..2429cd10986c 100644 --- a/src/sonic-dhcp-server/setup.py +++ b/src/sonic-dhcp-utilities/setup.py @@ -10,9 +10,9 @@ ] setup( - name="sonic-dhcp-server", + name="sonic-dhcp-utilities", install_requires=dependencies, - description="Module of SONiC built-in dhcp_server", + description="Module of SONiC built-in dhcp_utilities", version="1.0", url="https://github.com/Azure/sonic-buildimage", tests_require=test_deps, @@ -23,14 +23,14 @@ "wheel", ], packages=[ - "dhcp_server.common", - "dhcp_server.dhcpservd", - "dhcp_server.dhcprelayd" + "dhcp_utilities.common", + "dhcp_utilities.dhcpservd", + "dhcp_utilities.dhcprelayd" ], entry_points={ "console_scripts": [ - "dhcprelayd = dhcp_server.dhcprelayd.dhcprelayd:main", - "dhcpservd = dhcp_server.dhcpservd.dhcpservd:main" + "dhcprelayd = dhcp_utilities.dhcprelayd.dhcprelayd:main", + "dhcpservd = dhcp_utilities.dhcpservd.dhcpservd:main" ] }, classifiers=[ @@ -43,6 +43,6 @@ "Programming Language :: Python :: 3.8" ], package_data={ - "dhcp_server.dhcpservd": ["dhcp_option.csv"] + "dhcp_utilities.dhcpservd": ["dhcp_option.csv"] } ) diff --git a/src/sonic-dhcp-server/tests/common_utils.py b/src/sonic-dhcp-utilities/tests/common_utils.py similarity index 100% rename from src/sonic-dhcp-server/tests/common_utils.py rename to src/sonic-dhcp-utilities/tests/common_utils.py diff --git a/src/sonic-dhcp-server/tests/conftest.py b/src/sonic-dhcp-utilities/tests/conftest.py similarity index 81% rename from src/sonic-dhcp-server/tests/conftest.py rename to src/sonic-dhcp-utilities/tests/conftest.py index 9661a0be43ce..ae75df4822a8 100644 --- a/src/sonic-dhcp-server/tests/conftest.py +++ b/src/sonic-dhcp-utilities/tests/conftest.py @@ -1,9 +1,9 @@ import pytest -import dhcp_server.common.utils as utils +import dhcp_utilities.common.utils as utils import os import sys from unittest.mock import patch, PropertyMock -from dhcp_server.dhcpservd.dhcp_cfggen import DhcpServCfgGenerator +from dhcp_utilities.dhcpservd.dhcp_cfggen import DhcpServCfgGenerator test_path = os.path.dirname(os.path.abspath(__file__)) @@ -26,14 +26,14 @@ def mock_swsscommon_table_init(): @pytest.fixture(scope="function") def mock_get_render_template(): - with patch("dhcp_server.dhcpservd.dhcp_cfggen.DhcpServCfgGenerator._get_render_template", + with patch("dhcp_utilities.dhcpservd.dhcp_cfggen.DhcpServCfgGenerator._get_render_template", return_value=None) as mock_template: yield mock_template @pytest.fixture def mock_parse_port_map_alias(scope="function"): - with patch("dhcp_server.dhcpservd.dhcp_cfggen.DhcpServCfgGenerator._parse_port_map_alias", + with patch("dhcp_utilities.dhcpservd.dhcp_cfggen.DhcpServCfgGenerator._parse_port_map_alias", return_value=None) as mock_map, \ patch.object(DhcpServCfgGenerator, "port_alias_map", return_value={"Ethernet24": "etp7", "Ethernet28": "etp8"}, new_callable=PropertyMock), \ diff --git a/src/sonic-dhcp-server/tests/test_data/dhcp_db_monitor_test_data.json b/src/sonic-dhcp-utilities/tests/test_data/dhcp_db_monitor_test_data.json similarity index 100% rename from src/sonic-dhcp-server/tests/test_data/dhcp_db_monitor_test_data.json rename to src/sonic-dhcp-utilities/tests/test_data/dhcp_db_monitor_test_data.json diff --git a/src/sonic-dhcp-server/tests/test_data/kea-dhcp4.conf.j2 b/src/sonic-dhcp-utilities/tests/test_data/kea-dhcp4.conf.j2 similarity index 100% rename from src/sonic-dhcp-server/tests/test_data/kea-dhcp4.conf.j2 rename to src/sonic-dhcp-utilities/tests/test_data/kea-dhcp4.conf.j2 diff --git a/src/sonic-dhcp-server/tests/test_data/kea-lease.csv b/src/sonic-dhcp-utilities/tests/test_data/kea-lease.csv similarity index 100% rename from src/sonic-dhcp-server/tests/test_data/kea-lease.csv rename to src/sonic-dhcp-utilities/tests/test_data/kea-lease.csv diff --git a/src/sonic-dhcp-server/tests/test_data/mock_config_db.json b/src/sonic-dhcp-utilities/tests/test_data/mock_config_db.json similarity index 100% rename from src/sonic-dhcp-server/tests/test_data/mock_config_db.json rename to src/sonic-dhcp-utilities/tests/test_data/mock_config_db.json diff --git a/src/sonic-dhcp-server/tests/test_data/mock_config_db_without_port_config.json b/src/sonic-dhcp-utilities/tests/test_data/mock_config_db_without_port_config.json similarity index 100% rename from src/sonic-dhcp-server/tests/test_data/mock_config_db_without_port_config.json rename to src/sonic-dhcp-utilities/tests/test_data/mock_config_db_without_port_config.json diff --git a/src/sonic-dhcp-server/tests/test_data/port-name-alias-map.txt b/src/sonic-dhcp-utilities/tests/test_data/port-name-alias-map.txt similarity index 100% rename from src/sonic-dhcp-server/tests/test_data/port-name-alias-map.txt rename to src/sonic-dhcp-utilities/tests/test_data/port-name-alias-map.txt diff --git a/src/sonic-dhcp-server/tests/test_data/supervisor.conf b/src/sonic-dhcp-utilities/tests/test_data/supervisor.conf similarity index 100% rename from src/sonic-dhcp-server/tests/test_data/supervisor.conf rename to src/sonic-dhcp-utilities/tests/test_data/supervisor.conf diff --git a/src/sonic-dhcp-server/tests/test_dhcp_cfggen.py b/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py similarity index 99% rename from src/sonic-dhcp-server/tests/test_dhcp_cfggen.py rename to src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py index 64a0e9904e9d..db76cacb25db 100644 --- a/src/sonic-dhcp-server/tests/test_dhcp_cfggen.py +++ b/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py @@ -3,8 +3,8 @@ import json import pytest from common_utils import MockConfigDb, mock_get_config_db_table, PORT_MODE_CHECKER -from dhcp_server.common.utils import DhcpDbConnector -from dhcp_server.dhcpservd.dhcp_cfggen import DhcpServCfgGenerator +from dhcp_utilities.common.utils import DhcpDbConnector +from dhcp_utilities.dhcpservd.dhcp_cfggen import DhcpServCfgGenerator from unittest.mock import patch expected_dhcp_config = { diff --git a/src/sonic-dhcp-server/tests/test_dhcp_db_monitor.py b/src/sonic-dhcp-utilities/tests/test_dhcp_db_monitor.py similarity index 99% rename from src/sonic-dhcp-server/tests/test_dhcp_db_monitor.py rename to src/sonic-dhcp-utilities/tests/test_dhcp_db_monitor.py index a51988145e22..6cea6868d86a 100644 --- a/src/sonic-dhcp-server/tests/test_dhcp_db_monitor.py +++ b/src/sonic-dhcp-utilities/tests/test_dhcp_db_monitor.py @@ -2,11 +2,11 @@ import sys from common_utils import MockSubscribeTable, get_subscribe_table_tested_data, \ PORT_MODE_CHECKER, mock_exit_func -from dhcp_server.common.dhcp_db_monitor import DhcpRelaydDbMonitor, DhcpServdDbMonitor, ConfigDbEventChecker, \ +from dhcp_utilities.common.dhcp_db_monitor import DhcpRelaydDbMonitor, DhcpServdDbMonitor, ConfigDbEventChecker, \ DhcpServerTableIntfEnablementEventChecker, DhcpServerTableCfgChangeEventChecker, \ DhcpPortTableEventChecker, DhcpRangeTableEventChecker, DhcpOptionTableEventChecker, \ VlanTableEventChecker, VlanMemberTableEventChecker, VlanIntfTableEventChecker, DhcpServerFeatureStateChecker -from dhcp_server.common.utils import DhcpDbConnector +from dhcp_utilities.common.utils import DhcpDbConnector from swsscommon import swsscommon from unittest.mock import patch, ANY, PropertyMock, MagicMock diff --git a/src/sonic-dhcp-server/tests/test_dhcp_lease.py b/src/sonic-dhcp-utilities/tests/test_dhcp_lease.py similarity index 94% rename from src/sonic-dhcp-server/tests/test_dhcp_lease.py rename to src/sonic-dhcp-utilities/tests/test_dhcp_lease.py index 4ec748749d6e..892c5f9bcc95 100644 --- a/src/sonic-dhcp-server/tests/test_dhcp_lease.py +++ b/src/sonic-dhcp-utilities/tests/test_dhcp_lease.py @@ -1,5 +1,5 @@ -from dhcp_server.common.utils import DhcpDbConnector -from dhcp_server.dhcpservd.dhcp_lease import KeaDhcp4LeaseHandler, LeaseHanlder +from dhcp_utilities.common.utils import DhcpDbConnector +from dhcp_utilities.dhcpservd.dhcp_lease import KeaDhcp4LeaseHandler, LeaseHanlder from freezegun import freeze_time from swsscommon import swsscommon from unittest.mock import patch, call, MagicMock @@ -60,7 +60,7 @@ def test_get_fdb_info(mock_swsscommon_dbconnector_init): "Vlan1000:10:70:fd:b6:13:17": {"port": "Ethernet33", "type": "dynamic"}, "Vlan1000:10:70:fd:b6:13:18": {"port": "Ethernet34", "type": "dynamic"} } - with patch("dhcp_server.common.utils.DhcpDbConnector.get_state_db_table", return_value=mock_fdb_table): + with patch("dhcp_utilities.common.utils.DhcpDbConnector.get_state_db_table", return_value=mock_fdb_table): db_connector = DhcpDbConnector() kea_lease_handler = KeaDhcp4LeaseHandler(db_connector, lease_file="tests/test_data/kea-lease.csv") # Verify whether lease information read is as expected diff --git a/src/sonic-dhcp-server/tests/test_dhcprelayd.py b/src/sonic-dhcp-utilities/tests/test_dhcprelayd.py similarity index 95% rename from src/sonic-dhcp-server/tests/test_dhcprelayd.py rename to src/sonic-dhcp-utilities/tests/test_dhcprelayd.py index 1ff0d240239a..9e519aad4e8a 100644 --- a/src/sonic-dhcp-server/tests/test_dhcprelayd.py +++ b/src/sonic-dhcp-utilities/tests/test_dhcprelayd.py @@ -4,9 +4,9 @@ import sys import time from common_utils import mock_get_config_db_table, MockProc, MockPopen, MockSubprocessRes, mock_exit_func -from dhcp_server.common.utils import DhcpDbConnector -from dhcp_server.common.dhcp_db_monitor import ConfigDbEventChecker, DhcpRelaydDbMonitor -from dhcp_server.dhcprelayd.dhcprelayd import DhcpRelayd, KILLED_OLD, NOT_KILLED, NOT_FOUND_PROC +from dhcp_utilities.common.utils import DhcpDbConnector +from dhcp_utilities.common.dhcp_db_monitor import ConfigDbEventChecker, DhcpRelaydDbMonitor +from dhcp_utilities.dhcprelayd.dhcprelayd import DhcpRelayd, KILLED_OLD, NOT_KILLED, NOT_FOUND_PROC from swsscommon import swsscommon from unittest.mock import patch, call, ANY, PropertyMock @@ -49,7 +49,7 @@ def test_start_dhcrelay_process(mock_swsscommon_dbconnector_init, new_dhcp_inter with patch.object(DhcpRelayd, "_kill_exist_relay_releated_process", return_value=kill_res), \ patch.object(subprocess, "Popen", return_value=MockPopen(999)) as mock_popen, \ patch.object(time, "sleep"), \ - patch("dhcp_server.dhcprelayd.dhcprelayd.terminate_proc", return_value=None) as mock_terminate, \ + patch("dhcp_utilities.dhcprelayd.dhcprelayd.terminate_proc", return_value=None) as mock_terminate, \ patch.object(psutil.Process, "__init__", return_value=None), \ patch.object(psutil.Process, "status", return_value=proc_status), \ patch.object(sys, "exit") as mock_exit, \ @@ -82,7 +82,7 @@ def test_start_dhcpmon_process(mock_swsscommon_dbconnector_init, new_dhcp_interf with patch.object(DhcpRelayd, "_kill_exist_relay_releated_process", return_value=kill_res), \ patch.object(subprocess, "Popen", return_value=MockPopen(999)) as mock_popen, \ patch.object(time, "sleep"), \ - patch("dhcp_server.dhcprelayd.dhcprelayd.terminate_proc", return_value=None) as mock_terminate, \ + patch("dhcp_utilities.dhcprelayd.dhcprelayd.terminate_proc", return_value=None) as mock_terminate, \ patch.object(psutil.Process, "__init__", return_value=None), \ patch.object(psutil.Process, "status", return_value=proc_status), \ patch.object(ConfigDbEventChecker, "enable"): @@ -199,7 +199,7 @@ def test_execute_supervisor_dhcp_relay_process(mock_swsscommon_dbconnector_init, @pytest.mark.parametrize("target_cmds", [[["/usr/bin/dhcrelay"]], [["/usr/bin/dhcpmon"]]]) def test_check_dhcp_relay_process(mock_swsscommon_dbconnector_init, mock_swsscommon_table_init, target_cmds): exp_config = {"isc-dhcpv4-relay-Vlan1000": ["/usr/bin/dhcrelay"]} - with patch("dhcp_server.dhcprelayd.dhcprelayd.get_target_process_cmds", return_value=target_cmds), \ + with patch("dhcp_utilities.dhcprelayd.dhcprelayd.get_target_process_cmds", return_value=target_cmds), \ patch.object(DhcpRelayd, "dhcp_relay_supervisor_config", return_value=exp_config, new_callable=PropertyMock), \ patch.object(sys, "exit", mock_exit_func): diff --git a/src/sonic-dhcp-server/tests/test_dhcpservd.py b/src/sonic-dhcp-utilities/tests/test_dhcpservd.py similarity index 92% rename from src/sonic-dhcp-server/tests/test_dhcpservd.py rename to src/sonic-dhcp-utilities/tests/test_dhcpservd.py index 0eb74ca3011a..5a77999d7f92 100644 --- a/src/sonic-dhcp-server/tests/test_dhcpservd.py +++ b/src/sonic-dhcp-utilities/tests/test_dhcpservd.py @@ -4,10 +4,10 @@ import sys import time from common_utils import MockProc -from dhcp_server.common.utils import DhcpDbConnector -from dhcp_server.common.dhcp_db_monitor import DhcpServdDbMonitor -from dhcp_server.dhcpservd.dhcp_cfggen import DhcpServCfgGenerator -from dhcp_server.dhcpservd.dhcpservd import DhcpServd +from dhcp_utilities.common.utils import DhcpDbConnector +from dhcp_utilities.common.dhcp_db_monitor import DhcpServdDbMonitor +from dhcp_utilities.dhcpservd.dhcp_cfggen import DhcpServCfgGenerator +from dhcp_utilities.dhcpservd.dhcpservd import DhcpServd from swsscommon import swsscommon from unittest.mock import patch, call, MagicMock, PropertyMock @@ -21,9 +21,9 @@ @pytest.mark.parametrize("enabled_checker", [None, set(PORT_MODE_CHECKER)]) def test_dump_dhcp4_config(mock_swsscommon_dbconnector_init, enabled_checker): new_enabled_checker = set(["VlanTableEventChecker"]) - with patch("dhcp_server.dhcpservd.dhcp_cfggen.DhcpServCfgGenerator.generate", + with patch("dhcp_utilities.dhcpservd.dhcp_cfggen.DhcpServCfgGenerator.generate", return_value=("dummy_config", set(), set(), set(), new_enabled_checker)) as mock_generate, \ - patch("dhcp_server.dhcpservd.dhcpservd.DhcpServd._notify_kea_dhcp4_proc", + patch("dhcp_utilities.dhcpservd.dhcpservd.DhcpServd._notify_kea_dhcp4_proc", MagicMock()) as mock_notify_kea_dhcp4_proc, \ patch.object(DhcpServd, "dhcp_servd_monitor", return_value=DhcpServdDbMonitor, new_callable=PropertyMock), \ diff --git a/src/sonic-dhcp-server/tests/test_utils.py b/src/sonic-dhcp-utilities/tests/test_utils.py similarity index 99% rename from src/sonic-dhcp-server/tests/test_utils.py rename to src/sonic-dhcp-utilities/tests/test_utils.py index 129f2faf7f7c..8eb018a3c0e0 100644 --- a/src/sonic-dhcp-server/tests/test_utils.py +++ b/src/sonic-dhcp-utilities/tests/test_utils.py @@ -1,4 +1,4 @@ -import dhcp_server.common.utils as utils +import dhcp_utilities.common.utils as utils import ipaddress import psutil import pytest From dfe7c1e720cdc78b1c1308acf1762c3f18b938d5 Mon Sep 17 00:00:00 2001 From: arista-nwolfe <94405414+arista-nwolfe@users.noreply.github.com> Date: Tue, 28 Nov 2023 16:25:43 -0800 Subject: [PATCH 015/419] [Arista]: Disable SA_EQUALS_DA trap on DNX LC SKUs (#17206) This change was submitted directly to 202205 but it's also needed in master and 202305 with SAI9.x #13346 There has been a couple CSPs for this as well: CS00012273013 - [7.1][J2, J2c+] Disable SA Equals DA trap on DNX CS00012320965 - SAI9.2: iBGP doesn't work due to SA_EQUALS_DA trap If SA_EQUALS_DA trap is enabled iBGP won't work as the Ethernet-IB0 ports are expected to get packets with SA==DA. In the VOQ chassis design, for outgoing control plane packets, the packets goes the recycle port for routing, therefore the dmac of the packet should be the asic router mac. The source mac is assigned by the kernel, so it is also the asic router mac. --- .../Arista-7800R3-48CQ2-C48/jr2-a7280cr3-32d4-40x100G.config.bcm | 1 + .../0/j2p-a7800r3a-36d-36x400G.config.bcm | 1 + .../1/j2p-a7800r3a-36d-36x400G.config.bcm | 1 + .../0/j2p-a7800r3a-36d-36x400G.config.bcm | 1 + .../1/j2p-a7800r3a-36d-36x400G.config.bcm | 1 + .../0/j2p-a7800r3a-36d-36x400G.config.bcm | 1 + .../1/j2p-a7800r3a-36d-36x400G.config.bcm | 1 + src/sonic-device-data/tests/permitted_list | 1 + 8 files changed, 8 insertions(+) diff --git a/device/arista/x86_64-arista_7800r3_48cq2_lc/Arista-7800R3-48CQ2-C48/jr2-a7280cr3-32d4-40x100G.config.bcm b/device/arista/x86_64-arista_7800r3_48cq2_lc/Arista-7800R3-48CQ2-C48/jr2-a7280cr3-32d4-40x100G.config.bcm index 3d6885e6831e..f5f261610d25 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 @@ -861,3 +861,4 @@ dma_desc_aggregator_enable_specific_MDB_LPM.BCM8869X=1 dma_desc_aggregator_enable_specific_MDB_FEC.BCM8869X=1 sai_pfc_dlr_init_capability=0 sai_default_cpu_tx_tc=7 +sai_disable_srcmacqedstmac_ctrl=1 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 960ede5626c1..b0be0c5617b3 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 @@ -1015,3 +1015,4 @@ xflow_macsec_secure_chan_to_num_secure_assoc_encrypt=2 xflow_macsec_secure_chan_to_num_secure_assoc_decrypt=2 sai_pfc_dlr_init_capability=0 sai_default_cpu_tx_tc=7 +sai_disable_srcmacqedstmac_ctrl=1 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 7784b4876909..cc7d79bc2a88 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 @@ -1015,3 +1015,4 @@ xflow_macsec_secure_chan_to_num_secure_assoc_encrypt=2 xflow_macsec_secure_chan_to_num_secure_assoc_decrypt=2 sai_pfc_dlr_init_capability=0 sai_default_cpu_tx_tc=7 +sai_disable_srcmacqedstmac_ctrl=1 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 9530ae83ce04..34b8c52a91d3 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 @@ -1032,3 +1032,4 @@ xflow_macsec_secure_chan_to_num_secure_assoc_encrypt=2 xflow_macsec_secure_chan_to_num_secure_assoc_decrypt=4 sai_pfc_dlr_init_capability=0 sai_default_cpu_tx_tc=7 +sai_disable_srcmacqedstmac_ctrl=1 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 3c5039fcd4a0..97a58f37acda 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 @@ -1032,3 +1032,4 @@ xflow_macsec_secure_chan_to_num_secure_assoc_encrypt=2 xflow_macsec_secure_chan_to_num_secure_assoc_decrypt=4 sai_pfc_dlr_init_capability=0 sai_default_cpu_tx_tc=7 +sai_disable_srcmacqedstmac_ctrl=1 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 6a52876baa4d..bcb27b873431 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 @@ -1052,3 +1052,4 @@ xflow_macsec_secure_chan_to_num_secure_assoc_encrypt=2 xflow_macsec_secure_chan_to_num_secure_assoc_decrypt=4 sai_pfc_dlr_init_capability=0 sai_default_cpu_tx_tc=7 +sai_disable_srcmacqedstmac_ctrl=1 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 d1065f0ff8a6..ee9bf638a792 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 @@ -1052,3 +1052,4 @@ xflow_macsec_secure_chan_to_num_secure_assoc_encrypt=2 xflow_macsec_secure_chan_to_num_secure_assoc_decrypt=4 sai_pfc_dlr_init_capability=0 sai_default_cpu_tx_tc=7 +sai_disable_srcmacqedstmac_ctrl=1 diff --git a/src/sonic-device-data/tests/permitted_list b/src/sonic-device-data/tests/permitted_list index 017ae8f8295a..2992024b9eef 100644 --- a/src/sonic-device-data/tests/permitted_list +++ b/src/sonic-device-data/tests/permitted_list @@ -340,3 +340,4 @@ sai_nbr_bcast_ifp_optimized sai_pfc_defaults_disable sai_optimized_mmu sai_default_cpu_tx_tc +sai_disable_srcmacqedstmac_ctrl From b78e3a0d20c4b0ff5c90dbaf650f9921605e59f4 Mon Sep 17 00:00:00 2001 From: Xincun Li <147451452+xincunli-sonic@users.noreply.github.com> Date: Wed, 29 Nov 2023 17:22:47 -0800 Subject: [PATCH 016/419] Ensure that 'logrotate-config.service' is set as a dependency to start before 'logrotate.service'. (#17312) * Ensure that 'logrotate-config.service' is set as a dependency to start before 'logrotate.service'. --- build_debian.sh | 4 ++++ files/image_config/logrotate/logrotate-config.service | 1 + files/image_config/logrotate/logrotateOverride.conf | 2 ++ 3 files changed, 7 insertions(+) create mode 100644 files/image_config/logrotate/logrotateOverride.conf diff --git a/build_debian.sh b/build_debian.sh index 055daba9e66b..1f9bc8eba042 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -475,6 +475,10 @@ fi ## Disable kexec supported reboot which was installed by default sudo sed -i 's/LOAD_KEXEC=true/LOAD_KEXEC=false/' $FILESYSTEM_ROOT/etc/default/kexec +# Ensure that 'logrotate-config.service' is set as a dependency to start before 'logrotate.service'. +sudo mkdir $FILESYSTEM_ROOT/etc/systemd/system/logrotate.service.d +sudo cp files/image_config/logrotate/logrotateOverride.conf $FILESYSTEM_ROOT/etc/systemd/system/logrotate.service.d/logrotateOverride.conf + ## Remove sshd host keys, and will regenerate on first sshd start sudo rm -f $FILESYSTEM_ROOT/etc/ssh/ssh_host_*_key* sudo cp files/sshd/host-ssh-keygen.sh $FILESYSTEM_ROOT/usr/local/bin/ diff --git a/files/image_config/logrotate/logrotate-config.service b/files/image_config/logrotate/logrotate-config.service index b965e4b32425..0b89f9d85791 100644 --- a/files/image_config/logrotate/logrotate-config.service +++ b/files/image_config/logrotate/logrotate-config.service @@ -6,6 +6,7 @@ After=updategraph.service [Service] Type=oneshot ExecStart=/usr/bin/logrotate-config.sh +RemainAfterExit=yes [Install] WantedBy=multi-user.target diff --git a/files/image_config/logrotate/logrotateOverride.conf b/files/image_config/logrotate/logrotateOverride.conf new file mode 100644 index 000000000000..adc85ff306b5 --- /dev/null +++ b/files/image_config/logrotate/logrotateOverride.conf @@ -0,0 +1,2 @@ +[Unit] +Requires=logrotate-config.service \ No newline at end of file From 936f8689b97f85ba554165fdca7a2a2046e8ba5a Mon Sep 17 00:00:00 2001 From: ShiyanWangMS Date: Thu, 30 Nov 2023 09:23:25 +0800 Subject: [PATCH 017/419] Remove Python3 venv in Python3-only sonic-mgmt-docker (#17337) How I did it Remove Python3 venv in Python3-only sonic-mgmt-docker How to verify it There is no impact to sonic-mgmt-docker:latest tag. Build sonic-mgmt-docker with LEGACY_SONIC_MGMT_DOCKER=y, see python3 venv is there. Build sonic-mgmt-docker with LEGACY_SONIC_MGMT_DOCKER=n, see python3 venv is NOT included. --- dockers/docker-sonic-mgmt/Dockerfile.j2 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dockers/docker-sonic-mgmt/Dockerfile.j2 b/dockers/docker-sonic-mgmt/Dockerfile.j2 index 0c578fa2b100..63985576bd12 100755 --- a/dockers/docker-sonic-mgmt/Dockerfile.j2 +++ b/dockers/docker-sonic-mgmt/Dockerfile.j2 @@ -261,6 +261,7 @@ WORKDIR /var/$user # Add az symlink for backwards compatibility RUN mkdir bin && ln -s /usr/bin/az bin/az +{% if legacy == 'y' or legacy == '1' %} RUN python3 -m venv --system-site-packages env-python3 # Activating a virtualenv. The virtualenv automatically works for RUN, ENV and CMD. @@ -341,12 +342,13 @@ RUN python3 -m pip install aiohttp \ # Deactivating a virtualenv ENV PATH="$BACKUP_OF_PATH" +{% endif %} USER root WORKDIR /azp COPY start.sh \ 0001-Fix-getattr-AttributeError-in-multi-thread-scenario.patch \ - ./ + ./ RUN chmod +x start.sh \ && ln -sf /usr/bin/python3 /usr/bin/python \ && ln -sf `which pip3` /usr/bin/pip \ From 345064dccb0b1f1ac27a01f4a6be70eb388ae097 Mon Sep 17 00:00:00 2001 From: Yaqiang Zhu Date: Thu, 30 Nov 2023 16:52:54 -0500 Subject: [PATCH 018/419] [dhcp_server] Set to build dhcp_server image in vs image (#17340) Currently in this repo would not build dhcp_server container image by default, which would cause that building issue for dhcp_server introduced by other modules cannot be noticed in time. This PR is to set build dhcp_server container in vs image. --- azure-pipelines.yml | 2 +- rules/config | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7de4dbff3951..360ca9fdf367 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -50,7 +50,7 @@ stages: jobs: - template: .azure-pipelines/azure-pipelines-build.yml parameters: - buildOptions: 'USERNAME=admin SONIC_BUILD_JOBS=$(nproc) BUILD_MULTIASIC_KVM=y ${{ variables.VERSION_CONTROL_OPTIONS }}' + buildOptions: 'USERNAME=admin SONIC_BUILD_JOBS=$(nproc) BUILD_MULTIASIC_KVM=y INCLUDE_DHCP_SERVER=y ${{ variables.VERSION_CONTROL_OPTIONS }}' jobGroups: - name: vs diff --git a/rules/config b/rules/config index bd77e91c59d9..b9a7efa81502 100644 --- a/rules/config +++ b/rules/config @@ -153,7 +153,7 @@ INCLUDE_NAT = y INCLUDE_DHCP_RELAY = y # INCLUDE_DHCP_SERVER - build and install dhcp-server package -INCLUDE_DHCP_SERVER = n +INCLUDE_DHCP_SERVER ?= n # INCLUDE_P4RT - build docker-p4rt for P4RT support INCLUDE_P4RT = n From 7d308e340a0c847f39cd203ad4a2c287b9c68e34 Mon Sep 17 00:00:00 2001 From: Lawrence Lee Date: Thu, 30 Nov 2023 14:23:05 -0800 Subject: [PATCH 019/419] [arp_update]: Flush neighbors with incorrect MAC info (#17238) [arp_update]: Flush MAC mismatch neighbors - Check for MAC mismatch between neighbor entries in the kernel and APPL_DB - Flush any entries with a mismatch --- files/scripts/arp_update | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/files/scripts/arp_update b/files/scripts/arp_update index 14a82ebe4da3..f402d53dced3 100755 --- a/files/scripts/arp_update +++ b/files/scripts/arp_update @@ -9,6 +9,11 @@ ARP_UPDATE_VARS_FILE="/usr/share/sonic/templates/arp_update_vars.j2" +# Overload `logger` command to include arp_update tag +logger () { + command logger -t "arp_update" "$@" +} + while /bin/true; do # find L3 interfaces which are UP, send ipv6 multicast pings ARP_UPDATE_VARS=$(sonic-cfggen -d -t ${ARP_UPDATE_VARS_FILE}) @@ -19,7 +24,7 @@ while /bin/true; do STATIC_ROUTE_IFNAMES=($(echo $ARP_UPDATE_VARS | jq -r '.static_route_ifnames')) # on supervisor/rp exit the script gracefully if [[ -z "$STATIC_ROUTE_NEXTHOPS" ]] || [[ -z "$STATIC_ROUTE_IFNAMES" ]]; then - logger "arp_update: exiting as no static route in packet based chassis" + logger "exiting as no static route in packet based chassis" exit 0 fi for i in ${!STATIC_ROUTE_NEXTHOPS[@]}; do @@ -38,7 +43,7 @@ while /bin/true; do 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" + logger -p error "missing interface entry for static route $nexthop" continue fi intf_up=$(ip link show $interface | grep "state UP") @@ -47,7 +52,7 @@ while /bin/true; do eval $pingcmd # STALE entries may appear more often, not logging to prevent periodic syslogs if [[ -z $(echo ${neigh_state} | grep 'STALE') ]]; then - logger "arp_update: static route nexthop not resolved ($neigh_state), pinging $nexthop on $interface" + logger "static route nexthop not resolved ($neigh_state), pinging $nexthop on $interface" fi fi fi @@ -70,6 +75,30 @@ while /bin/true; do fi done + # find neighbor entries with aged MAC and flush/relearn them + STALE_NEIGHS=$(ip neigh show | grep -v "fe80" | grep "STALE" | awk '{print $1 "," $5}' | tr [:lower:] [:upper:]) + for neigh in $STALE_NEIGHS; do + ip="$( cut -d ',' -f 1 <<< "$neigh" )" + mac="$( cut -d ',' -f 2 <<< "$neigh" )" + if [[ -z $(sonic-db-cli ASIC_DB keys "ASIC_STATE:SAI_OBJECT_TYPE_FDB_ENTRY*${mac}*") ]]; then + timeout 0.2 ping -c1 -w1 $ip > /dev/null + fi + done + + # Flush neighbor entries with MAC mismatch between kernel and APPL_DB + KERNEL_NEIGH=$(ip neigh show | grep -v "fe80" | grep -v "FAILED\|INCOMPLETE" | cut -d ' ' -f 1,3,5 --output-delimiter=',' | tr -d ' ') + for neigh in $KERNEL_NEIGH; do + ip="$( cut -d ',' -f 1 <<< "$neigh" )" + intf="$( cut -d ',' -f 2 <<< "$neigh" )" + kernel_mac="$( cut -d ',' -f 3 <<< "$neigh" )" + appl_db_mac="$(sonic-db-cli APPL_DB hget NEIGH_TABLE:$intf:$ip neigh)" + if [[ $kernel_mac != $appl_db_mac ]]; then + logger -p warning "MAC mismatch for ${ip} on ${intf} - kernel: ${kernel_mac}, APPL_DB: ${appl_db_mac}" + ip neigh flush $ip + timeout 0.2 ping -c1 -w1 $ip > /dev/null + fi + done + VLAN=$(echo $ARP_UPDATE_VARS | jq -r '.vlan') SUBTYPE=$(sonic-db-cli CONFIG_DB hget 'DEVICE_METADATA|localhost' 'subtype' | tr '[:upper:]' '[:lower:]') for vlan in $VLAN; do @@ -158,11 +187,11 @@ while /bin/true; do if [[ $ip == *"."* ]] && [[ ! $KERNEIGH4 =~ "${ip},${intf}" ]]; then pingcmd="timeout 0.2 ping -I $intf -n -q -i 0 -c 1 -W 1 $ip >/dev/null" eval $pingcmd - logger "arp_update: mismatch arp entry, pinging ${ip} on ${intf}" + logger "mismatch arp entry, pinging ${ip} on ${intf}" elif [[ $ip == *":"* ]] && [[ ! $KERNEIGH6 =~ "${ip},${intf}" ]]; then ping6cmd="timeout 0.2 ping6 -I $intf -n -q -i 0 -c 1 -W 1 $ip >/dev/null" eval $ping6cmd - logger "arp_update: mismatch v6 nbr entry, pinging ${ip} on ${intf}" + logger "mismatch v6 nbr entry, pinging ${ip} on ${intf}" fi fi done From 451398f8013125b8fe69a4cd02080913cf946768 Mon Sep 17 00:00:00 2001 From: Pavan-Nokia <120486223+Pavan-Nokia@users.noreply.github.com> Date: Thu, 30 Nov 2023 19:34:53 -0500 Subject: [PATCH 020/419] [Nokia-7215][armhf] Enable Watchdog service (#16612) Enable CPUWDT service to enable watchdog --- .../7215/scripts/cpu_wdt.py | 46 ++++++++++ .../7215/service/cpu_wdt.service | 8 ++ .../7215/sonic_platform/watchdog.py | 86 ++++++++++++------- .../debian/sonic-platform-nokia-7215.install | 2 + .../debian/sonic-platform-nokia-7215.postinst | 3 + 5 files changed, 115 insertions(+), 30 deletions(-) create mode 100755 platform/marvell-armhf/sonic-platform-nokia/7215/scripts/cpu_wdt.py create mode 100644 platform/marvell-armhf/sonic-platform-nokia/7215/service/cpu_wdt.service diff --git a/platform/marvell-armhf/sonic-platform-nokia/7215/scripts/cpu_wdt.py b/platform/marvell-armhf/sonic-platform-nokia/7215/scripts/cpu_wdt.py new file mode 100755 index 000000000000..60f75b4f2e50 --- /dev/null +++ b/platform/marvell-armhf/sonic-platform-nokia/7215/scripts/cpu_wdt.py @@ -0,0 +1,46 @@ +#!/usr/bin/python + +from sonic_platform.chassis import Chassis +from sonic_py_common import logger +import time +import os +import signal +import sys + + +TIMEOUT=170 +KEEPALIVE=55 +sonic_logger = logger.Logger('Watchdog') +sonic_logger.set_min_log_priority_info() +time.sleep(60) +chassis = Chassis() +watchdog = chassis.get_watchdog() + +def stopWdtService(signal, frame): + watchdog._disablewatchdog() + sonic_logger.log_notice("CPUWDT Disabled: watchdog armed=%s" % watchdog.is_armed() ) + sys.exit() + +def main(): + + signal.signal(signal.SIGHUP, signal.SIG_IGN) + signal.signal(signal.SIGINT, stopWdtService) + signal.signal(signal.SIGTERM, stopWdtService) + + watchdog.arm(TIMEOUT) + sonic_logger.log_notice("CPUWDT Enabled: watchdog armed=%s" % watchdog.is_armed() ) + + + while True: + time.sleep(KEEPALIVE) + watchdog._keepalive() + sonic_logger.log_info("CPUWDT keepalive") + done + + stopWdtService + + return + + +if __name__ == '__main__': + main() diff --git a/platform/marvell-armhf/sonic-platform-nokia/7215/service/cpu_wdt.service b/platform/marvell-armhf/sonic-platform-nokia/7215/service/cpu_wdt.service new file mode 100644 index 000000000000..761deec569cc --- /dev/null +++ b/platform/marvell-armhf/sonic-platform-nokia/7215/service/cpu_wdt.service @@ -0,0 +1,8 @@ +[Unit] +Description=CPU WDT +After=nokia-7215init.service +[Service] +ExecStart=/usr/local/bin/cpu_wdt.py + +[Install] +WantedBy=multi-user.target diff --git a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/watchdog.py b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/watchdog.py index 903b6365dc48..03a8d9ecb4e7 100644 --- a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/watchdog.py +++ b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/watchdog.py @@ -8,7 +8,7 @@ import os import fcntl import array - +import time from sonic_platform_base.watchdog_base import WatchdogBase """ ioctl constants """ @@ -35,7 +35,7 @@ WDIOS_ENABLECARD = 0x0002 """ watchdog sysfs """ -WD_SYSFS_PATH = "/sys/class/watchdog/" +WD_SYSFS_PATH = "/sys/class/watchdog/watchdog0/" WD_COMMON_ERROR = -1 @@ -52,16 +52,32 @@ def __init__(self, wd_device_path): @param wd_device_path Path to watchdog device """ super(WatchdogImplBase, self).__init__() - + + self.watchdog="" self.watchdog_path = wd_device_path - self.watchdog = os.open(self.watchdog_path, os.O_WRONLY) - - # Opening a watchdog descriptor starts - # watchdog timer; by default it should be stopped - self._disablewatchdog() - self.armed = False + self.wd_state_reg = WD_SYSFS_PATH+"state" + self.wd_timeout_reg = WD_SYSFS_PATH+"timeout" + self.wd_timeleft_reg = WD_SYSFS_PATH+"timeleft" + self.timeout = self._gettimeout() + def _read_sysfs_file(self, sysfs_file): + # On successful read, returns the value read from given + # reg_name and on failure returns 'ERR' + rv = 'ERR' + + if (not os.path.isfile(sysfs_file)): + return rv + try: + with open(sysfs_file, 'r') as fd: + rv = fd.read() + except Exception as e: + rv = 'ERR' + + rv = rv.rstrip('\r\n') + rv = rv.lstrip(" ") + return rv + def _disablewatchdog(self): """ Turn off the watchdog timer @@ -102,11 +118,10 @@ def _gettimeout(self): Get watchdog timeout @return watchdog timeout """ + timeout=0 + timeout=self._read_sysfs_file(self.wd_timeout_reg) - req = array.array('I', [0]) - fcntl.ioctl(self.watchdog, WDIOC_GETTIMEOUT, req, True) - - return int(req[0]) + return timeout def _gettimeleft(self): """ @@ -127,15 +142,20 @@ def arm(self, seconds): ret = WD_COMMON_ERROR if seconds < 0: return ret - + + # Stop the watchdog service to gain access of watchdog file pointer + if self.is_armed(): + os.popen("systemctl stop cpu_wdt.service") + time.sleep(2) + if not self.watchdog: + self.watchdog = os.open(self.watchdog_path, os.O_WRONLY) try: if self.timeout != seconds: self.timeout = self._settimeout(seconds) - if self.armed: + if self.is_armed(): self._keepalive() else: self._enablewatchdog() - self.armed = True ret = self.timeout except IOError: pass @@ -150,13 +170,17 @@ def disarm(self): A boolean, True if watchdog is disarmed successfully, False if not """ - - try: - self._disablewatchdog() - self.armed = False - self.timeout = 0 - except IOError: - return False + + if self.is_armed(): + os.popen("systemctl stop cpu_wdt.service") + time.sleep(2) + if not self.watchdog: + self.watchdog = os.open(self.watchdog_path, os.O_WRONLY) + try: + self._disablewatchdog() + self.timeout = 0 + except IOError: + return False return True @@ -164,8 +188,13 @@ def is_armed(self): """ Implements is_armed WatchdogBase API """ + status = False + + state = self._read_sysfs_file(self.wd_state_reg) + if (state != 'inactive'): + status = True - return self.armed + return status def get_remaining_time(self): """ @@ -174,10 +203,7 @@ def get_remaining_time(self): timeleft = WD_COMMON_ERROR - if self.armed: - try: - timeleft = self._gettimeleft() - except IOError: - pass + if self.is_armed(): + timeleft=self._read_sysfs_file(self.wd_timeleft_reg) - return timeleft + return int(timeleft) diff --git a/platform/marvell-armhf/sonic-platform-nokia/debian/sonic-platform-nokia-7215.install b/platform/marvell-armhf/sonic-platform-nokia/debian/sonic-platform-nokia-7215.install index 8ce8d1726524..bca328306eab 100644 --- a/platform/marvell-armhf/sonic-platform-nokia/debian/sonic-platform-nokia-7215.install +++ b/platform/marvell-armhf/sonic-platform-nokia/debian/sonic-platform-nokia-7215.install @@ -1,6 +1,8 @@ nokia-7215_plt_setup.sh usr/sbin 7215/scripts/nokia-7215init.sh usr/local/bin +7215/scripts/cpu_wdt.py usr/local/bin 7215/service/nokia-7215init.service etc/systemd/system +7215/service/cpu_wdt.service etc/systemd/system 7215/service/fstrim.timer/timer-override.conf /lib/systemd/system/fstrim.timer.d 7215/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/armhf-nokia_ixs7215_52x-r0 inband_mgmt.sh etc/ diff --git a/platform/marvell-armhf/sonic-platform-nokia/debian/sonic-platform-nokia-7215.postinst b/platform/marvell-armhf/sonic-platform-nokia/debian/sonic-platform-nokia-7215.postinst index de91cedb4ec7..76d40865a0ac 100644 --- a/platform/marvell-armhf/sonic-platform-nokia/debian/sonic-platform-nokia-7215.postinst +++ b/platform/marvell-armhf/sonic-platform-nokia/debian/sonic-platform-nokia-7215.postinst @@ -7,5 +7,8 @@ sh /usr/sbin/nokia-7215_plt_setup.sh systemctl enable nokia-7215init.service systemctl start nokia-7215init.service +systemctl enable cpu_wdt.service +systemctl start cpu_wdt.service + exit 0 From dccc5bf6cf1920e0c526cc61cb5938d3d075e59e Mon Sep 17 00:00:00 2001 From: Tomer Shalvi <116184476+tshalvi@users.noreply.github.com> Date: Fri, 1 Dec 2023 03:18:09 +0200 Subject: [PATCH 021/419] Media_settings.json Validator Update (#16908) The format of the media_settings.json file was updated to support the Port SI Per Speed Enhancements. Since media_checker is the validator for the media_settings.json file, it needs to be updated to align with the new format. How I did it I added six new SI parameter names introduced as part of the Port SI Per Speed Enhancements. Additionally, I implemented handling for the new hierarchy level (lane_speed_key) in the updated media_settings.json format while maintaining backward compatibility with vendors whose JSON does not support port SI per speed. How to verify it I locally built the Debian package using 'make target/debs/bullseye/sonic-device-data_1.0-1_all.deb,' and it completed successfully. Jenkins also built the entire image, which includes the media_checker as part of its process. --- src/sonic-device-data/tests/media_checker | 38 +++++++++++++++++------ 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/src/sonic-device-data/tests/media_checker b/src/sonic-device-data/tests/media_checker index dc9567985dcb..9826914c5043 100755 --- a/src/sonic-device-data/tests/media_checker +++ b/src/sonic-device-data/tests/media_checker @@ -7,9 +7,12 @@ import sys level1_keys = ["GLOBAL_MEDIA_SETTINGS","PORT_MEDIA_SETTINGS"] -setting_keys = ["preemphasis","idriver","ipredriver",\ - "main","pre1","pre2","pre3",\ - "post1","post2","post3","attn"] +si_param_list = ["preemphasis", "idriver", "ipredriver", \ + "main", "pre1", "pre2", "pre3", \ + "post1", "post2", "post3", "attn", \ + "ob_m2lp", "ob_alev_out", "obplev", "obnlev", \ + "regn_bfm1p", "regn_bfm1n"] +lane_speed_key_prefix = 'speed:' lane_prefix = "lane" comma_separator = "," range_separator = "-" @@ -46,17 +49,32 @@ def check_media_dict(vendor_dict): print("Expecting settings for vendor type " + vendor_key) return False + lane_speed_hierarchy_exists = None + for value_key in value_dict: - if value_key not in setting_keys: - print("Unknown media setting " + value_key) - return False + if value_key.startswith(lane_speed_key_prefix): + if lane_speed_hierarchy_exists is False: + print("Inconsistent lane speed hierarchy levels for the same entry") + return False + lane_speed_hierarchy_exists = True + settings_dict = value_dict[value_key] + else: + if lane_speed_hierarchy_exists is True: + print("Inconsistent lane speed hierarchy levels for the same entry") + return False + lane_speed_hierarchy_exists = False + settings_dict = value_dict - lane_dict = value_dict[value_key] - for lanes in lane_dict: - if not check_lane_and_value(lanes, lane_dict[lanes]): + for si_param in settings_dict: + if si_param not in si_param_list: + print("Unknown media setting " + si_param) return False - return True + lane_dict = settings_dict[si_param] + for lanes in lane_dict: + if not check_lane_and_value(lanes, lane_dict[lanes]): + return False + return True def check_valid_port(port_name): try: From 15d9177c14794419568d06bdc731bce1a62cfb51 Mon Sep 17 00:00:00 2001 From: Dev Ojha <47282568+developfast@users.noreply.github.com> Date: Thu, 30 Nov 2023 21:33:00 -0800 Subject: [PATCH 022/419] [Snappi] Update snappi module on sonic-mgmt docker (#17269) * Update snappi module on Dockerfile.j2 * Update snappi module on Dockerfile.j2 * Update snappi module for py2 and venv --- dockers/docker-sonic-mgmt/Dockerfile.j2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dockers/docker-sonic-mgmt/Dockerfile.j2 b/dockers/docker-sonic-mgmt/Dockerfile.j2 index 63985576bd12..5e634f0b983f 100755 --- a/dockers/docker-sonic-mgmt/Dockerfile.j2 +++ b/dockers/docker-sonic-mgmt/Dockerfile.j2 @@ -101,7 +101,7 @@ RUN python3 -m pip install aiohttp \ scapy==2.4.5 \ setuptools-rust \ six \ - snappi[ixnetwork,convergence]==0.11.16 \ + snappi[ixnetwork,convergence]==0.9.1 \ tabulate \ textfsm==1.1.2 \ thrift==0.11.0 \ @@ -182,7 +182,7 @@ RUN python2 -m pip install allure-pytest==2.8.22 \ scandir \ scapy==2.4.5 \ six \ - snappi[ixnetwork,convergence]==0.11.16 \ + snappi[ixnetwork,convergence]==0.9.1 \ statistics \ tabulate \ textfsm==1.1.3 \ @@ -333,7 +333,7 @@ RUN python3 -m pip install aiohttp \ scapy==2.4.5 \ setuptools-rust \ six \ - snappi[ixnetwork,convergence]==0.11.16 \ + snappi[ixnetwork,convergence]==0.9.1 \ sshconf==0.2.5 \ tabulate \ textfsm==1.1.2 \ From 8c782c91a49685c702784350bc4e250faba3796f Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Thu, 30 Nov 2023 22:56:05 -0800 Subject: [PATCH 023/419] [FRR]zebra: Fix fpm multipath encap addition (#17247) Why I did it To fix the EVPN type5 failure seen in FRR when there are multipaths for nexthop. The type5 routes were queued show ip route vrf Vrf1 Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP, T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR, f - OpenFabric, > - selected route, * - FIB route, q - queued, r - rejected, b - backup t - trapped, o - offload failure VRF Vrf1: B>q 5.5.5.0/24 [200/0] via 30.0.0.2, Vlan100 onlink, weight 1, 00:00:40 q via 40.0.0.3, Vlan100 onlink, weight 1, 00:00:40 C>* 10.0.0.0/24 is directly connected, Vlan10, 00:00:43 B>q 100.0.0.0/24 [200/0] via 30.0.0.2, Vlan100 onlink, weight 1, 00:00:40 q via 40.0.0.3, Vlan100 onlink, weight 1, 00:00:40 Work item tracking Microsoft ADO (number only): How I did it Porting the FRR fix FRRouting/frr#14835 How to verify it Validated EVPN multipath with the scenario and confirmed its working. --- ...bra-Fix-fpm-multipath-encap-addition.patch | 58 +++++++++++++++++++ src/sonic-frr/patch/series | 1 + 2 files changed, 59 insertions(+) create mode 100644 src/sonic-frr/patch/0032-zebra-Fix-fpm-multipath-encap-addition.patch diff --git a/src/sonic-frr/patch/0032-zebra-Fix-fpm-multipath-encap-addition.patch b/src/sonic-frr/patch/0032-zebra-Fix-fpm-multipath-encap-addition.patch new file mode 100644 index 000000000000..5e3ce1441206 --- /dev/null +++ b/src/sonic-frr/patch/0032-zebra-Fix-fpm-multipath-encap-addition.patch @@ -0,0 +1,58 @@ +From b7ac2397103fe7d347d0766bd9966ff2302403c5 Mon Sep 17 00:00:00 2001 +From: dgsudharsan +Date: Tue, 21 Nov 2023 01:17:24 +0000 +Subject: [PATCH] zebra: Fix fpm multipath encap addition The fpm code path in + building a ecmp route for evpn has a bug that caused it to not add the encap + attribute to the netlink message. See + #f0f7b285b99dbd971400d33feea007232c0bd4a9 for the single path case being + fixed. + + +diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c +index 71505e037a..6bdc15592c 100644 +--- a/zebra/rt_netlink.c ++++ b/zebra/rt_netlink.c +@@ -2330,6 +2330,16 @@ ssize_t netlink_route_multipath_msg_encode(int cmd, + tag)) + return 0; + ++ /* ++ * Add encapsulation information when installing via ++ * FPM. ++ */ ++ if (fpm) { ++ if (!netlink_route_nexthop_encap( ++ &req->n, datalen, nexthop)) ++ return 0; ++ } ++ + if (!setsrc && src1) { + if (p->family == AF_INET) + src.ipv4 = src1->ipv4; +@@ -2343,23 +2353,6 @@ ssize_t netlink_route_multipath_msg_encode(int cmd, + + nl_attr_nest_end(&req->n, nest); + +- /* +- * Add encapsulation information when installing via +- * FPM. +- */ +- if (fpm) { +- for (ALL_NEXTHOPS_PTR(dplane_ctx_get_ng(ctx), +- nexthop)) { +- if (CHECK_FLAG(nexthop->flags, +- NEXTHOP_FLAG_RECURSIVE)) +- continue; +- if (!netlink_route_nexthop_encap( +- &req->n, datalen, nexthop)) +- return 0; +- } +- } +- +- + if (setsrc) { + if (p->family == AF_INET) { + if (!nl_attr_put(&req->n, datalen, RTA_PREFSRC, +-- +2.17.1 + diff --git a/src/sonic-frr/patch/series b/src/sonic-frr/patch/series index a2689c1529ca..c87c5e61f986 100644 --- a/src/sonic-frr/patch/series +++ b/src/sonic-frr/patch/series @@ -31,3 +31,4 @@ cross-compile-changes.patch 0029-bgpd-Handle-MP_REACH_NLRI-malformed-packets-with-ses.patch 0030-bgpd-Treat-EOR-as-withdrawn-to-avoid-unwanted-handli.patch 0031-bgpd-Ignore-handling-NLRIs-if-we-received-MP_UNREACH.patch +0032-zebra-Fix-fpm-multipath-encap-addition.patch From 2528b706301df6ac51e66553c93f7232d4e06cf7 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Sun, 3 Dec 2023 21:32:56 +0800 Subject: [PATCH 024/419] [Mellanox] Add special rsyslog filter for MSN2410 platform (#17365) - Why I did it Mellanox MSN2410 platforms have a non-functional error log: "ERR pmon#sensord: Error getting sensor data: dps460/#10: Can't read". This error is because of a firmware issue with some PSU, we are not able to upgrade the FW online. Since there is no functional impact, this error log can be ignored safely - How I did it Add a new rsyslog rule to the rsyslog-container.conf.j2, if the docker name is pmon and the platform name matches, the new rule will be inserted into the docker rsyslogd.conf - How to verify it run regression on the MSN2410 platform to make the error log will not be printed to the syslog. Signed-off-by: Kebo Liu --- files/image_config/rsyslog/rsyslog-container.conf.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/image_config/rsyslog/rsyslog-container.conf.j2 b/files/image_config/rsyslog/rsyslog-container.conf.j2 index bb786eacd4ec..4dff4695704a 100644 --- a/files/image_config/rsyslog/rsyslog-container.conf.j2 +++ b/files/image_config/rsyslog/rsyslog-container.conf.j2 @@ -53,9 +53,9 @@ $SystemLogRateLimitBurst 20000 #### GLOBAL DIRECTIVES #### ########################### {% if container_name == 'pmon' %} -{% if platform == 'x86_64-mlnx_msn2700-r0' or platform == 'x86_64-mlnx_msn2700a1-r0' %} +{% if platform == 'x86_64-mlnx_msn2700-r0' or platform == 'x86_64-mlnx_msn2700a1-r0' or platform == 'x86_64-mlnx_msn2410-r0' %} -# This rsyslog configuration is intended to resolve the following error message that only appears on the MSN2700 platform: +# This rsyslog configuration is intended to resolve the following error message that only appears on the MSN2700 and MSN2410 platforms: # "ERR pmon#sensord: Error getting sensor data: dps460/#10: Can't read" # This error is because of firmware issue with some type of PSU, we are not able to upgrade the FW online. # Since there is no functional impact, this error log can be ignored safely. From 897a0236379bec9edb9d621f39dec8cfcb244df5 Mon Sep 17 00:00:00 2001 From: zitingguo-ms Date: Mon, 4 Dec 2023 09:31:39 +0800 Subject: [PATCH 025/419] Upgrade xgs SAI version to 8.4.31.0 (#17059) Why I did it Upgrade the xgs SAI version to 8.4.31.0 to include the following changes: 8.4.22.0: [SDK upgrade][CSP CS00012314723][SAI_BRANCH rel_ocp_sai_8_4] SID:bcmtmPfcDdrScan thread takes 100% CPU utilization 8.4.23.0: [SDK upgrade][CSP CS00012290176[SAI_BRANCH rel_ocp_sai_8_4] SDK-323160: bcm_l3_ecmp_member_add returns Table Full error while ISSU 8.4.24.0: [SDK upgrade]Merge "[CSP NA][SAI_BRANCH rel_ocp_sai_8_4] SID: Software LinkScan Not Catching Short Local/Remote Fault Events" into hsdk_6.5.27_SAI_8.4.0_GA [SDK upgrade][CSP NA][SAI_BRANCH rel_ocp_sai_8_4] SID: Software LinkScan Not Catching Short Local/Remote Fault Events 8.4.25.0: [SAI_BRANCH rel_ocp_sai_8_4]CLONE - SAI - 8.4 - _brcm_sai_cosq_stat_get errors for CPU queue 41 8.4.26.0: [CSP CS00012307911] Fixed incorrect CPU related SAI port obj encoding/decoding in most subsystems 8.4.27.0: [CSP CS00012309154] [TD3] SAI_STATUS_INVALID_PARAMETER on setting SAI_BUFFER_POOL_ATTR_SIZE, OA crash 8.4.28.0: [CSP CS00012315552] Excessive logging from _brcm_sai_acl_tbl_grp_mbr_migration 8.4.29.0: [CSP CS00012321369] Fix TH2 regression with MMU/pool size 8.4.30.0: [SDK upgrade][CSP CS00012316299][SAI_BRANCH rel_ocp_sai_8_4] L3 entry delete failed when SER error is present 8.4.31.0: [CSP CS00012307911] Revert and limit scope of previous change due to WB issue. Work item tracking Microsoft ADO (number only): 26021230 How I did it Upgrade the SAI version in sai.mk file. How to verify it Run advanced reboot on TH2 and TD3: https://dev.azure.com/mssonic/internal/_build/results?buildId=422024&view=results https://dev.azure.com/mssonic/internal/_build/results?buildId=423352&view=results @saiarcot895 run warm reboot from 202012 to target image and they've passed TH2: https://dev.azure.com/mssonic/internal/_build/results?buildId=423112&view=logs&j=76acabad-01e9-5c52-6fe6-d396d63e85d2&t=0d14fb40-14d5-50ca-4a23-af1778140cbf TH: https://dev.azure.com/mssonic/internal/_build/results?buildId=423119&view=logs&j=76acabad-01e9-5c52-6fe6-d396d63e85d2&t=0d14fb40-14d5-50ca-4a23-af1778140cbf TD3: https://dev.azure.com/mssonic/internal/_build/results?buildId=423074&view=logs&j=76acabad-01e9-5c52-6fe6-d396d63e85d2&t=0d14fb40-14d5-50ca-4a23-af1778140cbf --- platform/broadcom/sai.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/broadcom/sai.mk b/platform/broadcom/sai.mk index 3b534eb2783d..92a1d95981bf 100644 --- a/platform/broadcom/sai.mk +++ b/platform/broadcom/sai.mk @@ -1,4 +1,4 @@ -LIBSAIBCM_XGS_VERSION = 8.4.21.0 +LIBSAIBCM_XGS_VERSION = 8.4.31.0 LIBSAIBCM_DNX_VERSION = 7.1.111.1 LIBSAIBCM_XGS_BRANCH_NAME = SAI_8.4.0_GA LIBSAIBCM_DNX_BRANCH_NAME = REL_7.0_SAI_1.11 From 6d22649c81ddfa024825a19404d8ec2ce8f71b97 Mon Sep 17 00:00:00 2001 From: Ying Xie Date: Mon, 4 Dec 2023 18:35:14 -0800 Subject: [PATCH 026/419] [202311] lock down some sub module branches (#17405) Signed-off-by: Ying Xie --- .gitmodules | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitmodules b/.gitmodules index ccd3674cb01a..fa60b665d48d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,15 +1,19 @@ [submodule "sonic-swss-common"] path = src/sonic-swss-common url = https://github.com/sonic-net/sonic-swss-common + branch = 202311 [submodule "sonic-linux-kernel"] path = src/sonic-linux-kernel url = https://github.com/sonic-net/sonic-linux-kernel + branch = 202311 [submodule "sonic-sairedis"] path = src/sonic-sairedis url = https://github.com/sonic-net/sonic-sairedis + branch = 202311 [submodule "sonic-swss"] path = src/sonic-swss url = https://github.com/sonic-net/sonic-swss + branch = 202311 [submodule "src/p4c-bm/p4c-bm"] path = platform/p4/p4c-bm/p4c-bm url = https://github.com/krambn/p4c-bm @@ -31,15 +35,18 @@ [submodule "src/sonic-utilities"] path = src/sonic-utilities url = https://github.com/sonic-net/sonic-utilities + branch = 202311 [submodule "platform/broadcom/sonic-platform-modules-arista"] path = platform/broadcom/sonic-platform-modules-arista url = https://github.com/aristanetworks/sonic [submodule "src/sonic-platform-common"] path = src/sonic-platform-common url = https://github.com/sonic-net/sonic-platform-common + branch = 202311 [submodule "src/sonic-platform-daemons"] path = src/sonic-platform-daemons url = https://github.com/sonic-net/sonic-platform-daemons + branch = 202311 [submodule "src/sonic-platform-pde"] path = src/sonic-platform-pde url = https://github.com/sonic-net/sonic-platform-pdk-pde @@ -103,6 +110,7 @@ [submodule "src/sonic-host-services"] path = src/sonic-host-services url = https://github.com/sonic-net/sonic-host-services + branch = 202311 [submodule "src/sonic-gnmi"] path = src/sonic-gnmi url = https://github.com/sonic-net/sonic-gnmi.git From 62429a2328432d724691b1f931d7a0a36cb27802 Mon Sep 17 00:00:00 2001 From: Aravind-Subbaroyan <125076667+Aravind-Subbaroyan@users.noreply.github.com> Date: Thu, 7 Dec 2023 17:04:45 -0800 Subject: [PATCH 027/419] Update cisco-8000.ini (#17429) FCS/CRC Errors will only be reported as RX_ERR. Fix to avoid the mac port related errors. Fix for sharedResSize testcase failure in QoS-SAI Fix the issue related to voltage in 'show platform psustatus'. Support WRED drop for lossy queues. Fixed an issue where lossy traffic was getting dropped. Enhancement of SAI logging for errors and interrupts --- platform/checkout/cisco-8000.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/checkout/cisco-8000.ini b/platform/checkout/cisco-8000.ini index e6ceacf358bc..d07141d59cd3 100644 --- a/platform/checkout/cisco-8000.ini +++ b/platform/checkout/cisco-8000.ini @@ -1,3 +1,3 @@ [module] repo=git@github.com:Cisco-8000-sonic/platform-cisco-8000.git -ref=202205.2.2.11 +ref=202305.1.0.3 From 2e8c2eba14010083e65266faa69aa803ae276e88 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 9 Dec 2023 10:22:55 +0800 Subject: [PATCH 028/419] Revert "[swss/syncd] remove dependency on interfaces-config.service (#13084) (#14341)" (#15094) (#17367) (#17447) --- files/build_templates/per_namespace/swss.service.j2 | 1 + files/build_templates/per_namespace/syncd.service.j2 | 1 + 2 files changed, 2 insertions(+) diff --git a/files/build_templates/per_namespace/swss.service.j2 b/files/build_templates/per_namespace/swss.service.j2 index 58bca6a219a6..765bee8a7ac0 100644 --- a/files/build_templates/per_namespace/swss.service.j2 +++ b/files/build_templates/per_namespace/swss.service.j2 @@ -11,6 +11,7 @@ Requires=opennsl-modules.service {% endif %} Requires=updategraph.service After=updategraph.service +After=interfaces-config.service BindsTo=sonic.target After=sonic.target Before=ntp-config.service diff --git a/files/build_templates/per_namespace/syncd.service.j2 b/files/build_templates/per_namespace/syncd.service.j2 index 1fb803390a80..66861efca473 100644 --- a/files/build_templates/per_namespace/syncd.service.j2 +++ b/files/build_templates/per_namespace/syncd.service.j2 @@ -16,6 +16,7 @@ After=nps-modules.service {% endif %} Requires=updategraph.service After=updategraph.service +After=interfaces-config.service BindsTo=sonic.target After=sonic.target Before=ntp-config.service From f2155956997727bbe0b8c25e20c735d8b78dc5ba Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 14 Dec 2023 07:34:35 +0800 Subject: [PATCH 029/419] [submodule] Update submodule sonic-sairedis to the latest HEAD automatically (#17454) src/sonic-sairedis * 9621316 - (HEAD -> 202311, origin/202311) [syncd] Remove notify pointers manual handling (#1326) (2 weeks ago) [Kamil Cudnik] * 4ee9c25 - Add TestSwitch missing attribute (#1327) (2 weeks ago) [noaOrMlnx] * 4cbbeed - Add SAI Notification support for host_tx_ready (#1307) (2 weeks ago) [noaOrMlnx] * 9804bd7 - Fix compilation issue due to PORT_STATE_CHANGE_QUEUE_SIZE undefined (#1324) (3 weeks ago) [Ashish Singh] --- src/sonic-sairedis | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-sairedis b/src/sonic-sairedis index 45cbf14df9a8..962131601d5d 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit 45cbf14df9a87d62f91fe509eb868ca06276bab4 +Subproject commit 962131601d5d99d1cb85eee636c2f1d01802e6d1 From d174ad33b769a508f77616345752fedbc3512030 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 14 Dec 2023 07:41:55 +0800 Subject: [PATCH 030/419] [submodule] Update submodule sonic-platform-common to the latest HEAD automatically (#17450) src/sonic-platform-common * 5d69644 - (HEAD -> 202311, origin/202311) Adding supported vendor PNs for remote CDB FW upgrade (#418) (#419) (5 days ago) [mihirpat1] * 036b2fc - [Credo][Ycable] Correct the lane mapping in the debugdumpregister function for the 50G cable (#417) (11 days ago) [Xinyu Lin] * 2efe97e - Fix VDM freeze and unfreeze needed for PM stats collection (#402) (2 weeks ago) [jaganbal-a] * cb80f17 - Fix issue: QSFP module with id 0x0d can be parsed using 8636 (#412) (3 weeks ago) [Stephen Sun] --- 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 30fb0ce17c9e..5d69644a0cab 160000 --- a/src/sonic-platform-common +++ b/src/sonic-platform-common @@ -1 +1 @@ -Subproject commit 30fb0ce17c9e7d02a6d9924ed14bd4c0b0ab23cc +Subproject commit 5d69644a0cabcdfde4430be5370e91bccbc078d6 From 4ee9a5c368ea1de1e109451ca0dee32d14298c0d Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 14 Dec 2023 07:42:15 +0800 Subject: [PATCH 031/419] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#17455) src/sonic-swss * d839eec3 - (HEAD -> 202311, origin/202311) Add support for fabric monitor daemon (swss part). (#2920) (11 days ago) [jfeng-arista] * 8dc0a856 - Add support for new Port SI parameters in PortsOA (#2929) (11 days ago) [Tomer Shalvi] * 9458b855 - [hash]: Add ECMP/LAG hash algorithm to OA (#2953) (12 days ago) [Nazarii Hnydyn] * dac3972d - [coppmgrd] Fix Copp processing logic by using Producer del instead of del from Table (13 days ago) [Vivek] * f6a35e98 - [gcov]: Fix directory prefix issue for (#2969) (13 days ago) [Lawrence Lee] * 14408ca3 - [Chassis][master][orchagent] : Added test case to verify WRED profile on system ports (#2954) (2 weeks ago) [vmittal-msft] * 2ca3deb0 - [dash] fix DASH ACL Rule protocol use-after-free (#2958) (3 weeks ago) [Yakiv Huryk] * b8841ecb - [orchagent]: Extend the SRv6Orch to support the programming of the L3Adj (#2902) (3 weeks ago) [Carmine Scarpitta] * 194566a7 - Fix the Orchagent Qos error messages reported in Issue #16787 (#2947) (3 weeks ago) [saksarav-nokia] --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 4a0bb1cfca06..d839eec3c02a 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 4a0bb1cfca06c757d054bd225f97d00fae5b1ff7 +Subproject commit d839eec3c02a5911645dbfc93aa5bb474bbff38f From 093abe423a28b2186b5e194bee020cb0eae35d75 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 14 Dec 2023 09:34:35 +0800 Subject: [PATCH 032/419] [submodule] Update submodule sonic-swss-common to the latest HEAD automatically (#17456) src/sonic-swss-common * 8dc6218 - (HEAD -> 202311, origin/202311) Add STATE_TRANSCEIVER_INFO_TABLE_NAME to shcema.h (#824) (2 weeks ago) [noaOrMlnx] --- 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 05e024e573ba..8dc6218e8ebd 160000 --- a/src/sonic-swss-common +++ b/src/sonic-swss-common @@ -1 +1 @@ -Subproject commit 05e024e573bab467b040e6401529c69eeba03f95 +Subproject commit 8dc6218e8ebdd7ca6f422fbb525137e346aa0ff0 From ee75667fd1093470707946786692d8ef33f75e43 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 14 Dec 2023 09:43:09 +0800 Subject: [PATCH 033/419] [submodule] Update submodule sonic-platform-daemons to the latest HEAD automatically (#17452) src/sonic-platform-daemons * 502c0b6 - (HEAD -> 202311, origin/202311) Add Port SI Configuration Per Speed (#400) (12 days ago) [Tomer Shalvi] * e2d9f87 - Add dynamic sensor logic for fixed and psu presence/state checking in thermalctld (#401) (2 weeks ago) [Gregory Boudreau] --- 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 55a682834b56..502c0b662200 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit 55a682834b5678b1840f87828913d4c15f99bd77 +Subproject commit 502c0b6622008363cb1ed6d1b7c85b4093997093 From bd15b77ba9c36a9f36d3567566e2c560e39582df Mon Sep 17 00:00:00 2001 From: zitingguo-ms Date: Thu, 14 Dec 2023 09:37:35 +0800 Subject: [PATCH 034/419] change branch name (#17267) Why I did it Upgrade xgs SAI to 10.1 version. Work item tracking Microsoft ADO (number only): 25931321 How I did it Upgrade xgs SAI version in sai.mk file. How to verify it Run full qualification on 7050cx3/7260cx3: 7050cx3: https://dev.azure.com/mssonic/internal/_build/results?buildId=425450&view=results https://dev.azure.com/mssonic/internal/_build/results?buildId=425449&view=results 7260cx3: https://elastictest.org/scheduler/testplan/656f2b2b617fb27e41557494?leftSideViewMode=detail&prop=status&order=ascending --- platform/broadcom/sai.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/broadcom/sai.mk b/platform/broadcom/sai.mk index 92a1d95981bf..eea4f47a4c83 100644 --- a/platform/broadcom/sai.mk +++ b/platform/broadcom/sai.mk @@ -1,6 +1,6 @@ -LIBSAIBCM_XGS_VERSION = 8.4.31.0 +LIBSAIBCM_XGS_VERSION = 10.1.0.0 LIBSAIBCM_DNX_VERSION = 7.1.111.1 -LIBSAIBCM_XGS_BRANCH_NAME = SAI_8.4.0_GA +LIBSAIBCM_XGS_BRANCH_NAME = SAI_10.1.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)" From 0cb08912273b006c908c099749c8e4948e5617ba Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 15 Dec 2023 05:16:39 +0800 Subject: [PATCH 035/419] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#17457) src/sonic-utilities * 1b1402f5 - (HEAD -> 202311, origin/202311) [hash]: Add ECMP/LAG hash algorithm CLI (#3036) (9 days ago) [Nazarii Hnydyn] * 71514ea3 - Revert "Run yang validation in unit test (#3025)" (#3055) (9 days ago) [Ying Xie] * b5daf5d4 - [dhcp_relay] Fix dhcp_relay counter display issue (#3054) (9 days ago) [Yaqiang Zhu] * b3172505 - [sflow][db_migrator] Egress Sflow support (#3020) (9 days ago) [Rajkumar-Marvell] * 1e813105 - [wol] Implement wol command line utility (#3048) (3 weeks ago) [Zhijian Li] * 8ebc56a0 - [sonic_installer]: Improve exception handling: introduce notes. (#3029) (3 weeks ago) [Nazarii Hnydyn] * 3610ce93 - [sonic-package-manager] Fix YANG validation failure on upgrade when feature has constraints in YANG model on FEATURE table (#2933) (3 weeks ago) [Stepan Blyshchak] * cfd2dd39 - Add container rsyslog.conf to the sys dump (#3039) (4 weeks ago) [Vivek] * c4b07828 - Support new platform in generic configuration update (#3038) (4 weeks ago) [Stephen Sun] * a8d236c8 - [fast-reboot-filter-routes.py] Remove click and improve error reporting (#3030) (4 weeks ago) [Stepan Blyshchak] * 75199c0f - [sonic-package-manager] insert newline in /etc/sonic/generated_services.conf (#3040) (4 weeks ago) [Stepan Blyshchak] * cd855698 - [VOQ][saidump] Modify generate_dump: replace save_saidump with save_saidump_by_route_size (#2972) (4 weeks ago) [JunhongMao] * f1e24ae5 - GCU support for Cisco-8000 features (#3010) (4 weeks ago) [rbpittman] * 67e1c3dc - Update GCU rsyslog validator (#3012) (4 weeks ago) [jingwenxie] * 253b7975 - [sonic-package-manager] do not modify config_db.json (#3032) (5 weeks ago) [Stepan Blyshchak] * 177dd8e8 - [sonic-package-manager] add generated service to /etc/sonic/generated_services.conf (#3037) (5 weeks ago) [Stepan Blyshchak] * 62fcd77a - Configure NTP according to extended configuration (#2835) (5 weeks ago) [Yevhen Fastiuk] * ced09404 - [dualtor_neighbor_check] Adjust zero-mac check condition (#3034) (5 weeks ago) [Longxiang Lyu] * a4eeb698 - [config] config reload should generate sysinfo if missing (#3031) (6 weeks ago) [jingwenxie] * e01fc891 - Run yang validation in unit test (#3025) (6 weeks ago) [ganglv] --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index 6833e6cac8ca..1b1402f5dc0f 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 6833e6cac8ca0879fde6f5462a994abfa685716d +Subproject commit 1b1402f5dc0fd01e5f0d25679e7382fc96226a40 From 9dbb016ad8907030721b16d3d4d76aa25f7df0ca Mon Sep 17 00:00:00 2001 From: Arun Saravanan Balachandran <52521751+ArunSaravananBalachandran@users.noreply.github.com> Date: Thu, 7 Dec 2023 23:38:42 +0530 Subject: [PATCH 036/419] [Dell] S6100 - Update EEPROM API serial_number_str to return service tag instead of serial number (#17440) To modify EEPROM API serial_number_str to return service tag instead of serial number in Dell S6100. Ref PR: #1239 How I did it Update EEPROM API serial_number_str to return service tag instead of serial number. How to verify it Verify decode-syseeprom -s returns service tag in Dell S6100. --- .../s6100/sonic_platform/chassis.py | 2 +- .../s6100/sonic_platform/eeprom.py | 18 ++++++++---------- .../s6100/sonic_platform/module.py | 2 +- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/chassis.py index 6af22720f1c9..f151193b15ad 100755 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/chassis.py +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/chassis.py @@ -216,7 +216,7 @@ def get_serial(self): Returns: string: Serial number of chassis """ - return self._eeprom.serial_str() + return self._eeprom.serial_number_str() def get_status(self): """ diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/eeprom.py b/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/eeprom.py index cab1998be39e..a2f5eb48ea99 100644 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/eeprom.py +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/eeprom.py @@ -83,8 +83,14 @@ def __init__(self, i2c_line=0, iom_eeprom=False): self.eeprom_tlv_dict[mac_code] = '00:00:00:00:00:00' def serial_number_str(self): - (is_valid, results) = self.get_tlv_field( - self.eeprom_data, self._TLV_CODE_SERIAL_NUMBER) + # For Chassis, return service tag instead of serial number + if not self.is_module: + (is_valid, results) = self.get_tlv_field( + self.eeprom_data, self._TLV_CODE_SERVICE_TAG) + else: + (is_valid, results) = self.get_tlv_field( + self.eeprom_data, self._TLV_CODE_SERIAL_NUMBER) + if not is_valid: return "N/A" @@ -118,14 +124,6 @@ def part_number_str(self): return results[2].decode('ascii') - def serial_str(self): - (is_valid, results) = self.get_tlv_field( - self.eeprom_data, self._TLV_CODE_SERVICE_TAG) - if not is_valid: - return "N/A" - - return results[2].decode('ascii') - def revision_str(self): (is_valid, results) = self.get_tlv_field( self.eeprom_data, self._TLV_CODE_LABEL_REVISION) diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/module.py b/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/module.py index 163a0ab3981c..751d90fcc6ca 100644 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/module.py +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/module.py @@ -139,7 +139,7 @@ def get_serial(self): Returns: string: Serial number of module """ - return self._eeprom.serial_str() + return self._eeprom.serial_number_str() def get_status(self): """ From 3d7459ccfcab06fe000682207cc724ab81decbe8 Mon Sep 17 00:00:00 2001 From: Junhua Zhai Date: Thu, 21 Dec 2023 01:23:14 +0800 Subject: [PATCH 037/419] [gbsyncd] Graceful shutdown of syncd process in container gbsyncd (#16812) (#17563) Fix #16608. Need to gracefully shutdown syncd/gbsyncd individually. --- files/scripts/gbsyncd.sh | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/files/scripts/gbsyncd.sh b/files/scripts/gbsyncd.sh index 0948aaadc199..53b00438ce23 100755 --- a/files/scripts/gbsyncd.sh +++ b/files/scripts/gbsyncd.sh @@ -19,7 +19,37 @@ function waitplatform() { } function stopplatform1() { - : + if ! docker top gbsyncd$DEV | grep -q /usr/bin/syncd; then + debug "syncd process in container gbsyncd$DEV is not running" + return + fi + + # Invoke platform specific pre shutdown routine. + PLATFORM=`$SONIC_DB_CLI CONFIG_DB hget 'DEVICE_METADATA|localhost' platform` + PLATFORM_PRE_SHUTDOWN="/usr/share/sonic/device/$PLATFORM/plugins/gbsyncd_request_pre_shutdown" + [ -f $PLATFORM_PRE_SHUTDOWN ] && \ + /usr/bin/docker exec -i gbsyncd$DEV /usr/share/sonic/platform/plugins/gbsyncd_request_pre_shutdown --${TYPE} + + debug "${TYPE} shutdown syncd process in container gbsyncd$DEV ..." + /usr/bin/docker exec -i gbsyncd$DEV /usr/bin/syncd_request_shutdown -g 1 -x /usr/share/sonic/hwsku/context_config.json --${TYPE} + + # wait until syncd quits gracefully or force syncd to exit after + # waiting for 20 seconds + start_in_secs=${SECONDS} + end_in_secs=${SECONDS} + timer_threshold=20 + while docker top gbsyncd$DEV | grep -q /usr/bin/syncd \ + && [[ $((end_in_secs - start_in_secs)) -le $timer_threshold ]]; do + sleep 0.1 + end_in_secs=${SECONDS} + done + + if [[ $((end_in_secs - start_in_secs)) -gt $timer_threshold ]]; then + debug "syncd process in container gbsyncd$DEV did not exit gracefully" + fi + + /usr/bin/docker exec -i gbsyncd$DEV /bin/sync + debug "Finished ${TYPE} shutdown syncd process in container gbsyncd$DEV ..." } function stopplatform2() { From e28b48b842d7a0223bffe9351f6f7d319549c1b8 Mon Sep 17 00:00:00 2001 From: Ze Gan Date: Thu, 21 Dec 2023 09:25:23 +0800 Subject: [PATCH 038/419] [202311][submodule]: Update submodule sonic-swss/sonic-dash-api/protobuf (#17521) * [submodule]: Update submodule sonic-swss/sonic-dash-api/protobuf (#17413) 1. Protobuf 3.21 has been released in the Debian bookworm 2. Update submodule sonic-swss and sonic-dash-api because they include related updates. - Microsoft ADO **(number only)**: 1. In the protobuf.mk, If it isn't bullseye, ignore to compile the protobuf package 2. Move sonic-swss commits: ``` fd852084 (HEAD, origin/master, origin/HEAD) [dashrouteorch]: Rename dash route namespace (#2966) ``` 3. Move sonic-dash-api and move build chain to its submodule ``` d4448c7 (HEAD, origin/master, origin/HEAD, master) [azp]: Add multi-platform artifacts (#11) 8a5e5cc [debian]: Add debian package (#10) d96163a [misc]: Add dash utils and its tests (#9) ``` Signed-off-by: Ze Gan --- .gitmodules | 4 +-- rules/protobuf.mk | 51 +++++++++++++++------------- rules/sonic-dash-api.mk | 6 ++-- src/sonic-dash-api | 1 + src/sonic-dash-api/.gitignore | 2 -- src/sonic-dash-api/Makefile | 47 ------------------------- src/sonic-dash-api/debian/changelog | 6 ---- src/sonic-dash-api/debian/compat | 1 - src/sonic-dash-api/debian/control | 13 ------- src/sonic-dash-api/debian/rules | 8 ----- src/sonic-dash-api/pypkg/__init__.py | 5 --- src/sonic-dash-api/sonic-dash-api | 1 - src/sonic-swss | 2 +- 13 files changed, 36 insertions(+), 111 deletions(-) create mode 160000 src/sonic-dash-api delete mode 100644 src/sonic-dash-api/.gitignore delete mode 100644 src/sonic-dash-api/Makefile delete mode 100644 src/sonic-dash-api/debian/changelog delete mode 100644 src/sonic-dash-api/debian/compat delete mode 100644 src/sonic-dash-api/debian/control delete mode 100755 src/sonic-dash-api/debian/rules delete mode 100644 src/sonic-dash-api/pypkg/__init__.py delete mode 160000 src/sonic-dash-api/sonic-dash-api diff --git a/.gitmodules b/.gitmodules index fa60b665d48d..26bfb47d2801 100644 --- a/.gitmodules +++ b/.gitmodules @@ -120,8 +120,8 @@ [submodule "src/dhcpmon"] path = src/dhcpmon url = https://github.com/sonic-net/sonic-dhcpmon.git -[submodule "src/sonic-dash-api/sonic-dash-api"] - path = src/sonic-dash-api/sonic-dash-api +[submodule "src/sonic-dash-api"] + path = src/sonic-dash-api url = https://github.com/sonic-net/sonic-dash-api.git [submodule "platform/marvell-arm64/mrvl-prestera"] path = platform/marvell-arm64/mrvl-prestera diff --git a/rules/protobuf.mk b/rules/protobuf.mk index 5e50eac86292..866eb6b99f3e 100644 --- a/rules/protobuf.mk +++ b/rules/protobuf.mk @@ -1,32 +1,37 @@ # protobuf package +# Protobuf 3.21.12 has been released in bookworm, So we only need to build it +# in the bullseye environment. +ifeq ($(BLDENV),bullseye) -PROTOBUF_VERSION = 3.21.12 -PROTOBUF_VERSION_FULL = $(PROTOBUF_VERSION)-3 + PROTOBUF_VERSION = 3.21.12 + PROTOBUF_VERSION_FULL = $(PROTOBUF_VERSION)-3 -export PROTOBUF_VERSION -export PROTOBUF_VERSION_FULL + export PROTOBUF_VERSION + export PROTOBUF_VERSION_FULL -PROTOBUF = libprotobuf32_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb -$(PROTOBUF)_SRC_PATH = $(SRC_PATH)/protobuf -SONIC_MAKE_DEBS += $(PROTOBUF) + PROTOBUF = libprotobuf32_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb + $(PROTOBUF)_SRC_PATH = $(SRC_PATH)/protobuf + SONIC_MAKE_DEBS += $(PROTOBUF) -PROTOBUF_DEV = libprotobuf-dev_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb -$(PROTOBUF_DEV)_DEPENDS = $(PROTOBUF) $(PROTOBUF_LITE) -$(eval $(call add_derived_package,$(PROTOBUF),$(PROTOBUF_DEV))) + PROTOBUF_DEV = libprotobuf-dev_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb + $(PROTOBUF_DEV)_DEPENDS = $(PROTOBUF) $(PROTOBUF_LITE) + $(eval $(call add_derived_package,$(PROTOBUF),$(PROTOBUF_DEV))) -PROTOBUF_LITE = libprotobuf-lite32_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb -$(eval $(call add_derived_package,$(PROTOBUF),$(PROTOBUF_LITE))) + PROTOBUF_LITE = libprotobuf-lite32_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb + $(eval $(call add_derived_package,$(PROTOBUF),$(PROTOBUF_LITE))) -PROTOC32 = libprotoc32_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb -$(PROTOC32)_RDEPENDS = $(PROTOBUF) $(PROTOBUF_LITE) -$(eval $(call add_derived_package,$(PROTOBUF),$(PROTOC32))) + PROTOC32 = libprotoc32_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb + $(PROTOC32)_RDEPENDS = $(PROTOBUF) $(PROTOBUF_LITE) + $(eval $(call add_derived_package,$(PROTOBUF),$(PROTOC32))) -PROTOBUF_COMPILER = protobuf-compiler_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb -$(PROTOBUF_COMPILER)_DEPENDS = $(PROTOC32) -$(PROTOBUF_COMPILER)_RDEPENDS = $(PROTOC32) -$(eval $(call add_derived_package,$(PROTOBUF),$(PROTOBUF_COMPILER))) + PROTOBUF_COMPILER = protobuf-compiler_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb + $(PROTOBUF_COMPILER)_DEPENDS = $(PROTOC32) + $(PROTOBUF_COMPILER)_RDEPENDS = $(PROTOC32) + $(eval $(call add_derived_package,$(PROTOBUF),$(PROTOBUF_COMPILER))) -PYTHON3_PROTOBUF = python3-protobuf_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb -$(PYTHON3_PROTOBUF)_DEPENDS = $(PROTOBUF_DEV) $(PROTOBUF) -$(PYTHON3_PROTOBUF)_RDEPENDS = $(PROTOBUF) -$(eval $(call add_derived_package,$(PROTOBUF),$(PYTHON3_PROTOBUF))) + PYTHON3_PROTOBUF = python3-protobuf_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb + $(PYTHON3_PROTOBUF)_DEPENDS = $(PROTOBUF_DEV) $(PROTOBUF) + $(PYTHON3_PROTOBUF)_RDEPENDS = $(PROTOBUF) + $(eval $(call add_derived_package,$(PROTOBUF),$(PYTHON3_PROTOBUF))) + +endif diff --git a/rules/sonic-dash-api.mk b/rules/sonic-dash-api.mk index e6d9e34c0395..742b2c3f9c6d 100644 --- a/rules/sonic-dash-api.mk +++ b/rules/sonic-dash-api.mk @@ -5,8 +5,10 @@ LIB_SONIC_DASH_API_VERSION = 1.0.0 LIB_SONIC_DASH_API = libdashapi_$(LIB_SONIC_DASH_API_VERSION)_$(CONFIGURED_ARCH).deb $(LIB_SONIC_DASH_API)_SRC_PATH = $(SRC_PATH)/sonic-dash-api -$(LIB_SONIC_DASH_API)_DEPENDS += $(PROTOBUF) $(PROTOBUF_LITE) $(PROTOBUF_DEV) $(PROTOBUF_COMPILER) -$(LIB_SONIC_DASH_API)_RDEPENDS += $(PROTOBUF) $(PROTOBUF_LITE) $(PYTHON3_PROTOBUF) +ifeq ($(BLDENV),bullseye) + $(LIB_SONIC_DASH_API)_DEPENDS += $(PROTOBUF) $(PROTOBUF_LITE) $(PROTOBUF_DEV) $(PROTOBUF_COMPILER) + $(LIB_SONIC_DASH_API)_RDEPENDS += $(PROTOBUF) $(PROTOBUF_LITE) $(PYTHON3_PROTOBUF) +endif SONIC_DPKG_DEBS += $(LIB_SONIC_DASH_API) diff --git a/src/sonic-dash-api b/src/sonic-dash-api new file mode 160000 index 000000000000..910814ffb4fd --- /dev/null +++ b/src/sonic-dash-api @@ -0,0 +1 @@ +Subproject commit 910814ffb4fd2e44e183d8d92086a724c62f5f1d diff --git a/src/sonic-dash-api/.gitignore b/src/sonic-dash-api/.gitignore deleted file mode 100644 index ff64e429bd09..000000000000 --- a/src/sonic-dash-api/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -build -debian/sonic-dash-api diff --git a/src/sonic-dash-api/Makefile b/src/sonic-dash-api/Makefile deleted file mode 100644 index 0031800cced7..000000000000 --- a/src/sonic-dash-api/Makefile +++ /dev/null @@ -1,47 +0,0 @@ -.ONESHELL: -SHELL = /bin/bash -.SHELLFLAGS += -e - -RM := rm -rf -CP := cp -rf -MKDIR := mkdir -MV := mv -LIBDASHAPI := libdashapi.so -BUILD_DIR := build -PYPKG_DIR := pypkg -DESTDIR := -DASH_API_PROTO_DIR := sonic-dash-api/proto -INSTALLED_HEADER_DIR := $(DESTDIR)/usr/include/dash_api -INSTALLED_LIB_DIR := $(DESTDIR)/usr/lib -INSTALLED_PYTHON_DIR := $(DESTDIR)/usr/lib/python3/dist-packages/dash_api - -all: compile_cpp_proto dashapi.so compile_py_proto - -compile_cpp_proto: - $(MKDIR) -p $(BUILD_DIR) - protoc -I=$(DASH_API_PROTO_DIR) --cpp_out=$(BUILD_DIR) $(DASH_API_PROTO_DIR)/*.proto - -dashapi.so: compile_cpp_proto - g++ -std=c++14 -fPIC -shared -o $(BUILD_DIR)/$(LIBDASHAPI) $(wildcard $(BUILD_DIR)/*.pb.cc) -lprotobuf - -compile_py_proto: - protoc -I=$(DASH_API_PROTO_DIR) --python_out=$(PYPKG_DIR) $(DASH_API_PROTO_DIR)/*.proto - -clean: - $(RM) $(BUILD_DIR) - $(RM) $(PYPKG_DIR)/*_pb2.py - -install: - $(MKDIR) -p $(INSTALLED_HEADER_DIR) - $(CP) $(BUILD_DIR)/*.pb.h $(INSTALLED_HEADER_DIR) - $(MKDIR) -p $(INSTALLED_LIB_DIR) - $(CP) $(BUILD_DIR)/$(LIBDASHAPI) $(INSTALLED_LIB_DIR) - $(MKDIR) -p $(INSTALLED_PYTHON_DIR) - $(CP) $(PYPKG_DIR)/* $(INSTALLED_PYTHON_DIR) - -uninstall: - $(RM) $(INSTALLED_HEADER_DIR) - $(RM) $(INSTALLED_LIB_DIR)/$(LIBDASHAPI) - $(RM) $(INSTALLED_PYTHON_DIR) - -.PHONY: uninstall clean diff --git a/src/sonic-dash-api/debian/changelog b/src/sonic-dash-api/debian/changelog deleted file mode 100644 index e5cb52398c4c..000000000000 --- a/src/sonic-dash-api/debian/changelog +++ /dev/null @@ -1,6 +0,0 @@ -sonic (1.0.0) stable; urgency=medium - - * Initial release. - - -- Ze Gan Wed, 14 Jun 2023 12:00:00 -0800 - diff --git a/src/sonic-dash-api/debian/compat b/src/sonic-dash-api/debian/compat deleted file mode 100644 index 9d607966b721..000000000000 --- a/src/sonic-dash-api/debian/compat +++ /dev/null @@ -1 +0,0 @@ -11 \ No newline at end of file diff --git a/src/sonic-dash-api/debian/control b/src/sonic-dash-api/debian/control deleted file mode 100644 index 545204fbe7da..000000000000 --- a/src/sonic-dash-api/debian/control +++ /dev/null @@ -1,13 +0,0 @@ -Source: sonic -Maintainer: Ze Gan -Section: net -Priority: optional -Build-Depends: dh-exec (>=0.3), debhelper (>= 12), autotools-dev, -Standards-Version: 1.0.0 - -Package: libdashapi -Architecture: any -Build-Depends: protobuf-compiler (>=3.21.12), libprotobuf-dev (>=3.21.12) -Depends: libprotobuf32 (>=3.21.12), libprotobuf-lite32 (>=3.21.12) -Section: libs -Description: DASH API definition for the SONiC project. diff --git a/src/sonic-dash-api/debian/rules b/src/sonic-dash-api/debian/rules deleted file mode 100755 index e661a7acd0bf..000000000000 --- a/src/sonic-dash-api/debian/rules +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/make -f -#export DH_VERBOSE = 1 - -%: - dh $@ - -override_dh_auto_build: - make all diff --git a/src/sonic-dash-api/pypkg/__init__.py b/src/sonic-dash-api/pypkg/__init__.py deleted file mode 100644 index ade95c521abf..000000000000 --- a/src/sonic-dash-api/pypkg/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -import sys -import os - - -sys.path.insert(0, os.path.abspath(os.path.dirname(__file__))) diff --git a/src/sonic-dash-api/sonic-dash-api b/src/sonic-dash-api/sonic-dash-api deleted file mode 160000 index 3f728d1bbf65..000000000000 --- a/src/sonic-dash-api/sonic-dash-api +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3f728d1bbf65d2e8c41bdc023d5c07702a7f848b diff --git a/src/sonic-swss b/src/sonic-swss index d839eec3c02a..7e691347274e 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit d839eec3c02a5911645dbfc93aa5bb474bbff38f +Subproject commit 7e691347274ebc17e1c6655396db6826a72d4fc3 From 9e94c3689a2db422d1a19d1c54e04d5f84fb71f4 Mon Sep 17 00:00:00 2001 From: Ying Xie Date: Wed, 20 Dec 2023 21:26:53 -0800 Subject: [PATCH 039/419] [202311] set sonic release value (#17582) Why I did it Each release branch needs to have release number set. Work item tracking Microsoft ADO (number only): How I did it How to verify it This PR test. --- files/image_config/sonic_release | 1 + 1 file changed, 1 insertion(+) create mode 100644 files/image_config/sonic_release diff --git a/files/image_config/sonic_release b/files/image_config/sonic_release new file mode 100644 index 000000000000..79f4615eb0a5 --- /dev/null +++ b/files/image_config/sonic_release @@ -0,0 +1 @@ +202311 From bd8ed6bc6d09862921d2b0f552156ac99edd269a Mon Sep 17 00:00:00 2001 From: kellyyeh <42761586+kellyyeh@users.noreply.github.com> Date: Wed, 20 Dec 2023 22:49:23 -0800 Subject: [PATCH 040/419] Advance dhcprelay submodule (#17585) 5ae186f Yaqiang Zhu Tue Dec 19 12:05:15 2023 -0500 [counter] Clear counter table when init (#45) --- src/dhcprelay | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dhcprelay b/src/dhcprelay index 40c68778d4b7..5ae186f4a6c2 160000 --- a/src/dhcprelay +++ b/src/dhcprelay @@ -1 +1 @@ -Subproject commit 40c68778d4b7a0d6318f1ac271871b87d0058a8a +Subproject commit 5ae186f4a6c25647f5ce7b4d2c884b08423455e7 From f78cb9c55c827520b8fb94357c1908a1ca866f19 Mon Sep 17 00:00:00 2001 From: Yevhen Fastiuk Date: Thu, 21 Dec 2023 19:45:29 +0200 Subject: [PATCH 041/419] [202311][cherry-pick][NTP] Add NTP extended configuration (#17487) * Add NTP YANG model Signed-off-by: Yevhen Fastiuk * Extend NTP config generation mechanism Signed-off-by: Yevhen Fastiuk * Add NTP YANG nodel tests Signed-off-by: Yevhen Fastiuk * Add test for NTP Jinja templates Signed-off-by: Yevhen Fastiuk * Add ntpdate package Signed-off-by: Yevhen Fastiuk * Fix 'bad' when auth disabled Signed-off-by: Yevhen Fastiuk * [NTP] Changed owner for ntp keys config file to root and remove read access for other. Signed-off-by: Yevhen Fastiuk * Fix NTP warnings after restarting the service Signed-off-by: Yevhen Fastiuk * Add ability to encrypt/decrypt NTP keys Signed-off-by: Yevhen Fastiuk * Update Configuration reference Signed-off-by: Yevhen Fastiuk * Fix NTP configuration template * Align the description for setting interface * Fix the usage of scoped variable Signed-off-by: Yevhen Fastiuk * Fix YANG model description and tests Signed-off-by: Yevhen Fastiuk * Align NTP test according to fixed condition Signed-off-by: Yevhen Fastiuk * Allow eth0 to be as source ifc without defining it Signed-off-by: Yevhen Fastiuk * Update sample config with NTP config Signed-off-by: Yevhen Fastiuk --------- Signed-off-by: Yevhen Fastiuk --- files/build_templates/init_cfg.json.j2 | 10 + .../build_templates/sonic_debian_extension.j2 | 3 + files/image_config/ntp/ntp | 100 ------- files/image_config/ntp/ntp-config.sh | 4 + files/image_config/ntp/ntp-systemd-wrapper | 17 +- files/image_config/ntp/ntp.conf.j2 | 136 +++++---- files/image_config/ntp/ntp.keys.j2 | 18 ++ src/sonic-config-engine/sonic-cfggen | 27 ++ .../tests/data/ntp/ntp_interfaces.json | 44 ++- src/sonic-config-engine/tests/ntp.keys.j2 | 1 + .../tests/sample_output/py2/ntp.conf | 73 +---- .../tests/sample_output/py2/ntp.keys | 1 + .../tests/sample_output/py3/ntp.conf | 58 +--- .../tests/sample_output/py3/ntp.keys | 8 + src/sonic-config-engine/tests/test_j2files.py | 13 +- src/sonic-yang-models/doc/Configuration.md | 130 ++++++++- .../tests/files/sample_config_db.json | 28 +- .../tests/yang_model_tests/tests/ntp.json | 77 ++++++ .../yang_model_tests/tests_config/ntp.json | 260 +++++++++++++++++- .../yang-models/sonic-ntp.yang | 149 ++++++++++ .../yang-templates/sonic-types.yang.j2 | 16 ++ 21 files changed, 891 insertions(+), 282 deletions(-) delete mode 100755 files/image_config/ntp/ntp create mode 100644 files/image_config/ntp/ntp.keys.j2 create mode 120000 src/sonic-config-engine/tests/ntp.keys.j2 mode change 100644 => 120000 src/sonic-config-engine/tests/sample_output/py2/ntp.conf create mode 120000 src/sonic-config-engine/tests/sample_output/py2/ntp.keys create mode 100644 src/sonic-config-engine/tests/sample_output/py3/ntp.keys diff --git a/files/build_templates/init_cfg.json.j2 b/files/build_templates/init_cfg.json.j2 index 7ec71a35891b..53091a4a2472 100644 --- a/files/build_templates/init_cfg.json.j2 +++ b/files/build_templates/init_cfg.json.j2 @@ -157,5 +157,15 @@ "memory": "0M-2G:256M,2G-4G:320M,4G-8G:384M,8G-:448M", "num_dumps": "3" } + }, + "NTP": { + "global": { + "authentication": "disabled", + "dhcp": "enabled", + "server_role": "disabled", + "src_intf": "eth0", + "admin_state": "enabled", + "vrf": "default" + } } } diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index b4ecda9942ca..240ebfaa387b 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -370,10 +370,13 @@ sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/flashrom_*.deb sudo cp -f $IMAGE_CONFIGS/cron.d/* $FILESYSTEM_ROOT/etc/cron.d/ # Copy NTP configuration files and templates +sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT \ + apt-get -y install ntpdate sudo cp $IMAGE_CONFIGS/ntp/ntp-config.service $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM echo "ntp-config.service" | sudo tee -a $GENERATED_SERVICE_FILE sudo cp $IMAGE_CONFIGS/ntp/ntp-config.sh $FILESYSTEM_ROOT/usr/bin/ sudo cp $IMAGE_CONFIGS/ntp/ntp.conf.j2 $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/ +sudo cp $IMAGE_CONFIGS/ntp/ntp.keys.j2 $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/ sudo cp $IMAGE_CONFIGS/ntp/ntp-systemd-wrapper $FILESYSTEM_ROOT/usr/lib/ntp/ sudo cp $IMAGE_CONFIGS/ntp/ntp.service $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM echo "ntp.service" | sudo tee -a $GENERATED_SERVICE_FILE diff --git a/files/image_config/ntp/ntp b/files/image_config/ntp/ntp deleted file mode 100755 index f0ca500fb8f3..000000000000 --- a/files/image_config/ntp/ntp +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/sh - -# This file was originally created automatically as part of default NTP application installation from debian package. -# This is now manually modified for supporting NTP in management VRF. -# When management VRF is enabled, the NTP application should be started using "cgexec -g l3mdev:mgmt". -# Check has been added to verify the management VRF enabled status and use cgexec when it is enabled. -# This file will be copied on top of the etc/init.d/ntp file that gets created during build process. - -### BEGIN INIT INFO -# Provides: ntp -# Required-Start: $network $remote_fs $syslog -# Required-Stop: $network $remote_fs $syslog -# Default-Start: 2 3 4 5 -# Default-Stop: -# Short-Description: Start NTP daemon -### END INIT INFO - -PATH=/sbin:/bin:/usr/sbin:/usr/bin - -. /lib/lsb/init-functions - -DAEMON=/usr/sbin/ntpd -PIDFILE=/var/run/ntpd.pid - -test -x $DAEMON || exit 5 - -if [ -r /etc/default/ntp ]; then - . /etc/default/ntp -fi - -if [ -e /run/ntp.conf.dhcp ]; then - NTPD_OPTS="$NTPD_OPTS -c /run/ntp.conf.dhcp" -fi - - -LOCKFILE=/run/lock/ntpdate - -RUNASUSER=ntp -UGID=$(getent passwd $RUNASUSER | cut -f 3,4 -d:) || true -if test "$(uname -s)" = "Linux"; then - NTPD_OPTS="$NTPD_OPTS -u $UGID" -fi - -case $1 in - start) - log_daemon_msg "Starting NTP server" "ntpd" - if [ -z "$UGID" ]; then - log_failure_msg "user \"$RUNASUSER\" does not exist" - exit 1 - fi - ( - flock -w 180 9 - - # when mgmt vrf is configured, ntp starts in mgmt vrf by default unless user configures otherwise - vrfEnabled=$(/usr/local/bin/sonic-cfggen -d -v 'MGMT_VRF_CONFIG["vrf_global"]["mgmtVrfEnabled"]' 2> /dev/null) - vrfConfigured=$(/usr/local/bin/sonic-cfggen -d -v 'NTP["global"]["vrf"]' 2> /dev/null) - if [ "$vrfEnabled" = "true" ] - then - if [ "$vrfConfigured" = "default" ] - then - log_daemon_msg "Starting NTP server in default-vrf for default set as NTP vrf" "ntpd" - start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --startas $DAEMON -- -p $PIDFILE $NTPD_OPTS - else - log_daemon_msg "Starting NTP server in mgmt-vrf" "ntpd" - cgexec -g l3mdev:mgmt start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --startas $DAEMON -- -p $PIDFILE $NTPD_OPTS - fi - else - log_daemon_msg "Starting NTP server in default-vrf" "ntpd" - start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --startas $DAEMON -- -p $PIDFILE $NTPD_OPTS - fi - ) 9>$LOCKFILE - log_end_msg $? - ;; - stop) - log_daemon_msg "Stopping NTP server" "ntpd" - start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --retry=TERM/30/KILL/5 --exec $DAEMON - log_end_msg $? - rm -f $PIDFILE - ;; - restart|force-reload) - $0 stop && sleep 2 && $0 start - ;; - try-restart) - if $0 status >/dev/null; then - $0 restart - else - exit 0 - fi - ;; - reload) - exit 3 - ;; - status) - status_of_proc $DAEMON "NTP server" - ;; - *) - echo "Usage: $0 {start|stop|restart|try-restart|force-reload|status}" - exit 2 - ;; -esac diff --git a/files/image_config/ntp/ntp-config.sh b/files/image_config/ntp/ntp-config.sh index ace9ad1c8a42..3a2a667d802e 100755 --- a/files/image_config/ntp/ntp-config.sh +++ b/files/image_config/ntp/ntp-config.sh @@ -24,6 +24,10 @@ function modify_ntp_default } sonic-cfggen -d -t /usr/share/sonic/templates/ntp.conf.j2 >/etc/ntp.conf +sonic-cfggen -d -t /usr/share/sonic/templates/ntp.keys.j2 >/etc/ntp.keys + +chown root:ntp /etc/ntp.keys +chmod o-r /etc/ntp.keys get_database_reboot_type echo "Disabling NTP long jump for reboot type ${reboot_type} ..." diff --git a/files/image_config/ntp/ntp-systemd-wrapper b/files/image_config/ntp/ntp-systemd-wrapper index 1e646f39369d..b1e027b9cd5d 100644 --- a/files/image_config/ntp/ntp-systemd-wrapper +++ b/files/image_config/ntp/ntp-systemd-wrapper @@ -13,7 +13,8 @@ if [ -r /etc/default/ntp ]; then . /etc/default/ntp fi -if [ -e /run/ntp.conf.dhcp ]; then +dhcp=$(/usr/local/bin/sonic-cfggen -d -v 'NTP["global"]["dhcp"]' 2> /dev/null) +if [ -e /run/ntp.conf.dhcp ] && [ "$dhcp" = "enabled" ]; then NTPD_OPTS="$NTPD_OPTS -c /run/ntp.conf.dhcp" fi @@ -27,6 +28,14 @@ fi ( flock -w 180 9 + ntpEnabled=$(/usr/local/bin/sonic-cfggen -d -v 'NTP["global"]["admin_state"]' 2> /dev/null) + if [ "$ntpEnabled" = "disabled" ] + then + logger -p INFO -t "ntpd" "Stopping NTP daemon" + start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE + exit 0 + fi + # when mgmt vrf is configured, ntp starts in mgmt vrf by default unless user configures otherwise vrfEnabled=$(/usr/local/bin/sonic-cfggen -d -v 'MGMT_VRF_CONFIG["vrf_global"]["mgmtVrfEnabled"]' 2> /dev/null) vrfConfigured=$(/usr/local/bin/sonic-cfggen -d -v 'NTP["global"]["vrf"]' 2> /dev/null) @@ -34,14 +43,14 @@ fi then if [ "$vrfConfigured" = "default" ] then - log_daemon_msg "Starting NTP server in default-vrf for default set as NTP vrf" "ntpd" + logger -p INFO -t "ntpd" "Starting NTP server in default-vrf for default set as NTP vrf" "ntpd" start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --startas $DAEMON -- -p $PIDFILE $NTPD_OPTS else - log_daemon_msg "Starting NTP server in mgmt-vrf" "ntpd" + logger -p INFO -t "ntpd" "Starting NTP server in mgmt-vrf" ip vrf exec mgmt start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --startas $DAEMON -- -p $PIDFILE $NTPD_OPTS fi else - log_daemon_msg "Starting NTP server in default-vrf" "ntpd" + logger -p INFO -t "ntpd" "Starting NTP server in default-vrf" start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --startas $DAEMON -- -p $PIDFILE $NTPD_OPTS fi ) 9>$LOCKFILE diff --git a/files/image_config/ntp/ntp.conf.j2 b/files/image_config/ntp/ntp.conf.j2 index 280b46a426d8..ff25367f1e16 100644 --- a/files/image_config/ntp/ntp.conf.j2 +++ b/files/image_config/ntp/ntp.conf.j2 @@ -1,45 +1,95 @@ ############################################################################### -# Managed by Ansible -# file: ansible/roles/acs/templates/ntp.conf.j2 +# This file was AUTOMATICALLY GENERATED. DO NOT MODIFY. +# Controlled by ntp-config.service ############################################################################### -# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help - # To avoid ntpd from panic and exit if the drift between new time and # current system time is large. tinker panic 0 driftfile /var/lib/ntp/ntp.drift - -# Enable this if you want statistics to be logged. -#statsdir /var/log/ntpstats/ - statistics loopstats peerstats clockstats filegen loopstats file loopstats type day enable filegen peerstats file peerstats type day enable filegen clockstats file clockstats type day enable +{# Getting NTP global configuration -#} +{% set global = (NTP | d({})).get('global', {}) -%} + +{# Adding NTP servers. We need to know if we have some pools, to set proper +config -#} +{% set ns = namespace(is_pools=false) %} +{% for server in NTP_SERVER if NTP_SERVER[server].admin_state != 'disabled' and + NTP_SERVER[server].resolve_as and + NTP_SERVER[server].association_type -%} + {% set config = NTP_SERVER[server] -%} + {# Server options -#} + {% set soptions = '' -%} + {# Server access control options -#} + {% set aoptions = '' -%} + + {# Authentication key -#} + {% if global.authentication == 'enabled' -%} + {% if config.key -%} + {% set soptions = soptions ~ ' key ' ~ config.key -%} + {% endif -%} + {% endif -%} + + {# Aggressive polling -#} + {% if config.iburst -%} + {% set soptions = soptions ~ ' iburst' -%} + {% endif -%} + + {# Protocol version -#} + {% if config.version -%} + {% set soptions = soptions ~ ' version ' ~ config.version -%} + {% endif -%} + + {# Check if there are any pool configured. BTW it doesn't matter what was + configured as "resolve_as" for pools. If they were configured with FQDN they + must remain like that -#} + {% set config_as = config.resolve_as -%} + {% if config.association_type == 'pool' -%} + {% set ns.is_pools = true -%} + {% set config_as = server -%} + {% else -%} + {% set aoptions = aoptions ~ ' nopeer' -%} + {% endif -%} + +{{ config.association_type }} {{ config_as }}{{ soptions }} +{% if global.server_role == 'disabled' %} +restrict {{ config_as }} kod limited nomodify notrap noquery{{ aoptions }} +{% endif %} -# You do need to talk to an NTP server or two (or three). -#server ntp.your-provider.example +{% endfor -%} -# pool.ntp.org maps to about 1000 low-stratum NTP servers. Your server will -# pick a different set every time it starts up. Please consider joining the -# pool: -{% for ntp_server in NTP_SERVER %} -server {{ ntp_server }} iburst +{% set trusted_keys_arr = [] -%} +{% for key in NTP_KEY -%} + {% set keydata = NTP_KEY[key] -%} + {% if keydata.trusted == 'yes' -%} + {% set trusted_keys_arr = trusted_keys_arr.append(key) -%} + {% endif -%} {% endfor %} -#listen on source interface if configured, else -#only listen on MGMT_INTERFACE, LOOPBACK_INTERFACE ip when MGMT_INTERFACE is not defined, or eth0 -# if we don't have both of them (default is to listen on all ip addresses) +{% if global.authentication == 'enabled' %} +keys /etc/ntp.keys +{% if trusted_keys_arr != [] %} +trustedkey {{ trusted_keys_arr|join(' ') }} +{% endif %} +{% endif %} + +{# listen on source interface if configured, else only listen on MGMT_INTERFACE, +LOOPBACK_INTERFACE ip when MGMT_INTERFACE is not defined, or eth0 if we don't +have both of them (default is to listen on all ip addresses) -#} interface ignore wildcard -# set global variable for configured source interface name -# set global boolean to indicate if the ip of the configured source interface is configured -# if the source interface is configured but no ip on that interface, then listen on another -# interface based on existing logic +{# Set interface to listen on: + * Set global variable for configured source interface name. + * Set global boolean to indicate if the ip of the configured source + interface is configured. + * If the source interface is configured but no ip on that + interface, then listen on another interface based on existing logic. -#} {%- macro check_ip_on_interface(interface_name, table_name) %} {%- set ns = namespace(valid_intf = 'false') %} {%- if table_name %} @@ -54,8 +104,8 @@ interface ignore wildcard {% set ns = namespace(source_intf = "") %} {% set ns = namespace(source_intf_ip = 'false') %} -{% if (NTP) and (NTP['global']['src_intf']) %} - {% set ns.source_intf = (NTP['global']['src_intf']) %} +{% if global.src_intf %} + {% set ns.source_intf = global.src_intf %} {% if ns.source_intf != "" %} {% if ns.source_intf == "eth0" %} {% set ns.source_intf_ip = 'true' %} @@ -90,32 +140,24 @@ interface listen eth0 {% endif %} interface listen 127.0.0.1 -# Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for -# details. The web page -# might also be helpful. -# -# Note that "restrict" applies to both servers and clients, so a configuration -# that might be intended to block requests from certain clients could also end -# up blocking replies from your own upstream servers. +{# Access control options -#} +{% set options = '' -%} + +{# Allow additional servers mobilization from the pool. Otherwise we don't need +that -#} +{% if ns.is_pools == false -%} + {% set options = options ~ ' nopeer' -%} +{% endif -%} +{# Disable NTP server functionality. Should stay on when dhcp is enabled -#} +{# {% if global.server_role == 'disabled' and global.dhcp == 'disabled' -%} + {% set options = options ~ ' ignore' -%} +{% endif -%} #} +# Access control configuration # By default, exchange time with everybody, but don't allow configuration. -restrict -4 default kod notrap nomodify nopeer noquery -restrict -6 default kod notrap nomodify nopeer noquery +restrict -4 default kod limited notrap nomodify noquery{{ options }} +restrict -6 default kod limited notrap nomodify noquery{{ options }} # Local users may interrogate the ntp server more closely. restrict 127.0.0.1 restrict ::1 - -# Clients from this (example!) subnet have unlimited access, but only if -# cryptographically authenticated. -#restrict 192.168.123.0 mask 255.255.255.0 notrust - - -# If you want to provide time to your local subnet, change the next line. -# (Again, the address is an example only.) -#broadcast 192.168.123.255 - -# If you want to listen to time broadcasts on your local subnet, de-comment the -# next lines. Please do this only if you trust everybody on the network! -#disable auth -#broadcastclient diff --git a/files/image_config/ntp/ntp.keys.j2 b/files/image_config/ntp/ntp.keys.j2 new file mode 100644 index 000000000000..961fc7532694 --- /dev/null +++ b/files/image_config/ntp/ntp.keys.j2 @@ -0,0 +1,18 @@ +############################################################################### +# This file was AUTOMATICALLY GENERATED. DO NOT MODIFY. +# Controlled by ntp-config.service +############################################################################### + +{# We can connect only to the servers we trust. Determine those servers -#} +{% set trusted_arr = [] -%} +{% for server in NTP_SERVER if NTP_SERVER[server].trusted == 'yes' and + NTP_SERVER[server].resolve_as -%} + {% set _ = trusted_arr.append(NTP_SERVER[server].resolve_as) -%} +{% endfor -%} + +{# Define authentication keys inventory -#} +{% set trusted_str = ' ' ~ trusted_arr|join(',') -%} +{% for keyid in NTP_KEY if NTP_KEY[keyid].type and NTP_KEY[keyid].value %} +{% set keyval = NTP_KEY[keyid].value | b64decode %} +{{ keyid }} {{ NTP_KEY[keyid].type }} {{ keyval }}{{trusted_str}} +{% endfor -%} diff --git a/src/sonic-config-engine/sonic-cfggen b/src/sonic-config-engine/sonic-cfggen index 243cc3ac2a87..e7451a1e1710 100755 --- a/src/sonic-config-engine/sonic-cfggen +++ b/src/sonic-config-engine/sonic-cfggen @@ -26,6 +26,7 @@ import os import sys import yaml import ipaddress +import base64 from collections import OrderedDict from config_samples import generate_sample_config, get_available_config @@ -138,6 +139,28 @@ def ip_network(value): return "Invalid ip address %s" % value return r_v.network +def b64encode(value): + """Base64 encoder + Return: + encoded string or the same value in case of error + """ + try: + ret = base64.b64encode(value.encode()).decode() + except: + return value + return ret + +def b64decode(value): + """Base64 decoder + Return: + decoded string or the same value in case of error + """ + try: + ret = base64.b64decode(value.encode()).decode() + except: + return value + return ret + def get_primary_addr(value): if not value: return "" @@ -273,6 +296,10 @@ def _get_jinja2_env(paths): for attr in ['ip', 'network', 'prefixlen', 'netmask', 'broadcast']: env.filters[attr] = partial(prefix_attr, attr) + # Base64 encoder/decoder + env.filters['b64encode'] = b64encode + env.filters['b64decode'] = b64decode + return env def main(): diff --git a/src/sonic-config-engine/tests/data/ntp/ntp_interfaces.json b/src/sonic-config-engine/tests/data/ntp/ntp_interfaces.json index 284758301411..a8da7f1331ff 100644 --- a/src/sonic-config-engine/tests/data/ntp/ntp_interfaces.json +++ b/src/sonic-config-engine/tests/data/ntp/ntp_interfaces.json @@ -1,7 +1,49 @@ { "NTP": { "global": { - "src_intf": "Ethernet0" + "src_intf": "eth0", + "vrf": "default", + "authentication": "enabled", + "dhcp": "disabled", + "server_role": "disabled", + "admin_state": "enabled" + } + }, + "NTP_SERVER": { + "my_ntp_server": { + "association_type": "server", + "iburst": "off", + "admin_state": "disabled", + "version": 3, + "resolve_as": "10.20.30.40" + }, + "server2": { + "association_type": "server", + "iburst": "off", + "admin_state": "enabled", + "version": 3, + "resolve_as": "10.20.30.50", + "key": 42, + "trusted": "no" + }, + "pool.ntp.org": { + "association_type": "pool", + "iburst": "on", + "admin_state": "enabled", + "version": 3, + "resolve_as": "pool.ntp.org" + } + }, + "NTP_KEY": { + "1": { + "type": "md5", + "trusted": "no", + "value": "blabla" + }, + "42": { + "type": "sha1", + "trusted": "yes", + "value": "the_answer" } }, "INTERFACE": { diff --git a/src/sonic-config-engine/tests/ntp.keys.j2 b/src/sonic-config-engine/tests/ntp.keys.j2 new file mode 120000 index 000000000000..a95603db8be2 --- /dev/null +++ b/src/sonic-config-engine/tests/ntp.keys.j2 @@ -0,0 +1 @@ +../../../files/image_config/ntp/ntp.keys.j2 \ No newline at end of file diff --git a/src/sonic-config-engine/tests/sample_output/py2/ntp.conf b/src/sonic-config-engine/tests/sample_output/py2/ntp.conf deleted file mode 100644 index bc98019e88f7..000000000000 --- a/src/sonic-config-engine/tests/sample_output/py2/ntp.conf +++ /dev/null @@ -1,72 +0,0 @@ -############################################################################### -# Managed by Ansible -# file: ansible/roles/acs/templates/ntp.conf.j2 -############################################################################### - -# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help - -# To avoid ntpd from panic and exit if the drift between new time and -# current system time is large. -tinker panic 0 - -driftfile /var/lib/ntp/ntp.drift - - -# Enable this if you want statistics to be logged. -#statsdir /var/log/ntpstats/ - -statistics loopstats peerstats clockstats -filegen loopstats file loopstats type day enable -filegen peerstats file peerstats type day enable -filegen clockstats file clockstats type day enable - - -# You do need to talk to an NTP server or two (or three). -#server ntp.your-provider.example - -# pool.ntp.org maps to about 1000 low-stratum NTP servers. Your server will -# pick a different set every time it starts up. Please consider joining the -# pool: - -#listen on source interface if configured, else -#only listen on MGMT_INTERFACE, LOOPBACK_INTERFACE ip when MGMT_INTERFACE is not defined, or eth0 -# if we don't have both of them (default is to listen on all ip addresses) -interface ignore wildcard - -# set global variable for configured source interface name -# set global boolean to indicate if the ip of the configured source interface is configured -# if the source interface is configured but no ip on that interface, then listen on another -# interface based on existing logic - -interface listen Ethernet0 -interface listen 127.0.0.1 - -# Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for -# details. The web page -# might also be helpful. -# -# Note that "restrict" applies to both servers and clients, so a configuration -# that might be intended to block requests from certain clients could also end -# up blocking replies from your own upstream servers. - -# By default, exchange time with everybody, but don't allow configuration. -restrict -4 default kod notrap nomodify nopeer noquery -restrict -6 default kod notrap nomodify nopeer noquery - -# Local users may interrogate the ntp server more closely. -restrict 127.0.0.1 -restrict ::1 - -# Clients from this (example!) subnet have unlimited access, but only if -# cryptographically authenticated. -#restrict 192.168.123.0 mask 255.255.255.0 notrust - - -# If you want to provide time to your local subnet, change the next line. -# (Again, the address is an example only.) -#broadcast 192.168.123.255 - -# If you want to listen to time broadcasts on your local subnet, de-comment the -# next lines. Please do this only if you trust everybody on the network! -#disable auth -#broadcastclient diff --git a/src/sonic-config-engine/tests/sample_output/py2/ntp.conf b/src/sonic-config-engine/tests/sample_output/py2/ntp.conf new file mode 120000 index 000000000000..5ebe399367a6 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py2/ntp.conf @@ -0,0 +1 @@ +../py3/ntp.conf \ No newline at end of file diff --git a/src/sonic-config-engine/tests/sample_output/py2/ntp.keys b/src/sonic-config-engine/tests/sample_output/py2/ntp.keys new file mode 120000 index 000000000000..5f1ab315e5a5 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py2/ntp.keys @@ -0,0 +1 @@ +../py3/ntp.keys \ No newline at end of file diff --git a/src/sonic-config-engine/tests/sample_output/py3/ntp.conf b/src/sonic-config-engine/tests/sample_output/py3/ntp.conf index bc98019e88f7..56f18e3ca13b 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/ntp.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/ntp.conf @@ -1,72 +1,42 @@ ############################################################################### -# Managed by Ansible -# file: ansible/roles/acs/templates/ntp.conf.j2 +# This file was AUTOMATICALLY GENERATED. DO NOT MODIFY. +# Controlled by ntp-config.service ############################################################################### -# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help - # To avoid ntpd from panic and exit if the drift between new time and # current system time is large. tinker panic 0 driftfile /var/lib/ntp/ntp.drift - -# Enable this if you want statistics to be logged. -#statsdir /var/log/ntpstats/ - statistics loopstats peerstats clockstats filegen loopstats file loopstats type day enable filegen peerstats file peerstats type day enable filegen clockstats file clockstats type day enable +server 10.20.30.50 key 42 iburst version 3 +restrict 10.20.30.50 kod limited nomodify notrap noquery nopeer -# You do need to talk to an NTP server or two (or three). -#server ntp.your-provider.example +pool pool.ntp.org iburst version 3 +restrict pool.ntp.org kod limited nomodify notrap noquery -# pool.ntp.org maps to about 1000 low-stratum NTP servers. Your server will -# pick a different set every time it starts up. Please consider joining the -# pool: -#listen on source interface if configured, else -#only listen on MGMT_INTERFACE, LOOPBACK_INTERFACE ip when MGMT_INTERFACE is not defined, or eth0 -# if we don't have both of them (default is to listen on all ip addresses) +keys /etc/ntp.keys +trustedkey 42 + interface ignore wildcard -# set global variable for configured source interface name -# set global boolean to indicate if the ip of the configured source interface is configured -# if the source interface is configured but no ip on that interface, then listen on another -# interface based on existing logic + -interface listen Ethernet0 +interface listen eth0 interface listen 127.0.0.1 -# Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for -# details. The web page -# might also be helpful. -# -# Note that "restrict" applies to both servers and clients, so a configuration -# that might be intended to block requests from certain clients could also end -# up blocking replies from your own upstream servers. +# Access control configuration # By default, exchange time with everybody, but don't allow configuration. -restrict -4 default kod notrap nomodify nopeer noquery -restrict -6 default kod notrap nomodify nopeer noquery +restrict -4 default kod limited notrap nomodify noquery +restrict -6 default kod limited notrap nomodify noquery # Local users may interrogate the ntp server more closely. restrict 127.0.0.1 restrict ::1 - -# Clients from this (example!) subnet have unlimited access, but only if -# cryptographically authenticated. -#restrict 192.168.123.0 mask 255.255.255.0 notrust - - -# If you want to provide time to your local subnet, change the next line. -# (Again, the address is an example only.) -#broadcast 192.168.123.255 - -# If you want to listen to time broadcasts on your local subnet, de-comment the -# next lines. Please do this only if you trust everybody on the network! -#disable auth -#broadcastclient diff --git a/src/sonic-config-engine/tests/sample_output/py3/ntp.keys b/src/sonic-config-engine/tests/sample_output/py3/ntp.keys new file mode 100644 index 000000000000..4a1a37b693eb --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/ntp.keys @@ -0,0 +1,8 @@ +############################################################################### +# This file was AUTOMATICALLY GENERATED. DO NOT MODIFY. +# Controlled by ntp-config.service +############################################################################### + +1 md5 blabla +42 sha1 the_answer + diff --git a/src/sonic-config-engine/tests/test_j2files.py b/src/sonic-config-engine/tests/test_j2files.py index 125668f24a80..5f317855072c 100644 --- a/src/sonic-config-engine/tests/test_j2files.py +++ b/src/sonic-config-engine/tests/test_j2files.py @@ -663,10 +663,19 @@ def test_ndppd_conf(self): def test_ntp_conf(self): conf_template = os.path.join(self.test_dir, "ntp.conf.j2") - ntp_interfaces_json = os.path.join(self.test_dir, "data", "ntp", "ntp_interfaces.json") + config_db_ntp_json = os.path.join(self.test_dir, "data", "ntp", "ntp_interfaces.json") expected = os.path.join(self.test_dir, "sample_output", utils.PYvX_DIR, "ntp.conf") - argument = ['-j', ntp_interfaces_json, '-t', conf_template] + argument = ['-j', config_db_ntp_json, '-t', conf_template] + self.run_script(argument, output_file=self.output_file) + assert utils.cmp(expected, self.output_file), self.run_diff(expected, self.output_file) + + def test_ntp_keys(self): + conf_template = os.path.join(self.test_dir, "ntp.keys.j2") + config_db_ntp_json = os.path.join(self.test_dir, "data", "ntp", "ntp_interfaces.json") + expected = os.path.join(self.test_dir, "sample_output", utils.PYvX_DIR, "ntp.keys") + + argument = ['-j', config_db_ntp_json, '-t', conf_template] self.run_script(argument, output_file=self.output_file) assert utils.cmp(expected, self.output_file), self.run_diff(expected, self.output_file) diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index a28ffa5c57d9..5ee894f7aae1 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -1538,6 +1538,35 @@ 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 Admin state*** + +If this option is set to `enabled` then ntp client will try to sync system time with configured NTP servers. +Otherwise, NTP client feature will be disabled. +``` +{ + "NTP": { + "global": { + "admin_state": "enabled" + } + } +} +``` + +***NTP Server role*** + +This option is used to control NTP server state on the switch. +If this option is set to `enabled` switch will act as NTP server. +By default `server_role` is `disabled`. +``` +{ + "NTP": { + "global": { + "server_role": "enabled" + } + } +} +``` + ***NTP VRF*** If this option is set to `default` then ntp will run within the default vrf @@ -1575,6 +1604,36 @@ for that address. } ``` +***NTP Authentication*** + +If this option is set to `enabled` then ntp will try to verify NTP servers it connects to. +This option **has no effect** if key is not set for NTP server. +By default it is `disabled` +``` +{ + "NTP": { + "global": { + "authentication": "enabled" + } + } +} +``` + +***NTP DHCP leases*** + +If this option is set to `enabled` then ntp client will try to use NTP servers provided by DHCP server. +If this option is set to `disabled` you will be able to use the user-configured NTP servers. +By default it is `enabled` +``` +{ + "NTP": { + "global": { + "dhcp": "enabled" + } + } +} +``` + ### NTP servers These information are configured in individual tables. Domain name or IP @@ -1585,18 +1644,77 @@ attributes in those objects. ``` { "NTP_SERVER": { - "2.debian.pool.ntp.org": {}, - "1.debian.pool.ntp.org": {}, - "3.debian.pool.ntp.org": {}, - "0.debian.pool.ntp.org": {} + "2.debian.pool.ntp.org": { + "association_type": "pool", + "iburst": "on", + "admin_state": "enabled", + "version": 4 + }, + "1.debian.pool.ntp.org": { + "association_type": "pool", + "iburst": "off", + "admin_state": "enabled", + "version": 3 + }, + "3.debian.pool.ntp.org": { + "association_type": "pool", + "iburst": "on", + "admin_state": "disabled", + "version": 4 + }, + "0.debian.pool.ntp.org": { + "association_type": "pool", + "iburst": "off", + "admin_state": "disabled", + "version": 3 + } }, "NTP_SERVER": { - "23.92.29.245": {}, - "204.2.134.164": {} + "23.92.29.245": { + "association_type": "server", + "iburst": "on", + "admin_state": "enabled", + "version": 4, + "key": 3, + "trusted": "yes" + }, + "204.2.134.164": { + "association_type": "server", + "iburst": "on", + "admin_state": "enabled", + "version": 3 + } + } +} +``` +* `association_type` - is used to control the type of the server. It can be `server` or `pool`. +* `iburst` - agressive server polling `{on, off}`. +* `version` - NTP protool version to use `[3..4]`. +* `key` - authentication key id `[1..65535]` to use to auth the server. +* `admin_state` - enable or disable specific server. +* `trusted` - trust this server when auth is enabled. + +***NTP keys*** +``` +{ + "NTP_KEY": { + "1": { + "type": "md5", + "value": "bXlwYXNzd29yZA==", + "trusted": "yes" + }, + "42": { + "type": "sha1", + "value": "dGhlYW5zd2Vy", + "trusted": "no" + } } } ``` +* `type` - key type to use `{md5, sha1, sha256, sha384, sha512}`. +* `value` - base64 encoded key value. +* `trusted` - trust this NTP key `{yes, no}`. ### Peer Switch 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 4eba94e72f1c..b0e3f5f589a7 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -477,14 +477,36 @@ }, "NTP": { "global": { + "authentication": "disabled", + "dhcp": "enabled", + "server_role": "disabled", + "admin_state": "enabled", "vrf": "mgmt", "src_intf": "eth0;Loopback0" } }, "NTP_SERVER": { - "0.debian.pool.ntp.org": {}, - "23.92.29.245": {}, - "2001:aa:aa::aa": {} + "0.debian.pool.ntp.org": { + "association_type": "pool", + "resolve_as": "0.debian.pool.ntp.org" + }, + "time.google.com": { + "association_type": "server", + "resolve_as": "216.239.35.4" + }, + "23.92.29.245": { + "admin_state": "enabled", + "association_type": "server", + "resolve_as": "23.92.29.245", + "iburst": "off", + "trusted": "yes" + }, + "2001:aa:aa::aa": { + "admin_state": "disabled", + "iburst": "on", + "association_type": "server", + "resolve_as": "2001:aa:aa::aa" + } }, "SYSLOG_SERVER" : { "10.13.14.17": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/ntp.json b/src/sonic-yang-models/tests/yang_model_tests/tests/ntp.json index c798de7d832e..f380162b83db 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/ntp.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/ntp.json @@ -58,5 +58,82 @@ "desc": "CONFIGURE NON-EXISTING MGMT INTERFACE AS NTP SOURCE INTERFACE.", "eStrKey": "InvalidValue", "eStr": ["src"] + }, + "NTP_GLOB_VALID1": { + "desc": "NTP global params valid config 1" + }, + "NTP_GLOB_VALID2": { + "desc": "NTP global params valid config 2" + }, + "NTP_AUTH_INVALID1": { + "desc": "NTP authentication state invalid 1", + "eStrKey": "InvalidValue" + }, + "NTP_AUTH_INVALID2": { + "desc": "NTP authentication state invalid 2", + "eStrKey": "InvalidValue" + }, + "NTP_DHCP_INVALID1": { + "desc": "NTP DHCP state invalid 1", + "eStrKey": "InvalidValue" + }, + "NTP_DHCP_INVALID2": { + "desc": "NTP DHCP state invalid 2", + "eStrKey": "InvalidValue" + }, + "NTP_SERVER_ROLE_INVALID1": { + "desc": "NTP server role state invalid 1", + "eStrKey": "InvalidValue" + }, + "NTP_SERVER_ROLE_INVALID2": { + "desc": "NTP server role state invalid 2", + "eStrKey": "InvalidValue" + }, + "NTP_STATE_INVALID1": { + "desc": "NTP daemon state invalid 1", + "eStrKey": "InvalidValue" + }, + "NTP_STATE_INVALID2": { + "desc": "NTP daemon state invalid 2", + "eStrKey": "InvalidValue" + }, + "NTP_SERVER_ASSOCIATION_INVALID": { + "desc": "NTP server type invalid", + "eStrKey": "InvalidValue" + }, + "NTP_SERVER_IBURST_INVALID": { + "desc": "NTP server aggressive mode invalid", + "eStrKey": "InvalidValue" + }, + "NTP_SERVER_KEY_INVALID": { + "desc": "NTP server authentication key invalid", + "eStrKey": "InvalidValue" + }, + "NTP_SERVER_STATE_INVALID": { + "desc": "NTP server state invalid", + "eStrKey": "InvalidValue" + }, + "NTP_SERVER_TRUSTED_INVALID": { + "desc": "NTP server trusted mode invalid", + "eStrKey": "InvalidValue" + }, + "NTP_KEY_VALID": { + "desc": "NTP authentication keys inventory" + }, + "NTP_KEY_ID_INVALID": { + "desc": "NTP authentication keys invalid key id", + "eStrKey": "InvalidValue" + }, + "NTP_KEY_TRUSTED_INVALID": { + "desc": "NTP authentication keys invalid trustiness", + "eStrKey": "InvalidValue" + }, + "NTP_KEY_TYPE_INVALID": { + "desc": "NTP authentication keys invalid key type", + "eStrKey": "InvalidValue" + }, + "NTP_KEY_VALUE_INVALID": { + "desc": "NTP authentication keys bad key value", + "eStrKey": "Range" } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/ntp.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/ntp.json index 5b9ab1495afc..c886bec3d200 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/ntp.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/ntp.json @@ -4,13 +4,38 @@ "sonic-ntp:NTP_SERVER": { "NTP_SERVER_LIST": [ { - "server_address": "10.11.12.13" + "server_address": "10.11.12.13", + "association_type": "server", + "iburst": "on", + "key": 10, + "admin_state": "enabled", + "trusted": "no" }, { - "server_address": "2001:aa:aa::aa" + "server_address": "2001:aa:aa::aa", + "association_type": "server", + "iburst": "off", + "key": 15, + "admin_state": "disabled", + "trusted": "yes" }, { - "server_address": "pool.ntp.org" + "server_address": "pool.ntp.org", + "association_type": "pool", + "iburst": "on", + "admin_state": "enabled" + } + ] + }, + "sonic-ntp:NTP_KEY": { + "NTP_KEYS_LIST": [ + { + "id": 10, + "value": "bHVtb3M=" + }, + { + "id": 15, + "value": "Ym9tYmFyZGE=" } ] } @@ -237,5 +262,234 @@ ] } } + }, + "NTP_GLOB_VALID1": { + "sonic-ntp:sonic-ntp": { + "sonic-ntp:NTP": { + "sonic-ntp:global": { + "authentication": "enabled", + "dhcp": "enabled", + "server_role": "enabled", + "admin_state": "enabled" + } + } + } + }, + "NTP_GLOB_VALID2": { + "sonic-ntp:sonic-ntp": { + "sonic-ntp:NTP": { + "sonic-ntp:global": { + "authentication": "disabled", + "dhcp": "disabled", + "server_role": "disabled", + "admin_state": "disabled" + } + } + } + }, + "NTP_AUTH_INVALID1": { + "sonic-ntp:sonic-ntp": { + "sonic-ntp:NTP": { + "sonic-ntp:global": { + "authentication": "" + } + } + } + }, + "NTP_AUTH_INVALID2": { + "sonic-ntp:sonic-ntp": { + "sonic-ntp:NTP": { + "sonic-ntp:global": { + "authentication": "blahblah" + } + } + } + }, + "NTP_DHCP_INVALID1": { + "sonic-ntp:sonic-ntp": { + "sonic-ntp:NTP": { + "sonic-ntp:global": { + "dhcp": "" + } + } + } + }, + "NTP_DHCP_INVALID2": { + "sonic-ntp:sonic-ntp": { + "sonic-ntp:NTP": { + "sonic-ntp:global": { + "dhcp": "abracadabra" + } + } + } + }, + "NTP_SERVER_ROLE_INVALID1": { + "sonic-ntp:sonic-ntp": { + "sonic-ntp:NTP": { + "sonic-ntp:global": { + "server_role": "" + } + } + } + }, + "NTP_SERVER_ROLE_INVALID2": { + "sonic-ntp:sonic-ntp": { + "sonic-ntp:NTP": { + "sonic-ntp:global": { + "server_role": "olololo" + } + } + } + }, + "NTP_STATE_INVALID1": { + "sonic-ntp:sonic-ntp": { + "sonic-ntp:NTP": { + "sonic-ntp:global": { + "admin_state": "" + } + } + } + }, + "NTP_STATE_INVALID2": { + "sonic-ntp:sonic-ntp": { + "sonic-ntp:NTP": { + "sonic-ntp:global": { + "admin_state": "azazaza" + } + } + } + }, + "NTP_SERVER_ASSOCIATION_INVALID": { + "sonic-ntp:sonic-ntp": { + "sonic-ntp:NTP_SERVER": { + "NTP_SERVER_LIST": [ + { + "server_address": "2001:aa:aa:aa", + "association_type": "puul" + } + ] + } + } + }, + "NTP_SERVER_IBURST_INVALID": { + "sonic-ntp:sonic-ntp": { + "sonic-ntp:NTP_SERVER": { + "NTP_SERVER_LIST": [ + { + "server_address": "2001:aa:aa:aa", + "iburst": "of" + } + ] + } + } + }, + "NTP_SERVER_KEY_INVALID": { + "sonic-ntp:sonic-ntp": { + "sonic-ntp:NTP_SERVER": { + "NTP_SERVER_LIST": [ + { + "server_address": "2001:aa:aa:aa", + "key": 0 + } + ] + } + } + }, + "NTP_SERVER_STATE_INVALID": { + "sonic-ntp:sonic-ntp": { + "sonic-ntp:NTP_SERVER": { + "NTP_SERVER_LIST": [ + { + "server_address": "2001:aa:aa:aa", + "admin_state": "enable" + } + ] + } + } + }, + "NTP_SERVER_TRUSTED_INVALID": { + "sonic-ntp:sonic-ntp": { + "sonic-ntp:NTP_SERVER": { + "NTP_SERVER_LIST": [ + { + "server_address": "2001:aa:aa:aa", + "trusted": "not" + } + ] + } + } + }, + "NTP_KEY_VALID": { + "sonic-ntp:sonic-ntp": { + "sonic-ntp:NTP_KEY": { + "NTP_KEYS_LIST": [ + { + "id": 20, + "type": "md5", + "value": "anNkZjg4MzIwZnNkMkBANDQ1", + "trusted": "no" + }, + { + "id": 30, + "type": "sha1", + "value": "YWFiYmNjZGRlZWZm", + "trusted": "yes" + }, + { + "id": 42, + "type": "md5", + "value": "dGhlYW5zd2Vy", + "trusted": "yes" + } + ] + } + } + }, + "NTP_KEY_ID_INVALID": { + "sonic-ntp:sonic-ntp": { + "sonic-ntp:NTP_KEY": { + "NTP_KEYS_LIST": [ + { + "id": 100000 + } + ] + } + } + }, + "NTP_KEY_TRUSTED_INVALID": { + "sonic-ntp:sonic-ntp": { + "sonic-ntp:NTP_KEY": { + "NTP_KEYS_LIST": [ + { + "id": 20, + "trusted": "nope" + } + ] + } + } + }, + "NTP_KEY_TYPE_INVALID": { + "sonic-ntp:sonic-ntp": { + "sonic-ntp:NTP_KEY": { + "NTP_KEYS_LIST": [ + { + "id": 20, + "type": "md6" + } + ] + } + } + }, + "NTP_KEY_VALUE_INVALID": { + "sonic-ntp:sonic-ntp": { + "sonic-ntp:NTP_KEY": { + "NTP_KEYS_LIST": [ + { + "id": 20, + "value": "" + } + ] + } + } } } diff --git a/src/sonic-yang-models/yang-models/sonic-ntp.yang b/src/sonic-yang-models/yang-models/sonic-ntp.yang index f28e1052096a..2591f8c7a58b 100644 --- a/src/sonic-yang-models/yang-models/sonic-ntp.yang +++ b/src/sonic-yang-models/yang-models/sonic-ntp.yang @@ -33,6 +33,10 @@ module sonic-ntp { prefix mprt; } + import sonic-types { + prefix stypes; + } + description "NTP yang Module for SONiC OS"; @@ -41,6 +45,39 @@ module sonic-ntp { "First revision"; } + revision 2023-03-20 { + description + "Add extended configuration options"; + } + + typedef association-type { + description "NTP server association type"; + type enumeration { + enum server; + enum pool; + } + } + + typedef key-type { + description "NTP key encryption type"; + type enumeration { + enum md5; + enum sha1; + enum sha256; + enum sha384; + enum sha512; + } + } + + typedef key-id { + description "NTP key ID"; + type uint16 { + range 1..65535 { + error-message "Failed NTP key ID"; + } + } + } + container sonic-ntp { container NTP { @@ -68,6 +105,9 @@ module sonic-ntp { type leafref { path /mprt:sonic-mgmt_port/mprt:MGMT_PORT/mprt:MGMT_PORT_LIST/mprt:name; } + type string { + pattern 'eth0'; + } } description @@ -92,6 +132,30 @@ module sonic-ntp { default VRF or Management VRF."; } + leaf authentication { + type stypes:admin_mode; + default disabled; + description "NTP authentication state"; + } + + leaf dhcp { + type stypes:admin_mode; + default enabled; + description "Use NTP servers distributed by DHCP"; + } + + leaf server_role { + type stypes:admin_mode; + default enabled; + description "NTP server functionality state"; + } + + leaf admin_state { + type stypes:admin_mode; + default enabled; + description "NTP feature state"; + } + } /* end of container global */ } /* end of container NTP */ @@ -112,10 +176,95 @@ module sonic-ntp { leaf server_address { type inet:host; } + + leaf association_type { + type association-type; + default server; + description "NTP remote association type: server or pool."; + } + + leaf iburst { + type stypes:on-off; + default on; + description "NTP aggressive polling"; + } + + leaf key { + description "NTP server key ID"; + type leafref { + path /ntp:sonic-ntp/ntp:NTP_KEY/ntp:NTP_KEYS_LIST/ntp:id; + } + } + + leaf resolve_as { + type inet:host; + description "Server resolved IP address"; + } + + leaf admin_state { + type stypes:admin_mode; + default enabled; + description "NTP server state"; + } + + leaf trusted { + type stypes:yes-no; + default no; + description "Trust this server. It will force time + synchronization only to this server when + authentication is enabled"; + } + + leaf version { + type uint8 { + range "3..4" { + error-message "Failed NTP version"; + } + } + default 4; + description "NTP proto version to communicate with NTP + server"; + } + } /* end of list NTP_SERVER_LIST */ } /* end of container NTP_SERVER */ + container NTP_KEY { + + description "NTP authentication keys inventory"; + + list NTP_KEYS_LIST { + description "NTP authentication keys inventory"; + key "id"; + + leaf id { + type key-id; + description "NTP key ID"; + } + + leaf trusted { + type stypes:yes-no; + default no; + description "Trust this NTP key"; + } + + leaf value { + type string { + length 1..64; + } + description "NTP encrypted authentication key"; + } + + leaf type { + type key-type; + default md5; + description "NTP authentication key type"; + } + } /* end of list NTP_KEYS_LIST */ + + } /* end of container NTP_KEY */ + } /* end of container sonic-ntp */ } /* end of module sonic-ntp */ diff --git a/src/sonic-yang-models/yang-templates/sonic-types.yang.j2 b/src/sonic-yang-models/yang-templates/sonic-types.yang.j2 index 4007a386b34d..909a883a0e1c 100644 --- a/src/sonic-yang-models/yang-templates/sonic-types.yang.j2 +++ b/src/sonic-yang-models/yang-templates/sonic-types.yang.j2 @@ -360,6 +360,22 @@ module sonic-types { "BCP 175: Procedures for Maintaining the Time Zone Database"; } + typedef yes-no { + description "Yes/No configuration"; + type enumeration { + enum yes; + enum no; + } + } + + typedef on-off { + description "On/Off configuration"; + type enumeration { + enum on; + enum off; + } + } + {% if yang_model_type == "cvl" %} /* Required for CVL */ container operation { From 49e96c3daa73a00971a4e60b2a4c8bf1984d8edd Mon Sep 17 00:00:00 2001 From: Nazarii Hnydyn Date: Thu, 21 Dec 2023 19:45:42 +0200 Subject: [PATCH 042/419] [mellanox]: Disable MFT bash autocompletion. (#17543) Signed-off-by: Nazarii Hnydyn --- platform/mellanox/mft/Makefile | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/platform/mellanox/mft/Makefile b/platform/mellanox/mft/Makefile index 3139e874cc08..43472ba69e29 100644 --- a/platform/mellanox/mft/Makefile +++ b/platform/mellanox/mft/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 2016-2021 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2016-2023 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -42,6 +42,8 @@ DERIVED_TARGETS = $(MOD_DEB) mft-oem_$(MFT_VERSION)-$(MFT_REVISION)_$(CONFIGURED DKMS_BMDEB = /var/lib/dkms/kernel-mft-dkms/$(MFT_VERSION)/bmdeb DKMS_TMP := $(shell mktemp -u -d -t dkms.XXXXXXXXXX) +MFT_TMP := $(shell mktemp -u -d -t mft.XXXXXXXXXX) + $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : rm -rf $(MFT_NAME) wget -O $(MFT_TGZ) $(MFT_TGZ_URL) @@ -75,6 +77,19 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : rm -rf $(DKMS_TMP) + # w/a: disable bash autocompletion + mkdir -p $(MFT_TMP)/DEBIAN + + dpkg -e $(MFT_NAME)/DEBS/$(MAIN_TARGET) $(MFT_TMP)/DEBIAN + dpkg -x $(MFT_NAME)/DEBS/$(MAIN_TARGET) $(MFT_TMP) + + rm -rf $(MFT_TMP)/etc/bash_completion.d + sed -i '/bash_completion.d/d' $(MFT_TMP)/DEBIAN/conffiles + + dpkg -b $(MFT_TMP) $(MFT_NAME)/DEBS/$(MAIN_TARGET) + + rm -rf $(MFT_TMP) + # fix timestamp because we do not actually build tools, only kernel touch $(MFT_NAME)/DEBS/*.deb mv $(MFT_NAME)/DEBS/*.deb $(DEST) From 16e695b912ecadd0fd5a3a4a2750228aab5a68b4 Mon Sep 17 00:00:00 2001 From: Ying Xie Date: Fri, 22 Dec 2023 08:49:34 -0800 Subject: [PATCH 043/419] [202311] lock down submodule branches (#17597) Signed-off-by: Ying Xie --- .gitmodules | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 26bfb47d2801..e68976c433d9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -23,12 +23,15 @@ [submodule "sonic-dbsyncd"] path = src/sonic-dbsyncd url = https://github.com/sonic-net/sonic-dbsyncd + branch = 202311 [submodule "src/sonic-py-swsssdk"] path = src/sonic-py-swsssdk url = https://github.com/sonic-net/sonic-py-swsssdk.git + branch = 202311 [submodule "src/sonic-snmpagent"] path = src/sonic-snmpagent url = https://github.com/sonic-net/sonic-snmpagent + branch = 202311 [submodule "src/ptf"] path = src/ptf url = https://github.com/p4lang/ptf.git @@ -81,7 +84,7 @@ [submodule "src/sonic-restapi"] path = src/sonic-restapi url = https://github.com/sonic-net/sonic-restapi.git - branch = master + branch = 202311 [submodule "src/sonic-mgmt-common"] path = src/sonic-mgmt-common url = https://github.com/sonic-net/sonic-mgmt-common.git @@ -98,6 +101,7 @@ [submodule "src/linkmgrd"] path = src/linkmgrd url = https://github.com/sonic-net/sonic-linkmgrd.git + branch = 202311 [submodule "src/sonic-p4rt/sonic-pins"] path = src/sonic-p4rt/sonic-pins url = https://github.com/sonic-net/sonic-pins.git @@ -107,6 +111,7 @@ [submodule "src/dhcprelay"] path = src/dhcprelay url = https://github.com/sonic-net/sonic-dhcp-relay.git + branch = 202311 [submodule "src/sonic-host-services"] path = src/sonic-host-services url = https://github.com/sonic-net/sonic-host-services @@ -114,15 +119,18 @@ [submodule "src/sonic-gnmi"] path = src/sonic-gnmi url = https://github.com/sonic-net/sonic-gnmi.git + branch = 202311 [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 + branch = 202311 [submodule "src/sonic-dash-api"] path = src/sonic-dash-api url = https://github.com/sonic-net/sonic-dash-api.git + branch = 202311 [submodule "platform/marvell-arm64/mrvl-prestera"] path = platform/marvell-arm64/mrvl-prestera url = https://github.com/Marvell-switching/mrvl-prestera.git From af08f29d4db94ae31f889500babdc9fec61129cc Mon Sep 17 00:00:00 2001 From: Ying Xie Date: Fri, 22 Dec 2023 11:23:31 -0800 Subject: [PATCH 044/419] [202311][YANG][sonic-utilities] update sonic DB version string format (#17600) Old format: version_a_b_c New format: version__ sonic-utilities: * fba4bf0b 2023-12-21 | [202311][db_migrator] add db migrator version space for 202305/202311 branch (#3082) (HEAD -> 202311, github/202311) [Ying Xie] Signed-off-by: Ying Xie --- src/sonic-utilities | 2 +- src/sonic-yang-models/yang-models/sonic-versions.yang | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index 1b1402f5dc0f..fba4bf0b9329 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 1b1402f5dc0fd01e5f0d25679e7382fc96226a40 +Subproject commit fba4bf0b932949117d5383afccdeb36d6a882209 diff --git a/src/sonic-yang-models/yang-models/sonic-versions.yang b/src/sonic-yang-models/yang-models/sonic-versions.yang index ad9b95f94180..9c405e4def29 100644 --- a/src/sonic-yang-models/yang-models/sonic-versions.yang +++ b/src/sonic-yang-models/yang-models/sonic-versions.yang @@ -23,7 +23,7 @@ module sonic-versions { leaf VERSION { type string { length 1..255; - pattern 'version_([1-9]|[1-9]{1}[0-9]{1})_([0-9]{1,2})_([0-9]{1,2})'; + pattern 'version_(([1-9]|[1-9]{1}[0-9]{1})_([0-9]{1,2})_([0-9]{1,2})|([1-9]{1}[0-9]{5})_([0-9]{2}))'; } } } From 27c1e9bb42bba325591b8b2cbeceda478b2c4fd1 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 3 Jan 2024 04:40:15 +0800 Subject: [PATCH 045/419] [dhcp_server] Fix ut issue in test_utils and test_dhcp_cfggen (#17646) (#17651) --- .../tests/test_dhcp_db_monitor.py | 54 ++++++------------- src/sonic-dhcp-utilities/tests/test_utils.py | 12 ++++- 2 files changed, 27 insertions(+), 39 deletions(-) diff --git a/src/sonic-dhcp-utilities/tests/test_dhcp_db_monitor.py b/src/sonic-dhcp-utilities/tests/test_dhcp_db_monitor.py index 6cea6868d86a..75b773599997 100644 --- a/src/sonic-dhcp-utilities/tests/test_dhcp_db_monitor.py +++ b/src/sonic-dhcp-utilities/tests/test_dhcp_db_monitor.py @@ -211,15 +211,12 @@ def test_db_event_checker_subscribe_table(mock_swsscommon_dbconnector_init, enab mock_sub.assert_called_once_with(ANY, "") -@pytest.mark.parametrize("tested_db_snapshot", [{"enabled_dhcp_interfaces": "Vlan1000"}, {}]) +@pytest.mark.parametrize("tested_db_snapshot", [{"enabled_dhcp_interfaces": {"Vlan1000"}}, {}]) @pytest.mark.parametrize("tested_data", get_subscribe_table_tested_data("test_dhcp_server_update")) -@pytest.mark.parametrize("enabled", [True, False]) -def test_dhcp_server_table_cfg_change_checker(mock_swsscommon_dbconnector_init, tested_data, tested_db_snapshot, - enabled): +def test_dhcp_server_table_cfg_change_checker(mock_swsscommon_dbconnector_init, tested_data, tested_db_snapshot): with patch.object(ConfigDbEventChecker, "enable"), \ patch.object(ConfigDbEventChecker, "subscriber_state_table", return_value=MockSubscribeTable(tested_data["table"]), new_callable=PropertyMock), \ - patch.object(ConfigDbEventChecker, "enabled", return_value=enabled, new_callable=PropertyMock), \ patch.object(sys, "exit"): sel = swsscommon.Select() db_event_checker = DhcpServerTableCfgChangeEventChecker(sel, MagicMock()) @@ -232,15 +229,12 @@ def test_dhcp_server_table_cfg_change_checker(mock_swsscommon_dbconnector_init, assert expected_res == check_res -@pytest.mark.parametrize("tested_db_snapshot", [{"enabled_dhcp_interfaces": "Vlan1000"}, {}]) +@pytest.mark.parametrize("tested_db_snapshot", [{"enabled_dhcp_interfaces": {"Vlan1000"}}, {}]) @pytest.mark.parametrize("tested_data", get_subscribe_table_tested_data("test_dhcp_server_update")) -@pytest.mark.parametrize("enabled", [True, False]) -def test_dhcp_server_table_enablement_change_checker(mock_swsscommon_dbconnector_init, tested_data, tested_db_snapshot, - enabled): +def test_dhcp_server_table_enablement_change_checker(mock_swsscommon_dbconnector_init, tested_data, tested_db_snapshot): with patch.object(ConfigDbEventChecker, "enable"), \ patch.object(ConfigDbEventChecker, "subscriber_state_table", return_value=MockSubscribeTable(tested_data["table"]), new_callable=PropertyMock), \ - patch.object(ConfigDbEventChecker, "enabled", return_value=enabled, new_callable=PropertyMock), \ patch.object(sys, "exit"): sel = swsscommon.Select() db_event_checker = DhcpServerTableIntfEnablementEventChecker(sel, MagicMock()) @@ -253,14 +247,12 @@ def test_dhcp_server_table_enablement_change_checker(mock_swsscommon_dbconnector assert expected_res == check_res -@pytest.mark.parametrize("tested_db_snapshot", [{"enabled_dhcp_interfaces": "Vlan1000"}, {}]) +@pytest.mark.parametrize("tested_db_snapshot", [{"enabled_dhcp_interfaces": {"Vlan1000"}}, {}]) @pytest.mark.parametrize("tested_data", get_subscribe_table_tested_data("test_port_update")) -@pytest.mark.parametrize("enabled", [True, False]) -def test_dhcp_port_table_checker(mock_swsscommon_dbconnector_init, tested_data, tested_db_snapshot, enabled): +def test_dhcp_port_table_checker(mock_swsscommon_dbconnector_init, tested_data, tested_db_snapshot): with patch.object(ConfigDbEventChecker, "enable"), \ patch.object(ConfigDbEventChecker, "subscriber_state_table", return_value=MockSubscribeTable(tested_data["table"]), new_callable=PropertyMock), \ - patch.object(ConfigDbEventChecker, "enabled", return_value=enabled, new_callable=PropertyMock), \ patch.object(sys, "exit"): sel = swsscommon.Select() db_event_checker = DhcpPortTableEventChecker(sel, MagicMock()) @@ -272,14 +264,12 @@ def test_dhcp_port_table_checker(mock_swsscommon_dbconnector_init, tested_data, assert expected_res == check_res -@pytest.mark.parametrize("tested_db_snapshot", [{"used_range": "range1"}, {}]) +@pytest.mark.parametrize("tested_db_snapshot", [{"used_range": {"range1"}}, {}]) @pytest.mark.parametrize("tested_data", get_subscribe_table_tested_data("test_range_update")) -@pytest.mark.parametrize("enabled", [True, False]) -def test_dhcp_range_table_checker(mock_swsscommon_dbconnector_init, tested_data, tested_db_snapshot, enabled): +def test_dhcp_range_table_checker(mock_swsscommon_dbconnector_init, tested_data, tested_db_snapshot): with patch.object(ConfigDbEventChecker, "enable"), \ patch.object(ConfigDbEventChecker, "subscriber_state_table", return_value=MockSubscribeTable(tested_data["table"]), new_callable=PropertyMock), \ - patch.object(ConfigDbEventChecker, "enabled", return_value=enabled, new_callable=PropertyMock), \ patch.object(sys, "exit"): sel = swsscommon.Select() db_event_checker = DhcpRangeTableEventChecker(sel, MagicMock()) @@ -291,14 +281,12 @@ def test_dhcp_range_table_checker(mock_swsscommon_dbconnector_init, tested_data, assert expected_res == check_res -@pytest.mark.parametrize("tested_db_snapshot", [{"used_options": "option223"}, {}]) +@pytest.mark.parametrize("tested_db_snapshot", [{"used_options": {"option223"}}, {}]) @pytest.mark.parametrize("tested_data", get_subscribe_table_tested_data("test_option_update")) -@pytest.mark.parametrize("enabled", [True, False]) -def test_dhcp_option_table_checker(mock_swsscommon_dbconnector_init, tested_data, tested_db_snapshot, enabled): +def test_dhcp_option_table_checker(mock_swsscommon_dbconnector_init, tested_data, tested_db_snapshot): with patch.object(ConfigDbEventChecker, "enable"), \ patch.object(ConfigDbEventChecker, "subscriber_state_table", return_value=MockSubscribeTable(tested_data["table"]), new_callable=PropertyMock), \ - patch.object(ConfigDbEventChecker, "enabled", return_value=enabled, new_callable=PropertyMock), \ patch.object(sys, "exit"): sel = swsscommon.Select() db_event_checker = DhcpOptionTableEventChecker(sel, MagicMock()) @@ -310,14 +298,12 @@ def test_dhcp_option_table_checker(mock_swsscommon_dbconnector_init, tested_data assert expected_res == check_res -@pytest.mark.parametrize("tested_db_snapshot", [{"enabled_dhcp_interfaces": "Vlan1000"}, {}]) +@pytest.mark.parametrize("tested_db_snapshot", [{"enabled_dhcp_interfaces": {"Vlan1000"}}, {}]) @pytest.mark.parametrize("tested_data", get_subscribe_table_tested_data("test_vlan_update")) -@pytest.mark.parametrize("enabled", [True, False]) -def test_vlan_table_checker(mock_swsscommon_dbconnector_init, tested_data, tested_db_snapshot, enabled): +def test_vlan_table_checker(mock_swsscommon_dbconnector_init, tested_data, tested_db_snapshot): with patch.object(ConfigDbEventChecker, "enable"), \ patch.object(ConfigDbEventChecker, "subscriber_state_table", return_value=MockSubscribeTable(tested_data["table"]), new_callable=PropertyMock), \ - patch.object(ConfigDbEventChecker, "enabled", return_value=enabled, new_callable=PropertyMock), \ patch.object(sys, "exit"): sel = swsscommon.Select() db_event_checker = VlanTableEventChecker(sel, MagicMock()) @@ -329,14 +315,12 @@ def test_vlan_table_checker(mock_swsscommon_dbconnector_init, tested_data, teste assert expected_res == check_res -@pytest.mark.parametrize("tested_db_snapshot", [{"enabled_dhcp_interfaces": "Vlan1000"}, {}]) +@pytest.mark.parametrize("tested_db_snapshot", [{"enabled_dhcp_interfaces": {"Vlan1000"}}, {}]) @pytest.mark.parametrize("tested_data", get_subscribe_table_tested_data("test_vlan_intf_update")) -@pytest.mark.parametrize("enabled", [True, False]) -def test_vlan_intf_table_checker(mock_swsscommon_dbconnector_init, tested_data, tested_db_snapshot, enabled): +def test_vlan_intf_table_checker(mock_swsscommon_dbconnector_init, tested_data, tested_db_snapshot): with patch.object(ConfigDbEventChecker, "enable"), \ patch.object(ConfigDbEventChecker, "subscriber_state_table", return_value=MockSubscribeTable(tested_data["table"]), new_callable=PropertyMock), \ - patch.object(ConfigDbEventChecker, "enabled", return_value=enabled, new_callable=PropertyMock), \ patch.object(sys, "exit"): sel = swsscommon.Select() db_event_checker = VlanIntfTableEventChecker(sel, MagicMock()) @@ -348,14 +332,12 @@ def test_vlan_intf_table_checker(mock_swsscommon_dbconnector_init, tested_data, assert expected_res == check_res -@pytest.mark.parametrize("tested_db_snapshot", [{"enabled_dhcp_interfaces": "Vlan1000"}, {}]) +@pytest.mark.parametrize("tested_db_snapshot", [{"enabled_dhcp_interfaces": {"Vlan1000"}}, {}]) @pytest.mark.parametrize("tested_data", get_subscribe_table_tested_data("test_vlan_member_update")) -@pytest.mark.parametrize("enabled", [True, False]) -def test_vlan_member_table_checker(mock_swsscommon_dbconnector_init, tested_data, tested_db_snapshot, enabled): +def test_vlan_member_table_checker(mock_swsscommon_dbconnector_init, tested_data, tested_db_snapshot): with patch.object(ConfigDbEventChecker, "enable"), \ patch.object(ConfigDbEventChecker, "subscriber_state_table", return_value=MockSubscribeTable(tested_data["table"]), new_callable=PropertyMock), \ - patch.object(ConfigDbEventChecker, "enabled", return_value=enabled, new_callable=PropertyMock), \ patch.object(sys, "exit"): sel = swsscommon.Select() db_event_checker = VlanMemberTableEventChecker(sel, MagicMock()) @@ -370,12 +352,10 @@ def test_vlan_member_table_checker(mock_swsscommon_dbconnector_init, tested_data @pytest.mark.parametrize("tested_db_snapshot", [{"dhcp_server_feature_enabled": True}, {"dhcp_server_feature_enabled": False}, {}]) @pytest.mark.parametrize("tested_data", get_subscribe_table_tested_data("test_feature_update")) -@pytest.mark.parametrize("enabled", [True, False]) -def test_feature_table_checker(mock_swsscommon_dbconnector_init, tested_data, tested_db_snapshot, enabled): +def test_feature_table_checker(mock_swsscommon_dbconnector_init, tested_data, tested_db_snapshot): with patch.object(ConfigDbEventChecker, "enable"), \ patch.object(ConfigDbEventChecker, "subscriber_state_table", return_value=MockSubscribeTable(tested_data["table"]), new_callable=PropertyMock), \ - patch.object(ConfigDbEventChecker, "enabled", return_value=enabled, new_callable=PropertyMock), \ patch.object(sys, "exit"): sel = swsscommon.Select() db_event_checker = DhcpServerFeatureStateChecker(sel, MagicMock()) diff --git a/src/sonic-dhcp-utilities/tests/test_utils.py b/src/sonic-dhcp-utilities/tests/test_utils.py index 8eb018a3c0e0..8017d23cb73b 100644 --- a/src/sonic-dhcp-utilities/tests/test_utils.py +++ b/src/sonic-dhcp-utilities/tests/test_utils.py @@ -142,5 +142,13 @@ def test_validate_ttr_type(test_data): def test_get_target_process_cmds(): - with patch.object(psutil, "process_iter", return_value=[MockProc("dhcrelay", 1), MockProc("dhcpmon", 2)], new_callable=PropertyMock): - res = utils.get_target_process_cmds("dhcrelay") \ No newline at end of file + with patch.object(psutil, "process_iter", return_value=[MockProc("dhcrelay", 1), MockProc("dhcpmon", 2)], + new_callable=PropertyMock): + res = utils.get_target_process_cmds("dhcrelay") + expected_res = [ + [ + "/usr/sbin/dhcrelay", "-d", "-m", "discard", "-a", "%h:%p", "%P", "--name-alias-map-file", + "/tmp/port-name-alias-map.txt", "-id", "Vlan1000", "-iu", "docker0", "240.127.1.2" + ] + ] + assert res == expected_res From 48885b6ac9598278dbcd6f1cb401c27de1b6d5a6 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 3 Jan 2024 17:36:12 +0800 Subject: [PATCH 046/419] [image_config]: Update DHCP rate-limit for mgmt TOR devices (#17630) (#17655) --- files/image_config/copp/copp_cfg.j2 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/files/image_config/copp/copp_cfg.j2 b/files/image_config/copp/copp_cfg.j2 index f3550677d760..dcae06fc0bbc 100755 --- a/files/image_config/copp/copp_cfg.j2 +++ b/files/image_config/copp/copp_cfg.j2 @@ -34,8 +34,13 @@ "queue": "4", "meter_type":"packets", "mode":"sr_tcm", +{% if DEVICE_METADATA is defined and DEVICE_METADATA['localhost'] is defined and DEVICE_METADATA['localhost']['type'] is defined and 'Mgmt' in DEVICE_METADATA['localhost']['type'] %} + "cir":"300", + "cbs":"300", +{% else %} "cir":"100", "cbs":"100", +{% endif %} "red_action":"drop" }, "queue1_group1": { From 6d43d2f63640098ef265903b37481b20743b6ece Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Wed, 6 Dec 2023 02:27:29 +0800 Subject: [PATCH 047/419] [Mellanox] Provide default implementation for sfp error description when CMIS host management is enabled (#17294) - Why I did it Provide a dummy implementation for SFP error description when CMIS host management is enabled. A future feature shall be raised to implement SFP error description for such mode. - How I did it if SFP is under software control, provide "Not supported" as error description if SFP is under initialization, provide "Initializing" as error description - How to verify it unit test --- .../sonic_platform/device_data.py | 9 +++++ .../mlnx-platform-api/sonic_platform/sfp.py | 22 +++++++++++ .../mlnx-platform-api/sonic_platform/utils.py | 35 ++++++++++++++--- .../tests/test_device_data.py | 9 +++++ .../mlnx-platform-api/tests/test_sfp.py | 38 ++++++++++++++++++- .../mlnx-platform-api/tests/test_utils.py | 3 ++ 6 files changed, 109 insertions(+), 7 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 3e5aa4fe4e9b..f2fa580b5b03 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py @@ -234,3 +234,12 @@ def get_cpld_component_list(cls): # Currently, only fetching BIOS version is supported return ComponentCPLDSN2201.get_component_list() return ComponentCPLD.get_component_list() + + @classmethod + @utils.read_only_cache() + def is_independent_mode(cls): + from sonic_py_common import device_info + _, hwsku_dir = device_info.get_paths_to_platform_and_hwsku_dirs() + sai_profile_file = os.path.join(hwsku_dir, 'sai.profile') + data = utils.read_key_value_file(sai_profile_file, delimeter='=') + return data.get('SAI_INDEPENDENT_MODULE_MODE') == '1' diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index a4dd7a8fc842..4b5c9bf4e924 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -139,6 +139,7 @@ SFP_SYSFS_STATUS_ERROR = 'statuserror' SFP_SYSFS_PRESENT = 'present' SFP_SYSFS_RESET = 'reset' +SFP_SYSFS_HWRESET = 'hw_reset' SFP_SYSFS_POWER_MODE = 'power_mode' SFP_SYSFS_POWER_MODE_POLICY = 'power_mode_policy' POWER_MODE_POLICY_HIGH = 1 @@ -638,6 +639,12 @@ def get_error_description(self): Returns: The error description """ + try: + if self.is_sw_control(): + return 'Not supported' + except: + return self.SFP_STATUS_INITIALIZING + oper_status, error_code = self._get_module_info(self.sdk_index) if oper_status == SX_PORT_MODULE_STATUS_INITIALIZING: error_description = self.SFP_STATUS_INITIALIZING @@ -792,6 +799,21 @@ def get_xcvr_api(self): self._xcvr_api.get_tx_fault = self.get_tx_fault return self._xcvr_api + def is_sw_control(self): + if not DeviceDataManager.is_independent_mode(): + return False + + db = utils.DbUtils.get_db_instance('STATE_DB') + control_type = db.get('STATE_DB', f'TRANSCEIVER_MODULES_MGMT|{self.sdk_index}', 'control_type') + control_file_value = utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/control') + + if control_type == 'SW_CONTROL' and control_file_value == 1: + return True + elif control_type == 'FW_CONTROL' and control_file_value == 0: + return False + else: + raise Exception(f'Module {self.sdk_index} is in initialization, please retry later') + class RJ45Port(NvidiaSFPCommon): """class derived from SFP, representing RJ45 ports""" diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/utils.py b/platform/mellanox/mlnx-platform-api/sonic_platform/utils.py index 83063b5c368e..51e9bc7f0318 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/utils.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/utils.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2020-2021 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,6 +19,7 @@ import subprocess import json import sys +import threading import time import os from sonic_py_common import device_info @@ -100,15 +101,15 @@ def read_float_from_file(file_path, default=0.0, raise_exception=False, log_func return read_from_file(file_path=file_path, target_type=float, default=default, raise_exception=raise_exception, log_func=log_func) -def _key_value_converter(content): +def _key_value_converter(content, delimeter): ret = {} for line in content.splitlines(): - k,v = line.split(':') + k,v = line.split(delimeter) ret[k.strip()] = v.strip() return ret -def read_key_value_file(file_path, default={}, raise_exception=False, log_func=logger.log_error): +def read_key_value_file(file_path, default={}, raise_exception=False, log_func=logger.log_error, delimeter=':'): """Read file content and parse the content to a dict. The file content should like: key1:value1 key2:value2 @@ -119,7 +120,8 @@ def read_key_value_file(file_path, default={}, raise_exception=False, log_func=l raise_exception (bool, optional): If exception should be raised or hiden. Defaults to False. log_func (optional): logger function.. Defaults to logger.log_error. """ - return read_from_file(file_path=file_path, target_type=_key_value_converter, default=default, raise_exception=raise_exception, log_func=log_func) + converter = lambda content: _key_value_converter(content, delimeter) + return read_from_file(file_path=file_path, target_type=converter, default=default, raise_exception=raise_exception, log_func=log_func) def write_file(file_path, content, raise_exception=False, log_func=logger.log_error): @@ -285,3 +287,26 @@ def wait_until(predict, timeout, interval=1, *args, **kwargs): time.sleep(interval) timeout -= interval return False + + +class DbUtils: + lock = threading.Lock() + db_instances = threading.local() + + @classmethod + def get_db_instance(cls, db_name, **kargs): + try: + if not hasattr(cls.db_instances, 'data'): + with cls.lock: + if not hasattr(cls.db_instances, 'data'): + cls.db_instances.data = {} + + if db_name not in cls.db_instances.data: + from swsscommon.swsscommon import SonicV2Connector + db = SonicV2Connector(use_unix_socket_path=True) + db.connect(db_name) + cls.db_instances.data[db_name] = db + return cls.db_instances.data[db_name] + except Exception as e: + logger.log_error(f'Failed to get DB instance for DB {db_name} - {e}') + raise e diff --git a/platform/mellanox/mlnx-platform-api/tests/test_device_data.py b/platform/mellanox/mlnx-platform-api/tests/test_device_data.py index d99591d513c8..866f01c3e7e3 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_device_data.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_device_data.py @@ -52,5 +52,14 @@ def test_get_linecard_max_port_count(self): def test_get_bios_component(self): assert DeviceDataManager.get_bios_component() is not None + @mock.patch('sonic_py_common.device_info.get_paths_to_platform_and_hwsku_dirs', mock.MagicMock(return_value=('', '/tmp'))) + @mock.patch('sonic_platform.device_data.utils.read_key_value_file') + def test_is_independent_mode(self, mock_read): + mock_read.return_value = {} + assert not DeviceDataManager.is_independent_mode() + mock_read.return_value = {'SAI_INDEPENDENT_MODULE_MODE': '1'} + assert DeviceDataManager.is_independent_mode() + + diff --git a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py index b9edc6838998..d0805a0d6250 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py @@ -54,17 +54,18 @@ def test_sfp_index(self, mock_max_port): assert sfp.sdk_index == 1 assert sfp.index == 5 + @mock.patch('sonic_platform.sfp.SFP.is_sw_control') @mock.patch('sonic_platform.sfp.SFP.read_eeprom', mock.MagicMock(return_value=None)) @mock.patch('sonic_platform.sfp.SFP.shared_sdk_handle', mock.MagicMock(return_value=2)) @mock.patch('sonic_platform.sfp.SFP._get_module_info') @mock.patch('sonic_platform.chassis.Chassis.get_num_sfps', mock.MagicMock(return_value=2)) @mock.patch('sonic_platform.chassis.extract_RJ45_ports_index', mock.MagicMock(return_value=[])) - def test_sfp_get_error_status(self, mock_get_error_code): + def test_sfp_get_error_status(self, mock_get_error_code, mock_control): chassis = Chassis() # Fetch an SFP module to test sfp = chassis.get_sfp(1) - + mock_control.return_value = False description_dict = sfp._get_error_description_dict() for error in description_dict.keys(): mock_get_error_code.return_value = (SX_PORT_MODULE_STATUS_PLUGGED_WITH_ERROR, error) @@ -88,6 +89,14 @@ def test_sfp_get_error_status(self, mock_get_error_code): assert description == expected_description + mock_control.return_value = True + description = sfp.get_error_description() + assert description == 'Not supported' + + mock_control.side_effect = RuntimeError('') + description = sfp.get_error_description() + assert description == 'Initializing' + @mock.patch('sonic_platform.sfp.SFP._get_page_and_page_offset') @mock.patch('sonic_platform.sfp.SFP._is_write_protected') def test_sfp_write_eeprom(self, mock_limited_eeprom, mock_get_page): @@ -278,6 +287,31 @@ def test_rj45_basic(self): assert sfp.get_transceiver_threshold_info() sfp.reinit() + @mock.patch('sonic_platform.utils.read_int_from_file') + @mock.patch('sonic_platform.device_data.DeviceDataManager.is_independent_mode') + @mock.patch('sonic_platform.utils.DbUtils.get_db_instance') + def test_is_sw_control(self, mock_get_db, mock_mode, mock_read): + sfp = SFP(0) + mock_mode.return_value = False + assert not sfp.is_sw_control() + mock_mode.return_value = True + + mock_db = mock.MagicMock() + mock_get_db.return_value = mock_db + mock_db.get = mock.MagicMock(return_value=None) + with pytest.raises(Exception): + sfp.is_sw_control() + + mock_read.return_value = 0 + mock_db.get.return_value = 'FW_CONTROL' + assert not sfp.is_sw_control() + mock_read.return_value = 1 + mock_db.get.return_value = 'SW_CONTROL' + assert sfp.is_sw_control() + mock_read.return_value = 0 + with pytest.raises(Exception): + sfp.is_sw_control() + @mock.patch('sonic_platform.utils.is_host', mock.MagicMock(side_effect = [True, True, False, False])) @mock.patch('subprocess.check_output', mock.MagicMock(side_effect = ['True', 'False'])) @mock.patch('sonic_platform.sfp.SFP._get_lpmode', mock.MagicMock(side_effect = [True, False])) diff --git a/platform/mellanox/mlnx-platform-api/tests/test_utils.py b/platform/mellanox/mlnx-platform-api/tests/test_utils.py index ad474433bfe8..04b00f82f4f9 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_utils.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_utils.py @@ -191,3 +191,6 @@ def test_read_key_value_file(self): mock_os_open = mock.mock_open(read_data='a:b') with mock.patch('sonic_platform.utils.open', mock_os_open): assert utils.read_key_value_file('some_file') == {'a':'b'} + mock_os_open = mock.mock_open(read_data='a=b') + with mock.patch('sonic_platform.utils.open', mock_os_open): + assert utils.read_key_value_file('some_file', delimeter='=') == {'a':'b'} From c5473c1d8b0f6ea421ed9b14fadd9a1f4599dc60 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 4 Jan 2024 10:45:26 +0800 Subject: [PATCH 048/419] Update backend_acl.py to specify ACL table name (#17553) (#17668) --- files/image_config/backend_acl/backend_acl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/image_config/backend_acl/backend_acl.py b/files/image_config/backend_acl/backend_acl.py index bb22a60880ab..113e1d1ac118 100755 --- a/files/image_config/backend_acl/backend_acl.py +++ b/files/image_config/backend_acl/backend_acl.py @@ -78,7 +78,7 @@ def load_backend_acl(device_type): 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]) + run_command(['acl-loader', 'update', 'full', BACKEND_ACL_FILE, '--table_name', 'DATAACL']) else: log_info("Skipping backend acl load - conditions not met") From ac4f6fcbc2f62d977b6976cea80253f0972d3ab8 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 5 Jan 2024 04:39:16 +0800 Subject: [PATCH 049/419] [docker_image_ctl.j2]: swss docker initialization improvements (#17628) (#17680) --- files/build_templates/docker_image_ctl.j2 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/files/build_templates/docker_image_ctl.j2 b/files/build_templates/docker_image_ctl.j2 index 3397f7a88bc4..2b0a752c86ba 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -294,6 +294,12 @@ function postStartAction() fi chgrp -f redis $REDIS_SOCK && chmod -f 0760 $REDIS_SOCK {%- elif docker_container_name == "swss" %} + # Wait until swss container state is Running + until [[ ($(docker inspect -f {{"'{{.State.Running}}'"}} swss$DEV) == "true") ]]; do + sleep 0.1 + done + echo "swss container is up and running" + docker exec swss$DEV rm -f /ready # remove cruft if [[ "$BOOT_TYPE" == "fast" ]] && [[ -d /host/fast-reboot ]]; then test -e /host/fast-reboot/fdb.json && docker cp /host/fast-reboot/fdb.json swss$DEV:/ @@ -303,6 +309,9 @@ function postStartAction() rm -fr /host/fast-reboot fi docker exec swss$DEV touch /ready # signal swssconfig.sh to go + # Re-confirm that file is indeed created and log an error if not + docker exec swss$DEV test -f /ready && echo "File swss:/ready created" || echo "Error: File swss:/ready doesn't exist" + {%- elif docker_container_name == "pmon" %} DEVPATH="/usr/share/sonic/device" From aafbf5bdc69438799acb8d33834026d308c89447 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 5 Jan 2024 06:22:58 +0800 Subject: [PATCH 050/419] Update Dockerfile.j2 (#17663) (#17682) --- dockers/docker-sonic-mgmt/Dockerfile.j2 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dockers/docker-sonic-mgmt/Dockerfile.j2 b/dockers/docker-sonic-mgmt/Dockerfile.j2 index 5e634f0b983f..be644bdd61d8 100755 --- a/dockers/docker-sonic-mgmt/Dockerfile.j2 +++ b/dockers/docker-sonic-mgmt/Dockerfile.j2 @@ -101,7 +101,9 @@ RUN python3 -m pip install aiohttp \ scapy==2.4.5 \ setuptools-rust \ six \ - snappi[ixnetwork,convergence]==0.9.1 \ + snappi==0.9.1 \ + snappi-convergence==0.4.1 \ + snappi-ixnetwork==0.9.1 \ tabulate \ textfsm==1.1.2 \ thrift==0.11.0 \ @@ -182,7 +184,9 @@ RUN python2 -m pip install allure-pytest==2.8.22 \ scandir \ scapy==2.4.5 \ six \ - snappi[ixnetwork,convergence]==0.9.1 \ + snappi==0.9.1 \ + snappi-convergence==0.4.1 \ + snappi-ixnetwork==0.9.1 \ statistics \ tabulate \ textfsm==1.1.3 \ @@ -333,7 +337,9 @@ RUN python3 -m pip install aiohttp \ scapy==2.4.5 \ setuptools-rust \ six \ - snappi[ixnetwork,convergence]==0.9.1 \ + snappi==0.9.1 \ + snappi-convergence==0.4.1 \ + snappi-ixnetwork==0.9.1 \ sshconf==0.2.5 \ tabulate \ textfsm==1.1.2 \ From 7368df783932c86e43829bdcc88c18964ea9c249 Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Sat, 6 Jan 2024 04:07:30 +0800 Subject: [PATCH 051/419] [Mellanox] Enable CMIS host management (#16846) (#17684) - Why I did it Enable CMIS host management for Mellanox devices which are expected to support the feature - How I did it new thread in a new file and changing logic in platform code in chassis.py which is calling this thread from get_change_event() this thread in the new file handles the state machine per port. first the static detection takes place once the thread is up (during switch bootup sequence), until final decision if it's FW control or SW control module. After it ends, the dynamic detection takes place, listening to changes in the sysfs fds, per port, so it will be able to detect plug in or out events of a cable. - How to verify it Enhanced unit tests run sonic mgmt on Nvidia SN4700 with CMIS host management enabled Co-authored-by: dbarashinvd <105214075+dbarashinvd@users.noreply.github.com> --- .../sonic_platform/chassis.py | 59 +- .../sonic_platform/device_data.py | 3 +- .../sonic_platform/modules_mgmt.py | 743 ++++++++++++++++++ .../mlnx-platform-api/tests/test_chassis.py | 15 +- 4 files changed, 783 insertions(+), 37 deletions(-) create mode 100644 platform/mellanox/mlnx-platform-api/sonic_platform/modules_mgmt.py diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py b/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py index 105fc48d8499..6efdfb61f4e3 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py @@ -31,7 +31,10 @@ from . import utils from .device_data import DeviceDataManager import re + import queue + import threading import time + from sonic_platform import modules_mgmt except ImportError as e: raise ImportError (str(e) + "- required module not found") @@ -124,6 +127,10 @@ def __init__(self): self._RJ45_port_inited = False self._RJ45_port_list = None + self.modules_mgmt_thread = threading.Thread() + self.modules_changes_queue = queue.Queue() + self.modules_mgmt_task_stopping_event = threading.Event() + logger.log_info("Chassis loaded successfully") def __del__(self): @@ -371,7 +378,7 @@ def get_change_event(self, timeout=0): Returns: (bool, dict): - - True if call successful, False if not; + - True if call successful, False if not; - Deprecated, will always return True - A nested dictionary where key is a device type, value is a dictionary with key:value pairs in the format of {'device_id':'device_event'}, @@ -383,38 +390,42 @@ def get_change_event(self, timeout=0): indicates that fan 0 has been removed, fan 2 has been inserted and sfp 11 has been removed. """ + if not self.modules_mgmt_thread.is_alive(): + # open new SFP change events thread + self.modules_mgmt_thread = modules_mgmt.ModulesMgmtTask(q=self.modules_changes_queue + , main_thread_stop_event = self.modules_mgmt_task_stopping_event) + # Set the thread as daemon so when pmon/xcvrd are shutting down, modules_mgmt will shut down immedietly. + self.modules_mgmt_thread.daemon = True + self.modules_mgmt_thread.start() self.initialize_sfp() - # Initialize SFP event first - if not self.sfp_event: - from .sfp_event import sfp_event - self.sfp_event = sfp_event(self.RJ45_port_list) - self.sfp_event.initialize() - wait_for_ever = (timeout == 0) - # select timeout should be no more than 1000ms to ensure fast shutdown flow - select_timeout = 1000.0 if timeout >= 1000 else float(timeout) + # poll timeout should be no more than 1000ms to ensure fast shutdown flow + timeout = 1000.0 if timeout >= 1000 else float(timeout) port_dict = {} error_dict = {} begin = time.time() + i = 0 while True: - status = self.sfp_event.check_sfp_status(port_dict, error_dict, select_timeout) - if bool(port_dict): - break - - if not wait_for_ever: - elapse = time.time() - begin - if elapse * 1000 > timeout: - break + try: + logger.log_info(f'get_change_event() trying to get changes from queue on iteration {i}') + port_dict = self.modules_changes_queue.get(timeout=timeout / 1000) + logger.log_info(f'get_change_event() iteration {i} port_dict: {port_dict}') + except queue.Empty: + logger.log_info(f"failed to get item from modules changes queue on itertaion {i}") - if status: if port_dict: self.reinit_sfps(port_dict) - result_dict = {'sfp': port_dict} - if error_dict: + result_dict = {'sfp': port_dict} result_dict['sfp_error'] = error_dict - return True, result_dict - else: - return True, {'sfp': {}} + return True, result_dict + else: + if not wait_for_ever: + elapse = time.time() - begin + logger.log_info(f"get_change_event: wait_for_ever {wait_for_ever} elapse {elapse} iteartion {i}") + if elapse * 1000 >= timeout: + logger.log_info(f"elapse {elapse} > timeout {timeout} iteartion {i} returning empty dict") + return True, {'sfp': {}} + i += 1 def reinit_sfps(self, port_dict): """ @@ -426,7 +437,7 @@ def reinit_sfps(self, port_dict): for index, status in port_dict.items(): if status == sfp.SFP_STATUS_INSERTED: try: - self._sfp_list[index - 1].reinit() + self._sfp_list[int(index) - 1].reinit() except Exception as e: logger.log_error("Fail to re-initialize SFP {} - {}".format(index, repr(e))) 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 f2fa580b5b03..6bf0a9945a85 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py @@ -167,7 +167,8 @@ def is_psu_hotswapable(cls): @classmethod @utils.read_only_cache() def get_sfp_count(cls): - return utils.read_int_from_file('/run/hw-management/config/sfp_counter') + sfp_count = utils.read_int_from_file('/run/hw-management/config/sfp_counter') + return sfp_count if sfp_count > 0 else len(glob.glob('/sys/module/sx_core/asic0/module*')) @classmethod def get_linecard_sfp_count(cls, lc_index): diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/modules_mgmt.py b/platform/mellanox/mlnx-platform-api/sonic_platform/modules_mgmt.py new file mode 100644 index 000000000000..470b39acb3df --- /dev/null +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/modules_mgmt.py @@ -0,0 +1,743 @@ +# +# Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. +# Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +import threading +import time +import queue +import os +import select +import traceback + +try: + from sonic_py_common.logger import Logger + from sonic_py_common import device_info, multi_asic + from .device_data import DeviceDataManager + from sonic_platform_base.sonic_xcvr.fields import consts + from sonic_platform_base.sonic_xcvr.api.public import cmis + from . import sfp as sfp_module + from . import utils + from swsscommon.swsscommon import SonicV2Connector +except ImportError as e: + raise ImportError (str(e) + "- required module not found") + +# Global logger class instance +logger = Logger() + +STATE_HW_NOT_PRESENT = "Initial state. module is not plugged to cage." +STATE_HW_PRESENT = "Module is plugged to cage" +STATE_MODULE_AVAILABLE = "Module hw present and power is good" +STATE_POWERED = "Module power is already loaded" +STATE_NOT_POWERED = "Module power is not loaded" +STATE_FW_CONTROL = "The module is not CMIS and FW needs to handle" +STATE_SW_CONTROL = "The module is CMIS and SW needs to handle" +STATE_ERROR_HANDLER = "An error occurred - read/write error, power limit or power cap." +STATE_POWER_LIMIT_ERROR = "The cage has not enough power for the plugged module" +STATE_SYSFS_ERROR = "An error occurred while writing/reading SySFS." + +SAI_PROFILE_FILE = "/{}/sai.profile" +SAI_INDEP_MODULE_MODE = "SAI_INDEPENDENT_MODULE_MODE" +SAI_INDEP_MODULE_MODE_DELIMITER = "=" +SAI_INDEP_MODULE_MODE_TRUE_STR = "1" +SYSFS_LEGACY_FD_PRESENCE = "/sys/module/sx_core/asic0/module{}/present" +ASIC_NUM = 0 +SYSFS_INDEPENDENT_FD_PREFIX_WO_MODULE = "/sys/module/sx_core/asic{}".format(ASIC_NUM) +SYSFS_INDEPENDENT_FD_PREFIX = SYSFS_INDEPENDENT_FD_PREFIX_WO_MODULE + "/module{}" +SYSFS_INDEPENDENT_FD_PRESENCE = os.path.join(SYSFS_INDEPENDENT_FD_PREFIX, "hw_present") +SYSFS_INDEPENDENT_FD_POWER_GOOD = os.path.join(SYSFS_INDEPENDENT_FD_PREFIX, "power_good") +SYSFS_INDEPENDENT_FD_POWER_ON = os.path.join(SYSFS_INDEPENDENT_FD_PREFIX, "power_on") +SYSFS_INDEPENDENT_FD_HW_RESET = os.path.join(SYSFS_INDEPENDENT_FD_PREFIX, "hw_reset") +SYSFS_INDEPENDENT_FD_POWER_LIMIT = os.path.join(SYSFS_INDEPENDENT_FD_PREFIX, "power_limit") +SYSFS_INDEPENDENT_FD_FW_CONTROL = os.path.join(SYSFS_INDEPENDENT_FD_PREFIX, "control") +# echo /sys/module/sx_core/$asic/$module/frequency // val: 0 - up to 400KHz, 1 - up to 1MHz +SYSFS_INDEPENDENT_FD_FREQ = os.path.join(SYSFS_INDEPENDENT_FD_PREFIX, "frequency") +SYSFS_INDEPENDENT_FD_FREQ_SUPPORT = os.path.join(SYSFS_INDEPENDENT_FD_PREFIX, "frequency_support") +IS_INDEPENDENT_MODULE = 'is_independent_module' + +MAX_EEPROM_ERROR_RESET_RETRIES = 4 + +class ModulesMgmtTask(threading.Thread): + + def __init__(self, namespaces=None, main_thread_stop_event=None, q=None): + threading.Thread.__init__(self) + self.name = "ModulesMgmtTask" + self.main_thread_stop_event = main_thread_stop_event + self.sfp_port_dict_initial = {} + self.sfp_port_dict = {} + self.sfp_changes_dict = {} + self.sfp_delete_list_from_port_dict = [] + self.namespaces = namespaces + self.modules_changes_queue = q + self.is_supported_indep_mods_system = False + self.modules_lock_list = [] + # A set to hold those modules waiting 3 seconds since power on and hw reset + self.waiting_modules_list = set() + self.timer = threading.Thread() + self.poll_obj = None + self.fds_mapping_to_obj = {} + self.port_to_fds = {} + self.fds_events_count_dict = {} + self.delete_ports_and_reset_states_dict = {} + self.setName("ModulesMgmtTask") + self.register_hw_present_fds = [] + + # SFPs state machine + def get_sm_func(self, sm, port): + SFP_SM_ENUM = {STATE_HW_NOT_PRESENT: self.check_if_hw_present + , STATE_HW_PRESENT: self.check_if_module_available + , STATE_MODULE_AVAILABLE: self.check_if_power_on + , STATE_NOT_POWERED: self.power_on_module + , STATE_POWERED: self.check_module_type + , STATE_FW_CONTROL: self.save_module_control_mode + , STATE_SW_CONTROL: self.save_module_control_mode + , STATE_ERROR_HANDLER: STATE_ERROR_HANDLER + , STATE_POWER_LIMIT_ERROR: STATE_POWER_LIMIT_ERROR + , STATE_SYSFS_ERROR: STATE_SYSFS_ERROR + } + logger.log_info("getting func for state {} for port {}".format(sm, port)) + try: + func = SFP_SM_ENUM[sm] + logger.log_info("got func {} for state {} for port {}".format(func, sm, port)) + return func + except KeyError as e: + logger.log_error("exception {} for port {} sm {}".format(e, port, sm)) + return None + + def run(self): + # check first if the system supports independent mode and set boolean accordingly + (platform_path, hwsku_dir) = device_info.get_paths_to_platform_and_hwsku_dirs() + logger.log_info("hwsku_dir {} found, continue to check sai.profile file".format(hwsku_dir)) + independent_file = SAI_PROFILE_FILE.format(hwsku_dir) + if os.path.isfile(independent_file): + logger.log_info("file {} found, checking content for independent mode value".format(independent_file)) + with open(independent_file, "r") as independent_file_fd: + found = False + independent_file_content = ' ' + logger.log_info("file {} found, checking content for independent mode value".format(independent_file)) + while independent_file_content and not found: + independent_file_content = independent_file_fd.readline() + if SAI_INDEP_MODULE_MODE in independent_file_content and \ + SAI_INDEP_MODULE_MODE_DELIMITER in independent_file_content: + independent_file_splitted = independent_file_content.split(SAI_INDEP_MODULE_MODE_DELIMITER) + if (len(independent_file_splitted) > 1): + self.is_supported_indep_mods_system = int(independent_file_splitted[1]) == int(SAI_INDEP_MODULE_MODE_TRUE_STR) + logger.log_info("file {} found, system will work in independent mode".format(independent_file)) + logger.log_info("value of indep mode var: {} found in file".format(independent_file_splitted[1])) + found = True + else: + logger.log_info("file {} not found, system stays in legacy mode".format(independent_file)) + + # static init - at first go over all ports and check each one if it's independent module or legacy + self.sfp_changes_dict = {} + # check for each port if the module connected and if it supports independent mode or legacy + num_of_ports = DeviceDataManager.get_sfp_count() + # create the modules sysfs fds poller + self.poll_obj = select.poll() + for port in range(num_of_ports): + # check sysfs per port whether it's independent mode or legacy + temp_module_sm = ModuleStateMachine(port_num=port, initial_state=STATE_HW_NOT_PRESENT + , current_state=STATE_HW_NOT_PRESENT) + module_fd_indep_path = SYSFS_INDEPENDENT_FD_PRESENCE.format(port) + logger.log_info("system in indep mode: {} port {}".format(self.is_supported_indep_mods_system, port)) + if self.is_supported_indep_mods_system and os.path.isfile(module_fd_indep_path): + logger.log_info("system in indep mode: {} port {} reading file {}".format(self.is_supported_indep_mods_system, port, module_fd_indep_path)) + temp_module_sm.set_is_indep_modules(True) + temp_module_sm.set_module_fd_path(module_fd_indep_path) + module_fd = open(module_fd_indep_path, "r") + temp_module_sm.set_module_fd(module_fd) + else: + module_fd_legacy_path = self.get_sysfs_ethernet_port_fd(SYSFS_LEGACY_FD_PRESENCE, port) + temp_module_sm.set_module_fd_path(module_fd_legacy_path) + module_fd = open(module_fd_legacy_path, "r") + temp_module_sm.set_module_fd(module_fd) + # add lock to use with timer task updating next state per module object + self.modules_lock_list.append(threading.Lock()) + # start SM for this independent module + logger.log_info("adding temp_module_sm {} to sfp_port_dict".format(temp_module_sm)) + self.sfp_port_dict_initial[port] = temp_module_sm + self.sfp_port_dict[port] = temp_module_sm + + i = 0 + # need at least 1 module in final state until it makes sense to send changes dict + is_final_state_module = False + all_static_detection_done = False + logger.log_info(f"sfp_port_dict before starting static detection: {self.sfp_port_dict} main_thread_stop_event: " + f"{self.main_thread_stop_event.is_set()} all_static_detection_done: {all_static_detection_done}") + # static detection - loop on different state for all ports until all done + while not self.main_thread_stop_event.is_set() and not all_static_detection_done: + logger.log_info("static detection running iteration {}".format(i)) + waiting_list_len = len(self.waiting_modules_list) + sfp_port_dict_keys_len = len(self.sfp_port_dict.keys()) + if waiting_list_len == sfp_port_dict_keys_len: + logger.log_info("static detection length of waiting list {}: {} and sfp port dict keys {}:{} is the same, sleeping 1 second..." + .format(waiting_list_len, self.waiting_modules_list, sfp_port_dict_keys_len, self.sfp_port_dict.keys())) + time.sleep(1) + else: + logger.log_info("static detectionlength of waiting list {}: {} and sfp port dict keys {}: {} is different, NOT sleeping 1 second" + .format(waiting_list_len, self.waiting_modules_list, sfp_port_dict_keys_len, self.sfp_port_dict.keys())) + for port_num, module_sm_obj in self.sfp_port_dict.items(): + curr_state = module_sm_obj.get_current_state() + logger.log_info(f'static detection STATE_LOG {port_num}: curr_state is {curr_state}') + func = self.get_sm_func(curr_state, port_num) + logger.log_info("static detection got returned func {} for state {}".format(func, curr_state)) + try: + if not isinstance(func, str): + if func is not None: + next_state = func(port_num, module_sm_obj) + except TypeError as e: + logger.log_info("static detection exception {} for port {} traceback:\n{}".format(e, port_num, traceback.format_exc())) + module_sm_obj.set_final_state(STATE_ERROR_HANDLER) + continue + logger.log_info(f'static detection STATE_LOG {port_num}: next_state is {next_state}') + if self.timer.is_alive(): + logger.log_info("static detection timer threads is alive, acquiring lock") + self.modules_lock_list[port_num].acquire() + # for STATE_NOT_POWERED we dont advance to next state, timerTask is doing it into STATE_POWERED + if curr_state != STATE_NOT_POWERED or not module_sm_obj.wait_for_power_on: + module_sm_obj.set_next_state(next_state) + module_sm_obj.advance_state() + if module_sm_obj.get_final_state(): + logger.log_info(f'static detection STATE_LOG {port_num}: enter final state {module_sm_obj.get_final_state()}') + is_final_state_module = True + if self.timer.is_alive(): + self.modules_lock_list[port_num].release() + is_timer_alive = self.timer.is_alive() + logger.log_info("static detection timer thread is_alive {} port {}".format(is_timer_alive, port_num)) + if STATE_NOT_POWERED == curr_state: + if not is_timer_alive: + logger.log_info ("static detection curr_state is {} and timer thread is_alive {}, running timer task thread" + .format(curr_state, is_timer_alive)) + # call timer task + self.timer = threading.Timer(1.0, self.timerTask) + self.timer.start() + if self.timer.is_alive(): + logger.log_info("timer thread is_alive {}, locking module obj".format(self.timer.is_alive())) + self.modules_lock_list[port_num].acquire() + module_sm_obj.set_next_state(next_state) + if self.timer.is_alive(): + logger.log_info("timer thread is_alive {}, releasing module obj".format(self.timer.is_alive())) + self.modules_lock_list[port_num].release() + + if is_final_state_module: + self.map_ports_final_state() + self.delete_ports_from_dict() + self.send_changes_to_shared_queue() + self.register_presece_closed_ports(False, self.register_hw_present_fds) + i += 1 + self.register_hw_present_fds = [] + logger.log_info("sfp_port_dict: {}".format(self.sfp_port_dict)) + for port_num, module_sm_obj in self.sfp_port_dict.items(): + logger.log_info("static detection port_num: {} initial state: {} current_state: {} next_state: {}" + .format(port_num, module_sm_obj.initial_state, module_sm_obj.get_current_state() + , module_sm_obj.get_next_state())) + sfp_port_dict_keys_len = len(self.sfp_port_dict.keys()) + if sfp_port_dict_keys_len == 0: + logger.log_info("static detection len of keys of sfp_port_dict is 0: {}".format(sfp_port_dict_keys_len)) + all_static_detection_done = True + else: + logger.log_info("static detection len of keys of sfp_port_dict is not 0: {}".format(sfp_port_dict_keys_len)) + logger.log_info("static detection all_static_detection_done: {}".format(all_static_detection_done)) + + logger.log_info(f"sfp_port_dict before dynamic detection: {self.sfp_port_dict} " + f"main_thread_stop_event.is_set(): {self.main_thread_stop_event.is_set()}") + # dynamic detection - loop on polling changes, run state machine for them and put them into shared queue + i = 0 + # need at least 1 module in final state until it makes sense to send changes dict + is_final_state_module = False + # initialize fds events count to 0 + for fd_fileno in self.fds_mapping_to_obj: + module_obj = self.fds_mapping_to_obj[fd_fileno]['module_obj'] + # for debug purposes + self.fds_events_count_dict[module_obj.port_num] = { 'presence' : 0 , 'power_good' : 0 } + while not self.main_thread_stop_event.is_set(): + logger.log_info("dynamic detection running iteration {}".format(i)) + # poll for changes with 1 second timeout + fds_events = self.poll_obj.poll(1000) + logger.log_info("dynamic detection polled obj checking fds_events iteration {}".format(i)) + for fd, event in fds_events: + # get modules object from fd according to saved key-value of fd-module obj saved earlier + logger.log_info("dynamic detection working on fd {} event {}".format(fd, event)) + module_obj = self.fds_mapping_to_obj[fd]['module_obj'] + module_fd = self.fds_mapping_to_obj[fd]['fd'] + fd_name = self.fds_mapping_to_obj[fd]['fd_name'] + if 'presence' == fd_name: + module_fd_path = module_obj.module_fd_path + elif 'power_good' == fd_name: + module_fd_path = module_obj.module_power_good_fd_path + self.fds_events_count_dict[module_obj.port_num][fd_name] += 1 + try: + val = module_fd.read() + module_fd.seek(0) + logger.log_info("dynamic detection got module_obj {} with port {} from fd number {} path {} val {} count {}" + .format(module_obj, module_obj.port_num, fd, module_fd_path + , val, self.fds_events_count_dict[module_obj.port_num])) + # workaround for garbage received after the 0 or 1 value of sysfs i.e. 0#012 or 1#012 + if len(val) > 1: + val = val[0] + if self.is_dummy_event(int(val), module_obj): + logger.log_info(f"dynamic detection dummy event port {module_obj.port_num} from fd number {fd}") + continue + if module_obj.port_num not in self.sfp_port_dict.keys(): + logger.log_info("dynamic detection port {} not found in sfp_port_dict keys: {} adding it" + .format(module_obj.port_num, self.sfp_port_dict.keys())) + self.deregister_fd_from_polling(module_obj.port_num) + # put again module obj in sfp_port_dict so next loop will work on it + self.sfp_port_dict[module_obj.port_num] = module_obj + self.delete_ports_and_reset_states_dict[module_obj.port_num] = val + except Exception as e: + logger.log_error("dynamic detection exception on read presence {} for port {} fd name {} traceback:\n{}" + .format(e, module_obj.port_num, module_fd.name, traceback.format_exc())) + for port, val in self.delete_ports_and_reset_states_dict.items(): + logger.log_info(f"dynamic detection resetting all states for port {port} close_presence_ports {val}") + module_obj = self.sfp_port_dict[port] + module_obj.reset_all_states(close_presence_ports=val) + self.delete_ports_and_reset_states_dict = {} + for port_num, module_sm_obj in self.sfp_port_dict.items(): + curr_state = module_sm_obj.get_current_state() + logger.log_info(f'dynamic detection STATE_LOG {port_num}: curr_state is {curr_state}') + func = self.get_sm_func(curr_state, port) + logger.log_info("dynamic detection got returned func {} for state {}".format(func, curr_state)) + try: + if func is not None: + next_state = func(port_num, module_sm_obj, dynamic=True) + except TypeError as e: + logger.log_info("exception {} for port {}".format(e, port_num)) + continue + logger.log_info(f'dynamic detection STATE_LOG {port_num}: next_state is {next_state}') + if self.timer.is_alive(): + logger.log_info("dynamic detection timer threads is alive, acquiring lock") + self.modules_lock_list[port_num].acquire() + if curr_state != STATE_NOT_POWERED or not module_sm_obj.wait_for_power_on: + module_sm_obj.set_next_state(next_state) + module_sm_obj.advance_state() + if module_sm_obj.get_final_state(): + logger.log_info(f'dynamic detection STATE_LOG {port_num}: enter final state {module_sm_obj.get_final_state()}') + is_final_state_module = True + if self.timer.is_alive(): + self.modules_lock_list[port_num].release() + is_timer_alive = self.timer.is_alive() + logger.log_info("dynamic detection timer thread is_alive {} port {}".format(is_timer_alive, port_num)) + if STATE_NOT_POWERED == curr_state: + if not is_timer_alive: + logger.log_info("dynamic detection curr_state is {} and timer thread is_alive {}, running timer task thread" + .format(curr_state, is_timer_alive)) + # call timer task + self.timer = threading.Timer(1.0, self.timerTask) + self.timer.start() + if self.timer.is_alive(): + logger.log_info("dynamic detection timer thread is_alive {}, locking module obj".format(self.timer.is_alive())) + self.modules_lock_list[port_num].acquire() + module_sm_obj.set_next_state(next_state) + if self.timer.is_alive(): + logger.log_info( + "dynamic detection timer thread is_alive {}, releasing module obj".format(self.timer.is_alive())) + self.modules_lock_list[port_num].release() + + if is_final_state_module: + self.map_ports_final_state(dynamic=True) + self.delete_ports_from_dict(dynamic=True) + self.send_changes_to_shared_queue(dynamic=True) + self.register_presece_closed_ports(True, self.register_hw_present_fds) + if not self.sfp_port_dict and is_final_state_module: + is_final_state_module = False + logger.log_info(f"sft_port_dict is empty {self.sfp_port_dict}, set is_final_state_module to {is_final_state_module}") + self.register_hw_present_fds = [] + i += 1 + logger.log_info("sfp_port_dict: {}".format(self.sfp_port_dict)) + for port_num, module_sm_obj in self.sfp_port_dict.items(): + logger.log_info("port_num: {} module_sm_obj initial state: {} current_state: {} next_state: {}" + .format(port_num, module_sm_obj.initial_state, module_sm_obj.get_current_state(), module_sm_obj.get_next_state())) + + def is_dummy_event(self, val, module_sm_obj): + if val == 1: + return module_sm_obj.final_state in (STATE_HW_PRESENT, STATE_SW_CONTROL, STATE_FW_CONTROL) + elif val == 0: + return module_sm_obj.final_state in (STATE_HW_NOT_PRESENT,) + return False + + def check_if_hw_present(self, port, module_sm_obj, dynamic=False): + detection_method = 'dynamic' if dynamic else 'static' + logger.log_info(f"{detection_method} detection enter check_if_hw_present port {port} module_sm_obj {module_sm_obj}") + module_fd_indep_path = module_sm_obj.module_fd_path + if os.path.isfile(module_fd_indep_path): + try: + val_int = utils.read_int_from_file(module_fd_indep_path) + if 0 == val_int: + logger.log_info("returning {} for val {}".format(STATE_HW_NOT_PRESENT, val_int)) + retval_state = STATE_HW_NOT_PRESENT + module_sm_obj.set_final_state(retval_state, detection_method) + return retval_state + elif 1 == val_int: + logger.log_info("returning {} for val {}".format(STATE_HW_PRESENT, val_int)) + retval_state = STATE_HW_PRESENT + if not self.is_supported_indep_mods_system: + module_sm_obj.set_final_state(retval_state, detection_method) + self.register_fd_for_polling(module_sm_obj, module_sm_obj.module_fd, 'presence') + return retval_state + except Exception as e: + logger.log_info("exception {} for port {} setting final state STATE_ERROR_HANDLER".format(e, port)) + module_sm_obj.set_final_state(STATE_ERROR_HANDLER) + return STATE_ERROR_HANDLER + module_sm_obj.set_final_state(STATE_HW_NOT_PRESENT, detection_method) + return STATE_HW_NOT_PRESENT + + def check_if_module_available(self, port, module_sm_obj, dynamic=False): + logger.log_info("enter check_if_module_available port {} module_sm_obj {}".format(port, module_sm_obj)) + module_fd_indep_path = SYSFS_INDEPENDENT_FD_POWER_GOOD.format(port) + if os.path.isfile(module_fd_indep_path): + try: + # not using utils.read_int_from_file since need to catch the exception here if no such file or it is + # not accesible. utils.read_int_from_file will return 0 in such a case + module_power_good_fd = open(module_fd_indep_path, "r") + val = module_power_good_fd.read() + val_int = int(val) + module_sm_obj.module_power_good_fd_path = module_fd_indep_path + module_sm_obj.module_power_good_fd = module_power_good_fd + + if 0 == val_int: + logger.log_info(f'port {port} power is not good') + module_sm_obj.set_final_state(STATE_HW_NOT_PRESENT) + return STATE_HW_NOT_PRESENT + elif 1 == val_int: + logger.log_info(f'port {port} power is good') + return STATE_MODULE_AVAILABLE + except Exception as e: + logger.log_info("exception {} for port {}".format(e, port)) + return STATE_HW_NOT_PRESENT + logger.log_info(f'port {port} has no power good file {module_fd_indep_path}') + module_sm_obj.set_final_state(STATE_HW_NOT_PRESENT) + return STATE_HW_NOT_PRESENT + + def check_if_power_on(self, port, module_sm_obj, dynamic=False): + logger.log_info(f'enter check_if_power_on for port {port}') + module_fd_indep_path = SYSFS_INDEPENDENT_FD_POWER_ON.format(port) + if os.path.isfile(module_fd_indep_path): + try: + val_int = utils.read_int_from_file(module_fd_indep_path) + if 0 == val_int: + logger.log_info(f'check_if_power_on port {port} is not powered') + return STATE_NOT_POWERED + elif 1 == val_int: + logger.log_info(f'check_if_power_on port {port} is powered') + return STATE_POWERED + except Exception as e: + logger.log_info(f'check_if_power_on got exception {e}') + module_sm_obj.set_final_state(STATE_HW_NOT_PRESENT) + return STATE_HW_NOT_PRESENT + + def power_on_module(self, port, module_sm_obj, dynamic=False): + logger.log_info(f'enter power_on_module for port {port}') + if not module_sm_obj.wait_for_power_on: + module_fd_indep_path_po = SYSFS_INDEPENDENT_FD_POWER_ON.format(port) + module_fd_indep_path_r = SYSFS_INDEPENDENT_FD_HW_RESET.format(port) + try: + if os.path.isfile(module_fd_indep_path_po): + logger.log_info("powerOnModule powering on via {} for port {}".format(module_fd_indep_path_po, port)) + # echo 1 > /sys/module/sx_core/$asic/$module/power_on + utils.write_file(module_fd_indep_path_po, "1") + if os.path.isfile(module_fd_indep_path_r): + logger.log_info("powerOnModule resetting via {} for port {}".format(module_fd_indep_path_r, port)) + # echo 0 > /sys/module/sx_core/$asic/$module/hw_reset + utils.write_file(module_fd_indep_path_r, "0") + self.add_port_to_wait_reset(module_sm_obj) + except Exception as e: + logger.log_info("exception in powerOnModule {} for port {}".format(e, port)) + return STATE_HW_NOT_PRESENT + return STATE_NOT_POWERED + + def check_module_type(self, port, module_sm_obj, dynamic=False): + logger.log_info("enter check_module_type port {} module_sm_obj {}".format(port, module_sm_obj)) + sfp = sfp_module.SFP(port) + xcvr_api = sfp.get_xcvr_api() + if not xcvr_api: + logger.log_info("check_module_type calling sfp reinit for port {} module_sm_obj {}" + .format(port, module_sm_obj)) + sfp.reinit() + logger.log_info("check_module_type setting as FW control as xcvr_api is empty for port {} module_sm_obj {}" + .format(port, module_sm_obj)) + return STATE_FW_CONTROL + # QSFP-DD ID is 24, OSFP ID is 25 - only these 2 are supported currently as independent module - SW controlled + if not isinstance(xcvr_api, cmis.CmisApi): + logger.log_info("check_module_type setting STATE_FW_CONTROL for {} in check_module_type port {} module_sm_obj {}" + .format(xcvr_api, port, module_sm_obj)) + return STATE_FW_CONTROL + else: + if xcvr_api.is_flat_memory(): + logger.log_info("check_module_type port {} setting STATE_FW_CONTROL module ID {} due to flat_mem device" + .format(xcvr_api, port)) + return STATE_FW_CONTROL + logger.log_info("check_module_type checking power cap for {} in check_module_type port {} module_sm_obj {}" + .format(xcvr_api, port, module_sm_obj)) + power_cap = self.check_power_cap(port, module_sm_obj) + if power_cap is STATE_POWER_LIMIT_ERROR: + module_sm_obj.set_final_state(STATE_POWER_LIMIT_ERROR) + return STATE_POWER_LIMIT_ERROR + else: + # first read the frequency support - if it's 1 then continue, if it's 0 no need to do anything + module_fd_freq_support_path = SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format(port) + val_int = utils.read_int_from_file(module_fd_freq_support_path) + if 1 == val_int: + # read the module maximum supported clock of Management Comm Interface (MCI) from module EEPROM. + # from byte 2 bits 3-2: + # 00b means module supports up to 400KHz + # 01b means module supports up to 1MHz + logger.log_info(f"check_module_type reading mci max frequency for port {port}") + read_mci = xcvr_api.xcvr_eeprom.read_raw(2, 1) + logger.log_info(f"check_module_type read mci max frequency {read_mci} for port {port}") + mci_bits = read_mci & 0b00001100 + logger.log_info(f"check_module_type read mci max frequency bits {mci_bits} for port {port}") + # Then, set it to frequency Sysfs using: + # echo > /sys/module/sx_core/$asic/$module/frequency // val: 0 - up to 400KHz, 1 - up to 1MHz + indep_fd_freq = SYSFS_INDEPENDENT_FD_FREQ.format(port) + utils.write_file(indep_fd_freq, mci_bits) + return STATE_SW_CONTROL + + def check_power_cap(self, port, module_sm_obj, dynamic=False): + logger.log_info("enter check_power_cap port {} module_sm_obj {}".format(port, module_sm_obj)) + sfp = sfp_module.SFP(port) + xcvr_api = sfp.get_xcvr_api() + field = xcvr_api.xcvr_eeprom.mem_map.get_field(consts.MAX_POWER_FIELD) + powercap_ba = xcvr_api.xcvr_eeprom.reader(field.get_offset(), field.get_size()) + logger.log_info("check_power_cap got powercap bytearray {} for port {} module_sm_obj {}".format(powercap_ba, port, module_sm_obj)) + powercap = int.from_bytes(powercap_ba, "big") + logger.log_info("check_power_cap got powercap {} for port {} module_sm_obj {}".format(powercap, port, module_sm_obj)) + indep_fd_power_limit = self.get_sysfs_ethernet_port_fd(SYSFS_INDEPENDENT_FD_POWER_LIMIT, port) + cage_power_limit = utils.read_int_from_file(indep_fd_power_limit) + logger.log_info("check_power_cap got cage_power_limit {} for port {} module_sm_obj {}".format(cage_power_limit, port, module_sm_obj)) + if powercap > int(cage_power_limit): + logger.log_info("check_power_cap powercap {} != cage_power_limit {} for port {} module_sm_obj {}".format(powercap, cage_power_limit, port, module_sm_obj)) + module_sm_obj.set_final_state(STATE_POWER_LIMIT_ERROR) + return STATE_POWER_LIMIT_ERROR + + def save_module_control_mode(self, port, module_sm_obj, dynamic=False): + detection_method = 'dynamic' if dynamic else 'static' + logger.log_info("{} detection save_module_control_mode setting current state {} for port {} as final state" + .format(detection_method, module_sm_obj.get_current_state(), port)) + state = module_sm_obj.get_current_state() + module_sm_obj.set_final_state(state) + try: + if state == STATE_FW_CONTROL: + # echo 0 > /sys/module/sx_core/$asic/$module/control + indep_fd_fw_control = SYSFS_INDEPENDENT_FD_FW_CONTROL.format(port) + utils.write_file(indep_fd_fw_control, "0") + logger.log_info("save_module_control_mode set FW control for state {} port {}".format(state, port)) + # update the presence sysfs fd to legacy FD presence, first close the previous fd + module_sm_obj.module_fd.close() + module_fd_legacy_path = SYSFS_LEGACY_FD_PRESENCE.format(port) + module_sm_obj.set_module_fd_path(module_fd_legacy_path) + module_fd = open(module_fd_legacy_path, "r") + module_sm_obj.set_module_fd(module_fd) + logger.log_info("save_module_control_mode changed module fd to legacy present for port {}".format(port)) + else: + # registering power good sysfs even if not good, so we can get an event from poller upon changes + self.register_fd_for_polling(module_sm_obj, module_sm_obj.module_power_good_fd, 'power_good') + # register the module's sysfs fd to poller with ERR and PRI attrs + logger.log_info("save_module_control_mode registering sysfs fd {} number {} path {} for port {}" + .format(module_sm_obj.module_fd, module_sm_obj.module_fd.fileno(), module_sm_obj.set_module_fd_path, port)) + except Exception as e: + logger.log_error("{} detection exception on read presence {} for port {} fd name {} traceback:\n{}" + .format(detection_method, e, port, module_sm_obj.module_fd.name, traceback.format_exc())) + self.register_fd_for_polling(module_sm_obj, module_sm_obj.module_fd, 'presence') + logger.log_info("save_module_control_mode set current state {} for port {} as final state {}".format( + module_sm_obj.get_current_state(), port, module_sm_obj.get_final_state())) + + def register_fd_for_polling(self, module_sm_obj, fd, fd_name): + self.fds_mapping_to_obj[fd.fileno()] = {'module_obj' : module_sm_obj, + 'fd': fd, + 'fd_name' : fd_name} + if module_sm_obj.port_num not in self.port_to_fds: + self.port_to_fds[module_sm_obj.port_num] = [fd] + else: + self.port_to_fds[module_sm_obj.port_num].append(fd) + self.poll_obj.register(fd, select.POLLERR | select.POLLPRI) + + def deregister_fd_from_polling(self, port): + if port in self.port_to_fds: + fds = self.port_to_fds[port] + for fd in fds: + self.fds_mapping_to_obj.pop(fd.fileno()) + self.poll_obj.unregister(fd) + self.port_to_fds.pop(port) + + def timerTask(self): # wakes up every 1 second + logger.log_info("timerTask entered run state") + empty = False + i = 0 + while not empty: + logger.log_info("timerTask while loop itartion {}".format(i)) + empty = True + port_list_to_delete = [] + for port in self.waiting_modules_list: + logger.log_info("timerTask working on port {}".format(port)) + empty = False + module = self.sfp_port_dict[port] + logger.log_info("timerTask got module with port_num {} from port {}".format(module.port_num, port)) + state = module.get_current_state() + if module and state == STATE_NOT_POWERED: + logger.log_info("timerTask module {} current_state {} counting seconds since reset_start_time" + .format(module, module.get_current_state())) + if time.time() - module.reset_start_time >= 3: + # set next state as STATE_POWERED state to trigger the function of check module type + logger.log_info("timerTask module port {} locking lock of port {}".format(module.port_num, module.port_num)) + self.modules_lock_list[module.port_num].acquire() + logger.log_info("timerTask module port {} setting next state to STATE_POWERED".format(module.port_num)) + module.set_next_state(STATE_POWERED) + logger.log_info("timerTask module port {} advancing next state".format(module.port_num)) + module.advance_state() + logger.log_info("timerTask module port {} releasing lock of port {}".format(port, module.port_num)) + self.modules_lock_list[module.port_num].release() + logger.log_info("timerTask module port {} adding to delete list to remove from waiting_modules_list".format(module.port_num)) + port_list_to_delete.append(module.port_num) + logger.log_info("timerTask deleting ports {} from waiting_modules_list...".format(port_list_to_delete)) + for port in port_list_to_delete: + logger.log_info("timerTask deleting port {} from waiting_modules_list".format(port)) + self.waiting_modules_list.remove(port) + logger.log_info("timerTask waiting_modules_list after deletion: {}".format(self.waiting_modules_list)) + time.sleep(1) + i += 1 + + def get_sysfs_ethernet_port_fd(self, sysfs_fd, port): + sysfs_eth_port_fd = sysfs_fd.format(port) + return sysfs_eth_port_fd + + def add_port_to_wait_reset(self, module_sm_obj): + module_sm_obj.reset_start_time = time.time() + logger.log_info("add_port_to_wait_reset reset_start_time {}".format(module_sm_obj.reset_start_time)) + module_sm_obj.wait_for_power_on = True + logger.log_info("add_port_to_wait_reset wait_for_power_on {}".format(module_sm_obj.wait_for_power_on)) + self.waiting_modules_list.add(module_sm_obj.port_num) + logger.log_info("add_port_to_wait_reset waiting_list after adding: {}".format(self.waiting_modules_list)) + + def map_ports_final_state(self, dynamic=False): + detection_method = 'dynamic' if dynamic else 'static' + logger.log_info(f"{detection_method} detection enter map_ports_final_state") + for port, module_obj in self.sfp_port_dict.items(): + final_state = module_obj.get_final_state() + if final_state: + # add port to delete list that we will iterate on later and delete the ports from sfp_port_dict + self.sfp_delete_list_from_port_dict.append(port) + if final_state in [STATE_HW_NOT_PRESENT, STATE_POWER_LIMIT_ERROR, STATE_ERROR_HANDLER]: + port_status = '0' + logger.log_info(f"{detection_method} detection adding port {port} to register_hw_present_fds") + self.register_hw_present_fds.append(module_obj) + else: + port_status = '1' + self.sfp_changes_dict[str(module_obj.port_num + 1)] = port_status + + def delete_ports_from_dict(self, dynamic=False): + detection_method = 'dynamic' if dynamic else 'static' + logger.log_info(f"{detection_method} detection sfp_port_dict before deletion: {self.sfp_port_dict}") + for port in self.sfp_delete_list_from_port_dict: + del self.sfp_port_dict[port] + self.sfp_delete_list_from_port_dict = [] + logger.log_info("{} detection sfp_port_dict after deletion: {}".format(detection_method, self.sfp_port_dict)) + + def send_changes_to_shared_queue(self, dynamic=False): + detection_method = 'dynamic' if dynamic else 'static' + if self.sfp_changes_dict: + logger.log_info(f"{detection_method} detection putting sfp_changes_dict {self.sfp_changes_dict} " + f"in modules changes queue...") + try: + self.modules_changes_queue.put(self.sfp_changes_dict, timeout=1) + self.sfp_changes_dict = {} + logger.log_info(f"{detection_method} sfp_changes_dict after put changes: {self.sfp_changes_dict}") + except queue.Full: + logger.log_info(f"{detection_method} failed to put item from modules changes queue, queue is full") + else: + logger.log_info(f"{detection_method} sfp_changes_dict {self.sfp_changes_dict} is empty...") + + def register_presece_closed_ports(self, dynamic=False, module_obj_list=[]): + detection_method = 'dynamic' if dynamic else 'static' + logger.log_info(f"{detection_method} detection enter register_presence_closed_ports") + for module_obj in module_obj_list: + port = module_obj.port_num + if self.is_supported_indep_mods_system: + module_fd_indep_path = SYSFS_INDEPENDENT_FD_PRESENCE.format(port) + else: + module_fd_indep_path = SYSFS_LEGACY_FD_PRESENCE.format(port) + module_obj.set_module_fd_path(module_fd_indep_path) + module_fd = open(module_fd_indep_path, "r") + module_obj.set_module_fd(module_fd) + logger.log_info(f"{detection_method} registering fd {module_fd} fd name {module_fd.name} for port {port}") + self.register_fd_for_polling(module_obj, module_fd, 'presence') + +class ModuleStateMachine(object): + + def __init__(self, port_num=0, initial_state=STATE_HW_NOT_PRESENT, current_state=STATE_HW_NOT_PRESENT + , next_state=STATE_HW_NOT_PRESENT, final_state='', is_indep_module=False + , module_fd_path='', module_fd=None, reset_start_time=None + , eeprom_poweron_reset_retries=1, module_power_good_fd_path=None, module_power_good_fd=None): + + self.port_num = port_num + self.initial_state = initial_state + self.current_state = current_state + self.next_state = next_state + self.final_state = final_state + self.is_indep_modules = is_indep_module + self.module_fd_path = module_fd_path + self.module_fd = module_fd + self.reset_start_time = reset_start_time + self.wait_for_power_on = False + self.eeprom_poweron_reset_retries = eeprom_poweron_reset_retries + self.module_power_good_fd_path = module_power_good_fd_path + self.module_power_good_fd = module_power_good_fd + + def set_initial_state(self, state): + self.initial_state = state + + def get_current_state(self): + return self.current_state + + def set_current_state(self, state): + self.current_state = state + + def get_next_state(self): + return self.next_state + + def set_next_state(self, state): + self.next_state = state + + def get_final_state(self): + return self.final_state + + def set_final_state(self, state, detection_method='static'): + logger.log_info(f"{detection_method} set_final_state setting {state} port {self.port_num}") + self.final_state = state + + def advance_state(self): + self.set_current_state(self.next_state) + self.next_state = '' + + def set_is_indep_modules(self, is_indep_modules): + self.is_indep_modules = is_indep_modules + + def set_module_fd_path(self, module_fd_path): + self.module_fd_path = module_fd_path + + def set_module_fd(self, module_fd): + self.module_fd = module_fd + + def reset_all_states(self, def_state=STATE_HW_NOT_PRESENT, retries=1, close_presence_ports='0'): + self.initial_state = def_state + self.current_state = def_state + self.next_state = def_state + self.final_state = '' + self.wait_for_power_on = False + self.eeprom_poweron_reset_retries = retries + if '0' == close_presence_ports: + self.module_fd.close() + if self.module_power_good_fd: + self.module_power_good_fd.close() diff --git a/platform/mellanox/mlnx-platform-api/tests/test_chassis.py b/platform/mellanox/mlnx-platform-api/tests/test_chassis.py index aefff3a7f00b..fce9bd00b0ee 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_chassis.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_chassis.py @@ -167,20 +167,11 @@ def test_sfp(self): assert len(sfp_list) == 3 assert chassis.sfp_initialized_count == 3 - @mock.patch('sonic_platform.sfp_event.sfp_event.check_sfp_status', MagicMock()) - @mock.patch('sonic_platform.sfp_event.sfp_event.__init__', MagicMock(return_value=None)) - @mock.patch('sonic_platform.sfp_event.sfp_event.initialize', MagicMock()) @mock.patch('sonic_platform.device_data.DeviceDataManager.get_sfp_count', MagicMock(return_value=3)) def test_change_event(self): - from sonic_platform.sfp_event import sfp_event - - return_port_dict = {1: '1'} - def mock_check_sfp_status(self, port_dict, error_dict, timeout): - port_dict.update(return_port_dict) - return True if port_dict else False - - sfp_event.check_sfp_status = mock_check_sfp_status chassis = Chassis() + chassis.modules_mgmt_thread.is_alive = MagicMock(return_value=True) + chassis.modules_changes_queue.get = MagicMock(return_value={1: '1'}) # Call get_change_event with timeout=0, wait until an event is detected status, event_dict = chassis.get_change_event() @@ -189,7 +180,7 @@ def mock_check_sfp_status(self, port_dict, error_dict, timeout): assert len(chassis._sfp_list) == 3 # Call get_change_event with timeout=1.0 - return_port_dict = {} + chassis.modules_changes_queue.get.return_value = {} status, event_dict = chassis.get_change_event(timeout=1.0) assert status is True assert 'sfp' in event_dict and not event_dict['sfp'] From fb7bad2d11be08e2ba6613cf0116c3532e694153 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 6 Jan 2024 07:55:41 +0800 Subject: [PATCH 052/419] [Mellanox] Implement low power mode for cmis host management (#17159) (#17693) --- .../mlnx-platform-api/sonic_platform/sfp.py | 30 ++++++++++++ .../mlnx-platform-api/tests/test_sfp.py | 46 +++++++++++++++++++ 2 files changed, 76 insertions(+) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index 4b5c9bf4e924..e0e11a50ef20 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -397,6 +397,18 @@ def get_lpmode(self): Returns: A Boolean, True if lpmode is enabled, False if disabled """ + try: + if self.is_sw_control(): + api = self.get_xcvr_api() + return api.get_lpmode() if api else False + elif DeviceDataManager.is_independent_mode(): + file_path = SFP_SDK_MODULE_SYSFS_ROOT_TEMPLATE.format(self.sdk_index) + SFP_SYSFS_POWER_MODE + power_mode = utils.read_int_from_file(file_path) + return power_mode == POWER_MODE_LOW + except Exception as e: + print(e) + return False + if utils.is_host(): # To avoid performance issue, # call class level method to avoid initialize the whole sonic platform API @@ -573,6 +585,24 @@ def set_lpmode(self, lpmode): Returns: A boolean, True if lpmode is set successfully, False if not """ + try: + if self.is_sw_control(): + api = self.get_xcvr_api() + if not api: + return False + if api.get_lpmode() == lpmode: + return True + api.set_lpmode(lpmode) + return api.get_lpmode() == lpmode + elif DeviceDataManager.is_independent_mode(): + # FW control under CMIS host management mode. + # Currently, we don't support set LPM under this mode. + # Just return False to indicate set Fail + return False + except Exception as e: + print(e) + return False + if utils.is_host(): # To avoid performance issue, # call class level method to avoid initialize the whole sonic platform API diff --git a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py index d0805a0d6250..4dfcf0f073c1 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py @@ -312,6 +312,8 @@ def test_is_sw_control(self, mock_get_db, mock_mode, mock_read): with pytest.raises(Exception): sfp.is_sw_control() + @mock.patch('sonic_platform.device_data.DeviceDataManager.is_independent_mode', mock.MagicMock(return_value=False)) + @mock.patch('sonic_platform.sfp.SFP.is_sw_control', mock.MagicMock(return_value=False)) @mock.patch('sonic_platform.utils.is_host', mock.MagicMock(side_effect = [True, True, False, False])) @mock.patch('subprocess.check_output', mock.MagicMock(side_effect = ['True', 'False'])) @mock.patch('sonic_platform.sfp.SFP._get_lpmode', mock.MagicMock(side_effect = [True, False])) @@ -323,6 +325,8 @@ def test_get_lpmode(self): assert sfp.get_lpmode() assert not sfp.get_lpmode() + @mock.patch('sonic_platform.device_data.DeviceDataManager.is_independent_mode', mock.MagicMock(return_value=False)) + @mock.patch('sonic_platform.sfp.SFP.is_sw_control', mock.MagicMock(return_value=False)) @mock.patch('sonic_platform.utils.is_host', mock.MagicMock(side_effect = [True, True, False, False])) @mock.patch('subprocess.check_output', mock.MagicMock(side_effect = ['True', 'False'])) @mock.patch('sonic_platform.sfp.SFP._set_lpmode', mock.MagicMock(side_effect = [True, False])) @@ -333,3 +337,45 @@ def test_set_lpmode(self): assert not sfp.set_lpmode(True) assert sfp.set_lpmode(False) assert not sfp.set_lpmode(False) + + @mock.patch('sonic_platform.device_data.DeviceDataManager.is_independent_mode', mock.MagicMock(return_value=True)) + @mock.patch('sonic_platform.utils.read_int_from_file') + @mock.patch('sonic_platform.sfp.SFP.is_sw_control') + def test_get_lpmode_cmis_host_mangagement(self, mock_control, mock_read): + mock_control.return_value = True + sfp = SFP(0) + sfp.get_xcvr_api = mock.MagicMock(return_value=None) + assert not sfp.get_lpmode() + + mock_api = mock.MagicMock() + sfp.get_xcvr_api.return_value = mock_api + mock_api.get_lpmode = mock.MagicMock(return_value=False) + assert not sfp.get_lpmode() + + mock_api.get_lpmode.return_value = True + assert sfp.get_lpmode() + + mock_control.return_value = False + mock_read.return_value = 1 + assert sfp.get_lpmode() + + mock_read.return_value = 2 + assert not sfp.get_lpmode() + + @mock.patch('sonic_platform.device_data.DeviceDataManager.is_independent_mode', mock.MagicMock(return_value=True)) + @mock.patch('sonic_platform.sfp.SFP.is_sw_control') + def test_set_lpmode_cmis_host_mangagement(self, mock_control): + mock_control.return_value = True + sfp = SFP(0) + sfp.get_xcvr_api = mock.MagicMock(return_value=None) + assert not sfp.set_lpmode(False) + + mock_api = mock.MagicMock() + sfp.get_xcvr_api.return_value = mock_api + mock_api.get_lpmode = mock.MagicMock(return_value=False) + assert sfp.set_lpmode(False) + assert not sfp.set_lpmode(True) + + mock_control.return_value = False + assert not sfp.set_lpmode(True) + assert not sfp.set_lpmode(False) From 4060f5ce5b9b5639d3a193ad8b07016872d48ac0 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sun, 7 Jan 2024 13:16:25 +0800 Subject: [PATCH 053/419] [Mellanox] Remove EEPROM write limitation if it is software control (#17030) (#17694) --- platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py | 7 +++++++ platform/mellanox/mlnx-platform-api/tests/test_sfp.py | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index e0e11a50ef20..9b9e97d189b3 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -771,6 +771,13 @@ def _is_write_protected(self, page, page_offset, num_bytes): Returns: bool: True if the limited bytes is hit """ + try: + if self.is_sw_control(): + return False + except Exception as e: + logger.log_notice(f'Module is under initialization, cannot write module EEPROM - {e}') + return True + eeprom_path = self._get_eeprom_path() limited_data = limited_eeprom.get(self._get_sfp_type_str(eeprom_path)) if not limited_data: diff --git a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py index 4dfcf0f073c1..6bdc82b5b4d1 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py @@ -162,8 +162,13 @@ def test_is_port_admin_status_up(self, mock_port_status): @mock.patch('sonic_platform.sfp.SFP._get_eeprom_path', mock.MagicMock(return_value = None)) @mock.patch('sonic_platform.sfp.SFP._get_sfp_type_str') - def test_is_write_protected(self, mock_get_type_str): + @mock.patch('sonic_platform.sfp.SFP.is_sw_control') + def test_is_write_protected(self, mock_sw_control, mock_get_type_str): sfp = SFP(0) + mock_sw_control.return_value = True + assert not sfp._is_write_protected(page=0, page_offset=26, num_bytes=1) + + mock_sw_control.return_value = False mock_get_type_str.return_value = 'cmis' assert sfp._is_write_protected(page=0, page_offset=26, num_bytes=1) assert not sfp._is_write_protected(page=0, page_offset=27, num_bytes=1) From 8de7cb598882e83c6e25c7803580bc58a18929dc Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Tue, 9 Jan 2024 02:50:59 +0800 Subject: [PATCH 054/419] [202311] [Mellanox] update asic and module temperature in a thread for CMIS management (#16955) (#17699) - Why I did it When module is totally under software control, driver cannot get module temperature/temperature threshold from firmware. In this case, sonic needs to get temperature/temperature threshold from EEPROM. In this PR, a thread thermal updater is created to update module temperature/temperature threshold while software control is enabled. - How I did it Query ASIC temperature from SDK sysfs and update hw-management-tc periodically Query Module temperature from EEPROM and update hw-management-tc periodically - How to verify it Manual test New Unit tests --- .../sonic_platform/chassis.py | 4 + .../mlnx-platform-api/sonic_platform/sfp.py | 79 ++++++- .../sonic_platform/thermal.py | 124 +++++++--- .../sonic_platform/thermal_manager.py | 27 +++ .../sonic_platform/thermal_updater.py | 213 ++++++++++++++++++ .../mlnx-platform-api/sonic_platform/utils.py | 55 +++++ .../mlnx-platform-api/tests/test_sfp.py | 40 ++++ .../mlnx-platform-api/tests/test_thermal.py | 21 +- .../tests/test_thermal_updater.py | 128 +++++++++++ .../mlnx-platform-api/tests/test_utils.py | 20 ++ 10 files changed, 675 insertions(+), 36 deletions(-) create mode 100644 platform/mellanox/mlnx-platform-api/sonic_platform/thermal_updater.py create mode 100644 platform/mellanox/mlnx-platform-api/tests/test_thermal_updater.py diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py b/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py index 6efdfb61f4e3..f0b73de66c34 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py @@ -82,6 +82,8 @@ class Chassis(ChassisBase): # System UID LED _led_uid = None + chassis_instance = None + def __init__(self): super(Chassis, self).__init__() @@ -127,6 +129,8 @@ def __init__(self): self._RJ45_port_inited = False self._RJ45_port_list = None + Chassis.chassis_instance = self + self.modules_mgmt_thread = threading.Thread() self.modules_changes_queue = queue.Queue() self.modules_mgmt_task_stopping_event = threading.Event() diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index 9b9e97d189b3..c5bcfddaf112 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -31,6 +31,8 @@ from . import utils from .device_data import DeviceDataManager from sonic_platform_base.sonic_xcvr.sfp_optoe_base import SfpOptoeBase + from sonic_platform_base.sonic_xcvr.fields import consts + from sonic_platform_base.sonic_xcvr.api.public import sff8636, sff8436 except ImportError as e: raise ImportError (str(e) + "- required module not found") @@ -155,6 +157,10 @@ # SFP stderr SFP_EEPROM_NOT_AVAILABLE = 'Input/output error' +SFP_DEFAULT_TEMP_WARNNING_THRESHOLD = 70.0 +SFP_DEFAULT_TEMP_CRITICAL_THRESHOLD = 80.0 +SFP_TEMPERATURE_SCALE = 8.0 + # SFP EEPROM limited bytes limited_eeprom = { SFP_TYPE_CMIS: { @@ -264,7 +270,7 @@ def __init__(self, sfp_index, sfp_type=None, slot_id=0, linecard_port_count=0, l if slot_id == 0: # For non-modular chassis from .thermal import initialize_sfp_thermal - self._thermal_list = initialize_sfp_thermal(sfp_index) + self._thermal_list = initialize_sfp_thermal(self) else: # For modular chassis # (slot_id % MAX_LC_CONUNT - 1) * MAX_PORT_COUNT + (sfp_index + 1) * (MAX_PORT_COUNT / LC_PORT_COUNT) max_linecard_count = DeviceDataManager.get_linecard_count() @@ -822,6 +828,77 @@ def get_tx_fault(self): api = self.get_xcvr_api() return [False] * api.NUM_CHANNELS if api else None + def get_temperature(self): + try: + if not self.is_sw_control(): + temp_file = f'/sys/module/sx_core/asic0/module{self.sdk_index}/temperature/input' + if not os.path.exists(temp_file): + logger.log_error(f'Failed to read from file {temp_file} - not exists') + return None + temperature = utils.read_int_from_file(temp_file, + log_func=None) + return temperature / SFP_TEMPERATURE_SCALE if temperature is not None else None + except: + return 0.0 + + self.reinit() + temperature = super().get_temperature() + return temperature if temperature is not None else None + + def get_temperature_warning_threashold(self): + """Get temperature warning threshold + + Returns: + int: temperature warning threshold + """ + try: + if not self.is_sw_control(): + emergency = utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/temperature/emergency', + log_func=None, + default=None) + return emergency / SFP_TEMPERATURE_SCALE if emergency is not None else SFP_DEFAULT_TEMP_WARNNING_THRESHOLD + except: + return SFP_DEFAULT_TEMP_WARNNING_THRESHOLD + + thresh = self._get_temperature_threshold() + if thresh and consts.TEMP_HIGH_WARNING_FIELD in thresh: + return thresh[consts.TEMP_HIGH_WARNING_FIELD] + return SFP_DEFAULT_TEMP_WARNNING_THRESHOLD + + def get_temperature_critical_threashold(self): + """Get temperature critical threshold + + Returns: + int: temperature critical threshold + """ + try: + if not self.is_sw_control(): + critical = utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/temperature/critical', + log_func=None, + default=None) + return critical / SFP_TEMPERATURE_SCALE if critical is not None else SFP_DEFAULT_TEMP_CRITICAL_THRESHOLD + except: + return SFP_DEFAULT_TEMP_CRITICAL_THRESHOLD + + thresh = self._get_temperature_threshold() + if thresh and consts.TEMP_HIGH_ALARM_FIELD in thresh: + return thresh[consts.TEMP_HIGH_ALARM_FIELD] + return SFP_DEFAULT_TEMP_CRITICAL_THRESHOLD + + def _get_temperature_threshold(self): + self.reinit() + api = self.get_xcvr_api() + if not api: + return None + + thresh_support = api.get_transceiver_thresholds_support() + if thresh_support: + if isinstance(api, sff8636.Sff8636Api) or isinstance(api, sff8436.Sff8436Api): + return api.xcvr_eeprom.read(consts.TEMP_THRESHOLDS_FIELD) + return api.xcvr_eeprom.read(consts.THRESHOLDS_FIELD) + else: + return None + def get_xcvr_api(self): """ Retrieves the XcvrApi associated with this SFP diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py index 4786b1f74049..867bf55e0292 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py @@ -36,6 +36,8 @@ # Global logger class instance logger = Logger() +DEFAULT_TEMP_SCALE = 1000 + """ The most important information for creating a Thermal object is 3 sysfs files: temperature file, high threshold file and high critical threshold file. There is no common naming rule for thermal objects on Nvidia platform. There are two types @@ -72,9 +74,11 @@ "chassis thermals": [ { "name": "ASIC", - "temperature": "asic", - "high_threshold": "mlxsw/temp_trip_hot", - "high_critical_threshold": "mlxsw/temp_trip_crit" + "temperature": "input", + "high_threshold_default": 105, + "high_critical_threshold_default": 120, + "sysfs_folder": "/sys/module/sx_core/asic0/temperature", + "scale": 8 }, { "name": "Ambient Port Side Temp", @@ -187,8 +191,8 @@ def initialize_psu_thermal(psu_index, presence_cb): return [create_indexable_thermal(THERMAL_NAMING_RULE['psu thermals'], psu_index, CHASSIS_THERMAL_SYSFS_FOLDER, 1, presence_cb)] -def initialize_sfp_thermal(sfp_index): - return [create_indexable_thermal(THERMAL_NAMING_RULE['sfp thermals'], sfp_index, CHASSIS_THERMAL_SYSFS_FOLDER, 1)] +def initialize_sfp_thermal(sfp): + return [ModuleThermal(sfp)] def initialize_linecard_thermals(lc_name, lc_index): @@ -214,6 +218,7 @@ def initialize_linecard_sfp_thermal(lc_name, lc_index, sfp_index): def create_indexable_thermal(rule, index, sysfs_folder, position, presence_cb=None): index += rule.get('start_index', 1) name = rule['name'].format(index) + sysfs_folder = rule.get('sysfs_folder', sysfs_folder) temp_file = os.path.join(sysfs_folder, rule['temperature'].format(index)) _check_thermal_sysfs_existence(temp_file) if 'high_threshold' in rule: @@ -226,10 +231,13 @@ def create_indexable_thermal(rule, index, sysfs_folder, position, presence_cb=No _check_thermal_sysfs_existence(high_crit_th_file) else: high_crit_th_file = None + high_th_default = rule.get('high_threshold_default') + high_crit_th_default = rule.get('high_critical_threshold_default') + scale = rule.get('scale', DEFAULT_TEMP_SCALE) if not presence_cb: - return Thermal(name, temp_file, high_th_file, high_crit_th_file, position) + return Thermal(name, temp_file, high_th_file, high_crit_th_file, high_th_default, high_crit_th_default, scale, position) else: - return RemovableThermal(name, temp_file, high_th_file, high_crit_th_file, position, presence_cb) + return RemovableThermal(name, temp_file, high_th_file, high_crit_th_file, high_th_default, high_crit_th_default, scale, position, presence_cb) def create_single_thermal(rule, sysfs_folder, position, presence_cb=None): @@ -243,6 +251,7 @@ def create_single_thermal(rule, sysfs_folder, position, presence_cb=None): elif not default_present: return None + sysfs_folder = rule.get('sysfs_folder', sysfs_folder) temp_file = os.path.join(sysfs_folder, temp_file) _check_thermal_sysfs_existence(temp_file) if 'high_threshold' in rule: @@ -255,11 +264,14 @@ def create_single_thermal(rule, sysfs_folder, position, presence_cb=None): _check_thermal_sysfs_existence(high_crit_th_file) else: high_crit_th_file = None + high_th_default = rule.get('high_threshold_default') + high_crit_th_default = rule.get('high_critical_threshold_default') + scale = rule.get('scale', DEFAULT_TEMP_SCALE) name = rule['name'] if not presence_cb: - return Thermal(name, temp_file, high_th_file, high_crit_th_file, position) + return Thermal(name, temp_file, high_th_file, high_crit_th_file, high_th_default, high_crit_th_default, scale, position) else: - return RemovableThermal(name, temp_file, high_th_file, high_crit_th_file, position, presence_cb) + return RemovableThermal(name, temp_file, high_th_file, high_crit_th_file, high_th_default, high_crit_th_default, scale, position, presence_cb) def _check_thermal_sysfs_existence(file_path): @@ -268,17 +280,7 @@ def _check_thermal_sysfs_existence(file_path): class Thermal(ThermalBase): - thermal_algorithm_status = False - # Expect cooling level, used for caching the cooling level value before commiting to hardware - expect_cooling_level = None - # Expect cooling state - expect_cooling_state = None - # Last committed cooling level - last_set_cooling_level = None - last_set_cooling_state = None - last_set_psu_cooling_level = None - - def __init__(self, name, temp_file, high_th_file, high_crit_th_file, position): + def __init__(self, name, temp_file, high_th_file, high_crit_th_file, high_th_default, high_crit_th_default, scale, position): """ index should be a string for category ambient and int for other categories """ @@ -288,6 +290,9 @@ def __init__(self, name, temp_file, high_th_file, high_crit_th_file, position): self.temperature = temp_file self.high_threshold = high_th_file self.high_critical_threshold = high_crit_th_file + self.high_th_default = high_th_default + self.high_crit_th_default = high_crit_th_default + self.scale = scale def get_name(self): """ @@ -307,7 +312,7 @@ def get_temperature(self): of one degree Celsius, e.g. 30.125 """ value = utils.read_float_from_file(self.temperature, None, log_func=logger.log_info) - return value / 1000.0 if (value is not None and value != 0) else None + return value / self.scale if (value is not None and value != 0) else None def get_high_threshold(self): """ @@ -318,9 +323,9 @@ def get_high_threshold(self): up to nearest thousandth of one degree Celsius, e.g. 30.125 """ if self.high_threshold is None: - return None + return self.high_th_default value = utils.read_float_from_file(self.high_threshold, None, log_func=logger.log_info) - return value / 1000.0 if (value is not None and value != 0) else None + return value / self.scale if (value is not None and value != 0) else self.high_th_default def get_high_critical_threshold(self): """ @@ -331,9 +336,9 @@ def get_high_critical_threshold(self): up to nearest thousandth of one degree Celsius, e.g. 30.125 """ if self.high_critical_threshold is None: - return None + return self.high_crit_th_default value = utils.read_float_from_file(self.high_critical_threshold, None, log_func=logger.log_info) - return value / 1000.0 if (value is not None and value != 0) else None + return value / self.scale if (value is not None and value != 0) else self.high_crit_th_default def get_position_in_parent(self): """ @@ -353,8 +358,8 @@ def is_replaceable(self): class RemovableThermal(Thermal): - def __init__(self, name, temp_file, high_th_file, high_crit_th_file, position, presence_cb): - super(RemovableThermal, self).__init__(name, temp_file, high_th_file, high_crit_th_file, position) + def __init__(self, name, temp_file, high_th_file, high_crit_th_file, high_th_default, high_crit_th_default, scale, position, presence_cb): + super(RemovableThermal, self).__init__(name, temp_file, high_th_file, high_crit_th_file, high_th_default, high_crit_th_default, scale, position) self.presence_cb = presence_cb def get_temperature(self): @@ -398,3 +403,68 @@ def get_high_critical_threshold(self): logger.log_debug("get_high_critical_threshold for {} failed due to {}".format(self.name, hint)) return None return super(RemovableThermal, self).get_high_critical_threshold() + + +class ModuleThermal(ThermalBase): + def __init__(self, sfp): + """ + index should be a string for category ambient and int for other categories + """ + super(ModuleThermal, self).__init__() + self.name = f'xSFP module {sfp.sdk_index + 1} Temp' + self.sfp = sfp + + def get_name(self): + """ + Retrieves the name of the device + + Returns: + string: The name of the device + """ + return self.name + + def get_temperature(self): + """ + Retrieves current temperature reading from thermal + + Returns: + A float number of current temperature in Celsius up to nearest thousandth + of one degree Celsius, e.g. 30.125 + """ + return self.sfp.get_temperature() + + def get_high_threshold(self): + """ + Retrieves the high threshold temperature of thermal + + Returns: + A float number, the high threshold temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + return self.sfp.get_temperature_warning_threashold() + + def get_high_critical_threshold(self): + """ + Retrieves the high critical threshold temperature of thermal + + Returns: + A float number, the high critical threshold temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + return self.sfp.get_temperature_critical_threashold() + + 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 1 + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_manager.py b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_manager.py index dd3d794d855c..9e1aaded0586 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_manager.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_manager.py @@ -15,9 +15,36 @@ # limitations under the License. # from sonic_platform_base.sonic_thermal_control.thermal_manager_base import ThermalManagerBase +from . import thermal_updater +from .device_data import DeviceDataManager class ThermalManager(ThermalManagerBase): + thermal_updater_task = None + @classmethod def run_policy(cls, chassis): pass + + @classmethod + def initialize(cls): + """ + Initialize thermal manager, including register thermal condition types and thermal action types + and any other vendor specific initialization. + :return: + """ + if DeviceDataManager.is_independent_mode(): + from .chassis import Chassis + cls.thermal_updater_task = thermal_updater.ThermalUpdater(Chassis.chassis_instance.get_all_sfps()) + cls.thermal_updater_task.start() + + + @classmethod + def deinitialize(cls): + """ + Destroy thermal manager, including any vendor specific cleanup. The default behavior of this function + is a no-op. + :return: + """ + if DeviceDataManager.is_independent_mode(): + cls.thermal_updater_task.stop() diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_updater.py b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_updater.py new file mode 100644 index 000000000000..ad0b92ef4ee6 --- /dev/null +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_updater.py @@ -0,0 +1,213 @@ +# +# Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. +# Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +from . import utils +from sonic_py_common import logger + +import sys +import time + +sys.path.append('/run/hw-management/bin') + +try: + import hw_management_independent_mode_update +except ImportError: + # For unit test only + from unittest import mock + hw_management_independent_mode_update = mock.MagicMock() + hw_management_independent_mode_update.module_data_set_module_counter = mock.MagicMock() + hw_management_independent_mode_update.thermal_data_set_asic = mock.MagicMock() + hw_management_independent_mode_update.thermal_data_set_module = mock.MagicMock() + hw_management_independent_mode_update.thermal_data_clean_asic = mock.MagicMock() + hw_management_independent_mode_update.thermal_data_clean_module = mock.MagicMock() + + +SFP_TEMPERATURE_SCALE = 1000 +ASIC_TEMPERATURE_SCALE = 125 +ASIC_DEFAULT_TEMP_WARNNING_THRESHOLD = 105000 +ASIC_DEFAULT_TEMP_CRITICAL_THRESHOLD = 120000 + +ERROR_READ_THERMAL_DATA = 254000 + +TC_CONFIG_FILE = '/run/hw-management/config/tc_config.json' +logger = logger.Logger('thermal-updater') + + +class ThermalUpdater: + def __init__(self, sfp_list): + self._sfp_list = sfp_list + self._sfp_status = {} + self._timer = utils.Timer() + + def load_tc_config(self): + asic_poll_interval = 1 + sfp_poll_interval = 10 + data = utils.load_json_file(TC_CONFIG_FILE) + if not data: + logger.log_notice(f'{TC_CONFIG_FILE} does not exist, use default polling interval') + + if data: + dev_parameters = data.get('dev_parameters') + if dev_parameters is not None: + asic_parameter = dev_parameters.get('asic') + if asic_parameter is not None: + asic_poll_interval_config = asic_parameter.get('poll_time') + if asic_poll_interval_config: + asic_poll_interval = int(asic_poll_interval_config) / 2 + module_parameter = dev_parameters.get('module\\d+') + if module_parameter is not None: + sfp_poll_interval_config = module_parameter.get('poll_time') + if sfp_poll_interval_config: + sfp_poll_interval = int(sfp_poll_interval_config) / 2 + + logger.log_notice(f'ASIC polling interval: {asic_poll_interval}') + self._timer.schedule(asic_poll_interval, self.update_asic) + logger.log_notice(f'Module polling interval: {sfp_poll_interval}') + self._timer.schedule(sfp_poll_interval, self.update_module) + + def start(self): + self.clean_thermal_data() + if not self.wait_all_sfp_ready(): + logger.log_error('Failed to wait for all SFP ready, will put hw-management-tc to suspend') + self.control_tc(True) + return + self.control_tc(False) + self.load_tc_config() + self._timer.start() + + def stop(self): + self._timer.stop() + self.control_tc(True) + + def control_tc(self, suspend): + logger.log_notice(f'Set hw-management-tc to {"suspend" if suspend else "resume"}') + utils.write_file('/run/hw-management/config/suspend', 1 if suspend else 0) + + def clean_thermal_data(self): + hw_management_independent_mode_update.module_data_set_module_counter(len(self._sfp_list)) + hw_management_independent_mode_update.thermal_data_clean_asic(0) + for sfp in self._sfp_list: + hw_management_independent_mode_update.thermal_data_clean_module( + 0, + sfp.sdk_index + 1 + ) + + def wait_all_sfp_ready(self): + logger.log_notice('Waiting for all SFP modules ready...') + max_wait_time = 60 + ready_set = set() + while len(ready_set) != len(self._sfp_list): + for sfp in self._sfp_list: + try: + sfp.is_sw_control() + ready_set.add(sfp) + except: + continue + max_wait_time -= 1 + if max_wait_time == 0: + return False + time.sleep(1) + + logger.log_notice('All SFP modules are ready') + return True + + def get_asic_temp(self): + temperature = utils.read_int_from_file('/sys/module/sx_core/asic0/temperature/input', default=None) + return temperature * ASIC_TEMPERATURE_SCALE if temperature is not None else None + + def get_asic_temp_warning_threashold(self): + emergency = utils.read_int_from_file('/sys/module/sx_core/asic0/temperature/emergency', default=None, log_func=None) + return emergency * ASIC_TEMPERATURE_SCALE if emergency is not None else ASIC_DEFAULT_TEMP_WARNNING_THRESHOLD + + def get_asic_temp_critical_threashold(self): + critical = utils.read_int_from_file('/sys/module/sx_core/asic0/temperature/critical', default=None, log_func=None) + return critical * ASIC_TEMPERATURE_SCALE if critical is not None else ASIC_DEFAULT_TEMP_CRITICAL_THRESHOLD + + def update_single_module(self, sfp): + try: + presence = sfp.get_presence() + pre_presence = self._sfp_status.get(sfp.sdk_index) + if presence: + temperature = sfp.get_temperature() + if temperature == 0: + warning_thresh = 0 + critical_thresh = 0 + fault = 0 + else: + warning_thresh = sfp.get_temperature_warning_threashold() + critical_thresh = sfp.get_temperature_critical_threashold() + fault = ERROR_READ_THERMAL_DATA if (temperature is None or warning_thresh is None or critical_thresh is None) else 0 + temperature = 0 if temperature is None else int(temperature * SFP_TEMPERATURE_SCALE) + warning_thresh = 0 if warning_thresh is None else int(warning_thresh * SFP_TEMPERATURE_SCALE) + critical_thresh = 0 if critical_thresh is None else int(critical_thresh * SFP_TEMPERATURE_SCALE) + + hw_management_independent_mode_update.thermal_data_set_module( + 0, # ASIC index always 0 for now + sfp.sdk_index + 1, + temperature, + critical_thresh, + warning_thresh, + fault + ) + else: + if pre_presence != presence: + hw_management_independent_mode_update.thermal_data_clean_module(0, sfp.sdk_index + 1) + + if pre_presence != presence: + self._sfp_status[sfp.sdk_index] = presence + except Exception as e: + logger.log_error('Failed to update module {sfp.sdk_index} thermal data - {e}') + hw_management_independent_mode_update.thermal_data_set_module( + 0, # ASIC index always 0 for now + sfp.sdk_index + 1, + 0, + 0, + 0, + ERROR_READ_THERMAL_DATA + ) + + def update_module(self): + for sfp in self._sfp_list: + self.update_single_module(sfp) + + def update_asic(self): + try: + asic_temp = self.get_asic_temp() + warn_threshold = self.get_asic_temp_warning_threashold() + critical_threshold = self.get_asic_temp_critical_threashold() + fault = 0 + if asic_temp is None: + logger.log_error('Failed to read ASIC temperature, send fault to hw-management-tc') + asic_temp = warn_threshold + fault = ERROR_READ_THERMAL_DATA + + hw_management_independent_mode_update.thermal_data_set_asic( + 0, # ASIC index always 0 for now + asic_temp, + critical_threshold, + warn_threshold, + fault + ) + except Exception as e: + logger.log_error('Failed to update ASIC thermal data - {e}') + hw_management_independent_mode_update.thermal_data_set_asic( + 0, # ASIC index always 0 for now + 0, + 0, + 0, + ERROR_READ_THERMAL_DATA + ) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/utils.py b/platform/mellanox/mlnx-platform-api/sonic_platform/utils.py index 51e9bc7f0318..9db38e6b4147 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/utils.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/utils.py @@ -18,6 +18,7 @@ import functools import subprocess import json +import queue import sys import threading import time @@ -289,6 +290,60 @@ def wait_until(predict, timeout, interval=1, *args, **kwargs): return False +class TimerEvent: + def __init__(self, interval, cb, repeat): + self.interval = interval + self._cb = cb + self.repeat = repeat + + def execute(self): + self._cb() + + +class Timer(threading.Thread): + def __init__(self): + super(Timer, self).__init__() + self._timestamp_queue = queue.PriorityQueue() + self._wait_event = threading.Event() + self._stop_event = threading.Event() + self._min_timestamp = None + + def schedule(self, interval, cb, repeat=True, run_now=True): + timer_event = TimerEvent(interval, cb, repeat) + self.add_timer_event(timer_event, run_now) + + def add_timer_event(self, timer_event, run_now=True): + timestamp = time.time() + if not run_now: + timestamp += timer_event.interval + + self._timestamp_queue.put_nowait((timestamp, timer_event)) + if self._min_timestamp is not None and timestamp < self._min_timestamp: + self._wait_event.set() + + def stop(self): + if self.is_alive(): + self._wait_event.set() + self._stop_event.set() + self.join() + + def run(self): + while not self._stop_event.is_set(): + now = time.time() + item = self._timestamp_queue.get() + self._min_timestamp = item[0] + if self._min_timestamp > now: + self._wait_event.wait(self._min_timestamp - now) + self._wait_event.clear() + self._timestamp_queue.put(item) + continue + + timer_event = item[1] + timer_event.execute() + if timer_event.repeat: + self.add_timer_event(timer_event, False) + + class DbUtils: lock = threading.Lock() db_instances = threading.local() diff --git a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py index 6bdc82b5b4d1..dccc727bfe57 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py @@ -292,6 +292,46 @@ def test_rj45_basic(self): assert sfp.get_transceiver_threshold_info() sfp.reinit() + @mock.patch('os.path.exists') + @mock.patch('sonic_platform.utils.read_int_from_file') + def test_get_temperature(self, mock_read, mock_exists): + sfp = SFP(0) + sfp.is_sw_control = mock.MagicMock(return_value=True) + mock_exists.return_value = False + assert sfp.get_temperature() == None + + mock_exists.return_value = True + assert sfp.get_temperature() == None + + mock_read.return_value = None + sfp.is_sw_control.return_value = False + assert sfp.get_temperature() == None + + mock_read.return_value = 448 + assert sfp.get_temperature() == 56.0 + + def test_get_temperature_threshold(self): + sfp = SFP(0) + sfp.is_sw_control = mock.MagicMock(return_value=True) + assert sfp.get_temperature_warning_threashold() == 70.0 + assert sfp.get_temperature_critical_threashold() == 80.0 + + mock_api = mock.MagicMock() + mock_api.get_transceiver_thresholds_support = mock.MagicMock(return_value=False) + sfp.get_xcvr_api = mock.MagicMock(return_value=mock_api) + assert sfp.get_temperature_warning_threashold() == 70.0 + assert sfp.get_temperature_critical_threashold() == 80.0 + + from sonic_platform_base.sonic_xcvr.fields import consts + mock_api.get_transceiver_thresholds_support.return_value = True + mock_api.xcvr_eeprom = mock.MagicMock() + mock_api.xcvr_eeprom.read = mock.MagicMock(return_value={ + consts.TEMP_HIGH_ALARM_FIELD: 85.0, + consts.TEMP_HIGH_WARNING_FIELD: 75.0 + }) + assert sfp.get_temperature_warning_threashold() == 75.0 + assert sfp.get_temperature_critical_threashold() == 85.0 + @mock.patch('sonic_platform.utils.read_int_from_file') @mock.patch('sonic_platform.device_data.DeviceDataManager.is_independent_mode') @mock.patch('sonic_platform.utils.DbUtils.get_db_instance') diff --git a/platform/mellanox/mlnx-platform-api/tests/test_thermal.py b/platform/mellanox/mlnx-platform-api/tests/test_thermal.py index db81f73096f4..a59b8dda4055 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_thermal.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_thermal.py @@ -31,6 +31,7 @@ import sonic_platform.chassis from sonic_platform.chassis import Chassis from sonic_platform.device_data import DeviceDataManager +from sonic_platform.sfp import SFP sonic_platform.chassis.extract_RJ45_ports_index = mock.MagicMock(return_value=[]) @@ -148,23 +149,27 @@ def test_psu_thermal(self): @mock.patch('os.path.exists', mock.MagicMock(return_value=True)) def test_sfp_thermal(self): - from sonic_platform.thermal import initialize_sfp_thermal, THERMAL_NAMING_RULE - thermal_list = initialize_sfp_thermal(0) + from sonic_platform.thermal import THERMAL_NAMING_RULE + sfp = SFP(0) + thermal_list = sfp.get_all_thermals() assert len(thermal_list) == 1 thermal = thermal_list[0] rule = THERMAL_NAMING_RULE['sfp thermals'] start_index = rule.get('start_index', 1) assert thermal.get_name() == rule['name'].format(start_index) - assert rule['temperature'].format(start_index) in thermal.temperature - assert rule['high_threshold'].format(start_index) in thermal.high_threshold - assert rule['high_critical_threshold'].format(start_index) in thermal.high_critical_threshold assert thermal.get_position_in_parent() == 1 assert thermal.is_replaceable() == False + sfp.get_temperature = mock.MagicMock(return_value=35.4) + sfp.get_temperature_warning_threashold = mock.MagicMock(return_value=70) + sfp.get_temperature_critical_threashold = mock.MagicMock(return_value=80) + assert thermal.get_temperature() == 35.4 + assert thermal.get_high_threshold() == 70 + assert thermal.get_high_critical_threshold() == 80 @mock.patch('sonic_platform.utils.read_float_from_file') def test_get_temperature(self, mock_read): from sonic_platform.thermal import Thermal - thermal = Thermal('test', 'temp_file', None, None, 1) + thermal = Thermal('test', 'temp_file', None, None, None, None, 1000, 1) mock_read.return_value = 35727 assert thermal.get_temperature() == 35.727 @@ -177,7 +182,7 @@ def test_get_temperature(self, mock_read): @mock.patch('sonic_platform.utils.read_float_from_file') def test_get_high_threshold(self, mock_read): from sonic_platform.thermal import Thermal - thermal = Thermal('test', None, None, None, 1) + thermal = Thermal('test', None, None, None, None, None, 1000, 1) assert thermal.get_high_threshold() is None thermal.high_threshold = 'high_th_file' @@ -193,7 +198,7 @@ def test_get_high_threshold(self, mock_read): @mock.patch('sonic_platform.utils.read_float_from_file') def test_get_high_critical_threshold(self, mock_read): from sonic_platform.thermal import Thermal - thermal = Thermal('test', None, None, None, 1) + thermal = Thermal('test', None, None, None, None, None, 1000, 1) assert thermal.get_high_critical_threshold() is None thermal.high_critical_threshold = 'high_th_file' diff --git a/platform/mellanox/mlnx-platform-api/tests/test_thermal_updater.py b/platform/mellanox/mlnx-platform-api/tests/test_thermal_updater.py new file mode 100644 index 000000000000..1a34a7440a2d --- /dev/null +++ b/platform/mellanox/mlnx-platform-api/tests/test_thermal_updater.py @@ -0,0 +1,128 @@ +# +# Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. +# Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +import time +from unittest import mock + +from sonic_platform import utils +from sonic_platform.thermal_updater import ThermalUpdater, hw_management_independent_mode_update +from sonic_platform.thermal_updater import ASIC_DEFAULT_TEMP_WARNNING_THRESHOLD, \ + ASIC_DEFAULT_TEMP_CRITICAL_THRESHOLD + + +mock_tc_config = """ +{ + "dev_parameters": { + "asic": { + "pwm_min": 20, + "pwm_max": 100, + "val_min": "!70000", + "val_max": "!105000", + "poll_time": 3 + }, + "module\\\\d+": { + "pwm_min": 20, + "pwm_max": 100, + "val_min": 60000, + "val_max": 80000, + "poll_time": 20 + } + } +} +""" + + +class TestThermalUpdater: + def test_load_tc_config_non_exists(self): + updater = ThermalUpdater(None) + updater.load_tc_config() + assert updater._timer._timestamp_queue.qsize() == 2 + + def test_load_tc_config_mocked(self): + updater = ThermalUpdater(None) + mock_os_open = mock.mock_open(read_data=mock_tc_config) + with mock.patch('sonic_platform.utils.open', mock_os_open): + updater.load_tc_config() + assert updater._timer._timestamp_queue.qsize() == 2 + + @mock.patch('sonic_platform.thermal_updater.ThermalUpdater.update_asic', mock.MagicMock()) + @mock.patch('sonic_platform.thermal_updater.ThermalUpdater.update_module', mock.MagicMock()) + @mock.patch('sonic_platform.thermal_updater.ThermalUpdater.wait_all_sfp_ready') + @mock.patch('sonic_platform.utils.write_file') + def test_start_stop(self, mock_write, mock_wait): + mock_wait.return_value = True + mock_sfp = mock.MagicMock() + mock_sfp.sdk_index = 1 + updater = ThermalUpdater([mock_sfp]) + updater.start() + mock_write.assert_called_once_with('/run/hw-management/config/suspend', 0) + utils.wait_until(updater._timer.is_alive, timeout=5) + + mock_write.reset_mock() + updater.stop() + assert not updater._timer.is_alive() + mock_write.assert_called_once_with('/run/hw-management/config/suspend', 1) + + mock_wait.return_value = False + mock_write.reset_mock() + updater.start() + mock_write.assert_called_once_with('/run/hw-management/config/suspend', 1) + updater.stop() + + @mock.patch('sonic_platform.thermal_updater.time.sleep', mock.MagicMock()) + def test_wait_all_sfp_ready(self): + mock_sfp = mock.MagicMock() + mock_sfp.is_sw_control = mock.MagicMock(return_value=True) + updater = ThermalUpdater([mock_sfp]) + assert updater.wait_all_sfp_ready() + mock_sfp.is_sw_control.side_effect = Exception('') + assert not updater.wait_all_sfp_ready() + + @mock.patch('sonic_platform.utils.read_int_from_file') + def test_update_asic(self, mock_read): + mock_read.return_value = 8 + updater = ThermalUpdater(None) + assert updater.get_asic_temp() == 1000 + assert updater.get_asic_temp_warning_threashold() == 1000 + assert updater.get_asic_temp_critical_threashold() == 1000 + updater.update_asic() + hw_management_independent_mode_update.thermal_data_set_asic.assert_called_once() + + mock_read.return_value = None + assert updater.get_asic_temp() is None + assert updater.get_asic_temp_warning_threashold() == ASIC_DEFAULT_TEMP_WARNNING_THRESHOLD + assert updater.get_asic_temp_critical_threashold() == ASIC_DEFAULT_TEMP_CRITICAL_THRESHOLD + + def test_update_module(self): + mock_sfp = mock.MagicMock() + mock_sfp.sdk_index = 10 + mock_sfp.get_presence = mock.MagicMock(return_value=True) + mock_sfp.get_temperature = mock.MagicMock(return_value=55.0) + mock_sfp.get_temperature_warning_threashold = mock.MagicMock(return_value=70.0) + mock_sfp.get_temperature_critical_threashold = mock.MagicMock(return_value=80.0) + updater = ThermalUpdater([mock_sfp]) + updater.update_module() + hw_management_independent_mode_update.thermal_data_set_module.assert_called_once_with(0, 11, 55000, 80000, 70000, 0) + + mock_sfp.get_temperature = mock.MagicMock(return_value=0.0) + hw_management_independent_mode_update.reset_mock() + updater.update_module() + hw_management_independent_mode_update.thermal_data_set_module.assert_called_once_with(0, 11, 0, 0, 0, 0) + + mock_sfp.get_presence = mock.MagicMock(return_value=False) + updater.update_module() + hw_management_independent_mode_update.thermal_data_clean_module.assert_called_once_with(0, 11) diff --git a/platform/mellanox/mlnx-platform-api/tests/test_utils.py b/platform/mellanox/mlnx-platform-api/tests/test_utils.py index 04b00f82f4f9..2a186de7e5b0 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_utils.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_utils.py @@ -191,6 +191,26 @@ def test_read_key_value_file(self): mock_os_open = mock.mock_open(read_data='a:b') with mock.patch('sonic_platform.utils.open', mock_os_open): assert utils.read_key_value_file('some_file') == {'a':'b'} + mock_os_open = mock.mock_open(read_data='a=b') with mock.patch('sonic_platform.utils.open', mock_os_open): assert utils.read_key_value_file('some_file', delimeter='=') == {'a':'b'} + + def test_timer(self): + timer = utils.Timer() + timer.start() + mock_cb_1000_run_now = mock.MagicMock() + mock_cb_1000_run_future = mock.MagicMock() + mock_cb_1_run_future_once = mock.MagicMock() + mock_cb_1_run_future_repeat = mock.MagicMock() + timer.schedule(1000, cb=mock_cb_1000_run_now, repeat=False, run_now=True) + timer.schedule(1000, cb=mock_cb_1000_run_future, repeat=False, run_now=False) + timer.schedule(1, cb=mock_cb_1_run_future_once, repeat=False, run_now=False) + timer.schedule(1, cb=mock_cb_1_run_future_repeat, repeat=True, run_now=False) + time.sleep(3) + timer.stop() + + mock_cb_1000_run_now.assert_called_once() + mock_cb_1000_run_future.assert_not_called() + mock_cb_1_run_future_once.assert_called_once() + assert mock_cb_1_run_future_repeat.call_count > 1 From 767944d7da41cda1c950b92adde1f26404eb1b78 Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Thu, 14 Dec 2023 18:01:11 +0800 Subject: [PATCH 055/419] [Mellanox] Fix race condition while creating SFP (#17441) - Why I did it Fix issue xcvrd crashes due to cannot import name 'initialize_sfp_thermal': Nov 27 09:47:16.388639 sonic ERR pmon#xcvrd: Exception occured at CmisManagerTask thread due to ImportError("cannot import name 'initialize_sfp_thermal' from partially initialized module 'sonic_platform.thermal' (most likely due to a circular import) (/usr/local/lib/python3.9/dist-packages/sonic_platform/thermal.py)") - How I did it Add lock for creating SFP object - How to verify it Unit test Manual Test --- .../sonic_platform/chassis.py | 70 +++++++++++-------- .../mlnx-platform-api/tests/test_chassis.py | 26 +++++++ 2 files changed, 67 insertions(+), 29 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py b/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py index f0b73de66c34..5870d7e6b602 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py @@ -124,6 +124,7 @@ def __init__(self): self.reboot_cause_initialized = False self.sfp_module = None + self.sfp_lock = threading.Lock() # Build the RJ45 port list from platform.json and hwsku.json self._RJ45_port_inited = False @@ -277,38 +278,49 @@ def _import_sfp_module(self): def initialize_single_sfp(self, index): sfp_count = self.get_num_sfps() + # Use double checked locking mechanism for: + # 1. protect shared resource self._sfp_list + # 2. performance (avoid locking every time) if index < sfp_count: - if not self._sfp_list: - self._sfp_list = [None] * sfp_count - - if not self._sfp_list[index]: - sfp_module = self._import_sfp_module() - if self.RJ45_port_list and index in self.RJ45_port_list: - self._sfp_list[index] = sfp_module.RJ45Port(index) - else: - self._sfp_list[index] = sfp_module.SFP(index) - self.sfp_initialized_count += 1 + if not self._sfp_list or not self._sfp_list[index]: + with self.sfp_lock: + if not self._sfp_list: + self._sfp_list = [None] * sfp_count + + if not self._sfp_list[index]: + sfp_module = self._import_sfp_module() + if self.RJ45_port_list and index in self.RJ45_port_list: + self._sfp_list[index] = sfp_module.RJ45Port(index) + else: + self._sfp_list[index] = sfp_module.SFP(index) + self.sfp_initialized_count += 1 def initialize_sfp(self): - if not self._sfp_list: - sfp_module = self._import_sfp_module() - sfp_count = self.get_num_sfps() - for index in range(sfp_count): - if self.RJ45_port_list and index in self.RJ45_port_list: - sfp_object = sfp_module.RJ45Port(index) - else: - sfp_object = sfp_module.SFP(index) - self._sfp_list.append(sfp_object) - self.sfp_initialized_count = sfp_count - elif self.sfp_initialized_count != len(self._sfp_list): - sfp_module = self._import_sfp_module() - for index in range(len(self._sfp_list)): - if self._sfp_list[index] is None: - if self.RJ45_port_list and index in self.RJ45_port_list: - self._sfp_list[index] = sfp_module.RJ45Port(index) - else: - self._sfp_list[index] = sfp_module.SFP(index) - self.sfp_initialized_count = len(self._sfp_list) + sfp_count = self.get_num_sfps() + # Use double checked locking mechanism for: + # 1. protect shared resource self._sfp_list + # 2. performance (avoid locking every time) + if sfp_count != self.sfp_initialized_count: + with self.sfp_lock: + if sfp_count != self.sfp_initialized_count: + if not self._sfp_list: + sfp_module = self._import_sfp_module() + for index in range(sfp_count): + if self.RJ45_port_list and index in self.RJ45_port_list: + sfp_object = sfp_module.RJ45Port(index) + else: + sfp_object = sfp_module.SFP(index) + self._sfp_list.append(sfp_object) + self.sfp_initialized_count = sfp_count + elif self.sfp_initialized_count != len(self._sfp_list): + sfp_module = self._import_sfp_module() + for index in range(len(self._sfp_list)): + if self._sfp_list[index] is None: + if self.RJ45_port_list and index in self.RJ45_port_list: + self._sfp_list[index] = sfp_module.RJ45Port(index) + else: + self._sfp_list[index] = sfp_module.SFP(index) + self.sfp_initialized_count = len(self._sfp_list) def get_num_sfps(self): """ diff --git a/platform/mellanox/mlnx-platform-api/tests/test_chassis.py b/platform/mellanox/mlnx-platform-api/tests/test_chassis.py index fce9bd00b0ee..ffe86aaf3d08 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_chassis.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_chassis.py @@ -16,8 +16,10 @@ # import os +import random import sys import subprocess +import threading from mock import MagicMock if sys.version_info.major == 3: @@ -167,6 +169,30 @@ def test_sfp(self): assert len(sfp_list) == 3 assert chassis.sfp_initialized_count == 3 + def test_create_sfp_in_multi_thread(self): + DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=3) + + iteration_num = 100 + while iteration_num > 0: + chassis = Chassis() + assert chassis.sfp_initialized_count == 0 + t1 = threading.Thread(target=lambda: chassis.get_sfp(1)) + t2 = threading.Thread(target=lambda: chassis.get_sfp(1)) + t3 = threading.Thread(target=lambda: chassis.get_all_sfps()) + t4 = threading.Thread(target=lambda: chassis.get_all_sfps()) + threads = [t1, t2, t3, t4] + random.shuffle(threads) + for t in threads: + t.start() + for t in threads: + t.join() + assert len(chassis.get_all_sfps()) == 3 + assert chassis.sfp_initialized_count == 3 + for index, s in enumerate(chassis.get_all_sfps()): + assert s.sdk_index == index + iteration_num -= 1 + + @mock.patch('sonic_platform.device_data.DeviceDataManager.get_sfp_count', MagicMock(return_value=3)) def test_change_event(self): chassis = Chassis() From 88ee9f78c2a79261f16696a56dfc94aab3c04531 Mon Sep 17 00:00:00 2001 From: "Marty Y. Lok" <76118573+mlok-nokia@users.noreply.github.com> Date: Mon, 8 Jan 2024 14:39:30 -0500 Subject: [PATCH 056/419] [Nokia-IXR7250E] Modify the platform_reboot on the IXR7250E for PMON API reboot and Disable all SFPs (#17483) Why I did it When Supervisor card is rebooted by using PMON API, it takes about 90 seconds to trigger the shutdown in down path. At this time linecards have been up. This delays linecards database initialization which is trying to PING/PONG the database-chassis. To address this issue, we modified the NDK to use the system call with "sudo reboot" when the request is from PMON API on Supervisor case. The NDK version is 22.9.20 and greater. This new NDK requires this modifcaiton of platform_reboot to work with. Work item tracking Microsoft ADO (number only): 26365734 How I did it Modify the platform_reboot In Supervisor not to reboot all IMMs since it has been done in the function reboot() in module.py. Also handle the reboot-cause.txt for on the Supervisor when the reboot is request from PMON API. Modify the Nokia platform specific platform_reboot in linecard to disable all SPFs. This PR works with NDK version 22.9.20 and above Signed-off-by: mlok --- .../platform_reboot | 4 +++ .../platform_reboot | 34 ++++++++++++++++--- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform_reboot b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform_reboot index 43aace70f7ee..eb0bebef0e54 100755 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform_reboot +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform_reboot @@ -17,6 +17,10 @@ update_reboot_cause() sync } +echo "Disable all SFPs" +python3 -c 'import sonic_platform.platform; platform_chassis = sonic_platform.platform.Platform().get_chassis(); platform_chassis.tx_disable_all_sfps()' +sleep 3 + # update the reboot_cuase file when reboot is trigger by device-mgr update_reboot_cause diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/platform_reboot b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/platform_reboot index 00ae76c9de86..dc4f934339c9 100755 --- a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/platform_reboot +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/platform_reboot @@ -1,15 +1,39 @@ #!/bin/bash -echo "Rebooting all Linecards" -python3 -c 'import sonic_platform.platform; platform_chassis = sonic_platform.platform.Platform().get_chassis(); platform_chassis.reboot_imms()' -sleep 3 + +DEVICE_MGR_REBOOT_FILE="/tmp/device_mgr_reboot" + +update_reboot_cause() +{ + DEVICE_MGR_REBOOT_FILE=/tmp/device_mgr_reboot + REBOOT_CAUSE_FILE=/host/reboot-cause/reboot-cause.txt + DEVICE_REBOOT_CAUSE_FILE=/etc/opt/srlinux/reboot-cause.txt + if [ -e $DEVICE_MGR_REBOOT_FILE ]; then + if [ -e $DEVICE_REBOOT_CAUSE_FILE ]; then + cp -f $DEVICE_REBOOT_CAUSE_FILE $REBOOT_CAUSE_FILE + fi + rm -f $DEVICE_MGR_REBOOT_FILE + else + touch /etc/opt/srlinux/devmgr_reboot_cause.done + rm -f $DEVICE_REBOOT_CAUSE_FILE &> /dev/null + fi + sync +} + +if [ ! -e $DEVICE_MGR_REBOOT_FILE ]; then + echo "Rebooting all Linecards" + python3 -c 'import sonic_platform.platform; platform_chassis = sonic_platform.platform.Platform().get_chassis(); platform_chassis.reboot_imms()' + sleep 3 +fi + +# update the reboot_cuase file when reboot is trigger by device-mgr +update_reboot_cause + systemctl stop nokia-watchdog.service sleep 2 echo "w" > /dev/watchdog kick_date=`date -u` echo "last watchdog kick $kick_date" > /var/log/nokia-watchdog-last.log rm -f /sys/firmware/efi/efivars/dump-* -touch /etc/opt/srlinux/devmgr_reboot_cause.done -rm -f /etc/opt/srlinux/reboot-cause.txt echo "Shutdown midplane" ifconfig xe0 down sync From bcdbaf1039343a448c43227d32f36c97263f2a38 Mon Sep 17 00:00:00 2001 From: snider-nokia <76123698+snider-nokia@users.noreply.github.com> Date: Mon, 8 Jan 2024 14:38:46 -0500 Subject: [PATCH 057/419] [Nokia][sonic-platform] Update Nokia sonic-platform submodule and device data (#17378) These changes, in conjunction with NDK version >= 22.9.17 address the thermal logging issues discussed at Nokia-ION/ndk#27. While the changes contained at this PR do not require coupling to NDK version >= 22.9.17, thermal logging enhancements will not be available without updated NDK >= 22.9.17. Thus, coupling with NDK >=22.9.17 is preferred and recommended. Why I did it To address thermal logging deficiencies. Work item tracking Microsoft ADO (number only): 26365734 How I did it The following changes are included: Threshold configuration values are provided in the associated device data .json files. There is also a change included to better handle the condition where an SFP module read fails. Modify the module.py reboot to support reboot linecard from Supervisor - Modify reboot to call _reboot_imm for single IMM card reboot - Add log to the ndk_cmd to log the operation of "reboot-linecard" and "shutdown/satrtup the sfm" Add new nokia_cmd set command and modify show ndk-status output - Add a new function reboot_imm() to nokia_common.py to support reboot a single IMM slot from CPM - Added new command: nokia_cmd set reboot-linecard [forece] for CPM - Append a new column "RebootStatus" at the end of output of "nokia_cmd show ndk-status" - Provide ability for IMM to disable all transceiver module TX at reboot time - Remove defunct xcvr-resync service --- .../platform_ndk.json | 22 ++++++++++++++++++- .../platform_ndk.json | 20 +++++++++++++++++ .../broadcom/sonic-platform-modules-nokia | 2 +- 3 files changed, 42 insertions(+), 2 deletions(-) diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform_ndk.json b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform_ndk.json index 4fbd84df39b6..f444a14a843c 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform_ndk.json +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform_ndk.json @@ -14,7 +14,7 @@ }, { "key": "monitor_action", - "stringval": "warn" + "stringval": "reboot" }, { "key": "grpc_thermal_monitor", @@ -43,6 +43,26 @@ { "key": "sonic_log_level", "stringval": "debug" + }, + { + "key": "thermal_low_margin_threshold", + "intval": 10 + }, + { + "key": "thermal_log_current_threshold", + "intval": 2 + }, + { + "key": "thermal_log_margin_threshold", + "intval": 2 + }, + { + "key": "thermal_log_min_threshold", + "intval": 2 + }, + { + "key": "thermal_log_max_threshold", + "intval": 1 } ] } diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/platform_ndk.json b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/platform_ndk.json index dddefb0bcf73..9d68aacc59cd 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/platform_ndk.json +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/platform_ndk.json @@ -31,6 +31,26 @@ { "key": "sonic_log_level", "stringval": "debug" + }, + { + "key": "thermal_low_margin_threshold", + "intval": 10 + }, + { + "key": "thermal_log_current_threshold", + "intval": 3 + }, + { + "key": "thermal_log_margin_threshold", + "intval": 3 + }, + { + "key": "thermal_log_min_threshold", + "intval": 5 + }, + { + "key": "thermal_log_max_threshold", + "intval": 1 } ] } diff --git a/platform/broadcom/sonic-platform-modules-nokia b/platform/broadcom/sonic-platform-modules-nokia index 6b07af449c4b..e82caa40d4ee 160000 --- a/platform/broadcom/sonic-platform-modules-nokia +++ b/platform/broadcom/sonic-platform-modules-nokia @@ -1 +1 @@ -Subproject commit 6b07af449c4b40e2a80e3154347ca0308817ebd5 +Subproject commit e82caa40d4eec59e574bd4acffb0e92fd7187da4 From 4b6feaa69c87aeb90ea8cca47d9db334e31593dc Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Wed, 20 Dec 2023 15:12:03 +0800 Subject: [PATCH 058/419] Optimize syslog rate limit feature for fast and warm boot (#17458) - Why I did it Optimize syslog rate limit feature for fast and warm boot - How I did it Optimize redis start time Don't render rsyslog.conf in container startup script Disable containercfgd by default. There is a new CLI to enable it (in another PR) - How to verify it Manual test Regression test --- dockers/docker-base-bullseye/Dockerfile.j2 | 2 +- dockers/docker-base-bullseye/etc/rsyslog.conf | 78 ++++++++++++++++ dockers/docker-base-buster/Dockerfile.j2 | 2 +- dockers/docker-base-buster/etc/rsyslog.conf | 78 ++++++++++++++++ .../etc/supervisor/containercfgd.conf | 9 -- dockers/docker-base-stretch/Dockerfile.j2 | 2 +- dockers/docker-base-stretch/etc/rsyslog.conf | 78 ++++++++++++++++ .../etc/supervisor/containercfgd.conf | 9 -- dockers/docker-base/Dockerfile.j2 | 2 +- dockers/docker-base/etc/rsyslog.conf | 78 ++++++++++++++++ .../etc/supervisor/containercfgd.conf | 9 -- dockers/docker-database/supervisord.conf.j2 | 4 +- dockers/docker-platform-monitor/Dockerfile.j2 | 1 + .../docker-platform-monitor/etc/rsyslog.conf | 88 +++++++++++++++++++ files/build_templates/docker_image_ctl.j2 | 38 ++++---- .../build_templates/sonic_debian_extension.j2 | 3 + .../containercfgd}/containercfgd.conf | 0 .../rsyslog/rsyslog-container.conf.j2 | 17 ++-- .../containercfgd/containercfgd.py | 20 ++--- .../tests/test_config_daemon.py | 3 + .../tests/test_syslog_config.py | 11 +-- 21 files changed, 454 insertions(+), 78 deletions(-) create mode 100644 dockers/docker-base-bullseye/etc/rsyslog.conf create mode 100644 dockers/docker-base-buster/etc/rsyslog.conf delete mode 100644 dockers/docker-base-buster/etc/supervisor/containercfgd.conf create mode 100644 dockers/docker-base-stretch/etc/rsyslog.conf delete mode 100644 dockers/docker-base-stretch/etc/supervisor/containercfgd.conf create mode 100644 dockers/docker-base/etc/rsyslog.conf delete mode 100644 dockers/docker-base/etc/supervisor/containercfgd.conf create mode 100644 dockers/docker-platform-monitor/etc/rsyslog.conf rename {dockers/docker-base-bullseye/etc/supervisor => files/image_config/containercfgd}/containercfgd.conf (100%) diff --git a/dockers/docker-base-bullseye/Dockerfile.j2 b/dockers/docker-base-bullseye/Dockerfile.j2 index 1fa7196ea67c..b31e986e770d 100644 --- a/dockers/docker-base-bullseye/Dockerfile.j2 +++ b/dockers/docker-base-bullseye/Dockerfile.j2 @@ -119,10 +119,10 @@ RUN apt-get clean -y && \ apt-get autoremove -y && \ rm -rf /var/lib/apt/lists/* /tmp/* ~/.cache +COPY ["etc/rsyslog.conf", "/etc/rsyslog.conf"] COPY ["etc/rsyslog.d/*", "/etc/rsyslog.d/"] COPY ["root/.vimrc", "/root/.vimrc"] RUN ln /usr/bin/vim.tiny /usr/bin/vim COPY ["etc/supervisor/supervisord.conf", "/etc/supervisor/"] -COPY ["etc/supervisor/containercfgd.conf", "/etc/supervisor/conf.d/"] diff --git a/dockers/docker-base-bullseye/etc/rsyslog.conf b/dockers/docker-base-bullseye/etc/rsyslog.conf new file mode 100644 index 000000000000..7a6667d68a13 --- /dev/null +++ b/dockers/docker-base-bullseye/etc/rsyslog.conf @@ -0,0 +1,78 @@ +# +# /etc/rsyslog.conf Configuration file for rsyslog. +# +# For more information see +# /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html + + +################# +#### MODULES #### +################# + +$ModLoad imuxsock # provides support for local system logging + +# +# Set a rate limit on messages from the container +# +$SystemLogRateLimitInterval 300 +$SystemLogRateLimitBurst 20000 + +#$ModLoad imklog # provides kernel logging support +#$ModLoad immark # provides --MARK-- message capability + +# provides UDP syslog reception +#$ModLoad imudp +#$UDPServerRun 514 + +# provides TCP syslog reception +#$ModLoad imtcp +#$InputTCPServerRun 514 + + +########################### +#### GLOBAL DIRECTIVES #### +########################### + +set $.CONTAINER_NAME=getenv("CONTAINER_NAME"); + +# Set remote syslog server +template (name="ForwardFormatInContainer" type="string" string="<%PRI%>%TIMESTAMP:::date-rfc3339% %HOSTNAME% %$.CONTAINER_NAME%#%syslogtag%%msg:::sp-if-no-1st-sp%%msg%") +*.* action(type="omfwd" target=`echo $SYSLOG_TARGET_IP` port="514" protocol="udp" Template="ForwardFormatInContainer") + +# +# Use traditional timestamp format. +# To enable high precision timestamps, comment out the following line. +# +#$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat + +# Define a custom template +$template SONiCFileFormat,"%TIMESTAMP%.%timestamp:::date-subseconds% %HOSTNAME% %syslogseverity-text:::uppercase% %$.CONTAINER_NAME%#%syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n" +$ActionFileDefaultTemplate SONiCFileFormat + +# +# Set the default permissions for all log files. +# +$FileOwner root +$FileGroup adm +$FileCreateMode 0640 +$DirCreateMode 0755 +$Umask 0022 + +# +# Where to place spool and state files +# +$WorkDirectory /var/spool/rsyslog + +# +# Include all config files in /etc/rsyslog.d/ +# +$IncludeConfig /etc/rsyslog.d/*.conf + +# +# Suppress duplicate messages and report "message repeated n times" +# +$RepeatedMsgReduction on + +############### +#### RULES #### +############### \ No newline at end of file diff --git a/dockers/docker-base-buster/Dockerfile.j2 b/dockers/docker-base-buster/Dockerfile.j2 index c05973510fea..a4139eaa3f11 100644 --- a/dockers/docker-base-buster/Dockerfile.j2 +++ b/dockers/docker-base-buster/Dockerfile.j2 @@ -118,10 +118,10 @@ RUN apt-get clean -y && \ apt-get autoremove -y && \ rm -rf /var/lib/apt/lists/* /tmp/* ~/.cache/ +COPY ["etc/rsyslog.conf", "/etc/rsyslog.conf"] COPY ["etc/rsyslog.d/*", "/etc/rsyslog.d/"] COPY ["root/.vimrc", "/root/.vimrc"] RUN ln /usr/bin/vim.tiny /usr/bin/vim COPY ["etc/supervisor/supervisord.conf", "/etc/supervisor/"] -COPY ["etc/supervisor/containercfgd.conf", "/etc/supervisor/conf.d/"] diff --git a/dockers/docker-base-buster/etc/rsyslog.conf b/dockers/docker-base-buster/etc/rsyslog.conf new file mode 100644 index 000000000000..7a6667d68a13 --- /dev/null +++ b/dockers/docker-base-buster/etc/rsyslog.conf @@ -0,0 +1,78 @@ +# +# /etc/rsyslog.conf Configuration file for rsyslog. +# +# For more information see +# /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html + + +################# +#### MODULES #### +################# + +$ModLoad imuxsock # provides support for local system logging + +# +# Set a rate limit on messages from the container +# +$SystemLogRateLimitInterval 300 +$SystemLogRateLimitBurst 20000 + +#$ModLoad imklog # provides kernel logging support +#$ModLoad immark # provides --MARK-- message capability + +# provides UDP syslog reception +#$ModLoad imudp +#$UDPServerRun 514 + +# provides TCP syslog reception +#$ModLoad imtcp +#$InputTCPServerRun 514 + + +########################### +#### GLOBAL DIRECTIVES #### +########################### + +set $.CONTAINER_NAME=getenv("CONTAINER_NAME"); + +# Set remote syslog server +template (name="ForwardFormatInContainer" type="string" string="<%PRI%>%TIMESTAMP:::date-rfc3339% %HOSTNAME% %$.CONTAINER_NAME%#%syslogtag%%msg:::sp-if-no-1st-sp%%msg%") +*.* action(type="omfwd" target=`echo $SYSLOG_TARGET_IP` port="514" protocol="udp" Template="ForwardFormatInContainer") + +# +# Use traditional timestamp format. +# To enable high precision timestamps, comment out the following line. +# +#$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat + +# Define a custom template +$template SONiCFileFormat,"%TIMESTAMP%.%timestamp:::date-subseconds% %HOSTNAME% %syslogseverity-text:::uppercase% %$.CONTAINER_NAME%#%syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n" +$ActionFileDefaultTemplate SONiCFileFormat + +# +# Set the default permissions for all log files. +# +$FileOwner root +$FileGroup adm +$FileCreateMode 0640 +$DirCreateMode 0755 +$Umask 0022 + +# +# Where to place spool and state files +# +$WorkDirectory /var/spool/rsyslog + +# +# Include all config files in /etc/rsyslog.d/ +# +$IncludeConfig /etc/rsyslog.d/*.conf + +# +# Suppress duplicate messages and report "message repeated n times" +# +$RepeatedMsgReduction on + +############### +#### RULES #### +############### \ No newline at end of file diff --git a/dockers/docker-base-buster/etc/supervisor/containercfgd.conf b/dockers/docker-base-buster/etc/supervisor/containercfgd.conf deleted file mode 100644 index 704b5490c3fb..000000000000 --- a/dockers/docker-base-buster/etc/supervisor/containercfgd.conf +++ /dev/null @@ -1,9 +0,0 @@ -[program:containercfgd] -command=python3 /usr/local/bin/containercfgd -priority=99 -autostart=false -autorestart=unexpected -stdout_logfile=syslog -stderr_logfile=syslog -dependent_startup=true -dependent_startup_wait_for=rsyslogd:running diff --git a/dockers/docker-base-stretch/Dockerfile.j2 b/dockers/docker-base-stretch/Dockerfile.j2 index 8963024d17ae..652ca11e205c 100644 --- a/dockers/docker-base-stretch/Dockerfile.j2 +++ b/dockers/docker-base-stretch/Dockerfile.j2 @@ -114,10 +114,10 @@ RUN apt-get clean -y && \ apt-get autoremove -y && \ rm -rf /var/lib/apt/lists/* /tmp/* +COPY ["etc/rsyslog.conf", "/etc/rsyslog.conf"] COPY ["etc/rsyslog.d/*", "/etc/rsyslog.d/"] COPY ["root/.vimrc", "/root/.vimrc"] RUN ln /usr/bin/vim.tiny /usr/bin/vim COPY ["etc/supervisor/supervisord.conf", "/etc/supervisor/"] -COPY ["etc/supervisor/containercfgd.conf", "/etc/supervisor/conf.d/"] diff --git a/dockers/docker-base-stretch/etc/rsyslog.conf b/dockers/docker-base-stretch/etc/rsyslog.conf new file mode 100644 index 000000000000..7a6667d68a13 --- /dev/null +++ b/dockers/docker-base-stretch/etc/rsyslog.conf @@ -0,0 +1,78 @@ +# +# /etc/rsyslog.conf Configuration file for rsyslog. +# +# For more information see +# /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html + + +################# +#### MODULES #### +################# + +$ModLoad imuxsock # provides support for local system logging + +# +# Set a rate limit on messages from the container +# +$SystemLogRateLimitInterval 300 +$SystemLogRateLimitBurst 20000 + +#$ModLoad imklog # provides kernel logging support +#$ModLoad immark # provides --MARK-- message capability + +# provides UDP syslog reception +#$ModLoad imudp +#$UDPServerRun 514 + +# provides TCP syslog reception +#$ModLoad imtcp +#$InputTCPServerRun 514 + + +########################### +#### GLOBAL DIRECTIVES #### +########################### + +set $.CONTAINER_NAME=getenv("CONTAINER_NAME"); + +# Set remote syslog server +template (name="ForwardFormatInContainer" type="string" string="<%PRI%>%TIMESTAMP:::date-rfc3339% %HOSTNAME% %$.CONTAINER_NAME%#%syslogtag%%msg:::sp-if-no-1st-sp%%msg%") +*.* action(type="omfwd" target=`echo $SYSLOG_TARGET_IP` port="514" protocol="udp" Template="ForwardFormatInContainer") + +# +# Use traditional timestamp format. +# To enable high precision timestamps, comment out the following line. +# +#$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat + +# Define a custom template +$template SONiCFileFormat,"%TIMESTAMP%.%timestamp:::date-subseconds% %HOSTNAME% %syslogseverity-text:::uppercase% %$.CONTAINER_NAME%#%syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n" +$ActionFileDefaultTemplate SONiCFileFormat + +# +# Set the default permissions for all log files. +# +$FileOwner root +$FileGroup adm +$FileCreateMode 0640 +$DirCreateMode 0755 +$Umask 0022 + +# +# Where to place spool and state files +# +$WorkDirectory /var/spool/rsyslog + +# +# Include all config files in /etc/rsyslog.d/ +# +$IncludeConfig /etc/rsyslog.d/*.conf + +# +# Suppress duplicate messages and report "message repeated n times" +# +$RepeatedMsgReduction on + +############### +#### RULES #### +############### \ No newline at end of file diff --git a/dockers/docker-base-stretch/etc/supervisor/containercfgd.conf b/dockers/docker-base-stretch/etc/supervisor/containercfgd.conf deleted file mode 100644 index 8d938e6f0ff3..000000000000 --- a/dockers/docker-base-stretch/etc/supervisor/containercfgd.conf +++ /dev/null @@ -1,9 +0,0 @@ -[program:containercfgd] -command=python /usr/local/bin/containercfgd -priority=99 -autostart=false -autorestart=unexpected -stdout_logfile=syslog -stderr_logfile=syslog -dependent_startup=true -dependent_startup_wait_for=rsyslogd:running diff --git a/dockers/docker-base/Dockerfile.j2 b/dockers/docker-base/Dockerfile.j2 index 66fab19016dd..45e91fbab967 100644 --- a/dockers/docker-base/Dockerfile.j2 +++ b/dockers/docker-base/Dockerfile.j2 @@ -50,6 +50,7 @@ RUN apt-get -y install \ rsyslog \ less +COPY ["etc/rsyslog.conf", "/etc/rsyslog.conf"] COPY ["etc/rsyslog.d/*", "/etc/rsyslog.d/"] COPY ["root/.vimrc", "/root/.vimrc"] @@ -68,7 +69,6 @@ RUN mkdir -p /etc/supervisor/conf.d RUN mkdir -p /var/log/supervisor COPY ["etc/supervisor/supervisord.conf", "/etc/supervisor/"] -COPY ["etc/supervisor/containercfgd.conf", "/etc/supervisor/conf.d/"] RUN apt-get -y purge \ exim4 \ diff --git a/dockers/docker-base/etc/rsyslog.conf b/dockers/docker-base/etc/rsyslog.conf new file mode 100644 index 000000000000..7a6667d68a13 --- /dev/null +++ b/dockers/docker-base/etc/rsyslog.conf @@ -0,0 +1,78 @@ +# +# /etc/rsyslog.conf Configuration file for rsyslog. +# +# For more information see +# /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html + + +################# +#### MODULES #### +################# + +$ModLoad imuxsock # provides support for local system logging + +# +# Set a rate limit on messages from the container +# +$SystemLogRateLimitInterval 300 +$SystemLogRateLimitBurst 20000 + +#$ModLoad imklog # provides kernel logging support +#$ModLoad immark # provides --MARK-- message capability + +# provides UDP syslog reception +#$ModLoad imudp +#$UDPServerRun 514 + +# provides TCP syslog reception +#$ModLoad imtcp +#$InputTCPServerRun 514 + + +########################### +#### GLOBAL DIRECTIVES #### +########################### + +set $.CONTAINER_NAME=getenv("CONTAINER_NAME"); + +# Set remote syslog server +template (name="ForwardFormatInContainer" type="string" string="<%PRI%>%TIMESTAMP:::date-rfc3339% %HOSTNAME% %$.CONTAINER_NAME%#%syslogtag%%msg:::sp-if-no-1st-sp%%msg%") +*.* action(type="omfwd" target=`echo $SYSLOG_TARGET_IP` port="514" protocol="udp" Template="ForwardFormatInContainer") + +# +# Use traditional timestamp format. +# To enable high precision timestamps, comment out the following line. +# +#$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat + +# Define a custom template +$template SONiCFileFormat,"%TIMESTAMP%.%timestamp:::date-subseconds% %HOSTNAME% %syslogseverity-text:::uppercase% %$.CONTAINER_NAME%#%syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n" +$ActionFileDefaultTemplate SONiCFileFormat + +# +# Set the default permissions for all log files. +# +$FileOwner root +$FileGroup adm +$FileCreateMode 0640 +$DirCreateMode 0755 +$Umask 0022 + +# +# Where to place spool and state files +# +$WorkDirectory /var/spool/rsyslog + +# +# Include all config files in /etc/rsyslog.d/ +# +$IncludeConfig /etc/rsyslog.d/*.conf + +# +# Suppress duplicate messages and report "message repeated n times" +# +$RepeatedMsgReduction on + +############### +#### RULES #### +############### \ No newline at end of file diff --git a/dockers/docker-base/etc/supervisor/containercfgd.conf b/dockers/docker-base/etc/supervisor/containercfgd.conf deleted file mode 100644 index 8d938e6f0ff3..000000000000 --- a/dockers/docker-base/etc/supervisor/containercfgd.conf +++ /dev/null @@ -1,9 +0,0 @@ -[program:containercfgd] -command=python /usr/local/bin/containercfgd -priority=99 -autostart=false -autorestart=unexpected -stdout_logfile=syslog -stderr_logfile=syslog -dependent_startup=true -dependent_startup_wait_for=rsyslogd:running diff --git a/dockers/docker-database/supervisord.conf.j2 b/dockers/docker-database/supervisord.conf.j2 index 4d9172797252..b71a4c59dbef 100644 --- a/dockers/docker-database/supervisord.conf.j2 +++ b/dockers/docker-database/supervisord.conf.j2 @@ -39,12 +39,10 @@ dependent_startup=true command=/bin/bash -c "{ [[ -s /var/lib/{{ redis_inst }}/dump.rdb ]] || rm -f /var/lib/{{ redis_inst }}/dump.rdb; } && mkdir -p /var/lib/{{ redis_inst }} && exec /usr/bin/redis-server /etc/redis/redis.conf --bind {{ LOOPBACK_IP }} {{ redis_items['hostname'] }} --port {{ redis_items['port'] }} --unixsocket {{ redis_items['unix_socket_path'] }} --pidfile /var/run/redis/{{ redis_inst }}.pid --dir /var/lib/{{ redis_inst }}" priority=2 user=redis -autostart=false +autostart=true autorestart=false stdout_logfile=syslog stderr_logfile=syslog -dependent_startup=true -dependent_startup_wait_for=rsyslogd:running {% endfor %} {% endif %} diff --git a/dockers/docker-platform-monitor/Dockerfile.j2 b/dockers/docker-platform-monitor/Dockerfile.j2 index de1bdb62059e..49f846bc0e82 100755 --- a/dockers/docker-platform-monitor/Dockerfile.j2 +++ b/dockers/docker-platform-monitor/Dockerfile.j2 @@ -89,6 +89,7 @@ COPY ["docker-pmon.supervisord.conf.j2", "docker_init.j2", "/usr/share/sonic/tem COPY ["ssd_tools/*", "/usr/bin/"] COPY ["files/supervisor-proc-exit-listener", "/usr/bin"] COPY ["critical_processes", "/etc/supervisor"] +COPY ["etc/rsyslog.conf", "/etc/rsyslog.conf"] RUN sonic-cfggen -a "{\"CONFIGURED_PLATFORM\":\"{{CONFIGURED_PLATFORM}}\"}" -t /usr/share/sonic/templates/docker_init.j2 > /usr/bin/docker_init.sh RUN rm -f /usr/share/sonic/templates/docker_init.j2 diff --git a/dockers/docker-platform-monitor/etc/rsyslog.conf b/dockers/docker-platform-monitor/etc/rsyslog.conf new file mode 100644 index 000000000000..35815e5322a1 --- /dev/null +++ b/dockers/docker-platform-monitor/etc/rsyslog.conf @@ -0,0 +1,88 @@ +# +# /etc/rsyslog.conf Configuration file for rsyslog. +# +# For more information see +# /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html + + +################# +#### MODULES #### +################# + +$ModLoad imuxsock # provides support for local system logging + +# +# Set a rate limit on messages from the container +# +$SystemLogRateLimitInterval 300 +$SystemLogRateLimitBurst 20000 + +#$ModLoad imklog # provides kernel logging support +#$ModLoad immark # provides --MARK-- message capability + +# provides UDP syslog reception +#$ModLoad imudp +#$UDPServerRun 514 + +# provides TCP syslog reception +#$ModLoad imtcp +#$InputTCPServerRun 514 + + +########################### +#### GLOBAL DIRECTIVES #### +########################### + +set $.PLATFORM=getenv("PLATFORM"); +set $.CONTAINER_NAME=getenv("CONTAINER_NAME"); + +if ($.PLATFORM == "x86_64-mlnx_msn2700-r0" or $.PLATFORM == "x86_64-mlnx_msn2700a1-r0" or $.PLATFORM == "x86_64-mlnx_msn2410-r0") then { + +# This rsyslog configuration is intended to resolve the following error message that only appears on the MSN2700 and MSN2410 platforms: +# "ERR pmon#sensord: Error getting sensor data: dps460/#10: Can't read" +# This error is because of firmware issue with some type of PSU, we are not able to upgrade the FW online. +# Since there is no functional impact, this error log can be ignored safely. +if $programname contains "sensord" and $msg contains "Error getting sensor data: dps460/#" then stop +} + +# Set remote syslog server +template (name="ForwardFormatInContainer" type="string" string="<%PRI%>%TIMESTAMP:::date-rfc3339% %HOSTNAME% %$.CONTAINER_NAME%#%syslogtag%%msg:::sp-if-no-1st-sp%%msg%") +*.* action(type="omfwd" target=`echo $SYSLOG_TARGET_IP` port="514" protocol="udp" Template="ForwardFormatInContainer") + +# +# Use traditional timestamp format. +# To enable high precision timestamps, comment out the following line. +# +#$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat + +# Define a custom template +$template SONiCFileFormat,"%TIMESTAMP%.%timestamp:::date-subseconds% %HOSTNAME% %syslogseverity-text:::uppercase% %$.CONTAINER_NAME%#%syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n" +$ActionFileDefaultTemplate SONiCFileFormat + +# +# Set the default permissions for all log files. +# +$FileOwner root +$FileGroup adm +$FileCreateMode 0640 +$DirCreateMode 0755 +$Umask 0022 + +# +# Where to place spool and state files +# +$WorkDirectory /var/spool/rsyslog + +# +# Include all config files in /etc/rsyslog.d/ +# +$IncludeConfig /etc/rsyslog.d/*.conf + +# +# Suppress duplicate messages and report "message repeated n times" +# +$RepeatedMsgReduction on + +############### +#### RULES #### +############### \ No newline at end of file diff --git a/files/build_templates/docker_image_ctl.j2 b/files/build_templates/docker_image_ctl.j2 index 2b0a752c86ba..95c2e1fa52a8 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -34,27 +34,16 @@ function updateSyslogConf() # Also update the container name if [[ ($NUM_ASIC -gt 1) ]]; then TARGET_IP=$(docker network inspect bridge --format={{ "'{{(index .IPAM.Config 0).Gateway}}'" }}) - else - if [ "$CONTAINER_EXISTS" = "yes" ]; then - # database configuration has been synced to /etc/rsyslog.conf - # no need generate it to save boot time - return - fi - TARGET_IP="127.0.0.1" - fi - CONTAINER_NAME="$DOCKERNAME" - TMP_FILE="/tmp/rsyslog.$CONTAINER_NAME.conf" - {%- if docker_container_name == "database" %} - python -c "import jinja2, os; paths=['/usr/share/sonic/templates']; loader = jinja2.FileSystemLoader(paths); env = jinja2.Environment(loader=loader, trim_blocks=True); template_file='/usr/share/sonic/templates/rsyslog-container.conf.j2'; template = env.get_template(os.path.basename(template_file)); data=template.render({\"target_ip\":\"$TARGET_IP\",\"container_name\":\"$CONTAINER_NAME\"}); print(data)" > $TMP_FILE - {%- else %} - sonic-cfggen -d -t /usr/share/sonic/templates/rsyslog-container.conf.j2 -a "{\"target_ip\": \"$TARGET_IP\", \"container_name\": \"$CONTAINER_NAME\", \"platform\": \"$PLATFORM\" }" > $TMP_FILE - if [ $? -ne 0 ]; then - echo "Error: Execute sonic-cfggen -d failed. Execute without '-d'." - sonic-cfggen -t /usr/share/sonic/templates/rsyslog-container.conf.j2 -a "{\"target_ip\": \"$TARGET_IP\", \"container_name\": \"$CONTAINER_NAME\", \"platform\": \"$PLATFORM\" }" > $TMP_FILE + CONTAINER_NAME="$DOCKERNAME" + TMP_FILE="/tmp/rsyslog.$CONTAINER_NAME.conf" + {%- if docker_container_name == "database" %} + python -c "import jinja2, os; paths=['/usr/share/sonic/templates']; loader = jinja2.FileSystemLoader(paths); env = jinja2.Environment(loader=loader, trim_blocks=True); template_file='/usr/share/sonic/templates/rsyslog-container.conf.j2'; template = env.get_template(os.path.basename(template_file)); data=template.render({\"target_ip\":\"$TARGET_IP\",\"container_name\":\"$CONTAINER_NAME\"}); print(data)" > $TMP_FILE + {%- else %} + sonic-cfggen -t /usr/share/sonic/templates/rsyslog-container.conf.j2 -a "{\"target_ip\": \"$TARGET_IP\", \"container_name\": \"$CONTAINER_NAME\" }" > $TMP_FILE + {%- endif %} + docker cp $TMP_FILE ${DOCKERNAME}:/etc/rsyslog.conf + rm -rf $TMP_FILE fi - {%- endif %} - docker cp $TMP_FILE ${DOCKERNAME}:/etc/rsyslog.conf - rm -rf $TMP_FILE } function ebtables_config() { @@ -335,13 +324,18 @@ start() { # Obtain our platform as we will mount directories with these names in each docker PLATFORM=${PLATFORM:-`$SONIC_CFGGEN -H -v DEVICE_METADATA.localhost.platform`} - # Parse the device specific asic conf file, if it exists ASIC_CONF=/usr/share/sonic/device/$PLATFORM/asic.conf if [ -f "$ASIC_CONF" ]; then source $ASIC_CONF fi + # Default rsyslog target IP for single ASIC platform + SYSLOG_TARGET_IP=127.0.0.1 + if [[ ($NUM_ASIC -gt 1) ]]; then + SYSLOG_TARGET_IP=$(docker network inspect bridge --format={{ "'{{(index .IPAM.Config 0).Gateway}}'" }}) + fi + PLATFORM_ENV_CONF=/usr/share/sonic/device/$PLATFORM/platform_env.conf if [ -f "$PLATFORM_ENV_CONF" ]; then source $PLATFORM_ENV_CONF @@ -655,6 +649,8 @@ start() { --env "NAMESPACE_COUNT"="$NUM_ASIC" \ --env "DEV"="$DEV" \ --env "CONTAINER_NAME"=$DOCKERNAME \ + --env "SYSLOG_TARGET_IP"=$SYSLOG_TARGET_IP \ + --env "PLATFORM"=$PLATFORM \ --name=$DOCKERNAME \ {%- if docker_container_name == "gbsyncd" %} -v /var/run/docker-syncd$DEV:/var/run/sswsyncd \ diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 240ebfaa387b..71952b9c4af5 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -402,6 +402,9 @@ sudo cp $IMAGE_CONFIGS/rsyslog/rsyslog-container.conf.j2 $FILESYSTEM_ROOT_USR_SH sudo cp $IMAGE_CONFIGS/rsyslog/rsyslog.d/* $FILESYSTEM_ROOT/etc/rsyslog.d/ echo "rsyslog-config.service" | sudo tee -a $GENERATED_SERVICE_FILE +# Copy containercfgd configuration files +sudo cp $IMAGE_CONFIGS/containercfgd/containercfgd.conf $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/ + # Copy syslog override files sudo mkdir -p $FILESYSTEM_ROOT/etc/systemd/system/syslog.socket.d sudo cp $IMAGE_CONFIGS/syslog/override.conf $FILESYSTEM_ROOT/etc/systemd/system/syslog.socket.d/override.conf diff --git a/dockers/docker-base-bullseye/etc/supervisor/containercfgd.conf b/files/image_config/containercfgd/containercfgd.conf similarity index 100% rename from dockers/docker-base-bullseye/etc/supervisor/containercfgd.conf rename to files/image_config/containercfgd/containercfgd.conf diff --git a/files/image_config/rsyslog/rsyslog-container.conf.j2 b/files/image_config/rsyslog/rsyslog-container.conf.j2 index 4dff4695704a..eb13ddd7bb0b 100644 --- a/files/image_config/rsyslog/rsyslog-container.conf.j2 +++ b/files/image_config/rsyslog/rsyslog-container.conf.j2 @@ -52,21 +52,26 @@ $SystemLogRateLimitBurst 20000 ########################### #### GLOBAL DIRECTIVES #### ########################### + +set $.PLATFORM=getenv("PLATFORM"); +set $.CONTAINER_NAME=getenv("CONTAINER_NAME"); + {% if container_name == 'pmon' %} -{% if platform == 'x86_64-mlnx_msn2700-r0' or platform == 'x86_64-mlnx_msn2700a1-r0' or platform == 'x86_64-mlnx_msn2410-r0' %} # This rsyslog configuration is intended to resolve the following error message that only appears on the MSN2700 and MSN2410 platforms: # "ERR pmon#sensord: Error getting sensor data: dps460/#10: Can't read" # This error is because of firmware issue with some type of PSU, we are not able to upgrade the FW online. # Since there is no functional impact, this error log can be ignored safely. -if $programname contains "sensord" and $msg contains "Error getting sensor data: dps460/#" then stop +if ($.PLATFORM == "x86_64-mlnx_msn2700-r0" or $.PLATFORM == "x86_64-mlnx_msn2700a1-r0" or $.PLATFORM == "x86_64-mlnx_msn2410-r0") then { + if $programname contains "sensord" and $msg contains "Error getting sensor data: dps460/#" then stop +} {% endif %} -{% endif %} + # Set remote syslog server -template (name="ForwardFormatInContainer" type="string" string="<%PRI%>%TIMESTAMP:::date-rfc3339% %HOSTNAME% {{container_name}}#%syslogtag%%msg:::sp-if-no-1st-sp%%msg%") -*.* action(type="omfwd" target="{{target_ip}}" port="514" protocol="udp" Template="ForwardFormatInContainer") +template (name="ForwardFormatInContainer" type="string" string="<%PRI%>%TIMESTAMP:::date-rfc3339% %HOSTNAME% %$.CONTAINER_NAME%#%syslogtag%%msg:::sp-if-no-1st-sp%%msg%") +*.* action(type="omfwd" target=`echo $SYSLOG_TARGET_IP` port="514" protocol="udp" Template="ForwardFormatInContainer") # # Use traditional timestamp format. @@ -75,7 +80,7 @@ template (name="ForwardFormatInContainer" type="string" string="<%PRI%>%TIMESTAM #$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat # Define a custom template -$template SONiCFileFormat,"%TIMESTAMP%.%timestamp:::date-subseconds% %HOSTNAME% %syslogseverity-text:::uppercase% {{container_name}}#%syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n" +$template SONiCFileFormat,"%TIMESTAMP%.%timestamp:::date-subseconds% %HOSTNAME% %syslogseverity-text:::uppercase% %$.CONTAINER_NAME%#%syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n" $ActionFileDefaultTemplate SONiCFileFormat # diff --git a/src/sonic-containercfgd/containercfgd/containercfgd.py b/src/sonic-containercfgd/containercfgd/containercfgd.py index 4eda8a6d8b40..f604034fc3d7 100644 --- a/src/sonic-containercfgd/containercfgd/containercfgd.py +++ b/src/sonic-containercfgd/containercfgd/containercfgd.py @@ -1,3 +1,6 @@ +from swsscommon.swsscommon import RestartWaiter +RestartWaiter.waitAdvancedBootDone() + import os import re import signal @@ -5,7 +8,7 @@ import sys from sonic_py_common import daemon_base, logger -from swsscommon.swsscommon import ConfigDBConnector, RestartWaiter +from swsscommon.swsscommon import ConfigDBConnector SYSLOG_IDENTIFIER = "containercfgd" logger = logger.Logger(SYSLOG_IDENTIFIER) @@ -101,10 +104,9 @@ class SyslogHandler: # Regular expressions to extract value from rsyslog.conf INTERVAL_PATTERN = '.*SystemLogRateLimitInterval\s+(\d+).*' BURST_PATTERN = '.*SystemLogRateLimitBurst\s+(\d+).*' - TARGET_IP_PATTERN = '.*target="(.*?)".*' def __init__(self): - self.current_interval, self.current_burst, self.target_ip = self.parse_syslog_conf() + self.current_interval, self.current_burst = self.parse_syslog_conf() def handle_config(self, table, key, data): """Handle CONFIG DB change. Callback by ConfigDBConnector. @@ -149,7 +151,7 @@ def update_syslog_config(self, data): if os.path.exists(self.TMP_SYSLOG_CONF_PATH): os.remove(self.TMP_SYSLOG_CONF_PATH) with open(self.TMP_SYSLOG_CONF_PATH, 'w+') as f: - json_args = f'{{"target_ip": "{self.target_ip}", "container_name": "{container_name}" }}' + json_args = f'{{"container_name": "{container_name}" }}' output = run_command(['sonic-cfggen', '-d', '-t', '/usr/share/sonic/templates/rsyslog-container.conf.j2', '-a', json_args]) f.write(output) run_command(['cp', self.TMP_SYSLOG_CONF_PATH, self.SYSLOG_CONF_PATH]) @@ -161,11 +163,10 @@ def parse_syslog_conf(self): """Passe existing syslog conf and extract config values Returns: - tuple: interval,burst,target_ip + tuple: interval,burst """ interval = '0' burst = '0' - target_ip = None with open(self.SYSLOG_CONF_PATH, 'r') as f: content = f.read() @@ -179,15 +180,10 @@ def parse_syslog_conf(self): burst = match.group(1) break - pattern = re.compile(self.TARGET_IP_PATTERN) - for match in pattern.finditer(content): - target_ip = match.group(1) - break - return interval, burst, target_ip + return interval, burst def main(): - RestartWaiter.waitAdvancedBootDone() global container_name container_name = os.environ['CONTAINER_NAME'] daemon = ContainerConfigDaemon() diff --git a/src/sonic-containercfgd/tests/test_config_daemon.py b/src/sonic-containercfgd/tests/test_config_daemon.py index 3604a32ab2d8..05014d397306 100644 --- a/src/sonic-containercfgd/tests/test_config_daemon.py +++ b/src/sonic-containercfgd/tests/test_config_daemon.py @@ -2,6 +2,9 @@ import sys from unittest import mock +from swsscommon import swsscommon +swsscommon.RestartWaiter = mock.MagicMock() + test_path = os.path.dirname(os.path.abspath(__file__)) modules_path = os.path.dirname(test_path) sys.path.insert(0, modules_path) diff --git a/src/sonic-containercfgd/tests/test_syslog_config.py b/src/sonic-containercfgd/tests/test_syslog_config.py index 23e5887b9d26..a823d9f9aea6 100644 --- a/src/sonic-containercfgd/tests/test_syslog_config.py +++ b/src/sonic-containercfgd/tests/test_syslog_config.py @@ -2,6 +2,9 @@ import sys from unittest import mock +from swsscommon import swsscommon +swsscommon.RestartWaiter = mock.MagicMock() + test_path = os.path.dirname(os.path.abspath(__file__)) modules_path = os.path.dirname(test_path) sys.path.insert(0, modules_path) @@ -49,7 +52,7 @@ def test_handle_init_data(): @mock.patch('containercfgd.containercfgd.run_command') -@mock.patch('containercfgd.containercfgd.SyslogHandler.parse_syslog_conf', mock.MagicMock(return_value=('100', '200', '127.0.0.1'))) +@mock.patch('containercfgd.containercfgd.SyslogHandler.parse_syslog_conf', mock.MagicMock(return_value=('100', '200'))) def test_update_syslog_config(mock_run_cmd): mock_run_cmd.return_value = "" handler = containercfgd.SyslogHandler() @@ -69,13 +72,11 @@ def test_update_syslog_config(mock_run_cmd): def test_parse_syslog_conf(): handler = containercfgd.SyslogHandler() handler.SYSLOG_CONF_PATH = os.path.join(test_path, 'mock_rsyslog.conf') - interval, burst, target_ip = handler.parse_syslog_conf() + interval, burst = handler.parse_syslog_conf() assert interval == '50' assert burst == '10002' - assert target_ip == '127.0.0.1' handler.SYSLOG_CONF_PATH = os.path.join(test_path, 'mock_empty_rsyslog.conf') - interval, burst, target_ip = handler.parse_syslog_conf() + interval, burst = handler.parse_syslog_conf() assert interval == '0' assert burst == '0' - assert target_ip is None From bd63fff75802c5d3b46d61d9e4d5cdbe4c82e607 Mon Sep 17 00:00:00 2001 From: Lawrence Lee Date: Wed, 10 Jan 2024 14:40:15 -0800 Subject: [PATCH 059/419] add timeout to ping6 command (#17729) Signed-off-by: Lawrence Lee --- files/scripts/arp_update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/scripts/arp_update b/files/scripts/arp_update index f402d53dced3..7fd5667bca83 100755 --- a/files/scripts/arp_update +++ b/files/scripts/arp_update @@ -68,7 +68,7 @@ while /bin/true; do ALL_INTERFACE="$INTERFACE $PC_INTERFACE $VLAN_SUB_INTERFACE" for intf in $ALL_INTERFACE; do - ping6cmd="ping6 -I $intf -n -q -i 0 -c 1 -W 0 ff02::1 >/dev/null" + ping6cmd="timeout 0.2 ping6 -I $intf -n -q -i 0 -c 1 -W 0 ff02::1 >/dev/null" intf_up=$(ip link show $intf | grep "state UP") if [[ -n "$intf_up" ]]; then eval $ping6cmd From 4a26cd81f55e4e4fbcc8a14e682c524baa04f397 Mon Sep 17 00:00:00 2001 From: zitingguo-ms Date: Fri, 5 Jan 2024 23:05:29 +0800 Subject: [PATCH 060/419] [YANG] Enable Yang model for BGP_BBR config entry (#17622) Why I did it Enable Yang model for BGP_BBR config entry. { "BGP_BBR": { "all": { "status": "enabled"/"disabled" } } } Work item tracking Microsoft ADO (number only): 25988660 How I did it Add yang model and ut for BGP_BBR. How to verify it Use GCU cmd to change bbr status. Create following json patch: disable_bbr.json-patch [ { "op": "replace", "path": "/BGP_BBR/all/status", "value": "disabled" } ] Run sudo config apply-patch ./disable_bbr.json-patch cmd on dut. Success. --- src/sonic-yang-models/doc/Configuration.md | 15 +++++++ src/sonic-yang-models/setup.py | 1 + .../tests/files/sample_config_db.json | 5 +++ .../tests/yang_model_tests/tests/bgp_bbr.json | 9 ++++ .../tests_config/bgp_bbr.json | 22 ++++++++++ .../yang-models/sonic-bgp-bbr.yang | 41 +++++++++++++++++++ 6 files changed, 93 insertions(+) create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests/bgp_bbr.json create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests_config/bgp_bbr.json create mode 100644 src/sonic-yang-models/yang-models/sonic-bgp-bbr.yang diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index 5ee894f7aae1..79782409bb10 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -7,9 +7,12 @@ 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 BBR](#bgp-bbr) * [BGP Device Global](#bgp-device-global) * [BGP Sessions](#bgp-sessions) * [BUFFER_PG](#buffer_pg) @@ -366,6 +369,18 @@ and migration plan } } ``` +### BGP BBR + +The **BGP_BBR** table contains device-level BBR state. +``` +{ + "BGP_BBR": { + "all": { + "status": "enabled"/"disabled" + } + } +} +``` ### BGP Device Global The **BGP_DEVICE_GLOBAL** table contains device-level BGP global state. diff --git a/src/sonic-yang-models/setup.py b/src/sonic-yang-models/setup.py index aacdd74204d7..ec1fbec42e56 100644 --- a/src/sonic-yang-models/setup.py +++ b/src/sonic-yang-models/setup.py @@ -79,6 +79,7 @@ def run(self): data_files=[ ('yang-models', ['./yang-models/sonic-acl.yang', './yang-models/sonic-auto_techsupport.yang', + './yang-models/sonic-bgp-bbr.yang', './yang-models/sonic-bgp-common.yang', './yang-models/sonic-bgp-device-global.yang', './yang-models/sonic-bgp-global.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 b0e3f5f589a7..567999143a0f 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1597,6 +1597,11 @@ "local_ip": "12.12.0.2" } }, + "BGP_BBR": { + "all": { + "status": "enabled" + } + }, "BGP_GLOBALS": { "default": { "router_id": "5.5.5.5", diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/bgp_bbr.json b/src/sonic-yang-models/tests/yang_model_tests/tests/bgp_bbr.json new file mode 100644 index 000000000000..50d1c40b119a --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/bgp_bbr.json @@ -0,0 +1,9 @@ +{ + "BGP_BBR_TABLE": { + "desc": "BGP BBR Table" + }, + "BGP_BBR_INVALID_STATUS": { + "desc": "Configure status key with invalid value", + "eStrKey": "InvalidValue" + } +} \ No newline at end of file diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/bgp_bbr.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/bgp_bbr.json new file mode 100644 index 000000000000..f5379a4091f9 --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/bgp_bbr.json @@ -0,0 +1,22 @@ +{ + "BGP_BBR_TABLE": { + "sonic-bgp-bbr:sonic-bgp-bbr": { + "sonic-bgp-bbr:BGP_BBR": { + "all": + { + "status": "enabled" + } + } + } + }, + "BGP_BBR_INVALID_STATUS": { + "sonic-bgp-bbr:sonic-bgp-bbr": { + "sonic-bgp-bbr:BGP_BBR": { + "all": + { + "status": "true" + } + } + } + } +} \ No newline at end of file diff --git a/src/sonic-yang-models/yang-models/sonic-bgp-bbr.yang b/src/sonic-yang-models/yang-models/sonic-bgp-bbr.yang new file mode 100644 index 000000000000..58cc8823d391 --- /dev/null +++ b/src/sonic-yang-models/yang-models/sonic-bgp-bbr.yang @@ -0,0 +1,41 @@ +module sonic-bgp-bbr { + namespace "http://github.com/sonic-net/sonic-bgp-bbr"; + prefix bgpbbr; + yang-version 1.1; + + import sonic-types { + prefix stypes; + } + + organization + "SONiC"; + + contact + "SONiC"; + + description + "SONIC BGP BBR"; + + revision 2023-12-25 { + description + "Initial revision."; + } + + container sonic-bgp-bbr { + container BGP_BBR { + + description "BGP_BBR table part of config_db.json"; + + container all { + leaf status { + type stypes:admin_mode; + default enabled; + description "bgp bbr status"; + } + } + /* end of container all */ + } + /* end of container BGP_BBR */ + } + /* end of container sonic-bgp-bbr */ +} \ No newline at end of file From 58861451607398a5107859dc6d0f09d1063b767c Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 12 Jan 2024 16:34:38 +0800 Subject: [PATCH 061/419] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#17752) #### Why I did it src/sonic-utilities ``` * 72b6c04c - (HEAD -> 202311, origin/202311) Support disable/enable syslog rate limit feature (#3072) (2 days ago) [Junchao-Mellanox] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index fba4bf0b9329..72b6c04c5d64 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit fba4bf0b932949117d5383afccdeb36d6a882209 +Subproject commit 72b6c04c5d64d0322ca36e5c8606740027a97767 From 87b4dc8899cc30febb83f9d7aa1fd256e4ea3a0f Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 12 Jan 2024 16:34:42 +0800 Subject: [PATCH 062/419] [submodule] Update submodule dhcpmon to the latest HEAD automatically (#17750) #### Why I did it src/dhcpmon ``` * 2443073 - (HEAD -> 202311, origin/202311) [counter] Clear counter table when dhcpmon init (#14) (#16) (2 days ago) [Yaqiang Zhu] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/dhcpmon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dhcpmon b/src/dhcpmon index 7c55e502a1b0..244307304688 160000 --- a/src/dhcpmon +++ b/src/dhcpmon @@ -1 +1 @@ -Subproject commit 7c55e502a1b054aa01c056dc1018e4b863975445 +Subproject commit 244307304688ada1062a36554acc1fa95610f17d From c51bfd2ee202d17040efd723802e237f7c8b9325 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 13 Jan 2024 16:32:41 +0800 Subject: [PATCH 063/419] [submodule] Update submodule sonic-linux-kernel to the latest HEAD automatically (#17772) #### Why I did it src/sonic-linux-kernel ``` * 46db038 - (HEAD -> 202311, origin/202311) Intgerate HW-MGMT 7.0030.2008 Changes (#361) (#372) (9 hours ago) [Kebo Liu] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-linux-kernel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-linux-kernel b/src/sonic-linux-kernel index c79efd7f1cff..46db038ecc6f 160000 --- a/src/sonic-linux-kernel +++ b/src/sonic-linux-kernel @@ -1 +1 @@ -Subproject commit c79efd7f1cff0d409b313f174df1905dc0e5a84b +Subproject commit 46db038ecc6fef6bc5e7bef8a7dc462bf9e6266a From 0b511986ae09502ce96926b06c837a92d94fea83 Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Wed, 17 Jan 2024 00:31:33 +0800 Subject: [PATCH 064/419] [202311][Mellanox] implement platform wait in python code (#17398) (#17719) - Why I did it New implementation of Nvidia platform_wait due to: 1. sysfs deprecated by hw-mgmt 2. new dependencies to SDK 3. For CMIS host management mode - How I did it wait hw-management ready wait SDK sysfs nodes ready - How to verify it manual test unit test sonic-mgmt regression --- .../x86_64-mlnx_msn2700-r0/platform_wait | 101 ++++++------------ .../sonic_platform/device_data.py | 28 ++++- .../mlnx-platform-api/sonic_platform/utils.py | 24 +++++ .../tests/test_device_data.py | 24 ++++- .../mlnx-platform-api/tests/test_utils.py | 7 ++ 5 files changed, 111 insertions(+), 73 deletions(-) diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/platform_wait b/device/mellanox/x86_64-mlnx_msn2700-r0/platform_wait index a233eb41de42..ea76db07a6d8 100755 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/platform_wait +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/platform_wait @@ -1,69 +1,32 @@ -#!/bin/bash - -declare -r SYSLOG_LOGGER="/usr/bin/logger" -declare -r SYSLOG_IDENTIFIER="platform_wait" -declare -r SYSLOG_ERROR="error" -declare -r SYSLOG_NOTICE="notice" -declare -r SYSLOG_INFO="info" - -declare -r HW_MGMT_CONFIG="/var/run/hw-management/config" - -declare -r MODULE_COUNTER="${HW_MGMT_CONFIG}/module_counter" -declare -r SFP_COUNTER="${HW_MGMT_CONFIG}/sfp_counter" - -declare -r EXIT_SUCCESS="0" -declare -r EXIT_TIMEOUT="1" - -function log_error() { - eval "${SYSLOG_LOGGER} -t ${SYSLOG_IDENTIFIER} -p ${SYSLOG_ERROR} $@" -} - -function log_notice() { - eval "${SYSLOG_LOGGER} -t ${SYSLOG_IDENTIFIER} -p ${SYSLOG_NOTICE} $@" -} - -function log_info() { - eval "${SYSLOG_LOGGER} -t ${SYSLOG_IDENTIFIER} -p ${SYSLOG_INFO} $@" -} - -function wait_for_sfp() { - local -r _NUM_MATCH="^[0-9]+$" - local -r _NUM_ZERO="0" - - local _MODULE_CNT="0" - local _SFP_CNT="0" - - local -i _WDOG_CNT="1" - local -ir _WDOG_MAX="300" - - local -r _TIMEOUT="1s" - - while [[ "${_WDOG_CNT}" -le "${_WDOG_MAX}" ]]; do - _MODULE_CNT="$(cat ${MODULE_COUNTER} 2>&1)" - _SFP_CNT="$(cat ${SFP_COUNTER} 2>&1)" - - if [[ "${_MODULE_CNT}" =~ ${_NUM_MATCH} && "${_SFP_CNT}" =~ ${_NUM_MATCH} ]]; then - if [[ "${_SFP_CNT}" -gt "${_NUM_ZERO}" && "${_MODULE_CNT}" -eq "${_SFP_CNT}" ]]; then - return "${EXIT_SUCCESS}" - fi - fi - - let "_WDOG_CNT++" - sleep "${_TIMEOUT}" - done - - return "${EXIT_TIMEOUT}" -} - -log_info "Wait for SFP interfaces to be ready" - -wait_for_sfp -EXIT_CODE="$?" -if [[ "${EXIT_CODE}" != "${EXIT_SUCCESS}" ]]; then - log_error "SFP interfaces are not ready: timeout" - exit "${EXIT_CODE}" -fi - -log_info "SFP interfaces are ready" - -exit "${EXIT_SUCCESS}" +#!/usr/bin/python3 + +# +# Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. +# Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +import sys +from sonic_platform.device_data import DeviceDataManager +from sonic_py_common.logger import Logger + + +logger = Logger(log_identifier='platform_wait') +logger.log_notice('Nvidia: Wait for PMON dependencies to be ready') +if DeviceDataManager.wait_platform_ready(): + logger.log_notice('Nvidia: PMON dependencies are ready') + sys.exit(0) +else: + logger.log_error('Nvidia: PMON dependencies are not ready: timeout') + sys.exit(-1) 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 6bf0a9945a85..aeceb15d1983 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py @@ -17,6 +17,7 @@ import glob import os +import time from . import utils @@ -167,8 +168,11 @@ def is_psu_hotswapable(cls): @classmethod @utils.read_only_cache() def get_sfp_count(cls): - sfp_count = utils.read_int_from_file('/run/hw-management/config/sfp_counter') - return sfp_count if sfp_count > 0 else len(glob.glob('/sys/module/sx_core/asic0/module*')) + from sonic_py_common import device_info + platform_path = device_info.get_path_to_platform_dir() + platform_json_path = os.path.join(platform_path, 'platform.json') + platform_data = utils.load_json_file(platform_json_path) + return len(platform_data['chassis']['sfps']) @classmethod def get_linecard_sfp_count(cls, lc_index): @@ -244,3 +248,23 @@ def is_independent_mode(cls): sai_profile_file = os.path.join(hwsku_dir, 'sai.profile') data = utils.read_key_value_file(sai_profile_file, delimeter='=') return data.get('SAI_INDEPENDENT_MODULE_MODE') == '1' + + @classmethod + def wait_platform_ready(cls): + """ + Wait for Nvidia platform related services(SDK, hw-management) ready + Returns: + bool: True if wait success else timeout + """ + conditions = [] + sysfs_nodes = ['power_mode', 'power_mode_policy', 'present', 'reset', 'status', 'statuserror'] + if cls.is_independent_mode(): + sysfs_nodes.extend(['control', 'frequency', 'frequency_support', 'hw_present', 'hw_reset', + 'power_good', 'power_limit', 'power_on', 'temperature/input']) + else: + conditions.append(lambda: utils.read_int_from_file('/var/run/hw-management/config/asics_init_done') == 1) + sfp_count = cls.get_sfp_count() + for sfp_index in range(sfp_count): + for sysfs_node in sysfs_nodes: + conditions.append(lambda: os.path.exists(f'/sys/module/sx_core/asic0/module{sfp_index}/{sysfs_node}')) + return utils.wait_until_conditions(conditions, 300, 1) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/utils.py b/platform/mellanox/mlnx-platform-api/sonic_platform/utils.py index 9db38e6b4147..1135903c24bf 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/utils.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/utils.py @@ -290,6 +290,30 @@ def wait_until(predict, timeout, interval=1, *args, **kwargs): return False +def wait_until_conditions(conditions, timeout, interval=1): + """ + Wait until all the conditions become true + Args: + conditions (list): a list of callable which generate True|False + timeout (int): wait time in seconds + interval (int, optional): interval to check the predict. Defaults to 1. + + Returns: + bool: True if wait success else False + """ + while timeout > 0: + pending_conditions = [] + for condition in conditions: + if not condition(): + pending_conditions.append(condition) + if not pending_conditions: + return True + conditions = pending_conditions + time.sleep(interval) + timeout -= interval + return False + + class TimerEvent: def __init__(self, interval, cb, repeat): self.interval = interval diff --git a/platform/mellanox/mlnx-platform-api/tests/test_device_data.py b/platform/mellanox/mlnx-platform-api/tests/test_device_data.py index 866f01c3e7e3..c172b82a30b7 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_device_data.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_device_data.py @@ -60,6 +60,26 @@ def test_is_independent_mode(self, mock_read): mock_read.return_value = {'SAI_INDEPENDENT_MODULE_MODE': '1'} assert DeviceDataManager.is_independent_mode() + @mock.patch('sonic_py_common.device_info.get_path_to_platform_dir', mock.MagicMock(return_value='/tmp')) + @mock.patch('sonic_platform.device_data.utils.load_json_file') + def test_get_sfp_count(self, mock_load_json): + mock_load_json.return_value = { + 'chassis': { + 'sfps': [1,2,3] + } + } + assert DeviceDataManager.get_sfp_count() == 3 - - + @mock.patch('sonic_platform.device_data.time.sleep', mock.MagicMock()) + @mock.patch('sonic_platform.device_data.DeviceDataManager.get_sfp_count', mock.MagicMock(return_value=3)) + @mock.patch('sonic_platform.device_data.utils.read_int_from_file', mock.MagicMock(return_value=1)) + @mock.patch('sonic_platform.device_data.os.path.exists') + @mock.patch('sonic_platform.device_data.DeviceDataManager.is_independent_mode') + def test_wait_platform_ready(self, mock_is_indep, mock_exists): + mock_exists.return_value = True + mock_is_indep.return_value = True + assert DeviceDataManager.wait_platform_ready() + mock_is_indep.return_value = False + assert DeviceDataManager.wait_platform_ready() + mock_exists.return_value = False + assert not DeviceDataManager.wait_platform_ready() diff --git a/platform/mellanox/mlnx-platform-api/tests/test_utils.py b/platform/mellanox/mlnx-platform-api/tests/test_utils.py index 2a186de7e5b0..b6ec67975f80 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_utils.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_utils.py @@ -195,6 +195,13 @@ def test_read_key_value_file(self): mock_os_open = mock.mock_open(read_data='a=b') with mock.patch('sonic_platform.utils.open', mock_os_open): assert utils.read_key_value_file('some_file', delimeter='=') == {'a':'b'} + + @mock.patch('sonic_platform.utils.time.sleep', mock.MagicMock()) + def test_wait_until_conditions(self): + conditions = [lambda: True] + assert utils.wait_until_conditions(conditions, 1) + conditions = [lambda: False] + assert not utils.wait_until_conditions(conditions, 1) def test_timer(self): timer = utils.Timer() From cacf46ff8677dde7f43baad9182a0c5e333ff31b Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Wed, 17 Jan 2024 00:33:50 +0800 Subject: [PATCH 065/419] [202311][Mellanox] Integrate HW-MGMT Version 7.0030.2008 (#17659) * Intgerate HW-MGMT 7.0030.2008 Changes ## Patch List * 0285-UBUNTU-SAUCE-mlxbf-gige-Fix-intermittent-no-ip-issue.patch : * 0286-pinctrl-Introduce-struct-pinfunction-and-PINCTRL_PIN.patch : * 0287-pinctrl-mlxbf3-Add-pinctrl-driver-support.patch : * 0288-UBUNTU-SAUCE-gpio-mmio-handle-ngpios-properly-in-bgp.patch : * 0289-UBUNTU-SAUCE-gpio-mlxbf3-Add-gpio-driver-support.patch : * 0291-mlxsw-core_hwmon-Align-modules-label-name-assignment.patch : * 0292-mlxsw-i2c-Limit-single-transaction-buffer-size.patch : * 0293-mlxsw-reg-Limit-MTBR-register-records-buffer-by-one-.patch : * 0296-UBUNTU-SAUCE-mmc-sdhci-of-dwcmshc-Add-runtime-PM-ope.patch : * 0298-UBUNTU-SAUCE-mlxbf-ptm-use-0444-instead-of-S_IRUGO.patch : * 0299-UBUNTU-SAUCE-mlxbf-ptm-add-atx-debugfs-nodes.patch : * 0300-UBUNTU-SAUCE-mlxbf-ptm-update-module-version.patch : * 0301-UBUNTU-SAUCE-mlxbf-gige-Fix-kernel-panic-at-shutdown.patch : * 0302-UBUNTU-SAUCE-mlxbf-bootctl-support-SMC-call-for-sett.patch : * 0303-UBUNTU-SAUCE-Add-BF3-related-ACPI-config-and-Ring-de.patch : * 0306-dt-bindings-trivial-devices-Add-infineon-xdpe1a2g7.patch : * 0307-leds-mlxreg-Add-support-for-new-flavour-of-capabilit.patch : * 0308-leds-mlxreg-Remove-code-for-amber-LED-colour.patch : * 0308-platform_data-mlxreg-Add-capability-bit-and-mask-fie.patch : * 0309-hwmon-mlxreg-fan-Add-support-for-new-flavour-of-capa.patch : * 0310-hwmon-mlxreg-fan-Extend-number-of-supporetd-fans.patch : * 0317-platform-mellanox-Introduce-support-for-switches-equ.patch : * 0318-mellanox-Relocate-mlx-platform-driver.patch : * 0319-UBUNTU-SAUCE-mlxbf-tmfifo-fix-potential-race.patch : * 0320-UBUNTU-SAUCE-mlxbf-tmfifo-Drop-the-Rx-packet-if-no-m.patch : * 0321-UBUNTU-SAUCE-mlxbf-tmfifo-Drop-jumbo-frames.patch : * 0322-UBUNTU-SAUCE-mlxbf-tmfifo.c-Amend-previous-tmfifo-pa.patch : * 0323-mlxbf_gige-add-set_link_ksettings-ethtool-callback.patch : * 0324-mlxbf_gige-fix-white-space-in-mlxbf_gige_eth_ioctl.patch : * 0325-UBUNTU-SAUCE-mlxbf-bootctl-Fix-kernel-panic-due-to-b.patch : * 0326-platform-mellanox-mlxreg-hotplug-Add-support-for-new.patch : * 0327-platform-mellanox-mlx-platform-Change-register-name.patch : * 0328-platform-mellanox-mlx-platform-Add-support-for-new-X.patch : * [Mellanox] Don't populate arm64 Kconfig when integrating hw-mgmt Signed-off-by: Vivek Reddy * [Mellanox] Remove thermal zone related code and replace with new one * Revert "Revert "[Mellanox] Align PSU temperature sysfs node name with hw-management change (#16820)" (#16956)" This reverts commit c2edc6f9d5fd812d89873e47456ae6c38bc05dee. * Update copyright header Signed-off-by: Kebo Liu --------- Signed-off-by: Vivek Reddy Signed-off-by: Kebo Liu Co-authored-by: Vivek Reddy Co-authored-by: Junchao-Mellanox Co-authored-by: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> --- platform/mellanox/hw-management.mk | 4 +- platform/mellanox/hw-management/hw-mgmt | 2 +- .../hw-management/hwmgmt_nonup_patches | 68 +- platform/mellanox/integration-scripts.mk | 21 +- .../mlnx-platform-api/sonic_platform/fan.py | 7 +- .../mlnx-platform-api/sonic_platform/psu.py | 6 +- .../sonic_platform/thermal.py | 14 +- .../mlnx-platform-api/tests/conftest.py | 13 +- .../mlnx-platform-api/tests/test_fan_api.py | 6 +- .../external-changes.patch | 122 +- ...platform-Add-SPI-path-for-rack-switc.patch | 84 - ...x-Introduce-support-of-new-Nvidia-L1.patch | 647 ------ ...lanox-Split-initialization-procedure.patch | 168 -- ...ox-Split-logic-in-init-and-exit-flow.patch | 455 ---- ...x-Extend-all-systems-with-I2C-notifi.patch | 81 - ...xreg-Add-field-with-mapped-resource-.patch | 37 - ...ux-Add-register-map-based-mux-driver.patch | 253 --- ...w-driver-to-run-on-ARM64-architectur.patch | 29 - ...i2c-mlxcpld-Modify-base-address-type.patch | 49 - ...w-to-configure-base-address-of-regis.patch | 34 - ...support-for-extended-transaction-len.patch | 57 - ...x-mlx-platform-Add-mux-selection-reg.patch | 99 - ...x-mlx-platform-Move-bus-shift-assign.patch | 35 - ...x-Add-support-for-dynamic-I2C-channe.patch | 158 -- ...x-Add-initial-support-for-PCIe-based.patch | 186 -- ...x-Introduce-support-for-switches-bas.patch | 253 --- ...x-mlx-platform-Add-reset-and-extend-.patch | 138 -- ...x-mlxbf-pmc-Add-Mellanox-BlueField-P.patch | 6 +- ...latform-mellanox-Add-mlx-trio-driver.patch | 5 +- ...0220-UBUNTU-SAUCE-pka-Add-pka-driver.patch | 8 +- ...tform-mellanox-Add-mlxbf-livefish-dr.patch | 5 +- ...bf_gige-add-validation-of-ACPI-table.patch | 62 - ...lxbf_gige-set-driver-version-to-1.27.patch | 39 - ...bf_gige-add-BlueField-3-Serdes-confi.patch | 1865 ----------------- ...xbf_gige-add-BlueField-3-ethtool_ops.patch | 95 - ...and-thermal-management-debugfs-drive.patch | 6 +- ...9-platform-mellanox-Cosmetic-changes.patch | 74 - ...form-mellanox-Fix-order-in-exit-flow.patch | 39 - ...platform-mellanox-Add-new-attributes.patch | 49 - ...nox-Change-register-offset-addresses.patch | 43 - ...x-Add-field-upgrade-capability-regis.patch | 72 - ...anox-Modify-reset-causes-description.patch | 53 - ...x-mlx-platform-Modify-graceful-shutd.patch | 43 - ...x-mlx-platform-Fix-signals-polarity-.patch | 59 - ...x-mlxreg-hotplug-Extend-condition-fo.patch | 33 - ...x-mlx-platform-Modify-health-and-pow.patch | 40 - ...x-mlx-platform-add-support-of-5th-CP.patch | 129 -- ...nox-mlx-platform-fix-CPLD4-PN-report.patch | 32 - ...bf-gige-Fix-intermittent-no-ip-issue.patch | 85 + ...e-struct-pinfunction-and-PINCTRL_PIN.patch | 60 + ...rl-mlxbf3-Add-pinctrl-driver-support.patch | 393 ++++ ...o-mmio-handle-ngpios-properly-in-bgp.patch | 125 ++ ...-gpio-mlxbf3-Add-gpio-driver-support.patch | 488 +++++ ...Align-modules-label-name-assignment.patch} | 4 +- ...Limit-single-transaction-buffer-size.patch | 45 + ...MTBR-register-records-buffer-by-one-.patch | 33 + ...-sdhci-of-dwcmshc-Add-runtime-PM-ope.patch | 159 ++ ...lxbf-ptm-use-0444-instead-of-S_IRUGO.patch | 64 + ...AUCE-mlxbf-ptm-add-atx-debugfs-nodes.patch | 83 + ...AUCE-mlxbf-ptm-update-module-version.patch | 31 + ...bf-gige-Fix-kernel-panic-at-shutdown.patch | 48 + ...bf-bootctl-support-SMC-call-for-sett.patch | 94 + ...-BF3-related-ACPI-config-and-Ring-de.patch | 135 ++ ...ivial-devices-Add-infineon-xdpe1a2g7.patch | 29 + ...support-for-new-flavour-of-capabilit.patch | 53 + ...reg-Remove-code-for-amber-LED-colour.patch | 50 + ...xreg-Add-capability-bit-and-mask-fie.patch | 60 + ...-Add-support-for-new-flavour-of-capa.patch | 101 + ...-fan-Extend-number-of-supporetd-fans.patch | 47 + ...x-Introduce-support-for-switches-equ.patch | 312 +++ ...llanox-Relocate-mlx-platform-driver.patch} | 25 +- ...AUCE-mlxbf-tmfifo-fix-potential-race.patch | 63 + ...bf-tmfifo-Drop-the-Rx-packet-if-no-m.patch | 177 ++ ...SAUCE-mlxbf-tmfifo-Drop-jumbo-frames.patch | 100 + ...bf-tmfifo.c-Amend-previous-tmfifo-pa.patch | 37 + ...-set_link_ksettings-ethtool-callback.patch | 39 + ...-white-space-in-mlxbf_gige_eth_ioctl.patch | 41 + ...bf-bootctl-Fix-kernel-panic-due-to-b.patch | 57 + ...x-mlxreg-hotplug-Add-support-for-new.patch | 88 + ...ox-mlx-platform-Change-register-name.patch | 57 + ...x-mlx-platform-Add-support-for-new-X.patch | 1383 ++++++++++++ 81 files changed, 4714 insertions(+), 5635 deletions(-) delete mode 100644 platform/mellanox/non-upstream-patches/patches/0172-DS-platform-mlx-platform-Add-SPI-path-for-rack-switc.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0182-platform-mellanox-Introduce-support-of-new-Nvidia-L1.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0183-platform-mellanox-Split-initialization-procedure.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0184-platform-mellanox-Split-logic-in-init-and-exit-flow.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0185-platform-mellanox-Extend-all-systems-with-I2C-notifi.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0187-platform_data-mlxreg-Add-field-with-mapped-resource-.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0188-i2c-mux-Add-register-map-based-mux-driver.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0189-i2c-mlxcpld-Allow-driver-to-run-on-ARM64-architectur.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0190-i2c-mlxcpld-Modify-base-address-type.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0191-i2c-mlxcpld-Allow-to-configure-base-address-of-regis.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0192-i2c-mlxcpld-Add-support-for-extended-transaction-len.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0193-platform-mellanox-mlx-platform-Add-mux-selection-reg.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0194-platform-mellanox-mlx-platform-Move-bus-shift-assign.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0195-platform-mellanox-Add-support-for-dynamic-I2C-channe.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0197-platform-mellanox-Add-initial-support-for-PCIe-based.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0198-platform-mellanox-Introduce-support-for-switches-bas.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0199-platform-mellanox-mlx-platform-Add-reset-and-extend-.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0234-UBUNTU-SAUCE-mlxbf_gige-add-validation-of-ACPI-table.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0235-UBUNTU-SAUCE-mlxbf_gige-set-driver-version-to-1.27.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0241-UBUNTU-SAUCE-mlxbf_gige-add-BlueField-3-Serdes-confi.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0242-UBUNTU-SAUCE-mlxbf_gige-add-BlueField-3-ethtool_ops.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0269-platform-mellanox-Cosmetic-changes.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0270-platform-mellanox-Fix-order-in-exit-flow.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0271-platform-mellanox-Add-new-attributes.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0272-platform-mellanox-Change-register-offset-addresses.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0273-platform-mellanox-Add-field-upgrade-capability-regis.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0274-platform-mellanox-Modify-reset-causes-description.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0278-platform-mellanox-mlx-platform-Modify-graceful-shutd.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0279-platform-mellanox-mlx-platform-Fix-signals-polarity-.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0280-platform-mellanox-mlxreg-hotplug-Extend-condition-fo.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0281-platform-mellanox-mlx-platform-Modify-health-and-pow.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0282-platform-mellanox-mlx-platform-add-support-of-5th-CP.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0284-platform-mellanox-mlx-platform-fix-CPLD4-PN-report.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0285-UBUNTU-SAUCE-mlxbf-gige-Fix-intermittent-no-ip-issue.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0286-pinctrl-Introduce-struct-pinfunction-and-PINCTRL_PIN.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0287-pinctrl-mlxbf3-Add-pinctrl-driver-support.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0288-UBUNTU-SAUCE-gpio-mmio-handle-ngpios-properly-in-bgp.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0289-UBUNTU-SAUCE-gpio-mlxbf3-Add-gpio-driver-support.patch rename platform/mellanox/non-upstream-patches/patches/{0283-mlxsw-core_hwmon-Align-modules-label-name-assignment.patch => 0291-mlxsw-core_hwmon-Align-modules-label-name-assignment.patch} (93%) create mode 100644 platform/mellanox/non-upstream-patches/patches/0292-mlxsw-i2c-Limit-single-transaction-buffer-size.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0293-mlxsw-reg-Limit-MTBR-register-records-buffer-by-one-.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0296-UBUNTU-SAUCE-mmc-sdhci-of-dwcmshc-Add-runtime-PM-ope.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0298-UBUNTU-SAUCE-mlxbf-ptm-use-0444-instead-of-S_IRUGO.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0299-UBUNTU-SAUCE-mlxbf-ptm-add-atx-debugfs-nodes.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0300-UBUNTU-SAUCE-mlxbf-ptm-update-module-version.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0301-UBUNTU-SAUCE-mlxbf-gige-Fix-kernel-panic-at-shutdown.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0302-UBUNTU-SAUCE-mlxbf-bootctl-support-SMC-call-for-sett.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0303-UBUNTU-SAUCE-Add-BF3-related-ACPI-config-and-Ring-de.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0306-dt-bindings-trivial-devices-Add-infineon-xdpe1a2g7.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0307-leds-mlxreg-Add-support-for-new-flavour-of-capabilit.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0308-leds-mlxreg-Remove-code-for-amber-LED-colour.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0308-platform_data-mlxreg-Add-capability-bit-and-mask-fie.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0309-hwmon-mlxreg-fan-Add-support-for-new-flavour-of-capa.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0310-hwmon-mlxreg-fan-Extend-number-of-supporetd-fans.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0317-platform-mellanox-Introduce-support-for-switches-equ.patch rename platform/mellanox/non-upstream-patches/patches/{0196-platform-mellanox-Relocate-mlx-platform-driver.patch => 0318-mellanox-Relocate-mlx-platform-driver.patch} (85%) create mode 100644 platform/mellanox/non-upstream-patches/patches/0319-UBUNTU-SAUCE-mlxbf-tmfifo-fix-potential-race.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0320-UBUNTU-SAUCE-mlxbf-tmfifo-Drop-the-Rx-packet-if-no-m.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0321-UBUNTU-SAUCE-mlxbf-tmfifo-Drop-jumbo-frames.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0322-UBUNTU-SAUCE-mlxbf-tmfifo.c-Amend-previous-tmfifo-pa.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0323-mlxbf_gige-add-set_link_ksettings-ethtool-callback.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0324-mlxbf_gige-fix-white-space-in-mlxbf_gige_eth_ioctl.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0325-UBUNTU-SAUCE-mlxbf-bootctl-Fix-kernel-panic-due-to-b.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0326-platform-mellanox-mlxreg-hotplug-Add-support-for-new.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0327-platform-mellanox-mlx-platform-Change-register-name.patch create mode 100644 platform/mellanox/non-upstream-patches/patches/0328-platform-mellanox-mlx-platform-Add-support-for-new-X.patch diff --git a/platform/mellanox/hw-management.mk b/platform/mellanox/hw-management.mk index 8c57fb63992a..7f28a8a927a8 100644 --- a/platform/mellanox/hw-management.mk +++ b/platform/mellanox/hw-management.mk @@ -1,5 +1,5 @@ # -# Copyright (c) 2016-2023 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2016-2024 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,7 +16,7 @@ # # Mellanox HW Management -MLNX_HW_MANAGEMENT_VERSION = 7.0030.1011 +MLNX_HW_MANAGEMENT_VERSION = 7.0030.2008 export MLNX_HW_MANAGEMENT_VERSION diff --git a/platform/mellanox/hw-management/hw-mgmt b/platform/mellanox/hw-management/hw-mgmt index c7d4c31a212e..f0cbd0e61f77 160000 --- a/platform/mellanox/hw-management/hw-mgmt +++ b/platform/mellanox/hw-management/hw-mgmt @@ -1 +1 @@ -Subproject commit c7d4c31a212eec6a5543f554ffb2c63c5cb621e3 +Subproject commit f0cbd0e61f77ca0d8ca37612abc5fe8339e0f884 diff --git a/platform/mellanox/hw-management/hwmgmt_nonup_patches b/platform/mellanox/hw-management/hwmgmt_nonup_patches index 36d1d3bd8bdd..f3cd270a0d95 100644 --- a/platform/mellanox/hw-management/hwmgmt_nonup_patches +++ b/platform/mellanox/hw-management/hwmgmt_nonup_patches @@ -66,26 +66,8 @@ 0167-DS-lan743x-Add-support-for-fixed-phy.patch 0168-TMP-mlxsw-minimal-Ignore-error-reading-SPAD-register.patch 0171-platform-mellanox-mlxreg-lc-Fix-cleanup-on-failure-a.patch -0172-DS-platform-mlx-platform-Add-SPI-path-for-rack-switc.patch 0174-DS-mlxsw-core_linecards-Skip-devlink-and-provisionin.patch 0181-Revert-Fix-out-of-bounds-memory-accesses-in-thermal.patch -0182-platform-mellanox-Introduce-support-of-new-Nvidia-L1.patch -0183-platform-mellanox-Split-initialization-procedure.patch -0184-platform-mellanox-Split-logic-in-init-and-exit-flow.patch -0185-platform-mellanox-Extend-all-systems-with-I2C-notifi.patch -0187-platform_data-mlxreg-Add-field-with-mapped-resource-.patch -0188-i2c-mux-Add-register-map-based-mux-driver.patch -0189-i2c-mlxcpld-Allow-driver-to-run-on-ARM64-architectur.patch -0190-i2c-mlxcpld-Modify-base-address-type.patch -0191-i2c-mlxcpld-Allow-to-configure-base-address-of-regis.patch -0192-i2c-mlxcpld-Add-support-for-extended-transaction-len.patch -0193-platform-mellanox-mlx-platform-Add-mux-selection-reg.patch -0194-platform-mellanox-mlx-platform-Move-bus-shift-assign.patch -0195-platform-mellanox-Add-support-for-dynamic-I2C-channe.patch -0196-platform-mellanox-Relocate-mlx-platform-driver.patch -0197-platform-mellanox-Add-initial-support-for-PCIe-based.patch -0198-platform-mellanox-Introduce-support-for-switches-bas.patch -0199-platform-mellanox-mlx-platform-Add-reset-and-extend-.patch 0200-dt-bindings-i2c-mellanox-i2c-mlxbf-convert-txt-to-YA.patch 0203-i2c-mlxbf-remove-IRQF_ONESHOT.patch 0206-i2c-mlxbf-add-multi-slave-functionality.patch @@ -116,15 +98,11 @@ 0231-mlxbf_gige-remove-own-module-name-define-and-use-KBU.patch 0232-UBUNTU-SAUCE-mlxbf_gige-add-ethtool-mlxbf_gige_set_r.patch 0233-UBUNTU-SAUCE-Fix-OOB-handling-RX-packets-in-heavy-tr.patch -0234-UBUNTU-SAUCE-mlxbf_gige-add-validation-of-ACPI-table.patch -0235-UBUNTU-SAUCE-mlxbf_gige-set-driver-version-to-1.27.patch 0236-UBUNTU-SAUCE-mlxbf_gige-clear-MDIO-gateway-lock-afte.patch 0237-mlxbf_gige-compute-MDIO-period-based-on-i1clk.patch 0238-net-mlxbf_gige-Fix-an-IS_ERR-vs-NULL-bug-in-mlxbf_gi.patch 0239-UBUNTU-SAUCE-mlxbf_gige-add-MDIO-support-for-BlueFie.patch 0240-UBUNTU-SAUCE-mlxbf_gige-support-10M-100M-1G-speeds-o.patch -0241-UBUNTU-SAUCE-mlxbf_gige-add-BlueField-3-Serdes-confi.patch -0242-UBUNTU-SAUCE-mlxbf_gige-add-BlueField-3-ethtool_ops.patch 0243-UBUNTU-SAUCE-bluefield_edac-Add-SMC-support.patch 0244-UBUNTU-SAUCE-bluefield_edac-Update-license-and-copyr.patch 0245-gpio-mlxbf2-Convert-to-device-PM-ops.patch @@ -150,20 +128,40 @@ 0266-UBUNTU-SAUCE-mlxbf-pmc-Bug-fix-for-BlueField-3-count.patch 0267-UBUNTU-SAUCE-mmc-sdhci-of-dwcmshc-add-the-missing-de.patch 0268-DS-mlxsw-core_linecards-Disable-firmware-bundling-ma.patch -0269-platform-mellanox-Cosmetic-changes.patch -0270-platform-mellanox-Fix-order-in-exit-flow.patch -0271-platform-mellanox-Add-new-attributes.patch -0272-platform-mellanox-Change-register-offset-addresses.patch -0273-platform-mellanox-Add-field-upgrade-capability-regis.patch -0274-platform-mellanox-Modify-reset-causes-description.patch 0275-mlxsw-Use-u16-for-local_port-field-instead-of-u8.patch 0276-mlxsw-minimal-Change-type-for-local-port.patch 0277-mlxsw-i2c-Fix-chunk-size-setting-in-output-mailbox-b.patch -0278-platform-mellanox-mlx-platform-Modify-graceful-shutd.patch -0279-platform-mellanox-mlx-platform-Fix-signals-polarity-.patch -0280-platform-mellanox-mlxreg-hotplug-Extend-condition-fo.patch -0281-platform-mellanox-mlx-platform-Modify-health-and-pow.patch -0282-platform-mellanox-mlx-platform-add-support-of-5th-CP.patch -0283-mlxsw-core_hwmon-Align-modules-label-name-assignment.patch -0284-platform-mellanox-mlx-platform-fix-CPLD4-PN-report.patch +0285-UBUNTU-SAUCE-mlxbf-gige-Fix-intermittent-no-ip-issue.patch +0286-pinctrl-Introduce-struct-pinfunction-and-PINCTRL_PIN.patch +0287-pinctrl-mlxbf3-Add-pinctrl-driver-support.patch +0288-UBUNTU-SAUCE-gpio-mmio-handle-ngpios-properly-in-bgp.patch +0289-UBUNTU-SAUCE-gpio-mlxbf3-Add-gpio-driver-support.patch +0291-mlxsw-core_hwmon-Align-modules-label-name-assignment.patch +0292-mlxsw-i2c-Limit-single-transaction-buffer-size.patch +0293-mlxsw-reg-Limit-MTBR-register-records-buffer-by-one-.patch +0296-UBUNTU-SAUCE-mmc-sdhci-of-dwcmshc-Add-runtime-PM-ope.patch +0298-UBUNTU-SAUCE-mlxbf-ptm-use-0444-instead-of-S_IRUGO.patch +0299-UBUNTU-SAUCE-mlxbf-ptm-add-atx-debugfs-nodes.patch +0300-UBUNTU-SAUCE-mlxbf-ptm-update-module-version.patch +0301-UBUNTU-SAUCE-mlxbf-gige-Fix-kernel-panic-at-shutdown.patch +0302-UBUNTU-SAUCE-mlxbf-bootctl-support-SMC-call-for-sett.patch +0303-UBUNTU-SAUCE-Add-BF3-related-ACPI-config-and-Ring-de.patch +0306-dt-bindings-trivial-devices-Add-infineon-xdpe1a2g7.patch +0307-leds-mlxreg-Add-support-for-new-flavour-of-capabilit.patch +0308-leds-mlxreg-Remove-code-for-amber-LED-colour.patch +0308-platform_data-mlxreg-Add-capability-bit-and-mask-fie.patch +0309-hwmon-mlxreg-fan-Add-support-for-new-flavour-of-capa.patch +0310-hwmon-mlxreg-fan-Extend-number-of-supporetd-fans.patch +0317-platform-mellanox-Introduce-support-for-switches-equ.patch +0318-mellanox-Relocate-mlx-platform-driver.patch +0319-UBUNTU-SAUCE-mlxbf-tmfifo-fix-potential-race.patch +0320-UBUNTU-SAUCE-mlxbf-tmfifo-Drop-the-Rx-packet-if-no-m.patch +0321-UBUNTU-SAUCE-mlxbf-tmfifo-Drop-jumbo-frames.patch +0322-UBUNTU-SAUCE-mlxbf-tmfifo.c-Amend-previous-tmfifo-pa.patch +0323-mlxbf_gige-add-set_link_ksettings-ethtool-callback.patch +0324-mlxbf_gige-fix-white-space-in-mlxbf_gige_eth_ioctl.patch +0325-UBUNTU-SAUCE-mlxbf-bootctl-Fix-kernel-panic-due-to-b.patch +0326-platform-mellanox-mlxreg-hotplug-Add-support-for-new.patch +0327-platform-mellanox-mlx-platform-Change-register-name.patch +0328-platform-mellanox-mlx-platform-Add-support-for-new-X.patch 9002-TMP-fix-for-fan-minimum-speed.patch diff --git a/platform/mellanox/integration-scripts.mk b/platform/mellanox/integration-scripts.mk index e902a1f06e80..31dfef807268 100644 --- a/platform/mellanox/integration-scripts.mk +++ b/platform/mellanox/integration-scripts.mk @@ -1,5 +1,5 @@ # -# Copyright (c) 2016-2023 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2016-2024 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -98,15 +98,16 @@ endif --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) \ - --dst_candidate_folder $(NON_UP_PTCH_DIR) \ - --series_file $(PTCH_LIST) \ - --config_file $(KCFG_LIST_ARM) \ - --config_file_downstream $(KCFG_DOWN_LIST_ARM) \ - --kernel_version $(KERNEL_VERSION) \ - --arch arm64 \ - --os_type sonic $(LOG_SIMPLE) + # Disable Writing KConfigs for arm64 platform + # $(BUILD_WORKDIR)/$($(MLNX_HW_MANAGEMENT)_SRC_PATH)/hw-mgmt/recipes-kernel/linux/deploy_kernel_patches.py \ + # --dst_accepted_folder $(PTCH_DIR) \ + # --dst_candidate_folder $(NON_UP_PTCH_DIR) \ + # --series_file $(PTCH_LIST) \ + # --config_file $(KCFG_LIST_ARM) \ + # --config_file_downstream $(KCFG_DOWN_LIST_ARM) \ + # --kernel_version $(KERNEL_VERSION) \ + # --arch arm64 \ + # --os_type sonic $(LOG_SIMPLE) $(BUILD_WORKDIR)/$($(MLNX_HW_MANAGEMENT)_SRC_PATH)/hw-mgmt/recipes-kernel/linux/deploy_kernel_patches.py \ --dst_accepted_folder $(PTCH_DIR) \ diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/fan.py b/platform/mellanox/mlnx-platform-api/sonic_platform/fan.py index 9567c65ce6c8..000db9d555c7 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/fan.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/fan.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2023 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -216,7 +216,10 @@ def get_target_speed(self): """ try: # Get PSU fan target speed according to current system cooling level - cooling_level = utils.read_int_from_file('/run/hw-management/thermal/cooling_cur_state', log_func=None) + pwm = utils.read_int_from_file('/run/hw-management/thermal/pwm1', log_func=None) + if pwm >= PWM_MAX: + pwm = PWM_MAX - 1 + cooling_level = int(pwm / PWM_MAX * 10) return int(self.PSU_FAN_SPEED[cooling_level], 16) except Exception: return self.get_speed() diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/psu.py b/platform/mellanox/mlnx-platform-api/sonic_platform/psu.py index cc5bb61b9608..7d4743879b91 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/psu.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/psu.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2023 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -242,8 +242,8 @@ def __init__(self, psu_index): self.psu_power_max_capacity = os.path.join(PSU_PATH, "config/psu{}_power_capacity".format(self.index)) - self.psu_temp = os.path.join(PSU_PATH, 'thermal/psu{}_temp'.format(self.index)) - self.psu_temp_threshold = os.path.join(PSU_PATH, 'thermal/psu{}_temp_max'.format(self.index)) + self.psu_temp = os.path.join(PSU_PATH, 'thermal/psu{}_temp1'.format(self.index)) + self.psu_temp_threshold = os.path.join(PSU_PATH, 'thermal/psu{}_temp1_max'.format(self.index)) self.psu_power_slope = os.path.join(PSU_PATH, self.PSU_POWER_SLOPE.format(self.index)) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py index 867bf55e0292..435389321d0b 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2023 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -67,8 +67,8 @@ "psu thermals": { "name": "PSU-{} Temp", - "temperature": "psu{}_temp", - "high_threshold": "psu{}_temp_max", + "temperature": "psu{}_temp1", + "high_threshold": "psu{}_temp1_max", "type": "indexable" }, "chassis thermals": [ @@ -109,8 +109,8 @@ { "name": "Gearbox {} Temp", "temperature": "gearbox{}_temp_input", - "high_threshold": "mlxsw-gearbox{}/temp_trip_hot", - "high_critical_threshold": "mlxsw-gearbox{}/temp_trip_crit", + "high_threshold": "gearbox{}_temp_emergency", + "high_critical_threshold": "gearbox{}_temp_trip_crit", "type": "indexable" }, { @@ -139,8 +139,8 @@ 'linecard thermals': { "name": "Gearbox {} Temp", "temperature": "gearbox{}_temp_input", - "high_threshold": "mlxsw-gearbox{}/temp_trip_hot", - "high_critical_threshold": "mlxsw-gearbox{}/temp_trip_crit", + "high_threshold": "gearbox{}_temp_emergency", + "high_critical_threshold": "gearbox{}_temp_trip_crit", "type": "indexable" } } diff --git a/platform/mellanox/mlnx-platform-api/tests/conftest.py b/platform/mellanox/mlnx-platform-api/tests/conftest.py index b69fdd6c75f0..58fab1855795 100644 --- a/platform/mellanox/mlnx-platform-api/tests/conftest.py +++ b/platform/mellanox/mlnx-platform-api/tests/conftest.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -42,14 +42,3 @@ def auto_recover_mock(): utils.read_str_from_file = origin_read_str_from_file utils.write_file = origin_write_file utils.read_float_from_file = origin_read_float_from_file - - -@pytest.fixture(scope='function', autouse=True) -def auto_reset_cooling_level(): - from sonic_platform.thermal import Thermal - yield - Thermal.expect_cooling_level = None - Thermal.expect_cooling_state = None - Thermal.last_set_cooling_level = None - Thermal.last_set_cooling_state = None - Thermal.last_set_psu_cooling_level = None 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 151b197e0836..796518ad918d 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_fan_api.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_fan_api.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -124,8 +124,8 @@ def test_psu_fan_basic(self, mock_path_exists, mock_powergood, mock_presence, mo assert fan.get_presence() is False mock_path_exists.return_value = True assert fan.get_presence() is True - mock_read_int.return_value = 7 - assert fan.get_target_speed() == 70 + mock_read_int.return_value = int(255 / 10 * 7) + assert fan.get_target_speed() == 60 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 diff --git a/platform/mellanox/non-upstream-patches/external-changes.patch b/platform/mellanox/non-upstream-patches/external-changes.patch index 43372c2c1af5..0cda6fd9f7bf 100644 --- a/platform/mellanox/non-upstream-patches/external-changes.patch +++ b/platform/mellanox/non-upstream-patches/external-changes.patch @@ -1,6 +1,6 @@ --- a/patch/series +++ b/patch/series -@@ -111,6 +111,9 @@ +@@ -115,6 +115,9 @@ 0045-i2c-mlxcpld-Fix-criteria-for-frequency-setting.patch 0046-i2c-mlxcpld-Reduce-polling-time-for-performance-impr.patch 0047-i2c-mlxcpld-Allow-flexible-polling-time-setting-for-.patch @@ -10,7 +10,7 @@ 0053-mlxsw-core-Avoid-creation-virtual-hwmon-objects-by-t.patch 0054-mlxsw-minimal-Simplify-method-of-modules-number-dete.patch 0055-platform_data-mlxreg-Add-new-type-to-support-modular.patch -@@ -158,7 +161,68 @@ +@@ -162,7 +165,68 @@ 0097-1-mlxsw-Use-u16-for-local_port-field.patch 0097-2-mlxsw-i2c-Fix-chunk-size-setting.patch 0097-3-mlxsw-core_hwmon-Adjust-module-label-names.patch @@ -79,7 +79,7 @@ 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 -@@ -169,15 +233,119 @@ +@@ -173,14 +237,19 @@ 0164-hwmon-jc42-Add-support-for-Seiko-Instruments-S-34TS0.patch 0165-platform-mellanox-mlxreg-io-Add-locking-for-io-opera.patch 0166-DS-leds-leds-mlxreg-Send-udev-event-from-leds-mlxreg.patch @@ -87,7 +87,7 @@ +0168-TMP-mlxsw-minimal-Ignore-error-reading-SPAD-register.patch 0170-i2c-mlxcpld-Fix-register-setting-for-400KHz-frequenc.patch +0171-platform-mellanox-mlxreg-lc-Fix-cleanup-on-failure-a.patch -+0172-DS-platform-mlx-platform-Add-SPI-path-for-rack-switc.patch + 0172-DS-platform-mlx-platform-Add-SPI-path-for-rack-switc.patch 0173-mlxsw-core-Add-support-for-OSFP-transceiver-modules.patch +0174-DS-mlxsw-core_linecards-Skip-devlink-and-provisionin.patch 0175-hwmon-pmbus-Add-support-for-Infineon-Digital-Multi-p.patch @@ -96,24 +96,13 @@ 0178-platform-mellanox-Introduce-support-for-next-generat.patch 0180-hwmon-pmbus-Fix-sensors-readouts-for-MPS-Multi-phase.patch +0181-Revert-Fix-out-of-bounds-memory-accesses-in-thermal.patch -+0182-platform-mellanox-Introduce-support-of-new-Nvidia-L1.patch -+0183-platform-mellanox-Split-initialization-procedure.patch -+0184-platform-mellanox-Split-logic-in-init-and-exit-flow.patch -+0185-platform-mellanox-Extend-all-systems-with-I2C-notifi.patch - 0186-platform-mellanox-mlxreg-hotplug-Allow-more-flexible.patch -+0187-platform_data-mlxreg-Add-field-with-mapped-resource-.patch -+0188-i2c-mux-Add-register-map-based-mux-driver.patch -+0189-i2c-mlxcpld-Allow-driver-to-run-on-ARM64-architectur.patch -+0190-i2c-mlxcpld-Modify-base-address-type.patch -+0191-i2c-mlxcpld-Allow-to-configure-base-address-of-regis.patch -+0192-i2c-mlxcpld-Add-support-for-extended-transaction-len.patch -+0193-platform-mellanox-mlx-platform-Add-mux-selection-reg.patch -+0194-platform-mellanox-mlx-platform-Move-bus-shift-assign.patch -+0195-platform-mellanox-Add-support-for-dynamic-I2C-channe.patch -+0196-platform-mellanox-Relocate-mlx-platform-driver.patch -+0197-platform-mellanox-Add-initial-support-for-PCIe-based.patch -+0198-platform-mellanox-Introduce-support-for-switches-bas.patch -+0199-platform-mellanox-mlx-platform-Add-reset-and-extend-.patch + 0182-platform-mellanox-Introduce-support-of-new-Nvidia-L1.patch + 0183-platform-mellanox-Split-initialization-procedure.patch + 0184-platform-mellanox-Split-logic-in-init-and-exit-flow.patch +@@ -198,24 +267,121 @@ + 0197-platform-mellanox-Fix-order-in-exit-flow.patch + 0198-platform-mellanox-Add-new-attributes.patch + 0199-platform-mellanox-Change-register-offset-addresses.patch +0200-dt-bindings-i2c-mellanox-i2c-mlxbf-convert-txt-to-YA.patch +0203-i2c-mlxbf-remove-IRQF_ONESHOT.patch +0206-i2c-mlxbf-add-multi-slave-functionality.patch @@ -144,15 +133,11 @@ +0231-mlxbf_gige-remove-own-module-name-define-and-use-KBU.patch +0232-UBUNTU-SAUCE-mlxbf_gige-add-ethtool-mlxbf_gige_set_r.patch +0233-UBUNTU-SAUCE-Fix-OOB-handling-RX-packets-in-heavy-tr.patch -+0234-UBUNTU-SAUCE-mlxbf_gige-add-validation-of-ACPI-table.patch -+0235-UBUNTU-SAUCE-mlxbf_gige-set-driver-version-to-1.27.patch +0236-UBUNTU-SAUCE-mlxbf_gige-clear-MDIO-gateway-lock-afte.patch +0237-mlxbf_gige-compute-MDIO-period-based-on-i1clk.patch +0238-net-mlxbf_gige-Fix-an-IS_ERR-vs-NULL-bug-in-mlxbf_gi.patch +0239-UBUNTU-SAUCE-mlxbf_gige-add-MDIO-support-for-BlueFie.patch +0240-UBUNTU-SAUCE-mlxbf_gige-support-10M-100M-1G-speeds-o.patch -+0241-UBUNTU-SAUCE-mlxbf_gige-add-BlueField-3-Serdes-confi.patch -+0242-UBUNTU-SAUCE-mlxbf_gige-add-BlueField-3-ethtool_ops.patch +0243-UBUNTU-SAUCE-bluefield_edac-Add-SMC-support.patch +0244-UBUNTU-SAUCE-bluefield_edac-Update-license-and-copyr.patch +0245-gpio-mlxbf2-Convert-to-device-PM-ops.patch @@ -178,24 +163,81 @@ +0266-UBUNTU-SAUCE-mlxbf-pmc-Bug-fix-for-BlueField-3-count.patch +0267-UBUNTU-SAUCE-mmc-sdhci-of-dwcmshc-add-the-missing-de.patch +0268-DS-mlxsw-core_linecards-Disable-firmware-bundling-ma.patch -+0269-platform-mellanox-Cosmetic-changes.patch -+0270-platform-mellanox-Fix-order-in-exit-flow.patch -+0271-platform-mellanox-Add-new-attributes.patch -+0272-platform-mellanox-Change-register-offset-addresses.patch -+0273-platform-mellanox-Add-field-upgrade-capability-regis.patch -+0274-platform-mellanox-Modify-reset-causes-description.patch + 0269-platform-mellanox-Add-field-upgrade-capability-regis.patch + 0270-platform-mellanox-Modify-reset-causes-description.patch +0275-mlxsw-Use-u16-for-local_port-field-instead-of-u8.patch +0276-mlxsw-minimal-Change-type-for-local-port.patch +0277-mlxsw-i2c-Fix-chunk-size-setting-in-output-mailbox-b.patch -+0278-platform-mellanox-mlx-platform-Modify-graceful-shutd.patch -+0279-platform-mellanox-mlx-platform-Fix-signals-polarity-.patch -+0280-platform-mellanox-mlxreg-hotplug-Extend-condition-fo.patch -+0281-platform-mellanox-mlx-platform-Modify-health-and-pow.patch -+0282-platform-mellanox-mlx-platform-add-support-of-5th-CP.patch -+0283-mlxsw-core_hwmon-Align-modules-label-name-assignment.patch -+0284-platform-mellanox-mlx-platform-fix-CPLD4-PN-report.patch - 0285-platform-mellanox-nvsw-sn2201-change-fans-i2c-busses.patch + 0278-platform-mellanox-mlx-platform-Modify-graceful-shutd.patch + 0279-platform-mellanox-mlx-platform-Fix-signals-polarity-.patch + 0280-platform-mellanox-mlxreg-hotplug-Extend-condition-fo.patch + 0281-platform-mellanox-mlx-platform-Modify-health-and-pow.patch + 0282-platform-mellanox-mlx-platform-Add-reset-cause-attri.patch + 0284-platform-mellanox-mlx-platform-add-support-for-addit.patch ++0285-UBUNTU-SAUCE-mlxbf-gige-Fix-intermittent-no-ip-issue.patch ++0286-pinctrl-Introduce-struct-pinfunction-and-PINCTRL_PIN.patch ++0287-pinctrl-mlxbf3-Add-pinctrl-driver-support.patch ++0288-UBUNTU-SAUCE-gpio-mmio-handle-ngpios-properly-in-bgp.patch ++0289-UBUNTU-SAUCE-gpio-mlxbf3-Add-gpio-driver-support.patch ++0291-mlxsw-core_hwmon-Align-modules-label-name-assignment.patch ++0292-mlxsw-i2c-Limit-single-transaction-buffer-size.patch ++0293-mlxsw-reg-Limit-MTBR-register-records-buffer-by-one-.patch + 0294-hwmon-pmbus-Add-support-for-MPS-Multi-phase-mp2891-c.patch + 0295-dt-bindings-trivial-devices-Add-mps-mp2891.patch ++0296-UBUNTU-SAUCE-mmc-sdhci-of-dwcmshc-Add-runtime-PM-ope.patch ++0298-UBUNTU-SAUCE-mlxbf-ptm-use-0444-instead-of-S_IRUGO.patch ++0299-UBUNTU-SAUCE-mlxbf-ptm-add-atx-debugfs-nodes.patch ++0300-UBUNTU-SAUCE-mlxbf-ptm-update-module-version.patch ++0301-UBUNTU-SAUCE-mlxbf-gige-Fix-kernel-panic-at-shutdown.patch ++0302-UBUNTU-SAUCE-mlxbf-bootctl-support-SMC-call-for-sett.patch ++0303-UBUNTU-SAUCE-Add-BF3-related-ACPI-config-and-Ring-de.patch + 0304-platform-mellanox-mlx-platform-Modify-power-off-call.patch + 0305-Extend-driver-to-support-Infineon-Digital-Multi-phas.patch ++0306-dt-bindings-trivial-devices-Add-infineon-xdpe1a2g7.patch ++0307-leds-mlxreg-Add-support-for-new-flavour-of-capabilit.patch ++0308-leds-mlxreg-Remove-code-for-amber-LED-colour.patch ++0308-platform_data-mlxreg-Add-capability-bit-and-mask-fie.patch ++0309-hwmon-mlxreg-fan-Add-support-for-new-flavour-of-capa.patch ++0310-hwmon-mlxreg-fan-Extend-number-of-supporetd-fans.patch + 0311-platform-mellanox-nvsw-sn2201-change-fans-i2c-busses.patch + 0312-platform-mellanox-mlx-platform-Add-reset-callback.patch + 0313-platform-mellanox-mlx-platform-Prepare-driver-to-all.patch + 0314-platform-mellanox-mlx-platform-Introduce-ACPI-init-f.patch + 0315-platform-mellanox-mlx-platform-Get-interrupt-line-th.patch + 0316-platform-mellanox-Add-initial-support-for-PCIe-based.patch ++0317-platform-mellanox-Introduce-support-for-switches-equ.patch ++0318-mellanox-Relocate-mlx-platform-driver.patch ++0319-UBUNTU-SAUCE-mlxbf-tmfifo-fix-potential-race.patch ++0320-UBUNTU-SAUCE-mlxbf-tmfifo-Drop-the-Rx-packet-if-no-m.patch ++0321-UBUNTU-SAUCE-mlxbf-tmfifo-Drop-jumbo-frames.patch ++0322-UBUNTU-SAUCE-mlxbf-tmfifo.c-Amend-previous-tmfifo-pa.patch ++0323-mlxbf_gige-add-set_link_ksettings-ethtool-callback.patch ++0324-mlxbf_gige-fix-white-space-in-mlxbf_gige_eth_ioctl.patch ++0325-UBUNTU-SAUCE-mlxbf-bootctl-Fix-kernel-panic-due-to-b.patch ++0326-platform-mellanox-mlxreg-hotplug-Add-support-for-new.patch ++0327-platform-mellanox-mlx-platform-Change-register-name.patch ++0328-platform-mellanox-mlx-platform-Add-support-for-new-X.patch +9002-TMP-fix-for-fan-minimum-speed.patch ###-> mellanox_hw_mgmt-end # Cisco patches for 5.10 kernel + +--- a/patch/kconfig-inclusions ++++ b/patch/kconfig-inclusions +@@ -206,4 +206,15 @@ + [mellanox-arm64] + CONFIG_THERMAL_STATISTICS=n + CONFIG_THERMAL_WRITABLE_TRIPS=y +- ++CONFIG_SENSORS_MP2891=m ++CONFIG_MMC_SDHCI_OF_DWCMSHC=m ++CONFIG_VFIO_PLATFORM=m ++CONFIG_SENSORS_ARM_SCMI=m ++CONFIG_MLXBF_GIGE=m ++CONFIG_I2C_MLXBF=m ++CONFIG_GPIO_MLXBF3=m ++CONFIG_MLXBF_TMFIFO=m ++CONFIG_MLXBF_BOOTCTL=m ++CONFIG_MLXBF_PMC=m ++CONFIG_MLXBF_PTM=m ++ diff --git a/platform/mellanox/non-upstream-patches/patches/0172-DS-platform-mlx-platform-Add-SPI-path-for-rack-switc.patch b/platform/mellanox/non-upstream-patches/patches/0172-DS-platform-mlx-platform-Add-SPI-path-for-rack-switc.patch deleted file mode 100644 index b5ec0ea19a6f..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0172-DS-platform-mlx-platform-Add-SPI-path-for-rack-switc.patch +++ /dev/null @@ -1,84 +0,0 @@ -From b1e9734f4dc29c65e05a8f35ec67efb7784d321f Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Sun, 15 May 2022 14:31:10 +0300 -Subject: [PATCH backport 5.10 172/182] DS: platform: mlx-platform: Add SPI - path for rack switch for EROT access - -Create spidev for OOB access to External Root of Trusts devices. - -Signed-off-by: Vadim Pasternak ---- - drivers/platform/x86/mlx-platform.c | 16 ++++++++++++++++ - drivers/spi/spi.c | 1 + - 2 files changed, 17 insertions(+) - -diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c -index 3ad85934d6e3..135ccea3a34e 100644 ---- a/drivers/platform/x86/mlx-platform.c -+++ b/drivers/platform/x86/mlx-platform.c -@@ -16,6 +16,7 @@ - #include - #include - #include -+#include - - #define MLX_PLAT_DEVICE_NAME "mlxplat" - -@@ -2299,6 +2300,16 @@ struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_rack_switch_data = { - .mask_low = MLXPLAT_CPLD_LOW_AGGR_MASK_LOW, - }; - -+static struct spi_board_info rack_switch_switch_spi_board_info[] = { -+ { -+ .modalias = "spidev", -+ .irq = -1, -+ .max_speed_hz = 20000000, -+ .bus_num = 0, -+ .chip_select = 0, -+ }, -+}; -+ - /* Platform led default data */ - static struct mlxreg_core_data mlxplat_mlxcpld_default_led_data[] = { - { -@@ -5254,6 +5265,7 @@ static struct mlxreg_core_platform_data *mlxplat_fan; - static struct mlxreg_core_platform_data - *mlxplat_wd_data[MLXPLAT_CPLD_WD_MAX_DEVS]; - static const struct regmap_config *mlxplat_regmap_config; -+static struct spi_board_info *mlxplat_spi; - - static int __init mlxplat_dmi_default_matched(const struct dmi_system_id *dmi) - { -@@ -5551,6 +5563,7 @@ static int __init mlxplat_dmi_rack_switch_matched(const struct dmi_system_id *dm - 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; -+ mlxplat_spi = rack_switch_switch_spi_board_info; - - return 1; - } -@@ -5917,6 +5930,9 @@ static int __init mlxplat_init(void) - } - } - -+ if (mlxplat_spi) -+ spi_register_board_info(mlxplat_spi, 1); -+ - /* Add WD drivers. */ - err = mlxplat_mlxcpld_check_wd_capability(priv->regmap); - if (err) -diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c -index 857a1399850c..2efafa34ff22 100644 ---- a/drivers/spi/spi.c -+++ b/drivers/spi/spi.c -@@ -790,6 +790,7 @@ int spi_register_board_info(struct spi_board_info const *info, unsigned n) - - return 0; - } -+EXPORT_SYMBOL(spi_register_board_info); - - /*-------------------------------------------------------------------------*/ - --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0182-platform-mellanox-Introduce-support-of-new-Nvidia-L1.patch b/platform/mellanox/non-upstream-patches/patches/0182-platform-mellanox-Introduce-support-of-new-Nvidia-L1.patch deleted file mode 100644 index 40e28f821fef..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0182-platform-mellanox-Introduce-support-of-new-Nvidia-L1.patch +++ /dev/null @@ -1,647 +0,0 @@ -From 74ab8a216510df924ca88d2f3d5944eb107264d0 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Sun, 11 Dec 2022 09:26:48 +0200 -Subject: [PATCH backport 5.10 1/5] platform: mellanox: Introduce support of - new Nvidia L1 switch - -Add support for new L1 switch nodes providing L1 connectivity for -multi-node networking chassis. - -The purpose is to provide compute server with full management and IO -subsystems with connections to L1 switches. - -System contains the following components: -- COMe module based on Intel Coffee Lake CPU -- Switch baseboard with two ASICs, while - 24 ports of each ASICs are connected to one backplane connector - 32 ports of each ASIC are connected to 8 OSFPs -- Integrated 60mm dual-rotor FANs inside L1 node (N+2 redundancy) -- Support 48V or 54V DC input from the external power server. - -Add the structures related to the new systems to allow proper activation -of the all required platform driver. - -Add poweroff callback to support deep power cycle flow, which should -include special actions against CPLD device for performing graceful -operation. - -Signed-off-by: Vadim Pasternak ---- - drivers/platform/x86/mlx-platform.c | 395 +++++++++++++++++++++++++++- - 1 file changed, 393 insertions(+), 2 deletions(-) - -diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c -index 4bbe1d8f0..a2addd1b3 100644 ---- a/drivers/platform/x86/mlx-platform.c -+++ b/drivers/platform/x86/mlx-platform.c -@@ -15,6 +15,7 @@ - #include - #include - #include -+#include - #include - #include - -@@ -62,12 +63,19 @@ - #define MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET 0x37 - #define MLXPLAT_CPLD_LPC_REG_AGGR_OFFSET 0x3a - #define MLXPLAT_CPLD_LPC_REG_AGGR_MASK_OFFSET 0x3b -+#define MLXPLAT_CPLD_LPC_REG_DBG1_OFFSET 0x3c -+#define MLXPLAT_CPLD_LPC_REG_DBG2_OFFSET 0x3d -+#define MLXPLAT_CPLD_LPC_REG_DBG3_OFFSET 0x3e -+#define MLXPLAT_CPLD_LPC_REG_DBG4_OFFSET 0x3f - #define MLXPLAT_CPLD_LPC_REG_AGGRLO_OFFSET 0x40 - #define MLXPLAT_CPLD_LPC_REG_AGGRLO_MASK_OFFSET 0x41 - #define MLXPLAT_CPLD_LPC_REG_AGGRCO_OFFSET 0x42 - #define MLXPLAT_CPLD_LPC_REG_AGGRCO_MASK_OFFSET 0x43 - #define MLXPLAT_CPLD_LPC_REG_AGGRCX_OFFSET 0x44 - #define MLXPLAT_CPLD_LPC_REG_AGGRCX_MASK_OFFSET 0x45 -+#define MLXPLAT_CPLD_LPC_REG_BRD_OFFSET 0x47 -+#define MLXPLAT_CPLD_LPC_REG_BRD_EVENT_OFFSET 0x48 -+#define MLXPLAT_CPLD_LPC_REG_BRD_MASK_OFFSET 0x49 - #define MLXPLAT_CPLD_LPC_REG_GWP_OFFSET 0x4a - #define MLXPLAT_CPLD_LPC_REG_GWP_EVENT_OFFSET 0x4b - #define MLXPLAT_CPLD_LPC_REG_GWP_MASK_OFFSET 0x4c -@@ -97,6 +105,9 @@ - #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_PWRB_OFFSET 0x97 -+#define MLXPLAT_CPLD_LPC_REG_PWRB_EVENT_OFFSET 0x98 -+#define MLXPLAT_CPLD_LPC_REG_PWRB_MASK_OFFSET 0x99 - #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 -@@ -128,6 +139,7 @@ - #define MLXPLAT_CPLD_LPC_REG_WD3_TMR_OFFSET 0xd1 - #define MLXPLAT_CPLD_LPC_REG_WD3_TLEFT_OFFSET 0xd2 - #define MLXPLAT_CPLD_LPC_REG_WD3_ACT_OFFSET 0xd3 -+#define MLXPLAT_CPLD_LPC_REG_DBG_CTRL_OFFSET 0xd9 - #define MLXPLAT_CPLD_LPC_REG_CPLD1_MVER_OFFSET 0xde - #define MLXPLAT_CPLD_LPC_REG_CPLD2_MVER_OFFSET 0xdf - #define MLXPLAT_CPLD_LPC_REG_CPLD3_MVER_OFFSET 0xe0 -@@ -211,6 +223,7 @@ - MLXPLAT_CPLD_AGGR_MASK_LC_SDWN) - #define MLXPLAT_CPLD_LOW_AGGR_MASK_LOW 0xc1 - #define MLXPLAT_CPLD_LOW_AGGR_MASK_ASIC2 BIT(2) -+#define MLXPLAT_CPLD_LOW_AGGR_MASK_PWR_BUT BIT(4) - #define MLXPLAT_CPLD_LOW_AGGR_MASK_I2C BIT(6) - #define MLXPLAT_CPLD_PSU_MASK GENMASK(1, 0) - #define MLXPLAT_CPLD_PWR_MASK GENMASK(1, 0) -@@ -225,6 +238,16 @@ - #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_PWR_BUTTON_MASK BIT(0) -+#define MLXPLAT_CPLD_LATCH_RST_MASK BIT(5) -+#define MLXPLAT_CPLD_THERMAL1_PDB_MASK BIT(3) -+#define MLXPLAT_CPLD_THERMAL2_PDB_MASK BIT(4) -+#define MLXPLAT_CPLD_INTRUSION_MASK BIT(6) -+#define MLXPLAT_CPLD_PWM_PG_MASK BIT(7) -+#define MLXPLAT_CPLD_L1_CHA_HEALTH_MASK (MLXPLAT_CPLD_THERMAL1_PDB_MASK | \ -+ MLXPLAT_CPLD_THERMAL2_PDB_MASK | \ -+ MLXPLAT_CPLD_INTRUSION_MASK |\ -+ MLXPLAT_CPLD_PWM_PG_MASK) - #define MLXPLAT_CPLD_I2C_CAP_BIT 0x04 - #define MLXPLAT_CPLD_I2C_CAP_MASK GENMASK(5, MLXPLAT_CPLD_I2C_CAP_BIT) - -@@ -237,6 +260,8 @@ - /* Masks for aggregation for modular systems */ - #define MLXPLAT_CPLD_LPC_LC_MASK GENMASK(7, 0) - -+#define MLXPLAT_CPLD_HALT_MASK BIT(3) -+ - /* Default I2C parent bus number */ - #define MLXPLAT_CPLD_PHYS_ADAPTER_DEF_NR 1 - -@@ -317,6 +342,8 @@ struct mlxplat_priv { - void *regmap; - }; - -+static struct platform_device *mlxplat_dev; -+ - /* Regions for LPC I2C controller and LPC base register space */ - static const struct resource mlxplat_lpc_resources[] = { - [0] = DEFINE_RES_NAMED(MLXPLAT_CPLD_LPC_I2C_BASE_ADRR, -@@ -476,7 +503,7 @@ static struct i2c_mux_reg_platform_data mlxplat_modular_mux_data[] = { - }, - }; - --/* Platform channels for rack swicth system family */ -+/* Platform channels for rack switch 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, - }; -@@ -2409,6 +2436,156 @@ struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_rack_switch_data = { - .mask_low = MLXPLAT_CPLD_LOW_AGGR_MASK_LOW, - }; - -+/* Callback performs graceful shutdown after notification about power button event */ -+static int -+mlxplat_mlxcpld_l1_switch_pwr_events_handler(void *handle, enum mlxreg_hotplug_kind kind, -+ u8 action) -+{ -+ dev_info(&mlxplat_dev->dev, "System shutdown due to short press of power button"); -+ kernel_halt(); -+ return 0; -+} -+ -+static struct mlxreg_core_hotplug_notifier mlxplat_mlxcpld_l1_switch_pwr_events_notifier = { -+ .user_handler = mlxplat_mlxcpld_l1_switch_pwr_events_handler, -+}; -+ -+/* Platform hotplug for l1 switch systems family data */ -+static struct mlxreg_core_data mlxplat_mlxcpld_l1_switch_pwr_events_items_data[] = { -+ { -+ .label = "power_button", -+ .reg = MLXPLAT_CPLD_LPC_REG_PWRB_OFFSET, -+ .mask = MLXPLAT_CPLD_PWR_BUTTON_MASK, -+ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, -+ .hpdev.notifier = &mlxplat_mlxcpld_l1_switch_pwr_events_notifier, -+ }, -+}; -+ -+/* Callback activates latch reset flow after notification about intrusion event */ -+static int -+mlxplat_mlxcpld_l1_switch_intrusion_events_handler(void *handle, enum mlxreg_hotplug_kind kind, -+ u8 action) -+{ -+ struct mlxplat_priv *priv = platform_get_drvdata(mlxplat_dev); -+ u32 regval; -+ int err; -+ -+ err = regmap_read(priv->regmap, MLXPLAT_CPLD_LPC_REG_GP1_OFFSET, ®val); -+ if (err) -+ goto fail_regmap_read; -+ -+ if (action) { -+ dev_info(&mlxplat_dev->dev, "Detected intrusion - system latch is opened"); -+ err = regmap_write(priv->regmap, MLXPLAT_CPLD_LPC_REG_GP1_OFFSET, -+ regval | MLXPLAT_CPLD_LATCH_RST_MASK); -+ } else { -+ dev_info(&mlxplat_dev->dev, "System latch is properly closed"); -+ err = regmap_write(priv->regmap, MLXPLAT_CPLD_LPC_REG_GP1_OFFSET, -+ regval & ~MLXPLAT_CPLD_LATCH_RST_MASK); -+ } -+ -+ if (err) -+ goto fail_regmap_write; -+ -+ return 0; -+ -+fail_regmap_read: -+fail_regmap_write: -+ dev_err(&mlxplat_dev->dev, "Register access failed"); -+ return err; -+} -+ -+static struct mlxreg_core_hotplug_notifier mlxplat_mlxcpld_l1_switch_intrusion_events_notifier = { -+ .user_handler = mlxplat_mlxcpld_l1_switch_intrusion_events_handler, -+}; -+ -+static struct mlxreg_core_data mlxplat_mlxcpld_l1_switch_health_events_items_data[] = { -+ { -+ .label = "thermal1_pdb", -+ .reg = MLXPLAT_CPLD_LPC_REG_BRD_OFFSET, -+ .mask = MLXPLAT_CPLD_THERMAL1_PDB_MASK, -+ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, -+ }, -+ { -+ .label = "thermal2_pdb", -+ .reg = MLXPLAT_CPLD_LPC_REG_BRD_OFFSET, -+ .mask = MLXPLAT_CPLD_THERMAL2_PDB_MASK, -+ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, -+ }, -+ { -+ .label = "intrusion", -+ .reg = MLXPLAT_CPLD_LPC_REG_BRD_OFFSET, -+ .mask = MLXPLAT_CPLD_INTRUSION_MASK, -+ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, -+ .hpdev.notifier = &mlxplat_mlxcpld_l1_switch_intrusion_events_notifier, -+ }, -+ { -+ .label = "pwm_pg", -+ .reg = MLXPLAT_CPLD_LPC_REG_BRD_OFFSET, -+ .mask = MLXPLAT_CPLD_PWM_PG_MASK, -+ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, -+ }, -+}; -+ -+static struct mlxreg_core_item mlxplat_mlxcpld_l1_switch_events_items[] = { -+ { -+ .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, -+ }, -+ { -+ .data = mlxplat_mlxcpld_l1_switch_pwr_events_items_data, -+ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, -+ .reg = MLXPLAT_CPLD_LPC_REG_PWRB_OFFSET, -+ .mask = MLXPLAT_CPLD_PWR_BUTTON_MASK, -+ .count = ARRAY_SIZE(mlxplat_mlxcpld_l1_switch_pwr_events_items_data), -+ .inversed = 0, -+ .health = false, -+ }, -+ { -+ .data = mlxplat_mlxcpld_l1_switch_health_events_items_data, -+ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, -+ .reg = MLXPLAT_CPLD_LPC_REG_BRD_OFFSET, -+ .mask = MLXPLAT_CPLD_L1_CHA_HEALTH_MASK, -+ .count = ARRAY_SIZE(mlxplat_mlxcpld_l1_switch_health_events_items_data), -+ .inversed = 0, -+ .health = false, -+ .ind = 8, -+ }, -+}; -+ -+static -+struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_l1_switch_data = { -+ .items = mlxplat_mlxcpld_l1_switch_events_items, -+ .counter = ARRAY_SIZE(mlxplat_mlxcpld_l1_switch_events_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_PWR_BUT, -+}; -+ - static struct spi_board_info rack_switch_switch_spi_board_info[] = { - { - .modalias = "spidev", -@@ -3066,6 +3243,114 @@ static struct mlxreg_core_platform_data mlxplat_qmb8700_led_data = { - .counter = ARRAY_SIZE(mlxplat_mlxcpld_qmb8700_led_data), - }; - -+/* Platform led data for chassis system */ -+static struct mlxreg_core_data mlxplat_mlxcpld_l1_switch_led_data[] = { -+ { -+ .label = "status:green", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED1_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, -+ }, -+ { -+ .label = "status:orange", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED1_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK -+ }, -+ { -+ .label = "fan1:green", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED2_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .bit = BIT(0), -+ }, -+ { -+ .label = "fan1:orange", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED2_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .bit = BIT(0), -+ }, -+ { -+ .label = "fan2:green", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED2_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .bit = BIT(1), -+ }, -+ { -+ .label = "fan2:orange", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED2_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .bit = BIT(1), -+ }, -+ { -+ .label = "fan3:green", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED3_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .bit = BIT(2), -+ }, -+ { -+ .label = "fan3:orange", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED3_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .bit = BIT(2), -+ }, -+ { -+ .label = "fan4:green", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED3_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .bit = BIT(3), -+ }, -+ { -+ .label = "fan4:orange", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED3_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .bit = BIT(3), -+ }, -+ { -+ .label = "fan5:green", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED4_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .bit = BIT(4), -+ }, -+ { -+ .label = "fan5:orange", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED4_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .bit = BIT(4), -+ }, -+ { -+ .label = "fan6:green", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED4_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .bit = BIT(5), -+ }, -+ { -+ .label = "fan6:orange", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED4_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .bit = BIT(5), -+ }, -+ { -+ .label = "uid:blue", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED5_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, -+ }, -+}; -+ -+static struct mlxreg_core_platform_data mlxplat_l1_switch_led_data = { -+ .data = mlxplat_mlxcpld_l1_switch_led_data, -+ .counter = ARRAY_SIZE(mlxplat_mlxcpld_l1_switch_led_data), -+}; -+ - /* Platform register access default */ - static struct mlxreg_core_data mlxplat_mlxcpld_default_regs_io_data[] = { - { -@@ -3594,12 +3879,48 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { - .mask = GENMASK(7, 0) & ~BIT(3), - .mode = 0200, - }, -+ { -+ .label = "deep_pwr_cycle", -+ .reg = MLXPLAT_CPLD_LPC_REG_GP1_OFFSET, -+ .mask = GENMASK(7, 0) & ~BIT(5), -+ .mode = 0200, -+ }, -+ { -+ .label = "latch_reset", -+ .reg = MLXPLAT_CPLD_LPC_REG_GP1_OFFSET, -+ .mask = GENMASK(7, 0) & ~BIT(5), -+ .mode = 0200, -+ }, - { - .label = "jtag_enable", - .reg = MLXPLAT_CPLD_LPC_REG_GP2_OFFSET, - .mask = GENMASK(7, 0) & ~BIT(4), - .mode = 0644, - }, -+ { -+ .label = "dbg1", -+ .reg = MLXPLAT_CPLD_LPC_REG_DBG1_OFFSET, -+ .bit = GENMASK(7, 0), -+ .mode = 0644, -+ }, -+ { -+ .label = "dbg2", -+ .reg = MLXPLAT_CPLD_LPC_REG_DBG2_OFFSET, -+ .bit = GENMASK(7, 0), -+ .mode = 0644, -+ }, -+ { -+ .label = "dbg3", -+ .reg = MLXPLAT_CPLD_LPC_REG_DBG3_OFFSET, -+ .bit = GENMASK(7, 0), -+ .mode = 0644, -+ }, -+ { -+ .label = "dbg4", -+ .reg = MLXPLAT_CPLD_LPC_REG_DBG4_OFFSET, -+ .bit = GENMASK(7, 0), -+ .mode = 0644, -+ }, - { - .label = "asic_health", - .reg = MLXPLAT_CPLD_LPC_REG_ASIC_HEALTH_OFFSET, -@@ -4913,11 +5234,18 @@ static bool mlxplat_mlxcpld_writeable_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_SAFE_BIOS_OFFSET: - case MLXPLAT_CPLD_LPC_SAFE_BIOS_WP_OFFSET: - case MLXPLAT_CPLD_LPC_REG_AGGR_MASK_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_DBG1_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_DBG2_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_DBG3_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_DBG4_OFFSET: - case MLXPLAT_CPLD_LPC_REG_AGGRLO_MASK_OFFSET: - case MLXPLAT_CPLD_LPC_REG_AGGRCO_MASK_OFFSET: - case MLXPLAT_CPLD_LPC_REG_AGGRCX_MASK_OFFSET: - case MLXPLAT_CPLD_LPC_REG_GWP_EVENT_OFFSET: - case MLXPLAT_CPLD_LPC_REG_GWP_MASK_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_BRD_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_BRD_EVENT_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_BRD_MASK_OFFSET: - case MLXPLAT_CPLD_LPC_REG_ASIC_EVENT_OFFSET: - case MLXPLAT_CPLD_LPC_REG_ASIC_MASK_OFFSET: - case MLXPLAT_CPLD_LPC_REG_ASIC2_EVENT_OFFSET: -@@ -4932,6 +5260,8 @@ static bool mlxplat_mlxcpld_writeable_reg(struct device *dev, unsigned int reg) - 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_PWRB_EVENT_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_PWRB_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: -@@ -4960,6 +5290,7 @@ static bool mlxplat_mlxcpld_writeable_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_REG_WD3_TMR_OFFSET: - case MLXPLAT_CPLD_LPC_REG_WD3_TLEFT_OFFSET: - case MLXPLAT_CPLD_LPC_REG_WD3_ACT_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_DBG_CTRL_OFFSET: - case MLXPLAT_CPLD_LPC_REG_PWM1_OFFSET: - case MLXPLAT_CPLD_LPC_REG_PWM2_OFFSET: - case MLXPLAT_CPLD_LPC_REG_PWM3_OFFSET: -@@ -5010,6 +5341,10 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_SAFE_BIOS_WP_OFFSET: - case MLXPLAT_CPLD_LPC_REG_AGGR_OFFSET: - case MLXPLAT_CPLD_LPC_REG_AGGR_MASK_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_DBG1_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_DBG2_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_DBG3_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_DBG4_OFFSET: - case MLXPLAT_CPLD_LPC_REG_AGGRLO_OFFSET: - case MLXPLAT_CPLD_LPC_REG_AGGRLO_MASK_OFFSET: - case MLXPLAT_CPLD_LPC_REG_AGGRCO_OFFSET: -@@ -5019,6 +5354,9 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_REG_GWP_OFFSET: - case MLXPLAT_CPLD_LPC_REG_GWP_EVENT_OFFSET: - case MLXPLAT_CPLD_LPC_REG_GWP_MASK_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_BRD_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_BRD_EVENT_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_BRD_MASK_OFFSET: - case MLXPLAT_CPLD_LPC_REG_ASIC_HEALTH_OFFSET: - case MLXPLAT_CPLD_LPC_REG_ASIC_EVENT_OFFSET: - case MLXPLAT_CPLD_LPC_REG_ASIC_MASK_OFFSET: -@@ -5040,6 +5378,9 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) - 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_PWRB_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_PWRB_EVENT_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_PWRB_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: -@@ -5076,6 +5417,7 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_REG_WD3_TMR_OFFSET: - case MLXPLAT_CPLD_LPC_REG_WD3_TLEFT_OFFSET: - case MLXPLAT_CPLD_LPC_REG_WD3_ACT_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_DBG_CTRL_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD1_MVER_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD2_MVER_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD3_MVER_OFFSET: -@@ -5152,6 +5494,10 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_SAFE_BIOS_WP_OFFSET: - case MLXPLAT_CPLD_LPC_REG_AGGR_OFFSET: - case MLXPLAT_CPLD_LPC_REG_AGGR_MASK_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_DBG1_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_DBG2_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_DBG3_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_DBG4_OFFSET: - case MLXPLAT_CPLD_LPC_REG_AGGRLO_OFFSET: - case MLXPLAT_CPLD_LPC_REG_AGGRLO_MASK_OFFSET: - case MLXPLAT_CPLD_LPC_REG_AGGRCO_OFFSET: -@@ -5161,6 +5507,9 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_REG_GWP_OFFSET: - case MLXPLAT_CPLD_LPC_REG_GWP_EVENT_OFFSET: - case MLXPLAT_CPLD_LPC_REG_GWP_MASK_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_BRD_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_BRD_EVENT_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_BRD_MASK_OFFSET: - case MLXPLAT_CPLD_LPC_REG_ASIC_HEALTH_OFFSET: - case MLXPLAT_CPLD_LPC_REG_ASIC_EVENT_OFFSET: - case MLXPLAT_CPLD_LPC_REG_ASIC_MASK_OFFSET: -@@ -5182,6 +5531,9 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) - 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_PWRB_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_PWRB_EVENT_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_PWRB_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: -@@ -5212,6 +5564,7 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_REG_WD2_TLEFT_OFFSET: - case MLXPLAT_CPLD_LPC_REG_WD3_TMR_OFFSET: - case MLXPLAT_CPLD_LPC_REG_WD3_TLEFT_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_DBG_CTRL_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD1_MVER_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD2_MVER_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD3_MVER_OFFSET: -@@ -5407,7 +5760,6 @@ static struct resource mlxplat_mlxcpld_resources[] = { - [0] = DEFINE_RES_IRQ_NAMED(MLXPLAT_CPLD_LPC_SYSIRQ, "mlxreg-hotplug"), - }; - --static struct platform_device *mlxplat_dev; - static struct mlxreg_core_hotplug_platform_data *mlxplat_i2c; - static struct mlxreg_core_hotplug_platform_data *mlxplat_hotplug; - static struct mlxreg_core_platform_data *mlxplat_led; -@@ -5418,6 +5770,14 @@ static struct mlxreg_core_platform_data - static const struct regmap_config *mlxplat_regmap_config; - static struct spi_board_info *mlxplat_spi; - -+/* Platform default poweroff function */ -+static void mlxplat_poweroff(void) -+{ -+ struct mlxplat_priv *priv = platform_get_drvdata(mlxplat_dev); -+ -+ regmap_write(priv->regmap, MLXPLAT_CPLD_LPC_REG_GP1_OFFSET, MLXPLAT_CPLD_HALT_MASK); -+} -+ - static int __init mlxplat_dmi_default_matched(const struct dmi_system_id *dmi) - { - int i; -@@ -5740,6 +6100,29 @@ static int __init mlxplat_dmi_ng800_matched(const struct dmi_system_id *dmi) - return 1; - } - -+static int __init mlxplat_dmi_l1_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_l1_switch_data; -+ mlxplat_hotplug->deferred_nr = -+ mlxplat_msn21xx_channels[MLXPLAT_CPLD_GRP_CHNL_NUM - 1]; -+ mlxplat_led = &mlxplat_l1_switch_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; -+ pm_power_off = mlxplat_poweroff; -+ mlxplat_spi = rack_switch_switch_spi_board_info; -+ -+ return 1; -+} -+ - static const struct dmi_system_id mlxplat_dmi_table[] __initconst = { - { - .callback = mlxplat_dmi_default_wc_matched, -@@ -5835,6 +6218,12 @@ static const struct dmi_system_id mlxplat_dmi_table[] __initconst = { - DMI_MATCH(DMI_BOARD_NAME, "VMOD0015"), - }, - }, -+ { -+ .callback = mlxplat_dmi_l1_switch_matched, -+ .matches = { -+ DMI_MATCH(DMI_BOARD_NAME, "VMOD0017"), -+ }, -+ }, - { - .callback = mlxplat_dmi_msn274x_matched, - .matches = { -@@ -6167,6 +6556,8 @@ static void __exit mlxplat_exit(void) - struct mlxplat_priv *priv = platform_get_drvdata(mlxplat_dev); - int i; - -+ if (pm_power_off) -+ pm_power_off = NULL; - for (i = MLXPLAT_CPLD_WD_MAX_DEVS - 1; i >= 0 ; i--) - platform_device_unregister(priv->pdev_wd[i]); - if (priv->pdev_fan) --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0183-platform-mellanox-Split-initialization-procedure.patch b/platform/mellanox/non-upstream-patches/patches/0183-platform-mellanox-Split-initialization-procedure.patch deleted file mode 100644 index deb8591ae1c3..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0183-platform-mellanox-Split-initialization-procedure.patch +++ /dev/null @@ -1,168 +0,0 @@ -From 5a2cfa144640a047ab17de5ef12dfefbe7e2f8c3 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Sun, 11 Dec 2022 10:44:43 +0200 -Subject: [PATCH backport 5.10 2/5] platform: mellanox: Split initialization - procedure - -Split mlxplat_init() into two by adding mlxplat_pre_init(). - -Motivation is to prepare 'mlx-platform' driver to support systems -equipped PCIe based programming logic device. - -Such systems are supposed to use different system resources, thus this -commit separates resources allocation related code. - -Signed-off-by: Vadim Pasternak ---- - drivers/platform/x86/mlx-platform.c | 78 ++++++++++++++++++++++------- - 1 file changed, 60 insertions(+), 18 deletions(-) - -diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c -index a2addd1b3..199f22d72 100644 ---- a/drivers/platform/x86/mlx-platform.c -+++ b/drivers/platform/x86/mlx-platform.c -@@ -330,6 +330,8 @@ - * @pdev_fan - FAN platform devices - * @pdev_wd - array of watchdog platform devices - * @regmap: device register map -+ * @hotplug_resources: system hotplug resources -+ * @hotplug_resources_size: size of system hotplug resources - */ - struct mlxplat_priv { - struct platform_device *pdev_i2c; -@@ -340,6 +342,8 @@ struct mlxplat_priv { - struct platform_device *pdev_fan; - struct platform_device *pdev_wd[MLXPLAT_CPLD_WD_MAX_DEVS]; - void *regmap; -+ struct resource *hotplug_resources; -+ unsigned int hotplug_resources_size; - }; - - static struct platform_device *mlxplat_dev; -@@ -6365,20 +6369,63 @@ static int mlxplat_mlxcpld_check_wd_capability(void *regmap) - return 0; - } - -+static int mlxplat_lpc_cpld_device_init(struct resource **hotplug_resources, -+ unsigned int *hotplug_resources_size) -+{ -+ int err; -+ -+ mlxplat_dev = platform_device_register_simple(MLX_PLAT_DEVICE_NAME, PLATFORM_DEVID_NONE, -+ mlxplat_lpc_resources, -+ ARRAY_SIZE(mlxplat_lpc_resources)); -+ if (IS_ERR(mlxplat_dev)) -+ return PTR_ERR(mlxplat_dev); -+ -+ mlxplat_mlxcpld_regmap_ctx.base = devm_ioport_map(&mlxplat_dev->dev, -+ mlxplat_lpc_resources[1].start, 1); -+ if (!mlxplat_mlxcpld_regmap_ctx.base) { -+ err = -ENOMEM; -+ goto fail_devm_ioport_map; -+ } -+ -+ *hotplug_resources = mlxplat_mlxcpld_resources; -+ *hotplug_resources_size = ARRAY_SIZE(mlxplat_mlxcpld_resources); -+ -+ return 0; -+ -+fail_devm_ioport_map: -+ platform_device_unregister(mlxplat_dev); -+ return err; -+} -+ -+static void mlxplat_lpc_cpld_device_exit(void) -+{ -+ platform_device_unregister(mlxplat_dev); -+} -+ -+static int -+mlxplat_pre_init(struct resource **hotplug_resources, unsigned int *hotplug_resources_size) -+{ -+ return mlxplat_lpc_cpld_device_init(hotplug_resources, hotplug_resources_size); -+} -+ -+static void mlxplat_post_exit(void) -+{ -+ mlxplat_lpc_cpld_device_exit(); -+} -+ - static int __init mlxplat_init(void) - { -+ unsigned int hotplug_resources_size; -+ struct resource *hotplug_resources; - struct mlxplat_priv *priv; - int i, j, nr, err; - - if (!dmi_check_system(mlxplat_dmi_table)) - return -ENODEV; - -- mlxplat_dev = platform_device_register_simple(MLX_PLAT_DEVICE_NAME, -1, -- mlxplat_lpc_resources, -- ARRAY_SIZE(mlxplat_lpc_resources)); -- -- if (IS_ERR(mlxplat_dev)) -- return PTR_ERR(mlxplat_dev); -+ err = mlxplat_pre_init(&hotplug_resources, &hotplug_resources_size); -+ if (err) -+ return err; - - priv = devm_kzalloc(&mlxplat_dev->dev, sizeof(struct mlxplat_priv), - GFP_KERNEL); -@@ -6388,12 +6435,8 @@ static int __init mlxplat_init(void) - } - platform_set_drvdata(mlxplat_dev, priv); - -- mlxplat_mlxcpld_regmap_ctx.base = devm_ioport_map(&mlxplat_dev->dev, -- mlxplat_lpc_resources[1].start, 1); -- if (!mlxplat_mlxcpld_regmap_ctx.base) { -- err = -ENOMEM; -- goto fail_alloc; -- } -+ priv->hotplug_resources = hotplug_resources; -+ priv->hotplug_resources_size = hotplug_resources_size; - - if (!mlxplat_regmap_config) - mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config; -@@ -6414,8 +6457,8 @@ static int __init mlxplat_init(void) - if (mlxplat_i2c) - mlxplat_i2c->regmap = priv->regmap; - priv->pdev_i2c = platform_device_register_resndata(&mlxplat_dev->dev, "i2c_mlxcpld", -- nr, mlxplat_mlxcpld_resources, -- ARRAY_SIZE(mlxplat_mlxcpld_resources), -+ nr, priv->hotplug_resources, -+ priv->hotplug_resources_size, - mlxplat_i2c, sizeof(*mlxplat_i2c)); - if (IS_ERR(priv->pdev_i2c)) { - err = PTR_ERR(priv->pdev_i2c); -@@ -6439,8 +6482,8 @@ static int __init mlxplat_init(void) - priv->pdev_hotplug = - platform_device_register_resndata(&mlxplat_dev->dev, - "mlxreg-hotplug", PLATFORM_DEVID_NONE, -- mlxplat_mlxcpld_resources, -- ARRAY_SIZE(mlxplat_mlxcpld_resources), -+ priv->hotplug_resources, -+ priv->hotplug_resources_size, - mlxplat_hotplug, sizeof(*mlxplat_hotplug)); - if (IS_ERR(priv->pdev_hotplug)) { - err = PTR_ERR(priv->pdev_hotplug); -@@ -6545,7 +6588,6 @@ static int __init mlxplat_init(void) - platform_device_unregister(priv->pdev_mux[i]); - platform_device_unregister(priv->pdev_i2c); - fail_alloc: -- platform_device_unregister(mlxplat_dev); - - return err; - } -@@ -6573,7 +6615,7 @@ static void __exit mlxplat_exit(void) - platform_device_unregister(priv->pdev_mux[i]); - - platform_device_unregister(priv->pdev_i2c); -- platform_device_unregister(mlxplat_dev); -+ mlxplat_post_exit(); - } - module_exit(mlxplat_exit); - --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0184-platform-mellanox-Split-logic-in-init-and-exit-flow.patch b/platform/mellanox/non-upstream-patches/patches/0184-platform-mellanox-Split-logic-in-init-and-exit-flow.patch deleted file mode 100644 index 3810a2dc03a9..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0184-platform-mellanox-Split-logic-in-init-and-exit-flow.patch +++ /dev/null @@ -1,455 +0,0 @@ -From f00081a6e0b7af5a0b85db3121afe3cc6a62f9e7 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Sun, 11 Dec 2022 11:08:07 +0200 -Subject: [PATCH backport 5.10 072/150] platform: mellanox: Split logic in init - and exit flow - -Split logic in mlxplat_init()/mlxplat_exit() routines. -Separate initialization of I2C infrastructure and others platform -drivers. - -Motivation is to provide synchronization between I2C bus and mux -drivers and other drivers using this infrastructure. -I2C main bus and MUX busses are implemented in FPGA logic. On some new -systems the numbers allocated for these busses could be variable -depending on order of initialization of I2C native busses. Since bus -numbers are passed to some other platform drivers during initialization -flow, it is necessary to synchronize completion of I2C infrastructure -drivers and activation of rest of drivers. - -Thus initialization flow will be performed in synchronized order. - -Signed-off-by: Vadim Pasternak ---- - drivers/platform/x86/mlx-platform.c | 313 ++++++++++++++++++---------- - 1 file changed, 204 insertions(+), 109 deletions(-) - -diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c -index 199f22d72..05a630135 100644 ---- a/drivers/platform/x86/mlx-platform.c -+++ b/drivers/platform/x86/mlx-platform.c -@@ -321,6 +321,9 @@ - /* Default value for PWM control register for rack switch system */ - #define MLXPLAT_REGMAP_NVSWITCH_PWM_DEFAULT 0xf4 - -+#define MLXPLAT_I2C_MAIN_BUS_NOTIFIED 0x01 -+#define MLXPLAT_I2C_MAIN_BUS_HANDLE_CREATED 0x02 -+ - /* mlxplat_priv - platform private data - * @pdev_i2c - i2c controller platform device - * @pdev_mux - array of mux platform devices -@@ -332,6 +335,7 @@ - * @regmap: device register map - * @hotplug_resources: system hotplug resources - * @hotplug_resources_size: size of system hotplug resources -+ * @hi2c_main_init_status: init status of I2C main bus - */ - struct mlxplat_priv { - struct platform_device *pdev_i2c; -@@ -344,9 +348,11 @@ struct mlxplat_priv { - void *regmap; - struct resource *hotplug_resources; - unsigned int hotplug_resources_size; -+ u8 i2c_main_init_status; - }; - - static struct platform_device *mlxplat_dev; -+static int mlxplat_i2c_main_complition_notify(void *handle, int id); - - /* Regions for LPC I2C controller and LPC base register space */ - static const struct resource mlxplat_lpc_resources[] = { -@@ -381,6 +387,7 @@ static struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_i2c_ng_data = { - .mask = MLXPLAT_CPLD_AGGR_MASK_COMEX, - .cell_low = MLXPLAT_CPLD_LPC_REG_AGGRCO_OFFSET, - .mask_low = MLXPLAT_CPLD_LOW_AGGR_MASK_I2C, -+ .completion_notify = mlxplat_i2c_main_complition_notify, - }; - - /* Platform default channels */ -@@ -6413,68 +6420,9 @@ static void mlxplat_post_exit(void) - mlxplat_lpc_cpld_device_exit(); - } - --static int __init mlxplat_init(void) -+static int mlxplat_post_init(struct mlxplat_priv *priv) - { -- unsigned int hotplug_resources_size; -- struct resource *hotplug_resources; -- struct mlxplat_priv *priv; -- int i, j, nr, err; -- -- if (!dmi_check_system(mlxplat_dmi_table)) -- return -ENODEV; -- -- err = mlxplat_pre_init(&hotplug_resources, &hotplug_resources_size); -- if (err) -- return err; -- -- priv = devm_kzalloc(&mlxplat_dev->dev, sizeof(struct mlxplat_priv), -- GFP_KERNEL); -- if (!priv) { -- err = -ENOMEM; -- goto fail_alloc; -- } -- platform_set_drvdata(mlxplat_dev, priv); -- -- priv->hotplug_resources = hotplug_resources; -- priv->hotplug_resources_size = hotplug_resources_size; -- -- if (!mlxplat_regmap_config) -- mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config; -- -- priv->regmap = devm_regmap_init(&mlxplat_dev->dev, NULL, -- &mlxplat_mlxcpld_regmap_ctx, -- mlxplat_regmap_config); -- if (IS_ERR(priv->regmap)) { -- err = PTR_ERR(priv->regmap); -- goto fail_alloc; -- } -- -- err = mlxplat_mlxcpld_verify_bus_topology(&nr); -- if (nr < 0) -- goto fail_alloc; -- -- nr = (nr == mlxplat_max_adap_num) ? -1 : nr; -- if (mlxplat_i2c) -- mlxplat_i2c->regmap = priv->regmap; -- priv->pdev_i2c = platform_device_register_resndata(&mlxplat_dev->dev, "i2c_mlxcpld", -- nr, priv->hotplug_resources, -- priv->hotplug_resources_size, -- mlxplat_i2c, sizeof(*mlxplat_i2c)); -- if (IS_ERR(priv->pdev_i2c)) { -- err = PTR_ERR(priv->pdev_i2c); -- goto fail_alloc; -- } -- -- for (i = 0; i < mlxplat_mux_num; i++) { -- priv->pdev_mux[i] = platform_device_register_resndata(&priv->pdev_i2c->dev, -- "i2c-mux-reg", i, NULL, 0, -- &mlxplat_mux_data[i], -- sizeof(mlxplat_mux_data[i])); -- if (IS_ERR(priv->pdev_mux[i])) { -- err = PTR_ERR(priv->pdev_mux[i]); -- goto fail_platform_mux_register; -- } -- } -+ int i = 0, err; - - /* Add hotplug driver */ - if (mlxplat_hotplug) { -@@ -6487,19 +6435,10 @@ static int __init mlxplat_init(void) - mlxplat_hotplug, sizeof(*mlxplat_hotplug)); - if (IS_ERR(priv->pdev_hotplug)) { - err = PTR_ERR(priv->pdev_hotplug); -- goto fail_platform_mux_register; -+ goto fail_platform_hotplug_register; - } - } - -- /* Set default registers. */ -- for (j = 0; j < mlxplat_regmap_config->num_reg_defaults; j++) { -- err = regmap_write(priv->regmap, -- mlxplat_regmap_config->reg_defaults[j].reg, -- mlxplat_regmap_config->reg_defaults[j].def); -- if (err) -- goto fail_platform_mux_register; -- } -- - /* Add LED driver. */ - if (mlxplat_led) { - mlxplat_led->regmap = priv->regmap; -@@ -6509,7 +6448,7 @@ static int __init mlxplat_init(void) - sizeof(*mlxplat_led)); - if (IS_ERR(priv->pdev_led)) { - err = PTR_ERR(priv->pdev_led); -- goto fail_platform_hotplug_register; -+ goto fail_platform_leds_register; - } - } - -@@ -6523,7 +6462,7 @@ static int __init mlxplat_init(void) - sizeof(*mlxplat_regs_io)); - if (IS_ERR(priv->pdev_io_regs)) { - err = PTR_ERR(priv->pdev_io_regs); -- goto fail_platform_led_register; -+ goto fail_platform_io_register; - } - } - -@@ -6536,7 +6475,7 @@ static int __init mlxplat_init(void) - sizeof(*mlxplat_fan)); - if (IS_ERR(priv->pdev_fan)) { - err = PTR_ERR(priv->pdev_fan); -- goto fail_platform_io_regs_register; -+ goto fail_platform_fan_register; - } - } - -@@ -6547,59 +6486,42 @@ static int __init mlxplat_init(void) - err = mlxplat_mlxcpld_check_wd_capability(priv->regmap); - if (err) - goto fail_platform_wd_register; -- for (j = 0; j < MLXPLAT_CPLD_WD_MAX_DEVS; j++) { -- if (mlxplat_wd_data[j]) { -- mlxplat_wd_data[j]->regmap = priv->regmap; -- priv->pdev_wd[j] = -- platform_device_register_resndata(&mlxplat_dev->dev, "mlx-wdt", j, -- NULL, 0, mlxplat_wd_data[j], -- sizeof(*mlxplat_wd_data[j])); -- if (IS_ERR(priv->pdev_wd[j])) { -- err = PTR_ERR(priv->pdev_wd[j]); -+ for (i = 0; i < MLXPLAT_CPLD_WD_MAX_DEVS; i++) { -+ if (mlxplat_wd_data[i]) { -+ mlxplat_wd_data[i]->regmap = priv->regmap; -+ priv->pdev_wd[i] = -+ platform_device_register_resndata(&mlxplat_dev->dev, "mlx-wdt", i, -+ NULL, 0, mlxplat_wd_data[i], -+ sizeof(*mlxplat_wd_data[i])); -+ if (IS_ERR(priv->pdev_wd[i])) { -+ err = PTR_ERR(priv->pdev_wd[i]); - goto fail_platform_wd_register; - } - } - } - -- /* Sync registers with hardware. */ -- regcache_mark_dirty(priv->regmap); -- err = regcache_sync(priv->regmap); -- if (err) -- goto fail_platform_wd_register; -- - return 0; - - fail_platform_wd_register: -- while (--j >= 0) -- platform_device_unregister(priv->pdev_wd[j]); -- if (mlxplat_fan) -- platform_device_unregister(priv->pdev_fan); --fail_platform_io_regs_register: -+ while (--i >= 0) -+ platform_device_unregister(priv->pdev_wd[i]); -+fail_platform_fan_register: - if (mlxplat_regs_io) - platform_device_unregister(priv->pdev_io_regs); --fail_platform_led_register: -+fail_platform_io_register: - if (mlxplat_led) - platform_device_unregister(priv->pdev_led); --fail_platform_hotplug_register: -+fail_platform_leds_register: - if (mlxplat_hotplug) - platform_device_unregister(priv->pdev_hotplug); --fail_platform_mux_register: -- while (--i >= 0) -- platform_device_unregister(priv->pdev_mux[i]); -- platform_device_unregister(priv->pdev_i2c); --fail_alloc: -- -+fail_platform_hotplug_register: - return err; - } --module_init(mlxplat_init); - --static void __exit mlxplat_exit(void) -+static void mlxplat_pre_exit(struct mlxplat_priv *priv) - { -- struct mlxplat_priv *priv = platform_get_drvdata(mlxplat_dev); - int i; - -- if (pm_power_off) -- pm_power_off = NULL; - for (i = MLXPLAT_CPLD_WD_MAX_DEVS - 1; i >= 0 ; i--) - platform_device_unregister(priv->pdev_wd[i]); - if (priv->pdev_fan) -@@ -6610,13 +6532,186 @@ static void __exit mlxplat_exit(void) - platform_device_unregister(priv->pdev_led); - if (priv->pdev_hotplug) - platform_device_unregister(priv->pdev_hotplug); -+} -+ -+static int -+mlxplat_i2c_mux_complition_notify(void *handle, struct i2c_adapter *parent, -+ struct i2c_adapter *adapters[]) -+{ -+ struct mlxplat_priv *priv = handle; -+ -+ return mlxplat_post_init(priv); -+} - -- for (i = mlxplat_mux_num - 1; i >= 0 ; i--) -+static int mlxplat_i2c_mux_topolgy_init(struct mlxplat_priv *priv) -+{ -+ int i, err; -+ -+ if (!priv->pdev_i2c) { -+ priv->i2c_main_init_status = MLXPLAT_I2C_MAIN_BUS_NOTIFIED; -+ return 0; -+ } -+ -+ priv->i2c_main_init_status = MLXPLAT_I2C_MAIN_BUS_HANDLE_CREATED; -+ for (i = 0; i < mlxplat_mux_num; i++) { -+ priv->pdev_mux[i] = platform_device_register_resndata(&priv->pdev_i2c->dev, -+ "i2c-mux-reg", i, NULL, 0, -+ &mlxplat_mux_data[i], -+ sizeof(mlxplat_mux_data[i])); -+ if (IS_ERR(priv->pdev_mux[i])) { -+ err = PTR_ERR(priv->pdev_mux[i]); -+ goto fail_platform_mux_register; -+ } -+ } -+ -+ return mlxplat_i2c_mux_complition_notify(priv, NULL, NULL); -+ -+fail_platform_mux_register: -+ while (--i >= 0) - platform_device_unregister(priv->pdev_mux[i]); -+ return err; -+} -+ -+static void mlxplat_i2c_mux_topolgy_exit(struct mlxplat_priv *priv) -+{ -+ int i; -+ -+ for (i = mlxplat_mux_num - 1; i >= 0 ; i--) { -+ if (priv->pdev_mux[i]) -+ platform_device_unregister(priv->pdev_mux[i]); -+ } - -- platform_device_unregister(priv->pdev_i2c); - mlxplat_post_exit(); - } -+ -+static int mlxplat_i2c_main_complition_notify(void *handle, int id) -+{ -+ struct mlxplat_priv *priv = handle; -+ -+ return mlxplat_i2c_mux_topolgy_init(priv); -+} -+ -+static int mlxplat_i2c_main_init(struct mlxplat_priv *priv) -+{ -+ int nr, err; -+ -+ if (!mlxplat_i2c) -+ return 0; -+ -+ err = mlxplat_mlxcpld_verify_bus_topology(&nr); -+ if (nr < 0) -+ goto fail_mlxplat_mlxcpld_verify_bus_topology; -+ -+ nr = (nr == mlxplat_max_adap_num) ? -1 : nr; -+ mlxplat_i2c->regmap = priv->regmap; -+ mlxplat_i2c->handle = priv; -+ -+ priv->pdev_i2c = platform_device_register_resndata(&mlxplat_dev->dev, "i2c_mlxcpld", -+ nr, priv->hotplug_resources, -+ priv->hotplug_resources_size, -+ mlxplat_i2c, sizeof(*mlxplat_i2c)); -+ if (IS_ERR(priv->pdev_i2c)) { -+ err = PTR_ERR(priv->pdev_i2c); -+ goto fail_platform_i2c_register; -+ } -+ -+ if (priv->i2c_main_init_status == MLXPLAT_I2C_MAIN_BUS_NOTIFIED) { -+ err = mlxplat_i2c_mux_topolgy_init(priv); -+ if (err) -+ goto fail_mlxplat_i2c_mux_topolgy_init; -+ } -+ -+ return 0; -+ -+fail_mlxplat_i2c_mux_topolgy_init: -+fail_platform_i2c_register: -+fail_mlxplat_mlxcpld_verify_bus_topology: -+ return err; -+} -+ -+static void mlxplat_i2c_main_exit(struct mlxplat_priv *priv) -+{ -+ mlxplat_i2c_mux_topolgy_exit(priv); -+ if (priv->pdev_i2c) -+ platform_device_unregister(priv->pdev_i2c); -+} -+ -+static int __init mlxplat_init(void) -+{ -+ unsigned int hotplug_resources_size; -+ struct resource *hotplug_resources; -+ struct mlxplat_priv *priv; -+ int i, err; -+ -+ if (!dmi_check_system(mlxplat_dmi_table)) -+ return -ENODEV; -+ -+ err = mlxplat_pre_init(&hotplug_resources, &hotplug_resources_size); -+ if (err) -+ return err; -+ -+ priv = devm_kzalloc(&mlxplat_dev->dev, sizeof(struct mlxplat_priv), -+ GFP_KERNEL); -+ if (!priv) { -+ err = -ENOMEM; -+ goto fail_alloc; -+ } -+ platform_set_drvdata(mlxplat_dev, priv); -+ priv->hotplug_resources = hotplug_resources; -+ priv->hotplug_resources_size = hotplug_resources_size; -+ -+ if (!mlxplat_regmap_config) -+ mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config; -+ -+ priv->regmap = devm_regmap_init(&mlxplat_dev->dev, NULL, -+ &mlxplat_mlxcpld_regmap_ctx, -+ mlxplat_regmap_config); -+ if (IS_ERR(priv->regmap)) { -+ err = PTR_ERR(priv->regmap); -+ goto fail_alloc; -+ } -+ -+ /* Set default registers. */ -+ for (i = 0; i < mlxplat_regmap_config->num_reg_defaults; i++) { -+ err = regmap_write(priv->regmap, -+ mlxplat_regmap_config->reg_defaults[i].reg, -+ mlxplat_regmap_config->reg_defaults[i].def); -+ if (err) -+ goto fail_regmap_write; -+ } -+ -+ err = mlxplat_i2c_main_init(priv); -+ if (err) -+ goto fail_mlxplat_i2c_main_init; -+ -+ /* Sync registers with hardware. */ -+ regcache_mark_dirty(priv->regmap); -+ err = regcache_sync(priv->regmap); -+ if (err) -+ goto fail_regcache_sync; -+ -+ return 0; -+ -+fail_regcache_sync: -+ mlxplat_pre_exit(priv); -+fail_mlxplat_i2c_main_init: -+fail_regmap_write: -+fail_alloc: -+ mlxplat_post_exit(); -+ -+ return err; -+} -+module_init(mlxplat_init); -+ -+static void __exit mlxplat_exit(void) -+{ -+ struct mlxplat_priv *priv = platform_get_drvdata(mlxplat_dev); -+ -+ if (pm_power_off) -+ pm_power_off = NULL; -+ mlxplat_pre_exit(priv); -+ mlxplat_i2c_main_exit(priv); -+} - module_exit(mlxplat_exit); - - MODULE_AUTHOR("Vadim Pasternak (vadimp@mellanox.com)"); --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0185-platform-mellanox-Extend-all-systems-with-I2C-notifi.patch b/platform/mellanox/non-upstream-patches/patches/0185-platform-mellanox-Extend-all-systems-with-I2C-notifi.patch deleted file mode 100644 index 6209d60352a7..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0185-platform-mellanox-Extend-all-systems-with-I2C-notifi.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 3a61ad447e2ec437079c86c277b80acde19e9173 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Mon, 26 Dec 2022 22:28:33 +0200 -Subject: [PATCH backport 5.10 073/150] platform: mellanox: Extend all systems - with I2C notification callback - -Motivation is to provide synchronization between I2C main bus and other -platform drivers using this notification callback. - -Signed-off-by: Vadim Pasternak ---- - drivers/platform/x86/mlx-platform.c | 11 +++++++++++ - 1 file changed, 11 insertions(+) - -diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c -index 05a630135..1ef0bb975 100644 ---- a/drivers/platform/x86/mlx-platform.c -+++ b/drivers/platform/x86/mlx-platform.c -@@ -365,6 +365,11 @@ static const struct resource mlxplat_lpc_resources[] = { - IORESOURCE_IO), - }; - -+/* Platform systems default i2c data */ -+static struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_i2c_default_data = { -+ .completion_notify = mlxplat_i2c_main_complition_notify, -+}; -+ - /* Platform i2c next generation systems data */ - static struct mlxreg_core_data mlxplat_mlxcpld_i2c_ng_items_data[] = { - { -@@ -5807,6 +5812,7 @@ static int __init mlxplat_dmi_default_matched(const struct dmi_system_id *dmi) - mlxplat_led = &mlxplat_default_led_data; - mlxplat_regs_io = &mlxplat_default_regs_io_data; - mlxplat_wd_data[0] = &mlxplat_mlxcpld_wd_set_type1[0]; -+ mlxplat_i2c = &mlxplat_mlxcpld_i2c_default_data; - - return 1; - } -@@ -5829,6 +5835,7 @@ static int __init mlxplat_dmi_default_wc_matched(const struct dmi_system_id *dmi - mlxplat_led = &mlxplat_default_led_wc_data; - mlxplat_regs_io = &mlxplat_default_regs_io_data; - mlxplat_wd_data[0] = &mlxplat_mlxcpld_wd_set_type1[0]; -+ mlxplat_i2c = &mlxplat_mlxcpld_i2c_default_data; - - return 1; - } -@@ -5876,6 +5883,7 @@ static int __init mlxplat_dmi_msn21xx_matched(const struct dmi_system_id *dmi) - mlxplat_led = &mlxplat_msn21xx_led_data; - mlxplat_regs_io = &mlxplat_msn21xx_regs_io_data; - mlxplat_wd_data[0] = &mlxplat_mlxcpld_wd_set_type1[0]; -+ mlxplat_i2c = &mlxplat_mlxcpld_i2c_default_data; - - return 1; - } -@@ -5898,6 +5906,7 @@ static int __init mlxplat_dmi_msn274x_matched(const struct dmi_system_id *dmi) - mlxplat_led = &mlxplat_default_led_data; - mlxplat_regs_io = &mlxplat_msn21xx_regs_io_data; - mlxplat_wd_data[0] = &mlxplat_mlxcpld_wd_set_type1[0]; -+ mlxplat_i2c = &mlxplat_mlxcpld_i2c_default_data; - - return 1; - } -@@ -5920,6 +5929,7 @@ static int __init mlxplat_dmi_msn201x_matched(const struct dmi_system_id *dmi) - mlxplat_led = &mlxplat_msn21xx_led_data; - mlxplat_regs_io = &mlxplat_msn21xx_regs_io_data; - mlxplat_wd_data[0] = &mlxplat_mlxcpld_wd_set_type1[0]; -+ mlxplat_i2c = &mlxplat_mlxcpld_i2c_default_data; - - return 1; - } -@@ -5969,6 +5979,7 @@ static int __init mlxplat_dmi_comex_matched(const struct dmi_system_id *dmi) - 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_default_data; - mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config_comex; - - return 1; --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0187-platform_data-mlxreg-Add-field-with-mapped-resource-.patch b/platform/mellanox/non-upstream-patches/patches/0187-platform_data-mlxreg-Add-field-with-mapped-resource-.patch deleted file mode 100644 index 2677a484f726..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0187-platform_data-mlxreg-Add-field-with-mapped-resource-.patch +++ /dev/null @@ -1,37 +0,0 @@ -From e1d1afba7f7285bebb2d30fce961901ee944d201 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Wed, 9 Nov 2022 09:43:28 +0200 -Subject: [PATCH backport 5.10 01/10] platform_data/mlxreg: Add field with - mapped resource address - -Add field with PCIe remapped based address for passing it across -relevant platform drivers sharing common system resources. - -Signed-off-by: Vadim Pasternak ---- - include/linux/platform_data/mlxreg.h | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/include/linux/platform_data/mlxreg.h b/include/linux/platform_data/mlxreg.h -index a6bd74e29..0b9f81a6f 100644 ---- a/include/linux/platform_data/mlxreg.h -+++ b/include/linux/platform_data/mlxreg.h -@@ -216,6 +216,7 @@ struct mlxreg_core_platform_data { - * @mask_low: low aggregation interrupt common mask; - * @deferred_nr: I2C adapter number must be exist prior probing execution; - * @shift_nr: I2C adapter numbers must be incremented by this value; -+ * @addr: mapped resource address; - * @handle: handle to be passed by callback; - * @completion_notify: callback to notify when platform driver probing is done; - */ -@@ -230,6 +231,7 @@ struct mlxreg_core_hotplug_platform_data { - u32 mask_low; - int deferred_nr; - int shift_nr; -+ void __iomem *addr; - void *handle; - int (*completion_notify)(void *handle, int id); - }; --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0188-i2c-mux-Add-register-map-based-mux-driver.patch b/platform/mellanox/non-upstream-patches/patches/0188-i2c-mux-Add-register-map-based-mux-driver.patch deleted file mode 100644 index 7912bf187352..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0188-i2c-mux-Add-register-map-based-mux-driver.patch +++ /dev/null @@ -1,253 +0,0 @@ -From 03195e7418ec41d0a118973a392165f11ba881cf Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Wed, 9 Nov 2022 12:22:12 +0200 -Subject: [PATCH backport 5.10 026/100] i2c: mux: Add register map based mux - driver - -Add 'regmap' mux driver to allow virtual bus switching by setting a -single selector register. -The 'regmap' is supposed to be passed to driver within a platform data -by parent platform driver. - -Motivation is to support indirect access to register space where -selector register is located. -For example, Lattice FPGA LFD2NX-40 device, being connected through -PCIe bus provides SPI or LPC bus logic through PCIe-to-SPI or -PCIe-to-LPC bridging. Thus, FPGA operates a as host controller and -some slave devices can be connected to it. For example: -- CPU (PCIe) -> FPGA (PCIe-to-SPI bridge) -> CPLD or another FPGA. -- CPU (PCIe) -> FPGA (PCIe-to-LPC bridge) -> CPLD or another FPGA. -Where 1-st FPGA connected to PCIe is located on carrier board, while -2-nd programming logic device is located on some switch board and -cannot be connected to CPU PCIe root complex. - -In case mux selector register is located within the 2-nd device, SPI or -LPC transactions are sent indirectly through pre-defined protocol. - -To support such protocol reg_read()/reg_write() callbacks are provided -to 'regmap' object and these callback implements required indirect -access. - -For example, flow in reg_write() will be as following: -- Verify there is no pending transactions. -- Set address in PCIe register space. -- Set data to be written in PCIe register space. -- Activate write operation in PCIe register space. -- LPC or SPI write transaction is performed. - -Signed-off-by: Vadim Pasternak ---- - drivers/i2c/muxes/Kconfig | 12 ++ - drivers/i2c/muxes/Makefile | 1 + - drivers/i2c/muxes/i2c-mux-regmap.c | 123 +++++++++++++++++++ - include/linux/platform_data/i2c-mux-regmap.h | 34 +++++ - 4 files changed, 170 insertions(+) - create mode 100644 drivers/i2c/muxes/i2c-mux-regmap.c - create mode 100644 include/linux/platform_data/i2c-mux-regmap.h - -diff --git a/drivers/i2c/muxes/Kconfig b/drivers/i2c/muxes/Kconfig -index 1708b1a82..48becd945 100644 ---- a/drivers/i2c/muxes/Kconfig -+++ b/drivers/i2c/muxes/Kconfig -@@ -99,6 +99,18 @@ config I2C_MUX_REG - This driver can also be built as a module. If so, the module - will be called i2c-mux-reg. - -+config I2C_MUX_REGMAP -+ tristate "Register map based I2C multiplexer" -+ depends on REGMAP -+ help -+ If you say yes to this option, support will be included for a -+ register map based I2C multiplexer. This driver provides access to -+ I2C busses connected through a MUX, which is controlled -+ by a single register through the regmap. -+ -+ This driver can also be built as a module. If so, the module -+ will be called i2c-mux-regmap. -+ - config I2C_DEMUX_PINCTRL - tristate "pinctrl-based I2C demultiplexer" - depends on PINCTRL && OF -diff --git a/drivers/i2c/muxes/Makefile b/drivers/i2c/muxes/Makefile -index 6d9d865e8..092dca428 100644 ---- a/drivers/i2c/muxes/Makefile -+++ b/drivers/i2c/muxes/Makefile -@@ -14,5 +14,6 @@ obj-$(CONFIG_I2C_MUX_PCA9541) += i2c-mux-pca9541.o - obj-$(CONFIG_I2C_MUX_PCA954x) += i2c-mux-pca954x.o - obj-$(CONFIG_I2C_MUX_PINCTRL) += i2c-mux-pinctrl.o - obj-$(CONFIG_I2C_MUX_REG) += i2c-mux-reg.o -+obj-$(CONFIG_I2C_MUX_REGMAP) += i2c-mux-regmap.o - - ccflags-$(CONFIG_I2C_DEBUG_BUS) := -DDEBUG -diff --git a/drivers/i2c/muxes/i2c-mux-regmap.c b/drivers/i2c/muxes/i2c-mux-regmap.c -new file mode 100644 -index 000000000..e155c039a ---- /dev/null -+++ b/drivers/i2c/muxes/i2c-mux-regmap.c -@@ -0,0 +1,123 @@ -+// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 -+/* -+ * Regmap i2c mux driver -+ * -+ * Copyright (C) 2023 Nvidia Technologies Ltd. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* i2c_mux_regmap - mux control structure: -+ * @last_val - last selected register value or -1 if mux deselected; -+ * @pdata: platform data; -+ */ -+struct i2c_mux_regmap { -+ int last_val; -+ struct i2c_mux_regmap_platform_data pdata; -+}; -+ -+static int i2c_mux_regmap_select_chan(struct i2c_mux_core *muxc, u32 chan) -+{ -+ struct i2c_mux_regmap *mux = i2c_mux_priv(muxc); -+ int err = 0; -+ -+ /* Only select the channel if its different from the last channel */ -+ if (mux->last_val != chan) { -+ err = regmap_write(mux->pdata.regmap, mux->pdata.sel_reg_addr, chan); -+ mux->last_val = err < 0 ? -1 : chan; -+ } -+ -+ return err; -+} -+ -+static int i2c_mux_regmap_deselect(struct i2c_mux_core *muxc, u32 chan) -+{ -+ struct i2c_mux_regmap *mux = i2c_mux_priv(muxc); -+ -+ /* Deselect active channel */ -+ mux->last_val = -1; -+ -+ return regmap_write(mux->pdata.regmap, mux->pdata.sel_reg_addr, 0); -+} -+ -+/* Probe/reomove functions */ -+static int i2c_mux_regmap_probe(struct platform_device *pdev) -+{ -+ struct i2c_mux_regmap_platform_data *pdata = dev_get_platdata(&pdev->dev); -+ struct i2c_mux_regmap *mux; -+ struct i2c_adapter *parent; -+ struct i2c_mux_core *muxc; -+ int num, err; -+ -+ if (!pdata) -+ return -EINVAL; -+ -+ mux = devm_kzalloc(&pdev->dev, sizeof(*mux), GFP_KERNEL); -+ if (!mux) -+ return -ENOMEM; -+ -+ memcpy(&mux->pdata, pdata, sizeof(*pdata)); -+ parent = i2c_get_adapter(mux->pdata.parent); -+ if (!parent) -+ return -EPROBE_DEFER; -+ -+ muxc = i2c_mux_alloc(parent, &pdev->dev, pdata->num_adaps, sizeof(*mux), 0, -+ i2c_mux_regmap_select_chan, i2c_mux_regmap_deselect); -+ if (!muxc) -+ return -ENOMEM; -+ -+ platform_set_drvdata(pdev, muxc); -+ muxc->priv = mux; -+ mux->last_val = -1; /* force the first selection */ -+ -+ /* Create an adapter for each channel. */ -+ for (num = 0; num < pdata->num_adaps; num++) { -+ err = i2c_mux_add_adapter(muxc, 0, pdata->chan_ids[num], 0); -+ if (err) -+ goto err_i2c_mux_add_adapter; -+ } -+ -+ /* Notify caller when all channels' adapters are created. */ -+ if (pdata->completion_notify) -+ pdata->completion_notify(pdata->handle, muxc->parent, muxc->adapter); -+ -+ return 0; -+ -+err_i2c_mux_add_adapter: -+ i2c_mux_del_adapters(muxc); -+ return err; -+} -+ -+static int i2c_mux_regmap_remove(struct platform_device *pdev) -+{ -+ struct i2c_mux_core *muxc = platform_get_drvdata(pdev); -+ -+ i2c_mux_del_adapters(muxc); -+ i2c_put_adapter(muxc->parent); -+ -+ return 0; -+} -+ -+static struct platform_driver i2c_mux_regmap_driver = { -+ .driver = { -+ .name = "i2c-mux-regmap", -+ }, -+ .probe = i2c_mux_regmap_probe, -+ .remove = i2c_mux_regmap_remove, -+}; -+ -+module_platform_driver(i2c_mux_regmap_driver); -+ -+MODULE_AUTHOR("Vadim Pasternak (vadimp@nvidia.com)"); -+MODULE_DESCRIPTION("Regmap I2C multiplexer driver"); -+MODULE_LICENSE("Dual BSD/GPL"); -+MODULE_ALIAS("platform:i2c-mux-regmap"); -diff --git a/include/linux/platform_data/i2c-mux-regmap.h b/include/linux/platform_data/i2c-mux-regmap.h -new file mode 100644 -index 000000000..a06614e5e ---- /dev/null -+++ b/include/linux/platform_data/i2c-mux-regmap.h -@@ -0,0 +1,34 @@ -+/* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */ -+/* -+ * Regmap i2c mux driver -+ * -+ * Copyright (C) 2023 Nvidia Technologies Ltd. -+ */ -+ -+#ifndef __LINUX_PLATFORM_DATA_I2C_MUX_REGMAP_H -+#define __LINUX_PLATFORM_DATA_I2C_MUX_REGMAP_H -+ -+/** -+ * struct i2c_mux_regmap_platform_data - Platform-dependent data for i2c-mux-regmap -+ * @regmap: register map of parent device; -+ * @parent: Parent I2C bus adapter number -+ * @chan_ids - channels array -+ * @num_adaps - number of adapters -+ * @sel_reg_addr - mux select register offset in CPLD space -+ * @reg_size: register size in bytes -+ * @handle: handle to be passed by callback -+ * @completion_notify: callback to notify when all the adapters are created -+ */ -+struct i2c_mux_regmap_platform_data { -+ void *regmap; -+ int parent; -+ const unsigned int *chan_ids; -+ int num_adaps; -+ int sel_reg_addr; -+ u8 reg_size; -+ void *handle; -+ int (*completion_notify)(void *handle, struct i2c_adapter *parent, -+ struct i2c_adapter *adapters[]); -+}; -+ -+#endif /* __LINUX_PLATFORM_DATA_I2C_MUX_REGMAP_H */ --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0189-i2c-mlxcpld-Allow-driver-to-run-on-ARM64-architectur.patch b/platform/mellanox/non-upstream-patches/patches/0189-i2c-mlxcpld-Allow-driver-to-run-on-ARM64-architectur.patch deleted file mode 100644 index b5c0e006e3de..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0189-i2c-mlxcpld-Allow-driver-to-run-on-ARM64-architectur.patch +++ /dev/null @@ -1,29 +0,0 @@ -From c4d1a7d7f51a8315f727c9210961ed93b922d440 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Mon, 7 Nov 2022 12:00:37 +0200 -Subject: [PATCH backport 5.10 03/10] i2c: mlxcpld: Allow driver to run on - ARM64 architecture - -Extend driver dependency by ARM64 architecture. - -Signed-off-by: Vadim Pasternak ---- - drivers/i2c/busses/Kconfig | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig -index 7e693dcbd..c984305ee 100644 ---- a/drivers/i2c/busses/Kconfig -+++ b/drivers/i2c/busses/Kconfig -@@ -1328,7 +1328,7 @@ config I2C_ICY - - config I2C_MLXCPLD - tristate "Mellanox I2C driver" -- depends on X86_64 || COMPILE_TEST -+ depends on X86_64 || ARM64 || COMPILE_TEST - help - This exposes the Mellanox platform I2C busses to the linux I2C layer - for X86 based systems. --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0190-i2c-mlxcpld-Modify-base-address-type.patch b/platform/mellanox/non-upstream-patches/patches/0190-i2c-mlxcpld-Modify-base-address-type.patch deleted file mode 100644 index 36c3178e6ce2..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0190-i2c-mlxcpld-Modify-base-address-type.patch +++ /dev/null @@ -1,49 +0,0 @@ -From d2130ff4d3aed72611f07213e9eceeb084f0fc65 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Wed, 9 Nov 2022 10:29:22 +0200 -Subject: [PATCH backport 5.10 04/10] i2c: mlxcpld: Modify base address type - -Change type of base address from 'u32' to 'u64'. - -Motivation is to support memory mapped virtual base address on ARM64 -architecture. - -Signed-off-by: Vadim Pasternak ---- - drivers/i2c/busses/i2c-mlxcpld.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/drivers/i2c/busses/i2c-mlxcpld.c b/drivers/i2c/busses/i2c-mlxcpld.c -index 72fcfb17d..57aea396c 100644 ---- a/drivers/i2c/busses/i2c-mlxcpld.c -+++ b/drivers/i2c/busses/i2c-mlxcpld.c -@@ -68,7 +68,7 @@ struct mlxcpld_i2c_curr_xfer { - - struct mlxcpld_i2c_priv { - struct i2c_adapter adap; -- u32 base_addr; -+ u64 base_addr; - struct mutex lock; - struct mlxcpld_i2c_curr_xfer xfer; - struct device *dev; -@@ -99,7 +99,7 @@ static void mlxcpld_i2c_lpc_read_buf(u8 *data, u8 len, u32 addr) - static void mlxcpld_i2c_read_comm(struct mlxcpld_i2c_priv *priv, u8 offs, - u8 *data, u8 datalen) - { -- u32 addr = priv->base_addr + offs; -+ u64 addr = priv->base_addr + offs; - - switch (datalen) { - case 1: -@@ -124,7 +124,7 @@ static void mlxcpld_i2c_read_comm(struct mlxcpld_i2c_priv *priv, u8 offs, - static void mlxcpld_i2c_write_comm(struct mlxcpld_i2c_priv *priv, u8 offs, - u8 *data, u8 datalen) - { -- u32 addr = priv->base_addr + offs; -+ u64 addr = priv->base_addr + offs; - - switch (datalen) { - case 1: --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0191-i2c-mlxcpld-Allow-to-configure-base-address-of-regis.patch b/platform/mellanox/non-upstream-patches/patches/0191-i2c-mlxcpld-Allow-to-configure-base-address-of-regis.patch deleted file mode 100644 index 245bcaa4f1bc..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0191-i2c-mlxcpld-Allow-to-configure-base-address-of-regis.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 0fcfc9b2eb7f071f3aa64845d262f1e8e4f741e7 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Wed, 9 Nov 2022 10:35:58 +0200 -Subject: [PATCH backport 5.10 05/10] i2c: mlxcpld: Allow to configure base - address of register space - -Allow to use configured base address. - -Currently driver uses constant base address of register space. -On new systems this base address could be different, thus it could be -passed to the driver through platform data. - -Signed-off-by: Vadim Pasternak ---- - drivers/i2c/busses/i2c-mlxcpld.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/drivers/i2c/busses/i2c-mlxcpld.c b/drivers/i2c/busses/i2c-mlxcpld.c -index 57aea396c..cd5401ce4 100644 ---- a/drivers/i2c/busses/i2c-mlxcpld.c -+++ b/drivers/i2c/busses/i2c-mlxcpld.c -@@ -538,6 +538,9 @@ static int mlxcpld_i2c_probe(struct platform_device *pdev) - err = mlxcpld_i2c_set_frequency(priv, pdata); - if (err) - goto mlxcpld_i2_probe_failed; -+ -+ if (pdata->addr) -+ priv->base_addr = (*(u64 __force *)pdata->addr); - } - - /* Register with i2c layer */ --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0192-i2c-mlxcpld-Add-support-for-extended-transaction-len.patch b/platform/mellanox/non-upstream-patches/patches/0192-i2c-mlxcpld-Add-support-for-extended-transaction-len.patch deleted file mode 100644 index 282ef9312999..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0192-i2c-mlxcpld-Add-support-for-extended-transaction-len.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 22447625fff0e742b3dc9c2f78bbaac29b1f1031 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Sun, 27 Nov 2022 10:43:23 +0200 -Subject: [PATCH backport 5.10 06/10] i2c: mlxcpld: Add support for extended - transaction length for i2c-mlxcpld - -Add support for extended length of read and write transactions. -New FPGA logic allows to increase size of the read and write -transactions length. This feature is verified through capability -register 'CPBLTY_REG'. Two bits 5 and 6 of the register are used for -length capability detection. Value '10' indicates support of extended -transaction length - 128 bytes for read transactions and 132 for write -transactions. - -Signed-off-by: Vadim Pasternak ---- - drivers/i2c/busses/i2c-mlxcpld.c | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/drivers/i2c/busses/i2c-mlxcpld.c b/drivers/i2c/busses/i2c-mlxcpld.c -index cd5401ce4..0e1807be7 100644 ---- a/drivers/i2c/busses/i2c-mlxcpld.c -+++ b/drivers/i2c/busses/i2c-mlxcpld.c -@@ -22,6 +22,7 @@ - #define MLXCPLD_I2C_BUS_NUM 1 - #define MLXCPLD_I2C_DATA_REG_SZ 36 - #define MLXCPLD_I2C_DATA_SZ_BIT BIT(5) -+#define MLXCPLD_I2C_DATA_EXT2_SZ_BIT BIT(6) - #define MLXCPLD_I2C_DATA_SZ_MASK GENMASK(6, 5) - #define MLXCPLD_I2C_SMBUS_BLK_BIT BIT(7) - #define MLXCPLD_I2C_MAX_ADDR_LEN 4 -@@ -466,6 +467,13 @@ static const struct i2c_adapter_quirks mlxcpld_i2c_quirks_ext = { - .max_comb_1st_msg_len = 4, - }; - -+static const struct i2c_adapter_quirks mlxcpld_i2c_quirks_ext2 = { -+ .flags = I2C_AQ_COMB_WRITE_THEN_READ, -+ .max_read_len = (MLXCPLD_I2C_DATA_REG_SZ - 4) * 4, -+ .max_write_len = (MLXCPLD_I2C_DATA_REG_SZ - 4) * 4 + MLXCPLD_I2C_MAX_ADDR_LEN, -+ .max_comb_1st_msg_len = 4, -+}; -+ - static struct i2c_adapter mlxcpld_i2c_adapter = { - .owner = THIS_MODULE, - .name = "i2c-mlxcpld", -@@ -550,6 +558,8 @@ static int mlxcpld_i2c_probe(struct platform_device *pdev) - /* Check support for extended transaction length */ - if ((val & MLXCPLD_I2C_DATA_SZ_MASK) == MLXCPLD_I2C_DATA_SZ_BIT) - mlxcpld_i2c_adapter.quirks = &mlxcpld_i2c_quirks_ext; -+ else if ((val & MLXCPLD_I2C_DATA_SZ_MASK) == MLXCPLD_I2C_DATA_EXT2_SZ_BIT) -+ mlxcpld_i2c_adapter.quirks = &mlxcpld_i2c_quirks_ext2; - /* Check support for smbus block transaction */ - if (val & MLXCPLD_I2C_SMBUS_BLK_BIT) - priv->smbus_block = true; --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0193-platform-mellanox-mlx-platform-Add-mux-selection-reg.patch b/platform/mellanox/non-upstream-patches/patches/0193-platform-mellanox-mlx-platform-Add-mux-selection-reg.patch deleted file mode 100644 index 79a4cafb6895..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0193-platform-mellanox-mlx-platform-Add-mux-selection-reg.patch +++ /dev/null @@ -1,99 +0,0 @@ -From e1d377039ba9a364f4e7f9816f5f0b7a3b165b43 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Wed, 18 Jan 2023 15:08:46 +0200 -Subject: [PATCH backport 5.10 07/10] platform: mellanox: mlx-platform: Add mux - selection register to regmap -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Extend writeable, readable, volatile registers of the 'regmap' object -with for I2C mux selector registers. - -The motivation is to pass this object extended with selector registers -to I2C mux driver working over ‘regmap’. - -Signed-off-by: Vadim Pasternak ---- - drivers/platform/x86/mlx-platform.c | 28 ++++++++++++++++++++-------- - 1 file changed, 20 insertions(+), 8 deletions(-) - -diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c -index e8c656d6e..03c744f37 100644 ---- a/drivers/platform/x86/mlx-platform.c -+++ b/drivers/platform/x86/mlx-platform.c -@@ -140,6 +140,10 @@ - #define MLXPLAT_CPLD_LPC_REG_WD3_TLEFT_OFFSET 0xd2 - #define MLXPLAT_CPLD_LPC_REG_WD3_ACT_OFFSET 0xd3 - #define MLXPLAT_CPLD_LPC_REG_DBG_CTRL_OFFSET 0xd9 -+#define MLXPLAT_CPLD_LPC_REG_I2C_CH1_OFFSET 0xdb -+#define MLXPLAT_CPLD_LPC_REG_I2C_CH2_OFFSET 0xda -+#define MLXPLAT_CPLD_LPC_REG_I2C_CH3_OFFSET 0xdc -+#define MLXPLAT_CPLD_LPC_REG_I2C_CH4_OFFSET 0xdd - #define MLXPLAT_CPLD_LPC_REG_CPLD1_MVER_OFFSET 0xde - #define MLXPLAT_CPLD_LPC_REG_CPLD2_MVER_OFFSET 0xdf - #define MLXPLAT_CPLD_LPC_REG_CPLD3_MVER_OFFSET 0xe0 -@@ -173,23 +177,19 @@ - #define MLXPLAT_CPLD_LPC_REG_CONFIG2_OFFSET 0xfc - #define MLXPLAT_CPLD_LPC_REG_CONFIG3_OFFSET 0xfd - #define MLXPLAT_CPLD_LPC_IO_RANGE 0x100 --#define MLXPLAT_CPLD_LPC_I2C_CH1_OFF 0xdb --#define MLXPLAT_CPLD_LPC_I2C_CH2_OFF 0xda --#define MLXPLAT_CPLD_LPC_I2C_CH3_OFF 0xdc --#define MLXPLAT_CPLD_LPC_I2C_CH4_OFF 0xdd - - #define MLXPLAT_CPLD_LPC_PIO_OFFSET 0x10000UL - #define MLXPLAT_CPLD_LPC_REG1 ((MLXPLAT_CPLD_LPC_REG_BASE_ADRR + \ -- MLXPLAT_CPLD_LPC_I2C_CH1_OFF) | \ -+ MLXPLAT_CPLD_LPC_REG_I2C_CH1_OFFSET) | \ - MLXPLAT_CPLD_LPC_PIO_OFFSET) - #define MLXPLAT_CPLD_LPC_REG2 ((MLXPLAT_CPLD_LPC_REG_BASE_ADRR + \ -- MLXPLAT_CPLD_LPC_I2C_CH2_OFF) | \ -+ MLXPLAT_CPLD_LPC_REG_I2C_CH2_OFFSET) | \ - MLXPLAT_CPLD_LPC_PIO_OFFSET) - #define MLXPLAT_CPLD_LPC_REG3 ((MLXPLAT_CPLD_LPC_REG_BASE_ADRR + \ -- MLXPLAT_CPLD_LPC_I2C_CH3_OFF) | \ -+ MLXPLAT_CPLD_LPC_REG_I2C_CH3_OFFSET) | \ - MLXPLAT_CPLD_LPC_PIO_OFFSET) - #define MLXPLAT_CPLD_LPC_REG4 ((MLXPLAT_CPLD_LPC_REG_BASE_ADRR + \ -- MLXPLAT_CPLD_LPC_I2C_CH4_OFF) | \ -+ MLXPLAT_CPLD_LPC_REG_I2C_CH4_OFFSET) | \ - MLXPLAT_CPLD_LPC_PIO_OFFSET) - - /* Masks for aggregation, psu, pwr and fan event in CPLD related registers. */ -@@ -5307,6 +5307,10 @@ static bool mlxplat_mlxcpld_writeable_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_REG_WD3_TLEFT_OFFSET: - case MLXPLAT_CPLD_LPC_REG_WD3_ACT_OFFSET: - case MLXPLAT_CPLD_LPC_REG_DBG_CTRL_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_I2C_CH1_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_I2C_CH2_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_I2C_CH3_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_I2C_CH4_OFFSET: - case MLXPLAT_CPLD_LPC_REG_PWM1_OFFSET: - case MLXPLAT_CPLD_LPC_REG_PWM2_OFFSET: - case MLXPLAT_CPLD_LPC_REG_PWM3_OFFSET: -@@ -5434,6 +5438,10 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_REG_WD3_TLEFT_OFFSET: - case MLXPLAT_CPLD_LPC_REG_WD3_ACT_OFFSET: - case MLXPLAT_CPLD_LPC_REG_DBG_CTRL_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_I2C_CH1_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_I2C_CH2_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_I2C_CH3_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_I2C_CH4_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD1_MVER_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD2_MVER_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD3_MVER_OFFSET: -@@ -5581,6 +5589,10 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_REG_WD3_TMR_OFFSET: - case MLXPLAT_CPLD_LPC_REG_WD3_TLEFT_OFFSET: - case MLXPLAT_CPLD_LPC_REG_DBG_CTRL_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_I2C_CH1_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_I2C_CH2_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_I2C_CH3_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_I2C_CH4_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD1_MVER_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD2_MVER_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD3_MVER_OFFSET: --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0194-platform-mellanox-mlx-platform-Move-bus-shift-assign.patch b/platform/mellanox/non-upstream-patches/patches/0194-platform-mellanox-mlx-platform-Move-bus-shift-assign.patch deleted file mode 100644 index 154f02d705d6..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0194-platform-mellanox-mlx-platform-Move-bus-shift-assign.patch +++ /dev/null @@ -1,35 +0,0 @@ -From deb8517499160d77e94b2969a98b3c01bed1a649 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Wed, 18 Jan 2023 15:25:37 +0200 -Subject: [PATCH backport 5.10 082/150] platform: mellanox: mlx-platform: Move - bus shift assignment out of the loop - -Move assignment of bus shift setting out of the loop to avoid redundant -operation. - -Signed-off-by: Vadim Pasternak ---- - drivers/platform/x86/mlx-platform.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c -index de8fd0886..9d4cab937 100644 ---- a/drivers/platform/x86/mlx-platform.c -+++ b/drivers/platform/x86/mlx-platform.c -@@ -6371,10 +6371,11 @@ static int mlxplat_mlxcpld_verify_bus_topology(int *nr) - shift = *nr - mlxplat_mux_data[i].parent; - mlxplat_mux_data[i].parent = *nr; - mlxplat_mux_data[i].base_nr += shift; -- if (shift > 0) -- mlxplat_hotplug->shift_nr = shift; - } - -+ if (shift > 0) -+ mlxplat_hotplug->shift_nr = shift; -+ - return 0; - } - --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0195-platform-mellanox-Add-support-for-dynamic-I2C-channe.patch b/platform/mellanox/non-upstream-patches/patches/0195-platform-mellanox-Add-support-for-dynamic-I2C-channe.patch deleted file mode 100644 index fa24430325fd..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0195-platform-mellanox-Add-support-for-dynamic-I2C-channe.patch +++ /dev/null @@ -1,158 +0,0 @@ -From d1fbdc9c5bd0939362ebdb4d76a701cb938f3837 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Wed, 18 Jan 2023 19:12:12 +0200 -Subject: [PATCH backport 5.10 083/150] platform/mellanox: Add support for - dynamic I2C channels infrastructure - -Allow to support platform configuration for dynamically allocated I2C -channels. -Motivation is to support I2C channels allocated in a non-continuous -way. - -Currently hotplug platform driver data structure contains static mux -channels for I2C hotplug devices. These channels numbers can be updated -dynamically and returned by mux driver's callback through the adapters -array. -Thus, hotplug mux channels will be aligned according to the dynamic -adapters data. - -Signed-off-by: Vadim Pasternak ---- - drivers/platform/x86/mlx-platform.c | 69 ++++++++++++++++++++++++----- - 1 file changed, 59 insertions(+), 10 deletions(-) - -diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c -index 9d4cab937..773d110c9 100644 ---- a/drivers/platform/x86/mlx-platform.c -+++ b/drivers/platform/x86/mlx-platform.c -@@ -14,6 +14,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -336,6 +337,7 @@ - * @hotplug_resources: system hotplug resources - * @hotplug_resources_size: size of system hotplug resources - * @hi2c_main_init_status: init status of I2C main bus -+ * @mux_added: number of added mux segments - */ - struct mlxplat_priv { - struct platform_device *pdev_i2c; -@@ -349,6 +351,7 @@ struct mlxplat_priv { - struct resource *hotplug_resources; - unsigned int hotplug_resources_size; - u8 i2c_main_init_status; -+ int mux_added; - }; - - static struct platform_device *mlxplat_dev; -@@ -436,7 +439,9 @@ static struct i2c_mux_reg_platform_data mlxplat_default_mux_data[] = { - /* Platform mux configuration variables */ - static int mlxplat_max_adap_num; - static int mlxplat_mux_num; -+static int mlxplat_mux_hotplug_num; - static struct i2c_mux_reg_platform_data *mlxplat_mux_data; -+static struct i2c_mux_regmap_platform_data *mlxplat_mux_regmap_data; - - /* Platform extended mux data */ - static struct i2c_mux_reg_platform_data mlxplat_extended_mux_data[] = { -@@ -6368,12 +6373,17 @@ static int mlxplat_mlxcpld_verify_bus_topology(int *nr) - /* Shift adapter ids, since expected parent adapter is not free. */ - *nr = i; - for (i = 0; i < mlxplat_mux_num; i++) { -- shift = *nr - mlxplat_mux_data[i].parent; -- mlxplat_mux_data[i].parent = *nr; -- mlxplat_mux_data[i].base_nr += shift; -+ if (mlxplat_mux_data) { -+ shift = *nr - mlxplat_mux_data[i].parent; -+ mlxplat_mux_data[i].parent = *nr; -+ mlxplat_mux_data[i].base_nr += shift; -+ } else if (mlxplat_mux_regmap_data) { -+ mlxplat_mux_regmap_data[i].parent = *nr; -+ } - } - -- if (shift > 0) -+ /* Shift bus only if mux provided by 'mlxplat_mux_data'. */ -+ if (shift > 0 && mlxplat_mux_data) - mlxplat_hotplug->shift_nr = shift; - - return 0; -@@ -6563,8 +6573,31 @@ mlxplat_i2c_mux_complition_notify(void *handle, struct i2c_adapter *parent, - struct i2c_adapter *adapters[]) - { - struct mlxplat_priv *priv = handle; -+ struct mlxreg_core_item *item; -+ int i, j; -+ -+ /* -+ * Hotplug platform driver data structure contains static mux channels for I2C hotplug -+ * devices. These channels numbers can be updated dynamically and returned by mux callback -+ * through the adapters array. Update mux channels according to the dynamic adapters data. -+ */ -+ if (priv->mux_added == mlxplat_mux_hotplug_num) { -+ item = mlxplat_hotplug->items; -+ for (i = 0; i < mlxplat_hotplug->counter; i++, item++) { -+ struct mlxreg_core_data *data = item->data; -+ -+ for (j = 0; j < item->count; j++, data++) { -+ if (data->hpdev.nr != MLXPLAT_CPLD_NR_NONE) -+ data->hpdev.nr = adapters[data->hpdev.nr - 2]->nr; -+ } -+ } -+ } - -- return mlxplat_post_init(priv); -+ /* Start post initialization only after last nux segment is added */ -+ if (++priv->mux_added == mlxplat_mux_num) -+ return mlxplat_post_init(priv); -+ -+ return 0; - } - - static int mlxplat_i2c_mux_topolgy_init(struct mlxplat_priv *priv) -@@ -6578,17 +6611,33 @@ static int mlxplat_i2c_mux_topolgy_init(struct mlxplat_priv *priv) - - priv->i2c_main_init_status = MLXPLAT_I2C_MAIN_BUS_HANDLE_CREATED; - for (i = 0; i < mlxplat_mux_num; i++) { -- priv->pdev_mux[i] = platform_device_register_resndata(&priv->pdev_i2c->dev, -- "i2c-mux-reg", i, NULL, 0, -- &mlxplat_mux_data[i], -- sizeof(mlxplat_mux_data[i])); -+ if (mlxplat_mux_data) { -+ priv->pdev_mux[i] = -+ platform_device_register_resndata(&priv->pdev_i2c->dev, -+ "i2c-mux-reg", i, NULL, 0, -+ &mlxplat_mux_data[i], -+ sizeof(mlxplat_mux_data[i])); -+ } else { -+ mlxplat_mux_regmap_data[i].handle = priv; -+ mlxplat_mux_regmap_data[i].regmap = priv->regmap; -+ mlxplat_mux_regmap_data[i].completion_notify = -+ mlxplat_i2c_mux_complition_notify; -+ priv->pdev_mux[i] = -+ platform_device_register_resndata(&priv->pdev_i2c->dev, -+ "i2c-mux-regmap", i, NULL, 0, -+ &mlxplat_mux_regmap_data[i], -+ sizeof(mlxplat_mux_regmap_data[i])); -+ } - if (IS_ERR(priv->pdev_mux[i])) { - err = PTR_ERR(priv->pdev_mux[i]); - goto fail_platform_mux_register; - } - } - -- return mlxplat_i2c_mux_complition_notify(priv, NULL, NULL); -+ if (mlxplat_mux_regmap_data && mlxplat_mux_regmap_data->completion_notify) -+ return 0; -+ -+ return mlxplat_post_init(priv); - - fail_platform_mux_register: - while (--i >= 0) --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0197-platform-mellanox-Add-initial-support-for-PCIe-based.patch b/platform/mellanox/non-upstream-patches/patches/0197-platform-mellanox-Add-initial-support-for-PCIe-based.patch deleted file mode 100644 index ae18a952d79a..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0197-platform-mellanox-Add-initial-support-for-PCIe-based.patch +++ /dev/null @@ -1,186 +0,0 @@ -From e831f971fd9895b74c0966b3cf3cd2e18c2f8fca Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Thu, 10 Nov 2022 08:53:49 +0200 -Subject: [PATCH backport 5.10 085/150] platform: mellanox: Add initial support - for PCIe based programming logic device - -Extend driver to support logic implemented by FPGA device connected -through PCIe bus. - -The motivation two support new generation of Nvidia COME module, based -on ARM64 architecture, and equipped with Lattice LFD2NX-40 FPGA device. - -In order to support new Nvidia COME module FPGA device driver -initialization flow is modified. In case FPGA device is detected, -system resources are to be mapped to this device, otherwise system -resources are to be mapped same as it has been done before for Lattice -LPC based CPLD. - -Signed-off-by: Vadim Pasternak ---- - drivers/platform/mellanox/mlx-platform.c | 106 ++++++++++++++++++++++- - 1 file changed, 105 insertions(+), 1 deletion(-) - -diff --git a/drivers/platform/mellanox/mlx-platform.c b/drivers/platform/mellanox/mlx-platform.c -index 773d110c9..f3df56c41 100644 ---- a/drivers/platform/mellanox/mlx-platform.c -+++ b/drivers/platform/mellanox/mlx-platform.c -@@ -12,6 +12,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -315,6 +316,7 @@ - #define MLXPLAT_CPLD_WD_MAX_DEVS 2 - - #define MLXPLAT_CPLD_LPC_SYSIRQ 17 -+#define MLXPLAT_FPGA_PCIE_SYSIRQ 17 - - /* Minimum power required for turning on Ethernet modular system (WATT) */ - #define MLXPLAT_CPLD_ETH_MODULAR_PWR_MIN 50 -@@ -325,6 +327,11 @@ - #define MLXPLAT_I2C_MAIN_BUS_NOTIFIED 0x01 - #define MLXPLAT_I2C_MAIN_BUS_HANDLE_CREATED 0x02 - -+/* Lattice FPGA PCI configuration */ -+#define PCI_VENDOR_ID_LATTICE 0x1204 -+#define PCI_DEVICE_ID_LATTICE_LFD2NX40 0x9c1d -+#define MLXPLAT_FPGA_PCI_BAR0_SIZE 0x4000 -+ - /* mlxplat_priv - platform private data - * @pdev_i2c - i2c controller platform device - * @pdev_mux - array of mux platform devices -@@ -5793,6 +5800,11 @@ static struct resource mlxplat_mlxcpld_resources[] = { - [0] = DEFINE_RES_IRQ_NAMED(MLXPLAT_CPLD_LPC_SYSIRQ, "mlxreg-hotplug"), - }; - -+static struct resource mlxplat_mlxfpga_resources[] = { -+ [0] = DEFINE_RES_IRQ_NAMED(MLXPLAT_FPGA_PCIE_SYSIRQ, "mlxreg-hotplug"), -+}; -+ -+static struct platform_device *mlxplat_dev; - static struct mlxreg_core_hotplug_platform_data *mlxplat_i2c; - static struct mlxreg_core_hotplug_platform_data *mlxplat_hotplug; - static struct mlxreg_core_platform_data *mlxplat_led; -@@ -5802,6 +5814,7 @@ static struct mlxreg_core_platform_data - *mlxplat_wd_data[MLXPLAT_CPLD_WD_MAX_DEVS]; - static const struct regmap_config *mlxplat_regmap_config; - static struct spi_board_info *mlxplat_spi; -+static struct pci_dev *fpga_dev; - - /* Platform default poweroff function */ - static void mlxplat_poweroff(void) -@@ -6443,15 +6456,106 @@ static void mlxplat_lpc_cpld_device_exit(void) - platform_device_unregister(mlxplat_dev); - } - -+static int -+mlxplat_pci_fpga_device_init(struct resource **hotplug_resources, -+ unsigned int *hotplug_resources_size, struct pci_dev **fpga_dev) -+{ -+ struct pci_dev *pci_dev; -+ int err; -+ -+ pci_dev = pci_get_device(PCI_VENDOR_ID_LATTICE, PCI_DEVICE_ID_LATTICE_LFD2NX40, NULL); -+ if (!pci_dev) -+ return -ENODEV; -+ -+ err = pci_enable_device(pci_dev); -+ if (err) { -+ dev_err(&mlxplat_dev->dev, "pci_enable_device failed\n"); -+ goto fail_pci_enable_device; -+ } -+ -+ err = pci_request_regions(pci_dev, "mlx-patform"); -+ if (err) { -+ dev_err(&mlxplat_dev->dev, "pci_request_regions failed\n"); -+ goto fail_pci_request_regions; -+ } -+ -+ err = dma_set_mask_and_coherent(&mlxplat_dev->dev, DMA_BIT_MASK(64)); -+ if (err) { -+ err = dma_set_mask(&mlxplat_dev->dev, DMA_BIT_MASK(32)); -+ if (err) { -+ dev_err(&mlxplat_dev->dev, "dma_set_mask failed\n"); -+ goto fail_pci_set_dma_mask; -+ } -+ } -+ -+ if (pci_resource_len(pci_dev, 0) < MLXPLAT_FPGA_PCI_BAR0_SIZE) { -+ dev_err(&mlxplat_dev->dev, "invalid PCI region size\n"); -+ err = -EINVAL; -+ goto fail_pci_resource_len_check; -+ } -+ -+ mlxplat_mlxcpld_regmap_ctx.base = devm_ioremap(&mlxplat_dev->dev, -+ pci_resource_start(pci_dev, 0), -+ pci_resource_len(pci_dev, 0)); -+ if (!mlxplat_mlxcpld_regmap_ctx.base) { -+ dev_err(&mlxplat_dev->dev, "ioremap failed\n"); -+ err = -EIO; -+ goto fail_ioremap; -+ } -+ pci_set_master(pci_dev); -+ -+ mlxplat_dev = platform_device_register_simple(MLX_PLAT_DEVICE_NAME, PLATFORM_DEVID_NONE, -+ NULL, 0); -+ if (IS_ERR(mlxplat_dev)) { -+ err = PTR_ERR(mlxplat_dev); -+ goto fail_platform_device_register_simple; -+ } -+ -+ *hotplug_resources = mlxplat_mlxfpga_resources; -+ *hotplug_resources_size = ARRAY_SIZE(mlxplat_mlxfpga_resources); -+ *fpga_dev = pci_dev; -+ -+ return 0; -+ -+fail_platform_device_register_simple: -+fail_ioremap: -+fail_pci_resource_len_check: -+fail_pci_set_dma_mask: -+ pci_release_regions(pci_dev); -+fail_pci_request_regions: -+ pci_disable_device(pci_dev); -+fail_pci_enable_device: -+ return err; -+} -+ -+static void mlxplat_pci_fpga_device_exit(void) -+{ -+ platform_device_unregister(mlxplat_dev); -+ iounmap(mlxplat_mlxcpld_regmap_ctx.base); -+ pci_release_regions(fpga_dev); -+ pci_disable_device(fpga_dev); -+} -+ - static int - mlxplat_pre_init(struct resource **hotplug_resources, unsigned int *hotplug_resources_size) - { -+ int err; -+ -+ err = mlxplat_pci_fpga_device_init(hotplug_resources, hotplug_resources_size, &fpga_dev); -+ if (!err) -+ return 0; -+ else if (err != -ENODEV) -+ return err; -+ - return mlxplat_lpc_cpld_device_init(hotplug_resources, hotplug_resources_size); - } - - static void mlxplat_post_exit(void) - { -- mlxplat_lpc_cpld_device_exit(); -+ if (fpga_dev) -+ mlxplat_pci_fpga_device_exit(); -+ else -+ mlxplat_lpc_cpld_device_exit(); - } - - static int mlxplat_post_init(struct mlxplat_priv *priv) --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0198-platform-mellanox-Introduce-support-for-switches-bas.patch b/platform/mellanox/non-upstream-patches/patches/0198-platform-mellanox-Introduce-support-for-switches-bas.patch deleted file mode 100644 index 1c24c54d6faf..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0198-platform-mellanox-Introduce-support-for-switches-bas.patch +++ /dev/null @@ -1,253 +0,0 @@ -From bcdfc7d1d106889fa9af3404f252fb1260f5a0fd Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Tue, 15 Nov 2022 11:51:47 +0200 -Subject: [PATCH backport 5.10 086/150] platform: mellanox: Introduce support - for switches based on BlueField-3/ARM64 COMe -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Add support for Nvidia MQM97xx family switches providing a -high-performance solution by delivering high bandwidth with low latency -to Enterprise Data Centers. - -These switches are based on previous generation of MQM97xx switches, -excepting CFL based COMe module is replaced by new BlueField®-3 COMe -module. - -Switches of this class are equipped with: -- Nvidia Quantum™-2 ASIC, providing up to 64x400GB/s (IB) full - bidirectional bandwidth per port using PAM-4 modulation. -- Com-Express type 7 module, based on Nvidia NVIDIA® BlueField®-3 - processing unit and equipped with LATTICE LFD2NX40 Certus™-NX FPGA - secured device with fail safe - mechanism, connected by PCIe bus. -- Switch board with two Lattice LCMXO3D-9400HC secured with fail safe - mechanism, connected by PCEi-to-LPC bridge. -- Fan board to supporting 7 fans. -- 2x power extender boards. -- 7x FRU fans. -- 2x 2000W AC/DC PSU (FRU). - -New switches platform configuration is based on the new VMOD0016 -class. Configuration is extended to support new register map with -callbacks supporting indirect addressing for PCIe-to-LPC bridge. -This bridge provides interface between FPAG at COMe board (directly -connected to CPU PCIe root complex) to CPLDs on switch board (which -cannot be connected directly to PCIe root complex). - -Signed-off-by: Vadim Pasternak ---- - drivers/platform/mellanox/mlx-platform.c | 147 ++++++++++++++++++++++- - 1 file changed, 146 insertions(+), 1 deletion(-) - -diff --git a/drivers/platform/mellanox/mlx-platform.c b/drivers/platform/mellanox/mlx-platform.c -index f3df56c41..b1c8632d6 100644 ---- a/drivers/platform/mellanox/mlx-platform.c -+++ b/drivers/platform/mellanox/mlx-platform.c -@@ -270,6 +270,7 @@ - /* Maximum number of possible physical buses equipped on system */ - #define MLXPLAT_CPLD_MAX_PHYS_ADAPTER_NUM 16 - #define MLXPLAT_CPLD_MAX_PHYS_EXT_ADAPTER_NUM 24 -+#define MLXPLAT_CPLD_DEFAULT_MUX_HOTPLUG_VECTOR 0 - - /* Number of channels in group */ - #define MLXPLAT_CPLD_GRP_CHNL_NUM 8 -@@ -331,6 +332,17 @@ - #define PCI_VENDOR_ID_LATTICE 0x1204 - #define PCI_DEVICE_ID_LATTICE_LFD2NX40 0x9c1d - #define MLXPLAT_FPGA_PCI_BAR0_SIZE 0x4000 -+#define MLXPLAT_FPGA_PCI_BASE_OFFSET 0x00000000 -+#define MLXPLAT_FPGA_PCI_ADDR_OFFSET MLXPLAT_FPGA_PCI_BASE_OFFSET -+#define MLXPLAT_FPGA_PCI_DATA_OFFSET (MLXPLAT_FPGA_PCI_BASE_OFFSET + 0x02) -+#define MLXPLAT_FPGA_PCI_CTRL_OFFSET (MLXPLAT_FPGA_PCI_BASE_OFFSET + 0x04) -+#define MLXPLAT_FPGA_PCI_STAT_OFFSET (MLXPLAT_FPGA_PCI_BASE_OFFSET + 0x06) -+#define MLXPLAT_FPGA_PCI_I2C_LPC_OFFSET (MLXPLAT_FPGA_PCI_BASE_OFFSET + 0x400) -+ -+#define MLXPLAT_FPGA_PCI_CTRL_READ BIT(0) -+#define MLXPLAT_FPGA_PCI_CTRL_WRITE BIT(1) -+#define MLXPLAT_FPGA_PCI_COMPLETED BIT(0) -+#define MLXPLAT_FPGA_PCI_TO 50 /* usec */ - - /* mlxplat_priv - platform private data - * @pdev_i2c - i2c controller platform device -@@ -443,6 +455,28 @@ static struct i2c_mux_reg_platform_data mlxplat_default_mux_data[] = { - - }; - -+/* Default channels vector for regmap mux. */ -+static int mlxplat_default_regmap_mux_chan[] = { 1, 2, 3, 4, 5, 6, 7, 8 }; -+ -+/* Platform regmap mux data */ -+static struct i2c_mux_regmap_platform_data mlxplat_default_regmap_mux_data[] = { -+ { -+ .parent = 1, -+ .chan_ids = mlxplat_default_regmap_mux_chan, -+ .num_adaps = ARRAY_SIZE(mlxplat_default_regmap_mux_chan), -+ .sel_reg_addr = MLXPLAT_CPLD_LPC_REG_I2C_CH1_OFFSET, -+ .reg_size = 1, -+ }, -+ { -+ .parent = 1, -+ .chan_ids = mlxplat_default_regmap_mux_chan, -+ .num_adaps = ARRAY_SIZE(mlxplat_default_regmap_mux_chan), -+ .sel_reg_addr = MLXPLAT_CPLD_LPC_REG_I2C_CH2_OFFSET, -+ .reg_size = 1, -+ }, -+ -+}; -+ - /* Platform mux configuration variables */ - static int mlxplat_max_adap_num; - static int mlxplat_mux_num; -@@ -5796,6 +5830,84 @@ static const struct regmap_config mlxplat_mlxcpld_regmap_config_eth_modular = { - .reg_write = mlxplat_mlxcpld_reg_write, - }; - -+/* Wait completion routine for indirect access for register map */ -+static int mlxplat_fpga_completion_wait(struct mlxplat_mlxcpld_regmap_context *ctx) -+{ -+ unsigned long end; -+ u16 status; -+ -+ end = jiffies + msecs_to_jiffies(MLXPLAT_FPGA_PCI_TO); -+ do { -+ status = ioread16(ctx->base + MLXPLAT_FPGA_PCI_STAT_OFFSET); -+ if (status & MLXPLAT_FPGA_PCI_COMPLETED) -+ return 0; -+ cond_resched(); -+ } while (time_before(jiffies, end)); -+ -+ return -EIO; -+} -+ -+/* Read callback for indirect register map access */ -+static int mlxplat_fpga_reg_read(void *context, unsigned int reg, unsigned int *val) -+{ -+ struct mlxplat_mlxcpld_regmap_context *ctx = context; -+ int err; -+ -+ /* Verify there is no pending transactions */ -+ err = mlxplat_fpga_completion_wait(ctx); -+ if (err) -+ return err; -+ -+ /* Set address in register space */ -+ iowrite16(reg, ctx->base + MLXPLAT_FPGA_PCI_ADDR_OFFSET); -+ /* Activate read operation */ -+ iowrite16(MLXPLAT_FPGA_PCI_CTRL_READ, ctx->base + MLXPLAT_FPGA_PCI_CTRL_OFFSET); -+ /* Verify transaction completion */ -+ err = mlxplat_fpga_completion_wait(ctx); -+ if (err) -+ return err; -+ -+ /* Read data */ -+ *val = ioread16(ctx->base + MLXPLAT_FPGA_PCI_DATA_OFFSET); -+ -+ return 0; -+} -+ -+/* Write callback for indirect register map access */ -+static int mlxplat_fpga_reg_write(void *context, unsigned int reg, unsigned int val) -+{ -+ struct mlxplat_mlxcpld_regmap_context *ctx = context; -+ int err; -+ -+ /* Verify there is no pending transactions */ -+ err = mlxplat_fpga_completion_wait(ctx); -+ if (err) -+ return err; -+ -+ /* Set address in register space */ -+ iowrite16(reg, ctx->base + MLXPLAT_FPGA_PCI_ADDR_OFFSET); -+ /* Set data to be written */ -+ iowrite16(val, ctx->base + MLXPLAT_FPGA_PCI_DATA_OFFSET); -+ /* Activate write operation */ -+ iowrite16(MLXPLAT_FPGA_PCI_CTRL_WRITE, ctx->base + MLXPLAT_FPGA_PCI_CTRL_OFFSET); -+ -+ return 0; -+} -+ -+static const struct regmap_config mlxplat_fpga_regmap_config_bf3_comex_default = { -+ .reg_bits = 16, -+ .val_bits = 8, -+ .max_register = 512, -+ .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_ng400, -+ .num_reg_defaults = ARRAY_SIZE(mlxplat_mlxcpld_regmap_ng400), -+ .reg_read = mlxplat_fpga_reg_read, -+ .reg_write = mlxplat_fpga_reg_write, -+}; -+ - static struct resource mlxplat_mlxcpld_resources[] = { - [0] = DEFINE_RES_IRQ_NAMED(MLXPLAT_CPLD_LPC_SYSIRQ, "mlxreg-hotplug"), - }; -@@ -6175,6 +6287,29 @@ static int __init mlxplat_dmi_l1_switch_matched(const struct dmi_system_id *dmi) - return 1; - } - -+static int __init mlxplat_dmi_bf3_comex_default_matched(const struct dmi_system_id *dmi) -+{ -+ int i; -+ -+ mlxplat_max_adap_num = MLXPLAT_CPLD_MAX_PHYS_ADAPTER_NUM; -+ mlxplat_mux_hotplug_num = MLXPLAT_CPLD_DEFAULT_MUX_HOTPLUG_VECTOR; -+ mlxplat_mux_num = ARRAY_SIZE(mlxplat_default_regmap_mux_data); -+ mlxplat_mux_regmap_data = mlxplat_default_regmap_mux_data; -+ mlxplat_hotplug = &mlxplat_mlxcpld_ext_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_fpga_regmap_config_bf3_comex_default; -+ pm_power_off = mlxplat_poweroff; -+ -+ return 1; -+} -+ - static const struct dmi_system_id mlxplat_dmi_table[] __initconst = { - { - .callback = mlxplat_dmi_default_wc_matched, -@@ -6270,6 +6405,12 @@ static const struct dmi_system_id mlxplat_dmi_table[] __initconst = { - DMI_MATCH(DMI_BOARD_NAME, "VMOD0015"), - }, - }, -+ { -+ .callback = mlxplat_dmi_bf3_comex_default_matched, -+ .matches = { -+ DMI_MATCH(DMI_BOARD_NAME, "VMOD0016"), -+ }, -+ }, - { - .callback = mlxplat_dmi_l1_switch_matched, - .matches = { -@@ -6502,6 +6643,11 @@ mlxplat_pci_fpga_device_init(struct resource **hotplug_resources, - err = -EIO; - goto fail_ioremap; - } -+ -+ /* Set mapped base address of I2C-LPC bridge over PCIe */ -+ mlxplat_i2c->addr = mlxplat_mlxcpld_regmap_ctx.base + -+ MLXPLAT_FPGA_PCI_I2C_LPC_OFFSET; -+ - pci_set_master(pci_dev); - - mlxplat_dev = platform_device_register_simple(MLX_PLAT_DEVICE_NAME, PLATFORM_DEVID_NONE, -@@ -6782,7 +6928,6 @@ static int mlxplat_i2c_main_init(struct mlxplat_priv *priv) - nr = (nr == mlxplat_max_adap_num) ? -1 : nr; - mlxplat_i2c->regmap = priv->regmap; - mlxplat_i2c->handle = priv; -- - priv->pdev_i2c = platform_device_register_resndata(&mlxplat_dev->dev, "i2c_mlxcpld", - nr, priv->hotplug_resources, - priv->hotplug_resources_size, --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0199-platform-mellanox-mlx-platform-Add-reset-and-extend-.patch b/platform/mellanox/non-upstream-patches/patches/0199-platform-mellanox-mlx-platform-Add-reset-and-extend-.patch deleted file mode 100644 index f9079db493ce..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0199-platform-mellanox-mlx-platform-Add-reset-and-extend-.patch +++ /dev/null @@ -1,138 +0,0 @@ -From a556177a2359c784e063f0914049ffd7f8d8852d Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Tue, 22 Nov 2022 21:20:49 +0200 -Subject: [PATCH backport 5.10 087/150] platform: mellanox: mlx-platform: Add - reset and extend poweroff callbacks - -On ARM based systems reset and poweroff flow should include special -actions against CPLD device for performing graceful operations. -For reset it is necessary to toggle special PLATFORM_RESET# signal, for -poweroff special HALT# signal. - -In order to support such flows relevant actions are provided. - -Signed-off-by: Vadim Pasternak ---- - drivers/platform/mellanox/mlx-platform.c | 35 ++++++++++++++++++++++++ - 1 file changed, 35 insertions(+) - -diff --git a/drivers/platform/mellanox/mlx-platform.c b/drivers/platform/mellanox/mlx-platform.c -index b1c8632d6..849fdf5de 100644 ---- a/drivers/platform/mellanox/mlx-platform.c -+++ b/drivers/platform/mellanox/mlx-platform.c -@@ -43,6 +43,7 @@ - #define MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET 0x1d - #define MLXPLAT_CPLD_LPC_REG_RST_CAUSE1_OFFSET 0x1e - #define MLXPLAT_CPLD_LPC_REG_RST_CAUSE2_OFFSET 0x1f -+#define MLXPLAT_CPLD_LPC_REG_PG_RST_OFFSET 0x19 - #define MLXPLAT_CPLD_LPC_REG_LED1_OFFSET 0x20 - #define MLXPLAT_CPLD_LPC_REG_LED2_OFFSET 0x21 - #define MLXPLAT_CPLD_LPC_REG_LED3_OFFSET 0x22 -@@ -263,6 +264,7 @@ - #define MLXPLAT_CPLD_LPC_LC_MASK GENMASK(7, 0) - - #define MLXPLAT_CPLD_HALT_MASK BIT(3) -+#define MLXPLAT_CPLD_RESET_MASK 0xfe - - /* Default I2C parent bus number */ - #define MLXPLAT_CPLD_PHYS_ADAPTER_DEF_NR 1 -@@ -483,6 +485,7 @@ static int mlxplat_mux_num; - static int mlxplat_mux_hotplug_num; - static struct i2c_mux_reg_platform_data *mlxplat_mux_data; - static struct i2c_mux_regmap_platform_data *mlxplat_mux_regmap_data; -+static struct notifier_block *mlxplat_reboot_nb; - - /* Platform extended mux data */ - static struct i2c_mux_reg_platform_data mlxplat_extended_mux_data[] = { -@@ -5280,6 +5283,7 @@ static bool mlxplat_mlxcpld_writeable_reg(struct device *dev, unsigned int reg) - switch (reg) { - case MLXPLAT_CPLD_LPC_REG_RESET_GP4_OFFSET: - case MLXPLAT_CPLD_LPC_REG_LED1_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_PG_RST_OFFSET: - case MLXPLAT_CPLD_LPC_REG_LED2_OFFSET: - case MLXPLAT_CPLD_LPC_REG_LED3_OFFSET: - case MLXPLAT_CPLD_LPC_REG_LED4_OFFSET: -@@ -5387,6 +5391,7 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_REG_RST_CAUSE1_OFFSET: - case MLXPLAT_CPLD_LPC_REG_RST_CAUSE2_OFFSET: - case MLXPLAT_CPLD_LPC_REG_LED1_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_PG_RST_OFFSET: - case MLXPLAT_CPLD_LPC_REG_LED2_OFFSET: - case MLXPLAT_CPLD_LPC_REG_LED3_OFFSET: - case MLXPLAT_CPLD_LPC_REG_LED4_OFFSET: -@@ -5546,6 +5551,7 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_REG_RST_CAUSE1_OFFSET: - case MLXPLAT_CPLD_LPC_REG_RST_CAUSE2_OFFSET: - case MLXPLAT_CPLD_LPC_REG_LED1_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_PG_RST_OFFSET: - case MLXPLAT_CPLD_LPC_REG_LED2_OFFSET: - case MLXPLAT_CPLD_LPC_REG_LED3_OFFSET: - case MLXPLAT_CPLD_LPC_REG_LED4_OFFSET: -@@ -5928,12 +5934,31 @@ static const struct regmap_config *mlxplat_regmap_config; - static struct spi_board_info *mlxplat_spi; - static struct pci_dev *fpga_dev; - -+/* Platform default reset function */ -+static int mlxplat_reboot_notifier(struct notifier_block *nb, unsigned long action, void *unused) -+{ -+ struct mlxplat_priv *priv = platform_get_drvdata(mlxplat_dev); -+ -+ if (action == SYS_RESTART) -+ regmap_write(priv->regmap, MLXPLAT_CPLD_LPC_REG_PG_RST_OFFSET, -+ MLXPLAT_CPLD_RESET_MASK); -+ -+ return NOTIFY_DONE; -+} -+ -+static struct notifier_block mlxplat_reboot_default_nb = { -+ .notifier_call = mlxplat_reboot_notifier, -+}; -+ - /* Platform default poweroff function */ - static void mlxplat_poweroff(void) - { - struct mlxplat_priv *priv = platform_get_drvdata(mlxplat_dev); - -+ if (mlxplat_reboot_nb) -+ unregister_reboot_notifier(mlxplat_reboot_nb); - regmap_write(priv->regmap, MLXPLAT_CPLD_LPC_REG_GP1_OFFSET, MLXPLAT_CPLD_HALT_MASK); -+ kernel_halt(); - } - - static int __init mlxplat_dmi_default_matched(const struct dmi_system_id *dmi) -@@ -6305,6 +6330,7 @@ static int __init mlxplat_dmi_bf3_comex_default_matched(const struct dmi_system_ - mlxplat_wd_data[i] = &mlxplat_mlxcpld_wd_set_type2[i]; - mlxplat_i2c = &mlxplat_mlxcpld_i2c_ng_data; - mlxplat_regmap_config = &mlxplat_fpga_regmap_config_bf3_comex_default; -+ mlxplat_reboot_nb = &mlxplat_reboot_default_nb; - pm_power_off = mlxplat_poweroff; - - return 1; -@@ -7012,8 +7038,15 @@ static int __init mlxplat_init(void) - if (err) - goto fail_regcache_sync; - -+ if (mlxplat_reboot_nb) { -+ err = register_reboot_notifier(mlxplat_reboot_nb); -+ if (err) -+ goto fail_register_reboot_notifier; -+ } -+ - return 0; - -+fail_register_reboot_notifier: - fail_regcache_sync: - mlxplat_pre_exit(priv); - fail_mlxplat_i2c_main_init: -@@ -7031,6 +7064,8 @@ static void __exit mlxplat_exit(void) - - if (pm_power_off) - pm_power_off = NULL; -+ if (mlxplat_reboot_nb) -+ unregister_reboot_notifier(mlxplat_reboot_nb); - mlxplat_pre_exit(priv); - mlxplat_i2c_main_exit(priv); - } --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0212-platform-mellanox-mlxbf-pmc-Add-Mellanox-BlueField-P.patch b/platform/mellanox/non-upstream-patches/patches/0212-platform-mellanox-mlxbf-pmc-Add-Mellanox-BlueField-P.patch index 03e53f059051..a7b97a234dc3 100644 --- a/platform/mellanox/non-upstream-patches/patches/0212-platform-mellanox-mlxbf-pmc-Add-Mellanox-BlueField-P.patch +++ b/platform/mellanox/non-upstream-patches/patches/0212-platform-mellanox-mlxbf-pmc-Add-Mellanox-BlueField-P.patch @@ -60,12 +60,12 @@ index 5bd6ddd42..b0d2c3343 100644 tristate "Nvidia SN2201 platform driver support" depends on REGMAP diff --git a/drivers/platform/mellanox/Makefile b/drivers/platform/mellanox/Makefile -index 23919e56a..ba56485cb 100644 +index 499623ccf2fe..000ddaa74c98 100644 --- a/drivers/platform/mellanox/Makefile +++ b/drivers/platform/mellanox/Makefile -@@ -5,6 +5,7 @@ +@@ -4,6 +4,7 @@ + # Mellanox Platform-Specific Drivers # - obj-$(CONFIG_MLX_PLATFORM) += mlx-platform.o obj-$(CONFIG_MLXBF_BOOTCTL) += mlxbf-bootctl.o +obj-$(CONFIG_MLXBF_PMC) += mlxbf-pmc.o obj-$(CONFIG_MLXBF_TMFIFO) += mlxbf-tmfifo.o diff --git a/platform/mellanox/non-upstream-patches/patches/0218-UBUNTU-SAUCE-platform-mellanox-Add-mlx-trio-driver.patch b/platform/mellanox/non-upstream-patches/patches/0218-UBUNTU-SAUCE-platform-mellanox-Add-mlx-trio-driver.patch index 104c33198caf..582c3e27d38b 100644 --- a/platform/mellanox/non-upstream-patches/patches/0218-UBUNTU-SAUCE-platform-mellanox-Add-mlx-trio-driver.patch +++ b/platform/mellanox/non-upstream-patches/patches/0218-UBUNTU-SAUCE-platform-mellanox-Add-mlx-trio-driver.patch @@ -40,17 +40,16 @@ index b0d2c3343..5d329350a 100644 tristate "Nvidia SN2201 platform driver support" depends on REGMAP diff --git a/drivers/platform/mellanox/Makefile b/drivers/platform/mellanox/Makefile -index ba56485cb..161fad566 100644 +index 000ddaa74c98..837b748db1f6 100644 --- a/drivers/platform/mellanox/Makefile +++ b/drivers/platform/mellanox/Makefile -@@ -7,6 +7,7 @@ obj-$(CONFIG_MLX_PLATFORM) += mlx-platform.o +@@ -6,5 +6,6 @@ obj-$(CONFIG_MLXBF_BOOTCTL) += mlxbf-bootctl.o obj-$(CONFIG_MLXBF_PMC) += mlxbf-pmc.o obj-$(CONFIG_MLXBF_TMFIFO) += mlxbf-tmfifo.o +obj-$(CONFIG_MLXBF_TRIO) += mlx-trio.o obj-$(CONFIG_MLXREG_HOTPLUG) += mlxreg-hotplug.o obj-$(CONFIG_MLXREG_IO) += mlxreg-io.o - obj-$(CONFIG_MLXREG_LC) += mlxreg-lc.o diff --git a/drivers/platform/mellanox/mlx-trio.c b/drivers/platform/mellanox/mlx-trio.c new file mode 100644 index 000000000..849006e9c diff --git a/platform/mellanox/non-upstream-patches/patches/0220-UBUNTU-SAUCE-pka-Add-pka-driver.patch b/platform/mellanox/non-upstream-patches/patches/0220-UBUNTU-SAUCE-pka-Add-pka-driver.patch index 875083ea0234..9cf8e26254d1 100644 --- a/platform/mellanox/non-upstream-patches/patches/0220-UBUNTU-SAUCE-pka-Add-pka-driver.patch +++ b/platform/mellanox/non-upstream-patches/patches/0220-UBUNTU-SAUCE-pka-Add-pka-driver.patch @@ -57,14 +57,16 @@ index 5d329350a..946bc2375 100644 tristate "Nvidia SN2201 platform driver support" depends on REGMAP diff --git a/drivers/platform/mellanox/Makefile b/drivers/platform/mellanox/Makefile -index 161fad566..046347d3a 100644 +index a0a073adb..d89931e36 100644 --- a/drivers/platform/mellanox/Makefile +++ b/drivers/platform/mellanox/Makefile -@@ -12,3 +12,4 @@ obj-$(CONFIG_MLXREG_HOTPLUG) += mlxreg-hotplug.o +@@ -9,5 +9,6 @@ obj-$(CONFIG_MLXBF_TMFIFO) += mlxbf-tmfifo.o + obj-$(CONFIG_MLXBF_TRIO) += mlx-trio.o + obj-$(CONFIG_MLXREG_HOTPLUG) += mlxreg-hotplug.o obj-$(CONFIG_MLXREG_IO) += mlxreg-io.o ++obj-$(CONFIG_MLXBF_PKA) += mlxbf_pka/ obj-$(CONFIG_MLXREG_LC) += mlxreg-lc.o obj-$(CONFIG_NVSW_SN2201) += nvsw-sn2201.o -+obj-$(CONFIG_MLXBF_PKA) += mlxbf_pka/ diff --git a/drivers/platform/mellanox/mlxbf_pka/Kconfig b/drivers/platform/mellanox/mlxbf_pka/Kconfig new file mode 100644 index 000000000..ebc038ec7 diff --git a/platform/mellanox/non-upstream-patches/patches/0221-UBUNTU-SAUCE-platform-mellanox-Add-mlxbf-livefish-dr.patch b/platform/mellanox/non-upstream-patches/patches/0221-UBUNTU-SAUCE-platform-mellanox-Add-mlxbf-livefish-dr.patch index 8f9c4430e57d..d83c31b778d4 100644 --- a/platform/mellanox/non-upstream-patches/patches/0221-UBUNTU-SAUCE-platform-mellanox-Add-mlxbf-livefish-dr.patch +++ b/platform/mellanox/non-upstream-patches/patches/0221-UBUNTU-SAUCE-platform-mellanox-Add-mlxbf-livefish-dr.patch @@ -39,17 +39,16 @@ index 946bc2375..a5231c23a 100644 tristate "Mellanox BlueField Performance Monitoring Counters driver" depends on ARM64 diff --git a/drivers/platform/mellanox/Makefile b/drivers/platform/mellanox/Makefile -index 046347d3a..7c6393ebe 100644 +index 837b748db1f6..be5b83bd765e 100644 --- a/drivers/platform/mellanox/Makefile +++ b/drivers/platform/mellanox/Makefile -@@ -8,6 +8,7 @@ obj-$(CONFIG_MLXBF_BOOTCTL) += mlxbf-bootctl.o +@@ -7,5 +7,6 @@ obj-$(CONFIG_MLXBF_BOOTCTL) += mlxbf-bootctl.o obj-$(CONFIG_MLXBF_PMC) += mlxbf-pmc.o obj-$(CONFIG_MLXBF_TMFIFO) += mlxbf-tmfifo.o obj-$(CONFIG_MLXBF_TRIO) += mlx-trio.o +obj-$(CONFIG_MLXBF_LIVEFISH) += mlxbf-livefish.o obj-$(CONFIG_MLXREG_HOTPLUG) += mlxreg-hotplug.o obj-$(CONFIG_MLXREG_IO) += mlxreg-io.o - obj-$(CONFIG_MLXREG_LC) += mlxreg-lc.o diff --git a/drivers/platform/mellanox/mlxbf-livefish.c b/drivers/platform/mellanox/mlxbf-livefish.c new file mode 100644 index 000000000..c6150117d diff --git a/platform/mellanox/non-upstream-patches/patches/0234-UBUNTU-SAUCE-mlxbf_gige-add-validation-of-ACPI-table.patch b/platform/mellanox/non-upstream-patches/patches/0234-UBUNTU-SAUCE-mlxbf_gige-add-validation-of-ACPI-table.patch deleted file mode 100644 index 3d6cbb213472..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0234-UBUNTU-SAUCE-mlxbf_gige-add-validation-of-ACPI-table.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 8c7dd66540096a636aa35406cdb023dd549e2755 Mon Sep 17 00:00:00 2001 -From: David Thompson -Date: Wed, 20 Jul 2022 18:17:09 -0400 -Subject: [PATCH backport 5.10 35/63] UBUNTU: SAUCE: mlxbf_gige: add validation - of ACPI table version - -BugLink: https://bugs.launchpad.net/bugs/1982427 - -This patch checks the "version" property in the OOB ACPI table, -ensuring that the driver probe will only succeed if the expected -version is found. - -Change-Id: I8dc1f877338f9b23ab3560c0315a1727e144dd57 -Signed-off-by: David Thompson -Signed-off-by: Ike Panhc ---- - .../mellanox/mlxbf_gige/mlxbf_gige_main.c | 19 +++++++++++++++++++ - 1 file changed, 19 insertions(+) - -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -index e8f9290a8..c9176a2e6 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -@@ -19,6 +19,11 @@ - #include "mlxbf_gige.h" - #include "mlxbf_gige_regs.h" - -+/* This setting defines the version of the ACPI table -+ * content that is compatible with this driver version. -+ */ -+#define MLXBF_GIGE_ACPI_TABLE_VERSION 2 -+ - /* Allocate SKB whose payload pointer aligns with the Bluefield - * hardware DMA limitation, i.e. DMA operation can't cross - * a 4KB boundary. A maximum packet size of 2KB is assumed in the -@@ -282,9 +287,23 @@ static int mlxbf_gige_probe(struct platform_device *pdev) - void __iomem *plu_base; - void __iomem *base; - int addr, phy_irq; -+ u32 version; - u64 control; - int err; - -+ version = 0; -+ err = device_property_read_u32(&pdev->dev, "version", &version); -+ if (err) { -+ dev_err(&pdev->dev, "ACPI table version not found\n"); -+ return -EINVAL; -+ } -+ -+ if (version != MLXBF_GIGE_ACPI_TABLE_VERSION) { -+ dev_err(&pdev->dev, "ACPI table version mismatch: expected %d found %d\n", -+ MLXBF_GIGE_ACPI_TABLE_VERSION, version); -+ return -EINVAL; -+ } -+ - mac_res = platform_get_resource(pdev, IORESOURCE_MEM, MLXBF_GIGE_RES_MAC); - if (!mac_res) - return -ENXIO; --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0235-UBUNTU-SAUCE-mlxbf_gige-set-driver-version-to-1.27.patch b/platform/mellanox/non-upstream-patches/patches/0235-UBUNTU-SAUCE-mlxbf_gige-set-driver-version-to-1.27.patch deleted file mode 100644 index 1f0fcabc871c..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0235-UBUNTU-SAUCE-mlxbf_gige-set-driver-version-to-1.27.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 438c36fd4f5ca577d03d50d0d037e44a2d25edd1 Mon Sep 17 00:00:00 2001 -From: David Thompson -Date: Wed, 20 Jul 2022 18:59:14 -0400 -Subject: [PATCH backport 5.10 36/63] UBUNTU: SAUCE: mlxbf_gige: set driver - version to 1.27 - -BugLink: https://bugs.launchpad.net/bugs/1982431 - -This patch adds logic to specify the driver version -via MODULE_VERSION() and sets the value to 1.27 - -Change-Id: I91f775df119877ad6d6eeaa5e5f93dcf1b55c8d2 -Signed-off-by: David Thompson -Signed-off-by: Ike Panhc ---- - drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -index c9176a2e6..66a50e35f 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -@@ -19,6 +19,8 @@ - #include "mlxbf_gige.h" - #include "mlxbf_gige_regs.h" - -+#define DRV_VERSION 1.27 -+ - /* This setting defines the version of the ACPI table - * content that is compatible with this driver version. - */ -@@ -470,3 +472,4 @@ MODULE_DESCRIPTION("Mellanox BlueField SoC Gigabit Ethernet Driver"); - MODULE_AUTHOR("David Thompson "); - MODULE_AUTHOR("Asmaa Mnebhi "); - MODULE_LICENSE("Dual BSD/GPL"); -+MODULE_VERSION(__stringify(DRV_VERSION)); --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0241-UBUNTU-SAUCE-mlxbf_gige-add-BlueField-3-Serdes-confi.patch b/platform/mellanox/non-upstream-patches/patches/0241-UBUNTU-SAUCE-mlxbf_gige-add-BlueField-3-Serdes-confi.patch deleted file mode 100644 index bdeef431bc85..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0241-UBUNTU-SAUCE-mlxbf_gige-add-BlueField-3-Serdes-confi.patch +++ /dev/null @@ -1,1865 +0,0 @@ -From e2017fcee49f8d2b36a59d5d6076259f4e4feeac Mon Sep 17 00:00:00 2001 -From: David Thompson -Date: Tue, 25 Oct 2022 18:24:01 -0400 -Subject: [PATCH backport 5.10 42/63] UBUNTU: SAUCE: mlxbf_gige: add - BlueField-3 Serdes configuration - -BugLink: https://bugs.launchpad.net/bugs/1995148 - -The BlueField-3 out-of-band Ethernet interface requires -SerDes configuration. There are two aspects to this: - -Configuration of PLL: - 1) Initialize UPHY registers to values dependent on p1clk clock - 2) Load PLL best known values via the gateway register - 3) Set the fuses to tune up the SerDes voltage - 4) Lock the PLL - 5) Get the lanes out of functional reset. - 6) Configure the UPHY microcontroller via gateway reads/writes - -Configuration of lanes: - 1) Configure and open TX lanes - 2) Configure and open RX lanes - -Signed-off-by: David Thompson -Signed-off-by: Asmaa Mnebhi ---- - .../net/ethernet/mellanox/mlxbf_gige/Makefile | 3 +- - .../ethernet/mellanox/mlxbf_gige/mlxbf_gige.h | 4 +- - .../mellanox/mlxbf_gige/mlxbf_gige_main.c | 76 +- - .../mellanox/mlxbf_gige/mlxbf_gige_mdio.c | 36 - - .../mellanox/mlxbf_gige/mlxbf_gige_uphy.c | 1191 +++++++++++++++++ - .../mellanox/mlxbf_gige/mlxbf_gige_uphy.h | 398 ++++++ - 6 files changed, 1645 insertions(+), 63 deletions(-) - create mode 100644 drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_uphy.c - create mode 100644 drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_uphy.h - -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/Makefile b/drivers/net/ethernet/mellanox/mlxbf_gige/Makefile -index a97c2bef8..524af17ca 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/Makefile -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/Makefile -@@ -7,4 +7,5 @@ mlxbf_gige-y := mlxbf_gige_ethtool.o \ - mlxbf_gige_main.o \ - mlxbf_gige_mdio.o \ - mlxbf_gige_rx.o \ -- mlxbf_gige_tx.o -+ mlxbf_gige_tx.o \ -+ mlxbf_gige_uphy.o -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige.h b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige.h -index a453b9cd9..e9bd09ee0 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige.h -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige.h -@@ -100,6 +100,7 @@ struct mlxbf_gige { - struct platform_device *pdev; - void __iomem *mdio_io; - void __iomem *clk_io; -+ void __iomem *fuse_gw_io; - struct mii_bus *mdiobus; - spinlock_t lock; /* for packet processing indices */ - u16 rx_q_entries; -@@ -166,7 +167,8 @@ enum mlxbf_gige_res { - MLXBF_GIGE_RES_GPIO0, - MLXBF_GIGE_RES_LLU, - MLXBF_GIGE_RES_PLU, -- MLXBF_GIGE_RES_CLK -+ MLXBF_GIGE_RES_CLK, -+ MLXBF_GIGE_RES_FUSE_GW - }; - - /* Version of register data returned by mlxbf_gige_get_regs() */ -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -index 106b83bd6..f97e49670 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -@@ -18,13 +18,25 @@ - - #include "mlxbf_gige.h" - #include "mlxbf_gige_regs.h" -+#include "mlxbf_gige_uphy.h" - --#define DRV_VERSION 1.27 -+#define MLXBF_GIGE_BF2_COREPLL_ADDR 0x02800c30 -+#define MLXBF_GIGE_BF2_COREPLL_SIZE 0x0000000c -+#define MLXBF_GIGE_BF3_COREPLL_ADDR 0x13409824 -+#define MLXBF_GIGE_BF3_COREPLL_SIZE 0x00000020 - --/* This setting defines the version of the ACPI table -- * content that is compatible with this driver version. -- */ --#define MLXBF_GIGE_ACPI_TABLE_VERSION 2 -+static struct resource corepll_params[] = { -+ [MLXBF_GIGE_VERSION_BF2] = { -+ .start = MLXBF_GIGE_BF2_COREPLL_ADDR, -+ .end = MLXBF_GIGE_BF2_COREPLL_ADDR + MLXBF_GIGE_BF2_COREPLL_SIZE - 1, -+ .name = "COREPLL_RES" -+ }, -+ [MLXBF_GIGE_VERSION_BF3] = { -+ .start = MLXBF_GIGE_BF3_COREPLL_ADDR, -+ .end = MLXBF_GIGE_BF3_COREPLL_ADDR + MLXBF_GIGE_BF3_COREPLL_SIZE - 1, -+ .name = "COREPLL_RES" -+ } -+}; - - /* Allocate SKB whose payload pointer aligns with the Bluefield - * hardware DMA limitation, i.e. DMA operation can't cross -@@ -371,31 +383,20 @@ static int mlxbf_gige_probe(struct platform_device *pdev) - { - struct phy_device *phydev; - struct net_device *netdev; -+ struct resource *clk_res; - struct resource *mac_res; - struct resource *llu_res; - struct resource *plu_res; - struct mlxbf_gige *priv; - void __iomem *llu_base; - void __iomem *plu_base; -+ void __iomem *clk_io; - void __iomem *base; - int addr, phy_irq; -- u32 version; -+ u64 soc_version; - u64 control; - int err; - -- version = 0; -- err = device_property_read_u32(&pdev->dev, "version", &version); -- if (err) { -- dev_err(&pdev->dev, "ACPI table version not found\n"); -- return -EINVAL; -- } -- -- if (version != MLXBF_GIGE_ACPI_TABLE_VERSION) { -- dev_err(&pdev->dev, "ACPI table version mismatch: expected %d found %d\n", -- MLXBF_GIGE_ACPI_TABLE_VERSION, version); -- return -EINVAL; -- } -- - mac_res = platform_get_resource(pdev, IORESOURCE_MEM, MLXBF_GIGE_RES_MAC); - if (!mac_res) - return -ENXIO; -@@ -404,6 +405,25 @@ static int mlxbf_gige_probe(struct platform_device *pdev) - if (IS_ERR(base)) - return PTR_ERR(base); - -+ soc_version = readq(base + MLXBF_GIGE_VERSION); -+ if (soc_version > MLXBF_GIGE_VERSION_BF3) -+ return -ENODEV; -+ -+ /* clk resource shared with other drivers so cannot use -+ * devm_platform_ioremap_resource -+ */ -+ clk_res = platform_get_resource(pdev, IORESOURCE_MEM, MLXBF_GIGE_RES_CLK); -+ if (!clk_res) { -+ /* For backward compatibility with older ACPI tables, also keep -+ * CLK resource internal to the driver. -+ */ -+ clk_res = &corepll_params[soc_version]; -+ } -+ -+ clk_io = devm_ioremap(&pdev->dev, clk_res->start, resource_size(clk_res)); -+ if (!clk_io) -+ return -ENOMEM; -+ - llu_res = platform_get_resource(pdev, IORESOURCE_MEM, MLXBF_GIGE_RES_LLU); - if (!llu_res) - return -ENXIO; -@@ -441,17 +461,23 @@ static int mlxbf_gige_probe(struct platform_device *pdev) - - spin_lock_init(&priv->lock); - -- priv->hw_version = readq(base + MLXBF_GIGE_VERSION); -+ priv->clk_io = clk_io; -+ priv->base = base; -+ priv->llu_base = llu_base; -+ priv->plu_base = plu_base; -+ priv->hw_version = soc_version; -+ -+ if (priv->hw_version == MLXBF_GIGE_VERSION_BF3) { -+ err = mlxbf_gige_config_uphy(priv); -+ if (err) -+ return err; -+ } - - /* Attach MDIO device */ - err = mlxbf_gige_mdio_probe(pdev, priv); - if (err) - return err; - -- priv->base = base; -- priv->llu_base = llu_base; -- priv->plu_base = plu_base; -- - priv->rx_q_entries = MLXBF_GIGE_DEFAULT_RXQ_SZ; - priv->tx_q_entries = MLXBF_GIGE_DEFAULT_TXQ_SZ; - -@@ -553,4 +579,4 @@ MODULE_DESCRIPTION("Mellanox BlueField SoC Gigabit Ethernet Driver"); - MODULE_AUTHOR("David Thompson "); - MODULE_AUTHOR("Asmaa Mnebhi "); - MODULE_LICENSE("Dual BSD/GPL"); --MODULE_VERSION(__stringify(DRV_VERSION)); -+ -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c -index 4ee3df30c..21acdcea3 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c -@@ -113,24 +113,6 @@ static struct mlxbf_gige_mdio_gw mlxbf_gige_mdio_gw_t[] = { - /* Busy bit is set by software and cleared by hardware */ - #define MLXBF_GIGE_MDIO_SET_BUSY 0x1 - --#define MLXBF_GIGE_BF2_COREPLL_ADDR 0x02800c30 --#define MLXBF_GIGE_BF2_COREPLL_SIZE 0x0000000c --#define MLXBF_GIGE_BF3_COREPLL_ADDR 0x13409824 --#define MLXBF_GIGE_BF3_COREPLL_SIZE 0x00000010 -- --static struct resource corepll_params[] = { -- [MLXBF_GIGE_VERSION_BF2] = { -- .start = MLXBF_GIGE_BF2_COREPLL_ADDR, -- .end = MLXBF_GIGE_BF2_COREPLL_ADDR + MLXBF_GIGE_BF2_COREPLL_SIZE - 1, -- .name = "COREPLL_RES" -- }, -- [MLXBF_GIGE_VERSION_BF3] = { -- .start = MLXBF_GIGE_BF3_COREPLL_ADDR, -- .end = MLXBF_GIGE_BF3_COREPLL_ADDR + MLXBF_GIGE_BF3_COREPLL_SIZE - 1, -- .name = "COREPLL_RES" -- } --}; -- - /* Returns core clock i1clk in Hz */ - static u64 calculate_i1clk(struct mlxbf_gige *priv) - { -@@ -297,9 +279,6 @@ int mlxbf_gige_mdio_probe(struct platform_device *pdev, struct mlxbf_gige *priv) - struct resource *res; - int ret; - -- if (priv->hw_version > MLXBF_GIGE_VERSION_BF3) -- return -ENODEV; -- - res = platform_get_resource(pdev, IORESOURCE_MEM, MLXBF_GIGE_RES_MDIO9); - if (!res) - return -ENODEV; -@@ -308,21 +287,6 @@ int mlxbf_gige_mdio_probe(struct platform_device *pdev, struct mlxbf_gige *priv) - if (IS_ERR(priv->mdio_io)) - return PTR_ERR(priv->mdio_io); - -- /* clk resource shared with other drivers so cannot use -- * devm_platform_ioremap_resource -- */ -- res = platform_get_resource(pdev, IORESOURCE_MEM, MLXBF_GIGE_RES_CLK); -- if (!res) { -- /* For backward compatibility with older ACPI tables, also keep -- * CLK resource internal to the driver. -- */ -- res = &corepll_params[priv->hw_version]; -- } -- -- priv->clk_io = devm_ioremap(dev, res->start, resource_size(res)); -- if (!priv->clk_io) -- return -ENOMEM; -- - priv->mdio_gw = &mlxbf_gige_mdio_gw_t[priv->hw_version]; - - mlxbf_gige_mdio_cfg(priv); -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_uphy.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_uphy.c -new file mode 100644 -index 000000000..9d64eb886 ---- /dev/null -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_uphy.c -@@ -0,0 +1,1191 @@ -+// SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause -+ -+/* UPHY support for Nvidia Gigabit Ethernet driver -+ * -+ * Copyright (C) 2022 NVIDIA CORPORATION & AFFILIATES -+ */ -+ -+#include -+#include -+#include -+ -+#include "mlxbf_gige.h" -+#include "mlxbf_gige_uphy.h" -+ -+static const struct mlxbf_gige_uphy_cfg_reg -+mlxbf_gige_clm_init[] = { -+ {.addr = 0x001, .wdata = 0x0105}, -+ {.addr = 0x008, .wdata = 0x0001}, -+ {.addr = 0x00B, .wdata = 0x8420}, -+ {.addr = 0x00E, .wdata = 0x0110}, -+ {.addr = 0x010, .wdata = 0x3010}, -+ {.addr = 0x027, .wdata = 0x0104}, -+ {.addr = 0x02F, .wdata = 0x09EA}, -+ {.addr = 0x055, .wdata = 0x0008}, -+ {.addr = 0x058, .wdata = 0x0088}, -+ {.addr = 0x072, .wdata = 0x3222}, -+ {.addr = 0x073, .wdata = 0x7654}, -+ {.addr = 0x074, .wdata = 0xBA98}, -+ {.addr = 0x075, .wdata = 0xDDDC} -+}; -+ -+#define MLXBF_GIGE_UPHY_CLM_INIT_NUM_ENTRIES \ -+ (sizeof(mlxbf_gige_clm_init) / sizeof(struct mlxbf_gige_uphy_cfg_reg)) -+ -+static const struct mlxbf_gige_uphy_cfg_reg -+mlxbf_gige_dlm_imem_init[] = { -+ {.addr = 0x39C, .wdata = 0x0000}, -+ {.addr = 0x39D, .wdata = 0x0095}, -+ {.addr = 0x3BF, .wdata = 0x9027}, -+ {.addr = 0x39E, .wdata = 0xA8F6}, -+ {.addr = 0x39F, .wdata = 0xAA10}, -+ {.addr = 0x3A0, .wdata = 0xA8D4}, -+ {.addr = 0x3A1, .wdata = 0xA7AE}, -+ {.addr = 0x3A2, .wdata = 0xA7CC}, -+ {.addr = 0x3A3, .wdata = 0x9BE4}, -+ {.addr = 0x3A4, .wdata = 0xB2D2}, -+ {.addr = 0x3A5, .wdata = 0xB1F2}, -+ {.addr = 0x3AE, .wdata = 0x7C38}, -+ {.addr = 0x3AF, .wdata = 0x7C4A}, -+ {.addr = 0x3B0, .wdata = 0x7C25}, -+ {.addr = 0x3B1, .wdata = 0x7C74}, -+ {.addr = 0x3B2, .wdata = 0x3C00}, -+ {.addr = 0x3B3, .wdata = 0x3C11}, -+ {.addr = 0x3B4, .wdata = 0x3C5D}, -+ {.addr = 0x3B5, .wdata = 0x3C5D} -+}; -+ -+#define MLXBF_GIGE_UPHY_DLM_IMEM_INIT_NUM_ENTRIES \ -+ (sizeof(mlxbf_gige_dlm_imem_init) / sizeof(struct mlxbf_gige_uphy_cfg_reg)) -+ -+static const struct mlxbf_gige_uphy_cfg_reg -+mlxbf_gige_dlm_seq_imem_wr_en_init = { -+ .addr = 0x39A, .wdata = 0x0001 -+}; -+ -+static const struct mlxbf_gige_uphy_cfg_reg -+mlxbf_gige_dlm_seq_imem_wr_dis_init = { -+ .addr = 0x39A, .wdata = 0x0000 -+}; -+ -+static const struct mlxbf_gige_uphy_cfg_reg -+mlxbf_gige_dlm_imem_data[] = { -+ { /* .iaddr = 0x0000 */ .wdata = 0x02DF}, -+ { /* .iaddr = 0x0001 */ .wdata = 0xEEC0}, -+ { /* .iaddr = 0x0002 */ .wdata = 0xD508}, -+ { /* .iaddr = 0x0003 */ .wdata = 0x022F}, -+ { /* .iaddr = 0x0004 */ .wdata = 0xC401}, -+ { /* .iaddr = 0x0005 */ .wdata = 0xD341}, -+ { /* .iaddr = 0x0006 */ .wdata = 0xC402}, -+ { /* .iaddr = 0x0007 */ .wdata = 0xD342}, -+ { /* .iaddr = 0x0008 */ .wdata = 0xC403}, -+ { /* .iaddr = 0x0009 */ .wdata = 0xD343}, -+ { /* .iaddr = 0x000A */ .wdata = 0xC404}, -+ { /* .iaddr = 0x000B */ .wdata = 0xD344}, -+ { /* .iaddr = 0x000C */ .wdata = 0xC417}, -+ { /* .iaddr = 0x000D */ .wdata = 0xD355}, -+ { /* .iaddr = 0x000E */ .wdata = 0xC418}, -+ { /* .iaddr = 0x000F */ .wdata = 0xD356}, -+ { /* .iaddr = 0x0010 */ .wdata = 0xF021}, -+ { /* .iaddr = 0x0011 */ .wdata = 0xF003}, -+ { /* .iaddr = 0x0012 */ .wdata = 0xE224}, -+ { /* .iaddr = 0x0013 */ .wdata = 0x0DA9}, -+ { /* .iaddr = 0x0014 */ .wdata = 0xF003}, -+ { /* .iaddr = 0x0015 */ .wdata = 0xE21C}, -+ { /* .iaddr = 0x0016 */ .wdata = 0xEEC1}, -+ { /* .iaddr = 0x0017 */ .wdata = 0x0D87}, -+ { /* .iaddr = 0x0018 */ .wdata = 0xEEC1}, -+ { /* .iaddr = 0x0019 */ .wdata = 0xE806}, -+ { /* .iaddr = 0x001A */ .wdata = 0xC3C5}, -+ { /* .iaddr = 0x001B */ .wdata = 0xD306}, -+ { /* .iaddr = 0x001C */ .wdata = 0xEEDF}, -+ { /* .iaddr = 0x001D */ .wdata = 0xE806}, -+ { /* .iaddr = 0x001E */ .wdata = 0xC3C6}, -+ { /* .iaddr = 0x001F */ .wdata = 0xD306}, -+ { /* .iaddr = 0x0020 */ .wdata = 0xF002}, -+ { /* .iaddr = 0x0021 */ .wdata = 0xC3C8}, -+ { /* .iaddr = 0x0022 */ .wdata = 0x409A}, -+ { /* .iaddr = 0x0023 */ .wdata = 0xF021}, -+ { /* .iaddr = 0x0024 */ .wdata = 0xEEE0}, -+ { /* .iaddr = 0x0025 */ .wdata = 0xEEC0}, -+ { /* .iaddr = 0x0026 */ .wdata = 0xD70D}, -+ { /* .iaddr = 0x0027 */ .wdata = 0xC305}, -+ { /* .iaddr = 0x0028 */ .wdata = 0xD328}, -+ { /* .iaddr = 0x0029 */ .wdata = 0xC300}, -+ { /* .iaddr = 0x002A */ .wdata = 0xD314}, -+ { /* .iaddr = 0x002B */ .wdata = 0xC301}, -+ { /* .iaddr = 0x002C */ .wdata = 0xD318}, -+ { /* .iaddr = 0x002D */ .wdata = 0xC303}, -+ { /* .iaddr = 0x002E */ .wdata = 0xD320}, -+ { /* .iaddr = 0x002F */ .wdata = 0xC302}, -+ { /* .iaddr = 0x0030 */ .wdata = 0xD31C}, -+ { /* .iaddr = 0x0031 */ .wdata = 0xC304}, -+ { /* .iaddr = 0x0032 */ .wdata = 0xD324}, -+ { /* .iaddr = 0x0033 */ .wdata = 0xC358}, -+ { /* .iaddr = 0x0034 */ .wdata = 0xD330}, -+ { /* .iaddr = 0x0035 */ .wdata = 0xC307}, -+ { /* .iaddr = 0x0036 */ .wdata = 0xD115}, -+ { /* .iaddr = 0x0037 */ .wdata = 0xF021}, -+ { /* .iaddr = 0x0038 */ .wdata = 0xD70D}, -+ { /* .iaddr = 0x0039 */ .wdata = 0xC305}, -+ { /* .iaddr = 0x003A */ .wdata = 0xD328}, -+ { /* .iaddr = 0x003B */ .wdata = 0xC300}, -+ { /* .iaddr = 0x003C */ .wdata = 0xD314}, -+ { /* .iaddr = 0x003D */ .wdata = 0xC301}, -+ { /* .iaddr = 0x003E */ .wdata = 0xD318}, -+ { /* .iaddr = 0x003F */ .wdata = 0xC303}, -+ { /* .iaddr = 0x0040 */ .wdata = 0xD320}, -+ { /* .iaddr = 0x0041 */ .wdata = 0xC302}, -+ { /* .iaddr = 0x0042 */ .wdata = 0xD31C}, -+ { /* .iaddr = 0x0043 */ .wdata = 0xC304}, -+ { /* .iaddr = 0x0044 */ .wdata = 0xD324}, -+ { /* .iaddr = 0x0045 */ .wdata = 0xC358}, -+ { /* .iaddr = 0x0046 */ .wdata = 0xD330}, -+ { /* .iaddr = 0x0047 */ .wdata = 0xC307}, -+ { /* .iaddr = 0x0048 */ .wdata = 0xD115}, -+ { /* .iaddr = 0x0049 */ .wdata = 0xF021}, -+ { /* .iaddr = 0x004A */ .wdata = 0xC70D}, -+ { /* .iaddr = 0x004B */ .wdata = 0xD70F}, -+ { /* .iaddr = 0x004C */ .wdata = 0xC328}, -+ { /* .iaddr = 0x004D */ .wdata = 0xD305}, -+ { /* .iaddr = 0x004E */ .wdata = 0xC314}, -+ { /* .iaddr = 0x004F */ .wdata = 0xD300}, -+ { /* .iaddr = 0x0050 */ .wdata = 0xC318}, -+ { /* .iaddr = 0x0051 */ .wdata = 0xD301}, -+ { /* .iaddr = 0x0052 */ .wdata = 0xC320}, -+ { /* .iaddr = 0x0053 */ .wdata = 0xD303}, -+ { /* .iaddr = 0x0054 */ .wdata = 0xC31C}, -+ { /* .iaddr = 0x0055 */ .wdata = 0xD302}, -+ { /* .iaddr = 0x0056 */ .wdata = 0xC324}, -+ { /* .iaddr = 0x0057 */ .wdata = 0xD304}, -+ { /* .iaddr = 0x0058 */ .wdata = 0xC330}, -+ { /* .iaddr = 0x0059 */ .wdata = 0xD358}, -+ { /* .iaddr = 0x005A */ .wdata = 0xC115}, -+ { /* .iaddr = 0x005B */ .wdata = 0xD307}, -+ { /* .iaddr = 0x005C */ .wdata = 0xF021}, -+ { /* .iaddr = 0x005D */ .wdata = 0x0249}, -+ { /* .iaddr = 0x005E */ .wdata = 0x0362}, -+ { /* .iaddr = 0x005F */ .wdata = 0x023D}, -+ { /* .iaddr = 0x0060 */ .wdata = 0xEEC1}, -+ { /* .iaddr = 0x0061 */ .wdata = 0x0369}, -+ { /* .iaddr = 0x0062 */ .wdata = 0xEEC1}, -+ { /* .iaddr = 0x0063 */ .wdata = 0x0CEA}, -+ { /* .iaddr = 0x0064 */ .wdata = 0xEEC2}, -+ { /* .iaddr = 0x0065 */ .wdata = 0xD701}, -+ { /* .iaddr = 0x0066 */ .wdata = 0x02C8}, -+ { /* .iaddr = 0x0067 */ .wdata = 0xC3C3}, -+ { /* .iaddr = 0x0068 */ .wdata = 0xD306}, -+ { /* .iaddr = 0x0069 */ .wdata = 0xC3C8}, -+ { /* .iaddr = 0x006A */ .wdata = 0x009A}, -+ { /* .iaddr = 0x006B */ .wdata = 0xC3D1}, -+ { /* .iaddr = 0x006C */ .wdata = 0xD309}, -+ { /* .iaddr = 0x006D */ .wdata = 0x0C46}, -+ { /* .iaddr = 0x006E */ .wdata = 0x0DE7}, -+ { /* .iaddr = 0x006F */ .wdata = 0xEEC0}, -+ { /* .iaddr = 0x0070 */ .wdata = 0xC3D9}, -+ { /* .iaddr = 0x0071 */ .wdata = 0x0DDE}, -+ { /* .iaddr = 0x0072 */ .wdata = 0x02D7}, -+ { /* .iaddr = 0x0073 */ .wdata = 0xF021}, -+ { /* .iaddr = 0x0074 */ .wdata = 0x1441}, -+ { /* .iaddr = 0x0075 */ .wdata = 0xF003}, -+ { /* .iaddr = 0x0076 */ .wdata = 0xC03F}, -+ { /* .iaddr = 0x0077 */ .wdata = 0xF704}, -+ { /* .iaddr = 0x0078 */ .wdata = 0xF009}, -+ { /* .iaddr = 0x0079 */ .wdata = 0xE21A}, -+ { /* .iaddr = 0x007A */ .wdata = 0xF002}, -+ { /* .iaddr = 0x007B */ .wdata = 0x0C52}, -+ { /* .iaddr = 0x007C */ .wdata = 0xE206}, -+ { /* .iaddr = 0x007D */ .wdata = 0xEEC1}, -+ { /* .iaddr = 0x007E */ .wdata = 0xD01A}, -+ { /* .iaddr = 0x007F */ .wdata = 0x3C5D}, -+ { /* .iaddr = 0x0080 */ .wdata = 0xEEC0}, -+ { /* .iaddr = 0x0081 */ .wdata = 0xD01A}, -+ { /* .iaddr = 0x0082 */ .wdata = 0x0E12}, -+ { /* .iaddr = 0x0083 */ .wdata = 0xEEC0}, -+ { /* .iaddr = 0x0084 */ .wdata = 0x13E1}, -+ { /* .iaddr = 0x0085 */ .wdata = 0x1441}, -+ { /* .iaddr = 0x0086 */ .wdata = 0xEEC1}, -+ { /* .iaddr = 0x0087 */ .wdata = 0xD70E}, -+ { /* .iaddr = 0x0088 */ .wdata = 0xD70F}, -+ { /* .iaddr = 0x0089 */ .wdata = 0xEEC0}, -+ { /* .iaddr = 0x008A */ .wdata = 0xD70E}, -+ { /* .iaddr = 0x008B */ .wdata = 0xC458}, -+ { /* .iaddr = 0x008C */ .wdata = 0x13BE}, -+ { /* .iaddr = 0x008D */ .wdata = 0xEEC0}, -+ { /* .iaddr = 0x008E */ .wdata = 0xF29B}, -+ { /* .iaddr = 0x008F */ .wdata = 0xE20A}, -+ { /* .iaddr = 0x0090 */ .wdata = 0xEEC1}, -+ { /* .iaddr = 0x0091 */ .wdata = 0xD01D}, -+ { /* .iaddr = 0x0092 */ .wdata = 0xEEC1}, -+ { /* .iaddr = 0x0093 */ .wdata = 0xD3FD}, -+ { /* .iaddr = 0x0094 */ .wdata = 0xF021} -+}; -+ -+#define MLXBF_GIGE_UPHY_DLM_IMEM_DATA_NUM_ENTRIES \ -+ (sizeof(mlxbf_gige_dlm_imem_data) / sizeof(struct mlxbf_gige_uphy_cfg_reg)) -+ -+static const struct mlxbf_gige_uphy_cfg_reg -+mlxbf_gige_dlm_seq_imem_csum_en = { -+ .addr = 0x39A, .wdata = 0x0004 -+}; -+ -+static const struct mlxbf_gige_uphy_cfg_reg -+mlxbf_gige_dlm_seq_imem_csum_dis = { -+ .addr = 0x39A, .wdata = 0x0000 -+}; -+ -+static const struct mlxbf_gige_uphy_cfg_reg -+mlxbf_gige_dlm_seq_imem_bmap_clr[] = { -+ {.addr = 0x39E, .wdata = 0x0000}, -+ {.addr = 0x39F, .wdata = 0x0000}, -+ {.addr = 0x3A0, .wdata = 0x0000}, -+ {.addr = 0x3A1, .wdata = 0x0000}, -+ {.addr = 0x3A2, .wdata = 0x0000}, -+ {.addr = 0x3A3, .wdata = 0x0000}, -+ {.addr = 0x3A4, .wdata = 0x0000}, -+ {.addr = 0x3A5, .wdata = 0x0000}, -+ {.addr = 0x3A6, .wdata = 0x0000}, -+ {.addr = 0x3A7, .wdata = 0x0000}, -+ {.addr = 0x3A8, .wdata = 0x0000}, -+ {.addr = 0x3A9, .wdata = 0x0000}, -+ {.addr = 0x3AA, .wdata = 0x0000}, -+ {.addr = 0x3AB, .wdata = 0x0000}, -+ {.addr = 0x3AC, .wdata = 0x0000}, -+ {.addr = 0x3AD, .wdata = 0x0000}, -+ {.addr = 0x3AE, .wdata = 0x0000}, -+ {.addr = 0x3AF, .wdata = 0x0000}, -+ {.addr = 0x3B0, .wdata = 0x0000}, -+ {.addr = 0x3B1, .wdata = 0x0000}, -+ {.addr = 0x3B2, .wdata = 0x0000}, -+ {.addr = 0x3B3, .wdata = 0x0000}, -+ {.addr = 0x3B4, .wdata = 0x0000}, -+ {.addr = 0x3B5, .wdata = 0x0000}, -+ {.addr = 0x3B6, .wdata = 0x0000}, -+ {.addr = 0x3B7, .wdata = 0x0000}, -+ {.addr = 0x3B8, .wdata = 0x0000}, -+ {.addr = 0x3B9, .wdata = 0x0000}, -+ {.addr = 0x3BA, .wdata = 0x0000}, -+ {.addr = 0x3BB, .wdata = 0x0000}, -+ {.addr = 0x3BC, .wdata = 0x0000}, -+ {.addr = 0x3BD, .wdata = 0x0000} -+}; -+ -+#define MLXBF_GIGE_DLM_SEQ_IMEM_BMAP_CLR_NUM_ENTRIES \ -+ (sizeof(mlxbf_gige_dlm_seq_imem_bmap_clr) / sizeof(struct mlxbf_gige_uphy_cfg_reg)) -+ -+static const struct mlxbf_gige_uphy_cfg_reg -+mlxbf_gige_dlm_tx_init[] = { -+ {.addr = 0x002, .wdata = 0x5125}, -+ {.addr = 0x01C, .wdata = 0x0018}, -+ {.addr = 0x01E, .wdata = 0x0E00}, -+ {.addr = 0x01F, .wdata = 0xC200}, -+ {.addr = 0x023, .wdata = 0x0277}, -+ {.addr = 0x024, .wdata = 0x026B}, -+ {.addr = 0x053, .wdata = 0x0700}, -+ {.addr = 0x059, .wdata = 0x1011}, -+ {.addr = 0x060, .wdata = 0x0000}, -+ {.addr = 0x062, .wdata = 0x0135}, -+ {.addr = 0x063, .wdata = 0x0443}, -+ {.addr = 0x064, .wdata = 0x0000}, -+ {.addr = 0x066, .wdata = 0x0061}, -+ {.addr = 0x067, .wdata = 0x0042}, -+ {.addr = 0x06A, .wdata = 0x1212}, -+ {.addr = 0x06B, .wdata = 0x1515}, -+ {.addr = 0x06C, .wdata = 0x011A}, -+ {.addr = 0x06D, .wdata = 0x0132}, -+ {.addr = 0x06E, .wdata = 0x0632}, -+ {.addr = 0x06F, .wdata = 0x0643}, -+ {.addr = 0x070, .wdata = 0x0233}, -+ {.addr = 0x071, .wdata = 0x0433}, -+ {.addr = 0x07E, .wdata = 0x6A08}, -+ {.addr = 0x08D, .wdata = 0x2101}, -+ {.addr = 0x093, .wdata = 0x0015}, -+ {.addr = 0x096, .wdata = 0x7555}, -+ {.addr = 0x0A9, .wdata = 0xE754}, -+ {.addr = 0x0AA, .wdata = 0x7ED1}, -+ {.addr = 0x3FF, .wdata = 0x0000}, -+ {.addr = 0x3FF, .wdata = 0x0000}, -+ {.addr = 0x3FF, .wdata = 0x0000}, -+ {.addr = 0x3FF, .wdata = 0x0000}, -+ {.addr = 0x3FF, .wdata = 0x0000}, -+ {.addr = 0x3FF, .wdata = 0x0000}, -+ {.addr = 0x3FF, .wdata = 0x0000}, -+ {.addr = 0x3FF, .wdata = 0x0000}, -+ {.addr = 0x3FF, .wdata = 0x0000}, -+ {.addr = 0x3FF, .wdata = 0x0000}, -+ {.addr = 0x3FF, .wdata = 0x0000}, -+ {.addr = 0x3FF, .wdata = 0x0000} -+}; -+ -+#define MLXBF_GIGE_DLM_TX_NUM_ENTRIES \ -+ (sizeof(mlxbf_gige_dlm_tx_init) / sizeof(struct mlxbf_gige_uphy_cfg_reg)) -+ -+static const struct mlxbf_gige_uphy_cfg_reg -+mlxbf_gige_dlm_rx_init[] = { -+ {.addr = 0x003, .wdata = 0x5125}, -+ {.addr = 0x01D, .wdata = 0x0004}, -+ {.addr = 0x028, .wdata = 0x1000}, -+ {.addr = 0x029, .wdata = 0x1001}, -+ {.addr = 0x02E, .wdata = 0x0004}, -+ {.addr = 0x053, .wdata = 0x0700}, -+ {.addr = 0x057, .wdata = 0x5044}, -+ {.addr = 0x05B, .wdata = 0x1011}, -+ {.addr = 0x0D2, .wdata = 0x0002}, -+ {.addr = 0x0D9, .wdata = 0x0000}, -+ {.addr = 0x0DA, .wdata = 0x0000}, -+ {.addr = 0x0DB, .wdata = 0x0000}, -+ {.addr = 0x0E2, .wdata = 0x0000}, -+ {.addr = 0x0E7, .wdata = 0xBB10}, -+ {.addr = 0x0E8, .wdata = 0xBB10}, -+ {.addr = 0x0EC, .wdata = 0x0111}, -+ {.addr = 0x0ED, .wdata = 0x1C00}, -+ {.addr = 0x0F5, .wdata = 0x0000}, -+ {.addr = 0x102, .wdata = 0x0CA6}, -+ {.addr = 0x107, .wdata = 0x0020}, -+ {.addr = 0x10C, .wdata = 0x1E31}, -+ {.addr = 0x10D, .wdata = 0x1D29}, -+ {.addr = 0x111, .wdata = 0x00E7}, -+ {.addr = 0x112, .wdata = 0x5202}, -+ {.addr = 0x117, .wdata = 0x0493}, -+ {.addr = 0x11B, .wdata = 0x0148}, -+ {.addr = 0x120, .wdata = 0x23DE}, -+ {.addr = 0x121, .wdata = 0x2294}, -+ {.addr = 0x125, .wdata = 0x03FF}, -+ {.addr = 0x126, .wdata = 0x25F0}, -+ {.addr = 0x12B, .wdata = 0xC633}, -+ {.addr = 0x136, .wdata = 0x0F6A}, -+ {.addr = 0x143, .wdata = 0x0000}, -+ {.addr = 0x148, .wdata = 0x0001}, -+ {.addr = 0x14E, .wdata = 0x0000}, -+ {.addr = 0x155, .wdata = 0x2003}, -+ {.addr = 0x15C, .wdata = 0x099B}, -+ {.addr = 0x161, .wdata = 0x0088}, -+ {.addr = 0x16B, .wdata = 0x0433}, -+ {.addr = 0x172, .wdata = 0x099B}, -+ {.addr = 0x17C, .wdata = 0x045D}, -+ {.addr = 0x17D, .wdata = 0x006A}, -+ {.addr = 0x181, .wdata = 0x0000}, -+ {.addr = 0x189, .wdata = 0x1590}, -+ {.addr = 0x18E, .wdata = 0x0080}, -+ {.addr = 0x18F, .wdata = 0x90EC}, -+ {.addr = 0x191, .wdata = 0x79F8}, -+ {.addr = 0x194, .wdata = 0x000A}, -+ {.addr = 0x195, .wdata = 0x000A}, -+ {.addr = 0x1EB, .wdata = 0x0133}, -+ {.addr = 0x1F0, .wdata = 0x0030}, -+ {.addr = 0x1F1, .wdata = 0x0030}, -+ {.addr = 0x1F5, .wdata = 0x3737}, -+ {.addr = 0x1F6, .wdata = 0x3737}, -+ {.addr = 0x1FA, .wdata = 0x2C00}, -+ {.addr = 0x1FF, .wdata = 0x0516}, -+ {.addr = 0x200, .wdata = 0x0516}, -+ {.addr = 0x204, .wdata = 0x3010}, -+ {.addr = 0x209, .wdata = 0x0429}, -+ {.addr = 0x20E, .wdata = 0x0010}, -+ {.addr = 0x213, .wdata = 0x005A}, -+ {.addr = 0x214, .wdata = 0x0000}, -+ {.addr = 0x216, .wdata = 0x0000}, -+ {.addr = 0x218, .wdata = 0x0000}, -+ {.addr = 0x225, .wdata = 0x0000}, -+ {.addr = 0x22A, .wdata = 0x0000}, -+ {.addr = 0x22B, .wdata = 0x0000}, -+ {.addr = 0x231, .wdata = 0x0000}, -+ {.addr = 0x232, .wdata = 0x0000}, -+ {.addr = 0x233, .wdata = 0x0000}, -+ {.addr = 0x245, .wdata = 0x0300}, -+ {.addr = 0x24A, .wdata = 0x0000}, -+ {.addr = 0x24F, .wdata = 0xFFF3}, -+ {.addr = 0x254, .wdata = 0x0000}, -+ {.addr = 0x259, .wdata = 0x0000}, -+ {.addr = 0x25E, .wdata = 0x0000}, -+ {.addr = 0x265, .wdata = 0x0009}, -+ {.addr = 0x267, .wdata = 0x0174}, -+ {.addr = 0x271, .wdata = 0x01F0}, -+ {.addr = 0x273, .wdata = 0x0170}, -+ {.addr = 0x275, .wdata = 0x7828}, -+ {.addr = 0x279, .wdata = 0x3E3A}, -+ {.addr = 0x27D, .wdata = 0x8468}, -+ {.addr = 0x283, .wdata = 0x000C}, -+ {.addr = 0x285, .wdata = 0x7777}, -+ {.addr = 0x288, .wdata = 0x5503}, -+ {.addr = 0x28C, .wdata = 0x0030}, -+ {.addr = 0x28E, .wdata = 0xBBBB}, -+ {.addr = 0x290, .wdata = 0xBBBB}, -+ {.addr = 0x293, .wdata = 0x0021}, -+ {.addr = 0x2FA, .wdata = 0x3B40}, -+ {.addr = 0x2FB, .wdata = 0x7777}, -+ {.addr = 0x30A, .wdata = 0x8022}, -+ {.addr = 0x319, .wdata = 0x205E}, -+ {.addr = 0x31B, .wdata = 0x0000}, -+ {.addr = 0x31D, .wdata = 0x6004}, -+ {.addr = 0x320, .wdata = 0x3014}, -+ {.addr = 0x322, .wdata = 0x6004}, -+ {.addr = 0x326, .wdata = 0x6004}, -+ {.addr = 0x32A, .wdata = 0x5000}, -+ {.addr = 0x32E, .wdata = 0x5000}, -+ {.addr = 0x332, .wdata = 0x6004}, -+ {.addr = 0x336, .wdata = 0x6063}, -+ {.addr = 0x389, .wdata = 0x0310}, -+ {.addr = 0x3FF, .wdata = 0x0000}, -+ {.addr = 0x3FF, .wdata = 0x0000}, -+ {.addr = 0x3FF, .wdata = 0x0000}, -+ {.addr = 0x3FF, .wdata = 0x0000}, -+ {.addr = 0x3FF, .wdata = 0x0000}, -+ {.addr = 0x3FF, .wdata = 0x0000}, -+ {.addr = 0x3FF, .wdata = 0x0000}, -+ {.addr = 0x3FF, .wdata = 0x0000}, -+ {.addr = 0x3FF, .wdata = 0x0000}, -+ {.addr = 0x3FF, .wdata = 0x0000}, -+ {.addr = 0x3FF, .wdata = 0x0000}, -+ {.addr = 0x3FF, .wdata = 0x0000}, -+ {.addr = 0x3FF, .wdata = 0x0000}, -+ {.addr = 0x3FF, .wdata = 0x0000}, -+ {.addr = 0x3FF, .wdata = 0x0000}, -+ {.addr = 0x3FF, .wdata = 0x0000} -+}; -+ -+#define MLXBF_GIGE_DLM_RX_NUM_ENTRIES \ -+ (sizeof(mlxbf_gige_dlm_rx_init) / sizeof(struct mlxbf_gige_uphy_cfg_reg)) -+ -+/* returns plu clock p1clk in Hz */ -+static u64 mlxbf_gige_calculate_p1clk(struct mlxbf_gige *priv) -+{ -+ u8 core_od, core_r; -+ u64 freq_output; -+ u32 reg1, reg2; -+ u32 core_f; -+ -+ reg1 = readl(priv->clk_io + MLXBF_GIGE_P1CLK_REG1); -+ reg2 = readl(priv->clk_io + MLXBF_GIGE_P1CLK_REG2); -+ -+ core_f = (reg1 & MLXBF_GIGE_P1_CORE_F_MASK) >> -+ MLXBF_GIGE_P1_CORE_F_SHIFT; -+ core_r = (reg1 & MLXBF_GIGE_P1_CORE_R_MASK) >> -+ MLXBF_GIGE_P1_CORE_R_SHIFT; -+ core_od = (reg2 & MLXBF_GIGE_P1_CORE_OD_MASK) >> -+ MLXBF_GIGE_P1_CORE_OD_SHIFT; -+ -+ /* Compute PLL output frequency as follow: -+ * -+ * CORE_F / 16384 -+ * freq_output = freq_reference * ---------------------------- -+ * (CORE_R + 1) * (CORE_OD + 1) -+ */ -+ freq_output = div_u64(MLXBF_GIGE_P1_FREQ_REFERENCE * core_f, -+ MLXBF_GIGE_P1_CLK_CONST); -+ freq_output = div_u64(freq_output, (core_r + 1) * (core_od + 1)); -+ -+ return freq_output; -+} -+ -+static void mlxbf_gige_ugl_static_config(struct mlxbf_gige *priv) -+{ -+ u32 val, p1clk_mhz; -+ u32 const_factor; -+ u64 p1clk; -+ -+ /* p1clk is the PLU clock in Hz */ -+ p1clk = mlxbf_gige_calculate_p1clk(priv); -+ -+ /* get p1clk in MHz */ -+ p1clk_mhz = div_u64(p1clk, 1000000); -+ -+ /* Multiply the p1clk clock by 12 according to HW requirements */ -+ const_factor = p1clk_mhz * MLXBF_GIGE_P1CLK_MULT_FACTOR; -+ -+ /* ugl_cr_bridge_desc */ -+ val = readl(priv->plu_base + MLXBF_GIGE_UGL_CR_BRIDGE_DESC); -+ val &= ~MLXBF_GIGE_UGL_CR_BRIDGE_ALL_MASK; -+ val |= FIELD_PREP(MLXBF_GIGE_UGL_CR_BRIDGE_SETUP_MASK, -+ MLXBF_GIGE_UGL_CR_BRIDGE_SETUP_VAL(const_factor)); -+ val |= FIELD_PREP(MLXBF_GIGE_UGL_CR_BRIDGE_PULSE_MASK, -+ MLXBF_GIGE_UGL_CR_BRIDGE_PULSE_VAL(const_factor)); -+ val |= FIELD_PREP(MLXBF_GIGE_UGL_CR_BRIDGE_HOLD_MASK, -+ MLXBF_GIGE_UGL_CR_BRIDGE_HOLD_VAL(const_factor)); -+ writel(val, priv->plu_base + MLXBF_GIGE_UGL_CR_BRIDGE_DESC); -+ -+ /* pll1x_fsm_counters */ -+ val = MLXBF_GIGE_PLL1X_FSM_DEFAULT_VAL(const_factor); -+ writel(val, priv->plu_base + MLXBF_GIGE_PLL1X_FSM_DEFAULT_CYCLES); -+ -+ val = MLXBF_GIGE_PLL1X_FSM_SLEEP_VAL(const_factor); -+ writel(val, priv->plu_base + MLXBF_GIGE_PLL1X_FSM_SLEEP_CYCLES); -+ -+ val = MLXBF_GIGE_PLL1X_FSM_RCAL_FLOW_VAL(const_factor); -+ writel(val, priv->plu_base + MLXBF_GIGE_PLL1X_FSM_RCAL_FLOW_CYCLES); -+ -+ val = MLXBF_GIGE_PLL1X_FSM_CAL_FLOW_VAL(const_factor); -+ writel(val, priv->plu_base + MLXBF_GIGE_PLL1X_FSM_CAL_FLOW_CYCLES); -+ -+ val = readl(priv->plu_base + MLXBF_GIGE_PLL1X_FSM_LOCKDET_STS_CYCLES); -+ val &= ~MLXBF_GIGE_PLL1X_FSM_LOCKDET_STS_MASK; -+ val |= FIELD_PREP(MLXBF_GIGE_PLL1X_FSM_LOCKDET_STS_MASK, -+ MLXBF_GIGE_PLL1X_FSM_LOCKDET_STS_VAL(const_factor)); -+ writel(val, priv->plu_base + MLXBF_GIGE_PLL1X_FSM_LOCKDET_STS_CYCLES); -+ -+ /* tx_fsm_counters */ -+ val = MLXBF_GIGE_TX_FSM_DEFAULT_VAL(const_factor); -+ writel(val, priv->plu_base + MLXBF_GIGE_TX_FSM_DEFAULT_CYCLES); -+ -+ val = MLXBF_GIGE_TX_FSM_SLEEP_VAL(const_factor); -+ writel(val, priv->plu_base + MLXBF_GIGE_TX_FSM_SLEEP_CYCLES); -+ -+ val = MLXBF_GIGE_TX_FSM_POWERUP_VAL(const_factor); -+ writel(val, priv->plu_base + MLXBF_GIGE_TX_FSM_POWERUP_CYCLES); -+ -+ val = MLXBF_GIGE_TX_FSM_CAL_FLOW_VAL(const_factor); -+ writel(val, priv->plu_base + MLXBF_GIGE_TX_FSM_CAL_FLOW_CYCLES); -+ -+ val = readl(priv->plu_base + MLXBF_GIGE_TX_FSM_CAL_ABORT_CYCLES); -+ val &= ~MLXBF_GIGE_TX_FSM_CAL_ABORT_MASK; -+ val |= FIELD_PREP(MLXBF_GIGE_TX_FSM_CAL_ABORT_MASK, -+ MLXBF_GIGE_TX_FSM_CAL_ABORT_VAL(const_factor)); -+ writel(val, priv->plu_base + MLXBF_GIGE_TX_FSM_CAL_ABORT_CYCLES); -+ -+ /* rx_fsm_counters */ -+ val = MLXBF_GIGE_RX_FSM_DEFAULT_VAL(const_factor); -+ writel(val, priv->plu_base + MLXBF_GIGE_RX_FSM_DEFAULT_CYCLES); -+ -+ val = MLXBF_GIGE_RX_FSM_SLEEP_VAL(const_factor); -+ writel(val, priv->plu_base + MLXBF_GIGE_RX_FSM_SLEEP_CYCLES); -+ -+ val = MLXBF_GIGE_RX_FSM_POWERUP_VAL(const_factor); -+ writel(val, priv->plu_base + MLXBF_GIGE_RX_FSM_POWERUP_CYCLES); -+ -+ val = MLXBF_GIGE_RX_FSM_TERM_VAL(const_factor); -+ writel(val, priv->plu_base + MLXBF_GIGE_RX_FSM_TERM_CYCLES); -+ -+ val = MLXBF_GIGE_RX_FSM_CAL_FLOW_VAL(const_factor); -+ writel(val, priv->plu_base + MLXBF_GIGE_RX_FSM_CAL_FLOW_CYCLES); -+ -+ val = MLXBF_GIGE_RX_FSM_CAL_ABORT_VAL(const_factor); -+ writel(val, priv->plu_base + MLXBF_GIGE_RX_FSM_CAL_ABORT_CYCLES); -+ -+ val = MLXBF_GIGE_RX_FSM_EQ_FLOW_VAL(const_factor); -+ writel(val, priv->plu_base + MLXBF_GIGE_RX_FSM_EQ_FLOW_CYCLES); -+ -+ val = MLXBF_GIGE_RX_FSM_EQ_ABORT_VAL(const_factor); -+ writel(val, priv->plu_base + MLXBF_GIGE_RX_FSM_EQ_ABORT_CYCLES); -+ -+ val = MLXBF_GIGE_RX_FSM_EOM_FLOW_VAL(const_factor); -+ writel(val, priv->plu_base + MLXBF_GIGE_RX_FSM_EOM_FLOW_CYCLES); -+ -+ val = readl(priv->plu_base + MLXBF_GIGE_RX_FSM_CDR_LOCK_CYCLES); -+ val &= ~MLXBF_GIGE_RX_FSM_CDR_LOCK_MASK; -+ val |= FIELD_PREP(MLXBF_GIGE_RX_FSM_CDR_LOCK_MASK, -+ MLXBF_GIGE_RX_FSM_CDR_LOCK_VAL(const_factor)); -+ writel(val, priv->plu_base + MLXBF_GIGE_RX_FSM_CDR_LOCK_CYCLES); -+ -+ /* periodic_flows_timer_max_value */ -+ val = readl(priv->plu_base + MLXBF_GIGE_PERIOD_FLOWS_TIMER_MAX); -+ val &= ~MLXBF_GIGE_PERIOD_FLOWS_TIMER_MAX_MASK; -+ val |= FIELD_PREP(MLXBF_GIGE_PERIOD_FLOWS_TIMER_MAX_MASK, -+ MLXBF_GIGE_PERIOD_FLOWS_TIMER_MAX_VAL(const_factor)); -+ writel(val, priv->plu_base + MLXBF_GIGE_PERIOD_FLOWS_TIMER_MAX); -+ -+ /* plltop.center.iddq_cycles */ -+ val = readl(priv->plu_base + MLXBF_GIGE_PLL_IDDQ_CYCLES); -+ val &= ~MLXBF_GIGE_PLL_IDDQ_CYCLES_MASK; -+ val |= FIELD_PREP(MLXBF_GIGE_PLL_IDDQ_CYCLES_MASK, -+ MLXBF_GIGE_PLL_IDDQ_CYCLES_VAL(const_factor)); -+ writel(val, priv->plu_base + MLXBF_GIGE_PLL_IDDQ_CYCLES); -+ -+ /* lanetop.center.iddq_cycles */ -+ val = readl(priv->plu_base + MLXBF_GIGE_LANE_IDDQ_CYCLES); -+ val &= ~MLXBF_GIGE_LANE_IDDQ_CYCLES_MASK; -+ val |= FIELD_PREP(MLXBF_GIGE_LANE_IDDQ_CYCLES_MASK, -+ MLXBF_GIGE_LANE_IDDQ_CYCLES_VAL(const_factor)); -+ writel(val, priv->plu_base + MLXBF_GIGE_LANE_IDDQ_CYCLES); -+ -+ /* lanetop.center.power_governor0 */ -+ val = FIELD_PREP(MLXBF_GIGE_LANE_PWR_GOV0_RISE_MASK, -+ MLXBF_GIGE_LANE_PWR_GOV0_RISE_VAL(const_factor)); -+ val |= FIELD_PREP(MLXBF_GIGE_LANE_PWR_GOV0_FALL_MASK, -+ MLXBF_GIGE_LANE_PWR_GOV0_FALL_VAL(const_factor)); -+ writel(val, priv->plu_base + MLXBF_GIGE_LANE_PWR_GOV0); -+} -+ -+static int mlxbf_gige_uphy_gw_write(struct mlxbf_gige *priv, u16 addr, -+ u16 data, bool is_pll) -+{ -+ u32 cmd, val; -+ int ret; -+ -+ cmd = MLXBF_GIGE_UPHY_GW_CREATE_CMD(addr, data, 0, is_pll); -+ -+ /* Send PLL or lane GW write request */ -+ writel(cmd, priv->plu_base + MLXBF_GIGE_UPHY_GW(is_pll)); -+ -+ /* If the poll times out, drop the request */ -+ ret = readl_poll_timeout_atomic(priv->plu_base + -+ MLXBF_GIGE_UPHY_GW(is_pll), -+ val, -+ !(val & MLXBF_GIGE_UPHY_GW_BUSY_MASK(is_pll)), -+ 5, 1000000); -+ if (ret) -+ dev_dbg(priv->dev, "Failed to send GW write request\n"); -+ -+ return ret; -+} -+ -+static int mlxbf_gige_uphy_gw_read(struct mlxbf_gige *priv, u16 addr, -+ bool is_pll) -+{ -+ u32 cmd, val; -+ int ret; -+ -+ cmd = MLXBF_GIGE_UPHY_GW_CREATE_CMD(addr, 0, 1, is_pll); -+ -+ /* Send PLL or lane GW read request */ -+ writel(cmd, priv->plu_base + MLXBF_GIGE_UPHY_GW(is_pll)); -+ -+ /* If the poll times out, drop the request */ -+ ret = readl_poll_timeout_atomic(priv->plu_base + -+ MLXBF_GIGE_UPHY_GW(is_pll), -+ val, -+ !(val & MLXBF_GIGE_UPHY_GW_BUSY_MASK(is_pll)), -+ 5, 1000000); -+ if (ret) { -+ dev_dbg(priv->dev, "Failed to send GW read request\n"); -+ return ret; -+ } -+ -+ val = readl(priv->plu_base + MLXBF_GIGE_UPHY_GW_DESC0(is_pll)); -+ val &= MLXBF_GIGE_UPHY_GW_DESC0_DATA_MASK(is_pll); -+ -+ return val; -+} -+ -+static int mlxbf_gige_load_uphy_clm_init_pkg(struct mlxbf_gige *priv) -+{ -+ int ret = 0; -+ int i; -+ -+ for (i = 0; i < MLXBF_GIGE_UPHY_CLM_INIT_NUM_ENTRIES; i++) { -+ ret = mlxbf_gige_uphy_gw_write(priv, -+ mlxbf_gige_clm_init[i].addr, -+ mlxbf_gige_clm_init[i].wdata, -+ true); -+ if (ret) { -+ dev_dbg(priv->dev, "Failed to load clm init pkg\n"); -+ return ret; -+ } -+ } -+ -+ return ret; -+} -+ -+static int mlxbf_gige_load_clm_production_fuses(struct mlxbf_gige *priv) -+{ -+ u8 bg_trim_room; -+ u8 cvb_trim_room; -+ u8 speedo_room; -+ int ret; -+ u32 val; -+ -+ val = readl(priv->fuse_gw_io); -+ bg_trim_room = (val & MLXBF_GIGE_YU_BG_TRIM_ROOM_MASK) >> -+ MLXBF_GIGE_YU_BG_TRIM_ROOM_SHIFT; -+ cvb_trim_room = (val & MLXBF_GIGE_YU_CVB_TRIM_ROOM_MASK) >> -+ MLXBF_GIGE_YU_CVB_TRIM_ROOM_SHIFT; -+ speedo_room = (val & MLXBF_GIGE_YU_SPEEDO_ROOM_MASK) >> -+ MLXBF_GIGE_YU_SPEEDO_ROOM_SHIFT; -+ -+ val = ((bg_trim_room >> MLXBF_GIGE_YU_FUSE_VALID_SHIFT) << -+ MLXBF_GIGE_PLL_MGMT_BGAP_FUSE_CTRL_BG_TRIM_VLD_SHIFT); -+ val |= ((cvb_trim_room >> MLXBF_GIGE_YU_FUSE_VALID_SHIFT) << -+ MLXBF_GIGE_PLL_MGMT_BGAP_FUSE_CTRL_CVB_TRIM_VLD_SHIFT); -+ val |= ((speedo_room >> MLXBF_GIGE_YU_FUSE_VALID_SHIFT) << -+ MLXBF_GIGE_PLL_MGMT_BGAP_FUSE_CTRL_SPEEDO_VLD_SHIFT); -+ val |= ((bg_trim_room & MLXBF_GIGE_YU_FUSE_MASK) << -+ MLXBF_GIGE_PLL_MGMT_BGAP_FUSE_CTRL_BG_TRIM_SHIFT); -+ val |= ((cvb_trim_room & MLXBF_GIGE_YU_FUSE_MASK) << -+ MLXBF_GIGE_PLL_MGMT_BGAP_FUSE_CTRL_CVB_TRIM_SHIFT); -+ val |= ((speedo_room & MLXBF_GIGE_YU_FUSE_MASK) << -+ MLXBF_GIGE_PLL_MGMT_BGAP_FUSE_CTRL_SPEEDO_SHIFT); -+ -+ ret = mlxbf_gige_uphy_gw_write(priv, MLXBF_GIGE_MGMT_BGAP_FUSE_CTRL_ADDR, val, true); -+ if (ret) -+ dev_dbg(priv->dev, "Failed to load clm production fuses\n"); -+ -+ return ret; -+} -+ -+static int mlxbf_gige_init_pll(struct mlxbf_gige *priv) -+{ -+ int ret; -+ -+ ret = mlxbf_gige_load_uphy_clm_init_pkg(priv); -+ if (ret) -+ return ret; -+ -+ ret = mlxbf_gige_load_clm_production_fuses(priv); -+ -+ return ret; -+} -+ -+static int mlxbf_gige_lock_pll(struct mlxbf_gige *priv) -+{ -+ int ret; -+ u32 val; -+ -+ /* plltop.center.uphy_pll_rst_reg_ */ -+ val = readl(priv->plu_base + MLXBF_GIGE_UPHY_PLL_RST_REG); -+ val |= MLXBF_GIGE_UPHY_PLL_RST_REG_MASK; -+ writel(val, priv->plu_base + MLXBF_GIGE_UPHY_PLL_RST_REG); -+ -+ /* cause_or.clrcause.bulk */ -+ val = readl(priv->plu_base + MLXBF_GIGE_PLL1X_CAUSE_CLRCAUSE_BULK); -+ val |= MLXBF_GIGE_PLL1X_CAUSE_CLRCAUSE_BULK_MASK; -+ writel(val, priv->plu_base + MLXBF_GIGE_PLL1X_CAUSE_CLRCAUSE_BULK); -+ -+ writel(0, priv->plu_base + MLXBF_GIGE_PLL_CAL); -+ -+ /* Stop polling when fsm state is UGL_PLL1X_FSM_STATE_SLEEP */ -+ ret = readl_poll_timeout_atomic(priv->plu_base + -+ MLXBF_GIGE_PLL_FSM_CTRL, -+ val, (val == MLXBF_GIGE_UGL_PLL1X_FSM_STATE_SLEEP), -+ 5, 1000000); -+ if (ret) { -+ dev_dbg(priv->dev, "Polling timeout on fsm state sleep\n"); -+ return ret; -+ } -+ -+ udelay(MLXBF_GIGE_PLL_STAB_TIME); -+ -+ val = readl(priv->plu_base + MLXBF_GIGE_PLL_SLEEP_FW); -+ val |= MLXBF_GIGE_PLL_SLEEP_FW_MASK; -+ writel(val, priv->plu_base + MLXBF_GIGE_PLL_SLEEP_FW); -+ -+ udelay(MLXBF_GIGE_PLL_STAB_TIME); -+ writel(MLXBF_GIGE_PLL_RCAL_MASK, priv->plu_base + MLXBF_GIGE_PLL_RCAL); -+ -+ /* Stop polling when fsm state is UGL_PLL1X_FSM_STATE_IDLE */ -+ ret = readl_poll_timeout_atomic(priv->plu_base + -+ MLXBF_GIGE_PLL_FSM_CTRL, -+ val, (val == MLXBF_GIGE_UGL_PLL1X_FSM_STATE_IDLE), -+ 5, 1000000); -+ if (ret) { -+ dev_dbg(priv->dev, "Polling timeout on fsm state idle\n"); -+ return ret; -+ } -+ -+ val = readl(priv->plu_base + MLXBF_GIGE_PLL_SLEEP_FW); -+ val &= ~MLXBF_GIGE_PLL_SLEEP_FW_MASK; -+ writel(val, priv->plu_base + MLXBF_GIGE_PLL_SLEEP_FW); -+ -+ writel(MLXBF_GIGE_PLL_CAL_MASK, priv->plu_base + MLXBF_GIGE_PLL_CAL); -+ -+ /* Stop polling when cal_valid is different from 0 */ -+ ret = readl_poll_timeout_atomic(priv->plu_base + MLXBF_GIGE_PLL_CAL_VLD, -+ val, !!(val & MLXBF_GIGE_PLL_CAL_VLD_MASK), -+ 5, 1000000); -+ if (ret) { -+ dev_dbg(priv->dev, "Polling timeout on cal_valid\n"); -+ return ret; -+ } -+ -+ /* pll_enable */ -+ val = readl(priv->plu_base + MLXBF_GIGE_PLL_ENABLE); -+ val |= MLXBF_GIGE_PLL_ENABLE_MASK; -+ writel(val, priv->plu_base + MLXBF_GIGE_PLL_ENABLE); -+ -+ return ret; -+} -+ -+static void mlxbf_gige_get_lane_out_of_rst(struct mlxbf_gige *priv) -+{ -+ u32 val; -+ -+ val = readl(priv->plu_base + MLXBF_GIGE_LANE_RST_REG); -+ val |= MLXBF_GIGE_LANE_RST_REG_MASK; -+ writel(val, priv->plu_base + MLXBF_GIGE_LANE_RST_REG); -+} -+ -+static int mlxbf_gige_load_imem(struct mlxbf_gige *priv) -+{ -+ u16 csum_status; -+ int ret = 0; -+ int i; -+ -+ for (i = 0; i < MLXBF_GIGE_UPHY_DLM_IMEM_INIT_NUM_ENTRIES; i++) { -+ ret = mlxbf_gige_uphy_gw_write(priv, -+ mlxbf_gige_dlm_imem_init[i].addr, -+ mlxbf_gige_dlm_imem_init[i].wdata, -+ false); -+ if (ret) -+ return ret; -+ } -+ -+ /* Resets the internal counter for MLXBF_GIGE_DLM_IMEM_DATA_ADDR to base address */ -+ ret = mlxbf_gige_uphy_gw_write(priv, -+ mlxbf_gige_dlm_seq_imem_wr_en_init.addr, -+ mlxbf_gige_dlm_seq_imem_wr_en_init.wdata, -+ false); -+ if (ret) -+ return ret; -+ -+ /* HW increments the address MLXBF_GIGE_DLM_IMEM_DATA_ADDR internally. */ -+ for (i = 0; i < MLXBF_GIGE_UPHY_DLM_IMEM_DATA_NUM_ENTRIES; i++) { -+ ret = mlxbf_gige_uphy_gw_write(priv, -+ MLXBF_GIGE_LANE_IMEM_DATA_ADDR, -+ mlxbf_gige_dlm_imem_data[i].wdata, -+ false); -+ if (ret) -+ return ret; -+ } -+ -+ ret = mlxbf_gige_uphy_gw_write(priv, -+ mlxbf_gige_dlm_seq_imem_wr_dis_init.addr, -+ mlxbf_gige_dlm_seq_imem_wr_dis_init.wdata, -+ false); -+ if (ret) -+ return ret; -+ -+ ret = mlxbf_gige_uphy_gw_write(priv, -+ mlxbf_gige_dlm_seq_imem_csum_en.addr, -+ mlxbf_gige_dlm_seq_imem_csum_en.wdata, -+ false); -+ if (ret) -+ return ret; -+ -+ udelay(MLXBF_GIGE_PLL_DLM_IMEM_CSUM_TIMEOUT); -+ -+ ret = mlxbf_gige_uphy_gw_read(priv, MLXBF_GIGE_LANE_CSUM_STS_ADDR, false); -+ if (ret < 0) -+ return ret; -+ -+ csum_status = ((ret & MLXBF_GIGE_IMEM_CSUM_STATUS_MASK) >> -+ MLXBF_GIGE_IMEM_CSUM_STATUS_SHIFT); -+ -+ ret = mlxbf_gige_uphy_gw_write(priv, -+ mlxbf_gige_dlm_seq_imem_csum_dis.addr, -+ mlxbf_gige_dlm_seq_imem_csum_dis.wdata, -+ false); -+ if (ret) -+ return ret; -+ -+ if (csum_status != MLXBF_GIGE_IMEM_CSUM_RUN_AND_VALID) { -+ dev_err(priv->dev, "%s: invalid checksum\n", __func__); -+ -+ /* recovery flow */ -+ for (i = 0; i < MLXBF_GIGE_DLM_SEQ_IMEM_BMAP_CLR_NUM_ENTRIES; i++) { -+ mlxbf_gige_uphy_gw_write(priv, -+ mlxbf_gige_dlm_seq_imem_bmap_clr[i].addr, -+ mlxbf_gige_dlm_seq_imem_bmap_clr[i].wdata, -+ false); -+ } -+ -+ return MLXBF_GIGE_INVALID_IMEM_CSUM; -+ } -+ -+ return ret; -+} -+ -+static int mlxbf_gige_plu_tx_power_ctrl(struct mlxbf_gige *priv, bool is_pwr_on) -+{ -+ int ret = 0; -+ u32 val; -+ -+ val = readl(priv->plu_base + MLXBF_GIGE_LANE_TX_RATE_ID0_SPEED); -+ val &= ~MLXBF_GIGE_LANE_TX_SLEEP_VAL_MASK; -+ writel(val, priv->plu_base + MLXBF_GIGE_LANE_TX_RATE_ID0_SPEED); -+ -+ if (is_pwr_on) { -+ val = readl(priv->plu_base + MLXBF_GIGE_LANE_TX_DATA_EN); -+ val &= ~MLXBF_GIGE_LANE_TX_IDDQ_VAL_MASK; -+ writel(val, priv->plu_base + MLXBF_GIGE_LANE_TX_DATA_EN); -+ -+ val = readl(priv->plu_base + MLXBF_GIGE_PLU_POWERUP); -+ val |= MLXBF_GIGE_PLU_TX_POWERUP_MASK; -+ writel(val, priv->plu_base + MLXBF_GIGE_PLU_POWERUP); -+ } else { -+ val = readl(priv->plu_base + MLXBF_GIGE_PLU_POWERUP); -+ val &= ~MLXBF_GIGE_PLU_TX_POWERUP_MASK; -+ writel(val, priv->plu_base + MLXBF_GIGE_PLU_POWERUP); -+ -+ val = readl(priv->plu_base + MLXBF_GIGE_LANE_TX_DATA_EN); -+ val |= MLXBF_GIGE_LANE_TX_IDDQ_VAL_MASK; -+ writel(val, priv->plu_base + MLXBF_GIGE_LANE_TX_DATA_EN); -+ -+ ret = readl_poll_timeout_atomic(priv->plu_base + -+ MLXBF_GIGE_LANE_TX_FSM_CTRL, val, -+ ((val & MLXBF_GIGE_LANE_TX_FSM_PS_MASK) == MLXBF_GIGE_TX_FSM_IDDQ), -+ 5, 1000000); -+ if (ret) -+ dev_dbg(priv->dev, "Polling timeout on tx fsm iddq state\n"); -+ } -+ -+ return ret; -+} -+ -+static int mlxbf_gige_dlm_tx_init_pkg(struct mlxbf_gige *priv) -+{ -+ int ret = 0; -+ int i; -+ -+ for (i = 0; i < MLXBF_GIGE_DLM_TX_NUM_ENTRIES; i++) { -+ ret = mlxbf_gige_uphy_gw_write(priv, -+ mlxbf_gige_dlm_tx_init[i].addr, -+ mlxbf_gige_dlm_tx_init[i].wdata, -+ false); -+ if (ret) { -+ dev_dbg(priv->dev, "Failed to load dlm tx init pkg\n"); -+ return ret; -+ } -+ } -+ -+ return ret; -+} -+ -+static int mlxbf_gige_tx_lane_open(struct mlxbf_gige *priv) -+{ -+ u32 val; -+ int ret; -+ -+ /* Prepare the TX lane before opening it */ -+ -+ ret = mlxbf_gige_plu_tx_power_ctrl(priv, false); -+ if (ret) -+ return ret; -+ -+ /* Calibration of TX elastic buffer */ -+ val = readl(priv->plu_base + MLXBF_GIGE_LANE_TX_BITS_SWAP); -+ val &= ~MLXBF_GIGE_TX_EB_BLOCK_PUSH_DIST_MASK_MASK; -+ val |= MLXBF_GIGE_TX_EB_BLOCK_PUSH_DIST_MASK_VAL; -+ writel(val, priv->plu_base + MLXBF_GIGE_LANE_TX_BITS_SWAP); -+ -+ val = readl(priv->plu_base + MLXBF_GIGE_LANE_TX_DATA_EN); -+ val |= MLXBF_GIGE_LANE_TX_DATA_EN_MASK; -+ writel(val, priv->plu_base + MLXBF_GIGE_LANE_TX_DATA_EN); -+ -+ writel(MLXBF_GIGE_LANE_TX_CAL_MASK, priv->plu_base + MLXBF_GIGE_LANE_TX_CAL); -+ -+ val = readl(priv->plu_base + MLXBF_GIGE_LANE_TX_DATA_EN); -+ val &= ~MLXBF_GIGE_LANE_TX_RATE_ID_MASK; -+ writel(val, priv->plu_base + MLXBF_GIGE_LANE_TX_DATA_EN); -+ -+ val = readl(priv->plu_base + MLXBF_GIGE_LANE_TX_RATE_ID0_SPEED); -+ val &= ~MLXBF_GIGE_LANE_TX_RATE_ID0_SPEED_MASK; -+ writel(val, priv->plu_base + MLXBF_GIGE_LANE_TX_RATE_ID0_SPEED); -+ -+ /* Loading the DLM tx init package should be done before lane power on */ -+ ret = mlxbf_gige_dlm_tx_init_pkg(priv); -+ if (ret) -+ return ret; -+ -+ val = readl(priv->plu_base + MLXBF_GIGE_LANE_TX_BITS_SWAP); -+ val &= ~MLXBF_GIGE_LANE_TX_BITS_SWAP_MASK; -+ writel(val, priv->plu_base + MLXBF_GIGE_LANE_TX_BITS_SWAP); -+ -+ ret = mlxbf_gige_plu_tx_power_ctrl(priv, true); -+ if (ret) -+ return ret; -+ -+ /* After preparing the TX lane, open it for data transmission */ -+ -+ val = readl(priv->plu_base + MLXBF_GIGE_LANE_TX_BITS_SWAP); -+ val &= ~MLXBF_GIGE_TX_EB_BLOCK_PUSH_DIST_MASK_MASK; -+ writel(val, priv->plu_base + MLXBF_GIGE_LANE_TX_BITS_SWAP); -+ -+ ret = readl_poll_timeout_atomic(priv->plu_base + -+ MLXBF_GIGE_LANE_TX_FSM_CTRL, val, -+ ((val & MLXBF_GIGE_LANE_TX_FSM_PS_MASK) == MLXBF_GIGE_TX_DATA_EN), -+ 5, 1000000); -+ if (ret) { -+ dev_dbg(priv->dev, "Polling timeout on fsm tx data enable state\n"); -+ return ret; -+ } -+ -+ val = readl(priv->plu_base + MLXBF_GIGE_LANE_TX_DATA_EN); -+ val |= MLXBF_GIGE_LANE_TX_PERIODIC_CAL_EN_MASK; -+ writel(val, priv->plu_base + MLXBF_GIGE_LANE_TX_DATA_EN); -+ -+ return ret; -+} -+ -+static int mlxbf_gige_dlm_rx_init_pkg(struct mlxbf_gige *priv) -+{ -+ int ret = 0; -+ int i; -+ -+ for (i = 0; i < MLXBF_GIGE_DLM_RX_NUM_ENTRIES; i++) { -+ ret = mlxbf_gige_uphy_gw_write(priv, -+ mlxbf_gige_dlm_rx_init[i].addr, -+ mlxbf_gige_dlm_rx_init[i].wdata, -+ false); -+ if (ret) { -+ dev_dbg(priv->dev, "Failed to load dlm rx init pkg\n"); -+ return ret; -+ } -+ } -+ -+ return ret; -+} -+ -+static int mlxbf_gige_plu_rx_power_ctrl(struct mlxbf_gige *priv, bool is_pwr_on) -+{ -+ int ret = 0; -+ u32 val; -+ -+ val = readl(priv->plu_base + MLXBF_GIGE_LANE_RX_RATE_ID); -+ val &= ~MLXBF_GIGE_LANE_RX_SLEEP_VAL_MASK; -+ writel(val, priv->plu_base + MLXBF_GIGE_LANE_RX_RATE_ID); -+ -+ if (is_pwr_on) { -+ val = readl(priv->plu_base + MLXBF_GIGE_LANE_RX_RATE_ID); -+ val &= ~MLXBF_GIGE_LANE_RX_IDDQ_VAL_MASK; -+ writel(val, priv->plu_base + MLXBF_GIGE_LANE_RX_RATE_ID); -+ -+ val = readl(priv->plu_base + MLXBF_GIGE_PLU_POWERUP); -+ val |= MLXBF_GIGE_PLU_RX_POWERUP_MASK; -+ writel(val, priv->plu_base + MLXBF_GIGE_PLU_POWERUP); -+ } else { -+ /* Enable HW watchdogs. */ -+ val = readl(priv->plu_base + MLXBF_GIGE_LANE_RX_EQ_DONE_TIMER_EN); -+ val |= MLXBF_GIGE_LANE_RX_EQ_DONE_TIMER_EN_MASK; -+ val |= MLXBF_GIGE_LANE_RX_CAL_DONE_TIMER_EN_MASK; -+ writel(val, priv->plu_base + MLXBF_GIGE_LANE_RX_EQ_DONE_TIMER_EN); -+ -+ val = readl(priv->plu_base + MLXBF_GIGE_PLU_POWERUP); -+ val &= ~MLXBF_GIGE_PLU_RX_POWERUP_MASK; -+ writel(val, priv->plu_base + MLXBF_GIGE_PLU_POWERUP); -+ -+ val = readl(priv->plu_base + MLXBF_GIGE_LANE_RX_RATE_ID); -+ val |= MLXBF_GIGE_LANE_RX_IDDQ_VAL_MASK; -+ writel(val, priv->plu_base + MLXBF_GIGE_LANE_RX_RATE_ID); -+ -+ ret = readl_poll_timeout_atomic(priv->plu_base + -+ MLXBF_GIGE_LANE_RX_FSM_CTRL, val, -+ ((val & MLXBF_GIGE_LANE_RX_FSM_PS_MASK) == MLXBF_GIGE_RX_FSM_IDDQ), -+ 5, 1000000); -+ if (ret) { -+ dev_dbg(priv->dev, "Polling timeout on rx fsm iddq state\n"); -+ return ret; -+ } -+ -+ val = readl(priv->plu_base + MLXBF_GIGE_LANE_RX_EQ_DONE_TIMER_EN); -+ val &= ~MLXBF_GIGE_LANE_RX_EQ_DONE_TIMER_EN_MASK; -+ val &= ~MLXBF_GIGE_LANE_RX_CAL_DONE_TIMER_EN_MASK; -+ writel(val, priv->plu_base + MLXBF_GIGE_LANE_RX_EQ_DONE_TIMER_EN); -+ } -+ -+ return ret; -+} -+ -+static int mlxbf_gige_rx_lane_open(struct mlxbf_gige *priv) -+{ -+ u32 val; -+ int ret; -+ -+ ret = mlxbf_gige_plu_rx_power_ctrl(priv, false); -+ if (ret) -+ return ret; -+ -+ val = readl(priv->plu_base + MLXBF_GIGE_LANE_RX_RATE_ID); -+ val &= ~MLXBF_GIGE_LANE_RX_RATE_ID_MASK; -+ writel(val, priv->plu_base + MLXBF_GIGE_LANE_RX_RATE_ID); -+ -+ val = readl(priv->plu_base + MLXBF_GIGE_LANE_RX_SYNC_FIFO_POP); -+ val &= ~MLXBF_GIGE_LANE_RX_SYNC_FIFO_POP_RDY_CHICKEN_MASK; -+ val &= ~MLXBF_GIGE_LANE_RX_DATA_SPLIT_LSB_VLD_CHICKEN_MASK; -+ writel(val, priv->plu_base + MLXBF_GIGE_LANE_RX_SYNC_FIFO_POP); -+ -+ val = readl(priv->plu_base + MLXBF_GIGE_LANE_RX_RATE_ID); -+ val &= ~MLXBF_GIGE_LANE_RX_RATE_ID0_SPEED_MASK; -+ writel(val, priv->plu_base + MLXBF_GIGE_LANE_RX_RATE_ID); -+ -+ ret = mlxbf_gige_dlm_rx_init_pkg(priv); -+ if (ret) -+ return ret; -+ -+ writel(MLXBF_GIGE_LANE_RX_CAL_MASK, priv->plu_base + MLXBF_GIGE_LANE_RX_CAL); -+ -+ val = readl(priv->plu_base + MLXBF_GIGE_LANE_RX_SYNC_FIFO_POP); -+ val &= ~MLXBF_GIGE_LANE_RX_CDR_RESET_REG_MASK; -+ val |= MLXBF_GIGE_LANE_RX_CDR_EN_MASK; -+ val |= MLXBF_GIGE_LANE_RX_DATA_EN_MASK; -+ writel(val, priv->plu_base + MLXBF_GIGE_LANE_RX_SYNC_FIFO_POP); -+ -+ val = readl(priv->plu_base + MLXBF_GIGE_LANE_RX_EQ_TRAIN); -+ val &= ~MLXBF_GIGE_LANE_RX_EQ_TRAIN_MASK; -+ val |= MLXBF_GIGE_LANE_RX_EQ_TRAIN_VAL; -+ writel(val, priv->plu_base + MLXBF_GIGE_LANE_RX_EQ_TRAIN); -+ -+ ret = mlxbf_gige_plu_rx_power_ctrl(priv, true); -+ if (ret) -+ return ret; -+ -+ ret = readl_poll_timeout_atomic(priv->plu_base + -+ MLXBF_GIGE_LANE_RX_FSM_CTRL, val, -+ ((val & MLXBF_GIGE_LANE_RX_FSM_PS_MASK) == MLXBF_GIGE_RX_FSM_ACTIVE), -+ 5, 1000000); -+ if (ret) -+ dev_dbg(priv->dev, "Polling timeout on rx fsm active state\n"); -+ -+ return ret; -+} -+ -+static bool mlxbf_gige_is_uphy_ready(struct mlxbf_gige *priv) -+{ -+ u32 val; -+ -+ val = readl(priv->plu_base + MLXBF_GIGE_LANE_TX_FSM_CTRL); -+ if ((val & MLXBF_GIGE_LANE_TX_FSM_PS_MASK) != MLXBF_GIGE_TX_DATA_EN) -+ return false; -+ -+ val = readl(priv->plu_base + MLXBF_GIGE_LANE_RX_FSM_CTRL); -+ if ((val & MLXBF_GIGE_LANE_RX_FSM_PS_MASK) != MLXBF_GIGE_RX_FSM_ACTIVE) -+ return false; -+ -+ return true; -+} -+ -+int mlxbf_gige_config_uphy(struct mlxbf_gige *priv) -+{ -+ struct platform_device *pdev = priv->pdev; -+ struct device *dev = &pdev->dev; -+ int ret = 0; -+ -+ priv->fuse_gw_io = devm_platform_ioremap_resource(pdev, MLXBF_GIGE_RES_FUSE_GW); -+ if (IS_ERR(priv->fuse_gw_io)) -+ return PTR_ERR(priv->fuse_gw_io); -+ -+ if (mlxbf_gige_is_uphy_ready(priv)) -+ return 0; -+ -+ mlxbf_gige_ugl_static_config(priv); -+ ret = mlxbf_gige_init_pll(priv); -+ if (ret) { -+ dev_err(dev, "%s: Failed to initialize PLL\n", __func__); -+ return ret; -+ } -+ -+ ret = mlxbf_gige_lock_pll(priv); -+ if (ret) { -+ dev_err(dev, "%s: Failed to lock PLL\n", __func__); -+ return ret; -+ } -+ -+ /* Due to hardware design issue, we need to get the lanes out of reset -+ * before configuring the imem. -+ */ -+ mlxbf_gige_get_lane_out_of_rst(priv); -+ ret = mlxbf_gige_load_imem(priv); -+ if (ret) { -+ dev_err(dev, "%s: Failed to load imem\n", __func__); -+ return ret; -+ } -+ -+ ret = mlxbf_gige_tx_lane_open(priv); -+ if (ret) { -+ dev_err(dev, "%s: Failed to open tx lane\n", __func__); -+ return ret; -+ } -+ -+ ret = mlxbf_gige_rx_lane_open(priv); -+ if (ret) -+ dev_err(dev, "%s: Failed to open rx lane\n", __func__); -+ -+ return ret; -+} -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_uphy.h b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_uphy.h -new file mode 100644 -index 000000000..a32be2407 ---- /dev/null -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_uphy.h -@@ -0,0 +1,398 @@ -+/* SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause */ -+ -+/* UPHY support for Mellanox Gigabit Ethernet driver -+ * -+ * Copyright (C) 2022 NVIDIA CORPORATION & AFFILIATES -+ */ -+ -+#ifndef __MLXBF_GIGE_UPHY_H__ -+#define __MLXBF_GIGE_UPHY_H__ -+ -+#include -+ -+/* Some registers' values depend on the p1clk clock. The following -+ * formula applies: -+ * ((time_in_ns*const_factor)/MLXBF_GIGE_TIME_FACTOR_TO_USEC) -+ */ -+#define MLXBF_GIGE_TIME_FACTOR_TO_USEC 10000 -+ -+/* All addresses represent the offset from the base PLU address */ -+ -+#define MLXBF_GIGE_PLU_POWERUP 0x488 -+#define MLXBF_GIGE_PLU_TX_POWERUP_MASK GENMASK(28, 28) -+#define MLXBF_GIGE_PLU_RX_POWERUP_MASK GENMASK(27, 27) -+ -+#define MLXBF_GIGE_LANE_CFG_FLAT0_BASE 0x23000 -+#define MLXBF_GIGE_AE_SYS_IMEM_RAM_DATA_CTRL_WDATA 0x23ef8 -+#define MLXBF_GIGE_AE_SYS_IMEM_RAM_STAT_IMEM_CSUM_STS 0x23f00 -+#define MLXBF_GIGE_IMEM_CSUM_STATUS_MASK GENMASK(6, 5) -+#define MLXBF_GIGE_IMEM_CSUM_STATUS_SHIFT 5 -+ -+#define MLXBF_GIGE_PLL_CFG_FLAT0_BASE 0x25000 -+#define MLXBF_GIGE_PLL_CFG_FLAT0_MGMT_BGAP_FUSE_CTRL 0x251d8 -+#define MLXBF_GIGE_PLL_MGMT_BGAP_FUSE_CTRL_BG_TRIM_SHIFT 0 -+#define MLXBF_GIGE_PLL_MGMT_BGAP_FUSE_CTRL_CVB_TRIM_SHIFT 4 -+#define MLXBF_GIGE_PLL_MGMT_BGAP_FUSE_CTRL_SPEEDO_SHIFT 8 -+#define MLXBF_GIGE_PLL_MGMT_BGAP_FUSE_CTRL_BG_TRIM_VLD_SHIFT 12 -+#define MLXBF_GIGE_PLL_MGMT_BGAP_FUSE_CTRL_CVB_TRIM_VLD_SHIFT 13 -+#define MLXBF_GIGE_PLL_MGMT_BGAP_FUSE_CTRL_SPEEDO_VLD_SHIFT 14 -+ -+#define MLXBF_GIGE_LANE_TX_FSM_CTRL 0x26000 -+#define MLXBF_GIGE_LANE_TX_FSM_PS_MASK GENMASK(3, 0) -+ -+#define MLXBF_GIGE_LANE_TX_BITS_SWAP 0x2600c -+#define MLXBF_GIGE_TX_EB_BLOCK_PUSH_DIST_MASK_MASK GENMASK(20, 16) -+#define MLXBF_GIGE_TX_EB_BLOCK_PUSH_DIST_MASK_VAL \ -+ FIELD_PREP(MLXBF_GIGE_TX_EB_BLOCK_PUSH_DIST_MASK_MASK, 0x3) -+#define MLXBF_GIGE_LANE_TX_BITS_SWAP_MASK GENMASK(0, 0) -+ -+#define MLXBF_GIGE_LANE_TX_DATA_EN 0x26010 -+#define MLXBF_GIGE_LANE_TX_RATE_ID_MASK GENMASK(30, 28) -+#define MLXBF_GIGE_LANE_TX_DATA_EN_MASK GENMASK(23, 23) -+#define MLXBF_GIGE_LANE_TX_IDDQ_VAL_MASK GENMASK(21, 21) -+#define MLXBF_GIGE_LANE_TX_PERIODIC_CAL_EN_MASK GENMASK(17, 17) -+ -+#define MLXBF_GIGE_LANE_TX_RATE_ID0_SPEED 0x26014 -+#define MLXBF_GIGE_LANE_TX_SLEEP_VAL_MASK GENMASK(9, 8) -+#define MLXBF_GIGE_LANE_TX_RATE_ID0_SPEED_MASK GENMASK(2, 0) -+ -+#define MLXBF_GIGE_LANE_TX_CAL 0x26018 -+#define MLXBF_GIGE_LANE_TX_CAL_MASK GENMASK(0, 0) -+ -+#define MLXBF_GIGE_LANE_RX_FSM_CTRL 0x26040 -+#define MLXBF_GIGE_LANE_RX_FSM_PS_MASK GENMASK(3, 0) -+ -+#define MLXBF_GIGE_LANE_RX_EQ_DONE_TIMER_EN 0x26054 -+#define MLXBF_GIGE_LANE_RX_EQ_DONE_TIMER_EN_MASK GENMASK(31, 31) -+#define MLXBF_GIGE_LANE_RX_CAL_DONE_TIMER_EN_MASK GENMASK(30, 30) -+ -+#define MLXBF_GIGE_LANE_RX_RATE_ID 0x26058 -+#define MLXBF_GIGE_LANE_RX_RATE_ID0_SPEED_MASK GENMASK(18, 16) -+#define MLXBF_GIGE_LANE_RX_RATE_ID_MASK GENMASK(14, 12) -+#define MLXBF_GIGE_LANE_RX_SLEEP_VAL_MASK GENMASK(7, 6) -+#define MLXBF_GIGE_LANE_RX_IDDQ_VAL_MASK GENMASK(4, 4) -+ -+#define MLXBF_GIGE_LANE_RX_CAL 0x2605c -+#define MLXBF_GIGE_LANE_RX_CAL_MASK GENMASK(0, 0) -+ -+#define MLXBF_GIGE_LANE_RX_SYNC_FIFO_POP 0x26060 -+#define MLXBF_GIGE_LANE_RX_DATA_SPLIT_LSB_VLD_CHICKEN_MASK GENMASK(5, 5) -+#define MLXBF_GIGE_LANE_RX_SYNC_FIFO_POP_RDY_CHICKEN_MASK GENMASK(4, 4) -+#define MLXBF_GIGE_LANE_RX_CDR_RESET_REG_MASK GENMASK(3, 3) -+#define MLXBF_GIGE_LANE_RX_CDR_EN_MASK GENMASK(2, 2) -+#define MLXBF_GIGE_LANE_RX_DATA_EN_MASK GENMASK(1, 1) -+ -+#define MLXBF_GIGE_LANE_RX_EQ_TRAIN 0x26064 -+#define MLXBF_GIGE_LANE_RX_EQ_TRAIN_MASK GENMASK(2, 0) -+#define MLXBF_GIGE_LANE_RX_EQ_TRAIN_VAL \ -+ FIELD_PREP(MLXBF_GIGE_LANE_RX_EQ_TRAIN_MASK, 0x3) -+ -+#define MLXBF_GIGE_LANE_GW 0x26100 -+#define MLXBF_GIGE_LANE_GW_ADDR_MASK GENMASK(10, 1) -+#define MLXBF_GIGE_LANE_GW_RW_MASK GENMASK(11, 11) -+#define MLXBF_GIGE_LANE_GW_DATA_MASK GENMASK(27, 12) -+#define MLXBF_GIGE_LANE_GW_DATA_EN_MASK GENMASK(28, 28) -+#define MLXBF_GIGE_LANE_GW_BUSY_MASK GENMASK(30, 30) -+#define MLXBF_GIGE_LANE_GW_ADDR_SHIFT 1 -+#define MLXBF_GIGE_LANE_GW_DESC0 0x2610c -+#define MLXBF_GIGE_LANE_GW_DESC0_DATA_MASK GENMASK(15, 0) -+ -+#define MLXBF_GIGE_TX_FSM_DEFAULT_CYCLES 0x26600 -+#define MLXBF_GIGE_TX_FSM_DEFAULT_VAL(const_factor) \ -+ ((200 * (const_factor)) / MLXBF_GIGE_TIME_FACTOR_TO_USEC) -+ -+#define MLXBF_GIGE_TX_FSM_SLEEP_CYCLES 0x26604 -+#define MLXBF_GIGE_TX_FSM_SLEEP_VAL(const_factor) \ -+ ((1000 * (const_factor)) / MLXBF_GIGE_TIME_FACTOR_TO_USEC) -+ -+#define MLXBF_GIGE_TX_FSM_POWERUP_CYCLES 0x26608 -+#define MLXBF_GIGE_TX_FSM_POWERUP_VAL(const_factor) \ -+ ((10000 * (const_factor)) / MLXBF_GIGE_TIME_FACTOR_TO_USEC) -+ -+#define MLXBF_GIGE_TX_FSM_CAL_FLOW_CYCLES 0x2660c -+#define MLXBF_GIGE_TX_FSM_CAL_FLOW_VAL(const_factor) \ -+ ((200000 * (const_factor)) / MLXBF_GIGE_TIME_FACTOR_TO_USEC) -+ -+#define MLXBF_GIGE_TX_FSM_CAL_ABORT_CYCLES 0x26610 -+#define MLXBF_GIGE_TX_FSM_CAL_ABORT_VAL(const_factor) \ -+ ((4000 * (const_factor)) / MLXBF_GIGE_TIME_FACTOR_TO_USEC) -+#define MLXBF_GIGE_TX_FSM_CAL_ABORT_MASK GENMASK(18, 0) -+ -+#define MLXBF_GIGE_RX_FSM_DEFAULT_CYCLES 0x26614 -+#define MLXBF_GIGE_RX_FSM_DEFAULT_VAL(const_factor) \ -+ ((200 * (const_factor)) / MLXBF_GIGE_TIME_FACTOR_TO_USEC) -+ -+#define MLXBF_GIGE_RX_FSM_SLEEP_CYCLES 0x26618 -+#define MLXBF_GIGE_RX_FSM_SLEEP_VAL(const_factor) \ -+ ((1000 * (const_factor)) / MLXBF_GIGE_TIME_FACTOR_TO_USEC) -+ -+#define MLXBF_GIGE_RX_FSM_POWERUP_CYCLES 0x2661c -+#define MLXBF_GIGE_RX_FSM_POWERUP_VAL(const_factor) \ -+ ((10000 * (const_factor)) / MLXBF_GIGE_TIME_FACTOR_TO_USEC) -+ -+#define MLXBF_GIGE_RX_FSM_TERM_CYCLES 0x26620 -+#define MLXBF_GIGE_RX_FSM_TERM_VAL(const_factor) \ -+ ((200000 * (const_factor)) / MLXBF_GIGE_TIME_FACTOR_TO_USEC) -+ -+#define MLXBF_GIGE_RX_FSM_CAL_FLOW_CYCLES 0x26624 -+#define MLXBF_GIGE_RX_FSM_CAL_FLOW_VAL(const_factor) \ -+ ((200000 * (const_factor)) / MLXBF_GIGE_TIME_FACTOR_TO_USEC) -+ -+#define MLXBF_GIGE_RX_FSM_CAL_ABORT_CYCLES 0x26628 -+#define MLXBF_GIGE_RX_FSM_CAL_ABORT_VAL(const_factor) \ -+ ((4000 * (const_factor)) / MLXBF_GIGE_TIME_FACTOR_TO_USEC) -+ -+#define MLXBF_GIGE_RX_FSM_EQ_FLOW_CYCLES 0x2662c -+#define MLXBF_GIGE_RX_FSM_EQ_FLOW_VAL(const_factor) \ -+ ((48000000 / MLXBF_GIGE_TIME_FACTOR_TO_USEC) * (const_factor)) -+ -+#define MLXBF_GIGE_RX_FSM_EQ_ABORT_CYCLES 0x26630 -+#define MLXBF_GIGE_RX_FSM_EQ_ABORT_VAL(const_factor) \ -+ ((4000 * (const_factor)) / MLXBF_GIGE_TIME_FACTOR_TO_USEC) -+ -+#define MLXBF_GIGE_RX_FSM_EOM_FLOW_CYCLES 0x26634 -+#define MLXBF_GIGE_RX_FSM_EOM_FLOW_VAL(const_factor) \ -+ ((4000000 / MLXBF_GIGE_TIME_FACTOR_TO_USEC) * (const_factor)) -+ -+#define MLXBF_GIGE_RX_FSM_CDR_LOCK_CYCLES 0x26638 -+#define MLXBF_GIGE_RX_FSM_CDR_LOCK_VAL(const_factor) \ -+ ((30000 * (const_factor)) / MLXBF_GIGE_TIME_FACTOR_TO_USEC) -+#define MLXBF_GIGE_RX_FSM_CDR_LOCK_MASK GENMASK(20, 0) -+ -+#define MLXBF_GIGE_LANE_PWR_GOV0 0x26650 -+#define MLXBF_GIGE_LANE_PWR_GOV0_FALL_VAL(const_factor) \ -+ ((5000 * (const_factor)) / MLXBF_GIGE_TIME_FACTOR_TO_USEC) -+#define MLXBF_GIGE_LANE_PWR_GOV0_FALL_MASK GENMASK(31, 16) -+#define MLXBF_GIGE_LANE_PWR_GOV0_RISE_VAL(const_factor) \ -+ ((5000 * (const_factor)) / MLXBF_GIGE_TIME_FACTOR_TO_USEC) -+#define MLXBF_GIGE_LANE_PWR_GOV0_RISE_MASK GENMASK(15, 0) -+ -+#define MLXBF_GIGE_LANE_IDDQ_CYCLES 0x26660 -+#define MLXBF_GIGE_LANE_IDDQ_CYCLES_VAL(const_factor) \ -+ ((2000 * (const_factor)) / MLXBF_GIGE_TIME_FACTOR_TO_USEC) -+#define MLXBF_GIGE_LANE_IDDQ_CYCLES_MASK GENMASK(28, 16) -+ -+#define MLXBF_GIGE_LANE_RST_REG 0x26660 -+#define MLXBF_GIGE_LANE_RST_REG_MASK GENMASK(7, 6) -+ -+#define MLXBF_GIGE_PERIOD_FLOWS_TIMER_MAX 0x26668 -+#define MLXBF_GIGE_PERIOD_FLOWS_TIMER_MAX_VAL(const_factor) \ -+ ((2500000 / (MLXBF_GIGE_TIME_FACTOR_TO_USEC * 8)) * (const_factor)) -+#define MLXBF_GIGE_PERIOD_FLOWS_TIMER_MAX_MASK GENMASK(22, 0) -+ -+#define MLXBF_GIGE_PLL_FSM_CTRL 0x26800 -+#define MLXBF_GIGE_PLL_FSM_PS_MASK GENMASK(3, 0) -+ -+#define MLXBF_GIGE_PLL_GW 0x26810 -+#define MLXBF_GIGE_PLL_GW_ADDR_MASK GENMASK(10, 1) -+#define MLXBF_GIGE_PLL_GW_RW_MASK GENMASK(11, 11) -+#define MLXBF_GIGE_PLL_GW_DATA_MASK GENMASK(27, 12) -+#define MLXBF_GIGE_PLL_GW_DATA_EN_MASK GENMASK(28, 28) -+#define MLXBF_GIGE_PLL_GW_BUSY_MASK GENMASK(30, 30) -+#define MLXBF_GIGE_PLL_GW_ADDR_SHIFT 1 -+#define MLXBF_GIGE_PLL_GW_DESC0 0x2681c -+#define MLXBF_GIGE_PLL_GW_DESC0_DATA_MASK GENMASK(15, 0) -+ -+#define MLXBF_GIGE_PLL_SLEEP_FW 0x26820 -+#define MLXBF_GIGE_PLL_SLEEP_FW_MASK GENMASK(14, 14) -+ -+#define MLXBF_GIGE_PLL_ENABLE 0x26820 -+#define MLXBF_GIGE_PLL_ENABLE_MASK GENMASK(1, 1) -+ -+#define MLXBF_GIGE_PLL_RCAL 0x26828 -+#define MLXBF_GIGE_PLL_RCAL_MASK GENMASK(0, 0) -+ -+#define MLXBF_GIGE_PLL_CAL_VLD 0x2682c -+#define MLXBF_GIGE_PLL_CAL_VLD_MASK GENMASK(1, 0) -+ -+#define MLXBF_GIGE_PLL_CAL 0x26830 -+#define MLXBF_GIGE_PLL_CAL_MASK GENMASK(0, 0) -+ -+#define MLXBF_GIGE_PLL1X_CAUSE_CLRCAUSE_BULK 0x26878 -+#define MLXBF_GIGE_PLL1X_CAUSE_CLRCAUSE_BULK_MASK GENMASK(16, 0) -+ -+#define MLXBF_GIGE_PLL1X_FSM_DEFAULT_CYCLES 0x26900 -+#define MLXBF_GIGE_PLL1X_FSM_DEFAULT_VAL(const_factor) \ -+ ((250 * (const_factor)) / MLXBF_GIGE_TIME_FACTOR_TO_USEC) -+ -+#define MLXBF_GIGE_PLL1X_FSM_SLEEP_CYCLES 0x26904 -+#define MLXBF_GIGE_PLL1X_FSM_SLEEP_VAL(const_factor) \ -+ ((5000 * (const_factor)) / MLXBF_GIGE_TIME_FACTOR_TO_USEC) -+ -+#define MLXBF_GIGE_PLL1X_FSM_RCAL_FLOW_CYCLES 0x26908 -+#define MLXBF_GIGE_PLL1X_FSM_RCAL_FLOW_VAL(const_factor) \ -+ ((40000 * (const_factor)) / MLXBF_GIGE_TIME_FACTOR_TO_USEC) -+ -+#define MLXBF_GIGE_PLL1X_FSM_CAL_FLOW_CYCLES 0x2690c -+#define MLXBF_GIGE_PLL1X_FSM_CAL_FLOW_VAL(const_factor) \ -+ ((300000 * (const_factor)) / MLXBF_GIGE_TIME_FACTOR_TO_USEC) -+ -+#define MLXBF_GIGE_PLL1X_FSM_LOCKDET_STS_CYCLES 0x26910 -+#define MLXBF_GIGE_PLL1X_FSM_LOCKDET_STS_VAL(const_factor) \ -+ ((100000 * (const_factor)) / MLXBF_GIGE_TIME_FACTOR_TO_USEC) -+#define MLXBF_GIGE_PLL1X_FSM_LOCKDET_STS_MASK GENMASK(18, 0) -+ -+#define MLXBF_GIGE_PLL_IDDQ_CYCLES 0x26914 -+#define MLXBF_GIGE_PLL_IDDQ_CYCLES_VAL(const_factor) \ -+ ((2000 * (const_factor)) / MLXBF_GIGE_TIME_FACTOR_TO_USEC) -+#define MLXBF_GIGE_PLL_IDDQ_CYCLES_MASK GENMASK(28, 16) -+ -+#define MLXBF_GIGE_UPHY_PLL_RST_REG 0x26914 -+#define MLXBF_GIGE_UPHY_PLL_RST_REG_MASK GENMASK(2, 2) -+ -+#define MLXBF_GIGE_UGL_CR_BRIDGE_DESC 0x26a90 -+#define MLXBF_GIGE_UGL_CR_BRIDGE_SETUP_MASK GENMASK(5, 0) -+#define MLXBF_GIGE_UGL_CR_BRIDGE_PULSE_MASK GENMASK(13, 8) -+#define MLXBF_GIGE_UGL_CR_BRIDGE_HOLD_MASK GENMASK(21, 16) -+#define MLXBF_GIGE_UGL_CR_BRIDGE_ALL_MASK \ -+ (MLXBF_GIGE_UGL_CR_BRIDGE_SETUP_MASK | \ -+ MLXBF_GIGE_UGL_CR_BRIDGE_PULSE_MASK | \ -+ MLXBF_GIGE_UGL_CR_BRIDGE_HOLD_MASK) -+ -+#define MLXBF_GIGE_UGL_CR_BRIDGE_SETUP_VAL(const_factor) \ -+ ((10 * (const_factor)) / MLXBF_GIGE_TIME_FACTOR_TO_USEC) -+#define MLXBF_GIGE_UGL_CR_BRIDGE_PULSE_VAL(const_factor) \ -+ ((30 * (const_factor)) / MLXBF_GIGE_TIME_FACTOR_TO_USEC) -+#define MLXBF_GIGE_UGL_CR_BRIDGE_HOLD_VAL(const_factor) \ -+ ((10 * (const_factor)) / MLXBF_GIGE_TIME_FACTOR_TO_USEC) -+ -+/* rw = 0 for write and 1 for read. -+ * data_en should be set to 1 only for a write transaction. -+ */ -+#define MLXBF_GIGE_PLL_GW_CREATE_CMD(addr, data, rw) \ -+ ((((addr) << MLXBF_GIGE_PLL_GW_ADDR_SHIFT) & MLXBF_GIGE_PLL_GW_ADDR_MASK) | \ -+ FIELD_PREP(MLXBF_GIGE_PLL_GW_RW_MASK, rw) | \ -+ FIELD_PREP(MLXBF_GIGE_PLL_GW_DATA_MASK, data) | \ -+ FIELD_PREP(MLXBF_GIGE_PLL_GW_DATA_EN_MASK, !rw) | \ -+ FIELD_PREP(MLXBF_GIGE_PLL_GW_BUSY_MASK, 1)) -+ -+#define MLXBF_GIGE_LANE_GW_CREATE_CMD(addr, data, rw) \ -+ ((((addr) << MLXBF_GIGE_LANE_GW_ADDR_SHIFT) & MLXBF_GIGE_LANE_GW_ADDR_MASK) | \ -+ FIELD_PREP(MLXBF_GIGE_LANE_GW_RW_MASK, rw) | \ -+ FIELD_PREP(MLXBF_GIGE_LANE_GW_DATA_MASK, data) | \ -+ FIELD_PREP(MLXBF_GIGE_LANE_GW_DATA_EN_MASK, !rw) | \ -+ FIELD_PREP(MLXBF_GIGE_LANE_GW_BUSY_MASK, 1)) -+ -+#define MLXBF_GIGE_UPHY_GW_CREATE_CMD(addr, data, rw, is_pll) \ -+ ((is_pll) ? MLXBF_GIGE_PLL_GW_CREATE_CMD(addr, data, rw) : \ -+ MLXBF_GIGE_LANE_GW_CREATE_CMD(addr, data, rw)) -+ -+#define MLXBF_GIGE_UPHY_GW(is_pll) \ -+ ((is_pll) ? MLXBF_GIGE_PLL_GW : MLXBF_GIGE_LANE_GW) -+ -+#define MLXBF_GIGE_UPHY_GW_DESC0(is_pll) \ -+ ((is_pll) ? MLXBF_GIGE_PLL_GW_DESC0 : MLXBF_GIGE_LANE_GW_DESC0) -+ -+#define MLXBF_GIGE_UPHY_GW_DESC0_DATA_MASK(is_pll) \ -+ ((is_pll) ? MLXBF_GIGE_PLL_GW_DESC0_DATA_MASK : \ -+ MLXBF_GIGE_LANE_GW_DESC0_DATA_MASK) -+ -+#define MLXBF_GIGE_UPHY_GW_BUSY_MASK(is_pll) \ -+ ((is_pll) ? MLXBF_GIGE_PLL_GW_BUSY_MASK : \ -+ MLXBF_GIGE_LANE_GW_BUSY_MASK) -+ -+/* bootrecord p1clk */ -+#define MLXBF_GIGE_P1CLK_REG1 0x14 -+#define MLXBF_GIGE_P1CLK_REG2 0x18 -+#define MLXBF_GIGE_P1_CORE_F_SHIFT 0 -+#define MLXBF_GIGE_P1_CORE_F_MASK GENMASK(25, 0) -+#define MLXBF_GIGE_P1_CORE_R_SHIFT 26 -+#define MLXBF_GIGE_P1_CORE_R_MASK GENMASK(31, 26) -+#define MLXBF_GIGE_P1_CORE_OD_SHIFT 0 -+#define MLXBF_GIGE_P1_CORE_OD_MASK GENMASK(3, 0) -+ -+#define MLXBF_GIGE_P1CLK_MULT_FACTOR 12 -+#define MLXBF_GIGE_P1_FREQ_REFERENCE 156250000ULL -+#define MLXBF_GIGE_P1_CLK_CONST 16384ULL -+ -+/* There is a 32-bit crspace to 16-bit UPHY address encoding. -+ * The 16-bit address can be accessed via the GW register. -+ * Subtract the crspace region base address from the actual -+ * address that needs to be accessed via the gw. -+ * Then divide it by 4 since crspace registers are 4 bit aligned -+ */ -+#define MLXBF_GIGE_32B_TO_16B_ADDR(addr, base) (((addr) - (base)) >> 2) -+ -+#define MLXBF_GIGE_LANE_CSUM_STS_ADDR \ -+ MLXBF_GIGE_32B_TO_16B_ADDR( \ -+ MLXBF_GIGE_AE_SYS_IMEM_RAM_STAT_IMEM_CSUM_STS, \ -+ MLXBF_GIGE_LANE_CFG_FLAT0_BASE) -+ -+#define MLXBF_GIGE_IMEM_CSUM_RUN_AND_VALID 0x3 -+#define MLXBF_GIGE_INVALID_IMEM_CSUM -1 -+ -+#define MLXBF_GIGE_LANE_IMEM_DATA_ADDR \ -+ MLXBF_GIGE_32B_TO_16B_ADDR( \ -+ MLXBF_GIGE_AE_SYS_IMEM_RAM_DATA_CTRL_WDATA, \ -+ MLXBF_GIGE_LANE_CFG_FLAT0_BASE) -+ -+#define MLXBF_GIGE_MGMT_BGAP_FUSE_CTRL_ADDR \ -+ MLXBF_GIGE_32B_TO_16B_ADDR( \ -+ MLXBF_GIGE_PLL_CFG_FLAT0_MGMT_BGAP_FUSE_CTRL, \ -+ MLXBF_GIGE_PLL_CFG_FLAT0_BASE) -+ -+#define MLXBF_GIGE_YU_BG_TRIM_ROOM_MASK GENMASK(4, 0) -+#define MLXBF_GIGE_YU_BG_TRIM_ROOM_SHIFT 0 -+#define MLXBF_GIGE_YU_CVB_TRIM_ROOM_MASK GENMASK(9, 5) -+#define MLXBF_GIGE_YU_CVB_TRIM_ROOM_SHIFT 5 -+#define MLXBF_GIGE_YU_SPEEDO_ROOM_MASK GENMASK(14, 10) -+#define MLXBF_GIGE_YU_SPEEDO_ROOM_SHIFT 10 -+#define MLXBF_GIGE_YU_FUSE_VALID_SHIFT 4 -+/* Fuse mask without valid bit */ -+#define MLXBF_GIGE_YU_FUSE_MASK 0xf -+ -+enum { -+ MLXBF_GIGE_UGL_PLL1X_FSM_STATE_IDDQ, -+ MLXBF_GIGE_UGL_PLL1X_FSM_STATE_SLEEP, -+ MLXBF_GIGE_UGL_PLL1X_FSM_STATE_RCAL_DONE_WAIT1, -+ MLXBF_GIGE_UGL_PLL1X_FSM_STATE_RCAL_DONE_WAIT0, -+ MLXBF_GIGE_UGL_PLL1X_FSM_STATE_IDLE, -+ MLXBF_GIGE_UGL_PLL1X_FSM_STATE_CAL_DONE_WAIT1, -+ MLXBF_GIGE_UGL_PLL1X_FSM_STATE_CAL_DONE_WAIT0, -+ MLXBF_GIGE_UGL_PLL1X_FSM_STATE_ACTIVE, -+ MLXBF_GIGE_UGL_PLL1X_FSM_STATE_LOCK, -+ MLXBF_GIGE_UGL_PLL1X_FSM_STATE_SPEED_CHANGE -+}; -+ -+enum { -+ MLXBF_GIGE_TX_FSM_IDDQ, -+ MLXBF_GIGE_TX_FSM_SLEEP, -+ MLXBF_GIGE_TX_FSM_SPEED_CHANGE, -+ MLXBF_GIGE_TX_FSM_POWERUP, -+ MLXBF_GIGE_TX_UGL_TX_POWERUP, -+ MLXBF_GIGE_TX_CAL_DONE_WAIT1, -+ MLXBF_GIGE_TX_CAL_ABORT, -+ MLXBF_GIGE_TX_CAL_ABORT_DONE_WAIT1, -+ MLXBF_GIGE_TX_CAL_DONE_WAIT0, -+ MLXBF_GIGE_TX_CAL_DONE, -+ MLXBF_GIGE_TX_DATA_READY, -+ MLXBF_GIGE_TX_DATA_EN_RDY, -+ MLXBF_GIGE_TX_DATA_EN -+}; -+ -+enum { -+ MLXBF_GIGE_RX_FSM_IDDQ, -+ MLXBF_GIGE_RX_FSM_SLEEP, -+ MLXBF_GIGE_RX_FSM_SPEED_CHANGE, -+ MLXBF_GIGE_RX_FSM_POWERUP, -+ MLXBF_GIGE_RX_FSM_CAL, -+ MLXBF_GIGE_RX_FSM_WAIT_TERM, -+ MLXBF_GIGE_RX_FSM_DATA_EN_RDY, -+ MLXBF_GIGE_RX_FSM_DATA_EN, -+ MLXBF_GIGE_RX_FSM_CDR_EN, -+ MLXBF_GIGE_RX_FSM_ACTIVE, -+ MLXBF_GIGE_RX_FSM_EQ, -+ MLXBF_GIGE_RX_FSM_EOM -+}; -+ -+#define MLXBF_GIGE_PLL_STAB_TIME 6 /* us */ -+#define MLXBF_GIGE_PLL_DLM_IMEM_CSUM_TIMEOUT 15 /* us */ -+ -+struct mlxbf_gige_uphy_cfg_reg { -+ u16 addr; -+ u16 wdata; -+}; -+ -+int mlxbf_gige_config_uphy(struct mlxbf_gige *priv); -+ -+#endif /* __MLXBF_GIGE_UPHY_H__ */ --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0242-UBUNTU-SAUCE-mlxbf_gige-add-BlueField-3-ethtool_ops.patch b/platform/mellanox/non-upstream-patches/patches/0242-UBUNTU-SAUCE-mlxbf_gige-add-BlueField-3-ethtool_ops.patch deleted file mode 100644 index d08aafb30154..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0242-UBUNTU-SAUCE-mlxbf_gige-add-BlueField-3-ethtool_ops.patch +++ /dev/null @@ -1,95 +0,0 @@ -From 33acf11a1ea46d88fbb27afff1537bdf5dd0e822 Mon Sep 17 00:00:00 2001 -From: David Thompson -Date: Fri, 28 Oct 2022 18:08:46 -0400 -Subject: [PATCH backport 5.10 43/63] UBUNTU: SAUCE: mlxbf_gige: add - BlueField-3 ethtool_ops - -BugLink: https://bugs.launchpad.net/bugs/1995148 - -This patch adds logic to support initialization of a -BlueField-3 specific "ethtool_ops" data structure. The -BlueField-3 data structure supports the "set_link_ksettings" -callback, while the BlueField-2 data structure does not. - -Signed-off-by: David Thompson -Signed-off-by: Asmaa Mnebhi ---- - .../ethernet/mellanox/mlxbf_gige/mlxbf_gige.h | 3 ++- - .../mellanox/mlxbf_gige/mlxbf_gige_ethtool.c | 17 ++++++++++++++++- - .../mellanox/mlxbf_gige/mlxbf_gige_main.c | 4 +++- - 3 files changed, 21 insertions(+), 3 deletions(-) - -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige.h b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige.h -index e9bd09ee0..cbabdac3e 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige.h -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige.h -@@ -200,7 +200,8 @@ struct sk_buff *mlxbf_gige_alloc_skb(struct mlxbf_gige *priv, - int mlxbf_gige_request_irqs(struct mlxbf_gige *priv); - void mlxbf_gige_free_irqs(struct mlxbf_gige *priv); - int mlxbf_gige_poll(struct napi_struct *napi, int budget); --extern const struct ethtool_ops mlxbf_gige_ethtool_ops; -+extern const struct ethtool_ops mlxbf_gige_bf2_ethtool_ops; -+extern const struct ethtool_ops mlxbf_gige_bf3_ethtool_ops; - void mlxbf_gige_update_tx_wqe_next(struct mlxbf_gige *priv); - - #endif /* !defined(__MLXBF_GIGE_H__) */ -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_ethtool.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_ethtool.c -index 257724323..3156ef064 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_ethtool.c -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_ethtool.c -@@ -158,7 +158,7 @@ static void mlxbf_gige_get_pauseparam(struct net_device *netdev, - pause->tx_pause = 1; - } - --const struct ethtool_ops mlxbf_gige_ethtool_ops = { -+const struct ethtool_ops mlxbf_gige_bf2_ethtool_ops = { - .get_link = ethtool_op_get_link, - .get_ringparam = mlxbf_gige_get_ringparam, - .set_ringparam = mlxbf_gige_set_ringparam, -@@ -171,3 +171,18 @@ const struct ethtool_ops mlxbf_gige_ethtool_ops = { - .get_pauseparam = mlxbf_gige_get_pauseparam, - .get_link_ksettings = phy_ethtool_get_link_ksettings, - }; -+ -+const struct ethtool_ops mlxbf_gige_bf3_ethtool_ops = { -+ .get_link = ethtool_op_get_link, -+ .get_ringparam = mlxbf_gige_get_ringparam, -+ .set_ringparam = mlxbf_gige_set_ringparam, -+ .get_regs_len = mlxbf_gige_get_regs_len, -+ .get_regs = mlxbf_gige_get_regs, -+ .get_strings = mlxbf_gige_get_strings, -+ .get_sset_count = mlxbf_gige_get_sset_count, -+ .get_ethtool_stats = mlxbf_gige_get_ethtool_stats, -+ .nway_reset = phy_ethtool_nway_reset, -+ .get_pauseparam = mlxbf_gige_get_pauseparam, -+ .get_link_ksettings = phy_ethtool_get_link_ksettings, -+ .set_link_ksettings = phy_ethtool_set_link_ksettings, -+}; -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -index f97e49670..197ec8ccb 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -@@ -451,7 +451,6 @@ static int mlxbf_gige_probe(struct platform_device *pdev) - - SET_NETDEV_DEV(netdev, &pdev->dev); - netdev->netdev_ops = &mlxbf_gige_netdev_ops; -- netdev->ethtool_ops = &mlxbf_gige_ethtool_ops; - priv = netdev_priv(netdev); - priv->netdev = netdev; - -@@ -468,9 +467,12 @@ static int mlxbf_gige_probe(struct platform_device *pdev) - priv->hw_version = soc_version; - - if (priv->hw_version == MLXBF_GIGE_VERSION_BF3) { -+ netdev->ethtool_ops = &mlxbf_gige_bf3_ethtool_ops; - err = mlxbf_gige_config_uphy(priv); - if (err) - return err; -+ } else { -+ netdev->ethtool_ops = &mlxbf_gige_bf2_ethtool_ops; - } - - /* Attach MDIO device */ --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0261-mlxbf-ptm-power-and-thermal-management-debugfs-drive.patch b/platform/mellanox/non-upstream-patches/patches/0261-mlxbf-ptm-power-and-thermal-management-debugfs-drive.patch index a58881c4a721..7328cbfdf048 100644 --- a/platform/mellanox/non-upstream-patches/patches/0261-mlxbf-ptm-power-and-thermal-management-debugfs-drive.patch +++ b/platform/mellanox/non-upstream-patches/patches/0261-mlxbf-ptm-power-and-thermal-management-debugfs-drive.patch @@ -39,17 +39,17 @@ index a5231c23a..48bd61f61 100644 config NVSW_SN2201 diff --git a/drivers/platform/mellanox/Makefile b/drivers/platform/mellanox/Makefile -index 7c6393ebe..6aa0ab157 100644 +index 7a4b90ed5..d30483021 100644 --- a/drivers/platform/mellanox/Makefile +++ b/drivers/platform/mellanox/Makefile -@@ -9,6 +9,7 @@ obj-$(CONFIG_MLXBF_PMC) += mlxbf-pmc.o +@@ -8,6 +8,7 @@ obj-$(CONFIG_MLXBF_PMC) += mlxbf-pmc.o obj-$(CONFIG_MLXBF_TMFIFO) += mlxbf-tmfifo.o obj-$(CONFIG_MLXBF_TRIO) += mlx-trio.o obj-$(CONFIG_MLXBF_LIVEFISH) += mlxbf-livefish.o +obj-$(CONFIG_MLXBF_PTM) += mlxbf-ptm.o obj-$(CONFIG_MLXREG_HOTPLUG) += mlxreg-hotplug.o obj-$(CONFIG_MLXREG_IO) += mlxreg-io.o - obj-$(CONFIG_MLXREG_LC) += mlxreg-lc.o + obj-$(CONFIG_MLXBF_PKA) += mlxbf_pka/ diff --git a/drivers/platform/mellanox/mlxbf-ptm.c b/drivers/platform/mellanox/mlxbf-ptm.c new file mode 100644 index 000000000..307ba1f33 diff --git a/platform/mellanox/non-upstream-patches/patches/0269-platform-mellanox-Cosmetic-changes.patch b/platform/mellanox/non-upstream-patches/patches/0269-platform-mellanox-Cosmetic-changes.patch deleted file mode 100644 index 18dc177ede3f..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0269-platform-mellanox-Cosmetic-changes.patch +++ /dev/null @@ -1,74 +0,0 @@ -From da7c9365e155de2a038cbc1cded3a56ea9a363aa Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Mon, 27 Feb 2023 15:24:43 +0000 -Subject: [PATCH backport 5.10 1/3] platform: mellanox: Cosmetic changes - -Fix routines and labels names by s/topology/topology. - -Signed-off-by: Vadim Pasternak -Reviewed-by: Michael Shych ---- - drivers/platform/mellanox/mlx-platform.c | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/drivers/platform/mellanox/mlx-platform.c b/drivers/platform/mellanox/mlx-platform.c -index 849fdf5de..656056089 100644 ---- a/drivers/platform/mellanox/mlx-platform.c -+++ b/drivers/platform/mellanox/mlx-platform.c -@@ -6876,7 +6876,7 @@ mlxplat_i2c_mux_complition_notify(void *handle, struct i2c_adapter *parent, - return 0; - } - --static int mlxplat_i2c_mux_topolgy_init(struct mlxplat_priv *priv) -+static int mlxplat_i2c_mux_topology_init(struct mlxplat_priv *priv) - { - int i, err; - -@@ -6921,7 +6921,7 @@ static int mlxplat_i2c_mux_topolgy_init(struct mlxplat_priv *priv) - return err; - } - --static void mlxplat_i2c_mux_topolgy_exit(struct mlxplat_priv *priv) -+static void mlxplat_i2c_mux_topology_exit(struct mlxplat_priv *priv) - { - int i; - -@@ -6937,7 +6937,7 @@ static int mlxplat_i2c_main_complition_notify(void *handle, int id) - { - struct mlxplat_priv *priv = handle; - -- return mlxplat_i2c_mux_topolgy_init(priv); -+ return mlxplat_i2c_mux_topology_init(priv); - } - - static int mlxplat_i2c_main_init(struct mlxplat_priv *priv) -@@ -6964,14 +6964,14 @@ static int mlxplat_i2c_main_init(struct mlxplat_priv *priv) - } - - if (priv->i2c_main_init_status == MLXPLAT_I2C_MAIN_BUS_NOTIFIED) { -- err = mlxplat_i2c_mux_topolgy_init(priv); -+ err = mlxplat_i2c_mux_topology_init(priv); - if (err) -- goto fail_mlxplat_i2c_mux_topolgy_init; -+ goto fail_mlxplat_i2c_mux_topology_init; - } - - return 0; - --fail_mlxplat_i2c_mux_topolgy_init: -+fail_mlxplat_i2c_mux_topology_init: - fail_platform_i2c_register: - fail_mlxplat_mlxcpld_verify_bus_topology: - return err; -@@ -6979,7 +6979,7 @@ static int mlxplat_i2c_main_init(struct mlxplat_priv *priv) - - static void mlxplat_i2c_main_exit(struct mlxplat_priv *priv) - { -- mlxplat_i2c_mux_topolgy_exit(priv); -+ mlxplat_i2c_mux_topology_exit(priv); - if (priv->pdev_i2c) - platform_device_unregister(priv->pdev_i2c); - } --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0270-platform-mellanox-Fix-order-in-exit-flow.patch b/platform/mellanox/non-upstream-patches/patches/0270-platform-mellanox-Fix-order-in-exit-flow.patch deleted file mode 100644 index 4bbbe389aaa8..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0270-platform-mellanox-Fix-order-in-exit-flow.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 89d0e497e62b90e8faa2b67c298cedeab47b8f8b Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Mon, 27 Feb 2023 16:09:17 +0000 -Subject: [PATCH backport 5.10 2/3] platform: mellanox: Fix order in exit flow - -Fix exit flow order: call mlxplat_post_exit() after -mlxplat_i2c_main_exit() in order to unregister main i2c driver before -to "mlxplat" driver. - -Signed-off-by: Vadim Pasternak -Reviewed-by: Michael Shych ---- - drivers/platform/mellanox/mlx-platform.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/drivers/platform/mellanox/mlx-platform.c b/drivers/platform/mellanox/mlx-platform.c -index 656056089..42fd7e4e0 100644 ---- a/drivers/platform/mellanox/mlx-platform.c -+++ b/drivers/platform/mellanox/mlx-platform.c -@@ -6929,8 +6929,6 @@ static void mlxplat_i2c_mux_topology_exit(struct mlxplat_priv *priv) - if (priv->pdev_mux[i]) - platform_device_unregister(priv->pdev_mux[i]); - } -- -- mlxplat_post_exit(); - } - - static int mlxplat_i2c_main_complition_notify(void *handle, int id) -@@ -7068,6 +7066,7 @@ static void __exit mlxplat_exit(void) - unregister_reboot_notifier(mlxplat_reboot_nb); - mlxplat_pre_exit(priv); - mlxplat_i2c_main_exit(priv); -+ mlxplat_post_exit(); - } - module_exit(mlxplat_exit); - --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0271-platform-mellanox-Add-new-attributes.patch b/platform/mellanox/non-upstream-patches/patches/0271-platform-mellanox-Add-new-attributes.patch deleted file mode 100644 index 92044c45bfad..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0271-platform-mellanox-Add-new-attributes.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 6cb8f4e432f8209a3775877d690a979a2e786afc Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Mon, 27 Feb 2023 18:56:09 +0000 -Subject: [PATCH backport 5.10 3/3] platform: mellanox: Add new attributes - -Add two new attributes: -"lid_open" - to indicate system intrusion detection. -"reset_long_pwr_pb" - to indicate that system has been reset due to -long press of power button. - -Signed-off-by: Vadim Pasternak -Reviewed-by: Michael Shych ---- - drivers/platform/mellanox/mlx-platform.c | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - -diff --git a/drivers/platform/mellanox/mlx-platform.c b/drivers/platform/mellanox/mlx-platform.c -index 42fd7e4e0..4eb327720 100644 ---- a/drivers/platform/mellanox/mlx-platform.c -+++ b/drivers/platform/mellanox/mlx-platform.c -@@ -4067,6 +4067,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { - .mask = GENMASK(7, 0) & ~BIT(1), - .mode = 0444, - }, -+ { -+ .label = "lid_open", -+ .reg = MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET, -+ .mask = GENMASK(7, 0) & ~BIT(2), -+ .mode = 0444, -+ }, - { - .label = "clk_brd1_boot_fail", - .reg = MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET, -@@ -4706,6 +4712,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_chassis_blade_regs_io_data[] = { - .mask = GENMASK(7, 0) & ~BIT(6), - .mode = 0444, - }, -+ { -+ .label = "reset_long_pwr_pb", -+ .reg = MLXPLAT_CPLD_LPC_REG_RST_CAUSE2_OFFSET, -+ .mask = GENMASK(7, 0) & ~BIT(7), -+ .mode = 0444, -+ }, - { - .label = "pwr_cycle", - .reg = MLXPLAT_CPLD_LPC_REG_GP1_OFFSET, --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0272-platform-mellanox-Change-register-offset-addresses.patch b/platform/mellanox/non-upstream-patches/patches/0272-platform-mellanox-Change-register-offset-addresses.patch deleted file mode 100644 index a5596171c962..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0272-platform-mellanox-Change-register-offset-addresses.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 020ab13e16f943bb66da221507f83634a7d9ca05 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Wed, 1 Mar 2023 17:21:48 +0000 -Subject: [PATCH backport 5.10 4/5] platform: mellanox: Change register offset - addresses - -Move debug register offsets to different location due to hardware changes. - -Signed-off-by: Vadim Pasternak -Reviewed-by: Michael Shych ---- - drivers/platform/mellanox/mlx-platform.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/drivers/platform/mellanox/mlx-platform.c b/drivers/platform/mellanox/mlx-platform.c -index 4eb327720..b5d51673f 100644 ---- a/drivers/platform/mellanox/mlx-platform.c -+++ b/drivers/platform/mellanox/mlx-platform.c -@@ -66,10 +66,6 @@ - #define MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET 0x37 - #define MLXPLAT_CPLD_LPC_REG_AGGR_OFFSET 0x3a - #define MLXPLAT_CPLD_LPC_REG_AGGR_MASK_OFFSET 0x3b --#define MLXPLAT_CPLD_LPC_REG_DBG1_OFFSET 0x3c --#define MLXPLAT_CPLD_LPC_REG_DBG2_OFFSET 0x3d --#define MLXPLAT_CPLD_LPC_REG_DBG3_OFFSET 0x3e --#define MLXPLAT_CPLD_LPC_REG_DBG4_OFFSET 0x3f - #define MLXPLAT_CPLD_LPC_REG_AGGRLO_OFFSET 0x40 - #define MLXPLAT_CPLD_LPC_REG_AGGRLO_MASK_OFFSET 0x41 - #define MLXPLAT_CPLD_LPC_REG_AGGRCO_OFFSET 0x42 -@@ -130,6 +126,10 @@ - #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_DBG1_OFFSET 0xb6 -+#define MLXPLAT_CPLD_LPC_REG_DBG2_OFFSET 0xb7 -+#define MLXPLAT_CPLD_LPC_REG_DBG3_OFFSET 0xb8 -+#define MLXPLAT_CPLD_LPC_REG_DBG4_OFFSET 0xb9 - #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 --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0273-platform-mellanox-Add-field-upgrade-capability-regis.patch b/platform/mellanox/non-upstream-patches/patches/0273-platform-mellanox-Add-field-upgrade-capability-regis.patch deleted file mode 100644 index 0e1c1b469c7c..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0273-platform-mellanox-Add-field-upgrade-capability-regis.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 96de5181b880adf2fd65fa85fbc3e0c74f976788 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Wed, 1 Mar 2023 17:49:08 +0000 -Subject: [PATCH backport 5.10 5/6] platform: mellanox: Add field upgrade - capability register - -Add new register to indicate the method of FPGA/CPLD field upgrade -supported on the specific system. -Currently two masks are available: -b00 - field upgrade through LPC gateway (new method introduced to - accelerate field upgrade process). -b11 - field upgrade through CPU GPIO pins (old method). - -Signed-off-by: Vadim Pasternak -Reviewed-by: Michael Shych ---- - drivers/platform/mellanox/mlx-platform.c | 11 +++++++++++ - 1 file changed, 11 insertions(+) - -diff --git a/drivers/platform/mellanox/mlx-platform.c b/drivers/platform/mellanox/mlx-platform.c -index b5d51673f..f674d9173 100644 ---- a/drivers/platform/mellanox/mlx-platform.c -+++ b/drivers/platform/mellanox/mlx-platform.c -@@ -66,6 +66,7 @@ - #define MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET 0x37 - #define MLXPLAT_CPLD_LPC_REG_AGGR_OFFSET 0x3a - #define MLXPLAT_CPLD_LPC_REG_AGGR_MASK_OFFSET 0x3b -+#define MLXPLAT_CPLD_LPC_REG_FU_CAP_OFFSET 0x3c - #define MLXPLAT_CPLD_LPC_REG_AGGRLO_OFFSET 0x40 - #define MLXPLAT_CPLD_LPC_REG_AGGRLO_MASK_OFFSET 0x41 - #define MLXPLAT_CPLD_LPC_REG_AGGRCO_OFFSET 0x42 -@@ -241,6 +242,7 @@ - #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_FU_CAP_MASK GENMASK(1, 0) - #define MLXPLAT_CPLD_PWR_BUTTON_MASK BIT(0) - #define MLXPLAT_CPLD_LATCH_RST_MASK BIT(5) - #define MLXPLAT_CPLD_THERMAL1_PDB_MASK BIT(3) -@@ -3956,6 +3958,13 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { - .mask = GENMASK(7, 0) & ~BIT(5), - .mode = 0200, - }, -+ { -+ .label = "jtag_cap", -+ .reg = MLXPLAT_CPLD_LPC_REG_FU_CAP_OFFSET, -+ .mask = MLXPLAT_CPLD_FU_CAP_MASK, -+ .bit = 1, -+ .mode = 0444, -+ }, - { - .label = "jtag_enable", - .reg = MLXPLAT_CPLD_LPC_REG_GP2_OFFSET, -@@ -5424,6 +5433,7 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_SAFE_BIOS_WP_OFFSET: - case MLXPLAT_CPLD_LPC_REG_AGGR_OFFSET: - case MLXPLAT_CPLD_LPC_REG_AGGR_MASK_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_FU_CAP_OFFSET: - case MLXPLAT_CPLD_LPC_REG_DBG1_OFFSET: - case MLXPLAT_CPLD_LPC_REG_DBG2_OFFSET: - case MLXPLAT_CPLD_LPC_REG_DBG3_OFFSET: -@@ -5582,6 +5592,7 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_SAFE_BIOS_WP_OFFSET: - case MLXPLAT_CPLD_LPC_REG_AGGR_OFFSET: - case MLXPLAT_CPLD_LPC_REG_AGGR_MASK_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_FU_CAP_OFFSET: - case MLXPLAT_CPLD_LPC_REG_DBG1_OFFSET: - case MLXPLAT_CPLD_LPC_REG_DBG2_OFFSET: - case MLXPLAT_CPLD_LPC_REG_DBG3_OFFSET: --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0274-platform-mellanox-Modify-reset-causes-description.patch b/platform/mellanox/non-upstream-patches/patches/0274-platform-mellanox-Modify-reset-causes-description.patch deleted file mode 100644 index 62b5635661b9..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0274-platform-mellanox-Modify-reset-causes-description.patch +++ /dev/null @@ -1,53 +0,0 @@ -From f8a0954053e6e06070ed399e1810bea089ba36bd Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Thu, 2 Mar 2023 12:28:11 +0000 -Subject: [PATCH backport v.5.10 4/8] platform: mellanox: Modify reset causes - description - -Link: https://patchwork.kernel.org/project/platform-driver-x86/patch/20230814203406.12399-4-vadimp@nvidia.com/ - -For system of classes VMOD0005, VMOD0010: -- remove "reset_from_comex", since this cause doesn't define specific - reason. -- add more speicific reason "reset_sw_reset", which is set along with - removed "reset_from_comex". - -Signed-off-by: Vadim Pasternak -Reviewed-by: Michael Shych ---- - drivers/platform/mellanox/mlx-platform.c | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - -diff --git a/drivers/platform/mellanox/mlx-platform.c b/drivers/platform/mellanox/mlx-platform.c -index 486a3e8da..67865636e 100644 ---- a/drivers/platform/mellanox/mlx-platform.c -+++ b/drivers/platform/mellanox/mlx-platform.c -@@ -3832,12 +3832,6 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { - .mask = GENMASK(7, 0) & ~BIT(2), - .mode = 0444, - }, -- { -- .label = "reset_from_comex", -- .reg = MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET, -- .mask = GENMASK(7, 0) & ~BIT(4), -- .mode = 0444, -- }, - { - .label = "reset_from_asic", - .reg = MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET, -@@ -3856,6 +3850,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { - .mask = GENMASK(7, 0) & ~BIT(7), - .mode = 0444, - }, -+ { -+ .label = "reset_sw_reset", -+ .reg = MLXPLAT_CPLD_LPC_REG_RST_CAUSE1_OFFSET, -+ .mask = GENMASK(7, 0) & ~BIT(0), -+ .mode = 0444, -+ }, - { - .label = "reset_comex_pwr_fail", - .reg = MLXPLAT_CPLD_LPC_REG_RST_CAUSE1_OFFSET, --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0278-platform-mellanox-mlx-platform-Modify-graceful-shutd.patch b/platform/mellanox/non-upstream-patches/patches/0278-platform-mellanox-mlx-platform-Modify-graceful-shutd.patch deleted file mode 100644 index 72e4b19bb381..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0278-platform-mellanox-mlx-platform-Modify-graceful-shutd.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 8b83fb501ac77d60e1cc30fac63e71f469ba0992 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Fri, 10 Mar 2023 09:15:35 +0000 -Subject: [PATCH backport v.5.10 1/1] platform: mellanox: mlx-platform: Modify - graceful shutdown callback and power down mask - -Use kernel_power_off() instead of kernel_halt() to pass through -machine_power_off() -> pm_power_off(), otherwise axillary power does -not go off. - -Change "power down" bitmask. - -Signed-off-by: Vadim Pasternak -Reviewed-by: Michael Shych ---- - drivers/platform/mellanox/mlx-platform.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/drivers/platform/mellanox/mlx-platform.c b/drivers/platform/mellanox/mlx-platform.c -index 67865636e..55afb4c90 100644 ---- a/drivers/platform/mellanox/mlx-platform.c -+++ b/drivers/platform/mellanox/mlx-platform.c -@@ -227,7 +227,7 @@ - MLXPLAT_CPLD_AGGR_MASK_LC_SDWN) - #define MLXPLAT_CPLD_LOW_AGGR_MASK_LOW 0xc1 - #define MLXPLAT_CPLD_LOW_AGGR_MASK_ASIC2 BIT(2) --#define MLXPLAT_CPLD_LOW_AGGR_MASK_PWR_BUT BIT(4) -+#define MLXPLAT_CPLD_LOW_AGGR_MASK_PWR_BUT GENMASK(5,4) - #define MLXPLAT_CPLD_LOW_AGGR_MASK_I2C BIT(6) - #define MLXPLAT_CPLD_PSU_MASK GENMASK(1, 0) - #define MLXPLAT_CPLD_PWR_MASK GENMASK(1, 0) -@@ -2509,7 +2509,7 @@ mlxplat_mlxcpld_l1_switch_pwr_events_handler(void *handle, enum mlxreg_hotplug_k - u8 action) - { - dev_info(&mlxplat_dev->dev, "System shutdown due to short press of power button"); -- kernel_halt(); -+ kernel_power_off(); - return 0; - } - --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0279-platform-mellanox-mlx-platform-Fix-signals-polarity-.patch b/platform/mellanox/non-upstream-patches/patches/0279-platform-mellanox-mlx-platform-Fix-signals-polarity-.patch deleted file mode 100644 index 6cd5cddd155d..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0279-platform-mellanox-mlx-platform-Fix-signals-polarity-.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 6720a3b49d3c0bb26d18bfe651bd9101dde34fc8 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Wed, 15 Mar 2023 19:23:20 +0000 -Subject: [PATCH backport v.5.10 1/3] platform: mellanox: mlx-platform: Fix - signals polarity and latch mask - -Change polarity of chassis health and power signals and fix latch reset -mask for L1 switch. - -Fixes: dd635e33b5c9 ("platform: mellanox: Introduce support of new Nvidia L1 switch") -Signed-off-by: Vadim Pasternak -Reviewed-by: Michael Shych ---- - drivers/platform/mellanox/mlx-platform.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/drivers/platform/mellanox/mlx-platform.c b/drivers/platform/mellanox/mlx-platform.c -index fa2e539b6..2bc3720a4 100644 ---- a/drivers/platform/mellanox/mlx-platform.c -+++ b/drivers/platform/mellanox/mlx-platform.c -@@ -244,7 +244,7 @@ - #define MLXPLAT_CPLD_EROT_MASK GENMASK(1, 0) - #define MLXPLAT_CPLD_FU_CAP_MASK GENMASK(1, 0) - #define MLXPLAT_CPLD_PWR_BUTTON_MASK BIT(0) --#define MLXPLAT_CPLD_LATCH_RST_MASK BIT(5) -+#define MLXPLAT_CPLD_LATCH_RST_MASK BIT(6) - #define MLXPLAT_CPLD_THERMAL1_PDB_MASK BIT(3) - #define MLXPLAT_CPLD_THERMAL2_PDB_MASK BIT(4) - #define MLXPLAT_CPLD_INTRUSION_MASK BIT(6) -@@ -2631,7 +2631,7 @@ static struct mlxreg_core_item mlxplat_mlxcpld_l1_switch_events_items[] = { - .reg = MLXPLAT_CPLD_LPC_REG_PWRB_OFFSET, - .mask = MLXPLAT_CPLD_PWR_BUTTON_MASK, - .count = ARRAY_SIZE(mlxplat_mlxcpld_l1_switch_pwr_events_items_data), -- .inversed = 0, -+ .inversed = 1, - .health = false, - }, - { -@@ -2640,7 +2640,7 @@ static struct mlxreg_core_item mlxplat_mlxcpld_l1_switch_events_items[] = { - .reg = MLXPLAT_CPLD_LPC_REG_BRD_OFFSET, - .mask = MLXPLAT_CPLD_L1_CHA_HEALTH_MASK, - .count = ARRAY_SIZE(mlxplat_mlxcpld_l1_switch_health_events_items_data), -- .inversed = 0, -+ .inversed = 1, - .health = false, - .ind = 8, - }, -@@ -3958,7 +3958,7 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { - { - .label = "latch_reset", - .reg = MLXPLAT_CPLD_LPC_REG_GP1_OFFSET, -- .mask = GENMASK(7, 0) & ~BIT(5), -+ .mask = GENMASK(7, 0) & ~BIT(6), - .mode = 0200, - }, - { --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0280-platform-mellanox-mlxreg-hotplug-Extend-condition-fo.patch b/platform/mellanox/non-upstream-patches/patches/0280-platform-mellanox-mlxreg-hotplug-Extend-condition-fo.patch deleted file mode 100644 index 68f8a792dfd5..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0280-platform-mellanox-mlxreg-hotplug-Extend-condition-fo.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 6531f28d37beb20fb423f4835eab47beaaf002bb Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Sun, 19 Mar 2023 15:04:26 +0000 -Subject: [PATCH backport v.5.10 2/3] platform/mellanox: mlxreg-hotplug: Extend - condition for notification callback processing - -Allow processing of notification callback in routine -mlxreg_hotplug_device_create() in case hotplug object is configured -with action "MLXREG_HOTPLUG_DEVICE_NO_ACTION" in case no I2C parent bus -is specified. - -Signed-off-by: Vadim Pasternak -Reviewed-by: Michael Shych ---- - drivers/platform/mellanox/mlxreg-hotplug.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/platform/mellanox/mlxreg-hotplug.c b/drivers/platform/mellanox/mlxreg-hotplug.c -index b7dcc64cd..c5abedd35 100644 ---- a/drivers/platform/mellanox/mlxreg-hotplug.c -+++ b/drivers/platform/mellanox/mlxreg-hotplug.c -@@ -113,7 +113,7 @@ static int mlxreg_hotplug_device_create(struct mlxreg_hotplug_priv_data *priv, - * Return if adapter number is negative. It could be in case hotplug - * event is not associated with hotplug device. - */ -- if (data->hpdev.nr < 0) -+ if (data->hpdev.nr < 0 && data->hpdev.action != MLXREG_HOTPLUG_DEVICE_NO_ACTION) - return 0; - - pdata = dev_get_platdata(&priv->pdev->dev); --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0281-platform-mellanox-mlx-platform-Modify-health-and-pow.patch b/platform/mellanox/non-upstream-patches/patches/0281-platform-mellanox-mlx-platform-Modify-health-and-pow.patch deleted file mode 100644 index f6b38f971250..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0281-platform-mellanox-mlx-platform-Modify-health-and-pow.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 718681c7948f3191fe7ab7cc0a5f96b6454c3a0b Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Sun, 19 Mar 2023 15:36:19 +0000 -Subject: [PATCH backport v.5.10 3/3] platform: mellanox: mlx-platform: Modify - health and power hotplug action - -Set explicitly hotplug event action for health and power signals for -L1 switch as "MLXREG_HOTPLUG_DEVICE_NO_ACTION" in order to allow -processing of notification callback even I2C parent bus is not -specified. - -Signed-off-by: Vadim Pasternak -Reviewed-by: Michael Shych ---- - drivers/platform/mellanox/mlx-platform.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/drivers/platform/mellanox/mlx-platform.c b/drivers/platform/mellanox/mlx-platform.c -index 2bc3720a4..605d57e95 100644 ---- a/drivers/platform/mellanox/mlx-platform.c -+++ b/drivers/platform/mellanox/mlx-platform.c -@@ -2527,6 +2527,7 @@ static struct mlxreg_core_data mlxplat_mlxcpld_l1_switch_pwr_events_items_data[] - .reg = MLXPLAT_CPLD_LPC_REG_PWRB_OFFSET, - .mask = MLXPLAT_CPLD_PWR_BUTTON_MASK, - .hpdev.nr = MLXPLAT_CPLD_NR_NONE, -+ .hpdev.action = MLXREG_HOTPLUG_DEVICE_NO_ACTION, - .hpdev.notifier = &mlxplat_mlxcpld_l1_switch_pwr_events_notifier, - }, - }; -@@ -2587,6 +2588,7 @@ static struct mlxreg_core_data mlxplat_mlxcpld_l1_switch_health_events_items_dat - .reg = MLXPLAT_CPLD_LPC_REG_BRD_OFFSET, - .mask = MLXPLAT_CPLD_INTRUSION_MASK, - .hpdev.nr = MLXPLAT_CPLD_NR_NONE, -+ .hpdev.action = MLXREG_HOTPLUG_DEVICE_NO_ACTION, - .hpdev.notifier = &mlxplat_mlxcpld_l1_switch_intrusion_events_notifier, - }, - { --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0282-platform-mellanox-mlx-platform-add-support-of-5th-CP.patch b/platform/mellanox/non-upstream-patches/patches/0282-platform-mellanox-mlx-platform-add-support-of-5th-CP.patch deleted file mode 100644 index 24f024a822a6..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0282-platform-mellanox-mlx-platform-add-support-of-5th-CP.patch +++ /dev/null @@ -1,129 +0,0 @@ -From b37820018a651f9f8bfe3a9c3fe0e90e49add58b Mon Sep 17 00:00:00 2001 -From: Michael Shych -Date: Tue, 9 May 2023 11:06:39 +0000 -Subject: [PATCH v1 1/1] platform: mellanox: mlx-platform: add support of 5th - CPLD. - -Add 5th CPLD version, PN and minimal version registers. - -Signed-off-by: Michael Shych ---- - drivers/platform/mellanox/mlx-platform.c | 33 ++++++++++++++++++++++++++++++-- - 1 file changed, 31 insertions(+), 2 deletions(-) - -diff --git a/drivers/platform/mellanox/mlx-platform.c b/drivers/platform/mellanox/mlx-platform.c -index 605d57e95..dc6b7ad2c 100644 ---- a/drivers/platform/mellanox/mlx-platform.c -+++ b/drivers/platform/mellanox/mlx-platform.c -@@ -99,6 +99,9 @@ - #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_CPLD5_VER_OFFSET 0x8e -+#define MLXPLAT_CPLD_LPC_REG_CPLD5_PN_OFFSET 0x8f -+#define MLXPLAT_CPLD_LPC_REG_CPLD5_PN1_OFFSET 0x90 - #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 -@@ -133,6 +136,7 @@ - #define MLXPLAT_CPLD_LPC_REG_DBG4_OFFSET 0xb9 - #define MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET 0xc2 - #define MLXPLAT_CPLD_LPC_REG_SPI_CHNL_SELECT 0xc3 -+#define MLXPLAT_CPLD_LPC_REG_CPLD5_MVER_OFFSET 0xc4 - #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 -@@ -3713,6 +3717,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { - .bit = GENMASK(7, 0), - .mode = 0444, - }, -+ { -+ .label = "cpld5_version", -+ .reg = MLXPLAT_CPLD_LPC_REG_CPLD5_VER_OFFSET, -+ .bit = GENMASK(7, 0), -+ .mode = 0444, -+ }, - { - .label = "cpld1_pn", - .reg = MLXPLAT_CPLD_LPC_REG_CPLD1_PN_OFFSET, -@@ -3741,6 +3751,13 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { - .mode = 0444, - .regnum = 2, - }, -+ { -+ .label = "cpld5_pn", -+ .reg = MLXPLAT_CPLD_LPC_REG_CPLD5_PN_OFFSET, -+ .bit = GENMASK(15, 0), -+ .mode = 0444, -+ .regnum = 2, -+ }, - { - .label = "cpld1_version_min", - .reg = MLXPLAT_CPLD_LPC_REG_CPLD1_MVER_OFFSET, -@@ -3765,6 +3782,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { - .bit = GENMASK(7, 0), - .mode = 0444, - }, -+ { -+ .label = "cpld5_version_min", -+ .reg = MLXPLAT_CPLD_LPC_REG_CPLD5_MVER_OFFSET, -+ .bit = GENMASK(7, 0), -+ .mode = 0444, -+ }, - { - .label = "asic_reset", - .reg = MLXPLAT_CPLD_LPC_REG_RESET_GP2_OFFSET, -@@ -5404,6 +5427,7 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_REG_CPLD2_VER_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD3_VER_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD4_VER_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_CPLD5_VER_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD1_PN_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD1_PN1_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD2_PN_OFFSET: -@@ -5412,6 +5436,8 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_REG_CPLD3_PN1_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD4_PN_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD4_PN1_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_CPLD5_PN_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_CPLD5_PN1_OFFSET: - case MLXPLAT_CPLD_LPC_REG_RESET_GP4_OFFSET: - case MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET: - case MLXPLAT_CPLD_LPC_REG_RST_CAUSE1_OFFSET: -@@ -5524,6 +5550,7 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_REG_CPLD2_MVER_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD3_MVER_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD4_MVER_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_CPLD5_MVER_OFFSET: - case MLXPLAT_CPLD_LPC_REG_PWM1_OFFSET: - case MLXPLAT_CPLD_LPC_REG_PWM2_OFFSET: - case MLXPLAT_CPLD_LPC_REG_PWM3_OFFSET: -@@ -5565,14 +5592,15 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_REG_CPLD2_VER_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD3_VER_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD4_VER_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_CPLD5_VER_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD1_PN_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD1_PN1_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD2_PN_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD2_PN1_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD3_PN_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD3_PN1_OFFSET: -- case MLXPLAT_CPLD_LPC_REG_CPLD4_PN_OFFSET: -- case MLXPLAT_CPLD_LPC_REG_CPLD4_PN1_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_CPLD5_PN_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_CPLD5_PN1_OFFSET: - case MLXPLAT_CPLD_LPC_REG_RESET_GP4_OFFSET: - case MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET: - case MLXPLAT_CPLD_LPC_REG_RST_CAUSE1_OFFSET: -@@ -5677,6 +5705,7 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_REG_CPLD2_MVER_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD3_MVER_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD4_MVER_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_CPLD5_MVER_OFFSET: - case MLXPLAT_CPLD_LPC_REG_PWM1_OFFSET: - case MLXPLAT_CPLD_LPC_REG_PWM2_OFFSET: - case MLXPLAT_CPLD_LPC_REG_PWM3_OFFSET: --- -2.14.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0284-platform-mellanox-mlx-platform-fix-CPLD4-PN-report.patch b/platform/mellanox/non-upstream-patches/patches/0284-platform-mellanox-mlx-platform-fix-CPLD4-PN-report.patch deleted file mode 100644 index 72f021eee44a..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0284-platform-mellanox-mlx-platform-fix-CPLD4-PN-report.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 21cafe13f2452a7c41c623dc63af9cbaa301108d Mon Sep 17 00:00:00 2001 -From: Michael Shych -Date: Wed, 28 Jun 2023 12:23:43 +0000 -Subject: [PATCH v1 1/1] platform: mellanox: mlx-platform: fix CPLD4 PN report. - -Add two lines from upstream commits: -[9045512ca6cdb221cd1ed32d483eac3c30c53bed] -[ae1aabf44bd672a07c4fa3ef56f069ed7daa7823] - -Fix PN report of CPLD4. - -Signed-off-by: Michael Shych ---- - drivers/platform/mellanox/mlx-platform.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/drivers/platform/mellanox/mlx-platform.c b/drivers/platform/mellanox/mlx-platform.c -index 00e62366b..641e7fe1f 100644 ---- a/drivers/platform/mellanox/mlx-platform.c -+++ b/drivers/platform/mellanox/mlx-platform.c -@@ -5605,6 +5605,8 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_REG_CPLD2_PN1_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD3_PN_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD3_PN1_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_CPLD4_PN_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_CPLD4_PN1_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD5_PN_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD5_PN1_OFFSET: - case MLXPLAT_CPLD_LPC_REG_RESET_GP4_OFFSET: --- -2.14.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0285-UBUNTU-SAUCE-mlxbf-gige-Fix-intermittent-no-ip-issue.patch b/platform/mellanox/non-upstream-patches/patches/0285-UBUNTU-SAUCE-mlxbf-gige-Fix-intermittent-no-ip-issue.patch new file mode 100644 index 000000000000..90023e1ab3ba --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0285-UBUNTU-SAUCE-mlxbf-gige-Fix-intermittent-no-ip-issue.patch @@ -0,0 +1,85 @@ +From c87bfec5830d104e564d536a2f5ff19f46eabf89 Mon Sep 17 00:00:00 2001 +From: Asmaa Mnebhi +Date: Tue, 28 Feb 2023 18:03:12 -0500 +Subject: [PATCH backport v5.10 30/70] UBUNTU: SAUCE: mlxbf-gige: Fix + intermittent no ip issue + +BugLink: https://bugs.launchpad.net/bugs/2008833 + +During the reboot test, the OOB might not get an ip assigned. +This is due to a race condition between phy_startcall and the +RX DMA being enabled and depends on the amount of background +traffic received by the OOB. Enable the RX DMA after teh phy +is started. + +Signed-off-by: Asmaa Mnebhi +Acked-by: Tim Gardner +Acked-by: Bartlomiej Zolnierkiewicz +Signed-off-by: Bartlomiej Zolnierkiewicz +--- + .../ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c | 14 +++++++------- + .../ethernet/mellanox/mlxbf_gige/mlxbf_gige_rx.c | 6 +++--- + 2 files changed, 10 insertions(+), 10 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c +index e8f9290a8..085240890 100644 +--- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c ++++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c +@@ -147,14 +147,14 @@ static int mlxbf_gige_open(struct net_device *netdev) + */ + priv->valid_polarity = 0; + +- err = mlxbf_gige_rx_init(priv); ++ phy_start(phydev); ++ ++ err = mlxbf_gige_tx_init(priv); + if (err) + goto free_irqs; +- err = mlxbf_gige_tx_init(priv); ++ err = mlxbf_gige_rx_init(priv); + if (err) +- goto rx_deinit; +- +- phy_start(phydev); ++ goto tx_deinit; + + netif_napi_add(netdev, &priv->napi, mlxbf_gige_poll, NAPI_POLL_WEIGHT); + napi_enable(&priv->napi); +@@ -176,8 +176,8 @@ static int mlxbf_gige_open(struct net_device *netdev) + + return 0; + +-rx_deinit: +- mlxbf_gige_rx_deinit(priv); ++tx_deinit: ++ mlxbf_gige_tx_deinit(priv); + + free_irqs: + mlxbf_gige_free_irqs(priv); +diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_rx.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_rx.c +index 96230763c..f21dafde4 100644 +--- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_rx.c ++++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_rx.c +@@ -142,6 +142,9 @@ int mlxbf_gige_rx_init(struct mlxbf_gige *priv) + writeq(MLXBF_GIGE_RX_MAC_FILTER_COUNT_PASS_EN, + priv->base + MLXBF_GIGE_RX_MAC_FILTER_COUNT_PASS); + ++ writeq(ilog2(priv->rx_q_entries), ++ priv->base + MLXBF_GIGE_RX_WQE_SIZE_LOG2); ++ + /* Clear MLXBF_GIGE_INT_MASK 'receive pkt' bit to + * indicate readiness to receive interrupts + */ +@@ -154,9 +157,6 @@ int mlxbf_gige_rx_init(struct mlxbf_gige *priv) + data |= MLXBF_GIGE_RX_DMA_EN; + writeq(data, priv->base + MLXBF_GIGE_RX_DMA); + +- writeq(ilog2(priv->rx_q_entries), +- priv->base + MLXBF_GIGE_RX_WQE_SIZE_LOG2); +- + return 0; + + free_wqe_and_skb: +-- +2.20.1 + diff --git a/platform/mellanox/non-upstream-patches/patches/0286-pinctrl-Introduce-struct-pinfunction-and-PINCTRL_PIN.patch b/platform/mellanox/non-upstream-patches/patches/0286-pinctrl-Introduce-struct-pinfunction-and-PINCTRL_PIN.patch new file mode 100644 index 000000000000..c9ca8fc23f0a --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0286-pinctrl-Introduce-struct-pinfunction-and-PINCTRL_PIN.patch @@ -0,0 +1,60 @@ +From 6f90ee9b22030be2aaa4e753aa9813adbb6c9814 Mon Sep 17 00:00:00 2001 +From: Andy Shevchenko +Date: Mon, 19 Dec 2022 14:42:33 +0200 +Subject: [PATCH 74/77] pinctrl: Introduce struct pinfunction and + PINCTRL_PINFUNCTION() macro +X-NVConfidentiality: public + +BugLink: https://bugs.launchpad.net/bugs/2012743 + +There are many pin control drivers define their own data type for +pin function representation which is the same or embed the same data +as newly introduced one. Provide the data type and convenient macro +for all pin control drivers. + +Signed-off-by: Andy Shevchenko +Reviewed-by: Linus Walleij +Acked-by: Mika Westerberg +(cherry picked from commit 443a0a0f0cf4f432c7af6654b7f2f920d411d379) +Signed-off-by: Asmaa Mnebhi +Acked-by: Tim Gardner +Acked-by: Bartlomiej Zolnierkiewicz +Signed-off-by: Bartlomiej Zolnierkiewicz +--- + include/linux/pinctrl/pinctrl.h | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h +index 2aef59df9..dce7402cd 100644 +--- a/include/linux/pinctrl/pinctrl.h ++++ b/include/linux/pinctrl/pinctrl.h +@@ -186,6 +186,26 @@ extern int pinctrl_get_group_pins(struct pinctrl_dev *pctldev, + const char *pin_group, const unsigned **pins, + unsigned *num_pins); + ++/** ++ * struct pinfunction - Description about a function ++ * @name: Name of the function ++ * @groups: An array of groups for this function ++ * @ngroups: Number of groups in @groups ++ */ ++struct pinfunction { ++ const char *name; ++ const char * const *groups; ++ size_t ngroups; ++}; ++ ++/* Convenience macro to define a single named pinfunction */ ++#define PINCTRL_PINFUNCTION(_name, _groups, _ngroups) \ ++(struct pinfunction) { \ ++ .name = (_name), \ ++ .groups = (_groups), \ ++ .ngroups = (_ngroups), \ ++ } ++ + #if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_PINCTRL) + extern struct pinctrl_dev *of_pinctrl_get(struct device_node *np); + #else +-- +2.14.1 + diff --git a/platform/mellanox/non-upstream-patches/patches/0287-pinctrl-mlxbf3-Add-pinctrl-driver-support.patch b/platform/mellanox/non-upstream-patches/patches/0287-pinctrl-mlxbf3-Add-pinctrl-driver-support.patch new file mode 100644 index 000000000000..0350d311dd87 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0287-pinctrl-mlxbf3-Add-pinctrl-driver-support.patch @@ -0,0 +1,393 @@ +From cbef04cdf39fe364158d0f67053e326c755085ad Mon Sep 17 00:00:00 2001 +From: Asmaa Mnebhi +Date: Wed, 15 Mar 2023 17:50:27 -0400 +Subject: [PATCH 75/77] pinctrl: mlxbf3: Add pinctrl driver support +X-NVConfidentiality: public + +BugLink: https://bugs.launchpad.net/bugs/2012743 + +NVIDIA BlueField-3 SoC has a few pins that can be used as GPIOs +or take the default hardware functionality. Add a driver for +the pin muxing. + +Signed-off-by: Asmaa Mnebhi +Reviewed-by: Andy Shevchenko +Link: https://lore.kernel.org/r/20230315215027.30685-3-asmaa@nvidia.com +Signed-off-by: Linus Walleij +(cherry picked from commit d11f932808dc689717e409bbc81b5093e7902fc9 linux-next) +Signed-off-by: Asmaa Mnebhi +Acked-by: Tim Gardner +Acked-by: Bartlomiej Zolnierkiewicz +Signed-off-by: Bartlomiej Zolnierkiewicz +--- + drivers/pinctrl/Kconfig | 13 ++ + drivers/pinctrl/Makefile | 1 + + drivers/pinctrl/pinctrl-mlxbf3.c | 320 +++++++++++++++++++++++++++++++++++++++ + 3 files changed, 334 insertions(+) + create mode 100644 drivers/pinctrl/pinctrl-mlxbf3.c + +diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig +index 815095326..43dbf5942 100644 +--- a/drivers/pinctrl/Kconfig ++++ b/drivers/pinctrl/Kconfig +@@ -374,6 +374,19 @@ config PINCTRL_OCELOT + select OF_GPIO + select REGMAP_MMIO + ++config PINCTRL_MLXBF3 ++ tristate "NVIDIA BlueField-3 SoC Pinctrl driver" ++ depends on (MELLANOX_PLATFORM && ARM64) || COMPILE_TEST ++ select PINMUX ++ select GPIOLIB ++ select GPIOLIB_IRQCHIP ++ select GPIO_MLXBF3 ++ help ++ Say Y to select the pinctrl driver for BlueField-3 SoCs. ++ This pin controller allows selecting the mux function for ++ each pin. This driver can also be built as a module called ++ pinctrl-mlxbf3. ++ + source "drivers/pinctrl/actions/Kconfig" + source "drivers/pinctrl/aspeed/Kconfig" + source "drivers/pinctrl/bcm/Kconfig" +diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile +index f53933b2f..52c0cdc40 100644 +--- a/drivers/pinctrl/Makefile ++++ b/drivers/pinctrl/Makefile +@@ -25,6 +25,7 @@ obj-$(CONFIG_PINCTRL_MCP23S08_I2C) += pinctrl-mcp23s08_i2c.o + obj-$(CONFIG_PINCTRL_MCP23S08_SPI) += pinctrl-mcp23s08_spi.o + obj-$(CONFIG_PINCTRL_MCP23S08) += pinctrl-mcp23s08.o + obj-$(CONFIG_PINCTRL_MESON) += meson/ ++obj-$(CONFIG_PINCTRL_MLXBF3) += pinctrl-mlxbf3.o + obj-$(CONFIG_PINCTRL_OXNAS) += pinctrl-oxnas.o + obj-$(CONFIG_PINCTRL_PALMAS) += pinctrl-palmas.o + obj-$(CONFIG_PINCTRL_PIC32) += pinctrl-pic32.o +diff --git a/drivers/pinctrl/pinctrl-mlxbf3.c b/drivers/pinctrl/pinctrl-mlxbf3.c +new file mode 100644 +index 000000000..3698f7bbd +--- /dev/null ++++ b/drivers/pinctrl/pinctrl-mlxbf3.c +@@ -0,0 +1,320 @@ ++// SPDX-License-Identifier: GPL-2.0-only or BSD-3-Clause ++/* Copyright (C) 2022 NVIDIA CORPORATION & AFFILIATES */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#define MLXBF3_NGPIOS_GPIO0 32 ++#define MLXBF3_MAX_GPIO_PINS 56 ++ ++enum { ++ MLXBF3_GPIO_HW_MODE, ++ MLXBF3_GPIO_SW_MODE, ++}; ++ ++struct mlxbf3_pinctrl { ++ void __iomem *fw_ctrl_set0; ++ void __iomem *fw_ctrl_clr0; ++ void __iomem *fw_ctrl_set1; ++ void __iomem *fw_ctrl_clr1; ++ struct device *dev; ++ struct pinctrl_dev *pctl; ++ struct pinctrl_gpio_range gpio_range; ++}; ++ ++#define MLXBF3_GPIO_RANGE(_id, _pinbase, _gpiobase, _npins) \ ++ { \ ++ .name = "mlxbf3_gpio_range", \ ++ .id = _id, \ ++ .base = _gpiobase, \ ++ .pin_base = _pinbase, \ ++ .npins = _npins, \ ++ } ++ ++static struct pinctrl_gpio_range mlxbf3_pinctrl_gpio_ranges[] = { ++ MLXBF3_GPIO_RANGE(0, 0, 480, 32), ++ MLXBF3_GPIO_RANGE(1, 32, 456, 24), ++}; ++ ++static const struct pinctrl_pin_desc mlxbf3_pins[] = { ++ PINCTRL_PIN(0, "gpio0"), ++ PINCTRL_PIN(1, "gpio1"), ++ PINCTRL_PIN(2, "gpio2"), ++ PINCTRL_PIN(3, "gpio3"), ++ PINCTRL_PIN(4, "gpio4"), ++ PINCTRL_PIN(5, "gpio5"), ++ PINCTRL_PIN(6, "gpio6"), ++ PINCTRL_PIN(7, "gpio7"), ++ PINCTRL_PIN(8, "gpio8"), ++ PINCTRL_PIN(9, "gpio9"), ++ PINCTRL_PIN(10, "gpio10"), ++ PINCTRL_PIN(11, "gpio11"), ++ PINCTRL_PIN(12, "gpio12"), ++ PINCTRL_PIN(13, "gpio13"), ++ PINCTRL_PIN(14, "gpio14"), ++ PINCTRL_PIN(15, "gpio15"), ++ PINCTRL_PIN(16, "gpio16"), ++ PINCTRL_PIN(17, "gpio17"), ++ PINCTRL_PIN(18, "gpio18"), ++ PINCTRL_PIN(19, "gpio19"), ++ PINCTRL_PIN(20, "gpio20"), ++ PINCTRL_PIN(21, "gpio21"), ++ PINCTRL_PIN(22, "gpio22"), ++ PINCTRL_PIN(23, "gpio23"), ++ PINCTRL_PIN(24, "gpio24"), ++ PINCTRL_PIN(25, "gpio25"), ++ PINCTRL_PIN(26, "gpio26"), ++ PINCTRL_PIN(27, "gpio27"), ++ PINCTRL_PIN(28, "gpio28"), ++ PINCTRL_PIN(29, "gpio29"), ++ PINCTRL_PIN(30, "gpio30"), ++ PINCTRL_PIN(31, "gpio31"), ++ PINCTRL_PIN(32, "gpio32"), ++ PINCTRL_PIN(33, "gpio33"), ++ PINCTRL_PIN(34, "gpio34"), ++ PINCTRL_PIN(35, "gpio35"), ++ PINCTRL_PIN(36, "gpio36"), ++ PINCTRL_PIN(37, "gpio37"), ++ PINCTRL_PIN(38, "gpio38"), ++ PINCTRL_PIN(39, "gpio39"), ++ PINCTRL_PIN(40, "gpio40"), ++ PINCTRL_PIN(41, "gpio41"), ++ PINCTRL_PIN(42, "gpio42"), ++ PINCTRL_PIN(43, "gpio43"), ++ PINCTRL_PIN(44, "gpio44"), ++ PINCTRL_PIN(45, "gpio45"), ++ PINCTRL_PIN(46, "gpio46"), ++ PINCTRL_PIN(47, "gpio47"), ++ PINCTRL_PIN(48, "gpio48"), ++ PINCTRL_PIN(49, "gpio49"), ++ PINCTRL_PIN(50, "gpio50"), ++ PINCTRL_PIN(51, "gpio51"), ++ PINCTRL_PIN(52, "gpio52"), ++ PINCTRL_PIN(53, "gpio53"), ++ PINCTRL_PIN(54, "gpio54"), ++ PINCTRL_PIN(55, "gpio55"), ++}; ++ ++/* ++ * All single-pin functions can be mapped to any GPIO, however pinmux applies ++ * functions to pin groups and only those groups declared as supporting that ++ * function. To make this work we must put each pin in its own dummy group so ++ * that the functions can be described as applying to all pins. ++ * We use the same name as in the datasheet. ++ */ ++static const char * const mlxbf3_pinctrl_single_group_names[] = { ++ "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", ++ "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", "gpio15", ++ "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21", "gpio22", "gpio23", ++ "gpio24", "gpio25", "gpio26", "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", ++ "gpio32", "gpio33", "gpio34", "gpio35", "gpio36", "gpio37", "gpio38", "gpio39", ++ "gpio40", "gpio41", "gpio42", "gpio43", "gpio44", "gpio45", "gpio46", "gpio47", ++ "gpio48", "gpio49", "gpio50", "gpio51", "gpio52", "gpio53", "gpio54", "gpio55", ++}; ++ ++static int mlxbf3_get_groups_count(struct pinctrl_dev *pctldev) ++{ ++ /* Number single-pin groups */ ++ return MLXBF3_MAX_GPIO_PINS; ++} ++ ++static const char *mlxbf3_get_group_name(struct pinctrl_dev *pctldev, ++ unsigned int selector) ++{ ++ return mlxbf3_pinctrl_single_group_names[selector]; ++} ++ ++static int mlxbf3_get_group_pins(struct pinctrl_dev *pctldev, ++ unsigned int selector, ++ const unsigned int **pins, ++ unsigned int *num_pins) ++{ ++ /* return the dummy group for a single pin */ ++ *pins = &selector; ++ *num_pins = 1; ++ ++ return 0; ++} ++ ++static const struct pinctrl_ops mlxbf3_pinctrl_group_ops = { ++ .get_groups_count = mlxbf3_get_groups_count, ++ .get_group_name = mlxbf3_get_group_name, ++ .get_group_pins = mlxbf3_get_group_pins, ++}; ++ ++/* ++ * Only 2 functions are supported and they apply to all pins: ++ * 1) Default hardware functionality ++ * 2) Software controlled GPIO ++ */ ++static const char * const mlxbf3_gpiofunc_group_names[] = { "swctrl" }; ++static const char * const mlxbf3_hwfunc_group_names[] = { "hwctrl" }; ++ ++struct pinfunction mlxbf3_pmx_funcs[] = { ++ PINCTRL_PINFUNCTION("hwfunc", mlxbf3_hwfunc_group_names, 1), ++ PINCTRL_PINFUNCTION("gpiofunc", mlxbf3_gpiofunc_group_names, 1), ++}; ++ ++static int mlxbf3_pmx_get_funcs_count(struct pinctrl_dev *pctldev) ++{ ++ return ARRAY_SIZE(mlxbf3_pmx_funcs); ++} ++ ++static const char *mlxbf3_pmx_get_func_name(struct pinctrl_dev *pctldev, ++ unsigned int selector) ++{ ++ return mlxbf3_pmx_funcs[selector].name; ++} ++ ++static int mlxbf3_pmx_get_groups(struct pinctrl_dev *pctldev, ++ unsigned int selector, ++ const char * const **groups, ++ unsigned int * const num_groups) ++{ ++ *groups = mlxbf3_pmx_funcs[selector].groups; ++ *num_groups = MLXBF3_MAX_GPIO_PINS; ++ ++ return 0; ++} ++ ++static int mlxbf3_pmx_set(struct pinctrl_dev *pctldev, ++ unsigned int selector, ++ unsigned int group) ++{ ++ struct mlxbf3_pinctrl *priv = pinctrl_dev_get_drvdata(pctldev); ++ ++ if (selector == MLXBF3_GPIO_HW_MODE) { ++ if (group < MLXBF3_NGPIOS_GPIO0) ++ writel(BIT(group), priv->fw_ctrl_clr0); ++ else ++ writel(BIT(group % MLXBF3_NGPIOS_GPIO0), priv->fw_ctrl_clr1); ++ } ++ ++ if (selector == MLXBF3_GPIO_SW_MODE) { ++ if (group < MLXBF3_NGPIOS_GPIO0) ++ writel(BIT(group), priv->fw_ctrl_set0); ++ else ++ writel(BIT(group % MLXBF3_NGPIOS_GPIO0), priv->fw_ctrl_set1); ++ } ++ ++ return 0; ++} ++ ++static int mlxbf3_gpio_request_enable(struct pinctrl_dev *pctldev, ++ struct pinctrl_gpio_range *range, ++ unsigned int offset) ++{ ++ struct mlxbf3_pinctrl *priv = pinctrl_dev_get_drvdata(pctldev); ++ ++ if (offset < MLXBF3_NGPIOS_GPIO0) ++ writel(BIT(offset), priv->fw_ctrl_set0); ++ else ++ writel(BIT(offset % MLXBF3_NGPIOS_GPIO0), priv->fw_ctrl_set1); ++ ++ return 0; ++} ++ ++static void mlxbf3_gpio_disable_free(struct pinctrl_dev *pctldev, ++ struct pinctrl_gpio_range *range, ++ unsigned int offset) ++{ ++ struct mlxbf3_pinctrl *priv = pinctrl_dev_get_drvdata(pctldev); ++ ++ /* disable GPIO functionality by giving control back to hardware */ ++ if (offset < MLXBF3_NGPIOS_GPIO0) ++ writel(BIT(offset), priv->fw_ctrl_clr0); ++ else ++ writel(BIT(offset % MLXBF3_NGPIOS_GPIO0), priv->fw_ctrl_clr1); ++} ++ ++static const struct pinmux_ops mlxbf3_pmx_ops = { ++ .get_functions_count = mlxbf3_pmx_get_funcs_count, ++ .get_function_name = mlxbf3_pmx_get_func_name, ++ .get_function_groups = mlxbf3_pmx_get_groups, ++ .set_mux = mlxbf3_pmx_set, ++ .gpio_request_enable = mlxbf3_gpio_request_enable, ++ .gpio_disable_free = mlxbf3_gpio_disable_free, ++}; ++ ++static struct pinctrl_desc mlxbf3_pin_desc = { ++ .name = "pinctrl-mlxbf3", ++ .pins = mlxbf3_pins, ++ .npins = ARRAY_SIZE(mlxbf3_pins), ++ .pctlops = &mlxbf3_pinctrl_group_ops, ++ .pmxops = &mlxbf3_pmx_ops, ++ .owner = THIS_MODULE, ++}; ++ ++static_assert(ARRAY_SIZE(mlxbf3_pinctrl_single_group_names) == MLXBF3_MAX_GPIO_PINS); ++ ++static int mlxbf3_pinctrl_probe(struct platform_device *pdev) ++{ ++ struct device *dev = &pdev->dev; ++ struct mlxbf3_pinctrl *priv; ++ int ret; ++ ++ priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); ++ if (!priv) ++ return -ENOMEM; ++ ++ priv->dev = &pdev->dev; ++ ++ priv->fw_ctrl_set0 = devm_platform_ioremap_resource(pdev, 0); ++ if (IS_ERR(priv->fw_ctrl_set0)) ++ return PTR_ERR(priv->fw_ctrl_set0); ++ ++ priv->fw_ctrl_clr0 = devm_platform_ioremap_resource(pdev, 1); ++ if (IS_ERR(priv->fw_ctrl_set0)) ++ return PTR_ERR(priv->fw_ctrl_set0); ++ ++ priv->fw_ctrl_set1 = devm_platform_ioremap_resource(pdev, 2); ++ if (IS_ERR(priv->fw_ctrl_set0)) ++ return PTR_ERR(priv->fw_ctrl_set0); ++ ++ priv->fw_ctrl_clr1 = devm_platform_ioremap_resource(pdev, 3); ++ if (IS_ERR(priv->fw_ctrl_set0)) ++ return PTR_ERR(priv->fw_ctrl_set0); ++ ++ ret = devm_pinctrl_register_and_init(dev, ++ &mlxbf3_pin_desc, ++ priv, ++ &priv->pctl); ++ if (ret) ++ return dev_err_probe(dev, ret, "Failed to register pinctrl\n"); ++ ++ ret = pinctrl_enable(priv->pctl); ++ if (ret) ++ return dev_err_probe(dev, ret, "Failed to enable pinctrl\n"); ++ ++ pinctrl_add_gpio_ranges(priv->pctl, mlxbf3_pinctrl_gpio_ranges, 2); ++ ++ return 0; ++} ++ ++static const struct acpi_device_id mlxbf3_pinctrl_acpi_ids[] = { ++ { "MLNXBF34", 0 }, ++ {} ++}; ++MODULE_DEVICE_TABLE(acpi, mlxbf3_pinctrl_acpi_ids); ++ ++static struct platform_driver mlxbf3_pinctrl_driver = { ++ .driver = { ++ .name = "pinctrl-mlxbf3", ++ .acpi_match_table = mlxbf3_pinctrl_acpi_ids, ++ }, ++ .probe = mlxbf3_pinctrl_probe, ++}; ++module_platform_driver(mlxbf3_pinctrl_driver); ++ ++MODULE_DESCRIPTION("NVIDIA pinctrl driver"); ++MODULE_AUTHOR("Asmaa Mnebhi "); ++MODULE_LICENSE("Dual BSD/GPL"); +-- +2.14.1 + diff --git a/platform/mellanox/non-upstream-patches/patches/0288-UBUNTU-SAUCE-gpio-mmio-handle-ngpios-properly-in-bgp.patch b/platform/mellanox/non-upstream-patches/patches/0288-UBUNTU-SAUCE-gpio-mmio-handle-ngpios-properly-in-bgp.patch new file mode 100644 index 000000000000..560ab260d602 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0288-UBUNTU-SAUCE-gpio-mmio-handle-ngpios-properly-in-bgp.patch @@ -0,0 +1,125 @@ +From 99a91873f7fe56dcdb4dc68b5a0766b63465ccbb Mon Sep 17 00:00:00 2001 +From: Asmaa Mnebhi +Date: Thu, 30 Mar 2023 12:25:27 -0400 +Subject: [PATCH 76/77] UBUNTU: SAUCE: gpio: mmio: handle "ngpios" properly in + bgpio_init() +X-NVConfidentiality: public + +BugLink: https://bugs.launchpad.net/bugs/2012743 + +bgpio_init() uses "sz" argument to populate ngpio, which is not +accurate. Instead, read the "ngpios" property from the DT and if it +doesn't exist, use the "sz" argument. With this change, drivers no +longer need to overwrite the ngpio variable after calling bgpio_init(). + +This change has already been approved for upstreaming but has not been +integrated into the linux-next branch yet (or any other branch as a matter +of fact). +There are 2 commits involved: +gpio: mmio: handle "ngpios" properly in bgpio_init() - +gpio: mmio: fix calculation of bgpio_bits + +There is no point in separating these 2 commits into 2 SAUCE patches since +they target the same functionality and will be reverted soon anyways to +cherry-pick the linux-next commits. + +Signed-off-by: Asmaa Mnebhi +Acked-by: Tim Gardner +Acked-by: Bartlomiej Zolnierkiewicz +Signed-off-by: Bartlomiej Zolnierkiewicz +--- + drivers/gpio/gpio-mmio.c | 9 ++++++++- + drivers/gpio/gpiolib.c | 34 ++++++++++++++++++++++++++++++++++ + drivers/gpio/gpiolib.h | 1 + + 3 files changed, 43 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpio/gpio-mmio.c b/drivers/gpio/gpio-mmio.c +index c335a0309..ababc4091 100644 +--- a/drivers/gpio/gpio-mmio.c ++++ b/drivers/gpio/gpio-mmio.c +@@ -60,6 +60,8 @@ o ` ~~~~\___/~~~~ ` controller in FPGA is ,.` + #include + #include + ++#include "gpiolib.h" ++ + static void bgpio_write8(void __iomem *reg, unsigned long data) + { + writeb(data, reg); +@@ -614,10 +616,15 @@ int bgpio_init(struct gpio_chip *gc, struct device *dev, + gc->parent = dev; + gc->label = dev_name(dev); + gc->base = -1; +- gc->ngpio = gc->bgpio_bits; + gc->request = bgpio_request; + gc->be_bits = !!(flags & BGPIOF_BIG_ENDIAN); + ++ ret = gpiochip_get_ngpios(gc, dev); ++ if (ret) ++ gc->ngpio = gc->bgpio_bits; ++ else ++ gc->bgpio_bits = roundup_pow_of_two(round_up(gc->ngpio, 8)); ++ + ret = bgpio_setup_io(gc, dat, set, clr, flags); + if (ret) + return ret; +diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c +index 3e01a3ac6..964f27f4d 100644 +--- a/drivers/gpio/gpiolib.c ++++ b/drivers/gpio/gpiolib.c +@@ -550,6 +550,40 @@ static void machine_gpiochip_add(struct gpio_chip *gc) + mutex_unlock(&gpio_machine_hogs_mutex); + } + ++int gpiochip_get_ngpios(struct gpio_chip *gc, struct device *dev) ++{ ++ u32 ngpios = gc->ngpio; ++ int ret; ++ ++ if (ngpios == 0) { ++ ret = device_property_read_u32(dev, "ngpios", &ngpios); ++ if (ret == -ENODATA) ++ /* ++ * -ENODATA means that there is no property found and ++ * we want to issue the error message to the user. ++ * Besides that, we want to return different error code ++ * to state that supplied value is not valid. ++ */ ++ ngpios = 0; ++ else if (ret) ++ return ret; ++ ++ gc->ngpio = ngpios; ++ } ++ ++ if (gc->ngpio == 0) { ++ chip_err(gc, "tried to insert a GPIO chip with zero lines\n"); ++ return -EINVAL; ++ } ++ ++ if (gc->ngpio > FASTPATH_NGPIO) ++ chip_warn(gc, "line cnt %u is greater than fast path cnt %u\n", ++ gc->ngpio, FASTPATH_NGPIO); ++ ++ return 0; ++} ++EXPORT_SYMBOL_GPL(gpiochip_get_ngpios); ++ + static void gpiochip_setup_devs(void) + { + struct gpio_device *gdev; +diff --git a/drivers/gpio/gpiolib.h b/drivers/gpio/gpiolib.h +index b674b5bb9..7c26a0060 100644 +--- a/drivers/gpio/gpiolib.h ++++ b/drivers/gpio/gpiolib.h +@@ -136,6 +136,7 @@ int gpiod_configure_flags(struct gpio_desc *desc, const char *con_id, + unsigned long lflags, enum gpiod_flags dflags); + int gpiod_hog(struct gpio_desc *desc, const char *name, + unsigned long lflags, enum gpiod_flags dflags); ++int gpiochip_get_ngpios(struct gpio_chip *gc, struct device *dev); + + /* + * Return the GPIO number of the passed descriptor relative to its chip +-- +2.14.1 + diff --git a/platform/mellanox/non-upstream-patches/patches/0289-UBUNTU-SAUCE-gpio-mlxbf3-Add-gpio-driver-support.patch b/platform/mellanox/non-upstream-patches/patches/0289-UBUNTU-SAUCE-gpio-mlxbf3-Add-gpio-driver-support.patch new file mode 100644 index 000000000000..c5c2096917af --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0289-UBUNTU-SAUCE-gpio-mlxbf3-Add-gpio-driver-support.patch @@ -0,0 +1,488 @@ +From d189171aa3b9e01b2e2d022f375f999a4a68d525 Mon Sep 17 00:00:00 2001 +From: Asmaa Mnebhi +Date: Thu, 30 Mar 2023 12:38:19 -0400 +Subject: [PATCH 77/77] UBUNTU: SAUCE: gpio: mlxbf3: Add gpio driver support +X-NVConfidentiality: public + +BugLink: https://bugs.launchpad.net/bugs/2012743 + +Add support for the BlueField-3 SoC GPIO driver. +This driver configures and handles GPIO interrupts. It also enables +a user to manipulate certain GPIO pins via libgpiod tools or other kernel drivers. + +The gpio-mlxbf3.c driver has already been approved for upstreaming +but is not yet available for cherry-picking. + +Signed-off-by: Asmaa Mnebhi +Acked-by: Tim Gardner +Acked-by: Bartlomiej Zolnierkiewicz +Signed-off-by: Bartlomiej Zolnierkiewicz +--- + drivers/gpio/Kconfig | 10 +- + drivers/gpio/gpio-mlxbf3.c | 285 +++++++++++++++++---------------------------- + 2 files changed, 116 insertions(+), 179 deletions(-) + +diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig +index bf1b2b787..a31b7ffea 100644 +--- a/drivers/gpio/Kconfig ++++ b/drivers/gpio/Kconfig +@@ -1461,10 +1461,16 @@ config GPIO_MLXBF2 + + config GPIO_MLXBF3 + tristate "Mellanox BlueField 3 SoC GPIO" +- depends on (MELLANOX_PLATFORM && ARM64 && ACPI) || (64BIT && COMPILE_TEST) ++ depends on (MELLANOX_PLATFORM && ARM64) || COMPILE_TEST + select GPIO_GENERIC ++ select GPIOLIB_IRQCHIP + help +- Say Y here if you want GPIO support on Mellanox BlueField 3 SoC. ++ Say Y if you want GPIO support on Mellanox BlueField 3 SoC. ++ This GPIO controller supports interrupt handling and enables the ++ manipulation of certain GPIO pins. ++ This controller should be used in parallel with pinctrl-mlxbf3 to ++ control the desired GPIOs. ++ This driver can also be built as a module called mlxbf3-gpio. + + config GPIO_ML_IOH + tristate "OKI SEMICONDUCTOR ML7213 IOH GPIO support" +diff --git a/drivers/gpio/gpio-mlxbf3.c b/drivers/gpio/gpio-mlxbf3.c +index 45f0946ac..51dce3ae1 100644 +--- a/drivers/gpio/gpio-mlxbf3.c ++++ b/drivers/gpio/gpio-mlxbf3.c +@@ -1,27 +1,20 @@ + // SPDX-License-Identifier: GPL-2.0-only or BSD-3-Clause ++/* Copyright (C) 2021-2023 NVIDIA CORPORATION & AFFILIATES */ + +-/* +- * Copyright (C) 2020-2021 NVIDIA CORPORATION & AFFILIATES +- */ +- +-#include + #include + #include + #include ++#include + #include + #include + #include +-#include +-#include +-#include + #include + #include +-#include +-#include + #include + #include ++#include + +-#define DRV_VERSION "1.0" ++#define DRV_VERSION "2.0" + + /* + * There are 2 YU GPIO blocks: +@@ -33,103 +26,51 @@ + /* + * fw_gpio[x] block registers and their offset + */ +-#define YU_GPIO_FW_CONTROL_SET 0x00 +-#define YU_GPIO_FW_OUTPUT_ENABLE_SET 0x04 +-#define YU_GPIO_FW_DATA_OUT_SET 0x08 +-#define YU_GPIO_FW_CONTROL_CLEAR 0x14 +-#define YU_GPIO_FW_OUTPUT_ENABLE_CLEAR 0x18 +-#define YU_GPIO_FW_DATA_OUT_CLEAR 0x1c +-#define YU_GPIO_CAUSE_RISE_EN 0x28 +-#define YU_GPIO_CAUSE_FALL_EN 0x2c +-#define YU_GPIO_READ_DATA_IN 0x30 +-#define YU_GPIO_READ_OUTPUT_ENABLE 0x34 +-#define YU_GPIO_READ_DATA_OUT 0x38 +-#define YU_GPIO_READ_FW_CONTROL 0x44 +- +-#define YU_GPIO_CAUSE_OR_CAUSE_EVTEN0 0x00 +-#define YU_GPIO_CAUSE_OR_EVTEN0 0x14 +-#define YU_GPIO_CAUSE_OR_CLRCAUSE 0x18 +- +-/* BlueField-3 gpio block context structure. */ ++#define MLXBF_GPIO_FW_OUTPUT_ENABLE_SET 0x00 ++#define MLXBF_GPIO_FW_DATA_OUT_SET 0x04 ++ ++#define MLXBF_GPIO_FW_OUTPUT_ENABLE_CLEAR 0x00 ++#define MLXBF_GPIO_FW_DATA_OUT_CLEAR 0x04 ++ ++#define MLXBF_GPIO_CAUSE_RISE_EN 0x00 ++#define MLXBF_GPIO_CAUSE_FALL_EN 0x04 ++#define MLXBF_GPIO_READ_DATA_IN 0x08 ++ ++#define MLXBF_GPIO_CAUSE_OR_CAUSE_EVTEN0 0x00 ++#define MLXBF_GPIO_CAUSE_OR_EVTEN0 0x14 ++#define MLXBF_GPIO_CAUSE_OR_CLRCAUSE 0x18 ++ + struct mlxbf3_gpio_context { + struct gpio_chip gc; +- struct irq_chip irq_chip; + +- /* YU GPIO blocks address */ ++ /* YU GPIO block address */ ++ void __iomem *gpio_set_io; ++ void __iomem *gpio_clr_io; + void __iomem *gpio_io; + + /* YU GPIO cause block address */ + void __iomem *gpio_cause_io; + +- uint32_t ctrl_gpio_mask; ++ /* Mask of valid gpios that can be accessed by software */ ++ unsigned int valid_mask; + }; + +-static void mlxbf3_gpio_set(struct gpio_chip *chip, unsigned int offset, int val) +-{ +- struct mlxbf3_gpio_context *gs = gpiochip_get_data(chip); +- +- /* Software can only control GPIO pins defined by ctrl_gpio_mask */ +- if (!(BIT(offset) & gs->ctrl_gpio_mask)) +- return; +- +- if (val) { +- writel(BIT(offset), gs->gpio_io + YU_GPIO_FW_DATA_OUT_SET); +- } else { +- writel(BIT(offset), gs->gpio_io + YU_GPIO_FW_DATA_OUT_CLEAR); +- } +- +- wmb(); +- +- /* This needs to be done last to avoid glitches */ +- writel(BIT(offset), gs->gpio_io + YU_GPIO_FW_CONTROL_SET); +-} +- +-static int mlxbf3_gpio_direction_input(struct gpio_chip *chip, +- unsigned int offset) +-{ +- struct mlxbf3_gpio_context *gs = gpiochip_get_data(chip); +- unsigned long flags; +- +- spin_lock_irqsave(&gs->gc.bgpio_lock, flags); +- +- writel(BIT(offset), gs->gpio_io + YU_GPIO_FW_OUTPUT_ENABLE_CLEAR); +- writel(BIT(offset), gs->gpio_io + YU_GPIO_FW_CONTROL_CLEAR); +- +- spin_unlock_irqrestore(&gs->gc.bgpio_lock, flags); +- +- return 0; +-} +- +-static int mlxbf3_gpio_direction_output(struct gpio_chip *chip, +- unsigned int offset, +- int value) +-{ +- struct mlxbf3_gpio_context *gs = gpiochip_get_data(chip); +- unsigned long flags; +- +- spin_lock_irqsave(&gs->gc.bgpio_lock, flags); +- +- writel(BIT(offset), gs->gpio_io + YU_GPIO_FW_OUTPUT_ENABLE_SET); +- +- spin_unlock_irqrestore(&gs->gc.bgpio_lock, flags); +- +- return 0; +-} +- + static void mlxbf3_gpio_irq_enable(struct irq_data *irqd) + { + struct gpio_chip *gc = irq_data_get_irq_chip_data(irqd); + struct mlxbf3_gpio_context *gs = gpiochip_get_data(gc); +- int offset = irqd_to_hwirq(irqd); ++ irq_hw_number_t offset = irqd_to_hwirq(irqd); + unsigned long flags; + u32 val; + ++ gpiochip_enable_irq(gc, offset); ++ + spin_lock_irqsave(&gs->gc.bgpio_lock, flags); +- writel(BIT(offset), gs->gpio_cause_io + YU_GPIO_CAUSE_OR_CLRCAUSE); ++ writel(BIT(offset), gs->gpio_cause_io + MLXBF_GPIO_CAUSE_OR_CLRCAUSE); + +- val = readl(gs->gpio_cause_io + YU_GPIO_CAUSE_OR_EVTEN0); ++ val = readl(gs->gpio_cause_io + MLXBF_GPIO_CAUSE_OR_EVTEN0); + val |= BIT(offset); +- writel(val, gs->gpio_cause_io + YU_GPIO_CAUSE_OR_EVTEN0); ++ writel(val, gs->gpio_cause_io + MLXBF_GPIO_CAUSE_OR_EVTEN0); + spin_unlock_irqrestore(&gs->gc.bgpio_lock, flags); + } + +@@ -137,15 +78,17 @@ static void mlxbf3_gpio_irq_disable(struct irq_data *irqd) + { + struct gpio_chip *gc = irq_data_get_irq_chip_data(irqd); + struct mlxbf3_gpio_context *gs = gpiochip_get_data(gc); +- int offset = irqd_to_hwirq(irqd); ++ irq_hw_number_t offset = irqd_to_hwirq(irqd); + unsigned long flags; + u32 val; + + spin_lock_irqsave(&gs->gc.bgpio_lock, flags); +- val = readl(gs->gpio_cause_io + YU_GPIO_CAUSE_OR_EVTEN0); ++ val = readl(gs->gpio_cause_io + MLXBF_GPIO_CAUSE_OR_EVTEN0); + val &= ~BIT(offset); +- writel(val, gs->gpio_cause_io + YU_GPIO_CAUSE_OR_EVTEN0); ++ writel(val, gs->gpio_cause_io + MLXBF_GPIO_CAUSE_OR_EVTEN0); + spin_unlock_irqrestore(&gs->gc.bgpio_lock, flags); ++ ++ gpiochip_disable_irq(gc, offset); + } + + static irqreturn_t mlxbf3_gpio_irq_handler(int irq, void *ptr) +@@ -155,8 +98,8 @@ static irqreturn_t mlxbf3_gpio_irq_handler(int irq, void *ptr) + unsigned long pending; + u32 level; + +- pending = readl(gs->gpio_cause_io + YU_GPIO_CAUSE_OR_CAUSE_EVTEN0); +- writel(pending, gs->gpio_cause_io + YU_GPIO_CAUSE_OR_CLRCAUSE); ++ pending = readl(gs->gpio_cause_io + MLXBF_GPIO_CAUSE_OR_CAUSE_EVTEN0); ++ writel(pending, gs->gpio_cause_io + MLXBF_GPIO_CAUSE_OR_CLRCAUSE); + + for_each_set_bit(level, &pending, gc->ngpio) { + int gpio_irq = irq_find_mapping(gc->irq.domain, level); +@@ -171,155 +114,145 @@ mlxbf3_gpio_irq_set_type(struct irq_data *irqd, unsigned int type) + { + struct gpio_chip *gc = irq_data_get_irq_chip_data(irqd); + struct mlxbf3_gpio_context *gs = gpiochip_get_data(gc); +- int offset = irqd_to_hwirq(irqd); ++ irq_hw_number_t offset = irqd_to_hwirq(irqd); + unsigned long flags; +- bool fall = false; +- bool rise = false; + u32 val; + ++ spin_lock_irqsave(&gs->gc.bgpio_lock, flags); ++ + switch (type & IRQ_TYPE_SENSE_MASK) { + case IRQ_TYPE_EDGE_BOTH: +- fall = true; +- rise = true; ++ val = readl(gs->gpio_io + MLXBF_GPIO_CAUSE_FALL_EN); ++ val |= BIT(offset); ++ writel(val, gs->gpio_io + MLXBF_GPIO_CAUSE_FALL_EN); ++ val = readl(gs->gpio_io + MLXBF_GPIO_CAUSE_RISE_EN); ++ val |= BIT(offset); ++ writel(val, gs->gpio_io + MLXBF_GPIO_CAUSE_RISE_EN); + break; + case IRQ_TYPE_EDGE_RISING: +- rise = true; ++ val = readl(gs->gpio_io + MLXBF_GPIO_CAUSE_RISE_EN); ++ val |= BIT(offset); ++ writel(val, gs->gpio_io + MLXBF_GPIO_CAUSE_RISE_EN); + break; + case IRQ_TYPE_EDGE_FALLING: +- fall = true; ++ val = readl(gs->gpio_io + MLXBF_GPIO_CAUSE_FALL_EN); ++ val |= BIT(offset); ++ writel(val, gs->gpio_io + MLXBF_GPIO_CAUSE_FALL_EN); + break; + default: ++ spin_unlock_irqrestore(&gs->gc.bgpio_lock, flags); + return -EINVAL; + } + +- spin_lock_irqsave(&gs->gc.bgpio_lock, flags); +- if (fall) { +- val = readl(gs->gpio_io + YU_GPIO_CAUSE_FALL_EN); +- val |= BIT(offset); +- writel(val, gs->gpio_io + YU_GPIO_CAUSE_FALL_EN); +- } +- +- if (rise) { +- val = readl(gs->gpio_io + YU_GPIO_CAUSE_RISE_EN); +- val |= BIT(offset); +- writel(val, gs->gpio_io + YU_GPIO_CAUSE_RISE_EN); +- } + spin_unlock_irqrestore(&gs->gc.bgpio_lock, flags); + ++ irq_set_handler_locked(irqd, handle_edge_irq); ++ + return 0; + } + +-/* BlueField-3 GPIO driver initialization routine. */ +-static int +-mlxbf3_gpio_probe(struct platform_device *pdev) ++/* This function needs to be defined for handle_edge_irq() */ ++static void mlxbf3_gpio_irq_ack(struct irq_data *data) ++{ ++} ++ ++static int mlxbf3_gpio_init_valid_mask(struct gpio_chip *gc, ++ unsigned long *valid_mask, ++ unsigned int ngpios) ++{ ++ struct mlxbf3_gpio_context *gs = gpiochip_get_data(gc); ++ ++ *valid_mask = gs->valid_mask; ++ ++ return 0; ++} ++ ++static struct irq_chip gpio_mlxbf3_irqchip = { ++ .name = "MLNXBF33", ++ .irq_ack = mlxbf3_gpio_irq_ack, ++ .irq_set_type = mlxbf3_gpio_irq_set_type, ++ .irq_enable = mlxbf3_gpio_irq_enable, ++ .irq_disable = mlxbf3_gpio_irq_disable, ++}; ++ ++static int mlxbf3_gpio_probe(struct platform_device *pdev) + { +- struct mlxbf3_gpio_context *gs; + struct device *dev = &pdev->dev; ++ struct mlxbf3_gpio_context *gs; + struct gpio_irq_chip *girq; + struct gpio_chip *gc; +- unsigned int npins; +- const char *name; + int ret, irq; + +- name = dev_name(dev); +- + gs = devm_kzalloc(dev, sizeof(*gs), GFP_KERNEL); + if (!gs) + return -ENOMEM; + +- /* YU GPIO block address */ + gs->gpio_io = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(gs->gpio_io)) + return PTR_ERR(gs->gpio_io); + +- /* YU GPIO block address */ + gs->gpio_cause_io = devm_platform_ioremap_resource(pdev, 1); + if (IS_ERR(gs->gpio_cause_io)) + return PTR_ERR(gs->gpio_cause_io); + +- if (device_property_read_u32(dev, "npins", &npins)) +- npins = MLXBF3_GPIO_MAX_PINS_PER_BLOCK; ++ gs->gpio_set_io = devm_platform_ioremap_resource(pdev, 2); ++ if (IS_ERR(gs->gpio_set_io)) ++ return PTR_ERR(gs->gpio_set_io); + +- if (device_property_read_u32(dev, "ctrl_gpio_mask", &gs->ctrl_gpio_mask)) +- gs->ctrl_gpio_mask = 0x0; ++ gs->gpio_clr_io = devm_platform_ioremap_resource(pdev, 3); ++ if (IS_ERR(gs->gpio_clr_io)) ++ return PTR_ERR(gs->gpio_clr_io); ++ ++ gs->valid_mask = 0x0; ++ device_property_read_u32(dev, "valid_mask", &gs->valid_mask); + + gc = &gs->gc; + +- /* To set the direction to input, just give control to HW by setting +- * YU_GPIO_FW_CONTROL_CLEAR. +- * If the GPIO is controlled by HW, read its value via read_data_in register. +- * +- * When the direction = output, the GPIO is controlled by SW and +- * datain=dataout. If software modifies the value of the GPIO pin, +- * the value can be read from read_data_in without changing the direction. +- */ + ret = bgpio_init(gc, dev, 4, +- gs->gpio_io + YU_GPIO_READ_DATA_IN, +- NULL, +- NULL, +- NULL, +- NULL, +- 0); +- +- gc->set = mlxbf3_gpio_set; +- gc->direction_input = mlxbf3_gpio_direction_input; +- gc->direction_output = mlxbf3_gpio_direction_output; +- +- gc->ngpio = npins; ++ gs->gpio_io + MLXBF_GPIO_READ_DATA_IN, ++ gs->gpio_set_io + MLXBF_GPIO_FW_DATA_OUT_SET, ++ gs->gpio_clr_io + MLXBF_GPIO_FW_DATA_OUT_CLEAR, ++ gs->gpio_set_io + MLXBF_GPIO_FW_OUTPUT_ENABLE_SET, ++ gs->gpio_clr_io + MLXBF_GPIO_FW_OUTPUT_ENABLE_CLEAR, 0); ++ ++ gc->request = gpiochip_generic_request; ++ gc->free = gpiochip_generic_free; + gc->owner = THIS_MODULE; ++ gc->init_valid_mask = mlxbf3_gpio_init_valid_mask; + + irq = platform_get_irq(pdev, 0); + if (irq >= 0) { +- gs->irq_chip.name = name; +- gs->irq_chip.irq_set_type = mlxbf3_gpio_irq_set_type; +- gs->irq_chip.irq_enable = mlxbf3_gpio_irq_enable; +- gs->irq_chip.irq_disable = mlxbf3_gpio_irq_disable; +- + girq = &gs->gc.irq; +- girq->chip = &gs->irq_chip; +- girq->handler = handle_simple_irq; ++ girq->chip = &gpio_mlxbf3_irqchip; + girq->default_type = IRQ_TYPE_NONE; + /* This will let us handle the parent IRQ in the driver */ + girq->num_parents = 0; + girq->parents = NULL; + girq->parent_handler = NULL; ++ girq->handler = handle_bad_irq; + + /* + * Directly request the irq here instead of passing + * a flow-handler because the irq is shared. + */ + ret = devm_request_irq(dev, irq, mlxbf3_gpio_irq_handler, +- IRQF_SHARED, name, gs); +- if (ret) { +- dev_err(dev, "failed to request IRQ"); +- return ret; +- } ++ IRQF_SHARED, dev_name(dev), gs); ++ if (ret) ++ return dev_err_probe(dev, ret, "failed to request IRQ"); + } + + platform_set_drvdata(pdev, gs); + + ret = devm_gpiochip_add_data(dev, &gs->gc, gs); +- if (ret) { +- dev_err(dev, "Failed adding memory mapped gpiochip\n"); +- return ret; +- } +- +- return 0; +-} +- +-static int mlxbf3_gpio_remove(struct platform_device *pdev) +-{ +- struct mlxbf3_gpio_context *gs = platform_get_drvdata(pdev); +- +- /* Set the GPIO control back to HW */ +- writel(gs->ctrl_gpio_mask, gs->gpio_io + YU_GPIO_FW_CONTROL_CLEAR); ++ if (ret) ++ dev_err_probe(dev, ret, "Failed adding memory mapped gpiochip\n"); + + return 0; + } + +-static const struct acpi_device_id __maybe_unused mlxbf3_gpio_acpi_match[] = { ++static const struct acpi_device_id mlxbf3_gpio_acpi_match[] = { + { "MLNXBF33", 0 }, +- {}, ++ {} + }; + MODULE_DEVICE_TABLE(acpi, mlxbf3_gpio_acpi_match); + +@@ -329,12 +262,10 @@ static struct platform_driver mlxbf3_gpio_driver = { + .acpi_match_table = mlxbf3_gpio_acpi_match, + }, + .probe = mlxbf3_gpio_probe, +- .remove = mlxbf3_gpio_remove, + }; +- + module_platform_driver(mlxbf3_gpio_driver); + +-MODULE_DESCRIPTION("Mellanox BlueField-3 GPIO Driver"); ++MODULE_DESCRIPTION("NVIDIA BlueField-3 GPIO Driver"); + MODULE_AUTHOR("Asmaa Mnebhi "); + MODULE_LICENSE("Dual BSD/GPL"); + MODULE_VERSION(DRV_VERSION); +-- +2.14.1 + diff --git a/platform/mellanox/non-upstream-patches/patches/0283-mlxsw-core_hwmon-Align-modules-label-name-assignment.patch b/platform/mellanox/non-upstream-patches/patches/0291-mlxsw-core_hwmon-Align-modules-label-name-assignment.patch similarity index 93% rename from platform/mellanox/non-upstream-patches/patches/0283-mlxsw-core_hwmon-Align-modules-label-name-assignment.patch rename to platform/mellanox/non-upstream-patches/patches/0291-mlxsw-core_hwmon-Align-modules-label-name-assignment.patch index 15d55ab0c345..e19583d193d8 100644 --- a/platform/mellanox/non-upstream-patches/patches/0283-mlxsw-core_hwmon-Align-modules-label-name-assignment.patch +++ b/platform/mellanox/non-upstream-patches/patches/0291-mlxsw-core_hwmon-Align-modules-label-name-assignment.patch @@ -17,8 +17,8 @@ For example, temperatures for module#1, module#2 will be exposed like: front panel 002: +37.0°C (crit = +70.0°C, emerg = +75.0°C) front panel 003: +47.0°C (crit = +70.0°C, emerg = +75.0°C) instead of: -front panel 001: +37.0°C (crit = +70.0°C, emerg = +75.0°C) -front panel 002: +47.0°C (crit = +70.0°C, emerg = +75.0°C) +front panel 002: +37.0°C (crit = +70.0°C, emerg = +75.0°C) +front panel 003: +47.0°C (crit = +70.0°C, emerg = +75.0°C) Set 'index' used in label name according to the 'sensor_count' value. diff --git a/platform/mellanox/non-upstream-patches/patches/0292-mlxsw-i2c-Limit-single-transaction-buffer-size.patch b/platform/mellanox/non-upstream-patches/patches/0292-mlxsw-i2c-Limit-single-transaction-buffer-size.patch new file mode 100644 index 000000000000..1fffd92e5964 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0292-mlxsw-i2c-Limit-single-transaction-buffer-size.patch @@ -0,0 +1,45 @@ +From 3363b3f15f1f65c5b33c464c1bb9d71fc044d3a8 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Thu, 6 Jul 2023 04:51:52 +0000 +Subject: [PATH backport 1/2] mlxsw: i2c: Limit single transaction buffer size + +Maximum size of buffer is obtained from underlying I2C adapter and in +case adapter allows I2C transaction buffer size greater than 100 bytes, +transaction will fail due to firmware limitation. +Limit the maximum size of transaction buffer by 100 bytes to fit to +firmware. + +Fixes: 3029a693beda ("mlxsw: i2c: Allow flexible setting of I2C transactions size") +Signed-off-by: Vadim Pasternak +--- + drivers/net/ethernet/mellanox/mlxsw/i2c.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/i2c.c b/drivers/net/ethernet/mellanox/mlxsw/i2c.c +index e04557afc..9fe03dd9e 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/i2c.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/i2c.c +@@ -48,6 +48,7 @@ + #define MLXSW_I2C_MBOX_SIZE_BITS 12 + #define MLXSW_I2C_ADDR_BUF_SIZE 4 + #define MLXSW_I2C_BLK_DEF 32 ++#define MLXSW_I2C_BLK_MAX 100 + #define MLXSW_I2C_RETRY 5 + #define MLXSW_I2C_TIMEOUT_MSECS 5000 + #define MLXSW_I2C_MAX_DATA_SIZE 256 +@@ -700,9 +701,10 @@ static int mlxsw_i2c_probe(struct i2c_client *client, + return -EOPNOTSUPP; + } + +- mlxsw_i2c->block_size = max_t(u16, MLXSW_I2C_BLK_DEF, ++ mlxsw_i2c->block_size = min_t(u16, MLXSW_I2C_BLK_MAX, ++ max_t(u16, MLXSW_I2C_BLK_DEF, + min_t(u16, quirks->max_read_len, +- quirks->max_write_len)); ++ quirks->max_write_len))); + } else { + mlxsw_i2c->block_size = MLXSW_I2C_BLK_DEF; + } +-- +2.20.1 + diff --git a/platform/mellanox/non-upstream-patches/patches/0293-mlxsw-reg-Limit-MTBR-register-records-buffer-by-one-.patch b/platform/mellanox/non-upstream-patches/patches/0293-mlxsw-reg-Limit-MTBR-register-records-buffer-by-one-.patch new file mode 100644 index 000000000000..ebbdb451d113 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0293-mlxsw-reg-Limit-MTBR-register-records-buffer-by-one-.patch @@ -0,0 +1,33 @@ +From d11192c5d4622552cd399194bf90af03ea2495a5 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Thu, 6 Jul 2023 07:40:34 +0000 +Subject: [PATH backport 2/2] mlxsw: reg: Limit MTBR register records buffer by + one record + +The MTBR register is used to obtain specific cable status, so just only +one data record is required in transaction. + +Limit size of MTBR register to avoid sending redundant size of buffer +to firmware. + +Signed-off-by: Vadim Pasternak +--- + drivers/net/ethernet/mellanox/mlxsw/reg.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h +index f8c828e05..81b4278fc 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h ++++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h +@@ -8771,7 +8771,7 @@ MLXSW_ITEM_BIT_ARRAY(reg, mtwe, sensor_warning, 0x0, 0x10, 1); + #define MLXSW_REG_MTBR_ID 0x900F + #define MLXSW_REG_MTBR_BASE_LEN 0x10 /* base length, without records */ + #define MLXSW_REG_MTBR_REC_LEN 0x04 /* record length */ +-#define MLXSW_REG_MTBR_REC_MAX_COUNT 47 /* firmware limitation */ ++#define MLXSW_REG_MTBR_REC_MAX_COUNT 1 + #define MLXSW_REG_MTBR_LEN (MLXSW_REG_MTBR_BASE_LEN + \ + MLXSW_REG_MTBR_REC_LEN * \ + MLXSW_REG_MTBR_REC_MAX_COUNT) +-- +2.20.1 + diff --git a/platform/mellanox/non-upstream-patches/patches/0296-UBUNTU-SAUCE-mmc-sdhci-of-dwcmshc-Add-runtime-PM-ope.patch b/platform/mellanox/non-upstream-patches/patches/0296-UBUNTU-SAUCE-mmc-sdhci-of-dwcmshc-Add-runtime-PM-ope.patch new file mode 100644 index 000000000000..00f87c6050fa --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0296-UBUNTU-SAUCE-mmc-sdhci-of-dwcmshc-Add-runtime-PM-ope.patch @@ -0,0 +1,159 @@ +From 48ac30096b7a3993f8711c0c3e09a0f06ea9639d Mon Sep 17 00:00:00 2001 +From: Liming Sun +Date: Tue, 4 Apr 2023 19:30:00 -0400 +Subject: [PATCH] UBUNTU: SAUCE: mmc: sdhci-of-dwcmshc: Add runtime PM + operations for BlueField-3 +X-NVConfidentiality: public + +BugLink: https://bugs.launchpad.net/bugs/2015307 + +This commit implements the runtime PM operations For BlueField-3 SoC +to disable eMMC card clock when idle. + +Reviewed-by: Khalil Blaiech +Signed-off-by: Liming Sun +Acked-by: Bartlomiej Zolnierkiewicz +Acked-by: Andrei Gherzan +[bzolnier: use a short URL version for BugLink] +Signed-off-by: Bartlomiej Zolnierkiewicz +--- + drivers/mmc/host/sdhci-of-dwcmshc.c | 102 +++++++++++++++++++++++++++++++++++- + 1 file changed, 101 insertions(+), 1 deletion(-) + +diff --git a/drivers/mmc/host/sdhci-of-dwcmshc.c b/drivers/mmc/host/sdhci-of-dwcmshc.c +index af995dc30..cc6b948d4 100644 +--- a/drivers/mmc/host/sdhci-of-dwcmshc.c ++++ b/drivers/mmc/host/sdhci-of-dwcmshc.c +@@ -16,6 +16,7 @@ + #include + #include + #include ++#include + + #include "sdhci-pltfm.h" + +@@ -72,6 +73,21 @@ struct dwcmshc_priv { + void *priv; /* pointer to SoC private stuff */ + }; + ++/* Last jiffies when entering idle state */ ++static uint64_t idle_last_jiffies; ++ ++/* Total jiffies in idle state */ ++static uint64_t idle_total_jiffies; ++ ++/* Total idle time */ ++static int idle_time; ++module_param(idle_time, int, 0444); ++MODULE_PARM_DESC(idle_time, "idle time (seconds)"); ++ ++/* The current idle state */ ++static int idle_state; ++module_param(idle_state, int, 0444); ++MODULE_PARM_DESC(idle_state, "idle state (0: not idle, 1: idle)"); + /* + * If DMA addr spans 128MB boundary, we split the DMA transfer into two + * so that each DMA transfer doesn't exceed the boundary. +@@ -432,6 +448,7 @@ static int dwcmshc_probe(struct platform_device *pdev) + #ifdef CONFIG_ACPI + if (pltfm_data == &sdhci_dwcmshc_bf3_pdata) { + sdhci_enable_v4_mode(host); ++ pm_runtime_enable(dev); + } + #endif + +@@ -526,7 +543,90 @@ static int dwcmshc_resume(struct device *dev) + } + #endif + +-static SIMPLE_DEV_PM_OPS(dwcmshc_pmops, dwcmshc_suspend, dwcmshc_resume); ++#ifdef CONFIG_PM ++ ++#ifdef CONFIG_ACPI ++static void dwcmshc_enable_card_clk(struct sdhci_host *host) ++{ ++ u16 ctrl; ++ ++ ctrl = sdhci_readw(host, SDHCI_CLOCK_CONTROL); ++ ctrl |= SDHCI_CLOCK_CARD_EN; ++ sdhci_writew(host, ctrl, SDHCI_CLOCK_CONTROL); ++} ++ ++static void dwcmshc_disable_card_clk(struct sdhci_host *host) ++{ ++ u16 ctrl; ++ ++ ctrl = sdhci_readw(host, SDHCI_CLOCK_CONTROL); ++ ctrl &= ~SDHCI_CLOCK_CARD_EN; ++ sdhci_writew(host, ctrl, SDHCI_CLOCK_CONTROL); ++} ++#endif ++ ++static int dwcmshc_runtime_suspend(struct device *dev) ++{ ++ struct sdhci_host *host = dev_get_drvdata(dev); ++ const struct sdhci_pltfm_data *pltfm_data; ++ int ret = 0; ++ ++ pltfm_data = device_get_match_data(dev); ++ if (!pltfm_data) ++ return -ENODEV; ++ ++#ifdef CONFIG_ACPI ++ if (pltfm_data == &sdhci_dwcmshc_bf3_pdata) { ++ ret = sdhci_runtime_suspend_host(host); ++ if (!ret) { ++ dwcmshc_disable_card_clk(host); ++ ++ if (!idle_state) { ++ idle_state = 1; ++ idle_last_jiffies = jiffies; ++ } ++ } ++ } ++#endif ++ ++ return ret; ++} ++ ++static int dwcmshc_runtime_resume(struct device *dev) ++{ ++ struct sdhci_host *host = dev_get_drvdata(dev); ++ const struct sdhci_pltfm_data *pltfm_data; ++ int ret = 0; ++ ++ pltfm_data = device_get_match_data(dev); ++ if (!pltfm_data) ++ return -ENODEV; ++ ++#ifdef CONFIG_ACPI ++ if (pltfm_data == &sdhci_dwcmshc_bf3_pdata) { ++ dwcmshc_enable_card_clk(host); ++ ++ if (idle_state) { ++ idle_state = 0; ++ idle_total_jiffies = jiffies - idle_last_jiffies; ++ idle_time += jiffies_to_msecs( ++ idle_total_jiffies) / 1000; ++ } ++ ++ ret = sdhci_runtime_resume_host(host, 0); ++ } ++#endif ++ ++ return ret; ++} ++ ++#endif ++ ++static const struct dev_pm_ops dwcmshc_pmops = { ++ SET_SYSTEM_SLEEP_PM_OPS(dwcmshc_suspend, dwcmshc_resume) ++ SET_RUNTIME_PM_OPS(dwcmshc_runtime_suspend, ++ dwcmshc_runtime_resume, NULL) ++}; + + static struct platform_driver sdhci_dwcmshc_driver = { + .driver = { +-- +2.14.1 + diff --git a/platform/mellanox/non-upstream-patches/patches/0298-UBUNTU-SAUCE-mlxbf-ptm-use-0444-instead-of-S_IRUGO.patch b/platform/mellanox/non-upstream-patches/patches/0298-UBUNTU-SAUCE-mlxbf-ptm-use-0444-instead-of-S_IRUGO.patch new file mode 100644 index 000000000000..ce0a48ea7e2b --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0298-UBUNTU-SAUCE-mlxbf-ptm-use-0444-instead-of-S_IRUGO.patch @@ -0,0 +1,64 @@ +From 6066741b9491d990cea962e7e56c0d3d4f7bc393 Mon Sep 17 00:00:00 2001 +From: Jitendra Lanka +Date: Wed, 22 Mar 2023 11:39:55 -0400 +Subject: [PATCH] UBUNTU: SAUCE: mlxbf-ptm: use 0444 instead of S_IRUGO +X-NVConfidentiality: public + +BugLink: https://bugs.launchpad.net/bugs/2011738 + +As recommended by checkscript, change S_IRUGO to 0444 + +Signed-off-by: Jitendra Lanka +Acked-by: Tim Gardner +Acked-by: Bartlomiej Zolnierkiewicz +Signed-off-by: Bartlomiej Zolnierkiewicz +--- + drivers/platform/mellanox/mlxbf-ptm.c | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +diff --git a/drivers/platform/mellanox/mlxbf-ptm.c b/drivers/platform/mellanox/mlxbf-ptm.c +index 79c3e2902..aeb68dc42 100644 +--- a/drivers/platform/mellanox/mlxbf-ptm.c ++++ b/drivers/platform/mellanox/mlxbf-ptm.c +@@ -154,27 +154,27 @@ static int __init mlxbf_ptm_init(void) + monitors = debugfs_create_dir("monitors", ptm_root); + status = debugfs_create_dir("status", monitors); + +- debugfs_create_file("vr0_power", S_IRUGO, status, NULL, ++ debugfs_create_file("vr0_power", 0444, status, NULL, + &vr0_power_fops); +- debugfs_create_file("vr1_power", S_IRUGO, status, NULL, ++ debugfs_create_file("vr1_power", 0444, status, NULL, + &vr1_power_fops); +- debugfs_create_file("total_power", S_IRUGO, status, NULL, ++ debugfs_create_file("total_power", 0444, status, NULL, + &total_power_fops); +- debugfs_create_file("ddr_temp", S_IRUGO, status, ++ debugfs_create_file("ddr_temp", 0444, status, + NULL, &ddr_thld_fops); +- debugfs_create_file("core_temp", S_IRUGO, status, ++ debugfs_create_file("core_temp", 0444, status, + NULL, &core_temp_fops); +- debugfs_create_file("power_throttling_event_count", S_IRUGO, status, ++ debugfs_create_file("power_throttling_event_count", 0444, status, + NULL, &pwr_evt_counter_fops); +- debugfs_create_file("thermal_throttling_event_count", S_IRUGO, status, ++ debugfs_create_file("thermal_throttling_event_count", 0444, status, + NULL, &temp_evt_counter_fops); +- debugfs_create_file("throttling_state", S_IRUGO, status, ++ debugfs_create_file("throttling_state", 0444, status, + NULL, &throttling_state_fops); +- debugfs_create_file("power_throttling_state", S_IRUGO, status, ++ debugfs_create_file("power_throttling_state", 0444, status, + NULL, &pthrottling_state_fops); +- debugfs_create_file("thermal_throttling_state", S_IRUGO, status, ++ debugfs_create_file("thermal_throttling_state", 0444, status, + NULL, &tthrottling_state_fops); +- debugfs_create_file("error_state", S_IRUGO, status, ++ debugfs_create_file("error_state", 0444, status, + NULL, &error_status_fops); + + return 0; +-- +2.14.1 + diff --git a/platform/mellanox/non-upstream-patches/patches/0299-UBUNTU-SAUCE-mlxbf-ptm-add-atx-debugfs-nodes.patch b/platform/mellanox/non-upstream-patches/patches/0299-UBUNTU-SAUCE-mlxbf-ptm-add-atx-debugfs-nodes.patch new file mode 100644 index 000000000000..dad2943f0586 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0299-UBUNTU-SAUCE-mlxbf-ptm-add-atx-debugfs-nodes.patch @@ -0,0 +1,83 @@ +From e6e21f6d79e1ccd2a88817c982f8350e5a1dfa92 Mon Sep 17 00:00:00 2001 +From: Jitendra Lanka +Date: Wed, 22 Mar 2023 11:39:56 -0400 +Subject: [PATCH] UBUNTU: SAUCE: mlxbf-ptm: add atx debugfs nodes +X-NVConfidentiality: public + +BugLink: https://bugs.launchpad.net/bugs/2011738 + +Add additional debugfs nodes that provide ATX status and +power profile data. + +Signed-off-by: Jitendra Lanka +Acked-by: Tim Gardner +Acked-by: Bartlomiej Zolnierkiewicz +Signed-off-by: Bartlomiej Zolnierkiewicz +--- + drivers/platform/mellanox/mlxbf-ptm.c | 36 +++++++++++++++++++++++++++++++++++ + 1 file changed, 36 insertions(+) + +diff --git a/drivers/platform/mellanox/mlxbf-ptm.c b/drivers/platform/mellanox/mlxbf-ptm.c +index aeb68dc42..a2845aa57 100644 +--- a/drivers/platform/mellanox/mlxbf-ptm.c ++++ b/drivers/platform/mellanox/mlxbf-ptm.c +@@ -23,6 +23,9 @@ + #define MLNX_PTM_GET_MAX_TEMP 0x82000108 + #define MLNX_PTM_GET_PWR_EVT_CNT 0x82000109 + #define MLNX_PTM_GET_TEMP_EVT_CNT 0x8200010A ++#define MLNX_PTM_GET_POWER_ENVELOPE 0x8200010B ++#define MLNX_PTM_GET_ATX_PWR_STATE 0x8200010C ++#define MLNX_PTM_GET_CUR_PPROFILE 0x8200010D + + #define MLNX_POWER_ERROR 300 + +@@ -142,6 +145,33 @@ static int error_status_show(void *data, u64 *val) + DEFINE_SIMPLE_ATTRIBUTE(error_status_fops, + error_status_show, NULL, "%llu\n"); + ++static int power_envelope_show(void *data, u64 *val) ++{ ++ *val = smc_call0(MLNX_PTM_GET_POWER_ENVELOPE); ++ ++ return 0; ++} ++DEFINE_SIMPLE_ATTRIBUTE(power_envelope_fops, ++ power_envelope_show, NULL, "%llu\n"); ++ ++static int atx_status_show(void *data, u64 *val) ++{ ++ *val = smc_call0(MLNX_PTM_GET_ATX_PWR_STATE); ++ ++ return 0; ++} ++DEFINE_SIMPLE_ATTRIBUTE(atx_status_fops, ++ atx_status_show, NULL, "%lld\n"); ++ ++static int current_pprofile_show(void *data, u64 *val) ++{ ++ *val = smc_call0(MLNX_PTM_GET_CUR_PPROFILE); ++ ++ return 0; ++} ++DEFINE_SIMPLE_ATTRIBUTE(current_pprofile_fops, ++ current_pprofile_show, NULL, "%llu\n"); ++ + + static int __init mlxbf_ptm_init(void) + { +@@ -176,6 +206,12 @@ static int __init mlxbf_ptm_init(void) + NULL, &tthrottling_state_fops); + debugfs_create_file("error_state", 0444, status, + NULL, &error_status_fops); ++ debugfs_create_file("power_envelope", 0444, status, ++ NULL, &power_envelope_fops); ++ debugfs_create_file("atx_power_available", 0444, status, ++ NULL, &atx_status_fops); ++ debugfs_create_file("active_power_profile", 0444, status, ++ NULL, ¤t_pprofile_fops); + + return 0; + } +-- +2.14.1 + diff --git a/platform/mellanox/non-upstream-patches/patches/0300-UBUNTU-SAUCE-mlxbf-ptm-update-module-version.patch b/platform/mellanox/non-upstream-patches/patches/0300-UBUNTU-SAUCE-mlxbf-ptm-update-module-version.patch new file mode 100644 index 000000000000..1ff594df611d --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0300-UBUNTU-SAUCE-mlxbf-ptm-update-module-version.patch @@ -0,0 +1,31 @@ +From 83e12ab298ef4c328ae0b410412abc9c5bf40678 Mon Sep 17 00:00:00 2001 +From: Jitendra Lanka +Date: Wed, 22 Mar 2023 11:39:57 -0400 +Subject: [PATCH] UBUNTU: SAUCE: mlxbf-ptm: update module version +X-NVConfidentiality: public + +BugLink: https://bugs.launchpad.net/bugs/2011738 + +update module version + +Signed-off-by: Jitendra Lanka +Acked-by: Tim Gardner +Acked-by: Bartlomiej Zolnierkiewicz +Signed-off-by: Bartlomiej Zolnierkiewicz +--- + drivers/platform/mellanox/mlxbf-ptm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/platform/mellanox/mlxbf-ptm.c b/drivers/platform/mellanox/mlxbf-ptm.c +index a2845aa57..eb4460cb0 100644 +--- a/drivers/platform/mellanox/mlxbf-ptm.c ++++ b/drivers/platform/mellanox/mlxbf-ptm.c +@@ -227,4 +227,4 @@ module_exit(mlxbf_ptm_exit); + MODULE_AUTHOR("Jitendra Lanka "); + MODULE_DESCRIPTION("Nvidia Bluefield power and thermal debugfs driver"); + MODULE_LICENSE("Dual BSD/GPL"); +-MODULE_VERSION("1.0"); ++MODULE_VERSION("1.1"); +-- +2.14.1 + diff --git a/platform/mellanox/non-upstream-patches/patches/0301-UBUNTU-SAUCE-mlxbf-gige-Fix-kernel-panic-at-shutdown.patch b/platform/mellanox/non-upstream-patches/patches/0301-UBUNTU-SAUCE-mlxbf-gige-Fix-kernel-panic-at-shutdown.patch new file mode 100644 index 000000000000..3f98aa9e723a --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0301-UBUNTU-SAUCE-mlxbf-gige-Fix-kernel-panic-at-shutdown.patch @@ -0,0 +1,48 @@ +From 4da66721a3e397268fd5070080d44399101ef9e9 Mon Sep 17 00:00:00 2001 +From: Asmaa Mnebhi +Date: Fri, 2 Jun 2023 13:04:25 -0400 +Subject: [PATCH] UBUNTU: SAUCE: mlxbf-gige: Fix kernel panic at shutdown +X-NVConfidentiality: public + +BugLink: https://bugs.launchpad.net/bugs/2022370 + +We occasionally see a race condition (once every 350 reboots) where napi is still +running (mlxbf_gige_poll) while a shutdown has been initiated through "reboot". +Since mlxbf_gige_poll is still running, it tries to access a NULL pointer and as +a result causes a kernel panic. + +The fix is to explicitly disable napi and dequeue it during shutdown. +mlxbf_gige_remove already calls: +unregister_netdev->unregister_netdevice->unregister_netdev_queue-> +rollback_registered->rollback_registered_many->dev_close_many-> +__dev_close_many->ndo_stop->mlxbf_gige_stop which stops napi + +So use mlxbf_gige_remove in place of the existing shutdown logic. + +Signed-off-by: Asmaa Mnebhi +Acked-by: Bartlomiej Zolnierkiewicz +Acked-by: Tim Gardner +Signed-off-by: Bartlomiej Zolnierkiewicz +--- + drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c +index 602260f2b..b7c1a10c4 100644 +--- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c ++++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c +@@ -500,10 +500,7 @@ static int mlxbf_gige_remove(struct platform_device *pdev) + + static void mlxbf_gige_shutdown(struct platform_device *pdev) + { +- struct mlxbf_gige *priv = platform_get_drvdata(pdev); +- +- writeq(0, priv->base + MLXBF_GIGE_INT_EN); +- mlxbf_gige_clean_port(priv); ++ mlxbf_gige_remove(pdev); + } + + static const struct acpi_device_id __maybe_unused mlxbf_gige_acpi_match[] = { +-- +2.14.1 + diff --git a/platform/mellanox/non-upstream-patches/patches/0302-UBUNTU-SAUCE-mlxbf-bootctl-support-SMC-call-for-sett.patch b/platform/mellanox/non-upstream-patches/patches/0302-UBUNTU-SAUCE-mlxbf-bootctl-support-SMC-call-for-sett.patch new file mode 100644 index 000000000000..e2aae0c0d4f2 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0302-UBUNTU-SAUCE-mlxbf-bootctl-support-SMC-call-for-sett.patch @@ -0,0 +1,94 @@ +From 76ed90858f09e7be6601053d0654872ab0018379 Mon Sep 17 00:00:00 2001 +From: Asmaa Mnebhi +Date: Thu, 30 Mar 2023 14:42:33 -0400 +Subject: [PATCH] UBUNTU: SAUCE: mlxbf-bootctl: support SMC call for setting + ARM boot state +X-NVConfidentiality: public + +BugLink: https://bugs.launchpad.net/bugs/2013383 + +Add a new SMC call which allows setting the ARM boot progress state to "OS is up". + +Signed-off-by: Asmaa Mnebhi +Acked-by: Tim Gardner +Acked-by: Bartlomiej Zolnierkiewicz +Signed-off-by: Bartlomiej Zolnierkiewicz +--- + drivers/platform/mellanox/mlxbf-bootctl.c | 23 +++++++++++++++++++++++ + drivers/platform/mellanox/mlxbf-bootctl.h | 5 +++++ + 2 files changed, 28 insertions(+) + +diff --git a/drivers/platform/mellanox/mlxbf-bootctl.c b/drivers/platform/mellanox/mlxbf-bootctl.c +index e8877a19d..a68bf5b27 100644 +--- a/drivers/platform/mellanox/mlxbf-bootctl.c ++++ b/drivers/platform/mellanox/mlxbf-bootctl.c +@@ -105,6 +105,7 @@ enum { + /* This mutex is used to serialize MFG write and lock operations. */ + static DEFINE_MUTEX(mfg_ops_lock); + static DEFINE_MUTEX(icm_ops_lock); ++static DEFINE_MUTEX(os_up_lock); + + #define MLNX_MFG_OOB_MAC_LEN ETH_ALEN + #define MLNX_MFG_OPN_VAL_LEN 24 +@@ -747,6 +748,26 @@ static ssize_t mfg_lock_store(struct device_driver *drv, const char *buf, + return count; + } + ++static ssize_t os_up_store(struct device_driver *drv, const char *buf, ++ size_t count) ++{ ++ unsigned long val; ++ int err; ++ ++ err = kstrtoul(buf, 10, &val); ++ if (err) ++ return err; ++ ++ if (val != 1) ++ return -EINVAL; ++ ++ mutex_lock(&os_up_lock); ++ smc_call0(MLNX_HANDLE_OS_UP); ++ mutex_unlock(&os_up_lock); ++ ++ return count; ++} ++ + /* Log header format. */ + #define RSH_LOG_TYPE_SHIFT 56 + #define RSH_LOG_LEN_SHIFT 48 +@@ -1209,6 +1230,7 @@ static DRIVER_ATTR_RW(rev); + static DRIVER_ATTR_WO(mfg_lock); + static DRIVER_ATTR_RW(rsh_log); + static DRIVER_ATTR_RW(large_icm); ++static DRIVER_ATTR_WO(os_up); + + static struct attribute *mbc_dev_attrs[] = { + &driver_attr_post_reset_wdog.attr, +@@ -1227,6 +1249,7 @@ static struct attribute *mbc_dev_attrs[] = { + &driver_attr_mfg_lock.attr, + &driver_attr_rsh_log.attr, + &driver_attr_large_icm.attr, ++ &driver_attr_os_up.attr, + NULL + }; + +diff --git a/drivers/platform/mellanox/mlxbf-bootctl.h b/drivers/platform/mellanox/mlxbf-bootctl.h +index c70204770..dc73f7e88 100644 +--- a/drivers/platform/mellanox/mlxbf-bootctl.h ++++ b/drivers/platform/mellanox/mlxbf-bootctl.h +@@ -102,6 +102,11 @@ + #define MLNX_HANDLE_SET_ICM_INFO 0x82000012 + #define MLNX_HANDLE_GET_ICM_INFO 0x82000013 + ++/* ++ * SMC function ID to set the ARM boot state to up ++ */ ++#define MLNX_HANDLE_OS_UP 0x82000014 ++ + #define MAX_ICM_BUFFER_SIZE 10 + + /* SMC function IDs for SiP Service queries */ +-- +2.14.1 + diff --git a/platform/mellanox/non-upstream-patches/patches/0303-UBUNTU-SAUCE-Add-BF3-related-ACPI-config-and-Ring-de.patch b/platform/mellanox/non-upstream-patches/patches/0303-UBUNTU-SAUCE-Add-BF3-related-ACPI-config-and-Ring-de.patch new file mode 100644 index 000000000000..d73e70262a2a --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0303-UBUNTU-SAUCE-Add-BF3-related-ACPI-config-and-Ring-de.patch @@ -0,0 +1,135 @@ +From 8660928fa01c363f1aa826d392de2c6ef4924dcf Mon Sep 17 00:00:00 2001 +From: Shih-Yi Chen +Date: Wed, 5 Apr 2023 14:41:27 -0400 +Subject: [PATCH] UBUNTU: SAUCE: Add BF3 related ACPI config and Ring device + creation code +X-NVConfidentiality: public + +BugLink: https://bugs.launchpad.net/bugs/2015292 + +Fixed Missing ACPI device info in mlxbf_pka module. Added configuration info +and associated code to provision PKA ring devices. + +Signed-off-by: Shih-Yi Chen +Reviewed-by: Khalil Blaiech +Acked-by: Bartlomiej Zolnierkiewicz +Acked-by: Andrei Gherzan +Signed-off-by: Bartlomiej Zolnierkiewicz +--- + .../platform/mellanox/mlxbf_pka/mlxbf_pka_config.h | 9 ++++++--- + .../platform/mellanox/mlxbf_pka/mlxbf_pka_drv.c | 23 +++++++++++++++++++--- + 2 files changed, 26 insertions(+), 6 deletions(-) + +diff --git a/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_config.h b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_config.h +index 5b69d55be..c9543416b 100644 +--- a/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_config.h ++++ b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_config.h +@@ -37,7 +37,7 @@ + #include "mlxbf_pka_addrs.h" + + // The maximum number of PKA shims refered to as IO blocks. +-#define PKA_MAX_NUM_IO_BLOCKS 8 ++#define PKA_MAX_NUM_IO_BLOCKS 24 + // The maximum number of Rings supported by IO block (shim). + #define PKA_MAX_NUM_IO_BLOCK_RINGS 4 + +@@ -72,8 +72,11 @@ + #define PKA_WINDOW_RAM_RING_MEM_SIZE 0x0800 // 2KB + #define PKA_WINDOW_RAM_DATA_MEM_SIZE 0x3800 // 14KB + +-// Offset mask, common to both Window and Alternate Window RAM. +-#define PKA_WINDOW_RAM_OFFSET_MASK1 0x730000 ++// Window RAM/Alternate Window RAM offset mask for BF1 and BF2 ++#define PKA_WINDOW_RAM_OFFSET_MASK1 0x730000 ++// ++// Window RAM/Alternate Window RAM offset mask for BF3 ++#define PKA_WINDOW_RAM_OFFSET_MASK2 0x70000 + + // Macro for mapping PKA Ring address into Window RAM address. It converts the + // ring address, either physical address or virtual address, to valid address +diff --git a/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_drv.c b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_drv.c +index 9e26ccf21..6b171b2a6 100644 +--- a/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_drv.c ++++ b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_drv.c +@@ -34,6 +34,9 @@ + #define PKA_DEVICE_ACPIHID_BF2 "MLNXBF20" + #define PKA_RING_DEVICE_ACPIHID_BF2 "MLNXBF21" + ++#define PKA_DEVICE_ACPIHID_BF3 "MLNXBF51" ++#define PKA_RING_DEVICE_ACPIHID_BF3 "MLNXBF52" ++ + #define PKA_DEVICE_ACCESS_MODE 0666 + + #define PKA_DEVICE_RES_CNT 7 +@@ -49,7 +52,8 @@ enum pka_mem_res_idx { + + enum pka_plat_type { + PKA_PLAT_TYPE_BF1 = 0, /* Platform type Bluefield-1 */ +- PKA_PLAT_TYPE_BF2 /* Platform type Bluefield-2 */ ++ PKA_PLAT_TYPE_BF2, /* Platform type Bluefield-2 */ ++ PKA_PLAT_TYPE_BF3 /* Platform type Bluefield-3 */ + }; + + static DEFINE_MUTEX(pka_drv_lock); +@@ -66,6 +70,9 @@ const char pka_ring_acpihid_bf1[] = PKA_RING_DEVICE_ACPIHID_BF1; + const char pka_acpihid_bf2[] = PKA_DEVICE_ACPIHID_BF2; + const char pka_ring_acpihid_bf2[] = PKA_RING_DEVICE_ACPIHID_BF2; + ++const char pka_acpihid_bf3[] = PKA_DEVICE_ACPIHID_BF3; ++const char pka_ring_acpihid_bf3[] = PKA_RING_DEVICE_ACPIHID_BF3; ++ + struct pka_drv_plat_info { + enum pka_plat_type type; + uint8_t fw_id; +@@ -79,6 +86,10 @@ static struct pka_drv_plat_info pka_drv_plat[] = { + [PKA_PLAT_TYPE_BF2] = { + .type = PKA_PLAT_TYPE_BF2, + .fw_id = PKA_FIRMWARE_IMAGE_2_ID ++ }, ++ [PKA_PLAT_TYPE_BF3] = { ++ .type = PKA_PLAT_TYPE_BF3, ++ .fw_id = PKA_FIRMWARE_IMAGE_2_ID + } + }; + +@@ -87,6 +98,8 @@ static const struct acpi_device_id pka_drv_acpi_ids[] = { + { PKA_RING_DEVICE_ACPIHID_BF1, 0 }, + { PKA_DEVICE_ACPIHID_BF2, (kernel_ulong_t)&pka_drv_plat[PKA_PLAT_TYPE_BF2] }, + { PKA_RING_DEVICE_ACPIHID_BF2, 0 }, ++ { PKA_DEVICE_ACPIHID_BF3, (kernel_ulong_t)&pka_drv_plat[PKA_PLAT_TYPE_BF3] }, ++ { PKA_RING_DEVICE_ACPIHID_BF3, 0 }, + {}, + }; + +@@ -967,6 +980,8 @@ static int pka_drv_probe_device(struct pka_info *info) + plat_info = (struct pka_drv_plat_info *)aid->driver_data; + if (plat_info->type <= PKA_PLAT_TYPE_BF2) { + wndw_ram_off_mask = PKA_WINDOW_RAM_OFFSET_MASK1; ++ } else if (plat_info->type <= PKA_PLAT_TYPE_BF3) { ++ wndw_ram_off_mask = PKA_WINDOW_RAM_OFFSET_MASK2; + } else { + PKA_ERROR(PKA_DRIVER, "Invalid platform type: %d\n", + (int)plat_info->type); +@@ -1210,7 +1225,8 @@ static int pka_drv_acpi_probe(struct platform_device *pdev, + return -EINVAL; + + if (!strcmp(info->acpihid, pka_ring_acpihid_bf1) +- || !strcmp(info->acpihid, pka_ring_acpihid_bf2)) { ++ || !strcmp(info->acpihid, pka_ring_acpihid_bf2) ++ || !strcmp(info->acpihid, pka_ring_acpihid_bf3)) { + error = pka_drv_probe_ring_device(info); + if (error) { + PKA_DEBUG(PKA_DRIVER, +@@ -1222,7 +1238,8 @@ static int pka_drv_acpi_probe(struct platform_device *pdev, + pdev->name); + + } else if (!strcmp(info->acpihid, pka_acpihid_bf1) +- || !strcmp(info->acpihid, pka_acpihid_bf2)) { ++ || !strcmp(info->acpihid, pka_acpihid_bf2) ++ || !strcmp(info->acpihid, pka_acpihid_bf3)) { + error = pka_drv_probe_device(info); + if (error) { + PKA_DEBUG(PKA_DRIVER, +-- +2.14.1 + diff --git a/platform/mellanox/non-upstream-patches/patches/0306-dt-bindings-trivial-devices-Add-infineon-xdpe1a2g7.patch b/platform/mellanox/non-upstream-patches/patches/0306-dt-bindings-trivial-devices-Add-infineon-xdpe1a2g7.patch new file mode 100644 index 000000000000..509520e0997f --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0306-dt-bindings-trivial-devices-Add-infineon-xdpe1a2g7.patch @@ -0,0 +1,29 @@ +From 752f09e963ed92cf6ba69930a26dc4cba674bdd3 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Mon, 17 Jul 2023 16:24:58 +0000 +Subject: [PATCH hwmon-next 2/2] dt-bindings: trivial-devices: Add + infineon,xdpe1a2g7 + +Add new Infineon Multi-phase Digital VR Controller xdpe1a2g7 + +Signed-off-by: Vadim Pasternak +--- + Documentation/devicetree/bindings/trivial-devices.yaml | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml +index adec3a0f6..aa1fa8414 100644 +--- a/Documentation/devicetree/bindings/trivial-devices.yaml ++++ b/Documentation/devicetree/bindings/trivial-devices.yaml +@@ -98,6 +98,8 @@ properties: + - infineon,slb9645tt + # Infineon TLV493D-A1B6 I2C 3D Magnetic Sensor + - infineon,tlv493d-a1b6 ++ # Infineon Multi-phase Digital VR Controller xdpe1a2g7 ++ - infineon,xdpe1a2g7 + # Infineon Multi-phase Digital VR Controller xdpe12254 + - infineon,xdpe12254 + # Infineon Multi-phase Digital VR Controller xdpe12284 +-- +2.20.1 + diff --git a/platform/mellanox/non-upstream-patches/patches/0307-leds-mlxreg-Add-support-for-new-flavour-of-capabilit.patch b/platform/mellanox/non-upstream-patches/patches/0307-leds-mlxreg-Add-support-for-new-flavour-of-capabilit.patch new file mode 100644 index 000000000000..5ef9bf48369d --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0307-leds-mlxreg-Add-support-for-new-flavour-of-capabilit.patch @@ -0,0 +1,53 @@ +From 6f745b2a6cfd48e1e5ab0276665ac1583df263d2 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Thu, 20 Jul 2023 11:01:56 +0000 +Subject: [PATCH] leds: mlxreg: Add support for new flavour of capability + register +X-NVConfidentiality: public + +LED platform data is common across the various systems, while LED +driver should be able to apply only the LED instances relevant +to specific system. + +For example, platform data might contain descriptions for fan1, +fan2, ..., fan{n} LEDs, while some systems equipped with all 'n' fan +LEDs, others with less. + +For detection of the real number of equipped LEDs special capability +register is used. +This register used to indicate presence of LED through the bitmap. + +For some new big modular systems this register will provide presence +data by counter. + +Use slot parameter to distinct whether capability register contains +bitmask or counter. + +Signed-off-by: Vadim Pasternak +--- + drivers/leds/leds-mlxreg.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/drivers/leds/leds-mlxreg.c b/drivers/leds/leds-mlxreg.c +index 6241a3407..e6b205d31 100644 +--- a/drivers/leds/leds-mlxreg.c ++++ b/drivers/leds/leds-mlxreg.c +@@ -243,7 +243,14 @@ static int mlxreg_led_config(struct mlxreg_led_priv_data *priv) + dev_err(&priv->pdev->dev, "Failed to query capability register\n"); + return err; + } +- if (!(regval & data->bit)) ++ /* ++ * If slot is specified - validate if slot is equipped on system. ++ * In case slot is specified in platform data, capability register ++ * contains the counter of untits. ++ */ ++ if (data->slot && data->slot > regval) ++ continue; ++ else if (!(regval & data->bit) && !data->slot) + continue; + /* + * Field "bit" can contain one capability bit in 0 byte +-- +2.14.1 + diff --git a/platform/mellanox/non-upstream-patches/patches/0308-leds-mlxreg-Remove-code-for-amber-LED-colour.patch b/platform/mellanox/non-upstream-patches/patches/0308-leds-mlxreg-Remove-code-for-amber-LED-colour.patch new file mode 100644 index 000000000000..690c44b07349 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0308-leds-mlxreg-Remove-code-for-amber-LED-colour.patch @@ -0,0 +1,50 @@ +From 76dc17f264b5d1530f110187220923dc8f7db0a4 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Sun, 23 Jul 2023 10:07:15 +0000 +Subject: [PATCH backport 5.10.179 2/2] leds: mlxreg: Remove code for amber LED + colour + +Remove unused code for amber LED colour. + +In case system LED color is "green", "orange" or "amber" same code is +to be used for colour setting. + +Signed-off-by: Vadim Pasternak +--- + drivers/leds/leds-mlxreg.c | 10 ++-------- + 1 file changed, 2 insertions(+), 8 deletions(-) + +diff --git a/drivers/leds/leds-mlxreg.c b/drivers/leds/leds-mlxreg.c +index e6b205d31..26039e187 100644 +--- a/drivers/leds/leds-mlxreg.c ++++ b/drivers/leds/leds-mlxreg.c +@@ -22,7 +22,6 @@ + #define MLXREG_LED_RED_SOLID 0x05 /* Solid red or orange */ + #define MLXREG_LED_GREEN_SOLID_HW 0x09 /* Solid green by hardware */ + #define MLXREG_LED_GREEN_SOLID 0x0D /* Solid green */ +-#define MLXREG_LED_AMBER_SOLID 0x09 /* Solid amber */ + #define MLXREG_LED_BLINK_3HZ 167 /* ~167 msec off/on - HW support */ + #define MLXREG_LED_BLINK_6HZ 83 /* ~83 msec off/on - HW support */ + #define MLXREG_LED_CAPABILITY_CLEAR GENMASK(31, 8) /* Clear mask */ +@@ -262,16 +261,11 @@ static int mlxreg_led_config(struct mlxreg_led_priv_data *priv) + + led_cdev = &led_data->led_cdev; + led_data->data_parent = priv; +- if (strstr(data->label, "red")) { +- brightness = LED_OFF; +- led_data->base_color = MLXREG_LED_RED_SOLID; +- } else if (strstr(data->label, "orange")) { ++ if (strstr(data->label, "red") || strstr(data->label, "orange") || ++ strstr(data->label, "amber")) { + brightness = LED_OFF; + led_data->base_color = MLXREG_LED_RED_SOLID; + led_data->base_color_hw = MLXREG_LED_RED_SOLID_HW; +- } else if (strstr(data->label, "amber")) { +- brightness = LED_OFF; +- led_data->base_color = MLXREG_LED_AMBER_SOLID; + } else { + brightness = LED_OFF; + led_data->base_color = MLXREG_LED_GREEN_SOLID; +-- +2.20.1 + diff --git a/platform/mellanox/non-upstream-patches/patches/0308-platform_data-mlxreg-Add-capability-bit-and-mask-fie.patch b/platform/mellanox/non-upstream-patches/patches/0308-platform_data-mlxreg-Add-capability-bit-and-mask-fie.patch new file mode 100644 index 000000000000..dee10dc70a37 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0308-platform_data-mlxreg-Add-capability-bit-and-mask-fie.patch @@ -0,0 +1,60 @@ +From 3abc15462d81d65a70734cebbca3f0a4f35a7328 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Thu, 24 Aug 2023 13:20:54 +0000 +Subject: [PATCH] platform_data/mlxreg: Add capability bit and mask fields +X-NVConfidentiality: public + +Some 'capability' registers can be shared between different resources. +Add new fields 'capability_bit' and 'capability_mask' to structs +'mlxreg_core_data' and and 'mlxreg_core_item' for getting only relevant +capability bits. + +Signed-off-by: Vadim Pasternak +Reviewed-by: Felix Radensky +--- + include/linux/platform_data/mlxreg.h | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/include/linux/platform_data/mlxreg.h b/include/linux/platform_data/mlxreg.h +index 0b9f81a6f..d9f679752 100644 +--- a/include/linux/platform_data/mlxreg.h ++++ b/include/linux/platform_data/mlxreg.h +@@ -118,6 +118,8 @@ struct mlxreg_hotplug_device { + * @mask: attribute access mask; + * @bit: attribute effective bit; + * @capability: attribute capability register; ++ * @capability_bit: started bit in attribute capability register; ++ * @capability_mask: mask in attribute capability register; + * @reg_prsnt: attribute presence register; + * @reg_sync: attribute synch register; + * @reg_pwr: attribute power register; +@@ -138,6 +140,8 @@ struct mlxreg_core_data { + u32 mask; + u32 bit; + u32 capability; ++ u32 capability_bit; ++ u32 capability_mask; + u32 reg_prsnt; + u32 reg_sync; + u32 reg_pwr; +@@ -162,6 +166,8 @@ struct mlxreg_core_data { + * @reg: group interrupt status register; + * @mask: group interrupt mask; + * @capability: group capability register; ++ * @capability_bit: started bit in attribute capability register; ++ * @capability_mask: mask in attribute capability register; + * @cache: last status value for elements fro the same group; + * @count: number of available elements in the group; + * @ind: element's index inside the group; +@@ -175,6 +181,8 @@ struct mlxreg_core_item { + u32 reg; + u32 mask; + u32 capability; ++ u32 capability_bit; ++ u32 capability_mask; + u32 cache; + u8 count; + u8 ind; +-- +2.14.1 + diff --git a/platform/mellanox/non-upstream-patches/patches/0309-hwmon-mlxreg-fan-Add-support-for-new-flavour-of-capa.patch b/platform/mellanox/non-upstream-patches/patches/0309-hwmon-mlxreg-fan-Add-support-for-new-flavour-of-capa.patch new file mode 100644 index 000000000000..acf9c1730cda --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0309-hwmon-mlxreg-fan-Add-support-for-new-flavour-of-capa.patch @@ -0,0 +1,101 @@ +From 582264258aa3e95f87e33221ff9026899e02d529 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Sun, 23 Jul 2023 06:26:09 +0000 +Subject: [PATCH] hwmon: (mlxreg-fan) Add support for new flavour of capability + register +X-NVConfidentiality: public + +FAN platform data is common across the various systems, while fan +driver should be able to apply only the fan instances relevant +to specific system. + +For example, platform data might contain descriptions for fan1, +fan2, ..., fan{n}, while some systems equipped with all 'n' fans, +others with less. +Also, on some systems fan drawer can be equipped with several +tachometers and on others only with one. + +For detection of the real number of equipped drawers and tachometers +special capability registers are used. +These registers used to indicate presence of drawers and tachometers +through the bitmap. + +For some new big modular systems this register will provide presence +data by counter. + +Use slot parameter to distinct whether capability register contains +bitmask or counter. + +Signed-off-by: Vadim Pasternak +--- + drivers/hwmon/mlxreg-fan.c | 19 ++++++++++++++++--- + 1 file changed, 16 insertions(+), 3 deletions(-) + +diff --git a/drivers/hwmon/mlxreg-fan.c b/drivers/hwmon/mlxreg-fan.c +index acba9d688..c0b42821f 100644 +--- a/drivers/hwmon/mlxreg-fan.c ++++ b/drivers/hwmon/mlxreg-fan.c +@@ -72,12 +72,14 @@ struct mlxreg_fan; + * @reg: register offset; + * @mask: fault mask; + * @prsnt: present register offset; ++ * @shift: tacho presence bit shift; + */ + struct mlxreg_fan_tacho { + bool connected; + u32 reg; + u32 mask; + u32 prsnt; ++ u32 shift; + }; + + /* +@@ -146,8 +148,10 @@ mlxreg_fan_read(struct device *dev, enum hwmon_sensor_types type, u32 attr, + /* + * Map channel to presence bit - drawer can be equipped with + * one or few FANs, while presence is indicated per drawer. ++ * Shift channel value if necessary to align with register value. + */ +- if (BIT(channel / fan->tachos_per_drwr) & regval) { ++ if (BIT(rol32(channel, tacho->shift) / fan->tachos_per_drwr) & ++ regval) { + /* FAN is not connected - return zero for FAN speed. */ + *val = 0; + return 0; +@@ -411,7 +415,7 @@ static int mlxreg_fan_connect_verify(struct mlxreg_fan *fan, + return err; + } + +- return !!(regval & data->bit); ++ return data->slot ? (data->slot <= regval ? 1 : 0) : !!(regval & data->bit); + } + + static int mlxreg_pwm_connect_verify(struct mlxreg_fan *fan, +@@ -486,6 +490,7 @@ static int mlxreg_fan_config(struct mlxreg_fan *fan, + fan->tacho[tacho_num].reg = data->reg; + fan->tacho[tacho_num].mask = data->mask; + fan->tacho[tacho_num].prsnt = data->reg_prsnt; ++ fan->tacho[tacho_num].shift = data->capability_bit; + fan->tacho[tacho_num++].connected = true; + tacho_avail++; + } else if (strnstr(data->label, "pwm", sizeof(data->label))) { +@@ -548,7 +553,15 @@ static int mlxreg_fan_config(struct mlxreg_fan *fan, + return err; + } + +- drwr_avail = hweight32(regval); ++ /* ++ * The number of drawers could be specified in registers by counters for newer ++ * systems, or by bitmasks for older systems. In case the data is provided by ++ * counter, it is indicated through 'version' field. ++ */ ++ if (pdata->version) ++ drwr_avail = regval; ++ else ++ drwr_avail = hweight32(regval); + if (!tacho_avail || !drwr_avail || tacho_avail < drwr_avail) { + dev_err(fan->dev, "Configuration is invalid: drawers num %d tachos num %d\n", + drwr_avail, tacho_avail); +-- +2.14.1 + diff --git a/platform/mellanox/non-upstream-patches/patches/0310-hwmon-mlxreg-fan-Extend-number-of-supporetd-fans.patch b/platform/mellanox/non-upstream-patches/patches/0310-hwmon-mlxreg-fan-Extend-number-of-supporetd-fans.patch new file mode 100644 index 000000000000..b46961465f48 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0310-hwmon-mlxreg-fan-Extend-number-of-supporetd-fans.patch @@ -0,0 +1,47 @@ +From bfd3600fe51e7f2fe5f5777936b308c18220b85c Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Sun, 23 Jul 2023 06:49:01 +0000 +Subject: [PATCH] hwmon: (mlxreg-fan) Extend number of supporetd fans +X-NVConfidentiality: public + +Some new big modular systems can be equipped with up to 24 fans. +Extend maximum number of fans accordingly. + +Signed-off-by: Vadim Pasternak +--- + drivers/hwmon/mlxreg-fan.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/drivers/hwmon/mlxreg-fan.c b/drivers/hwmon/mlxreg-fan.c +index c0b42821f..298af1d9b 100644 +--- a/drivers/hwmon/mlxreg-fan.c ++++ b/drivers/hwmon/mlxreg-fan.c +@@ -12,7 +12,7 @@ + #include + #include + +-#define MLXREG_FAN_MAX_TACHO 14 ++#define MLXREG_FAN_MAX_TACHO 24 + #define MLXREG_FAN_MAX_PWM 4 + #define MLXREG_FAN_PWM_NOT_CONNECTED 0xff + #define MLXREG_FAN_MAX_STATE 10 +@@ -276,6 +276,16 @@ static char *mlxreg_fan_name[] = { + + static const struct hwmon_channel_info *mlxreg_fan_hwmon_info[] = { + HWMON_CHANNEL_INFO(fan, ++ HWMON_F_INPUT | HWMON_F_FAULT, ++ HWMON_F_INPUT | HWMON_F_FAULT, ++ HWMON_F_INPUT | HWMON_F_FAULT, ++ HWMON_F_INPUT | HWMON_F_FAULT, ++ HWMON_F_INPUT | HWMON_F_FAULT, ++ HWMON_F_INPUT | HWMON_F_FAULT, ++ HWMON_F_INPUT | HWMON_F_FAULT, ++ HWMON_F_INPUT | HWMON_F_FAULT, ++ HWMON_F_INPUT | HWMON_F_FAULT, ++ HWMON_F_INPUT | HWMON_F_FAULT, + HWMON_F_INPUT | HWMON_F_FAULT, + HWMON_F_INPUT | HWMON_F_FAULT, + HWMON_F_INPUT | HWMON_F_FAULT, +-- +2.14.1 + diff --git a/platform/mellanox/non-upstream-patches/patches/0317-platform-mellanox-Introduce-support-for-switches-equ.patch b/platform/mellanox/non-upstream-patches/patches/0317-platform-mellanox-Introduce-support-for-switches-equ.patch new file mode 100644 index 000000000000..dec533c3a272 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0317-platform-mellanox-Introduce-support-for-switches-equ.patch @@ -0,0 +1,312 @@ +From 6e7badaa478c42acfaef111d799f56ace64783fd Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Mon, 24 Jul 2023 11:10:50 +0000 +Subject: [PATCH backport 5.10.179 25/26] platform: mellanox: Introduce support + for switches equipped with new FPGA device + +Add support for Nvidia MQM97xx and MSN47xx family switches equipped with +new FPGA device. + +These switches are based on previous generation of MQM97xx and MSN47xx +switches, but COMe module uses new FPGA device. + +Platform configuration for new switches is based on the new VMOD0016 +class. Configuration is extended to support new register map with +callbacks supporting indirect addressing for PCIe-to-LPC bridge. +This bridge provides interface between FPGA at COMe board (directly +connected to CPU PCIe root complex) to CPLDs on switch board (which +cannot be connected directly to PCIe root complex). + +Signed-off-by: Vadim Pasternak +Reviewed-by: Michael Shych +--- + drivers/platform/x86/mlx-platform.c | 196 ++++++++++++++++++++++++++++ + 1 file changed, 196 insertions(+) + +diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c +index c4a4afff7..e303b8e5a 100644 +--- a/drivers/platform/x86/mlx-platform.c ++++ b/drivers/platform/x86/mlx-platform.c +@@ -184,6 +184,9 @@ + #define MLXPLAT_CPLD_LPC_REG_CONFIG1_OFFSET 0xfb + #define MLXPLAT_CPLD_LPC_REG_CONFIG2_OFFSET 0xfc + #define MLXPLAT_CPLD_LPC_REG_CONFIG3_OFFSET 0xfd ++#define MLXPLAT_CPLD_LPC_REG_EXT_MIN_OFFSET 0x100 ++#define MLXPLAT_CPLD_LPC_REG_EXT_MID_OFFSET 0x195 ++#define MLXPLAT_CPLD_LPC_REG_EXT_MAX_OFFSET 0x1ff + #define MLXPLAT_CPLD_LPC_IO_RANGE 0x100 + + #define MLXPLAT_CPLD_LPC_PIO_OFFSET 0x10000UL +@@ -278,6 +281,7 @@ + /* Maximum number of possible physical buses equipped on system */ + #define MLXPLAT_CPLD_MAX_PHYS_ADAPTER_NUM 16 + #define MLXPLAT_CPLD_MAX_PHYS_EXT_ADAPTER_NUM 24 ++#define MLXPLAT_CPLD_DEFAULT_MUX_HOTPLUG_VECTOR 0 + + /* Number of channels in group */ + #define MLXPLAT_CPLD_GRP_CHNL_NUM 8 +@@ -339,6 +343,21 @@ + #define PCI_DEVICE_ID_LATTICE_I2C_BRIDGE 0x9c2f + #define PCI_DEVICE_ID_LATTICE_JTAG_BRIDGE 0x9c30 + #define PCI_DEVICE_ID_LATTICE_LPC_BRIDGE 0x9c32 ++#define MLXPLAT_FPGA_PCI_BAR0_SIZE 0x4000 ++#define MLXPLAT_FPGA_PCI_BASE_OFFSET 0x00000000 ++#define MLXPLAT_FPGA_PCI_MSB_ADDR 0x25 ++#define MLXPLAT_FPGA_PCI_MSB_EXT_ADDR 0x20 ++#define MLXPLAT_FPGA_PCI_LSB_ADDR_OFFSET MLXPLAT_FPGA_PCI_BASE_OFFSET ++#define MLXPLAT_FPGA_PCI_MSB_ADDR_OFFSET (MLXPLAT_FPGA_PCI_BASE_OFFSET + 0x01) ++#define MLXPLAT_FPGA_PCI_DATA_OUT_OFFSET (MLXPLAT_FPGA_PCI_BASE_OFFSET + 0x02) ++#define MLXPLAT_FPGA_PCI_DATA_IN_OFFSET (MLXPLAT_FPGA_PCI_BASE_OFFSET + 0x03) ++#define MLXPLAT_FPGA_PCI_CTRL_OFFSET (MLXPLAT_FPGA_PCI_BASE_OFFSET + 0x04) ++#define MLXPLAT_FPGA_PCI_STAT_OFFSET (MLXPLAT_FPGA_PCI_BASE_OFFSET + 0x05) ++ ++#define MLXPLAT_FPGA_PCI_CTRL_READ BIT(0) ++#define MLXPLAT_FPGA_PCI_CTRL_WRITE BIT(1) ++#define MLXPLAT_FPGA_PCI_COMPLETED GENMASK(1, 0) ++#define MLXPLAT_FPGA_PCI_TO 50 /* usec */ + + /* mlxplat_priv - platform private data + * @pdev_i2c - i2c controller platform device +@@ -454,6 +473,28 @@ static struct i2c_mux_reg_platform_data mlxplat_default_mux_data[] = { + + }; + ++/* Default channels vector for regmap mux. */ ++static int mlxplat_default_regmap_mux_chan[] = { 1, 2, 3, 4, 5, 6, 7, 8 }; ++ ++/* Platform regmap mux data */ ++static struct i2c_mux_regmap_platform_data mlxplat_default_regmap_mux_data[] = { ++ { ++ .parent = 1, ++ .chan_ids = mlxplat_default_regmap_mux_chan, ++ .num_adaps = ARRAY_SIZE(mlxplat_default_regmap_mux_chan), ++ .sel_reg_addr = MLXPLAT_CPLD_LPC_REG_I2C_CH1_OFFSET, ++ .reg_size = 1, ++ }, ++ { ++ .parent = 1, ++ .chan_ids = mlxplat_default_regmap_mux_chan, ++ .num_adaps = ARRAY_SIZE(mlxplat_default_regmap_mux_chan), ++ .sel_reg_addr = MLXPLAT_CPLD_LPC_REG_I2C_CH2_OFFSET, ++ .reg_size = 1, ++ }, ++ ++}; ++ + /* Platform mux configuration variables */ + static int mlxplat_max_adap_num; + static int mlxplat_mux_num; +@@ -3769,6 +3810,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { + .mask = GENMASK(7, 0) & ~BIT(2), + .mode = 0444, + }, ++ { ++ .label = "kexec_activated", ++ .reg = MLXPLAT_CPLD_LPC_REG_RESET_GP2_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(1), ++ .mode = 0644, ++ }, + { + .label = "erot1_reset", + .reg = MLXPLAT_CPLD_LPC_REG_RESET_GP2_OFFSET, +@@ -5391,6 +5438,7 @@ static bool mlxplat_mlxcpld_writeable_reg(struct device *dev, unsigned int reg) + case MLXPLAT_CPLD_LPC_REG_PWM3_OFFSET: + case MLXPLAT_CPLD_LPC_REG_PWM4_OFFSET: + case MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_EXT_MIN_OFFSET ... MLXPLAT_CPLD_LPC_REG_EXT_MAX_OFFSET: + return true; + } + return false; +@@ -5556,6 +5604,7 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) + case MLXPLAT_CPLD_LPC_REG_CONFIG2_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CONFIG3_OFFSET: + case MLXPLAT_CPLD_LPC_REG_UFM_VERSION_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_EXT_MIN_OFFSET ... MLXPLAT_CPLD_LPC_REG_EXT_MAX_OFFSET: + return true; + } + return false; +@@ -5713,6 +5762,7 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) + case MLXPLAT_CPLD_LPC_REG_CONFIG2_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CONFIG3_OFFSET: + case MLXPLAT_CPLD_LPC_REG_UFM_VERSION_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_EXT_MIN_OFFSET ... MLXPLAT_CPLD_LPC_REG_EXT_MAX_OFFSET: + return true; + } + return false; +@@ -5743,6 +5793,14 @@ 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_bf3[] = { ++ { MLXPLAT_CPLD_LPC_REG_GP2_OFFSET, 0xc1 }, ++ { MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET, 0x00 }, ++ { 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_rack_switch[] = { + { MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET, MLXPLAT_REGMAP_NVSWITCH_PWM_DEFAULT }, + { MLXPLAT_CPLD_LPC_REG_WD1_ACT_OFFSET, 0x00 }, +@@ -5871,6 +5929,114 @@ static const struct regmap_config mlxplat_mlxcpld_regmap_config_eth_modular = { + .reg_write = mlxplat_mlxcpld_reg_write, + }; + ++/* Wait completion routine for indirect access for register map */ ++static int mlxplat_fpga_completion_wait(struct mlxplat_mlxcpld_regmap_context *ctx) ++{ ++ unsigned long end; ++ u8 status; ++ ++ end = jiffies + msecs_to_jiffies(MLXPLAT_FPGA_PCI_TO); ++ do { ++ status = ioread8(ctx->base + MLXPLAT_FPGA_PCI_STAT_OFFSET); ++ if (!(status & MLXPLAT_FPGA_PCI_COMPLETED)) ++ return 0; ++ cond_resched(); ++ } while (time_before(jiffies, end)); ++ ++ return -EIO; ++} ++ ++/* Read callback for indirect register map access */ ++static int mlxplat_fpga_reg_read(void *context, unsigned int reg, unsigned int *val) ++{ ++ struct mlxplat_mlxcpld_regmap_context *ctx = context; ++ unsigned int msb_off = MLXPLAT_FPGA_PCI_MSB_ADDR; ++ int err; ++ ++ if (reg >= MLXPLAT_CPLD_LPC_REG_EXT_MIN_OFFSET) { ++ if (reg <= MLXPLAT_CPLD_LPC_REG_EXT_MID_OFFSET) { ++ /* Access to 2-nd FPGA bank */ ++ *val = ioread8(i2c_bridge_addr + reg - ++ MLXPLAT_CPLD_LPC_REG_EXT_MIN_OFFSET); ++ return 0; ++ } ++ /* Access to 3-rd FPGA bank */ ++ reg -= MLXPLAT_CPLD_LPC_REG_EXT_MIN_OFFSET; ++ msb_off = MLXPLAT_FPGA_PCI_MSB_EXT_ADDR; ++ } ++ ++ /* Verify there is no pending transactions */ ++ err = mlxplat_fpga_completion_wait(ctx); ++ if (err) ++ return err; ++ ++ /* Set address in register space */ ++ iowrite8(msb_off, ctx->base + MLXPLAT_FPGA_PCI_MSB_ADDR_OFFSET); ++ iowrite8(reg, ctx->base + MLXPLAT_FPGA_PCI_LSB_ADDR_OFFSET); ++ /* Activate read operation */ ++ iowrite8(MLXPLAT_FPGA_PCI_CTRL_READ, ctx->base + MLXPLAT_FPGA_PCI_CTRL_OFFSET); ++ /* Verify transaction completion */ ++ err = mlxplat_fpga_completion_wait(ctx); ++ if (err) ++ return err; ++ ++ /* Read data */ ++ *val = ioread8(ctx->base + MLXPLAT_FPGA_PCI_DATA_IN_OFFSET); ++ ++ return 0; ++} ++ ++/* Write callback for indirect register map access */ ++static int mlxplat_fpga_reg_write(void *context, unsigned int reg, unsigned int val) ++{ ++ struct mlxplat_mlxcpld_regmap_context *ctx = context; ++ unsigned int msb_off = MLXPLAT_FPGA_PCI_MSB_ADDR; ++ int err; ++ ++ if (reg >= MLXPLAT_CPLD_LPC_REG_EXT_MIN_OFFSET) { ++ if (reg <= MLXPLAT_CPLD_LPC_REG_EXT_MID_OFFSET) { ++ /* Access to 2-nd FPGA bank */ ++ iowrite8(val, i2c_bridge_addr + reg - MLXPLAT_CPLD_LPC_REG_EXT_MIN_OFFSET); ++ /* Flush modification */ ++ wmb(); ++ return 0; ++ } ++ ++ /* Access to 3-rd FPGA bank */ ++ reg -= MLXPLAT_CPLD_LPC_REG_EXT_MIN_OFFSET; ++ msb_off = MLXPLAT_FPGA_PCI_MSB_EXT_ADDR; ++ } ++ ++ /* Verify there is no pending transactions */ ++ err = mlxplat_fpga_completion_wait(ctx); ++ if (err) ++ return err; ++ ++ /* Set address in register space */ ++ iowrite8(msb_off, ctx->base + MLXPLAT_FPGA_PCI_MSB_ADDR_OFFSET); ++ iowrite8(reg, ctx->base + MLXPLAT_FPGA_PCI_LSB_ADDR_OFFSET); ++ /* Set data to be written */ ++ iowrite8(val, ctx->base + MLXPLAT_FPGA_PCI_DATA_OUT_OFFSET); ++ /* Activate write operation */ ++ iowrite8(MLXPLAT_FPGA_PCI_CTRL_WRITE, ctx->base + MLXPLAT_FPGA_PCI_CTRL_OFFSET); ++ ++ return mlxplat_fpga_completion_wait(ctx); ++} ++ ++static const struct regmap_config mlxplat_fpga_regmap_config_bf3_comex_default = { ++ .reg_bits = 9, ++ .val_bits = 8, ++ .max_register = 511, ++ .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_bf3, ++ .num_reg_defaults = ARRAY_SIZE(mlxplat_mlxcpld_regmap_bf3), ++ .reg_read = mlxplat_fpga_reg_read, ++ .reg_write = mlxplat_fpga_reg_write, ++}; ++ + static struct resource mlxplat_mlxcpld_resources[] = { + [0] = DEFINE_RES_IRQ_NAMED(MLXPLAT_CPLD_LPC_SYSIRQ, "mlxreg-hotplug"), + }; +@@ -6282,6 +6448,30 @@ static int __init mlxplat_dmi_l1_switch_matched(const struct dmi_system_id *dmi) + return mlxplat_register_platform_device(); + } + ++static int __init mlxplat_dmi_bf3_comex_default_matched(const struct dmi_system_id *dmi) ++{ ++ int i; ++ ++ mlxplat_max_adap_num = MLXPLAT_CPLD_MAX_PHYS_ADAPTER_NUM; ++ mlxplat_mux_hotplug_num = MLXPLAT_CPLD_DEFAULT_MUX_HOTPLUG_VECTOR; ++ mlxplat_mux_num = ARRAY_SIZE(mlxplat_default_regmap_mux_data); ++ mlxplat_mux_regmap_data = mlxplat_default_regmap_mux_data; ++ mlxplat_hotplug = &mlxplat_mlxcpld_ext_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_fpga_regmap_config_bf3_comex_default; ++ mlxplat_reboot_nb = &mlxplat_reboot_default_nb; ++ pm_power_off = mlxplat_poweroff; ++ ++ return 1; ++} ++ + static const struct dmi_system_id mlxplat_dmi_table[] __initconst = { + { + .callback = mlxplat_dmi_default_wc_matched, +@@ -6377,6 +6567,12 @@ static const struct dmi_system_id mlxplat_dmi_table[] __initconst = { + DMI_MATCH(DMI_BOARD_NAME, "VMOD0015"), + }, + }, ++ { ++ .callback = mlxplat_dmi_bf3_comex_default_matched, ++ .matches = { ++ DMI_MATCH(DMI_BOARD_NAME, "VMOD0016"), ++ }, ++ }, + { + .callback = mlxplat_dmi_l1_switch_matched, + .matches = { +-- +2.20.1 + diff --git a/platform/mellanox/non-upstream-patches/patches/0196-platform-mellanox-Relocate-mlx-platform-driver.patch b/platform/mellanox/non-upstream-patches/patches/0318-mellanox-Relocate-mlx-platform-driver.patch similarity index 85% rename from platform/mellanox/non-upstream-patches/patches/0196-platform-mellanox-Relocate-mlx-platform-driver.patch rename to platform/mellanox/non-upstream-patches/patches/0318-mellanox-Relocate-mlx-platform-driver.patch index 473be771db09..4f8a1127bad2 100644 --- a/platform/mellanox/non-upstream-patches/patches/0196-platform-mellanox-Relocate-mlx-platform-driver.patch +++ b/platform/mellanox/non-upstream-patches/patches/0318-mellanox-Relocate-mlx-platform-driver.patch @@ -1,35 +1,34 @@ -From 723dacff3d93f270a52195c895e2ddf233b146d7 Mon Sep 17 00:00:00 2001 +From e56aebff93c7c72dab4958e56d518c17057344ff Mon Sep 17 00:00:00 2001 From: Vadim Pasternak -Date: Mon, 7 Nov 2022 11:52:34 +0200 -Subject: [PATCH backport 5.10 084/150] platform: mellanox: Relocate - mlx-platform driver +Date: Mon, 24 Jul 2023 11:52:56 +0000 +Subject: [PATCH backport 5.10 100/100] mellanox: Relocate mlx-platform driver Move 'mlx-platform' driver 'x86' to 'mellanox' folder. Motivation to allow running it on systems with ARM architecture. Signed-off-by: Vadim Pasternak +Reviewed-by: Michael Shych --- drivers/platform/mellanox/Kconfig | 12 ++++++++++++ drivers/platform/mellanox/Makefile | 1 + drivers/platform/{x86 => mellanox}/mlx-platform.c | 0 - drivers/platform/x86/Kconfig | 12 ------------ + drivers/platform/x86/Kconfig | 13 ------------- drivers/platform/x86/Makefile | 1 - - 5 files changed, 13 insertions(+), 13 deletions(-) + 5 files changed, 13 insertions(+), 14 deletions(-) rename drivers/platform/{x86 => mellanox}/mlx-platform.c (100%) diff --git a/drivers/platform/mellanox/Kconfig b/drivers/platform/mellanox/Kconfig -index 75e2bee17..ff8267329 100644 +index d54d36d92..dfa29127e 100644 --- a/drivers/platform/mellanox/Kconfig +++ b/drivers/platform/mellanox/Kconfig -@@ -14,6 +14,19 @@ menuconfig MELLANOX_PLATFORM +@@ -14,6 +14,18 @@ menuconfig MELLANOX_PLATFORM if MELLANOX_PLATFORM +config MLX_PLATFORM + tristate "Mellanox Technologies platform support" -+ depends on I2C -+ select REGMAP ++ depends on I2C && REGMAP + help + This option enables system support for the Mellanox Technologies + platform. The Mellanox systems provide data center networking @@ -43,7 +42,7 @@ index 75e2bee17..ff8267329 100644 tristate "Mellanox platform hotplug driver support" depends on REGMAP diff --git a/drivers/platform/mellanox/Makefile b/drivers/platform/mellanox/Makefile -index 6af37ee88..23919e56a 100644 +index 51a56ea1b..58ddeab43 100644 --- a/drivers/platform/mellanox/Makefile +++ b/drivers/platform/mellanox/Makefile @@ -3,6 +3,7 @@ @@ -52,14 +51,14 @@ index 6af37ee88..23919e56a 100644 # +obj-$(CONFIG_MLX_PLATFORM) += mlx-platform.o obj-$(CONFIG_MLXBF_BOOTCTL) += mlxbf-bootctl.o + obj-$(CONFIG_MLXBF_PMC) += mlxbf-pmc.o obj-$(CONFIG_MLXBF_TMFIFO) += mlxbf-tmfifo.o - obj-$(CONFIG_MLXREG_HOTPLUG) += mlxreg-hotplug.o diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/mellanox/mlx-platform.c similarity index 100% rename from drivers/platform/x86/mlx-platform.c rename to drivers/platform/mellanox/mlx-platform.c diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig -index a1858689d..4270d4c17 100644 +index 84c5b922f..4270d4c17 100644 --- a/drivers/platform/x86/Kconfig +++ b/drivers/platform/x86/Kconfig @@ -1193,19 +1193,6 @@ config I2C_MULTI_INSTANTIATE diff --git a/platform/mellanox/non-upstream-patches/patches/0319-UBUNTU-SAUCE-mlxbf-tmfifo-fix-potential-race.patch b/platform/mellanox/non-upstream-patches/patches/0319-UBUNTU-SAUCE-mlxbf-tmfifo-fix-potential-race.patch new file mode 100644 index 000000000000..868a458630d1 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0319-UBUNTU-SAUCE-mlxbf-tmfifo-fix-potential-race.patch @@ -0,0 +1,63 @@ +From 0a853a02d268ae7355e559043e4dea1a1b2be9a5 Mon Sep 17 00:00:00 2001 +From: Liming Sun +Date: Thu, 13 Apr 2023 08:32:24 -0400 +Subject: [PATCH] UBUNTU: SAUCE: mlxbf-tmfifo: fix potential race +X-NVConfidentiality: public + +BugLink: https://bugs.launchpad.net/bugs/2016039 + +The fix adds memory barrier for the 'is_ready' flag and the 'vq' +pointer in mlxbf_tmfifo_virtio_find_vqs() to avoid potential race +due to out-of-order memory write. + +Signed-off-by: Liming Sun +Acked-by: Bartlomiej Zolnierkiewicz +Acked-by: Tim Gardner +[bzolnier: this patch also contains a fix for mlxbf_tmfifo_create_vdev() + failure case] +Signed-off-by: Bartlomiej Zolnierkiewicz +--- + drivers/platform/mellanox/mlxbf-tmfifo.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/drivers/platform/mellanox/mlxbf-tmfifo.c b/drivers/platform/mellanox/mlxbf-tmfifo.c +index 97956c9c9d4c..19d539fc99ae 100644 +--- a/drivers/platform/mellanox/mlxbf-tmfifo.c ++++ b/drivers/platform/mellanox/mlxbf-tmfifo.c +@@ -922,7 +922,7 @@ static void mlxbf_tmfifo_rxtx(struct mlxbf_tmfifo_vring *vring, bool is_rx) + fifo = vring->fifo; + + /* Return if vdev is not ready. */ +- if (!fifo->vdev[devid]) ++ if (!fifo || !fifo->vdev[devid]) + return; + + /* Return if another vring is running. */ +@@ -1119,9 +1119,13 @@ static int mlxbf_tmfifo_virtio_find_vqs(struct virtio_device *vdev, + goto error; + } + ++ vq->priv = vring; ++ ++ /* Make vq update visible before using it. */ ++ virtio_mb(false); ++ + vqs[i] = vq; + vring->vq = vq; +- vq->priv = vring; + } + + return 0; +@@ -1426,6 +1430,9 @@ static int mlxbf_tmfifo_probe(struct platform_device *pdev) + + mod_timer(&fifo->timer, jiffies + MLXBF_TMFIFO_TIMER_INTERVAL); + ++ /* Make all updates visible before the 'is_ready' flag. */ ++ virtio_mb(false); ++ + fifo->is_ready = 1; + return 0; + +-- +2.14.1 + diff --git a/platform/mellanox/non-upstream-patches/patches/0320-UBUNTU-SAUCE-mlxbf-tmfifo-Drop-the-Rx-packet-if-no-m.patch b/platform/mellanox/non-upstream-patches/patches/0320-UBUNTU-SAUCE-mlxbf-tmfifo-Drop-the-Rx-packet-if-no-m.patch new file mode 100644 index 000000000000..591ab5ea6176 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0320-UBUNTU-SAUCE-mlxbf-tmfifo-Drop-the-Rx-packet-if-no-m.patch @@ -0,0 +1,177 @@ +From fda66dd5619067846d24d3b30398f7406b10af69 Mon Sep 17 00:00:00 2001 +From: Liming Sun +Date: Sun, 4 Jun 2023 10:28:14 -0400 +Subject: [PATCH] UBUNTU: SAUCE: mlxbf-tmfifo: Drop the Rx packet if no more + descriptors +X-NVConfidentiality: public + +BugLink: https://bugs.launchpad.net/bugs/2021749 + +This commit fixes tmfifo console stuck issue when the virtual +networking interface is in down state. In such case, the network +Rx descriptors runs out which causes the network packet stays +in the tmfifo and couldn't be popped out thus blocking the console +packets. The fix is to drop the receiving packet when no more Rx +descriptors. + +Signed-off-by: Liming Sun +Acked-by: Tim Gardner +Acked-by: Bartlomiej Zolnierkiewicz +Signed-off-by: Bartlomiej Zolnierkiewicz +--- + drivers/platform/mellanox/mlxbf-tmfifo.c | 65 ++++++++++++++++++++++---------- + 1 file changed, 46 insertions(+), 19 deletions(-) + +diff --git a/drivers/platform/mellanox/mlxbf-tmfifo.c b/drivers/platform/mellanox/mlxbf-tmfifo.c +index 19d539fc99ae..88610f45456b 100644 +--- a/drivers/platform/mellanox/mlxbf-tmfifo.c ++++ b/drivers/platform/mellanox/mlxbf-tmfifo.c +@@ -59,6 +59,7 @@ struct mlxbf_tmfifo; + * @vq: pointer to the virtio virtqueue + * @desc: current descriptor of the pending packet + * @desc_head: head descriptor of the pending packet ++ * @drop_desc: dummy desc for packet dropping + * @cur_len: processed length of the current descriptor + * @rem_len: remaining length of the pending packet + * @pkt_len: total length of the pending packet +@@ -75,6 +76,7 @@ struct mlxbf_tmfifo_vring { + struct virtqueue *vq; + struct vring_desc *desc; + struct vring_desc *desc_head; ++ struct vring_desc drop_desc; + int cur_len; + int rem_len; + u32 pkt_len; +@@ -86,6 +88,11 @@ struct mlxbf_tmfifo_vring { + struct mlxbf_tmfifo *fifo; + }; + ++/* Check whether vring is in drop mode. */ ++#define IS_VRING_DROP(_r) ({ \ ++ typeof(_r) (r) = (_r); \ ++ (r->desc_head == &r->drop_desc ? true : false); }) ++ + /* Interrupt types. */ + enum { + MLXBF_TM_RX_LWM_IRQ, +@@ -275,6 +282,7 @@ static int mlxbf_tmfifo_alloc_vrings(struct mlxbf_tmfifo *fifo, + vring->align = SMP_CACHE_BYTES; + vring->index = i; + vring->vdev_id = tm_vdev->vdev.id.device; ++ vring->drop_desc.len = 0xffff; + dev = &tm_vdev->vdev.dev; + + size = vring_size(vring->num, vring->align); +@@ -380,7 +388,7 @@ static u32 mlxbf_tmfifo_get_pkt_len(struct mlxbf_tmfifo_vring *vring, + return len; + } + +-static void mlxbf_tmfifo_release_pending_pkt(struct mlxbf_tmfifo_vring *vring) ++static void mlxbf_tmfifo_release_pkt(struct mlxbf_tmfifo_vring *vring) + { + struct vring_desc *desc_head; + u32 len = 0; +@@ -508,8 +516,6 @@ static int mlxbf_tmfifo_get_rx_avail(struct mlxbf_tmfifo *fifo) + return FIELD_GET(MLXBF_TMFIFO_RX_STS__COUNT_MASK, sts); + } + +- +- + /* Get the number of available words in the TmFifo for sending. */ + static int mlxbf_tmfifo_get_tx_avail(struct mlxbf_tmfifo *fifo, int vdev_id) + { +@@ -732,19 +738,25 @@ static void mlxbf_tmfifo_rxtx_word(struct mlxbf_tmfifo_vring *vring, + + if (vring->cur_len + sizeof(u64) <= len) { + /* The whole word. */ +- if (is_rx) +- memcpy(addr + vring->cur_len, &data, sizeof(u64)); +- else +- memcpy(&data, addr + vring->cur_len, sizeof(u64)); ++ if (!IS_VRING_DROP(vring)) { ++ if (is_rx) ++ memcpy(addr + vring->cur_len, &data, ++ sizeof(u64)); ++ else ++ memcpy(&data, addr + vring->cur_len, ++ sizeof(u64)); ++ } + vring->cur_len += sizeof(u64); + } else { + /* Leftover bytes. */ +- if (is_rx) +- memcpy(addr + vring->cur_len, &data, +- len - vring->cur_len); +- else +- memcpy(&data, addr + vring->cur_len, +- len - vring->cur_len); ++ if (!IS_VRING_DROP(vring)) { ++ if (is_rx) ++ memcpy(addr + vring->cur_len, &data, ++ len - vring->cur_len); ++ else ++ memcpy(&data, addr + vring->cur_len, ++ len - vring->cur_len); ++ } + vring->cur_len = len; + } + +@@ -847,8 +859,16 @@ static bool mlxbf_tmfifo_rxtx_one_desc(struct mlxbf_tmfifo_vring *vring, + /* Get the descriptor of the next packet. */ + if (!vring->desc) { + desc = mlxbf_tmfifo_get_next_pkt(vring, is_rx); +- if (!desc) +- return false; ++ if (!desc) { ++ /* Drop next Rx packet to avoid stuck. */ ++ if (is_rx) { ++ desc = &vring->drop_desc; ++ vring->desc_head = desc; ++ vring->desc = desc; ++ } else { ++ return false; ++ } ++ } + } else { + desc = vring->desc; + } +@@ -881,17 +901,24 @@ static bool mlxbf_tmfifo_rxtx_one_desc(struct mlxbf_tmfifo_vring *vring, + vring->rem_len -= len; + + /* Get the next desc on the chain. */ +- if (vring->rem_len > 0 && ++ if (!IS_VRING_DROP(vring) && vring->rem_len > 0 && + (virtio16_to_cpu(vdev, desc->flags) & VRING_DESC_F_NEXT)) { + idx = virtio16_to_cpu(vdev, desc->next); + desc = &vr->desc[idx]; + goto mlxbf_tmfifo_desc_done; + } + +- /* Done and release the pending packet. */ +- mlxbf_tmfifo_release_pending_pkt(vring); ++ /* Done and release the packet. */ + desc = NULL; + fifo->vring[is_rx] = NULL; ++ if (!IS_VRING_DROP(vring)) { ++ mlxbf_tmfifo_release_pkt(vring); ++ } else { ++ vring->pkt_len = 0; ++ vring->desc_head = NULL; ++ vring->desc = NULL; ++ return false; ++ } + + /* + * Make sure the load/store are in order before +@@ -1073,7 +1100,7 @@ static void mlxbf_tmfifo_virtio_del_vqs(struct virtio_device *vdev) + + /* Release the pending packet. */ + if (vring->desc) +- mlxbf_tmfifo_release_pending_pkt(vring); ++ mlxbf_tmfifo_release_pkt(vring); + vq = vring->vq; + if (vq) { + vring->vq = NULL; +-- +2.14.1 + diff --git a/platform/mellanox/non-upstream-patches/patches/0321-UBUNTU-SAUCE-mlxbf-tmfifo-Drop-jumbo-frames.patch b/platform/mellanox/non-upstream-patches/patches/0321-UBUNTU-SAUCE-mlxbf-tmfifo-Drop-jumbo-frames.patch new file mode 100644 index 000000000000..df0e01e79feb --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0321-UBUNTU-SAUCE-mlxbf-tmfifo-Drop-jumbo-frames.patch @@ -0,0 +1,100 @@ +From a72d23ea2daedf011b2a3239c7f1dbfe28d36e7d Mon Sep 17 00:00:00 2001 +From: Liming Sun +Date: Sun, 4 Jun 2023 10:28:15 -0400 +Subject: [PATCH] UBUNTU: SAUCE: mlxbf-tmfifo: Drop jumbo frames +X-NVConfidentiality: public + +BugLink: https://bugs.launchpad.net/bugs/2021749 + +This commit drops over-sized network packets to avoid tmfifo +queue stuck. + +Signed-off-by: Liming Sun +Acked-by: Tim Gardner +Acked-by: Bartlomiej Zolnierkiewicz +[bzolnier: removed Change-Id from the commit description] +Signed-off-by: Bartlomiej Zolnierkiewicz +--- + drivers/platform/mellanox/mlxbf-tmfifo.c | 24 +++++++++++++++++------- + 1 file changed, 17 insertions(+), 7 deletions(-) + +diff --git a/drivers/platform/mellanox/mlxbf-tmfifo.c b/drivers/platform/mellanox/mlxbf-tmfifo.c +index 88610f45456b..4f3226007e32 100644 +--- a/drivers/platform/mellanox/mlxbf-tmfifo.c ++++ b/drivers/platform/mellanox/mlxbf-tmfifo.c +@@ -234,7 +234,7 @@ static u8 mlxbf_tmfifo_net_default_mac[ETH_ALEN] = { + static efi_char16_t mlxbf_tmfifo_efi_name[] = L"RshimMacAddr"; + + /* Maximum L2 header length. */ +-#define MLXBF_TMFIFO_NET_L2_OVERHEAD 36 ++#define MLXBF_TMFIFO_NET_L2_OVERHEAD (ETH_HLEN + VLAN_HLEN) + + /* Supported virtio-net features. */ + #define MLXBF_TMFIFO_NET_FEATURES \ +@@ -773,13 +773,14 @@ static void mlxbf_tmfifo_rxtx_word(struct mlxbf_tmfifo_vring *vring, + * flag is set. + */ + static void mlxbf_tmfifo_rxtx_header(struct mlxbf_tmfifo_vring *vring, +- struct vring_desc *desc, ++ struct vring_desc **desc, + bool is_rx, bool *vring_change) + { + struct mlxbf_tmfifo *fifo = vring->fifo; + struct virtio_net_config *config; + struct mlxbf_tmfifo_msg_hdr hdr; + int vdev_id, hdr_len; ++ bool drop_rx = false; + + /* Read/Write packet header. */ + if (is_rx) { +@@ -801,8 +802,8 @@ static void mlxbf_tmfifo_rxtx_header(struct mlxbf_tmfifo_vring *vring, + if (ntohs(hdr.len) > + __virtio16_to_cpu(virtio_legacy_is_little_endian(), + config->mtu) + +- MLXBF_TMFIFO_NET_L2_OVERHEAD) +- return; ++ MLXBF_TMFIFO_NET_L2_OVERHEAD) ++ drop_rx = true; + } else { + vdev_id = VIRTIO_ID_CONSOLE; + hdr_len = 0; +@@ -817,16 +818,25 @@ static void mlxbf_tmfifo_rxtx_header(struct mlxbf_tmfifo_vring *vring, + + if (!tm_dev2) + return; +- vring->desc = desc; ++ vring->desc = *desc; + vring = &tm_dev2->vrings[MLXBF_TMFIFO_VRING_RX]; + *vring_change = true; + } ++ ++ if (drop_rx && !IS_VRING_DROP(vring)) { ++ if (vring->desc_head) ++ mlxbf_tmfifo_release_pkt(vring); ++ *desc = &vring->drop_desc; ++ vring->desc_head = *desc; ++ vring->desc = *desc; ++ } ++ + vring->pkt_len = ntohs(hdr.len) + hdr_len; + } else { + /* Network virtio has an extra header. */ + hdr_len = (vring->vdev_id == VIRTIO_ID_NET) ? + sizeof(struct virtio_net_hdr) : 0; +- vring->pkt_len = mlxbf_tmfifo_get_pkt_len(vring, desc); ++ vring->pkt_len = mlxbf_tmfifo_get_pkt_len(vring, *desc); + hdr.type = (vring->vdev_id == VIRTIO_ID_NET) ? + VIRTIO_ID_NET : VIRTIO_ID_CONSOLE; + hdr.len = htons(vring->pkt_len - hdr_len); +@@ -875,7 +885,7 @@ static bool mlxbf_tmfifo_rxtx_one_desc(struct mlxbf_tmfifo_vring *vring, + + /* Beginning of a packet. Start to Rx/Tx packet header. */ + if (vring->pkt_len == 0) { +- mlxbf_tmfifo_rxtx_header(vring, desc, is_rx, &vring_change); ++ mlxbf_tmfifo_rxtx_header(vring, &desc, is_rx, &vring_change); + (*avail)--; + + /* Return if new packet is for another ring. */ +-- +2.14.1 + diff --git a/platform/mellanox/non-upstream-patches/patches/0322-UBUNTU-SAUCE-mlxbf-tmfifo.c-Amend-previous-tmfifo-pa.patch b/platform/mellanox/non-upstream-patches/patches/0322-UBUNTU-SAUCE-mlxbf-tmfifo.c-Amend-previous-tmfifo-pa.patch new file mode 100644 index 000000000000..1e26f7f8d5d4 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0322-UBUNTU-SAUCE-mlxbf-tmfifo.c-Amend-previous-tmfifo-pa.patch @@ -0,0 +1,37 @@ +From b23bb194dc1dbad104f2afce1a8ed202d182b73b Mon Sep 17 00:00:00 2001 +From: Shih-Yi Chen +Date: Thu, 20 Jul 2023 16:39:40 -0400 +Subject: [PATCH] UBUNTU: SAUCE: mlxbf-tmfifo.c: Amend previous tmfifo patch w/ + regard to schedule_work +X-NVConfidentiality: public + +BugLink: https://bugs.launchpad.net/bugs/2028197 + +Fix rshim console output got cutoff due to tmfifo driver not processing all virtio console notifications. + +Signed-off-by: Shih-Yi Chen +Reviewed-by: Liming Sun +Acked-by: Bartlomiej Zolnierkiewicz +Acked-by: Tim Gardner +[bzolnier: use a short URL version for BugLink] +Signed-off-by: Bartlomiej Zolnierkiewicz +--- + drivers/platform/mellanox/mlxbf-tmfifo.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/platform/mellanox/mlxbf-tmfifo.c b/drivers/platform/mellanox/mlxbf-tmfifo.c +index 4f3226007e32..36b87d5d8baf 100644 +--- a/drivers/platform/mellanox/mlxbf-tmfifo.c ++++ b/drivers/platform/mellanox/mlxbf-tmfifo.c +@@ -1065,6 +1065,8 @@ static bool mlxbf_tmfifo_virtio_notify(struct virtqueue *vq) + tm_vdev = fifo->vdev[VIRTIO_ID_CONSOLE]; + mlxbf_tmfifo_console_output(tm_vdev, vring); + spin_unlock_irqrestore(&fifo->spin_lock[0], flags); ++ test_and_set_bit(MLXBF_TM_TX_LWM_IRQ, ++ &fifo->pend_events); + } else if (test_and_set_bit(MLXBF_TM_TX_LWM_IRQ, + &fifo->pend_events)) { + return true; +-- +2.14.1 + diff --git a/platform/mellanox/non-upstream-patches/patches/0323-mlxbf_gige-add-set_link_ksettings-ethtool-callback.patch b/platform/mellanox/non-upstream-patches/patches/0323-mlxbf_gige-add-set_link_ksettings-ethtool-callback.patch new file mode 100644 index 000000000000..5198d6e54f4a --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0323-mlxbf_gige-add-set_link_ksettings-ethtool-callback.patch @@ -0,0 +1,39 @@ +From 29ebd6bb4afdf9f4aad3019c0ca9892b69dbff40 Mon Sep 17 00:00:00 2001 +From: David Thompson +Date: Thu, 12 Jan 2023 15:26:08 -0500 +Subject: [PATCH] mlxbf_gige: add "set_link_ksettings" ethtool callback +X-NVConfidentiality: public + +BugLink: https://bugs.launchpad.net/bugs/2012649 + +This patch extends the "ethtool_ops" data structure to +include the "set_link_ksettings" callback. This change +enables configuration of the various interface speeds +that the BlueField-3 supports (10Mbps, 100Mbps, and 1Gbps). + +Signed-off-by: David Thompson +Signed-off-by: Asmaa Mnebhi +Reviewed-by: Andrew Lunn +Signed-off-by: Jakub Kicinski +(cherry picked from commit cedd97737a1f302b3d0493d7054a35e0c5997b99) +Signed-off-by: David Thompson +Acked-by: Tim Gardner +Acked-by: Bartlomiej Zolnierkiewicz +Signed-off-by: Bartlomiej Zolnierkiewicz +--- + drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_ethtool.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_ethtool.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_ethtool.c +index 257724323..602537f62 100644 +--- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_ethtool.c ++++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_ethtool.c +@@ -170,4 +170,5 @@ const struct ethtool_ops mlxbf_gige_ethtool_ops = { + .nway_reset = phy_ethtool_nway_reset, + .get_pauseparam = mlxbf_gige_get_pauseparam, + .get_link_ksettings = phy_ethtool_get_link_ksettings, ++ .set_link_ksettings = phy_ethtool_set_link_ksettings, + }; +-- +2.14.1 + diff --git a/platform/mellanox/non-upstream-patches/patches/0324-mlxbf_gige-fix-white-space-in-mlxbf_gige_eth_ioctl.patch b/platform/mellanox/non-upstream-patches/patches/0324-mlxbf_gige-fix-white-space-in-mlxbf_gige_eth_ioctl.patch new file mode 100644 index 000000000000..b24dc636a5fd --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0324-mlxbf_gige-fix-white-space-in-mlxbf_gige_eth_ioctl.patch @@ -0,0 +1,41 @@ +From dc7c16946141474dad808f7bef9c00a547ed0db6 Mon Sep 17 00:00:00 2001 +From: David Thompson +Date: Thu, 12 Jan 2023 15:26:09 -0500 +Subject: [PATCH] mlxbf_gige: fix white space in mlxbf_gige_eth_ioctl +X-NVConfidentiality: public + +BugLink: https://bugs.launchpad.net/bugs/2012649 + +This patch fixes the white space issue raised by checkpatch: +CHECK: Alignment should match open parenthesis ++static int mlxbf_gige_eth_ioctl(struct net_device *netdev, ++ struct ifreq *ifr, int cmd) + +Signed-off-by: David Thompson +Signed-off-by: Asmaa Mnebhi +Signed-off-by: Jakub Kicinski +(cherry picked from commit e1cc8ce46200b3f3026e546053458c6f8046ef27) +Signed-off-by: David Thompson +Acked-by: Tim Gardner +Acked-by: Bartlomiej Zolnierkiewicz +Signed-off-by: Bartlomiej Zolnierkiewicz +--- + drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c +index 867248e3c..602260f2b 100644 +--- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c ++++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c +@@ -205,7 +205,7 @@ static int mlxbf_gige_stop(struct net_device *netdev) + } + + static int mlxbf_gige_do_ioctl(struct net_device *netdev, +- struct ifreq *ifr, int cmd) ++ struct ifreq *ifr, int cmd) + { + if (!(netif_running(netdev))) + return -EINVAL; +-- +2.14.1 + diff --git a/platform/mellanox/non-upstream-patches/patches/0325-UBUNTU-SAUCE-mlxbf-bootctl-Fix-kernel-panic-due-to-b.patch b/platform/mellanox/non-upstream-patches/patches/0325-UBUNTU-SAUCE-mlxbf-bootctl-Fix-kernel-panic-due-to-b.patch new file mode 100644 index 000000000000..f867f38cf679 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0325-UBUNTU-SAUCE-mlxbf-bootctl-Fix-kernel-panic-due-to-b.patch @@ -0,0 +1,57 @@ +From aaad0c7201b7f3908e30c529fb5ab83dc9851c83 Mon Sep 17 00:00:00 2001 +From: Asmaa Mnebhi +Date: Thu, 20 Jul 2023 16:37:37 -0400 +Subject: [PATCH] UBUNTU: SAUCE: mlxbf-bootctl: Fix kernel panic due to buffer + overflow +X-NVConfidentiality: public + +BugLink: https://bugs.launchpad.net/bugs/2028309 + +Running the following LTP (linux-test-project) script, causes +a kernel panic and a reboot of the DPU: +ltp/testcases/bin/read_all -d /sys -q -r 10 + +The above test reads all directory and files under /sys. +Reading the sysfs entry "large_icm" causes the kernel panic +due to a garbage value returned via i2c read. That garbage +value causes a buffer overflow in sprintf. + +Replace sprintf with snprintf. And also add missing lock and +increase the buffer size to PAGE_SIZE. + +Signed-off-by: Asmaa Mnebhi +Acked-by: Bartlomiej Zolnierkiewicz +Acked-by: Tim Gardner +Signed-off-by: Bartlomiej Zolnierkiewicz +--- + drivers/platform/mellanox/mlxbf-bootctl.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/drivers/platform/mellanox/mlxbf-bootctl.c b/drivers/platform/mellanox/mlxbf-bootctl.c +index a68bf5b27013..52666ee360b2 100644 +--- a/drivers/platform/mellanox/mlxbf-bootctl.c ++++ b/drivers/platform/mellanox/mlxbf-bootctl.c +@@ -387,17 +387,16 @@ static ssize_t oob_mac_store(struct device_driver *drv, const char *buf, + + static ssize_t large_icm_show(struct device_driver *drv, char *buf) + { +- char icm_str[MAX_ICM_BUFFER_SIZE] = { 0 }; + struct arm_smccc_res res; + ++ mutex_lock(&icm_ops_lock); + arm_smccc_smc(MLNX_HANDLE_GET_ICM_INFO, 0, 0, 0, 0, + 0, 0, 0, &res); ++ mutex_unlock(&icm_ops_lock); + if (res.a0) + return -EPERM; + +- sprintf(icm_str, "0x%lx", res.a1); +- +- return snprintf(buf, sizeof(icm_str), "%s", icm_str); ++ return snprintf(buf, PAGE_SIZE, "0x%lx", res.a1); + } + + static ssize_t large_icm_store(struct device_driver *drv, const char *buf, +-- +2.14.1 + diff --git a/platform/mellanox/non-upstream-patches/patches/0326-platform-mellanox-mlxreg-hotplug-Add-support-for-new.patch b/platform/mellanox/non-upstream-patches/patches/0326-platform-mellanox-mlxreg-hotplug-Add-support-for-new.patch new file mode 100644 index 000000000000..3905bd494ddd --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0326-platform-mellanox-mlxreg-hotplug-Add-support-for-new.patch @@ -0,0 +1,88 @@ +From b9d89fb53b5361df87974a223cb4b423a647bc2f Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Thu, 24 Aug 2023 11:47:54 +0000 +Subject: [PATCH] platform/mellanox: mlxreg-hotplug: Add support for new flavor + of capability registers +X-NVConfidentiality: public + +Hotplug platform data is common across the various systems, while +hotplug driver should be able to configure only the instances relevant +to specific system. + +For example, platform hoptplug data might contain descriptions for fan1, +fan2, ..., fan{n}, while some systems equipped with all 'n' fans, +others with less. +Same for power units, power controllers, ASICs and so on. + +For detection of the real number of equipped devices capability +registers are used. +These registers used to indicate presence of hotplug devices through +the bitmap. + +For some new big modular systems, these registers will provide presence +by counters. + +Use slot parameter to determine whether capability register contains +bitmask or counter. + +Some 'capability' registers can be shared between different resources. +Use fields 'capability_bit' and 'capability_mask' for getting only +relevant capability bits. + +Signed-off-by: Vadim Pasternak +Reviewed-by: Felix Radensky +--- + drivers/platform/mellanox/mlxreg-hotplug.c | 23 +++++++++++++++++++++-- + 1 file changed, 21 insertions(+), 2 deletions(-) + +diff --git a/drivers/platform/mellanox/mlxreg-hotplug.c b/drivers/platform/mellanox/mlxreg-hotplug.c +index c5abedd35..3737af0d3 100644 +--- a/drivers/platform/mellanox/mlxreg-hotplug.c ++++ b/drivers/platform/mellanox/mlxreg-hotplug.c +@@ -275,6 +275,13 @@ static int mlxreg_hotplug_attr_init(struct mlxreg_hotplug_priv_data *priv) + if (ret) + return ret; + ++ if (!regval) ++ continue; ++ ++ /* Remove non-relevant bits. */ ++ if (item->capability_mask) ++ regval = rol32(regval & item->capability_mask, ++ item->capability_bit); + item->mask = GENMASK((regval & item->mask) - 1, 0); + } + +@@ -295,7 +302,19 @@ static int mlxreg_hotplug_attr_init(struct mlxreg_hotplug_priv_data *priv) + if (ret) + return ret; + +- if (!(regval & data->bit)) { ++ /* ++ * In case slot field is provided, capability ++ * register contains counter, otherwise bitmask. ++ * Skip non-relevant entries if slot set and ++ * exceeds counter. Othewise validate entry by ++ * matching bitmask. ++ */ ++ if (data->capability_mask) ++ regval = rol32(regval & data->capability_mask, ++ data->capability_bit); ++ if (data->slot > regval) { ++ break; ++ } else if (!(regval & data->bit) && !data->slot) { + data++; + continue; + } +@@ -626,7 +645,7 @@ static int mlxreg_hotplug_set_irq(struct mlxreg_hotplug_priv_data *priv) + if (ret) + goto out; + +- if (!(regval & data->bit)) ++ if (!(regval & data->bit) && !data->slot) + item->mask &= ~BIT(j); + } + } +-- +2.14.1 + diff --git a/platform/mellanox/non-upstream-patches/patches/0327-platform-mellanox-mlx-platform-Change-register-name.patch b/platform/mellanox/non-upstream-patches/patches/0327-platform-mellanox-mlx-platform-Change-register-name.patch new file mode 100644 index 000000000000..7953c4149461 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0327-platform-mellanox-mlx-platform-Change-register-name.patch @@ -0,0 +1,57 @@ +From 45cc492edbf7dc36e20a166355840a5cce0841c9 Mon Sep 17 00:00:00 2001 +From: Felix Radensky +Date: Thu, 21 Sep 2023 05:53:11 +0000 +Subject: [PATCH] platform: mellanox: mlx-platform: Change register name +X-NVConfidentiality: public + +Register 0xd9 was repurposed on new systems. Change its name +to correctly reflect the new functionality. + +Signed-off-by: Felix Radensky +Reviewed-by: Vadim Pasternak +--- + drivers/platform/mellanox/mlx-platform.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/drivers/platform/mellanox/mlx-platform.c b/drivers/platform/mellanox/mlx-platform.c +index 20211d28c..4efd06eaf 100644 +--- a/drivers/platform/mellanox/mlx-platform.c ++++ b/drivers/platform/mellanox/mlx-platform.c +@@ -147,7 +147,7 @@ + #define MLXPLAT_CPLD_LPC_REG_WD3_TMR_OFFSET 0xd1 + #define MLXPLAT_CPLD_LPC_REG_WD3_TLEFT_OFFSET 0xd2 + #define MLXPLAT_CPLD_LPC_REG_WD3_ACT_OFFSET 0xd3 +-#define MLXPLAT_CPLD_LPC_REG_DBG_CTRL_OFFSET 0xd9 ++#define MLXPLAT_CPLD_LPC_REG_CPLD6_MVER_OFFSET 0xd9 + #define MLXPLAT_CPLD_LPC_REG_I2C_CH1_OFFSET 0xdb + #define MLXPLAT_CPLD_LPC_REG_I2C_CH2_OFFSET 0xda + #define MLXPLAT_CPLD_LPC_REG_I2C_CH3_OFFSET 0xdc +@@ -5428,7 +5428,6 @@ static bool mlxplat_mlxcpld_writeable_reg(struct device *dev, unsigned int reg) + case MLXPLAT_CPLD_LPC_REG_WD3_TMR_OFFSET: + case MLXPLAT_CPLD_LPC_REG_WD3_TLEFT_OFFSET: + case MLXPLAT_CPLD_LPC_REG_WD3_ACT_OFFSET: +- case MLXPLAT_CPLD_LPC_REG_DBG_CTRL_OFFSET: + case MLXPLAT_CPLD_LPC_REG_I2C_CH1_OFFSET: + case MLXPLAT_CPLD_LPC_REG_I2C_CH2_OFFSET: + case MLXPLAT_CPLD_LPC_REG_I2C_CH3_OFFSET: +@@ -5565,7 +5564,7 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) + case MLXPLAT_CPLD_LPC_REG_WD3_TMR_OFFSET: + case MLXPLAT_CPLD_LPC_REG_WD3_TLEFT_OFFSET: + case MLXPLAT_CPLD_LPC_REG_WD3_ACT_OFFSET: +- case MLXPLAT_CPLD_LPC_REG_DBG_CTRL_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_CPLD6_MVER_OFFSET: + case MLXPLAT_CPLD_LPC_REG_I2C_CH1_OFFSET: + case MLXPLAT_CPLD_LPC_REG_I2C_CH2_OFFSET: + case MLXPLAT_CPLD_LPC_REG_I2C_CH3_OFFSET: +@@ -5723,7 +5722,7 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) + case MLXPLAT_CPLD_LPC_REG_WD2_TLEFT_OFFSET: + case MLXPLAT_CPLD_LPC_REG_WD3_TMR_OFFSET: + case MLXPLAT_CPLD_LPC_REG_WD3_TLEFT_OFFSET: +- case MLXPLAT_CPLD_LPC_REG_DBG_CTRL_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_CPLD6_MVER_OFFSET: + case MLXPLAT_CPLD_LPC_REG_I2C_CH1_OFFSET: + case MLXPLAT_CPLD_LPC_REG_I2C_CH2_OFFSET: + case MLXPLAT_CPLD_LPC_REG_I2C_CH3_OFFSET: +-- +2.14.1 + diff --git a/platform/mellanox/non-upstream-patches/patches/0328-platform-mellanox-mlx-platform-Add-support-for-new-X.patch b/platform/mellanox/non-upstream-patches/patches/0328-platform-mellanox-mlx-platform-Add-support-for-new-X.patch new file mode 100644 index 000000000000..ad38b1555460 --- /dev/null +++ b/platform/mellanox/non-upstream-patches/patches/0328-platform-mellanox-mlx-platform-Add-support-for-new-X.patch @@ -0,0 +1,1383 @@ +From e1431c088b27f877747f9a74e07c8b158db7ec66 Mon Sep 17 00:00:00 2001 +From: Felix Radensky +Date: Mon, 4 Sep 2023 18:28:37 +0000 +Subject: [PATCH 1/4] From f25ad1918eb613aa315805717603a0960f42e6df Mon Sep 17 + 00:00:00 2001 Subject: [PATCH] platform: mellanox: mlx-platform: Add support + for new XDR systems X-NVConfidentiality: public +X-NVConfidentiality: public + +Add support for QM3400 and QM3000, Nvidia XDR switches. + +QM3400 is a 57.6Tbps switch based on Nvidia Quantum-3 ASIC. +It provides up-to 800Gbps full bidirectional bandwidth per port. +The system supports 36 OSFP cages and fits into standard 2U racks. + +QM3400 Features: + - 36 OSFP ports supporting 2.5Gbps - 800Gbps speeds. + - Air-cooled with 4 + 1 redundant fan units. + - 2 + 2 redundant 2000W PSUs. + - System management board based on Intel Coffee Lake CPU + with secure-boot support. + +QM3000 is a 115.2Tbps switch based on Nvidia Quantum-3 ASIC. +It provides up-to 800Gbps full bidirectional bandwidth per port. +The system supports 72 OSFP cages and fits into standard 4U racks. + +QM3000 Features: + - 72 OSFP ports or 144 aggregated XDR ports supporting 800Gbps speeds. + - Air-cooled with 9 + 1 redundant fan units. + - 4 + 4 redundant 2000W PSUs. + - System management board based on Intel Coffee Lake CPU + with secure-boot support. + +Signed-off-by: Felix Radensky +Reviewed-by: Vadim Pasternak +--- + drivers/platform/mellanox/mlx-platform.c | 1057 +++++++++++++++++++++++++++++- + 1 file changed, 1037 insertions(+), 20 deletions(-) + +diff --git a/drivers/platform/mellanox/mlx-platform.c b/drivers/platform/mellanox/mlx-platform.c +index 20211d28c..66b1f32f5 100644 +--- a/drivers/platform/mellanox/mlx-platform.c ++++ b/drivers/platform/mellanox/mlx-platform.c +@@ -51,6 +51,7 @@ + #define MLXPLAT_CPLD_LPC_REG_LED5_OFFSET 0x24 + #define MLXPLAT_CPLD_LPC_REG_LED6_OFFSET 0x25 + #define MLXPLAT_CPLD_LPC_REG_LED7_OFFSET 0x26 ++#define MLXPLAT_CPLD_LPC_REG_LED8_OFFSET 0x27 + #define MLXPLAT_CPLD_LPC_REG_FAN_DIRECTION 0x2a + #define MLXPLAT_CPLD_LPC_REG_GP0_RO_OFFSET 0x2b + #define MLXPLAT_CPLD_LPC_REG_GPCOM0_OFFSET 0x2d +@@ -96,9 +97,21 @@ + #define MLXPLAT_CPLD_LPC_REG_LC_IN_OFFSET 0x70 + #define MLXPLAT_CPLD_LPC_REG_LC_IN_EVENT_OFFSET 0x71 + #define MLXPLAT_CPLD_LPC_REG_LC_IN_MASK_OFFSET 0x72 ++#define MLXPLAT_CPLD_LPC_REG_CPLD6_VER_OFFSET 0x7c ++#define MLXPLAT_CPLD_LPC_REG_CPLD6_PN_OFFSET 0x7d ++#define MLXPLAT_CPLD_LPC_REG_CPLD6_PN1_OFFSET 0x7e ++#define MLXPLAT_CPLD_LPC_REG_ASIC3_HEALTH_OFFSET 0x82 ++#define MLXPLAT_CPLD_LPC_REG_ASIC3_EVENT_OFFSET 0x83 ++#define MLXPLAT_CPLD_LPC_REG_ASIC3_MASK_OFFSET 0x84 ++#define MLXPLAT_CPLD_LPC_REG_ASIC4_HEALTH_OFFSET 0x85 ++#define MLXPLAT_CPLD_LPC_REG_ASIC4_EVENT_OFFSET 0x86 ++#define MLXPLAT_CPLD_LPC_REG_ASIC4_MASK_OFFSET 0x87 + #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_FAN2_OFFSET 0x8b ++#define MLXPLAT_CPLD_LPC_REG_FAN2_EVENT_OFFSET 0x8c ++#define MLXPLAT_CPLD_LPC_REG_FAN2_MASK_OFFSET 0x8d + #define MLXPLAT_CPLD_LPC_REG_CPLD5_VER_OFFSET 0x8e + #define MLXPLAT_CPLD_LPC_REG_CPLD5_PN_OFFSET 0x8f + #define MLXPLAT_CPLD_LPC_REG_CPLD5_PN1_OFFSET 0x90 +@@ -130,10 +143,15 @@ + #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_TACHO19_OFFSET 0xb4 ++#define MLXPLAT_CPLD_LPC_REG_TACHO20_OFFSET 0xb5 + #define MLXPLAT_CPLD_LPC_REG_DBG1_OFFSET 0xb6 + #define MLXPLAT_CPLD_LPC_REG_DBG2_OFFSET 0xb7 + #define MLXPLAT_CPLD_LPC_REG_DBG3_OFFSET 0xb8 + #define MLXPLAT_CPLD_LPC_REG_DBG4_OFFSET 0xb9 ++#define MLXPLAT_CPLD_LPC_REG_TACHO17_OFFSET 0xba ++#define MLXPLAT_CPLD_LPC_REG_TACHO18_OFFSET 0xbb ++#define MLXPLAT_CPLD_LPC_REG_ASIC_CAP_OFFSET 0xc1 + #define MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET 0xc2 + #define MLXPLAT_CPLD_LPC_REG_SPI_CHNL_SELECT 0xc3 + #define MLXPLAT_CPLD_LPC_REG_CPLD5_MVER_OFFSET 0xc4 +@@ -184,6 +202,8 @@ + #define MLXPLAT_CPLD_LPC_REG_CONFIG1_OFFSET 0xfb + #define MLXPLAT_CPLD_LPC_REG_CONFIG2_OFFSET 0xfc + #define MLXPLAT_CPLD_LPC_REG_CONFIG3_OFFSET 0xfd ++#define MLXPLAT_CPLD_LPC_REG_TACHO15_OFFSET 0xfe ++#define MLXPLAT_CPLD_LPC_REG_TACHO16_OFFSET 0xff + #define MLXPLAT_CPLD_LPC_REG_EXT_MIN_OFFSET 0x100 + #define MLXPLAT_CPLD_LPC_REG_EXT_MID_OFFSET 0x195 + #define MLXPLAT_CPLD_LPC_REG_EXT_MAX_OFFSET 0x1ff +@@ -236,20 +256,30 @@ + #define MLXPLAT_CPLD_LOW_AGGR_MASK_ASIC2 BIT(2) + #define MLXPLAT_CPLD_LOW_AGGR_MASK_PWR_BUT GENMASK(5, 4) + #define MLXPLAT_CPLD_LOW_AGGR_MASK_I2C BIT(6) ++#define MLXPLAT_CPLD_LOW_AGGR_MASK_MULTI_ASICS GENMASK(3, 0) ++#define MLXPLAT_CPLD_LOW_AGGR_MASK_FRU BIT(7) + #define MLXPLAT_CPLD_PSU_MASK GENMASK(1, 0) + #define MLXPLAT_CPLD_PWR_MASK GENMASK(1, 0) + #define MLXPLAT_CPLD_PSU_EXT_MASK GENMASK(3, 0) + #define MLXPLAT_CPLD_PWR_EXT_MASK GENMASK(3, 0) ++#define MLXPLAT_CPLD_PSU_XDR_MASK GENMASK(7, 0) ++#define MLXPLAT_CPLD_PWR_XDR_MASK GENMASK(7, 0) + #define MLXPLAT_CPLD_FAN_MASK GENMASK(3, 0) + #define MLXPLAT_CPLD_ASIC_MASK GENMASK(1, 0) ++#define MLXPLAT_CPLD_ASIC_XDR_MASK GENMASK(3, 0) + #define MLXPLAT_CPLD_FAN_NG_MASK GENMASK(6, 0) + #define MLXPLAT_CPLD_FAN_QMB8700_MASK GENMASK(5, 0) ++#define MLXPLAT_CPLD_FAN_XDR_MASK GENMASK(7, 0) ++#define MLXPLAT_CPLD_FAN_XDR_EXT_MASK GENMASK(1, 0) + #define MLXPLAT_CPLD_LED_LO_NIBBLE_MASK GENMASK(7, 4) + #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_FU_CAP_MASK GENMASK(1, 0) ++#define MLXPLAT_CPLD_PSU_CAP_MASK GENMASK(3, 0) ++#define MLXPLAT_CPLD_FAN_CAP_MASK GENMASK(7, 0) ++#define MLXPLAT_CPLD_ASIC_CAP_MASK GENMASK(7, 0) + #define MLXPLAT_CPLD_PWR_BUTTON_MASK BIT(0) + #define MLXPLAT_CPLD_LATCH_RST_MASK BIT(6) + #define MLXPLAT_CPLD_THERMAL1_PDB_MASK BIT(3) +@@ -295,6 +325,7 @@ + #define MLXPLAT_CPLD_CH4_ETH_MODULAR 51 + #define MLXPLAT_CPLD_CH2_RACK_SWITCH 18 + #define MLXPLAT_CPLD_CH2_NG800 34 ++#define MLXPLAT_CPLD_CH2_XDR 66 + + /* Number of LPC attached MUX platform devices */ + #define MLXPLAT_CPLD_LPC_MUX_DEVS 4 +@@ -303,6 +334,7 @@ + #define MLXPLAT_CPLD_NR_NONE -1 + #define MLXPLAT_CPLD_PSU_DEFAULT_NR 10 + #define MLXPLAT_CPLD_PSU_MSNXXXX_NR 4 ++#define MLXPLAT_CPLD_PSU_XDR_NR 3 + #define MLXPLAT_CPLD_FAN1_DEFAULT_NR 11 + #define MLXPLAT_CPLD_FAN2_DEFAULT_NR 12 + #define MLXPLAT_CPLD_FAN3_DEFAULT_NR 13 +@@ -645,6 +677,38 @@ static struct i2c_mux_reg_platform_data mlxplat_ng800_mux_data[] = { + + }; + ++/* Platform channels for XDR system family */ ++static const int mlxplat_xdr_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, ++ 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, ++ 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64 ++}; ++ ++/* Platform XDR mux data */ ++static struct i2c_mux_reg_platform_data mlxplat_xdr_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_xdr_channels, ++ .n_values = ARRAY_SIZE(mlxplat_xdr_channels), ++ }, ++ { ++ .parent = 1, ++ .base_nr = MLXPLAT_CPLD_CH2_XDR, ++ .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[] = { + { +@@ -664,6 +728,21 @@ static struct i2c_board_info mlxplat_mlxcpld_ext_pwr[] = { + }, + }; + ++static struct i2c_board_info mlxplat_mlxcpld_xdr_pwr[] = { ++ { ++ I2C_BOARD_INFO("dps460", 0x5d), ++ }, ++ { ++ I2C_BOARD_INFO("dps460", 0x5c), ++ }, ++ { ++ I2C_BOARD_INFO("dps460", 0x5e), ++ }, ++ { ++ I2C_BOARD_INFO("dps460", 0x5f), ++ }, ++}; ++ + static struct i2c_board_info mlxplat_mlxcpld_pwr_ng800[] = { + { + I2C_BOARD_INFO("dps460", 0x59), +@@ -1533,6 +1612,430 @@ static struct mlxreg_core_item mlxplat_mlxcpld_ng800_items[] = { + }, + }; + ++/* Platform hotplug XDR system family data */ ++static struct mlxreg_core_data mlxplat_mlxcpld_xdr_psu_items_data[] = { ++ { ++ .label = "psu1", ++ .reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET, ++ .mask = BIT(0), ++ .slot = 1, ++ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ }, ++ { ++ .label = "psu2", ++ .reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET, ++ .mask = BIT(1), ++ .slot = 2, ++ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ }, ++ { ++ .label = "psu3", ++ .reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET, ++ .mask = BIT(2), ++ .slot = 3, ++ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ }, ++ { ++ .label = "psu4", ++ .reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET, ++ .mask = BIT(3), ++ .slot = 4, ++ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ }, ++ { ++ .label = "psu5", ++ .reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET, ++ .mask = BIT(4), ++ .slot = 5, ++ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ }, ++ { ++ .label = "psu6", ++ .reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET, ++ .mask = BIT(5), ++ .slot = 6, ++ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ }, ++ { ++ .label = "psu7", ++ .reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET, ++ .mask = BIT(6), ++ .slot = 7, ++ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ }, ++ { ++ .label = "psu8", ++ .reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET, ++ .mask = BIT(7), ++ .slot = 8, ++ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ }, ++}; ++ ++static struct mlxreg_core_data mlxplat_mlxcpld_xdr_pwr_items_data[] = { ++ { ++ .label = "pwr1", ++ .reg = MLXPLAT_CPLD_LPC_REG_PWR_OFFSET, ++ .mask = BIT(0), ++ .slot = 1, ++ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, ++ .hpdev.brdinfo = &mlxplat_mlxcpld_pwr[0], ++ .hpdev.nr = MLXPLAT_CPLD_PSU_MSNXXXX_NR, ++ }, ++ { ++ .label = "pwr2", ++ .reg = MLXPLAT_CPLD_LPC_REG_PWR_OFFSET, ++ .mask = BIT(1), ++ .slot = 2, ++ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, ++ .hpdev.brdinfo = &mlxplat_mlxcpld_pwr[1], ++ .hpdev.nr = MLXPLAT_CPLD_PSU_MSNXXXX_NR, ++ }, ++ { ++ .label = "pwr3", ++ .reg = MLXPLAT_CPLD_LPC_REG_PWR_OFFSET, ++ .mask = BIT(2), ++ .slot = 3, ++ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, ++ .hpdev.brdinfo = &mlxplat_mlxcpld_ext_pwr[0], ++ .hpdev.nr = MLXPLAT_CPLD_PSU_MSNXXXX_NR, ++ }, ++ { ++ .label = "pwr4", ++ .reg = MLXPLAT_CPLD_LPC_REG_PWR_OFFSET, ++ .mask = BIT(3), ++ .slot = 4, ++ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, ++ .hpdev.brdinfo = &mlxplat_mlxcpld_ext_pwr[1], ++ .hpdev.nr = MLXPLAT_CPLD_PSU_MSNXXXX_NR, ++ }, ++ { ++ .label = "pwr5", ++ .reg = MLXPLAT_CPLD_LPC_REG_PWR_OFFSET, ++ .mask = BIT(4), ++ .slot = 5, ++ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, ++ .hpdev.brdinfo = &mlxplat_mlxcpld_xdr_pwr[0], ++ .hpdev.nr = MLXPLAT_CPLD_PSU_XDR_NR, ++ }, ++ { ++ .label = "pwr6", ++ .reg = MLXPLAT_CPLD_LPC_REG_PWR_OFFSET, ++ .mask = BIT(5), ++ .slot = 6, ++ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, ++ .hpdev.brdinfo = &mlxplat_mlxcpld_xdr_pwr[1], ++ .hpdev.nr = MLXPLAT_CPLD_PSU_XDR_NR, ++ }, ++ { ++ .label = "pwr7", ++ .reg = MLXPLAT_CPLD_LPC_REG_PWR_OFFSET, ++ .mask = BIT(6), ++ .slot = 7, ++ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, ++ .hpdev.brdinfo = &mlxplat_mlxcpld_xdr_pwr[2], ++ .hpdev.nr = MLXPLAT_CPLD_PSU_XDR_NR, ++ }, ++ { ++ .label = "pwr8", ++ .reg = MLXPLAT_CPLD_LPC_REG_PWR_OFFSET, ++ .mask = BIT(7), ++ .slot = 8, ++ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, ++ .hpdev.brdinfo = &mlxplat_mlxcpld_xdr_pwr[3], ++ .hpdev.nr = MLXPLAT_CPLD_PSU_XDR_NR, ++ }, ++}; ++ ++static struct mlxreg_core_data mlxplat_mlxcpld_xdr_fan_items_data[] = { ++ { ++ .label = "fan1", ++ .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ .mask = BIT(0), ++ .slot = 1, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_FAN_XDR_MASK, ++ .bit = BIT(0), ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ }, ++ { ++ .label = "fan2", ++ .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ .mask = BIT(1), ++ .slot = 2, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_FAN_XDR_MASK, ++ .bit = BIT(1), ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ }, ++ { ++ .label = "fan3", ++ .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ .mask = BIT(2), ++ .slot = 3, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_FAN_XDR_MASK, ++ .bit = BIT(2), ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ }, ++ { ++ .label = "fan4", ++ .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ .mask = BIT(3), ++ .slot = 4, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_FAN_XDR_MASK, ++ .bit = BIT(3), ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ }, ++ { ++ .label = "fan5", ++ .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ .mask = BIT(4), ++ .slot = 5, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_FAN_XDR_MASK, ++ .bit = BIT(4), ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ }, ++ { ++ .label = "fan6", ++ .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ .mask = BIT(5), ++ .slot = 6, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_FAN_XDR_MASK, ++ .bit = BIT(5), ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ }, ++ { ++ .label = "fan7", ++ .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ .mask = BIT(6), ++ .slot = 7, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_FAN_XDR_MASK, ++ .bit = BIT(6), ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ }, ++ { ++ .label = "fan8", ++ .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ .mask = BIT(7), ++ .slot = 8, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_FAN_XDR_MASK, ++ .bit = BIT(7), ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ }, ++}; ++ ++static struct mlxreg_core_data mlxplat_mlxcpld_xdr_ext_fan_items_data[] = { ++ { ++ .label = "fan9", ++ .reg = MLXPLAT_CPLD_LPC_REG_FAN2_OFFSET, ++ .mask = BIT(0), ++ .slot = 9, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_FAN_XDR_MASK, ++ .bit = BIT(0), ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ }, ++ { ++ .label = "fan10", ++ .reg = MLXPLAT_CPLD_LPC_REG_FAN2_OFFSET, ++ .mask = BIT(1), ++ .slot = 10, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_FAN_XDR_MASK, ++ .bit = BIT(1), ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ }, ++ { ++ .label = "fan11", ++ .reg = MLXPLAT_CPLD_LPC_REG_FAN2_OFFSET, ++ .mask = BIT(2), ++ .slot = 11, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_FAN_XDR_MASK, ++ .bit = BIT(2), ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ }, ++ { ++ .label = "fan12", ++ .reg = MLXPLAT_CPLD_LPC_REG_FAN2_OFFSET, ++ .mask = BIT(3), ++ .slot = 12, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_FAN_XDR_MASK, ++ .bit = BIT(3), ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ }, ++}; ++ ++static struct mlxreg_core_data mlxplat_mlxcpld_xdr_asic1_items_data[] = { ++ { ++ .label = "asic1", ++ .reg = MLXPLAT_CPLD_LPC_REG_ASIC_HEALTH_OFFSET, ++ .mask = MLXPLAT_CPLD_ASIC_MASK, ++ .slot = 1, ++ .capability = MLXPLAT_CPLD_LPC_REG_ASIC_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_ASIC_XDR_MASK, ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ } ++}; ++ ++static struct mlxreg_core_data mlxplat_mlxcpld_xdr_asic2_items_data[] = { ++ { ++ .label = "asic2", ++ .reg = MLXPLAT_CPLD_LPC_REG_ASIC2_HEALTH_OFFSET, ++ .mask = MLXPLAT_CPLD_ASIC_MASK, ++ .slot = 2, ++ .capability = MLXPLAT_CPLD_LPC_REG_ASIC_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_ASIC_CAP_MASK, ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ } ++}; ++ ++static struct mlxreg_core_data mlxplat_mlxcpld_xdr_asic3_items_data[] = { ++ { ++ .label = "asic3", ++ .reg = MLXPLAT_CPLD_LPC_REG_ASIC3_HEALTH_OFFSET, ++ .mask = MLXPLAT_CPLD_ASIC_MASK, ++ .slot = 3, ++ .capability = MLXPLAT_CPLD_LPC_REG_ASIC_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_ASIC_CAP_MASK, ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ } ++}; ++ ++static struct mlxreg_core_data mlxplat_mlxcpld_xdr_asic4_items_data[] = { ++ { ++ .label = "asic4", ++ .reg = MLXPLAT_CPLD_LPC_REG_ASIC4_HEALTH_OFFSET, ++ .mask = MLXPLAT_CPLD_ASIC_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_ASIC_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_ASIC_CAP_MASK, ++ .slot = 4, ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ } ++}; ++ ++static struct mlxreg_core_item mlxplat_mlxcpld_xdr_items[] = { ++ { ++ .data = mlxplat_mlxcpld_xdr_psu_items_data, ++ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, ++ .reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET, ++ .mask = MLXPLAT_CPLD_PSU_XDR_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, ++ .count = ARRAY_SIZE(mlxplat_mlxcpld_xdr_psu_items_data), ++ .inversed = 1, ++ .health = false, ++ }, ++ { ++ .data = mlxplat_mlxcpld_xdr_pwr_items_data, ++ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, ++ .reg = MLXPLAT_CPLD_LPC_REG_PWR_OFFSET, ++ .mask = MLXPLAT_CPLD_PWR_XDR_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, ++ .count = ARRAY_SIZE(mlxplat_mlxcpld_xdr_pwr_items_data), ++ .inversed = 0, ++ .health = false, ++ }, ++ { ++ .data = mlxplat_mlxcpld_xdr_fan_items_data, ++ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, ++ .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ .mask = MLXPLAT_CPLD_FAN_XDR_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_FAN_CAP_MASK, ++ .count = ARRAY_SIZE(mlxplat_mlxcpld_xdr_fan_items_data), ++ .inversed = 1, ++ .health = false, ++ }, ++ { ++ .data = mlxplat_mlxcpld_xdr_ext_fan_items_data, ++ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, ++ .reg = MLXPLAT_CPLD_LPC_REG_FAN2_OFFSET, ++ .mask = MLXPLAT_CPLD_FAN_XDR_EXT_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_FAN_CAP_MASK, ++ .count = ARRAY_SIZE(mlxplat_mlxcpld_xdr_ext_fan_items_data), ++ .inversed = 1, ++ .health = false, ++ }, ++ { ++ .data = mlxplat_mlxcpld_xdr_asic1_items_data, ++ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, ++ .reg = MLXPLAT_CPLD_LPC_REG_ASIC_HEALTH_OFFSET, ++ .mask = MLXPLAT_CPLD_ASIC_XDR_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_ASIC_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_ASIC_CAP_MASK, ++ .count = ARRAY_SIZE(mlxplat_mlxcpld_xdr_asic1_items_data), ++ .inversed = 0, ++ .health = true, ++ }, ++ { ++ .data = mlxplat_mlxcpld_xdr_asic2_items_data, ++ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, ++ .reg = MLXPLAT_CPLD_LPC_REG_ASIC2_HEALTH_OFFSET, ++ .mask = MLXPLAT_CPLD_ASIC_XDR_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_ASIC_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_ASIC_CAP_MASK, ++ .count = ARRAY_SIZE(mlxplat_mlxcpld_xdr_asic2_items_data), ++ .inversed = 0, ++ .health = true, ++ }, ++ { ++ .data = mlxplat_mlxcpld_xdr_asic3_items_data, ++ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, ++ .reg = MLXPLAT_CPLD_LPC_REG_ASIC3_HEALTH_OFFSET, ++ .mask = MLXPLAT_CPLD_ASIC_XDR_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_ASIC_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_ASIC_XDR_MASK, ++ .count = ARRAY_SIZE(mlxplat_mlxcpld_xdr_asic3_items_data), ++ .inversed = 0, ++ .health = true, ++ }, ++ { ++ .data = mlxplat_mlxcpld_xdr_asic4_items_data, ++ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, ++ .reg = MLXPLAT_CPLD_LPC_REG_ASIC4_HEALTH_OFFSET, ++ .mask = MLXPLAT_CPLD_ASIC_XDR_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_ASIC_CAP_OFFSET, ++ .capability_mask = MLXPLAT_CPLD_ASIC_XDR_MASK, ++ .count = ARRAY_SIZE(mlxplat_mlxcpld_xdr_asic4_items_data), ++ .inversed = 0, ++ .health = true, ++ }, ++}; ++ + static + struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_ext_data = { + .items = mlxplat_mlxcpld_ext_items, +@@ -1553,6 +2056,16 @@ struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_ng800_data = { + .mask_low = MLXPLAT_CPLD_LOW_AGGR_MASK_LOW | MLXPLAT_CPLD_LOW_AGGR_MASK_ASIC2, + }; + ++static ++struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_xdr_data = { ++ .items = mlxplat_mlxcpld_xdr_items, ++ .counter = ARRAY_SIZE(mlxplat_mlxcpld_xdr_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_FRU | MLXPLAT_CPLD_LOW_AGGR_MASK_MULTI_ASICS, ++}; ++ + static struct mlxreg_core_data mlxplat_mlxcpld_modular_pwr_items_data[] = { + { + .label = "pwr1", +@@ -3395,35 +3908,209 @@ static struct mlxreg_core_data mlxplat_mlxcpld_l1_switch_led_data[] = { + .reg = MLXPLAT_CPLD_LPC_REG_LED3_OFFSET, + .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, + .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, +- .bit = BIT(3), ++ .bit = BIT(3), ++ }, ++ { ++ .label = "fan5:green", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED4_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .bit = BIT(4), ++ }, ++ { ++ .label = "fan5:orange", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED4_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .bit = BIT(4), ++ }, ++ { ++ .label = "fan6:green", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED4_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .bit = BIT(5), ++ }, ++ { ++ .label = "fan6:orange", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED4_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .bit = BIT(5), ++ }, ++ { ++ .label = "uid:blue", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED5_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, ++ }, ++}; ++ ++static struct mlxreg_core_platform_data mlxplat_l1_switch_led_data = { ++ .data = mlxplat_mlxcpld_l1_switch_led_data, ++ .counter = ARRAY_SIZE(mlxplat_mlxcpld_l1_switch_led_data), ++}; ++ ++/* Platform led data for XDR systems */ ++static struct mlxreg_core_data mlxplat_mlxcpld_xdr_led_data[] = { ++ { ++ .label = "status:green", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED1_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, ++ }, ++ { ++ .label = "status:amber", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED1_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK ++ }, ++ { ++ .label = "psu:green", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED1_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, ++ }, ++ { ++ .label = "psu:amber", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED1_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, ++ }, ++ { ++ .label = "fan1:green", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED2_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .slot = 1, ++ }, ++ { ++ .label = "fan1:amber", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED2_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .slot = 1, ++ }, ++ { ++ .label = "fan2:green", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED2_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .slot = 2, ++ }, ++ { ++ .label = "fan2:amber", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED2_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .slot = 2, ++ }, ++ { ++ .label = "fan3:green", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED3_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .slot = 3, ++ }, ++ { ++ .label = "fan3:amber", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED3_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .slot = 3, ++ }, ++ { ++ .label = "fan4:green", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED3_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .slot = 4, ++ }, ++ { ++ .label = "fan4:amber", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED3_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .slot = 4, ++ }, ++ { ++ .label = "fan5:green", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED4_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .slot = 5, ++ }, ++ { ++ .label = "fan5:amber", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED4_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .slot = 5, ++ }, ++ { ++ .label = "fan6:green", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED4_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .slot = 6, ++ }, ++ { ++ .label = "fan6:amber", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED4_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .slot = 6, ++ }, ++ { ++ .label = "fan7:green", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED6_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .slot = 7, ++ }, ++ { ++ .label = "fan7:amber", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED6_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .slot = 7, + }, + { +- .label = "fan5:green", +- .reg = MLXPLAT_CPLD_LPC_REG_LED4_OFFSET, ++ .label = "fan8:green", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED7_OFFSET, + .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, + .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, +- .bit = BIT(4), ++ .slot = 8, + }, + { +- .label = "fan5:orange", +- .reg = MLXPLAT_CPLD_LPC_REG_LED4_OFFSET, ++ .label = "fan8:amber", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED7_OFFSET, + .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, + .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, +- .bit = BIT(4), ++ .slot = 8, + }, + { +- .label = "fan6:green", +- .reg = MLXPLAT_CPLD_LPC_REG_LED4_OFFSET, ++ .label = "fan9:green", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED7_OFFSET, + .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, + .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, +- .bit = BIT(5), ++ .slot = 9, + }, + { +- .label = "fan6:orange", +- .reg = MLXPLAT_CPLD_LPC_REG_LED4_OFFSET, ++ .label = "fan9:amber", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED7_OFFSET, + .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, + .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, +- .bit = BIT(5), ++ .slot = 9, ++ }, ++ { ++ .label = "fan10:green", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED8_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .slot = 10, ++ }, ++ { ++ .label = "fan10:amber", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED8_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .slot = 10, + }, + { + .label = "uid:blue", +@@ -3432,9 +4119,9 @@ static struct mlxreg_core_data mlxplat_mlxcpld_l1_switch_led_data[] = { + }, + }; + +-static struct mlxreg_core_platform_data mlxplat_l1_switch_led_data = { +- .data = mlxplat_mlxcpld_l1_switch_led_data, +- .counter = ARRAY_SIZE(mlxplat_mlxcpld_l1_switch_led_data), ++static struct mlxreg_core_platform_data mlxplat_xdr_led_data = { ++ .data = mlxplat_mlxcpld_xdr_led_data, ++ .counter = ARRAY_SIZE(mlxplat_mlxcpld_xdr_led_data), + }; + + /* Platform register access default */ +@@ -3733,6 +4420,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { + .bit = GENMASK(7, 0), + .mode = 0444, + }, ++ { ++ .label = "cpld6_version", ++ .reg = MLXPLAT_CPLD_LPC_REG_CPLD6_VER_OFFSET, ++ .bit = GENMASK(7, 0), ++ .mode = 0444, ++ }, + { + .label = "cpld1_pn", + .reg = MLXPLAT_CPLD_LPC_REG_CPLD1_PN_OFFSET, +@@ -3768,6 +4461,13 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { + .mode = 0444, + .regnum = 2, + }, ++ { ++ .label = "cpld6_pn", ++ .reg = MLXPLAT_CPLD_LPC_REG_CPLD6_PN_OFFSET, ++ .bit = GENMASK(15, 0), ++ .mode = 0444, ++ .regnum = 2, ++ }, + { + .label = "cpld1_version_min", + .reg = MLXPLAT_CPLD_LPC_REG_CPLD1_MVER_OFFSET, +@@ -3798,6 +4498,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { + .bit = GENMASK(7, 0), + .mode = 0444, + }, ++ { ++ .label = "cpld6_version_min", ++ .reg = MLXPLAT_CPLD_LPC_REG_CPLD6_MVER_OFFSET, ++ .bit = GENMASK(7, 0), ++ .mode = 0444, ++ }, + { + .label = "asic_reset", + .reg = MLXPLAT_CPLD_LPC_REG_RESET_GP2_OFFSET, +@@ -3984,6 +4690,43 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { + .mask = GENMASK(7, 0) & ~BIT(1), + .mode = 0200, + }, ++ { ++ .label = "psu3_on", ++ .reg = MLXPLAT_CPLD_LPC_REG_GP1_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(4), ++ .mode = 0200, ++ }, ++ { ++ .label = "psu4_on", ++ .reg = MLXPLAT_CPLD_LPC_REG_GP1_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(7), ++ .mode = 0200, ++ }, ++ { ++ .label = "psu5_on", ++ .reg = MLXPLAT_CPLD_LPC_REG_WP1_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(0), ++ .mode = 0200, ++ }, ++ ++ { ++ .label = "psu6_on", ++ .reg = MLXPLAT_CPLD_LPC_REG_WP1_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(1), ++ .mode = 0200, ++ }, ++ { ++ .label = "psu7_on", ++ .reg = MLXPLAT_CPLD_LPC_REG_WP1_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(2), ++ .mode = 0200, ++ }, ++ { ++ .label = "psu8_on", ++ .reg = MLXPLAT_CPLD_LPC_REG_WP1_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(3), ++ .mode = 0200, ++ }, + { + .label = "pwr_cycle", + .reg = MLXPLAT_CPLD_LPC_REG_GP1_OFFSET, +@@ -4059,6 +4802,20 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { + .bit = 1, + .mode = 0444, + }, ++ { ++ .label = "asic3_health", ++ .reg = MLXPLAT_CPLD_LPC_REG_ASIC3_HEALTH_OFFSET, ++ .mask = MLXPLAT_CPLD_ASIC_MASK, ++ .bit = 1, ++ .mode = 0444, ++ }, ++ { ++ .label = "asic4_health", ++ .reg = MLXPLAT_CPLD_LPC_REG_ASIC4_HEALTH_OFFSET, ++ .mask = MLXPLAT_CPLD_ASIC_MASK, ++ .bit = 1, ++ .mode = 0444, ++ }, + { + .label = "fan_dir", + .reg = MLXPLAT_CPLD_LPC_REG_FAN_DIRECTION, +@@ -5129,6 +5886,193 @@ static struct mlxreg_core_platform_data mlxplat_qmb8700_fan_data = { + .counter = ARRAY_SIZE(mlxplat_mlxcpld_qmb8700_fan_data), + }; + ++/* XDR platform fan data */ ++static struct mlxreg_core_data mlxplat_mlxcpld_xdr_fan_data[] = { ++ { ++ .label = "pwm1", ++ .reg = MLXPLAT_CPLD_LPC_REG_PWM1_OFFSET, ++ }, ++ { ++ .label = "pwm2", ++ .reg = MLXPLAT_CPLD_LPC_REG_PWM2_OFFSET, ++ }, ++ { ++ .label = "pwm3", ++ .reg = MLXPLAT_CPLD_LPC_REG_PWM3_OFFSET, ++ }, ++ { ++ .label = "pwm4", ++ .reg = MLXPLAT_CPLD_LPC_REG_PWM4_OFFSET, ++ }, ++ { ++ .label = "tacho1", ++ .reg = MLXPLAT_CPLD_LPC_REG_TACHO1_OFFSET, ++ .mask = GENMASK(7, 0), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, ++ .slot = 1, ++ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ }, ++ { ++ .label = "tacho2", ++ .reg = MLXPLAT_CPLD_LPC_REG_TACHO2_OFFSET, ++ .mask = GENMASK(7, 0), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, ++ .slot = 2, ++ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ }, ++ { ++ .label = "tacho3", ++ .reg = MLXPLAT_CPLD_LPC_REG_TACHO3_OFFSET, ++ .mask = GENMASK(7, 0), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, ++ .slot = 3, ++ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ }, ++ { ++ .label = "tacho4", ++ .reg = MLXPLAT_CPLD_LPC_REG_TACHO4_OFFSET, ++ .mask = GENMASK(7, 0), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, ++ .slot = 4, ++ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ }, ++ { ++ .label = "tacho5", ++ .reg = MLXPLAT_CPLD_LPC_REG_TACHO5_OFFSET, ++ .mask = GENMASK(7, 0), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, ++ .slot = 5, ++ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ }, ++ { ++ .label = "tacho6", ++ .reg = MLXPLAT_CPLD_LPC_REG_TACHO6_OFFSET, ++ .mask = GENMASK(7, 0), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, ++ .slot = 6, ++ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ }, ++ { ++ .label = "tacho7", ++ .reg = MLXPLAT_CPLD_LPC_REG_TACHO7_OFFSET, ++ .mask = GENMASK(7, 0), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, ++ .slot = 7, ++ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ }, ++ { ++ .label = "tacho8", ++ .reg = MLXPLAT_CPLD_LPC_REG_TACHO8_OFFSET, ++ .mask = GENMASK(7, 0), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, ++ .slot = 8, ++ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ }, ++ { ++ .label = "tacho9", ++ .reg = MLXPLAT_CPLD_LPC_REG_TACHO9_OFFSET, ++ .mask = GENMASK(7, 0), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, ++ .slot = 9, ++ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ }, ++ { ++ .label = "tacho10", ++ .reg = MLXPLAT_CPLD_LPC_REG_TACHO10_OFFSET, ++ .mask = GENMASK(7, 0), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, ++ .slot = 10, ++ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ }, ++ { ++ .label = "tacho11", ++ .reg = MLXPLAT_CPLD_LPC_REG_TACHO11_OFFSET, ++ .mask = GENMASK(7, 0), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, ++ .slot = 11, ++ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ }, ++ { ++ .label = "tacho12", ++ .reg = MLXPLAT_CPLD_LPC_REG_TACHO12_OFFSET, ++ .mask = GENMASK(7, 0), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, ++ .slot = 12, ++ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ }, ++ { ++ .label = "tacho13", ++ .reg = MLXPLAT_CPLD_LPC_REG_TACHO13_OFFSET, ++ .mask = GENMASK(7, 0), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, ++ .slot = 13, ++ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ }, ++ { ++ .label = "tacho14", ++ .reg = MLXPLAT_CPLD_LPC_REG_TACHO14_OFFSET, ++ .mask = GENMASK(7, 0), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, ++ .slot = 14, ++ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ }, ++ { ++ .label = "tacho15", ++ .reg = MLXPLAT_CPLD_LPC_REG_TACHO15_OFFSET, ++ .mask = GENMASK(7, 0), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, ++ .slot = 15, ++ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ }, ++ { ++ .label = "tacho16", ++ .reg = MLXPLAT_CPLD_LPC_REG_TACHO16_OFFSET, ++ .mask = GENMASK(7, 0), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, ++ .slot = 16, ++ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ }, ++ { ++ .label = "tacho17", ++ .reg = MLXPLAT_CPLD_LPC_REG_TACHO17_OFFSET, ++ .mask = GENMASK(7, 0), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, ++ .slot = 17, ++ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN2_OFFSET, ++ }, ++ { ++ .label = "tacho18", ++ .reg = MLXPLAT_CPLD_LPC_REG_TACHO18_OFFSET, ++ .mask = GENMASK(7, 0), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, ++ .slot = 18, ++ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN2_OFFSET, ++ }, ++ { ++ .label = "tacho19", ++ .reg = MLXPLAT_CPLD_LPC_REG_TACHO19_OFFSET, ++ .mask = GENMASK(7, 0), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, ++ .slot = 19, ++ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN2_OFFSET, ++ }, ++ { ++ .label = "tacho20", ++ .reg = MLXPLAT_CPLD_LPC_REG_TACHO20_OFFSET, ++ .mask = GENMASK(7, 0), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, ++ .slot = 20, ++ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN2_OFFSET, ++ }, ++}; ++ ++static struct mlxreg_core_platform_data mlxplat_xdr_fan_data = { ++ .data = mlxplat_mlxcpld_xdr_fan_data, ++ .counter = ARRAY_SIZE(mlxplat_mlxcpld_xdr_fan_data), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .version = 1, ++}; ++ + /* Watchdog type1: hardware implementation version1 + * (MSN2700, MSN2410, MSN2740, MSN2100 and MSN2140 systems). + */ +@@ -5361,6 +6305,7 @@ static bool mlxplat_mlxcpld_writeable_reg(struct device *dev, unsigned int reg) + case MLXPLAT_CPLD_LPC_REG_LED5_OFFSET: + case MLXPLAT_CPLD_LPC_REG_LED6_OFFSET: + case MLXPLAT_CPLD_LPC_REG_LED7_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_LED8_OFFSET: + case MLXPLAT_CPLD_LPC_REG_GP0_OFFSET: + case MLXPLAT_CPLD_LPC_REG_GP_RST_OFFSET: + case MLXPLAT_CPLD_LPC_REG_GP1_OFFSET: +@@ -5388,12 +6333,18 @@ static bool mlxplat_mlxcpld_writeable_reg(struct device *dev, unsigned int reg) + case MLXPLAT_CPLD_LPC_REG_ASIC_MASK_OFFSET: + case MLXPLAT_CPLD_LPC_REG_ASIC2_EVENT_OFFSET: + case MLXPLAT_CPLD_LPC_REG_ASIC2_MASK_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_ASIC3_EVENT_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_ASIC3_MASK_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_ASIC4_EVENT_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_ASIC4_MASK_OFFSET: + case MLXPLAT_CPLD_LPC_REG_PSU_EVENT_OFFSET: + case MLXPLAT_CPLD_LPC_REG_PSU_MASK_OFFSET: + case MLXPLAT_CPLD_LPC_REG_PWR_EVENT_OFFSET: + 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_FAN2_EVENT_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_FAN2_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: +@@ -5452,6 +6402,7 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) + case MLXPLAT_CPLD_LPC_REG_CPLD3_VER_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD4_VER_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD5_VER_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_CPLD6_VER_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD1_PN_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD1_PN1_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD2_PN_OFFSET: +@@ -5462,6 +6413,8 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) + case MLXPLAT_CPLD_LPC_REG_CPLD4_PN1_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD5_PN_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD5_PN1_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_CPLD6_PN_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_CPLD6_PN1_OFFSET: + case MLXPLAT_CPLD_LPC_REG_RESET_GP1_OFFSET: + case MLXPLAT_CPLD_LPC_REG_RESET_GP4_OFFSET: + case MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET: +@@ -5474,6 +6427,7 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) + case MLXPLAT_CPLD_LPC_REG_LED5_OFFSET: + case MLXPLAT_CPLD_LPC_REG_LED6_OFFSET: + case MLXPLAT_CPLD_LPC_REG_LED7_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_LED8_OFFSET: + case MLXPLAT_CPLD_LPC_REG_FAN_DIRECTION: + case MLXPLAT_CPLD_LPC_REG_GP0_RO_OFFSET: + case MLXPLAT_CPLD_LPC_REG_GPCOM0_OFFSET: +@@ -5511,6 +6465,12 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) + case MLXPLAT_CPLD_LPC_REG_ASIC2_HEALTH_OFFSET: + case MLXPLAT_CPLD_LPC_REG_ASIC2_EVENT_OFFSET: + case MLXPLAT_CPLD_LPC_REG_ASIC2_MASK_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_ASIC3_HEALTH_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_ASIC3_EVENT_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_ASIC3_MASK_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_ASIC4_HEALTH_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_ASIC4_EVENT_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_ASIC4_MASK_OFFSET: + case MLXPLAT_CPLD_LPC_REG_PSU_OFFSET: + case MLXPLAT_CPLD_LPC_REG_PSU_EVENT_OFFSET: + case MLXPLAT_CPLD_LPC_REG_PSU_MASK_OFFSET: +@@ -5520,6 +6480,9 @@ 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_FAN2_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_FAN2_EVENT_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_FAN2_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: +@@ -5593,6 +6556,13 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) + case MLXPLAT_CPLD_LPC_REG_TACHO12_OFFSET: + case MLXPLAT_CPLD_LPC_REG_TACHO13_OFFSET: + case MLXPLAT_CPLD_LPC_REG_TACHO14_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_TACHO15_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_TACHO16_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_TACHO17_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_TACHO18_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_TACHO19_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_TACHO20_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_ASIC_CAP_OFFSET: + case MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET: + case MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET: + case MLXPLAT_CPLD_LPC_REG_FAN_CAP2_OFFSET: +@@ -5618,6 +6588,7 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) + case MLXPLAT_CPLD_LPC_REG_CPLD3_VER_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD4_VER_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD5_VER_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_CPLD6_VER_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD1_PN_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD1_PN1_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD2_PN_OFFSET: +@@ -5628,6 +6599,8 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) + case MLXPLAT_CPLD_LPC_REG_CPLD4_PN1_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD5_PN_OFFSET: + case MLXPLAT_CPLD_LPC_REG_CPLD5_PN1_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_CPLD6_PN_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_CPLD6_PN1_OFFSET: + case MLXPLAT_CPLD_LPC_REG_RESET_GP1_OFFSET: + case MLXPLAT_CPLD_LPC_REG_RESET_GP4_OFFSET: + case MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET: +@@ -5640,6 +6613,7 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) + case MLXPLAT_CPLD_LPC_REG_LED5_OFFSET: + case MLXPLAT_CPLD_LPC_REG_LED6_OFFSET: + case MLXPLAT_CPLD_LPC_REG_LED7_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_LED8_OFFSET: + case MLXPLAT_CPLD_LPC_REG_FAN_DIRECTION: + case MLXPLAT_CPLD_LPC_REG_GP0_RO_OFFSET: + case MLXPLAT_CPLD_LPC_REG_GPCOM0_OFFSET: +@@ -5675,6 +6649,12 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) + case MLXPLAT_CPLD_LPC_REG_ASIC2_HEALTH_OFFSET: + case MLXPLAT_CPLD_LPC_REG_ASIC2_EVENT_OFFSET: + case MLXPLAT_CPLD_LPC_REG_ASIC2_MASK_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_ASIC3_HEALTH_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_ASIC3_EVENT_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_ASIC3_MASK_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_ASIC4_HEALTH_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_ASIC4_EVENT_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_ASIC4_MASK_OFFSET: + case MLXPLAT_CPLD_LPC_REG_PSU_OFFSET: + case MLXPLAT_CPLD_LPC_REG_PSU_EVENT_OFFSET: + case MLXPLAT_CPLD_LPC_REG_PSU_MASK_OFFSET: +@@ -5684,6 +6664,9 @@ 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_FAN2_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_FAN2_EVENT_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_FAN2_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: +@@ -5751,6 +6734,13 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) + case MLXPLAT_CPLD_LPC_REG_TACHO12_OFFSET: + case MLXPLAT_CPLD_LPC_REG_TACHO13_OFFSET: + case MLXPLAT_CPLD_LPC_REG_TACHO14_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_TACHO15_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_TACHO16_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_TACHO17_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_TACHO18_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_TACHO19_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_TACHO20_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_ASIC_CAP_OFFSET: + case MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET: + case MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET: + case MLXPLAT_CPLD_LPC_REG_FAN_CAP2_OFFSET: +@@ -6472,6 +7462,27 @@ static int __init mlxplat_dmi_bf3_comex_default_matched(const struct dmi_system_ + return 1; + } + ++static int __init mlxplat_dmi_xdr_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_xdr_mux_data); ++ mlxplat_mux_data = mlxplat_xdr_mux_data; ++ mlxplat_hotplug = &mlxplat_mlxcpld_xdr_data; ++ mlxplat_hotplug->deferred_nr = ++ mlxplat_msn21xx_channels[MLXPLAT_CPLD_GRP_CHNL_NUM - 1]; ++ mlxplat_led = &mlxplat_xdr_led_data; ++ mlxplat_regs_io = &mlxplat_default_ng_regs_io_data; ++ mlxplat_fan = &mlxplat_xdr_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 mlxplat_register_platform_device(); ++} ++ + static const struct dmi_system_id mlxplat_dmi_table[] __initconst = { + { + .callback = mlxplat_dmi_default_wc_matched, +@@ -6579,6 +7590,12 @@ static const struct dmi_system_id mlxplat_dmi_table[] __initconst = { + DMI_MATCH(DMI_BOARD_NAME, "VMOD0017"), + }, + }, ++ { ++ .callback = mlxplat_dmi_xdr_matched, ++ .matches = { ++ DMI_MATCH(DMI_BOARD_NAME, "VMOD0018"), ++ }, ++ }, + { + .callback = mlxplat_dmi_msn274x_matched, + .matches = { +-- +2.14.1 + From 56ba5b10b47858bf2d8b688ce0e299d849290381 Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Sun, 17 Dec 2023 14:02:47 +0800 Subject: [PATCH 066/419] [Mellanox] implement sfp.reset for CMIS management (#16862) - Why I did it For CMIS host management module, we need a different implementation for sfp.reset. This PR is to implement it - How I did it For SW control modules, do reset from hw_reset For FW control modules, do reset as the original way - How to verify it Manual test sonic-mgmt platform test --- .../mlnx-platform-api/sonic_platform/sfp.py | 72 +++++++++++++++---- .../mlnx-platform-api/sonic_platform/utils.py | 6 +- .../mlnx-platform-api/tests/test_sfp.py | 21 ++++-- 3 files changed, 77 insertions(+), 22 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index c5bcfddaf112..d03c0fe10e79 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -26,6 +26,7 @@ import ctypes import subprocess import os + import threading from sonic_py_common.logger import Logger from sonic_py_common.general import check_output_pipe from . import utils @@ -219,6 +220,9 @@ def __exit__(self, exc_type, exc_val, exc_tb): deinitialize_sdk_handle(self.sdk_handle) class NvidiaSFPCommon(SfpOptoeBase): + sfp_index_to_logical_port_dict = {} + sfp_index_to_logical_lock = threading.Lock() + def __init__(self, sfp_index): super(NvidiaSFPCommon, self).__init__() self.index = sfp_index + 1 @@ -247,7 +251,31 @@ def _get_module_info(self, sdk_index): error_type = utils.read_int_from_file(status_error_file_path) return oper_state, error_type - + + @classmethod + def get_sfp_index_to_logical_port(cls, force=False): + if not cls.sfp_index_to_logical_port_dict or force: + config_db = utils.DbUtils.get_db_instance('CONFIG_DB') + port_data = config_db.get_table('PORT') + for key, data in port_data.items(): + if data['index'] not in cls.sfp_index_to_logical_port_dict: + cls.sfp_index_to_logical_port_dict[int(data['index']) - 1] = key + + @classmethod + def get_logical_port_by_sfp_index(cls, sfp_index): + with cls.sfp_index_to_logical_lock: + cls.get_sfp_index_to_logical_port() + logical_port_name = cls.sfp_index_to_logical_port_dict.get(sfp_index) + if not logical_port_name: + cls.get_sfp_index_to_logical_port(force=True) + else: + config_db = utils.DbUtils.get_db_instance('CONFIG_DB') + current_index = int(config_db.get('CONFIG_DB', f'PORT|{logical_port_name}', 'index')) + if current_index != sfp_index: + cls.get_sfp_index_to_logical_port(force=True) + logical_port_name = cls.sfp_index_to_logical_port_dict.get(sfp_index) + return logical_port_name + class SFP(NvidiaSFPCommon): """Platform-specific SFP class""" @@ -299,6 +327,17 @@ def get_presence(self): Returns: bool: True if device is present, False if not """ + if DeviceDataManager.is_independent_mode(): + if utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/control') != 0: + if not utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/hw_present'): + return False + if not utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/power_good'): + return False + if not utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/power_on'): + return False + if utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/hw_reset') == 1: + return False + eeprom_raw = self._read_eeprom(0, 1, log_on_error=False) return eeprom_raw is not None @@ -455,8 +494,17 @@ def reset(self): refer plugins/sfpreset.py """ - file_path = SFP_SDK_MODULE_SYSFS_ROOT_TEMPLATE.format(self.sdk_index) + SFP_SYSFS_RESET - return utils.write_file(file_path, '1') + try: + if not self.is_sw_control(): + file_path = SFP_SDK_MODULE_SYSFS_ROOT_TEMPLATE.format(self.sdk_index) + SFP_SYSFS_RESET + return utils.write_file(file_path, '1') + else: + file_path = SFP_SDK_MODULE_SYSFS_ROOT_TEMPLATE.format(self.sdk_index) + SFP_SYSFS_HWRESET + return utils.write_file(file_path, '0') and utils.write_file(file_path, '1') + except Exception as e: + print(f'Failed to reset module - {e}') + logger.log_error(f'Failed to reset module - {e}') + return False @classmethod @@ -918,15 +966,15 @@ def is_sw_control(self): return False db = utils.DbUtils.get_db_instance('STATE_DB') - control_type = db.get('STATE_DB', f'TRANSCEIVER_MODULES_MGMT|{self.sdk_index}', 'control_type') - control_file_value = utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/control') - - if control_type == 'SW_CONTROL' and control_file_value == 1: - return True - elif control_type == 'FW_CONTROL' and control_file_value == 0: - return False - else: - raise Exception(f'Module {self.sdk_index} is in initialization, please retry later') + logical_port = NvidiaSFPCommon.get_logical_port_by_sfp_index(self.sdk_index) + if not logical_port: + raise Exception(f'Module {self.sdk_index} is not present or in initialization') + + initialized = db.exists('STATE_DB', f'TRANSCEIVER_STATUS|{logical_port}') + if not initialized: + raise Exception(f'Module {self.sdk_index} is not present or in initialization') + + return utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/control') == 1 class RJ45Port(NvidiaSFPCommon): diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/utils.py b/platform/mellanox/mlnx-platform-api/sonic_platform/utils.py index 1135903c24bf..a7354ac7b864 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/utils.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/utils.py @@ -381,9 +381,9 @@ def get_db_instance(cls, db_name, **kargs): cls.db_instances.data = {} if db_name not in cls.db_instances.data: - from swsscommon.swsscommon import SonicV2Connector - db = SonicV2Connector(use_unix_socket_path=True) - db.connect(db_name) + from swsscommon.swsscommon import ConfigDBConnector + db = ConfigDBConnector(use_unix_socket_path=True) + db.db_connect(db_name) cls.db_instances.data[db_name] = db return cls.db_instances.data[db_name] except Exception as e: diff --git a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py index dccc727bfe57..d273e9bce700 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py @@ -266,9 +266,14 @@ def test_dummy_apis(self, mock_get_xcvr_api): @mock.patch('sonic_platform.utils.write_file') def test_reset(self, mock_write): sfp = SFP(0) + sfp.is_sw_control = mock.MagicMock(return_value=False) mock_write.return_value = True assert sfp.reset() mock_write.assert_called_with('/sys/module/sx_core/asic0/module0/reset', '1') + sfp.is_sw_control.return_value = True + assert sfp.reset() + sfp.is_sw_control.side_effect = Exception('') + assert not sfp.reset() @mock.patch('sonic_platform.sfp.SFP.read_eeprom') def test_get_xcvr_api(self, mock_read): @@ -332,30 +337,32 @@ def test_get_temperature_threshold(self): assert sfp.get_temperature_warning_threashold() == 75.0 assert sfp.get_temperature_critical_threashold() == 85.0 + @mock.patch('sonic_platform.sfp.NvidiaSFPCommon.get_logical_port_by_sfp_index') @mock.patch('sonic_platform.utils.read_int_from_file') @mock.patch('sonic_platform.device_data.DeviceDataManager.is_independent_mode') @mock.patch('sonic_platform.utils.DbUtils.get_db_instance') - def test_is_sw_control(self, mock_get_db, mock_mode, mock_read): + def test_is_sw_control(self, mock_get_db, mock_mode, mock_read, mock_get_logical): sfp = SFP(0) mock_mode.return_value = False assert not sfp.is_sw_control() mock_mode.return_value = True + + mock_get_logical.return_value = None + with pytest.raises(Exception): + sfp.is_sw_control() + mock_get_logical.return_value = 'Ethernet0' mock_db = mock.MagicMock() mock_get_db.return_value = mock_db - mock_db.get = mock.MagicMock(return_value=None) + mock_db.exists = mock.MagicMock(return_value=False) with pytest.raises(Exception): sfp.is_sw_control() + mock_db.exists.return_value = True mock_read.return_value = 0 - mock_db.get.return_value = 'FW_CONTROL' assert not sfp.is_sw_control() mock_read.return_value = 1 - mock_db.get.return_value = 'SW_CONTROL' assert sfp.is_sw_control() - mock_read.return_value = 0 - with pytest.raises(Exception): - sfp.is_sw_control() @mock.patch('sonic_platform.device_data.DeviceDataManager.is_independent_mode', mock.MagicMock(return_value=False)) @mock.patch('sonic_platform.sfp.SFP.is_sw_control', mock.MagicMock(return_value=False)) From 1687a442debb8d5dd53ca8cc7e65b8a77a18dcb9 Mon Sep 17 00:00:00 2001 From: Nazarii Hnydyn Date: Wed, 6 Dec 2023 05:09:54 +0200 Subject: [PATCH 067/419] [frr]: Force disable next hop group support. (#17344) Signed-off-by: Nazarii Hnydyn nazariig@nvidia.com Closes #17345 This W/A was proposed by Nvidia FRR team before the long term solution is ready. Why I did it A W/A to fix default route installation during LAG member flap Work item tracking N/A How I did it Disabled FRR next hop group support How to verify it Do LAG member flap --- dockers/docker-fpm-frr/docker_init.sh | 4 ++++ dockers/docker-fpm-frr/frr/zebra/zebra.conf.j2 | 2 ++ platform/vs/docker-sonic-vs/frr/zebra.conf | 3 +-- src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/zebra.conf | 2 ++ .../tests/sample_output/py2/t2-chassis-fe-vni-zebra.conf | 2 ++ .../tests/sample_output/py2/t2-chassis-fe-zebra.conf | 2 ++ .../tests/sample_output/py2/zebra_frr.conf | 2 ++ .../tests/sample_output/py3/t2-chassis-fe-vni-zebra.conf | 2 ++ .../tests/sample_output/py3/t2-chassis-fe-zebra.conf | 2 ++ .../tests/sample_output/py3/zebra_frr.conf | 2 ++ 10 files changed, 21 insertions(+), 2 deletions(-) diff --git a/dockers/docker-fpm-frr/docker_init.sh b/dockers/docker-fpm-frr/docker_init.sh index 0ed274ec703f..390a403aa598 100755 --- a/dockers/docker-fpm-frr/docker_init.sh +++ b/dockers/docker-fpm-frr/docker_init.sh @@ -49,6 +49,10 @@ write_default_zebra_config() echo "no fpm use-next-hop-groups" >> $FILE_NAME echo "fpm address 127.0.0.1" >> $FILE_NAME } + + grep -q '^no zebra nexthop kernel enable' $FILE_NAME || { + echo "no zebra nexthop kernel enable" >> $FILE_NAME + } } if [[ ! -z "$NAMESPACE_ID" ]]; then diff --git a/dockers/docker-fpm-frr/frr/zebra/zebra.conf.j2 b/dockers/docker-fpm-frr/frr/zebra/zebra.conf.j2 index f5a56c316d41..4543ad8f974e 100644 --- a/dockers/docker-fpm-frr/frr/zebra/zebra.conf.j2 +++ b/dockers/docker-fpm-frr/frr/zebra/zebra.conf.j2 @@ -7,6 +7,8 @@ {% endblock banner %} ! {% block fpm %} +! Force disable next hop group support +no zebra nexthop kernel enable ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! diff --git a/platform/vs/docker-sonic-vs/frr/zebra.conf b/platform/vs/docker-sonic-vs/frr/zebra.conf index 4c994e60def2..1980a6e159f0 100644 --- a/platform/vs/docker-sonic-vs/frr/zebra.conf +++ b/platform/vs/docker-sonic-vs/frr/zebra.conf @@ -1,4 +1,3 @@ +no zebra nexthop kernel enable no fpm use-next-hop-groups - fpm address 127.0.0.1 - diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/zebra.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/zebra.conf index 6b7e1feff000..38db2964823e 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/zebra.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/zebra.conf @@ -4,6 +4,8 @@ ! file: zebra.conf ! ! +! Force disable next hop group support +no zebra nexthop kernel enable ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! diff --git a/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-vni-zebra.conf b/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-vni-zebra.conf index 8bb483456829..120878fe1186 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-vni-zebra.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-vni-zebra.conf @@ -4,6 +4,8 @@ ! file: zebra.conf ! ! +! Force disable next hop group support +no zebra nexthop kernel enable ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! diff --git a/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-zebra.conf b/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-zebra.conf index 402230348a4a..a6e3ad05310f 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-zebra.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-zebra.conf @@ -4,6 +4,8 @@ ! file: zebra.conf ! ! +! Force disable next hop group support +no zebra nexthop kernel enable ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! diff --git a/src/sonic-config-engine/tests/sample_output/py2/zebra_frr.conf b/src/sonic-config-engine/tests/sample_output/py2/zebra_frr.conf index 9d0ab16ee384..9e438caa0e34 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/zebra_frr.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/zebra_frr.conf @@ -4,6 +4,8 @@ ! file: zebra.conf ! ! +! Force disable next hop group support +no zebra nexthop kernel enable ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-vni-zebra.conf b/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-vni-zebra.conf index b55906056616..c6c973f7f05c 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-vni-zebra.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-vni-zebra.conf @@ -4,6 +4,8 @@ ! file: zebra.conf ! ! +! Force disable next hop group support +no zebra nexthop kernel enable ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-zebra.conf b/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-zebra.conf index 19e303639a55..84e76ecdb01c 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-zebra.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-zebra.conf @@ -4,6 +4,8 @@ ! file: zebra.conf ! ! +! Force disable next hop group support +no zebra nexthop kernel enable ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/zebra_frr.conf b/src/sonic-config-engine/tests/sample_output/py3/zebra_frr.conf index a5fb8b1ca104..b8adb98787a7 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/zebra_frr.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/zebra_frr.conf @@ -4,6 +4,8 @@ ! file: zebra.conf ! ! +! Force disable next hop group support +no zebra nexthop kernel enable ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! From 9d918889e4a20e3f8ebc42e9e3717ffbeb11157c Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Wed, 17 Jan 2024 18:50:22 -0800 Subject: [PATCH 068/419] dhcrelay: Don't look up the ifindex for the fallback interface (#17797) Currently, whenever isc-dhcp-relay forwards a packet upstream, internally, it will try to send it on a "fallback" interface. My understanding is that this isn't meant to be a real interface, but instead is basically saying to use Linux's regular routing stack to route the packet appropriately (rather than having isc-dhcp-relay specify specifically which interface to use). The problem is that on systems with a weak CPU, a large number of interfaces, and many upstream servers specified, this can introduce a noticeable delay in packets getting sent. The delay comes from trying to get the ifindex of the fallback interface. In one test case, it got to the point that only 2 packets could be processed per second. Because of this, dhcrelay will easily get backlogged and likely get to a point where packets get dropped in the kernel. Fix this by adding a check saying if we're using the fallback interface, then don't try to get the ifindex of this interface. We're never going to have an interface named this in SONiC. Signed-off-by: Saikrishna Arcot --- ...n-t-look-up-the-ifindex-for-fallback.patch | 34 +++++++++++++++++++ src/isc-dhcp/patch/series | 1 + 2 files changed, 35 insertions(+) create mode 100644 src/isc-dhcp/patch/0016-Don-t-look-up-the-ifindex-for-fallback.patch diff --git a/src/isc-dhcp/patch/0016-Don-t-look-up-the-ifindex-for-fallback.patch b/src/isc-dhcp/patch/0016-Don-t-look-up-the-ifindex-for-fallback.patch new file mode 100644 index 000000000000..55fde475ff61 --- /dev/null +++ b/src/isc-dhcp/patch/0016-Don-t-look-up-the-ifindex-for-fallback.patch @@ -0,0 +1,34 @@ +From 079ff1bb570dae96c4ca513e210c9856e9cc75b0 Mon Sep 17 00:00:00 2001 +From: Saikrishna Arcot +Date: Wed, 10 Jan 2024 23:30:17 -0800 +Subject: [PATCH] Don't look up the ifindex for fallback + +If sending a packet on the "fallback" interface, then don't try to get the +ifindex for that interface. There will never be an actual interface named +"fallback" in SONiC (at least, not one that we will want to use). + +This might save 0.009-0.012 seconds per upstream server, and when there +are as many as 48 upstream servers, it can save about 0.4-0.5 seconds of +time. This then allows dhcrelay to process more packets. + +Signed-off-by: Saikrishna Arcot + +diff --git a/common/socket.c b/common/socket.c +index da9f501..e707a7f 100644 +--- a/common/socket.c ++++ b/common/socket.c +@@ -767,7 +767,10 @@ ssize_t send_packet (interface, packet, raw, len, from, to, hto) + memcpy(&dst, to, sizeof(dst)); + m.msg_name = &dst; + m.msg_namelen = sizeof(dst); +- ifindex = if_nametoindex(interface->name); ++ if (strcmp(interface->name, "fallback") != 0) ++ ifindex = if_nametoindex(interface->name); ++ else ++ ifindex = 0; + + /* + * Set the data buffer we're sending. (Using this wacky +-- +2.34.1 + diff --git a/src/isc-dhcp/patch/series b/src/isc-dhcp/patch/series index 07f78949ae0b..5a58b41b1552 100644 --- a/src/isc-dhcp/patch/series +++ b/src/isc-dhcp/patch/series @@ -14,3 +14,4 @@ 0013-Fix-dhcrelay-agent-option-buffer-pointer-logic.patch 0014-enable-parallel-build.patch 0015-option-to-set-primary-address-in-interface.patch +0016-Don-t-look-up-the-ifindex-for-fallback.patch From 0fbdc2b8edd4d48a12ce55c9ac2f078cc860cf96 Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Wed, 27 Dec 2023 00:27:18 +0800 Subject: [PATCH 069/419] [Mellanox] wait until hw-management watchdog files ready (#17618) - Why I did it watchdog-control service always disarm watchdog during system startup stage. It could be the case that watchdog is not fully initialized while the watchdog-control service is accessing it. This PR adds a wait to make sure watchdog has been fully initialized. - How I did it adds a wait to make sure watchdog has been fully initialized. - How to verify it Manual test sonic regression --- platform/mellanox/mlnx-platform-api/sonic_platform/watchdog.py | 3 ++- platform/mellanox/mlnx-platform-api/tests/test_watchdog.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/watchdog.py b/platform/mellanox/mlnx-platform-api/sonic_platform/watchdog.py index 630163c12e18..9e16b6d69cf8 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/watchdog.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/watchdog.py @@ -283,7 +283,8 @@ def get_watchdog(): """ Return WatchdogType1 or WatchdogType2 based on system """ - + + utils.wait_until(lambda: os.path.exists('/run/hw-management/watchdog/main/state'), timeout=10, interval=1) watchdog_main_device_name = None for device in os.listdir("/dev/"): diff --git a/platform/mellanox/mlnx-platform-api/tests/test_watchdog.py b/platform/mellanox/mlnx-platform-api/tests/test_watchdog.py index 68d29d38a654..6e925d594708 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_watchdog.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_watchdog.py @@ -36,6 +36,7 @@ class TestWatchdog: + @mock.patch('sonic_platform.utils.wait_until', mock.MagicMock()) @mock.patch('sonic_platform.watchdog.is_mlnx_wd_main') @mock.patch('sonic_platform.watchdog.os.listdir') def test_get_watchdog_no_device(self, mock_listdir, mock_is_main): @@ -50,6 +51,7 @@ def test_get_watchdog_no_device(self, mock_listdir, mock_is_main): mock_is_main.return_value = False assert get_watchdog() is None + @mock.patch('sonic_platform.utils.wait_until', mock.MagicMock()) @mock.patch('sonic_platform.watchdog.is_mlnx_wd_main') @mock.patch('sonic_platform.watchdog.is_wd_type2') @mock.patch('sonic_platform.watchdog.os.listdir', mock.MagicMock(return_value=['watchdog1', 'watchdog2'])) From 3f29b28b36fd7921287559fdd3a5fdc4ee67b078 Mon Sep 17 00:00:00 2001 From: Longxiang Lyu <35479537+lolyu@users.noreply.github.com> Date: Fri, 19 Jan 2024 00:36:06 +0800 Subject: [PATCH 070/419] [dualtor] Disable zebra link-detect for vlan interfaces (#17784) * [dualtor] Disable zebra link-detect for vlan interfaces Signed-off-by: Longxiang Lyu --- .../frr/zebra/zebra.interfaces.conf.j2 | 8 +++ .../sample_output/py2/zebra_frr_dualtor.conf | 49 +++++++++++++++++++ .../sample_output/py3/zebra_frr_dualtor.conf | 49 +++++++++++++++++++ src/sonic-config-engine/tests/test_frr.py | 4 ++ 4 files changed, 110 insertions(+) create mode 100644 src/sonic-config-engine/tests/sample_output/py2/zebra_frr_dualtor.conf create mode 100644 src/sonic-config-engine/tests/sample_output/py3/zebra_frr_dualtor.conf diff --git a/dockers/docker-fpm-frr/frr/zebra/zebra.interfaces.conf.j2 b/dockers/docker-fpm-frr/frr/zebra/zebra.interfaces.conf.j2 index 44e8bca8b987..82b973d37cc9 100644 --- a/dockers/docker-fpm-frr/frr/zebra/zebra.interfaces.conf.j2 +++ b/dockers/docker-fpm-frr/frr/zebra/zebra.interfaces.conf.j2 @@ -24,5 +24,13 @@ interface {{ pc }} link-detect ! {% endfor %} +{% if (DEVICE_METADATA is defined) and ('localhost' in DEVICE_METADATA) and ('subtype' in DEVICE_METADATA['localhost']) and (DEVICE_METADATA['localhost']['subtype'].lower() == 'dualtor') %} +! Disable link-detect on VLAN interfaces for dualtor +{% for (name, prefix) in VLAN_INTERFACE|pfx_filter|unique(attribute=0) %} +interface {{ name }} +no link-detect +! +{% endfor %} +{% endif %} {% endblock interfaces %} ! diff --git a/src/sonic-config-engine/tests/sample_output/py2/zebra_frr_dualtor.conf b/src/sonic-config-engine/tests/sample_output/py2/zebra_frr_dualtor.conf new file mode 100644 index 000000000000..0f49b229b88d --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py2/zebra_frr_dualtor.conf @@ -0,0 +1,49 @@ +! +! =========== Managed by sonic-cfggen DO NOT edit manually! ==================== +! generated by templates/zebra/zebra.conf.j2 using config DB data +! file: zebra.conf +! +! +! Force disable next hop group support +no zebra nexthop kernel enable +! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages +no fpm use-next-hop-groups +! +fpm address 127.0.0.1 +! +! template: common/daemons.common.conf.j2 +! +hostname switch-t0 +password zebra +enable password zebra +! +log syslog informational +log facility local4 +! +! end of template: common/daemons.common.conf.j2! +! +! +! Enable nht through default route +ip nht resolve-via-default +ipv6 nht resolve-via-default +! Enable link-detect (default disabled) +interface PortChannel03 +link-detect +! +interface PortChannel02 +link-detect +! +interface PortChannel01 +link-detect +! +interface PortChannel04 +link-detect +! +! Disable link-detect on VLAN interfaces for dualtor +interface Vlan2000 +no link-detect +! +interface Vlan1000 +no link-detect +! +!! diff --git a/src/sonic-config-engine/tests/sample_output/py3/zebra_frr_dualtor.conf b/src/sonic-config-engine/tests/sample_output/py3/zebra_frr_dualtor.conf new file mode 100644 index 000000000000..2741ba54cf4f --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/zebra_frr_dualtor.conf @@ -0,0 +1,49 @@ +! +! =========== Managed by sonic-cfggen DO NOT edit manually! ==================== +! generated by templates/zebra/zebra.conf.j2 using config DB data +! file: zebra.conf +! +! +! Force disable next hop group support +no zebra nexthop kernel enable +! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages +no fpm use-next-hop-groups +! +fpm address 127.0.0.1 +! +! template: common/daemons.common.conf.j2 +! +hostname switch-t0 +password zebra +enable password zebra +! +log syslog informational +log facility local4 +! +! end of template: common/daemons.common.conf.j2! +! +! +! Enable nht through default route +ip nht resolve-via-default +ipv6 nht resolve-via-default +! Enable link-detect (default disabled) +interface PortChannel01 +link-detect +! +interface PortChannel02 +link-detect +! +interface PortChannel03 +link-detect +! +interface PortChannel04 +link-detect +! +! Disable link-detect on VLAN interfaces for dualtor +interface Vlan1000 +no link-detect +! +interface Vlan2000 +no link-detect +! +!! diff --git a/src/sonic-config-engine/tests/test_frr.py b/src/sonic-config-engine/tests/test_frr.py index 3b89f9452c50..92deef922752 100644 --- a/src/sonic-config-engine/tests/test_frr.py +++ b/src/sonic-config-engine/tests/test_frr.py @@ -74,3 +74,7 @@ def test_zebra_frr(self): def test_bgpd_frr_dualtor(self): extra_data = {"DEVICE_METADATA": {"localhost": {"subtype": "DualToR"}}} self.assertTrue(*self.run_case('bgpd/bgpd.conf.j2', 'bgpd_frr_dualtor.conf', extra_data=extra_data)) + + def test_zebra_frr_dualtor(self): + extra_data = {"DEVICE_METADATA": {"localhost": {"subtype": "DualToR"}}} + self.assertTrue(*self.run_case('zebra/zebra.conf.j2', 'zebra_frr_dualtor.conf', extra_data=extra_data)) From 8d65e2c5172ad5c6d21c3651a8914817d7eb9919 Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Thu, 4 Jan 2024 15:42:33 +0800 Subject: [PATCH 071/419] [Mellanox] Fix issues found for CMIS host management (#17637) - Why I did it 1. Thermal updater should wait more time for module to be initialized 2. sfp should get temperature threshold from EEPROM because SDK sysfs is not yet supported 3. Rename sfp function to fix typo 4. sfp.get_presence should return False if module is under initialization - How I did it 1. Thermal updater should wait more time for module to be initialized 2. sfp should get temperature threshold from EEPROM because SDK sysfs is not yet supported 3. Rename sfp function to fix typo 4. sfp.get_presence should return False if module is under initialization - How to verify it Manual test Unit test --- .../mlnx-platform-api/sonic_platform/sfp.py | 102 ++++++++++-------- .../sonic_platform/thermal.py | 9 +- .../sonic_platform/thermal_manager.py | 2 +- .../sonic_platform/thermal_updater.py | 32 +++--- .../mlnx-platform-api/tests/test_sfp.py | 22 ++-- .../mlnx-platform-api/tests/test_thermal.py | 10 +- .../tests/test_thermal_updater.py | 12 +-- 7 files changed, 109 insertions(+), 80 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index d03c0fe10e79..f6a9380bf6aa 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -327,17 +327,10 @@ def get_presence(self): Returns: bool: True if device is present, False if not """ - if DeviceDataManager.is_independent_mode(): - if utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/control') != 0: - if not utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/hw_present'): - return False - if not utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/power_good'): - return False - if not utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/power_on'): - return False - if utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/hw_reset') == 1: - return False - + try: + self.is_sw_control() + except: + return False eeprom_raw = self._read_eeprom(0, 1, log_on_error=False) return eeprom_raw is not None @@ -877,6 +870,13 @@ def get_tx_fault(self): return [False] * api.NUM_CHANNELS if api else None def get_temperature(self): + """Get SFP temperature + + Returns: + None if there is an error (sysfs does not exist or sysfs return None or module EEPROM not readable) + 0.0 if module temperature is not supported or module is under initialization + other float value if module temperature is available + """ try: if not self.is_sw_control(): temp_file = f'/sys/module/sx_core/asic0/module{self.sdk_index}/temperature/input' @@ -893,59 +893,68 @@ def get_temperature(self): temperature = super().get_temperature() return temperature if temperature is not None else None - def get_temperature_warning_threashold(self): + def get_temperature_warning_threshold(self): """Get temperature warning threshold Returns: - int: temperature warning threshold + None if there is an error (module EEPROM not readable) + 0.0 if warning threshold is not supported or module is under initialization + other float value if warning threshold is available """ try: - if not self.is_sw_control(): - emergency = utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/temperature/emergency', - log_func=None, - default=None) - return emergency / SFP_TEMPERATURE_SCALE if emergency is not None else SFP_DEFAULT_TEMP_WARNNING_THRESHOLD + self.is_sw_control() except: - return SFP_DEFAULT_TEMP_WARNNING_THRESHOLD - - thresh = self._get_temperature_threshold() - if thresh and consts.TEMP_HIGH_WARNING_FIELD in thresh: - return thresh[consts.TEMP_HIGH_WARNING_FIELD] - return SFP_DEFAULT_TEMP_WARNNING_THRESHOLD + return 0.0 + + support, thresh = self._get_temperature_threshold() + if support is None or thresh is None: + # Failed to read from EEPROM + return None + if support is False: + # Do not support + return 0.0 + return thresh.get(consts.TEMP_HIGH_WARNING_FIELD, SFP_DEFAULT_TEMP_WARNNING_THRESHOLD) - def get_temperature_critical_threashold(self): + def get_temperature_critical_threshold(self): """Get temperature critical threshold Returns: - int: temperature critical threshold + None if there is an error (module EEPROM not readable) + 0.0 if critical threshold is not supported or module is under initialization + other float value if critical threshold is available """ try: - if not self.is_sw_control(): - critical = utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/temperature/critical', - log_func=None, - default=None) - return critical / SFP_TEMPERATURE_SCALE if critical is not None else SFP_DEFAULT_TEMP_CRITICAL_THRESHOLD + self.is_sw_control() except: - return SFP_DEFAULT_TEMP_CRITICAL_THRESHOLD + return 0.0 - thresh = self._get_temperature_threshold() - if thresh and consts.TEMP_HIGH_ALARM_FIELD in thresh: - return thresh[consts.TEMP_HIGH_ALARM_FIELD] - return SFP_DEFAULT_TEMP_CRITICAL_THRESHOLD + support, thresh = self._get_temperature_threshold() + if support is None or thresh is None: + # Failed to read from EEPROM + return None + if support is False: + # Do not support + return 0.0 + return thresh.get(consts.TEMP_HIGH_ALARM_FIELD, SFP_DEFAULT_TEMP_CRITICAL_THRESHOLD) def _get_temperature_threshold(self): + """Get temperature thresholds data from EEPROM + + Returns: + tuple: (support, thresh_dict) + """ self.reinit() api = self.get_xcvr_api() if not api: - return None + return None, None thresh_support = api.get_transceiver_thresholds_support() if thresh_support: if isinstance(api, sff8636.Sff8636Api) or isinstance(api, sff8436.Sff8436Api): - return api.xcvr_eeprom.read(consts.TEMP_THRESHOLDS_FIELD) - return api.xcvr_eeprom.read(consts.THRESHOLDS_FIELD) + return thresh_support, api.xcvr_eeprom.read(consts.TEMP_THRESHOLDS_FIELD) + return thresh_support, api.xcvr_eeprom.read(consts.THRESHOLDS_FIELD) else: - return None + return thresh_support, {} def get_xcvr_api(self): """ @@ -964,17 +973,22 @@ def get_xcvr_api(self): def is_sw_control(self): if not DeviceDataManager.is_independent_mode(): return False - + db = utils.DbUtils.get_db_instance('STATE_DB') logical_port = NvidiaSFPCommon.get_logical_port_by_sfp_index(self.sdk_index) if not logical_port: - raise Exception(f'Module {self.sdk_index} is not present or in initialization') + raise Exception(f'Module {self.sdk_index} is not present or under initialization') initialized = db.exists('STATE_DB', f'TRANSCEIVER_STATUS|{logical_port}') if not initialized: - raise Exception(f'Module {self.sdk_index} is not present or in initialization') + raise Exception(f'Module {self.sdk_index} is not present or under initialization') - return utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/control') == 1 + try: + return utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/control', + raise_exception=True, log_func=None) == 1 + except: + # just in case control file does not exist + raise Exception(f'Module {self.sdk_index} is under initialization') class RJ45Port(NvidiaSFPCommon): diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py index 435389321d0b..cdd47af607c2 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py @@ -431,7 +431,8 @@ def get_temperature(self): A float number of current temperature in Celsius up to nearest thousandth of one degree Celsius, e.g. 30.125 """ - return self.sfp.get_temperature() + value = self.sfp.get_temperature() + return value if (value != 0.0 and value is not None) else None def get_high_threshold(self): """ @@ -441,7 +442,8 @@ def get_high_threshold(self): A float number, the high threshold temperature of thermal in Celsius up to nearest thousandth of one degree Celsius, e.g. 30.125 """ - return self.sfp.get_temperature_warning_threashold() + value = self.sfp.get_temperature_warning_threshold() + return value if (value != 0.0 and value is not None) else None def get_high_critical_threshold(self): """ @@ -451,7 +453,8 @@ def get_high_critical_threshold(self): A float number, the high critical threshold temperature of thermal in Celsius up to nearest thousandth of one degree Celsius, e.g. 30.125 """ - return self.sfp.get_temperature_critical_threashold() + value = self.sfp.get_temperature_critical_threshold() + return value if (value != 0.0 and value is not None) else None def get_position_in_parent(self): """ diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_manager.py b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_manager.py index 9e1aaded0586..5c118b4c9a07 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_manager.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_manager.py @@ -46,5 +46,5 @@ def deinitialize(cls): is a no-op. :return: """ - if DeviceDataManager.is_independent_mode(): + if DeviceDataManager.is_independent_mode() and cls.thermal_updater_task: cls.thermal_updater_task.stop() diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_updater.py b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_updater.py index ad0b92ef4ee6..f2f0f75b2fd1 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_updater.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_updater.py @@ -56,7 +56,7 @@ def __init__(self, sfp_list): def load_tc_config(self): asic_poll_interval = 1 sfp_poll_interval = 10 - data = utils.load_json_file(TC_CONFIG_FILE) + data = utils.load_json_file(TC_CONFIG_FILE, log_func=None) if not data: logger.log_notice(f'{TC_CONFIG_FILE} does not exist, use default polling interval') @@ -108,7 +108,7 @@ def clean_thermal_data(self): def wait_all_sfp_ready(self): logger.log_notice('Waiting for all SFP modules ready...') - max_wait_time = 60 + max_wait_time = 300 ready_set = set() while len(ready_set) != len(self._sfp_list): for sfp in self._sfp_list: @@ -129,11 +129,11 @@ def get_asic_temp(self): temperature = utils.read_int_from_file('/sys/module/sx_core/asic0/temperature/input', default=None) return temperature * ASIC_TEMPERATURE_SCALE if temperature is not None else None - def get_asic_temp_warning_threashold(self): + def get_asic_temp_warning_threshold(self): emergency = utils.read_int_from_file('/sys/module/sx_core/asic0/temperature/emergency', default=None, log_func=None) return emergency * ASIC_TEMPERATURE_SCALE if emergency is not None else ASIC_DEFAULT_TEMP_WARNNING_THRESHOLD - def get_asic_temp_critical_threashold(self): + def get_asic_temp_critical_threshold(self): critical = utils.read_int_from_file('/sys/module/sx_core/asic0/temperature/critical', default=None, log_func=None) return critical * ASIC_TEMPERATURE_SCALE if critical is not None else ASIC_DEFAULT_TEMP_CRITICAL_THRESHOLD @@ -148,19 +148,19 @@ def update_single_module(self, sfp): critical_thresh = 0 fault = 0 else: - warning_thresh = sfp.get_temperature_warning_threashold() - critical_thresh = sfp.get_temperature_critical_threashold() + warning_thresh = sfp.get_temperature_warning_threshold() + critical_thresh = sfp.get_temperature_critical_threshold() fault = ERROR_READ_THERMAL_DATA if (temperature is None or warning_thresh is None or critical_thresh is None) else 0 - temperature = 0 if temperature is None else int(temperature * SFP_TEMPERATURE_SCALE) - warning_thresh = 0 if warning_thresh is None else int(warning_thresh * SFP_TEMPERATURE_SCALE) - critical_thresh = 0 if critical_thresh is None else int(critical_thresh * SFP_TEMPERATURE_SCALE) + temperature = 0 if temperature is None else temperature * SFP_TEMPERATURE_SCALE + warning_thresh = 0 if warning_thresh is None else warning_thresh * SFP_TEMPERATURE_SCALE + critical_thresh = 0 if critical_thresh is None else critical_thresh * SFP_TEMPERATURE_SCALE hw_management_independent_mode_update.thermal_data_set_module( 0, # ASIC index always 0 for now sfp.sdk_index + 1, - temperature, - critical_thresh, - warning_thresh, + int(temperature), + int(critical_thresh), + int(warning_thresh), fault ) else: @@ -170,7 +170,7 @@ def update_single_module(self, sfp): if pre_presence != presence: self._sfp_status[sfp.sdk_index] = presence except Exception as e: - logger.log_error('Failed to update module {sfp.sdk_index} thermal data - {e}') + logger.log_error(f'Failed to update module {sfp.sdk_index} thermal data - {e}') hw_management_independent_mode_update.thermal_data_set_module( 0, # ASIC index always 0 for now sfp.sdk_index + 1, @@ -187,8 +187,8 @@ def update_module(self): def update_asic(self): try: asic_temp = self.get_asic_temp() - warn_threshold = self.get_asic_temp_warning_threashold() - critical_threshold = self.get_asic_temp_critical_threashold() + warn_threshold = self.get_asic_temp_warning_threshold() + critical_threshold = self.get_asic_temp_critical_threshold() fault = 0 if asic_temp is None: logger.log_error('Failed to read ASIC temperature, send fault to hw-management-tc') @@ -203,7 +203,7 @@ def update_asic(self): fault ) except Exception as e: - logger.log_error('Failed to update ASIC thermal data - {e}') + logger.log_error(f'Failed to update ASIC thermal data - {e}') hw_management_independent_mode_update.thermal_data_set_asic( 0, # ASIC index always 0 for now 0, diff --git a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py index d273e9bce700..499983a01e15 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py @@ -230,14 +230,18 @@ def test_get_page_and_page_offset(self, mock_get_type_str, mock_eeprom_path, moc assert page == '/tmp/1/data' assert page_offset is 0 + @mock.patch('sonic_platform.sfp.SFP.is_sw_control') @mock.patch('sonic_platform.sfp.SFP._read_eeprom') - def test_sfp_get_presence(self, mock_read): + def test_sfp_get_presence(self, mock_read, mock_control): sfp = SFP(0) mock_read.return_value = None assert not sfp.get_presence() mock_read.return_value = 0 assert sfp.get_presence() + + mock_control.side_effect = RuntimeError('') + assert not sfp.get_presence() @mock.patch('sonic_platform.utils.read_int_from_file') def test_rj45_get_presence(self, mock_read_int): @@ -318,14 +322,16 @@ def test_get_temperature(self, mock_read, mock_exists): def test_get_temperature_threshold(self): sfp = SFP(0) sfp.is_sw_control = mock.MagicMock(return_value=True) - assert sfp.get_temperature_warning_threashold() == 70.0 - assert sfp.get_temperature_critical_threashold() == 80.0 mock_api = mock.MagicMock() mock_api.get_transceiver_thresholds_support = mock.MagicMock(return_value=False) - sfp.get_xcvr_api = mock.MagicMock(return_value=mock_api) - assert sfp.get_temperature_warning_threashold() == 70.0 - assert sfp.get_temperature_critical_threashold() == 80.0 + sfp.get_xcvr_api = mock.MagicMock(return_value=None) + assert sfp.get_temperature_warning_threshold() is None + assert sfp.get_temperature_critical_threshold() is None + + sfp.get_xcvr_api.return_value = mock_api + assert sfp.get_temperature_warning_threshold() == 0.0 + assert sfp.get_temperature_critical_threshold() == 0.0 from sonic_platform_base.sonic_xcvr.fields import consts mock_api.get_transceiver_thresholds_support.return_value = True @@ -334,8 +340,8 @@ def test_get_temperature_threshold(self): consts.TEMP_HIGH_ALARM_FIELD: 85.0, consts.TEMP_HIGH_WARNING_FIELD: 75.0 }) - assert sfp.get_temperature_warning_threashold() == 75.0 - assert sfp.get_temperature_critical_threashold() == 85.0 + assert sfp.get_temperature_warning_threshold() == 75.0 + assert sfp.get_temperature_critical_threshold() == 85.0 @mock.patch('sonic_platform.sfp.NvidiaSFPCommon.get_logical_port_by_sfp_index') @mock.patch('sonic_platform.utils.read_int_from_file') diff --git a/platform/mellanox/mlnx-platform-api/tests/test_thermal.py b/platform/mellanox/mlnx-platform-api/tests/test_thermal.py index a59b8dda4055..e17d91cb0818 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_thermal.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_thermal.py @@ -160,11 +160,17 @@ def test_sfp_thermal(self): assert thermal.get_position_in_parent() == 1 assert thermal.is_replaceable() == False sfp.get_temperature = mock.MagicMock(return_value=35.4) - sfp.get_temperature_warning_threashold = mock.MagicMock(return_value=70) - sfp.get_temperature_critical_threashold = mock.MagicMock(return_value=80) + sfp.get_temperature_warning_threshold = mock.MagicMock(return_value=70) + sfp.get_temperature_critical_threshold = mock.MagicMock(return_value=80) assert thermal.get_temperature() == 35.4 assert thermal.get_high_threshold() == 70 assert thermal.get_high_critical_threshold() == 80 + sfp.get_temperature = mock.MagicMock(return_value=0) + sfp.get_temperature_warning_threshold = mock.MagicMock(return_value=0) + sfp.get_temperature_critical_threshold = mock.MagicMock(return_value=None) + assert thermal.get_temperature() is None + assert thermal.get_high_threshold() is None + assert thermal.get_high_critical_threshold() is None @mock.patch('sonic_platform.utils.read_float_from_file') def test_get_temperature(self, mock_read): diff --git a/platform/mellanox/mlnx-platform-api/tests/test_thermal_updater.py b/platform/mellanox/mlnx-platform-api/tests/test_thermal_updater.py index 1a34a7440a2d..8e7509ce9b69 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_thermal_updater.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_thermal_updater.py @@ -97,23 +97,23 @@ def test_update_asic(self, mock_read): mock_read.return_value = 8 updater = ThermalUpdater(None) assert updater.get_asic_temp() == 1000 - assert updater.get_asic_temp_warning_threashold() == 1000 - assert updater.get_asic_temp_critical_threashold() == 1000 + assert updater.get_asic_temp_warning_threshold() == 1000 + assert updater.get_asic_temp_critical_threshold() == 1000 updater.update_asic() hw_management_independent_mode_update.thermal_data_set_asic.assert_called_once() mock_read.return_value = None assert updater.get_asic_temp() is None - assert updater.get_asic_temp_warning_threashold() == ASIC_DEFAULT_TEMP_WARNNING_THRESHOLD - assert updater.get_asic_temp_critical_threashold() == ASIC_DEFAULT_TEMP_CRITICAL_THRESHOLD + assert updater.get_asic_temp_warning_threshold() == ASIC_DEFAULT_TEMP_WARNNING_THRESHOLD + assert updater.get_asic_temp_critical_threshold() == ASIC_DEFAULT_TEMP_CRITICAL_THRESHOLD def test_update_module(self): mock_sfp = mock.MagicMock() mock_sfp.sdk_index = 10 mock_sfp.get_presence = mock.MagicMock(return_value=True) mock_sfp.get_temperature = mock.MagicMock(return_value=55.0) - mock_sfp.get_temperature_warning_threashold = mock.MagicMock(return_value=70.0) - mock_sfp.get_temperature_critical_threashold = mock.MagicMock(return_value=80.0) + mock_sfp.get_temperature_warning_threshold = mock.MagicMock(return_value=70.0) + mock_sfp.get_temperature_critical_threshold = mock.MagicMock(return_value=80.0) updater = ThermalUpdater([mock_sfp]) updater.update_module() hw_management_independent_mode_update.thermal_data_set_module.assert_called_once_with(0, 11, 55000, 80000, 70000, 0) From 9fb1b889ccc21219adbb6ccc44608506fbc20d2b Mon Sep 17 00:00:00 2001 From: Ye Jianquan Date: Mon, 22 Jan 2024 13:04:16 +0800 Subject: [PATCH 072/419] [202311, PR test] Use 202311 as the test branch (#17843) * [PR test] Use 202311 as the test branch --- azure-pipelines.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 360ca9fdf367..13008854f072 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -164,7 +164,7 @@ stages: TOPOLOGY: t0 MIN_WORKER: $(T0_INSTANCE_NUM) MAX_WORKER: $(T0_INSTANCE_NUM) - MGMT_BRANCH: "master" + MGMT_BRANCH: "202311" - job: t0_2vlans_elastictest pool: ubuntu-20.04 @@ -178,7 +178,7 @@ stages: TEST_SET: t0-2vlans MIN_WORKER: $(T0_2VLANS_INSTANCE_NUM) MAX_WORKER: $(T0_2VLANS_INSTANCE_NUM) - MGMT_BRANCH: "master" + MGMT_BRANCH: "202311" DEPLOY_MG_EXTRA_PARAMS: "-e vlan_config=two_vlan_a" - job: t1_lag_elastictest @@ -192,7 +192,7 @@ stages: TOPOLOGY: t1-lag MIN_WORKER: $(T1_LAG_INSTANCE_NUM) MAX_WORKER: $(T1_LAG_INSTANCE_NUM) - MGMT_BRANCH: "master" + MGMT_BRANCH: "202311" - job: multi_asic_elastictest displayName: "kvmtest-multi-asic-t1-lag by Elastictest" @@ -207,7 +207,7 @@ stages: MIN_WORKER: $(MULTI_ASIC_INSTANCE_NUM) MAX_WORKER: $(MULTI_ASIC_INSTANCE_NUM) NUM_ASIC: 4 - MGMT_BRANCH: "master" + MGMT_BRANCH: "202311" - job: dualtor_elastictest pool: ubuntu-20.04 @@ -220,7 +220,7 @@ stages: TOPOLOGY: dualtor MIN_WORKER: $(T0_DUALTOR_INSTANCE_NUM) MAX_WORKER: $(T0_DUALTOR_INSTANCE_NUM) - MGMT_BRANCH: "master" + MGMT_BRANCH: "202311" COMMON_EXTRA_PARAMS: "--disable_loganalyzer " - job: sonic_t0_elastictest @@ -235,7 +235,7 @@ stages: MIN_WORKER: $(T0_SONIC_INSTANCE_NUM) MAX_WORKER: $(T0_SONIC_INSTANCE_NUM) TEST_SET: t0-sonic - MGMT_BRANCH: "master" + MGMT_BRANCH: "202311" COMMON_EXTRA_PARAMS: "--neighbor_type=sonic " VM_TYPE: vsonic @@ -250,8 +250,7 @@ stages: TOPOLOGY: dpu MIN_WORKER: $(T0_SONIC_INSTANCE_NUM) MAX_WORKER: $(T0_SONIC_INSTANCE_NUM) - KVM_IMAGE_BRANCH: "master" - MGMT_BRANCH: "master" + MGMT_BRANCH: "202311" # - job: wan_elastictest From 87caed6f629f524337aaa2b5106d3caf02e21d3f Mon Sep 17 00:00:00 2001 From: ganglv <88995770+ganglyu@users.noreply.github.com> Date: Mon, 22 Jan 2024 13:15:22 +0800 Subject: [PATCH 073/419] Fix host service for 202311 branch (#17782) --- .../debian/sonic-host-services-data.sonic-hostservice.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-host-services-data/debian/sonic-host-services-data.sonic-hostservice.service b/src/sonic-host-services-data/debian/sonic-host-services-data.sonic-hostservice.service index 799f3511e784..98f1058c0388 100644 --- a/src/sonic-host-services-data/debian/sonic-host-services-data.sonic-hostservice.service +++ b/src/sonic-host-services-data/debian/sonic-host-services-data.sonic-hostservice.service @@ -12,5 +12,5 @@ RestartSec=10 TimeoutStopSec=3 [Install] -WantedBy=mgmt-framework.service telemetry.service +WantedBy=mgmt-framework.service telemetry.service gnmi.service From b527372642061991052a9756d634540d04a85614 Mon Sep 17 00:00:00 2001 From: Stepan Blyshchak <38952541+stepanblyschak@users.noreply.github.com> Date: Mon, 22 Jan 2024 20:17:50 +0200 Subject: [PATCH 074/419] [202311] Revert bgp suppress fib pending (#17660) * [FRR] Bring back patches required for FPM plugin Signed-off-by: Stepan Blyschak * [zebra] use fpm plugin instead of dplane_fpm_nl Signed-off-by: Stepan Blyschak * Revert BGP suppress FIB pending Signed-off-by: Stepan Blyschak --------- Signed-off-by: Stepan Blyschak --- .../docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2 | 1 - .../frr/supervisord/supervisord.conf.j2 | 2 +- .../vs/docker-sonic-vs/supervisord.conf.j2 | 2 +- src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py | 5 +- .../data/sonic-cfggen/bgpd.conf.j2/all.conf | 1 - .../sonic-cfggen/bgpd.main.conf.j2/all.conf | 1 - .../sonic-cfggen/bgpd.main.conf.j2/base.conf | 1 - .../bgpd.main.conf.j2/defaults.conf | 1 - .../bgpd.main.conf.j2/ipv6_lo.conf | 1 - .../bgpd.main.conf.j2/packet_chassis.conf | 1 - .../bgpd.main.conf.j2/voq_chassis.conf | 1 - .../data/sonic-cfggen/frr.conf.j2/all.conf | 1 - src/sonic-config-engine/minigraph.py | 6 +- .../tests/sample_output/py2/bgpd_frr.conf | 1 - .../py2/bgpd_frr_backend_asic.conf | 1 - .../sample_output/py2/bgpd_frr_dualtor.conf | 1 - .../py2/bgpd_frr_frontend_asic.conf | 1 - .../tests/sample_output/py2/frr.conf | 1 - .../sample_output/py2/t2-chassis-fe-bgpd.conf | 1 - .../tests/sample_output/py3/bgpd_frr.conf | 1 - .../py3/bgpd_frr_backend_asic.conf | 1 - .../sample_output/py3/bgpd_frr_dualtor.conf | 1 - .../py3/bgpd_frr_frontend_asic.conf | 1 - .../tests/sample_output/py3/frr.conf | 1 - .../sample_output/py3/t2-chassis-fe-bgpd.conf | 1 - .../0005-Add-support-of-bgp-l3vni-evpn.patch | 121 ------------- ...0007-ignore-route-from-default-table.patch | 31 ---- ...008-Use-vrf_id-for-vrf-not-tabled_id.patch | 111 ------------ ..._lookup_by_tableid-to-zebra_vrf_look.patch | 56 +++--- ...fpm-Use-vrf_id-for-vrf-not-tabled_id.patch | 25 +++ ...-fpm-ignore-route-from-default-table.patch | 29 ++++ .../0036-Add-support-of-bgp-l3vni-evpn.patch | 164 ++++++++++++++++++ src/sonic-frr/patch/series | 6 +- .../tests/device_metadata.json | 10 -- .../tests_config/device_metadata.json | 30 ---- .../yang-models/sonic-device_metadata.yang | 12 -- 36 files changed, 256 insertions(+), 375 deletions(-) delete mode 100644 src/sonic-frr/patch/0005-Add-support-of-bgp-l3vni-evpn.patch delete mode 100644 src/sonic-frr/patch/0007-ignore-route-from-default-table.patch delete mode 100644 src/sonic-frr/patch/0008-Use-vrf_id-for-vrf-not-tabled_id.patch create mode 100644 src/sonic-frr/patch/0034-fpm-Use-vrf_id-for-vrf-not-tabled_id.patch create mode 100644 src/sonic-frr/patch/0035-fpm-ignore-route-from-default-table.patch create mode 100644 src/sonic-frr/patch/0036-Add-support-of-bgp-l3vni-evpn.patch diff --git a/dockers/docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2 b/dockers/docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2 index 793ab055c215..f13c11f91e48 100644 --- a/dockers/docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2 +++ b/dockers/docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2 @@ -66,7 +66,6 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} ! {% block bgp_init %} bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy {% if (DEVICE_METADATA is defined) and ('localhost' in DEVICE_METADATA) and ('subtype' in DEVICE_METADATA['localhost']) and (DEVICE_METADATA['localhost']['subtype'].lower() == 'dualtor') %} diff --git a/dockers/docker-fpm-frr/frr/supervisord/supervisord.conf.j2 b/dockers/docker-fpm-frr/frr/supervisord/supervisord.conf.j2 index 0b26be8d3c45..00b24d697f50 100644 --- a/dockers/docker-fpm-frr/frr/supervisord/supervisord.conf.j2 +++ b/dockers/docker-fpm-frr/frr/supervisord/supervisord.conf.j2 @@ -30,7 +30,7 @@ stderr_logfile=syslog dependent_startup=true [program:zebra] -command=/usr/lib/frr/zebra -A 127.0.0.1 -s 90000000 -M dplane_fpm_nl -M snmp --asic-offload=notify_on_offload +command=/usr/lib/frr/zebra -A 127.0.0.1 -s 90000000 -M fpm -M snmp priority=4 autostart=false autorestart=false diff --git a/platform/vs/docker-sonic-vs/supervisord.conf.j2 b/platform/vs/docker-sonic-vs/supervisord.conf.j2 index 5b988a5a5d92..d8c1cf368113 100644 --- a/platform/vs/docker-sonic-vs/supervisord.conf.j2 +++ b/platform/vs/docker-sonic-vs/supervisord.conf.j2 @@ -164,7 +164,7 @@ environment=ASAN_OPTIONS="log_path=/var/log/asan/teammgrd-asan.log{{ asan_extra_ {% endif %} [program:zebra] -command=/usr/lib/frr/zebra -A 127.0.0.1 -s 90000000 -M dplane_fpm_nl --asic-offload=notify_on_offload +command=/usr/lib/frr/zebra -A 127.0.0.1 -s 90000000 -M fpm priority=13 autostart=false autorestart=false diff --git a/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py b/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py index e88dc60b8c55..b15f841f6166 100644 --- a/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py +++ b/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py @@ -304,11 +304,10 @@ def apply_op(self, cmd, vrf): :return: True if no errors, False if there are errors """ bgp_asn = self.directory.get_slot("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME)["localhost"]["bgp_asn"] - enable_bgp_suppress_fib_pending_cmd = 'bgp suppress-fib-pending' if vrf == 'default': - cmd = ('router bgp %s\n %s\n' % (bgp_asn, enable_bgp_suppress_fib_pending_cmd)) + cmd + cmd = ('router bgp %s\n' % bgp_asn) + cmd else: - cmd = ('router bgp %s vrf %s\n %s\n' % (bgp_asn, vrf, enable_bgp_suppress_fib_pending_cmd)) + cmd + cmd = ('router bgp %s vrf %s\n' % (bgp_asn, vrf)) + cmd self.cfg_mgr.push(cmd) return True diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.conf.j2/all.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.conf.j2/all.conf index a7f34245873a..c39115706d79 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.conf.j2/all.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.conf.j2/all.conf @@ -55,7 +55,6 @@ route-map HIDE_INTERNAL permit 20 router bgp 55555 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/all.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/all.conf index d2dc9e40e892..c5ba79d34392 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/all.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/all.conf @@ -34,7 +34,6 @@ route-map HIDE_INTERNAL permit 10 router bgp 55555 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/base.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/base.conf index 27d04b953a3e..77cc9d6fffd8 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/base.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/base.conf @@ -12,7 +12,6 @@ ip prefix-list PL_LoopbackV4 permit 55.55.55.55/32 router bgp 55555 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/defaults.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/defaults.conf index b85dd67a5ca0..00b09bd40d9a 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/defaults.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/defaults.conf @@ -34,7 +34,6 @@ route-map HIDE_INTERNAL permit 10 router bgp 55555 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/ipv6_lo.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/ipv6_lo.conf index 5ee5ce5443aa..50414a89a389 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/ipv6_lo.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/ipv6_lo.conf @@ -14,7 +14,6 @@ ipv6 prefix-list PL_LoopbackV6 permit fc00::1/128 router bgp 55555 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis.conf index 6b2e1f257948..a949ce6e4512 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis.conf @@ -34,7 +34,6 @@ route-map HIDE_INTERNAL permit 10 router bgp 55555 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/voq_chassis.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/voq_chassis.conf index efd45eda1ea9..0d9eeebe9e8e 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/voq_chassis.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/voq_chassis.conf @@ -34,7 +34,6 @@ route-map HIDE_INTERNAL permit 10 router bgp 55555 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/frr.conf.j2/all.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/frr.conf.j2/all.conf index 8856e58db686..af2e974ee9b7 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/frr.conf.j2/all.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/frr.conf.j2/all.conf @@ -71,7 +71,6 @@ route-map HIDE_INTERNAL permit 10 router bgp 55555 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index 1cadd297e527..dfdb9406dd49 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -608,7 +608,7 @@ def parse_dpg(dpg, hname): else: prefix = prefix + "/32" static_routes[prefix] = {'nexthop': ",".join(nexthop), 'ifname': ",".join(ifname), 'advertise': advertise} - + if port_nhipv4_map and port_nhipv6_map: subnet_check_ip = list(port_nhipv4_map.values())[0] for subnet_range in ip_intfs_map: @@ -2131,10 +2131,6 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw if current_device and current_device['type'] in mgmt_device_types: results["FLEX_COUNTER_TABLE"] = {counter: {"FLEX_COUNTER_STATUS": "disable"} for counter in mgmt_disabled_counters} - # Enable bgp-suppress-fib by default for leafrouter - if current_device and current_device['type'] in leafrouter_device_types: - results['DEVICE_METADATA']['localhost']['suppress-fib-pending'] = 'enabled' - return results def get_tunnel_entries(tunnel_intfs, tunnel_intfs_qos_remap_config, lo_intfs, tunnel_qos_remap, mux_tunnel_name, peer_switch_ip): diff --git a/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr.conf b/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr.conf index 3828af13fd71..2c146698a960 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr.conf @@ -42,7 +42,6 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.0.0/27 router bgp 65100 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_backend_asic.conf b/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_backend_asic.conf index 45cd03a540a8..d793dfa39a98 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_backend_asic.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_backend_asic.conf @@ -53,7 +53,6 @@ route-map HIDE_INTERNAL permit 10 router bgp 65100 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_dualtor.conf b/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_dualtor.conf index eda11ab9f285..364a2c34bcaa 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_dualtor.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_dualtor.conf @@ -42,7 +42,6 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.0.0/27 router bgp 65100 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy coalesce-time 10000 diff --git a/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_frontend_asic.conf b/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_frontend_asic.conf index 8daeff2a61e9..94bd37e3b90f 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_frontend_asic.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_frontend_asic.conf @@ -53,7 +53,6 @@ route-map HIDE_INTERNAL permit 10 router bgp 65100 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-config-engine/tests/sample_output/py2/frr.conf b/src/sonic-config-engine/tests/sample_output/py2/frr.conf index 032adb8c5106..2653f8fc0893 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/frr.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/frr.conf @@ -62,7 +62,6 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.0.0/27 router bgp 65100 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-bgpd.conf b/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-bgpd.conf index 32a9abf88bac..20744efaa40f 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-bgpd.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-bgpd.conf @@ -58,7 +58,6 @@ ip prefix-list PL_LoopbackV4 permit 4.0.0.0/32 router bgp 4000 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr.conf b/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr.conf index e5ad8964454a..e7534d4b9781 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr.conf @@ -42,7 +42,6 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.200.0/27 router bgp 65100 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_backend_asic.conf b/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_backend_asic.conf index 45cd03a540a8..d793dfa39a98 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_backend_asic.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_backend_asic.conf @@ -53,7 +53,6 @@ route-map HIDE_INTERNAL permit 10 router bgp 65100 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_dualtor.conf b/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_dualtor.conf index 0ada9a4f8d60..4f606b80838c 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_dualtor.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_dualtor.conf @@ -42,7 +42,6 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.200.0/27 router bgp 65100 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy coalesce-time 10000 diff --git a/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_frontend_asic.conf b/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_frontend_asic.conf index 8daeff2a61e9..94bd37e3b90f 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_frontend_asic.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_frontend_asic.conf @@ -53,7 +53,6 @@ route-map HIDE_INTERNAL permit 10 router bgp 65100 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/frr.conf b/src/sonic-config-engine/tests/sample_output/py3/frr.conf index d0821f1b11ca..5b7eacefe8ba 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/frr.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/frr.conf @@ -62,7 +62,6 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.200.0/27 router bgp 65100 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-bgpd.conf b/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-bgpd.conf index 32a9abf88bac..20744efaa40f 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-bgpd.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-bgpd.conf @@ -58,7 +58,6 @@ ip prefix-list PL_LoopbackV4 permit 4.0.0.0/32 router bgp 4000 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-frr/patch/0005-Add-support-of-bgp-l3vni-evpn.patch b/src/sonic-frr/patch/0005-Add-support-of-bgp-l3vni-evpn.patch deleted file mode 100644 index fe2636c2e289..000000000000 --- a/src/sonic-frr/patch/0005-Add-support-of-bgp-l3vni-evpn.patch +++ /dev/null @@ -1,121 +0,0 @@ -From f5f0018266c98ad96cdbe69ae60d501de21e5600 Mon Sep 17 00:00:00 2001 -From: Stepan Blyschak -Date: Thu, 20 Oct 2022 13:19:31 +0000 -Subject: [PATCH] From 369bbb4d62aa47d5a6d5157ca6ea819c4cb80f15 Mon Sep 17 - 00:00:00 2001 Subject: [PATCH 07/13] Added support of L3VNI EVPN - -This is temp patch till Prefix to ARP indirection is add in neighorch - -Signed-off-by: Kishore Kunal -Signed-off-by: Stepan Blyschak - -diff --git a/lib/nexthop.c b/lib/nexthop.c -index 7ebc4fefb..2f7bb0e7b 100644 ---- a/lib/nexthop.c -+++ b/lib/nexthop.c -@@ -813,6 +813,7 @@ void nexthop_copy_no_recurse(struct nexthop *copy, - memcpy(©->src, &nexthop->src, sizeof(nexthop->src)); - memcpy(©->rmap_src, &nexthop->rmap_src, sizeof(nexthop->rmap_src)); - copy->rparent = rparent; -+ memcpy(©->nh_encap.encap_data.rmac, &nexthop->nh_encap.encap_data.rmac, ETH_ALEN); - if (nexthop->nh_label) - nexthop_add_labels(copy, nexthop->nh_label_type, - nexthop->nh_label->num_labels, -diff --git a/lib/nexthop.h b/lib/nexthop.h -index f1309aa52..7b4bbbafd 100644 ---- a/lib/nexthop.h -+++ b/lib/nexthop.h -@@ -66,6 +66,11 @@ enum nh_encap_type { - /* Backup index value is limited */ - #define NEXTHOP_BACKUP_IDX_MAX 255 - -+struct vxlan_nh_encap { -+ vni_t vni; -+ struct ethaddr rmac; -+}; -+ - /* Nexthop structure. */ - struct nexthop { - struct nexthop *next; -@@ -137,7 +142,7 @@ struct nexthop { - /* Encapsulation information. */ - enum nh_encap_type nh_encap_type; - union { -- vni_t vni; -+ struct vxlan_nh_encap encap_data; - } nh_encap; - - /* SR-TE color used for matching SR-TE policies */ -diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c -index 79d79d74b..325199eff 100644 ---- a/zebra/rt_netlink.c -+++ b/zebra/rt_netlink.c -@@ -1969,6 +1969,7 @@ static int netlink_route_nexthop_encap(struct nlmsghdr *n, size_t nlen, - struct nexthop *nh) - { - struct rtattr *nest; -+ struct vxlan_nh_encap* encap_data; - - switch (nh->nh_encap_type) { - case NET_VXLAN: -@@ -1979,9 +1980,21 @@ static int netlink_route_nexthop_encap(struct nlmsghdr *n, size_t nlen, - if (!nest) - return false; - -+ encap_data = &nh->nh_encap.encap_data; -+ - if (!nl_attr_put32(n, nlen, 0 /* VXLAN_VNI */, -- nh->nh_encap.vni)) -+ encap_data->vni)) -+ return false; -+ -+ if (ZEBRA_DEBUG_KERNEL) -+ zlog_debug( -+ "%s: VNI:%d RMAC:%pEA", __func__, encap_data->vni, -+ &encap_data->rmac); -+ -+ if (!nl_attr_put(n, nlen, 1 /* VXLAN_RMAC */, -+ &encap_data->rmac, sizeof(encap_data->rmac))) - return false; -+ - nl_attr_nest_end(n, nest); - break; - } -diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c -index c0945eae2..157c33ced 100644 ---- a/zebra/zapi_msg.c -+++ b/zebra/zapi_msg.c -@@ -1605,6 +1605,8 @@ static struct nexthop *nexthop_from_zapi(const struct zapi_nexthop *api_nh, - vtep_ip.ipa_type = IPADDR_V4; - memcpy(&(vtep_ip.ipaddr_v4), &(api_nh->gate.ipv4), - sizeof(struct in_addr)); -+ memcpy(&(nexthop->nh_encap.encap_data.rmac), -+ &api_nh->rmac, ETH_ALEN); - zebra_rib_queue_evpn_route_add( - api_nh->vrf_id, &api_nh->rmac, &vtep_ip, p); - SET_FLAG(nexthop->flags, NEXTHOP_FLAG_EVPN); -@@ -1639,6 +1641,8 @@ static struct nexthop *nexthop_from_zapi(const struct zapi_nexthop *api_nh, - vtep_ip.ipa_type = IPADDR_V6; - memcpy(&vtep_ip.ipaddr_v6, &(api_nh->gate.ipv6), - sizeof(struct in6_addr)); -+ memcpy(&(nexthop->nh_encap.encap_data.rmac), -+ &api_nh->rmac, ETH_ALEN); - zebra_rib_queue_evpn_route_add( - api_nh->vrf_id, &api_nh->rmac, &vtep_ip, p); - SET_FLAG(nexthop->flags, NEXTHOP_FLAG_EVPN); -diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c -index f6f436f39..c8511bd28 100644 ---- a/zebra/zebra_dplane.c -+++ b/zebra/zebra_dplane.c -@@ -2917,7 +2917,7 @@ int dplane_ctx_route_init(struct zebra_dplane_ctx *ctx, enum dplane_op_e op, - zl3vni = zl3vni_from_vrf(nexthop->vrf_id); - if (zl3vni && is_l3vni_oper_up(zl3vni)) { - nexthop->nh_encap_type = NET_VXLAN; -- nexthop->nh_encap.vni = zl3vni->vni; -+ nexthop->nh_encap.encap_data.vni = zl3vni->vni; - } - } - --- -2.17.1 - diff --git a/src/sonic-frr/patch/0007-ignore-route-from-default-table.patch b/src/sonic-frr/patch/0007-ignore-route-from-default-table.patch deleted file mode 100644 index 52167d765287..000000000000 --- a/src/sonic-frr/patch/0007-ignore-route-from-default-table.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 1a639f2dcd400997345dab424a2adbc091752661 Mon Sep 17 00:00:00 2001 -From: Stepan Blyschak -Date: Thu, 20 Oct 2022 13:07:18 +0000 -Subject: [PATCH] From ca66350aecf7db3354019480d11754fabae3a97c Mon Sep 17 - 00:00:00 2001 Subject: [PATCH 09/13] ignore route from default table - -Signed-off-by: Stepan Blyschak - -diff --git a/zebra/dplane_fpm_nl.c b/zebra/dplane_fpm_nl.c -index 0a9fecc9d..b18a96353 100644 ---- a/zebra/dplane_fpm_nl.c -+++ b/zebra/dplane_fpm_nl.c -@@ -814,6 +814,15 @@ static int fpm_nl_enqueue(struct fpm_nl_ctx *fnc, struct zebra_dplane_ctx *ctx) - || op == DPLANE_OP_NH_UPDATE)) - return 0; - -+ /* -+ * Ignore route from default table, because when mgmt port goes down, -+ * zebra will remove the default route and causing ASIC to blackhole IO. -+ */ -+ if (dplane_ctx_get_table(ctx) == RT_TABLE_DEFAULT) { -+ zlog_debug("%s: discard default table route", __func__); -+ return 0; -+ } -+ - nl_buf_len = 0; - - frr_mutex_lock_autounlock(&fnc->obuf_mutex); --- -2.17.1 - diff --git a/src/sonic-frr/patch/0008-Use-vrf_id-for-vrf-not-tabled_id.patch b/src/sonic-frr/patch/0008-Use-vrf_id-for-vrf-not-tabled_id.patch deleted file mode 100644 index ae8b05f06bd0..000000000000 --- a/src/sonic-frr/patch/0008-Use-vrf_id-for-vrf-not-tabled_id.patch +++ /dev/null @@ -1,111 +0,0 @@ -From 44f3736ee601e06e43e978fa075402c3da4823bd Mon Sep 17 00:00:00 2001 -From: Stepan Blyschak -Date: Mon, 16 Jan 2023 11:45:19 +0000 -Subject: [PATCH] From 349e3f758860be0077b69919c39764d3486ec44a Mon Sep 17 - 00:00:00 2001 Subject: [PATCH] use vrf id instead of table id - -Signed-off-by: Stepan Blyschak - -diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c -index 325199eff..587045eac 100644 ---- a/zebra/rt_netlink.c -+++ b/zebra/rt_netlink.c -@@ -406,6 +406,30 @@ vrf_id_t vrf_lookup_by_table(uint32_t table_id, ns_id_t ns_id) - return VRF_DEFAULT; - } - -+static uint32_t table_lookup_by_vrf(vrf_id_t vrf_id, ns_id_t ns_id) -+{ -+ struct vrf *vrf; -+ struct zebra_vrf *zvrf; -+ -+ RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id) { -+ zvrf = vrf->info; -+ if (zvrf == NULL) -+ continue; -+ /* case vrf with netns : match the netnsid */ -+ if (vrf_is_backend_netns()) { -+ if (ns_id == zvrf_id(zvrf)) -+ return zvrf->table_id; -+ } else { -+ /* VRF is VRF_BACKEND_VRF_LITE */ -+ if (zvrf_id(zvrf) != vrf_id) -+ continue; -+ return zvrf->table_id; -+ } -+ } -+ -+ return RT_TABLE_UNSPEC; -+} -+ - /** - * @parse_encap_mpls() - Parses encapsulated mpls attributes - * @tb: Pointer to rtattr to look for nested items in. -@@ -782,14 +806,26 @@ int netlink_route_change_read_unicast_internal(struct nlmsghdr *h, - if (rtm->rtm_family == AF_MPLS) - return 0; - -- /* Table corresponding to route. */ -- if (tb[RTA_TABLE]) -- table = *(int *)RTA_DATA(tb[RTA_TABLE]); -- else -- table = rtm->rtm_table; -+ if (!ctx) { -+ /* Table corresponding to route. */ -+ if (tb[RTA_TABLE]) -+ table = *(int *)RTA_DATA(tb[RTA_TABLE]); -+ else -+ table = rtm->rtm_table; -+ -+ /* Map to VRF */ -+ vrf_id = vrf_lookup_by_table(table, ns_id); -+ } else { -+ /* With FPM, rtm_table contains vrf id, see netlink_route_multipath_msg_encode */ -+ if (tb[RTA_TABLE]) -+ vrf_id = *(int *)RTA_DATA(tb[RTA_TABLE]); -+ else -+ vrf_id = rtm->rtm_table; -+ -+ /* Map to table */ -+ table = table_lookup_by_vrf(vrf_id, ns_id); -+ } - -- /* Map to VRF */ -- vrf_id = vrf_lookup_by_table(table, ns_id); - if (vrf_id == VRF_DEFAULT) { - if (!is_zebra_valid_kernel_table(table) - && !is_zebra_main_routing_table(table)) -@@ -2102,12 +2138,24 @@ ssize_t netlink_route_multipath_msg_encode(int cmd, - - /* Table corresponding to this route. */ - table_id = dplane_ctx_get_table(ctx); -- if (table_id < 256) -- req->r.rtm_table = table_id; -- else { -- req->r.rtm_table = RT_TABLE_UNSPEC; -- if (!nl_attr_put32(&req->n, datalen, RTA_TABLE, table_id)) -- return 0; -+ if (!fpm) { -+ if (table_id < 256) -+ req->r.rtm_table = table_id; -+ else { -+ req->r.rtm_table = RT_TABLE_UNSPEC; -+ if (!nl_attr_put32(&req->n, datalen, RTA_TABLE, table_id)) -+ return 0; -+ } -+ } else { -+ /* Put vrf if_index instead of table id */ -+ vrf_id_t vrf = dplane_ctx_get_vrf(ctx); -+ if (vrf < 256) -+ req->r.rtm_table = vrf; -+ else { -+ req->r.rtm_table = RT_TABLE_UNSPEC; -+ if (!nl_attr_put32(&req->n, datalen, RTA_TABLE, vrf)) -+ return 0; -+ } - } - - if (IS_ZEBRA_DEBUG_KERNEL) --- -2.17.1 - diff --git a/src/sonic-frr/patch/0012-zebra-Rename-vrf_lookup_by_tableid-to-zebra_vrf_look.patch b/src/sonic-frr/patch/0012-zebra-Rename-vrf_lookup_by_tableid-to-zebra_vrf_look.patch index ca6517fbf655..01f8d04c2b78 100644 --- a/src/sonic-frr/patch/0012-zebra-Rename-vrf_lookup_by_tableid-to-zebra_vrf_look.patch +++ b/src/sonic-frr/patch/0012-zebra-Rename-vrf_lookup_by_tableid-to-zebra_vrf_look.patch @@ -1,4 +1,4 @@ -From 2b9c7592a9857ddccc77b9d3f178e0c5bd5f19ed Mon Sep 17 00:00:00 2001 +From 6a3ae11c9b1480966b22d4f9b67a40b76d96aa15 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 26 Apr 2023 23:25:27 -0400 Subject: [PATCH] zebra: Rename vrf_lookup_by_tableid to zebra_vrf_lookup.. @@ -9,12 +9,19 @@ we need zebra specific data to find this vrf_id and as such it does not belong in vrf.c Signed-off-by: Donald Sharp +--- + zebra/if_netlink.c | 3 ++- + zebra/rt_netlink.c | 31 ++----------------------------- + zebra/rt_netlink.h | 1 - + zebra/zebra_vrf.c | 27 +++++++++++++++++++++++++++ + zebra/zebra_vrf.h | 1 + + 5 files changed, 32 insertions(+), 31 deletions(-) diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c -index 81347b550a..4599121261 100644 +index cd200d821d7a..cea47b4c30af 100644 --- a/zebra/if_netlink.c +++ b/zebra/if_netlink.c -@@ -342,7 +342,8 @@ static void netlink_vrf_change(struct nlmsghdr *h, struct rtattr *tb, +@@ -325,7 +325,8 @@ static void netlink_vrf_change(struct nlmsghdr *h, struct rtattr *tb, if (!vrf_lookup_by_id((vrf_id_t)ifi->ifi_index)) { vrf_id_t exist_id; @@ -25,10 +32,10 @@ index 81347b550a..4599121261 100644 vrf = vrf_lookup_by_id(exist_id); diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c -index 587045eac2..6b9b047858 100644 +index de01ced411ef..0f542ab80756 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c -@@ -379,33 +379,6 @@ static inline int proto2zebra(int proto, int family, bool is_nexthop) +@@ -380,33 +380,6 @@ static inline int proto2zebra(int proto, int family, bool is_nexthop) return proto; } @@ -59,19 +66,19 @@ index 587045eac2..6b9b047858 100644 - return VRF_DEFAULT; -} - - static uint32_t table_lookup_by_vrf(vrf_id_t vrf_id, ns_id_t ns_id) - { - struct vrf *vrf; -@@ -814,7 +787,7 @@ int netlink_route_change_read_unicast_internal(struct nlmsghdr *h, - table = rtm->rtm_table; + /** + * @parse_encap_mpls() - Parses encapsulated mpls attributes + * @tb: Pointer to rtattr to look for nested items in. +@@ -790,7 +763,7 @@ int netlink_route_change_read_unicast_internal(struct nlmsghdr *h, + table = rtm->rtm_table; - /* Map to VRF */ -- vrf_id = vrf_lookup_by_table(table, ns_id); -+ vrf_id = zebra_vrf_lookup_by_table(table, ns_id); - } else { - /* With FPM, rtm_table contains vrf id, see netlink_route_multipath_msg_encode */ - if (tb[RTA_TABLE]) -@@ -1114,7 +1087,7 @@ static int netlink_route_change_read_multicast(struct nlmsghdr *h, + /* Map to VRF */ +- vrf_id = vrf_lookup_by_table(table, ns_id); ++ vrf_id = zebra_vrf_lookup_by_table(table, ns_id); + if (vrf_id == VRF_DEFAULT) { + if (!is_zebra_valid_kernel_table(table) + && !is_zebra_main_routing_table(table)) +@@ -1079,7 +1052,7 @@ static int netlink_route_change_read_multicast(struct nlmsghdr *h, else table = rtm->rtm_table; @@ -81,10 +88,10 @@ index 587045eac2..6b9b047858 100644 if (tb[RTA_IIF]) iif = *(int *)RTA_DATA(tb[RTA_IIF]); diff --git a/zebra/rt_netlink.h b/zebra/rt_netlink.h -index 8506367ae4..364aac0f6b 100644 +index 3ca59ce676f3..d9d0ee76249a 100644 --- a/zebra/rt_netlink.h +++ b/zebra/rt_netlink.h -@@ -102,7 +102,6 @@ extern int netlink_macfdb_read_specific_mac(struct zebra_ns *zns, +@@ -90,7 +90,6 @@ extern int netlink_macfdb_read_specific_mac(struct zebra_ns *zns, uint16_t vid); extern int netlink_neigh_read_specific_ip(const struct ipaddr *ip, struct interface *vlan_if); @@ -93,10 +100,10 @@ index 8506367ae4..364aac0f6b 100644 struct nl_batch; extern enum netlink_msg_status diff --git a/zebra/zebra_vrf.c b/zebra/zebra_vrf.c -index be5e91495f..c59cb7c0a7 100644 +index 3365cdcdbaa8..74b9d106cdc3 100644 --- a/zebra/zebra_vrf.c +++ b/zebra/zebra_vrf.c -@@ -389,6 +389,33 @@ struct zebra_vrf *zebra_vrf_alloc(struct vrf *vrf) +@@ -376,6 +376,33 @@ struct zebra_vrf *zebra_vrf_alloc(struct vrf *vrf) return zvrf; } @@ -131,10 +138,10 @@ index be5e91495f..c59cb7c0a7 100644 struct zebra_vrf *zebra_vrf_lookup_by_id(vrf_id_t vrf_id) { diff --git a/zebra/zebra_vrf.h b/zebra/zebra_vrf.h -index 02e3c197c9..937e7fb144 100644 +index b23b7282610b..aef83cd8f172 100644 --- a/zebra/zebra_vrf.h +++ b/zebra/zebra_vrf.h -@@ -252,6 +252,7 @@ extern struct route_table *zebra_vrf_get_table_with_table_id(afi_t afi, +@@ -237,6 +237,7 @@ extern struct route_table *zebra_vrf_get_table_with_table_id(afi_t afi, extern void zebra_vrf_update_all(struct zserv *client); extern struct zebra_vrf *zebra_vrf_lookup_by_id(vrf_id_t vrf_id); extern struct zebra_vrf *zebra_vrf_lookup_by_name(const char *); @@ -142,6 +149,3 @@ index 02e3c197c9..937e7fb144 100644 extern struct zebra_vrf *zebra_vrf_alloc(struct vrf *vrf); extern struct route_table *zebra_vrf_table(afi_t, safi_t, vrf_id_t); --- -2.17.1 - diff --git a/src/sonic-frr/patch/0034-fpm-Use-vrf_id-for-vrf-not-tabled_id.patch b/src/sonic-frr/patch/0034-fpm-Use-vrf_id-for-vrf-not-tabled_id.patch new file mode 100644 index 000000000000..f815cf38455e --- /dev/null +++ b/src/sonic-frr/patch/0034-fpm-Use-vrf_id-for-vrf-not-tabled_id.patch @@ -0,0 +1,25 @@ +From 39bb40dc4bad4462e4ae9c98580d75fa2c92e032 Mon Sep 17 00:00:00 2001 +From: Pavel Shirshov +Date: Mon, 16 Nov 2020 18:29:46 -0800 +Subject: [PATCH 3/8] Use vrf_id for vrf, not tabled_id + +--- + zebra/zebra_fpm_netlink.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/zebra/zebra_fpm_netlink.c b/zebra/zebra_fpm_netlink.c +index ec22c5dd4..aad0156b3 100644 +--- a/zebra/zebra_fpm_netlink.c ++++ b/zebra/zebra_fpm_netlink.c +@@ -287,7 +287,7 @@ static int netlink_route_info_fill(struct netlink_route_info *ri, int cmd, + ri->nlmsg_pid = zvrf->zns->netlink_dplane_out.snl.nl_pid; + + ri->nlmsg_type = cmd; +- ri->rtm_table = table_info->table_id; ++ ri->rtm_table = zvrf_id(rib_dest_vrf(dest)); + ri->rtm_protocol = RTPROT_UNSPEC; + + /* +-- +2.12.2 + diff --git a/src/sonic-frr/patch/0035-fpm-ignore-route-from-default-table.patch b/src/sonic-frr/patch/0035-fpm-ignore-route-from-default-table.patch new file mode 100644 index 000000000000..e925b9908fb6 --- /dev/null +++ b/src/sonic-frr/patch/0035-fpm-ignore-route-from-default-table.patch @@ -0,0 +1,29 @@ +From bb3b003840959adf5b5be52e91bc798007c9857a Mon Sep 17 00:00:00 2001 +From: Ying Xie +Date: Thu, 8 Sep 2022 04:20:36 +0000 +Subject: [PATCH] From 776a29e8ab32c1364ee601a8730aabb773b0c86b Mon Sep 17 + 00:00:00 2001 Subject: [PATCH] ignore route from default table + +Signed-off-by: Ying Xie +--- + zebra/zebra_fpm_netlink.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/zebra/zebra_fpm_netlink.c b/zebra/zebra_fpm_netlink.c +index 34be9fb39..d6c875a7e 100644 +--- a/zebra/zebra_fpm_netlink.c ++++ b/zebra/zebra_fpm_netlink.c +@@ -283,6 +283,11 @@ static int netlink_route_info_fill(struct netlink_route_info *ri, int cmd, + rib_table_info(rib_dest_table(dest)); + struct zebra_vrf *zvrf = table_info->zvrf; + ++ if (table_info->table_id == RT_TABLE_DEFAULT) { ++ zfpm_debug("%s: Discard default table route", __func__); ++ return 0; ++ } ++ + memset(ri, 0, sizeof(*ri)); + + ri->prefix = rib_dest_prefix(dest); +-- +2.17.1 diff --git a/src/sonic-frr/patch/0036-Add-support-of-bgp-l3vni-evpn.patch b/src/sonic-frr/patch/0036-Add-support-of-bgp-l3vni-evpn.patch new file mode 100644 index 000000000000..01d4df820739 --- /dev/null +++ b/src/sonic-frr/patch/0036-Add-support-of-bgp-l3vni-evpn.patch @@ -0,0 +1,164 @@ +From b1b2e40cf43a9d206e2d867bdec4f0f7b740c8b9 Mon Sep 17 00:00:00 2001 +From: stepanb +Date: Tue, 19 Dec 2023 11:27:37 +0000 +Subject: [PATCH] Add support of bgp l3vni evpn + +--- + lib/nexthop.c | 2 ++ + lib/nexthop.h | 6 ++++++ + zebra/rt_netlink.c | 2 +- + zebra/zapi_msg.c | 4 ++++ + zebra/zebra_dplane.c | 1 + + zebra/zebra_fpm_netlink.c | 20 ++++++++++++++++++++ + 6 files changed, 34 insertions(+), 1 deletion(-) + +diff --git a/lib/nexthop.c b/lib/nexthop.c +index 7ebc4fefb..fe42b9f86 100644 +--- a/lib/nexthop.c ++++ b/lib/nexthop.c +@@ -813,6 +813,8 @@ void nexthop_copy_no_recurse(struct nexthop *copy, + memcpy(©->src, &nexthop->src, sizeof(nexthop->src)); + memcpy(©->rmap_src, &nexthop->rmap_src, sizeof(nexthop->rmap_src)); + copy->rparent = rparent; ++ memcpy(©->nh_encap.encap_data.rmac, &nexthop->nh_encap.encap_data.rmac, ETH_ALEN); ++ + if (nexthop->nh_label) + nexthop_add_labels(copy, nexthop->nh_label_type, + nexthop->nh_label->num_labels, +diff --git a/lib/nexthop.h b/lib/nexthop.h +index f1309aa52..7026ce1c2 100644 +--- a/lib/nexthop.h ++++ b/lib/nexthop.h +@@ -66,6 +66,11 @@ enum nh_encap_type { + /* Backup index value is limited */ + #define NEXTHOP_BACKUP_IDX_MAX 255 + ++struct vxlan_nh_encap { ++ vni_t vni; ++ struct ethaddr rmac; ++}; ++ + /* Nexthop structure. */ + struct nexthop { + struct nexthop *next; +@@ -138,6 +143,7 @@ struct nexthop { + enum nh_encap_type nh_encap_type; + union { + vni_t vni; ++ struct vxlan_nh_encap encap_data; + } nh_encap; + + /* SR-TE color used for matching SR-TE policies */ +diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c +index d31732a55..581255158 100644 +--- a/zebra/rt_netlink.c ++++ b/zebra/rt_netlink.c +@@ -1991,7 +1991,7 @@ static int netlink_route_nexthop_encap(struct nlmsghdr *n, size_t nlen, + return false; + + if (!nl_attr_put32(n, nlen, 0 /* VXLAN_VNI */, +- nh->nh_encap.vni)) ++ nh->nh_encap.encap_data.vni)) + return false; + nl_attr_nest_end(n, nest); + break; +diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c +index c0945eae2..157c33ced 100644 +--- a/zebra/zapi_msg.c ++++ b/zebra/zapi_msg.c +@@ -1605,6 +1605,8 @@ static struct nexthop *nexthop_from_zapi(const struct zapi_nexthop *api_nh, + vtep_ip.ipa_type = IPADDR_V4; + memcpy(&(vtep_ip.ipaddr_v4), &(api_nh->gate.ipv4), + sizeof(struct in_addr)); ++ memcpy(&(nexthop->nh_encap.encap_data.rmac), ++ &api_nh->rmac, ETH_ALEN); + zebra_rib_queue_evpn_route_add( + api_nh->vrf_id, &api_nh->rmac, &vtep_ip, p); + SET_FLAG(nexthop->flags, NEXTHOP_FLAG_EVPN); +@@ -1639,6 +1641,8 @@ static struct nexthop *nexthop_from_zapi(const struct zapi_nexthop *api_nh, + vtep_ip.ipa_type = IPADDR_V6; + memcpy(&vtep_ip.ipaddr_v6, &(api_nh->gate.ipv6), + sizeof(struct in6_addr)); ++ memcpy(&(nexthop->nh_encap.encap_data.rmac), ++ &api_nh->rmac, ETH_ALEN); + zebra_rib_queue_evpn_route_add( + api_nh->vrf_id, &api_nh->rmac, &vtep_ip, p); + SET_FLAG(nexthop->flags, NEXTHOP_FLAG_EVPN); +diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c +index 34d30484a..260a7b497 100644 +--- a/zebra/zebra_dplane.c ++++ b/zebra/zebra_dplane.c +@@ -3394,6 +3394,7 @@ int dplane_ctx_route_init(struct zebra_dplane_ctx *ctx, enum dplane_op_e op, + if (zl3vni && is_l3vni_oper_up(zl3vni)) { + nexthop->nh_encap_type = NET_VXLAN; + nexthop->nh_encap.vni = zl3vni->vni; ++ nexthop->nh_encap.encap_data.vni = zl3vni->vni; + } + } + +diff --git a/zebra/zebra_fpm_netlink.c b/zebra/zebra_fpm_netlink.c +index ec6090da9..22650eedc 100644 +--- a/zebra/zebra_fpm_netlink.c ++++ b/zebra/zebra_fpm_netlink.c +@@ -95,10 +95,12 @@ static const char *fpm_nh_encap_type_to_str(enum fpm_nh_encap_type_t encap_type) + + struct vxlan_encap_info_t { + vni_t vni; ++ struct ethaddr rmac; + }; + + enum vxlan_encap_info_type_t { + VXLAN_VNI = 0, ++ VXLAN_RMAC = 1, + }; + + struct fpm_nh_encap_info_t { +@@ -234,6 +236,9 @@ static int netlink_route_info_add_nh(struct netlink_route_info *ri, + } + + nhi.encap_info.vxlan_encap.vni = vni; ++ memcpy(&nhi.encap_info.vxlan_encap.rmac, ++ &(nexthop->nh_encap.encap_data.rmac), ++ ETH_ALEN); + } + + /* +@@ -456,9 +461,16 @@ static int netlink_route_info_encode(struct netlink_route_info *ri, + nl_attr_put16(&req->n, in_buf_len, RTA_ENCAP_TYPE, + encap); + vxlan = &nhi->encap_info.vxlan_encap; ++ char buf[ETHER_ADDR_STRLEN]; ++ ++ zfpm_debug( ++ "%s: VNI:%d RMAC:%s", __func__, vxlan->vni, ++ prefix_mac2str(&vxlan->rmac, buf, sizeof(buf))); + nest = nl_attr_nest(&req->n, in_buf_len, RTA_ENCAP); + nl_attr_put32(&req->n, in_buf_len, VXLAN_VNI, + vxlan->vni); ++ nl_attr_put(&req->n, in_buf_len, VXLAN_RMAC, ++ &vxlan->rmac, sizeof(vxlan->rmac)); + nl_attr_nest_end(&req->n, nest); + break; + } +@@ -494,10 +506,18 @@ static int netlink_route_info_encode(struct netlink_route_info *ri, + nl_attr_put16(&req->n, in_buf_len, RTA_ENCAP_TYPE, + encap); + vxlan = &nhi->encap_info.vxlan_encap; ++ char rmac_buf[ETHER_ADDR_STRLEN]; ++ ++ zfpm_debug("%s: Multi VNI:%d RMAC:%s", __func__, ++ vxlan->vni, ++ prefix_mac2str(&vxlan->rmac, rmac_buf, ++ sizeof(rmac_buf))); + inner_nest = + nl_attr_nest(&req->n, in_buf_len, RTA_ENCAP); + nl_attr_put32(&req->n, in_buf_len, VXLAN_VNI, + vxlan->vni); ++ nl_attr_put(&req->n, in_buf_len, VXLAN_RMAC, ++ &vxlan->rmac, sizeof(vxlan->rmac)); + nl_attr_nest_end(&req->n, inner_nest); + break; + } +-- +2.30.2 + diff --git a/src/sonic-frr/patch/series b/src/sonic-frr/patch/series index c87c5e61f986..e2f5bc28a91f 100644 --- a/src/sonic-frr/patch/series +++ b/src/sonic-frr/patch/series @@ -2,12 +2,9 @@ 0002-Allow-BGP-attr-NEXT_HOP-to-be-0.0.0.0-due-to-allevia.patch 0003-nexthops-compare-vrf-only-if-ip-type.patch 0004-frr-remove-frr-log-outchannel-to-var-log-frr.log.patch -0005-Add-support-of-bgp-l3vni-evpn.patch 0006-Link-local-scope-was-not-set-while-binding-socket-for-bgp-ipv6-link-local-neighbors.patch Disable-ipv6-src-address-test-in-pceplib.patch cross-compile-changes.patch -0007-ignore-route-from-default-table.patch -0008-Use-vrf_id-for-vrf-not-tabled_id.patch 0009-bgpd-Ensure-suppress-fib-pending-works-with-network-.patch 0010-bgpd-Change-log-level-for-graceful-restart-events.patch 0011-zebra-Static-routes-async-notification-do-not-need-t.patch @@ -32,3 +29,6 @@ cross-compile-changes.patch 0030-bgpd-Treat-EOR-as-withdrawn-to-avoid-unwanted-handli.patch 0031-bgpd-Ignore-handling-NLRIs-if-we-received-MP_UNREACH.patch 0032-zebra-Fix-fpm-multipath-encap-addition.patch +0034-fpm-Use-vrf_id-for-vrf-not-tabled_id.patch +0035-fpm-ignore-route-from-default-table.patch +0036-Add-support-of-bgp-l3vni-evpn.patch diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json b/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json index 141d8b5c8230..65288b8b2db8 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json @@ -126,16 +126,6 @@ "DEVICE_METADATA_ADVERTISE_LO_PREFIX_AS_128": { "desc": "Verifying advertising lo prefix as /128." }, - "DEVICE_METADATA_SUPPRESS_PENDING_FIB_ENABLED": { - "desc": "Enable bgp-suppress-fib-pending" - }, - "DEVICE_METADATA_SUPPRESS_PENDING_FIB_DISABLED": { - "desc": "Disable bgp-suppress-fib-pending" - }, - "DEVICE_METADATA_SUPPRESS_PENDING_FIB_ENABLED_SYNCHRONOUS_MODE_DISABLED": { - "desc": "Enable bgp-suppress-fib-pending when synchronous mode is disabled", - "eStr": ["ASIC synchronous mode must be enabled in order to enable suppress FIB pending feature"] - }, "DEVICE_METADATA_VALID_RACK_MGMT_MAP": { "desc": "Verifying rack_mgmt_map configuration." }, diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json index 941077205df6..b8053aa6ac66 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json @@ -333,36 +333,6 @@ } } }, - "DEVICE_METADATA_SUPPRESS_PENDING_FIB_ENABLED": { - "sonic-device_metadata:sonic-device_metadata": { - "sonic-device_metadata:DEVICE_METADATA": { - "sonic-device_metadata:localhost": { - "synchronous_mode": "enable", - "suppress-fib-pending": "enabled" - } - } - } - }, - "DEVICE_METADATA_SUPPRESS_PENDING_FIB_DISABLED": { - "sonic-device_metadata:sonic-device_metadata": { - "sonic-device_metadata:DEVICE_METADATA": { - "sonic-device_metadata:localhost": { - "synchronous_mode": "disable", - "suppress-fib-pending": "disabled" - } - } - } - }, - "DEVICE_METADATA_SUPPRESS_PENDING_FIB_ENABLED_SYNCHRONOUS_MODE_DISABLED": { - "sonic-device_metadata:sonic-device_metadata": { - "sonic-device_metadata:DEVICE_METADATA": { - "sonic-device_metadata:localhost": { - "synchronous_mode": "disable", - "suppress-fib-pending": "enabled" - } - } - } - }, "DEVICE_METADATA_VALID_RACK_MGMT_MAP": { "sonic-device_metadata:sonic-device_metadata": { "sonic-device_metadata:DEVICE_METADATA": { diff --git a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang index 26e20d196a88..392bbf941f6f 100644 --- a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang +++ b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang @@ -205,18 +205,6 @@ module sonic-device_metadata { By default SONiC advertises /128 subnet prefix in Loopback0 as /64 subnet route"; } - leaf suppress-fib-pending { - description "Enable BGP suppress FIB pending feature. BGP will wait for route FIB installation before announcing routes"; - type enumeration { - enum enabled; - enum disabled; - } - default disabled; - - must "((current() = 'disabled') or (current() = 'enabled' and ../synchronous_mode = 'enable'))" { - error-message "ASIC synchronous mode must be enabled in order to enable suppress FIB pending feature"; - } - } leaf rack_mgmt_map { type string { length 0..128 { From 51ba2cc07154e1518982e63810f2b82773240946 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 23 Jan 2024 02:18:30 +0800 Subject: [PATCH 075/419] [Mellanox][SKU] Adding Mellanox-SN4700-O8V48 SKU (#17425) (#17831) - Why I did it To add new SKU Mellanox-SN4700-O8V48 with following requirements: - How I did it Create new SKU files based on the below definition: * Port Mapping: 1-12 2x200G, 13-20 1x400G, 21-32 2x200G T0 topology: 48x200G Downlinks 8x400G uplinks. Length of downlink: 5m Length of uplink: 40m * Auto-negotiation enable/disable: Yes * FEC mode: RS * Shared headroom: Enabled * Shared headroom pool factor: 2 * Warmboot enabled: yes - How to verify it SONiC build with new SKU finish init, all ports up, qos tests suite from sonic-mgmt Co-authored-by: DavidZagury <32644413+DavidZagury@users.noreply.github.com> --- .../Mellanox-SN4700-O8V48/buffers.json.j2 | 17 + .../buffers_defaults_objects.j2 | 1 + .../buffers_defaults_t0.j2 | 38 +++ .../buffers_defaults_t1.j2 | 38 +++ .../buffers_dynamic.json.j2 | 18 ++ .../Mellanox-SN4700-O8V48/hwsku.json | 172 ++++++++++ .../pg_profile_lookup.ini | 1 + .../Mellanox-SN4700-O8V48/port_config.ini | 74 +++++ .../Mellanox-SN4700-O8V48/qos.json.j2 | 1 + .../Mellanox-SN4700-O8V48/sai.profile | 5 + .../sai_4700_8x400g_48x200g.xml | 297 ++++++++++++++++++ 11 files changed, 662 insertions(+) create mode 100644 device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/buffers.json.j2 create mode 120000 device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/buffers_defaults_objects.j2 create mode 100644 device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/buffers_defaults_t0.j2 create mode 100644 device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/buffers_defaults_t1.j2 create mode 100644 device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/buffers_dynamic.json.j2 create mode 100644 device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/hwsku.json create mode 120000 device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/pg_profile_lookup.ini create mode 100644 device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/port_config.ini create mode 120000 device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/qos.json.j2 create mode 100644 device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/sai.profile create mode 100644 device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/sai_4700_8x400g_48x200g.xml diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/buffers.json.j2 b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/buffers.json.j2 new file mode 100644 index 000000000000..07a5d9ef1c59 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/buffers.json.j2 @@ -0,0 +1,17 @@ +{# + Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. + Apache-2.0 + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +#} +{%- set default_topo = 't0' %} +{%- include 'buffers_config.j2' %} diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/buffers_defaults_objects.j2 b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/buffers_defaults_objects.j2 new file mode 120000 index 000000000000..c01aebb7ae12 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/buffers_defaults_objects.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_objects.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..02de15759cff --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/buffers_defaults_t0.j2 @@ -0,0 +1,38 @@ +{# + Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. + Apache-2.0 + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +#} +{% set default_cable = '5m' %} +{% set ingress_lossless_pool_size = '49946624' %} +{% set ingress_lossless_pool_xoff = '4063232' %} +{% set egress_lossless_pool_size = '60817392' %} +{% set egress_lossy_pool_size = '49946624' %} + +{% import 'buffers_defaults_objects.j2' as defs with context %} + +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} +{%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..2c183413df34 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/buffers_defaults_t1.j2 @@ -0,0 +1,38 @@ +{# + Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. + Apache-2.0 + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +#} +{% set default_cable = '300m' %} +{% set ingress_lossless_pool_size = '47546368' %} +{% set ingress_lossless_pool_xoff = '6463488' %} +{% set egress_lossless_pool_size = '60817392' %} +{% set egress_lossy_pool_size = '47546368' %} + +{% import 'buffers_defaults_objects.j2' as defs with context %} + +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} +{%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/buffers_dynamic.json.j2 b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/buffers_dynamic.json.j2 new file mode 100644 index 000000000000..eb46dffb8d8c --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/buffers_dynamic.json.j2 @@ -0,0 +1,18 @@ +{# + Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. + Apache-2.0 + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +#} +{%- set default_topo = 't0' %} +{%- set dynamic_mode = 'true' %} +{%- include 'buffers_config.j2' %} diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/hwsku.json b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/hwsku.json new file mode 100644 index 000000000000..62030cf19188 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/hwsku.json @@ -0,0 +1,172 @@ +{ + "interfaces": { + "Ethernet0": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet4": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet8": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet12": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet16": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet20": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet24": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet28": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet32": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet36": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet40": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet44": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet48": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet52": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet56": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet60": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet64": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet68": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet72": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet76": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet80": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet84": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet88": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet92": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet96": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + }, + "Ethernet104": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + }, + "Ethernet112": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + }, + "Ethernet120": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + }, + "Ethernet128": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + }, + "Ethernet136": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + }, + "Ethernet144": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + }, + "Ethernet152": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + }, + "Ethernet160": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet164": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet168": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet172": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet176": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet180": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet184": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet188": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet192": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet196": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet200": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet204": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet208": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet212": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet216": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet220": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet224": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet228": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet232": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet236": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet240": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet244": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet248": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + }, + "Ethernet252": { + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + } + } +} diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/pg_profile_lookup.ini b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/pg_profile_lookup.ini new file mode 120000 index 000000000000..66cab04d2c42 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/pg_profile_lookup.ini @@ -0,0 +1 @@ +../Mellanox-SN4700-C128/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/port_config.ini b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/port_config.ini new file mode 100644 index 000000000000..55ac271b9867 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/port_config.ini @@ -0,0 +1,74 @@ +## +## Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. +## Apache-2.0 +## +## Licensed under the Apache License, Version 2.0 (the "License"); +## you may not use this file except in compliance with the License. +## You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## + +# name lanes alias index speed +Ethernet0 0,1,2,3 etp1a 1 200000 +Ethernet4 4,5,6,7 etp1b 1 200000 +Ethernet8 8,9,10,11 etp2a 2 200000 +Ethernet12 12,13,14,15 etp2b 2 200000 +Ethernet16 16,17,18,19 etp3a 3 200000 +Ethernet20 20,21,22,23 etp3b 3 200000 +Ethernet24 24,25,26,27 etp4a 4 200000 +Ethernet28 28,29,30,31 etp4b 4 200000 +Ethernet32 32,33,34,35 etp5a 5 200000 +Ethernet36 36,37,38,39 etp5b 5 200000 +Ethernet40 40,41,42,43 etp6a 6 200000 +Ethernet44 44,45,46,47 etp6b 6 200000 +Ethernet48 48,49,50,51 etp7a 7 200000 +Ethernet52 52,53,54,55 etp7b 7 200000 +Ethernet56 56,57,58,59 etp8a 8 200000 +Ethernet60 60,61,62,63 etp8b 8 200000 +Ethernet64 64,65,66,67 etp9a 9 200000 +Ethernet68 68,69,70,71 etp9b 9 200000 +Ethernet72 72,73,74,75 etp10a 10 200000 +Ethernet76 76,77,78,79 etp10b 10 200000 +Ethernet80 80,81,82,83 etp11a 11 200000 +Ethernet84 84,85,86,87 etp11b 11 200000 +Ethernet88 88,89,90,91 etp12a 12 200000 +Ethernet92 92,93,94,95 etp12b 12 200000 +Ethernet96 96,97,98,99,100,101,102,103 etp13 13 400000 +Ethernet104 104,105,106,107,108,109,110,111 etp14 14 400000 +Ethernet112 112,113,114,115,116,117,118,119 etp15 15 400000 +Ethernet120 120,121,122,123,124,125,126,127 etp16 16 400000 +Ethernet128 128,129,130,131,132,133,134,135 etp17 17 400000 +Ethernet136 136,137,138,139,140,141,142,143 etp18 18 400000 +Ethernet144 144,145,146,147,148,149,150,151 etp19 19 400000 +Ethernet152 152,153,154,155,156,157,158,159 etp20 20 400000 +Ethernet160 160,161,162,163 etp21a 21 200000 +Ethernet164 164,165,166,167 etp21b 21 200000 +Ethernet168 168,169,170,171 etp22a 22 200000 +Ethernet172 172,173,174,175 etp22b 22 200000 +Ethernet176 176,177,178,179 etp23a 23 200000 +Ethernet180 180,181,182,183 etp23b 23 200000 +Ethernet184 184,185,186,187 etp24a 24 200000 +Ethernet188 188,189,190,191 etp24b 24 200000 +Ethernet192 192,193,194,195 etp25a 25 200000 +Ethernet196 196,197,198,199 etp25b 25 200000 +Ethernet200 200,201,202,203 etp26a 26 200000 +Ethernet204 204,205,206,207 etp26b 26 200000 +Ethernet208 208,209,210,211 etp27a 27 200000 +Ethernet212 212,213,214,215 etp27b 27 200000 +Ethernet216 216,217,218,219 etp28a 28 200000 +Ethernet220 220,221,222,223 etp28b 28 200000 +Ethernet224 224,225,226,227 etp29a 29 200000 +Ethernet228 228,229,230,231 etp29b 29 200000 +Ethernet232 232,233,234,235 etp30a 30 200000 +Ethernet236 236,237,238,239 etp30b 30 200000 +Ethernet240 240,241,242,243 etp31a 31 200000 +Ethernet244 244,245,246,247 etp31b 31 200000 +Ethernet248 248,249,250,251 etp32a 32 200000 +Ethernet252 252,253,254,255 etp32b 32 200000 diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/qos.json.j2 b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/qos.json.j2 new file mode 120000 index 000000000000..eccf286dc879 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/qos.json.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/qos.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/sai.profile b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/sai.profile new file mode 100644 index 000000000000..e0109ecf26d3 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/sai.profile @@ -0,0 +1,5 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4700_8x400g_48x200g.xml +SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps +SAI_DUMP_STORE_AMOUNT=10 +SAI_DUMP_MFT_CFG_PATH=/etc/sonic/mft/fwtrace_cfg +SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/sai_4700_8x400g_48x200g.xml b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/sai_4700_8x400g_48x200g.xml new file mode 100644 index 000000000000..bb1f8646b2f7 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/sai_4700_8x400g_48x200g.xml @@ -0,0 +1,297 @@ + + + + + + + 00:02:03:04:05:00 + + + 1 + + + 32 + + + 1 + + + + + 1 + 8 + 17 + + + 0 + + + 32768 + 1 + + + 5 + 8 + 16 + 0 + 32768 + 1 + + + 9 + 8 + 19 + 0 + 32768 + 1 + + + 13 + 8 + 18 + 0 + 32768 + 1 + + + 17 + 8 + 21 + 1 + 4096 + 2 + + + 21 + 8 + 20 + 1 + 4096 + 2 + + + 25 + 8 + 23 + 1 + 4096 + 2 + + + 29 + 8 + 22 + 1 + 4096 + 2 + + + 33 + 8 + 29 + 1 + 4096 + 2 + + + 37 + 8 + 28 + 1 + 4096 + 2 + + + 41 + 8 + 31 + 1 + 4096 + 2 + + + 45 + 8 + 30 + 1 + 4096 + 2 + + + 49 + 8 + 25 + 1 + 4096 + 2 + + + 53 + 8 + 24 + 1 + 4096 + 2 + + + 57 + 8 + 27 + 1 + 4096 + 2 + + + 61 + 8 + 26 + 1 + 4096 + 2 + + + 65 + 8 + 14 + 0 + 32768 + 1 + + + 69 + 8 + 15 + 0 + 32768 + 1 + + + 73 + 8 + 12 + 0 + 32768 + 1 + + + 77 + 8 + 13 + 0 + 32768 + 1 + + + 81 + 8 + 10 + 1 + 4096 + 2 + + + 85 + 8 + 11 + 1 + 4096 + 2 + + + 89 + 8 + 8 + 1 + 4096 + 2 + + + 93 + 8 + 9 + 1 + 4096 + 2 + + + 97 + 8 + 2 + 1 + 4096 + 2 + + + 101 + 8 + 3 + 1 + 4096 + 2 + + + 105 + 8 + 0 + 1 + 4096 + 2 + + + 109 + 8 + 1 + 1 + 4096 + 2 + + + 113 + 8 + 6 + 1 + 4096 + 2 + + + 117 + 8 + 7 + 1 + 4096 + 2 + + + 121 + 8 + 4 + 1 + 4096 + 2 + + + 125 + 8 + 5 + 1 + 4096 + 2 + + + + From aa691f1f903161e82d49fa730e7284f892f2d318 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 23 Jan 2024 02:19:25 +0800 Subject: [PATCH 076/419] [submodule] Update submodule sonic-platform-common to the latest HEAD automatically (#17845) src/sonic-platform-common * 570bb3f - (HEAD -> 202311, origin/202311) Fix memory map parsing issue (#427) (3 days ago) [Stephen Sun] --- 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 5d69644a0cab..570bb3f8b290 160000 --- a/src/sonic-platform-common +++ b/src/sonic-platform-common @@ -1 +1 @@ -Subproject commit 5d69644a0cabcdfde4430be5370e91bccbc078d6 +Subproject commit 570bb3f8b290129279c25016dcf9c96894e1ca34 From 204c5528d7fe772ea736ca2528623f9c88dc58b3 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 23 Jan 2024 02:19:52 +0800 Subject: [PATCH 077/419] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#17846) src/sonic-utilities * 7a242eeb - (HEAD -> 202311, origin/202311) [202311] Support reading/writing module EEPROM data by page and offset (#3008) (#3073) (2 days ago) [Junchao-Mellanox] * cb0fd428 - [202311] Collect module EEPROM data in dump (#3009) (#3124) (3 days ago) [Junchao-Mellanox] --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index 72b6c04c5d64..7a242eeb8e12 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 72b6c04c5d64d0322ca36e5c8606740027a97767 +Subproject commit 7a242eeb8e12c18366bff5eb27500b0de2a213c8 From d7a77601e4bff6a715b313cad2816cf0f97edcda Mon Sep 17 00:00:00 2001 From: dbarashinvd <105214075+dbarashinvd@users.noreply.github.com> Date: Mon, 22 Jan 2024 20:53:55 +0200 Subject: [PATCH 078/419] fix low polarity wrong value for hw_reset deassert and seek(0) before reading sysfs upon poll event (#17627) * fix hw_reset low polarity (reverse values) * move seek to beginning of sysfs fd before reading to resolve power_good sysfs returns empty upon plug out cable --- .../mlnx-platform-api/sonic_platform/modules_mgmt.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/modules_mgmt.py b/platform/mellanox/mlnx-platform-api/sonic_platform/modules_mgmt.py index 470b39acb3df..f69d00772e68 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/modules_mgmt.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/modules_mgmt.py @@ -279,8 +279,8 @@ def run(self): module_fd_path = module_obj.module_power_good_fd_path self.fds_events_count_dict[module_obj.port_num][fd_name] += 1 try: - val = module_fd.read() module_fd.seek(0) + val = module_fd.read() logger.log_info("dynamic detection got module_obj {} with port {} from fd number {} path {} val {} count {}" .format(module_obj, module_obj.port_num, fd, module_fd_path , val, self.fds_events_count_dict[module_obj.port_num])) @@ -450,8 +450,9 @@ def power_on_module(self, port, module_sm_obj, dynamic=False): utils.write_file(module_fd_indep_path_po, "1") if os.path.isfile(module_fd_indep_path_r): logger.log_info("powerOnModule resetting via {} for port {}".format(module_fd_indep_path_r, port)) - # echo 0 > /sys/module/sx_core/$asic/$module/hw_reset - utils.write_file(module_fd_indep_path_r, "0") + # de-assert hw_reset - low polarity. 1 for de-assert 0 for assert + # echo 1 > /sys/module/sx_core/$asic/$module/hw_reset + utils.write_file(module_fd_indep_path_r, "1") self.add_port_to_wait_reset(module_sm_obj) except Exception as e: logger.log_info("exception in powerOnModule {} for port {}".format(e, port)) From 1ccee478e226844f3098ebc48d1e7bbfe1cba589 Mon Sep 17 00:00:00 2001 From: Ying Xie Date: Tue, 23 Jan 2024 08:43:43 -0800 Subject: [PATCH 079/419] Revert "[202311] Revert bgp suppress fib pending" (#17882) --- .../docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2 | 1 + .../frr/supervisord/supervisord.conf.j2 | 2 +- .../vs/docker-sonic-vs/supervisord.conf.j2 | 2 +- src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py | 5 +- .../data/sonic-cfggen/bgpd.conf.j2/all.conf | 1 + .../sonic-cfggen/bgpd.main.conf.j2/all.conf | 1 + .../sonic-cfggen/bgpd.main.conf.j2/base.conf | 1 + .../bgpd.main.conf.j2/defaults.conf | 1 + .../bgpd.main.conf.j2/ipv6_lo.conf | 1 + .../bgpd.main.conf.j2/packet_chassis.conf | 1 + .../bgpd.main.conf.j2/voq_chassis.conf | 1 + .../data/sonic-cfggen/frr.conf.j2/all.conf | 1 + src/sonic-config-engine/minigraph.py | 6 +- .../tests/sample_output/py2/bgpd_frr.conf | 1 + .../py2/bgpd_frr_backend_asic.conf | 1 + .../sample_output/py2/bgpd_frr_dualtor.conf | 1 + .../py2/bgpd_frr_frontend_asic.conf | 1 + .../tests/sample_output/py2/frr.conf | 1 + .../sample_output/py2/t2-chassis-fe-bgpd.conf | 1 + .../tests/sample_output/py3/bgpd_frr.conf | 1 + .../py3/bgpd_frr_backend_asic.conf | 1 + .../sample_output/py3/bgpd_frr_dualtor.conf | 1 + .../py3/bgpd_frr_frontend_asic.conf | 1 + .../tests/sample_output/py3/frr.conf | 1 + .../sample_output/py3/t2-chassis-fe-bgpd.conf | 1 + .../0005-Add-support-of-bgp-l3vni-evpn.patch | 121 +++++++++++++ ...0007-ignore-route-from-default-table.patch | 31 ++++ ...008-Use-vrf_id-for-vrf-not-tabled_id.patch | 111 ++++++++++++ ..._lookup_by_tableid-to-zebra_vrf_look.patch | 56 +++--- ...fpm-Use-vrf_id-for-vrf-not-tabled_id.patch | 25 --- ...-fpm-ignore-route-from-default-table.patch | 29 ---- .../0036-Add-support-of-bgp-l3vni-evpn.patch | 164 ------------------ src/sonic-frr/patch/series | 6 +- .../tests/device_metadata.json | 10 ++ .../tests_config/device_metadata.json | 30 ++++ .../yang-models/sonic-device_metadata.yang | 12 ++ 36 files changed, 375 insertions(+), 256 deletions(-) create mode 100644 src/sonic-frr/patch/0005-Add-support-of-bgp-l3vni-evpn.patch create mode 100644 src/sonic-frr/patch/0007-ignore-route-from-default-table.patch create mode 100644 src/sonic-frr/patch/0008-Use-vrf_id-for-vrf-not-tabled_id.patch delete mode 100644 src/sonic-frr/patch/0034-fpm-Use-vrf_id-for-vrf-not-tabled_id.patch delete mode 100644 src/sonic-frr/patch/0035-fpm-ignore-route-from-default-table.patch delete mode 100644 src/sonic-frr/patch/0036-Add-support-of-bgp-l3vni-evpn.patch diff --git a/dockers/docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2 b/dockers/docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2 index f13c11f91e48..793ab055c215 100644 --- a/dockers/docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2 +++ b/dockers/docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2 @@ -66,6 +66,7 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} ! {% block bgp_init %} bgp log-neighbor-changes + bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy {% if (DEVICE_METADATA is defined) and ('localhost' in DEVICE_METADATA) and ('subtype' in DEVICE_METADATA['localhost']) and (DEVICE_METADATA['localhost']['subtype'].lower() == 'dualtor') %} diff --git a/dockers/docker-fpm-frr/frr/supervisord/supervisord.conf.j2 b/dockers/docker-fpm-frr/frr/supervisord/supervisord.conf.j2 index 00b24d697f50..0b26be8d3c45 100644 --- a/dockers/docker-fpm-frr/frr/supervisord/supervisord.conf.j2 +++ b/dockers/docker-fpm-frr/frr/supervisord/supervisord.conf.j2 @@ -30,7 +30,7 @@ stderr_logfile=syslog dependent_startup=true [program:zebra] -command=/usr/lib/frr/zebra -A 127.0.0.1 -s 90000000 -M fpm -M snmp +command=/usr/lib/frr/zebra -A 127.0.0.1 -s 90000000 -M dplane_fpm_nl -M snmp --asic-offload=notify_on_offload priority=4 autostart=false autorestart=false diff --git a/platform/vs/docker-sonic-vs/supervisord.conf.j2 b/platform/vs/docker-sonic-vs/supervisord.conf.j2 index d8c1cf368113..5b988a5a5d92 100644 --- a/platform/vs/docker-sonic-vs/supervisord.conf.j2 +++ b/platform/vs/docker-sonic-vs/supervisord.conf.j2 @@ -164,7 +164,7 @@ environment=ASAN_OPTIONS="log_path=/var/log/asan/teammgrd-asan.log{{ asan_extra_ {% endif %} [program:zebra] -command=/usr/lib/frr/zebra -A 127.0.0.1 -s 90000000 -M fpm +command=/usr/lib/frr/zebra -A 127.0.0.1 -s 90000000 -M dplane_fpm_nl --asic-offload=notify_on_offload priority=13 autostart=false autorestart=false diff --git a/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py b/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py index b15f841f6166..e88dc60b8c55 100644 --- a/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py +++ b/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py @@ -304,10 +304,11 @@ def apply_op(self, cmd, vrf): :return: True if no errors, False if there are errors """ bgp_asn = self.directory.get_slot("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME)["localhost"]["bgp_asn"] + enable_bgp_suppress_fib_pending_cmd = 'bgp suppress-fib-pending' if vrf == 'default': - cmd = ('router bgp %s\n' % bgp_asn) + cmd + cmd = ('router bgp %s\n %s\n' % (bgp_asn, enable_bgp_suppress_fib_pending_cmd)) + cmd else: - cmd = ('router bgp %s vrf %s\n' % (bgp_asn, vrf)) + cmd + cmd = ('router bgp %s vrf %s\n %s\n' % (bgp_asn, vrf, enable_bgp_suppress_fib_pending_cmd)) + cmd self.cfg_mgr.push(cmd) return True diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.conf.j2/all.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.conf.j2/all.conf index c39115706d79..a7f34245873a 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.conf.j2/all.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.conf.j2/all.conf @@ -55,6 +55,7 @@ route-map HIDE_INTERNAL permit 20 router bgp 55555 ! bgp log-neighbor-changes + bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/all.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/all.conf index c5ba79d34392..d2dc9e40e892 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/all.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/all.conf @@ -34,6 +34,7 @@ route-map HIDE_INTERNAL permit 10 router bgp 55555 ! bgp log-neighbor-changes + bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/base.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/base.conf index 77cc9d6fffd8..27d04b953a3e 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/base.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/base.conf @@ -12,6 +12,7 @@ ip prefix-list PL_LoopbackV4 permit 55.55.55.55/32 router bgp 55555 ! bgp log-neighbor-changes + bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/defaults.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/defaults.conf index 00b09bd40d9a..b85dd67a5ca0 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/defaults.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/defaults.conf @@ -34,6 +34,7 @@ route-map HIDE_INTERNAL permit 10 router bgp 55555 ! bgp log-neighbor-changes + bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/ipv6_lo.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/ipv6_lo.conf index 50414a89a389..5ee5ce5443aa 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/ipv6_lo.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/ipv6_lo.conf @@ -14,6 +14,7 @@ ipv6 prefix-list PL_LoopbackV6 permit fc00::1/128 router bgp 55555 ! bgp log-neighbor-changes + bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis.conf index a949ce6e4512..6b2e1f257948 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis.conf @@ -34,6 +34,7 @@ route-map HIDE_INTERNAL permit 10 router bgp 55555 ! bgp log-neighbor-changes + bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/voq_chassis.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/voq_chassis.conf index 0d9eeebe9e8e..efd45eda1ea9 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/voq_chassis.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/voq_chassis.conf @@ -34,6 +34,7 @@ route-map HIDE_INTERNAL permit 10 router bgp 55555 ! bgp log-neighbor-changes + bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/frr.conf.j2/all.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/frr.conf.j2/all.conf index af2e974ee9b7..8856e58db686 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/frr.conf.j2/all.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/frr.conf.j2/all.conf @@ -71,6 +71,7 @@ route-map HIDE_INTERNAL permit 10 router bgp 55555 ! bgp log-neighbor-changes + bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index dfdb9406dd49..1cadd297e527 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -608,7 +608,7 @@ def parse_dpg(dpg, hname): else: prefix = prefix + "/32" static_routes[prefix] = {'nexthop': ",".join(nexthop), 'ifname': ",".join(ifname), 'advertise': advertise} - + if port_nhipv4_map and port_nhipv6_map: subnet_check_ip = list(port_nhipv4_map.values())[0] for subnet_range in ip_intfs_map: @@ -2131,6 +2131,10 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw if current_device and current_device['type'] in mgmt_device_types: results["FLEX_COUNTER_TABLE"] = {counter: {"FLEX_COUNTER_STATUS": "disable"} for counter in mgmt_disabled_counters} + # Enable bgp-suppress-fib by default for leafrouter + if current_device and current_device['type'] in leafrouter_device_types: + results['DEVICE_METADATA']['localhost']['suppress-fib-pending'] = 'enabled' + return results def get_tunnel_entries(tunnel_intfs, tunnel_intfs_qos_remap_config, lo_intfs, tunnel_qos_remap, mux_tunnel_name, peer_switch_ip): diff --git a/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr.conf b/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr.conf index 2c146698a960..3828af13fd71 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr.conf @@ -42,6 +42,7 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.0.0/27 router bgp 65100 ! bgp log-neighbor-changes + bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_backend_asic.conf b/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_backend_asic.conf index d793dfa39a98..45cd03a540a8 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_backend_asic.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_backend_asic.conf @@ -53,6 +53,7 @@ route-map HIDE_INTERNAL permit 10 router bgp 65100 ! bgp log-neighbor-changes + bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_dualtor.conf b/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_dualtor.conf index 364a2c34bcaa..eda11ab9f285 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_dualtor.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_dualtor.conf @@ -42,6 +42,7 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.0.0/27 router bgp 65100 ! bgp log-neighbor-changes + bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy coalesce-time 10000 diff --git a/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_frontend_asic.conf b/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_frontend_asic.conf index 94bd37e3b90f..8daeff2a61e9 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_frontend_asic.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_frontend_asic.conf @@ -53,6 +53,7 @@ route-map HIDE_INTERNAL permit 10 router bgp 65100 ! bgp log-neighbor-changes + bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-config-engine/tests/sample_output/py2/frr.conf b/src/sonic-config-engine/tests/sample_output/py2/frr.conf index 2653f8fc0893..032adb8c5106 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/frr.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/frr.conf @@ -62,6 +62,7 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.0.0/27 router bgp 65100 ! bgp log-neighbor-changes + bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-bgpd.conf b/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-bgpd.conf index 20744efaa40f..32a9abf88bac 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-bgpd.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-bgpd.conf @@ -58,6 +58,7 @@ ip prefix-list PL_LoopbackV4 permit 4.0.0.0/32 router bgp 4000 ! bgp log-neighbor-changes + bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr.conf b/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr.conf index e7534d4b9781..e5ad8964454a 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr.conf @@ -42,6 +42,7 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.200.0/27 router bgp 65100 ! bgp log-neighbor-changes + bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_backend_asic.conf b/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_backend_asic.conf index d793dfa39a98..45cd03a540a8 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_backend_asic.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_backend_asic.conf @@ -53,6 +53,7 @@ route-map HIDE_INTERNAL permit 10 router bgp 65100 ! bgp log-neighbor-changes + bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_dualtor.conf b/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_dualtor.conf index 4f606b80838c..0ada9a4f8d60 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_dualtor.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_dualtor.conf @@ -42,6 +42,7 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.200.0/27 router bgp 65100 ! bgp log-neighbor-changes + bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy coalesce-time 10000 diff --git a/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_frontend_asic.conf b/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_frontend_asic.conf index 94bd37e3b90f..8daeff2a61e9 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_frontend_asic.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_frontend_asic.conf @@ -53,6 +53,7 @@ route-map HIDE_INTERNAL permit 10 router bgp 65100 ! bgp log-neighbor-changes + bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/frr.conf b/src/sonic-config-engine/tests/sample_output/py3/frr.conf index 5b7eacefe8ba..d0821f1b11ca 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/frr.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/frr.conf @@ -62,6 +62,7 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.200.0/27 router bgp 65100 ! bgp log-neighbor-changes + bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-bgpd.conf b/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-bgpd.conf index 20744efaa40f..32a9abf88bac 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-bgpd.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-bgpd.conf @@ -58,6 +58,7 @@ ip prefix-list PL_LoopbackV4 permit 4.0.0.0/32 router bgp 4000 ! bgp log-neighbor-changes + bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-frr/patch/0005-Add-support-of-bgp-l3vni-evpn.patch b/src/sonic-frr/patch/0005-Add-support-of-bgp-l3vni-evpn.patch new file mode 100644 index 000000000000..fe2636c2e289 --- /dev/null +++ b/src/sonic-frr/patch/0005-Add-support-of-bgp-l3vni-evpn.patch @@ -0,0 +1,121 @@ +From f5f0018266c98ad96cdbe69ae60d501de21e5600 Mon Sep 17 00:00:00 2001 +From: Stepan Blyschak +Date: Thu, 20 Oct 2022 13:19:31 +0000 +Subject: [PATCH] From 369bbb4d62aa47d5a6d5157ca6ea819c4cb80f15 Mon Sep 17 + 00:00:00 2001 Subject: [PATCH 07/13] Added support of L3VNI EVPN + +This is temp patch till Prefix to ARP indirection is add in neighorch + +Signed-off-by: Kishore Kunal +Signed-off-by: Stepan Blyschak + +diff --git a/lib/nexthop.c b/lib/nexthop.c +index 7ebc4fefb..2f7bb0e7b 100644 +--- a/lib/nexthop.c ++++ b/lib/nexthop.c +@@ -813,6 +813,7 @@ void nexthop_copy_no_recurse(struct nexthop *copy, + memcpy(©->src, &nexthop->src, sizeof(nexthop->src)); + memcpy(©->rmap_src, &nexthop->rmap_src, sizeof(nexthop->rmap_src)); + copy->rparent = rparent; ++ memcpy(©->nh_encap.encap_data.rmac, &nexthop->nh_encap.encap_data.rmac, ETH_ALEN); + if (nexthop->nh_label) + nexthop_add_labels(copy, nexthop->nh_label_type, + nexthop->nh_label->num_labels, +diff --git a/lib/nexthop.h b/lib/nexthop.h +index f1309aa52..7b4bbbafd 100644 +--- a/lib/nexthop.h ++++ b/lib/nexthop.h +@@ -66,6 +66,11 @@ enum nh_encap_type { + /* Backup index value is limited */ + #define NEXTHOP_BACKUP_IDX_MAX 255 + ++struct vxlan_nh_encap { ++ vni_t vni; ++ struct ethaddr rmac; ++}; ++ + /* Nexthop structure. */ + struct nexthop { + struct nexthop *next; +@@ -137,7 +142,7 @@ struct nexthop { + /* Encapsulation information. */ + enum nh_encap_type nh_encap_type; + union { +- vni_t vni; ++ struct vxlan_nh_encap encap_data; + } nh_encap; + + /* SR-TE color used for matching SR-TE policies */ +diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c +index 79d79d74b..325199eff 100644 +--- a/zebra/rt_netlink.c ++++ b/zebra/rt_netlink.c +@@ -1969,6 +1969,7 @@ static int netlink_route_nexthop_encap(struct nlmsghdr *n, size_t nlen, + struct nexthop *nh) + { + struct rtattr *nest; ++ struct vxlan_nh_encap* encap_data; + + switch (nh->nh_encap_type) { + case NET_VXLAN: +@@ -1979,9 +1980,21 @@ static int netlink_route_nexthop_encap(struct nlmsghdr *n, size_t nlen, + if (!nest) + return false; + ++ encap_data = &nh->nh_encap.encap_data; ++ + if (!nl_attr_put32(n, nlen, 0 /* VXLAN_VNI */, +- nh->nh_encap.vni)) ++ encap_data->vni)) ++ return false; ++ ++ if (ZEBRA_DEBUG_KERNEL) ++ zlog_debug( ++ "%s: VNI:%d RMAC:%pEA", __func__, encap_data->vni, ++ &encap_data->rmac); ++ ++ if (!nl_attr_put(n, nlen, 1 /* VXLAN_RMAC */, ++ &encap_data->rmac, sizeof(encap_data->rmac))) + return false; ++ + nl_attr_nest_end(n, nest); + break; + } +diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c +index c0945eae2..157c33ced 100644 +--- a/zebra/zapi_msg.c ++++ b/zebra/zapi_msg.c +@@ -1605,6 +1605,8 @@ static struct nexthop *nexthop_from_zapi(const struct zapi_nexthop *api_nh, + vtep_ip.ipa_type = IPADDR_V4; + memcpy(&(vtep_ip.ipaddr_v4), &(api_nh->gate.ipv4), + sizeof(struct in_addr)); ++ memcpy(&(nexthop->nh_encap.encap_data.rmac), ++ &api_nh->rmac, ETH_ALEN); + zebra_rib_queue_evpn_route_add( + api_nh->vrf_id, &api_nh->rmac, &vtep_ip, p); + SET_FLAG(nexthop->flags, NEXTHOP_FLAG_EVPN); +@@ -1639,6 +1641,8 @@ static struct nexthop *nexthop_from_zapi(const struct zapi_nexthop *api_nh, + vtep_ip.ipa_type = IPADDR_V6; + memcpy(&vtep_ip.ipaddr_v6, &(api_nh->gate.ipv6), + sizeof(struct in6_addr)); ++ memcpy(&(nexthop->nh_encap.encap_data.rmac), ++ &api_nh->rmac, ETH_ALEN); + zebra_rib_queue_evpn_route_add( + api_nh->vrf_id, &api_nh->rmac, &vtep_ip, p); + SET_FLAG(nexthop->flags, NEXTHOP_FLAG_EVPN); +diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c +index f6f436f39..c8511bd28 100644 +--- a/zebra/zebra_dplane.c ++++ b/zebra/zebra_dplane.c +@@ -2917,7 +2917,7 @@ int dplane_ctx_route_init(struct zebra_dplane_ctx *ctx, enum dplane_op_e op, + zl3vni = zl3vni_from_vrf(nexthop->vrf_id); + if (zl3vni && is_l3vni_oper_up(zl3vni)) { + nexthop->nh_encap_type = NET_VXLAN; +- nexthop->nh_encap.vni = zl3vni->vni; ++ nexthop->nh_encap.encap_data.vni = zl3vni->vni; + } + } + +-- +2.17.1 + diff --git a/src/sonic-frr/patch/0007-ignore-route-from-default-table.patch b/src/sonic-frr/patch/0007-ignore-route-from-default-table.patch new file mode 100644 index 000000000000..52167d765287 --- /dev/null +++ b/src/sonic-frr/patch/0007-ignore-route-from-default-table.patch @@ -0,0 +1,31 @@ +From 1a639f2dcd400997345dab424a2adbc091752661 Mon Sep 17 00:00:00 2001 +From: Stepan Blyschak +Date: Thu, 20 Oct 2022 13:07:18 +0000 +Subject: [PATCH] From ca66350aecf7db3354019480d11754fabae3a97c Mon Sep 17 + 00:00:00 2001 Subject: [PATCH 09/13] ignore route from default table + +Signed-off-by: Stepan Blyschak + +diff --git a/zebra/dplane_fpm_nl.c b/zebra/dplane_fpm_nl.c +index 0a9fecc9d..b18a96353 100644 +--- a/zebra/dplane_fpm_nl.c ++++ b/zebra/dplane_fpm_nl.c +@@ -814,6 +814,15 @@ static int fpm_nl_enqueue(struct fpm_nl_ctx *fnc, struct zebra_dplane_ctx *ctx) + || op == DPLANE_OP_NH_UPDATE)) + return 0; + ++ /* ++ * Ignore route from default table, because when mgmt port goes down, ++ * zebra will remove the default route and causing ASIC to blackhole IO. ++ */ ++ if (dplane_ctx_get_table(ctx) == RT_TABLE_DEFAULT) { ++ zlog_debug("%s: discard default table route", __func__); ++ return 0; ++ } ++ + nl_buf_len = 0; + + frr_mutex_lock_autounlock(&fnc->obuf_mutex); +-- +2.17.1 + diff --git a/src/sonic-frr/patch/0008-Use-vrf_id-for-vrf-not-tabled_id.patch b/src/sonic-frr/patch/0008-Use-vrf_id-for-vrf-not-tabled_id.patch new file mode 100644 index 000000000000..ae8b05f06bd0 --- /dev/null +++ b/src/sonic-frr/patch/0008-Use-vrf_id-for-vrf-not-tabled_id.patch @@ -0,0 +1,111 @@ +From 44f3736ee601e06e43e978fa075402c3da4823bd Mon Sep 17 00:00:00 2001 +From: Stepan Blyschak +Date: Mon, 16 Jan 2023 11:45:19 +0000 +Subject: [PATCH] From 349e3f758860be0077b69919c39764d3486ec44a Mon Sep 17 + 00:00:00 2001 Subject: [PATCH] use vrf id instead of table id + +Signed-off-by: Stepan Blyschak + +diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c +index 325199eff..587045eac 100644 +--- a/zebra/rt_netlink.c ++++ b/zebra/rt_netlink.c +@@ -406,6 +406,30 @@ vrf_id_t vrf_lookup_by_table(uint32_t table_id, ns_id_t ns_id) + return VRF_DEFAULT; + } + ++static uint32_t table_lookup_by_vrf(vrf_id_t vrf_id, ns_id_t ns_id) ++{ ++ struct vrf *vrf; ++ struct zebra_vrf *zvrf; ++ ++ RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id) { ++ zvrf = vrf->info; ++ if (zvrf == NULL) ++ continue; ++ /* case vrf with netns : match the netnsid */ ++ if (vrf_is_backend_netns()) { ++ if (ns_id == zvrf_id(zvrf)) ++ return zvrf->table_id; ++ } else { ++ /* VRF is VRF_BACKEND_VRF_LITE */ ++ if (zvrf_id(zvrf) != vrf_id) ++ continue; ++ return zvrf->table_id; ++ } ++ } ++ ++ return RT_TABLE_UNSPEC; ++} ++ + /** + * @parse_encap_mpls() - Parses encapsulated mpls attributes + * @tb: Pointer to rtattr to look for nested items in. +@@ -782,14 +806,26 @@ int netlink_route_change_read_unicast_internal(struct nlmsghdr *h, + if (rtm->rtm_family == AF_MPLS) + return 0; + +- /* Table corresponding to route. */ +- if (tb[RTA_TABLE]) +- table = *(int *)RTA_DATA(tb[RTA_TABLE]); +- else +- table = rtm->rtm_table; ++ if (!ctx) { ++ /* Table corresponding to route. */ ++ if (tb[RTA_TABLE]) ++ table = *(int *)RTA_DATA(tb[RTA_TABLE]); ++ else ++ table = rtm->rtm_table; ++ ++ /* Map to VRF */ ++ vrf_id = vrf_lookup_by_table(table, ns_id); ++ } else { ++ /* With FPM, rtm_table contains vrf id, see netlink_route_multipath_msg_encode */ ++ if (tb[RTA_TABLE]) ++ vrf_id = *(int *)RTA_DATA(tb[RTA_TABLE]); ++ else ++ vrf_id = rtm->rtm_table; ++ ++ /* Map to table */ ++ table = table_lookup_by_vrf(vrf_id, ns_id); ++ } + +- /* Map to VRF */ +- vrf_id = vrf_lookup_by_table(table, ns_id); + if (vrf_id == VRF_DEFAULT) { + if (!is_zebra_valid_kernel_table(table) + && !is_zebra_main_routing_table(table)) +@@ -2102,12 +2138,24 @@ ssize_t netlink_route_multipath_msg_encode(int cmd, + + /* Table corresponding to this route. */ + table_id = dplane_ctx_get_table(ctx); +- if (table_id < 256) +- req->r.rtm_table = table_id; +- else { +- req->r.rtm_table = RT_TABLE_UNSPEC; +- if (!nl_attr_put32(&req->n, datalen, RTA_TABLE, table_id)) +- return 0; ++ if (!fpm) { ++ if (table_id < 256) ++ req->r.rtm_table = table_id; ++ else { ++ req->r.rtm_table = RT_TABLE_UNSPEC; ++ if (!nl_attr_put32(&req->n, datalen, RTA_TABLE, table_id)) ++ return 0; ++ } ++ } else { ++ /* Put vrf if_index instead of table id */ ++ vrf_id_t vrf = dplane_ctx_get_vrf(ctx); ++ if (vrf < 256) ++ req->r.rtm_table = vrf; ++ else { ++ req->r.rtm_table = RT_TABLE_UNSPEC; ++ if (!nl_attr_put32(&req->n, datalen, RTA_TABLE, vrf)) ++ return 0; ++ } + } + + if (IS_ZEBRA_DEBUG_KERNEL) +-- +2.17.1 + diff --git a/src/sonic-frr/patch/0012-zebra-Rename-vrf_lookup_by_tableid-to-zebra_vrf_look.patch b/src/sonic-frr/patch/0012-zebra-Rename-vrf_lookup_by_tableid-to-zebra_vrf_look.patch index 01f8d04c2b78..ca6517fbf655 100644 --- a/src/sonic-frr/patch/0012-zebra-Rename-vrf_lookup_by_tableid-to-zebra_vrf_look.patch +++ b/src/sonic-frr/patch/0012-zebra-Rename-vrf_lookup_by_tableid-to-zebra_vrf_look.patch @@ -1,4 +1,4 @@ -From 6a3ae11c9b1480966b22d4f9b67a40b76d96aa15 Mon Sep 17 00:00:00 2001 +From 2b9c7592a9857ddccc77b9d3f178e0c5bd5f19ed Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 26 Apr 2023 23:25:27 -0400 Subject: [PATCH] zebra: Rename vrf_lookup_by_tableid to zebra_vrf_lookup.. @@ -9,19 +9,12 @@ we need zebra specific data to find this vrf_id and as such it does not belong in vrf.c Signed-off-by: Donald Sharp ---- - zebra/if_netlink.c | 3 ++- - zebra/rt_netlink.c | 31 ++----------------------------- - zebra/rt_netlink.h | 1 - - zebra/zebra_vrf.c | 27 +++++++++++++++++++++++++++ - zebra/zebra_vrf.h | 1 + - 5 files changed, 32 insertions(+), 31 deletions(-) diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c -index cd200d821d7a..cea47b4c30af 100644 +index 81347b550a..4599121261 100644 --- a/zebra/if_netlink.c +++ b/zebra/if_netlink.c -@@ -325,7 +325,8 @@ static void netlink_vrf_change(struct nlmsghdr *h, struct rtattr *tb, +@@ -342,7 +342,8 @@ static void netlink_vrf_change(struct nlmsghdr *h, struct rtattr *tb, if (!vrf_lookup_by_id((vrf_id_t)ifi->ifi_index)) { vrf_id_t exist_id; @@ -32,10 +25,10 @@ index cd200d821d7a..cea47b4c30af 100644 vrf = vrf_lookup_by_id(exist_id); diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c -index de01ced411ef..0f542ab80756 100644 +index 587045eac2..6b9b047858 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c -@@ -380,33 +380,6 @@ static inline int proto2zebra(int proto, int family, bool is_nexthop) +@@ -379,33 +379,6 @@ static inline int proto2zebra(int proto, int family, bool is_nexthop) return proto; } @@ -66,19 +59,19 @@ index de01ced411ef..0f542ab80756 100644 - return VRF_DEFAULT; -} - - /** - * @parse_encap_mpls() - Parses encapsulated mpls attributes - * @tb: Pointer to rtattr to look for nested items in. -@@ -790,7 +763,7 @@ int netlink_route_change_read_unicast_internal(struct nlmsghdr *h, - table = rtm->rtm_table; + static uint32_t table_lookup_by_vrf(vrf_id_t vrf_id, ns_id_t ns_id) + { + struct vrf *vrf; +@@ -814,7 +787,7 @@ int netlink_route_change_read_unicast_internal(struct nlmsghdr *h, + table = rtm->rtm_table; - /* Map to VRF */ -- vrf_id = vrf_lookup_by_table(table, ns_id); -+ vrf_id = zebra_vrf_lookup_by_table(table, ns_id); - if (vrf_id == VRF_DEFAULT) { - if (!is_zebra_valid_kernel_table(table) - && !is_zebra_main_routing_table(table)) -@@ -1079,7 +1052,7 @@ static int netlink_route_change_read_multicast(struct nlmsghdr *h, + /* Map to VRF */ +- vrf_id = vrf_lookup_by_table(table, ns_id); ++ vrf_id = zebra_vrf_lookup_by_table(table, ns_id); + } else { + /* With FPM, rtm_table contains vrf id, see netlink_route_multipath_msg_encode */ + if (tb[RTA_TABLE]) +@@ -1114,7 +1087,7 @@ static int netlink_route_change_read_multicast(struct nlmsghdr *h, else table = rtm->rtm_table; @@ -88,10 +81,10 @@ index de01ced411ef..0f542ab80756 100644 if (tb[RTA_IIF]) iif = *(int *)RTA_DATA(tb[RTA_IIF]); diff --git a/zebra/rt_netlink.h b/zebra/rt_netlink.h -index 3ca59ce676f3..d9d0ee76249a 100644 +index 8506367ae4..364aac0f6b 100644 --- a/zebra/rt_netlink.h +++ b/zebra/rt_netlink.h -@@ -90,7 +90,6 @@ extern int netlink_macfdb_read_specific_mac(struct zebra_ns *zns, +@@ -102,7 +102,6 @@ extern int netlink_macfdb_read_specific_mac(struct zebra_ns *zns, uint16_t vid); extern int netlink_neigh_read_specific_ip(const struct ipaddr *ip, struct interface *vlan_if); @@ -100,10 +93,10 @@ index 3ca59ce676f3..d9d0ee76249a 100644 struct nl_batch; extern enum netlink_msg_status diff --git a/zebra/zebra_vrf.c b/zebra/zebra_vrf.c -index 3365cdcdbaa8..74b9d106cdc3 100644 +index be5e91495f..c59cb7c0a7 100644 --- a/zebra/zebra_vrf.c +++ b/zebra/zebra_vrf.c -@@ -376,6 +376,33 @@ struct zebra_vrf *zebra_vrf_alloc(struct vrf *vrf) +@@ -389,6 +389,33 @@ struct zebra_vrf *zebra_vrf_alloc(struct vrf *vrf) return zvrf; } @@ -138,10 +131,10 @@ index 3365cdcdbaa8..74b9d106cdc3 100644 struct zebra_vrf *zebra_vrf_lookup_by_id(vrf_id_t vrf_id) { diff --git a/zebra/zebra_vrf.h b/zebra/zebra_vrf.h -index b23b7282610b..aef83cd8f172 100644 +index 02e3c197c9..937e7fb144 100644 --- a/zebra/zebra_vrf.h +++ b/zebra/zebra_vrf.h -@@ -237,6 +237,7 @@ extern struct route_table *zebra_vrf_get_table_with_table_id(afi_t afi, +@@ -252,6 +252,7 @@ extern struct route_table *zebra_vrf_get_table_with_table_id(afi_t afi, extern void zebra_vrf_update_all(struct zserv *client); extern struct zebra_vrf *zebra_vrf_lookup_by_id(vrf_id_t vrf_id); extern struct zebra_vrf *zebra_vrf_lookup_by_name(const char *); @@ -149,3 +142,6 @@ index b23b7282610b..aef83cd8f172 100644 extern struct zebra_vrf *zebra_vrf_alloc(struct vrf *vrf); extern struct route_table *zebra_vrf_table(afi_t, safi_t, vrf_id_t); +-- +2.17.1 + diff --git a/src/sonic-frr/patch/0034-fpm-Use-vrf_id-for-vrf-not-tabled_id.patch b/src/sonic-frr/patch/0034-fpm-Use-vrf_id-for-vrf-not-tabled_id.patch deleted file mode 100644 index f815cf38455e..000000000000 --- a/src/sonic-frr/patch/0034-fpm-Use-vrf_id-for-vrf-not-tabled_id.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 39bb40dc4bad4462e4ae9c98580d75fa2c92e032 Mon Sep 17 00:00:00 2001 -From: Pavel Shirshov -Date: Mon, 16 Nov 2020 18:29:46 -0800 -Subject: [PATCH 3/8] Use vrf_id for vrf, not tabled_id - ---- - zebra/zebra_fpm_netlink.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/zebra/zebra_fpm_netlink.c b/zebra/zebra_fpm_netlink.c -index ec22c5dd4..aad0156b3 100644 ---- a/zebra/zebra_fpm_netlink.c -+++ b/zebra/zebra_fpm_netlink.c -@@ -287,7 +287,7 @@ static int netlink_route_info_fill(struct netlink_route_info *ri, int cmd, - ri->nlmsg_pid = zvrf->zns->netlink_dplane_out.snl.nl_pid; - - ri->nlmsg_type = cmd; -- ri->rtm_table = table_info->table_id; -+ ri->rtm_table = zvrf_id(rib_dest_vrf(dest)); - ri->rtm_protocol = RTPROT_UNSPEC; - - /* --- -2.12.2 - diff --git a/src/sonic-frr/patch/0035-fpm-ignore-route-from-default-table.patch b/src/sonic-frr/patch/0035-fpm-ignore-route-from-default-table.patch deleted file mode 100644 index e925b9908fb6..000000000000 --- a/src/sonic-frr/patch/0035-fpm-ignore-route-from-default-table.patch +++ /dev/null @@ -1,29 +0,0 @@ -From bb3b003840959adf5b5be52e91bc798007c9857a Mon Sep 17 00:00:00 2001 -From: Ying Xie -Date: Thu, 8 Sep 2022 04:20:36 +0000 -Subject: [PATCH] From 776a29e8ab32c1364ee601a8730aabb773b0c86b Mon Sep 17 - 00:00:00 2001 Subject: [PATCH] ignore route from default table - -Signed-off-by: Ying Xie ---- - zebra/zebra_fpm_netlink.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/zebra/zebra_fpm_netlink.c b/zebra/zebra_fpm_netlink.c -index 34be9fb39..d6c875a7e 100644 ---- a/zebra/zebra_fpm_netlink.c -+++ b/zebra/zebra_fpm_netlink.c -@@ -283,6 +283,11 @@ static int netlink_route_info_fill(struct netlink_route_info *ri, int cmd, - rib_table_info(rib_dest_table(dest)); - struct zebra_vrf *zvrf = table_info->zvrf; - -+ if (table_info->table_id == RT_TABLE_DEFAULT) { -+ zfpm_debug("%s: Discard default table route", __func__); -+ return 0; -+ } -+ - memset(ri, 0, sizeof(*ri)); - - ri->prefix = rib_dest_prefix(dest); --- -2.17.1 diff --git a/src/sonic-frr/patch/0036-Add-support-of-bgp-l3vni-evpn.patch b/src/sonic-frr/patch/0036-Add-support-of-bgp-l3vni-evpn.patch deleted file mode 100644 index 01d4df820739..000000000000 --- a/src/sonic-frr/patch/0036-Add-support-of-bgp-l3vni-evpn.patch +++ /dev/null @@ -1,164 +0,0 @@ -From b1b2e40cf43a9d206e2d867bdec4f0f7b740c8b9 Mon Sep 17 00:00:00 2001 -From: stepanb -Date: Tue, 19 Dec 2023 11:27:37 +0000 -Subject: [PATCH] Add support of bgp l3vni evpn - ---- - lib/nexthop.c | 2 ++ - lib/nexthop.h | 6 ++++++ - zebra/rt_netlink.c | 2 +- - zebra/zapi_msg.c | 4 ++++ - zebra/zebra_dplane.c | 1 + - zebra/zebra_fpm_netlink.c | 20 ++++++++++++++++++++ - 6 files changed, 34 insertions(+), 1 deletion(-) - -diff --git a/lib/nexthop.c b/lib/nexthop.c -index 7ebc4fefb..fe42b9f86 100644 ---- a/lib/nexthop.c -+++ b/lib/nexthop.c -@@ -813,6 +813,8 @@ void nexthop_copy_no_recurse(struct nexthop *copy, - memcpy(©->src, &nexthop->src, sizeof(nexthop->src)); - memcpy(©->rmap_src, &nexthop->rmap_src, sizeof(nexthop->rmap_src)); - copy->rparent = rparent; -+ memcpy(©->nh_encap.encap_data.rmac, &nexthop->nh_encap.encap_data.rmac, ETH_ALEN); -+ - if (nexthop->nh_label) - nexthop_add_labels(copy, nexthop->nh_label_type, - nexthop->nh_label->num_labels, -diff --git a/lib/nexthop.h b/lib/nexthop.h -index f1309aa52..7026ce1c2 100644 ---- a/lib/nexthop.h -+++ b/lib/nexthop.h -@@ -66,6 +66,11 @@ enum nh_encap_type { - /* Backup index value is limited */ - #define NEXTHOP_BACKUP_IDX_MAX 255 - -+struct vxlan_nh_encap { -+ vni_t vni; -+ struct ethaddr rmac; -+}; -+ - /* Nexthop structure. */ - struct nexthop { - struct nexthop *next; -@@ -138,6 +143,7 @@ struct nexthop { - enum nh_encap_type nh_encap_type; - union { - vni_t vni; -+ struct vxlan_nh_encap encap_data; - } nh_encap; - - /* SR-TE color used for matching SR-TE policies */ -diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c -index d31732a55..581255158 100644 ---- a/zebra/rt_netlink.c -+++ b/zebra/rt_netlink.c -@@ -1991,7 +1991,7 @@ static int netlink_route_nexthop_encap(struct nlmsghdr *n, size_t nlen, - return false; - - if (!nl_attr_put32(n, nlen, 0 /* VXLAN_VNI */, -- nh->nh_encap.vni)) -+ nh->nh_encap.encap_data.vni)) - return false; - nl_attr_nest_end(n, nest); - break; -diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c -index c0945eae2..157c33ced 100644 ---- a/zebra/zapi_msg.c -+++ b/zebra/zapi_msg.c -@@ -1605,6 +1605,8 @@ static struct nexthop *nexthop_from_zapi(const struct zapi_nexthop *api_nh, - vtep_ip.ipa_type = IPADDR_V4; - memcpy(&(vtep_ip.ipaddr_v4), &(api_nh->gate.ipv4), - sizeof(struct in_addr)); -+ memcpy(&(nexthop->nh_encap.encap_data.rmac), -+ &api_nh->rmac, ETH_ALEN); - zebra_rib_queue_evpn_route_add( - api_nh->vrf_id, &api_nh->rmac, &vtep_ip, p); - SET_FLAG(nexthop->flags, NEXTHOP_FLAG_EVPN); -@@ -1639,6 +1641,8 @@ static struct nexthop *nexthop_from_zapi(const struct zapi_nexthop *api_nh, - vtep_ip.ipa_type = IPADDR_V6; - memcpy(&vtep_ip.ipaddr_v6, &(api_nh->gate.ipv6), - sizeof(struct in6_addr)); -+ memcpy(&(nexthop->nh_encap.encap_data.rmac), -+ &api_nh->rmac, ETH_ALEN); - zebra_rib_queue_evpn_route_add( - api_nh->vrf_id, &api_nh->rmac, &vtep_ip, p); - SET_FLAG(nexthop->flags, NEXTHOP_FLAG_EVPN); -diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c -index 34d30484a..260a7b497 100644 ---- a/zebra/zebra_dplane.c -+++ b/zebra/zebra_dplane.c -@@ -3394,6 +3394,7 @@ int dplane_ctx_route_init(struct zebra_dplane_ctx *ctx, enum dplane_op_e op, - if (zl3vni && is_l3vni_oper_up(zl3vni)) { - nexthop->nh_encap_type = NET_VXLAN; - nexthop->nh_encap.vni = zl3vni->vni; -+ nexthop->nh_encap.encap_data.vni = zl3vni->vni; - } - } - -diff --git a/zebra/zebra_fpm_netlink.c b/zebra/zebra_fpm_netlink.c -index ec6090da9..22650eedc 100644 ---- a/zebra/zebra_fpm_netlink.c -+++ b/zebra/zebra_fpm_netlink.c -@@ -95,10 +95,12 @@ static const char *fpm_nh_encap_type_to_str(enum fpm_nh_encap_type_t encap_type) - - struct vxlan_encap_info_t { - vni_t vni; -+ struct ethaddr rmac; - }; - - enum vxlan_encap_info_type_t { - VXLAN_VNI = 0, -+ VXLAN_RMAC = 1, - }; - - struct fpm_nh_encap_info_t { -@@ -234,6 +236,9 @@ static int netlink_route_info_add_nh(struct netlink_route_info *ri, - } - - nhi.encap_info.vxlan_encap.vni = vni; -+ memcpy(&nhi.encap_info.vxlan_encap.rmac, -+ &(nexthop->nh_encap.encap_data.rmac), -+ ETH_ALEN); - } - - /* -@@ -456,9 +461,16 @@ static int netlink_route_info_encode(struct netlink_route_info *ri, - nl_attr_put16(&req->n, in_buf_len, RTA_ENCAP_TYPE, - encap); - vxlan = &nhi->encap_info.vxlan_encap; -+ char buf[ETHER_ADDR_STRLEN]; -+ -+ zfpm_debug( -+ "%s: VNI:%d RMAC:%s", __func__, vxlan->vni, -+ prefix_mac2str(&vxlan->rmac, buf, sizeof(buf))); - nest = nl_attr_nest(&req->n, in_buf_len, RTA_ENCAP); - nl_attr_put32(&req->n, in_buf_len, VXLAN_VNI, - vxlan->vni); -+ nl_attr_put(&req->n, in_buf_len, VXLAN_RMAC, -+ &vxlan->rmac, sizeof(vxlan->rmac)); - nl_attr_nest_end(&req->n, nest); - break; - } -@@ -494,10 +506,18 @@ static int netlink_route_info_encode(struct netlink_route_info *ri, - nl_attr_put16(&req->n, in_buf_len, RTA_ENCAP_TYPE, - encap); - vxlan = &nhi->encap_info.vxlan_encap; -+ char rmac_buf[ETHER_ADDR_STRLEN]; -+ -+ zfpm_debug("%s: Multi VNI:%d RMAC:%s", __func__, -+ vxlan->vni, -+ prefix_mac2str(&vxlan->rmac, rmac_buf, -+ sizeof(rmac_buf))); - inner_nest = - nl_attr_nest(&req->n, in_buf_len, RTA_ENCAP); - nl_attr_put32(&req->n, in_buf_len, VXLAN_VNI, - vxlan->vni); -+ nl_attr_put(&req->n, in_buf_len, VXLAN_RMAC, -+ &vxlan->rmac, sizeof(vxlan->rmac)); - nl_attr_nest_end(&req->n, inner_nest); - break; - } --- -2.30.2 - diff --git a/src/sonic-frr/patch/series b/src/sonic-frr/patch/series index e2f5bc28a91f..c87c5e61f986 100644 --- a/src/sonic-frr/patch/series +++ b/src/sonic-frr/patch/series @@ -2,9 +2,12 @@ 0002-Allow-BGP-attr-NEXT_HOP-to-be-0.0.0.0-due-to-allevia.patch 0003-nexthops-compare-vrf-only-if-ip-type.patch 0004-frr-remove-frr-log-outchannel-to-var-log-frr.log.patch +0005-Add-support-of-bgp-l3vni-evpn.patch 0006-Link-local-scope-was-not-set-while-binding-socket-for-bgp-ipv6-link-local-neighbors.patch Disable-ipv6-src-address-test-in-pceplib.patch cross-compile-changes.patch +0007-ignore-route-from-default-table.patch +0008-Use-vrf_id-for-vrf-not-tabled_id.patch 0009-bgpd-Ensure-suppress-fib-pending-works-with-network-.patch 0010-bgpd-Change-log-level-for-graceful-restart-events.patch 0011-zebra-Static-routes-async-notification-do-not-need-t.patch @@ -29,6 +32,3 @@ cross-compile-changes.patch 0030-bgpd-Treat-EOR-as-withdrawn-to-avoid-unwanted-handli.patch 0031-bgpd-Ignore-handling-NLRIs-if-we-received-MP_UNREACH.patch 0032-zebra-Fix-fpm-multipath-encap-addition.patch -0034-fpm-Use-vrf_id-for-vrf-not-tabled_id.patch -0035-fpm-ignore-route-from-default-table.patch -0036-Add-support-of-bgp-l3vni-evpn.patch diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json b/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json index 65288b8b2db8..141d8b5c8230 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json @@ -126,6 +126,16 @@ "DEVICE_METADATA_ADVERTISE_LO_PREFIX_AS_128": { "desc": "Verifying advertising lo prefix as /128." }, + "DEVICE_METADATA_SUPPRESS_PENDING_FIB_ENABLED": { + "desc": "Enable bgp-suppress-fib-pending" + }, + "DEVICE_METADATA_SUPPRESS_PENDING_FIB_DISABLED": { + "desc": "Disable bgp-suppress-fib-pending" + }, + "DEVICE_METADATA_SUPPRESS_PENDING_FIB_ENABLED_SYNCHRONOUS_MODE_DISABLED": { + "desc": "Enable bgp-suppress-fib-pending when synchronous mode is disabled", + "eStr": ["ASIC synchronous mode must be enabled in order to enable suppress FIB pending feature"] + }, "DEVICE_METADATA_VALID_RACK_MGMT_MAP": { "desc": "Verifying rack_mgmt_map configuration." }, diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json index b8053aa6ac66..941077205df6 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json @@ -333,6 +333,36 @@ } } }, + "DEVICE_METADATA_SUPPRESS_PENDING_FIB_ENABLED": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "sonic-device_metadata:localhost": { + "synchronous_mode": "enable", + "suppress-fib-pending": "enabled" + } + } + } + }, + "DEVICE_METADATA_SUPPRESS_PENDING_FIB_DISABLED": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "sonic-device_metadata:localhost": { + "synchronous_mode": "disable", + "suppress-fib-pending": "disabled" + } + } + } + }, + "DEVICE_METADATA_SUPPRESS_PENDING_FIB_ENABLED_SYNCHRONOUS_MODE_DISABLED": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "sonic-device_metadata:localhost": { + "synchronous_mode": "disable", + "suppress-fib-pending": "enabled" + } + } + } + }, "DEVICE_METADATA_VALID_RACK_MGMT_MAP": { "sonic-device_metadata:sonic-device_metadata": { "sonic-device_metadata:DEVICE_METADATA": { diff --git a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang index 392bbf941f6f..26e20d196a88 100644 --- a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang +++ b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang @@ -205,6 +205,18 @@ module sonic-device_metadata { By default SONiC advertises /128 subnet prefix in Loopback0 as /64 subnet route"; } + leaf suppress-fib-pending { + description "Enable BGP suppress FIB pending feature. BGP will wait for route FIB installation before announcing routes"; + type enumeration { + enum enabled; + enum disabled; + } + default disabled; + + must "((current() = 'disabled') or (current() = 'enabled' and ../synchronous_mode = 'enable'))" { + error-message "ASIC synchronous mode must be enabled in order to enable suppress FIB pending feature"; + } + } leaf rack_mgmt_map { type string { length 0..128 { From 30fe193900632717687b01e69cb9b44c9f5ce0e4 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 24 Jan 2024 15:41:58 +0800 Subject: [PATCH 080/419] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#17880) src/sonic-swss * b78a4181 - (HEAD -> 202311, origin/202311) Add host_tx_ready enhancements (#2930) (2 days ago) [noaOrMlnx] --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 7e691347274e..b78a4181627d 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 7e691347274ebc17e1c6655396db6826a72d4fc3 +Subproject commit b78a4181627d9db3d55c244446697dd2f741f4b2 From 05dafc9653ebf5fe262c76fbfba3b0930ea9bf55 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 24 Jan 2024 15:42:23 +0800 Subject: [PATCH 081/419] [submodule] Update submodule linkmgrd to the latest HEAD automatically (#17888) src/linkmgrd * 74e455e - (HEAD -> 202311, origin/202311) [active-standby] Probe the link in suspend timeout (#235) (22 hours ago) [Longxiang Lyu] --- src/linkmgrd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linkmgrd b/src/linkmgrd index 489f6cee955a..74e455e01779 160000 --- a/src/linkmgrd +++ b/src/linkmgrd @@ -1 +1 @@ -Subproject commit 489f6cee955a10d5d6d576d8258e1bd69efa5665 +Subproject commit 74e455e01779e7da240c50d97d40de550fc2aa72 From 7430574fc830e3589d6c4bed61e6d29ca6f3a5e7 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 24 Jan 2024 15:42:51 +0800 Subject: [PATCH 082/419] [submodule] Update submodule sonic-snmpagent to the latest HEAD automatically (#17890) src/sonic-snmpagent * 03e8bcd - (HEAD -> 202311, origin/202311) Fix SNMP dropping some of the queue counter when create_only_config_db_buffers is set to true (#303) (10 hours ago) [DavidZagury] --- src/sonic-snmpagent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-snmpagent b/src/sonic-snmpagent index 347a6e452211..03e8bcddda3b 160000 --- a/src/sonic-snmpagent +++ b/src/sonic-snmpagent @@ -1 +1 @@ -Subproject commit 347a6e4522111111e13ee1ab4fd4e0a58adcf612 +Subproject commit 03e8bcddda3b1ba14f753ff931df90090987e12a From c7d84d26d50fe6c972f622f4f180608d9f96daad Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 25 Jan 2024 16:34:50 +0800 Subject: [PATCH 083/419] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#17898) #### Why I did it src/sonic-utilities ``` * e70b0546 - (HEAD -> 202311, origin/202311) [202311] Revert bgp suppress fib pending (#3109) (9 hours ago) [Stepan Blyshchak] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index 7a242eeb8e12..e70b05460406 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 7a242eeb8e12c18366bff5eb27500b0de2a213c8 +Subproject commit e70b054604062683f766a28dc295c7443b63c4a1 From d41a23986e43b665cdb39fb5de3f1736c7401353 Mon Sep 17 00:00:00 2001 From: Liu Shilong Date: Thu, 25 Jan 2024 19:00:57 +0800 Subject: [PATCH 084/419] [ci] Remove barefoot build in Pinning Version pipeline. (#17901) Why I did it Remove barefoot platform in pinning version pipeline. Work item tracking Microsoft ADO (number only): 26515265 --- .azure-pipelines/azure-pipelines-UpgrateVersion.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.azure-pipelines/azure-pipelines-UpgrateVersion.yml b/.azure-pipelines/azure-pipelines-UpgrateVersion.yml index 6800b0c8e057..c4d1d9f98db1 100644 --- a/.azure-pipelines/azure-pipelines-UpgrateVersion.yml +++ b/.azure-pipelines/azure-pipelines-UpgrateVersion.yml @@ -33,7 +33,6 @@ parameters: type: object default: - vs - - barefoot - broadcom - centec - centec-arm64 From 388c3f5f9011a2c27fcb0eeece734ae0655c40a1 Mon Sep 17 00:00:00 2001 From: Ying Xie Date: Fri, 26 Jan 2024 13:12:10 -0800 Subject: [PATCH 085/419] [202311][sonic-utilities] Revert bgp suppress fib pending (#17915) Revert "Revert "[202311] Revert bgp suppress fib pending" (#17882)" This reverts commit 1ccee478e226844f3098ebc48d1e7bbfe1cba589. sonic-utilities: * be294f39 2024-01-25 | [202311] Revert bgp suppress fib pending (#3003) (HEAD -> 202311, github/202311) [Stepan Blyshchak] Signed-off-by: Ying Xie --- .../docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2 | 1 - .../frr/supervisord/supervisord.conf.j2 | 2 +- .../vs/docker-sonic-vs/supervisord.conf.j2 | 2 +- src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py | 5 +- .../data/sonic-cfggen/bgpd.conf.j2/all.conf | 1 - .../sonic-cfggen/bgpd.main.conf.j2/all.conf | 1 - .../sonic-cfggen/bgpd.main.conf.j2/base.conf | 1 - .../bgpd.main.conf.j2/defaults.conf | 1 - .../bgpd.main.conf.j2/ipv6_lo.conf | 1 - .../bgpd.main.conf.j2/packet_chassis.conf | 1 - .../bgpd.main.conf.j2/voq_chassis.conf | 1 - .../data/sonic-cfggen/frr.conf.j2/all.conf | 1 - src/sonic-config-engine/minigraph.py | 6 +- .../tests/sample_output/py2/bgpd_frr.conf | 1 - .../py2/bgpd_frr_backend_asic.conf | 1 - .../sample_output/py2/bgpd_frr_dualtor.conf | 1 - .../py2/bgpd_frr_frontend_asic.conf | 1 - .../tests/sample_output/py2/frr.conf | 1 - .../sample_output/py2/t2-chassis-fe-bgpd.conf | 1 - .../tests/sample_output/py3/bgpd_frr.conf | 1 - .../py3/bgpd_frr_backend_asic.conf | 1 - .../sample_output/py3/bgpd_frr_dualtor.conf | 1 - .../py3/bgpd_frr_frontend_asic.conf | 1 - .../tests/sample_output/py3/frr.conf | 1 - .../sample_output/py3/t2-chassis-fe-bgpd.conf | 1 - .../0005-Add-support-of-bgp-l3vni-evpn.patch | 121 ------------- ...0007-ignore-route-from-default-table.patch | 31 ---- ...008-Use-vrf_id-for-vrf-not-tabled_id.patch | 111 ------------ ..._lookup_by_tableid-to-zebra_vrf_look.patch | 56 +++--- ...fpm-Use-vrf_id-for-vrf-not-tabled_id.patch | 25 +++ ...-fpm-ignore-route-from-default-table.patch | 29 ++++ .../0036-Add-support-of-bgp-l3vni-evpn.patch | 164 ++++++++++++++++++ src/sonic-frr/patch/series | 6 +- src/sonic-swss | 2 +- .../tests/device_metadata.json | 10 -- .../tests_config/device_metadata.json | 30 ---- .../yang-models/sonic-device_metadata.yang | 12 -- 37 files changed, 257 insertions(+), 376 deletions(-) delete mode 100644 src/sonic-frr/patch/0005-Add-support-of-bgp-l3vni-evpn.patch delete mode 100644 src/sonic-frr/patch/0007-ignore-route-from-default-table.patch delete mode 100644 src/sonic-frr/patch/0008-Use-vrf_id-for-vrf-not-tabled_id.patch create mode 100644 src/sonic-frr/patch/0034-fpm-Use-vrf_id-for-vrf-not-tabled_id.patch create mode 100644 src/sonic-frr/patch/0035-fpm-ignore-route-from-default-table.patch create mode 100644 src/sonic-frr/patch/0036-Add-support-of-bgp-l3vni-evpn.patch diff --git a/dockers/docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2 b/dockers/docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2 index 793ab055c215..f13c11f91e48 100644 --- a/dockers/docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2 +++ b/dockers/docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2 @@ -66,7 +66,6 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} ! {% block bgp_init %} bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy {% if (DEVICE_METADATA is defined) and ('localhost' in DEVICE_METADATA) and ('subtype' in DEVICE_METADATA['localhost']) and (DEVICE_METADATA['localhost']['subtype'].lower() == 'dualtor') %} diff --git a/dockers/docker-fpm-frr/frr/supervisord/supervisord.conf.j2 b/dockers/docker-fpm-frr/frr/supervisord/supervisord.conf.j2 index 0b26be8d3c45..00b24d697f50 100644 --- a/dockers/docker-fpm-frr/frr/supervisord/supervisord.conf.j2 +++ b/dockers/docker-fpm-frr/frr/supervisord/supervisord.conf.j2 @@ -30,7 +30,7 @@ stderr_logfile=syslog dependent_startup=true [program:zebra] -command=/usr/lib/frr/zebra -A 127.0.0.1 -s 90000000 -M dplane_fpm_nl -M snmp --asic-offload=notify_on_offload +command=/usr/lib/frr/zebra -A 127.0.0.1 -s 90000000 -M fpm -M snmp priority=4 autostart=false autorestart=false diff --git a/platform/vs/docker-sonic-vs/supervisord.conf.j2 b/platform/vs/docker-sonic-vs/supervisord.conf.j2 index 5b988a5a5d92..d8c1cf368113 100644 --- a/platform/vs/docker-sonic-vs/supervisord.conf.j2 +++ b/platform/vs/docker-sonic-vs/supervisord.conf.j2 @@ -164,7 +164,7 @@ environment=ASAN_OPTIONS="log_path=/var/log/asan/teammgrd-asan.log{{ asan_extra_ {% endif %} [program:zebra] -command=/usr/lib/frr/zebra -A 127.0.0.1 -s 90000000 -M dplane_fpm_nl --asic-offload=notify_on_offload +command=/usr/lib/frr/zebra -A 127.0.0.1 -s 90000000 -M fpm priority=13 autostart=false autorestart=false diff --git a/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py b/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py index e88dc60b8c55..b15f841f6166 100644 --- a/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py +++ b/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py @@ -304,11 +304,10 @@ def apply_op(self, cmd, vrf): :return: True if no errors, False if there are errors """ bgp_asn = self.directory.get_slot("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME)["localhost"]["bgp_asn"] - enable_bgp_suppress_fib_pending_cmd = 'bgp suppress-fib-pending' if vrf == 'default': - cmd = ('router bgp %s\n %s\n' % (bgp_asn, enable_bgp_suppress_fib_pending_cmd)) + cmd + cmd = ('router bgp %s\n' % bgp_asn) + cmd else: - cmd = ('router bgp %s vrf %s\n %s\n' % (bgp_asn, vrf, enable_bgp_suppress_fib_pending_cmd)) + cmd + cmd = ('router bgp %s vrf %s\n' % (bgp_asn, vrf)) + cmd self.cfg_mgr.push(cmd) return True diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.conf.j2/all.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.conf.j2/all.conf index a7f34245873a..c39115706d79 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.conf.j2/all.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.conf.j2/all.conf @@ -55,7 +55,6 @@ route-map HIDE_INTERNAL permit 20 router bgp 55555 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/all.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/all.conf index d2dc9e40e892..c5ba79d34392 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/all.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/all.conf @@ -34,7 +34,6 @@ route-map HIDE_INTERNAL permit 10 router bgp 55555 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/base.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/base.conf index 27d04b953a3e..77cc9d6fffd8 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/base.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/base.conf @@ -12,7 +12,6 @@ ip prefix-list PL_LoopbackV4 permit 55.55.55.55/32 router bgp 55555 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/defaults.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/defaults.conf index b85dd67a5ca0..00b09bd40d9a 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/defaults.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/defaults.conf @@ -34,7 +34,6 @@ route-map HIDE_INTERNAL permit 10 router bgp 55555 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/ipv6_lo.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/ipv6_lo.conf index 5ee5ce5443aa..50414a89a389 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/ipv6_lo.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/ipv6_lo.conf @@ -14,7 +14,6 @@ ipv6 prefix-list PL_LoopbackV6 permit fc00::1/128 router bgp 55555 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis.conf index 6b2e1f257948..a949ce6e4512 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis.conf @@ -34,7 +34,6 @@ route-map HIDE_INTERNAL permit 10 router bgp 55555 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/voq_chassis.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/voq_chassis.conf index efd45eda1ea9..0d9eeebe9e8e 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/voq_chassis.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/voq_chassis.conf @@ -34,7 +34,6 @@ route-map HIDE_INTERNAL permit 10 router bgp 55555 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/frr.conf.j2/all.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/frr.conf.j2/all.conf index 8856e58db686..af2e974ee9b7 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/frr.conf.j2/all.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/frr.conf.j2/all.conf @@ -71,7 +71,6 @@ route-map HIDE_INTERNAL permit 10 router bgp 55555 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index 1cadd297e527..dfdb9406dd49 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -608,7 +608,7 @@ def parse_dpg(dpg, hname): else: prefix = prefix + "/32" static_routes[prefix] = {'nexthop': ",".join(nexthop), 'ifname': ",".join(ifname), 'advertise': advertise} - + if port_nhipv4_map and port_nhipv6_map: subnet_check_ip = list(port_nhipv4_map.values())[0] for subnet_range in ip_intfs_map: @@ -2131,10 +2131,6 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw if current_device and current_device['type'] in mgmt_device_types: results["FLEX_COUNTER_TABLE"] = {counter: {"FLEX_COUNTER_STATUS": "disable"} for counter in mgmt_disabled_counters} - # Enable bgp-suppress-fib by default for leafrouter - if current_device and current_device['type'] in leafrouter_device_types: - results['DEVICE_METADATA']['localhost']['suppress-fib-pending'] = 'enabled' - return results def get_tunnel_entries(tunnel_intfs, tunnel_intfs_qos_remap_config, lo_intfs, tunnel_qos_remap, mux_tunnel_name, peer_switch_ip): diff --git a/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr.conf b/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr.conf index 3828af13fd71..2c146698a960 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr.conf @@ -42,7 +42,6 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.0.0/27 router bgp 65100 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_backend_asic.conf b/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_backend_asic.conf index 45cd03a540a8..d793dfa39a98 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_backend_asic.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_backend_asic.conf @@ -53,7 +53,6 @@ route-map HIDE_INTERNAL permit 10 router bgp 65100 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_dualtor.conf b/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_dualtor.conf index eda11ab9f285..364a2c34bcaa 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_dualtor.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_dualtor.conf @@ -42,7 +42,6 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.0.0/27 router bgp 65100 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy coalesce-time 10000 diff --git a/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_frontend_asic.conf b/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_frontend_asic.conf index 8daeff2a61e9..94bd37e3b90f 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_frontend_asic.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_frontend_asic.conf @@ -53,7 +53,6 @@ route-map HIDE_INTERNAL permit 10 router bgp 65100 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-config-engine/tests/sample_output/py2/frr.conf b/src/sonic-config-engine/tests/sample_output/py2/frr.conf index 032adb8c5106..2653f8fc0893 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/frr.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/frr.conf @@ -62,7 +62,6 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.0.0/27 router bgp 65100 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-bgpd.conf b/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-bgpd.conf index 32a9abf88bac..20744efaa40f 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-bgpd.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-bgpd.conf @@ -58,7 +58,6 @@ ip prefix-list PL_LoopbackV4 permit 4.0.0.0/32 router bgp 4000 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr.conf b/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr.conf index e5ad8964454a..e7534d4b9781 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr.conf @@ -42,7 +42,6 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.200.0/27 router bgp 65100 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_backend_asic.conf b/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_backend_asic.conf index 45cd03a540a8..d793dfa39a98 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_backend_asic.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_backend_asic.conf @@ -53,7 +53,6 @@ route-map HIDE_INTERNAL permit 10 router bgp 65100 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_dualtor.conf b/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_dualtor.conf index 0ada9a4f8d60..4f606b80838c 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_dualtor.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_dualtor.conf @@ -42,7 +42,6 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.200.0/27 router bgp 65100 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy coalesce-time 10000 diff --git a/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_frontend_asic.conf b/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_frontend_asic.conf index 8daeff2a61e9..94bd37e3b90f 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_frontend_asic.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_frontend_asic.conf @@ -53,7 +53,6 @@ route-map HIDE_INTERNAL permit 10 router bgp 65100 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/frr.conf b/src/sonic-config-engine/tests/sample_output/py3/frr.conf index d0821f1b11ca..5b7eacefe8ba 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/frr.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/frr.conf @@ -62,7 +62,6 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.200.0/27 router bgp 65100 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-bgpd.conf b/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-bgpd.conf index 32a9abf88bac..20744efaa40f 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-bgpd.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-bgpd.conf @@ -58,7 +58,6 @@ ip prefix-list PL_LoopbackV4 permit 4.0.0.0/32 router bgp 4000 ! bgp log-neighbor-changes - bgp suppress-fib-pending no bgp default ipv4-unicast no bgp ebgp-requires-policy ! diff --git a/src/sonic-frr/patch/0005-Add-support-of-bgp-l3vni-evpn.patch b/src/sonic-frr/patch/0005-Add-support-of-bgp-l3vni-evpn.patch deleted file mode 100644 index fe2636c2e289..000000000000 --- a/src/sonic-frr/patch/0005-Add-support-of-bgp-l3vni-evpn.patch +++ /dev/null @@ -1,121 +0,0 @@ -From f5f0018266c98ad96cdbe69ae60d501de21e5600 Mon Sep 17 00:00:00 2001 -From: Stepan Blyschak -Date: Thu, 20 Oct 2022 13:19:31 +0000 -Subject: [PATCH] From 369bbb4d62aa47d5a6d5157ca6ea819c4cb80f15 Mon Sep 17 - 00:00:00 2001 Subject: [PATCH 07/13] Added support of L3VNI EVPN - -This is temp patch till Prefix to ARP indirection is add in neighorch - -Signed-off-by: Kishore Kunal -Signed-off-by: Stepan Blyschak - -diff --git a/lib/nexthop.c b/lib/nexthop.c -index 7ebc4fefb..2f7bb0e7b 100644 ---- a/lib/nexthop.c -+++ b/lib/nexthop.c -@@ -813,6 +813,7 @@ void nexthop_copy_no_recurse(struct nexthop *copy, - memcpy(©->src, &nexthop->src, sizeof(nexthop->src)); - memcpy(©->rmap_src, &nexthop->rmap_src, sizeof(nexthop->rmap_src)); - copy->rparent = rparent; -+ memcpy(©->nh_encap.encap_data.rmac, &nexthop->nh_encap.encap_data.rmac, ETH_ALEN); - if (nexthop->nh_label) - nexthop_add_labels(copy, nexthop->nh_label_type, - nexthop->nh_label->num_labels, -diff --git a/lib/nexthop.h b/lib/nexthop.h -index f1309aa52..7b4bbbafd 100644 ---- a/lib/nexthop.h -+++ b/lib/nexthop.h -@@ -66,6 +66,11 @@ enum nh_encap_type { - /* Backup index value is limited */ - #define NEXTHOP_BACKUP_IDX_MAX 255 - -+struct vxlan_nh_encap { -+ vni_t vni; -+ struct ethaddr rmac; -+}; -+ - /* Nexthop structure. */ - struct nexthop { - struct nexthop *next; -@@ -137,7 +142,7 @@ struct nexthop { - /* Encapsulation information. */ - enum nh_encap_type nh_encap_type; - union { -- vni_t vni; -+ struct vxlan_nh_encap encap_data; - } nh_encap; - - /* SR-TE color used for matching SR-TE policies */ -diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c -index 79d79d74b..325199eff 100644 ---- a/zebra/rt_netlink.c -+++ b/zebra/rt_netlink.c -@@ -1969,6 +1969,7 @@ static int netlink_route_nexthop_encap(struct nlmsghdr *n, size_t nlen, - struct nexthop *nh) - { - struct rtattr *nest; -+ struct vxlan_nh_encap* encap_data; - - switch (nh->nh_encap_type) { - case NET_VXLAN: -@@ -1979,9 +1980,21 @@ static int netlink_route_nexthop_encap(struct nlmsghdr *n, size_t nlen, - if (!nest) - return false; - -+ encap_data = &nh->nh_encap.encap_data; -+ - if (!nl_attr_put32(n, nlen, 0 /* VXLAN_VNI */, -- nh->nh_encap.vni)) -+ encap_data->vni)) -+ return false; -+ -+ if (ZEBRA_DEBUG_KERNEL) -+ zlog_debug( -+ "%s: VNI:%d RMAC:%pEA", __func__, encap_data->vni, -+ &encap_data->rmac); -+ -+ if (!nl_attr_put(n, nlen, 1 /* VXLAN_RMAC */, -+ &encap_data->rmac, sizeof(encap_data->rmac))) - return false; -+ - nl_attr_nest_end(n, nest); - break; - } -diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c -index c0945eae2..157c33ced 100644 ---- a/zebra/zapi_msg.c -+++ b/zebra/zapi_msg.c -@@ -1605,6 +1605,8 @@ static struct nexthop *nexthop_from_zapi(const struct zapi_nexthop *api_nh, - vtep_ip.ipa_type = IPADDR_V4; - memcpy(&(vtep_ip.ipaddr_v4), &(api_nh->gate.ipv4), - sizeof(struct in_addr)); -+ memcpy(&(nexthop->nh_encap.encap_data.rmac), -+ &api_nh->rmac, ETH_ALEN); - zebra_rib_queue_evpn_route_add( - api_nh->vrf_id, &api_nh->rmac, &vtep_ip, p); - SET_FLAG(nexthop->flags, NEXTHOP_FLAG_EVPN); -@@ -1639,6 +1641,8 @@ static struct nexthop *nexthop_from_zapi(const struct zapi_nexthop *api_nh, - vtep_ip.ipa_type = IPADDR_V6; - memcpy(&vtep_ip.ipaddr_v6, &(api_nh->gate.ipv6), - sizeof(struct in6_addr)); -+ memcpy(&(nexthop->nh_encap.encap_data.rmac), -+ &api_nh->rmac, ETH_ALEN); - zebra_rib_queue_evpn_route_add( - api_nh->vrf_id, &api_nh->rmac, &vtep_ip, p); - SET_FLAG(nexthop->flags, NEXTHOP_FLAG_EVPN); -diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c -index f6f436f39..c8511bd28 100644 ---- a/zebra/zebra_dplane.c -+++ b/zebra/zebra_dplane.c -@@ -2917,7 +2917,7 @@ int dplane_ctx_route_init(struct zebra_dplane_ctx *ctx, enum dplane_op_e op, - zl3vni = zl3vni_from_vrf(nexthop->vrf_id); - if (zl3vni && is_l3vni_oper_up(zl3vni)) { - nexthop->nh_encap_type = NET_VXLAN; -- nexthop->nh_encap.vni = zl3vni->vni; -+ nexthop->nh_encap.encap_data.vni = zl3vni->vni; - } - } - --- -2.17.1 - diff --git a/src/sonic-frr/patch/0007-ignore-route-from-default-table.patch b/src/sonic-frr/patch/0007-ignore-route-from-default-table.patch deleted file mode 100644 index 52167d765287..000000000000 --- a/src/sonic-frr/patch/0007-ignore-route-from-default-table.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 1a639f2dcd400997345dab424a2adbc091752661 Mon Sep 17 00:00:00 2001 -From: Stepan Blyschak -Date: Thu, 20 Oct 2022 13:07:18 +0000 -Subject: [PATCH] From ca66350aecf7db3354019480d11754fabae3a97c Mon Sep 17 - 00:00:00 2001 Subject: [PATCH 09/13] ignore route from default table - -Signed-off-by: Stepan Blyschak - -diff --git a/zebra/dplane_fpm_nl.c b/zebra/dplane_fpm_nl.c -index 0a9fecc9d..b18a96353 100644 ---- a/zebra/dplane_fpm_nl.c -+++ b/zebra/dplane_fpm_nl.c -@@ -814,6 +814,15 @@ static int fpm_nl_enqueue(struct fpm_nl_ctx *fnc, struct zebra_dplane_ctx *ctx) - || op == DPLANE_OP_NH_UPDATE)) - return 0; - -+ /* -+ * Ignore route from default table, because when mgmt port goes down, -+ * zebra will remove the default route and causing ASIC to blackhole IO. -+ */ -+ if (dplane_ctx_get_table(ctx) == RT_TABLE_DEFAULT) { -+ zlog_debug("%s: discard default table route", __func__); -+ return 0; -+ } -+ - nl_buf_len = 0; - - frr_mutex_lock_autounlock(&fnc->obuf_mutex); --- -2.17.1 - diff --git a/src/sonic-frr/patch/0008-Use-vrf_id-for-vrf-not-tabled_id.patch b/src/sonic-frr/patch/0008-Use-vrf_id-for-vrf-not-tabled_id.patch deleted file mode 100644 index ae8b05f06bd0..000000000000 --- a/src/sonic-frr/patch/0008-Use-vrf_id-for-vrf-not-tabled_id.patch +++ /dev/null @@ -1,111 +0,0 @@ -From 44f3736ee601e06e43e978fa075402c3da4823bd Mon Sep 17 00:00:00 2001 -From: Stepan Blyschak -Date: Mon, 16 Jan 2023 11:45:19 +0000 -Subject: [PATCH] From 349e3f758860be0077b69919c39764d3486ec44a Mon Sep 17 - 00:00:00 2001 Subject: [PATCH] use vrf id instead of table id - -Signed-off-by: Stepan Blyschak - -diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c -index 325199eff..587045eac 100644 ---- a/zebra/rt_netlink.c -+++ b/zebra/rt_netlink.c -@@ -406,6 +406,30 @@ vrf_id_t vrf_lookup_by_table(uint32_t table_id, ns_id_t ns_id) - return VRF_DEFAULT; - } - -+static uint32_t table_lookup_by_vrf(vrf_id_t vrf_id, ns_id_t ns_id) -+{ -+ struct vrf *vrf; -+ struct zebra_vrf *zvrf; -+ -+ RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id) { -+ zvrf = vrf->info; -+ if (zvrf == NULL) -+ continue; -+ /* case vrf with netns : match the netnsid */ -+ if (vrf_is_backend_netns()) { -+ if (ns_id == zvrf_id(zvrf)) -+ return zvrf->table_id; -+ } else { -+ /* VRF is VRF_BACKEND_VRF_LITE */ -+ if (zvrf_id(zvrf) != vrf_id) -+ continue; -+ return zvrf->table_id; -+ } -+ } -+ -+ return RT_TABLE_UNSPEC; -+} -+ - /** - * @parse_encap_mpls() - Parses encapsulated mpls attributes - * @tb: Pointer to rtattr to look for nested items in. -@@ -782,14 +806,26 @@ int netlink_route_change_read_unicast_internal(struct nlmsghdr *h, - if (rtm->rtm_family == AF_MPLS) - return 0; - -- /* Table corresponding to route. */ -- if (tb[RTA_TABLE]) -- table = *(int *)RTA_DATA(tb[RTA_TABLE]); -- else -- table = rtm->rtm_table; -+ if (!ctx) { -+ /* Table corresponding to route. */ -+ if (tb[RTA_TABLE]) -+ table = *(int *)RTA_DATA(tb[RTA_TABLE]); -+ else -+ table = rtm->rtm_table; -+ -+ /* Map to VRF */ -+ vrf_id = vrf_lookup_by_table(table, ns_id); -+ } else { -+ /* With FPM, rtm_table contains vrf id, see netlink_route_multipath_msg_encode */ -+ if (tb[RTA_TABLE]) -+ vrf_id = *(int *)RTA_DATA(tb[RTA_TABLE]); -+ else -+ vrf_id = rtm->rtm_table; -+ -+ /* Map to table */ -+ table = table_lookup_by_vrf(vrf_id, ns_id); -+ } - -- /* Map to VRF */ -- vrf_id = vrf_lookup_by_table(table, ns_id); - if (vrf_id == VRF_DEFAULT) { - if (!is_zebra_valid_kernel_table(table) - && !is_zebra_main_routing_table(table)) -@@ -2102,12 +2138,24 @@ ssize_t netlink_route_multipath_msg_encode(int cmd, - - /* Table corresponding to this route. */ - table_id = dplane_ctx_get_table(ctx); -- if (table_id < 256) -- req->r.rtm_table = table_id; -- else { -- req->r.rtm_table = RT_TABLE_UNSPEC; -- if (!nl_attr_put32(&req->n, datalen, RTA_TABLE, table_id)) -- return 0; -+ if (!fpm) { -+ if (table_id < 256) -+ req->r.rtm_table = table_id; -+ else { -+ req->r.rtm_table = RT_TABLE_UNSPEC; -+ if (!nl_attr_put32(&req->n, datalen, RTA_TABLE, table_id)) -+ return 0; -+ } -+ } else { -+ /* Put vrf if_index instead of table id */ -+ vrf_id_t vrf = dplane_ctx_get_vrf(ctx); -+ if (vrf < 256) -+ req->r.rtm_table = vrf; -+ else { -+ req->r.rtm_table = RT_TABLE_UNSPEC; -+ if (!nl_attr_put32(&req->n, datalen, RTA_TABLE, vrf)) -+ return 0; -+ } - } - - if (IS_ZEBRA_DEBUG_KERNEL) --- -2.17.1 - diff --git a/src/sonic-frr/patch/0012-zebra-Rename-vrf_lookup_by_tableid-to-zebra_vrf_look.patch b/src/sonic-frr/patch/0012-zebra-Rename-vrf_lookup_by_tableid-to-zebra_vrf_look.patch index ca6517fbf655..01f8d04c2b78 100644 --- a/src/sonic-frr/patch/0012-zebra-Rename-vrf_lookup_by_tableid-to-zebra_vrf_look.patch +++ b/src/sonic-frr/patch/0012-zebra-Rename-vrf_lookup_by_tableid-to-zebra_vrf_look.patch @@ -1,4 +1,4 @@ -From 2b9c7592a9857ddccc77b9d3f178e0c5bd5f19ed Mon Sep 17 00:00:00 2001 +From 6a3ae11c9b1480966b22d4f9b67a40b76d96aa15 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 26 Apr 2023 23:25:27 -0400 Subject: [PATCH] zebra: Rename vrf_lookup_by_tableid to zebra_vrf_lookup.. @@ -9,12 +9,19 @@ we need zebra specific data to find this vrf_id and as such it does not belong in vrf.c Signed-off-by: Donald Sharp +--- + zebra/if_netlink.c | 3 ++- + zebra/rt_netlink.c | 31 ++----------------------------- + zebra/rt_netlink.h | 1 - + zebra/zebra_vrf.c | 27 +++++++++++++++++++++++++++ + zebra/zebra_vrf.h | 1 + + 5 files changed, 32 insertions(+), 31 deletions(-) diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c -index 81347b550a..4599121261 100644 +index cd200d821d7a..cea47b4c30af 100644 --- a/zebra/if_netlink.c +++ b/zebra/if_netlink.c -@@ -342,7 +342,8 @@ static void netlink_vrf_change(struct nlmsghdr *h, struct rtattr *tb, +@@ -325,7 +325,8 @@ static void netlink_vrf_change(struct nlmsghdr *h, struct rtattr *tb, if (!vrf_lookup_by_id((vrf_id_t)ifi->ifi_index)) { vrf_id_t exist_id; @@ -25,10 +32,10 @@ index 81347b550a..4599121261 100644 vrf = vrf_lookup_by_id(exist_id); diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c -index 587045eac2..6b9b047858 100644 +index de01ced411ef..0f542ab80756 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c -@@ -379,33 +379,6 @@ static inline int proto2zebra(int proto, int family, bool is_nexthop) +@@ -380,33 +380,6 @@ static inline int proto2zebra(int proto, int family, bool is_nexthop) return proto; } @@ -59,19 +66,19 @@ index 587045eac2..6b9b047858 100644 - return VRF_DEFAULT; -} - - static uint32_t table_lookup_by_vrf(vrf_id_t vrf_id, ns_id_t ns_id) - { - struct vrf *vrf; -@@ -814,7 +787,7 @@ int netlink_route_change_read_unicast_internal(struct nlmsghdr *h, - table = rtm->rtm_table; + /** + * @parse_encap_mpls() - Parses encapsulated mpls attributes + * @tb: Pointer to rtattr to look for nested items in. +@@ -790,7 +763,7 @@ int netlink_route_change_read_unicast_internal(struct nlmsghdr *h, + table = rtm->rtm_table; - /* Map to VRF */ -- vrf_id = vrf_lookup_by_table(table, ns_id); -+ vrf_id = zebra_vrf_lookup_by_table(table, ns_id); - } else { - /* With FPM, rtm_table contains vrf id, see netlink_route_multipath_msg_encode */ - if (tb[RTA_TABLE]) -@@ -1114,7 +1087,7 @@ static int netlink_route_change_read_multicast(struct nlmsghdr *h, + /* Map to VRF */ +- vrf_id = vrf_lookup_by_table(table, ns_id); ++ vrf_id = zebra_vrf_lookup_by_table(table, ns_id); + if (vrf_id == VRF_DEFAULT) { + if (!is_zebra_valid_kernel_table(table) + && !is_zebra_main_routing_table(table)) +@@ -1079,7 +1052,7 @@ static int netlink_route_change_read_multicast(struct nlmsghdr *h, else table = rtm->rtm_table; @@ -81,10 +88,10 @@ index 587045eac2..6b9b047858 100644 if (tb[RTA_IIF]) iif = *(int *)RTA_DATA(tb[RTA_IIF]); diff --git a/zebra/rt_netlink.h b/zebra/rt_netlink.h -index 8506367ae4..364aac0f6b 100644 +index 3ca59ce676f3..d9d0ee76249a 100644 --- a/zebra/rt_netlink.h +++ b/zebra/rt_netlink.h -@@ -102,7 +102,6 @@ extern int netlink_macfdb_read_specific_mac(struct zebra_ns *zns, +@@ -90,7 +90,6 @@ extern int netlink_macfdb_read_specific_mac(struct zebra_ns *zns, uint16_t vid); extern int netlink_neigh_read_specific_ip(const struct ipaddr *ip, struct interface *vlan_if); @@ -93,10 +100,10 @@ index 8506367ae4..364aac0f6b 100644 struct nl_batch; extern enum netlink_msg_status diff --git a/zebra/zebra_vrf.c b/zebra/zebra_vrf.c -index be5e91495f..c59cb7c0a7 100644 +index 3365cdcdbaa8..74b9d106cdc3 100644 --- a/zebra/zebra_vrf.c +++ b/zebra/zebra_vrf.c -@@ -389,6 +389,33 @@ struct zebra_vrf *zebra_vrf_alloc(struct vrf *vrf) +@@ -376,6 +376,33 @@ struct zebra_vrf *zebra_vrf_alloc(struct vrf *vrf) return zvrf; } @@ -131,10 +138,10 @@ index be5e91495f..c59cb7c0a7 100644 struct zebra_vrf *zebra_vrf_lookup_by_id(vrf_id_t vrf_id) { diff --git a/zebra/zebra_vrf.h b/zebra/zebra_vrf.h -index 02e3c197c9..937e7fb144 100644 +index b23b7282610b..aef83cd8f172 100644 --- a/zebra/zebra_vrf.h +++ b/zebra/zebra_vrf.h -@@ -252,6 +252,7 @@ extern struct route_table *zebra_vrf_get_table_with_table_id(afi_t afi, +@@ -237,6 +237,7 @@ extern struct route_table *zebra_vrf_get_table_with_table_id(afi_t afi, extern void zebra_vrf_update_all(struct zserv *client); extern struct zebra_vrf *zebra_vrf_lookup_by_id(vrf_id_t vrf_id); extern struct zebra_vrf *zebra_vrf_lookup_by_name(const char *); @@ -142,6 +149,3 @@ index 02e3c197c9..937e7fb144 100644 extern struct zebra_vrf *zebra_vrf_alloc(struct vrf *vrf); extern struct route_table *zebra_vrf_table(afi_t, safi_t, vrf_id_t); --- -2.17.1 - diff --git a/src/sonic-frr/patch/0034-fpm-Use-vrf_id-for-vrf-not-tabled_id.patch b/src/sonic-frr/patch/0034-fpm-Use-vrf_id-for-vrf-not-tabled_id.patch new file mode 100644 index 000000000000..f815cf38455e --- /dev/null +++ b/src/sonic-frr/patch/0034-fpm-Use-vrf_id-for-vrf-not-tabled_id.patch @@ -0,0 +1,25 @@ +From 39bb40dc4bad4462e4ae9c98580d75fa2c92e032 Mon Sep 17 00:00:00 2001 +From: Pavel Shirshov +Date: Mon, 16 Nov 2020 18:29:46 -0800 +Subject: [PATCH 3/8] Use vrf_id for vrf, not tabled_id + +--- + zebra/zebra_fpm_netlink.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/zebra/zebra_fpm_netlink.c b/zebra/zebra_fpm_netlink.c +index ec22c5dd4..aad0156b3 100644 +--- a/zebra/zebra_fpm_netlink.c ++++ b/zebra/zebra_fpm_netlink.c +@@ -287,7 +287,7 @@ static int netlink_route_info_fill(struct netlink_route_info *ri, int cmd, + ri->nlmsg_pid = zvrf->zns->netlink_dplane_out.snl.nl_pid; + + ri->nlmsg_type = cmd; +- ri->rtm_table = table_info->table_id; ++ ri->rtm_table = zvrf_id(rib_dest_vrf(dest)); + ri->rtm_protocol = RTPROT_UNSPEC; + + /* +-- +2.12.2 + diff --git a/src/sonic-frr/patch/0035-fpm-ignore-route-from-default-table.patch b/src/sonic-frr/patch/0035-fpm-ignore-route-from-default-table.patch new file mode 100644 index 000000000000..e925b9908fb6 --- /dev/null +++ b/src/sonic-frr/patch/0035-fpm-ignore-route-from-default-table.patch @@ -0,0 +1,29 @@ +From bb3b003840959adf5b5be52e91bc798007c9857a Mon Sep 17 00:00:00 2001 +From: Ying Xie +Date: Thu, 8 Sep 2022 04:20:36 +0000 +Subject: [PATCH] From 776a29e8ab32c1364ee601a8730aabb773b0c86b Mon Sep 17 + 00:00:00 2001 Subject: [PATCH] ignore route from default table + +Signed-off-by: Ying Xie +--- + zebra/zebra_fpm_netlink.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/zebra/zebra_fpm_netlink.c b/zebra/zebra_fpm_netlink.c +index 34be9fb39..d6c875a7e 100644 +--- a/zebra/zebra_fpm_netlink.c ++++ b/zebra/zebra_fpm_netlink.c +@@ -283,6 +283,11 @@ static int netlink_route_info_fill(struct netlink_route_info *ri, int cmd, + rib_table_info(rib_dest_table(dest)); + struct zebra_vrf *zvrf = table_info->zvrf; + ++ if (table_info->table_id == RT_TABLE_DEFAULT) { ++ zfpm_debug("%s: Discard default table route", __func__); ++ return 0; ++ } ++ + memset(ri, 0, sizeof(*ri)); + + ri->prefix = rib_dest_prefix(dest); +-- +2.17.1 diff --git a/src/sonic-frr/patch/0036-Add-support-of-bgp-l3vni-evpn.patch b/src/sonic-frr/patch/0036-Add-support-of-bgp-l3vni-evpn.patch new file mode 100644 index 000000000000..01d4df820739 --- /dev/null +++ b/src/sonic-frr/patch/0036-Add-support-of-bgp-l3vni-evpn.patch @@ -0,0 +1,164 @@ +From b1b2e40cf43a9d206e2d867bdec4f0f7b740c8b9 Mon Sep 17 00:00:00 2001 +From: stepanb +Date: Tue, 19 Dec 2023 11:27:37 +0000 +Subject: [PATCH] Add support of bgp l3vni evpn + +--- + lib/nexthop.c | 2 ++ + lib/nexthop.h | 6 ++++++ + zebra/rt_netlink.c | 2 +- + zebra/zapi_msg.c | 4 ++++ + zebra/zebra_dplane.c | 1 + + zebra/zebra_fpm_netlink.c | 20 ++++++++++++++++++++ + 6 files changed, 34 insertions(+), 1 deletion(-) + +diff --git a/lib/nexthop.c b/lib/nexthop.c +index 7ebc4fefb..fe42b9f86 100644 +--- a/lib/nexthop.c ++++ b/lib/nexthop.c +@@ -813,6 +813,8 @@ void nexthop_copy_no_recurse(struct nexthop *copy, + memcpy(©->src, &nexthop->src, sizeof(nexthop->src)); + memcpy(©->rmap_src, &nexthop->rmap_src, sizeof(nexthop->rmap_src)); + copy->rparent = rparent; ++ memcpy(©->nh_encap.encap_data.rmac, &nexthop->nh_encap.encap_data.rmac, ETH_ALEN); ++ + if (nexthop->nh_label) + nexthop_add_labels(copy, nexthop->nh_label_type, + nexthop->nh_label->num_labels, +diff --git a/lib/nexthop.h b/lib/nexthop.h +index f1309aa52..7026ce1c2 100644 +--- a/lib/nexthop.h ++++ b/lib/nexthop.h +@@ -66,6 +66,11 @@ enum nh_encap_type { + /* Backup index value is limited */ + #define NEXTHOP_BACKUP_IDX_MAX 255 + ++struct vxlan_nh_encap { ++ vni_t vni; ++ struct ethaddr rmac; ++}; ++ + /* Nexthop structure. */ + struct nexthop { + struct nexthop *next; +@@ -138,6 +143,7 @@ struct nexthop { + enum nh_encap_type nh_encap_type; + union { + vni_t vni; ++ struct vxlan_nh_encap encap_data; + } nh_encap; + + /* SR-TE color used for matching SR-TE policies */ +diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c +index d31732a55..581255158 100644 +--- a/zebra/rt_netlink.c ++++ b/zebra/rt_netlink.c +@@ -1991,7 +1991,7 @@ static int netlink_route_nexthop_encap(struct nlmsghdr *n, size_t nlen, + return false; + + if (!nl_attr_put32(n, nlen, 0 /* VXLAN_VNI */, +- nh->nh_encap.vni)) ++ nh->nh_encap.encap_data.vni)) + return false; + nl_attr_nest_end(n, nest); + break; +diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c +index c0945eae2..157c33ced 100644 +--- a/zebra/zapi_msg.c ++++ b/zebra/zapi_msg.c +@@ -1605,6 +1605,8 @@ static struct nexthop *nexthop_from_zapi(const struct zapi_nexthop *api_nh, + vtep_ip.ipa_type = IPADDR_V4; + memcpy(&(vtep_ip.ipaddr_v4), &(api_nh->gate.ipv4), + sizeof(struct in_addr)); ++ memcpy(&(nexthop->nh_encap.encap_data.rmac), ++ &api_nh->rmac, ETH_ALEN); + zebra_rib_queue_evpn_route_add( + api_nh->vrf_id, &api_nh->rmac, &vtep_ip, p); + SET_FLAG(nexthop->flags, NEXTHOP_FLAG_EVPN); +@@ -1639,6 +1641,8 @@ static struct nexthop *nexthop_from_zapi(const struct zapi_nexthop *api_nh, + vtep_ip.ipa_type = IPADDR_V6; + memcpy(&vtep_ip.ipaddr_v6, &(api_nh->gate.ipv6), + sizeof(struct in6_addr)); ++ memcpy(&(nexthop->nh_encap.encap_data.rmac), ++ &api_nh->rmac, ETH_ALEN); + zebra_rib_queue_evpn_route_add( + api_nh->vrf_id, &api_nh->rmac, &vtep_ip, p); + SET_FLAG(nexthop->flags, NEXTHOP_FLAG_EVPN); +diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c +index 34d30484a..260a7b497 100644 +--- a/zebra/zebra_dplane.c ++++ b/zebra/zebra_dplane.c +@@ -3394,6 +3394,7 @@ int dplane_ctx_route_init(struct zebra_dplane_ctx *ctx, enum dplane_op_e op, + if (zl3vni && is_l3vni_oper_up(zl3vni)) { + nexthop->nh_encap_type = NET_VXLAN; + nexthop->nh_encap.vni = zl3vni->vni; ++ nexthop->nh_encap.encap_data.vni = zl3vni->vni; + } + } + +diff --git a/zebra/zebra_fpm_netlink.c b/zebra/zebra_fpm_netlink.c +index ec6090da9..22650eedc 100644 +--- a/zebra/zebra_fpm_netlink.c ++++ b/zebra/zebra_fpm_netlink.c +@@ -95,10 +95,12 @@ static const char *fpm_nh_encap_type_to_str(enum fpm_nh_encap_type_t encap_type) + + struct vxlan_encap_info_t { + vni_t vni; ++ struct ethaddr rmac; + }; + + enum vxlan_encap_info_type_t { + VXLAN_VNI = 0, ++ VXLAN_RMAC = 1, + }; + + struct fpm_nh_encap_info_t { +@@ -234,6 +236,9 @@ static int netlink_route_info_add_nh(struct netlink_route_info *ri, + } + + nhi.encap_info.vxlan_encap.vni = vni; ++ memcpy(&nhi.encap_info.vxlan_encap.rmac, ++ &(nexthop->nh_encap.encap_data.rmac), ++ ETH_ALEN); + } + + /* +@@ -456,9 +461,16 @@ static int netlink_route_info_encode(struct netlink_route_info *ri, + nl_attr_put16(&req->n, in_buf_len, RTA_ENCAP_TYPE, + encap); + vxlan = &nhi->encap_info.vxlan_encap; ++ char buf[ETHER_ADDR_STRLEN]; ++ ++ zfpm_debug( ++ "%s: VNI:%d RMAC:%s", __func__, vxlan->vni, ++ prefix_mac2str(&vxlan->rmac, buf, sizeof(buf))); + nest = nl_attr_nest(&req->n, in_buf_len, RTA_ENCAP); + nl_attr_put32(&req->n, in_buf_len, VXLAN_VNI, + vxlan->vni); ++ nl_attr_put(&req->n, in_buf_len, VXLAN_RMAC, ++ &vxlan->rmac, sizeof(vxlan->rmac)); + nl_attr_nest_end(&req->n, nest); + break; + } +@@ -494,10 +506,18 @@ static int netlink_route_info_encode(struct netlink_route_info *ri, + nl_attr_put16(&req->n, in_buf_len, RTA_ENCAP_TYPE, + encap); + vxlan = &nhi->encap_info.vxlan_encap; ++ char rmac_buf[ETHER_ADDR_STRLEN]; ++ ++ zfpm_debug("%s: Multi VNI:%d RMAC:%s", __func__, ++ vxlan->vni, ++ prefix_mac2str(&vxlan->rmac, rmac_buf, ++ sizeof(rmac_buf))); + inner_nest = + nl_attr_nest(&req->n, in_buf_len, RTA_ENCAP); + nl_attr_put32(&req->n, in_buf_len, VXLAN_VNI, + vxlan->vni); ++ nl_attr_put(&req->n, in_buf_len, VXLAN_RMAC, ++ &vxlan->rmac, sizeof(vxlan->rmac)); + nl_attr_nest_end(&req->n, inner_nest); + break; + } +-- +2.30.2 + diff --git a/src/sonic-frr/patch/series b/src/sonic-frr/patch/series index c87c5e61f986..e2f5bc28a91f 100644 --- a/src/sonic-frr/patch/series +++ b/src/sonic-frr/patch/series @@ -2,12 +2,9 @@ 0002-Allow-BGP-attr-NEXT_HOP-to-be-0.0.0.0-due-to-allevia.patch 0003-nexthops-compare-vrf-only-if-ip-type.patch 0004-frr-remove-frr-log-outchannel-to-var-log-frr.log.patch -0005-Add-support-of-bgp-l3vni-evpn.patch 0006-Link-local-scope-was-not-set-while-binding-socket-for-bgp-ipv6-link-local-neighbors.patch Disable-ipv6-src-address-test-in-pceplib.patch cross-compile-changes.patch -0007-ignore-route-from-default-table.patch -0008-Use-vrf_id-for-vrf-not-tabled_id.patch 0009-bgpd-Ensure-suppress-fib-pending-works-with-network-.patch 0010-bgpd-Change-log-level-for-graceful-restart-events.patch 0011-zebra-Static-routes-async-notification-do-not-need-t.patch @@ -32,3 +29,6 @@ cross-compile-changes.patch 0030-bgpd-Treat-EOR-as-withdrawn-to-avoid-unwanted-handli.patch 0031-bgpd-Ignore-handling-NLRIs-if-we-received-MP_UNREACH.patch 0032-zebra-Fix-fpm-multipath-encap-addition.patch +0034-fpm-Use-vrf_id-for-vrf-not-tabled_id.patch +0035-fpm-ignore-route-from-default-table.patch +0036-Add-support-of-bgp-l3vni-evpn.patch diff --git a/src/sonic-swss b/src/sonic-swss index b78a4181627d..be294f390c97 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit b78a4181627d9db3d55c244446697dd2f741f4b2 +Subproject commit be294f390c976dfb18f59bb93eedcf8bdbefe33b diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json b/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json index 141d8b5c8230..65288b8b2db8 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json @@ -126,16 +126,6 @@ "DEVICE_METADATA_ADVERTISE_LO_PREFIX_AS_128": { "desc": "Verifying advertising lo prefix as /128." }, - "DEVICE_METADATA_SUPPRESS_PENDING_FIB_ENABLED": { - "desc": "Enable bgp-suppress-fib-pending" - }, - "DEVICE_METADATA_SUPPRESS_PENDING_FIB_DISABLED": { - "desc": "Disable bgp-suppress-fib-pending" - }, - "DEVICE_METADATA_SUPPRESS_PENDING_FIB_ENABLED_SYNCHRONOUS_MODE_DISABLED": { - "desc": "Enable bgp-suppress-fib-pending when synchronous mode is disabled", - "eStr": ["ASIC synchronous mode must be enabled in order to enable suppress FIB pending feature"] - }, "DEVICE_METADATA_VALID_RACK_MGMT_MAP": { "desc": "Verifying rack_mgmt_map configuration." }, diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json index 941077205df6..b8053aa6ac66 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json @@ -333,36 +333,6 @@ } } }, - "DEVICE_METADATA_SUPPRESS_PENDING_FIB_ENABLED": { - "sonic-device_metadata:sonic-device_metadata": { - "sonic-device_metadata:DEVICE_METADATA": { - "sonic-device_metadata:localhost": { - "synchronous_mode": "enable", - "suppress-fib-pending": "enabled" - } - } - } - }, - "DEVICE_METADATA_SUPPRESS_PENDING_FIB_DISABLED": { - "sonic-device_metadata:sonic-device_metadata": { - "sonic-device_metadata:DEVICE_METADATA": { - "sonic-device_metadata:localhost": { - "synchronous_mode": "disable", - "suppress-fib-pending": "disabled" - } - } - } - }, - "DEVICE_METADATA_SUPPRESS_PENDING_FIB_ENABLED_SYNCHRONOUS_MODE_DISABLED": { - "sonic-device_metadata:sonic-device_metadata": { - "sonic-device_metadata:DEVICE_METADATA": { - "sonic-device_metadata:localhost": { - "synchronous_mode": "disable", - "suppress-fib-pending": "enabled" - } - } - } - }, "DEVICE_METADATA_VALID_RACK_MGMT_MAP": { "sonic-device_metadata:sonic-device_metadata": { "sonic-device_metadata:DEVICE_METADATA": { diff --git a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang index 26e20d196a88..392bbf941f6f 100644 --- a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang +++ b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang @@ -205,18 +205,6 @@ module sonic-device_metadata { By default SONiC advertises /128 subnet prefix in Loopback0 as /64 subnet route"; } - leaf suppress-fib-pending { - description "Enable BGP suppress FIB pending feature. BGP will wait for route FIB installation before announcing routes"; - type enumeration { - enum enabled; - enum disabled; - } - default disabled; - - must "((current() = 'disabled') or (current() = 'enabled' and ../synchronous_mode = 'enable'))" { - error-message "ASIC synchronous mode must be enabled in order to enable suppress FIB pending feature"; - } - } leaf rack_mgmt_map { type string { length 0..128 { From 9f7166b5d2fa397f14682954337791c2e20f1a7a Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 27 Jan 2024 05:27:30 +0800 Subject: [PATCH 086/419] Change tcp port range to support telemetry and gnmi (#17907) (#17916) * Reserve tcp port for telemetry and gnmi * Use ip_local_port_range instead * Fix sysctl config Co-authored-by: ganglv <88995770+ganglyu@users.noreply.github.com> --- files/image_config/sysctl/sysctl-net.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/files/image_config/sysctl/sysctl-net.conf b/files/image_config/sysctl/sysctl-net.conf index 3e7c0811200a..7946d2c8685f 100644 --- a/files/image_config/sysctl/sysctl-net.conf +++ b/files/image_config/sysctl/sysctl-net.conf @@ -15,6 +15,7 @@ net.ipv4.conf.all.arp_announce=1 net.ipv4.conf.all.arp_filter=0 net.ipv4.conf.all.arp_notify=1 net.ipv4.conf.all.arp_ignore=2 +net.ipv4.ip_local_port_range="32768 50001" net.ipv4.neigh.default.base_reachable_time_ms=1800000 net.ipv6.neigh.default.base_reachable_time_ms=1800000 net.ipv4.neigh.default.gc_thresh1=1024 From 4166d83f047cbec9ced21cef6ad3e911399b3840 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sun, 28 Jan 2024 10:39:42 +0800 Subject: [PATCH 087/419] [ci/build]: Upgrade SONiC package versions (#17917) --- .../versions-deb-bullseye | 20 +- .../build-sonic-slave-bullseye/versions-py3 | 1 - .../versions-deb-buster | 2 - files/build/versions/default/versions-docker | 24 +-- files/build/versions/default/versions-git | 24 +-- files/build/versions/default/versions-mirror | 24 +-- files/build/versions/default/versions-web | 96 ++++----- .../versions-deb-bullseye | 20 +- .../versions-deb-bullseye-armhf | 2 +- .../dockers/docker-base-bullseye/versions-py3 | 4 + .../docker-base-buster/versions-deb-buster | 32 +-- .../versions-deb-bullseye | 2 +- .../versions-deb-bullseye-arm64 | 6 +- .../versions-deb-bullseye-armhf | 6 +- .../versions-py3 | 1 - .../versions-deb-buster | 2 +- .../versions-deb-buster-arm64 | 4 +- .../versions-deb-buster-armhf | 4 +- .../docker-database/versions-deb-bullseye | 4 +- .../docker-dhcp-relay/versions-deb-bullseye | 4 +- .../dockers/docker-dhcp-relay/versions-py3 | 1 + .../docker-eventd/versions-deb-bullseye | 4 +- .../docker-fpm-frr/versions-deb-bullseye | 6 +- .../versions-deb-bullseye | 18 +- .../versions-deb-bullseye | 8 +- .../docker-gbsyncd-vs/versions-deb-bullseye | 4 +- .../dockers/docker-lldp/versions-deb-bullseye | 4 +- .../docker-macsec/versions-deb-bullseye | 4 +- .../dockers/docker-mux/versions-deb-bullseye | 4 +- .../dockers/docker-nat/versions-deb-bullseye | 4 +- .../docker-orchagent/versions-deb-bullseye | 4 +- .../versions-deb-bullseye | 8 +- .../dockers/docker-ptf/versions-deb-buster | 90 ++++---- .../versions-deb-bullseye | 4 +- .../docker-sflow/versions-deb-bullseye | 4 +- .../dockers/docker-snmp/versions-deb-bullseye | 8 +- .../docker-sonic-gnmi/versions-deb-bullseye | 26 +++ .../versions-deb-buster | 15 +- .../docker-sonic-vs/versions-deb-bullseye | 48 ++--- .../versions-deb-bullseye | 26 +-- .../versions-deb-bullseye | 4 +- .../versions-deb-bullseye | 26 +-- .../docker-syncd-brcm/versions-deb-bullseye | 5 +- .../versions-deb-bullseye | 26 +-- .../docker-syncd-centec/versions-deb-bullseye | 6 +- .../versions-deb-bullseye-arm64 | 18 +- .../versions-deb-bullseye | 20 +- .../docker-syncd-mlnx/versions-deb-bullseye | 10 +- .../versions-deb-bullseye-armhf | 18 +- .../docker-syncd-vs/versions-deb-bullseye | 4 +- .../docker-teamd/versions-deb-bullseye | 4 +- .../versions-deb-bullseye | 204 +++++++++--------- .../versions-deb-bullseye-arm64 | 4 +- .../versions-deb-bullseye-armhf | 6 +- .../dockers/sonic-slave-bullseye/versions-py3 | 3 + .../sonic-slave-buster/versions-deb-buster | 199 +++++++++-------- .../versions-deb-buster-armhf | 2 +- .../dockers/sonic-slave-buster/versions-py3 | 2 +- .../host-base-image/versions-deb-bullseye | 26 +-- .../versions/host-image/versions-deb-bullseye | 59 ++--- .../host-image/versions-deb-bullseye-arm64 | 6 +- .../host-image/versions-deb-bullseye-armhf | 15 +- files/build/versions/host-image/versions-py3 | 1 - .../host-image/versions-py3-all-armhf | 9 + 64 files changed, 634 insertions(+), 615 deletions(-) create mode 100644 files/build/versions/dockers/docker-dhcp-relay/versions-py3 create mode 100644 files/build/versions/dockers/docker-sonic-gnmi/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 ca6bda7bd0d5..44d0d52079a0 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,8 +1,5 @@ applibs==1.mlnx.4.6.1062 applibs-dev==1.mlnx.4.6.1062 -bfnplatform==1.0.0 -hsflowd==2.0.51-26 -isc-dhcp-relay==4.4.1-2.3+deb11u2 kernel-mft-dkms==4.25.0-62 libdashapi==1.0.0 libnl-3-dev==3.5.0-1 @@ -17,15 +14,14 @@ libprotobuf-dev==3.21.12-3 libprotobuf-lite32==3.21.12-3 libprotobuf32==3.21.12-3 libprotoc32==3.21.12-3 -libsai==1.12.0-1 -libsai-dev==1.12.0-1 +libsai==1.13.0-1 +libsai-dev==1.13.0-1 libsaimetadata==1.0.0 libsaimetadata-dev==1.0.0 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 @@ -36,30 +32,20 @@ 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 libyang==1.0.73 libyang-cpp==1.0.73 libyang-dev==1.0.73 linux-headers-5.10.0-23-2-amd64==5.10.179-3 linux-headers-5.10.0-23-2-common==5.10.179-3 -lldpd==1.0.4-1 -lm-sensors==1:3.6.0-7 -mft==4.25.0-62 net-tools==1.60+git20181103.0eebece-1 protobuf-compiler==3.21.12-3 python-thrift==0.11.0-4 python3-swsscommon==1.0.0 -python3-thrift==0.14.1 python3-yang==1.0.73 -sonic-dhcp6relay==1.0.0-0 -sonic-dhcpmon==1.0.0-0 -sonic-eventd==1.0.0-0 -sonic-linkmgrd==1.0.0-1 sonic-mgmt-common==1.0.0 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.6.1062 sx-acl-helper-dev==1.mlnx.4.6.1062 sx-complib==1.mlnx.4.6.1062 @@ -73,8 +59,6 @@ sx-obj-desc-lib==1.mlnx.4.6.1062 sx-obj-desc-lib-dev==1.mlnx.4.6.1062 sxd-libs==1.mlnx.4.6.1062 sxd-libs-dev==1.mlnx.4.6.1062 -syncd==1.0.0 thrift-compiler==0.11.0-4 wjh-libs==1.mlnx.4.6.1062 wjh-libs-dev==1.mlnx.4.6.1062 -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 86cb980fcc3c..1eaf9de454db 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 @@ -29,7 +29,6 @@ python-arptable==0.0.2 semantic-version==2.10.0 systemd-python==235 tabulate==0.8.2 -thrift==0.14.1 toposort==1.6 wcwidth==0.2.6 websocket-client==1.6.3 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 850c2bfc402e..847836dae200 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 @@ -13,7 +13,6 @@ libswsscommon==1.0.0 libswsscommon-dev==1.0.0 libthrift-0.11.0==0.11.0-4 libthrift-dev==0.11.0-4 -libthrift0==0.14.1 libyang==1.0.73 libyang-cpp==1.0.73 libyang-dev==1.0.73 @@ -23,5 +22,4 @@ python3-swsscommon==1.0.0 python3-yang==1.0.73 sonic-mgmt-common==1.0.0 sonic-mgmt-common-codegen==1.0.0 -sonic-mgmt-framework==1.0-01 thrift-compiler==0.11.0-4 diff --git a/files/build/versions/default/versions-docker b/files/build/versions/default/versions-docker index 91b082ca96b3..fc59b073223c 100644 --- a/files/build/versions/default/versions-docker +++ b/files/build/versions/default/versions-docker @@ -1,12 +1,12 @@ -amd64:amd64/debian:bullseye==sha256:9d23db14fbdc095689c423af56b9525538de139a1bbe950b4f0467698fb874d2 -amd64:amd64/debian:buster==sha256:d774a984460a74973e6ce4d1f87ab90f2818e41fcdd4802bcbdc4e0b67f9dadf -amd64:debian:bullseye==sha256:54d33aaad0bc936a9a40d856764c7bc35c0afaa9cab51f88bb95f6cd8004438d -amd64:debian:buster==sha256:484cc8ab0d73f513e3f9bacd03424eb081bd90f594d7ebde42587843fdc242f3 -arm64:arm64v8/debian:bullseye==sha256:eefb45317844a131035d89384dbbe3858a0c22f6b7884e56648bd6b22d206a8a -arm64:arm64v8/debian:buster==sha256:de3b447d1ed18aabf08e36086037e7a78883ab3b25cb2b7fb014f7873391fe81 -arm64:debian:bullseye==sha256:54d33aaad0bc936a9a40d856764c7bc35c0afaa9cab51f88bb95f6cd8004438d -arm64:debian:buster==sha256:484cc8ab0d73f513e3f9bacd03424eb081bd90f594d7ebde42587843fdc242f3 -armhf:arm32v7/debian:bullseye==sha256:19973da79531feade9ed259004c735d0458285f1db9a16bd9d76a954b261c4ab -armhf:arm32v7/debian:buster==sha256:b6dc71e7be8b027386c8562e72ae8b78ee2db29093787e5268b18d42900a2d12 -armhf:debian:bullseye==sha256:54d33aaad0bc936a9a40d856764c7bc35c0afaa9cab51f88bb95f6cd8004438d -armhf:debian:buster==sha256:484cc8ab0d73f513e3f9bacd03424eb081bd90f594d7ebde42587843fdc242f3 +amd64:amd64/debian:bullseye==sha256:4cb3f4198e4af2d03dffe6bfa4f3686773596494ef298f3882553d52e885634b +amd64:amd64/debian:buster==sha256:d39357a2a8840e450e387df33a5aaf8f0c8f99e388a0e18169f3dd240fc2393d +amd64:debian:bullseye==sha256:71cb300d5448af821aedfe63afd55ba05f45a6a79f00dcd131b96b780bb99fe4 +amd64:debian:buster==sha256:defa5d214292f2aaf7905d3e4bcdf8f628019feb63e7c8746df563d1a941f8d7 +arm64:arm64v8/debian:bullseye==sha256:c4a762841d008c85d809f0981c47e2a490c43483e4a169e17afa2dc83d18b2b1 +arm64:arm64v8/debian:buster==sha256:7d6cb4b56f1230b8692ed0c5fa5fa838ddd7ebd436a6463a6e9b29d1aa4c6e24 +arm64:debian:bullseye==sha256:71cb300d5448af821aedfe63afd55ba05f45a6a79f00dcd131b96b780bb99fe4 +arm64:debian:buster==sha256:defa5d214292f2aaf7905d3e4bcdf8f628019feb63e7c8746df563d1a941f8d7 +armhf:arm32v7/debian:bullseye==sha256:70dcc7f2c51acbeaff85f700d9c1ef936371e60bdec8da15729c19503ef1fb8f +armhf:arm32v7/debian:buster==sha256:d984bf6bd66a53445e82ca3e6ae8d3c40a866c053339acfd5f3fa705a7092b90 +armhf:debian:bullseye==sha256:71cb300d5448af821aedfe63afd55ba05f45a6a79f00dcd131b96b780bb99fe4 +armhf:debian:buster==sha256:defa5d214292f2aaf7905d3e4bcdf8f628019feb63e7c8746df563d1a941f8d7 diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index 440b24b978c8..ff4e4f20d96e 100644 --- a/files/build/versions/default/versions-git +++ b/files/build/versions/default/versions-git @@ -1,23 +1,23 @@ -https://chromium.googlesource.com/chromium/tools/depot_tools.git==4af2818c5bf2b884ea6d5d8a56a7995fb5ce4b9b +https://chromium.googlesource.com/chromium/tools/depot_tools.git==68c511349d6ee2a50e3b7e3ce96b8a06034d304e https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f -https://github.com/CESNET/libyang.git==8b0b910a2dcb7360cb5b0aaefbd1338271d50946 +https://github.com/CESNET/libyang.git==fc4dbd923e044006c93df020590a1e5a8656c09e 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==9ccbf1cf434e9ec0206b8121c6f1bbf9cf506864 -https://github.com/FreeRADIUS/freeradius-server.git==04fdc052f3f62aa93288ffbff59d2ad43d96fd41 -https://github.com/FreeRADIUS/pam_radius.git==7d75a319e43d5e234b93f89cd461a11861d07b95 -https://github.com/jeroennijhof/pam_tacplus.git==4284d9016e64def2bb81d5f50f96dc3b59bfdc39 +https://github.com/flashrom/flashrom.git==a21be9153abe50ae26cd833db62d9493e7eadf54 +https://github.com/FreeRADIUS/freeradius-server.git==cd0dd9e16460dee6dbd37ebeecadf1a3be8cbf31 +https://github.com/FreeRADIUS/pam_radius.git==53c0cfff686ab48ae3bac5449d5461b6e1b83d27 +https://github.com/jeroennijhof/pam_tacplus.git==b89dba44b58ec7fdc9b5365b982aa4a316484a3c https://github.com/jpirko/libteam.git==8b843e93cee1dab61fb79b01791201cdad45e1d1 https://github.com/lguohan/gnxi.git==3adf8b97755b49947e465b5a14645f11e79fa0cd -https://github.com/Marvell-switching/mrvl-prestera.git==63118c2a6b627e543f5556baa27eee1ec6cd7a2b +https://github.com/Marvell-switching/mrvl-prestera.git==22ac73bff81451571002df88e5a39cf390a4d8cd https://github.com/Mellanox/libpsample.git==62bb27d9a49424e45191eee81df7ce0d8c74e774 -https://github.com/p4lang/ptf.git==bad2ecf5ccf6d897bc0f8f43c95c228599f79ae9 +https://github.com/p4lang/ptf.git==e8b545f3f281fc509c7bdd6c8a4f55bc829149e7 https://github.com/p4lang/scapy-vxlan.git==85ffe83da156568ee47a0750f638227e6e1d7479 -https://github.com/sflow/host-sflow==d1453b32e3c4828f88045107272064c7bb1d1fbe -https://github.com/sflow/sflowtool==219ab50bcfd9d9e714ff169eec31b2625933acb5 -https://github.com/thom311/libnl==052a97cb6554386c70d531e7c1b34a6afa1dbeb0 +https://github.com/sflow/host-sflow==2d9d73c2937577116f679b245bdfc098dbe459d7 +https://github.com/sflow/sflowtool==c1eeb55ad6bfd76283833614a8296f635627e1db +https://github.com/thom311/libnl==8693347fe9c47d08ce5899602ab4f208c1249619 https://salsa.debian.org/debian/libteam.git==48142125234a665ad5367b724af36a58fb484d3d https://salsa.debian.org/kernel-team/initramfs-tools.git==cf964bfb4362019fd7fba1e839e403ff950dca8e https://salsa.debian.org/sk-guest/monit.git==c9da7ebb1f35dfba17b50b5969a6e75e29cbec0d -https://salsa.debian.org/ssh-team/openssh.git==2b4ef335ae2ef4e1fe846b92c7047754aa706539 +https://salsa.debian.org/ssh-team/openssh.git==1d67ef8053a0ea5e9a57c0e6ad33604d17e95456 diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index 040ea9da8399..977d789c0329 100644 --- a/files/build/versions/default/versions-mirror +++ b/files/build/versions/default/versions-mirror @@ -1,14 +1,14 @@ 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==20230924T000228Z -debian-security==20230924T000235Z -download.docker.com_linux_debian_dists_bullseye==2023-09-15T23:15:08Z -download.docker.com_linux_debian_dists_buster==2023-09-15T23:15:08Z -packages.trafficmanager.net_snapshot_debian-security_20230924T000235Z_dists_bullseye-security==2023-09-23T14:03:27Z -packages.trafficmanager.net_snapshot_debian-security_20230924T000235Z_dists_buster_updates==2023-09-23T14:03:27Z -packages.trafficmanager.net_snapshot_debian_20230924T000228Z_dists_bullseye==2023-06-10T08:52:21Z -packages.trafficmanager.net_snapshot_debian_20230924T000228Z_dists_bullseye-backports==2023-09-23T20:17:29Z -packages.trafficmanager.net_snapshot_debian_20230924T000228Z_dists_bullseye-updates==2023-09-23T20:17:29Z -packages.trafficmanager.net_snapshot_debian_20230924T000228Z_dists_buster==2023-06-10T08:53:33Z -packages.trafficmanager.net_snapshot_debian_20230924T000228Z_dists_buster-backports==2023-09-23T20:17:29Z -packages.trafficmanager.net_snapshot_debian_20230924T000228Z_dists_buster-updates==2023-06-10T08:55:10Z +debian==20240126T000254Z +debian-security==20240126T000239Z +download.docker.com_linux_debian_dists_bullseye==2024-01-25T21:46:24Z +download.docker.com_linux_debian_dists_buster==2024-01-25T21:46:24Z +packages.trafficmanager.net_snapshot_debian-security_20240126T000239Z_dists_bullseye-security==2024-01-25T19:33:24Z +packages.trafficmanager.net_snapshot_debian-security_20240126T000239Z_dists_buster_updates==2024-01-25T19:33:25Z +packages.trafficmanager.net_snapshot_debian_20240126T000254Z_dists_bullseye==2023-10-07T11:07:16Z +packages.trafficmanager.net_snapshot_debian_20240126T000254Z_dists_bullseye-backports==2024-01-25T20:16:12Z +packages.trafficmanager.net_snapshot_debian_20240126T000254Z_dists_bullseye-updates==2024-01-25T20:16:12Z +packages.trafficmanager.net_snapshot_debian_20240126T000254Z_dists_buster==2023-06-10T08:53:33Z +packages.trafficmanager.net_snapshot_debian_20240126T000254Z_dists_buster-backports==2024-01-25T20:16:12Z +packages.trafficmanager.net_snapshot_debian_20240126T000254Z_dists_buster-updates==2023-06-10T08:55:10Z diff --git a/files/build/versions/default/versions-web b/files/build/versions/default/versions-web index da511ce0bdfb..7ea236132906 100644 --- a/files/build/versions/default/versions-web +++ b/files/build/versions/default/versions-web @@ -31,22 +31,20 @@ https://deb.nodesource.com/node_14.x/dists/buster/Release==42875141604382f0abb4d https://deb.nodesource.com/setup_14.x==c30873f4a513bb935afaf8f65e7de9e1 https://download.docker.com/linux/debian/gpg==1afae06b34a13c1b3d9cb61a26285a15 https://github.com/aristanetworks/sonic-firmware/raw/446f30ccd8626f904d89d5798da7294948e090a6/phy/phy-credo_1.0_amd64.deb==6c3d6c32477615cbe049b9161ce15bd5 -https://github.com/barefootnetworks/sonic-release-pkgs/raw/dev/bfnplatform_20221130_sai_1.11.0_deb11.deb==4a77e5f35b75ad7ce062f631581b40e2 -https://github.com/barefootnetworks/sonic-release-pkgs/raw/dev/bfnsdk_20221130_sai_1.11.0_deb11.deb==c2b0dfb4122dcdbd4af58826e2010640 -https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64==0334fd679ec178f14882b73ebc10d7d8 -https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-arm64==e07f07d9f758cdcf57ba5d2ff9f3d491 -https://github.com/CentecNetworks/sonic-binaries/raw/master/amd64/sai/libsaictc-dev_1.12.0-1_amd64.deb==bab91db87a01dd58a88d0de3dae7c79c -https://github.com/CentecNetworks/sonic-binaries/raw/master/amd64/sai/libsaictc_1.12.0-1_amd64.deb==57fa57bcd38ae4df9d17c56bf1c59bdf +https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64==44124b7ea28b7ffc38cb7a6b770b7844 +https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-arm64==13442c16ab9043c7f351f74001c565ac +https://github.com/CentecNetworks/sonic-binaries/raw/master/amd64/sai/libsaictc-dev_1.13.0-1_amd64.deb==b2e4b33541d4ab5de4c1b8eb4a783761 +https://github.com/CentecNetworks/sonic-binaries/raw/master/amd64/sai/libsaictc_1.13.0-1_amd64.deb==fd5f2ddc1d9bc12c0e612154c63634cf https://github.com/CentecNetworks/sonic-binaries/raw/master/amd64/third_party/advantech/_Susi4.so==5e1b8daef522c9da00af400abe25810b https://github.com/CentecNetworks/sonic-binaries/raw/master/amd64/third_party/advantech/libSUSI-4.00.so.1==393a94b0abba146777e276e1febe0cb0 -https://github.com/CentecNetworks/sonic-binaries/raw/master/arm64/sai/libsaictc-dev_1.12.0-1_arm64.deb==75350b2a4a662268cc413427e47cd588 -https://github.com/CentecNetworks/sonic-binaries/raw/master/arm64/sai/libsaictc_1.12.0-1_arm64.deb==7699a44a090208ff0c5cd5d1674ab47b +https://github.com/CentecNetworks/sonic-binaries/raw/master/arm64/sai/libsaictc-dev_1.13.0-1_arm64.deb==1162131e154bba573bf7502d743f1d81 +https://github.com/CentecNetworks/sonic-binaries/raw/master/arm64/sai/libsaictc_1.13.0-1_arm64.deb==b8b25694a1dc9b4d8dffc2f2c04ddaed 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.12.0-2_armhf.deb==e2890daebc864898775d8b0a7379d4aa +https://github.com/Marvell-switching/sonic-marvell-binaries/raw/master/armhf/sai-plugin/mrvllibsai_1.12.0-2_armhf.deb==944790bf2d262144cfd939b2caeda1b1 https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2012.1062/fw-SPC-rel-13_2012_1062-EVB.mfa==ded5ea46c37ba564a29e306ad233a83c https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2012.1062/fw-SPC2-rel-29_2012_1062-EVB.mfa==74700208646225d39afff0154642648a https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2012.1062/fw-SPC3-rel-30_2012_1062-EVB.mfa==3de91549a489dc45250e3e1ca11b74e3 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2012.1062/fw-SPC4-rel-34_2012_1062-EVB.mfa==52f099ae0e83941a009e07c9ceff3e01 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2012.1062/fw-SPC4-rel-34_2012_1062-EVB.mfa==1af0b2946674351bc262f1650ab73b89 https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sai-SAIBuild2211.25.1.4-bullseye-amd64/mlnx-sai-dbgsym_1.mlnx.SAIBuild2211.25.1.4_amd64.deb==084c7e47eab2663dbc92d920b13062ee https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sai-SAIBuild2211.25.1.4-bullseye-amd64/mlnx-sai_1.mlnx.SAIBuild2211.25.1.4_amd64.deb==d5f99501d798fddbf055442b7a9825c9 https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.1062-bullseye-amd64/applibs-dev_1.mlnx.4.6.1062_amd64.deb==896c56aee293b11b353f6bbe39e12c97 @@ -91,8 +89,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.3_amd64.deb?sv=2021-04-10&st=2023-10-12T02%3A21%3A51Z&se=2031-10-13T02%3A21%3A00Z&sr=b&sp=r&sig=olu3%2Bq5eJYRtXCygJWgKUx%2FdlrlB%2FWE0i9ruftYdB7g%3D==c69922a1589cf5615a3fddd5b66aa296 +https://sonicstorage.blob.core.windows.net/packages/credosai/libsaicredo_0.9.3_amd64.deb?sv=2021-04-10&st=2023-10-12T02%3A21%3A05Z&se=2031-10-13T02%3A21%3A00Z&sr=b&sp=r&sig=UXC%2FYKm%2BvHRjGmM3xjnFMQzY%2BMpxhKtMxNHQPdwvtN8%3D==0400bc2015f56bff7d4283c030be26cc 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 @@ -109,43 +107,43 @@ https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.1/amd64/golang https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.1/amd64/golang-1.15-src_1.15.15-1~deb11u4%2Bfips_amd64.deb==1c920937aa49b602a1bfec3c49747131 https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.1/arm64/golang-1.15-go_1.15.15-1~deb11u4%2Bfips_arm64.deb==0b70c104b907db13ff2fe5d52b3d0008 https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.1/arm64/golang-1.15-src_1.15.15-1~deb11u4%2Bfips_arm64.deb==1d06900f03424fa5ce34a782605983fe -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/golang-1.15-doc_1.15.15-1~deb11u4+fips_all.deb==72ead09139135d4ecd91b76c89128567 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/golang-1.15-go_1.15.15-1~deb11u4+fips_amd64.deb==145e103357a915cc759cc93de602b631 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/golang-1.15-src_1.15.15-1~deb11u4+fips_amd64.deb==1c1a46d5599be92777702643c37d5751 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/golang-1.15_1.15.15-1~deb11u4+fips_all.deb==847bc1fc5ce9c8ebae5176947ab34d30 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/libk5crypto3_1.18.3-6+deb11u1+fips_amd64.deb==5e8de29d5f6844f71f15cbf0c3993f1c -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/libpython3.9-minimal_3.9.2-1+fips_amd64.deb==71b75222c8bcd5ede55693a9223a3246 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/libpython3.9-stdlib_3.9.2-1+fips_amd64.deb==565cce5ca6e6a31a53b7a9e2faa4b7d9 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/libpython3.9_3.9.2-1+fips_amd64.deb==c405132eacaf059c7c903f853d48be7e -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/libssl-dev_1.1.1n-0+deb11u4+fips_amd64.deb==a1833ecb83cddb66ce30bf4b28e48856 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/libssl-doc_1.1.1n-0+deb11u4+fips_all.deb==52925c4fd9932ffe78798dd55bdb077e -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/libssl1.1_1.1.1n-0+deb11u4+fips_amd64.deb==65000162eac58235fbf1acab52047ca9 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/openssh-client_8.4p1-5+deb11u1+fips_amd64.deb==bee0e4f52cf8dedd6dac78be18b02400 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/openssh-server_8.4p1-5+deb11u1+fips_amd64.deb==8ac4a8397c8e62d554718f1c8c6f5896 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/openssh-sftp-server_8.4p1-5+deb11u1+fips_amd64.deb==94740a01d5d025df8d99d3e5b7a0b0e9 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/openssl_1.1.1n-0+deb11u4+fips_amd64.deb==2f3040c1dc6230c5dd09994eeaace905 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/python3.9-minimal_3.9.2-1+fips_amd64.deb==66511f65e2873cda108e6bb3911abbf5 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/python3.9_3.9.2-1+fips_amd64.deb==30be224443931a2a3428aa270b87384a -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/symcrypt-openssl_0.8_amd64.deb==0b838c07c4625a593cd914e414b656ea -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/golang-1.15-doc_1.15.15-1~deb11u4+fips_all.deb==72ead09139135d4ecd91b76c89128567 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/golang-1.15-go_1.15.15-1~deb11u4+fips_arm64.deb==b59f315800ca2ec31de79136dfb8979d -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/golang-1.15-src_1.15.15-1~deb11u4+fips_arm64.deb==0038c68ed1e3adb1b43434af81cff678 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/golang-1.15_1.15.15-1~deb11u4+fips_all.deb==847bc1fc5ce9c8ebae5176947ab34d30 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/libk5crypto3_1.18.3-6+deb11u1+fips_arm64.deb==0bb2a2d23f73e882d91b2e256aad08f6 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/libpython3.9-minimal_3.9.2-1+fips_arm64.deb==870a96b0d9d7fe753d495ad6574e4c03 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/libpython3.9-stdlib_3.9.2-1+fips_arm64.deb==df2b4d1672a297f855d0e85b382629cc -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/libpython3.9_3.9.2-1+fips_arm64.deb==edae5c269e2c401873e7cff3d4f93a7a -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/libssl-dev_1.1.1n-0+deb11u4+fips_arm64.deb==56aed9e3cef3692a36129598bd9871d6 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/libssl-doc_1.1.1n-0+deb11u4+fips_all.deb==52925c4fd9932ffe78798dd55bdb077e -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/libssl1.1_1.1.1n-0+deb11u4+fips_arm64.deb==5c760faf80f6f4efc71e255b2e0774fc -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/openssh-client_8.4p1-5+deb11u1+fips_arm64.deb==ce762b1730871a72bc423c97444342ad -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/openssh-server_8.4p1-5+deb11u1+fips_arm64.deb==c943526cf7317d4c0d05005db47b6992 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/openssh-sftp-server_8.4p1-5+deb11u1+fips_arm64.deb==4e360e97ed3f0eaead7a8ef79fa4f3d7 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/openssl_1.1.1n-0+deb11u4+fips_arm64.deb==68e32a58e12f960ce163decc0f756906 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/python3.9-minimal_3.9.2-1+fips_arm64.deb==71935b5d5780014e0048f0e9d84acdb9 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/python3.9_3.9.2-1+fips_arm64.deb==4d6307dabcd3060235d6188cfa0346b8 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/symcrypt-openssl_0.8_arm64.deb==0ab2a6b1c621508eb5b39da92fd69060 -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/fips/bullseye/0.9/amd64/golang-1.15-doc_1.15.15-1~deb11u4+fips_all.deb==72ead09139135d4ecd91b76c89128567 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/amd64/golang-1.15-go_1.15.15-1~deb11u4+fips_amd64.deb==145e103357a915cc759cc93de602b631 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/amd64/golang-1.15-src_1.15.15-1~deb11u4+fips_amd64.deb==1c1a46d5599be92777702643c37d5751 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/amd64/golang-1.15_1.15.15-1~deb11u4+fips_all.deb==847bc1fc5ce9c8ebae5176947ab34d30 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/amd64/libk5crypto3_1.18.3-6+deb11u1+fips_amd64.deb==5e8de29d5f6844f71f15cbf0c3993f1c +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/amd64/libpython3.9-minimal_3.9.2-1+fips_amd64.deb==e47afaa81099fa2949a2dce75cffb6da +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/amd64/libpython3.9-stdlib_3.9.2-1+fips_amd64.deb==ab079d683259b241186cc1b3c68f3d73 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/amd64/libpython3.9_3.9.2-1+fips_amd64.deb==c405132eacaf059c7c903f853d48be7e +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/amd64/libssl-dev_1.1.1n-0+deb11u5+fips_amd64.deb==7deccb6cb0197bd9dc257d54505533cf +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/amd64/libssl-doc_1.1.1n-0+deb11u5+fips_all.deb==3ac7462c370d85e42c03b11d26f35016 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/amd64/libssl1.1_1.1.1n-0+deb11u5+fips_amd64.deb==6a4505b82957d711e983e03364275521 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/amd64/openssh-client_8.4p1-5+deb11u2+fips_amd64.deb==1fb734b040398b0fb9c674385253b993 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/amd64/openssh-server_8.4p1-5+deb11u2+fips_amd64.deb==8ec9f1fbfedd6c36312c5181d9950b58 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/amd64/openssh-sftp-server_8.4p1-5+deb11u2+fips_amd64.deb==02e8be0633aff33497655261256eadca +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/amd64/openssl_1.1.1n-0+deb11u5+fips_amd64.deb==ee086d7e1fb0cfd36513ec242381af53 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/amd64/python3.9-minimal_3.9.2-1+fips_amd64.deb==44c28ede910f014efc84118bc8a4b73c +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/amd64/python3.9_3.9.2-1+fips_amd64.deb==30be224443931a2a3428aa270b87384a +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/amd64/symcrypt-openssl_0.9_amd64.deb==9095ce7fd2283806f0c3ce8a60d36ad2 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/golang-1.15-doc_1.15.15-1~deb11u4+fips_all.deb==72ead09139135d4ecd91b76c89128567 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/golang-1.15-go_1.15.15-1~deb11u4+fips_arm64.deb==b59f315800ca2ec31de79136dfb8979d +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/golang-1.15-src_1.15.15-1~deb11u4+fips_arm64.deb==0038c68ed1e3adb1b43434af81cff678 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/golang-1.15_1.15.15-1~deb11u4+fips_all.deb==847bc1fc5ce9c8ebae5176947ab34d30 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/libk5crypto3_1.18.3-6+deb11u1+fips_arm64.deb==0bb2a2d23f73e882d91b2e256aad08f6 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/libpython3.9-minimal_3.9.2-1+fips_arm64.deb==7e6ac5f9bce1ecd59532ed669040436d +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/libpython3.9-stdlib_3.9.2-1+fips_arm64.deb==1b86a9d8bafe7cddc484f4ac1010ee07 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/libpython3.9_3.9.2-1+fips_arm64.deb==edae5c269e2c401873e7cff3d4f93a7a +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/libssl-dev_1.1.1n-0+deb11u5+fips_arm64.deb==2116b0e949a521b02098f01aee5a33d4 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/libssl-doc_1.1.1n-0+deb11u5+fips_all.deb==3ac7462c370d85e42c03b11d26f35016 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/libssl1.1_1.1.1n-0+deb11u5+fips_arm64.deb==a6a6a6f2d23d91398f44570da6e2e80c +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/openssh-client_8.4p1-5+deb11u2+fips_arm64.deb==b30c745ca94e392740c67225802e9068 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/openssh-server_8.4p1-5+deb11u2+fips_arm64.deb==8ab6d9e3bac9d486bda5664e40f634ef +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/openssh-sftp-server_8.4p1-5+deb11u2+fips_arm64.deb==73c51fa8f165a014571c2bdbd843c517 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/openssl_1.1.1n-0+deb11u5+fips_arm64.deb==5c16b501e97678e7f55c616afa6423bb +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/python3.9-minimal_3.9.2-1+fips_arm64.deb==3ea50a9bb61102b7e2ffe8f7b79c3d5f +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/python3.9_3.9.2-1+fips_arm64.deb==4d6307dabcd3060235d6188cfa0346b8 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/symcrypt-openssl_0.9_arm64.deb==5138fe3d77f84c995ed412f064c07951 +https://sonicstorage.blob.core.windows.net/public/sai/bcmpai/REL_3.11/3.11/libsaibroncos_3.11_amd64.deb==6e21a16126e833516a9659d4c35c284e https://storage.googleapis.com/golang/go1.15.15.linux-amd64.tar.gz==b75227438c6129b5013da053b3aa3f38 https://storage.googleapis.com/golang/go1.15.15.linux-arm64.tar.gz==6d721146a9195592d92a80cf27d475f9 https://storage.googleapis.com/golang/go1.15.15.linux-armv6l.tar.gz==23d140bbeedc978b954de1a199a22bdb 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 5efe29e93828..7ab5e0cfbcb9 100644 --- a/files/build/versions/dockers/docker-base-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-base-bullseye/versions-deb-bullseye @@ -1,17 +1,17 @@ ca-certificates==20210119 -curl==7.74.0-1.3+deb11u7 +curl==7.74.0-1.3+deb11u11 iproute2==5.10.0-4 jq==1.6-2.1 less==551-2 libatomic1==10.2.1-6 libbpf0==1:0.3-2 libbrotli1==1.0.9-2+b2 -libbsd0==0.11.3-1 +libbsd0==0.11.3-1+deb11u1 libcap2==1:2.44-1 libcap2-bin==1:2.44-1 -libcurl4==7.74.0-1.3+deb11u7 +libcurl4==7.74.0-1.3+deb11u11 libdaemon0==0.14-7.1 -libdbus-1-3==1.12.24-0+deb11u1 +libdbus-1-3==1.12.28-0+deb11u1 libelf1==0.183-1 libestr0==0.1.10-2.1+b1 libexpat1==2.2.10-2+deb11u5 @@ -29,9 +29,9 @@ liblzf1==3.6-3 libmd0==1.0.3-3 libmnl0==1.0.4-3 libmpdec3==2.5.1-1 -libncurses6==6.2+20201114-2+deb11u1 -libncursesw6==6.2+20201114-2+deb11u1 -libnghttp2-14==1.43.0-1 +libncurses6==6.2+20201114-2+deb11u2 +libncursesw6==6.2+20201114-2+deb11u2 +libnghttp2-14==1.43.0-1+deb11u1 libnorm1==1.5.9+dfsg-2 libonig5==6.9.6-1.1 libperl5.32==5.32.1-4+deb11u2 @@ -48,8 +48,8 @@ libsasl2-modules-db==2.1.27+dfsg-2.1+deb11u1 libsodium23==1.0.18-1 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 +libssl-dev==1.1.1n-0+deb11u5+fips +libssl1.1==1.1.1n-0+deb11u5+fips libwrap0==7.6.q-31 libxtables12==1.8.7-1 libzmq5==4.3.4-1 @@ -57,7 +57,7 @@ lua-bitop==1.0.2-5 lua-cjson==2.1.0+dfsg-2.1 media-types==4.0.0 net-tools==1.60+git20181103.0eebece-1 -openssl==1.1.1n-0+deb11u4+fips +openssl==1.1.1n-0+deb11u5+fips perl==5.32.1-4+deb11u2 perl-modules-5.32==5.32.1-4+deb11u2 procps==2:3.3.17-5 diff --git a/files/build/versions/dockers/docker-base-bullseye/versions-deb-bullseye-armhf b/files/build/versions/dockers/docker-base-bullseye/versions-deb-bullseye-armhf index 42c9a7e5bcd0..3546f534b2c9 100644 --- a/files/build/versions/dockers/docker-base-bullseye/versions-deb-bullseye-armhf +++ b/files/build/versions/dockers/docker-base-bullseye/versions-deb-bullseye-armhf @@ -1 +1 @@ -openssl==1.1.1n-0+deb11u5 +openssl==1.1.1w-0+deb11u1 diff --git a/files/build/versions/dockers/docker-base-bullseye/versions-py3 b/files/build/versions/dockers/docker-base-bullseye/versions-py3 index 61ebeea0c4ca..956035480690 100644 --- a/files/build/versions/dockers/docker-base-bullseye/versions-py3 +++ b/files/build/versions/dockers/docker-base-bullseye/versions-py3 @@ -1,7 +1,11 @@ +async-timeout==4.0.3 j2cli==0.3.10 jinja2==3.1.2 markupsafe==2.1.3 pip==23.2.1 +python-lzf==0.2.4 +rdbtools==0.1.15 +redis==5.0.1 setuptools==49.6.0 supervisor==4.2.1 supervisord-dependent-startup==1.4.0 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 79b80bd4c927..ab4875803369 100644 --- a/files/build/versions/dockers/docker-base-buster/versions-deb-buster +++ b/files/build/versions/dockers/docker-base-buster/versions-deb-buster @@ -1,31 +1,31 @@ ca-certificates==20200601~deb10u2 -curl==7.64.0-4+deb10u6 +curl==7.64.0-4+deb10u8 jq==1.5+dfsg-2+b1 less==487-0.1+b1 libatomic1==8.3.0-6 -libcurl4==7.64.0-4+deb10u6 +libcurl4==7.64.0-4+deb10u8 libdaemon0==0.14-7 -libdbus-1-3==1.12.24-0+deb10u1 +libdbus-1-3==1.12.28-0+deb10u1 libestr0==0.1.10-2.1 libexpat1==2.2.6-2+deb10u6 libfastjson4==0.99.8-2+deb10u1 libgdbm-compat4==1.18.1-4 libgdbm6==1.18.1-4 -libgssapi-krb5-2==1.17-3+deb10u5 +libgssapi-krb5-2==1.17-3+deb10u6 libjansson4==2.12-1 libjemalloc2==5.1.0-3 libjq1==1.5+dfsg-2+b1 -libk5crypto3==1.17-3+deb10u5 +libk5crypto3==1.17-3+deb10u6 libkeyutils1==1.6-6 -libkrb5-3==1.17-3+deb10u5 -libkrb5support0==1.17-3+deb10u5 +libkrb5-3==1.17-3+deb10u6 +libkrb5support0==1.17-3+deb10u6 libldap-2.4-2==2.4.47+dfsg-3+deb10u7 libldap-common==2.4.47+dfsg-3+deb10u7 liblognorm5==2.0.5-1 liblua5.1-0==5.1.5-8.1+b2 libmpdec2==2.4.2-2 -libncurses6==6.1+20181013-2+deb10u3 -libnghttp2-14==1.36.0-2+deb10u1 +libncurses6==6.1+20181013-2+deb10u5 +libnghttp2-14==1.36.0-2+deb10u2 libnorm1==1.5.8+dfsg2-1 libonig5==6.9.1-1 libperl5.28==5.28.1-6+deb10u1 @@ -33,8 +33,8 @@ libpgm-5.2-0==5.2.122~dfsg-3 libprocps7==2:3.3.15-2 libpsl5==0.20.2-2 libpython3-stdlib==3.7.3-1 -libpython3.7-minimal==3.7.3-2+deb10u5 -libpython3.7-stdlib==3.7.3-2+deb10u5 +libpython3.7-minimal==3.7.3-2+deb10u6 +libpython3.7-stdlib==3.7.3-2+deb10u6 libreadline7==7.0-5 librtmp1==2.4+20151223.gitfa8646d.1-2 libsasl2-2==2.1.27+dfsg-1+deb10u2 @@ -58,12 +58,12 @@ python3==3.7.3-1 python3-distutils==3.7.3-1 python3-lib2to3==3.7.3-1 python3-minimal==3.7.3-1 -python3.7==3.7.3-2+deb10u5 -python3.7-minimal==3.7.3-2+deb10u5 +python3.7==3.7.3-2+deb10u6 +python3.7-minimal==3.7.3-2+deb10u6 readline-common==7.0-5 redis-tools==5:6.0.6-1~bpo10+1 rsyslog==8.1901.0-1+deb10u2 socat==1.7.4.1-3 -vim-common==2:8.1.0875-5+deb10u5 -vim-tiny==2:8.1.0875-5+deb10u5 -xxd==2:8.1.0875-5+deb10u5 +vim-common==2:8.1.0875-5+deb10u6 +vim-tiny==2:8.1.0875-5+deb10u6 +xxd==2:8.1.0875-5+deb10u6 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 d686852ba6d6..1db2454d7f2e 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,5 +1,5 @@ apt-utils==2.2.4 -dpkg-dev==1.20.12 +dpkg-dev==1.20.13 libboost-serialization1.74.0==1.74.0-9 libhiredis0.14==0.14.1-1 libjs-jquery==3.5.1+dfsg+~3.5.5-7 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 547547b57606..58a55d6d16b1 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 @@ -1,6 +1,6 @@ icu-devtools==67.1-7 -libc-dev-bin==2.31-13+deb11u6 -libc6-dev==2.31-13+deb11u6 +libc-dev-bin==2.31-13+deb11u7 +libc6-dev==2.31-13+deb11u7 libcrypt-dev==1:4.4.18-4 libicu-dev==67.1-7 libicu67==67.1-7 @@ -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.191-1 +linux-libc-dev==5.10.205-2 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 547547b57606..58a55d6d16b1 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 @@ -1,6 +1,6 @@ icu-devtools==67.1-7 -libc-dev-bin==2.31-13+deb11u6 -libc6-dev==2.31-13+deb11u6 +libc-dev-bin==2.31-13+deb11u7 +libc6-dev==2.31-13+deb11u7 libcrypt-dev==1:4.4.18-4 libicu-dev==67.1-7 libicu67==67.1-7 @@ -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.191-1 +linux-libc-dev==5.10.205-2 zlib1g-dev==1:1.2.11.dfsg-2+deb11u2 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 366939c86526..1cfab9ea348f 100644 --- a/files/build/versions/dockers/docker-config-engine-bullseye/versions-py3 +++ b/files/build/versions/dockers/docker-config-engine-bullseye/versions-py3 @@ -1,4 +1,3 @@ -async-timeout==4.0.3 bitarray==1.5.3 ijson==2.6.1 ipaddress==1.0.23 diff --git a/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster b/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster index be7150c01a8f..8317e357d67f 100644 --- a/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster +++ b/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster @@ -9,7 +9,7 @@ libnl-cli-3-200==3.5.0-1 libnl-genl-3-200==3.5.0-1 libnl-nf-3-200==3.5.0-1 libnl-route-3-200==3.5.0-1 -libpython3.7==3.7.3-2+deb10u5 +libpython3.7==3.7.3-2+deb10u6 libswsscommon==1.0.0 libyang==1.0.73 libyang-cpp==1.0.73 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 eaa6151a10fb..37e9e7f025ea 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 @@ -2,13 +2,13 @@ icu-devtools==63.1-6+deb10u3 libc-dev-bin==2.28-10+deb10u2 libc6-dev==2.28-10+deb10u2 libdpkg-perl==1.19.8 -libglib2.0-0==2.58.3-2+deb10u4 +libglib2.0-0==2.58.3-2+deb10u5 libicu-dev==63.1-6+deb10u3 libicu63==63.1-6+deb10u3 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.289-2 +linux-libc-dev==4.19.304-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 eaa6151a10fb..37e9e7f025ea 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 @@ -2,13 +2,13 @@ icu-devtools==63.1-6+deb10u3 libc-dev-bin==2.28-10+deb10u2 libc6-dev==2.28-10+deb10u2 libdpkg-perl==1.19.8 -libglib2.0-0==2.58.3-2+deb10u4 +libglib2.0-0==2.58.3-2+deb10u5 libicu-dev==63.1-6+deb10u3 libicu63==63.1-6+deb10u3 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.289-2 +linux-libc-dev==4.19.304-1 pkg-config==0.29-6 zlib1g-dev==1:1.2.11.dfsg-1+deb10u2 diff --git a/files/build/versions/dockers/docker-database/versions-deb-bullseye b/files/build/versions/dockers/docker-database/versions-deb-bullseye index dbb7df916e09..c5d9dce1290f 100644 --- a/files/build/versions/dockers/docker-database/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-database/versions-deb-bullseye @@ -3,7 +3,7 @@ gdbserver==10.1-1.7 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 +libcurl3-gnutls==7.74.0-1.3+deb11u11 libdebuginfod1==0.183-1 libdw1==0.183-1 libedit2==3.1-20191231-2+b1 @@ -17,7 +17,7 @@ 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 +openssh-client==1:8.4p1-5+deb11u3 redis-server==5:6.0.16-1+deb11u2 sshpass==1.09-1+b1 strace==5.10-1 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 c19775241773..5e65ac7c303e 100644 --- a/files/build/versions/dockers/docker-dhcp-relay/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-dhcp-relay/versions-deb-bullseye @@ -5,7 +5,7 @@ isc-dhcp-relay-dbgsym==4.4.1-2.3+deb11u2 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 +libcurl3-gnutls==7.74.0-1.3+deb11u11 libdebuginfod1==0.183-1 libdns-export1110==1:9.11.19+dfsg-2.1 libdw1==0.183-1 @@ -28,7 +28,7 @@ libsource-highlight4v5==3.1.9-3+b1 libswsscommon-dbgsym==1.0.0 libunwind8==1.3.2-2 lsof==4.93.2+dfsg-1.1 -openssh-client==1:8.4p1-5+deb11u1 +openssh-client==1:8.4p1-5+deb11u3 sonic-dhcp6relay==1.0.0-0 sonic-dhcp6relay-dbgsym==1.0.0-0 sonic-dhcpmon==1.0.0-0 diff --git a/files/build/versions/dockers/docker-dhcp-relay/versions-py3 b/files/build/versions/dockers/docker-dhcp-relay/versions-py3 new file mode 100644 index 000000000000..0704b2dbf683 --- /dev/null +++ b/files/build/versions/dockers/docker-dhcp-relay/versions-py3 @@ -0,0 +1 @@ +psutil==5.9.8 diff --git a/files/build/versions/dockers/docker-eventd/versions-deb-bullseye b/files/build/versions/dockers/docker-eventd/versions-deb-bullseye index 6c1c7663b571..10c7dbc37ff3 100644 --- a/files/build/versions/dockers/docker-eventd/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-eventd/versions-deb-bullseye @@ -3,7 +3,7 @@ gdbserver==10.1-1.7 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 +libcurl3-gnutls==7.74.0-1.3+deb11u11 libdebuginfod1==0.183-1 libdw1==0.183-1 libedit2==3.1-20191231-2+b1 @@ -17,7 +17,7 @@ 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 +openssh-client==1:8.4p1-5+deb11u3 sonic-eventd-dbgsym==1.0.0-0 sshpass==1.09-1+b1 strace==5.10-1 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 7046ebaa06bd..c122570ea15e 100644 --- a/files/build/versions/dockers/docker-fpm-frr/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-fpm-frr/versions-deb-bullseye @@ -9,7 +9,7 @@ libbabeltrace1==1.5.8-1+b3 libboost-regex1.74.0==1.74.0-9 libc-ares2==1.17.1-1+deb11u3 libcbor0==0.5.0+dfsg-2 -libcurl3-gnutls==7.74.0-1.3+deb11u7 +libcurl3-gnutls==7.74.0-1.3+deb11u11 libdebuginfod1==0.183-1 libdw1==0.183-1 libedit2==3.1-20191231-2+b1 @@ -32,9 +32,9 @@ libswsscommon-dbgsym==1.0.0 libunwind8==1.3.2-2 libyang2==2.0.112-6 libyang2-dbgsym==2.0.112-6 -logrotate==3.18.0-2+deb11u1 +logrotate==3.18.0-2+deb11u2 lsof==4.93.2+dfsg-1.1 -openssh-client==1:8.4p1-5+deb11u1 +openssh-client==1:8.4p1-5+deb11u3 pci.ids==0.0~2021.02.08-1 sensible-utils==0.0.14 sonic-rsyslog-plugin==1.0.0-0 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 01c7654a23d5..5dc6c13134fb 100644 --- a/files/build/versions/dockers/docker-gbsyncd-broncos/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-gbsyncd-broncos/versions-deb-bullseye @@ -2,11 +2,11 @@ gdb==10.1-1.7 gdbserver==10.1-1.7 libbabeltrace1==1.5.8-1+b3 libboost-regex1.74.0==1.74.0-9 -libc-dev-bin==2.31-13+deb11u6 -libc6-dev==2.31-13+deb11u6 +libc-dev-bin==2.31-13+deb11u7 +libc6-dev==2.31-13+deb11u7 libcbor0==0.5.0+dfsg-2 libcrypt-dev==1:4.4.18-4 -libcurl3-gnutls==7.74.0-1.3+deb11u7 +libcurl3-gnutls==7.74.0-1.3+deb11u11 libdebuginfod1==0.183-1 libdw1==0.183-1 libedit2==3.1-20191231-2+b1 @@ -17,10 +17,10 @@ libicu67==67.1-7 libipt2==2.0.3-1 libmpfr6==4.1.0-3 libnsl-dev==1.3.0-2 -libprotobuf-dev==3.12.4-1 -libprotobuf-lite23==3.12.4-1 -libprotobuf23==3.12.4-1 -libsaibroncos==3.8 +libprotobuf-dev==3.12.4-1+deb11u1 +libprotobuf-lite23==3.12.4-1+deb11u1 +libprotobuf23==3.12.4-1+deb11u1 +libsaibroncos==3.11 libsaimetadata==1.0.0 libsairedis==1.0.0 libsource-highlight-common==3.1.9-3 @@ -28,8 +28,8 @@ 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.191-1 -openssh-client==1:8.4p1-5+deb11u1 +linux-libc-dev==5.10.205-2 +openssh-client==1:8.4p1-5+deb11u3 sshpass==1.09-1+b1 strace==5.10-1 syncd==1.0.0 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 8ad1e44a0704..b993d31f2bff 100644 --- a/files/build/versions/dockers/docker-gbsyncd-credo/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-gbsyncd-credo/versions-deb-bullseye @@ -3,7 +3,7 @@ gdbserver==10.1-1.7 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 +libcurl3-gnutls==7.74.0-1.3+deb11u11 libdebuginfod1==0.183-1 libdw1==0.183-1 libedit2==3.1-20191231-2+b1 @@ -13,15 +13,15 @@ libgpm2==1.20.7-8 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.3 +libsaicredo-owl==0.9.3 libsaimetadata==1.0.0 libsairedis==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 +openssh-client==1:8.4p1-5+deb11u3 sshpass==1.09-1+b1 strace==5.10-1 syncd==1.0.0 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 8f1853a7df3f..cdfa7d2de06d 100644 --- a/files/build/versions/dockers/docker-gbsyncd-vs/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-gbsyncd-vs/versions-deb-bullseye @@ -3,7 +3,7 @@ gdbserver==10.1-1.7 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 +libcurl3-gnutls==7.74.0-1.3+deb11u11 libdebuginfod1==0.183-1 libdw1==0.183-1 libedit2==3.1-20191231-2+b1 @@ -25,7 +25,7 @@ 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 +openssh-client==1:8.4p1-5+deb11u3 sshpass==1.09-1+b1 strace==5.10-1 syncd-vs==1.0.0 diff --git a/files/build/versions/dockers/docker-lldp/versions-deb-bullseye b/files/build/versions/dockers/docker-lldp/versions-deb-bullseye index 818079eab17b..2b79a96d90fa 100644 --- a/files/build/versions/dockers/docker-lldp/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-lldp/versions-deb-bullseye @@ -3,7 +3,7 @@ gdbserver==10.1-1.7 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 +libcurl3-gnutls==7.74.0-1.3+deb11u11 libdebuginfod1==0.183-1 libdw1==0.183-1 libedit2==3.1-20191231-2+b1 @@ -26,7 +26,7 @@ libunwind8==1.3.2-2 libxml2==2.9.10+dfsg-6.7+deb11u4 lldpd==1.0.4-1 lldpd-dbgsym==1.0.4-1 -openssh-client==1:8.4p1-5+deb11u1 +openssh-client==1:8.4p1-5+deb11u3 pci.ids==0.0~2021.02.08-1 sshpass==1.09-1+b1 strace==5.10-1 diff --git a/files/build/versions/dockers/docker-macsec/versions-deb-bullseye b/files/build/versions/dockers/docker-macsec/versions-deb-bullseye index fbdc107c9350..a24cc64c4978 100644 --- a/files/build/versions/dockers/docker-macsec/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-macsec/versions-deb-bullseye @@ -3,7 +3,7 @@ gdbserver==10.1-1.7 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 +libcurl3-gnutls==7.74.0-1.3+deb11u11 libdashapi==1.0.0 libdebuginfod1==0.183-1 libdw1==0.183-1 @@ -25,7 +25,7 @@ libswsscommon-dbgsym==1.0.0 libteam5==1.30-1 libteamdctl0==1.30-1 libunwind8==1.3.2-2 -openssh-client==1:8.4p1-5+deb11u1 +openssh-client==1:8.4p1-5+deb11u3 python3-protobuf==3.21.12-3 sshpass==1.09-1+b1 strace==5.10-1 diff --git a/files/build/versions/dockers/docker-mux/versions-deb-bullseye b/files/build/versions/dockers/docker-mux/versions-deb-bullseye index 36ba316c113e..04ef7009f0b4 100644 --- a/files/build/versions/dockers/docker-mux/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-mux/versions-deb-bullseye @@ -7,7 +7,7 @@ libboost-program-options1.74.0==1.74.0-9 libboost-regex1.74.0==1.74.0-9 libboost-thread1.74.0==1.74.0-9 libcbor0==0.5.0+dfsg-2 -libcurl3-gnutls==7.74.0-1.3+deb11u7 +libcurl3-gnutls==7.74.0-1.3+deb11u11 libdebuginfod1==0.183-1 libdw1==0.183-1 libedit2==3.1-20191231-2+b1 @@ -21,7 +21,7 @@ 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 +openssh-client==1:8.4p1-5+deb11u3 sonic-linkmgrd==1.0.0-1 sonic-linkmgrd-dbgsym==1.0.0-1 sshpass==1.09-1+b1 diff --git a/files/build/versions/dockers/docker-nat/versions-deb-bullseye b/files/build/versions/dockers/docker-nat/versions-deb-bullseye index 02af240b1ff3..ae4e94d4ffde 100644 --- a/files/build/versions/dockers/docker-nat/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-nat/versions-deb-bullseye @@ -6,7 +6,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 +libcurl3-gnutls==7.74.0-1.3+deb11u11 libdebuginfod1==0.183-1 libdw1==0.183-1 libedit2==3.1-20191231-2+b1 @@ -27,7 +27,7 @@ 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 +openssh-client==1:8.4p1-5+deb11u3 sshpass==1.09-1+b1 strace==5.10-1 swss-dbg==1.0.0 diff --git a/files/build/versions/dockers/docker-orchagent/versions-deb-bullseye b/files/build/versions/dockers/docker-orchagent/versions-deb-bullseye index 10a7341b3ac0..fb351d232c97 100644 --- a/files/build/versions/dockers/docker-orchagent/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-orchagent/versions-deb-bullseye @@ -7,7 +7,7 @@ ifupdown==0.8.36 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 +libcurl3-gnutls==7.74.0-1.3+deb11u11 libdebuginfod1==0.183-1 libdw1==0.183-1 libedit2==3.1-20191231-2+b1 @@ -29,7 +29,7 @@ libswsscommon-dbgsym==1.0.0 libunwind8==1.3.2-2 ndisc6==1.0.4-2 ndppd==0.2.5-6 -openssh-client==1:8.4p1-5+deb11u1 +openssh-client==1:8.4p1-5+deb11u3 pci.ids==0.0~2021.02.08-1 pciutils==1:3.7.0-5 sonic-rsyslog-plugin==1.0.0-0 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 2bf0eeb9d473..a05dd9d01124 100644 --- a/files/build/versions/dockers/docker-platform-monitor/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-platform-monitor/versions-deb-bullseye @@ -16,7 +16,7 @@ libbabeltrace1==1.5.8-1+b3 libboost-regex1.74.0==1.74.0-9 libcairo2==1.16.0-5 libcbor0==0.5.0+dfsg-2 -libcurl3-gnutls==7.74.0-1.3+deb11u7 +libcurl3-gnutls==7.74.0-1.3+deb11u11 libdatrie1==0.2.13-1 libdbi1==0.9.0-6 libdebuginfod1==0.183-1 @@ -53,8 +53,8 @@ libswsscommon-dbgsym==1.0.0 libthai-data==0.1.28-3 libthai0==0.1.28-3 libunwind8==1.3.2-2 -libx11-6==2:1.7.2-1+deb11u1 -libx11-data==2:1.7.2-1+deb11u1 +libx11-6==2:1.7.2-1+deb11u2 +libx11-data==2:1.7.2-1+deb11u2 libxau6==1:1.0.9-1 libxcb-render0==1.14-3 libxcb-shm0==1.14-3 @@ -66,7 +66,7 @@ libxrender1==1:0.9.10-1 lm-sensors==1:3.6.0-7 lm-sensors-dbgsym==1:3.6.0-7 mft==4.25.0-62 -openssh-client==1:8.4p1-5+deb11u1 +openssh-client==1:8.4p1-5+deb11u3 pci.ids==0.0~2021.02.08-1 pciutils==1:3.7.0-5 psmisc==23.4-2 diff --git a/files/build/versions/dockers/docker-ptf/versions-deb-buster b/files/build/versions/dockers/docker-ptf/versions-deb-buster index a92e60ea6d96..e3414d16c786 100644 --- a/files/build/versions/dockers/docker-ptf/versions-deb-buster +++ b/files/build/versions/dockers/docker-ptf/versions-deb-buster @@ -18,9 +18,9 @@ cmake-data==3.13.4-1 cpp==4:8.3.0-1 cpp-8==8.3.0-6 cron==3.0pl1-134+deb10u1 -curl==7.64.0-4+deb10u6 -dbus==1.12.24-0+deb10u1 -dbus-user-session==1.12.24-0+deb10u1 +curl==7.64.0-4+deb10u8 +dbus==1.12.28-0+deb10u1 +dbus-user-session==1.12.28-0+deb10u1 dconf-gsettings-backend==0.30.1-2 dconf-service==0.30.1-2 debian-archive-keyring==2019.1+deb10u2 @@ -29,9 +29,9 @@ dirmngr==2.2.12-1+deb10u2 dmsetup==2:1.02.155-3 dpkg-dev==1.19.8 ethtool==1:4.19-1 -exim4-base==4.92-8+deb10u7 -exim4-config==4.92-8+deb10u7 -exim4-daemon-light==4.92-8+deb10u7 +exim4-base==4.92-8+deb10u9 +exim4-config==4.92-8+deb10u9 +exim4-daemon-light==4.92-8+deb10u9 fakeroot==1.23-1 file==1:5.35-4+deb10u2 fontconfig==2.13.1-2 @@ -70,7 +70,7 @@ 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 +krb5-locales==1.17-3+deb10u6 less==487-0.1+b1 libalgorithm-diff-perl==1.19.03-2 libalgorithm-diff-xs-perl==0.04-5+b1 @@ -111,15 +111,15 @@ 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+deb10u8 +libcups2==2.2.10-6+deb10u9 libcupsfilters1==1.21.6-5+deb10u1 -libcupsimage2==2.2.10-6+deb10u8 -libcurl3-gnutls==7.64.0-4+deb10u6 -libcurl4==7.64.0-4+deb10u6 +libcupsimage2==2.2.10-6+deb10u9 +libcurl3-gnutls==7.64.0-4+deb10u8 +libcurl4==7.64.0-4+deb10u8 libdaemon0==0.14-7 libdata-dump-perl==1.23-1 libdatrie1==0.2.12-2 -libdbus-1-3==1.12.24-0+deb10u1 +libdbus-1-3==1.12.28-0+deb10u1 libdconf1==0.30.1-2 libdevmapper1.02.1==2:1.02.155-3 libdouble-conversion1==3.1.0-3 @@ -153,7 +153,7 @@ 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 +libflac8==1.3.2-3+deb10u3 libfont-afm-perl==1.20-2 libfontconfig1==2.13.1-2 libfontenc1==1:1.1.3-1+b2 @@ -172,19 +172,19 @@ libgirepository-1.0-1==1.58.3-2 libgl1==1.1.0-1 libgl1-mesa-dri==18.3.6-2+deb10u1 libglapi-mesa==18.3.6-2+deb10u1 -libglib2.0-0==2.58.3-2+deb10u4 -libglib2.0-data==2.58.3-2+deb10u4 +libglib2.0-0==2.58.3-2+deb10u5 +libglib2.0-data==2.58.3-2+deb10u5 libglvnd0==1.1.0-1 libglx-mesa0==18.3.6-2+deb10u1 libglx0==1.1.0-1 -libgnutls-dane0==3.6.7-4+deb10u10 +libgnutls-dane0==3.6.7-4+deb10u11 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+deb10u8 -libgs9-common==9.27~dfsg-2+deb10u8 -libgssapi-krb5-2==1.17-3+deb10u5 +libgs9==9.27~dfsg-2+deb10u9 +libgs9-common==9.27~dfsg-2+deb10u9 +libgssapi-krb5-2==1.17-3+deb10u6 libgstreamer-plugins-base1.0-0==1.14.4-2+deb10u2 libgstreamer1.0-0==1.14.4-1 libgtk-3-0==3.24.5-1 @@ -232,12 +232,12 @@ 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 +libk5crypto3==1.17-3+deb10u6 libkeyutils1==1.6-6 libkmod2==26-1 libkpathsea6==2018.20181218.49446-1+deb10u2 -libkrb5-3==1.17-3+deb10u5 -libkrb5support0==1.17-3+deb10u5 +libkrb5-3==1.17-3+deb10u6 +libkrb5support0==1.17-3+deb10u6 libksba8==1.3.5-2+deb10u2 liblab-gamut1==2.40.1-6+deb10u1 liblapack3==3.8.0-2 @@ -263,13 +263,13 @@ 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 +libncurses6==6.1+20181013-2+deb10u5 libnet-dbus-perl==1.1.0-5+b1 libnet-http-perl==6.18-1 libnet-smtp-ssl-perl==1.04-1 libnet-ssleay-perl==1.85-2+deb10u1 libnet1==1.1.6+dfsg-3.1 -libnghttp2-14==1.36.0-2+deb10u1 +libnghttp2-14==1.36.0-2+deb10u2 libnl-3-200==3.4.0-1 libnl-cli-3-200==3.4.0-1 libnl-genl-3-200==3.4.0-1 @@ -315,10 +315,10 @@ libpython2.7-minimal==2.7.16-2+deb10u3 libpython2.7-stdlib==2.7.16-2+deb10u3 libpython3-dev==3.7.3-1 libpython3-stdlib==3.7.3-1 -libpython3.7==3.7.3-2+deb10u5 -libpython3.7-dev==3.7.3-2+deb10u5 -libpython3.7-minimal==3.7.3-2+deb10u5 -libpython3.7-stdlib==3.7.3-2+deb10u5 +libpython3.7==3.7.3-2+deb10u6 +libpython3.7-dev==3.7.3-2+deb10u6 +libpython3.7-minimal==3.7.3-2+deb10u6 +libpython3.7-stdlib==3.7.3-2+deb10u6 libqt5core5a==5.11.3+dfsg1-1+deb10u5 libqt5dbus5==5.11.3+dfsg1-1+deb10u5 libqt5gui5==5.11.3+dfsg1-1+deb10u5 @@ -408,10 +408,10 @@ libwscodecs2==2.6.20-0+deb10u7 libwsutil9==2.6.20-0+deb10u7 libwww-perl==6.36-2 libwww-robotrules-perl==6.02-1 -libx11-6==2:1.6.7-1+deb10u3 -libx11-data==2:1.6.7-1+deb10u3 +libx11-6==2:1.6.7-1+deb10u4 +libx11-data==2:1.6.7-1+deb10u4 libx11-protocol-perl==0.56-7 -libx11-xcb1==2:1.6.7-1+deb10u3 +libx11-xcb1==2:1.6.7-1+deb10u4 libxau6==1:1.0.8-1+b2 libxaw7==2:1.0.13-1+b2 libxcb-dri2-0==1.13.1-2 @@ -450,7 +450,7 @@ libxml-xpathengine-perl==0.14-1 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+deb10u1 +libxpm4==1:3.5.12-1+deb10u2 libxrandr2==2:1.5.1-1 libxrender1==1:0.9.10-1 libxshmfence1==1.3-1 @@ -462,7 +462,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.289-2 +linux-libc-dev==4.19.304-1 lmodern==2.004.5-6 logrotate==3.14.0-4 lsb-base==10.2019051400 @@ -472,15 +472,15 @@ make==4.2.1-1.2 manpages==4.16-2 manpages-dev==4.16-2 mime-support==3.62 -ncurses-term==6.1+20181013-2+deb10u3 +ncurses-term==6.1+20181013-2+deb10u5 net-tools==1.60+git20180626.aebd88e-1 netbase==5.6 ntp==1:4.2.8p12+dfsg-4 ntpdate==1:4.2.8p12+dfsg-4 ntpstat==0.0.0.1-2 -openssh-client==1:7.9p1-10+deb10u3 -openssh-server==1:7.9p1-10+deb10u3 -openssh-sftp-server==1:7.9p1-10+deb10u3 +openssh-client==1:7.9p1-10+deb10u4 +openssh-server==1:7.9p1-10+deb10u4 +openssh-sftp-server==1:7.9p1-10+deb10u4 openssl==1.1.1n-0+deb10u6 patch==2.7.6-3+deb10u1 perl==5.28.1-6+deb10u1 @@ -553,10 +553,10 @@ python3-venv==3.7.3-1 python3-wcwidth==0.1.7+dfsg1-3 python3-wheel==0.32.3-2 python3-xdg==0.25-5 -python3.7==3.7.3-2+deb10u5 -python3.7-dev==3.7.3-2+deb10u5 -python3.7-minimal==3.7.3-2+deb10u5 -python3.7-venv==3.7.3-2+deb10u5 +python3.7==3.7.3-2+deb10u6 +python3.7-dev==3.7.3-2+deb10u6 +python3.7-minimal==3.7.3-2+deb10u6 +python3.7-venv==3.7.3-2+deb10u6 qt5-gtk-platformtheme==5.11.3+dfsg1-1+deb10u5 qttranslations5-l10n==5.11.3-2 readline-common==7.0-5 @@ -582,9 +582,9 @@ ttf-bitstream-vera==1.10-8 tzdata==2021a-0+deb10u11 ucf==3.0038+nmu1 unzip==6.0-23+deb10u3 -vim==2:8.1.0875-5+deb10u5 -vim-common==2:8.1.0875-5+deb10u5 -vim-runtime==2:8.1.0875-5+deb10u5 +vim==2:8.1.0875-5+deb10u6 +vim-common==2:8.1.0875-5+deb10u6 +vim-runtime==2:8.1.0875-5+deb10u6 wget==1.20.1-1.1 wireshark==2.6.20-0+deb10u7 wireshark-common==2.6.20-0+deb10u7 @@ -598,5 +598,5 @@ 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+deb10u5 +xxd==2:8.1.0875-5+deb10u6 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 ec8711ee9e61..c96c2d625623 100644 --- a/files/build/versions/dockers/docker-router-advertiser/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-router-advertiser/versions-deb-bullseye @@ -3,7 +3,7 @@ gdbserver==10.1-1.7 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 +libcurl3-gnutls==7.74.0-1.3+deb11u11 libdebuginfod1==0.183-1 libdw1==0.183-1 libedit2==3.1-20191231-2+b1 @@ -17,7 +17,7 @@ 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 +openssh-client==1:8.4p1-5+deb11u3 radvd==1:2.18-3 sshpass==1.09-1+b1 strace==5.10-1 diff --git a/files/build/versions/dockers/docker-sflow/versions-deb-bullseye b/files/build/versions/dockers/docker-sflow/versions-deb-bullseye index f3a28bc7544d..889af0d45430 100644 --- a/files/build/versions/dockers/docker-sflow/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-sflow/versions-deb-bullseye @@ -6,7 +6,7 @@ hsflowd-dbg==2.0.51-26 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 +libcurl3-gnutls==7.74.0-1.3+deb11u11 libdebuginfod1==0.183-1 libdw1==0.183-1 libedit2==3.1-20191231-2+b1 @@ -20,7 +20,7 @@ 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 +openssh-client==1:8.4p1-5+deb11u3 psample==1.1-1 sflowtool==5.04 sshpass==1.09-1+b1 diff --git a/files/build/versions/dockers/docker-snmp/versions-deb-bullseye b/files/build/versions/dockers/docker-snmp/versions-deb-bullseye index f69b91d05392..02097494e3e4 100644 --- a/files/build/versions/dockers/docker-snmp/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-snmp/versions-deb-bullseye @@ -4,9 +4,9 @@ gdbserver==10.1-1.7 ipmitool==1.8.18-10.1 libbabeltrace1==1.5.8-1+b3 libboost-regex1.74.0==1.74.0-9 -libc-l10n==2.31-13+deb11u6 +libc-l10n==2.31-13+deb11u7 libcbor0==0.5.0+dfsg-2 -libcurl3-gnutls==7.74.0-1.3+deb11u7 +libcurl3-gnutls==7.74.0-1.3+deb11u11 libdebuginfod1==0.183-1 libdw1==0.183-1 libedit2==3.1-20191231-2+b1 @@ -27,8 +27,8 @@ libsource-highlight-common==3.1.9-3 libsource-highlight4v5==3.1.9-3+b1 libswsscommon-dbgsym==1.0.0 libunwind8==1.3.2-2 -locales==2.31-13+deb11u6 -openssh-client==1:8.4p1-5+deb11u1 +locales==2.31-13+deb11u7 +openssh-client==1:8.4p1-5+deb11u3 pci.ids==0.0~2021.02.08-1 snmp==5.9+dfsg-4+deb11u1 snmp-dbgsym==5.9+dfsg-4+deb11u1 diff --git a/files/build/versions/dockers/docker-sonic-gnmi/versions-deb-bullseye b/files/build/versions/dockers/docker-sonic-gnmi/versions-deb-bullseye new file mode 100644 index 000000000000..33c2b2450252 --- /dev/null +++ b/files/build/versions/dockers/docker-sonic-gnmi/versions-deb-bullseye @@ -0,0 +1,26 @@ +gdb==10.1-1.7 +gdbserver==10.1-1.7 +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+deb11u11 +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 +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+deb11u3 +sonic-gnmi==0.1 +sonic-mgmt-common==1.0.0 +sshpass==1.09-1+b1 +strace==5.10-1 +vim==2:8.2.2434-3+deb11u1 +vim-runtime==2:8.2.2434-3+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 cbe12c5c3d65..989ddfd32b5b 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 @@ -2,13 +2,12 @@ gdb==8.2.1-2+b3 gdbserver==8.2.1-2+b3 libbabeltrace1==1.5.6-2+deb10u1 libbsd0==0.9.1-2+deb10u1 -libcjson-dev==1.7.10-1.1+deb10u1 -libcjson1==1.7.10-1.1+deb10u1 -libcurl3-gnutls==7.64.0-4+deb10u6 +libcjson-dev==1.7.10-1.1+deb10u2 +libcjson1==1.7.10-1.1+deb10u2 +libcurl3-gnutls==7.64.0-4+deb10u8 libdw1==0.176-1.1+deb10u1 libedit2==3.1-20181209-1 -libelf1==0.176-1.1+deb10u1 -libglib2.0-0==2.58.3-2+deb10u4 +libglib2.0-0==2.58.3-2+deb10u5 libgpm2==1.20.7-5 libicu63==63.1-6+deb10u3 libipt2==2.0-2 @@ -16,11 +15,11 @@ libpopt0==1.16-12 libswsscommon-dbgsym==1.0.0 libunwind8==1.2.1-10~deb10u1 libxml2==2.9.4+dfsg1-7+deb10u6 -openssh-client==1:7.9p1-10+deb10u3 +openssh-client==1:7.9p1-10+deb10u4 sonic-mgmt-common==1.0.0 sonic-mgmt-framework==1.0-01 sonic-mgmt-framework-dbg==1.0-01 sshpass==1.06-1 strace==4.26-0.2 -vim==2:8.1.0875-5+deb10u5 -vim-runtime==2:8.1.0875-5+deb10u5 +vim==2:8.1.0875-5+deb10u6 +vim-runtime==2:8.1.0875-5+deb10u6 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 12fb10c37611..683c92343d54 100644 --- a/files/build/versions/dockers/docker-sonic-vs/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-sonic-vs/versions-deb-bullseye @@ -5,7 +5,7 @@ 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 +dbus==1.12.28-0+deb11u1 dirmngr==2.2.27-2+deb11u2 dmsetup==2:1.02.175-2.1 ethtool==1:5.9-1 @@ -25,20 +25,20 @@ 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 +grub-common==2.06-3~deb11u6 +grub2-common==2.06-3~deb11u6 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 +krb5-multidev==1.18.3-6+deb11u4 libapparmor1==2.13.6-10 libassuan0==2.5.3-7.1 libblkid-dev==2.36.1-8+deb11u1 -libbsd-dev==0.11.3-1 +libbsd-dev==0.11.3-1+deb11u1 libc-ares2==1.17.1-1+deb11u3 -libc-dev-bin==2.31-13+deb11u6 -libc6-dev==2.31-13+deb11u6 +libc-dev-bin==2.31-13+deb11u7 +libc6-dev==2.31-13+deb11u7 libcbor0==0.5.0+dfsg-2 libcrypt-dev==1:4.4.18-4 libdevmapper1.02.1==2:1.02.175-2.1 @@ -53,7 +53,7 @@ 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 +libgssrpc4==1.18.3-6+deb11u4 libicu-dev==67.1-7 libicu67==67.1-7 libip4tc2==1.8.7-1 @@ -62,11 +62,11 @@ libjs-sphinxdoc==3.4.3-2 libjs-underscore==1.9.1~dfsg-3 libjson-c5==0.15-2+deb11u1 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 +libk5crypto3==1.18.3-6+deb11u4 +libkadm5clnt-mit12==1.18.3-6+deb11u4 +libkadm5srv-mit12==1.18.3-6+deb11u4 +libkdb5-10==1.18.3-6+deb11u4 +libkrb5-dev==1.18.3-6+deb11u4 libksba8==1.5.0-3+deb11u2 libmd-dev==1.0.3-3 libnet1==1.1.6+dfsg-3.1 @@ -82,14 +82,14 @@ 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 +libpython2.7-minimal==2.7.18-8+deb11u1 +libpython2.7-stdlib==2.7.18-8+deb11u1 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 -libssl1.1==1.1.1n-0+deb11u5 +libssl1.1==1.1.1w-0+deb11u1 libsystemd0==247.3-7+deb11u2 libteam-utils==1.30-1 libtirpc-dev==1.3.1-1+deb11u1 @@ -98,24 +98,24 @@ 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.191-1 -logrotate==3.18.0-2+deb11u1 +linux-libc-dev==5.10.205-2 +logrotate==3.18.0-2+deb11u2 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 -openssl==1.1.1n-0+deb11u5 +openssh-client==1:8.4p1-5+deb11u3 +openssh-server==1:8.4p1-5+deb11u3 +openssh-sftp-server==1:8.4p1-5+deb11u3 +openssl==1.1.1w-0+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 +python2.7==2.7.18-8+deb11u1 +python2.7-minimal==2.7.18-8+deb11u1 python3-scapy==2.4.4-4 redis-server==5:6.0.16-1+deb11u2 runit-helper==2.10.3 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 dd0e740c7776..053ffe835326 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 @@ -15,14 +15,14 @@ libarchive13==3.4.3-2+deb11u1 libasan6==10.2.1-6 libbinutils==2.35.2-2 libboost-atomic1.74.0==1.74.0-9 -libc-dev-bin==2.31-13+deb11u6 -libc6-dev==2.31-13+deb11u6 +libc-dev-bin==2.31-13+deb11u7 +libc6-dev==2.31-13+deb11u7 libcc1-0==10.2.1-6 libcrypt-dev==1:4.4.18-4 libctf-nobfd0==2.35.2-2 libctf0==2.35.2-2 libdouble-conversion3==3.1.5-6.1 -libdpkg-perl==1.20.12 +libdpkg-perl==1.20.13 libexpat1-dev==2.2.10-2+deb11u5 libffi-dev==3.3-6 libgcc-10-dev==10.2.1-6 @@ -39,17 +39,17 @@ libnsl-dev==1.3.0-2 libpcre2-16-0==10.36-2+deb11u1 libpython2-dev==2.7.18-3 libpython2-stdlib==2.7.18-3 -libpython2.7==2.7.18-8 -libpython2.7-dev==2.7.18-8 -libpython2.7-minimal==2.7.18-8 -libpython2.7-stdlib==2.7.18-8 +libpython2.7==2.7.18-8+deb11u1 +libpython2.7-dev==2.7.18-8+deb11u1 +libpython2.7-minimal==2.7.18-8+deb11u1 +libpython2.7-stdlib==2.7.18-8+deb11u1 libqt5core5a==5.15.2+dfsg-9 libqt5dbus5==5.15.2+dfsg-9 libqt5network5==5.15.2+dfsg-9 libquadmath0==10.2.1-6 librhash0==1.4.1-2 -libssl-dev==1.1.1n-0+deb11u5 -libssl1.1==1.1.1n-0+deb11u5 +libssl-dev==1.1.1w-0+deb11u1 +libssl1.1==1.1.1w-0+deb11u1 libstdc++-10-dev==10.2.1-6 libthrift-0.11.0==0.11.0-4 libtirpc-dev==1.3.1-1+deb11u1 @@ -57,7 +57,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.191-1 +linux-libc-dev==5.10.205-2 mailcap==3.69 make==4.3-4.1 mime-support==3.66 @@ -70,9 +70,9 @@ python-setuptools==44.1.1-1 python2==2.7.18-3 python2-dev==2.7.18-3 python2-minimal==2.7.18-3 -python2.7==2.7.18-8 -python2.7-dev==2.7.18-8 -python2.7-minimal==2.7.18-8 +python2.7==2.7.18-8+deb11u1 +python2.7-dev==2.7.18-8+deb11u1 +python2.7-minimal==2.7.18-8+deb11u1 python3-pip==20.3.4-4+deb11u1 python3-pkg-resources==52.0.0-4 python3-setuptools==52.0.0-4 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 3d584faa7afd..1b0765aa1d78 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 @@ -5,7 +5,7 @@ kmod==28-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 +libcurl3-gnutls==7.74.0-1.3+deb11u11 libdebuginfod1==0.183-1 libdw1==0.183-1 libedit2==3.1-20191231-2+b1 @@ -22,7 +22,7 @@ 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 +openssh-client==1:8.4p1-5+deb11u3 sshpass==1.09-1+b1 strace==5.10-1 syncd==1.0.0 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 dd0e740c7776..053ffe835326 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 @@ -15,14 +15,14 @@ libarchive13==3.4.3-2+deb11u1 libasan6==10.2.1-6 libbinutils==2.35.2-2 libboost-atomic1.74.0==1.74.0-9 -libc-dev-bin==2.31-13+deb11u6 -libc6-dev==2.31-13+deb11u6 +libc-dev-bin==2.31-13+deb11u7 +libc6-dev==2.31-13+deb11u7 libcc1-0==10.2.1-6 libcrypt-dev==1:4.4.18-4 libctf-nobfd0==2.35.2-2 libctf0==2.35.2-2 libdouble-conversion3==3.1.5-6.1 -libdpkg-perl==1.20.12 +libdpkg-perl==1.20.13 libexpat1-dev==2.2.10-2+deb11u5 libffi-dev==3.3-6 libgcc-10-dev==10.2.1-6 @@ -39,17 +39,17 @@ libnsl-dev==1.3.0-2 libpcre2-16-0==10.36-2+deb11u1 libpython2-dev==2.7.18-3 libpython2-stdlib==2.7.18-3 -libpython2.7==2.7.18-8 -libpython2.7-dev==2.7.18-8 -libpython2.7-minimal==2.7.18-8 -libpython2.7-stdlib==2.7.18-8 +libpython2.7==2.7.18-8+deb11u1 +libpython2.7-dev==2.7.18-8+deb11u1 +libpython2.7-minimal==2.7.18-8+deb11u1 +libpython2.7-stdlib==2.7.18-8+deb11u1 libqt5core5a==5.15.2+dfsg-9 libqt5dbus5==5.15.2+dfsg-9 libqt5network5==5.15.2+dfsg-9 libquadmath0==10.2.1-6 librhash0==1.4.1-2 -libssl-dev==1.1.1n-0+deb11u5 -libssl1.1==1.1.1n-0+deb11u5 +libssl-dev==1.1.1w-0+deb11u1 +libssl1.1==1.1.1w-0+deb11u1 libstdc++-10-dev==10.2.1-6 libthrift-0.11.0==0.11.0-4 libtirpc-dev==1.3.1-1+deb11u1 @@ -57,7 +57,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.191-1 +linux-libc-dev==5.10.205-2 mailcap==3.69 make==4.3-4.1 mime-support==3.66 @@ -70,9 +70,9 @@ python-setuptools==44.1.1-1 python2==2.7.18-3 python2-dev==2.7.18-3 python2-minimal==2.7.18-3 -python2.7==2.7.18-8 -python2.7-dev==2.7.18-8 -python2.7-minimal==2.7.18-8 +python2.7==2.7.18-8+deb11u1 +python2.7-dev==2.7.18-8+deb11u1 +python2.7-minimal==2.7.18-8+deb11u1 python3-pip==20.3.4-4+deb11u1 python3-pkg-resources==52.0.0-4 python3-setuptools==52.0.0-4 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 9a055aa7e096..1dd59320fbf9 100644 --- a/files/build/versions/dockers/docker-syncd-brcm/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-brcm/versions-deb-bullseye @@ -5,7 +5,7 @@ kmod==28-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 +libcurl3-gnutls==7.74.0-1.3+deb11u11 libdebuginfod1==0.183-1 libdw1==0.183-1 libedit2==3.1-20191231-2+b1 @@ -23,7 +23,8 @@ libsource-highlight4v5==3.1.9-3+b1 libswsscommon-dbgsym==1.0.0 libunwind8==1.3.2-2 libyaml-0-2==0.2.2-1 -openssh-client==1:8.4p1-5+deb11u1 +lz4==1.9.3-2 +openssh-client==1:8.4p1-5+deb11u3 sshpass==1.09-1+b1 strace==5.10-1 syncd==1.0.0 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 dd0e740c7776..053ffe835326 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 @@ -15,14 +15,14 @@ libarchive13==3.4.3-2+deb11u1 libasan6==10.2.1-6 libbinutils==2.35.2-2 libboost-atomic1.74.0==1.74.0-9 -libc-dev-bin==2.31-13+deb11u6 -libc6-dev==2.31-13+deb11u6 +libc-dev-bin==2.31-13+deb11u7 +libc6-dev==2.31-13+deb11u7 libcc1-0==10.2.1-6 libcrypt-dev==1:4.4.18-4 libctf-nobfd0==2.35.2-2 libctf0==2.35.2-2 libdouble-conversion3==3.1.5-6.1 -libdpkg-perl==1.20.12 +libdpkg-perl==1.20.13 libexpat1-dev==2.2.10-2+deb11u5 libffi-dev==3.3-6 libgcc-10-dev==10.2.1-6 @@ -39,17 +39,17 @@ libnsl-dev==1.3.0-2 libpcre2-16-0==10.36-2+deb11u1 libpython2-dev==2.7.18-3 libpython2-stdlib==2.7.18-3 -libpython2.7==2.7.18-8 -libpython2.7-dev==2.7.18-8 -libpython2.7-minimal==2.7.18-8 -libpython2.7-stdlib==2.7.18-8 +libpython2.7==2.7.18-8+deb11u1 +libpython2.7-dev==2.7.18-8+deb11u1 +libpython2.7-minimal==2.7.18-8+deb11u1 +libpython2.7-stdlib==2.7.18-8+deb11u1 libqt5core5a==5.15.2+dfsg-9 libqt5dbus5==5.15.2+dfsg-9 libqt5network5==5.15.2+dfsg-9 libquadmath0==10.2.1-6 librhash0==1.4.1-2 -libssl-dev==1.1.1n-0+deb11u5 -libssl1.1==1.1.1n-0+deb11u5 +libssl-dev==1.1.1w-0+deb11u1 +libssl1.1==1.1.1w-0+deb11u1 libstdc++-10-dev==10.2.1-6 libthrift-0.11.0==0.11.0-4 libtirpc-dev==1.3.1-1+deb11u1 @@ -57,7 +57,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.191-1 +linux-libc-dev==5.10.205-2 mailcap==3.69 make==4.3-4.1 mime-support==3.66 @@ -70,9 +70,9 @@ python-setuptools==44.1.1-1 python2==2.7.18-3 python2-dev==2.7.18-3 python2-minimal==2.7.18-3 -python2.7==2.7.18-8 -python2.7-dev==2.7.18-8 -python2.7-minimal==2.7.18-8 +python2.7==2.7.18-8+deb11u1 +python2.7-dev==2.7.18-8+deb11u1 +python2.7-minimal==2.7.18-8+deb11u1 python3-pip==20.3.4-4+deb11u1 python3-pkg-resources==52.0.0-4 python3-setuptools==52.0.0-4 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 77d75ecaad09..f28efa949102 100644 --- a/files/build/versions/dockers/docker-syncd-centec/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-centec/versions-deb-bullseye @@ -4,7 +4,7 @@ kmod==28-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 +libcurl3-gnutls==7.74.0-1.3+deb11u11 libdebuginfod1==0.183-1 libdw1==0.183-1 libedit2==3.1-20191231-2+b1 @@ -16,7 +16,7 @@ libicu67==67.1-7 libipt2==2.0.3-1 libkmod2==28-1 libmpfr6==4.1.0-3 -libsai==1.12.0-1 +libsai==1.13.0-1 libsaimetadata==1.0.0 libsairedis==1.0.0 libsource-highlight-common==3.1.9-3 @@ -24,7 +24,7 @@ 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 +openssh-client==1:8.4p1-5+deb11u3 sshpass==1.09-1+b1 strace==5.10-1 syncd==1.0.0 diff --git a/files/build/versions/dockers/docker-syncd-centec/versions-deb-bullseye-arm64 b/files/build/versions/dockers/docker-syncd-centec/versions-deb-bullseye-arm64 index 0af33189fd01..27985507a3f6 100644 --- a/files/build/versions/dockers/docker-syncd-centec/versions-deb-bullseye-arm64 +++ b/files/build/versions/dockers/docker-syncd-centec/versions-deb-bullseye-arm64 @@ -1,9 +1,9 @@ dmsetup==2:1.02.175-2.1 iputils-ping==3:20210202-1 keyutils==1.6.1-2 -libdbus-1-dev==1.12.24-0+deb11u1 +libdbus-1-dev==1.12.28-0+deb11u1 libdevmapper1.02.1==2:1.02.175-2.1 -libdpkg-perl==1.20.12 +libdpkg-perl==1.20.13 libevent-2.1-7==2.1.12-stable-1 libexpat1-dev==2.2.10-2+deb11u5 libnfsidmap2==0.25-6 @@ -12,10 +12,10 @@ libpcap0.8==1.10.0-2 libpcap0.8-dev==1.10.0-2 libpython2-dev==2.7.18-3 libpython2-stdlib==2.7.18-3 -libpython2.7==2.7.18-8 -libpython2.7-dev==2.7.18-8 -libpython2.7-minimal==2.7.18-8 -libpython2.7-stdlib==2.7.18-8 +libpython2.7==2.7.18-8+deb11u1 +libpython2.7-dev==2.7.18-8+deb11u1 +libpython2.7-minimal==2.7.18-8+deb11u1 +libpython2.7-stdlib==2.7.18-8+deb11u1 libsensors-config==1:3.6.0-7 libsensors-dev==1:3.6.0-7 libsensors4-dev==1:3.6.0-7 @@ -29,9 +29,9 @@ python-is-python2==2.7.18-9 python2==2.7.18-3 python2-dev==2.7.18-3 python2-minimal==2.7.18-3 -python2.7==2.7.18-8 -python2.7-dev==2.7.18-8 -python2.7-minimal==2.7.18-8 +python2.7==2.7.18-8+deb11u1 +python2.7-dev==2.7.18-8+deb11u1 +python2.7-minimal==2.7.18-8+deb11u1 rpcbind==1.2.5-9 sensible-utils==0.0.14 swig==4.0.2-1 diff --git a/files/build/versions/dockers/docker-syncd-mlnx-rpc/versions-deb-bullseye b/files/build/versions/dockers/docker-syncd-mlnx-rpc/versions-deb-bullseye index 3b532413c330..6bced6505e64 100644 --- a/files/build/versions/dockers/docker-syncd-mlnx-rpc/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-mlnx-rpc/versions-deb-bullseye @@ -19,7 +19,7 @@ libcc1-0==10.2.1-6 libctf-nobfd0==2.35.2-2 libctf0==2.35.2-2 libdouble-conversion3==3.1.5-6.1 -libdpkg-perl==1.20.12 +libdpkg-perl==1.20.13 libffi-dev==3.3-6 libgcc-10-dev==10.2.1-6 libglib2.0-0==2.66.8-1 @@ -33,17 +33,17 @@ libmpfr6==4.1.0-3 libpcre2-16-0==10.36-2+deb11u1 libpython2-dev==2.7.18-3 libpython2-stdlib==2.7.18-3 -libpython2.7==2.7.18-8 -libpython2.7-dev==2.7.18-8 -libpython2.7-minimal==2.7.18-8 -libpython2.7-stdlib==2.7.18-8 +libpython2.7==2.7.18-8+deb11u1 +libpython2.7-dev==2.7.18-8+deb11u1 +libpython2.7-minimal==2.7.18-8+deb11u1 +libpython2.7-stdlib==2.7.18-8+deb11u1 libqt5core5a==5.15.2+dfsg-9 libqt5dbus5==5.15.2+dfsg-9 libqt5network5==5.15.2+dfsg-9 libquadmath0==10.2.1-6 librhash0==1.4.1-2 -libssl-dev==1.1.1n-0+deb11u5 -libssl1.1==1.1.1n-0+deb11u5 +libssl-dev==1.1.1w-0+deb11u1 +libssl1.1==1.1.1w-0+deb11u1 libstdc++-10-dev==10.2.1-6 libthrift-0.11.0==0.11.0-4 libtsan0==10.2.1-6 @@ -62,9 +62,9 @@ python-setuptools==44.1.1-1 python2==2.7.18-3 python2-dev==2.7.18-3 python2-minimal==2.7.18-3 -python2.7==2.7.18-8 -python2.7-dev==2.7.18-8 -python2.7-minimal==2.7.18-8 +python2.7==2.7.18-8+deb11u1 +python2.7-dev==2.7.18-8+deb11u1 +python2.7-minimal==2.7.18-8+deb11u1 shared-mime-info==2.0-1 syncd-rpc==1.0.0 wget==1.21-1+deb11u1 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 2bc77a61dc98..5e5360e9918a 100644 --- a/files/build/versions/dockers/docker-syncd-mlnx/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-mlnx/versions-deb-bullseye @@ -7,11 +7,11 @@ iproute2-dev==1.mlnx.4.5.4206 iproute2-mlnx==5.10.0-4~bpo10+1 libbabeltrace1==1.5.8-1+b3 libboost-regex1.74.0==1.74.0-9 -libc-dev-bin==2.31-13+deb11u6 -libc6-dev==2.31-13+deb11u6 +libc-dev-bin==2.31-13+deb11u7 +libc6-dev==2.31-13+deb11u7 libcbor0==0.5.0+dfsg-2 libcrypt-dev==1:4.4.18-4 -libcurl3-gnutls==7.74.0-1.3+deb11u7 +libcurl3-gnutls==7.74.0-1.3+deb11u11 libdebuginfod1==0.183-1 libdw1==0.183-1 libedit2==3.1-20191231-2+b1 @@ -40,11 +40,11 @@ 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.191-1 +linux-libc-dev==5.10.205-2 mft==4.25.0-62 mft-fwtrace-cfg==1.0.0 mlnx-sai==1.mlnx.SAIBuild2211.25.1.4 -openssh-client==1:8.4p1-5+deb11u1 +openssh-client==1:8.4p1-5+deb11u3 python-pip-whl==20.3.4-4+deb11u1 python-sdk-api==1.mlnx.4.6.1062 python3-attr==20.3.0-1 diff --git a/files/build/versions/dockers/docker-syncd-mrvl/versions-deb-bullseye-armhf b/files/build/versions/dockers/docker-syncd-mrvl/versions-deb-bullseye-armhf index c95d0e6787b3..50830ad960ec 100644 --- a/files/build/versions/dockers/docker-syncd-mrvl/versions-deb-bullseye-armhf +++ b/files/build/versions/dockers/docker-syncd-mrvl/versions-deb-bullseye-armhf @@ -1,9 +1,9 @@ dmsetup==2:1.02.175-2.1 iputils-ping==3:20210202-1 keyutils==1.6.1-2 -libdbus-1-dev==1.12.24-0+deb11u1 +libdbus-1-dev==1.12.28-0+deb11u1 libdevmapper1.02.1==2:1.02.175-2.1 -libdpkg-perl==1.20.12 +libdpkg-perl==1.20.13 libevent-2.1-7==2.1.12-stable-1 libexpat1-dev==2.2.10-2+deb11u5 libglib2.0-0==2.66.8-1 @@ -13,10 +13,10 @@ libpcap0.8==1.10.0-2 libpcap0.8-dev==1.10.0-2 libpython2-dev==2.7.18-3 libpython2-stdlib==2.7.18-3 -libpython2.7==2.7.18-8 -libpython2.7-dev==2.7.18-8 -libpython2.7-minimal==2.7.18-8 -libpython2.7-stdlib==2.7.18-8 +libpython2.7==2.7.18-8+deb11u1 +libpython2.7-dev==2.7.18-8+deb11u1 +libpython2.7-minimal==2.7.18-8+deb11u1 +libpython2.7-stdlib==2.7.18-8+deb11u1 libsaimetadata==1.0.0 libsairedis==1.0.0 libsensors-config==1:3.6.0-7 @@ -33,9 +33,9 @@ python-is-python2==2.7.18-9 python2==2.7.18-3 python2-dev==2.7.18-3 python2-minimal==2.7.18-3 -python2.7==2.7.18-8 -python2.7-dev==2.7.18-8 -python2.7-minimal==2.7.18-8 +python2.7==2.7.18-8+deb11u1 +python2.7-dev==2.7.18-8+deb11u1 +python2.7-minimal==2.7.18-8+deb11u1 rpcbind==1.2.5-9 sensible-utils==0.0.14 swig==4.0.2-1 diff --git a/files/build/versions/dockers/docker-syncd-vs/versions-deb-bullseye b/files/build/versions/dockers/docker-syncd-vs/versions-deb-bullseye index 5491e98c301b..526f470f7e22 100644 --- a/files/build/versions/dockers/docker-syncd-vs/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-vs/versions-deb-bullseye @@ -4,7 +4,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 +libcurl3-gnutls==7.74.0-1.3+deb11u11 libdebuginfod1==0.183-1 libdw1==0.183-1 libedit2==3.1-20191231-2+b1 @@ -25,7 +25,7 @@ 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 +openssh-client==1:8.4p1-5+deb11u3 sshpass==1.09-1+b1 strace==5.10-1 syncd-vs==1.0.0 diff --git a/files/build/versions/dockers/docker-teamd/versions-deb-bullseye b/files/build/versions/dockers/docker-teamd/versions-deb-bullseye index 6133080b93fc..7b97b16842d9 100644 --- a/files/build/versions/dockers/docker-teamd/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-teamd/versions-deb-bullseye @@ -3,7 +3,7 @@ gdbserver==10.1-1.7 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 +libcurl3-gnutls==7.74.0-1.3+deb11u11 libdebuginfod1==0.183-1 libdw1==0.183-1 libedit2==3.1-20191231-2+b1 @@ -20,7 +20,7 @@ libteam-utils==1.30-1 libteam-utils-dbgsym==1.30-1 libteamdctl0-dbgsym==1.30-1 libunwind8==1.3.2-2 -openssh-client==1:8.4p1-5+deb11u1 +openssh-client==1:8.4p1-5+deb11u3 sshpass==1.09-1+b1 strace==5.10-1 swss-dbg==1.0.0 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 aa14b0634bc6..4f74fdd5a516 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye @@ -53,16 +53,16 @@ comerr-dev==2.1-1.46.2-2 containerd.io==1.6.21-1 cowbuilder==0.89 cowdancer==0.89 -cpio==2.13+dfsg-4 +cpio==2.13+dfsg-7.1~deb11u1 cpp==4:10.2.1-1 cpp-10==10.2.1-6 cppcheck==2.3-1 cron==3.0pl1-137 -curl==7.74.0-1.3+deb11u7 +curl==7.74.0-1.3+deb11u11 dblatex==0.3.12py3-1 dblatex-doc==0.3.12py3-1 -dbus==1.12.24-0+deb11u1 -dbus-user-session==1.12.24-0+deb11u1 +dbus==1.12.28-0+deb11u1 +dbus-user-session==1.12.28-0+deb11u1 dconf-gsettings-backend==0.38.0-2 dconf-service==0.38.0-2 dctrl-tools==2.24-3+b1 @@ -87,7 +87,7 @@ dh-strip-nondeterminism==1.12.0-1 dictionaries-common==1.28.4 diffstat==1.64-1 dirmngr==2.2.27-2+deb11u2 -distro-info-data==0.51+deb11u3 +distro-info-data==0.51+deb11u4 dkms==2.8.4-3 dmeventd==2:1.02.175-2.1 dmsetup==2:1.02.175-2.1 @@ -101,13 +101,13 @@ docbook-xsl==1.79.2+dfsg-1 docker-buildx-plugin==0.10.5-1~debian.11~bullseye docker-ce==5:24.0.2-1~debian.11~bullseye docker-ce-cli==5:24.0.2-1~debian.11~bullseye -docker-ce-rootless-extras==5:24.0.6-1~debian.11~bullseye +docker-ce-rootless-extras==5:25.0.1-1~debian.11~bullseye docker-compose-plugin==2.18.1-1~debian.11~bullseye docutils-common==0.16+dfsg-4 dosfstools==4.2-1 doxygen==1.9.1-1 dpatch==2.0.41 -dpkg-dev==1.20.12 +dpkg-dev==1.20.13 dput==1.1.0 dvipng==1.15-1.1+b1 dvisvgm==2.11.1-1 @@ -121,9 +121,9 @@ emacs-el==1:27.1+1-3.1+deb11u2 emacs-nox==1:27.1+1-3.1+deb11u2 emacsen-common==3.0.4 equivs==2.3.1 -exim4-base==4.94.2-7 -exim4-config==4.94.2-7 -exim4-daemon-light==4.94.2-7 +exim4-base==4.94.2-7+deb11u2 +exim4-config==4.94.2-7+deb11u2 +exim4-daemon-light==4.94.2-7+deb11u2 expat==2.2.10-2+deb11u5 fakeroot==1.25.3-1.1 file==1:5.39-3+deb11u1 @@ -155,7 +155,7 @@ gem2deb==1.4 gem2deb-test-runner==1.4 gettext==0.21-4 gettext-base==0.21-4 -ghostscript==9.53.3~dfsg-7+deb11u5 +ghostscript==9.53.3~dfsg-7+deb11u6 gir1.2-atk-1.0==2.36.0-2 gir1.2-atspi-2.0==2.38.0-4+deb11u1 gir1.2-freedesktop==1.66.1-1+b1 @@ -222,7 +222,7 @@ jq==1.6-2.1 junit5==5.3.2-4 kernel-wedge==2.104 kmod==28-1 -krb5-multidev==1.18.3-6+deb11u3 +krb5-multidev==1.18.3-6+deb11u4 lcov==1.14-2 less==551-2 lib32asan6==10.2.1-6 @@ -300,12 +300,12 @@ libb-hooks-endofscope-perl==0.24-1.1 libb-hooks-op-check-perl==0.22-1+b3 libbabeltrace-dev==1.5.8-1+b3 libbabeltrace1==1.5.8-1+b3 -libbatik-java==1.12-4+deb11u1 +libbatik-java==1.12-4+deb11u2 libbdplus0==0.1.2-3 libbind-export-dev==1:9.11.19+dfsg-2.1 libbinutils==2.35.2-2 libbit-vector-perl==7.4-1+b7 -libblas3==3.9.0-3 +libblas3==3.9.0-3+deb11u1 libblkid-dev==2.36.1-8+deb11u1 libbluray2==1:1.2.1-4+deb11u2 libboost-atomic-dev==1.74.0.3 @@ -366,21 +366,21 @@ libbrlapi0.8==6.3+dfsg-1+deb11u1 libbrotli-dev==1.0.9-2+b2 libbrotli1==1.0.9-2+b2 libbs2b0==3.1.0+dfsg-2.2+b1 -libbsd-dev==0.11.3-1 -libbsd0==0.11.3-1 +libbsd-dev==0.11.3-1+deb11u1 +libbsd0==0.11.3-1+deb11u1 libbsh-java==2.0b4-20 libbz2-dev==1.0.8-4 libc-ares-dev==1.17.1-1+deb11u3 libc-ares2==1.17.1-1+deb11u3 -libc-dev-bin==2.31-13+deb11u6 -libc-devtools==2.31-13+deb11u6 -libc-l10n==2.31-13+deb11u6 -libc6-dbg==2.31-13+deb11u6 -libc6-dev==2.31-13+deb11u6 -libc6-dev-i386==2.31-13+deb11u6 -libc6-dev-x32==2.31-13+deb11u6 -libc6-i386==2.31-13+deb11u6 -libc6-x32==2.31-13+deb11u6 +libc-dev-bin==2.31-13+deb11u7 +libc-devtools==2.31-13+deb11u7 +libc-l10n==2.31-13+deb11u7 +libc6-dbg==2.31-13+deb11u7 +libc6-dev==2.31-13+deb11u7 +libc6-dev-i386==2.31-13+deb11u7 +libc6-dev-x32==2.31-13+deb11u7 +libc6-i386==2.31-13+deb11u7 +libc6-x32==2.31-13+deb11u7 libcaca0==0.99.beta19-2.2 libcacard0==1:2.8.0-3 libcairo-gobject2==1.16.0-5 @@ -448,10 +448,10 @@ libctf-nobfd0==2.35.2-2 libctf0==2.35.2-2 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 -libcurl4==7.74.0-1.3+deb11u7 -libcurl4-openssl-dev==7.74.0-1.3+deb11u7 +libcups2==2.3.3op2-3+deb11u6 +libcurl3-gnutls==7.74.0-1.3+deb11u11 +libcurl4==7.74.0-1.3+deb11u11 +libcurl4-openssl-dev==7.74.0-1.3+deb11u11 libdaemon-dev==0.14-7.1 libdaemon0==0.14-7.1 libdata-dpath-perl==0.58-1 @@ -466,8 +466,8 @@ libdaxctl1==71.1-1 libdb-dev==5.3.1+nmu1 libdb5.3-dev==5.3.28+dfsg1-0.8 libdbi1==0.9.0-6 -libdbus-1-3==1.12.24-0+deb11u1 -libdbus-1-dev==1.12.24-0+deb11u1 +libdbus-1-3==1.12.28-0+deb11u1 +libdbus-1-dev==1.12.28-0+deb11u1 libdbus-glib-1-2==0.110-6 libdbus-glib-1-dev==0.110-6 libdbus-glib-1-dev-bin==0.110-6 @@ -497,7 +497,7 @@ libdouble-conversion3==3.1.5-6.1 libdoxia-core-java==1.7-2 libdoxia-java==1.7-2 libdoxia-sitetools-java==1.7.5-2 -libdpkg-perl==1.20.12 +libdpkg-perl==1.20.13 libdrm-amdgpu1==2.4.104-1 libdrm-common==2.4.104-1 libdrm-intel1==2.4.104-1 @@ -638,11 +638,11 @@ 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+deb11u5 -libgs9-common==9.53.3~dfsg-7+deb11u5 +libgs9==9.53.3~dfsg-7+deb11u6 +libgs9-common==9.53.3~dfsg-7+deb11u6 libgsasl7==1.10.0-4+deb11u1 libgsm1==1.0.18-2 -libgssrpc4==1.18.3-6+deb11u3 +libgssrpc4==1.18.3-6+deb11u4 libgstreamer-plugins-base1.0-0==1.18.4-2+deb11u1 libgstreamer1.0-0==1.18.4-2.1 libgtest-dev==1.10.0.20201025-1.1 @@ -735,7 +735,7 @@ libjbig0==2.1-3.1+b2 libjbig2dec0==0.19-2 libjemalloc-dev==5.2.1-3 libjemalloc2==5.2.1-3 -libjetty9-java==9.4.39-3+deb11u1 +libjetty9-java==9.4.50-4+deb11u1 libjpeg62-turbo==1:2.0.6-4 libjq1==1.6-2.1 libjs-bootstrap4==4.5.2+dfsg1-8~deb11u1 @@ -766,15 +766,15 @@ libjudy-dev==1.0.5-5+b2 libjudydebian1==1.0.5-5+b2 libjxr-tools==1.1-6+b1 libjxr0==1.1-6+b1 -libkadm5clnt-mit12==1.18.3-6+deb11u3 -libkadm5srv-mit12==1.18.3-6+deb11u3 -libkdb5-10==1.18.3-6+deb11u3 +libkadm5clnt-mit12==1.18.3-6+deb11u4 +libkadm5srv-mit12==1.18.3-6+deb11u4 +libkdb5-10==1.18.3-6+deb11u4 libkmod2==28-1 libkpathsea6==2020.20200327.54578-7+deb11u1 -libkrb5-dev==1.18.3-6+deb11u3 +libkrb5-dev==1.18.3-6+deb11u4 libksba8==1.5.0-3+deb11u2 liblab-gamut1==2.42.2-5 -liblapack3==3.9.0-3 +liblapack3==3.9.0-3+deb11u1 liblcms2-2==2.12~rc1-2 libldap-2.4-2==2.4.57+dfsg-3+deb11u1 libldap-common==2.4.57+dfsg-3+deb11u1 @@ -801,7 +801,7 @@ libltdl-dev==2.4.6-15 libltdl7==2.4.6-15 liblua5.1-0==5.1.5-8.1+b3 liblua5.1-0-dev==5.1.5-8.1+b3 -liblua5.3-0==5.3.3-1.1+b1 +liblua5.3-0==5.3.3-1.1+deb11u1 liblvm2cmd2.03==2.03.11-2.1 liblwp-mediatypes-perl==6.04-1 liblwp-protocol-https-perl==6.10-1 @@ -816,9 +816,9 @@ libmagickwand-6.q16-6==8:6.9.11.60+dfsg-1.3+deb11u1 libmail-sendmail-perl==0.80-1.1 libmailtools-perl==2.21-1 libmailutils7==1:3.10-3+b1 -libmariadb-dev==1:10.5.19-0+deb11u2 -libmariadb-dev-compat==1:10.5.19-0+deb11u2 -libmariadb3==1:10.5.19-0+deb11u2 +libmariadb-dev==1:10.5.21-0+deb11u1 +libmariadb-dev-compat==1:10.5.21-0+deb11u1 +libmariadb3==1:10.5.21-0+deb11u1 libmarkdown2==2.2.6-1 libmaven-archiver-java==3.2.0-2.1 libmaven-clean-plugin-java==3.1.0-1 @@ -872,10 +872,10 @@ libnamespace-autoclean-perl==0.29-1 libnamespace-clean-perl==0.27-1 libnanomsg-dev==1.1.5+dfsg-1+b2 libnanomsg5==1.1.5+dfsg-1+b2 -libncurses-dev==6.2+20201114-2+deb11u1 -libncurses5-dev==6.2+20201114-2+deb11u1 -libncurses6==6.2+20201114-2+deb11u1 -libncursesw6==6.2+20201114-2+deb11u1 +libncurses-dev==6.2+20201114-2+deb11u2 +libncurses5-dev==6.2+20201114-2+deb11u2 +libncurses6==6.2+20201114-2+deb11u2 +libncursesw6==6.2+20201114-2+deb11u2 libndctl6==71.1-1 libnet-dbus-perl==1.2.0-1+b1 libnet-domain-tld-perl==1.75-1.1 @@ -893,7 +893,7 @@ libnfnetlink0==1.0.1-3+b1 libnftables1==0.9.8-3.1+deb11u1 libnftnl-dev==1.1.9-1 libnftnl11==1.1.9-1 -libnghttp2-14==1.43.0-1 +libnghttp2-14==1.43.0-1+deb11u1 libnl-3-200==3.4.0-1+b1 libnl-route-3-200==3.4.0-1+b1 libnorm-dev==1.5.9+dfsg-2 @@ -1002,7 +1002,7 @@ libplexus-sec-dispatcher-java==1.4-4 libplexus-utils2-java==3.3.0-1 libplexus-velocity-java==1.2-3.1 libpmem1==1.10-2+deb11u1 -libpmix2==4.0.0-4.1 +libpmix2==4.0.0-4.1+deb11u1 libpng-dev==1.6.37-3 libpng-tools==1.6.37-3 libpng16-16==1.6.37-3 @@ -1016,7 +1016,7 @@ 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 -libprotobuf23==3.12.4-1 +libprotobuf23==3.12.4-1+deb11u1 libproxy1v5==0.4.17-1 libpsl5==0.21.0-1.2 libpsm-infinipath1==3.3+20.604758e7-6.1 @@ -1026,10 +1026,10 @@ libpthread-stubs0-dev==0.4-1 libpulse0==14.2-2 libpython2-dev==2.7.18-3 libpython2-stdlib==2.7.18-3 -libpython2.7==2.7.18-8 -libpython2.7-dev==2.7.18-8 -libpython2.7-minimal==2.7.18-8 -libpython2.7-stdlib==2.7.18-8 +libpython2.7==2.7.18-8+deb11u1 +libpython2.7-dev==2.7.18-8+deb11u1 +libpython2.7-minimal==2.7.18-8+deb11u1 +libpython2.7-stdlib==2.7.18-8+deb11u1 libpython3-all-dbg==3.9.2-3 libpython3-all-dev==3.9.2-3 libpython3-dbg==3.9.2-3 @@ -1134,9 +1134,9 @@ libspice-server1==0.14.3-2.1 libsqlite3-0==3.34.1-3 libsratom-0-0==0.6.8-1 libsrt1.4-gnutls==1.4.2-1.3 -libssh-gcrypt-4==0.9.7-0+deb11u1 +libssh-gcrypt-4==0.9.8-0+deb11u1 libssh2-1==1.9.0-2 -libssl-dev==1.1.1n-0+deb11u5 +libssl-dev==1.1.1w-0+deb11u1 libstdc++-10-dev==10.2.1-6 libstemmer0d==2.1.0-1 libstrictures-perl==2.000006-1 @@ -1185,7 +1185,7 @@ libthai-dev==0.1.28-3 libthai0==0.1.28-3 libtheora0==1.1.1+dfsg.1-15 libtie-ixhash-perl==1.23-2.1 -libtiff5==4.2.0-1+deb11u4 +libtiff5==4.2.0-1+deb11u5 libtime-duration-perl==1.21-1 libtime-moment-perl==0.44-1+b3 libtimedate-perl==2.3300-2 @@ -1239,7 +1239,7 @@ libvisual-0.4-0==0.4.0-17 libvorbis0a==1.3.7-1 libvorbisenc2==1.3.7-1 libvorbisfile3==1.3.7-1 -libvpx6==1.9.0-1 +libvpx6==1.9.0-1+deb11u2 libvte-2.91-0==0.62.3-1 libvte-2.91-common==0.62.3-1 libvulkan-dev==1.2.162.0-1 @@ -1269,11 +1269,11 @@ libwrap0-dev==7.6.q-31 libwww-mechanize-perl==2.03-1 libwww-perl==6.52-1 libwww-robotrules-perl==6.02-1 -libx11-6==2:1.7.2-1+deb11u1 -libx11-data==2:1.7.2-1+deb11u1 -libx11-dev==2:1.7.2-1+deb11u1 +libx11-6==2:1.7.2-1+deb11u2 +libx11-data==2:1.7.2-1+deb11u2 +libx11-dev==2:1.7.2-1+deb11u2 libx11-protocol-perl==0.56-7.1 -libx11-xcb1==2:1.7.2-1+deb11u1 +libx11-xcb1==2:1.7.2-1+deb11u2 libx264-160==2:0.160.3011+gitcde9a93-2.1 libx265-192==3.4-2 libx32asan6==10.2.1-6 @@ -1322,16 +1322,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+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 +libxencall1==4.14.6-1 +libxendevicemodel1==4.14.6-1 +libxenevtchn1==4.14.6-1 +libxenforeignmemory1==4.14.6-1 +libxengnttab1==4.14.6-1 +libxenhypfs1==4.14.6-1 +libxenmisc4.14==4.14.6-1 +libxenstore3.0==4.14.6-1 +libxentoolcore1==4.14.6-1 +libxentoollog1==4.14.6-1 libxerces2-java==2.12.1-1 libxext-dev==2:1.3.3-1.1 libxext6==2:1.3.3-1.1 @@ -1366,7 +1366,7 @@ libxmlrpc-lite-perl==0.717-4 libxmu6==2:1.1.2-2+b3 libxmuu1==2:1.1.2-2+b3 libxnvctrl0==470.141.03-1~deb11u1 -libxpm4==1:3.5.12-1.1~deb11u1 +libxpm4==1:3.5.12-1.1+deb11u1 libxrandr-dev==2:1.5.1-1 libxrandr2==2:1.5.1-1 libxrender-dev==1:0.9.10-1 @@ -1386,7 +1386,7 @@ libxvidcore4==2:1.3.7-1 libxxf86dga1==2:1.1.4-1+b3 libxxf86vm1==1:1.1.4-1+b2 libxz-java==1.8-2 -libyajl2==2.1.0-3 +libyajl2==2.1.0-3+deb11u2 libyaml-0-2==0.2.2-1 libyaml-dev==0.2.2-1 libyaml-libyaml-perl==0.82+repack-1+b1 @@ -1400,18 +1400,18 @@ 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.191-1 -linux-headers-5.10.0-25-amd64==5.10.191-1 -linux-headers-5.10.0-25-common==5.10.191-1 -linux-headers-amd64==5.10.191-1 -linux-kbuild-5.10==5.10.191-1 -linux-libc-dev==5.10.191-1 +linux-compiler-gcc-10-x86==5.10.205-2 +linux-headers-5.10.0-27-amd64==5.10.205-2 +linux-headers-5.10.0-27-common==5.10.205-2 +linux-headers-amd64==5.10.205-2 +linux-kbuild-5.10==5.10.205-2 +linux-libc-dev==5.10.205-2 linuxdoc-tools==0.9.82-1 llvm-11==1:11.0.1-2 llvm-11-runtime==1:11.0.1-2 lmodern==2.004.5-6.1 -locales==2.31-13+deb11u6 -logrotate==3.18.0-2+deb11u1 +locales==2.31-13+deb11u7 +logrotate==3.18.0-2+deb11u2 lsb-release==11.1.0 lsof==4.93.2+dfsg-1.1 lua-bitop==1.0.2-5 @@ -1433,7 +1433,7 @@ man-db==2.9.4-2 man2html-base==1.6g-14 manpages==5.10-1 manpages-dev==5.10-1 -mariadb-common==1:10.5.19-0+deb11u2 +mariadb-common==1:10.5.21-0+deb11u1 maven==3.6.3-5 maven-debian-helper==2.6 maven-repo-helper==1.10 @@ -1444,7 +1444,7 @@ mesa-vulkan-drivers==20.3.5-1 mime-support==3.66 module-assistant==0.11.10 mysql-common==5.8+1.0.7 -ncurses-term==6.2+20201114-2+deb11u1 +ncurses-term==6.2+20201114-2+deb11u2 netbase==6.3 netpbm==2:10.0-15.4 nftables==0.9.8-3.1+deb11u1 @@ -1452,15 +1452,15 @@ nlohmann-json3-dev==3.9.1-1 node-jquery==3.5.1+dfsg+~3.5.5-7 ocl-icd-libopencl1==2.2.14-2 openjade==1.4devel1-22 -openjdk-11-jdk==11.0.20+8-1~deb11u1 -openjdk-11-jdk-headless==11.0.20+8-1~deb11u1 -openjdk-11-jre==11.0.20+8-1~deb11u1 -openjdk-11-jre-headless==11.0.20+8-1~deb11u1 +openjdk-11-jdk==11.0.22+7-1~deb11u1 +openjdk-11-jdk-headless==11.0.22+7-1~deb11u1 +openjdk-11-jre==11.0.22+7-1~deb11u1 +openjdk-11-jre-headless==11.0.22+7-1~deb11u1 opensp==1.5.2-13+b2 -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+deb11u5 +openssh-client==1:8.4p1-5+deb11u3 +openssh-server==1:8.4p1-5+deb11u3 +openssh-sftp-server==1:8.4p1-5+deb11u3 +openssl==1.1.1w-0+deb11u1 ovmf==2020.11-2+deb11u1 packagekit==1.2.2-2 packagekit-tools==1.2.2-2 @@ -1546,9 +1546,9 @@ python-setuptools==44.1.1-1 python2==2.7.18-3 python2-dev==2.7.18-3 python2-minimal==2.7.18-3 -python2.7==2.7.18-8 -python2.7-dev==2.7.18-8 -python2.7-minimal==2.7.18-8 +python2.7==2.7.18-8+deb11u1 +python2.7-dev==2.7.18-8+deb11u1 +python2.7-minimal==2.7.18-8+deb11u1 python3==3.9.2-3 python3-alabaster==0.7.8-1.1 python3-all==3.9.2-3 @@ -1650,11 +1650,11 @@ python3.9-dbg==3.9.2-1 python3.9-dev==3.9.2-1 python3.9-minimal==3.9.2-1 python3.9-venv==3.9.2-1 -qemu-system-common==1:5.2+dfsg-11+deb11u2 -qemu-system-data==1:5.2+dfsg-11+deb11u2 -qemu-system-gui==1:5.2+dfsg-11+deb11u2 -qemu-system-x86==1:5.2+dfsg-11+deb11u2 -qemu-utils==1:5.2+dfsg-11+deb11u2 +qemu-system-common==1:5.2+dfsg-11+deb11u3 +qemu-system-data==1:5.2+dfsg-11+deb11u3 +qemu-system-gui==1:5.2+dfsg-11+deb11u3 +qemu-system-x86==1:5.2+dfsg-11+deb11u3 +qemu-utils==1:5.2+dfsg-11+deb11u3 qt5-gtk-platformtheme==5.15.2+dfsg-9 qt5-qmake==5.15.2+dfsg-9 qt5-qmake-bin==5.15.2+dfsg-9 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 048e3a4b5fe8..9356b5ee9abb 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 @@ -18,6 +18,6 @@ libstdc++6-armhf-cross==10.2.1-6cross1 libubsan1-armhf-cross==10.2.1-6cross1 libunicode-linebreak-perl==0.0.20190101-1+b2 libxslt1-dev==1.1.34-4+deb11u1 -linux-headers-5.10.0-25-arm64==5.10.191-1 -linux-headers-arm64==5.10.191-1 +linux-headers-5.10.0-27-arm64==5.10.205-2 +linux-headers-arm64==5.10.205-2 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 3c9bcd6b6b84..982b90176b0e 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 @@ -7,8 +7,8 @@ libjpeg-dev==1:2.0.6-4 libjpeg62-turbo-dev==1:2.0.6-4 libunicode-linebreak-perl==0.0.20190101-1+b2 libxslt1-dev==1.1.34-4+deb11u1 -linux-compiler-gcc-10-arm==5.10.191-1 -linux-headers-5.10.0-25-armmp==5.10.191-1 -linux-headers-armmp==5.10.191-1 +linux-compiler-gcc-10-arm==5.10.205-2 +linux-headers-5.10.0-27-armmp==5.10.205-2 +linux-headers-armmp==5.10.205-2 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 a1bf00f05bbb..2278b0803943 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 @@ -26,6 +26,8 @@ fastentrypoints==0.12 gbp==0.9.22 gcovr==4.2 gpg===1.14.0-unknown +grpcio==1.58.0 +grpcio-tools==1.58.0 html5lib==1.1 hyperlink==19.0.0 idna==2.10 @@ -60,6 +62,7 @@ pexpect==4.8.0 pillow==9.4.0 pip==23.2.1 pluggy==0.13.0 +protobuf==4.25.2 ptyprocess==0.7.0 py==1.10.0 pyang==2.4.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 09798b7d6d5e..7300a53243fd 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster @@ -56,9 +56,9 @@ cpp==4:8.3.0-1 cpp-8==8.3.0-6 cppcheck==1.86-1 cron==3.0pl1-134+deb10u1 -curl==7.64.0-4+deb10u6 -dbus==1.12.24-0+deb10u1 -dbus-user-session==1.12.24-0+deb10u1 +curl==7.64.0-4+deb10u8 +dbus==1.12.28-0+deb10u1 +dbus-user-session==1.12.28-0+deb10u1 dconf-gsettings-backend==0.30.1-2 dconf-service==0.30.1-2 dctrl-tools==2.24-3 @@ -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+deb10u7 +distro-info-data==0.41+deb10u8 dkms==2.6.1-4 dmeventd==2:1.02.155-3 dmsetup==2:1.02.155-3 @@ -94,7 +94,7 @@ docbook-xml==4.5-8 docker-buildx-plugin==0.10.5-1~debian.10~buster docker-ce==5:24.0.2-1~debian.10~buster docker-ce-cli==5:24.0.2-1~debian.10~buster -docker-ce-rootless-extras==5:24.0.6-1~debian.10~buster +docker-ce-rootless-extras==5:25.0.1-1~debian.10~buster docker-compose-plugin==2.18.1-1~debian.10~buster docutils-common==0.14+dfsg-4 docutils-doc==0.14+dfsg-4 @@ -108,9 +108,9 @@ dwz==0.13-5~bpo10+1 eatmydata==105-7 emacsen-common==3.0.4 equivs==2.2.0 -exim4-base==4.92-8+deb10u7 -exim4-config==4.92-8+deb10u7 -exim4-daemon-light==4.92-8+deb10u7 +exim4-base==4.92-8+deb10u9 +exim4-config==4.92-8+deb10u9 +exim4-daemon-light==4.92-8+deb10u9 expat==2.2.6-2+deb10u6 exuberant-ctags==1:5.9~svn20110310-12+deb10u1 fakeroot==1.23-1 @@ -145,7 +145,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+deb10u8 +ghostscript==9.27~dfsg-2+deb10u9 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 @@ -207,8 +207,8 @@ javascript-common==11 jq==1.5+dfsg-2+b1 kernel-wedge==2.99 kmod==26-1 -krb5-locales==1.17-3+deb10u5 -krb5-multidev==1.17-3+deb10u5 +krb5-locales==1.17-3+deb10u6 +krb5-multidev==1.17-3+deb10u6 lcov==1.13-4 less==487-0.1+b1 lib32asan5==8.3.0-6 @@ -284,7 +284,7 @@ libb-hooks-endofscope-perl==0.24-1 libb-hooks-op-check-perl==0.22-1+b1 libbabeltrace-dev==1.5.6-2+deb10u1 libbabeltrace1==1.5.6-2+deb10u1 -libbatik-java==1.10-2+deb10u2 +libbatik-java==1.10-2+deb10u3 libbdplus0==0.1.2-3 libbind-export-dev==1:9.11.5.P4+dfsg-5.1+deb10u9 libbind9-161==1:9.11.5.P4+dfsg-5.1+deb10u9 @@ -292,7 +292,7 @@ libbinutils==2.31.1-16 libbison-dev==2:3.3.2.dfsg-1 libbit-vector-perl==7.4-1+b5 libblkid-dev==2.33.1-0.1 -libbluetooth3==5.50-1.2~deb10u3 +libbluetooth3==5.50-1.2~deb10u4 libbluray2==1:1.1.0-1+deb10u1 libboost-atomic1.71-dev==1.71.0-6~bpo10+1 libboost-atomic1.71.0==1.71.0-6~bpo10+1 @@ -371,8 +371,8 @@ libcgi-pm-perl==4.40-1 libcglib-java==3.2.10-1 libcgraph6==2.40.1-6+deb10u1 libchromaprint1==1.4.3-3 -libcjson-dev==1.7.10-1.1+deb10u1 -libcjson1==1.7.10-1.1+deb10u1 +libcjson-dev==1.7.10-1.1+deb10u2 +libcjson1==1.7.10-1.1+deb10u2 libclang-common-7-dev==1:7.0.1-8+deb10u2 libclang1-6.0==1:6.0.1-10 libclang1-7==1:7.0.1-8+deb10u2 @@ -414,12 +414,12 @@ libcryptsetup12==2:2.1.0-5+deb10u2 libcrystalhd3==1:0.0~git20110715.fdd2f19-13 libcunit1==2.1-3-dfsg-2+b12 libcunit1-dev==2.1-3-dfsg-2+b12 -libcups2==2.2.10-6+deb10u8 +libcups2==2.2.10-6+deb10u9 libcupsfilters1==1.21.6-5+deb10u1 -libcupsimage2==2.2.10-6+deb10u8 -libcurl3-gnutls==7.64.0-4+deb10u6 -libcurl4==7.64.0-4+deb10u6 -libcurl4-openssl-dev==7.64.0-4+deb10u6 +libcupsimage2==2.2.10-6+deb10u9 +libcurl3-gnutls==7.64.0-4+deb10u8 +libcurl4==7.64.0-4+deb10u8 +libcurl4-openssl-dev==7.64.0-4+deb10u8 libdaemon-dev==0.14-7 libdaemon0==0.14-7 libdata-dump-perl==1.23-1 @@ -428,13 +428,13 @@ libdatrie1==0.2.12-2 libdb-dev==5.3.1+nmu1 libdb5.3-dev==5.3.28+dfsg1-0.5 libdbi1==0.9.0-5 -libdbus-1-3==1.12.24-0+deb10u1 -libdbus-1-dev==1.12.24-0+deb10u1 +libdbus-1-3==1.12.28-0+deb10u1 +libdbus-1-dev==1.12.28-0+deb10u1 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.11-0+deb10u4 +libde265-0==1.0.11-0+deb10u6 libdebhelper-perl==13.3.3~bpo10+1 libdevel-callchecker-perl==0.008-1 libdevel-caller-perl==2.06-2+b1 @@ -448,7 +448,7 @@ libdevmapper1.02.1==2:1.02.155-3 libdigest-bubblebabble-perl==0.02-2 libdigest-hmac-perl==1.03+dfsg-2 libdist-checkconflicts-perl==0.11-1 -libdistro-info-perl==0.21 +libdistro-info-perl==0.21+deb10u1 libdjvulibre-text==3.5.27.1-10+deb10u1 libdjvulibre21==3.5.27.1-10+deb10u1 libdns-export1104==1:9.11.5.P4+dfsg-5.1+deb10u9 @@ -480,7 +480,6 @@ libegl1==1.1.0-1 libegl1-mesa-dev==18.3.6-2+deb10u1 libel-api-java==3.0.0-2+deb10u1 libelf-dev==0.176-1.1+deb10u1 -libelf1==0.176-1.1+deb10u1 libemail-valid-perl==1.202-1 libencode-locale-perl==1.05-1 libepoxy-dev==1.5.3-0.1 @@ -518,7 +517,7 @@ libfile-stripnondeterminism-perl==1.1.2-1 libfile-which-perl==1.23-1 libfl-dev==2.6.4-6.2 libfl2==2.6.4-6.2 -libflac8==1.3.2-3+deb10u2 +libflac8==1.3.2-3+deb10u3 libflite1==2.1-release-3 libfont-afm-perl==1.20-2 libfontbox2-java==2.0.13-2 @@ -562,11 +561,11 @@ libgl1-mesa-dri==18.3.6-2+deb10u1 libglapi-mesa==18.3.6-2+deb10u1 libgles1==1.1.0-1 libgles2==1.1.0-1 -libglib2.0-0==2.58.3-2+deb10u4 -libglib2.0-bin==2.58.3-2+deb10u4 -libglib2.0-data==2.58.3-2+deb10u4 -libglib2.0-dev==2.58.3-2+deb10u4 -libglib2.0-dev-bin==2.58.3-2+deb10u4 +libglib2.0-0==2.58.3-2+deb10u5 +libglib2.0-bin==2.58.3-2+deb10u5 +libglib2.0-data==2.58.3-2+deb10u5 +libglib2.0-dev==2.58.3-2+deb10u5 +libglib2.0-dev-bin==2.58.3-2+deb10u5 libglu1-mesa==9.0.0-2.1+b3 libglu1-mesa-dev==9.0.0-2.1+b3 libglvnd-core-dev==1.1.0-1 @@ -578,10 +577,10 @@ libgme0==0.6.2-1 libgmock-dev==1.8.1-3 libgmp-dev==2:6.1.2+dfsg-4+deb10u1 libgmpxx4ldbl==2:6.1.2+dfsg-4+deb10u1 -libgnutls-dane0==3.6.7-4+deb10u10 -libgnutls-openssl27==3.6.7-4+deb10u10 -libgnutls28-dev==3.6.7-4+deb10u10 -libgnutlsxx28==3.6.7-4+deb10u10 +libgnutls-dane0==3.6.7-4+deb10u11 +libgnutls-openssl27==3.6.7-4+deb10u11 +libgnutls28-dev==3.6.7-4+deb10u11 +libgnutlsxx28==3.6.7-4+deb10u11 libgomp1==8.3.0-6 libgoogle-perftools4==2.7-1 libgpgme11==1.12.0-6 @@ -590,11 +589,11 @@ 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+deb10u8 -libgs9-common==9.27~dfsg-2+deb10u8 +libgs9==9.27~dfsg-2+deb10u9 +libgs9-common==9.27~dfsg-2+deb10u9 libgsm1==1.0.18-2 -libgssapi-krb5-2==1.17-3+deb10u5 -libgssrpc4==1.17-3+deb10u5 +libgssapi-krb5-2==1.17-3+deb10u6 +libgssrpc4==1.17-3+deb10u6 libgstreamer-plugins-base1.0-0==1.14.4-2+deb10u2 libgstreamer1.0-0==1.14.4-1 libgtest-dev==1.8.1-3 @@ -692,7 +691,7 @@ libjbig0==2.1-3.1+b2 libjbig2dec0==0.16-1+deb10u1 libjemalloc-dev==5.1.0-3 libjemalloc2==5.1.0-3 -libjetty9-java==9.4.16-0+deb10u2 +libjetty9-java==9.4.50-4+deb10u1 libjpeg62-turbo==1:1.5.2-2+deb10u1 libjq1==1.5+dfsg-2+b1 libjs-bootstrap==3.4.1+dfsg-1 @@ -719,16 +718,16 @@ libjudy-dev==1.0.5-5 libjudydebian1==1.0.5-5 libjxr-tools==1.1-6+b1 libjxr0==1.1-6+b1 -libk5crypto3==1.17-3+deb10u5 -libkadm5clnt-mit11==1.17-3+deb10u5 -libkadm5srv-mit11==1.17-3+deb10u5 -libkdb5-9==1.17-3+deb10u5 +libk5crypto3==1.17-3+deb10u6 +libkadm5clnt-mit11==1.17-3+deb10u6 +libkadm5srv-mit11==1.17-3+deb10u6 +libkdb5-9==1.17-3+deb10u6 libkeyutils1==1.6-6 libkmod2==26-1 libkpathsea6==2018.20181218.49446-1+deb10u2 -libkrb5-3==1.17-3+deb10u5 -libkrb5-dev==1.17-3+deb10u5 -libkrb5support0==1.17-3+deb10u5 +libkrb5-3==1.17-3+deb10u6 +libkrb5-dev==1.17-3+deb10u6 +libkrb5support0==1.17-3+deb10u6 libksba8==1.3.5-2+deb10u2 liblab-gamut1==2.40.1-6+deb10u1 liblcms2-2==2.9-3 @@ -812,9 +811,9 @@ libnamespace-autoclean-perl==0.28-1 libnamespace-clean-perl==0.27-1 libnanomsg-dev==1.1.5+dfsg-1 libnanomsg5==1.1.5+dfsg-1 -libncurses-dev==6.1+20181013-2+deb10u3 -libncurses5-dev==6.1+20181013-2+deb10u3 -libncurses6==6.1+20181013-2+deb10u3 +libncurses-dev==6.1+20181013-2+deb10u5 +libncurses5-dev==6.1+20181013-2+deb10u5 +libncurses6==6.1+20181013-2+deb10u5 libnet-dbus-perl==1.1.0-5+b1 libnet-dns-perl==1.19-1 libnet-dns-sec-perl==1.11-1 @@ -834,7 +833,7 @@ libnfnetlink0==1.0.1-3+b1 libnftables0==0.9.0-2 libnftnl-dev==1.1.2-2 libnftnl11==1.1.2-2 -libnghttp2-14==1.36.0-2+deb10u1 +libnghttp2-14==1.36.0-2+deb10u2 libnl-3-200==3.4.0-1 libnl-3-dev==3.4.0-1 libnl-route-3-200==3.4.0-1 @@ -844,7 +843,7 @@ libnorm1==1.5.8+dfsg2-1 libnpth0==1.6-1 libnspr4==2:4.20-1 libnss-systemd==241-7~deb10u10 -libnss3==2:3.42.1-1+deb10u6 +libnss3==2:3.42.1-1+deb10u7 libnuma-dev==2.0.12-1 libnuma1==2.0.12-1 libnumber-compare-perl==0.03-1 @@ -940,7 +939,7 @@ libplexus-languages-java==0.9.10-1 libplexus-sec-dispatcher-java==1.4-4 libplexus-utils2-java==3.1.1-1 libplexus-velocity-java==1.2-3 -libpmix2==3.1.2-3 +libpmix2==3.1.2-3+deb10u1 libpng-dev==1.6.36-6 libpng-tools==1.6.36-6 libpng16-16==1.6.36-6 @@ -978,11 +977,11 @@ libpython3-all-dev==3.7.3-1 libpython3-dbg==3.7.3-1 libpython3-dev==3.7.3-1 libpython3-stdlib==3.7.3-1 -libpython3.7==3.7.3-2+deb10u5 -libpython3.7-dbg==3.7.3-2+deb10u5 -libpython3.7-dev==3.7.3-2+deb10u5 -libpython3.7-minimal==3.7.3-2+deb10u5 -libpython3.7-stdlib==3.7.3-2+deb10u5 +libpython3.7==3.7.3-2+deb10u6 +libpython3.7-dbg==3.7.3-2+deb10u6 +libpython3.7-dev==3.7.3-2+deb10u6 +libpython3.7-minimal==3.7.3-2+deb10u6 +libpython3.7-stdlib==3.7.3-2+deb10u6 libqdox-java==1.12.1-3 libqdox2-java==2.0~M10-1 libqt4-dbus==4:4.8.7+dfsg-18+deb10u2 @@ -1108,8 +1107,8 @@ libsub-identify-perl==0.14-1+b1 libsub-install-perl==0.928-1 libsub-name-perl==0.21-1+b3 libsub-quote-perl==2.005001-1 -libsubunit-dev==1.3.0-1 -libsubunit0==1.3.0-1 +libsubunit-dev==1.3.0-1+deb10u1 +libsubunit0==1.3.0-1+deb10u1 libsurefire-java==2.22.1-1 libswitch-perl==2.17-2 libswresample3==7:4.1.11-0+deb10u1 @@ -1189,7 +1188,7 @@ libvisual-0.4-0==0.4.0-15 libvorbis0a==1.3.6-2 libvorbisenc2==1.3.6-2 libvorbisfile3==1.3.6-2 -libvpx5==1.7.0-3+deb10u1 +libvpx5==1.7.0-3+deb10u2 libvte-2.91-0==0.54.2-2 libvte-2.91-common==0.54.2-2 libvulkan-dev==1.1.97-2 @@ -1218,12 +1217,12 @@ libwrap0==7.6.q-28 libwrap0-dev==7.6.q-28 libwww-perl==6.36-2 libwww-robotrules-perl==6.02-1 -libx11-6==2:1.6.7-1+deb10u3 -libx11-data==2:1.6.7-1+deb10u3 -libx11-dev==2:1.6.7-1+deb10u3 +libx11-6==2:1.6.7-1+deb10u4 +libx11-data==2:1.6.7-1+deb10u4 +libx11-dev==2:1.6.7-1+deb10u4 libx11-protocol-perl==0.56-7 -libx11-xcb-dev==2:1.6.7-1+deb10u3 -libx11-xcb1==2:1.6.7-1+deb10u3 +libx11-xcb-dev==2:1.6.7-1+deb10u4 +libx11-xcb1==2:1.6.7-1+deb10u4 libx264-155==2:0.155.2917+git0a84d98-2 libx265-165==2.9-4 libx32asan5==8.3.0-6 @@ -1321,7 +1320,7 @@ libxmlgraphics-commons-java==2.3-1+deb10u1 libxmlrpc-lite-perl==0.717-2 libxmu6==2:1.1.2-2+b3 libxmuu1==2:1.1.2-2+b3 -libxpm4==1:3.5.12-1+deb10u1 +libxpm4==1:3.5.12-1+deb10u2 libxrandr-dev==2:1.5.1-1 libxrandr2==2:1.5.1-1 libxrender-dev==1:0.9.10-1 @@ -1353,12 +1352,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.289-2 -linux-headers-4.19.0-25-amd64==4.19.289-2 -linux-headers-4.19.0-25-common==4.19.289-2 -linux-headers-amd64==4.19+105+deb10u20 -linux-kbuild-4.19==4.19.289-2 -linux-libc-dev==4.19.289-2 +linux-compiler-gcc-8-x86==4.19.304-1 +linux-headers-4.19.0-26-amd64==4.19.304-1 +linux-headers-4.19.0-26-common==4.19.304-1 +linux-headers-amd64==4.19+105+deb10u21 +linux-kbuild-4.19==4.19.304-1 +linux-libc-dev==4.19.304-1 linuxdoc-tools==0.9.73-2 llvm-7==1:7.0.1-8+deb10u2 llvm-7-dev==1:7.0.1-8+deb10u2 @@ -1392,7 +1391,7 @@ mesa-vdpau-drivers==18.3.6-2+deb10u1 mime-support==3.62 module-assistant==0.11.10 mysql-common==5.8+1.0.5 -ncurses-term==6.1+20181013-2+deb10u3 +ncurses-term==6.1+20181013-2+deb10u5 netbase==5.6 netpbm==2:10.0-15.3+b2 nettle-dev==3.4.1-1+deb10u1 @@ -1400,16 +1399,16 @@ nftables==0.9.0-2 nlohmann-json3-dev==3.5.0-0.1 ocl-icd-libopencl1==2.2.12-2 openjade==1.4devel1-21.3+b1 -openjdk-11-jdk==11.0.20+8-1~deb10u1 -openjdk-11-jdk-headless==11.0.20+8-1~deb10u1 -openjdk-11-jre==11.0.20+8-1~deb10u1 -openjdk-11-jre-headless==11.0.20+8-1~deb10u1 +openjdk-11-jdk==11.0.21+9-1~deb10u1 +openjdk-11-jdk-headless==11.0.21+9-1~deb10u1 +openjdk-11-jre==11.0.21+9-1~deb10u1 +openjdk-11-jre-headless==11.0.21+9-1~deb10u1 openmpi-bin==3.1.3-11 openmpi-common==3.1.3-11 opensp==1.5.2-13+b1 -openssh-client==1:7.9p1-10+deb10u3 -openssh-server==1:7.9p1-10+deb10u3 -openssh-sftp-server==1:7.9p1-10+deb10u3 +openssh-client==1:7.9p1-10+deb10u4 +openssh-server==1:7.9p1-10+deb10u4 +openssh-sftp-server==1:7.9p1-10+deb10u4 openssl==1.1.1n-0+deb10u6 ovmf==0~20181115.85588389-3+deb10u3 packagekit==1.1.12-5 @@ -1521,7 +1520,7 @@ python-incremental==16.10.1-3 python-ipaddr==2.2.0-2 python-ipaddress==1.0.17-1+deb10u1 python-isort==4.3.4+ds1-1.1 -python-jinja2==2.10-2 +python-jinja2==2.10-2+deb10u1 python-keyring==17.1.1-1 python-keyrings.alt==3.1.1-1 python-lazy-object-proxy==1.3.1-1+b1 @@ -1567,7 +1566,7 @@ python-twisted-bin==18.9.0-3+deb10u2 python-twisted-core==18.9.0-3+deb10u2 python-typing==3.6.6-1 python-tz==2019.1-1 -python-urllib3==1.24.1-1 +python-urllib3==1.24.1-1+deb10u2 python-webencodings==0.5.1-1 python-wheel==0.32.3-2 python-wrapt==1.10.11-1 @@ -1601,7 +1600,7 @@ python3-dbg==3.7.3-1 python3-dbus==1.2.8-3 python3-debian==0.1.35 python3-dev==3.7.3-1 -python3-distro-info==0.21 +python3-distro-info==0.21+deb10u1 python3-distutils==3.7.3-1 python3-docutils==0.14+dfsg-4 python3-entrypoints==0.3-1 @@ -1609,7 +1608,7 @@ python3-gi==3.30.4-1 python3-gpg==1.12.0-6 python3-idna==2.6-1 python3-imagesize==1.0.0-1 -python3-jinja2==2.10-2 +python3-jinja2==2.10-2+deb10u1 python3-keyring==17.1.1-1 python3-keyrings.alt==3.1.1-1 python3-lib2to3==3.7.3-1 @@ -1643,20 +1642,20 @@ python3-sphinx==1.8.4-1 python3-sphinx-rtd-theme==0.4.3+dfsg-1 python3-tz==2019.1-1 python3-unidiff==0.5.4-1 -python3-urllib3==1.24.1-1 +python3-urllib3==1.24.1-1+deb10u2 python3-wheel==0.32.3-2 python3-xdg==0.25-5 -python3.7==3.7.3-2+deb10u5 -python3.7-dbg==3.7.3-2+deb10u5 -python3.7-dev==3.7.3-2+deb10u5 -python3.7-minimal==3.7.3-2+deb10u5 +python3.7==3.7.3-2+deb10u6 +python3.7-dbg==3.7.3-2+deb10u6 +python3.7-dev==3.7.3-2+deb10u6 +python3.7-minimal==3.7.3-2+deb10u6 qdbus==4:4.8.7+dfsg-18+deb10u2 -qemu-kvm==1:3.1+dfsg-8+deb10u10 -qemu-system-common==1:3.1+dfsg-8+deb10u10 -qemu-system-data==1:3.1+dfsg-8+deb10u10 -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 +qemu-kvm==1:3.1+dfsg-8+deb10u11 +qemu-system-common==1:3.1+dfsg-8+deb10u11 +qemu-system-data==1:3.1+dfsg-8+deb10u11 +qemu-system-gui==1:3.1+dfsg-8+deb10u11 +qemu-system-x86==1:3.1+dfsg-8+deb10u11 +qemu-utils==1:3.1+dfsg-8+deb10u11 qt-at-spi==0.4.0-9 qt4-linguist-tools==4:4.8.7+dfsg-18+deb10u2 qt4-qmake==4:4.8.7+dfsg-18+deb10u2 @@ -1742,9 +1741,9 @@ uuid-dev==2.33.1-0.1 va-driver-all==2.4.0-1 vdpau-driver-all==1.1.1-10 velocity==1.7-5+deb10u1 -vim==2:8.1.0875-5+deb10u5 -vim-common==2:8.1.0875-5+deb10u5 -vim-runtime==2:8.1.0875-5+deb10u5 +vim==2:8.1.0875-5+deb10u6 +vim-common==2:8.1.0875-5+deb10u6 +vim-runtime==2:8.1.0875-5+deb10u6 wayland-protocols==1.17-1 wdiff==1.2.2-2+b1 wget==1.20.1-1.1 @@ -1776,7 +1775,7 @@ xorg-sgml-doctools==1:1.11-1 xsltproc==1.1.32-2.2~deb10u2 xterm==344-1+deb10u2 xtrans-dev==1.3.5-1 -xxd==2:8.1.0875-5+deb10u5 +xxd==2:8.1.0875-5+deb10u6 xz-utils==5.2.4-1+deb10u1 zip==3.0-11+b1 zlib1g-dev==1:1.2.11.dfsg-1+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 255632f99acb..5957b744fe03 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.289-2 +linux-compiler-gcc-8-arm==4.19.304-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 a831ef80c7f0..c6fb39fa348a 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-py3 +++ b/files/build/versions/dockers/sonic-slave-buster/versions-py3 @@ -11,7 +11,7 @@ cov-core==1.15.0 coverage==4.5.2 cryptography==2.6.1 devscripts==2.19.5+deb10u1 -distro-info==0.21 +distro-info==0.21+deb10u1 docutils==0.14 entrypoints==0.3 fastentrypoints==0.12 diff --git a/files/build/versions/host-base-image/versions-deb-bullseye b/files/build/versions/host-base-image/versions-deb-bullseye index f40eeff20cfa..1e60c6bab5d6 100644 --- a/files/build/versions/host-base-image/versions-deb-bullseye +++ b/files/build/versions/host-base-image/versions-deb-bullseye @@ -1,6 +1,6 @@ -adduser==3.118 +adduser==3.118+deb11u1 apt==2.2.4 -base-files==11.1+deb11u7 +base-files==11.1+deb11u8 base-passwd==3.5.51 bash==5.1-2+deb11u1 bsdutils==1:2.36.1-8+deb11u1 @@ -10,7 +10,7 @@ debconf==1.5.77 debian-archive-keyring==2021.1.1+deb11u1 debianutils==4.11.2 diffutils==1:3.7-5 -dpkg==1.20.12 +dpkg==1.20.13 e2fsprogs==1.46.2-2 findutils==4.8.0-1 gcc-10-base==10.2.1-6 @@ -41,13 +41,13 @@ libgcrypt20==1.8.7-6 libgmp10==2:6.2.1+dfsg-1+deb11u1 libgnutls30==3.7.1-5+deb11u3 libgpg-error0==1.38-2 -libgssapi-krb5-2==1.18.3-6+deb11u3 +libgssapi-krb5-2==1.18.3-6+deb11u4 libhogweed6==3.7.3-1 libidn2-0==2.3.0-5 -libk5crypto3==1.18.3-6+deb11u3 +libk5crypto3==1.18.3-6+deb11u4 libkeyutils1==1.6.1-2 -libkrb5-3==1.18.3-6+deb11u3 -libkrb5support0==1.18.3-6+deb11u3 +libkrb5-3==1.18.3-6+deb11u4 +libkrb5support0==1.18.3-6+deb11u4 liblz4-1==1.9.3-2 liblzma5==5.2.5-2.1~deb11u1 libmount1==2.36.1-8+deb11u1 @@ -67,14 +67,14 @@ libsemanage1==3.1-1+b2 libsepol1==3.1-1 libsmartcols1==2.36.1-8+deb11u1 libss2==1.46.2-2 -libssl1.1==1.1.1n-0+deb11u4 +libssl1.1==1.1.1w-0+deb11u1 libstdc++6==10.2.1-6 -libsystemd0==247.3-7+deb11u2 +libsystemd0==247.3-7+deb11u4 libtasn1-6==4.16.0-2+deb11u1 -libtinfo6==6.2+20201114-2+deb11u1 +libtinfo6==6.2+20201114-2+deb11u2 libtirpc-common==1.3.1-1+deb11u1 libtirpc3==1.3.1-1+deb11u1 -libudev1==247.3-7+deb11u2 +libudev1==247.3-7+deb11u4 libunistring2==0.9.10-4 libuuid1==2.36.1-8+deb11u1 libxxhash0==0.8.0-2 @@ -84,8 +84,8 @@ logsave==1.46.2-2 lsb-base==11.1.0 mawk==1.3.4.20200120-2 mount==2.36.1-8+deb11u1 -ncurses-base==6.2+20201114-2+deb11u1 -ncurses-bin==6.2+20201114-2+deb11u1 +ncurses-base==6.2+20201114-2+deb11u2 +ncurses-bin==6.2+20201114-2+deb11u2 passwd==1:4.8.1-1 perl-base==5.32.1-4+deb11u2 sed==4.7-1 diff --git a/files/build/versions/host-image/versions-deb-bullseye b/files/build/versions/host-image/versions-deb-bullseye index cbab475d356e..02ceda70f0e3 100644 --- a/files/build/versions/host-image/versions-deb-bullseye +++ b/files/build/versions/host-image/versions-deb-bullseye @@ -7,7 +7,6 @@ auditd==1:3.0-2 bash==5.1-2 bash-completion==1:2.11-2 bash-tacplus==1.0.0 -bfn-modules==1.0 binutils==2.35.2-2 binutils-common==2.35.2-2 binutils-x86-64-linux-gnu==2.35.2-2 @@ -19,21 +18,21 @@ ca-certificates==20210119 cgroup-tools==0.41-11 conntrack==1:1.4.6-2 containerd.io==1.6.21-1 -cpio==2.13+dfsg-4 +cpio==2.13+dfsg-7.1~deb11u1 cpp==4:10.2.1-1 cpp-10==10.2.1-6 cracklib-runtime==2.9.6-3.4 cron==3.0pl1-137 -curl==7.74.0-1.3+deb11u7 -dbus==1.12.24-0+deb11u1 +curl==7.74.0-1.3+deb11u11 +dbus==1.12.28-0+deb11u1 device-tree-compiler==1.6.0-1 dirmngr==2.2.27-2+deb11u2 -distro-info-data==0.51+deb11u3 +distro-info-data==0.51+deb11u4 dmidecode==3.3-2 dmsetup==2:1.02.175-2.1 docker-ce==5:24.0.2-1~debian.11~bullseye docker-ce-cli==5:24.0.2-1~debian.11~bullseye -dpkg-dev==1.20.12 +dpkg-dev==1.20.13 eatmydata==105-9 ebtables==2.0.11-4+b1 efibootmgr==17-1 @@ -62,12 +61,12 @@ 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 +grub-common==2.06-3~deb11u6 +grub2-common==2.06-3~deb11u6 haveged==1.9.14-1 hdparm==9.60+ds-1 hping3==3.a2.ds2-10 -hw-management==1.mlnx.7.0030.1011 +hw-management==1.mlnx.7.0030.2008 i2c-tools==4.2-1+b1 ifmetric==0.3-5 ifupdown2==3.0.0-1 @@ -100,9 +99,11 @@ libblkid-dev==2.36.1-8+deb11u1 libboost-serialization1.74.0==1.74.0-9 libbpf0==1:0.3-2 libbrotli1==1.0.9-2+b2 -libbsd0==0.11.3-1 +libbsd0==0.11.3-1+deb11u1 libc-ares2==1.17.1-1+deb11u3 -libc-l10n==2.31-13+deb11u6 +libc-bin==2.31-13+deb11u7 +libc-l10n==2.31-13+deb11u7 +libc6==2.31-13+deb11u7 libcap2==1:2.44-1 libcap2-bin==1:2.44-1 libcbor0==0.5.0+dfsg-2 @@ -112,11 +113,11 @@ libcrack2==2.9.6-3.4 libcryptsetup12==2:2.3.7-1+deb11u1 libctf-nobfd0==2.35.2-2 libctf0==2.35.2-2 -libcurl3-gnutls==7.74.0-1.3+deb11u7 -libcurl4==7.74.0-1.3+deb11u7 +libcurl3-gnutls==7.74.0-1.3+deb11u11 +libcurl4==7.74.0-1.3+deb11u11 libdbd-sqlite3-perl==1.66-1+b1 libdbi-perl==1.643-3+b1 -libdbus-1-3==1.12.24-0+deb11u1 +libdbus-1-3==1.12.28-0+deb11u1 libdevmapper1.02.1==2:1.02.175-2.1 libdns-export1110==1:9.11.19+dfsg-2.1 libdw1==0.183-1 @@ -174,13 +175,13 @@ libmnl0==1.0.4-3 libmpc3==1.2.0-1 libmpdec3==2.5.1-1 libmpfr6==4.1.0-3 -libncurses6==6.2+20201114-2+deb11u1 -libncursesw6==6.2+20201114-2+deb11u1 +libncurses6==6.2+20201114-2+deb11u2 +libncursesw6==6.2+20201114-2+deb11u2 libnet1==1.1.6+dfsg-3.1 libnetfilter-conntrack3==1.0.8-3 libnfnetlink0==1.0.1-3+b1 libnftnl11==1.1.9-1 -libnghttp2-14==1.43.0-1 +libnghttp2-14==1.43.0-1+deb11u1 libnl-3-200==3.5.0-1 libnl-cli-3-200==3.5.0-1 libnl-genl-3-200==3.5.0-1 @@ -205,7 +206,7 @@ libpgm-5.3-0==5.3.128~dfsg-2 libpng16-16==1.6.37-3 libpopt0==1.18-2 libprocps8==2:3.3.17-5 -libprotobuf23==3.12.4-1 +libprotobuf23==3.12.4-1+deb11u1 libpsl5==0.21.0-1.2 libpython3-stdlib==3.9.2-3 libpython3.9==3.9.2-1 @@ -222,17 +223,15 @@ libslang2==2.3.2-5 libsodium23==1.0.18-1 libsqlite3-0==3.34.1-3 libssh2-1==1.9.0-2 -libssl1.1==1.1.1n-0+deb11u4+fips +libssl1.1==1.1.1n-0+deb11u5+fips libswsscommon==1.0.0 libsysfs2==2.1.0+repack-7 -libsystemd0==247.3-7+deb11u4 libtac2==1.4.1-1 libtcl8.6==8.6.11+dfsg-1 libtsan0==10.2.1-6 libubootenv-tool==0.3.2-0.1 libubootenv0.1==0.3.2-0.1 libubsan1==10.2.1-6 -libudev1==247.3-7+deb11u4 libunwind8==1.3.2-2 libusb-1.0-0==2:1.0.24-3 libutempter0==1.2.1-2 @@ -244,10 +243,10 @@ libyang-cpp==1.0.73 libzmq5==4.3.4-1 linux-base==4.6 linux-image-5.10.0-23-2-amd64-unsigned==5.10.179-3 -linux-perf==5.10.191-1 -linux-perf-5.10==5.10.191-1 -locales==2.31-13+deb11u6 -logrotate==3.18.0-2+deb11u1 +linux-perf==5.10.205-2 +linux-perf-5.10==5.10.205-2 +locales==2.31-13+deb11u7 +logrotate==3.18.0-2+deb11u2 lsb-release==11.1.0 lsof==4.93.2+dfsg-1.1 makedev==2.3.1-94.1 @@ -266,12 +265,13 @@ net-tools==1.60+git20181103.0eebece-1 netbase==6.3 netfilter-persistent==1.0.15 ntp==1:4.2.8p15+dfsg-1+deb10u2 +ntpdate==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+deb11u2+fips +openssh-server==1:8.4p1-5+deb11u2+fips +openssh-sftp-server==1:8.4p1-5+deb11u2+fips +openssl==1.1.1n-0+deb11u5+fips pci.ids==0.0~2021.02.08-1 pciutils==1:3.7.0-5 perl==5.32.1-4+deb11u2 @@ -328,6 +328,7 @@ systemd-sysv==247.3-7+deb11u4 tcpdump==4.99.0-2+deb11u1 tcptraceroute==1.5beta7+debian-4.1+b1 traceroute==1:2.1.0-2+deb11u1 +tzdata==2021a-1+deb11u11 u-boot-tools==2021.01+dfsg-5 ucf==3.0043 udev==247.3-7+deb11u4 diff --git a/files/build/versions/host-image/versions-deb-bullseye-arm64 b/files/build/versions/host-image/versions-deb-bullseye-arm64 index 5b3cb3e1173d..da2e9298b680 100644 --- a/files/build/versions/host-image/versions-deb-bullseye-arm64 +++ b/files/build/versions/host-image/versions-deb-bullseye-arm64 @@ -1,8 +1,8 @@ binutils-aarch64-linux-gnu==2.35.2-2 ebtables==2.0.11-4 icu-devtools==67.1-7 -libc-dev-bin==2.31-13+deb11u6 -libc6-dev==2.31-13+deb11u6 +libc-dev-bin==2.31-13+deb11u7 +libc6-dev==2.31-13+deb11u7 libcrypt-dev==1:4.4.18-4 libicu-dev==67.1-7 libicu67==67.1-7 @@ -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-23-2-arm64-unsigned==5.10.179-3 -linux-libc-dev==5.10.191-1 +linux-libc-dev==5.10.205-2 ntpstat==0.0.0.1-2 picocom==3.1-2 tsingma-bsp==1.0 diff --git a/files/build/versions/host-image/versions-deb-bullseye-armhf b/files/build/versions/host-image/versions-deb-bullseye-armhf index 97b28a2a2dde..171ce7648c69 100644 --- a/files/build/versions/host-image/versions-deb-bullseye-armhf +++ b/files/build/versions/host-image/versions-deb-bullseye-armhf @@ -1,25 +1,24 @@ binutils-arm-linux-gnueabihf==2.35.2-2 ebtables==2.0.11-4 icu-devtools==67.1-7 -libc-dev-bin==2.31-13+deb11u6 -libc6-dev==2.31-13+deb11u6 +libc-dev-bin==2.31-13+deb11u7 +libc6-dev==2.31-13+deb11u7 libcrypt-dev==1:4.4.18-4 libicu-dev==67.1-7 libicu67==67.1-7 libnsl-dev==1.3.0-2 -libssl1.1==1.1.1n-0+deb11u5 libtirpc-dev==1.3.1-1+deb11u1 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-image-5.10.0-23-2-armmp==5.10.179-3 -linux-libc-dev==5.10.191-1 +linux-libc-dev==5.10.205-2 mrvlprestera==1.0 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+deb11u5 +openssh-client==1:8.4p1-5+deb11u2 +openssh-server==1:8.4p1-5+deb11u2 +openssh-sftp-server==1:8.4p1-5+deb11u2 +openssl==1.1.1w-0+deb11u1 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 68a057af15c2..f9de0272e709 100644 --- a/files/build/versions/host-image/versions-py3 +++ b/files/build/versions/host-image/versions-py3 @@ -67,7 +67,6 @@ setuptools==49.6.0 six==1.16.0 systemd-python==235 tabulate==0.8.2 -thrift==0.13.0 toposort==1.6 urllib3==2.0.5 watchdog==0.10.3 diff --git a/files/build/versions/host-image/versions-py3-all-armhf b/files/build/versions/host-image/versions-py3-all-armhf index 4b03e7899eb1..61d8c26c7a49 100644 --- a/files/build/versions/host-image/versions-py3-all-armhf +++ b/files/build/versions/host-image/versions-py3-all-armhf @@ -1 +1,10 @@ +colorful==0.5.6 cryptography==3.3.1 +enlighten==1.12.4 +filelock==3.13.1 +lazy-object-proxy==1.10.0 +m2crypto==0.40.1 +pexpect==4.9.0 +pycairo==1.25.1 +pygments==2.17.2 +wcwidth==0.2.13 From 2b21e64ffc54cb9f4bd95b5519314b33566a160b Mon Sep 17 00:00:00 2001 From: Kevin Wang <65380078+kevinskwang@users.noreply.github.com> Date: Mon, 29 Jan 2024 10:10:54 +0800 Subject: [PATCH 088/419] [qos] change the template keyword from Compute-AI to ComputeAI (#17902) Why I did it Align the keywords to make qos configuration take effect Work item tracking Microsoft ADO (number only): How I did it Change the keyword to ComputeAI How to verify it reload minigraph and check the qos configuration --- files/build_templates/qos_config.j2 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/files/build_templates/qos_config.j2 b/files/build_templates/qos_config.j2 index 9a3741a397db..a85d4f1e4ee0 100644 --- a/files/build_templates/qos_config.j2 +++ b/files/build_templates/qos_config.j2 @@ -83,7 +83,7 @@ ('type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] in backend_device_types) and ('resource_type' in DEVICE_METADATA['localhost'] and - DEVICE_METADATA['localhost']['resource_type'] == 'Compute-AI') %} + DEVICE_METADATA['localhost']['resource_type'] == 'ComputeAI') %} {{- generate_tc_to_pg_map() }} {% else %} "TC_TO_PRIORITY_GROUP_MAP": { @@ -147,7 +147,7 @@ ('type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] in backend_device_types) and ('resource_type' in DEVICE_METADATA['localhost'] and - DEVICE_METADATA['localhost']['resource_type'] == 'Compute-AI') %} + DEVICE_METADATA['localhost']['resource_type'] == 'ComputeAI') %} {{- generate_dscp_to_tc_map() }} {% else %} "DSCP_TO_TC_MAP": { @@ -241,7 +241,7 @@ ('type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] in backend_device_types) and ('resource_type' in DEVICE_METADATA['localhost'] and - DEVICE_METADATA['localhost']['resource_type'] == 'Compute-AI') %} + DEVICE_METADATA['localhost']['resource_type'] == 'ComputeAI') %} "SCHEDULER": { "scheduler.0": { "type" : "DWRR", @@ -406,7 +406,7 @@ {% if 'type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] in backend_device_types and 'resource_type' in DEVICE_METADATA['localhost'] and - DEVICE_METADATA['localhost']['resource_type'] == 'Compute-AI' %} + DEVICE_METADATA['localhost']['resource_type'] == 'ComputeAI' %} {% for port in PORT_ACTIVE %} "{{ port }}|0": { "scheduler": "scheduler.0" From 6b8549c3bb4efa2fdf59c217c863223694ba377b Mon Sep 17 00:00:00 2001 From: Prince George <45705344+prgeor@users.noreply.github.com> Date: Tue, 19 Dec 2023 17:51:49 -0800 Subject: [PATCH 089/419] Fix the fsck script that does filesystem repair (#17424) Fix the fsck check which is not working. Potentially fixes #16938 Modified fsck script to run on the ext4.fsck on the appropriate disk where SONiC resides Microsoft ADO: 26098631 --- files/initramfs-tools/fsck-rootfs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/files/initramfs-tools/fsck-rootfs b/files/initramfs-tools/fsck-rootfs index 25b1c096aa5b..651d7e0a16c5 100644 --- a/files/initramfs-tools/fsck-rootfs +++ b/files/initramfs-tools/fsck-rootfs @@ -11,15 +11,19 @@ root_val="" set -- $(cat /proc/cmdline) for x in "$@"; do case "$x" in + root=UUID=*) + root_val="${x#root=UUID=}" + blkdev=$(blkid --uuid $root_val) + ;; root=*) - root_val="${x#root=}" + blkdev="${x#root=}" ;; esac done # Check the filesystem we are using -if [ ! -z $root_val ]; then - fstype=$(blkid -o value -s TYPE $root_val) +if [ ! -z $blkdev ]; then + fstype=$(blkid -o value -s TYPE $blkdev) case "$fstype" in ext4) cmd="fsck.ext4 -v -p" @@ -29,6 +33,6 @@ if [ ! -z $root_val ]; then ;; esac if [ ! -z "$cmd" ]; then - $cmd $root_val 2>&1 | gzip -c > /tmp/fsck.log.gz + $cmd $blkdev 2>&1 | gzip -c > /tmp/fsck.log.gz fi fi From 4599f7aeaf202011b95731bd532de4e683f968dd Mon Sep 17 00:00:00 2001 From: Lior Avramov <73036155+liorghub@users.noreply.github.com> Date: Tue, 30 Jan 2024 23:47:39 +0200 Subject: [PATCH 090/419] [Nvidia] Update syncd docker to use python version 3 (#17735) * Remove python2 from compilation of python-sdk-api * Upgrade Python version in syncd RPC docker image to Python3 --- .../docker-syncd-mlnx-rpc/Dockerfile.j2 | 48 +++++++++---------- .../docker-syncd-mlnx-rpc/ptf_nn_agent.conf | 2 +- .../mellanox/docker-syncd-mlnx/Dockerfile.j2 | 2 +- .../mellanox/sdk-src/python-sdk-api/Makefile | 2 +- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/platform/mellanox/docker-syncd-mlnx-rpc/Dockerfile.j2 b/platform/mellanox/docker-syncd-mlnx-rpc/Dockerfile.j2 index d10d560110c6..511e360cb5a5 100644 --- a/platform/mellanox/docker-syncd-mlnx-rpc/Dockerfile.j2 +++ b/platform/mellanox/docker-syncd-mlnx-rpc/Dockerfile.j2 @@ -1,5 +1,5 @@ ## -## Copyright (c) 2016-2021 NVIDIA CORPORATION & AFFILIATES. +## Copyright (c) 2016-2024 NVIDIA CORPORATION & AFFILIATES. ## Apache-2.0 ## ## Licensed under the Apache License, Version 2.0 (the "License"); @@ -25,23 +25,27 @@ RUN mkdir -p /var/run/sx_sdk RUN apt-get purge -y syncd ## Pre-install the fundamental packages -RUN apt-get update \ - && apt-get -y install \ - net-tools \ - python-setuptools \ - build-essential \ - libssl-dev \ - libffi-dev \ - python-dev \ - wget \ - cmake \ - libqt5core5a \ - libqt5network5 \ - libboost-atomic1.74.0 +RUN apt-get update \ + && apt-get -y install \ + net-tools \ + build-essential \ + libssl-dev \ + libffi-dev \ + wget \ + cmake \ + libqt5core5a \ + libqt5network5 \ + libboost-atomic1.74.0 \ + python3-pip \ + python3-dev \ + python-is-python3 \ + python3-setuptools + +RUN pip3 install --upgrade pip # Build and install python-scapy -RUN curl http://ftp.us.debian.org/debian/pool/main/s/scapy/python-scapy_2.4.0-2_all.deb --output python-scapy_2.4.0-2_all.deb \ - && dpkg -i python-scapy_2.4.0-2_all.deb \ +RUN curl http://ftp.us.debian.org/debian/pool/main/s/scapy/python3-scapy_2.4.0-2_all.deb --output python3-scapy_2.4.0-2_all.deb \ + && dpkg -i python3-scapy_2.4.0-2_all.deb \ && apt install -f {% if docker_syncd_mlnx_rpc_debs.strip() -%} @@ -64,10 +68,6 @@ RUN curl http://ftp.us.debian.org/debian/pool/main/s/scapy/python-scapy_2.4.0-2_ {{ install_debian_packages(docker_syncd_mlnx_rpc_pydebs.split(' ')) }} {% endif %} -# Install pip2 since it is no longer in the APT upstream -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py \ - && python2 get-pip.py - RUN wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \ && tar xvfz 1.0.0.tar.gz \ && cd nanomsg-1.0.0 \ @@ -78,10 +78,10 @@ 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 \ - && pip2 install cffi==1.7.0 \ - && pip2 install --upgrade cffi==1.7.0 \ - && pip2 install wheel \ - && pip2 install nnpy \ + && pip3 install cffi==1.16.0 \ + && pip3 install wheel \ + && pip3 install nnpy \ + && pip3 install ptf \ && mkdir -p /opt \ && cd /opt \ && wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py \ diff --git a/platform/mellanox/docker-syncd-mlnx-rpc/ptf_nn_agent.conf b/platform/mellanox/docker-syncd-mlnx-rpc/ptf_nn_agent.conf index 80812464a19e..1b91d3efbeba 100644 --- a/platform/mellanox/docker-syncd-mlnx-rpc/ptf_nn_agent.conf +++ b/platform/mellanox/docker-syncd-mlnx-rpc/ptf_nn_agent.conf @@ -1,5 +1,5 @@ [program:ptf_nn_agent] -command=/usr/bin/python2 /opt/ptf_nn_agent.py --device-socket 1@tcp://0.0.0.0:10900 -i 1-3@Ethernet12 --set-nn-rcv-buffer=109430400 --set-iface-rcv-buffer=109430400 --set-nn-snd-buffer=109430400 --set-iface-snd-buffer=109430400 +command=/usr/bin/python3 /opt/ptf_nn_agent.py --device-socket 1@tcp://0.0.0.0:10900 -i 1-3@Ethernet12 --set-nn-rcv-buffer=109430400 --set-iface-rcv-buffer=109430400 --set-nn-snd-buffer=109430400 --set-iface-snd-buffer=109430400 process_name=ptf_nn_agent stdout_logfile=/tmp/ptf_nn_agent.out.log stderr_logfile=/tmp/ptf_nn_agent.err.log diff --git a/platform/mellanox/docker-syncd-mlnx/Dockerfile.j2 b/platform/mellanox/docker-syncd-mlnx/Dockerfile.j2 index 3d68ba4bc9f7..dbd51e2782ea 100755 --- a/platform/mellanox/docker-syncd-mlnx/Dockerfile.j2 +++ b/platform/mellanox/docker-syncd-mlnx/Dockerfile.j2 @@ -1,5 +1,5 @@ ## -## Copyright (c) 2016-2021 NVIDIA CORPORATION & AFFILIATES. +## Copyright (c) 2016-2024 NVIDIA CORPORATION & AFFILIATES. ## Apache-2.0 ## ## Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/platform/mellanox/sdk-src/python-sdk-api/Makefile b/platform/mellanox/sdk-src/python-sdk-api/Makefile index 5ac3e8504968..2d27e367e825 100644 --- a/platform/mellanox/sdk-src/python-sdk-api/Makefile +++ b/platform/mellanox/sdk-src/python-sdk-api/Makefile @@ -18,7 +18,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : ./autogen.sh fi - debuild -e PYTHON_INTERPRETERS="\"python2 python3\"" -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) + debuild -e PYTHON_INTERPRETERS="\"python3\"" -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) popd From e2ae58102875c5b79a3b7572247332d4e8740bf1 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 31 Jan 2024 16:32:37 +0800 Subject: [PATCH 091/419] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#17954) #### Why I did it src/sonic-utilities ``` * 9c1d489c - (HEAD -> 202311, origin/202311) Fix database initialization for db_migrator (#3100) (10 hours ago) [ganglv] * e9ae14d2 - Support golden config in db migrator (#3076) (16 hours ago) [ganglv] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index e70b05460406..9c1d489ca5cd 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit e70b054604062683f766a28dc295c7443b63c4a1 +Subproject commit 9c1d489ca5cd849020610c4a57664c675c64d321 From d88051cc3aeb8cf92a1864b2e3da9ad98f6a34c0 Mon Sep 17 00:00:00 2001 From: Nazarii Hnydyn Date: Sat, 20 Jan 2024 07:52:30 +0200 Subject: [PATCH 092/419] [sonic-cfggen]: Optimize template rendering and database access. (#17740) #### Why I did it * Improved switch init time ### How I did it * Replaced: `sonic-cfggen` -> `sonic-db-cli` * Aggregated template list for `sonic-cfggen` #### How to verify it 1. Run `warm-reboot` --- dockers/docker-database/docker-database-init.sh | 10 ++++++---- dockers/docker-orchagent/docker-init.j2 | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/dockers/docker-database/docker-database-init.sh b/dockers/docker-database/docker-database-init.sh index 9fe5ae242245..f6f8522bb944 100755 --- a/dockers/docker-database/docker-database-init.sh +++ b/dockers/docker-database/docker-database-init.sh @@ -63,8 +63,9 @@ if [[ $DATABASE_TYPE == "chassisdb" ]]; then echo "Init docker-database-chassis..." update_chassisdb_config -j $db_cfg_file_tmp -k -p $chassis_db_port # generate all redis server supervisord configuration file - sonic-cfggen -j $db_cfg_file_tmp -t /usr/share/sonic/templates/supervisord.conf.j2 > /etc/supervisor/conf.d/supervisord.conf - sonic-cfggen -j $db_cfg_file_tmp -t /usr/share/sonic/templates/critical_processes.j2 > /etc/supervisor/critical_processes + sonic-cfggen -j $db_cfg_file_tmp \ + -t /usr/share/sonic/templates/supervisord.conf.j2,/etc/supervisor/conf.d/supervisord.conf \ + -t /usr/share/sonic/templates/critical_processes.j2,/etc/supervisor/critical_processes rm $db_cfg_file_tmp exec /usr/local/bin/supervisord exit 0 @@ -81,8 +82,9 @@ then fi # delete chassisdb config to generate supervisord config update_chassisdb_config -j $db_cfg_file_tmp -d -sonic-cfggen -j $db_cfg_file_tmp -t /usr/share/sonic/templates/supervisord.conf.j2 > /etc/supervisor/conf.d/supervisord.conf -sonic-cfggen -j $db_cfg_file_tmp -t /usr/share/sonic/templates/critical_processes.j2 > /etc/supervisor/critical_processes +sonic-cfggen -j $db_cfg_file_tmp \ +-t /usr/share/sonic/templates/supervisord.conf.j2,/etc/supervisor/conf.d/supervisord.conf \ +-t /usr/share/sonic/templates/critical_processes.j2,/etc/supervisor/critical_processes if [[ "$start_chassis_db" != "1" ]] && [[ -z "$chassis_db_address" ]]; then cp $db_cfg_file_tmp $db_cfg_file diff --git a/dockers/docker-orchagent/docker-init.j2 b/dockers/docker-orchagent/docker-init.j2 index 1e8574de153b..41dbe27285f1 100755 --- a/dockers/docker-orchagent/docker-init.j2 +++ b/dockers/docker-orchagent/docker-init.j2 @@ -23,8 +23,8 @@ CFGGEN_PARAMS=" \ -t /usr/share/sonic/templates/wait_for_link.sh.j2,/usr/bin/wait_for_link.sh \ " VLAN=$(sonic-cfggen $CFGGEN_PARAMS) -SUBTYPE=$(sonic-cfggen -d -v "DEVICE_METADATA['localhost']['subtype']") -SWITCH_TYPE=${SWITCH_TYPE:-`sonic-cfggen -d -v "DEVICE_METADATA['localhost']['switch_type']"`} +SUBTYPE=$(sonic-db-cli -s CONFIG_DB HGET 'DEVICE_METADATA|localhost' 'subtype') +SWITCH_TYPE=${SWITCH_TYPE:-`sonic-db-cli -s CONFIG_DB HGET 'DEVICE_METADATA|localhost' 'switch_type'`} chmod +x /usr/bin/wait_for_link.sh # Executed platform specific initialization tasks. From 3ba603960b7cf55e539c43f5351f54b7de27d20a Mon Sep 17 00:00:00 2001 From: Oleksandr Ivantsiv Date: Tue, 23 Jan 2024 16:29:55 -0800 Subject: [PATCH 093/419] [dns] Do not apply dynamic DNS configuration when MGMT interface has static IP address. (#17769) ### Why I did it Fix the issue detected by[ TestStaticMgmtPortIP::test_dynamic_dns_not_working_when_static_ip_configured ](https://github.com/sonic-net/sonic-mgmt/blob/master/tests/dns/static_dns/test_static_dns.py#L105C9-L105C63) test. ### How I did it Query MGMT interface configuration. Do not apply dynamic DNS configuration when MGMT interface has static IP address. #### How to verify it Run `tests/dns/static_dns/test_static_dns.py` sonic-mgmt tests. --- .../resolv-config/resolv-config.sh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/files/image_config/resolv-config/resolv-config.sh b/files/image_config/resolv-config/resolv-config.sh index cffda6acb54b..a9f061e31f27 100755 --- a/files/image_config/resolv-config/resolv-config.sh +++ b/files/image_config/resolv-config/resolv-config.sh @@ -14,13 +14,24 @@ start() { update_symlink - redis-dump -d 4 -k "DNS_NAMESERVER*" -y > /tmp/dns.json - if [[ $? -eq 0 && "$(cat /tmp/dns.json)" != "{}" ]]; then + has_static_mgmt_ip=false + mgmt_ip_cfg=$(redis-dump -d 4 -k "MGMT_INTERFACE|eth0|*" -y) + if [[ $? -eq 0 && ${mgmt_ip_cfg} != "{}" ]]; then + has_static_mgmt_ip=true + fi + + has_static_dns=false + dns_cfg=$(redis-dump -d 4 -k "DNS_NAMESERVER*" -y) + if [[ $? -eq 0 && ${dns_cfg} != "{}" ]]; then + has_static_dns=true + fi + + if [[ ${has_static_mgmt_ip} == true || ${has_static_dns} == true ]]; then # Apply static DNS configuration and disable updates /sbin/resolvconf --disable-updates pushd ${CONFIG_DIR} # Backup dynamic configuration to restore it when the static configuration is removed - mv ${DYNAMIC_CONFIG_FILE_TEMPLATE} ${WD} || true + mv ${DYNAMIC_CONFIG_FILE_TEMPLATE} ${WD} 2>/dev/null || true sonic-cfggen -d -t /usr/share/sonic/templates/resolv.conf.j2,${STATIC_CONFIG_FILE} @@ -34,7 +45,7 @@ start() pushd ${CONFIG_DIR} rm -f ${STATIC_CONFIG_FILE} # Restore dynamic configuration if it exists - mv ${WD}/${DYNAMIC_CONFIG_FILE_TEMPLATE} ${CONFIG_DIR} || true + mv ${WD}/${DYNAMIC_CONFIG_FILE_TEMPLATE} ${CONFIG_DIR} 2>/dev/null || true /sbin/resolvconf --enable-updates /sbin/resolvconf -u From d53fba12cbcda0f71b6397d06a758cb5c3a00350 Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Mon, 22 Jan 2024 22:22:07 +0800 Subject: [PATCH 094/419] Fix error log while creating PSU thermal object (#17789) - Why I did it If a PSU is not present, there could be error log while restarting psud or thermalctld: Jan 8 17:15:52.689616 sonic ERR pmon#psud: Thermal sysfs /run/hw-management/thermal/psu2_temp1_max does not exist Jan 8 17:15:57.747723 sonic ERR pmon#thermalctld: Thermal sysfs /run/hw-management/thermal/psu2_temp1 does not exist - How I did it if a PSU is not present, we should not check the PSU temperature sysfs. --- .../sonic_platform/thermal.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py index cdd47af607c2..7ac703b7841c 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py @@ -220,15 +220,15 @@ def create_indexable_thermal(rule, index, sysfs_folder, position, presence_cb=No name = rule['name'].format(index) sysfs_folder = rule.get('sysfs_folder', sysfs_folder) temp_file = os.path.join(sysfs_folder, rule['temperature'].format(index)) - _check_thermal_sysfs_existence(temp_file) + _check_thermal_sysfs_existence(temp_file, presence_cb) if 'high_threshold' in rule: high_th_file = os.path.join(sysfs_folder, rule['high_threshold'].format(index)) - _check_thermal_sysfs_existence(high_th_file) + _check_thermal_sysfs_existence(high_th_file, presence_cb) else: high_th_file = None if 'high_critical_threshold' in rule: high_crit_th_file = os.path.join(sysfs_folder, rule['high_critical_threshold'].format(index)) - _check_thermal_sysfs_existence(high_crit_th_file) + _check_thermal_sysfs_existence(high_crit_th_file, presence_cb) else: high_crit_th_file = None high_th_default = rule.get('high_threshold_default') @@ -253,15 +253,15 @@ def create_single_thermal(rule, sysfs_folder, position, presence_cb=None): sysfs_folder = rule.get('sysfs_folder', sysfs_folder) temp_file = os.path.join(sysfs_folder, temp_file) - _check_thermal_sysfs_existence(temp_file) + _check_thermal_sysfs_existence(temp_file, presence_cb) if 'high_threshold' in rule: high_th_file = os.path.join(sysfs_folder, rule['high_threshold']) - _check_thermal_sysfs_existence(high_th_file) + _check_thermal_sysfs_existence(high_th_file, presence_cb) else: high_th_file = None if 'high_critical_threshold' in rule: high_crit_th_file = os.path.join(sysfs_folder, rule['high_critical_threshold']) - _check_thermal_sysfs_existence(high_crit_th_file) + _check_thermal_sysfs_existence(high_crit_th_file, presence_cb) else: high_crit_th_file = None high_th_default = rule.get('high_threshold_default') @@ -274,7 +274,11 @@ def create_single_thermal(rule, sysfs_folder, position, presence_cb=None): return RemovableThermal(name, temp_file, high_th_file, high_crit_th_file, high_th_default, high_crit_th_default, scale, position, presence_cb) -def _check_thermal_sysfs_existence(file_path): +def _check_thermal_sysfs_existence(file_path, presence_cb): + if presence_cb: + status, _ = presence_cb() + if not status: + return if not os.path.exists(file_path): logger.log_error('Thermal sysfs {} does not exist'.format(file_path)) From 23190ad00006637b18aa3462344c454d3351fffb Mon Sep 17 00:00:00 2001 From: Stepan Blyshchak <38952541+stepanblyschak@users.noreply.github.com> Date: Thu, 7 Dec 2023 15:24:21 +0200 Subject: [PATCH 095/419] [config-chassisdb] use cached variables (#17342) - Why I did it Improve boot performance mostly needed for fast and warmboot - How I did it Use cached variable. - How to verify it Boot the system. Simply do "systemd-analyze blame" and look at service start time. Signed-off-by: Stepan Blyschak --- files/image_config/config-chassisdb/config-chassisdb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/files/image_config/config-chassisdb/config-chassisdb b/files/image_config/config-chassisdb/config-chassisdb index 3bdcf0a0fbe2..f64443b274f3 100755 --- a/files/image_config/config-chassisdb/config-chassisdb +++ b/files/image_config/config-chassisdb/config-chassisdb @@ -27,7 +27,7 @@ config_chassis_db() { startdb_file="/etc/sonic/chassisdb.conf" [ ! -e $startdb_file ] || rm $startdb_file - platform=$(sonic-cfggen -H -v DEVICE_METADATA.localhost.platform) + platform=${PLATFORM:-`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`} # database-chassis services will start when $chassis_config file exists chassis_config="/usr/share/sonic/device/$platform/chassisdb.conf" if [ ! -e $chassis_config ]; then @@ -54,6 +54,9 @@ config_chassis_db() { fi } +# read SONiC immutable variables +[ -f /etc/sonic/sonic-environment ] && . /etc/sonic/sonic-environment + config_chassis_db exit 0 From f419319e0e3efd02d8fcd868fe843b0de2c4ad07 Mon Sep 17 00:00:00 2001 From: Nazarii Hnydyn Date: Thu, 14 Dec 2023 08:41:12 +0200 Subject: [PATCH 096/419] [installer] Create a blank grubenv if doesn't exist. (#17414) - Why I did it To fix BIOS firmware update after fresh image installation from ONiE - How I did it Initialized empty GRUB environment file after ONiE installation - How to verify it Install image from ONiE Run BIOS firmware upgrade Signed-off-by: Nazarii Hnydyn --- installer/default_platform.conf | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/installer/default_platform.conf b/installer/default_platform.conf index fca775447692..7a9fe00ecf4e 100755 --- a/installer/default_platform.conf +++ b/installer/default_platform.conf @@ -264,14 +264,6 @@ demo_install_grub() exit 1 } - # Create a blank environment block file. - if [ ! -f "$onie_initrd_tmp/$demo_mnt/grub/grubenv" ]; then - grub-editenv "$onie_initrd_tmp/$demo_mnt/grub/grubenv" create || { - echo "ERROR: grub-editenv failed on: $blk_dev" - exit 1 - } - fi - if [ "$demo_type" = "DIAG" ] ; then # Install GRUB in the partition also. This allows for # chainloading the DIAG image from another OS. @@ -354,14 +346,6 @@ demo_install_uefi_grub() } rm -f $grub_install_log - # Create a blank environment block file. - if [ ! -f "$demo_mnt/grub/grubenv" ]; then - grub-editenv "$demo_mnt/grub/grubenv" create || { - echo "ERROR: grub-editenv failed on: $blk_dev" - exit 1 - } - fi - # Configure EFI NVRAM Boot variables. --create also sets the # new boot number as active. grub=$(find /boot/efi/EFI/$demo_volume_label/ -name grub*.efi -exec basename {} \;) @@ -631,6 +615,14 @@ EOF umount $demo_mnt else cp $grub_cfg $onie_initrd_tmp/$demo_mnt/grub/grub.cfg + + # Create a blank environment block file. + if [ ! -f "$onie_initrd_tmp/$demo_mnt/grub/grubenv" ]; then + grub-editenv "$onie_initrd_tmp/$demo_mnt/grub/grubenv" create || { + echo "ERROR: grub-editenv failed on: $blk_dev" + exit 1 + } + fi fi cd / From 48f7613f9592493127fbcf713dd0724d10e616e0 Mon Sep 17 00:00:00 2001 From: Nazarii Hnydyn Date: Thu, 18 Jan 2024 18:04:00 +0200 Subject: [PATCH 097/419] [swss/syncd]: Remove dependency on interfaces-config.service (#17739) Signed-off-by: Nazarii Hnydyn Co-authored-by: Stepan Blyshchak <38952541+stepanblyschak@users.noreply.github.com> --- files/build_templates/per_namespace/swss.service.j2 | 1 - files/build_templates/per_namespace/syncd.service.j2 | 1 - 2 files changed, 2 deletions(-) diff --git a/files/build_templates/per_namespace/swss.service.j2 b/files/build_templates/per_namespace/swss.service.j2 index 765bee8a7ac0..58bca6a219a6 100644 --- a/files/build_templates/per_namespace/swss.service.j2 +++ b/files/build_templates/per_namespace/swss.service.j2 @@ -11,7 +11,6 @@ Requires=opennsl-modules.service {% endif %} Requires=updategraph.service After=updategraph.service -After=interfaces-config.service BindsTo=sonic.target After=sonic.target Before=ntp-config.service diff --git a/files/build_templates/per_namespace/syncd.service.j2 b/files/build_templates/per_namespace/syncd.service.j2 index 66861efca473..1fb803390a80 100644 --- a/files/build_templates/per_namespace/syncd.service.j2 +++ b/files/build_templates/per_namespace/syncd.service.j2 @@ -16,7 +16,6 @@ After=nps-modules.service {% endif %} Requires=updategraph.service After=updategraph.service -After=interfaces-config.service BindsTo=sonic.target After=sonic.target Before=ntp-config.service From 747ddb19782df39889c431eb6150465a000a3493 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 1 Feb 2024 16:32:49 +0800 Subject: [PATCH 098/419] [submodule] Update submodule sonic-platform-common to the latest HEAD automatically (#17980) #### Why I did it src/sonic-platform-common ``` * 83a8c7a - (HEAD -> 202311, origin/202311) Fix issue: QSFP module with id 0x0d can be parsed using 8636 (#412) (4 hours ago) [Stephen Sun] ``` #### How I did it #### How to verify it #### Description for the changelog --- 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 570bb3f8b290..83a8c7a446c5 160000 --- a/src/sonic-platform-common +++ b/src/sonic-platform-common @@ -1 +1 @@ -Subproject commit 570bb3f8b290129279c25016dcf9c96894e1ca34 +Subproject commit 83a8c7a446c57d538b9228852ff0b2ea37dbdb96 From e676ad1aa0b15f3db3a1dc26ee1ebb813ebd1308 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 1 Feb 2024 18:33:13 +0800 Subject: [PATCH 099/419] [submodule] Update submodule sonic-linux-kernel to the latest HEAD automatically (#17979) #### Why I did it src/sonic-linux-kernel ``` * 342f6c3 - (HEAD -> 202311, origin/202311) [kconfig] Set default SATA Link Power Management policy (#363) (4 hours ago) [Volodymyr Samotiy] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-linux-kernel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-linux-kernel b/src/sonic-linux-kernel index 46db038ecc6f..342f6c39d401 160000 --- a/src/sonic-linux-kernel +++ b/src/sonic-linux-kernel @@ -1 +1 @@ -Subproject commit 46db038ecc6fef6bc5e7bef8a7dc462bf9e6266a +Subproject commit 342f6c39d401bc0058cadcb8d0402001ad920928 From 27b05ddac3f85aa7716484c732f4b38847c500e0 Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Thu, 1 Feb 2024 16:28:21 -0800 Subject: [PATCH 100/419] [FRR] Fix zebra memory leak when bgp fib suppress pending is enabled (#17484) (#17977) Fix zebra leaking memory with fib suppress enabled. Porting the fix from FRRouting/frr#14983 While running test_stress_route.py, systems with lower memory started to throw low memory logs. On further investigation, a memory leak has been found in zebra which was fixed in the FRR community. --- ...lane_fpm_nl-return-path-leaks-memory.patch | 57 +++++++++++++++++++ src/sonic-frr/patch/series | 1 + 2 files changed, 58 insertions(+) create mode 100644 src/sonic-frr/patch/0033-zebra-The-dplane_fpm_nl-return-path-leaks-memory.patch diff --git a/src/sonic-frr/patch/0033-zebra-The-dplane_fpm_nl-return-path-leaks-memory.patch b/src/sonic-frr/patch/0033-zebra-The-dplane_fpm_nl-return-path-leaks-memory.patch new file mode 100644 index 000000000000..00e8cc0062ca --- /dev/null +++ b/src/sonic-frr/patch/0033-zebra-The-dplane_fpm_nl-return-path-leaks-memory.patch @@ -0,0 +1,57 @@ +From c13964525dae96299dc54daf635609971576a09e Mon Sep 17 00:00:00 2001 +From: Donald Sharp +Date: Mon, 11 Dec 2023 13:41:36 -0500 +Subject: [PATCH] zebra: The dplane_fpm_nl return path leaks memory + +The route entry created when using a ctx to pass route +entry data backup to the master pthread in zebra is +being leaked. Prevent this from happening. + +Signed-off-by: Donald Sharp + +diff --git a/zebra/rib.h b/zebra/rib.h +index 016106312..e99eee67c 100644 +--- a/zebra/rib.h ++++ b/zebra/rib.h +@@ -352,6 +352,8 @@ extern void _route_entry_dump(const char *func, union prefixconstptr pp, + union prefixconstptr src_pp, + const struct route_entry *re); + ++void zebra_rib_route_entry_free(struct route_entry *re); ++ + struct route_entry * + zebra_rib_route_entry_new(vrf_id_t vrf_id, int type, uint8_t instance, + uint32_t flags, uint32_t nhe_id, uint32_t table_id, +diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c +index 6bdc15592..fc9e8c457 100644 +--- a/zebra/rt_netlink.c ++++ b/zebra/rt_netlink.c +@@ -1001,6 +1001,8 @@ int netlink_route_change_read_unicast_internal(struct nlmsghdr *h, + re, ng, startup, ctx); + if (ng) + nexthop_group_delete(&ng); ++ if (ctx) ++ zebra_rib_route_entry_free(re); + } else { + /* + * I really don't see how this is possible +diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c +index f2f20bcf7..1cefdfae7 100644 +--- a/zebra/zebra_rib.c ++++ b/zebra/zebra_rib.c +@@ -4136,6 +4136,12 @@ struct route_entry *zebra_rib_route_entry_new(vrf_id_t vrf_id, int type, + + return re; + } ++ ++void zebra_rib_route_entry_free(struct route_entry *re) ++{ ++ XFREE(MTYPE_RE, re); ++} ++ + /* + * Internal route-add implementation; there are a couple of different public + * signatures. Callers in this path are responsible for the memory they +-- +2.17.1 + diff --git a/src/sonic-frr/patch/series b/src/sonic-frr/patch/series index e2f5bc28a91f..3c9c6e6acf25 100644 --- a/src/sonic-frr/patch/series +++ b/src/sonic-frr/patch/series @@ -29,6 +29,7 @@ cross-compile-changes.patch 0030-bgpd-Treat-EOR-as-withdrawn-to-avoid-unwanted-handli.patch 0031-bgpd-Ignore-handling-NLRIs-if-we-received-MP_UNREACH.patch 0032-zebra-Fix-fpm-multipath-encap-addition.patch +0033-zebra-The-dplane_fpm_nl-return-path-leaks-memory.patch 0034-fpm-Use-vrf_id-for-vrf-not-tabled_id.patch 0035-fpm-ignore-route-from-default-table.patch 0036-Add-support-of-bgp-l3vni-evpn.patch From fcef7d1095da350aca867ea9837c496c3478b457 Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Thu, 1 Feb 2024 17:53:49 -0800 Subject: [PATCH 101/419] [202311][Mellanox]Update SAI to 2311.26.0.28, SDK/FW to 4.6.2202/2012.2202 (#17975) --- platform/mellanox/fw.mk | 12 ++++++------ platform/mellanox/mlnx-sai.mk | 2 +- platform/mellanox/sdk.mk | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/platform/mellanox/fw.mk b/platform/mellanox/fw.mk index 82e5dbfc898a..7bfdee4026b4 100644 --- a/platform/mellanox/fw.mk +++ b/platform/mellanox/fw.mk @@ -21,33 +21,33 @@ MLNX_FW_BASE_PATH = $(MLNX_SDK_BASE_PATH) # Place an URL here to FW if you want to download FW instead MLNX_FW_BASE_URL = -SIMX_VERSION = 23.7-1086 +SIMX_VERSION = 23.10-1123 FW_FROM_URL = y -MLNX_FW_ASSETS_RELEASE_TAG = fw-2012.1062 +MLNX_FW_ASSETS_RELEASE_TAG = fw-2012.2202 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.2012.1062 +MLNX_SPC_FW_VERSION = 13.2012.2202 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.2012.1062 +MLNX_SPC2_FW_VERSION = 29.2012.2202 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.2012.1062 +MLNX_SPC3_FW_VERSION = 30.2012.2202 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) -MLNX_SPC4_FW_VERSION = 34.2012.1062 +MLNX_SPC4_FW_VERSION = 34.2012.2202 MLNX_SPC4_FW_FILE = fw-SPC4-rel-$(subst .,_,$(MLNX_SPC4_FW_VERSION))-EVB.mfa $(MLNX_SPC4_FW_FILE)_PATH = $(MLNX_FW_BASE_PATH) $(MLNX_SPC4_FW_FILE)_URL = $(MLNX_FW_BASE_URL)/$(MLNX_SPC4_FW_FILE) diff --git a/platform/mellanox/mlnx-sai.mk b/platform/mellanox/mlnx-sai.mk index 0061132941e0..c640420c23cd 100644 --- a/platform/mellanox/mlnx-sai.mk +++ b/platform/mellanox/mlnx-sai.mk @@ -1,6 +1,6 @@ # Mellanox SAI -MLNX_SAI_VERSION = SAIBuild2211.25.1.4 +MLNX_SAI_VERSION = SAIBuild2311.26.0.28 MLNX_SAI_ASSETS_GITHUB_URL = https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins MLNX_SAI_ASSETS_RELEASE_TAG = sai-$(MLNX_SAI_VERSION)-$(BLDENV)-$(CONFIGURED_ARCH) MLNX_SAI_ASSETS_URL = $(MLNX_ASSETS_GITHUB_URL)/releases/download/$(MLNX_SAI_ASSETS_RELEASE_TAG) diff --git a/platform/mellanox/sdk.mk b/platform/mellanox/sdk.mk index 096432b3efb9..d91823d41d46 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.6.1062 +MLNX_SDK_VERSION = 4.6.2202 MLNX_SDK_ISSU_VERSION = 101 MLNX_SDK_DRIVERS_GITHUB_URL = https://github.com/Mellanox/Spectrum-SDK-Drivers From 34a86bd8f964f9df3f887598ff61c673a361d3ae Mon Sep 17 00:00:00 2001 From: Ze Gan Date: Thu, 14 Dec 2023 14:49:04 +0800 Subject: [PATCH 102/419] [Azp]: Fix azp on building ubuntu20.04 and sonic-mgmt (#17439) The Azp failed on ubuntu20.04 and sonic-mgmt building due to sonic-dash-api updating. Signed-off-by: Ze Gan --- .azure-pipelines/azure-pipelines-build-ubuntu-2004.yml | 2 +- dockers/docker-sonic-mgmt/Dockerfile.j2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/azure-pipelines-build-ubuntu-2004.yml b/.azure-pipelines/azure-pipelines-build-ubuntu-2004.yml index 697c87b3c9ea..1ff50719cee7 100644 --- a/.azure-pipelines/azure-pipelines-build-ubuntu-2004.yml +++ b/.azure-pipelines/azure-pipelines-build-ubuntu-2004.yml @@ -34,7 +34,7 @@ stages: mkdir -p /tmp/artifacts displayName: "Install dependencies" - script: | - SONIC_CONFIG_MAKE_JOBS=$(nproc) CONFIGURED_ARCH=amd64 DEST=/tmp/artifacts make -f ../rules/protobuf.mk -f protobuf/Makefile + BLDENV=bullseye SONIC_CONFIG_MAKE_JOBS=$(nproc) CONFIGURED_ARCH=amd64 DEST=/tmp/artifacts make -f ../rules/protobuf.mk -f protobuf/Makefile workingDirectory: src displayName: "Build protobuf" - script: | diff --git a/dockers/docker-sonic-mgmt/Dockerfile.j2 b/dockers/docker-sonic-mgmt/Dockerfile.j2 index be644bdd61d8..3efb3e5995db 100755 --- a/dockers/docker-sonic-mgmt/Dockerfile.j2 +++ b/dockers/docker-sonic-mgmt/Dockerfile.j2 @@ -228,7 +228,7 @@ RUN mkdir -p /tmp/protobuf \ # Install dash-api RUN cd /tmp \ && mkdir -p /usr/lib/python3/dist-packages/dash_api \ - && wget https://raw.githubusercontent.com/sonic-net/sonic-buildimage/master/src/sonic-dash-api/pypkg/__init__.py -O /usr/lib/python3/dist-packages/dash_api/__init__.py \ + && wget https://raw.githubusercontent.com/sonic-net/sonic-dash-api/master/misc/pypkg/dash_api/__init__.py -O /usr/lib/python3/dist-packages/dash_api/__init__.py \ && git clone https://github.com/sonic-net/sonic-dash-api.git \ && protoc -I=sonic-dash-api/proto --python_out=/usr/lib/python3/dist-packages/dash_api sonic-dash-api/proto/*.proto \ && rm -rf /tmp/sonic-dash-api From f35512ef0a07e14532b86905b0c6f2c8a1908f65 Mon Sep 17 00:00:00 2001 From: Hua Liu <58683130+liuh-80@users.noreply.github.com> Date: Fri, 26 Jan 2024 16:00:00 +0800 Subject: [PATCH 103/419] [TACACS] Fix when set TACACS to "tacacs+, local" user can run blocked command with local permission issue. (#17749) Fix when set TACACS to "tacacs+, local" user can run blocked command with local permission issue. #### Why I did it When set TACACS to "tacacs+, local", user still can run a blocked command with local permission. ##### Work item tracking - Microsoft ADO: 26399545 #### How I did it Fix code to reject command when authorized failed from TACACS server side. #### How to verify it Pass all UT. ### Description for the changelog Fix when set TACACS to "tacacs+, local" user can run blocked command with local permission issue. --- src/tacacs/bash_tacplus/bash_tacplus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tacacs/bash_tacplus/bash_tacplus.c b/src/tacacs/bash_tacplus/bash_tacplus.c index 6e72e8f0a0cf..169d6bec3a0f 100644 --- a/src/tacacs/bash_tacplus/bash_tacplus.c +++ b/src/tacacs/bash_tacplus/bash_tacplus.c @@ -471,8 +471,9 @@ int on_shell_execve (char *user, int shell_level, char *cmd, char **argv) fprintf(stdout, "%s not authorized by TACACS+ with given arguments, not executing\n", cmd); break; default: + // when command reject by server, authorization will failed immediately fprintf(stdout, "%s authorize failed by TACACS+ with given arguments, not executing\n", cmd); - break; + return ret; } if ((tacacs_ctrl & AUTHORIZATION_FLAG_LOCAL) == 0) { From 765377ac8122bd29ef82d65162aacb4beda69c5f Mon Sep 17 00:00:00 2001 From: davidpil2002 <91657985+davidpil2002@users.noreply.github.com> Date: Mon, 25 Dec 2023 11:14:17 +0200 Subject: [PATCH 104/419] password-hardening: Add support to disable expiration date like in Linux (PAM) (#17426) - Why I did it Enhance the feature to support disabling password hardening as Linux support. -1: expiration will never occur 0: expiration will expired immediately Opened bug: #17427 - How I did it Added the -1 value to be supported in hostcfgd and this value will propagate to the relevant Linux files - How to verify it Pls see the details in the bug description that link attached above --- src/sonic-yang-models/yang-models/sonic-passwh.yang | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sonic-yang-models/yang-models/sonic-passwh.yang b/src/sonic-yang-models/yang-models/sonic-passwh.yang index 347a740180db..5047b40c573d 100755 --- a/src/sonic-yang-models/yang-models/sonic-passwh.yang +++ b/src/sonic-yang-models/yang-models/sonic-passwh.yang @@ -28,14 +28,14 @@ module sonic-passwh { } leaf expiration { description "expiration time (days unit)"; - type uint16 { - range 1..365; + type int16 { + range -1..365; } } leaf expiration_warning { description "expiration warning time (days unit)"; - type uint8 { - range 1..30; + type int8 { + range -1..30; } } leaf history_cnt { From 9eef01d7a73b4182f2deff33a984856c4b69089f Mon Sep 17 00:00:00 2001 From: vdahiya12 <67608553+vdahiya12@users.noreply.github.com> Date: Tue, 16 Jan 2024 11:34:19 -0800 Subject: [PATCH 105/419] [Arista] Update config.bcm of 7060_cx32s for handling 40g optics with unreliable los settings (#17768) For 40G optics there is SAI handling of T0 facing ports to be set with SR4 type and unreliable los set for a fixed set of ports. For this property to be invoked the requirement is set phy_unlos_msft=1 in config.bcm. This change is to meet the requirement and once this property is set, the los/interface type settings is applied by SAI on the required ports. Why I did it For Arista-7060CX-32S-Q32 T1, 40G ports RX_ERR minimalization during connected device reboot can be achieved by turning on Unreliable LOS and SR4 media_type for all ports which are connected to T0. The property phy_unlos_msft=1 is to exclusively enable this property. Microsoft ADO: 25941176 How I did it Changes in SAI and turning on property How to verify it Ran the changes on a testbed and verified configurations are as intended. with property admin@sonic2:~$ bcmcmd "phy diag xe8 dsc config" | grep -C 2 "LOS" Brdfe_on = 0 Media Type = 2 Unreliable LOS = 1 Scrambling Disable = 0 Lane Config from PCS = 0 without property admin@sonic:~$ bcmcmd "phy diag xe8 dsc config" | grep -C 2 "LOS" Brdfe_on = 0 Media Type = 0 Unreliable LOS = 0 Scrambling Disable = 0 Lane Config from PCS = 0 Signed-off-by: vaibhav-dahiya --- .../Arista-7060CX-32S-Q32/th-a7060-cx32s-32x40G-t1.config.bcm | 1 + src/sonic-device-data/tests/permitted_list | 1 + 2 files changed, 2 insertions(+) diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/th-a7060-cx32s-32x40G-t1.config.bcm b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/th-a7060-cx32s-32x40G-t1.config.bcm index 9b0dc219307f..27fccd876c7d 100644 --- a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/th-a7060-cx32s-32x40G-t1.config.bcm +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/th-a7060-cx32s-32x40G-t1.config.bcm @@ -449,3 +449,4 @@ serdes_preemphasis_109=0x145c00 mmu_init_config="MSFT-TH-Tier1" phy_an_lt_msft=1 +phy_unlos_msft=1 diff --git a/src/sonic-device-data/tests/permitted_list b/src/sonic-device-data/tests/permitted_list index 2992024b9eef..f89d80ac8bad 100644 --- a/src/sonic-device-data/tests/permitted_list +++ b/src/sonic-device-data/tests/permitted_list @@ -326,6 +326,7 @@ phy_pcs_repeater l3_alpm_hit_skip sai_verify_incoming_chksum phy_an_lt_msft +phy_unlos_msft system_ref_core_clock_khz xflow_macsec_secure_chan_to_num_secure_assoc_encrypt xflow_macsec_secure_chan_to_num_secure_assoc_decrypt From 0b84b8fc30a562933ed6958351ffb71871c7fb51 Mon Sep 17 00:00:00 2001 From: Yaqiang Zhu Date: Tue, 23 Jan 2024 07:21:16 +0800 Subject: [PATCH 106/419] [dhcp_server] Remove dependency in port-name-alias-map.txt.j2 (#17858) * [dhcp_server] Remove dependency in port-name-alias-map.txt.j2 --- dockers/docker-dhcp-server/Dockerfile.j2 | 2 +- dockers/docker-dhcp-server/docker_init.sh | 1 - .../port-name-alias-map.txt.j2 | 8 ----- .../dhcp_utilities/dhcpservd/dhcp_cfggen.py | 20 +++++------ .../tests/test_data/mock_config_db.json | 33 +++++++++++++++++++ .../tests/test_data/port-name-alias-map.txt | 3 -- .../tests/test_dhcp_cfggen.py | 9 ++--- .../tests/test_dhcpservd.py | 4 +-- 8 files changed, 50 insertions(+), 30 deletions(-) delete mode 100644 dockers/docker-dhcp-server/port-name-alias-map.txt.j2 delete mode 100644 src/sonic-dhcp-utilities/tests/test_data/port-name-alias-map.txt diff --git a/dockers/docker-dhcp-server/Dockerfile.j2 b/dockers/docker-dhcp-server/Dockerfile.j2 index 9257ee38c7cd..0b6244d32e4d 100755 --- a/dockers/docker-dhcp-server/Dockerfile.j2 +++ b/dockers/docker-dhcp-server/Dockerfile.j2 @@ -86,7 +86,7 @@ RUN apt-get clean -y && \ COPY ["docker_init.sh", "start.sh", "/usr/bin/"] COPY ["supervisord.conf", "/etc/supervisor/conf.d/"] COPY ["files/supervisor-proc-exit-listener", "/usr/bin"] -COPY ["port-name-alias-map.txt.j2", "rsyslog/rsyslog.conf.j2", "kea-dhcp4.conf.j2", "/usr/share/sonic/templates/"] +COPY ["rsyslog/rsyslog.conf.j2", "kea-dhcp4.conf.j2", "/usr/share/sonic/templates/"] COPY ["critical_processes", "/etc/supervisor/"] COPY ["lease_update.sh", "/etc/kea/"] COPY ["kea-dhcp4-init.conf", "/etc/kea/kea-dhcp4.conf"] diff --git a/dockers/docker-dhcp-server/docker_init.sh b/dockers/docker-dhcp-server/docker_init.sh index 21ff37059aab..5220f9ffec44 100755 --- a/dockers/docker-dhcp-server/docker_init.sh +++ b/dockers/docker-dhcp-server/docker_init.sh @@ -12,7 +12,6 @@ hostname=$(hostname) sonic-cfggen -d -t /usr/share/sonic/templates/rsyslog.conf.j2 \ -a "{\"udp_server_ip\": \"$udp_server_ip\", \"hostname\": \"$hostname\"}" \ > /etc/rsyslog.conf -sonic-cfggen -d -t /usr/share/sonic/templates/port-name-alias-map.txt.j2,/tmp/port-name-alias-map.txt # Make the script that waits for all interfaces to come up executable chmod +x /etc/kea/lease_update.sh /usr/bin/start.sh diff --git a/dockers/docker-dhcp-server/port-name-alias-map.txt.j2 b/dockers/docker-dhcp-server/port-name-alias-map.txt.j2 deleted file mode 100644 index efafe4d5bcb6..000000000000 --- a/dockers/docker-dhcp-server/port-name-alias-map.txt.j2 +++ /dev/null @@ -1,8 +0,0 @@ -{# Generate port name-alias map for isc-dhcp-relay to parse. Each line contains one #} -{# name-alias pair of the form " " #} -{% for port, config in PORT.items() %} - {{- port }} {% if "alias" in config %}{{ config["alias"] }}{% else %}{{ port }}{% endif %} {{- "\n" -}} -{% endfor -%} -{% for pc, config in PORTCHANNEL.items() %} - {{- pc }} {{ pc }} {{- "\n" -}} -{% endfor -%} diff --git a/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py index 438a6e814713..544b46e4bb39 100755 --- a/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py +++ b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py @@ -7,7 +7,6 @@ from jinja2 import Environment, FileSystemLoader from dhcp_utilities.common.utils import merge_intervals, validate_str_type -PORT_MAP_PATH = "/tmp/port-name-alias-map.txt" UNICODE_TYPE = str DHCP_SERVER_IPV4 = "DHCP_SERVER_IPV4" DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS = "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS" @@ -32,14 +31,14 @@ class DhcpServCfgGenerator(object): lease_update_script_path = "" lease_path = "" - def __init__(self, dhcp_db_connector, lease_path=DEFAULT_LEASE_PATH, port_map_path=PORT_MAP_PATH, + def __init__(self, dhcp_db_connector, lease_path=DEFAULT_LEASE_PATH, lease_update_script_path=LEASE_UPDATE_SCRIPT_PATH, dhcp_option_path=DHCP_OPTION_FILE, kea_conf_template_path=KEA_DHCP4_CONF_TEMPLATE_PATH): self.db_connector = dhcp_db_connector self.lease_path = lease_path self.lease_update_script_path = lease_update_script_path # Read port alias map file, this file is render after container start, so it would not change any more - self._parse_port_map_alias(port_map_path) + self._parse_port_map_alias() # Get kea config template self._get_render_template(kea_conf_template_path) self._read_dhcp_option(dhcp_option_path) @@ -122,14 +121,13 @@ def _get_render_template(self, kea_conf_template_path): env = Environment(loader=FileSystemLoader(os.path.dirname(kea_conf_template_path))) # nosemgrep self.kea_template = env.get_template(os.path.basename(kea_conf_template_path)) - def _parse_port_map_alias(self, port_map_path): - with open(port_map_path, "r") as file: - lines = file.readlines() - for line in lines: - splits = line.strip().split(" ") - if len(splits) != 2: - continue - self.port_alias_map[splits[0]] = splits[1] + def _parse_port_map_alias(self): + port_table = self.db_connector.get_config_db_table("PORT") + pc_table = self.db_connector.get_config_db_table("PORTCHANNEL") + for port_name, item in port_table.items(): + self.port_alias_map[port_name] = item.get("alias", port_name) + for pc_name in pc_table.keys(): + self.port_alias_map[pc_name] = pc_name def _construct_obj_for_template(self, dhcp_server_ipv4, port_ips, hostname, customized_options): subnets = [] diff --git a/src/sonic-dhcp-utilities/tests/test_data/mock_config_db.json b/src/sonic-dhcp-utilities/tests/test_data/mock_config_db.json index 1afb7c7e8054..faeaa722eb3a 100644 --- a/src/sonic-dhcp-utilities/tests/test_data/mock_config_db.json +++ b/src/sonic-dhcp-utilities/tests/test_data/mock_config_db.json @@ -161,5 +161,38 @@ "192.168.0.10" ] } + }, + "PORT": { + "Ethernet0": { + "admin_status": "up", + "alias": "etp1", + "description": "Servers0:eth0", + "index": "1", + "lanes": "25", + "mtu": "9100", + "pfc_asym": "off", + "speed": "1000", + "tpid": "0x8100" + }, + "Ethernet1": { + "admin_status": "up", + "alias": "etp2", + "description": "Servers1:eth0", + "index": "2", + "lanes": "26", + "mtu": "9100", + "pfc_asym": "off", + "speed": "1000", + "tpid": "0x8100" + } + }, + "PORTCHANNEL": { + "PortChannel101": { + "admin_status": "up", + "lacp_key": "auto", + "min_links": "1", + "mtu": "9100", + "tpid": "0x8100" + } } } diff --git a/src/sonic-dhcp-utilities/tests/test_data/port-name-alias-map.txt b/src/sonic-dhcp-utilities/tests/test_data/port-name-alias-map.txt deleted file mode 100644 index edebd17db9f7..000000000000 --- a/src/sonic-dhcp-utilities/tests/test_data/port-name-alias-map.txt +++ /dev/null @@ -1,3 +0,0 @@ -Ethernet24 etp7 -Ethernet28 etp8 -Ethernet32 \ No newline at end of file diff --git a/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py b/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py index db76cacb25db..c1c2569dbe0a 100644 --- a/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py +++ b/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py @@ -267,10 +267,11 @@ def test_parse_port_alias(mock_swsscommon_dbconnector_init, mock_get_render_template): - dhcp_db_connector = DhcpDbConnector() - dhcp_cfg_generator = DhcpServCfgGenerator(dhcp_db_connector, - port_map_path="tests/test_data/port-name-alias-map.txt") - assert dhcp_cfg_generator.port_alias_map == {"Ethernet24": "etp7", "Ethernet28": "etp8"} + with patch.object(DhcpDbConnector, "get_config_db_table", side_effect=mock_get_config_db_table): + dhcp_db_connector = DhcpDbConnector() + dhcp_cfg_generator = DhcpServCfgGenerator(dhcp_db_connector) + assert dhcp_cfg_generator.port_alias_map == {"Ethernet0": "etp1", "Ethernet1": "etp2", + "PortChannel101": "PortChannel101"} @pytest.mark.parametrize("is_success", [True, False]) diff --git a/src/sonic-dhcp-utilities/tests/test_dhcpservd.py b/src/sonic-dhcp-utilities/tests/test_dhcpservd.py index 5a77999d7f92..dd3d09a63831 100644 --- a/src/sonic-dhcp-utilities/tests/test_dhcpservd.py +++ b/src/sonic-dhcp-utilities/tests/test_dhcpservd.py @@ -29,10 +29,10 @@ def test_dump_dhcp4_config(mock_swsscommon_dbconnector_init, enabled_checker): new_callable=PropertyMock), \ patch.object(DhcpServdDbMonitor, "disable_checkers") as mock_unsubscribe, \ patch.object(DhcpServdDbMonitor, "enable_checkers") as mock_subscribe, \ - patch.object(DhcpServd, "enabled_checker", return_value=enabled_checker, new_callable=PropertyMock): + patch.object(DhcpServd, "enabled_checker", return_value=enabled_checker, new_callable=PropertyMock), \ + patch.object(DhcpServCfgGenerator, "_parse_port_map_alias"): dhcp_db_connector = DhcpDbConnector() dhcp_cfg_generator = DhcpServCfgGenerator(dhcp_db_connector, - port_map_path="tests/test_data/port-name-alias-map.txt", kea_conf_template_path="tests/test_data/kea-dhcp4.conf.j2") dhcpservd = DhcpServd(dhcp_cfg_generator, dhcp_db_connector, None, kea_dhcp4_config_path="/tmp/kea-dhcp4.conf") From 8f9e58c033ceda9383a03367ce7add65df2c2cb6 Mon Sep 17 00:00:00 2001 From: Yaqiang Zhu Date: Fri, 15 Dec 2023 18:47:40 -0500 Subject: [PATCH 107/419] [dhcp_relay] Optimize j2 file in dhcp_relay container (#17506) --- dockers/docker-dhcp-relay/dhcp-relay.programs.j2 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dockers/docker-dhcp-relay/dhcp-relay.programs.j2 b/dockers/docker-dhcp-relay/dhcp-relay.programs.j2 index 94f6adf76510..087a734d6f86 100644 --- a/dockers/docker-dhcp-relay/dhcp-relay.programs.j2 +++ b/dockers/docker-dhcp-relay/dhcp-relay.programs.j2 @@ -1,9 +1,7 @@ [group:dhcp-relay] -programs=dhcprelayd, +programs=dhcprelayd {%- set relay_for_ipv6 = { 'flag': False } %} -{%- set add_preceding_comma = { 'flag': False } %} -{% if dhcp_server_ipv4_enabled %} -{%- endif %} +{%- set add_preceding_comma = { 'flag': True } %} {% for vlan_name in VLAN_INTERFACE %} {% if DHCP_RELAY and vlan_name in DHCP_RELAY and DHCP_RELAY[vlan_name]['dhcpv6_servers']|length > 0 %} {% set _dummy = relay_for_ipv6.update({'flag': True}) %} From b84e3f9e8afaecf506cd8a95a2dd34a37f9aa90d Mon Sep 17 00:00:00 2001 From: Hua Liu <58683130+liuh-80@users.noreply.github.com> Date: Wed, 6 Dec 2023 03:51:56 +0800 Subject: [PATCH 108/419] Fix can't access IPV6 address via management interface because 'default' route table does not add to route lookup issue. (#17281) Fix can't access IPV6 address via management interface because 'default' route table does not add to route lookup issue. #### Why I did it When device set with IPV6 TACACS server address, and shutdown all BGP, device can't connect to TACACS server via management interface. After investigation, I found the IPV6 'default' route table does not add to route lookup: admin@vlab-01:~$ ip -6 rule list 1001: from all lookup local 32765: from fec0::ffff:afa:1 lookup default 32766: from all lookup main admin@vlab-01:~$ As compare: admin@vlab-01:~$ ip -4 rule list 1001: from all lookup local 32764: from all to 172.17.0.1/24 lookup default 32765: from 10.250.0.101 lookup default 32766: from all lookup main 32767: from all lookup default <== 'default' route table exist in IPV4 route lookup Issue fix by add 'default' route table to route lookup with following command: admin@vlab-01:~$ sudo ip -6 rule add pref 32767 lookup default admin@vlab-01:~$ ip -6 rule list 1001: from all lookup local 32765: from fec0::ffff:afa:1 lookup default 32766: from all lookup main 32767: from all lookup default <== 'default' route table been added to IPV6 route lookup admin@vlab-01:~$ ##### Work item tracking - Microsoft ADO: 25798732 #### How I did it When management interface using 'default' route table, add 'default' route table to IPV6 route lookup. #### How to verify it Pass all UT. Add new UT to cover this change. Manually verify issue fixed: ### Tested branch (Please provide the tested image version) - [x] master-17281.417570-2133d58fa #### Description for the changelog Fix can't access IPV6 address via management interface because 'default' route table does not add to route lookup issue. --- files/image_config/interfaces/interfaces.j2 | 16 ++++++++++++---- .../tests/sample_output/py2/interfaces | 3 +++ .../tests/sample_output/py2/two_mgmt_interfaces | 6 ++++++ .../tests/sample_output/py3/interfaces | 3 +++ .../tests/sample_output/py3/two_mgmt_interfaces | 6 ++++++ 5 files changed, 30 insertions(+), 4 deletions(-) diff --git a/files/image_config/interfaces/interfaces.j2 b/files/image_config/interfaces/interfaces.j2 index b39331f459b7..3702eb1f6798 100644 --- a/files/image_config/interfaces/interfaces.j2 +++ b/files/image_config/interfaces/interfaces.j2 @@ -79,21 +79,29 @@ iface {{ name }} {{ 'inet' if prefix | ipv4 else 'inet6' }} static {% set vrf_table = '5000' %} vrf mgmt {% endif %} +{% set force_mgmt_route_priority = 32764 %} ########## management network policy routing rules # management port up rules up ip {{ '-4' if prefix | ipv4 else '-6' }} route add default via {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} dev {{ name }} table {{ vrf_table }} metric 201 up ip {{ '-4' if prefix | ipv4 else '-6' }} route add {{ prefix | network }}/{{ prefix | prefixlen }} dev {{ name }} table {{ vrf_table }} - up ip {{ '-4' if prefix | ipv4 else '-6' }} rule add pref 32765 from {{ prefix | ip }}/{{ '32' if prefix | ipv4 else '128' }} table {{ vrf_table }} + up ip {{ '-4' if prefix | ipv4 else '-6' }} rule add pref {{ force_mgmt_route_priority + 1 }} from {{ prefix | ip }}/{{ '32' if prefix | ipv4 else '128' }} table {{ vrf_table }} {% for route in MGMT_INTERFACE[(name, prefix)]['forced_mgmt_routes'] %} - up ip rule add pref 32764 to {{ route }} table {{ vrf_table }} + up ip rule add pref {{ force_mgmt_route_priority }} to {{ route }} table {{ vrf_table }} {% endfor %} +{% if prefix | ipv6 and vrf_table == 'default'%} + # IPV6 default table not add to lookup by default, management server need this to access IPV6 address when BGP shutdown + up ip -6 rule add pref {{ force_mgmt_route_priority + 3 }} lookup {{ vrf_table }} +{% endif %} # management port down rules pre-down ip {{ '-4' if prefix | ipv4 else '-6' }} route delete default via {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} dev {{ name }} table {{ vrf_table }} pre-down ip {{ '-4' if prefix | ipv4 else '-6' }} route delete {{ prefix | network }}/{{ prefix | prefixlen }} dev {{ name }} table {{ vrf_table }} - pre-down ip {{ '-4' if prefix | ipv4 else '-6' }} rule delete pref 32765 from {{ prefix | ip }}/{{ '32' if prefix | ipv4 else '128' }} table {{ vrf_table }} + pre-down ip {{ '-4' if prefix | ipv4 else '-6' }} rule delete pref {{ force_mgmt_route_priority + 1 }} from {{ prefix | ip }}/{{ '32' if prefix | ipv4 else '128' }} table {{ vrf_table }} {% for route in MGMT_INTERFACE[(name, prefix)]['forced_mgmt_routes'] %} - pre-down ip rule delete pref 32764 to {{ route }} table {{ vrf_table }} + pre-down ip rule delete pref {{ force_mgmt_route_priority }} to {{ route }} table {{ vrf_table }} {% endfor %} +{% if prefix | ipv6 and vrf_table == 'default'%} + pre-down ip -6 rule delete pref {{ force_mgmt_route_priority + 3 }} lookup {{ vrf_table }} +{% endif %} {# TODO: COPP policy type rules #} {% endfor %} {% else %} diff --git a/src/sonic-config-engine/tests/sample_output/py2/interfaces b/src/sonic-config-engine/tests/sample_output/py2/interfaces index 90aadce5f44e..15d5f8426247 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/interfaces +++ b/src/sonic-config-engine/tests/sample_output/py2/interfaces @@ -38,10 +38,13 @@ iface eth0 inet6 static up ip -6 route add default via 2603:10e2:0:2902::1 dev eth0 table default metric 201 up ip -6 route add 2603:10e2:0:2902::/64 dev eth0 table default up ip -6 rule add pref 32765 from 2603:10e2:0:2902::8/128 table default + # IPV6 default table not add to lookup by default, management server need this to access IPV6 address when BGP shutdown + up ip -6 rule add pref 32767 lookup default # management port down rules pre-down ip -6 route delete default via 2603:10e2:0:2902::1 dev eth0 table default pre-down ip -6 route delete 2603:10e2:0:2902::/64 dev eth0 table default pre-down ip -6 rule delete pref 32765 from 2603:10e2:0:2902::8/128 table default + pre-down ip -6 rule delete pref 32767 lookup default # source /etc/network/interfaces.d/* # diff --git a/src/sonic-config-engine/tests/sample_output/py2/two_mgmt_interfaces b/src/sonic-config-engine/tests/sample_output/py2/two_mgmt_interfaces index 319f25c4e91a..1b46be4bc380 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/two_mgmt_interfaces +++ b/src/sonic-config-engine/tests/sample_output/py2/two_mgmt_interfaces @@ -53,10 +53,13 @@ iface eth1 inet6 static up ip -6 route add default via 2603:10e2:0:abcd::1 dev eth1 table default metric 201 up ip -6 route add 2603:10e2:0:abcd::/64 dev eth1 table default up ip -6 rule add pref 32765 from 2603:10e2:0:abcd::8/128 table default + # IPV6 default table not add to lookup by default, management server need this to access IPV6 address when BGP shutdown + up ip -6 rule add pref 32767 lookup default # management port down rules pre-down ip -6 route delete default via 2603:10e2:0:abcd::1 dev eth1 table default pre-down ip -6 route delete 2603:10e2:0:abcd::/64 dev eth1 table default pre-down ip -6 rule delete pref 32765 from 2603:10e2:0:abcd::8/128 table default + pre-down ip -6 rule delete pref 32767 lookup default iface eth0 inet6 static address 2603:10e2:0:2902::8 netmask 64 @@ -67,10 +70,13 @@ iface eth0 inet6 static up ip -6 route add default via 2603:10e2:0:2902::1 dev eth0 table default metric 201 up ip -6 route add 2603:10e2:0:2902::/64 dev eth0 table default up ip -6 rule add pref 32765 from 2603:10e2:0:2902::8/128 table default + # IPV6 default table not add to lookup by default, management server need this to access IPV6 address when BGP shutdown + up ip -6 rule add pref 32767 lookup default # management port down rules pre-down ip -6 route delete default via 2603:10e2:0:2902::1 dev eth0 table default pre-down ip -6 route delete 2603:10e2:0:2902::/64 dev eth0 table default pre-down ip -6 rule delete pref 32765 from 2603:10e2:0:2902::8/128 table default + pre-down ip -6 rule delete pref 32767 lookup default # source /etc/network/interfaces.d/* # diff --git a/src/sonic-config-engine/tests/sample_output/py3/interfaces b/src/sonic-config-engine/tests/sample_output/py3/interfaces index 90aadce5f44e..15d5f8426247 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/interfaces +++ b/src/sonic-config-engine/tests/sample_output/py3/interfaces @@ -38,10 +38,13 @@ iface eth0 inet6 static up ip -6 route add default via 2603:10e2:0:2902::1 dev eth0 table default metric 201 up ip -6 route add 2603:10e2:0:2902::/64 dev eth0 table default up ip -6 rule add pref 32765 from 2603:10e2:0:2902::8/128 table default + # IPV6 default table not add to lookup by default, management server need this to access IPV6 address when BGP shutdown + up ip -6 rule add pref 32767 lookup default # management port down rules pre-down ip -6 route delete default via 2603:10e2:0:2902::1 dev eth0 table default pre-down ip -6 route delete 2603:10e2:0:2902::/64 dev eth0 table default pre-down ip -6 rule delete pref 32765 from 2603:10e2:0:2902::8/128 table default + pre-down ip -6 rule delete pref 32767 lookup default # source /etc/network/interfaces.d/* # diff --git a/src/sonic-config-engine/tests/sample_output/py3/two_mgmt_interfaces b/src/sonic-config-engine/tests/sample_output/py3/two_mgmt_interfaces index 490a27366fd3..4be6dcd5d801 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/two_mgmt_interfaces +++ b/src/sonic-config-engine/tests/sample_output/py3/two_mgmt_interfaces @@ -39,10 +39,13 @@ iface eth0 inet6 static up ip -6 route add default via 2603:10e2:0:2902::1 dev eth0 table default metric 201 up ip -6 route add 2603:10e2:0:2902::/64 dev eth0 table default up ip -6 rule add pref 32765 from 2603:10e2:0:2902::8/128 table default + # IPV6 default table not add to lookup by default, management server need this to access IPV6 address when BGP shutdown + up ip -6 rule add pref 32767 lookup default # management port down rules pre-down ip -6 route delete default via 2603:10e2:0:2902::1 dev eth0 table default pre-down ip -6 route delete 2603:10e2:0:2902::/64 dev eth0 table default pre-down ip -6 rule delete pref 32765 from 2603:10e2:0:2902::8/128 table default + pre-down ip -6 rule delete pref 32767 lookup default iface eth1 inet static address 10.0.10.100 netmask 255.255.255.0 @@ -67,10 +70,13 @@ iface eth1 inet6 static up ip -6 route add default via 2603:10e2:0:abcd::1 dev eth1 table default metric 201 up ip -6 route add 2603:10e2:0:abcd::/64 dev eth1 table default up ip -6 rule add pref 32765 from 2603:10e2:0:abcd::8/128 table default + # IPV6 default table not add to lookup by default, management server need this to access IPV6 address when BGP shutdown + up ip -6 rule add pref 32767 lookup default # management port down rules pre-down ip -6 route delete default via 2603:10e2:0:abcd::1 dev eth1 table default pre-down ip -6 route delete 2603:10e2:0:abcd::/64 dev eth1 table default pre-down ip -6 rule delete pref 32765 from 2603:10e2:0:abcd::8/128 table default + pre-down ip -6 rule delete pref 32767 lookup default # source /etc/network/interfaces.d/* # From 015ce751a44fb60a0cb4f8677d684397507d6a1a Mon Sep 17 00:00:00 2001 From: Liu Shilong Date: Mon, 15 Jan 2024 14:59:21 +0800 Subject: [PATCH 109/419] [build] Fix a bash script some times called by sh issue. (#17761) Why I did it Fix a bug that sometimes the script runs in sh not bash. Work item tracking Microsoft ADO (number only): 26297955 How I did it --- scripts/docker_version_control.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/docker_version_control.sh b/scripts/docker_version_control.sh index e94370d0e2d9..7af5173decae 100755 --- a/scripts/docker_version_control.sh +++ b/scripts/docker_version_control.sh @@ -1,7 +1,8 @@ +#!/bin/bash + # This script is for reproducible build. # Reproducible build for docker enabled: Before build docker image, this script will change image:tag to image:sha256 in DOCKERFILE. # And record image sha256 to a target file. -#!/bin/bash IMAGENAME=$1 DOCKERFILE=$2 From 1e4dcbc75d447cd12140657dcb1b0c9f2435bd36 Mon Sep 17 00:00:00 2001 From: Liping Xu <108326363+lipxu@users.noreply.github.com> Date: Fri, 12 Jan 2024 15:26:06 +0800 Subject: [PATCH 110/419] disable restapi for leafRouter in slim image (#17713) Why I did it For some devices with small memory, after upgrading to the latest image, the available memory is not enough. Work item tracking Microsoft ADO (number only): 26324242 How I did it Disable restapi feature for LeafRouter which with slim image. How to verify it verified on 7050qx T1 (slim image), restapi disabled verified on 7050qx T0 (slim image), restapi enabled verified on 7260 T1 (normal image), restapi enabled --- files/build_templates/init_cfg.json.j2 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/files/build_templates/init_cfg.json.j2 b/files/build_templates/init_cfg.json.j2 index 53091a4a2472..b43206332c45 100644 --- a/files/build_templates/init_cfg.json.j2 +++ b/files/build_templates/init_cfg.json.j2 @@ -51,7 +51,11 @@ {%- if include_mux == "y" %}{% do features.append(("mux", "{% if 'subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR' %}enabled{% else %}always_disabled{% endif %}", false, "enabled")) %}{% endif %} {%- if include_nat == "y" %}{% do features.append(("nat", "disabled", false, "enabled")) %}{% endif %} {%- if include_p4rt == "y" %}{% do features.append(("p4rt", "disabled", false, "enabled")) %}{% endif %} -{%- if include_restapi == "y" %}{% do features.append(("restapi", "enabled", false, "enabled")) %}{% endif %} +{%- if include_restapi == "y" and BUILD_REDUCE_IMAGE_SIZE == "y" and sonic_asic_platform == "broadcom" %} + {% do features.append(("restapi", "{% if (DEVICE_METADATA is defined and DEVICE_METADATA['localhost'] is defined and DEVICE_METADATA['localhost']['type'] is defined and DEVICE_METADATA['localhost']['type'] is not in ['LeafRouter', 'BackEndLeafRouter']) %}enabled{% else %}disabled{% endif %}", false, "enabled")) %} +{%- elif include_restapi == "y" %} + {% do features.append(("restapi", "enabled", false, "enabled")) %} +{%- endif %} {%- if include_sflow == "y" %}{% do features.append(("sflow", "disabled", true, "enabled")) %}{% endif %} {%- if include_macsec == "y" %}{% do features.append(("macsec", "{% if 'type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] == 'SpineRouter' and DEVICE_RUNTIME_METADATA['MACSEC_SUPPORTED'] %}enabled{% else %}disabled{% endif %}", false, "enabled")) %}{% endif %} {%- if include_system_gnmi == "y" %}{% do features.append(("gnmi", "enabled", true, "enabled")) %}{% endif %} From c469359cef57d297c1f5f0181c761fe171e80aa7 Mon Sep 17 00:00:00 2001 From: byu343 Date: Tue, 19 Dec 2023 23:29:43 -0800 Subject: [PATCH 111/419] [Arista] Use port_config.ini for Arista-7050QX-32S-S4Q31 (#17253) This change of removing hwsku.json is to correct the port index for sfp ports (Ethernet0, Ethernet1, Ethernet2, Ethernet3) by using port_config.ini, which should be '1, 2, 3, 4'. We could not do it with hwsku.json, as it is defined as '5, 5, 5, 5' by platform.json for the breakout_mode 1x40G[10G]. --- .../Arista-7050QX-32S-S4Q31/hwsku.json | 132 ------------------ .../Arista-7050QX-32S-S4Q31/port_config.ini | 72 +++++----- 2 files changed, 36 insertions(+), 168 deletions(-) delete mode 100644 device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/hwsku.json diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/hwsku.json b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/hwsku.json deleted file mode 100644 index 0f17443e499d..000000000000 --- a/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/hwsku.json +++ /dev/null @@ -1,132 +0,0 @@ -{ - "interfaces": { - "Ethernet0": { - "default_brkout_mode": "3x10G(3)+1x1G(1)", - "port_type": "RJ45" - }, - "Ethernet4": { - "default_brkout_mode": "1x40G[10G]", - "port_type": "QSFP+" - }, - "Ethernet8": { - "default_brkout_mode": "1x40G[10G]", - "port_type": "QSFP+" - }, - "Ethernet12": { - "default_brkout_mode": "1x40G[10G]", - "port_type": "QSFP+" - }, - "Ethernet16": { - "default_brkout_mode": "1x40G[10G]", - "port_type": "QSFP+" - }, - "Ethernet20": { - "default_brkout_mode": "1x40G[10G]", - "port_type": "QSFP+" - }, - "Ethernet24": { - "default_brkout_mode": "1x40G[10G]", - "port_type": "QSFP+" - }, - "Ethernet28": { - "default_brkout_mode": "1x40G[10G]", - "port_type": "QSFP+" - }, - "Ethernet32": { - "default_brkout_mode": "1x40G[10G]", - "port_type": "QSFP+" - }, - "Ethernet36": { - "default_brkout_mode": "1x40G[10G]", - "port_type": "QSFP+" - }, - "Ethernet40": { - "default_brkout_mode": "1x40G[10G]", - "port_type": "QSFP+" - }, - "Ethernet44": { - "default_brkout_mode": "1x40G[10G]", - "port_type": "QSFP+" - }, - "Ethernet48": { - "default_brkout_mode": "1x40G[10G]", - "port_type": "QSFP+" - }, - "Ethernet52": { - "default_brkout_mode": "1x40G[10G]", - "port_type": "QSFP+" - }, - "Ethernet56": { - "default_brkout_mode": "1x40G[10G]", - "port_type": "QSFP+" - }, - "Ethernet60": { - "default_brkout_mode": "1x40G[10G]", - "port_type": "QSFP+" - }, - "Ethernet64": { - "default_brkout_mode": "1x40G[10G]", - "port_type": "QSFP+" - }, - "Ethernet68": { - "default_brkout_mode": "1x40G[10G]", - "port_type": "QSFP+" - }, - "Ethernet72": { - "default_brkout_mode": "1x40G[10G]", - "port_type": "QSFP+" - }, - "Ethernet76": { - "default_brkout_mode": "1x40G[10G]", - "port_type": "QSFP+" - }, - "Ethernet80": { - "default_brkout_mode": "1x40G[10G]", - "port_type": "QSFP+" - }, - "Ethernet84": { - "default_brkout_mode": "1x40G[10G]", - "port_type": "QSFP+" - }, - "Ethernet88": { - "default_brkout_mode": "1x40G[10G]", - "port_type": "QSFP+" - }, - "Ethernet92": { - "default_brkout_mode": "1x40G[10G]", - "port_type": "QSFP+" - }, - "Ethernet96": { - "default_brkout_mode": "1x40G[10G]", - "port_type": "QSFP+" - }, - "Ethernet100": { - "default_brkout_mode": "1x40G[10G]", - "port_type": "QSFP+" - }, - "Ethernet104": { - "default_brkout_mode": "1x40G[10G]", - "port_type": "QSFP+" - }, - "Ethernet108": { - "default_brkout_mode": "1x40G[10G]", - "port_type": "QSFP+" - }, - "Ethernet112": { - "default_brkout_mode": "1x40G[10G]", - "port_type": "QSFP+" - }, - "Ethernet116": { - "default_brkout_mode": "1x40G[10G]", - "port_type": "QSFP+" - }, - "Ethernet120": { - "default_brkout_mode": "1x40G[10G]", - "port_type": "QSFP+" - }, - "Ethernet124": { - "default_brkout_mode": "1x40G[10G]", - "port_type": "QSFP+" - } - } -} diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/port_config.ini b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/port_config.ini index dafdb570e9cc..182f04acab0f 100644 --- a/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/port_config.ini +++ b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/port_config.ini @@ -1,36 +1,36 @@ -# name lanes alias index -Ethernet0 9 Ethernet1 1 -Ethernet1 10 Ethernet2 2 -Ethernet2 11 Ethernet3 3 -Ethernet3 12 Ethernet4 4 -Ethernet4 13,14,15,16 Ethernet6/1 6 -Ethernet8 17,18,19,20 Ethernet7/1 7 -Ethernet12 21,22,23,24 Ethernet8/1 8 -Ethernet16 29,30,31,32 Ethernet9/1 9 -Ethernet20 25,26,27,28 Ethernet10/1 10 -Ethernet24 33,34,35,36 Ethernet11/1 11 -Ethernet28 37,38,39,40 Ethernet12/1 12 -Ethernet32 45,46,47,48 Ethernet13/1 13 -Ethernet36 41,42,43,44 Ethernet14/1 14 -Ethernet40 49,50,51,52 Ethernet15/1 15 -Ethernet44 53,54,55,56 Ethernet16/1 16 -Ethernet48 69,70,71,72 Ethernet17/1 17 -Ethernet52 65,66,67,68 Ethernet18/1 18 -Ethernet56 73,74,75,76 Ethernet19/1 19 -Ethernet60 77,78,79,80 Ethernet20/1 20 -Ethernet64 93,94,95,96 Ethernet21/1 21 -Ethernet68 89,90,91,92 Ethernet22/1 22 -Ethernet72 97,98,99,100 Ethernet23/1 23 -Ethernet76 101,102,103,104 Ethernet24/1 24 -Ethernet80 109,110,111,112 Ethernet25/1 25 -Ethernet84 105,106,107,108 Ethernet26/1 26 -Ethernet88 121,122,123,124 Ethernet27/1 27 -Ethernet92 125,126,127,128 Ethernet28/1 28 -Ethernet96 61,62,63,64 Ethernet29 29 -Ethernet100 57,58,59,60 Ethernet30 30 -Ethernet104 81,82,83,84 Ethernet31 31 -Ethernet108 85,86,87,88 Ethernet32 32 -Ethernet112 117,118,119,120 Ethernet33 33 -Ethernet116 113,114,115,116 Ethernet34 34 -Ethernet120 1,2,3,4 Ethernet35 35 -Ethernet124 5,6,7,8 Ethernet36 36 +# name lanes alias index speed +Ethernet0 9 Ethernet1 1 10000 +Ethernet1 10 Ethernet2 2 10000 +Ethernet2 11 Ethernet3 3 10000 +Ethernet3 12 Ethernet4 4 1000 +Ethernet4 13,14,15,16 Ethernet6/1 6 40000 +Ethernet8 17,18,19,20 Ethernet7/1 7 40000 +Ethernet12 21,22,23,24 Ethernet8/1 8 40000 +Ethernet16 29,30,31,32 Ethernet9/1 9 40000 +Ethernet20 25,26,27,28 Ethernet10/1 10 40000 +Ethernet24 33,34,35,36 Ethernet11/1 11 40000 +Ethernet28 37,38,39,40 Ethernet12/1 12 40000 +Ethernet32 45,46,47,48 Ethernet13/1 13 40000 +Ethernet36 41,42,43,44 Ethernet14/1 14 40000 +Ethernet40 49,50,51,52 Ethernet15/1 15 40000 +Ethernet44 53,54,55,56 Ethernet16/1 16 40000 +Ethernet48 69,70,71,72 Ethernet17/1 17 40000 +Ethernet52 65,66,67,68 Ethernet18/1 18 40000 +Ethernet56 73,74,75,76 Ethernet19/1 19 40000 +Ethernet60 77,78,79,80 Ethernet20/1 20 40000 +Ethernet64 93,94,95,96 Ethernet21/1 21 40000 +Ethernet68 89,90,91,92 Ethernet22/1 22 40000 +Ethernet72 97,98,99,100 Ethernet23/1 23 40000 +Ethernet76 101,102,103,104 Ethernet24/1 24 40000 +Ethernet80 109,110,111,112 Ethernet25/1 25 40000 +Ethernet84 105,106,107,108 Ethernet26/1 26 40000 +Ethernet88 121,122,123,124 Ethernet27/1 27 40000 +Ethernet92 125,126,127,128 Ethernet28/1 28 40000 +Ethernet96 61,62,63,64 Ethernet29 29 40000 +Ethernet100 57,58,59,60 Ethernet30 30 40000 +Ethernet104 81,82,83,84 Ethernet31 31 40000 +Ethernet108 85,86,87,88 Ethernet32 32 40000 +Ethernet112 117,118,119,120 Ethernet33 33 40000 +Ethernet116 113,114,115,116 Ethernet34 34 40000 +Ethernet120 1,2,3,4 Ethernet35 35 40000 +Ethernet124 5,6,7,8 Ethernet36 36 40000 From 6905ab74dcc87517a870ee0bd5b3e6dad6eed323 Mon Sep 17 00:00:00 2001 From: SuvarnaMeenakshi <50386592+SuvarnaMeenakshi@users.noreply.github.com> Date: Wed, 6 Dec 2023 13:23:02 -0800 Subject: [PATCH 112/419] [SNMP]: Modify minigraph parser to update SNMP_AGENT_ADDRESS_CONFIG table (#17045) #### Why I did it SNMP query over IPv6 does not work due to issue in net-snmp where IPv6 query does not work on multi-nic environment. To get around this, if snmpd listens on specific ipv4 or ipv6 address, then the issue is not seen. We plan to configure Management IP and Loopback IP configured in minigraph.xml as SNMP_AGENT_ADDRESS in config_db., based on changes discussed in https://github.com/sonic-net/SONiC/pull/1457. ##### Work item tracking - Microsoft ADO **(number only)**:26091228 #### How I did it Modify minigraph parser to update SNMP_AGENT_ADDRESS_CONFIG with management and Loopback0 IP addresses. Modify snmpd.conf.j2 to use SNMP_AGENT_ADDRESS_CONFIG table if it is present in config_db, if not listen on any IP. Main change: 1. if minigraph.xml is used to configure the device, then snmpd will listen on mgmt and loopback IP addresses, 2. if config_db is used to configure the device, snmpd will listen IP present in SNMP_AGENT_ADDRESS_CONFIG if that table is present, if table is not present snmpd will listen on any IP. #### How to verify it config_db.json created from minigraph.xml for single asic VS image with mgmt and Loopback IP addresses. ``` "SNMP_AGENT_ADDRESS_CONFIG": { "10.1.0.32|161|": {}, "10.250.0.101|161|": {}, "FC00:1::32|161|": {}, "fec0::ffff:afa:1|161|": {} }, ..... snmpd listening on the above IP addresses: admin@vlab-01:~$ sudo netstat -tulnp | grep 161 tcp 0 0 127.0.0.1:3161 0.0.0.0:* LISTEN 71522/snmpd udp 0 0 10.250.0.101:161 0.0.0.0:* 71522/snmpd udp 0 0 10.1.0.32:161 0.0.0.0:* 71522/snmpd udp6 0 0 fec0::ffff:afa:1:161 :::* 71522/snmpd udp6 0 0 fc00:1::32:161 :::* 71522/snmpd ``` --- dockers/docker-snmp/snmpd.conf.j2 | 26 ------------------- dockers/docker-snmp/start.sh | 3 --- src/sonic-config-engine/minigraph.py | 16 ++++++++++++ .../tests/sample_graph.xml | 8 ++++++ src/sonic-config-engine/tests/test_cfggen.py | 7 ++++- 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/dockers/docker-snmp/snmpd.conf.j2 b/dockers/docker-snmp/snmpd.conf.j2 index 182056b636e1..aa04901f0009 100644 --- a/dockers/docker-snmp/snmpd.conf.j2 +++ b/dockers/docker-snmp/snmpd.conf.j2 @@ -28,32 +28,6 @@ {% for (agentip, port, vrf) in SNMP_AGENT_ADDRESS_CONFIG %} agentAddress {{ protocol(agentip) }}:[{{ agentip }}]{% if port %}:{{ port }}{% endif %}{% if vrf %}%{{ vrf }}{% endif %}{{ "" }} {% endfor %} -{% elif NAMESPACE_COUNT is not defined or NAMESPACE_COUNT|int <= 1 %} -{% if MGMT_INTERFACE is defined %} -{% for intf, ip in MGMT_INTERFACE %} -{% set agentip = ip.split('/')[0]|lower %} -{% set zoneid = '' %} -# Use interface as zoneid for link local ipv6 -{% if agentip.startswith('fe80') %} -{% set zoneid = '%' + intf %} -{% endif %} -agentAddress {{ protocol(agentip) }}:[{{ agentip }}{{ zoneid }}]:161 -{% endfor %} -{% endif %} -{% if LOOPBACK_INTERFACE is defined %} -{% for lo in LOOPBACK_INTERFACE %} -{% if lo | length == 2 %} -{% set intf = lo[0] %} -{% set agentip = lo[1].split('/')[0]|lower %} -{% set zoneid = '' %} -# Use interface as zoneid for link local ipv6 -{% if agentip.startswith('fe80') %} -{% set zoneid = '%' + intf %} -{% endif %} -agentAddress {{ protocol(agentip) }}:[{{ agentip }}{{ zoneid }}]:161 -{% endif %} -{% endfor %} -{% endif %} {% else %} agentAddress udp:161 agentAddress udp6:161 diff --git a/dockers/docker-snmp/start.sh b/dockers/docker-snmp/start.sh index 1d4c3b935a02..6de6f740b0ad 100755 --- a/dockers/docker-snmp/start.sh +++ b/dockers/docker-snmp/start.sh @@ -16,14 +16,11 @@ mkdir -p /etc/ssw /etc/snmp # Parse snmp.yml and insert the data in Config DB /usr/bin/snmp_yml_to_configdb.py -ADD_PARAM=$(printf '%s {"NAMESPACE_COUNT":"%s"}' "-a" "$NAMESPACE_COUNT") - SONIC_CFGGEN_ARGS=" \ -d \ -y /etc/sonic/sonic_version.yml \ -t /usr/share/sonic/templates/sysDescription.j2,/etc/ssw/sysDescription \ -t /usr/share/sonic/templates/snmpd.conf.j2,/etc/snmp/snmpd.conf \ - $ADD_PARAM \ " sonic-cfggen $SONIC_CFGGEN_ARGS diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index dfdb9406dd49..5746c4f733d3 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -16,6 +16,7 @@ from portconfig import get_port_config, get_fabric_port_config, get_fabric_monitor_config from sonic_py_common.interface import backplane_prefix +from sonic_py_common.multi_asic import is_multi_asic # TODO: Remove this once we no longer support Python 2 if sys.version_info.major == 3: @@ -1730,6 +1731,21 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw results['MGMT_VRF_CONFIG'] = mvrf + # Update SNMP_AGENT_ADDRESS_CONFIG with Management IP and Loopback IP + # if available. + if not is_multi_asic() and asic_name is None: + results['SNMP_AGENT_ADDRESS_CONFIG'] = {} + port = '161' + for mgmt_intf in mgmt_intf.keys(): + snmp_key = mgmt_intf[1].split('/')[0] + '|' + port + '|' + results['SNMP_AGENT_ADDRESS_CONFIG'][snmp_key] = {} + # Add Loopback IP as agent address for single asic + for loip in lo_intfs.keys(): + snmp_key = loip[1].split('/')[0] + '|' + port + '|' + results['SNMP_AGENT_ADDRESS_CONFIG'][snmp_key] = {} + else: + results['SNMP_AGENT_ADDRESS_CONFIG'] = {} + phyport_intfs = {} vlan_intfs = {} pc_intfs = {} diff --git a/src/sonic-config-engine/tests/sample_graph.xml b/src/sonic-config-engine/tests/sample_graph.xml index 478fdd5ba8d4..35247671fa24 100644 --- a/src/sonic-config-engine/tests/sample_graph.xml +++ b/src/sonic-config-engine/tests/sample_graph.xml @@ -63,6 +63,14 @@ 100.0.0.6/32 + + HostIP + Loopback1 + + 100.0.0.7/32 + + 100.0.0.7/32 + diff --git a/src/sonic-config-engine/tests/test_cfggen.py b/src/sonic-config-engine/tests/test_cfggen.py index 77c95c496795..b8480cf81fee 100644 --- a/src/sonic-config-engine/tests/test_cfggen.py +++ b/src/sonic-config-engine/tests/test_cfggen.py @@ -1145,4 +1145,9 @@ def test_minigraph_cisco_400g_to_100G_speed_no_lane_change(self): ) ) - + def testsnmp_agent_address_config(self): + argument = ['-m', self.sample_graph, '-p', self.port_config, '-v', 'SNMP_AGENT_ADDRESS_CONFIG.keys()|list'] + output = self.run_script(argument) + self.assertEqual( + utils.liststr_to_dict(output.strip()), + utils.liststr_to_dict("['192.168.200.15|161|', '100.0.0.6|161|', '100.0.0.7|161|']")) From 770ffb1ecdf6b1839461891cfd3ccf47528dac69 Mon Sep 17 00:00:00 2001 From: Baorong Liu Date: Tue, 30 Jan 2024 22:21:46 -0800 Subject: [PATCH 113/419] [staticroutebfd] fix an error in error logging (#17043) Why I did it Fix an error in the log_err call. this error can be triggered by an invalid static route key. usually the code cannot go here with normal config file. but hit this issue with an invalid key by manual testing with redis-cli directly. the file is scanned by Python lint to prevent such errors. Work item tracking Microsoft ADO ():26250268 How I did it fix the format error. How to verify it 1, ran pylint to check the design, make sure no such error in the design file. 2, wrote a separate python program to verify the log call. In the current logging related testing, usually use patch/mock for logging. for this specific error, could not trigger it if we call mock function instead the real function in the design. so need to do lint checking for code change. --- src/sonic-bgpcfgd/staticroutebfd/main.py | 2 +- src/sonic-bgpcfgd/tests/test_static_rt_bfd.py | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/sonic-bgpcfgd/staticroutebfd/main.py b/src/sonic-bgpcfgd/staticroutebfd/main.py index 268dbd3c1669..89f10f2dca5a 100644 --- a/src/sonic-bgpcfgd/staticroutebfd/main.py +++ b/src/sonic-bgpcfgd/staticroutebfd/main.py @@ -376,7 +376,7 @@ def static_route_set_handler(self, key, data): valid, is_ipv4, ip = check_ip(ip_prefix) if not valid: - log_err("invalid ip prefix for static route: ", key) + log_err("invalid ip prefix for static route: '%s'"%(key)) return True #use lower case if there is letter in IPv6 address string diff --git a/src/sonic-bgpcfgd/tests/test_static_rt_bfd.py b/src/sonic-bgpcfgd/tests/test_static_rt_bfd.py index f9b6139244b8..5198e50eae5c 100644 --- a/src/sonic-bgpcfgd/tests/test_static_rt_bfd.py +++ b/src/sonic-bgpcfgd/tests/test_static_rt_bfd.py @@ -171,6 +171,23 @@ def test_set_del_ipv6(): {'del_default:2603:10e2:400::4/128': { }} ) +@patch('staticroutebfd.main.log_err') +def test_invalid_key(mocked_log_err): + dut = constructor() + intf_setup(dut) + + set_del_test(dut, "srt", + "SET", + ("2.2.2/24", { + "bfd": "true", + "nexthop": "192.168.1.2 , 192.168.2.2, 192.168.3.2", + "ifname": "if1, if2, if3", + }), + {}, + {} + ) + mocked_log_err.assert_called_with("invalid ip prefix for static route: '2.2.2/24'") + def test_set_del(): dut = constructor() intf_setup(dut) From 93eaa3cac02199d9b7835ca79df5c5f7462d63dd Mon Sep 17 00:00:00 2001 From: jingwenxie Date: Sat, 16 Dec 2023 09:04:55 +0800 Subject: [PATCH 114/419] Update TELEMETRY_CLIENT YANG model (#16861) ### Why I did it Github issue: https://github.com/sonic-net/sonic-buildimage/issues/16356. The YANG definition breaks GCU feature. We can either update sonic_yang and GCU's search algorithm to enable the same key count case or simply update YANG model to solve the issue. The pros for update YANG model are it could solve the issue directly and we don't need to handle the complicate search algorithm in sonic_yang and GCU. This is the only YANG model that has this issue. ### How I did it Combine two list into one. The previous YANG validation unit tests are still applicable. #### How to verify it Unit test and E2E test --- src/sonic-yang-models/doc/Configuration.md | 26 ++++++++ .../tests/files/sample_config_db.json | 4 +- .../tests_config/telemetry_client.json | 62 +++++++++---------- .../yang-models/sonic-telemetry_client.yang | 23 +++---- 4 files changed, 67 insertions(+), 48 deletions(-) diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index 79782409bb10..64de05a809d0 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -73,6 +73,7 @@ Table of Contents * [TC to Priority group map](#tc-to-priority-group-map) * [TC to Queue map](#tc-to-queue-map) * [Telemetry](#telemetry) + * [Telemetry client](#telemetry-client) * [Tunnel](#tunnel) * [Versions](#versions) * [VLAN](#vlan) @@ -2236,6 +2237,31 @@ and is listed in this table. } ``` +### Telemetry client + +``` +{ + "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" + } + } +} +``` + ### Tunnel This table configures the MUX tunnel for Dual-ToR setup 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 567999143a0f..e5ff0b26a8ae 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1235,10 +1235,10 @@ "src_ip": "30.57.185.38", "unidirectional": "true" }, - "DestinationGroup_HS": { + "DestinationGroup|HS": { "dst_addr": "30.57.186.214:8081,30.57.185.39:8081" }, - "Subscription_HS_RDMA": { + "Subscription|HS_RDMA": { "dst_group": "HS", "path_target": "COUNTERS_DB", "paths": "COUNTERS/Ethernet*,COUNTERS_PORT_NAME_MAP", 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 index 5286bcba8b93..91de532c8c95 100644 --- 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 @@ -8,15 +8,15 @@ "src_ip": "30.57.185.38", "unidirectional": "true" }, - "TELEMETRY_CLIENT_DS_LIST": [ + "TELEMETRY_CLIENT_LIST": [ { - "prefix": "DestinationGroup_HS", + "prefix": "DestinationGroup", + "name": "HS", "dst_addr": "30.57.186.214:8081,30.57.185.39:8081" - } - ], - "TELEMETRY_CLIENT_SUB_LIST": [ + }, { - "prefix": "Subscription_HS_RDMA", + "prefix": "Subscription", + "name": "HS_RDMA", "dst_group": "HS", "path_target": "COUNTERS_DB", "paths": "COUNTERS/Ethernet*,COUNTERS_PORT_NAME_MAP", @@ -36,15 +36,15 @@ "src_ip": "30.57.185.38", "unidirectional": "true" }, - "TELEMETRY_CLIENT_DS_LIST": [ + "TELEMETRY_CLIENT_LIST": [ { - "prefix": "DestinationGroup_HS", + "prefix": "DestinationGroup", + "name": "HS", "dst_addr": "30.57.186.214:8081,30.57.185.39:8081" - } - ], - "TELEMETRY_CLIENT_SUB_LIST": [ + }, { - "prefix": "Subscription_HS_RDMA", + "prefix": "Subscription", + "name": "HS_RDMA", "dst_group": "FS", "path_target": "COUNTERS_DB", "paths": "COUNTERS/Ethernet*,COUNTERS_PORT_NAME_MAP", @@ -64,15 +64,15 @@ "src_ip": "30.57.185.388", "unidirectional": "true" }, - "TELEMETRY_CLIENT_DS_LIST": [ + "TELEMETRY_CLIENT_LIST": [ { - "prefix": "DestinationGroup_HS", + "prefix": "DestinationGroup", + "name": "HS", "dst_addr": "30.57.186.214:8081,30.57.185.39:8081" - } - ], - "TELEMETRY_CLIENT_SUB_LIST": [ + }, { - "prefix": "Subscription_HS_RDMA", + "prefix": "Subscription", + "name": "HS_RDMA", "dst_group": "HS", "path_target": "COUNTERS_DB", "paths": "COUNTERS/Ethernet*,COUNTERS_PORT_NAME_MAP", @@ -92,15 +92,15 @@ "src_ip": "30.57.185.38", "unidirectional": "true" }, - "TELEMETRY_CLIENT_DS_LIST": [ + "TELEMETRY_CLIENT_LIST": [ { - "prefix": "DestinationGroup_HS", + "prefix": "DestinationGroup", + "name": "HS", "dst_addr": "30.57.186.214:8081,30.57.185.39:8081" - } - ], - "TELEMETRY_CLIENT_SUB_LIST": [ + }, { - "prefix": "Subscription_HS_RDMA", + "prefix": "Subscription", + "name": "HS_RDMA", "dst_group": "HS", "path_target": "COUNTERS_DB", "paths": "COUNTERS/Ethernet*,COUNTERS_PORT_NAME_MAP", @@ -120,15 +120,15 @@ "src_ip": "30.57.185.38", "unidirectional": "true" }, - "TELEMETRY_CLIENT_DS_LIST": [ + "TELEMETRY_CLIENT_LIST": [ { - "prefix": "DestinationGroup_HS", + "prefix": "DestinationGroup", + "name": "HS", "dst_addr": "30.57.186.214:80819,30.57.185.39:8081" - } - ], - "TELEMETRY_CLIENT_SUB_LIST": [ + }, { - "prefix": "Subscription_HS_RDMA", + "prefix": "Subscription", + "name": "HS_RDMA", "dst_group": "HS", "path_target": "COUNTERS_DB", "paths": "COUNTERS/Ethernet*,COUNTERS_PORT_NAME_MAP", @@ -139,4 +139,4 @@ } } } -} \ 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 index 7b6b231031c5..7c4b7b37b8e6 100644 --- a/src/sonic-yang-models/yang-models/sonic-telemetry_client.yang +++ b/src/sonic-yang-models/yang-models/sonic-telemetry_client.yang @@ -86,33 +86,26 @@ module sonic-telemetry_client { } } - list TELEMETRY_CLIENT_DS_LIST { + list TELEMETRY_CLIENT_LIST { ordered-by user; - key "prefix"; + key "prefix name"; leaf prefix { type string { - pattern "DestinationGroup_" + ".*"; + pattern 'Subscription|DestinationGroup'; } } - leaf dst_addr { - type ipv4-port; + leaf name { + type string; } - } - - list TELEMETRY_CLIENT_SUB_LIST { - ordered-by user; - key "prefix"; - leaf prefix { - type string { - pattern "Subscription_" + ".*"; - } + leaf dst_addr { + type ipv4-port; } leaf dst_group { - must "(contains(../../TELEMETRY_CLIENT_DS_LIST/prefix, current()))"; + must "(contains(../../TELEMETRY_CLIENT_LIST/name, current()))"; type string; } From 3b982c073cc7bbf9ce0a690fe31b6fb370ca8666 Mon Sep 17 00:00:00 2001 From: spilkey-cisco <110940806+spilkey-cisco@users.noreply.github.com> Date: Fri, 15 Dec 2023 15:33:20 -0800 Subject: [PATCH 115/419] Fix system-health hardware_checker to consume fan tolerance details (#16689) Why I did it Fan tolerance checking is done through new APIs, is_under_speed and is_over_speed, which populate corresponding fields into the database. speed_tolerance is no longer used and was removed, but system-health was not updated and indicates failures: ADO: 25279165 root@sonic/# show system-health summary System status summary System status LED red_blink Services: Status: OK Hardware: Status: Not OK Reasons: Failed to get speed tolerance for fantray5.fan1 Failed to get speed tolerance for fantray5.fan0 Failed to get speed tolerance for fantray4.fan1 Failed to get speed tolerance for fantray4.fan0 Failed to get speed tolerance for fantray3.fan1 Failed to get speed tolerance for fantray3.fan0 Failed to get speed tolerance for fantray2.fan1 Failed to get speed tolerance for fantray2.fan0 Failed to get speed tolerance for fantray1.fan1 Failed to get speed tolerance for fantray1.fan0 Failed to get speed tolerance for fantray0.fan1 Failed to get speed tolerance for fantray0.fan0 Failed to get speed tolerance for PSU1.fan0 Failed to get speed tolerance for PSU0.fan0 How I did it Updated hardware_checker.py in system-health to consume new is_under_speed and is_over_speed database entries instead of speed_tolerance and hard-coded calculations. How to verify it root@sonic:/# show system-health summary System status summary System status LED green Services: Status: OK Hardware: Status: OK --- .../health_checker/hardware_checker.py | 28 ++++++++++--------- src/system-health/tests/test_system_health.py | 28 +++++++++++++++---- 2 files changed, 37 insertions(+), 19 deletions(-) diff --git a/src/system-health/health_checker/hardware_checker.py b/src/system-health/health_checker/hardware_checker.py index 8f7a11f55c2e..113fd88663a9 100644 --- a/src/system-health/health_checker/hardware_checker.py +++ b/src/system-health/health_checker/hardware_checker.py @@ -102,37 +102,39 @@ def _check_fan_status(self, config): if not self._ignore_check(config.ignore_devices, 'fan', name, 'speed'): speed = data_dict.get('speed', None) speed_target = data_dict.get('speed_target', None) - speed_tolerance = data_dict.get('speed_tolerance', None) + is_under_speed = data_dict.get('is_under_speed', None) + is_over_speed = data_dict.get('is_over_speed', None) if not speed: self.set_object_not_ok('Fan', name, 'Failed to get actual speed data for {}'.format(name)) continue elif not speed_target: self.set_object_not_ok('Fan', name, 'Failed to get target speed date for {}'.format(name)) continue - elif not speed_tolerance: - self.set_object_not_ok('Fan', name, 'Failed to get speed tolerance for {}'.format(name)) + elif is_under_speed is None: + self.set_object_not_ok('Fan', name, 'Failed to get under speed threshold check for {}'.format(name)) + continue + elif is_over_speed is None: + self.set_object_not_ok('Fan', name, 'Failed to get over speed threshold check for {}'.format(name)) continue else: try: speed = float(speed) speed_target = float(speed_target) - speed_tolerance = float(speed_tolerance) - speed_min_th = speed_target * (1 - float(speed_tolerance) / 100) - speed_max_th = speed_target * (1 + float(speed_tolerance) / 100) - if speed < speed_min_th or speed > speed_max_th: + if 'true' in (is_under_speed.lower(), is_over_speed.lower()): self.set_object_not_ok('Fan', name, - '{} speed is out of range, speed={}, range=[{},{}]'.format(name, - speed, - speed_min_th, - speed_max_th)) + '{} speed is out of range, speed={}, target={}'.format( + name, + speed, + speed_target)) continue except ValueError: self.set_object_not_ok('Fan', name, - 'Invalid fan speed data for {}, speed={}, target={}, tolerance={}'.format( + 'Invalid fan speed data for {}, speed={}, target={}, is_under_speed={}, is_over_speed={}'.format( name, speed, speed_target, - speed_tolerance)) + is_under_speed, + is_over_speed)) continue if not self._ignore_check(config.ignore_devices, 'fan', name, 'direction'): diff --git a/src/system-health/tests/test_system_health.py b/src/system-health/tests/test_system_health.py index c2d782230749..67f819ecc5ff 100644 --- a/src/system-health/tests/test_system_health.py +++ b/src/system-health/tests/test_system_health.py @@ -298,7 +298,8 @@ def test_hardware_checker(): 'status': 'True', 'speed': '60', 'speed_target': '60', - 'speed_tolerance': '20', + 'is_under_speed': 'False', + 'is_over_speed': 'False', 'direction': 'intake' }, 'FAN_INFO|fan2': { @@ -306,28 +307,40 @@ def test_hardware_checker(): 'status': 'True', 'speed': '60', 'speed_target': '60', - 'speed_tolerance': '20' + 'is_under_speed': 'False', + 'is_over_speed': 'False', }, 'FAN_INFO|fan3': { 'presence': 'True', 'status': 'False', 'speed': '60', 'speed_target': '60', - 'speed_tolerance': '20' + 'is_under_speed': 'False', + 'is_over_speed': 'False', }, 'FAN_INFO|fan4': { 'presence': 'True', 'status': 'True', 'speed': '20', 'speed_target': '60', - 'speed_tolerance': '20' + 'is_under_speed': 'True', + 'is_over_speed': 'False', }, 'FAN_INFO|fan5': { + 'presence': 'True', + 'status': 'True', + 'speed': '90', + 'speed_target': '60', + 'is_under_speed': 'False', + 'is_over_speed': 'True', + }, + 'FAN_INFO|fan6': { 'presence': 'True', 'status': 'True', 'speed': '60', 'speed_target': '60', - 'speed_tolerance': '20', + 'is_under_speed': 'False', + 'is_over_speed': 'False', 'direction': 'exhaust' } }) @@ -426,7 +439,10 @@ def test_hardware_checker(): assert 'fan5' in checker._info assert checker._info['fan5'][HealthChecker.INFO_FIELD_OBJECT_STATUS] == HealthChecker.STATUS_NOT_OK - assert checker._info['fan5'][HealthChecker.INFO_FIELD_OBJECT_MSG] == 'fan5 direction exhaust is not aligned with fan1 direction intake' + + assert 'fan6' in checker._info + assert checker._info['fan6'][HealthChecker.INFO_FIELD_OBJECT_STATUS] == HealthChecker.STATUS_NOT_OK + assert checker._info['fan6'][HealthChecker.INFO_FIELD_OBJECT_MSG] == 'fan6 direction exhaust is not aligned with fan1 direction intake' assert 'PSU 1' in checker._info assert checker._info['PSU 1'][HealthChecker.INFO_FIELD_OBJECT_STATUS] == HealthChecker.STATUS_OK From c83f81ea0fb81a45fe49459bc5fdc94451ef9118 Mon Sep 17 00:00:00 2001 From: abdosi <58047199+abdosi@users.noreply.github.com> Date: Fri, 5 Jan 2024 12:24:31 -0800 Subject: [PATCH 116/419] [chassis] Added support of isolating given LC in Chassis with TSA mode (#16732) What I did: Added support when TSA is done on Line Card make sure it's completely isolated from all e-BGP peer devices from this LC or remote LC Why I did: Currently when TSA is executed on LC routes are withdrawn from it's connected e-BGP peers only. e-BGP peers on remote LC can/will (via i-BGP) still have route pointing/attracting traffic towards this isolated LC. How I did: When TSA is applied on LC all the routes that are advertised via i-BGP are set with community tag of no-export so that when remote LC received these routes it does not send over to it's connected e-BGP peers. Also once we receive the route with no-export over iBGP match on it and and set the local preference of that route to lower value (80) so that we remove that route from the forwarding database. Below scenario explains why we do this: - LC1 advertise R1 to LC3 - LC2 advertise R1 to LC3 - On LC3 we have multi-path/ECMP over both LC1 and LC2 - On LC3 R1 received from LC1 is consider best route over R1 over received from LC2 and is send to LC3 e-BGP peers - Now we do TSA on LC2 - LC3 will receive R1 from LC2 with community no-export and from LC1 same as earlier (no change) - LC3 will still get traffic for R1 since it is still advertised to e-BGP peers (since R1 from LC1 is best route) - LC3 will forward to both LC1 and LC2 (ecmp) and this causes issue as LC2 is in TSA mode and should not receive traffic To fix above scenario we change the preference to lower value of R1 received from LC2 so that it is removed from Multi-path/ECMP group. How I verfiy: UT has been added to make sure Template generation is correct Manual Verification of the functionality sonic-mgmt test case will be updated accordingly. Please note this PR is on top of this :#16714 which needs to be merged first. Signed-off-by: Abhishek Dosi --- dockers/docker-fpm-frr/TS | 22 +++++++++--- dockers/docker-fpm-frr/TSA | 5 +-- dockers/docker-fpm-frr/TSB | 5 +-- .../bgpd/templates/internal/policies.conf.j2 | 9 +++++ .../templates/voq_chassis/policies.conf.j2 | 9 +++++ .../frr/bgpd/tsa/bgpd.tsa.isolate.conf.j2 | 7 ++++ .../frr/bgpd/tsa/bgpd.tsa.unisolate.conf.j2 | 6 ++++ .../bgpcfgd/managers_device_global.py | 6 ++-- .../result_chassis_packet_isolate.conf | 35 +++++++++++++++++++ .../result_chassis_packet_unisolate.conf | 33 +++++++++++++++++ .../policies.conf/result_chasiss_packet.conf | 9 +++++ .../policies.conf/result_base.conf | 9 +++++ src/sonic-bgpcfgd/tests/test_device_global.py | 30 +++++++++++++--- 13 files changed, 171 insertions(+), 14 deletions(-) create mode 100644 src/sonic-bgpcfgd/tests/data/internal/peer-group.conf/result_chassis_packet_isolate.conf create mode 100644 src/sonic-bgpcfgd/tests/data/internal/peer-group.conf/result_chassis_packet_unisolate.conf diff --git a/dockers/docker-fpm-frr/TS b/dockers/docker-fpm-frr/TS index 888b2c20b847..fda750d9c224 100755 --- a/dockers/docker-fpm-frr/TS +++ b/dockers/docker-fpm-frr/TS @@ -4,7 +4,12 @@ switch_type=`sonic-cfggen -d -v "DEVICE_METADATA['localhost']['switch_type']"` # Check whether the routemap is for internal BGP sessions. function is_internal_route_map() { - [[ "$1" =~ .*"_INTERNAL_".* || "$1" =~ .*"VOQ_".* ]] + if [[ "$1" =~ .*"_INTERNAL_".* || "$1" =~ .*"VOQ_".* ]] + then + return 1 + else + return 0 + fi } function check_not_installed() @@ -13,7 +18,10 @@ function check_not_installed() config=$(vtysh -c "show run") for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p' | egrep 'V4|V6' | uniq); do - is_internal_route_map $route_map_name && continue + is_internal_route_map $route_map_name + if [[ $? -eq 1 ]]; then + continue + fi echo "$config" | egrep -q "^route-map $route_map_name permit 20$" c=$((c+$?)) echo "$config" | egrep -q "^route-map $route_map_name permit 30$" @@ -31,7 +39,10 @@ function check_installed() config=$(vtysh -c "show run") for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p' | egrep 'V4|V6' | uniq); do - is_internal_route_map $route_map_name && continue + is_internal_route_map $route_map_name + if [[ $? -eq 1 ]]; then + continue + fi echo "$config" | egrep -q "^route-map $route_map_name permit 20$" c=$((c+$?)) e=$((e+1)) @@ -51,7 +62,10 @@ function find_num_routemap() config=$(vtysh -c "show run") for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p' | egrep 'V4|V6' | uniq); do - is_internal_route_map $route_map_name && continue + is_internal_route_map $route_map_name + if [[ $? -eq 1 ]]; then + continue + fi c=$((c+1)) done return $c diff --git a/dockers/docker-fpm-frr/TSA b/dockers/docker-fpm-frr/TSA index f45d3bf0bcb3..c94a35ea05f0 100755 --- a/dockers/docker-fpm-frr/TSA +++ b/dockers/docker-fpm-frr/TSA @@ -16,7 +16,8 @@ then TSA_FILE=$(mktemp) for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p' | uniq); do - is_internal_route_map $route_map_name && continue + is_internal_route_map $route_map_name + internal_route_map=$? case "$route_map_name" in *V4*) ip_version=V4 @@ -30,7 +31,7 @@ then continue ;; esac - sonic-cfggen -d -a "{\"route_map_name\":\"$route_map_name\", \"ip_version\": \"$ip_version\", \"ip_protocol\": \"$ip_protocol\"}" -y /etc/sonic/constants.yml -t /usr/share/sonic/templates/bgpd/tsa/bgpd.tsa.isolate.conf.j2 > "$TSA_FILE" + sonic-cfggen -d -a "{\"route_map_name\":\"$route_map_name\", \"ip_version\": \"$ip_version\", \"ip_protocol\": \"$ip_protocol\", \"internal_route_map\": \"$internal_route_map\"}" -y /etc/sonic/constants.yml -t /usr/share/sonic/templates/bgpd/tsa/bgpd.tsa.isolate.conf.j2 > "$TSA_FILE" vtysh -f "$TSA_FILE" rm -f "$TSA_FILE" done diff --git a/dockers/docker-fpm-frr/TSB b/dockers/docker-fpm-frr/TSB index 50f1ebc3ce8b..add7eda94504 100755 --- a/dockers/docker-fpm-frr/TSB +++ b/dockers/docker-fpm-frr/TSB @@ -16,7 +16,8 @@ then TSB_FILE=$(mktemp) for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p' | uniq); do - is_internal_route_map $route_map_name && continue + is_internal_route_map $route_map_name + internal_route_map=$? case "$route_map_name" in *V4*) ;; @@ -26,7 +27,7 @@ then continue ;; esac - sonic-cfggen -d -a "{\"route_map_name\":\"$route_map_name\"}" -t /usr/share/sonic/templates/bgpd/tsa/bgpd.tsa.unisolate.conf.j2 > "$TSB_FILE" + sonic-cfggen -d -a "{\"route_map_name\":\"$route_map_name\", \"internal_route_map\": \"$internal_route_map\"}" -t /usr/share/sonic/templates/bgpd/tsa/bgpd.tsa.unisolate.conf.j2 > "$TSB_FILE" vtysh -f "$TSB_FILE" rm -f "$TSB_FILE" done diff --git a/dockers/docker-fpm-frr/frr/bgpd/templates/internal/policies.conf.j2 b/dockers/docker-fpm-frr/frr/bgpd/templates/internal/policies.conf.j2 index 5f9c8a83e29a..bedc6eeea422 100644 --- a/dockers/docker-fpm-frr/frr/bgpd/templates/internal/policies.conf.j2 +++ b/dockers/docker-fpm-frr/frr/bgpd/templates/internal/policies.conf.j2 @@ -16,12 +16,17 @@ route-map FROM_BGP_INTERNAL_PEER_V6 permit 2 set originator-id {{ get_ipv4_loopback_address(CONFIG_DB__LOOPBACK_INTERFACE, "Loopback4096") | ip }} {% elif CONFIG_DB__DEVICE_METADATA['localhost']['switch_type'] == 'chassis-packet' %} bgp community-list standard DEVICE_INTERNAL_COMMUNITY permit {{ constants.bgp.internal_community }} +bgp community-list standard NO_EXPORT permit no-export ! route-map FROM_BGP_INTERNAL_PEER_V4 permit 1 match community DEVICE_INTERNAL_COMMUNITY set comm-list DEVICE_INTERNAL_COMMUNITY delete set tag {{ constants.bgp.internal_community_match_tag }} ! +route-map FROM_BGP_INTERNAL_PEER_V4 permit 2 + match community NO_EXPORT + set local-preference 80 +! route-map FROM_BGP_INTERNAL_PEER_V6 permit 1 set ipv6 next-hop prefer-global on-match next @@ -31,6 +36,10 @@ route-map FROM_BGP_INTERNAL_PEER_V6 permit 2 set comm-list DEVICE_INTERNAL_COMMUNITY delete set tag {{ constants.bgp.internal_community_match_tag }} ! +route-map FROM_BGP_INTERNAL_PEER_V6 permit 3 + match community NO_EXPORT + set local-preference 80 +! route-map TO_BGP_INTERNAL_PEER_V4 permit 1 match ip address prefix-list PL_LoopbackV4 set community {{ constants.bgp.internal_community }} diff --git a/dockers/docker-fpm-frr/frr/bgpd/templates/voq_chassis/policies.conf.j2 b/dockers/docker-fpm-frr/frr/bgpd/templates/voq_chassis/policies.conf.j2 index 9ffe00d14a26..7002a0ac1a41 100644 --- a/dockers/docker-fpm-frr/frr/bgpd/templates/voq_chassis/policies.conf.j2 +++ b/dockers/docker-fpm-frr/frr/bgpd/templates/voq_chassis/policies.conf.j2 @@ -2,12 +2,17 @@ ! template: bgpd/templates/voq_chassis/policies.conf.j2 ! bgp community-list standard DEVICE_INTERNAL_COMMUNITY permit {{ constants.bgp.internal_community }} +bgp community-list standard NO_EXPORT permit no-export ! route-map FROM_VOQ_CHASSIS_V4_PEER permit 1 match community DEVICE_INTERNAL_COMMUNITY set comm-list DEVICE_INTERNAL_COMMUNITY delete set tag {{ constants.bgp.internal_community_match_tag }} ! +route-map FROM_VOQ_CHASSIS_V4_PEER permit 2 + match community NO_EXPORT + set local-preference 80 +! route-map FROM_VOQ_CHASSIS_V4_PEER permit 100 ! route-map TO_VOQ_CHASSIS_V4_PEER permit 1 @@ -26,6 +31,10 @@ route-map FROM_VOQ_CHASSIS_V6_PEER permit 2 set comm-list DEVICE_INTERNAL_COMMUNITY delete set tag {{ constants.bgp.internal_community_match_tag }} ! +route-map FROM_VOQ_CHASSIS_V6_PEER permit 3 + match community NO_EXPORT + set local-preference 80 +! route-map FROM_VOQ_CHASSIS_V6_PEER permit 100 ! route-map TO_VOQ_CHASSIS_V6_PEER permit 1 diff --git a/dockers/docker-fpm-frr/frr/bgpd/tsa/bgpd.tsa.isolate.conf.j2 b/dockers/docker-fpm-frr/frr/bgpd/tsa/bgpd.tsa.isolate.conf.j2 index 2321643f8d04..1d39af2a8942 100644 --- a/dockers/docker-fpm-frr/frr/bgpd/tsa/bgpd.tsa.isolate.conf.j2 +++ b/dockers/docker-fpm-frr/frr/bgpd/tsa/bgpd.tsa.isolate.conf.j2 @@ -1,3 +1,8 @@ +{%- if internal_route_map == '1' -%} +route-map {{ route_map_name }} permit 20 + set community no-export additive +{# #} +{%- else -%} route-map {{ route_map_name }} permit 20 match {{ ip_protocol }} address prefix-list PL_Loopback{{ ip_version }} set community {{ constants.bgp.traffic_shift_community }} @@ -5,4 +10,6 @@ route-map {{ route_map_name }} permit 30 match tag {{ constants.bgp.internal_community_match_tag }} set community {{ constants.bgp.traffic_shift_community }} route-map {{ route_map_name }} deny 40 +{# #} +{%- endif -%} ! diff --git a/dockers/docker-fpm-frr/frr/bgpd/tsa/bgpd.tsa.unisolate.conf.j2 b/dockers/docker-fpm-frr/frr/bgpd/tsa/bgpd.tsa.unisolate.conf.j2 index 7ba4c1bd6f32..45caddc2196d 100644 --- a/dockers/docker-fpm-frr/frr/bgpd/tsa/bgpd.tsa.unisolate.conf.j2 +++ b/dockers/docker-fpm-frr/frr/bgpd/tsa/bgpd.tsa.unisolate.conf.j2 @@ -1,4 +1,10 @@ +{%- if internal_route_map == '1' -%} +no route-map {{ route_map_name }} permit 20 +{# #} +{%- else -%} no route-map {{ route_map_name }} permit 20 no route-map {{ route_map_name }} permit 30 no route-map {{ route_map_name }} deny 40 +{# #} +{%- endif -%} ! diff --git a/src/sonic-bgpcfgd/bgpcfgd/managers_device_global.py b/src/sonic-bgpcfgd/bgpcfgd/managers_device_global.py index 4f7c28cbd51b..db2bcd9893db 100644 --- a/src/sonic-bgpcfgd/bgpcfgd/managers_device_global.py +++ b/src/sonic-bgpcfgd/bgpcfgd/managers_device_global.py @@ -91,14 +91,16 @@ def __generate_routemaps_from_template(self, route_map_names, template): # For packet-based chassis, the bgp session between the linecards are also considered internal sessions # While isolating a single linecard, these sessions should not be skipped if "_INTERNAL_" in rm or "VOQ_" in rm: - continue + is_internal="1" + else: + is_internal="0" if "V4" in rm: ipv="V4" ; ipp="ip" elif "V6" in rm: ipv="V6" ; ipp="ipv6" else: continue - cmd += template.render(route_map_name=rm,ip_version=ipv,ip_protocol=ipp, constants=self.constants) + cmd += template.render(route_map_name=rm,ip_version=ipv,ip_protocol=ipp,internal_route_map=is_internal, constants=self.constants) cmd += "\n" return cmd diff --git a/src/sonic-bgpcfgd/tests/data/internal/peer-group.conf/result_chassis_packet_isolate.conf b/src/sonic-bgpcfgd/tests/data/internal/peer-group.conf/result_chassis_packet_isolate.conf new file mode 100644 index 000000000000..cfb47916e655 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/internal/peer-group.conf/result_chassis_packet_isolate.conf @@ -0,0 +1,35 @@ +! +! template: bgpd/templates/internal/peer-group.conf.j2 +! + neighbor INTERNAL_PEER_V4 peer-group + neighbor INTERNAL_PEER_V6 peer-group + neighbor INTERNAL_PEER_V4 update-source Loopback4096 + address-family ipv4 + neighbor INTERNAL_PEER_V4 soft-reconfiguration inbound + neighbor INTERNAL_PEER_V4 allowas-in 1 + neighbor INTERNAL_PEER_V4 route-map FROM_BGP_INTERNAL_PEER_V4 in + neighbor INTERNAL_PEER_V4 route-map TO_BGP_INTERNAL_PEER_V4 out + neighbor INTERNAL_PEER_V4 send-community + neighbor INTERNAL_PEER_V4 ttl-security hops 1 + exit-address-family + neighbor INTERNAL_PEER_V6 update-source Loopback4096 + address-family ipv6 + neighbor INTERNAL_PEER_V6 soft-reconfiguration inbound + neighbor INTERNAL_PEER_V6 allowas-in 1 + neighbor INTERNAL_PEER_V6 route-map FROM_BGP_INTERNAL_PEER_V6 in + neighbor INTERNAL_PEER_V6 route-map TO_BGP_INTERNAL_PEER_V6 out + neighbor INTERNAL_PEER_V6 send-community + neighbor INTERNAL_PEER_V6 ttl-security hops 1 + exit-address-family +! +! end of template: bgpd/templates/internal/peer-group.conf.j2 +! + + +route-map TO_BGP_INTERNAL_PEER_V4 permit 20 + set community no-export additive +! +route-map TO_BGP_INTERNAL_PEER_V6 permit 20 + set community no-export additive +! + diff --git a/src/sonic-bgpcfgd/tests/data/internal/peer-group.conf/result_chassis_packet_unisolate.conf b/src/sonic-bgpcfgd/tests/data/internal/peer-group.conf/result_chassis_packet_unisolate.conf new file mode 100644 index 000000000000..2711f46d567b --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/internal/peer-group.conf/result_chassis_packet_unisolate.conf @@ -0,0 +1,33 @@ +! +! template: bgpd/templates/internal/peer-group.conf.j2 +! + neighbor INTERNAL_PEER_V4 peer-group + neighbor INTERNAL_PEER_V6 peer-group + neighbor INTERNAL_PEER_V4 update-source Loopback4096 + address-family ipv4 + neighbor INTERNAL_PEER_V4 soft-reconfiguration inbound + neighbor INTERNAL_PEER_V4 allowas-in 1 + neighbor INTERNAL_PEER_V4 route-map FROM_BGP_INTERNAL_PEER_V4 in + neighbor INTERNAL_PEER_V4 route-map TO_BGP_INTERNAL_PEER_V4 out + neighbor INTERNAL_PEER_V4 send-community + neighbor INTERNAL_PEER_V4 ttl-security hops 1 + exit-address-family + neighbor INTERNAL_PEER_V6 update-source Loopback4096 + address-family ipv6 + neighbor INTERNAL_PEER_V6 soft-reconfiguration inbound + neighbor INTERNAL_PEER_V6 allowas-in 1 + neighbor INTERNAL_PEER_V6 route-map FROM_BGP_INTERNAL_PEER_V6 in + neighbor INTERNAL_PEER_V6 route-map TO_BGP_INTERNAL_PEER_V6 out + neighbor INTERNAL_PEER_V6 send-community + neighbor INTERNAL_PEER_V6 ttl-security hops 1 + exit-address-family +! +! end of template: bgpd/templates/internal/peer-group.conf.j2 +! + + +no route-map TO_BGP_INTERNAL_PEER_V4 permit 20 +! +no route-map TO_BGP_INTERNAL_PEER_V6 permit 20 +! + diff --git a/src/sonic-bgpcfgd/tests/data/internal/policies.conf/result_chasiss_packet.conf b/src/sonic-bgpcfgd/tests/data/internal/policies.conf/result_chasiss_packet.conf index e3a4e2e071c8..4b346d635975 100644 --- a/src/sonic-bgpcfgd/tests/data/internal/policies.conf/result_chasiss_packet.conf +++ b/src/sonic-bgpcfgd/tests/data/internal/policies.conf/result_chasiss_packet.conf @@ -2,12 +2,17 @@ ! template: bgpd/templates/internal/policies.conf.j2 ! bgp community-list standard DEVICE_INTERNAL_COMMUNITY permit 12345:556 +bgp community-list standard NO_EXPORT permit no-export ! route-map FROM_BGP_INTERNAL_PEER_V4 permit 1 match community DEVICE_INTERNAL_COMMUNITY set comm-list DEVICE_INTERNAL_COMMUNITY delete set tag 101 ! +route-map FROM_BGP_INTERNAL_PEER_V4 permit 2 + match community NO_EXPORT + set local-preference 80 +! route-map FROM_BGP_INTERNAL_PEER_V6 permit 1 set ipv6 next-hop prefer-global on-match next @@ -17,6 +22,10 @@ route-map FROM_BGP_INTERNAL_PEER_V6 permit 2 set comm-list DEVICE_INTERNAL_COMMUNITY delete set tag 101 ! +route-map FROM_BGP_INTERNAL_PEER_V6 permit 3 + match community NO_EXPORT + set local-preference 80 +! route-map TO_BGP_INTERNAL_PEER_V4 permit 1 match ip address prefix-list PL_LoopbackV4 set community 12345:556 diff --git a/src/sonic-bgpcfgd/tests/data/voq_chassis/policies.conf/result_base.conf b/src/sonic-bgpcfgd/tests/data/voq_chassis/policies.conf/result_base.conf index 4dc2f9cec96c..f0e3771d1a39 100644 --- a/src/sonic-bgpcfgd/tests/data/voq_chassis/policies.conf/result_base.conf +++ b/src/sonic-bgpcfgd/tests/data/voq_chassis/policies.conf/result_base.conf @@ -2,12 +2,17 @@ ! template: bgpd/templates/voq_chassis/policies.conf.j2 ! bgp community-list standard DEVICE_INTERNAL_COMMUNITY permit 12345:556 +bgp community-list standard NO_EXPORT permit no-export ! route-map FROM_VOQ_CHASSIS_V4_PEER permit 1 match community DEVICE_INTERNAL_COMMUNITY set comm-list DEVICE_INTERNAL_COMMUNITY delete set tag 101 ! +route-map FROM_VOQ_CHASSIS_V4_PEER permit 2 + match community NO_EXPORT + set local-preference 80 +! route-map FROM_VOQ_CHASSIS_V4_PEER permit 100 ! route-map TO_VOQ_CHASSIS_V4_PEER permit 1 @@ -25,6 +30,10 @@ route-map FROM_VOQ_CHASSIS_V6_PEER permit 2 set comm-list DEVICE_INTERNAL_COMMUNITY delete set tag 101 ! +route-map FROM_VOQ_CHASSIS_V6_PEER permit 3 + match community NO_EXPORT + set local-preference 80 +! route-map FROM_VOQ_CHASSIS_V6_PEER permit 100 ! route-map TO_VOQ_CHASSIS_V6_PEER permit 1 diff --git a/src/sonic-bgpcfgd/tests/test_device_global.py b/src/sonic-bgpcfgd/tests/test_device_global.py index 049bcbeec058..396a72a23182 100644 --- a/src/sonic-bgpcfgd/tests/test_device_global.py +++ b/src/sonic-bgpcfgd/tests/test_device_global.py @@ -11,6 +11,7 @@ TEMPLATE_PATH = os.path.abspath('../../dockers/docker-fpm-frr/frr') BASE_PATH = os.path.abspath('../sonic-bgpcfgd/tests/data/general/peer-group.conf/') +INTERNAL_BASE_PATH = os.path.abspath('../sonic-bgpcfgd/tests/data/internal/peer-group.conf/') global_constants = { "bgp": { "traffic_shift_community" :"12345:12345", @@ -18,7 +19,7 @@ } } -def constructor(): +def constructor(check_internal=False): cfg_mgr = MagicMock() def get_text(): text = [] @@ -29,7 +30,10 @@ def get_text(): text += [" "] return text def update(): - cfg_mgr.changes = get_string_from_file("/result_all.conf") + if check_internal: + cfg_mgr.changes = get_string_from_file("/result_chasiss_packet.conf", INTERNAL_BASE_PATH) + else: + cfg_mgr.changes = get_string_from_file("/result_all.conf") def push(cfg): cfg_mgr.changes += cfg + "\n" def get_config(): @@ -59,6 +63,15 @@ def test_isolate_device(mocked_log_info): mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") assert m.cfg_mgr.get_config() == get_string_from_file("/result_all_isolate.conf") +@patch('bgpcfgd.managers_device_global.log_debug') +def test_isolate_device_internal_session(mocked_log_info): + m = constructor(check_internal=True) + res = m.set_handler("STATE", {"tsa_enabled": "true"}) + assert res, "Expect True return value for set_handler" + mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") + assert m.cfg_mgr.get_config() == get_string_from_file("/result_chassis_packet_isolate.conf", INTERNAL_BASE_PATH) + + @patch('bgpcfgd.managers_device_global.log_debug') def test_unisolate_device(mocked_log_info): m = constructor() @@ -67,6 +80,15 @@ def test_unisolate_device(mocked_log_info): mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") assert m.cfg_mgr.get_config() == get_string_from_file("/result_all_unisolate.conf") +@patch('bgpcfgd.managers_device_global.log_debug') +def test_unisolate_device_internal_session(mocked_log_info): + m = constructor(check_internal=True) + res = m.set_handler("STATE", {"tsa_enabled": "false"}) + assert res, "Expect True return value for set_handler" + mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") + assert m.cfg_mgr.get_config() == get_string_from_file("/result_chassis_packet_unisolate.conf", INTERNAL_BASE_PATH) + + def test_check_state_and_get_tsa_routemaps(): m = constructor() m.set_handler("STATE", {"tsa_enabled": "true"}) @@ -93,8 +115,8 @@ def test_get_tsb_routemaps(): expected_res = get_string_from_file("/result_unisolate.conf") assert res == expected_res -def get_string_from_file(filename): - fp = open(BASE_PATH + filename, "r") +def get_string_from_file(filename, base_path=BASE_PATH): + fp = open(base_path + filename, "r") cfg = fp.read() fp.close() From fe07450a267eaed5c8a780a7bd6c6f3e5cb69f73 Mon Sep 17 00:00:00 2001 From: Zain Budhwani <99770260+zbud-msft@users.noreply.github.com> Date: Tue, 30 Jan 2024 22:14:23 -0800 Subject: [PATCH 117/419] Disable eventd and rsyslog plugin in slim images (#17905) ### Why I did it Disable eventd at buildtime for slim images ##### Work item tracking - Microsoft ADO **(number only)**:26386286 #### How I did it Add flags for disabling eventd and only copy rsyslog conf files when eventd is included and not slim image #### How to verify it Manual testing --- Makefile.work | 1 + dockers/docker-dhcp-relay/Dockerfile.j2 | 6 +++++- dockers/docker-fpm-frr/Dockerfile.j2 | 8 ++++++-- dockers/docker-orchagent/Dockerfile.j2 | 11 +++++++---- files/build_templates/init_cfg.json.j2 | 6 +++++- files/build_templates/sonic_debian_extension.j2 | 9 ++++++++- .../rsyslog.d/{00-sonic.conf => 00-sonic.conf.j2} | 6 ++++++ rules/config | 3 +++ rules/docker-eventd.mk | 4 ++++ slave.mk | 9 +++++++++ 10 files changed, 54 insertions(+), 9 deletions(-) rename files/image_config/rsyslog/rsyslog.d/{00-sonic.conf => 00-sonic.conf.j2} (87%) diff --git a/Makefile.work b/Makefile.work index 628f770a8200..b3901c342e26 100644 --- a/Makefile.work +++ b/Makefile.work @@ -544,6 +544,7 @@ SONIC_BUILD_INSTRUCTION := $(MAKE) \ SONIC_CONFIG_USE_NATIVE_DOCKERD_FOR_BUILD=$(SONIC_CONFIG_USE_NATIVE_DOCKERD_FOR_BUILD) \ SONIC_INCLUDE_SYSTEM_TELEMETRY=$(INCLUDE_SYSTEM_TELEMETRY) \ SONIC_INCLUDE_SYSTEM_GNMI=$(INCLUDE_SYSTEM_GNMI) \ + SONIC_INCLUDE_SYSTEM_EVENTD=$(INCLUDE_SYSTEM_EVENTD) \ INCLUDE_DHCP_RELAY=$(INCLUDE_DHCP_RELAY) \ INCLUDE_DHCP_SERVER=$(INCLUDE_DHCP_SERVER) \ INCLUDE_MACSEC=$(INCLUDE_MACSEC) \ diff --git a/dockers/docker-dhcp-relay/Dockerfile.j2 b/dockers/docker-dhcp-relay/Dockerfile.j2 index 8b0753f288c3..a406af404065 100644 --- a/dockers/docker-dhcp-relay/Dockerfile.j2 +++ b/dockers/docker-dhcp-relay/Dockerfile.j2 @@ -51,13 +51,17 @@ COPY ["dhcp-relay.programs.j2", "dhcpv4-relay.agents.j2", "dhcpv6-relay.agents.j COPY ["files/supervisor-proc-exit-listener", "/usr/bin"] COPY ["critical_processes", "/etc/supervisor"] COPY ["cli", "/cli/"] + +{% if include_system_eventd == "y" %} +{% if build_reduce_image_size != "y" or sonic_asic_platform != "broadcom" %} # Copy regex json and rsyslog_plugin.conf file into rsyslog.d COPY ["*.json", "/etc/rsyslog.d/"] COPY ["files/rsyslog_plugin.conf.j2", "/etc/rsyslog.d/"] - # Create dhcp_relay_regex.conf RUN j2 -f json /etc/rsyslog.d/rsyslog_plugin.conf.j2 /etc/rsyslog.d/events_info.json > /etc/rsyslog.d/dhcp_relay_events.conf RUN rm -f /etc/rsyslog.d/rsyslog_plugin.conf.j2 RUN rm -f /etc/rsyslog.d/events_info.json +{% endif %} +{% endif %} ENTRYPOINT ["/usr/bin/docker_init.sh"] diff --git a/dockers/docker-fpm-frr/Dockerfile.j2 b/dockers/docker-fpm-frr/Dockerfile.j2 index d15fc1846232..d0cb32d02ec5 100644 --- a/dockers/docker-fpm-frr/Dockerfile.j2 +++ b/dockers/docker-fpm-frr/Dockerfile.j2 @@ -54,15 +54,19 @@ COPY ["TSC", "/usr/bin/TSC"] COPY ["TS", "/usr/bin/TS"] COPY ["files/supervisor-proc-exit-listener", "/usr/bin"] COPY ["zsocket.sh", "/usr/bin/"] -COPY ["*.json", "/etc/rsyslog.d/"] -COPY ["files/rsyslog_plugin.conf.j2", "/etc/rsyslog.d/"] RUN chmod a+x /usr/bin/TSA && \ chmod a+x /usr/bin/TSB && \ chmod a+x /usr/bin/TSC && \ chmod a+x /usr/bin/zsocket.sh +{% if include_system_eventd == "y" %} +{% if build_reduce_image_size != "y" or sonic_asic_platform != "broadcom" %} +COPY ["*.json", "/etc/rsyslog.d/"] +COPY ["files/rsyslog_plugin.conf.j2", "/etc/rsyslog.d/"] RUN j2 -f json /etc/rsyslog.d/rsyslog_plugin.conf.j2 /etc/rsyslog.d/events_info.json > /etc/rsyslog.d/bgp_events.conf RUN rm -f /etc/rsyslog.d/rsyslog_plugin.conf.j2 RUN rm -f /etc/rsyslog.d/events_info.json +{% endif %} +{% endif %} ENTRYPOINT ["/usr/bin/docker_init.sh"] diff --git a/dockers/docker-orchagent/Dockerfile.j2 b/dockers/docker-orchagent/Dockerfile.j2 index b8b95a9133c2..ec17575eb9c5 100755 --- a/dockers/docker-orchagent/Dockerfile.j2 +++ b/dockers/docker-orchagent/Dockerfile.j2 @@ -75,17 +75,20 @@ COPY ["files/supervisor-proc-exit-listener", "/usr/bin"] # Copy all Jinja2 template files into the templates folder COPY ["*.j2", "/usr/share/sonic/templates/"] -# Copy all regex json files and rsyslog_plugin.conf to rsyslog.d -COPY ["*.json", "/etc/rsyslog.d/"] -COPY ["files/rsyslog_plugin.conf.j2", "/etc/rsyslog.d/"] - RUN sonic-cfggen -a "{\"ENABLE_ASAN\":\"{{ENABLE_ASAN}}\"}" -t /usr/share/sonic/templates/docker-init.j2 > /usr/bin/docker-init.sh RUN rm -f /usr/share/sonic/templates/docker-init.j2 RUN chmod 755 /usr/bin/docker-init.sh +{% if include_system_eventd == "y" %} +{% if build_reduce_image_size != "y" or sonic_asic_platform != "broadcom" %} +# Copy all regex json files and rsyslog_plugin.conf to rsyslog.d +COPY ["*.json", "/etc/rsyslog.d/"] +COPY ["files/rsyslog_plugin.conf.j2", "/etc/rsyslog.d/"] # Create swss rsyslog_plugin conf file RUN j2 -f json /etc/rsyslog.d/rsyslog_plugin.conf.j2 /etc/rsyslog.d/events_info.json > /etc/rsyslog.d/swss_events.conf RUN rm -f /etc/rsyslog.d/rsyslog_plugin.conf.j2 RUN rm -f /etc/rsyslog.d/events_info.json +{% endif %} +{% endif %} ENTRYPOINT ["/usr/bin/docker-init.sh"] diff --git a/files/build_templates/init_cfg.json.j2 b/files/build_templates/init_cfg.json.j2 index b43206332c45..9c02de602076 100644 --- a/files/build_templates/init_cfg.json.j2 +++ b/files/build_templates/init_cfg.json.j2 @@ -38,7 +38,6 @@ ("lldp", "enabled", true, "enabled"), ("pmon", "enabled", true, "enabled"), ("snmp", "enabled", true, "enabled"), - ("eventd", "enabled", false, "enabled"), ("swss", "enabled", false, "enabled"), ("syncd", "enabled", false, "enabled")] %} {%- if include_router_advertiser == "y" %}{% do features.append(("radv", "enabled", false, "enabled")) %}{% endif %} @@ -60,6 +59,11 @@ {%- if include_macsec == "y" %}{% do features.append(("macsec", "{% if 'type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] == 'SpineRouter' and DEVICE_RUNTIME_METADATA['MACSEC_SUPPORTED'] %}enabled{% else %}disabled{% endif %}", false, "enabled")) %}{% endif %} {%- if include_system_gnmi == "y" %}{% do features.append(("gnmi", "enabled", true, "enabled")) %}{% endif %} {%- if include_system_telemetry == "y" %}{% do features.append(("telemetry", "enabled", true, "enabled")) %}{% endif %} +{%- if include_system_eventd == "y" and BUILD_REDUCE_IMAGE_SIZE == "y" and sonic_asic_platform == "broadcom" %} + {% do features.append(("eventd","disabled", false, "enabled")) %} +{%- elif include_system_eventd == "y" %} + {% do features.append(("eventd", "enabled", false, "enabled")) %} +{%- endif %} "FEATURE": { {# delayed field if set, will start the feature systemd .timer unit instead of .service unit #} {%- for feature, state, delayed, autorestart in features %} diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 71952b9c4af5..67bc3ab40847 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -322,6 +322,9 @@ sudo dpkg --root=$FILESYSTEM_ROOT -i {{deb}} || sudo LANG=C DEBIAN_FRONTEND=noni sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/sonic-db-cli_*.deb || \ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f + +{% if include_system_eventd == "y" %} +{% if build_reduce_image_size != "y" or sonic_asic_platform != "broadcom" %} # Install sonic-rsyslog-plugin sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/sonic-rsyslog-plugin_*.deb || \ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f @@ -341,6 +344,9 @@ sudo cp $BUILD_TEMPLATES/bgpd_regex.json $FILESYSTEM_ROOT_ETC/rsyslog.d/ j2 -f json $BUILD_TEMPLATES/rsyslog_plugin.conf.j2 $BUILD_TEMPLATES/syncd_events_info.json | sudo tee $FILESYSTEM_ROOT_ETC/rsyslog.d/syncd_events.conf sudo cp $BUILD_TEMPLATES/syncd_regex.json $FILESYSTEM_ROOT_ETC/rsyslog.d/ +{% endif %} +{% endif %} + # Install custom-built monit package and SONiC configuration files sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/monit_*.deb || \ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f @@ -399,7 +405,8 @@ sudo cp $IMAGE_CONFIGS/rsyslog/rsyslog-config.service $FILESYSTEM_ROOT_USR_LIB_S sudo cp $IMAGE_CONFIGS/rsyslog/rsyslog-config.sh $FILESYSTEM_ROOT/usr/bin/ sudo cp $IMAGE_CONFIGS/rsyslog/rsyslog.conf.j2 $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/ sudo cp $IMAGE_CONFIGS/rsyslog/rsyslog-container.conf.j2 $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/ -sudo cp $IMAGE_CONFIGS/rsyslog/rsyslog.d/* $FILESYSTEM_ROOT/etc/rsyslog.d/ +j2 $IMAGE_CONFIGS/rsyslog/rsyslog.d/00-sonic.conf.j2 | sudo tee $FILESYSTEM_ROOT/etc/rsyslog.d/00-sonic.conf +sudo cp $IMAGE_CONFIGS/rsyslog/rsyslog.d/*.conf $FILESYSTEM_ROOT/etc/rsyslog.d/ echo "rsyslog-config.service" | sudo tee -a $GENERATED_SERVICE_FILE # Copy containercfgd configuration files diff --git a/files/image_config/rsyslog/rsyslog.d/00-sonic.conf b/files/image_config/rsyslog/rsyslog.d/00-sonic.conf.j2 similarity index 87% rename from files/image_config/rsyslog/rsyslog.d/00-sonic.conf rename to files/image_config/rsyslog/rsyslog.d/00-sonic.conf.j2 index e949365da4d2..66eb1346362c 100644 --- a/files/image_config/rsyslog/rsyslog.d/00-sonic.conf +++ b/files/image_config/rsyslog/rsyslog.d/00-sonic.conf.j2 @@ -5,6 +5,9 @@ template(name="prog_msg" type="list") { constant(value="\n") } +{% if include_system_eventd == "y" %} +{% if build_reduce_image_size != "y" or sonic_asic_platform != "broadcom" %} + $ModLoad omprog if re_match($programname, "bgp[0-9]*#(frr|zebra|staticd|watchfrr)") then { @@ -25,6 +28,9 @@ if re_match($programname, "bgp[0-9]*#bgpd") then { stop } +{% endif %} +{% endif %} + ## Teamd rules if $programname contains "teamd_" then { diff --git a/rules/config b/rules/config index b9a7efa81502..06dc71261a9b 100644 --- a/rules/config +++ b/rules/config @@ -127,6 +127,9 @@ DEFAULT_VS_PREPARE_MEM = yes # INCLUDE_SYSTEM_GNMI - build docker-sonic-gnmi for system gnmi support INCLUDE_SYSTEM_GNMI = y +# INCLUDE_SYSTEM_EVENTD - build docker-eventd for system eventd support +INCLUDE_SYSTEM_EVENTD = y + # INCLUDE_SYSTEM_TELEMETRY - build docker-sonic-telemetry for system telemetry support INCLUDE_SYSTEM_TELEMETRY = n diff --git a/rules/docker-eventd.mk b/rules/docker-eventd.mk index 509465133cf0..ef926a064df9 100644 --- a/rules/docker-eventd.mk +++ b/rules/docker-eventd.mk @@ -25,10 +25,14 @@ $(DOCKER_DHCP)_SERVICE_REQUIRES = updategraph $(DOCKER_DHCP)_SERVICE_AFTER = database SONIC_DOCKER_IMAGES += $(DOCKER_EVENTD) +ifeq ($(INCLUDE_SYSTEM_EVENTD), y) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_EVENTD) +endif SONIC_DOCKER_DBG_IMAGES += $(DOCKER_EVENTD_DBG) +ifeq ($(INCLUDE_SYSTEM_EVENTD), y) SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_EVENTD_DBG) +endif $(DOCKER_EVENTD)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) $(DOCKER_EVENTD)_CONTAINER_NAME = eventd diff --git a/slave.mk b/slave.mk index bf4f22463161..68b2874b99f5 100644 --- a/slave.mk +++ b/slave.mk @@ -161,6 +161,10 @@ ifeq ($(SONIC_INCLUDE_SYSTEM_GNMI),y) INCLUDE_SYSTEM_GNMI = y endif +ifeq ($(SONIC_INCLUDE_SYSTEM_EVENTD),y) +INCLUDE_SYSTEM_EVENTD = y +endif + ifeq ($(SONIC_INCLUDE_RESTAPI),y) INCLUDE_RESTAPI = y endif @@ -419,6 +423,7 @@ $(info "INCLUDE_MGMT_FRAMEWORK" : "$(INCLUDE_MGMT_FRAMEWORK)") $(info "INCLUDE_ICCPD" : "$(INCLUDE_ICCPD)") $(info "INCLUDE_SYSTEM_TELEMETRY" : "$(INCLUDE_SYSTEM_TELEMETRY)") $(info "INCLUDE_SYSTEM_GNMI" : "$(INCLUDE_SYSTEM_GNMI)") +$(info "INCLUDE_SYSTEM_EVENTD" : "$(INCLUDE_SYSTEM_EVENTD)") $(info "ENABLE_HOST_SERVICE_ON_START" : "$(ENABLE_HOST_SERVICE_ON_START)") $(info "INCLUDE_RESTAPI" : "$(INCLUDE_RESTAPI)") $(info "INCLUDE_SFLOW" : "$(INCLUDE_SFLOW)") @@ -1097,6 +1102,8 @@ $(addprefix $(TARGET_PATH)/, $(DOCKER_IMAGES)) : $(TARGET_PATH)/%.gz : .platform sudo mount --bind $(PYTHON_DEBS_PATH) $($*.gz_PATH)/python-debs $(LOG) sudo mount --bind $(PYTHON_WHEELS_PATH) $($*.gz_PATH)/python-wheels $(LOG) # Export variables for j2. Use path for unique variable names, e.g. docker_orchagent_debs + export include_system_eventd="$(INCLUDE_SYSTEM_EVENTD)" + export build_reduce_image_size="$(BUILD_REDUCE_IMAGE_SIZE)" $(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_debs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_DEPENDS),RDEPENDS))\n" | awk '!a[$$0]++')) $(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_pydebs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_PYTHON_DEBS)))\n" | awk '!a[$$0]++')) $(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_whls=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_PYTHON_WHEELS)))\n" | awk '!a[$$0]++')) @@ -1382,6 +1389,8 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \ export sonic_su_prod_signing_tool="/sonic/scripts/$(shell basename -- $(SECURE_UPGRADE_PROD_SIGNING_TOOL))" export include_system_telemetry="$(INCLUDE_SYSTEM_TELEMETRY)" export include_system_gnmi="$(INCLUDE_SYSTEM_GNMI)" + export include_system_eventd="$(INCLUDE_SYSTEM_EVENTD)" + export build_reduce_image_size="$(BUILD_REDUCE_IMAGE_SIZE)" export include_restapi="$(INCLUDE_RESTAPI)" export include_nat="$(INCLUDE_NAT)" export include_p4rt="$(INCLUDE_P4RT)" From 69478a6b85395be4ba726867a674986f2fe8f282 Mon Sep 17 00:00:00 2001 From: Feng-msft Date: Fri, 12 Jan 2024 10:51:48 +0800 Subject: [PATCH 118/419] Fix dialout build flag issue. (#17715) ### Why I did it Fix ENABLE_DIALOUT flag issue. ##### Work item tracking - Microsoft ADO **(number only)**: 21326000 #### How I did it Update Makefile.work and add debug string. #### How to verify it ![image](https://github.com/sonic-net/sonic-buildimage/assets/97083744/960d75d1-618c-4734-acb5-7a32a28c262b) --- Makefile.work | 4 ++++ slave.mk | 1 + 2 files changed, 5 insertions(+) diff --git a/Makefile.work b/Makefile.work index b3901c342e26..1381795988e2 100644 --- a/Makefile.work +++ b/Makefile.work @@ -40,6 +40,9 @@ # * ENABLE_NATIVE_WRITE: Enable native write/config operations via the gNMI interface. # * Default: unset # * Values: y +# * ENABLE_DIALOUT: Enable dialout client in telemetry. +# * Default: unset +# * Values: y # * SONIC_DPKG_CACHE_METHOD: Specifying method of obtaining the Debian packages from cache: none or cache # * SONIC_DPKG_CACHE_SOURCE: Debian package cache location when cache enabled for debian packages # * BUILD_LOG_TIMESTAMP: Set timestamp in the build log (simple/none) @@ -552,6 +555,7 @@ SONIC_BUILD_INSTRUCTION := $(MAKE) \ SONIC_INCLUDE_MUX=$(INCLUDE_MUX) \ ENABLE_TRANSLIB_WRITE=$(ENABLE_TRANSLIB_WRITE) \ ENABLE_NATIVE_WRITE=$(ENABLE_NATIVE_WRITE) \ + ENABLE_DIALOUT=$(ENABLE_DIALOUT) \ EXTRA_DOCKER_TARGETS=$(EXTRA_DOCKER_TARGETS) \ BUILD_LOG_TIMESTAMP=$(BUILD_LOG_TIMESTAMP) \ SONIC_ENABLE_IMAGE_SIGNATURE=$(ENABLE_IMAGE_SIGNATURE) \ diff --git a/slave.mk b/slave.mk index 68b2874b99f5..aa3abebabf8b 100644 --- a/slave.mk +++ b/slave.mk @@ -442,6 +442,7 @@ $(info "ENABLE_BOOTCHART : "$(ENABLE_BOOTCHART)") $(info "INCLUDE_FIPS" : "$(INCLUDE_FIPS)") $(info "ENABLE_TRANSLIB_WRITE" : "$(ENABLE_TRANSLIB_WRITE)") $(info "ENABLE_NATIVE_WRITE" : "$(ENABLE_NATIVE_WRITE)") +$(info "ENABLE_DIALOUT" : "$(ENABLE_DIALOUT)") $(info "ENABLE_AUTO_TECH_SUPPORT" : "$(ENABLE_AUTO_TECH_SUPPORT)") $(info "PDDF_SUPPORT" : "$(PDDF_SUPPORT)") $(info "MULTIARCH_QEMU_ENVIRON" : "$(MULTIARCH_QEMU_ENVIRON)") From a467ff71a23e4c8f040ae1cd03de26329408b53d Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 2 Feb 2024 18:32:12 +0800 Subject: [PATCH 119/419] [submodule] Update submodule sonic-platform-common to the latest HEAD automatically (#18008) #### Why I did it src/sonic-platform-common ``` * 7c2ad66 - (HEAD -> 202311, origin/202311) Tx/Rx power values should be rounded up to 3 decimal places (#432) (4 hours ago) [mihirpat1] ``` #### How I did it #### How to verify it #### Description for the changelog --- 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 83a8c7a446c5..7c2ad665bbb7 160000 --- a/src/sonic-platform-common +++ b/src/sonic-platform-common @@ -1 +1 @@ -Subproject commit 83a8c7a446c57d538b9228852ff0b2ea37dbdb96 +Subproject commit 7c2ad665bbb771e85e06056c5c0fb7fc42ab5842 From 009b0dd7ec66fbbfaf7f5dcabe215962c881c57f Mon Sep 17 00:00:00 2001 From: Hua Liu <58683130+liuh-80@users.noreply.github.com> Date: Fri, 26 Jan 2024 16:01:50 +0800 Subject: [PATCH 120/419] Change orchagent stuck message from ERR to WARNING (#17872) Change orchagent stuck message from ERR to WARNING #### Why I did it During switch initialization, sometime Orchagent will busy for more than 40seconds and will trigger process stuck workdog error. To improve this issue, change watchdog error message to warning message. ##### Work item tracking - Microsoft ADO: 26517622 #### How I did it Change orchagent stuck message from ERR to WARNING. #### How to verify it Pass all UT. ### Description for the changelog Change orchagent stuck message from ERR to WARNING. --- files/scripts/supervisor-proc-exit-listener | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/files/scripts/supervisor-proc-exit-listener b/files/scripts/supervisor-proc-exit-listener index 61c12d8ce45e..8628826e6157 100755 --- a/files/scripts/supervisor-proc-exit-listener +++ b/files/scripts/supervisor-proc-exit-listener @@ -73,7 +73,7 @@ def get_group_and_process_list(process_file): return group_list, process_list -def generate_alerting_message(process_name, status, dead_minutes): +def generate_alerting_message(process_name, status, dead_minutes, priority=syslog.LOG_ERR): """ @summary: If a critical process was not running, this function will determine it resides in host or in a specific namespace. Then an alerting message will be written into syslog. @@ -86,7 +86,7 @@ def generate_alerting_message(process_name, status, dead_minutes): else: namespace = namespace_prefix + namespace_id - syslog.syslog(syslog.LOG_ERR, "Process '{}' is {} in namespace '{}' ({} minutes)." + syslog.syslog(priority, "Process '{}' is {} in namespace '{}' ({} minutes)." .format(process_name, status, namespace, dead_minutes)) @@ -213,7 +213,7 @@ def main(argv): elapsed_secs = epoch_time - process_heart_beat_info[process]["last_heart_beat"] if elapsed_secs >= ALERTING_INTERVAL_SECS: elapsed_mins = elapsed_secs // 60 - generate_alerting_message(process, "stuck", elapsed_mins) + generate_alerting_message(process, "stuck", elapsed_mins, syslog.LOG_WARNING) if __name__ == "__main__": main(sys.argv[1:]) \ No newline at end of file From 9f1bebbdbafa36f696b642d99348160ca236f0a5 Mon Sep 17 00:00:00 2001 From: Ze Gan Date: Fri, 2 Feb 2024 03:14:30 +0800 Subject: [PATCH 121/419] [ci]: Enable daily building for ubuntu20.04 to every branch (#17520) - The ubuntu 2004 is needed by 202311 - Because the artifacts of ubuntu2004 are used by other repos, a daily building is needed without an updating of this repo for a long time. Signed-off-by: Ze Gan --- .azure-pipelines/azure-pipelines-build-ubuntu-2004.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.azure-pipelines/azure-pipelines-build-ubuntu-2004.yml b/.azure-pipelines/azure-pipelines-build-ubuntu-2004.yml index 1ff50719cee7..1f7f2eb82cc8 100644 --- a/.azure-pipelines/azure-pipelines-build-ubuntu-2004.yml +++ b/.azure-pipelines/azure-pipelines-build-ubuntu-2004.yml @@ -9,6 +9,16 @@ trigger: branches: include: - master + - 202??? + +schedules: +- cron: "0 0 * * *" + displayName: Daily build + branches: + include: + - master + - 202??? + always: true stages: - stage: Build From 1672ce81fc1839e27b21c2616af0da0f5cd3fac2 Mon Sep 17 00:00:00 2001 From: Stepan Blyshchak <38952541+stepanblyschak@users.noreply.github.com> Date: Thu, 7 Dec 2023 15:22:44 +0200 Subject: [PATCH 122/419] [config-topology] use cached variables (#17343) - Why I did it Improve boot performance mostly needed for fast and warmboot - How I did it Use cached variable. - How to verify it Boot the system. Simply do "systemd-analyze blame" and look at service start time. Signed-off-by: Stepan Blyschak --- files/image_config/config-topology/config-topology.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/image_config/config-topology/config-topology.sh b/files/image_config/config-topology/config-topology.sh index 9ba06cb87a78..2bc2b7861c6a 100755 --- a/files/image_config/config-topology/config-topology.sh +++ b/files/image_config/config-topology/config-topology.sh @@ -4,7 +4,7 @@ # which could be used for platform specific topology configuration # start() { - PLATFORM=`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform` + PLATFORM=${PLATFORM:-`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`} #Path to platform topology script TOPOLOGY_SCRIPT="/usr/share/sonic/device/$PLATFORM/plugins/config-topology.sh" #if topology script file not present, do nothing and return 0 @@ -13,7 +13,7 @@ start() { } stop() { - PLATFORM=`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform` + PLATFORM=${PLATFORM:-`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`} #Path to platform topology script TOPOLOGY_SCRIPT="/usr/share/sonic/device/$PLATFORM/plugins/config-topology.sh" #if topology script file not present, do nothing and return 0 From 5cd18eeda7aca88d88e791913f5e0fc58e181439 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 3 Feb 2024 00:15:51 +0800 Subject: [PATCH 123/419] [ci/build]: Upgrade SONiC package versions (#17956) --- files/build/versions/default/versions-git | 4 ++-- files/build/versions/default/versions-mirror | 22 +++++++++---------- .../dockers/docker-ptf/versions-deb-buster | 2 +- .../sonic-slave-buster/versions-deb-buster | 20 ++++++++--------- .../versions-deb-buster-armhf | 4 ++++ 5 files changed, 28 insertions(+), 24 deletions(-) diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index ff4e4f20d96e..fa9475088026 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==68c511349d6ee2a50e3b7e3ce96b8a06034d304e +https://chromium.googlesource.com/chromium/tools/depot_tools.git==10bd39fd47865eb6c9af749e4d30e8ec5d06451f https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f https://github.com/CESNET/libyang.git==fc4dbd923e044006c93df020590a1e5a8656c09e 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==a21be9153abe50ae26cd833db62d9493e7eadf54 -https://github.com/FreeRADIUS/freeradius-server.git==cd0dd9e16460dee6dbd37ebeecadf1a3be8cbf31 +https://github.com/FreeRADIUS/freeradius-server.git==6a5e992ac04edffec92ae1d3408e71dcb0ed7896 https://github.com/FreeRADIUS/pam_radius.git==53c0cfff686ab48ae3bac5449d5461b6e1b83d27 https://github.com/jeroennijhof/pam_tacplus.git==b89dba44b58ec7fdc9b5365b982aa4a316484a3c https://github.com/jpirko/libteam.git==8b843e93cee1dab61fb79b01791201cdad45e1d1 diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index 977d789c0329..c98c4752ff7a 100644 --- a/files/build/versions/default/versions-mirror +++ b/files/build/versions/default/versions-mirror @@ -1,14 +1,14 @@ 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==20240126T000254Z -debian-security==20240126T000239Z -download.docker.com_linux_debian_dists_bullseye==2024-01-25T21:46:24Z +debian==20240130T000231Z +debian-security==20240130T000229Z +download.docker.com_linux_debian_dists_bullseye==2024-01-30T14:03:31Z download.docker.com_linux_debian_dists_buster==2024-01-25T21:46:24Z -packages.trafficmanager.net_snapshot_debian-security_20240126T000239Z_dists_bullseye-security==2024-01-25T19:33:24Z -packages.trafficmanager.net_snapshot_debian-security_20240126T000239Z_dists_buster_updates==2024-01-25T19:33:25Z -packages.trafficmanager.net_snapshot_debian_20240126T000254Z_dists_bullseye==2023-10-07T11:07:16Z -packages.trafficmanager.net_snapshot_debian_20240126T000254Z_dists_bullseye-backports==2024-01-25T20:16:12Z -packages.trafficmanager.net_snapshot_debian_20240126T000254Z_dists_bullseye-updates==2024-01-25T20:16:12Z -packages.trafficmanager.net_snapshot_debian_20240126T000254Z_dists_buster==2023-06-10T08:53:33Z -packages.trafficmanager.net_snapshot_debian_20240126T000254Z_dists_buster-backports==2024-01-25T20:16:12Z -packages.trafficmanager.net_snapshot_debian_20240126T000254Z_dists_buster-updates==2023-06-10T08:55:10Z +packages.trafficmanager.net_snapshot_debian-security_20240130T000229Z_dists_bullseye-security==2024-01-29T21:14:47Z +packages.trafficmanager.net_snapshot_debian-security_20240130T000229Z_dists_buster_updates==2024-01-29T21:14:48Z +packages.trafficmanager.net_snapshot_debian_20240130T000231Z_dists_bullseye==2023-10-07T11:07:16Z +packages.trafficmanager.net_snapshot_debian_20240130T000231Z_dists_bullseye-backports==2024-01-29T20:18:02Z +packages.trafficmanager.net_snapshot_debian_20240130T000231Z_dists_bullseye-updates==2024-01-29T20:18:02Z +packages.trafficmanager.net_snapshot_debian_20240130T000231Z_dists_buster==2023-06-10T08:53:33Z +packages.trafficmanager.net_snapshot_debian_20240130T000231Z_dists_buster-backports==2024-01-29T20:18:02Z +packages.trafficmanager.net_snapshot_debian_20240130T000231Z_dists_buster-updates==2023-06-10T08:55:10Z diff --git a/files/build/versions/dockers/docker-ptf/versions-deb-buster b/files/build/versions/dockers/docker-ptf/versions-deb-buster index e3414d16c786..d294754da102 100644 --- a/files/build/versions/dockers/docker-ptf/versions-deb-buster +++ b/files/build/versions/dockers/docker-ptf/versions-deb-buster @@ -534,7 +534,7 @@ python3-numpy==1:1.16.2-1 python3-olefile==0.46-1 python3-pexpect==4.6.0-1 python3-pickleshare==0.7.5-1 -python3-pil==5.4.1-2+deb10u3 +python3-pil==5.4.1-2+deb10u4 python3-pip==18.1-5 python3-pkg-resources==40.8.0-1 python3-prompt-toolkit==1.0.15-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 7300a53243fd..66b1ff7ac3b9 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster @@ -767,9 +767,9 @@ libmagickcore-6.q16-6-extra==8:6.9.10.23+dfsg-2.1+deb10u5 libmagickwand-6.q16-6==8:6.9.10.23+dfsg-2.1+deb10u5 libmail-sendmail-perl==0.80-1 libmailtools-perl==2.18-1 -libmariadb-dev==1:10.3.39-0+deb10u1 -libmariadb-dev-compat==1:10.3.39-0+deb10u1 -libmariadb3==1:10.3.39-0+deb10u1 +libmariadb-dev==1:10.3.39-0+deb10u2 +libmariadb-dev-compat==1:10.3.39-0+deb10u2 +libmariadb3==1:10.3.39-0+deb10u2 libmaven-archiver-java==3.2.0-2 libmaven-clean-plugin-java==3.1.0-1 libmaven-common-artifact-filters-java==3.0.1-3 @@ -1381,7 +1381,7 @@ man-db==2.8.5-2 man2html-base==1.6g-11 manpages==4.16-2 manpages-dev==4.16-2 -mariadb-common==1:10.3.39-0+deb10u1 +mariadb-common==1:10.3.39-0+deb10u2 maven==3.6.0-1 maven-debian-helper==2.3.2 maven-repo-helper==1.9.3 @@ -1399,10 +1399,10 @@ nftables==0.9.0-2 nlohmann-json3-dev==3.5.0-0.1 ocl-icd-libopencl1==2.2.12-2 openjade==1.4devel1-21.3+b1 -openjdk-11-jdk==11.0.21+9-1~deb10u1 -openjdk-11-jdk-headless==11.0.21+9-1~deb10u1 -openjdk-11-jre==11.0.21+9-1~deb10u1 -openjdk-11-jre-headless==11.0.21+9-1~deb10u1 +openjdk-11-jdk==11.0.22+7-1~deb10u1 +openjdk-11-jdk-headless==11.0.22+7-1~deb10u1 +openjdk-11-jre==11.0.22+7-1~deb10u1 +openjdk-11-jre-headless==11.0.22+7-1~deb10u1 openmpi-bin==3.1.3-11 openmpi-common==3.1.3-11 opensp==1.5.2-13+b1 @@ -1538,7 +1538,7 @@ python-packaging==19.0-1 python-parse==1.6.6-0.1 python-pathlib2==2.3.3-1 python-pbr==4.2.0-5 -python-pil==5.4.1-2+deb10u3 +python-pil==5.4.1-2+deb10u4 python-pip-whl==18.1-5 python-pkg-resources==40.8.0-1 python-pluggy==0.8.0-1 @@ -1623,7 +1623,7 @@ python3-nose2==0.8.0-1 python3-olefile==0.46-1 python3-packaging==19.0-1 python3-pbr==4.2.0-5 -python3-pil==5.4.1-2+deb10u3 +python3-pil==5.4.1-2+deb10u4 python3-pkg-resources==40.8.0-1 python3-pluggy==0.8.0-1 python3-py==1.7.0-2 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 5957b744fe03..e49aa8016b2b 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 @@ -11,3 +11,7 @@ libxslt1-dev==1.1.32-2.2~deb10u2 linux-compiler-gcc-8-arm==4.19.304-1 nasm==2.14-1 nodejs==14.21.3-deb-1nodesource1 +openjdk-11-jdk==11.0.21+9-1~deb10u1 +openjdk-11-jdk-headless==11.0.21+9-1~deb10u1 +openjdk-11-jre==11.0.21+9-1~deb10u1 +openjdk-11-jre-headless==11.0.21+9-1~deb10u1 From a110e625a238962037392570f06cb31bce209964 Mon Sep 17 00:00:00 2001 From: kellyyeh <42761586+kellyyeh@users.noreply.github.com> Date: Tue, 30 Jan 2024 10:02:34 -0800 Subject: [PATCH 124/419] Only add to DHCP_RELAY if dhcpv6 servers exist (#17770) --- src/sonic-config-engine/minigraph.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index 5746c4f733d3..393b515c0559 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -680,8 +680,8 @@ def parse_dpg(dpg, hname): vdhcpserver_list = vintfdhcpservers.split(';') vlan_attributes['dhcpv6_servers'] = vdhcpserver_list dhcp_attributes['dhcpv6_servers'] = vdhcpserver_list - sonic_vlan_member_name = "Vlan%s" % (vlanid) - dhcp_relay_table[sonic_vlan_member_name] = dhcp_attributes + sonic_vlan_member_name = "Vlan%s" % (vlanid) + dhcp_relay_table[sonic_vlan_member_name] = dhcp_attributes vlanmac = vintf.find(str(QName(ns, "MacAddress"))) if vlanmac is not None and vlanmac.text is not None: From f97b53322f97dfc78102c8f36f32285928b26de9 Mon Sep 17 00:00:00 2001 From: Yaqiang Zhu Date: Wed, 3 Jan 2024 01:04:14 +0800 Subject: [PATCH 125/419] [dhcp_server] Add field not exist checks in dhcp_cfggen (#17645) * [dhcp_server] Add field not exist checks in dhcp_cfggen --- .../dhcp_utilities/dhcpservd/dhcp_cfggen.py | 12 +++++++++-- src/sonic-dhcp-utilities/tests/conftest.py | 3 ++- .../tests/test_data/mock_config_db.json | 21 ++++++++++++++++++- .../tests/test_dhcp_cfggen.py | 18 +++++++++++++--- 4 files changed, 47 insertions(+), 7 deletions(-) diff --git a/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py index 544b46e4bb39..efe7440d991a 100755 --- a/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py +++ b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py @@ -134,6 +134,7 @@ def _construct_obj_for_template(self, dhcp_server_ipv4, port_ips, hostname, cust client_classes = [] enabled_dhcp_interfaces = set() used_options = set() + customized_option_keys = customized_options.keys() # Different mode would subscribe different table, always subscribe DHCP_SERVER_IPV4 subscribe_table = set(["DhcpServerTableCfgChangeEventChecker"]) for dhcp_interface_name, dhcp_config in dhcp_server_ipv4.items(): @@ -147,8 +148,12 @@ def _construct_obj_for_template(self, dhcp_server_ipv4, port_ips, hostname, cust .format(dhcp_interface_name)) continue curr_options = {} - for option in dhcp_config["customized_options"]: - if option in customized_options.keys(): + if "customized_options" in dhcp_config: + for option in dhcp_config["customized_options"]: + if option not in customized_option_keys: + syslog.syslog(syslog.LOG_WARNING, "Customized option {} configured for {} is not defined" + .format(option, dhcp_interface_name)) + continue curr_options[option] = { "always_send": customized_options[option]["always_send"], "value": customized_options[option]["value"] @@ -352,6 +357,9 @@ def _parse_port(self, port_ipv4, vlan_interfaces, vlan_members, ranges): syslog.syslog(syslog.LOG_WARNING, f"Cannot find {splits[1]} in port_alias_map") continue port = self.port_alias_map[splits[1]] + if dhcp_interface_name not in vlan_interfaces: + syslog.syslog(syslog.LOG_WARNING, f"Interface {dhcp_interface_name} doesn't have IPv4 address") + continue if dhcp_interface_name not in port_ips: port_ips[dhcp_interface_name] = {} # Get ip information of Vlan diff --git a/src/sonic-dhcp-utilities/tests/conftest.py b/src/sonic-dhcp-utilities/tests/conftest.py index ae75df4822a8..2b3076d5acca 100644 --- a/src/sonic-dhcp-utilities/tests/conftest.py +++ b/src/sonic-dhcp-utilities/tests/conftest.py @@ -35,7 +35,8 @@ def mock_get_render_template(): def mock_parse_port_map_alias(scope="function"): with patch("dhcp_utilities.dhcpservd.dhcp_cfggen.DhcpServCfgGenerator._parse_port_map_alias", return_value=None) as mock_map, \ - patch.object(DhcpServCfgGenerator, "port_alias_map", return_value={"Ethernet24": "etp7", "Ethernet28": "etp8"}, + patch.object(DhcpServCfgGenerator, "port_alias_map", return_value={"Ethernet24": "etp7", "Ethernet28": "etp8", + "Ethernet44": "etp12"}, new_callable=PropertyMock), \ patch.object(DhcpServCfgGenerator, "lease_update_script_path", return_value="/etc/kea/lease_update.sh", new_callable=PropertyMock), \ diff --git a/src/sonic-dhcp-utilities/tests/test_data/mock_config_db.json b/src/sonic-dhcp-utilities/tests/test_data/mock_config_db.json index faeaa722eb3a..ca7974673a34 100644 --- a/src/sonic-dhcp-utilities/tests/test_data/mock_config_db.json +++ b/src/sonic-dhcp-utilities/tests/test_data/mock_config_db.json @@ -6,7 +6,8 @@ }, "VLAN": { "Vlan1000": {}, - "Vlan2000": {} + "Vlan2000": {}, + "Vlan3000": {} }, "VLAN_INTERFACE": { "Vlan1000|192.168.0.1/21": { @@ -26,6 +27,9 @@ }, "Vlan2000": { "NULL": "NULL" + }, + "Vlan3000": { + "NULL": "NULL" } }, "VLAN_MEMBER": { @@ -37,6 +41,9 @@ }, "Vlan1000|Ethernet40": { "tagging_mode": "untagged" + }, + "Vlan3000|Ethernet44": { + "tagging_mode": "untagged" } }, "DHCP_SERVER_IPV4": { @@ -92,6 +99,13 @@ "mode": "PORT", "netmask": "255.255.255.0", "state": "disabled" + }, + "Vlan6000": { + "gateway": "192.168.2.1", + "lease_time": "900", + "mode": "PORT", + "netmask": "255.255.255.0", + "state": "enabled" } }, "DHCP_SERVER_IPV4_RANGE": { @@ -160,6 +174,11 @@ "ips": [ "192.168.0.10" ] + }, + "Vlan3000|Ethernet44": { + "ips": [ + "192.168.0.10" + ] } }, "PORT": { diff --git a/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py b/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py index c1c2569dbe0a..172f6c2f3bfd 100644 --- a/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py +++ b/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py @@ -303,7 +303,8 @@ def test_parse_vlan(mock_swsscommon_dbconnector_init, mock_parse_port_map_alias, vlan_interfaces, vlan_members = dhcp_cfg_generator._parse_vlan(mock_config_db.config_db.get("VLAN_INTERFACE"), mock_config_db.config_db.get("VLAN_MEMBER")) assert vlan_interfaces == expected_vlan_ipv4_interface - assert list(vlan_members) == ["Vlan1000|Ethernet24", "Vlan1000|Ethernet28", "Vlan1000|Ethernet40"] + expeceted_members = ["Vlan1000|Ethernet24", "Vlan1000|Ethernet28", "Vlan1000|Ethernet40", "Vlan3000|Ethernet44"] + assert list(vlan_members) == expeceted_members @pytest.mark.parametrize("test_config_db", ["mock_config_db.json", "mock_config_db_without_port_config.json"]) @@ -352,11 +353,22 @@ def test_construct_obj_for_template(mock_swsscommon_dbconnector_init, mock_parse customized_options = {"option223": {"id": "223", "value": "dummy_value", "type": "string", "always_send": "true"}} dhcp_cfg_generator = DhcpServCfgGenerator(dhcp_db_connector) tested_hostname = "sonic-host" + port_ips = { + "Vlan1000": { + "192.168.0.1/21": { + "etp8": [["192.168.0.2", "192.168.0.6"], ["192.168.0.10", "192.168.0.10"]], + "etp7": [["192.168.0.7", "192.168.0.7"]], + "etp9": [] + } + }, + "Vlan6000": { + } + } render_obj, enabled_dhcp_interfaces, used_options, subscribe_table = \ dhcp_cfg_generator._construct_obj_for_template(mock_config_db.config_db.get("DHCP_SERVER_IPV4"), - tested_parsed_port, tested_hostname, customized_options) + port_ips, tested_hostname, customized_options) assert render_obj == expected_render_obj - assert enabled_dhcp_interfaces == {"Vlan1000", "Vlan4000", "Vlan3000"} + assert enabled_dhcp_interfaces == {"Vlan1000", "Vlan4000", "Vlan3000", "Vlan6000"} assert used_options == set(["option223"]) assert subscribe_table == set(PORT_MODE_CHECKER) From 66b469249edc5deb0a3066431b13803c8a70fcf9 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Sat, 27 Jan 2024 07:34:22 +0800 Subject: [PATCH 126/419] [Security] Fix the krb5 vulnerability issue (#17914) ### Why I did it Fix the krb5 vulnerable issue CVE-2021-36222 allows remote attackers to cause a NULL pointer dereference and daemon crash CVE-2021-37750 NULL pointer dereference in kdc/do_tgs_req.c via a FAST inner body that lacks a server field DSA 5286-1 remote code execution ##### Work item tracking - Microsoft ADO **(number only)**: 26577929 #### How I did it Upgrade the krb5 version to 1.18.3-6+deb11u14+fips. --- rules/sonic-fips.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rules/sonic-fips.mk b/rules/sonic-fips.mk index ad37f51e1fc8..d44bf627cf5d 100644 --- a/rules/sonic-fips.mk +++ b/rules/sonic-fips.mk @@ -1,13 +1,13 @@ # fips packages -FIPS_VERSION = 0.9 +FIPS_VERSION = 0.10 FIPS_OPENSSL_VERSION = 1.1.1n-0+deb11u5+fips FIPS_OPENSSH_VERSION = 8.4p1-5+deb11u2+fips FIPS_PYTHON_MAIN_VERSION = 3.9 FIPS_PYTHON_VERSION = 3.9.2-1+fips FIPS_GOLANG_MAIN_VERSION = 1.15 FIPS_GOLANG_VERSION = 1.15.15-1~deb11u4+fips -FIPS_KRB5_VERSION = 1.18.3-6+deb11u1+fips +FIPS_KRB5_VERSION = 1.18.3-6+deb11u14+fips FIPS_URL_PREFIX = https://sonicstorage.blob.core.windows.net/public/fips/$(BLDENV)/$(FIPS_VERSION)/$(CONFIGURED_ARCH) SYMCRYPT_OPENSSL_NAME = symcrypt-openssl From 2b08a783f6db63a529e1d9849ea681ecf49dc223 Mon Sep 17 00:00:00 2001 From: Ze Gan Date: Fri, 15 Dec 2023 00:59:16 +0800 Subject: [PATCH 127/419] [Azp]: Add dash-api dependencies on building Azp ubuntu20.04 (#17507) Signed-off-by: Ze Gan --- .azure-pipelines/azure-pipelines-build-ubuntu-2004.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/azure-pipelines-build-ubuntu-2004.yml b/.azure-pipelines/azure-pipelines-build-ubuntu-2004.yml index 1f7f2eb82cc8..478522d73ba2 100644 --- a/.azure-pipelines/azure-pipelines-build-ubuntu-2004.yml +++ b/.azure-pipelines/azure-pipelines-build-ubuntu-2004.yml @@ -38,7 +38,8 @@ stages: cmake pkg-config python3-pip python cmake libgtest-dev libgmock-dev libyang-dev \ debhelper-compat dh-elpa dh-sequence-python3 python3-all \ libpython3-all-dev python3-six xmlto unzip rake-compiler gem2deb pkg-php-tools \ - ant default-jdk maven-repo-helper libguava-java + ant default-jdk maven-repo-helper libguava-java \ + libboost-all-dev libgtest-dev build-essential wget http://ftp.us.debian.org/debian/pool/main/libg/libgoogle-gson-java/libgoogle-gson-java_2.8.6-1+deb11u1_all.deb sudo dpkg -i libgoogle-gson-java_2.8.6-1+deb11u1_all.deb mkdir -p /tmp/artifacts From 36028893a349bcba0eb3fd736a3ee82d15b206a8 Mon Sep 17 00:00:00 2001 From: Liping Xu <108326363+lipxu@users.noreply.github.com> Date: Mon, 29 Jan 2024 15:55:28 +0800 Subject: [PATCH 128/419] handle json load exception in bgpmon (#17856) Why I did it ICM reported due to "BGPMon Process exited" which was caused by json load exception. Work item tracking Microsoft ADO (number only): 25916773 How I did it Add an exception handle during json load. How to verify it Verified locally, add debug log to modify the output string of cmd to make it not with json formation, then check the syslog. --- src/sonic-bgpcfgd/bgpmon/bgpmon.py | 51 +++++++++++++++++++++++------- 1 file changed, 39 insertions(+), 12 deletions(-) diff --git a/src/sonic-bgpcfgd/bgpmon/bgpmon.py b/src/sonic-bgpcfgd/bgpmon/bgpmon.py index f60f1c5eb1b6..26a5b245413e 100755 --- a/src/sonic-bgpcfgd/bgpmon/bgpmon.py +++ b/src/sonic-bgpcfgd/bgpmon/bgpmon.py @@ -49,6 +49,7 @@ def __init__(self): self.db.connect(self.db.STATE_DB, False) self.pipe = swsscommon.RedisPipeline(self.db.get_redis_client(self.db.STATE_DB)) self.db.delete_all_by_pattern(self.db.STATE_DB, "NEIGH_STATE_TABLE|*" ) + self.MAX_RETRY_ATTEMPTS = 3 # A quick way to check if there are anything happening within BGP is to # check its log file has any activities. This is by checking its modified @@ -77,18 +78,44 @@ def update_new_peer_states(self, peer_dict): # Get a new snapshot of BGP neighbors and store them in the "new" location def get_all_neigh_states(self): cmd = ["vtysh", "-c", 'show bgp summary json'] - rc, output = getstatusoutput_noshell(cmd) - if rc: - syslog.syslog(syslog.LOG_ERR, "*ERROR* Failed with rc:{} when execute: {}".format(rc, cmd)) - return - - peer_info = json.loads(output) - # cmd ran successfully, safe to Clean the "new" set/dict for new snapshot - self.new_peer_l.clear() - self.new_peer_state.clear() - for key, value in peer_info.items(): - if key == "ipv4Unicast" or key == "ipv6Unicast": - self.update_new_peer_states(value) + retry_attempt = 0 + + while retry_attempt < self.MAX_RETRY_ATTEMPTS: + try: + rc, output = getstatusoutput_noshell(cmd) + if rc: + syslog.syslog(syslog.LOG_ERR, "*ERROR* Failed with rc:{} when execute: {}".format(rc, cmd)) + return + if len(output) == 0: + syslog.syslog(syslog.LOG_WARNING, "*WARNING* output none when execute: {}".format(cmd)) + return + + peer_info = json.loads(output) + # cmd ran successfully, safe to Clean the "new" set/dict for new snapshot + self.new_peer_l.clear() + self.new_peer_state.clear() + for key, value in peer_info.items(): + if key == "ipv4Unicast" or key == "ipv6Unicast": + self.update_new_peer_states(value) + return + + except json.JSONDecodeError as decode_error: + # Log the exception and retry if within the maximum attempts + retry_attempt += 1 + syslog.syslog(syslog.LOG_WARNING, "*WARNING* JSONDecodeError: {} when execute: {} Retry attempt: {}".format(decode_error, cmd, retry_attempt)) + time.sleep(1) + continue + except Exception as e: + # Log other exceptions and return failure + retry_attempt += 1 + syslog.syslog(syslog.LOG_WARNING, "*WARNING* An unexpected error occurred: {} when execute: {} Retry attempt: {}".format(e, cmd, retry_attempt)) + time.sleep(1) + continue + + # Log an error if the maximum retry attempts are reached + syslog.syslog(syslog.LOG_ERR, "*ERROR* Maximum retry attempts reached. Failed to execute: {} Output: {}".format(cmd, output)) + sys.exit(1) + # This method will take the caller's dictionary which contains the peer state operation # That need to be updated in StateDB using Redis pipeline. From 0aa67d467030d60a607680e0d74240b412101b88 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 3 Feb 2024 10:32:41 +0800 Subject: [PATCH 129/419] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#18011) #### Why I did it src/sonic-utilities ``` * be6224a3 - (HEAD -> 202311, origin/202311) [202311] Migrate GNMI table (#3138) (10 hours ago) [ganglv] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index 9c1d489ca5cd..be6224a3446a 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 9c1d489ca5cd849020610c4a57664c675c64d321 +Subproject commit be6224a3446a6e091c29fb36d87d259205ea1688 From 59c378da1045c1b8859602a6a58d4e2fd7273379 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Mon, 5 Feb 2024 16:32:37 +0800 Subject: [PATCH 130/419] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#18025) #### Why I did it src/sonic-utilities ``` * 2046e66c - (HEAD -> 202311, origin/202311) Reduce generate_dump mem usage for cores (#3052) (3 days ago) [davidm-arista] * fbd6c916 - Disable Key Validation feature during sonic-installation for Cisco Platforms (#3115) (3 days ago) [selvipal] * 88c027f0 - [Techsupport]Adding more FRR and BGP dumps (#3118) (3 days ago) [Sudharsan Dhamal Gopalarathnam] * 555ecf64 - [chassis]: Support show ip bgp summary to display without error when no external neighbors are configured on chassis LC (#3099) (3 days ago) [Arvindsrinivasan Lakshmi Narasimhan] * 1515edcb - [db_migrator]Remove route migration (#3068) (3 days ago) [Sudharsan Dhamal Gopalarathnam] * 8862c114 - Modify teamd retry count script to base BGP status on default BGP status (#3069) (3 days ago) [Saikrishna Arcot] * f4b5ef21 - Add all SKUs to the generic config update list (#3131) (3 days ago) [Stephen Sun] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index be6224a3446a..2046e66cafba 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit be6224a3446a6e091c29fb36d87d259205ea1688 +Subproject commit 2046e66cafba9e4dcade775d781342bb35e683bb From de6ad3fd71ab541147a75dcec05d29b51810088d Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Mon, 5 Feb 2024 16:32:40 +0800 Subject: [PATCH 131/419] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#18024) #### Why I did it src/sonic-swss ``` * 55d53b79 - (HEAD -> 202311, origin/202311) [copporch] Add safeguard during policer attribute update (#2977) (3 days ago) [Vivek] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index be294f390c97..55d53b7989f2 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit be294f390c976dfb18f59bb93eedcf8bdbefe33b +Subproject commit 55d53b7989f216b8e22dc6852d93b972fa7fa56c From ae59ff2ef720bbd3b6261c1d1890cc7c7d5c8a97 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Mon, 5 Feb 2024 16:32:43 +0800 Subject: [PATCH 132/419] [submodule] Update submodule sonic-snmpagent to the latest HEAD automatically (#18023) #### Why I did it src/sonic-snmpagent ``` * 5d5cfe5 - (HEAD -> 202311, origin/202311) Set the execute bit on sysDescr_pass.py (#306) (3 days ago) [Andre Kostur] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-snmpagent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-snmpagent b/src/sonic-snmpagent index 03e8bcddda3b..5d5cfe506ac1 160000 --- a/src/sonic-snmpagent +++ b/src/sonic-snmpagent @@ -1 +1 @@ -Subproject commit 03e8bcddda3b1ba14f753ff931df90090987e12a +Subproject commit 5d5cfe506ac1ccf3af88e80150508d1620d16e9f From dae74cc7de7ca8442ed81d6b2cdc43e032e337ee Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Mon, 5 Feb 2024 16:32:47 +0800 Subject: [PATCH 133/419] [submodule] Update submodule sonic-platform-daemons to the latest HEAD automatically (#18022) #### Why I did it src/sonic-platform-daemons ``` * dbaa079 - (HEAD -> 202311, origin/202311) Support 800G ifname in xcvrd (#416) (2 days ago) [Anoop Kamath] * e4272c1 - 400ZR not linking up with latest SONiC master image (#410) (3 days ago) [mihirpat1] ``` #### How I did it #### How to verify it #### Description for the changelog --- 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 502c0b662200..dbaa0797a908 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit 502c0b6622008363cb1ed6d1b7c85b4093997093 +Subproject commit dbaa0797a90868ace82b8a3476882b7bfb178416 From 36ba782dfa79b9bf96e0e4425eb400ac76548fe2 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Mon, 5 Feb 2024 16:32:50 +0800 Subject: [PATCH 134/419] [submodule] Update submodule sonic-platform-common to the latest HEAD automatically (#18020) #### Why I did it src/sonic-platform-common ``` * 9bf5a17 - (HEAD -> 202311, origin/202311) Implementing set_optoe_write_timeout API (#422) (3 days ago) [mihirpat1] * c8617b8 - APIs to help in finding NPU SI settings (#410) (3 days ago) [mihirpat1] ``` #### How I did it #### How to verify it #### Description for the changelog --- 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 7c2ad665bbb7..9bf5a179035a 160000 --- a/src/sonic-platform-common +++ b/src/sonic-platform-common @@ -1 +1 @@ -Subproject commit 7c2ad665bbb771e85e06056c5c0fb7fc42ab5842 +Subproject commit 9bf5a179035a1bf2b7728330cf0b0503d35bad4c From 01550963001e1f1b7229fd55e427e2941f2f5275 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Mon, 5 Feb 2024 16:32:57 +0800 Subject: [PATCH 135/419] [submodule] Update submodule sonic-host-services to the latest HEAD automatically (#18018) #### Why I did it src/sonic-host-services ``` * 054aa7a - (HEAD -> 202311, origin/202311) Fixed ip6table internal_docker_ip_traffic rule command for multi-asic (#94) (3 days ago) [anamehra] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-host-services | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-host-services b/src/sonic-host-services index 50db9d3a3c75..054aa7a27588 160000 --- a/src/sonic-host-services +++ b/src/sonic-host-services @@ -1 +1 @@ -Subproject commit 50db9d3a3c751321df7c825c9ca9c344ff224ffe +Subproject commit 054aa7a27588043fce1d1e60a0bc35990e950eb6 From 627d9cb3bb47be6047baa9bf8a006a25a885e55b Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Mon, 5 Feb 2024 16:33:00 +0800 Subject: [PATCH 136/419] [submodule] Update submodule linkmgrd to the latest HEAD automatically (#18016) #### Why I did it src/linkmgrd ``` * 70b6d15 - (HEAD -> 202311, origin/202311) [active-standby] Fix `show mux status` inconsistency introduced by orchagent rollback (#225) (3 days ago) [Jing Zhang] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/linkmgrd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linkmgrd b/src/linkmgrd index 74e455e01779..70b6d15fad7f 160000 --- a/src/linkmgrd +++ b/src/linkmgrd @@ -1 +1 @@ -Subproject commit 74e455e01779e7da240c50d97d40de550fc2aa72 +Subproject commit 70b6d15fad7f40d80597791cbc963a59d68c087f From 5352135776f4488c88f922af7d528b31fb563f73 Mon Sep 17 00:00:00 2001 From: Ye Jianquan Date: Tue, 6 Feb 2024 02:07:20 +0800 Subject: [PATCH 137/419] [202311, PR] deprecate DPU (#18035) --- azure-pipelines.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 13008854f072..0a58bc4c0cbc 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -239,18 +239,18 @@ stages: COMMON_EXTRA_PARAMS: "--neighbor_type=sonic " VM_TYPE: vsonic - - job: dpu_elastictest - displayName: "kvmtest-dpu by Elastictest" - timeoutInMinutes: 240 - continueOnError: false - pool: ubuntu-20.04 - steps: - - template: .azure-pipelines/run-test-elastictest-template.yml@sonic-mgmt - parameters: - TOPOLOGY: dpu - MIN_WORKER: $(T0_SONIC_INSTANCE_NUM) - MAX_WORKER: $(T0_SONIC_INSTANCE_NUM) - MGMT_BRANCH: "202311" +# - job: dpu_elastictest +# displayName: "kvmtest-dpu by Elastictest" +# timeoutInMinutes: 240 +# continueOnError: false +# pool: ubuntu-20.04 +# steps: +# - template: .azure-pipelines/run-test-elastictest-template.yml@sonic-mgmt +# parameters: +# TOPOLOGY: dpu +# MIN_WORKER: $(T0_SONIC_INSTANCE_NUM) +# MAX_WORKER: $(T0_SONIC_INSTANCE_NUM) +# MGMT_BRANCH: "202311" # - job: wan_elastictest From 0611bdfb39d25837ed2f6121d0963416af696f43 Mon Sep 17 00:00:00 2001 From: Yaqiang Zhu Date: Wed, 7 Feb 2024 08:31:19 +0800 Subject: [PATCH 138/419] [202311][dhcp_server][yang] Update supported option type to string (#18029) (#18043) --- src/sonic-yang-models/doc/Configuration.md | 2 +- .../tests/files/sample_config_db.json | 2 +- .../tests/dhcp_server_ipv4.json | 4 +-- .../tests_config/dhcp_server_ipv4.json | 26 +++++++++---------- .../yang-models/sonic-dhcp-server-ipv4.yang | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index 64de05a809d0..00465d666b1b 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -1024,7 +1024,7 @@ IPV4 DHPC Server related configuration are defined in **DHCP_SERVER_IPV4**, **DH "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { "option60": { "id": 60, - "type": "text", + "type": "string", "value": "dummy_value" } }, 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 e5ff0b26a8ae..0355d7eb7b0b 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1924,7 +1924,7 @@ "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { "option60": { "id": "60", - "type": "text", + "type": "string", "value": "dummy_value" } }, diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/dhcp_server_ipv4.json b/src/sonic-yang-models/tests/yang_model_tests/tests/dhcp_server_ipv4.json index b3d301150de0..cc70b89372cd 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/dhcp_server_ipv4.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/dhcp_server_ipv4.json @@ -35,8 +35,8 @@ "eStrKey": "InvalidValue", "eStr": ["type"] }, - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_TEXT": { - "desc": "Add text type of DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS." + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_STRING": { + "desc": "Add string type of DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS." }, "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_IPV4_ADDRESS": { "desc": "Add ipv4-address type of DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS." diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/dhcp_server_ipv4.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/dhcp_server_ipv4.json index 3ea58eb67957..3b56a815901d 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/dhcp_server_ipv4.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/dhcp_server_ipv4.json @@ -46,7 +46,7 @@ { "name": "option60", "id": 60, - "type": "text", + "type": "string", "value": "dummy_value" } ] @@ -171,7 +171,7 @@ { "name": "option60", "id": 60, - "type": "text", + "type": "string", "value": "dummy_value" } ] @@ -230,7 +230,7 @@ { "name": "option60", "id": 60, - "type": "text", + "type": "string", "value": "dummy_value" } ] @@ -248,14 +248,14 @@ } } }, - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_TEXT": { + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_STRING": { "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [ { "name": "option60", "id": 60, - "type": "text", + "type": "string", "value": "dummy_value" } ] @@ -325,7 +325,7 @@ { "name": "option60", "id": 60, - "type": "texts", + "type": "text", "value": "dummy_value" } ] @@ -448,7 +448,7 @@ { "name": "option60", "id": 60, - "type": "text", + "type": "string", "value": "dummy_value" } ] @@ -529,7 +529,7 @@ { "name": "option60", "id": 60, - "type": "text", + "type": "string", "value": "dummy_value" } ] @@ -610,7 +610,7 @@ { "name": "option60", "id": 60, - "type": "text", + "type": "string", "value": "dummy_value" } ] @@ -691,7 +691,7 @@ { "name": "option60", "id": 60, - "type": "text", + "type": "string", "value": "dummy_value" } ] @@ -772,7 +772,7 @@ { "name": "option60", "id": 60, - "type": "text", + "type": "string", "value": "dummy_value" } ] @@ -814,7 +814,7 @@ "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [ { "name": "option60", - "type": "text", + "type": "string", "value": "dummy_value" } ] @@ -828,7 +828,7 @@ { "name": "option60", "id": 60, - "type": "text" + "type": "string" } ] } diff --git a/src/sonic-yang-models/yang-models/sonic-dhcp-server-ipv4.yang b/src/sonic-yang-models/yang-models/sonic-dhcp-server-ipv4.yang index 065366639d87..3f868028a964 100644 --- a/src/sonic-yang-models/yang-models/sonic-dhcp-server-ipv4.yang +++ b/src/sonic-yang-models/yang-models/sonic-dhcp-server-ipv4.yang @@ -130,7 +130,7 @@ module sonic-dhcp-server-ipv4 { leaf type { description "Type of customized option, for standard DHCP option, this field is invalid"; type enumeration { - enum text; + enum string; enum ipv4-address; enum uint8; enum uint16; From e13ef9d9b216d9b26ccd383df8950b3527644746 Mon Sep 17 00:00:00 2001 From: Volodymyr Samotiy Date: Wed, 7 Feb 2024 02:31:50 +0200 Subject: [PATCH 139/419] [202311] [Mellanox] Disable SSD NCQ on Mellanox platforms (#18040) Signed-off-by: Volodymyr Samotiy --- device/mellanox/x86_64-mlnx_msn2010-r0/installer.conf | 2 +- device/mellanox/x86_64-mlnx_msn2700-r0/installer.conf | 2 +- device/mellanox/x86_64-mlnx_msn2700a1-r0/installer.conf | 2 +- device/mellanox/x86_64-mlnx_msn3420-r0/installer.conf | 1 + device/mellanox/x86_64-mlnx_msn3700-r0/installer.conf | 1 + device/mellanox/x86_64-mlnx_msn3700c-r0/installer.conf | 1 + device/mellanox/x86_64-mlnx_msn3800-r0/installer.conf | 1 + device/mellanox/x86_64-mlnx_msn4410-r0/installer.conf | 1 + device/mellanox/x86_64-mlnx_msn4600-r0/installer.conf | 1 + device/mellanox/x86_64-mlnx_msn4600c-r0/installer.conf | 1 + device/mellanox/x86_64-mlnx_msn4700-r0/installer.conf | 1 + device/mellanox/x86_64-nvidia_sn2201-r0/installer.conf | 2 +- device/mellanox/x86_64-nvidia_sn4800-r0/installer.conf | 1 + device/mellanox/x86_64-nvidia_sn5600-r0/installer.conf | 1 + 14 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 device/mellanox/x86_64-mlnx_msn3420-r0/installer.conf create mode 100644 device/mellanox/x86_64-mlnx_msn3700-r0/installer.conf create mode 100644 device/mellanox/x86_64-mlnx_msn3700c-r0/installer.conf create mode 100644 device/mellanox/x86_64-mlnx_msn3800-r0/installer.conf create mode 100644 device/mellanox/x86_64-mlnx_msn4410-r0/installer.conf create mode 100644 device/mellanox/x86_64-mlnx_msn4600-r0/installer.conf create mode 100644 device/mellanox/x86_64-mlnx_msn4600c-r0/installer.conf create mode 100644 device/mellanox/x86_64-mlnx_msn4700-r0/installer.conf create mode 100644 device/mellanox/x86_64-nvidia_sn4800-r0/installer.conf create mode 100644 device/mellanox/x86_64-nvidia_sn5600-r0/installer.conf diff --git a/device/mellanox/x86_64-mlnx_msn2010-r0/installer.conf b/device/mellanox/x86_64-mlnx_msn2010-r0/installer.conf index c9c9493a5404..1aba51906edf 100644 --- a/device/mellanox/x86_64-mlnx_msn2010-r0/installer.conf +++ b/device/mellanox/x86_64-mlnx_msn2010-r0/installer.conf @@ -1 +1 @@ -ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="acpi_enforce_resources=lax acpi=noirq" +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="acpi_enforce_resources=lax acpi=noirq libata.force=noncq" diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/installer.conf b/device/mellanox/x86_64-mlnx_msn2700-r0/installer.conf index c9c9493a5404..1aba51906edf 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/installer.conf +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/installer.conf @@ -1 +1 @@ -ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="acpi_enforce_resources=lax acpi=noirq" +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="acpi_enforce_resources=lax acpi=noirq libata.force=noncq" diff --git a/device/mellanox/x86_64-mlnx_msn2700a1-r0/installer.conf b/device/mellanox/x86_64-mlnx_msn2700a1-r0/installer.conf index 580aa1fe4c8c..3f527393e156 100644 --- a/device/mellanox/x86_64-mlnx_msn2700a1-r0/installer.conf +++ b/device/mellanox/x86_64-mlnx_msn2700a1-r0/installer.conf @@ -1 +1 @@ -ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="logs_inram=on" \ No newline at end of file +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="logs_inram=on libata.force=noncq" diff --git a/device/mellanox/x86_64-mlnx_msn3420-r0/installer.conf b/device/mellanox/x86_64-mlnx_msn3420-r0/installer.conf new file mode 100644 index 000000000000..c46f0eb7a459 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3420-r0/installer.conf @@ -0,0 +1 @@ +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="libata.force=noncq" diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/installer.conf b/device/mellanox/x86_64-mlnx_msn3700-r0/installer.conf new file mode 100644 index 000000000000..c46f0eb7a459 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/installer.conf @@ -0,0 +1 @@ +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="libata.force=noncq" diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/installer.conf b/device/mellanox/x86_64-mlnx_msn3700c-r0/installer.conf new file mode 100644 index 000000000000..c46f0eb7a459 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/installer.conf @@ -0,0 +1 @@ +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="libata.force=noncq" diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/installer.conf b/device/mellanox/x86_64-mlnx_msn3800-r0/installer.conf new file mode 100644 index 000000000000..c46f0eb7a459 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/installer.conf @@ -0,0 +1 @@ +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="libata.force=noncq" diff --git a/device/mellanox/x86_64-mlnx_msn4410-r0/installer.conf b/device/mellanox/x86_64-mlnx_msn4410-r0/installer.conf new file mode 100644 index 000000000000..c46f0eb7a459 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4410-r0/installer.conf @@ -0,0 +1 @@ +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="libata.force=noncq" diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/installer.conf b/device/mellanox/x86_64-mlnx_msn4600-r0/installer.conf new file mode 100644 index 000000000000..c46f0eb7a459 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/installer.conf @@ -0,0 +1 @@ +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="libata.force=noncq" diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/installer.conf b/device/mellanox/x86_64-mlnx_msn4600c-r0/installer.conf new file mode 100644 index 000000000000..c46f0eb7a459 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/installer.conf @@ -0,0 +1 @@ +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="libata.force=noncq" diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/installer.conf b/device/mellanox/x86_64-mlnx_msn4700-r0/installer.conf new file mode 100644 index 000000000000..c46f0eb7a459 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/installer.conf @@ -0,0 +1 @@ +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="libata.force=noncq" diff --git a/device/mellanox/x86_64-nvidia_sn2201-r0/installer.conf b/device/mellanox/x86_64-nvidia_sn2201-r0/installer.conf index 8fcb08aba3b8..c1376afcd13f 100644 --- a/device/mellanox/x86_64-nvidia_sn2201-r0/installer.conf +++ b/device/mellanox/x86_64-nvidia_sn2201-r0/installer.conf @@ -1 +1 @@ -ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="acpi_enforce_resources=lax" +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="acpi_enforce_resources=lax libata.force=noncq" diff --git a/device/mellanox/x86_64-nvidia_sn4800-r0/installer.conf b/device/mellanox/x86_64-nvidia_sn4800-r0/installer.conf new file mode 100644 index 000000000000..c46f0eb7a459 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn4800-r0/installer.conf @@ -0,0 +1 @@ +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="libata.force=noncq" diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/installer.conf b/device/mellanox/x86_64-nvidia_sn5600-r0/installer.conf new file mode 100644 index 000000000000..c46f0eb7a459 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/installer.conf @@ -0,0 +1 @@ +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="libata.force=noncq" From 05ae1fa2850e4ba1fc8481795b8995c503da9dbc Mon Sep 17 00:00:00 2001 From: zitingguo-ms Date: Wed, 7 Feb 2024 15:11:58 +0800 Subject: [PATCH 140/419] upgrade xgs SAI version to 10.1.6.0 (#18055) Signed-off-by: zitingguo-ms --- platform/broadcom/sai.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/broadcom/sai.mk b/platform/broadcom/sai.mk index eea4f47a4c83..f419d8b1bbd8 100644 --- a/platform/broadcom/sai.mk +++ b/platform/broadcom/sai.mk @@ -1,4 +1,4 @@ -LIBSAIBCM_XGS_VERSION = 10.1.0.0 +LIBSAIBCM_XGS_VERSION = 10.1.6.0 LIBSAIBCM_DNX_VERSION = 7.1.111.1 LIBSAIBCM_XGS_BRANCH_NAME = SAI_10.1.0_GA LIBSAIBCM_DNX_BRANCH_NAME = REL_7.0_SAI_1.11 From a7af5b4a112b26e8f76315f0193401246d6e695f Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 7 Feb 2024 15:58:46 +0800 Subject: [PATCH 141/419] fix the compile issue for slim image (#18015) (#18057) Why I did it The PR introduced a bug for slim image build, #17905, by which the sonic_asic_platform is missing when build docker image for slim image. [ building ] [ target/docker-dhcp-relay.gz ] /sonic/dockers/docker-dhcp-relay/cli-plugin-tests /sonic /sonic Traceback (most recent call last): File "/usr/local/bin/j2", line 8, in sys.exit(main()) File "/usr/local/lib/python3.9/dist-packages/j2cli/cli.py", line 202, in main output = render_command( File "/usr/local/lib/python3.9/dist-packages/j2cli/cli.py", line 186, in render_command result = renderer.render(args.template, context) File "/usr/local/lib/python3.9/dist-packages/j2cli/cli.py", line 85, in render return self._env \ File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 1090, in render self.environment.handle_exception() File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 832, in handle_exception reraise(*rewrite_traceback_stack(source=source)) File "/usr/lib/python3/dist-packages/jinja2/_compat.py", line 28, in reraise raise value.with_traceback(tb) File "/sonic/dockers/docker-dhcp-relay/Dockerfile.j2", line 48, in top-level template code {% if build_reduce_image_size != "y" or sonic_asic_platform != "broadcom" %} jinja2.exceptions.UndefinedError: 'sonic_asic_platform' is undefined make: *** [slave.mk:1072: target/docker-dhcp-relay.gz] Error 1 make: *** Waiting for unfinished jobs.... [ finished ] [ target/docker-swss-layer-bullseye.gz ] [ finished ] [ target/docker-syncd-brcm-dnx.gz ] make[1]: *** [Makefile.work:608: target/sonic-broadcom.bin] Error 2 make[1]: Leaving directory '/data/work/1/s' make: *** [Makefile:41: target/sonic-broadcom.bin] Error 2 And why it slipped the PR test? PR test doesn't compile with slim option, it won't check sonic_asic_platform != "broadcom" for PR build. Work item tracking Microsoft ADO (number only): How I did it Export sonic_asic_platform for docker build in slave.mk How to verify it build with slim image option. Co-authored-by: StormLiangMS <89824293+StormLiangMS@users.noreply.github.com> --- slave.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/slave.mk b/slave.mk index aa3abebabf8b..dbd9d109b84f 100644 --- a/slave.mk +++ b/slave.mk @@ -1105,6 +1105,7 @@ $(addprefix $(TARGET_PATH)/, $(DOCKER_IMAGES)) : $(TARGET_PATH)/%.gz : .platform # Export variables for j2. Use path for unique variable names, e.g. docker_orchagent_debs export include_system_eventd="$(INCLUDE_SYSTEM_EVENTD)" export build_reduce_image_size="$(BUILD_REDUCE_IMAGE_SIZE)" + export sonic_asic_platform="$(patsubst %-$(CONFIGURED_ARCH),%,$(CONFIGURED_PLATFORM))" $(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_debs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_DEPENDS),RDEPENDS))\n" | awk '!a[$$0]++')) $(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_pydebs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_PYTHON_DEBS)))\n" | awk '!a[$$0]++')) $(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_whls=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_PYTHON_WHEELS)))\n" | awk '!a[$$0]++')) From d8149a1435f488a930a101145f92cab7d2346c57 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 7 Feb 2024 18:32:27 +0800 Subject: [PATCH 142/419] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#18059) #### Why I did it src/sonic-utilities ``` * 31a6584c - (HEAD -> 202311, origin/202311) Fix `sudo config load_mgmt_config` fails with error "File /var/run/dhclient.eth0.pid does not exist" (#3149) (16 hours ago) [Mai Bui] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index 2046e66cafba..31a6584cc250 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 2046e66cafba9e4dcade775d781342bb35e683bb +Subproject commit 31a6584cc250552cc2f4166ee828de1f88623830 From f4b1eb0a5ba1abecb62b9442587b57134657eb46 Mon Sep 17 00:00:00 2001 From: Hua Liu <58683130+liuh-80@users.noreply.github.com> Date: Wed, 7 Feb 2024 22:50:57 +0800 Subject: [PATCH 143/419] Fix IPV6 forced-mgmt-route not work issue (#17299) (#18045) Fix IPV6 forced-mgmt-route not work issue Why I did it IPV6 forced-mgmt-route not work When add a IPV6 route, should use 'ip -6 rule add pref 32764 address' command, but currently in the template the '-6' parameter are missing, so the IPV6 route been add to IPV4 route table. Also this PR depends on #17281 , which will fix the IPV6 'default' route table missing in IPV6 route lookup issue. Microsoft ADO (number only):24719238 --- files/image_config/interfaces/interfaces.j2 | 4 +-- src/sonic-config-engine/minigraph.py | 30 +++++++++++++++++-- .../tests/sample_output/py2/mvrf_interfaces | 10 ++++--- .../tests/sample_output/py3/mvrf_interfaces | 10 ++++--- .../tests/t0-sample-graph-mvrf.xml | 2 +- 5 files changed, 43 insertions(+), 13 deletions(-) diff --git a/files/image_config/interfaces/interfaces.j2 b/files/image_config/interfaces/interfaces.j2 index 3702eb1f6798..a75b617f1ec5 100644 --- a/files/image_config/interfaces/interfaces.j2 +++ b/files/image_config/interfaces/interfaces.j2 @@ -86,7 +86,7 @@ iface {{ name }} {{ 'inet' if prefix | ipv4 else 'inet6' }} static up ip {{ '-4' if prefix | ipv4 else '-6' }} route add {{ prefix | network }}/{{ prefix | prefixlen }} dev {{ name }} table {{ vrf_table }} up ip {{ '-4' if prefix | ipv4 else '-6' }} rule add pref {{ force_mgmt_route_priority + 1 }} from {{ prefix | ip }}/{{ '32' if prefix | ipv4 else '128' }} table {{ vrf_table }} {% for route in MGMT_INTERFACE[(name, prefix)]['forced_mgmt_routes'] %} - up ip rule add pref {{ force_mgmt_route_priority }} to {{ route }} table {{ vrf_table }} + up ip {{ '-4' if prefix | ipv4 else '-6' }} rule add pref {{ force_mgmt_route_priority }} to {{ route }} table {{ vrf_table }} {% endfor %} {% if prefix | ipv6 and vrf_table == 'default'%} # IPV6 default table not add to lookup by default, management server need this to access IPV6 address when BGP shutdown @@ -97,7 +97,7 @@ iface {{ name }} {{ 'inet' if prefix | ipv4 else 'inet6' }} static pre-down ip {{ '-4' if prefix | ipv4 else '-6' }} route delete {{ prefix | network }}/{{ prefix | prefixlen }} dev {{ name }} table {{ vrf_table }} pre-down ip {{ '-4' if prefix | ipv4 else '-6' }} rule delete pref {{ force_mgmt_route_priority + 1 }} from {{ prefix | ip }}/{{ '32' if prefix | ipv4 else '128' }} table {{ vrf_table }} {% for route in MGMT_INTERFACE[(name, prefix)]['forced_mgmt_routes'] %} - pre-down ip rule delete pref {{ force_mgmt_route_priority }} to {{ route }} table {{ vrf_table }} + pre-down ip {{ '-4' if route | ipv4 else '-6' }} rule delete pref {{ force_mgmt_route_priority }} to {{ route }} table {{ vrf_table }} {% endfor %} {% if prefix | ipv6 and vrf_table == 'default'%} pre-down ip -6 rule delete pref {{ force_mgmt_route_priority + 3 }} lookup {{ vrf_table }} diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index 393b515c0559..54d27ad06587 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -1459,6 +1459,33 @@ def select_mmu_profiles(profile, platform, hwsku): base_file = os.path.join(path, file_item) exec_cmd(["sudo", "cp", file_in_dir, base_file]) +def address_type(address): + # encode and decode to unicode, because when address is bytes type, ip_network will throw AddressValueError + # set strict to False because address may set host bit, for example 192.168.0.1/24 + return type(ipaddress.ip_network(UNICODE_TYPE(address), False)) + +def update_forced_mgmt_route(mgmt_intf, mgmt_routes): + for mgmt_intf_key in mgmt_intf.keys(): + forced_mgmt_routes = [] + + try: + # get mgmt interface type + mgmt_intf_addr = mgmt_intf_key[1] + mgmt_iftype = address_type(mgmt_intf_addr) + + # add mgmt route to different mgmt interface by address type + for mgmt_route in mgmt_routes: + route_iftype = address_type(mgmt_route) + if mgmt_iftype == route_iftype: + forced_mgmt_routes.append(mgmt_route) + except ValueError as e: + print("Warning: invalid management routes in minigraph, exception: {}".format(e), file=sys.stderr) + continue + + # forced_mgmt_routes yang model not support empty list + if len(forced_mgmt_routes) > 0: + mgmt_intf[mgmt_intf_key]['forced_mgmt_routes'] = forced_mgmt_routes + ############################################################################### # # Main functions @@ -1700,8 +1727,7 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw results['BGP_VOQ_CHASSIS_NEIGHBOR'] = bgp_voq_chassis_sessions results['BGP_SENTINELS'] = bgp_sentinel_sessions if mgmt_routes: - # TODO: differentiate v4 and v6 - next(iter(mgmt_intf.values()))['forced_mgmt_routes'] = mgmt_routes + update_forced_mgmt_route(mgmt_intf, mgmt_routes) results['MGMT_PORT'] = {} results['MGMT_INTERFACE'] = {} mgmt_intf_count = 0 diff --git a/src/sonic-config-engine/tests/sample_output/py2/mvrf_interfaces b/src/sonic-config-engine/tests/sample_output/py2/mvrf_interfaces index 1c33cfe819c6..518fbb0389a1 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/mvrf_interfaces +++ b/src/sonic-config-engine/tests/sample_output/py2/mvrf_interfaces @@ -34,14 +34,14 @@ iface eth0 inet static up ip -4 route add default via 10.0.0.1 dev eth0 table 5000 metric 201 up ip -4 route add 10.0.0.0/24 dev eth0 table 5000 up ip -4 rule add pref 32765 from 10.0.0.100/32 table 5000 - up ip rule add pref 32764 to 11.11.11.11 table 5000 - up ip rule add pref 32764 to 22.22.22.0/23 table 5000 + up ip -4 rule add pref 32764 to 11.11.11.11 table 5000 + up ip -4 rule add pref 32764 to 22.22.22.0/23 table 5000 # management port down rules pre-down ip -4 route delete default via 10.0.0.1 dev eth0 table 5000 pre-down ip -4 route delete 10.0.0.0/24 dev eth0 table 5000 pre-down ip -4 rule delete pref 32765 from 10.0.0.100/32 table 5000 - pre-down ip rule delete pref 32764 to 11.11.11.11 table 5000 - pre-down ip rule delete pref 32764 to 22.22.22.0/23 table 5000 + pre-down ip -4 rule delete pref 32764 to 11.11.11.11 table 5000 + pre-down ip -4 rule delete pref 32764 to 22.22.22.0/23 table 5000 iface eth0 inet6 static address 2603:10e2:0:2902::8 netmask 64 @@ -53,10 +53,12 @@ iface eth0 inet6 static up ip -6 route add default via 2603:10e2:0:2902::1 dev eth0 table 5000 metric 201 up ip -6 route add 2603:10e2:0:2902::/64 dev eth0 table 5000 up ip -6 rule add pref 32765 from 2603:10e2:0:2902::8/128 table 5000 + up ip -6 rule add pref 32764 to 33:33:33::0/64 table 5000 # management port down rules pre-down ip -6 route delete default via 2603:10e2:0:2902::1 dev eth0 table 5000 pre-down ip -6 route delete 2603:10e2:0:2902::/64 dev eth0 table 5000 pre-down ip -6 rule delete pref 32765 from 2603:10e2:0:2902::8/128 table 5000 + pre-down ip -6 rule delete pref 32764 to 33:33:33::0/64 table 5000 # source /etc/network/interfaces.d/* # diff --git a/src/sonic-config-engine/tests/sample_output/py3/mvrf_interfaces b/src/sonic-config-engine/tests/sample_output/py3/mvrf_interfaces index 1c33cfe819c6..518fbb0389a1 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/mvrf_interfaces +++ b/src/sonic-config-engine/tests/sample_output/py3/mvrf_interfaces @@ -34,14 +34,14 @@ iface eth0 inet static up ip -4 route add default via 10.0.0.1 dev eth0 table 5000 metric 201 up ip -4 route add 10.0.0.0/24 dev eth0 table 5000 up ip -4 rule add pref 32765 from 10.0.0.100/32 table 5000 - up ip rule add pref 32764 to 11.11.11.11 table 5000 - up ip rule add pref 32764 to 22.22.22.0/23 table 5000 + up ip -4 rule add pref 32764 to 11.11.11.11 table 5000 + up ip -4 rule add pref 32764 to 22.22.22.0/23 table 5000 # management port down rules pre-down ip -4 route delete default via 10.0.0.1 dev eth0 table 5000 pre-down ip -4 route delete 10.0.0.0/24 dev eth0 table 5000 pre-down ip -4 rule delete pref 32765 from 10.0.0.100/32 table 5000 - pre-down ip rule delete pref 32764 to 11.11.11.11 table 5000 - pre-down ip rule delete pref 32764 to 22.22.22.0/23 table 5000 + pre-down ip -4 rule delete pref 32764 to 11.11.11.11 table 5000 + pre-down ip -4 rule delete pref 32764 to 22.22.22.0/23 table 5000 iface eth0 inet6 static address 2603:10e2:0:2902::8 netmask 64 @@ -53,10 +53,12 @@ iface eth0 inet6 static up ip -6 route add default via 2603:10e2:0:2902::1 dev eth0 table 5000 metric 201 up ip -6 route add 2603:10e2:0:2902::/64 dev eth0 table 5000 up ip -6 rule add pref 32765 from 2603:10e2:0:2902::8/128 table 5000 + up ip -6 rule add pref 32764 to 33:33:33::0/64 table 5000 # management port down rules pre-down ip -6 route delete default via 2603:10e2:0:2902::1 dev eth0 table 5000 pre-down ip -6 route delete 2603:10e2:0:2902::/64 dev eth0 table 5000 pre-down ip -6 rule delete pref 32765 from 2603:10e2:0:2902::8/128 table 5000 + pre-down ip -6 rule delete pref 32764 to 33:33:33::0/64 table 5000 # source /etc/network/interfaces.d/* # diff --git a/src/sonic-config-engine/tests/t0-sample-graph-mvrf.xml b/src/sonic-config-engine/tests/t0-sample-graph-mvrf.xml index 3fd73f7369fe..996720ba2d7f 100644 --- a/src/sonic-config-engine/tests/t0-sample-graph-mvrf.xml +++ b/src/sonic-config-engine/tests/t0-sample-graph-mvrf.xml @@ -787,7 +787,7 @@ ForcedMgmtRoutes - 11.11.11.11;22.22.22.0/23 + 11.11.11.11;22.22.22.0/23;33:33:33::0/64 ErspanDestinationIpv4 From a7daae67e33b3ceb1295c00ab96669114afe75a2 Mon Sep 17 00:00:00 2001 From: snider-nokia <76123698+snider-nokia@users.noreply.github.com> Date: Thu, 8 Feb 2024 16:03:05 -0500 Subject: [PATCH 144/419] [Nokia-IXR7250E][Devicedata] Update the device data for Nokia IXR7250E platform (thermal logging thresholds) (#18063) These changes adjust Nokia IXR7250 thermal sensor logging thresholds. Why I did it To modify the thermal sensor logging thresholds used on LC and Supervisor. How I did it Modified the JSON based thermal logging thresholds used to determine when to log current high sensor temperature and hottest sensor margin fluctuations. How to verify it Verify that syslog messages indicating current (high) temperature and margin values are only logged when these respective values fluctuate by at least 5 degrees. --- .../nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform_ndk.json | 4 ++-- device/nokia/x86_64-nokia_ixr7250e_sup-r0/platform_ndk.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform_ndk.json b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform_ndk.json index f444a14a843c..57bc959d7104 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform_ndk.json +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform_ndk.json @@ -50,11 +50,11 @@ }, { "key": "thermal_log_current_threshold", - "intval": 2 + "intval": 5 }, { "key": "thermal_log_margin_threshold", - "intval": 2 + "intval": 5 }, { "key": "thermal_log_min_threshold", diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/platform_ndk.json b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/platform_ndk.json index 9d68aacc59cd..bf7f1ed57427 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/platform_ndk.json +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/platform_ndk.json @@ -38,11 +38,11 @@ }, { "key": "thermal_log_current_threshold", - "intval": 3 + "intval": 5 }, { "key": "thermal_log_margin_threshold", - "intval": 3 + "intval": 5 }, { "key": "thermal_log_min_threshold", From fb3f6832825217e3ab9a3ef6ab33615862a260e9 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 15 Feb 2024 16:33:00 +0800 Subject: [PATCH 145/419] [submodule] Update submodule sonic-sairedis to the latest HEAD automatically (#18083) #### Why I did it src/sonic-sairedis ``` * 23481f0 - (HEAD -> 202311, origin/202311) Skip FABRIC PORT Attributes from sairedis logging (#1339) (2 days ago) [saksarav-nokia] * 682e860 - Revert "add if statement for module control mode support" (#1341) (4 days ago) [dbarashinvd] * 3621a18 - SAI submodule update to pick the sai-thrift support added to read VOQ counters (#1332) (4 days ago) [saksarav-nokia] * 52cd15b - Fix code coverage and ASAN not being enabled (#1338) (5 days ago) [Saikrishna Arcot] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-sairedis | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-sairedis b/src/sonic-sairedis index 962131601d5d..23481f0d8d8d 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit 962131601d5d99d1cb85eee636c2f1d01802e6d1 +Subproject commit 23481f0d8d8d8f07f333d605010faaeb8920b836 From 8cd9463de0aac90f728ba286e63c1b1535fd6c37 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 15 Feb 2024 16:33:04 +0800 Subject: [PATCH 146/419] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#18081) #### Why I did it src/sonic-utilities ``` * b2125761 - (HEAD -> 202311, origin/202311) [chassis] fix show bgp summary when no neighbors are present on one ASIC (#3158) (2 days ago) [Arvindsrinivasan Lakshmi Narasimhan] * 54595c1e - [202311]Fix the sfputil treats page number as decimal instead of hexadecimal (#3153) (#3160) (5 days ago) [Sudharsan Dhamal Gopalarathnam] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index 31a6584cc250..b21257617755 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 31a6584cc250552cc2f4166ee828de1f88623830 +Subproject commit b21257617755c5d9af061f9d60d131d012de82e6 From 71014b28e7641814cd2c9b7b1196d821007b561a Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 15 Feb 2024 16:33:13 +0800 Subject: [PATCH 147/419] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#18075) #### Why I did it src/sonic-swss ``` * 2910b0e3 - (HEAD -> 202311, origin/202311) Fix the Orchagent crash seen during Port channel OC test cases. (#3042) (7 days ago) [saksarav-nokia] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 55d53b7989f2..2910b0e3b484 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 55d53b7989f216b8e22dc6852d93b972fa7fa56c +Subproject commit 2910b0e3b484fe97bad22554a38b0ad378fef3dd From dcc5a162ecb4b19c9fc2017893b01fd600dcb850 Mon Sep 17 00:00:00 2001 From: dbarashinvd <105214075+dbarashinvd@users.noreply.github.com> Date: Thu, 8 Feb 2024 14:49:56 +0200 Subject: [PATCH 148/419] [Mellanox] fix code for warm reboot to work with FW controlled ports (#18065) - Why I did it Fix the code to work also after warm reboot to work with FW controlled ports. In warm reboot the control state sysfs of each port does not change unlike reboot or fast boot. - How I did it 1. Check procfs cmdline if warm reboot done this is due to the fact pmon don't recognize warm reboot when it's taking place since pmon is loaded after warm reboot is finished. 2. If warm reboot done, check in static detection part for each port if it's FW controlled. If so, leave it this way and stop the state machine flow (set it to final state). - How to verify it 1. Boot a switch with CMIS host management with at least one FW controlled port (non active cables or non cmis cables) then run warm reboot. 2. Verify no errors of sysfs reading appears for control sysfs --- .../sonic_platform/modules_mgmt.py | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/modules_mgmt.py b/platform/mellanox/mlnx-platform-api/sonic_platform/modules_mgmt.py index f69d00772e68..6727e1a6d64e 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/modules_mgmt.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/modules_mgmt.py @@ -66,9 +66,13 @@ SYSFS_INDEPENDENT_FD_FREQ = os.path.join(SYSFS_INDEPENDENT_FD_PREFIX, "frequency") SYSFS_INDEPENDENT_FD_FREQ_SUPPORT = os.path.join(SYSFS_INDEPENDENT_FD_PREFIX, "frequency_support") IS_INDEPENDENT_MODULE = 'is_independent_module' +PROC_CMDLINE = "/proc/cmdline" +CMDLINE_STR_TO_LOOK_FOR = 'SONIC_BOOT_TYPE=' +CMDLINE_VAL_TO_LOOK_FOR = 'fastfast' MAX_EEPROM_ERROR_RESET_RETRIES = 4 + class ModulesMgmtTask(threading.Thread): def __init__(self, namespaces=None, main_thread_stop_event=None, q=None): @@ -93,6 +97,8 @@ def __init__(self, namespaces=None, main_thread_stop_event=None, q=None): self.delete_ports_and_reset_states_dict = {} self.setName("ModulesMgmtTask") self.register_hw_present_fds = [] + self.is_warm_reboot = False + self.port_control_dict = {} # SFPs state machine def get_sm_func(self, sm, port): @@ -146,13 +152,35 @@ def run(self): num_of_ports = DeviceDataManager.get_sfp_count() # create the modules sysfs fds poller self.poll_obj = select.poll() + # read cmdline to check if warm reboot done. cannot use swsscommon warmstart since this code runs after + # warm-reboot is finished. if done, need to read control sysfs per port and act accordingly since modules are + # not reset in warm-reboot + cmdline_dict = {} + proc_cmdline_str = utils.read_str_from_file(PROC_CMDLINE) + if CMDLINE_STR_TO_LOOK_FOR in proc_cmdline_str: + cmdline_dict[CMDLINE_STR_TO_LOOK_FOR] = proc_cmdline_str.split(CMDLINE_STR_TO_LOOK_FOR)[1] + if CMDLINE_STR_TO_LOOK_FOR in cmdline_dict.keys(): + self.is_warm_reboot = cmdline_dict[CMDLINE_STR_TO_LOOK_FOR] == CMDLINE_VAL_TO_LOOK_FOR + logger.log_info(f"system was warm rebooted is_warm_reboot: {self.is_warm_reboot}") for port in range(num_of_ports): # check sysfs per port whether it's independent mode or legacy temp_module_sm = ModuleStateMachine(port_num=port, initial_state=STATE_HW_NOT_PRESENT , current_state=STATE_HW_NOT_PRESENT) module_fd_indep_path = SYSFS_INDEPENDENT_FD_PRESENCE.format(port) logger.log_info("system in indep mode: {} port {}".format(self.is_supported_indep_mods_system, port)) - if self.is_supported_indep_mods_system and os.path.isfile(module_fd_indep_path): + if self.is_warm_reboot: + logger.log_info("system was warm rebooted is_warm_reboot: {} trying to read control sysfs for port {}" + .format(self.is_warm_reboot, port)) + port_control_file = SYSFS_INDEPENDENT_FD_FW_CONTROL.format(port) + try: + port_control = utils.read_int_from_file(port_control_file, raise_exception=True) + self.port_control_dict[port] = port_control + logger.log_info(f"port control sysfs is {port_control} for port {port}") + except Exception as e: + logger.log_error("exception {} for port {} trying to read port control sysfs {}" + .format(e, port, port_control_file)) + if (self.is_supported_indep_mods_system and os.path.isfile(module_fd_indep_path)) \ + and not (self.is_warm_reboot and 0 == port_control): logger.log_info("system in indep mode: {} port {} reading file {}".format(self.is_supported_indep_mods_system, port, module_fd_indep_path)) temp_module_sm.set_is_indep_modules(True) temp_module_sm.set_module_fd_path(module_fd_indep_path) @@ -383,7 +411,7 @@ def check_if_hw_present(self, port, module_sm_obj, dynamic=False): elif 1 == val_int: logger.log_info("returning {} for val {}".format(STATE_HW_PRESENT, val_int)) retval_state = STATE_HW_PRESENT - if not self.is_supported_indep_mods_system: + if not self.is_supported_indep_mods_system or (self.is_warm_reboot and 0 == self.port_control_dict[port] and not dynamic): module_sm_obj.set_final_state(retval_state, detection_method) self.register_fd_for_polling(module_sm_obj, module_sm_obj.module_fd, 'presence') return retval_state From e54c5b4b98eea565bed92d24a466fc64056b10fb Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 16 Feb 2024 16:33:06 +0800 Subject: [PATCH 149/419] [submodule] Update submodule sonic-platform-daemons to the latest HEAD automatically (#18103) #### Why I did it src/sonic-platform-daemons ``` * 121b338 - (HEAD -> 202311, origin/202311) Unable to retrieve media settings with just Vendor name (#419) (10 hours ago) [mihirpat1] ``` #### How I did it #### How to verify it #### Description for the changelog --- 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 dbaa0797a908..121b3381a89d 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit dbaa0797a90868ace82b8a3476882b7bfb178416 +Subproject commit 121b3381a89dc11045ad6654937dcc2c42865f6a From b967cf0b999b9cca114e0f7d854d4880d1abe0c6 Mon Sep 17 00:00:00 2001 From: dbarashinvd <105214075+dbarashinvd@users.noreply.github.com> Date: Mon, 5 Feb 2024 19:39:55 +0200 Subject: [PATCH 150/419] [Mellanox] fix sysfs reading that gets garbage end of line using strip (#17830) - Why I did it when reading sysfs fd upon python poller events, there's end of line garbage like "# 012" (without space between the 2 parts) trailing the real value of 1 or 0 - How I did it using python strip() to remove end of line - How to verify it run the CMIS host management feature on a switch wait few minutes until switch completes boot up sequence including CMIS host manager then disconnect or reconnect a port to create a poller event --- .../mlnx-platform-api/sonic_platform/modules_mgmt.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/modules_mgmt.py b/platform/mellanox/mlnx-platform-api/sonic_platform/modules_mgmt.py index 6727e1a6d64e..ddc5ac599e03 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/modules_mgmt.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/modules_mgmt.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2023-2024 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -308,13 +308,10 @@ def run(self): self.fds_events_count_dict[module_obj.port_num][fd_name] += 1 try: module_fd.seek(0) - val = module_fd.read() + val = module_fd.read().strip() logger.log_info("dynamic detection got module_obj {} with port {} from fd number {} path {} val {} count {}" .format(module_obj, module_obj.port_num, fd, module_fd_path , val, self.fds_events_count_dict[module_obj.port_num])) - # workaround for garbage received after the 0 or 1 value of sysfs i.e. 0#012 or 1#012 - if len(val) > 1: - val = val[0] if self.is_dummy_event(int(val), module_obj): logger.log_info(f"dynamic detection dummy event port {module_obj.port_num} from fd number {fd}") continue From 491cf9a3f878ec72108c1f34cc16b8c97129284f Mon Sep 17 00:00:00 2001 From: Yevhen Fastiuk Date: Mon, 5 Feb 2024 19:41:16 +0200 Subject: [PATCH 151/419] [Mellanox] Fix uninitialized variable on module plug event (#17011) - Why I did it To fix uninitialized variable - How I did it Add initial value Signed-off-by: Yevhen Fastiuk --- .../mellanox/mlnx-platform-api/sonic_platform/sfp_event.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp_event.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp_event.py index c390e9a4d341..133001020495 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp_event.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp_event.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2022 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -336,6 +336,7 @@ def on_pmpe(self, fd_p): uint32_t_p_assign(port_cnt_p, 0) label_port_list = [] module_state = 0 + error_type = pmpe_t.error_type rc = sx_lib_host_ifc_recv(fd_p, pkt, pkt_size_p, recv_info_p) if rc != 0: From bacd215779c24dbc14480dc5e4525f814514a4ba Mon Sep 17 00:00:00 2001 From: Liu Shilong Date: Tue, 9 Jan 2024 20:28:31 +0800 Subject: [PATCH 152/419] [ci] Enable cache for marvell-arm64 build in PR checks. (#15449) Why I did it Enable build cache for marvell-arm64 build to decrease PR check duration. Work item tracking Microsoft ADO (number only): 26340500 How I did it How to verify it --- .azure-pipelines/azure-pipelines-image-template.yml | 2 +- platform/marvell-arm64/docker-saiserver-mrvl.dep | 8 ++++++++ platform/marvell-arm64/docker-syncd-mrvl-rpc.dep | 8 ++++++++ platform/marvell-arm64/docker-syncd-mrvl.dep | 10 ++++++++++ platform/marvell-arm64/libsaithrift-dev.dep | 11 +++++++++++ platform/marvell-arm64/mrvl-prestera.dep | 9 +++++++++ platform/marvell-arm64/one-image.dep | 1 + platform/marvell-arm64/platform-marvell.dep | 9 +++++++++ platform/marvell-arm64/platform-nokia.dep | 8 ++++++++ platform/marvell-arm64/rules.dep | 9 +++++++++ platform/marvell-arm64/sai.dep | 8 ++++++++ 11 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 platform/marvell-arm64/docker-saiserver-mrvl.dep create mode 100644 platform/marvell-arm64/docker-syncd-mrvl-rpc.dep create mode 100644 platform/marvell-arm64/docker-syncd-mrvl.dep create mode 100644 platform/marvell-arm64/libsaithrift-dev.dep create mode 100644 platform/marvell-arm64/mrvl-prestera.dep create mode 100644 platform/marvell-arm64/one-image.dep create mode 100644 platform/marvell-arm64/platform-marvell.dep create mode 100644 platform/marvell-arm64/platform-nokia.dep create mode 100644 platform/marvell-arm64/rules.dep create mode 100644 platform/marvell-arm64/sai.dep diff --git a/.azure-pipelines/azure-pipelines-image-template.yml b/.azure-pipelines/azure-pipelines-image-template.yml index 0b480638cd9c..c412edb4234b 100644 --- a/.azure-pipelines/azure-pipelines-image-template.yml +++ b/.azure-pipelines/azure-pipelines-image-template.yml @@ -30,7 +30,7 @@ jobs: - script: | [ -n "$OVERRIDE_BUILD_OPTIONS" ] && OVERRIDE_BUILD_OPTIONS=$(OVERRIDE_BUILD_OPTIONS) BUILD_OPTIONS="$(BUILD_OPTIONS) $OVERRIDE_BUILD_OPTIONS" - if [ -n "$(CACHE_MODE)" ] && echo $(PLATFORM_AZP) | grep -E -q "^(vs|broadcom|mellanox|marvell-armhf)$"; then + if [ -n "$(CACHE_MODE)" ] && echo $(PLATFORM_AZP) | grep -E -q "^(vs|broadcom|mellanox|marvell-armhf|marvell-arm64)$"; then CACHE_OPTIONS="SONIC_DPKG_CACHE_METHOD=$(CACHE_MODE) SONIC_DPKG_CACHE_SOURCE=/nfs/dpkg_cache/$(PLATFORM_AZP)" BUILD_OPTIONS="$BUILD_OPTIONS $CACHE_OPTIONS" fi diff --git a/platform/marvell-arm64/docker-saiserver-mrvl.dep b/platform/marvell-arm64/docker-saiserver-mrvl.dep new file mode 100644 index 000000000000..3ded7bc916eb --- /dev/null +++ b/platform/marvell-arm64/docker-saiserver-mrvl.dep @@ -0,0 +1,8 @@ +DPATH := $($(DOCKER_SAISERVER_MRVL)_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) $(PLATFORM_PATH)/docker-saiserver-mrvl.mk $(PLATFORM_PATH)/docker-saiserver-mrvl.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(shell git ls-files $(DPATH)) + +$(DOCKER_SAISERVER_MRVL)_CACHE_MODE := GIT_CONTENT_SHA +$(DOCKER_SAISERVER_MRVL)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(DOCKER_SAISERVER_MRVL)_DEP_FILES := $(DEP_FILES) diff --git a/platform/marvell-arm64/docker-syncd-mrvl-rpc.dep b/platform/marvell-arm64/docker-syncd-mrvl-rpc.dep new file mode 100644 index 000000000000..3ab0dec8eb52 --- /dev/null +++ b/platform/marvell-arm64/docker-syncd-mrvl-rpc.dep @@ -0,0 +1,8 @@ +DPATH := $($(DOCKER_SYNCD_MRVL_RPC)_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) $(PLATFORM_PATH)/docker-syncd-mrvl-rpc.mk $(PLATFORM_PATH)/docker-syncd-mrvl-rpc.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(shell git ls-files $(DPATH)) + +$(DOCKER_SYNCD_MRVL_RPC)_CACHE_MODE := GIT_CONTENT_SHA +$(DOCKER_SYNCD_MRVL_RPC)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(DOCKER_SYNCD_MRVL_RPC)_DEP_FILES := $(DEP_FILES) diff --git a/platform/marvell-arm64/docker-syncd-mrvl.dep b/platform/marvell-arm64/docker-syncd-mrvl.dep new file mode 100644 index 000000000000..d3f213a2da84 --- /dev/null +++ b/platform/marvell-arm64/docker-syncd-mrvl.dep @@ -0,0 +1,10 @@ +DPATH := $($(DOCKER_SYNCD_BASE)_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) $(PLATFORM_PATH)/docker-syncd-mrvl.mk $(PLATFORM_PATH)/docker-syncd-mrvl.dep $(PLATFORM_PATH)/sai.mk +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(shell git ls-files $(DPATH)) + +$(DOCKER_SYNCD_BASE)_CACHE_MODE := GIT_CONTENT_SHA +$(DOCKER_SYNCD_BASE)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(DOCKER_SYNCD_BASE)_DEP_FILES := $(DEP_FILES) + +$(eval $(call add_dbg_docker,$(DOCKER_SYNCD_BASE),$(DOCKER_SYNCD_BASE_DBG))) diff --git a/platform/marvell-arm64/libsaithrift-dev.dep b/platform/marvell-arm64/libsaithrift-dev.dep new file mode 100644 index 000000000000..d7d08f14a319 --- /dev/null +++ b/platform/marvell-arm64/libsaithrift-dev.dep @@ -0,0 +1,11 @@ +SPATH := $($(LIBSAITHRIFT_DEV)_SRC_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) $(PLATFORM_PATH)/libsaithrift-dev.mk $(PLATFORM_PATH)/libsaithrift-dev.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +SMDEP_PATHS := $(SPATH) $(SPATH)/bm/behavioral-model $(SPATH)/test/ptf $(SPATH)/test/saithrift/ctypesgen +$(foreach path, $(SMDEP_PATHS), $(eval $(path) :=$(filter-out $(SMDEP_PATHS),$(addprefix $(path)/, $(shell cd $(path) && git ls-files | grep -Ev " " ))))) + +$(LIBSAITHRIFT_DEV)_CACHE_MODE := GIT_CONTENT_SHA +$(LIBSAITHRIFT_DEV)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(LIBSAITHRIFT_DEV)_DEP_FILES := $(DEP_FILES) +$(LIBSAITHRIFT_DEV)_SMDEP_FILES := $(foreach path, $(SMDEP_PATHS), $($(path))) +$(LIBSAITHRIFT_DEV)_SMDEP_PATHS := $(SMDEP_PATHS) diff --git a/platform/marvell-arm64/mrvl-prestera.dep b/platform/marvell-arm64/mrvl-prestera.dep new file mode 100644 index 000000000000..3ee32c3cbcd3 --- /dev/null +++ b/platform/marvell-arm64/mrvl-prestera.dep @@ -0,0 +1,9 @@ +MPATH := $($(MRVL_PRESTERA_DEB)_SRC_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) $(PLATFORM_PATH)/mrvl-prestera.mk $(PLATFORM_PATH)/mrvl-prestera.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +SMDEP_FILES := $(addprefix $(MPATH)/,$(shell cd $(MPATH) && git ls-files)) + +$(MRVL_PRESTERA_DEB)_CACHE_MODE := GIT_CONTENT_SHA +$(MRVL_PRESTERA_DEB)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(MRVL_PRESTERA_DEB)_DEP_FILES := $(DEP_FILES) +$(MRVL_PRESTERA_DEB)_SMDEP_FILES := $(SMDEP_FILES) diff --git a/platform/marvell-arm64/one-image.dep b/platform/marvell-arm64/one-image.dep new file mode 100644 index 000000000000..154112a82abc --- /dev/null +++ b/platform/marvell-arm64/one-image.dep @@ -0,0 +1 @@ +$(SONIC_ONE_IMAGE)_CACHE_MODE := none diff --git a/platform/marvell-arm64/platform-marvell.dep b/platform/marvell-arm64/platform-marvell.dep new file mode 100644 index 000000000000..f906215e3c0b --- /dev/null +++ b/platform/marvell-arm64/platform-marvell.dep @@ -0,0 +1,9 @@ +MPATH := $($(AC5X_RD98DX35xx_PLATFORM)_SRC_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) $(PLATFORM_PATH)/platform-marvell.dep $(PLATFORM_PATH)/platform-marvell.mk +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +SMDEP_FILES := $(addprefix $(MPATH)/,$(shell cd $(MPATH) && git ls-files)) + +$(AC5X_RD98DX35xx_PLATFORM)_CACHE_MODE := GIT_CONTENT_SHA +$(AC5X_RD98DX35xx_PLATFORM)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(AC5X_RD98DX35xx_PLATFORM)_DEP_FILES := $(DEP_FILES) +$(AC5X_RD98DX35xx_PLATFORM)_SMDEP_FILES := $(SMDEP_FILES) diff --git a/platform/marvell-arm64/platform-nokia.dep b/platform/marvell-arm64/platform-nokia.dep new file mode 100644 index 000000000000..603feb645eb1 --- /dev/null +++ b/platform/marvell-arm64/platform-nokia.dep @@ -0,0 +1,8 @@ +MPATH := $($(NOKIA_7215_PLATFORM)_SRC_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) $(PLATFORM_PATH)/platform-nokia.mk $(PLATFORM_PATH)/platform-nokia.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(shell git ls-files $(MPATH)) + +$(NOKIA_7215_PLATFORM)_CACHE_MODE := GIT_CONTENT_SHA +$(NOKIA_7215_PLATFORM)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(NOKIA_7215_PLATFORM)_DEP_FILES := $(DEP_FILES) diff --git a/platform/marvell-arm64/rules.dep b/platform/marvell-arm64/rules.dep new file mode 100644 index 000000000000..b14b76ef03dc --- /dev/null +++ b/platform/marvell-arm64/rules.dep @@ -0,0 +1,9 @@ +include $(PLATFORM_PATH)/docker-saiserver-mrvl.dep +include $(PLATFORM_PATH)/docker-syncd-mrvl-rpc.dep +include $(PLATFORM_PATH)/docker-syncd-mrvl.dep +include $(PLATFORM_PATH)/libsaithrift-dev.dep +include $(PLATFORM_PATH)/mrvl-prestera.dep +include $(PLATFORM_PATH)/one-image.dep +include $(PLATFORM_PATH)/platform-marvell.dep +include $(PLATFORM_PATH)/platform-nokia.dep +include $(PLATFORM_PATH)/sai.dep diff --git a/platform/marvell-arm64/sai.dep b/platform/marvell-arm64/sai.dep new file mode 100644 index 000000000000..618babe65ace --- /dev/null +++ b/platform/marvell-arm64/sai.dep @@ -0,0 +1,8 @@ +SPATH := $($(MRVL_SAI)_SRC_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) $(PLATFORM_PATH)/sai.mk $(PLATFORM_PATH)/sai.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(shell git ls-files $(SPATH)) + +$(MRVL_SAI)_CACHE_MODE := GIT_CONTENT_SHA +$(MRVL_SAI)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(MRVL_SAI)_DEP_FILES := $(DEP_FILES) From 317c1ad4794fa3797a542c60693959cf8714a6ec Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sun, 18 Feb 2024 20:41:51 +0800 Subject: [PATCH 153/419] [submodule] Update submodule sonic-platform-daemons to the latest HEAD automatically (#18127) #### Why I did it src/sonic-platform-daemons ``` * 7792838 - (HEAD -> 202311, origin/202311) Move firmware version fields to TRANSCEIVER_FIRMWARE_INFO table (#435) (22 hours ago) [mihirpat1] ``` #### How I did it #### How to verify it #### Description for the changelog --- 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 121b3381a89d..7792838612e9 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit 121b3381a89dc11045ad6654937dcc2c42865f6a +Subproject commit 7792838612e99da4001bd1265ea9c44fc8416024 From b9fbfcfa5cf023b72f3e6544ef3bcb988aa37886 Mon Sep 17 00:00:00 2001 From: abdosi <58047199+abdosi@users.noreply.github.com> Date: Wed, 24 Jan 2024 10:36:01 -0800 Subject: [PATCH 154/419] [chassis] update service_checker module to handle database-chassis service (#17836) * Update service_checker.py Signed-off-by: Abhishek Dosi --- src/system-health/health_checker/service_checker.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/system-health/health_checker/service_checker.py b/src/system-health/health_checker/service_checker.py index a310fbba1a3d..d2f245e70e0e 100644 --- a/src/system-health/health_checker/service_checker.py +++ b/src/system-health/health_checker/service_checker.py @@ -4,7 +4,7 @@ import re from swsscommon import swsscommon -from sonic_py_common import multi_asic +from sonic_py_common import multi_asic, device_info from sonic_py_common.logger import Logger from .health_checker import HealthChecker from . import utils @@ -99,7 +99,9 @@ def get_expected_running_containers(self, feature_table): else: expected_running_containers.add(feature_name) container_feature_dict[feature_name] = feature_name - + + if device_info.is_supervisor(): + expected_running_containers.add("database-chassis") return expected_running_containers, container_feature_dict def get_current_running_containers(self): From 6d422d23ece40250de3ed789becfc529d52a9c92 Mon Sep 17 00:00:00 2001 From: Arvindsrinivasan Lakshmi Narasimhan <55814491+arlakshm@users.noreply.github.com> Date: Thu, 8 Feb 2024 13:01:51 -0800 Subject: [PATCH 155/419] [nokia][chassis][voq] update the sai_post_init soc file with interrupt ids (#18066) Update/Add the sai_postinit_cmd.soc with the interrupt-ids Microsoft ADO 26730061: How to verify it Verify on the Chassis LCs --- .../0/jr2cp-nokia-18x100g-4x25g-config.bcm | 1 + .../0/sai_postinit_cmd.soc | 28 ++++++++++++++++++ .../1/jr2cp-nokia-18x100g-4x25g-config.bcm | 1 + .../1/sai_postinit_cmd.soc | 28 ++++++++++++++++++ .../0/sai_postinit_cmd.soc | 29 +++++++++++++++++++ .../1/sai_postinit_cmd.soc | 29 +++++++++++++++++++ 6 files changed, 116 insertions(+) diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/0/jr2cp-nokia-18x100g-4x25g-config.bcm b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/0/jr2cp-nokia-18x100g-4x25g-config.bcm index 9f3064f279f0..e289de50967b 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/0/jr2cp-nokia-18x100g-4x25g-config.bcm +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/0/jr2cp-nokia-18x100g-4x25g-config.bcm @@ -2094,3 +2094,4 @@ cmic_dma_abort_in_cold_boot=0 sai_pfc_dlr_init_capability=0 trunk_group_max_members=16 sai_default_cpu_tx_tc=7 +sai_postinit_cmd_file=/usr/share/sonic/hwsku/sai_postinit_cmd.soc \ No newline at end of file diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/0/sai_postinit_cmd.soc b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/0/sai_postinit_cmd.soc index 8b137891791f..80338902b828 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/0/sai_postinit_cmd.soc +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/0/sai_postinit_cmd.soc @@ -1 +1,29 @@ +INTeRrupt ENAble id=2209 +INTeRrupt ENAble id=2210 +INTeRrupt ENAble id=2211 +INTeRrupt ENAble id=2212 +INTeRrupt ENAble id=2213 +INTeRrupt ENAble id=2214 +INTeRrupt ENAble id=2215 +INTeRrupt ENAble id=2216 +INTeRrupt ENAble id=2217 +INTeRrupt ENAble id=2218 +INTeRrupt ENAble id=2219 +INTeRrupt ENAble id=2220 +INTeRrupt ENAble id=2221 +INTeRrupt ENAble id=2222 +INTeRrupt ENAble id=2223 +INTeRrupt ENAble id=2224 +INTeRrupt ENAble id=2225 +INTeRrupt ENAble id=2226 +INTeRrupt ENAble id=482 +INTeRrupt ENAble id=483 +INTeRrupt ENAble id=484 +INTeRrupt ENAble id=485 +INTeRrupt ENAble id=486 +INTeRrupt ENAble id=487 +INTeRrupt ENAble id=488 + +INTeRrupt ENAble id=1597 +debug intr error \ No newline at end of file diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/1/jr2cp-nokia-18x100g-4x25g-config.bcm b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/1/jr2cp-nokia-18x100g-4x25g-config.bcm index 27ff4d423394..cb112766e674 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/1/jr2cp-nokia-18x100g-4x25g-config.bcm +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/1/jr2cp-nokia-18x100g-4x25g-config.bcm @@ -2095,3 +2095,4 @@ cmic_dma_abort_in_cold_boot=0 sai_pfc_dlr_init_capability=0 trunk_group_max_members=16 sai_default_cpu_tx_tc=7 +sai_postinit_cmd_file=/usr/share/sonic/hwsku/sai_postinit_cmd.soc \ No newline at end of file diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/1/sai_postinit_cmd.soc b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/1/sai_postinit_cmd.soc index 8b137891791f..80338902b828 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/1/sai_postinit_cmd.soc +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/1/sai_postinit_cmd.soc @@ -1 +1,29 @@ +INTeRrupt ENAble id=2209 +INTeRrupt ENAble id=2210 +INTeRrupt ENAble id=2211 +INTeRrupt ENAble id=2212 +INTeRrupt ENAble id=2213 +INTeRrupt ENAble id=2214 +INTeRrupt ENAble id=2215 +INTeRrupt ENAble id=2216 +INTeRrupt ENAble id=2217 +INTeRrupt ENAble id=2218 +INTeRrupt ENAble id=2219 +INTeRrupt ENAble id=2220 +INTeRrupt ENAble id=2221 +INTeRrupt ENAble id=2222 +INTeRrupt ENAble id=2223 +INTeRrupt ENAble id=2224 +INTeRrupt ENAble id=2225 +INTeRrupt ENAble id=2226 +INTeRrupt ENAble id=482 +INTeRrupt ENAble id=483 +INTeRrupt ENAble id=484 +INTeRrupt ENAble id=485 +INTeRrupt ENAble id=486 +INTeRrupt ENAble id=487 +INTeRrupt ENAble id=488 + +INTeRrupt ENAble id=1597 +debug intr error \ No newline at end of file diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/sai_postinit_cmd.soc b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/sai_postinit_cmd.soc index 97f62c07cc77..26b9099a949a 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/sai_postinit_cmd.soc +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/sai_postinit_cmd.soc @@ -36,3 +36,32 @@ phy set 17 reg=0xd137 data=0 lane=2 phy set 17 reg=0xd138 data=0 lane=2 phy set 17 reg=0xd133 data=0x1804 lane=2 +INTeRrupt ENAble id=2209 +INTeRrupt ENAble id=2210 +INTeRrupt ENAble id=2211 +INTeRrupt ENAble id=2212 +INTeRrupt ENAble id=2213 +INTeRrupt ENAble id=2214 +INTeRrupt ENAble id=2215 +INTeRrupt ENAble id=2216 +INTeRrupt ENAble id=2217 +INTeRrupt ENAble id=2218 +INTeRrupt ENAble id=2219 +INTeRrupt ENAble id=2220 +INTeRrupt ENAble id=2221 +INTeRrupt ENAble id=2222 +INTeRrupt ENAble id=2223 +INTeRrupt ENAble id=2224 +INTeRrupt ENAble id=2225 +INTeRrupt ENAble id=2226 + +INTeRrupt ENAble id=482 +INTeRrupt ENAble id=483 +INTeRrupt ENAble id=484 +INTeRrupt ENAble id=485 +INTeRrupt ENAble id=486 +INTeRrupt ENAble id=487 +INTeRrupt ENAble id=488 + +INTeRrupt ENAble id=1597 +debug intr error \ No newline at end of file diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/sai_postinit_cmd.soc b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/sai_postinit_cmd.soc index ed471c6c19b2..19c3f73e9e30 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/sai_postinit_cmd.soc +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/sai_postinit_cmd.soc @@ -13,3 +13,32 @@ phy set 8 reg=0xd137 data=0 lane=1 phy set 8 reg=0xd138 data=0 lane=1 phy set 8 reg=0xd133 data=0x1802 lane=1 +INTeRrupt ENAble id=2209 +INTeRrupt ENAble id=2210 +INTeRrupt ENAble id=2211 +INTeRrupt ENAble id=2212 +INTeRrupt ENAble id=2213 +INTeRrupt ENAble id=2214 +INTeRrupt ENAble id=2215 +INTeRrupt ENAble id=2216 +INTeRrupt ENAble id=2217 +INTeRrupt ENAble id=2218 +INTeRrupt ENAble id=2219 +INTeRrupt ENAble id=2220 +INTeRrupt ENAble id=2221 +INTeRrupt ENAble id=2222 +INTeRrupt ENAble id=2223 +INTeRrupt ENAble id=2224 +INTeRrupt ENAble id=2225 +INTeRrupt ENAble id=2226 + +INTeRrupt ENAble id=482 +INTeRrupt ENAble id=483 +INTeRrupt ENAble id=484 +INTeRrupt ENAble id=485 +INTeRrupt ENAble id=486 +INTeRrupt ENAble id=487 +INTeRrupt ENAble id=488 + +INTeRrupt ENAble id=1597 +debug intr error \ No newline at end of file From 76ef12ec7372ab7e16de560efa5e81519743a52e Mon Sep 17 00:00:00 2001 From: Zain Budhwani <99770260+zbud-msft@users.noreply.github.com> Date: Mon, 12 Feb 2024 21:52:38 -0800 Subject: [PATCH 156/419] [eventd] Fix eventd UT flakiness (#17055) ### Why I did it Fix flakiness of eventd UT - run sub after capture service starts ##### Work item tracking - Microsoft ADO **(number only)**:25650744 #### How I did it Run sub socket after capture socket is initialized #### How to verify it Pipeline --- src/sonic-eventd/Makefile | 2 +- src/sonic-eventd/src/eventd.cpp | 4 +- src/sonic-eventd/src/eventd.h | 2 + src/sonic-eventd/tests/eventd_ut.cpp | 72 ++++++++++++++++++---------- src/sonic-eventd/tests/main.cpp | 42 ++++------------ 5 files changed, 63 insertions(+), 59 deletions(-) diff --git a/src/sonic-eventd/Makefile b/src/sonic-eventd/Makefile index f9cc5bf8b5fa..835d0732a0cd 100644 --- a/src/sonic-eventd/Makefile +++ b/src/sonic-eventd/Makefile @@ -29,7 +29,7 @@ endif -include rsyslog_plugin/subdir.mk -include rsyslog_plugin_tests/subdir.mk -all: sonic-eventd eventd-tool rsyslog-plugin +all: sonic-eventd eventd-tests eventd-tool rsyslog-plugin rsyslog-plugin-tests sonic-eventd: $(OBJS) @echo 'Building target: $@' diff --git a/src/sonic-eventd/src/eventd.cpp b/src/sonic-eventd/src/eventd.cpp index 953fe9b7c491..36c162453427 100644 --- a/src/sonic-eventd/src/eventd.cpp +++ b/src/sonic-eventd/src/eventd.cpp @@ -546,9 +546,9 @@ capture_service::set_control(capture_control_t ctrl, event_serialized_lst_t *lst switch(ctrl) { case INIT_CAPTURE: m_thr = thread(&capture_service::do_capture, this); - for(int i=0; !m_cap_run && (i < 100); ++i) { + for(int i=0; !m_cap_run && (i < CAPTURE_SERVICE_POLLING_RETRIES); ++i) { /* Wait max a second for thread to init */ - this_thread::sleep_for(chrono::milliseconds(10)); + this_thread::sleep_for(chrono::milliseconds(CAPTURE_SERVICE_POLLING_DURATION)); } RET_ON_ERR(m_cap_run, "Failed to init capture"); m_ctrl = ctrl; diff --git a/src/sonic-eventd/src/eventd.h b/src/sonic-eventd/src/eventd.h index 706863667eea..a7a87f9436a0 100644 --- a/src/sonic-eventd/src/eventd.h +++ b/src/sonic-eventd/src/eventd.h @@ -21,6 +21,8 @@ typedef enum { #define EVENTS_STATS_FIELD_NAME "value" #define STATS_HEARTBEAT_MIN 300 +#define CAPTURE_SERVICE_POLLING_DURATION 10 +#define CAPTURE_SERVICE_POLLING_RETRIES 100 /* * Started by eventd_service. diff --git a/src/sonic-eventd/tests/eventd_ut.cpp b/src/sonic-eventd/tests/eventd_ut.cpp index db46845b0480..729563fcd39d 100644 --- a/src/sonic-eventd/tests/eventd_ut.cpp +++ b/src/sonic-eventd/tests/eventd_ut.cpp @@ -152,25 +152,23 @@ static const test_data_t ldata[] = { void run_cap(void *zctx, bool &term, string &read_source, - int &cnt) + int &cnt, bool &should_read_control) { void *mock_cap = zmq_socket (zctx, ZMQ_SUB); string source; internal_event_t ev_int; int block_ms = 200; int i=0; - static int proxy_finished_init = false; EXPECT_TRUE(NULL != mock_cap); EXPECT_EQ(0, zmq_connect(mock_cap, get_config(CAPTURE_END_KEY).c_str())); EXPECT_EQ(0, zmq_setsockopt(mock_cap, ZMQ_SUBSCRIBE, "", 0)); EXPECT_EQ(0, zmq_setsockopt(mock_cap, ZMQ_RCVTIMEO, &block_ms, sizeof (block_ms))); - if(!proxy_finished_init) { + if(should_read_control) { zmq_msg_t msg; zmq_msg_init(&msg); - EXPECT_EQ(1, zmq_msg_recv(&msg, mock_cap, 0)); // Subscription message - proxy_finished_init = true; + EXPECT_NE(1, zmq_msg_recv(&msg, mock_cap, 0)); // Subscription message should be read by do_capture } while(!term) { @@ -227,10 +225,10 @@ void run_pub(void *mock_pub, const string wr_source, internal_events_lst_t &lst) } } - TEST(eventd, proxy) { printf("Proxy TEST started\n"); + bool should_read_control = false; bool term_sub = false; bool term_cap = false; string rd_csource, rd_source, wr_source("hello"); @@ -247,12 +245,12 @@ TEST(eventd, proxy) /* Starting proxy */ EXPECT_EQ(0, pxy->init()); + /* capture in a thread */ + thread thrc(&run_cap, zctx, ref(term_cap), ref(rd_csource), ref(rd_cevts_sz), ref(should_read_control)); + /* subscriber in a thread */ thread thr(&run_sub, zctx, ref(term_sub), ref(rd_source), ref(rd_evts), ref(rd_evts_sz)); - /* capture in a thread */ - thread thrc(&run_cap, zctx, ref(term_cap), ref(rd_csource), ref(rd_cevts_sz)); - /* Init pub connection */ void *mock_pub = init_pub(zctx); @@ -275,9 +273,6 @@ TEST(eventd, proxy) } this_thread::sleep_for(chrono::milliseconds(1000)); - delete pxy; - pxy = NULL; - term_sub = true; term_cap = true; @@ -287,6 +282,18 @@ TEST(eventd, proxy) EXPECT_EQ(rd_cevts_sz, wr_evts.size()); zmq_close(mock_pub); + + /* Do control test */ + + should_read_control = true; + + /* capture in a thread */ + thread thrcc(&run_cap, zctx, ref(term_cap), ref(rd_csource), ref(rd_cevts_sz), ref(should_read_control)); + + delete pxy; + pxy = NULL; + + thrcc.join(); zmq_ctx_term(zctx); /* Provide time for async proxy removal to complete */ @@ -295,7 +302,6 @@ TEST(eventd, proxy) printf("eventd_proxy is tested GOOD\n"); } - TEST(eventd, capture) { printf("Capture TEST started\n"); @@ -329,9 +335,6 @@ TEST(eventd, capture) /* Starting proxy */ EXPECT_EQ(0, pxy->init()); - /* Run subscriber; Else publisher will drop events on floor, with no subscriber. */ - thread thr_sub(&run_sub, zctx, ref(term_sub), ref(sub_source), ref(sub_evts), ref(sub_evts_sz)); - /* Create capture service */ capture_service *pcap = new capture_service(zctx, cache_max, &stats_instance); @@ -341,6 +344,9 @@ TEST(eventd, capture) /* Initialize the capture */ EXPECT_EQ(0, pcap->set_control(INIT_CAPTURE)); + /* Run subscriber; Else publisher will drop events on floor, with no subscriber. */ + thread thr_sub(&run_sub, zctx, ref(term_sub), ref(sub_source), ref(sub_evts), ref(sub_evts_sz)); + EXPECT_TRUE(init_cache > 1); EXPECT_TRUE((cache_max+3) < (int)ARRAY_SIZE(ldata)); @@ -473,9 +479,6 @@ TEST(eventd, captureCacheMax) /* Starting proxy */ EXPECT_EQ(0, pxy->init()); - /* Run subscriber; Else publisher will drop events on floor, with no subscriber. */ - thread thr_sub(&run_sub, zctx, ref(term_sub), ref(sub_source), ref(sub_evts), ref(sub_evts_sz)); - /* Create capture service */ capture_service *pcap = new capture_service(zctx, cache_max, &stats_instance); @@ -484,6 +487,9 @@ TEST(eventd, captureCacheMax) EXPECT_TRUE(init_cache > 1); + /* Run subscriber; Else publisher will drop events on floor, with no subscriber. */ + thread thr_sub(&run_sub, zctx, ref(term_sub), ref(sub_source), ref(sub_evts), ref(sub_evts_sz)); + /* Collect few serailized strings of events for startup cache */ for(int i=0; i < init_cache; ++i) { internal_event_t ev(create_ev(ldata[i])); @@ -595,6 +601,7 @@ TEST(eventd, service) } thread thread_service(&run_eventd_service); + this_thread::sleep_for(chrono::milliseconds(CAPTURE_SERVICE_POLLING_DURATION * CAPTURE_SERVICE_POLLING_RETRIES)); /* Need client side service to interact with server side */ EXPECT_EQ(0, service.init_client(zctx)); @@ -610,7 +617,7 @@ TEST(eventd, service) string wr_source("hello"); /* Test service startup caching */ - event_serialized_lst_t evts_start, evts_read; + event_serialized_lst_t evts_start, evts_read, polled_events; for(int i=0; i(current_ts - poll_start_ts).count() >= max_polling_duration) { + break; + } + event_serialized_lst_t read_events; + service.cache_read(read_events); + polled_events.insert(polled_events.end(), read_events.begin(), read_events.end()); + if (!read_events.empty()) { + break; + } + this_thread::sleep_for(chrono::milliseconds(polling_interval)); + } EXPECT_EQ(0, service.cache_stop()); - /* Read the cache; expect wr_sz events */ + /* Read remaining events in cache, if any */ EXPECT_EQ(0, service.cache_read(evts_read)); - EXPECT_EQ(evts_read, evts_start); + polled_events.insert(polled_events.end(), evts_read.begin(), evts_read.end()); + + EXPECT_EQ(polled_events, evts_start); zmq_close(mock_pub); } diff --git a/src/sonic-eventd/tests/main.cpp b/src/sonic-eventd/tests/main.cpp index fdc175e645d8..f0d011305a50 100644 --- a/src/sonic-eventd/tests/main.cpp +++ b/src/sonic-eventd/tests/main.cpp @@ -1,6 +1,7 @@ #include "gtest/gtest.h" #include "dbconnector.h" #include +#include using namespace std; using namespace swss; @@ -20,57 +21,34 @@ class SwsscommonEnvironment : public ::testing::Environment { // Override this to define how to set up the environment void SetUp() override { // by default , init should be false - cout<<"Default : isInit = "< Date: Mon, 19 Feb 2024 16:33:04 +0800 Subject: [PATCH 157/419] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#18128) #### Why I did it src/sonic-utilities ``` * c711b061 - (HEAD -> 202311, origin/202311) [Mellanox buffer migrator] Do not touch the buffer model on generic SKUs if the buffer configuration is empty (#3114) (2 days ago) [Stephen Sun] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index b21257617755..c711b061c8af 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit b21257617755c5d9af061f9d60d131d012de82e6 +Subproject commit c711b061c8af6a50c74e97c87d3c1cb9b906648d From 4383c7ff8bd94ef50df10b9b0bff687fee178a02 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Mon, 19 Feb 2024 16:33:07 +0800 Subject: [PATCH 158/419] [submodule] Update submodule sonic-platform-common to the latest HEAD automatically (#18126) #### Why I did it src/sonic-platform-common ``` * 5430f6f - (HEAD -> 202311, origin/202311) Change get_transceiver_info_firmware_versions return type to dict (#440) (2 days ago) [mihirpat1] ``` #### How I did it #### How to verify it #### Description for the changelog --- 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 9bf5a179035a..5430f6fce8fa 160000 --- a/src/sonic-platform-common +++ b/src/sonic-platform-common @@ -1 +1 @@ -Subproject commit 9bf5a179035a1bf2b7728330cf0b0503d35bad4c +Subproject commit 5430f6fce8fa154cabba5a8ae12dde60a4f4e573 From 20ba1e2406ddb3fe4f248b71018f4dcaba10c67e Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Mon, 12 Feb 2024 22:12:57 +0800 Subject: [PATCH 159/419] [Mellanox] Remove SFP sensors from sensors.conf (#17631) - Why I did it The cable thermal sensors will be deprecated from the kernel driver. When cable host management is enabled, NOS will fetch the cable temperature from cable EEPROM, kernel driver will not provide the sysfs anymore. - How I did it Remove the relevant sensor form the conf files - How to verify it Run sonic mgmt sensor test Signed-off-by: Kebo Liu --- .../x86_64-mlnx_msn2010-r0/sensors.conf | 22 +++++++ .../x86_64-mlnx_msn2100-r0/sensors.conf | 16 +++++ .../x86_64-mlnx_msn2410-r0/sensors.conf | 56 ++++++++++++++++ .../x86_64-mlnx_msn2700-r0/sensors.conf | 32 +++++++++ .../x86_64-mlnx_msn2700a1-r0/sensors.conf | 32 +++++++++ .../x86_64-mlnx_msn2740-r0/sensors.conf | 33 ++++++++++ .../x86_64-mlnx_msn3420-r0/sensors.conf | 60 +++++++++++++++++ .../x86_64-mlnx_msn3700-r0/sensors.conf | 32 +++++++++ .../sensors_respin.conf | 32 +++++++++ .../sensors_swb_respin.conf | 32 +++++++++ .../x86_64-mlnx_msn3700c-r0/sensors.conf | 32 +++++++++ .../sensors_respin.conf | 32 +++++++++ .../sensors_swb_respin.conf | 32 +++++++++ .../x86_64-mlnx_msn3800-r0/sensors.conf | 64 ++++++++++++++++++ .../x86_64-mlnx_msn4600-r0/sensors.conf | 64 ++++++++++++++++++ .../x86_64-mlnx_msn4600c-r0/sensors.conf | 64 ++++++++++++++++++ .../x86_64-mlnx_msn4600c-r0/sensors.conf.a1 | 64 ++++++++++++++++++ .../sensors_respin.conf | 64 ++++++++++++++++++ .../sensors_respin.conf.a1 | 64 ++++++++++++++++++ .../x86_64-mlnx_msn4700-r0/sensors.conf | 32 +++++++++ .../x86_64-mlnx_msn4700-r0/sensors.conf.a1 | 32 +++++++++ .../x86_64-nvidia_sn2201-r0/sensors.conf | 4 ++ .../x86_64-nvidia_sn5600-r0/sensors.conf | 65 +++++++++++++++++++ 23 files changed, 960 insertions(+) diff --git a/device/mellanox/x86_64-mlnx_msn2010-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn2010-r0/sensors.conf index 7f5b023afec6..9bcfcbe21138 100644 --- a/device/mellanox/x86_64-mlnx_msn2010-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn2010-r0/sensors.conf @@ -47,3 +47,25 @@ bus "i2c-2" "i2c-1-mux (chan_id 1)" label fan2 "Chassis Fan 2" label fan3 "Chassis Fan 3" label fan4 "Chassis Fan 4" + ignore temp2 + ignore temp3 + ignore temp4 + ignore temp5 + ignore temp6 + ignore temp7 + ignore temp8 + ignore temp9 + ignore temp10 + ignore temp11 + ignore temp12 + ignore temp13 + ignore temp14 + ignore temp15 + ignore temp16 + ignore temp17 + ignore temp18 + ignore temp19 + ignore temp20 + ignore temp21 + ignore temp22 + ignore temp23 diff --git a/device/mellanox/x86_64-mlnx_msn2100-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn2100-r0/sensors.conf index e37dd25f03db..22b8e4dd8c7d 100644 --- a/device/mellanox/x86_64-mlnx_msn2100-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn2100-r0/sensors.conf @@ -49,3 +49,19 @@ bus "i2c-2" "i2c-1-mux (chan_id 1)" label fan2 "Chassis Fan 2" label fan3 "Chassis Fan 3" label fan4 "Chassis Fan 4" + ignore temp2 + ignore temp3 + ignore temp4 + ignore temp5 + ignore temp6 + ignore temp7 + ignore temp8 + ignore temp9 + ignore temp10 + ignore temp11 + ignore temp12 + ignore temp13 + ignore temp14 + ignore temp15 + ignore temp16 + ignore temp17 diff --git a/device/mellanox/x86_64-mlnx_msn2410-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn2410-r0/sensors.conf index ede1fbe3c768..fa446832fef1 100644 --- a/device/mellanox/x86_64-mlnx_msn2410-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn2410-r0/sensors.conf @@ -79,3 +79,59 @@ bus "i2c-2" "i2c-1-mux (chan_id 1)" label fan6 "Chassis Drawer-3 Fan-2" label fan7 "Chassis Drawer-4 Fan-1" label fan8 "Chassis Drawer-4 Fan-2" + ignore temp2 + ignore temp3 + ignore temp4 + ignore temp5 + ignore temp6 + ignore temp7 + ignore temp8 + ignore temp9 + ignore temp10 + ignore temp11 + ignore temp12 + ignore temp13 + ignore temp14 + ignore temp15 + ignore temp16 + ignore temp17 + ignore temp18 + ignore temp19 + ignore temp20 + ignore temp21 + ignore temp22 + ignore temp23 + ignore temp24 + ignore temp25 + ignore temp26 + ignore temp27 + ignore temp28 + ignore temp29 + ignore temp30 + ignore temp31 + ignore temp32 + ignore temp33 + ignore temp34 + ignore temp35 + ignore temp36 + ignore temp37 + ignore temp38 + ignore temp39 + ignore temp40 + ignore temp41 + ignore temp42 + ignore temp43 + ignore temp44 + ignore temp45 + ignore temp46 + ignore temp47 + ignore temp48 + ignore temp49 + ignore temp50 + ignore temp51 + ignore temp52 + ignore temp53 + ignore temp54 + ignore temp55 + ignore temp56 + ignore temp57 diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn2700-r0/sensors.conf index 62f100d757e7..8197e191b462 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/sensors.conf @@ -79,3 +79,35 @@ bus "i2c-2" "i2c-1-mux (chan_id 2)" label fan6 "Chassis Drawer-3 Fan-2" label fan7 "Chassis Drawer-4 Fan-1" label fan8 "Chassis Drawer-4 Fan-2" + ignore temp2 + ignore temp3 + ignore temp4 + ignore temp5 + ignore temp6 + ignore temp7 + ignore temp8 + ignore temp9 + ignore temp10 + ignore temp11 + ignore temp12 + ignore temp13 + ignore temp14 + ignore temp15 + ignore temp16 + ignore temp17 + ignore temp18 + ignore temp19 + ignore temp20 + ignore temp21 + ignore temp22 + ignore temp23 + ignore temp24 + ignore temp25 + ignore temp26 + ignore temp27 + ignore temp28 + ignore temp29 + ignore temp30 + ignore temp31 + ignore temp32 + ignore temp33 diff --git a/device/mellanox/x86_64-mlnx_msn2700a1-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn2700a1-r0/sensors.conf index d9a5d26485cd..e8f5e1568106 100644 --- a/device/mellanox/x86_64-mlnx_msn2700a1-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn2700a1-r0/sensors.conf @@ -21,6 +21,38 @@ bus "i2c-17" "i2c-1-mux (chan_id 8)" # Temperature sensors chip "mlxsw-i2c-*-48" label temp1 "Ambient ASIC Temp" + ignore temp2 + ignore temp3 + ignore temp4 + ignore temp5 + ignore temp6 + ignore temp7 + ignore temp8 + ignore temp9 + ignore temp10 + ignore temp11 + ignore temp12 + ignore temp13 + ignore temp14 + ignore temp15 + ignore temp16 + ignore temp17 + ignore temp18 + ignore temp19 + ignore temp20 + ignore temp21 + ignore temp22 + ignore temp23 + ignore temp24 + ignore temp25 + ignore temp26 + ignore temp27 + ignore temp28 + ignore temp29 + ignore temp30 + ignore temp31 + ignore temp32 + ignore temp33 chip "tmp102-i2c-*-49" label temp1 "Ambient COMEX Temp" diff --git a/device/mellanox/x86_64-mlnx_msn2740-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn2740-r0/sensors.conf index ffc36fe2168c..2e60f6b451e1 100644 --- a/device/mellanox/x86_64-mlnx_msn2740-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn2740-r0/sensors.conf @@ -74,3 +74,36 @@ bus "i2c-2" "i2c-1-mux (chan_id 1)" label fan2 "Chassis Fan Drawer-2" label fan3 "Chassis Fan Drawer-3" label fan4 "Chassis Fan Drawer-4" + ignore temp2 + ignore temp3 + ignore temp4 + ignore temp5 + ignore temp6 + ignore temp7 + ignore temp8 + ignore temp9 + ignore temp10 + ignore temp11 + ignore temp12 + ignore temp13 + ignore temp14 + ignore temp15 + ignore temp16 + ignore temp17 + ignore temp18 + ignore temp19 + ignore temp20 + ignore temp21 + ignore temp22 + ignore temp23 + ignore temp24 + ignore temp25 + ignore temp26 + ignore temp27 + ignore temp28 + ignore temp29 + ignore temp30 + ignore temp31 + ignore temp32 + ignore temp33 + diff --git a/device/mellanox/x86_64-mlnx_msn3420-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn3420-r0/sensors.conf index b0e4901eccca..83a5c7ce4c77 100644 --- a/device/mellanox/x86_64-mlnx_msn3420-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn3420-r0/sensors.conf @@ -8,6 +8,66 @@ bus "i2c-2" "i2c-1-mux (chan_id 1)" chip "mlxsw-i2c-*-48" label temp1 "Ambient ASIC Temp" + ignore temp2 + ignore temp3 + ignore temp4 + ignore temp5 + ignore temp6 + ignore temp7 + ignore temp8 + ignore temp9 + ignore temp10 + ignore temp11 + ignore temp12 + ignore temp13 + ignore temp14 + ignore temp15 + ignore temp16 + ignore temp17 + ignore temp18 + ignore temp19 + ignore temp20 + ignore temp21 + ignore temp22 + ignore temp23 + ignore temp24 + ignore temp25 + ignore temp26 + ignore temp27 + ignore temp28 + ignore temp29 + ignore temp30 + ignore temp31 + ignore temp32 + ignore temp33 + ignore temp34 + ignore temp35 + ignore temp36 + ignore temp37 + ignore temp38 + ignore temp39 + ignore temp40 + ignore temp41 + ignore temp42 + ignore temp43 + ignore temp44 + ignore temp45 + ignore temp46 + ignore temp47 + ignore temp48 + ignore temp49 + ignore temp50 + ignore temp51 + ignore temp52 + ignore temp53 + ignore temp54 + ignore temp55 + ignore temp56 + ignore temp57 + ignore temp58 + ignore temp59 + ignore temp60 + ignore temp61 bus "i2c-7" "i2c-1-mux (chan_id 6)" chip "tmp102-i2c-*-49" diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn3700-r0/sensors.conf index 59c99ac98e39..37446268adab 100644 --- a/device/mellanox/x86_64-mlnx_msn3700-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/sensors.conf @@ -8,6 +8,38 @@ bus "i2c-2" "i2c-1-mux (chan_id 1)" chip "mlxsw-i2c-*-48" label temp1 "Ambient ASIC Temp" + ignore temp2 + ignore temp3 + ignore temp4 + ignore temp5 + ignore temp6 + ignore temp7 + ignore temp8 + ignore temp9 + ignore temp10 + ignore temp11 + ignore temp12 + ignore temp13 + ignore temp14 + ignore temp15 + ignore temp16 + ignore temp17 + ignore temp18 + ignore temp19 + ignore temp20 + ignore temp21 + ignore temp22 + ignore temp23 + ignore temp24 + ignore temp25 + ignore temp26 + ignore temp27 + ignore temp28 + ignore temp29 + ignore temp30 + ignore temp31 + ignore temp32 + ignore temp33 bus "i2c-7" "i2c-1-mux (chan_id 6)" chip "tmp102-i2c-*-49" diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/sensors_respin.conf b/device/mellanox/x86_64-mlnx_msn3700-r0/sensors_respin.conf index d3cd3091faa8..db5cd3009294 100644 --- a/device/mellanox/x86_64-mlnx_msn3700-r0/sensors_respin.conf +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/sensors_respin.conf @@ -19,6 +19,38 @@ bus "i2c-2" "i2c-1-mux (chan_id 1)" chip "mlxsw-i2c-*-48" label temp1 "Ambient ASIC Temp" + ignore temp2 + ignore temp3 + ignore temp4 + ignore temp5 + ignore temp6 + ignore temp7 + ignore temp8 + ignore temp9 + ignore temp10 + ignore temp11 + ignore temp12 + ignore temp13 + ignore temp14 + ignore temp15 + ignore temp16 + ignore temp17 + ignore temp18 + ignore temp19 + ignore temp20 + ignore temp21 + ignore temp22 + ignore temp23 + ignore temp24 + ignore temp25 + ignore temp26 + ignore temp27 + ignore temp28 + ignore temp29 + ignore temp30 + ignore temp31 + ignore temp32 + ignore temp33 bus "i2c-7" "i2c-1-mux (chan_id 6)" chip "tmp102-i2c-*-49" diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/sensors_swb_respin.conf b/device/mellanox/x86_64-mlnx_msn3700-r0/sensors_swb_respin.conf index c10d0fd15950..8c546c107cfa 100644 --- a/device/mellanox/x86_64-mlnx_msn3700-r0/sensors_swb_respin.conf +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/sensors_swb_respin.conf @@ -19,6 +19,38 @@ bus "i2c-2" "i2c-1-mux (chan_id 1)" chip "mlxsw-i2c-*-48" label temp1 "Ambient ASIC Temp" + ignore temp2 + ignore temp3 + ignore temp4 + ignore temp5 + ignore temp6 + ignore temp7 + ignore temp8 + ignore temp9 + ignore temp10 + ignore temp11 + ignore temp12 + ignore temp13 + ignore temp14 + ignore temp15 + ignore temp16 + ignore temp17 + ignore temp18 + ignore temp19 + ignore temp20 + ignore temp21 + ignore temp22 + ignore temp23 + ignore temp24 + ignore temp25 + ignore temp26 + ignore temp27 + ignore temp28 + ignore temp29 + ignore temp30 + ignore temp31 + ignore temp32 + ignore temp33 bus "i2c-7" "i2c-1-mux (chan_id 6)" chip "tmp102-i2c-*-49" diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors.conf index 343385fcd4de..ed6cebd1d102 100644 --- a/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors.conf @@ -8,6 +8,38 @@ bus "i2c-2" "i2c-1-mux (chan_id 1)" chip "mlxsw-i2c-*-48" label temp1 "Ambient ASIC Temp" + ignore temp2 + ignore temp3 + ignore temp4 + ignore temp5 + ignore temp6 + ignore temp7 + ignore temp8 + ignore temp9 + ignore temp10 + ignore temp11 + ignore temp12 + ignore temp13 + ignore temp14 + ignore temp15 + ignore temp16 + ignore temp17 + ignore temp18 + ignore temp19 + ignore temp20 + ignore temp21 + ignore temp22 + ignore temp23 + ignore temp24 + ignore temp25 + ignore temp26 + ignore temp27 + ignore temp28 + ignore temp29 + ignore temp30 + ignore temp31 + ignore temp32 + ignore temp33 bus "i2c-7" "i2c-1-mux (chan_id 6)" chip "tmp102-i2c-*-49" diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors_respin.conf b/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors_respin.conf index 740f9ae968fe..fdc7bac39424 100644 --- a/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors_respin.conf +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors_respin.conf @@ -19,6 +19,38 @@ bus "i2c-2" "i2c-1-mux (chan_id 1)" chip "mlxsw-i2c-*-48" label temp1 "Ambient ASIC Temp" + ignore temp2 + ignore temp3 + ignore temp4 + ignore temp5 + ignore temp6 + ignore temp7 + ignore temp8 + ignore temp9 + ignore temp10 + ignore temp11 + ignore temp12 + ignore temp13 + ignore temp14 + ignore temp15 + ignore temp16 + ignore temp17 + ignore temp18 + ignore temp19 + ignore temp20 + ignore temp21 + ignore temp22 + ignore temp23 + ignore temp24 + ignore temp25 + ignore temp26 + ignore temp27 + ignore temp28 + ignore temp29 + ignore temp30 + ignore temp31 + ignore temp32 + ignore temp33 bus "i2c-7" "i2c-1-mux (chan_id 6)" chip "tmp102-i2c-*-49" diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors_swb_respin.conf b/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors_swb_respin.conf index 027c63d744e8..2b0394f801f0 100644 --- a/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors_swb_respin.conf +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors_swb_respin.conf @@ -19,6 +19,38 @@ bus "i2c-2" "i2c-1-mux (chan_id 1)" chip "mlxsw-i2c-*-48" label temp1 "Ambient ASIC Temp" + ignore temp2 + ignore temp3 + ignore temp4 + ignore temp5 + ignore temp6 + ignore temp7 + ignore temp8 + ignore temp9 + ignore temp10 + ignore temp11 + ignore temp12 + ignore temp13 + ignore temp14 + ignore temp15 + ignore temp16 + ignore temp17 + ignore temp18 + ignore temp19 + ignore temp20 + ignore temp21 + ignore temp22 + ignore temp23 + ignore temp24 + ignore temp25 + ignore temp26 + ignore temp27 + ignore temp28 + ignore temp29 + ignore temp30 + ignore temp31 + ignore temp32 + ignore temp33 bus "i2c-7" "i2c-1-mux (chan_id 6)" chip "tmp102-i2c-*-49" diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn3800-r0/sensors.conf index 0b1cfc75548a..5400269b32e1 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/sensors.conf @@ -8,6 +8,70 @@ bus "i2c-2" "i2c-1-mux (chan_id 1)" chip "mlxsw-i2c-*-48" label temp1 "Ambient ASIC Temp" + ignore temp2 + ignore temp3 + ignore temp4 + ignore temp5 + ignore temp6 + ignore temp7 + ignore temp8 + ignore temp9 + ignore temp10 + ignore temp11 + ignore temp12 + ignore temp13 + ignore temp14 + ignore temp15 + ignore temp16 + ignore temp17 + ignore temp18 + ignore temp19 + ignore temp20 + ignore temp21 + ignore temp22 + ignore temp23 + ignore temp24 + ignore temp25 + ignore temp26 + ignore temp27 + ignore temp28 + ignore temp29 + ignore temp30 + ignore temp31 + ignore temp32 + ignore temp33 + ignore temp34 + ignore temp35 + ignore temp36 + ignore temp37 + ignore temp38 + ignore temp39 + ignore temp40 + ignore temp41 + ignore temp42 + ignore temp43 + ignore temp44 + ignore temp45 + ignore temp46 + ignore temp47 + ignore temp48 + ignore temp49 + ignore temp50 + ignore temp51 + ignore temp52 + ignore temp53 + ignore temp54 + ignore temp55 + ignore temp56 + ignore temp57 + ignore temp58 + ignore temp59 + ignore temp60 + ignore temp61 + ignore temp62 + ignore temp63 + ignore temp64 + ignore temp65 bus "i2c-7" "i2c-1-mux (chan_id 6)" chip "tmp102-i2c-*-49" diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn4600-r0/sensors.conf index dfe848ca8aa4..8443e1b11c82 100644 --- a/device/mellanox/x86_64-mlnx_msn4600-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/sensors.conf @@ -8,6 +8,70 @@ bus "i2c-2" "i2c-1-mux (chan_id 1)" chip "mlxsw-i2c-*-48" label temp1 "Ambient ASIC Temp" + ignore temp2 + ignore temp3 + ignore temp4 + ignore temp5 + ignore temp6 + ignore temp7 + ignore temp8 + ignore temp9 + ignore temp10 + ignore temp11 + ignore temp12 + ignore temp13 + ignore temp14 + ignore temp15 + ignore temp16 + ignore temp17 + ignore temp18 + ignore temp19 + ignore temp20 + ignore temp21 + ignore temp22 + ignore temp23 + ignore temp24 + ignore temp25 + ignore temp26 + ignore temp27 + ignore temp28 + ignore temp29 + ignore temp30 + ignore temp31 + ignore temp32 + ignore temp33 + ignore temp34 + ignore temp35 + ignore temp36 + ignore temp37 + ignore temp38 + ignore temp39 + ignore temp40 + ignore temp41 + ignore temp42 + ignore temp43 + ignore temp44 + ignore temp45 + ignore temp46 + ignore temp47 + ignore temp48 + ignore temp49 + ignore temp50 + ignore temp51 + ignore temp52 + ignore temp53 + ignore temp54 + ignore temp55 + ignore temp56 + ignore temp57 + ignore temp58 + ignore temp59 + ignore temp60 + ignore temp61 + ignore temp62 + ignore temp63 + ignore temp64 + ignore temp65 bus "i2c-7" "i2c-1-mux (chan_id 6)" chip "tmp102-i2c-*-49" diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors.conf index b0ad1ff407b4..02f811b6c795 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors.conf @@ -8,6 +8,70 @@ bus "i2c-2" "i2c-1-mux (chan_id 1)" chip "mlxsw-i2c-*-48" label temp1 "Ambient ASIC Temp" + ignore temp2 + ignore temp3 + ignore temp4 + ignore temp5 + ignore temp6 + ignore temp7 + ignore temp8 + ignore temp9 + ignore temp10 + ignore temp11 + ignore temp12 + ignore temp13 + ignore temp14 + ignore temp15 + ignore temp16 + ignore temp17 + ignore temp18 + ignore temp19 + ignore temp20 + ignore temp21 + ignore temp22 + ignore temp23 + ignore temp24 + ignore temp25 + ignore temp26 + ignore temp27 + ignore temp28 + ignore temp29 + ignore temp30 + ignore temp31 + ignore temp32 + ignore temp33 + ignore temp34 + ignore temp35 + ignore temp36 + ignore temp37 + ignore temp38 + ignore temp39 + ignore temp40 + ignore temp41 + ignore temp42 + ignore temp43 + ignore temp44 + ignore temp45 + ignore temp46 + ignore temp47 + ignore temp48 + ignore temp49 + ignore temp50 + ignore temp51 + ignore temp52 + ignore temp53 + ignore temp54 + ignore temp55 + ignore temp56 + ignore temp57 + ignore temp58 + ignore temp59 + ignore temp60 + ignore temp61 + ignore temp62 + ignore temp63 + ignore temp64 + ignore temp65 bus "i2c-7" "i2c-1-mux (chan_id 6)" chip "tmp102-i2c-*-49" diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors.conf.a1 b/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors.conf.a1 index a0ebc677ad56..4200febc3d1e 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors.conf.a1 +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors.conf.a1 @@ -20,6 +20,70 @@ bus "i2c-2" "i2c-1-mux (chan_id 1)" chip "mlxsw-i2c-*-48" label temp1 "Ambient ASIC Temp" + ignore temp2 + ignore temp3 + ignore temp4 + ignore temp5 + ignore temp6 + ignore temp7 + ignore temp8 + ignore temp9 + ignore temp10 + ignore temp11 + ignore temp12 + ignore temp13 + ignore temp14 + ignore temp15 + ignore temp16 + ignore temp17 + ignore temp18 + ignore temp19 + ignore temp20 + ignore temp21 + ignore temp22 + ignore temp23 + ignore temp24 + ignore temp25 + ignore temp26 + ignore temp27 + ignore temp28 + ignore temp29 + ignore temp30 + ignore temp31 + ignore temp32 + ignore temp33 + ignore temp34 + ignore temp35 + ignore temp36 + ignore temp37 + ignore temp38 + ignore temp39 + ignore temp40 + ignore temp41 + ignore temp42 + ignore temp43 + ignore temp44 + ignore temp45 + ignore temp46 + ignore temp47 + ignore temp48 + ignore temp49 + ignore temp50 + ignore temp51 + ignore temp52 + ignore temp53 + ignore temp54 + ignore temp55 + ignore temp56 + ignore temp57 + ignore temp58 + ignore temp59 + ignore temp60 + ignore temp61 + ignore temp62 + ignore temp63 + ignore temp64 + ignore temp65 bus "i2c-7" "i2c-1-mux (chan_id 6)" chip "tmp102-i2c-*-49" diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors_respin.conf b/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors_respin.conf index caaa42ac04c3..4cf7b71ef80b 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors_respin.conf +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors_respin.conf @@ -19,6 +19,70 @@ bus "i2c-2" "i2c-1-mux (chan_id 1)" chip "mlxsw-i2c-*-48" label temp1 "Ambient ASIC Temp" + ignore temp2 + ignore temp3 + ignore temp4 + ignore temp5 + ignore temp6 + ignore temp7 + ignore temp8 + ignore temp9 + ignore temp10 + ignore temp11 + ignore temp12 + ignore temp13 + ignore temp14 + ignore temp15 + ignore temp16 + ignore temp17 + ignore temp18 + ignore temp19 + ignore temp20 + ignore temp21 + ignore temp22 + ignore temp23 + ignore temp24 + ignore temp25 + ignore temp26 + ignore temp27 + ignore temp28 + ignore temp29 + ignore temp30 + ignore temp31 + ignore temp32 + ignore temp33 + ignore temp34 + ignore temp35 + ignore temp36 + ignore temp37 + ignore temp38 + ignore temp39 + ignore temp40 + ignore temp41 + ignore temp42 + ignore temp43 + ignore temp44 + ignore temp45 + ignore temp46 + ignore temp47 + ignore temp48 + ignore temp49 + ignore temp50 + ignore temp51 + ignore temp52 + ignore temp53 + ignore temp54 + ignore temp55 + ignore temp56 + ignore temp57 + ignore temp58 + ignore temp59 + ignore temp60 + ignore temp61 + ignore temp62 + ignore temp63 + ignore temp64 + ignore temp65 bus "i2c-7" "i2c-1-mux (chan_id 6)" chip "tmp102-i2c-*-49" diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors_respin.conf.a1 b/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors_respin.conf.a1 index f3096b01f637..a959a7a2c3af 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors_respin.conf.a1 +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors_respin.conf.a1 @@ -19,6 +19,70 @@ bus "i2c-2" "i2c-1-mux (chan_id 1)" chip "mlxsw-i2c-*-48" label temp1 "Ambient ASIC Temp" + ignore temp2 + ignore temp3 + ignore temp4 + ignore temp5 + ignore temp6 + ignore temp7 + ignore temp8 + ignore temp9 + ignore temp10 + ignore temp11 + ignore temp12 + ignore temp13 + ignore temp14 + ignore temp15 + ignore temp16 + ignore temp17 + ignore temp18 + ignore temp19 + ignore temp20 + ignore temp21 + ignore temp22 + ignore temp23 + ignore temp24 + ignore temp25 + ignore temp26 + ignore temp27 + ignore temp28 + ignore temp29 + ignore temp30 + ignore temp31 + ignore temp32 + ignore temp33 + ignore temp34 + ignore temp35 + ignore temp36 + ignore temp37 + ignore temp38 + ignore temp39 + ignore temp40 + ignore temp41 + ignore temp42 + ignore temp43 + ignore temp44 + ignore temp45 + ignore temp46 + ignore temp47 + ignore temp48 + ignore temp49 + ignore temp50 + ignore temp51 + ignore temp52 + ignore temp53 + ignore temp54 + ignore temp55 + ignore temp56 + ignore temp57 + ignore temp58 + ignore temp59 + ignore temp60 + ignore temp61 + ignore temp62 + ignore temp63 + ignore temp64 + ignore temp65 bus "i2c-7" "i2c-1-mux (chan_id 6)" chip "tmp102-i2c-*-49" diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn4700-r0/sensors.conf index 3b19dc80c6ce..e4c6724b618f 100644 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/sensors.conf @@ -8,6 +8,38 @@ bus "i2c-2" "i2c-1-mux (chan_id 1)" chip "mlxsw-i2c-*-48" label temp1 "Ambient ASIC Temp" + ignore temp2 + ignore temp3 + ignore temp4 + ignore temp5 + ignore temp6 + ignore temp7 + ignore temp8 + ignore temp9 + ignore temp10 + ignore temp11 + ignore temp12 + ignore temp13 + ignore temp14 + ignore temp15 + ignore temp16 + ignore temp17 + ignore temp18 + ignore temp19 + ignore temp20 + ignore temp21 + ignore temp22 + ignore temp23 + ignore temp24 + ignore temp25 + ignore temp26 + ignore temp27 + ignore temp28 + ignore temp29 + ignore temp30 + ignore temp31 + ignore temp32 + ignore temp33 bus "i2c-7" "i2c-1-mux (chan_id 6)" chip "tmp102-i2c-*-49" diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/sensors.conf.a1 b/device/mellanox/x86_64-mlnx_msn4700-r0/sensors.conf.a1 index 87308be500ce..d609b4321ce2 100644 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/sensors.conf.a1 +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/sensors.conf.a1 @@ -9,6 +9,38 @@ bus "i2c-2" "i2c-1-mux (chan_id 1)" chip "mlxsw-i2c-*-48" label temp1 "Ambient ASIC Temp" + ignore temp2 + ignore temp3 + ignore temp4 + ignore temp5 + ignore temp6 + ignore temp7 + ignore temp8 + ignore temp9 + ignore temp10 + ignore temp11 + ignore temp12 + ignore temp13 + ignore temp14 + ignore temp15 + ignore temp16 + ignore temp17 + ignore temp18 + ignore temp19 + ignore temp20 + ignore temp21 + ignore temp22 + ignore temp23 + ignore temp24 + ignore temp25 + ignore temp26 + ignore temp27 + ignore temp28 + ignore temp29 + ignore temp30 + ignore temp31 + ignore temp32 + ignore temp33 bus "i2c-7" "i2c-1-mux (chan_id 6)" chip "tmp102-i2c-*-49" diff --git a/device/mellanox/x86_64-nvidia_sn2201-r0/sensors.conf b/device/mellanox/x86_64-nvidia_sn2201-r0/sensors.conf index 1c29cfd2d7b3..908ebe7c1ccd 100644 --- a/device/mellanox/x86_64-nvidia_sn2201-r0/sensors.conf +++ b/device/mellanox/x86_64-nvidia_sn2201-r0/sensors.conf @@ -70,6 +70,10 @@ bus "i2c-2" "i2c-1-mux (chan_id 4)" ignore temp47 ignore temp48 ignore temp49 + ignore temp50 + ignore temp51 + ignore temp52 + ignore temp53 bus "i2c-2" "i2c-1-mux (chan_id 0)" chip "lm75-i2c-*-4a" diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/sensors.conf b/device/mellanox/x86_64-nvidia_sn5600-r0/sensors.conf index 9180bf38da35..2a78b7cd65f2 100644 --- a/device/mellanox/x86_64-nvidia_sn5600-r0/sensors.conf +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/sensors.conf @@ -10,6 +10,71 @@ bus "i2c-39" "i2c-1-mux (chan_id 6)" # Temperature sensors chip "mlxsw-i2c-*-48" label temp1 "Ambient ASIC Temp" + ignore temp2 + ignore temp3 + ignore temp4 + ignore temp5 + ignore temp6 + ignore temp7 + ignore temp8 + ignore temp9 + ignore temp10 + ignore temp11 + ignore temp12 + ignore temp13 + ignore temp14 + ignore temp15 + ignore temp16 + ignore temp17 + ignore temp18 + ignore temp19 + ignore temp20 + ignore temp21 + ignore temp22 + ignore temp23 + ignore temp24 + ignore temp25 + ignore temp26 + ignore temp27 + ignore temp28 + ignore temp29 + ignore temp30 + ignore temp31 + ignore temp32 + ignore temp33 + ignore temp34 + ignore temp35 + ignore temp36 + ignore temp37 + ignore temp38 + ignore temp39 + ignore temp40 + ignore temp41 + ignore temp42 + ignore temp43 + ignore temp44 + ignore temp45 + ignore temp46 + ignore temp47 + ignore temp48 + ignore temp49 + ignore temp50 + ignore temp51 + ignore temp52 + ignore temp53 + ignore temp54 + ignore temp55 + ignore temp56 + ignore temp57 + ignore temp58 + ignore temp59 + ignore temp60 + ignore temp61 + ignore temp62 + ignore temp63 + ignore temp64 + ignore temp65 + ignore temp66 chip "tmp102-i2c-*-49" label temp1 "Ambient Fan Side Temp (air intake)" From ab5f9209b575ded2ec7dbd2cacfa73959f57428d Mon Sep 17 00:00:00 2001 From: Oleksandr Ivantsiv Date: Mon, 5 Feb 2024 10:26:46 -0800 Subject: [PATCH 160/419] [dhcp-server] Change the kea-dhcp4 PID file directory to tmpfs. (#17974) --- dockers/docker-dhcp-server/supervisord.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/dockers/docker-dhcp-server/supervisord.conf b/dockers/docker-dhcp-server/supervisord.conf index 73f454d7c62d..f8652a930b56 100644 --- a/dockers/docker-dhcp-server/supervisord.conf +++ b/dockers/docker-dhcp-server/supervisord.conf @@ -61,3 +61,4 @@ stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=dhcpservd:running +environment=KEA_PIDFILE_DIR=/tmp/ From f19fae59e7bcebe9d565a96ce6886d69129837ba Mon Sep 17 00:00:00 2001 From: bktsim <144830673+bktsim-arista@users.noreply.github.com> Date: Fri, 22 Dec 2023 17:10:41 -0800 Subject: [PATCH 161/419] [Arista] Remove aggregate port config files for multi-asic devices (#16923) An aggregate port_config.ini file for Arista multi-asic devices was first introduced by mistake. This PR cleans up these unnecessary files. --- .../Arista-7800R3A-36D2-C36/port_config.ini | 41 ---------- .../Arista-7800R3A-36D2-C72/port_config.ini | 77 ------------------- .../Arista-7800R3A-36D2-D36/port_config.ini | 41 ---------- 3 files changed, 159 deletions(-) delete mode 100644 device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/port_config.ini delete mode 100644 device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/port_config.ini delete mode 100644 device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/port_config.ini diff --git a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/port_config.ini b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/port_config.ini deleted file mode 100644 index 268ba635ed44..000000000000 --- a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/port_config.ini +++ /dev/null @@ -1,41 +0,0 @@ -# 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 -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-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 -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 diff --git a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/port_config.ini b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/port_config.ini deleted file mode 100644 index d23b2070d409..000000000000 --- a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/port_config.ini +++ /dev/null @@ -1,77 +0,0 @@ -# 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 -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-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 -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 diff --git a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/port_config.ini b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/port_config.ini deleted file mode 100644 index 37a8915cf32e..000000000000 --- a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/port_config.ini +++ /dev/null @@ -1,41 +0,0 @@ -# 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 -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-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 -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 From 941b541baa4c1731b2e242daf73fec1030aacb7d Mon Sep 17 00:00:00 2001 From: Dror Prital <76714716+dprital@users.noreply.github.com> Date: Tue, 20 Feb 2024 18:54:53 +0200 Subject: [PATCH 162/419] [Build] Fix krb5 package not found issue (#18135) --- platform/vs/docker-sonic-vs.mk | 4 ++++ platform/vs/docker-sonic-vs/Dockerfile.j2 | 9 +++++++-- rules/sonic-fips.mk | 12 ++++++++++-- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/platform/vs/docker-sonic-vs.mk b/platform/vs/docker-sonic-vs.mk index 18b1e92cf58c..dfcff23a566e 100644 --- a/platform/vs/docker-sonic-vs.mk +++ b/platform/vs/docker-sonic-vs.mk @@ -34,6 +34,10 @@ else $(DOCKER_SONIC_VS)_DEPENDS += $(GOBGP) endif +ifeq ($(INCLUDE_FIPS), y) +$(DOCKER_SONIC_VS)_DEPENDS += $(FIPS_KRB5_ALL) +endif + $(DOCKER_SONIC_VS)_FILES += $(CONFIGDB_LOAD_SCRIPT) \ $(ARP_UPDATE_SCRIPT) \ $(ARP_UPDATE_VARS_TEMPLATE) \ diff --git a/platform/vs/docker-sonic-vs/Dockerfile.j2 b/platform/vs/docker-sonic-vs/Dockerfile.j2 index 20f87d19f146..a82a8abbc2f2 100644 --- a/platform/vs/docker-sonic-vs/Dockerfile.j2 +++ b/platform/vs/docker-sonic-vs/Dockerfile.j2 @@ -38,7 +38,6 @@ RUN apt-get install -y net-tools \ iptables \ jq \ libzmq5 \ - libzmq3-dev \ uuid-dev \ # For installing Python m2crypto package # (these can be uninstalled after installation) @@ -64,7 +63,11 @@ RUN apt-get install -y net-tools \ libasan6 \ {%- endif %} dbus \ - redis-server + redis-server\ + # For libkrb5-dev + comerr-dev \ + libgssrpc4 \ + libkdb5-10 # For sonic-config-engine Python 3 package # Install pyangbind here, outside sonic-config-engine dependencies, as pyangbind causes enum34 to be installed. @@ -88,6 +91,8 @@ COPY {%- for deb in docker_sonic_vs_debs.split(' ') %} debs/{{ deb }}{%- endfor RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; }; {%- for deb in docker_sonic_vs_debs.split(' ') %} dpkg_apt /debs/{{ deb }};{%- endfor %} {%- endif %} +RUN apt-get install -y libzmq3-dev + {% if docker_sonic_vs_pydebs.strip() -%} # Copy locally-built Debian package dependencies COPY {%- for deb in docker_sonic_vs_pydebs.split(' ') %} python-debs/{{ deb }}{%- endfor %} /debs/ diff --git a/rules/sonic-fips.mk b/rules/sonic-fips.mk index d44bf627cf5d..3ce37224bf64 100644 --- a/rules/sonic-fips.mk +++ b/rules/sonic-fips.mk @@ -7,7 +7,7 @@ FIPS_PYTHON_MAIN_VERSION = 3.9 FIPS_PYTHON_VERSION = 3.9.2-1+fips FIPS_GOLANG_MAIN_VERSION = 1.15 FIPS_GOLANG_VERSION = 1.15.15-1~deb11u4+fips -FIPS_KRB5_VERSION = 1.18.3-6+deb11u14+fips +FIPS_KRB5_VERSION = 1.18.3-6+deb11u4+fips FIPS_URL_PREFIX = https://sonicstorage.blob.core.windows.net/public/fips/$(BLDENV)/$(FIPS_VERSION)/$(CONFIGURED_ARCH) SYMCRYPT_OPENSSL_NAME = symcrypt-openssl @@ -40,7 +40,15 @@ FIPS_GOLANG_DOC = golang-$(FIPS_GOLANG_MAIN_VERSION)-doc_$(FIPS_GOLANG_VERSION)_ FIPS_GOLANG_ALL = $(FIPS_GOLANG) $(FIPS_GOLANG_GO) $(FIPS_GOLANG_SRC) $(FIPS_GOLANG_DOC) FIPS_KRB5 = libk5crypto3_$(FIPS_KRB5_VERSION)_$(CONFIGURED_ARCH).deb -FIPS_KRB5_ALL = $(FIPS_KRB5) +FIPS_KRB5_SUPPORT0 = libkrb5support0_$(FIPS_KRB5_VERSION)_$(CONFIGURED_ARCH).deb +FIPS_KRB5_3 = libkrb5-3_$(FIPS_KRB5_VERSION)_$(CONFIGURED_ARCH).deb +FIPS_KRB5_LIBGSSAPI = libgssapi-krb5-2_$(FIPS_KRB5_VERSION)_$(CONFIGURED_ARCH).deb +FIPS_KRB5_LIBKADM5CLNT = libkadm5clnt-mit12_$(FIPS_KRB5_VERSION)_$(CONFIGURED_ARCH).deb +FIPS_KRB5_LIBKADM5SRV = libkadm5srv-mit12_$(FIPS_KRB5_VERSION)_$(CONFIGURED_ARCH).deb +FIPS_KRB5_LIBGSSRPC4 = libgssrpc4_$(FIPS_KRB5_VERSION)_$(CONFIGURED_ARCH).deb +FIPS_KRB5_MULTIDEV = krb5-multidev_$(FIPS_KRB5_VERSION)_$(CONFIGURED_ARCH).deb +FIPS_KRB5_DEV = libkrb5-dev_$(FIPS_KRB5_VERSION)_$(CONFIGURED_ARCH).deb +FIPS_KRB5_ALL = $(FIPS_KRB5) $(FIPS_KRB5_SUPPORT0) $(FIPS_KRB5_3) $(FIPS_KRB5_LIBGSSAPI) $(FIPS_KRB5_LIBKADM5CLNT) $(FIPS_KRB5_LIBKADM5SRV) $(FIPS_KRB5_LIBGSSRPC4) $(FIPS_KRB5_MULTIDEV) $(FIPS_KRB5_DEV) FIPS_DERIVED_TARGET = $(FIPS_OPENSSL_ALL) $(FIPS_OPENSSH_ALL) $(FIPS_GOLANG_ALL) $(FIPS_PYTHON_ALL) $(FIPS_KRB5_ALL) FIPS_PACKAGE_ALL = $(SYMCRYPT_OPENSSL) $(FIPS_DERIVED_TARGET) From 1a01724845640b307adb6de88f920d6317ae2191 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 22 Feb 2024 02:45:29 +0800 Subject: [PATCH 163/419] [submodule] Update submodule sonic-sairedis to the latest HEAD automatically (#18140) src/sonic-sairedis * 5c05e23 - (HEAD -> 202311, origin/202311) [SAI] Move SAI submodule to v1.13.3 (#1349) (2 hours ago) [Kamil Cudnik] --- src/sonic-sairedis | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-sairedis b/src/sonic-sairedis index 23481f0d8d8d..5c05e23a1b9f 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit 23481f0d8d8d8f07f333d605010faaeb8920b836 +Subproject commit 5c05e23a1b9ffcccc7c1c3ea26d37aa8fe79fc75 From ab117b655e30aa3faf04c5df3120725a687f100a Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 22 Feb 2024 02:46:04 +0800 Subject: [PATCH 164/419] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#18141) src/sonic-swss * d322f660 - (HEAD -> 202311, origin/202311) Fix memory leak and object copying bugs in orchagent (#3017) (4 hours ago) [Saikrishna Arcot] --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 2910b0e3b484..d322f660acbf 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 2910b0e3b484fe97bad22554a38b0ad378fef3dd +Subproject commit d322f660acbfc6b308875e35ad9f10ed70657355 From d658e7847db0bc07fe7abc2942b85a4ecc045e95 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 22 Feb 2024 02:46:28 +0800 Subject: [PATCH 165/419] [ci/build]: Upgrade SONiC package versions (#18142) --- .../versions-deb-bullseye | 35 ++--- files/build/versions/default/versions-docker | 24 +-- files/build/versions/default/versions-git | 12 +- files/build/versions/default/versions-mirror | 24 +-- files/build/versions/default/versions-web | 140 ++++++++++-------- .../versions-deb-bullseye | 10 +- .../versions-deb-bullseye-arm64 | 6 +- .../versions-deb-bullseye-armhf | 6 +- .../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 | 8 +- .../versions-deb-bullseye | 2 +- .../docker-gbsyncd-vs/versions-deb-bullseye | 2 +- .../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-bullseye | 2 +- .../docker-orchagent/versions-deb-bullseye | 2 +- .../versions-deb-bullseye | 20 +-- .../docker-platform-monitor/versions-py3 | 2 +- .../versions-deb-bullseye | 2 +- .../docker-sflow/versions-deb-bullseye | 2 +- .../dockers/docker-snmp/versions-deb-bullseye | 6 +- .../docker-sonic-gnmi/versions-deb-bullseye | 2 +- .../docker-sonic-vs/versions-deb-bullseye | 25 ++-- .../versions-deb-bullseye | 8 +- .../versions-deb-bullseye | 2 +- .../versions-deb-bullseye | 8 +- .../docker-syncd-brcm/versions-deb-bullseye | 2 +- .../versions-deb-bullseye | 8 +- .../docker-syncd-centec/versions-deb-bullseye | 2 +- .../versions-deb-bullseye | 3 +- .../docker-syncd-mlnx-rpc/versions-py3 | 5 + .../docker-syncd-mlnx/versions-deb-bullseye | 46 +++--- .../dockers/docker-syncd-mlnx/versions-py3 | 2 +- .../versions-deb-bullseye-armhf | 2 +- .../docker-syncd-vs/versions-deb-bullseye | 2 +- .../docker-teamd/versions-deb-bullseye | 2 +- .../versions-deb-bullseye | 104 ++++++------- .../versions-deb-bullseye-arm64 | 4 +- .../versions-deb-bullseye-armhf | 6 +- .../dockers/sonic-slave-bullseye/versions-py3 | 2 +- .../sonic-slave-buster/versions-deb-buster | 36 ++--- .../versions-deb-buster-armhf | 4 - .../host-base-image/versions-deb-bullseye | 14 +- .../versions/host-image/versions-deb-bullseye | 27 ++-- .../host-image/versions-deb-bullseye-arm64 | 6 +- .../host-image/versions-deb-bullseye-armhf | 6 +- .../host-image/versions-py3-all-armhf | 4 +- 51 files changed, 335 insertions(+), 316 deletions(-) create mode 100644 files/build/versions/dockers/docker-syncd-mlnx-rpc/versions-py3 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 44d0d52079a0..8c2a81ad5b27 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,5 +1,6 @@ -applibs==1.mlnx.4.6.1062 -applibs-dev==1.mlnx.4.6.1062 +applibs==1.mlnx.4.6.2202 +applibs-dev==1.mlnx.4.6.2202 +debootstrap==1.0.123+deb11u1 kernel-mft-dkms==4.25.0-62 libdashapi==1.0.0 libnl-3-dev==3.5.0-1 @@ -46,19 +47,19 @@ sonic-mgmt-common==1.0.0 sonic-mgmt-common-codegen==1.0.0 sonic-platform-pddf==1.1 sonic-platform-pddf-sym==1.1 -sx-acl-helper==1.mlnx.4.6.1062 -sx-acl-helper-dev==1.mlnx.4.6.1062 -sx-complib==1.mlnx.4.6.1062 -sx-complib-dev==1.mlnx.4.6.1062 -sx-examples==1.mlnx.4.6.1062 -sx-examples-dev==1.mlnx.4.6.1062 -sx-gen-utils==1.mlnx.4.6.1062 -sx-gen-utils-dev==1.mlnx.4.6.1062 -sx-hash-calc==1.mlnx.4.6.1062 -sx-obj-desc-lib==1.mlnx.4.6.1062 -sx-obj-desc-lib-dev==1.mlnx.4.6.1062 -sxd-libs==1.mlnx.4.6.1062 -sxd-libs-dev==1.mlnx.4.6.1062 +sx-acl-helper==1.mlnx.4.6.2202 +sx-acl-helper-dev==1.mlnx.4.6.2202 +sx-complib==1.mlnx.4.6.2202 +sx-complib-dev==1.mlnx.4.6.2202 +sx-examples==1.mlnx.4.6.2202 +sx-examples-dev==1.mlnx.4.6.2202 +sx-gen-utils==1.mlnx.4.6.2202 +sx-gen-utils-dev==1.mlnx.4.6.2202 +sx-hash-calc==1.mlnx.4.6.2202 +sx-obj-desc-lib==1.mlnx.4.6.2202 +sx-obj-desc-lib-dev==1.mlnx.4.6.2202 +sxd-libs==1.mlnx.4.6.2202 +sxd-libs-dev==1.mlnx.4.6.2202 thrift-compiler==0.11.0-4 -wjh-libs==1.mlnx.4.6.1062 -wjh-libs-dev==1.mlnx.4.6.1062 +wjh-libs==1.mlnx.4.6.2202 +wjh-libs-dev==1.mlnx.4.6.2202 diff --git a/files/build/versions/default/versions-docker b/files/build/versions/default/versions-docker index fc59b073223c..88abfc7d1901 100644 --- a/files/build/versions/default/versions-docker +++ b/files/build/versions/default/versions-docker @@ -1,12 +1,12 @@ -amd64:amd64/debian:bullseye==sha256:4cb3f4198e4af2d03dffe6bfa4f3686773596494ef298f3882553d52e885634b -amd64:amd64/debian:buster==sha256:d39357a2a8840e450e387df33a5aaf8f0c8f99e388a0e18169f3dd240fc2393d -amd64:debian:bullseye==sha256:71cb300d5448af821aedfe63afd55ba05f45a6a79f00dcd131b96b780bb99fe4 -amd64:debian:buster==sha256:defa5d214292f2aaf7905d3e4bcdf8f628019feb63e7c8746df563d1a941f8d7 -arm64:arm64v8/debian:bullseye==sha256:c4a762841d008c85d809f0981c47e2a490c43483e4a169e17afa2dc83d18b2b1 -arm64:arm64v8/debian:buster==sha256:7d6cb4b56f1230b8692ed0c5fa5fa838ddd7ebd436a6463a6e9b29d1aa4c6e24 -arm64:debian:bullseye==sha256:71cb300d5448af821aedfe63afd55ba05f45a6a79f00dcd131b96b780bb99fe4 -arm64:debian:buster==sha256:defa5d214292f2aaf7905d3e4bcdf8f628019feb63e7c8746df563d1a941f8d7 -armhf:arm32v7/debian:bullseye==sha256:70dcc7f2c51acbeaff85f700d9c1ef936371e60bdec8da15729c19503ef1fb8f -armhf:arm32v7/debian:buster==sha256:d984bf6bd66a53445e82ca3e6ae8d3c40a866c053339acfd5f3fa705a7092b90 -armhf:debian:bullseye==sha256:71cb300d5448af821aedfe63afd55ba05f45a6a79f00dcd131b96b780bb99fe4 -armhf:debian:buster==sha256:defa5d214292f2aaf7905d3e4bcdf8f628019feb63e7c8746df563d1a941f8d7 +amd64:amd64/debian:bullseye==sha256:2d2786922ceb0b2c5172e2fee1f0c83bc045afc6d96574305fc74bb8300f75de +amd64:amd64/debian:buster==sha256:e3e2e6c8da3feadd6298d517dfe5ae0c768106b89677cd4cbdfd3806441c5d4b +amd64:debian:bullseye==sha256:171478fbe347a3cfe45058dae333b6ed848fd8ce89f3104c89fa94c245086db1 +amd64:debian:buster==sha256:a52d4e1c201d9ab2f3b939b91a3fdd345d3d11404755bc1cdb22c1d5be131c5d +arm64:arm64v8/debian:bullseye==sha256:2dbcc03931d08f46fbdc0e6fadc83fe2d55787210fea8625449fb64f7de67c8f +arm64:arm64v8/debian:buster==sha256:32c61e9a1b9f7f06a6093bb0749b10159255fe347f0e0531741814c710d5bbbf +arm64:debian:bullseye==sha256:171478fbe347a3cfe45058dae333b6ed848fd8ce89f3104c89fa94c245086db1 +arm64:debian:buster==sha256:a52d4e1c201d9ab2f3b939b91a3fdd345d3d11404755bc1cdb22c1d5be131c5d +armhf:arm32v7/debian:bullseye==sha256:e186179ddb52086b96d93a4621f1d9244ec87011732583d91061a6908bf9bb41 +armhf:arm32v7/debian:buster==sha256:ad22861172e9d868ff5717417d832714caf0d6efd55e622e3298572dcd5bc367 +armhf:debian:bullseye==sha256:171478fbe347a3cfe45058dae333b6ed848fd8ce89f3104c89fa94c245086db1 +armhf:debian:buster==sha256:a52d4e1c201d9ab2f3b939b91a3fdd345d3d11404755bc1cdb22c1d5be131c5d diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index fa9475088026..2ccddf027307 100644 --- a/files/build/versions/default/versions-git +++ b/files/build/versions/default/versions-git @@ -1,23 +1,23 @@ -https://chromium.googlesource.com/chromium/tools/depot_tools.git==10bd39fd47865eb6c9af749e4d30e8ec5d06451f +https://chromium.googlesource.com/chromium/tools/depot_tools.git==7dc148fe3ca0df5a010cfb3b2fcaa9ea2b48e92d https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f https://github.com/CESNET/libyang.git==fc4dbd923e044006c93df020590a1e5a8656c09e 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==a21be9153abe50ae26cd833db62d9493e7eadf54 -https://github.com/FreeRADIUS/freeradius-server.git==6a5e992ac04edffec92ae1d3408e71dcb0ed7896 +https://github.com/flashrom/flashrom.git==56bb56d8e3b8eb059c50041040a6db7b44bfab77 +https://github.com/FreeRADIUS/freeradius-server.git==82ffbf0e5cb332632afabd6f4be1afc00d4659b1 https://github.com/FreeRADIUS/pam_radius.git==53c0cfff686ab48ae3bac5449d5461b6e1b83d27 https://github.com/jeroennijhof/pam_tacplus.git==b89dba44b58ec7fdc9b5365b982aa4a316484a3c https://github.com/jpirko/libteam.git==8b843e93cee1dab61fb79b01791201cdad45e1d1 https://github.com/lguohan/gnxi.git==3adf8b97755b49947e465b5a14645f11e79fa0cd -https://github.com/Marvell-switching/mrvl-prestera.git==22ac73bff81451571002df88e5a39cf390a4d8cd +https://github.com/Marvell-switching/mrvl-prestera.git==b7a14a93b21c099fab6b53f5fc4917ca0eb9b6c9 https://github.com/Mellanox/libpsample.git==62bb27d9a49424e45191eee81df7ce0d8c74e774 https://github.com/p4lang/ptf.git==e8b545f3f281fc509c7bdd6c8a4f55bc829149e7 https://github.com/p4lang/scapy-vxlan.git==85ffe83da156568ee47a0750f638227e6e1d7479 https://github.com/sflow/host-sflow==2d9d73c2937577116f679b245bdfc098dbe459d7 https://github.com/sflow/sflowtool==c1eeb55ad6bfd76283833614a8296f635627e1db -https://github.com/thom311/libnl==8693347fe9c47d08ce5899602ab4f208c1249619 +https://github.com/thom311/libnl==b76c3a5d9a0e421fe6cb0e89cceb70ae15b57695 https://salsa.debian.org/debian/libteam.git==48142125234a665ad5367b724af36a58fb484d3d https://salsa.debian.org/kernel-team/initramfs-tools.git==cf964bfb4362019fd7fba1e839e403ff950dca8e https://salsa.debian.org/sk-guest/monit.git==c9da7ebb1f35dfba17b50b5969a6e75e29cbec0d -https://salsa.debian.org/ssh-team/openssh.git==1d67ef8053a0ea5e9a57c0e6ad33604d17e95456 +https://salsa.debian.org/ssh-team/openssh.git==b9671cc74475922fa61e9ebdba56ec84446d19ac diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index c98c4752ff7a..d6150f6f8140 100644 --- a/files/build/versions/default/versions-mirror +++ b/files/build/versions/default/versions-mirror @@ -1,14 +1,14 @@ 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==20240130T000231Z -debian-security==20240130T000229Z -download.docker.com_linux_debian_dists_bullseye==2024-01-30T14:03:31Z -download.docker.com_linux_debian_dists_buster==2024-01-25T21:46:24Z -packages.trafficmanager.net_snapshot_debian-security_20240130T000229Z_dists_bullseye-security==2024-01-29T21:14:47Z -packages.trafficmanager.net_snapshot_debian-security_20240130T000229Z_dists_buster_updates==2024-01-29T21:14:48Z -packages.trafficmanager.net_snapshot_debian_20240130T000231Z_dists_bullseye==2023-10-07T11:07:16Z -packages.trafficmanager.net_snapshot_debian_20240130T000231Z_dists_bullseye-backports==2024-01-29T20:18:02Z -packages.trafficmanager.net_snapshot_debian_20240130T000231Z_dists_bullseye-updates==2024-01-29T20:18:02Z -packages.trafficmanager.net_snapshot_debian_20240130T000231Z_dists_buster==2023-06-10T08:53:33Z -packages.trafficmanager.net_snapshot_debian_20240130T000231Z_dists_buster-backports==2024-01-29T20:18:02Z -packages.trafficmanager.net_snapshot_debian_20240130T000231Z_dists_buster-updates==2023-06-10T08:55:10Z +debian==20240220T000244Z +debian-security==20240220T000150Z +download.docker.com_linux_debian_dists_bullseye==2024-02-09T13:28:39Z +download.docker.com_linux_debian_dists_buster==2024-02-06T23:41:14Z +packages.trafficmanager.net_snapshot_debian-security_20240220T000150Z_dists_bullseye-security==2024-02-19T01:02:40Z +packages.trafficmanager.net_snapshot_debian-security_20240220T000150Z_dists_buster_updates==2024-02-19T01:02:41Z +packages.trafficmanager.net_snapshot_debian_20240220T000244Z_dists_bullseye==2024-02-10T12:40:37Z +packages.trafficmanager.net_snapshot_debian_20240220T000244Z_dists_bullseye-backports==2024-02-19T20:20:34Z +packages.trafficmanager.net_snapshot_debian_20240220T000244Z_dists_bullseye-updates==2024-02-19T20:20:34Z +packages.trafficmanager.net_snapshot_debian_20240220T000244Z_dists_buster==2023-06-10T08:53:33Z +packages.trafficmanager.net_snapshot_debian_20240220T000244Z_dists_buster-backports==2024-02-19T20:20:34Z +packages.trafficmanager.net_snapshot_debian_20240220T000244Z_dists_buster-updates==2023-06-10T08:55:10Z diff --git a/files/build/versions/default/versions-web b/files/build/versions/default/versions-web index 7ea236132906..1da9bf76db10 100644 --- a/files/build/versions/default/versions-web +++ b/files/build/versions/default/versions-web @@ -17,7 +17,7 @@ http://deb.debian.org/debian/pool/main/n/ntp/ntp_4.2.8p15+dfsg.orig.tar.xz==c1c5 http://deb.debian.org/debian/pool/main/p/protobuf/protobuf_3.21.12-3.debian.tar.xz==f457e44218a7d4cc7b7ab0ed696096e3 http://deb.debian.org/debian/pool/main/p/protobuf/protobuf_3.21.12-3.dsc==d8e34e7b07473c6903f9d245934524fb http://deb.debian.org/debian/pool/main/p/protobuf/protobuf_3.21.12.orig.tar.gz==d38562490234d8080bdbe8eb7baf937a -http://ftp.us.debian.org/debian/pool/main/s/scapy/python-scapy_2.4.0-2_all.deb==d87d7b22de51937b1e706e4751b86251 +http://ftp.us.debian.org/debian/pool/main/s/scapy/python3-scapy_2.4.0-2_all.deb==b8717ca83b3b60da54bc3f72018964a7 http://www.mellanox.com/downloads/MFT/mft-4.25.0-62-x86_64-deb.tgz==658a7f7170f6798c98ef8b8045c70f0d 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 @@ -41,31 +41,31 @@ https://github.com/CentecNetworks/sonic-binaries/raw/master/arm64/sai/libsaictc- https://github.com/CentecNetworks/sonic-binaries/raw/master/arm64/sai/libsaictc_1.13.0-1_arm64.deb==b8b25694a1dc9b4d8dffc2f2c04ddaed 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.12.0-2_armhf.deb==944790bf2d262144cfd939b2caeda1b1 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2012.1062/fw-SPC-rel-13_2012_1062-EVB.mfa==ded5ea46c37ba564a29e306ad233a83c -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2012.1062/fw-SPC2-rel-29_2012_1062-EVB.mfa==74700208646225d39afff0154642648a -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2012.1062/fw-SPC3-rel-30_2012_1062-EVB.mfa==3de91549a489dc45250e3e1ca11b74e3 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2012.1062/fw-SPC4-rel-34_2012_1062-EVB.mfa==1af0b2946674351bc262f1650ab73b89 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sai-SAIBuild2211.25.1.4-bullseye-amd64/mlnx-sai-dbgsym_1.mlnx.SAIBuild2211.25.1.4_amd64.deb==084c7e47eab2663dbc92d920b13062ee -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sai-SAIBuild2211.25.1.4-bullseye-amd64/mlnx-sai_1.mlnx.SAIBuild2211.25.1.4_amd64.deb==d5f99501d798fddbf055442b7a9825c9 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.1062-bullseye-amd64/applibs-dev_1.mlnx.4.6.1062_amd64.deb==896c56aee293b11b353f6bbe39e12c97 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.1062-bullseye-amd64/applibs_1.mlnx.4.6.1062_amd64.deb==990fc6f36b5d9656b93b602666b713d9 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.1062-bullseye-amd64/python-sdk-api_1.mlnx.4.6.1062_amd64.deb==ed5a3d066bd74e9e503c0e675f303967 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.1062-bullseye-amd64/sx-acl-helper-dev_1.mlnx.4.6.1062_amd64.deb==527ef92f811c9bd68bc9c2fd2e92a9fe -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.1062-bullseye-amd64/sx-acl-helper_1.mlnx.4.6.1062_amd64.deb==b5efc17b478d203d832a3c6c6b89cc74 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.1062-bullseye-amd64/sx-complib-dev_1.mlnx.4.6.1062_amd64.deb==8f937c5035bc6f3b003d9655bf04d3aa -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.1062-bullseye-amd64/sx-complib_1.mlnx.4.6.1062_amd64.deb==5a82968a18755dddcd476475b1b13344 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.1062-bullseye-amd64/sx-examples-dev_1.mlnx.4.6.1062_amd64.deb==4fc8aba54ec8510d36d063bb12757476 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.1062-bullseye-amd64/sx-examples_1.mlnx.4.6.1062_amd64.deb==f47378440b4fb5561d53e30503d13915 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.1062-bullseye-amd64/sx-gen-utils-dev_1.mlnx.4.6.1062_amd64.deb==91b0eebf60c1951f69445280d4e6c4bd -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.1062-bullseye-amd64/sx-gen-utils_1.mlnx.4.6.1062_amd64.deb==7297619bd83b02e79c710f5b5fa49eda -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.1062-bullseye-amd64/sx-hash-calc_1.mlnx.4.6.1062_amd64.deb==9a60e92d1ce28007121ac68eacee0496 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.1062-bullseye-amd64/sx-obj-desc-lib-dev_1.mlnx.4.6.1062_amd64.deb==e13879a8469e37340e9907cdd45b8e16 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.1062-bullseye-amd64/sx-obj-desc-lib_1.mlnx.4.6.1062_amd64.deb==506e2dd46f2143cf18803a0da67a6ff3 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.1062-bullseye-amd64/sxd-libs-dev_1.mlnx.4.6.1062_amd64.deb==1fdfde8b32074b946acfd081c0e1271b -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.1062-bullseye-amd64/sxd-libs_1.mlnx.4.6.1062_amd64.deb==02738041bcf511e6b789c75cb733f7ae -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.1062-bullseye-amd64/wjh-libs-dev_1.mlnx.4.6.1062_amd64.deb==e9ac3327a9c40ed51a6eacfb33ea6c21 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.1062-bullseye-amd64/wjh-libs_1.mlnx.4.6.1062_amd64.deb==26f396720661ba2ce50b7ad0a5f61d71 -https://github.com/Mellanox/Spectrum-SDK-Drivers/archive/refs/heads/4.6.1062.zip==b688b23ed6c55fe2436e8928dea0c3b0 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2012.2202/fw-SPC-rel-13_2012_2202-EVB.mfa==a77569575da124cdcee7d9b4f09dc5f2 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2012.2202/fw-SPC2-rel-29_2012_2202-EVB.mfa==5b1138d4f422eebfdabb17ef15dd9d4b +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2012.2202/fw-SPC3-rel-30_2012_2202-EVB.mfa==006291d10adf09b230ee20317b984379 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2012.2202/fw-SPC4-rel-34_2012_2202-EVB.mfa==99205ae3ecd7f7bab2fd2e5657abd974 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sai-SAIBuild2311.26.0.28-bullseye-amd64/mlnx-sai-dbgsym_1.mlnx.SAIBuild2311.26.0.28_amd64.deb==a54897d02becbfa8e3b57e89d80b1a66 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sai-SAIBuild2311.26.0.28-bullseye-amd64/mlnx-sai_1.mlnx.SAIBuild2311.26.0.28_amd64.deb==dc93d3163e4acd4876de7c4b39175b26 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/applibs-dev_1.mlnx.4.6.2202_amd64.deb==ebfd6c3fc04ffa476a1dce5b66d44596 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/applibs_1.mlnx.4.6.2202_amd64.deb==2acd562c1c28cd373c35bd2f66301339 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/python-sdk-api_1.mlnx.4.6.2202_amd64.deb==69e6543617825b2dbd1a6191ca5cff8e +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/sx-acl-helper-dev_1.mlnx.4.6.2202_amd64.deb==9cc5b35e0a0630b0a8f639cdc039c3c1 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/sx-acl-helper_1.mlnx.4.6.2202_amd64.deb==5187fca944b21b2859e800b39871ddc0 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/sx-complib-dev_1.mlnx.4.6.2202_amd64.deb==1cab8319bdc99a1d620adf3f855affa2 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/sx-complib_1.mlnx.4.6.2202_amd64.deb==2644363c7f0b8832e05329c86c6e9164 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/sx-examples-dev_1.mlnx.4.6.2202_amd64.deb==637b81546cd1bf9dd6cb0f42f3fce846 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/sx-examples_1.mlnx.4.6.2202_amd64.deb==b7cabdf4c84e1cab8a34796e3fe47058 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/sx-gen-utils-dev_1.mlnx.4.6.2202_amd64.deb==7410da8e7603d48378b6d0b8a6a19fed +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/sx-gen-utils_1.mlnx.4.6.2202_amd64.deb==271db53cba7c0bab35599113b8134fce +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/sx-hash-calc_1.mlnx.4.6.2202_amd64.deb==d997b3a9adfa0fa5aef34414d4bc94c9 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/sx-obj-desc-lib-dev_1.mlnx.4.6.2202_amd64.deb==c61007a50d203f0d08cd905909255ef7 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/sx-obj-desc-lib_1.mlnx.4.6.2202_amd64.deb==3ef17ef44493ab90629b5c3a9d39b2cb +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/sxd-libs-dev_1.mlnx.4.6.2202_amd64.deb==fe94691ba8da67928faa50e618242848 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/sxd-libs_1.mlnx.4.6.2202_amd64.deb==d6bb87c432d60d656ad053b9b1d42e44 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/wjh-libs-dev_1.mlnx.4.6.2202_amd64.deb==984e5be1dbb1fb1ab8c15e57eaa979d6 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/wjh-libs_1.mlnx.4.6.2202_amd64.deb==aa1e61b1d91de49c170079ea5b2fca19 +https://github.com/Mellanox/Spectrum-SDK-Drivers/archive/refs/heads/4.6.2202.zip==2d839bdb59974f4018e10296af2a147a 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 @@ -107,42 +107,58 @@ https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.1/amd64/golang https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.1/amd64/golang-1.15-src_1.15.15-1~deb11u4%2Bfips_amd64.deb==1c920937aa49b602a1bfec3c49747131 https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.1/arm64/golang-1.15-go_1.15.15-1~deb11u4%2Bfips_arm64.deb==0b70c104b907db13ff2fe5d52b3d0008 https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.1/arm64/golang-1.15-src_1.15.15-1~deb11u4%2Bfips_arm64.deb==1d06900f03424fa5ce34a782605983fe -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/amd64/golang-1.15-doc_1.15.15-1~deb11u4+fips_all.deb==72ead09139135d4ecd91b76c89128567 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/amd64/golang-1.15-go_1.15.15-1~deb11u4+fips_amd64.deb==145e103357a915cc759cc93de602b631 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/amd64/golang-1.15-src_1.15.15-1~deb11u4+fips_amd64.deb==1c1a46d5599be92777702643c37d5751 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/amd64/golang-1.15_1.15.15-1~deb11u4+fips_all.deb==847bc1fc5ce9c8ebae5176947ab34d30 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/amd64/libk5crypto3_1.18.3-6+deb11u1+fips_amd64.deb==5e8de29d5f6844f71f15cbf0c3993f1c -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/amd64/libpython3.9-minimal_3.9.2-1+fips_amd64.deb==e47afaa81099fa2949a2dce75cffb6da -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/amd64/libpython3.9-stdlib_3.9.2-1+fips_amd64.deb==ab079d683259b241186cc1b3c68f3d73 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/amd64/libpython3.9_3.9.2-1+fips_amd64.deb==c405132eacaf059c7c903f853d48be7e -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/amd64/libssl-dev_1.1.1n-0+deb11u5+fips_amd64.deb==7deccb6cb0197bd9dc257d54505533cf -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/amd64/libssl-doc_1.1.1n-0+deb11u5+fips_all.deb==3ac7462c370d85e42c03b11d26f35016 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/amd64/libssl1.1_1.1.1n-0+deb11u5+fips_amd64.deb==6a4505b82957d711e983e03364275521 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/amd64/openssh-client_8.4p1-5+deb11u2+fips_amd64.deb==1fb734b040398b0fb9c674385253b993 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/amd64/openssh-server_8.4p1-5+deb11u2+fips_amd64.deb==8ec9f1fbfedd6c36312c5181d9950b58 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/amd64/openssh-sftp-server_8.4p1-5+deb11u2+fips_amd64.deb==02e8be0633aff33497655261256eadca -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/amd64/openssl_1.1.1n-0+deb11u5+fips_amd64.deb==ee086d7e1fb0cfd36513ec242381af53 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/amd64/python3.9-minimal_3.9.2-1+fips_amd64.deb==44c28ede910f014efc84118bc8a4b73c -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/amd64/python3.9_3.9.2-1+fips_amd64.deb==30be224443931a2a3428aa270b87384a -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/amd64/symcrypt-openssl_0.9_amd64.deb==9095ce7fd2283806f0c3ce8a60d36ad2 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/golang-1.15-doc_1.15.15-1~deb11u4+fips_all.deb==72ead09139135d4ecd91b76c89128567 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/golang-1.15-go_1.15.15-1~deb11u4+fips_arm64.deb==b59f315800ca2ec31de79136dfb8979d -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/golang-1.15-src_1.15.15-1~deb11u4+fips_arm64.deb==0038c68ed1e3adb1b43434af81cff678 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/golang-1.15_1.15.15-1~deb11u4+fips_all.deb==847bc1fc5ce9c8ebae5176947ab34d30 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/libk5crypto3_1.18.3-6+deb11u1+fips_arm64.deb==0bb2a2d23f73e882d91b2e256aad08f6 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/libpython3.9-minimal_3.9.2-1+fips_arm64.deb==7e6ac5f9bce1ecd59532ed669040436d -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/libpython3.9-stdlib_3.9.2-1+fips_arm64.deb==1b86a9d8bafe7cddc484f4ac1010ee07 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/libpython3.9_3.9.2-1+fips_arm64.deb==edae5c269e2c401873e7cff3d4f93a7a -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/libssl-dev_1.1.1n-0+deb11u5+fips_arm64.deb==2116b0e949a521b02098f01aee5a33d4 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/libssl-doc_1.1.1n-0+deb11u5+fips_all.deb==3ac7462c370d85e42c03b11d26f35016 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/libssl1.1_1.1.1n-0+deb11u5+fips_arm64.deb==a6a6a6f2d23d91398f44570da6e2e80c -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/openssh-client_8.4p1-5+deb11u2+fips_arm64.deb==b30c745ca94e392740c67225802e9068 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/openssh-server_8.4p1-5+deb11u2+fips_arm64.deb==8ab6d9e3bac9d486bda5664e40f634ef -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/openssh-sftp-server_8.4p1-5+deb11u2+fips_arm64.deb==73c51fa8f165a014571c2bdbd843c517 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/openssl_1.1.1n-0+deb11u5+fips_arm64.deb==5c16b501e97678e7f55c616afa6423bb -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/python3.9-minimal_3.9.2-1+fips_arm64.deb==3ea50a9bb61102b7e2ffe8f7b79c3d5f -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/python3.9_3.9.2-1+fips_arm64.deb==4d6307dabcd3060235d6188cfa0346b8 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.9/arm64/symcrypt-openssl_0.9_arm64.deb==5138fe3d77f84c995ed412f064c07951 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/golang-1.15-doc_1.15.15-1~deb11u4+fips_all.deb==72ead09139135d4ecd91b76c89128567 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/golang-1.15-go_1.15.15-1~deb11u4+fips_amd64.deb==145e103357a915cc759cc93de602b631 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/golang-1.15-src_1.15.15-1~deb11u4+fips_amd64.deb==1c1a46d5599be92777702643c37d5751 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/golang-1.15_1.15.15-1~deb11u4+fips_all.deb==847bc1fc5ce9c8ebae5176947ab34d30 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/krb5-multidev_1.18.3-6+deb11u4+fips_amd64.deb==41c7aecaf738ceb8e0348b9420d0aa3f +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libgssapi-krb5-2_1.18.3-6+deb11u4+fips_amd64.deb==9ab263ae9192bf4c964ea3ad86012c9a +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libgssrpc4_1.18.3-6+deb11u4+fips_amd64.deb==4913523ed341663cd9a8bd2ea0e5c64a +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libk5crypto3_1.18.3-6+deb11u4+fips_amd64.deb==5c89f642c4265a2f53d8788f93b37aaf +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libkadm5clnt-mit12_1.18.3-6+deb11u4+fips_amd64.deb==19a7a6eeae8387d4114a6b76ff5fc7c8 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libkadm5srv-mit12_1.18.3-6+deb11u4+fips_amd64.deb==2bdb2e358091302bb66f9208cf082807 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libkrb5-3_1.18.3-6+deb11u4+fips_amd64.deb==ba2b9c93e084c442cb1495eef5979b05 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libkrb5-dev_1.18.3-6+deb11u4+fips_amd64.deb==6ffd25f46089ad674fe20f074454297c +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libkrb5support0_1.18.3-6+deb11u4+fips_amd64.deb==851abebe415c61f98bfc5024ef2e54fb +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libpython3.9-minimal_3.9.2-1+fips_amd64.deb==71b75222c8bcd5ede55693a9223a3246 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libpython3.9-stdlib_3.9.2-1+fips_amd64.deb==f4274260999ba26346dc60f95b1cf91c +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libpython3.9_3.9.2-1+fips_amd64.deb==c405132eacaf059c7c903f853d48be7e +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libssl-dev_1.1.1n-0+deb11u5+fips_amd64.deb==7deccb6cb0197bd9dc257d54505533cf +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libssl-doc_1.1.1n-0+deb11u5+fips_all.deb==3ac7462c370d85e42c03b11d26f35016 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libssl1.1_1.1.1n-0+deb11u5+fips_amd64.deb==6a4505b82957d711e983e03364275521 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/openssh-client_8.4p1-5+deb11u2+fips_amd64.deb==1fb734b040398b0fb9c674385253b993 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/openssh-server_8.4p1-5+deb11u2+fips_amd64.deb==8ec9f1fbfedd6c36312c5181d9950b58 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/openssh-sftp-server_8.4p1-5+deb11u2+fips_amd64.deb==02e8be0633aff33497655261256eadca +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/openssl_1.1.1n-0+deb11u5+fips_amd64.deb==ee086d7e1fb0cfd36513ec242381af53 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/python3.9-minimal_3.9.2-1+fips_amd64.deb==ff2d0b457ef7872e0a9c6da65cd2f146 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/python3.9_3.9.2-1+fips_amd64.deb==30be224443931a2a3428aa270b87384a +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/symcrypt-openssl_0.10_amd64.deb==01bc30a1bc6fc07be723258f7a6566b6 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/golang-1.15-doc_1.15.15-1~deb11u4+fips_all.deb==72ead09139135d4ecd91b76c89128567 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/golang-1.15-go_1.15.15-1~deb11u4+fips_arm64.deb==b59f315800ca2ec31de79136dfb8979d +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/golang-1.15-src_1.15.15-1~deb11u4+fips_arm64.deb==0038c68ed1e3adb1b43434af81cff678 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/golang-1.15_1.15.15-1~deb11u4+fips_all.deb==847bc1fc5ce9c8ebae5176947ab34d30 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/krb5-multidev_1.18.3-6+deb11u4+fips_arm64.deb==53130dd865aeedf3f99cc0deca4ae50a +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libgssapi-krb5-2_1.18.3-6+deb11u4+fips_arm64.deb==49255677e3c149d29d059aa2af18747a +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libgssrpc4_1.18.3-6+deb11u4+fips_arm64.deb==1f939eb23261667a9e920d1acb08969c +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libk5crypto3_1.18.3-6+deb11u4+fips_arm64.deb==5b7eb6aa93b20949d7422ad25fe73549 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libkadm5clnt-mit12_1.18.3-6+deb11u4+fips_arm64.deb==c5d5a81770b64a33d6d87f288fdb974c +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libkadm5srv-mit12_1.18.3-6+deb11u4+fips_arm64.deb==267114332521c5de4c88de464fc098de +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libkrb5-3_1.18.3-6+deb11u4+fips_arm64.deb==ce88c2527f79baa4cd29c71580e57807 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libkrb5-dev_1.18.3-6+deb11u4+fips_arm64.deb==6af1cfd53e8e55b5619365d4a462ee35 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libkrb5support0_1.18.3-6+deb11u4+fips_arm64.deb==86768f22a3d883d9d19a814e075a9a1b +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libpython3.9-minimal_3.9.2-1+fips_arm64.deb==870a96b0d9d7fe753d495ad6574e4c03 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libpython3.9-stdlib_3.9.2-1+fips_arm64.deb==f944ca0b75549d6f24d07deb1ea897d4 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libpython3.9_3.9.2-1+fips_arm64.deb==edae5c269e2c401873e7cff3d4f93a7a +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libssl-dev_1.1.1n-0+deb11u5+fips_arm64.deb==2116b0e949a521b02098f01aee5a33d4 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libssl-doc_1.1.1n-0+deb11u5+fips_all.deb==3ac7462c370d85e42c03b11d26f35016 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libssl1.1_1.1.1n-0+deb11u5+fips_arm64.deb==a6a6a6f2d23d91398f44570da6e2e80c +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/openssh-client_8.4p1-5+deb11u2+fips_arm64.deb==b30c745ca94e392740c67225802e9068 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/openssh-server_8.4p1-5+deb11u2+fips_arm64.deb==8ab6d9e3bac9d486bda5664e40f634ef +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/openssh-sftp-server_8.4p1-5+deb11u2+fips_arm64.deb==73c51fa8f165a014571c2bdbd843c517 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/openssl_1.1.1n-0+deb11u5+fips_arm64.deb==5c16b501e97678e7f55c616afa6423bb +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/python3.9-minimal_3.9.2-1+fips_arm64.deb==3ad5f86b07a3f5794ddee1dcd69c1d7e +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/python3.9_3.9.2-1+fips_arm64.deb==4d6307dabcd3060235d6188cfa0346b8 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/symcrypt-openssl_0.10_arm64.deb==7b709cbe2ccbe62fa207b8cae0f88d46 https://sonicstorage.blob.core.windows.net/public/sai/bcmpai/REL_3.11/3.11/libsaibroncos_3.11_amd64.deb==6e21a16126e833516a9659d4c35c284e https://storage.googleapis.com/golang/go1.15.15.linux-amd64.tar.gz==b75227438c6129b5013da053b3aa3f38 https://storage.googleapis.com/golang/go1.15.15.linux-arm64.tar.gz==6d721146a9195592d92a80cf27d475f9 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 7ab5e0cfbcb9..716540f65ecb 100644 --- a/files/build/versions/dockers/docker-base-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-base-bullseye/versions-deb-bullseye @@ -21,7 +21,7 @@ libgdbm6==1.19-2 libjansson4==2.13.1-1.1 libjemalloc2==5.2.1-3 libjq1==1.6-2.1 -libk5crypto3==1.18.3-6+deb11u1+fips +libk5crypto3==1.18.3-6+deb11u4+fips libldap-2.4-2==2.4.57+dfsg-3+deb11u1 liblognorm5==2.0.5-1.1 liblua5.1-0==5.1.5-8.1+b3 @@ -34,7 +34,7 @@ libncursesw6==6.2+20201114-2+deb11u2 libnghttp2-14==1.43.0-1+deb11u1 libnorm1==1.5.9+dfsg-2 libonig5==6.9.6-1.1 -libperl5.32==5.32.1-4+deb11u2 +libperl5.32==5.32.1-4+deb11u3 libpgm-5.3-0==5.3.128~dfsg-2 libprocps8==2:3.3.17-5 libpsl5==0.21.0-1.2 @@ -52,14 +52,14 @@ libssl-dev==1.1.1n-0+deb11u5+fips libssl1.1==1.1.1n-0+deb11u5+fips libwrap0==7.6.q-31 libxtables12==1.8.7-1 -libzmq5==4.3.4-1 +libzmq5==4.3.4-1+deb11u1 lua-bitop==1.0.2-5 lua-cjson==2.1.0+dfsg-2.1 media-types==4.0.0 net-tools==1.60+git20181103.0eebece-1 openssl==1.1.1n-0+deb11u5+fips -perl==5.32.1-4+deb11u2 -perl-modules-5.32==5.32.1-4+deb11u2 +perl==5.32.1-4+deb11u3 +perl-modules-5.32==5.32.1-4+deb11u3 procps==2:3.3.17-5 python-is-python3==3.9.2-1 python3==3.9.2-3 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 58a55d6d16b1..1829220819e8 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 @@ -1,6 +1,6 @@ icu-devtools==67.1-7 -libc-dev-bin==2.31-13+deb11u7 -libc6-dev==2.31-13+deb11u7 +libc-dev-bin==2.31-13+deb11u8 +libc6-dev==2.31-13+deb11u8 libcrypt-dev==1:4.4.18-4 libicu-dev==67.1-7 libicu67==67.1-7 @@ -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.205-2 +linux-libc-dev==5.10.209-2 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 58a55d6d16b1..1829220819e8 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 @@ -1,6 +1,6 @@ icu-devtools==67.1-7 -libc-dev-bin==2.31-13+deb11u7 -libc6-dev==2.31-13+deb11u7 +libc-dev-bin==2.31-13+deb11u8 +libc6-dev==2.31-13+deb11u8 libcrypt-dev==1:4.4.18-4 libicu-dev==67.1-7 libicu67==67.1-7 @@ -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.205-2 +linux-libc-dev==5.10.209-2 zlib1g-dev==1:1.2.11.dfsg-2+deb11u2 diff --git a/files/build/versions/dockers/docker-database/versions-deb-bullseye b/files/build/versions/dockers/docker-database/versions-deb-bullseye index c5d9dce1290f..5d2c507de040 100644 --- a/files/build/versions/dockers/docker-database/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-database/versions-deb-bullseye @@ -8,7 +8,7 @@ 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 +libglib2.0-0==2.66.8-1+deb11u1 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 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 5e65ac7c303e..128545e36ed0 100644 --- a/files/build/versions/dockers/docker-dhcp-relay/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-dhcp-relay/versions-deb-bullseye @@ -13,7 +13,7 @@ libedit2==3.1-20191231-2+b1 libevent-2.1-7==2.1.12-stable-1 libexplain51==1.4.D001-11+deb11u1 libfido2-1==1.6.0-2 -libglib2.0-0==2.66.8-1 +libglib2.0-0==2.66.8-1+deb11u1 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 diff --git a/files/build/versions/dockers/docker-eventd/versions-deb-bullseye b/files/build/versions/dockers/docker-eventd/versions-deb-bullseye index 10c7dbc37ff3..eb7f7e9c5906 100644 --- a/files/build/versions/dockers/docker-eventd/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-eventd/versions-deb-bullseye @@ -8,7 +8,7 @@ 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 +libglib2.0-0==2.66.8-1+deb11u1 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 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 c122570ea15e..7d076b3f8a5c 100644 --- a/files/build/versions/dockers/docker-fpm-frr/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-fpm-frr/versions-deb-bullseye @@ -14,7 +14,7 @@ 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 +libglib2.0-0==2.66.8-1+deb11u1 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 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 5dc6c13134fb..bf8acc56c2c3 100644 --- a/files/build/versions/dockers/docker-gbsyncd-broncos/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-gbsyncd-broncos/versions-deb-bullseye @@ -2,8 +2,8 @@ gdb==10.1-1.7 gdbserver==10.1-1.7 libbabeltrace1==1.5.8-1+b3 libboost-regex1.74.0==1.74.0-9 -libc-dev-bin==2.31-13+deb11u7 -libc6-dev==2.31-13+deb11u7 +libc-dev-bin==2.31-13+deb11u8 +libc6-dev==2.31-13+deb11u8 libcbor0==0.5.0+dfsg-2 libcrypt-dev==1:4.4.18-4 libcurl3-gnutls==7.74.0-1.3+deb11u11 @@ -11,7 +11,7 @@ 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 +libglib2.0-0==2.66.8-1+deb11u1 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 @@ -28,7 +28,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.205-2 +linux-libc-dev==5.10.209-2 openssh-client==1:8.4p1-5+deb11u3 sshpass==1.09-1+b1 strace==5.10-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 b993d31f2bff..272f7dca37ab 100644 --- a/files/build/versions/dockers/docker-gbsyncd-credo/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-gbsyncd-credo/versions-deb-bullseye @@ -8,7 +8,7 @@ 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 +libglib2.0-0==2.66.8-1+deb11u1 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 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 cdfa7d2de06d..80fb00748bfa 100644 --- a/files/build/versions/dockers/docker-gbsyncd-vs/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-gbsyncd-vs/versions-deb-bullseye @@ -8,7 +8,7 @@ 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 +libglib2.0-0==2.66.8-1+deb11u1 libgpm2==1.20.7-8 libhiredis0.14-dbgsym==0.14.1-1 libicu67==67.1-7 diff --git a/files/build/versions/dockers/docker-lldp/versions-deb-bullseye b/files/build/versions/dockers/docker-lldp/versions-deb-bullseye index 2b79a96d90fa..561d5fb8ea13 100644 --- a/files/build/versions/dockers/docker-lldp/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-lldp/versions-deb-bullseye @@ -9,7 +9,7 @@ libdw1==0.183-1 libedit2==3.1-20191231-2+b1 libevent-2.1-7==2.1.12-stable-1 libfido2-1==1.6.0-2 -libglib2.0-0==2.66.8-1 +libglib2.0-0==2.66.8-1+deb11u1 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 diff --git a/files/build/versions/dockers/docker-macsec/versions-deb-bullseye b/files/build/versions/dockers/docker-macsec/versions-deb-bullseye index a24cc64c4978..671bc7525289 100644 --- a/files/build/versions/dockers/docker-macsec/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-macsec/versions-deb-bullseye @@ -9,7 +9,7 @@ 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 +libglib2.0-0==2.66.8-1+deb11u1 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 diff --git a/files/build/versions/dockers/docker-mux/versions-deb-bullseye b/files/build/versions/dockers/docker-mux/versions-deb-bullseye index 04ef7009f0b4..2aab48e5f757 100644 --- a/files/build/versions/dockers/docker-mux/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-mux/versions-deb-bullseye @@ -12,7 +12,7 @@ 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 +libglib2.0-0==2.66.8-1+deb11u1 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 diff --git a/files/build/versions/dockers/docker-nat/versions-deb-bullseye b/files/build/versions/dockers/docker-nat/versions-deb-bullseye index ae4e94d4ffde..fa4f16b3aacf 100644 --- a/files/build/versions/dockers/docker-nat/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-nat/versions-deb-bullseye @@ -11,7 +11,7 @@ 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 +libglib2.0-0==2.66.8-1+deb11u1 libgpm2==1.20.7-8 libicu67==67.1-7 libip4tc2==1.8.7-1 diff --git a/files/build/versions/dockers/docker-orchagent/versions-deb-bullseye b/files/build/versions/dockers/docker-orchagent/versions-deb-bullseye index fb351d232c97..140922f9cb16 100644 --- a/files/build/versions/dockers/docker-orchagent/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-orchagent/versions-deb-bullseye @@ -12,7 +12,7 @@ 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 +libglib2.0-0==2.66.8-1+deb11u1 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 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 a05dd9d01124..ffce1cc9be0a 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.6.1062 -applibs-dev==1.mlnx.4.6.1062 +applibs==1.mlnx.4.6.2202 +applibs-dev==1.mlnx.4.6.2202 dmidecode==3.3-2 ethtool==1:5.9-1 fancontrol==1:3.6.0-7 @@ -27,7 +27,7 @@ libfontconfig1==2.13.1-4.2 libfreeipmi17==1.6.6-4+deb11u1 libfreetype6==2.10.4+dfsg-1+deb11u1 libfribidi0==1.0.8-2+deb11u1 -libglib2.0-0==2.66.8-1 +libglib2.0-0==2.66.8-1+deb11u1 libgpm2==1.20.7-8 libgraphite2-3==1.3.14-1 libharfbuzz0b==2.7.4-1 @@ -70,7 +70,7 @@ openssh-client==1:8.4p1-5+deb11u3 pci.ids==0.0~2021.02.08-1 pciutils==1:3.7.0-5 psmisc==23.4-2 -python-sdk-api==1.mlnx.4.6.1062 +python-sdk-api==1.mlnx.4.6.2202 python3-attr==20.3.0-1 python3-importlib-metadata==1.6.0-2 python3-jsonschema==3.2.0-3 @@ -88,12 +88,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.6.1062 -sx-complib-dev==1.mlnx.4.6.1062 -sx-gen-utils==1.mlnx.4.6.1062 -sx-gen-utils-dev==1.mlnx.4.6.1062 -sxd-libs==1.mlnx.4.6.1062 -sxd-libs-dev==1.mlnx.4.6.1062 +sx-complib==1.mlnx.4.6.2202 +sx-complib-dev==1.mlnx.4.6.2202 +sx-gen-utils==1.mlnx.4.6.2202 +sx-gen-utils-dev==1.mlnx.4.6.2202 +sxd-libs==1.mlnx.4.6.2202 +sxd-libs-dev==1.mlnx.4.6.2202 ucf==3.0043 udev==247.3-7+deb11u4 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 78fa618008c5..bda1782a173c 100644 --- a/files/build/versions/dockers/docker-platform-monitor/versions-py3 +++ b/files/build/versions/dockers/docker-platform-monitor/versions-py3 @@ -12,7 +12,7 @@ more-itertools==4.2.0 netifaces==0.11.0 protobuf==4.24.3 pyrsistent==0.15.5 -python_sdk_api==4.6.1062 +python_sdk_api==4.6.2202 requests==2.31.0 thrift==0.13.0 urllib3==2.0.5 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 c96c2d625623..ab83ce7865c6 100644 --- a/files/build/versions/dockers/docker-router-advertiser/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-router-advertiser/versions-deb-bullseye @@ -8,7 +8,7 @@ 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 +libglib2.0-0==2.66.8-1+deb11u1 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 diff --git a/files/build/versions/dockers/docker-sflow/versions-deb-bullseye b/files/build/versions/dockers/docker-sflow/versions-deb-bullseye index 889af0d45430..9c2e1a810961 100644 --- a/files/build/versions/dockers/docker-sflow/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-sflow/versions-deb-bullseye @@ -11,7 +11,7 @@ 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 +libglib2.0-0==2.66.8-1+deb11u1 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 diff --git a/files/build/versions/dockers/docker-snmp/versions-deb-bullseye b/files/build/versions/dockers/docker-snmp/versions-deb-bullseye index 02097494e3e4..247f77f7900a 100644 --- a/files/build/versions/dockers/docker-snmp/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-snmp/versions-deb-bullseye @@ -4,7 +4,7 @@ gdbserver==10.1-1.7 ipmitool==1.8.18-10.1 libbabeltrace1==1.5.8-1+b3 libboost-regex1.74.0==1.74.0-9 -libc-l10n==2.31-13+deb11u7 +libc-l10n==2.31-13+deb11u8 libcbor0==0.5.0+dfsg-2 libcurl3-gnutls==7.74.0-1.3+deb11u11 libdebuginfod1==0.183-1 @@ -12,7 +12,7 @@ libdw1==0.183-1 libedit2==3.1-20191231-2+b1 libfido2-1==1.6.0-2 libfreeipmi17==1.6.6-4+deb11u1 -libglib2.0-0==2.66.8-1 +libglib2.0-0==2.66.8-1+deb11u1 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 @@ -27,7 +27,7 @@ libsource-highlight-common==3.1.9-3 libsource-highlight4v5==3.1.9-3+b1 libswsscommon-dbgsym==1.0.0 libunwind8==1.3.2-2 -locales==2.31-13+deb11u7 +locales==2.31-13+deb11u8 openssh-client==1:8.4p1-5+deb11u3 pci.ids==0.0~2021.02.08-1 snmp==5.9+dfsg-4+deb11u1 diff --git a/files/build/versions/dockers/docker-sonic-gnmi/versions-deb-bullseye b/files/build/versions/dockers/docker-sonic-gnmi/versions-deb-bullseye index 33c2b2450252..7ae0b391e217 100644 --- a/files/build/versions/dockers/docker-sonic-gnmi/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-sonic-gnmi/versions-deb-bullseye @@ -8,7 +8,7 @@ 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 +libglib2.0-0==2.66.8-1+deb11u1 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-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 index 683c92343d54..e3b668a9e128 100644 --- a/files/build/versions/dockers/docker-sonic-vs/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-sonic-vs/versions-deb-bullseye @@ -31,14 +31,14 @@ 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+deb11u4 +krb5-multidev==1.18.3-6+deb11u4+fips libapparmor1==2.13.6-10 libassuan0==2.5.3-7.1 libblkid-dev==2.36.1-8+deb11u1 libbsd-dev==0.11.3-1+deb11u1 libc-ares2==1.17.1-1+deb11u3 -libc-dev-bin==2.31-13+deb11u7 -libc6-dev==2.31-13+deb11u7 +libc-dev-bin==2.31-13+deb11u8 +libc6-dev==2.31-13+deb11u8 libcbor0==0.5.0+dfsg-2 libcrypt-dev==1:4.4.18-4 libdevmapper1.02.1==2:1.02.175-2.1 @@ -51,9 +51,10 @@ 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+deb11u4 +libglib2.0-0==2.66.8-1+deb11u1 +libglib2.0-data==2.66.8-1+deb11u1 +libgssapi-krb5-2==1.18.3-6+deb11u4+fips +libgssrpc4==1.18.3-6+deb11u4+fips libicu-dev==67.1-7 libicu67==67.1-7 libip4tc2==1.8.7-1 @@ -63,10 +64,12 @@ libjs-underscore==1.9.1~dfsg-3 libjson-c5==0.15-2+deb11u1 libjudydebian1==1.0.5-5+b2 libk5crypto3==1.18.3-6+deb11u4 -libkadm5clnt-mit12==1.18.3-6+deb11u4 -libkadm5srv-mit12==1.18.3-6+deb11u4 +libkadm5clnt-mit12==1.18.3-6+deb11u4+fips +libkadm5srv-mit12==1.18.3-6+deb11u4+fips libkdb5-10==1.18.3-6+deb11u4 -libkrb5-dev==1.18.3-6+deb11u4 +libkrb5-3==1.18.3-6+deb11u4+fips +libkrb5-dev==1.18.3-6+deb11u4+fips +libkrb5support0==1.18.3-6+deb11u4+fips libksba8==1.5.0-3+deb11u2 libmd-dev==1.0.3-3 libnet1==1.1.6+dfsg-3.1 @@ -97,8 +100,8 @@ libunwind8==1.3.2-2 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.205-2 +libzmq3-dev==4.3.4-1+deb11u1 +linux-libc-dev==5.10.209-2 logrotate==3.18.0-2+deb11u2 lsof==4.93.2+dfsg-1.1 mailcap==3.69 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 053ffe835326..b859c3369054 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 @@ -15,8 +15,8 @@ libarchive13==3.4.3-2+deb11u1 libasan6==10.2.1-6 libbinutils==2.35.2-2 libboost-atomic1.74.0==1.74.0-9 -libc-dev-bin==2.31-13+deb11u7 -libc6-dev==2.31-13+deb11u7 +libc-dev-bin==2.31-13+deb11u8 +libc6-dev==2.31-13+deb11u8 libcc1-0==10.2.1-6 libcrypt-dev==1:4.4.18-4 libctf-nobfd0==2.35.2-2 @@ -26,7 +26,7 @@ libdpkg-perl==1.20.13 libexpat1-dev==2.2.10-2+deb11u5 libffi-dev==3.3-6 libgcc-10-dev==10.2.1-6 -libglib2.0-0==2.66.8-1 +libglib2.0-0==2.66.8-1+deb11u1 libgomp1==10.2.1-6 libicu67==67.1-7 libisl23==0.23-1 @@ -57,7 +57,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.205-2 +linux-libc-dev==5.10.209-2 mailcap==3.69 make==4.3-4.1 mime-support==3.66 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 1b0765aa1d78..90a20c6f370d 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 @@ -10,7 +10,7 @@ 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 +libglib2.0-0==2.66.8-1+deb11u1 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 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 053ffe835326..b859c3369054 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 @@ -15,8 +15,8 @@ libarchive13==3.4.3-2+deb11u1 libasan6==10.2.1-6 libbinutils==2.35.2-2 libboost-atomic1.74.0==1.74.0-9 -libc-dev-bin==2.31-13+deb11u7 -libc6-dev==2.31-13+deb11u7 +libc-dev-bin==2.31-13+deb11u8 +libc6-dev==2.31-13+deb11u8 libcc1-0==10.2.1-6 libcrypt-dev==1:4.4.18-4 libctf-nobfd0==2.35.2-2 @@ -26,7 +26,7 @@ libdpkg-perl==1.20.13 libexpat1-dev==2.2.10-2+deb11u5 libffi-dev==3.3-6 libgcc-10-dev==10.2.1-6 -libglib2.0-0==2.66.8-1 +libglib2.0-0==2.66.8-1+deb11u1 libgomp1==10.2.1-6 libicu67==67.1-7 libisl23==0.23-1 @@ -57,7 +57,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.205-2 +linux-libc-dev==5.10.209-2 mailcap==3.69 make==4.3-4.1 mime-support==3.66 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 1dd59320fbf9..70ccdd336acc 100644 --- a/files/build/versions/dockers/docker-syncd-brcm/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-brcm/versions-deb-bullseye @@ -10,7 +10,7 @@ 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 +libglib2.0-0==2.66.8-1+deb11u1 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 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 053ffe835326..b859c3369054 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 @@ -15,8 +15,8 @@ libarchive13==3.4.3-2+deb11u1 libasan6==10.2.1-6 libbinutils==2.35.2-2 libboost-atomic1.74.0==1.74.0-9 -libc-dev-bin==2.31-13+deb11u7 -libc6-dev==2.31-13+deb11u7 +libc-dev-bin==2.31-13+deb11u8 +libc6-dev==2.31-13+deb11u8 libcc1-0==10.2.1-6 libcrypt-dev==1:4.4.18-4 libctf-nobfd0==2.35.2-2 @@ -26,7 +26,7 @@ libdpkg-perl==1.20.13 libexpat1-dev==2.2.10-2+deb11u5 libffi-dev==3.3-6 libgcc-10-dev==10.2.1-6 -libglib2.0-0==2.66.8-1 +libglib2.0-0==2.66.8-1+deb11u1 libgomp1==10.2.1-6 libicu67==67.1-7 libisl23==0.23-1 @@ -57,7 +57,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.205-2 +linux-libc-dev==5.10.209-2 mailcap==3.69 make==4.3-4.1 mime-support==3.66 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 f28efa949102..a3b48eb31ab1 100644 --- a/files/build/versions/dockers/docker-syncd-centec/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-centec/versions-deb-bullseye @@ -9,7 +9,7 @@ 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 +libglib2.0-0==2.66.8-1+deb11u1 libgpm2==1.20.7-8 libhiredis0.14-dbgsym==0.14.1-1 libicu67==67.1-7 diff --git a/files/build/versions/dockers/docker-syncd-mlnx-rpc/versions-deb-bullseye b/files/build/versions/dockers/docker-syncd-mlnx-rpc/versions-deb-bullseye index 6bced6505e64..c1048ab941f8 100644 --- a/files/build/versions/dockers/docker-syncd-mlnx-rpc/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-mlnx-rpc/versions-deb-bullseye @@ -22,7 +22,7 @@ libdouble-conversion3==3.1.5-6.1 libdpkg-perl==1.20.13 libffi-dev==3.3-6 libgcc-10-dev==10.2.1-6 -libglib2.0-0==2.66.8-1 +libglib2.0-0==2.66.8-1+deb11u1 libgomp1==10.2.1-6 libisl23==0.23-1 libitm1==10.2.1-6 @@ -65,6 +65,7 @@ python2-minimal==2.7.18-3 python2.7==2.7.18-8+deb11u1 python2.7-dev==2.7.18-8+deb11u1 python2.7-minimal==2.7.18-8+deb11u1 +python3-scapy==2.4.0-2 shared-mime-info==2.0-1 syncd-rpc==1.0.0 wget==1.21-1+deb11u1 diff --git a/files/build/versions/dockers/docker-syncd-mlnx-rpc/versions-py3 b/files/build/versions/dockers/docker-syncd-mlnx-rpc/versions-py3 new file mode 100644 index 000000000000..c15e52a9b0b1 --- /dev/null +++ b/files/build/versions/dockers/docker-syncd-mlnx-rpc/versions-py3 @@ -0,0 +1,5 @@ +cffi==1.16.0 +nnpy==1.4.2 +ptf==0.10.0 +pycparser==2.21 +scapy==2.4.0 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 5e5360e9918a..449b0b00274e 100644 --- a/files/build/versions/dockers/docker-syncd-mlnx/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-mlnx/versions-deb-bullseye @@ -1,5 +1,5 @@ -applibs==1.mlnx.4.6.1062 -applibs-dev==1.mlnx.4.6.1062 +applibs==1.mlnx.4.6.2202 +applibs-dev==1.mlnx.4.6.2202 gdb==10.1-1.7 gdbserver==10.1-1.7 iproute2==1.mlnx.4.5.4206 @@ -7,8 +7,8 @@ iproute2-dev==1.mlnx.4.5.4206 iproute2-mlnx==5.10.0-4~bpo10+1 libbabeltrace1==1.5.8-1+b3 libboost-regex1.74.0==1.74.0-9 -libc-dev-bin==2.31-13+deb11u7 -libc6-dev==2.31-13+deb11u7 +libc-dev-bin==2.31-13+deb11u8 +libc6-dev==2.31-13+deb11u8 libcbor0==0.5.0+dfsg-2 libcrypt-dev==1:4.4.18-4 libcurl3-gnutls==7.74.0-1.3+deb11u11 @@ -18,7 +18,7 @@ libedit2==3.1-20191231-2+b1 libelf1==0.183-1 libexpat1-dev==2.2.10-2+deb11u5 libfido2-1==1.6.0-2 -libglib2.0-0==2.66.8-1 +libglib2.0-0==2.66.8-1+deb11u1 libgpm2==1.20.7-8 libhiredis0.14-dbgsym==0.14.1-1 libicu67==67.1-7 @@ -40,13 +40,13 @@ 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.205-2 +linux-libc-dev==5.10.209-2 mft==4.25.0-62 mft-fwtrace-cfg==1.0.0 -mlnx-sai==1.mlnx.SAIBuild2211.25.1.4 +mlnx-sai==1.mlnx.SAIBuild2311.26.0.28 openssh-client==1:8.4p1-5+deb11u3 python-pip-whl==20.3.4-4+deb11u1 -python-sdk-api==1.mlnx.4.6.1062 +python-sdk-api==1.mlnx.4.6.2202 python3-attr==20.3.0-1 python3-dev==3.9.2-3 python3-importlib-metadata==1.6.0-2 @@ -62,25 +62,25 @@ 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.6.1062 -sx-acl-helper-dev==1.mlnx.4.6.1062 -sx-complib==1.mlnx.4.6.1062 -sx-complib-dev==1.mlnx.4.6.1062 -sx-examples==1.mlnx.4.6.1062 -sx-examples-dev==1.mlnx.4.6.1062 -sx-gen-utils==1.mlnx.4.6.1062 -sx-gen-utils-dev==1.mlnx.4.6.1062 -sx-hash-calc==1.mlnx.4.6.1062 -sx-obj-desc-lib==1.mlnx.4.6.1062 -sx-obj-desc-lib-dev==1.mlnx.4.6.1062 +sx-acl-helper==1.mlnx.4.6.2202 +sx-acl-helper-dev==1.mlnx.4.6.2202 +sx-complib==1.mlnx.4.6.2202 +sx-complib-dev==1.mlnx.4.6.2202 +sx-examples==1.mlnx.4.6.2202 +sx-examples-dev==1.mlnx.4.6.2202 +sx-gen-utils==1.mlnx.4.6.2202 +sx-gen-utils-dev==1.mlnx.4.6.2202 +sx-hash-calc==1.mlnx.4.6.2202 +sx-obj-desc-lib==1.mlnx.4.6.2202 +sx-obj-desc-lib-dev==1.mlnx.4.6.2202 sx-scew==1.mlnx.4.5.5142 sx-scew-dev==1.mlnx.4.5.5142 -sxd-libs==1.mlnx.4.6.1062 -sxd-libs-dev==1.mlnx.4.6.1062 +sxd-libs==1.mlnx.4.6.2202 +sxd-libs-dev==1.mlnx.4.6.2202 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.6.1062 -wjh-libs-dev==1.mlnx.4.6.1062 +wjh-libs==1.mlnx.4.6.2202 +wjh-libs-dev==1.mlnx.4.6.2202 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 c7bb4ca74409..d49cf202c9dc 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.6.1062 +python_sdk_api==4.6.2202 zipp==1.0.0 diff --git a/files/build/versions/dockers/docker-syncd-mrvl/versions-deb-bullseye-armhf b/files/build/versions/dockers/docker-syncd-mrvl/versions-deb-bullseye-armhf index 50830ad960ec..55419d341c51 100644 --- a/files/build/versions/dockers/docker-syncd-mrvl/versions-deb-bullseye-armhf +++ b/files/build/versions/dockers/docker-syncd-mrvl/versions-deb-bullseye-armhf @@ -6,7 +6,7 @@ libdevmapper1.02.1==2:1.02.175-2.1 libdpkg-perl==1.20.13 libevent-2.1-7==2.1.12-stable-1 libexpat1-dev==2.2.10-2+deb11u5 -libglib2.0-0==2.66.8-1 +libglib2.0-0==2.66.8-1+deb11u1 libnfsidmap2==0.25-6 libpcap-dev==1.10.0-2 libpcap0.8==1.10.0-2 diff --git a/files/build/versions/dockers/docker-syncd-vs/versions-deb-bullseye b/files/build/versions/dockers/docker-syncd-vs/versions-deb-bullseye index 526f470f7e22..00c0c3966c98 100644 --- a/files/build/versions/dockers/docker-syncd-vs/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-vs/versions-deb-bullseye @@ -9,7 +9,7 @@ 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 +libglib2.0-0==2.66.8-1+deb11u1 libgpm2==1.20.7-8 libhiredis0.14-dbgsym==0.14.1-1 libicu67==67.1-7 diff --git a/files/build/versions/dockers/docker-teamd/versions-deb-bullseye b/files/build/versions/dockers/docker-teamd/versions-deb-bullseye index 7b97b16842d9..e12805bc8e6c 100644 --- a/files/build/versions/dockers/docker-teamd/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-teamd/versions-deb-bullseye @@ -8,7 +8,7 @@ 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 +libglib2.0-0==2.66.8-1+deb11u1 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-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 4f74fdd5a516..76038461815a 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye @@ -24,9 +24,9 @@ autopoint==0.21-4 autotools-dev==20180224.1+nmu1 bash-completion==1:2.11-2 bc==1.07.1-2+b2 -bind9-dnsutils==1:9.16.44-1~deb11u1 -bind9-host==1:9.16.44-1~deb11u1 -bind9-libs==1:9.16.44-1~deb11u1 +bind9-dnsutils==1:9.16.48-1 +bind9-host==1:9.16.48-1 +bind9-libs==1:9.16.48-1 binfmt-support==2.2.1-1+deb11u1 binutils==2.35.2-2 binutils-common==2.35.2-2 @@ -68,7 +68,7 @@ dconf-service==0.38.0-2 dctrl-tools==2.24-3+b1 debhelper==13.3.4 debian-keyring==2021.07.26 -debootstrap==1.0.123+deb11u1 +debootstrap==1.0.123+deb11u2 default-jdk==2:1.11-72 default-jdk-headless==2:1.11-72 default-jre==2:1.11-72 @@ -87,11 +87,11 @@ dh-strip-nondeterminism==1.12.0-1 dictionaries-common==1.28.4 diffstat==1.64-1 dirmngr==2.2.27-2+deb11u2 -distro-info-data==0.51+deb11u4 +distro-info-data==0.51+deb11u5 dkms==2.8.4-3 dmeventd==2:1.02.175-2.1 dmsetup==2:1.02.175-2.1 -dnsutils==1:9.16.44-1~deb11u1 +dnsutils==1:9.16.48-1 docbook==4.5-6 docbook-dsssl==1.79-9.2 docbook-to-man==1:2.0.0-45 @@ -101,7 +101,7 @@ docbook-xsl==1.79.2+dfsg-1 docker-buildx-plugin==0.10.5-1~debian.11~bullseye docker-ce==5:24.0.2-1~debian.11~bullseye docker-ce-cli==5:24.0.2-1~debian.11~bullseye -docker-ce-rootless-extras==5:25.0.1-1~debian.11~bullseye +docker-ce-rootless-extras==5:25.0.3-1~debian.11~bullseye docker-compose-plugin==2.18.1-1~debian.11~bullseye docutils-common==0.16+dfsg-4 dosfstools==4.2-1 @@ -204,9 +204,9 @@ i965-va-driver==2.4.1+dfsg1-1 ibverbs-providers==33.2-1 icc-profiles-free==2.0.1+dfsg-1.1 icu-devtools==67.1-7 -imagemagick==8:6.9.11.60+dfsg-1.3+deb11u1 -imagemagick-6-common==8:6.9.11.60+dfsg-1.3+deb11u1 -imagemagick-6.q16==8:6.9.11.60+dfsg-1.3+deb11u1 +imagemagick==8:6.9.11.60+dfsg-1.3+deb11u2 +imagemagick-6-common==8:6.9.11.60+dfsg-1.3+deb11u2 +imagemagick-6.q16==8:6.9.11.60+dfsg-1.3+deb11u2 install-info==6.7.0.dfsg.2-6 intel-media-va-driver==21.1.1+dfsg1-1 intltool-debian==0.35.0+20060710.5 @@ -372,15 +372,15 @@ libbsh-java==2.0b4-20 libbz2-dev==1.0.8-4 libc-ares-dev==1.17.1-1+deb11u3 libc-ares2==1.17.1-1+deb11u3 -libc-dev-bin==2.31-13+deb11u7 -libc-devtools==2.31-13+deb11u7 -libc-l10n==2.31-13+deb11u7 -libc6-dbg==2.31-13+deb11u7 -libc6-dev==2.31-13+deb11u7 -libc6-dev-i386==2.31-13+deb11u7 -libc6-dev-x32==2.31-13+deb11u7 -libc6-i386==2.31-13+deb11u7 -libc6-x32==2.31-13+deb11u7 +libc-dev-bin==2.31-13+deb11u8 +libc-devtools==2.31-13+deb11u8 +libc-l10n==2.31-13+deb11u8 +libc6-dbg==2.31-13+deb11u8 +libc6-dev==2.31-13+deb11u8 +libc6-dev-i386==2.31-13+deb11u8 +libc6-dev-x32==2.31-13+deb11u8 +libc6-i386==2.31-13+deb11u8 +libc6-x32==2.31-13+deb11u8 libcaca0==0.99.beta19-2.2 libcacard0==1:2.8.0-3 libcairo-gobject2==1.16.0-5 @@ -472,7 +472,7 @@ libdbus-glib-1-2==0.110-6 libdbus-glib-1-dev==0.110-6 libdbus-glib-1-dev-bin==0.110-6 libdconf1==0.38.0-2 -libde265-0==1.0.11-0+deb11u1 +libde265-0==1.0.11-0+deb11u3 libdebhelper-perl==13.3.4 libdebian-source-perl==0.116 libdebuginfod1==0.183-1 @@ -488,7 +488,7 @@ libdevel-stacktrace-perl==2.0400-1 libdevmapper-event1.02.1==2:1.02.175-2.1 libdevmapper1.02.1==2:1.02.175-2.1 libdist-checkconflicts-perl==0.11-1.1 -libdistro-info-perl==1.0 +libdistro-info-perl==1.0+deb11u1 libdjvulibre-text==3.5.28-2 libdjvulibre21==3.5.28-2 libdns-export1110==1:9.11.19+dfsg-2.1 @@ -612,11 +612,11 @@ libglapi-mesa==20.3.5-1 libgles-dev==1.3.2-1 libgles1==1.3.2-1 libgles2==1.3.2-1 -libglib2.0-0==2.66.8-1 -libglib2.0-bin==2.66.8-1 -libglib2.0-data==2.66.8-1 -libglib2.0-dev==2.66.8-1 -libglib2.0-dev-bin==2.66.8-1 +libglib2.0-0==2.66.8-1+deb11u1 +libglib2.0-bin==2.66.8-1+deb11u1 +libglib2.0-data==2.66.8-1+deb11u1 +libglib2.0-dev==2.66.8-1+deb11u1 +libglib2.0-dev-bin==2.66.8-1+deb11u1 libglu1-mesa==9.0.1-1 libglu1-mesa-dev==9.0.1-1 libglvnd-dev==1.3.2-1 @@ -628,7 +628,7 @@ libgme0==0.6.3-2 libgmock-dev==1.10.0.20201025-1.1 libgmp-dev==2:6.2.1+dfsg-1+deb11u1 libgmpxx4ldbl==2:6.2.1+dfsg-1+deb11u1 -libgnutls-dane0==3.7.1-5+deb11u3 +libgnutls-dane0==3.7.1-5+deb11u4 libgomp1==10.2.1-6 libgoogle-gson-java==2.8.6-1+deb11u1 libgoogle-perftools4==2.8.1-1 @@ -810,15 +810,15 @@ liblzo2-2==2.10-2 liblzo2-dev==2.10-2 libmagic-mgc==1:5.39-3+deb11u1 libmagic1==1:5.39-3+deb11u1 -libmagickcore-6.q16-6==8:6.9.11.60+dfsg-1.3+deb11u1 -libmagickcore-6.q16-6-extra==8:6.9.11.60+dfsg-1.3+deb11u1 -libmagickwand-6.q16-6==8:6.9.11.60+dfsg-1.3+deb11u1 +libmagickcore-6.q16-6==8:6.9.11.60+dfsg-1.3+deb11u2 +libmagickcore-6.q16-6-extra==8:6.9.11.60+dfsg-1.3+deb11u2 +libmagickwand-6.q16-6==8:6.9.11.60+dfsg-1.3+deb11u2 libmail-sendmail-perl==0.80-1.1 libmailtools-perl==2.21-1 libmailutils7==1:3.10-3+b1 -libmariadb-dev==1:10.5.21-0+deb11u1 -libmariadb-dev-compat==1:10.5.21-0+deb11u1 -libmariadb3==1:10.5.21-0+deb11u1 +libmariadb-dev==1:10.5.23-0+deb11u1 +libmariadb-dev-compat==1:10.5.23-0+deb11u1 +libmariadb3==1:10.5.23-0+deb11u1 libmarkdown2==2.2.6-1 libmaven-archiver-java==3.2.0-2.1 libmaven-clean-plugin-java==3.1.0-1 @@ -890,7 +890,7 @@ libnewt-dev==0.52.21-4+b3 libnewt0.52==0.52.21-4+b3 libnfnetlink-dev==1.0.1-3+b1 libnfnetlink0==1.0.1-3+b1 -libnftables1==0.9.8-3.1+deb11u1 +libnftables1==0.9.8-3.1+deb11u2 libnftnl-dev==1.1.9-1 libnftnl11==1.1.9-1 libnghttp2-14==1.43.0-1+deb11u1 @@ -975,8 +975,8 @@ libpcsclite-dev==1.9.1-1 libpcsclite1==1.9.1-1 libpdfbox-java==1:1.8.16-2 libpegdown-java==1.6.0-1.1 -libperl-dev==5.32.1-4+deb11u2 -libperl5.32==5.32.1-4+deb11u2 +libperl-dev==5.32.1-4+deb11u3 +libperl5.32==5.32.1-4+deb11u3 libperlio-gzip-perl==0.19-1+b7 libpfm4==4.11.1+git32-gd0b85fb-1 libpgm-5.3-0==5.3.128~dfsg-2 @@ -1206,7 +1206,7 @@ libuchardet0==0.0.7-1 libucx0==1.10.1~rc1+really.1.10.0-1 libudev-dev==247.3-7+deb11u4 libudfread0==1.1.1-1 -libunbound8==1.13.1-1+deb11u1 +libunbound8==1.13.1-1+deb11u2 libunicode-linebreak-perl==0.0.20190101-1+b3 libunicode-utf8-perl==0.62-1+b2 libunivocity-parsers-java==2.8.3-2 @@ -1393,24 +1393,24 @@ libyaml-libyaml-perl==0.82+repack-1+b1 libyaml-tiny-perl==1.73-1 libz3-4==4.8.10-1 libz3-dev==4.8.10-1 -libzmq3-dev==4.3.4-1 -libzmq5==4.3.4-1 +libzmq3-dev==4.3.4-1+deb11u1 +libzmq5==4.3.4-1+deb11u1 libzvbi-common==0.2.35-18 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.205-2 -linux-headers-5.10.0-27-amd64==5.10.205-2 -linux-headers-5.10.0-27-common==5.10.205-2 -linux-headers-amd64==5.10.205-2 -linux-kbuild-5.10==5.10.205-2 -linux-libc-dev==5.10.205-2 +linux-compiler-gcc-10-x86==5.10.209-2 +linux-headers-5.10.0-28-amd64==5.10.209-2 +linux-headers-5.10.0-28-common==5.10.209-2 +linux-headers-amd64==5.10.209-2 +linux-kbuild-5.10==5.10.209-2 +linux-libc-dev==5.10.209-2 linuxdoc-tools==0.9.82-1 llvm-11==1:11.0.1-2 llvm-11-runtime==1:11.0.1-2 lmodern==2.004.5-6.1 -locales==2.31-13+deb11u7 +locales==2.31-13+deb11u8 logrotate==3.18.0-2+deb11u2 lsb-release==11.1.0 lsof==4.93.2+dfsg-1.1 @@ -1433,7 +1433,7 @@ man-db==2.9.4-2 man2html-base==1.6g-14 manpages==5.10-1 manpages-dev==5.10-1 -mariadb-common==1:10.5.21-0+deb11u1 +mariadb-common==1:10.5.23-0+deb11u1 maven==3.6.3-5 maven-debian-helper==2.6 maven-repo-helper==1.10 @@ -1447,7 +1447,7 @@ mysql-common==5.8+1.0.7 ncurses-term==6.2+20201114-2+deb11u2 netbase==6.3 netpbm==2:10.0-15.4 -nftables==0.9.8-3.1+deb11u1 +nftables==0.9.8-3.1+deb11u2 nlohmann-json3-dev==3.9.1-1 node-jquery==3.5.1+dfsg+~3.5.5-7 ocl-icd-libopencl1==2.2.14-2 @@ -1461,7 +1461,7 @@ openssh-client==1:8.4p1-5+deb11u3 openssh-server==1:8.4p1-5+deb11u3 openssh-sftp-server==1:8.4p1-5+deb11u3 openssl==1.1.1w-0+deb11u1 -ovmf==2020.11-2+deb11u1 +ovmf==2020.11-2+deb11u2 packagekit==1.2.2-2 packagekit-tools==1.2.2-2 pango1.0-tools==1.46.2-3 @@ -1470,8 +1470,8 @@ patchutils==0.4.2-1 pbuilder==0.231 pbzip2==1.1.13-1 pci.ids==0.0~2021.02.08-1 -perl==5.32.1-4+deb11u2 -perl-modules-5.32==5.32.1-4+deb11u2 +perl==5.32.1-4+deb11u3 +perl-modules-5.32==5.32.1-4+deb11u3 perl-openssl-defaults==5 php-cli==2:7.4+76 php-codecoverage==9.2.5+dfsg-3 @@ -1575,7 +1575,7 @@ python3-dbg==3.9.2-3 python3-dbus==1.2.16-5 python3-debian==0.1.39 python3-dev==3.9.2-3 -python3-distro-info==1.0 +python3-distro-info==1.0+deb11u1 python3-distutils==3.9.2-1 python3-docutils==0.16+dfsg-4 python3-gi==3.38.0-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 9356b5ee9abb..e63c869a25de 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 @@ -18,6 +18,6 @@ libstdc++6-armhf-cross==10.2.1-6cross1 libubsan1-armhf-cross==10.2.1-6cross1 libunicode-linebreak-perl==0.0.20190101-1+b2 libxslt1-dev==1.1.34-4+deb11u1 -linux-headers-5.10.0-27-arm64==5.10.205-2 -linux-headers-arm64==5.10.205-2 +linux-headers-5.10.0-28-arm64==5.10.209-2 +linux-headers-arm64==5.10.209-2 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 982b90176b0e..324174f4275b 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 @@ -7,8 +7,8 @@ libjpeg-dev==1:2.0.6-4 libjpeg62-turbo-dev==1:2.0.6-4 libunicode-linebreak-perl==0.0.20190101-1+b2 libxslt1-dev==1.1.34-4+deb11u1 -linux-compiler-gcc-10-arm==5.10.205-2 -linux-headers-5.10.0-27-armmp==5.10.205-2 -linux-headers-armmp==5.10.205-2 +linux-compiler-gcc-10-arm==5.10.209-2 +linux-headers-5.10.0-28-armmp==5.10.209-2 +linux-headers-armmp==5.10.209-2 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 2278b0803943..9357fd66a6a6 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 @@ -20,7 +20,7 @@ ctypesgen==1.0.2 dblatex==0.3.12 dbus-python==1.2.16 devscripts==2.21.3+deb11u1 -distro-info==1.0 +distro-info==1.0+deb11u1 docutils==0.16 fastentrypoints==0.12 gbp==0.9.22 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 66b1ff7ac3b9..c071a6c203a3 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster @@ -23,7 +23,7 @@ autopoint==0.19.8.1-9 autotools-dev==20180224.1 bash-completion==1:2.8-6 bc==1.07.1-2+b1 -bind9-host==1:9.11.5.P4+dfsg-5.1+deb10u9 +bind9-host==1:9.11.5.P4+dfsg-5.1+deb10u10 binfmt-support==2.2.0-2 binutils==2.31.1-16 binutils-common==2.31.1-16 @@ -85,7 +85,7 @@ distro-info-data==0.41+deb10u8 dkms==2.6.1-4 dmeventd==2:1.02.155-3 dmsetup==2:1.02.155-3 -dnsutils==1:9.11.5.P4+dfsg-5.1+deb10u9 +dnsutils==1:9.11.5.P4+dfsg-5.1+deb10u10 docbook==4.5-6 docbook-dsssl==1.79-9.1 docbook-to-man==1:2.0.0-42 @@ -94,7 +94,7 @@ docbook-xml==4.5-8 docker-buildx-plugin==0.10.5-1~debian.10~buster docker-ce==5:24.0.2-1~debian.10~buster docker-ce-cli==5:24.0.2-1~debian.10~buster -docker-ce-rootless-extras==5:25.0.1-1~debian.10~buster +docker-ce-rootless-extras==5:25.0.3-1~debian.10~buster docker-compose-plugin==2.18.1-1~debian.10~buster docutils-common==0.14+dfsg-4 docutils-doc==0.14+dfsg-4 @@ -286,8 +286,8 @@ libbabeltrace-dev==1.5.6-2+deb10u1 libbabeltrace1==1.5.6-2+deb10u1 libbatik-java==1.10-2+deb10u3 libbdplus0==0.1.2-3 -libbind-export-dev==1:9.11.5.P4+dfsg-5.1+deb10u9 -libbind9-161==1:9.11.5.P4+dfsg-5.1+deb10u9 +libbind-export-dev==1:9.11.5.P4+dfsg-5.1+deb10u10 +libbind9-161==1:9.11.5.P4+dfsg-5.1+deb10u10 libbinutils==2.31.1-16 libbison-dev==2:3.3.2.dfsg-1 libbit-vector-perl==7.4-1+b5 @@ -451,8 +451,8 @@ libdist-checkconflicts-perl==0.11-1 libdistro-info-perl==0.21+deb10u1 libdjvulibre-text==3.5.27.1-10+deb10u1 libdjvulibre21==3.5.27.1-10+deb10u1 -libdns-export1104==1:9.11.5.P4+dfsg-5.1+deb10u9 -libdns1104==1:9.11.5.P4+dfsg-5.1+deb10u9 +libdns-export1104==1:9.11.5.P4+dfsg-5.1+deb10u10 +libdns1104==1:9.11.5.P4+dfsg-5.1+deb10u10 libdom4j-java==2.1.1-2 libdouble-conversion1==3.1.0-3 libdoxia-core-java==1.7-2 @@ -669,14 +669,14 @@ libipc-system-simple-perl==1.25-4 libipt2==2.0-2 libiptc-dev==1.8.2-4 libiptc0==1.8.2-4 -libirs-export161==1:9.11.5.P4+dfsg-5.1+deb10u9 -libirs161==1:9.11.5.P4+dfsg-5.1+deb10u9 -libisc-export1100==1:9.11.5.P4+dfsg-5.1+deb10u9 -libisc1100==1:9.11.5.P4+dfsg-5.1+deb10u9 -libisccc-export161==1:9.11.5.P4+dfsg-5.1+deb10u9 -libisccc161==1:9.11.5.P4+dfsg-5.1+deb10u9 -libisccfg-export163==1:9.11.5.P4+dfsg-5.1+deb10u9 -libisccfg163==1:9.11.5.P4+dfsg-5.1+deb10u9 +libirs-export161==1:9.11.5.P4+dfsg-5.1+deb10u10 +libirs161==1:9.11.5.P4+dfsg-5.1+deb10u10 +libisc-export1100==1:9.11.5.P4+dfsg-5.1+deb10u10 +libisc1100==1:9.11.5.P4+dfsg-5.1+deb10u10 +libisccc-export161==1:9.11.5.P4+dfsg-5.1+deb10u10 +libisccc161==1:9.11.5.P4+dfsg-5.1+deb10u10 +libisccfg-export163==1:9.11.5.P4+dfsg-5.1+deb10u10 +libisccfg163==1:9.11.5.P4+dfsg-5.1+deb10u10 libisl19==0.20-2 libitext1-java==1.4-7 libitm1==8.3.0-6 @@ -756,7 +756,7 @@ liblua5.1-0-dev==5.1.5-8.1+b2 liblvm2cmd2.03==2.03.02-3 liblwp-mediatypes-perl==6.02-1 liblwp-protocol-https-perl==6.07-2 -liblwres161==1:9.11.5.P4+dfsg-5.1+deb10u9 +liblwres161==1:9.11.5.P4+dfsg-5.1+deb10u10 liblzma-dev==5.2.4-1+deb10u1 liblzo2-2==2.10-0.1 liblzo2-dev==2.10-0.1 @@ -1377,7 +1377,7 @@ lynx==2.8.9rel.1-3+deb10u1 lynx-common==2.8.9rel.1-3+deb10u1 m4==1.4.18-2 make==4.2.1-1.2 -man-db==2.8.5-2 +man-db==2.8.5-2+deb10u1 man2html-base==1.6g-11 manpages==4.16-2 manpages-dev==4.16-2 @@ -1703,7 +1703,7 @@ sphinx-rtd-theme-common==0.4.3+dfsg-1 squashfs-tools==1:4.3-12+deb10u2 stgit==0.18-1 strace==4.26-0.2 -sudo==1.8.27-1+deb10u5 +sudo==1.8.27-1+deb10u6 swig==3.0.12-2 swig3.0==3.0.12-2 systemd==241-7~deb10u10 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 e49aa8016b2b..5957b744fe03 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 @@ -11,7 +11,3 @@ libxslt1-dev==1.1.32-2.2~deb10u2 linux-compiler-gcc-8-arm==4.19.304-1 nasm==2.14-1 nodejs==14.21.3-deb-1nodesource1 -openjdk-11-jdk==11.0.21+9-1~deb10u1 -openjdk-11-jdk-headless==11.0.21+9-1~deb10u1 -openjdk-11-jre==11.0.21+9-1~deb10u1 -openjdk-11-jre-headless==11.0.21+9-1~deb10u1 diff --git a/files/build/versions/host-base-image/versions-deb-bullseye b/files/build/versions/host-base-image/versions-deb-bullseye index 1e60c6bab5d6..a23abe3eb09a 100644 --- a/files/build/versions/host-base-image/versions-deb-bullseye +++ b/files/build/versions/host-base-image/versions-deb-bullseye @@ -1,6 +1,6 @@ adduser==3.118+deb11u1 apt==2.2.4 -base-files==11.1+deb11u8 +base-files==11.1+deb11u9 base-passwd==3.5.51 bash==5.1-2+deb11u1 bsdutils==1:2.36.1-8+deb11u1 @@ -27,8 +27,8 @@ libaudit-common==1:3.0-2 libaudit1==1:3.0-2 libblkid1==2.36.1-8+deb11u1 libbz2-1.0==1.0.8-4 -libc-bin==2.31-13+deb11u6 -libc6==2.31-13+deb11u6 +libc-bin==2.31-13+deb11u8 +libc6==2.31-13+deb11u8 libcap-ng0==0.7.9-2.2+b1 libcom-err2==1.46.2-2 libcrypt1==1:4.4.18-4 @@ -39,7 +39,7 @@ libffi7==3.3-6 libgcc-s1==10.2.1-6 libgcrypt20==1.8.7-6 libgmp10==2:6.2.1+dfsg-1+deb11u1 -libgnutls30==3.7.1-5+deb11u3 +libgnutls30==3.7.1-5+deb11u4 libgpg-error0==1.38-2 libgssapi-krb5-2==1.18.3-6+deb11u4 libhogweed6==3.7.3-1 @@ -87,10 +87,10 @@ mount==2.36.1-8+deb11u1 ncurses-base==6.2+20201114-2+deb11u2 ncurses-bin==6.2+20201114-2+deb11u2 passwd==1:4.8.1-1 -perl-base==5.32.1-4+deb11u2 +perl-base==5.32.1-4+deb11u3 sed==4.7-1 sysvinit-utils==2.96-7+deb11u1 -tar==1.34+dfsg-1 -tzdata==2021a-1+deb11u10 +tar==1.34+dfsg-1+deb11u1 +tzdata==2024a-0+deb11u1 util-linux==2.36.1-8+deb11u1 zlib1g==1:1.2.11.dfsg-2+deb11u2 diff --git a/files/build/versions/host-image/versions-deb-bullseye b/files/build/versions/host-image/versions-deb-bullseye index 02ceda70f0e3..7fc74f6c9a1a 100644 --- a/files/build/versions/host-image/versions-deb-bullseye +++ b/files/build/versions/host-image/versions-deb-bullseye @@ -27,7 +27,7 @@ curl==7.74.0-1.3+deb11u11 dbus==1.12.28-0+deb11u1 device-tree-compiler==1.6.0-1 dirmngr==2.2.27-2+deb11u2 -distro-info-data==0.51+deb11u4 +distro-info-data==0.51+deb11u5 dmidecode==3.3-2 dmsetup==2:1.02.175-2.1 docker-ce==5:24.0.2-1~debian.11~bullseye @@ -101,9 +101,7 @@ libbpf0==1:0.3-2 libbrotli1==1.0.9-2+b2 libbsd0==0.11.3-1+deb11u1 libc-ares2==1.17.1-1+deb11u3 -libc-bin==2.31-13+deb11u7 -libc-l10n==2.31-13+deb11u7 -libc6==2.31-13+deb11u7 +libc-l10n==2.31-13+deb11u8 libcap2==1:2.44-1 libcap2-bin==1:2.44-1 libcbor0==0.5.0+dfsg-2 @@ -141,7 +139,7 @@ libgcc-10-dev==10.2.1-6 libgdbm-compat4==1.19-2 libgdbm6==1.19-2 libgirepository-1.0-1==1.66.1-1+b1 -libglib2.0-0==2.66.8-1 +libglib2.0-0==2.66.8-1+deb11u1 libgomp1==10.2.1-6 libgpm2==1.20.7-8 libgrpc++1==1.30.2-3 @@ -159,7 +157,7 @@ libjansson4==2.13.1-1.1 libjq1==1.6-2.1 libjs-jquery==3.5.1+dfsg+~3.5.5-7 libjson-c5==0.15-2+deb11u1 -libk5crypto3==1.18.3-6+deb11u1+fips +libk5crypto3==1.18.3-6+deb11u4+fips libklibc==2.0.8-6.1 libkmod2==28-1 libksba8==1.5.0-3+deb11u2 @@ -201,7 +199,7 @@ libpam-radius-auth==1.4.1-1 libpam-tacplus==1.4.1-1 libpcap0.8==1.10.0-2 libpci3==1:3.7.0-5 -libperl5.32==5.32.1-4+deb11u2 +libperl5.32==5.32.1-4+deb11u3 libpgm-5.3-0==5.3.128~dfsg-2 libpng16-16==1.6.37-3 libpopt0==1.18-2 @@ -240,12 +238,12 @@ libxtables12==1.8.7-1 libyaml-0-2==0.2.2-1 libyang==1.0.73 libyang-cpp==1.0.73 -libzmq5==4.3.4-1 +libzmq5==4.3.4-1+deb11u1 linux-base==4.6 linux-image-5.10.0-23-2-amd64-unsigned==5.10.179-3 -linux-perf==5.10.205-2 -linux-perf-5.10==5.10.205-2 -locales==2.31-13+deb11u7 +linux-perf==5.10.209-2 +linux-perf-5.10==5.10.209-2 +locales==2.31-13+deb11u8 logrotate==3.18.0-2+deb11u2 lsb-release==11.1.0 lsof==4.93.2+dfsg-1.1 @@ -274,8 +272,8 @@ openssh-sftp-server==1:8.4p1-5+deb11u2+fips openssl==1.1.1n-0+deb11u5+fips pci.ids==0.0~2021.02.08-1 pciutils==1:3.7.0-5 -perl==5.32.1-4+deb11u2 -perl-modules-5.32==5.32.1-4+deb11u2 +perl==5.32.1-4+deb11u3 +perl-modules-5.32==5.32.1-4+deb11u3 picocom==3.1-2+b1 pinentry-curses==1.1.0-4 procps==2:3.3.17-5 @@ -317,7 +315,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.6.1062 +sx-kernel==1.mlnx.4.6.2202 symcrypt-openssl==0.1 sysfsutils==2.1.0+repack-7 sysstat==12.5.2-2 @@ -328,7 +326,6 @@ systemd-sysv==247.3-7+deb11u4 tcpdump==4.99.0-2+deb11u1 tcptraceroute==1.5beta7+debian-4.1+b1 traceroute==1:2.1.0-2+deb11u1 -tzdata==2021a-1+deb11u11 u-boot-tools==2021.01+dfsg-5 ucf==3.0043 udev==247.3-7+deb11u4 diff --git a/files/build/versions/host-image/versions-deb-bullseye-arm64 b/files/build/versions/host-image/versions-deb-bullseye-arm64 index da2e9298b680..248a64964aa4 100644 --- a/files/build/versions/host-image/versions-deb-bullseye-arm64 +++ b/files/build/versions/host-image/versions-deb-bullseye-arm64 @@ -1,8 +1,8 @@ binutils-aarch64-linux-gnu==2.35.2-2 ebtables==2.0.11-4 icu-devtools==67.1-7 -libc-dev-bin==2.31-13+deb11u7 -libc6-dev==2.31-13+deb11u7 +libc-dev-bin==2.31-13+deb11u8 +libc6-dev==2.31-13+deb11u8 libcrypt-dev==1:4.4.18-4 libicu-dev==67.1-7 libicu67==67.1-7 @@ -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-23-2-arm64-unsigned==5.10.179-3 -linux-libc-dev==5.10.205-2 +linux-libc-dev==5.10.209-2 ntpstat==0.0.0.1-2 picocom==3.1-2 tsingma-bsp==1.0 diff --git a/files/build/versions/host-image/versions-deb-bullseye-armhf b/files/build/versions/host-image/versions-deb-bullseye-armhf index 171ce7648c69..04d7c1e78536 100644 --- a/files/build/versions/host-image/versions-deb-bullseye-armhf +++ b/files/build/versions/host-image/versions-deb-bullseye-armhf @@ -1,8 +1,8 @@ binutils-arm-linux-gnueabihf==2.35.2-2 ebtables==2.0.11-4 icu-devtools==67.1-7 -libc-dev-bin==2.31-13+deb11u7 -libc6-dev==2.31-13+deb11u7 +libc-dev-bin==2.31-13+deb11u8 +libc6-dev==2.31-13+deb11u8 libcrypt-dev==1:4.4.18-4 libicu-dev==67.1-7 libicu67==67.1-7 @@ -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-23-2-armmp==5.10.179-3 -linux-libc-dev==5.10.205-2 +linux-libc-dev==5.10.209-2 mrvlprestera==1.0 ntpstat==0.0.0.1-2 openssh-client==1:8.4p1-5+deb11u2 diff --git a/files/build/versions/host-image/versions-py3-all-armhf b/files/build/versions/host-image/versions-py3-all-armhf index 61d8c26c7a49..427877797027 100644 --- a/files/build/versions/host-image/versions-py3-all-armhf +++ b/files/build/versions/host-image/versions-py3-all-armhf @@ -3,8 +3,8 @@ cryptography==3.3.1 enlighten==1.12.4 filelock==3.13.1 lazy-object-proxy==1.10.0 -m2crypto==0.40.1 +m2crypto==0.41.0 pexpect==4.9.0 -pycairo==1.25.1 +pycairo==1.26.0 pygments==2.17.2 wcwidth==0.2.13 From e220fe7f94b46f9f68e7dfc1cc7aa2bd3ac2e4a2 Mon Sep 17 00:00:00 2001 From: zitingguo-ms Date: Sat, 24 Feb 2024 03:09:24 +0800 Subject: [PATCH 166/419] upgrade xgs SAI version to 10.1.7.0 (#18163) Signed-off-by: zitingguo-ms --- platform/broadcom/sai.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/broadcom/sai.mk b/platform/broadcom/sai.mk index f419d8b1bbd8..a3c61771ab04 100644 --- a/platform/broadcom/sai.mk +++ b/platform/broadcom/sai.mk @@ -1,4 +1,4 @@ -LIBSAIBCM_XGS_VERSION = 10.1.6.0 +LIBSAIBCM_XGS_VERSION = 10.1.7.0 LIBSAIBCM_DNX_VERSION = 7.1.111.1 LIBSAIBCM_XGS_BRANCH_NAME = SAI_10.1.0_GA LIBSAIBCM_DNX_BRANCH_NAME = REL_7.0_SAI_1.11 From 2a5b1c7cd111d5da97a0b2223d4a0e186d2eecdb Mon Sep 17 00:00:00 2001 From: Nikola Dancejic <26731235+Ndancejic@users.noreply.github.com> Date: Tue, 27 Feb 2024 13:11:58 -0800 Subject: [PATCH 167/419] [ebtables] Add multicast drop rule to ebtables (#18064) Adding rule to ebtables to drop multicast packets in kernel. This was done to address a bug where NS packets were flooding ports with duplicate packets. Signed-off-by: Nikola Dancejic --- files/image_config/ebtables/ebtables.filter.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/files/image_config/ebtables/ebtables.filter.cfg b/files/image_config/ebtables/ebtables.filter.cfg index 7a2dc5c8b6ec..fae04a378ab4 100644 --- a/files/image_config/ebtables/ebtables.filter.cfg +++ b/files/image_config/ebtables/ebtables.filter.cfg @@ -8,4 +8,5 @@ -A FORWARD -d BGA -j DROP -A FORWARD -p ARP -j DROP -A FORWARD -p 802_1Q --vlan-encap ARP -j DROP +-A FORWARD -d Multicast -j DROP From bc1bc0f01927ed9b9ca685c5de28824f3abcf634 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 28 Feb 2024 19:01:08 +0800 Subject: [PATCH 168/419] [submodule] Update submodule sonic-sairedis to the latest HEAD automatically (#18195) #### Why I did it src/sonic-sairedis ``` * edb2b17 - (HEAD -> 202311, origin/202311) Add new functionality to syncd_init_common.sh, to use common sai.profile (#1352) (22 hours ago) [noaOrMlnx] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-sairedis | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-sairedis b/src/sonic-sairedis index 5c05e23a1b9f..edb2b173fd30 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit 5c05e23a1b9ffcccc7c1c3ea26d37aa8fe79fc75 +Subproject commit edb2b173fd301a01b0e26ccbb4d4bca72c94fd80 From 55da4fa52cfb8dde6cb3a7287a9ef3f61894e88b Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 29 Feb 2024 03:00:03 +0800 Subject: [PATCH 169/419] [Nokia-7215-T1] Disable sysrq-trigger from platform init (#18161) (#18210) Co-authored-by: Pavan-Nokia <120486223+Pavan-Nokia@users.noreply.github.com> --- .../sonic-platform-nokia/7215/scripts/nokia-7215init.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platform/marvell-armhf/sonic-platform-nokia/7215/scripts/nokia-7215init.sh b/platform/marvell-armhf/sonic-platform-nokia/7215/scripts/nokia-7215init.sh index f8a7ad54b310..5ec108d1cfca 100755 --- a/platform/marvell-armhf/sonic-platform-nokia/7215/scripts/nokia-7215init.sh +++ b/platform/marvell-armhf/sonic-platform-nokia/7215/scripts/nokia-7215init.sh @@ -30,6 +30,9 @@ nokia_7215_profile() # Install kernel drivers required for i2c bus access load_kernel_drivers +# Disable sysrq-trigger +echo 0 > /proc/sys/kernel/sysrq + # LOGIC to enumerate SFP eeprom devices - send 0x50 to kernel i2c driver - initialize devices # the mux may be enumerated at number 4 or 5 so we check for the mux and skip if needed From b10abaf435f63e7e4e02ad40affa445b684fc0af Mon Sep 17 00:00:00 2001 From: noaOrMlnx <58519608+noaOrMlnx@users.noreply.github.com> Date: Wed, 28 Feb 2024 21:05:20 +0200 Subject: [PATCH 170/419] [Mellanox] Update Nvidia sai.profile SKU files to have common file (#18074) * Update Nvidia sai.profile SKU files to have common file * Remove SAI_DUMP_MFT_CFG_PATH from sai-common.profile as it is not in use --- device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/sai.profile | 2 -- device/mellanox/x86_64-mlnx_msn2100-r0/ACS-MSN2100/sai.profile | 2 -- device/mellanox/x86_64-mlnx_msn2410-r0/ACS-MSN2410/sai.profile | 2 -- device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/sai.profile | 2 -- .../x86_64-mlnx_msn2700-r0/Mellanox-SN2700-C28D8/sai.profile | 2 -- .../x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/sai.profile | 2 -- .../x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D44C10/sai.profile | 2 -- .../x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/sai.profile | 2 -- .../x86_64-mlnx_msn2700-r0/Mellanox-SN2700/sai.profile | 2 -- device/mellanox/x86_64-mlnx_msn2740-r0/ACS-MSN2740/sai.profile | 2 -- device/mellanox/x86_64-mlnx_msn3420-r0/ACS-MSN3420/sai.profile | 3 --- device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/sai.profile | 3 --- .../mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/sai.profile | 3 --- device/mellanox/x86_64-mlnx_msn3800-r0/ACS-MSN3800/sai.profile | 3 --- .../x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/sai.profile | 3 --- .../Mellanox-SN3800-D100C12S2/sai.profile | 3 --- .../x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/sai.profile | 3 --- .../x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/sai.profile | 3 --- .../Mellanox-SN3800-D28C49S1/sai.profile | 3 --- .../x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/sai.profile | 3 --- device/mellanox/x86_64-mlnx_msn4410-r0/ACS-MSN4410/sai.profile | 3 --- device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/sai.profile | 3 --- .../mellanox/x86_64-mlnx_msn4600c-r0/ACS-MSN4600C/sai.profile | 3 --- .../x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/sai.profile | 3 --- .../Mellanox-SN4600C-D100C12S2/sai.profile | 3 --- .../Mellanox-SN4600C-D112C8/sai.profile | 3 --- .../Mellanox-SN4600C-D48C40/sai.profile | 3 --- device/mellanox/x86_64-mlnx_msn4700-r0/ACS-MSN4700/sai.profile | 3 --- .../x86_64-mlnx_msn4700-r0/Mellanox-SN4700-A96C8V8/sai.profile | 3 --- .../x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/sai.profile | 3 --- .../x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O28/sai.profile | 2 -- .../x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/sai.profile | 3 --- .../x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/sai.profile | 3 --- .../x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/sai.profile | 3 --- device/mellanox/x86_64-nvidia_sn2201-r0/ACS-SN2201/sai.profile | 2 -- device/mellanox/x86_64-nvidia_sn4800-r0/ACS-SN4800/sai.profile | 3 --- device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/sai.profile | 2 -- .../x86_64-nvidia_sn5600_simx-r0/ACS-SN5600/sai.profile | 2 -- platform/mellanox/docker-syncd-mlnx/Dockerfile.j2 | 3 +++ platform/mellanox/docker-syncd-mlnx/sai-common.profile | 2 ++ 40 files changed, 5 insertions(+), 100 deletions(-) create mode 100644 platform/mellanox/docker-syncd-mlnx/sai-common.profile diff --git a/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/sai.profile b/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/sai.profile index fa261ec655c2..c13ca373750d 100644 --- a/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/sai.profile @@ -1,3 +1 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_2010.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-mlnx_msn2100-r0/ACS-MSN2100/sai.profile b/device/mellanox/x86_64-mlnx_msn2100-r0/ACS-MSN2100/sai.profile index 25f879a531d4..5a381e4666ee 100644 --- a/device/mellanox/x86_64-mlnx_msn2100-r0/ACS-MSN2100/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn2100-r0/ACS-MSN2100/sai.profile @@ -1,3 +1 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_2100.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-mlnx_msn2410-r0/ACS-MSN2410/sai.profile b/device/mellanox/x86_64-mlnx_msn2410-r0/ACS-MSN2410/sai.profile index b707c2692102..f7cb264c2287 100644 --- a/device/mellanox/x86_64-mlnx_msn2410-r0/ACS-MSN2410/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn2410-r0/ACS-MSN2410/sai.profile @@ -1,3 +1 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_2410.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/sai.profile b/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/sai.profile index 2b855ccb2d8e..696f3d8182f9 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/sai.profile @@ -1,3 +1 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_2700.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-C28D8/sai.profile b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-C28D8/sai.profile index 3b09459755f0..5ee219f34380 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-C28D8/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-C28D8/sai.profile @@ -1,4 +1,2 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_2700_8x50g_28x100g.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/sai.profile b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/sai.profile index c1810655051c..8498641f522a 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/sai.profile @@ -1,4 +1,2 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_2700_8x100g_40x50g_8x10g.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D44C10/sai.profile b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D44C10/sai.profile index e6f3c2f0cf58..7a2add983f13 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D44C10/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D44C10/sai.profile @@ -1,4 +1,2 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_2700_44x50g_10x100g.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/sai.profile b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/sai.profile index daf2235f0adc..1d1563cd61a6 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/sai.profile @@ -1,4 +1,2 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_2700_48x50g_8x100g.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/sai.profile b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/sai.profile index fcd0120d8342..f1c554fa521a 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/sai.profile @@ -1,4 +1,2 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_2700.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 diff --git a/device/mellanox/x86_64-mlnx_msn2740-r0/ACS-MSN2740/sai.profile b/device/mellanox/x86_64-mlnx_msn2740-r0/ACS-MSN2740/sai.profile index e212df2e5ea1..adaa280e6cd5 100644 --- a/device/mellanox/x86_64-mlnx_msn2740-r0/ACS-MSN2740/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn2740-r0/ACS-MSN2740/sai.profile @@ -1,3 +1 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_2740.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-mlnx_msn3420-r0/ACS-MSN3420/sai.profile b/device/mellanox/x86_64-mlnx_msn3420-r0/ACS-MSN3420/sai.profile index 9b50bab67670..a30106c8674d 100644 --- a/device/mellanox/x86_64-mlnx_msn3420-r0/ACS-MSN3420/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn3420-r0/ACS-MSN3420/sai.profile @@ -1,4 +1 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_3420.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 -SAI_DUMP_MFT_CFG_PATH=/etc/mft/fwtrace_cfg diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/sai.profile b/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/sai.profile index a040416bf51b..4907e971a2dd 100644 --- a/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/sai.profile @@ -1,4 +1 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_3700.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 -SAI_DUMP_MFT_CFG_PATH=/etc/mft/fwtrace_cfg diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/sai.profile b/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/sai.profile index 1b1b4bbe2477..46750fb2e07b 100644 --- a/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/sai.profile @@ -1,4 +1 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_3700c.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 -SAI_DUMP_MFT_CFG_PATH=/etc/mft/fwtrace_cfg diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/ACS-MSN3800/sai.profile b/device/mellanox/x86_64-mlnx_msn3800-r0/ACS-MSN3800/sai.profile index 5fe089467374..367f6c4e99c0 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/ACS-MSN3800/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/ACS-MSN3800/sai.profile @@ -1,4 +1 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_3800.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 -SAI_DUMP_MFT_CFG_PATH=/etc/mft/fwtrace_cfg diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/sai.profile b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/sai.profile index 7b27b5a2b96f..011612d978df 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/sai.profile @@ -1,5 +1,2 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_3800.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 -SAI_DUMP_MFT_CFG_PATH=/etc/mft/fwtrace_cfg SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/sai.profile b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/sai.profile index 92fb9921fdf5..a0d219afc68b 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/sai.profile @@ -1,5 +1,2 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_3800_2x10g_100x50g_12x100g.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 -SAI_DUMP_MFT_CFG_PATH=/etc/mft/fwtrace_cfg SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/sai.profile b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/sai.profile index 90534ae58a43..eba550e54e21 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/sai.profile @@ -1,5 +1,2 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_3800_112x50g_8x100g.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 -SAI_DUMP_MFT_CFG_PATH=/etc/mft/fwtrace_cfg SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/sai.profile b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/sai.profile index f00701cde546..f7d985529020 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/sai.profile @@ -1,5 +1,2 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_3800_24x50g_52x100g.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 -SAI_DUMP_MFT_CFG_PATH=/etc/mft/fwtrace_cfg SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/sai.profile b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/sai.profile index e90f26e77358..1ad3746399d6 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/sai.profile @@ -1,5 +1,2 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_3800_1x10g_28x50g_49x100g.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 -SAI_DUMP_MFT_CFG_PATH=/etc/mft/fwtrace_cfg SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/sai.profile b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/sai.profile index 3b36aff3126a..0e989e17cfe9 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/sai.profile @@ -1,5 +1,2 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_3800_28x50g_52x100g.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 -SAI_DUMP_MFT_CFG_PATH=/etc/mft/fwtrace_cfg SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 diff --git a/device/mellanox/x86_64-mlnx_msn4410-r0/ACS-MSN4410/sai.profile b/device/mellanox/x86_64-mlnx_msn4410-r0/ACS-MSN4410/sai.profile index 09cacbed000d..be729cb4e06a 100644 --- a/device/mellanox/x86_64-mlnx_msn4410-r0/ACS-MSN4410/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn4410-r0/ACS-MSN4410/sai.profile @@ -1,4 +1 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4410.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 -SAI_DUMP_MFT_CFG_PATH=/etc/mft/fwtrace_cfg diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/sai.profile b/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/sai.profile index f9d5172456a1..8d18361c1620 100644 --- a/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/sai.profile @@ -1,4 +1 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4600.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 -SAI_DUMP_MFT_CFG_PATH=/etc/mft/fwtrace_cfg diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/ACS-MSN4600C/sai.profile b/device/mellanox/x86_64-mlnx_msn4600c-r0/ACS-MSN4600C/sai.profile index 6dfcaf49bf66..e9d1e3e5f591 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/ACS-MSN4600C/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/ACS-MSN4600C/sai.profile @@ -1,4 +1 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4600C.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 -SAI_DUMP_MFT_CFG_PATH=/etc/mft/fwtrace_cfg diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/sai.profile b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/sai.profile index 8bf256a6ac45..3324d5b4b6c9 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/sai.profile @@ -1,5 +1,2 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4600C.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 -SAI_DUMP_MFT_CFG_PATH=/etc/mft/fwtrace_cfg SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/sai.profile b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/sai.profile index ac24ca45fdf1..acf46cd351f5 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/sai.profile @@ -1,5 +1,2 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4600c_100x50g_12x100g_2x10g.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 -SAI_DUMP_MFT_CFG_PATH=/etc/mft/fwtrace_cfg SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/sai.profile b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/sai.profile index 6c8656b90a79..cbe1b241b5f0 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/sai.profile @@ -1,5 +1,2 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4600c_112x50g_8x100g.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 -SAI_DUMP_MFT_CFG_PATH=/etc/mft/fwtrace_cfg SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/sai.profile b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/sai.profile index f8174ebe6892..5d63094db5a7 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/sai.profile @@ -1,5 +1,2 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4600c_48x50g_40x100g.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 -SAI_DUMP_MFT_CFG_PATH=/etc/mft/fwtrace_cfg SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/ACS-MSN4700/sai.profile b/device/mellanox/x86_64-mlnx_msn4700-r0/ACS-MSN4700/sai.profile index 8c76d4ca1bbc..d145093cab96 100644 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/ACS-MSN4700/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/ACS-MSN4700/sai.profile @@ -1,4 +1 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4700.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 -SAI_DUMP_MFT_CFG_PATH=/etc/mft/fwtrace_cfg diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-A96C8V8/sai.profile b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-A96C8V8/sai.profile index b90eb55a9ba3..a1542c6e1635 100644 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-A96C8V8/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-A96C8V8/sai.profile @@ -1,4 +1 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4700_8x200g_8x100g_96x25g.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 -SAI_DUMP_MFT_CFG_PATH=/etc/sonic/mft/fwtrace_cfg diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/sai.profile b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/sai.profile index cd04cc332c5d..ad1011267959 100644 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/sai.profile @@ -1,4 +1 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4700_128x100g.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 -SAI_DUMP_MFT_CFG_PATH=/etc/sonic/mft/fwtrace_cfg diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O28/sai.profile b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O28/sai.profile index fddba40b2233..e246cad50ad8 100644 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O28/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O28/sai.profile @@ -1,4 +1,2 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4700.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/sai.profile b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/sai.profile index 42f665d760b0..8238fae60b4b 100644 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/sai.profile @@ -1,5 +1,2 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4700_8x400g_48x100g.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 -SAI_DUMP_MFT_CFG_PATH=/etc/sonic/mft/fwtrace_cfg SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/sai.profile b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/sai.profile index e0109ecf26d3..0570470af163 100644 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/sai.profile @@ -1,5 +1,2 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4700_8x400g_48x200g.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 -SAI_DUMP_MFT_CFG_PATH=/etc/sonic/mft/fwtrace_cfg SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/sai.profile b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/sai.profile index 27e1cdad33b5..5a780a8cc729 100644 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/sai.profile @@ -1,4 +1 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4700_32x100g_48x200g.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 -SAI_DUMP_MFT_CFG_PATH=/etc/sonic/mft/fwtrace_cfg diff --git a/device/mellanox/x86_64-nvidia_sn2201-r0/ACS-SN2201/sai.profile b/device/mellanox/x86_64-nvidia_sn2201-r0/ACS-SN2201/sai.profile index 692ad368de4c..21a54436be6a 100644 --- a/device/mellanox/x86_64-nvidia_sn2201-r0/ACS-SN2201/sai.profile +++ b/device/mellanox/x86_64-nvidia_sn2201-r0/ACS-SN2201/sai.profile @@ -1,3 +1 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_2201.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-nvidia_sn4800-r0/ACS-SN4800/sai.profile b/device/mellanox/x86_64-nvidia_sn4800-r0/ACS-SN4800/sai.profile index 2ce406ef0185..3a8824058cf0 100644 --- a/device/mellanox/x86_64-nvidia_sn4800-r0/ACS-SN4800/sai.profile +++ b/device/mellanox/x86_64-nvidia_sn4800-r0/ACS-SN4800/sai.profile @@ -1,4 +1 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4800.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 -SAI_DUMP_MFT_CFG_PATH=/etc/mft/fwtrace_cfg diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/sai.profile b/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/sai.profile index b37ca8c3ed0c..ace2d70a85e6 100644 --- a/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/sai.profile +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/sai.profile @@ -1,3 +1 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_5600.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-nvidia_sn5600_simx-r0/ACS-SN5600/sai.profile b/device/mellanox/x86_64-nvidia_sn5600_simx-r0/ACS-SN5600/sai.profile index b37ca8c3ed0c..ace2d70a85e6 100644 --- a/device/mellanox/x86_64-nvidia_sn5600_simx-r0/ACS-SN5600/sai.profile +++ b/device/mellanox/x86_64-nvidia_sn5600_simx-r0/ACS-SN5600/sai.profile @@ -1,3 +1 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_5600.xml -SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps -SAI_DUMP_STORE_AMOUNT=10 diff --git a/platform/mellanox/docker-syncd-mlnx/Dockerfile.j2 b/platform/mellanox/docker-syncd-mlnx/Dockerfile.j2 index dbd51e2782ea..bdc51abca7e7 100755 --- a/platform/mellanox/docker-syncd-mlnx/Dockerfile.j2 +++ b/platform/mellanox/docker-syncd-mlnx/Dockerfile.j2 @@ -66,6 +66,9 @@ COPY ["files/supervisor-proc-exit-listener", "/usr/bin"] COPY ["critical_processes", "/etc/supervisor/"] COPY ["platform_syncd_dump.sh", "/usr/bin/"] +RUN mkdir -p /etc/mlnx/ +COPY ["sai-common.profile", "/etc/mlnx/"] + RUN mkdir -p /etc/supervisor/conf.d/ RUN sonic-cfggen -a "{\"ENABLE_ASAN\":\"{{ENABLE_ASAN}}\"}" -t /usr/share/sonic/templates/supervisord.conf.j2 > /etc/supervisor/conf.d/supervisord.conf RUN rm -f /usr/share/sonic/templates/supervisord.conf.j2 diff --git a/platform/mellanox/docker-syncd-mlnx/sai-common.profile b/platform/mellanox/docker-syncd-mlnx/sai-common.profile new file mode 100644 index 000000000000..3b9e6fe00573 --- /dev/null +++ b/platform/mellanox/docker-syncd-mlnx/sai-common.profile @@ -0,0 +1,2 @@ +SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps +SAI_DUMP_STORE_AMOUNT=10 From fced303ac78b1adeac72341f2192d46750724c15 Mon Sep 17 00:00:00 2001 From: skumar041 <107456442+skumar041@users.noreply.github.com> Date: Fri, 1 Mar 2024 03:49:50 +0530 Subject: [PATCH 171/419] [Marvell] Update arm64 sai debian to 1.13.0-1 (#18073) Signed-off-by: sandeep kumar --- platform/marvell-arm64/sai.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/marvell-arm64/sai.mk b/platform/marvell-arm64/sai.mk index fe4f91b8393a..f7d8782ac0e3 100644 --- a/platform/marvell-arm64/sai.mk +++ b/platform/marvell-arm64/sai.mk @@ -1,6 +1,6 @@ # Marvell SAI -export MRVL_SAI_VERSION = 1.12.0-2 +export MRVL_SAI_VERSION = 1.13.0-1 export MRVL_SAI = mrvllibsai_$(MRVL_SAI_VERSION)_$(PLATFORM_ARCH).deb $(MRVL_SAI)_SRC_PATH = $(PLATFORM_PATH)/sai From dabf4bc06c6519338622148e5b436bf9984130eb Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 1 Mar 2024 19:01:25 +0800 Subject: [PATCH 172/419] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#18219) #### Why I did it src/sonic-utilities ``` * b2bea12c - (HEAD -> 202311, origin/202311) CLI enhancements to revtrieve data from TRANSCEIVER_FIRMWARE_INFO table (#3177) (4 hours ago) [mihirpat1] * 02ae33f3 - Modify transceiver PM CLI to handle N/A value for DOM threshold (#3174) (28 hours ago) [mihirpat1] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index c711b061c8af..b2bea12cd3dc 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit c711b061c8af6a50c74e97c87d3c1cb9b906648d +Subproject commit b2bea12cd3dc9a0d80f1060b974a95b162830b0a From bb61ef5bacdabae65a40d99b3516a5df1b171a7c Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 1 Mar 2024 19:01:36 +0800 Subject: [PATCH 173/419] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#18217) #### Why I did it src/sonic-swss ``` * 64d5fdd9 - (HEAD -> 202311, origin/202311) [intfsorch] Enable ipv6 proxy ndp along with proxy arp (#3045) (2 days ago) [Nikola Dancejic] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index d322f660acbf..64d5fdd9b3b5 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit d322f660acbfc6b308875e35ad9f10ed70657355 +Subproject commit 64d5fdd9b3b5862585c20c27e539f9112e9177c7 From 8be727bcb1fd58f9a04b87cbeb0fd5b506b289f8 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 1 Mar 2024 19:01:47 +0800 Subject: [PATCH 174/419] [submodule] Update submodule sonic-platform-common to the latest HEAD automatically (#18215) #### Why I did it src/sonic-platform-common ``` * 4dfc01f - (HEAD -> 202311, origin/202311) Certain VDM fields not populating after encountering KeyError on 400ZR optics (#442) (28 hours ago) [mihirpat1] ``` #### How I did it #### How to verify it #### Description for the changelog --- 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 5430f6fce8fa..4dfc01fcfdf4 160000 --- a/src/sonic-platform-common +++ b/src/sonic-platform-common @@ -1 +1 @@ -Subproject commit 5430f6fce8fa154cabba5a8ae12dde60a4f4e573 +Subproject commit 4dfc01fcfdf4f71f622f9aae0a5a7f1a175f5ee0 From 742d85b6347b26be2c9e031b9c9dd9bae769bcad Mon Sep 17 00:00:00 2001 From: Liu Shilong Date: Wed, 28 Feb 2024 09:45:49 +0800 Subject: [PATCH 175/419] [build] Use public storage for public resources. (#18038) --- dockers/docker-base-buster/Dockerfile.j2 | 6 +++--- dockers/docker-base-stretch/Dockerfile.j2 | 6 +++--- files/build/versions/default/versions-web | 7 ------- get_docker-base.sh | 2 +- platform/broadcom/rules.mk | 4 ++-- platform/components/docker-gbsyncd-credo.mk | 4 ++-- platform/nephos/rules.mk | 2 +- platform/vs/onie.mk | 6 +++--- sonic-slave-stretch/Dockerfile.j2 | 8 ++++---- src/ixgbe/Makefile | 2 +- src/socat/Makefile | 6 +++--- src/swig/Makefile | 6 +++--- src/thrift/Makefile | 8 ++++---- 13 files changed, 30 insertions(+), 37 deletions(-) diff --git a/dockers/docker-base-buster/Dockerfile.j2 b/dockers/docker-base-buster/Dockerfile.j2 index a4139eaa3f11..b1940e90d79b 100644 --- a/dockers/docker-base-buster/Dockerfile.j2 +++ b/dockers/docker-base-buster/Dockerfile.j2 @@ -65,15 +65,15 @@ RUN apt-get update && \ # Install redis-tools {% 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-tools_6.0.6-1~bpo10+1_armhf.deb "https://sonicstorage.blob.core.windows.net/public/redis/redis-tools_6.0.6-1_bpo10+1_armhf.deb" RUN dpkg -i redis-tools_6.0.6-1~bpo10+1_armhf.deb || apt-get install -f -y RUN rm redis-tools_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-tools_6.0.6-1~bpo10+1_arm64.deb "https://sonicstorage.blob.core.windows.net/public/redis/redis-tools_6.0.6-1_bpo10+1_arm64.deb" RUN dpkg -i redis-tools_6.0.6-1~bpo10+1_arm64.deb || apt-get install -f -y RUN rm redis-tools_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-tools_6.0.6-1~bpo10+1_amd64.deb "https://sonicstorage.blob.core.windows.net/public/redis/redis-tools_6.0.6-1~bpo10+1_amd64.deb" RUN dpkg -i redis-tools_6.0.6-1~bpo10+1_amd64.deb || apt-get install -f -y RUN rm redis-tools_6.0.6-1~bpo10+1_amd64.deb {% endif %} diff --git a/dockers/docker-base-stretch/Dockerfile.j2 b/dockers/docker-base-stretch/Dockerfile.j2 index 652ca11e205c..df1025749cb4 100644 --- a/dockers/docker-base-stretch/Dockerfile.j2 +++ b/dockers/docker-base-stretch/Dockerfile.j2 @@ -64,15 +64,15 @@ RUN apt-get -y -t stretch-backports install rsyslog # Install redis-tools {% if CONFIGURED_ARCH == "armhf" %} - RUN curl -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 -o redis-tools_6.0.6-1~bpo10+1_armhf.deb "https://sonicstorage.blob.core.windows.net/public/redis/redis-tools_6.0.6-1_bpo10+1_armhf.deb" RUN dpkg -i redis-tools_6.0.6-1~bpo10+1_armhf.deb || apt-get install -f -y RUN rm redis-tools_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-tools_6.0.6-1~bpo10+1_arm64.deb "https://sonicstorage.blob.core.windows.net/public/redis/redis-tools_6.0.6-1_bpo10+1_arm64.deb" RUN dpkg -i redis-tools_6.0.6-1~bpo10+1_arm64.deb || apt-get install -f -y RUN rm redis-tools_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-tools_6.0.6-1~bpo10+1_amd64.deb "https://sonicstorage.blob.core.windows.net/public/redis/redis-tools_6.0.6-1~bpo10+1_amd64.deb" RUN dpkg -i redis-tools_6.0.6-1~bpo10+1_amd64.deb || apt-get install -f -y RUN rm redis-tools_6.0.6-1~bpo10+1_amd64.deb {% endif %} diff --git a/files/build/versions/default/versions-web b/files/build/versions/default/versions-web index 1da9bf76db10..4c93db4bf2cd 100644 --- a/files/build/versions/default/versions-web +++ b/files/build/versions/default/versions-web @@ -87,10 +87,6 @@ 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-4+deb11u1.debian.tar.xz==a3e626b1ed5adc26430e1727d81641df https://sonicstorage.blob.core.windows.net/debian/pool/main/n/net-snmp/net-snmp_5.9+dfsg-4+deb11u1.dsc==a36ed553b5034b7400d9e9a8d529b27e 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.9.3_amd64.deb?sv=2021-04-10&st=2023-10-12T02%3A21%3A51Z&se=2031-10-13T02%3A21%3A00Z&sr=b&sp=r&sig=olu3%2Bq5eJYRtXCygJWgKUx%2FdlrlB%2FWE0i9ruftYdB7g%3D==c69922a1589cf5615a3fddd5b66aa296 -https://sonicstorage.blob.core.windows.net/packages/credosai/libsaicredo_0.9.3_amd64.deb?sv=2021-04-10&st=2023-10-12T02%3A21%3A05Z&se=2031-10-13T02%3A21%3A00Z&sr=b&sp=r&sig=UXC%2FYKm%2BvHRjGmM3xjnFMQzY%2BMpxhKtMxNHQPdwvtN8%3D==0400bc2015f56bff7d4283c030be26cc 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 @@ -100,9 +96,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-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 https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.1/amd64/golang-1.15-go_1.15.15-1~deb11u4%2Bfips_amd64.deb==b60f6db62805696b47ab422ab798fe56 https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.1/amd64/golang-1.15-src_1.15.15-1~deb11u4%2Bfips_amd64.deb==1c920937aa49b602a1bfec3c49747131 https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.1/arm64/golang-1.15-go_1.15.15-1~deb11u4%2Bfips_arm64.deb==0b70c104b907db13ff2fe5d52b3d0008 diff --git a/get_docker-base.sh b/get_docker-base.sh index ff2bdeaff02b..0951e5fa1f5f 100755 --- a/get_docker-base.sh +++ b/get_docker-base.sh @@ -12,7 +12,7 @@ set -x -e TARGET_PATH=$(sed -n 's/TARGET_PATH\s*=\s*//p' slave.mk) ## [SuppressMessage("Microsoft.Security", "CS002:SecretInNextLine", Justification="Read-only link of Azure Blob storage with shared access signature (SAS)")] -BASE_URL="https://sonicstorage.blob.core.windows.net/packages/docker-base.ea507753d98b0769e2a15be13003331f8ad38d1c15b40a683e05fc53b1463b10.gz?sv=2015-04-05&sr=b&sig=YNN6eYVMEFndUaiHIRnqcZFdDZwIG%2BaAuVj0IoyDWPw%3D&se=2026-10-27T20%3A46%3A18Z&sp=r" +BASE_URL="https://sonicstorage.blob.core.windows.net/public/docker-base.ea507753d98b0769e2a15be13003331f8ad38d1c15b40a683e05fc53b1463b10.gz" base_image_name=docker-base docker_try_rmi $base_image_name diff --git a/platform/broadcom/rules.mk b/platform/broadcom/rules.mk index 46700df119b1..33d3195b66d5 100755 --- a/platform/broadcom/rules.mk +++ b/platform/broadcom/rules.mk @@ -36,10 +36,10 @@ include $(PLATFORM_PATH)/../components/docker-gbsyncd-broncos.mk endif BCMCMD = bcmcmd -$(BCMCMD)_URL = "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" +$(BCMCMD)_URL = "https://sonicstorage.blob.core.windows.net/public/20190307/bcmcmd" DSSERVE = dsserve -$(DSSERVE)_URL = "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" +$(DSSERVE)_URL = "https://sonicstorage.blob.core.windows.net/public/20190307/dsserve" SONIC_ONLINE_FILES += $(BCMCMD) $(DSSERVE) diff --git a/platform/components/docker-gbsyncd-credo.mk b/platform/components/docker-gbsyncd-credo.mk index 2181add0f9c3..a500a34a45bc 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.9.3_amd64.deb -$(LIBSAI_CREDO)_URL = "https://sonicstorage.blob.core.windows.net/packages/credosai/libsaicredo_0.9.3_amd64.deb?sv=2021-04-10&st=2023-10-12T02%3A21%3A05Z&se=2031-10-13T02%3A21%3A00Z&sr=b&sp=r&sig=UXC%2FYKm%2BvHRjGmM3xjnFMQzY%2BMpxhKtMxNHQPdwvtN8%3D" +$(LIBSAI_CREDO)_URL = "https://sonicstorage.blob.core.windows.net/public/credosai/libsaicredo_0.9.3_amd64.deb" LIBSAI_CREDO_OWL = libsaicredo-owl_0.9.3_amd64.deb -$(LIBSAI_CREDO_OWL)_URL = "https://sonicstorage.blob.core.windows.net/packages/credosai/libsaicredo-owl_0.9.3_amd64.deb?sv=2021-04-10&st=2023-10-12T02%3A21%3A51Z&se=2031-10-13T02%3A21%3A00Z&sr=b&sp=r&sig=olu3%2Bq5eJYRtXCygJWgKUx%2FdlrlB%2FWE0i9ruftYdB7g%3D" +$(LIBSAI_CREDO_OWL)_URL = "https://sonicstorage.blob.core.windows.net/public/credosai/libsaicredo-owl_0.9.3_amd64.deb?" ifneq ($($(LIBSAI_CREDO)_URL),) include $(PLATFORM_PATH)/../template/docker-gbsyncd-base.mk diff --git a/platform/nephos/rules.mk b/platform/nephos/rules.mk index 4ee2443e7585..2691de76adaf 100644 --- a/platform/nephos/rules.mk +++ b/platform/nephos/rules.mk @@ -15,7 +15,7 @@ WARM_VERIFIER = warm-verifier $(WARM_VERIFIER)_URL = "https://github.com/NephosInc/SONiC/raw/master/sai/warm-verifier" DSSERVE = dsserve -$(DSSERVE)_URL = "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" +$(DSSERVE)_URL = "https://sonicstorage.blob.core.windows.net/public/20190307/dsserve" SONIC_ONLINE_FILES += $(NPX_DIAG) $(WARM_VERIFIER) $(DSSERVE) diff --git a/platform/vs/onie.mk b/platform/vs/onie.mk index c64a09b8861b..9d4f843b0e08 100644 --- a/platform/vs/onie.mk +++ b/platform/vs/onie.mk @@ -1,10 +1,10 @@ ONIE_RECOVERY_IMAGE = onie-recovery-x86_64-kvm_x86_64-r0.iso -$(ONIE_RECOVERY_IMAGE)_URL = "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" +$(ONIE_RECOVERY_IMAGE)_URL = "https://sonicstorage.blob.core.windows.net/public/onie/onie-recovery-x86_64-kvm_x86_64-r0.iso" ONIE_RECOVERY_KVM_4ASIC_IMAGE = onie-recovery-x86_64-kvm_x86_64_4_asic-r0.iso -$(ONIE_RECOVERY_KVM_4ASIC_IMAGE)_URL = "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" +$(ONIE_RECOVERY_KVM_4ASIC_IMAGE)_URL = "https://sonicstorage.blob.core.windows.net/public/onie/onie-recovery-x86_64-kvm_x86_64_4_asic-r0.iso" ONIE_RECOVERY_KVM_6ASIC_IMAGE = onie-recovery-x86_64-kvm_x86_64_6_asic-r0.iso -$(ONIE_RECOVERY_KVM_6ASIC_IMAGE)_URL = "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" +$(ONIE_RECOVERY_KVM_6ASIC_IMAGE)_URL = "https://sonicstorage.blob.core.windows.net/public/onie/onie-recovery-x86_64-kvm_x86_64_6_asic-r0.iso" SONIC_ONLINE_FILES += $(ONIE_RECOVERY_IMAGE) $(ONIE_RECOVERY_KVM_4ASIC_IMAGE) $(ONIE_RECOVERY_KVM_6ASIC_IMAGE) diff --git a/sonic-slave-stretch/Dockerfile.j2 b/sonic-slave-stretch/Dockerfile.j2 index d63861c6d98f..5d2d345e23a9 100644 --- a/sonic-slave-stretch/Dockerfile.j2 +++ b/sonic-slave-stretch/Dockerfile.j2 @@ -373,16 +373,16 @@ RUN apt-get install -y libarchive13 librhash0 RUN apt-get -t stretch-backports install -y libuv1 # Install cmake/cmake-data 3.13.2-1_bpo9+1 # latest cmake 3.16.3 break the build libyang 1.0.73 -RUN wget -O cmake-data_3.13.2-1_bpo9+1_all.deb "https://sonicstorage.blob.core.windows.net/packages/cmake/cmake-data_3.13.2-1_bpo9%2B1_all.deb?st=2020-03-27T02%3A22%3A24Z&se=2100-03-26T19%3A00%3A00Z&sp=rl&sv=2018-03-28&sr=b&sig=Xby%2Bm3OZOjPB%2FSlDbHD65yDcPzAgoys%2FA3vK8RB4BzA%3D" +RUN wget -O cmake-data_3.13.2-1_bpo9+1_all.deb "https://sonicstorage.blob.core.windows.net/public/cmake/cmake-data_3.13.2-1_bpo9%2B1_all.deb" RUN dpkg -i cmake-data_3.13.2-1_bpo9+1_all.deb || apt-get install -f {% if CONFIGURED_ARCH == "armhf" %} -RUN wget -O cmake_3.13.2-1_bpo9+1_armhf.deb "https://sonicstorage.blob.core.windows.net/packages/cmake/cmake_3.13.2-1_bpo9%2B1_armhf.deb?st=2020-03-27T02%3A29%3A41Z&se=2100-03-26T19%3A00%3A00Z&sp=rl&sv=2018-03-28&sr=b&sig=sWt7kxrFumn020d2GeutGJ716cuQsFwmAmgU%2BJ0kqnk%3D" +RUN wget -O cmake_3.13.2-1_bpo9+1_armhf.deb "https://sonicstorage.blob.core.windows.net/public/cmake/cmake_3.13.2-1_bpo9%2B1_armhf.deb" RUN dpkg -i cmake_3.13.2-1_bpo9+1_armhf.deb || apt-get install -f {% elif CONFIGURED_ARCH == "arm64" %} -RUN wget -O cmake_3.13.2-1_bpo9+1_arm64.deb "https://sonicstorage.blob.core.windows.net/packages/cmake/cmake_3.13.2-1_bpo9%2B1_arm64.deb?st=2020-03-27T02%3A28%3A38Z&se=2100-03-26T19%3A00%3A00Z&sp=rl&sv=2018-03-28&sr=b&sig=rrHMkLi29aI8yH6s52ILCY8VcEbNFrzYT2DmC5RwOgs%3D" +RUN wget -O cmake_3.13.2-1_bpo9+1_arm64.deb "https://sonicstorage.blob.core.windows.net/public/cmake/cmake_3.13.2-1_bpo9%2B1_arm64.deb" RUN dpkg -i cmake_3.13.2-1_bpo9+1_arm64.deb || apt-get install -f {% else %} -RUN wget -O cmake_3.13.2-1_bpo9+1_amd64.deb "https://sonicstorage.blob.core.windows.net/packages/cmake/cmake_3.13.2-1_bpo9%2B1_amd64.deb?st=2020-03-27T02%3A27%3A21Z&se=2100-03-26T19%3A00%3A00Z&sp=rl&sv=2018-03-28&sr=b&sig=4MvmmDBQuicFEJYakLm7xCNU19yJ8GIP4ankFSnITKY%3D" +RUN wget -O cmake_3.13.2-1_bpo9+1_amd64.deb "https://sonicstorage.blob.core.windows.net/public/cmake/cmake_3.13.2-1_bpo9%2B1_amd64.deb" RUN dpkg -i cmake_3.13.2-1_bpo9+1_amd64.deb || apt-get install -f {% endif %} RUN cd /usr/src/gtest && cmake . && make -C /usr/src/gtest diff --git a/src/ixgbe/Makefile b/src/ixgbe/Makefile index 90d20e606ef6..7514a08fae72 100644 --- a/src/ixgbe/Makefile +++ b/src/ixgbe/Makefile @@ -6,7 +6,7 @@ MAIN_TARGET = ixgbe.ko $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : rm -rf ./ixgbe-$(IXGBE_DRIVER_VERSION) - wget -O ixgbe-$(IXGBE_DRIVER_VERSION).tar.gz "https://sonicstorage.blob.core.windows.net/packages/ixgbe-5.2.4.tar.gz?sv=2015-04-05&sr=b&sig=AaqJHHaPiJRp8R3HKobi0GNDgHAVnqijk6hpahwJ0Mg%3D&se=2154-10-05T22%3A19%3A29Z&sp=r" + wget -O ixgbe-$(IXGBE_DRIVER_VERSION).tar.gz "https://sonicstorage.blob.core.windows.net/public/ixgbe-5.2.4.tar.gz" tar xzf ixgbe-$(IXGBE_DRIVER_VERSION).tar.gz # Patch diff --git a/src/socat/Makefile b/src/socat/Makefile index 8df6c826007b..db1fd3d02597 100644 --- a/src/socat/Makefile +++ b/src/socat/Makefile @@ -9,9 +9,9 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : rm -rf ./socat-1.7.4.1 # Get source package - wget -NO socat_$(SOCAT_VERSION).dsc "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" - wget -NO socat_$(SOCAT_VERSION).debian.tar.xz "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" - wget -NO socat_1.7.4.1.orig.tar.gz "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" + wget -NO socat_$(SOCAT_VERSION).dsc "https://sonicstorage.blob.core.windows.net/public/debian/socat_1.7.4.1-3.dsc" + wget -NO socat_$(SOCAT_VERSION).debian.tar.xz "https://sonicstorage.blob.core.windows.net/public/debian/socat_1.7.4.1-3.debian.tar.xz" + wget -NO socat_1.7.4.1.orig.tar.gz "https://sonicstorage.blob.core.windows.net/public/debian/socat_1.7.4.1.orig.tar.gz" dpkg-source -x socat_$(SOCAT_VERSION).dsc diff --git a/src/swig/Makefile b/src/swig/Makefile index f00d86521806..2e3dc237da88 100644 --- a/src/swig/Makefile +++ b/src/swig/Makefile @@ -7,9 +7,9 @@ DERIVED_TARGETS = $(SWIG) $(SWIG_DBG) $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : rm -fr ./swig-$(SWIG_VERSION) *.deb - wget -O swig_$(SWIG_VERSION).orig.tar.gz 'https://sonicstorage.blob.core.windows.net/packages/swig_3.0.12.orig.tar.gz?sv=2015-04-05&sr=b&sig=kcSKFvlTQZst8Dbb8MUfckGbVEZU5sptFqT2HbwOUtA%3D&se=2046-09-30T22%3A11%3A59Z&sp=r' - wget -O swig_$(SWIG_VERSION).dsc 'https://sonicstorage.blob.core.windows.net/packages/swig_3.0.12-2.dsc?sv=2015-04-05&sr=b&sig=k3eLfmWgmCz1Kx8SYcirX18FSQdJ76ifo%2B9rbJBnrf8%3D&se=2046-09-30T22%3A11%3A45Z&sp=r' - wget -O swig_$(SWIG_VERSION)-$(SWIG_SUBVERSION).debian.tar.xz 'https://sonicstorage.blob.core.windows.net/packages/swig_3.0.12-2.debian.tar.xz?sv=2015-04-05&sr=b&sig=SQICTE%2BR1BO7npUBNwTQjo447OaFz%2BooX6VAm912c7g%3D&se=2046-09-30T22%3A11%3A32Z&sp=r' + wget -O swig_$(SWIG_VERSION).orig.tar.gz 'https://sonicstorage.blob.core.windows.net/public/swig_3.0.12.orig.tar.gz' + wget -O swig_$(SWIG_VERSION).dsc 'https://sonicstorage.blob.core.windows.net/public/swig_3.0.12-2.dsc' + wget -O swig_$(SWIG_VERSION)-$(SWIG_SUBVERSION).debian.tar.xz 'https://sonicstorage.blob.core.windows.net/public/swig_3.0.12-2.debian.tar.xz' dpkg-source -x swig_$(SWIG_VERSION).dsc pushd ./swig-$(SWIG_VERSION) diff --git a/src/thrift/Makefile b/src/thrift/Makefile index 643cc61faf45..293b659124d4 100644 --- a/src/thrift/Makefile +++ b/src/thrift/Makefile @@ -10,14 +10,14 @@ DERIVED_TARGETS = libthrift-dev_$(THRIFT_VERSION_FULL)_$(CONFIGURED_ARCH).deb \ python-thrift_$(THRIFT_VERSION_FULL)_$(CONFIGURED_ARCH).deb \ thrift-compiler_$(THRIFT_VERSION_FULL)_$(CONFIGURED_ARCH).deb -THRIFT_LINK_PRE = https://sonicstorage.blob.core.windows.net/packages/debian +THRIFT_LINK_PRE = https://sonicstorage.blob.core.windows.net/public/debian $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : rm -rf thrift-$(THRIFT_VERSION) - wget -NO "thrift_$(THRIFT_VERSION).orig.tar.gz" "$(THRIFT_LINK_PRE)/thrift_0.11.0.orig.tar.gz?sv=2015-04-05&sr=b&sig=%2BrAjWESiSNRCMN7NGqEqVGceLefpwwS%2FWPKEfJpPLSQ%3D&se=2156-02-02T17%3A17%3A20Z&sp=r" - wget -NO "thrift_$(THRIFT_VERSION_FULL).debian.tar.xz" "$(THRIFT_LINK_PRE)/thrift_0.11.0-4.debian.tar.xz?sv=2015-04-05&sr=b&sig=dj9uJ5YjUNupcmuxSX6%2F5IS9NqaGAyM9iF2h%2F2rROZA%3D&se=2156-02-02T17%3A19%3A34Z&sp=r" - wget -NO "thrift_$(THRIFT_VERSION_FULL).dsc" "$(THRIFT_LINK_PRE)/thrift_0.11.0-4.dsc?sv=2015-04-05&sr=b&sig=pWfg55owvQ2jZtZ6ylHp0OP8uZyfc9sxO6H%2BP4Ez7w4%3D&se=2156-02-02T17%3A20%3A05Z&sp=r" + wget -NO "thrift_$(THRIFT_VERSION).orig.tar.gz" "$(THRIFT_LINK_PRE)/thrift_0.11.0.orig.tar.gz" + wget -NO "thrift_$(THRIFT_VERSION_FULL).debian.tar.xz" "$(THRIFT_LINK_PRE)/thrift_0.11.0-4.debian.tar.xz" + wget -NO "thrift_$(THRIFT_VERSION_FULL).dsc" "$(THRIFT_LINK_PRE)/thrift_0.11.0-4.dsc" dpkg-source -x thrift_$(THRIFT_VERSION_FULL).dsc pushd thrift-$(THRIFT_VERSION) From 7d44c6b00b7895075554b0ac2e999608f9f05b17 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Tue, 5 Mar 2024 02:12:32 +0800 Subject: [PATCH 176/419] [build] Update debootstrap version from deb11u1 to deb11u2 (#18185) (#18236) Why I did it deb11u1 is deprecated. Use deb11u2 instead. Other branches are not impacted, because their reproducible build version files are up to date. Work item tracking Microsoft ADO (number only): 26964185 How I did it How to verify it Co-authored-by: Liu Shilong --- rules/debootstrap.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules/debootstrap.mk b/rules/debootstrap.mk index a74fa22e9faa..d325932ef653 100644 --- a/rules/debootstrap.mk +++ b/rules/debootstrap.mk @@ -1,6 +1,6 @@ # debootstrap package -DEBOOTSTRAP_VERSION = 1.0.123+deb11u1 +DEBOOTSTRAP_VERSION = 1.0.123+deb11u2 export DEBOOTSTRAP_VERSION From 865d2ba44b54c01700ed46a90a094864ad51ab1c Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Thu, 29 Feb 2024 21:46:49 +0800 Subject: [PATCH 177/419] [Mellanox] Extend the time to wait for EEPROM VPD file creation (#18146) - Why I did it The creation of system EEPROM VPD file "/var/run/hw-management/eeprom/vpd_info" is triggered by the udev event during the system boot up, in case the CPU is busy during the bootup, the udev event handling can be delayed, and need to wait for some more time for the file creation. - How I did it Extend the waiting time from 10s to 20s to overcome some extreme case. - How to verify it continuously run reboot case and verify whether still can see error msg "ERR decode-syseeprom: Nowhere to read syseeprom from! No symlink found" Signed-off-by: Kebo Liu --- platform/mellanox/mlnx-platform-api/sonic_platform/eeprom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/eeprom.py b/platform/mellanox/mlnx-platform-api/sonic_platform/eeprom.py index 2767a24d3bf1..8a2aa058cb42 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/eeprom.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/eeprom.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2023 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -51,7 +51,7 @@ os.makedirs(os.path.dirname(EEPROM_SYMLINK)) subprocess.check_call(['/usr/bin/xxd', '-r', '-p', 'syseeprom.hex', EEPROM_SYMLINK], cwd=platform_path) -WAIT_EEPROM_READY_SEC = 10 +WAIT_EEPROM_READY_SEC = 20 class Eeprom(eeprom_tlvinfo.TlvInfoDecoder): From a162676487128a01ef5552b2db5c12afeafe3cea Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 5 Mar 2024 19:01:09 +0800 Subject: [PATCH 178/419] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#18264) #### Why I did it src/sonic-swss ``` * c4fd095e - (HEAD -> 202311, origin/202311) Fix multi VLAN neighbor learning (#3049) (#3064) (65 minutes ago) [Lawrence Lee] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 64d5fdd9b3b5..c4fd095e180a 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 64d5fdd9b3b5862585c20c27e539f9112e9177c7 +Subproject commit c4fd095e180a4e34b51fc7017213f945507d9051 From e13e38b853d0f39c074ed0f25b606a5905f7f682 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 5 Mar 2024 19:01:20 +0800 Subject: [PATCH 179/419] [submodule] Update submodule sonic-platform-daemons to the latest HEAD automatically (#18261) #### Why I did it src/sonic-platform-daemons ``` * 83e5106 - (HEAD -> 202311, origin/202311) Updated supported CMIS module types in xcvrd to include new module for SPC4 (#440) (4 hours ago) [Tomer Shalvi] * f390d8d - Mark sub-port interfaces as invalid ports in xcvrd (#412) (21 hours ago) [mihirpat1] ``` #### How I did it #### How to verify it #### Description for the changelog --- 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 7792838612e9..83e51060a337 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit 7792838612e99da4001bd1265ea9c44fc8416024 +Subproject commit 83e51060a3379f1c714faf53387d92355e67d75e From 1867d24b38e9de3bcda9c34c9b3544c4f2f86e1a Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 5 Mar 2024 19:01:48 +0800 Subject: [PATCH 180/419] [submodule] Update submodule linkmgrd to the latest HEAD automatically (#18255) #### Why I did it src/linkmgrd ``` * 1f5fcfd - (HEAD -> 202311, origin/202311) Exclude DbInterface in PR coverage check (#224) (21 hours ago) [Jing Zhang] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/linkmgrd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linkmgrd b/src/linkmgrd index 70b6d15fad7f..1f5fcfd21b11 160000 --- a/src/linkmgrd +++ b/src/linkmgrd @@ -1 +1 @@ -Subproject commit 70b6d15fad7f40d80597791cbc963a59d68c087f +Subproject commit 1f5fcfd21b112c4765d20691c8c4bf8d2842f0c2 From 86613b8dcc3e1780fce912e4832e494868e7de7f Mon Sep 17 00:00:00 2001 From: noaOrMlnx <58519608+noaOrMlnx@users.noreply.github.com> Date: Mon, 4 Mar 2024 16:38:51 +0200 Subject: [PATCH 181/419] [Mellanox] Fix timing issue in lpmode change (#18223) - Why I did it Changing LPMODE timing is different between cables. We want to add functionality to make sure LPMODE has changed. For that, the wait_until utility is used and every 1 second (until timeout), it will check with lower-layers what is the current Lpmode. Once it is the expected mode, set_lpmode() functino will return True. If after seconds, Lpmode is still not in the expected mode, set_lpmode() function will return False. - How I did it Add use of wait_until function to make sure lpmode was changed. - How to verify it sfputil lpmode on sfputil lpmode off --- .../mellanox/mlnx-platform-api/sonic_platform/sfp.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index f6a9380bf6aa..90462e9ed0fe 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2023 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -640,7 +640,12 @@ def set_lpmode(self, lpmode): if api.get_lpmode() == lpmode: return True api.set_lpmode(lpmode) - return api.get_lpmode() == lpmode + # check_lpmode is a lambda function which checks if current lpmode already updated to the desired lpmode + check_lpmode = lambda api, lpmode: api.get_lpmode() == lpmode + # utils.wait_until function will call check_lpmode function every 1 second for a total timeout of 2 seconds. + # If at some point get_lpmode=desired_lpmode, it will return true. + # If after timeout ends, lpmode will not be desired_lpmode, it will return false. + return utils.wait_until(check_lpmode, 2, 1, api=api, lpmode=lpmode) elif DeviceDataManager.is_independent_mode(): # FW control under CMIS host management mode. # Currently, we don't support set LPM under this mode. From a93a8f84a12a865d8fd102615cc3740ff708aec1 Mon Sep 17 00:00:00 2001 From: Pavan-Nokia <120486223+Pavan-Nokia@users.noreply.github.com> Date: Mon, 4 Mar 2024 13:53:00 -0500 Subject: [PATCH 182/419] [Nokia-7215-A1]Update Nokia-7215-A1 Platform (#18147) 1) Update Nokia-7215-A1 platform to address UT and OC test failures 2) Enable watchdog service 3) EZB files for SAI upgrade --- .../Nokia-7215-A1/ASK-Board-AC5X-xb.md5 | 2 +- .../Nokia-7215-A1/ASK-Board-AC5X-xb.xml | 290 ++++++------------ .../Nokia-7215-A1/ASK-L1-AC5X-xb.md5 | 2 +- .../Nokia-7215-A1/ASK-L1-AC5X-xb.xml | 2 +- .../Nokia-7215-A1/ASK-PP-AC5X-xb.md5 | 2 +- .../Nokia-7215-A1/ASK-PP-AC5X-xb.xml | 24 +- .../Nokia-7215-A1/SAI-AC5X-xb.md5 | 2 +- .../Nokia-7215-A1/SAI-AC5X-xb.xml | 138 ++++++++- .../installer.conf | 1 - .../arm64-nokia_ixs7215_52xb-r0/pcie.yaml | 10 + .../arm64-nokia_ixs7215_52xb-r0/platform.json | 11 +- .../platform_reboot | 10 +- .../pmon_daemon_control.json | 3 - .../system_health_monitoring_config.json | 4 +- .../7215/modules/Makefile | 2 +- .../7215/modules/ac5_thermal_sensor.c | 218 ------------- .../7215/modules/cn9130_cpu_thermal_sensor.c | 242 +++++++++++++++ .../7215/scripts/cpu_wdt.py | 46 +++ .../7215/service/cpu_wdt.service | 8 + .../7215/sonic_platform/chassis.py | 23 +- .../7215/sonic_platform/component.py | 2 +- .../7215/sonic_platform/eeprom.py | 3 +- .../7215/sonic_platform/fan.py | 34 +- .../7215/sonic_platform/psu.py | 34 +- .../7215/sonic_platform/sfp.py | 2 +- .../7215/sonic_platform/thermal.py | 73 +++-- .../7215/sonic_platform/thermal_infos.py | 33 +- .../7215/sonic_platform/watchdog.py | 159 ++++++---- .../sonic-platform-nokia/debian/rules | 2 +- .../debian/sonic-platform-nokia-7215.install | 2 + .../debian/sonic-platform-nokia-7215.postinst | 3 + 31 files changed, 818 insertions(+), 569 deletions(-) create mode 100644 device/nokia/arm64-nokia_ixs7215_52xb-r0/pcie.yaml mode change 100644 => 100755 device/nokia/arm64-nokia_ixs7215_52xb-r0/platform_reboot delete mode 100644 device/nokia/arm64-nokia_ixs7215_52xb-r0/pmon_daemon_control.json delete mode 100644 platform/marvell-arm64/sonic-platform-nokia/7215/modules/ac5_thermal_sensor.c create mode 100644 platform/marvell-arm64/sonic-platform-nokia/7215/modules/cn9130_cpu_thermal_sensor.c create mode 100755 platform/marvell-arm64/sonic-platform-nokia/7215/scripts/cpu_wdt.py create mode 100644 platform/marvell-arm64/sonic-platform-nokia/7215/service/cpu_wdt.service diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-Board-AC5X-xb.md5 b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-Board-AC5X-xb.md5 index 64cb21addf3a..fe63caf784ee 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-Board-AC5X-xb.md5 +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-Board-AC5X-xb.md5 @@ -1 +1 @@ -ee44e299ca857b9f0abf2e804ec4850f \ No newline at end of file +4983b60d1d68623c202b91093f3730db \ No newline at end of file diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-Board-AC5X-xb.xml b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-Board-AC5X-xb.xml index 08936c1339e4..20cdef069c45 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-Board-AC5X-xb.xml +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-Board-AC5X-xb.xml @@ -1,5 +1,5 @@ - + @@ -82,9 +82,9 @@ device-id-type uint32 - Device ID 0..1023 + Device ID 0..1 0 - 1023 + 1 port-mapping-type @@ -111,11 +111,9 @@ txq-port-number-type uint32 - 0 - 8 queues are configured per port (legacy mode), -1...16 - the number of queues configured per port - SIP 5 : Bobcat2,BobK:0..71 ;Bobcat3: 0..576 ;Aldrin2:0..99 + TXq port number 0 - 576 + 99 phy-smi-interface-type @@ -162,12 +160,14 @@ alaska-88E3140 - Specifies PHY identifier 88E3140, used for Copper with speeds of 100M/1G/10G. Uses with FW SolarFlare next generation. + Specifies PHY identifier 88E3140, used for Copper with speeds of 100M/1G/10G. +Uses with FW SolarFlare next generation. 5 alaska-88E3240 - Specifies PHY identifier 88E3240, used for Copper with speeds of 100M/1G/10G. Uses with FW, SolarFlare next generation. + Specifies PHY identifier 88E3240, used for Copper with speeds of 100M/1G/10G. +Uses with FW, SolarFlare next generation. 6 @@ -177,7 +177,8 @@ alaska-88E3220 - Specifies PHY identifier 88E3220, used for Combo port with speeds of 100M/1G/10G. Uses FW, SolarFlare next generation. + Specifies PHY identifier 88E3220, used for Combo port with speeds of 100M/1G/10G. +Uses FW, SolarFlare next generation. 8 @@ -212,17 +213,20 @@ alaska-88E1780 - Specifies PHY identifier 88E1780, Integrated Octal 10/100/1000 Mbps Energy Efficient Ethernet Transceiver + Specifies PHY identifier 88E1780, Integrated Octal 10/100/1000 Mbps Energy +Efficient Ethernet Transceiver 15 alaska-88E2540 - Specifies PHY identifier 88E2540, 4 ports 10/100/1000/2.5G/5GBASE-T Ethernet Transceiver with IEEE 1588v2 PTP Support + Specifies PHY identifier 88E2540, 4 ports 10/100/1000/2.5G/5GBASE-T Ethernet +Transceiver with IEEE 1588v2 PTP Support 16 alaska-88E2580 - Specifies PHY identifier 88E12580, Octal 10/100/1000/2.5G/5GBASE-T Ethernet Transceiver with IEEE 1588v2 PTP Support + Specifies PHY identifier 88E12580, Octal 10/100/1000/2.5G/5GBASE-T Ethernet Transceiver +with IEEE 1588v2 PTP Support 17 @@ -510,7 +514,7 @@ uint32 serdes lane 0 - 255 + 7 cpu-type @@ -589,12 +593,12 @@ lowercase characters. sip5 - SIP5: AC5, AC3x + SIP5: AC3x 5 sip6 - SIP6: Falcon, AC5x, AC5P + SIP6: Falcon, AC5x 6 @@ -665,12 +669,28 @@ lowercase characters. 1 + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_AC5X AC5X-xb linux-static linux-static autoscan - internal + external pex_eagle 0 @@ -683,10 +703,8 @@ lowercase characters. ethernet_mac 0 - 0 false - NETWORK alaska-88E1780 0 @@ -704,10 +722,8 @@ lowercase characters. ethernet_mac 1 - 0 false - NETWORK alaska-88E1780 0 @@ -725,10 +741,8 @@ lowercase characters. ethernet_mac 2 - 0 false - NETWORK alaska-88E1780 0 @@ -746,10 +760,8 @@ lowercase characters. ethernet_mac 3 - 0 false - NETWORK alaska-88E1780 0 @@ -767,10 +779,8 @@ lowercase characters. ethernet_mac 4 - 0 false - NETWORK alaska-88E1780 0 @@ -788,10 +798,8 @@ lowercase characters. ethernet_mac 5 - 0 false - NETWORK alaska-88E1780 0 @@ -809,10 +817,8 @@ lowercase characters. ethernet_mac 6 - 0 false - NETWORK alaska-88E1780 0 @@ -830,10 +836,8 @@ lowercase characters. ethernet_mac 7 - 0 false - NETWORK alaska-88E1780 0 @@ -851,10 +855,8 @@ lowercase characters. ethernet_mac 8 - 0 false - NETWORK alaska-88E1780 1 @@ -872,10 +874,8 @@ lowercase characters. ethernet_mac 9 - 0 false - NETWORK alaska-88E1780 1 @@ -893,10 +893,8 @@ lowercase characters. ethernet_mac 10 - 0 false - NETWORK alaska-88E1780 1 @@ -914,10 +912,8 @@ lowercase characters. ethernet_mac 11 - 0 false - NETWORK alaska-88E1780 1 @@ -935,10 +931,8 @@ lowercase characters. ethernet_mac 12 - 0 false - NETWORK alaska-88E1780 1 @@ -956,10 +950,8 @@ lowercase characters. ethernet_mac 13 - 0 false - NETWORK alaska-88E1780 1 @@ -977,10 +969,8 @@ lowercase characters. ethernet_mac 14 - 0 false - NETWORK alaska-88E1780 1 @@ -998,10 +988,8 @@ lowercase characters. ethernet_mac 15 - 0 false - NETWORK alaska-88E1780 1 @@ -1019,10 +1007,8 @@ lowercase characters. ethernet_mac 16 - 0 false - NETWORK alaska-88E1780 2 @@ -1040,10 +1026,8 @@ lowercase characters. ethernet_mac 17 - 0 false - NETWORK alaska-88E1780 2 @@ -1061,10 +1045,8 @@ lowercase characters. ethernet_mac 18 - 0 false - NETWORK alaska-88E1780 2 @@ -1082,10 +1064,8 @@ lowercase characters. ethernet_mac 19 - 0 false - NETWORK alaska-88E1780 2 @@ -1103,10 +1083,8 @@ lowercase characters. ethernet_mac 20 - 0 false - NETWORK alaska-88E1780 2 @@ -1124,10 +1102,8 @@ lowercase characters. ethernet_mac 21 - 0 false - NETWORK alaska-88E1780 2 @@ -1145,10 +1121,8 @@ lowercase characters. ethernet_mac 22 - 0 false - NETWORK alaska-88E1780 2 @@ -1166,10 +1140,8 @@ lowercase characters. ethernet_mac 23 - 0 false - NETWORK alaska-88E1780 2 @@ -1187,10 +1159,8 @@ lowercase characters. ethernet_mac 24 - 0 false - NETWORK alaska-88E1780 3 @@ -1208,10 +1178,8 @@ lowercase characters. ethernet_mac 25 - 0 false - NETWORK alaska-88E1780 3 @@ -1229,10 +1197,8 @@ lowercase characters. ethernet_mac 26 - 0 false - NETWORK alaska-88E1780 3 @@ -1250,10 +1216,8 @@ lowercase characters. ethernet_mac 27 - 0 false - NETWORK alaska-88E1780 3 @@ -1271,10 +1235,8 @@ lowercase characters. ethernet_mac 28 - 0 false - NETWORK alaska-88E1780 3 @@ -1292,10 +1254,8 @@ lowercase characters. ethernet_mac 29 - 0 false - NETWORK alaska-88E1780 3 @@ -1313,10 +1273,8 @@ lowercase characters. ethernet_mac 30 - 0 false - NETWORK alaska-88E1780 3 @@ -1334,10 +1292,8 @@ lowercase characters. ethernet_mac 31 - 0 false - NETWORK alaska-88E1780 3 @@ -1355,10 +1311,8 @@ lowercase characters. ethernet_mac 32 - 0 false - NETWORK alaska-88E1780 4 @@ -1372,18 +1326,16 @@ lowercase characters. - 33 + 47 ethernet_mac - 33 - 0 + 47 false - NETWORK alaska-88E1780 - 4 - 9 + 6 + 23 1 @@ -1393,18 +1345,16 @@ lowercase characters. - 34 + 46 ethernet_mac - 34 - 0 + 46 false - NETWORK alaska-88E1780 - 4 - 10 + 6 + 22 1 @@ -1414,18 +1364,16 @@ lowercase characters. - 35 + 45 ethernet_mac - 35 - 0 + 45 false - NETWORK alaska-88E1780 - 4 - 11 + 6 + 21 1 @@ -1435,18 +1383,16 @@ lowercase characters. - 36 + 44 ethernet_mac - 36 - 0 + 44 false - NETWORK alaska-88E1780 - 4 - 12 + 6 + 20 1 @@ -1456,18 +1402,16 @@ lowercase characters. - 37 + 43 ethernet_mac - 37 - 0 + 43 false - NETWORK alaska-88E1780 - 4 - 13 + 5 + 19 1 @@ -1477,18 +1421,16 @@ lowercase characters. - 38 + 42 ethernet_mac - 38 - 0 + 42 false - NETWORK alaska-88E1780 - 4 - 14 + 5 + 18 1 @@ -1498,18 +1440,16 @@ lowercase characters. - 39 + 41 ethernet_mac - 39 - 0 + 41 false - NETWORK alaska-88E1780 - 4 - 15 + 5 + 17 1 @@ -1523,10 +1463,8 @@ lowercase characters. ethernet_mac 40 - 0 false - NETWORK alaska-88E1780 5 @@ -1540,18 +1478,16 @@ lowercase characters. - 41 + 39 ethernet_mac - 41 - 0 + 39 false - NETWORK alaska-88E1780 - 5 - 17 + 4 + 15 1 @@ -1561,18 +1497,16 @@ lowercase characters. - 42 + 38 ethernet_mac - 42 - 0 + 38 false - NETWORK alaska-88E1780 - 5 - 18 + 4 + 14 1 @@ -1582,18 +1516,16 @@ lowercase characters. - 43 + 37 ethernet_mac - 43 - 0 + 37 false - NETWORK alaska-88E1780 - 5 - 19 + 4 + 13 1 @@ -1603,18 +1535,16 @@ lowercase characters. - 44 + 36 ethernet_mac - 44 - 0 + 36 false - NETWORK alaska-88E1780 - 6 - 20 + 4 + 12 1 @@ -1624,18 +1554,16 @@ lowercase characters. - 45 + 35 ethernet_mac - 45 - 0 + 35 false - NETWORK alaska-88E1780 - 6 - 21 + 4 + 11 1 @@ -1645,18 +1573,16 @@ lowercase characters. - 46 + 34 ethernet_mac - 46 - 0 + 34 false - NETWORK alaska-88E1780 - 6 - 22 + 4 + 10 1 @@ -1666,18 +1592,16 @@ lowercase characters. - 47 + 33 ethernet_mac - 47 - 0 + 33 false - NETWORK alaska-88E1780 - 6 - 23 + 4 + 9 1 @@ -1691,10 +1615,8 @@ lowercase characters. ethernet_mac 49 - 0 false - NETWORK NA @@ -1703,7 +1625,7 @@ lowercase characters. 0 2 - false + true false @@ -1713,10 +1635,8 @@ lowercase characters. ethernet_mac 48 - 0 false - NETWORK NA @@ -1725,7 +1645,7 @@ lowercase characters. 1 2 - false + true false @@ -1735,10 +1655,8 @@ lowercase characters. ethernet_mac 51 - 0 false - NETWORK NA @@ -1747,7 +1665,7 @@ lowercase characters. 0 2 - false + true false @@ -1757,10 +1675,8 @@ lowercase characters. ethernet_mac 50 - 0 false - NETWORK NA @@ -1769,30 +1685,26 @@ lowercase characters. 1 2 - false + true false - 60 + 63 cpu_sdma - 55 - 0 + 54 false - NETWORK - 63 + 60 cpu_sdma - 54 - 0 + 55 false - NETWORK 0 diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-L1-AC5X-xb.md5 b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-L1-AC5X-xb.md5 index e8daa7b6f38b..6ea0d9634769 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-L1-AC5X-xb.md5 +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-L1-AC5X-xb.md5 @@ -1 +1 @@ -8d006b7a29c75f81b641df68102a6aa3 \ No newline at end of file +48c76e16726ad2b1cb797c55c477fc30 \ No newline at end of file diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-L1-AC5X-xb.xml b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-L1-AC5X-xb.xml index 534b218554f1..e00ba0314768 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-L1-AC5X-xb.xml +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-L1-AC5X-xb.xml @@ -1,5 +1,5 @@ - + diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-PP-AC5X-xb.md5 b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-PP-AC5X-xb.md5 index de23afe95536..bcd85e67a645 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-PP-AC5X-xb.md5 +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-PP-AC5X-xb.md5 @@ -1 +1 @@ -b42f2a2be9da6c7752c0807f9dee48bf \ No newline at end of file +d36319f76733ae8593e31f3231599936 \ No newline at end of file diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-PP-AC5X-xb.xml b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-PP-AC5X-xb.xml index ad457fe7db03..cd948edc27f2 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-PP-AC5X-xb.xml +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-PP-AC5X-xb.xml @@ -1,5 +1,5 @@ - + @@ -357,28 +357,28 @@ NATIVE NATIVE - * the trunk members are filled - * according to the order given by application. - * Regular trunk may hold max of 8 members. - * Cascade trunk may hold : - * max of 64 members +* the trunk members are filled +* according to the order given by application. +* Regular trunk may hold max of 8 members. +* Cascade trunk may hold : +* max of 64 members 0 FLEX FLEX - * A mode to allows flexibility for - * each Regular trunk to state it's max number of members (before starting to add members). - * (this mode not effect 'cascade trunk' members) - * Regular trunk may hold : max of 4K members. (each trunk set it's own limit) - * Cascade trunk may hold : max of 64 members. +* A mode to allows flexibility for +* each Regular trunk to state it's max number of members (before starting to add members). +* (this mode not effect 'cascade trunk' members) +* Regular trunk may hold : max of 4K members. (each trunk set it's own limit) +* Cascade trunk may hold : max of 64 members. 2 number-physical-port-type enumeration - ac5x 128, falcon 64,128,256, 512, 1024 + AC3X/AC5X 128, falcon 64, 128, 256, 512, 1024 no-ports no-ports diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/SAI-AC5X-xb.md5 b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/SAI-AC5X-xb.md5 index 951dd3007b76..dd43b585717b 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/SAI-AC5X-xb.md5 +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/SAI-AC5X-xb.md5 @@ -1 +1 @@ -b43a871130f9e59ac21a74940574558f \ No newline at end of file +1ff8c65eb4b5dfff5d2c9be67401c723 \ No newline at end of file diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/SAI-AC5X-xb.xml b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/SAI-AC5X-xb.xml index 5e374fdb06b1..d88939c0005f 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/SAI-AC5X-xb.xml +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/SAI-AC5X-xb.xml @@ -1,13 +1,13 @@ - + device-id-type uint32 - Device ID 0..1023 + Device ID 0..1 0 - 1023 + 1 port-id-type @@ -22,7 +22,7 @@ Logging Feature Options SAI_LOG_SYSLOG - SYSLOG {Syslog service should be running to use this option} + SYSLOG {Syslog service should be running to use this option} 0 @@ -32,7 +32,7 @@ SAI_LOG_FILE - FILE {Warning !!! Use with caution. Can cause disk full issues} + FILE {Warning !!! Use with caution. Can cause disk full issues} 2 @@ -43,11 +43,93 @@ 2 30 + + acl-feature-name-type + enumeration + + + port-sFlow + SFlow over Port + 0 + + + port-counters-ipv4-ipv6 + Port ipv4/ipv6 counters + 1 + + + control-acl + ACLs for control packet handling + 2 + + + + ingress-acl-stage-type + enumeration + + + disabled + Feature not enabled + 0 + + + IPCL0 + Stage IPCL0 + 1 + + + IPCL1 + Stage IPCL1 + 2 + + + + egress-acl-stage-type + enumeration + + + disabled + Feature not enabled + 0 + + + EPCL0 + Stage EPCL0 + 2 + + + + feature-priority-type + uint32 + Feature priority + 2 + 15 + + + hit-number-type + uint32 + Hit/lookup number + 0 + 3 + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_AC5X ASK-Board-AC5X-xb.xml - - false - 0 @@ -310,7 +392,7 @@ 51 - + 8 0 0 @@ -320,9 +402,45 @@ 1024 0 0 - + SAI_LOG_SYSLOG + + control-acl + 2 + + IPCL0 + 1 + + + EPCL0 + 0 + + + + port-sFlow + 3 + + IPCL0 + 0 + + + EPCL0 + 0 + + + + port-counters-ipv4-ipv6 + 4 + + IPCL0 + 3 + + + EPCL0 + 0 + + \ No newline at end of file diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/installer.conf b/device/nokia/arm64-nokia_ixs7215_52xb-r0/installer.conf index 3d02aab20dc1..bcce80934d73 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/installer.conf +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/installer.conf @@ -1,2 +1 @@ -VAR_LOG_SIZE=4096 ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="default_hugepagesz=32M hugepages=4 loglevel=4" diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/pcie.yaml b/device/nokia/arm64-nokia_ixs7215_52xb-r0/pcie.yaml new file mode 100644 index 000000000000..865f9090ee13 --- /dev/null +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/pcie.yaml @@ -0,0 +1,10 @@ +- bus: '00' + dev: '00' + fn: '0' + id: '0110' + name: 'PCI bridge: Marvell Technology Group Ltd. 88F60x0/88F70x0/88F80x0/CN913x ARM SoC' +- bus: '01' + dev: '00' + fn: '0' + id: '9821' + name: 'Ethernet controller: Marvell Technology Group Ltd. Device 9821' diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/platform.json b/device/nokia/arm64-nokia_ixs7215_52xb-r0/platform.json index 0ddd1f39583a..89a7a3e9ddf8 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/platform.json +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/platform.json @@ -97,17 +97,22 @@ "high-crit-threshold": false }, { - "name": "AC5X CORE", + "name": "PCB MID", "controllable": false, "low-threshold": false, "low-crit-threshold": false, "high-crit-threshold": false }, { - "name": "OOB PHY", + "name": "ASIC", + "controllable": false, + "low-threshold": false, + "low-crit-threshold": false + }, + { + "name": "CPU CORE", "controllable": false, "low-threshold": false, - "high-threshold": false, "low-crit-threshold": false } ], diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/platform_reboot b/device/nokia/arm64-nokia_ixs7215_52xb-r0/platform_reboot old mode 100644 new mode 100755 index b99b9bcfe976..aeb9f87f158a --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/platform_reboot +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/platform_reboot @@ -1,11 +1,13 @@ #!/bin/bash -function SafePwrCycle() { +function SafeReboot() { sync ; sync sudo umount -fa > /dev/null 2&>1 - # Write CPLD register to initiate cold reboot - sudo echo 0 > /sys/bus/i2c/devices/i2c-0/0-0041/cold_reset + # Turn off watchdog monitor gpio for correct reboot-cause + sudo echo 1 > /sys/class/gpio/gpio41/value + cat /sys/bus/i2c/devices/0-0041/last_reset_cause > /dev/null 2&>1 + exec /sbin/reboot } -SafePwrCycle +SafeReboot diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/pmon_daemon_control.json b/device/nokia/arm64-nokia_ixs7215_52xb-r0/pmon_daemon_control.json deleted file mode 100644 index f6445f875922..000000000000 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/pmon_daemon_control.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "skip_pcied": true -} diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/system_health_monitoring_config.json b/device/nokia/arm64-nokia_ixs7215_52xb-r0/system_health_monitoring_config.json index b4c438a104d9..d5f3a7b98304 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/system_health_monitoring_config.json +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/system_health_monitoring_config.json @@ -2,9 +2,7 @@ "services_to_ignore": [], "devices_to_ignore": [ "asic", - "psu.temperature", - "fan", - "psu" + "psu.temperature" ], "user_defined_checkers": [], "polling_interval": 60, diff --git a/platform/marvell-arm64/sonic-platform-nokia/7215/modules/Makefile b/platform/marvell-arm64/sonic-platform-nokia/7215/modules/Makefile index 73d6e5f38876..d82a871c1ccf 100644 --- a/platform/marvell-arm64/sonic-platform-nokia/7215/modules/Makefile +++ b/platform/marvell-arm64/sonic-platform-nokia/7215/modules/Makefile @@ -1 +1 @@ -obj-m:= nokia_7215_ixs_a1_cpld.o ac5_thermal_sensor.o +obj-m:= nokia_7215_ixs_a1_cpld.o cn9130_cpu_thermal_sensor.o diff --git a/platform/marvell-arm64/sonic-platform-nokia/7215/modules/ac5_thermal_sensor.c b/platform/marvell-arm64/sonic-platform-nokia/7215/modules/ac5_thermal_sensor.c deleted file mode 100644 index faf4402ffe61..000000000000 --- a/platform/marvell-arm64/sonic-platform-nokia/7215/modules/ac5_thermal_sensor.c +++ /dev/null @@ -1,218 +0,0 @@ -/* - * HWMON Driver for AC5x thermal sensor - * - * Author: Natarajan Subbiramani - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#define AC5_DEFAULT_TEMP_CRIT 100000 -#define AC5_DEFAULT_TEMP_MAX 110000 - -#define AC5_TEMP_BASE_ADDR 0x944F80D0 -static unsigned long thermal_base_addr=AC5_TEMP_BASE_ADDR; -module_param(thermal_base_addr, ulong, 0444); -MODULE_PARM_DESC(thermal_base_addr, - "Initialize the base address of the thermal sensor"); - -struct ac5_thermal_data { - struct device *dev; - struct device *hwmon_dev; - uint8_t * __iomem temp_base; - int temp_input; - int temp_crit; - int temp_max; -}; - -static long ac5_thermal_read_reg_in_mcelcius(struct device *dev, struct ac5_thermal_data *data) -{ - volatile uint8_t * __iomem temp_base = data->temp_base; - uint32_t regval; - long output=data->temp_max; - - //STOP MEASUREMENT - writel(0xF0F01034, temp_base); - - //delay for 1ms - mdelay(1); - - //Read thermal value - regval = readl(temp_base+0xC); - - //RE-START MEASUREMENT - writel(0xF0F01035, temp_base); - - //Validate data - if(regval & 0x10000) { - //Calibrate it to milli-celcius - output = (regval>> 6) & 0x3FF; - output = ((output*42)-27250)*10; - } - - return output; -} -static int ac5_thermal_read(struct device *dev, enum hwmon_sensor_types type, - u32 attr, int channel, long *val) -{ - struct ac5_thermal_data *data = dev_get_drvdata(dev); - - switch (type) { - case hwmon_temp: - switch (attr) { - case hwmon_temp_input: - *val = ac5_thermal_read_reg_in_mcelcius(dev, data); - break; - case hwmon_temp_crit: - *val = data->temp_crit; - break; - case hwmon_temp_max: - *val = data->temp_max; - break; - default: - return -EINVAL; - } - break; - default: - return -EINVAL; - } - return 0; -} - -static int ac5_thermal_write(struct device *dev, enum hwmon_sensor_types type, - u32 attr, int channel, long val) -{ - struct ac5_thermal_data *data = dev_get_drvdata(dev); - switch (type) { - case hwmon_temp: - switch (attr) { - case hwmon_temp_crit: - data->temp_crit = val; - break; - case hwmon_temp_max: - data->temp_max = val; - break; - default: - return -EINVAL; - } - break; - default: - return -EINVAL; - } - return 0; -} - - -static umode_t ac5_thermal_is_visible(const void *data, enum hwmon_sensor_types type, - u32 attr, int channel) -{ - switch (type) { - case hwmon_temp: - switch (attr) { - case hwmon_temp_input: - return 0444; - case hwmon_temp_crit: - case hwmon_temp_max: - return 0644; - } - break; - default: - break; - } - return 0; -} - -static const struct hwmon_channel_info *ac5_thermal_info[] = { - HWMON_CHANNEL_INFO(temp, - HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_CRIT), - NULL -}; - -static const struct hwmon_ops ac5_thermal_hwmon_ops = { - .is_visible = ac5_thermal_is_visible, - .read = ac5_thermal_read, - .write = ac5_thermal_write, -}; - -static const struct hwmon_chip_info ac5_thermal_chip_info = { - .ops = &ac5_thermal_hwmon_ops, - .info = ac5_thermal_info, -}; - -static const struct file_operations fops = { - .owner = THIS_MODULE, -}; - -struct miscdevice ac5_thermal_misc_device = { - .minor = TEMP_MINOR, - .name = "ac5_thermal", - .fops = &fops, -}; - -static int __init ac5_thermal_init_misc_driver(void) -{ - struct device *dev; - struct ac5_thermal_data *thermal_data; - int err; - void * __iomem reg; - - err = misc_register(&ac5_thermal_misc_device); - if (err) { - pr_err("ac5_thermal misc_register failed!!!\n"); - return err; - } - - dev = ac5_thermal_misc_device.this_device; - thermal_data = devm_kzalloc(dev, sizeof(struct ac5_thermal_data), GFP_KERNEL); - if (!thermal_data) - return -ENOMEM; - - thermal_data->dev = dev; - thermal_data->temp_crit = AC5_DEFAULT_TEMP_CRIT; - thermal_data->temp_max = AC5_DEFAULT_TEMP_MAX; - - thermal_data->hwmon_dev = devm_hwmon_device_register_with_info(dev, ac5_thermal_misc_device.name, - thermal_data, &ac5_thermal_chip_info, - NULL); - if (IS_ERR(thermal_data->hwmon_dev)) { - dev_err(dev, "%s: hwmon registration failed.\n", ac5_thermal_misc_device.name); - return PTR_ERR(thermal_data->hwmon_dev); - } - - reg = devm_ioremap(dev, thermal_base_addr, 16); - if (IS_ERR(reg)) { - dev_err(dev, "%s: base addr remap failed\n", ac5_thermal_misc_device.name); - return PTR_ERR(reg); - } - thermal_data->temp_base = reg; - /*Enable measurement*/ - writel(0xF0F01035, thermal_data->temp_base); - writel(0x0584e680, thermal_data->temp_base+8); - - dev_info(dev, "%s: initialized. base_addr: 0x%lx\n", dev_name(thermal_data->hwmon_dev), thermal_base_addr); - - return 0; -} - -static void __exit ac5_thermal_exit_misc_driver(void) -{ - misc_deregister(&ac5_thermal_misc_device); -} - -module_init(ac5_thermal_init_misc_driver); -module_exit(ac5_thermal_exit_misc_driver); - -MODULE_AUTHOR("Natarajan Subbiramani "); -MODULE_DESCRIPTION("AC5 Thermal sensor Driver"); -MODULE_LICENSE("GPL"); diff --git a/platform/marvell-arm64/sonic-platform-nokia/7215/modules/cn9130_cpu_thermal_sensor.c b/platform/marvell-arm64/sonic-platform-nokia/7215/modules/cn9130_cpu_thermal_sensor.c new file mode 100644 index 000000000000..e11e281579f3 --- /dev/null +++ b/platform/marvell-arm64/sonic-platform-nokia/7215/modules/cn9130_cpu_thermal_sensor.c @@ -0,0 +1,242 @@ +/* + * HWMON Driver for CN9130 thermal sensor + * + * Author: Natarajan Subbiramani + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#define CN9130_DEFAULT_TEMP_CRIT 100000 +#define CN9130_DEFAULT_TEMP_MAX 106000 + +#define CN9130_TEMP_BASE_ADDR 0xF06F8080 +#define CN9130_TSEN_REG_CTRL_0_OFFSET 0x4 +#define CN9130_TSEN_REG_CTRL_1_OFFSET 0x8 +#define CN9130_TSEN_REG_STATUS_OFFSET 0xC +#define CN9130_TSEN_SENSOR_MAX_ID 6 +static unsigned long thermal_base_addr=CN9130_TEMP_BASE_ADDR; +module_param(thermal_base_addr, ulong, 0444); +MODULE_PARM_DESC(thermal_base_addr, + "Initialize the base address of the thermal sensor"); + +struct cn9130_thermal_data { + struct device *dev; + struct device *hwmon_dev; + uint8_t * __iomem temp_base; + int temp_input; + int temp_crit; + int temp_max; +}; + +static long cn9130_thermal_read_reg_in_mcelcius(struct device *dev, struct cn9130_thermal_data *data) +{ + volatile uint8_t * __iomem temp_base = data->temp_base; + uint32_t regval; + uint32_t status_regval=0; + uint32_t output=data->temp_max; + + //STOP MEASUREMENT + regval = readl(temp_base+CN9130_TSEN_REG_CTRL_0_OFFSET); + regval &= ~( 1 << 0); //TSEN_STOP + writel(regval, temp_base+CN9130_TSEN_REG_CTRL_0_OFFSET); + + //delay for 1ms + mdelay(1); + + //Read thermal value + status_regval = readl(temp_base+CN9130_TSEN_REG_STATUS_OFFSET); + dev_dbg(dev, "%s: cn9130_thermal_read_reg_in_mcelcius: addr: 0x%lx value:0x%x\n", dev_name(data->hwmon_dev), temp_base+CN9130_TSEN_REG_STATUS_OFFSET, status_regval); + + //START MEASUREMENT + regval = readl(temp_base+CN9130_TSEN_REG_CTRL_0_OFFSET); + regval |= 1 << 0; //TSEN_START + writel(regval, temp_base+CN9130_TSEN_REG_CTRL_0_OFFSET); + + //Validate data + if(status_regval &= 0x3ff) { + //Convert it to milli-celcius + output = 150000 - (~(status_regval-1) & 0x3ff) * 423; + } + + return output; +} +static int cn9130_thermal_read(struct device *dev, enum hwmon_sensor_types type, + u32 attr, int channel, long *val) +{ + struct cn9130_thermal_data *data = dev_get_drvdata(dev); + + switch (type) { + case hwmon_temp: + switch (attr) { + case hwmon_temp_input: + *val = cn9130_thermal_read_reg_in_mcelcius(dev, data); + break; + case hwmon_temp_crit: + *val = data->temp_crit; + break; + case hwmon_temp_max: + *val = data->temp_max; + break; + default: + return -EINVAL; + } + break; + default: + return -EINVAL; + } + return 0; +} + +static int cn9130_thermal_write(struct device *dev, enum hwmon_sensor_types type, + u32 attr, int channel, long val) +{ + struct cn9130_thermal_data *data = dev_get_drvdata(dev); + switch (type) { + case hwmon_temp: + switch (attr) { + case hwmon_temp_crit: + data->temp_crit = val; + break; + case hwmon_temp_max: + data->temp_max = val; + break; + default: + return -EINVAL; + } + break; + default: + return -EINVAL; + } + return 0; +} + + +static umode_t cn9130_thermal_is_visible(const void *data, enum hwmon_sensor_types type, + u32 attr, int channel) +{ + switch (type) { + case hwmon_temp: + switch (attr) { + case hwmon_temp_input: + return 0444; + case hwmon_temp_crit: + case hwmon_temp_max: + return 0644; + } + break; + default: + break; + } + return 0; +} + +static const struct hwmon_channel_info *cn9130_thermal_info[] = { + HWMON_CHANNEL_INFO(temp, + HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_CRIT), + NULL +}; + +static const struct hwmon_ops cn9130_thermal_hwmon_ops = { + .is_visible = cn9130_thermal_is_visible, + .read = cn9130_thermal_read, + .write = cn9130_thermal_write, +}; + +static const struct hwmon_chip_info cn9130_thermal_chip_info = { + .ops = &cn9130_thermal_hwmon_ops, + .info = cn9130_thermal_info, +}; + +static const struct file_operations fops = { + .owner = THIS_MODULE, +}; + +struct miscdevice cn9130_thermal_device = { + .minor = TEMP_MINOR, + .name = "cn9130_thermal", + .fops = &fops, +}; + +static int __init cn9130_thermal_init_driver(void) +{ + struct device *dev; + struct cn9130_thermal_data *thermal_data; + int err; + void * __iomem reg; + uint32_t regval=0; + + err = misc_register(&cn9130_thermal_device); + if (err) { + pr_err("cn9130_thermal misc_register failed!!!\n"); + return err; + } + + dev = cn9130_thermal_device.this_device; + thermal_data = devm_kzalloc(dev, sizeof(struct cn9130_thermal_data), GFP_KERNEL); + if (!thermal_data) + return -ENOMEM; + + thermal_data->dev = dev; + thermal_data->temp_crit = CN9130_DEFAULT_TEMP_CRIT; + thermal_data->temp_max = CN9130_DEFAULT_TEMP_MAX; + + thermal_data->hwmon_dev = devm_hwmon_device_register_with_info(dev, cn9130_thermal_device.name, + thermal_data, &cn9130_thermal_chip_info, + NULL); + if (IS_ERR(thermal_data->hwmon_dev)) { + dev_err(dev, "%s: hwmon registration failed.\n", cn9130_thermal_device.name); + return PTR_ERR(thermal_data->hwmon_dev); + } + + reg = devm_ioremap(dev, thermal_base_addr, 16); + if (IS_ERR(reg)) { + dev_err(dev, "%s: base addr remap failed\n", cn9130_thermal_device.name); + return PTR_ERR(reg); + } + thermal_data->temp_base = reg; + + /*Enable measurement*/ + regval = readl(thermal_data->temp_base+CN9130_TSEN_REG_CTRL_0_OFFSET); + regval |= 1 << 2; //TSEN_EN + writel(regval, thermal_data->temp_base+CN9130_TSEN_REG_CTRL_0_OFFSET); + mdelay(10); + + // Set temperature reading zone as max reading + regval = readl(thermal_data->temp_base+CN9130_TSEN_REG_CTRL_1_OFFSET); + regval &= ~(0x7 << 21); + regval |= (CN9130_TSEN_SENSOR_MAX_ID & 0x7) << 21; + writel(regval, thermal_data->temp_base+CN9130_TSEN_REG_CTRL_1_OFFSET); + + //START MEASUREMENT + regval = readl(thermal_data->temp_base+CN9130_TSEN_REG_CTRL_0_OFFSET); + regval |= 1 << 0; //TSEN_START + writel(regval, thermal_data->temp_base+CN9130_TSEN_REG_CTRL_0_OFFSET); + + dev_info(dev, "%s: initialized. base_addr: 0x%lx virt_addr:0x%lx\n", dev_name(thermal_data->hwmon_dev), thermal_base_addr, thermal_data->temp_base); + + return 0; +} + +static void __exit cn9101_thermal_exit_driver(void) +{ + misc_deregister(&cn9130_thermal_device); +} + +module_init(cn9130_thermal_init_driver); +module_exit(cn9101_thermal_exit_driver); + +MODULE_AUTHOR("Natarajan Subbiramani "); +MODULE_DESCRIPTION("CN9130 CPU Thermal sensor Driver"); +MODULE_LICENSE("GPL"); diff --git a/platform/marvell-arm64/sonic-platform-nokia/7215/scripts/cpu_wdt.py b/platform/marvell-arm64/sonic-platform-nokia/7215/scripts/cpu_wdt.py new file mode 100755 index 000000000000..b23cd46566e5 --- /dev/null +++ b/platform/marvell-arm64/sonic-platform-nokia/7215/scripts/cpu_wdt.py @@ -0,0 +1,46 @@ +#!/usr/bin/python + +from sonic_platform.chassis import Chassis +from sonic_py_common import logger +import time +import os +import signal +import sys + + +TIMEOUT=180 +KEEPALIVE=60 +sonic_logger = logger.Logger('Watchdog') +sonic_logger.set_min_log_priority_info() +time.sleep(60) +chassis = Chassis() +watchdog = chassis.get_watchdog() + +def stopWdtService(signal, frame): + watchdog._disablewatchdog() + sonic_logger.log_notice("CPUWDT Disabled: watchdog armed=%s" % watchdog.is_armed() ) + sys.exit() + +def main(): + + signal.signal(signal.SIGHUP, signal.SIG_IGN) + signal.signal(signal.SIGINT, stopWdtService) + signal.signal(signal.SIGTERM, stopWdtService) + + watchdog.arm(TIMEOUT) + sonic_logger.log_notice("CPUWDT Enabled: watchdog armed=%s" % watchdog.is_armed() ) + + + while True: + time.sleep(KEEPALIVE) + watchdog._keepalive() + sonic_logger.log_info("CPUWDT keepalive") + done + + stopWdtService + + return + + +if __name__ == '__main__': + main() diff --git a/platform/marvell-arm64/sonic-platform-nokia/7215/service/cpu_wdt.service b/platform/marvell-arm64/sonic-platform-nokia/7215/service/cpu_wdt.service new file mode 100644 index 000000000000..761deec569cc --- /dev/null +++ b/platform/marvell-arm64/sonic-platform-nokia/7215/service/cpu_wdt.service @@ -0,0 +1,8 @@ +[Unit] +Description=CPU WDT +After=nokia-7215init.service +[Service] +ExecStart=/usr/local/bin/cpu_wdt.py + +[Install] +WantedBy=multi-user.target diff --git a/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/chassis.py b/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/chassis.py index 11eeb15106af..19007a3b4de1 100644 --- a/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/chassis.py +++ b/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/chassis.py @@ -35,7 +35,7 @@ MAX_7215_FAN_DRAWERS = 2 MAX_7215_FANS_PER_DRAWER = 1 MAX_7215_PSU = 2 -MAX_7215_THERMAL = 4 +MAX_7215_THERMAL = 5 CPLD_DIR = "/sys/bus/i2c/devices/0-0041/" SYSLOG_IDENTIFIER = "chassis" @@ -92,7 +92,7 @@ def __init__(self): drawer = drawer_ctor(drawer_index) self._fan_drawer_list.append(drawer) for index in range(fan_num_per_drawer): - fan = Fan(fan_index, drawer) + fan = Fan(fan_index, drawer, self.get_model()) fan_index += 1 drawer._fan_list.append(fan) self._fan_list.append(fan) @@ -259,10 +259,21 @@ def get_reboot_cause(self): is "REBOOT_CAUSE_HARDWARE_OTHER", the second string can be used to pass a description of the reboot cause. """ - # The ixs7215 CPLD does not have a hardware reboot cause register so - # the hardware portion of reboot cause can't be implemented - - return (ChassisBase.REBOOT_CAUSE_NON_HARDWARE, None) + value = self._read_sysfs_file(CPLD_DIR+"last_reset_cause") + thermal = self._read_sysfs_file(CPLD_DIR+"temp_event_status") + if (value == 'cold_reset'): + reboot_cause=(ChassisBase.REBOOT_CAUSE_POWER_LOSS, "Cold Reset") + elif (value == 'warm_reset'): + reboot_cause=(ChassisBase.REBOOT_CAUSE_HARDWARE_OTHER, "Warm Reset") + elif (value == 'wdog_reset'): + reboot_cause=(ChassisBase.REBOOT_CAUSE_WATCHDOG, None) + elif (value == 'thermal_reset'): + reboot_cause=(ChassisBase.REBOOT_CAUSE_THERMAL_OVERLOAD_OTHER, thermal) + else: + reboot_cause=(ChassisBase.REBOOT_CAUSE_NON_HARDWARE, None) + #unmask temperature event + self._write_sysfs_file(CPLD_DIR+"temp_event_mask", 0) + return reboot_cause def get_watchdog(self): """ diff --git a/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/component.py b/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/component.py index cda5abc3c223..f4d01291193b 100644 --- a/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/component.py +++ b/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/component.py @@ -175,7 +175,7 @@ def get_firmware_version(self): return self._get_cpld_version(self.index) if self.index == 1: - cmdstatus, uboot_version = cmd.getstatusoutput('grep --null-data ^U-Boot /dev/mtd0ro | cut -d" " -f2') + cmdstatus, uboot_version = cmd.getstatusoutput('grep --null-data ^U-Boot /dev/mtd0ro | cut -d" " -f4') return uboot_version def install_firmware(self, image_path): diff --git a/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/eeprom.py b/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/eeprom.py index 4abfad47be9f..b9f770abf906 100644 --- a/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/eeprom.py +++ b/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/eeprom.py @@ -41,8 +41,7 @@ def __init__(self, is_psu=False, psu_index=0, is_fan=False, fan_index=0): self.index = psu_index self.part_number = '1' self.model_str = 'PJT-12V100WBBA' - self.serial_number = 'NA' - self.serial_number = 'NA' + self.serial_number = 'NA' if self.is_fan_eeprom: self.index = fan_index diff --git a/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/fan.py b/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/fan.py index aa4a51a95d31..b86370dc0eec 100644 --- a/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/fan.py +++ b/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/fan.py @@ -16,8 +16,8 @@ except ImportError as e: raise ImportError(str(e) + "- required module not found") -MAX_IXS7215_FAN_SPEED = 24000 -WORKING_IXS7215_FAN_SPEED = 2400 +MAX_IXS7215_FAN_SPEED = 23000 +WORKING_IXS7215_FAN_SPEED = 2300 sonic_logger = logger.Logger('fan') @@ -26,10 +26,10 @@ class Fan(FanBase): """Nokia platform-specific Fan class""" - def __init__(self, fan_index, fan_drawer, psu_fan=False, dependency=None): + def __init__(self, fan_index, fan_drawer, chassis_model, psu_fan=False, dependency=None): self.is_psu_fan = psu_fan EMC2302_DIR = " " - i2c_path = "/sys/bus/i2c/devices/0-002e/hwmon/" + i2c_path = "/sys/bus/i2c/devices/0-002f/hwmon/" if(os.path.exists(i2c_path)): hwmon_node = os.listdir(i2c_path)[0] EMC2302_DIR = i2c_path + hwmon_node + '/' @@ -38,6 +38,7 @@ def __init__(self, fan_index, fan_drawer, psu_fan=False, dependency=None): # Fan is 1-based in Nokia platforms self.index = fan_index + 1 self.fan_drawer = fan_drawer + self.chassis_model = chassis_model self.set_fan_speed_reg = EMC2302_DIR+"pwm{}".format(self.index) self.get_fan_speed_reg = EMC2302_DIR+"fan{}_input".format(self.index) self.max_fan_speed = MAX_IXS7215_FAN_SPEED @@ -116,7 +117,16 @@ def get_model(self): Returns: string: Model number of Fan. Use part number for this. """ - return self.eeprom.part_number_str() + return self.eeprom.modelstr() + + def get_chassis_model(self): + """ + Retrieves the model number of the Fan + + Returns: + string: Model number of Fan. Use part number for this. + """ + return self.chassis_model def get_serial(self): """ @@ -169,8 +179,14 @@ def get_direction(self): A string, either FAN_DIRECTION_INTAKE or FAN_DIRECTION_EXHAUST depending on fan direction """ + ch_model=self.get_chassis_model() + #compare first 8 characters of chassis molel string + if(ch_model[:8]=='3HE18723'): + direction = 'intake' + else: + direction = 'exhaust' - return 'intake' + return direction def get_position_in_parent(self): """ @@ -219,8 +235,10 @@ def get_speed_tolerance(self): which is considered tolerable """ if self.get_presence(): - # The tolerance value is fixed as 25% for this platform - tolerance = 50 + if self.get_target_speed()<50: + tolerance=60 + else: + tolerance = 25 else: tolerance = 0 diff --git a/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/psu.py b/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/psu.py index eb8aeeaedfb1..8249954932ff 100644 --- a/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/psu.py +++ b/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/psu.py @@ -19,6 +19,8 @@ sonic_logger = logger.Logger('psu') INA230_DIR = "/sys/bus/i2c/devices/0-0040/iio:device0/" CPLD_DIR = "/sys/bus/i2c/devices/0-0041/" +PSU_GPIO_DIR = ["/sys/class/gpio/gpio61/value", "/sys/class/gpio/gpio62/value"] + class Psu(PsuBase): """Nokia platform-specific PSU class for 7215 """ @@ -32,6 +34,8 @@ def __init__(self, psu_index): # PSU eeprom self.eeprom = Eeprom(is_psu=True, psu_index=self.index) + self.MAX_VOLTAGE = 14 + self.MIN_VOLTAGE = 10 def _read_sysfs_file(self, sysfs_file): # On successful read, returns the value read from given @@ -80,8 +84,8 @@ def _get_active_psus(self): Integer: Number of active PSU's """ active_psus = 0 - psu1_good = self._read_sysfs_file(CPLD_DIR+"psu1_power_good") - psu2_good = self._read_sysfs_file(CPLD_DIR+"psu2_power_good") + psu1_good = self._read_sysfs_file(PSU_GPIO_DIR[0]) + psu2_good = self._read_sysfs_file(PSU_GPIO_DIR[1]) active_psus = int(psu1_good) + int(psu2_good) @@ -150,7 +154,7 @@ def get_status(self): Returns: bool: True if PSU is operating properly, False if not """ - psu_sysfs_str=CPLD_DIR+"psu{}_power_good".format(self.index) + psu_sysfs_str=PSU_GPIO_DIR[self.index-1] psu_status = self._read_sysfs_file(psu_sysfs_str) if psu_status == '1': @@ -212,6 +216,26 @@ def get_position_in_parent(self): """ return self.index + def get_voltage_high_threshold(self): + """ + Retrieves the high threshold PSU voltage output + + Returns: + A float number, the high threshold output voltage in volts, + e.g. 12.1 + """ + return self.MAX_VOLTAGE + + def get_voltage_low_threshold(self): + """ + Retrieves the low threshold PSU voltage output + + Returns: + A float number, the low threshold output voltage in volts, + e.g. 12.1 + """ + return self.MIN_VOLTAGE + def is_replaceable(self): """ Indicate whether this device is replaceable. @@ -227,7 +251,7 @@ def get_powergood_status(self): A boolean, True if PSU has stablized its output voltages and passed all its internal self-tests, False if not. """ - psu_sysfs_str=CPLD_DIR+"psu{}_power_good".format(self.index) + psu_sysfs_str=PSU_GPIO_DIR[self.index-1] psu_pg_status = self._read_sysfs_file(psu_sysfs_str) if psu_pg_status == '1': @@ -294,4 +318,4 @@ def set_status_master_led(self, color): if status == "ERR": return False - return True \ No newline at end of file + return True diff --git a/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/sfp.py b/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/sfp.py index 4cb96ed47046..b682080e18dd 100644 --- a/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/sfp.py +++ b/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/sfp.py @@ -30,7 +30,7 @@ class Sfp(SfpOptoeBase): """ - Nokia IXR-7215 Platform-specific Sfp refactor class + Nokia IXS-7215 Platform-specific Sfp refactor class """ instances = [] diff --git a/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/thermal.py b/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/thermal.py index 5a8a084cfc7c..20c15452b682 100644 --- a/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/thermal.py +++ b/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/thermal.py @@ -10,6 +10,7 @@ try: import os from sonic_platform_base.thermal_base import ThermalBase + from swsscommon.swsscommon import SonicV2Connector from sonic_py_common import logger except ImportError as e: raise ImportError(str(e) + "- required module not found") @@ -21,12 +22,13 @@ class Thermal(ThermalBase): I2C_CLASS_DIR = "/sys/class/i2c-adapter/" I2C_DEV_MAPPING = (['i2c-0/0-0048/hwmon/', 1], - ['i2c-0/0-0049/hwmon/', 1]) + ['i2c-0/0-0049/hwmon/', 1], + ['i2c-0/0-004a/hwmon/', 1]) - HWMON_CLASS_DIR = "/sys/class/hwmon/hwmon0/" - AC5X_THERMAL_DIR = "/sys/class/hwmon/hwmon1/" + CN9130_THERMAL_DIR = "/sys/class/hwmon/hwmon1/" + ASIC_TEMP_INFO = "ASIC_TEMPERATURE_INFO" - THERMAL_NAME = ("PCB BACK", "PCB FRONT", "AC5X CORE", "OOB PHY") + THERMAL_NAME = ("PCB BACK", "PCB FRONT", "PCB MID", "ASIC", "CPU CORE") def __init__(self, thermal_index): ThermalBase.__init__(self) @@ -37,7 +39,7 @@ def __init__(self, thermal_index): self._maximum = None self.thermal_high_threshold_file = None # PCB temperature sensors - if self.index < 3: + if self.index < 4: i2c_path = self.I2C_CLASS_DIR + self.I2C_DEV_MAPPING[self.index - 1][0] sensor_index = self.I2C_DEV_MAPPING[self.index - 1][1] sensor_high_suffix = "max" @@ -45,24 +47,26 @@ def __init__(self, thermal_index): hwmon_node = os.listdir(i2c_path)[0] self.SENSOR_DIR = i2c_path + hwmon_node + '/' - # SOC temperature sensor - elif self.index == 3: - dev_path = self.AC5X_THERMAL_DIR - sensor_index = 1 - sensor_high_suffix = "max" + #ASIC temperature sensor + elif self.index == 4: + sensor_high_suffix = None sensor_high_crit_suffix = None - self.SENSOR_DIR = dev_path - # - else: - dev_path = self.HWMON_CLASS_DIR + self.sensor_high_threshold = 100.0 + self.sensor_crit_threshold = 110.0 + self.SENSOR_DIR = None + + # CPU CN9130 temperature sensor + elif self.index == 5: + dev_path = self.CN9130_THERMAL_DIR sensor_index = 1 - sensor_high_suffix = None - sensor_high_crit_suffix = "crit" + sensor_high_suffix = "crit" + sensor_high_crit_suffix = "max" self.SENSOR_DIR = dev_path # sysfs file for current temperature value - self.thermal_temperature_file = self.SENSOR_DIR \ - + "temp{}_input".format(sensor_index) + if self.SENSOR_DIR: + self.thermal_temperature_file = self.SENSOR_DIR \ + + "temp{}_input".format(sensor_index) # sysfs file for high threshold value if supported for this sensor if sensor_high_suffix: @@ -156,16 +160,23 @@ def get_temperature(self): A float number of current temperature in Celsius up to nearest thousandth of one degree Celsius, e.g. 30.125 """ - thermal_temperature = self._read_sysfs_file( - self.thermal_temperature_file) - if (thermal_temperature != 'ERR'): - thermal_temperature = float(thermal_temperature) / 1000 - if self._minimum is None or self._minimum > thermal_temperature: - self._minimum = thermal_temperature - if self._maximum is None or self._maximum < thermal_temperature: - self._maximum = thermal_temperature + #read from state_db for asic temperature + if self.index == 4: + db = SonicV2Connector() + db.connect(db.STATE_DB) + data_dict = db.get_all(db.STATE_DB, self.ASIC_TEMP_INFO) + thermal_temperature = float(data_dict['maximum_temperature']) else: - thermal_temperature = 0 + thermal_temperature = self._read_sysfs_file(self.thermal_temperature_file) + if (thermal_temperature != 'ERR'): + thermal_temperature = float(thermal_temperature) / 1000 + else: + thermal_temperature = 0 + + if self._minimum is None or self._minimum > thermal_temperature: + self._minimum = thermal_temperature + if self._maximum is None or self._maximum < thermal_temperature: + self._maximum = thermal_temperature return float("{:.3f}".format(thermal_temperature)) @@ -178,12 +189,13 @@ def get_high_threshold(self): Celsius up to nearest thousandth of one degree Celsius, e.g. 30.125 """ + if self.index == 4: + return float("{:.3f}".format(self.sensor_high_threshold)) # Not implemented for this sensor if not self.thermal_high_threshold_file: raise NotImplementedError - thermal_high_threshold = self._read_sysfs_file( - self.thermal_high_threshold_file) + thermal_high_threshold = self._read_sysfs_file(self.thermal_high_threshold_file) if (thermal_high_threshold != 'ERR'): thermal_high_threshold = float(thermal_high_threshold) / 1000 else: @@ -213,7 +225,8 @@ def get_high_critical_threshold(self): A float number, the high critical threshold temperature of thermal in Celsius up to nearest thousandth of one degree Celsius, e.g. 30.125 """ - + if self.index == 4: + return float("{:.3f}".format(self.sensor_crit_threshold)) # Not implemented for this sensor if not self.thermal_high_crit_threshold_file: raise NotImplementedError diff --git a/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/thermal_infos.py b/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/thermal_infos.py index cf9b0cdee6de..0f03ee7a4fde 100644 --- a/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/thermal_infos.py +++ b/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/thermal_infos.py @@ -73,14 +73,22 @@ def __init__(self): self._current_threshold_level = 0 self._num_fan_levels = 3 self._high_crital_threshold = 75 - self._level_up_threshold = [[31,39,58,46], - [39,46,65,54], - [51,57,77,68]] + #THERMAL_NAME ("PCB BACK", "PCB FRONT", "PCB MID", "ASIC", "CPU CORE") + self._f2b_level_up_threshold = [[38,30,37,60,77], + [51,44,50,72,90], + [61,57,61,77,94]] - self._level_down_threshold = [[24,31,47,40], - [31,38,53,46], - [48,54,72,63]] - + self._f2b_level_down_threshold = [[29,24,29,50,64], + [40,37,40,59,75], + [58,54,58,72,90]] + + self._b2f_level_up_threshold = [[30,38,41,65,71], + [43,50,54,76,86], + [53,59,61,79,92]] + + self._b2f_level_down_threshold = [[22,30,33,54,60], + [37,44,46,62,73], + [51,57,58,75,90]] def collect(self, chassis): """ Collect thermal sensor temperature change status @@ -99,6 +107,13 @@ def collect(self, chassis): for index in range(num_of_thermals): self._temps.insert(index, chassis.get_thermal(index).get_temperature()) + fan_direction=chassis.get_fan(1).get_direction() + if(fan_direction == "intake"): + level_up_threshold=self._f2b_level_up_threshold + level_down_threshold=self._f2b_level_down_threshold + else: + level_up_threshold=self._b2f_level_up_threshold + level_down_threshold=self._b2f_level_down_threshold # Find current required threshold level max_level =0 @@ -106,10 +121,10 @@ def collect(self, chassis): for index in range(num_of_thermals): for level in range(self._num_fan_levels): - if self._temps[index]>self._level_up_threshold[level][index]: + if self._temps[index]>level_up_threshold[level][index]: if max_levellevel: min_level[index]=level diff --git a/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/watchdog.py b/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/watchdog.py index cf655448d6df..052a276af425 100644 --- a/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/watchdog.py +++ b/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/watchdog.py @@ -6,9 +6,8 @@ import os import fcntl import array - +import time from sonic_platform_base.watchdog_base import WatchdogBase -from sonic_py_common import logger """ ioctl constants """ IO_WRITE = 0x40000000 @@ -34,13 +33,12 @@ WDIOS_ENABLECARD = 0x0002 """ watchdog sysfs """ -WD_SYSFS_PATH = "/sys/class/watchdog/" +WD_SYSFS_PATH = "/sys/class/watchdog/watchdog0/" +WD_GPIO_PATH = "/sys/class/gpio/gpio41/value" +CPLD_DIR = "/sys/bus/i2c/devices/0-0041/" WD_COMMON_ERROR = -1 -sonic_logger = logger.Logger() - - class WatchdogImplBase(WatchdogBase): """ Base class that implements common logic for interacting @@ -53,34 +51,53 @@ def __init__(self, wd_device_path): @param wd_device_path Path to watchdog device """ super(WatchdogImplBase, self).__init__() - + + self.watchdog="" self.watchdog_path = wd_device_path - self.watchdog = os.open(self.watchdog_path, os.O_WRONLY) - - # Opening a watchdog descriptor starts - # watchdog timer; by default it should be stopped - self._disablewatchdog() - self.armed = False + self.watchdog_gpio_reg = WD_GPIO_PATH + self.wd_state_reg = WD_SYSFS_PATH+"state" + self.wd_timeout_reg = WD_SYSFS_PATH+"timeout" + self.wd_timeleft_reg = WD_SYSFS_PATH+"timeleft" + self.timeout = self._gettimeout() - def disarm(self): - """ - Disarm the hardware watchdog - - Returns: - A boolean, True if watchdog is disarmed successfully, False - if not - """ - sonic_logger.log_info(" Debug disarm watchdog ") + def _read_sysfs_file(self, sysfs_file): + # On successful read, returns the value read from given + # reg_name and on failure returns 'ERR' + rv = 'ERR' + if (not os.path.isfile(sysfs_file)): + return rv try: - self._disablewatchdog() - self.armed = False - self.timeout = 0 - except IOError: - return False + with open(sysfs_file, 'r') as fd: + rv = fd.read() + except Exception as e: + rv = 'ERR' + + rv = rv.rstrip('\r\n') + rv = rv.lstrip(" ") + return rv + + def _write_sysfs_file(self, sysfs_file, value): + # On successful write, the value read will be written on + # reg_name and on failure returns 'ERR' + rv = 'ERR' + + if (not os.path.isfile(sysfs_file)): + return rv + try: + with open(sysfs_file, 'w') as fd: + rv = fd.write(str(value)) + except Exception as e: + rv = 'ERR' - return True + # Ensure that the write operation has succeeded + if (int(self._read_sysfs_file(sysfs_file)) != value ): + time.sleep(3) + if (int(self._read_sysfs_file(sysfs_file)) != value ): + rv = 'ERR' + + return rv def _disablewatchdog(self): """ @@ -89,6 +106,23 @@ def _disablewatchdog(self): req = array.array('h', [WDIOS_DISABLECARD]) fcntl.ioctl(self.watchdog, WDIOC_SETOPTIONS, req, False) + self._write_sysfs_file(self.watchdog_gpio_reg, 1) + self._read_sysfs_file(CPLD_DIR+"last_reset_cause") + + def _enablewatchdog(self): + """ + Turn on the watchdog timer + """ + + req = array.array('h', [WDIOS_ENABLECARD]) + fcntl.ioctl(self.watchdog, WDIOC_SETOPTIONS, req, False) + + def _keepalive(self): + """ + Keep alive watchdog timer + """ + + fcntl.ioctl(self.watchdog, WDIOC_KEEPALIVE) def _settimeout(self, seconds): """ @@ -107,11 +141,10 @@ def _gettimeout(self): Get watchdog timeout @return watchdog timeout """ + timeout=0 + timeout=self._read_sysfs_file(self.wd_timeout_reg) - req = array.array('I', [0]) - fcntl.ioctl(self.watchdog, WDIOC_GETTIMEOUT, req, True) - - return int(req[0]) + return timeout def _gettimeleft(self): """ @@ -128,47 +161,62 @@ def arm(self, seconds): """ Implements arm WatchdogBase API """ - sonic_logger.log_info(" Debug arm watchdog4 ") + ret = WD_COMMON_ERROR - if seconds < 0: + if (seconds < 0 or seconds > 340 ): return ret - + # Stop the watchdog service to gain access of watchdog file pointer + if self.is_armed(): + os.popen("systemctl stop cpu_wdt.service") + time.sleep(2) + if not self.watchdog: + self.watchdog = os.open(self.watchdog_path, os.O_WRONLY) try: if self.timeout != seconds: self.timeout = self._settimeout(seconds) - if self.armed: + if self.is_armed(): self._keepalive() else: - sonic_logger.log_info(" Debug arm watchdog5 ") self._enablewatchdog() - self.armed = True ret = self.timeout except IOError: pass - + if(ret == seconds): + self._write_sysfs_file(self.watchdog_gpio_reg, 0) return ret - def _enablewatchdog(self): - """ - Turn on the watchdog timer + def disarm(self): """ + Implements disarm WatchdogBase API - req = array.array('h', [WDIOS_ENABLECARD]) - fcntl.ioctl(self.watchdog, WDIOC_SETOPTIONS, req, False) - - def _keepalive(self): - """ - Keep alive watchdog timer + Returns: + A boolean, True if watchdog is disarmed successfully, False + if not """ - - fcntl.ioctl(self.watchdog, WDIOC_KEEPALIVE) + + if self.is_armed(): + os.popen("systemctl stop cpu_wdt.service") + time.sleep(2) + if not self.watchdog: + self.watchdog = os.open(self.watchdog_path, os.O_WRONLY) + try: + self._disablewatchdog() + self.timeout = 0 + except IOError: + return False + return True def is_armed(self): """ Implements is_armed WatchdogBase API """ + status = False - return self.armed + state = self._read_sysfs_file(self.wd_state_reg) + if (state != 'inactive'): + status = True + + return status def get_remaining_time(self): """ @@ -177,10 +225,7 @@ def get_remaining_time(self): timeleft = WD_COMMON_ERROR - if self.armed: - try: - timeleft = self._gettimeleft() - except IOError: - pass + if self.is_armed(): + timeleft=self._read_sysfs_file(self.wd_timeleft_reg) - return timeleft + return int(timeleft) diff --git a/platform/marvell-arm64/sonic-platform-nokia/debian/rules b/platform/marvell-arm64/sonic-platform-nokia/debian/rules index 27015185a1a7..de6ed670d0c3 100755 --- a/platform/marvell-arm64/sonic-platform-nokia/debian/rules +++ b/platform/marvell-arm64/sonic-platform-nokia/debian/rules @@ -33,7 +33,7 @@ build: (for mod in $(MODULE_DIRS); do \ cd $(MOD_SRC_DIR)/../$(PRESTERA_MODULE_SRC)/; \ make clean; \ - make modules -C $(KERNEL_SRC)/build M=`pwd` CONFIG_KM_MVMBUS=y CONFIG_KM_MVINT=y || exit 1; \ + make modules -C $(KERNEL_SRC)/build M=`pwd` CONFIG_KM_MVPCI=y CONFIG_KM_MVINT=y || exit 1; \ mkdir $(MOD_SRC_DIR)/$${mod}/$(MRVL_MODULE_DIR); \ cp *.ko $(MOD_SRC_DIR)/$${mod}/$(MRVL_MODULE_DIR)/; \ cd $(MOD_SRC_DIR); \ diff --git a/platform/marvell-arm64/sonic-platform-nokia/debian/sonic-platform-nokia-7215.install b/platform/marvell-arm64/sonic-platform-nokia/debian/sonic-platform-nokia-7215.install index ec9e8d9f6086..efa3c696be2f 100644 --- a/platform/marvell-arm64/sonic-platform-nokia/debian/sonic-platform-nokia-7215.install +++ b/platform/marvell-arm64/sonic-platform-nokia/debian/sonic-platform-nokia-7215.install @@ -1,4 +1,6 @@ 7215/scripts/nokia-7215-init.sh usr/local/bin +7215/scripts/cpu_wdt.py usr/local/bin 7215/service/nokia-7215init.service etc/systemd/system +7215/service/cpu_wdt.service etc/systemd/system 7215/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/arm64-nokia_ixs7215_52xb-r0 ../mrvl-prestera/platform/arm64/ac5x/* / diff --git a/platform/marvell-arm64/sonic-platform-nokia/debian/sonic-platform-nokia-7215.postinst b/platform/marvell-arm64/sonic-platform-nokia/debian/sonic-platform-nokia-7215.postinst index e48b6feee769..949cd1a289ef 100644 --- a/platform/marvell-arm64/sonic-platform-nokia/debian/sonic-platform-nokia-7215.postinst +++ b/platform/marvell-arm64/sonic-platform-nokia/debian/sonic-platform-nokia-7215.postinst @@ -26,6 +26,9 @@ case "$1" in systemctl enable nokia-7215init.service systemctl start nokia-7215init.service + systemctl enable cpu_wdt.service + systemctl start cpu_wdt.service + ;; abort-upgrade|abort-remove|abort-deconfigure) From 28b12a7013d4200264506d4ccbd502af54e5a9fc Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 6 Mar 2024 19:00:56 +0800 Subject: [PATCH 183/419] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#18274) #### Why I did it src/sonic-swss ``` * dd1432a2 - (HEAD -> 202311, origin/202311) [ci] Allow partially success build artifact in PR checker pipeline. #2986 (10 hours ago) [Liu Shilong] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index c4fd095e180a..dd1432a292c1 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit c4fd095e180a4e34b51fc7017213f945507d9051 +Subproject commit dd1432a292c17b8a88e558c42101074abbe833c5 From 25b24485e9d8989ebc393b32df4d92ee49a23b3a Mon Sep 17 00:00:00 2001 From: James An <94036556+jamesan47@users.noreply.github.com> Date: Wed, 6 Mar 2024 17:42:26 -0800 Subject: [PATCH 184/419] Update cisco-8000.ini (#18271) --- platform/checkout/cisco-8000.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/checkout/cisco-8000.ini b/platform/checkout/cisco-8000.ini index d07141d59cd3..ccda22289a97 100644 --- a/platform/checkout/cisco-8000.ini +++ b/platform/checkout/cisco-8000.ini @@ -1,3 +1,3 @@ [module] repo=git@github.com:Cisco-8000-sonic/platform-cisco-8000.git -ref=202305.1.0.3 +ref=202311.main.0.1 From e00d06083454b0c1c15eee7fef9b483af15d0aef Mon Sep 17 00:00:00 2001 From: Xichen96 Date: Fri, 8 Mar 2024 00:46:28 +0800 Subject: [PATCH 185/419] replace host check command in e1031 (#18279) --- .../x86_64-cel_e1031-r0/sonic_platform/common.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/common.py b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/common.py index 7d3b37e36597..0838f0cf0a2a 100644 --- a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/common.py +++ b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/common.py @@ -24,7 +24,6 @@ class Common: SET_METHOD_IPMI = 'ipmitool' NULL_VAL = 'N/A' - HOST_CHK_CMD = ["docker"] REF_KEY = '$ref:' def __init__(self, conf=None): @@ -184,12 +183,13 @@ def write_txt_file(self, file_path, value): return False return True - def is_host(self): - try: - subprocess.call(self.HOST_CHK_CMD, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) - except FileNotFoundError: - return False - return True + def is_host(): + """ + Test whether current process is running on the host or an docker + return True for host and False for docker + """ + docker_env_file = '/.dockerenv' + return os.path.exists(docker_env_file) is False def load_json_file(self, path): """ From 6993a384ad3aaf564034608d639395167b741037 Mon Sep 17 00:00:00 2001 From: lixiaoyuner <35456895+lixiaoyuner@users.noreply.github.com> Date: Fri, 8 Mar 2024 10:02:06 -0800 Subject: [PATCH 186/419] [Build] Install k8s packages from sonic build storage to mitigate k8s source deprecation issue (#18280) (#18304) Why I did it pkgs.k8s.io: Introducing Kubernetes Community-Owned Package Repositories | Kubernetes For 1.22.2 k8s packages, source repo has been deprecated, going to store these packages in sonic build storage for installation to mitigate the issue. Will migrate to new repo when we are ready to upgrade k8s version. Work item tracking Microsoft ADO (number only): 27075924 How I did it Store the 1.22.2 k8s package in sonic build storage and install the package there. How to verify it "apt list" to check if it's installed. --- Makefile.work | 1 + build_debian.sh | 29 +++++++++++++++++++---------- rules/config | 1 + 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/Makefile.work b/Makefile.work index 1381795988e2..f3c9a740dc6e 100644 --- a/Makefile.work +++ b/Makefile.work @@ -521,6 +521,7 @@ SONIC_BUILD_INSTRUCTION := $(MAKE) \ INCLUDE_KUBERNETES=$(INCLUDE_KUBERNETES) \ KUBERNETES_VERSION=$(KUBERNETES_VERSION) \ KUBERNETES_CNI_VERSION=$(KUBERNETES_CNI_VERSION) \ + KUBERNETES_CRI_TOOLS_VERSION=$(KUBERNETES_CRI_TOOLS_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 1f9bc8eba042..8e6d799e8157 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -276,16 +276,25 @@ sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y remove software-properties-common install_kubernetes () { local ver="$1" - sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT curl -fsSL \ - https://packages.cloud.google.com/apt/doc/apt-key.gpg | \ - sudo LANG=C chroot $FILESYSTEM_ROOT apt-key add - - ## 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} + ## Install k8s package from storage + local storage_prefix="https://sonicstorage.blob.core.windows.net/public/kubernetes" + sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT curl -o /tmp/cri-tools.deb -fsSL \ + ${storage_prefix}/cri-tools_${KUBERNETES_CRI_TOOLS_VERSION}_${CONFIGURED_ARCH}.deb + sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT curl -o /tmp/kubernetes-cni.deb -fsSL \ + ${storage_prefix}/kubernetes-cni_${KUBERNETES_CNI_VERSION}_${CONFIGURED_ARCH}.deb + sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT curl -o /tmp/kubelet.deb -fsSL \ + ${storage_prefix}/kubelet_${ver}_${CONFIGURED_ARCH}.deb + sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT curl -o /tmp/kubectl.deb -fsSL \ + ${storage_prefix}/kubectl_${ver}_${CONFIGURED_ARCH}.deb + sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT curl -o /tmp/kubeadm.deb -fsSL \ + ${storage_prefix}/kubeadm_${ver}_${CONFIGURED_ARCH}.deb + + sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install -f /tmp/cri-tools.deb + sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install -f /tmp/kubernetes-cni.deb + sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install -f /tmp/kubelet.deb + sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install -f /tmp/kubectl.deb + sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install -f /tmp/kubeadm.deb + sudo LANG=C chroot $FILESYSTEM_ROOT rm -f /tmp/{cri-tools,kubernetes-cni,kubelet,kubeadm,kubectl}.deb } if [ "$INCLUDE_KUBERNETES" == "y" ] diff --git a/rules/config b/rules/config index 06dc71261a9b..1adaccbc9304 100644 --- a/rules/config +++ b/rules/config @@ -196,6 +196,7 @@ KUBE_DOCKER_PROXY = http://172.16.1.1:3128/ # KUBERNETES_VERSION = 1.22.2-00 KUBERNETES_CNI_VERSION = 0.8.7-00 +KUBERNETES_CRI_TOOLS_VERSION = 1.26.0-00 K8s_GCR_IO_PAUSE_VERSION = 3.5 # INCLUDE_KUBERNETES_MASTER - if set to y kubernetes packages are installed o be able From 12c662ab3295b041173fd1dc1e570570b148e388 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sun, 10 Mar 2024 01:01:01 +0800 Subject: [PATCH 187/419] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#18314) #### Why I did it src/sonic-utilities ``` * 9d5dacab - (HEAD -> 202311, origin/202311) CLI to skip polling for periodic information for a port in DomInfoUpdateTask thread (#3187) (4 hours ago) [mihirpat1] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index b2bea12cd3dc..9d5dacab0267 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit b2bea12cd3dc9a0d80f1060b974a95b162830b0a +Subproject commit 9d5dacab02671f35659114d44a554f5181badac1 From fe1e96dafe9a6027cc92d9327320a73dca6ab5c3 Mon Sep 17 00:00:00 2001 From: Pavan-Nokia <120486223+Pavan-Nokia@users.noreply.github.com> Date: Mon, 11 Mar 2024 00:45:06 -0400 Subject: [PATCH 188/419] [Nokia-7215-A1][arm64]Update platform init files (#18267) --- platform/marvell-arm64/platform.conf | 8 +- .../7215/modules/nokia_7215_ixs_a1_cpld.c | 148 +++++++----------- .../7215/scripts/nokia-7215-init.sh | 26 ++- platform/marvell-arm64/sonic_fit.its | 32 +++- 4 files changed, 115 insertions(+), 99 deletions(-) diff --git a/platform/marvell-arm64/platform.conf b/platform/marvell-arm64/platform.conf index 8a78164d93a5..7f969495c890 100644 --- a/platform/marvell-arm64/platform.conf +++ b/platform/marvell-arm64/platform.conf @@ -31,7 +31,7 @@ PLATFORM_AC5X=0 PLATFORM_CN9131=0 case $PLATFORM in - arm64-nokia_ixs7215_52xb-r0) PLATFORM_AC5X=1; + arm64-nokia_ixs7215_52xb-r0) PLATFORM_7215_A1=1; fdt_fname="/usr/lib/linux-image-${kernel_version}/marvell/7215-ixs-a1.dtb"; fit_conf_name="#conf_7215_a1";; arm64-marvell_rd98DX35xx-r0) PLATFORM_AC5X=1; @@ -50,6 +50,12 @@ if [ $PLATFORM_AC5X -eq 1 ]; then FW_ENV_DEFAULT='/dev/mtd0 0x400000 0x10000 0x10000' demo_part=2 mmc_bus="mmc0:0001" +elif [ $PLATFORM_7215_A1 -eq 1 ]; then + fit_addr=0x20000000 + VAR_LOG=4096 + FW_ENV_DEFAULT='/dev/mtd1 0x0 0x10000 0x10000' + demo_part=2 + mmc_bus="mmc0:0001" elif [ $PLATFORM_CN9131 -eq 1 ]; then fdt_addr=0x1000000 fit_addr=0x8000000 diff --git a/platform/marvell-arm64/sonic-platform-nokia/7215/modules/nokia_7215_ixs_a1_cpld.c b/platform/marvell-arm64/sonic-platform-nokia/7215/modules/nokia_7215_ixs_a1_cpld.c index e6f05fc6ac56..d97c9f779538 100644 --- a/platform/marvell-arm64/sonic-platform-nokia/7215/modules/nokia_7215_ixs_a1_cpld.c +++ b/platform/marvell-arm64/sonic-platform-nokia/7215/modules/nokia_7215_ixs_a1_cpld.c @@ -56,18 +56,14 @@ #define SYSTEM_STATUS_LED_CONTROL_REG 0x07 #define POWER_AND_FAN_LED_CONTROL_REG 0x08 #define SFP_TX_FAULT_STATUS_REG 0x09 -#define PSU1_PSU2_DEVICE_STATUS_REG 0x0A -#define FAN_ENABLE_REG 0x0B -#define USB_POWER_ENABLE_REG 0x0C +#define TEMP_EVENT_STATUS_REG 0x0D +#define TEMP_EVENT_MASK_REG 0x0E #define SFP_LED_TEST_REG 0x0F #define RESET_REG 0x10 -#define PHY_IRQ_LIVE_STATE_REG 0x11 #define MISC_IRQ_LIVE_STATE_REG 0x12 #define INTERRUPT_REG 0x13 #define INTERRUPT_MASK_REG 0x14 -#define PHY_INT_STATUS_REG 0x15 #define MISC_INT_STATUS_REG 0x16 -#define PHY_INT_MASK_REG 0x17 #define MISC_INT_MASK_REG 0x18 #define GPIO_DIRECTION_REG 0x19 #define GPIO_DATA_IN_REG 0x1A @@ -79,6 +75,7 @@ #define RESET_CAUSE_REG_WARM_RESET 0x2 #define RESET_CAUSE_REG_WDOG_RESET 0x4 #define RESET_CAUSE_REG_SYS_RESET 0x8 +#define RESET_CAUSE_REG_THERMAL_OL 0x10 #define SFP_PRESENCE_REG_SFP49 0x0 #define SFP_PRESENCE_REG_SFP50 0x1 @@ -96,6 +93,13 @@ #define SFP_TX_DISABLE_REG_SFP52 0x3 #define SFP_TX_DISABLE_REG_LED_MUX 0x4 +#define TS1_ALERT_EVENT 0x2 +#define TS2_ALERT_EVENT 0x4 +#define TS3_ALERT_EVENT 0x8 +#define CPU_TEMP_EVENT 0x10 +#define AC5X_HIGHTEMP_EVENT 0x20 +#define DIMM_TEMP_EVENT 0x40 + #define MAC_INIT_STATUS_REG_INIT_DONE 0x2 enum system_status_led_mode { @@ -129,14 +133,6 @@ char *power_fan_led_mode_str[]={"off", "green", "amber", "blink-green", "invalid #define SFP_TX_FAULT_STATUS_SFP51 0x2 #define SFP_TX_FAULT_STATUS_SFP52 0x3 -#define PSU1_POWERGOOD 2 -#define PSU2_POWERGOOD 3 - -#define FAN1_ENABLE 0 -#define FAN2_ENABLE 1 - -#define USB_POWER_ENABLE 0 - #define RESET_REG_WARM_RESET 0x0 #define RESET_REG_COLD_RESET 0x4 #define RESET_REG_I2CMUX_RESET 0x6 @@ -193,22 +189,26 @@ static ssize_t show_last_reset_cause(struct device *dev, struct device_attribute val = nokia_7215_ixs_a1_cpld_read(data, RESET_CAUSE_REG); switch (val) { case RESET_CAUSE_REG_COLD_RESET: - reason="cold reset"; + reason="cold_reset"; break; case RESET_CAUSE_REG_WARM_RESET: - reason="warm reset"; + reason="warm_reset"; break; case RESET_CAUSE_REG_WDOG_RESET: - reason="wdog reset"; + reason="wdog_reset"; break; case RESET_CAUSE_REG_SYS_RESET: - reason="sys reset"; + reason="sys_reset"; + break; + case RESET_CAUSE_REG_THERMAL_OL: + reason="thermal_reset"; break; + default: reason="unknown"; break; } - return sprintf(buf,"0x%02x %s\n",val, reason); + return sprintf(buf,"%s\n",reason); } static ssize_t show_cpld_version(struct device *dev, struct device_attribute *devattr, char *buf) @@ -343,67 +343,48 @@ static ssize_t show_sfp_tx_fault(struct device *dev, struct device_attribute *de return sprintf(buf,"%d\n",(val>>sda->index) & 0x1 ? 1:0); } - -static ssize_t show_psu_pg_status(struct device *dev, struct device_attribute *devattr, char *buf) +static ssize_t show_temp_event_status(struct device *dev, struct device_attribute *devattr, char *buf) { struct cpld_data *data = dev_get_drvdata(dev); - struct sensor_device_attribute *sda = to_sensor_dev_attr(devattr); u8 val=0; - val = nokia_7215_ixs_a1_cpld_read(data, PSU1_PSU2_DEVICE_STATUS_REG); - - /* If the bit is set, psu power is good */ - return sprintf(buf,"%d\n",(val>>sda->index) & 0x1 ? 1:0); -} - -static ssize_t show_fan_enable_status(struct device *dev, struct device_attribute *devattr, char *buf) -{ - struct cpld_data *data = dev_get_drvdata(dev); - struct sensor_device_attribute *sda = to_sensor_dev_attr(devattr); - u8 val=0; - val = nokia_7215_ixs_a1_cpld_read(data, FAN_ENABLE_REG); - - /* If the bit is set, fan is disabled. So, toggling intentionally */ - return sprintf(buf,"%d\n",(val>>sda->index) & 0x1 ? 0:1); -} - -static ssize_t set_fan_enable_status(struct device *dev, struct device_attribute *devattr, const char *buf, size_t count) -{ - struct cpld_data *data = dev_get_drvdata(dev); - struct sensor_device_attribute *sda = to_sensor_dev_attr(devattr); - u8 reg_val=0, usr_val=0, mask; - int ret=kstrtou8(buf,10, &usr_val); - if (ret != 0) { - return ret; - } - if (usr_val > 1) { - return -EINVAL; + char *reason=NULL; + val = nokia_7215_ixs_a1_cpld_read(data, TEMP_EVENT_STATUS_REG); + switch (val) { + case TS1_ALERT_EVENT: + reason="ts1"; + break; + case TS2_ALERT_EVENT: + reason="ts2"; + break; + case TS3_ALERT_EVENT: + reason="ts3"; + break; + case CPU_TEMP_EVENT: + reason="cpu"; + break; + case AC5X_HIGHTEMP_EVENT: + reason="ac5x"; + break; + case DIMM_TEMP_EVENT: + reason="dimm"; + break; + + default: + reason="none"; + break; } - - mask = (~(1 << sda->index)) & 0xFF; - reg_val = nokia_7215_ixs_a1_cpld_read(data, RESET_REG); - reg_val = reg_val & mask; - - usr_val = !usr_val; // If the bit is set, fan is disabled. So, toggling intentionally - usr_val = usr_val << sda->index; - - nokia_7215_ixs_a1_cpld_write(data, FAN_ENABLE_REG, (reg_val|usr_val)); - - return count; + return sprintf(buf,"0x%02x %s\n",val, reason); } -static ssize_t show_usb_enable_status(struct device *dev, struct device_attribute *devattr, char *buf) +static ssize_t show_sfp_ledtest_status(struct device *dev, struct device_attribute *devattr, char *buf) { struct cpld_data *data = dev_get_drvdata(dev); - struct sensor_device_attribute *sda = to_sensor_dev_attr(devattr); - u8 val=0; - val = nokia_7215_ixs_a1_cpld_read(data, USB_POWER_ENABLE_REG); - - /* If the bit is set, usb power is disabled. So, toggling intentionally */ - return sprintf(buf,"%d\n",(val>>sda->index) & 0x1 ? 0:1); + u8 val = nokia_7215_ixs_a1_cpld_read(data, SFP_LED_TEST_REG); + return sprintf(buf,"0x%02x\n",val); } -static ssize_t set_usb_enable_status(struct device *dev, struct device_attribute *devattr, const char *buf, size_t count) +static ssize_t set_sfp_ledtest_status(struct device *dev, struct device_attribute *devattr, const char *buf, size_t count) { struct cpld_data *data = dev_get_drvdata(dev); u8 usr_val=0; @@ -411,24 +392,19 @@ static ssize_t set_usb_enable_status(struct device *dev, struct device_attribute if (ret != 0) { return ret; } - if(usr_val > 1) { - return -EINVAL; - } - /* If the bit is set, usb power is disabled. So, toggling intentionally */ - usr_val = !usr_val; - nokia_7215_ixs_a1_cpld_write(data, USB_POWER_ENABLE_REG, usr_val); + nokia_7215_ixs_a1_cpld_write(data, SFP_LED_TEST_REG, usr_val); return count; } -static ssize_t show_sfp_ledtest_status(struct device *dev, struct device_attribute *devattr, char *buf) +static ssize_t show_temp_event_mask_status(struct device *dev, struct device_attribute *devattr, char *buf) { struct cpld_data *data = dev_get_drvdata(dev); - u8 val = nokia_7215_ixs_a1_cpld_read(data, SFP_LED_TEST_REG); + u8 val = nokia_7215_ixs_a1_cpld_read(data, TEMP_EVENT_MASK_REG); return sprintf(buf,"0x%02x\n",val); } -static ssize_t set_sfp_ledtest_status(struct device *dev, struct device_attribute *devattr, const char *buf, size_t count) +static ssize_t set_temp_event_mask_status(struct device *dev, struct device_attribute *devattr, const char *buf, size_t count) { struct cpld_data *data = dev_get_drvdata(dev); u8 usr_val=0; @@ -437,7 +413,7 @@ static ssize_t set_sfp_ledtest_status(struct device *dev, struct device_attribut return ret; } - nokia_7215_ixs_a1_cpld_write(data, SFP_LED_TEST_REG, usr_val); + nokia_7215_ixs_a1_cpld_write(data, TEMP_EVENT_MASK_REG, usr_val); return count; } @@ -499,12 +475,9 @@ static SENSOR_DEVICE_ATTR(sfp49_tx_fault, S_IRUGO, show_sfp_tx_fault, NULL, SFP_ static SENSOR_DEVICE_ATTR(sfp50_tx_fault, S_IRUGO, show_sfp_tx_fault, NULL, SFP_TX_FAULT_STATUS_SFP50); static SENSOR_DEVICE_ATTR(sfp51_tx_fault, S_IRUGO, show_sfp_tx_fault, NULL, SFP_TX_FAULT_STATUS_SFP51); static SENSOR_DEVICE_ATTR(sfp52_tx_fault, S_IRUGO, show_sfp_tx_fault, NULL, SFP_TX_FAULT_STATUS_SFP52); -static SENSOR_DEVICE_ATTR(psu1_power_good, S_IRUGO, show_psu_pg_status, NULL, PSU1_POWERGOOD); -static SENSOR_DEVICE_ATTR(psu2_power_good, S_IRUGO, show_psu_pg_status, NULL, PSU2_POWERGOOD); -static SENSOR_DEVICE_ATTR(fan1_enable, S_IRUGO | S_IWUSR, show_fan_enable_status, set_fan_enable_status, FAN1_ENABLE); -static SENSOR_DEVICE_ATTR(fan2_enable, S_IRUGO | S_IWUSR, show_fan_enable_status, set_fan_enable_status, FAN2_ENABLE); -static SENSOR_DEVICE_ATTR(usb_power_enable, S_IRUGO | S_IWUSR, show_usb_enable_status, set_usb_enable_status, 0); +static SENSOR_DEVICE_ATTR(temp_event_status, S_IRUGO, show_temp_event_status, NULL, 0); static SENSOR_DEVICE_ATTR(sfp_led_test, S_IRUGO | S_IWUSR, show_sfp_ledtest_status, set_sfp_ledtest_status, 0); +static SENSOR_DEVICE_ATTR(temp_event_mask, S_IRUGO | S_IWUSR, show_temp_event_mask_status, set_temp_event_mask_status, 0); static SENSOR_DEVICE_ATTR(warm_reset, S_IRUGO | S_IWUSR, show_reset_reg, set_reset_reg, RESET_REG_WARM_RESET); static SENSOR_DEVICE_ATTR(cold_reset, S_IRUGO | S_IWUSR, show_reset_reg, set_reset_reg, RESET_REG_COLD_RESET); static SENSOR_DEVICE_ATTR(i2cmux_reset, S_IRUGO | S_IWUSR, show_reset_reg, set_reset_reg, RESET_REG_I2CMUX_RESET); @@ -526,6 +499,7 @@ static struct attribute *nokia_7215_ixs_a1_cpld_attributes[] = { &sensor_dev_attr_sfp50_tx_disable.dev_attr.attr, &sensor_dev_attr_sfp51_tx_disable.dev_attr.attr, &sensor_dev_attr_sfp52_tx_disable.dev_attr.attr, + &sensor_dev_attr_temp_event_status.dev_attr.attr, &sensor_dev_attr_system_led.dev_attr.attr, &sensor_dev_attr_psu_led.dev_attr.attr, &sensor_dev_attr_fan_led.dev_attr.attr, @@ -533,12 +507,8 @@ static struct attribute *nokia_7215_ixs_a1_cpld_attributes[] = { &sensor_dev_attr_sfp50_tx_fault.dev_attr.attr, &sensor_dev_attr_sfp51_tx_fault.dev_attr.attr, &sensor_dev_attr_sfp52_tx_fault.dev_attr.attr, - &sensor_dev_attr_psu1_power_good.dev_attr.attr, - &sensor_dev_attr_psu2_power_good.dev_attr.attr, - &sensor_dev_attr_fan1_enable.dev_attr.attr, - &sensor_dev_attr_fan2_enable.dev_attr.attr, - &sensor_dev_attr_usb_power_enable.dev_attr.attr, &sensor_dev_attr_sfp_led_test.dev_attr.attr, + &sensor_dev_attr_temp_event_mask.dev_attr.attr, &sensor_dev_attr_warm_reset.dev_attr.attr, &sensor_dev_attr_cold_reset.dev_attr.attr, &sensor_dev_attr_i2cmux_reset.dev_attr.attr, diff --git a/platform/marvell-arm64/sonic-platform-nokia/7215/scripts/nokia-7215-init.sh b/platform/marvell-arm64/sonic-platform-nokia/7215/scripts/nokia-7215-init.sh index deecbe068232..1a3db2f0e716 100644 --- a/platform/marvell-arm64/sonic-platform-nokia/7215/scripts/nokia-7215-init.sh +++ b/platform/marvell-arm64/sonic-platform-nokia/7215/scripts/nokia-7215-init.sh @@ -6,7 +6,14 @@ load_kernel_drivers() { echo "Loading Kernel Drivers" sudo insmod /lib/modules/5.10.0-23-2-arm64/kernel/extra/nokia_7215_ixs_a1_cpld.ko - sudo insmod /lib/modules/5.10.0-23-2-arm64/kernel/extra/ac5_thermal_sensor.ko + sudo insmod /lib/modules/5.10.0-23-2-arm64/kernel/extra/cn9130_cpu_thermal_sensor.ko +} + +fw_uboot_env_cfg() +{ + echo "Setting up U-Boot environment for Nokia-7215-A1" + FW_ENV_DEFAULT='/dev/mtd1 0x0 0x10000 0x10000' + echo $FW_ENV_DEFAULT > /etc/fw_env.config } nokia_7215_profile() @@ -33,8 +40,8 @@ file_exists() { # Install kernel drivers required for i2c bus access load_kernel_drivers -# Enumerate RTC -echo m41t11 0x68 > /sys/bus/i2c/devices/i2c-0/new_device +#setting up uboot environment +fw_uboot_env_cfg # Enumerate the SFP eeprom device on each mux channel echo pca9546 0x70> /sys/bus/i2c/devices/i2c-1/new_device @@ -43,11 +50,12 @@ echo pca9546 0x70> /sys/bus/i2c/devices/i2c-1/new_device echo ina230 0x40 > /sys/bus/i2c/devices/i2c-0/new_device # Enumerate fan -echo emc2305 0x2e > /sys/bus/i2c/devices/i2c-0/new_device +echo emc2305 0x2f > /sys/bus/i2c/devices/i2c-0/new_device # Enumerate Thermals echo tmp75 0x48 > /sys/bus/i2c/devices/i2c-0/new_device echo tmp75 0x49 > /sys/bus/i2c/devices/i2c-0/new_device +echo tmp75 0x4A > /sys/bus/i2c/devices/i2c-0/new_device #Enumerate CPLD echo nokia_7215_a1_cpld 0x41 > /sys/bus/i2c/devices/i2c-0/new_device @@ -63,6 +71,12 @@ else echo "SYSEEPROM file not foud" fi +#Enumurate GPIO +echo 41 > /sys/class/gpio/export +echo 61 > /sys/class/gpio/export +echo 62 > /sys/class/gpio/export +chmod 666 /sys/class/gpio/gpio41/value + # Get list of the mux channels for((i=0; i<10; i++)); do @@ -85,8 +99,8 @@ do echo 0 > /sys/bus/i2c/devices/0-0041/sfp${i}_tx_disable done -#slow down fan speed to 50 untill thermal algorithm kicks in% -i2c_path="/sys/bus/i2c/devices/0-002e/hwmon/hwmon?" +#slow down fan speed to 50% untill thermal algorithm kicks in +i2c_path="/sys/bus/i2c/devices/0-002f/hwmon/hwmon?" echo 128 > $i2c_path/pwm1 echo 128 > $i2c_path/pwm2 diff --git a/platform/marvell-arm64/sonic_fit.its b/platform/marvell-arm64/sonic_fit.its index b4c8ca89014d..1a329d3839dc 100644 --- a/platform/marvell-arm64/sonic_fit.its +++ b/platform/marvell-arm64/sonic_fit.its @@ -35,7 +35,7 @@ type = "flat_dt"; arch = "arm64"; compression = "none"; - load = <0x2 0x1000000>; + load = <0x11000000>; hash@1 { algo = "sha1"; }; @@ -66,6 +66,19 @@ algo = "sha1"; }; }; + kernel_2 { + description = "Linux Kernel"; + data = /incbin/("/boot/vmlinuz-5.10.0-23-2-arm64"); + type = "kernel"; + arch = "arm64"; + os = "linux"; + compression = "none"; + load = <0x12000000>; + entry = <0x12000000>; + hash@1 { + algo = "sha1"; + }; + }; ramdisk_1 { description = "ramdisk"; data = /incbin/("/boot/initrd.img-5.10.0-23-2-arm64"); @@ -79,6 +92,19 @@ algo = "sha1"; }; }; + ramdisk_2 { + description = "ramdisk"; + data = /incbin/("/boot/initrd.img-5.10.0-23-2-arm64"); + type = "ramdisk"; + arch = "arm64"; + os = "linux"; + compression = "gzip"; + load = <0x18000000>; + entry = <0x18000000>; + hash@1 { + algo = "sha1"; + }; + }; fdt_cn9131 { description = "Flattened Device Tree blob"; data = /incbin/("/boot/cn9131-db-comexpress.dtb"); @@ -105,9 +131,9 @@ }; conf_7215_a1 { description = "Boot Linux kernel with FDT blob + ramdisk for 7125_IXS_A1"; - kernel = "kernel_ac5x"; + kernel = "kernel_2"; fdt = "fdt_7215_a1"; - ramdisk = "ramdisk_ac5x"; + ramdisk = "ramdisk_2"; hash@1 { algo = "sha1"; }; From 4ae9a3d1e1b0c343b9a46ff172f73298b1ea701b Mon Sep 17 00:00:00 2001 From: Rajkumar-Marvell <54936542+rajkumar38@users.noreply.github.com> Date: Mon, 11 Mar 2024 21:31:22 +0530 Subject: [PATCH 189/419] [Marvell] Update armhf sai debian (#18282) Signed-off-by: Rajkumar P R --- platform/marvell-armhf/sai.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/marvell-armhf/sai.mk b/platform/marvell-armhf/sai.mk index fe4f91b8393a..23be2753a5d5 100644 --- a/platform/marvell-armhf/sai.mk +++ b/platform/marvell-armhf/sai.mk @@ -1,6 +1,6 @@ # Marvell SAI -export MRVL_SAI_VERSION = 1.12.0-2 +export MRVL_SAI_VERSION = 1.13.3-1 export MRVL_SAI = mrvllibsai_$(MRVL_SAI_VERSION)_$(PLATFORM_ARCH).deb $(MRVL_SAI)_SRC_PATH = $(PLATFORM_PATH)/sai From abc3536e7a082edfb2d5f86d4ec4a1203882300b Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Mon, 11 Mar 2024 22:07:23 +0800 Subject: [PATCH 190/419] [Build] Fix the pygobject installation issue (#18318) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Why I did it Fix the build broken issue: Processing /sonic_host_services-1.0-py3-none-any.whl Requirement already satisfied: dbus-python in /usr/lib/python3/dist-packages (from sonic-host-services==1.0) (1.2.16) Requirement already satisfied: systemd-python in /usr/local/lib/python3.9/dist-packages (from sonic-host-services==1.0) (235) Requirement already satisfied: Jinja2>=2.10 in /usr/local/lib/python3.9/dist-packages (from sonic-host-services==1.0) (3.1.2) Collecting PyGObject (from sonic-host-services==1.0) Downloading pygobject-3.48.0.tar.gz (714 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 714.2/714.2 kB 13.1 MB/s eta 0:00:00 Installing build dependencies: started Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Getting requirements to build wheel: finished with status 'done' Installing backend dependencies: started Installing backend dependencies: finished with status 'error' error: subprocess-exited-with-error Work item tracking Microsoft ADO (number only): 27124786 How I did it Install the pygobject before installing the sonic_host_services. If installing during the .,whl, it will try to install the latest version (3.48.0), then it will have an issue. Prefer to use the version 3.46.0, see sonic-buildimage/files/build/versions/host-image/versions-py3 Line 55 in a6437d8 pygobject==3.46.0 It will not add a new package, only install the depended packages firstly. --- files/build_templates/sonic_debian_extension.j2 | 1 + 1 file changed, 1 insertion(+) diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 67bc3ab40847..6ecbcb4bf300 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -244,6 +244,7 @@ sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install system # Install SONiC host services package SONIC_HOST_SERVICES_PY3_WHEEL_NAME=$(basename {{sonic_host_services_py3_wheel_path}}) sudo cp {{sonic_host_services_py3_wheel_path}} $FILESYSTEM_ROOT/$SONIC_HOST_SERVICES_PY3_WHEEL_NAME +sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install pygobject sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install $SONIC_HOST_SERVICES_PY3_WHEEL_NAME sudo rm -rf $FILESYSTEM_ROOT/$SONIC_HOST_SERVICES_PY3_WHEEL_NAME From 5b91eeb07eaceef90ace35a2a5c255dd0ffe7967 Mon Sep 17 00:00:00 2001 From: amulyan7 <98349131+amulyan7@users.noreply.github.com> Date: Tue, 12 Mar 2024 18:36:51 -0700 Subject: [PATCH 191/419] Set loglevel for crash kernel to reduce verbosity and improve overall router recovery time (#18285) Why I did it On certain routers with baud rate 9600, crash kernel is taking a long time , close to ~5mins, to complete kernel dump and reload the box. On contrast to routers with baud rate 115200, crash kernel dump process is observed to be completed under 35s-60s (depending on the platform). Currently, all debug and informational messages are printed on the console which also factors in for the delay seen. Unless the router is monitored on console in real time, these messages are not very useful. Setting the loglevel to warning will help reduce the verbosity of logs on console, in turn allow crash kernel dump process to be completed in a reasonable time which will also help in overall router recovery time. How I did it Setting loglevel attribute in crashkernel cmdline How to verify it Install SONiC image with crashkernel cmdline with loglevel set to warning and initiate an induced a crash (sysrq-trigger) crashkernel boot and dump process will be completed in 20s-30s depending on the platform --- files/image_config/kdump/kdump-tools | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/files/image_config/kdump/kdump-tools b/files/image_config/kdump/kdump-tools index 83c2766524d3..2fb39d81bc75 100644 --- a/files/image_config/kdump/kdump-tools +++ b/files/image_config/kdump/kdump-tools @@ -7,10 +7,11 @@ KDUMP_CMDLINE_APPEND="irqpoll nr_cpus=1 nousb systemd.unit=kdump-tools.service a # Reboot crash kernel on panic # Enable debug level logging of crash kernel for better visibility +# Set loglevel to reduce verbosity and print only warning conditions # Disable advanced pcie features # Disable high precision event timer as on some platforms it is interfering with the kdump operation # Pass platform identifier string as part of crash kernel command line to be used by the reboot script during kdump -KDUMP_CMDLINE_APPEND="${KDUMP_CMDLINE_APPEND} panic=10 debug hpet=disable pcie_port=compat pci=nommconf sonic_platform=__PLATFORM__" +KDUMP_CMDLINE_APPEND="${KDUMP_CMDLINE_APPEND} panic=10 debug loglevel=4 hpet=disable pcie_port=compat pci=nommconf sonic_platform=__PLATFORM__" # Use SONiC reboot wrapper script present in /usr/local/bin post kdump PATH=/usr/local/bin:$PATH From f46a2dba14650100bd0c05320fb02bedea2e69ae Mon Sep 17 00:00:00 2001 From: Zhijian Li Date: Wed, 13 Mar 2024 06:07:08 +0800 Subject: [PATCH 192/419] Update minigraph testcases (#18321) --- src/sonic-config-engine/tests/test_minigraph_case.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sonic-config-engine/tests/test_minigraph_case.py b/src/sonic-config-engine/tests/test_minigraph_case.py index 70c5c410332e..8bad0f5f3560 100644 --- a/src/sonic-config-engine/tests/test_minigraph_case.py +++ b/src/sonic-config-engine/tests/test_minigraph_case.py @@ -528,7 +528,7 @@ def test_minigraph_acl_type_bmcdata(self): } # TC1: Minigraph contains acl table type BmcData sample_mx_graph = os.path.join(self.test_dir,'simple-sample-graph-mx.xml') - result = minigraph.parse_xml(sample_mx_graph) + result = minigraph.parse_xml(sample_mx_graph, port_config_file=self.port_config) self.assertIn('ACL_TABLE_TYPE', result) self.assertIn('BMCDATA', result['ACL_TABLE_TYPE']) self.assertIn('BMCDATAV6', result['ACL_TABLE_TYPE']) @@ -537,7 +537,7 @@ def test_minigraph_acl_type_bmcdata(self): self.assertDictEqual(result['ACL_TABLE']['BMC_ACL_NORTHBOUND'], expected_acl_table_bmc_acl_northbound) self.assertDictEqual(result['ACL_TABLE']['BMC_ACL_NORTHBOUND_V6'], expected_acl_table_bmc_acl_northbound_v6) # TC2: Minigraph doesn't contain acl table type BmcData - result = minigraph.parse_xml(self.sample_graph) + result = minigraph.parse_xml(self.sample_graph, port_config_file=self.port_config) self.assertNotIn('ACL_TABLE_TYPE', result) def test_parse_device_desc_xml_mgmt_interface(self): @@ -564,7 +564,7 @@ def test_mgmt_device_disable_counters(self): mgmt_graphs = ['simple-sample-graph-mx.xml', 'simple-sample-graph-m0.xml'] for graph in mgmt_graphs: graph_path = os.path.join(self.test_dir, graph) - result = minigraph.parse_xml(graph_path) + result = minigraph.parse_xml(graph_path, port_config_file=self.port_config) self.assertIn('FLEX_COUNTER_TABLE', result) for counter in expected_mgmt_disabled_counters: self.assertIn(counter, result['FLEX_COUNTER_TABLE']) @@ -573,5 +573,5 @@ def test_mgmt_device_disable_counters(self): if counter in result['FLEX_COUNTER_TABLE']: self.assertDictEqual(result['FLEX_COUNTER_TABLE'][counter], {'FLEX_COUNTER_STATUS': 'enable'}) # TC2: For other minigraph, result should not contain FLEX_COUNTER_TABLE - result = minigraph.parse_xml(self.sample_graph) + result = minigraph.parse_xml(self.sample_graph, port_config_file=self.port_config) self.assertNotIn('FLEX_COUNTER_TABLE', result) From 31d52aa48bf7776033dde9550ca13fdc5306d099 Mon Sep 17 00:00:00 2001 From: Stepan Blyshchak <38952541+stepanblyschak@users.noreply.github.com> Date: Thu, 29 Feb 2024 15:59:36 +0200 Subject: [PATCH 193/419] [systemd-sonic-generator] Fix handling service files with additional fields under [Install] section (#17764) If encountered a line without RequiredBy or WantedBy the code passes uninitialized pointer to get_install_targets_from_line(). Where it can fail with segfault or silently pass randomly. - Why I did it Uninitialized target_suffix is passed to get_install_targets_from_line() when other fields are present in [Install] section, like this: root@sonic:/home/admin# systemctl cat ntpsec ... [Install] Alias=ntp.service Alias=ntpd.service WantedBy=multi-user.target - How I did it Initialize target_suffix with NULL, put an assert in get_install_targets_from_line(). Edited test to cover this scenario. - How to verify it UT and on the switch. Signed-off-by: Stepan Blyschak --- src/systemd-sonic-generator/systemd-sonic-generator.c | 7 ++++++- src/systemd-sonic-generator/tests/testfiles/test.service | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/systemd-sonic-generator/systemd-sonic-generator.c b/src/systemd-sonic-generator/systemd-sonic-generator.c index 1d1a53dbcef9..d9bb75fea2b6 100644 --- a/src/systemd-sonic-generator/systemd-sonic-generator.c +++ b/src/systemd-sonic-generator/systemd-sonic-generator.c @@ -141,6 +141,9 @@ static int get_install_targets_from_line(char* target_string, char* install_type char final_target[PATH_MAX]; int num_targets = 0; + assert(target_string); + assert(install_type); + while ((token = strtok_r(target_string, " ", &target_string))) { if (num_targets + existing_targets >= MAX_NUM_TARGETS) { fputs("Number of targets found exceeds MAX_NUM_TARGETS\n", stderr); @@ -269,7 +272,7 @@ int get_install_targets(char* unit_file, char* targets[]) { char* token; char* line = NULL; bool first; - char* target_suffix; + char* target_suffix = NULL; char *instance_name; char *dot_ptr; @@ -306,6 +309,8 @@ int get_install_targets(char* unit_file, char* targets[]) { } else if (strstr(token, "WantedBy") != NULL) { target_suffix = ".wants"; + } else { + break; } } else { diff --git a/src/systemd-sonic-generator/tests/testfiles/test.service b/src/systemd-sonic-generator/tests/testfiles/test.service index e8b37f641fd3..ebc8b1f8d707 100644 --- a/src/systemd-sonic-generator/tests/testfiles/test.service +++ b/src/systemd-sonic-generator/tests/testfiles/test.service @@ -7,4 +7,5 @@ Type=oneshot RemainAfterExit=yes ExecStart=/usr/bin/test.sh start [Install] +Alias=test.service WantedBy=multi-user.target From 7f64e872b45841c9d3b0cfe0043178e05837c1fa Mon Sep 17 00:00:00 2001 From: bingwang-ms <66248323+bingwang-ms@users.noreply.github.com> Date: Mon, 11 Mar 2024 10:13:12 -0700 Subject: [PATCH 194/419] Fix yang model for ICMP and ICMPV6 (#18311) * Fix yang model for ICMP and ICMPV6 * Change ICMP type and code to 0-255 --- .../tests/yang_model_tests/tests/acl.json | 6 + .../yang_model_tests/tests_config/acl.json | 110 ++++++++++++++++++ .../yang-templates/sonic-acl.yang.j2 | 8 +- 3 files changed, 120 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 779a96d02bce..18f053e2a300 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 @@ -20,6 +20,12 @@ "ACL_RULE_WITH_VALID_OUT_PORTS": { "desc": "Configure ACL_RULE with valid OUT_PORTS." }, + "ACL_RULE_WITH_VALID_ICMPV4_CODE": { + "desc": "Configure ACL_RULE with valid ICMPV4 type and code." + }, + "ACL_RULE_WITH_VALID_ICMPV6_CODE": { + "desc": "Configure ACL_RULE with valid ICMPV6 type and code." + }, "ACL_TABLE_EMPTY_PORTS": { "desc": "Configure ACL_TABLE with empty ports." }, diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/acl.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/acl.json index aa908fdb754d..6f39ab6e41cb 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 @@ -590,6 +590,116 @@ } } }, + "ACL_RULE_WITH_VALID_ICMPV4_CODE": { + "sonic-acl:sonic-acl": { + "sonic-acl:ACL_RULE": { + "ACL_RULE_LIST": [ + { + "ACL_TABLE_NAME": "NO-NSW-PACL-V4", + "ICMP_CODE": 0, + "ICMP_TYPE": 0, + "IP_TYPE": "IPV4", + "PACKET_ACTION": "FORWARD", + "PRIORITY": 999960, + "RULE_NAME": "Rule_40" + } + ] + }, + "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_WITH_VALID_ICMPV6_CODE": { + "sonic-acl:sonic-acl": { + "sonic-acl:ACL_RULE": { + "ACL_RULE_LIST": [ + { + "ACL_TABLE_NAME": "NO-NSW-PACL-V6", + "ICMPV6_CODE": 0, + "ICMPV6_TYPE": 129, + "IP_TYPE": "IPV6", + "PACKET_ACTION": "FORWARD", + "PRIORITY": 999960, + "RULE_NAME": "Rule_40" + } + ] + }, + "sonic-acl:ACL_TABLE": { + "ACL_TABLE_LIST": [ + { + "ACL_TABLE_NAME": "NO-NSW-PACL-V6", + "policy_desc": "Filter IPv6", + "ports": [ + "Ethernet0", + "Ethernet1" + ], + "stage": "EGRESS", + "type": "L3" + } + ] + } + }, + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "admin_status": "up", + "alias": "eth0", + "description": "Ethernet0", + "lanes": "0,1,2,3", + "mtu": 9000, + "name": "Ethernet0", + "speed": 25000 + }, + { + "admin_status": "up", + "alias": "eth1", + "description": "Ethernet1", + "lanes": "4,5,6,7", + "mtu": 9000, + "name": "Ethernet1", + "speed": 25000 + } + ] + } + } + }, "ACL_TABLE_DEFAULT_VALUE_STAGE": { "sonic-acl:sonic-acl": { "sonic-acl:ACL_TABLE": { diff --git a/src/sonic-yang-models/yang-templates/sonic-acl.yang.j2 b/src/sonic-yang-models/yang-templates/sonic-acl.yang.j2 index 513c467094f7..882dbf8ef9c3 100644 --- a/src/sonic-yang-models/yang-templates/sonic-acl.yang.j2 +++ b/src/sonic-yang-models/yang-templates/sonic-acl.yang.j2 @@ -202,13 +202,13 @@ module sonic-acl { 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; + range 0..255; } } leaf ICMP_CODE { type uint8 { - range 1..16; + range 0..255; } } } @@ -217,13 +217,13 @@ module sonic-acl { when "not(IP_TYPE) or boolean(IP_TYPE[.='ANY' or .='IP' or .='IPV6' or .='IPv6ANY'])"; leaf ICMPV6_TYPE { type uint8 { - range 1..44; + range 0..255; } } leaf ICMPV6_CODE { type uint8 { - range 1..16; + range 0..255; } } } From 483f1f4cf49bd6a3cf57ef153977fd1e7bb1d197 Mon Sep 17 00:00:00 2001 From: Pavan-Nokia <120486223+Pavan-Nokia@users.noreply.github.com> Date: Mon, 11 Mar 2024 00:44:31 -0400 Subject: [PATCH 195/419] [armhf][Nokia-7215]Update HWSKU files for new SAI (#18294) --- .../Nokia-7215/ASK-Board-M0-48x1G-4x10G.md5 | 2 +- .../Nokia-7215/ASK-Board-M0-48x1G-4x10G.xml | 52 ++++++--- .../Nokia-7215/ASK-L1-M0-D0-48x1G-4x10G.md5 | 2 +- .../Nokia-7215/ASK-L1-M0-D0-48x1G-4x10G.xml | 2 +- .../Nokia-7215/ASK-L1-M0-D1-48x1G-4x10G.md5 | 2 +- .../Nokia-7215/ASK-L1-M0-D1-48x1G-4x10G.xml | 2 +- .../Nokia-7215/ASK-PP-M0-48x1G-4x10G.md5 | 2 +- .../Nokia-7215/ASK-PP-M0-48x1G-4x10G.xml | 24 ++--- .../Nokia-7215/SAI-M0-48x1G-4x10G.md5 | 2 +- .../Nokia-7215/SAI-M0-48x1G-4x10G.xml | 101 ++++++++++++++++-- 10 files changed, 147 insertions(+), 44 deletions(-) diff --git a/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/ASK-Board-M0-48x1G-4x10G.md5 b/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/ASK-Board-M0-48x1G-4x10G.md5 index b9adf45e052b..d381d2541957 100644 --- a/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/ASK-Board-M0-48x1G-4x10G.md5 +++ b/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/ASK-Board-M0-48x1G-4x10G.md5 @@ -1 +1 @@ -429e9dc38eebb3093b21e687edf55e79 \ No newline at end of file +78ea2f9bc238a32b68823bc7b082198d \ No newline at end of file diff --git a/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/ASK-Board-M0-48x1G-4x10G.xml b/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/ASK-Board-M0-48x1G-4x10G.xml index b3ee5191c442..63b6aeba3bd3 100644 --- a/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/ASK-Board-M0-48x1G-4x10G.xml +++ b/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/ASK-Board-M0-48x1G-4x10G.xml @@ -1,5 +1,5 @@ - + @@ -82,9 +82,9 @@ device-id-type uint32 - Device ID 0..1023 + Device ID 0..1 0 - 1023 + 1 port-mapping-type @@ -111,11 +111,9 @@ txq-port-number-type uint32 - 0 - 8 queues are configured per port (legacy mode), -1...16 - the number of queues configured per port - SIP 5 : Bobcat2,BobK:0..71 ;Bobcat3: 0..576 ;Aldrin2:0..99 + TXq port number 0 - 576 + 99 phy-smi-interface-type @@ -162,12 +160,14 @@ alaska-88E3140 - Specifies PHY identifier 88E3140, used for Copper with speeds of 100M/1G/10G. Uses with FW SolarFlare next generation. + Specifies PHY identifier 88E3140, used for Copper with speeds of 100M/1G/10G. +Uses with FW SolarFlare next generation. 5 alaska-88E3240 - Specifies PHY identifier 88E3240, used for Copper with speeds of 100M/1G/10G. Uses with FW, SolarFlare next generation. + Specifies PHY identifier 88E3240, used for Copper with speeds of 100M/1G/10G. +Uses with FW, SolarFlare next generation. 6 @@ -177,7 +177,8 @@ alaska-88E3220 - Specifies PHY identifier 88E3220, used for Combo port with speeds of 100M/1G/10G. Uses FW, SolarFlare next generation. + Specifies PHY identifier 88E3220, used for Combo port with speeds of 100M/1G/10G. +Uses FW, SolarFlare next generation. 8 @@ -212,17 +213,20 @@ alaska-88E1780 - Specifies PHY identifier 88E1780, Integrated Octal 10/100/1000 Mbps Energy Efficient Ethernet Transceiver + Specifies PHY identifier 88E1780, Integrated Octal 10/100/1000 Mbps Energy +Efficient Ethernet Transceiver 15 alaska-88E2540 - Specifies PHY identifier 88E2540, 4 ports 10/100/1000/2.5G/5GBASE-T Ethernet Transceiver with IEEE 1588v2 PTP Support + Specifies PHY identifier 88E2540, 4 ports 10/100/1000/2.5G/5GBASE-T Ethernet +Transceiver with IEEE 1588v2 PTP Support 16 alaska-88E2580 - Specifies PHY identifier 88E12580, Octal 10/100/1000/2.5G/5GBASE-T Ethernet Transceiver with IEEE 1588v2 PTP Support + Specifies PHY identifier 88E12580, Octal 10/100/1000/2.5G/5GBASE-T Ethernet Transceiver +with IEEE 1588v2 PTP Support 17 @@ -510,7 +514,7 @@ uint32 serdes lane 0 - 255 + 7 cpu-type @@ -589,12 +593,12 @@ lowercase characters. sip5 - SIP5: AC5, AC3x + SIP5: AC3x 5 sip6 - SIP6: Falcon, AC5x, AC5P + SIP6: Falcon, AC5x 6 @@ -665,7 +669,23 @@ lowercase characters. 1 + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_AC3X M0-48x1G-4x10G linux-static linux-static diff --git a/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/ASK-L1-M0-D0-48x1G-4x10G.md5 b/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/ASK-L1-M0-D0-48x1G-4x10G.md5 index 036debecafca..7ff2b96da2e7 100644 --- a/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/ASK-L1-M0-D0-48x1G-4x10G.md5 +++ b/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/ASK-L1-M0-D0-48x1G-4x10G.md5 @@ -1 +1 @@ -c2fad8d9eea6eb57614af010b4c7ad17 \ No newline at end of file +a51445be255ef6afa324278ba9e191d9 \ No newline at end of file diff --git a/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/ASK-L1-M0-D0-48x1G-4x10G.xml b/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/ASK-L1-M0-D0-48x1G-4x10G.xml index abd5a2e8d03e..a254fbaa5283 100644 --- a/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/ASK-L1-M0-D0-48x1G-4x10G.xml +++ b/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/ASK-L1-M0-D0-48x1G-4x10G.xml @@ -1,5 +1,5 @@ - + diff --git a/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/ASK-L1-M0-D1-48x1G-4x10G.md5 b/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/ASK-L1-M0-D1-48x1G-4x10G.md5 index 81dcc7fb63f0..63460edb35f8 100644 --- a/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/ASK-L1-M0-D1-48x1G-4x10G.md5 +++ b/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/ASK-L1-M0-D1-48x1G-4x10G.md5 @@ -1 +1 @@ -d1884cf0a6d9728290e522a41337e86e \ No newline at end of file +afe146bae79635a1513eba92343210b6 \ No newline at end of file diff --git a/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/ASK-L1-M0-D1-48x1G-4x10G.xml b/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/ASK-L1-M0-D1-48x1G-4x10G.xml index 3dd94351a809..d9ea4a9e233b 100644 --- a/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/ASK-L1-M0-D1-48x1G-4x10G.xml +++ b/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/ASK-L1-M0-D1-48x1G-4x10G.xml @@ -1,5 +1,5 @@ - + diff --git a/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/ASK-PP-M0-48x1G-4x10G.md5 b/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/ASK-PP-M0-48x1G-4x10G.md5 index 0ecbf1e4b671..6405ae29196c 100644 --- a/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/ASK-PP-M0-48x1G-4x10G.md5 +++ b/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/ASK-PP-M0-48x1G-4x10G.md5 @@ -1 +1 @@ -8fdb417a68122b4d127e5b7c6750bd68 \ No newline at end of file +e9257245632ec82a066bef433451b17f \ No newline at end of file diff --git a/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/ASK-PP-M0-48x1G-4x10G.xml b/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/ASK-PP-M0-48x1G-4x10G.xml index 4f4670997274..4c89ace68533 100644 --- a/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/ASK-PP-M0-48x1G-4x10G.xml +++ b/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/ASK-PP-M0-48x1G-4x10G.xml @@ -1,5 +1,5 @@ - + @@ -357,28 +357,28 @@ NATIVE NATIVE - * the trunk members are filled - * according to the order given by application. - * Regular trunk may hold max of 8 members. - * Cascade trunk may hold : - * max of 64 members +* the trunk members are filled +* according to the order given by application. +* Regular trunk may hold max of 8 members. +* Cascade trunk may hold : +* max of 64 members 0 FLEX FLEX - * A mode to allows flexibility for - * each Regular trunk to state it's max number of members (before starting to add members). - * (this mode not effect 'cascade trunk' members) - * Regular trunk may hold : max of 4K members. (each trunk set it's own limit) - * Cascade trunk may hold : max of 64 members. +* A mode to allows flexibility for +* each Regular trunk to state it's max number of members (before starting to add members). +* (this mode not effect 'cascade trunk' members) +* Regular trunk may hold : max of 4K members. (each trunk set it's own limit) +* Cascade trunk may hold : max of 64 members. 2 number-physical-port-type enumeration - ac5x 128, falcon 64,128,256, 512, 1024 + AC3X/AC5X 128, falcon 64, 128, 256, 512, 1024 no-ports no-ports diff --git a/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/SAI-M0-48x1G-4x10G.md5 b/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/SAI-M0-48x1G-4x10G.md5 index 666eb19a9a04..3f32972fed77 100644 --- a/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/SAI-M0-48x1G-4x10G.md5 +++ b/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/SAI-M0-48x1G-4x10G.md5 @@ -1 +1 @@ -6a6dc37a64244b9e80f31008ea68f276 \ No newline at end of file +999d0a26c697a35601fcef34127c216d \ No newline at end of file diff --git a/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/SAI-M0-48x1G-4x10G.xml b/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/SAI-M0-48x1G-4x10G.xml index d3f85bb017d7..ca34f67ad124 100644 --- a/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/SAI-M0-48x1G-4x10G.xml +++ b/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/SAI-M0-48x1G-4x10G.xml @@ -1,13 +1,13 @@ - + device-id-type uint32 - Device ID 0..1023 + Device ID 0..1 0 - 1023 + 1 port-id-type @@ -22,7 +22,7 @@ Logging Feature Options SAI_LOG_SYSLOG - SYSLOG {Syslog service should be running to use this option} + SYSLOG {Syslog service should be running to use this option} 0 @@ -32,7 +32,7 @@ SAI_LOG_FILE - FILE {Warning !!! Use with caution. Can cause disk full issues} + FILE {Warning !!! Use with caution. Can cause disk full issues} 2 @@ -43,7 +43,92 @@ 2 30 + + acl-feature-name-type + enumeration + + + port-sFlow + SFlow over Port + 0 + + + port-counters-ipv4-ipv6 + Port ipv4/ipv6 counters + 1 + + + control-acl + ACLs for control packet handling + 2 + + + + ingress-acl-stage-type + enumeration + + + disabled + Feature not enabled + 0 + + + IPCL0 + Stage IPCL0 + 1 + + + IPCL1 + Stage IPCL1 + 2 + + + + egress-acl-stage-type + enumeration + + + disabled + Feature not enabled + 0 + + + EPCL0 + Stage EPCL0 + 2 + + + + feature-priority-type + uint32 + Feature priority + 2 + 15 + + + hit-number-type + uint32 + Hit/lookup number + 0 + 3 + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_AC3X ASK-Board-M0-48x1G-4x10G.xml false @@ -310,7 +395,7 @@ 52 - + 8 0 0 @@ -318,9 +403,7 @@ 8 8 1024 - 0 - 0 - + 4096 From 3974f69d8099f8bcccc473078513ae59d3ffa2ac Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 15 Mar 2024 19:01:21 +0800 Subject: [PATCH 196/419] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#18367) #### Why I did it src/sonic-swss ``` * dd4810b1 - (HEAD -> 202311, origin/202311) Set HOST_TX_READY_NOTIFY attribute only after query capabilities(#3070) (2 days ago) [noaOrMlnx] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index dd1432a292c1..dd4810b11406 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit dd1432a292c17b8a88e558c42101074abbe833c5 +Subproject commit dd4810b114061a14dd5254e9a7bebe7f616b5e32 From cbba534fa75f7984d6247a9fbc601486b02cb440 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 15 Mar 2024 19:01:26 +0800 Subject: [PATCH 197/419] [submodule] Update submodule sonic-platform-daemons to the latest HEAD automatically (#18355) #### Why I did it src/sonic-platform-daemons ``` * ba250d8 - (HEAD -> 202311, origin/202311) Combine psu presence/status update with data update (#424) (2 days ago) [Yuanzhe] ``` #### How I did it #### How to verify it #### Description for the changelog --- 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 83e51060a337..ba250d8a80fa 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit 83e51060a3379f1c714faf53387d92355e67d75e +Subproject commit ba250d8a80fa0a29c35a90d164f8a30117befd6e From bd8730a06be471ee4fab39d4af2ff58e69024ae4 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 15 Mar 2024 19:01:33 +0800 Subject: [PATCH 198/419] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#18332) #### Why I did it src/sonic-utilities ``` * c68f4b16 - (HEAD -> 202311, origin/202311) Skip the validation of action in acl-loader if capability table in STATE_DB is empty (#3199) (3 days ago) [bingwang-ms] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index 9d5dacab0267..c68f4b168db8 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 9d5dacab02671f35659114d44a554f5181badac1 +Subproject commit c68f4b168db8ff9c550322bc9a74c0bc8fd92b74 From dfcb9abfb0945194744811010f76fde73ff301a4 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 15 Mar 2024 19:01:39 +0800 Subject: [PATCH 199/419] [submodule] Update submodule sonic-linux-kernel to the latest HEAD automatically (#18313) #### Why I did it src/sonic-linux-kernel ``` * a037503 - (HEAD -> 202311, origin/202311) arm64: dts: marvell: Add DTS for 7215-IXS-A1 board (#379) (6 days ago) [Pavan-Nokia] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-linux-kernel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-linux-kernel b/src/sonic-linux-kernel index 342f6c39d401..a03750336cea 160000 --- a/src/sonic-linux-kernel +++ b/src/sonic-linux-kernel @@ -1 +1 @@ -Subproject commit 342f6c39d401bc0058cadcb8d0402001ad920928 +Subproject commit a03750336cea5c95cf7ce7fb923c01a9d54c8cef From b030f3efcfdd386bfb96b7caed61169a01334a48 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 16 Mar 2024 19:00:51 +0800 Subject: [PATCH 200/419] [submodule] Update submodule sonic-platform-daemons to the latest HEAD automatically (#18378) #### Why I did it src/sonic-platform-daemons ``` * 395d8d7 - (HEAD -> 202311, origin/202311) Enable periodic polling of TRANSCEIVER_FIRMWARE_INFO table in DomInfoUpdateTask (#443) (22 hours ago) [mihirpat1] ``` #### How I did it #### How to verify it #### Description for the changelog --- 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 ba250d8a80fa..395d8d7be711 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit ba250d8a80fa0a29c35a90d164f8a30117befd6e +Subproject commit 395d8d7be7111e088c1121596013883efa5973ef From a65fc61e86eb64d05a152c17af0c9b13043b6b4c Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Tue, 19 Mar 2024 10:24:57 -0700 Subject: [PATCH 201/419] Fix debug package variables for syncd (#18319) * Fix debug package variables for syncd PR #16072 renamed the debug package variables from `*_DBG` to `*_DBGSYM`, since the package names had changed. However, the references weren't updated. Since all the other debug packages (including ones that are named `*-dbgsym`) use `*_DBG`, just use that here as well. Signed-off-by: Saikrishna Arcot * Update sairedis.mk as well Signed-off-by: Saikrishna Arcot --------- Signed-off-by: Saikrishna Arcot --- platform/vs/syncd-vs.mk | 8 ++++---- rules/sairedis.mk | 28 ++++++++++++++-------------- rules/syncd.mk | 16 ++++++++-------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/platform/vs/syncd-vs.mk b/platform/vs/syncd-vs.mk index 7070240cbd25..e9edf78b2520 100644 --- a/platform/vs/syncd-vs.mk +++ b/platform/vs/syncd-vs.mk @@ -4,7 +4,7 @@ SYNCD_VS = syncd-vs_1.0.0_$(CONFIGURED_ARCH).deb $(SYNCD_VS)_RDEPENDS += $(LIBSAIREDIS) $(LIBSAIMETADATA) $(LIBSAIVS) $(eval $(call add_derived_package,$(LIBSAIREDIS),$(SYNCD_VS))) -SYNCD_VS_DBGSYM = syncd-vs-dbgsym_1.0.0_$(CONFIGURED_ARCH).deb -$(SYNCD_VS_DBGSYM)_DEPENDS += $(SYNCD_VS) -$(SYNCD_VS_DBGSYM)_RDEPENDS += $(SYNCD_VS) -$(eval $(call add_derived_package,$(LIBSAIREDIS),$(SYNCD_VS_DBGSYM))) +SYNCD_VS_DBG = syncd-vs-dbgsym_1.0.0_$(CONFIGURED_ARCH).deb +$(SYNCD_VS_DBG)_DEPENDS += $(SYNCD_VS) +$(SYNCD_VS_DBG)_RDEPENDS += $(SYNCD_VS) +$(eval $(call add_derived_package,$(LIBSAIREDIS),$(SYNCD_VS_DBG))) diff --git a/rules/sairedis.mk b/rules/sairedis.mk index 163e9b797645..1dae3b6bb8d4 100644 --- a/rules/sairedis.mk +++ b/rules/sairedis.mk @@ -29,20 +29,20 @@ LIBSAIMETADATA_DEV = libsaimetadata-dev_$(LIBSAIREDIS_VERSION)_$(CONFIGURED_ARCH $(LIBSAIMETADATA_DEV)_DEPENDS += $(LIBSAIMETADATA) $(eval $(call add_derived_package,$(LIBSAIREDIS),$(LIBSAIMETADATA_DEV))) -LIBSAIREDIS_DBGSYM = $(LIBSAIREDIS_NAME)-dbgsym_$(LIBSAIREDIS_VERSION)_$(CONFIGURED_ARCH).deb -$(LIBSAIREDIS_DBGSYM)_DEPENDS += $(LIBSAIREDIS) -$(LIBSAIREDIS_DBGSYM)_RDEPENDS += $(LIBSAIREDIS) -$(eval $(call add_derived_package,$(LIBSAIREDIS),$(LIBSAIREDIS_DBGSYM))) - -LIBSAIVS_DBGSYM = libsaivs-dbgsym_$(LIBSAIREDIS_VERSION)_$(CONFIGURED_ARCH).deb -$(LIBSAIVS_DBGSYM)_DEPENDS += $(LIBSAIVS) -$(LIBSAIVS_DBGSYM)_RDEPENDS += $(LIBSAIVS) -$(eval $(call add_derived_package,$(LIBSAIREDIS),$(LIBSAIVS_DBGSYM))) - -LIBSAIMETADATA_DBGSYM = libsaimetadata-dbgsym_$(LIBSAIREDIS_VERSION)_$(CONFIGURED_ARCH).deb -$(LIBSAIMETADATA_DBGSYM)_DEPENDS += $(LIBSAIMETADATA) -$(LIBSAIMETADATA_DBGSYM)_RDEPENDS += $(LIBSAIMETADATA) -$(eval $(call add_derived_package,$(LIBSAIREDIS),$(LIBSAIMETADATA_DBGSYM))) +LIBSAIREDIS_DBG = $(LIBSAIREDIS_NAME)-dbgsym_$(LIBSAIREDIS_VERSION)_$(CONFIGURED_ARCH).deb +$(LIBSAIREDIS_DBG)_DEPENDS += $(LIBSAIREDIS) +$(LIBSAIREDIS_DBG)_RDEPENDS += $(LIBSAIREDIS) +$(eval $(call add_derived_package,$(LIBSAIREDIS),$(LIBSAIREDIS_DBG))) + +LIBSAIVS_DBG = libsaivs-dbgsym_$(LIBSAIREDIS_VERSION)_$(CONFIGURED_ARCH).deb +$(LIBSAIVS_DBG)_DEPENDS += $(LIBSAIVS) +$(LIBSAIVS_DBG)_RDEPENDS += $(LIBSAIVS) +$(eval $(call add_derived_package,$(LIBSAIREDIS),$(LIBSAIVS_DBG))) + +LIBSAIMETADATA_DBG = libsaimetadata-dbgsym_$(LIBSAIREDIS_VERSION)_$(CONFIGURED_ARCH).deb +$(LIBSAIMETADATA_DBG)_DEPENDS += $(LIBSAIMETADATA) +$(LIBSAIMETADATA_DBG)_RDEPENDS += $(LIBSAIMETADATA) +$(eval $(call add_derived_package,$(LIBSAIREDIS),$(LIBSAIMETADATA_DBG))) ifeq ($(ENABLE_PY2_MODULES), n) $(LIBSAIREDIS)_DEB_BUILD_PROFILES += nopython2 diff --git a/rules/syncd.mk b/rules/syncd.mk index 2f5cce6cebff..cbed33fbf50f 100644 --- a/rules/syncd.mk +++ b/rules/syncd.mk @@ -21,16 +21,16 @@ $(SYNCD)_DEPENDS += $(LIBSWSSCOMMON_DEV) $(LIBTHRIFT_DEV) $(SYNCD)_DEB_BUILD_PROFILES += rpc endif -SYNCD_DBGSYM = syncd-dbgsym_1.0.0_$(CONFIGURED_ARCH).deb -$(SYNCD_DBGSYM)_DEPENDS += $(SYNCD) -$(SYNCD_DBGSYM)_RDEPENDS += $(SYNCD) -$(eval $(call add_derived_package,$(SYNCD),$(SYNCD_DBGSYM))) +SYNCD_DBG = syncd-dbgsym_1.0.0_$(CONFIGURED_ARCH).deb +$(SYNCD_DBG)_DEPENDS += $(SYNCD) +$(SYNCD_DBG)_RDEPENDS += $(SYNCD) +$(eval $(call add_derived_package,$(SYNCD),$(SYNCD_DBG))) ifeq ($(ENABLE_SYNCD_RPC),y) -SYNCD_RPC_DBGSYM = syncd-rpc-dbgsym_1.0.0_$(CONFIGURED_ARCH).deb -$(SYNCD_RPC_DBGSYM)_DEPENDS += $(SYNCD_RPC) -$(SYNCD_RPC_DBGSYM)_RDEPENDS += $(SYNCD_RPC) -$(eval $(call add_derived_package,$(SYNCD),$(SYNCD_RPC_DBGSYM))) +SYNCD_RPC_DBG = syncd-rpc-dbgsym_1.0.0_$(CONFIGURED_ARCH).deb +$(SYNCD_RPC_DBG)_DEPENDS += $(SYNCD_RPC) +$(SYNCD_RPC_DBG)_RDEPENDS += $(SYNCD_RPC) +$(eval $(call add_derived_package,$(SYNCD),$(SYNCD_RPC_DBG))) endif ifeq ($(ENABLE_PY2_MODULES), n) From 8e0ce727a136f375d775771cbfaaa89093c2c818 Mon Sep 17 00:00:00 2001 From: Andriy Yurkiv <70649192+ayurkiv-nvda@users.noreply.github.com> Date: Mon, 18 Mar 2024 23:32:24 +0200 Subject: [PATCH 202/419] [Mellanox] Support DSCP remapping in Dual-ToR topo for SN4700-O8V48, update buffers for t0 (#18293) * [Mellanox] Support DSCP remapping in Dual-ToR topo for SN4700-O8V48, update buffers for t0 Signed-off-by: Andriy Yurkiv * [Mellanox] Support DSCP remapping in Dual-ToR topo for SN4700-O8V48, update buffers for t0 (fixes after recalculation) Signed-off-by: Andriy Yurkiv --------- Signed-off-by: Andriy Yurkiv --- .../buffers_defaults_t0.j2 | 17 ++++++++++++++++- .../Mellanox-SN4700-O8V48/qos.json.j2 | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/buffers_defaults_t0.j2 index 02de15759cff..beaa88723b79 100644 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/buffers_defaults_t0.j2 +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/buffers_defaults_t0.j2 @@ -1,5 +1,5 @@ {# - Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. + Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. Apache-2.0 Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,10 +14,17 @@ limitations under the License. #} {% set default_cable = '5m' %} +{%- if ((SYSTEM_DEFAULTS is defined) and ('tunnel_qos_remap' in SYSTEM_DEFAULTS) and (SYSTEM_DEFAULTS['tunnel_qos_remap']['status'] == 'enabled')) -%} +{% set ingress_lossless_pool_size = '48168960' %} +{% set ingress_lossless_pool_xoff = '5218304' %} +{% set egress_lossless_pool_size = '60817392' %} +{% set egress_lossy_pool_size = '48168960' %} +{%- else -%} {% set ingress_lossless_pool_size = '49946624' %} {% set ingress_lossless_pool_xoff = '4063232' %} {% set egress_lossless_pool_size = '60817392' %} {% set egress_lossy_pool_size = '49946624' %} +{%- endif -%} {% import 'buffers_defaults_objects.j2' as defs with context %} @@ -29,10 +36,18 @@ {{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} {%- endmacro %} +{%- macro generate_queue_buffers_with_extra_lossless_queues_with_inactive_ports(port_names_active, port_names_extra_queues, port_names_inactive) %} +{{ defs.generate_queue_buffers_with_extra_lossless_queues(port_names_active, port_names_extra_queues, port_names_inactive) }} +{%- endmacro %} + {%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} {{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} {%- endmacro %} +{%- macro generate_pg_profiles_with_extra_lossless_pgs_with_inactive_ports(port_names_active, port_names_extra_pgs, port_names_inactive) %} +{{ defs.generate_pg_profiles_with_extra_lossless_pgs(port_names_active, port_names_extra_pgs, port_names_inactive) }} +{%- endmacro %} + {%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} {{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} {%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/qos.json.j2 b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/qos.json.j2 index eccf286dc879..48221aa2b3de 120000 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/qos.json.j2 +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/qos.json.j2 @@ -1 +1 @@ -../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/qos.json.j2 \ No newline at end of file +../../x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/qos.json.j2 \ No newline at end of file From ac35a0fafb90e78ac664ff328e5471f14d1ed355 Mon Sep 17 00:00:00 2001 From: dbarashinvd <105214075+dbarashinvd@users.noreply.github.com> Date: Wed, 20 Mar 2024 22:15:50 +0200 Subject: [PATCH 203/419] add unit tests for CMIS host management feature (#18211) * add unit tests for CMIS host management feature --- .../tests/test_modules_mgmt.py | 800 ++++++++++++++++++ 1 file changed, 800 insertions(+) create mode 100644 platform/mellanox/mlnx-platform-api/tests/test_modules_mgmt.py diff --git a/platform/mellanox/mlnx-platform-api/tests/test_modules_mgmt.py b/platform/mellanox/mlnx-platform-api/tests/test_modules_mgmt.py new file mode 100644 index 000000000000..d0cab978cf2f --- /dev/null +++ b/platform/mellanox/mlnx-platform-api/tests/test_modules_mgmt.py @@ -0,0 +1,800 @@ +# +# Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. +# Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +import os +import queue +import sys +import threading +import time +import types +import unittest + +from mock import MagicMock, patch, mock_open, Mock +if sys.version_info.major == 3: + from unittest import mock +else: + import mock + +test_path = os.path.dirname(os.path.abspath(__file__)) +modules_path = os.path.dirname(test_path) +sys.path.insert(0, modules_path) + +from sonic_platform.device_data import DeviceDataManager +from sonic_py_common import device_info +from sonic_platform import modules_mgmt +from sonic_platform.modules_mgmt import ModulesMgmtTask +from sonic_platform_base.sonic_xcvr.api.public.cmis import CmisApi +from sonic_platform_base.sonic_xcvr.xcvr_eeprom import XcvrEeprom +from sonic_platform_base.sonic_xcvr.codes.public.cmis import CmisCodes +from sonic_platform_base.sonic_xcvr.mem_maps.public.cmis import CmisMemMap +from sonic_platform_base.sonic_xcvr.fields import consts + +DEFAULT_NUM_OF_PORTS_1 = 1 +DEFAULT_NUM_OF_PORTS_3 = 3 +DEFAULT_NUM_OF_PORTS_32 = 32 +POLLER_EXECUTED = False + +def _mock_sysfs_default_file_content(): + return { + modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("0"): "1", + modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("1"): "1", + modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("2"): "1", + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("0"): "1", + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("1"): "1", + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("2"): "1", + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("0"): "1", + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("1"): "1", + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("2"): "1", + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("0"): "48", + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("1"): "48", + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("2"): "48", + modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("0"): "0", + modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("1"): "0", + modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("2"): "0", + modules_mgmt.SYSFS_INDEPENDENT_FD_HW_RESET: "", + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT: "48", + modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("0"): "1", + modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL.format("0"): "1", + modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL.format("1"): "1", + modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL.format("2"): "1", + modules_mgmt.SYSFS_LEGACY_FD_PRESENCE: "1", + modules_mgmt.PROC_CMDLINE: "" + } + + +mock_file_content = _mock_sysfs_default_file_content() + + +class MockPoller: + + def __init__(self, modules_mgmt_task_stopping_event, modules_mgmt_thrd=None, num_of_ports=3, port_plug_out=False + , feature_enabled=True, warm_reboot=False, port_plug_in=False, sleep_timeout=False): + self.fds_dict = {} + self.poller_iteration_count = 0 + self.modules_mgmt_task_stopping_event = modules_mgmt_task_stopping_event + self.modules_mgmt_thrd = modules_mgmt_thrd + self.num_of_ports = num_of_ports + self.port_plug_out = port_plug_out + self.port_plug_in = port_plug_in + self.feature_enabled = feature_enabled + self.warm_reboot = warm_reboot + self.port_plug_out_changed = False + self.port_plug_in_changed = False + self.sleep_timeout = sleep_timeout + + def register(self, fd, attrs): + self.fds_dict[fd.fileno()] = { fd : attrs } + assert fd.fileno() in self.fds_dict + + def unregister(self, fd): + if fd.fileno() in self.fds_dict.keys(): + del self.fds_dict[fd.fileno()] + assert fd.fileno() not in self.fds_dict.keys() + + def poll(self, timeout=1000): + global POLLER_EXECUTED + assert len(self.modules_mgmt_thrd.sfp_port_dict_initial) == self.num_of_ports + assert self.modules_mgmt_thrd.is_supported_indep_mods_system == self.feature_enabled + # counting the number of poller iterations to know when to do the checks after plug out (and plug in) + # have to check at least on iteration 7 to let ports reach final state + self.poller_iteration_count += 1 + if self.num_of_ports > 0: + if not self.port_plug_out_changed: + if self.port_plug_out: + # return first fd registered with some made up event number 870 + fd_no_to_return = list(self.fds_dict.keys())[0] + fd = list(self.fds_dict[fd_no_to_return].keys())[0] + fd.set_file_int_content(0) + event_to_return = 870 + self.port_plug_out_changed = True + return [(fd_no_to_return, event_to_return)] + if not self.port_plug_in_changed: + if self.port_plug_in: + # return first fd registered with some made up event number 871 + fd_no_to_return = list(self.fds_dict.keys())[0] + fd = list(self.fds_dict[fd_no_to_return].keys())[0] + fd.set_file_int_content(1) + event_to_return = 871 + self.port_plug_in_changed = True + return [(fd_no_to_return, event_to_return)] + if 7 == self.poller_iteration_count: + # when feature is enabled, need to check for each port both power_good and hw_present sysfs for + # cmis non-flat memory cables + num_of_sysfs_to_check = self.num_of_ports if (not self.port_plug_out or not self.feature_enabled + or self.warm_reboot) else self.num_of_ports * 2 + for i in range(num_of_sysfs_to_check): + # when feature is enabled, power_good sysfs is also registered for cmis non-flat memory cables + # so each SW controlled port has 2 fds registered + port_to_test = i if not self.feature_enabled else int(i / 2) + assert self.modules_mgmt_thrd.sfp_port_dict_initial[port_to_test].port_num == port_to_test + assert self.modules_mgmt_thrd.sfp_port_dict_initial[ + port_to_test].initial_state == modules_mgmt.STATE_HW_NOT_PRESENT + if self.feature_enabled: + module_obj = self.modules_mgmt_thrd.fds_mapping_to_obj[list(self.fds_dict.keys())[i]][ + 'module_obj'] + assert module_obj.port_num == port_to_test + if not self.warm_reboot: + # in tests other than warm reboot it creates only SW control ports + if not self.port_plug_out: + assert module_obj.final_state == modules_mgmt.STATE_SW_CONTROL + else: + assert module_obj.final_state == modules_mgmt.STATE_HW_NOT_PRESENT + else: + if not self.port_plug_out: + assert module_obj.final_state == modules_mgmt.STATE_HW_PRESENT + # in warm reboot test with plug out plug in test creates only FW control ports + elif self.port_plug_out and self.port_plug_in: + assert module_obj.final_state == modules_mgmt.STATE_FW_CONTROL + else: + assert module_obj.final_state == modules_mgmt.STATE_HW_NOT_PRESENT + POLLER_EXECUTED = True + self.modules_mgmt_task_stopping_event.set() + if self.sleep_timeout: + time.sleep(timeout/1000) + return [] + + +class MockOpen: + + def __init__(self, name='', file_no=None, indep_mode_supported=True): + self.name = name + self.file_no = file_no + self.indep_mode_supported = indep_mode_supported + self.retint = None + self.curr = 0 + + def read(self): + if self.fileno() in [SAI_PROFILE_FD_FILENO]: + pass + else: + # if return value was changed, i.e. sysfs content changed from 1 to 0 to simulate plug out + if self.retint is not None: + return str(self.retint) + # return default values (can be changed per test) + else: + return mock_file_content[self.name] + + def readline(self): + # if trying to read sai profile file, according to fd fileno + if self.fileno() in [SAI_PROFILE_FD_FILENO]: + if self.indep_mode_supported: + return "SAI_INDEPENDENT_MODULE_MODE=1" + else: + return "" + else: + return mock_file_content[self.name] + + def fileno(self): + return self.file_no + + def seek(self, seek_val): + self.curr = seek_val + + def close(self): + pass + + def write(self, write_val): + self.set_file_int_content(write_val) + + def set_file_int_content(self, retint): + self.retint = str(retint) + mock_file_content[self.name] = str(retint) + + def __enter__(self): + return self + + def __exit__(self, filename, *args, **kwargs): + pass + +class MockPollerStopEvent: + + def __init__(self, modules_mgmt_task_stopping_event, modules_mgmt_thrd=None, num_of_ports=DEFAULT_NUM_OF_PORTS_3 + , feature_enabled=True, ports_connected=True, fw_controlled_ports=False, sleep_timeout=False): + self.fds_dict = {} + self.modules_mgmt_task_stopping_event = modules_mgmt_task_stopping_event + self.modules_mgmt_thrd = modules_mgmt_thrd + self.num_of_ports = num_of_ports + self.feature_enabled = feature_enabled + self.ports_connected = ports_connected + self.sleep_timeout = sleep_timeout + self.fw_controlled_ports = fw_controlled_ports + + def register(self, fd, attrs): + self.fds_dict[fd.fileno()] = 1 & attrs + assert fd.fileno() in self.fds_dict + + def poll(self, timeout=0): + assert len(self.modules_mgmt_thrd.sfp_port_dict_initial) == self.num_of_ports + assert self.modules_mgmt_thrd.is_supported_indep_mods_system == self.feature_enabled + global POLLER_EXECUTED + if self.num_of_ports > 0: + # when feature is enabled, need to check for each port both power_good and hw_present sysfs for + # cmis non-flat memory cables + ports_to_test = self.num_of_ports if (not self.feature_enabled or not self.ports_connected + or self.fw_controlled_ports) else self.num_of_ports * 2 + for i in range(ports_to_test): + # when feature is enabled, power_good sysfs is also registered for cmis non-flat memory cables + port_to_test = i if (not self.feature_enabled or not self.ports_connected + or self.fw_controlled_ports) else int(i / 2) + assert self.modules_mgmt_thrd.sfp_port_dict_initial[port_to_test].port_num == port_to_test + assert self.modules_mgmt_thrd.sfp_port_dict_initial[port_to_test].initial_state == modules_mgmt.STATE_HW_NOT_PRESENT + module_obj = self.modules_mgmt_thrd.fds_mapping_to_obj[list(self.fds_dict.keys())[i]]['module_obj'] + assert module_obj.port_num == port_to_test + if self.ports_connected: + if self.feature_enabled: + if self.fw_controlled_ports: + assert module_obj.final_state == modules_mgmt.STATE_FW_CONTROL + else: + assert module_obj.final_state == modules_mgmt.STATE_SW_CONTROL + else: + assert module_obj.final_state == modules_mgmt.STATE_HW_PRESENT + else: + assert module_obj.final_state == modules_mgmt.STATE_HW_NOT_PRESENT + POLLER_EXECUTED = True + else: + POLLER_EXECUTED = True + self.modules_mgmt_task_stopping_event.set() + if self.sleep_timeout: + time.sleep(timeout/1000) + return [] + + +def _mock_is_file_indep_mode_disabled_content(): + return { + modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE: True, + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD: True, + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON: True, + modules_mgmt.SYSFS_INDEPENDENT_FD_HW_RESET: True, + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT: True, + modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL: True, + modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("0"): True, + modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("1"): True, + modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("2"): True, + '//usr/share/sonic/platform/ACS-MSN4700/sai.profile' : True + } + +mock_is_file_indep_mode_disabled_content = _mock_is_file_indep_mode_disabled_content() + +def mock_is_file_indep_mode_disabled(file_path, **kwargs): + return mock_is_file_indep_mode_disabled_content[file_path] + +def _mock_is_file_indep_mode_enabled_content(): + return { + modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE: True, + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD: True, + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON: True, + modules_mgmt.SYSFS_INDEPENDENT_FD_HW_RESET: True, + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT: True, + modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL: True, + modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("0"): True, + modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("0"): True, + modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("1"): True, + modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("2"): True, + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("0"): True, + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("1"): True, + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("2"): True, + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("0"): True, + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("1"): True, + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("2"): True, + '//usr/share/sonic/platform/ACS-MSN4700/sai.profile' : True + } + +mock_is_file_indep_mode_enabled_content = _mock_is_file_indep_mode_enabled_content() + + +def mock_is_file_indep_mode_enabled(file_path, **kwargs): + return mock_is_file_indep_mode_enabled_content[file_path] + + +def mock_read_int_from_file(filename, *args): + return_dict = { + modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("0") : 1, + modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("1") : 1, + modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("2") : 1 + } + + return return_dict[filename] + + +class MockXcvrEeprom(): + def __init__(self, is_flat_memory, mem_map): + self.is_flat_memory = is_flat_memory + self.mem_map = mem_map + + def is_cmis_api(self): + return self.is_cmis_api + + def is_flat_memory(self): + return self.is_flat_memory + + def read(self, field): + if consts.FLAT_MEM_FIELD == field: + return 0 if self.is_flat_memory else 1 + else: + return 0 + + +class MockXcvrapi: + def __init__(self, is_cmis_api=True, is_flat_memory_bool=False): + self.is_cmis_api = is_cmis_api + self.is_flat_memory_bool = is_flat_memory_bool + self.xcvr_eeprom = MagicMock(autospec=XcvrEeprom, return_value=MockXcvrEeprom(is_flat_memory_bool, CmisMemMap(CmisCodes))) + + def is_flat_memory(self): + return self.is_flat_memory_bool + + def xcvr_eeprom(self): + return self.xcvr_eeprom + + +class MockSFPxcvrapi: + def __init__(self, xcvr_api_is_cmis_api=True, xcvr_eeprom_is_flat_memory=False): + self.xcvr_api = Mock(spec=CmisApi(MockXcvrEeprom(False, CmisMemMap(CmisCodes))), return_value=MockXcvrapi(xcvr_api_is_cmis_api, xcvr_eeprom_is_flat_memory)) + self.xcvr_api_is_cmis_api = xcvr_api_is_cmis_api + self.xcvr_eeprom_is_flat_memory = xcvr_eeprom_is_flat_memory + self.xcvr_api.is_flat_memory = types.MethodType(self.is_flat_memory, self) + + def get_xcvr_api(self): + return self.xcvr_api + + def is_flat_memory(self, ref): + return self.xcvr_eeprom_is_flat_memory + + +def check_power_cap(port, module_sm_obj): + pass + +SAI_PROFILE_FD_FILENO = 99 + + +class TestModulesMgmt(unittest.TestCase): + """Test class to test modules_mgmt.py. The test cases covers: + 1. cables detection for 1 to 3 ports - feature disabled / enabled / poller + 2. cable disconnection - plug out + 3. cable reconnection - plug in + 4. warm reboot normal flow with FW ports + 5. warm reboot flow with FW ports plugged out + 6. warm reboot flow with FW ports plugged out and then plugged in (stays FW controlled, no SFP mock change) + 7. test 32 FW controlled (non cmis flat mem) cables powered off + 8. test 32 SW controlled (cmis active non flat mem) cables powered off + """ + + def _mock_sysfs_file_content(self): + return { + modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE : "1", + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD : "1", + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON : "0", + modules_mgmt.SYSFS_INDEPENDENT_FD_HW_RESET : "", + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT : "48", + modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL : "1", + modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("0") : "1", + modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("1") : "1", + modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("2") : "1", + modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("0"): "0" + } + + def mock_open_builtin(self, file_name, feature_enabled=True): + return_dict = { + (modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("0"), 'r') : MockOpen(modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("0"), 100), + (modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("1"), 'r') : MockOpen(modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("1"), 101), + (modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("2"), 'r') : MockOpen(modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("2"), 102), + '//usr/share/sonic/platform/ACS-MSN4700/sai.profile' : MockOpen('//usr/share/sonic/platform/ACS-MSN4700/sai.profile' + , SAI_PROFILE_FD_FILENO, feature_enabled), + modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("0") : MockOpen(modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("0"), 100), + modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("1") : MockOpen(modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("1"), 101), + modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("2") : MockOpen(modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("2"), 102), + modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("0"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("0"), 0), + modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("1"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("1"), 1), + modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("2"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("2"), 2), + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("0"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("0"), 200), + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("1"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("1"), 201), + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("2"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("2"), 202), + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("0"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("0"), 300), + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("1"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("1"), 301), + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("2"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("2"), 302), + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("0"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("0"), 500), + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("1"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("1"), 501), + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("2"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("2"), 502), + modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("0"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("0"), 602), + modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("1"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("1"), 602), + modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("2"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("2"), 602), + modules_mgmt.PROC_CMDLINE: MockOpen(modules_mgmt.PROC_CMDLINE, self.fd_number_by_fd_name_dict[modules_mgmt.PROC_CMDLINE]) + } + return return_dict[file_name] + + # side effects are used in mock when want to create different mocks per variable, i.e. here it's filename + # see below mock_open_new_side_effect_poller_test where returning a new MockOpen passing it the filename + def mock_open_new_side_effect_feature_disabled(self, filename, *args, **kwargs): + mock_context = MagicMock() + mock_context.__enter__.return_value = self.mock_open_builtin(filename, False) + mock_context.__exit__.return_value = False + return mock_context + + def mock_open_new_side_effect_feature_enabled(self, filename, *args, **kwargs): + mock_context = MagicMock() + mock_context.__enter__.return_value = self.mock_open_builtin(filename) + mock_context.__exit__.return_value = False + return mock_context + + def mock_open_new_side_effect_poller_test(self, filename, *args, **kwargs): + if filename in ['//usr/share/sonic/platform/ACS-MSN4700/sai.profile']: + mock_context = MagicMock() + mock_context.__enter__.return_value = MockOpen(filename, SAI_PROFILE_FD_FILENO) + mock_context.__exit__.return_value = False + return mock_context + else: + mock_context = MagicMock() + mock_open_new = MockOpen(filename, self.fd_number_by_fd_name_dict[filename]) + mock_context.return_value = mock_open_new + mock_context.__enter__.return_value = mock_open_new + mock_context.__exit__.return_value = False + if 'hw_present' in filename or 'power_on' in filename or 'freq' in filename or 'control' in filename: + return mock_context + else: + return mock_context.return_value + + def mock_open_new_side_effect_warm_reboot(self, filename, *args, **kwargs): + if filename in ['//usr/share/sonic/platform/ACS-MSN4700/sai.profile']: + mock_context = MagicMock() + mock_context.__enter__.return_value = MockOpen(filename, SAI_PROFILE_FD_FILENO) + mock_context.__exit__.return_value = False + return mock_context + else: + mock_open_new = MockOpen(filename, self.fd_number_by_fd_name_dict[filename]) + return mock_open_new + + def setUp(cls): + cls.modules_mgmt_task_stopping_event = threading.Event() + cls.modules_changes_queue = queue.Queue() + global POLLER_EXECUTED + POLLER_EXECUTED = False + # start modules_mgmt thread and the test in poller part + cls.modules_mgmt_thrd = ModulesMgmtTask(main_thread_stop_event=cls.modules_mgmt_task_stopping_event, + q=cls.modules_changes_queue) + cls.modules_mgmt_thrd.check_power_cap = check_power_cap + assert cls.modules_mgmt_thrd.sfp_port_dict_initial == {} + + @classmethod + def setup_class(cls): + os.environ["MLNX_PLATFORM_API_UNIT_TESTING"] = "1" + cls.fd_number_by_fd_name_dict = { + modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("0") : 100, + modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("1") : 101, + modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("2") : 102, + '//usr/share/sonic/platform/ACS-MSN4700/sai.profile' : SAI_PROFILE_FD_FILENO, + modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("0") : 0, + modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("1") : 1, + modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("2") : 2, + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("0") : 200, + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("1") : 201, + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("2") : 202, + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("0") : 300, + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("1") : 301, + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("2") : 302, + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("0") : 500, + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("1") : 501, + modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("2") : 502, + modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("0") : 600, + modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("1") : 601, + modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("2") : 602, + modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL.format("0") : 700, + modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL.format("1") : 701, + modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL.format("2") : 702, + modules_mgmt.PROC_CMDLINE : 800 + } + # mock the directory holding relevant sai.profile + device_info.get_paths_to_platform_and_hwsku_dirs = mock.MagicMock(return_value=('', '/usr/share/sonic/platform/ACS-MSN4700')) + + + @patch('sonic_platform.device_data.DeviceDataManager.get_sfp_count', MagicMock(return_value=DEFAULT_NUM_OF_PORTS_3)) + @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_disabled)) + @patch('sonic_platform.utils.read_int_from_file', MagicMock(side_effect=mock_read_int_from_file)) + @patch('builtins.open', spec=open) + def test_mdf_all_ports_feature_disabled(self, mock_open): + mock_open.side_effect = self.mock_open_new_side_effect_feature_disabled + num_of_tested_ports = DeviceDataManager.get_sfp_count() + assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_3 + + # start modules_mgmt thread and the test in poller part + with patch('select.poll', MagicMock(return_value=MockPollerStopEvent(self.modules_mgmt_task_stopping_event + , self.modules_mgmt_thrd, feature_enabled=False))): + self.modules_mgmt_thrd.run() + + @patch('sonic_platform.device_data.DeviceDataManager.get_sfp_count', MagicMock(return_value=DEFAULT_NUM_OF_PORTS_3)) + @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) + @patch('builtins.open', spec=open) + @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi())) + def test_mdf_all_ports_feature_enabled(self, mock_open): + mock_open.side_effect = self.mock_open_new_side_effect_feature_enabled + num_of_tested_ports = DeviceDataManager.get_sfp_count() + assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_3 + + # start modules_mgmt thread and the test in poller part + with patch('select.poll', MagicMock(return_value=MockPollerStopEvent(self.modules_mgmt_task_stopping_event + , self.modules_mgmt_thrd))): + self.modules_mgmt_thrd.run() + + @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) + @patch('builtins.open', spec=open) + @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi())) + def test_modules_mgmt_poller_events_3_ports(self, mock_open): + mock_open.side_effect = self.mock_open_new_side_effect_poller_test + DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=DEFAULT_NUM_OF_PORTS_3) + num_of_tested_ports = DeviceDataManager.get_sfp_count() + assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_3 + + # start modules_mgmt thread and the test in poller part + with patch('select.poll', MagicMock(return_value=MockPollerStopEvent(self.modules_mgmt_task_stopping_event + , self.modules_mgmt_thrd))): + self.modules_mgmt_thrd.run() + + @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) + @patch('builtins.open', spec=open) + @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi())) + def test_modules_mgmt_poller_events_single_port(self, mock_open): + mock_open.side_effect = self.mock_open_new_side_effect_poller_test + DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=DEFAULT_NUM_OF_PORTS_1) + num_of_tested_ports = DeviceDataManager.get_sfp_count() + assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_1 + + # start modules_mgmt thread and the test in poller part + with patch('select.poll', MagicMock(return_value=MockPollerStopEvent(self.modules_mgmt_task_stopping_event + , self.modules_mgmt_thrd, num_of_tested_ports))): + #with patch('builtins.open', MagicMock(side_effect=self.mock_open_new_side_effect_poller_test)): + self.modules_mgmt_thrd.run() + + @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) + @patch('builtins.open', spec=open) + @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi(False, True))) + def test_modules_mgmt_normal_warm_reboot(self, mock_open): + mock_open.side_effect = self.mock_open_new_side_effect_warm_reboot + # mock /proc/cmdline with warm reboot boot type key value + mock_file_content[modules_mgmt.PROC_CMDLINE] = f'{modules_mgmt.CMDLINE_STR_TO_LOOK_FOR}{modules_mgmt.CMDLINE_VAL_TO_LOOK_FOR}' + DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=DEFAULT_NUM_OF_PORTS_1) + num_of_tested_ports = DeviceDataManager.get_sfp_count() + assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_1 + # set the port to start with FW controlled before warm reboot takes place + mock_file_content[modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL.format("0")] = "0" + + # start modules_mgmt thread and the test in poller part + with patch('select.poll', MagicMock(return_value=MockPoller(self.modules_mgmt_task_stopping_event + , self.modules_mgmt_thrd, num_of_tested_ports, warm_reboot=True))): + self.modules_mgmt_thrd.run() + + @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) + @patch('builtins.open', spec=open) + @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi(False, True))) + def test_modules_mgmt_plug_out_fw_cable_after_warm_reboot(self, mock_open): + mock_open.side_effect = self.mock_open_new_side_effect_warm_reboot + # mock /proc/cmdline with warm reboot boot type key value + mock_file_content[modules_mgmt.PROC_CMDLINE] = f'{modules_mgmt.CMDLINE_STR_TO_LOOK_FOR}{modules_mgmt.CMDLINE_VAL_TO_LOOK_FOR}' + DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=DEFAULT_NUM_OF_PORTS_1) + num_of_tested_ports = DeviceDataManager.get_sfp_count() + assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_1 + + # set the port to start with FW controlled before warm reboot takes place + mock_file_content[modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL.format("0")] = "0" + + # start modules_mgmt thread and the test in poller part + with patch('select.poll', MagicMock(return_value=MockPoller(self.modules_mgmt_task_stopping_event + , self.modules_mgmt_thrd, num_of_tested_ports, port_plug_out=True, warm_reboot=True))): + self.modules_mgmt_thrd.run() + + @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) + @patch('builtins.open', spec=open) + @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi(False, True))) + def test_modules_mgmt_plug_out_plug_in_fw_cable_after_warm_reboot(self, mock_open): + mock_open.side_effect = self.mock_open_new_side_effect_warm_reboot + # mock /proc/cmdline with warm reboot boot type key value + mock_file_content[modules_mgmt.PROC_CMDLINE] = f'{modules_mgmt.CMDLINE_STR_TO_LOOK_FOR}{modules_mgmt.CMDLINE_VAL_TO_LOOK_FOR}' + DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=DEFAULT_NUM_OF_PORTS_1) + num_of_tested_ports = DeviceDataManager.get_sfp_count() + assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_1 + + mock_file_content[modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL.format("0")] = "0" + + # start modules_mgmt thread and the test in poller part + with patch('select.poll', MagicMock(return_value=MockPoller(self.modules_mgmt_task_stopping_event + , self.modules_mgmt_thrd, num_of_tested_ports, port_plug_out=True, warm_reboot=True, port_plug_in=True))): + self.modules_mgmt_thrd.run() + + @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) + @patch('builtins.open', spec=open) + @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi(False, True))) + def test_modules_mgmt_no_ports(self, mock_open): + mock_open.side_effect = self.mock_open_new_side_effect_poller_test + DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=0) + num_of_tested_ports = DeviceDataManager.get_sfp_count() + assert num_of_tested_ports == 0 + + # start modules_mgmt thread and the test in poller part + with patch('select.poll', MagicMock(return_value=MockPollerStopEvent(self.modules_mgmt_task_stopping_event + , self.modules_mgmt_thrd, num_of_tested_ports))): + self.modules_mgmt_thrd.run() + + @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) + @patch('builtins.open', spec=open) + @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi(False, True))) + def test_modules_mgmt_ports_disconnected(self, mock_open): + mock_open.side_effect = self.mock_open_new_side_effect_poller_test + DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=DEFAULT_NUM_OF_PORTS_3) + num_of_tested_ports = DeviceDataManager.get_sfp_count() + assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_3 + + # update hw_present sysfs with value of 0 for each port + for i in range(num_of_tested_ports): + modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format(f"{i}") + mock_file_content[modules_sysfs] = "0" + + # start modules_mgmt thread and the test in poller part + with patch('select.poll', MagicMock(return_value=MockPollerStopEvent(self.modules_mgmt_task_stopping_event + , self.modules_mgmt_thrd, num_of_tested_ports, ports_connected=False))): + self.modules_mgmt_thrd.run() + + @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) + @patch('builtins.open', spec=open) + @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi(False, True))) + def test_modules_mgmt_bad_flows_port_disconnected(self, mock_open): + mock_open.side_effect = self.mock_open_new_side_effect_poller_test + DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=DEFAULT_NUM_OF_PORTS_1) + num_of_tested_ports = DeviceDataManager.get_sfp_count() + assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_1 + + # update hw_present sysfs with value of 0 for each port + for i in range(num_of_tested_ports): + modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format(f"{i}") + mock_file_content[modules_sysfs] = "0" + + # start modules_mgmt thread and the test in poller part + with patch('select.poll', MagicMock(return_value=MockPollerStopEvent(self.modules_mgmt_task_stopping_event + , self.modules_mgmt_thrd, num_of_tested_ports, ports_connected=False))): + self.modules_mgmt_thrd.run() + + @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) + @patch('builtins.open', spec=open) + @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi(False, True))) + def test_modules_mgmt_bad_flows_power_good(self, mock_open): + mock_open.side_effect = self.mock_open_new_side_effect_poller_test + DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=DEFAULT_NUM_OF_PORTS_1) + num_of_tested_ports = DeviceDataManager.get_sfp_count() + assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_1 + + # update power_good sysfs with value of 0 for each port + for i in range(num_of_tested_ports): + modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format(f"{i}") + mock_file_content[modules_sysfs] = "0" + + # start modules_mgmt thread and the test in poller part + with patch('select.poll', MagicMock(return_value=MockPollerStopEvent(self.modules_mgmt_task_stopping_event + , self.modules_mgmt_thrd, num_of_tested_ports, ports_connected=False))): + self.modules_mgmt_thrd.run() + for i in range(num_of_tested_ports): + modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format(f"{i}") + mock_file_content[modules_sysfs] = "1" + + @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) + @patch('builtins.open', spec=open) + @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi(False, True))) + def test_modules_mgmt_bad_flows_ports_powered_off_fw_controlled(self, mock_open): + mock_open.side_effect = self.mock_open_new_side_effect_poller_test + DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=DEFAULT_NUM_OF_PORTS_32) + num_of_tested_ports = DeviceDataManager.get_sfp_count() + assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_32 + + # create or update different sysfs and is_file mocking with relevant value for each port + for i in range(num_of_tested_ports): + # mock power_on sysfs for all ports + modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format(f"{i}") + mock_file_content[modules_sysfs] = "0" + mock_is_file_indep_mode_enabled_content[modules_sysfs] = True + self.fd_number_by_fd_name_dict[modules_sysfs] = 300 + i + # mock hw_presence sysfs for all ports + modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format(f'{i}') + mock_file_content[modules_sysfs] = "1" + mock_is_file_indep_mode_enabled_content[modules_sysfs] = True + self.fd_number_by_fd_name_dict[modules_sysfs] = i + # mock power_good sysfs for all ports + modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format(f'{i}') + mock_file_content[modules_sysfs] = "1" + mock_is_file_indep_mode_enabled_content[modules_sysfs] = True + self.fd_number_by_fd_name_dict[modules_sysfs] = 200 + i + # mock hw_reset sysfs for all ports + modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_HW_RESET.format(f'{i}') + mock_is_file_indep_mode_enabled_content[modules_sysfs] = True + self.fd_number_by_fd_name_dict[modules_sysfs] = 400 + i + + # start modules_mgmt thread and the test in poller part + with patch('select.poll', MagicMock(return_value=MockPollerStopEvent(self.modules_mgmt_task_stopping_event + , self.modules_mgmt_thrd, num_of_tested_ports, fw_controlled_ports=True))): + self.modules_mgmt_thrd.run() + + # change power_on sysfs values back to the default ones + for i in range(num_of_tested_ports): + modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format(f"{i}") + mock_file_content[modules_sysfs] = "1" + + @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) + @patch('builtins.open', spec=open) + @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi())) + def test_modules_mgmt_bad_flows_ports_powered_off_sw_controlled(self, mock_open): + mock_open.side_effect = self.mock_open_new_side_effect_poller_test + DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=DEFAULT_NUM_OF_PORTS_32) + num_of_tested_ports = DeviceDataManager.get_sfp_count() + assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_32 + + # create or update different sysfs and is_file mocking with relevant value for each port + for i in range(num_of_tested_ports): + # mock power_on sysfs for all ports + modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format(f"{i}") + mock_file_content[modules_sysfs] = "0" + mock_is_file_indep_mode_enabled_content[modules_sysfs] = True + self.fd_number_by_fd_name_dict[modules_sysfs] = 300 + i + # mock hw_presence sysfs for all ports + modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format(f'{i}') + mock_file_content[modules_sysfs] = "1" + mock_is_file_indep_mode_enabled_content[modules_sysfs] = True + self.fd_number_by_fd_name_dict[modules_sysfs] = i + # mock power_good sysfs for all ports + modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format(f'{i}') + mock_file_content[modules_sysfs] = "1" + mock_is_file_indep_mode_enabled_content[modules_sysfs] = True + self.fd_number_by_fd_name_dict[modules_sysfs] = 200 + i + # mock hw_reset sysfs for all ports + modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_HW_RESET.format(f'{i}') + mock_is_file_indep_mode_enabled_content[modules_sysfs] = True + self.fd_number_by_fd_name_dict[modules_sysfs] = 400 + i + # mock frequency_support sysfs for all ports + modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format(f'{i}') + mock_file_content[modules_sysfs] = "0" + mock_is_file_indep_mode_enabled_content[modules_sysfs] = True + self.fd_number_by_fd_name_dict[modules_sysfs] = 600 + i + + # start modules_mgmt thread and the test in poller part + with patch('select.poll', MagicMock(return_value=MockPollerStopEvent(self.modules_mgmt_task_stopping_event + , self.modules_mgmt_thrd, num_of_tested_ports))): + self.modules_mgmt_thrd.run() + + # change power_on sysfs values back to the default ones + for i in range(num_of_tested_ports): + modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format(f"{i}") + mock_file_content[modules_sysfs] = "1" + + def tearDown(cls): + mock_file_content[modules_mgmt.PROC_CMDLINE] = '' + cls.modules_mgmt_thrd = None + # a check that modules mgmt thread ran and got into the poller part where the tests here has all checks + assert POLLER_EXECUTED From 34c95327f5ef535636f21f32aaa54f7f43d317ea Mon Sep 17 00:00:00 2001 From: Tomer Shalvi <116184476+tshalvi@users.noreply.github.com> Date: Thu, 29 Feb 2024 16:07:10 +0200 Subject: [PATCH 204/419] [Mellanox] Adding a new field to CONFIG DB: "subport" (#18204) - Why I did it The field 'subport' represents the index of the split port within a physical port. For example, if a port is split into 4, the subport of the first logical port is 1, the subport of the second logical port is 2, and so on. In xcvrd, the CMIS manager uses the subport to calculate the lane mask, which is used to control the data path per lane. In Nvidia platform, the subport is missing and is always set to 0. According to the xcvrd code, when subport=0, it will always correspond to the first logical port. Therefore, if we shut down any logical port that is not the first one, we will see the operational status of the first logical port also becomes down. This PR aims to add the subport field to CONFIG DB and prevent such scenarios. This is applicable only for static default breakout mode. For DPB, subport calculation will happen on the fly (changes are not in Sonic yet). (Subport HLD: HLD of subport: [link to the HLD document]) - How I did it I have added the 'subport' field to all relevant Nvidia hwsku.json files (minigraph generation is based on them). Additionally, I introduced the new 'subport' field to portconfig.py, so that sonic-cfggen will be able to generate the minigraph with it. In this file, I also fixed an error that caused all attributes from hwsku.json to be applied only to the first logical ports associated with a physical port. Furthermore, I updated hwsku_json_checker to include the new field and applied a fix to the sample_hwsku.json file. sample_hwsku.json is the file that sonic-config-engine's unit tests rely on for its tests. Previously, it only included attributes for the first logical port of a split physical port. For example, if Ethernet4, a 4-lane port, was split into 2 ports, then sample_hwsku.json included only the entry for Ethernet4, with no entry for Ethernet6. This misalignment with the structure of other hwsku.json files has been corrected as well. - How to verify it Ensure that each logical port has the correct value of 'subport' in CONFIG DB, and that shutting down a logical port affects only that port and not other ports in the split. --- .../Mellanox-SN4700-C128/hwsku.json | 384 ++++++++++++------ .../Mellanox-SN4700-O28/hwsku.json | 96 +++-- .../Mellanox-SN4700-O8C48/hwsku.json | 168 +++++--- .../Mellanox-SN4700-O8V48/hwsku.json | 168 +++++--- .../Mellanox-SN4700-V48C32/hwsku.json | 240 +++++++---- src/sonic-config-engine/portconfig.py | 9 +- .../tests/sample_hwsku.json | 163 ++++++++ .../tests/hwsku_json_checker | 2 +- 8 files changed, 873 insertions(+), 357 deletions(-) diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/hwsku.json b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/hwsku.json index 867637000a1f..2692ca30c65d 100644 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/hwsku.json +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/hwsku.json @@ -1,388 +1,516 @@ { "interfaces": { "Ethernet0": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet2": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet4": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet6": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet8": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet10": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet12": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet14": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet16": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet18": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet20": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet22": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet24": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet26": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet28": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet30": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet32": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet34": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet36": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet38": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet40": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet42": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet44": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet46": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet48": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet50": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet52": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet54": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet56": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet58": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet60": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet62": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet64": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet66": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet68": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet70": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet72": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet74": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet76": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet78": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet80": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet82": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet84": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet86": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet88": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet90": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet92": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet94": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet96": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet98": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet100": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet102": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet104": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet106": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet108": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet110": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet112": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet114": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet116": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet118": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet120": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet122": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet124": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet126": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet128": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet130": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet132": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet134": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet136": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet138": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet140": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet142": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet144": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet146": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet148": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet150": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet152": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet154": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet156": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet158": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet160": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet162": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet164": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet166": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet168": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet170": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet172": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet174": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet176": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet178": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet180": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet182": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet184": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet186": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet188": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet190": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet192": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet194": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet196": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet198": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet200": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet202": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet204": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet206": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet208": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet210": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet212": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet214": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet216": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet218": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet220": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet222": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet224": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet226": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet228": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet230": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet232": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet234": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet236": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet238": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet240": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet242": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet244": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet246": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet248": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet250": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet252": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet254": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" } } } diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O28/hwsku.json b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O28/hwsku.json index b9c07d3cdf8b..86d6ec991a64 100644 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O28/hwsku.json +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O28/hwsku.json @@ -1,100 +1,132 @@ { "interfaces": { "Ethernet0": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet8": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet16": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet24": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet32": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet40": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet48": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet56": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet64": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet72": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet80": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet88": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet96": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet104": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet112": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet120": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet128": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet136": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet144": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet152": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet160": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet168": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet176": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet184": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet192": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet200": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet208": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet216": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet224": { - "default_brkout_mode": "1x200G[400G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x200G[400G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet232": { - "default_brkout_mode": "1x200G[400G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x200G[400G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet240": { - "default_brkout_mode": "1x200G[400G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x200G[400G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet248": { - "default_brkout_mode": "1x200G[400G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x200G[400G,100G,50G,40G,25G,10G,1G]", + "subport": "1" } } } diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/hwsku.json b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/hwsku.json index eb3ad6bb9009..d50fae23ec92 100644 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/hwsku.json +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/hwsku.json @@ -1,172 +1,228 @@ { "interfaces": { "Ethernet0": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet4": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet8": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet12": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet16": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet20": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet24": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet28": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet32": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet36": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet40": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet44": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet48": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet52": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet56": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet60": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet64": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet68": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet72": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet76": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet80": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet84": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet88": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet92": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet96": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet104": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet112": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet120": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet128": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet136": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet144": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet152": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet160": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet164": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet168": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet172": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet176": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet180": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet184": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet188": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet192": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet196": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet200": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet204": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet208": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet212": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet216": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet220": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet224": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet228": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet232": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet236": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet240": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet244": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet248": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet252": { - "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]", + "subport": "2" } } } diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/hwsku.json b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/hwsku.json index 62030cf19188..3d51a36be689 100644 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/hwsku.json +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/hwsku.json @@ -1,172 +1,228 @@ { "interfaces": { "Ethernet0": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet4": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet8": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet12": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet16": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet20": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet24": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet28": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet32": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet36": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet40": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet44": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet48": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet52": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet56": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet60": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet64": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet68": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet72": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet76": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet80": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet84": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet88": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet92": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet96": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet104": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet112": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet120": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet128": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet136": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet144": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet152": { - "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet160": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet164": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet168": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet172": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet176": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet180": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet184": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet188": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet192": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet196": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet200": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet204": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet208": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet212": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet216": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet220": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet224": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet228": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet232": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet236": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet240": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet244": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet248": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet252": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" } } } diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/hwsku.json b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/hwsku.json index 50d2faec2899..4fef978209db 100644 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/hwsku.json +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/hwsku.json @@ -1,244 +1,324 @@ { "interfaces": { "Ethernet0": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet4": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet8": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet12": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet16": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet20": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet24": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet28": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet32": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet36": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet40": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet44": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet48": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet52": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet56": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet60": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet64": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet68": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet72": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet76": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet80": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet84": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet88": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet92": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet96": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet100": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet104": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet108": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet112": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet116": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet120": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet124": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet128": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet132": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet136": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet140": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet144": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet148": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet152": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet156": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet160": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet164": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet168": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet172": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet176": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet180": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet184": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "1" }, "Ethernet188": { - "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]" + "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G,1G]", + "subport": "2" }, "Ethernet192": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet194": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet196": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet198": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet200": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet202": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet204": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet206": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet208": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet210": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet212": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet214": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet216": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet218": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet220": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet222": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet224": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet226": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet228": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet230": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet232": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet234": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet236": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet238": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet240": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet242": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet244": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet246": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" }, "Ethernet248": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "1" }, "Ethernet250": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "2" }, "Ethernet252": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "3" }, "Ethernet254": { - "default_brkout_mode": "4x100G[50G,25G,10G,1G]" + "default_brkout_mode": "4x100G[50G,25G,10G,1G]", + "subport": "4" } } } diff --git a/src/sonic-config-engine/portconfig.py b/src/sonic-config-engine/portconfig.py index f1bb80460e34..81b3dfb8f5bc 100644 --- a/src/sonic-config-engine/portconfig.py +++ b/src/sonic-config-engine/portconfig.py @@ -37,7 +37,7 @@ BRKOUT_MODE = "default_brkout_mode" CUR_BRKOUT_MODE = "brkout_mode" INTF_KEY = "interfaces" -OPTIONAL_HWSKU_ATTRIBUTES = ["fec", "autoneg"] +OPTIONAL_HWSKU_ATTRIBUTES = ["fec", "autoneg", "subport"] BRKOUT_PATTERN = r'(\d{1,6})x(\d{1,6}G?)(\[(\d{1,6}G?,?)*\])?(\((\d{1,6})\))?' BRKOUT_PATTERN_GROUPS = 6 @@ -422,9 +422,10 @@ def parse_platform_json_file(hwsku_json_file, platform_json_file): child_ports = get_child_ports(intf, brkout_mode, platform_json_file) # take optional fields from hwsku.json - for key, item in hwsku_dict[INTF_KEY][intf].items(): - if key in OPTIONAL_HWSKU_ATTRIBUTES: - child_ports.get(intf)[key] = item + for child_port in child_ports: + for key, item in hwsku_dict[INTF_KEY][child_port].items(): + if key in OPTIONAL_HWSKU_ATTRIBUTES: + child_ports.get(child_port)[key] = item ports.update(child_ports) diff --git a/src/sonic-config-engine/tests/sample_hwsku.json b/src/sonic-config-engine/tests/sample_hwsku.json index 697fb7b1ccb4..3615cda2680b 100644 --- a/src/sonic-config-engine/tests/sample_hwsku.json +++ b/src/sonic-config-engine/tests/sample_hwsku.json @@ -6,96 +6,243 @@ "Ethernet4": { "default_brkout_mode": "2x50G" }, + "Ethernet6": { + "default_brkout_mode": "2x50G" + }, "Ethernet8": { "default_brkout_mode": "4x25G[10G]" }, + "Ethernet9": { + "default_brkout_mode": "4x25G[10G]" + }, + "Ethernet10": { + "default_brkout_mode": "4x25G[10G]" + }, + "Ethernet11": { + "default_brkout_mode": "4x25G[10G]" + }, "Ethernet12": { "default_brkout_mode": "2x25G(2)+1x50G(2)" }, + "Ethernet13": { + "default_brkout_mode": "2x25G(2)+1x50G(2)" + }, + "Ethernet14": { + "default_brkout_mode": "2x25G(2)+1x50G(2)" + }, "Ethernet16": { "default_brkout_mode": "1x50G(2)+2x25G(2)" }, + "Ethernet18": { + "default_brkout_mode": "1x50G(2)+2x25G(2)" + }, + "Ethernet19": { + "default_brkout_mode": "1x50G(2)+2x25G(2)" + }, "Ethernet20": { "default_brkout_mode": "1x100G[40G]" }, "Ethernet24": { "default_brkout_mode": "2x50G" }, + "Ethernet26": { + "default_brkout_mode": "2x50G" + }, "Ethernet28": { "default_brkout_mode": "4x25G[10G]" }, + "Ethernet29": { + "default_brkout_mode": "4x25G[10G]" + }, + "Ethernet30": { + "default_brkout_mode": "4x25G[10G]" + }, + "Ethernet31": { + "default_brkout_mode": "4x25G[10G]" + }, "Ethernet32": { "default_brkout_mode": "2x25G(2)+1x50G(2)" }, + "Ethernet33": { + "default_brkout_mode": "2x25G(2)+1x50G(2)" + }, + "Ethernet34": { + "default_brkout_mode": "2x25G(2)+1x50G(2)" + }, "Ethernet36": { "default_brkout_mode": "1x50G(2)+2x25G(2)" }, + "Ethernet38": { + "default_brkout_mode": "1x50G(2)+2x25G(2)" + }, + "Ethernet39": { + "default_brkout_mode": "1x50G(2)+2x25G(2)" + }, "Ethernet40": { "default_brkout_mode": "1x100G[50G,40G,25G,10G,1G]" }, "Ethernet44": { "default_brkout_mode": "2x50G[40G,25G,10G,1G]" }, + "Ethernet46": { + "default_brkout_mode": "2x50G[40G,25G,10G,1G]" + }, "Ethernet48": { "default_brkout_mode": "4x25G[10G]" }, + "Ethernet49": { + "default_brkout_mode": "4x25G[10G]" + }, + "Ethernet50": { + "default_brkout_mode": "4x25G[10G]" + }, + "Ethernet51": { + "default_brkout_mode": "4x25G[10G]" + }, "Ethernet52": { "default_brkout_mode": "2x25G(2)+1x50G(2)" }, + "Ethernet53": { + "default_brkout_mode": "2x25G(2)+1x50G(2)" + }, + "Ethernet54": { + "default_brkout_mode": "2x25G(2)+1x50G(2)" + }, "Ethernet56": { "default_brkout_mode": "1x50G(2)+2x25G(2)" }, + "Ethernet58": { + "default_brkout_mode": "1x50G(2)+2x25G(2)" + }, + "Ethernet59": { + "default_brkout_mode": "1x50G(2)+2x25G(2)" + }, "Ethernet60": { "default_brkout_mode": "1x100G[40G]" }, "Ethernet64": { "default_brkout_mode": "2x50G" }, + "Ethernet66": { + "default_brkout_mode": "2x50G" + }, "Ethernet68": { "default_brkout_mode": "4x25G[10G]" }, + "Ethernet69": { + "default_brkout_mode": "4x25G[10G]" + }, + "Ethernet70": { + "default_brkout_mode": "4x25G[10G]" + }, + "Ethernet71": { + "default_brkout_mode": "4x25G[10G]" + }, "Ethernet72": { "default_brkout_mode": "2x25G(2)+1x50G(2)" }, + "Ethernet73": { + "default_brkout_mode": "2x25G(2)+1x50G(2)" + }, + "Ethernet74": { + "default_brkout_mode": "2x25G(2)+1x50G(2)" + }, "Ethernet76": { "default_brkout_mode": "1x50G(2)+2x25G(2)" }, + "Ethernet78": { + "default_brkout_mode": "1x50G(2)+2x25G(2)" + }, + "Ethernet79": { + "default_brkout_mode": "1x50G(2)+2x25G(2)" + }, "Ethernet80": { "default_brkout_mode": "1x100G[40G]" }, "Ethernet84": { "default_brkout_mode": "2x50G" }, + "Ethernet86": { + "default_brkout_mode": "2x50G" + }, "Ethernet88": { "default_brkout_mode": "4x25G[10G]" }, + "Ethernet89": { + "default_brkout_mode": "4x25G[10G]" + }, + "Ethernet90": { + "default_brkout_mode": "4x25G[10G]" + }, + "Ethernet91": { + "default_brkout_mode": "4x25G[10G]" + }, "Ethernet92": { "default_brkout_mode": "2x25G(2)+1x50G(2)" }, + "Ethernet93": { + "default_brkout_mode": "2x25G(2)+1x50G(2)" + }, + "Ethernet94": { + "default_brkout_mode": "2x25G(2)+1x50G(2)" + }, "Ethernet96": { "default_brkout_mode": "1x50G(2)+2x25G(2)" }, + "Ethernet98": { + "default_brkout_mode": "1x50G(2)+2x25G(2)" + }, + "Ethernet99": { + "default_brkout_mode": "1x50G(2)+2x25G(2)" + }, "Ethernet100": { "default_brkout_mode": "1x100G[40G]" }, "Ethernet104": { "default_brkout_mode": "2x50G" }, + "Ethernet106": { + "default_brkout_mode": "2x50G" + }, "Ethernet108": { "default_brkout_mode": "4x25G[10G]" }, + "Ethernet109": { + "default_brkout_mode": "4x25G[10G]" + }, + "Ethernet110": { + "default_brkout_mode": "4x25G[10G]" + }, + "Ethernet111": { + "default_brkout_mode": "4x25G[10G]" + }, "Ethernet112": { "default_brkout_mode": "2x25G(2)+1x50G(2)" }, + "Ethernet113": { + "default_brkout_mode": "2x25G(2)+1x50G(2)" + }, + "Ethernet114": { + "default_brkout_mode": "2x25G(2)+1x50G(2)" + }, "Ethernet116": { "default_brkout_mode": "1x50G(2)+2x25G(2)" }, + "Ethernet118": { + "default_brkout_mode": "1x50G(2)+2x25G(2)" + }, + "Ethernet119": { + "default_brkout_mode": "1x50G(2)+2x25G(2)" + }, "Ethernet120": { "default_brkout_mode": "1x100G[40G]" }, "Ethernet124": { "default_brkout_mode": "2x50G" }, + "Ethernet126": { + "default_brkout_mode": "2x50G" + }, "Ethernet128": { "default_brkout_mode": "1x40G[100G]" }, @@ -105,11 +252,27 @@ "Ethernet136": { "default_brkout_mode": "4x10G[25G]" }, + "Ethernet137": { + "default_brkout_mode": "4x10G[25G]" + }, + "Ethernet138": { + "default_brkout_mode": "4x10G[25G]" + }, + "Ethernet139": { + "default_brkout_mode": "4x10G[25G]" + }, "Ethernet140": { "default_brkout_mode": "2x25G(2)+1x50000(2)" }, + "Ethernet141": { + "default_brkout_mode": "2x25G(2)+1x50000(2)" + }, + "Ethernet142": { + "default_brkout_mode": "2x25G(2)+1x50000(2)" + }, "Ethernet144": { "default_brkout_mode": "1x100000[50G,40000,25G,10000]" } } } + diff --git a/src/sonic-device-data/tests/hwsku_json_checker b/src/sonic-device-data/tests/hwsku_json_checker index ee15c6fb4b5e..4abf62c159ba 100755 --- a/src/sonic-device-data/tests/hwsku_json_checker +++ b/src/sonic-device-data/tests/hwsku_json_checker @@ -7,7 +7,7 @@ import sys # Global variable PORT_ATTRIBUTES = ["default_brkout_mode"] -OPTIONAL_PORT_ATTRIBUTES = ["fec", "autoneg", "port_type"] +OPTIONAL_PORT_ATTRIBUTES = ["fec", "autoneg", "port_type", "subport"] PORT_REG = "Ethernet(\d+)" HWSKU_JSON = '*hwsku.json' INTF_KEY = "interfaces" From 4807c9422f0a86d1d79b45fed1e24196efef8ff0 Mon Sep 17 00:00:00 2001 From: mihirpat1 <112018033+mihirpat1@users.noreply.github.com> Date: Thu, 21 Mar 2024 11:50:25 -0700 Subject: [PATCH 205/419] [YANG]: Add Yang model support for adding dom_polling to PORT table (#18277) (#18344) Added YANG related changes for adding `dom_polling` field in PORT table of CONFIG_DB. This field can be set with `config interface transceiver dom PORT_NAME (enable|disable)` CLI. The `dom_polling` field was added through https://github.com/sonic-net/sonic-utilities/pull/3187. Please refer to this PR for the details on the reason for adding `dom_polling` field. Added `dom_polling` field to CONFIG_DB PORT table. Added unit tests for both valid and invalid options for controlling `dom_polling`. Valid values for for `dom_polling` are `enabled` and `disabled` Any other value is treated as an invalid value --- src/sonic-yang-models/doc/Configuration.md | 15 ++++--- .../tests/files/sample_config_db.json | 6 ++- .../tests/yang_model_tests/tests/port.json | 8 ++++ .../yang_model_tests/tests_config/port.json | 42 +++++++++++++++++++ .../yang-models/sonic-port.yang | 4 ++ 5 files changed, 68 insertions(+), 7 deletions(-) diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index 00465d666b1b..c17ed75e0028 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -1807,7 +1807,8 @@ optional attributes. "speed": "40000", "link_training": "off", "laser_freq": "191300", - "tx_power": "-27.3" + "tx_power": "-27.3", + "dom_polling": "enabled" }, "Ethernet1": { "index": "1", @@ -1819,7 +1820,8 @@ optional attributes. "speed": "40000", "link_training": "on", "laser_freq": "191300", - "tx_power": "-27.3" + "tx_power": "-27.3", + "dom_polling": "enabled" }, "Ethernet63": { "index": "63", @@ -1829,7 +1831,8 @@ optional attributes. "alias": "fortyGigE1/4/16", "speed": "40000", "laser_freq": "191300", - "tx_power": "-27.3" + "tx_power": "-27.3", + "dom_polling": "disabled" } } } @@ -1845,7 +1848,8 @@ optional attributes. "mtu": "9100", "alias": "etp1a", "speed": "100000", - "subport": 1 + "subport": 1, + "dom_polling": "enabled" }, "Ethernet4": { "admin_status": "up", @@ -1855,7 +1859,8 @@ optional attributes. "mtu": "9100", "alias": "etp1b", "speed": "100000", - "subport": 2 + "subport": 2, + "dom_polling": "enabled" }, } } 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 0355d7eb7b0b..0e1ca2bd168a 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -598,7 +598,8 @@ "autoneg": "on", "adv_speeds": "all", "adv_interface_types": "all", - "subport" : "0" + "subport" : "0", + "dom_polling":"enabled" }, "Ethernet3": { "alias": "Eth1/4", @@ -616,7 +617,8 @@ "speed": "11100", "tpid": "0x9100", "admin_status": "up", - "subport": "2" + "subport": "2", + "dom_polling":"enabled" }, "Ethernet5": { "alias": "Eth2/2", diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/port.json b/src/sonic-yang-models/tests/yang_model_tests/tests/port.json index cffa5bac65f7..f248e207a649 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 @@ -129,6 +129,14 @@ "eStrKey": "Range", "eStr": "0..8" }, + "PORT_VALID_DOM_POLLING": { + "desc": "PORT_VALID_DOM_POLLING no failure." + }, + "PORT_INVALID_DOM_POLLING": { + "desc": "PORT_INVALID_DOM_POLLING invalid condition failure.", + "eStrKey" : "InvalidValue", + "eStr": ["dom_polling"] + }, "PORT_AUTO_FEC_TEST": { "desc": "PORT_AUTO_FEC_TEST validate auto mode in fec." } 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 5879bbac55a3..8ac0d964734b 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 @@ -640,6 +640,48 @@ } }, + "PORT_INVALID_DOM_POLLING": { + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "name": "Ethernet0", + "alias": "etp1a", + "lanes": "60, 61", + "speed": 100000, + "subport": 1, + "dom_polling": "on" + } + ] + } + } + }, + + "PORT_VALID_DOM_POLLING": { + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "name": "Ethernet0", + "alias": "etp1a", + "lanes": "60, 61", + "speed": 100000, + "subport": 1, + "dom_polling": "enabled" + }, + { + "name": "Ethernet2", + "alias": "etp1b", + "lanes": "62, 63", + "speed": 100000, + "subport": 2, + "dom_polling": "disabled" + } + ] + } + } + }, + "PORT_AUTO_FEC_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 f164140d0d81..183dd0d4b182 100644 --- a/src/sonic-yang-models/yang-models/sonic-port.yang +++ b/src/sonic-yang-models/yang-models/sonic-port.yang @@ -155,6 +155,10 @@ module sonic-port{ } } + leaf dom_polling { + type stypes:admin_mode; + } + leaf pfc_asym { type string { pattern "on|off"; From d7298c5a1eca6f1e89abbc4a4b7dcb25e7c20637 Mon Sep 17 00:00:00 2001 From: snider-nokia <76123698+snider-nokia@users.noreply.github.com> Date: Fri, 15 Mar 2024 15:18:45 -0400 Subject: [PATCH 206/419] [Nokia][sonic-platform] Update Nokia sonic-platform submodule - ungraceful reboot hooks to induce NIF port shutdown (#18014) These changes provide for the automatic shutdown of NIF ports on LC when an ungraceful reboot scenario occurs. Reboot and panic notifier hooks are now registered so that callback occurs from the kernel and NIF ports are subsequently shut down. Why I did it To facilitate the timely movement of traffic away from a crashed LC when its peers recognize that the associated links have gone down. How I did it Linux kernel reboot and panic notifier hooks are used to register a callback routine that, when invoked, stuffs all present transceiver modules into reset. How to verify it Cause an ungraceful reboot (whether via /usr/sbin/reboot or by causing a kernel panic) and verify that all LC native NIF links are brought down at reboot/panic time (on the way down). It may be necessary to monitor the LC link peer(s) in order to verify in real-time. --- platform/broadcom/sonic-platform-modules-nokia | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/broadcom/sonic-platform-modules-nokia b/platform/broadcom/sonic-platform-modules-nokia index e82caa40d4ee..1ef68bdba5df 160000 --- a/platform/broadcom/sonic-platform-modules-nokia +++ b/platform/broadcom/sonic-platform-modules-nokia @@ -1 +1 @@ -Subproject commit e82caa40d4eec59e574bd4acffb0e92fd7187da4 +Subproject commit 1ef68bdba5dfcb1b7946c952ee233f0ee5b7738a From 35715ae0b1723058ee5652044f5409963545b3ab Mon Sep 17 00:00:00 2001 From: Aaron Payment Date: Wed, 6 Dec 2023 22:04:21 -0800 Subject: [PATCH 207/419] [gbsyncd]: Set SYSLOG_CONFIG_FEATURE for gbsyncd (#17325) Why I did it SONiC Mgmt test syslog/test_syslog_rate_limit.py syslog.test_syslog_rate_limit test_syslog_rate_limit was failing on SKUs with gbsyncd. This includes Arista 720DT when testing on the 202305 branch. How I did it The issue was no value for gbsyncd in "show syslog rate-limit-container", because gbsyncd is not having a SYSLOG_CONFIG_FEAGTURE|gbsyncd entry in config_db, which is further because gbsyncd feature is for not enabled through init_cfg.json.j2. How to verify it Test is now passing on 720DT in 202305 branch. Co-authored-by: Boyang Yu --- files/scripts/gbsyncd.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/files/scripts/gbsyncd.sh b/files/scripts/gbsyncd.sh index 53b00438ce23..34bcb7044bed 100755 --- a/files/scripts/gbsyncd.sh +++ b/files/scripts/gbsyncd.sh @@ -10,6 +10,7 @@ function startplatform() { if [ -z $($DB_CLI CONFIG_DB HGET 'FEATURE|gbsyncd' state) ]; then local CMD="local r=redis.call('DUMP', KEYS[1]); redis.call('RESTORE', KEYS[2], 0, r)" $DB_CLI CONFIG_DB EVAL "$CMD" 2 'FEATURE|syncd' 'FEATURE|gbsyncd' + $DB_CLI CONFIG_DB EVAL "$CMD" 2 'SYSLOG_CONFIG_FEATURE|syncd' 'SYSLOG_CONFIG_FEATURE|gbsyncd' fi done } From 8deb49367340420b231e386289010c91acaa6441 Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Mon, 4 Mar 2024 09:58:31 -0800 Subject: [PATCH 208/419] [Mellanox]Adding dependency of libnl-route-3 for Mellanox SAI library (#18197) - Why I did it Adding explicit dependency of libnl-route-3 for Mellanox SAI library. This is required for the latest SAI library. - How I did it Modifying Make files - How to verify it Building with the changes. --- platform/mellanox/mlnx-sai.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/mellanox/mlnx-sai.mk b/platform/mellanox/mlnx-sai.mk index c640420c23cd..89f696bcd238 100644 --- a/platform/mellanox/mlnx-sai.mk +++ b/platform/mellanox/mlnx-sai.mk @@ -19,8 +19,8 @@ export MLNX_SAI_VERSION MLNX_SAI_SOURCE_BASE_URL MLNX_SAI = mlnx-sai_1.mlnx.$(MLNX_SAI_VERSION)_$(CONFIGURED_ARCH).deb $(MLNX_SAI)_SRC_PATH = $(PLATFORM_PATH)/mlnx-sai -$(MLNX_SAI)_DEPENDS += $(MLNX_SDK_DEBS) -$(MLNX_SAI)_RDEPENDS += $(MLNX_SDK_RDEBS) $(MLNX_SDK_DEBS) +$(MLNX_SAI)_DEPENDS += $(MLNX_SDK_DEBS) $(LIBNL_ROUTE3_DEV) +$(MLNX_SAI)_RDEPENDS += $(MLNX_SDK_RDEBS) $(MLNX_SDK_DEBS) $(LIBNL_ROUTE3) $(eval $(call add_conflict_package,$(MLNX_SAI),$(LIBSAIVS_DEV))) MLNX_SAI_DBGSYM = mlnx-sai-dbgsym_1.mlnx.$(MLNX_SAI_VERSION)_$(CONFIGURED_ARCH).deb $(eval $(call add_derived_package,$(MLNX_SAI),$(MLNX_SAI_DBGSYM))) From f6380a3a6e5af4a867d2dc229d7926e91207d126 Mon Sep 17 00:00:00 2001 From: Stephen Sun <5379172+stephenxs@users.noreply.github.com> Date: Fri, 15 Mar 2024 10:02:21 +0800 Subject: [PATCH 209/419] Support dot in the additional information of the PFC watchdog event in the yang model (#18235) ### Why I did it Support dot (`.`) in the `additional_info` field in the PFC watchdog event in the yang model. The `additional_info` field was introduced to represent diagnosis information when a PFC storm is detected, which can include fragments. Signed-off-by: Stephen Sun ### How I did it #### How to verify it Unit test. --- .../yang_model_tests/tests/sonic-events-swss.json | 3 +++ .../tests_config/sonic-events-swss.json | 12 ++++++++++++ .../yang-models/sonic-events-swss.yang | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/sonic-events-swss.json b/src/sonic-yang-models/tests/yang_model_tests/tests/sonic-events-swss.json index 6592fd10136f..56a05d1736b3 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/sonic-events-swss.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/sonic-events-swss.json @@ -40,6 +40,9 @@ "SONIC_EVENTS_SWSS_PFC_STORM_VALID_WITH_ADDITIONAL_INFO": { "desc": "VALID IF_STATE EVENT." }, + "SONIC_EVENTS_SWSS_PFC_STORM_VALID_WITH_ADDITIONAL_INFO_FRAGMENT": { + "desc": "VALID IF_STATE EVENT." + }, "SONIC_EVENTS_SWSS_PFC_STORM_WITH_INVALID_ADDITIONAL_INFO_1": { "desc": "PFC_STORM_EVENT_INCORRECT_ADDITIONAL_INFO failure.", "eStrKey": "Pattern" diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/sonic-events-swss.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/sonic-events-swss.json index 6b50ccd55acf..06ebf50df0e8 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/sonic-events-swss.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/sonic-events-swss.json @@ -113,6 +113,18 @@ } } }, + "SONIC_EVENTS_SWSS_PFC_STORM_VALID_WITH_ADDITIONAL_INFO_FRAGMENT": { + "sonic-events-swss:sonic-events-swss": { + "sonic-events-swss:pfc-storm": { + "ifname": "Ethernet0", + "queue_index": 0, + "queue_id": 0, + "port_id": 0, + "additional_info": "info1:1.2|info2:3.25", + "timestamp": "1985-04-12T23:20:50.52Z" + } + } + }, "SONIC_EVENTS_SWSS_PFC_STORM_WITH_INVALID_ADDITIONAL_INFO_1": { "sonic-events-swss:sonic-events-swss": { "sonic-events-swss:pfc-storm": { diff --git a/src/sonic-yang-models/yang-models/sonic-events-swss.yang b/src/sonic-yang-models/yang-models/sonic-events-swss.yang index f7b3ca3ea5e6..309bab1738e4 100644 --- a/src/sonic-yang-models/yang-models/sonic-events-swss.yang +++ b/src/sonic-yang-models/yang-models/sonic-events-swss.yang @@ -80,7 +80,7 @@ module sonic-events-swss { leaf additional_info { type string { - pattern '[-a-zA-Z0-9_]+:[-a-zA-Z0-9_]+(\|{1}[-a-zA-Z0-9_]+:[-a-zA-Z0-9_]+)*'; + pattern '[-a-zA-Z0-9_]+:[-a-zA-Z0-9_.]+(\|{1}[-a-zA-Z0-9_]+:[-a-zA-Z0-9_.]+)*'; } description "Additional information to investigate PFC storm"; } From 544dcfbd3d6e8a1e342a40cae89dd38bbfeb054c Mon Sep 17 00:00:00 2001 From: Ze Gan Date: Thu, 29 Feb 2024 14:23:03 +0800 Subject: [PATCH 210/419] [sonic-dash-api]: Fix wrong path in sonic-dash-api.dep (#18206) In some local buildings, an error /bin/bash: line 0: cd: src/sonic-dash-api/sonic-dash-api: No such file or directory will be raised due to the directory structure of sonic-dash-api has been changed. Signed-off-by: Ze Gan --- rules/sonic-dash-api.dep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules/sonic-dash-api.dep b/rules/sonic-dash-api.dep index 6d4ffcad847f..64e23961d904 100644 --- a/rules/sonic-dash-api.dep +++ b/rules/sonic-dash-api.dep @@ -3,7 +3,7 @@ SPATH := $($(LIB_SONIC_DASH_API)_SRC_PATH) DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic-dash-api.mk rules/sonic-dash-api.dep DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) DEP_FILES += $(shell git ls-files $(SPATH) | grep -v sonic-dash-api) -SMDEP_FILES := $(addprefix $(SPATH)/sonic-dash-api/,$(shell cd $(SPATH)/sonic-dash-api && git ls-files)) +SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH)/ && git ls-files)) $(LIB_SONIC_DASH_API)_CACHE_MODE := GIT_CONTENT_SHA $(LIB_SONIC_DASH_API)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) From 23fd6711aac44443da2785ea2fc3955fb1156024 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 22 Mar 2024 19:01:08 +0800 Subject: [PATCH 211/419] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#18437) #### Why I did it src/sonic-utilities ``` * fb4a090d - (HEAD -> 202311, origin/202311) [config] Add Table hard dependency check (#3159) (4 hours ago) [jingwenxie] * 86f3de58 - [ipintutil]Handle exception in show ip interfaces command (#3182) (4 hours ago) [Sudharsan Dhamal Gopalarathnam] * 5bfc3b40 - [Techsupport]Handle SAI kv pair if present in sai common profile (#3196) (4 hours ago) [Sudharsan Dhamal Gopalarathnam] * f4ef7681 - [fast/warm-reboot] Put ERR message in syslog when a failure is seen (#3186) (4 hours ago) [Vaibhav Hemant Dixit] * db36df24 - [Bug] Fix fw_setenv illegel character issue (#3201) (4 hours ago) [xumia] * a58b78c8 - [config] Add YANG alerting for override (#3188) (4 hours ago) [jingwenxie] * 943a6846 - Update port2alias (#3217) (4 hours ago) [abdosi] * 3236fbf4 - [show] Update show run all to cover all asic config in multiasic (#3148) (#3224) (5 hours ago) [mssonicbld] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index c68f4b168db8..fb4a090d3eab 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit c68f4b168db8ff9c550322bc9a74c0bc8fd92b74 +Subproject commit fb4a090d3eab28d32012cfd7e649edf5a54b7fbe From cbe50d4272d60c4f4a4e9e5f50dca1dba4c00e92 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 22 Mar 2024 19:01:13 +0800 Subject: [PATCH 212/419] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#18436) #### Why I did it src/sonic-swss ``` * 71e7b37c - (HEAD -> 202311, origin/202311) [202311][muxorch] Fixing cache bug in updateRoute logic and Fixing bug with multiple routes pointing to nhg (#3082) (11 hours ago) [Nikola Dancejic] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index dd4810b11406..71e7b37c1dd9 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit dd4810b114061a14dd5254e9a7bebe7f616b5e32 +Subproject commit 71e7b37c1dd92d83e4b280991803ac2b6b67339a From ffb5a5880c8ec29ed6197bc3283af1c9ffe9d616 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 22 Mar 2024 19:01:18 +0800 Subject: [PATCH 213/419] [submodule] Update submodule sonic-platform-daemons to the latest HEAD automatically (#18435) #### Why I did it src/sonic-platform-daemons ``` * fa46abb - (HEAD -> 202311, origin/202311) [ycabled] Fix insert delete events for ycabled OIR by subscribing to TRANSCEIVER_INFO instead of TRANSCEIVER_STATUS table (#442) (4 hours ago) [vdahiya12] * 8c15adb - Disable periodic polling of port in DomInfoUpdateTask thread during CMIS init (#449) (#451) (11 hours ago) [mihirpat1] ``` #### How I did it #### How to verify it #### Description for the changelog --- 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 395d8d7be711..fa46abbafe22 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit 395d8d7be7111e088c1121596013883efa5973ef +Subproject commit fa46abbafe22c4cbcaabe346120907e6e4347167 From f767e4161a45addb1867ba90621973ffe4382e18 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 22 Mar 2024 19:01:28 +0800 Subject: [PATCH 214/419] [submodule] Update submodule sonic-linux-kernel to the latest HEAD automatically (#18433) #### Why I did it src/sonic-linux-kernel ``` * 59e5ea1 - (HEAD -> 202311, origin/202311) Disable small sector erase size for UBIFS on flash (#382) (4 hours ago) [Mridul Bajpai] * ed95e5d - [202311] Dynamic write timeout support for optoe driver (#371) (8 hours ago) [mihirpat1] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-linux-kernel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-linux-kernel b/src/sonic-linux-kernel index a03750336cea..59e5ea16e831 160000 --- a/src/sonic-linux-kernel +++ b/src/sonic-linux-kernel @@ -1 +1 @@ -Subproject commit a03750336cea5c95cf7ce7fb923c01a9d54c8cef +Subproject commit 59e5ea16e831d08e37f663327bf165255b60b98e From aa74566df6f6f3782b32ba2e3e9d2bd32e55bd17 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 22 Mar 2024 19:01:35 +0800 Subject: [PATCH 215/419] [submodule] Update submodule linkmgrd to the latest HEAD automatically (#18432) #### Why I did it src/linkmgrd ``` * 27aed40 - (HEAD -> 202311, origin/202311) [active-standby] reset mux probing backoff factor in link flaps (#245) (4 hours ago) [Jing Zhang] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/linkmgrd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linkmgrd b/src/linkmgrd index 1f5fcfd21b11..27aed4037295 160000 --- a/src/linkmgrd +++ b/src/linkmgrd @@ -1 +1 @@ -Subproject commit 1f5fcfd21b112c4765d20691c8c4bf8d2842f0c2 +Subproject commit 27aed4037295b4c047c99047303c45a107888f1f From a9c5600be292f1bd5a0b6916cb6f4dbc342a5c09 Mon Sep 17 00:00:00 2001 From: Zhijian Li Date: Tue, 19 Mar 2024 14:04:38 +0800 Subject: [PATCH 216/419] [E1031] Bugfix for Python syntax error in sonic_platform/common.py (#18386) Why I did it Bugfix for Python syntax error in sonic_platform/common.py. A method of class need to have self as parameter. Fixing below issue: e1031:~$ show int st Traceback (most recent call last): File "/usr/local/bin/intfutil", line 836, in main() File "/usr/local/bin/intfutil", line 819, in main interface_stat.display_intf_status() File "/usr/local/bin/intfutil", line 448, in display_intf_status self.get_intf_status() File "/usr/local/lib/python3.9/dist-packages/utilities_common/multi_asic.py", line 157, in wrapped_run_on_all_asics func(self, *args, **kwargs) File "/usr/local/bin/intfutil", line 529, in get_intf_status self.portchannel_speed_dict = po_speed_dict(self.po_int_dict, self.db) File "/usr/local/bin/intfutil", line 334, in po_speed_dict optics_type = port_optics_get(appl_db, value[0], PORT_OPTICS_TYPE) File "/usr/local/bin/intfutil", line 224, in port_optics_get if is_rj45_port(intf_name): File "/usr/local/lib/python3.9/dist-packages/utilities_common/platform_sfputil_helper.py", line 120, in is_rj45_port platform_chassis = sonic_platform.platform.Platform().get_chassis() File "/usr/local/lib/python3.9/dist-packages/sonic_platform/platform.py", line 21, in __init__ self._chassis = Chassis() File "/usr/local/lib/python3.9/dist-packages/sonic_platform/chassis.py", line 37, in __init__ self._is_host = self._api_common.is_host() TypeError: is_host() takes 0 positional arguments but 1 was given Work item tracking Microsoft ADO (number only): 27208152 How I did it Add self parameter to function Common::is_host(). How to verify it Verified on E1031 DUT with this patch. --- device/celestica/x86_64-cel_e1031-r0/sonic_platform/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/common.py b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/common.py index 0838f0cf0a2a..0dcbf7f33def 100644 --- a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/common.py +++ b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/common.py @@ -183,7 +183,7 @@ def write_txt_file(self, file_path, value): return False return True - def is_host(): + def is_host(self): """ Test whether current process is running on the host or an docker return True for host and False for docker From 5620d6c30be571cf3368a7016436584e47135ce1 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 23 Mar 2024 19:01:06 +0800 Subject: [PATCH 217/419] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#18451) #### Why I did it src/sonic-swss ``` * f1aad1f0 - (HEAD -> 202311, origin/202311) [acl] Add IN_PORTS qualifier for L3 table (#3078) (10 hours ago) [Neetha John] * 3b953ae7 - [Mellanox] Fix inconsistence in the shared headroom pool initialization (#3057) (22 hours ago) [Stephen Sun] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 71e7b37c1dd9..f1aad1f0b93b 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 71e7b37c1dd92d83e4b280991803ac2b6b67339a +Subproject commit f1aad1f0b93bed236022564d3d100f371501229a From e295afa3b38be66f7cab8802957e271539577ea2 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 23 Mar 2024 19:01:17 +0800 Subject: [PATCH 218/419] [submodule] Update submodule linkmgrd to the latest HEAD automatically (#18449) #### Why I did it src/linkmgrd ``` * 7465431 - (HEAD -> 202311, origin/202311) draft (#231) (22 hours ago) [Liu Shilong] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/linkmgrd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linkmgrd b/src/linkmgrd index 27aed4037295..746543176654 160000 --- a/src/linkmgrd +++ b/src/linkmgrd @@ -1 +1 @@ -Subproject commit 27aed4037295b4c047c99047303c45a107888f1f +Subproject commit 746543176654fd6c55a4d94147c832d86317b86a From 5e9f1b05b861cf3e70867f9656c28f1acd03f6a4 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 23 Mar 2024 19:01:28 +0800 Subject: [PATCH 219/419] [submodule] Update submodule sonic-gnmi to the latest HEAD automatically (#18258) #### Why I did it src/sonic-gnmi ``` * d59e436 - (HEAD -> 202311, origin/202311) Fix sonic string in osversion/build (#190) (3 weeks ago) [Zain Budhwani] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-gnmi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-gnmi b/src/sonic-gnmi index 07e0b364375c..d59e436de44a 160000 --- a/src/sonic-gnmi +++ b/src/sonic-gnmi @@ -1 +1 @@ -Subproject commit 07e0b364375c9b867ae1f5d600d0785f30e3f4d3 +Subproject commit d59e436de44a6aae156b1889d5a398e497be39a4 From 085765a45dd5023568c138cd7c75403375bb9830 Mon Sep 17 00:00:00 2001 From: Nazarii Hnydyn Date: Mon, 25 Mar 2024 18:29:33 +0200 Subject: [PATCH 220/419] [202311][Mellanox][MFT]: Update MFT to 4.27.0-83: bash login fix (#18462) * Revert "[mellanox]: Disable MFT bash autocompletion. (#17543)" This reverts commit 49e96c3daa73a00971a4e60b2a4c8bf1984d8edd. * [mellanox][mft]: Update MFT to 4.27.0-83: bash login fix. Signed-off-by: Nazarii Hnydyn --------- Signed-off-by: Nazarii Hnydyn --- platform/mellanox/mft.mk | 6 +++--- platform/mellanox/mft/Makefile | 15 --------------- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/platform/mellanox/mft.mk b/platform/mellanox/mft.mk index 5ef30af77c55..c118f63a2aa9 100644 --- a/platform/mellanox/mft.mk +++ b/platform/mellanox/mft.mk @@ -14,10 +14,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# Mellanox SAI +# Mellanox MFT -MFT_VERSION = 4.25.0 -MFT_REVISION = 62 +MFT_VERSION = 4.27.0 +MFT_REVISION = 83 MLNX_MFT_INTERNAL_SOURCE_BASE_URL = diff --git a/platform/mellanox/mft/Makefile b/platform/mellanox/mft/Makefile index 43472ba69e29..88fc3d901ad2 100644 --- a/platform/mellanox/mft/Makefile +++ b/platform/mellanox/mft/Makefile @@ -42,8 +42,6 @@ DERIVED_TARGETS = $(MOD_DEB) mft-oem_$(MFT_VERSION)-$(MFT_REVISION)_$(CONFIGURED DKMS_BMDEB = /var/lib/dkms/kernel-mft-dkms/$(MFT_VERSION)/bmdeb DKMS_TMP := $(shell mktemp -u -d -t dkms.XXXXXXXXXX) -MFT_TMP := $(shell mktemp -u -d -t mft.XXXXXXXXXX) - $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : rm -rf $(MFT_NAME) wget -O $(MFT_TGZ) $(MFT_TGZ_URL) @@ -77,19 +75,6 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : rm -rf $(DKMS_TMP) - # w/a: disable bash autocompletion - mkdir -p $(MFT_TMP)/DEBIAN - - dpkg -e $(MFT_NAME)/DEBS/$(MAIN_TARGET) $(MFT_TMP)/DEBIAN - dpkg -x $(MFT_NAME)/DEBS/$(MAIN_TARGET) $(MFT_TMP) - - rm -rf $(MFT_TMP)/etc/bash_completion.d - sed -i '/bash_completion.d/d' $(MFT_TMP)/DEBIAN/conffiles - - dpkg -b $(MFT_TMP) $(MFT_NAME)/DEBS/$(MAIN_TARGET) - - rm -rf $(MFT_TMP) - # fix timestamp because we do not actually build tools, only kernel touch $(MFT_NAME)/DEBS/*.deb mv $(MFT_NAME)/DEBS/*.deb $(DEST) From d61e1ec6e8f1eecb2a5c4126550894a71bc5fe25 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 26 Mar 2024 19:01:17 +0800 Subject: [PATCH 221/419] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#18458) #### Why I did it src/sonic-swss ``` * b8b1c08e - (HEAD -> 202311, origin/202311) [PortOrch] Add FEC codeword errors in port stats (#3029) (2 days ago) [vdahiya12] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index f1aad1f0b93b..b8b1c08e070d 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit f1aad1f0b93bed236022564d3d100f371501229a +Subproject commit b8b1c08e070d071c1c93bfcc9878d8179b09eade From c25075c2399a55869473f01400b059fb3da92b00 Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Tue, 26 Mar 2024 09:55:14 -0700 Subject: [PATCH 222/419] [202311][Mellanox]Remove log in RAM kernel option for 2700 A1 platform (#18361) --- device/mellanox/x86_64-mlnx_msn2700a1-r0/installer.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/device/mellanox/x86_64-mlnx_msn2700a1-r0/installer.conf b/device/mellanox/x86_64-mlnx_msn2700a1-r0/installer.conf index 3f527393e156..c46f0eb7a459 100644 --- a/device/mellanox/x86_64-mlnx_msn2700a1-r0/installer.conf +++ b/device/mellanox/x86_64-mlnx_msn2700a1-r0/installer.conf @@ -1 +1 @@ -ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="logs_inram=on libata.force=noncq" +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="libata.force=noncq" From 3e8c5a699ab74ccd951fb717748e9e3d0722ab06 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 27 Mar 2024 19:01:09 +0800 Subject: [PATCH 223/419] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#18474) #### Why I did it src/sonic-utilities ``` * faffd73d - (HEAD -> 202311, origin/202311) Modify "show interface transceiver status" CLI to show SW cmis state (#3238) (4 hours ago) [mihirpat1] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index fb4a090d3eab..faffd73d40a9 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit fb4a090d3eab28d32012cfd7e649edf5a54b7fbe +Subproject commit faffd73d40a9f34e927e5abe2756cd317e21ca00 From 2476b154df9925fc303da25a21d13c8fa9762df1 Mon Sep 17 00:00:00 2001 From: Pavan Naregundi <92989231+pavannaregundi@users.noreply.github.com> Date: Fri, 29 Mar 2024 04:20:13 +0530 Subject: [PATCH 224/419] Update MRVL_PRESTERA_DRIVER (#18370) Signed-off-by: Pavan Naregundi --- platform/marvell-armhf/prestera.mk | 2 +- .../prestera/debian/mrvlprestera.install.template | 3 +-- platform/marvell-armhf/prestera/debian/rules | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/platform/marvell-armhf/prestera.mk b/platform/marvell-armhf/prestera.mk index 0d48b9ed8aec..308df5e7569a 100644 --- a/platform/marvell-armhf/prestera.mk +++ b/platform/marvell-armhf/prestera.mk @@ -4,7 +4,7 @@ export MRVL_PRESTERA_VER = 1.0 export MRVL_PRESTERA = mrvlprestera_$(MRVL_PRESTERA_VER)_$(PLATFORM_ARCH) export MRVL_PRESTERA_DEB = $(MRVL_PRESTERA).deb export MRVL_PRESTERA_SRC_URL = https://github.com/Marvell-switching/mrvl-prestera.git -export MRVL_PRESTERA_SRC_TAG = MRVL_PRESTERA_DRIVER_1.4 +export MRVL_PRESTERA_SRC_TAG = MRVL_PRESTERA_DRIVER_1.7_1 $(MRVL_PRESTERA_DEB)_SRC_PATH = $(PLATFORM_PATH)/prestera $(MRVL_PRESTERA_DEB)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) diff --git a/platform/marvell-armhf/prestera/debian/mrvlprestera.install.template b/platform/marvell-armhf/prestera/debian/mrvlprestera.install.template index 3c805336cc51..70a9655ddea2 100644 --- a/platform/marvell-armhf/prestera/debian/mrvlprestera.install.template +++ b/platform/marvell-armhf/prestera/debian/mrvlprestera.install.template @@ -1,3 +1,2 @@ -mrvl-prestera/drivers/armhf/cpssEnabler/linuxNoKernelModule/drivers/mvDmaDrv.ko /lib/modules/KVERSION/kernel/extra -mrvl-prestera/drivers/armhf/cpssEnabler/linuxNoKernelModule/drivers/mvIntDrv.ko /lib/modules/KVERSION/kernel/extra +mrvl-prestera/drivers/armhf/cpssEnabler/linuxNoKernelModule/drivers/mvcpss.ko /lib/modules/KVERSION/kernel/extra mrvl-prestera/platform/armhf/* / diff --git a/platform/marvell-armhf/prestera/debian/rules b/platform/marvell-armhf/prestera/debian/rules index 7164aa7548a4..8f082a9c98fb 100755 --- a/platform/marvell-armhf/prestera/debian/rules +++ b/platform/marvell-armhf/prestera/debian/rules @@ -25,7 +25,7 @@ build: cd mrvl-prestera && git checkout ${MRVL_PRESTERA_SRC_TAG} && cd .. sed "s/KVERSION/${KVERSION}/g" /sonic/platform/marvell-armhf/prestera/debian/mrvlprestera.install.template > /sonic/platform/marvell-armhf/prestera/debian/mrvlprestera.install - make modules -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$(MODULE_DIR)/ + make modules -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$(MODULE_DIR)/ CONFIG_KM_MVPCI=y CONFIG_KM_MVDMA=y CONFIG_KM_MVINT=y binary: binary-arch binary-indep # Nothing to do From 16178ddb0bea3dcada6eeb40daed8e9b7f9e53ad Mon Sep 17 00:00:00 2001 From: Stephen Sun <5379172+stephenxs@users.noreply.github.com> Date: Sun, 24 Mar 2024 08:04:00 +0800 Subject: [PATCH 225/419] Do not pass the option "device" in rsyslog.conf by default when syslog server's source address is configured (#17616) ### Why I did it An in-band syslog server will not receive any syslog if it is configured without a VRF specified, which is because `eth0` is always specified as the `device` of a syslog server and the syslog packets will be sent to `eth0` regardless of its destination IP address. ### How I did it Pass the option "device" in rsyslog.conf only if when syslog server's source address is configured with a non-default VRF #### How to verify it Manually test: 1. Configuring a syslog server without VRF specified or with `default` as the VRF: no `device` passed in `rsyslog.conf` 2. Configuring a syslog server with non-default VRF: the configured VRF passed as `device` in `rsyslog.conf` --- files/image_config/rsyslog/rsyslog.conf.j2 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/files/image_config/rsyslog/rsyslog.conf.j2 b/files/image_config/rsyslog/rsyslog.conf.j2 index c29d803d085a..f6d480494091 100644 --- a/files/image_config/rsyslog/rsyslog.conf.j2 +++ b/files/image_config/rsyslog/rsyslog.conf.j2 @@ -107,7 +107,7 @@ $RepeatedMsgReduction on {% set regex = conf.get('filter_regex') -%} {% set fmodifier = '!' if filter == 'exclude' else '' %} -{% set device = 'eth0' if vrf == 'default' else vrf -%} +{% set device = vrf if vrf != '' and vrf != 'default' -%} {% set template = 'WelfRemoteFormat' if format == 'welf' else 'SONiCFileFormat' -%} {# Server extra options -#} @@ -115,11 +115,16 @@ $RepeatedMsgReduction on {% if source -%} {% set options = options ~ ' Address="' ~ source ~ '"'-%} + {% set device = device if device != 'eth0' else '' -%} +{% endif -%} + +{% if device -%} + {% set options = options ~ ' Device="' ~ device ~ '"'-%} {% endif -%} {% if filter %} :msg, {{ fmodifier }}ereregex, "{{ regex }}" {% endif %} *.{{ severity }} -action(type="omfwd" Target="{{ server }}" Port="{{ port }}" Protocol="{{ proto }}" Device="{{ device }}" Template="{{ template }}"{{ options }}) +action(type="omfwd" Target="{{ server }}" Port="{{ port }}" Protocol="{{ proto }}" Template="{{ template }}"{{ options }}) {% endfor %} From 107019c48a20eec42bbc68f68da9389ec79970d8 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 2 Apr 2024 19:01:04 +0800 Subject: [PATCH 226/419] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#18521) #### Why I did it src/sonic-utilities ``` * a056e9d5 - (HEAD -> 202311, origin/202311) [dualtor_neighbor_check] Fix the script not exists issue (#3244) (16 hours ago) [Longxiang Lyu] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index faffd73d40a9..a056e9d517ea 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit faffd73d40a9f34e927e5abe2756cd317e21ca00 +Subproject commit a056e9d517ea26a82afdcc2fc68e0359232a154f From 35f1f223a5a8eb1b8c61313169c6dde6017b0adf Mon Sep 17 00:00:00 2001 From: Zain Budhwani <99770260+zbud-msft@users.noreply.github.com> Date: Thu, 14 Mar 2024 19:00:11 -0700 Subject: [PATCH 227/419] [eventd] Add incremental polling when waiting for capture service to start (#18138) ### Why I did it Addresses https://github.com/sonic-net/sonic-buildimage/issues/17350 ### How I did it Instead of a 1 second delay, we poll to check that the thread is available and after each poll increment the delay. There were situations where if there was less memory available, fixed polling would not be effective for starting zmq capture service. Add an incremental delay such that eventd can wait longer to start up capture service if system is too busy or overloaded, but still keep a max duration/retry limit so that we do not wait forever. #### How to verify it UT --- src/sonic-eventd/src/eventd.cpp | 42 ++++++++++++++++++++------------- src/sonic-eventd/src/eventd.h | 2 ++ 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/src/sonic-eventd/src/eventd.cpp b/src/sonic-eventd/src/eventd.cpp index 36c162453427..eb692d5b3a9b 100644 --- a/src/sonic-eventd/src/eventd.cpp +++ b/src/sonic-eventd/src/eventd.cpp @@ -1,4 +1,5 @@ #include +#include #include "eventd.h" #include "dbconnector.h" #include "zmq.h" @@ -539,6 +540,7 @@ int capture_service::set_control(capture_control_t ctrl, event_serialized_lst_t *lst) { int ret = -1; + int duration = CAPTURE_SERVICE_POLLING_DURATION; /* Can go in single step only. */ RET_ON_ERR((ctrl - m_ctrl) == 1, "m_ctrl(%d)+1 < ctrl(%d)", m_ctrl, ctrl); @@ -547,8 +549,9 @@ capture_service::set_control(capture_control_t ctrl, event_serialized_lst_t *lst case INIT_CAPTURE: m_thr = thread(&capture_service::do_capture, this); for(int i=0; !m_cap_run && (i < CAPTURE_SERVICE_POLLING_RETRIES); ++i) { - /* Wait max a second for thread to init */ - this_thread::sleep_for(chrono::milliseconds(CAPTURE_SERVICE_POLLING_DURATION)); + /* Poll to see if thread has been init, if so exit early. Add delay on every attempt */ + this_thread::sleep_for(chrono::milliseconds(duration)); + duration = min(duration + CAPTURE_SERVICE_POLLING_INCREMENT, CAPTURE_SERVICE_POLLING_MAX_DURATION); } RET_ON_ERR(m_cap_run, "Failed to init capture"); m_ctrl = ctrl; @@ -646,7 +649,8 @@ run_eventd_service() event_service service; stats_collector stats_instance; eventd_proxy *proxy = NULL; - capture_service *capture = NULL; + unique_ptr capture; + bool skip_caching = false; event_serialized_lst_t capture_fifo_events; last_events_t capture_last_events; @@ -676,9 +680,14 @@ run_eventd_service() * events until telemetry starts. * Telemetry will send a stop & collect cache upon startup */ - capture = new capture_service(zctx, cache_max, &stats_instance); - RET_ON_ERR(capture->set_control(INIT_CAPTURE) == 0, "Failed to init capture"); - RET_ON_ERR(capture->set_control(START_CAPTURE) == 0, "Failed to start capture"); + capture = make_unique(zctx, cache_max, &stats_instance); + if (capture->set_control(INIT_CAPTURE) != 0) { + SWSS_LOG_WARN("Failed to initialize capture service, so we skip caching"); + skip_caching = true; + capture.reset(); // Capture service will not be available + } else { + RET_ON_ERR(capture->set_control(START_CAPTURE) == 0, "Failed to start capture"); + } this_thread::sleep_for(chrono::milliseconds(200)); RET_ON_ERR(stats_instance.is_running(), "Failed to start stats instance"); @@ -694,12 +703,12 @@ run_eventd_service() case EVENT_CACHE_INIT: /* connect only*/ if (capture != NULL) { - delete capture; + capture.reset(); } event_serialized_lst_t().swap(capture_fifo_events); last_events_t().swap(capture_last_events); - capture = new capture_service(zctx, cache_max, &stats_instance); + capture = make_unique(zctx, cache_max, &stats_instance); if (capture != NULL) { resp = capture->set_control(INIT_CAPTURE); } @@ -708,7 +717,7 @@ run_eventd_service() case EVENT_CACHE_START: if (capture == NULL) { - SWSS_LOG_ERROR("Cache is not initialized to start"); + SWSS_LOG_WARN("Cache is not initialized to start"); resp = -1; break; } @@ -721,7 +730,7 @@ run_eventd_service() case EVENT_CACHE_STOP: if (capture == NULL) { - SWSS_LOG_ERROR("Cache is not initialized to stop"); + SWSS_LOG_WARN("Cache is not initialized to stop"); resp = -1; break; } @@ -731,8 +740,7 @@ run_eventd_service() resp = capture->read_cache(capture_fifo_events, capture_last_events, overflow); } - delete capture; - capture = NULL; + capture.reset(); /* Unpause heartbeat upon stop caching */ stats_instance.heartbeat_ctrl(); @@ -740,6 +748,11 @@ run_eventd_service() case EVENT_CACHE_READ: + if (skip_caching) { + SWSS_LOG_WARN("Capture service is unavailable, skipping cache read"); + resp = -1; + break; + } if (capture != NULL) { SWSS_LOG_ERROR("Cache is not stopped yet."); resp = -1; @@ -802,13 +815,10 @@ run_eventd_service() if (proxy != NULL) { delete proxy; } - if (capture != NULL) { - delete capture; - } if (zctx != NULL) { zmq_ctx_term(zctx); } - SWSS_LOG_ERROR("Eventd service exiting\n"); + SWSS_LOG_INFO("Eventd service exiting\n"); } void set_unit_testing(bool b) diff --git a/src/sonic-eventd/src/eventd.h b/src/sonic-eventd/src/eventd.h index a7a87f9436a0..960dfb8b8dc1 100644 --- a/src/sonic-eventd/src/eventd.h +++ b/src/sonic-eventd/src/eventd.h @@ -22,6 +22,8 @@ typedef enum { #define EVENTS_STATS_FIELD_NAME "value" #define STATS_HEARTBEAT_MIN 300 #define CAPTURE_SERVICE_POLLING_DURATION 10 +#define CAPTURE_SERVICE_POLLING_INCREMENT 10 +#define CAPTURE_SERVICE_POLLING_MAX_DURATION 100 #define CAPTURE_SERVICE_POLLING_RETRIES 100 /* From eaa3c234227a15e9ab2ab09c0c6e9d67cb4a458c Mon Sep 17 00:00:00 2001 From: James An <94036556+jamesan47@users.noreply.github.com> Date: Sun, 7 Apr 2024 16:21:42 -0700 Subject: [PATCH 228/419] Update cisco-8000.ini (#18584) --- platform/checkout/cisco-8000.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/checkout/cisco-8000.ini b/platform/checkout/cisco-8000.ini index ccda22289a97..c3883beb43e1 100644 --- a/platform/checkout/cisco-8000.ini +++ b/platform/checkout/cisco-8000.ini @@ -1,3 +1,3 @@ [module] repo=git@github.com:Cisco-8000-sonic/platform-cisco-8000.git -ref=202311.main.0.1 +ref=202311.main.0.2 From fb6bc61f9e5d0b9fa305bf915cffe0b0a6619943 Mon Sep 17 00:00:00 2001 From: Zhijian Li Date: Tue, 2 Apr 2024 23:16:32 +0800 Subject: [PATCH 229/419] [E1031] Ensure determine-reboot-cause start after platform fully initialized (#18526) 1031] Ensure determine-reboot-cause start after platform fully initialized --------- Co-authored-by: Xichen Lin --- .../haliburton/systemd/platform-modules-haliburton.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/broadcom/sonic-platform-modules-cel/haliburton/systemd/platform-modules-haliburton.service b/platform/broadcom/sonic-platform-modules-cel/haliburton/systemd/platform-modules-haliburton.service index bf1295038856..e2101a74aa88 100644 --- a/platform/broadcom/sonic-platform-modules-cel/haliburton/systemd/platform-modules-haliburton.service +++ b/platform/broadcom/sonic-platform-modules-cel/haliburton/systemd/platform-modules-haliburton.service @@ -2,7 +2,7 @@ [Unit] Description=Celestica haliburton platform modules After=local-fs.target -Before=pmon.service +Before=process-reboot-cause.service determine-reboot-cause.service pmon.service [Service] Type=oneshot From bd50f5b91042a3143648a1fe2f97c7c20412ffa0 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Mon, 8 Apr 2024 19:01:12 +0800 Subject: [PATCH 230/419] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#18587) #### Why I did it src/sonic-swss ``` * f83a0baf - (HEAD -> 202311, origin/202311) [fpmsyncd][WR] Relax the static schema constraint for ROUTE_TABLE (#2981) (#3067) (2 days ago) [Vivek] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index b8b1c08e070d..f83a0baf2484 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit b8b1c08e070d071c1c93bfcc9878d8179b09eade +Subproject commit f83a0baf248445a0e418e52258244132930f7e12 From c27964506ab0dddcaaec7410ffb15ebdce194241 Mon Sep 17 00:00:00 2001 From: Zain Budhwani <99770260+zbud-msft@users.noreply.github.com> Date: Thu, 25 Jan 2024 17:14:21 -0800 Subject: [PATCH 231/419] Remove echo log to /tmp/{$SERVICE}-debug.log in service_mgmt.sh (#17838) ### Why I did it Unnecessary for logs to be written out to /tmp/${SERVICE}-debug.log as they are already being written to syslog. Therefore, removing writing to a new log in concern for memory space and not being able to startup some services in RO state. ##### Work item tracking - Microsoft ADO **(number only)**:26458976 #### How I did it Remove DEBUGLOG definition and line that echo's message to mentioned log file. #### How to verify it Manually verified, /tmp/${SERVICE}-debug.log files do not exist and log for service starting still appears in syslog --- files/scripts/service_mgmt.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/files/scripts/service_mgmt.sh b/files/scripts/service_mgmt.sh index a3709bf2bf8b..6a038c0a35ce 100755 --- a/files/scripts/service_mgmt.sh +++ b/files/scripts/service_mgmt.sh @@ -3,7 +3,6 @@ function debug() { /usr/bin/logger $1 - /bin/echo `date` "- $1" >> ${DEBUGLOG} } function check_warm_boot() @@ -87,7 +86,6 @@ DEV=$2 SCRIPT_NAME=$(basename -- "$0") SERVICE="${SCRIPT_NAME%.*}" -DEBUGLOG="/tmp/$SERVICE-debug$DEV.log" NAMESPACE_PREFIX="asic" if [ "$DEV" ]; then NET_NS="$NAMESPACE_PREFIX$DEV" #name of the network namespace From 31bf7a8820dc2ef59b580c50c2b2b20b9e670221 Mon Sep 17 00:00:00 2001 From: "Marty Y. Lok" <76118573+mlok-nokia@users.noreply.github.com> Date: Wed, 21 Feb 2024 13:44:58 -0500 Subject: [PATCH 232/419] [service-checker] Fix the service-checker issue which is caused by PR17836 (#18109) PR #17836 added the container checking for database-chassis for Supervisor. But the related container_feature_dict[] is missing for the database-chassis. This causes the exception failure shows on Supervisor Signed-off-by: mlok --- src/system-health/health_checker/service_checker.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/system-health/health_checker/service_checker.py b/src/system-health/health_checker/service_checker.py index d2f245e70e0e..bc38bd43a929 100644 --- a/src/system-health/health_checker/service_checker.py +++ b/src/system-health/health_checker/service_checker.py @@ -102,6 +102,7 @@ def get_expected_running_containers(self, feature_table): if device_info.is_supervisor(): expected_running_containers.add("database-chassis") + container_feature_dict["database-chassis"] = "database" return expected_running_containers, container_feature_dict def get_current_running_containers(self): From 17d266d2a95b50870122b917a68dc3498d6f7401 Mon Sep 17 00:00:00 2001 From: Zhijian Li Date: Tue, 2 Apr 2024 23:21:04 +0800 Subject: [PATCH 233/419] [E1031] Update sonic_platform.sfp.Sfp class to fix xcvrd crash issue (#18495) * [E1031] Update sonic_platform class Sfp * Add implementation for get_eeprom_path --- .../x86_64-cel_e1031-r0/sonic_platform/sfp.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/sfp.py b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/sfp.py index 627fa8a7a1ee..249f611ec154 100644 --- a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/sfp.py +++ b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/sfp.py @@ -9,7 +9,7 @@ try: import time from ctypes import c_char - from sonic_platform_base.sfp_base import SfpBase + from sonic_platform_base.sonic_xcvr.sfp_optoe_base import SfpOptoeBase from sonic_platform_base.sonic_sfp.sff8472 import sff8472InterfaceId from sonic_platform_base.sonic_sfp.sff8472 import sff8472Dom from sonic_platform_base.sonic_sfp.sff8436 import sff8436InterfaceId @@ -157,7 +157,7 @@ PORT_END = 55 -class Sfp(SfpBase): +class Sfp(SfpOptoeBase): """Platform-specific Sfp class""" # Port I2C number @@ -172,7 +172,7 @@ class Sfp(SfpBase): PRS_PATH = "/sys/devices/platform/e1031.smc/SFP/sfp_modabs" def __init__(self, sfp_index, sfp_name): - SfpBase.__init__(self) + SfpOptoeBase.__init__(self) # Init common function self._api_common = Common() @@ -235,7 +235,7 @@ def _read_eeprom_specific_bytes(self, offset, num_bytes): 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] + sysfs_sfp_i2c_client_eeprom_path = self.get_eeprom_path() try: sysfsfile_eeprom = open( sysfs_sfp_i2c_client_eeprom_path, mode="rb", buffering=0) @@ -355,6 +355,9 @@ def _dom_capability_detect(self): self.dom_rx_power_supported = False self.dom_tx_power_supported = False + def get_eeprom_path(self): + return self.port_to_eeprom_mapping[self.port_num] + def get_transceiver_info(self): """ Retrieves transceiver info of this SFP @@ -1176,7 +1179,7 @@ def tx_disable(self, tx_disable): if self.dom_tx_disable_supported: # SFP status/control register at address A2h, byte 110 offset = 256 - sysfs_sfp_i2c_client_eeprom_path = self.port_to_eeprom_mapping[self.port_num] + sysfs_sfp_i2c_client_eeprom_path = self.get_eeprom_path() status_control_raw = self._read_eeprom_specific_bytes( (offset + SFP_STATUS_CONTROL_OFFSET), SFP_STATUS_CONTROL_WIDTH) if status_control_raw is not None: From 4fde0f315e149e3d5c73e5cfae6fbb714f70a3de Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Mon, 8 Apr 2024 14:14:18 -0700 Subject: [PATCH 234/419] [System Ready]Handle template value for feature table state field (#18411) * [System Ready]Handle template value for feature table state field --- .../health_checker/sysmonitor.py | 28 ++++++++++++++++++- src/system-health/tests/test_system_health.py | 15 +++++++++- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/src/system-health/health_checker/sysmonitor.py b/src/system-health/health_checker/sysmonitor.py index 3a2840e11a63..92777b256c94 100755 --- a/src/system-health/health_checker/sysmonitor.py +++ b/src/system-health/health_checker/sysmonitor.py @@ -10,8 +10,10 @@ from sonic_py_common.logger import Logger from . import utils from sonic_py_common.task_base import ProcessTaskBase +from sonic_py_common import device_info from .config import Config import signal +import jinja2 SYSLOG_IDENTIFIER = "system#monitor" REDIS_TIMEOUT_MS = 0 @@ -159,6 +161,26 @@ def get_all_service_list(self): dir_list.sort() return dir_list + def get_render_value_for_field(self, configuration, device_config, expected_values): + """ Returns the target value by rendering the configuration as J2 template. + + Args: + configuration (str): Table value from CONFIG_DB for given field + device_config (dict): DEVICE_METADATA section of CONFIG_DB and populated Device Running Metadata which is needed for rendering + expected_values (list): Expected set of values for given field + Returns: + (str): Target value for given key + """ + + if configuration is None: + return None + + template = jinja2.Template(configuration) + target_value = template.render(device_config) # nosemgrep: python.flask.security.xss.audit.direct-use-of-jinja2.direct-use-of-jinja2 + if target_value not in expected_values: + raise ValueError('Invalid value rendered for configuration {}: {}'.format(configuration, target_value)) + return target_value + def get_service_from_feature_table(self, dir_list): """Get service from CONFIG DB FEATURE table. During "config reload" command, filling FEATURE table is not an atomic operation, sonic-cfggen do it with two steps: @@ -178,12 +200,16 @@ def get_service_from_feature_table(self, dir_list): while max_retry > 0: success = True feature_table = self.config_db.get_table("FEATURE") + device_config = {} + device_config['DEVICE_METADATA'] = self.config_db.get_table('DEVICE_METADATA') + device_config.update(device_info.get_device_runtime_metadata()) for srv, fields in feature_table.items(): if 'state' not in fields: success = False logger.log_warning("FEATURE table is not fully ready: {}, retrying".format(feature_table)) break - if fields["state"] not in ["disabled", "always_disabled"]: + state = self.get_render_value_for_field(fields["state"], device_config, ['enabled', 'disabled', 'always_enabled', 'always_disabled']) + if state not in ["disabled", "always_disabled"]: srvext = srv + ".service" if srvext not in dir_list: dir_list.append(srvext) diff --git a/src/system-health/tests/test_system_health.py b/src/system-health/tests/test_system_health.py index 67f819ecc5ff..cd9a54e8799f 100644 --- a/src/system-health/tests/test_system_health.py +++ b/src/system-health/tests/test_system_health.py @@ -47,6 +47,7 @@ """ device_info.get_platform = MagicMock(return_value='unittest') +device_runtime_metadata = {"DEVICE_RUNTIME_METADATA": {"ETHERNET_PORTS_PRESENT":True}} def setup(): if os.path.exists(ServiceChecker.CRITICAL_PROCESS_CACHE): @@ -583,6 +584,7 @@ def test_utils(): @patch('docker.DockerClient') @patch('health_checker.utils.run_command') @patch('swsscommon.swsscommon.ConfigDBConnector') +@patch('sonic_py_common.device_info.get_device_runtime_metadata', MagicMock(return_value=device_runtime_metadata)) def test_get_all_service_list(mock_config_db, mock_run, mock_docker_client): mock_db_data = MagicMock() mock_get_table = MagicMock() @@ -841,6 +843,7 @@ def test_system_service(): sysmon.task_stop() +@patch('sonic_py_common.device_info.get_device_runtime_metadata', MagicMock(return_value=device_runtime_metadata)) def test_get_service_from_feature_table(): sysmon = Sysmonitor() sysmon.config_db = MagicMock() @@ -851,8 +854,18 @@ def test_get_service_from_feature_table(): 'swss': {} }, { - 'bgp': {'state': 'enabled'}, + 'localhost': { + 'type': 'ToRRouter' + } + }, + { + 'bgp': {'state': "{% if not (DEVICE_METADATA is defined and DEVICE_METADATA['localhost'] is defined and DEVICE_METADATA['localhost']['type'] is defined and DEVICE_METADATA['localhost']['type'] is not in ['ToRRouter', 'EPMS', 'MgmtTsToR', 'MgmtToRRouter', 'BmcMgmtToRRouter']) %}enabled{% else %}disabled{% endif %}"}, 'swss': {'state': 'disabled'} + }, + { + 'localhost': { + 'type': 'ToRRouter' + } } ] dir_list = [] From e6025b467b1e87fc7a9f22a9997e7b6a1706cc1a Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 9 Apr 2024 19:01:10 +0800 Subject: [PATCH 235/419] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#18603) #### Why I did it src/sonic-swss ``` * 344b28f3 - (HEAD -> 202311, origin/202311) Revert "[acl] Add IN_PORTS qualifier for L3 table (#3078)" (#3092) (16 hours ago) [Neetha John] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index f83a0baf2484..344b28f378a5 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit f83a0baf248445a0e418e52258244132930f7e12 +Subproject commit 344b28f378a54bf43cf2d8df00780c6cf62e9721 From 30d3eb62b490894ffe4cc09333d843b9b95943f9 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 9 Apr 2024 19:01:16 +0800 Subject: [PATCH 236/419] [submodule] Update submodule sonic-platform-daemons to the latest HEAD automatically (#18602) #### Why I did it src/sonic-platform-daemons ``` * 6d8ccbe - (HEAD -> 202311, origin/202311) [202311] Support to get MEDIA_SETTING and OPTICS_SI from both platform folder and HWSKU folder (#460) (20 minutes ago) [Kebo Liu] ``` #### How I did it #### How to verify it #### Description for the changelog --- 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 fa46abbafe22..6d8ccbe8d361 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit fa46abbafe22c4cbcaabe346120907e6e4347167 +Subproject commit 6d8ccbe8d36193efdd4d38690f36c7b6e54ec845 From 68a09914324a1a1a24c316be533db3552c586196 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 9 Apr 2024 19:01:26 +0800 Subject: [PATCH 237/419] [submodule] Update submodule sonic-gnmi to the latest HEAD automatically (#18600) #### Why I did it src/sonic-gnmi ``` * cf52c74 - (HEAD -> 202311, origin/202311) Replace PFC_WD_TABLE with PFC_WD (#173) (21 hours ago) [Zain Budhwani] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-gnmi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-gnmi b/src/sonic-gnmi index d59e436de44a..cf52c7453946 160000 --- a/src/sonic-gnmi +++ b/src/sonic-gnmi @@ -1 +1 @@ -Subproject commit d59e436de44a6aae156b1889d5a398e497be39a4 +Subproject commit cf52c7453946e273d10a7dcdc51df58d646c9adf From 5d35e6b5164c9bd87209e60d4b2cba3687ef7b6c Mon Sep 17 00:00:00 2001 From: ganglv <88995770+ganglyu@users.noreply.github.com> Date: Tue, 9 Apr 2024 07:29:10 +0800 Subject: [PATCH 238/419] Improve container checker for gnmi/telemetry container (#18529) ### Why I did it We have used gnmi container to replace telemetry container, and telemetry is still enabled after upgrade. container_checker script reads from features table and check if the container is running, telemetry is enabled but there's no telemetry container. It's difficult to disable telemetry in feature table for warm reboot and cold reboot, we need to check docker image in db migrator and minigraph.py. ### How I did it I modify container_checker script: If there's docker-sonic-telemetry image, check telemetry container. If there's no docker-sonic-telemetry image, check gnmi container instead. If there's no docker-sonic-telemetry image and docker-sonic-gnmi image, do not check telemetry. #### How to verify it Run end to end test with cold-reboot and warm-reboot. --- files/image_config/monit/container_checker | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/files/image_config/monit/container_checker b/files/image_config/monit/container_checker index f6be2cda9fcd..f4e4995060c8 100755 --- a/files/image_config/monit/container_checker +++ b/files/image_config/monit/container_checker @@ -25,6 +25,19 @@ from swsscommon import swsscommon EVENTS_PUBLISHER_SOURCE = "sonic-events-host" EVENTS_PUBLISHER_TAG = "event-down-ctr" +def check_docker_image(image_name): + """ + @summary: This function will check if docker image exists. + @return: True if the image exists, otherwise False. + """ + try: + DOCKER_CLIENT = docker.DockerClient(base_url='unix://var/run/docker.sock') + DOCKER_CLIENT.images.get(image_name) + return True + except (docker.errors.ImageNotFound, docker.errors.APIError) as err: + print("Failed to get image '{}'. Error: '{}'".format(image_name, err)) + return False + def get_expected_running_containers(): """ @summary: This function will get the expected running & always-enabled containers by following the rule: @@ -55,7 +68,24 @@ def get_expected_running_containers(): # it will be removed from exception list. run_all_instance_list = ['database', 'bgp'] + container_list = [] for container_name in feature_table.keys(): + # slim image does not have telemetry container and corresponding docker image + if container_name == "telemetry": + ret = check_docker_image("docker-sonic-telemetry") + if not ret: + # If telemetry container image is not present, check gnmi container image + # If gnmi container image is not present, ignore telemetry container check + # if gnmi container image is present, check gnmi container instead of telemetry + ret = check_docker_image("docker-sonic-gnmi") + if not ret: + print("Ignoring telemetry container check on image which has no corresponding docker image") + else: + container_list.append("gnmi") + continue + container_list.append(container_name) + + for container_name in container_list: if feature_table[container_name]["state"] not in ["disabled", "always_disabled"]: if multi_asic.is_multi_asic(): if feature_table[container_name].get("has_global_scope", "True") == "True": From 7de924f781d301a9eca3f0f635b2794be14aff6a Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 10 Apr 2024 16:01:01 +0800 Subject: [PATCH 239/419] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#18613) #### Why I did it src/sonic-swss ``` * 8fd34c1f - (HEAD -> 202311, origin/202311) Fix oper FEC retrieval after warmboot (#3100) (22 hours ago) [Sudharsan Dhamal Gopalarathnam] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 344b28f378a5..8fd34c1f7e1a 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 344b28f378a54bf43cf2d8df00780c6cf62e9721 +Subproject commit 8fd34c1f7e1aeecc2585a39e58ef4b02be7d7d07 From 201295185466dd3d5b049df7d076585ce824f606 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 10 Apr 2024 16:01:07 +0800 Subject: [PATCH 240/419] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#18605) #### Why I did it src/sonic-utilities ``` * 3db0245b - (HEAD -> 202311, origin/202311) [generate_dump] call hw-management-generate-dump.sh in collect_cisco_8000 (#2809) (2 days ago) [Geert Vlaemynck] * ea42cb9a - [show] multi-asic show running test residue (#3198) (2 days ago) [jingwenxie] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index a056e9d517ea..3db0245b0ac9 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit a056e9d517ea26a82afdcc2fc68e0359232a154f +Subproject commit 3db0245b0ac91dd6638a08d95a7a4427234627d4 From 4eba44fb07b57df9b3579acd10e511dc2b5c19b2 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:01:36 +0800 Subject: [PATCH 241/419] [submodule] Update submodule sonic-platform-daemons to the latest HEAD automatically (#18652) #### Why I did it src/sonic-platform-daemons ``` * 4ed4fa8 - (HEAD -> 202311, origin/202311) [202311] Fix intermittent build failure for test_SfpStateUpdateTask_task_run_stop (#461) (#464) (8 hours ago) [mihirpat1] ``` #### How I did it #### How to verify it #### Description for the changelog --- 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 6d8ccbe8d361..4ed4fa885a70 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit 6d8ccbe8d36193efdd4d38690f36c7b6e54ec845 +Subproject commit 4ed4fa885a70fc34a5411187bd9fcdae401eb5f8 From f6b04eb983eea804879693f3aa1dff51dd910c48 Mon Sep 17 00:00:00 2001 From: noaOrMlnx <58519608+noaOrMlnx@users.noreply.github.com> Date: Wed, 10 Apr 2024 11:28:36 +0300 Subject: [PATCH 242/419] Fix Module Detection Flow in modules_mgmt thread, to check power_on before power_good (#18593) - Why I did it Old flow checked power_good before powering-on the module. If the module is not powered, power_good will always remain 0 and flow will stop at the beginning. - How I did it Updated the state machine of MDF to have the right order. - How to verify it I added logs and made sure the right order is being executed. --- .../mlnx-platform-api/sonic_platform/modules_mgmt.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/modules_mgmt.py b/platform/mellanox/mlnx-platform-api/sonic_platform/modules_mgmt.py index ddc5ac599e03..448e0ca06809 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/modules_mgmt.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/modules_mgmt.py @@ -103,10 +103,10 @@ def __init__(self, namespaces=None, main_thread_stop_event=None, q=None): # SFPs state machine def get_sm_func(self, sm, port): SFP_SM_ENUM = {STATE_HW_NOT_PRESENT: self.check_if_hw_present - , STATE_HW_PRESENT: self.check_if_module_available - , STATE_MODULE_AVAILABLE: self.check_if_power_on + , STATE_HW_PRESENT: self.check_if_power_on , STATE_NOT_POWERED: self.power_on_module - , STATE_POWERED: self.check_module_type + , STATE_POWERED: self.check_if_module_available + , STATE_MODULE_AVAILABLE: self.check_module_type , STATE_FW_CONTROL: self.save_module_control_mode , STATE_SW_CONTROL: self.save_module_control_mode , STATE_ERROR_HANDLER: STATE_ERROR_HANDLER From 723cced1f5b2f8dadeb7ecedd99f49b56826067b Mon Sep 17 00:00:00 2001 From: DavidZagury <32644413+DavidZagury@users.noreply.github.com> Date: Tue, 9 Apr 2024 12:25:24 +0300 Subject: [PATCH 243/419] [Mellanox] enable host interface control by orchagent (#18592) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Why I did it To move the control of the netdevice’s operational status from SDK to SAI. SAI will be responsible for updating the operational status on moving the netdev’s admin status from DOWN to UP. - How I did it Configure the SAI profile with SAI_HOSTIF_OPER_STATUS_UPDATE_BY_APP - How to verify it Verify links go up and down correctly. --- platform/mellanox/docker-syncd-mlnx/sai-common.profile | 1 + 1 file changed, 1 insertion(+) diff --git a/platform/mellanox/docker-syncd-mlnx/sai-common.profile b/platform/mellanox/docker-syncd-mlnx/sai-common.profile index 3b9e6fe00573..d3b91a00e106 100644 --- a/platform/mellanox/docker-syncd-mlnx/sai-common.profile +++ b/platform/mellanox/docker-syncd-mlnx/sai-common.profile @@ -1,2 +1,3 @@ SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps SAI_DUMP_STORE_AMOUNT=10 +SAI_HOSTIF_OPER_STATUS_UPDATE_BY_APP=1 From 2ddfe13e06664cb3fc7e4af5816d50e8ff7e2ed2 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Sun, 7 Apr 2024 21:00:47 +0800 Subject: [PATCH 244/419] [Mellanox][SN2201] Fix wrong sfp number on SN2201 platform (#18413) - Why I did it For the SN2201 platform, it includes both RJ45 ports and SFP ports, in the recent new chassis.get_num_sfps() implementation, it only counts the number of SFP ports, however, as per the design, on this platform, RJ45 ports should also be counted to correctly initialize the SFP objects list inside the Chassis. The RJ45 ports are treated as a special type of SFP object in the Mellanox platform API implementation. - How I did it count both SFP ports number and RJ45 ports number in chassis.get_num_sfps(). - How to verify it run SFP-related sonic-mgmt tests on SN2201 and other Mellanox platforms and all the test pass. Signed-off-by: Kebo Liu --- .../mlnx-platform-api/sonic_platform/chassis.py | 10 ++++++++-- .../mellanox/mlnx-platform-api/tests/test_chassis.py | 9 ++++++++- 2 files changed, 16 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 5870d7e6b602..f216f6de2c36 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2023 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -329,7 +329,13 @@ def get_num_sfps(self): Returns: An integer, the number of sfps available on this chassis """ - return DeviceDataManager.get_sfp_count() + if not self._RJ45_port_inited: + self._RJ45_port_list = extract_RJ45_ports_index() + self._RJ45_port_inited = True + if self._RJ45_port_list is not None: + return DeviceDataManager.get_sfp_count() + len(self._RJ45_port_list) + else: + return DeviceDataManager.get_sfp_count() def get_all_sfps(self): """ diff --git a/platform/mellanox/mlnx-platform-api/tests/test_chassis.py b/platform/mellanox/mlnx-platform-api/tests/test_chassis.py index ffe86aaf3d08..ad23cd8dde85 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_chassis.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_chassis.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -169,6 +169,13 @@ def test_sfp(self): assert len(sfp_list) == 3 assert chassis.sfp_initialized_count == 3 + # Get all SFPs, with RJ45 ports + sonic_platform.chassis.extract_RJ45_ports_index = mock.MagicMock(return_value=[0,1,2]) + DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=3) + chassis = Chassis() + assert chassis.get_num_sfps() == 6 + sonic_platform.chassis.extract_RJ45_ports_index = mock.MagicMock(return_value=[]) + def test_create_sfp_in_multi_thread(self): DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=3) From ca44c9f67473a9c90fb1f859d8df02a8325aadda Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 13 Apr 2024 16:01:24 +0800 Subject: [PATCH 245/419] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#18673) #### Why I did it src/sonic-utilities ``` * 21f69fb5 - (HEAD -> 202311, origin/202311) [graceful reboot] Add watchdog, add execution of pre_reboot_hook, fix --force flag bug (#3204) (11 hours ago) [Vadym Hlushko] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index 3db0245b0ac9..21f69fb53892 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 3db0245b0ac91dd6638a08d95a7a4427234627d4 +Subproject commit 21f69fb53892e815daa89f66db778ad4c7cd6c77 From d3c42711f32b9b1997a18ea8032c4011c776ad88 Mon Sep 17 00:00:00 2001 From: Vivek Date: Mon, 15 Apr 2024 10:32:11 -0700 Subject: [PATCH 246/419] Update cache infra to be aware on non-upstream flag (#18569) --- rules/linux-kernel.dep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules/linux-kernel.dep b/rules/linux-kernel.dep index e577ca7f44c5..eab4e8391048 100644 --- a/rules/linux-kernel.dep +++ b/rules/linux-kernel.dep @@ -3,7 +3,7 @@ SPATH := $($(LINUX_HEADERS_COMMON)_SRC_PATH) 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) \ +DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) $(INCLUDE_EXTERNAL_PATCHES) \ $(KERNEL_PROCURE_METHOD) $(KERNEL_CACHE_PATH) $(SECURE_UPGRADE_MODE) $(SECURE_UPGRADE_SIGNING_CERT) $(LINUX_HEADERS_COMMON)_CACHE_MODE := GIT_CONTENT_SHA From e0f87535bf2d864e241e8263e629dd12eb6cbf4c Mon Sep 17 00:00:00 2001 From: Neetha John Date: Mon, 15 Apr 2024 08:52:30 -0700 Subject: [PATCH 247/419] Update backend acl template and unit tests (#18659) Signed-off-by: Neetha John --- files/build_templates/backend_acl.j2 | 19 ------------------- .../data/backend_acl/acl_multi_vlan.json | 14 -------------- .../data/backend_acl/acl_single_vlan.json | 7 ------- 3 files changed, 40 deletions(-) diff --git a/files/build_templates/backend_acl.j2 b/files/build_templates/backend_acl.j2 index f5468e6c12cb..7d4bf7cc1308 100644 --- a/files/build_templates/backend_acl.j2 +++ b/files/build_templates/backend_acl.j2 @@ -1,15 +1,3 @@ -{%- set vlan2ports = {} %} -{%- for vlan in VLAN %} - {% set portlist = [] %} - {%- for vlan_name, port in VLAN_MEMBER %} - {%- if vlan_name == vlan %} - {%- if portlist.append(port) %}{%- endif %} - {%- endif %} - {%- endfor %} - {%- set _ = vlan2ports.update({vlan: portlist| sort | join(',')}) %} -{%- endfor %} - - { "acl": { "acl-sets": { @@ -31,13 +19,6 @@ "config": { "vlan_id": "{{ vlan_entries['vlanid'] }}" } - }, - "input_interface": { - "interface_ref": { - "config": { - "interface": "{{ vlan2ports[vlan] }}" - } - } } }{% if not loop.last %},{% endif %} diff --git a/src/sonic-config-engine/tests/data/backend_acl/acl_multi_vlan.json b/src/sonic-config-engine/tests/data/backend_acl/acl_multi_vlan.json index 53cd50d0f2d1..32bd561b9467 100644 --- a/src/sonic-config-engine/tests/data/backend_acl/acl_multi_vlan.json +++ b/src/sonic-config-engine/tests/data/backend_acl/acl_multi_vlan.json @@ -19,13 +19,6 @@ "config": { "vlan_id": "1000" } - }, - "input_interface": { - "interface_ref": { - "config": { - "interface": "Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76" - } - } } }, "2": { @@ -41,13 +34,6 @@ "config": { "vlan_id": "2000" } - }, - "input_interface": { - "interface_ref": { - "config": { - "interface": "Ethernet4,Ethernet8" - } - } } } } diff --git a/src/sonic-config-engine/tests/data/backend_acl/acl_single_vlan.json b/src/sonic-config-engine/tests/data/backend_acl/acl_single_vlan.json index 86dcc80d08d1..fa132f65dc03 100644 --- a/src/sonic-config-engine/tests/data/backend_acl/acl_single_vlan.json +++ b/src/sonic-config-engine/tests/data/backend_acl/acl_single_vlan.json @@ -19,13 +19,6 @@ "config": { "vlan_id": "1000" } - }, - "input_interface": { - "interface_ref": { - "config": { - "interface": "Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet4,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet8" - } - } } } From baf6f62e12190f88f79dc10578aabfefc0cc69f6 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 18 Apr 2024 16:01:12 +0800 Subject: [PATCH 248/419] [submodule] Update submodule sonic-platform-daemons to the latest HEAD automatically (#18706) #### Why I did it src/sonic-platform-daemons ``` * d45b982 - (HEAD -> 202311, origin/202311) [chassis][linecard] Fix Module LINECARD<> went off-line message for empty slot issue (#462) (4 hours ago) [Marty Y. Lok] ``` #### How I did it #### How to verify it #### Description for the changelog --- 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 4ed4fa885a70..d45b982eef17 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit 4ed4fa885a70fc34a5411187bd9fcdae401eb5f8 +Subproject commit d45b982eef176f815eb2d80b56348c17b84e0616 From 2f9bc000166e30a5ffbb66eaba6b76def6103a73 Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Thu, 18 Apr 2024 02:29:23 -0700 Subject: [PATCH 249/419] [FRR]Adding fix for memory leak seen with BGP community (#18606) Porting PR #18272 to 202311. Why I did it Porting fix for FRRouting/frr#15459 Adding patch for PR FRRouting/frr#15466 Work item tracking Microsoft ADO (number only): How I did it Ported the fix FRRouting/frr#15466 to 8.5.1 How to verify it Running the test_stress_route and ensure no memory leak --- .../0037-bgp-community-memory-leak-fix.patch | 303 ++++++++++++++++++ src/sonic-frr/patch/series | 1 + 2 files changed, 304 insertions(+) create mode 100644 src/sonic-frr/patch/0037-bgp-community-memory-leak-fix.patch diff --git a/src/sonic-frr/patch/0037-bgp-community-memory-leak-fix.patch b/src/sonic-frr/patch/0037-bgp-community-memory-leak-fix.patch new file mode 100644 index 000000000000..8d1ff02d46bf --- /dev/null +++ b/src/sonic-frr/patch/0037-bgp-community-memory-leak-fix.patch @@ -0,0 +1,303 @@ +From 2b8e4e4b93a78e5884e2e5b97050b4ea3843e2e0 Mon Sep 17 00:00:00 2001 +From: Donald Sharp +Date: Thu, 7 Mar 2024 22:18:18 -0500 +Subject: [PATCH 1/2] bgpd: Combined patch to clean up filter leaks + +Customer has this valgrind trace: + +Direct leak of 2829120 byte(s) in 70728 object(s) allocated from: + 0 in community_new ../bgpd/bgp_community.c:39 + 1 in community_uniq_sort ../bgpd/bgp_community.c:170 + 2 in route_set_community ../bgpd/bgp_routemap.c:2342 + 3 in route_map_apply_ext ../lib/routemap.c:2673 + 4 in subgroup_announce_check ../bgpd/bgp_route.c:2367 + 5 in subgroup_process_announce_selected ../bgpd/bgp_route.c:2914 + 6 in group_announce_route_walkcb ../bgpd/bgp_updgrp_adv.c:199 + 7 in hash_walk ../lib/hash.c:285 + 8 in update_group_af_walk ../bgpd/bgp_updgrp.c:2061 + 9 in group_announce_route ../bgpd/bgp_updgrp_adv.c:1059 + 10 in bgp_process_main_one ../bgpd/bgp_route.c:3221 + 11 in bgp_process_wq ../bgpd/bgp_route.c:3221 + 12 in work_queue_run ../lib/workqueue.c:282 + +The above leak detected by valgrind was from a screenshot so I copied it +by hand. Any mistakes in line numbers are purely from my transcription. +Additionally this is against a slightly modified 8.5.1 version of FRR. +Code inspection of 8.5.1 -vs- latest master shows the same problem +exists. Code should be able to be followed from there to here. + +What is happening: + +There is a route-map being applied that modifes the outgoing community +to a peer. This is saved in the attr copy created in +subgroup_process_announce_selected. This community pointer is not +interned. So the community->refcount is still 0. Normally when +a prefix is announced, the attr and the prefix are placed on a +adjency out structure where the attribute is interned. This will +cause the community to be saved in the community hash list as well. +In a non-normal operation when the decision to send is aborted after +the route-map application, the attribute is just dropped and the +pointer to the community is just dropped too, leading to situations +where the memory is leaked. The usage of bgp suppress-fib would +would be a case where the community is caused to be leaked. +Additionally the previous commit where an unsuppress-map is used +to modify the outgoing attribute but since unsuppress-map was +not considered part of outgoing policy the attribute would be dropped as +well. This pointer drop also extends to any dynamically allocated +memory saved by the attribute pointer that was not interned yet as well. + +So let's modify the return case where the decision is made to +not send the prefix to the peer to always just flush the attribute +to ensure memory is not leaked. + +Fixes: #15459 +Signed-off-by: Donald Sharp +--- + bgpd/bgp_conditional_adv.c | 5 +++-- + bgpd/bgp_route.c | 19 +++++++++++------ + bgpd/bgp_updgrp.h | 2 +- + bgpd/bgp_updgrp_adv.c | 53 ++++++++++++++++++++++++++-------------------- + 4 files changed, 47 insertions(+), 32 deletions(-) + +diff --git a/bgpd/bgp_conditional_adv.c b/bgpd/bgp_conditional_adv.c +index 4ad00ed121..89ea85ff46 100644 +--- a/bgpd/bgp_conditional_adv.c ++++ b/bgpd/bgp_conditional_adv.c +@@ -134,8 +134,9 @@ static void bgp_conditional_adv_routes(struct peer *peer, afi_t afi, + if (update_type == UPDATE_TYPE_ADVERTISE && + subgroup_announce_check(dest, pi, subgrp, dest_p, + &attr, &advmap_attr)) { +- bgp_adj_out_set_subgroup(dest, subgrp, &attr, +- pi); ++ if (!bgp_adj_out_set_subgroup(dest, subgrp, ++ &attr, pi)) ++ bgp_attr_flush(&attr); + } else { + /* If default originate is enabled for + * the peer, do not send explicit +diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c +index a7a5c9849a..157bfa8a2b 100644 +--- a/bgpd/bgp_route.c ++++ b/bgpd/bgp_route.c +@@ -2917,16 +2917,23 @@ void subgroup_process_announce_selected(struct update_subgroup *subgrp, + * in FIB, then it is advertised + */ + if (advertise) { +- if (!bgp_check_withdrawal(bgp, dest)) +- bgp_adj_out_set_subgroup( +- dest, subgrp, &attr, selected); +- else ++ if (!bgp_check_withdrawal(bgp, dest)) { ++ if (!bgp_adj_out_set_subgroup( ++ dest, subgrp, &attr, ++ selected)) ++ bgp_attr_flush(&attr); ++ } else { + bgp_adj_out_unset_subgroup( + dest, subgrp, 1, addpath_tx_id); +- } +- } else ++ bgp_attr_flush(&attr); ++ } ++ } else ++ bgp_attr_flush(&attr); ++ } else { + bgp_adj_out_unset_subgroup(dest, subgrp, 1, + addpath_tx_id); ++ bgp_attr_flush(&attr); ++ } + } + + /* If selected is NULL we must withdraw the path using addpath_tx_id */ +diff --git a/bgpd/bgp_updgrp.h b/bgpd/bgp_updgrp.h +index e27c1e7b67..b7b6aa07e9 100644 +--- a/bgpd/bgp_updgrp.h ++++ b/bgpd/bgp_updgrp.h +@@ -458,7 +458,7 @@ extern struct bgp_adj_out *bgp_adj_out_alloc(struct update_subgroup *subgrp, + extern void bgp_adj_out_remove_subgroup(struct bgp_dest *dest, + struct bgp_adj_out *adj, + struct update_subgroup *subgrp); +-extern void bgp_adj_out_set_subgroup(struct bgp_dest *dest, ++extern bool bgp_adj_out_set_subgroup(struct bgp_dest *dest, + struct update_subgroup *subgrp, + struct attr *attr, + struct bgp_path_info *path); +diff --git a/bgpd/bgp_updgrp_adv.c b/bgpd/bgp_updgrp_adv.c +index af8ef751da..301a8b267e 100644 +--- a/bgpd/bgp_updgrp_adv.c ++++ b/bgpd/bgp_updgrp_adv.c +@@ -454,7 +454,7 @@ bgp_advertise_clean_subgroup(struct update_subgroup *subgrp, + return next; + } + +-void bgp_adj_out_set_subgroup(struct bgp_dest *dest, ++bool bgp_adj_out_set_subgroup(struct bgp_dest *dest, + struct update_subgroup *subgrp, struct attr *attr, + struct bgp_path_info *path) + { +@@ -474,7 +474,7 @@ void bgp_adj_out_set_subgroup(struct bgp_dest *dest, + bgp = SUBGRP_INST(subgrp); + + if (DISABLE_BGP_ANNOUNCE) +- return; ++ return false; + + /* Look for adjacency information. */ + adj = adj_lookup( +@@ -490,7 +490,7 @@ void bgp_adj_out_set_subgroup(struct bgp_dest *dest, + bgp_addpath_id_for_peer(peer, afi, safi, + &path->tx_addpath)); + if (!adj) +- return; ++ return false; + + subgrp->pscount++; + } +@@ -529,7 +529,7 @@ void bgp_adj_out_set_subgroup(struct bgp_dest *dest, + * will never be able to coalesce the 3rd peer down + */ + subgrp->version = MAX(subgrp->version, dest->version); +- return; ++ return false; + } + + if (adj->adv) +@@ -576,6 +576,8 @@ void bgp_adj_out_set_subgroup(struct bgp_dest *dest, + bgp_adv_fifo_add_tail(&subgrp->sync->update, adv); + + subgrp->version = MAX(subgrp->version, dest->version); ++ ++ return true; + } + + /* The only time 'withdraw' will be false is if we are sending +@@ -668,7 +670,7 @@ void subgroup_announce_table(struct update_subgroup *subgrp, + { + struct bgp_dest *dest; + struct bgp_path_info *ri; +- struct attr attr; ++ struct attr attr = {0}; + struct peer *peer; + afi_t afi; + safi_t safi; +@@ -715,19 +717,24 @@ void subgroup_announce_table(struct update_subgroup *subgrp, + &attr, NULL)) { + /* Check if route can be advertised */ + if (advertise) { +- if (!bgp_check_withdrawal(bgp, dest)) +- bgp_adj_out_set_subgroup( +- dest, subgrp, &attr, +- ri); +- else ++ if (!bgp_check_withdrawal(bgp, dest)) { ++ if (!bgp_adj_out_set_subgroup( ++ dest, subgrp, &attr, ++ ri)) ++ bgp_attr_flush(&attr); ++ } else { ++ bgp_attr_flush(&attr); + bgp_adj_out_unset_subgroup( + dest, subgrp, 1, + bgp_addpath_id_for_peer( + peer, afi, + safi_rib, + &ri->tx_addpath)); +- } ++ } ++ } else ++ bgp_attr_flush(&attr); + } else { ++ bgp_attr_flush(&attr); + /* If default originate is enabled for + * the peer, do not send explicit + * withdraw. This will prevent deletion +@@ -947,18 +954,18 @@ void subgroup_default_originate(struct update_subgroup *subgrp, int withdraw) + if (dest) { + for (pi = bgp_dest_get_bgp_path_info(dest); pi; + pi = pi->next) { +- if (CHECK_FLAG(pi->flags, BGP_PATH_SELECTED)) +- if (subgroup_announce_check( +- dest, pi, subgrp, +- bgp_dest_get_prefix(dest), +- &attr, NULL)) { +- struct attr *default_attr = +- bgp_attr_intern(&attr); +- +- bgp_adj_out_set_subgroup( +- dest, subgrp, +- default_attr, pi); +- } ++ if (!CHECK_FLAG(pi->flags, BGP_PATH_SELECTED)) ++ continue; ++ ++ if (subgroup_announce_check( ++ dest, pi, subgrp, ++ bgp_dest_get_prefix(dest), &attr, ++ NULL)) { ++ if (!bgp_adj_out_set_subgroup( ++ dest, subgrp, &attr, pi)) ++ bgp_attr_flush(&attr); ++ } else ++ bgp_attr_flush(&attr); + } + bgp_dest_unlock_node(dest); + } +-- +2.14.1 + + +From 761907075520aa3fae70a8d18fa717a24d3cbd65 Mon Sep 17 00:00:00 2001 +From: Donald Sharp +Date: Wed, 13 Mar 2024 10:26:58 -0400 +Subject: [PATCH 2/2] bgpd: Ensure that the correct aspath is free'd + +Currently in subgroup_default_originate the attr.aspath +is set in bgp_attr_default_set, which hashs the aspath +and creates a refcount for it. If this is a withdraw +the subgroup_announce_check and bgp_adj_out_set_subgroup +is called which will intern the attribute. This will +cause the the attr.aspath to be set to a new value +finally at the bottom of the function it intentionally +uninterns the aspath which is not the one that was +created for this function. This reduces the other +aspath's refcount by 1 and if a clear bgp * is issued +fast enough the aspath for that will be removed +and the system will crash. + +Signed-off-by: Donald Sharp +--- + bgpd/bgp_updgrp_adv.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/bgpd/bgp_updgrp_adv.c b/bgpd/bgp_updgrp_adv.c +index 301a8b267e..75e377f9a1 100644 +--- a/bgpd/bgp_updgrp_adv.c ++++ b/bgpd/bgp_updgrp_adv.c +@@ -817,6 +817,7 @@ void subgroup_default_originate(struct update_subgroup *subgrp, int withdraw) + struct bgp *bgp; + struct attr attr; + struct attr *new_attr = &attr; ++ struct aspath *aspath; + struct prefix p; + struct peer *from; + struct bgp_dest *dest; +@@ -854,6 +855,7 @@ void subgroup_default_originate(struct update_subgroup *subgrp, int withdraw) + /* make coverity happy */ + assert(attr.aspath); + ++ aspath = attr.aspath; + attr.med = 0; + attr.flag |= ATTR_FLAG_BIT(BGP_ATTR_MULTI_EXIT_DISC); + +@@ -1009,7 +1011,7 @@ void subgroup_default_originate(struct update_subgroup *subgrp, int withdraw) + } + } + +- aspath_unintern(&attr.aspath); ++ aspath_unintern(&aspath); + } + + /* +-- +2.14.1 + diff --git a/src/sonic-frr/patch/series b/src/sonic-frr/patch/series index 3c9c6e6acf25..fcc15bac8ffc 100644 --- a/src/sonic-frr/patch/series +++ b/src/sonic-frr/patch/series @@ -33,3 +33,4 @@ cross-compile-changes.patch 0034-fpm-Use-vrf_id-for-vrf-not-tabled_id.patch 0035-fpm-ignore-route-from-default-table.patch 0036-Add-support-of-bgp-l3vni-evpn.patch +0037-bgp-community-memory-leak-fix.patch From 1cb9dd5190fbca525e5f4e238dca4afa1cb1b052 Mon Sep 17 00:00:00 2001 From: Tejaswini Chadaga <85581939+tjchadaga@users.noreply.github.com> Date: Tue, 16 Apr 2024 21:08:28 -0700 Subject: [PATCH 250/419] Add dependency for tsa_enabled flag before populating peer config and bringing up BGP (#18556) Why I did it Ensure BGP peer bring-up and route advertisements are done only after checking TSA status during reload Work item tracking Microsoft ADO (number only): 27171112 How I did it Add dependency on tsa_enabled flag before peer configuration How to verify it Validate that the BGP session bring up is not complete until tsa_enabled flag is populated. Ensure no traffic is drawn to the device when in TSA and reboot with BGP unshut. --- src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py b/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py index b15f841f6166..306b33e32cc4 100644 --- a/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py +++ b/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py @@ -107,6 +107,7 @@ def __init__(self, common_objs, db_name, table_name, peer_type, check_neig_meta) deps = [ ("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME, "localhost/bgp_asn"), ("CONFIG_DB", swsscommon.CFG_LOOPBACK_INTERFACE_TABLE_NAME, "Loopback0"), + ("CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME, "tsa_enabled"), ("LOCAL", "local_addresses", ""), ("LOCAL", "interfaces", ""), ] From 09b0423cccfdf3a1c293cfb16a0466d071a5c1cc Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Sun, 14 Apr 2024 21:35:26 +0800 Subject: [PATCH 251/419] Support to fetch pmon_daemon_control.json file from both platform and HWSKU folders (#18441) - Why I did it The pmon_daemon_control.json file currently has a platform-specific scope, resulting in all SKUs of the same platform sharing the same pmon daemon configuration. Consequently, this restricts the ability to have distinct pmon daemon configurations for different SKUs. The proposed change aims to enhance flexibility by allowing PMON to load this file from both the platform folder and the HWSKU folder. In case a pmon_daemon_control.json file exists in the HWSKU folder, it will take precedence over the one in the platform folder. - How I did it The pmon docker init script will be updated to prioritize the HWSKU folder when searching for the pmon_daemon_control.json file. If the file is present in the HWSKU folder, it will be utilized. However, if the file does not exist in the HWSKU folder, the script will then fallback to utilizing the one located in the platform folder. - How to verify it Build image with this change, put the file in 1. platform folder, 2. in HWSKU folder 3. in both folders make sure the pmon daemons started according to the configuration. Signed-off-by: Kebo Liu --- dockers/docker-platform-monitor/docker_init.j2 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dockers/docker-platform-monitor/docker_init.j2 b/dockers/docker-platform-monitor/docker_init.j2 index d8667296efae..46766b5fd171 100755 --- a/dockers/docker-platform-monitor/docker_init.j2 +++ b/dockers/docker-platform-monitor/docker_init.j2 @@ -8,7 +8,6 @@ FANCONTROL_CONF_FILE="/usr/share/sonic/platform/fancontrol" SUPERVISOR_CONF_TEMPLATE="/usr/share/sonic/templates/docker-pmon.supervisord.conf.j2" SUPERVISOR_CONF_FILE="/etc/supervisor/conf.d/supervisord.conf" -PMON_DAEMON_CONTROL_FILE="/usr/share/sonic/platform/pmon_daemon_control.json" MODULAR_CHASSISDB_CONF_FILE="/usr/share/sonic/platform/chassisdb.conf" HAVE_SENSORS_CONF=0 @@ -17,6 +16,13 @@ IS_MODULAR_CHASSIS=0 # Default use python2 version SONIC_PLATFORM_API_PYTHON_VERSION=2 +if [ -e /usr/share/sonic/hwsku/pmon_daemon_control.json ]; +then + PMON_DAEMON_CONTROL_FILE="/usr/share/sonic/hwsku/pmon_daemon_control.json" +else + PMON_DAEMON_CONTROL_FILE="/usr/share/sonic/platform/pmon_daemon_control.json" +fi + declare -r EXIT_SUCCESS="0" if [ "${RUNTIME_OWNER}" == "" ]; then From f3ff2ef0264b77bab44b46d670e0030f418b8f4d Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Wed, 17 Apr 2024 09:03:17 -0500 Subject: [PATCH 252/419] Use the archive repo for Buster (#18678) Why I did it Buster is EOL, and the backports section has been removed from the main Debian repos. This also means that our default mirror (for non-snapshot builds) is also affected. Work item tracking Microsoft ADO (number only): 27691460 How I did it Change to using archive.debian.org directly for Buster. How to verify it --- scripts/build_mirror_config.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/build_mirror_config.sh b/scripts/build_mirror_config.sh index d6042da13c17..971390d0045f 100755 --- a/scripts/build_mirror_config.sh +++ b/scripts/build_mirror_config.sh @@ -25,6 +25,10 @@ if [ "$ARCHITECTURE" == "armhf" ]; then DEFAULT_MIRROR_SECURITY_URLS=http://deb.debian.org/debian-security/ fi +if [ "$DISTRIBUTION" == "buster" ]; then + DEFAULT_MIRROR_URLS=http://archive.debian.org/debian/ +fi + if [ "$MIRROR_SNAPSHOT" == y ]; then if [ -f "$MIRROR_VERSION_FILE" ]; then DEBIAN_TIMESTAMP=$(grep "^debian==" $MIRROR_VERSION_FILE | tail -n 1 | sed 's/.*==//') From a708980ea501627fbd801f977643a7d147e594d1 Mon Sep 17 00:00:00 2001 From: Neetha John Date: Thu, 18 Apr 2024 13:15:45 -0700 Subject: [PATCH 253/419] Restructure Arista-7260CX3-D92C16 hwsku to use common Th2 profile (#18687) * Restructure Arista-7260CX3-D92C16 hwsku to use common Th2 profile Signed-off-by: Neetha John --- .../Arista-7260CX3-D92C16 | 1 - .../Arista-7260CX3-D92C16/BALANCED | 1 + .../Arista-7260CX3-D92C16/RDMA-CENTRIC | 1 + .../Arista-7260CX3-D92C16/TCP-CENTRIC | 1 + .../Arista-7260CX3-D92C16/buffer_ports_t0.j2 | 21 + .../Arista-7260CX3-D92C16/buffers.json.j2 | 3 + .../buffers_defaults_t0.j2 | 1 + .../buffers_extra_queues.j2 | 38 + .../buffers_pool_sizes_t0.j2 | 8 + .../pg_profile_lookup.ini | 1 + .../Arista-7260CX3-D92C16/port_config.ini | 115 + .../Arista-7260CX3-D92C16/qos.json.j2 | 1 + .../Arista-7260CX3-D92C16/sai.profile | 1 + .../th2-a7260cx3-64-96x50G+16x100G.config.bcm | 925 ++++++++ .../tests/sample-arista-7260-t0-minigraph.xml | 1857 +++++++++++++++++ .../py2/buffer-arista7260-t0.json | 426 ++++ .../sample_output/py2/qos-arista7260-t0.json | 822 ++++++++ .../py3/buffer-arista7260-t0.json | 426 ++++ .../sample_output/py3/qos-arista7260-t0.json | 822 ++++++++ src/sonic-config-engine/tests/test_j2files.py | 6 + 20 files changed, 5476 insertions(+), 1 deletion(-) delete mode 120000 device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16 create mode 120000 device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/BALANCED create mode 120000 device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/RDMA-CENTRIC create mode 120000 device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/TCP-CENTRIC create mode 100644 device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/buffer_ports_t0.j2 create mode 100644 device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/buffers.json.j2 create mode 120000 device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/buffers_defaults_t0.j2 create mode 100644 device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/buffers_extra_queues.j2 create mode 100644 device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/buffers_pool_sizes_t0.j2 create mode 120000 device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/pg_profile_lookup.ini create mode 100644 device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/port_config.ini create mode 120000 device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/qos.json.j2 create mode 100644 device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/sai.profile create mode 100644 device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/th2-a7260cx3-64-96x50G+16x100G.config.bcm create mode 100644 src/sonic-config-engine/tests/sample-arista-7260-t0-minigraph.xml create mode 100644 src/sonic-config-engine/tests/sample_output/py2/buffer-arista7260-t0.json create mode 100644 src/sonic-config-engine/tests/sample_output/py2/qos-arista7260-t0.json create mode 100644 src/sonic-config-engine/tests/sample_output/py3/buffer-arista7260-t0.json create mode 100644 src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-t0.json diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16 deleted file mode 120000 index fd5bbe75f37c..000000000000 --- a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16 +++ /dev/null @@ -1 +0,0 @@ -Arista-7260CX3-D96C16 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/BALANCED b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/BALANCED new file mode 120000 index 000000000000..a270c70ffc36 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/BALANCED @@ -0,0 +1 @@ +../../../common/profiles/th2/7260/BALANCED \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/RDMA-CENTRIC b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/RDMA-CENTRIC new file mode 120000 index 000000000000..8d1ec6d277a8 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/RDMA-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/th2/7260/RDMA-CENTRIC \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/TCP-CENTRIC b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/TCP-CENTRIC new file mode 120000 index 000000000000..7ee783aac6a4 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/TCP-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/th2/7260/TCP-CENTRIC \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/buffer_ports_t0.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/buffer_ports_t0.j2 new file mode 100644 index 000000000000..7e4518bae963 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/buffer_ports_t0.j2 @@ -0,0 +1,21 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0,12) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{%- endif %} + {%- endfor %} + {%- for port_idx in range(12,20) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- endfor %} + {%- for port_idx in range(20,44) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{%- endif %} + {%- endfor %} + {%- for port_idx in range(44,52) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- endfor %} + {%- for port_idx in range(52,64) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/buffers.json.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/buffers.json.j2 new file mode 100644 index 000000000000..e6e9e844469b --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/buffers.json.j2 @@ -0,0 +1,3 @@ +{%- set default_topo = 't0' %} +{%- include 'buffers_config.j2' %} + diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..9524e6a476ac --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/buffers_extra_queues.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/buffers_extra_queues.j2 new file mode 100644 index 000000000000..3ad6c5b9bc9e --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/buffers_extra_queues.j2 @@ -0,0 +1,38 @@ +{% if DEVICE_METADATA is defined and 'type' in DEVICE_METADATA['localhost'] and +(DEVICE_METADATA['localhost']['type'] == 'LeafRouter' or DEVICE_METADATA['localhost']['subtype'] == 'DualToR') %} +{%- macro generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) %} + "BUFFER_QUEUE": { +{% for port in port_names.split(',') %} +{% if port in port_names_require_extra_buffer.split(',') %} + "{{ port }}|0-1": { + "profile" : "egress_lossy_profile" + }, + "{{ port }}|2-4": { + "profile" : "egress_lossless_profile" + }, + "{{ port }}|5": { + "profile" : "egress_lossy_profile" + }, + "{{ port }}|6": { + "profile" : "egress_lossless_profile" + }, + "{{ port }}|7": { + "profile" : "egress_lossy_profile" + }{% if not loop.last %},{% endif %} + +{% else %} + "{{ port }}|0-2": { + "profile" : "egress_lossy_profile" + }, + "{{ port }}|3-4": { + "profile" : "egress_lossless_profile" + }, + "{{ port }}|5-7": { + "profile" : "egress_lossy_profile" + }{% if not loop.last %},{% endif %} + +{% endif %} +{% endfor %} + } +{% endmacro %} +{% endif %} diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/buffers_pool_sizes_t0.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/buffers_pool_sizes_t0.j2 new file mode 100644 index 000000000000..bd82c947e4fc --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/buffers_pool_sizes_t0.j2 @@ -0,0 +1,8 @@ +{%- set ingress_lossless_pool_size = '33329088' %} +{%- set egress_lossy_pool_size = '26663272' %} + +{%- if ((SYSTEM_DEFAULTS is defined) and ('tunnel_qos_remap' in SYSTEM_DEFAULTS) and (SYSTEM_DEFAULTS['tunnel_qos_remap']['status'] == 'enabled')) and +((DEVICE_METADATA is defined) and ('localhost' in DEVICE_METADATA) and ('subtype' in DEVICE_METADATA['localhost']) and (DEVICE_METADATA['localhost']['subtype'] == 'DualToR')) %} + {%- set ingress_lossless_pool_size = '33169344' %} + {%- set egress_lossy_pool_size = '26535808' %} +{%- endif %} diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/pg_profile_lookup.ini b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/pg_profile_lookup.ini new file mode 120000 index 000000000000..297cddb2d223 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/pg_profile_lookup.ini @@ -0,0 +1 @@ +BALANCED/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/port_config.ini b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/port_config.ini new file mode 100644 index 000000000000..49bd6fd68856 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/port_config.ini @@ -0,0 +1,115 @@ +# name lanes alias index speed +Ethernet0 77,78 Ethernet1/1 1 50000 +Ethernet2 79,80 Ethernet1/3 1 50000 +Ethernet4 65,66 Ethernet2/1 2 50000 +Ethernet6 67,68 Ethernet2/3 2 50000 +Ethernet8 85,86 Ethernet3/1 3 50000 +Ethernet10 87,88 Ethernet3/3 3 50000 +Ethernet12 89,90 Ethernet4/1 4 50000 +Ethernet14 91,92 Ethernet4/3 4 50000 +Ethernet16 109,110 Ethernet5/1 5 50000 +Ethernet18 111,112 Ethernet5/3 5 50000 +Ethernet20 97,98 Ethernet6/1 6 50000 +Ethernet22 99,100 Ethernet6/3 6 50000 +Ethernet24 5,6 Ethernet7/1 7 50000 +Ethernet26 7,8 Ethernet7/3 7 50000 +Ethernet28 13,14 Ethernet8/1 8 50000 +Ethernet30 15,16 Ethernet8/3 8 50000 +Ethernet32 25,26 Ethernet9/1 9 50000 +Ethernet34 27,28 Ethernet9/3 9 50000 +Ethernet36 21,22 Ethernet10/1 10 50000 +Ethernet38 23,24 Ethernet10/3 10 50000 +Ethernet40 37,38 Ethernet11/1 11 50000 +Ethernet42 39,40 Ethernet11/3 11 50000 +Ethernet44 45,46 Ethernet12/1 12 50000 +Ethernet46 47,48 Ethernet12/3 12 50000 +Ethernet48 57,58,59,60 Ethernet13/1 13 100000 +Ethernet52 53,54,55,56 Ethernet14/1 14 100000 +Ethernet56 117,118,119,120 Ethernet15/1 15 100000 +Ethernet60 121,122,123,124 Ethernet16/1 16 100000 +Ethernet64 141,142,143,144 Ethernet17/1 17 100000 +Ethernet68 133,134,135,136 Ethernet18/1 18 100000 +Ethernet72 197,198,199,200 Ethernet19/1 19 100000 +Ethernet76 205,206,207,208 Ethernet20/1 20 100000 +Ethernet80 217,218 Ethernet21/1 21 50000 +Ethernet82 219,220 Ethernet21/3 21 50000 +Ethernet84 213,214 Ethernet22/1 22 50000 +Ethernet86 215,216 Ethernet22/3 22 50000 +Ethernet88 229,230 Ethernet23/1 23 50000 +Ethernet90 231,232 Ethernet23/3 23 50000 +Ethernet92 237,238 Ethernet24/1 24 50000 +Ethernet94 239,240 Ethernet24/3 24 50000 +Ethernet96 249,250 Ethernet25/1 25 50000 +Ethernet98 251,252 Ethernet25/3 25 50000 +Ethernet100 245,246 Ethernet26/1 26 50000 +Ethernet102 247,248 Ethernet26/3 26 50000 +Ethernet104 149,150 Ethernet27/1 27 50000 +Ethernet106 151,152 Ethernet27/3 27 50000 +Ethernet108 153,154 Ethernet28/1 28 50000 +Ethernet110 155,156 Ethernet28/3 28 50000 +Ethernet112 173,174 Ethernet29/1 29 50000 +Ethernet114 175,176 Ethernet29/3 29 50000 +Ethernet116 161,162 Ethernet30/1 30 50000 +Ethernet118 163,164 Ethernet30/3 30 50000 +Ethernet120 181,182 Ethernet31/1 31 50000 +Ethernet122 183,184 Ethernet31/3 31 50000 +Ethernet124 185,186 Ethernet32/1 32 50000 +Ethernet126 187,188 Ethernet32/3 32 50000 +Ethernet128 69,70 Ethernet33/1 33 50000 +Ethernet130 71,72 Ethernet33/3 33 50000 +Ethernet132 73,74 Ethernet34/1 34 50000 +Ethernet134 75,76 Ethernet34/3 34 50000 +Ethernet136 93,94 Ethernet35/1 35 50000 +Ethernet138 95,96 Ethernet35/3 35 50000 +Ethernet140 81,82 Ethernet36/1 36 50000 +Ethernet142 83,84 Ethernet36/3 36 50000 +Ethernet144 101,102 Ethernet37/1 37 50000 +Ethernet146 103,104 Ethernet37/3 37 50000 +Ethernet148 105,106 Ethernet38/1 38 50000 +Ethernet150 107,108 Ethernet38/3 38 50000 +Ethernet152 9,10 Ethernet39/1 39 50000 +Ethernet154 11,12 Ethernet39/3 39 50000 +Ethernet156 1,2 Ethernet40/1 40 50000 +Ethernet158 3,4 Ethernet40/3 40 50000 +Ethernet160 17,18 Ethernet41/1 41 50000 +Ethernet162 19,20 Ethernet41/3 41 50000 +Ethernet164 29,30 Ethernet42/1 42 50000 +Ethernet166 31,32 Ethernet42/3 42 50000 +Ethernet168 41,42 Ethernet43/1 43 50000 +Ethernet170 43,44 Ethernet43/3 43 50000 +Ethernet172 33,34 Ethernet44/1 44 50000 +Ethernet174 35,36 Ethernet44/3 44 50000 +Ethernet176 49,50,51,52 Ethernet45/1 45 100000 +Ethernet180 61,62,63,64 Ethernet46/1 46 100000 +Ethernet184 125,126,127,128 Ethernet47/1 47 100000 +Ethernet188 113,114,115,116 Ethernet48/1 48 100000 +Ethernet192 129,130,131,132 Ethernet49/1 49 100000 +Ethernet196 137,138,139,140 Ethernet50/1 50 100000 +Ethernet200 201,202,203,204 Ethernet51/1 51 100000 +Ethernet204 193,194,195,196 Ethernet52/1 52 100000 +Ethernet208 209,210 Ethernet53/1 53 50000 +Ethernet210 211,212 Ethernet53/3 53 50000 +Ethernet212 221,222 Ethernet54/1 54 50000 +Ethernet214 223,224 Ethernet54/3 54 50000 +Ethernet216 233,234 Ethernet55/1 55 50000 +Ethernet218 235,236 Ethernet55/3 55 50000 +Ethernet220 225,226 Ethernet56/1 56 50000 +Ethernet222 227,228 Ethernet56/3 56 50000 +Ethernet224 241,242 Ethernet57/1 57 50000 +Ethernet226 243,244 Ethernet57/3 57 50000 +Ethernet228 253,254 Ethernet58/1 58 50000 +Ethernet230 255,256 Ethernet58/3 58 50000 +Ethernet232 157,158 Ethernet59/1 59 50000 +Ethernet234 159,160 Ethernet59/3 59 50000 +Ethernet236 145,146 Ethernet60/1 60 50000 +Ethernet238 147,148 Ethernet60/3 60 50000 +Ethernet240 165,166 Ethernet61/1 61 50000 +Ethernet242 167,168 Ethernet61/3 61 50000 +Ethernet244 169,170 Ethernet62/1 62 50000 +Ethernet246 171,172 Ethernet62/3 62 50000 +Ethernet248 189,190 Ethernet63/1 63 50000 +Ethernet250 191,192 Ethernet63/3 63 50000 +Ethernet252 177,178 Ethernet64/1 64 50000 +Ethernet254 179,180 Ethernet64/3 64 50000 +Ethernet256 257 Ethernet65 65 10000 +Ethernet260 259 Ethernet66 66 10000 diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/qos.json.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/qos.json.j2 new file mode 120000 index 000000000000..aef6b6765cf2 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/qos.json.j2 @@ -0,0 +1 @@ +BALANCED/qos.json.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/sai.profile b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/sai.profile new file mode 100644 index 000000000000..d18e31d2c2a4 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/sai.profile @@ -0,0 +1 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th2-a7260cx3-64-96x50G+16x100G.config.bcm diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/th2-a7260cx3-64-96x50G+16x100G.config.bcm b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/th2-a7260cx3-64-96x50G+16x100G.config.bcm new file mode 100644 index 000000000000..5a298ed9bc7b --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16/th2-a7260cx3-64-96x50G+16x100G.config.bcm @@ -0,0 +1,925 @@ +sai_tunnel_support=1 +l3_alpm_hit_skip=1 +sai_adjust_acl_drop_in_rx_drop=1 +PHY_AN_ALLOW_PLL_CHANGE=1 +arl_clean_timeout_usec=15000000 +asf_mem_profile=2 +bcm_num_cos=10 +bcm_stat_flags=1 +bcm_stat_jumbo=9236 +cdma_timeout_usec=15000000 +core_clock_frequency=1700 +dma_desc_timeout_usec=15000000 +dpp_clock_ratio=2:3 +higig2_hdr_mode=1 +ipv6_lpm_128b_enable=1 +l3_alpm_enable=2 +lpm_scaling_enable=0 +l2xmsg_mode=1 +max_vp_lags=0 +mem_scan_enable=1 +miim_intr_enable=0 +module_64ports=1 +os=unix +oversubscribe_mode=1 +pbmp_xport_xe=0xfffffffd3fffffff4fffffffc7ffffffe +#pbmp_xport_xe=0x47fffffff1fffffffcfffffffe7ffffffe +phy_an_allow_pll_change_hg=0 +phy_an_c73=1 +phy_chain_rx_lane_map_physical{1.0}=0x3210 +phy_chain_rx_lane_map_physical{101.0}=0x0123 +phy_chain_rx_lane_map_physical{105.0}=0x0123 +phy_chain_rx_lane_map_physical{109.0}=0x0123 +phy_chain_rx_lane_map_physical{113.0}=0x2301 +phy_chain_rx_lane_map_physical{117.0}=0x3210 +phy_chain_rx_lane_map_physical{121.0}=0x3210 +phy_chain_rx_lane_map_physical{125.0}=0x1203 +phy_chain_rx_lane_map_physical{129.0}=0x3210 +phy_chain_rx_lane_map_physical{13.0}=0x0321 +phy_chain_rx_lane_map_physical{133.0}=0x1032 +phy_chain_rx_lane_map_physical{137.0}=0x3210 +phy_chain_rx_lane_map_physical{141.0}=0x0123 +phy_chain_rx_lane_map_physical{145.0}=0x3210 +phy_chain_rx_lane_map_physical{149.0}=0x2310 +phy_chain_rx_lane_map_physical{153.0}=0x0132 +phy_chain_rx_lane_map_physical{157.0}=0x1302 +phy_chain_rx_lane_map_physical{161.0}=0x3021 +phy_chain_rx_lane_map_physical{165.0}=0x2031 +phy_chain_rx_lane_map_physical{169.0}=0x2031 +phy_chain_rx_lane_map_physical{17.0}=0x3210 +phy_chain_rx_lane_map_physical{173.0}=0x1302 +phy_chain_rx_lane_map_physical{177.0}=0x2031 +phy_chain_rx_lane_map_physical{181.0}=0x0213 +phy_chain_rx_lane_map_physical{185.0}=0x0213 +phy_chain_rx_lane_map_physical{189.0}=0x1302 +phy_chain_rx_lane_map_physical{193.0}=0x3120 +phy_chain_rx_lane_map_physical{197.0}=0x0231 +phy_chain_rx_lane_map_physical{201.0}=0x2031 +phy_chain_rx_lane_map_physical{205.0}=0x0213 +phy_chain_rx_lane_map_physical{209.0}=0x2013 +phy_chain_rx_lane_map_physical{21.0}=0x3021 +phy_chain_rx_lane_map_physical{213.0}=0x3021 +phy_chain_rx_lane_map_physical{217.0}=0x0231 +phy_chain_rx_lane_map_physical{221.0}=0x2031 +phy_chain_rx_lane_map_physical{225.0}=0x1203 +phy_chain_rx_lane_map_physical{229.0}=0x1230 +phy_chain_rx_lane_map_physical{233.0}=0x3021 +phy_chain_rx_lane_map_physical{237.0}=0x1032 +phy_chain_rx_lane_map_physical{241.0}=0x2301 +phy_chain_rx_lane_map_physical{245.0}=0x0321 +phy_chain_rx_lane_map_physical{249.0}=0x2301 +phy_chain_rx_lane_map_physical{25.0}=0x2301 +phy_chain_rx_lane_map_physical{253.0}=0x2301 +phy_chain_rx_lane_map_physical{257.0}=0x3210 +phy_chain_rx_lane_map_physical{29.0}=0x3021 +phy_chain_rx_lane_map_physical{33.0}=0x1302 +phy_chain_rx_lane_map_physical{37.0}=0x2031 +phy_chain_rx_lane_map_physical{41.0}=0x3021 +phy_chain_rx_lane_map_physical{45.0}=0x1023 +phy_chain_rx_lane_map_physical{49.0}=0x0213 +phy_chain_rx_lane_map_physical{5.0}=0x3201 +phy_chain_rx_lane_map_physical{53.0}=0x3201 +phy_chain_rx_lane_map_physical{57.0}=0x2013 +phy_chain_rx_lane_map_physical{61.0}=0x0213 +phy_chain_rx_lane_map_physical{65.0}=0x1203 +phy_chain_rx_lane_map_physical{69.0}=0x0213 +phy_chain_rx_lane_map_physical{73.0}=0x0213 +phy_chain_rx_lane_map_physical{77.0}=0x3120 +phy_chain_rx_lane_map_physical{81.0}=0x0213 +phy_chain_rx_lane_map_physical{85.0}=0x2031 +phy_chain_rx_lane_map_physical{89.0}=0x2031 +phy_chain_rx_lane_map_physical{9.0}=0x0321 +phy_chain_rx_lane_map_physical{93.0}=0x3120 +phy_chain_rx_lane_map_physical{97.0}=0x1203 +phy_chain_rx_polarity_flip_physical{1.0}=0x1 +phy_chain_rx_polarity_flip_physical{10.0}=0x0 +phy_chain_rx_polarity_flip_physical{100.0}=0x1 +phy_chain_rx_polarity_flip_physical{101.0}=0x1 +phy_chain_rx_polarity_flip_physical{102.0}=0x0 +phy_chain_rx_polarity_flip_physical{103.0}=0x1 +phy_chain_rx_polarity_flip_physical{104.0}=0x0 +phy_chain_rx_polarity_flip_physical{105.0}=0x1 +phy_chain_rx_polarity_flip_physical{106.0}=0x0 +phy_chain_rx_polarity_flip_physical{107.0}=0x1 +phy_chain_rx_polarity_flip_physical{108.0}=0x0 +phy_chain_rx_polarity_flip_physical{109.0}=0x0 +phy_chain_rx_polarity_flip_physical{11.0}=0x1 +phy_chain_rx_polarity_flip_physical{110.0}=0x1 +phy_chain_rx_polarity_flip_physical{111.0}=0x0 +phy_chain_rx_polarity_flip_physical{112.0}=0x1 +phy_chain_rx_polarity_flip_physical{113.0}=0x1 +phy_chain_rx_polarity_flip_physical{114.0}=0x0 +phy_chain_rx_polarity_flip_physical{115.0}=0x1 +phy_chain_rx_polarity_flip_physical{116.0}=0x0 +phy_chain_rx_polarity_flip_physical{117.0}=0x0 +phy_chain_rx_polarity_flip_physical{118.0}=0x0 +phy_chain_rx_polarity_flip_physical{119.0}=0x1 +phy_chain_rx_polarity_flip_physical{12.0}=0x1 +phy_chain_rx_polarity_flip_physical{120.0}=0x0 +phy_chain_rx_polarity_flip_physical{121.0}=0x1 +phy_chain_rx_polarity_flip_physical{122.0}=0x0 +phy_chain_rx_polarity_flip_physical{123.0}=0x1 +phy_chain_rx_polarity_flip_physical{124.0}=0x0 +phy_chain_rx_polarity_flip_physical{125.0}=0x0 +phy_chain_rx_polarity_flip_physical{126.0}=0x1 +phy_chain_rx_polarity_flip_physical{127.0}=0x1 +phy_chain_rx_polarity_flip_physical{128.0}=0x1 +phy_chain_rx_polarity_flip_physical{129.0}=0x0 +phy_chain_rx_polarity_flip_physical{13.0}=0x1 +phy_chain_rx_polarity_flip_physical{130.0}=0x1 +phy_chain_rx_polarity_flip_physical{131.0}=0x1 +phy_chain_rx_polarity_flip_physical{132.0}=0x0 +phy_chain_rx_polarity_flip_physical{133.0}=0x1 +phy_chain_rx_polarity_flip_physical{134.0}=0x1 +phy_chain_rx_polarity_flip_physical{135.0}=0x1 +phy_chain_rx_polarity_flip_physical{136.0}=0x0 +phy_chain_rx_polarity_flip_physical{137.0}=0x0 +phy_chain_rx_polarity_flip_physical{138.0}=0x0 +phy_chain_rx_polarity_flip_physical{139.0}=0x1 +phy_chain_rx_polarity_flip_physical{14.0}=0x0 +phy_chain_rx_polarity_flip_physical{140.0}=0x0 +phy_chain_rx_polarity_flip_physical{141.0}=0x1 +phy_chain_rx_polarity_flip_physical{142.0}=0x0 +phy_chain_rx_polarity_flip_physical{143.0}=0x1 +phy_chain_rx_polarity_flip_physical{144.0}=0x0 +phy_chain_rx_polarity_flip_physical{145.0}=0x1 +phy_chain_rx_polarity_flip_physical{146.0}=0x0 +phy_chain_rx_polarity_flip_physical{147.0}=0x1 +phy_chain_rx_polarity_flip_physical{148.0}=0x0 +phy_chain_rx_polarity_flip_physical{149.0}=0x0 +phy_chain_rx_polarity_flip_physical{15.0}=0x1 +phy_chain_rx_polarity_flip_physical{150.0}=0x1 +phy_chain_rx_polarity_flip_physical{151.0}=0x1 +phy_chain_rx_polarity_flip_physical{152.0}=0x0 +phy_chain_rx_polarity_flip_physical{153.0}=0x0 +phy_chain_rx_polarity_flip_physical{154.0}=0x1 +phy_chain_rx_polarity_flip_physical{155.0}=0x1 +phy_chain_rx_polarity_flip_physical{156.0}=0x0 +phy_chain_rx_polarity_flip_physical{157.0}=0x0 +phy_chain_rx_polarity_flip_physical{158.0}=0x0 +phy_chain_rx_polarity_flip_physical{159.0}=0x1 +phy_chain_rx_polarity_flip_physical{16.0}=0x0 +phy_chain_rx_polarity_flip_physical{160.0}=0x0 +phy_chain_rx_polarity_flip_physical{161.0}=0x1 +phy_chain_rx_polarity_flip_physical{162.0}=0x1 +phy_chain_rx_polarity_flip_physical{163.0}=0x0 +phy_chain_rx_polarity_flip_physical{164.0}=0x1 +phy_chain_rx_polarity_flip_physical{165.0}=0x0 +phy_chain_rx_polarity_flip_physical{166.0}=0x0 +phy_chain_rx_polarity_flip_physical{167.0}=0x1 +phy_chain_rx_polarity_flip_physical{168.0}=0x1 +phy_chain_rx_polarity_flip_physical{169.0}=0x1 +phy_chain_rx_polarity_flip_physical{17.0}=0x1 +phy_chain_rx_polarity_flip_physical{170.0}=0x1 +phy_chain_rx_polarity_flip_physical{171.0}=0x0 +phy_chain_rx_polarity_flip_physical{172.0}=0x0 +phy_chain_rx_polarity_flip_physical{173.0}=0x0 +phy_chain_rx_polarity_flip_physical{174.0}=0x0 +phy_chain_rx_polarity_flip_physical{175.0}=0x1 +phy_chain_rx_polarity_flip_physical{176.0}=0x1 +phy_chain_rx_polarity_flip_physical{177.0}=0x1 +phy_chain_rx_polarity_flip_physical{178.0}=0x1 +phy_chain_rx_polarity_flip_physical{179.0}=0x0 +phy_chain_rx_polarity_flip_physical{18.0}=0x0 +phy_chain_rx_polarity_flip_physical{180.0}=0x0 +phy_chain_rx_polarity_flip_physical{181.0}=0x1 +phy_chain_rx_polarity_flip_physical{182.0}=0x1 +phy_chain_rx_polarity_flip_physical{183.0}=0x0 +phy_chain_rx_polarity_flip_physical{184.0}=0x0 +phy_chain_rx_polarity_flip_physical{185.0}=0x0 +phy_chain_rx_polarity_flip_physical{186.0}=0x0 +phy_chain_rx_polarity_flip_physical{187.0}=0x1 +phy_chain_rx_polarity_flip_physical{188.0}=0x1 +phy_chain_rx_polarity_flip_physical{189.0}=0x0 +phy_chain_rx_polarity_flip_physical{19.0}=0x1 +phy_chain_rx_polarity_flip_physical{190.0}=0x0 +phy_chain_rx_polarity_flip_physical{191.0}=0x1 +phy_chain_rx_polarity_flip_physical{192.0}=0x0 +phy_chain_rx_polarity_flip_physical{193.0}=0x0 +phy_chain_rx_polarity_flip_physical{194.0}=0x0 +phy_chain_rx_polarity_flip_physical{195.0}=0x1 +phy_chain_rx_polarity_flip_physical{196.0}=0x1 +phy_chain_rx_polarity_flip_physical{197.0}=0x1 +phy_chain_rx_polarity_flip_physical{198.0}=0x1 +phy_chain_rx_polarity_flip_physical{199.0}=0x0 +phy_chain_rx_polarity_flip_physical{2.0}=0x0 +phy_chain_rx_polarity_flip_physical{20.0}=0x0 +phy_chain_rx_polarity_flip_physical{200.0}=0x0 +phy_chain_rx_polarity_flip_physical{201.0}=0x0 +phy_chain_rx_polarity_flip_physical{202.0}=0x0 +phy_chain_rx_polarity_flip_physical{203.0}=0x1 +phy_chain_rx_polarity_flip_physical{204.0}=0x0 +phy_chain_rx_polarity_flip_physical{205.0}=0x1 +phy_chain_rx_polarity_flip_physical{206.0}=0x1 +phy_chain_rx_polarity_flip_physical{207.0}=0x0 +phy_chain_rx_polarity_flip_physical{208.0}=0x0 +phy_chain_rx_polarity_flip_physical{209.0}=0x1 +phy_chain_rx_polarity_flip_physical{21.0}=0x0 +phy_chain_rx_polarity_flip_physical{210.0}=0x1 +phy_chain_rx_polarity_flip_physical{211.0}=0x0 +phy_chain_rx_polarity_flip_physical{212.0}=0x0 +phy_chain_rx_polarity_flip_physical{213.0}=0x0 +phy_chain_rx_polarity_flip_physical{214.0}=0x0 +phy_chain_rx_polarity_flip_physical{215.0}=0x1 +phy_chain_rx_polarity_flip_physical{216.0}=0x0 +phy_chain_rx_polarity_flip_physical{217.0}=0x0 +phy_chain_rx_polarity_flip_physical{218.0}=0x0 +phy_chain_rx_polarity_flip_physical{219.0}=0x1 +phy_chain_rx_polarity_flip_physical{22.0}=0x0 +phy_chain_rx_polarity_flip_physical{220.0}=0x1 +phy_chain_rx_polarity_flip_physical{221.0}=0x0 +phy_chain_rx_polarity_flip_physical{222.0}=0x0 +phy_chain_rx_polarity_flip_physical{223.0}=0x1 +phy_chain_rx_polarity_flip_physical{224.0}=0x1 +phy_chain_rx_polarity_flip_physical{225.0}=0x1 +phy_chain_rx_polarity_flip_physical{226.0}=0x0 +phy_chain_rx_polarity_flip_physical{227.0}=0x0 +phy_chain_rx_polarity_flip_physical{228.0}=0x1 +phy_chain_rx_polarity_flip_physical{229.0}=0x0 +phy_chain_rx_polarity_flip_physical{23.0}=0x1 +phy_chain_rx_polarity_flip_physical{230.0}=0x0 +phy_chain_rx_polarity_flip_physical{231.0}=0x1 +phy_chain_rx_polarity_flip_physical{232.0}=0x1 +phy_chain_rx_polarity_flip_physical{233.0}=0x1 +phy_chain_rx_polarity_flip_physical{234.0}=0x0 +phy_chain_rx_polarity_flip_physical{235.0}=0x0 +phy_chain_rx_polarity_flip_physical{236.0}=0x0 +phy_chain_rx_polarity_flip_physical{237.0}=0x1 +phy_chain_rx_polarity_flip_physical{238.0}=0x0 +phy_chain_rx_polarity_flip_physical{239.0}=0x1 +phy_chain_rx_polarity_flip_physical{24.0}=0x0 +phy_chain_rx_polarity_flip_physical{240.0}=0x0 +phy_chain_rx_polarity_flip_physical{241.0}=0x1 +phy_chain_rx_polarity_flip_physical{242.0}=0x0 +phy_chain_rx_polarity_flip_physical{243.0}=0x1 +phy_chain_rx_polarity_flip_physical{244.0}=0x0 +phy_chain_rx_polarity_flip_physical{245.0}=0x1 +phy_chain_rx_polarity_flip_physical{246.0}=0x1 +phy_chain_rx_polarity_flip_physical{247.0}=0x1 +phy_chain_rx_polarity_flip_physical{248.0}=0x0 +phy_chain_rx_polarity_flip_physical{249.0}=0x0 +phy_chain_rx_polarity_flip_physical{25.0}=0x1 +phy_chain_rx_polarity_flip_physical{250.0}=0x1 +phy_chain_rx_polarity_flip_physical{251.0}=0x0 +phy_chain_rx_polarity_flip_physical{252.0}=0x1 +phy_chain_rx_polarity_flip_physical{253.0}=0x1 +phy_chain_rx_polarity_flip_physical{254.0}=0x0 +phy_chain_rx_polarity_flip_physical{255.0}=0x1 +phy_chain_rx_polarity_flip_physical{256.0}=0x0 +phy_chain_rx_polarity_flip_physical{257.0}=0x0 +phy_chain_rx_polarity_flip_physical{259.0}=0x0 +phy_chain_rx_polarity_flip_physical{26.0}=0x0 +phy_chain_rx_polarity_flip_physical{27.0}=0x1 +phy_chain_rx_polarity_flip_physical{28.0}=0x0 +phy_chain_rx_polarity_flip_physical{29.0}=0x0 +phy_chain_rx_polarity_flip_physical{3.0}=0x1 +phy_chain_rx_polarity_flip_physical{30.0}=0x0 +phy_chain_rx_polarity_flip_physical{31.0}=0x0 +phy_chain_rx_polarity_flip_physical{32.0}=0x1 +phy_chain_rx_polarity_flip_physical{33.0}=0x0 +phy_chain_rx_polarity_flip_physical{34.0}=0x0 +phy_chain_rx_polarity_flip_physical{35.0}=0x1 +phy_chain_rx_polarity_flip_physical{36.0}=0x1 +phy_chain_rx_polarity_flip_physical{37.0}=0x1 +phy_chain_rx_polarity_flip_physical{38.0}=0x1 +phy_chain_rx_polarity_flip_physical{39.0}=0x0 +phy_chain_rx_polarity_flip_physical{4.0}=0x0 +phy_chain_rx_polarity_flip_physical{40.0}=0x0 +phy_chain_rx_polarity_flip_physical{41.0}=0x0 +phy_chain_rx_polarity_flip_physical{42.0}=0x1 +phy_chain_rx_polarity_flip_physical{43.0}=0x1 +phy_chain_rx_polarity_flip_physical{44.0}=0x1 +phy_chain_rx_polarity_flip_physical{45.0}=0x1 +phy_chain_rx_polarity_flip_physical{46.0}=0x0 +phy_chain_rx_polarity_flip_physical{47.0}=0x0 +phy_chain_rx_polarity_flip_physical{48.0}=0x1 +phy_chain_rx_polarity_flip_physical{49.0}=0x1 +phy_chain_rx_polarity_flip_physical{5.0}=0x1 +phy_chain_rx_polarity_flip_physical{50.0}=0x1 +phy_chain_rx_polarity_flip_physical{51.0}=0x0 +phy_chain_rx_polarity_flip_physical{52.0}=0x0 +phy_chain_rx_polarity_flip_physical{53.0}=0x0 +phy_chain_rx_polarity_flip_physical{54.0}=0x0 +phy_chain_rx_polarity_flip_physical{55.0}=0x1 +phy_chain_rx_polarity_flip_physical{56.0}=0x0 +phy_chain_rx_polarity_flip_physical{57.0}=0x0 +phy_chain_rx_polarity_flip_physical{58.0}=0x0 +phy_chain_rx_polarity_flip_physical{59.0}=0x1 +phy_chain_rx_polarity_flip_physical{6.0}=0x0 +phy_chain_rx_polarity_flip_physical{60.0}=0x1 +phy_chain_rx_polarity_flip_physical{61.0}=0x0 +phy_chain_rx_polarity_flip_physical{62.0}=0x0 +phy_chain_rx_polarity_flip_physical{63.0}=0x1 +phy_chain_rx_polarity_flip_physical{64.0}=0x1 +phy_chain_rx_polarity_flip_physical{65.0}=0x1 +phy_chain_rx_polarity_flip_physical{66.0}=0x1 +phy_chain_rx_polarity_flip_physical{67.0}=0x0 +phy_chain_rx_polarity_flip_physical{68.0}=0x1 +phy_chain_rx_polarity_flip_physical{69.0}=0x0 +phy_chain_rx_polarity_flip_physical{7.0}=0x0 +phy_chain_rx_polarity_flip_physical{70.0}=0x0 +phy_chain_rx_polarity_flip_physical{71.0}=0x1 +phy_chain_rx_polarity_flip_physical{72.0}=0x1 +phy_chain_rx_polarity_flip_physical{73.0}=0x1 +phy_chain_rx_polarity_flip_physical{74.0}=0x1 +phy_chain_rx_polarity_flip_physical{75.0}=0x0 +phy_chain_rx_polarity_flip_physical{76.0}=0x0 +phy_chain_rx_polarity_flip_physical{77.0}=0x0 +phy_chain_rx_polarity_flip_physical{78.0}=0x0 +phy_chain_rx_polarity_flip_physical{79.0}=0x1 +phy_chain_rx_polarity_flip_physical{8.0}=0x1 +phy_chain_rx_polarity_flip_physical{80.0}=0x1 +phy_chain_rx_polarity_flip_physical{81.0}=0x1 +phy_chain_rx_polarity_flip_physical{82.0}=0x1 +phy_chain_rx_polarity_flip_physical{83.0}=0x0 +phy_chain_rx_polarity_flip_physical{84.0}=0x0 +phy_chain_rx_polarity_flip_physical{85.0}=0x1 +phy_chain_rx_polarity_flip_physical{86.0}=0x1 +phy_chain_rx_polarity_flip_physical{87.0}=0x0 +phy_chain_rx_polarity_flip_physical{88.0}=0x0 +phy_chain_rx_polarity_flip_physical{89.0}=0x0 +phy_chain_rx_polarity_flip_physical{9.0}=0x1 +phy_chain_rx_polarity_flip_physical{90.0}=0x0 +phy_chain_rx_polarity_flip_physical{91.0}=0x1 +phy_chain_rx_polarity_flip_physical{92.0}=0x1 +phy_chain_rx_polarity_flip_physical{93.0}=0x0 +phy_chain_rx_polarity_flip_physical{94.0}=0x0 +phy_chain_rx_polarity_flip_physical{95.0}=0x1 +phy_chain_rx_polarity_flip_physical{96.0}=0x0 +phy_chain_rx_polarity_flip_physical{97.0}=0x1 +phy_chain_rx_polarity_flip_physical{98.0}=0x1 +phy_chain_rx_polarity_flip_physical{99.0}=0x0 +phy_chain_tx_lane_map_physical{1.0}=0x2031 +phy_chain_tx_lane_map_physical{101.0}=0x1023 +phy_chain_tx_lane_map_physical{105.0}=0x1302 +phy_chain_tx_lane_map_physical{109.0}=0x0321 +phy_chain_tx_lane_map_physical{113.0}=0x2301 +phy_chain_tx_lane_map_physical{117.0}=0x3120 +phy_chain_tx_lane_map_physical{121.0}=0x3102 +phy_chain_tx_lane_map_physical{125.0}=0x3210 +phy_chain_tx_lane_map_physical{129.0}=0x1023 +phy_chain_tx_lane_map_physical{13.0}=0x3021 +phy_chain_tx_lane_map_physical{133.0}=0x3210 +phy_chain_tx_lane_map_physical{137.0}=0x2031 +phy_chain_tx_lane_map_physical{141.0}=0x1302 +phy_chain_tx_lane_map_physical{145.0}=0x3210 +phy_chain_tx_lane_map_physical{149.0}=0x0213 +phy_chain_tx_lane_map_physical{153.0}=0x3210 +phy_chain_tx_lane_map_physical{157.0}=0x1320 +phy_chain_tx_lane_map_physical{161.0}=0x3210 +phy_chain_tx_lane_map_physical{165.0}=0x0231 +phy_chain_tx_lane_map_physical{169.0}=0x3120 +phy_chain_tx_lane_map_physical{17.0}=0x1032 +phy_chain_tx_lane_map_physical{173.0}=0x0312 +phy_chain_tx_lane_map_physical{177.0}=0x0231 +phy_chain_tx_lane_map_physical{181.0}=0x3210 +phy_chain_tx_lane_map_physical{185.0}=0x3210 +phy_chain_tx_lane_map_physical{189.0}=0x1320 +phy_chain_tx_lane_map_physical{193.0}=0x0321 +phy_chain_tx_lane_map_physical{197.0}=0x3120 +phy_chain_tx_lane_map_physical{201.0}=0x3120 +phy_chain_tx_lane_map_physical{205.0}=0x0123 +phy_chain_tx_lane_map_physical{209.0}=0x3120 +phy_chain_tx_lane_map_physical{21.0}=0x0213 +phy_chain_tx_lane_map_physical{213.0}=0x3021 +phy_chain_tx_lane_map_physical{217.0}=0x0312 +phy_chain_tx_lane_map_physical{221.0}=0x2301 +phy_chain_tx_lane_map_physical{225.0}=0x0123 +phy_chain_tx_lane_map_physical{229.0}=0x2031 +phy_chain_tx_lane_map_physical{233.0}=0x0231 +phy_chain_tx_lane_map_physical{237.0}=0x0213 +phy_chain_tx_lane_map_physical{241.0}=0x1320 +phy_chain_tx_lane_map_physical{245.0}=0x2031 +phy_chain_tx_lane_map_physical{249.0}=0x3120 +phy_chain_tx_lane_map_physical{25.0}=0x0231 +phy_chain_tx_lane_map_physical{253.0}=0x0321 +phy_chain_tx_lane_map_physical{257.0}=0x3210 +phy_chain_tx_lane_map_physical{29.0}=0x1230 +phy_chain_tx_lane_map_physical{33.0}=0x1032 +phy_chain_tx_lane_map_physical{37.0}=0x0123 +phy_chain_tx_lane_map_physical{41.0}=0x0213 +phy_chain_tx_lane_map_physical{45.0}=0x0132 +phy_chain_tx_lane_map_physical{49.0}=0x2031 +phy_chain_tx_lane_map_physical{5.0}=0x2301 +phy_chain_tx_lane_map_physical{53.0}=0x2301 +phy_chain_tx_lane_map_physical{57.0}=0x2031 +phy_chain_tx_lane_map_physical{61.0}=0x2031 +phy_chain_tx_lane_map_physical{65.0}=0x1230 +phy_chain_tx_lane_map_physical{69.0}=0x2013 +phy_chain_tx_lane_map_physical{73.0}=0x0213 +phy_chain_tx_lane_map_physical{77.0}=0x2310 +phy_chain_tx_lane_map_physical{81.0}=0x0321 +phy_chain_tx_lane_map_physical{85.0}=0x2013 +phy_chain_tx_lane_map_physical{89.0}=0x0213 +phy_chain_tx_lane_map_physical{9.0}=0x3012 +phy_chain_tx_lane_map_physical{93.0}=0x3102 +phy_chain_tx_lane_map_physical{97.0}=0x3210 +phy_chain_tx_polarity_flip_physical{1.0}=0x0 +phy_chain_tx_polarity_flip_physical{10.0}=0x1 +phy_chain_tx_polarity_flip_physical{100.0}=0x0 +phy_chain_tx_polarity_flip_physical{101.0}=0x0 +phy_chain_tx_polarity_flip_physical{102.0}=0x1 +phy_chain_tx_polarity_flip_physical{103.0}=0x0 +phy_chain_tx_polarity_flip_physical{104.0}=0x0 +phy_chain_tx_polarity_flip_physical{105.0}=0x0 +phy_chain_tx_polarity_flip_physical{106.0}=0x1 +phy_chain_tx_polarity_flip_physical{107.0}=0x1 +phy_chain_tx_polarity_flip_physical{108.0}=0x1 +phy_chain_tx_polarity_flip_physical{109.0}=0x0 +phy_chain_tx_polarity_flip_physical{11.0}=0x1 +phy_chain_tx_polarity_flip_physical{110.0}=0x0 +phy_chain_tx_polarity_flip_physical{111.0}=0x0 +phy_chain_tx_polarity_flip_physical{112.0}=0x1 +phy_chain_tx_polarity_flip_physical{113.0}=0x1 +phy_chain_tx_polarity_flip_physical{114.0}=0x1 +phy_chain_tx_polarity_flip_physical{115.0}=0x1 +phy_chain_tx_polarity_flip_physical{116.0}=0x0 +phy_chain_tx_polarity_flip_physical{117.0}=0x1 +phy_chain_tx_polarity_flip_physical{118.0}=0x0 +phy_chain_tx_polarity_flip_physical{119.0}=0x0 +phy_chain_tx_polarity_flip_physical{12.0}=0x0 +phy_chain_tx_polarity_flip_physical{120.0}=0x0 +phy_chain_tx_polarity_flip_physical{121.0}=0x0 +phy_chain_tx_polarity_flip_physical{122.0}=0x0 +phy_chain_tx_polarity_flip_physical{123.0}=0x0 +phy_chain_tx_polarity_flip_physical{124.0}=0x1 +phy_chain_tx_polarity_flip_physical{125.0}=0x0 +phy_chain_tx_polarity_flip_physical{126.0}=0x1 +phy_chain_tx_polarity_flip_physical{127.0}=0x1 +phy_chain_tx_polarity_flip_physical{128.0}=0x1 +phy_chain_tx_polarity_flip_physical{129.0}=0x1 +phy_chain_tx_polarity_flip_physical{13.0}=0x0 +phy_chain_tx_polarity_flip_physical{130.0}=0x0 +phy_chain_tx_polarity_flip_physical{131.0}=0x1 +phy_chain_tx_polarity_flip_physical{132.0}=0x0 +phy_chain_tx_polarity_flip_physical{133.0}=0x1 +phy_chain_tx_polarity_flip_physical{134.0}=0x1 +phy_chain_tx_polarity_flip_physical{135.0}=0x1 +phy_chain_tx_polarity_flip_physical{136.0}=0x1 +phy_chain_tx_polarity_flip_physical{137.0}=0x1 +phy_chain_tx_polarity_flip_physical{138.0}=0x1 +phy_chain_tx_polarity_flip_physical{139.0}=0x1 +phy_chain_tx_polarity_flip_physical{14.0}=0x1 +phy_chain_tx_polarity_flip_physical{140.0}=0x1 +phy_chain_tx_polarity_flip_physical{141.0}=0x0 +phy_chain_tx_polarity_flip_physical{142.0}=0x1 +phy_chain_tx_polarity_flip_physical{143.0}=0x1 +phy_chain_tx_polarity_flip_physical{144.0}=0x1 +phy_chain_tx_polarity_flip_physical{145.0}=0x1 +phy_chain_tx_polarity_flip_physical{146.0}=0x1 +phy_chain_tx_polarity_flip_physical{147.0}=0x1 +phy_chain_tx_polarity_flip_physical{148.0}=0x0 +phy_chain_tx_polarity_flip_physical{149.0}=0x1 +phy_chain_tx_polarity_flip_physical{15.0}=0x0 +phy_chain_tx_polarity_flip_physical{150.0}=0x0 +phy_chain_tx_polarity_flip_physical{151.0}=0x0 +phy_chain_tx_polarity_flip_physical{152.0}=0x0 +phy_chain_tx_polarity_flip_physical{153.0}=0x1 +phy_chain_tx_polarity_flip_physical{154.0}=0x0 +phy_chain_tx_polarity_flip_physical{155.0}=0x0 +phy_chain_tx_polarity_flip_physical{156.0}=0x0 +phy_chain_tx_polarity_flip_physical{157.0}=0x0 +phy_chain_tx_polarity_flip_physical{158.0}=0x0 +phy_chain_tx_polarity_flip_physical{159.0}=0x0 +phy_chain_tx_polarity_flip_physical{16.0}=0x0 +phy_chain_tx_polarity_flip_physical{160.0}=0x0 +phy_chain_tx_polarity_flip_physical{161.0}=0x0 +phy_chain_tx_polarity_flip_physical{162.0}=0x1 +phy_chain_tx_polarity_flip_physical{163.0}=0x1 +phy_chain_tx_polarity_flip_physical{164.0}=0x0 +phy_chain_tx_polarity_flip_physical{165.0}=0x1 +phy_chain_tx_polarity_flip_physical{166.0}=0x1 +phy_chain_tx_polarity_flip_physical{167.0}=0x1 +phy_chain_tx_polarity_flip_physical{168.0}=0x0 +phy_chain_tx_polarity_flip_physical{169.0}=0x0 +phy_chain_tx_polarity_flip_physical{17.0}=0x0 +phy_chain_tx_polarity_flip_physical{170.0}=0x1 +phy_chain_tx_polarity_flip_physical{171.0}=0x1 +phy_chain_tx_polarity_flip_physical{172.0}=0x1 +phy_chain_tx_polarity_flip_physical{173.0}=0x0 +phy_chain_tx_polarity_flip_physical{174.0}=0x0 +phy_chain_tx_polarity_flip_physical{175.0}=0x1 +phy_chain_tx_polarity_flip_physical{176.0}=0x0 +phy_chain_tx_polarity_flip_physical{177.0}=0x1 +phy_chain_tx_polarity_flip_physical{178.0}=0x0 +phy_chain_tx_polarity_flip_physical{179.0}=0x0 +phy_chain_tx_polarity_flip_physical{18.0}=0x1 +phy_chain_tx_polarity_flip_physical{180.0}=0x0 +phy_chain_tx_polarity_flip_physical{181.0}=0x0 +phy_chain_tx_polarity_flip_physical{182.0}=0x0 +phy_chain_tx_polarity_flip_physical{183.0}=0x0 +phy_chain_tx_polarity_flip_physical{184.0}=0x1 +phy_chain_tx_polarity_flip_physical{185.0}=0x0 +phy_chain_tx_polarity_flip_physical{186.0}=0x1 +phy_chain_tx_polarity_flip_physical{187.0}=0x1 +phy_chain_tx_polarity_flip_physical{188.0}=0x1 +phy_chain_tx_polarity_flip_physical{189.0}=0x0 +phy_chain_tx_polarity_flip_physical{19.0}=0x1 +phy_chain_tx_polarity_flip_physical{190.0}=0x0 +phy_chain_tx_polarity_flip_physical{191.0}=0x0 +phy_chain_tx_polarity_flip_physical{192.0}=0x0 +phy_chain_tx_polarity_flip_physical{193.0}=0x1 +phy_chain_tx_polarity_flip_physical{194.0}=0x1 +phy_chain_tx_polarity_flip_physical{195.0}=0x1 +phy_chain_tx_polarity_flip_physical{196.0}=0x0 +phy_chain_tx_polarity_flip_physical{197.0}=0x0 +phy_chain_tx_polarity_flip_physical{198.0}=0x1 +phy_chain_tx_polarity_flip_physical{199.0}=0x1 +phy_chain_tx_polarity_flip_physical{2.0}=0x1 +phy_chain_tx_polarity_flip_physical{20.0}=0x1 +phy_chain_tx_polarity_flip_physical{200.0}=0x1 +phy_chain_tx_polarity_flip_physical{201.0}=0x1 +phy_chain_tx_polarity_flip_physical{202.0}=0x1 +phy_chain_tx_polarity_flip_physical{203.0}=0x1 +phy_chain_tx_polarity_flip_physical{204.0}=0x1 +phy_chain_tx_polarity_flip_physical{205.0}=0x0 +phy_chain_tx_polarity_flip_physical{206.0}=0x1 +phy_chain_tx_polarity_flip_physical{207.0}=0x1 +phy_chain_tx_polarity_flip_physical{208.0}=0x1 +phy_chain_tx_polarity_flip_physical{209.0}=0x1 +phy_chain_tx_polarity_flip_physical{21.0}=0x0 +phy_chain_tx_polarity_flip_physical{210.0}=0x1 +phy_chain_tx_polarity_flip_physical{211.0}=0x1 +phy_chain_tx_polarity_flip_physical{212.0}=0x0 +phy_chain_tx_polarity_flip_physical{213.0}=0x0 +phy_chain_tx_polarity_flip_physical{214.0}=0x1 +phy_chain_tx_polarity_flip_physical{215.0}=0x0 +phy_chain_tx_polarity_flip_physical{216.0}=0x1 +phy_chain_tx_polarity_flip_physical{217.0}=0x1 +phy_chain_tx_polarity_flip_physical{218.0}=0x1 +phy_chain_tx_polarity_flip_physical{219.0}=0x0 +phy_chain_tx_polarity_flip_physical{22.0}=0x0 +phy_chain_tx_polarity_flip_physical{220.0}=0x1 +phy_chain_tx_polarity_flip_physical{221.0}=0x0 +phy_chain_tx_polarity_flip_physical{222.0}=0x0 +phy_chain_tx_polarity_flip_physical{223.0}=0x0 +phy_chain_tx_polarity_flip_physical{224.0}=0x1 +phy_chain_tx_polarity_flip_physical{225.0}=0x1 +phy_chain_tx_polarity_flip_physical{226.0}=0x1 +phy_chain_tx_polarity_flip_physical{227.0}=0x1 +phy_chain_tx_polarity_flip_physical{228.0}=0x0 +phy_chain_tx_polarity_flip_physical{229.0}=0x0 +phy_chain_tx_polarity_flip_physical{23.0}=0x0 +phy_chain_tx_polarity_flip_physical{230.0}=0x1 +phy_chain_tx_polarity_flip_physical{231.0}=0x1 +phy_chain_tx_polarity_flip_physical{232.0}=0x1 +phy_chain_tx_polarity_flip_physical{233.0}=0x0 +phy_chain_tx_polarity_flip_physical{234.0}=0x0 +phy_chain_tx_polarity_flip_physical{235.0}=0x0 +phy_chain_tx_polarity_flip_physical{236.0}=0x0 +phy_chain_tx_polarity_flip_physical{237.0}=0x1 +phy_chain_tx_polarity_flip_physical{238.0}=0x1 +phy_chain_tx_polarity_flip_physical{239.0}=0x1 +phy_chain_tx_polarity_flip_physical{24.0}=0x0 +phy_chain_tx_polarity_flip_physical{240.0}=0x0 +phy_chain_tx_polarity_flip_physical{241.0}=0x1 +phy_chain_tx_polarity_flip_physical{242.0}=0x1 +phy_chain_tx_polarity_flip_physical{243.0}=0x1 +phy_chain_tx_polarity_flip_physical{244.0}=0x0 +phy_chain_tx_polarity_flip_physical{245.0}=0x1 +phy_chain_tx_polarity_flip_physical{246.0}=0x1 +phy_chain_tx_polarity_flip_physical{247.0}=0x1 +phy_chain_tx_polarity_flip_physical{248.0}=0x1 +phy_chain_tx_polarity_flip_physical{249.0}=0x1 +phy_chain_tx_polarity_flip_physical{25.0}=0x1 +phy_chain_tx_polarity_flip_physical{250.0}=0x0 +phy_chain_tx_polarity_flip_physical{251.0}=0x0 +phy_chain_tx_polarity_flip_physical{252.0}=0x0 +phy_chain_tx_polarity_flip_physical{253.0}=0x1 +phy_chain_tx_polarity_flip_physical{254.0}=0x1 +phy_chain_tx_polarity_flip_physical{255.0}=0x1 +phy_chain_tx_polarity_flip_physical{256.0}=0x0 +phy_chain_tx_polarity_flip_physical{257.0}=0x0 +phy_chain_tx_polarity_flip_physical{259.0}=0x0 +phy_chain_tx_polarity_flip_physical{26.0}=0x0 +phy_chain_tx_polarity_flip_physical{27.0}=0x0 +phy_chain_tx_polarity_flip_physical{28.0}=0x0 +phy_chain_tx_polarity_flip_physical{29.0}=0x1 +phy_chain_tx_polarity_flip_physical{3.0}=0x1 +phy_chain_tx_polarity_flip_physical{30.0}=0x1 +phy_chain_tx_polarity_flip_physical{31.0}=0x1 +phy_chain_tx_polarity_flip_physical{32.0}=0x0 +phy_chain_tx_polarity_flip_physical{33.0}=0x0 +phy_chain_tx_polarity_flip_physical{34.0}=0x0 +phy_chain_tx_polarity_flip_physical{35.0}=0x0 +phy_chain_tx_polarity_flip_physical{36.0}=0x1 +phy_chain_tx_polarity_flip_physical{37.0}=0x1 +phy_chain_tx_polarity_flip_physical{38.0}=0x1 +phy_chain_tx_polarity_flip_physical{39.0}=0x1 +phy_chain_tx_polarity_flip_physical{4.0}=0x1 +phy_chain_tx_polarity_flip_physical{40.0}=0x0 +phy_chain_tx_polarity_flip_physical{41.0}=0x0 +phy_chain_tx_polarity_flip_physical{42.0}=0x0 +phy_chain_tx_polarity_flip_physical{43.0}=0x0 +phy_chain_tx_polarity_flip_physical{44.0}=0x0 +phy_chain_tx_polarity_flip_physical{45.0}=0x1 +phy_chain_tx_polarity_flip_physical{46.0}=0x0 +phy_chain_tx_polarity_flip_physical{47.0}=0x1 +phy_chain_tx_polarity_flip_physical{48.0}=0x1 +phy_chain_tx_polarity_flip_physical{49.0}=0x0 +phy_chain_tx_polarity_flip_physical{5.0}=0x1 +phy_chain_tx_polarity_flip_physical{50.0}=0x0 +phy_chain_tx_polarity_flip_physical{51.0}=0x0 +phy_chain_tx_polarity_flip_physical{52.0}=0x1 +phy_chain_tx_polarity_flip_physical{53.0}=0x0 +phy_chain_tx_polarity_flip_physical{54.0}=0x1 +phy_chain_tx_polarity_flip_physical{55.0}=0x1 +phy_chain_tx_polarity_flip_physical{56.0}=0x0 +phy_chain_tx_polarity_flip_physical{57.0}=0x0 +phy_chain_tx_polarity_flip_physical{58.0}=0x1 +phy_chain_tx_polarity_flip_physical{59.0}=0x1 +phy_chain_tx_polarity_flip_physical{6.0}=0x1 +phy_chain_tx_polarity_flip_physical{60.0}=0x1 +phy_chain_tx_polarity_flip_physical{61.0}=0x0 +phy_chain_tx_polarity_flip_physical{62.0}=0x1 +phy_chain_tx_polarity_flip_physical{63.0}=0x1 +phy_chain_tx_polarity_flip_physical{64.0}=0x1 +phy_chain_tx_polarity_flip_physical{65.0}=0x0 +phy_chain_tx_polarity_flip_physical{66.0}=0x1 +phy_chain_tx_polarity_flip_physical{67.0}=0x1 +phy_chain_tx_polarity_flip_physical{68.0}=0x0 +phy_chain_tx_polarity_flip_physical{69.0}=0x1 +phy_chain_tx_polarity_flip_physical{7.0}=0x1 +phy_chain_tx_polarity_flip_physical{70.0}=0x1 +phy_chain_tx_polarity_flip_physical{71.0}=0x1 +phy_chain_tx_polarity_flip_physical{72.0}=0x0 +phy_chain_tx_polarity_flip_physical{73.0}=0x1 +phy_chain_tx_polarity_flip_physical{74.0}=0x0 +phy_chain_tx_polarity_flip_physical{75.0}=0x0 +phy_chain_tx_polarity_flip_physical{76.0}=0x0 +phy_chain_tx_polarity_flip_physical{77.0}=0x0 +phy_chain_tx_polarity_flip_physical{78.0}=0x0 +phy_chain_tx_polarity_flip_physical{79.0}=0x1 +phy_chain_tx_polarity_flip_physical{8.0}=0x0 +phy_chain_tx_polarity_flip_physical{80.0}=0x0 +phy_chain_tx_polarity_flip_physical{81.0}=0x1 +phy_chain_tx_polarity_flip_physical{82.0}=0x1 +phy_chain_tx_polarity_flip_physical{83.0}=0x1 +phy_chain_tx_polarity_flip_physical{84.0}=0x0 +phy_chain_tx_polarity_flip_physical{85.0}=0x1 +phy_chain_tx_polarity_flip_physical{86.0}=0x0 +phy_chain_tx_polarity_flip_physical{87.0}=0x0 +phy_chain_tx_polarity_flip_physical{88.0}=0x0 +phy_chain_tx_polarity_flip_physical{89.0}=0x1 +phy_chain_tx_polarity_flip_physical{9.0}=0x0 +phy_chain_tx_polarity_flip_physical{90.0}=0x1 +phy_chain_tx_polarity_flip_physical{91.0}=0x1 +phy_chain_tx_polarity_flip_physical{92.0}=0x0 +phy_chain_tx_polarity_flip_physical{93.0}=0x0 +phy_chain_tx_polarity_flip_physical{94.0}=0x0 +phy_chain_tx_polarity_flip_physical{95.0}=0x0 +phy_chain_tx_polarity_flip_physical{96.0}=0x0 +phy_chain_tx_polarity_flip_physical{97.0}=0x0 +phy_chain_tx_polarity_flip_physical{98.0}=0x1 +phy_chain_tx_polarity_flip_physical{99.0}=0x1 + +port_init_cl72_hg=1 + + + + + + + +robust_hash_disable_egress_vlan=1 +robust_hash_disable_mpls=1 +robust_hash_disable_vlan=1 +stable_size=0x5500000 +stable_size=0x5500000 +tdma_timeout_usec=15000000 +tslam_timeout_usec=15000000 +dport_map_direct=1 +portmap_1=5:50 +portmap_2=7:50 +portmap_3=13:50 +portmap_4=15:50 +portmap_5=25:50 +portmap_6=27:50 +portmap_7=21:50 +portmap_8=23:50 +portmap_9=37:50 +portmap_10=39:50 +portmap_11=45:50 +portmap_12=47:50 +portmap_13=57:100 +portmap_14=53:100 +portmap_15=9:50 +portmap_16=11:50 +portmap_17=1:50 +portmap_18=3:50 +portmap_19=17:50 +portmap_20=19:50 +portmap_21=29:50 +portmap_22=31:50 +portmap_23=41:50 +portmap_24=43:50 +portmap_25=33:50 +portmap_26=35:50 +portmap_27=49:100 +portmap_28=61:100 +portmap_34=77:50 +portmap_35=79:50 +portmap_36=65:50 +portmap_37=67:50 +portmap_38=85:50 +portmap_39=87:50 +portmap_40=89:50 +portmap_41=91:50 +portmap_42=109:50 +portmap_43=111:50 +portmap_44=97:50 +portmap_45=99:50 +portmap_46=117:100 +portmap_47=121:100 +portmap_48=69:50 +portmap_49=71:50 +portmap_50=73:50 +portmap_51=75:50 +portmap_52=93:50 +portmap_53=95:50 +portmap_54=81:50 +portmap_55=83:50 +portmap_56=101:50 +portmap_57=103:50 +portmap_58=105:50 +portmap_59=107:50 +portmap_60=125:100 +portmap_61=113:100 +portmap_66=257:10 +portmap_68=141:100 +portmap_69=133:100 +portmap_70=149:50 +portmap_71=151:50 +portmap_72=153:50 +portmap_73=155:50 +portmap_74=173:50 +portmap_75=175:50 +portmap_76=161:50 +portmap_77=163:50 +portmap_78=181:50 +portmap_79=183:50 +portmap_80=185:50 +portmap_81=187:50 +portmap_82=129:100 +portmap_83=137:100 +portmap_84=157:50 +portmap_85=159:50 +portmap_86=145:50 +portmap_87=147:50 +portmap_88=165:50 +portmap_89=167:50 +portmap_90=169:50 +portmap_91=171:50 +portmap_92=189:50 +portmap_93=191:50 +portmap_94=177:50 +portmap_95=179:50 +portmap_100=259:10 +portmap_102=197:100 +portmap_103=205:100 +portmap_104=217:50 +portmap_105=219:50 +portmap_106=213:50 +portmap_107=215:50 +portmap_108=229:50 +portmap_109=231:50 +portmap_110=237:50 +portmap_111=239:50 +portmap_112=249:50 +portmap_113=251:50 +portmap_114=245:50 +portmap_115=247:50 +portmap_116=201:100 +portmap_117=193:100 +portmap_118=209:50 +portmap_119=211:50 +portmap_120=221:50 +portmap_121=223:50 +portmap_122=233:50 +portmap_123=235:50 +portmap_124=225:50 +portmap_125=227:50 +portmap_126=241:50 +portmap_127=243:50 +portmap_128=253:50 +portmap_129=255:50 + +# tuning parameters +serdes_preemphasis_1=0x580c +serdes_preemphasis_2=0x580c +serdes_preemphasis_3=0x580c +serdes_preemphasis_4=0x580c +serdes_preemphasis_5=0x580c +serdes_preemphasis_6=0x580c +serdes_preemphasis_7=0x580c +serdes_preemphasis_8=0x580c +serdes_preemphasis_9=0x580c +serdes_preemphasis_10=0x580c +serdes_preemphasis_11=0x580c +serdes_preemphasis_12=0x580c +serdes_preemphasis_13=0x83404 +serdes_preemphasis_14=0x83404 +serdes_preemphasis_15=0x580c +serdes_preemphasis_16=0x580c +serdes_preemphasis_17=0x580c +serdes_preemphasis_18=0x580c +serdes_preemphasis_19=0x580c +serdes_preemphasis_20=0x580c +serdes_preemphasis_21=0x580c +serdes_preemphasis_22=0x580c +serdes_preemphasis_23=0x580c +serdes_preemphasis_24=0x580c +serdes_preemphasis_25=0x580c +serdes_preemphasis_26=0x580c +serdes_preemphasis_27=0xf3c05 +serdes_preemphasis_28=0xf3d05 +serdes_preemphasis_34=0x580c +serdes_preemphasis_35=0x580c +serdes_preemphasis_36=0x580c +serdes_preemphasis_37=0x580c +serdes_preemphasis_38=0x580c +serdes_preemphasis_39=0x580c +serdes_preemphasis_40=0x580c +serdes_preemphasis_41=0x580c +serdes_preemphasis_42=0x580c +serdes_preemphasis_43=0x580c +serdes_preemphasis_44=0x580c +serdes_preemphasis_45=0x580c +serdes_preemphasis_46=0xb3604 +serdes_preemphasis_47=0x72b03 +serdes_preemphasis_48=0x580c +serdes_preemphasis_49=0x580c +serdes_preemphasis_50=0x580c +serdes_preemphasis_51=0x580c +serdes_preemphasis_52=0x580c +serdes_preemphasis_53=0x580c +serdes_preemphasis_54=0x580c +serdes_preemphasis_55=0x580c +serdes_preemphasis_56=0x580c +serdes_preemphasis_57=0x580c +serdes_preemphasis_58=0x580c +serdes_preemphasis_59=0x580c +serdes_preemphasis_60=0xf3c05 +serdes_preemphasis_61=0x103f06 +serdes_preemphasis_66=0x43004 +serdes_preemphasis_68=0xf4006 +serdes_preemphasis_69=0xf4006 +serdes_preemphasis_70=0x580c +serdes_preemphasis_71=0x580c +serdes_preemphasis_72=0x580c +serdes_preemphasis_73=0x580c +serdes_preemphasis_74=0x580c +serdes_preemphasis_75=0x580c +serdes_preemphasis_76=0x580c +serdes_preemphasis_77=0x580c +serdes_preemphasis_78=0x580c +serdes_preemphasis_79=0x580c +serdes_preemphasis_80=0x580c +serdes_preemphasis_81=0x580c +serdes_preemphasis_82=0x73103 +serdes_preemphasis_83=0x73103 +serdes_preemphasis_84=0x580c +serdes_preemphasis_85=0x580c +serdes_preemphasis_86=0x580c +serdes_preemphasis_87=0x580c +serdes_preemphasis_88=0x580c +serdes_preemphasis_89=0x580c +serdes_preemphasis_90=0x580c +serdes_preemphasis_91=0x580c +serdes_preemphasis_92=0x580c +serdes_preemphasis_93=0x580c +serdes_preemphasis_94=0x580c +serdes_preemphasis_95=0x580c +serdes_preemphasis_100=0x43004 +serdes_preemphasis_102=0xf3c05 +serdes_preemphasis_103=0xf3c05 +serdes_preemphasis_104=0x580c +serdes_preemphasis_105=0x580c +serdes_preemphasis_106=0x580c +serdes_preemphasis_107=0x580c +serdes_preemphasis_108=0x580c +serdes_preemphasis_109=0x580c +serdes_preemphasis_110=0x580c +serdes_preemphasis_111=0x580c +serdes_preemphasis_112=0x580c +serdes_preemphasis_113=0x580c +serdes_preemphasis_114=0x580c +serdes_preemphasis_115=0x580c +serdes_preemphasis_116=0x83404 +serdes_preemphasis_117=0x83404 +serdes_preemphasis_118=0x580c +serdes_preemphasis_119=0x580c +serdes_preemphasis_120=0x580c +serdes_preemphasis_121=0x580c +serdes_preemphasis_122=0x580c +serdes_preemphasis_123=0x580c +serdes_preemphasis_124=0x580c +serdes_preemphasis_125=0x580c +serdes_preemphasis_126=0x580c +serdes_preemphasis_127=0x580c +serdes_preemphasis_128=0x580c +serdes_preemphasis_129=0x580c + +mmu_init_config="MSFT-TH2-Tier0" + +phy_an_lt_msft=1 diff --git a/src/sonic-config-engine/tests/sample-arista-7260-t0-minigraph.xml b/src/sonic-config-engine/tests/sample-arista-7260-t0-minigraph.xml new file mode 100644 index 000000000000..c206756269b6 --- /dev/null +++ b/src/sonic-config-engine/tests/sample-arista-7260-t0-minigraph.xml @@ -0,0 +1,1857 @@ + + + + + + BGPSession + false + str-7260cx3-1 + 10.0.0.56 + ARISTA01T1 + 10.0.0.57 + 1 + 10 + 3 + + + BGPSession + false + str-7260cx3-1 + 10.0.0.58 + ARISTA02T1 + 10.0.0.59 + 1 + 10 + 3 + + + BGPSession + false + str-7260cx3-1 + 10.0.0.60 + ARISTA03T1 + 10.0.0.61 + 1 + 10 + 3 + + + BGPSession + false + str-7260cx3-1 + 10.0.0.62 + ARISTA04T1 + 10.0.0.63 + 1 + 10 + 3 + + + BGPSession + false + str-7260cx3-1 + FC00::71 + ARISTA01T1 + FC00::72 + 1 + 10 + 3 + + + BGPSession + false + str-7260cx3-1 + FC00::75 + ARISTA02T1 + FC00::76 + 1 + 10 + 3 + + + BGPSession + false + str-7260cx3-1 + FC00::79 + ARISTA03T1 + FC00::7A + 1 + 10 + 3 + + + BGPSession + false + str-7260cx3-1 + FC00::7D + ARISTA04T1 + FC00::7E + 1 + 10 + 3 + + + + + 65100 + str-7260cx3-1 + + + BGPPeer +
10.0.0.57
+ + + +
+ + BGPPeer +
10.0.0.59
+ + + +
+ + BGPPeer +
10.0.0.61
+ + + +
+ + BGPPeer +
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 + + +
+
+ + + + + DeviceInterface + + true + 1 + Ethernet1/1 + false + 1/1 + Ethernet0 + 50000 + + + DeviceInterface + + true + 2 + Ethernet1/3 + false + 1/3 + Ethernet2 + 50000 + + + DeviceInterface + + true + 3 + Ethernet2/1 + false + 2/1 + Ethernet4 + 50000 + + + DeviceInterface + + true + 4 + Ethernet2/3 + false + 2/3 + Ethernet6 + 50000 + + + DeviceInterface + + true + 5 + Ethernet3/1 + false + 3/1 + Ethernet8 + 50000 + + + DeviceInterface + + true + 6 + Ethernet3/3 + false + 3/3 + Ethernet10 + 50000 + + + DeviceInterface + + true + 7 + Ethernet4/1 + false + 4/1 + Ethernet12 + 50000 + + + DeviceInterface + + true + 8 + Ethernet4/3 + false + 4/3 + Ethernet14 + 50000 + + + DeviceInterface + + true + 9 + Ethernet5/1 + false + 5/1 + Ethernet16 + 50000 + + + DeviceInterface + + true + 10 + Ethernet5/3 + false + 5/3 + Ethernet18 + 50000 + + + DeviceInterface + + true + 11 + Ethernet6/1 + false + 6/1 + Ethernet20 + 50000 + + + DeviceInterface + + true + 12 + Ethernet6/3 + false + 6/3 + Ethernet22 + 50000 + + + DeviceInterface + + true + 13 + Ethernet7/1 + false + 7/1 + Ethernet24 + 50000 + + + DeviceInterface + + true + 14 + Ethernet7/3 + false + 7/3 + Ethernet26 + 50000 + + + DeviceInterface + + true + 15 + Ethernet8/1 + false + 8/1 + Ethernet28 + 50000 + + + DeviceInterface + + true + 16 + Ethernet8/3 + false + 8/3 + Ethernet30 + 50000 + + + DeviceInterface + + true + 17 + Ethernet9/1 + false + 9/1 + Ethernet32 + 50000 + + + DeviceInterface + + true + 18 + Ethernet9/3 + false + 9/3 + Ethernet34 + 50000 + + + DeviceInterface + + true + 19 + Ethernet10/1 + false + 10/1 + Ethernet36 + 50000 + + + DeviceInterface + + true + 20 + Ethernet10/3 + false + 10/3 + Ethernet38 + 50000 + + + DeviceInterface + + true + 21 + Ethernet11/1 + false + 11/1 + Ethernet40 + 50000 + + + DeviceInterface + + true + 22 + Ethernet11/3 + false + 11/3 + Ethernet42 + 50000 + + + DeviceInterface + + true + 23 + Ethernet12/1 + false + 12/1 + Ethernet44 + 50000 + + + DeviceInterface + + true + 24 + Ethernet12/3 + false + 12/3 + Ethernet46 + 50000 + + + DeviceInterface + + true + 25 + Ethernet13/1 + false + 13/1 + Ethernet48 + 100000 + + + DeviceInterface + + true + 26 + Ethernet14/1 + false + 14/1 + Ethernet52 + 100000 + + + DeviceInterface + + true + 27 + Ethernet15/1 + false + 15/1 + Ethernet56 + 100000 + + + DeviceInterface + + true + 28 + Ethernet16/1 + false + 16/1 + Ethernet60 + 100000 + + + DeviceInterface + + true + 29 + Ethernet17/1 + false + 17/1 + Ethernet64 + 100000 + + + DeviceInterface + + true + 30 + Ethernet18/1 + false + 18/1 + Ethernet68 + 100000 + + + DeviceInterface + + true + 31 + Ethernet19/1 + false + 19/1 + Ethernet72 + 100000 + + + DeviceInterface + + true + 32 + Ethernet20/1 + false + 20/1 + Ethernet76 + 100000 + + + DeviceInterface + + true + 33 + Ethernet21/1 + false + 21/1 + Ethernet80 + 50000 + + + DeviceInterface + + true + 34 + Ethernet21/3 + false + 21/3 + Ethernet82 + 50000 + + + DeviceInterface + + true + 35 + Ethernet22/1 + false + 22/1 + Ethernet84 + 50000 + + + DeviceInterface + + true + 36 + Ethernet22/3 + false + 22/3 + Ethernet86 + 50000 + + + DeviceInterface + + true + 37 + Ethernet23/1 + false + 23/1 + Ethernet88 + 50000 + + + DeviceInterface + + true + 38 + Ethernet23/3 + false + 23/3 + Ethernet90 + 50000 + + + DeviceInterface + + true + 39 + Ethernet24/1 + false + 24/1 + Ethernet92 + 50000 + + + DeviceInterface + + true + 40 + Ethernet24/3 + false + 24/3 + Ethernet94 + 50000 + + + DeviceInterface + + true + 41 + Ethernet25/1 + false + 25/1 + Ethernet96 + 50000 + + + DeviceInterface + + true + 42 + Ethernet25/3 + false + 25/3 + Ethernet98 + 50000 + + + DeviceInterface + + true + 43 + Ethernet26/1 + false + 26/1 + Ethernet100 + 50000 + + + DeviceInterface + + true + 44 + Ethernet26/3 + false + 26/3 + Ethernet102 + 50000 + + + DeviceInterface + + true + 45 + Ethernet27/1 + false + 27/1 + Ethernet104 + 50000 + + + DeviceInterface + + true + 46 + Ethernet27/3 + false + 27/3 + Ethernet106 + 50000 + + + DeviceInterface + + true + 47 + Ethernet28/1 + false + 28/1 + Ethernet108 + 50000 + + + DeviceInterface + + true + 48 + Ethernet28/3 + false + 28/3 + Ethernet110 + 50000 + + + DeviceInterface + + true + 49 + Ethernet29/1 + false + 29/1 + Ethernet112 + 50000 + + + DeviceInterface + + true + 50 + Ethernet29/3 + false + 29/3 + Ethernet114 + 50000 + + + DeviceInterface + + true + 51 + Ethernet30/1 + false + 30/1 + Ethernet116 + 50000 + + + DeviceInterface + + true + 52 + Ethernet30/3 + false + 30/3 + Ethernet118 + 50000 + + + DeviceInterface + + true + 53 + Ethernet31/1 + false + 31/1 + Ethernet120 + 50000 + + + DeviceInterface + + true + 54 + Ethernet31/3 + false + 31/3 + Ethernet122 + 50000 + + + DeviceInterface + + true + 55 + Ethernet32/1 + false + 32/1 + Ethernet124 + 50000 + + + DeviceInterface + + true + 56 + Ethernet32/3 + false + 32/3 + Ethernet126 + 50000 + + + DeviceInterface + + true + 57 + Ethernet33/1 + false + 33/1 + Ethernet128 + 50000 + + + DeviceInterface + + true + 58 + Ethernet33/3 + false + 33/3 + Ethernet130 + 50000 + + + DeviceInterface + + true + 59 + Ethernet34/1 + false + 34/1 + Ethernet132 + 50000 + + + DeviceInterface + + true + 60 + Ethernet34/3 + false + 34/3 + Ethernet134 + 50000 + + + DeviceInterface + + true + 61 + Ethernet35/1 + false + 35/1 + Ethernet136 + 50000 + + + DeviceInterface + + true + 62 + Ethernet35/3 + false + 35/3 + Ethernet138 + 50000 + + + DeviceInterface + + true + 63 + Ethernet36/1 + false + 36/1 + Ethernet140 + 50000 + + + DeviceInterface + + true + 64 + Ethernet36/3 + false + 36/3 + Ethernet142 + 50000 + + + DeviceInterface + + true + 65 + Ethernet37/1 + false + 37/1 + Ethernet144 + 50000 + + + DeviceInterface + + true + 66 + Ethernet37/3 + false + 37/3 + Ethernet146 + 50000 + + + DeviceInterface + + true + 67 + Ethernet38/1 + false + 38/1 + Ethernet148 + 50000 + + + DeviceInterface + + true + 68 + Ethernet38/3 + false + 38/3 + Ethernet150 + 50000 + + + DeviceInterface + + true + 69 + Ethernet39/1 + false + 39/1 + Ethernet152 + 50000 + + + DeviceInterface + + true + 70 + Ethernet39/3 + false + 39/3 + Ethernet154 + 50000 + + + DeviceInterface + + true + 71 + Ethernet40/1 + false + 40/1 + Ethernet156 + 50000 + + + DeviceInterface + + true + 72 + Ethernet40/3 + false + 40/3 + Ethernet158 + 50000 + + + DeviceInterface + + true + 73 + Ethernet41/1 + false + 41/1 + Ethernet160 + 50000 + + + DeviceInterface + + true + 74 + Ethernet41/3 + false + 41/3 + Ethernet162 + 50000 + + + DeviceInterface + + true + 75 + Ethernet42/1 + false + 42/1 + Ethernet164 + 50000 + + + DeviceInterface + + true + 76 + Ethernet42/3 + false + 42/3 + Ethernet166 + 50000 + + + DeviceInterface + + true + 77 + Ethernet43/1 + false + 43/1 + Ethernet168 + 50000 + + + DeviceInterface + + true + 78 + Ethernet43/3 + false + 43/3 + Ethernet170 + 50000 + + + DeviceInterface + + true + 79 + Ethernet44/1 + false + 44/1 + Ethernet172 + 50000 + + + DeviceInterface + + true + 80 + Ethernet44/3 + false + 44/3 + Ethernet174 + 50000 + + + DeviceInterface + + true + 81 + Ethernet45/1 + false + 45/1 + Ethernet176 + 100000 + + + DeviceInterface + + true + 82 + Ethernet46/1 + false + 46/1 + Ethernet180 + 100000 + + + DeviceInterface + + true + 83 + Ethernet47/1 + false + 47/1 + Ethernet184 + 100000 + + + DeviceInterface + + true + 84 + Ethernet48/1 + false + 48/1 + Ethernet188 + 100000 + + + DeviceInterface + + true + 85 + Ethernet49/1 + false + 49/1 + Ethernet192 + 100000 + + + DeviceInterface + + true + 86 + Ethernet50/1 + false + 50/1 + Ethernet196 + 100000 + + + DeviceInterface + + true + 87 + Ethernet51/1 + false + 51/1 + Ethernet200 + 100000 + + + DeviceInterface + + true + 88 + Ethernet52/1 + false + 52/1 + Ethernet204 + 100000 + + + DeviceInterface + + true + 89 + Ethernet53/1 + false + 53/1 + Ethernet208 + 50000 + + + DeviceInterface + + true + 90 + Ethernet53/3 + false + 53/3 + Ethernet210 + 50000 + + + DeviceInterface + + true + 91 + Ethernet54/1 + false + 54/1 + Ethernet212 + 50000 + + + DeviceInterface + + true + 92 + Ethernet54/3 + false + 54/3 + Ethernet214 + 50000 + + + DeviceInterface + + true + 93 + Ethernet55/1 + false + 55/1 + Ethernet216 + 50000 + + + DeviceInterface + + true + 94 + Ethernet55/3 + false + 55/3 + Ethernet218 + 50000 + + + DeviceInterface + + true + 95 + Ethernet56/1 + false + 56/1 + Ethernet220 + 50000 + + + DeviceInterface + + true + 96 + Ethernet56/3 + false + 56/3 + Ethernet222 + 50000 + + + DeviceInterface + + true + 97 + Ethernet57/1 + false + 57/1 + Ethernet224 + 50000 + + + DeviceInterface + + true + 98 + Ethernet57/3 + false + 57/3 + Ethernet226 + 50000 + + + DeviceInterface + + true + 99 + Ethernet58/1 + false + 58/1 + Ethernet228 + 50000 + + + DeviceInterface + + true + 100 + Ethernet58/3 + false + 58/3 + Ethernet230 + 50000 + + + DeviceInterface + + true + 101 + Ethernet59/1 + false + 59/1 + Ethernet232 + 50000 + + + DeviceInterface + + true + 102 + Ethernet59/3 + false + 59/3 + Ethernet234 + 50000 + + + DeviceInterface + + true + 103 + Ethernet60/1 + false + 60/1 + Ethernet236 + 50000 + + + DeviceInterface + + true + 104 + Ethernet60/3 + false + 60/3 + Ethernet238 + 50000 + + + DeviceInterface + + true + 105 + Ethernet61/1 + false + 61/1 + Ethernet240 + 50000 + + + DeviceInterface + + true + 106 + Ethernet61/3 + false + 61/3 + Ethernet242 + 50000 + + + DeviceInterface + + true + 107 + Ethernet62/1 + false + 62/1 + Ethernet244 + 50000 + + + DeviceInterface + + true + 108 + Ethernet62/3 + false + 62/3 + Ethernet246 + 50000 + + + DeviceInterface + + true + 109 + Ethernet63/1 + false + 63/1 + Ethernet248 + 50000 + + + DeviceInterface + + true + 110 + Ethernet63/3 + false + 63/3 + Ethernet250 + 50000 + + + DeviceInterface + + true + 111 + Ethernet64/1 + false + 64/1 + Ethernet252 + 50000 + + + DeviceInterface + + true + 112 + Ethernet64/3 + false + 64/3 + Ethernet254 + 50000 + + + true + 0 + Arista-7260CX3-D92C16 + + + + + + + + + LoopbackInterface + HostIP + Loopback0 + + 10.1.0.32/32 + + 10.1.0.32/32 + + + LoopbackInterface + HostIP1 + Loopback0 + + FC00:1::32/128 + + FC00:1::32/128 + + + + + ManagementInterface + ManagementIP + eth0 + + 10.3.146.57/23 + + 10.3.146.57/23 + + + ManagementInterface + v6ManagementIP + eth0 + + FC00:2::32/64 + + FC00:2::32/64 + + + + + + + + str-7260cx3-1 + + + PortChannelInterface + PortChannel1 + Ethernet13/1;Ethernet14/1 + + + + PortChannelInterface + PortChannel2 + Ethernet15/1;Ethernet16/1 + + + + PortChannelInterface + PortChannel3 + Ethernet17/1;Ethernet18/1 + + + + PortChannelInterface + PortChannel4 + Ethernet19/1;Ethernet20/1 + + + + + + VlanInterface + Vlan1000 + Ethernet11/1;Ethernet21/1;Ethernet44/1;Ethernet54/1;Ethernet23/1;Ethernet25/1;Ethernet27/1;Ethernet29/1;Ethernet31/1;Ethernet34/1;Ethernet36/1;Ethernet38/1;Ethernet40/1;Ethernet42/1 + 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 + + + + + IPInterface + + PortChannel1 + 10.0.0.56/31 + + + IPInterface + + PortChannel1 + FC00::71/126 + + + IPInterface + + PortChannel2 + 10.0.0.58/31 + + + IPInterface + + PortChannel2 + FC00::75/126 + + + IPInterface + + PortChannel3 + 10.0.0.60/31 + + + IPInterface + + PortChannel3 + FC00::79/126 + + + IPInterface + + PortChannel4 + 10.0.0.62/31 + + + IPInterface + + PortChannel4 + FC00::7D/126 + + + IPInterface + + Vlan1000 + 192.168.0.1/21 + + + IPInterface + + Vlan1000 + fc02:1000::1/64 + + + + + + ERSPAN + everflow + Everflow + + + ERSPANv6 + everflowV6 + Everflow + + + VTY_LINE + ssh-only + SSH + + + + + + + + str-7260cx3-1 + + + DeploymentId + + 2 + + + FirmwareProfile + + SONiC-Arista-7260CX364-D92C16-ToRRouter-Storage + + + NtpResources + Public.Ntp + 10.20.8.129;10.20.8.130 + + + SnmpResources + + 10.20.6.16 + + + SonicQosProfile + + Balanced + + + SyslogResources + + 10.64.246.95 + + + TacacsGroup + + Starlab + + + TacacsServer + 100.127.20.21 + + + + + + + + + + DeviceInterfaceLink + 100000 + ARISTA01T1 + Ethernet27/1 + str-7260cx3-1 + Ethernet13/1 + + + DeviceInterfaceLink + 100000 + ARISTA01T1 + Ethernet28/1 + str-7260cx3-1 + Ethernet14/1 + + + DeviceInterfaceLink + 100000 + ARISTA02T1 + Ethernet27/1 + str-7260cx3-1 + Ethernet15/1 + + + DeviceInterfaceLink + 100000 + ARISTA02T1 + Ethernet28/1 + str-7260cx3-1 + Ethernet16/1 + + + DeviceInterfaceLink + 100000 + ARISTA03T1 + Ethernet27/1 + str-7260cx3-1 + Ethernet17/1 + + + DeviceInterfaceLink + 100000 + ARISTA03T1 + Ethernet28/1 + str-7260cx3-1 + Ethernet18/1 + + + DeviceInterfaceLink + 100000 + ARISTA04T1 + Ethernet27/1 + str-7260cx3-1 + Ethernet19/1 + + + DeviceInterfaceLink + 100000 + ARISTA04T1 + Ethernet28/1 + str-7260cx3-1 + Ethernet20/1 + + + DeviceInterfaceLink + 50000 + str-7260cx3-1 + Ethernet11/1 + Server0 + eth0 + + + DeviceInterfaceLink + 50000 + str-7260cx3-1 + Ethernet21/1 + Server1 + eth0 + + + DeviceInterfaceLink + 50000 + str-7260cx3-1 + Ethernet23/1 + Server2 + eth0 + + + DeviceInterfaceLink + 50000 + str-7260cx3-1 + Ethernet25/1 + Server3 + eth0 + + + DeviceInterfaceLink + 50000 + str-7260cx3-1 + Ethernet27/1 + Server4 + eth0 + + + DeviceInterfaceLink + 50000 + str-7260cx3-1 + Ethernet29/1 + Server5 + eth0 + + + DeviceInterfaceLink + 50000 + str-7260cx3-1 + Ethernet31/1 + Server6 + eth0 + + + DeviceInterfaceLink + 50000 + str-7260cx3-1 + Ethernet34/1 + Server7 + eth0 + + + DeviceInterfaceLink + 50000 + str-7260cx3-1 + Ethernet36/1 + Server8 + eth0 + + + DeviceInterfaceLink + 50000 + str-7260cx3-1 + Ethernet38/1 + Server9 + eth0 + + + DeviceInterfaceLink + 50000 + str-7260cx3-1 + Ethernet40/1 + Server10 + eth0 + + + DeviceInterfaceLink + 50000 + str-7260cx3-1 + Ethernet42/1 + Server11 + eth0 + + + DeviceInterfaceLink + 50000 + str-7260cx3-1 + Ethernet44/1 + Server12 + eth0 + + + DeviceInterfaceLink + 50000 + str-7260cx3-1 + Ethernet54/1 + Server13 + eth0 + + + + + ToRRouter +
+ 10.3.146.57 +
+ + 10.3.146.57/23 + + str-7260cx3-1 + Arista-7260CX3-D92C16 +
+ + LeafRouter + + 172.16.137.124/23 + + ARISTA01T1 + Arista-VM + + + LeafRouter + + 172.16.137.125/23 + + ARISTA02T1 + Arista-VM + + + LeafRouter + + 172.16.137.126/23 + + ARISTA03T1 + Arista-VM + + + LeafRouter + + 172.16.137.127/23 + + ARISTA04T1 + Arista-VM + +
+
+ str-7260cx3-1 + Arista-7260CX3-D92C16 +
diff --git a/src/sonic-config-engine/tests/sample_output/py2/buffer-arista7260-t0.json b/src/sonic-config-engine/tests/sample_output/py2/buffer-arista7260-t0.json new file mode 100644 index 000000000000..cdb18cfa7777 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py2/buffer-arista7260-t0.json @@ -0,0 +1,426 @@ +{ + "CABLE_LENGTH": { + "AZURE": { + "Ethernet0": "5m", + "Ethernet2": "5m", + "Ethernet4": "5m", + "Ethernet6": "5m", + "Ethernet8": "5m", + "Ethernet10": "5m", + "Ethernet12": "5m", + "Ethernet14": "5m", + "Ethernet16": "5m", + "Ethernet18": "5m", + "Ethernet20": "5m", + "Ethernet22": "5m", + "Ethernet24": "5m", + "Ethernet26": "5m", + "Ethernet28": "5m", + "Ethernet30": "5m", + "Ethernet32": "5m", + "Ethernet34": "5m", + "Ethernet36": "5m", + "Ethernet38": "5m", + "Ethernet40": "5m", + "Ethernet42": "5m", + "Ethernet44": "5m", + "Ethernet46": "5m", + "Ethernet48": "40m", + "Ethernet52": "40m", + "Ethernet56": "40m", + "Ethernet60": "40m", + "Ethernet64": "40m", + "Ethernet68": "40m", + "Ethernet72": "40m", + "Ethernet76": "40m", + "Ethernet80": "5m", + "Ethernet82": "5m", + "Ethernet84": "5m", + "Ethernet86": "5m", + "Ethernet88": "5m", + "Ethernet90": "5m", + "Ethernet92": "5m", + "Ethernet94": "5m", + "Ethernet96": "5m", + "Ethernet98": "5m", + "Ethernet100": "5m", + "Ethernet102": "5m", + "Ethernet104": "5m", + "Ethernet106": "5m", + "Ethernet108": "5m", + "Ethernet110": "5m", + "Ethernet112": "5m", + "Ethernet114": "5m", + "Ethernet116": "5m", + "Ethernet118": "5m", + "Ethernet120": "5m", + "Ethernet122": "5m", + "Ethernet124": "5m", + "Ethernet126": "5m", + "Ethernet128": "5m", + "Ethernet130": "5m", + "Ethernet132": "5m", + "Ethernet134": "5m", + "Ethernet136": "5m", + "Ethernet138": "5m", + "Ethernet140": "5m", + "Ethernet142": "5m", + "Ethernet144": "5m", + "Ethernet146": "5m", + "Ethernet148": "5m", + "Ethernet150": "5m", + "Ethernet152": "5m", + "Ethernet154": "5m", + "Ethernet156": "5m", + "Ethernet158": "5m", + "Ethernet160": "5m", + "Ethernet162": "5m", + "Ethernet164": "5m", + "Ethernet166": "5m", + "Ethernet168": "5m", + "Ethernet170": "5m", + "Ethernet172": "5m", + "Ethernet174": "5m", + "Ethernet176": "5m", + "Ethernet180": "5m", + "Ethernet184": "5m", + "Ethernet188": "5m", + "Ethernet192": "5m", + "Ethernet196": "5m", + "Ethernet200": "5m", + "Ethernet204": "5m", + "Ethernet208": "5m", + "Ethernet210": "5m", + "Ethernet212": "5m", + "Ethernet214": "5m", + "Ethernet216": "5m", + "Ethernet218": "5m", + "Ethernet220": "5m", + "Ethernet222": "5m", + "Ethernet224": "5m", + "Ethernet226": "5m", + "Ethernet228": "5m", + "Ethernet230": "5m", + "Ethernet232": "5m", + "Ethernet234": "5m", + "Ethernet236": "5m", + "Ethernet238": "5m", + "Ethernet240": "5m", + "Ethernet242": "5m", + "Ethernet244": "5m", + "Ethernet246": "5m", + "Ethernet248": "5m", + "Ethernet250": "5m", + "Ethernet252": "5m", + "Ethernet254": "5m", + "Ethernet256": "5m", + "Ethernet260": "5m" + } + }, + + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "33329088", + "type": "ingress", + "mode": "dynamic", + "xoff": "7827456" + }, + "egress_lossy_pool": { + "size": "26663272", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "42349632", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"ingress_lossless_pool", + "size":"0", + "static_th":"44302336" + }, + "egress_lossless_profile": { + "pool":"egress_lossless_pool", + "size":"0", + "static_th":"42349632" + }, + "egress_lossy_profile": { + "pool":"egress_lossy_pool", + "size":"1664", + "dynamic_th":"-1" + } + }, + + "BUFFER_PG": { + "Ethernet48|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet52|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet56|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet60|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet64|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet68|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet72|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet76|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet40|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet80|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet88|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet96|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet104|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet112|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet120|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet132|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet140|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet148|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet156|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet164|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet172|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet212|0": { + "profile" : "ingress_lossy_profile" + } + }, + + "BUFFER_QUEUE": { + "Ethernet48|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet52|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet56|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet60|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet64|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet68|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet72|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet76|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet40|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet80|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet88|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet96|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet104|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet112|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet120|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet132|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet140|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet148|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet156|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet164|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet172|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet212|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet48|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet52|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet56|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet60|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet64|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet68|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet72|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet76|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet40|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet80|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet88|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet96|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet104|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet112|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet120|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet132|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet140|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet148|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet156|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet164|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet172|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet212|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet48|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet52|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet56|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet60|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet64|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet68|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet72|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet76|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet40|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet80|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet88|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet96|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet104|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet112|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet120|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet132|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet140|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet148|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet156|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet164|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet172|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet212|5-6": { + "profile" : "egress_lossy_profile" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py2/qos-arista7260-t0.json b/src/sonic-config-engine/tests/sample_output/py2/qos-arista7260-t0.json new file mode 100644 index 000000000000..a65953672924 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py2/qos-arista7260-t0.json @@ -0,0 +1,822 @@ +{ + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "0", + "2": "0", + "3": "3", + "4": "4", + "5": "0", + "6": "0", + "7": "7" + } + }, + "MAP_PFC_PRIORITY_TO_QUEUE": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "TC_TO_QUEUE_MAP": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "DSCP_TO_TC_MAP": { + "AZURE": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "2", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "1", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "6", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + } + }, + "SCHEDULER": { + "scheduler.0": { + "type" : "DWRR", + "weight": "14" + }, + "scheduler.1": { + "type" : "DWRR", + "weight": "15" + } + }, + "PORT_QOS_MAP": { + "global": { + "dscp_to_tc_map" : "AZURE" + }, + "Ethernet40": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet48": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet52": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet56": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet60": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet64": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet68": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet72": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet76": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet80": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet88": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet96": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet104": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet112": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet120": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet132": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet140": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet148": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet156": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet164": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet172": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet212": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + } + }, + "WRED_PROFILE": { + "AZURE_LOSSLESS" : { + "wred_green_enable" : "true", + "wred_yellow_enable" : "true", + "wred_red_enable" : "true", + "ecn" : "ecn_all", + "green_max_threshold" : "10000000", + "green_min_threshold" : "2000000", + "yellow_max_threshold" : "2097152", + "yellow_min_threshold" : "1048576", + "red_max_threshold" : "2097152", + "red_min_threshold" : "1048576", + "green_drop_probability" : "5", + "yellow_drop_probability": "5", + "red_drop_probability" : "5" + } + }, + "QUEUE": { + "Ethernet40|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet48|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet52|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet56|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet60|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet64|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet68|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet72|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet76|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet80|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet88|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet96|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet104|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet112|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet120|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet132|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet140|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet148|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet156|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet164|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet172|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet212|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet40|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet48|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet52|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet56|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet60|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet64|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet68|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet72|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet76|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet80|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet88|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet96|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet104|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet112|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet120|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet132|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet140|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet148|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet156|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet164|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet172|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet212|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet40|0": { + "scheduler": "scheduler.0" + }, + "Ethernet48|0": { + "scheduler": "scheduler.0" + }, + "Ethernet52|0": { + "scheduler": "scheduler.0" + }, + "Ethernet56|0": { + "scheduler": "scheduler.0" + }, + "Ethernet60|0": { + "scheduler": "scheduler.0" + }, + "Ethernet64|0": { + "scheduler": "scheduler.0" + }, + "Ethernet68|0": { + "scheduler": "scheduler.0" + }, + "Ethernet72|0": { + "scheduler": "scheduler.0" + }, + "Ethernet76|0": { + "scheduler": "scheduler.0" + }, + "Ethernet80|0": { + "scheduler": "scheduler.0" + }, + "Ethernet88|0": { + "scheduler": "scheduler.0" + }, + "Ethernet96|0": { + "scheduler": "scheduler.0" + }, + "Ethernet104|0": { + "scheduler": "scheduler.0" + }, + "Ethernet112|0": { + "scheduler": "scheduler.0" + }, + "Ethernet120|0": { + "scheduler": "scheduler.0" + }, + "Ethernet132|0": { + "scheduler": "scheduler.0" + }, + "Ethernet140|0": { + "scheduler": "scheduler.0" + }, + "Ethernet148|0": { + "scheduler": "scheduler.0" + }, + "Ethernet156|0": { + "scheduler": "scheduler.0" + }, + "Ethernet164|0": { + "scheduler": "scheduler.0" + }, + "Ethernet172|0": { + "scheduler": "scheduler.0" + }, + "Ethernet212|0": { + "scheduler": "scheduler.0" + }, + "Ethernet40|1": { + "scheduler": "scheduler.0" + }, + "Ethernet48|1": { + "scheduler": "scheduler.0" + }, + "Ethernet52|1": { + "scheduler": "scheduler.0" + }, + "Ethernet56|1": { + "scheduler": "scheduler.0" + }, + "Ethernet60|1": { + "scheduler": "scheduler.0" + }, + "Ethernet64|1": { + "scheduler": "scheduler.0" + }, + "Ethernet68|1": { + "scheduler": "scheduler.0" + }, + "Ethernet72|1": { + "scheduler": "scheduler.0" + }, + "Ethernet76|1": { + "scheduler": "scheduler.0" + }, + "Ethernet80|1": { + "scheduler": "scheduler.0" + }, + "Ethernet88|1": { + "scheduler": "scheduler.0" + }, + "Ethernet96|1": { + "scheduler": "scheduler.0" + }, + "Ethernet104|1": { + "scheduler": "scheduler.0" + }, + "Ethernet112|1": { + "scheduler": "scheduler.0" + }, + "Ethernet120|1": { + "scheduler": "scheduler.0" + }, + "Ethernet132|1": { + "scheduler": "scheduler.0" + }, + "Ethernet140|1": { + "scheduler": "scheduler.0" + }, + "Ethernet148|1": { + "scheduler": "scheduler.0" + }, + "Ethernet156|1": { + "scheduler": "scheduler.0" + }, + "Ethernet164|1": { + "scheduler": "scheduler.0" + }, + "Ethernet172|1": { + "scheduler": "scheduler.0" + }, + "Ethernet212|1": { + "scheduler": "scheduler.0" + }, + "Ethernet40|2": { + "scheduler": "scheduler.0" + }, + "Ethernet48|2": { + "scheduler": "scheduler.0" + }, + "Ethernet52|2": { + "scheduler": "scheduler.0" + }, + "Ethernet56|2": { + "scheduler": "scheduler.0" + }, + "Ethernet60|2": { + "scheduler": "scheduler.0" + }, + "Ethernet64|2": { + "scheduler": "scheduler.0" + }, + "Ethernet68|2": { + "scheduler": "scheduler.0" + }, + "Ethernet72|2": { + "scheduler": "scheduler.0" + }, + "Ethernet76|2": { + "scheduler": "scheduler.0" + }, + "Ethernet80|2": { + "scheduler": "scheduler.0" + }, + "Ethernet88|2": { + "scheduler": "scheduler.0" + }, + "Ethernet96|2": { + "scheduler": "scheduler.0" + }, + "Ethernet104|2": { + "scheduler": "scheduler.0" + }, + "Ethernet112|2": { + "scheduler": "scheduler.0" + }, + "Ethernet120|2": { + "scheduler": "scheduler.0" + }, + "Ethernet132|2": { + "scheduler": "scheduler.0" + }, + "Ethernet140|2": { + "scheduler": "scheduler.0" + }, + "Ethernet148|2": { + "scheduler": "scheduler.0" + }, + "Ethernet156|2": { + "scheduler": "scheduler.0" + }, + "Ethernet164|2": { + "scheduler": "scheduler.0" + }, + "Ethernet172|2": { + "scheduler": "scheduler.0" + }, + "Ethernet212|2": { + "scheduler": "scheduler.0" + }, + "Ethernet40|5": { + "scheduler": "scheduler.0" + }, + "Ethernet48|5": { + "scheduler": "scheduler.0" + }, + "Ethernet52|5": { + "scheduler": "scheduler.0" + }, + "Ethernet56|5": { + "scheduler": "scheduler.0" + }, + "Ethernet60|5": { + "scheduler": "scheduler.0" + }, + "Ethernet64|5": { + "scheduler": "scheduler.0" + }, + "Ethernet68|5": { + "scheduler": "scheduler.0" + }, + "Ethernet72|5": { + "scheduler": "scheduler.0" + }, + "Ethernet76|5": { + "scheduler": "scheduler.0" + }, + "Ethernet80|5": { + "scheduler": "scheduler.0" + }, + "Ethernet88|5": { + "scheduler": "scheduler.0" + }, + "Ethernet96|5": { + "scheduler": "scheduler.0" + }, + "Ethernet104|5": { + "scheduler": "scheduler.0" + }, + "Ethernet112|5": { + "scheduler": "scheduler.0" + }, + "Ethernet120|5": { + "scheduler": "scheduler.0" + }, + "Ethernet132|5": { + "scheduler": "scheduler.0" + }, + "Ethernet140|5": { + "scheduler": "scheduler.0" + }, + "Ethernet148|5": { + "scheduler": "scheduler.0" + }, + "Ethernet156|5": { + "scheduler": "scheduler.0" + }, + "Ethernet164|5": { + "scheduler": "scheduler.0" + }, + "Ethernet172|5": { + "scheduler": "scheduler.0" + }, + "Ethernet212|5": { + "scheduler": "scheduler.0" + }, + "Ethernet40|6": { + "scheduler": "scheduler.0" + }, + "Ethernet48|6": { + "scheduler": "scheduler.0" + }, + "Ethernet52|6": { + "scheduler": "scheduler.0" + }, + "Ethernet56|6": { + "scheduler": "scheduler.0" + }, + "Ethernet60|6": { + "scheduler": "scheduler.0" + }, + "Ethernet64|6": { + "scheduler": "scheduler.0" + }, + "Ethernet68|6": { + "scheduler": "scheduler.0" + }, + "Ethernet72|6": { + "scheduler": "scheduler.0" + }, + "Ethernet76|6": { + "scheduler": "scheduler.0" + }, + "Ethernet80|6": { + "scheduler": "scheduler.0" + }, + "Ethernet88|6": { + "scheduler": "scheduler.0" + }, + "Ethernet96|6": { + "scheduler": "scheduler.0" + }, + "Ethernet104|6": { + "scheduler": "scheduler.0" + }, + "Ethernet112|6": { + "scheduler": "scheduler.0" + }, + "Ethernet120|6": { + "scheduler": "scheduler.0" + }, + "Ethernet132|6": { + "scheduler": "scheduler.0" + }, + "Ethernet140|6": { + "scheduler": "scheduler.0" + }, + "Ethernet148|6": { + "scheduler": "scheduler.0" + }, + "Ethernet156|6": { + "scheduler": "scheduler.0" + }, + "Ethernet164|6": { + "scheduler": "scheduler.0" + }, + "Ethernet172|6": { + "scheduler": "scheduler.0" + }, + "Ethernet212|6": { + "scheduler": "scheduler.0" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py3/buffer-arista7260-t0.json b/src/sonic-config-engine/tests/sample_output/py3/buffer-arista7260-t0.json new file mode 100644 index 000000000000..cdb18cfa7777 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/buffer-arista7260-t0.json @@ -0,0 +1,426 @@ +{ + "CABLE_LENGTH": { + "AZURE": { + "Ethernet0": "5m", + "Ethernet2": "5m", + "Ethernet4": "5m", + "Ethernet6": "5m", + "Ethernet8": "5m", + "Ethernet10": "5m", + "Ethernet12": "5m", + "Ethernet14": "5m", + "Ethernet16": "5m", + "Ethernet18": "5m", + "Ethernet20": "5m", + "Ethernet22": "5m", + "Ethernet24": "5m", + "Ethernet26": "5m", + "Ethernet28": "5m", + "Ethernet30": "5m", + "Ethernet32": "5m", + "Ethernet34": "5m", + "Ethernet36": "5m", + "Ethernet38": "5m", + "Ethernet40": "5m", + "Ethernet42": "5m", + "Ethernet44": "5m", + "Ethernet46": "5m", + "Ethernet48": "40m", + "Ethernet52": "40m", + "Ethernet56": "40m", + "Ethernet60": "40m", + "Ethernet64": "40m", + "Ethernet68": "40m", + "Ethernet72": "40m", + "Ethernet76": "40m", + "Ethernet80": "5m", + "Ethernet82": "5m", + "Ethernet84": "5m", + "Ethernet86": "5m", + "Ethernet88": "5m", + "Ethernet90": "5m", + "Ethernet92": "5m", + "Ethernet94": "5m", + "Ethernet96": "5m", + "Ethernet98": "5m", + "Ethernet100": "5m", + "Ethernet102": "5m", + "Ethernet104": "5m", + "Ethernet106": "5m", + "Ethernet108": "5m", + "Ethernet110": "5m", + "Ethernet112": "5m", + "Ethernet114": "5m", + "Ethernet116": "5m", + "Ethernet118": "5m", + "Ethernet120": "5m", + "Ethernet122": "5m", + "Ethernet124": "5m", + "Ethernet126": "5m", + "Ethernet128": "5m", + "Ethernet130": "5m", + "Ethernet132": "5m", + "Ethernet134": "5m", + "Ethernet136": "5m", + "Ethernet138": "5m", + "Ethernet140": "5m", + "Ethernet142": "5m", + "Ethernet144": "5m", + "Ethernet146": "5m", + "Ethernet148": "5m", + "Ethernet150": "5m", + "Ethernet152": "5m", + "Ethernet154": "5m", + "Ethernet156": "5m", + "Ethernet158": "5m", + "Ethernet160": "5m", + "Ethernet162": "5m", + "Ethernet164": "5m", + "Ethernet166": "5m", + "Ethernet168": "5m", + "Ethernet170": "5m", + "Ethernet172": "5m", + "Ethernet174": "5m", + "Ethernet176": "5m", + "Ethernet180": "5m", + "Ethernet184": "5m", + "Ethernet188": "5m", + "Ethernet192": "5m", + "Ethernet196": "5m", + "Ethernet200": "5m", + "Ethernet204": "5m", + "Ethernet208": "5m", + "Ethernet210": "5m", + "Ethernet212": "5m", + "Ethernet214": "5m", + "Ethernet216": "5m", + "Ethernet218": "5m", + "Ethernet220": "5m", + "Ethernet222": "5m", + "Ethernet224": "5m", + "Ethernet226": "5m", + "Ethernet228": "5m", + "Ethernet230": "5m", + "Ethernet232": "5m", + "Ethernet234": "5m", + "Ethernet236": "5m", + "Ethernet238": "5m", + "Ethernet240": "5m", + "Ethernet242": "5m", + "Ethernet244": "5m", + "Ethernet246": "5m", + "Ethernet248": "5m", + "Ethernet250": "5m", + "Ethernet252": "5m", + "Ethernet254": "5m", + "Ethernet256": "5m", + "Ethernet260": "5m" + } + }, + + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "33329088", + "type": "ingress", + "mode": "dynamic", + "xoff": "7827456" + }, + "egress_lossy_pool": { + "size": "26663272", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "42349632", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"ingress_lossless_pool", + "size":"0", + "static_th":"44302336" + }, + "egress_lossless_profile": { + "pool":"egress_lossless_pool", + "size":"0", + "static_th":"42349632" + }, + "egress_lossy_profile": { + "pool":"egress_lossy_pool", + "size":"1664", + "dynamic_th":"-1" + } + }, + + "BUFFER_PG": { + "Ethernet48|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet52|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet56|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet60|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet64|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet68|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet72|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet76|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet40|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet80|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet88|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet96|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet104|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet112|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet120|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet132|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet140|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet148|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet156|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet164|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet172|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet212|0": { + "profile" : "ingress_lossy_profile" + } + }, + + "BUFFER_QUEUE": { + "Ethernet48|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet52|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet56|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet60|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet64|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet68|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet72|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet76|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet40|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet80|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet88|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet96|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet104|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet112|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet120|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet132|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet140|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet148|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet156|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet164|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet172|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet212|3-4": { + "profile" : "egress_lossless_profile" + }, + "Ethernet48|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet52|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet56|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet60|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet64|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet68|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet72|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet76|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet40|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet80|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet88|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet96|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet104|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet112|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet120|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet132|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet140|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet148|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet156|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet164|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet172|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet212|0-2": { + "profile" : "egress_lossy_profile" + }, + "Ethernet48|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet52|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet56|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet60|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet64|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet68|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet72|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet76|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet40|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet80|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet88|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet96|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet104|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet112|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet120|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet132|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet140|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet148|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet156|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet164|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet172|5-6": { + "profile" : "egress_lossy_profile" + }, + "Ethernet212|5-6": { + "profile" : "egress_lossy_profile" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-t0.json b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-t0.json new file mode 100644 index 000000000000..a65953672924 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-t0.json @@ -0,0 +1,822 @@ +{ + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "0", + "2": "0", + "3": "3", + "4": "4", + "5": "0", + "6": "0", + "7": "7" + } + }, + "MAP_PFC_PRIORITY_TO_QUEUE": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "TC_TO_QUEUE_MAP": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "DSCP_TO_TC_MAP": { + "AZURE": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "2", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "1", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "6", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + } + }, + "SCHEDULER": { + "scheduler.0": { + "type" : "DWRR", + "weight": "14" + }, + "scheduler.1": { + "type" : "DWRR", + "weight": "15" + } + }, + "PORT_QOS_MAP": { + "global": { + "dscp_to_tc_map" : "AZURE" + }, + "Ethernet40": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet48": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet52": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet56": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet60": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet64": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet68": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet72": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet76": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet80": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet88": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet96": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet104": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet112": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet120": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet132": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet140": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet148": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet156": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet164": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet172": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet212": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + } + }, + "WRED_PROFILE": { + "AZURE_LOSSLESS" : { + "wred_green_enable" : "true", + "wred_yellow_enable" : "true", + "wred_red_enable" : "true", + "ecn" : "ecn_all", + "green_max_threshold" : "10000000", + "green_min_threshold" : "2000000", + "yellow_max_threshold" : "2097152", + "yellow_min_threshold" : "1048576", + "red_max_threshold" : "2097152", + "red_min_threshold" : "1048576", + "green_drop_probability" : "5", + "yellow_drop_probability": "5", + "red_drop_probability" : "5" + } + }, + "QUEUE": { + "Ethernet40|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet48|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet52|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet56|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet60|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet64|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet68|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet72|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet76|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet80|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet88|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet96|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet104|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet112|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet120|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet132|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet140|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet148|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet156|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet164|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet172|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet212|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet40|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet48|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet52|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet56|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet60|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet64|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet68|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet72|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet76|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet80|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet88|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet96|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet104|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet112|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet120|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet132|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet140|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet148|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet156|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet164|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet172|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet212|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet40|0": { + "scheduler": "scheduler.0" + }, + "Ethernet48|0": { + "scheduler": "scheduler.0" + }, + "Ethernet52|0": { + "scheduler": "scheduler.0" + }, + "Ethernet56|0": { + "scheduler": "scheduler.0" + }, + "Ethernet60|0": { + "scheduler": "scheduler.0" + }, + "Ethernet64|0": { + "scheduler": "scheduler.0" + }, + "Ethernet68|0": { + "scheduler": "scheduler.0" + }, + "Ethernet72|0": { + "scheduler": "scheduler.0" + }, + "Ethernet76|0": { + "scheduler": "scheduler.0" + }, + "Ethernet80|0": { + "scheduler": "scheduler.0" + }, + "Ethernet88|0": { + "scheduler": "scheduler.0" + }, + "Ethernet96|0": { + "scheduler": "scheduler.0" + }, + "Ethernet104|0": { + "scheduler": "scheduler.0" + }, + "Ethernet112|0": { + "scheduler": "scheduler.0" + }, + "Ethernet120|0": { + "scheduler": "scheduler.0" + }, + "Ethernet132|0": { + "scheduler": "scheduler.0" + }, + "Ethernet140|0": { + "scheduler": "scheduler.0" + }, + "Ethernet148|0": { + "scheduler": "scheduler.0" + }, + "Ethernet156|0": { + "scheduler": "scheduler.0" + }, + "Ethernet164|0": { + "scheduler": "scheduler.0" + }, + "Ethernet172|0": { + "scheduler": "scheduler.0" + }, + "Ethernet212|0": { + "scheduler": "scheduler.0" + }, + "Ethernet40|1": { + "scheduler": "scheduler.0" + }, + "Ethernet48|1": { + "scheduler": "scheduler.0" + }, + "Ethernet52|1": { + "scheduler": "scheduler.0" + }, + "Ethernet56|1": { + "scheduler": "scheduler.0" + }, + "Ethernet60|1": { + "scheduler": "scheduler.0" + }, + "Ethernet64|1": { + "scheduler": "scheduler.0" + }, + "Ethernet68|1": { + "scheduler": "scheduler.0" + }, + "Ethernet72|1": { + "scheduler": "scheduler.0" + }, + "Ethernet76|1": { + "scheduler": "scheduler.0" + }, + "Ethernet80|1": { + "scheduler": "scheduler.0" + }, + "Ethernet88|1": { + "scheduler": "scheduler.0" + }, + "Ethernet96|1": { + "scheduler": "scheduler.0" + }, + "Ethernet104|1": { + "scheduler": "scheduler.0" + }, + "Ethernet112|1": { + "scheduler": "scheduler.0" + }, + "Ethernet120|1": { + "scheduler": "scheduler.0" + }, + "Ethernet132|1": { + "scheduler": "scheduler.0" + }, + "Ethernet140|1": { + "scheduler": "scheduler.0" + }, + "Ethernet148|1": { + "scheduler": "scheduler.0" + }, + "Ethernet156|1": { + "scheduler": "scheduler.0" + }, + "Ethernet164|1": { + "scheduler": "scheduler.0" + }, + "Ethernet172|1": { + "scheduler": "scheduler.0" + }, + "Ethernet212|1": { + "scheduler": "scheduler.0" + }, + "Ethernet40|2": { + "scheduler": "scheduler.0" + }, + "Ethernet48|2": { + "scheduler": "scheduler.0" + }, + "Ethernet52|2": { + "scheduler": "scheduler.0" + }, + "Ethernet56|2": { + "scheduler": "scheduler.0" + }, + "Ethernet60|2": { + "scheduler": "scheduler.0" + }, + "Ethernet64|2": { + "scheduler": "scheduler.0" + }, + "Ethernet68|2": { + "scheduler": "scheduler.0" + }, + "Ethernet72|2": { + "scheduler": "scheduler.0" + }, + "Ethernet76|2": { + "scheduler": "scheduler.0" + }, + "Ethernet80|2": { + "scheduler": "scheduler.0" + }, + "Ethernet88|2": { + "scheduler": "scheduler.0" + }, + "Ethernet96|2": { + "scheduler": "scheduler.0" + }, + "Ethernet104|2": { + "scheduler": "scheduler.0" + }, + "Ethernet112|2": { + "scheduler": "scheduler.0" + }, + "Ethernet120|2": { + "scheduler": "scheduler.0" + }, + "Ethernet132|2": { + "scheduler": "scheduler.0" + }, + "Ethernet140|2": { + "scheduler": "scheduler.0" + }, + "Ethernet148|2": { + "scheduler": "scheduler.0" + }, + "Ethernet156|2": { + "scheduler": "scheduler.0" + }, + "Ethernet164|2": { + "scheduler": "scheduler.0" + }, + "Ethernet172|2": { + "scheduler": "scheduler.0" + }, + "Ethernet212|2": { + "scheduler": "scheduler.0" + }, + "Ethernet40|5": { + "scheduler": "scheduler.0" + }, + "Ethernet48|5": { + "scheduler": "scheduler.0" + }, + "Ethernet52|5": { + "scheduler": "scheduler.0" + }, + "Ethernet56|5": { + "scheduler": "scheduler.0" + }, + "Ethernet60|5": { + "scheduler": "scheduler.0" + }, + "Ethernet64|5": { + "scheduler": "scheduler.0" + }, + "Ethernet68|5": { + "scheduler": "scheduler.0" + }, + "Ethernet72|5": { + "scheduler": "scheduler.0" + }, + "Ethernet76|5": { + "scheduler": "scheduler.0" + }, + "Ethernet80|5": { + "scheduler": "scheduler.0" + }, + "Ethernet88|5": { + "scheduler": "scheduler.0" + }, + "Ethernet96|5": { + "scheduler": "scheduler.0" + }, + "Ethernet104|5": { + "scheduler": "scheduler.0" + }, + "Ethernet112|5": { + "scheduler": "scheduler.0" + }, + "Ethernet120|5": { + "scheduler": "scheduler.0" + }, + "Ethernet132|5": { + "scheduler": "scheduler.0" + }, + "Ethernet140|5": { + "scheduler": "scheduler.0" + }, + "Ethernet148|5": { + "scheduler": "scheduler.0" + }, + "Ethernet156|5": { + "scheduler": "scheduler.0" + }, + "Ethernet164|5": { + "scheduler": "scheduler.0" + }, + "Ethernet172|5": { + "scheduler": "scheduler.0" + }, + "Ethernet212|5": { + "scheduler": "scheduler.0" + }, + "Ethernet40|6": { + "scheduler": "scheduler.0" + }, + "Ethernet48|6": { + "scheduler": "scheduler.0" + }, + "Ethernet52|6": { + "scheduler": "scheduler.0" + }, + "Ethernet56|6": { + "scheduler": "scheduler.0" + }, + "Ethernet60|6": { + "scheduler": "scheduler.0" + }, + "Ethernet64|6": { + "scheduler": "scheduler.0" + }, + "Ethernet68|6": { + "scheduler": "scheduler.0" + }, + "Ethernet72|6": { + "scheduler": "scheduler.0" + }, + "Ethernet76|6": { + "scheduler": "scheduler.0" + }, + "Ethernet80|6": { + "scheduler": "scheduler.0" + }, + "Ethernet88|6": { + "scheduler": "scheduler.0" + }, + "Ethernet96|6": { + "scheduler": "scheduler.0" + }, + "Ethernet104|6": { + "scheduler": "scheduler.0" + }, + "Ethernet112|6": { + "scheduler": "scheduler.0" + }, + "Ethernet120|6": { + "scheduler": "scheduler.0" + }, + "Ethernet132|6": { + "scheduler": "scheduler.0" + }, + "Ethernet140|6": { + "scheduler": "scheduler.0" + }, + "Ethernet148|6": { + "scheduler": "scheduler.0" + }, + "Ethernet156|6": { + "scheduler": "scheduler.0" + }, + "Ethernet164|6": { + "scheduler": "scheduler.0" + }, + "Ethernet172|6": { + "scheduler": "scheduler.0" + }, + "Ethernet212|6": { + "scheduler": "scheduler.0" + } + } +} diff --git a/src/sonic-config-engine/tests/test_j2files.py b/src/sonic-config-engine/tests/test_j2files.py index 5f317855072c..9e6cfaf2fbd6 100644 --- a/src/sonic-config-engine/tests/test_j2files.py +++ b/src/sonic-config-engine/tests/test_j2files.py @@ -363,6 +363,9 @@ def test_qos_dell6100_render_template(self): 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_arista7260t0_render_template(self): + self._test_qos_render_template('arista', 'x86_64-arista_7260cx3_64', 'Arista-7260CX3-D92C16', 'sample-arista-7260-t0-minigraph.xml', 'qos-arista7260-t0.json') + 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) @@ -551,6 +554,9 @@ def test_buffers_dell6100_render_template(self): 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') + def test_buffers_arista7260_render_template(self): + self._test_buffers_render_template('arista', 'x86_64-arista_7260cx3_64', 'Arista-7260CX3-D92C16', 'sample-arista-7260-t0-minigraph.xml', 'buffers.json.j2', 'buffer-arista7260-t0.json') + def test_buffers_mellanox2410_dynamic_render_template(self): self._test_buffers_render_template('mellanox', 'x86_64-mlnx_msn2410-r0', 'ACS-MSN2410', 'sample-mellanox-2410-t1-minigraph.xml', 'buffers_dynamic.json.j2', 'buffers-mellanox2410-dynamic.json') From 9c324a534980843e29209761226b96d7f864c259 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 20 Apr 2024 16:01:09 +0800 Subject: [PATCH 254/419] [submodule] Update submodule sonic-platform-common to the latest HEAD automatically (#18723) #### Why I did it src/sonic-platform-common ``` * 401e702 - (HEAD -> 202311, origin/202311) Separate common code for remote target FW upgrade supported optics (#453) (34 hours ago) [mihirpat1] ``` #### How I did it #### How to verify it #### Description for the changelog --- 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 4dfc01fcfdf4..401e702df732 160000 --- a/src/sonic-platform-common +++ b/src/sonic-platform-common @@ -1 +1 @@ -Subproject commit 4dfc01fcfdf4f71f622f9aae0a5a7f1a175f5ee0 +Subproject commit 401e702df732f3bc2cabb7a7288bdbae41f00325 From c609af64d7cc3dae76992d988e2b634dd1fb1278 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 20 Apr 2024 19:01:03 +0800 Subject: [PATCH 255/419] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#18725) #### Why I did it src/sonic-swss ``` * 5eadb794 - (HEAD -> 202311, origin/202311) [202311][portsorch] Handle TRANSCEIVER_INFO table on warm boot (#3107) (30 hours ago) [Stepan Blyshchak] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 8fd34c1f7e1a..5eadb794ad96 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 8fd34c1f7e1aeecc2585a39e58ef4b02be7d7d07 +Subproject commit 5eadb794ad963c71947ec5c51ca020e9b2b6a880 From b23f6f2b9748d97fb54f2291bb85da6b2ff7eb74 Mon Sep 17 00:00:00 2001 From: Vadym Hlushko <62022266+vadymhlushko-mlnx@users.noreply.github.com> Date: Mon, 22 Apr 2024 19:38:24 +0200 Subject: [PATCH 256/419] [202311][graceful reboot] Rename the platform_reboot to the pre_reboot_hook, remove the sysfs power cycle (#18325) * [graceful reboot] Rename platform_reboot script to pre_reboot_hook, remove sysfs power cycle, and Debina reboot Signed-off-by: vadymhlushko-mlnx --- .../x86_64-mlnx_lssn2700-r0/platform_reboot | 1 - .../x86_64-mlnx_lssn2700-r0/pre_reboot_hook | 1 + .../x86_64-mlnx_msn2010-r0/platform_reboot | 1 - .../x86_64-mlnx_msn2010-r0/pre_reboot_hook | 1 + .../x86_64-mlnx_msn2100-r0/platform_reboot | 1 - .../x86_64-mlnx_msn2100-r0/pre_reboot_hook | 1 + .../x86_64-mlnx_msn2410-r0/platform_reboot | 1 - .../x86_64-mlnx_msn2410-r0/pre_reboot_hook | 1 + .../x86_64-mlnx_msn2700-r0/platform_reboot | 55 ------------------- .../x86_64-mlnx_msn2700-r0/pre_reboot_hook | 34 ++++++++++++ .../x86_64-mlnx_msn2700a1-r0/platform_reboot | 1 - .../x86_64-mlnx_msn2700a1-r0/pre_reboot_hook | 1 + .../x86_64-mlnx_msn2740-r0/platform_reboot | 1 - .../x86_64-mlnx_msn2740-r0/pre_reboot_hook | 1 + .../x86_64-mlnx_msn3420-r0/platform_reboot | 1 - .../x86_64-mlnx_msn3420-r0/pre_reboot_hook | 1 + .../x86_64-mlnx_msn3700-r0/platform_reboot | 1 - .../x86_64-mlnx_msn3700-r0/pre_reboot_hook | 1 + .../x86_64-mlnx_msn3700c-r0/platform_reboot | 1 - .../x86_64-mlnx_msn3700c-r0/pre_reboot_hook | 1 + .../x86_64-mlnx_msn3800-r0/platform_reboot | 1 - .../x86_64-mlnx_msn3800-r0/pre_reboot_hook | 1 + .../x86_64-mlnx_msn4410-r0/platform_reboot | 1 - .../x86_64-mlnx_msn4410-r0/pre_reboot_hook | 1 + .../x86_64-mlnx_msn4600-r0/platform_reboot | 1 - .../x86_64-mlnx_msn4600-r0/pre_reboot_hook | 1 + .../x86_64-mlnx_msn4600c-r0/platform_reboot | 1 - .../x86_64-mlnx_msn4600c-r0/pre_reboot_hook | 1 + .../x86_64-mlnx_msn4700-r0/platform_reboot | 1 - .../x86_64-mlnx_msn4700-r0/pre_reboot_hook | 1 + .../x86_64-nvidia_sn2201-r0/platform_reboot | 1 - .../x86_64-nvidia_sn2201-r0/pre_reboot_hook | 1 + .../x86_64-nvidia_sn4800-r0/platform_reboot | 1 - .../x86_64-nvidia_sn4800-r0/pre_reboot_hook | 1 + .../x86_64-nvidia_sn5600-r0/platform_reboot | 1 - .../x86_64-nvidia_sn5600-r0/pre_reboot_hook | 1 + 36 files changed, 51 insertions(+), 72 deletions(-) delete mode 120000 device/mellanox/x86_64-mlnx_lssn2700-r0/platform_reboot create mode 120000 device/mellanox/x86_64-mlnx_lssn2700-r0/pre_reboot_hook delete mode 120000 device/mellanox/x86_64-mlnx_msn2010-r0/platform_reboot create mode 120000 device/mellanox/x86_64-mlnx_msn2010-r0/pre_reboot_hook delete mode 120000 device/mellanox/x86_64-mlnx_msn2100-r0/platform_reboot create mode 120000 device/mellanox/x86_64-mlnx_msn2100-r0/pre_reboot_hook delete mode 120000 device/mellanox/x86_64-mlnx_msn2410-r0/platform_reboot create mode 120000 device/mellanox/x86_64-mlnx_msn2410-r0/pre_reboot_hook delete mode 100755 device/mellanox/x86_64-mlnx_msn2700-r0/platform_reboot create mode 100755 device/mellanox/x86_64-mlnx_msn2700-r0/pre_reboot_hook delete mode 120000 device/mellanox/x86_64-mlnx_msn2700a1-r0/platform_reboot create mode 120000 device/mellanox/x86_64-mlnx_msn2700a1-r0/pre_reboot_hook delete mode 120000 device/mellanox/x86_64-mlnx_msn2740-r0/platform_reboot create mode 120000 device/mellanox/x86_64-mlnx_msn2740-r0/pre_reboot_hook delete mode 120000 device/mellanox/x86_64-mlnx_msn3420-r0/platform_reboot create mode 120000 device/mellanox/x86_64-mlnx_msn3420-r0/pre_reboot_hook delete mode 120000 device/mellanox/x86_64-mlnx_msn3700-r0/platform_reboot create mode 120000 device/mellanox/x86_64-mlnx_msn3700-r0/pre_reboot_hook delete mode 120000 device/mellanox/x86_64-mlnx_msn3700c-r0/platform_reboot create mode 120000 device/mellanox/x86_64-mlnx_msn3700c-r0/pre_reboot_hook delete mode 120000 device/mellanox/x86_64-mlnx_msn3800-r0/platform_reboot create mode 120000 device/mellanox/x86_64-mlnx_msn3800-r0/pre_reboot_hook delete mode 120000 device/mellanox/x86_64-mlnx_msn4410-r0/platform_reboot create mode 120000 device/mellanox/x86_64-mlnx_msn4410-r0/pre_reboot_hook delete mode 120000 device/mellanox/x86_64-mlnx_msn4600-r0/platform_reboot create mode 120000 device/mellanox/x86_64-mlnx_msn4600-r0/pre_reboot_hook delete mode 120000 device/mellanox/x86_64-mlnx_msn4600c-r0/platform_reboot create mode 120000 device/mellanox/x86_64-mlnx_msn4600c-r0/pre_reboot_hook delete mode 120000 device/mellanox/x86_64-mlnx_msn4700-r0/platform_reboot create mode 120000 device/mellanox/x86_64-mlnx_msn4700-r0/pre_reboot_hook delete mode 120000 device/mellanox/x86_64-nvidia_sn2201-r0/platform_reboot create mode 120000 device/mellanox/x86_64-nvidia_sn2201-r0/pre_reboot_hook delete mode 120000 device/mellanox/x86_64-nvidia_sn4800-r0/platform_reboot create mode 120000 device/mellanox/x86_64-nvidia_sn4800-r0/pre_reboot_hook delete mode 120000 device/mellanox/x86_64-nvidia_sn5600-r0/platform_reboot create mode 120000 device/mellanox/x86_64-nvidia_sn5600-r0/pre_reboot_hook diff --git a/device/mellanox/x86_64-mlnx_lssn2700-r0/platform_reboot b/device/mellanox/x86_64-mlnx_lssn2700-r0/platform_reboot deleted file mode 120000 index 43c8ea567493..000000000000 --- a/device/mellanox/x86_64-mlnx_lssn2700-r0/platform_reboot +++ /dev/null @@ -1 +0,0 @@ -../x86_64-mlnx_msn2700-r0/platform_reboot \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_lssn2700-r0/pre_reboot_hook b/device/mellanox/x86_64-mlnx_lssn2700-r0/pre_reboot_hook new file mode 120000 index 000000000000..6fc31078ee86 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_lssn2700-r0/pre_reboot_hook @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/pre_reboot_hook \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2010-r0/platform_reboot b/device/mellanox/x86_64-mlnx_msn2010-r0/platform_reboot deleted file mode 120000 index 43c8ea567493..000000000000 --- a/device/mellanox/x86_64-mlnx_msn2010-r0/platform_reboot +++ /dev/null @@ -1 +0,0 @@ -../x86_64-mlnx_msn2700-r0/platform_reboot \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2010-r0/pre_reboot_hook b/device/mellanox/x86_64-mlnx_msn2010-r0/pre_reboot_hook new file mode 120000 index 000000000000..6fc31078ee86 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2010-r0/pre_reboot_hook @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/pre_reboot_hook \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2100-r0/platform_reboot b/device/mellanox/x86_64-mlnx_msn2100-r0/platform_reboot deleted file mode 120000 index 43c8ea567493..000000000000 --- a/device/mellanox/x86_64-mlnx_msn2100-r0/platform_reboot +++ /dev/null @@ -1 +0,0 @@ -../x86_64-mlnx_msn2700-r0/platform_reboot \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2100-r0/pre_reboot_hook b/device/mellanox/x86_64-mlnx_msn2100-r0/pre_reboot_hook new file mode 120000 index 000000000000..6fc31078ee86 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2100-r0/pre_reboot_hook @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/pre_reboot_hook \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2410-r0/platform_reboot b/device/mellanox/x86_64-mlnx_msn2410-r0/platform_reboot deleted file mode 120000 index 43c8ea567493..000000000000 --- a/device/mellanox/x86_64-mlnx_msn2410-r0/platform_reboot +++ /dev/null @@ -1 +0,0 @@ -../x86_64-mlnx_msn2700-r0/platform_reboot \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2410-r0/pre_reboot_hook b/device/mellanox/x86_64-mlnx_msn2410-r0/pre_reboot_hook new file mode 120000 index 000000000000..6fc31078ee86 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2410-r0/pre_reboot_hook @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/pre_reboot_hook \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/platform_reboot b/device/mellanox/x86_64-mlnx_msn2700-r0/platform_reboot deleted file mode 100755 index 9b68790498a1..000000000000 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/platform_reboot +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash - -declare -r EXIT_SUCCESS="0" -declare -r EXIT_ERROR="1" - -declare -r PENDING_COMPONENT_FW="/usr/bin/install-pending-fw.py" -declare -r FW_UPGRADE_SCRIPT="/usr/bin/mlnx-fw-upgrade.sh" -declare -r SYSFS_PWR_CYCLE="/var/run/hw-management/system/pwr_cycle" - -FORCE_REBOOT="no" - -function ParseArguments() { - while [ $# -ge 1 ]; do - case "$1" in - -f|--force) - FORCE_REBOOT="yes" - ;; - esac - shift - done -} - -function SafePwrCycle() { - sync; sync - umount -fa > /dev/null 2>&1 - echo 1 > $SYSFS_PWR_CYCLE -} - -ParseArguments "$@" - -# Reboot immediately if the kdump capture kernel is running -VMCORE_FILE=/proc/vmcore -if [ -s $VMCORE_FILE ]; then - sync; sync - umount -fa > /dev/null 2>&1 - - # Run Debian reboot because the platform reboot isn't available - /sbin/reboot -fi - - -${FW_UPGRADE_SCRIPT} --upgrade --verbose -EXIT_CODE="$?" -if [[ "${EXIT_CODE}" != "${EXIT_SUCCESS}" ]]; then - echo "Failed to burn MLNX FW: errno=${EXIT_CODE}" - - if [[ "${FORCE_REBOOT}" != "yes" ]]; then - echo "Reboot is interrupted: use -f|--force to override" - exit "${EXIT_ERROR}" - fi -fi - -${PENDING_COMPONENT_FW} - -SafePwrCycle diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/pre_reboot_hook b/device/mellanox/x86_64-mlnx_msn2700-r0/pre_reboot_hook new file mode 100755 index 000000000000..134357d320f1 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/pre_reboot_hook @@ -0,0 +1,34 @@ +#!/bin/bash + +# Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. +# Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +declare -r EXIT_SUCCESS=0 +declare -r EXIT_ERROR=1 + +declare -r PENDING_COMPONENT_FW="/usr/bin/install-pending-fw.py" +declare -r FW_UPGRADE_SCRIPT="/usr/bin/mlnx-fw-upgrade.sh" + + +${FW_UPGRADE_SCRIPT} --upgrade --verbose +EXIT_CODE=$? +if [[ ${EXIT_CODE} != ${EXIT_SUCCESS} ]]; then + echo "Failed to burn MLNX FW: errno=${EXIT_CODE}" + exit ${EXIT_ERROR} +fi + +${PENDING_COMPONENT_FW} + +exit ${EXIT_SUCCESS} \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2700a1-r0/platform_reboot b/device/mellanox/x86_64-mlnx_msn2700a1-r0/platform_reboot deleted file mode 120000 index 43c8ea567493..000000000000 --- a/device/mellanox/x86_64-mlnx_msn2700a1-r0/platform_reboot +++ /dev/null @@ -1 +0,0 @@ -../x86_64-mlnx_msn2700-r0/platform_reboot \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2700a1-r0/pre_reboot_hook b/device/mellanox/x86_64-mlnx_msn2700a1-r0/pre_reboot_hook new file mode 120000 index 000000000000..6fc31078ee86 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2700a1-r0/pre_reboot_hook @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/pre_reboot_hook \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2740-r0/platform_reboot b/device/mellanox/x86_64-mlnx_msn2740-r0/platform_reboot deleted file mode 120000 index 43c8ea567493..000000000000 --- a/device/mellanox/x86_64-mlnx_msn2740-r0/platform_reboot +++ /dev/null @@ -1 +0,0 @@ -../x86_64-mlnx_msn2700-r0/platform_reboot \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2740-r0/pre_reboot_hook b/device/mellanox/x86_64-mlnx_msn2740-r0/pre_reboot_hook new file mode 120000 index 000000000000..6fc31078ee86 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2740-r0/pre_reboot_hook @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/pre_reboot_hook \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3420-r0/platform_reboot b/device/mellanox/x86_64-mlnx_msn3420-r0/platform_reboot deleted file mode 120000 index 43c8ea567493..000000000000 --- a/device/mellanox/x86_64-mlnx_msn3420-r0/platform_reboot +++ /dev/null @@ -1 +0,0 @@ -../x86_64-mlnx_msn2700-r0/platform_reboot \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3420-r0/pre_reboot_hook b/device/mellanox/x86_64-mlnx_msn3420-r0/pre_reboot_hook new file mode 120000 index 000000000000..6fc31078ee86 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3420-r0/pre_reboot_hook @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/pre_reboot_hook \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/platform_reboot b/device/mellanox/x86_64-mlnx_msn3700-r0/platform_reboot deleted file mode 120000 index 43c8ea567493..000000000000 --- a/device/mellanox/x86_64-mlnx_msn3700-r0/platform_reboot +++ /dev/null @@ -1 +0,0 @@ -../x86_64-mlnx_msn2700-r0/platform_reboot \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/pre_reboot_hook b/device/mellanox/x86_64-mlnx_msn3700-r0/pre_reboot_hook new file mode 120000 index 000000000000..6fc31078ee86 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/pre_reboot_hook @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/pre_reboot_hook \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/platform_reboot b/device/mellanox/x86_64-mlnx_msn3700c-r0/platform_reboot deleted file mode 120000 index 43c8ea567493..000000000000 --- a/device/mellanox/x86_64-mlnx_msn3700c-r0/platform_reboot +++ /dev/null @@ -1 +0,0 @@ -../x86_64-mlnx_msn2700-r0/platform_reboot \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/pre_reboot_hook b/device/mellanox/x86_64-mlnx_msn3700c-r0/pre_reboot_hook new file mode 120000 index 000000000000..6fc31078ee86 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/pre_reboot_hook @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/pre_reboot_hook \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/platform_reboot b/device/mellanox/x86_64-mlnx_msn3800-r0/platform_reboot deleted file mode 120000 index 43c8ea567493..000000000000 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/platform_reboot +++ /dev/null @@ -1 +0,0 @@ -../x86_64-mlnx_msn2700-r0/platform_reboot \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/pre_reboot_hook b/device/mellanox/x86_64-mlnx_msn3800-r0/pre_reboot_hook new file mode 120000 index 000000000000..6fc31078ee86 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/pre_reboot_hook @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/pre_reboot_hook \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4410-r0/platform_reboot b/device/mellanox/x86_64-mlnx_msn4410-r0/platform_reboot deleted file mode 120000 index 43c8ea567493..000000000000 --- a/device/mellanox/x86_64-mlnx_msn4410-r0/platform_reboot +++ /dev/null @@ -1 +0,0 @@ -../x86_64-mlnx_msn2700-r0/platform_reboot \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4410-r0/pre_reboot_hook b/device/mellanox/x86_64-mlnx_msn4410-r0/pre_reboot_hook new file mode 120000 index 000000000000..6fc31078ee86 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4410-r0/pre_reboot_hook @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/pre_reboot_hook \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/platform_reboot b/device/mellanox/x86_64-mlnx_msn4600-r0/platform_reboot deleted file mode 120000 index 43c8ea567493..000000000000 --- a/device/mellanox/x86_64-mlnx_msn4600-r0/platform_reboot +++ /dev/null @@ -1 +0,0 @@ -../x86_64-mlnx_msn2700-r0/platform_reboot \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/pre_reboot_hook b/device/mellanox/x86_64-mlnx_msn4600-r0/pre_reboot_hook new file mode 120000 index 000000000000..6fc31078ee86 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/pre_reboot_hook @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/pre_reboot_hook \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/platform_reboot b/device/mellanox/x86_64-mlnx_msn4600c-r0/platform_reboot deleted file mode 120000 index 43c8ea567493..000000000000 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/platform_reboot +++ /dev/null @@ -1 +0,0 @@ -../x86_64-mlnx_msn2700-r0/platform_reboot \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/pre_reboot_hook b/device/mellanox/x86_64-mlnx_msn4600c-r0/pre_reboot_hook new file mode 120000 index 000000000000..6fc31078ee86 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/pre_reboot_hook @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/pre_reboot_hook \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/platform_reboot b/device/mellanox/x86_64-mlnx_msn4700-r0/platform_reboot deleted file mode 120000 index 43c8ea567493..000000000000 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/platform_reboot +++ /dev/null @@ -1 +0,0 @@ -../x86_64-mlnx_msn2700-r0/platform_reboot \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/pre_reboot_hook b/device/mellanox/x86_64-mlnx_msn4700-r0/pre_reboot_hook new file mode 120000 index 000000000000..6fc31078ee86 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/pre_reboot_hook @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/pre_reboot_hook \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn2201-r0/platform_reboot b/device/mellanox/x86_64-nvidia_sn2201-r0/platform_reboot deleted file mode 120000 index 43c8ea567493..000000000000 --- a/device/mellanox/x86_64-nvidia_sn2201-r0/platform_reboot +++ /dev/null @@ -1 +0,0 @@ -../x86_64-mlnx_msn2700-r0/platform_reboot \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn2201-r0/pre_reboot_hook b/device/mellanox/x86_64-nvidia_sn2201-r0/pre_reboot_hook new file mode 120000 index 000000000000..6fc31078ee86 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn2201-r0/pre_reboot_hook @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/pre_reboot_hook \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn4800-r0/platform_reboot b/device/mellanox/x86_64-nvidia_sn4800-r0/platform_reboot deleted file mode 120000 index 43c8ea567493..000000000000 --- a/device/mellanox/x86_64-nvidia_sn4800-r0/platform_reboot +++ /dev/null @@ -1 +0,0 @@ -../x86_64-mlnx_msn2700-r0/platform_reboot \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn4800-r0/pre_reboot_hook b/device/mellanox/x86_64-nvidia_sn4800-r0/pre_reboot_hook new file mode 120000 index 000000000000..6fc31078ee86 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn4800-r0/pre_reboot_hook @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/pre_reboot_hook \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/platform_reboot b/device/mellanox/x86_64-nvidia_sn5600-r0/platform_reboot deleted file mode 120000 index 43c8ea567493..000000000000 --- a/device/mellanox/x86_64-nvidia_sn5600-r0/platform_reboot +++ /dev/null @@ -1 +0,0 @@ -../x86_64-mlnx_msn2700-r0/platform_reboot \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/pre_reboot_hook b/device/mellanox/x86_64-nvidia_sn5600-r0/pre_reboot_hook new file mode 120000 index 000000000000..6fc31078ee86 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/pre_reboot_hook @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/pre_reboot_hook \ No newline at end of file From 0e9a9293654e61af38e079f3b359ed207b033a0d Mon Sep 17 00:00:00 2001 From: Pavan Naregundi <92989231+pavannaregundi@users.noreply.github.com> Date: Wed, 24 Apr 2024 02:55:51 +0530 Subject: [PATCH 257/419] [Marvell-arm64]: Fix sonic-installer (#18753) Change is backport of PR #18683 This change involves following installer script fixes. Fix illegal character error Set second image based on current image Fix boot_once. boot_once needs to be cleared during the boot of boot_once. Fix print boot menu Signed-off-by: Pavan Naregundi --- platform/marvell-arm64/platform.conf | 60 +++++++++++++++------------- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/platform/marvell-arm64/platform.conf b/platform/marvell-arm64/platform.conf index 7f969495c890..6f5eece3d157 100644 --- a/platform/marvell-arm64/platform.conf +++ b/platform/marvell-arm64/platform.conf @@ -180,19 +180,32 @@ prepare_boot_menu() { if [ "$install_env" = "onie" ]; then FW_ARG="-f" - image_dir_old="" - image_name_old="" - initrd_name_old="" - fdt_name_old="" - fit_name_old="" - sonic_version_2="None" + fw_setenv ${FW_ARG} image_dir_old "" > /dev/null + fw_setenv ${FW_ARG} image_name_old "" > /dev/null + fw_setenv ${FW_ARG} initrd_name_old "" > /dev/null + fw_setenv ${FW_ARG} fdt_name_old "" > /dev/null + fw_setenv ${FW_ARG} fit_name_old "" > /dev/null + fw_setenv ${FW_ARG} sonic_version_2 "None" > /dev/null + fw_setenv ${FW_ARG} linuxargs_old "" > /dev/null else - image_dir_old=$(fw_printenv -n image_dir || true) - image_name_old=$(fw_printenv -n image_name || true) - initrd_name_old=$(fw_printenv -n initrd_name || true) - fdt_name_old=$(fw_printenv -n fdt_name || true) - fit_name_old=$(fw_printenv -n fit_name || true) - sonic_version_2=$(fw_printenv -n sonic_version_1 || true) + CURR_SONIC_IMAGE="$(sonic-installer list | grep "Current: " | cut -f2 -d' ')" + FIRST_SONIC_IMAGE="$(fw_printenv sonic_version_1 | cut -f2 -d'=')" + if [ "$CURR_SONIC_IMAGE" = "$FIRST_SONIC_IMAGE" ]; then + image_dir_old=$(fw_printenv -n image_dir || true) + image_name_old=$(fw_printenv -n image_name || true) + initrd_name_old=$(fw_printenv -n initrd_name || true) + fdt_name_old=$(fw_printenv -n fdt_name || true) + fit_name_old=$(fw_printenv -n fit_name || true) + sonic_version_2=$(fw_printenv -n sonic_version_1 || true) + linuxargs_old=$(fw_printenv -n linuxargs || true) + fw_setenv ${FW_ARG} image_dir_old "$image_dir_old" > /dev/null + fw_setenv ${FW_ARG} image_name_old "$image_name_old" > /dev/null + fw_setenv ${FW_ARG} initrd_name_old "$initrd_name_old" > /dev/null + fw_setenv ${FW_ARG} fdt_name_old "$fdt_name_old" > /dev/null + fw_setenv ${FW_ARG} fit_name_old "$fit_name_old" > /dev/null + fw_setenv ${FW_ARG} sonic_version_2 "$sonic_version_2" > /dev/null + fw_setenv ${FW_ARG} linuxargs_old "$linuxargs_old" > /dev/null + fi fi # Set boot variables @@ -202,22 +215,15 @@ prepare_boot_menu() { fw_setenv ${FW_ARG} fdt_name $fdt_name > /dev/null fw_setenv ${FW_ARG} fit_name $fit_name > /dev/null fw_setenv ${FW_ARG} sonic_version_1 $demo_volume_revision_label > /dev/null - fw_setenv ${FW_ARG} image_dir_old $image_dir_old > /dev/null - fw_setenv ${FW_ARG} image_name_old $image_name_old > /dev/null - fw_setenv ${FW_ARG} initrd_name_old $initrd_name_old > /dev/null - fw_setenv ${FW_ARG} fdt_name_old $fdt_name_old > /dev/null - fw_setenv ${FW_ARG} fit_name_old $fit_name_old > /dev/null - fw_setenv ${FW_ARG} sonic_version_2 $sonic_version_2 > /dev/null BOOT1='echo " > Boot1: $sonic_version_1 - run sonic_image_1";echo;' BOOT2='echo " > Boot2: $sonic_version_2 - run sonic_image_2";echo;' BOOT3='echo " > Boot3: ONIE - run onie_boot";echo;' 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 ${ONIE_PLATFORM_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 ${ONIE_PLATFORM_EXTRA_CMDLINE_LINUX}" > /dev/null - sonic_bootargs_old='setenv bootargs root='$demo_dev' rw rootwait rootfstype=ext4 panic=1 console=ttyS0,${baudrate} ${othbootargs} ${mtdparts} ${linuxargs_old}' - fw_setenv ${FW_ARG} sonic_bootargs_old $sonic_bootargs_old > /dev/null || true + sonic_bootargs_old='setenv bootargs root='$demo_dev' rw rootwait panic=1 console=ttyS0,${baudrate} ${othbootargs} ${mtdparts} ${linuxargs_old}' + fw_setenv ${FW_ARG} sonic_bootargs_old "$sonic_bootargs_old" > /dev/null || true sonic_boot_load_old=$(fw_printenv -n sonic_boot_load || true) old_str="_old" fw_setenv ${FW_ARG} sonic_boot_load_old "$sonic_boot_load_old$old_str" > /dev/null || true @@ -231,14 +237,14 @@ prepare_boot_menu() { fw_setenv ${FW_ARG} sonic_boot_load "$MMC_LOAD" > /dev/null SONIC_BOOT_CMD='run sonic_bootargs; run sonic_boot_load; bootm $fit_addr${fit_conf_name}' SONIC_BOOT_CMD_OLD='run sonic_bootargs_old; run sonic_boot_load_old; bootm $fit_addr${fit_conf_name}' - BOOTARGS='setenv bootargs root='$demo_dev' rw rootwait rootfstype=ext4 panic=1 console=ttyS0,${baudrate} ${othbootargs} ${mtdparts} ${linuxargs}' - fw_setenv ${FW_ARG} sonic_bootargs $BOOTARGS > /dev/null - fw_setenv ${FW_ARG} sonic_bootcmd $SONIC_BOOT_CMD > /dev/null - fw_setenv ${FW_ARG} sonic_image_2 $SONIC_BOOT_CMD_OLD > /dev/null + BOOTARGS='setenv bootargs root='$demo_dev' rw rootwait panic=1 console=ttyS0,${baudrate} ${othbootargs} ${mtdparts} ${linuxargs}' + fw_setenv ${FW_ARG} sonic_bootargs "$BOOTARGS" > /dev/null + fw_setenv ${FW_ARG} sonic_image_2 "$SONIC_BOOT_CMD_OLD" > /dev/null fw_setenv ${FW_ARG} sonic_image_1 "$SONIC_BOOT_CMD" > /dev/null fw_setenv ${FW_ARG} boot_next 'run sonic_image_1'> /dev/null - fw_setenv ${FW_ARG} bootcmd 'run print_menu; usb start; test -n "$boot_once" && run boot_once; run boot_next' > /dev/null + fw_setenv ${FW_ARG} bootcmd 'run print_menu; usb start; test -n "$boot_once" && setenv do_boot_once "$boot_once" && setenv boot_once "" && saveenv && run do_boot_once; run boot_next' > /dev/null + echo "Installed SONiC base image SONiC-OS successfully" } bootloader_menu_config() { From 236dbdd40203f6e66f2d70f60c44a1b01ca74391 Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Tue, 23 Apr 2024 16:20:49 -0700 Subject: [PATCH 258/419] [202311][FRR]Fix EVPN route type not matching route map (#18732) Backport based on comment #18669 (comment) Why I did it Fix the below FRR issues FRRouting/frr#14419 FRRouting/frr#13792 --- ...rt-EVPN-prefixes-into-IPv4-IPv6-if-n.patch | 278 ++++++++++++++++++ src/sonic-frr/patch/series | 1 + 2 files changed, 279 insertions(+) create mode 100644 src/sonic-frr/patch/0038-lib-Do-not-convert-EVPN-prefixes-into-IPv4-IPv6-if-n.patch diff --git a/src/sonic-frr/patch/0038-lib-Do-not-convert-EVPN-prefixes-into-IPv4-IPv6-if-n.patch b/src/sonic-frr/patch/0038-lib-Do-not-convert-EVPN-prefixes-into-IPv4-IPv6-if-n.patch new file mode 100644 index 000000000000..361aac9e2db6 --- /dev/null +++ b/src/sonic-frr/patch/0038-lib-Do-not-convert-EVPN-prefixes-into-IPv4-IPv6-if-n.patch @@ -0,0 +1,278 @@ +From 799c131b6a41262322a68252e44624e052b23cfa Mon Sep 17 00:00:00 2001 +From: Trey Aspelund +Date: Fri, 17 Feb 2023 21:47:09 +0000 +Subject: [PATCH 1/2] lib: skip route-map optimization if !AF_INET(6) + +Currently we unconditionally send a prefix through the optimized +route-map codepath if the v4 and v6 LPM tables have been allocated and +optimization has not been disabled. +However prefixes from address-families that are not IPv4/IPv6 unicast +always fail the optimized route-map index lookup, because they occur on +an LPM tree that is IPv4 or IPv6 specific. +e.g. +Even if you have an empty permit route-map clause, Type-3 EVPN routes +are always denied: +``` +--config +route-map soo-foo permit 10 + +--logs +2023/02/17 19:38:42 BGP: [KZK58-6T4Y6] No best match sequence for pfx: [3]:[0]:[32]:[2.2.2.2] in route-map: soo-foo, result: no match +2023/02/17 19:38:42 BGP: [H5AW4-JFYQC] Route-map: soo-foo, prefix: [3]:[0]:[32]:[2.2.2.2], result: deny +``` + +There is some existing code that creates an AF_INET/AF_INET6 prefix +using the IP/prefix information from a Type-2/5 EVPN route, which +allowed only these two route-types to successfully attempt an LPM lookup +in the route-map optimization trees via the converted prefix. + +This commit does 3 things: +1) Reverts to non-optimized route-map lookup for prefixes that are not + AF_INET or AF_INET6. +2) Cleans up the route-map code so that the AF check is part of the + index lookup + the EVPN RT-2/5 -> AF_INET/6 prefix conversion occurs + outside the index lookup. +3) Adds "debug route-map detail" logs to indicate when we attempt to + convert an AF_EVPN prefix into an AF_INET/6 prefix + when we fallback + to a non-optimized lookup. + +Additional functionality for optimized lookups of prefixes from other +address-families can be added prior to the index lookup, similar to how +the existing EVPN conversion works today. + +New behavior: +``` +2023/02/17 21:44:27 BGP: [WYP1M-NE4SY] Converted EVPN prefix [5]:[0]:[32]:[192.0.2.7] into 192.0.2.7/32 for optimized route-map lookup +2023/02/17 21:44:27 BGP: [MT1SJ-WEJQ1] Best match route-map: soo-foo, sequence: 10 for pfx: 192.0.2.7/32, result: match +2023/02/17 21:44:27 BGP: [H5AW4-JFYQC] Route-map: soo-foo, prefix: 192.0.2.7/32, result: permit + +2023/02/17 21:44:27 BGP: [WYP1M-NE4SY] Converted EVPN prefix [2]:[0]:[48]:[aa:bb:cc:00:22:22]:[32]:[20.0.0.2] into 20.0.0.2/32 for optimized route-map lookup +2023/02/17 21:44:27 BGP: [MT1SJ-WEJQ1] Best match route-map: soo-foo, sequence: 10 for pfx: 20.0.0.2/32, result: match +2023/02/17 21:44:27 BGP: [H5AW4-JFYQC] Route-map: soo-foo, prefix: 20.0.0.2/32, result: permit + +2023/02/17 21:44:27 BGP: [KHG7H-RH4PN] Unable to convert EVPN prefix [3]:[0]:[32]:[2.2.2.2] into IPv4/IPv6 prefix. Falling back to non-optimized route-map lookup +2023/02/17 21:44:27 BGP: [MT1SJ-WEJQ1] Best match route-map: soo-foo, sequence: 10 for pfx: [3]:[0]:[32]:[2.2.2.2], result: match +2023/02/17 21:44:27 BGP: [H5AW4-JFYQC] Route-map: soo-foo, prefix: [3]:[0]:[32]:[2.2.2.2], result: permit +``` + +Signed-off-by: Trey Aspelund +--- + lib/routemap.c | 99 ++++++++++++++++++++++++++++---------------------- + 1 file changed, 56 insertions(+), 43 deletions(-) + +diff --git a/lib/routemap.c b/lib/routemap.c +index 210027105d..010d4bff0b 100644 +--- a/lib/routemap.c ++++ b/lib/routemap.c +@@ -1817,26 +1817,24 @@ route_map_get_index(struct route_map *map, const struct prefix *prefix, + struct route_map_index *index = NULL, *best_index = NULL; + struct route_map_index *head_index = NULL; + struct route_table *table = NULL; +- struct prefix conv; +- unsigned char family; + +- /* +- * Handling for matching evpn_routes in the prefix table. +- * +- * We convert type2/5 prefix to ipv4/6 prefix to do longest +- * prefix matching on. ++ /* Route-map optimization relies on LPM lookups of the prefix to reduce ++ * the amount of route-map clauses a given prefix needs to be processed ++ * against. These LPM trees are IPv4/IPv6-specific and prefix->family ++ * must be AF_INET or AF_INET6 in order for the lookup to succeed. So if ++ * the AF doesn't line up with the LPM trees, skip the optimization. + */ +- if (prefix->family == AF_EVPN) { +- if (evpn_prefix2prefix(prefix, &conv) != 0) +- return NULL; +- +- prefix = &conv; ++ if (map->optimization_disabled || ++ (prefix->family == AF_INET && !map->ipv4_prefix_table) || ++ (prefix->family == AF_INET6 && !map->ipv6_prefix_table)) { ++ if (rmap_debug) ++ zlog_debug( ++ "Skipping route-map optimization for route-map: %s, pfx: %pFX, family: %d", ++ map->name, prefix, prefix->family); ++ return map->head; + } + +- +- family = prefix->family; +- +- if (family == AF_INET) ++ if (prefix->family == AF_INET) + table = map->ipv4_prefix_table; + else + table = map->ipv6_prefix_table; +@@ -2558,6 +2556,7 @@ route_map_result_t route_map_apply_ext(struct route_map *map, + struct route_map_index *index = NULL; + struct route_map_rule *set = NULL; + bool skip_match_clause = false; ++ struct prefix conv; + + if (recursion > RMAP_RECURSION_LIMIT) { + flog_warn( +@@ -2575,37 +2574,51 @@ route_map_result_t route_map_apply_ext(struct route_map *map, + + map->applied++; + +- if ((!map->optimization_disabled) +- && (map->ipv4_prefix_table || map->ipv6_prefix_table)) { +- index = route_map_get_index(map, prefix, match_object, +- &match_ret); +- if (index) { +- index->applied++; +- if (rmap_debug) +- zlog_debug( +- "Best match route-map: %s, sequence: %d for pfx: %pFX, result: %s", +- map->name, index->pref, prefix, +- route_map_cmd_result_str(match_ret)); ++ /* ++ * Handling for matching evpn_routes in the prefix table. ++ * ++ * We convert type2/5 prefix to ipv4/6 prefix to do longest ++ * prefix matching on. ++ */ ++ if (prefix->family == AF_EVPN) { ++ if (evpn_prefix2prefix(prefix, &conv) != 0) { ++ zlog_debug( ++ "Unable to convert EVPN prefix %pFX into IPv4/IPv6 prefix. Falling back to non-optimized route-map lookup", ++ prefix); + } else { +- if (rmap_debug) +- zlog_debug( +- "No best match sequence for pfx: %pFX in route-map: %s, result: %s", +- prefix, map->name, +- route_map_cmd_result_str(match_ret)); +- /* +- * No index matches this prefix. Return deny unless, +- * match_ret = RMAP_NOOP. +- */ +- if (match_ret == RMAP_NOOP) +- ret = RMAP_PERMITMATCH; +- else +- ret = RMAP_DENYMATCH; +- goto route_map_apply_end; ++ zlog_debug( ++ "Converted EVPN prefix %pFX into %pFX for optimized route-map lookup", ++ prefix, &conv); ++ ++ prefix = &conv; + } +- skip_match_clause = true; ++ } ++ ++ index = route_map_get_index(map, prefix, match_object, &match_ret); ++ if (index) { ++ index->applied++; ++ if (rmap_debug) ++ zlog_debug( ++ "Best match route-map: %s, sequence: %d for pfx: %pFX, result: %s", ++ map->name, index->pref, prefix, ++ route_map_cmd_result_str(match_ret)); + } else { +- index = map->head; ++ if (rmap_debug) ++ zlog_debug( ++ "No best match sequence for pfx: %pFX in route-map: %s, result: %s", ++ prefix, map->name, ++ route_map_cmd_result_str(match_ret)); ++ /* ++ * No index matches this prefix. Return deny unless, ++ * match_ret = RMAP_NOOP. ++ */ ++ if (match_ret == RMAP_NOOP) ++ ret = RMAP_PERMITMATCH; ++ else ++ ret = RMAP_DENYMATCH; ++ goto route_map_apply_end; + } ++ skip_match_clause = true; + + for (; index; index = index->next) { + if (!skip_match_clause) { +-- +2.17.1 + + +From 950cf63054fa36be57f4aa751243f5425793584b Mon Sep 17 00:00:00 2001 +From: Donatas Abraitis +Date: Thu, 15 Feb 2024 12:07:43 +0200 +Subject: [PATCH 2/2] lib: Do not convert EVPN prefixes into IPv4/IPv6 if not + needed + +Convert only when this is really needed, e.g. `match ip address prefix-list ...`. + +Otherwise, we can't have mixed match clauses, like: + +``` +match ip address prefix-list p1 +match evpn route-type prefix +``` + +This won't work, because the prefix is already converted, and we can't extract +route type, vni, etc. from the original EVPN prefix. + +Signed-off-by: Donatas Abraitis +(cherry picked from commit 439b739495e86912c8b9ec36b84e55311c549ba0) +--- + lib/routemap.c | 25 +++++-------------------- + 1 file changed, 5 insertions(+), 20 deletions(-) + +diff --git a/lib/routemap.c b/lib/routemap.c +index 010d4bff0b..408faae49e 100644 +--- a/lib/routemap.c ++++ b/lib/routemap.c +@@ -2556,7 +2556,6 @@ route_map_result_t route_map_apply_ext(struct route_map *map, + struct route_map_index *index = NULL; + struct route_map_rule *set = NULL; + bool skip_match_clause = false; +- struct prefix conv; + + if (recursion > RMAP_RECURSION_LIMIT) { + flog_warn( +@@ -2574,27 +2573,14 @@ route_map_result_t route_map_apply_ext(struct route_map *map, + + map->applied++; + +- /* +- * Handling for matching evpn_routes in the prefix table. +- * +- * We convert type2/5 prefix to ipv4/6 prefix to do longest +- * prefix matching on. +- */ + if (prefix->family == AF_EVPN) { +- if (evpn_prefix2prefix(prefix, &conv) != 0) { +- zlog_debug( +- "Unable to convert EVPN prefix %pFX into IPv4/IPv6 prefix. Falling back to non-optimized route-map lookup", +- prefix); +- } else { +- zlog_debug( +- "Converted EVPN prefix %pFX into %pFX for optimized route-map lookup", +- prefix, &conv); +- +- prefix = &conv; +- } ++ index = map->head; ++ } else { ++ skip_match_clause = true; ++ index = route_map_get_index(map, prefix, match_object, ++ &match_ret); + } + +- index = route_map_get_index(map, prefix, match_object, &match_ret); + if (index) { + index->applied++; + if (rmap_debug) +@@ -2618,7 +2604,6 @@ route_map_result_t route_map_apply_ext(struct route_map *map, + ret = RMAP_DENYMATCH; + goto route_map_apply_end; + } +- skip_match_clause = true; + + for (; index; index = index->next) { + if (!skip_match_clause) { +-- +2.17.1 + diff --git a/src/sonic-frr/patch/series b/src/sonic-frr/patch/series index fcc15bac8ffc..e0a16cd6eba2 100644 --- a/src/sonic-frr/patch/series +++ b/src/sonic-frr/patch/series @@ -34,3 +34,4 @@ cross-compile-changes.patch 0035-fpm-ignore-route-from-default-table.patch 0036-Add-support-of-bgp-l3vni-evpn.patch 0037-bgp-community-memory-leak-fix.patch +0038-lib-Do-not-convert-EVPN-prefixes-into-IPv4-IPv6-if-n.patch From ad237b7417132cfc7da1217c823e6a1823a05658 Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Wed, 24 Apr 2024 01:45:02 +0200 Subject: [PATCH 259/419] [202311][Arista] Update platform library submodules (#18360) Add QuicksilverDD product Fix issue with linecard rpc powercycle Fix pcie switch race condition on chassis Fix powercycle on SEU behavior for Lodoga Improve out of spec xcvr support Refactor some of the platform detection code Fix reboot cause time issue on some products Fix some bookworm related issues Fix some issue with linecard reboot cause determination Fix some corner case in fabric card asic initialization --- 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 c2b98f6a9efc..9038696debe7 160000 --- a/platform/barefoot/sonic-platform-modules-arista +++ b/platform/barefoot/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit c2b98f6a9efce536a228028bb81e760bade2015d +Subproject commit 9038696debe74bd99b0b6e35552531e38cd1aa51 diff --git a/platform/broadcom/sonic-platform-modules-arista b/platform/broadcom/sonic-platform-modules-arista index c2b98f6a9efc..9038696debe7 160000 --- a/platform/broadcom/sonic-platform-modules-arista +++ b/platform/broadcom/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit c2b98f6a9efce536a228028bb81e760bade2015d +Subproject commit 9038696debe74bd99b0b6e35552531e38cd1aa51 From deb4d97d48019706a33a1bae75aa9dc2edaf46b9 Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Wed, 24 Apr 2024 01:43:38 +0200 Subject: [PATCH 260/419] [Arista] Add support for Quicksilver platform (#18362) Add support for the new Quicksilver product Work item tracking Microsoft ADO (number only): How I did it register the product in boot0 add device configuration files add a 800G hwsku add a 400G hwsku --------- Co-authored-by: Rick Robbins Co-authored-by: Boyang Yu --- .../Arista-7060X6-64DE-64x400G/hwsku.json | 196 +++ .../port_config.ini | 65 + .../Arista-7060X6-64DE-64x400G/sai.profile | 1 + .../th5-a7060x6-64de.config.bcm | 1 + .../Arista-7060X6-64DE/hwsku.json | 196 +++ .../Arista-7060X6-64DE/port_config.ini | 65 + .../Arista-7060X6-64DE/sai.profile | 1 + .../th5-a7060x6-64de.config.bcm | 1145 ++++++++++++++ .../x86_64-arista_7060x6_64de/default_sku | 1 + .../x86_64-arista_7060x6_64de/pcie.yaml | 1 + .../x86_64-arista_7060x6_64de/platform.json | 1340 +++++++++++++++++ .../x86_64-arista_7060x6_64de/platform_asic | 1 + .../platform_components.json | 12 + .../platform_env.conf | 2 + .../x86_64-arista_7060x6_64de/platform_reboot | 1 + .../arista/x86_64-arista_7060x6_64de/plugins | 1 + .../pmon_daemon_control.json | 1 + .../x86_64-arista_7060x6_64de/sensors.conf | 14 + .../system_health_monitoring_config.json | 1 + .../thermal_policy.json | 1 + files/Aboot/boot0.j2 | 24 +- 21 files changed, 3067 insertions(+), 3 deletions(-) create mode 100644 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/hwsku.json create mode 100644 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/port_config.ini create mode 120000 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/sai.profile create mode 120000 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/th5-a7060x6-64de.config.bcm create mode 100644 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/hwsku.json create mode 100644 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/port_config.ini create mode 100644 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/sai.profile create mode 100644 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/th5-a7060x6-64de.config.bcm create mode 100644 device/arista/x86_64-arista_7060x6_64de/default_sku create mode 120000 device/arista/x86_64-arista_7060x6_64de/pcie.yaml create mode 100644 device/arista/x86_64-arista_7060x6_64de/platform.json create mode 100644 device/arista/x86_64-arista_7060x6_64de/platform_asic create mode 100644 device/arista/x86_64-arista_7060x6_64de/platform_components.json create mode 100644 device/arista/x86_64-arista_7060x6_64de/platform_env.conf create mode 120000 device/arista/x86_64-arista_7060x6_64de/platform_reboot create mode 120000 device/arista/x86_64-arista_7060x6_64de/plugins create mode 120000 device/arista/x86_64-arista_7060x6_64de/pmon_daemon_control.json create mode 100644 device/arista/x86_64-arista_7060x6_64de/sensors.conf create mode 120000 device/arista/x86_64-arista_7060x6_64de/system_health_monitoring_config.json create mode 120000 device/arista/x86_64-arista_7060x6_64de/thermal_policy.json diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/hwsku.json b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/hwsku.json new file mode 100644 index 000000000000..84e39004f9da --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/hwsku.json @@ -0,0 +1,196 @@ +{ + "interfaces": { + "Ethernet0": { + "default_brkout_mode": "1x400G" + }, + "Ethernet8": { + "default_brkout_mode": "1x400G" + }, + "Ethernet16": { + "default_brkout_mode": "1x400G" + }, + "Ethernet24": { + "default_brkout_mode": "1x400G" + }, + "Ethernet32": { + "default_brkout_mode": "1x400G" + }, + "Ethernet40": { + "default_brkout_mode": "1x400G" + }, + "Ethernet48": { + "default_brkout_mode": "1x400G" + }, + "Ethernet56": { + "default_brkout_mode": "1x400G" + }, + "Ethernet64": { + "default_brkout_mode": "1x400G" + }, + "Ethernet72": { + "default_brkout_mode": "1x400G" + }, + "Ethernet80": { + "default_brkout_mode": "1x400G" + }, + "Ethernet88": { + "default_brkout_mode": "1x400G" + }, + "Ethernet96": { + "default_brkout_mode": "1x400G" + }, + "Ethernet104": { + "default_brkout_mode": "1x400G" + }, + "Ethernet112": { + "default_brkout_mode": "1x400G" + }, + "Ethernet120": { + "default_brkout_mode": "1x400G" + }, + "Ethernet128": { + "default_brkout_mode": "1x400G" + }, + "Ethernet136": { + "default_brkout_mode": "1x400G" + }, + "Ethernet144": { + "default_brkout_mode": "1x400G" + }, + "Ethernet152": { + "default_brkout_mode": "1x400G" + }, + "Ethernet160": { + "default_brkout_mode": "1x400G" + }, + "Ethernet168": { + "default_brkout_mode": "1x400G" + }, + "Ethernet176": { + "default_brkout_mode": "1x400G" + }, + "Ethernet184": { + "default_brkout_mode": "1x400G" + }, + "Ethernet192": { + "default_brkout_mode": "1x400G" + }, + "Ethernet200": { + "default_brkout_mode": "1x400G" + }, + "Ethernet208": { + "default_brkout_mode": "1x400G" + }, + "Ethernet216": { + "default_brkout_mode": "1x400G" + }, + "Ethernet224": { + "default_brkout_mode": "1x400G" + }, + "Ethernet232": { + "default_brkout_mode": "1x400G" + }, + "Ethernet240": { + "default_brkout_mode": "1x400G" + }, + "Ethernet248": { + "default_brkout_mode": "1x400G" + }, + "Ethernet256": { + "default_brkout_mode": "1x400G" + }, + "Ethernet264": { + "default_brkout_mode": "1x400G" + }, + "Ethernet272": { + "default_brkout_mode": "1x400G" + }, + "Ethernet280": { + "default_brkout_mode": "1x400G" + }, + "Ethernet288": { + "default_brkout_mode": "1x400G" + }, + "Ethernet296": { + "default_brkout_mode": "1x400G" + }, + "Ethernet304": { + "default_brkout_mode": "1x400G" + }, + "Ethernet312": { + "default_brkout_mode": "1x400G" + }, + "Ethernet320": { + "default_brkout_mode": "1x400G" + }, + "Ethernet328": { + "default_brkout_mode": "1x400G" + }, + "Ethernet336": { + "default_brkout_mode": "1x400G" + }, + "Ethernet344": { + "default_brkout_mode": "1x400G" + }, + "Ethernet352": { + "default_brkout_mode": "1x400G" + }, + "Ethernet360": { + "default_brkout_mode": "1x400G" + }, + "Ethernet368": { + "default_brkout_mode": "1x400G" + }, + "Ethernet376": { + "default_brkout_mode": "1x400G" + }, + "Ethernet384": { + "default_brkout_mode": "1x400G" + }, + "Ethernet392": { + "default_brkout_mode": "1x400G" + }, + "Ethernet400": { + "default_brkout_mode": "1x400G" + }, + "Ethernet408": { + "default_brkout_mode": "1x400G" + }, + "Ethernet416": { + "default_brkout_mode": "1x400G" + }, + "Ethernet424": { + "default_brkout_mode": "1x400G" + }, + "Ethernet432": { + "default_brkout_mode": "1x400G" + }, + "Ethernet440": { + "default_brkout_mode": "1x400G" + }, + "Ethernet448": { + "default_brkout_mode": "1x400G" + }, + "Ethernet456": { + "default_brkout_mode": "1x400G" + }, + "Ethernet464": { + "default_brkout_mode": "1x400G" + }, + "Ethernet472": { + "default_brkout_mode": "1x400G" + }, + "Ethernet480": { + "default_brkout_mode": "1x400G" + }, + "Ethernet488": { + "default_brkout_mode": "1x400G" + }, + "Ethernet496": { + "default_brkout_mode": "1x400G" + }, + "Ethernet504": { + "default_brkout_mode": "1x400G" + } + } +} diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/port_config.ini b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/port_config.ini new file mode 100644 index 000000000000..dfb191acec93 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/port_config.ini @@ -0,0 +1,65 @@ +# name lanes alias index speed fec +Ethernet0 17,18,19,20,21,22,23,24 Ethernet1/1 1 400000 rs +Ethernet8 1,2,3,4,5,6,7,8 Ethernet2/1 2 400000 rs +Ethernet16 9,10,11,12,13,14,15,16 Ethernet3/1 3 400000 rs +Ethernet24 25,26,27,28,29,30,31,32 Ethernet4/1 4 400000 rs +Ethernet32 57,58,59,60,61,62,63,64 Ethernet5/1 5 400000 rs +Ethernet40 41,42,43,44,45,46,47,48 Ethernet6/1 6 400000 rs +Ethernet48 33,34,35,36,37,38,39,40 Ethernet7/1 7 400000 rs +Ethernet56 49,50,51,52,53,54,55,56 Ethernet8/1 8 400000 rs +Ethernet64 89,90,91,92,93,94,95,96 Ethernet9/1 9 400000 rs +Ethernet72 73,74,75,76,77,78,79,80 Ethernet10/1 10 400000 rs +Ethernet80 65,66,67,68,69,70,71,72 Ethernet11/1 11 400000 rs +Ethernet88 81,82,83,84,85,86,87,88 Ethernet12/1 12 400000 rs +Ethernet96 121,122,123,124,125,126,127,128 Ethernet13/1 13 400000 rs +Ethernet104 105,106,107,108,109,110,111,112 Ethernet14/1 14 400000 rs +Ethernet112 97,98,99,100,101,102,103,104 Ethernet15/1 15 400000 rs +Ethernet120 113,114,115,116,117,118,119,120 Ethernet16/1 16 400000 rs +Ethernet128 153,154,155,156,157,158,159,160 Ethernet17/1 17 400000 rs +Ethernet136 137,138,139,140,141,142,143,144 Ethernet18/1 18 400000 rs +Ethernet144 129,130,131,132,133,134,135,136 Ethernet19/1 19 400000 rs +Ethernet152 145,146,147,148,149,150,151,152 Ethernet20/1 20 400000 rs +Ethernet160 185,186,187,188,189,190,191,192 Ethernet21/1 21 400000 rs +Ethernet168 169,170,171,172,173,174,175,176 Ethernet22/1 22 400000 rs +Ethernet176 161,162,163,164,165,166,167,168 Ethernet23/1 23 400000 rs +Ethernet184 177,178,179,180,181,182,183,184 Ethernet24/1 24 400000 rs +Ethernet192 217,218,219,220,221,222,223,224 Ethernet25/1 25 400000 rs +Ethernet200 201,202,203,204,205,206,207,208 Ethernet26/1 26 400000 rs +Ethernet208 193,194,195,196,197,198,199,200 Ethernet27/1 27 400000 rs +Ethernet216 209,210,211,212,213,214,215,216 Ethernet28/1 28 400000 rs +Ethernet224 249,250,251,252,253,254,255,256 Ethernet29/1 29 400000 rs +Ethernet232 233,234,235,236,237,238,239,240 Ethernet30/1 30 400000 rs +Ethernet240 225,226,227,228,229,230,231,232 Ethernet31/1 31 400000 rs +Ethernet248 241,242,243,244,245,246,247,248 Ethernet32/1 32 400000 rs +Ethernet256 273,274,275,276,277,278,279,280 Ethernet33/1 33 400000 rs +Ethernet264 257,258,259,260,261,262,263,264 Ethernet34/1 34 400000 rs +Ethernet272 265,266,267,268,269,270,271,272 Ethernet35/1 35 400000 rs +Ethernet280 281,282,283,284,285,286,287,288 Ethernet36/1 36 400000 rs +Ethernet288 313,314,315,316,317,318,319,320 Ethernet37/1 37 400000 rs +Ethernet296 297,298,299,300,301,302,303,304 Ethernet38/1 38 400000 rs +Ethernet304 289,290,291,292,293,294,295,296 Ethernet39/1 39 400000 rs +Ethernet312 305,306,307,308,309,310,311,312 Ethernet40/1 40 400000 rs +Ethernet320 345,346,347,348,349,350,351,352 Ethernet41/1 41 400000 rs +Ethernet328 329,330,331,332,333,334,335,336 Ethernet42/1 42 400000 rs +Ethernet336 321,322,323,324,325,326,327,328 Ethernet43/1 43 400000 rs +Ethernet344 337,338,339,340,341,342,343,344 Ethernet44/1 44 400000 rs +Ethernet352 377,378,379,380,381,382,383,384 Ethernet45/1 45 400000 rs +Ethernet360 361,362,363,364,365,366,367,368 Ethernet46/1 46 400000 rs +Ethernet368 353,354,355,356,357,358,359,360 Ethernet47/1 47 400000 rs +Ethernet376 369,370,371,372,373,374,375,376 Ethernet48/1 48 400000 rs +Ethernet384 409,410,411,412,413,414,415,416 Ethernet49/1 49 400000 rs +Ethernet392 393,394,395,396,397,398,399,400 Ethernet50/1 50 400000 rs +Ethernet400 385,386,387,388,389,390,391,392 Ethernet51/1 51 400000 rs +Ethernet408 401,402,403,404,405,406,407,408 Ethernet52/1 52 400000 rs +Ethernet416 441,442,443,444,445,446,447,448 Ethernet53/1 53 400000 rs +Ethernet424 425,426,427,428,429,430,431,432 Ethernet54/1 54 400000 rs +Ethernet432 417,418,419,420,421,422,423,424 Ethernet55/1 55 400000 rs +Ethernet440 433,434,435,436,437,438,439,440 Ethernet56/1 56 400000 rs +Ethernet448 473,474,475,476,477,478,479,480 Ethernet57/1 57 400000 rs +Ethernet456 457,458,459,460,461,462,463,464 Ethernet58/1 58 400000 rs +Ethernet464 449,450,451,452,453,454,455,456 Ethernet59/1 59 400000 rs +Ethernet472 465,466,467,468,469,470,471,472 Ethernet60/1 60 400000 rs +Ethernet480 505,506,507,508,509,510,511,512 Ethernet61/1 61 400000 rs +Ethernet488 489,490,491,492,493,494,495,496 Ethernet62/1 62 400000 rs +Ethernet496 481,482,483,484,485,486,487,488 Ethernet63/1 63 400000 rs +Ethernet504 497,498,499,500,501,502,503,504 Ethernet64/1 64 400000 rs diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/sai.profile b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/sai.profile new file mode 120000 index 000000000000..1ce4748f7487 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/sai.profile @@ -0,0 +1 @@ +../Arista-7060X6-64DE/sai.profile \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/th5-a7060x6-64de.config.bcm b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/th5-a7060x6-64de.config.bcm new file mode 120000 index 000000000000..efb75325dc34 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/th5-a7060x6-64de.config.bcm @@ -0,0 +1 @@ +../Arista-7060X6-64DE/th5-a7060x6-64de.config.bcm \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/hwsku.json b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/hwsku.json new file mode 100644 index 000000000000..74df314829bd --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/hwsku.json @@ -0,0 +1,196 @@ +{ + "interfaces": { + "Ethernet0": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet8": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet16": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet24": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet32": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet40": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet48": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet56": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet64": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet72": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet80": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet88": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet96": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet104": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet112": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet120": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet128": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet136": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet144": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet152": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet160": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet168": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet176": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet184": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet192": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet200": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet208": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet216": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet224": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet232": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet240": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet248": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet256": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet264": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet272": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet280": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet288": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet296": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet304": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet312": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet320": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet328": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet336": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet344": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet352": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet360": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet368": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet376": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet384": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet392": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet400": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet408": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet416": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet424": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet432": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet440": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet448": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet456": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet464": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet472": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet480": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet488": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet496": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet504": { + "default_brkout_mode": "1x800G[400G]" + } + } +} diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/port_config.ini b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/port_config.ini new file mode 100644 index 000000000000..48d2519c0ca4 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/port_config.ini @@ -0,0 +1,65 @@ +# name lanes alias index speed fec +Ethernet0 17,18,19,20,21,22,23,24 Ethernet1/1 1 800000 rs +Ethernet8 1,2,3,4,5,6,7,8 Ethernet2/1 2 800000 rs +Ethernet16 9,10,11,12,13,14,15,16 Ethernet3/1 3 800000 rs +Ethernet24 25,26,27,28,29,30,31,32 Ethernet4/1 4 800000 rs +Ethernet32 57,58,59,60,61,62,63,64 Ethernet5/1 5 800000 rs +Ethernet40 41,42,43,44,45,46,47,48 Ethernet6/1 6 800000 rs +Ethernet48 33,34,35,36,37,38,39,40 Ethernet7/1 7 800000 rs +Ethernet56 49,50,51,52,53,54,55,56 Ethernet8/1 8 800000 rs +Ethernet64 89,90,91,92,93,94,95,96 Ethernet9/1 9 800000 rs +Ethernet72 73,74,75,76,77,78,79,80 Ethernet10/1 10 800000 rs +Ethernet80 65,66,67,68,69,70,71,72 Ethernet11/1 11 800000 rs +Ethernet88 81,82,83,84,85,86,87,88 Ethernet12/1 12 800000 rs +Ethernet96 121,122,123,124,125,126,127,128 Ethernet13/1 13 800000 rs +Ethernet104 105,106,107,108,109,110,111,112 Ethernet14/1 14 800000 rs +Ethernet112 97,98,99,100,101,102,103,104 Ethernet15/1 15 800000 rs +Ethernet120 113,114,115,116,117,118,119,120 Ethernet16/1 16 800000 rs +Ethernet128 153,154,155,156,157,158,159,160 Ethernet17/1 17 800000 rs +Ethernet136 137,138,139,140,141,142,143,144 Ethernet18/1 18 800000 rs +Ethernet144 129,130,131,132,133,134,135,136 Ethernet19/1 19 800000 rs +Ethernet152 145,146,147,148,149,150,151,152 Ethernet20/1 20 800000 rs +Ethernet160 185,186,187,188,189,190,191,192 Ethernet21/1 21 800000 rs +Ethernet168 169,170,171,172,173,174,175,176 Ethernet22/1 22 800000 rs +Ethernet176 161,162,163,164,165,166,167,168 Ethernet23/1 23 800000 rs +Ethernet184 177,178,179,180,181,182,183,184 Ethernet24/1 24 800000 rs +Ethernet192 217,218,219,220,221,222,223,224 Ethernet25/1 25 800000 rs +Ethernet200 201,202,203,204,205,206,207,208 Ethernet26/1 26 800000 rs +Ethernet208 193,194,195,196,197,198,199,200 Ethernet27/1 27 800000 rs +Ethernet216 209,210,211,212,213,214,215,216 Ethernet28/1 28 800000 rs +Ethernet224 249,250,251,252,253,254,255,256 Ethernet29/1 29 800000 rs +Ethernet232 233,234,235,236,237,238,239,240 Ethernet30/1 30 800000 rs +Ethernet240 225,226,227,228,229,230,231,232 Ethernet31/1 31 800000 rs +Ethernet248 241,242,243,244,245,246,247,248 Ethernet32/1 32 800000 rs +Ethernet256 273,274,275,276,277,278,279,280 Ethernet33/1 33 800000 rs +Ethernet264 257,258,259,260,261,262,263,264 Ethernet34/1 34 800000 rs +Ethernet272 265,266,267,268,269,270,271,272 Ethernet35/1 35 800000 rs +Ethernet280 281,282,283,284,285,286,287,288 Ethernet36/1 36 800000 rs +Ethernet288 313,314,315,316,317,318,319,320 Ethernet37/1 37 800000 rs +Ethernet296 297,298,299,300,301,302,303,304 Ethernet38/1 38 800000 rs +Ethernet304 289,290,291,292,293,294,295,296 Ethernet39/1 39 800000 rs +Ethernet312 305,306,307,308,309,310,311,312 Ethernet40/1 40 800000 rs +Ethernet320 345,346,347,348,349,350,351,352 Ethernet41/1 41 800000 rs +Ethernet328 329,330,331,332,333,334,335,336 Ethernet42/1 42 800000 rs +Ethernet336 321,322,323,324,325,326,327,328 Ethernet43/1 43 800000 rs +Ethernet344 337,338,339,340,341,342,343,344 Ethernet44/1 44 800000 rs +Ethernet352 377,378,379,380,381,382,383,384 Ethernet45/1 45 800000 rs +Ethernet360 361,362,363,364,365,366,367,368 Ethernet46/1 46 800000 rs +Ethernet368 353,354,355,356,357,358,359,360 Ethernet47/1 47 800000 rs +Ethernet376 369,370,371,372,373,374,375,376 Ethernet48/1 48 800000 rs +Ethernet384 409,410,411,412,413,414,415,416 Ethernet49/1 49 800000 rs +Ethernet392 393,394,395,396,397,398,399,400 Ethernet50/1 50 800000 rs +Ethernet400 385,386,387,388,389,390,391,392 Ethernet51/1 51 800000 rs +Ethernet408 401,402,403,404,405,406,407,408 Ethernet52/1 52 800000 rs +Ethernet416 441,442,443,444,445,446,447,448 Ethernet53/1 53 800000 rs +Ethernet424 425,426,427,428,429,430,431,432 Ethernet54/1 54 800000 rs +Ethernet432 417,418,419,420,421,422,423,424 Ethernet55/1 55 800000 rs +Ethernet440 433,434,435,436,437,438,439,440 Ethernet56/1 56 800000 rs +Ethernet448 473,474,475,476,477,478,479,480 Ethernet57/1 57 800000 rs +Ethernet456 457,458,459,460,461,462,463,464 Ethernet58/1 58 800000 rs +Ethernet464 449,450,451,452,453,454,455,456 Ethernet59/1 59 800000 rs +Ethernet472 465,466,467,468,469,470,471,472 Ethernet60/1 60 800000 rs +Ethernet480 505,506,507,508,509,510,511,512 Ethernet61/1 61 800000 rs +Ethernet488 489,490,491,492,493,494,495,496 Ethernet62/1 62 800000 rs +Ethernet496 481,482,483,484,485,486,487,488 Ethernet63/1 63 800000 rs +Ethernet504 497,498,499,500,501,502,503,504 Ethernet64/1 64 800000 rs diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/sai.profile b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/sai.profile new file mode 100644 index 000000000000..89cfbc9f1b84 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/sai.profile @@ -0,0 +1 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th5-a7060x6-64de.config.bcm diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/th5-a7060x6-64de.config.bcm b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/th5-a7060x6-64de.config.bcm new file mode 100644 index 000000000000..33fa541ca59d --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/th5-a7060x6-64de.config.bcm @@ -0,0 +1,1145 @@ +# +# $Copyright: (c) 2022 Broadcom. +# Broadcom Proprietary and Confidential. All rights reserved.$ +# +# BCM78900 64x800g port configuration. +# +# configuration yaml file +# device: +# : +# : +# ? +# : +# : +# ... +# : +# : +# : +# : +# ... +# : +# + +--- +bcm_device: + 0: + global: + pktio_mode: 1 + default_cpu_tx_queue: 7 + vlan_flooding_l2mc_num_reserved: 0 + ipv6_lpm_128b_enable: 1 + shared_block_mask_section: uc_bc + skip_protocol_default_entries: 1 + # LTSW uses value 1 for ALPM combined mode + l3_alpm_template: 1 + l3_alpm_hit_skip: 1 + sai_feat_tail_timestamp : 1 + sai_port_phy_time_sync_en : 1 + sai_field_group_auto_prioritize: 1 + #l3_intf_vlan_split_egress for MTU at L3IF + l3_intf_vlan_split_egress : 1 + pfc_deadlock_seq_control : 1 + sai_tunnel_support: 2 + bcm_tunnel_term_compatible_mode: 1 + l3_ecmp_member_first_lkup_mem_size: 12288 +--- +device: + 0: + PC_PM_CORE: + ? + PC_PM_ID: 3 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x15047362 + TX_LANE_MAP: 0x4152637 + RX_POLARITY_FLIP: 0xc3 + TX_POLARITY_FLIP: 0xcc + ? + PC_PM_ID: 1 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x17063524 + TX_LANE_MAP: 0x60714253 + RX_POLARITY_FLIP: 0x97 + TX_POLARITY_FLIP: 0xcc + ? + PC_PM_ID: 2 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x6172435 + TX_LANE_MAP: 0x71605342 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0x69 + ? + PC_PM_ID: 4 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x40516273 + TX_LANE_MAP: 0x51403726 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0xc3 + ? + PC_PM_ID: 8 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x71630524 + TX_LANE_MAP: 0x4371625 + RX_POLARITY_FLIP: 0x47 + TX_POLARITY_FLIP: 0xc9 + ? + PC_PM_ID: 6 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x70625143 + TX_LANE_MAP: 0x60534172 + RX_POLARITY_FLIP: 0x1e + TX_POLARITY_FLIP: 0x2c + ? + PC_PM_ID: 5 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x17063524 + TX_LANE_MAP: 0x60715243 + RX_POLARITY_FLIP: 0x38 + TX_POLARITY_FLIP: 0x4e + ? + PC_PM_ID: 7 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x36172405 + TX_LANE_MAP: 0x73402516 + RX_POLARITY_FLIP: 0xd2 + TX_POLARITY_FLIP: 0xc9 + ? + PC_PM_ID: 12 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x71630524 + TX_LANE_MAP: 0x4371625 + RX_POLARITY_FLIP: 0x47 + TX_POLARITY_FLIP: 0xc9 + ? + PC_PM_ID: 10 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x70625143 + TX_LANE_MAP: 0x60534172 + RX_POLARITY_FLIP: 0x1e + TX_POLARITY_FLIP: 0x6c + ? + PC_PM_ID: 9 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x62704351 + TX_LANE_MAP: 0x53607241 + RX_POLARITY_FLIP: 0xb4 + TX_POLARITY_FLIP: 0x6c + ? + PC_PM_ID: 11 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x36172405 + TX_LANE_MAP: 0x73402516 + RX_POLARITY_FLIP: 0xd2 + TX_POLARITY_FLIP: 0xc9 + ? + PC_PM_ID: 16 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x71630524 + TX_LANE_MAP: 0x4371625 + RX_POLARITY_FLIP: 0x47 + TX_POLARITY_FLIP: 0xc9 + ? + PC_PM_ID: 14 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x70625143 + TX_LANE_MAP: 0x60534172 + RX_POLARITY_FLIP: 0x1e + TX_POLARITY_FLIP: 0x6c + ? + PC_PM_ID: 13 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x62704351 + TX_LANE_MAP: 0x53607241 + RX_POLARITY_FLIP: 0xb4 + TX_POLARITY_FLIP: 0x6c + ? + PC_PM_ID: 15 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x36172405 + TX_LANE_MAP: 0x73402516 + RX_POLARITY_FLIP: 0xd2 + TX_POLARITY_FLIP: 0xc9 + ? + PC_PM_ID: 20 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x15347062 + TX_LANE_MAP: 0x60734152 + RX_POLARITY_FLIP: 0x3f + TX_POLARITY_FLIP: 0x76 + ? + PC_PM_ID: 18 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x17360524 + TX_LANE_MAP: 0x16270435 + RX_POLARITY_FLIP: 0x7b + TX_POLARITY_FLIP: 0x9b + ? + PC_PM_ID: 17 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x36172405 + TX_LANE_MAP: 0x27163504 + RX_POLARITY_FLIP: 0x21 + TX_POLARITY_FLIP: 0x91 + ? + PC_PM_ID: 19 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x43516270 + TX_LANE_MAP: 0x37065241 + RX_POLARITY_FLIP: 0x30 + TX_POLARITY_FLIP: 0x16 + ? + PC_PM_ID: 24 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x15347062 + TX_LANE_MAP: 0x60734152 + RX_POLARITY_FLIP: 0x3f + TX_POLARITY_FLIP: 0x76 + ? + PC_PM_ID: 22 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x17360524 + TX_LANE_MAP: 0x16270435 + RX_POLARITY_FLIP: 0x7b + TX_POLARITY_FLIP: 0x9b + ? + PC_PM_ID: 21 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x36172405 + TX_LANE_MAP: 0x27163504 + RX_POLARITY_FLIP: 0x21 + TX_POLARITY_FLIP: 0x91 + ? + PC_PM_ID: 23 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x43516270 + TX_LANE_MAP: 0x37065241 + RX_POLARITY_FLIP: 0x30 + TX_POLARITY_FLIP: 0x16 + ? + PC_PM_ID: 28 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x43612705 + TX_LANE_MAP: 0x63507241 + RX_POLARITY_FLIP: 0xfc + TX_POLARITY_FLIP: 0x8e + ? + PC_PM_ID: 26 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x17360524 + TX_LANE_MAP: 0x16270435 + RX_POLARITY_FLIP: 0x7b + TX_POLARITY_FLIP: 0x9b + ? + PC_PM_ID: 25 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x36172405 + TX_LANE_MAP: 0x27163504 + RX_POLARITY_FLIP: 0x21 + TX_POLARITY_FLIP: 0x91 + ? + PC_PM_ID: 27 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x43516270 + TX_LANE_MAP: 0x37065241 + RX_POLARITY_FLIP: 0x30 + TX_POLARITY_FLIP: 0x36 + ? + PC_PM_ID: 32 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x73621504 + TX_LANE_MAP: 0x62734051 + RX_POLARITY_FLIP: 0xf0 + TX_POLARITY_FLIP: 0x00 + ? + PC_PM_ID: 30 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x71605342 + TX_LANE_MAP: 0x6172435 + RX_POLARITY_FLIP: 0xa5 + TX_POLARITY_FLIP: 0x00 + ? + PC_PM_ID: 29 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x60714253 + TX_LANE_MAP: 0x17063524 + RX_POLARITY_FLIP: 0x21 + TX_POLARITY_FLIP: 0x69 + ? + PC_PM_ID: 31 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x26370415 + TX_LANE_MAP: 0x37265140 + RX_POLARITY_FLIP: 0x30 + TX_POLARITY_FLIP: 0xc3 + ? + PC_PM_ID: 35 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x15047362 + TX_LANE_MAP: 0x4152637 + RX_POLARITY_FLIP: 0xf0 + TX_POLARITY_FLIP: 0xff + ? + PC_PM_ID: 33 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x17063524 + TX_LANE_MAP: 0x60714253 + RX_POLARITY_FLIP: 0xa5 + TX_POLARITY_FLIP: 0xff + ? + PC_PM_ID: 34 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x6172435 + TX_LANE_MAP: 0x71605342 + RX_POLARITY_FLIP: 0xed + TX_POLARITY_FLIP: 0x69 + ? + PC_PM_ID: 36 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x40516273 + TX_LANE_MAP: 0x51403726 + RX_POLARITY_FLIP: 0xfc + TX_POLARITY_FLIP: 0xc3 + ? + PC_PM_ID: 40 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x70621534 + TX_LANE_MAP: 0x14250637 + RX_POLARITY_FLIP: 0x0c + TX_POLARITY_FLIP: 0x64 + ? + PC_PM_ID: 38 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x71635042 + TX_LANE_MAP: 0x61724053 + RX_POLARITY_FLIP: 0x48 + TX_POLARITY_FLIP: 0x9c + ? + PC_PM_ID: 37 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x6241537 + TX_LANE_MAP: 0x51624073 + RX_POLARITY_FLIP: 0x7b + TX_POLARITY_FLIP: 0x3a + ? + PC_PM_ID: 39 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x26073415 + TX_LANE_MAP: 0x52413706 + RX_POLARITY_FLIP: 0xfc + TX_POLARITY_FLIP: 0x9e + ? + PC_PM_ID: 44 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x70621534 + TX_LANE_MAP: 0x14250637 + RX_POLARITY_FLIP: 0x0c + TX_POLARITY_FLIP: 0x64 + ? + PC_PM_ID: 42 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x71635042 + TX_LANE_MAP: 0x61724053 + RX_POLARITY_FLIP: 0x48 + TX_POLARITY_FLIP: 0x98 + ? + PC_PM_ID: 41 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x63714250 + TX_LANE_MAP: 0x72615340 + RX_POLARITY_FLIP: 0xed + TX_POLARITY_FLIP: 0x9d + ? + PC_PM_ID: 43 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x26073415 + TX_LANE_MAP: 0x52413706 + RX_POLARITY_FLIP: 0xfc + TX_POLARITY_FLIP: 0x9e + ? + PC_PM_ID: 48 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x70621534 + TX_LANE_MAP: 0x14250637 + RX_POLARITY_FLIP: 0x0c + TX_POLARITY_FLIP: 0x64 + ? + PC_PM_ID: 46 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x71635042 + TX_LANE_MAP: 0x61724053 + RX_POLARITY_FLIP: 0x48 + TX_POLARITY_FLIP: 0x98 + ? + PC_PM_ID: 45 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x63714250 + TX_LANE_MAP: 0x72615340 + RX_POLARITY_FLIP: 0xed + TX_POLARITY_FLIP: 0x9d + ? + PC_PM_ID: 47 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x26073415 + TX_LANE_MAP: 0x52413706 + RX_POLARITY_FLIP: 0xfc + TX_POLARITY_FLIP: 0x9e + ? + PC_PM_ID: 52 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x5247163 + TX_LANE_MAP: 0x61524073 + RX_POLARITY_FLIP: 0x8b + TX_POLARITY_FLIP: 0x93 + ? + PC_PM_ID: 50 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x7261534 + TX_LANE_MAP: 0x6351427 + RX_POLARITY_FLIP: 0xd2 + TX_POLARITY_FLIP: 0x63 + ? + PC_PM_ID: 49 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x26073415 + TX_LANE_MAP: 0x35062714 + RX_POLARITY_FLIP: 0x87 + TX_POLARITY_FLIP: 0x63 + ? + PC_PM_ID: 51 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x42506371 + TX_LANE_MAP: 0x25167340 + RX_POLARITY_FLIP: 0xe1 + TX_POLARITY_FLIP: 0x63 + ? + PC_PM_ID: 56 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x5247163 + TX_LANE_MAP: 0x61524073 + RX_POLARITY_FLIP: 0x8b + TX_POLARITY_FLIP: 0x93 + ? + PC_PM_ID: 54 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x7261534 + TX_LANE_MAP: 0x6351427 + RX_POLARITY_FLIP: 0xd2 + TX_POLARITY_FLIP: 0x63 + ? + PC_PM_ID: 53 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x26073415 + TX_LANE_MAP: 0x35062714 + RX_POLARITY_FLIP: 0x87 + TX_POLARITY_FLIP: 0x63 + ? + PC_PM_ID: 55 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x42506371 + TX_LANE_MAP: 0x25167340 + RX_POLARITY_FLIP: 0xe1 + TX_POLARITY_FLIP: 0x63 + ? + PC_PM_ID: 60 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x62730415 + TX_LANE_MAP: 0x73624150 + RX_POLARITY_FLIP: 0x98 + TX_POLARITY_FLIP: 0x1b + ? + PC_PM_ID: 58 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x7261534 + TX_LANE_MAP: 0x6351427 + RX_POLARITY_FLIP: 0xd2 + TX_POLARITY_FLIP: 0x63 + ? + PC_PM_ID: 57 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x26073415 + TX_LANE_MAP: 0x35062714 + RX_POLARITY_FLIP: 0x87 + TX_POLARITY_FLIP: 0x63 + ? + PC_PM_ID: 59 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x42506371 + TX_LANE_MAP: 0x25167340 + RX_POLARITY_FLIP: 0xe1 + TX_POLARITY_FLIP: 0x62 + ? + PC_PM_ID: 64 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x73621504 + TX_LANE_MAP: 0x62734051 + RX_POLARITY_FLIP: 0xc2 + TX_POLARITY_FLIP: 0x33 + ? + PC_PM_ID: 62 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x71605342 + TX_LANE_MAP: 0x6172435 + RX_POLARITY_FLIP: 0x96 + TX_POLARITY_FLIP: 0x33 + ? + PC_PM_ID: 61 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x60714253 + TX_LANE_MAP: 0x17063524 + RX_POLARITY_FLIP: 0xcc + TX_POLARITY_FLIP: 0x69 + ? + PC_PM_ID: 63 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x26370415 + TX_LANE_MAP: 0x37265140 + RX_POLARITY_FLIP: 0xcc + TX_POLARITY_FLIP: 0xc3 +--- +device: + 0: + PC_PORT_PHYS_MAP: + ? + PORT_ID: 1 + : + PC_PHYS_PORT_ID: 1 + ? + PORT_ID: 2 + : + PC_PHYS_PORT_ID: 9 + ? + PORT_ID: 11 + : + PC_PHYS_PORT_ID: 17 + ? + PORT_ID: 12 + : + PC_PHYS_PORT_ID: 25 + ? + PORT_ID: 22 + : + PC_PHYS_PORT_ID: 33 + ? + PORT_ID: 23 + : + PC_PHYS_PORT_ID: 41 + ? + PORT_ID: 33 + : + PC_PHYS_PORT_ID: 49 + ? + PORT_ID: 34 + : + PC_PHYS_PORT_ID: 57 + ? + PORT_ID: 44 + : + PC_PHYS_PORT_ID: 65 + ? + PORT_ID: 45 + : + PC_PHYS_PORT_ID: 73 + ? + PORT_ID: 55 + : + PC_PHYS_PORT_ID: 81 + ? + PORT_ID: 56 + : + PC_PHYS_PORT_ID: 89 + ? + PORT_ID: 66 + : + PC_PHYS_PORT_ID: 97 + ? + PORT_ID: 67 + : + PC_PHYS_PORT_ID: 105 + ? + PORT_ID: 77 + : + PC_PHYS_PORT_ID: 113 + ? + PORT_ID: 78 + : + PC_PHYS_PORT_ID: 121 + ? + PORT_ID: 88 + : + PC_PHYS_PORT_ID: 129 + ? + PORT_ID: 89 + : + PC_PHYS_PORT_ID: 137 + ? + PORT_ID: 99 + : + PC_PHYS_PORT_ID: 145 + ? + PORT_ID: 100 + : + PC_PHYS_PORT_ID: 153 + ? + PORT_ID: 110 + : + PC_PHYS_PORT_ID: 161 + ? + PORT_ID: 111 + : + PC_PHYS_PORT_ID: 169 + ? + PORT_ID: 121 + : + PC_PHYS_PORT_ID: 177 + ? + PORT_ID: 122 + : + PC_PHYS_PORT_ID: 185 + ? + PORT_ID: 132 + : + PC_PHYS_PORT_ID: 193 + ? + PORT_ID: 133 + : + PC_PHYS_PORT_ID: 201 + ? + PORT_ID: 143 + : + PC_PHYS_PORT_ID: 209 + ? + PORT_ID: 144 + : + PC_PHYS_PORT_ID: 217 + ? + PORT_ID: 154 + : + PC_PHYS_PORT_ID: 225 + ? + PORT_ID: 155 + : + PC_PHYS_PORT_ID: 233 + ? + PORT_ID: 165 + : + PC_PHYS_PORT_ID: 241 + ? + PORT_ID: 166 + : + PC_PHYS_PORT_ID: 249 + ? + PORT_ID: 176 + : + PC_PHYS_PORT_ID: 257 + ? + PORT_ID: 177 + : + PC_PHYS_PORT_ID: 265 + ? + PORT_ID: 187 + : + PC_PHYS_PORT_ID: 273 + ? + PORT_ID: 188 + : + PC_PHYS_PORT_ID: 281 + ? + PORT_ID: 198 + : + PC_PHYS_PORT_ID: 289 + ? + PORT_ID: 199 + : + PC_PHYS_PORT_ID: 297 + ? + PORT_ID: 209 + : + PC_PHYS_PORT_ID: 305 + ? + PORT_ID: 210 + : + PC_PHYS_PORT_ID: 313 + ? + PORT_ID: 220 + : + PC_PHYS_PORT_ID: 321 + ? + PORT_ID: 221 + : + PC_PHYS_PORT_ID: 329 + ? + PORT_ID: 231 + : + PC_PHYS_PORT_ID: 337 + ? + PORT_ID: 232 + : + PC_PHYS_PORT_ID: 345 + ? + PORT_ID: 242 + : + PC_PHYS_PORT_ID: 353 + ? + PORT_ID: 243 + : + PC_PHYS_PORT_ID: 361 + ? + PORT_ID: 253 + : + PC_PHYS_PORT_ID: 369 + ? + PORT_ID: 254 + : + PC_PHYS_PORT_ID: 377 + ? + PORT_ID: 264 + : + PC_PHYS_PORT_ID: 385 + ? + PORT_ID: 265 + : + PC_PHYS_PORT_ID: 393 + ? + PORT_ID: 275 + : + PC_PHYS_PORT_ID: 401 + ? + PORT_ID: 276 + : + PC_PHYS_PORT_ID: 409 + ? + PORT_ID: 286 + : + PC_PHYS_PORT_ID: 417 + ? + PORT_ID: 287 + : + PC_PHYS_PORT_ID: 425 + ? + PORT_ID: 297 + : + PC_PHYS_PORT_ID: 433 + ? + PORT_ID: 298 + : + PC_PHYS_PORT_ID: 441 + ? + PORT_ID: 308 + : + PC_PHYS_PORT_ID: 449 + ? + PORT_ID: 309 + : + PC_PHYS_PORT_ID: 457 + ? + PORT_ID: 319 + : + PC_PHYS_PORT_ID: 465 + ? + PORT_ID: 320 + : + PC_PHYS_PORT_ID: 473 + ? + PORT_ID: 330 + : + PC_PHYS_PORT_ID: 481 + ? + PORT_ID: 331 + : + PC_PHYS_PORT_ID: 489 + ? + PORT_ID: 341 + : + PC_PHYS_PORT_ID: 497 + ? + PORT_ID: 342 + : + PC_PHYS_PORT_ID: 505 +... +--- +device: + 0: + PC_PORT: + ? + PORT_ID: [[1, 2], + [11, 12], + [22, 23], + [33, 34], + [44, 45], + [55, 56], + [66, 67], + [77, 78], + [88, 89], + [99, 100], + [110, 111], + [121, 122], + [132, 133], + [143, 144], + [154, 155], + [165, 166], + [176, 177], + [187, 188], + [198, 199], + [209, 210], + [220, 221], + [231, 232], + [242, 243], + [253, 254], + [264, 265], + [275, 276], + [286, 287], + [297, 298], + [308, 309], + [319, 320], + [330, 331], + [341, 342]] + : + ENABLE: 1 + SPEED: 800000 + NUM_LANES: 8 + FEC_MODE: PC_FEC_RS544_2XN + MAX_FRAME_SIZE: 9416 +... +--- +bcm_device: + 0: + global: + ftem_mem_entries: 65536 +... +--- +device: + 0: + # Per pipe flex counter configuration + CTR_EFLEX_CONFIG: + CTR_ING_EFLEX_OPERMODE_PIPEUNIQUE: 0 + CTR_EGR_EFLEX_OPERMODE_PIPEUNIQUE: 0 + + # IFP mode + FP_CONFIG: + FP_ING_OPERMODE: GLOBAL_PIPE_AWARE +... +--- +device: + 0: + DEVICE_CONFIG: + AUTOLOAD_BOARD_SETTINGS: 0 +... diff --git a/device/arista/x86_64-arista_7060x6_64de/default_sku b/device/arista/x86_64-arista_7060x6_64de/default_sku new file mode 100644 index 000000000000..1fd33cc6b700 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/default_sku @@ -0,0 +1 @@ +Arista-7060X6-64DE t1 diff --git a/device/arista/x86_64-arista_7060x6_64de/pcie.yaml b/device/arista/x86_64-arista_7060x6_64de/pcie.yaml new file mode 120000 index 000000000000..df18a601d82f --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/pcie.yaml @@ -0,0 +1 @@ +../x86_64-arista_common/pcie.yaml \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64de/platform.json b/device/arista/x86_64-arista_7060x6_64de/platform.json new file mode 100644 index 000000000000..9f58b40e4c1d --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/platform.json @@ -0,0 +1,1340 @@ +{ + "chassis": { + "name": "DCS-7060X6-64DE", + "components": [ + { + "name": "Aboot()" + }, + { + "name": "Scd(addr=0000:00:18.7)" + }, + { + "name": "Scd(addr=0000:03:00.0)" + }, + { + "name": "ShearwaterSysCpld(addr=13-0023)" + } + ], + "fans": [], + "fan_drawers": [ + { + "name": "slot1", + "fans": [ + { + "name": "fan1" + } + ] + }, + { + "name": "slot2", + "fans": [ + { + "name": "fan2" + } + ] + }, + { + "name": "slot3", + "fans": [ + { + "name": "fan3" + } + ] + }, + { + "name": "slot4", + "fans": [ + { + "name": "fan4" + } + ] + } + ], + "psus": [ + { + "name": "psu1", + "voltage_high_threshold": false, + "voltage_low_threshold": false, + "fans": [ + { + "name": "psu1/1", + "speed": { + "controllable": false + } + } + ] + }, + { + "name": "psu2", + "voltage_high_threshold": false, + "voltage_low_threshold": false, + "fans": [ + { + "name": "psu2/1", + "speed": { + "controllable": false + } + } + ] + } + ], + "thermals": [ + { + "name": "Cpu temp sensor", + "controllable": false + }, + { + "name": "Ambient", + "controllable": false + }, + { + "name": "Outlet", + "controllable": false + }, + { + "name": "Switch Card temp sensor", + "controllable": false + }, + { + "name": "Air Exit Behind TH5", + "controllable": false + }, + { + "name": "Left Edge PCB Near Rear of Switch", + "controllable": false + }, + { + "name": "Air Inlet", + "controllable": false + }, + { + "name": "TH5 Diode 1", + "controllable": false + }, + { + "name": "TH5 Diode 2", + "controllable": false + } + ], + "sfps": [ + { + "name": "osfp1" + }, + { + "name": "osfp2" + }, + { + "name": "osfp3" + }, + { + "name": "osfp4" + }, + { + "name": "osfp5" + }, + { + "name": "osfp6" + }, + { + "name": "osfp7" + }, + { + "name": "osfp8" + }, + { + "name": "osfp9" + }, + { + "name": "osfp10" + }, + { + "name": "osfp11" + }, + { + "name": "osfp12" + }, + { + "name": "osfp13" + }, + { + "name": "osfp14" + }, + { + "name": "osfp15" + }, + { + "name": "osfp16" + }, + { + "name": "osfp17" + }, + { + "name": "osfp18" + }, + { + "name": "osfp19" + }, + { + "name": "osfp20" + }, + { + "name": "osfp21" + }, + { + "name": "osfp22" + }, + { + "name": "osfp23" + }, + { + "name": "osfp24" + }, + { + "name": "osfp25" + }, + { + "name": "osfp26" + }, + { + "name": "osfp27" + }, + { + "name": "osfp28" + }, + { + "name": "osfp29" + }, + { + "name": "osfp30" + }, + { + "name": "osfp31" + }, + { + "name": "osfp32" + }, + { + "name": "osfp33" + }, + { + "name": "osfp34" + }, + { + "name": "osfp35" + }, + { + "name": "osfp36" + }, + { + "name": "osfp37" + }, + { + "name": "osfp38" + }, + { + "name": "osfp39" + }, + { + "name": "osfp40" + }, + { + "name": "osfp41" + }, + { + "name": "osfp42" + }, + { + "name": "osfp43" + }, + { + "name": "osfp44" + }, + { + "name": "osfp45" + }, + { + "name": "osfp46" + }, + { + "name": "osfp47" + }, + { + "name": "osfp48" + }, + { + "name": "osfp49" + }, + { + "name": "osfp50" + }, + { + "name": "osfp51" + }, + { + "name": "osfp52" + }, + { + "name": "osfp53" + }, + { + "name": "osfp54" + }, + { + "name": "osfp55" + }, + { + "name": "osfp56" + }, + { + "name": "osfp57" + }, + { + "name": "osfp58" + }, + { + "name": "osfp59" + }, + { + "name": "osfp60" + }, + { + "name": "osfp61" + }, + { + "name": "osfp62" + }, + { + "name": "osfp63" + }, + { + "name": "osfp64" + } + ] + }, + "interfaces": { + "Ethernet0": { + "index": "1,1,1,1,1,1,1,1", + "lanes": "17,18,19,20,21,22,23,24", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet1/1" + ], + "1x400G": [ + "Ethernet1/1" + ], + "2x400G": [ + "Ethernet1/1", + "Ethernet1/5" + ] + } + }, + "Ethernet8": { + "index": "2,2,2,2,2,2,2,2", + "lanes": "1,2,3,4,5,6,7,8", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet2/1" + ], + "1x400G": [ + "Ethernet2/1" + ], + "2x400G": [ + "Ethernet2/1", + "Ethernet2/5" + ] + } + }, + "Ethernet16": { + "index": "3,3,3,3,3,3,3,3", + "lanes": "9,10,11,12,13,14,15,16", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet3/1" + ], + "1x400G": [ + "Ethernet3/1" + ], + "2x400G": [ + "Ethernet3/1", + "Ethernet3/5" + ] + } + }, + "Ethernet24": { + "index": "4,4,4,4,4,4,4,4", + "lanes": "25,26,27,28,29,30,31,32", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet4/1" + ], + "1x400G": [ + "Ethernet4/1" + ], + "2x400G": [ + "Ethernet4/1", + "Ethernet4/5" + ] + } + }, + "Ethernet32": { + "index": "5,5,5,5,5,5,5,5", + "lanes": "57,58,59,60,61,62,63,64", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet5/1" + ], + "1x400G": [ + "Ethernet5/1" + ], + "2x400G": [ + "Ethernet5/1", + "Ethernet5/5" + ] + } + }, + "Ethernet40": { + "index": "6,6,6,6,6,6,6,6", + "lanes": "41,42,43,44,45,46,47,48", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet6/1" + ], + "1x400G": [ + "Ethernet6/1" + ], + "2x400G": [ + "Ethernet6/1", + "Ethernet6/5" + ] + } + }, + "Ethernet48": { + "index": "7,7,7,7,7,7,7,7", + "lanes": "33,34,35,36,37,38,39,40", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet7/1" + ], + "1x400G": [ + "Ethernet7/1" + ], + "2x400G": [ + "Ethernet7/1", + "Ethernet7/5" + ] + } + }, + "Ethernet56": { + "index": "8,8,8,8,8,8,8,8", + "lanes": "49,50,51,52,53,54,55,56", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet8/1" + ], + "1x400G": [ + "Ethernet8/1" + ], + "2x400G": [ + "Ethernet8/1", + "Ethernet8/5" + ] + } + }, + "Ethernet64": { + "index": "9,9,9,9,9,9,9,9", + "lanes": "89,90,91,92,93,94,95,96", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet9/1" + ], + "1x400G": [ + "Ethernet9/1" + ], + "2x400G": [ + "Ethernet9/1", + "Ethernet9/5" + ] + } + }, + "Ethernet72": { + "index": "10,10,10,10,10,10,10,10", + "lanes": "73,74,75,76,77,78,79,80", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet10/1" + ], + "1x400G": [ + "Ethernet10/1" + ], + "2x400G": [ + "Ethernet10/1", + "Ethernet10/5" + ] + } + }, + "Ethernet80": { + "index": "11,11,11,11,11,11,11,11", + "lanes": "65,66,67,68,69,70,71,72", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet11/1" + ], + "1x400G": [ + "Ethernet11/1" + ], + "2x400G": [ + "Ethernet11/1", + "Ethernet11/5" + ] + } + }, + "Ethernet88": { + "index": "12,12,12,12,12,12,12,12", + "lanes": "81,82,83,84,85,86,87,88", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet12/1" + ], + "1x400G": [ + "Ethernet12/1" + ], + "2x400G": [ + "Ethernet12/1", + "Ethernet12/5" + ] + } + }, + "Ethernet96": { + "index": "13,13,13,13,13,13,13,13", + "lanes": "121,122,123,124,125,126,127,128", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet13/1" + ], + "1x400G": [ + "Ethernet13/1" + ], + "2x400G": [ + "Ethernet13/1", + "Ethernet13/5" + ] + } + }, + "Ethernet104": { + "index": "14,14,14,14,14,14,14,14", + "lanes": "105,106,107,108,109,110,111,112", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet14/1" + ], + "1x400G": [ + "Ethernet14/1" + ], + "2x400G": [ + "Ethernet14/1", + "Ethernet14/5" + ] + } + }, + "Ethernet112": { + "index": "15,15,15,15,15,15,15,15", + "lanes": "97,98,99,100,101,102,103,104", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet15/1" + ], + "1x400G": [ + "Ethernet15/1" + ], + "2x400G": [ + "Ethernet15/1", + "Ethernet15/5" + ] + } + }, + "Ethernet120": { + "index": "16,16,16,16,16,16,16,16", + "lanes": "113,114,115,116,117,118,119,120", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet16/1" + ], + "1x400G": [ + "Ethernet16/1" + ], + "2x400G": [ + "Ethernet16/1", + "Ethernet16/5" + ] + } + }, + "Ethernet128": { + "index": "17,17,17,17,17,17,17,17", + "lanes": "153,154,155,156,157,158,159,160", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet17/1" + ], + "1x400G": [ + "Ethernet17/1" + ], + "2x400G": [ + "Ethernet17/1", + "Ethernet17/5" + ] + } + }, + "Ethernet136": { + "index": "18,18,18,18,18,18,18,18", + "lanes": "137,138,139,140,141,142,143,144", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet18/1" + ], + "1x400G": [ + "Ethernet18/1" + ], + "2x400G": [ + "Ethernet18/1", + "Ethernet18/5" + ] + } + }, + "Ethernet144": { + "index": "19,19,19,19,19,19,19,19", + "lanes": "129,130,131,132,133,134,135,136", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet19/1" + ], + "1x400G": [ + "Ethernet19/1" + ], + "2x400G": [ + "Ethernet19/1", + "Ethernet19/5" + ] + } + }, + "Ethernet152": { + "index": "20,20,20,20,20,20,20,20", + "lanes": "145,146,147,148,149,150,151,152", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet20/1" + ], + "1x400G": [ + "Ethernet20/1" + ], + "2x400G": [ + "Ethernet20/1", + "Ethernet20/5" + ] + } + }, + "Ethernet160": { + "index": "21,21,21,21,21,21,21,21", + "lanes": "185,186,187,188,189,190,191,192", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet21/1" + ], + "1x400G": [ + "Ethernet21/1" + ], + "2x400G": [ + "Ethernet21/1", + "Ethernet21/5" + ] + } + }, + "Ethernet168": { + "index": "22,22,22,22,22,22,22,22", + "lanes": "169,170,171,172,173,174,175,176", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet22/1" + ], + "1x400G": [ + "Ethernet22/1" + ], + "2x400G": [ + "Ethernet22/1", + "Ethernet22/5" + ] + } + }, + "Ethernet176": { + "index": "23,23,23,23,23,23,23,23", + "lanes": "161,162,163,164,165,166,167,168", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet23/1" + ], + "1x400G": [ + "Ethernet23/1" + ], + "2x400G": [ + "Ethernet23/1", + "Ethernet23/5" + ] + } + }, + "Ethernet184": { + "index": "24,24,24,24,24,24,24,24", + "lanes": "177,178,179,180,181,182,183,184", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet24/1" + ], + "1x400G": [ + "Ethernet24/1" + ], + "2x400G": [ + "Ethernet24/1", + "Ethernet24/5" + ] + } + }, + "Ethernet192": { + "index": "25,25,25,25,25,25,25,25", + "lanes": "217,218,219,220,221,222,223,224", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet25/1" + ], + "1x400G": [ + "Ethernet25/1" + ], + "2x400G": [ + "Ethernet25/1", + "Ethernet25/5" + ] + } + }, + "Ethernet200": { + "index": "26,26,26,26,26,26,26,26", + "lanes": "201,202,203,204,205,206,207,208", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet26/1" + ], + "1x400G": [ + "Ethernet26/1" + ], + "2x400G": [ + "Ethernet26/1", + "Ethernet26/5" + ] + } + }, + "Ethernet208": { + "index": "27,27,27,27,27,27,27,27", + "lanes": "193,194,195,196,197,198,199,200", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet27/1" + ], + "1x400G": [ + "Ethernet27/1" + ], + "2x400G": [ + "Ethernet27/1", + "Ethernet27/5" + ] + } + }, + "Ethernet216": { + "index": "28,28,28,28,28,28,28,28", + "lanes": "209,210,211,212,213,214,215,216", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet28/1" + ], + "1x400G": [ + "Ethernet28/1" + ], + "2x400G": [ + "Ethernet28/1", + "Ethernet28/5" + ] + } + }, + "Ethernet224": { + "index": "29,29,29,29,29,29,29,29", + "lanes": "249,250,251,252,253,254,255,256", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet29/1" + ], + "1x400G": [ + "Ethernet29/1" + ], + "2x400G": [ + "Ethernet29/1", + "Ethernet29/5" + ] + } + }, + "Ethernet232": { + "index": "30,30,30,30,30,30,30,30", + "lanes": "233,234,235,236,237,238,239,240", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet30/1" + ], + "1x400G": [ + "Ethernet30/1" + ], + "2x400G": [ + "Ethernet30/1", + "Ethernet30/5" + ] + } + }, + "Ethernet240": { + "index": "31,31,31,31,31,31,31,31", + "lanes": "225,226,227,228,229,230,231,232", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet31/1" + ], + "1x400G": [ + "Ethernet31/1" + ], + "2x400G": [ + "Ethernet31/1", + "Ethernet31/5" + ] + } + }, + "Ethernet248": { + "index": "32,32,32,32,32,32,32,32", + "lanes": "241,242,243,244,245,246,247,248", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet32/1" + ], + "1x400G": [ + "Ethernet32/1" + ], + "2x400G": [ + "Ethernet32/1", + "Ethernet32/5" + ] + } + }, + "Ethernet256": { + "index": "33,33,33,33,33,33,33,33", + "lanes": "273,274,275,276,277,278,279,280", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet33/1" + ], + "1x400G": [ + "Ethernet33/1" + ], + "2x400G": [ + "Ethernet33/1", + "Ethernet33/5" + ] + } + }, + "Ethernet264": { + "index": "34,34,34,34,34,34,34,34", + "lanes": "257,258,259,260,261,262,263,264", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet34/1" + ], + "1x400G": [ + "Ethernet34/1" + ], + "2x400G": [ + "Ethernet34/1", + "Ethernet34/5" + ] + } + }, + "Ethernet272": { + "index": "35,35,35,35,35,35,35,35", + "lanes": "265,266,267,268,269,270,271,272", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet35/1" + ], + "1x400G": [ + "Ethernet35/1" + ], + "2x400G": [ + "Ethernet35/1", + "Ethernet35/5" + ] + } + }, + "Ethernet280": { + "index": "36,36,36,36,36,36,36,36", + "lanes": "281,282,283,284,285,286,287,288", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet36/1" + ], + "1x400G": [ + "Ethernet36/1" + ], + "2x400G": [ + "Ethernet36/1", + "Ethernet36/5" + ] + } + }, + "Ethernet288": { + "index": "37,37,37,37,37,37,37,37", + "lanes": "313,314,315,316,317,318,319,320", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet37/1" + ], + "1x400G": [ + "Ethernet37/1" + ], + "2x400G": [ + "Ethernet37/1", + "Ethernet37/5" + ] + } + }, + "Ethernet296": { + "index": "38,38,38,38,38,38,38,38", + "lanes": "297,298,299,300,301,302,303,304", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet38/1" + ], + "1x400G": [ + "Ethernet38/1" + ], + "2x400G": [ + "Ethernet38/1", + "Ethernet38/5" + ] + } + }, + "Ethernet304": { + "index": "39,39,39,39,39,39,39,39", + "lanes": "289,290,291,292,293,294,295,296", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet39/1" + ], + "1x400G": [ + "Ethernet39/1" + ], + "2x400G": [ + "Ethernet39/1", + "Ethernet39/5" + ] + } + }, + "Ethernet312": { + "index": "40,40,40,40,40,40,40,40", + "lanes": "305,306,307,308,309,310,311,312", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet40/1" + ], + "1x400G": [ + "Ethernet40/1" + ], + "2x400G": [ + "Ethernet40/1", + "Ethernet40/5" + ] + } + }, + "Ethernet320": { + "index": "41,41,41,41,41,41,41,41", + "lanes": "345,346,347,348,349,350,351,352", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet41/1" + ], + "1x400G": [ + "Ethernet41/1" + ], + "2x400G": [ + "Ethernet41/1", + "Ethernet41/5" + ] + } + }, + "Ethernet328": { + "index": "42,42,42,42,42,42,42,42", + "lanes": "329,330,331,332,333,334,335,336", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet42/1" + ], + "1x400G": [ + "Ethernet42/1" + ], + "2x400G": [ + "Ethernet42/1", + "Ethernet42/5" + ] + } + }, + "Ethernet336": { + "index": "43,43,43,43,43,43,43,43", + "lanes": "321,322,323,324,325,326,327,328", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet43/1" + ], + "1x400G": [ + "Ethernet43/1" + ], + "2x400G": [ + "Ethernet43/1", + "Ethernet43/5" + ] + } + }, + "Ethernet344": { + "index": "44,44,44,44,44,44,44,44", + "lanes": "337,338,339,340,341,342,343,344", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet44/1" + ], + "1x400G": [ + "Ethernet44/1" + ], + "2x400G": [ + "Ethernet44/1", + "Ethernet44/5" + ] + } + }, + "Ethernet352": { + "index": "45,45,45,45,45,45,45,45", + "lanes": "377,378,379,380,381,382,383,384", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet45/1" + ], + "1x400G": [ + "Ethernet45/1" + ], + "2x400G": [ + "Ethernet45/1", + "Ethernet45/5" + ] + } + }, + "Ethernet360": { + "index": "46,46,46,46,46,46,46,46", + "lanes": "361,362,363,364,365,366,367,368", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet46/1" + ], + "1x400G": [ + "Ethernet46/1" + ], + "2x400G": [ + "Ethernet46/1", + "Ethernet46/5" + ] + } + }, + "Ethernet368": { + "index": "47,47,47,47,47,47,47,47", + "lanes": "353,354,355,356,357,358,359,360", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet47/1" + ], + "1x400G": [ + "Ethernet47/1" + ], + "2x400G": [ + "Ethernet47/1", + "Ethernet47/5" + ] + } + }, + "Ethernet376": { + "index": "48,48,48,48,48,48,48,48", + "lanes": "369,370,371,372,373,374,375,376", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet48/1" + ], + "1x400G": [ + "Ethernet48/1" + ], + "2x400G": [ + "Ethernet48/1", + "Ethernet48/5" + ] + } + }, + "Ethernet384": { + "index": "49,49,49,49,49,49,49,49", + "lanes": "409,410,411,412,413,414,415,416", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet49/1" + ], + "1x400G": [ + "Ethernet49/1" + ], + "2x400G": [ + "Ethernet49/1", + "Ethernet49/5" + ] + } + }, + "Ethernet392": { + "index": "50,50,50,50,50,50,50,50", + "lanes": "393,394,395,396,397,398,399,400", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet50/1" + ], + "1x400G": [ + "Ethernet50/1" + ], + "2x400G": [ + "Ethernet50/1", + "Ethernet50/5" + ] + } + }, + "Ethernet400": { + "index": "51,51,51,51,51,51,51,51", + "lanes": "385,386,387,388,389,390,391,392", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet51/1" + ], + "1x400G": [ + "Ethernet51/1" + ], + "2x400G": [ + "Ethernet51/1", + "Ethernet51/5" + ] + } + }, + "Ethernet408": { + "index": "52,52,52,52,52,52,52,52", + "lanes": "401,402,403,404,405,406,407,408", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet52/1" + ], + "1x400G": [ + "Ethernet52/1" + ], + "2x400G": [ + "Ethernet52/1", + "Ethernet52/5" + ] + } + }, + "Ethernet416": { + "index": "53,53,53,53,53,53,53,53", + "lanes": "441,442,443,444,445,446,447,448", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet53/1" + ], + "1x400G": [ + "Ethernet53/1" + ], + "2x400G": [ + "Ethernet53/1", + "Ethernet53/5" + ] + } + }, + "Ethernet424": { + "index": "54,54,54,54,54,54,54,54", + "lanes": "425,426,427,428,429,430,431,432", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet54/1" + ], + "1x400G": [ + "Ethernet54/1" + ], + "2x400G": [ + "Ethernet54/1", + "Ethernet54/5" + ] + } + }, + "Ethernet432": { + "index": "55,55,55,55,55,55,55,55", + "lanes": "417,418,419,420,421,422,423,424", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet55/1" + ], + "1x400G": [ + "Ethernet55/1" + ], + "2x400G": [ + "Ethernet55/1", + "Ethernet55/5" + ] + } + }, + "Ethernet440": { + "index": "56,56,56,56,56,56,56,56", + "lanes": "433,434,435,436,437,438,439,440", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet56/1" + ], + "1x400G": [ + "Ethernet56/1" + ], + "2x400G": [ + "Ethernet56/1", + "Ethernet56/5" + ] + } + }, + "Ethernet448": { + "index": "57,57,57,57,57,57,57,57", + "lanes": "473,474,475,476,477,478,479,480", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet57/1" + ], + "1x400G": [ + "Ethernet57/1" + ], + "2x400G": [ + "Ethernet57/1", + "Ethernet57/5" + ] + } + }, + "Ethernet456": { + "index": "58,58,58,58,58,58,58,58", + "lanes": "457,458,459,460,461,462,463,464", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet58/1" + ], + "1x400G": [ + "Ethernet58/1" + ], + "2x400G": [ + "Ethernet58/1", + "Ethernet58/5" + ] + } + }, + "Ethernet464": { + "index": "59,59,59,59,59,59,59,59", + "lanes": "449,450,451,452,453,454,455,456", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet59/1" + ], + "1x400G": [ + "Ethernet59/1" + ], + "2x400G": [ + "Ethernet59/1", + "Ethernet59/5" + ] + } + }, + "Ethernet472": { + "index": "60,60,60,60,60,60,60,60", + "lanes": "465,466,467,468,469,470,471,472", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet60/1" + ], + "1x400G": [ + "Ethernet60/1" + ], + "2x400G": [ + "Ethernet60/1", + "Ethernet60/5" + ] + } + }, + "Ethernet480": { + "index": "61,61,61,61,61,61,61,61", + "lanes": "505,506,507,508,509,510,511,512", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet61/1" + ], + "1x400G": [ + "Ethernet61/1" + ], + "2x400G": [ + "Ethernet61/1", + "Ethernet61/5" + ] + } + }, + "Ethernet488": { + "index": "62,62,62,62,62,62,62,62", + "lanes": "489,490,491,492,493,494,495,496", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet62/1" + ], + "1x400G": [ + "Ethernet62/1" + ], + "2x400G": [ + "Ethernet62/1", + "Ethernet62/5" + ] + } + }, + "Ethernet496": { + "index": "63,63,63,63,63,63,63,63", + "lanes": "481,482,483,484,485,486,487,488", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet63/1" + ], + "1x400G": [ + "Ethernet63/1" + ], + "2x400G": [ + "Ethernet63/1", + "Ethernet63/5" + ] + } + }, + "Ethernet504": { + "index": "64,64,64,64,64,64,64,64", + "lanes": "497,498,499,500,501,502,503,504", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet64/1" + ], + "1x400G": [ + "Ethernet64/1" + ], + "2x400G": [ + "Ethernet64/1", + "Ethernet64/5" + ] + } + } + } +} diff --git a/device/arista/x86_64-arista_7060x6_64de/platform_asic b/device/arista/x86_64-arista_7060x6_64de/platform_asic new file mode 100644 index 000000000000..960467652765 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/platform_asic @@ -0,0 +1 @@ +broadcom diff --git a/device/arista/x86_64-arista_7060x6_64de/platform_components.json b/device/arista/x86_64-arista_7060x6_64de/platform_components.json new file mode 100644 index 000000000000..0c90359cb10d --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/platform_components.json @@ -0,0 +1,12 @@ +{ + "chassis": { + "DCS-7060X6-64DE": { + "component": { + "Aboot()": {}, + "Scd(addr=0000:00:18.7)": {}, + "Scd(addr=0000:03:00.0)": {}, + "ShearwaterSysCpld(addr=13-0023)": {} + } + } + } +} diff --git a/device/arista/x86_64-arista_7060x6_64de/platform_env.conf b/device/arista/x86_64-arista_7060x6_64de/platform_env.conf new file mode 100644 index 000000000000..dd7cf4fe01c5 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/platform_env.conf @@ -0,0 +1,2 @@ +SYNCD_SHM_SIZE=512m +is_ltsw_chip=1 diff --git a/device/arista/x86_64-arista_7060x6_64de/platform_reboot b/device/arista/x86_64-arista_7060x6_64de/platform_reboot new file mode 120000 index 000000000000..7f94a49e38b0 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/platform_reboot @@ -0,0 +1 @@ +../x86_64-arista_common/platform_reboot \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64de/plugins b/device/arista/x86_64-arista_7060x6_64de/plugins new file mode 120000 index 000000000000..789a45fcace9 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/plugins @@ -0,0 +1 @@ +../x86_64-arista_common/plugins \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64de/pmon_daemon_control.json b/device/arista/x86_64-arista_7060x6_64de/pmon_daemon_control.json new file mode 120000 index 000000000000..51d5ab7b0059 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/pmon_daemon_control.json @@ -0,0 +1 @@ +../x86_64-arista_common/pmon_daemon_control.json \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64de/sensors.conf b/device/arista/x86_64-arista_7060x6_64de/sensors.conf new file mode 100644 index 000000000000..d424c8708988 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/sensors.conf @@ -0,0 +1,14 @@ +bus "i2c-25" "SCD 0000:03:00.0 SMBus master 1 bus 0" + +chip "max6581-i2c-25-4d" + ignore temp5 + ignore temp6 + +chip "nvme-pci-0400" + # TODO: sensors complaining about tempX_min and tempX_max + ignore temp2 + ignore temp3 + ignore temp4 + ignore temp5 + ignore temp6 + ignore temp7 diff --git a/device/arista/x86_64-arista_7060x6_64de/system_health_monitoring_config.json b/device/arista/x86_64-arista_7060x6_64de/system_health_monitoring_config.json new file mode 120000 index 000000000000..1185f771fa8e --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/system_health_monitoring_config.json @@ -0,0 +1 @@ +../x86_64-arista_common/system_health_monitoring_config.json \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64de/thermal_policy.json b/device/arista/x86_64-arista_7060x6_64de/thermal_policy.json new file mode 120000 index 000000000000..0991dc7f3638 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/thermal_policy.json @@ -0,0 +1 @@ +../x86_64-arista_common/thermal_policy.json \ No newline at end of file diff --git a/files/Aboot/boot0.j2 b/files/Aboot/boot0.j2 index 143e869e58f4..43f3fcae1baa 100644 --- a/files/Aboot/boot0.j2 +++ b/files/Aboot/boot0.j2 @@ -457,15 +457,23 @@ EOF chmod a+r "${target_path}/machine.conf" } -read_system_eeprom() { - if [ -x /bin/readprefdl ] && [ -f /tmp/.system-prefdl ]; then - readprefdl -f /tmp/.system-prefdl -d > $target_path/.system-prefdl +read_eeprom() { + if [ -x /bin/readprefdl ] && [ -f "$1" ]; then + readprefdl -f "$1" -d > $target_path/.system-prefdl elif [ -f /etc/prefdl ]; then cp /etc/prefdl $target_path/.system-prefdl chmod a+r $target_path/.system-prefdl fi } +read_switch_eeprom() { + read_eeprom /tmp/.switch-prefdl +} + +read_system_eeprom() { + read_eeprom /tmp/.system-prefdl +} + write_platform_specific_cmdline() { local platform="$(cmdline_get platform)" local sid="$(cmdline_get sid | sed 's/Ssd$//')" @@ -615,6 +623,9 @@ write_platform_specific_cmdline() { aboot_machine=arista_7280cr3mk_32p4 flash_size=7382 fi + if in_array "$sid" "Shearwater4Mk2" "Shearwater4Mk2N" "Shearwater4Mk2QuicksilverDD" "Shearwater4Mk2NQuicksilverDD"; then + aboot_machine=arista_7060x6_64de + fi # disable cpu c-state other than C1 local cpuvendor="$(sed -nr 's/vendor_id[\t ]*: (.*)/\1/p' /proc/cpuinfo | head -n 1)" @@ -656,6 +667,13 @@ write_platform_specific_cmdline() { if in_array "$platform" "prairieisland"; then read_system_eeprom fi + if in_array "$platform" "shearwater"; then + if [ -f /tmp/.switch-prefdl ]; then + read_switch_eeprom + else + read_system_eeprom + fi + fi if [ $varlog_size -eq 0 ]; then if [ $flash_size -ge 28000 ]; then From 5c615a9c15002d4c29cf0d0c8a9a9df19c715c5a Mon Sep 17 00:00:00 2001 From: bingwang-ms <66248323+bingwang-ms@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:01:57 -0700 Subject: [PATCH 261/419] Fix YANG model for ACL (#18693) * Fix YANG model for ACL --- src/sonic-yang-mgmt/tests/test_cfghelp.py | 12 +- .../tests/yang_model_tests/tests/acl.json | 12 + .../yang_model_tests/tests_config/acl.json | 220 ++++++++++++++++++ .../yang-templates/sonic-acl.yang.j2 | 14 +- .../yang-templates/sonic-types.yang.j2 | 2 + 5 files changed, 247 insertions(+), 13 deletions(-) diff --git a/src/sonic-yang-mgmt/tests/test_cfghelp.py b/src/sonic-yang-mgmt/tests/test_cfghelp.py index 70b3a1edb10a..4efca817c8fb 100644 --- a/src/sonic-yang-mgmt/tests/test_cfghelp.py +++ b/src/sonic-yang-mgmt/tests/test_cfghelp.py @@ -111,12 +111,12 @@ Description: ACL_RULE part of config_db.json key - ACL_TABLE_NAME:RULE_NAME -+-----------+-----------------------------------------+-------------+-----------+-------------+ -| Field | Description | Mandatory | Default | Reference | -+===========+=========================================+=============+===========+=============+ -| ICMP_TYPE | Mutually exclusive in group icmp | | | | -| | when IP_TYPE in ANY,IP,IPV4,IPv4ANY,ARP | | | | -+-----------+-----------------------------------------+-------------+-----------+-------------+ ++-----------+-------------------------------------------------+-------------+-----------+-------------+ +| Field | Description | Mandatory | Default | Reference | ++===========+=================================================+=============+===========+=============+ +| ICMP_TYPE | Mutually exclusive in group icmp | | | | +| | when IP_TYPE in ANY,IP,IPV4,IPv4ANY,IPV4ANY,ARP | | | | ++-----------+-------------------------------------------------+-------------+-----------+-------------+ """ 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 18f053e2a300..309b64bb06a5 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 @@ -38,6 +38,12 @@ "desc": "Configure non-existing ACL_TABLE in ACL_RULE.", "eStrKey" : "LeafRef" }, + "ACL_RULE_IP_TYPE_SRC_IPV6ANY": { + "desc": "Configure IP_TYPE as ipv6any and SRC_IPV6 in ACL_RULE." + }, + "ACL_RULE_IP_TYPE_DST_IPV4ANY": { + "desc": "Configure IP_TYPE as ipv4any and DST_IP in ACL_RULE." + }, "ACL_RULE_IP_TYPE_SRC_IPV6_MISMATCH": { "desc": "Configure IP_TYPE as ipv4any and SRC_IPV6 in ACL_RULE.", "eStrKey" : "When", @@ -51,6 +57,12 @@ "eStrKey" : "When", "eStr": ["IP_TYPE"] }, + "ACL_RULE_VALID_L4_SRC_PORT_RANGE": { + "desc": "Configure l4_src_port_range as 1024-65535 in ACL_RULE" + }, + "ACL_RULE_VALID_L4_DST_PORT_RANGE": { + "desc": "Configure l4_src_port_range as 0-65535 in ACL_RULE" + }, "ACL_RULE_WRONG_L4_SRC_PORT_RANGE": { "desc": "Configure l4_src_port_range as 99999-99999 in ACL_RULE", "eStrKey" : "Pattern" 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 6f39ab6e41cb..c50fd8c71a6a 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 @@ -106,6 +106,114 @@ } } }, + "ACL_RULE_IP_TYPE_SRC_IPV6ANY": { + "sonic-acl:sonic-acl": { + "sonic-acl:ACL_RULE": { + "ACL_RULE_LIST": [ + { + "ACL_TABLE_NAME": "NO-NSW-PACL-V6", + "IP_TYPE": "IPV6ANY", + "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-V6", + "policy_desc": "Filter IPv6", + "ports": [ + "Ethernet0", + "Ethernet1" + ], + "stage": "EGRESS", + "type": "L3V6" + } + ] + } + }, + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "admin_status": "up", + "alias": "eth0", + "lanes": "0,1,2,3", + "description": "Ethernet0", + "mtu": 9000, + "name": "Ethernet0", + "speed": 25000 + }, + { + "admin_status": "up", + "alias": "eth1", + "lanes": "0,1,2,3", + "description": "Ethernet1", + "mtu": 9000, + "name": "Ethernet1", + "speed": 25000 + } + ] + } + } + }, + "ACL_RULE_IP_TYPE_DST_IPV4ANY": { + "sonic-acl:sonic-acl": { + "sonic-acl:ACL_RULE": { + "ACL_RULE_LIST": [ + { + "ACL_TABLE_NAME": "NO-NSW-PACL-V4", + "IP_TYPE": "IPV4ANY", + "PACKET_ACTION": "FORWARD", + "PRIORITY": 999980, + "RULE_NAME": "Rule_20", + "DST_IP": "192.168.0.1/21" + } + ] + }, + "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", + "lanes": "0,1,2,3", + "description": "Ethernet0", + "mtu": 9000, + "name": "Ethernet0", + "speed": 25000 + }, + { + "admin_status": "up", + "alias": "eth1", + "lanes": "0,1,2,3", + "description": "Ethernet1", + "mtu": 9000, + "name": "Ethernet1", + "speed": 25000 + } + ] + } + } + }, "ACL_RULE_IP_TYPE_SRC_IPV6_MISMATCH": { "sonic-acl:sonic-acl": { "sonic-acl:ACL_RULE": { @@ -428,6 +536,118 @@ } } }, + "ACL_RULE_VALID_L4_SRC_PORT_RANGE": { + "sonic-acl:sonic-acl": { + "sonic-acl:ACL_RULE": { + "ACL_RULE_LIST": [ + { + "ACL_TABLE_NAME": "NO-NSW-PACL-V6", + "DST_IPV6": "2a04:f547:43:320::/64", + "IP_TYPE": "IP", + "L4_SRC_PORT_RANGE": "1024-65535", + "PACKET_ACTION": "FORWARD", + "PRIORITY": 999980, + "RULE_NAME": "Rule_20", + "SRC_IPV6": "2a04:f547:41::/48" + } + ] + }, + "sonic-acl:ACL_TABLE": { + "ACL_TABLE_LIST": [ + { + "ACL_TABLE_NAME": "NO-NSW-PACL-V6", + "policy_desc": "Filter IPv6", + "ports": [ + "Ethernet0", + "Ethernet1" + ], + "stage": "EGRESS", + "type": "L3V6" + } + ] + } + }, + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "admin_status": "up", + "alias": "eth0", + "lanes": "0,1,2,3", + "description": "Ethernet0", + "mtu": 9000, + "name": "Ethernet0", + "speed": 25000 + }, + { + "admin_status": "up", + "alias": "eth1", + "lanes": "0,1,2,3", + "description": "Ethernet1", + "mtu": 9000, + "name": "Ethernet1", + "speed": 25000 + } + ] + } + } + }, + "ACL_RULE_VALID_L4_DST_PORT_RANGE": { + "sonic-acl:sonic-acl": { + "sonic-acl:ACL_RULE": { + "ACL_RULE_LIST": [ + { + "ACL_TABLE_NAME": "NO-NSW-PACL-V6", + "DST_IPV6": "2a04:f547:43:320::/64", + "IP_TYPE": "IP", + "L4_DST_PORT_RANGE": "1024-65535", + "PACKET_ACTION": "FORWARD", + "PRIORITY": 999980, + "RULE_NAME": "Rule_20", + "SRC_IPV6": "2a04:f547:41::/48" + } + ] + }, + "sonic-acl:ACL_TABLE": { + "ACL_TABLE_LIST": [ + { + "ACL_TABLE_NAME": "NO-NSW-PACL-V6", + "policy_desc": "Filter IPv6", + "ports": [ + "Ethernet0", + "Ethernet1" + ], + "stage": "EGRESS", + "type": "L3V6" + } + ] + } + }, + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "admin_status": "up", + "alias": "eth0", + "lanes": "0,1,2,3", + "description": "Ethernet0", + "mtu": 9000, + "name": "Ethernet0", + "speed": 25000 + }, + { + "admin_status": "up", + "alias": "eth1", + "lanes": "0,1,2,3", + "description": "Ethernet1", + "mtu": 9000, + "name": "Ethernet1", + "speed": 25000 + } + ] + } + } + }, "ACL_RULE_WRONG_L4_SRC_PORT_RANGE": { "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 882dbf8ef9c3..ebaffe96e8d9 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 "not(IP_TYPE) or 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 .='IPV4ANY' or .='ARP'])"; leaf SRC_IP { type inet:ipv4-prefix; } @@ -117,7 +117,7 @@ module sonic-acl { } case ip6_prefix { - when "not(IP_TYPE) or 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' or .='IPV6ANY'])"; leaf SRC_IPV6 { type inet:ipv6-prefix; } @@ -148,7 +148,7 @@ module sonic-acl { case l4_src_port_range { leaf L4_SRC_PORT_RANGE { type string { - pattern '([0-9]{1,4}|[0-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-2][0-9]{2}|[6][5][3][0-5]{2}|[6][5][3][6][0-5])-([0-9]{1,4}|[0-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-2][0-9]{2}|[6][5][3][0-5]{2}|[6][5][3][6][0-5])'; + pattern '([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])-([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])'; } } } @@ -164,7 +164,7 @@ module sonic-acl { case l4_dst_port_range { leaf L4_DST_PORT_RANGE { type string { - pattern '([0-9]{1,4}|[0-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-2][0-9]{2}|[6][5][3][0-5]{2}|[6][5][3][6][0-5])-([0-9]{1,4}|[0-5][0-9]{4}|[6][0-4][0-9]{3}|[6][5][0-2][0-9]{2}|[6][5][3][0-5]{2}|[6][5][3][6][0-5])'; + pattern '([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])-([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])'; } } } @@ -172,7 +172,7 @@ module sonic-acl { leaf ETHER_TYPE { type string { - pattern "0x0[6-9a-fA-F][0-9a-fA-F]{2}|0x[1-9a-fA-F][0-9a-fA-F]{3}|153[6-9]|15[4-9][0-9]|1[6-9][0-9][0-9]|[2-9][0-9]{3}|[1-5][0-9]{4}|6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}"; + pattern "0x0[6-9a-fA-F][0-9a-fA-F]{2}|0x[1-9a-fA-F][0-9a-fA-F]{3}|153[6-9]|15[4-9][0-9]|1[6-9][0-9][0-9]|[2-9][0-9]{3}|[1-5][0-9]{4}|6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}"; } } @@ -199,7 +199,7 @@ module sonic-acl { choice icmp { case icmp4 { - when "not(IP_TYPE) or 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 .='IPV4ANY' or .='ARP'])"; leaf ICMP_TYPE { type uint8 { range 0..255; @@ -214,7 +214,7 @@ module sonic-acl { } case icmp6 { - when "not(IP_TYPE) or 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' or .='IPV6ANY'])"; leaf ICMPV6_TYPE { type uint8 { range 0..255; diff --git a/src/sonic-yang-models/yang-templates/sonic-types.yang.j2 b/src/sonic-yang-models/yang-templates/sonic-types.yang.j2 index 909a883a0e1c..56b4cf903aef 100644 --- a/src/sonic-yang-models/yang-templates/sonic-types.yang.j2 +++ b/src/sonic-yang-models/yang-templates/sonic-types.yang.j2 @@ -76,8 +76,10 @@ module sonic-types { enum IPV4; enum IPV6; enum IPv4ANY; + enum IPV4ANY; enum NON_IP4; enum IPv6ANY; + enum IPV6ANY; enum NON_IPv6; enum ARP; } From 49eee0651868f29e8b14fe9863cb74100c0ab565 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 26 Apr 2024 16:01:34 +0800 Subject: [PATCH 262/419] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#18777) #### Why I did it src/sonic-swss ``` * a821af04 - (HEAD -> 202311, origin/202311) [ACL] Remove flex counter when updating ACL rule (#3118) (3 days ago) [bingwang-ms] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 5eadb794ad96..a821af0421de 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 5eadb794ad963c71947ec5c51ca020e9b2b6a880 +Subproject commit a821af0421de316555146615cffd4108ec566e20 From d1bd2d2ada9a802cc7a9ac029fd3e1ca3b29cf23 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 26 Apr 2024 16:01:45 +0800 Subject: [PATCH 263/419] [submodule] Update submodule sonic-host-services to the latest HEAD automatically (#18775) #### Why I did it src/sonic-host-services ``` * a711aec - (HEAD -> 202311, origin/202311) [caclmgrd]Fix bfd and vxlan acl rules programming in acl table update scenario (#114) (2 days ago) [Sudharsan Dhamal Gopalarathnam] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-host-services | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-host-services b/src/sonic-host-services index 054aa7a27588..a711aecad055 160000 --- a/src/sonic-host-services +++ b/src/sonic-host-services @@ -1 +1 @@ -Subproject commit 054aa7a27588043fce1d1e60a0bc35990e950eb6 +Subproject commit a711aecad05536a096dfd5ae1798d361d520f961 From 77c856a4024cf4a7960fa7ad372ae4854fb689fe Mon Sep 17 00:00:00 2001 From: Yaqiang Zhu Date: Sat, 27 Apr 2024 06:44:28 +0800 Subject: [PATCH 264/419] [202311][dhcp_server] Add support for customize string option include comma (#18811) * [dhcp_server] Add support for customize comma-sperated string option --- .../dhcp_utilities/dhcpservd/dhcp_cfggen.py | 2 +- .../tests/test_data/test_kea_config.conf | 3 + .../tests/test_dhcp_cfggen.py | 110 ++++++++---------- .../tests/test_dhcpservd.py | 15 ++- 4 files changed, 68 insertions(+), 62 deletions(-) create mode 100644 src/sonic-dhcp-utilities/tests/test_data/test_kea_config.conf diff --git a/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py index efe7440d991a..0b862627fcbd 100755 --- a/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py +++ b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py @@ -94,7 +94,7 @@ def _parse_customized_options(self, customized_options_ipv4): always_send = config["always_send"] if "always_send" in config else "true" customized_options[option_name] = { "id": config["id"], - "value": config["value"], + "value": config["value"].replace(",", "\\\\,") if option_type == "string" else config["value"], "type": option_type, "always_send": always_send } diff --git a/src/sonic-dhcp-utilities/tests/test_data/test_kea_config.conf b/src/sonic-dhcp-utilities/tests/test_data/test_kea_config.conf new file mode 100644 index 000000000000..adacd460290d --- /dev/null +++ b/src/sonic-dhcp-utilities/tests/test_data/test_kea_config.conf @@ -0,0 +1,3 @@ +{ + "key": "dummy_value\\,dummy_value" +} diff --git a/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py b/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py index 172f6c2f3bfd..c59db3af6c1b 100644 --- a/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py +++ b/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py @@ -209,61 +209,53 @@ } } } -tested_options_data = [ - { - "data": { - "option223": { - "id": "223", - "type": "string", - "value": "dummy_value" - } +tested_options_data = { + "data": { + "option223": { + "id": "223", + "type": "string", + "value": "dummy_value" }, - "res": True - }, - { - "data": { - "option60": { - "id": "60", - "type": "string", - "value": "dummy_value" - } + "option60": { + "id": "60", + "type": "string", + "value": "dummy_value" }, - "res": False - }, - { - "data": { - "option222": { - "id": "222", - "type": "text", - "value": "dummy_value" - } + "option222": { + "id": "222", + "type": "text", + "value": "dummy_value" }, - "res": False - }, - { - "data": { - "option219": { - "id": "219", - "type": "uint8", - "value": "259" - } + "option219": { + "id": "219", + "type": "uint8", + "value": "259" }, - "res": False - }, - { - "data": { - "option223": { - "id": "223", - "type": "string", - "value": "long_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_value" + - "long_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_value" + - "long_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_value" + - "long_valuelong_valuelong_valuelong_valuelong_value" - } + "option218": { + "id": "218", + "type": "string", + "value": "long_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_value" + + "long_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_value" + + "long_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_value" + + "long_valuelong_valuelong_valuelong_valuelong_value" + }, + "option217": { + "id": "217", + "type": "string", + "value": "dummy_value,dummy_value" }, - "res": False + "option216": { + "id": "216", + "type": "uint8", + "value": "8" + } + }, + "res": { + "option223": "dummy_value", + "option217": "dummy_value\\\\,dummy_value", + "option216": "8" } -] +} def test_parse_port_alias(mock_swsscommon_dbconnector_init, mock_get_render_template): @@ -397,21 +389,19 @@ def test_render_config(mock_swsscommon_dbconnector_init, mock_parse_port_map_ali assert json.loads(config) == expected_config if with_port_config else expected_config -@pytest.mark.parametrize("tested_options_data", tested_options_data) def test_parse_customized_options(mock_swsscommon_dbconnector_init, mock_get_render_template, - mock_parse_port_map_alias, tested_options_data): + mock_parse_port_map_alias): dhcp_db_connector = DhcpDbConnector() dhcp_cfg_generator = DhcpServCfgGenerator(dhcp_db_connector) customized_options_ipv4 = tested_options_data["data"] customized_options = dhcp_cfg_generator._parse_customized_options(customized_options_ipv4) - if tested_options_data["res"]: - assert customized_options == { - "option223": { - "id": "223", - "value": "dummy_value", - "type": "string", - "always_send": "true" - } + expected_res = {} + for key, value in tested_options_data["res"].items(): + expected_res[key] = { + "id": customized_options_ipv4[key]["id"], + "value": value, + "type": customized_options_ipv4[key]["type"], + "always_send": "true" } else: - assert customized_options == {} + assert customized_options == expected_res diff --git a/src/sonic-dhcp-utilities/tests/test_dhcpservd.py b/src/sonic-dhcp-utilities/tests/test_dhcpservd.py index dd3d09a63831..0828ea0b02df 100644 --- a/src/sonic-dhcp-utilities/tests/test_dhcpservd.py +++ b/src/sonic-dhcp-utilities/tests/test_dhcpservd.py @@ -1,4 +1,5 @@ import pytest +import json import psutil import signal import sys @@ -18,11 +19,18 @@ "VlanMemberTableEventChecker"] +tested_config = """ +{ + "key": "dummy_value\\\\,dummy_value" +} +""" + + @pytest.mark.parametrize("enabled_checker", [None, set(PORT_MODE_CHECKER)]) def test_dump_dhcp4_config(mock_swsscommon_dbconnector_init, enabled_checker): new_enabled_checker = set(["VlanTableEventChecker"]) with patch("dhcp_utilities.dhcpservd.dhcp_cfggen.DhcpServCfgGenerator.generate", - return_value=("dummy_config", set(), set(), set(), new_enabled_checker)) as mock_generate, \ + return_value=(tested_config, set(), set(), set(), new_enabled_checker)) as mock_generate, \ patch("dhcp_utilities.dhcpservd.dhcpservd.DhcpServd._notify_kea_dhcp4_proc", MagicMock()) as mock_notify_kea_dhcp4_proc, \ patch.object(DhcpServd, "dhcp_servd_monitor", return_value=DhcpServdDbMonitor, @@ -39,6 +47,11 @@ def test_dump_dhcp4_config(mock_swsscommon_dbconnector_init, enabled_checker): dhcpservd.dump_dhcp4_config() # Verfiy whether generate() func of dhcp_cfggen is called mock_generate.assert_called_once_with() + with open("tests/test_data/test_kea_config.conf", "r") as file, \ + open("/tmp/kea-dhcp4.conf", "r") as output: + expected_content = file.read() + actual_content = output.read() + assert json.loads(expected_content) == json.loads(actual_content) # Verify whether notify func of dhcpservd is called, which is expected to call after new config generated mock_notify_kea_dhcp4_proc.assert_called_once_with() if enabled_checker is None: From 2472123c6587ac26880d50411669e1bbfe89ea34 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 27 Apr 2024 16:00:53 +0800 Subject: [PATCH 265/419] [submodule] Update submodule sonic-platform-common to the latest HEAD automatically (#18816) #### Why I did it src/sonic-platform-common ``` * 11a3f7d - (HEAD -> 202311, origin/202311) Fetch firmware versions for Cmis Target FW upgrade supported cables (#455) (7 hours ago) [mihirpat1] ``` #### How I did it #### How to verify it #### Description for the changelog --- 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 401e702df732..11a3f7daf41e 160000 --- a/src/sonic-platform-common +++ b/src/sonic-platform-common @@ -1 +1 @@ -Subproject commit 401e702df732f3bc2cabb7a7288bdbae41f00325 +Subproject commit 11a3f7daf41e69157bcf1086a3af465c6f2d5c34 From ce84167fcd120aa9d427e82a423c83b75b67e1c6 Mon Sep 17 00:00:00 2001 From: James An <94036556+jamesan47@users.noreply.github.com> Date: Mon, 29 Apr 2024 13:07:56 -0700 Subject: [PATCH 266/419] Update cisco-8000.ini (#18768) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Release notes for Cisco 8111-32EH-O, 8102-64H-O and 8101-32FH • Enable Cisco Debug Shell by default • Support for Single CLI to display all captured dropped packets • Fix for [8111] MAC learning issue • Fix for tx_drop counter increasing while the port is oper down • Addressed the following test case failures: ERR pmon#sensord: Error getting sensor data: ltc2 [8102] syncd: SAI_LOG|SAI_API_SWITCH: Unrecognized la_event LA_EVENT_ETHERNET_PTP_OVER_ETH test_watchdog_reboot: AssertionError DualTor: qos/test_tunnel_qos_remap platform_tests.api.test_fan_drawer_fans.TestFanDrawerFans --- platform/checkout/cisco-8000.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/checkout/cisco-8000.ini b/platform/checkout/cisco-8000.ini index c3883beb43e1..1f5b7bed02f7 100644 --- a/platform/checkout/cisco-8000.ini +++ b/platform/checkout/cisco-8000.ini @@ -1,3 +1,3 @@ [module] repo=git@github.com:Cisco-8000-sonic/platform-cisco-8000.git -ref=202311.main.0.2 +ref=202311.main.0.3 From a22eb82dc67547e5b65a03470f493d4b86ef6019 Mon Sep 17 00:00:00 2001 From: Stephen Sun <5379172+stephenxs@users.noreply.github.com> Date: Sun, 14 Apr 2024 21:39:31 +0800 Subject: [PATCH 267/419] [Mellanox] Support SKU Mellanox-SN5600-O128 (#18440) - Why I did it Align ACS-SN5600 buffer templates to reduce redundant code Support Mellanox-SN5600-O128 - How I did it Add relevant files to support the new SKU Update the SN5600 device files to align with the buffer configuration required. - How to verify it Regression test Signed-off-by: Stephen Sun --- .../ACS-SN5600/buffers_defaults_t0.j2 | 111 +--- .../ACS-SN5600/buffers_defaults_t1.j2 | 111 +--- .../Mellanox-SN5600-O128/buffers.json.j2 | 1 + .../buffers_defaults_objects.j2 | 1 + .../buffers_defaults_t0.j2 | 1 + .../buffers_defaults_t1.j2 | 1 + .../buffers_dynamic.json.j2 | 16 + .../create_only_config_db_buffers.json | 7 + .../Mellanox-SN5600-O128/hwsku.json | 391 ++++++++++++++ .../pg_profile_lookup.ini | 1 + .../Mellanox-SN5600-O128/port_config.ini | 147 ++++++ .../Mellanox-SN5600-O128/qos.json.j2 | 1 + .../Mellanox-SN5600-O128/sai.profile | 1 + .../sai_sn5600_128x400g_1x25g.xml | 495 ++++++++++++++++++ 14 files changed, 1085 insertions(+), 200 deletions(-) create mode 120000 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/buffers.json.j2 create mode 120000 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/buffers_defaults_objects.j2 create mode 120000 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/buffers_defaults_t0.j2 create mode 120000 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/buffers_defaults_t1.j2 create mode 100644 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/buffers_dynamic.json.j2 create mode 100644 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/create_only_config_db_buffers.json create mode 100644 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/hwsku.json create mode 120000 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/pg_profile_lookup.ini create mode 100644 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/port_config.ini create mode 120000 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/qos.json.j2 create mode 100644 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/sai.profile create mode 100644 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/sai_sn5600_128x400g_1x25g.xml diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/buffers_defaults_t0.j2 b/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/buffers_defaults_t0.j2 index b03bcf004505..0b414500d79b 100644 --- a/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/buffers_defaults_t0.j2 +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/buffers_defaults_t0.j2 @@ -1,5 +1,5 @@ {# - Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. + Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. Apache-2.0 Licensed under the Apache License, Version 2.0 (the "License"); @@ -20,109 +20,20 @@ {% set egress_lossless_pool_size = '158229504' %} {% set egress_lossy_pool_size = '67737959' %} -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0, 32) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} +{% import 'buffers_defaults_objects.j2' as defs with context %} -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ ingress_lossless_pool_size }}", - {%- endif %} - "type": "ingress", - "mode": "dynamic" - }, - "ingress_lossy_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ ingress_lossy_pool_size }}", - {%- endif %} - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "{{ egress_lossless_pool_size }}", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossy_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ egress_lossy_pool_size }}", - {%- endif %} - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossless_profile": { - "pool":"ingress_lossless_pool", - "size":"0", - "dynamic_th":"7" - }, - "ingress_lossy_profile": { - "pool":"ingress_lossy_pool", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"egress_lossless_pool", - "size":"0", - "dynamic_th":"7" - }, - "egress_lossy_profile": { - "pool":"egress_lossy_pool", - "size":"9216", - "dynamic_th":"7" - }, - "q_lossy_profile": { - "pool":"egress_lossy_pool", - "size":"0", - "dynamic_th":"3" - } - }, +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} {%- endmacro %} -{%- macro generate_profile_lists(port_names) %} - "BUFFER_PORT_INGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "ingress_lossless_profile,ingress_lossy_profile" - }{% if not loop.last %},{% endif %} - -{% endfor %} - }, - "BUFFER_PORT_EGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "egress_lossless_profile,egress_lossy_profile" - }{% if not loop.last %},{% endif %} - -{% endfor %} - } +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} {%- endmacro %} -{%- macro generate_queue_buffers(port_names) %} - "BUFFER_QUEUE": { -{% for port in port_names.split(',') %} - "{{ port }}|3-4": { - "profile" : "egress_lossless_profile" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|0-2": { - "profile" : "q_lossy_profile" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|5-6": { - "profile" : "q_lossy_profile" - }{% if not loop.last %},{% endif %} - -{% endfor %} - } +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} {%- endmacro %} - +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} +{%- endmacro %} diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/buffers_defaults_t1.j2 b/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/buffers_defaults_t1.j2 index 374c23fd8ddc..16214dab4f4d 100644 --- a/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/buffers_defaults_t1.j2 +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/buffers_defaults_t1.j2 @@ -1,5 +1,5 @@ {# - Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. + Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. Apache-2.0 Licensed under the Apache License, Version 2.0 (the "License"); @@ -20,109 +20,20 @@ {% set egress_lossless_pool_size = '158229504' %} {% set egress_lossy_pool_size = '52161690' %} -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0, 32) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} +{% import 'buffers_defaults_objects.j2' as defs with context %} -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ ingress_lossless_pool_size }}", - {%- endif %} - "type": "ingress", - "mode": "dynamic" - }, - "ingress_lossy_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ ingress_lossy_pool_size }}", - {%- endif %} - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "{{ egress_lossless_pool_size }}", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossy_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ egress_lossy_pool_size }}", - {%- endif %} - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossless_profile": { - "pool":"ingress_lossless_pool", - "size":"0", - "dynamic_th":"7" - }, - "ingress_lossy_profile": { - "pool":"ingress_lossy_pool", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"egress_lossless_pool", - "size":"0", - "dynamic_th":"7" - }, - "egress_lossy_profile": { - "pool":"egress_lossy_pool", - "size":"9216", - "dynamic_th":"7" - }, - "q_lossy_profile": { - "pool":"egress_lossy_pool", - "size":"0", - "dynamic_th":"3" - } - }, +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} {%- endmacro %} -{%- macro generate_profile_lists(port_names) %} - "BUFFER_PORT_INGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "ingress_lossless_profile,ingress_lossy_profile" - }{% if not loop.last %},{% endif %} - -{% endfor %} - }, - "BUFFER_PORT_EGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "egress_lossless_profile,egress_lossy_profile" - }{% if not loop.last %},{% endif %} - -{% endfor %} - } +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} {%- endmacro %} -{%- macro generate_queue_buffers(port_names) %} - "BUFFER_QUEUE": { -{% for port in port_names.split(',') %} - "{{ port }}|3-4": { - "profile" : "egress_lossless_profile" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|0-2": { - "profile" : "q_lossy_profile" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|5-6": { - "profile" : "q_lossy_profile" - }{% if not loop.last %},{% endif %} - -{% endfor %} - } +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} {%- endmacro %} - +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} +{%- endmacro %} diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/buffers.json.j2 b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/buffers.json.j2 new file mode 120000 index 000000000000..add8bf8bb7c2 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/buffers.json.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/buffers_defaults_objects.j2 b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/buffers_defaults_objects.j2 new file mode 120000 index 000000000000..33b6704f9902 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/buffers_defaults_objects.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_defaults_objects.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/buffers_defaults_t0.j2 b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..6e43fd4f6622 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +../ACS-SN5600/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/buffers_defaults_t1.j2 b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/buffers_defaults_t1.j2 new file mode 120000 index 000000000000..601a262149d4 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/buffers_defaults_t1.j2 @@ -0,0 +1 @@ +../ACS-SN5600/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/buffers_dynamic.json.j2 b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/buffers_dynamic.json.j2 new file mode 100644 index 000000000000..b2cc958b7c45 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/buffers_dynamic.json.j2 @@ -0,0 +1,16 @@ +{# + Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. + Apache-2.0 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +#} +{%- set default_topo = 't0' %} +{%- set dynamic_mode = 'true' %} +{%- include 'buffers_config.j2' %} diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/create_only_config_db_buffers.json b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/create_only_config_db_buffers.json new file mode 100644 index 000000000000..6feb156714fe --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/create_only_config_db_buffers.json @@ -0,0 +1,7 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "create_only_config_db_buffers": "true" + } + } +} diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/hwsku.json b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/hwsku.json new file mode 100644 index 000000000000..52088a40302f --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/hwsku.json @@ -0,0 +1,391 @@ +{ + "interfaces": { + "Ethernet0": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet4": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet8": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet12": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet16": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet20": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet24": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet28": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet32": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet36": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet40": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet44": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet48": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet52": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet56": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet60": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet64": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet68": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet72": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet76": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet80": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet84": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet88": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet92": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet96": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet100": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet104": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet108": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet112": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet116": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet120": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet124": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet128": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet132": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet136": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet140": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet144": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet148": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet152": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet156": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet160": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet164": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet168": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet172": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet176": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet180": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet184": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet188": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet192": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet196": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet200": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet204": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet208": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet212": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet216": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet220": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet224": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet228": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet232": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet236": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet240": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet244": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet248": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet252": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet256": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet260": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet264": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet268": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet272": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet276": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet280": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet284": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet288": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet292": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet296": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet300": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet304": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet308": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet312": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet316": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet320": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet324": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet328": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet332": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet336": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet340": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet344": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet348": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet352": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet356": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet360": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet364": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet368": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet372": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet376": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet380": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet384": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet388": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet392": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet396": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet400": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet404": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet408": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet412": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet416": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet420": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet424": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet428": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet432": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet436": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet440": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet444": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet448": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet452": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet456": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet460": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet464": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet468": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet472": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet476": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet480": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet484": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet488": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet492": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet496": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet500": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet504": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet508": { + "default_brkout_mode": "2x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet512": { + "default_brkout_mode": "1x25G(1)[10G]" + } + } +} diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/pg_profile_lookup.ini b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/pg_profile_lookup.ini new file mode 120000 index 000000000000..36462db80105 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/pg_profile_lookup.ini @@ -0,0 +1 @@ +../ACS-SN5600/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/port_config.ini b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/port_config.ini new file mode 100644 index 000000000000..bf437af13a6d --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/port_config.ini @@ -0,0 +1,147 @@ +## +## Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. +## Apache-2.0 +## +## Licensed under the Apache License, Version 2.0 (the "License"); +## you may not use this file except in compliance with the License. +## You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## + +# name lanes alias index speed fec +Ethernet0 0,1,2,3 etp1a 1 400000 rs +Ethernet4 4,5,6,7 etp1b 1 400000 rs +Ethernet8 8,9,10,11 etp2a 2 400000 rs +Ethernet12 12,13,14,15 etp2b 2 400000 rs +Ethernet16 16,17,18,19 etp3a 3 400000 rs +Ethernet20 20,21,22,23 etp3b 3 400000 rs +Ethernet24 24,25,26,27 etp4a 4 400000 rs +Ethernet28 28,29,30,31 etp4b 4 400000 rs +Ethernet32 32,33,34,35 etp5a 5 400000 rs +Ethernet36 36,37,38,39 etp5b 5 400000 rs +Ethernet40 40,41,42,43 etp6a 6 400000 rs +Ethernet44 44,45,46,47 etp6b 6 400000 rs +Ethernet48 48,49,50,51 etp7a 7 400000 rs +Ethernet52 52,53,54,55 etp7b 7 400000 rs +Ethernet56 56,57,58,59 etp8a 8 400000 rs +Ethernet60 60,61,62,63 etp8b 8 400000 rs +Ethernet64 64,65,66,67 etp9a 9 400000 rs +Ethernet68 68,69,70,71 etp9b 9 400000 rs +Ethernet72 72,73,74,75 etp10a 10 400000 rs +Ethernet76 76,77,78,79 etp10b 10 400000 rs +Ethernet80 80,81,82,83 etp11a 11 400000 rs +Ethernet84 84,85,86,87 etp11b 11 400000 rs +Ethernet88 88,89,90,91 etp12a 12 400000 rs +Ethernet92 92,93,94,95 etp12b 12 400000 rs +Ethernet96 96,97,98,99 etp13a 13 400000 rs +Ethernet100 100,101,102,103 etp13b 13 400000 rs +Ethernet104 104,105,106,107 etp14a 14 400000 rs +Ethernet108 108,109,110,111 etp14b 14 400000 rs +Ethernet112 112,113,114,115 etp15a 15 400000 rs +Ethernet116 116,117,118,119 etp15b 15 400000 rs +Ethernet120 120,121,122,123 etp16a 16 400000 rs +Ethernet124 124,125,126,127 etp16b 16 400000 rs +Ethernet128 128,129,130,131 etp17a 17 400000 rs +Ethernet132 132,133,134,135 etp17b 17 400000 rs +Ethernet136 136,137,138,139 etp18a 18 400000 rs +Ethernet140 140,141,142,143 etp18b 18 400000 rs +Ethernet144 144,145,146,147 etp19a 19 400000 rs +Ethernet148 148,149,150,151 etp19b 19 400000 rs +Ethernet152 152,153,154,155 etp20a 20 400000 rs +Ethernet156 156,157,158,159 etp20b 20 400000 rs +Ethernet160 160,161,162,163 etp21a 21 400000 rs +Ethernet164 164,165,166,167 etp21b 21 400000 rs +Ethernet168 168,169,170,171 etp22a 22 400000 rs +Ethernet172 172,173,174,175 etp22b 22 400000 rs +Ethernet176 176,177,178,179 etp23a 23 400000 rs +Ethernet180 180,181,182,183 etp23b 23 400000 rs +Ethernet184 184,185,186,187 etp24a 24 400000 rs +Ethernet188 188,189,190,191 etp24b 24 400000 rs +Ethernet192 192,193,194,195 etp25a 25 400000 rs +Ethernet196 196,197,198,199 etp25b 25 400000 rs +Ethernet200 200,201,202,203 etp26a 26 400000 rs +Ethernet204 204,205,206,207 etp26b 26 400000 rs +Ethernet208 208,209,210,211 etp27a 27 400000 rs +Ethernet212 212,213,214,215 etp27b 27 400000 rs +Ethernet216 216,217,218,219 etp28a 28 400000 rs +Ethernet220 220,221,222,223 etp28b 28 400000 rs +Ethernet224 224,225,226,227 etp29a 29 400000 rs +Ethernet228 228,229,230,231 etp29b 29 400000 rs +Ethernet232 232,233,234,235 etp30a 30 400000 rs +Ethernet236 236,237,238,239 etp30b 30 400000 rs +Ethernet240 240,241,242,243 etp31a 31 400000 rs +Ethernet244 244,245,246,247 etp31b 31 400000 rs +Ethernet248 248,249,250,251 etp32a 32 400000 rs +Ethernet252 252,253,254,255 etp32b 32 400000 rs +Ethernet256 256,257,258,259 etp33a 33 400000 rs +Ethernet260 260,261,262,263 etp33b 33 400000 rs +Ethernet264 264,265,266,267 etp34a 34 400000 rs +Ethernet268 268,269,270,271 etp34b 34 400000 rs +Ethernet272 272,273,274,275 etp35a 35 400000 rs +Ethernet276 276,277,278,279 etp35b 35 400000 rs +Ethernet280 280,281,282,283 etp36a 36 400000 rs +Ethernet284 284,285,286,287 etp36b 36 400000 rs +Ethernet288 288,289,290,291 etp37a 37 400000 rs +Ethernet292 292,293,294,295 etp37b 37 400000 rs +Ethernet296 296,297,298,299 etp38a 38 400000 rs +Ethernet300 300,301,302,303 etp38b 38 400000 rs +Ethernet304 304,305,306,307 etp39a 39 400000 rs +Ethernet308 308,309,310,311 etp39b 39 400000 rs +Ethernet312 312,313,314,315 etp40a 40 400000 rs +Ethernet316 316,317,318,319 etp40b 40 400000 rs +Ethernet320 320,321,322,323 etp41a 41 400000 rs +Ethernet324 324,325,326,327 etp41b 41 400000 rs +Ethernet328 328,329,330,331 etp42a 42 400000 rs +Ethernet332 332,333,334,335 etp42b 42 400000 rs +Ethernet336 336,337,338,339 etp43a 43 400000 rs +Ethernet340 340,341,342,343 etp43b 43 400000 rs +Ethernet344 344,345,346,347 etp44a 44 400000 rs +Ethernet348 348,349,350,351 etp44b 44 400000 rs +Ethernet352 352,353,354,355 etp45a 45 400000 rs +Ethernet356 356,357,358,359 etp45b 45 400000 rs +Ethernet360 360,361,362,363 etp46a 46 400000 rs +Ethernet364 364,365,366,367 etp46b 46 400000 rs +Ethernet368 368,369,370,371 etp47a 47 400000 rs +Ethernet372 372,373,374,375 etp47b 47 400000 rs +Ethernet376 376,377,378,379 etp48a 48 400000 rs +Ethernet380 380,381,382,383 etp48b 48 400000 rs +Ethernet384 384,385,386,387 etp49a 49 400000 rs +Ethernet388 388,389,390,391 etp49b 49 400000 rs +Ethernet392 392,393,394,395 etp50a 50 400000 rs +Ethernet396 396,397,398,399 etp50b 50 400000 rs +Ethernet400 400,401,402,403 etp51a 51 400000 rs +Ethernet404 404,405,406,407 etp51b 51 400000 rs +Ethernet408 408,409,410,411 etp52a 52 400000 rs +Ethernet412 412,413,414,415 etp52b 52 400000 rs +Ethernet416 416,417,418,419 etp53a 53 400000 rs +Ethernet420 420,421,422,423 etp53b 53 400000 rs +Ethernet424 424,425,426,427 etp54a 54 400000 rs +Ethernet428 428,429,430,431 etp54b 54 400000 rs +Ethernet432 432,433,434,435 etp55a 55 400000 rs +Ethernet436 436,437,438,439 etp55b 55 400000 rs +Ethernet440 440,441,442,443 etp56a 56 400000 rs +Ethernet444 444,445,446,447 etp56b 56 400000 rs +Ethernet448 448,449,450,451 etp57a 57 400000 rs +Ethernet452 452,453,454,455 etp57b 57 400000 rs +Ethernet456 456,457,458,459 etp58a 58 400000 rs +Ethernet460 460,461,462,463 etp58b 58 400000 rs +Ethernet464 464,465,466,467 etp59a 59 400000 rs +Ethernet468 468,469,470,471 etp59b 59 400000 rs +Ethernet472 472,473,474,475 etp60a 60 400000 rs +Ethernet476 476,477,478,479 etp60b 60 400000 rs +Ethernet480 480,481,482,483 etp61a 61 400000 rs +Ethernet484 484,485,486,487 etp61b 61 400000 rs +Ethernet488 488,489,490,491 etp62a 62 400000 rs +Ethernet492 492,493,494,495 etp62b 62 400000 rs +Ethernet496 496,497,498,499 etp63a 63 400000 rs +Ethernet500 500,501,502,503 etp63b 63 400000 rs +Ethernet504 504,505,506,507 etp64a 64 400000 rs +Ethernet508 508,509,510,511 etp64b 64 400000 rs +Ethernet512 512 etp65 65 25000 diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/qos.json.j2 b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/qos.json.j2 new file mode 120000 index 000000000000..eccf286dc879 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/qos.json.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/qos.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/sai.profile b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/sai.profile new file mode 100644 index 000000000000..a362513c8dd5 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/sai.profile @@ -0,0 +1 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_sn5600_128x400g_1x25g.xml diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/sai_sn5600_128x400g_1x25g.xml b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/sai_sn5600_128x400g_1x25g.xml new file mode 100644 index 000000000000..97656c1d5100 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/sai_sn5600_128x400g_1x25g.xml @@ -0,0 +1,495 @@ + + + + + + 00:02:03:04:05:00 + + + 1 + + + 65 + + + 1 + + + + + 1 + 8 + 34 + + + 1 + + + 32768 + 2 + + 5 + 8 + 35 + 1 + 32768 + 2 + + 9 + 8 + 33 + 1 + 32768 + 2 + + 13 + 8 + 32 + 1 + 32768 + 2 + + 17 + 8 + 38 + 1 + 32768 + 2 + + 21 + 8 + 39 + 1 + 32768 + 2 + + 25 + 8 + 37 + 1 + 32768 + 2 + + 29 + 8 + 36 + 1 + 32768 + 2 + + 33 + 8 + 42 + 1 + 32768 + 2 + + 37 + 8 + 43 + 1 + 32768 + 2 + + 41 + 8 + 41 + 1 + 32768 + 2 + + 45 + 8 + 40 + 1 + 32768 + 2 + + 49 + 8 + 46 + 1 + 32768 + 2 + + 53 + 8 + 47 + 1 + 32768 + 2 + + 57 + 8 + 45 + 1 + 32768 + 2 + + 61 + 8 + 44 + 1 + 32768 + 2 + + 65 + 8 + 51 + 1 + 32768 + 2 + + 69 + 8 + 50 + 1 + 32768 + 2 + + 73 + 8 + 48 + 1 + 32768 + 2 + + 77 + 8 + 49 + 1 + 32768 + 2 + + 81 + 8 + 55 + 1 + 32768 + 2 + + 85 + 8 + 54 + 1 + 32768 + 2 + + 89 + 8 + 52 + 1 + 32768 + 2 + + 93 + 8 + 53 + 1 + 32768 + 2 + + 97 + 8 + 59 + 1 + 32768 + 2 + + 101 + 8 + 58 + 1 + 32768 + 2 + + 105 + 8 + 56 + 1 + 32768 + 2 + + 109 + 8 + 57 + 1 + 32768 + 2 + + 113 + 8 + 63 + 1 + 32768 + 2 + + 117 + 8 + 62 + 1 + 32768 + 2 + + 121 + 8 + 60 + 1 + 32768 + 2 + + 125 + 8 + 61 + 1 + 32768 + 2 + + 129 + 8 + 29 + 1 + 32768 + 2 + + 133 + 8 + 28 + 1 + 32768 + 2 + + 137 + 8 + 30 + 1 + 32768 + 2 + + 141 + 8 + 31 + 1 + 32768 + 2 + + 145 + 8 + 25 + 1 + 32768 + 2 + + 149 + 8 + 24 + 1 + 32768 + 2 + + 153 + 8 + 26 + 1 + 32768 + 2 + + 157 + 8 + 27 + 1 + 32768 + 2 + + 161 + 8 + 21 + 1 + 32768 + 2 + + 165 + 8 + 20 + 1 + 32768 + 2 + + 169 + 8 + 22 + 1 + 32768 + 2 + + 173 + 8 + 23 + 1 + 32768 + 2 + + 177 + 8 + 17 + 1 + 32768 + 2 + + 181 + 8 + 16 + 1 + 32768 + 2 + + 185 + 8 + 18 + 1 + 32768 + 2 + + 189 + 8 + 19 + 1 + 32768 + 2 + + 193 + 8 + 12 + 1 + 32768 + 2 + + 197 + 8 + 13 + 1 + 32768 + 2 + + 201 + 8 + 15 + 1 + 32768 + 2 + + 205 + 8 + 14 + 1 + 32768 + 2 + + 209 + 8 + 8 + 1 + 32768 + 2 + + 213 + 8 + 9 + 1 + 32768 + 2 + + 217 + 8 + 11 + 1 + 32768 + 2 + + 221 + 8 + 10 + 1 + 32768 + 2 + + 225 + 8 + 4 + 1 + 32768 + 2 + + 229 + 8 + 5 + 1 + 32768 + 2 + + 233 + 8 + 7 + 1 + 32768 + 2 + + 237 + 8 + 6 + 1 + 32768 + 2 + + 241 + 8 + 0 + 1 + 32768 + 2 + + 245 + 8 + 1 + 1 + 32768 + 2 + + 249 + 8 + 3 + 1 + 32768 + 2 + + 253 + 8 + 2 + 1 + 32768 + 2 + + 257 + 1 + 64 + 0 + 64 + + + + From f05bfcb4f81e16940811d0da4e6705c44704b432 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 1 May 2024 16:01:11 +0800 Subject: [PATCH 268/419] [submodule] Update submodule sonic-platform-daemons to the latest HEAD automatically (#18841) #### Why I did it src/sonic-platform-daemons ``` * 4c5f727 - (HEAD -> 202311, origin/202311) [202311][warm/fast-reboot] Retain TRANSCEIVER_INFO/STATUS tables on deinit (#477) (4 hours ago) [Stepan Blyshchak] ``` #### How I did it #### How to verify it #### Description for the changelog --- 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 d45b982eef17..4c5f727aebc4 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit d45b982eef176f815eb2d80b56348c17b84e0616 +Subproject commit 4c5f727aebc467a6336f5c56509aaf70509128f0 From 1f782224df104cc402131fa37a7ce24ac8cf10e4 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 1 May 2024 16:01:18 +0800 Subject: [PATCH 269/419] [submodule] Update submodule sonic-platform-common to the latest HEAD automatically (#18839) #### Why I did it src/sonic-platform-common ``` * b893c95 - (HEAD -> 202311, origin/202311) parse the output from the beginning of the line (#451) (7 hours ago) [Kebo Liu] ``` #### How I did it #### How to verify it #### Description for the changelog --- 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 11a3f7daf41e..b893c95c0741 160000 --- a/src/sonic-platform-common +++ b/src/sonic-platform-common @@ -1 +1 @@ -Subproject commit 11a3f7daf41e69157bcf1086a3af465c6f2d5c34 +Subproject commit b893c95c07411e97d2a3ff32d8181d2039f8f90b From 4962460ba6dcac841423780b9dcc2b907b409335 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 1 May 2024 19:01:04 +0800 Subject: [PATCH 270/419] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#18842) #### Why I did it src/sonic-utilities ``` * d52dc8e6 - (HEAD -> 202311, origin/202311) Display target firmware version through CLI (#3274) (4 hours ago) [mihirpat1] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index 21f69fb53892..d52dc8e66594 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 21f69fb53892e815daa89f66db778ad4c7cd6c77 +Subproject commit d52dc8e66594e3a7c18338dba89b5e72abd08899 From 1d8111206b879e224ec36a70dc001f2941d064c8 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 2 May 2024 16:01:48 +0800 Subject: [PATCH 271/419] [submodule] Update submodule sonic-gnmi to the latest HEAD automatically (#18824) #### Why I did it src/sonic-gnmi ``` * 530c6bb - (HEAD -> 202311, origin/202311) Merge pull request #220 from sonic-net/revert-211-cherry/202311/173 (3 days ago) [Ying Xie] * db6f983 - (origin/revert-211-cherry/202311/173) Revert "Replace PFC_WD_TABLE with PFC_WD (#173)" (8 days ago) [Zain Budhwani] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-gnmi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-gnmi b/src/sonic-gnmi index cf52c7453946..530c6bbf92e6 160000 --- a/src/sonic-gnmi +++ b/src/sonic-gnmi @@ -1 +1 @@ -Subproject commit cf52c7453946e273d10a7dcdc51df58d646c9adf +Subproject commit 530c6bbf92e6d62167c7faef1d2091222c9b8829 From b0af9706b0a2a509796ceeb8b6abda2660488928 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 4 May 2024 19:00:52 +0800 Subject: [PATCH 272/419] [submodule] Update submodule sonic-platform-daemons to the latest HEAD automatically (#18858) #### Why I did it src/sonic-platform-daemons ``` * 867b0c7 - (HEAD -> 202311, origin/202311) [202311] Handling exceptions in CMIS SM to prevent xcvrd crash (#485) (34 hours ago) [mihirpat1] ``` #### How I did it #### How to verify it #### Description for the changelog --- 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 4c5f727aebc4..867b0c7f2e80 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit 4c5f727aebc467a6336f5c56509aaf70509128f0 +Subproject commit 867b0c7f2e80f10f1e177415bb2630d9e7041e7f From 4728d4c7143764f8083a3f9544ada9801d707052 Mon Sep 17 00:00:00 2001 From: wadoodkhan <31757051+wadoodkhan@users.noreply.github.com> Date: Mon, 6 May 2024 21:39:29 +0530 Subject: [PATCH 273/419] [Marvell] Update SDK debian to 1.13.3-1 (#18710) * [Marvell-arm64] Update sai debian to 1.13.3-1 Signed-off-by: Wadood A. Khan --- platform/marvell-arm64/sai.mk | 2 +- platform/marvell-arm64/sai/Makefile | 2 +- platform/marvell/sai.mk | 2 +- platform/marvell/sai/Makefile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/platform/marvell-arm64/sai.mk b/platform/marvell-arm64/sai.mk index f7d8782ac0e3..23be2753a5d5 100644 --- a/platform/marvell-arm64/sai.mk +++ b/platform/marvell-arm64/sai.mk @@ -1,6 +1,6 @@ # Marvell SAI -export MRVL_SAI_VERSION = 1.13.0-1 +export MRVL_SAI_VERSION = 1.13.3-1 export MRVL_SAI = mrvllibsai_$(MRVL_SAI_VERSION)_$(PLATFORM_ARCH).deb $(MRVL_SAI)_SRC_PATH = $(PLATFORM_PATH)/sai diff --git a/platform/marvell-arm64/sai/Makefile b/platform/marvell-arm64/sai/Makefile index 07048e0141ea..a23b45843726 100644 --- a/platform/marvell-arm64/sai/Makefile +++ b/platform/marvell-arm64/sai/Makefile @@ -2,7 +2,7 @@ SHELL = /bin/bash .SHELLFLAGS += -e -MRVL_SAI_URL = https://github.com/Marvell-switching/sonic-marvell-binaries/raw/master/arm64/sai-plugin/$(MRVL_SAI) +MRVL_SAI_URL = https://github.com/Marvell-switching/sonic-marvell-binaries/raw/master/arm64/sai-plugin/202311/$(MRVL_SAI) $(addprefix $(DEST)/, $(MRVL_SAI)): $(DEST)/% : # get deb package diff --git a/platform/marvell/sai.mk b/platform/marvell/sai.mk index 231bdfc810a7..0bf366af45ed 100644 --- a/platform/marvell/sai.mk +++ b/platform/marvell/sai.mk @@ -1,6 +1,6 @@ # Marvell SAI -export MRVL_SAI_VERSION = 1.13.0-1 +export MRVL_SAI_VERSION = 1.13.3-1 export MRVL_SAI = mrvllibsai_amd64_$(MRVL_SAI_VERSION).deb $(MRVL_SAI)_SRC_PATH = $(PLATFORM_PATH)/sai diff --git a/platform/marvell/sai/Makefile b/platform/marvell/sai/Makefile index 1cd6d0267fa2..3438dab61826 100644 --- a/platform/marvell/sai/Makefile +++ b/platform/marvell/sai/Makefile @@ -2,7 +2,7 @@ SHELL = /bin/bash .SHELLFLAGS += -e -MRVL_SAI_URL = https://github.com/Marvell-switching/sonic-marvell-binaries/raw/master/amd64/sai-plugin/$(MRVL_SAI) +MRVL_SAI_URL = https://github.com/Marvell-switching/sonic-marvell-binaries/raw/master/amd64/sai-plugin/202311/$(MRVL_SAI) $(addprefix $(DEST)/, $(MRVL_SAI)): $(DEST)/% : # get deb package From 484a82c8c4a2f9064410f8b40eb59e7ba159d7b2 Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Tue, 7 May 2024 06:25:05 +0200 Subject: [PATCH 274/419] [202311][Arista] Update platform library submodules (#18885) Add platform driver support for the DCS-7060X6-64PE product --- 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 9038696debe7..c8924f32a3cf 160000 --- a/platform/barefoot/sonic-platform-modules-arista +++ b/platform/barefoot/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit 9038696debe74bd99b0b6e35552531e38cd1aa51 +Subproject commit c8924f32a3cff45e35dcdfd9f0b7dd9d37cecf60 diff --git a/platform/broadcom/sonic-platform-modules-arista b/platform/broadcom/sonic-platform-modules-arista index 9038696debe7..c8924f32a3cf 160000 --- a/platform/broadcom/sonic-platform-modules-arista +++ b/platform/broadcom/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit 9038696debe74bd99b0b6e35552531e38cd1aa51 +Subproject commit c8924f32a3cff45e35dcdfd9f0b7dd9d37cecf60 From 16e3b81491e1947e1b43a380f387e15d8db8469e Mon Sep 17 00:00:00 2001 From: Wenda Chu <32250288+w1nda@users.noreply.github.com> Date: Sat, 27 Apr 2024 06:46:12 +0800 Subject: [PATCH 275/419] [dhcp_server] Append subnet_id to server config and read the id from lease file for STATE_DB updating (#18739) --- dockers/docker-dhcp-server/kea-dhcp4.conf.j2 | 1 + .../dhcp_utilities/dhcpservd/dhcp_cfggen.py | 1 + .../dhcp_utilities/dhcpservd/dhcp_lease.py | 23 +---------- .../tests/test_data/kea-lease.csv | 18 ++++----- .../tests/test_dhcp_cfggen.py | 2 +- .../tests/test_dhcp_lease.py | 38 +++++-------------- 6 files changed, 24 insertions(+), 59 deletions(-) diff --git a/dockers/docker-dhcp-server/kea-dhcp4.conf.j2 b/dockers/docker-dhcp-server/kea-dhcp4.conf.j2 index d1e457764e02..dea1f997452e 100644 --- a/dockers/docker-dhcp-server/kea-dhcp4.conf.j2 +++ b/dockers/docker-dhcp-server/kea-dhcp4.conf.j2 @@ -42,6 +42,7 @@ {%- if add_subnet_preceding_comma.flag -%},{%- endif -%} {%- set _dummy = add_subnet_preceding_comma.update({'flag': True}) %} { + "id": {{ subnet_info["id"] }}, "subnet": "{{ subnet_info["subnet"] }}", "pools": [ {%- set add_pool_preceding_comma = { 'flag': False } %} diff --git a/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py index 0b862627fcbd..43b2df38e452 100755 --- a/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py +++ b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py @@ -177,6 +177,7 @@ def _construct_obj_for_template(self, dhcp_server_ipv4, port_ips, hostname, cust client_class) }) subnet_obj = { + "id": dhcp_interface_name.replace("Vlan", ""), "subnet": str(ipaddress.ip_network(dhcp_interface_ip, strict=False)), "pools": pools, "gateway": dhcp_config["gateway"], diff --git a/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_lease.py b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_lease.py index 10ff46da85c8..6dda767287ca 100644 --- a/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_lease.py +++ b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_lease.py @@ -106,7 +106,6 @@ def _read(self): syslog.syslog(syslog.LOG_ERR, "Cannot find lease file: {}".format(self.lease_file)) raise err - fdb_info = self._get_fdb_info() new_lease = {} # Get newest lease information of each client while dq: @@ -119,11 +118,9 @@ def _read(self): mac_address = splits[1] valid_lifetime = splits[3] lease_end = splits[4] + subnet_id = splits[5] - if mac_address not in fdb_info: - syslog.syslog(syslog.LOG_WARNING, "Cannot not find {} in fdb table".format(mac_address)) - continue - new_key = "{}|{}".format(fdb_info[mac_address], mac_address) + new_key = "{}|{}".format("Vlan" + subnet_id, mac_address) if new_key in new_lease: continue new_lease[new_key] = { @@ -133,21 +130,5 @@ def _read(self): } return new_lease - def _get_fdb_info(self): - """ - Get fdb information, indicate that mac address comes from which dhcp interface. - Returns: - Dict of fdb information, sample: - { - "aa:bb:cc:dd:ee:ff": "Vlan1000" - } - """ - fdb_table = self.db_connector.get_state_db_table("FDB_TABLE") - ret = {} - for key in fdb_table.keys(): - splits = key.split(":", 1) - ret[splits[1]] = splits[0] - return ret - def _update_lease(self, signum, frame): self.update_lease() diff --git a/src/sonic-dhcp-utilities/tests/test_data/kea-lease.csv b/src/sonic-dhcp-utilities/tests/test_data/kea-lease.csv index 645b07b2276e..c8ebe4390b37 100644 --- a/src/sonic-dhcp-utilities/tests/test_data/kea-lease.csv +++ b/src/sonic-dhcp-utilities/tests/test_data/kea-lease.csv @@ -1,10 +1,10 @@ address,hwaddr,client_id,valid_lifetime,expire,subnet_id,fqdn_fwd,fqdn_rev,hostname,state,user_context,pool_id -192.168.0.2,10:70:fd:b6:13:00,,3600,1694000905,1,0,0,7626dced293e,0,,0 -192.168.0.131,10:70:fd:b6:13:17,,3600,1694000909,1,0,0,7626dced293e,0,,1 -192.168.0.131,10:70:fd:b6:13:17,,0,1693997309,1,0,0,7626dced293e,0,,1 -192.168.0.131,10:70:fd:b6:13:17,,0,1693997309,1,0,0,,2,,1 -192.168.0.131,10:70:fd:b6:13:17,,3600,1694000915,1,0,0,7626dced293e,0,,1 -192.168.0.2,10:70:fd:b6:13:00,,0,1693997305,1,0,0,7626dced293e,0,,0 -193.168.2.2,10:70:fd:b6:13:15,,3600,1693999305,1,0,0,7626dced293e,0,,0 -193.168.2.3,10:70:fd:b6:13:20,,3600,1693999305,1,0,0,7626dced293e,0,,0 -193.168.0.132,10:70:fd:b6:13:18,,3600,1697610805,1,0,0,7626dced293e,0,,0 \ No newline at end of file +192.168.0.2,10:70:fd:b6:13:00,,3600,1694000905,1000,0,0,7626dced293e,0,,0 +192.168.0.131,10:70:fd:b6:13:17,,3600,1694000909,1000,0,0,7626dced293e,0,,1 +192.168.0.131,10:70:fd:b6:13:17,,0,1693997309,1000,0,0,7626dced293e,0,,1 +192.168.0.131,10:70:fd:b6:13:17,,0,1693997309,1000,0,0,,2,,1 +192.168.0.131,10:70:fd:b6:13:17,,3600,1694000915,1000,0,0,7626dced293e,0,,1 +192.168.0.2,10:70:fd:b6:13:00,,0,1693997305,1000,0,0,7626dced293e,0,,0 +193.168.2.2,10:70:fd:b6:13:15,,3600,1693999305,2000,0,0,7626dced293e,0,,0 +193.168.2.3,10:70:fd:b6:13:20,,3600,1693999305,2000,0,0,7626dced293e,0,,0 +193.168.0.132,10:70:fd:b6:13:18,,3600,1697610805,1000,0,0,7626dced293e,0,,0 \ No newline at end of file diff --git a/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py b/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py index c59db3af6c1b..cc9358b47c0c 100644 --- a/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py +++ b/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py @@ -181,7 +181,7 @@ expected_render_obj = { "subnets": [ { - "subnet": "192.168.0.0/21", + "subnet": "192.168.0.0/21", 'id': '1000', "pools": [{"range": "192.168.0.2 - 192.168.0.6", "client_class": "sonic-host:etp8"}, {"range": "192.168.0.10 - 192.168.0.10", "client_class": "sonic-host:etp8"}, {"range": "192.168.0.7 - 192.168.0.7", "client_class": "sonic-host:etp7"}], diff --git a/src/sonic-dhcp-utilities/tests/test_dhcp_lease.py b/src/sonic-dhcp-utilities/tests/test_dhcp_lease.py index 892c5f9bcc95..a831b2ad5a11 100644 --- a/src/sonic-dhcp-utilities/tests/test_dhcp_lease.py +++ b/src/sonic-dhcp-utilities/tests/test_dhcp_lease.py @@ -24,14 +24,13 @@ "lease_start": "1693995705", "lease_end": "1693999305", "ip": "193.168.2.2" + }, + "Vlan2000|10:70:fd:b6:13:20": { + "lease_start": "1693995705", + "lease_end": "1693999305", + "ip": "193.168.2.3" } } -expected_fdb_info = { - "10:70:fd:b6:13:00": "Vlan1000", - "10:70:fd:b6:13:15": "Vlan2000", - "10:70:fd:b6:13:17": "Vlan1000", - "10:70:fd:b6:13:18": "Vlan1000" -} def test_read_kea_lease_with_file_not_found(mock_swsscommon_dbconnector_init): @@ -44,28 +43,11 @@ def test_read_kea_lease_with_file_not_found(mock_swsscommon_dbconnector_init): def test_read_kea_lease(mock_swsscommon_dbconnector_init): - tested_fdb_info = expected_fdb_info - with patch.object(KeaDhcp4LeaseHandler, "_get_fdb_info", return_value=tested_fdb_info): - db_connector = DhcpDbConnector() - kea_lease_handler = KeaDhcp4LeaseHandler(db_connector, lease_file="tests/test_data/kea-lease.csv") - # Verify whether lease information read is as expected - lease = kea_lease_handler._read() - assert lease == expected_lease - - -def test_get_fdb_info(mock_swsscommon_dbconnector_init): - mock_fdb_table = { - "Vlan2000:10:70:fd:b6:13:15": {"port": "Ethernet31", "type": "dynamic"}, - "Vlan1000:10:70:fd:b6:13:00": {"port": "Ethernet32", "type": "dynamic"}, - "Vlan1000:10:70:fd:b6:13:17": {"port": "Ethernet33", "type": "dynamic"}, - "Vlan1000:10:70:fd:b6:13:18": {"port": "Ethernet34", "type": "dynamic"} - } - with patch("dhcp_utilities.common.utils.DhcpDbConnector.get_state_db_table", return_value=mock_fdb_table): - db_connector = DhcpDbConnector() - kea_lease_handler = KeaDhcp4LeaseHandler(db_connector, lease_file="tests/test_data/kea-lease.csv") - # Verify whether lease information read is as expected - fdb_info = kea_lease_handler._get_fdb_info() - assert fdb_info == expected_fdb_info + db_connector = DhcpDbConnector() + kea_lease_handler = KeaDhcp4LeaseHandler(db_connector, lease_file="tests/test_data/kea-lease.csv") + # Verify whether lease information read is as expected + lease = kea_lease_handler._read() + assert lease == expected_lease # Cannot mock built-in/extension type function(datetime.datetime.timestamp), need to free time From 511cfca61b8400f66da92414872c28b6aa6acf2c Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Wed, 17 Apr 2024 01:32:16 -0700 Subject: [PATCH 276/419] Platform configurations for QuicksilverP --- .../Arista-7060X6-64PE/port_config.ini | 65 + .../Arista-7060X6-64PE/sai.profile | 1 + .../th5-a7060x6-64pe.config.bcm | 1145 ++++++++++++++ .../x86_64-arista_7060x6_64pe/default_sku | 1 + .../x86_64-arista_7060x6_64pe/pcie.yaml | 1 + .../x86_64-arista_7060x6_64pe/platform.json | 1336 +++++++++++++++++ .../x86_64-arista_7060x6_64pe/platform_asic | 1 + .../platform_components.json | 12 + .../platform_env.conf | 2 + .../x86_64-arista_7060x6_64pe/platform_reboot | 1 + .../arista/x86_64-arista_7060x6_64pe/plugins | 1 + .../pmon_daemon_control.json | 1 + .../x86_64-arista_7060x6_64pe/sensors.conf | 26 + .../system_health_monitoring_config.json | 1 + .../thermal_policy.json | 1 + files/Aboot/boot0.j2 | 4 + 16 files changed, 2599 insertions(+) create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/port_config.ini create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/sai.profile create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/th5-a7060x6-64pe.config.bcm create mode 100644 device/arista/x86_64-arista_7060x6_64pe/default_sku create mode 120000 device/arista/x86_64-arista_7060x6_64pe/pcie.yaml create mode 100644 device/arista/x86_64-arista_7060x6_64pe/platform.json create mode 100644 device/arista/x86_64-arista_7060x6_64pe/platform_asic create mode 100644 device/arista/x86_64-arista_7060x6_64pe/platform_components.json create mode 100644 device/arista/x86_64-arista_7060x6_64pe/platform_env.conf create mode 120000 device/arista/x86_64-arista_7060x6_64pe/platform_reboot create mode 120000 device/arista/x86_64-arista_7060x6_64pe/plugins create mode 120000 device/arista/x86_64-arista_7060x6_64pe/pmon_daemon_control.json create mode 100644 device/arista/x86_64-arista_7060x6_64pe/sensors.conf create mode 120000 device/arista/x86_64-arista_7060x6_64pe/system_health_monitoring_config.json create mode 120000 device/arista/x86_64-arista_7060x6_64pe/thermal_policy.json diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/port_config.ini b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/port_config.ini new file mode 100644 index 000000000000..48d2519c0ca4 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/port_config.ini @@ -0,0 +1,65 @@ +# name lanes alias index speed fec +Ethernet0 17,18,19,20,21,22,23,24 Ethernet1/1 1 800000 rs +Ethernet8 1,2,3,4,5,6,7,8 Ethernet2/1 2 800000 rs +Ethernet16 9,10,11,12,13,14,15,16 Ethernet3/1 3 800000 rs +Ethernet24 25,26,27,28,29,30,31,32 Ethernet4/1 4 800000 rs +Ethernet32 57,58,59,60,61,62,63,64 Ethernet5/1 5 800000 rs +Ethernet40 41,42,43,44,45,46,47,48 Ethernet6/1 6 800000 rs +Ethernet48 33,34,35,36,37,38,39,40 Ethernet7/1 7 800000 rs +Ethernet56 49,50,51,52,53,54,55,56 Ethernet8/1 8 800000 rs +Ethernet64 89,90,91,92,93,94,95,96 Ethernet9/1 9 800000 rs +Ethernet72 73,74,75,76,77,78,79,80 Ethernet10/1 10 800000 rs +Ethernet80 65,66,67,68,69,70,71,72 Ethernet11/1 11 800000 rs +Ethernet88 81,82,83,84,85,86,87,88 Ethernet12/1 12 800000 rs +Ethernet96 121,122,123,124,125,126,127,128 Ethernet13/1 13 800000 rs +Ethernet104 105,106,107,108,109,110,111,112 Ethernet14/1 14 800000 rs +Ethernet112 97,98,99,100,101,102,103,104 Ethernet15/1 15 800000 rs +Ethernet120 113,114,115,116,117,118,119,120 Ethernet16/1 16 800000 rs +Ethernet128 153,154,155,156,157,158,159,160 Ethernet17/1 17 800000 rs +Ethernet136 137,138,139,140,141,142,143,144 Ethernet18/1 18 800000 rs +Ethernet144 129,130,131,132,133,134,135,136 Ethernet19/1 19 800000 rs +Ethernet152 145,146,147,148,149,150,151,152 Ethernet20/1 20 800000 rs +Ethernet160 185,186,187,188,189,190,191,192 Ethernet21/1 21 800000 rs +Ethernet168 169,170,171,172,173,174,175,176 Ethernet22/1 22 800000 rs +Ethernet176 161,162,163,164,165,166,167,168 Ethernet23/1 23 800000 rs +Ethernet184 177,178,179,180,181,182,183,184 Ethernet24/1 24 800000 rs +Ethernet192 217,218,219,220,221,222,223,224 Ethernet25/1 25 800000 rs +Ethernet200 201,202,203,204,205,206,207,208 Ethernet26/1 26 800000 rs +Ethernet208 193,194,195,196,197,198,199,200 Ethernet27/1 27 800000 rs +Ethernet216 209,210,211,212,213,214,215,216 Ethernet28/1 28 800000 rs +Ethernet224 249,250,251,252,253,254,255,256 Ethernet29/1 29 800000 rs +Ethernet232 233,234,235,236,237,238,239,240 Ethernet30/1 30 800000 rs +Ethernet240 225,226,227,228,229,230,231,232 Ethernet31/1 31 800000 rs +Ethernet248 241,242,243,244,245,246,247,248 Ethernet32/1 32 800000 rs +Ethernet256 273,274,275,276,277,278,279,280 Ethernet33/1 33 800000 rs +Ethernet264 257,258,259,260,261,262,263,264 Ethernet34/1 34 800000 rs +Ethernet272 265,266,267,268,269,270,271,272 Ethernet35/1 35 800000 rs +Ethernet280 281,282,283,284,285,286,287,288 Ethernet36/1 36 800000 rs +Ethernet288 313,314,315,316,317,318,319,320 Ethernet37/1 37 800000 rs +Ethernet296 297,298,299,300,301,302,303,304 Ethernet38/1 38 800000 rs +Ethernet304 289,290,291,292,293,294,295,296 Ethernet39/1 39 800000 rs +Ethernet312 305,306,307,308,309,310,311,312 Ethernet40/1 40 800000 rs +Ethernet320 345,346,347,348,349,350,351,352 Ethernet41/1 41 800000 rs +Ethernet328 329,330,331,332,333,334,335,336 Ethernet42/1 42 800000 rs +Ethernet336 321,322,323,324,325,326,327,328 Ethernet43/1 43 800000 rs +Ethernet344 337,338,339,340,341,342,343,344 Ethernet44/1 44 800000 rs +Ethernet352 377,378,379,380,381,382,383,384 Ethernet45/1 45 800000 rs +Ethernet360 361,362,363,364,365,366,367,368 Ethernet46/1 46 800000 rs +Ethernet368 353,354,355,356,357,358,359,360 Ethernet47/1 47 800000 rs +Ethernet376 369,370,371,372,373,374,375,376 Ethernet48/1 48 800000 rs +Ethernet384 409,410,411,412,413,414,415,416 Ethernet49/1 49 800000 rs +Ethernet392 393,394,395,396,397,398,399,400 Ethernet50/1 50 800000 rs +Ethernet400 385,386,387,388,389,390,391,392 Ethernet51/1 51 800000 rs +Ethernet408 401,402,403,404,405,406,407,408 Ethernet52/1 52 800000 rs +Ethernet416 441,442,443,444,445,446,447,448 Ethernet53/1 53 800000 rs +Ethernet424 425,426,427,428,429,430,431,432 Ethernet54/1 54 800000 rs +Ethernet432 417,418,419,420,421,422,423,424 Ethernet55/1 55 800000 rs +Ethernet440 433,434,435,436,437,438,439,440 Ethernet56/1 56 800000 rs +Ethernet448 473,474,475,476,477,478,479,480 Ethernet57/1 57 800000 rs +Ethernet456 457,458,459,460,461,462,463,464 Ethernet58/1 58 800000 rs +Ethernet464 449,450,451,452,453,454,455,456 Ethernet59/1 59 800000 rs +Ethernet472 465,466,467,468,469,470,471,472 Ethernet60/1 60 800000 rs +Ethernet480 505,506,507,508,509,510,511,512 Ethernet61/1 61 800000 rs +Ethernet488 489,490,491,492,493,494,495,496 Ethernet62/1 62 800000 rs +Ethernet496 481,482,483,484,485,486,487,488 Ethernet63/1 63 800000 rs +Ethernet504 497,498,499,500,501,502,503,504 Ethernet64/1 64 800000 rs diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/sai.profile b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/sai.profile new file mode 100644 index 000000000000..50c136d97b24 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/sai.profile @@ -0,0 +1 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th5-a7060x6-64pe.config.bcm diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/th5-a7060x6-64pe.config.bcm b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/th5-a7060x6-64pe.config.bcm new file mode 100644 index 000000000000..015f79440198 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/th5-a7060x6-64pe.config.bcm @@ -0,0 +1,1145 @@ +# +# $Copyright: (c) 2022 Broadcom. +# Broadcom Proprietary and Confidential. All rights reserved.$ +# +# BCM78900 64x800g port configuration. +# +# configuration yaml file +# device: +# : +#
: +# ? +# : +# : +# ... +# : +# : +# : +# : +# ... +# : +# + +--- +bcm_device: + 0: + global: + pktio_mode: 1 + default_cpu_tx_queue: 7 + vlan_flooding_l2mc_num_reserved: 0 + ipv6_lpm_128b_enable: 1 + shared_block_mask_section: uc_bc + skip_protocol_default_entries: 1 + # LTSW uses value 1 for ALPM combined mode + l3_alpm_template: 1 + l3_alpm_hit_skip: 1 + sai_feat_tail_timestamp : 1 + sai_port_phy_time_sync_en : 1 + sai_field_group_auto_prioritize: 1 + #l3_intf_vlan_split_egress for MTU at L3IF + l3_intf_vlan_split_egress : 1 + pfc_deadlock_seq_control : 1 + sai_tunnel_support: 2 + bcm_tunnel_term_compatible_mode: 1 + l3_ecmp_member_first_lkup_mem_size: 12288 +--- +device: + 0: + PC_PM_CORE: + ? + PC_PM_ID: 3 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0x66 + TX_POLARITY_FLIP: 0xaa + ? + PC_PM_ID: 1 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0x26 + TX_POLARITY_FLIP: 0xaa + ? + PC_PM_ID: 2 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x55 + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 4 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x55 + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 8 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 6 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xb6 + ? + PC_PM_ID: 5 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x23016745 + TX_LANE_MAP: 0x54670123 + RX_POLARITY_FLIP: 0x97 + TX_POLARITY_FLIP: 0x35 + ? + PC_PM_ID: 7 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 12 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 10 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 9 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 11 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 16 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 14 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 13 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 15 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 20 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 18 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 17 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 19 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 24 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 22 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 21 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 23 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 28 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x31204675 + TX_LANE_MAP: 0x47561203 + RX_POLARITY_FLIP: 0x11 + TX_POLARITY_FLIP: 0x2b + ? + PC_PM_ID: 26 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 25 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 27 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0x9a + ? + PC_PM_ID: 32 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0xff + ? + PC_PM_ID: 30 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0xff + ? + PC_PM_ID: 29 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 31 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 35 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0x00 + ? + PC_PM_ID: 33 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0x00 + ? + PC_PM_ID: 34 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 36 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 40 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 38 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0x9a + ? + PC_PM_ID: 37 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x31204675 + TX_LANE_MAP: 0x47561203 + RX_POLARITY_FLIP: 0x11 + TX_POLARITY_FLIP: 0x2b + ? + PC_PM_ID: 39 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 44 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 42 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 41 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 43 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 48 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 46 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 45 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 47 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 52 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 50 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 49 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 51 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 56 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 54 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 53 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 55 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 60 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x23016745 + TX_LANE_MAP: 0x54670123 + RX_POLARITY_FLIP: 0x97 + TX_POLARITY_FLIP: 0x35 + ? + PC_PM_ID: 58 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 57 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 59 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xb6 + ? + PC_PM_ID: 64 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x67 + TX_POLARITY_FLIP: 0x55 + ? + PC_PM_ID: 62 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x66 + TX_POLARITY_FLIP: 0x55 + ? + PC_PM_ID: 61 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0xaa + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 63 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0xaa + TX_POLARITY_FLIP: 0x66 +--- +device: + 0: + PC_PORT_PHYS_MAP: + ? + PORT_ID: 1 + : + PC_PHYS_PORT_ID: 1 + ? + PORT_ID: 2 + : + PC_PHYS_PORT_ID: 9 + ? + PORT_ID: 11 + : + PC_PHYS_PORT_ID: 17 + ? + PORT_ID: 12 + : + PC_PHYS_PORT_ID: 25 + ? + PORT_ID: 22 + : + PC_PHYS_PORT_ID: 33 + ? + PORT_ID: 23 + : + PC_PHYS_PORT_ID: 41 + ? + PORT_ID: 33 + : + PC_PHYS_PORT_ID: 49 + ? + PORT_ID: 34 + : + PC_PHYS_PORT_ID: 57 + ? + PORT_ID: 44 + : + PC_PHYS_PORT_ID: 65 + ? + PORT_ID: 45 + : + PC_PHYS_PORT_ID: 73 + ? + PORT_ID: 55 + : + PC_PHYS_PORT_ID: 81 + ? + PORT_ID: 56 + : + PC_PHYS_PORT_ID: 89 + ? + PORT_ID: 66 + : + PC_PHYS_PORT_ID: 97 + ? + PORT_ID: 67 + : + PC_PHYS_PORT_ID: 105 + ? + PORT_ID: 77 + : + PC_PHYS_PORT_ID: 113 + ? + PORT_ID: 78 + : + PC_PHYS_PORT_ID: 121 + ? + PORT_ID: 88 + : + PC_PHYS_PORT_ID: 129 + ? + PORT_ID: 89 + : + PC_PHYS_PORT_ID: 137 + ? + PORT_ID: 99 + : + PC_PHYS_PORT_ID: 145 + ? + PORT_ID: 100 + : + PC_PHYS_PORT_ID: 153 + ? + PORT_ID: 110 + : + PC_PHYS_PORT_ID: 161 + ? + PORT_ID: 111 + : + PC_PHYS_PORT_ID: 169 + ? + PORT_ID: 121 + : + PC_PHYS_PORT_ID: 177 + ? + PORT_ID: 122 + : + PC_PHYS_PORT_ID: 185 + ? + PORT_ID: 132 + : + PC_PHYS_PORT_ID: 193 + ? + PORT_ID: 133 + : + PC_PHYS_PORT_ID: 201 + ? + PORT_ID: 143 + : + PC_PHYS_PORT_ID: 209 + ? + PORT_ID: 144 + : + PC_PHYS_PORT_ID: 217 + ? + PORT_ID: 154 + : + PC_PHYS_PORT_ID: 225 + ? + PORT_ID: 155 + : + PC_PHYS_PORT_ID: 233 + ? + PORT_ID: 165 + : + PC_PHYS_PORT_ID: 241 + ? + PORT_ID: 166 + : + PC_PHYS_PORT_ID: 249 + ? + PORT_ID: 176 + : + PC_PHYS_PORT_ID: 257 + ? + PORT_ID: 177 + : + PC_PHYS_PORT_ID: 265 + ? + PORT_ID: 187 + : + PC_PHYS_PORT_ID: 273 + ? + PORT_ID: 188 + : + PC_PHYS_PORT_ID: 281 + ? + PORT_ID: 198 + : + PC_PHYS_PORT_ID: 289 + ? + PORT_ID: 199 + : + PC_PHYS_PORT_ID: 297 + ? + PORT_ID: 209 + : + PC_PHYS_PORT_ID: 305 + ? + PORT_ID: 210 + : + PC_PHYS_PORT_ID: 313 + ? + PORT_ID: 220 + : + PC_PHYS_PORT_ID: 321 + ? + PORT_ID: 221 + : + PC_PHYS_PORT_ID: 329 + ? + PORT_ID: 231 + : + PC_PHYS_PORT_ID: 337 + ? + PORT_ID: 232 + : + PC_PHYS_PORT_ID: 345 + ? + PORT_ID: 242 + : + PC_PHYS_PORT_ID: 353 + ? + PORT_ID: 243 + : + PC_PHYS_PORT_ID: 361 + ? + PORT_ID: 253 + : + PC_PHYS_PORT_ID: 369 + ? + PORT_ID: 254 + : + PC_PHYS_PORT_ID: 377 + ? + PORT_ID: 264 + : + PC_PHYS_PORT_ID: 385 + ? + PORT_ID: 265 + : + PC_PHYS_PORT_ID: 393 + ? + PORT_ID: 275 + : + PC_PHYS_PORT_ID: 401 + ? + PORT_ID: 276 + : + PC_PHYS_PORT_ID: 409 + ? + PORT_ID: 286 + : + PC_PHYS_PORT_ID: 417 + ? + PORT_ID: 287 + : + PC_PHYS_PORT_ID: 425 + ? + PORT_ID: 297 + : + PC_PHYS_PORT_ID: 433 + ? + PORT_ID: 298 + : + PC_PHYS_PORT_ID: 441 + ? + PORT_ID: 308 + : + PC_PHYS_PORT_ID: 449 + ? + PORT_ID: 309 + : + PC_PHYS_PORT_ID: 457 + ? + PORT_ID: 319 + : + PC_PHYS_PORT_ID: 465 + ? + PORT_ID: 320 + : + PC_PHYS_PORT_ID: 473 + ? + PORT_ID: 330 + : + PC_PHYS_PORT_ID: 481 + ? + PORT_ID: 331 + : + PC_PHYS_PORT_ID: 489 + ? + PORT_ID: 341 + : + PC_PHYS_PORT_ID: 497 + ? + PORT_ID: 342 + : + PC_PHYS_PORT_ID: 505 +... +--- +device: + 0: + PC_PORT: + ? + PORT_ID: [[1, 2], + [11, 12], + [22, 23], + [33, 34], + [44, 45], + [55, 56], + [66, 67], + [77, 78], + [88, 89], + [99, 100], + [110, 111], + [121, 122], + [132, 133], + [143, 144], + [154, 155], + [165, 166], + [176, 177], + [187, 188], + [198, 199], + [209, 210], + [220, 221], + [231, 232], + [242, 243], + [253, 254], + [264, 265], + [275, 276], + [286, 287], + [297, 298], + [308, 309], + [319, 320], + [330, 331], + [341, 342]] + : + ENABLE: 1 + SPEED: 800000 + NUM_LANES: 8 + FEC_MODE: PC_FEC_RS544_2XN + MAX_FRAME_SIZE: 9416 +... +--- +bcm_device: + 0: + global: + ftem_mem_entries: 65536 +... +--- +device: + 0: + # Per pipe flex counter configuration + CTR_EFLEX_CONFIG: + CTR_ING_EFLEX_OPERMODE_PIPEUNIQUE: 0 + CTR_EGR_EFLEX_OPERMODE_PIPEUNIQUE: 0 + + # IFP mode + FP_CONFIG: + FP_ING_OPERMODE: GLOBAL_PIPE_AWARE +... +--- +device: + 0: + DEVICE_CONFIG: + AUTOLOAD_BOARD_SETTINGS: 0 +... diff --git a/device/arista/x86_64-arista_7060x6_64pe/default_sku b/device/arista/x86_64-arista_7060x6_64pe/default_sku new file mode 100644 index 000000000000..a2770760bedf --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/default_sku @@ -0,0 +1 @@ +Arista-7060X6-64PE t1 diff --git a/device/arista/x86_64-arista_7060x6_64pe/pcie.yaml b/device/arista/x86_64-arista_7060x6_64pe/pcie.yaml new file mode 120000 index 000000000000..df18a601d82f --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/pcie.yaml @@ -0,0 +1 @@ +../x86_64-arista_common/pcie.yaml \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/platform.json b/device/arista/x86_64-arista_7060x6_64pe/platform.json new file mode 100644 index 000000000000..a249a56b4c47 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/platform.json @@ -0,0 +1,1336 @@ +{ + "chassis": { + "name": "DCS-7060X6-64PE", + "components": [ + { + "name": "Aboot()" + }, + { + "name": "Scd(addr=0000:00:18.7)" + }, + { + "name": "Scd(addr=0000:03:00.0)" + }, + { + "name": "ShearwaterSysCpld(addr=13-0023)" + } + ], + "fans": [], + "fan_drawers": [ + { + "name": "slot1", + "fans": [ + { + "name": "fan1" + } + ] + }, + { + "name": "slot2", + "fans": [ + { + "name": "fan2" + } + ] + }, + { + "name": "slot3", + "fans": [ + { + "name": "fan3" + } + ] + }, + { + "name": "slot4", + "fans": [ + { + "name": "fan4" + } + ] + } + ], + "psus": [ + { + "name": "psu1", + "voltage_high_threshold": false, + "voltage_low_threshold": false, + "fans": [ + { + "name": "psu1/1", + "speed": { + "controllable": false + } + } + ] + }, + { + "name": "psu2", + "voltage_high_threshold": false, + "voltage_low_threshold": false, + "fans": [ + { + "name": "psu2/1", + "speed": { + "controllable": false + } + } + ] + } + ], + "thermals": [ + { + "name": "Cpu temp sensor", + "controllable": false + }, + { + "name": "Ambient", + "controllable": false + }, + { + "name": "Outlet", + "controllable": false + }, + { + "name": "Switch Card temp sensor", + "controllable": false + }, + { + "name": "Air Exit Behind TH5", + "controllable": false + }, + { + "name": "Left Edge PCB Near Rear of Switch", + "controllable": false + }, + { + "name": "Air Inlet", + "controllable": false + }, + { + "name": "Management Card Inlet", + "controllable": false + } + ], + "sfps": [ + { + "name": "osfp1" + }, + { + "name": "osfp2" + }, + { + "name": "osfp3" + }, + { + "name": "osfp4" + }, + { + "name": "osfp5" + }, + { + "name": "osfp6" + }, + { + "name": "osfp7" + }, + { + "name": "osfp8" + }, + { + "name": "osfp9" + }, + { + "name": "osfp10" + }, + { + "name": "osfp11" + }, + { + "name": "osfp12" + }, + { + "name": "osfp13" + }, + { + "name": "osfp14" + }, + { + "name": "osfp15" + }, + { + "name": "osfp16" + }, + { + "name": "osfp17" + }, + { + "name": "osfp18" + }, + { + "name": "osfp19" + }, + { + "name": "osfp20" + }, + { + "name": "osfp21" + }, + { + "name": "osfp22" + }, + { + "name": "osfp23" + }, + { + "name": "osfp24" + }, + { + "name": "osfp25" + }, + { + "name": "osfp26" + }, + { + "name": "osfp27" + }, + { + "name": "osfp28" + }, + { + "name": "osfp29" + }, + { + "name": "osfp30" + }, + { + "name": "osfp31" + }, + { + "name": "osfp32" + }, + { + "name": "osfp33" + }, + { + "name": "osfp34" + }, + { + "name": "osfp35" + }, + { + "name": "osfp36" + }, + { + "name": "osfp37" + }, + { + "name": "osfp38" + }, + { + "name": "osfp39" + }, + { + "name": "osfp40" + }, + { + "name": "osfp41" + }, + { + "name": "osfp42" + }, + { + "name": "osfp43" + }, + { + "name": "osfp44" + }, + { + "name": "osfp45" + }, + { + "name": "osfp46" + }, + { + "name": "osfp47" + }, + { + "name": "osfp48" + }, + { + "name": "osfp49" + }, + { + "name": "osfp50" + }, + { + "name": "osfp51" + }, + { + "name": "osfp52" + }, + { + "name": "osfp53" + }, + { + "name": "osfp54" + }, + { + "name": "osfp55" + }, + { + "name": "osfp56" + }, + { + "name": "osfp57" + }, + { + "name": "osfp58" + }, + { + "name": "osfp59" + }, + { + "name": "osfp60" + }, + { + "name": "osfp61" + }, + { + "name": "osfp62" + }, + { + "name": "osfp63" + }, + { + "name": "osfp64" + } + ] + }, + "interfaces": { + "Ethernet0": { + "index": "1,1,1,1,1,1,1,1", + "lanes": "17,18,19,20,21,22,23,24", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet1/1" + ], + "1x400G": [ + "Ethernet1/1" + ], + "2x400G": [ + "Ethernet1/1", + "Ethernet1/5" + ] + } + }, + "Ethernet8": { + "index": "2,2,2,2,2,2,2,2", + "lanes": "1,2,3,4,5,6,7,8", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet2/1" + ], + "1x400G": [ + "Ethernet2/1" + ], + "2x400G": [ + "Ethernet2/1", + "Ethernet2/5" + ] + } + }, + "Ethernet16": { + "index": "3,3,3,3,3,3,3,3", + "lanes": "9,10,11,12,13,14,15,16", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet3/1" + ], + "1x400G": [ + "Ethernet3/1" + ], + "2x400G": [ + "Ethernet3/1", + "Ethernet3/5" + ] + } + }, + "Ethernet24": { + "index": "4,4,4,4,4,4,4,4", + "lanes": "25,26,27,28,29,30,31,32", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet4/1" + ], + "1x400G": [ + "Ethernet4/1" + ], + "2x400G": [ + "Ethernet4/1", + "Ethernet4/5" + ] + } + }, + "Ethernet32": { + "index": "5,5,5,5,5,5,5,5", + "lanes": "57,58,59,60,61,62,63,64", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet5/1" + ], + "1x400G": [ + "Ethernet5/1" + ], + "2x400G": [ + "Ethernet5/1", + "Ethernet5/5" + ] + } + }, + "Ethernet40": { + "index": "6,6,6,6,6,6,6,6", + "lanes": "41,42,43,44,45,46,47,48", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet6/1" + ], + "1x400G": [ + "Ethernet6/1" + ], + "2x400G": [ + "Ethernet6/1", + "Ethernet6/5" + ] + } + }, + "Ethernet48": { + "index": "7,7,7,7,7,7,7,7", + "lanes": "33,34,35,36,37,38,39,40", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet7/1" + ], + "1x400G": [ + "Ethernet7/1" + ], + "2x400G": [ + "Ethernet7/1", + "Ethernet7/5" + ] + } + }, + "Ethernet56": { + "index": "8,8,8,8,8,8,8,8", + "lanes": "49,50,51,52,53,54,55,56", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet8/1" + ], + "1x400G": [ + "Ethernet8/1" + ], + "2x400G": [ + "Ethernet8/1", + "Ethernet8/5" + ] + } + }, + "Ethernet64": { + "index": "9,9,9,9,9,9,9,9", + "lanes": "89,90,91,92,93,94,95,96", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet9/1" + ], + "1x400G": [ + "Ethernet9/1" + ], + "2x400G": [ + "Ethernet9/1", + "Ethernet9/5" + ] + } + }, + "Ethernet72": { + "index": "10,10,10,10,10,10,10,10", + "lanes": "73,74,75,76,77,78,79,80", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet10/1" + ], + "1x400G": [ + "Ethernet10/1" + ], + "2x400G": [ + "Ethernet10/1", + "Ethernet10/5" + ] + } + }, + "Ethernet80": { + "index": "11,11,11,11,11,11,11,11", + "lanes": "65,66,67,68,69,70,71,72", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet11/1" + ], + "1x400G": [ + "Ethernet11/1" + ], + "2x400G": [ + "Ethernet11/1", + "Ethernet11/5" + ] + } + }, + "Ethernet88": { + "index": "12,12,12,12,12,12,12,12", + "lanes": "81,82,83,84,85,86,87,88", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet12/1" + ], + "1x400G": [ + "Ethernet12/1" + ], + "2x400G": [ + "Ethernet12/1", + "Ethernet12/5" + ] + } + }, + "Ethernet96": { + "index": "13,13,13,13,13,13,13,13", + "lanes": "121,122,123,124,125,126,127,128", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet13/1" + ], + "1x400G": [ + "Ethernet13/1" + ], + "2x400G": [ + "Ethernet13/1", + "Ethernet13/5" + ] + } + }, + "Ethernet104": { + "index": "14,14,14,14,14,14,14,14", + "lanes": "105,106,107,108,109,110,111,112", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet14/1" + ], + "1x400G": [ + "Ethernet14/1" + ], + "2x400G": [ + "Ethernet14/1", + "Ethernet14/5" + ] + } + }, + "Ethernet112": { + "index": "15,15,15,15,15,15,15,15", + "lanes": "97,98,99,100,101,102,103,104", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet15/1" + ], + "1x400G": [ + "Ethernet15/1" + ], + "2x400G": [ + "Ethernet15/1", + "Ethernet15/5" + ] + } + }, + "Ethernet120": { + "index": "16,16,16,16,16,16,16,16", + "lanes": "113,114,115,116,117,118,119,120", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet16/1" + ], + "1x400G": [ + "Ethernet16/1" + ], + "2x400G": [ + "Ethernet16/1", + "Ethernet16/5" + ] + } + }, + "Ethernet128": { + "index": "17,17,17,17,17,17,17,17", + "lanes": "153,154,155,156,157,158,159,160", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet17/1" + ], + "1x400G": [ + "Ethernet17/1" + ], + "2x400G": [ + "Ethernet17/1", + "Ethernet17/5" + ] + } + }, + "Ethernet136": { + "index": "18,18,18,18,18,18,18,18", + "lanes": "137,138,139,140,141,142,143,144", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet18/1" + ], + "1x400G": [ + "Ethernet18/1" + ], + "2x400G": [ + "Ethernet18/1", + "Ethernet18/5" + ] + } + }, + "Ethernet144": { + "index": "19,19,19,19,19,19,19,19", + "lanes": "129,130,131,132,133,134,135,136", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet19/1" + ], + "1x400G": [ + "Ethernet19/1" + ], + "2x400G": [ + "Ethernet19/1", + "Ethernet19/5" + ] + } + }, + "Ethernet152": { + "index": "20,20,20,20,20,20,20,20", + "lanes": "145,146,147,148,149,150,151,152", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet20/1" + ], + "1x400G": [ + "Ethernet20/1" + ], + "2x400G": [ + "Ethernet20/1", + "Ethernet20/5" + ] + } + }, + "Ethernet160": { + "index": "21,21,21,21,21,21,21,21", + "lanes": "185,186,187,188,189,190,191,192", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet21/1" + ], + "1x400G": [ + "Ethernet21/1" + ], + "2x400G": [ + "Ethernet21/1", + "Ethernet21/5" + ] + } + }, + "Ethernet168": { + "index": "22,22,22,22,22,22,22,22", + "lanes": "169,170,171,172,173,174,175,176", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet22/1" + ], + "1x400G": [ + "Ethernet22/1" + ], + "2x400G": [ + "Ethernet22/1", + "Ethernet22/5" + ] + } + }, + "Ethernet176": { + "index": "23,23,23,23,23,23,23,23", + "lanes": "161,162,163,164,165,166,167,168", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet23/1" + ], + "1x400G": [ + "Ethernet23/1" + ], + "2x400G": [ + "Ethernet23/1", + "Ethernet23/5" + ] + } + }, + "Ethernet184": { + "index": "24,24,24,24,24,24,24,24", + "lanes": "177,178,179,180,181,182,183,184", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet24/1" + ], + "1x400G": [ + "Ethernet24/1" + ], + "2x400G": [ + "Ethernet24/1", + "Ethernet24/5" + ] + } + }, + "Ethernet192": { + "index": "25,25,25,25,25,25,25,25", + "lanes": "217,218,219,220,221,222,223,224", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet25/1" + ], + "1x400G": [ + "Ethernet25/1" + ], + "2x400G": [ + "Ethernet25/1", + "Ethernet25/5" + ] + } + }, + "Ethernet200": { + "index": "26,26,26,26,26,26,26,26", + "lanes": "201,202,203,204,205,206,207,208", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet26/1" + ], + "1x400G": [ + "Ethernet26/1" + ], + "2x400G": [ + "Ethernet26/1", + "Ethernet26/5" + ] + } + }, + "Ethernet208": { + "index": "27,27,27,27,27,27,27,27", + "lanes": "193,194,195,196,197,198,199,200", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet27/1" + ], + "1x400G": [ + "Ethernet27/1" + ], + "2x400G": [ + "Ethernet27/1", + "Ethernet27/5" + ] + } + }, + "Ethernet216": { + "index": "28,28,28,28,28,28,28,28", + "lanes": "209,210,211,212,213,214,215,216", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet28/1" + ], + "1x400G": [ + "Ethernet28/1" + ], + "2x400G": [ + "Ethernet28/1", + "Ethernet28/5" + ] + } + }, + "Ethernet224": { + "index": "29,29,29,29,29,29,29,29", + "lanes": "249,250,251,252,253,254,255,256", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet29/1" + ], + "1x400G": [ + "Ethernet29/1" + ], + "2x400G": [ + "Ethernet29/1", + "Ethernet29/5" + ] + } + }, + "Ethernet232": { + "index": "30,30,30,30,30,30,30,30", + "lanes": "233,234,235,236,237,238,239,240", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet30/1" + ], + "1x400G": [ + "Ethernet30/1" + ], + "2x400G": [ + "Ethernet30/1", + "Ethernet30/5" + ] + } + }, + "Ethernet240": { + "index": "31,31,31,31,31,31,31,31", + "lanes": "225,226,227,228,229,230,231,232", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet31/1" + ], + "1x400G": [ + "Ethernet31/1" + ], + "2x400G": [ + "Ethernet31/1", + "Ethernet31/5" + ] + } + }, + "Ethernet248": { + "index": "32,32,32,32,32,32,32,32", + "lanes": "241,242,243,244,245,246,247,248", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet32/1" + ], + "1x400G": [ + "Ethernet32/1" + ], + "2x400G": [ + "Ethernet32/1", + "Ethernet32/5" + ] + } + }, + "Ethernet256": { + "index": "33,33,33,33,33,33,33,33", + "lanes": "273,274,275,276,277,278,279,280", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet33/1" + ], + "1x400G": [ + "Ethernet33/1" + ], + "2x400G": [ + "Ethernet33/1", + "Ethernet33/5" + ] + } + }, + "Ethernet264": { + "index": "34,34,34,34,34,34,34,34", + "lanes": "257,258,259,260,261,262,263,264", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet34/1" + ], + "1x400G": [ + "Ethernet34/1" + ], + "2x400G": [ + "Ethernet34/1", + "Ethernet34/5" + ] + } + }, + "Ethernet272": { + "index": "35,35,35,35,35,35,35,35", + "lanes": "265,266,267,268,269,270,271,272", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet35/1" + ], + "1x400G": [ + "Ethernet35/1" + ], + "2x400G": [ + "Ethernet35/1", + "Ethernet35/5" + ] + } + }, + "Ethernet280": { + "index": "36,36,36,36,36,36,36,36", + "lanes": "281,282,283,284,285,286,287,288", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet36/1" + ], + "1x400G": [ + "Ethernet36/1" + ], + "2x400G": [ + "Ethernet36/1", + "Ethernet36/5" + ] + } + }, + "Ethernet288": { + "index": "37,37,37,37,37,37,37,37", + "lanes": "313,314,315,316,317,318,319,320", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet37/1" + ], + "1x400G": [ + "Ethernet37/1" + ], + "2x400G": [ + "Ethernet37/1", + "Ethernet37/5" + ] + } + }, + "Ethernet296": { + "index": "38,38,38,38,38,38,38,38", + "lanes": "297,298,299,300,301,302,303,304", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet38/1" + ], + "1x400G": [ + "Ethernet38/1" + ], + "2x400G": [ + "Ethernet38/1", + "Ethernet38/5" + ] + } + }, + "Ethernet304": { + "index": "39,39,39,39,39,39,39,39", + "lanes": "289,290,291,292,293,294,295,296", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet39/1" + ], + "1x400G": [ + "Ethernet39/1" + ], + "2x400G": [ + "Ethernet39/1", + "Ethernet39/5" + ] + } + }, + "Ethernet312": { + "index": "40,40,40,40,40,40,40,40", + "lanes": "305,306,307,308,309,310,311,312", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet40/1" + ], + "1x400G": [ + "Ethernet40/1" + ], + "2x400G": [ + "Ethernet40/1", + "Ethernet40/5" + ] + } + }, + "Ethernet320": { + "index": "41,41,41,41,41,41,41,41", + "lanes": "345,346,347,348,349,350,351,352", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet41/1" + ], + "1x400G": [ + "Ethernet41/1" + ], + "2x400G": [ + "Ethernet41/1", + "Ethernet41/5" + ] + } + }, + "Ethernet328": { + "index": "42,42,42,42,42,42,42,42", + "lanes": "329,330,331,332,333,334,335,336", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet42/1" + ], + "1x400G": [ + "Ethernet42/1" + ], + "2x400G": [ + "Ethernet42/1", + "Ethernet42/5" + ] + } + }, + "Ethernet336": { + "index": "43,43,43,43,43,43,43,43", + "lanes": "321,322,323,324,325,326,327,328", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet43/1" + ], + "1x400G": [ + "Ethernet43/1" + ], + "2x400G": [ + "Ethernet43/1", + "Ethernet43/5" + ] + } + }, + "Ethernet344": { + "index": "44,44,44,44,44,44,44,44", + "lanes": "337,338,339,340,341,342,343,344", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet44/1" + ], + "1x400G": [ + "Ethernet44/1" + ], + "2x400G": [ + "Ethernet44/1", + "Ethernet44/5" + ] + } + }, + "Ethernet352": { + "index": "45,45,45,45,45,45,45,45", + "lanes": "377,378,379,380,381,382,383,384", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet45/1" + ], + "1x400G": [ + "Ethernet45/1" + ], + "2x400G": [ + "Ethernet45/1", + "Ethernet45/5" + ] + } + }, + "Ethernet360": { + "index": "46,46,46,46,46,46,46,46", + "lanes": "361,362,363,364,365,366,367,368", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet46/1" + ], + "1x400G": [ + "Ethernet46/1" + ], + "2x400G": [ + "Ethernet46/1", + "Ethernet46/5" + ] + } + }, + "Ethernet368": { + "index": "47,47,47,47,47,47,47,47", + "lanes": "353,354,355,356,357,358,359,360", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet47/1" + ], + "1x400G": [ + "Ethernet47/1" + ], + "2x400G": [ + "Ethernet47/1", + "Ethernet47/5" + ] + } + }, + "Ethernet376": { + "index": "48,48,48,48,48,48,48,48", + "lanes": "369,370,371,372,373,374,375,376", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet48/1" + ], + "1x400G": [ + "Ethernet48/1" + ], + "2x400G": [ + "Ethernet48/1", + "Ethernet48/5" + ] + } + }, + "Ethernet384": { + "index": "49,49,49,49,49,49,49,49", + "lanes": "409,410,411,412,413,414,415,416", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet49/1" + ], + "1x400G": [ + "Ethernet49/1" + ], + "2x400G": [ + "Ethernet49/1", + "Ethernet49/5" + ] + } + }, + "Ethernet392": { + "index": "50,50,50,50,50,50,50,50", + "lanes": "393,394,395,396,397,398,399,400", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet50/1" + ], + "1x400G": [ + "Ethernet50/1" + ], + "2x400G": [ + "Ethernet50/1", + "Ethernet50/5" + ] + } + }, + "Ethernet400": { + "index": "51,51,51,51,51,51,51,51", + "lanes": "385,386,387,388,389,390,391,392", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet51/1" + ], + "1x400G": [ + "Ethernet51/1" + ], + "2x400G": [ + "Ethernet51/1", + "Ethernet51/5" + ] + } + }, + "Ethernet408": { + "index": "52,52,52,52,52,52,52,52", + "lanes": "401,402,403,404,405,406,407,408", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet52/1" + ], + "1x400G": [ + "Ethernet52/1" + ], + "2x400G": [ + "Ethernet52/1", + "Ethernet52/5" + ] + } + }, + "Ethernet416": { + "index": "53,53,53,53,53,53,53,53", + "lanes": "441,442,443,444,445,446,447,448", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet53/1" + ], + "1x400G": [ + "Ethernet53/1" + ], + "2x400G": [ + "Ethernet53/1", + "Ethernet53/5" + ] + } + }, + "Ethernet424": { + "index": "54,54,54,54,54,54,54,54", + "lanes": "425,426,427,428,429,430,431,432", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet54/1" + ], + "1x400G": [ + "Ethernet54/1" + ], + "2x400G": [ + "Ethernet54/1", + "Ethernet54/5" + ] + } + }, + "Ethernet432": { + "index": "55,55,55,55,55,55,55,55", + "lanes": "417,418,419,420,421,422,423,424", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet55/1" + ], + "1x400G": [ + "Ethernet55/1" + ], + "2x400G": [ + "Ethernet55/1", + "Ethernet55/5" + ] + } + }, + "Ethernet440": { + "index": "56,56,56,56,56,56,56,56", + "lanes": "433,434,435,436,437,438,439,440", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet56/1" + ], + "1x400G": [ + "Ethernet56/1" + ], + "2x400G": [ + "Ethernet56/1", + "Ethernet56/5" + ] + } + }, + "Ethernet448": { + "index": "57,57,57,57,57,57,57,57", + "lanes": "473,474,475,476,477,478,479,480", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet57/1" + ], + "1x400G": [ + "Ethernet57/1" + ], + "2x400G": [ + "Ethernet57/1", + "Ethernet57/5" + ] + } + }, + "Ethernet456": { + "index": "58,58,58,58,58,58,58,58", + "lanes": "457,458,459,460,461,462,463,464", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet58/1" + ], + "1x400G": [ + "Ethernet58/1" + ], + "2x400G": [ + "Ethernet58/1", + "Ethernet58/5" + ] + } + }, + "Ethernet464": { + "index": "59,59,59,59,59,59,59,59", + "lanes": "449,450,451,452,453,454,455,456", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet59/1" + ], + "1x400G": [ + "Ethernet59/1" + ], + "2x400G": [ + "Ethernet59/1", + "Ethernet59/5" + ] + } + }, + "Ethernet472": { + "index": "60,60,60,60,60,60,60,60", + "lanes": "465,466,467,468,469,470,471,472", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet60/1" + ], + "1x400G": [ + "Ethernet60/1" + ], + "2x400G": [ + "Ethernet60/1", + "Ethernet60/5" + ] + } + }, + "Ethernet480": { + "index": "61,61,61,61,61,61,61,61", + "lanes": "505,506,507,508,509,510,511,512", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet61/1" + ], + "1x400G": [ + "Ethernet61/1" + ], + "2x400G": [ + "Ethernet61/1", + "Ethernet61/5" + ] + } + }, + "Ethernet488": { + "index": "62,62,62,62,62,62,62,62", + "lanes": "489,490,491,492,493,494,495,496", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet62/1" + ], + "1x400G": [ + "Ethernet62/1" + ], + "2x400G": [ + "Ethernet62/1", + "Ethernet62/5" + ] + } + }, + "Ethernet496": { + "index": "63,63,63,63,63,63,63,63", + "lanes": "481,482,483,484,485,486,487,488", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet63/1" + ], + "1x400G": [ + "Ethernet63/1" + ], + "2x400G": [ + "Ethernet63/1", + "Ethernet63/5" + ] + } + }, + "Ethernet504": { + "index": "64,64,64,64,64,64,64,64", + "lanes": "497,498,499,500,501,502,503,504", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet64/1" + ], + "1x400G": [ + "Ethernet64/1" + ], + "2x400G": [ + "Ethernet64/1", + "Ethernet64/5" + ] + } + } + } +} diff --git a/device/arista/x86_64-arista_7060x6_64pe/platform_asic b/device/arista/x86_64-arista_7060x6_64pe/platform_asic new file mode 100644 index 000000000000..960467652765 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/platform_asic @@ -0,0 +1 @@ +broadcom diff --git a/device/arista/x86_64-arista_7060x6_64pe/platform_components.json b/device/arista/x86_64-arista_7060x6_64pe/platform_components.json new file mode 100644 index 000000000000..2295cd3a9f89 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/platform_components.json @@ -0,0 +1,12 @@ +{ + "chassis": { + "DCS-7060X6-64PE": { + "component": { + "Aboot()": {}, + "Scd(addr=0000:00:18.7)": {}, + "Scd(addr=0000:03:00.0)": {}, + "ShearwaterSysCpld(addr=13-0023)": {} + } + } + } +} diff --git a/device/arista/x86_64-arista_7060x6_64pe/platform_env.conf b/device/arista/x86_64-arista_7060x6_64pe/platform_env.conf new file mode 100644 index 000000000000..dd7cf4fe01c5 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/platform_env.conf @@ -0,0 +1,2 @@ +SYNCD_SHM_SIZE=512m +is_ltsw_chip=1 diff --git a/device/arista/x86_64-arista_7060x6_64pe/platform_reboot b/device/arista/x86_64-arista_7060x6_64pe/platform_reboot new file mode 120000 index 000000000000..7f94a49e38b0 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/platform_reboot @@ -0,0 +1 @@ +../x86_64-arista_common/platform_reboot \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/plugins b/device/arista/x86_64-arista_7060x6_64pe/plugins new file mode 120000 index 000000000000..789a45fcace9 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/plugins @@ -0,0 +1 @@ +../x86_64-arista_common/plugins \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/pmon_daemon_control.json b/device/arista/x86_64-arista_7060x6_64pe/pmon_daemon_control.json new file mode 120000 index 000000000000..51d5ab7b0059 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/pmon_daemon_control.json @@ -0,0 +1 @@ +../x86_64-arista_common/pmon_daemon_control.json \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/sensors.conf b/device/arista/x86_64-arista_7060x6_64pe/sensors.conf new file mode 100644 index 000000000000..a3f85d5aee0a --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/sensors.conf @@ -0,0 +1,26 @@ +bus "i2c-25" "SCD 0000:03:00.0 SMBus master 1 bus 0" +bus "i2c-28" "SCD 0000:03:00.0 SMBus master 1 bus 3" +bus "i2c-29" "SCD 0000:03:00.0 SMBus master 1 bus 4" + +chip "max6581-i2c-25-4d" + ignore temp5 + ignore temp6 + ignore temp7 + ignore temp8 + +chip "nvme-pci-0400" + # TODO: sensors complaining about tempX_min and tempX_max + ignore temp2 + ignore temp3 + ignore temp4 + ignore temp5 + ignore temp6 + ignore temp7 + +chip "pmbus-i2c-28-58" + ignore fan3 + ignore fan4 + +chip "pmbus-i2c-29-58" + ignore fan3 + ignore fan4 diff --git a/device/arista/x86_64-arista_7060x6_64pe/system_health_monitoring_config.json b/device/arista/x86_64-arista_7060x6_64pe/system_health_monitoring_config.json new file mode 120000 index 000000000000..1185f771fa8e --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/system_health_monitoring_config.json @@ -0,0 +1 @@ +../x86_64-arista_common/system_health_monitoring_config.json \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/thermal_policy.json b/device/arista/x86_64-arista_7060x6_64pe/thermal_policy.json new file mode 120000 index 000000000000..0991dc7f3638 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/thermal_policy.json @@ -0,0 +1 @@ +../x86_64-arista_common/thermal_policy.json \ No newline at end of file diff --git a/files/Aboot/boot0.j2 b/files/Aboot/boot0.j2 index 43f3fcae1baa..439debc74859 100644 --- a/files/Aboot/boot0.j2 +++ b/files/Aboot/boot0.j2 @@ -626,6 +626,9 @@ write_platform_specific_cmdline() { if in_array "$sid" "Shearwater4Mk2" "Shearwater4Mk2N" "Shearwater4Mk2QuicksilverDD" "Shearwater4Mk2NQuicksilverDD"; then aboot_machine=arista_7060x6_64de fi + if in_array "$sid" "Shearwater4Mk2QuicksilverP" "Shearwater4Mk2NQuicksilverP"; then + aboot_machine=arista_7060x6_64pe + fi # disable cpu c-state other than C1 local cpuvendor="$(sed -nr 's/vendor_id[\t ]*: (.*)/\1/p' /proc/cpuinfo | head -n 1)" @@ -668,6 +671,7 @@ write_platform_specific_cmdline() { read_system_eeprom fi if in_array "$platform" "shearwater"; then + cmdline_add modprobe.blacklist=snd_hda_intel,hdaudio if [ -f /tmp/.switch-prefdl ]; then read_switch_eeprom else From 6e884bcd9ddbcc640f8d468ef5b521f0cbf22f88 Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Mon, 6 May 2024 06:22:48 -0700 Subject: [PATCH 277/419] Add 256x200G hwsku for QuicksilverP --- .../port_config.ini | 257 +++ .../Arista-7060X6-64PE-256x200G/sai.profile | 1 + .../th5-a7060x6-64pe.config.bcm | 1913 +++++++++++++++++ 3 files changed, 2171 insertions(+) create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/port_config.ini create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/sai.profile create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/th5-a7060x6-64pe.config.bcm diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/port_config.ini b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/port_config.ini new file mode 100644 index 000000000000..323b8e2612eb --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/port_config.ini @@ -0,0 +1,257 @@ +# name lanes alias index speed fec +Ethernet0 17,18 Ethernet1/1 1 200000 rs +Ethernet2 19,20 Ethernet1/3 1 200000 rs +Ethernet4 21,22 Ethernet1/5 1 200000 rs +Ethernet6 23,24 Ethernet1/7 1 200000 rs +Ethernet8 1,2 Ethernet2/1 2 200000 rs +Ethernet10 3,4 Ethernet2/3 2 200000 rs +Ethernet12 5,6 Ethernet2/5 2 200000 rs +Ethernet14 7,8 Ethernet2/7 2 200000 rs +Ethernet16 9,10 Ethernet3/1 3 200000 rs +Ethernet18 11,12 Ethernet3/3 3 200000 rs +Ethernet20 13,14 Ethernet3/5 3 200000 rs +Ethernet22 15,16 Ethernet3/7 3 200000 rs +Ethernet24 25,26 Ethernet4/1 4 200000 rs +Ethernet26 27,28 Ethernet4/3 4 200000 rs +Ethernet28 29,30 Ethernet4/5 4 200000 rs +Ethernet30 31,32 Ethernet4/7 4 200000 rs +Ethernet32 57,58 Ethernet5/1 5 200000 rs +Ethernet34 59,60 Ethernet5/3 5 200000 rs +Ethernet36 61,62 Ethernet5/5 5 200000 rs +Ethernet38 63,64 Ethernet5/7 5 200000 rs +Ethernet40 41,42 Ethernet6/1 6 200000 rs +Ethernet42 43,44 Ethernet6/3 6 200000 rs +Ethernet44 45,46 Ethernet6/5 6 200000 rs +Ethernet46 47,48 Ethernet6/7 6 200000 rs +Ethernet48 33,34 Ethernet7/1 7 200000 rs +Ethernet50 35,36 Ethernet7/3 7 200000 rs +Ethernet52 37,38 Ethernet7/5 7 200000 rs +Ethernet54 39,40 Ethernet7/7 7 200000 rs +Ethernet56 49,50 Ethernet8/1 8 200000 rs +Ethernet58 51,52 Ethernet8/3 8 200000 rs +Ethernet60 53,54 Ethernet8/5 8 200000 rs +Ethernet62 55,56 Ethernet8/7 8 200000 rs +Ethernet64 89,90 Ethernet9/1 9 200000 rs +Ethernet66 91,92 Ethernet9/3 9 200000 rs +Ethernet68 93,94 Ethernet9/5 9 200000 rs +Ethernet70 95,96 Ethernet9/7 9 200000 rs +Ethernet72 73,74 Ethernet10/1 10 200000 rs +Ethernet74 75,76 Ethernet10/3 10 200000 rs +Ethernet76 77,78 Ethernet10/5 10 200000 rs +Ethernet78 79,80 Ethernet10/7 10 200000 rs +Ethernet80 65,66 Ethernet11/1 11 200000 rs +Ethernet82 67,68 Ethernet11/3 11 200000 rs +Ethernet84 69,70 Ethernet11/5 11 200000 rs +Ethernet86 71,72 Ethernet11/7 11 200000 rs +Ethernet88 81,82 Ethernet12/1 12 200000 rs +Ethernet90 83,84 Ethernet12/3 12 200000 rs +Ethernet92 85,86 Ethernet12/5 12 200000 rs +Ethernet94 87,88 Ethernet12/7 12 200000 rs +Ethernet96 121,122 Ethernet13/1 13 200000 rs +Ethernet98 123,124 Ethernet13/3 13 200000 rs +Ethernet100 125,126 Ethernet13/5 13 200000 rs +Ethernet102 127,128 Ethernet13/7 13 200000 rs +Ethernet104 105,106 Ethernet14/1 14 200000 rs +Ethernet106 107,108 Ethernet14/3 14 200000 rs +Ethernet108 109,110 Ethernet14/5 14 200000 rs +Ethernet110 111,112 Ethernet14/7 14 200000 rs +Ethernet112 97,98 Ethernet15/1 15 200000 rs +Ethernet114 99,100 Ethernet15/3 15 200000 rs +Ethernet116 101,102 Ethernet15/5 15 200000 rs +Ethernet118 103,104 Ethernet15/7 15 200000 rs +Ethernet120 113,114 Ethernet16/1 16 200000 rs +Ethernet122 115,116 Ethernet16/3 16 200000 rs +Ethernet124 117,118 Ethernet16/5 16 200000 rs +Ethernet126 119,120 Ethernet16/7 16 200000 rs +Ethernet128 153,154 Ethernet17/1 17 200000 rs +Ethernet130 155,156 Ethernet17/3 17 200000 rs +Ethernet132 157,158 Ethernet17/5 17 200000 rs +Ethernet134 159,160 Ethernet17/7 17 200000 rs +Ethernet136 137,138 Ethernet18/1 18 200000 rs +Ethernet138 139,140 Ethernet18/3 18 200000 rs +Ethernet140 141,142 Ethernet18/5 18 200000 rs +Ethernet142 143,144 Ethernet18/7 18 200000 rs +Ethernet144 129,130 Ethernet19/1 19 200000 rs +Ethernet146 131,132 Ethernet19/3 19 200000 rs +Ethernet148 133,134 Ethernet19/5 19 200000 rs +Ethernet150 135,136 Ethernet19/7 19 200000 rs +Ethernet152 145,146 Ethernet20/1 20 200000 rs +Ethernet154 147,148 Ethernet20/3 20 200000 rs +Ethernet156 149,150 Ethernet20/5 20 200000 rs +Ethernet158 151,152 Ethernet20/7 20 200000 rs +Ethernet160 185,186 Ethernet21/1 21 200000 rs +Ethernet162 187,188 Ethernet21/3 21 200000 rs +Ethernet164 189,190 Ethernet21/5 21 200000 rs +Ethernet166 191,192 Ethernet21/7 21 200000 rs +Ethernet168 169,170 Ethernet22/1 22 200000 rs +Ethernet170 171,172 Ethernet22/3 22 200000 rs +Ethernet172 173,174 Ethernet22/5 22 200000 rs +Ethernet174 175,176 Ethernet22/7 22 200000 rs +Ethernet176 161,162 Ethernet23/1 23 200000 rs +Ethernet178 163,164 Ethernet23/3 23 200000 rs +Ethernet180 165,166 Ethernet23/5 23 200000 rs +Ethernet182 167,168 Ethernet23/7 23 200000 rs +Ethernet184 177,178 Ethernet24/1 24 200000 rs +Ethernet186 179,180 Ethernet24/3 24 200000 rs +Ethernet188 181,182 Ethernet24/5 24 200000 rs +Ethernet190 183,184 Ethernet24/7 24 200000 rs +Ethernet192 217,218 Ethernet25/1 25 200000 rs +Ethernet194 219,220 Ethernet25/3 25 200000 rs +Ethernet196 221,222 Ethernet25/5 25 200000 rs +Ethernet198 223,224 Ethernet25/7 25 200000 rs +Ethernet200 201,202 Ethernet26/1 26 200000 rs +Ethernet202 203,204 Ethernet26/3 26 200000 rs +Ethernet204 205,206 Ethernet26/5 26 200000 rs +Ethernet206 207,208 Ethernet26/7 26 200000 rs +Ethernet208 193,194 Ethernet27/1 27 200000 rs +Ethernet210 195,196 Ethernet27/3 27 200000 rs +Ethernet212 197,198 Ethernet27/5 27 200000 rs +Ethernet214 199,200 Ethernet27/7 27 200000 rs +Ethernet216 209,210 Ethernet28/1 28 200000 rs +Ethernet218 211,212 Ethernet28/3 28 200000 rs +Ethernet220 213,214 Ethernet28/5 28 200000 rs +Ethernet222 215,216 Ethernet28/7 28 200000 rs +Ethernet224 249,250 Ethernet29/1 29 200000 rs +Ethernet226 251,252 Ethernet29/3 29 200000 rs +Ethernet228 253,254 Ethernet29/5 29 200000 rs +Ethernet230 255,256 Ethernet29/7 29 200000 rs +Ethernet232 233,234 Ethernet30/1 30 200000 rs +Ethernet234 235,236 Ethernet30/3 30 200000 rs +Ethernet236 237,238 Ethernet30/5 30 200000 rs +Ethernet238 239,240 Ethernet30/7 30 200000 rs +Ethernet240 225,226 Ethernet31/1 31 200000 rs +Ethernet242 227,228 Ethernet31/3 31 200000 rs +Ethernet244 229,230 Ethernet31/5 31 200000 rs +Ethernet246 231,232 Ethernet31/7 31 200000 rs +Ethernet248 241,242 Ethernet32/1 32 200000 rs +Ethernet250 243,244 Ethernet32/3 32 200000 rs +Ethernet252 245,246 Ethernet32/5 32 200000 rs +Ethernet254 247,248 Ethernet32/7 32 200000 rs +Ethernet256 273,274 Ethernet33/1 33 200000 rs +Ethernet258 275,276 Ethernet33/3 33 200000 rs +Ethernet260 277,278 Ethernet33/5 33 200000 rs +Ethernet262 279,280 Ethernet33/7 33 200000 rs +Ethernet264 257,258 Ethernet34/1 34 200000 rs +Ethernet266 259,260 Ethernet34/3 34 200000 rs +Ethernet268 261,262 Ethernet34/5 34 200000 rs +Ethernet270 263,264 Ethernet34/7 34 200000 rs +Ethernet272 265,266 Ethernet35/1 35 200000 rs +Ethernet274 267,268 Ethernet35/3 35 200000 rs +Ethernet276 269,270 Ethernet35/5 35 200000 rs +Ethernet278 271,272 Ethernet35/7 35 200000 rs +Ethernet280 281,282 Ethernet36/1 36 200000 rs +Ethernet282 283,284 Ethernet36/3 36 200000 rs +Ethernet284 285,286 Ethernet36/5 36 200000 rs +Ethernet286 287,288 Ethernet36/7 36 200000 rs +Ethernet288 313,314 Ethernet37/1 37 200000 rs +Ethernet290 315,316 Ethernet37/3 37 200000 rs +Ethernet292 317,318 Ethernet37/5 37 200000 rs +Ethernet294 319,320 Ethernet37/7 37 200000 rs +Ethernet296 297,298 Ethernet38/1 38 200000 rs +Ethernet298 299,300 Ethernet38/3 38 200000 rs +Ethernet300 301,302 Ethernet38/5 38 200000 rs +Ethernet302 303,304 Ethernet38/7 38 200000 rs +Ethernet304 289,290 Ethernet39/1 39 200000 rs +Ethernet306 291,292 Ethernet39/3 39 200000 rs +Ethernet308 293,294 Ethernet39/5 39 200000 rs +Ethernet310 295,296 Ethernet39/7 39 200000 rs +Ethernet312 305,306 Ethernet40/1 40 200000 rs +Ethernet314 307,308 Ethernet40/3 40 200000 rs +Ethernet316 309,310 Ethernet40/5 40 200000 rs +Ethernet318 311,312 Ethernet40/7 40 200000 rs +Ethernet320 345,346 Ethernet41/1 41 200000 rs +Ethernet322 347,348 Ethernet41/3 41 200000 rs +Ethernet324 349,350 Ethernet41/5 41 200000 rs +Ethernet326 351,352 Ethernet41/7 41 200000 rs +Ethernet328 329,330 Ethernet42/1 42 200000 rs +Ethernet330 331,332 Ethernet42/3 42 200000 rs +Ethernet332 333,334 Ethernet42/5 42 200000 rs +Ethernet334 335,336 Ethernet42/7 42 200000 rs +Ethernet336 321,322 Ethernet43/1 43 200000 rs +Ethernet338 323,324 Ethernet43/3 43 200000 rs +Ethernet340 325,326 Ethernet43/5 43 200000 rs +Ethernet342 327,328 Ethernet43/7 43 200000 rs +Ethernet344 337,338 Ethernet44/1 44 200000 rs +Ethernet346 339,340 Ethernet44/3 44 200000 rs +Ethernet348 341,342 Ethernet44/5 44 200000 rs +Ethernet350 343,344 Ethernet44/7 44 200000 rs +Ethernet352 377,378 Ethernet45/1 45 200000 rs +Ethernet354 379,380 Ethernet45/3 45 200000 rs +Ethernet356 381,382 Ethernet45/5 45 200000 rs +Ethernet358 383,384 Ethernet45/7 45 200000 rs +Ethernet360 361,362 Ethernet46/1 46 200000 rs +Ethernet362 363,364 Ethernet46/3 46 200000 rs +Ethernet364 365,366 Ethernet46/5 46 200000 rs +Ethernet366 367,368 Ethernet46/7 46 200000 rs +Ethernet368 353,354 Ethernet47/1 47 200000 rs +Ethernet370 355,356 Ethernet47/3 47 200000 rs +Ethernet372 357,358 Ethernet47/5 47 200000 rs +Ethernet374 359,360 Ethernet47/7 47 200000 rs +Ethernet376 369,370 Ethernet48/1 48 200000 rs +Ethernet378 371,372 Ethernet48/3 48 200000 rs +Ethernet380 373,374 Ethernet48/5 48 200000 rs +Ethernet382 375,376 Ethernet48/7 48 200000 rs +Ethernet384 409,410 Ethernet49/1 49 200000 rs +Ethernet386 411,412 Ethernet49/3 49 200000 rs +Ethernet388 413,414 Ethernet49/5 49 200000 rs +Ethernet390 415,416 Ethernet49/7 49 200000 rs +Ethernet392 393,394 Ethernet50/1 50 200000 rs +Ethernet394 395,396 Ethernet50/3 50 200000 rs +Ethernet396 397,398 Ethernet50/5 50 200000 rs +Ethernet398 399,400 Ethernet50/7 50 200000 rs +Ethernet400 385,386 Ethernet51/1 51 200000 rs +Ethernet402 387,388 Ethernet51/3 51 200000 rs +Ethernet404 389,390 Ethernet51/5 51 200000 rs +Ethernet406 391,392 Ethernet51/7 51 200000 rs +Ethernet408 401,402 Ethernet52/1 52 200000 rs +Ethernet410 403,404 Ethernet52/3 52 200000 rs +Ethernet412 405,406 Ethernet52/5 52 200000 rs +Ethernet414 407,408 Ethernet52/7 52 200000 rs +Ethernet416 441,442 Ethernet53/1 53 200000 rs +Ethernet418 443,444 Ethernet53/3 53 200000 rs +Ethernet420 445,446 Ethernet53/5 53 200000 rs +Ethernet422 447,448 Ethernet53/7 53 200000 rs +Ethernet424 425,426 Ethernet54/1 54 200000 rs +Ethernet426 427,428 Ethernet54/3 54 200000 rs +Ethernet428 429,430 Ethernet54/5 54 200000 rs +Ethernet430 431,432 Ethernet54/7 54 200000 rs +Ethernet432 417,418 Ethernet55/1 55 200000 rs +Ethernet434 419,420 Ethernet55/3 55 200000 rs +Ethernet436 421,422 Ethernet55/5 55 200000 rs +Ethernet438 423,424 Ethernet55/7 55 200000 rs +Ethernet440 433,434 Ethernet56/1 56 200000 rs +Ethernet442 435,436 Ethernet56/3 56 200000 rs +Ethernet444 437,438 Ethernet56/5 56 200000 rs +Ethernet446 439,440 Ethernet56/7 56 200000 rs +Ethernet448 473,474 Ethernet57/1 57 200000 rs +Ethernet450 475,476 Ethernet57/3 57 200000 rs +Ethernet452 477,478 Ethernet57/5 57 200000 rs +Ethernet454 479,480 Ethernet57/7 57 200000 rs +Ethernet456 457,458 Ethernet58/1 58 200000 rs +Ethernet458 459,460 Ethernet58/3 58 200000 rs +Ethernet460 461,462 Ethernet58/5 58 200000 rs +Ethernet462 463,464 Ethernet58/7 58 200000 rs +Ethernet464 449,450 Ethernet59/1 59 200000 rs +Ethernet466 451,452 Ethernet59/3 59 200000 rs +Ethernet468 453,454 Ethernet59/5 59 200000 rs +Ethernet470 455,456 Ethernet59/7 59 200000 rs +Ethernet472 465,466 Ethernet60/1 60 200000 rs +Ethernet474 467,468 Ethernet60/3 60 200000 rs +Ethernet476 469,470 Ethernet60/5 60 200000 rs +Ethernet478 471,472 Ethernet60/7 60 200000 rs +Ethernet480 505,506 Ethernet61/1 61 200000 rs +Ethernet482 507,508 Ethernet61/3 61 200000 rs +Ethernet484 509,510 Ethernet61/5 61 200000 rs +Ethernet486 511,512 Ethernet61/7 61 200000 rs +Ethernet488 489,490 Ethernet62/1 62 200000 rs +Ethernet490 491,492 Ethernet62/3 62 200000 rs +Ethernet492 493,494 Ethernet62/5 62 200000 rs +Ethernet494 495,496 Ethernet62/7 62 200000 rs +Ethernet496 481,482 Ethernet63/1 63 200000 rs +Ethernet498 483,484 Ethernet63/3 63 200000 rs +Ethernet500 485,486 Ethernet63/5 63 200000 rs +Ethernet502 487,488 Ethernet63/7 63 200000 rs +Ethernet504 497,498 Ethernet64/1 64 200000 rs +Ethernet506 499,500 Ethernet64/3 64 200000 rs +Ethernet508 501,502 Ethernet64/5 64 200000 rs +Ethernet510 503,504 Ethernet64/7 64 200000 rs diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/sai.profile b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/sai.profile new file mode 100644 index 000000000000..50c136d97b24 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/sai.profile @@ -0,0 +1 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th5-a7060x6-64pe.config.bcm diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/th5-a7060x6-64pe.config.bcm b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/th5-a7060x6-64pe.config.bcm new file mode 100644 index 000000000000..997636fdcc58 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/th5-a7060x6-64pe.config.bcm @@ -0,0 +1,1913 @@ +# +# $Copyright: (c) 2022 Broadcom. +# Broadcom Proprietary and Confidential. All rights reserved.$ +# +# BCM78900 64x800g port configuration. +# +# configuration yaml file +# device: +# : +#
: +# ? +# : +# : +# ... +# : +# : +# : +# : +# ... +# : +# + +--- +bcm_device: + 0: + global: + pktio_mode: 1 + default_cpu_tx_queue: 7 + vlan_flooding_l2mc_num_reserved: 0 + ipv6_lpm_128b_enable: 1 + shared_block_mask_section: uc_bc + skip_protocol_default_entries: 1 + # LTSW uses value 1 for ALPM combined mode + l3_alpm_template: 1 + l3_alpm_hit_skip: 1 + sai_feat_tail_timestamp : 1 + sai_port_phy_time_sync_en : 1 + sai_field_group_auto_prioritize: 1 + #l3_intf_vlan_split_egress for MTU at L3IF + l3_intf_vlan_split_egress : 1 + pfc_deadlock_seq_control : 1 + sai_tunnel_support: 2 + bcm_tunnel_term_compatible_mode: 1 + l3_ecmp_member_first_lkup_mem_size: 12288 +--- +device: + 0: + PC_PM_CORE: + ? + PC_PM_ID: 3 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0x66 + TX_POLARITY_FLIP: 0xaa + ? + PC_PM_ID: 1 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0x26 + TX_POLARITY_FLIP: 0xaa + ? + PC_PM_ID: 2 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x55 + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 4 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x55 + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 8 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 6 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xb6 + ? + PC_PM_ID: 5 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x23016745 + TX_LANE_MAP: 0x54670123 + RX_POLARITY_FLIP: 0x97 + TX_POLARITY_FLIP: 0x35 + ? + PC_PM_ID: 7 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 12 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 10 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 9 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 11 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 16 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 14 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 13 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 15 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 20 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 18 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 17 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 19 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 24 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 22 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 21 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 23 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 28 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x31204675 + TX_LANE_MAP: 0x47561203 + RX_POLARITY_FLIP: 0x11 + TX_POLARITY_FLIP: 0x2b + ? + PC_PM_ID: 26 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 25 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 27 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0x9a + ? + PC_PM_ID: 32 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0xff + ? + PC_PM_ID: 30 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0xff + ? + PC_PM_ID: 29 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 31 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 35 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0x00 + ? + PC_PM_ID: 33 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0x00 + ? + PC_PM_ID: 34 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 36 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 40 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 38 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0x9a + ? + PC_PM_ID: 37 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x31204675 + TX_LANE_MAP: 0x47561203 + RX_POLARITY_FLIP: 0x11 + TX_POLARITY_FLIP: 0x2b + ? + PC_PM_ID: 39 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 44 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 42 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 41 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 43 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 48 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 46 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 45 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 47 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 52 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 50 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 49 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 51 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 56 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 54 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 53 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 55 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 60 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x23016745 + TX_LANE_MAP: 0x54670123 + RX_POLARITY_FLIP: 0x97 + TX_POLARITY_FLIP: 0x35 + ? + PC_PM_ID: 58 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 57 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 59 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xb6 + ? + PC_PM_ID: 64 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x67 + TX_POLARITY_FLIP: 0x55 + ? + PC_PM_ID: 62 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x66 + TX_POLARITY_FLIP: 0x55 + ? + PC_PM_ID: 61 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0xaa + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 63 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0xaa + TX_POLARITY_FLIP: 0x66 +--- +device: + 0: + PC_PORT_PHYS_MAP: + ? + PORT_ID: 1 + : + PC_PHYS_PORT_ID: 1 + ? + PORT_ID: 2 + : + PC_PHYS_PORT_ID: 3 + ? + PORT_ID: 3 + : + PC_PHYS_PORT_ID: 5 + ? + PORT_ID: 4 + : + PC_PHYS_PORT_ID: 7 + ? + PORT_ID: 5 + : + PC_PHYS_PORT_ID: 9 + ? + PORT_ID: 6 + : + PC_PHYS_PORT_ID: 11 + ? + PORT_ID: 7 + : + PC_PHYS_PORT_ID: 13 + ? + PORT_ID: 8 + : + PC_PHYS_PORT_ID: 15 + ? + PORT_ID: 11 + : + PC_PHYS_PORT_ID: 17 + ? + PORT_ID: 12 + : + PC_PHYS_PORT_ID: 19 + ? + PORT_ID: 13 + : + PC_PHYS_PORT_ID: 21 + ? + PORT_ID: 14 + : + PC_PHYS_PORT_ID: 23 + ? + PORT_ID: 15 + : + PC_PHYS_PORT_ID: 25 + ? + PORT_ID: 16 + : + PC_PHYS_PORT_ID: 27 + ? + PORT_ID: 17 + : + PC_PHYS_PORT_ID: 29 + ? + PORT_ID: 18 + : + PC_PHYS_PORT_ID: 31 + ? + PORT_ID: 22 + : + PC_PHYS_PORT_ID: 33 + ? + PORT_ID: 23 + : + PC_PHYS_PORT_ID: 35 + ? + PORT_ID: 24 + : + PC_PHYS_PORT_ID: 37 + ? + PORT_ID: 25 + : + PC_PHYS_PORT_ID: 39 + ? + PORT_ID: 26 + : + PC_PHYS_PORT_ID: 41 + ? + PORT_ID: 27 + : + PC_PHYS_PORT_ID: 43 + ? + PORT_ID: 28 + : + PC_PHYS_PORT_ID: 45 + ? + PORT_ID: 29 + : + PC_PHYS_PORT_ID: 47 + ? + PORT_ID: 33 + : + PC_PHYS_PORT_ID: 49 + ? + PORT_ID: 34 + : + PC_PHYS_PORT_ID: 51 + ? + PORT_ID: 35 + : + PC_PHYS_PORT_ID: 53 + ? + PORT_ID: 36 + : + PC_PHYS_PORT_ID: 55 + ? + PORT_ID: 37 + : + PC_PHYS_PORT_ID: 57 + ? + PORT_ID: 38 + : + PC_PHYS_PORT_ID: 59 + ? + PORT_ID: 39 + : + PC_PHYS_PORT_ID: 61 + ? + PORT_ID: 40 + : + PC_PHYS_PORT_ID: 63 + ? + PORT_ID: 44 + : + PC_PHYS_PORT_ID: 65 + ? + PORT_ID: 45 + : + PC_PHYS_PORT_ID: 67 + ? + PORT_ID: 46 + : + PC_PHYS_PORT_ID: 69 + ? + PORT_ID: 47 + : + PC_PHYS_PORT_ID: 71 + ? + PORT_ID: 48 + : + PC_PHYS_PORT_ID: 73 + ? + PORT_ID: 49 + : + PC_PHYS_PORT_ID: 75 + ? + PORT_ID: 50 + : + PC_PHYS_PORT_ID: 77 + ? + PORT_ID: 51 + : + PC_PHYS_PORT_ID: 79 + ? + PORT_ID: 55 + : + PC_PHYS_PORT_ID: 81 + ? + PORT_ID: 56 + : + PC_PHYS_PORT_ID: 83 + ? + PORT_ID: 57 + : + PC_PHYS_PORT_ID: 85 + ? + PORT_ID: 58 + : + PC_PHYS_PORT_ID: 87 + ? + PORT_ID: 59 + : + PC_PHYS_PORT_ID: 89 + ? + PORT_ID: 60 + : + PC_PHYS_PORT_ID: 91 + ? + PORT_ID: 61 + : + PC_PHYS_PORT_ID: 93 + ? + PORT_ID: 62 + : + PC_PHYS_PORT_ID: 95 + ? + PORT_ID: 66 + : + PC_PHYS_PORT_ID: 97 + ? + PORT_ID: 67 + : + PC_PHYS_PORT_ID: 99 + ? + PORT_ID: 68 + : + PC_PHYS_PORT_ID: 101 + ? + PORT_ID: 69 + : + PC_PHYS_PORT_ID: 103 + ? + PORT_ID: 70 + : + PC_PHYS_PORT_ID: 105 + ? + PORT_ID: 71 + : + PC_PHYS_PORT_ID: 107 + ? + PORT_ID: 72 + : + PC_PHYS_PORT_ID: 109 + ? + PORT_ID: 73 + : + PC_PHYS_PORT_ID: 111 + ? + PORT_ID: 77 + : + PC_PHYS_PORT_ID: 113 + ? + PORT_ID: 78 + : + PC_PHYS_PORT_ID: 115 + ? + PORT_ID: 79 + : + PC_PHYS_PORT_ID: 117 + ? + PORT_ID: 80 + : + PC_PHYS_PORT_ID: 119 + ? + PORT_ID: 81 + : + PC_PHYS_PORT_ID: 121 + ? + PORT_ID: 82 + : + PC_PHYS_PORT_ID: 123 + ? + PORT_ID: 83 + : + PC_PHYS_PORT_ID: 125 + ? + PORT_ID: 84 + : + PC_PHYS_PORT_ID: 127 + ? + PORT_ID: 88 + : + PC_PHYS_PORT_ID: 129 + ? + PORT_ID: 89 + : + PC_PHYS_PORT_ID: 131 + ? + PORT_ID: 90 + : + PC_PHYS_PORT_ID: 133 + ? + PORT_ID: 91 + : + PC_PHYS_PORT_ID: 135 + ? + PORT_ID: 92 + : + PC_PHYS_PORT_ID: 137 + ? + PORT_ID: 93 + : + PC_PHYS_PORT_ID: 139 + ? + PORT_ID: 94 + : + PC_PHYS_PORT_ID: 141 + ? + PORT_ID: 95 + : + PC_PHYS_PORT_ID: 143 + ? + PORT_ID: 99 + : + PC_PHYS_PORT_ID: 145 + ? + PORT_ID: 100 + : + PC_PHYS_PORT_ID: 147 + ? + PORT_ID: 101 + : + PC_PHYS_PORT_ID: 149 + ? + PORT_ID: 102 + : + PC_PHYS_PORT_ID: 151 + ? + PORT_ID: 103 + : + PC_PHYS_PORT_ID: 153 + ? + PORT_ID: 104 + : + PC_PHYS_PORT_ID: 155 + ? + PORT_ID: 105 + : + PC_PHYS_PORT_ID: 157 + ? + PORT_ID: 106 + : + PC_PHYS_PORT_ID: 159 + ? + PORT_ID: 110 + : + PC_PHYS_PORT_ID: 161 + ? + PORT_ID: 111 + : + PC_PHYS_PORT_ID: 163 + ? + PORT_ID: 112 + : + PC_PHYS_PORT_ID: 165 + ? + PORT_ID: 113 + : + PC_PHYS_PORT_ID: 167 + ? + PORT_ID: 114 + : + PC_PHYS_PORT_ID: 169 + ? + PORT_ID: 115 + : + PC_PHYS_PORT_ID: 171 + ? + PORT_ID: 116 + : + PC_PHYS_PORT_ID: 173 + ? + PORT_ID: 117 + : + PC_PHYS_PORT_ID: 175 + ? + PORT_ID: 121 + : + PC_PHYS_PORT_ID: 177 + ? + PORT_ID: 122 + : + PC_PHYS_PORT_ID: 179 + ? + PORT_ID: 123 + : + PC_PHYS_PORT_ID: 181 + ? + PORT_ID: 124 + : + PC_PHYS_PORT_ID: 183 + ? + PORT_ID: 125 + : + PC_PHYS_PORT_ID: 185 + ? + PORT_ID: 126 + : + PC_PHYS_PORT_ID: 187 + ? + PORT_ID: 127 + : + PC_PHYS_PORT_ID: 189 + ? + PORT_ID: 128 + : + PC_PHYS_PORT_ID: 191 + ? + PORT_ID: 132 + : + PC_PHYS_PORT_ID: 193 + ? + PORT_ID: 133 + : + PC_PHYS_PORT_ID: 195 + ? + PORT_ID: 134 + : + PC_PHYS_PORT_ID: 197 + ? + PORT_ID: 135 + : + PC_PHYS_PORT_ID: 199 + ? + PORT_ID: 136 + : + PC_PHYS_PORT_ID: 201 + ? + PORT_ID: 137 + : + PC_PHYS_PORT_ID: 203 + ? + PORT_ID: 138 + : + PC_PHYS_PORT_ID: 205 + ? + PORT_ID: 139 + : + PC_PHYS_PORT_ID: 207 + ? + PORT_ID: 143 + : + PC_PHYS_PORT_ID: 209 + ? + PORT_ID: 144 + : + PC_PHYS_PORT_ID: 211 + ? + PORT_ID: 145 + : + PC_PHYS_PORT_ID: 213 + ? + PORT_ID: 146 + : + PC_PHYS_PORT_ID: 215 + ? + PORT_ID: 147 + : + PC_PHYS_PORT_ID: 217 + ? + PORT_ID: 148 + : + PC_PHYS_PORT_ID: 219 + ? + PORT_ID: 149 + : + PC_PHYS_PORT_ID: 221 + ? + PORT_ID: 150 + : + PC_PHYS_PORT_ID: 223 + ? + PORT_ID: 154 + : + PC_PHYS_PORT_ID: 225 + ? + PORT_ID: 155 + : + PC_PHYS_PORT_ID: 227 + ? + PORT_ID: 156 + : + PC_PHYS_PORT_ID: 229 + ? + PORT_ID: 157 + : + PC_PHYS_PORT_ID: 231 + ? + PORT_ID: 158 + : + PC_PHYS_PORT_ID: 233 + ? + PORT_ID: 159 + : + PC_PHYS_PORT_ID: 235 + ? + PORT_ID: 160 + : + PC_PHYS_PORT_ID: 237 + ? + PORT_ID: 161 + : + PC_PHYS_PORT_ID: 239 + ? + PORT_ID: 165 + : + PC_PHYS_PORT_ID: 241 + ? + PORT_ID: 166 + : + PC_PHYS_PORT_ID: 243 + ? + PORT_ID: 167 + : + PC_PHYS_PORT_ID: 245 + ? + PORT_ID: 168 + : + PC_PHYS_PORT_ID: 247 + ? + PORT_ID: 169 + : + PC_PHYS_PORT_ID: 249 + ? + PORT_ID: 170 + : + PC_PHYS_PORT_ID: 251 + ? + PORT_ID: 171 + : + PC_PHYS_PORT_ID: 253 + ? + PORT_ID: 172 + : + PC_PHYS_PORT_ID: 255 + ? + PORT_ID: 176 + : + PC_PHYS_PORT_ID: 257 + ? + PORT_ID: 177 + : + PC_PHYS_PORT_ID: 259 + ? + PORT_ID: 178 + : + PC_PHYS_PORT_ID: 261 + ? + PORT_ID: 179 + : + PC_PHYS_PORT_ID: 263 + ? + PORT_ID: 180 + : + PC_PHYS_PORT_ID: 265 + ? + PORT_ID: 181 + : + PC_PHYS_PORT_ID: 267 + ? + PORT_ID: 182 + : + PC_PHYS_PORT_ID: 269 + ? + PORT_ID: 183 + : + PC_PHYS_PORT_ID: 271 + ? + PORT_ID: 187 + : + PC_PHYS_PORT_ID: 273 + ? + PORT_ID: 188 + : + PC_PHYS_PORT_ID: 275 + ? + PORT_ID: 189 + : + PC_PHYS_PORT_ID: 277 + ? + PORT_ID: 190 + : + PC_PHYS_PORT_ID: 279 + ? + PORT_ID: 191 + : + PC_PHYS_PORT_ID: 281 + ? + PORT_ID: 192 + : + PC_PHYS_PORT_ID: 283 + ? + PORT_ID: 193 + : + PC_PHYS_PORT_ID: 285 + ? + PORT_ID: 194 + : + PC_PHYS_PORT_ID: 287 + ? + PORT_ID: 198 + : + PC_PHYS_PORT_ID: 289 + ? + PORT_ID: 199 + : + PC_PHYS_PORT_ID: 291 + ? + PORT_ID: 200 + : + PC_PHYS_PORT_ID: 293 + ? + PORT_ID: 201 + : + PC_PHYS_PORT_ID: 295 + ? + PORT_ID: 202 + : + PC_PHYS_PORT_ID: 297 + ? + PORT_ID: 203 + : + PC_PHYS_PORT_ID: 299 + ? + PORT_ID: 204 + : + PC_PHYS_PORT_ID: 301 + ? + PORT_ID: 205 + : + PC_PHYS_PORT_ID: 303 + ? + PORT_ID: 209 + : + PC_PHYS_PORT_ID: 305 + ? + PORT_ID: 210 + : + PC_PHYS_PORT_ID: 307 + ? + PORT_ID: 211 + : + PC_PHYS_PORT_ID: 309 + ? + PORT_ID: 212 + : + PC_PHYS_PORT_ID: 311 + ? + PORT_ID: 213 + : + PC_PHYS_PORT_ID: 313 + ? + PORT_ID: 214 + : + PC_PHYS_PORT_ID: 315 + ? + PORT_ID: 215 + : + PC_PHYS_PORT_ID: 317 + ? + PORT_ID: 216 + : + PC_PHYS_PORT_ID: 319 + ? + PORT_ID: 220 + : + PC_PHYS_PORT_ID: 321 + ? + PORT_ID: 221 + : + PC_PHYS_PORT_ID: 323 + ? + PORT_ID: 222 + : + PC_PHYS_PORT_ID: 325 + ? + PORT_ID: 223 + : + PC_PHYS_PORT_ID: 327 + ? + PORT_ID: 224 + : + PC_PHYS_PORT_ID: 329 + ? + PORT_ID: 225 + : + PC_PHYS_PORT_ID: 331 + ? + PORT_ID: 226 + : + PC_PHYS_PORT_ID: 333 + ? + PORT_ID: 227 + : + PC_PHYS_PORT_ID: 335 + ? + PORT_ID: 231 + : + PC_PHYS_PORT_ID: 337 + ? + PORT_ID: 232 + : + PC_PHYS_PORT_ID: 339 + ? + PORT_ID: 233 + : + PC_PHYS_PORT_ID: 341 + ? + PORT_ID: 234 + : + PC_PHYS_PORT_ID: 343 + ? + PORT_ID: 235 + : + PC_PHYS_PORT_ID: 345 + ? + PORT_ID: 236 + : + PC_PHYS_PORT_ID: 347 + ? + PORT_ID: 237 + : + PC_PHYS_PORT_ID: 349 + ? + PORT_ID: 238 + : + PC_PHYS_PORT_ID: 351 + ? + PORT_ID: 242 + : + PC_PHYS_PORT_ID: 353 + ? + PORT_ID: 243 + : + PC_PHYS_PORT_ID: 355 + ? + PORT_ID: 244 + : + PC_PHYS_PORT_ID: 357 + ? + PORT_ID: 245 + : + PC_PHYS_PORT_ID: 359 + ? + PORT_ID: 246 + : + PC_PHYS_PORT_ID: 361 + ? + PORT_ID: 247 + : + PC_PHYS_PORT_ID: 363 + ? + PORT_ID: 248 + : + PC_PHYS_PORT_ID: 365 + ? + PORT_ID: 249 + : + PC_PHYS_PORT_ID: 367 + ? + PORT_ID: 253 + : + PC_PHYS_PORT_ID: 369 + ? + PORT_ID: 254 + : + PC_PHYS_PORT_ID: 371 + ? + PORT_ID: 255 + : + PC_PHYS_PORT_ID: 373 + ? + PORT_ID: 256 + : + PC_PHYS_PORT_ID: 375 + ? + PORT_ID: 257 + : + PC_PHYS_PORT_ID: 377 + ? + PORT_ID: 258 + : + PC_PHYS_PORT_ID: 379 + ? + PORT_ID: 259 + : + PC_PHYS_PORT_ID: 381 + ? + PORT_ID: 260 + : + PC_PHYS_PORT_ID: 383 + ? + PORT_ID: 264 + : + PC_PHYS_PORT_ID: 385 + ? + PORT_ID: 265 + : + PC_PHYS_PORT_ID: 387 + ? + PORT_ID: 266 + : + PC_PHYS_PORT_ID: 389 + ? + PORT_ID: 267 + : + PC_PHYS_PORT_ID: 391 + ? + PORT_ID: 268 + : + PC_PHYS_PORT_ID: 393 + ? + PORT_ID: 269 + : + PC_PHYS_PORT_ID: 395 + ? + PORT_ID: 270 + : + PC_PHYS_PORT_ID: 397 + ? + PORT_ID: 271 + : + PC_PHYS_PORT_ID: 399 + ? + PORT_ID: 275 + : + PC_PHYS_PORT_ID: 401 + ? + PORT_ID: 276 + : + PC_PHYS_PORT_ID: 403 + ? + PORT_ID: 277 + : + PC_PHYS_PORT_ID: 405 + ? + PORT_ID: 278 + : + PC_PHYS_PORT_ID: 407 + ? + PORT_ID: 279 + : + PC_PHYS_PORT_ID: 409 + ? + PORT_ID: 280 + : + PC_PHYS_PORT_ID: 411 + ? + PORT_ID: 281 + : + PC_PHYS_PORT_ID: 413 + ? + PORT_ID: 282 + : + PC_PHYS_PORT_ID: 415 + ? + PORT_ID: 286 + : + PC_PHYS_PORT_ID: 417 + ? + PORT_ID: 287 + : + PC_PHYS_PORT_ID: 419 + ? + PORT_ID: 288 + : + PC_PHYS_PORT_ID: 421 + ? + PORT_ID: 289 + : + PC_PHYS_PORT_ID: 423 + ? + PORT_ID: 290 + : + PC_PHYS_PORT_ID: 425 + ? + PORT_ID: 291 + : + PC_PHYS_PORT_ID: 427 + ? + PORT_ID: 292 + : + PC_PHYS_PORT_ID: 429 + ? + PORT_ID: 293 + : + PC_PHYS_PORT_ID: 431 + ? + PORT_ID: 297 + : + PC_PHYS_PORT_ID: 433 + ? + PORT_ID: 298 + : + PC_PHYS_PORT_ID: 435 + ? + PORT_ID: 299 + : + PC_PHYS_PORT_ID: 437 + ? + PORT_ID: 300 + : + PC_PHYS_PORT_ID: 439 + ? + PORT_ID: 301 + : + PC_PHYS_PORT_ID: 441 + ? + PORT_ID: 302 + : + PC_PHYS_PORT_ID: 443 + ? + PORT_ID: 303 + : + PC_PHYS_PORT_ID: 445 + ? + PORT_ID: 304 + : + PC_PHYS_PORT_ID: 447 + ? + PORT_ID: 308 + : + PC_PHYS_PORT_ID: 449 + ? + PORT_ID: 309 + : + PC_PHYS_PORT_ID: 451 + ? + PORT_ID: 310 + : + PC_PHYS_PORT_ID: 453 + ? + PORT_ID: 311 + : + PC_PHYS_PORT_ID: 455 + ? + PORT_ID: 312 + : + PC_PHYS_PORT_ID: 457 + ? + PORT_ID: 313 + : + PC_PHYS_PORT_ID: 459 + ? + PORT_ID: 314 + : + PC_PHYS_PORT_ID: 461 + ? + PORT_ID: 315 + : + PC_PHYS_PORT_ID: 463 + ? + PORT_ID: 319 + : + PC_PHYS_PORT_ID: 465 + ? + PORT_ID: 320 + : + PC_PHYS_PORT_ID: 467 + ? + PORT_ID: 321 + : + PC_PHYS_PORT_ID: 469 + ? + PORT_ID: 322 + : + PC_PHYS_PORT_ID: 471 + ? + PORT_ID: 323 + : + PC_PHYS_PORT_ID: 473 + ? + PORT_ID: 324 + : + PC_PHYS_PORT_ID: 475 + ? + PORT_ID: 325 + : + PC_PHYS_PORT_ID: 477 + ? + PORT_ID: 326 + : + PC_PHYS_PORT_ID: 479 + ? + PORT_ID: 330 + : + PC_PHYS_PORT_ID: 481 + ? + PORT_ID: 331 + : + PC_PHYS_PORT_ID: 483 + ? + PORT_ID: 332 + : + PC_PHYS_PORT_ID: 485 + ? + PORT_ID: 333 + : + PC_PHYS_PORT_ID: 487 + ? + PORT_ID: 334 + : + PC_PHYS_PORT_ID: 489 + ? + PORT_ID: 335 + : + PC_PHYS_PORT_ID: 491 + ? + PORT_ID: 336 + : + PC_PHYS_PORT_ID: 493 + ? + PORT_ID: 337 + : + PC_PHYS_PORT_ID: 495 + ? + PORT_ID: 341 + : + PC_PHYS_PORT_ID: 497 + ? + PORT_ID: 342 + : + PC_PHYS_PORT_ID: 499 + ? + PORT_ID: 343 + : + PC_PHYS_PORT_ID: 501 + ? + PORT_ID: 344 + : + PC_PHYS_PORT_ID: 503 + ? + PORT_ID: 345 + : + PC_PHYS_PORT_ID: 505 + ? + PORT_ID: 346 + : + PC_PHYS_PORT_ID: 507 + ? + PORT_ID: 347 + : + PC_PHYS_PORT_ID: 509 + ? + PORT_ID: 348 + : + PC_PHYS_PORT_ID: 511 +... +--- +device: + 0: + PC_PORT: + ? + PORT_ID: [[1, 8], + [11, 18], + [22, 29], + [33, 40], + [44, 51], + [55, 62], + [66, 73], + [77, 84], + [88, 95], + [99, 106], + [110, 117], + [121, 128], + [132, 139], + [143, 150], + [154, 161], + [165, 172], + [176, 183], + [187, 194], + [198, 205], + [209, 216], + [220, 227], + [231, 238], + [242, 249], + [253, 260], + [264, 271], + [275, 282], + [286, 293], + [297, 304], + [308, 315], + [319, 326], + [330, 337], + [341, 348]] + : + ENABLE: 0 + SPEED: 200000 + NUM_LANES: 2 + FEC_MODE: PC_FEC_RS544_2XN + MAX_FRAME_SIZE: 9416 +... +--- +bcm_device: + 0: + global: + ftem_mem_entries: 65536 +... +--- +device: + 0: + # Per pipe flex counter configuration + CTR_EFLEX_CONFIG: + CTR_ING_EFLEX_OPERMODE_PIPEUNIQUE: 0 + CTR_EGR_EFLEX_OPERMODE_PIPEUNIQUE: 0 + + # IFP mode + FP_CONFIG: + FP_ING_OPERMODE: GLOBAL_PIPE_AWARE +... +--- +device: + 0: + DEVICE_CONFIG: + AUTOLOAD_BOARD_SETTINGS: 0 +... From 830a1bf9582a168652d3a19e9fe63cef5e6b030f Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Mon, 6 May 2024 08:54:52 -0700 Subject: [PATCH 278/419] Add 4x200G breakout in platform.json --- .../x86_64-arista_7060x6_64pe/platform.json | 386 +++++++++++++++++- 1 file changed, 385 insertions(+), 1 deletion(-) diff --git a/device/arista/x86_64-arista_7060x6_64pe/platform.json b/device/arista/x86_64-arista_7060x6_64pe/platform.json index a249a56b4c47..45c564a126f9 100644 --- a/device/arista/x86_64-arista_7060x6_64pe/platform.json +++ b/device/arista/x86_64-arista_7060x6_64pe/platform.json @@ -321,6 +321,12 @@ "2x400G": [ "Ethernet1/1", "Ethernet1/5" + ], + "4x200G": [ + "Ethernet1/1", + "Ethernet1/3", + "Ethernet1/5", + "Ethernet1/7" ] } }, @@ -337,6 +343,12 @@ "2x400G": [ "Ethernet2/1", "Ethernet2/5" + ], + "4x200G": [ + "Ethernet2/1", + "Ethernet2/3", + "Ethernet2/5", + "Ethernet2/7" ] } }, @@ -353,6 +365,12 @@ "2x400G": [ "Ethernet3/1", "Ethernet3/5" + ], + "4x200G": [ + "Ethernet3/1", + "Ethernet3/3", + "Ethernet3/5", + "Ethernet3/7" ] } }, @@ -369,6 +387,12 @@ "2x400G": [ "Ethernet4/1", "Ethernet4/5" + ], + "4x200G": [ + "Ethernet4/1", + "Ethernet4/3", + "Ethernet4/5", + "Ethernet4/7" ] } }, @@ -385,6 +409,12 @@ "2x400G": [ "Ethernet5/1", "Ethernet5/5" + ], + "4x200G": [ + "Ethernet5/1", + "Ethernet5/3", + "Ethernet5/5", + "Ethernet5/7" ] } }, @@ -401,6 +431,12 @@ "2x400G": [ "Ethernet6/1", "Ethernet6/5" + ], + "4x200G": [ + "Ethernet6/1", + "Ethernet6/3", + "Ethernet6/5", + "Ethernet6/7" ] } }, @@ -417,6 +453,12 @@ "2x400G": [ "Ethernet7/1", "Ethernet7/5" + ], + "4x200G": [ + "Ethernet7/1", + "Ethernet7/3", + "Ethernet7/5", + "Ethernet7/7" ] } }, @@ -433,6 +475,12 @@ "2x400G": [ "Ethernet8/1", "Ethernet8/5" + ], + "4x200G": [ + "Ethernet8/1", + "Ethernet8/3", + "Ethernet8/5", + "Ethernet8/7" ] } }, @@ -449,6 +497,12 @@ "2x400G": [ "Ethernet9/1", "Ethernet9/5" + ], + "4x200G": [ + "Ethernet9/1", + "Ethernet9/3", + "Ethernet9/5", + "Ethernet9/7" ] } }, @@ -465,6 +519,12 @@ "2x400G": [ "Ethernet10/1", "Ethernet10/5" + ], + "4x200G": [ + "Ethernet10/1", + "Ethernet10/3", + "Ethernet10/5", + "Ethernet10/7" ] } }, @@ -481,6 +541,12 @@ "2x400G": [ "Ethernet11/1", "Ethernet11/5" + ], + "4x200G": [ + "Ethernet11/1", + "Ethernet11/3", + "Ethernet11/5", + "Ethernet11/7" ] } }, @@ -497,6 +563,12 @@ "2x400G": [ "Ethernet12/1", "Ethernet12/5" + ], + "4x200G": [ + "Ethernet12/1", + "Ethernet12/3", + "Ethernet12/5", + "Ethernet12/7" ] } }, @@ -513,6 +585,12 @@ "2x400G": [ "Ethernet13/1", "Ethernet13/5" + ], + "4x200G": [ + "Ethernet13/1", + "Ethernet13/3", + "Ethernet13/5", + "Ethernet13/7" ] } }, @@ -529,6 +607,12 @@ "2x400G": [ "Ethernet14/1", "Ethernet14/5" + ], + "4x200G": [ + "Ethernet14/1", + "Ethernet14/3", + "Ethernet14/5", + "Ethernet14/7" ] } }, @@ -545,6 +629,12 @@ "2x400G": [ "Ethernet15/1", "Ethernet15/5" + ], + "4x200G": [ + "Ethernet15/1", + "Ethernet15/3", + "Ethernet15/5", + "Ethernet15/7" ] } }, @@ -561,6 +651,12 @@ "2x400G": [ "Ethernet16/1", "Ethernet16/5" + ], + "4x200G": [ + "Ethernet16/1", + "Ethernet16/3", + "Ethernet16/5", + "Ethernet16/7" ] } }, @@ -577,6 +673,12 @@ "2x400G": [ "Ethernet17/1", "Ethernet17/5" + ], + "4x200G": [ + "Ethernet17/1", + "Ethernet17/3", + "Ethernet17/5", + "Ethernet17/7" ] } }, @@ -593,6 +695,12 @@ "2x400G": [ "Ethernet18/1", "Ethernet18/5" + ], + "4x200G": [ + "Ethernet18/1", + "Ethernet18/3", + "Ethernet18/5", + "Ethernet18/7" ] } }, @@ -609,6 +717,12 @@ "2x400G": [ "Ethernet19/1", "Ethernet19/5" + ], + "4x200G": [ + "Ethernet19/1", + "Ethernet19/3", + "Ethernet19/5", + "Ethernet19/7" ] } }, @@ -625,6 +739,12 @@ "2x400G": [ "Ethernet20/1", "Ethernet20/5" + ], + "4x200G": [ + "Ethernet20/1", + "Ethernet20/3", + "Ethernet20/5", + "Ethernet20/7" ] } }, @@ -641,6 +761,12 @@ "2x400G": [ "Ethernet21/1", "Ethernet21/5" + ], + "4x200G": [ + "Ethernet21/1", + "Ethernet21/3", + "Ethernet21/5", + "Ethernet21/7" ] } }, @@ -657,6 +783,12 @@ "2x400G": [ "Ethernet22/1", "Ethernet22/5" + ], + "4x200G": [ + "Ethernet22/1", + "Ethernet22/3", + "Ethernet22/5", + "Ethernet22/7" ] } }, @@ -673,6 +805,12 @@ "2x400G": [ "Ethernet23/1", "Ethernet23/5" + ], + "4x200G": [ + "Ethernet23/1", + "Ethernet23/3", + "Ethernet23/5", + "Ethernet23/7" ] } }, @@ -689,6 +827,12 @@ "2x400G": [ "Ethernet24/1", "Ethernet24/5" + ], + "4x200G": [ + "Ethernet24/1", + "Ethernet24/3", + "Ethernet24/5", + "Ethernet24/7" ] } }, @@ -705,6 +849,12 @@ "2x400G": [ "Ethernet25/1", "Ethernet25/5" + ], + "4x200G": [ + "Ethernet25/1", + "Ethernet25/3", + "Ethernet25/5", + "Ethernet25/7" ] } }, @@ -721,6 +871,12 @@ "2x400G": [ "Ethernet26/1", "Ethernet26/5" + ], + "4x200G": [ + "Ethernet26/1", + "Ethernet26/3", + "Ethernet26/5", + "Ethernet26/7" ] } }, @@ -737,6 +893,12 @@ "2x400G": [ "Ethernet27/1", "Ethernet27/5" + ], + "4x200G": [ + "Ethernet27/1", + "Ethernet27/3", + "Ethernet27/5", + "Ethernet27/7" ] } }, @@ -753,6 +915,12 @@ "2x400G": [ "Ethernet28/1", "Ethernet28/5" + ], + "4x200G": [ + "Ethernet28/1", + "Ethernet28/3", + "Ethernet28/5", + "Ethernet28/7" ] } }, @@ -769,6 +937,12 @@ "2x400G": [ "Ethernet29/1", "Ethernet29/5" + ], + "4x200G": [ + "Ethernet29/1", + "Ethernet29/3", + "Ethernet29/5", + "Ethernet29/7" ] } }, @@ -785,6 +959,12 @@ "2x400G": [ "Ethernet30/1", "Ethernet30/5" + ], + "4x200G": [ + "Ethernet30/1", + "Ethernet30/3", + "Ethernet30/5", + "Ethernet30/7" ] } }, @@ -801,6 +981,12 @@ "2x400G": [ "Ethernet31/1", "Ethernet31/5" + ], + "4x200G": [ + "Ethernet31/1", + "Ethernet31/3", + "Ethernet31/5", + "Ethernet31/7" ] } }, @@ -817,6 +1003,12 @@ "2x400G": [ "Ethernet32/1", "Ethernet32/5" + ], + "4x200G": [ + "Ethernet32/1", + "Ethernet32/3", + "Ethernet32/5", + "Ethernet32/7" ] } }, @@ -833,6 +1025,12 @@ "2x400G": [ "Ethernet33/1", "Ethernet33/5" + ], + "4x200G": [ + "Ethernet33/1", + "Ethernet33/3", + "Ethernet33/5", + "Ethernet33/7" ] } }, @@ -849,6 +1047,12 @@ "2x400G": [ "Ethernet34/1", "Ethernet34/5" + ], + "4x200G": [ + "Ethernet34/1", + "Ethernet34/3", + "Ethernet34/5", + "Ethernet34/7" ] } }, @@ -865,6 +1069,12 @@ "2x400G": [ "Ethernet35/1", "Ethernet35/5" + ], + "4x200G": [ + "Ethernet35/1", + "Ethernet35/3", + "Ethernet35/5", + "Ethernet35/7" ] } }, @@ -881,6 +1091,12 @@ "2x400G": [ "Ethernet36/1", "Ethernet36/5" + ], + "4x200G": [ + "Ethernet36/1", + "Ethernet36/3", + "Ethernet36/5", + "Ethernet36/7" ] } }, @@ -897,6 +1113,12 @@ "2x400G": [ "Ethernet37/1", "Ethernet37/5" + ], + "4x200G": [ + "Ethernet37/1", + "Ethernet37/3", + "Ethernet37/5", + "Ethernet37/7" ] } }, @@ -913,6 +1135,12 @@ "2x400G": [ "Ethernet38/1", "Ethernet38/5" + ], + "4x200G": [ + "Ethernet38/1", + "Ethernet38/3", + "Ethernet38/5", + "Ethernet38/7" ] } }, @@ -929,6 +1157,12 @@ "2x400G": [ "Ethernet39/1", "Ethernet39/5" + ], + "4x200G": [ + "Ethernet39/1", + "Ethernet39/3", + "Ethernet39/5", + "Ethernet39/7" ] } }, @@ -945,6 +1179,12 @@ "2x400G": [ "Ethernet40/1", "Ethernet40/5" + ], + "4x200G": [ + "Ethernet40/1", + "Ethernet40/3", + "Ethernet40/5", + "Ethernet40/7" ] } }, @@ -961,6 +1201,12 @@ "2x400G": [ "Ethernet41/1", "Ethernet41/5" + ], + "4x200G": [ + "Ethernet41/1", + "Ethernet41/3", + "Ethernet41/5", + "Ethernet41/7" ] } }, @@ -977,6 +1223,12 @@ "2x400G": [ "Ethernet42/1", "Ethernet42/5" + ], + "4x200G": [ + "Ethernet42/1", + "Ethernet42/3", + "Ethernet42/5", + "Ethernet42/7" ] } }, @@ -993,6 +1245,12 @@ "2x400G": [ "Ethernet43/1", "Ethernet43/5" + ], + "4x200G": [ + "Ethernet43/1", + "Ethernet43/3", + "Ethernet43/5", + "Ethernet43/7" ] } }, @@ -1009,6 +1267,12 @@ "2x400G": [ "Ethernet44/1", "Ethernet44/5" + ], + "4x200G": [ + "Ethernet44/1", + "Ethernet44/3", + "Ethernet44/5", + "Ethernet44/7" ] } }, @@ -1025,6 +1289,12 @@ "2x400G": [ "Ethernet45/1", "Ethernet45/5" + ], + "4x200G": [ + "Ethernet45/1", + "Ethernet45/3", + "Ethernet45/5", + "Ethernet45/7" ] } }, @@ -1041,6 +1311,12 @@ "2x400G": [ "Ethernet46/1", "Ethernet46/5" + ], + "4x200G": [ + "Ethernet46/1", + "Ethernet46/3", + "Ethernet46/5", + "Ethernet46/7" ] } }, @@ -1057,6 +1333,12 @@ "2x400G": [ "Ethernet47/1", "Ethernet47/5" + ], + "4x200G": [ + "Ethernet47/1", + "Ethernet47/3", + "Ethernet47/5", + "Ethernet47/7" ] } }, @@ -1073,6 +1355,12 @@ "2x400G": [ "Ethernet48/1", "Ethernet48/5" + ], + "4x200G": [ + "Ethernet48/1", + "Ethernet48/3", + "Ethernet48/5", + "Ethernet48/7" ] } }, @@ -1089,6 +1377,12 @@ "2x400G": [ "Ethernet49/1", "Ethernet49/5" + ], + "4x200G": [ + "Ethernet49/1", + "Ethernet49/3", + "Ethernet49/5", + "Ethernet49/7" ] } }, @@ -1105,6 +1399,12 @@ "2x400G": [ "Ethernet50/1", "Ethernet50/5" + ], + "4x200G": [ + "Ethernet50/1", + "Ethernet50/3", + "Ethernet50/5", + "Ethernet50/7" ] } }, @@ -1121,6 +1421,12 @@ "2x400G": [ "Ethernet51/1", "Ethernet51/5" + ], + "4x200G": [ + "Ethernet51/1", + "Ethernet51/3", + "Ethernet51/5", + "Ethernet51/7" ] } }, @@ -1137,6 +1443,12 @@ "2x400G": [ "Ethernet52/1", "Ethernet52/5" + ], + "4x200G": [ + "Ethernet52/1", + "Ethernet52/3", + "Ethernet52/5", + "Ethernet52/7" ] } }, @@ -1153,6 +1465,12 @@ "2x400G": [ "Ethernet53/1", "Ethernet53/5" + ], + "4x200G": [ + "Ethernet53/1", + "Ethernet53/3", + "Ethernet53/5", + "Ethernet53/7" ] } }, @@ -1169,6 +1487,12 @@ "2x400G": [ "Ethernet54/1", "Ethernet54/5" + ], + "4x200G": [ + "Ethernet54/1", + "Ethernet54/3", + "Ethernet54/5", + "Ethernet54/7" ] } }, @@ -1185,6 +1509,12 @@ "2x400G": [ "Ethernet55/1", "Ethernet55/5" + ], + "4x200G": [ + "Ethernet55/1", + "Ethernet55/3", + "Ethernet55/5", + "Ethernet55/7" ] } }, @@ -1201,6 +1531,12 @@ "2x400G": [ "Ethernet56/1", "Ethernet56/5" + ], + "4x200G": [ + "Ethernet56/1", + "Ethernet56/3", + "Ethernet56/5", + "Ethernet56/7" ] } }, @@ -1217,6 +1553,12 @@ "2x400G": [ "Ethernet57/1", "Ethernet57/5" + ], + "4x200G": [ + "Ethernet57/1", + "Ethernet57/3", + "Ethernet57/5", + "Ethernet57/7" ] } }, @@ -1233,6 +1575,12 @@ "2x400G": [ "Ethernet58/1", "Ethernet58/5" + ], + "4x200G": [ + "Ethernet58/1", + "Ethernet58/3", + "Ethernet58/5", + "Ethernet58/7" ] } }, @@ -1249,6 +1597,12 @@ "2x400G": [ "Ethernet59/1", "Ethernet59/5" + ], + "4x200G": [ + "Ethernet59/1", + "Ethernet59/3", + "Ethernet59/5", + "Ethernet59/7" ] } }, @@ -1265,6 +1619,12 @@ "2x400G": [ "Ethernet60/1", "Ethernet60/5" + ], + "4x200G": [ + "Ethernet60/1", + "Ethernet60/3", + "Ethernet60/5", + "Ethernet60/7" ] } }, @@ -1281,6 +1641,12 @@ "2x400G": [ "Ethernet61/1", "Ethernet61/5" + ], + "4x200G": [ + "Ethernet61/1", + "Ethernet61/3", + "Ethernet61/5", + "Ethernet61/7" ] } }, @@ -1297,6 +1663,12 @@ "2x400G": [ "Ethernet62/1", "Ethernet62/5" + ], + "4x200G": [ + "Ethernet62/1", + "Ethernet62/3", + "Ethernet62/5", + "Ethernet62/7" ] } }, @@ -1313,6 +1685,12 @@ "2x400G": [ "Ethernet63/1", "Ethernet63/5" + ], + "4x200G": [ + "Ethernet63/1", + "Ethernet63/3", + "Ethernet63/5", + "Ethernet63/7" ] } }, @@ -1329,8 +1707,14 @@ "2x400G": [ "Ethernet64/1", "Ethernet64/5" + ], + "4x200G": [ + "Ethernet64/1", + "Ethernet64/3", + "Ethernet64/5", + "Ethernet64/7" ] } } } -} +} \ No newline at end of file From 234bf2895847039963367750aa29dabf05a6fb1f Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Tue, 7 May 2024 17:36:21 +0200 Subject: [PATCH 279/419] [Arista]: Add new 256x200G profile for QuicksilverDd (#18894) Add new HwSku to support 256x200G breakouts on QuicksilverDD --- .../Arista-7060X6-64DE-256x200G/hwsku.json | 196 ++ .../port_config.ini | 257 +++ .../Arista-7060X6-64DE-256x200G/sai.profile | 1 + .../th5-a7060x6-64de.config.bcm | 1913 +++++++++++++++++ .../x86_64-arista_7060x6_64de/platform.json | 386 +++- 5 files changed, 2752 insertions(+), 1 deletion(-) create mode 100644 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/hwsku.json create mode 100644 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/port_config.ini create mode 100644 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/sai.profile create mode 100644 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/th5-a7060x6-64de.config.bcm diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/hwsku.json b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/hwsku.json new file mode 100644 index 000000000000..f30bfc4a06f2 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/hwsku.json @@ -0,0 +1,196 @@ +{ + "interfaces": { + "Ethernet0": { + "default_brkout_mode": "4x200G" + }, + "Ethernet8": { + "default_brkout_mode": "4x200G" + }, + "Ethernet16": { + "default_brkout_mode": "4x200G" + }, + "Ethernet24": { + "default_brkout_mode": "4x200G" + }, + "Ethernet32": { + "default_brkout_mode": "4x200G" + }, + "Ethernet40": { + "default_brkout_mode": "4x200G" + }, + "Ethernet48": { + "default_brkout_mode": "4x200G" + }, + "Ethernet56": { + "default_brkout_mode": "4x200G" + }, + "Ethernet64": { + "default_brkout_mode": "4x200G" + }, + "Ethernet72": { + "default_brkout_mode": "4x200G" + }, + "Ethernet80": { + "default_brkout_mode": "4x200G" + }, + "Ethernet88": { + "default_brkout_mode": "4x200G" + }, + "Ethernet96": { + "default_brkout_mode": "4x200G" + }, + "Ethernet104": { + "default_brkout_mode": "4x200G" + }, + "Ethernet112": { + "default_brkout_mode": "4x200G" + }, + "Ethernet120": { + "default_brkout_mode": "4x200G" + }, + "Ethernet128": { + "default_brkout_mode": "4x200G" + }, + "Ethernet136": { + "default_brkout_mode": "4x200G" + }, + "Ethernet144": { + "default_brkout_mode": "4x200G" + }, + "Ethernet152": { + "default_brkout_mode": "4x200G" + }, + "Ethernet160": { + "default_brkout_mode": "4x200G" + }, + "Ethernet168": { + "default_brkout_mode": "4x200G" + }, + "Ethernet176": { + "default_brkout_mode": "4x200G" + }, + "Ethernet184": { + "default_brkout_mode": "4x200G" + }, + "Ethernet192": { + "default_brkout_mode": "4x200G" + }, + "Ethernet200": { + "default_brkout_mode": "4x200G" + }, + "Ethernet208": { + "default_brkout_mode": "4x200G" + }, + "Ethernet216": { + "default_brkout_mode": "4x200G" + }, + "Ethernet224": { + "default_brkout_mode": "4x200G" + }, + "Ethernet232": { + "default_brkout_mode": "4x200G" + }, + "Ethernet240": { + "default_brkout_mode": "4x200G" + }, + "Ethernet248": { + "default_brkout_mode": "4x200G" + }, + "Ethernet256": { + "default_brkout_mode": "4x200G" + }, + "Ethernet264": { + "default_brkout_mode": "4x200G" + }, + "Ethernet272": { + "default_brkout_mode": "4x200G" + }, + "Ethernet280": { + "default_brkout_mode": "4x200G" + }, + "Ethernet288": { + "default_brkout_mode": "4x200G" + }, + "Ethernet296": { + "default_brkout_mode": "4x200G" + }, + "Ethernet304": { + "default_brkout_mode": "4x200G" + }, + "Ethernet312": { + "default_brkout_mode": "4x200G" + }, + "Ethernet320": { + "default_brkout_mode": "4x200G" + }, + "Ethernet328": { + "default_brkout_mode": "4x200G" + }, + "Ethernet336": { + "default_brkout_mode": "4x200G" + }, + "Ethernet344": { + "default_brkout_mode": "4x200G" + }, + "Ethernet352": { + "default_brkout_mode": "4x200G" + }, + "Ethernet360": { + "default_brkout_mode": "4x200G" + }, + "Ethernet368": { + "default_brkout_mode": "4x200G" + }, + "Ethernet376": { + "default_brkout_mode": "4x200G" + }, + "Ethernet384": { + "default_brkout_mode": "4x200G" + }, + "Ethernet392": { + "default_brkout_mode": "4x200G" + }, + "Ethernet400": { + "default_brkout_mode": "4x200G" + }, + "Ethernet408": { + "default_brkout_mode": "4x200G" + }, + "Ethernet416": { + "default_brkout_mode": "4x200G" + }, + "Ethernet424": { + "default_brkout_mode": "4x200G" + }, + "Ethernet432": { + "default_brkout_mode": "4x200G" + }, + "Ethernet440": { + "default_brkout_mode": "4x200G" + }, + "Ethernet448": { + "default_brkout_mode": "4x200G" + }, + "Ethernet456": { + "default_brkout_mode": "4x200G" + }, + "Ethernet464": { + "default_brkout_mode": "4x200G" + }, + "Ethernet472": { + "default_brkout_mode": "4x200G" + }, + "Ethernet480": { + "default_brkout_mode": "4x200G" + }, + "Ethernet488": { + "default_brkout_mode": "4x200G" + }, + "Ethernet496": { + "default_brkout_mode": "4x200G" + }, + "Ethernet504": { + "default_brkout_mode": "4x200G" + } + } +} diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/port_config.ini b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/port_config.ini new file mode 100644 index 000000000000..323b8e2612eb --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/port_config.ini @@ -0,0 +1,257 @@ +# name lanes alias index speed fec +Ethernet0 17,18 Ethernet1/1 1 200000 rs +Ethernet2 19,20 Ethernet1/3 1 200000 rs +Ethernet4 21,22 Ethernet1/5 1 200000 rs +Ethernet6 23,24 Ethernet1/7 1 200000 rs +Ethernet8 1,2 Ethernet2/1 2 200000 rs +Ethernet10 3,4 Ethernet2/3 2 200000 rs +Ethernet12 5,6 Ethernet2/5 2 200000 rs +Ethernet14 7,8 Ethernet2/7 2 200000 rs +Ethernet16 9,10 Ethernet3/1 3 200000 rs +Ethernet18 11,12 Ethernet3/3 3 200000 rs +Ethernet20 13,14 Ethernet3/5 3 200000 rs +Ethernet22 15,16 Ethernet3/7 3 200000 rs +Ethernet24 25,26 Ethernet4/1 4 200000 rs +Ethernet26 27,28 Ethernet4/3 4 200000 rs +Ethernet28 29,30 Ethernet4/5 4 200000 rs +Ethernet30 31,32 Ethernet4/7 4 200000 rs +Ethernet32 57,58 Ethernet5/1 5 200000 rs +Ethernet34 59,60 Ethernet5/3 5 200000 rs +Ethernet36 61,62 Ethernet5/5 5 200000 rs +Ethernet38 63,64 Ethernet5/7 5 200000 rs +Ethernet40 41,42 Ethernet6/1 6 200000 rs +Ethernet42 43,44 Ethernet6/3 6 200000 rs +Ethernet44 45,46 Ethernet6/5 6 200000 rs +Ethernet46 47,48 Ethernet6/7 6 200000 rs +Ethernet48 33,34 Ethernet7/1 7 200000 rs +Ethernet50 35,36 Ethernet7/3 7 200000 rs +Ethernet52 37,38 Ethernet7/5 7 200000 rs +Ethernet54 39,40 Ethernet7/7 7 200000 rs +Ethernet56 49,50 Ethernet8/1 8 200000 rs +Ethernet58 51,52 Ethernet8/3 8 200000 rs +Ethernet60 53,54 Ethernet8/5 8 200000 rs +Ethernet62 55,56 Ethernet8/7 8 200000 rs +Ethernet64 89,90 Ethernet9/1 9 200000 rs +Ethernet66 91,92 Ethernet9/3 9 200000 rs +Ethernet68 93,94 Ethernet9/5 9 200000 rs +Ethernet70 95,96 Ethernet9/7 9 200000 rs +Ethernet72 73,74 Ethernet10/1 10 200000 rs +Ethernet74 75,76 Ethernet10/3 10 200000 rs +Ethernet76 77,78 Ethernet10/5 10 200000 rs +Ethernet78 79,80 Ethernet10/7 10 200000 rs +Ethernet80 65,66 Ethernet11/1 11 200000 rs +Ethernet82 67,68 Ethernet11/3 11 200000 rs +Ethernet84 69,70 Ethernet11/5 11 200000 rs +Ethernet86 71,72 Ethernet11/7 11 200000 rs +Ethernet88 81,82 Ethernet12/1 12 200000 rs +Ethernet90 83,84 Ethernet12/3 12 200000 rs +Ethernet92 85,86 Ethernet12/5 12 200000 rs +Ethernet94 87,88 Ethernet12/7 12 200000 rs +Ethernet96 121,122 Ethernet13/1 13 200000 rs +Ethernet98 123,124 Ethernet13/3 13 200000 rs +Ethernet100 125,126 Ethernet13/5 13 200000 rs +Ethernet102 127,128 Ethernet13/7 13 200000 rs +Ethernet104 105,106 Ethernet14/1 14 200000 rs +Ethernet106 107,108 Ethernet14/3 14 200000 rs +Ethernet108 109,110 Ethernet14/5 14 200000 rs +Ethernet110 111,112 Ethernet14/7 14 200000 rs +Ethernet112 97,98 Ethernet15/1 15 200000 rs +Ethernet114 99,100 Ethernet15/3 15 200000 rs +Ethernet116 101,102 Ethernet15/5 15 200000 rs +Ethernet118 103,104 Ethernet15/7 15 200000 rs +Ethernet120 113,114 Ethernet16/1 16 200000 rs +Ethernet122 115,116 Ethernet16/3 16 200000 rs +Ethernet124 117,118 Ethernet16/5 16 200000 rs +Ethernet126 119,120 Ethernet16/7 16 200000 rs +Ethernet128 153,154 Ethernet17/1 17 200000 rs +Ethernet130 155,156 Ethernet17/3 17 200000 rs +Ethernet132 157,158 Ethernet17/5 17 200000 rs +Ethernet134 159,160 Ethernet17/7 17 200000 rs +Ethernet136 137,138 Ethernet18/1 18 200000 rs +Ethernet138 139,140 Ethernet18/3 18 200000 rs +Ethernet140 141,142 Ethernet18/5 18 200000 rs +Ethernet142 143,144 Ethernet18/7 18 200000 rs +Ethernet144 129,130 Ethernet19/1 19 200000 rs +Ethernet146 131,132 Ethernet19/3 19 200000 rs +Ethernet148 133,134 Ethernet19/5 19 200000 rs +Ethernet150 135,136 Ethernet19/7 19 200000 rs +Ethernet152 145,146 Ethernet20/1 20 200000 rs +Ethernet154 147,148 Ethernet20/3 20 200000 rs +Ethernet156 149,150 Ethernet20/5 20 200000 rs +Ethernet158 151,152 Ethernet20/7 20 200000 rs +Ethernet160 185,186 Ethernet21/1 21 200000 rs +Ethernet162 187,188 Ethernet21/3 21 200000 rs +Ethernet164 189,190 Ethernet21/5 21 200000 rs +Ethernet166 191,192 Ethernet21/7 21 200000 rs +Ethernet168 169,170 Ethernet22/1 22 200000 rs +Ethernet170 171,172 Ethernet22/3 22 200000 rs +Ethernet172 173,174 Ethernet22/5 22 200000 rs +Ethernet174 175,176 Ethernet22/7 22 200000 rs +Ethernet176 161,162 Ethernet23/1 23 200000 rs +Ethernet178 163,164 Ethernet23/3 23 200000 rs +Ethernet180 165,166 Ethernet23/5 23 200000 rs +Ethernet182 167,168 Ethernet23/7 23 200000 rs +Ethernet184 177,178 Ethernet24/1 24 200000 rs +Ethernet186 179,180 Ethernet24/3 24 200000 rs +Ethernet188 181,182 Ethernet24/5 24 200000 rs +Ethernet190 183,184 Ethernet24/7 24 200000 rs +Ethernet192 217,218 Ethernet25/1 25 200000 rs +Ethernet194 219,220 Ethernet25/3 25 200000 rs +Ethernet196 221,222 Ethernet25/5 25 200000 rs +Ethernet198 223,224 Ethernet25/7 25 200000 rs +Ethernet200 201,202 Ethernet26/1 26 200000 rs +Ethernet202 203,204 Ethernet26/3 26 200000 rs +Ethernet204 205,206 Ethernet26/5 26 200000 rs +Ethernet206 207,208 Ethernet26/7 26 200000 rs +Ethernet208 193,194 Ethernet27/1 27 200000 rs +Ethernet210 195,196 Ethernet27/3 27 200000 rs +Ethernet212 197,198 Ethernet27/5 27 200000 rs +Ethernet214 199,200 Ethernet27/7 27 200000 rs +Ethernet216 209,210 Ethernet28/1 28 200000 rs +Ethernet218 211,212 Ethernet28/3 28 200000 rs +Ethernet220 213,214 Ethernet28/5 28 200000 rs +Ethernet222 215,216 Ethernet28/7 28 200000 rs +Ethernet224 249,250 Ethernet29/1 29 200000 rs +Ethernet226 251,252 Ethernet29/3 29 200000 rs +Ethernet228 253,254 Ethernet29/5 29 200000 rs +Ethernet230 255,256 Ethernet29/7 29 200000 rs +Ethernet232 233,234 Ethernet30/1 30 200000 rs +Ethernet234 235,236 Ethernet30/3 30 200000 rs +Ethernet236 237,238 Ethernet30/5 30 200000 rs +Ethernet238 239,240 Ethernet30/7 30 200000 rs +Ethernet240 225,226 Ethernet31/1 31 200000 rs +Ethernet242 227,228 Ethernet31/3 31 200000 rs +Ethernet244 229,230 Ethernet31/5 31 200000 rs +Ethernet246 231,232 Ethernet31/7 31 200000 rs +Ethernet248 241,242 Ethernet32/1 32 200000 rs +Ethernet250 243,244 Ethernet32/3 32 200000 rs +Ethernet252 245,246 Ethernet32/5 32 200000 rs +Ethernet254 247,248 Ethernet32/7 32 200000 rs +Ethernet256 273,274 Ethernet33/1 33 200000 rs +Ethernet258 275,276 Ethernet33/3 33 200000 rs +Ethernet260 277,278 Ethernet33/5 33 200000 rs +Ethernet262 279,280 Ethernet33/7 33 200000 rs +Ethernet264 257,258 Ethernet34/1 34 200000 rs +Ethernet266 259,260 Ethernet34/3 34 200000 rs +Ethernet268 261,262 Ethernet34/5 34 200000 rs +Ethernet270 263,264 Ethernet34/7 34 200000 rs +Ethernet272 265,266 Ethernet35/1 35 200000 rs +Ethernet274 267,268 Ethernet35/3 35 200000 rs +Ethernet276 269,270 Ethernet35/5 35 200000 rs +Ethernet278 271,272 Ethernet35/7 35 200000 rs +Ethernet280 281,282 Ethernet36/1 36 200000 rs +Ethernet282 283,284 Ethernet36/3 36 200000 rs +Ethernet284 285,286 Ethernet36/5 36 200000 rs +Ethernet286 287,288 Ethernet36/7 36 200000 rs +Ethernet288 313,314 Ethernet37/1 37 200000 rs +Ethernet290 315,316 Ethernet37/3 37 200000 rs +Ethernet292 317,318 Ethernet37/5 37 200000 rs +Ethernet294 319,320 Ethernet37/7 37 200000 rs +Ethernet296 297,298 Ethernet38/1 38 200000 rs +Ethernet298 299,300 Ethernet38/3 38 200000 rs +Ethernet300 301,302 Ethernet38/5 38 200000 rs +Ethernet302 303,304 Ethernet38/7 38 200000 rs +Ethernet304 289,290 Ethernet39/1 39 200000 rs +Ethernet306 291,292 Ethernet39/3 39 200000 rs +Ethernet308 293,294 Ethernet39/5 39 200000 rs +Ethernet310 295,296 Ethernet39/7 39 200000 rs +Ethernet312 305,306 Ethernet40/1 40 200000 rs +Ethernet314 307,308 Ethernet40/3 40 200000 rs +Ethernet316 309,310 Ethernet40/5 40 200000 rs +Ethernet318 311,312 Ethernet40/7 40 200000 rs +Ethernet320 345,346 Ethernet41/1 41 200000 rs +Ethernet322 347,348 Ethernet41/3 41 200000 rs +Ethernet324 349,350 Ethernet41/5 41 200000 rs +Ethernet326 351,352 Ethernet41/7 41 200000 rs +Ethernet328 329,330 Ethernet42/1 42 200000 rs +Ethernet330 331,332 Ethernet42/3 42 200000 rs +Ethernet332 333,334 Ethernet42/5 42 200000 rs +Ethernet334 335,336 Ethernet42/7 42 200000 rs +Ethernet336 321,322 Ethernet43/1 43 200000 rs +Ethernet338 323,324 Ethernet43/3 43 200000 rs +Ethernet340 325,326 Ethernet43/5 43 200000 rs +Ethernet342 327,328 Ethernet43/7 43 200000 rs +Ethernet344 337,338 Ethernet44/1 44 200000 rs +Ethernet346 339,340 Ethernet44/3 44 200000 rs +Ethernet348 341,342 Ethernet44/5 44 200000 rs +Ethernet350 343,344 Ethernet44/7 44 200000 rs +Ethernet352 377,378 Ethernet45/1 45 200000 rs +Ethernet354 379,380 Ethernet45/3 45 200000 rs +Ethernet356 381,382 Ethernet45/5 45 200000 rs +Ethernet358 383,384 Ethernet45/7 45 200000 rs +Ethernet360 361,362 Ethernet46/1 46 200000 rs +Ethernet362 363,364 Ethernet46/3 46 200000 rs +Ethernet364 365,366 Ethernet46/5 46 200000 rs +Ethernet366 367,368 Ethernet46/7 46 200000 rs +Ethernet368 353,354 Ethernet47/1 47 200000 rs +Ethernet370 355,356 Ethernet47/3 47 200000 rs +Ethernet372 357,358 Ethernet47/5 47 200000 rs +Ethernet374 359,360 Ethernet47/7 47 200000 rs +Ethernet376 369,370 Ethernet48/1 48 200000 rs +Ethernet378 371,372 Ethernet48/3 48 200000 rs +Ethernet380 373,374 Ethernet48/5 48 200000 rs +Ethernet382 375,376 Ethernet48/7 48 200000 rs +Ethernet384 409,410 Ethernet49/1 49 200000 rs +Ethernet386 411,412 Ethernet49/3 49 200000 rs +Ethernet388 413,414 Ethernet49/5 49 200000 rs +Ethernet390 415,416 Ethernet49/7 49 200000 rs +Ethernet392 393,394 Ethernet50/1 50 200000 rs +Ethernet394 395,396 Ethernet50/3 50 200000 rs +Ethernet396 397,398 Ethernet50/5 50 200000 rs +Ethernet398 399,400 Ethernet50/7 50 200000 rs +Ethernet400 385,386 Ethernet51/1 51 200000 rs +Ethernet402 387,388 Ethernet51/3 51 200000 rs +Ethernet404 389,390 Ethernet51/5 51 200000 rs +Ethernet406 391,392 Ethernet51/7 51 200000 rs +Ethernet408 401,402 Ethernet52/1 52 200000 rs +Ethernet410 403,404 Ethernet52/3 52 200000 rs +Ethernet412 405,406 Ethernet52/5 52 200000 rs +Ethernet414 407,408 Ethernet52/7 52 200000 rs +Ethernet416 441,442 Ethernet53/1 53 200000 rs +Ethernet418 443,444 Ethernet53/3 53 200000 rs +Ethernet420 445,446 Ethernet53/5 53 200000 rs +Ethernet422 447,448 Ethernet53/7 53 200000 rs +Ethernet424 425,426 Ethernet54/1 54 200000 rs +Ethernet426 427,428 Ethernet54/3 54 200000 rs +Ethernet428 429,430 Ethernet54/5 54 200000 rs +Ethernet430 431,432 Ethernet54/7 54 200000 rs +Ethernet432 417,418 Ethernet55/1 55 200000 rs +Ethernet434 419,420 Ethernet55/3 55 200000 rs +Ethernet436 421,422 Ethernet55/5 55 200000 rs +Ethernet438 423,424 Ethernet55/7 55 200000 rs +Ethernet440 433,434 Ethernet56/1 56 200000 rs +Ethernet442 435,436 Ethernet56/3 56 200000 rs +Ethernet444 437,438 Ethernet56/5 56 200000 rs +Ethernet446 439,440 Ethernet56/7 56 200000 rs +Ethernet448 473,474 Ethernet57/1 57 200000 rs +Ethernet450 475,476 Ethernet57/3 57 200000 rs +Ethernet452 477,478 Ethernet57/5 57 200000 rs +Ethernet454 479,480 Ethernet57/7 57 200000 rs +Ethernet456 457,458 Ethernet58/1 58 200000 rs +Ethernet458 459,460 Ethernet58/3 58 200000 rs +Ethernet460 461,462 Ethernet58/5 58 200000 rs +Ethernet462 463,464 Ethernet58/7 58 200000 rs +Ethernet464 449,450 Ethernet59/1 59 200000 rs +Ethernet466 451,452 Ethernet59/3 59 200000 rs +Ethernet468 453,454 Ethernet59/5 59 200000 rs +Ethernet470 455,456 Ethernet59/7 59 200000 rs +Ethernet472 465,466 Ethernet60/1 60 200000 rs +Ethernet474 467,468 Ethernet60/3 60 200000 rs +Ethernet476 469,470 Ethernet60/5 60 200000 rs +Ethernet478 471,472 Ethernet60/7 60 200000 rs +Ethernet480 505,506 Ethernet61/1 61 200000 rs +Ethernet482 507,508 Ethernet61/3 61 200000 rs +Ethernet484 509,510 Ethernet61/5 61 200000 rs +Ethernet486 511,512 Ethernet61/7 61 200000 rs +Ethernet488 489,490 Ethernet62/1 62 200000 rs +Ethernet490 491,492 Ethernet62/3 62 200000 rs +Ethernet492 493,494 Ethernet62/5 62 200000 rs +Ethernet494 495,496 Ethernet62/7 62 200000 rs +Ethernet496 481,482 Ethernet63/1 63 200000 rs +Ethernet498 483,484 Ethernet63/3 63 200000 rs +Ethernet500 485,486 Ethernet63/5 63 200000 rs +Ethernet502 487,488 Ethernet63/7 63 200000 rs +Ethernet504 497,498 Ethernet64/1 64 200000 rs +Ethernet506 499,500 Ethernet64/3 64 200000 rs +Ethernet508 501,502 Ethernet64/5 64 200000 rs +Ethernet510 503,504 Ethernet64/7 64 200000 rs diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/sai.profile b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/sai.profile new file mode 100644 index 000000000000..89cfbc9f1b84 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/sai.profile @@ -0,0 +1 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th5-a7060x6-64de.config.bcm diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/th5-a7060x6-64de.config.bcm b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/th5-a7060x6-64de.config.bcm new file mode 100644 index 000000000000..b418d4965799 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/th5-a7060x6-64de.config.bcm @@ -0,0 +1,1913 @@ +# +# $Copyright: (c) 2022 Broadcom. +# Broadcom Proprietary and Confidential. All rights reserved.$ +# +# BCM78900 64x800g port configuration. +# +# configuration yaml file +# device: +# : +#
: +# ? +# : +# : +# ... +# : +# : +# : +# : +# ... +# : +# + +--- +bcm_device: + 0: + global: + pktio_mode: 1 + default_cpu_tx_queue: 7 + vlan_flooding_l2mc_num_reserved: 0 + ipv6_lpm_128b_enable: 1 + shared_block_mask_section: uc_bc + skip_protocol_default_entries: 1 + # LTSW uses value 1 for ALPM combined mode + l3_alpm_template: 1 + l3_alpm_hit_skip: 1 + sai_feat_tail_timestamp : 1 + sai_port_phy_time_sync_en : 1 + sai_field_group_auto_prioritize: 1 + #l3_intf_vlan_split_egress for MTU at L3IF + l3_intf_vlan_split_egress : 1 + pfc_deadlock_seq_control : 1 + sai_tunnel_support: 2 + bcm_tunnel_term_compatible_mode: 1 + l3_ecmp_member_first_lkup_mem_size: 12288 +--- +device: + 0: + PC_PM_CORE: + ? + PC_PM_ID: 3 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x15047362 + TX_LANE_MAP: 0x4152637 + RX_POLARITY_FLIP: 0xc3 + TX_POLARITY_FLIP: 0xcc + ? + PC_PM_ID: 1 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x17063524 + TX_LANE_MAP: 0x60714253 + RX_POLARITY_FLIP: 0x97 + TX_POLARITY_FLIP: 0xcc + ? + PC_PM_ID: 2 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x6172435 + TX_LANE_MAP: 0x71605342 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0x69 + ? + PC_PM_ID: 4 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x40516273 + TX_LANE_MAP: 0x51403726 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0xc3 + ? + PC_PM_ID: 8 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x71630524 + TX_LANE_MAP: 0x4371625 + RX_POLARITY_FLIP: 0x47 + TX_POLARITY_FLIP: 0xc9 + ? + PC_PM_ID: 6 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x70625143 + TX_LANE_MAP: 0x60534172 + RX_POLARITY_FLIP: 0x1e + TX_POLARITY_FLIP: 0x2c + ? + PC_PM_ID: 5 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x17063524 + TX_LANE_MAP: 0x60715243 + RX_POLARITY_FLIP: 0x38 + TX_POLARITY_FLIP: 0x4e + ? + PC_PM_ID: 7 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x36172405 + TX_LANE_MAP: 0x73402516 + RX_POLARITY_FLIP: 0xd2 + TX_POLARITY_FLIP: 0xc9 + ? + PC_PM_ID: 12 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x71630524 + TX_LANE_MAP: 0x4371625 + RX_POLARITY_FLIP: 0x47 + TX_POLARITY_FLIP: 0xc9 + ? + PC_PM_ID: 10 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x70625143 + TX_LANE_MAP: 0x60534172 + RX_POLARITY_FLIP: 0x1e + TX_POLARITY_FLIP: 0x6c + ? + PC_PM_ID: 9 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x62704351 + TX_LANE_MAP: 0x53607241 + RX_POLARITY_FLIP: 0xb4 + TX_POLARITY_FLIP: 0x6c + ? + PC_PM_ID: 11 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x36172405 + TX_LANE_MAP: 0x73402516 + RX_POLARITY_FLIP: 0xd2 + TX_POLARITY_FLIP: 0xc9 + ? + PC_PM_ID: 16 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x71630524 + TX_LANE_MAP: 0x4371625 + RX_POLARITY_FLIP: 0x47 + TX_POLARITY_FLIP: 0xc9 + ? + PC_PM_ID: 14 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x70625143 + TX_LANE_MAP: 0x60534172 + RX_POLARITY_FLIP: 0x1e + TX_POLARITY_FLIP: 0x6c + ? + PC_PM_ID: 13 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x62704351 + TX_LANE_MAP: 0x53607241 + RX_POLARITY_FLIP: 0xb4 + TX_POLARITY_FLIP: 0x6c + ? + PC_PM_ID: 15 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x36172405 + TX_LANE_MAP: 0x73402516 + RX_POLARITY_FLIP: 0xd2 + TX_POLARITY_FLIP: 0xc9 + ? + PC_PM_ID: 20 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x15347062 + TX_LANE_MAP: 0x60734152 + RX_POLARITY_FLIP: 0x3f + TX_POLARITY_FLIP: 0x76 + ? + PC_PM_ID: 18 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x17360524 + TX_LANE_MAP: 0x16270435 + RX_POLARITY_FLIP: 0x7b + TX_POLARITY_FLIP: 0x9b + ? + PC_PM_ID: 17 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x36172405 + TX_LANE_MAP: 0x27163504 + RX_POLARITY_FLIP: 0x21 + TX_POLARITY_FLIP: 0x91 + ? + PC_PM_ID: 19 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x43516270 + TX_LANE_MAP: 0x37065241 + RX_POLARITY_FLIP: 0x30 + TX_POLARITY_FLIP: 0x16 + ? + PC_PM_ID: 24 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x15347062 + TX_LANE_MAP: 0x60734152 + RX_POLARITY_FLIP: 0x3f + TX_POLARITY_FLIP: 0x76 + ? + PC_PM_ID: 22 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x17360524 + TX_LANE_MAP: 0x16270435 + RX_POLARITY_FLIP: 0x7b + TX_POLARITY_FLIP: 0x9b + ? + PC_PM_ID: 21 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x36172405 + TX_LANE_MAP: 0x27163504 + RX_POLARITY_FLIP: 0x21 + TX_POLARITY_FLIP: 0x91 + ? + PC_PM_ID: 23 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x43516270 + TX_LANE_MAP: 0x37065241 + RX_POLARITY_FLIP: 0x30 + TX_POLARITY_FLIP: 0x16 + ? + PC_PM_ID: 28 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x43612705 + TX_LANE_MAP: 0x63507241 + RX_POLARITY_FLIP: 0xfc + TX_POLARITY_FLIP: 0x8e + ? + PC_PM_ID: 26 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x17360524 + TX_LANE_MAP: 0x16270435 + RX_POLARITY_FLIP: 0x7b + TX_POLARITY_FLIP: 0x9b + ? + PC_PM_ID: 25 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x36172405 + TX_LANE_MAP: 0x27163504 + RX_POLARITY_FLIP: 0x21 + TX_POLARITY_FLIP: 0x91 + ? + PC_PM_ID: 27 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x43516270 + TX_LANE_MAP: 0x37065241 + RX_POLARITY_FLIP: 0x30 + TX_POLARITY_FLIP: 0x36 + ? + PC_PM_ID: 32 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x73621504 + TX_LANE_MAP: 0x62734051 + RX_POLARITY_FLIP: 0xf0 + TX_POLARITY_FLIP: 0x00 + ? + PC_PM_ID: 30 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x71605342 + TX_LANE_MAP: 0x6172435 + RX_POLARITY_FLIP: 0xa5 + TX_POLARITY_FLIP: 0x00 + ? + PC_PM_ID: 29 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x60714253 + TX_LANE_MAP: 0x17063524 + RX_POLARITY_FLIP: 0x21 + TX_POLARITY_FLIP: 0x69 + ? + PC_PM_ID: 31 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x26370415 + TX_LANE_MAP: 0x37265140 + RX_POLARITY_FLIP: 0x30 + TX_POLARITY_FLIP: 0xc3 + ? + PC_PM_ID: 35 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x15047362 + TX_LANE_MAP: 0x4152637 + RX_POLARITY_FLIP: 0xf0 + TX_POLARITY_FLIP: 0xff + ? + PC_PM_ID: 33 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x17063524 + TX_LANE_MAP: 0x60714253 + RX_POLARITY_FLIP: 0xa5 + TX_POLARITY_FLIP: 0xff + ? + PC_PM_ID: 34 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x6172435 + TX_LANE_MAP: 0x71605342 + RX_POLARITY_FLIP: 0xed + TX_POLARITY_FLIP: 0x69 + ? + PC_PM_ID: 36 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x40516273 + TX_LANE_MAP: 0x51403726 + RX_POLARITY_FLIP: 0xfc + TX_POLARITY_FLIP: 0xc3 + ? + PC_PM_ID: 40 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x70621534 + TX_LANE_MAP: 0x14250637 + RX_POLARITY_FLIP: 0x0c + TX_POLARITY_FLIP: 0x64 + ? + PC_PM_ID: 38 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x71635042 + TX_LANE_MAP: 0x61724053 + RX_POLARITY_FLIP: 0x48 + TX_POLARITY_FLIP: 0x9c + ? + PC_PM_ID: 37 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x6241537 + TX_LANE_MAP: 0x51624073 + RX_POLARITY_FLIP: 0x7b + TX_POLARITY_FLIP: 0x3a + ? + PC_PM_ID: 39 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x26073415 + TX_LANE_MAP: 0x52413706 + RX_POLARITY_FLIP: 0xfc + TX_POLARITY_FLIP: 0x9e + ? + PC_PM_ID: 44 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x70621534 + TX_LANE_MAP: 0x14250637 + RX_POLARITY_FLIP: 0x0c + TX_POLARITY_FLIP: 0x64 + ? + PC_PM_ID: 42 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x71635042 + TX_LANE_MAP: 0x61724053 + RX_POLARITY_FLIP: 0x48 + TX_POLARITY_FLIP: 0x98 + ? + PC_PM_ID: 41 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x63714250 + TX_LANE_MAP: 0x72615340 + RX_POLARITY_FLIP: 0xed + TX_POLARITY_FLIP: 0x9d + ? + PC_PM_ID: 43 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x26073415 + TX_LANE_MAP: 0x52413706 + RX_POLARITY_FLIP: 0xfc + TX_POLARITY_FLIP: 0x9e + ? + PC_PM_ID: 48 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x70621534 + TX_LANE_MAP: 0x14250637 + RX_POLARITY_FLIP: 0x0c + TX_POLARITY_FLIP: 0x64 + ? + PC_PM_ID: 46 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x71635042 + TX_LANE_MAP: 0x61724053 + RX_POLARITY_FLIP: 0x48 + TX_POLARITY_FLIP: 0x98 + ? + PC_PM_ID: 45 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x63714250 + TX_LANE_MAP: 0x72615340 + RX_POLARITY_FLIP: 0xed + TX_POLARITY_FLIP: 0x9d + ? + PC_PM_ID: 47 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x26073415 + TX_LANE_MAP: 0x52413706 + RX_POLARITY_FLIP: 0xfc + TX_POLARITY_FLIP: 0x9e + ? + PC_PM_ID: 52 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x5247163 + TX_LANE_MAP: 0x61524073 + RX_POLARITY_FLIP: 0x8b + TX_POLARITY_FLIP: 0x93 + ? + PC_PM_ID: 50 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x7261534 + TX_LANE_MAP: 0x6351427 + RX_POLARITY_FLIP: 0xd2 + TX_POLARITY_FLIP: 0x63 + ? + PC_PM_ID: 49 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x26073415 + TX_LANE_MAP: 0x35062714 + RX_POLARITY_FLIP: 0x87 + TX_POLARITY_FLIP: 0x63 + ? + PC_PM_ID: 51 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x42506371 + TX_LANE_MAP: 0x25167340 + RX_POLARITY_FLIP: 0xe1 + TX_POLARITY_FLIP: 0x63 + ? + PC_PM_ID: 56 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x5247163 + TX_LANE_MAP: 0x61524073 + RX_POLARITY_FLIP: 0x8b + TX_POLARITY_FLIP: 0x93 + ? + PC_PM_ID: 54 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x7261534 + TX_LANE_MAP: 0x6351427 + RX_POLARITY_FLIP: 0xd2 + TX_POLARITY_FLIP: 0x63 + ? + PC_PM_ID: 53 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x26073415 + TX_LANE_MAP: 0x35062714 + RX_POLARITY_FLIP: 0x87 + TX_POLARITY_FLIP: 0x63 + ? + PC_PM_ID: 55 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x42506371 + TX_LANE_MAP: 0x25167340 + RX_POLARITY_FLIP: 0xe1 + TX_POLARITY_FLIP: 0x63 + ? + PC_PM_ID: 60 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x62730415 + TX_LANE_MAP: 0x73624150 + RX_POLARITY_FLIP: 0x98 + TX_POLARITY_FLIP: 0x1b + ? + PC_PM_ID: 58 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x7261534 + TX_LANE_MAP: 0x6351427 + RX_POLARITY_FLIP: 0xd2 + TX_POLARITY_FLIP: 0x63 + ? + PC_PM_ID: 57 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x26073415 + TX_LANE_MAP: 0x35062714 + RX_POLARITY_FLIP: 0x87 + TX_POLARITY_FLIP: 0x63 + ? + PC_PM_ID: 59 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x42506371 + TX_LANE_MAP: 0x25167340 + RX_POLARITY_FLIP: 0xe1 + TX_POLARITY_FLIP: 0x62 + ? + PC_PM_ID: 64 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x73621504 + TX_LANE_MAP: 0x62734051 + RX_POLARITY_FLIP: 0xc2 + TX_POLARITY_FLIP: 0x33 + ? + PC_PM_ID: 62 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x71605342 + TX_LANE_MAP: 0x6172435 + RX_POLARITY_FLIP: 0x96 + TX_POLARITY_FLIP: 0x33 + ? + PC_PM_ID: 61 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x60714253 + TX_LANE_MAP: 0x17063524 + RX_POLARITY_FLIP: 0xcc + TX_POLARITY_FLIP: 0x69 + ? + PC_PM_ID: 63 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x26370415 + TX_LANE_MAP: 0x37265140 + RX_POLARITY_FLIP: 0xcc + TX_POLARITY_FLIP: 0xc3 +--- +device: + 0: + PC_PORT_PHYS_MAP: + ? + PORT_ID: 1 + : + PC_PHYS_PORT_ID: 1 + ? + PORT_ID: 2 + : + PC_PHYS_PORT_ID: 3 + ? + PORT_ID: 3 + : + PC_PHYS_PORT_ID: 5 + ? + PORT_ID: 4 + : + PC_PHYS_PORT_ID: 7 + ? + PORT_ID: 5 + : + PC_PHYS_PORT_ID: 9 + ? + PORT_ID: 6 + : + PC_PHYS_PORT_ID: 11 + ? + PORT_ID: 7 + : + PC_PHYS_PORT_ID: 13 + ? + PORT_ID: 8 + : + PC_PHYS_PORT_ID: 15 + ? + PORT_ID: 11 + : + PC_PHYS_PORT_ID: 17 + ? + PORT_ID: 12 + : + PC_PHYS_PORT_ID: 19 + ? + PORT_ID: 13 + : + PC_PHYS_PORT_ID: 21 + ? + PORT_ID: 14 + : + PC_PHYS_PORT_ID: 23 + ? + PORT_ID: 15 + : + PC_PHYS_PORT_ID: 25 + ? + PORT_ID: 16 + : + PC_PHYS_PORT_ID: 27 + ? + PORT_ID: 17 + : + PC_PHYS_PORT_ID: 29 + ? + PORT_ID: 18 + : + PC_PHYS_PORT_ID: 31 + ? + PORT_ID: 22 + : + PC_PHYS_PORT_ID: 33 + ? + PORT_ID: 23 + : + PC_PHYS_PORT_ID: 35 + ? + PORT_ID: 24 + : + PC_PHYS_PORT_ID: 37 + ? + PORT_ID: 25 + : + PC_PHYS_PORT_ID: 39 + ? + PORT_ID: 26 + : + PC_PHYS_PORT_ID: 41 + ? + PORT_ID: 27 + : + PC_PHYS_PORT_ID: 43 + ? + PORT_ID: 28 + : + PC_PHYS_PORT_ID: 45 + ? + PORT_ID: 29 + : + PC_PHYS_PORT_ID: 47 + ? + PORT_ID: 33 + : + PC_PHYS_PORT_ID: 49 + ? + PORT_ID: 34 + : + PC_PHYS_PORT_ID: 51 + ? + PORT_ID: 35 + : + PC_PHYS_PORT_ID: 53 + ? + PORT_ID: 36 + : + PC_PHYS_PORT_ID: 55 + ? + PORT_ID: 37 + : + PC_PHYS_PORT_ID: 57 + ? + PORT_ID: 38 + : + PC_PHYS_PORT_ID: 59 + ? + PORT_ID: 39 + : + PC_PHYS_PORT_ID: 61 + ? + PORT_ID: 40 + : + PC_PHYS_PORT_ID: 63 + ? + PORT_ID: 44 + : + PC_PHYS_PORT_ID: 65 + ? + PORT_ID: 45 + : + PC_PHYS_PORT_ID: 67 + ? + PORT_ID: 46 + : + PC_PHYS_PORT_ID: 69 + ? + PORT_ID: 47 + : + PC_PHYS_PORT_ID: 71 + ? + PORT_ID: 48 + : + PC_PHYS_PORT_ID: 73 + ? + PORT_ID: 49 + : + PC_PHYS_PORT_ID: 75 + ? + PORT_ID: 50 + : + PC_PHYS_PORT_ID: 77 + ? + PORT_ID: 51 + : + PC_PHYS_PORT_ID: 79 + ? + PORT_ID: 55 + : + PC_PHYS_PORT_ID: 81 + ? + PORT_ID: 56 + : + PC_PHYS_PORT_ID: 83 + ? + PORT_ID: 57 + : + PC_PHYS_PORT_ID: 85 + ? + PORT_ID: 58 + : + PC_PHYS_PORT_ID: 87 + ? + PORT_ID: 59 + : + PC_PHYS_PORT_ID: 89 + ? + PORT_ID: 60 + : + PC_PHYS_PORT_ID: 91 + ? + PORT_ID: 61 + : + PC_PHYS_PORT_ID: 93 + ? + PORT_ID: 62 + : + PC_PHYS_PORT_ID: 95 + ? + PORT_ID: 66 + : + PC_PHYS_PORT_ID: 97 + ? + PORT_ID: 67 + : + PC_PHYS_PORT_ID: 99 + ? + PORT_ID: 68 + : + PC_PHYS_PORT_ID: 101 + ? + PORT_ID: 69 + : + PC_PHYS_PORT_ID: 103 + ? + PORT_ID: 70 + : + PC_PHYS_PORT_ID: 105 + ? + PORT_ID: 71 + : + PC_PHYS_PORT_ID: 107 + ? + PORT_ID: 72 + : + PC_PHYS_PORT_ID: 109 + ? + PORT_ID: 73 + : + PC_PHYS_PORT_ID: 111 + ? + PORT_ID: 77 + : + PC_PHYS_PORT_ID: 113 + ? + PORT_ID: 78 + : + PC_PHYS_PORT_ID: 115 + ? + PORT_ID: 79 + : + PC_PHYS_PORT_ID: 117 + ? + PORT_ID: 80 + : + PC_PHYS_PORT_ID: 119 + ? + PORT_ID: 81 + : + PC_PHYS_PORT_ID: 121 + ? + PORT_ID: 82 + : + PC_PHYS_PORT_ID: 123 + ? + PORT_ID: 83 + : + PC_PHYS_PORT_ID: 125 + ? + PORT_ID: 84 + : + PC_PHYS_PORT_ID: 127 + ? + PORT_ID: 88 + : + PC_PHYS_PORT_ID: 129 + ? + PORT_ID: 89 + : + PC_PHYS_PORT_ID: 131 + ? + PORT_ID: 90 + : + PC_PHYS_PORT_ID: 133 + ? + PORT_ID: 91 + : + PC_PHYS_PORT_ID: 135 + ? + PORT_ID: 92 + : + PC_PHYS_PORT_ID: 137 + ? + PORT_ID: 93 + : + PC_PHYS_PORT_ID: 139 + ? + PORT_ID: 94 + : + PC_PHYS_PORT_ID: 141 + ? + PORT_ID: 95 + : + PC_PHYS_PORT_ID: 143 + ? + PORT_ID: 99 + : + PC_PHYS_PORT_ID: 145 + ? + PORT_ID: 100 + : + PC_PHYS_PORT_ID: 147 + ? + PORT_ID: 101 + : + PC_PHYS_PORT_ID: 149 + ? + PORT_ID: 102 + : + PC_PHYS_PORT_ID: 151 + ? + PORT_ID: 103 + : + PC_PHYS_PORT_ID: 153 + ? + PORT_ID: 104 + : + PC_PHYS_PORT_ID: 155 + ? + PORT_ID: 105 + : + PC_PHYS_PORT_ID: 157 + ? + PORT_ID: 106 + : + PC_PHYS_PORT_ID: 159 + ? + PORT_ID: 110 + : + PC_PHYS_PORT_ID: 161 + ? + PORT_ID: 111 + : + PC_PHYS_PORT_ID: 163 + ? + PORT_ID: 112 + : + PC_PHYS_PORT_ID: 165 + ? + PORT_ID: 113 + : + PC_PHYS_PORT_ID: 167 + ? + PORT_ID: 114 + : + PC_PHYS_PORT_ID: 169 + ? + PORT_ID: 115 + : + PC_PHYS_PORT_ID: 171 + ? + PORT_ID: 116 + : + PC_PHYS_PORT_ID: 173 + ? + PORT_ID: 117 + : + PC_PHYS_PORT_ID: 175 + ? + PORT_ID: 121 + : + PC_PHYS_PORT_ID: 177 + ? + PORT_ID: 122 + : + PC_PHYS_PORT_ID: 179 + ? + PORT_ID: 123 + : + PC_PHYS_PORT_ID: 181 + ? + PORT_ID: 124 + : + PC_PHYS_PORT_ID: 183 + ? + PORT_ID: 125 + : + PC_PHYS_PORT_ID: 185 + ? + PORT_ID: 126 + : + PC_PHYS_PORT_ID: 187 + ? + PORT_ID: 127 + : + PC_PHYS_PORT_ID: 189 + ? + PORT_ID: 128 + : + PC_PHYS_PORT_ID: 191 + ? + PORT_ID: 132 + : + PC_PHYS_PORT_ID: 193 + ? + PORT_ID: 133 + : + PC_PHYS_PORT_ID: 195 + ? + PORT_ID: 134 + : + PC_PHYS_PORT_ID: 197 + ? + PORT_ID: 135 + : + PC_PHYS_PORT_ID: 199 + ? + PORT_ID: 136 + : + PC_PHYS_PORT_ID: 201 + ? + PORT_ID: 137 + : + PC_PHYS_PORT_ID: 203 + ? + PORT_ID: 138 + : + PC_PHYS_PORT_ID: 205 + ? + PORT_ID: 139 + : + PC_PHYS_PORT_ID: 207 + ? + PORT_ID: 143 + : + PC_PHYS_PORT_ID: 209 + ? + PORT_ID: 144 + : + PC_PHYS_PORT_ID: 211 + ? + PORT_ID: 145 + : + PC_PHYS_PORT_ID: 213 + ? + PORT_ID: 146 + : + PC_PHYS_PORT_ID: 215 + ? + PORT_ID: 147 + : + PC_PHYS_PORT_ID: 217 + ? + PORT_ID: 148 + : + PC_PHYS_PORT_ID: 219 + ? + PORT_ID: 149 + : + PC_PHYS_PORT_ID: 221 + ? + PORT_ID: 150 + : + PC_PHYS_PORT_ID: 223 + ? + PORT_ID: 154 + : + PC_PHYS_PORT_ID: 225 + ? + PORT_ID: 155 + : + PC_PHYS_PORT_ID: 227 + ? + PORT_ID: 156 + : + PC_PHYS_PORT_ID: 229 + ? + PORT_ID: 157 + : + PC_PHYS_PORT_ID: 231 + ? + PORT_ID: 158 + : + PC_PHYS_PORT_ID: 233 + ? + PORT_ID: 159 + : + PC_PHYS_PORT_ID: 235 + ? + PORT_ID: 160 + : + PC_PHYS_PORT_ID: 237 + ? + PORT_ID: 161 + : + PC_PHYS_PORT_ID: 239 + ? + PORT_ID: 165 + : + PC_PHYS_PORT_ID: 241 + ? + PORT_ID: 166 + : + PC_PHYS_PORT_ID: 243 + ? + PORT_ID: 167 + : + PC_PHYS_PORT_ID: 245 + ? + PORT_ID: 168 + : + PC_PHYS_PORT_ID: 247 + ? + PORT_ID: 169 + : + PC_PHYS_PORT_ID: 249 + ? + PORT_ID: 170 + : + PC_PHYS_PORT_ID: 251 + ? + PORT_ID: 171 + : + PC_PHYS_PORT_ID: 253 + ? + PORT_ID: 172 + : + PC_PHYS_PORT_ID: 255 + ? + PORT_ID: 176 + : + PC_PHYS_PORT_ID: 257 + ? + PORT_ID: 177 + : + PC_PHYS_PORT_ID: 259 + ? + PORT_ID: 178 + : + PC_PHYS_PORT_ID: 261 + ? + PORT_ID: 179 + : + PC_PHYS_PORT_ID: 263 + ? + PORT_ID: 180 + : + PC_PHYS_PORT_ID: 265 + ? + PORT_ID: 181 + : + PC_PHYS_PORT_ID: 267 + ? + PORT_ID: 182 + : + PC_PHYS_PORT_ID: 269 + ? + PORT_ID: 183 + : + PC_PHYS_PORT_ID: 271 + ? + PORT_ID: 187 + : + PC_PHYS_PORT_ID: 273 + ? + PORT_ID: 188 + : + PC_PHYS_PORT_ID: 275 + ? + PORT_ID: 189 + : + PC_PHYS_PORT_ID: 277 + ? + PORT_ID: 190 + : + PC_PHYS_PORT_ID: 279 + ? + PORT_ID: 191 + : + PC_PHYS_PORT_ID: 281 + ? + PORT_ID: 192 + : + PC_PHYS_PORT_ID: 283 + ? + PORT_ID: 193 + : + PC_PHYS_PORT_ID: 285 + ? + PORT_ID: 194 + : + PC_PHYS_PORT_ID: 287 + ? + PORT_ID: 198 + : + PC_PHYS_PORT_ID: 289 + ? + PORT_ID: 199 + : + PC_PHYS_PORT_ID: 291 + ? + PORT_ID: 200 + : + PC_PHYS_PORT_ID: 293 + ? + PORT_ID: 201 + : + PC_PHYS_PORT_ID: 295 + ? + PORT_ID: 202 + : + PC_PHYS_PORT_ID: 297 + ? + PORT_ID: 203 + : + PC_PHYS_PORT_ID: 299 + ? + PORT_ID: 204 + : + PC_PHYS_PORT_ID: 301 + ? + PORT_ID: 205 + : + PC_PHYS_PORT_ID: 303 + ? + PORT_ID: 209 + : + PC_PHYS_PORT_ID: 305 + ? + PORT_ID: 210 + : + PC_PHYS_PORT_ID: 307 + ? + PORT_ID: 211 + : + PC_PHYS_PORT_ID: 309 + ? + PORT_ID: 212 + : + PC_PHYS_PORT_ID: 311 + ? + PORT_ID: 213 + : + PC_PHYS_PORT_ID: 313 + ? + PORT_ID: 214 + : + PC_PHYS_PORT_ID: 315 + ? + PORT_ID: 215 + : + PC_PHYS_PORT_ID: 317 + ? + PORT_ID: 216 + : + PC_PHYS_PORT_ID: 319 + ? + PORT_ID: 220 + : + PC_PHYS_PORT_ID: 321 + ? + PORT_ID: 221 + : + PC_PHYS_PORT_ID: 323 + ? + PORT_ID: 222 + : + PC_PHYS_PORT_ID: 325 + ? + PORT_ID: 223 + : + PC_PHYS_PORT_ID: 327 + ? + PORT_ID: 224 + : + PC_PHYS_PORT_ID: 329 + ? + PORT_ID: 225 + : + PC_PHYS_PORT_ID: 331 + ? + PORT_ID: 226 + : + PC_PHYS_PORT_ID: 333 + ? + PORT_ID: 227 + : + PC_PHYS_PORT_ID: 335 + ? + PORT_ID: 231 + : + PC_PHYS_PORT_ID: 337 + ? + PORT_ID: 232 + : + PC_PHYS_PORT_ID: 339 + ? + PORT_ID: 233 + : + PC_PHYS_PORT_ID: 341 + ? + PORT_ID: 234 + : + PC_PHYS_PORT_ID: 343 + ? + PORT_ID: 235 + : + PC_PHYS_PORT_ID: 345 + ? + PORT_ID: 236 + : + PC_PHYS_PORT_ID: 347 + ? + PORT_ID: 237 + : + PC_PHYS_PORT_ID: 349 + ? + PORT_ID: 238 + : + PC_PHYS_PORT_ID: 351 + ? + PORT_ID: 242 + : + PC_PHYS_PORT_ID: 353 + ? + PORT_ID: 243 + : + PC_PHYS_PORT_ID: 355 + ? + PORT_ID: 244 + : + PC_PHYS_PORT_ID: 357 + ? + PORT_ID: 245 + : + PC_PHYS_PORT_ID: 359 + ? + PORT_ID: 246 + : + PC_PHYS_PORT_ID: 361 + ? + PORT_ID: 247 + : + PC_PHYS_PORT_ID: 363 + ? + PORT_ID: 248 + : + PC_PHYS_PORT_ID: 365 + ? + PORT_ID: 249 + : + PC_PHYS_PORT_ID: 367 + ? + PORT_ID: 253 + : + PC_PHYS_PORT_ID: 369 + ? + PORT_ID: 254 + : + PC_PHYS_PORT_ID: 371 + ? + PORT_ID: 255 + : + PC_PHYS_PORT_ID: 373 + ? + PORT_ID: 256 + : + PC_PHYS_PORT_ID: 375 + ? + PORT_ID: 257 + : + PC_PHYS_PORT_ID: 377 + ? + PORT_ID: 258 + : + PC_PHYS_PORT_ID: 379 + ? + PORT_ID: 259 + : + PC_PHYS_PORT_ID: 381 + ? + PORT_ID: 260 + : + PC_PHYS_PORT_ID: 383 + ? + PORT_ID: 264 + : + PC_PHYS_PORT_ID: 385 + ? + PORT_ID: 265 + : + PC_PHYS_PORT_ID: 387 + ? + PORT_ID: 266 + : + PC_PHYS_PORT_ID: 389 + ? + PORT_ID: 267 + : + PC_PHYS_PORT_ID: 391 + ? + PORT_ID: 268 + : + PC_PHYS_PORT_ID: 393 + ? + PORT_ID: 269 + : + PC_PHYS_PORT_ID: 395 + ? + PORT_ID: 270 + : + PC_PHYS_PORT_ID: 397 + ? + PORT_ID: 271 + : + PC_PHYS_PORT_ID: 399 + ? + PORT_ID: 275 + : + PC_PHYS_PORT_ID: 401 + ? + PORT_ID: 276 + : + PC_PHYS_PORT_ID: 403 + ? + PORT_ID: 277 + : + PC_PHYS_PORT_ID: 405 + ? + PORT_ID: 278 + : + PC_PHYS_PORT_ID: 407 + ? + PORT_ID: 279 + : + PC_PHYS_PORT_ID: 409 + ? + PORT_ID: 280 + : + PC_PHYS_PORT_ID: 411 + ? + PORT_ID: 281 + : + PC_PHYS_PORT_ID: 413 + ? + PORT_ID: 282 + : + PC_PHYS_PORT_ID: 415 + ? + PORT_ID: 286 + : + PC_PHYS_PORT_ID: 417 + ? + PORT_ID: 287 + : + PC_PHYS_PORT_ID: 419 + ? + PORT_ID: 288 + : + PC_PHYS_PORT_ID: 421 + ? + PORT_ID: 289 + : + PC_PHYS_PORT_ID: 423 + ? + PORT_ID: 290 + : + PC_PHYS_PORT_ID: 425 + ? + PORT_ID: 291 + : + PC_PHYS_PORT_ID: 427 + ? + PORT_ID: 292 + : + PC_PHYS_PORT_ID: 429 + ? + PORT_ID: 293 + : + PC_PHYS_PORT_ID: 431 + ? + PORT_ID: 297 + : + PC_PHYS_PORT_ID: 433 + ? + PORT_ID: 298 + : + PC_PHYS_PORT_ID: 435 + ? + PORT_ID: 299 + : + PC_PHYS_PORT_ID: 437 + ? + PORT_ID: 300 + : + PC_PHYS_PORT_ID: 439 + ? + PORT_ID: 301 + : + PC_PHYS_PORT_ID: 441 + ? + PORT_ID: 302 + : + PC_PHYS_PORT_ID: 443 + ? + PORT_ID: 303 + : + PC_PHYS_PORT_ID: 445 + ? + PORT_ID: 304 + : + PC_PHYS_PORT_ID: 447 + ? + PORT_ID: 308 + : + PC_PHYS_PORT_ID: 449 + ? + PORT_ID: 309 + : + PC_PHYS_PORT_ID: 451 + ? + PORT_ID: 310 + : + PC_PHYS_PORT_ID: 453 + ? + PORT_ID: 311 + : + PC_PHYS_PORT_ID: 455 + ? + PORT_ID: 312 + : + PC_PHYS_PORT_ID: 457 + ? + PORT_ID: 313 + : + PC_PHYS_PORT_ID: 459 + ? + PORT_ID: 314 + : + PC_PHYS_PORT_ID: 461 + ? + PORT_ID: 315 + : + PC_PHYS_PORT_ID: 463 + ? + PORT_ID: 319 + : + PC_PHYS_PORT_ID: 465 + ? + PORT_ID: 320 + : + PC_PHYS_PORT_ID: 467 + ? + PORT_ID: 321 + : + PC_PHYS_PORT_ID: 469 + ? + PORT_ID: 322 + : + PC_PHYS_PORT_ID: 471 + ? + PORT_ID: 323 + : + PC_PHYS_PORT_ID: 473 + ? + PORT_ID: 324 + : + PC_PHYS_PORT_ID: 475 + ? + PORT_ID: 325 + : + PC_PHYS_PORT_ID: 477 + ? + PORT_ID: 326 + : + PC_PHYS_PORT_ID: 479 + ? + PORT_ID: 330 + : + PC_PHYS_PORT_ID: 481 + ? + PORT_ID: 331 + : + PC_PHYS_PORT_ID: 483 + ? + PORT_ID: 332 + : + PC_PHYS_PORT_ID: 485 + ? + PORT_ID: 333 + : + PC_PHYS_PORT_ID: 487 + ? + PORT_ID: 334 + : + PC_PHYS_PORT_ID: 489 + ? + PORT_ID: 335 + : + PC_PHYS_PORT_ID: 491 + ? + PORT_ID: 336 + : + PC_PHYS_PORT_ID: 493 + ? + PORT_ID: 337 + : + PC_PHYS_PORT_ID: 495 + ? + PORT_ID: 341 + : + PC_PHYS_PORT_ID: 497 + ? + PORT_ID: 342 + : + PC_PHYS_PORT_ID: 499 + ? + PORT_ID: 343 + : + PC_PHYS_PORT_ID: 501 + ? + PORT_ID: 344 + : + PC_PHYS_PORT_ID: 503 + ? + PORT_ID: 345 + : + PC_PHYS_PORT_ID: 505 + ? + PORT_ID: 346 + : + PC_PHYS_PORT_ID: 507 + ? + PORT_ID: 347 + : + PC_PHYS_PORT_ID: 509 + ? + PORT_ID: 348 + : + PC_PHYS_PORT_ID: 511 +... +--- +device: + 0: + PC_PORT: + ? + PORT_ID: [[1, 8], + [11, 18], + [22, 29], + [33, 40], + [44, 51], + [55, 62], + [66, 73], + [77, 84], + [88, 95], + [99, 106], + [110, 117], + [121, 128], + [132, 139], + [143, 150], + [154, 161], + [165, 172], + [176, 183], + [187, 194], + [198, 205], + [209, 216], + [220, 227], + [231, 238], + [242, 249], + [253, 260], + [264, 271], + [275, 282], + [286, 293], + [297, 304], + [308, 315], + [319, 326], + [330, 337], + [341, 348]] + : + ENABLE: 0 + SPEED: 200000 + NUM_LANES: 2 + FEC_MODE: PC_FEC_RS544_2XN + MAX_FRAME_SIZE: 9416 +... +--- +bcm_device: + 0: + global: + ftem_mem_entries: 65536 +... +--- +device: + 0: + # Per pipe flex counter configuration + CTR_EFLEX_CONFIG: + CTR_ING_EFLEX_OPERMODE_PIPEUNIQUE: 0 + CTR_EGR_EFLEX_OPERMODE_PIPEUNIQUE: 0 + + # IFP mode + FP_CONFIG: + FP_ING_OPERMODE: GLOBAL_PIPE_AWARE +... +--- +device: + 0: + DEVICE_CONFIG: + AUTOLOAD_BOARD_SETTINGS: 0 +... diff --git a/device/arista/x86_64-arista_7060x6_64de/platform.json b/device/arista/x86_64-arista_7060x6_64de/platform.json index 9f58b40e4c1d..6af55dd4f738 100644 --- a/device/arista/x86_64-arista_7060x6_64de/platform.json +++ b/device/arista/x86_64-arista_7060x6_64de/platform.json @@ -325,6 +325,12 @@ "2x400G": [ "Ethernet1/1", "Ethernet1/5" + ], + "4x200G": [ + "Ethernet1/1", + "Ethernet1/3", + "Ethernet1/5", + "Ethernet1/7" ] } }, @@ -341,6 +347,12 @@ "2x400G": [ "Ethernet2/1", "Ethernet2/5" + ], + "4x200G": [ + "Ethernet2/1", + "Ethernet2/3", + "Ethernet2/5", + "Ethernet2/7" ] } }, @@ -357,6 +369,12 @@ "2x400G": [ "Ethernet3/1", "Ethernet3/5" + ], + "4x200G": [ + "Ethernet3/1", + "Ethernet3/3", + "Ethernet3/5", + "Ethernet3/7" ] } }, @@ -373,6 +391,12 @@ "2x400G": [ "Ethernet4/1", "Ethernet4/5" + ], + "4x200G": [ + "Ethernet4/1", + "Ethernet4/3", + "Ethernet4/5", + "Ethernet4/7" ] } }, @@ -389,6 +413,12 @@ "2x400G": [ "Ethernet5/1", "Ethernet5/5" + ], + "4x200G": [ + "Ethernet5/1", + "Ethernet5/3", + "Ethernet5/5", + "Ethernet5/7" ] } }, @@ -405,6 +435,12 @@ "2x400G": [ "Ethernet6/1", "Ethernet6/5" + ], + "4x200G": [ + "Ethernet6/1", + "Ethernet6/3", + "Ethernet6/5", + "Ethernet6/7" ] } }, @@ -421,6 +457,12 @@ "2x400G": [ "Ethernet7/1", "Ethernet7/5" + ], + "4x200G": [ + "Ethernet7/1", + "Ethernet7/3", + "Ethernet7/5", + "Ethernet7/7" ] } }, @@ -437,6 +479,12 @@ "2x400G": [ "Ethernet8/1", "Ethernet8/5" + ], + "4x200G": [ + "Ethernet8/1", + "Ethernet8/3", + "Ethernet8/5", + "Ethernet8/7" ] } }, @@ -453,6 +501,12 @@ "2x400G": [ "Ethernet9/1", "Ethernet9/5" + ], + "4x200G": [ + "Ethernet9/1", + "Ethernet9/3", + "Ethernet9/5", + "Ethernet9/7" ] } }, @@ -469,6 +523,12 @@ "2x400G": [ "Ethernet10/1", "Ethernet10/5" + ], + "4x200G": [ + "Ethernet10/1", + "Ethernet10/3", + "Ethernet10/5", + "Ethernet10/7" ] } }, @@ -485,6 +545,12 @@ "2x400G": [ "Ethernet11/1", "Ethernet11/5" + ], + "4x200G": [ + "Ethernet11/1", + "Ethernet11/3", + "Ethernet11/5", + "Ethernet11/7" ] } }, @@ -501,6 +567,12 @@ "2x400G": [ "Ethernet12/1", "Ethernet12/5" + ], + "4x200G": [ + "Ethernet12/1", + "Ethernet12/3", + "Ethernet12/5", + "Ethernet12/7" ] } }, @@ -517,6 +589,12 @@ "2x400G": [ "Ethernet13/1", "Ethernet13/5" + ], + "4x200G": [ + "Ethernet13/1", + "Ethernet13/3", + "Ethernet13/5", + "Ethernet13/7" ] } }, @@ -533,6 +611,12 @@ "2x400G": [ "Ethernet14/1", "Ethernet14/5" + ], + "4x200G": [ + "Ethernet14/1", + "Ethernet14/3", + "Ethernet14/5", + "Ethernet14/7" ] } }, @@ -549,6 +633,12 @@ "2x400G": [ "Ethernet15/1", "Ethernet15/5" + ], + "4x200G": [ + "Ethernet15/1", + "Ethernet15/3", + "Ethernet15/5", + "Ethernet15/7" ] } }, @@ -565,6 +655,12 @@ "2x400G": [ "Ethernet16/1", "Ethernet16/5" + ], + "4x200G": [ + "Ethernet16/1", + "Ethernet16/3", + "Ethernet16/5", + "Ethernet16/7" ] } }, @@ -581,6 +677,12 @@ "2x400G": [ "Ethernet17/1", "Ethernet17/5" + ], + "4x200G": [ + "Ethernet17/1", + "Ethernet17/3", + "Ethernet17/5", + "Ethernet17/7" ] } }, @@ -597,6 +699,12 @@ "2x400G": [ "Ethernet18/1", "Ethernet18/5" + ], + "4x200G": [ + "Ethernet18/1", + "Ethernet18/3", + "Ethernet18/5", + "Ethernet18/7" ] } }, @@ -613,6 +721,12 @@ "2x400G": [ "Ethernet19/1", "Ethernet19/5" + ], + "4x200G": [ + "Ethernet19/1", + "Ethernet19/3", + "Ethernet19/5", + "Ethernet19/7" ] } }, @@ -629,6 +743,12 @@ "2x400G": [ "Ethernet20/1", "Ethernet20/5" + ], + "4x200G": [ + "Ethernet20/1", + "Ethernet20/3", + "Ethernet20/5", + "Ethernet20/7" ] } }, @@ -645,6 +765,12 @@ "2x400G": [ "Ethernet21/1", "Ethernet21/5" + ], + "4x200G": [ + "Ethernet21/1", + "Ethernet21/3", + "Ethernet21/5", + "Ethernet21/7" ] } }, @@ -661,6 +787,12 @@ "2x400G": [ "Ethernet22/1", "Ethernet22/5" + ], + "4x200G": [ + "Ethernet22/1", + "Ethernet22/3", + "Ethernet22/5", + "Ethernet22/7" ] } }, @@ -677,6 +809,12 @@ "2x400G": [ "Ethernet23/1", "Ethernet23/5" + ], + "4x200G": [ + "Ethernet23/1", + "Ethernet23/3", + "Ethernet23/5", + "Ethernet23/7" ] } }, @@ -693,6 +831,12 @@ "2x400G": [ "Ethernet24/1", "Ethernet24/5" + ], + "4x200G": [ + "Ethernet24/1", + "Ethernet24/3", + "Ethernet24/5", + "Ethernet24/7" ] } }, @@ -709,6 +853,12 @@ "2x400G": [ "Ethernet25/1", "Ethernet25/5" + ], + "4x200G": [ + "Ethernet25/1", + "Ethernet25/3", + "Ethernet25/5", + "Ethernet25/7" ] } }, @@ -725,6 +875,12 @@ "2x400G": [ "Ethernet26/1", "Ethernet26/5" + ], + "4x200G": [ + "Ethernet26/1", + "Ethernet26/3", + "Ethernet26/5", + "Ethernet26/7" ] } }, @@ -741,6 +897,12 @@ "2x400G": [ "Ethernet27/1", "Ethernet27/5" + ], + "4x200G": [ + "Ethernet27/1", + "Ethernet27/3", + "Ethernet27/5", + "Ethernet27/7" ] } }, @@ -757,6 +919,12 @@ "2x400G": [ "Ethernet28/1", "Ethernet28/5" + ], + "4x200G": [ + "Ethernet28/1", + "Ethernet28/3", + "Ethernet28/5", + "Ethernet28/7" ] } }, @@ -773,6 +941,12 @@ "2x400G": [ "Ethernet29/1", "Ethernet29/5" + ], + "4x200G": [ + "Ethernet29/1", + "Ethernet29/3", + "Ethernet29/5", + "Ethernet29/7" ] } }, @@ -789,6 +963,12 @@ "2x400G": [ "Ethernet30/1", "Ethernet30/5" + ], + "4x200G": [ + "Ethernet30/1", + "Ethernet30/3", + "Ethernet30/5", + "Ethernet30/7" ] } }, @@ -805,6 +985,12 @@ "2x400G": [ "Ethernet31/1", "Ethernet31/5" + ], + "4x200G": [ + "Ethernet31/1", + "Ethernet31/3", + "Ethernet31/5", + "Ethernet31/7" ] } }, @@ -821,6 +1007,12 @@ "2x400G": [ "Ethernet32/1", "Ethernet32/5" + ], + "4x200G": [ + "Ethernet32/1", + "Ethernet32/3", + "Ethernet32/5", + "Ethernet32/7" ] } }, @@ -837,6 +1029,12 @@ "2x400G": [ "Ethernet33/1", "Ethernet33/5" + ], + "4x200G": [ + "Ethernet33/1", + "Ethernet33/3", + "Ethernet33/5", + "Ethernet33/7" ] } }, @@ -853,6 +1051,12 @@ "2x400G": [ "Ethernet34/1", "Ethernet34/5" + ], + "4x200G": [ + "Ethernet34/1", + "Ethernet34/3", + "Ethernet34/5", + "Ethernet34/7" ] } }, @@ -869,6 +1073,12 @@ "2x400G": [ "Ethernet35/1", "Ethernet35/5" + ], + "4x200G": [ + "Ethernet35/1", + "Ethernet35/3", + "Ethernet35/5", + "Ethernet35/7" ] } }, @@ -885,6 +1095,12 @@ "2x400G": [ "Ethernet36/1", "Ethernet36/5" + ], + "4x200G": [ + "Ethernet36/1", + "Ethernet36/3", + "Ethernet36/5", + "Ethernet36/7" ] } }, @@ -901,6 +1117,12 @@ "2x400G": [ "Ethernet37/1", "Ethernet37/5" + ], + "4x200G": [ + "Ethernet37/1", + "Ethernet37/3", + "Ethernet37/5", + "Ethernet37/7" ] } }, @@ -917,6 +1139,12 @@ "2x400G": [ "Ethernet38/1", "Ethernet38/5" + ], + "4x200G": [ + "Ethernet38/1", + "Ethernet38/3", + "Ethernet38/5", + "Ethernet38/7" ] } }, @@ -933,6 +1161,12 @@ "2x400G": [ "Ethernet39/1", "Ethernet39/5" + ], + "4x200G": [ + "Ethernet39/1", + "Ethernet39/3", + "Ethernet39/5", + "Ethernet39/7" ] } }, @@ -949,6 +1183,12 @@ "2x400G": [ "Ethernet40/1", "Ethernet40/5" + ], + "4x200G": [ + "Ethernet40/1", + "Ethernet40/3", + "Ethernet40/5", + "Ethernet40/7" ] } }, @@ -965,6 +1205,12 @@ "2x400G": [ "Ethernet41/1", "Ethernet41/5" + ], + "4x200G": [ + "Ethernet41/1", + "Ethernet41/3", + "Ethernet41/5", + "Ethernet41/7" ] } }, @@ -981,6 +1227,12 @@ "2x400G": [ "Ethernet42/1", "Ethernet42/5" + ], + "4x200G": [ + "Ethernet42/1", + "Ethernet42/3", + "Ethernet42/5", + "Ethernet42/7" ] } }, @@ -997,6 +1249,12 @@ "2x400G": [ "Ethernet43/1", "Ethernet43/5" + ], + "4x200G": [ + "Ethernet43/1", + "Ethernet43/3", + "Ethernet43/5", + "Ethernet43/7" ] } }, @@ -1013,6 +1271,12 @@ "2x400G": [ "Ethernet44/1", "Ethernet44/5" + ], + "4x200G": [ + "Ethernet44/1", + "Ethernet44/3", + "Ethernet44/5", + "Ethernet44/7" ] } }, @@ -1029,6 +1293,12 @@ "2x400G": [ "Ethernet45/1", "Ethernet45/5" + ], + "4x200G": [ + "Ethernet45/1", + "Ethernet45/3", + "Ethernet45/5", + "Ethernet45/7" ] } }, @@ -1045,6 +1315,12 @@ "2x400G": [ "Ethernet46/1", "Ethernet46/5" + ], + "4x200G": [ + "Ethernet46/1", + "Ethernet46/3", + "Ethernet46/5", + "Ethernet46/7" ] } }, @@ -1061,6 +1337,12 @@ "2x400G": [ "Ethernet47/1", "Ethernet47/5" + ], + "4x200G": [ + "Ethernet47/1", + "Ethernet47/3", + "Ethernet47/5", + "Ethernet47/7" ] } }, @@ -1077,6 +1359,12 @@ "2x400G": [ "Ethernet48/1", "Ethernet48/5" + ], + "4x200G": [ + "Ethernet48/1", + "Ethernet48/3", + "Ethernet48/5", + "Ethernet48/7" ] } }, @@ -1093,6 +1381,12 @@ "2x400G": [ "Ethernet49/1", "Ethernet49/5" + ], + "4x200G": [ + "Ethernet49/1", + "Ethernet49/3", + "Ethernet49/5", + "Ethernet49/7" ] } }, @@ -1109,6 +1403,12 @@ "2x400G": [ "Ethernet50/1", "Ethernet50/5" + ], + "4x200G": [ + "Ethernet50/1", + "Ethernet50/3", + "Ethernet50/5", + "Ethernet50/7" ] } }, @@ -1125,6 +1425,12 @@ "2x400G": [ "Ethernet51/1", "Ethernet51/5" + ], + "4x200G": [ + "Ethernet51/1", + "Ethernet51/3", + "Ethernet51/5", + "Ethernet51/7" ] } }, @@ -1141,6 +1447,12 @@ "2x400G": [ "Ethernet52/1", "Ethernet52/5" + ], + "4x200G": [ + "Ethernet52/1", + "Ethernet52/3", + "Ethernet52/5", + "Ethernet52/7" ] } }, @@ -1157,6 +1469,12 @@ "2x400G": [ "Ethernet53/1", "Ethernet53/5" + ], + "4x200G": [ + "Ethernet53/1", + "Ethernet53/3", + "Ethernet53/5", + "Ethernet53/7" ] } }, @@ -1173,6 +1491,12 @@ "2x400G": [ "Ethernet54/1", "Ethernet54/5" + ], + "4x200G": [ + "Ethernet54/1", + "Ethernet54/3", + "Ethernet54/5", + "Ethernet54/7" ] } }, @@ -1189,6 +1513,12 @@ "2x400G": [ "Ethernet55/1", "Ethernet55/5" + ], + "4x200G": [ + "Ethernet55/1", + "Ethernet55/3", + "Ethernet55/5", + "Ethernet55/7" ] } }, @@ -1205,6 +1535,12 @@ "2x400G": [ "Ethernet56/1", "Ethernet56/5" + ], + "4x200G": [ + "Ethernet56/1", + "Ethernet56/3", + "Ethernet56/5", + "Ethernet56/7" ] } }, @@ -1221,6 +1557,12 @@ "2x400G": [ "Ethernet57/1", "Ethernet57/5" + ], + "4x200G": [ + "Ethernet57/1", + "Ethernet57/3", + "Ethernet57/5", + "Ethernet57/7" ] } }, @@ -1237,6 +1579,12 @@ "2x400G": [ "Ethernet58/1", "Ethernet58/5" + ], + "4x200G": [ + "Ethernet58/1", + "Ethernet58/3", + "Ethernet58/5", + "Ethernet58/7" ] } }, @@ -1253,6 +1601,12 @@ "2x400G": [ "Ethernet59/1", "Ethernet59/5" + ], + "4x200G": [ + "Ethernet59/1", + "Ethernet59/3", + "Ethernet59/5", + "Ethernet59/7" ] } }, @@ -1269,6 +1623,12 @@ "2x400G": [ "Ethernet60/1", "Ethernet60/5" + ], + "4x200G": [ + "Ethernet60/1", + "Ethernet60/3", + "Ethernet60/5", + "Ethernet60/7" ] } }, @@ -1285,6 +1645,12 @@ "2x400G": [ "Ethernet61/1", "Ethernet61/5" + ], + "4x200G": [ + "Ethernet61/1", + "Ethernet61/3", + "Ethernet61/5", + "Ethernet61/7" ] } }, @@ -1301,6 +1667,12 @@ "2x400G": [ "Ethernet62/1", "Ethernet62/5" + ], + "4x200G": [ + "Ethernet62/1", + "Ethernet62/3", + "Ethernet62/5", + "Ethernet62/7" ] } }, @@ -1317,6 +1689,12 @@ "2x400G": [ "Ethernet63/1", "Ethernet63/5" + ], + "4x200G": [ + "Ethernet63/1", + "Ethernet63/3", + "Ethernet63/5", + "Ethernet63/7" ] } }, @@ -1333,8 +1711,14 @@ "2x400G": [ "Ethernet64/1", "Ethernet64/5" + ], + "4x200G": [ + "Ethernet64/1", + "Ethernet64/3", + "Ethernet64/5", + "Ethernet64/7" ] } } } -} +} \ No newline at end of file From c4053e0f09eae4d3ba54b726dda15ca7d5368ff9 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Sun, 12 May 2024 09:54:54 +0800 Subject: [PATCH 280/419] [FIPS] Upgrade the SymCrypt lib to 103.4.2 (#18879) Upgrade SymCrypt to version 103.4.2 to meet the FedRAMP. Microsoft ADO (number only): 27945386 --- rules/sonic-fips.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules/sonic-fips.mk b/rules/sonic-fips.mk index 3ce37224bf64..a065269ad6e2 100644 --- a/rules/sonic-fips.mk +++ b/rules/sonic-fips.mk @@ -1,6 +1,6 @@ # fips packages -FIPS_VERSION = 0.10 +FIPS_VERSION = 0.12 FIPS_OPENSSL_VERSION = 1.1.1n-0+deb11u5+fips FIPS_OPENSSH_VERSION = 8.4p1-5+deb11u2+fips FIPS_PYTHON_MAIN_VERSION = 3.9 From fc0644ecb8c3602cc1dbb927d6c7a8811add8790 Mon Sep 17 00:00:00 2001 From: Pavan Prakash <120486223+Pavan-Nokia@users.noreply.github.com> Date: Sat, 11 May 2024 21:55:51 -0400 Subject: [PATCH 281/419] [Nokia-7215-A1] EZB update for SAI and platform finetuning (#18915) 1) Update EZB to version 1.06 to suppost Marvell SAI update to version 1.13.3-1 2) Platform changes to finetune fan and thermals --- .../Nokia-7215-A1/ASK-Board-AC5X-xb.md5 | 2 +- .../Nokia-7215-A1/ASK-Board-AC5X-xb.xml | 52 +++++++++++------ .../Nokia-7215-A1/ASK-L1-AC5X-xb.md5 | 2 +- .../Nokia-7215-A1/ASK-L1-AC5X-xb.xml | 2 +- .../Nokia-7215-A1/ASK-PP-AC5X-xb.md5 | 2 +- .../Nokia-7215-A1/ASK-PP-AC5X-xb.xml | 24 +++++++- .../Nokia-7215-A1/SAI-AC5X-xb.md5 | 2 +- .../Nokia-7215-A1/SAI-AC5X-xb.xml | 56 +++++++++++++++++-- .../7215/modules/nokia_7215_ixs_a1_cpld.c | 6 +- .../7215/scripts/nokia-7215-init.sh | 3 + .../7215/sonic_platform/chassis.py | 5 +- .../7215/sonic_platform/fan.py | 4 +- 12 files changed, 123 insertions(+), 37 deletions(-) diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-Board-AC5X-xb.md5 b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-Board-AC5X-xb.md5 index fe63caf784ee..b11b209e5598 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-Board-AC5X-xb.md5 +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-Board-AC5X-xb.md5 @@ -1 +1 @@ -4983b60d1d68623c202b91093f3730db \ No newline at end of file +c99947340cd205fa728bd418d1ca7a92 \ No newline at end of file diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-Board-AC5X-xb.xml b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-Board-AC5X-xb.xml index 20cdef069c45..f23c2e9badda 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-Board-AC5X-xb.xml +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-Board-AC5X-xb.xml @@ -1,5 +1,5 @@ - + @@ -52,7 +52,7 @@ board-pp-interface-channel-type enumeration - Specifies interface tunnel. + Specifies channel interface type. pci PCI @@ -64,19 +64,29 @@ 1 - pex - PEX - 3 + twsi + TWSI + 2 + + + board-pp-as-type + enumeration + Specifies Address space type. - pex_eagle - PEX EAGLE - 5 + 4_regions + address-space 4 regions + 0 - pex_falcon_z - PEX FALCON Z - 6 + 8_regions + address-space 8 regions + 1 + + + atu + address translation unit + 2 @@ -683,6 +693,11 @@ lowercase characters. AC5X 1 + + ASIC_Falcon + FALCON + 2 + ASIC_AC5X @@ -691,7 +706,8 @@ lowercase characters. linux-static autoscan external - pex_eagle + pci + atu 0 0 @@ -1625,7 +1641,7 @@ lowercase characters. 0 2 - true + false false @@ -1645,7 +1661,7 @@ lowercase characters. 1 2 - true + false false @@ -1665,7 +1681,7 @@ lowercase characters. 0 2 - true + false false @@ -1685,7 +1701,7 @@ lowercase characters. 1 2 - true + false false @@ -1771,9 +1787,9 @@ lowercase characters. ORDER_MODE_BY_PORT BLINK_DUTY_CYCLE_1 - BLINK_DURATION_2 + BLINK_DURATION_0 BLINK_DUTY_CYCLE_1 - BLINK_DURATION_2 + BLINK_DURATION_0 PULSE_STRETCH_1 false 1627 diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-L1-AC5X-xb.md5 b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-L1-AC5X-xb.md5 index 6ea0d9634769..575bbf06a1b2 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-L1-AC5X-xb.md5 +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-L1-AC5X-xb.md5 @@ -1 +1 @@ -48c76e16726ad2b1cb797c55c477fc30 \ No newline at end of file +83b91095c99529e49619e31e3fd72101 \ No newline at end of file diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-L1-AC5X-xb.xml b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-L1-AC5X-xb.xml index e00ba0314768..eff23c06ff2b 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-L1-AC5X-xb.xml +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-L1-AC5X-xb.xml @@ -1,5 +1,5 @@ - + diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-PP-AC5X-xb.md5 b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-PP-AC5X-xb.md5 index bcd85e67a645..c043a0d7231f 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-PP-AC5X-xb.md5 +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-PP-AC5X-xb.md5 @@ -1 +1 @@ -d36319f76733ae8593e31f3231599936 \ No newline at end of file +209426f8b550ddf85db19925f9f202a1 \ No newline at end of file diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-PP-AC5X-xb.xml b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-PP-AC5X-xb.xml index cd948edc27f2..9e40492cfe8f 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-PP-AC5X-xb.xml +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-PP-AC5X-xb.xml @@ -1,5 +1,5 @@ - + @@ -519,7 +519,28 @@ 1 + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + ASIC_AC5X AC5X-RD @@ -842,7 +863,6 @@ TCAM_ROUTER_BASED 0 - MID_L3_MID_L2_NO_EM true diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/SAI-AC5X-xb.md5 b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/SAI-AC5X-xb.md5 index dd43b585717b..04eaffc09efc 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/SAI-AC5X-xb.md5 +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/SAI-AC5X-xb.md5 @@ -1 +1 @@ -1ff8c65eb4b5dfff5d2c9be67401c723 \ No newline at end of file +8918d787a5ccaa80a481ddb8b169574a \ No newline at end of file diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/SAI-AC5X-xb.xml b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/SAI-AC5X-xb.xml index d88939c0005f..00c77001f56b 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/SAI-AC5X-xb.xml +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/SAI-AC5X-xb.xml @@ -1,5 +1,5 @@ - + @@ -36,6 +36,26 @@ 2 + + InDropCounter-type + enumeration + Router In Drop Reason Feature Options + + TTL_HOPLIMIT_EXCEEDED + Router In Drop Counters track TTL & Hop Limit Exceeded Packets + 0 + + + ROUTE_BLACKHOLE + Router In Drop Counters track Route Black Hole Packets + 1 + + + IN_DROP_ANY + Router In Drop Counters track either TTL & Hop Limit Exceeded or Route Black Hole Packets + 2 + + log-dest-file-path-type string @@ -62,6 +82,11 @@ ACLs for control packet handling 2 + + debug-counter-acl + ACLs for Debug Counters + 3 + ingress-acl-stage-type @@ -126,6 +151,11 @@ AC5X 1 + + ASIC_Falcon + FALCON + 2 + ASIC_AC5X @@ -400,15 +430,19 @@ 8 8 1024 - 0 - 0 + + + 0 + + IN_DROP_ANY + SAI_LOG_SYSLOG control-acl - 2 + 3 IPCL0 1 @@ -420,7 +454,7 @@ port-sFlow - 3 + 4 IPCL0 0 @@ -432,7 +466,7 @@ port-counters-ipv4-ipv6 - 4 + 5 IPCL0 3 @@ -442,5 +476,15 @@ 0 + + debug-counter-acl + 2 + + disabled + + + disabled + + \ No newline at end of file diff --git a/platform/marvell-arm64/sonic-platform-nokia/7215/modules/nokia_7215_ixs_a1_cpld.c b/platform/marvell-arm64/sonic-platform-nokia/7215/modules/nokia_7215_ixs_a1_cpld.c index d97c9f779538..f0f697708815 100644 --- a/platform/marvell-arm64/sonic-platform-nokia/7215/modules/nokia_7215_ixs_a1_cpld.c +++ b/platform/marvell-arm64/sonic-platform-nokia/7215/modules/nokia_7215_ixs_a1_cpld.c @@ -351,13 +351,13 @@ static ssize_t show_temp_event_status(struct device *dev, struct device_attribut val = nokia_7215_ixs_a1_cpld_read(data, TEMP_EVENT_STATUS_REG); switch (val) { case TS1_ALERT_EVENT: - reason="ts1"; + reason="PCB Back"; break; case TS2_ALERT_EVENT: - reason="ts2"; + reason="PCB Front"; break; case TS3_ALERT_EVENT: - reason="ts3"; + reason="PCB Mid"; break; case CPU_TEMP_EVENT: reason="cpu"; diff --git a/platform/marvell-arm64/sonic-platform-nokia/7215/scripts/nokia-7215-init.sh b/platform/marvell-arm64/sonic-platform-nokia/7215/scripts/nokia-7215-init.sh index 1a3db2f0e716..19edf5ba6a2b 100644 --- a/platform/marvell-arm64/sonic-platform-nokia/7215/scripts/nokia-7215-init.sh +++ b/platform/marvell-arm64/sonic-platform-nokia/7215/scripts/nokia-7215-init.sh @@ -40,6 +40,9 @@ file_exists() { # Install kernel drivers required for i2c bus access load_kernel_drivers +# Disable sysrq-trigger +echo 0 > /proc/sys/kernel/sysrq + #setting up uboot environment fw_uboot_env_cfg diff --git a/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/chassis.py b/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/chassis.py index 19007a3b4de1..41d600147bd9 100644 --- a/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/chassis.py +++ b/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/chassis.py @@ -271,8 +271,11 @@ def get_reboot_cause(self): reboot_cause=(ChassisBase.REBOOT_CAUSE_THERMAL_OVERLOAD_OTHER, thermal) else: reboot_cause=(ChassisBase.REBOOT_CAUSE_NON_HARDWARE, None) - #unmask temperature event + + #Log reboot cause and unmask temperature event + sonic_logger.log_notice("Reboot-cause reported by platform - {}".format(reboot_cause)) self._write_sysfs_file(CPLD_DIR+"temp_event_mask", 0) + return reboot_cause def get_watchdog(self): diff --git a/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/fan.py b/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/fan.py index b86370dc0eec..a8891a51f0f0 100644 --- a/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/fan.py +++ b/platform/marvell-arm64/sonic-platform-nokia/7215/sonic_platform/fan.py @@ -16,8 +16,8 @@ except ImportError as e: raise ImportError(str(e) + "- required module not found") -MAX_IXS7215_FAN_SPEED = 23000 -WORKING_IXS7215_FAN_SPEED = 2300 +MAX_IXS7215_FAN_SPEED = 24000 +WORKING_IXS7215_FAN_SPEED = 2400 sonic_logger = logger.Logger('fan') From f3d1c54ad2349f1e869d9d0edf4e9a9a6bcb3d83 Mon Sep 17 00:00:00 2001 From: Stephen Sun <5379172+stephenxs@users.noreply.github.com> Date: Sun, 12 May 2024 09:57:27 +0800 Subject: [PATCH 282/419] [202311][Mellanox] Support read/write more than 1 page in a single platform API call (#18881) (#18902) Backport PR #18881 to 202311 Support read/write more than 1 page in a single platform API call. Signed-off-by: Stephen Sun --- .../mlnx-platform-api/sonic_platform/sfp.py | 98 ++++++++++++------- .../mlnx-platform-api/tests/test_sfp.py | 20 +++- 2 files changed, 82 insertions(+), 36 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index 90462e9ed0fe..72a8e686b03f 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -355,23 +355,40 @@ def _read_eeprom(self, offset, num_bytes, log_on_error=True): Returns: bytearray: the content of EEPROM """ - _, page, page_offset = self._get_page_and_page_offset(offset) - if not page: - return None + result = None + while num_bytes > 0: + _, page, page_offset = self._get_page_and_page_offset(offset) + if not page: + return None - try: - with open(page, mode='rb', buffering=0) as f: - f.seek(page_offset) - content = f.read(num_bytes) - if ctypes.get_errno() != 0: - raise IOError(f'errno = {os.strerror(ctypes.get_errno())}') - except (OSError, IOError) as e: - if log_on_error: - logger.log_warning(f'Failed to read sfp={self.sdk_index} EEPROM page={page}, page_offset={page_offset}, \ - size={num_bytes}, offset={offset}, error = {e}') - return None + try: + with open(page, mode='rb', buffering=0) as f: + f.seek(page_offset) + content = f.read(num_bytes) + if not result: + result = content + else: + result += content + read_length = len(content) + num_bytes -= read_length + if num_bytes > 0: + page_size = f.seek(0, os.SEEK_END) + if page_offset + read_length == page_size: + offset += read_length + else: + # Indicate read finished + num_bytes = 0 + if ctypes.get_errno() != 0: + raise IOError(f'errno = {os.strerror(ctypes.get_errno())}') + logger.log_debug(f'read EEPROM sfp={self.sdk_index}, page={page}, page_offset={page_offset}, '\ + f'size={read_length}, data={content}') + except (OSError, IOError) as e: + if log_on_error: + logger.log_warning(f'Failed to read sfp={self.sdk_index} EEPROM page={page}, page_offset={page_offset}, '\ + f'size={num_bytes}, offset={offset}, error = {e}') + return None - return bytearray(content) + return bytearray(result) # write eeprom specfic bytes beginning from offset with size as num_bytes def write_eeprom(self, offset, num_bytes, write_buffer): @@ -387,27 +404,38 @@ def write_eeprom(self, offset, num_bytes, write_buffer): logger.log_error("Error mismatch between buffer length and number of bytes to be written") return False - page_num, page, page_offset = self._get_page_and_page_offset(offset) - if not page: - return False + while num_bytes > 0: + page_num, page, page_offset = self._get_page_and_page_offset(offset) + if not page: + return False + + try: + if self._is_write_protected(page_num, page_offset, num_bytes): + # write limited eeprom is not supported + raise IOError('write limited bytes') + with open(page, mode='r+b', buffering=0) as f: + f.seek(page_offset) + ret = f.write(write_buffer[0:num_bytes]) + written_buffer = write_buffer[0:ret] + if ret != num_bytes: + page_size = f.seek(0, os.SEEK_END) + if page_offset + ret == page_size: + # Move to next page + write_buffer = write_buffer[ret:num_bytes] + offset += ret + else: + raise IOError(f'write return code = {ret}') + num_bytes -= ret + if ctypes.get_errno() != 0: + raise IOError(f'errno = {os.strerror(ctypes.get_errno())}') + logger.log_debug(f'write EEPROM sfp={self.sdk_index}, page={page}, page_offset={page_offset}, '\ + f'size={ret}, left={num_bytes}, data={written_buffer}') + except (OSError, IOError) as e: + data = ''.join('{:02x}'.format(x) for x in write_buffer) + logger.log_error(f'Failed to write EEPROM data sfp={self.sdk_index} EEPROM page={page}, page_offset={page_offset}, size={num_bytes}, '\ + f'offset={offset}, data = {data}, error = {e}') + return False - try: - if self._is_write_protected(page_num, page_offset, num_bytes): - # write limited eeprom is not supported - raise IOError('write limited bytes') - - with open(page, mode='r+b', buffering=0) as f: - f.seek(page_offset) - ret = f.write(write_buffer[0:num_bytes]) - if ret != num_bytes: - raise IOError(f'write return code = {ret}') - if ctypes.get_errno() != 0: - raise IOError(f'errno = {os.strerror(ctypes.get_errno())}') - except (OSError, IOError) as e: - data = ''.join('{:02x}'.format(x) for x in write_buffer) - logger.log_error(f'Failed to write EEPROM data sfp={self.sdk_index} EEPROM page={page}, page_offset={page_offset}, size={num_bytes}, \ - offset={offset}, data = {data}, error = {e}') - return False return True @classmethod diff --git a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py index 499983a01e15..c98a0d27fc14 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -131,6 +131,17 @@ def test_sfp_write_eeprom(self, mock_limited_eeprom, mock_get_page): handle.write.side_effect = OSError('') assert not sfp.write_eeprom(0, 1, bytearray([1])) + mo = mock.mock_open() + print('after mock open') + with mock.patch('sonic_platform.sfp.open', mo): + handle = mo() + handle.write.side_effect = [128, 128, 64] + handle.seek.side_effect = [0, 128, 0, 128, 0] + bytes_to_write = bytearray([0]*128 + [1]*128 + [2]*64) + assert sfp.write_eeprom(0, 320, bytes_to_write) + expected_calls = [mock.call(bytes_to_write), mock.call(bytes_to_write[128:]), mock.call(bytes_to_write[256:])] + handle.write.assert_has_calls(expected_calls) + @mock.patch('sonic_platform.sfp.SFP._get_page_and_page_offset') def test_sfp_read_eeprom(self, mock_get_page): sfp = SFP(0) @@ -152,6 +163,13 @@ def test_sfp_read_eeprom(self, mock_get_page): handle.read.side_effect = OSError('') assert sfp.read_eeprom(0, 1) is None + mo = mock.mock_open() + with mock.patch('sonic_platform.sfp.open', mo): + handle = mo() + handle.read.side_effect = [b'\x00'*128, b'\x01'*128, b'\x02'*64] + handle.seek.side_effect = [0, 128, 0, 128, 0] + assert sfp.read_eeprom(0, 320) == bytearray([0]*128 + [1]*128 + [2]*64) + @mock.patch('sonic_platform.sfp.SFP._fetch_port_status') def test_is_port_admin_status_up(self, mock_port_status): mock_port_status.return_value = (0, True) From 9d3329ec6feb4e7baa222b3b2a9c0a6e8e009011 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Mon, 13 May 2024 14:08:35 +0800 Subject: [PATCH 283/419] [ci/build]: 202311 Upgrade SONiC package versions (#18278) --- .../versions-deb-bullseye | 3 +- files/build/versions/default/versions-docker | 24 +-- files/build/versions/default/versions-git | 24 +-- files/build/versions/default/versions-mirror | 24 +-- files/build/versions/default/versions-web | 39 ++-- .../versions-deb-bullseye | 3 +- .../docker-base-buster/versions-deb-buster | 16 +- .../versions-deb-bullseye-arm64 | 6 +- .../versions-deb-bullseye-armhf | 6 +- .../versions-deb-buster | 3 +- .../versions-deb-buster-arm64 | 4 +- .../versions-deb-buster-armhf | 4 +- .../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 | 8 +- .../versions-deb-bullseye | 2 +- .../docker-gbsyncd-vs/versions-deb-bullseye | 6 +- .../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-bullseye | 2 +- .../docker-orchagent/versions-deb-bullseye | 3 +- .../versions-deb-bullseye | 4 +- .../dockers/docker-ptf/versions-deb-buster | 94 ++++----- .../versions-deb-bullseye | 2 +- .../docker-sflow/versions-deb-bullseye | 2 +- .../dockers/docker-snmp/versions-deb-bullseye | 6 +- .../docker-sonic-gnmi/versions-deb-bullseye | 2 +- .../versions-deb-buster | 2 +- .../docker-sonic-vs/versions-deb-bullseye | 14 +- .../versions-deb-bullseye | 10 +- .../versions-deb-bullseye | 5 +- .../versions-deb-bullseye | 10 +- .../docker-syncd-brcm/versions-deb-bullseye | 5 +- .../versions-deb-bullseye | 10 +- .../docker-syncd-centec/versions-deb-bullseye | 2 +- .../versions-deb-bullseye | 4 +- .../docker-syncd-mlnx/versions-deb-bullseye | 13 +- .../versions-deb-bullseye-armhf | 4 +- .../docker-syncd-vs/versions-deb-bullseye | 6 +- .../docker-teamd/versions-deb-bullseye | 2 +- .../versions-deb-bullseye | 95 ++++----- .../versions-deb-bullseye-arm64 | 4 +- .../versions-deb-bullseye-armhf | 6 +- .../sonic-slave-buster/versions-deb-buster | 195 +++++++++--------- .../versions-deb-buster-armhf | 19 ++ .../versions/host-image/versions-deb-bullseye | 45 ++-- .../host-image/versions-deb-bullseye-arm64 | 11 +- .../host-image/versions-deb-bullseye-armhf | 8 +- .../host-image/versions-py3-all-armhf | 5 +- 52 files changed, 420 insertions(+), 356 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 8c2a81ad5b27..413b56edae6a 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,7 +1,6 @@ applibs==1.mlnx.4.6.2202 applibs-dev==1.mlnx.4.6.2202 -debootstrap==1.0.123+deb11u1 -kernel-mft-dkms==4.25.0-62 +kernel-mft-dkms==4.27.0-83 libdashapi==1.0.0 libnl-3-dev==3.5.0-1 libnl-cli-3-200==3.5.0-1 diff --git a/files/build/versions/default/versions-docker b/files/build/versions/default/versions-docker index 88abfc7d1901..3b9e07256828 100644 --- a/files/build/versions/default/versions-docker +++ b/files/build/versions/default/versions-docker @@ -1,12 +1,12 @@ -amd64:amd64/debian:bullseye==sha256:2d2786922ceb0b2c5172e2fee1f0c83bc045afc6d96574305fc74bb8300f75de -amd64:amd64/debian:buster==sha256:e3e2e6c8da3feadd6298d517dfe5ae0c768106b89677cd4cbdfd3806441c5d4b -amd64:debian:bullseye==sha256:171478fbe347a3cfe45058dae333b6ed848fd8ce89f3104c89fa94c245086db1 -amd64:debian:buster==sha256:a52d4e1c201d9ab2f3b939b91a3fdd345d3d11404755bc1cdb22c1d5be131c5d -arm64:arm64v8/debian:bullseye==sha256:2dbcc03931d08f46fbdc0e6fadc83fe2d55787210fea8625449fb64f7de67c8f -arm64:arm64v8/debian:buster==sha256:32c61e9a1b9f7f06a6093bb0749b10159255fe347f0e0531741814c710d5bbbf -arm64:debian:bullseye==sha256:171478fbe347a3cfe45058dae333b6ed848fd8ce89f3104c89fa94c245086db1 -arm64:debian:buster==sha256:a52d4e1c201d9ab2f3b939b91a3fdd345d3d11404755bc1cdb22c1d5be131c5d -armhf:arm32v7/debian:bullseye==sha256:e186179ddb52086b96d93a4621f1d9244ec87011732583d91061a6908bf9bb41 -armhf:arm32v7/debian:buster==sha256:ad22861172e9d868ff5717417d832714caf0d6efd55e622e3298572dcd5bc367 -armhf:debian:bullseye==sha256:171478fbe347a3cfe45058dae333b6ed848fd8ce89f3104c89fa94c245086db1 -armhf:debian:buster==sha256:a52d4e1c201d9ab2f3b939b91a3fdd345d3d11404755bc1cdb22c1d5be131c5d +amd64:amd64/debian:bullseye==sha256:38fb0f1618bfa65b0cf1dd279293ebc70ef94aab2f2dc49274a2efc6ee29880e +amd64:amd64/debian:buster==sha256:255eec9d157d35e00a81a45f1e958fd19437d504139e8eb4ea6cc380ea741ed4 +amd64:debian:bullseye==sha256:f860cec7ccaf31b42cd60b6a409f9dad9510ea27fca9c2864741087b4298a1e3 +amd64:debian:buster==sha256:bce46a1c39574f98c845df4a5acc6c70c211df5a6182e428c1155c33317d4920 +arm64:arm64v8/debian:bullseye==sha256:284d075b0fd0350198c79fcb19b9b0fccac6ade8ada1b1309aee35dd223fc802 +arm64:arm64v8/debian:buster==sha256:4d104dd705ba3cba521271fae2d7259e4bc078c5f4855de32dab30acc9a5d3c5 +arm64:debian:bullseye==sha256:f860cec7ccaf31b42cd60b6a409f9dad9510ea27fca9c2864741087b4298a1e3 +arm64:debian:buster==sha256:bce46a1c39574f98c845df4a5acc6c70c211df5a6182e428c1155c33317d4920 +armhf:arm32v7/debian:bullseye==sha256:c1205d95cc1479322f5c34df0a98f62ede571d041cb02a48ccca34209b3f7be9 +armhf:arm32v7/debian:buster==sha256:540d61b391864b97f3ee3d9d0ded73d21e35b23c3db56c6400ac789118d0f47c +armhf:debian:bullseye==sha256:f860cec7ccaf31b42cd60b6a409f9dad9510ea27fca9c2864741087b4298a1e3 +armhf:debian:buster==sha256:bce46a1c39574f98c845df4a5acc6c70c211df5a6182e428c1155c33317d4920 diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index 2ccddf027307..45c77e7c6384 100644 --- a/files/build/versions/default/versions-git +++ b/files/build/versions/default/versions-git @@ -1,23 +1,23 @@ -https://chromium.googlesource.com/chromium/tools/depot_tools.git==7dc148fe3ca0df5a010cfb3b2fcaa9ea2b48e92d +https://chromium.googlesource.com/chromium/tools/depot_tools.git==a9b9284faf89cd1a426371237df8307c328cc818 https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f -https://github.com/CESNET/libyang.git==fc4dbd923e044006c93df020590a1e5a8656c09e +https://github.com/CESNET/libyang.git==4c733412e7173219166be7053940326a92699765 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==56bb56d8e3b8eb059c50041040a6db7b44bfab77 -https://github.com/FreeRADIUS/freeradius-server.git==82ffbf0e5cb332632afabd6f4be1afc00d4659b1 -https://github.com/FreeRADIUS/pam_radius.git==53c0cfff686ab48ae3bac5449d5461b6e1b83d27 -https://github.com/jeroennijhof/pam_tacplus.git==b89dba44b58ec7fdc9b5365b982aa4a316484a3c +https://github.com/flashrom/flashrom.git==1a779dbfc5fb7830bea7f229ac08cc69eee7e3a0 +https://github.com/FreeRADIUS/freeradius-server.git==4a9fa0d1794e61b2aac651b3f84e44d579813f67 +https://github.com/FreeRADIUS/pam_radius.git==d802da75cbfc3062ae1b18d0bf26ac2a030ffdaa +https://github.com/jeroennijhof/pam_tacplus.git==b839c440e33c36eced9dcbc287fcfe6237c4c4ce https://github.com/jpirko/libteam.git==8b843e93cee1dab61fb79b01791201cdad45e1d1 https://github.com/lguohan/gnxi.git==3adf8b97755b49947e465b5a14645f11e79fa0cd -https://github.com/Marvell-switching/mrvl-prestera.git==b7a14a93b21c099fab6b53f5fc4917ca0eb9b6c9 +https://github.com/Marvell-switching/mrvl-prestera.git==5834b7338ff9ac6f03d45ab85568048be1f62199 https://github.com/Mellanox/libpsample.git==62bb27d9a49424e45191eee81df7ce0d8c74e774 -https://github.com/p4lang/ptf.git==e8b545f3f281fc509c7bdd6c8a4f55bc829149e7 +https://github.com/p4lang/ptf.git==c554f83685186be4cfa9387eb5d6d700d2bbd7c0 https://github.com/p4lang/scapy-vxlan.git==85ffe83da156568ee47a0750f638227e6e1d7479 -https://github.com/sflow/host-sflow==2d9d73c2937577116f679b245bdfc098dbe459d7 -https://github.com/sflow/sflowtool==c1eeb55ad6bfd76283833614a8296f635627e1db -https://github.com/thom311/libnl==b76c3a5d9a0e421fe6cb0e89cceb70ae15b57695 +https://github.com/sflow/host-sflow==6edc82d62a1cf0f7fb821587af67e5520624f50d +https://github.com/sflow/sflowtool==c42c49cb80b927a4c02e54fc26430417f18f4833 +https://github.com/thom311/libnl==7cc72d19f84698a194bee843af66be9be6179baa https://salsa.debian.org/debian/libteam.git==48142125234a665ad5367b724af36a58fb484d3d https://salsa.debian.org/kernel-team/initramfs-tools.git==cf964bfb4362019fd7fba1e839e403ff950dca8e https://salsa.debian.org/sk-guest/monit.git==c9da7ebb1f35dfba17b50b5969a6e75e29cbec0d -https://salsa.debian.org/ssh-team/openssh.git==b9671cc74475922fa61e9ebdba56ec84446d19ac +https://salsa.debian.org/ssh-team/openssh.git==703b8198a123f57fd09e555a4c62b2d55273d57b diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index d6150f6f8140..a3f6530e9223 100644 --- a/files/build/versions/default/versions-mirror +++ b/files/build/versions/default/versions-mirror @@ -1,14 +1,14 @@ 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==20240220T000244Z -debian-security==20240220T000150Z -download.docker.com_linux_debian_dists_bullseye==2024-02-09T13:28:39Z -download.docker.com_linux_debian_dists_buster==2024-02-06T23:41:14Z -packages.trafficmanager.net_snapshot_debian-security_20240220T000150Z_dists_bullseye-security==2024-02-19T01:02:40Z -packages.trafficmanager.net_snapshot_debian-security_20240220T000150Z_dists_buster_updates==2024-02-19T01:02:41Z -packages.trafficmanager.net_snapshot_debian_20240220T000244Z_dists_bullseye==2024-02-10T12:40:37Z -packages.trafficmanager.net_snapshot_debian_20240220T000244Z_dists_bullseye-backports==2024-02-19T20:20:34Z -packages.trafficmanager.net_snapshot_debian_20240220T000244Z_dists_bullseye-updates==2024-02-19T20:20:34Z -packages.trafficmanager.net_snapshot_debian_20240220T000244Z_dists_buster==2023-06-10T08:53:33Z -packages.trafficmanager.net_snapshot_debian_20240220T000244Z_dists_buster-backports==2024-02-19T20:20:34Z -packages.trafficmanager.net_snapshot_debian_20240220T000244Z_dists_buster-updates==2023-06-10T08:55:10Z +debian==20240511T000214Z +debian-security==20240511T000223Z +download.docker.com_linux_debian_dists_bullseye==2024-05-10T08:31:56Z +download.docker.com_linux_debian_dists_buster==2024-05-09T09:19:41Z +packages.trafficmanager.net_snapshot_debian-security_20240511T000223Z_dists_bullseye-security==2024-05-10T17:15:32Z +packages.trafficmanager.net_snapshot_debian-security_20240511T000223Z_dists_buster_updates==2024-05-10T17:15:32Z +packages.trafficmanager.net_snapshot_debian_20240511T000214Z_dists_bullseye==2024-02-10T12:40:37Z +packages.trafficmanager.net_snapshot_debian_20240511T000214Z_dists_bullseye-backports==2024-05-10T20:24:35Z +packages.trafficmanager.net_snapshot_debian_20240511T000214Z_dists_bullseye-updates==2024-05-10T20:24:35Z +packages.trafficmanager.net_snapshot_debian_20240511T000214Z_dists_buster==2023-06-10T08:53:33Z +packages.trafficmanager.net_snapshot_debian_20240511T000214Z_dists_buster-backports==2024-03-09T20:54:54Z +packages.trafficmanager.net_snapshot_debian_20240511T000214Z_dists_buster-updates==2023-06-10T08:55:10Z diff --git a/files/build/versions/default/versions-web b/files/build/versions/default/versions-web index 4c93db4bf2cd..d1cfb5696717 100644 --- a/files/build/versions/default/versions-web +++ b/files/build/versions/default/versions-web @@ -18,11 +18,11 @@ http://deb.debian.org/debian/pool/main/p/protobuf/protobuf_3.21.12-3.debian.tar. http://deb.debian.org/debian/pool/main/p/protobuf/protobuf_3.21.12-3.dsc==d8e34e7b07473c6903f9d245934524fb http://deb.debian.org/debian/pool/main/p/protobuf/protobuf_3.21.12.orig.tar.gz==d38562490234d8080bdbe8eb7baf937a http://ftp.us.debian.org/debian/pool/main/s/scapy/python3-scapy_2.4.0-2_all.deb==b8717ca83b3b60da54bc3f72018964a7 -http://www.mellanox.com/downloads/MFT/mft-4.25.0-62-x86_64-deb.tgz==658a7f7170f6798c98ef8b8045c70f0d +http://www.mellanox.com/downloads/MFT/mft-4.27.0-83-x86_64-deb.tgz==e475ca87a9252ba8d0abb6b05d5d94d0 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 -https://deb.debian.org/debian/pool/main/d/debootstrap/debootstrap_1.0.123+deb11u1.tar.gz==37b56a6cf74721c6496d05d032cd22af +https://deb.debian.org/debian/pool/main/d/debootstrap/debootstrap_1.0.123+deb11u2.dsc==9a06f5bc186878050305303e14d0bf55 +https://deb.debian.org/debian/pool/main/d/debootstrap/debootstrap_1.0.123+deb11u2.tar.gz==90383725eb83811f035d0eaa7289359c https://deb.debian.org/debian/pool/main/k/kdump-tools/kdump-tools_1.6.8.4.dsc==f96a03bb090ab03d484e5d232161fafe https://deb.debian.org/debian/pool/main/k/kdump-tools/kdump-tools_1.6.8.4.tar.xz==26bcae7c27b729d614a4a85e2a01cb64 https://deb.nodesource.com/gpgkey/nodesource.gpg.key==003b51a89a133b5db4cca98b2dea3117 @@ -31,8 +31,8 @@ https://deb.nodesource.com/node_14.x/dists/buster/Release==42875141604382f0abb4d https://deb.nodesource.com/setup_14.x==c30873f4a513bb935afaf8f65e7de9e1 https://download.docker.com/linux/debian/gpg==1afae06b34a13c1b3d9cb61a26285a15 https://github.com/aristanetworks/sonic-firmware/raw/446f30ccd8626f904d89d5798da7294948e090a6/phy/phy-credo_1.0_amd64.deb==6c3d6c32477615cbe049b9161ce15bd5 -https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64==44124b7ea28b7ffc38cb7a6b770b7844 -https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-arm64==13442c16ab9043c7f351f74001c565ac +https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64==4c5f03df0d1074addce889dd53d9564a +https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-arm64==bd02444daced3e97685d1067fbe6498d https://github.com/CentecNetworks/sonic-binaries/raw/master/amd64/sai/libsaictc-dev_1.13.0-1_amd64.deb==b2e4b33541d4ab5de4c1b8eb4a783761 https://github.com/CentecNetworks/sonic-binaries/raw/master/amd64/sai/libsaictc_1.13.0-1_amd64.deb==fd5f2ddc1d9bc12c0e612154c63634cf https://github.com/CentecNetworks/sonic-binaries/raw/master/amd64/third_party/advantech/_Susi4.so==5e1b8daef522c9da00af400abe25810b @@ -40,7 +40,7 @@ https://github.com/CentecNetworks/sonic-binaries/raw/master/amd64/third_party/ad https://github.com/CentecNetworks/sonic-binaries/raw/master/arm64/sai/libsaictc-dev_1.13.0-1_arm64.deb==1162131e154bba573bf7502d743f1d81 https://github.com/CentecNetworks/sonic-binaries/raw/master/arm64/sai/libsaictc_1.13.0-1_arm64.deb==b8b25694a1dc9b4d8dffc2f2c04ddaed 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.12.0-2_armhf.deb==944790bf2d262144cfd939b2caeda1b1 +https://github.com/Marvell-switching/sonic-marvell-binaries/raw/master/armhf/sai-plugin/mrvllibsai_1.13.3-1_armhf.deb==bfeb30fcf6a047040d06a8e6a67b4964 https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2012.2202/fw-SPC-rel-13_2012_2202-EVB.mfa==a77569575da124cdcee7d9b4f09dc5f2 https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2012.2202/fw-SPC2-rel-29_2012_2202-EVB.mfa==5b1138d4f422eebfdabb17ef15dd9d4b https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2012.2202/fw-SPC3-rel-30_2012_2202-EVB.mfa==006291d10adf09b230ee20317b984379 @@ -70,7 +70,7 @@ https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz==6f56ef28c93cee644e8c4aa 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 https://launchpad.net/debian/+archive/primary/+sourcefiles/bash/5.1-2/bash_5.1.orig.tar.xz==6ddb13b6111f601db08fc7c72afa0263 -https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py==963c345c75fe5c5bdedc05ed98a5fd1f +https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py==b16e05ede6aed78f7abadae1185f487d https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.5/swagger-codegen-cli-2.4.5.jar==219f1453ff22482d9e080effbfa7fa81 https://sonicstorage.blob.core.windows.net/debian-security/pool/updates/main/l/linux/linux_5.10.179-3.debian.tar.xz==d7df508e9f8139cd066f23b45d9ae37b https://sonicstorage.blob.core.windows.net/debian-security/pool/updates/main/l/linux/linux_5.10.179-3.dsc==6324f828e630f775e861e64e3b4f38fd @@ -87,15 +87,16 @@ 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-4+deb11u1.debian.tar.xz==a3e626b1ed5adc26430e1727d81641df https://sonicstorage.blob.core.windows.net/debian/pool/main/n/net-snmp/net-snmp_5.9+dfsg-4+deb11u1.dsc==a36ed553b5034b7400d9e9a8d529b27e 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/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 -https://sonicstorage.blob.core.windows.net/packages/debian/thrift_0.11.0-4.debian.tar.xz?sv=2015-04-05&sr=b&sig=dj9uJ5YjUNupcmuxSX6%2F5IS9NqaGAyM9iF2h%2F2rROZA%3D&se=2156-02-02T17%3A19%3A34Z&sp=r==52ad383b97ad051f4d1d25b54aaad569 -https://sonicstorage.blob.core.windows.net/packages/debian/thrift_0.11.0-4.dsc?sv=2015-04-05&sr=b&sig=pWfg55owvQ2jZtZ6ylHp0OP8uZyfc9sxO6H%2BP4Ez7w4%3D&se=2156-02-02T17%3A20%3A05Z&sp=r==6917fe7b3ada9313be94713dd50fee7b -https://sonicstorage.blob.core.windows.net/packages/debian/thrift_0.11.0.orig.tar.gz?sv=2015-04-05&sr=b&sig=%2BrAjWESiSNRCMN7NGqEqVGceLefpwwS%2FWPKEfJpPLSQ%3D&se=2156-02-02T17%3A17%3A20Z&sp=r==0be59730ebce071eceaf6bfdb8d3a20e -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/public/20190307/bcmcmd==b8aefc751bdf93218716bca6797460ff +https://sonicstorage.blob.core.windows.net/public/20190307/dsserve==f9d4b815ebb9be9f755dedca8a51170d +https://sonicstorage.blob.core.windows.net/public/credosai/libsaicredo-owl_0.9.3_amd64.deb?==c69922a1589cf5615a3fddd5b66aa296 +https://sonicstorage.blob.core.windows.net/public/credosai/libsaicredo_0.9.3_amd64.deb==0400bc2015f56bff7d4283c030be26cc +https://sonicstorage.blob.core.windows.net/public/debian/socat_1.7.4.1-3.debian.tar.xz==e8d1e99b4b9e93f5dde860f6d55f42e3 +https://sonicstorage.blob.core.windows.net/public/debian/socat_1.7.4.1-3.dsc==df3ed0dd965589fd09bf6a2920bc273e +https://sonicstorage.blob.core.windows.net/public/debian/socat_1.7.4.1.orig.tar.gz==780d14908dc1a6aa2790de376ab56b7a +https://sonicstorage.blob.core.windows.net/public/debian/thrift_0.11.0-4.debian.tar.xz==52ad383b97ad051f4d1d25b54aaad569 +https://sonicstorage.blob.core.windows.net/public/debian/thrift_0.11.0-4.dsc==6917fe7b3ada9313be94713dd50fee7b +https://sonicstorage.blob.core.windows.net/public/debian/thrift_0.11.0.orig.tar.gz==0be59730ebce071eceaf6bfdb8d3a20e https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.1/amd64/golang-1.15-go_1.15.15-1~deb11u4%2Bfips_amd64.deb==b60f6db62805696b47ab422ab798fe56 https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.1/amd64/golang-1.15-src_1.15.15-1~deb11u4%2Bfips_amd64.deb==1c920937aa49b602a1bfec3c49747131 https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.1/arm64/golang-1.15-go_1.15.15-1~deb11u4%2Bfips_arm64.deb==0b70c104b907db13ff2fe5d52b3d0008 @@ -152,6 +153,12 @@ https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/opens https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/python3.9-minimal_3.9.2-1+fips_arm64.deb==3ad5f86b07a3f5794ddee1dcd69c1d7e https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/python3.9_3.9.2-1+fips_arm64.deb==4d6307dabcd3060235d6188cfa0346b8 https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/symcrypt-openssl_0.10_arm64.deb==7b709cbe2ccbe62fa207b8cae0f88d46 +https://sonicstorage.blob.core.windows.net/public/onie/onie-recovery-x86_64-kvm_x86_64-r0.iso==54e11e450a461b1f4ae39c3ce3f15eff +https://sonicstorage.blob.core.windows.net/public/onie/onie-recovery-x86_64-kvm_x86_64_4_asic-r0.iso==1d8b8d3fa37f842d0184b5205be22be9 +https://sonicstorage.blob.core.windows.net/public/onie/onie-recovery-x86_64-kvm_x86_64_6_asic-r0.iso==58494305d4ac201daedf9364a1018a1b +https://sonicstorage.blob.core.windows.net/public/redis/redis-tools_6.0.6-1_bpo10+1_arm64.deb==282b4766cc9ac7d8bb70622bd69d9f5c +https://sonicstorage.blob.core.windows.net/public/redis/redis-tools_6.0.6-1_bpo10+1_armhf.deb==62f287117afab6caaec564232ebbb5de +https://sonicstorage.blob.core.windows.net/public/redis/redis-tools_6.0.6-1~bpo10+1_amd64.deb==2d58c3c3358290c04d5e0ba70f297f18 https://sonicstorage.blob.core.windows.net/public/sai/bcmpai/REL_3.11/3.11/libsaibroncos_3.11_amd64.deb==6e21a16126e833516a9659d4c35c284e https://storage.googleapis.com/golang/go1.15.15.linux-amd64.tar.gz==b75227438c6129b5013da053b3aa3f38 https://storage.googleapis.com/golang/go1.15.15.linux-arm64.tar.gz==6d721146a9195592d92a80cf27d475f9 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 716540f65ecb..1a43c5332ff9 100644 --- a/files/build/versions/dockers/docker-base-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-base-bullseye/versions-deb-bullseye @@ -2,11 +2,12 @@ ca-certificates==20210119 curl==7.74.0-1.3+deb11u11 iproute2==5.10.0-4 jq==1.6-2.1 -less==551-2 +less==551-2+deb11u2 libatomic1==10.2.1-6 libbpf0==1:0.3-2 libbrotli1==1.0.9-2+b2 libbsd0==0.11.3-1+deb11u1 +libc6==2.31-13+deb11u10 libcap2==1:2.44-1 libcap2-bin==1:2.44-1 libcurl4==7.74.0-1.3+deb11u11 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 ab4875803369..820ceac71c13 100644 --- a/files/build/versions/dockers/docker-base-buster/versions-deb-buster +++ b/files/build/versions/dockers/docker-base-buster/versions-deb-buster @@ -1,13 +1,13 @@ ca-certificates==20200601~deb10u2 -curl==7.64.0-4+deb10u8 +curl==7.64.0-4+deb10u9 jq==1.5+dfsg-2+b1 less==487-0.1+b1 libatomic1==8.3.0-6 -libcurl4==7.64.0-4+deb10u8 +libcurl4==7.64.0-4+deb10u9 libdaemon0==0.14-7 libdbus-1-3==1.12.28-0+deb10u1 libestr0==0.1.10-2.1 -libexpat1==2.2.6-2+deb10u6 +libexpat1==2.2.6-2+deb10u7 libfastjson4==0.99.8-2+deb10u1 libgdbm-compat4==1.18.1-4 libgdbm6==1.18.1-4 @@ -25,7 +25,7 @@ liblognorm5==2.0.5-1 liblua5.1-0==5.1.5-8.1+b2 libmpdec2==2.4.2-2 libncurses6==6.1+20181013-2+deb10u5 -libnghttp2-14==1.36.0-2+deb10u2 +libnghttp2-14==1.36.0-2+deb10u3 libnorm1==1.5.8+dfsg2-1 libonig5==6.9.1-1 libperl5.28==5.28.1-6+deb10u1 @@ -33,8 +33,8 @@ libpgm-5.2-0==5.2.122~dfsg-3 libprocps7==2:3.3.15-2 libpsl5==0.20.2-2 libpython3-stdlib==3.7.3-1 -libpython3.7-minimal==3.7.3-2+deb10u6 -libpython3.7-stdlib==3.7.3-2+deb10u6 +libpython3.7-minimal==3.7.3-2+deb10u7 +libpython3.7-stdlib==3.7.3-2+deb10u7 libreadline7==7.0-5 librtmp1==2.4+20151223.gitfa8646d.1-2 libsasl2-2==2.1.27+dfsg-1+deb10u2 @@ -58,8 +58,8 @@ python3==3.7.3-1 python3-distutils==3.7.3-1 python3-lib2to3==3.7.3-1 python3-minimal==3.7.3-1 -python3.7==3.7.3-2+deb10u6 -python3.7-minimal==3.7.3-2+deb10u6 +python3.7==3.7.3-2+deb10u7 +python3.7-minimal==3.7.3-2+deb10u7 readline-common==7.0-5 redis-tools==5:6.0.6-1~bpo10+1 rsyslog==8.1901.0-1+deb10u2 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 1829220819e8..368e528cff50 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 @@ -1,6 +1,6 @@ icu-devtools==67.1-7 -libc-dev-bin==2.31-13+deb11u8 -libc6-dev==2.31-13+deb11u8 +libc-dev-bin==2.31-13+deb11u10 +libc6-dev==2.31-13+deb11u10 libcrypt-dev==1:4.4.18-4 libicu-dev==67.1-7 libicu67==67.1-7 @@ -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.209-2 +linux-libc-dev==5.10.216-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 1829220819e8..368e528cff50 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 @@ -1,6 +1,6 @@ icu-devtools==67.1-7 -libc-dev-bin==2.31-13+deb11u8 -libc6-dev==2.31-13+deb11u8 +libc-dev-bin==2.31-13+deb11u10 +libc6-dev==2.31-13+deb11u10 libcrypt-dev==1:4.4.18-4 libicu-dev==67.1-7 libicu67==67.1-7 @@ -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.209-2 +linux-libc-dev==5.10.216-1 zlib1g-dev==1:1.2.11.dfsg-2+deb11u2 diff --git a/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster b/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster index 8317e357d67f..5bf6838b1099 100644 --- a/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster +++ b/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster @@ -3,13 +3,14 @@ bzip2==1.0.6-9.2~deb10u2 dpkg-dev==1.19.8 libapt-inst2.0==1.8.2.3 libboost-serialization1.71.0==1.71.0-6~bpo10+1 +libc6==2.28-10+deb10u3 libhiredis0.14==0.14.0-3 libnl-3-200==3.5.0-1 libnl-cli-3-200==3.5.0-1 libnl-genl-3-200==3.5.0-1 libnl-nf-3-200==3.5.0-1 libnl-route-3-200==3.5.0-1 -libpython3.7==3.7.3-2+deb10u6 +libpython3.7==3.7.3-2+deb10u7 libswsscommon==1.0.0 libyang==1.0.73 libyang-cpp==1.0.73 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 37e9e7f025ea..286c5bf29414 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 @@ -1,6 +1,6 @@ icu-devtools==63.1-6+deb10u3 -libc-dev-bin==2.28-10+deb10u2 -libc6-dev==2.28-10+deb10u2 +libc-dev-bin==2.28-10+deb10u3 +libc6-dev==2.28-10+deb10u3 libdpkg-perl==1.19.8 libglib2.0-0==2.58.3-2+deb10u5 libicu-dev==63.1-6+deb10u3 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 37e9e7f025ea..286c5bf29414 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 @@ -1,6 +1,6 @@ icu-devtools==63.1-6+deb10u3 -libc-dev-bin==2.28-10+deb10u2 -libc6-dev==2.28-10+deb10u2 +libc-dev-bin==2.28-10+deb10u3 +libc6-dev==2.28-10+deb10u3 libdpkg-perl==1.19.8 libglib2.0-0==2.58.3-2+deb10u5 libicu-dev==63.1-6+deb10u3 diff --git a/files/build/versions/dockers/docker-database/versions-deb-bullseye b/files/build/versions/dockers/docker-database/versions-deb-bullseye index 5d2c507de040..9edbf469e667 100644 --- a/files/build/versions/dockers/docker-database/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-database/versions-deb-bullseye @@ -8,7 +8,7 @@ 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+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 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 128545e36ed0..9ba38482416f 100644 --- a/files/build/versions/dockers/docker-dhcp-relay/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-dhcp-relay/versions-deb-bullseye @@ -13,7 +13,7 @@ libedit2==3.1-20191231-2+b1 libevent-2.1-7==2.1.12-stable-1 libexplain51==1.4.D001-11+deb11u1 libfido2-1==1.6.0-2 -libglib2.0-0==2.66.8-1+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 diff --git a/files/build/versions/dockers/docker-eventd/versions-deb-bullseye b/files/build/versions/dockers/docker-eventd/versions-deb-bullseye index eb7f7e9c5906..1948dfa0ae85 100644 --- a/files/build/versions/dockers/docker-eventd/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-eventd/versions-deb-bullseye @@ -8,7 +8,7 @@ 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+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 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 7d076b3f8a5c..d3e9ee0080cd 100644 --- a/files/build/versions/dockers/docker-fpm-frr/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-fpm-frr/versions-deb-bullseye @@ -14,7 +14,7 @@ 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+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 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 bf8acc56c2c3..99169d93b946 100644 --- a/files/build/versions/dockers/docker-gbsyncd-broncos/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-gbsyncd-broncos/versions-deb-bullseye @@ -2,8 +2,8 @@ gdb==10.1-1.7 gdbserver==10.1-1.7 libbabeltrace1==1.5.8-1+b3 libboost-regex1.74.0==1.74.0-9 -libc-dev-bin==2.31-13+deb11u8 -libc6-dev==2.31-13+deb11u8 +libc-dev-bin==2.31-13+deb11u10 +libc6-dev==2.31-13+deb11u10 libcbor0==0.5.0+dfsg-2 libcrypt-dev==1:4.4.18-4 libcurl3-gnutls==7.74.0-1.3+deb11u11 @@ -11,7 +11,7 @@ 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+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 @@ -28,7 +28,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.209-2 +linux-libc-dev==5.10.216-1 openssh-client==1:8.4p1-5+deb11u3 sshpass==1.09-1+b1 strace==5.10-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 272f7dca37ab..bc2d5198f03d 100644 --- a/files/build/versions/dockers/docker-gbsyncd-credo/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-gbsyncd-credo/versions-deb-bullseye @@ -8,7 +8,7 @@ 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+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 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 80fb00748bfa..ed6993037463 100644 --- a/files/build/versions/dockers/docker-gbsyncd-vs/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-gbsyncd-vs/versions-deb-bullseye @@ -8,7 +8,7 @@ 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+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgpm2==1.20.7-8 libhiredis0.14-dbgsym==0.14.1-1 libicu67==67.1-7 @@ -16,10 +16,13 @@ libipt2==2.0.3-1 libmpfr6==4.1.0-3 libsaimetadata==1.0.0 libsaimetadata-dbg==1.0.0 +libsaimetadata-dbgsym==1.0.0 libsairedis==1.0.0 libsairedis-dbg==1.0.0 +libsairedis-dbgsym==1.0.0 libsaivs==1.0.0 libsaivs-dbg==1.0.0 +libsaivs-dbgsym==1.0.0 libsource-highlight-common==3.1.9-3 libsource-highlight4v5==3.1.9-3+b1 libswsscommon-dbg==1.0.0 @@ -30,5 +33,6 @@ sshpass==1.09-1+b1 strace==5.10-1 syncd-vs==1.0.0 syncd-vs-dbg==1.0.0 +syncd-vs-dbgsym==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-lldp/versions-deb-bullseye b/files/build/versions/dockers/docker-lldp/versions-deb-bullseye index 561d5fb8ea13..9137e98ce2ce 100644 --- a/files/build/versions/dockers/docker-lldp/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-lldp/versions-deb-bullseye @@ -9,7 +9,7 @@ libdw1==0.183-1 libedit2==3.1-20191231-2+b1 libevent-2.1-7==2.1.12-stable-1 libfido2-1==1.6.0-2 -libglib2.0-0==2.66.8-1+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 diff --git a/files/build/versions/dockers/docker-macsec/versions-deb-bullseye b/files/build/versions/dockers/docker-macsec/versions-deb-bullseye index 671bc7525289..59a882cda7df 100644 --- a/files/build/versions/dockers/docker-macsec/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-macsec/versions-deb-bullseye @@ -9,7 +9,7 @@ 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+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 diff --git a/files/build/versions/dockers/docker-mux/versions-deb-bullseye b/files/build/versions/dockers/docker-mux/versions-deb-bullseye index 2aab48e5f757..93ba8d6d5c85 100644 --- a/files/build/versions/dockers/docker-mux/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-mux/versions-deb-bullseye @@ -12,7 +12,7 @@ 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+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 diff --git a/files/build/versions/dockers/docker-nat/versions-deb-bullseye b/files/build/versions/dockers/docker-nat/versions-deb-bullseye index fa4f16b3aacf..0444d5596dcd 100644 --- a/files/build/versions/dockers/docker-nat/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-nat/versions-deb-bullseye @@ -11,7 +11,7 @@ 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+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgpm2==1.20.7-8 libicu67==67.1-7 libip4tc2==1.8.7-1 diff --git a/files/build/versions/dockers/docker-orchagent/versions-deb-bullseye b/files/build/versions/dockers/docker-orchagent/versions-deb-bullseye index 140922f9cb16..d50021993e20 100644 --- a/files/build/versions/dockers/docker-orchagent/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-orchagent/versions-deb-bullseye @@ -12,7 +12,7 @@ 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+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 @@ -23,6 +23,7 @@ libnetfilter-conntrack3==1.0.8-3 libnfnetlink0==1.0.1-3+b1 libpcap0.8==1.10.0-2 libpci3==1:3.7.0-5 +libsairedis-dbgsym==1.0.0 libsource-highlight-common==3.1.9-3 libsource-highlight4v5==3.1.9-3+b1 libswsscommon-dbgsym==1.0.0 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 ffce1cc9be0a..08097a85f2ff 100644 --- a/files/build/versions/dockers/docker-platform-monitor/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-platform-monitor/versions-deb-bullseye @@ -27,7 +27,7 @@ libfontconfig1==2.13.1-4.2 libfreeipmi17==1.6.6-4+deb11u1 libfreetype6==2.10.4+dfsg-1+deb11u1 libfribidi0==1.0.8-2+deb11u1 -libglib2.0-0==2.66.8-1+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgpm2==1.20.7-8 libgraphite2-3==1.3.14-1 libharfbuzz0b==2.7.4-1 @@ -65,7 +65,7 @@ libxml2==2.9.10+dfsg-6.7+deb11u4 libxrender1==1:0.9.10-1 lm-sensors==1:3.6.0-7 lm-sensors-dbgsym==1:3.6.0-7 -mft==4.25.0-62 +mft==4.27.0-83 openssh-client==1:8.4p1-5+deb11u3 pci.ids==0.0~2021.02.08-1 pciutils==1:3.7.0-5 diff --git a/files/build/versions/dockers/docker-ptf/versions-deb-buster b/files/build/versions/dockers/docker-ptf/versions-deb-buster index d294754da102..f87566b1e2e2 100644 --- a/files/build/versions/dockers/docker-ptf/versions-deb-buster +++ b/files/build/versions/dockers/docker-ptf/versions-deb-buster @@ -18,7 +18,7 @@ cmake-data==3.13.4-1 cpp==4:8.3.0-1 cpp-8==8.3.0-6 cron==3.0pl1-134+deb10u1 -curl==7.64.0-4+deb10u8 +curl==7.64.0-4+deb10u9 dbus==1.12.28-0+deb10u1 dbus-user-session==1.12.28-0+deb10u1 dconf-gsettings-backend==0.30.1-2 @@ -99,9 +99,11 @@ 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+deb10u4 -libc-dev-bin==2.28-10+deb10u2 -libc6-dbg==2.28-10+deb10u2 -libc6-dev==2.28-10+deb10u2 +libc-bin==2.28-10+deb10u3 +libc-dev-bin==2.28-10+deb10u3 +libc6==2.28-10+deb10u3 +libc6-dbg==2.28-10+deb10u3 +libc6-dev==2.28-10+deb10u3 libcairo-gobject2==1.16.0-4+deb10u1 libcairo2==1.16.0-4+deb10u1 libcc1-0==8.3.0-6 @@ -114,8 +116,8 @@ libcryptsetup12==2:2.1.0-5+deb10u2 libcups2==2.2.10-6+deb10u9 libcupsfilters1==1.21.6-5+deb10u1 libcupsimage2==2.2.10-6+deb10u9 -libcurl3-gnutls==7.64.0-4+deb10u8 -libcurl4==7.64.0-4+deb10u8 +libcurl3-gnutls==7.64.0-4+deb10u9 +libcurl4==7.64.0-4+deb10u9 libdaemon0==0.14-7 libdata-dump-perl==1.23-1 libdatrie1==0.2.12-2 @@ -143,8 +145,8 @@ 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 -libexpat1==2.2.6-2+deb10u6 -libexpat1-dev==2.2.6-2+deb10u6 +libexpat1==2.2.6-2+deb10u7 +libexpat1-dev==2.2.6-2+deb10u7 libfakeroot==1.23-1 libfastjson4==0.99.8-2+deb10u1 libffi-dev==3.2.1-9 @@ -161,7 +163,7 @@ 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 +libgd3==2.2.5-5.2+deb10u1 libgdbm-compat4==1.18.1-4 libgdbm6==1.18.1-4 libgdk-pixbuf2.0-0==2.38.1+dfsg-1 @@ -177,7 +179,7 @@ libglib2.0-data==2.58.3-2+deb10u5 libglvnd0==1.1.0-1 libglx-mesa0==18.3.6-2+deb10u1 libglx0==1.1.0-1 -libgnutls-dane0==3.6.7-4+deb10u11 +libgnutls-dane0==3.6.7-4+deb10u12 libgnutls30==3.6.7-4+deb10u10 libgomp1==8.3.0-6 libgpm2==1.20.7-5 @@ -269,7 +271,7 @@ libnet-http-perl==6.18-1 libnet-smtp-ssl-perl==1.04-1 libnet-ssleay-perl==1.85-2+deb10u1 libnet1==1.1.6+dfsg-3.1 -libnghttp2-14==1.36.0-2+deb10u2 +libnghttp2-14==1.36.0-2+deb10u3 libnl-3-200==3.4.0-1 libnl-cli-3-200==3.4.0-1 libnl-genl-3-200==3.4.0-1 @@ -309,28 +311,28 @@ libpython-dev==2.7.16-1 libpython-stdlib==2.7.16-1 libpython2-dev==2.7.16-1 libpython2-stdlib==2.7.16-1 -libpython2.7==2.7.16-2+deb10u3 -libpython2.7-dev==2.7.16-2+deb10u3 -libpython2.7-minimal==2.7.16-2+deb10u3 -libpython2.7-stdlib==2.7.16-2+deb10u3 +libpython2.7==2.7.16-2+deb10u4 +libpython2.7-dev==2.7.16-2+deb10u4 +libpython2.7-minimal==2.7.16-2+deb10u4 +libpython2.7-stdlib==2.7.16-2+deb10u4 libpython3-dev==3.7.3-1 libpython3-stdlib==3.7.3-1 -libpython3.7==3.7.3-2+deb10u6 -libpython3.7-dev==3.7.3-2+deb10u6 -libpython3.7-minimal==3.7.3-2+deb10u6 -libpython3.7-stdlib==3.7.3-2+deb10u6 -libqt5core5a==5.11.3+dfsg1-1+deb10u5 -libqt5dbus5==5.11.3+dfsg1-1+deb10u5 -libqt5gui5==5.11.3+dfsg1-1+deb10u5 +libpython3.7==3.7.3-2+deb10u7 +libpython3.7-dev==3.7.3-2+deb10u7 +libpython3.7-minimal==3.7.3-2+deb10u7 +libpython3.7-stdlib==3.7.3-2+deb10u7 +libqt5core5a==5.11.3+dfsg1-1+deb10u6 +libqt5dbus5==5.11.3+dfsg1-1+deb10u6 +libqt5gui5==5.11.3+dfsg1-1+deb10u6 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 +libqt5network5==5.11.3+dfsg1-1+deb10u6 +libqt5opengl5==5.11.3+dfsg1-1+deb10u6 +libqt5printsupport5==5.11.3+dfsg1-1+deb10u6 libqt5svg5==5.11.3-2 -libqt5widgets5==5.11.3+dfsg1-1+deb10u5 +libqt5widgets5==5.11.3+dfsg1-1+deb10u6 libquadmath0==8.3.0-6 libreadline7==7.0-5 librest-0.7-0==0.8.1-1 @@ -375,17 +377,17 @@ 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~deb10u8 +libtiff5==4.1.0+git191117-2~deb10u9 libtimedate-perl==2.3000-2+deb10u1 libtk8.6==8.6.9-2 libtry-tiny-perl==0.30-1 libtsan0==8.3.0-6 libubsan1==8.3.0-6 libudev1==241-7~deb10u10 -libunbound8==1.9.0-2+deb10u3 +libunbound8==1.9.0-2+deb10u4 liburi-perl==1.76-1 libutempter0==1.1.6-3 -libuv1==1.24.1-1+deb10u1 +libuv1==1.24.1-1+deb10u2 libvisual-0.4-0==0.4.0-15 libvorbis0a==1.3.6-2 libvorbisenc2==1.3.6-2 @@ -399,13 +401,13 @@ libwayland-server0==1.16.0-1 libwebp6==0.6.1-2+deb10u3 libwebpdemux2==0.6.1-2+deb10u3 libwebpmux3==0.6.1-2+deb10u3 -libwireshark-data==2.6.20-0+deb10u7 -libwireshark11==2.6.20-0+deb10u7 -libwiretap8==2.6.20-0+deb10u7 +libwireshark-data==2.6.20-0+deb10u8 +libwireshark11==2.6.20-0+deb10u8 +libwiretap8==2.6.20-0+deb10u8 libwoff1==1.0.2-1 libwrap0==7.6.q-28 -libwscodecs2==2.6.20-0+deb10u7 -libwsutil9==2.6.20-0+deb10u7 +libwscodecs2==2.6.20-0+deb10u8 +libwsutil9==2.6.20-0+deb10u8 libwww-perl==6.36-2 libwww-robotrules-perl==6.02-1 libx11-6==2:1.6.7-1+deb10u4 @@ -506,9 +508,9 @@ python-thrift==0.11.0-4 python2==2.7.16-1 python2-dev==2.7.16-1 python2-minimal==2.7.16-1 -python2.7==2.7.16-2+deb10u3 -python2.7-dev==2.7.16-2+deb10u3 -python2.7-minimal==2.7.16-2+deb10u3 +python2.7==2.7.16-2+deb10u4 +python2.7-dev==2.7.16-2+deb10u4 +python2.7-minimal==2.7.16-2+deb10u4 python3==3.7.3-1 python3-asn1crypto==0.24.0-1 python3-cffi-backend==1.12.2-1 @@ -534,7 +536,7 @@ python3-numpy==1:1.16.2-1 python3-olefile==0.46-1 python3-pexpect==4.6.0-1 python3-pickleshare==0.7.5-1 -python3-pil==5.4.1-2+deb10u4 +python3-pil==5.4.1-2+deb10u6 python3-pip==18.1-5 python3-pkg-resources==40.8.0-1 python3-prompt-toolkit==1.0.15-1 @@ -553,11 +555,11 @@ python3-venv==3.7.3-1 python3-wcwidth==0.1.7+dfsg1-3 python3-wheel==0.32.3-2 python3-xdg==0.25-5 -python3.7==3.7.3-2+deb10u6 -python3.7-dev==3.7.3-2+deb10u6 -python3.7-minimal==3.7.3-2+deb10u6 -python3.7-venv==3.7.3-2+deb10u6 -qt5-gtk-platformtheme==5.11.3+dfsg1-1+deb10u5 +python3.7==3.7.3-2+deb10u7 +python3.7-dev==3.7.3-2+deb10u7 +python3.7-minimal==3.7.3-2+deb10u7 +python3.7-venv==3.7.3-2+deb10u7 +qt5-gtk-platformtheme==5.11.3+dfsg1-1+deb10u6 qttranslations5-l10n==5.11.3-2 readline-common==7.0-5 rsync==3.1.3-6 @@ -586,9 +588,9 @@ vim==2:8.1.0875-5+deb10u6 vim-common==2:8.1.0875-5+deb10u6 vim-runtime==2:8.1.0875-5+deb10u6 wget==1.20.1-1.1 -wireshark==2.6.20-0+deb10u7 -wireshark-common==2.6.20-0+deb10u7 -wireshark-qt==2.6.20-0+deb10u7 +wireshark==2.6.20-0+deb10u8 +wireshark-common==2.6.20-0+deb10u8 +wireshark-qt==2.6.20-0+deb10u8 x11-common==1:7.7+19 x11-utils==7.7+4 x11-xserver-utils==7.7+8 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 ab83ce7865c6..53c44855ff14 100644 --- a/files/build/versions/dockers/docker-router-advertiser/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-router-advertiser/versions-deb-bullseye @@ -8,7 +8,7 @@ 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+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 diff --git a/files/build/versions/dockers/docker-sflow/versions-deb-bullseye b/files/build/versions/dockers/docker-sflow/versions-deb-bullseye index 9c2e1a810961..351cd823756a 100644 --- a/files/build/versions/dockers/docker-sflow/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-sflow/versions-deb-bullseye @@ -11,7 +11,7 @@ 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+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 diff --git a/files/build/versions/dockers/docker-snmp/versions-deb-bullseye b/files/build/versions/dockers/docker-snmp/versions-deb-bullseye index 247f77f7900a..7729918b74f9 100644 --- a/files/build/versions/dockers/docker-snmp/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-snmp/versions-deb-bullseye @@ -4,7 +4,7 @@ gdbserver==10.1-1.7 ipmitool==1.8.18-10.1 libbabeltrace1==1.5.8-1+b3 libboost-regex1.74.0==1.74.0-9 -libc-l10n==2.31-13+deb11u8 +libc-l10n==2.31-13+deb11u10 libcbor0==0.5.0+dfsg-2 libcurl3-gnutls==7.74.0-1.3+deb11u11 libdebuginfod1==0.183-1 @@ -12,7 +12,7 @@ libdw1==0.183-1 libedit2==3.1-20191231-2+b1 libfido2-1==1.6.0-2 libfreeipmi17==1.6.6-4+deb11u1 -libglib2.0-0==2.66.8-1+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 @@ -27,7 +27,7 @@ libsource-highlight-common==3.1.9-3 libsource-highlight4v5==3.1.9-3+b1 libswsscommon-dbgsym==1.0.0 libunwind8==1.3.2-2 -locales==2.31-13+deb11u8 +locales==2.31-13+deb11u10 openssh-client==1:8.4p1-5+deb11u3 pci.ids==0.0~2021.02.08-1 snmp==5.9+dfsg-4+deb11u1 diff --git a/files/build/versions/dockers/docker-sonic-gnmi/versions-deb-bullseye b/files/build/versions/dockers/docker-sonic-gnmi/versions-deb-bullseye index 7ae0b391e217..40e96a175a43 100644 --- a/files/build/versions/dockers/docker-sonic-gnmi/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-sonic-gnmi/versions-deb-bullseye @@ -8,7 +8,7 @@ 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+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 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 989ddfd32b5b..84f912677860 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 @@ -4,7 +4,7 @@ libbabeltrace1==1.5.6-2+deb10u1 libbsd0==0.9.1-2+deb10u1 libcjson-dev==1.7.10-1.1+deb10u2 libcjson1==1.7.10-1.1+deb10u2 -libcurl3-gnutls==7.64.0-4+deb10u8 +libcurl3-gnutls==7.64.0-4+deb10u9 libdw1==0.176-1.1+deb10u1 libedit2==3.1-20181209-1 libglib2.0-0==2.58.3-2+deb10u5 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 e3b668a9e128..f82a0965af6e 100644 --- a/files/build/versions/dockers/docker-sonic-vs/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-sonic-vs/versions-deb-bullseye @@ -34,11 +34,11 @@ iptables==1.8.7-1 krb5-multidev==1.18.3-6+deb11u4+fips libapparmor1==2.13.6-10 libassuan0==2.5.3-7.1 -libblkid-dev==2.36.1-8+deb11u1 +libblkid-dev==2.36.1-8+deb11u2 libbsd-dev==0.11.3-1+deb11u1 libc-ares2==1.17.1-1+deb11u3 -libc-dev-bin==2.31-13+deb11u8 -libc6-dev==2.31-13+deb11u8 +libc-dev-bin==2.31-13+deb11u10 +libc6-dev==2.31-13+deb11u10 libcbor0==0.5.0+dfsg-2 libcrypt-dev==1:4.4.18-4 libdevmapper1.02.1==2:1.02.175-2.1 @@ -51,8 +51,8 @@ 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+deb11u1 -libglib2.0-data==2.66.8-1+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 +libglib2.0-data==2.66.8-1+deb11u3 libgssapi-krb5-2==1.18.3-6+deb11u4+fips libgssrpc4==1.18.3-6+deb11u4+fips libicu-dev==67.1-7 @@ -101,7 +101,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+deb11u1 -linux-libc-dev==5.10.209-2 +linux-libc-dev==5.10.216-1 logrotate==3.18.0-2+deb11u2 lsof==4.93.2+dfsg-1.1 mailcap==3.69 @@ -131,6 +131,6 @@ 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 +uuid-dev==2.36.1-8+deb11u2 x11-common==1:7.7+22 xz-utils==5.2.5-2.1~deb11u1 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 b859c3369054..ccec9b25c822 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 @@ -15,8 +15,8 @@ libarchive13==3.4.3-2+deb11u1 libasan6==10.2.1-6 libbinutils==2.35.2-2 libboost-atomic1.74.0==1.74.0-9 -libc-dev-bin==2.31-13+deb11u8 -libc6-dev==2.31-13+deb11u8 +libc-dev-bin==2.31-13+deb11u10 +libc6-dev==2.31-13+deb11u10 libcc1-0==10.2.1-6 libcrypt-dev==1:4.4.18-4 libctf-nobfd0==2.35.2-2 @@ -26,7 +26,7 @@ libdpkg-perl==1.20.13 libexpat1-dev==2.2.10-2+deb11u5 libffi-dev==3.3-6 libgcc-10-dev==10.2.1-6 -libglib2.0-0==2.66.8-1+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgomp1==10.2.1-6 libicu67==67.1-7 libisl23==0.23-1 @@ -55,9 +55,9 @@ libthrift-0.11.0==0.11.0-4 libtirpc-dev==1.3.1-1+deb11u1 libtsan0==10.2.1-6 libubsan1==10.2.1-6 -libuv1==1.40.0-2 +libuv1==1.40.0-2+deb11u1 libxml2==2.9.10+dfsg-6.7+deb11u4 -linux-libc-dev==5.10.209-2 +linux-libc-dev==5.10.216-1 mailcap==3.69 make==4.3-4.1 mime-support==3.66 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 90a20c6f370d..775ac6c4b0ec 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 @@ -10,14 +10,16 @@ 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+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 libkmod2==28-1 libmpfr6==4.1.0-3 libsaimetadata==1.0.0 +libsaimetadata-dbgsym==1.0.0 libsairedis==1.0.0 +libsairedis-dbgsym==1.0.0 libsource-highlight-common==3.1.9-3 libsource-highlight4v5==3.1.9-3+b1 libswsscommon-dbgsym==1.0.0 @@ -26,5 +28,6 @@ openssh-client==1:8.4p1-5+deb11u3 sshpass==1.09-1+b1 strace==5.10-1 syncd==1.0.0 +syncd-dbgsym==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-syncd-brcm-rpc/versions-deb-bullseye b/files/build/versions/dockers/docker-syncd-brcm-rpc/versions-deb-bullseye index b859c3369054..ccec9b25c822 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 @@ -15,8 +15,8 @@ libarchive13==3.4.3-2+deb11u1 libasan6==10.2.1-6 libbinutils==2.35.2-2 libboost-atomic1.74.0==1.74.0-9 -libc-dev-bin==2.31-13+deb11u8 -libc6-dev==2.31-13+deb11u8 +libc-dev-bin==2.31-13+deb11u10 +libc6-dev==2.31-13+deb11u10 libcc1-0==10.2.1-6 libcrypt-dev==1:4.4.18-4 libctf-nobfd0==2.35.2-2 @@ -26,7 +26,7 @@ libdpkg-perl==1.20.13 libexpat1-dev==2.2.10-2+deb11u5 libffi-dev==3.3-6 libgcc-10-dev==10.2.1-6 -libglib2.0-0==2.66.8-1+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgomp1==10.2.1-6 libicu67==67.1-7 libisl23==0.23-1 @@ -55,9 +55,9 @@ libthrift-0.11.0==0.11.0-4 libtirpc-dev==1.3.1-1+deb11u1 libtsan0==10.2.1-6 libubsan1==10.2.1-6 -libuv1==1.40.0-2 +libuv1==1.40.0-2+deb11u1 libxml2==2.9.10+dfsg-6.7+deb11u4 -linux-libc-dev==5.10.209-2 +linux-libc-dev==5.10.216-1 mailcap==3.69 make==4.3-4.1 mime-support==3.66 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 70ccdd336acc..1c5b66ad5b5c 100644 --- a/files/build/versions/dockers/docker-syncd-brcm/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-brcm/versions-deb-bullseye @@ -10,14 +10,16 @@ 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+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 libkmod2==28-1 libmpfr6==4.1.0-3 libsaimetadata==1.0.0 +libsaimetadata-dbgsym==1.0.0 libsairedis==1.0.0 +libsairedis-dbgsym==1.0.0 libsource-highlight-common==3.1.9-3 libsource-highlight4v5==3.1.9-3+b1 libswsscommon-dbgsym==1.0.0 @@ -28,5 +30,6 @@ openssh-client==1:8.4p1-5+deb11u3 sshpass==1.09-1+b1 strace==5.10-1 syncd==1.0.0 +syncd-dbgsym==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-syncd-centec-rpc/versions-deb-bullseye b/files/build/versions/dockers/docker-syncd-centec-rpc/versions-deb-bullseye index b859c3369054..ccec9b25c822 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 @@ -15,8 +15,8 @@ libarchive13==3.4.3-2+deb11u1 libasan6==10.2.1-6 libbinutils==2.35.2-2 libboost-atomic1.74.0==1.74.0-9 -libc-dev-bin==2.31-13+deb11u8 -libc6-dev==2.31-13+deb11u8 +libc-dev-bin==2.31-13+deb11u10 +libc6-dev==2.31-13+deb11u10 libcc1-0==10.2.1-6 libcrypt-dev==1:4.4.18-4 libctf-nobfd0==2.35.2-2 @@ -26,7 +26,7 @@ libdpkg-perl==1.20.13 libexpat1-dev==2.2.10-2+deb11u5 libffi-dev==3.3-6 libgcc-10-dev==10.2.1-6 -libglib2.0-0==2.66.8-1+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgomp1==10.2.1-6 libicu67==67.1-7 libisl23==0.23-1 @@ -55,9 +55,9 @@ libthrift-0.11.0==0.11.0-4 libtirpc-dev==1.3.1-1+deb11u1 libtsan0==10.2.1-6 libubsan1==10.2.1-6 -libuv1==1.40.0-2 +libuv1==1.40.0-2+deb11u1 libxml2==2.9.10+dfsg-6.7+deb11u4 -linux-libc-dev==5.10.209-2 +linux-libc-dev==5.10.216-1 mailcap==3.69 make==4.3-4.1 mime-support==3.66 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 a3b48eb31ab1..f9547ecf807d 100644 --- a/files/build/versions/dockers/docker-syncd-centec/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-centec/versions-deb-bullseye @@ -9,7 +9,7 @@ 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+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgpm2==1.20.7-8 libhiredis0.14-dbgsym==0.14.1-1 libicu67==67.1-7 diff --git a/files/build/versions/dockers/docker-syncd-mlnx-rpc/versions-deb-bullseye b/files/build/versions/dockers/docker-syncd-mlnx-rpc/versions-deb-bullseye index c1048ab941f8..d6a8d419c528 100644 --- a/files/build/versions/dockers/docker-syncd-mlnx-rpc/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-mlnx-rpc/versions-deb-bullseye @@ -22,7 +22,7 @@ libdouble-conversion3==3.1.5-6.1 libdpkg-perl==1.20.13 libffi-dev==3.3-6 libgcc-10-dev==10.2.1-6 -libglib2.0-0==2.66.8-1+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgomp1==10.2.1-6 libisl23==0.23-1 libitm1==10.2.1-6 @@ -48,7 +48,7 @@ libstdc++-10-dev==10.2.1-6 libthrift-0.11.0==0.11.0-4 libtsan0==10.2.1-6 libubsan1==10.2.1-6 -libuv1==1.40.0-2 +libuv1==1.40.0-2+deb11u1 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 449b0b00274e..a0b84e89731c 100644 --- a/files/build/versions/dockers/docker-syncd-mlnx/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-mlnx/versions-deb-bullseye @@ -7,8 +7,8 @@ iproute2-dev==1.mlnx.4.5.4206 iproute2-mlnx==5.10.0-4~bpo10+1 libbabeltrace1==1.5.8-1+b3 libboost-regex1.74.0==1.74.0-9 -libc-dev-bin==2.31-13+deb11u8 -libc6-dev==2.31-13+deb11u8 +libc-dev-bin==2.31-13+deb11u10 +libc6-dev==2.31-13+deb11u10 libcbor0==0.5.0+dfsg-2 libcrypt-dev==1:4.4.18-4 libcurl3-gnutls==7.74.0-1.3+deb11u11 @@ -18,7 +18,7 @@ libedit2==3.1-20191231-2+b1 libelf1==0.183-1 libexpat1-dev==2.2.10-2+deb11u5 libfido2-1==1.6.0-2 -libglib2.0-0==2.66.8-1+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgpm2==1.20.7-8 libhiredis0.14-dbgsym==0.14.1-1 libicu67==67.1-7 @@ -31,8 +31,10 @@ libpython3-dev==3.9.2-3 libpython3.9-dev==3.9.2-1 libsaimetadata==1.0.0 libsaimetadata-dbg==1.0.0 +libsaimetadata-dbgsym==1.0.0 libsairedis==1.0.0 libsairedis-dbg==1.0.0 +libsairedis-dbgsym==1.0.0 libsource-highlight-common==3.1.9-3 libsource-highlight4v5==3.1.9-3+b1 libswsscommon-dbg==1.0.0 @@ -40,8 +42,8 @@ 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.209-2 -mft==4.25.0-62 +linux-libc-dev==5.10.216-1 +mft==4.27.0-83 mft-fwtrace-cfg==1.0.0 mlnx-sai==1.mlnx.SAIBuild2311.26.0.28 openssh-client==1:8.4p1-5+deb11u3 @@ -79,6 +81,7 @@ sxd-libs==1.mlnx.4.6.2202 sxd-libs-dev==1.mlnx.4.6.2202 syncd==1.0.0 syncd-dbg==1.0.0 +syncd-dbgsym==1.0.0 vim==2:8.2.2434-3+deb11u1 vim-runtime==2:8.2.2434-3+deb11u1 wjh-libs==1.mlnx.4.6.2202 diff --git a/files/build/versions/dockers/docker-syncd-mrvl/versions-deb-bullseye-armhf b/files/build/versions/dockers/docker-syncd-mrvl/versions-deb-bullseye-armhf index 55419d341c51..3ef2bd76d0cd 100644 --- a/files/build/versions/dockers/docker-syncd-mrvl/versions-deb-bullseye-armhf +++ b/files/build/versions/dockers/docker-syncd-mrvl/versions-deb-bullseye-armhf @@ -6,7 +6,7 @@ libdevmapper1.02.1==2:1.02.175-2.1 libdpkg-perl==1.20.13 libevent-2.1-7==2.1.12-stable-1 libexpat1-dev==2.2.10-2+deb11u5 -libglib2.0-0==2.66.8-1+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libnfsidmap2==0.25-6 libpcap-dev==1.10.0-2 libpcap0.8==1.10.0-2 @@ -25,7 +25,7 @@ libsensors4-dev==1:3.6.0-7 libsensors5==1:3.6.0-7 mailcap==3.69 mime-support==3.66 -mrvllibsai==1.12.0-2 +mrvllibsai==1.13.3-1 nfs-common==1:1.3.4-6 pkg-config==0.29.2-1 python-dev-is-python2==2.7.18-9 diff --git a/files/build/versions/dockers/docker-syncd-vs/versions-deb-bullseye b/files/build/versions/dockers/docker-syncd-vs/versions-deb-bullseye index 00c0c3966c98..2cf0b2bd7416 100644 --- a/files/build/versions/dockers/docker-syncd-vs/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-vs/versions-deb-bullseye @@ -9,7 +9,7 @@ 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+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgpm2==1.20.7-8 libhiredis0.14-dbgsym==0.14.1-1 libicu67==67.1-7 @@ -17,10 +17,13 @@ libipt2==2.0.3-1 libmpfr6==4.1.0-3 libsaimetadata==1.0.0 libsaimetadata-dbg==1.0.0 +libsaimetadata-dbgsym==1.0.0 libsairedis==1.0.0 libsairedis-dbg==1.0.0 +libsairedis-dbgsym==1.0.0 libsaivs==1.0.0 libsaivs-dbg==1.0.0 +libsaivs-dbgsym==1.0.0 libsource-highlight-common==3.1.9-3 libsource-highlight4v5==3.1.9-3+b1 libswsscommon-dbgsym==1.0.0 @@ -30,5 +33,6 @@ sshpass==1.09-1+b1 strace==5.10-1 syncd-vs==1.0.0 syncd-vs-dbg==1.0.0 +syncd-vs-dbgsym==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-teamd/versions-deb-bullseye b/files/build/versions/dockers/docker-teamd/versions-deb-bullseye index e12805bc8e6c..9c143f0fec29 100644 --- a/files/build/versions/dockers/docker-teamd/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-teamd/versions-deb-bullseye @@ -8,7 +8,7 @@ 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+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-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 76038461815a..cb9e3fa4063e 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye @@ -33,7 +33,7 @@ binutils-common==2.35.2-2 binutils-x86-64-linux-gnu==2.35.2-2 bison==2:3.7.5+dfsg-1 blt==2.5.3+dfsg-4.1 -bsdextrautils==2.36.1-8+deb11u1 +bsdextrautils==2.36.1-8+deb11u2 build-essential==12.9 byacc==20140715-1+b1 bzip2==1.0.8-4 @@ -101,7 +101,7 @@ docbook-xsl==1.79.2+dfsg-1 docker-buildx-plugin==0.10.5-1~debian.11~bullseye docker-ce==5:24.0.2-1~debian.11~bullseye docker-ce-cli==5:24.0.2-1~debian.11~bullseye -docker-ce-rootless-extras==5:25.0.3-1~debian.11~bullseye +docker-ce-rootless-extras==5:26.1.2-1~debian.11~bullseye docker-compose-plugin==2.18.1-1~debian.11~bullseye docutils-common==0.16+dfsg-4 dosfstools==4.2-1 @@ -204,9 +204,9 @@ i965-va-driver==2.4.1+dfsg1-1 ibverbs-providers==33.2-1 icc-profiles-free==2.0.1+dfsg-1.1 icu-devtools==67.1-7 -imagemagick==8:6.9.11.60+dfsg-1.3+deb11u2 -imagemagick-6-common==8:6.9.11.60+dfsg-1.3+deb11u2 -imagemagick-6.q16==8:6.9.11.60+dfsg-1.3+deb11u2 +imagemagick==8:6.9.11.60+dfsg-1.3+deb11u3 +imagemagick-6-common==8:6.9.11.60+dfsg-1.3+deb11u3 +imagemagick-6.q16==8:6.9.11.60+dfsg-1.3+deb11u3 install-info==6.7.0.dfsg.2-6 intel-media-va-driver==21.1.1+dfsg1-1 intltool-debian==0.35.0+20060710.5 @@ -224,7 +224,7 @@ kernel-wedge==2.104 kmod==28-1 krb5-multidev==1.18.3-6+deb11u4 lcov==1.14-2 -less==551-2 +less==551-2+deb11u2 lib32asan6==10.2.1-6 lib32atomic1==10.2.1-6 lib32gcc-10-dev==10.2.1-6 @@ -306,7 +306,7 @@ libbind-export-dev==1:9.11.19+dfsg-2.1 libbinutils==2.35.2-2 libbit-vector-perl==7.4-1+b7 libblas3==3.9.0-3+deb11u1 -libblkid-dev==2.36.1-8+deb11u1 +libblkid-dev==2.36.1-8+deb11u2 libbluray2==1:1.2.1-4+deb11u2 libboost-atomic-dev==1.74.0.3 libboost-atomic1.74-dev==1.74.0-9 @@ -372,15 +372,16 @@ libbsh-java==2.0b4-20 libbz2-dev==1.0.8-4 libc-ares-dev==1.17.1-1+deb11u3 libc-ares2==1.17.1-1+deb11u3 -libc-dev-bin==2.31-13+deb11u8 -libc-devtools==2.31-13+deb11u8 -libc-l10n==2.31-13+deb11u8 -libc6-dbg==2.31-13+deb11u8 -libc6-dev==2.31-13+deb11u8 -libc6-dev-i386==2.31-13+deb11u8 -libc6-dev-x32==2.31-13+deb11u8 -libc6-i386==2.31-13+deb11u8 -libc6-x32==2.31-13+deb11u8 +libc-dev-bin==2.31-13+deb11u10 +libc-devtools==2.31-13+deb11u10 +libc-l10n==2.31-13+deb11u10 +libc6==2.31-13+deb11u10 +libc6-dbg==2.31-13+deb11u10 +libc6-dev==2.31-13+deb11u10 +libc6-dev-i386==2.31-13+deb11u10 +libc6-dev-x32==2.31-13+deb11u10 +libc6-i386==2.31-13+deb11u10 +libc6-x32==2.31-13+deb11u10 libcaca0==0.99.beta19-2.2 libcacard0==1:2.8.0-3 libcairo-gobject2==1.16.0-5 @@ -461,7 +462,7 @@ libdata-optlist-perl==0.110-1.1 libdata-validate-domain-perl==0.10-1.1 libdatrie-dev==0.2.13-1 libdatrie1==0.2.13-1 -libdav1d4==0.7.1-3 +libdav1d4==0.7.1-3+deb11u1 libdaxctl1==71.1-1 libdb-dev==5.3.1+nmu1 libdb5.3-dev==5.3.28+dfsg1-0.8 @@ -612,11 +613,11 @@ libglapi-mesa==20.3.5-1 libgles-dev==1.3.2-1 libgles1==1.3.2-1 libgles2==1.3.2-1 -libglib2.0-0==2.66.8-1+deb11u1 -libglib2.0-bin==2.66.8-1+deb11u1 -libglib2.0-data==2.66.8-1+deb11u1 -libglib2.0-dev==2.66.8-1+deb11u1 -libglib2.0-dev-bin==2.66.8-1+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 +libglib2.0-bin==2.66.8-1+deb11u3 +libglib2.0-data==2.66.8-1+deb11u3 +libglib2.0-dev==2.66.8-1+deb11u3 +libglib2.0-dev-bin==2.66.8-1+deb11u3 libglu1-mesa==9.0.1-1 libglu1-mesa-dev==9.0.1-1 libglvnd-dev==1.3.2-1 @@ -735,7 +736,7 @@ libjbig0==2.1-3.1+b2 libjbig2dec0==0.19-2 libjemalloc-dev==5.2.1-3 libjemalloc2==5.2.1-3 -libjetty9-java==9.4.50-4+deb11u1 +libjetty9-java==9.4.50-4+deb11u2 libjpeg62-turbo==1:2.0.6-4 libjq1==1.6-2.1 libjs-bootstrap4==4.5.2+dfsg1-8~deb11u1 @@ -810,9 +811,9 @@ liblzo2-2==2.10-2 liblzo2-dev==2.10-2 libmagic-mgc==1:5.39-3+deb11u1 libmagic1==1:5.39-3+deb11u1 -libmagickcore-6.q16-6==8:6.9.11.60+dfsg-1.3+deb11u2 -libmagickcore-6.q16-6-extra==8:6.9.11.60+dfsg-1.3+deb11u2 -libmagickwand-6.q16-6==8:6.9.11.60+dfsg-1.3+deb11u2 +libmagickcore-6.q16-6==8:6.9.11.60+dfsg-1.3+deb11u3 +libmagickcore-6.q16-6-extra==8:6.9.11.60+dfsg-1.3+deb11u3 +libmagickwand-6.q16-6==8:6.9.11.60+dfsg-1.3+deb11u3 libmail-sendmail-perl==0.80-1.1 libmailtools-perl==2.21-1 libmailutils7==1:3.10-3+b1 @@ -858,7 +859,7 @@ libmoose-perl==2.2014-2 libmoosex-aliases-perl==0.11-1.1 libmoox-aliases-perl==0.001006-1.1 libmoox-struct-perl==0.020-1 -libmount-dev==2.36.1-8+deb11u1 +libmount-dev==2.36.1-8+deb11u2 libmouse-perl==2.5.10-1+b1 libmp3lame0==3.100-3 libmpc3==1.2.0-1 @@ -1220,7 +1221,7 @@ libusb-1.0-0-dev==2:1.0.24-3 libusb-1.0-doc==2:1.0.24-3 libusb-dev==2:0.1.12-32 libusbredirparser1==0.8.0-1+b1 -libuv1==1.40.0-2 +libuv1==1.40.0-2+deb11u1 libv4l-0==1.20.0-2 libv4lconvert0==1.20.0-2 libva-drm2==2.10.0-1 @@ -1400,17 +1401,17 @@ 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.209-2 -linux-headers-5.10.0-28-amd64==5.10.209-2 -linux-headers-5.10.0-28-common==5.10.209-2 -linux-headers-amd64==5.10.209-2 -linux-kbuild-5.10==5.10.209-2 -linux-libc-dev==5.10.209-2 +linux-compiler-gcc-10-x86==5.10.216-1 +linux-headers-5.10.0-29-amd64==5.10.216-1 +linux-headers-5.10.0-29-common==5.10.216-1 +linux-headers-amd64==5.10.216-1 +linux-kbuild-5.10==5.10.216-1 +linux-libc-dev==5.10.216-1 linuxdoc-tools==0.9.82-1 llvm-11==1:11.0.1-2 llvm-11-runtime==1:11.0.1-2 lmodern==2.004.5-6.1 -locales==2.31-13+deb11u8 +locales==2.31-13+deb11u10 logrotate==3.18.0-2+deb11u2 lsb-release==11.1.0 lsof==4.93.2+dfsg-1.1 @@ -1452,10 +1453,10 @@ nlohmann-json3-dev==3.9.1-1 node-jquery==3.5.1+dfsg+~3.5.5-7 ocl-icd-libopencl1==2.2.14-2 openjade==1.4devel1-22 -openjdk-11-jdk==11.0.22+7-1~deb11u1 -openjdk-11-jdk-headless==11.0.22+7-1~deb11u1 -openjdk-11-jre==11.0.22+7-1~deb11u1 -openjdk-11-jre-headless==11.0.22+7-1~deb11u1 +openjdk-11-jdk==11.0.23+9-1~deb11u1 +openjdk-11-jdk-headless==11.0.23+9-1~deb11u1 +openjdk-11-jre==11.0.23+9-1~deb11u1 +openjdk-11-jre-headless==11.0.23+9-1~deb11u1 opensp==1.5.2-13+b2 openssh-client==1:8.4p1-5+deb11u3 openssh-server==1:8.4p1-5+deb11u3 @@ -1494,13 +1495,13 @@ php-timer==5.0.3-2 php-tokenizer==1.2.0-1 php-webmozart-assert==1.9.1-2 php-xml==2:7.4+76 -php7.4-cli==7.4.33-1+deb11u4 -php7.4-common==7.4.33-1+deb11u4 -php7.4-json==7.4.33-1+deb11u4 -php7.4-mbstring==7.4.33-1+deb11u4 -php7.4-opcache==7.4.33-1+deb11u4 -php7.4-readline==7.4.33-1+deb11u4 -php7.4-xml==7.4.33-1+deb11u4 +php7.4-cli==7.4.33-1+deb11u5 +php7.4-common==7.4.33-1+deb11u5 +php7.4-json==7.4.33-1+deb11u5 +php7.4-mbstring==7.4.33-1+deb11u5 +php7.4-opcache==7.4.33-1+deb11u5 +php7.4-readline==7.4.33-1+deb11u5 +php7.4-xml==7.4.33-1+deb11u5 phpunit==9.5.2-1 phpunit-cli-parser==1.0.1-1 phpunit-code-unit==1.0.8-1 @@ -1746,7 +1747,7 @@ tk8.6-blt2.5==2.5.3+dfsg-4.1 ucf==3.0043 unattended-upgrades==2.8 unzip==6.0-26+deb11u1 -uuid-dev==2.36.1-8+deb11u1 +uuid-dev==2.36.1-8+deb11u2 va-driver-all==2.10.0-1 vdpau-driver-all==1.4-3 velocity==1.7-6 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 e63c869a25de..decf51c55779 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 @@ -18,6 +18,6 @@ libstdc++6-armhf-cross==10.2.1-6cross1 libubsan1-armhf-cross==10.2.1-6cross1 libunicode-linebreak-perl==0.0.20190101-1+b2 libxslt1-dev==1.1.34-4+deb11u1 -linux-headers-5.10.0-28-arm64==5.10.209-2 -linux-headers-arm64==5.10.209-2 +linux-headers-5.10.0-29-arm64==5.10.216-1 +linux-headers-arm64==5.10.216-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 324174f4275b..82d432729f7e 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 @@ -7,8 +7,8 @@ libjpeg-dev==1:2.0.6-4 libjpeg62-turbo-dev==1:2.0.6-4 libunicode-linebreak-perl==0.0.20190101-1+b2 libxslt1-dev==1.1.34-4+deb11u1 -linux-compiler-gcc-10-arm==5.10.209-2 -linux-headers-5.10.0-28-armmp==5.10.209-2 -linux-headers-armmp==5.10.209-2 +linux-compiler-gcc-10-arm==5.10.216-1 +linux-headers-5.10.0-29-armmp==5.10.216-1 +linux-headers-armmp==5.10.216-1 nasm==2.15.05-1 nodejs==14.21.3-deb-1nodesource1 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 c071a6c203a3..c7789af9c806 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster @@ -56,7 +56,7 @@ cpp==4:8.3.0-1 cpp-8==8.3.0-6 cppcheck==1.86-1 cron==3.0pl1-134+deb10u1 -curl==7.64.0-4+deb10u8 +curl==7.64.0-4+deb10u9 dbus==1.12.28-0+deb10u1 dbus-user-session==1.12.28-0+deb10u1 dconf-gsettings-backend==0.30.1-2 @@ -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+deb10u8 +distro-info-data==0.41+deb10u9 dkms==2.6.1-4 dmeventd==2:1.02.155-3 dmsetup==2:1.02.155-3 @@ -94,7 +94,7 @@ docbook-xml==4.5-8 docker-buildx-plugin==0.10.5-1~debian.10~buster docker-ce==5:24.0.2-1~debian.10~buster docker-ce-cli==5:24.0.2-1~debian.10~buster -docker-ce-rootless-extras==5:25.0.3-1~debian.10~buster +docker-ce-rootless-extras==5:26.1.2-1~debian.10~buster docker-compose-plugin==2.18.1-1~debian.10~buster docutils-common==0.14+dfsg-4 docutils-doc==0.14+dfsg-4 @@ -111,7 +111,7 @@ equivs==2.2.0 exim4-base==4.92-8+deb10u9 exim4-config==4.92-8+deb10u9 exim4-daemon-light==4.92-8+deb10u9 -expat==2.2.6-2+deb10u6 +expat==2.2.6-2+deb10u7 exuberant-ctags==1:5.9~svn20110310-12+deb10u1 fakeroot==1.23-1 file==1:5.35-4+deb10u2 @@ -190,9 +190,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+deb10u5 -imagemagick-6-common==8:6.9.10.23+dfsg-2.1+deb10u5 -imagemagick-6.q16==8:6.9.10.23+dfsg-2.1+deb10u5 +imagemagick==8:6.9.10.23+dfsg-2.1+deb10u7 +imagemagick-6-common==8:6.9.10.23+dfsg-2.1+deb10u7 +imagemagick-6.q16==8:6.9.10.23+dfsg-2.1+deb10u7 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 @@ -291,7 +291,7 @@ libbind9-161==1:9.11.5.P4+dfsg-5.1+deb10u10 libbinutils==2.31.1-16 libbison-dev==2:3.3.2.dfsg-1 libbit-vector-perl==7.4-1+b5 -libblkid-dev==2.33.1-0.1 +libblkid-dev==2.33.1-0.1+deb10u1 libbluetooth3==5.50-1.2~deb10u4 libbluray2==1:1.1.0-1+deb10u1 libboost-atomic1.71-dev==1.71.0-6~bpo10+1 @@ -341,15 +341,16 @@ libbsh-java==2.0b4-19 libbz2-dev==1.0.6-9.2~deb10u2 libc-ares-dev==1.14.0-1+deb10u4 libc-ares2==1.14.0-1+deb10u4 -libc-dev-bin==2.28-10+deb10u2 -libc-l10n==2.28-10+deb10u2 -libc6-dbg==2.28-10+deb10u2 -libc6-dev==2.28-10+deb10u2 -libc6-dev-i386==2.28-10+deb10u2 -libc6-dev-x32==2.28-10+deb10u2 -libc6-i386==2.28-10+deb10u2 -libc6-x32==2.28-10+deb10u2 -libcaca0==0.99.beta19-2.1 +libc-dev-bin==2.28-10+deb10u3 +libc-l10n==2.28-10+deb10u3 +libc6==2.28-10+deb10u3 +libc6-dbg==2.28-10+deb10u3 +libc6-dev==2.28-10+deb10u3 +libc6-dev-i386==2.28-10+deb10u3 +libc6-dev-x32==2.28-10+deb10u3 +libc6-i386==2.28-10+deb10u3 +libc6-x32==2.28-10+deb10u3 +libcaca0==0.99.beta19-2.1+deb10u1 libcacard0==1:2.6.1-1 libcaf-openmpi-3==2.4.0-2 libcairo-gobject2==1.16.0-4+deb10u1 @@ -417,9 +418,9 @@ libcunit1-dev==2.1-3-dfsg-2+b12 libcups2==2.2.10-6+deb10u9 libcupsfilters1==1.21.6-5+deb10u1 libcupsimage2==2.2.10-6+deb10u9 -libcurl3-gnutls==7.64.0-4+deb10u8 -libcurl4==7.64.0-4+deb10u8 -libcurl4-openssl-dev==7.64.0-4+deb10u8 +libcurl3-gnutls==7.64.0-4+deb10u9 +libcurl4==7.64.0-4+deb10u9 +libcurl4-openssl-dev==7.64.0-4+deb10u9 libdaemon-dev==0.14-7 libdaemon0==0.14-7 libdata-dump-perl==1.23-1 @@ -494,8 +495,8 @@ libevent-dev==2.1.8-stable-4 libevent-extra-2.1-6==2.1.8-stable-4 libevent-openssl-2.1-6==2.1.8-stable-4 libevent-pthreads-2.1-6==2.1.8-stable-4 -libexpat1==2.2.6-2+deb10u6 -libexpat1-dev==2.2.6-2+deb10u6 +libexpat1==2.2.6-2+deb10u7 +libexpat1-dev==2.2.6-2+deb10u7 libexplain-dev==1.4.D001-8 libexplain51==1.4.D001-8 libexporter-tiny-perl==1.002001-1 @@ -537,7 +538,7 @@ libgbm1==18.3.6-2+deb10u1 libgc1c2==1:7.6.4-0.4 libgcc-8-dev==8.3.0-6 libgd-perl==2.71-2 -libgd3==2.2.5-5.2 +libgd3==2.2.5-5.2+deb10u1 libgdbm-compat4==1.18.1-4 libgdbm6==1.18.1-4 libgdk-pixbuf2.0-0==2.38.1+dfsg-1 @@ -577,10 +578,10 @@ libgme0==0.6.2-1 libgmock-dev==1.8.1-3 libgmp-dev==2:6.1.2+dfsg-4+deb10u1 libgmpxx4ldbl==2:6.1.2+dfsg-4+deb10u1 -libgnutls-dane0==3.6.7-4+deb10u11 -libgnutls-openssl27==3.6.7-4+deb10u11 -libgnutls28-dev==3.6.7-4+deb10u11 -libgnutlsxx28==3.6.7-4+deb10u11 +libgnutls-dane0==3.6.7-4+deb10u12 +libgnutls-openssl27==3.6.7-4+deb10u12 +libgnutls28-dev==3.6.7-4+deb10u12 +libgnutlsxx28==3.6.7-4+deb10u12 libgomp1==8.3.0-6 libgoogle-perftools4==2.7-1 libgpgme11==1.12.0-6 @@ -691,7 +692,7 @@ libjbig0==2.1-3.1+b2 libjbig2dec0==0.16-1+deb10u1 libjemalloc-dev==5.1.0-3 libjemalloc2==5.1.0-3 -libjetty9-java==9.4.50-4+deb10u1 +libjetty9-java==9.4.50-4+deb10u2 libjpeg62-turbo==1:1.5.2-2+deb10u1 libjq1==1.5+dfsg-2+b1 libjs-bootstrap==3.4.1+dfsg-1 @@ -762,9 +763,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+deb10u5 -libmagickcore-6.q16-6-extra==8:6.9.10.23+dfsg-2.1+deb10u5 -libmagickwand-6.q16-6==8:6.9.10.23+dfsg-2.1+deb10u5 +libmagickcore-6.q16-6==8:6.9.10.23+dfsg-2.1+deb10u7 +libmagickcore-6.q16-6-extra==8:6.9.10.23+dfsg-2.1+deb10u7 +libmagickwand-6.q16-6==8:6.9.10.23+dfsg-2.1+deb10u7 libmail-sendmail-perl==0.80-1 libmailtools-perl==2.18-1 libmariadb-dev==1:10.3.39-0+deb10u2 @@ -796,7 +797,7 @@ libmodule-runtime-perl==0.016-1 libmoo-perl==2.003004-2 libmoose-perl==2.2011-1+b1 libmoosex-aliases-perl==0.11-1 -libmount-dev==2.33.1-0.1 +libmount-dev==2.33.1-0.1+deb10u1 libmp3lame0==3.100-2+b1 libmpc3==1.1.0-1 libmpdec2==2.4.2-2 @@ -833,7 +834,7 @@ libnfnetlink0==1.0.1-3+b1 libnftables0==0.9.0-2 libnftnl-dev==1.1.2-2 libnftnl11==1.1.2-2 -libnghttp2-14==1.36.0-2+deb10u2 +libnghttp2-14==1.36.0-2+deb10u3 libnl-3-200==3.4.0-1 libnl-3-dev==3.4.0-1 libnl-route-3-200==3.4.0-1 @@ -843,7 +844,7 @@ libnorm1==1.5.8+dfsg2-1 libnpth0==1.6-1 libnspr4==2:4.20-1 libnss-systemd==241-7~deb10u10 -libnss3==2:3.42.1-1+deb10u7 +libnss3==2:3.42.1-1+deb10u8 libnuma-dev==2.0.12-1 libnuma1==2.0.12-1 libnumber-compare-perl==0.03-1 @@ -968,20 +969,20 @@ libpython-dev==2.7.16-1 libpython-stdlib==2.7.16-1 libpython2-dev==2.7.16-1 libpython2-stdlib==2.7.16-1 -libpython2.7==2.7.16-2+deb10u3 -libpython2.7-dev==2.7.16-2+deb10u3 -libpython2.7-minimal==2.7.16-2+deb10u3 -libpython2.7-stdlib==2.7.16-2+deb10u3 +libpython2.7==2.7.16-2+deb10u4 +libpython2.7-dev==2.7.16-2+deb10u4 +libpython2.7-minimal==2.7.16-2+deb10u4 +libpython2.7-stdlib==2.7.16-2+deb10u4 libpython3-all-dbg==3.7.3-1 libpython3-all-dev==3.7.3-1 libpython3-dbg==3.7.3-1 libpython3-dev==3.7.3-1 libpython3-stdlib==3.7.3-1 -libpython3.7==3.7.3-2+deb10u6 -libpython3.7-dbg==3.7.3-2+deb10u6 -libpython3.7-dev==3.7.3-2+deb10u6 -libpython3.7-minimal==3.7.3-2+deb10u6 -libpython3.7-stdlib==3.7.3-2+deb10u6 +libpython3.7==3.7.3-2+deb10u7 +libpython3.7-dbg==3.7.3-2+deb10u7 +libpython3.7-dev==3.7.3-2+deb10u7 +libpython3.7-minimal==3.7.3-2+deb10u7 +libpython3.7-stdlib==3.7.3-2+deb10u7 libqdox-java==1.12.1-3 libqdox2-java==2.0~M10-1 libqt4-dbus==4:4.8.7+dfsg-18+deb10u2 @@ -1002,20 +1003,20 @@ libqt4-svg==4:4.8.7+dfsg-18+deb10u2 libqt4-test==4:4.8.7+dfsg-18+deb10u2 libqt4-xml==4:4.8.7+dfsg-18+deb10u2 libqt4-xmlpatterns==4:4.8.7+dfsg-18+deb10u2 -libqt5concurrent5==5.11.3+dfsg1-1+deb10u5 -libqt5core5a==5.11.3+dfsg1-1+deb10u5 -libqt5dbus5==5.11.3+dfsg1-1+deb10u5 -libqt5gui5==5.11.3+dfsg1-1+deb10u5 -libqt5network5==5.11.3+dfsg1-1+deb10u5 -libqt5opengl5==5.11.3+dfsg1-1+deb10u5 -libqt5opengl5-dev==5.11.3+dfsg1-1+deb10u5 -libqt5printsupport5==5.11.3+dfsg1-1+deb10u5 -libqt5sql5==5.11.3+dfsg1-1+deb10u5 -libqt5sql5-sqlite==5.11.3+dfsg1-1+deb10u5 +libqt5concurrent5==5.11.3+dfsg1-1+deb10u6 +libqt5core5a==5.11.3+dfsg1-1+deb10u6 +libqt5dbus5==5.11.3+dfsg1-1+deb10u6 +libqt5gui5==5.11.3+dfsg1-1+deb10u6 +libqt5network5==5.11.3+dfsg1-1+deb10u6 +libqt5opengl5==5.11.3+dfsg1-1+deb10u6 +libqt5opengl5-dev==5.11.3+dfsg1-1+deb10u6 +libqt5printsupport5==5.11.3+dfsg1-1+deb10u6 +libqt5sql5==5.11.3+dfsg1-1+deb10u6 +libqt5sql5-sqlite==5.11.3+dfsg1-1+deb10u6 libqt5svg5==5.11.3-2 -libqt5test5==5.11.3+dfsg1-1+deb10u5 -libqt5widgets5==5.11.3+dfsg1-1+deb10u5 -libqt5xml5==5.11.3+dfsg1-1+deb10u5 +libqt5test5==5.11.3+dfsg1-1+deb10u6 +libqt5widgets5==5.11.3+dfsg1-1+deb10u6 +libqt5xml5==5.11.3+dfsg1-1+deb10u6 libqtcore4==4:4.8.7+dfsg-18+deb10u2 libqtdbus4==4:4.8.7+dfsg-18+deb10u2 libqtgui4==4:4.8.7+dfsg-18+deb10u2 @@ -1141,7 +1142,7 @@ libthai-data==0.1.28-2 libthai0==0.1.28-2 libtheora0==1.1.1+dfsg.1-15 libtie-ixhash-perl==1.23-2 -libtiff5==4.1.0+git191117-2~deb10u8 +libtiff5==4.1.0+git191117-2~deb10u9 libtimedate-perl==2.3000-2+deb10u1 libtinyxml2-6a==7.0.0+dfsg-1 libtinyxml2-dev==7.0.0+dfsg-1 @@ -1157,7 +1158,7 @@ libtypes-serialiser-perl==1.0-1 libubsan1==8.3.0-6 libuchardet0==0.0.6-3 libudev-dev==241-7~deb10u10 -libunbound8==1.9.0-2+deb10u3 +libunbound8==1.9.0-2+deb10u4 libunicode-utf8-perl==0.62-1 libunwind-dev==1.2.1-10~deb10u1 libunwind8==1.2.1-10~deb10u1 @@ -1169,7 +1170,7 @@ libusb-1.0-doc==2:1.0.22-2 libusb-dev==2:0.1.12-32 libusbredirparser1==0.8.0-1 libutempter0==1.1.6-3 -libuv1==1.24.1-1+deb10u1 +libuv1==1.24.1-1+deb10u2 libv4l-0==1.16.3-3 libv4lconvert0==1.16.3-3 libva-drm2==2.4.0-1 @@ -1182,8 +1183,8 @@ libvdpau1==1.1.1-10 libvelocity-tools-java==2.0-7 libvidstab1.1==1.1.0-2 libvirglrenderer0==0.7.0-2+deb10u1 -libvirt-clients==5.0.0-4+deb10u1 -libvirt0==5.0.0-4+deb10u1 +libvirt-clients==5.0.0-4+deb10u2 +libvirt0==5.0.0-4+deb10u2 libvisual-0.4-0==0.4.0-15 libvorbis0a==1.3.6-2 libvorbisenc2==1.3.6-2 @@ -1363,7 +1364,7 @@ llvm-7==1:7.0.1-8+deb10u2 llvm-7-dev==1:7.0.1-8+deb10u2 llvm-7-runtime==1:7.0.1-8+deb10u2 lmodern==2.004.5-6 -locales==2.28-10+deb10u2 +locales==2.28-10+deb10u3 logrotate==3.14.0-4 lsb-base==10.2019051400 lsb-release==10.2019051400 @@ -1399,10 +1400,10 @@ nftables==0.9.0-2 nlohmann-json3-dev==3.5.0-0.1 ocl-icd-libopencl1==2.2.12-2 openjade==1.4devel1-21.3+b1 -openjdk-11-jdk==11.0.22+7-1~deb10u1 -openjdk-11-jdk-headless==11.0.22+7-1~deb10u1 -openjdk-11-jre==11.0.22+7-1~deb10u1 -openjdk-11-jre-headless==11.0.22+7-1~deb10u1 +openjdk-11-jdk==11.0.23+9-1~deb10u1 +openjdk-11-jdk-headless==11.0.23+9-1~deb10u1 +openjdk-11-jre==11.0.23+9-1~deb10u1 +openjdk-11-jre-headless==11.0.23+9-1~deb10u1 openmpi-bin==3.1.3-11 openmpi-common==3.1.3-11 opensp==1.5.2-13+b1 @@ -1441,13 +1442,13 @@ php-token-stream==3.0.1-1 php-tokenizer==1.1.0-1 php-webmozart-assert==1.4.0-3 php-xml==2:7.3+69 -php7.3-cli==7.3.31-1~deb10u5 -php7.3-common==7.3.31-1~deb10u5 -php7.3-json==7.3.31-1~deb10u5 -php7.3-mbstring==7.3.31-1~deb10u5 -php7.3-opcache==7.3.31-1~deb10u5 -php7.3-readline==7.3.31-1~deb10u5 -php7.3-xml==7.3.31-1~deb10u5 +php7.3-cli==7.3.31-1~deb10u6 +php7.3-common==7.3.31-1~deb10u6 +php7.3-json==7.3.31-1~deb10u6 +php7.3-mbstring==7.3.31-1~deb10u6 +php7.3-opcache==7.3.31-1~deb10u6 +php7.3-readline==7.3.31-1~deb10u6 +php7.3-xml==7.3.31-1~deb10u6 phpunit==7.5.6-1 phpunit-code-unit-reverse-lookup==1.0.1-1 phpunit-comparator==3.0.2-1 @@ -1514,7 +1515,7 @@ python-funcsigs==1.0.2-4 python-gi==3.30.4-1 python-html5lib==1.0.1-1 python-hyperlink==17.3.1-2 -python-idna==2.6-1 +python-idna==2.6-1+deb10u1 python-imagesize==1.0.0-1 python-incremental==16.10.1-3 python-ipaddr==2.2.0-2 @@ -1538,7 +1539,7 @@ python-packaging==19.0-1 python-parse==1.6.6-0.1 python-pathlib2==2.3.3-1 python-pbr==4.2.0-5 -python-pil==5.4.1-2+deb10u4 +python-pil==5.4.1-2+deb10u6 python-pip-whl==18.1-5 python-pkg-resources==40.8.0-1 python-pluggy==0.8.0-1 @@ -1575,9 +1576,9 @@ python-zope.interface==4.3.2-1+b2 python2==2.7.16-1 python2-dev==2.7.16-1 python2-minimal==2.7.16-1 -python2.7==2.7.16-2+deb10u3 -python2.7-dev==2.7.16-2+deb10u3 -python2.7-minimal==2.7.16-2+deb10u3 +python2.7==2.7.16-2+deb10u4 +python2.7-dev==2.7.16-2+deb10u4 +python2.7-minimal==2.7.16-2+deb10u4 python3==3.7.3-1 python3-alabaster==0.7.8-1 python3-all==3.7.3-1 @@ -1606,7 +1607,7 @@ python3-docutils==0.14+dfsg-4 python3-entrypoints==0.3-1 python3-gi==3.30.4-1 python3-gpg==1.12.0-6 -python3-idna==2.6-1 +python3-idna==2.6-1+deb10u1 python3-imagesize==1.0.0-1 python3-jinja2==2.10-2+deb10u1 python3-keyring==17.1.1-1 @@ -1623,7 +1624,7 @@ python3-nose2==0.8.0-1 python3-olefile==0.46-1 python3-packaging==19.0-1 python3-pbr==4.2.0-5 -python3-pil==5.4.1-2+deb10u4 +python3-pil==5.4.1-2+deb10u6 python3-pkg-resources==40.8.0-1 python3-pluggy==0.8.0-1 python3-py==1.7.0-2 @@ -1645,26 +1646,26 @@ python3-unidiff==0.5.4-1 python3-urllib3==1.24.1-1+deb10u2 python3-wheel==0.32.3-2 python3-xdg==0.25-5 -python3.7==3.7.3-2+deb10u6 -python3.7-dbg==3.7.3-2+deb10u6 -python3.7-dev==3.7.3-2+deb10u6 -python3.7-minimal==3.7.3-2+deb10u6 +python3.7==3.7.3-2+deb10u7 +python3.7-dbg==3.7.3-2+deb10u7 +python3.7-dev==3.7.3-2+deb10u7 +python3.7-minimal==3.7.3-2+deb10u7 qdbus==4:4.8.7+dfsg-18+deb10u2 -qemu-kvm==1:3.1+dfsg-8+deb10u11 -qemu-system-common==1:3.1+dfsg-8+deb10u11 -qemu-system-data==1:3.1+dfsg-8+deb10u11 -qemu-system-gui==1:3.1+dfsg-8+deb10u11 -qemu-system-x86==1:3.1+dfsg-8+deb10u11 -qemu-utils==1:3.1+dfsg-8+deb10u11 +qemu-kvm==1:3.1+dfsg-8+deb10u12 +qemu-system-common==1:3.1+dfsg-8+deb10u12 +qemu-system-data==1:3.1+dfsg-8+deb10u12 +qemu-system-gui==1:3.1+dfsg-8+deb10u12 +qemu-system-x86==1:3.1+dfsg-8+deb10u12 +qemu-utils==1:3.1+dfsg-8+deb10u12 qt-at-spi==0.4.0-9 qt4-linguist-tools==4:4.8.7+dfsg-18+deb10u2 qt4-qmake==4:4.8.7+dfsg-18+deb10u2 -qt5-default==5.11.3+dfsg1-1+deb10u5 -qt5-gtk-platformtheme==5.11.3+dfsg1-1+deb10u5 -qt5-qmake==5.11.3+dfsg1-1+deb10u5 -qt5-qmake-bin==5.11.3+dfsg1-1+deb10u5 -qtbase5-dev==5.11.3+dfsg1-1+deb10u5 -qtbase5-dev-tools==5.11.3+dfsg1-1+deb10u5 +qt5-default==5.11.3+dfsg1-1+deb10u6 +qt5-gtk-platformtheme==5.11.3+dfsg1-1+deb10u6 +qt5-qmake==5.11.3+dfsg1-1+deb10u6 +qt5-qmake-bin==5.11.3+dfsg1-1+deb10u6 +qtbase5-dev==5.11.3+dfsg1-1+deb10u6 +qtbase5-dev-tools==5.11.3+dfsg1-1+deb10u6 qtchooser==66-2 qtcore4-l10n==4:4.8.7+dfsg-18+deb10u2 qttranslations5-l10n==5.11.3-2 @@ -1737,7 +1738,7 @@ tk8.6-blt2.5==2.5.3+dfsg-4 ucf==3.0038+nmu1 unattended-upgrades==1.11.2 unzip==6.0-23+deb10u3 -uuid-dev==2.33.1-0.1 +uuid-dev==2.33.1-0.1+deb10u1 va-driver-all==2.4.0-1 vdpau-driver-all==1.1.1-10 velocity==1.7-5+deb10u1 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 5957b744fe03..d907e69c5bcc 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 @@ -7,7 +7,26 @@ 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 +libqt5concurrent5==5.11.3+dfsg1-1+deb10u5 +libqt5core5a==5.11.3+dfsg1-1+deb10u5 +libqt5dbus5==5.11.3+dfsg1-1+deb10u5 +libqt5gui5==5.11.3+dfsg1-1+deb10u5 +libqt5network5==5.11.3+dfsg1-1+deb10u5 +libqt5opengl5==5.11.3+dfsg1-1+deb10u5 +libqt5opengl5-dev==5.11.3+dfsg1-1+deb10u5 +libqt5printsupport5==5.11.3+dfsg1-1+deb10u5 +libqt5sql5==5.11.3+dfsg1-1+deb10u5 +libqt5sql5-sqlite==5.11.3+dfsg1-1+deb10u5 +libqt5test5==5.11.3+dfsg1-1+deb10u5 +libqt5widgets5==5.11.3+dfsg1-1+deb10u5 +libqt5xml5==5.11.3+dfsg1-1+deb10u5 libxslt1-dev==1.1.32-2.2~deb10u2 linux-compiler-gcc-8-arm==4.19.304-1 nasm==2.14-1 nodejs==14.21.3-deb-1nodesource1 +qt5-default==5.11.3+dfsg1-1+deb10u5 +qt5-gtk-platformtheme==5.11.3+dfsg1-1+deb10u5 +qt5-qmake==5.11.3+dfsg1-1+deb10u5 +qt5-qmake-bin==5.11.3+dfsg1-1+deb10u5 +qtbase5-dev==5.11.3+dfsg1-1+deb10u5 +qtbase5-dev-tools==5.11.3+dfsg1-1+deb10u5 diff --git a/files/build/versions/host-image/versions-deb-bullseye b/files/build/versions/host-image/versions-deb-bullseye index 7fc74f6c9a1a..f1de04ddc7b6 100644 --- a/files/build/versions/host-image/versions-deb-bullseye +++ b/files/build/versions/host-image/versions-deb-bullseye @@ -11,8 +11,9 @@ binutils==2.35.2-2 binutils-common==2.35.2-2 binutils-x86-64-linux-gnu==2.35.2-2 bridge-utils==1.7-1 -bsdextrautils==2.36.1-8+deb11u1 +bsdextrautils==2.36.1-8+deb11u2 bsdmainutils==12.1.7+nmu3 +bsdutils==1:2.36.1-8+deb11u2 busybox==1:1.30.1-6+b3 ca-certificates==20210119 cgroup-tools==0.41-11 @@ -37,7 +38,7 @@ eatmydata==105-9 ebtables==2.0.11-4+b1 efibootmgr==17-1 efitools==1.9.2-2~deb11u1 -fdisk==2.36.1-8+deb11u1 +fdisk==2.36.1-8+deb11u2 file==1:5.39-3+deb11u1 firmware-amd-graphics==20210315-3 firmware-linux-nonfree==20210315-3 @@ -81,11 +82,11 @@ isc-dhcp-client==4.4.1-2.3+deb11u2 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-23-2-amd64==4.25.0 +kernel-mft-dkms-modules-5.10.0-23-2-amd64==4.27.0 kexec-tools==1:2.0.20-2.1 klibc-utils==2.0.8-6.1 kmod==28-1 -less==551-2 +less==551-2+deb11u2 libabsl20200923==0~20200923.3-2 libapparmor1==2.13.6-10 libargon2-1==0~20171227-0.2 @@ -95,13 +96,16 @@ libatomic1==10.2.1-6 libauparse0==1:3.0-2 libbabeltrace1==1.5.8-1+b3 libbinutils==2.35.2-2 -libblkid-dev==2.36.1-8+deb11u1 +libblkid-dev==2.36.1-8+deb11u2 +libblkid1==2.36.1-8+deb11u2 libboost-serialization1.74.0==1.74.0-9 libbpf0==1:0.3-2 libbrotli1==1.0.9-2+b2 libbsd0==0.11.3-1+deb11u1 libc-ares2==1.17.1-1+deb11u3 -libc-l10n==2.31-13+deb11u8 +libc-bin==2.31-13+deb11u10 +libc-l10n==2.31-13+deb11u10 +libc6==2.31-13+deb11u10 libcap2==1:2.44-1 libcap2-bin==1:2.44-1 libcbor0==0.5.0+dfsg-2 @@ -127,7 +131,7 @@ libelf1==0.183-1 libestr0==0.1.10-2.1+b1 libexpat1==2.2.10-2+deb11u5 libfastjson4==0.99.9-1 -libfdisk1==2.36.1-8+deb11u1 +libfdisk1==2.36.1-8+deb11u2 libfdt1==1.6.0-1 libffi-dev==3.3-6 libfido2-1==1.6.0-2 @@ -139,7 +143,7 @@ libgcc-10-dev==10.2.1-6 libgdbm-compat4==1.19-2 libgdbm6==1.19-2 libgirepository-1.0-1==1.66.1-1+b1 -libglib2.0-0==2.66.8-1+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgomp1==10.2.1-6 libgpm2==1.20.7-8 libgrpc++1==1.30.2-3 @@ -170,6 +174,7 @@ libmagic-mgc==1:5.39-3+deb11u1 libmagic1==1:5.39-3+deb11u1 libmd0==1.0.3-3 libmnl0==1.0.4-3 +libmount1==2.36.1-8+deb11u2 libmpc3==1.2.0-1 libmpdec3==2.5.1-1 libmpfr6==4.1.0-3 @@ -218,6 +223,7 @@ libsasl2-modules-db==2.1.27+dfsg-2.1+deb11u1 libsensors-config==1:3.6.0-7 libsensors5==1:3.6.0-7 libslang2==2.3.2-5 +libsmartcols1==2.36.1-8+deb11u2 libsodium23==1.0.18-1 libsqlite3-0==3.34.1-3 libssh2-1==1.9.0-2 @@ -233,6 +239,7 @@ libubsan1==10.2.1-6 libunwind8==1.3.2-2 libusb-1.0-0==2:1.0.24-3 libutempter0==1.2.1-2 +libuuid1==2.36.1-8+deb11u2 libwrap0==7.6.q-31 libxtables12==1.8.7-1 libyaml-0-2==0.2.2-1 @@ -241,20 +248,21 @@ libyang-cpp==1.0.73 libzmq5==4.3.4-1+deb11u1 linux-base==4.6 linux-image-5.10.0-23-2-amd64-unsigned==5.10.179-3 -linux-perf==5.10.209-2 -linux-perf-5.10==5.10.209-2 -locales==2.31-13+deb11u8 +linux-perf==5.10.216-1 +linux-perf-5.10==5.10.216-1 +locales==2.31-13+deb11u10 logrotate==3.18.0-2+deb11u2 lsb-release==11.1.0 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.25.0-62 +mft==4.27.0-83 mft-fwtrace-cfg==1.0.0 -mft-oem==4.25.0-62 +mft-oem==4.27.0-83 mokutil==0.6.0-2~deb11u1 monit==1:5.20.0-6 +mount==2.36.1-8+deb11u2 mtd-utils==1:2.1.2-2 mtr-tiny==0.94-1+deb11u1 ncal==12.1.7+nmu3 @@ -262,14 +270,14 @@ 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 ntpdate==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+deb11u2+fips -openssh-server==1:8.4p1-5+deb11u2+fips -openssh-sftp-server==1:8.4p1-5+deb11u2+fips -openssl==1.1.1n-0+deb11u5+fips +openssh-client==1:8.4p1-5+deb11u3 +openssh-server==1:8.4p1-5+deb11u3 +openssh-sftp-server==1:8.4p1-5+deb11u3 +openssl==1.1.1w-0+deb11u1 pci.ids==0.0~2021.02.08-1 pciutils==1:3.7.0-5 perl==5.32.1-4+deb11u3 @@ -331,6 +339,7 @@ ucf==3.0043 udev==247.3-7+deb11u4 unzip==6.0-26+deb11u1 usbutils==1:013-3 +util-linux==2.36.1-8+deb11u2 vim==2:8.2.2434-3+deb11u1 vim-common==2:8.2.2434-3+deb11u1 vim-runtime==2:8.2.2434-3+deb11u1 diff --git a/files/build/versions/host-image/versions-deb-bullseye-arm64 b/files/build/versions/host-image/versions-deb-bullseye-arm64 index 248a64964aa4..8db4768eb28b 100644 --- a/files/build/versions/host-image/versions-deb-bullseye-arm64 +++ b/files/build/versions/host-image/versions-deb-bullseye-arm64 @@ -1,8 +1,8 @@ binutils-aarch64-linux-gnu==2.35.2-2 ebtables==2.0.11-4 icu-devtools==67.1-7 -libc-dev-bin==2.31-13+deb11u8 -libc6-dev==2.31-13+deb11u8 +libc-dev-bin==2.31-13+deb11u10 +libc6-dev==2.31-13+deb11u10 libcrypt-dev==1:4.4.18-4 libicu-dev==67.1-7 libicu67==67.1-7 @@ -13,8 +13,13 @@ 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-23-2-arm64-unsigned==5.10.179-3 -linux-libc-dev==5.10.209-2 +linux-libc-dev==5.10.216-1 +ntp==1:4.2.8p15+dfsg-1+deb10u2 ntpstat==0.0.0.1-2 +openssh-client==1:8.4p1-5+deb11u2+fips +openssh-server==1:8.4p1-5+deb11u2+fips +openssh-sftp-server==1:8.4p1-5+deb11u2+fips +openssl==1.1.1n-0+deb11u5+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 04d7c1e78536..5e8afc3a26fb 100644 --- a/files/build/versions/host-image/versions-deb-bullseye-armhf +++ b/files/build/versions/host-image/versions-deb-bullseye-armhf @@ -1,8 +1,8 @@ binutils-arm-linux-gnueabihf==2.35.2-2 ebtables==2.0.11-4 icu-devtools==67.1-7 -libc-dev-bin==2.31-13+deb11u8 -libc6-dev==2.31-13+deb11u8 +libc-dev-bin==2.31-13+deb11u10 +libc6-dev==2.31-13+deb11u10 libcrypt-dev==1:4.4.18-4 libicu-dev==67.1-7 libicu67==67.1-7 @@ -13,12 +13,12 @@ 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-23-2-armmp==5.10.179-3 -linux-libc-dev==5.10.209-2 +linux-libc-dev==5.10.216-1 mrvlprestera==1.0 +ntp==1:4.2.8p15+dfsg-1+deb10u2 ntpstat==0.0.0.1-2 openssh-client==1:8.4p1-5+deb11u2 openssh-server==1:8.4p1-5+deb11u2 openssh-sftp-server==1:8.4p1-5+deb11u2 -openssl==1.1.1w-0+deb11u1 picocom==3.1-2 zlib1g-dev==1:1.2.11.dfsg-2+deb11u2 diff --git a/files/build/versions/host-image/versions-py3-all-armhf b/files/build/versions/host-image/versions-py3-all-armhf index 427877797027..749f4a9720fd 100644 --- a/files/build/versions/host-image/versions-py3-all-armhf +++ b/files/build/versions/host-image/versions-py3-all-armhf @@ -1,10 +1,11 @@ colorful==0.5.6 cryptography==3.3.1 enlighten==1.12.4 -filelock==3.13.1 +filelock==3.14.0 lazy-object-proxy==1.10.0 m2crypto==0.41.0 pexpect==4.9.0 +prefixed==0.7.1 pycairo==1.26.0 -pygments==2.17.2 +pygments==2.18.0 wcwidth==0.2.13 From 2e3968349d9a17f5d82d11ddf832f993ade5a99c Mon Sep 17 00:00:00 2001 From: Gagan Punathil Ellath Date: Mon, 13 May 2024 09:10:11 -0700 Subject: [PATCH 284/419] [202311] Fix for DNS service being canceled (#18846) * Test to fix canceled DNS service * Remove bind dependency --- files/image_config/resolv-config/resolv-config.service | 3 --- 1 file changed, 3 deletions(-) diff --git a/files/image_config/resolv-config/resolv-config.service b/files/image_config/resolv-config/resolv-config.service index 18a261dcf5d0..b13ca841b4a1 100644 --- a/files/image_config/resolv-config/resolv-config.service +++ b/files/image_config/resolv-config/resolv-config.service @@ -2,7 +2,6 @@ Description=Update DNS configuration Requires=updategraph.service After=updategraph.service -BindsTo=sonic.target After=sonic.target StartLimitIntervalSec=0 @@ -11,5 +10,3 @@ Type=oneshot RemainAfterExit=yes ExecStart=/usr/bin/resolv-config.sh start -[Install] -WantedBy=sonic.target From 8e1ab033f12ebef84d9ab006c31b3398ea2cd752 Mon Sep 17 00:00:00 2001 From: Senthil Kumar Guruswamy <75792349+sg893052@users.noreply.github.com> Date: Wed, 10 Apr 2024 00:28:59 +0530 Subject: [PATCH 285/419] Fix for issue#16596 (#17459) ### Why I did it Sysmonitor bug fix Fix for issue#16596 ### How I did it When the system reboots, the system-health service is compelled to halt through the transmission of a SIGTERM signal. Consequently, the system_service function encounters an EOFError, leading to the observation of an exception, which is currently being bypassed. #### How to verify it systemctl restart system-health.service or perform a reboot and check the syslog --- src/system-health/health_checker/sysmonitor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system-health/health_checker/sysmonitor.py b/src/system-health/health_checker/sysmonitor.py index 92777b256c94..5312603d7365 100755 --- a/src/system-health/health_checker/sysmonitor.py +++ b/src/system-health/health_checker/sysmonitor.py @@ -482,7 +482,7 @@ def system_service(self): logger.log_debug("Main process- received event:{} from source:{} time:{}".format(event,event_src,event_time)) logger.log_info("check_unit_status for [ "+event+" ] ") self.check_unit_status(event) - except Empty: + except (Empty, EOFError): pass except Exception as e: logger.log_error("system_service"+str(e)) From 608d747987efac898ca5c7486722111ec7f056c1 Mon Sep 17 00:00:00 2001 From: Stepan Blyshchak <38952541+stepanblyschak@users.noreply.github.com> Date: Tue, 7 May 2024 15:03:09 +0300 Subject: [PATCH 286/419] [Mellanox] Fix reboot script usage in mlnx-onie-fw-update (#18863) /usr/local/bin/reboot could return execution back to the invoking script in case of using graceful reboot. So, exit the script with reboot return code instead of proceeding with execution. - Why I did it Fix BIOS fw update procedure. - How I did it Return exit code from reboot script in mlnx-onie-fw-update.sh - How to verify it Tested with successful reboot Tested with unsuccessful reboot Signed-off-by: Stepan Blyschak --- platform/mellanox/mlnx-onie-fw-update.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/mellanox/mlnx-onie-fw-update.sh b/platform/mellanox/mlnx-onie-fw-update.sh index 4d441c5ced9b..35fdb55dfd93 100755 --- a/platform/mellanox/mlnx-onie-fw-update.sh +++ b/platform/mellanox/mlnx-onie-fw-update.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (c) 2020-2022 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -107,6 +107,7 @@ system_reboot() { # Use SONiC reboot scenario /usr/local/bin/reboot + exit $? } terminate_handler() { From 18eba1885120c387362abb3e6bd0afb4f198e22e Mon Sep 17 00:00:00 2001 From: DavidZagury <32644413+DavidZagury@users.noreply.github.com> Date: Wed, 17 Apr 2024 11:52:43 +0300 Subject: [PATCH 287/419] [Mellanox] Add support for platform SN5400 (#18595) - Why I did it Add support for new platform x86_64-nvidia_sn5400-r0 - How I did it Added all config files that are needed to support SN5400. - How to verify it Run Platform tests Signed-off-by: Kebo Liu --- .../ACS-SN5400/buffers.json.j2 | 1 + .../ACS-SN5400/buffers_defaults_objects.j2 | 1 + .../ACS-SN5400/buffers_defaults_t0.j2 | 1 + .../ACS-SN5400/buffers_defaults_t1.j2 | 1 + .../ACS-SN5400/buffers_dynamic.json.j2 | 1 + .../ACS-SN5400/hwsku.json | 202 +++ .../ACS-SN5400/pg_profile_lookup.ini | 1 + .../ACS-SN5400/port_config.ini | 84 ++ .../ACS-SN5400/qos.json.j2 | 1 + .../ACS-SN5400/sai.profile | 1 + .../ACS-SN5400/sai_5400.xml | 503 +++++++ .../x86_64-nvidia_sn5400-r0/default_sku | 1 + .../x86_64-nvidia_sn5400-r0/pcie.yaml | 145 ++ .../x86_64-nvidia_sn5400-r0/platform.json | 1333 ++++++++++++++++ .../x86_64-nvidia_sn5400-r0/platform_asic | 1 + .../platform_components.json | 16 + .../x86_64-nvidia_sn5400-r0/platform_wait | 1 + .../x86_64-nvidia_sn5400-r0/plugins/eeprom.py | 1 + .../plugins/psuutil.py | 1 + .../plugins/sfplpmget.py | 1 + .../plugins/sfplpmset.py | 1 + .../plugins/sfpreset.py | 1 + .../plugins/sfputil.py | 1 + .../pmon_daemon_control.json | 1 + .../x86_64-nvidia_sn5400-r0/pre_reboot_hook | 1 + .../x86_64-nvidia_sn5400-r0/sensors.conf | 379 +++++ .../system_health_monitoring_config.json | 1 + .../thermal_policy.json | 1 + .../x86_64-nvidia_sn5400_simx-r0/ACS-SN5400 | 1 + .../x86_64-nvidia_sn5400_simx-r0/default_sku | 1 + .../platform.json | 1336 +++++++++++++++++ .../platform_asic | 1 + .../plugins/eeprom.py | 1 + .../plugins/psuutil.py | 1 + .../plugins/sfplpmget.py | 1 + .../plugins/sfplpmset.py | 1 + .../plugins/sfpreset.py | 1 + .../plugins/sfputil.py | 1 + .../pmon_daemon_control.json | 1 + .../syseeprom.hex | 256 ++++ .../system_health_monitoring_config.json | 1 + platform/mellanox/asic_table.j2 | 4 +- .../sonic_platform/device_data.py | 10 +- 43 files changed, 4298 insertions(+), 2 deletions(-) create mode 120000 device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/buffers.json.j2 create mode 120000 device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/buffers_defaults_objects.j2 create mode 120000 device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/buffers_defaults_t0.j2 create mode 120000 device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/buffers_defaults_t1.j2 create mode 120000 device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/buffers_dynamic.json.j2 create mode 100644 device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/hwsku.json create mode 120000 device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/pg_profile_lookup.ini create mode 100644 device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/port_config.ini create mode 120000 device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/qos.json.j2 create mode 100644 device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/sai.profile create mode 100644 device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/sai_5400.xml create mode 100644 device/mellanox/x86_64-nvidia_sn5400-r0/default_sku create mode 100644 device/mellanox/x86_64-nvidia_sn5400-r0/pcie.yaml create mode 100644 device/mellanox/x86_64-nvidia_sn5400-r0/platform.json create mode 100644 device/mellanox/x86_64-nvidia_sn5400-r0/platform_asic create mode 100644 device/mellanox/x86_64-nvidia_sn5400-r0/platform_components.json create mode 120000 device/mellanox/x86_64-nvidia_sn5400-r0/platform_wait create mode 120000 device/mellanox/x86_64-nvidia_sn5400-r0/plugins/eeprom.py create mode 120000 device/mellanox/x86_64-nvidia_sn5400-r0/plugins/psuutil.py create mode 120000 device/mellanox/x86_64-nvidia_sn5400-r0/plugins/sfplpmget.py create mode 120000 device/mellanox/x86_64-nvidia_sn5400-r0/plugins/sfplpmset.py create mode 120000 device/mellanox/x86_64-nvidia_sn5400-r0/plugins/sfpreset.py create mode 120000 device/mellanox/x86_64-nvidia_sn5400-r0/plugins/sfputil.py create mode 120000 device/mellanox/x86_64-nvidia_sn5400-r0/pmon_daemon_control.json create mode 120000 device/mellanox/x86_64-nvidia_sn5400-r0/pre_reboot_hook create mode 100644 device/mellanox/x86_64-nvidia_sn5400-r0/sensors.conf create mode 120000 device/mellanox/x86_64-nvidia_sn5400-r0/system_health_monitoring_config.json create mode 120000 device/mellanox/x86_64-nvidia_sn5400-r0/thermal_policy.json create mode 120000 device/mellanox/x86_64-nvidia_sn5400_simx-r0/ACS-SN5400 create mode 120000 device/mellanox/x86_64-nvidia_sn5400_simx-r0/default_sku create mode 100644 device/mellanox/x86_64-nvidia_sn5400_simx-r0/platform.json create mode 100644 device/mellanox/x86_64-nvidia_sn5400_simx-r0/platform_asic create mode 120000 device/mellanox/x86_64-nvidia_sn5400_simx-r0/plugins/eeprom.py create mode 120000 device/mellanox/x86_64-nvidia_sn5400_simx-r0/plugins/psuutil.py create mode 120000 device/mellanox/x86_64-nvidia_sn5400_simx-r0/plugins/sfplpmget.py create mode 120000 device/mellanox/x86_64-nvidia_sn5400_simx-r0/plugins/sfplpmset.py create mode 120000 device/mellanox/x86_64-nvidia_sn5400_simx-r0/plugins/sfpreset.py create mode 120000 device/mellanox/x86_64-nvidia_sn5400_simx-r0/plugins/sfputil.py create mode 120000 device/mellanox/x86_64-nvidia_sn5400_simx-r0/pmon_daemon_control.json create mode 100644 device/mellanox/x86_64-nvidia_sn5400_simx-r0/syseeprom.hex create mode 120000 device/mellanox/x86_64-nvidia_sn5400_simx-r0/system_health_monitoring_config.json diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/buffers.json.j2 b/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/buffers.json.j2 new file mode 120000 index 000000000000..add8bf8bb7c2 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/buffers.json.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/buffers_defaults_objects.j2 b/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/buffers_defaults_objects.j2 new file mode 120000 index 000000000000..33b6704f9902 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/buffers_defaults_objects.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_defaults_objects.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/buffers_defaults_t0.j2 b/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..febae7236f21 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +../../x86_64-nvidia_sn5600-r0/ACS-SN5600/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/buffers_defaults_t1.j2 b/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/buffers_defaults_t1.j2 new file mode 120000 index 000000000000..25908aded108 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/buffers_defaults_t1.j2 @@ -0,0 +1 @@ +../../x86_64-nvidia_sn5600-r0/ACS-SN5600/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/buffers_dynamic.json.j2 b/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/buffers_dynamic.json.j2 new file mode 120000 index 000000000000..8c4117c66214 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/buffers_dynamic.json.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_dynamic.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/hwsku.json b/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/hwsku.json new file mode 100644 index 000000000000..abe6649e7db1 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/hwsku.json @@ -0,0 +1,202 @@ +{ + "interfaces": { + "Ethernet0": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet8": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet16": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet24": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet32": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet40": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet48": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet56": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet64": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet72": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet80": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet88": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet96": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet104": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet112": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet120": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet128": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet136": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet144": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet152": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet160": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet168": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet176": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet184": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet192": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet200": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet208": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet216": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet224": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet232": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet240": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet248": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet256": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet264": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet272": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet280": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet288": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet296": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet304": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet312": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet320": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet328": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet336": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet344": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet352": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet360": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet368": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet376": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet384": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet392": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet400": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet408": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet416": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet424": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet432": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet440": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet448": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet456": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet464": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet472": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet480": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet488": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet496": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet504": { + "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G]" + }, + "Ethernet512": { + "default_brkout_mode": "1x25G[10G]" + }, + "Ethernet513": { + "default_brkout_mode": "1x25G[10G]" + } + } +} diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/pg_profile_lookup.ini b/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/pg_profile_lookup.ini new file mode 120000 index 000000000000..402daee2bda0 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/pg_profile_lookup.ini @@ -0,0 +1 @@ +../../x86_64-nvidia_sn5600-r0/ACS-SN5600/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/port_config.ini b/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/port_config.ini new file mode 100644 index 000000000000..4b62d3abf172 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/port_config.ini @@ -0,0 +1,84 @@ +## +## Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. +## Apache-2.0 +## +## Licensed under the Apache License, Version 2.0 (the "License"); +## you may not use this file except in compliance with the License. +## You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## + +# name lanes alias index +Ethernet0 0,1,2,3,4,5,6,7 etp1 1 +Ethernet8 8,9,10,11,12,13,14,15 etp2 2 +Ethernet16 16,17,18,19,20,21,22,23 etp3 3 +Ethernet24 24,25,26,27,28,29,30,31 etp4 4 +Ethernet32 32,33,34,35,36,37,38,39 etp5 5 +Ethernet40 40,41,42,43,44,45,46,47 etp6 6 +Ethernet48 48,49,50,51,52,53,54,55 etp7 7 +Ethernet56 56,57,58,59,60,61,62,63 etp8 8 +Ethernet64 64,65,66,67,68,69,70,71 etp9 9 +Ethernet72 72,73,74,75,76,77,78,79 etp10 10 +Ethernet80 80,81,82,83,84,85,86,87 etp11 11 +Ethernet88 88,89,90,91,92,93,94,95 etp12 12 +Ethernet96 96,97,98,99,100,101,102,103 etp13 13 +Ethernet104 104,105,106,107,108,109,110,111 etp14 14 +Ethernet112 112,113,114,115,116,117,118,119 etp15 15 +Ethernet120 120,121,122,123,124,125,126,127 etp16 16 +Ethernet128 128,129,130,131,132,133,134,135 etp17 17 +Ethernet136 136,137,138,139,140,141,142,143 etp18 18 +Ethernet144 144,145,146,147,148,149,150,151 etp19 19 +Ethernet152 152,153,154,155,156,157,158,159 etp20 20 +Ethernet160 160,161,162,163,164,165,166,167 etp21 21 +Ethernet168 168,169,170,171,172,173,174,175 etp22 22 +Ethernet176 176,177,178,179,180,181,182,183 etp23 23 +Ethernet184 184,185,186,187,188,189,190,191 etp24 24 +Ethernet192 192,193,194,195,196,197,198,199 etp25 25 +Ethernet200 200,201,202,203,204,205,206,207 etp26 26 +Ethernet208 208,209,210,211,212,213,214,215 etp27 27 +Ethernet216 216,217,218,219,220,221,222,223 etp28 28 +Ethernet224 224,225,226,227,228,229,230,231 etp29 29 +Ethernet232 232,233,234,235,236,237,238,239 etp30 30 +Ethernet240 240,241,242,243,244,245,246,247 etp31 31 +Ethernet248 248,249,250,251,252,253,254,255 etp32 32 +Ethernet256 256,257,258,259,260,261,262,263 etp33 33 +Ethernet264 264,265,266,267,268,269,270,271 etp34 34 +Ethernet272 272,273,274,275,276,277,278,279 etp35 35 +Ethernet280 280,281,282,283,284,285,286,287 etp36 36 +Ethernet288 288,289,290,291,292,293,294,295 etp37 37 +Ethernet296 296,297,298,299,300,301,302,303 etp38 38 +Ethernet304 304,305,306,307,308,309,310,311 etp39 39 +Ethernet312 312,313,314,315,316,317,318,319 etp40 40 +Ethernet320 320,321,322,323,324,325,326,327 etp41 41 +Ethernet328 328,329,330,331,332,333,334,335 etp42 42 +Ethernet336 336,337,338,339,340,341,342,343 etp43 43 +Ethernet344 344,345,346,347,348,349,350,351 etp44 44 +Ethernet352 352,353,354,355,356,357,358,359 etp45 45 +Ethernet360 360,361,362,363,364,365,366,367 etp46 46 +Ethernet368 368,369,370,371,372,373,374,375 etp47 47 +Ethernet376 376,377,378,379,380,381,382,383 etp48 48 +Ethernet384 384,385,386,387,388,389,390,391 etp49 49 +Ethernet392 392,393,394,395,396,397,398,399 etp50 50 +Ethernet400 400,401,402,403,404,405,406,407 etp51 51 +Ethernet408 408,409,410,411,412,413,414,415 etp52 52 +Ethernet416 416,417,418,419,420,421,422,423 etp53 53 +Ethernet424 424,425,426,427,428,429,430,431 etp54 54 +Ethernet432 432,433,434,435,436,437,438,439 etp55 55 +Ethernet440 440,441,442,443,444,445,446,447 etp56 56 +Ethernet448 448,449,450,451,452,453,454,455 etp57 57 +Ethernet456 456,457,458,459,460,461,462,463 etp58 58 +Ethernet464 464,465,466,467,468,469,470,471 etp59 59 +Ethernet472 472,473,474,475,476,477,478,479 etp60 60 +Ethernet480 480,481,482,483,484,485,486,487 etp61 61 +Ethernet488 488,489,490,491,492,493,494,495 etp62 62 +Ethernet496 496,497,498,499,500,501,502,503 etp63 63 +Ethernet504 504,505,506,507,508,509,510,511 etp64 64 +Ethernet512 512 etp65 65 +Ethernet513 513 etp66 66 diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/qos.json.j2 b/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/qos.json.j2 new file mode 120000 index 000000000000..eccf286dc879 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/qos.json.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/qos.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/sai.profile b/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/sai.profile new file mode 100644 index 000000000000..e9809c749b0a --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/sai.profile @@ -0,0 +1 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_5400.xml diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/sai_5400.xml b/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/sai_5400.xml new file mode 100644 index 000000000000..6f9b541713e7 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/sai_5400.xml @@ -0,0 +1,503 @@ + + + + + + + 00:02:03:04:05:00 + + + 1 + + + 66 + + + 1 + + + + + 1 + 8 + 34 + 3 + 32768 + + + 5 + 8 + 35 + 3 + 32768 + + + 9 + 8 + 33 + 3 + 32768 + + + 13 + 8 + 32 + 3 + 32768 + + + 17 + 8 + 38 + 3 + 32768 + + + 21 + 8 + 39 + 3 + 32768 + + + 25 + 8 + 37 + 3 + 32768 + + + 29 + 8 + 36 + 3 + 32768 + + + 33 + 8 + 43 + 3 + 32768 + + + 37 + 8 + 42 + 3 + 32768 + + + 41 + 8 + 41 + 3 + 32768 + + + 45 + 8 + 40 + 3 + 32768 + + + 49 + 8 + 46 + 3 + 32768 + + + 53 + 8 + 47 + 3 + 32768 + + + 57 + 8 + 45 + 3 + 32768 + + + 61 + 8 + 44 + 3 + 32768 + + + 65 + 8 + 51 + 3 + 32768 + + + 69 + 8 + 50 + 3 + 32768 + + + 73 + 8 + 48 + 3 + 32768 + + + 77 + 8 + 49 + 3 + 32768 + + + 81 + 8 + 55 + 3 + 32768 + + + 85 + 8 + 54 + 3 + 32768 + + + 89 + 8 + 53 + 3 + 32768 + + + 93 + 8 + 52 + 3 + 32768 + + + 97 + 8 + 59 + 3 + 32768 + + + 101 + 8 + 58 + 3 + 32768 + + + 105 + 8 + 56 + + 3 + + 32768 + + + 109 + 8 + 57 + 3 + 32768 + + + 113 + 8 + 63 + 3 + 32768 + + + 117 + 8 + 62 + 3 + 32768 + + + 121 + 8 + 60 + 3 + 32768 + + + 125 + 8 + 61 + 3 + 32768 + + + 129 + 8 + 29 + 3 + 32768 + + + 133 + 8 + 28 + 3 + 32768 + + + 137 + 8 + 30 + 3 + 32768 + + + 141 + 8 + 31 + 3 + 32768 + + + 145 + 8 + 25 + 3 + 32768 + + + 149 + 8 + 24 + 3 + 32768 + + + 153 + 8 + 26 + 3 + 32768 + + + 157 + 8 + 27 + 3 + 32768 + + + 161 + 8 + 20 + 3 + 32768 + + + 165 + 8 + 21 + 3 + 32768 + + + 169 + 8 + 22 + 3 + 32768 + + + 173 + 8 + 23 + 3 + 32768 + + + 177 + 8 + 17 + 3 + 32768 + + + 181 + 8 + 16 + 3 + 32768 + + + 185 + 8 + 18 + 3 + 32768 + + + 189 + 8 + 19 + 3 + 32768 + + + 193 + 8 + 12 + 3 + 32768 + + + 197 + 8 + 13 + 3 + 32768 + + + 201 + 8 + 15 + 3 + 32768 + + + 205 + 8 + 14 + 3 + 32768 + + + 209 + 8 + 8 + 3 + 32768 + + + 213 + 8 + 9 + 3 + 32768 + + + 217 + 8 + 10 + 3 + 32768 + + + 221 + 8 + 11 + 3 + 32768 + + + 225 + 8 + 4 + 3 + 32768 + + + 229 + 8 + 5 + 3 + 32768 + + + 233 + 8 + 7 + + 3 + + 32768 + + + 237 + 8 + 6 + 3 + 32768 + + + 241 + 8 + 0 + 3 + 32768 + + + 245 + 8 + 1 + 3 + 32768 + + + 249 + 8 + 3 + 3 + 32768 + + + 253 + 8 + 2 + 3 + 32768 + + + 257 + 1 + 64 + 0 + 64 + + + 258 + 1 + 65 + 0 + 64 + + + + diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/default_sku b/device/mellanox/x86_64-nvidia_sn5400-r0/default_sku new file mode 100644 index 000000000000..d4c02b6749e0 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/default_sku @@ -0,0 +1 @@ +ACS-SN5400 t1 diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/pcie.yaml b/device/mellanox/x86_64-nvidia_sn5400-r0/pcie.yaml new file mode 100644 index 000000000000..7c08d0aa1e0d --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/pcie.yaml @@ -0,0 +1,145 @@ +## +## Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. +## Apache-2.0 +## +## Licensed under the Apache License, Version 2.0 (the "License"); +## you may not use this file except in compliance with the License. +## You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## + +- bus: '00' + dev: '00' + fn: '0' + id: 3ec4 + name: 'Host bridge: Intel Corporation 8th Gen Core Processor Host Bridge/DRAM Registers + (rev 07)' +- bus: '00' + dev: '01' + fn: '0' + id: '1901' + name: 'PCI bridge: Intel Corporation 6th-10th Gen Core Processor PCIe Controller + (x16) (rev 07)' +- bus: '00' + dev: '01' + fn: '1' + id: '1905' + name: 'PCI bridge: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor + PCIe Controller (x8) (rev 07)' +- bus: '00' + dev: 08 + fn: '0' + id: '1911' + name: 'System peripheral: Intel Corporation Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th/8th + Gen Core Processor Gaussian Mixture Model' +- bus: '00' + dev: '12' + fn: '0' + id: a379 + name: 'Signal processing controller: Intel Corporation Cannon Lake PCH Thermal Controller + (rev 10)' +- bus: '00' + dev: '14' + fn: '0' + id: a36d + name: 'USB controller: Intel Corporation Cannon Lake PCH USB 3.1 xHCI Host Controller + (rev 10)' +- bus: '00' + dev: '14' + fn: '2' + id: a36f + name: 'RAM memory: Intel Corporation Cannon Lake PCH Shared SRAM (rev 10)' +- bus: '00' + dev: '15' + fn: '0' + id: a368 + name: 'Serial bus controller [0c80]: Intel Corporation Cannon Lake PCH Serial IO + I2C Controller #0 (rev 10)' +- bus: '00' + dev: '16' + fn: '0' + id: a360 + name: 'Communication controller: Intel Corporation Cannon Lake PCH HECI Controller + (rev 10)' +- bus: '00' + dev: '17' + fn: '0' + id: a353 + name: 'SATA controller: Intel Corporation Cannon Lake Mobile PCH SATA AHCI Controller + (rev 10)' +- bus: '00' + dev: 1b + fn: '0' + id: a340 + name: 'PCI bridge: Intel Corporation Cannon Lake PCH PCI Express Root Port #17 (rev + f0)' +- bus: '00' + dev: 1b + fn: '4' + id: a32c + name: 'PCI bridge: Intel Corporation Cannon Lake PCH PCI Express Root Port #21 (rev + f0)' +- bus: '00' + dev: 1c + fn: '0' + id: a33d + name: 'PCI bridge: Intel Corporation Cannon Lake PCH PCI Express Root Port #6 (rev + f0)' +- bus: '00' + dev: 1c + fn: '6' + id: a33e + name: 'PCI bridge: Intel Corporation Cannon Lake PCH PCI Express Root Port #7 (rev + f0)' +- bus: '00' + dev: 1c + fn: '7' + id: a33f + name: 'PCI bridge: Intel Corporation Cannon Lake PCH PCI Express Root Port #8 (rev + f0)' +- bus: '00' + dev: 1d + fn: '0' + id: a334 + name: 'PCI bridge: Intel Corporation Cannon Lake PCH PCI Express Root Port #13 (rev + f0)' +- bus: '00' + dev: 1e + fn: '0' + id: a328 + name: 'Communication controller: Intel Corporation Cannon Lake PCH Serial IO UART + Host Controller (rev 10)' +- bus: '00' + dev: 1f + fn: '0' + id: a30e + name: 'ISA bridge: Intel Corporation Cannon Lake LPC Controller (rev 10)' +- bus: '00' + dev: 1f + fn: '4' + id: a323 + name: 'SMBus: Intel Corporation Cannon Lake PCH SMBus Controller (rev 10)' +- bus: '00' + dev: 1f + fn: '5' + id: a324 + name: 'Serial bus controller [0c80]: Intel Corporation Cannon Lake PCH SPI Controller + (rev 10)' +- bus: '00' + dev: 1f + fn: '6' + id: 15bb + name: 'Ethernet controller: Intel Corporation Ethernet Connection (7) I219-LM (rev + 10)' +- bus: '01' + dev: '00' + fn: '0' + id: cf80 + name: 'Ethernet controller: Mellanox Technologies Spectrum-4' diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/platform.json b/device/mellanox/x86_64-nvidia_sn5400-r0/platform.json new file mode 100644 index 000000000000..274a12d0c715 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/platform.json @@ -0,0 +1,1333 @@ +{ + "chassis": { + "name": "SN5400", + "components": [ + { + "name": "ONIE" + }, + { + "name": "SSD" + }, + { + "name": "BIOS" + }, + { + "name": "CPLD1" + }, + { + "name": "CPLD2" + }, + { + "name": "CPLD3" + }, + { + "name": "CPLD4" + }, + { + "name": "CPLD5" + } + ], + "fans": [], + "fan_drawers": [ + { + "name": "drawer1", + "fans": [ + { + "name": "fan1" + }, + { + "name": "fan2" + } + ] + }, + { + "name": "drawer2", + "fans": [ + { + "name": "fan3" + }, + { + "name": "fan4" + } + ] + }, + { + "name": "drawer3", + "fans": [ + { + "name": "fan5" + }, + { + "name": "fan6" + } + ] + }, + { + "name": "drawer4", + "fans": [ + { + "name": "fan7" + }, + { + "name": "fan8" + } + ] + } + ], + "psus": [ + { + "name": "PSU 1", + "fans": [ + { + "name": "psu1_fan1" + } + ], + "thermals": [ + { + "name": "PSU-1 Temp" + } + ] + }, + { + "name": "PSU 2", + "fans": [ + { + "name": "psu2_fan1" + } + ], + "thermals": [ + { + "name": "PSU-2 Temp" + } + ] + } + ], + "thermals": [ + { + "name": "ASIC" + }, + { + "name": "Ambient Fan Side Temp" + }, + { + "name": "Ambient Port Side Temp" + }, + { + "name": "CPU Core 0 Temp" + }, + { + "name": "CPU Core 1 Temp" + }, + { + "name": "CPU Core 2 Temp" + }, + { + "name": "CPU Core 3 Temp" + }, + { + "name": "CPU Core 4 Temp" + }, + { + "name": "CPU Core 5 Temp" + }, + { + "name": "CPU Pack Temp" + }, + { + "name": "SODIMM 1 Temp" + }, + { + "name": "SODIMM 2 Temp" + }, + { + "name": "PCH Temp" + } + ], + "sfps": [ + { + "name": "sfp1", + "thermals": [ + { + "name": "xSFP module 1 Temp" + } + ] + }, + { + "name": "sfp2", + "thermals": [ + { + "name": "xSFP module 2 Temp" + } + ] + }, + { + "name": "sfp3", + "thermals": [ + { + "name": "xSFP module 3 Temp" + } + ] + }, + { + "name": "sfp4", + "thermals": [ + { + "name": "xSFP module 4 Temp" + } + ] + }, + { + "name": "sfp5", + "thermals": [ + { + "name": "xSFP module 5 Temp" + } + ] + }, + { + "name": "sfp6", + "thermals": [ + { + "name": "xSFP module 6 Temp" + } + ] + }, + { + "name": "sfp7", + "thermals": [ + { + "name": "xSFP module 7 Temp" + } + ] + }, + { + "name": "sfp8", + "thermals": [ + { + "name": "xSFP module 8 Temp" + } + ] + }, + { + "name": "sfp9", + "thermals": [ + { + "name": "xSFP module 9 Temp" + } + ] + }, + { + "name": "sfp10", + "thermals": [ + { + "name": "xSFP module 10 Temp" + } + ] + }, + { + "name": "sfp11", + "thermals": [ + { + "name": "xSFP module 11 Temp" + } + ] + }, + { + "name": "sfp12", + "thermals": [ + { + "name": "xSFP module 12 Temp" + } + ] + }, + { + "name": "sfp13", + "thermals": [ + { + "name": "xSFP module 13 Temp" + } + ] + }, + { + "name": "sfp14", + "thermals": [ + { + "name": "xSFP module 14 Temp" + } + ] + }, + { + "name": "sfp15", + "thermals": [ + { + "name": "xSFP module 15 Temp" + } + ] + }, + { + "name": "sfp16", + "thermals": [ + { + "name": "xSFP module 16 Temp" + } + ] + }, + { + "name": "sfp17", + "thermals": [ + { + "name": "xSFP module 17 Temp" + } + ] + }, + { + "name": "sfp18", + "thermals": [ + { + "name": "xSFP module 18 Temp" + } + ] + }, + { + "name": "sfp19", + "thermals": [ + { + "name": "xSFP module 19 Temp" + } + ] + }, + { + "name": "sfp20", + "thermals": [ + { + "name": "xSFP module 20 Temp" + } + ] + }, + { + "name": "sfp21", + "thermals": [ + { + "name": "xSFP module 21 Temp" + } + ] + }, + { + "name": "sfp22", + "thermals": [ + { + "name": "xSFP module 22 Temp" + } + ] + }, + { + "name": "sfp23", + "thermals": [ + { + "name": "xSFP module 23 Temp" + } + ] + }, + { + "name": "sfp24", + "thermals": [ + { + "name": "xSFP module 24 Temp" + } + ] + }, + { + "name": "sfp25", + "thermals": [ + { + "name": "xSFP module 25 Temp" + } + ] + }, + { + "name": "sfp26", + "thermals": [ + { + "name": "xSFP module 26 Temp" + } + ] + }, + { + "name": "sfp27", + "thermals": [ + { + "name": "xSFP module 27 Temp" + } + ] + }, + { + "name": "sfp28", + "thermals": [ + { + "name": "xSFP module 28 Temp" + } + ] + }, + { + "name": "sfp29", + "thermals": [ + { + "name": "xSFP module 29 Temp" + } + ] + }, + { + "name": "sfp30", + "thermals": [ + { + "name": "xSFP module 30 Temp" + } + ] + }, + { + "name": "sfp31", + "thermals": [ + { + "name": "xSFP module 31 Temp" + } + ] + }, + { + "name": "sfp32", + "thermals": [ + { + "name": "xSFP module 32 Temp" + } + ] + }, + { + "name": "sfp33", + "thermals": [ + { + "name": "xSFP module 33 Temp" + } + ] + }, + { + "name": "sfp34", + "thermals": [ + { + "name": "xSFP module 34 Temp" + } + ] + }, + { + "name": "sfp35", + "thermals": [ + { + "name": "xSFP module 35 Temp" + } + ] + }, + { + "name": "sfp36", + "thermals": [ + { + "name": "xSFP module 36 Temp" + } + ] + }, + { + "name": "sfp37", + "thermals": [ + { + "name": "xSFP module 37 Temp" + } + ] + }, + { + "name": "sfp38", + "thermals": [ + { + "name": "xSFP module 38 Temp" + } + ] + }, + { + "name": "sfp39", + "thermals": [ + { + "name": "xSFP module 39 Temp" + } + ] + }, + { + "name": "sfp40", + "thermals": [ + { + "name": "xSFP module 40 Temp" + } + ] + }, + { + "name": "sfp41", + "thermals": [ + { + "name": "xSFP module 41 Temp" + } + ] + }, + { + "name": "sfp42", + "thermals": [ + { + "name": "xSFP module 42 Temp" + } + ] + }, + { + "name": "sfp43", + "thermals": [ + { + "name": "xSFP module 43 Temp" + } + ] + }, + { + "name": "sfp44", + "thermals": [ + { + "name": "xSFP module 44 Temp" + } + ] + }, + { + "name": "sfp45", + "thermals": [ + { + "name": "xSFP module 45 Temp" + } + ] + }, + { + "name": "sfp46", + "thermals": [ + { + "name": "xSFP module 46 Temp" + } + ] + }, + { + "name": "sfp47", + "thermals": [ + { + "name": "xSFP module 47 Temp" + } + ] + }, + { + "name": "sfp48", + "thermals": [ + { + "name": "xSFP module 48 Temp" + } + ] + }, + { + "name": "sfp49", + "thermals": [ + { + "name": "xSFP module 49 Temp" + } + ] + }, + { + "name": "sfp50", + "thermals": [ + { + "name": "xSFP module 50 Temp" + } + ] + }, + { + "name": "sfp51", + "thermals": [ + { + "name": "xSFP module 51 Temp" + } + ] + }, + { + "name": "sfp52", + "thermals": [ + { + "name": "xSFP module 52 Temp" + } + ] + }, + { + "name": "sfp53", + "thermals": [ + { + "name": "xSFP module 53 Temp" + } + ] + }, + { + "name": "sfp54", + "thermals": [ + { + "name": "xSFP module 54 Temp" + } + ] + }, + { + "name": "sfp55", + "thermals": [ + { + "name": "xSFP module 55 Temp" + } + ] + }, + { + "name": "sfp56", + "thermals": [ + { + "name": "xSFP module 56 Temp" + } + ] + }, + { + "name": "sfp57", + "thermals": [ + { + "name": "xSFP module 57 Temp" + } + ] + }, + { + "name": "sfp58", + "thermals": [ + { + "name": "xSFP module 58 Temp" + } + ] + }, + { + "name": "sfp59", + "thermals": [ + { + "name": "xSFP module 59 Temp" + } + ] + }, + { + "name": "sfp60", + "thermals": [ + { + "name": "xSFP module 60 Temp" + } + ] + }, + { + "name": "sfp61", + "thermals": [ + { + "name": "xSFP module 61 Temp" + } + ] + }, + { + "name": "sfp62", + "thermals": [ + { + "name": "xSFP module 62 Temp" + } + ] + }, + { + "name": "sfp63", + "thermals": [ + { + "name": "xSFP module 63 Temp" + } + ] + }, + { + "name": "sfp64", + "thermals": [ + { + "name": "xSFP module 64 Temp" + } + ] + }, + { + "name": "sfp65", + "thermals": [ + { + "name": "xSFP module 65 Temp" + } + ] + }, + { + "name": "sfp66", + "thermals": [ + { + "name": "xSFP module 66 Temp" + } + ] + } + ] + }, + "interfaces": { + "Ethernet0": { + "index": "1,1,1,1,1,1,1,1", + "lanes": "0,1,2,3,4,5,6,7", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp1"], + "2x200G[100G,50G,40G,25G,10G]": ["etp1a", "etp1b"], + "4x100G[50G,25G,10G]": ["etp1a", "etp1b", "etp1c", "etp1d"], + "8x50G[25G,10G]": ["etp1a", "etp1b", "etp1c", "etp1d", "etp1e", "etp1f", "etp1g", "etp1h"] + } + }, + "Ethernet8": { + "index": "2,2,2,2,2,2,2,2", + "lanes": "8,9,10,11,12,13,14,15", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp2"], + "2x200G[100G,50G,40G,25G,10G]": ["etp2a", "etp2b"], + "4x100G[50G,25G,10G]": ["etp2a", "etp2b", "etp2c", "etp2d"], + "8x50G[25G,10G]": ["etp2a", "etp2b", "etp2c", "etp2d", "etp2e", "etp2f", "etp2g", "etp2h"] + } + }, + "Ethernet16": { + "index": "3,3,3,3,3,3,3,3", + "lanes": "16,17,18,19,20,21,22,23", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp3"], + "2x200G[100G,50G,40G,25G,10G]": ["etp3a", "etp3b"], + "4x100G[50G,25G,10G]": ["etp3a", "etp3b", "etp3c", "etp3d"], + "8x50G[25G,10G]": ["etp3a", "etp3b", "etp3c", "etp3d", "etp3e", "etp3f", "etp3g", "etp3h"] + } + }, + "Ethernet24": { + "index": "4,4,4,4,4,4,4,4", + "lanes": "24,25,26,27,28,29,30,31", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp4"], + "2x200G[100G,50G,40G,25G,10G]": ["etp4a", "etp4b"], + "4x100G[50G,25G,10G]": ["etp4a", "etp4b", "etp4c", "etp4d"], + "8x50G[25G,10G]": ["etp4a", "etp4b", "etp4c", "etp4d", "etp4e", "etp4f", "etp4g", "etp4h"] + } + }, + "Ethernet32": { + "index": "5,5,5,5,5,5,5,5", + "lanes": "32,33,34,35,36,37,38,39", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp5"], + "2x200G[100G,50G,40G,25G,10G]": ["etp5a", "etp5b"], + "4x100G[50G,25G,10G]": ["etp5a", "etp5b", "etp5c", "etp5d"], + "8x50G[25G,10G]": ["etp5a", "etp5b", "etp5c", "etp5d", "etp5e", "etp5f", "etp5g", "etp5h"] + } + }, + "Ethernet40": { + "index": "6,6,6,6,6,6,6,6", + "lanes": "40,41,42,43,44,45,46,47", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp6"], + "2x200G[100G,50G,40G,25G,10G]": ["etp6a", "etp6b"], + "4x100G[50G,25G,10G]": ["etp6a", "etp6b", "etp6c", "etp6d"], + "8x50G[25G,10G]": ["etp6a", "etp6b", "etp6c", "etp6d", "etp6e", "etp6f", "etp6g", "etp6h"] + } + }, + "Ethernet48": { + "index": "7,7,7,7,7,7,7,7", + "lanes": "48,49,50,51,52,53,54,55", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp7"], + "2x200G[100G,50G,40G,25G,10G]": ["etp7a", "etp7b"], + "4x100G[50G,25G,10G]": ["etp7a", "etp7b", "etp7c", "etp7d"], + "8x50G[25G,10G]": ["etp7a", "etp7b", "etp7c", "etp7d", "etp7e", "etp7f", "etp7g", "etp7h"] + } + }, + "Ethernet56": { + "index": "8,8,8,8,8,8,8,8", + "lanes": "56,57,58,59,60,61,62,63", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp8"], + "2x200G[100G,50G,40G,25G,10G]": ["etp8a", "etp8b"], + "4x100G[50G,25G,10G]": ["etp8a", "etp8b", "etp8c", "etp8d"], + "8x50G[25G,10G]": ["etp8a", "etp8b", "etp8c", "etp8d", "etp8e", "etp8f", "etp8g", "etp8h"] + } + }, + "Ethernet64": { + "index": "9,9,9,9,9,9,9,9", + "lanes": "64,65,66,67,68,69,70,71", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp9"], + "2x200G[100G,50G,40G,25G,10G]": ["etp9a", "etp9b"], + "4x100G[50G,25G,10G]": ["etp9a", "etp9b", "etp9c", "etp9d"], + "8x50G[25G,10G]": ["etp9a", "etp9b", "etp9c", "etp9d", "etp9e", "etp9f", "etp9g", "etp9h"] + } + }, + "Ethernet72": { + "index": "10,10,10,10,10,10,10,10", + "lanes": "72,73,74,75,76,77,78,79", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp10"], + "2x200G[100G,50G,40G,25G,10G]": ["etp10a", "etp10b"], + "4x100G[50G,25G,10G]": ["etp10a", "etp10b", "etp10c", "etp10d"], + "8x50G[25G,10G]": ["etp10a", "etp10b", "etp10c", "etp10d", "etp10e", "etp10f", "etp10g", "etp10h"] + } + }, + "Ethernet80": { + "index": "11,11,11,11,11,11,11,11", + "lanes": "80,81,82,83,84,85,86,87", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp11"], + "2x200G[100G,50G,40G,25G,10G]": ["etp11a", "etp11b"], + "4x100G[50G,25G,10G]": ["etp11a", "etp11b", "etp11c", "etp11d"], + "8x50G[25G,10G]": ["etp11a", "etp11b", "etp11c", "etp11d", "etp11e", "etp11f", "etp11g", "etp11h"] + } + }, + "Ethernet88": { + "index": "12,12,12,12,12,12,12,12", + "lanes": "88,89,90,91,92,93,94,95", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp12"], + "2x200G[100G,50G,40G,25G,10G]": ["etp12a", "etp12b"], + "4x100G[50G,25G,10G]": ["etp12a", "etp12b", "etp12c", "etp12d"], + "8x50G[25G,10G]": ["etp12a", "etp12b", "etp12c", "etp12d", "etp12e", "etp12f", "etp12g", "etp12h"] + } + }, + "Ethernet96": { + "index": "13,13,13,13,13,13,13,13", + "lanes": "96,97,98,99,100,101,102,103", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp13"], + "2x200G[100G,50G,40G,25G,10G]": ["etp13a", "etp13b"], + "4x100G[50G,25G,10G]": ["etp13a", "etp13b", "etp13c", "etp13d"], + "8x50G[25G,10G]": ["etp13a", "etp13b", "etp13c", "etp13d", "etp13e", "etp13f", "etp13g", "etp13h"] + } + }, + "Ethernet104": { + "index": "14,14,14,14,14,14,14,14", + "lanes": "104,105,106,107,108,109,110,111", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp14"], + "2x200G[100G,50G,40G,25G,10G]": ["etp14a", "etp14b"], + "4x100G[50G,25G,10G]": ["etp14a", "etp14b", "etp14c", "etp14d"], + "8x50G[25G,10G]": ["etp14a", "etp14b", "etp14c", "etp14d", "etp14e", "etp14f", "etp14g", "etp14h"] + } + }, + "Ethernet112": { + "index": "15,15,15,15,15,15,15,15", + "lanes": "112,113,114,115,116,117,118,119", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp15"], + "2x200G[100G,50G,40G,25G,10G]": ["etp15a", "etp15b"], + "4x100G[50G,25G,10G]": ["etp15a", "etp15b", "etp15c", "etp15d"], + "8x50G[25G,10G]": ["etp15a", "etp15b", "etp15c", "etp15d", "etp15e", "etp15f", "etp15g", "etp15h"] + } + }, + "Ethernet120": { + "index": "16,16,16,16,16,16,16,16", + "lanes": "120,121,122,123,124,125,126,127", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp16"], + "2x200G[100G,50G,40G,25G,10G]": ["etp16a", "etp16b"], + "4x100G[50G,25G,10G]": ["etp16a", "etp16b", "etp16c", "etp16d"], + "8x50G[25G,10G]": ["etp16a", "etp16b", "etp16c", "etp16d", "etp16e", "etp16f", "etp16g", "etp16h"] + } + }, + "Ethernet128": { + "index": "17,17,17,17,17,17,17,17", + "lanes": "128,129,130,131,132,133,134,135", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp17"], + "2x200G[100G,50G,40G,25G,10G]": ["etp17a", "etp17b"], + "4x100G[50G,25G,10G]": ["etp17a", "etp17b", "etp17c", "etp17d"], + "8x50G[25G,10G]": ["etp17a", "etp17b", "etp17c", "etp17d", "etp17e", "etp17f", "etp17g", "etp17h"] + } + }, + "Ethernet136": { + "index": "18,18,18,18,18,18,18,18", + "lanes": "136,137,138,139,140,141,142,143", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp18"], + "2x200G[100G,50G,40G,25G,10G]": ["etp18a", "etp18b"], + "4x100G[50G,25G,10G]": ["etp18a", "etp18b", "etp18c", "etp18d"], + "8x50G[25G,10G]": ["etp18a", "etp18b", "etp18c", "etp18d", "etp18e", "etp18f", "etp18g", "etp18h"] + } + }, + "Ethernet144": { + "index": "19,19,19,19,19,19,19,19", + "lanes": "144,145,146,147,148,149,150,151", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp19"], + "2x200G[100G,50G,40G,25G,10G]": ["etp19a", "etp19b"], + "4x100G[50G,25G,10G]": ["etp19a", "etp19b", "etp19c", "etp19d"], + "8x50G[25G,10G]": ["etp19a", "etp19b", "etp19c", "etp19d", "etp19e", "etp19f", "etp19g", "etp19h"] + } + }, + "Ethernet152": { + "index": "20,20,20,20,20,20,20,20", + "lanes": "152,153,154,155,156,157,158,159", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp20"], + "2x200G[100G,50G,40G,25G,10G]": ["etp20a", "etp20b"], + "4x100G[50G,25G,10G]": ["etp20a", "etp20b", "etp20c", "etp20d"], + "8x50G[25G,10G]": ["etp20a", "etp20b", "etp20c", "etp20d", "etp20e", "etp20f", "etp20g", "etp20h"] + } + }, + "Ethernet160": { + "index": "21,21,21,21,21,21,21,21", + "lanes": "160,161,162,163,164,165,166,167", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp21"], + "2x200G[100G,50G,40G,25G,10G]": ["etp21a", "etp21b"], + "4x100G[50G,25G,10G]": ["etp21a", "etp21b", "etp21c", "etp21d"], + "8x50G[25G,10G]": ["etp21a", "etp21b", "etp21c", "etp21d", "etp21e", "etp21f", "etp21g", "etp21h"] + } + }, + "Ethernet168": { + "index": "22,22,22,22,22,22,22,22", + "lanes": "168,169,170,171,172,173,174,175", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp22"], + "2x200G[100G,50G,40G,25G,10G]": ["etp22a", "etp22b"], + "4x100G[50G,25G,10G]": ["etp22a", "etp22b", "etp22c", "etp22d"], + "8x50G[25G,10G]": ["etp22a", "etp22b", "etp22c", "etp22d", "etp22e", "etp22f", "etp22g", "etp22h"] + } + }, + "Ethernet176": { + "index": "23,23,23,23,23,23,23,23", + "lanes": "176,177,178,179,180,181,182,183", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp23"], + "2x200G[100G,50G,40G,25G,10G]": ["etp23a", "etp23b"], + "4x100G[50G,25G,10G]": ["etp23a", "etp23b", "etp23c", "etp23d"], + "8x50G[25G,10G]": ["etp23a", "etp23b", "etp23c", "etp23d", "etp23e", "etp23f", "etp23g", "etp23h"] + } + }, + "Ethernet184": { + "index": "24,24,24,24,24,24,24,24", + "lanes": "184,185,186,187,188,189,190,191", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp24"], + "2x200G[100G,50G,40G,25G,10G]": ["etp24a", "etp24b"], + "4x100G[50G,25G,10G]": ["etp24a", "etp24b", "etp24c", "etp24d"], + "8x50G[25G,10G]": ["etp24a", "etp24b", "etp24c", "etp24d", "etp24e", "etp24f", "etp24g", "etp24h"] + } + }, + "Ethernet192": { + "index": "25,25,25,25,25,25,25,25", + "lanes": "192,193,194,195,196,197,198,199", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp25"], + "2x200G[100G,50G,40G,25G,10G]": ["etp25a", "etp25b"], + "4x100G[50G,25G,10G]": ["etp25a", "etp25b", "etp25c", "etp25d"], + "8x50G[25G,10G]": ["etp25a", "etp25b", "etp25c", "etp25d", "etp25e", "etp25f", "etp25g", "etp25h"] + } + }, + "Ethernet200": { + "index": "26,26,26,26,26,26,26,26", + "lanes": "200,201,202,203,204,205,206,207", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp26"], + "2x200G[100G,50G,40G,25G,10G]": ["etp26a", "etp26b"], + "4x100G[50G,25G,10G]": ["etp26a", "etp26b", "etp26c", "etp26d"], + "8x50G[25G,10G]": ["etp26a", "etp26b", "etp26c", "etp26d", "etp26e", "etp26f", "etp26g", "etp26h"] + } + }, + "Ethernet208": { + "index": "27,27,27,27,27,27,27,27", + "lanes": "208,209,210,211,212,213,214,215", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp27"], + "2x200G[100G,50G,40G,25G,10G]": ["etp27a", "etp27b"], + "4x100G[50G,25G,10G]": ["etp27a", "etp27b", "etp27c", "etp27d"], + "8x50G[25G,10G]": ["etp27a", "etp27b", "etp27c", "etp27d", "etp27e", "etp27f", "etp27g", "etp27h"] + } + }, + "Ethernet216": { + "index": "28,28,28,28,28,28,28,28", + "lanes": "216,217,218,219,220,221,222,223", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp28"], + "2x200G[100G,50G,40G,25G,10G]": ["etp28a", "etp28b"], + "4x100G[50G,25G,10G]": ["etp28a", "etp28b", "etp28c", "etp28d"], + "8x50G[25G,10G]": ["etp28a", "etp28b", "etp28c", "etp28d", "etp28e", "etp28f", "etp28g", "etp28h"] + } + }, + "Ethernet224": { + "index": "29,29,29,29,29,29,29,29", + "lanes": "224,225,226,227,228,229,230,231", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp29"], + "2x200G[100G,50G,40G,25G,10G]": ["etp29a", "etp29b"], + "4x100G[50G,25G,10G]": ["etp29a", "etp29b", "etp29c", "etp29d"], + "8x50G[25G,10G]": ["etp29a", "etp29b", "etp29c", "etp29d", "etp29e", "etp29f", "etp29g", "etp29h"] + } + }, + "Ethernet232": { + "index": "30,30,30,30,30,30,30,30", + "lanes": "232,233,234,235,236,237,238,239", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp30"], + "2x200G[100G,50G,40G,25G,10G]": ["etp30a", "etp30b"], + "4x100G[50G,25G,10G]": ["etp30a", "etp30b", "etp30c", "etp30d"], + "8x50G[25G,10G]": ["etp30a", "etp30b", "etp30c", "etp30d", "etp30e", "etp30f", "etp30g", "etp30h"] + } + }, + "Ethernet240": { + "index": "31,31,31,31,31,31,31,31", + "lanes": "240,241,242,243,244,245,246,247", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp31"], + "2x200G[100G,50G,40G,25G,10G]": ["etp31a", "etp31b"], + "4x100G[50G,25G,10G]": ["etp31a", "etp31b", "etp31c", "etp31d"], + "8x50G[25G,10G]": ["etp31a", "etp31b", "etp31c", "etp31d", "etp31e", "etp31f", "etp31g", "etp31h"] + } + }, + "Ethernet248": { + "index": "32,32,32,32,32,32,32,32", + "lanes": "248,249,250,251,252,253,254,255", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp32"], + "2x200G[100G,50G,40G,25G,10G]": ["etp32a", "etp32b"], + "4x100G[50G,25G,10G]": ["etp32a", "etp32b", "etp32c", "etp32d"], + "8x50G[25G,10G]": ["etp32a", "etp32b", "etp32c", "etp32d", "etp32e", "etp32f", "etp32g", "etp32h"] + } + }, + "Ethernet256": { + "index": "33,33,33,33,33,33,33,33", + "lanes": "256,257,258,259,260,261,262,263", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp33"], + "2x200G[100G,50G,40G,25G,10G]": ["etp33a", "etp33b"], + "4x100G[50G,25G,10G]": ["etp33a", "etp33b", "etp33c", "etp33d"], + "8x50G[25G,10G]": ["etp33a", "etp33b", "etp33c", "etp33d", "etp33e", "etp33f", "etp33g", "etp33h"] + } + }, + "Ethernet264": { + "index": "34,34,34,34,34,34,34,34", + "lanes": "264,265,266,267,268,269,270,271", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp34"], + "2x200G[100G,50G,40G,25G,10G]": ["etp34a", "etp34b"], + "4x100G[50G,25G,10G]": ["etp34a", "etp34b", "etp34c", "etp34d"], + "8x50G[25G,10G]": ["etp34a", "etp34b", "etp34c", "etp34d", "etp34e", "etp34f", "etp34g", "etp34h"] + } + }, + "Ethernet272": { + "index": "35,35,35,35,35,35,35,35", + "lanes": "272,273,274,275,276,277,278,279", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp35"], + "2x200G[100G,50G,40G,25G,10G]": ["etp35a", "etp35b"], + "4x100G[50G,25G,10G]": ["etp35a", "etp35b", "etp35c", "etp35d"], + "8x50G[25G,10G]": ["etp35a", "etp35b", "etp35c", "etp35d", "etp35e", "etp35f", "etp35g", "etp35h"] + } + }, + "Ethernet280": { + "index": "36,36,36,36,36,36,36,36", + "lanes": "280,281,282,283,284,285,286,287", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp36"], + "2x200G[100G,50G,40G,25G,10G]": ["etp36a", "etp36b"], + "4x100G[50G,25G,10G]": ["etp36a", "etp36b", "etp36c", "etp36d"], + "8x50G[25G,10G]": ["etp36a", "etp36b", "etp36c", "etp36d", "etp36e", "etp36f", "etp36g", "etp36h"] + } + }, + "Ethernet288": { + "index": "37,37,37,37,37,37,37,37", + "lanes": "288,289,290,291,292,293,294,295", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp37"], + "2x200G[100G,50G,40G,25G,10G]": ["etp37a", "etp37b"], + "4x100G[50G,25G,10G]": ["etp37a", "etp37b", "etp37c", "etp37d"], + "8x50G[25G,10G]": ["etp37a", "etp37b", "etp37c", "etp37d", "etp37e", "etp37f", "etp37g", "etp37h"] + } + }, + "Ethernet296": { + "index": "38,38,38,38,38,38,38,38", + "lanes": "296,297,298,299,300,301,302,303", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp38"], + "2x200G[100G,50G,40G,25G,10G]": ["etp38a", "etp38b"], + "4x100G[50G,25G,10G]": ["etp38a", "etp38b", "etp38c", "etp38d"], + "8x50G[25G,10G]": ["etp38a", "etp38b", "etp38c", "etp38d", "etp38e", "etp38f", "etp38g", "etp38h"] + } + }, + "Ethernet304": { + "index": "39,39,39,39,39,39,39,39", + "lanes": "304,305,306,307,308,309,310,311", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp39"], + "2x200G[100G,50G,40G,25G,10G]": ["etp39a", "etp39b"], + "4x100G[50G,25G,10G]": ["etp39a", "etp39b", "etp39c", "etp39d"], + "8x50G[25G,10G]": ["etp39a", "etp39b", "etp39c", "etp39d", "etp39e", "etp39f", "etp39g", "etp39h"] + } + }, + "Ethernet312": { + "index": "40,40,40,40,40,40,40,40", + "lanes": "312,313,314,315,316,317,318,319", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp40"], + "2x200G[100G,50G,40G,25G,10G]": ["etp40a", "etp40b"], + "4x100G[50G,25G,10G]": ["etp40a", "etp40b", "etp40c", "etp40d"], + "8x50G[25G,10G]": ["etp40a", "etp40b", "etp40c", "etp40d", "etp40e", "etp40f", "etp40g", "etp40h"] + } + }, + "Ethernet320": { + "index": "41,41,41,41,41,41,41,41", + "lanes": "320,321,322,323,324,325,326,327", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp41"], + "2x200G[100G,50G,40G,25G,10G]": ["etp41a", "etp41b"], + "4x100G[50G,25G,10G]": ["etp41a", "etp41b", "etp41c", "etp41d"], + "8x50G[25G,10G]": ["etp41a", "etp41b", "etp41c", "etp41d", "etp41e", "etp41f", "etp41g", "etp41h"] + } + }, + "Ethernet328": { + "index": "42,42,42,42,42,42,42,42", + "lanes": "328,329,330,331,332,333,334,335", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp42"], + "2x200G[100G,50G,40G,25G,10G]": ["etp42a", "etp42b"], + "4x100G[50G,25G,10G]": ["etp42a", "etp42b", "etp42c", "etp42d"], + "8x50G[25G,10G]": ["etp42a", "etp42b", "etp42c", "etp42d", "etp42e", "etp42f", "etp42g", "etp42h"] + } + }, + "Ethernet336": { + "index": "43,43,43,43,43,43,43,43", + "lanes": "336,337,338,339,340,341,342,343", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp43"], + "2x200G[100G,50G,40G,25G,10G]": ["etp43a", "etp43b"], + "4x100G[50G,25G,10G]": ["etp43a", "etp43b", "etp43c", "etp43d"], + "8x50G[25G,10G]": ["etp43a", "etp43b", "etp43c", "etp43d", "etp43e", "etp43f", "etp43g", "etp43h"] + } + }, + "Ethernet344": { + "index": "44,44,44,44,44,44,44,44", + "lanes": "344,345,346,347,348,349,350,351", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp44"], + "2x200G[100G,50G,40G,25G,10G]": ["etp44a", "etp44b"], + "4x100G[50G,25G,10G]": ["etp44a", "etp44b", "etp44c", "etp44d"], + "8x50G[25G,10G]": ["etp44a", "etp44b", "etp44c", "etp44d", "etp44e", "etp44f", "etp44g", "etp44h"] + } + }, + "Ethernet352": { + "index": "45,45,45,45,45,45,45,45", + "lanes": "352,353,354,355,356,357,358,359", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp45"], + "2x200G[100G,50G,40G,25G,10G]": ["etp45a", "etp45b"], + "4x100G[50G,25G,10G]": ["etp45a", "etp45b", "etp45c", "etp45d"], + "8x50G[25G,10G]": ["etp45a", "etp45b", "etp45c", "etp45d", "etp45e", "etp45f", "etp45g", "etp45h"] + } + }, + "Ethernet360": { + "index": "46,46,46,46,46,46,46,46", + "lanes": "360,361,362,363,364,365,366,367", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp46"], + "2x200G[100G,50G,40G,25G,10G]": ["etp46a", "etp46b"], + "4x100G[50G,25G,10G]": ["etp46a", "etp46b", "etp46c", "etp46d"], + "8x50G[25G,10G]": ["etp46a", "etp46b", "etp46c", "etp46d", "etp46e", "etp46f", "etp46g", "etp46h"] + } + }, + "Ethernet368": { + "index": "47,47,47,47,47,47,47,47", + "lanes": "368,369,370,371,372,373,374,375", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp47"], + "2x200G[100G,50G,40G,25G,10G]": ["etp47a", "etp47b"], + "4x100G[50G,25G,10G]": ["etp47a", "etp47b", "etp47c", "etp47d"], + "8x50G[25G,10G]": ["etp47a", "etp47b", "etp47c", "etp47d", "etp47e", "etp47f", "etp47g", "etp47h"] + } + }, + "Ethernet376": { + "index": "48,48,48,48,48,48,48,48", + "lanes": "376,377,378,379,380,381,382,383", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp48"], + "2x200G[100G,50G,40G,25G,10G]": ["etp48a", "etp48b"], + "4x100G[50G,25G,10G]": ["etp48a", "etp48b", "etp48c", "etp48d"], + "8x50G[25G,10G]": ["etp48a", "etp48b", "etp48c", "etp48d", "etp48e", "etp48f", "etp48g", "etp48h"] + } + }, + "Ethernet384": { + "index": "49,49,49,49,49,49,49,49", + "lanes": "384,385,386,387,388,389,390,391", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp49"], + "2x200G[100G,50G,40G,25G,10G]": ["etp49a", "etp49b"], + "4x100G[50G,25G,10G]": ["etp49a", "etp49b", "etp49c", "etp49d"], + "8x50G[25G,10G]": ["etp49a", "etp49b", "etp49c", "etp49d", "etp49e", "etp49f", "etp49g", "etp49h"] + } + }, + "Ethernet392": { + "index": "50,50,50,50,50,50,50,50", + "lanes": "392,393,394,395,396,397,398,399", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp50"], + "2x200G[100G,50G,40G,25G,10G]": ["etp50a", "etp50b"], + "4x100G[50G,25G,10G]": ["etp50a", "etp50b", "etp50c", "etp50d"], + "8x50G[25G,10G]": ["etp50a", "etp50b", "etp50c", "etp50d", "etp50e", "etp50f", "etp50g", "etp50h"] + } + }, + "Ethernet400": { + "index": "51,51,51,51,51,51,51,51", + "lanes": "400,401,402,403,404,405,406,407", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp51"], + "2x200G[100G,50G,40G,25G,10G]": ["etp51a", "etp51b"], + "4x100G[50G,25G,10G]": ["etp51a", "etp51b", "etp51c", "etp51d"], + "8x50G[25G,10G]": ["etp51a", "etp51b", "etp51c", "etp51d", "etp51e", "etp51f", "etp51g", "etp51h"] + } + }, + "Ethernet408": { + "index": "52,52,52,52,52,52,52,52", + "lanes": "408,409,410,411,412,413,414,415", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp52"], + "2x200G[100G,50G,40G,25G,10G]": ["etp52a", "etp52b"], + "4x100G[50G,25G,10G]": ["etp52a", "etp52b", "etp52c", "etp52d"], + "8x50G[25G,10G]": ["etp52a", "etp52b", "etp52c", "etp52d", "etp52e", "etp52f", "etp52g", "etp52h"] + } + }, + "Ethernet416": { + "index": "53,53,53,53,53,53,53,53", + "lanes": "416,417,418,419,420,421,422,423", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp53"], + "2x200G[100G,50G,40G,25G,10G]": ["etp53a", "etp53b"], + "4x100G[50G,25G,10G]": ["etp53a", "etp53b", "etp53c", "etp53d"], + "8x50G[25G,10G]": ["etp53a", "etp53b", "etp53c", "etp53d", "etp53e", "etp53f", "etp53g", "etp53h"] + } + }, + "Ethernet424": { + "index": "54,54,54,54,54,54,54,54", + "lanes": "424,425,426,427,428,429,430,431", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp54"], + "2x200G[100G,50G,40G,25G,10G]": ["etp54a", "etp54b"], + "4x100G[50G,25G,10G]": ["etp54a", "etp54b", "etp54c", "etp54d"], + "8x50G[25G,10G]": ["etp54a", "etp54b", "etp54c", "etp54d", "etp54e", "etp54f", "etp54g", "etp54h"] + } + }, + "Ethernet432": { + "index": "55,55,55,55,55,55,55,55", + "lanes": "432,433,434,435,436,437,438,439", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp55"], + "2x200G[100G,50G,40G,25G,10G]": ["etp55a", "etp55b"], + "4x100G[50G,25G,10G]": ["etp55a", "etp55b", "etp55c", "etp55d"], + "8x50G[25G,10G]": ["etp55a", "etp55b", "etp55c", "etp55d", "etp55e", "etp55f", "etp55g", "etp55h"] + } + }, + "Ethernet440": { + "index": "56,56,56,56,56,56,56,56", + "lanes": "440,441,442,443,444,445,446,447", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp56"], + "2x200G[100G,50G,40G,25G,10G]": ["etp56a", "etp56b"], + "4x100G[50G,25G,10G]": ["etp56a", "etp56b", "etp56c", "etp56d"], + "8x50G[25G,10G]": ["etp56a", "etp56b", "etp56c", "etp56d", "etp56e", "etp56f", "etp56g", "etp56h"] + } + }, + "Ethernet448": { + "index": "57,57,57,57,57,57,57,57", + "lanes": "448,449,450,451,452,453,454,455", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp57"], + "2x200G[100G,50G,40G,25G,10G]": ["etp57a", "etp57b"], + "4x100G[50G,25G,10G]": ["etp57a", "etp57b", "etp57c", "etp57d"], + "8x50G[25G,10G]": ["etp57a", "etp57b", "etp57c", "etp57d", "etp57e", "etp57f", "etp57g", "etp57h"] + } + }, + "Ethernet456": { + "index": "58,58,58,58,58,58,58,58", + "lanes": "456,457,458,459,460,461,462,463", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp58"], + "2x200G[100G,50G,40G,25G,10G]": ["etp58a", "etp58b"], + "4x100G[50G,25G,10G]": ["etp58a", "etp58b", "etp58c", "etp58d"], + "8x50G[25G,10G]": ["etp58a", "etp58b", "etp58c", "etp58d", "etp58e", "etp58f", "etp58g", "etp58h"] + } + }, + "Ethernet464": { + "index": "59,59,59,59,59,59,59,59", + "lanes": "464,465,466,467,468,469,470,471", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp59"], + "2x200G[100G,50G,40G,25G,10G]": ["etp59a", "etp59b"], + "4x100G[50G,25G,10G]": ["etp59a", "etp59b", "etp59c", "etp59d"], + "8x50G[25G,10G]": ["etp59a", "etp59b", "etp59c", "etp59d", "etp59e", "etp59f", "etp59g", "etp59h"] + } + }, + "Ethernet472": { + "index": "60,60,60,60,60,60,60,60", + "lanes": "472,473,474,475,476,477,478,479", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp60"], + "2x200G[100G,50G,40G,25G,10G]": ["etp60a", "etp60b"], + "4x100G[50G,25G,10G]": ["etp60a", "etp60b", "etp60c", "etp60d"], + "8x50G[25G,10G]": ["etp60a", "etp60b", "etp60c", "etp60d", "etp60e", "etp60f", "etp60g", "etp60h"] + } + }, + "Ethernet480": { + "index": "61,61,61,61,61,61,61,61", + "lanes": "480,481,482,483,484,485,486,487", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp61"], + "2x200G[100G,50G,40G,25G,10G]": ["etp61a", "etp61b"], + "4x100G[50G,25G,10G]": ["etp61a", "etp61b", "etp61c", "etp61d"], + "8x50G[25G,10G]": ["etp61a", "etp61b", "etp61c", "etp61d", "etp61e", "etp61f", "etp61g", "etp61h"] + } + }, + "Ethernet488": { + "index": "62,62,62,62,62,62,62,62", + "lanes": "488,489,490,491,492,493,494,495", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp62"], + "2x200G[100G,50G,40G,25G,10G]": ["etp62a", "etp62b"], + "4x100G[50G,25G,10G]": ["etp62a", "etp62b", "etp62c", "etp62d"], + "8x50G[25G,10G]": ["etp62a", "etp62b", "etp62c", "etp62d", "etp62e", "etp62f", "etp62g", "etp62h"] + } + }, + "Ethernet496": { + "index": "63,63,63,63,63,63,63,63", + "lanes": "496,497,498,499,500,501,502,503", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp63"], + "2x200G[100G,50G,40G,25G,10G]": ["etp63a", "etp63b"], + "4x100G[50G,25G,10G]": ["etp63a", "etp63b", "etp63c", "etp63d"], + "8x50G[25G,10G]": ["etp63a", "etp63b", "etp63c", "etp63d", "etp63e", "etp63f", "etp63g", "etp63h"] + } + }, + "Ethernet504": { + "index": "64,64,64,64,64,64,64,64", + "lanes": "504,505,506,507,508,509,510,511", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp64"], + "2x200G[100G,50G,40G,25G,10G]": ["etp64a", "etp64b"], + "4x100G[50G,25G,10G]": ["etp64a", "etp64b", "etp64c", "etp64d"], + "8x50G[25G,10G]": ["etp64a", "etp64b", "etp64c", "etp64d", "etp64e", "etp64f", "etp64g", "etp64h"] + } + }, + "Ethernet512": { + "index": "65", + "lanes": "512", + "breakout_modes": { + "1x25G[10G]": ["etp65"] + } + }, + "Ethernet513": { + "index": "66", + "lanes": "513", + "breakout_modes": { + "1x25G[10G]": ["etp66"] + } + } + } +} diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/platform_asic b/device/mellanox/x86_64-nvidia_sn5400-r0/platform_asic new file mode 100644 index 000000000000..70c074885557 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/platform_asic @@ -0,0 +1 @@ +mellanox diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/platform_components.json b/device/mellanox/x86_64-nvidia_sn5400-r0/platform_components.json new file mode 100644 index 000000000000..e9760aafeb5c --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/platform_components.json @@ -0,0 +1,16 @@ +{ + "chassis": { + "SN5400": { + "component": { + "ONIE": { }, + "SSD": { }, + "BIOS": { }, + "CPLD1": { }, + "CPLD2": { }, + "CPLD3": { }, + "CPLD4": { }, + "CPLD5": { } + } + } + } +} diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/platform_wait b/device/mellanox/x86_64-nvidia_sn5400-r0/platform_wait new file mode 120000 index 000000000000..4b30bd429854 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/platform_wait @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/platform_wait \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/plugins/eeprom.py b/device/mellanox/x86_64-nvidia_sn5400-r0/plugins/eeprom.py new file mode 120000 index 000000000000..b4e2a6a61671 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/plugins/eeprom.py @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/plugins/eeprom.py \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/plugins/psuutil.py b/device/mellanox/x86_64-nvidia_sn5400-r0/plugins/psuutil.py new file mode 120000 index 000000000000..9f724238a8d5 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/plugins/psuutil.py @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/plugins/psuutil.py \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/plugins/sfplpmget.py b/device/mellanox/x86_64-nvidia_sn5400-r0/plugins/sfplpmget.py new file mode 120000 index 000000000000..2e84f435abd9 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/plugins/sfplpmget.py @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/plugins/sfplpmget.py \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/plugins/sfplpmset.py b/device/mellanox/x86_64-nvidia_sn5400-r0/plugins/sfplpmset.py new file mode 120000 index 000000000000..6a88bac30467 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/plugins/sfplpmset.py @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/plugins/sfplpmset.py \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/plugins/sfpreset.py b/device/mellanox/x86_64-nvidia_sn5400-r0/plugins/sfpreset.py new file mode 120000 index 000000000000..fef2063e3496 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/plugins/sfpreset.py @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/plugins/sfpreset.py \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/plugins/sfputil.py b/device/mellanox/x86_64-nvidia_sn5400-r0/plugins/sfputil.py new file mode 120000 index 000000000000..45909b880fc9 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/plugins/sfputil.py @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/plugins/sfputil.py \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/pmon_daemon_control.json b/device/mellanox/x86_64-nvidia_sn5400-r0/pmon_daemon_control.json new file mode 120000 index 000000000000..435a2ce7c0ba --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/pmon_daemon_control.json @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/pmon_daemon_control.json \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/pre_reboot_hook b/device/mellanox/x86_64-nvidia_sn5400-r0/pre_reboot_hook new file mode 120000 index 000000000000..6fc31078ee86 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/pre_reboot_hook @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/pre_reboot_hook \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/sensors.conf b/device/mellanox/x86_64-nvidia_sn5400-r0/sensors.conf new file mode 100644 index 000000000000..e858a0311c05 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/sensors.conf @@ -0,0 +1,379 @@ +## +## Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. +## Apache-2.0 +## +## Licensed under the Apache License, Version 2.0 (the "License"); +## you may not use this file except in compliance with the License. +## You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## + +# Bus names +bus "i2c-39" "i2c-1-mux (chan_id 6)" + +# Temperature sensors +chip "mlxsw-i2c-*-48" + label temp1 "Ambient ASIC Temp" + ignore temp2 + ignore temp3 + ignore temp4 + ignore temp5 + ignore temp6 + ignore temp7 + ignore temp8 + ignore temp9 + ignore temp10 + ignore temp11 + ignore temp12 + ignore temp13 + ignore temp14 + ignore temp15 + ignore temp16 + ignore temp17 + ignore temp18 + ignore temp19 + ignore temp20 + ignore temp21 + ignore temp22 + ignore temp23 + ignore temp24 + ignore temp25 + ignore temp26 + ignore temp27 + ignore temp28 + ignore temp29 + ignore temp30 + ignore temp31 + ignore temp32 + ignore temp33 + ignore temp34 + ignore temp35 + ignore temp36 + ignore temp37 + ignore temp38 + ignore temp39 + ignore temp40 + ignore temp41 + ignore temp42 + ignore temp43 + ignore temp44 + ignore temp45 + ignore temp46 + ignore temp47 + ignore temp48 + ignore temp49 + ignore temp50 + ignore temp51 + ignore temp52 + ignore temp53 + ignore temp54 + ignore temp55 + ignore temp56 + ignore temp57 + ignore temp58 + ignore temp59 + ignore temp60 + ignore temp61 + ignore temp62 + ignore temp63 + ignore temp64 + ignore temp65 + ignore temp66 + ignore temp67 + +chip "tmp102-i2c-*-49" + label temp1 "Ambient Fan Side Temp (air intake)" +chip "adt75-i2c-*-49" + label temp1 "Ambient Fan Side Temp (air intake)" +chip "tmp102-i2c-*-4a" + label temp1 "Ambient Port Side Temp (air exhaust)" +chip "adt75-i2c-*-4a" + label temp1 "Ambient Port Side Temp (air exhaust)" + +# Power controllers +chip "mp2975-i2c-*-62" + label in1 "PMIC-1 PSU 13V5 Rail (in1)" + label in2 "PMIC-1 VDD_M ADJ Rail (out1)" + ignore in3 + label temp1 "PMIC-1 VDD_M ADJ Temp 1" + ignore temp2 + label power1 "PMIC-1 13V5 VDD_M (in)" + label power2 "PMIC-1 VDD_M Rail Pwr (out1)" + ignore power3 + label curr1 "PMIC-1 13V5 VDD_M Rail Curr (in1)" + label curr2 "PMIC-1 VDD_M Rail Curr (out1)" + ignore curr3 + ignore curr4 + ignore curr5 + ignore curr6 + ignore curr7 + ignore curr8 + ignore curr9 + ignore curr10 +chip "mp2975-i2c-*-63" + label in1 "PMIC-2 PSU 13V5 Rail (in1)" + label in2 "PMIC-2 VDD_T0 ADJ Rail (out1)" + label in3 "PMIC-2 VDD_T1 ADJ Rail (out2)" + label temp1 "PMIC-2 VDD_T0 ADJ Temp 1" + label temp2 "PMIC-2 VDD_T1 ADJ Temp 2" + label power1 "PMIC-2 13V5 VDD_T0 VDD_T1 (in)" + label power2 "PMIC-2 VDD_T0 Rail Pwr (out1)" + label power3 "PMIC-2 VDD_T1 Rail Pwr (out2)" + label curr1 "PMIC-2 13V5 VDD_T0 VDD_T1 Rail Curr (in1)" + label curr2 "PMIC-2 VDD_T0 Rail Curr (out1)" + label curr3 "PMIC-2 VDD_T1 Rail Curr (out2)" + ignore curr4 + ignore curr5 + ignore curr6 +chip "mp2975-i2c-*-64" + label in1 "PMIC-3 PSU 13V5 Rail (in1)" + label in2 "PMIC-3 VDD_T2 ADJ Rail (out1)" + label in3 "PMIC-3 VDD_T3 ADJ Rail (out2)" + label temp1 "PMIC-3 VDD_T2 ADJ Temp 1" + label temp2 "PMIC-3 VDD_T3 ADJ Temp 2" + label power1 "PMIC-3 13V5 VDD_T2 VDD_T3 (in)" + label power2 "PMIC-3 VDD_T2 Rail Pwr (out1)" + label power3 "PMIC-3 VDD_T3 Rail Pwr (out2)" + label curr1 "PMIC-3 13V5 VDD_T2 VDD_T3 Rail Curr (in1)" + label curr2 "PMIC-3 VDD_T2 Rail Curr (out1)" + label curr3 "PMIC-3 VDD_T3 Rail Curr (out2)" + ignore curr4 + ignore curr5 + ignore curr6 +chip "mp2975-i2c-*-65" + label in1 "PMIC-4 PSU 13V5 Rail (in1)" + label in2 "PMIC-4 VDD_T4 ADJ Rail (out1)" + label in3 "PMIC-4 VDD_T5 ADJ Rail (out2)" + label temp1 "PMIC-4 VDD_T4 ADJ Temp 1" + label temp2 "PMIC-4 VDD_T5 ADJ Temp 2" + label power1 "PMIC-4 13V5 VDD_T4 VDD_T5 (in)" + label power2 "PMIC-4 VDD_T4 Rail Pwr (out1)" + label power3 "PMIC-4 VDD_T5 Rail Pwr (out2)" + label curr1 "PMIC-4 13V5 VDD_T4 VDD_T5 Rail Curr (in1)" + label curr2 "PMIC-4 VDD_T4 Rail Curr (out1)" + label curr3 "PMIC-4 VDD_T5 Rail Curr (out2)" + ignore curr4 + ignore curr5 + ignore curr6 +chip "mp2975-i2c-*-66" + label in1 "PMIC-5 PSU 13V5 Rail (in1)" + label in2 "PMIC-5 VDD_T6 ADJ Rail (out1)" + label in3 "PMIC-5 VDD_T7 ADJ Rail (out2)" + label temp1 "PMIC-5 VDD_T6 ADJ Temp 1" + label temp2 "PMIC-5 VDD_T7 ADJ Temp 2" + label power1 "PMIC-5 13V5 VDD_T6 VDD_T7 (in)" + label power2 "PMIC-5 VDD_T6 Rail Pwr (out1)" + label power3 "PMIC-5 VDD_T7 Rail Pwr (out2)" + label curr1 "PMIC-5 13V5 VDD_T6 VDD_T7 Rail Curr (in1)" + label curr2 "PMIC-5 VDD_T6 Rail Curr (out1)" + label curr3 "PMIC-5 VDD_T7 Rail Curr (out2)" + ignore curr4 + ignore curr5 + ignore curr6 +chip "mp2975-i2c-*-67" + label in1 "PMIC-6 PSU 13V5 Rail (in1)" + label in2 "PMIC-6 DVDD_T0 ADJ Rail (out1)" + label in3 "PMIC-6 DVDD_T1 ADJ Rail (out2)" + label temp1 "PMIC-6 DVDD_T0 ADJ Temp 1" + label temp2 "PMIC-6 DVDD_T1 ADJ Temp 2" + label power1 "PMIC-6 13V5 DVDD_T0 DVDD_T1 (in)" + label power2 "PMIC-6 DVDD_T0 Rail Pwr (out1)" + label power3 "PMIC-6 DVDD_T1 Rail Pwr (out2)" + label curr1 "PMIC-6 13V5 DVDD_T0 DVDD_T1 Rail Curr (in1)" + label curr2 "PMIC-6 DVDD_T0 Rail Curr (out1)" + label curr3 "PMIC-6 DVDD_T1 Rail Curr (out2)" + ignore curr4 + ignore curr5 + ignore curr6 +chip "mp2975-i2c-*-68" + label in1 "PMIC-7 PSU 13V5 Rail (in1)" + label in2 "PMIC-7 DVDD_T2 ADJ Rail (out1)" + label in3 "PMIC-7 DVDD_T3 ADJ Rail (out2)" + label temp1 "PMIC-7 DVDD_T2 ADJ Temp 1" + label temp2 "PMIC-7 DVDD_T3 ADJ Temp 2" + label power1 "PMIC-7 13V5 DVDD_T2 DVDD_T3 (in)" + label power2 "PMIC-7 DVDD_T2 Rail Pwr (out1)" + label power3 "PMIC-7 DVDD_T3 Rail Pwr (out2)" + label curr1 "PMIC-7 13V5 DVDD_T2 DVDD_T3 Rail Curr (in1)" + label curr2 "PMIC-7 DVDD_T2 Rail Curr (out1)" + label curr3 "PMIC-7 DVDD_T3 Rail Curr (out2)" + ignore curr4 + ignore curr5 + ignore curr6 +chip "mp2975-i2c-*-69" + label in1 "PMIC-8 PSU 13V5 Rail (in1)" + label in2 "PMIC-8 DVDD_T4 ADJ Rail (out1)" + label in3 "PMIC-8 DVDD_T5 ADJ Rail (out2)" + label temp1 "PMIC-8 DVDD_T4 ADJ Temp 1" + label temp2 "PMIC-8 DVDD_T5 ADJ Temp 2" + label power1 "PMIC-8 13V5 DVDD_T4 DVDD_T5 (in)" + label power2 "PMIC-8 DVDD_T4 Rail Pwr (out1)" + label power3 "PMIC-8 DVDD_T5 Rail Pwr (out2)" + label curr1 "PMIC-8 13V5 DVDD_T4 DVDD_T5 Rail Curr (in1)" + label curr2 "PMIC-8 DVDD_T4 Rail Curr (out1)" + label curr3 "PMIC-8 DVDD_T5 Rail Curr (out2)" + ignore curr4 + ignore curr5 + ignore curr6 +chip "mp2975-i2c-*-6a" + label in1 "PMIC-9 PSU 13V5 Rail (in1)" + label in2 "PMIC-9 DVDD_T6 ADJ Rail (out1)" + label in3 "PMIC-9 DVDD_T7 ADJ Rail (out2)" + label temp1 "PMIC-9 DVDD_T6 ADJ Temp 1" + label temp2 "PMIC-9 DVDD_T7 ADJ Temp 2" + label power1 "PMIC-9 13V5 DVDD_T6 DVDD_T7 (in)" + label power2 "PMIC-9 DVDD_T6 Rail Pwr (out1)" + label power3 "PMIC-9 DVDD_T7 Rail Pwr (out2)" + label curr1 "PMIC-9 13V5 DVDD_T6 DVDD_T7 Rail Curr (in1)" + label curr2 "PMIC-9 DVDD_T6 Rail Curr (out1)" + label curr3 "PMIC-9 DVDD_T7 Rail Curr (out2)" + ignore curr4 + ignore curr5 + ignore curr6 +chip "mp2975-i2c-*-6c" + label in1 "PMIC-10 PSU 13V5 Rail (in1)" + label in2 "PMIC-10 HVDD_T03 1V2 Rail (out1)" + label in3 "PMIC-10 HVDD_T47 1V2 Rail (out2)" + label temp1 "PMIC-10 HVDD_T03 1V2 Temp 1" + label temp2 "PMIC-10 HVDD_T47 1V2 Temp 2" + label power1 "PMIC-10 13V5 HVDD_T03 HVDD_T47 (in)" + label power2 "PMIC-10 HVDD_T03 Rail Pwr (out1)" + label power3 "PMIC-10 HVDD_T47 Rail Pwr (out2)" + label curr1 "PMIC-10 13V5 HVDD_T03 HVDD_T47 Rail Curr (in1)" + label curr2 "PMIC-10 HVDD_T03 Rail Curr (out1)" + label curr3 "PMIC-10 HVDD_T47 Rail Curr (out2)" + ignore curr4 + ignore curr5 + ignore curr6 + ignore curr7 + ignore curr8 + ignore curr9 + ignore curr10 + ignore curr11 +chip "mp2975-i2c-*-6e" + label in1 "PMIC-11 PSU 13V5 Rail (in1)" + label in2 "PMIC-11 VDDSCC 0V75 Rail (out1)" + label in3 "PMIC-11 DVDD_M ADJ Rail (out2)" + label temp1 "PMIC-11 VDDSCC 1V2 Temp 1" + label temp2 "PMIC-11 DVDD_M 1V2 Temp 2" + label power1 "PMIC-11 13V5 VDDSCC DVDD_M (in)" + label power2 "PMIC-11 VDDSCC Rail Pwr (out1)" + label power3 "PMIC-11 DVDD_M Rail Pwr (out2)" + label curr1 "PMIC-11 13V5 VDDSCC DVDD_M Rail Curr (in1)" + label curr2 "PMIC-11 VDDSCC Rail Curr (out1)" + label curr3 "PMIC-11 DVDD_M Rail Curr (out2)" + ignore curr4 + ignore curr5 + ignore curr6 + +# Power supplies + +chip "dps460-i2c-*-59" + label in1 "PSU-1(L) 220V Rail (in)" + ignore in2 + label in3 "PSU-1(L) 12V Rail (out)" + label fan1 "PSU-1(L) Fan 1" + label temp1 "PSU-1(L) Temp 1" + label temp2 "PSU-1(L) Temp 2" + label temp3 "PSU-1(L) Temp 3" + label power1 "PSU-1(L) 220V Rail Pwr (in)" + label power2 "PSU-1(L) 12V Rail Pwr (out)" + label curr1 "PSU-1(L) 220V Rail Curr (in)" + label curr2 "PSU-1(L) 12V Rail Curr (out)" + set power2_cap 0 +chip "dps460-i2c-*-5a" + label in1 "PSU-2(R) 220V Rail (in)" + ignore in2 + label in3 "PSU-2(R) 12V Rail (out)" + label fan1 "PSU-2(R) Fan 1" + label temp1 "PSU-2(R) Temp 1" + label temp2 "PSU-2(R) Temp 2" + label temp3 "PSU-2(R) Temp 3" + label power1 "PSU-2(R) 220V Rail Pwr (in)" + label power2 "PSU-2(R) 12V Rail Pwr (out)" + label curr1 "PSU-2(R) 220V Rail Curr (in)" + label curr2 "PSU-2(R) 12V Rail Curr (out)" + +# Power converters +chip "pmbus-i2c-*-10" + label in1 "IBC-1 PWR CONV 54V Rail (in1)" + ignore in2 + ignore in3 + label temp1 "IBC-1 Temp 1" + ignore curr1 + label curr2 "IBC-1 13V5 Rail Curr (out)" +chip "pmbus-i2c-*-11" + label in1 "IBC-2 PWR CONV 54V Rail (in1)" + ignore in2 + ignore in3 + label temp1 "IBC-2 Temp 1" + label curr1 "IBC-2 13V5 Rail Curr (out)" + ignore curr2 +chip "pmbus-i2c-*-13" + label in1 "IBC-3 PWR CONV 54V Rail (in1)" + ignore in2 + ignore in3 + label temp1 "IBC-3 Temp 1" + label curr1 "IBC-3 13V5 Rail Curr (out)" + ignore curr2 +chip "pmbus-i2c-*-15" + label in1 "IBC-4 PWR CONV 54V Rail (in1)" + ignore in2 + ignore in3 + label temp1 "IBC-4 Temp 1" + label curr1 "IBC-4 13V5 Rail Curr (out)" + ignore curr2 + +#COMEX CFL +chip "mp2975-i2c-39-6b" + label in1 "PMIC-6 PSU 12V Rail (vin)" + label in2 "PMIC-6 COMEX VCORE (out1)" + label in3 "PMIC-6 COMEX VCCSA (out2)" + label temp1 "PMIC-6 Temp" + label power1 "PMIC-6 COMEX Pwr (pin)" + label power2 "PMIC-6 COMEX VCORE Pwr (pout1)" + label power3 "PMIC-6 COMEX VCCSA Pwr (pout2)" + label curr1 "PMIC-6 COMEX Curr (iin)" + label curr2 "PMIC-6 COMEX VCORE Rail Curr (out1)" + ignore curr3 + ignore curr4 + ignore curr5 + label curr6 "PMIC-6 COMEX VCCSA Rail Curr (out2)" + ignore curr7 + +# Chassis fans +chip "mlxreg_fan-isa-*" + label fan1 "Chassis Fan Drawer-1 Tach 1" + label fan2 "Chassis Fan Drawer-1 Tach 2" + label fan3 "Chassis Fan Drawer-2 Tach 1" + label fan4 "Chassis Fan Drawer-2 Tach 2" + label fan5 "Chassis Fan Drawer-3 Tach 1" + label fan6 "Chassis Fan Drawer-3 Tach 2" + label fan7 "Chassis Fan Drawer-4 Tach 1" + label fan8 "Chassis Fan Drawer-4 Tach 2" + +# Memory sensors +bus "i2c-0" "SMBus I801 adapter at efa0" +chip "jc42-i2c-0-1c" + label temp1 "SODIMM Temp" + +chip "jc42-i2c-0-1a" + label temp1 "SODIMM Temp" + +# PCH +chip "pch_cannonlake-virtual-*" + label temp1 "PCH Temp" + +# SSD +chip "drivetemp-*" + label temp1 "SSD Temp" + +chip "*-acpi-*" + label temp1 "CPU ACPI temp" diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/system_health_monitoring_config.json b/device/mellanox/x86_64-nvidia_sn5400-r0/system_health_monitoring_config.json new file mode 120000 index 000000000000..98df66c27ca5 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/system_health_monitoring_config.json @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/system_health_monitoring_config.json \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/thermal_policy.json b/device/mellanox/x86_64-nvidia_sn5400-r0/thermal_policy.json new file mode 120000 index 000000000000..5a25cd87f70c --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/thermal_policy.json @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/thermal_policy.json \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5400_simx-r0/ACS-SN5400 b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/ACS-SN5400 new file mode 120000 index 000000000000..d68ed0a1be77 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/ACS-SN5400 @@ -0,0 +1 @@ +../x86_64-nvidia_sn5400-r0/ACS-SN5400/ \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5400_simx-r0/default_sku b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/default_sku new file mode 120000 index 000000000000..6358d0a77390 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/default_sku @@ -0,0 +1 @@ +../x86_64-nvidia_sn5400-r0/default_sku \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5400_simx-r0/platform.json b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/platform.json new file mode 100644 index 000000000000..213822ce5116 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/platform.json @@ -0,0 +1,1336 @@ +{ + "chassis": { + "name": "SN5400", + "components": [ + { + "name": "ONIE" + }, + { + "name": "SSD" + }, + { + "name": "BIOS" + }, + { + "name": "CPLD1" + }, + { + "name": "CPLD2" + }, + { + "name": "CPLD3" + }, + { + "name": "CPLD4" + }, + { + "name": "CPLD5" + }, + { + "name": "CPLD6" + } + ], + "fans": [], + "fan_drawers": [ + { + "name": "drawer1", + "fans": [ + { + "name": "fan1" + }, + { + "name": "fan2" + } + ] + }, + { + "name": "drawer2", + "fans": [ + { + "name": "fan3" + }, + { + "name": "fan4" + } + ] + }, + { + "name": "drawer3", + "fans": [ + { + "name": "fan5" + }, + { + "name": "fan6" + } + ] + }, + { + "name": "drawer4", + "fans": [ + { + "name": "fan7" + }, + { + "name": "fan8" + } + ] + } + ], + "psus": [ + { + "name": "PSU 1", + "fans": [ + { + "name": "psu1_fan1" + } + ], + "thermals": [ + { + "name": "PSU-1 Temp" + } + ] + }, + { + "name": "PSU 2", + "fans": [ + { + "name": "psu2_fan1" + } + ], + "thermals": [ + { + "name": "PSU-2 Temp" + } + ] + } + ], + "thermals": [ + { + "name": "ASIC" + }, + { + "name": "Ambient Fan Side Temp" + }, + { + "name": "Ambient Port Side Temp" + }, + { + "name": "CPU Core 0 Temp" + }, + { + "name": "CPU Core 1 Temp" + }, + { + "name": "CPU Core 2 Temp" + }, + { + "name": "CPU Core 3 Temp" + }, + { + "name": "CPU Core 4 Temp" + }, + { + "name": "CPU Core 5 Temp" + }, + { + "name": "CPU Pack Temp" + }, + { + "name": "SODIMM 1 Temp" + }, + { + "name": "SODIMM 2 Temp" + }, + { + "name": "PCH Temp" + } + ], + "sfps": [ + { + "name": "sfp1", + "thermals": [ + { + "name": "xSFP module 1 Temp" + } + ] + }, + { + "name": "sfp2", + "thermals": [ + { + "name": "xSFP module 2 Temp" + } + ] + }, + { + "name": "sfp3", + "thermals": [ + { + "name": "xSFP module 3 Temp" + } + ] + }, + { + "name": "sfp4", + "thermals": [ + { + "name": "xSFP module 4 Temp" + } + ] + }, + { + "name": "sfp5", + "thermals": [ + { + "name": "xSFP module 5 Temp" + } + ] + }, + { + "name": "sfp6", + "thermals": [ + { + "name": "xSFP module 6 Temp" + } + ] + }, + { + "name": "sfp7", + "thermals": [ + { + "name": "xSFP module 7 Temp" + } + ] + }, + { + "name": "sfp8", + "thermals": [ + { + "name": "xSFP module 8 Temp" + } + ] + }, + { + "name": "sfp9", + "thermals": [ + { + "name": "xSFP module 9 Temp" + } + ] + }, + { + "name": "sfp10", + "thermals": [ + { + "name": "xSFP module 10 Temp" + } + ] + }, + { + "name": "sfp11", + "thermals": [ + { + "name": "xSFP module 11 Temp" + } + ] + }, + { + "name": "sfp12", + "thermals": [ + { + "name": "xSFP module 12 Temp" + } + ] + }, + { + "name": "sfp13", + "thermals": [ + { + "name": "xSFP module 13 Temp" + } + ] + }, + { + "name": "sfp14", + "thermals": [ + { + "name": "xSFP module 14 Temp" + } + ] + }, + { + "name": "sfp15", + "thermals": [ + { + "name": "xSFP module 15 Temp" + } + ] + }, + { + "name": "sfp16", + "thermals": [ + { + "name": "xSFP module 16 Temp" + } + ] + }, + { + "name": "sfp17", + "thermals": [ + { + "name": "xSFP module 17 Temp" + } + ] + }, + { + "name": "sfp18", + "thermals": [ + { + "name": "xSFP module 18 Temp" + } + ] + }, + { + "name": "sfp19", + "thermals": [ + { + "name": "xSFP module 19 Temp" + } + ] + }, + { + "name": "sfp20", + "thermals": [ + { + "name": "xSFP module 20 Temp" + } + ] + }, + { + "name": "sfp21", + "thermals": [ + { + "name": "xSFP module 21 Temp" + } + ] + }, + { + "name": "sfp22", + "thermals": [ + { + "name": "xSFP module 22 Temp" + } + ] + }, + { + "name": "sfp23", + "thermals": [ + { + "name": "xSFP module 23 Temp" + } + ] + }, + { + "name": "sfp24", + "thermals": [ + { + "name": "xSFP module 24 Temp" + } + ] + }, + { + "name": "sfp25", + "thermals": [ + { + "name": "xSFP module 25 Temp" + } + ] + }, + { + "name": "sfp26", + "thermals": [ + { + "name": "xSFP module 26 Temp" + } + ] + }, + { + "name": "sfp27", + "thermals": [ + { + "name": "xSFP module 27 Temp" + } + ] + }, + { + "name": "sfp28", + "thermals": [ + { + "name": "xSFP module 28 Temp" + } + ] + }, + { + "name": "sfp29", + "thermals": [ + { + "name": "xSFP module 29 Temp" + } + ] + }, + { + "name": "sfp30", + "thermals": [ + { + "name": "xSFP module 30 Temp" + } + ] + }, + { + "name": "sfp31", + "thermals": [ + { + "name": "xSFP module 31 Temp" + } + ] + }, + { + "name": "sfp32", + "thermals": [ + { + "name": "xSFP module 32 Temp" + } + ] + }, + { + "name": "sfp33", + "thermals": [ + { + "name": "xSFP module 33 Temp" + } + ] + }, + { + "name": "sfp34", + "thermals": [ + { + "name": "xSFP module 34 Temp" + } + ] + }, + { + "name": "sfp35", + "thermals": [ + { + "name": "xSFP module 35 Temp" + } + ] + }, + { + "name": "sfp36", + "thermals": [ + { + "name": "xSFP module 36 Temp" + } + ] + }, + { + "name": "sfp37", + "thermals": [ + { + "name": "xSFP module 37 Temp" + } + ] + }, + { + "name": "sfp38", + "thermals": [ + { + "name": "xSFP module 38 Temp" + } + ] + }, + { + "name": "sfp39", + "thermals": [ + { + "name": "xSFP module 39 Temp" + } + ] + }, + { + "name": "sfp40", + "thermals": [ + { + "name": "xSFP module 40 Temp" + } + ] + }, + { + "name": "sfp41", + "thermals": [ + { + "name": "xSFP module 41 Temp" + } + ] + }, + { + "name": "sfp42", + "thermals": [ + { + "name": "xSFP module 42 Temp" + } + ] + }, + { + "name": "sfp43", + "thermals": [ + { + "name": "xSFP module 43 Temp" + } + ] + }, + { + "name": "sfp44", + "thermals": [ + { + "name": "xSFP module 44 Temp" + } + ] + }, + { + "name": "sfp45", + "thermals": [ + { + "name": "xSFP module 45 Temp" + } + ] + }, + { + "name": "sfp46", + "thermals": [ + { + "name": "xSFP module 46 Temp" + } + ] + }, + { + "name": "sfp47", + "thermals": [ + { + "name": "xSFP module 47 Temp" + } + ] + }, + { + "name": "sfp48", + "thermals": [ + { + "name": "xSFP module 48 Temp" + } + ] + }, + { + "name": "sfp49", + "thermals": [ + { + "name": "xSFP module 49 Temp" + } + ] + }, + { + "name": "sfp50", + "thermals": [ + { + "name": "xSFP module 50 Temp" + } + ] + }, + { + "name": "sfp51", + "thermals": [ + { + "name": "xSFP module 51 Temp" + } + ] + }, + { + "name": "sfp52", + "thermals": [ + { + "name": "xSFP module 52 Temp" + } + ] + }, + { + "name": "sfp53", + "thermals": [ + { + "name": "xSFP module 53 Temp" + } + ] + }, + { + "name": "sfp54", + "thermals": [ + { + "name": "xSFP module 54 Temp" + } + ] + }, + { + "name": "sfp55", + "thermals": [ + { + "name": "xSFP module 55 Temp" + } + ] + }, + { + "name": "sfp56", + "thermals": [ + { + "name": "xSFP module 56 Temp" + } + ] + }, + { + "name": "sfp57", + "thermals": [ + { + "name": "xSFP module 57 Temp" + } + ] + }, + { + "name": "sfp58", + "thermals": [ + { + "name": "xSFP module 58 Temp" + } + ] + }, + { + "name": "sfp59", + "thermals": [ + { + "name": "xSFP module 59 Temp" + } + ] + }, + { + "name": "sfp60", + "thermals": [ + { + "name": "xSFP module 60 Temp" + } + ] + }, + { + "name": "sfp61", + "thermals": [ + { + "name": "xSFP module 61 Temp" + } + ] + }, + { + "name": "sfp62", + "thermals": [ + { + "name": "xSFP module 62 Temp" + } + ] + }, + { + "name": "sfp63", + "thermals": [ + { + "name": "xSFP module 63 Temp" + } + ] + }, + { + "name": "sfp64", + "thermals": [ + { + "name": "xSFP module 64 Temp" + } + ] + }, + { + "name": "sfp65", + "thermals": [ + { + "name": "xSFP module 65 Temp" + } + ] + }, + { + "name": "sfp66", + "thermals": [ + { + "name": "xSFP module 66 Temp" + } + ] + } + ] + }, + "interfaces": { + "Ethernet0": { + "index": "1,1,1,1,1,1,1,1", + "lanes": "0,1,2,3,4,5,6,7", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp1"], + "2x200G[100G,50G,40G,25G,10G]": ["etp1a", "etp1b"], + "4x100G[50G,25G,10G]": ["etp1a", "etp1b", "etp1c", "etp1d"], + "8x50G[25G,10G]": ["etp1a", "etp1b", "etp1c", "etp1d", "etp1e", "etp1f", "etp1g", "etp1h"] + } + }, + "Ethernet8": { + "index": "2,2,2,2,2,2,2,2", + "lanes": "8,9,10,11,12,13,14,15", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp2"], + "2x200G[100G,50G,40G,25G,10G]": ["etp2a", "etp2b"], + "4x100G[50G,25G,10G]": ["etp2a", "etp2b", "etp2c", "etp2d"], + "8x50G[25G,10G]": ["etp2a", "etp2b", "etp2c", "etp2d", "etp2e", "etp2f", "etp2g", "etp2h"] + } + }, + "Ethernet16": { + "index": "3,3,3,3,3,3,3,3", + "lanes": "16,17,18,19,20,21,22,23", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp3"], + "2x200G[100G,50G,40G,25G,10G]": ["etp3a", "etp3b"], + "4x100G[50G,25G,10G]": ["etp3a", "etp3b", "etp3c", "etp3d"], + "8x50G[25G,10G]": ["etp3a", "etp3b", "etp3c", "etp3d", "etp3e", "etp3f", "etp3g", "etp3h"] + } + }, + "Ethernet24": { + "index": "4,4,4,4,4,4,4,4", + "lanes": "24,25,26,27,28,29,30,31", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp4"], + "2x200G[100G,50G,40G,25G,10G]": ["etp4a", "etp4b"], + "4x100G[50G,25G,10G]": ["etp4a", "etp4b", "etp4c", "etp4d"], + "8x50G[25G,10G]": ["etp4a", "etp4b", "etp4c", "etp4d", "etp4e", "etp4f", "etp4g", "etp4h"] + } + }, + "Ethernet32": { + "index": "5,5,5,5,5,5,5,5", + "lanes": "32,33,34,35,36,37,38,39", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp5"], + "2x200G[100G,50G,40G,25G,10G]": ["etp5a", "etp5b"], + "4x100G[50G,25G,10G]": ["etp5a", "etp5b", "etp5c", "etp5d"], + "8x50G[25G,10G]": ["etp5a", "etp5b", "etp5c", "etp5d", "etp5e", "etp5f", "etp5g", "etp5h"] + } + }, + "Ethernet40": { + "index": "6,6,6,6,6,6,6,6", + "lanes": "40,41,42,43,44,45,46,47", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp6"], + "2x200G[100G,50G,40G,25G,10G]": ["etp6a", "etp6b"], + "4x100G[50G,25G,10G]": ["etp6a", "etp6b", "etp6c", "etp6d"], + "8x50G[25G,10G]": ["etp6a", "etp6b", "etp6c", "etp6d", "etp6e", "etp6f", "etp6g", "etp6h"] + } + }, + "Ethernet48": { + "index": "7,7,7,7,7,7,7,7", + "lanes": "48,49,50,51,52,53,54,55", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp7"], + "2x200G[100G,50G,40G,25G,10G]": ["etp7a", "etp7b"], + "4x100G[50G,25G,10G]": ["etp7a", "etp7b", "etp7c", "etp7d"], + "8x50G[25G,10G]": ["etp7a", "etp7b", "etp7c", "etp7d", "etp7e", "etp7f", "etp7g", "etp7h"] + } + }, + "Ethernet56": { + "index": "8,8,8,8,8,8,8,8", + "lanes": "56,57,58,59,60,61,62,63", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp8"], + "2x200G[100G,50G,40G,25G,10G]": ["etp8a", "etp8b"], + "4x100G[50G,25G,10G]": ["etp8a", "etp8b", "etp8c", "etp8d"], + "8x50G[25G,10G]": ["etp8a", "etp8b", "etp8c", "etp8d", "etp8e", "etp8f", "etp8g", "etp8h"] + } + }, + "Ethernet64": { + "index": "9,9,9,9,9,9,9,9", + "lanes": "64,65,66,67,68,69,70,71", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp9"], + "2x200G[100G,50G,40G,25G,10G]": ["etp9a", "etp9b"], + "4x100G[50G,25G,10G]": ["etp9a", "etp9b", "etp9c", "etp9d"], + "8x50G[25G,10G]": ["etp9a", "etp9b", "etp9c", "etp9d", "etp9e", "etp9f", "etp9g", "etp9h"] + } + }, + "Ethernet72": { + "index": "10,10,10,10,10,10,10,10", + "lanes": "72,73,74,75,76,77,78,79", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp10"], + "2x200G[100G,50G,40G,25G,10G]": ["etp10a", "etp10b"], + "4x100G[50G,25G,10G]": ["etp10a", "etp10b", "etp10c", "etp10d"], + "8x50G[25G,10G]": ["etp10a", "etp10b", "etp10c", "etp10d", "etp10e", "etp10f", "etp10g", "etp10h"] + } + }, + "Ethernet80": { + "index": "11,11,11,11,11,11,11,11", + "lanes": "80,81,82,83,84,85,86,87", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp11"], + "2x200G[100G,50G,40G,25G,10G]": ["etp11a", "etp11b"], + "4x100G[50G,25G,10G]": ["etp11a", "etp11b", "etp11c", "etp11d"], + "8x50G[25G,10G]": ["etp11a", "etp11b", "etp11c", "etp11d", "etp11e", "etp11f", "etp11g", "etp11h"] + } + }, + "Ethernet88": { + "index": "12,12,12,12,12,12,12,12", + "lanes": "88,89,90,91,92,93,94,95", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp12"], + "2x200G[100G,50G,40G,25G,10G]": ["etp12a", "etp12b"], + "4x100G[50G,25G,10G]": ["etp12a", "etp12b", "etp12c", "etp12d"], + "8x50G[25G,10G]": ["etp12a", "etp12b", "etp12c", "etp12d", "etp12e", "etp12f", "etp12g", "etp12h"] + } + }, + "Ethernet96": { + "index": "13,13,13,13,13,13,13,13", + "lanes": "96,97,98,99,100,101,102,103", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp13"], + "2x200G[100G,50G,40G,25G,10G]": ["etp13a", "etp13b"], + "4x100G[50G,25G,10G]": ["etp13a", "etp13b", "etp13c", "etp13d"], + "8x50G[25G,10G]": ["etp13a", "etp13b", "etp13c", "etp13d", "etp13e", "etp13f", "etp13g", "etp13h"] + } + }, + "Ethernet104": { + "index": "14,14,14,14,14,14,14,14", + "lanes": "104,105,106,107,108,109,110,111", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp14"], + "2x200G[100G,50G,40G,25G,10G]": ["etp14a", "etp14b"], + "4x100G[50G,25G,10G]": ["etp14a", "etp14b", "etp14c", "etp14d"], + "8x50G[25G,10G]": ["etp14a", "etp14b", "etp14c", "etp14d", "etp14e", "etp14f", "etp14g", "etp14h"] + } + }, + "Ethernet112": { + "index": "15,15,15,15,15,15,15,15", + "lanes": "112,113,114,115,116,117,118,119", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp15"], + "2x200G[100G,50G,40G,25G,10G]": ["etp15a", "etp15b"], + "4x100G[50G,25G,10G]": ["etp15a", "etp15b", "etp15c", "etp15d"], + "8x50G[25G,10G]": ["etp15a", "etp15b", "etp15c", "etp15d", "etp15e", "etp15f", "etp15g", "etp15h"] + } + }, + "Ethernet120": { + "index": "16,16,16,16,16,16,16,16", + "lanes": "120,121,122,123,124,125,126,127", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp16"], + "2x200G[100G,50G,40G,25G,10G]": ["etp16a", "etp16b"], + "4x100G[50G,25G,10G]": ["etp16a", "etp16b", "etp16c", "etp16d"], + "8x50G[25G,10G]": ["etp16a", "etp16b", "etp16c", "etp16d", "etp16e", "etp16f", "etp16g", "etp16h"] + } + }, + "Ethernet128": { + "index": "17,17,17,17,17,17,17,17", + "lanes": "128,129,130,131,132,133,134,135", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp17"], + "2x200G[100G,50G,40G,25G,10G]": ["etp17a", "etp17b"], + "4x100G[50G,25G,10G]": ["etp17a", "etp17b", "etp17c", "etp17d"], + "8x50G[25G,10G]": ["etp17a", "etp17b", "etp17c", "etp17d", "etp17e", "etp17f", "etp17g", "etp17h"] + } + }, + "Ethernet136": { + "index": "18,18,18,18,18,18,18,18", + "lanes": "136,137,138,139,140,141,142,143", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp18"], + "2x200G[100G,50G,40G,25G,10G]": ["etp18a", "etp18b"], + "4x100G[50G,25G,10G]": ["etp18a", "etp18b", "etp18c", "etp18d"], + "8x50G[25G,10G]": ["etp18a", "etp18b", "etp18c", "etp18d", "etp18e", "etp18f", "etp18g", "etp18h"] + } + }, + "Ethernet144": { + "index": "19,19,19,19,19,19,19,19", + "lanes": "144,145,146,147,148,149,150,151", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp19"], + "2x200G[100G,50G,40G,25G,10G]": ["etp19a", "etp19b"], + "4x100G[50G,25G,10G]": ["etp19a", "etp19b", "etp19c", "etp19d"], + "8x50G[25G,10G]": ["etp19a", "etp19b", "etp19c", "etp19d", "etp19e", "etp19f", "etp19g", "etp19h"] + } + }, + "Ethernet152": { + "index": "20,20,20,20,20,20,20,20", + "lanes": "152,153,154,155,156,157,158,159", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp20"], + "2x200G[100G,50G,40G,25G,10G]": ["etp20a", "etp20b"], + "4x100G[50G,25G,10G]": ["etp20a", "etp20b", "etp20c", "etp20d"], + "8x50G[25G,10G]": ["etp20a", "etp20b", "etp20c", "etp20d", "etp20e", "etp20f", "etp20g", "etp20h"] + } + }, + "Ethernet160": { + "index": "21,21,21,21,21,21,21,21", + "lanes": "160,161,162,163,164,165,166,167", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp21"], + "2x200G[100G,50G,40G,25G,10G]": ["etp21a", "etp21b"], + "4x100G[50G,25G,10G]": ["etp21a", "etp21b", "etp21c", "etp21d"], + "8x50G[25G,10G]": ["etp21a", "etp21b", "etp21c", "etp21d", "etp21e", "etp21f", "etp21g", "etp21h"] + } + }, + "Ethernet168": { + "index": "22,22,22,22,22,22,22,22", + "lanes": "168,169,170,171,172,173,174,175", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp22"], + "2x200G[100G,50G,40G,25G,10G]": ["etp22a", "etp22b"], + "4x100G[50G,25G,10G]": ["etp22a", "etp22b", "etp22c", "etp22d"], + "8x50G[25G,10G]": ["etp22a", "etp22b", "etp22c", "etp22d", "etp22e", "etp22f", "etp22g", "etp22h"] + } + }, + "Ethernet176": { + "index": "23,23,23,23,23,23,23,23", + "lanes": "176,177,178,179,180,181,182,183", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp23"], + "2x200G[100G,50G,40G,25G,10G]": ["etp23a", "etp23b"], + "4x100G[50G,25G,10G]": ["etp23a", "etp23b", "etp23c", "etp23d"], + "8x50G[25G,10G]": ["etp23a", "etp23b", "etp23c", "etp23d", "etp23e", "etp23f", "etp23g", "etp23h"] + } + }, + "Ethernet184": { + "index": "24,24,24,24,24,24,24,24", + "lanes": "184,185,186,187,188,189,190,191", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp24"], + "2x200G[100G,50G,40G,25G,10G]": ["etp24a", "etp24b"], + "4x100G[50G,25G,10G]": ["etp24a", "etp24b", "etp24c", "etp24d"], + "8x50G[25G,10G]": ["etp24a", "etp24b", "etp24c", "etp24d", "etp24e", "etp24f", "etp24g", "etp24h"] + } + }, + "Ethernet192": { + "index": "25,25,25,25,25,25,25,25", + "lanes": "192,193,194,195,196,197,198,199", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp25"], + "2x200G[100G,50G,40G,25G,10G]": ["etp25a", "etp25b"], + "4x100G[50G,25G,10G]": ["etp25a", "etp25b", "etp25c", "etp25d"], + "8x50G[25G,10G]": ["etp25a", "etp25b", "etp25c", "etp25d", "etp25e", "etp25f", "etp25g", "etp25h"] + } + }, + "Ethernet200": { + "index": "26,26,26,26,26,26,26,26", + "lanes": "200,201,202,203,204,205,206,207", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp26"], + "2x200G[100G,50G,40G,25G,10G]": ["etp26a", "etp26b"], + "4x100G[50G,25G,10G]": ["etp26a", "etp26b", "etp26c", "etp26d"], + "8x50G[25G,10G]": ["etp26a", "etp26b", "etp26c", "etp26d", "etp26e", "etp26f", "etp26g", "etp26h"] + } + }, + "Ethernet208": { + "index": "27,27,27,27,27,27,27,27", + "lanes": "208,209,210,211,212,213,214,215", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp27"], + "2x200G[100G,50G,40G,25G,10G]": ["etp27a", "etp27b"], + "4x100G[50G,25G,10G]": ["etp27a", "etp27b", "etp27c", "etp27d"], + "8x50G[25G,10G]": ["etp27a", "etp27b", "etp27c", "etp27d", "etp27e", "etp27f", "etp27g", "etp27h"] + } + }, + "Ethernet216": { + "index": "28,28,28,28,28,28,28,28", + "lanes": "216,217,218,219,220,221,222,223", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp28"], + "2x200G[100G,50G,40G,25G,10G]": ["etp28a", "etp28b"], + "4x100G[50G,25G,10G]": ["etp28a", "etp28b", "etp28c", "etp28d"], + "8x50G[25G,10G]": ["etp28a", "etp28b", "etp28c", "etp28d", "etp28e", "etp28f", "etp28g", "etp28h"] + } + }, + "Ethernet224": { + "index": "29,29,29,29,29,29,29,29", + "lanes": "224,225,226,227,228,229,230,231", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp29"], + "2x200G[100G,50G,40G,25G,10G]": ["etp29a", "etp29b"], + "4x100G[50G,25G,10G]": ["etp29a", "etp29b", "etp29c", "etp29d"], + "8x50G[25G,10G]": ["etp29a", "etp29b", "etp29c", "etp29d", "etp29e", "etp29f", "etp29g", "etp29h"] + } + }, + "Ethernet232": { + "index": "30,30,30,30,30,30,30,30", + "lanes": "232,233,234,235,236,237,238,239", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp30"], + "2x200G[100G,50G,40G,25G,10G]": ["etp30a", "etp30b"], + "4x100G[50G,25G,10G]": ["etp30a", "etp30b", "etp30c", "etp30d"], + "8x50G[25G,10G]": ["etp30a", "etp30b", "etp30c", "etp30d", "etp30e", "etp30f", "etp30g", "etp30h"] + } + }, + "Ethernet240": { + "index": "31,31,31,31,31,31,31,31", + "lanes": "240,241,242,243,244,245,246,247", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp31"], + "2x200G[100G,50G,40G,25G,10G]": ["etp31a", "etp31b"], + "4x100G[50G,25G,10G]": ["etp31a", "etp31b", "etp31c", "etp31d"], + "8x50G[25G,10G]": ["etp31a", "etp31b", "etp31c", "etp31d", "etp31e", "etp31f", "etp31g", "etp31h"] + } + }, + "Ethernet248": { + "index": "32,32,32,32,32,32,32,32", + "lanes": "248,249,250,251,252,253,254,255", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp32"], + "2x200G[100G,50G,40G,25G,10G]": ["etp32a", "etp32b"], + "4x100G[50G,25G,10G]": ["etp32a", "etp32b", "etp32c", "etp32d"], + "8x50G[25G,10G]": ["etp32a", "etp32b", "etp32c", "etp32d", "etp32e", "etp32f", "etp32g", "etp32h"] + } + }, + "Ethernet256": { + "index": "33,33,33,33,33,33,33,33", + "lanes": "256,257,258,259,260,261,262,263", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp33"], + "2x200G[100G,50G,40G,25G,10G]": ["etp33a", "etp33b"], + "4x100G[50G,25G,10G]": ["etp33a", "etp33b", "etp33c", "etp33d"], + "8x50G[25G,10G]": ["etp33a", "etp33b", "etp33c", "etp33d", "etp33e", "etp33f", "etp33g", "etp33h"] + } + }, + "Ethernet264": { + "index": "34,34,34,34,34,34,34,34", + "lanes": "264,265,266,267,268,269,270,271", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp34"], + "2x200G[100G,50G,40G,25G,10G]": ["etp34a", "etp34b"], + "4x100G[50G,25G,10G]": ["etp34a", "etp34b", "etp34c", "etp34d"], + "8x50G[25G,10G]": ["etp34a", "etp34b", "etp34c", "etp34d", "etp34e", "etp34f", "etp34g", "etp34h"] + } + }, + "Ethernet272": { + "index": "35,35,35,35,35,35,35,35", + "lanes": "272,273,274,275,276,277,278,279", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp35"], + "2x200G[100G,50G,40G,25G,10G]": ["etp35a", "etp35b"], + "4x100G[50G,25G,10G]": ["etp35a", "etp35b", "etp35c", "etp35d"], + "8x50G[25G,10G]": ["etp35a", "etp35b", "etp35c", "etp35d", "etp35e", "etp35f", "etp35g", "etp35h"] + } + }, + "Ethernet280": { + "index": "36,36,36,36,36,36,36,36", + "lanes": "280,281,282,283,284,285,286,287", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp36"], + "2x200G[100G,50G,40G,25G,10G]": ["etp36a", "etp36b"], + "4x100G[50G,25G,10G]": ["etp36a", "etp36b", "etp36c", "etp36d"], + "8x50G[25G,10G]": ["etp36a", "etp36b", "etp36c", "etp36d", "etp36e", "etp36f", "etp36g", "etp36h"] + } + }, + "Ethernet288": { + "index": "37,37,37,37,37,37,37,37", + "lanes": "288,289,290,291,292,293,294,295", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp37"], + "2x200G[100G,50G,40G,25G,10G]": ["etp37a", "etp37b"], + "4x100G[50G,25G,10G]": ["etp37a", "etp37b", "etp37c", "etp37d"], + "8x50G[25G,10G]": ["etp37a", "etp37b", "etp37c", "etp37d", "etp37e", "etp37f", "etp37g", "etp37h"] + } + }, + "Ethernet296": { + "index": "38,38,38,38,38,38,38,38", + "lanes": "296,297,298,299,300,301,302,303", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp38"], + "2x200G[100G,50G,40G,25G,10G]": ["etp38a", "etp38b"], + "4x100G[50G,25G,10G]": ["etp38a", "etp38b", "etp38c", "etp38d"], + "8x50G[25G,10G]": ["etp38a", "etp38b", "etp38c", "etp38d", "etp38e", "etp38f", "etp38g", "etp38h"] + } + }, + "Ethernet304": { + "index": "39,39,39,39,39,39,39,39", + "lanes": "304,305,306,307,308,309,310,311", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp39"], + "2x200G[100G,50G,40G,25G,10G]": ["etp39a", "etp39b"], + "4x100G[50G,25G,10G]": ["etp39a", "etp39b", "etp39c", "etp39d"], + "8x50G[25G,10G]": ["etp39a", "etp39b", "etp39c", "etp39d", "etp39e", "etp39f", "etp39g", "etp39h"] + } + }, + "Ethernet312": { + "index": "40,40,40,40,40,40,40,40", + "lanes": "312,313,314,315,316,317,318,319", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp40"], + "2x200G[100G,50G,40G,25G,10G]": ["etp40a", "etp40b"], + "4x100G[50G,25G,10G]": ["etp40a", "etp40b", "etp40c", "etp40d"], + "8x50G[25G,10G]": ["etp40a", "etp40b", "etp40c", "etp40d", "etp40e", "etp40f", "etp40g", "etp40h"] + } + }, + "Ethernet320": { + "index": "41,41,41,41,41,41,41,41", + "lanes": "320,321,322,323,324,325,326,327", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp41"], + "2x200G[100G,50G,40G,25G,10G]": ["etp41a", "etp41b"], + "4x100G[50G,25G,10G]": ["etp41a", "etp41b", "etp41c", "etp41d"], + "8x50G[25G,10G]": ["etp41a", "etp41b", "etp41c", "etp41d", "etp41e", "etp41f", "etp41g", "etp41h"] + } + }, + "Ethernet328": { + "index": "42,42,42,42,42,42,42,42", + "lanes": "328,329,330,331,332,333,334,335", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp42"], + "2x200G[100G,50G,40G,25G,10G]": ["etp42a", "etp42b"], + "4x100G[50G,25G,10G]": ["etp42a", "etp42b", "etp42c", "etp42d"], + "8x50G[25G,10G]": ["etp42a", "etp42b", "etp42c", "etp42d", "etp42e", "etp42f", "etp42g", "etp42h"] + } + }, + "Ethernet336": { + "index": "43,43,43,43,43,43,43,43", + "lanes": "336,337,338,339,340,341,342,343", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp43"], + "2x200G[100G,50G,40G,25G,10G]": ["etp43a", "etp43b"], + "4x100G[50G,25G,10G]": ["etp43a", "etp43b", "etp43c", "etp43d"], + "8x50G[25G,10G]": ["etp43a", "etp43b", "etp43c", "etp43d", "etp43e", "etp43f", "etp43g", "etp43h"] + } + }, + "Ethernet344": { + "index": "44,44,44,44,44,44,44,44", + "lanes": "344,345,346,347,348,349,350,351", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp44"], + "2x200G[100G,50G,40G,25G,10G]": ["etp44a", "etp44b"], + "4x100G[50G,25G,10G]": ["etp44a", "etp44b", "etp44c", "etp44d"], + "8x50G[25G,10G]": ["etp44a", "etp44b", "etp44c", "etp44d", "etp44e", "etp44f", "etp44g", "etp44h"] + } + }, + "Ethernet352": { + "index": "45,45,45,45,45,45,45,45", + "lanes": "352,353,354,355,356,357,358,359", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp45"], + "2x200G[100G,50G,40G,25G,10G]": ["etp45a", "etp45b"], + "4x100G[50G,25G,10G]": ["etp45a", "etp45b", "etp45c", "etp45d"], + "8x50G[25G,10G]": ["etp45a", "etp45b", "etp45c", "etp45d", "etp45e", "etp45f", "etp45g", "etp45h"] + } + }, + "Ethernet360": { + "index": "46,46,46,46,46,46,46,46", + "lanes": "360,361,362,363,364,365,366,367", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp46"], + "2x200G[100G,50G,40G,25G,10G]": ["etp46a", "etp46b"], + "4x100G[50G,25G,10G]": ["etp46a", "etp46b", "etp46c", "etp46d"], + "8x50G[25G,10G]": ["etp46a", "etp46b", "etp46c", "etp46d", "etp46e", "etp46f", "etp46g", "etp46h"] + } + }, + "Ethernet368": { + "index": "47,47,47,47,47,47,47,47", + "lanes": "368,369,370,371,372,373,374,375", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp47"], + "2x200G[100G,50G,40G,25G,10G]": ["etp47a", "etp47b"], + "4x100G[50G,25G,10G]": ["etp47a", "etp47b", "etp47c", "etp47d"], + "8x50G[25G,10G]": ["etp47a", "etp47b", "etp47c", "etp47d", "etp47e", "etp47f", "etp47g", "etp47h"] + } + }, + "Ethernet376": { + "index": "48,48,48,48,48,48,48,48", + "lanes": "376,377,378,379,380,381,382,383", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp48"], + "2x200G[100G,50G,40G,25G,10G]": ["etp48a", "etp48b"], + "4x100G[50G,25G,10G]": ["etp48a", "etp48b", "etp48c", "etp48d"], + "8x50G[25G,10G]": ["etp48a", "etp48b", "etp48c", "etp48d", "etp48e", "etp48f", "etp48g", "etp48h"] + } + }, + "Ethernet384": { + "index": "49,49,49,49,49,49,49,49", + "lanes": "384,385,386,387,388,389,390,391", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp49"], + "2x200G[100G,50G,40G,25G,10G]": ["etp49a", "etp49b"], + "4x100G[50G,25G,10G]": ["etp49a", "etp49b", "etp49c", "etp49d"], + "8x50G[25G,10G]": ["etp49a", "etp49b", "etp49c", "etp49d", "etp49e", "etp49f", "etp49g", "etp49h"] + } + }, + "Ethernet392": { + "index": "50,50,50,50,50,50,50,50", + "lanes": "392,393,394,395,396,397,398,399", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp50"], + "2x200G[100G,50G,40G,25G,10G]": ["etp50a", "etp50b"], + "4x100G[50G,25G,10G]": ["etp50a", "etp50b", "etp50c", "etp50d"], + "8x50G[25G,10G]": ["etp50a", "etp50b", "etp50c", "etp50d", "etp50e", "etp50f", "etp50g", "etp50h"] + } + }, + "Ethernet400": { + "index": "51,51,51,51,51,51,51,51", + "lanes": "400,401,402,403,404,405,406,407", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp51"], + "2x200G[100G,50G,40G,25G,10G]": ["etp51a", "etp51b"], + "4x100G[50G,25G,10G]": ["etp51a", "etp51b", "etp51c", "etp51d"], + "8x50G[25G,10G]": ["etp51a", "etp51b", "etp51c", "etp51d", "etp51e", "etp51f", "etp51g", "etp51h"] + } + }, + "Ethernet408": { + "index": "52,52,52,52,52,52,52,52", + "lanes": "408,409,410,411,412,413,414,415", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp52"], + "2x200G[100G,50G,40G,25G,10G]": ["etp52a", "etp52b"], + "4x100G[50G,25G,10G]": ["etp52a", "etp52b", "etp52c", "etp52d"], + "8x50G[25G,10G]": ["etp52a", "etp52b", "etp52c", "etp52d", "etp52e", "etp52f", "etp52g", "etp52h"] + } + }, + "Ethernet416": { + "index": "53,53,53,53,53,53,53,53", + "lanes": "416,417,418,419,420,421,422,423", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp53"], + "2x200G[100G,50G,40G,25G,10G]": ["etp53a", "etp53b"], + "4x100G[50G,25G,10G]": ["etp53a", "etp53b", "etp53c", "etp53d"], + "8x50G[25G,10G]": ["etp53a", "etp53b", "etp53c", "etp53d", "etp53e", "etp53f", "etp53g", "etp53h"] + } + }, + "Ethernet424": { + "index": "54,54,54,54,54,54,54,54", + "lanes": "424,425,426,427,428,429,430,431", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp54"], + "2x200G[100G,50G,40G,25G,10G]": ["etp54a", "etp54b"], + "4x100G[50G,25G,10G]": ["etp54a", "etp54b", "etp54c", "etp54d"], + "8x50G[25G,10G]": ["etp54a", "etp54b", "etp54c", "etp54d", "etp54e", "etp54f", "etp54g", "etp54h"] + } + }, + "Ethernet432": { + "index": "55,55,55,55,55,55,55,55", + "lanes": "432,433,434,435,436,437,438,439", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp55"], + "2x200G[100G,50G,40G,25G,10G]": ["etp55a", "etp55b"], + "4x100G[50G,25G,10G]": ["etp55a", "etp55b", "etp55c", "etp55d"], + "8x50G[25G,10G]": ["etp55a", "etp55b", "etp55c", "etp55d", "etp55e", "etp55f", "etp55g", "etp55h"] + } + }, + "Ethernet440": { + "index": "56,56,56,56,56,56,56,56", + "lanes": "440,441,442,443,444,445,446,447", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp56"], + "2x200G[100G,50G,40G,25G,10G]": ["etp56a", "etp56b"], + "4x100G[50G,25G,10G]": ["etp56a", "etp56b", "etp56c", "etp56d"], + "8x50G[25G,10G]": ["etp56a", "etp56b", "etp56c", "etp56d", "etp56e", "etp56f", "etp56g", "etp56h"] + } + }, + "Ethernet448": { + "index": "57,57,57,57,57,57,57,57", + "lanes": "448,449,450,451,452,453,454,455", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp57"], + "2x200G[100G,50G,40G,25G,10G]": ["etp57a", "etp57b"], + "4x100G[50G,25G,10G]": ["etp57a", "etp57b", "etp57c", "etp57d"], + "8x50G[25G,10G]": ["etp57a", "etp57b", "etp57c", "etp57d", "etp57e", "etp57f", "etp57g", "etp57h"] + } + }, + "Ethernet456": { + "index": "58,58,58,58,58,58,58,58", + "lanes": "456,457,458,459,460,461,462,463", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp58"], + "2x200G[100G,50G,40G,25G,10G]": ["etp58a", "etp58b"], + "4x100G[50G,25G,10G]": ["etp58a", "etp58b", "etp58c", "etp58d"], + "8x50G[25G,10G]": ["etp58a", "etp58b", "etp58c", "etp58d", "etp58e", "etp58f", "etp58g", "etp58h"] + } + }, + "Ethernet464": { + "index": "59,59,59,59,59,59,59,59", + "lanes": "464,465,466,467,468,469,470,471", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp59"], + "2x200G[100G,50G,40G,25G,10G]": ["etp59a", "etp59b"], + "4x100G[50G,25G,10G]": ["etp59a", "etp59b", "etp59c", "etp59d"], + "8x50G[25G,10G]": ["etp59a", "etp59b", "etp59c", "etp59d", "etp59e", "etp59f", "etp59g", "etp59h"] + } + }, + "Ethernet472": { + "index": "60,60,60,60,60,60,60,60", + "lanes": "472,473,474,475,476,477,478,479", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp60"], + "2x200G[100G,50G,40G,25G,10G]": ["etp60a", "etp60b"], + "4x100G[50G,25G,10G]": ["etp60a", "etp60b", "etp60c", "etp60d"], + "8x50G[25G,10G]": ["etp60a", "etp60b", "etp60c", "etp60d", "etp60e", "etp60f", "etp60g", "etp60h"] + } + }, + "Ethernet480": { + "index": "61,61,61,61,61,61,61,61", + "lanes": "480,481,482,483,484,485,486,487", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp61"], + "2x200G[100G,50G,40G,25G,10G]": ["etp61a", "etp61b"], + "4x100G[50G,25G,10G]": ["etp61a", "etp61b", "etp61c", "etp61d"], + "8x50G[25G,10G]": ["etp61a", "etp61b", "etp61c", "etp61d", "etp61e", "etp61f", "etp61g", "etp61h"] + } + }, + "Ethernet488": { + "index": "62,62,62,62,62,62,62,62", + "lanes": "488,489,490,491,492,493,494,495", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp62"], + "2x200G[100G,50G,40G,25G,10G]": ["etp62a", "etp62b"], + "4x100G[50G,25G,10G]": ["etp62a", "etp62b", "etp62c", "etp62d"], + "8x50G[25G,10G]": ["etp62a", "etp62b", "etp62c", "etp62d", "etp62e", "etp62f", "etp62g", "etp62h"] + } + }, + "Ethernet496": { + "index": "63,63,63,63,63,63,63,63", + "lanes": "496,497,498,499,500,501,502,503", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp63"], + "2x200G[100G,50G,40G,25G,10G]": ["etp63a", "etp63b"], + "4x100G[50G,25G,10G]": ["etp63a", "etp63b", "etp63c", "etp63d"], + "8x50G[25G,10G]": ["etp63a", "etp63b", "etp63c", "etp63d", "etp63e", "etp63f", "etp63g", "etp63h"] + } + }, + "Ethernet504": { + "index": "64,64,64,64,64,64,64,64", + "lanes": "504,505,506,507,508,509,510,511", + "breakout_modes": { + "1x400G[200G,100G,50G,40G,25G,10G]": ["etp64"], + "2x200G[100G,50G,40G,25G,10G]": ["etp64a", "etp64b"], + "4x100G[50G,25G,10G]": ["etp64a", "etp64b", "etp64c", "etp64d"], + "8x50G[25G,10G]": ["etp64a", "etp64b", "etp64c", "etp64d", "etp64e", "etp64f", "etp64g", "etp64h"] + } + }, + "Ethernet512": { + "index": "65", + "lanes": "512", + "breakout_modes": { + "1x25G[10G]": ["etp65"] + } + }, + "Ethernet513": { + "index": "66", + "lanes": "513", + "breakout_modes": { + "1x25G[10G]": ["etp66"] + } + } + } +} diff --git a/device/mellanox/x86_64-nvidia_sn5400_simx-r0/platform_asic b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/platform_asic new file mode 100644 index 000000000000..70c074885557 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/platform_asic @@ -0,0 +1 @@ +mellanox diff --git a/device/mellanox/x86_64-nvidia_sn5400_simx-r0/plugins/eeprom.py b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/plugins/eeprom.py new file mode 120000 index 000000000000..b4e2a6a61671 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/plugins/eeprom.py @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/plugins/eeprom.py \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5400_simx-r0/plugins/psuutil.py b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/plugins/psuutil.py new file mode 120000 index 000000000000..9f724238a8d5 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/plugins/psuutil.py @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/plugins/psuutil.py \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5400_simx-r0/plugins/sfplpmget.py b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/plugins/sfplpmget.py new file mode 120000 index 000000000000..2e84f435abd9 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/plugins/sfplpmget.py @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/plugins/sfplpmget.py \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5400_simx-r0/plugins/sfplpmset.py b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/plugins/sfplpmset.py new file mode 120000 index 000000000000..6a88bac30467 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/plugins/sfplpmset.py @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/plugins/sfplpmset.py \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5400_simx-r0/plugins/sfpreset.py b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/plugins/sfpreset.py new file mode 120000 index 000000000000..fef2063e3496 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/plugins/sfpreset.py @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/plugins/sfpreset.py \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5400_simx-r0/plugins/sfputil.py b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/plugins/sfputil.py new file mode 120000 index 000000000000..45909b880fc9 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/plugins/sfputil.py @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/plugins/sfputil.py \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5400_simx-r0/pmon_daemon_control.json b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/pmon_daemon_control.json new file mode 120000 index 000000000000..435a2ce7c0ba --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/pmon_daemon_control.json @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/pmon_daemon_control.json \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5400_simx-r0/syseeprom.hex b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/syseeprom.hex new file mode 100644 index 000000000000..cfd9f961997f --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/syseeprom.hex @@ -0,0 +1,256 @@ +54 6c 76 49 6e 66 6f 00 01 01 ee 22 14 4d 53 4e +34 37 30 30 2d 57 53 32 46 4f 00 00 00 00 00 00 +00 23 18 4d 54 32 30 32 32 58 30 38 35 39 37 00 +00 00 00 00 00 00 00 00 00 00 00 24 06 1c 34 da +1d 42 00 25 13 30 37 2f 30 32 2f 32 30 32 30 20 +30 32 3a 33 38 3a 32 36 26 01 00 2a 02 00 fe fd +24 00 00 81 19 00 16 01 01 00 56 00 00 4d 4c 4e +58 02 01 0c 05 0e 02 10 06 12 07 00 00 00 00 00 +00 00 00 00 00 fd a4 00 00 81 19 00 92 00 03 01 +8a 00 00 4d 54 32 30 32 32 58 30 38 35 39 37 00 +00 00 00 00 00 00 00 00 00 00 00 4d 53 4e 34 37 +30 30 2d 57 53 32 46 4f 00 00 00 00 00 00 00 41 +37 00 00 00 82 a2 c4 4c 65 6f 70 61 72 64 20 45 +74 68 20 34 30 30 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 7a 00 00 00 12 5c 4d +53 4e 34 37 30 30 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 fd 24 00 00 81 +19 00 10 00 03 05 e8 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 fd 24 00 00 81 19 00 1e 00 11 02 af 00 00 0d +00 00 00 00 00 00 00 1c 34 da 1d 42 00 00 fe 1c +34 da 03 00 1d 42 00 fd 24 00 00 81 19 00 12 00 +01 06 7d 00 00 00 46 00 00 08 00 07 07 07 07 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 fd 14 00 +00 81 19 00 0e 00 02 07 99 00 00 30 00 20 00 00 +00 00 00 29 15 32 30 32 30 2e 31 31 2d 35 2e 33 +2e 30 30 30 35 2d 39 36 30 30 21 06 53 4e 35 36 +30 30 2b 06 4e 76 69 64 69 61 28 17 78 38 36 5f +36 34 2d 6e 76 69 64 69 61 5f 73 6e 35 36 30 30 +2d 72 30 fe 04 65 11 86 e0 32 30 2e 31 31 2d 35 +2e 33 2e 30 30 30 35 2d 39 36 30 30 21 06 53 4e +35 36 30 30 2b 06 4e 76 69 64 69 61 fe 04 7b d3 +21 17 8f b7 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 29 15 32 30 32 30 2e 31 31 2d 35 2e 33 2e 30 +30 30 35 2d 39 36 30 30 fe 04 12 38 c7 41 d3 2a +00 00 00 fe 04 4f b8 08 f0 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 diff --git a/device/mellanox/x86_64-nvidia_sn5400_simx-r0/system_health_monitoring_config.json b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/system_health_monitoring_config.json new file mode 120000 index 000000000000..98df66c27ca5 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/system_health_monitoring_config.json @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/system_health_monitoring_config.json \ No newline at end of file diff --git a/platform/mellanox/asic_table.j2 b/platform/mellanox/asic_table.j2 index 894b06128985..76db12267e19 100644 --- a/platform/mellanox/asic_table.j2 +++ b/platform/mellanox/asic_table.j2 @@ -1,5 +1,5 @@ {# - Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. + Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. Apache-2.0 Licensed under the Apache License, Version 2.0 (the "License"); @@ -44,7 +44,9 @@ 'x86_64-nvidia_sn4800-r0':'MELLANOX-SPECTRUM-3', 'x86_64-nvidia_sn4800_simx-r0':'MELLANOX-SPECTRUM-3', 'x86_64-nvidia_sn2201-r0':'MELLANOX-SPECTRUM', + 'x86_64-nvidia_sn5400-r0':'MELLANOX-SPECTRUM-4', 'x86_64-nvidia_sn5600-r0':'MELLANOX-SPECTRUM-4', + 'x86_64-nvidia_sn5400_simx-r0':'MELLANOX-SPECTRUM-4', 'x86_64-nvidia_sn5600_simx-r0':'MELLANOX-SPECTRUM-4', 'vs-platform':'vs' } 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 aeceb15d1983..9c0550252a80 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -112,6 +112,14 @@ } } }, + 'x86_64-nvidia_sn5400-r0': { + 'thermal': { + "capability": { + "comex_amb": False, + "pch_temp": True + } + } + }, 'x86_64-nvidia_sn5600-r0': { 'thermal': { "capability": { From 8238f4430585d27fe2af4bd9dcc0e918a0fbe2a0 Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Mon, 6 May 2024 09:06:00 -0700 Subject: [PATCH 288/419] [sflow]Changing the verbosity of ERR log when interface is unavailable (#18821) --- ...emoved-just-as-we-discover-it-log-wi.patch | 33 +++++++++++++++++++ src/sflow/hsflowd/patch/series | 1 + 2 files changed, 34 insertions(+) create mode 100644 src/sflow/hsflowd/patch/0004-When-interface-removed-just-as-we-discover-it-log-wi.patch diff --git a/src/sflow/hsflowd/patch/0004-When-interface-removed-just-as-we-discover-it-log-wi.patch b/src/sflow/hsflowd/patch/0004-When-interface-removed-just-as-we-discover-it-log-wi.patch new file mode 100644 index 000000000000..337e3ffc5db9 --- /dev/null +++ b/src/sflow/hsflowd/patch/0004-When-interface-removed-just-as-we-discover-it-log-wi.patch @@ -0,0 +1,33 @@ +From 3d6a3a02d12bcd742e9bcd701cb77da5f265adee Mon Sep 17 00:00:00 2001 +From: Neil McKee +Date: Fri, 26 Apr 2024 11:05:19 -0700 +Subject: [PATCH] When interface removed just as we discover it, log with + LOG_INFO, not LOG_ERR. + + +diff --git a/src/Linux/readInterfaces.c b/src/Linux/readInterfaces.c +index 438d8ed..06427eb 100644 +--- a/src/Linux/readInterfaces.c ++++ b/src/Linux/readInterfaces.c +@@ -758,7 +758,8 @@ extern "C" { + + // Get the flags for this interface + if(ioctl(fd,SIOCGIFFLAGS, &ifr) < 0) { +- myLog(LOG_ERR, "device %s Get SIOCGIFFLAGS failed : %s", ++ // Can get here if the interface was just removed under our feet. ++ myLog(LOG_INFO, "device %s Get SIOCGIFFLAGS failed : %s", + devName, + strerror(errno)); + continue; +@@ -781,7 +782,7 @@ extern "C" { + u_char macBytes[6]; + int gotMac = NO; + if(ioctl(fd,SIOCGIFHWADDR, &ifr) < 0) { +- myLog(LOG_ERR, "device %s Get SIOCGIFHWADDR failed : %s", ++ myLog(LOG_INFO, "device %s Get SIOCGIFHWADDR failed : %s", + devName, + strerror(errno)); + } +-- +2.30.2 + diff --git a/src/sflow/hsflowd/patch/series b/src/sflow/hsflowd/patch/series index f6def262debc..727e9b4feb45 100644 --- a/src/sflow/hsflowd/patch/series +++ b/src/sflow/hsflowd/patch/series @@ -1,3 +1,4 @@ 0001-host_sflow_psample.patch 0002-host_sflow_debian.patch 0003-sflow-enabled-drop-monitor-support-for-SONiC.patch +0004-When-interface-removed-just-as-we-discover-it-log-wi.patch From 2a974bcbf8523bc17dd1e4769f430b71fdb9cab1 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 14 May 2024 16:01:10 +0800 Subject: [PATCH 289/419] [submodule] Update submodule sonic-host-services to the latest HEAD automatically (#18960) #### Why I did it src/sonic-host-services ``` * 4caed11 - (HEAD -> 202311, origin/202311) Fix issue: delayed service will not be restarted if swss crashes (#107) (10 hours ago) [Junchao-Mellanox] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-host-services | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-host-services b/src/sonic-host-services index a711aecad055..4caed1137a4b 160000 --- a/src/sonic-host-services +++ b/src/sonic-host-services @@ -1 +1 @@ -Subproject commit a711aecad05536a096dfd5ae1798d361d520f961 +Subproject commit 4caed1137a4b26113124ab7771c18b0708ebe168 From 6619eb27d27542a3b74d7256bf2d895b148ba559 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 14 May 2024 16:01:17 +0800 Subject: [PATCH 290/419] [submodule] Update submodule sonic-platform-common to the latest HEAD automatically (#18857) #### Why I did it src/sonic-platform-common ``` * b9fa9ed - (HEAD -> 202311, origin/202311) Update Innolight package for mock test (#461) (7 hours ago) [Anoop Kamath] * a217354 - Aligning SONiC code with sff8024 spec (#457) (5 days ago) [Tomer Shalvi] * d08c786 - DPinit timeout seen for Innolight transceiver during CMIS init + transceiver OIR causing CMIS init failure (#450) (11 days ago) [Anoop Kamath] ``` #### How I did it #### How to verify it #### Description for the changelog --- 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 b893c95c0741..b9fa9ed69e54 160000 --- a/src/sonic-platform-common +++ b/src/sonic-platform-common @@ -1 +1 @@ -Subproject commit b893c95c07411e97d2a3ff32d8181d2039f8f90b +Subproject commit b9fa9ed69e54035b0ef7ed9713ead16ed3997d5f From 4fb785e53042c0ce868c04e074865ff712c0e7da Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 14 May 2024 19:01:07 +0800 Subject: [PATCH 291/419] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#18962) #### Why I did it src/sonic-utilities ``` * 265c9b36 - (HEAD -> 202311, origin/202311) [Mellanox] Support new platform SN5400 in generic configuration update (#3272) (7 hours ago) [DavidZagury] * 515e78e3 - [fast/warm-reboot] Retain TRANSCEIVER_INFO tables on fast/warm-reboot (#3240) (7 hours ago) [Stepan Blyshchak] * 4eb04c33 - Add vlan validation in config interface ip add command (#3155) (7 hours ago) [Mati Alfaro] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index d52dc8e66594..265c9b368f69 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit d52dc8e66594e3a7c18338dba89b5e72abd08899 +Subproject commit 265c9b368f690c27185d48c1ee9b7e4318af9b6b From 62443b09f2ea49e76a307a61f3140f959bb811ec Mon Sep 17 00:00:00 2001 From: Zain Budhwani <99770260+zbud-msft@users.noreply.github.com> Date: Tue, 14 May 2024 18:08:14 -0700 Subject: [PATCH 292/419] [eventd]: Close rsyslog plugin when rsyslog SIGTERM and EOF is sent to stream (#18835) Fix #18771 Microsoft ADO (number only):27882794 How I did it Add signalOnClose for omprog as well as close rsyslog plugin when receives an EOF. How to verify it Verify rsyslog_plugin is running inside bgp or swss container Run docker exec -it bgp supervisorctl restart rsyslogd Before change: This will not kill current rsyslog_plugin process but instead rsyslogd will now break off its end of writing to cin and send EOF to rsyslog_plugin, however will not send a signal SIGTERM or SIGKILL to rsyslog_plugin. Therefore, rsyslog plugin will run in an infinite loop forever, constantly calling getline raising CPU to 100% inside docker. After change of adding signalOnClose="on" to conf file inside omprog, rsyslogd will now send SIGTERM to rsyslog_plugin process running inside container, and rsyslog_plugin will die. ? ( ): rsyslog_plugin/578637 ... [continued]: read()) = -1 (unknown) (INTERNAL ERROR: strerror_r(512, [buf], 128)=22) UT (will add sonic-mgmt testcase for storming events with logs) RCA: 1. When rsyslogd is terminated, no signal is sent to child process of rsyslog_plugin meaning that rsyslog_plugin will be constantly trying to read from cin with no writer on the other end of the pipe. This leads to rsyslog_plugin process will constantly be reading via getline infinitely. 2. Because rsyslog is terminated and the spawned rsyslog_plugin is still alive, when rsyslog starts backup again, and log is triggered, a new rsyslog_plugin will be spawned for that rsyslog process, which can lead to many "ghost" rsyslog_plugin processes that will be at high CPU usage. --- files/build_templates/rsyslog_plugin.conf.j2 | 1 + .../rsyslog_plugin/rsyslog_plugin.cpp | 27 ++++++++++--------- .../rsyslog_plugin/rsyslog_plugin.h | 8 ++++++ .../rsyslog_plugin_ut.cpp | 26 ++++++++++++++++++ 4 files changed, 50 insertions(+), 12 deletions(-) diff --git a/files/build_templates/rsyslog_plugin.conf.j2 b/files/build_templates/rsyslog_plugin.conf.j2 index 4628bea70e62..56ec0f71d3f1 100644 --- a/files/build_templates/rsyslog_plugin.conf.j2 +++ b/files/build_templates/rsyslog_plugin.conf.j2 @@ -12,6 +12,7 @@ if re_match($programname, "{{ proc.name }}") then { action(type="omprog" binary="/usr/bin/rsyslog_plugin -r /etc/rsyslog.d/{{ proc.parse_json }} -m {{ yang_module }}" output="/var/log/rsyslog_plugin.log" + signalOnClose="on" template="prog_msg") } {% endfor %} diff --git a/src/sonic-eventd/rsyslog_plugin/rsyslog_plugin.cpp b/src/sonic-eventd/rsyslog_plugin/rsyslog_plugin.cpp index 6df0a73b0210..52a70fd182ae 100644 --- a/src/sonic-eventd/rsyslog_plugin/rsyslog_plugin.cpp +++ b/src/sonic-eventd/rsyslog_plugin/rsyslog_plugin.cpp @@ -9,6 +9,8 @@ using json = nlohmann::json; +bool RsyslogPlugin::g_running; + bool RsyslogPlugin::onMessage(string msg, lua_State* luaState) { string tag; event_params_t paramDict; @@ -30,18 +32,18 @@ void parseParams(vector params, vector& eventParams) { if(params[i].empty()) { SWSS_LOG_ERROR("Empty param provided in regex file\n"); continue; - } + } EventParam ep = EventParam(); auto delimPos = params[i].find(':'); if(delimPos == string::npos) { // no lua code ep.paramName = params[i]; } else { ep.paramName = params[i].substr(0, delimPos); - ep.luaCode = params[i].substr(delimPos + 1); + ep.luaCode = params[i].substr(delimPos + 1); if(ep.luaCode.empty()) { SWSS_LOG_ERROR("Lua code missing after :\n"); } - } + } eventParams.push_back(ep); } } @@ -71,11 +73,11 @@ bool RsyslogPlugin::createRegexList() { vector eventParams; try { string eventRegex = jsonList[i]["regex"]; - regexString = timestampRegex + eventRegex; + regexString = timestampRegex + eventRegex; string tag = jsonList[i]["tag"]; vector params = jsonList[i]["params"]; - vector timestampParams = { "month", "day", "time" }; - params.insert(params.begin(), timestampParams.begin(), timestampParams.end()); + vector timestampParams = { "month", "day", "time" }; + params.insert(params.begin(), timestampParams.begin(), timestampParams.end()); regex expr(regexString); expression = expr; parseParams(params, eventParams); @@ -83,13 +85,13 @@ bool RsyslogPlugin::createRegexList() { rs.tag = tag; rs.regexExpression = expression; regexList.push_back(rs); - } catch (nlohmann::detail::type_error& deException) { + } catch (nlohmann::detail::type_error& deException) { SWSS_LOG_ERROR("Missing required key, throws exception: %s\n", deException.what()); return false; } catch (regex_error& reException) { SWSS_LOG_ERROR("Invalid regex, throws exception: %s\n", reException.what()); - return false; - } + return false; + } } if(regexList.empty()) { @@ -104,11 +106,11 @@ bool RsyslogPlugin::createRegexList() { } void RsyslogPlugin::run() { + signal(SIGTERM, RsyslogPlugin::signalHandler); lua_State* luaState = luaL_newstate(); luaL_openlibs(luaState); - while(true) { - string line; - getline(cin, line); + string line; + while(RsyslogPlugin::g_running && getline(cin, line)) { if(line.empty()) { continue; } @@ -132,4 +134,5 @@ RsyslogPlugin::RsyslogPlugin(string moduleName, string regexPath) { m_parser = unique_ptr(new SyslogParser()); m_moduleName = moduleName; m_regexPath = regexPath; + RsyslogPlugin::g_running = true; } diff --git a/src/sonic-eventd/rsyslog_plugin/rsyslog_plugin.h b/src/sonic-eventd/rsyslog_plugin/rsyslog_plugin.h index 0811b5f3032f..ae6c9baf9630 100644 --- a/src/sonic-eventd/rsyslog_plugin/rsyslog_plugin.h +++ b/src/sonic-eventd/rsyslog_plugin/rsyslog_plugin.h @@ -9,6 +9,7 @@ extern "C" } #include #include +#include #include "syslog_parser.h" #include "events.h" #include "logger.h" @@ -24,10 +25,17 @@ using namespace swss; class RsyslogPlugin { public: + static bool g_running; int onInit(); bool onMessage(string msg, lua_State* luaState); void run(); RsyslogPlugin(string moduleName, string regexPath); + static void signalHandler(int signum) { + if (signum == SIGTERM) { + SWSS_LOG_INFO("Rsyslog plugin received SIGTERM, shutting down"); + RsyslogPlugin::g_running = false; + } + } private: unique_ptr m_parser; event_handle_t m_eventHandle; diff --git a/src/sonic-eventd/rsyslog_plugin_tests/rsyslog_plugin_ut.cpp b/src/sonic-eventd/rsyslog_plugin_tests/rsyslog_plugin_ut.cpp index 5ff41d11dd70..aafd357006eb 100644 --- a/src/sonic-eventd/rsyslog_plugin_tests/rsyslog_plugin_ut.cpp +++ b/src/sonic-eventd/rsyslog_plugin_tests/rsyslog_plugin_ut.cpp @@ -8,6 +8,7 @@ extern "C" #include #include #include +#include #include "gtest/gtest.h" #include #include "events.h" @@ -253,6 +254,31 @@ TEST(rsyslog_plugin, onMessage_noParams) { infile.close(); } +TEST(rsyslog_plugin, run) { + unique_ptr plugin(new RsyslogPlugin("test_mod_name", "./rsyslog_plugin_tests/test_regex_5.rc.json")); + EXPECT_EQ(0, plugin->onInit()); + istringstream ss(""); + streambuf* cinbuf = cin.rdbuf(); + cin.rdbuf(ss.rdbuf()); + plugin->run(); + cin.rdbuf(cinbuf); +} + +TEST(rsyslog_plugin, run_SIGTERM) { + unique_ptr plugin(new RsyslogPlugin("test_mod_name", "./rsyslog_plugin_tests/test_regex_5.rc.json")); + EXPECT_EQ(0, plugin->onInit()); + EXPECT_TRUE(RsyslogPlugin::g_running); + thread pluginThread([&]() { + plugin->run(); + }); + + RsyslogPlugin::signalHandler(SIGTERM); + + pluginThread.join(); + + EXPECT_FALSE(RsyslogPlugin::g_running); +} + TEST(timestampFormatter, changeTimestampFormat) { unique_ptr formatter(new TimestampFormatter()); From 3f6def36ee5fcbdd876397b48839a4e7c5c78e70 Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Thu, 16 May 2024 01:47:07 +0800 Subject: [PATCH 293/419] [Mellanox] run module initialization when any SFP related API is called (#18930) (#18937) Why I did it Currently, there are a few issues related to module host management: 1. module initialization flow is triggered when chassis.get_change_event is called for the first time. It is too late which delays fast-reboot/warm-reboot convergence time 2. module initialization flow always send change event for all SFP objects to xcvrd even if there is no real module change event. It causes ports flapping during warm-reboot 3. legacy mode and module host management mode are mixed into the same code logic which makes it hard to maintain and extend To address above issues, the PR introduces following changes: 1. module initialization flow is triggered when chassis SFP related API is called for the first time. It means that any of the following API will trigger module init: chassis.get_sfp, chassis.get_all_sfps, chassis.get_change_event. The init flow shall only execute once under xcvrd context. 2. module initialization flow does not send change event anymore. Change event shall be sent only if a real cable event is detected by chassis.get_change_event (plug-in/plug-out/error) 3. legacy mode and module host management mode are decoupled to avoid affecting each other How to verify it 1. Unit test covered most of the new change 2. Full sonic-mgmt regression test make sure there is no degradation (test branch 202311) 3. Manual test --- .../sonic_platform/chassis.py | 251 +++++- .../sonic_platform/device_data.py | 4 +- .../module_host_mgmt_initializer.py | 128 +++ .../sonic_platform/modules_mgmt.py | 769 ----------------- .../mlnx-platform-api/sonic_platform/sfp.py | 786 +++++++++++++++-- .../sonic_platform/sfp_event.py | 409 --------- .../sonic_platform/state_machine.py | 168 ++++ .../sonic_platform/thermal_manager.py | 6 +- .../sonic_platform/thermal_updater.py | 25 +- .../mlnx-platform-api/sonic_platform/utils.py | 8 +- .../sonic_platform/wait_sfp_ready_task.py | 139 +++ .../tests/test_change_event.py | 220 +++++ .../mlnx-platform-api/tests/test_chassis.py | 21 +- .../tests/test_device_data.py | 8 +- .../tests/test_module_initializer.py | 98 +++ .../tests/test_modules_mgmt.py | 800 ------------------ .../mlnx-platform-api/tests/test_sfp.py | 149 +++- .../mlnx-platform-api/tests/test_sfp_event.py | 61 -- .../mlnx-platform-api/tests/test_sfp_sm.py | 170 ++++ .../tests/test_statemachine.py | 137 +++ .../tests/test_thermal_updater.py | 21 +- .../tests/test_wait_sfp_ready_task.py | 51 ++ 22 files changed, 2200 insertions(+), 2229 deletions(-) create mode 100644 platform/mellanox/mlnx-platform-api/sonic_platform/module_host_mgmt_initializer.py delete mode 100644 platform/mellanox/mlnx-platform-api/sonic_platform/modules_mgmt.py delete mode 100644 platform/mellanox/mlnx-platform-api/sonic_platform/sfp_event.py create mode 100644 platform/mellanox/mlnx-platform-api/sonic_platform/state_machine.py create mode 100644 platform/mellanox/mlnx-platform-api/sonic_platform/wait_sfp_ready_task.py create mode 100644 platform/mellanox/mlnx-platform-api/tests/test_change_event.py create mode 100644 platform/mellanox/mlnx-platform-api/tests/test_module_initializer.py delete mode 100644 platform/mellanox/mlnx-platform-api/tests/test_modules_mgmt.py delete mode 100644 platform/mellanox/mlnx-platform-api/tests/test_sfp_event.py create mode 100644 platform/mellanox/mlnx-platform-api/tests/test_sfp_sm.py create mode 100644 platform/mellanox/mlnx-platform-api/tests/test_statemachine.py create mode 100644 platform/mellanox/mlnx-platform-api/tests/test_wait_sfp_ready_task.py diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py b/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py index f216f6de2c36..935a2fa5f1f8 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py @@ -28,13 +28,13 @@ import os from functools import reduce from .utils import extract_RJ45_ports_index + from . import module_host_mgmt_initializer from . import utils from .device_data import DeviceDataManager import re - import queue + import select import threading import time - from sonic_platform import modules_mgmt except ImportError as e: raise ImportError (str(e) + "- required module not found") @@ -132,9 +132,9 @@ def __init__(self): Chassis.chassis_instance = self - self.modules_mgmt_thread = threading.Thread() - self.modules_changes_queue = queue.Queue() - self.modules_mgmt_task_stopping_event = threading.Event() + self.module_host_mgmt_initializer = module_host_mgmt_initializer.ModuleHostMgmtInitializer() + self.poll_obj = None + self.registered_fds = None logger.log_info("Chassis loaded successfully") @@ -344,8 +344,11 @@ def get_all_sfps(self): Returns: A list of objects derived from SfpBase representing all sfps available on this chassis - """ - self.initialize_sfp() + """ + if DeviceDataManager.is_module_host_management_mode(): + self.module_host_mgmt_initializer.initialize(self) + else: + self.initialize_sfp() return self._sfp_list def get_sfp(self, index): @@ -362,7 +365,10 @@ def get_sfp(self, index): An object dervied from SfpBase representing the specified sfp """ index = index - 1 - self.initialize_single_sfp(index) + if DeviceDataManager.is_module_host_management_mode(): + self.module_host_mgmt_initializer.initialize(self) + else: + self.initialize_single_sfp(index) return super(Chassis, self).get_sfp(index) def get_port_or_cage_type(self, index): @@ -412,42 +418,223 @@ def get_change_event(self, timeout=0): indicates that fan 0 has been removed, fan 2 has been inserted and sfp 11 has been removed. """ - if not self.modules_mgmt_thread.is_alive(): - # open new SFP change events thread - self.modules_mgmt_thread = modules_mgmt.ModulesMgmtTask(q=self.modules_changes_queue - , main_thread_stop_event = self.modules_mgmt_task_stopping_event) - # Set the thread as daemon so when pmon/xcvrd are shutting down, modules_mgmt will shut down immedietly. - self.modules_mgmt_thread.daemon = True - self.modules_mgmt_thread.start() - self.initialize_sfp() - wait_for_ever = (timeout == 0) + if DeviceDataManager.is_module_host_management_mode(): + self.module_host_mgmt_initializer.initialize(self) + return self.get_change_event_for_module_host_management_mode(timeout) + else: + self.initialize_sfp() + return self.get_change_event_legacy(timeout) + + def get_change_event_for_module_host_management_mode(self, timeout): + """Get SFP change event when module host management mode is enabled. + + Args: + timeout: Timeout in milliseconds (optional). If timeout == 0, + this method will block until a change is detected. + + Returns: + (bool, dict): + - True if call successful, False if not; - Deprecated, will always return True + - A nested dictionary where key is a device type, + value is a dictionary with key:value pairs in the format of + {'device_id':'device_event'}, + where device_id is the device ID for this device and + device_event, + status='1' represents device inserted, + status='0' represents device removed. + Ex. {'fan':{'0':'0', '2':'1'}, 'sfp':{'11':'0'}} + indicates that fan 0 has been removed, fan 2 + has been inserted and sfp 11 has been removed. + """ + if not self.poll_obj: + self.poll_obj = select.poll() + self.registered_fds = {} + for s in self._sfp_list: + fds = s.get_fds_for_poling() + for fd_type, fd in fds.items(): + self.poll_obj.register(fd, select.POLLERR | select.POLLPRI) + self.registered_fds[fd.fileno()] = (s.sdk_index, fd, fd_type) + + logger.log_debug(f'Registered SFP file descriptors for polling: {self.registered_fds}') + + from . import sfp + + wait_forever = (timeout == 0) + # poll timeout should be no more than 1000ms to ensure fast shutdown flow + timeout = 1000.0 if timeout >= 1000 else float(timeout) + port_dict = {} + error_dict = {} + begin = time.time() + wait_ready_task = sfp.SFP.get_wait_ready_task() + + while True: + fds_events = self.poll_obj.poll(timeout) + for fileno, _ in fds_events: + if fileno not in self.registered_fds: + logger.log_error(f'Unknown file no {fileno} from poll event, registered files are {self.registered_fds}') + continue + + sfp_index, fd, fd_type = self.registered_fds[fileno] + s = self._sfp_list[sfp_index] + fd.seek(0) + fd_value = int(fd.read().strip()) + + # Detecting dummy event + if s.is_dummy_event(fd_type, fd_value): + # Ignore dummy event for the first poll, assume SDK only provide 1 dummy event + logger.log_debug(f'Ignore dummy event {fd_type}:{fd_value} for SFP {sfp_index}') + continue + + logger.log_notice(f'Got SFP event: index={sfp_index}, type={fd_type}, value={fd_value}') + if fd_type == 'hw_present': + # event could be EVENT_NOT_PRESENT or EVENT_PRESENT + event = sfp.EVENT_NOT_PRESENT if fd_value == 0 else sfp.EVENT_PRESENT + s.on_event(event) + elif fd_type == 'present': + if str(fd_value) == sfp.SFP_STATUS_ERROR: + # FW control cable got an error, no need trigger state machine + sfp_status, error_desc = s.get_error_info_from_sdk_error_type() + port_dict[sfp_index + 1] = sfp_status + if error_desc: + error_dict[sfp_index + 1] = error_desc + continue + elif str(fd_value) == sfp.SFP_STATUS_INSERTED: + # FW control cable got present, only case is that the cable is recovering + # from an error. FW control cable has no transition from "Not Present" to "Present" + # because "Not Present" cable is always "software control" and should always poll + # hw_present sysfs instead of present sysfs. + port_dict[sfp_index + 1] = sfp.SFP_STATUS_INSERTED + continue + else: + s.on_event(sfp.EVENT_NOT_PRESENT) + else: + # event could be EVENT_POWER_GOOD or EVENT_POWER_BAD + event = sfp.EVENT_POWER_BAD if fd_value == 0 else sfp.EVENT_POWER_GOOD + s.on_event(event) + + if s.in_stable_state(): + s.fill_change_event(port_dict) + s.refresh_poll_obj(self.poll_obj, self.registered_fds) + else: + logger.log_debug(f'SFP {sfp_index} does not reach stable state, state={s.state}') + + ready_sfp_set = wait_ready_task.get_ready_set() + for sfp_index in ready_sfp_set: + s = self._sfp_list[sfp_index] + s.on_event(sfp.EVENT_RESET_DONE) + if s.in_stable_state(): + s.fill_change_event(port_dict) + s.refresh_poll_obj(self.poll_obj, self.registered_fds) + else: + logger.log_error(f'SFP {sfp_index} failed to reach stable state, state={s.state}') + + if port_dict: + logger.log_notice(f'Sending SFP change event: {port_dict}, error event: {error_dict}') + self.reinit_sfps(port_dict) + return True, { + 'sfp': port_dict, + 'sfp_error': error_dict + } + else: + if not wait_forever: + elapse = time.time() - begin + if elapse * 1000 >= timeout: + return True, {'sfp': {}} + + def get_change_event_legacy(self, timeout): + """Get SFP change event when module host management is disabled. + + Args: + timeout (int): polling timeout in ms + + Returns: + (bool, dict): + - True if call successful, False if not; - Deprecated, will always return True + - A nested dictionary where key is a device type, + value is a dictionary with key:value pairs in the format of + {'device_id':'device_event'}, + where device_id is the device ID for this device and + device_event, + status='1' represents device inserted, + status='0' represents device removed. + Ex. {'fan':{'0':'0', '2':'1'}, 'sfp':{'11':'0'}} + indicates that fan 0 has been removed, fan 2 + has been inserted and sfp 11 has been removed. + """ + if not self.poll_obj: + self.poll_obj = select.poll() + self.registered_fds = {} + # SDK always sent event for the first time polling. Such event should not be sent to xcvrd. + # Store SFP state before first time polling so that we can detect dummy event. + self.sfp_states_before_first_poll = {} + for s in self._sfp_list: + fd = s.get_fd_for_polling_legacy() + self.poll_obj.register(fd, select.POLLERR | select.POLLPRI) + self.registered_fds[fd.fileno()] = (s.sdk_index, fd) + self.sfp_states_before_first_poll[s.sdk_index] = s.get_module_status() + + logger.log_debug(f'Registered SFP file descriptors for polling: {self.registered_fds}') + + from . import sfp + + wait_forever = (timeout == 0) # poll timeout should be no more than 1000ms to ensure fast shutdown flow timeout = 1000.0 if timeout >= 1000 else float(timeout) port_dict = {} error_dict = {} begin = time.time() - i = 0 + while True: - try: - logger.log_info(f'get_change_event() trying to get changes from queue on iteration {i}') - port_dict = self.modules_changes_queue.get(timeout=timeout / 1000) - logger.log_info(f'get_change_event() iteration {i} port_dict: {port_dict}') - except queue.Empty: - logger.log_info(f"failed to get item from modules changes queue on itertaion {i}") + fds_events = self.poll_obj.poll(timeout) + for fileno, _ in fds_events: + if fileno not in self.registered_fds: + logger.log_error(f'Unknown file no {fileno} from poll event, registered files are {self.registered_fds}') + continue + + sfp_index, fd = self.registered_fds[fileno] + fd.seek(0) + fd.read() + s = self._sfp_list[sfp_index] + sfp_status = s.get_module_status() + + if sfp_index in self.sfp_states_before_first_poll: + # Detecting dummy event + sfp_state_before_poll = self.sfp_states_before_first_poll[sfp_index] + self.sfp_states_before_first_poll.pop(sfp_index) + if sfp_state_before_poll == sfp_status: + # Ignore dummy event for the first poll, assume SDK only provide 1 dummy event + logger.log_debug(f'Ignore dummy event {sfp_status} for SFP {sfp_index}') + continue + + logger.log_notice(f'Got SFP event: index={sfp_index}, value={sfp_status}') + if sfp_status == sfp.SFP_STATUS_UNKNOWN: + # in the following sequence, STATUS_UNKNOWN can be returned. + # so we shouldn't raise exception here. + # 1. some sfp module is inserted + # 2. sfp_event gets stuck and fails to fetch the change event instantaneously + # 3. and then the sfp module is removed + # 4. sfp_event starts to try fetching the change event + logger.log_notice("unknown module state, maybe the port suffers two adjacent insertion/removal") + continue + + if sfp_status == sfp.SFP_STATUS_ERROR: + sfp_status, error_desc = s.get_error_info_from_sdk_error_type() + if error_desc: + error_dict[sfp_index + 1] = error_desc + port_dict[sfp_index + 1] = sfp_status if port_dict: + logger.log_notice(f'Sending SFP change event: {port_dict}, error event: {error_dict}') self.reinit_sfps(port_dict) - result_dict = {'sfp': port_dict} - result_dict['sfp_error'] = error_dict - return True, result_dict + return True, { + 'sfp': port_dict, + 'sfp_error': error_dict + } else: - if not wait_for_ever: + if not wait_forever: elapse = time.time() - begin - logger.log_info(f"get_change_event: wait_for_ever {wait_for_ever} elapse {elapse} iteartion {i}") if elapse * 1000 >= timeout: - logger.log_info(f"elapse {elapse} > timeout {timeout} iteartion {i} returning empty dict") return True, {'sfp': {}} - i += 1 def reinit_sfps(self, port_dict): """ @@ -457,7 +644,7 @@ def reinit_sfps(self, port_dict): """ from . import sfp for index, status in port_dict.items(): - if status == sfp.SFP_STATUS_INSERTED: + if status == sfp.SFP_STATUS_REMOVED: try: self._sfp_list[int(index) - 1].reinit() except Exception as e: 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 9c0550252a80..6a67c0e6238b 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py @@ -250,7 +250,7 @@ def get_cpld_component_list(cls): @classmethod @utils.read_only_cache() - def is_independent_mode(cls): + def is_module_host_management_mode(cls): from sonic_py_common import device_info _, hwsku_dir = device_info.get_paths_to_platform_and_hwsku_dirs() sai_profile_file = os.path.join(hwsku_dir, 'sai.profile') @@ -266,7 +266,7 @@ def wait_platform_ready(cls): """ conditions = [] sysfs_nodes = ['power_mode', 'power_mode_policy', 'present', 'reset', 'status', 'statuserror'] - if cls.is_independent_mode(): + if cls.is_module_host_management_mode(): sysfs_nodes.extend(['control', 'frequency', 'frequency_support', 'hw_present', 'hw_reset', 'power_good', 'power_limit', 'power_on', 'temperature/input']) else: diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/module_host_mgmt_initializer.py b/platform/mellanox/mlnx-platform-api/sonic_platform/module_host_mgmt_initializer.py new file mode 100644 index 000000000000..d9bec65987e0 --- /dev/null +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/module_host_mgmt_initializer.py @@ -0,0 +1,128 @@ +# +# Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. +# Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +from . import utils +from sonic_py_common.logger import Logger + +import atexit +import os +import sys +import threading + +MODULE_READY_MAX_WAIT_TIME = 300 +MODULE_READY_CHECK_INTERVAL = 5 +MODULE_READY_CONTAINER_FILE = '/tmp/module_host_mgmt_ready' +MODULE_READY_HOST_FILE = '/tmp/nv-syncd-shared/module_host_mgmt_ready' +DEDICATE_INIT_DAEMON = 'xcvrd' +initialization_owner = False + +logger = Logger() + + +class ModuleHostMgmtInitializer: + """Responsible for initializing modules for host management mode. + """ + def __init__(self): + self.initialized = False + self.lock = threading.Lock() + + def initialize(self, chassis): + """Initialize all modules. Only applicable for module host management mode. + The real initialization job shall only be done in xcvrd. Only 1 owner is allowed + to to the initialization. Other daemon/CLI shall wait for the initialization done. + + Args: + chassis (object): chassis object + """ + global initialization_owner + if self.initialized: + return + + if utils.is_host(): + self.wait_module_ready() + chassis.initialize_sfp() + else: + if self.is_initialization_owner(): + if not self.initialized: + with self.lock: + if not self.initialized: + logger.log_notice('Starting module initialization for module host management...') + initialization_owner = True + self.remove_module_ready_file() + + chassis.initialize_sfp() + + from .sfp import SFP + SFP.initialize_sfp_modules(chassis._sfp_list) + + self.create_module_ready_file() + self.initialized = True + logger.log_notice('Module initialization for module host management done') + else: + self.wait_module_ready() + chassis.initialize_sfp() + + @classmethod + def create_module_ready_file(cls): + """Create module ready file + """ + with open(MODULE_READY_CONTAINER_FILE, 'w'): + pass + + @classmethod + def remove_module_ready_file(cls): + """Remove module ready file + """ + if os.path.exists(MODULE_READY_CONTAINER_FILE): + os.remove(MODULE_READY_CONTAINER_FILE) + + def wait_module_ready(self): + """Wait up to MODULE_READY_MAX_WAIT_TIME seconds for all modules to be ready + """ + if utils.is_host(): + module_ready_file = MODULE_READY_HOST_FILE + else: + module_ready_file = MODULE_READY_CONTAINER_FILE + + if os.path.exists(module_ready_file): + self.initialized = True + return + else: + print('Waiting module to be initialized...') + + if utils.wait_until(os.path.exists, MODULE_READY_MAX_WAIT_TIME, MODULE_READY_CHECK_INTERVAL, module_ready_file): + self.initialized = True + else: + logger.log_error('Module initialization timeout', True) + + def is_initialization_owner(self): + """Indicate whether current thread is the owner of doing module initialization + + Returns: + bool: True if current thread is the owner + """ + cmd = os.path.basename(sys.argv[0]) + return DEDICATE_INIT_DAEMON in cmd + +@atexit.register +def clean_up(): + """Remove module ready file when program exits. + When module host management is enabled, xcvrd is the dependency for all other + daemon/CLI who potentially uses SFP API. + """ + if initialization_owner: + ModuleHostMgmtInitializer.remove_module_ready_file() diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/modules_mgmt.py b/platform/mellanox/mlnx-platform-api/sonic_platform/modules_mgmt.py deleted file mode 100644 index 448e0ca06809..000000000000 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/modules_mgmt.py +++ /dev/null @@ -1,769 +0,0 @@ -# -# Copyright (c) 2023-2024 NVIDIA CORPORATION & AFFILIATES. -# Apache-2.0 -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -import threading -import time -import queue -import os -import select -import traceback - -try: - from sonic_py_common.logger import Logger - from sonic_py_common import device_info, multi_asic - from .device_data import DeviceDataManager - from sonic_platform_base.sonic_xcvr.fields import consts - from sonic_platform_base.sonic_xcvr.api.public import cmis - from . import sfp as sfp_module - from . import utils - from swsscommon.swsscommon import SonicV2Connector -except ImportError as e: - raise ImportError (str(e) + "- required module not found") - -# Global logger class instance -logger = Logger() - -STATE_HW_NOT_PRESENT = "Initial state. module is not plugged to cage." -STATE_HW_PRESENT = "Module is plugged to cage" -STATE_MODULE_AVAILABLE = "Module hw present and power is good" -STATE_POWERED = "Module power is already loaded" -STATE_NOT_POWERED = "Module power is not loaded" -STATE_FW_CONTROL = "The module is not CMIS and FW needs to handle" -STATE_SW_CONTROL = "The module is CMIS and SW needs to handle" -STATE_ERROR_HANDLER = "An error occurred - read/write error, power limit or power cap." -STATE_POWER_LIMIT_ERROR = "The cage has not enough power for the plugged module" -STATE_SYSFS_ERROR = "An error occurred while writing/reading SySFS." - -SAI_PROFILE_FILE = "/{}/sai.profile" -SAI_INDEP_MODULE_MODE = "SAI_INDEPENDENT_MODULE_MODE" -SAI_INDEP_MODULE_MODE_DELIMITER = "=" -SAI_INDEP_MODULE_MODE_TRUE_STR = "1" -SYSFS_LEGACY_FD_PRESENCE = "/sys/module/sx_core/asic0/module{}/present" -ASIC_NUM = 0 -SYSFS_INDEPENDENT_FD_PREFIX_WO_MODULE = "/sys/module/sx_core/asic{}".format(ASIC_NUM) -SYSFS_INDEPENDENT_FD_PREFIX = SYSFS_INDEPENDENT_FD_PREFIX_WO_MODULE + "/module{}" -SYSFS_INDEPENDENT_FD_PRESENCE = os.path.join(SYSFS_INDEPENDENT_FD_PREFIX, "hw_present") -SYSFS_INDEPENDENT_FD_POWER_GOOD = os.path.join(SYSFS_INDEPENDENT_FD_PREFIX, "power_good") -SYSFS_INDEPENDENT_FD_POWER_ON = os.path.join(SYSFS_INDEPENDENT_FD_PREFIX, "power_on") -SYSFS_INDEPENDENT_FD_HW_RESET = os.path.join(SYSFS_INDEPENDENT_FD_PREFIX, "hw_reset") -SYSFS_INDEPENDENT_FD_POWER_LIMIT = os.path.join(SYSFS_INDEPENDENT_FD_PREFIX, "power_limit") -SYSFS_INDEPENDENT_FD_FW_CONTROL = os.path.join(SYSFS_INDEPENDENT_FD_PREFIX, "control") -# echo /sys/module/sx_core/$asic/$module/frequency // val: 0 - up to 400KHz, 1 - up to 1MHz -SYSFS_INDEPENDENT_FD_FREQ = os.path.join(SYSFS_INDEPENDENT_FD_PREFIX, "frequency") -SYSFS_INDEPENDENT_FD_FREQ_SUPPORT = os.path.join(SYSFS_INDEPENDENT_FD_PREFIX, "frequency_support") -IS_INDEPENDENT_MODULE = 'is_independent_module' -PROC_CMDLINE = "/proc/cmdline" -CMDLINE_STR_TO_LOOK_FOR = 'SONIC_BOOT_TYPE=' -CMDLINE_VAL_TO_LOOK_FOR = 'fastfast' - -MAX_EEPROM_ERROR_RESET_RETRIES = 4 - - -class ModulesMgmtTask(threading.Thread): - - def __init__(self, namespaces=None, main_thread_stop_event=None, q=None): - threading.Thread.__init__(self) - self.name = "ModulesMgmtTask" - self.main_thread_stop_event = main_thread_stop_event - self.sfp_port_dict_initial = {} - self.sfp_port_dict = {} - self.sfp_changes_dict = {} - self.sfp_delete_list_from_port_dict = [] - self.namespaces = namespaces - self.modules_changes_queue = q - self.is_supported_indep_mods_system = False - self.modules_lock_list = [] - # A set to hold those modules waiting 3 seconds since power on and hw reset - self.waiting_modules_list = set() - self.timer = threading.Thread() - self.poll_obj = None - self.fds_mapping_to_obj = {} - self.port_to_fds = {} - self.fds_events_count_dict = {} - self.delete_ports_and_reset_states_dict = {} - self.setName("ModulesMgmtTask") - self.register_hw_present_fds = [] - self.is_warm_reboot = False - self.port_control_dict = {} - - # SFPs state machine - def get_sm_func(self, sm, port): - SFP_SM_ENUM = {STATE_HW_NOT_PRESENT: self.check_if_hw_present - , STATE_HW_PRESENT: self.check_if_power_on - , STATE_NOT_POWERED: self.power_on_module - , STATE_POWERED: self.check_if_module_available - , STATE_MODULE_AVAILABLE: self.check_module_type - , STATE_FW_CONTROL: self.save_module_control_mode - , STATE_SW_CONTROL: self.save_module_control_mode - , STATE_ERROR_HANDLER: STATE_ERROR_HANDLER - , STATE_POWER_LIMIT_ERROR: STATE_POWER_LIMIT_ERROR - , STATE_SYSFS_ERROR: STATE_SYSFS_ERROR - } - logger.log_info("getting func for state {} for port {}".format(sm, port)) - try: - func = SFP_SM_ENUM[sm] - logger.log_info("got func {} for state {} for port {}".format(func, sm, port)) - return func - except KeyError as e: - logger.log_error("exception {} for port {} sm {}".format(e, port, sm)) - return None - - def run(self): - # check first if the system supports independent mode and set boolean accordingly - (platform_path, hwsku_dir) = device_info.get_paths_to_platform_and_hwsku_dirs() - logger.log_info("hwsku_dir {} found, continue to check sai.profile file".format(hwsku_dir)) - independent_file = SAI_PROFILE_FILE.format(hwsku_dir) - if os.path.isfile(independent_file): - logger.log_info("file {} found, checking content for independent mode value".format(independent_file)) - with open(independent_file, "r") as independent_file_fd: - found = False - independent_file_content = ' ' - logger.log_info("file {} found, checking content for independent mode value".format(independent_file)) - while independent_file_content and not found: - independent_file_content = independent_file_fd.readline() - if SAI_INDEP_MODULE_MODE in independent_file_content and \ - SAI_INDEP_MODULE_MODE_DELIMITER in independent_file_content: - independent_file_splitted = independent_file_content.split(SAI_INDEP_MODULE_MODE_DELIMITER) - if (len(independent_file_splitted) > 1): - self.is_supported_indep_mods_system = int(independent_file_splitted[1]) == int(SAI_INDEP_MODULE_MODE_TRUE_STR) - logger.log_info("file {} found, system will work in independent mode".format(independent_file)) - logger.log_info("value of indep mode var: {} found in file".format(independent_file_splitted[1])) - found = True - else: - logger.log_info("file {} not found, system stays in legacy mode".format(independent_file)) - - # static init - at first go over all ports and check each one if it's independent module or legacy - self.sfp_changes_dict = {} - # check for each port if the module connected and if it supports independent mode or legacy - num_of_ports = DeviceDataManager.get_sfp_count() - # create the modules sysfs fds poller - self.poll_obj = select.poll() - # read cmdline to check if warm reboot done. cannot use swsscommon warmstart since this code runs after - # warm-reboot is finished. if done, need to read control sysfs per port and act accordingly since modules are - # not reset in warm-reboot - cmdline_dict = {} - proc_cmdline_str = utils.read_str_from_file(PROC_CMDLINE) - if CMDLINE_STR_TO_LOOK_FOR in proc_cmdline_str: - cmdline_dict[CMDLINE_STR_TO_LOOK_FOR] = proc_cmdline_str.split(CMDLINE_STR_TO_LOOK_FOR)[1] - if CMDLINE_STR_TO_LOOK_FOR in cmdline_dict.keys(): - self.is_warm_reboot = cmdline_dict[CMDLINE_STR_TO_LOOK_FOR] == CMDLINE_VAL_TO_LOOK_FOR - logger.log_info(f"system was warm rebooted is_warm_reboot: {self.is_warm_reboot}") - for port in range(num_of_ports): - # check sysfs per port whether it's independent mode or legacy - temp_module_sm = ModuleStateMachine(port_num=port, initial_state=STATE_HW_NOT_PRESENT - , current_state=STATE_HW_NOT_PRESENT) - module_fd_indep_path = SYSFS_INDEPENDENT_FD_PRESENCE.format(port) - logger.log_info("system in indep mode: {} port {}".format(self.is_supported_indep_mods_system, port)) - if self.is_warm_reboot: - logger.log_info("system was warm rebooted is_warm_reboot: {} trying to read control sysfs for port {}" - .format(self.is_warm_reboot, port)) - port_control_file = SYSFS_INDEPENDENT_FD_FW_CONTROL.format(port) - try: - port_control = utils.read_int_from_file(port_control_file, raise_exception=True) - self.port_control_dict[port] = port_control - logger.log_info(f"port control sysfs is {port_control} for port {port}") - except Exception as e: - logger.log_error("exception {} for port {} trying to read port control sysfs {}" - .format(e, port, port_control_file)) - if (self.is_supported_indep_mods_system and os.path.isfile(module_fd_indep_path)) \ - and not (self.is_warm_reboot and 0 == port_control): - logger.log_info("system in indep mode: {} port {} reading file {}".format(self.is_supported_indep_mods_system, port, module_fd_indep_path)) - temp_module_sm.set_is_indep_modules(True) - temp_module_sm.set_module_fd_path(module_fd_indep_path) - module_fd = open(module_fd_indep_path, "r") - temp_module_sm.set_module_fd(module_fd) - else: - module_fd_legacy_path = self.get_sysfs_ethernet_port_fd(SYSFS_LEGACY_FD_PRESENCE, port) - temp_module_sm.set_module_fd_path(module_fd_legacy_path) - module_fd = open(module_fd_legacy_path, "r") - temp_module_sm.set_module_fd(module_fd) - # add lock to use with timer task updating next state per module object - self.modules_lock_list.append(threading.Lock()) - # start SM for this independent module - logger.log_info("adding temp_module_sm {} to sfp_port_dict".format(temp_module_sm)) - self.sfp_port_dict_initial[port] = temp_module_sm - self.sfp_port_dict[port] = temp_module_sm - - i = 0 - # need at least 1 module in final state until it makes sense to send changes dict - is_final_state_module = False - all_static_detection_done = False - logger.log_info(f"sfp_port_dict before starting static detection: {self.sfp_port_dict} main_thread_stop_event: " - f"{self.main_thread_stop_event.is_set()} all_static_detection_done: {all_static_detection_done}") - # static detection - loop on different state for all ports until all done - while not self.main_thread_stop_event.is_set() and not all_static_detection_done: - logger.log_info("static detection running iteration {}".format(i)) - waiting_list_len = len(self.waiting_modules_list) - sfp_port_dict_keys_len = len(self.sfp_port_dict.keys()) - if waiting_list_len == sfp_port_dict_keys_len: - logger.log_info("static detection length of waiting list {}: {} and sfp port dict keys {}:{} is the same, sleeping 1 second..." - .format(waiting_list_len, self.waiting_modules_list, sfp_port_dict_keys_len, self.sfp_port_dict.keys())) - time.sleep(1) - else: - logger.log_info("static detectionlength of waiting list {}: {} and sfp port dict keys {}: {} is different, NOT sleeping 1 second" - .format(waiting_list_len, self.waiting_modules_list, sfp_port_dict_keys_len, self.sfp_port_dict.keys())) - for port_num, module_sm_obj in self.sfp_port_dict.items(): - curr_state = module_sm_obj.get_current_state() - logger.log_info(f'static detection STATE_LOG {port_num}: curr_state is {curr_state}') - func = self.get_sm_func(curr_state, port_num) - logger.log_info("static detection got returned func {} for state {}".format(func, curr_state)) - try: - if not isinstance(func, str): - if func is not None: - next_state = func(port_num, module_sm_obj) - except TypeError as e: - logger.log_info("static detection exception {} for port {} traceback:\n{}".format(e, port_num, traceback.format_exc())) - module_sm_obj.set_final_state(STATE_ERROR_HANDLER) - continue - logger.log_info(f'static detection STATE_LOG {port_num}: next_state is {next_state}') - if self.timer.is_alive(): - logger.log_info("static detection timer threads is alive, acquiring lock") - self.modules_lock_list[port_num].acquire() - # for STATE_NOT_POWERED we dont advance to next state, timerTask is doing it into STATE_POWERED - if curr_state != STATE_NOT_POWERED or not module_sm_obj.wait_for_power_on: - module_sm_obj.set_next_state(next_state) - module_sm_obj.advance_state() - if module_sm_obj.get_final_state(): - logger.log_info(f'static detection STATE_LOG {port_num}: enter final state {module_sm_obj.get_final_state()}') - is_final_state_module = True - if self.timer.is_alive(): - self.modules_lock_list[port_num].release() - is_timer_alive = self.timer.is_alive() - logger.log_info("static detection timer thread is_alive {} port {}".format(is_timer_alive, port_num)) - if STATE_NOT_POWERED == curr_state: - if not is_timer_alive: - logger.log_info ("static detection curr_state is {} and timer thread is_alive {}, running timer task thread" - .format(curr_state, is_timer_alive)) - # call timer task - self.timer = threading.Timer(1.0, self.timerTask) - self.timer.start() - if self.timer.is_alive(): - logger.log_info("timer thread is_alive {}, locking module obj".format(self.timer.is_alive())) - self.modules_lock_list[port_num].acquire() - module_sm_obj.set_next_state(next_state) - if self.timer.is_alive(): - logger.log_info("timer thread is_alive {}, releasing module obj".format(self.timer.is_alive())) - self.modules_lock_list[port_num].release() - - if is_final_state_module: - self.map_ports_final_state() - self.delete_ports_from_dict() - self.send_changes_to_shared_queue() - self.register_presece_closed_ports(False, self.register_hw_present_fds) - i += 1 - self.register_hw_present_fds = [] - logger.log_info("sfp_port_dict: {}".format(self.sfp_port_dict)) - for port_num, module_sm_obj in self.sfp_port_dict.items(): - logger.log_info("static detection port_num: {} initial state: {} current_state: {} next_state: {}" - .format(port_num, module_sm_obj.initial_state, module_sm_obj.get_current_state() - , module_sm_obj.get_next_state())) - sfp_port_dict_keys_len = len(self.sfp_port_dict.keys()) - if sfp_port_dict_keys_len == 0: - logger.log_info("static detection len of keys of sfp_port_dict is 0: {}".format(sfp_port_dict_keys_len)) - all_static_detection_done = True - else: - logger.log_info("static detection len of keys of sfp_port_dict is not 0: {}".format(sfp_port_dict_keys_len)) - logger.log_info("static detection all_static_detection_done: {}".format(all_static_detection_done)) - - logger.log_info(f"sfp_port_dict before dynamic detection: {self.sfp_port_dict} " - f"main_thread_stop_event.is_set(): {self.main_thread_stop_event.is_set()}") - # dynamic detection - loop on polling changes, run state machine for them and put them into shared queue - i = 0 - # need at least 1 module in final state until it makes sense to send changes dict - is_final_state_module = False - # initialize fds events count to 0 - for fd_fileno in self.fds_mapping_to_obj: - module_obj = self.fds_mapping_to_obj[fd_fileno]['module_obj'] - # for debug purposes - self.fds_events_count_dict[module_obj.port_num] = { 'presence' : 0 , 'power_good' : 0 } - while not self.main_thread_stop_event.is_set(): - logger.log_info("dynamic detection running iteration {}".format(i)) - # poll for changes with 1 second timeout - fds_events = self.poll_obj.poll(1000) - logger.log_info("dynamic detection polled obj checking fds_events iteration {}".format(i)) - for fd, event in fds_events: - # get modules object from fd according to saved key-value of fd-module obj saved earlier - logger.log_info("dynamic detection working on fd {} event {}".format(fd, event)) - module_obj = self.fds_mapping_to_obj[fd]['module_obj'] - module_fd = self.fds_mapping_to_obj[fd]['fd'] - fd_name = self.fds_mapping_to_obj[fd]['fd_name'] - if 'presence' == fd_name: - module_fd_path = module_obj.module_fd_path - elif 'power_good' == fd_name: - module_fd_path = module_obj.module_power_good_fd_path - self.fds_events_count_dict[module_obj.port_num][fd_name] += 1 - try: - module_fd.seek(0) - val = module_fd.read().strip() - logger.log_info("dynamic detection got module_obj {} with port {} from fd number {} path {} val {} count {}" - .format(module_obj, module_obj.port_num, fd, module_fd_path - , val, self.fds_events_count_dict[module_obj.port_num])) - if self.is_dummy_event(int(val), module_obj): - logger.log_info(f"dynamic detection dummy event port {module_obj.port_num} from fd number {fd}") - continue - if module_obj.port_num not in self.sfp_port_dict.keys(): - logger.log_info("dynamic detection port {} not found in sfp_port_dict keys: {} adding it" - .format(module_obj.port_num, self.sfp_port_dict.keys())) - self.deregister_fd_from_polling(module_obj.port_num) - # put again module obj in sfp_port_dict so next loop will work on it - self.sfp_port_dict[module_obj.port_num] = module_obj - self.delete_ports_and_reset_states_dict[module_obj.port_num] = val - except Exception as e: - logger.log_error("dynamic detection exception on read presence {} for port {} fd name {} traceback:\n{}" - .format(e, module_obj.port_num, module_fd.name, traceback.format_exc())) - for port, val in self.delete_ports_and_reset_states_dict.items(): - logger.log_info(f"dynamic detection resetting all states for port {port} close_presence_ports {val}") - module_obj = self.sfp_port_dict[port] - module_obj.reset_all_states(close_presence_ports=val) - self.delete_ports_and_reset_states_dict = {} - for port_num, module_sm_obj in self.sfp_port_dict.items(): - curr_state = module_sm_obj.get_current_state() - logger.log_info(f'dynamic detection STATE_LOG {port_num}: curr_state is {curr_state}') - func = self.get_sm_func(curr_state, port) - logger.log_info("dynamic detection got returned func {} for state {}".format(func, curr_state)) - try: - if func is not None: - next_state = func(port_num, module_sm_obj, dynamic=True) - except TypeError as e: - logger.log_info("exception {} for port {}".format(e, port_num)) - continue - logger.log_info(f'dynamic detection STATE_LOG {port_num}: next_state is {next_state}') - if self.timer.is_alive(): - logger.log_info("dynamic detection timer threads is alive, acquiring lock") - self.modules_lock_list[port_num].acquire() - if curr_state != STATE_NOT_POWERED or not module_sm_obj.wait_for_power_on: - module_sm_obj.set_next_state(next_state) - module_sm_obj.advance_state() - if module_sm_obj.get_final_state(): - logger.log_info(f'dynamic detection STATE_LOG {port_num}: enter final state {module_sm_obj.get_final_state()}') - is_final_state_module = True - if self.timer.is_alive(): - self.modules_lock_list[port_num].release() - is_timer_alive = self.timer.is_alive() - logger.log_info("dynamic detection timer thread is_alive {} port {}".format(is_timer_alive, port_num)) - if STATE_NOT_POWERED == curr_state: - if not is_timer_alive: - logger.log_info("dynamic detection curr_state is {} and timer thread is_alive {}, running timer task thread" - .format(curr_state, is_timer_alive)) - # call timer task - self.timer = threading.Timer(1.0, self.timerTask) - self.timer.start() - if self.timer.is_alive(): - logger.log_info("dynamic detection timer thread is_alive {}, locking module obj".format(self.timer.is_alive())) - self.modules_lock_list[port_num].acquire() - module_sm_obj.set_next_state(next_state) - if self.timer.is_alive(): - logger.log_info( - "dynamic detection timer thread is_alive {}, releasing module obj".format(self.timer.is_alive())) - self.modules_lock_list[port_num].release() - - if is_final_state_module: - self.map_ports_final_state(dynamic=True) - self.delete_ports_from_dict(dynamic=True) - self.send_changes_to_shared_queue(dynamic=True) - self.register_presece_closed_ports(True, self.register_hw_present_fds) - if not self.sfp_port_dict and is_final_state_module: - is_final_state_module = False - logger.log_info(f"sft_port_dict is empty {self.sfp_port_dict}, set is_final_state_module to {is_final_state_module}") - self.register_hw_present_fds = [] - i += 1 - logger.log_info("sfp_port_dict: {}".format(self.sfp_port_dict)) - for port_num, module_sm_obj in self.sfp_port_dict.items(): - logger.log_info("port_num: {} module_sm_obj initial state: {} current_state: {} next_state: {}" - .format(port_num, module_sm_obj.initial_state, module_sm_obj.get_current_state(), module_sm_obj.get_next_state())) - - def is_dummy_event(self, val, module_sm_obj): - if val == 1: - return module_sm_obj.final_state in (STATE_HW_PRESENT, STATE_SW_CONTROL, STATE_FW_CONTROL) - elif val == 0: - return module_sm_obj.final_state in (STATE_HW_NOT_PRESENT,) - return False - - def check_if_hw_present(self, port, module_sm_obj, dynamic=False): - detection_method = 'dynamic' if dynamic else 'static' - logger.log_info(f"{detection_method} detection enter check_if_hw_present port {port} module_sm_obj {module_sm_obj}") - module_fd_indep_path = module_sm_obj.module_fd_path - if os.path.isfile(module_fd_indep_path): - try: - val_int = utils.read_int_from_file(module_fd_indep_path) - if 0 == val_int: - logger.log_info("returning {} for val {}".format(STATE_HW_NOT_PRESENT, val_int)) - retval_state = STATE_HW_NOT_PRESENT - module_sm_obj.set_final_state(retval_state, detection_method) - return retval_state - elif 1 == val_int: - logger.log_info("returning {} for val {}".format(STATE_HW_PRESENT, val_int)) - retval_state = STATE_HW_PRESENT - if not self.is_supported_indep_mods_system or (self.is_warm_reboot and 0 == self.port_control_dict[port] and not dynamic): - module_sm_obj.set_final_state(retval_state, detection_method) - self.register_fd_for_polling(module_sm_obj, module_sm_obj.module_fd, 'presence') - return retval_state - except Exception as e: - logger.log_info("exception {} for port {} setting final state STATE_ERROR_HANDLER".format(e, port)) - module_sm_obj.set_final_state(STATE_ERROR_HANDLER) - return STATE_ERROR_HANDLER - module_sm_obj.set_final_state(STATE_HW_NOT_PRESENT, detection_method) - return STATE_HW_NOT_PRESENT - - def check_if_module_available(self, port, module_sm_obj, dynamic=False): - logger.log_info("enter check_if_module_available port {} module_sm_obj {}".format(port, module_sm_obj)) - module_fd_indep_path = SYSFS_INDEPENDENT_FD_POWER_GOOD.format(port) - if os.path.isfile(module_fd_indep_path): - try: - # not using utils.read_int_from_file since need to catch the exception here if no such file or it is - # not accesible. utils.read_int_from_file will return 0 in such a case - module_power_good_fd = open(module_fd_indep_path, "r") - val = module_power_good_fd.read() - val_int = int(val) - module_sm_obj.module_power_good_fd_path = module_fd_indep_path - module_sm_obj.module_power_good_fd = module_power_good_fd - - if 0 == val_int: - logger.log_info(f'port {port} power is not good') - module_sm_obj.set_final_state(STATE_HW_NOT_PRESENT) - return STATE_HW_NOT_PRESENT - elif 1 == val_int: - logger.log_info(f'port {port} power is good') - return STATE_MODULE_AVAILABLE - except Exception as e: - logger.log_info("exception {} for port {}".format(e, port)) - return STATE_HW_NOT_PRESENT - logger.log_info(f'port {port} has no power good file {module_fd_indep_path}') - module_sm_obj.set_final_state(STATE_HW_NOT_PRESENT) - return STATE_HW_NOT_PRESENT - - def check_if_power_on(self, port, module_sm_obj, dynamic=False): - logger.log_info(f'enter check_if_power_on for port {port}') - module_fd_indep_path = SYSFS_INDEPENDENT_FD_POWER_ON.format(port) - if os.path.isfile(module_fd_indep_path): - try: - val_int = utils.read_int_from_file(module_fd_indep_path) - if 0 == val_int: - logger.log_info(f'check_if_power_on port {port} is not powered') - return STATE_NOT_POWERED - elif 1 == val_int: - logger.log_info(f'check_if_power_on port {port} is powered') - return STATE_POWERED - except Exception as e: - logger.log_info(f'check_if_power_on got exception {e}') - module_sm_obj.set_final_state(STATE_HW_NOT_PRESENT) - return STATE_HW_NOT_PRESENT - - def power_on_module(self, port, module_sm_obj, dynamic=False): - logger.log_info(f'enter power_on_module for port {port}') - if not module_sm_obj.wait_for_power_on: - module_fd_indep_path_po = SYSFS_INDEPENDENT_FD_POWER_ON.format(port) - module_fd_indep_path_r = SYSFS_INDEPENDENT_FD_HW_RESET.format(port) - try: - if os.path.isfile(module_fd_indep_path_po): - logger.log_info("powerOnModule powering on via {} for port {}".format(module_fd_indep_path_po, port)) - # echo 1 > /sys/module/sx_core/$asic/$module/power_on - utils.write_file(module_fd_indep_path_po, "1") - if os.path.isfile(module_fd_indep_path_r): - logger.log_info("powerOnModule resetting via {} for port {}".format(module_fd_indep_path_r, port)) - # de-assert hw_reset - low polarity. 1 for de-assert 0 for assert - # echo 1 > /sys/module/sx_core/$asic/$module/hw_reset - utils.write_file(module_fd_indep_path_r, "1") - self.add_port_to_wait_reset(module_sm_obj) - except Exception as e: - logger.log_info("exception in powerOnModule {} for port {}".format(e, port)) - return STATE_HW_NOT_PRESENT - return STATE_NOT_POWERED - - def check_module_type(self, port, module_sm_obj, dynamic=False): - logger.log_info("enter check_module_type port {} module_sm_obj {}".format(port, module_sm_obj)) - sfp = sfp_module.SFP(port) - xcvr_api = sfp.get_xcvr_api() - if not xcvr_api: - logger.log_info("check_module_type calling sfp reinit for port {} module_sm_obj {}" - .format(port, module_sm_obj)) - sfp.reinit() - logger.log_info("check_module_type setting as FW control as xcvr_api is empty for port {} module_sm_obj {}" - .format(port, module_sm_obj)) - return STATE_FW_CONTROL - # QSFP-DD ID is 24, OSFP ID is 25 - only these 2 are supported currently as independent module - SW controlled - if not isinstance(xcvr_api, cmis.CmisApi): - logger.log_info("check_module_type setting STATE_FW_CONTROL for {} in check_module_type port {} module_sm_obj {}" - .format(xcvr_api, port, module_sm_obj)) - return STATE_FW_CONTROL - else: - if xcvr_api.is_flat_memory(): - logger.log_info("check_module_type port {} setting STATE_FW_CONTROL module ID {} due to flat_mem device" - .format(xcvr_api, port)) - return STATE_FW_CONTROL - logger.log_info("check_module_type checking power cap for {} in check_module_type port {} module_sm_obj {}" - .format(xcvr_api, port, module_sm_obj)) - power_cap = self.check_power_cap(port, module_sm_obj) - if power_cap is STATE_POWER_LIMIT_ERROR: - module_sm_obj.set_final_state(STATE_POWER_LIMIT_ERROR) - return STATE_POWER_LIMIT_ERROR - else: - # first read the frequency support - if it's 1 then continue, if it's 0 no need to do anything - module_fd_freq_support_path = SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format(port) - val_int = utils.read_int_from_file(module_fd_freq_support_path) - if 1 == val_int: - # read the module maximum supported clock of Management Comm Interface (MCI) from module EEPROM. - # from byte 2 bits 3-2: - # 00b means module supports up to 400KHz - # 01b means module supports up to 1MHz - logger.log_info(f"check_module_type reading mci max frequency for port {port}") - read_mci = xcvr_api.xcvr_eeprom.read_raw(2, 1) - logger.log_info(f"check_module_type read mci max frequency {read_mci} for port {port}") - mci_bits = read_mci & 0b00001100 - logger.log_info(f"check_module_type read mci max frequency bits {mci_bits} for port {port}") - # Then, set it to frequency Sysfs using: - # echo > /sys/module/sx_core/$asic/$module/frequency // val: 0 - up to 400KHz, 1 - up to 1MHz - indep_fd_freq = SYSFS_INDEPENDENT_FD_FREQ.format(port) - utils.write_file(indep_fd_freq, mci_bits) - return STATE_SW_CONTROL - - def check_power_cap(self, port, module_sm_obj, dynamic=False): - logger.log_info("enter check_power_cap port {} module_sm_obj {}".format(port, module_sm_obj)) - sfp = sfp_module.SFP(port) - xcvr_api = sfp.get_xcvr_api() - field = xcvr_api.xcvr_eeprom.mem_map.get_field(consts.MAX_POWER_FIELD) - powercap_ba = xcvr_api.xcvr_eeprom.reader(field.get_offset(), field.get_size()) - logger.log_info("check_power_cap got powercap bytearray {} for port {} module_sm_obj {}".format(powercap_ba, port, module_sm_obj)) - powercap = int.from_bytes(powercap_ba, "big") - logger.log_info("check_power_cap got powercap {} for port {} module_sm_obj {}".format(powercap, port, module_sm_obj)) - indep_fd_power_limit = self.get_sysfs_ethernet_port_fd(SYSFS_INDEPENDENT_FD_POWER_LIMIT, port) - cage_power_limit = utils.read_int_from_file(indep_fd_power_limit) - logger.log_info("check_power_cap got cage_power_limit {} for port {} module_sm_obj {}".format(cage_power_limit, port, module_sm_obj)) - if powercap > int(cage_power_limit): - logger.log_info("check_power_cap powercap {} != cage_power_limit {} for port {} module_sm_obj {}".format(powercap, cage_power_limit, port, module_sm_obj)) - module_sm_obj.set_final_state(STATE_POWER_LIMIT_ERROR) - return STATE_POWER_LIMIT_ERROR - - def save_module_control_mode(self, port, module_sm_obj, dynamic=False): - detection_method = 'dynamic' if dynamic else 'static' - logger.log_info("{} detection save_module_control_mode setting current state {} for port {} as final state" - .format(detection_method, module_sm_obj.get_current_state(), port)) - state = module_sm_obj.get_current_state() - module_sm_obj.set_final_state(state) - try: - if state == STATE_FW_CONTROL: - # echo 0 > /sys/module/sx_core/$asic/$module/control - indep_fd_fw_control = SYSFS_INDEPENDENT_FD_FW_CONTROL.format(port) - utils.write_file(indep_fd_fw_control, "0") - logger.log_info("save_module_control_mode set FW control for state {} port {}".format(state, port)) - # update the presence sysfs fd to legacy FD presence, first close the previous fd - module_sm_obj.module_fd.close() - module_fd_legacy_path = SYSFS_LEGACY_FD_PRESENCE.format(port) - module_sm_obj.set_module_fd_path(module_fd_legacy_path) - module_fd = open(module_fd_legacy_path, "r") - module_sm_obj.set_module_fd(module_fd) - logger.log_info("save_module_control_mode changed module fd to legacy present for port {}".format(port)) - else: - # registering power good sysfs even if not good, so we can get an event from poller upon changes - self.register_fd_for_polling(module_sm_obj, module_sm_obj.module_power_good_fd, 'power_good') - # register the module's sysfs fd to poller with ERR and PRI attrs - logger.log_info("save_module_control_mode registering sysfs fd {} number {} path {} for port {}" - .format(module_sm_obj.module_fd, module_sm_obj.module_fd.fileno(), module_sm_obj.set_module_fd_path, port)) - except Exception as e: - logger.log_error("{} detection exception on read presence {} for port {} fd name {} traceback:\n{}" - .format(detection_method, e, port, module_sm_obj.module_fd.name, traceback.format_exc())) - self.register_fd_for_polling(module_sm_obj, module_sm_obj.module_fd, 'presence') - logger.log_info("save_module_control_mode set current state {} for port {} as final state {}".format( - module_sm_obj.get_current_state(), port, module_sm_obj.get_final_state())) - - def register_fd_for_polling(self, module_sm_obj, fd, fd_name): - self.fds_mapping_to_obj[fd.fileno()] = {'module_obj' : module_sm_obj, - 'fd': fd, - 'fd_name' : fd_name} - if module_sm_obj.port_num not in self.port_to_fds: - self.port_to_fds[module_sm_obj.port_num] = [fd] - else: - self.port_to_fds[module_sm_obj.port_num].append(fd) - self.poll_obj.register(fd, select.POLLERR | select.POLLPRI) - - def deregister_fd_from_polling(self, port): - if port in self.port_to_fds: - fds = self.port_to_fds[port] - for fd in fds: - self.fds_mapping_to_obj.pop(fd.fileno()) - self.poll_obj.unregister(fd) - self.port_to_fds.pop(port) - - def timerTask(self): # wakes up every 1 second - logger.log_info("timerTask entered run state") - empty = False - i = 0 - while not empty: - logger.log_info("timerTask while loop itartion {}".format(i)) - empty = True - port_list_to_delete = [] - for port in self.waiting_modules_list: - logger.log_info("timerTask working on port {}".format(port)) - empty = False - module = self.sfp_port_dict[port] - logger.log_info("timerTask got module with port_num {} from port {}".format(module.port_num, port)) - state = module.get_current_state() - if module and state == STATE_NOT_POWERED: - logger.log_info("timerTask module {} current_state {} counting seconds since reset_start_time" - .format(module, module.get_current_state())) - if time.time() - module.reset_start_time >= 3: - # set next state as STATE_POWERED state to trigger the function of check module type - logger.log_info("timerTask module port {} locking lock of port {}".format(module.port_num, module.port_num)) - self.modules_lock_list[module.port_num].acquire() - logger.log_info("timerTask module port {} setting next state to STATE_POWERED".format(module.port_num)) - module.set_next_state(STATE_POWERED) - logger.log_info("timerTask module port {} advancing next state".format(module.port_num)) - module.advance_state() - logger.log_info("timerTask module port {} releasing lock of port {}".format(port, module.port_num)) - self.modules_lock_list[module.port_num].release() - logger.log_info("timerTask module port {} adding to delete list to remove from waiting_modules_list".format(module.port_num)) - port_list_to_delete.append(module.port_num) - logger.log_info("timerTask deleting ports {} from waiting_modules_list...".format(port_list_to_delete)) - for port in port_list_to_delete: - logger.log_info("timerTask deleting port {} from waiting_modules_list".format(port)) - self.waiting_modules_list.remove(port) - logger.log_info("timerTask waiting_modules_list after deletion: {}".format(self.waiting_modules_list)) - time.sleep(1) - i += 1 - - def get_sysfs_ethernet_port_fd(self, sysfs_fd, port): - sysfs_eth_port_fd = sysfs_fd.format(port) - return sysfs_eth_port_fd - - def add_port_to_wait_reset(self, module_sm_obj): - module_sm_obj.reset_start_time = time.time() - logger.log_info("add_port_to_wait_reset reset_start_time {}".format(module_sm_obj.reset_start_time)) - module_sm_obj.wait_for_power_on = True - logger.log_info("add_port_to_wait_reset wait_for_power_on {}".format(module_sm_obj.wait_for_power_on)) - self.waiting_modules_list.add(module_sm_obj.port_num) - logger.log_info("add_port_to_wait_reset waiting_list after adding: {}".format(self.waiting_modules_list)) - - def map_ports_final_state(self, dynamic=False): - detection_method = 'dynamic' if dynamic else 'static' - logger.log_info(f"{detection_method} detection enter map_ports_final_state") - for port, module_obj in self.sfp_port_dict.items(): - final_state = module_obj.get_final_state() - if final_state: - # add port to delete list that we will iterate on later and delete the ports from sfp_port_dict - self.sfp_delete_list_from_port_dict.append(port) - if final_state in [STATE_HW_NOT_PRESENT, STATE_POWER_LIMIT_ERROR, STATE_ERROR_HANDLER]: - port_status = '0' - logger.log_info(f"{detection_method} detection adding port {port} to register_hw_present_fds") - self.register_hw_present_fds.append(module_obj) - else: - port_status = '1' - self.sfp_changes_dict[str(module_obj.port_num + 1)] = port_status - - def delete_ports_from_dict(self, dynamic=False): - detection_method = 'dynamic' if dynamic else 'static' - logger.log_info(f"{detection_method} detection sfp_port_dict before deletion: {self.sfp_port_dict}") - for port in self.sfp_delete_list_from_port_dict: - del self.sfp_port_dict[port] - self.sfp_delete_list_from_port_dict = [] - logger.log_info("{} detection sfp_port_dict after deletion: {}".format(detection_method, self.sfp_port_dict)) - - def send_changes_to_shared_queue(self, dynamic=False): - detection_method = 'dynamic' if dynamic else 'static' - if self.sfp_changes_dict: - logger.log_info(f"{detection_method} detection putting sfp_changes_dict {self.sfp_changes_dict} " - f"in modules changes queue...") - try: - self.modules_changes_queue.put(self.sfp_changes_dict, timeout=1) - self.sfp_changes_dict = {} - logger.log_info(f"{detection_method} sfp_changes_dict after put changes: {self.sfp_changes_dict}") - except queue.Full: - logger.log_info(f"{detection_method} failed to put item from modules changes queue, queue is full") - else: - logger.log_info(f"{detection_method} sfp_changes_dict {self.sfp_changes_dict} is empty...") - - def register_presece_closed_ports(self, dynamic=False, module_obj_list=[]): - detection_method = 'dynamic' if dynamic else 'static' - logger.log_info(f"{detection_method} detection enter register_presence_closed_ports") - for module_obj in module_obj_list: - port = module_obj.port_num - if self.is_supported_indep_mods_system: - module_fd_indep_path = SYSFS_INDEPENDENT_FD_PRESENCE.format(port) - else: - module_fd_indep_path = SYSFS_LEGACY_FD_PRESENCE.format(port) - module_obj.set_module_fd_path(module_fd_indep_path) - module_fd = open(module_fd_indep_path, "r") - module_obj.set_module_fd(module_fd) - logger.log_info(f"{detection_method} registering fd {module_fd} fd name {module_fd.name} for port {port}") - self.register_fd_for_polling(module_obj, module_fd, 'presence') - -class ModuleStateMachine(object): - - def __init__(self, port_num=0, initial_state=STATE_HW_NOT_PRESENT, current_state=STATE_HW_NOT_PRESENT - , next_state=STATE_HW_NOT_PRESENT, final_state='', is_indep_module=False - , module_fd_path='', module_fd=None, reset_start_time=None - , eeprom_poweron_reset_retries=1, module_power_good_fd_path=None, module_power_good_fd=None): - - self.port_num = port_num - self.initial_state = initial_state - self.current_state = current_state - self.next_state = next_state - self.final_state = final_state - self.is_indep_modules = is_indep_module - self.module_fd_path = module_fd_path - self.module_fd = module_fd - self.reset_start_time = reset_start_time - self.wait_for_power_on = False - self.eeprom_poweron_reset_retries = eeprom_poweron_reset_retries - self.module_power_good_fd_path = module_power_good_fd_path - self.module_power_good_fd = module_power_good_fd - - def set_initial_state(self, state): - self.initial_state = state - - def get_current_state(self): - return self.current_state - - def set_current_state(self, state): - self.current_state = state - - def get_next_state(self): - return self.next_state - - def set_next_state(self, state): - self.next_state = state - - def get_final_state(self): - return self.final_state - - def set_final_state(self, state, detection_method='static'): - logger.log_info(f"{detection_method} set_final_state setting {state} port {self.port_num}") - self.final_state = state - - def advance_state(self): - self.set_current_state(self.next_state) - self.next_state = '' - - def set_is_indep_modules(self, is_indep_modules): - self.is_indep_modules = is_indep_modules - - def set_module_fd_path(self, module_fd_path): - self.module_fd_path = module_fd_path - - def set_module_fd(self, module_fd): - self.module_fd = module_fd - - def reset_all_states(self, def_state=STATE_HW_NOT_PRESENT, retries=1, close_presence_ports='0'): - self.initial_state = def_state - self.current_state = def_state - self.next_state = def_state - self.final_state = '' - self.wait_for_power_on = False - self.eeprom_poweron_reset_retries = retries - if '0' == close_presence_ports: - self.module_fd.close() - if self.module_power_good_fd: - self.module_power_good_fd.close() diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index 72a8e686b03f..b7c4d34a18b3 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -24,16 +24,18 @@ try: import ctypes + import select import subprocess import os import threading + import time from sonic_py_common.logger import Logger from sonic_py_common.general import check_output_pipe from . import utils from .device_data import DeviceDataManager from sonic_platform_base.sonic_xcvr.sfp_optoe_base import SfpOptoeBase from sonic_platform_base.sonic_xcvr.fields import consts - from sonic_platform_base.sonic_xcvr.api.public import sff8636, sff8436 + from sonic_platform_base.sonic_xcvr.api.public import cmis, sff8636, sff8436 except ImportError as e: raise ImportError (str(e) + "- required module not found") @@ -127,7 +129,44 @@ CPU_MASK = PORT_TYPE_MASK & (PORT_TYPE_CPU << PORT_TYPE_OFFSET) # parameters for SFP presence +SFP_STATUS_REMOVED = '0' SFP_STATUS_INSERTED = '1' +SFP_STATUS_ERROR = '2' +SFP_STATUS_UNKNOWN = '-1' + +# SFP status from PMAOS register +# 0x1 plug in +# 0x2 plug out +# 0x3 plug in with error +# 0x4 disabled, at this status SFP eeprom is not accessible, +# and presence status also will be not present, +# so treate it as plug out. +SDK_SFP_STATE_IN = 0x1 +SDK_SFP_STATE_OUT = 0x2 +SDK_SFP_STATE_ERR = 0x3 +SDK_SFP_STATE_DIS = 0x4 +SDK_SFP_STATE_UNKNOWN = 0x5 + +SDK_STATUS_TO_SONIC_STATUS = { + SDK_SFP_STATE_IN: SFP_STATUS_INSERTED, + SDK_SFP_STATE_OUT: SFP_STATUS_REMOVED, + SDK_SFP_STATE_ERR: SFP_STATUS_ERROR, + SDK_SFP_STATE_DIS: SFP_STATUS_REMOVED, + SDK_SFP_STATE_UNKNOWN: SFP_STATUS_UNKNOWN +} + +# SDK error definitions begin + +# SFP errors that will block eeprom accessing +SDK_SFP_BLOCKING_ERRORS = [ + 0x2, # SFP.SFP_ERROR_BIT_I2C_STUCK, + 0x3, # SFP.SFP_ERROR_BIT_BAD_EEPROM, + 0x5, # SFP.SFP_ERROR_BIT_UNSUPPORTED_CABLE, + 0x6, # SFP.SFP_ERROR_BIT_HIGH_TEMP, + 0x7, # SFP.SFP_ERROR_BIT_BAD_CABLE +] + +# SDK error definitions end # SFP constants SFP_PAGE_SIZE = 256 # page size of page0h @@ -162,6 +201,60 @@ SFP_DEFAULT_TEMP_CRITICAL_THRESHOLD = 80.0 SFP_TEMPERATURE_SCALE = 8.0 +# Module host management definitions begin +SFP_SW_CONTROL = 1 +SFP_FW_CONTROL = 0 + +CMIS_MAX_POWER_OFFSET = 201 + +SFF_POWER_CLASS_MASK = 0xE3 +SFF_POWER_CLASS_MAPPING = { + 0: 1.5, # 1.5W + 64: 2, # 2.0W + 128: 2.5, # 2.5W + 192: 3.5, # 3.5W + 193: 4, # 4.0W + 194: 4.5, # 4.5W + 195: 5 # 5.0W +} +SFF_POWER_CLASS_OFFSET = 129 +SFF_POWER_CLASS_8_INDICATOR = 32 +SFF_POWER_CLASS_8_OFFSET = 107 + +CMIS_MCI_EEPROM_OFFSET = 2 +CMIS_MCI_MASK = 0b00001100 + +STATE_DOWN = 'Down' # Initial state +STATE_INIT = 'Initializing' # Module starts initializing, check module present, also power on the module if need +STATE_RESETTING = 'Resetting' # Module is resetting the firmware +STATE_POWERED_ON = 'Power On' # Module is powered on, module firmware has been loaded, check module power is in good state +STATE_SW_CONTROL = 'Software Control' # Module is under software control +STATE_FW_CONTROL = 'Firmware Control' # Module is under firmware control +STATE_POWER_BAD = 'Power Bad' # Module power_good returns 0 +STATE_POWER_LIMIT_ERROR = 'Exceed Power Limit' # Module power exceeds cage power limit +STATE_NOT_PRESENT = 'Not Present' # Module is not present + +EVENT_START = 'Start' +EVENT_NOT_PRESENT = 'Not Present' +EVENT_RESET = 'Reset' +EVENT_POWER_ON = 'Power On' +EVENT_RESET_DONE = 'Reset Done' +EVENT_POWER_BAD = 'Power Bad' +EVENT_SW_CONTROL = 'Software Control' +EVENT_FW_CONTROL = 'Firmware Control' +EVENT_POWER_LIMIT_EXCEED = 'Power Limit Exceed' +EVENT_POWER_GOOD = 'Power Good' +EVENT_PRESENT = 'Present' + +ACTION_ON_START = 'On Start' +ACTION_ON_RESET = 'On Reset' +ACTION_ON_POWERED = 'On Powered' +ACTION_ON_SW_CONTROL = 'On Software Control' +ACTION_ON_FW_CONTROL = 'On Firmware Control' +ACTION_ON_POWER_LIMIT_ERROR = 'On Power Limit Error' +ACTION_ON_CANCEL_WAIT = 'On Cancel Wait' +# Module host management definitions end + # SFP EEPROM limited bytes limited_eeprom = { SFP_TYPE_CMIS: { @@ -223,6 +316,38 @@ class NvidiaSFPCommon(SfpOptoeBase): sfp_index_to_logical_port_dict = {} sfp_index_to_logical_lock = threading.Lock() + SFP_MLNX_ERROR_DESCRIPTION_LONGRANGE_NON_MLNX_CABLE = 'Long range for non-Mellanox cable or module' + SFP_MLNX_ERROR_DESCRIPTION_ENFORCE_PART_NUMBER_LIST = 'Enforce part number list' + SFP_MLNX_ERROR_DESCRIPTION_PMD_TYPE_NOT_ENABLED = 'PMD type not enabled' + SFP_MLNX_ERROR_DESCRIPTION_PCIE_POWER_SLOT_EXCEEDED = 'PCIE system power slot exceeded' + SFP_MLNX_ERROR_DESCRIPTION_RESERVED = 'Reserved' + + SDK_ERRORS_TO_DESCRIPTION = { + 0x1: SFP_MLNX_ERROR_DESCRIPTION_LONGRANGE_NON_MLNX_CABLE, + 0x4: SFP_MLNX_ERROR_DESCRIPTION_ENFORCE_PART_NUMBER_LIST, + 0x8: SFP_MLNX_ERROR_DESCRIPTION_PMD_TYPE_NOT_ENABLED, + 0xc: SFP_MLNX_ERROR_DESCRIPTION_PCIE_POWER_SLOT_EXCEEDED + } + + SFP_MLNX_ERROR_BIT_LONGRANGE_NON_MLNX_CABLE = 0x00010000 + SFP_MLNX_ERROR_BIT_ENFORCE_PART_NUMBER_LIST = 0x00020000 + SFP_MLNX_ERROR_BIT_PMD_TYPE_NOT_ENABLED = 0x00040000 + SFP_MLNX_ERROR_BIT_PCIE_POWER_SLOT_EXCEEDED = 0x00080000 + SFP_MLNX_ERROR_BIT_RESERVED = 0x80000000 + + SDK_ERRORS_TO_ERROR_BITS = { + 0x0: SfpOptoeBase.SFP_ERROR_BIT_POWER_BUDGET_EXCEEDED, + 0x1: SFP_MLNX_ERROR_BIT_LONGRANGE_NON_MLNX_CABLE, + 0x2: SfpOptoeBase.SFP_ERROR_BIT_I2C_STUCK, + 0x3: SfpOptoeBase.SFP_ERROR_BIT_BAD_EEPROM, + 0x4: SFP_MLNX_ERROR_BIT_ENFORCE_PART_NUMBER_LIST, + 0x5: SfpOptoeBase.SFP_ERROR_BIT_UNSUPPORTED_CABLE, + 0x6: SfpOptoeBase.SFP_ERROR_BIT_HIGH_TEMP, + 0x7: SfpOptoeBase.SFP_ERROR_BIT_BAD_CABLE, + 0x8: SFP_MLNX_ERROR_BIT_PMD_TYPE_NOT_ENABLED, + 0xc: SFP_MLNX_ERROR_BIT_PCIE_POWER_SLOT_EXCEEDED + } + def __init__(self, sfp_index): super(NvidiaSFPCommon, self).__init__() self.index = sfp_index + 1 @@ -251,46 +376,72 @@ def _get_module_info(self, sdk_index): error_type = utils.read_int_from_file(status_error_file_path) return oper_state, error_type + + def get_fd(self, fd_type): + return open(f'/sys/module/sx_core/asic0/module{self.sdk_index}/{fd_type}') + + def get_fd_for_polling_legacy(self): + """Get polling fds for when module host management is disabled + + Returns: + object: file descriptor of present + """ + return self.get_fd('present') + + def get_module_status(self): + """Get value of sysfs status. It could return: + SXD_PMPE_MODULE_STATUS_PLUGGED_ENABLED_E = 0x1, + SXD_PMPE_MODULE_STATUS_UNPLUGGED_E = 0x2, + SXD_PMPE_MODULE_STATUS_MODULE_PLUGGED_ERROR_E = 0x3, + SXD_PMPE_MODULE_STATUS_PLUGGED_DISABLED_E = 0x4, + SXD_PMPE_MODULE_STATUS_UNKNOWN_E = 0x5, + + Returns: + str: sonic status of the module + """ + status = utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/status') + return SDK_STATUS_TO_SONIC_STATUS[status] + + def get_error_info_from_sdk_error_type(self): + """Translate SDK error type to SONiC error state and error description. Only calls + when sysfs "present" returns "2". + + Returns: + tuple: (error state, error description) + """ + error_type = utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/temperature/statuserror', default=-1) + sfp_state_bits = NvidiaSFPCommon.SDK_ERRORS_TO_ERROR_BITS.get(error_type) + if sfp_state_bits is None: + logger.log_error(f"Unrecognized error {error_type} detected on SFP {self.sdk_index}") + return SFP_STATUS_ERROR, "Unknown error ({})".format(error_type) + + if error_type in SDK_SFP_BLOCKING_ERRORS: + # In SFP at error status case, need to overwrite the sfp_state with the exact error code + sfp_state_bits |= SfpOptoeBase.SFP_ERROR_BIT_BLOCKING + + # An error should be always set along with 'INSERTED' + sfp_state_bits |= SfpOptoeBase.SFP_STATUS_BIT_INSERTED + + # For vendor specific errors, the description should be returned as well + error_description = NvidiaSFPCommon.SDK_ERRORS_TO_DESCRIPTION.get(error_type) + sfp_state = str(sfp_state_bits) + return sfp_state, error_description - @classmethod - def get_sfp_index_to_logical_port(cls, force=False): - if not cls.sfp_index_to_logical_port_dict or force: - config_db = utils.DbUtils.get_db_instance('CONFIG_DB') - port_data = config_db.get_table('PORT') - for key, data in port_data.items(): - if data['index'] not in cls.sfp_index_to_logical_port_dict: - cls.sfp_index_to_logical_port_dict[int(data['index']) - 1] = key - - @classmethod - def get_logical_port_by_sfp_index(cls, sfp_index): - with cls.sfp_index_to_logical_lock: - cls.get_sfp_index_to_logical_port() - logical_port_name = cls.sfp_index_to_logical_port_dict.get(sfp_index) - if not logical_port_name: - cls.get_sfp_index_to_logical_port(force=True) - else: - config_db = utils.DbUtils.get_db_instance('CONFIG_DB') - current_index = int(config_db.get('CONFIG_DB', f'PORT|{logical_port_name}', 'index')) - if current_index != sfp_index: - cls.get_sfp_index_to_logical_port(force=True) - logical_port_name = cls.sfp_index_to_logical_port_dict.get(sfp_index) - return logical_port_name - class SFP(NvidiaSFPCommon): """Platform-specific SFP class""" shared_sdk_handle = None - SFP_MLNX_ERROR_DESCRIPTION_LONGRANGE_NON_MLNX_CABLE = 'Long range for non-Mellanox cable or module' - SFP_MLNX_ERROR_DESCRIPTION_ENFORCE_PART_NUMBER_LIST = 'Enforce part number list' - SFP_MLNX_ERROR_DESCRIPTION_PMD_TYPE_NOT_ENABLED = 'PMD type not enabled' - SFP_MLNX_ERROR_DESCRIPTION_PCIE_POWER_SLOT_EXCEEDED = 'PCIE system power slot exceeded' - SFP_MLNX_ERROR_DESCRIPTION_RESERVED = 'Reserved' - - SFP_MLNX_ERROR_BIT_LONGRANGE_NON_MLNX_CABLE = 0x00010000 - SFP_MLNX_ERROR_BIT_ENFORCE_PART_NUMBER_LIST = 0x00020000 - SFP_MLNX_ERROR_BIT_PMD_TYPE_NOT_ENABLED = 0x00040000 - SFP_MLNX_ERROR_BIT_PCIE_POWER_SLOT_EXCEEDED = 0x00080000 - SFP_MLNX_ERROR_BIT_RESERVED = 0x80000000 + + # Class level state machine object, only applicable for module host management + sm = None + + # Class level wait SFP ready task, the task waits for module to load its firmware after resetting, + # only applicable for module host management + wait_ready_task = None + + # Class level action table which stores the mapping from action name to action function, + # only applicable for module host management + action_table = None def __init__(self, sfp_index, sfp_type=None, slot_id=0, linecard_port_count=0, lc_name=None): super(SFP, self).__init__(sfp_index) @@ -311,6 +462,11 @@ def __init__(self, sfp_index, sfp_type=None, slot_id=0, linecard_port_count=0, l self.slot_id = slot_id self._sfp_type_str = None + # SFP state, only applicable for module host management + self.state = STATE_DOWN + + def __str__(self): + return f'SFP {self.sdk_index}' def reinit(self): """ @@ -318,7 +474,7 @@ def reinit(self): :return: """ self._sfp_type_str = None - self.refresh_xcvr_api() + self._xcvr_api = None def get_presence(self): """ @@ -327,10 +483,6 @@ def get_presence(self): Returns: bool: True if device is present, False if not """ - try: - self.is_sw_control() - except: - return False eeprom_raw = self._read_eeprom(0, 1, log_on_error=False) return eeprom_raw is not None @@ -467,7 +619,7 @@ def get_lpmode(self): if self.is_sw_control(): api = self.get_xcvr_api() return api.get_lpmode() if api else False - elif DeviceDataManager.is_independent_mode(): + elif DeviceDataManager.is_module_host_management_mode(): file_path = SFP_SDK_MODULE_SYSFS_ROOT_TEMPLATE.format(self.sdk_index) + SFP_SYSFS_POWER_MODE power_mode = utils.read_int_from_file(file_path) return power_mode == POWER_MODE_LOW @@ -674,7 +826,7 @@ def set_lpmode(self, lpmode): # If at some point get_lpmode=desired_lpmode, it will return true. # If after timeout ends, lpmode will not be desired_lpmode, it will return false. return utils.wait_until(check_lpmode, 2, 1, api=api, lpmode=lpmode) - elif DeviceDataManager.is_independent_mode(): + elif DeviceDataManager.is_module_host_management_mode(): # FW control under CMIS host management mode. # Currently, we don't support set LPM under this mode. # Just return False to indicate set Fail @@ -1004,24 +1156,534 @@ def get_xcvr_api(self): return self._xcvr_api def is_sw_control(self): - if not DeviceDataManager.is_independent_mode(): + if not DeviceDataManager.is_module_host_management_mode(): return False - - db = utils.DbUtils.get_db_instance('STATE_DB') - logical_port = NvidiaSFPCommon.get_logical_port_by_sfp_index(self.sdk_index) - if not logical_port: - raise Exception(f'Module {self.sdk_index} is not present or under initialization') - - initialized = db.exists('STATE_DB', f'TRANSCEIVER_STATUS|{logical_port}') - if not initialized: - raise Exception(f'Module {self.sdk_index} is not present or under initialization') - try: return utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/control', raise_exception=True, log_func=None) == 1 except: # just in case control file does not exist - raise Exception(f'Module {self.sdk_index} is under initialization') + raise Exception(f'control sysfs for SFP {self.sdk_index} does not exist') + + def get_hw_present(self): + """Get hardware present status, only applicable on host management mode + + Returns: + bool: True if module is in the cage + """ + return utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/hw_present') == 1 + + def get_power_on(self): + """Get power on status, only applicable on host management mode + + Returns: + bool: True if the module is powered on + """ + return utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/power_on') == 1 + + def set_power(self, on): + """Control the power of this module, only applicable on host management mode + + Args: + on (bool): True if on + """ + value = 1 if on else 0 + utils.write_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/power_on', value) + + def get_reset_state(self): + """Get reset state of this module, only applicable on host management mode + + Returns: + bool: True if module is not in reset status + """ + return utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/hw_reset') == 1 + + def set_hw_reset(self, value): + """Set the module reset status + + Args: + value (int): 1 for reset, 0 for leaving reset + """ + utils.write_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/hw_reset', value) + + def get_power_good(self): + """Get power good status of this module, only applicable on host management mode + + Returns: + bool: True if the power is in good status + """ + return utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/power_good') == 1 + + def get_control_type(self): + """Get control type of this module, only applicable on host management mode + + Returns: + int: 1 - software control, 0 - firmware control + """ + return utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/control') + + def set_control_type(self, control_type): + """Set control type for the module + + Args: + control_type (int): 0 for firmware control, currently only 0 is allowed + """ + utils.write_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/control', control_type) + + def determine_control_type(self): + """Determine control type according to module type + + Returns: + enum: software control or firmware control + """ + api = self.get_xcvr_api() + if not api: + logger.log_error(f'Failed to get api object for SFP {self.sdk_index}, probably module EEPROM is not ready') + return SFP_FW_CONTROL + + if not self.is_supported_for_software_control(api): + return SFP_FW_CONTROL + else: + return SFP_SW_CONTROL + + def is_cmis_api(self, xcvr_api): + """Check if the api type is CMIS + + Args: + xcvr_api (object): xcvr api object + + Returns: + bool: True if the api is of type CMIS + """ + return isinstance(xcvr_api, cmis.CmisApi) + + def is_sff_api(self, xcvr_api): + """Check if the api type is SFF + + Args: + xcvr_api (object): xcvr api object + + Returns: + bool: True if the api is of type SFF + """ + return isinstance(xcvr_api, sff8636.Sff8636Api) or isinstance(xcvr_api, sff8436.Sff8436Api) + + def is_supported_for_software_control(self, xcvr_api): + """Check if the api object supports software control + + Args: + xcvr_api (object): xcvr api object + + Returns: + bool: True if the api object supports software control + """ + return self.is_cmis_api(xcvr_api) and not xcvr_api.is_flat_memory() + + def check_power_capability(self): + """Check module max power with cage power limit + + Returns: + bool: True if max power does not exceed cage power limit + """ + max_power = self.get_module_max_power() + if max_power < 0: + return False + + power_limit = self.get_power_limit() + logger.log_info(f'SFP {self.sdk_index}: max_power={max_power}, power_limit={power_limit}') + if max_power <= power_limit: + return True + else: + logger.log_error(f'SFP {self.sdk_index} exceed power limit: max_power={max_power}, power_limit={power_limit}') + return False + + def get_power_limit(self): + """Get power limit of this module + + Returns: + int: Power limit in unit of 0.25W + """ + return utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/power_limit') + + def get_module_max_power(self): + """Get module max power from EEPROM + + Returns: + int: max power in terms of 0.25W. Return POWER_CLASS_INVALID if EEPROM data is incorrect. + """ + xcvr_api = self.get_xcvr_api() + if self.is_cmis_api(xcvr_api): + powercap_raw = self.read_eeprom(CMIS_MAX_POWER_OFFSET, 1) + return powercap_raw[0] + elif self.is_sff_api(xcvr_api): + power_class_raw = self.read_eeprom(SFF_POWER_CLASS_OFFSET, 1) + power_class_bit = power_class_raw[0] & SFF_POWER_CLASS_MASK + if power_class_bit in SFF_POWER_CLASS_MAPPING: + powercap = SFF_POWER_CLASS_MAPPING[power_class_bit] + elif power_class_bit == SFF_POWER_CLASS_8_INDICATOR: + # According to standard: + # Byte 128: + # if bit 5 is 1, "Power Class 8 implemented (Max power declared in byte 107)" + # Byte 107: + # "Maximum power consumption of module. Unsigned integer with LSB = 0.1 W." + power_class_8_byte = self.read_eeprom(SFF_POWER_CLASS_8_OFFSET, 1) + powercap = power_class_8_byte[0] * 0.1 + else: + logger.log_error(f'SFP {self.sdk_index} got invalid value for power class field: {power_class_bit}') + return -1 + + # Multiplying the sysfs value (0.25 Watt units) by 4 aligns it with the EEPROM max power value (1 Watt units), + # ensuring both are in the same unit for a meaningful comparison + return powercap * 4 # + else: + # Should never hit, just in case + logger.log_error(f'SFP {self.sdk_index} with api type {xcvr_api} does not support getting max power') + return -1 + + def update_i2c_frequency(self): + """Update I2C frequency for the module. + """ + if self.get_frequency_support(): + api = self.get_xcvr_api() + if self.is_cmis_api(api): + # for CMIS modules, read the module maximum supported clock of Management Comm Interface (MCI) from module EEPROM. + # from byte 2 bits 3-2: + # 00b means module supports up to 400KHz + # 01b means module supports up to 1MHz + logger.log_debug(f"Reading mci max frequency for SFP {self.sdk_index}") + read_mci = self.read_eeprom(CMIS_MCI_EEPROM_OFFSET, 1) + logger.log_debug(f"Read mci max frequency {read_mci[0]} for SFP {self.sdk_index}") + frequency = (read_mci[0] & CMIS_MCI_MASK) >> 2 + elif self.is_sff_api(api): + # for SFF modules, frequency is always 400KHz + frequency = 0 + else: + # Should never hit, just in case + logger.log_error(f'SFP {self.sdk_index} with api type {api} does not support updating frequency but frequency_support sysfs return 1') + return + + logger.log_info(f"Read mci max frequency bits {frequency} for SFP {self.sdk_index}") + self.set_frequency(frequency) + + def get_frequency_support(self): + """Get frequency support for this module + + Returns: + bool: True if supported + """ + return utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/frequency_support') == 1 + + def set_frequency(self, freqeuncy): + """Set module frequency. + + Args: + freqeuncy (int): 0 - up to 400KHz, 1 - up to 1MHz + """ + utils.write_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/frequency', freqeuncy) + + def disable_tx_for_sff_optics(self): + """Disable TX for SFF optics + """ + api = self.get_xcvr_api() + if self.is_sff_api(api) and api.get_tx_disable_support(): + logger.log_info(f'Disabling tx for SFP {self.sdk_index}') + api.tx_disable(True) + + @classmethod + def get_state_machine(cls): + """Get state machine object, create if not exists + + Returns: + object: state machine object + """ + if not cls.sm: + from .state_machine import StateMachine + sm = StateMachine() + sm.add_state(STATE_DOWN).add_transition(EVENT_START, STATE_INIT) + sm.add_state(STATE_INIT).set_entry_action(ACTION_ON_START) \ + .add_transition(EVENT_NOT_PRESENT, STATE_NOT_PRESENT) \ + .add_transition(EVENT_RESET, STATE_RESETTING) \ + .add_transition(EVENT_POWER_ON, STATE_POWERED_ON) \ + .add_transition(EVENT_FW_CONTROL, STATE_FW_CONTROL) # for warm reboot, cable might be in firmware control at startup + sm.add_state(STATE_RESETTING).set_entry_action(ACTION_ON_RESET) \ + .add_transition(EVENT_RESET_DONE, STATE_POWERED_ON) \ + .add_transition(EVENT_NOT_PRESENT, STATE_NOT_PRESENT, ACTION_ON_CANCEL_WAIT) + sm.add_state(STATE_POWERED_ON).set_entry_action(ACTION_ON_POWERED) \ + .add_transition(EVENT_POWER_BAD, STATE_POWER_BAD) \ + .add_transition(EVENT_SW_CONTROL, STATE_SW_CONTROL) \ + .add_transition(EVENT_FW_CONTROL, STATE_FW_CONTROL) + sm.add_state(STATE_SW_CONTROL).set_entry_action(ACTION_ON_SW_CONTROL) \ + .add_transition(EVENT_NOT_PRESENT, STATE_NOT_PRESENT) \ + .add_transition(EVENT_POWER_LIMIT_EXCEED, STATE_POWER_LIMIT_ERROR) \ + .add_transition(EVENT_POWER_BAD, STATE_POWER_BAD) + sm.add_state(STATE_FW_CONTROL).set_entry_action(ACTION_ON_FW_CONTROL) \ + .add_transition(EVENT_NOT_PRESENT, STATE_NOT_PRESENT) + sm.add_state(STATE_POWER_BAD).add_transition(EVENT_POWER_GOOD, STATE_POWERED_ON) \ + .add_transition(EVENT_NOT_PRESENT, STATE_NOT_PRESENT) + sm.add_state(STATE_NOT_PRESENT).add_transition(EVENT_PRESENT, STATE_INIT) + sm.add_state(STATE_POWER_LIMIT_ERROR).set_entry_action(ACTION_ON_POWER_LIMIT_ERROR) \ + .add_transition(EVENT_POWER_GOOD, STATE_POWERED_ON) \ + .add_transition(EVENT_NOT_PRESENT, STATE_NOT_PRESENT) + + cls.action_table = {} + cls.action_table[ACTION_ON_START] = cls.action_on_start + cls.action_table[ACTION_ON_RESET] = cls.action_on_reset + cls.action_table[ACTION_ON_POWERED] = cls.action_on_powered + cls.action_table[ACTION_ON_SW_CONTROL] = cls.action_on_sw_control + cls.action_table[ACTION_ON_FW_CONTROL] = cls.action_on_fw_control + cls.action_table[ACTION_ON_CANCEL_WAIT] = cls.action_on_cancel_wait + cls.action_table[ACTION_ON_POWER_LIMIT_ERROR] = cls.action_on_power_limit_error + + cls.sm = sm + + return cls.sm + + @classmethod + def action_on_start(cls, sfp): + if sfp.get_control_type() == SFP_FW_CONTROL: + logger.log_info(f'SFP {sfp.sdk_index} is already FW control, probably in warm reboot') + sfp.on_event(EVENT_FW_CONTROL) + return + + if not sfp.get_hw_present(): + logger.log_info(f'SFP {sfp.sdk_index} is not present') + sfp.on_event(EVENT_NOT_PRESENT) + return + + if not sfp.get_power_on(): + logger.log_info(f'SFP {sfp.sdk_index} is not powered on') + sfp.set_power(True) + sfp.set_hw_reset(1) + sfp.on_event(EVENT_RESET) + else: + if not sfp.get_reset_state(): + logger.log_info(f'SFP {sfp.sdk_index} is in reset state') + sfp.set_hw_reset(1) + sfp.on_event(EVENT_RESET) + else: + sfp.on_event(EVENT_POWER_ON) + + @classmethod + def action_on_reset(cls, sfp): + logger.log_info(f'SFP {sfp.sdk_index} is scheduled to wait for resetting done') + cls.get_wait_ready_task().schedule_wait(sfp.sdk_index) + + @classmethod + def action_on_powered(cls, sfp): + if not sfp.get_power_good(): + logger.log_error(f'SFP {sfp.sdk_index} is not in power good state') + sfp.on_event(EVENT_POWER_BAD) + return + + control_type = sfp.determine_control_type() + if control_type == SFP_SW_CONTROL: + sfp.on_event(EVENT_SW_CONTROL) + else: + sfp.on_event(EVENT_FW_CONTROL) + + @classmethod + def action_on_sw_control(cls, sfp): + if not sfp.check_power_capability(): + sfp.on_event(EVENT_POWER_LIMIT_EXCEED) + return + + sfp.update_i2c_frequency() + sfp.disable_tx_for_sff_optics() + logger.log_info(f'SFP {sfp.sdk_index} is set to software control') + + @classmethod + def action_on_fw_control(cls, sfp): + logger.log_info(f'SFP {sfp.sdk_index} is set to firmware control') + sfp.set_control_type(SFP_FW_CONTROL) + + @classmethod + def action_on_cancel_wait(cls, sfp): + cls.get_wait_ready_task().cancel_wait(sfp.sdk_index) + + @classmethod + def action_on_power_limit_error(cls, sfp): + logger.log_info(f'SFP {sfp.sdk_index} is powered off due to exceeding power limit') + sfp.set_power(False) + sfp.set_hw_reset(0) + + @classmethod + def get_wait_ready_task(cls): + """Get SFP wait ready task. Create if not exists. + + Returns: + object: an instance of WaitSfpReadyTask + """ + if not cls.wait_ready_task: + from .wait_sfp_ready_task import WaitSfpReadyTask + cls.wait_ready_task = WaitSfpReadyTask() + return cls.wait_ready_task + + def get_state(self): + """Return the current state. + + Returns: + str: current state + """ + return self.state + + def change_state(self, new_state): + """Change from old state to new state + + Args: + new_state (str): new state + """ + self.state = new_state + + def on_action(self, action_name): + """Called when a state machine action is executing + + Args: + action_name (str): action name + """ + SFP.action_table[action_name](self) + + def on_event(self, event): + """Called when a state machine event arrives + + Args: + event (str): State machine event + """ + SFP.get_state_machine().on_event(self, event) + + def in_stable_state(self): + """Indicate whether this module is in a stable state. 'Stable state' means the module is pending on a polling event + from SDK. + + Returns: + bool: True if the module is in a stable state + """ + return self.state in (STATE_NOT_PRESENT, STATE_SW_CONTROL, STATE_FW_CONTROL, STATE_POWER_BAD, STATE_POWER_LIMIT_ERROR) + + def get_fds_for_poling(self): + if self.state == STATE_FW_CONTROL: + return { + 'present': self.get_fd('present') + } + else: + return { + 'hw_present': self.get_fd('hw_present'), + 'power_good': self.get_fd('power_good') + } + + def fill_change_event(self, port_dict): + """Fill change event data based on current state. + + Args: + port_dict (dict): {:} + """ + if self.state == STATE_NOT_PRESENT: + port_dict[self.sdk_index + 1] = SFP_STATUS_REMOVED + elif self.state == STATE_SW_CONTROL: + port_dict[self.sdk_index + 1] = SFP_STATUS_INSERTED + elif self.state == STATE_FW_CONTROL: + port_dict[self.sdk_index + 1] = SFP_STATUS_INSERTED + elif self.state == STATE_POWER_BAD or self.state == STATE_POWER_LIMIT_ERROR: + sfp_state = SFP.SFP_ERROR_BIT_POWER_BUDGET_EXCEEDED | SFP.SFP_STATUS_BIT_INSERTED + port_dict[self.sdk_index + 1] = str(sfp_state) + + def refresh_poll_obj(self, poll_obj, all_registered_fds): + """Refresh polling object and registered fds. This function is usually called when a cable plugin + event occurs. For example, user plugs out a software control module and replaces with a firmware + control cable. In such case, poll_obj was polling "hw_present" and "power_good" for software control, + and it needs to be changed to poll "present" for new control type which is firmware control. + + Args: + poll_obj (object): poll object + all_registered_fds (dict): fds that have been registered to poll object + """ + # find fds registered by this SFP + current_registered_fds = {item[2]: (fileno, item[1]) for fileno, item in all_registered_fds.items() if item[0] == self.sdk_index} + logger.log_debug(f'SFP {self.sdk_index} registered fds are: {current_registered_fds}') + if self.state == STATE_FW_CONTROL: + target_poll_types = ['present'] + else: + target_poll_types = ['hw_present', 'power_good'] + + for target_poll_type in target_poll_types: + if target_poll_type not in current_registered_fds: + # need add new fd for polling + logger.log_debug(f'SFP {self.sdk_index} is registering file descriptor: {target_poll_type}') + fd = self.get_fd(target_poll_type) + poll_obj.register(fd, select.POLLERR | select.POLLPRI) + all_registered_fds[fd.fileno()] = (self.sdk_index, fd, target_poll_type) + else: + # the fd is already in polling + current_registered_fds.pop(target_poll_type) + + for _, item in current_registered_fds.items(): + # Deregister poll, close fd + logger.log_debug(f'SFP {self.sdk_index} is de-registering file descriptor: {item}') + poll_obj.unregister(item[1]) + all_registered_fds.pop(item[0]) + item[1].close() + + def is_dummy_event(self, fd_type, fd_value): + """Check whether an event is dummy event + + Args: + origin_state (str): original state before polling + fd_type (str): polling sysfs type + fd_value (int): polling sysfs value + + Returns: + bool: True if the event is a dummy event + """ + if fd_type == 'hw_present' or fd_type == 'present': + if fd_value == int(SFP_STATUS_INSERTED): + return self.state in (STATE_SW_CONTROL, STATE_FW_CONTROL, STATE_POWER_BAD, STATE_POWER_LIMIT_ERROR) + elif fd_value == int(SFP_STATUS_REMOVED): + return self.state == STATE_NOT_PRESENT + elif fd_type == 'power_good': + if fd_value == 1: + return self.state in (STATE_SW_CONTROL, STATE_NOT_PRESENT, STATE_RESETTING) + else: + return self.state in (STATE_POWER_BAD, STATE_POWER_LIMIT_ERROR, STATE_NOT_PRESENT) + return False + + @classmethod + def initialize_sfp_modules(cls, sfp_list): + """Initialize all modules. Only applicable when module host management is enabled + + Args: + sfp_list (object): all sfps + """ + wait_ready_task = cls.get_wait_ready_task() + wait_ready_task.start() + + for s in sfp_list: + s.on_event(EVENT_START) + + if not wait_ready_task.empty(): + # Wait until wait_ready_task is up + while not wait_ready_task.is_alive(): + pass + + # Resetting SFP requires a reloading of module firmware, it takes up to 3 seconds + # according to standard + max_wait_time = 3.5 + begin = time.time() + while True: + ready_sfp_set = wait_ready_task.get_ready_set() + for sfp_index in ready_sfp_set: + s = sfp_list[sfp_index] + logger.log_debug(f'SFP {sfp_index} is recovered from resetting state') + s.on_event(EVENT_RESET_DONE) + elapse = time.time() - begin + if elapse < max_wait_time: + time.sleep(0.5) + else: + break + + # Verify that all modules are in a stable state + for index, s in enumerate(sfp_list): + if not s.in_stable_state(): + logger.log_error(f'SFP {index} is not in stable state after initializing, state={s.state}') + logger.log_notice(f'SFP {index} is in state {s.state} after module initialization') class RJ45Port(NvidiaSFPCommon): @@ -1262,3 +1924,17 @@ def reinit(self): :return: """ return + + def get_module_status(self): + """Get value of sysfs status. It could return: + SXD_PMPE_MODULE_STATUS_PLUGGED_ENABLED_E = 0x1, + SXD_PMPE_MODULE_STATUS_UNPLUGGED_E = 0x2, + SXD_PMPE_MODULE_STATUS_MODULE_PLUGGED_ERROR_E = 0x3, + SXD_PMPE_MODULE_STATUS_PLUGGED_DISABLED_E = 0x4, + SXD_PMPE_MODULE_STATUS_UNKNOWN_E = 0x5, + + Returns: + str: sonic status of the module + """ + status = super().get_module_status() + return SFP_STATUS_REMOVED if status == SFP_STATUS_UNKNOWN else status diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp_event.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp_event.py deleted file mode 100644 index 133001020495..000000000000 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp_event.py +++ /dev/null @@ -1,409 +0,0 @@ -# -# Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES. -# Apache-2.0 -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -''' -listen to the SDK for the SFP change event and return to chassis. -''' - - -import sys, errno -import os -import time -import select - -from .device_data import DeviceDataManager -try: - if 'PLATFORM_API_UNIT_TESTING' not in os.environ: - from python_sdk_api.sx_api import * - else: - from mock import MagicMock - class MockSxFd(object): - fd = 99 - new_sx_fd_t_p = MagicMock(return_value=MockSxFd()) - new_sx_user_channel_t_p = MagicMock() -except KeyError: - pass -from sonic_py_common.logger import Logger -from .sfp import SFP - -# SFP status from PMAOS register -# 0x1 plug in -# 0x2 plug out -# 0x3 plug in with error -# 0x4 disabled, at this status SFP eeprom is not accessible, -# and presence status also will be not present, -# so treate it as plug out. -SDK_SFP_STATE_IN = 0x1 -SDK_SFP_STATE_OUT = 0x2 -SDK_SFP_STATE_ERR = 0x3 -SDK_SFP_STATE_DIS = 0x4 -SDK_SFP_STATE_UNKNOWN = 0x5 - -# SFP status used in this file only, will not expose to XCVRD -# STATUS_ERROR will be mapped to different status according to the error code -STATUS_UNKNOWN = '-1' -STATUS_ERROR = '-2' - -# SFP error code, only valid when SFP at SDK_SFP_STATE_ERR status -# Only 0x2, 0x3, 0x5, 0x6 and 0x7 will block the eeprom access, -# so will only report above errors to XCVRD and other errors will be -# printed to syslog. - -''' -0x0: "Power_Budget_Exceeded", -0x1: "Long_Range_for_non_MLNX_cable_or_module", -0x2: "Bus_stuck", -0x3: "bad_or_unsupported_EEPROM", -0x4: "Enforce_part_number_list", -0x5: "unsupported_cable", -0x6: "High_Temperature", -0x7: "bad_cable", -0x8: "PMD_type_is_not_enabled", -0x9: "[internal]Laster_TEC_failure", -0xa: "[internal]High_current", -0xb: "[internal]High_voltage", -0xd: "[internal]High_power", -0xe: "[internal]Module_state_machine_fault", -0xc: "pcie_system_power_slot_Exceeded" -''' - -# SFP errors that will block eeprom accessing -SDK_SFP_BLOCKING_ERRORS = [ - 0x2, # SFP.SFP_ERROR_BIT_I2C_STUCK, - 0x3, # SFP.SFP_ERROR_BIT_BAD_EEPROM, - 0x5, # SFP.SFP_ERROR_BIT_UNSUPPORTED_CABLE, - 0x6, # SFP.SFP_ERROR_BIT_HIGH_TEMP, - 0x7, # SFP.SFP_ERROR_BIT_BAD_CABLE -] - -SDK_ERRORS_TO_ERROR_BITS = { - 0x0: SFP.SFP_ERROR_BIT_POWER_BUDGET_EXCEEDED, - 0x1: SFP.SFP_MLNX_ERROR_BIT_LONGRANGE_NON_MLNX_CABLE, - 0x2: SFP.SFP_ERROR_BIT_I2C_STUCK, - 0x3: SFP.SFP_ERROR_BIT_BAD_EEPROM, - 0x4: SFP.SFP_MLNX_ERROR_BIT_ENFORCE_PART_NUMBER_LIST, - 0x5: SFP.SFP_ERROR_BIT_UNSUPPORTED_CABLE, - 0x6: SFP.SFP_ERROR_BIT_HIGH_TEMP, - 0x7: SFP.SFP_ERROR_BIT_BAD_CABLE, - 0x8: SFP.SFP_MLNX_ERROR_BIT_PMD_TYPE_NOT_ENABLED, - 0xc: SFP.SFP_MLNX_ERROR_BIT_PCIE_POWER_SLOT_EXCEEDED -} - -SDK_ERRORS_TO_DESCRIPTION = { - 0x1: SFP.SFP_MLNX_ERROR_DESCRIPTION_LONGRANGE_NON_MLNX_CABLE, - 0x4: SFP.SFP_MLNX_ERROR_DESCRIPTION_ENFORCE_PART_NUMBER_LIST, - 0x8: SFP.SFP_MLNX_ERROR_DESCRIPTION_PMD_TYPE_NOT_ENABLED, - 0xc: SFP.SFP_MLNX_ERROR_DESCRIPTION_PCIE_POWER_SLOT_EXCEEDED -} - -sfp_value_status_dict = { - SDK_SFP_STATE_IN: str(SFP.SFP_STATUS_BIT_INSERTED), - SDK_SFP_STATE_OUT: str(SFP.SFP_STATUS_BIT_REMOVED), - SDK_SFP_STATE_ERR: STATUS_ERROR, - SDK_SFP_STATE_DIS: str(SFP.SFP_STATUS_BIT_REMOVED), -} - -# system level event/error -EVENT_ON_ALL_SFP = '-1' -SYSTEM_NOT_READY = 'system_not_ready' -SYSTEM_READY = 'system_become_ready' -SYSTEM_FAIL = 'system_fail' - -SDK_DAEMON_READY_FILE = '/tmp/sdk_ready' - -PMPE_PACKET_SIZE = 2000 - -logger = Logger() - -class sfp_event: - ''' Listen to plugin/plugout cable events ''' - - SX_OPEN_RETRIES = 30 - SX_OPEN_TIMEOUT = 5 - SELECT_TIMEOUT = 1 - - def __init__(self, rj45_port_list=None): - self.swid = 0 - self.handle = None - - # Allocate SDK fd and user channel structures - self.rx_fd_p = new_sx_fd_t_p() - self.user_channel_p = new_sx_user_channel_t_p() - if rj45_port_list: - self.RJ45_port_set = set(rj45_port_list) - else: - self.RJ45_port_set = set() - - def initialize(self): - swid_cnt_p = None - - try: - # Wait for SDK daemon to be started with detect the sdk_ready file - retry = 0 - while not os.path.exists(SDK_DAEMON_READY_FILE): - if retry >= self.SX_OPEN_RETRIES: - raise RuntimeError("SDK daemon failed to start after {} retries and {} seconds waiting, exiting..." - .format(retry, self.SX_OPEN_TIMEOUT * self.SX_OPEN_RETRIES)) - else: - logger.log_info("SDK daemon not started yet, retry {} times".format(retry)) - retry += 1 - time.sleep(self.SX_OPEN_TIMEOUT) - - # After SDK daemon started, sx_api_open and sx_api_host_ifc_open is ready for call - rc, self.handle = sx_api_open(None) - if rc != SX_STATUS_SUCCESS: - raise RuntimeError("failed to call sx_api_open with rc {}, exiting...".format(rc)) - - rc = sx_api_host_ifc_open(self.handle, self.rx_fd_p) - if rc != SX_STATUS_SUCCESS: - raise RuntimeError("failed to call sx_api_host_ifc_open with rc {}, exiting...".format(rc)) - - self.user_channel_p.type = SX_USER_CHANNEL_TYPE_FD - self.user_channel_p.channel.fd = self.rx_fd_p - - # Wait for switch to be created and initialized inside SDK - retry = 0 - swid_cnt_p = new_uint32_t_p() - uint32_t_p_assign(swid_cnt_p, 0) - swid_cnt = 0 - while True: - if retry >= self.SX_OPEN_RETRIES: - raise RuntimeError("switch not created after {} retries and {} seconds waiting, exiting..." - .format(retry, self.SX_OPEN_RETRIES * self.SX_OPEN_TIMEOUT)) - else: - rc = sx_api_port_swid_list_get(self.handle, None, swid_cnt_p) - if rc == SX_STATUS_SUCCESS: - swid_cnt = uint32_t_p_value(swid_cnt_p) - if swid_cnt > 0: - delete_uint32_t_p(swid_cnt_p) - swid_cnt_p = None - break - else: - logger.log_info("switch not created yet, swid_cnt {}, retry {} times and wait for {} seconds" - .format(swid_cnt, retry, self.SX_OPEN_TIMEOUT * retry)) - else: - raise RuntimeError("sx_api_port_swid_list_get fail with rc {}, retry {} times and wait for {} seconds". - format(rc, retry, self.SX_OPEN_TIMEOUT * retry)) - - retry += 1 - time.sleep(self.SX_OPEN_TIMEOUT) - - # After switch was created inside SDK, sx_api_host_ifc_trap_id_register_set is ready to call - rc = sx_api_host_ifc_trap_id_register_set(self.handle, - SX_ACCESS_CMD_REGISTER, - self.swid, - SX_TRAP_ID_PMPE, - self.user_channel_p) - - if rc != SX_STATUS_SUCCESS: - raise RuntimeError("sx_api_host_ifc_trap_id_register_set failed with rc {}, exiting...".format(rc)) - except Exception as e: - logger.log_error("sfp_event initialization failed due to {}, exiting...".format(repr(e))) - if swid_cnt_p is not None: - delete_uint32_t_p(swid_cnt_p) - self.deinitialize() - - def deinitialize(self): - if self.handle is None: - return - - # unregister trap id - rc = sx_api_host_ifc_trap_id_register_set(self.handle, - SX_ACCESS_CMD_DEREGISTER, - self.swid, - SX_TRAP_ID_PMPE, - self.user_channel_p) - if rc != SX_STATUS_SUCCESS: - logger.log_error("sx_api_host_ifc_trap_id_register_set exited with error, rc {}".format(rc)) - - rc = sx_api_host_ifc_close(self.handle, self.rx_fd_p) - if rc != SX_STATUS_SUCCESS: - logger.log_error("sx_api_host_ifc_close exited with error, rc {}".format(rc)) - - rc = sx_api_close(self.handle) - if rc != SX_STATUS_SUCCESS: - logger.log_error("sx_api_close exited with error, rc {}".format(rc)) - - delete_sx_fd_t_p(self.rx_fd_p) - delete_sx_user_channel_t_p(self.user_channel_p) - - def check_sfp_status(self, port_change, error_dict, timeout): - """ - the meaning of timeout is aligned with select.select, which has the following meaning: - 0: poll, returns without blocked - arbitrary positive value: doesn't returns until at least fd in the set is ready or - seconds elapsed - Note: - check_sfp_status makes the use of select to retrieve the notifications, which means - it should has the logic of reading out all the notifications in the fd selected without blocked. - However, it fails to do that due to some sdk API's characteristics: - sx_lib_host_ifc_recv can only read one notification each time and will block when no notification in that fd. - sx_lib_host_ifc_recv_list can return all notification in the fd via a single reading operation but - not supported by PMPE register (I've tested it but failed) - as a result the only way to satisfy the logic is to call sx_lib_host_ifc_recv in a loop until all notifications - has been read and we have to find a way to check that. it seems the only way to check that is via using select. - in this sense, we return one notification each time check_sfp_status called and let the caller, get_change_event, - to repeat calling it with timeout = 0 in a loop until no new notification read (in this case it returns false). - by doing so all the notifications in the fd can be retrieved through a single call to get_change_event. - """ - found = 0 - - try: - read, _, _ = select.select([self.rx_fd_p.fd], [], [], float(timeout) / 1000) - print(read) - except select.error as err: - rc, msg = err - if rc == errno.EAGAIN or rc == errno.EINTR: - return False - else: - raise - - for fd in read: - if fd == self.rx_fd_p.fd: - success, port_list, module_state, error_type = self.on_pmpe(self.rx_fd_p) - print('success = ', success) - if not success: - logger.log_error("failed to read from {}".format(fd)) - break - - sfp_state = sfp_value_status_dict.get(module_state, STATUS_UNKNOWN) - error_description = None - if sfp_state == STATUS_UNKNOWN: - # in the following sequence, STATUS_UNKNOWN can be returned. - # so we shouldn't raise exception here. - # 1. some sfp module is inserted - # 2. sfp_event gets stuck and fails to fetch the change event instantaneously - # 3. and then the sfp module is removed - # 4. sfp_event starts to try fetching the change event - # in this case found is increased so that True will be returned - logger.log_info("unknown module state {}, maybe the port suffers two adjacent insertion/removal".format(module_state)) - found += 1 - continue - - # If get SFP status error(0x3) from SDK, then need to read the error_type to get the detailed error - if sfp_state == STATUS_ERROR: - sfp_state_bits = SDK_ERRORS_TO_ERROR_BITS.get(error_type) - if sfp_state_bits is None: - logger.log_error("Unrecognized error {} detected on ports {}".format(error_type, port_list)) - found += 1 - continue - - if error_type in SDK_SFP_BLOCKING_ERRORS: - # In SFP at error status case, need to overwrite the sfp_state with the exact error code - sfp_state_bits |= SFP.SFP_ERROR_BIT_BLOCKING - - # An error should be always set along with 'INSERTED' - sfp_state_bits |= SFP.SFP_STATUS_BIT_INSERTED - - # For vendor specific errors, the description should be returned as well - error_description = SDK_ERRORS_TO_DESCRIPTION.get(error_type) - - sfp_state = str(sfp_state_bits) - - for port in port_list: - logger.log_info("SFP on port {} state {}".format(port, sfp_state)) - port_change[port+1] = sfp_state - if error_description: - error_dict[port+1] = error_description - found += 1 - - return found != 0 - - def on_pmpe(self, fd_p): - ''' on port module plug event handler ''' - - # recv parameters - pkt_size = PMPE_PACKET_SIZE - pkt_size_p = new_uint32_t_p() - uint32_t_p_assign(pkt_size_p, pkt_size) - pkt = new_uint8_t_arr(pkt_size) - recv_info_p = new_sx_receive_info_t_p() - pmpe_t = sx_event_pmpe_t() - port_cnt_p = new_uint32_t_p() - uint32_t_p_assign(port_cnt_p, 0) - label_port_list = [] - module_state = 0 - error_type = pmpe_t.error_type - - rc = sx_lib_host_ifc_recv(fd_p, pkt, pkt_size_p, recv_info_p) - if rc != 0: - logger.log_error("sx_lib_host_ifc_recv exited with error, rc %d" % rc) - status = False - else: - status = True - unknown = False - pmpe_t = recv_info_p.event_info.pmpe - port_list_size = pmpe_t.list_size - logical_port_list = pmpe_t.log_port_list - module_state = pmpe_t.module_state - error_type = pmpe_t.error_type - module_id = pmpe_t.module_id - slot_id = pmpe_t.slot_id # For non-modular chassis, it should return 0 - - if module_state == SDK_SFP_STATE_ERR: - logger.log_error("Receive PMPE error event on module {}: status {} error type {}".format(module_id, module_state, error_type)) - elif module_state == SDK_SFP_STATE_DIS: - logger.log_notice("Receive PMPE disable event on module {}: status {}".format(module_id, module_state)) - elif module_state == SDK_SFP_STATE_IN or module_state == SDK_SFP_STATE_OUT: - logger.log_notice("Receive PMPE plug in/out event on module {}: status {}".format(module_id, module_state)) - elif module_state == SDK_SFP_STATE_UNKNOWN: - unknown = True - else: - logger.log_error("Receive PMPE unknown event on module {}: status {}".format(module_id, module_state)) - - # Call sx_api_port_device_get with port_cnt_p=0, SDK will return the logical port number - rc = sx_api_port_device_get(self.handle, 1, 0, None, port_cnt_p) - if rc != SX_STATUS_SUCCESS: - logger.log_error("Failed to get logical port number") - status = False - else: - 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(self.handle, 1, 0, port_attributes_list, port_cnt_p) - if rc != SX_STATUS_SUCCESS: - logger.log_error("Failed to get logical port attributes") - status = False - else: - for i in range(port_list_size): - label_port = None - logical_port = sx_port_log_id_t_arr_getitem(logical_port_list, i) - for j in range(port_cnt): - port_attributes = sx_port_attributes_t_arr_getitem(port_attributes_list,j) - if port_attributes.log_port == logical_port: - label_port = slot_id * DeviceDataManager.get_linecard_max_port_count() + port_attributes.port_mapping.module_port - break - - if label_port is not None: - label_port_list.append(label_port) - delete_sx_port_attributes_t_arr(port_attributes_list) - - if unknown: - SFP_ports_with_unknown_event = set(label_port_list) - self.RJ45_port_set - if SFP_ports_with_unknown_event: - logger.log_error("Receive PMPE unknown event on module {}: status {}".format(module_id, module_state)) - else: - # For RJ45 ports, we treat unknown as disconnect - module_state = SDK_SFP_STATE_DIS - - delete_uint32_t_p(pkt_size_p) - delete_uint8_t_arr(pkt) - delete_sx_receive_info_t_p(recv_info_p) - delete_uint32_t_p(port_cnt_p) - - if not label_port_list: - logger.log_error('Dropping PMPE event due to label port not found') - - return status, label_port_list, module_state, error_type diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/state_machine.py b/platform/mellanox/mlnx-platform-api/sonic_platform/state_machine.py new file mode 100644 index 000000000000..d7b6faf10c37 --- /dev/null +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/state_machine.py @@ -0,0 +1,168 @@ +# +# Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. +# Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +from sonic_py_common.logger import Logger + +logger = Logger() + + +class State: + """Represent a state in a state machine + """ + def __init__(self, name): + self.name = name + self.entry_action = None + self.leave_action = None + self.transitions = {} + self.event_actions = {} + + def set_entry_action(self, action_name): + """Set an action when entering this state + + Args: + action_name (str): action name + + Returns: + object: self + """ + self.entry_action = action_name + return self + + def set_leave_action(self, action_name): + """Set a leave action when leaving the state + + Args: + action_name (str): action name + + Returns: + object: self + """ + self.leave_action = action_name + return self + + def add_transition(self, event, next_state, event_action=None): + """Add a transition item to this state + + Args: + event (str): event name + next_state (str): next state that the state entity will transit to upon this event. + event_action (str): action called when event arrives + + Raises: + RuntimeError: raise if the event is already in the transition table + + Returns: + object: self + """ + if event in self.transitions: + raise RuntimeError(f'event {event} already exists in transition table of state {self.name}') + + self.transitions[event] = next_state + + if event_action: + if event in self.event_actions: + raise RuntimeError(f'event {event} already exists in action table of state {self.name}') + self.event_actions[event] = event_action + return self + + def on_enter(self, entity): + """Called when state entity enters the state + + Args: + entity (obj): state entity + """ + if self.entry_action: + logger.log_debug(f'{entity} entered state [{self.name}] and is triggering action [{self.entry_action}]') + entity.on_action(self.entry_action) + else: + logger.log_debug(f'{entity} entered state [{self.name}]') + + def on_leave(self, entity): + """Called when state entity leaves the state + + Args: + entity (obj): state entity + """ + if self.leave_action: + entity.on_action(self.leave_action) + + def on_event(self, entity, event): + """Called when state entity has got an event + + Args: + entity (object): state entity + event (str): event name + + Returns: + str: next event name + """ + if event not in self.transitions: + logger.log_error(f'{event} is not defined in state {self.name}') + return self.name + else: + if event in self.event_actions: + entity.on_action(self.event_actions[event]) + return self.transitions[event] + + +class StateMachine: + def __init__(self): + self.states = {} + + def add_state(self, state_name): + """Register a state to state machine + + Args: + state_name (str): name of the state + + Raises: + RuntimeError: raise if state name already exists + + Returns: + object: the new state object + """ + if state_name in self.states: + raise RuntimeError(f'state {state_name} already exists') + + state = State(state_name) + self.states[state_name] = state + return state + + def on_event(self, entity, event): + """Called when an event occurs + + Args: + entity (object): state entity + event (str): event name + + Raises: + RuntimeError: raise if the current state is not registered + RuntimeError: raise if next state is not registered + """ + current_state_name = entity.get_state() + if current_state_name not in self.states: + raise RuntimeError(f'Unknown state {current_state_name}') + + current_state = self.states[current_state_name] + next_state_name = current_state.on_event(entity, event) + logger.log_debug(f'{entity} has got event [{event}], it is changing from state [{current_state}] to [{next_state_name}]') + if next_state_name not in self.states: + raise RuntimeError(f'Unknown next state {next_state_name}') + if next_state_name != current_state_name: + current_state.on_leave(entity) + entity.change_state(next_state_name) + self.states[next_state_name].on_enter(entity) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_manager.py b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_manager.py index 5c118b4c9a07..3512a0cf52e5 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_manager.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_manager.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -33,7 +33,7 @@ def initialize(cls): and any other vendor specific initialization. :return: """ - if DeviceDataManager.is_independent_mode(): + if DeviceDataManager.is_module_host_management_mode(): from .chassis import Chassis cls.thermal_updater_task = thermal_updater.ThermalUpdater(Chassis.chassis_instance.get_all_sfps()) cls.thermal_updater_task.start() @@ -46,5 +46,5 @@ def deinitialize(cls): is a no-op. :return: """ - if DeviceDataManager.is_independent_mode() and cls.thermal_updater_task: + if DeviceDataManager.is_module_host_management_mode() and cls.thermal_updater_task: cls.thermal_updater_task.stop() diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_updater.py b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_updater.py index f2f0f75b2fd1..889bc96d3bec 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_updater.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_updater.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2023-2024 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -81,10 +81,6 @@ def load_tc_config(self): def start(self): self.clean_thermal_data() - if not self.wait_all_sfp_ready(): - logger.log_error('Failed to wait for all SFP ready, will put hw-management-tc to suspend') - self.control_tc(True) - return self.control_tc(False) self.load_tc_config() self._timer.start() @@ -106,25 +102,6 @@ def clean_thermal_data(self): sfp.sdk_index + 1 ) - def wait_all_sfp_ready(self): - logger.log_notice('Waiting for all SFP modules ready...') - max_wait_time = 300 - ready_set = set() - while len(ready_set) != len(self._sfp_list): - for sfp in self._sfp_list: - try: - sfp.is_sw_control() - ready_set.add(sfp) - except: - continue - max_wait_time -= 1 - if max_wait_time == 0: - return False - time.sleep(1) - - logger.log_notice('All SFP modules are ready') - return True - def get_asic_temp(self): temperature = utils.read_int_from_file('/sys/module/sx_core/asic0/temperature/input', default=None) return temperature * ASIC_TEMPERATURE_SCALE if temperature is not None else None diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/utils.py b/platform/mellanox/mlnx-platform-api/sonic_platform/utils.py index a7354ac7b864..77aad4a315c7 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/utils.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/utils.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -282,11 +282,13 @@ def wait_until(predict, timeout, interval=1, *args, **kwargs): Returns: _type_: _description_ """ + if predict(*args, **kwargs): + return True while timeout > 0: - if predict(*args, **kwargs): - return True time.sleep(interval) timeout -= interval + if predict(*args, **kwargs): + return True return False diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/wait_sfp_ready_task.py b/platform/mellanox/mlnx-platform-api/sonic_platform/wait_sfp_ready_task.py new file mode 100644 index 000000000000..56b1f479fd44 --- /dev/null +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/wait_sfp_ready_task.py @@ -0,0 +1,139 @@ +# +# Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. +# Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +import copy +import threading +import time +from sonic_py_common.logger import Logger + +logger = Logger() +EMPTY_SET = set() + + +class WaitSfpReadyTask(threading.Thread): + """When bring a module from powered off to powered on, it takes 3 seconds + for module to load its firmware. This class is designed to perform a wait for + those modules who are loading firmware. + """ + WAIT_TIME = 3 + + def __init__(self): + # Set daemon to True so that the thread will be destroyed when daemon exits. + super().__init__(daemon=True) + self.running = False + + # Lock to protect the wait list + self.lock = threading.Lock() + + # Event to wake up thread function + self.event = threading.Event() + + # A list of SFP to be waited. Key is SFP index, value is the expire time. + self._wait_dict = {} + + # The queue to store those SFPs who finish loading firmware. + self._ready_set = set() + + def stop(self): + """Stop the task, only used in unit test + """ + self.running = False + self.event.set() + + def schedule_wait(self, sfp_index): + """Add a SFP to the wait list + + Args: + sfp_index (int): the index of the SFP object + """ + logger.log_debug(f'SFP {sfp_index} is scheduled for waiting reset done') + with self.lock: + if len(self._wait_dict) == 0: + is_empty = True + # The item will be expired in 3 seconds + self._wait_dict[sfp_index] = time.time() + self.WAIT_TIME + + if is_empty: + logger.log_debug('An item arrives, wake up WaitSfpReadyTask') + # wake up the thread + self.event.set() + + def cancel_wait(self, sfp_index): + """Cancel a SFP from the wait list + + Args: + sfp_index (int): the index of the SFP object + """ + logger.log_debug(f'SFP {sfp_index} is canceled for waiting reset done') + with self.lock: + if sfp_index in self._wait_dict: + self._wait_dict.pop(sfp_index) + if sfp_index in self._ready_set: + self._ready_set.pop(sfp_index) + + def get_ready_set(self): + """Get ready set and clear it + + Returns: + set: a deep copy of self._ready_set + """ + with self.lock: + if not self._ready_set: + return EMPTY_SET + ready_set = copy.deepcopy(self._ready_set) + self._ready_set.clear() + return ready_set + + def empty(self): + """Indicate if wait_dict is empty + + Returns: + bool: True if wait_dict is empty + """ + with self.lock: + return len(self._wait_dict) == 0 + + def run(self): + """Thread function + """ + self.running = True + pending_remove_set = set() + is_empty = True + while self.running: + if is_empty: + logger.log_debug(f'WaitSfpReadyTask is waiting for task...') + # If wait_dict is empty, hold the thread until an item coming + self.event.wait() + self.event.clear() + + now = time.time() + with self.lock: + logger.log_debug(f'Processing wait SFP dict: {self._wait_dict}, now={now}') + for sfp_index, expire_time in self._wait_dict.items(): + # If now time is greater than the expire time, remove + # the item from wait_dict + if now >= expire_time: + pending_remove_set.add(sfp_index) + + for sfp_index in pending_remove_set: + self._wait_dict.pop(sfp_index) + self._ready_set.add(sfp_index) + + is_empty = (len(self._wait_dict) == 0) + + pending_remove_set.clear() + time.sleep(1) diff --git a/platform/mellanox/mlnx-platform-api/tests/test_change_event.py b/platform/mellanox/mlnx-platform-api/tests/test_change_event.py new file mode 100644 index 000000000000..0d3429c483de --- /dev/null +++ b/platform/mellanox/mlnx-platform-api/tests/test_change_event.py @@ -0,0 +1,220 @@ +# +# Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. +# Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +import os +import sys + +if sys.version_info.major == 3: + from unittest import mock +else: + import mock + +test_path = os.path.dirname(os.path.abspath(__file__)) +modules_path = os.path.dirname(test_path) +sys.path.insert(0, modules_path) + +from sonic_platform import chassis +from sonic_platform import sfp + + +class TestChangeEvent: + @mock.patch('sonic_platform.sfp.SFP.get_fd_for_polling_legacy') + @mock.patch('select.poll') + @mock.patch('time.time') + @mock.patch('sonic_platform.device_data.DeviceDataManager.is_module_host_management_mode', mock.MagicMock(return_value=False)) + @mock.patch('sonic_platform.device_data.DeviceDataManager.get_sfp_count', mock.MagicMock(return_value=1)) + @mock.patch('sonic_platform.chassis.extract_RJ45_ports_index', mock.MagicMock(return_value=[])) + @mock.patch('sonic_platform.sfp.SFP.get_module_status') + def test_get_change_event_legacy(self, mock_status, mock_time, mock_create_poll, mock_get_fd): + c = chassis.Chassis() + s = c.get_sfp(1) + + mock_status.return_value = sfp.SFP_STATUS_INSERTED + + # mock poll object + mock_poll = mock.MagicMock() + mock_create_poll.return_value = mock_poll + mock_poll.poll = mock.MagicMock(return_value = []) + + # mock file descriptor for polling + mock_file = mock.MagicMock() + mock_get_fd.return_value = mock_file + mock_file.fileno = mock.MagicMock(return_value = 1) + + timeout = 1000 + # mock time function so that the while loop exit early + mock_time.side_effect = [0, timeout] + + # no event, expect returning empty change event + _, change_event = c.get_change_event(timeout) + assert 'sfp' in change_event and not change_event['sfp'] + + # dummy event, expect returning empty change event + sfp_index = s.sdk_index + 1 + mock_poll.poll.return_value = [(1, 10)] + mock_time.side_effect = [0, timeout] + _, change_event = c.get_change_event(timeout) + assert 'sfp' in change_event and not change_event['sfp'] + + # plug out event, expect returning remove event + mock_time.side_effect = [0, timeout] + mock_status.return_value = sfp.SFP_STATUS_REMOVED + _, change_event = c.get_change_event(timeout) + assert 'sfp' in change_event and sfp_index in change_event['sfp'] and change_event['sfp'][sfp_index] == sfp.SFP_STATUS_REMOVED + + # error event, expect returning error event + mock_time.side_effect = [0, timeout] + mock_status.return_value = sfp.SFP_STATUS_ERROR + s.get_error_info_from_sdk_error_type = mock.MagicMock(return_value=('2', 'some error')) + _, change_event = c.get_change_event(timeout) + assert 'sfp' in change_event and sfp_index in change_event['sfp'] and change_event['sfp'][sfp_index] == '2' + assert 'sfp_error' in change_event and sfp_index in change_event['sfp_error'] and change_event['sfp_error'][sfp_index] == 'some error' + + @mock.patch('sonic_platform.sfp.SFP.get_fd') + @mock.patch('select.poll') + @mock.patch('time.time') + @mock.patch('sonic_platform.device_data.DeviceDataManager.is_module_host_management_mode', mock.MagicMock(return_value=True)) + @mock.patch('sonic_platform.device_data.DeviceDataManager.get_sfp_count', mock.MagicMock(return_value=1)) + @mock.patch('sonic_platform.chassis.extract_RJ45_ports_index', mock.MagicMock(return_value=[])) + @mock.patch('sonic_platform.module_host_mgmt_initializer.ModuleHostMgmtInitializer.initialize', mock.MagicMock()) + def test_get_change_event_for_module_host_management_mode(self, mock_time, mock_create_poll, mock_get_fd): + """Test steps: + 1. Simulate polling with no event + 2. Simulate polling the first dummy event. (SDK always return a event when first polling the fd even if there is no change) + 3. Simulate a plug out event, module transfer from sw control to not present + 4. Simulate plugging in a fw control module, module transfer to fw control + 5. Simulate an error event + 6. Simulate a plug out event, module transfer from fw control to not present + 7. Simulate plugging in a sw control module, module transfer to sw control + 8. Simulate a power bad event, module transfer from sw control to power bad + 9. Simulate a power good event, module transfer from power bad to sw control + """ + c = chassis.Chassis() + c.initialize_sfp() + s = c._sfp_list[0] + s.state = sfp.STATE_SW_CONTROL + + # mock poll object + mock_poll = mock.MagicMock() + mock_create_poll.return_value = mock_poll + mock_poll.poll = mock.MagicMock(return_value = []) + + # mock file descriptors for polling + mock_hw_present_file = mock.MagicMock() + mock_power_good_file = mock.MagicMock() + mock_present_file = mock.MagicMock() + mock_hw_present_file.read = mock.MagicMock(return_value=sfp.SFP_STATUS_INSERTED) + mock_hw_present_file.fileno = mock.MagicMock(return_value = 1) + mock_power_good_file.read = mock.MagicMock(return_value=1) + mock_power_good_file.fileno = mock.MagicMock(return_value = 2) + mock_present_file.read = mock.MagicMock(return_value=sfp.SFP_STATUS_INSERTED) + mock_present_file.fileno = mock.MagicMock(return_value = 3) + def get_fd(fd_type): + if fd_type == 'hw_present': + return mock_hw_present_file + elif fd_type == 'power_good': + return mock_power_good_file + else: + return mock_present_file + mock_get_fd.side_effect = get_fd + + timeout = 1000 + # mock time function so that the while loop exit early + mock_time.side_effect = [0, timeout] + + # no event, expect returning empty change event + _, change_event = c.get_change_event(timeout) + assert 'sfp' in change_event and not change_event['sfp'] + + # dummy event, expect returning empty change event + sfp_index = s.sdk_index + 1 + mock_poll.poll.return_value = [(1, 10)] + mock_time.side_effect = [0, timeout] + _, change_event = c.get_change_event(timeout) + assert 'sfp' in change_event and not change_event['sfp'] + + # plug out event, expect returning remove event + mock_time.side_effect = [0, timeout] + mock_hw_present_file.read.return_value = sfp.SFP_STATUS_REMOVED + _, change_event = c.get_change_event(timeout) + assert 'sfp' in change_event and sfp_index in change_event['sfp'] and change_event['sfp'][sfp_index] == sfp.SFP_STATUS_REMOVED + assert s.state == sfp.STATE_NOT_PRESENT + + # plug in with a fw control cable, expect returning insert event + s.get_control_type = mock.MagicMock(return_value=sfp.SFP_SW_CONTROL) + s.get_hw_present = mock.MagicMock(return_value=True) + s.get_power_on = mock.MagicMock(return_value=True) + s.get_reset_state = mock.MagicMock(return_value=True) + s.get_power_good = mock.MagicMock(return_value=True) + s.determine_control_type = mock.MagicMock(return_value=sfp.SFP_FW_CONTROL) + s.set_control_type = mock.MagicMock() + mock_time.side_effect = [0, timeout] + mock_hw_present_file.read.return_value = sfp.SFP_STATUS_INSERTED + _, change_event = c.get_change_event(timeout) + assert 'sfp' in change_event and sfp_index in change_event['sfp'] and change_event['sfp'][sfp_index] == sfp.SFP_STATUS_INSERTED + assert s.state == sfp.STATE_FW_CONTROL + assert 1 not in c.registered_fds # stop polling hw_present + assert 2 not in c.registered_fds # stop polling power_good + assert 3 in c.registered_fds # start polling present because it is firmware control + print(c.registered_fds) + + # error event, expect returning error + mock_time.side_effect = [0, timeout] + mock_poll.poll.return_value = [(3, 10)] + mock_present_file.read.return_value = sfp.SFP_STATUS_ERROR + s.get_error_info_from_sdk_error_type = mock.MagicMock(return_value=('2', 'some error')) + _, change_event = c.get_change_event(timeout) + assert 'sfp' in change_event and sfp_index in change_event['sfp'] and change_event['sfp'][sfp_index] == '2' + assert 'sfp_error' in change_event and sfp_index in change_event['sfp_error'] and change_event['sfp_error'][sfp_index] == 'some error' + + # plug out the firmware control cable, expect returning remove event + mock_time.side_effect = [0, timeout] + mock_present_file.read.return_value = sfp.SFP_STATUS_REMOVED + _, change_event = c.get_change_event(timeout) + assert 'sfp' in change_event and sfp_index in change_event['sfp'] and change_event['sfp'][sfp_index] == sfp.SFP_STATUS_REMOVED + assert s.state == sfp.STATE_NOT_PRESENT + assert 1 in c.registered_fds # start polling hw_present because cable is not present, always assume software control + assert 2 in c.registered_fds # start polling power_good because cable is not present, always assume software control + assert 3 not in c.registered_fds # stop polling present + + # plug in a software control cable, expect returning insert event + mock_time.side_effect = [0, timeout] + mock_poll.poll.return_value = [(1, 10)] + mock_hw_present_file.read.return_value = sfp.SFP_STATUS_INSERTED + s.determine_control_type.return_value = sfp.SFP_SW_CONTROL + s.check_power_capability = mock.MagicMock(return_value=True) + s.update_i2c_frequency = mock.MagicMock() + s.disable_tx_for_sff_optics = mock.MagicMock() + _, change_event = c.get_change_event(timeout) + assert 'sfp' in change_event and sfp_index in change_event['sfp'] and change_event['sfp'][sfp_index] == sfp.SFP_STATUS_INSERTED + assert s.state == sfp.STATE_SW_CONTROL + + # power bad event, expect returning error event + mock_time.side_effect = [0, timeout] + mock_poll.poll.return_value = [(2, 10)] + mock_power_good_file.read.return_value = '0' + _, change_event = c.get_change_event(timeout) + assert 'sfp' in change_event and sfp_index in change_event['sfp'] and change_event['sfp'][sfp_index] == '5' + assert s.state == sfp.STATE_POWER_BAD + + # power good event, expect returning insert event + mock_time.side_effect = [0, timeout] + mock_poll.poll.return_value = [(2, 10)] + mock_power_good_file.read.return_value = '1' + _, change_event = c.get_change_event(timeout) + assert 'sfp' in change_event and sfp_index in change_event['sfp'] and change_event['sfp'][sfp_index] == '1' + assert s.state == sfp.STATE_SW_CONTROL diff --git a/platform/mellanox/mlnx-platform-api/tests/test_chassis.py b/platform/mellanox/mlnx-platform-api/tests/test_chassis.py index ad23cd8dde85..49dfa8ff3fa9 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_chassis.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_chassis.py @@ -124,6 +124,7 @@ def test_fan(self): chassis._fan_drawer_list = [] assert chassis.get_num_fan_drawers() == 2 + @mock.patch('sonic_platform.device_data.DeviceDataManager.is_module_host_management_mode', mock.MagicMock(return_value=False)) def test_sfp(self): # Test get_num_sfps, it should not create any SFP objects DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=3) @@ -176,6 +177,7 @@ def test_sfp(self): assert chassis.get_num_sfps() == 6 sonic_platform.chassis.extract_RJ45_ports_index = mock.MagicMock(return_value=[]) + @mock.patch('sonic_platform.device_data.DeviceDataManager.is_module_host_management_mode', mock.MagicMock(return_value=False)) def test_create_sfp_in_multi_thread(self): DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=3) @@ -199,25 +201,6 @@ def test_create_sfp_in_multi_thread(self): assert s.sdk_index == index iteration_num -= 1 - - @mock.patch('sonic_platform.device_data.DeviceDataManager.get_sfp_count', MagicMock(return_value=3)) - def test_change_event(self): - chassis = Chassis() - chassis.modules_mgmt_thread.is_alive = MagicMock(return_value=True) - chassis.modules_changes_queue.get = MagicMock(return_value={1: '1'}) - - # Call get_change_event with timeout=0, wait until an event is detected - status, event_dict = chassis.get_change_event() - assert status is True - assert 'sfp' in event_dict and event_dict['sfp'][1] == '1' - assert len(chassis._sfp_list) == 3 - - # Call get_change_event with timeout=1.0 - chassis.modules_changes_queue.get.return_value = {} - status, event_dict = chassis.get_change_event(timeout=1.0) - assert status is True - assert 'sfp' in event_dict and not event_dict['sfp'] - @mock.patch('sonic_platform.chassis.Chassis._wait_reboot_cause_ready', MagicMock(return_value=True)) def test_reboot_cause(self): from sonic_platform import utils diff --git a/platform/mellanox/mlnx-platform-api/tests/test_device_data.py b/platform/mellanox/mlnx-platform-api/tests/test_device_data.py index c172b82a30b7..f67793419091 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_device_data.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_device_data.py @@ -54,11 +54,11 @@ def test_get_bios_component(self): @mock.patch('sonic_py_common.device_info.get_paths_to_platform_and_hwsku_dirs', mock.MagicMock(return_value=('', '/tmp'))) @mock.patch('sonic_platform.device_data.utils.read_key_value_file') - def test_is_independent_mode(self, mock_read): + def test_is_module_host_management_mode(self, mock_read): mock_read.return_value = {} - assert not DeviceDataManager.is_independent_mode() + assert not DeviceDataManager.is_module_host_management_mode() mock_read.return_value = {'SAI_INDEPENDENT_MODULE_MODE': '1'} - assert DeviceDataManager.is_independent_mode() + assert DeviceDataManager.is_module_host_management_mode() @mock.patch('sonic_py_common.device_info.get_path_to_platform_dir', mock.MagicMock(return_value='/tmp')) @mock.patch('sonic_platform.device_data.utils.load_json_file') @@ -74,7 +74,7 @@ def test_get_sfp_count(self, mock_load_json): @mock.patch('sonic_platform.device_data.DeviceDataManager.get_sfp_count', mock.MagicMock(return_value=3)) @mock.patch('sonic_platform.device_data.utils.read_int_from_file', mock.MagicMock(return_value=1)) @mock.patch('sonic_platform.device_data.os.path.exists') - @mock.patch('sonic_platform.device_data.DeviceDataManager.is_independent_mode') + @mock.patch('sonic_platform.device_data.DeviceDataManager.is_module_host_management_mode') def test_wait_platform_ready(self, mock_is_indep, mock_exists): mock_exists.return_value = True mock_is_indep.return_value = True diff --git a/platform/mellanox/mlnx-platform-api/tests/test_module_initializer.py b/platform/mellanox/mlnx-platform-api/tests/test_module_initializer.py new file mode 100644 index 000000000000..ad833a70f85c --- /dev/null +++ b/platform/mellanox/mlnx-platform-api/tests/test_module_initializer.py @@ -0,0 +1,98 @@ +# +# Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. +# Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +import os +import sys + +if sys.version_info.major == 3: + from unittest import mock +else: + import mock + +test_path = os.path.dirname(os.path.abspath(__file__)) +modules_path = os.path.dirname(test_path) +sys.path.insert(0, modules_path) + +from sonic_platform import chassis +from sonic_platform import module_host_mgmt_initializer + + +class TestModuleInitializer: + @mock.patch('os.path.exists') + @mock.patch('sonic_platform.utils.wait_until') + @mock.patch('sonic_platform.utils.is_host') + def test_wait_module_ready(self, mock_is_host, mock_wait, mock_exists): + initializer = module_host_mgmt_initializer.ModuleHostMgmtInitializer() + mock_is_host.return_value = True + mock_exists.return_value = False + mock_wait.return_value = True + initializer.wait_module_ready() + mock_exists.assert_called_with(module_host_mgmt_initializer.MODULE_READY_HOST_FILE) + assert initializer.initialized + + initializer.initialized = False + mock_is_host.return_value = False + initializer.wait_module_ready() + mock_exists.assert_called_with(module_host_mgmt_initializer.MODULE_READY_CONTAINER_FILE) + + initializer.initialized = False + mock_exists.return_value = True + initializer.wait_module_ready() + assert initializer.initialized + + initializer.initialized = False + mock_wait.return_value = False + mock_exists.return_value = False + initializer.wait_module_ready() + assert not initializer.initialized + + + @mock.patch('sonic_platform.chassis.extract_RJ45_ports_index', mock.MagicMock(return_value=[])) + @mock.patch('sonic_platform.device_data.DeviceDataManager.get_sfp_count', mock.MagicMock(return_value=1)) + @mock.patch('sonic_platform.sfp.SFP.initialize_sfp_modules', mock.MagicMock()) + @mock.patch('sonic_platform.module_host_mgmt_initializer.ModuleHostMgmtInitializer.is_initialization_owner') + @mock.patch('sonic_platform.module_host_mgmt_initializer.ModuleHostMgmtInitializer.wait_module_ready') + @mock.patch('sonic_platform.utils.is_host') + def test_initialize(self, mock_is_host, mock_wait_ready, mock_owner): + c = chassis.Chassis() + initializer = module_host_mgmt_initializer.ModuleHostMgmtInitializer() + mock_is_host.return_value = True + mock_owner.return_value = False + # called from host side, just wait + initializer.initialize(c) + mock_wait_ready.assert_called_once() + mock_wait_ready.reset_mock() + + mock_is_host.return_value = False + # non-initializer-owner called from container side, just wait + initializer.initialize(c) + mock_wait_ready.assert_called_once() + mock_wait_ready.reset_mock() + + mock_owner.return_value = True + initializer.initialize(c) + mock_wait_ready.assert_not_called() + assert initializer.initialized + assert module_host_mgmt_initializer.initialization_owner + assert os.path.exists(module_host_mgmt_initializer.MODULE_READY_CONTAINER_FILE) + + module_host_mgmt_initializer.clean_up() + assert not os.path.exists(module_host_mgmt_initializer.MODULE_READY_CONTAINER_FILE) + + def test_is_initialization_owner(self): + initializer = module_host_mgmt_initializer.ModuleHostMgmtInitializer() + assert not initializer.is_initialization_owner() diff --git a/platform/mellanox/mlnx-platform-api/tests/test_modules_mgmt.py b/platform/mellanox/mlnx-platform-api/tests/test_modules_mgmt.py deleted file mode 100644 index d0cab978cf2f..000000000000 --- a/platform/mellanox/mlnx-platform-api/tests/test_modules_mgmt.py +++ /dev/null @@ -1,800 +0,0 @@ -# -# Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. -# Apache-2.0 -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -import os -import queue -import sys -import threading -import time -import types -import unittest - -from mock import MagicMock, patch, mock_open, Mock -if sys.version_info.major == 3: - from unittest import mock -else: - import mock - -test_path = os.path.dirname(os.path.abspath(__file__)) -modules_path = os.path.dirname(test_path) -sys.path.insert(0, modules_path) - -from sonic_platform.device_data import DeviceDataManager -from sonic_py_common import device_info -from sonic_platform import modules_mgmt -from sonic_platform.modules_mgmt import ModulesMgmtTask -from sonic_platform_base.sonic_xcvr.api.public.cmis import CmisApi -from sonic_platform_base.sonic_xcvr.xcvr_eeprom import XcvrEeprom -from sonic_platform_base.sonic_xcvr.codes.public.cmis import CmisCodes -from sonic_platform_base.sonic_xcvr.mem_maps.public.cmis import CmisMemMap -from sonic_platform_base.sonic_xcvr.fields import consts - -DEFAULT_NUM_OF_PORTS_1 = 1 -DEFAULT_NUM_OF_PORTS_3 = 3 -DEFAULT_NUM_OF_PORTS_32 = 32 -POLLER_EXECUTED = False - -def _mock_sysfs_default_file_content(): - return { - modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("0"): "1", - modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("1"): "1", - modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("2"): "1", - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("0"): "1", - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("1"): "1", - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("2"): "1", - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("0"): "1", - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("1"): "1", - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("2"): "1", - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("0"): "48", - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("1"): "48", - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("2"): "48", - modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("0"): "0", - modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("1"): "0", - modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("2"): "0", - modules_mgmt.SYSFS_INDEPENDENT_FD_HW_RESET: "", - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT: "48", - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("0"): "1", - modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL.format("0"): "1", - modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL.format("1"): "1", - modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL.format("2"): "1", - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE: "1", - modules_mgmt.PROC_CMDLINE: "" - } - - -mock_file_content = _mock_sysfs_default_file_content() - - -class MockPoller: - - def __init__(self, modules_mgmt_task_stopping_event, modules_mgmt_thrd=None, num_of_ports=3, port_plug_out=False - , feature_enabled=True, warm_reboot=False, port_plug_in=False, sleep_timeout=False): - self.fds_dict = {} - self.poller_iteration_count = 0 - self.modules_mgmt_task_stopping_event = modules_mgmt_task_stopping_event - self.modules_mgmt_thrd = modules_mgmt_thrd - self.num_of_ports = num_of_ports - self.port_plug_out = port_plug_out - self.port_plug_in = port_plug_in - self.feature_enabled = feature_enabled - self.warm_reboot = warm_reboot - self.port_plug_out_changed = False - self.port_plug_in_changed = False - self.sleep_timeout = sleep_timeout - - def register(self, fd, attrs): - self.fds_dict[fd.fileno()] = { fd : attrs } - assert fd.fileno() in self.fds_dict - - def unregister(self, fd): - if fd.fileno() in self.fds_dict.keys(): - del self.fds_dict[fd.fileno()] - assert fd.fileno() not in self.fds_dict.keys() - - def poll(self, timeout=1000): - global POLLER_EXECUTED - assert len(self.modules_mgmt_thrd.sfp_port_dict_initial) == self.num_of_ports - assert self.modules_mgmt_thrd.is_supported_indep_mods_system == self.feature_enabled - # counting the number of poller iterations to know when to do the checks after plug out (and plug in) - # have to check at least on iteration 7 to let ports reach final state - self.poller_iteration_count += 1 - if self.num_of_ports > 0: - if not self.port_plug_out_changed: - if self.port_plug_out: - # return first fd registered with some made up event number 870 - fd_no_to_return = list(self.fds_dict.keys())[0] - fd = list(self.fds_dict[fd_no_to_return].keys())[0] - fd.set_file_int_content(0) - event_to_return = 870 - self.port_plug_out_changed = True - return [(fd_no_to_return, event_to_return)] - if not self.port_plug_in_changed: - if self.port_plug_in: - # return first fd registered with some made up event number 871 - fd_no_to_return = list(self.fds_dict.keys())[0] - fd = list(self.fds_dict[fd_no_to_return].keys())[0] - fd.set_file_int_content(1) - event_to_return = 871 - self.port_plug_in_changed = True - return [(fd_no_to_return, event_to_return)] - if 7 == self.poller_iteration_count: - # when feature is enabled, need to check for each port both power_good and hw_present sysfs for - # cmis non-flat memory cables - num_of_sysfs_to_check = self.num_of_ports if (not self.port_plug_out or not self.feature_enabled - or self.warm_reboot) else self.num_of_ports * 2 - for i in range(num_of_sysfs_to_check): - # when feature is enabled, power_good sysfs is also registered for cmis non-flat memory cables - # so each SW controlled port has 2 fds registered - port_to_test = i if not self.feature_enabled else int(i / 2) - assert self.modules_mgmt_thrd.sfp_port_dict_initial[port_to_test].port_num == port_to_test - assert self.modules_mgmt_thrd.sfp_port_dict_initial[ - port_to_test].initial_state == modules_mgmt.STATE_HW_NOT_PRESENT - if self.feature_enabled: - module_obj = self.modules_mgmt_thrd.fds_mapping_to_obj[list(self.fds_dict.keys())[i]][ - 'module_obj'] - assert module_obj.port_num == port_to_test - if not self.warm_reboot: - # in tests other than warm reboot it creates only SW control ports - if not self.port_plug_out: - assert module_obj.final_state == modules_mgmt.STATE_SW_CONTROL - else: - assert module_obj.final_state == modules_mgmt.STATE_HW_NOT_PRESENT - else: - if not self.port_plug_out: - assert module_obj.final_state == modules_mgmt.STATE_HW_PRESENT - # in warm reboot test with plug out plug in test creates only FW control ports - elif self.port_plug_out and self.port_plug_in: - assert module_obj.final_state == modules_mgmt.STATE_FW_CONTROL - else: - assert module_obj.final_state == modules_mgmt.STATE_HW_NOT_PRESENT - POLLER_EXECUTED = True - self.modules_mgmt_task_stopping_event.set() - if self.sleep_timeout: - time.sleep(timeout/1000) - return [] - - -class MockOpen: - - def __init__(self, name='', file_no=None, indep_mode_supported=True): - self.name = name - self.file_no = file_no - self.indep_mode_supported = indep_mode_supported - self.retint = None - self.curr = 0 - - def read(self): - if self.fileno() in [SAI_PROFILE_FD_FILENO]: - pass - else: - # if return value was changed, i.e. sysfs content changed from 1 to 0 to simulate plug out - if self.retint is not None: - return str(self.retint) - # return default values (can be changed per test) - else: - return mock_file_content[self.name] - - def readline(self): - # if trying to read sai profile file, according to fd fileno - if self.fileno() in [SAI_PROFILE_FD_FILENO]: - if self.indep_mode_supported: - return "SAI_INDEPENDENT_MODULE_MODE=1" - else: - return "" - else: - return mock_file_content[self.name] - - def fileno(self): - return self.file_no - - def seek(self, seek_val): - self.curr = seek_val - - def close(self): - pass - - def write(self, write_val): - self.set_file_int_content(write_val) - - def set_file_int_content(self, retint): - self.retint = str(retint) - mock_file_content[self.name] = str(retint) - - def __enter__(self): - return self - - def __exit__(self, filename, *args, **kwargs): - pass - -class MockPollerStopEvent: - - def __init__(self, modules_mgmt_task_stopping_event, modules_mgmt_thrd=None, num_of_ports=DEFAULT_NUM_OF_PORTS_3 - , feature_enabled=True, ports_connected=True, fw_controlled_ports=False, sleep_timeout=False): - self.fds_dict = {} - self.modules_mgmt_task_stopping_event = modules_mgmt_task_stopping_event - self.modules_mgmt_thrd = modules_mgmt_thrd - self.num_of_ports = num_of_ports - self.feature_enabled = feature_enabled - self.ports_connected = ports_connected - self.sleep_timeout = sleep_timeout - self.fw_controlled_ports = fw_controlled_ports - - def register(self, fd, attrs): - self.fds_dict[fd.fileno()] = 1 & attrs - assert fd.fileno() in self.fds_dict - - def poll(self, timeout=0): - assert len(self.modules_mgmt_thrd.sfp_port_dict_initial) == self.num_of_ports - assert self.modules_mgmt_thrd.is_supported_indep_mods_system == self.feature_enabled - global POLLER_EXECUTED - if self.num_of_ports > 0: - # when feature is enabled, need to check for each port both power_good and hw_present sysfs for - # cmis non-flat memory cables - ports_to_test = self.num_of_ports if (not self.feature_enabled or not self.ports_connected - or self.fw_controlled_ports) else self.num_of_ports * 2 - for i in range(ports_to_test): - # when feature is enabled, power_good sysfs is also registered for cmis non-flat memory cables - port_to_test = i if (not self.feature_enabled or not self.ports_connected - or self.fw_controlled_ports) else int(i / 2) - assert self.modules_mgmt_thrd.sfp_port_dict_initial[port_to_test].port_num == port_to_test - assert self.modules_mgmt_thrd.sfp_port_dict_initial[port_to_test].initial_state == modules_mgmt.STATE_HW_NOT_PRESENT - module_obj = self.modules_mgmt_thrd.fds_mapping_to_obj[list(self.fds_dict.keys())[i]]['module_obj'] - assert module_obj.port_num == port_to_test - if self.ports_connected: - if self.feature_enabled: - if self.fw_controlled_ports: - assert module_obj.final_state == modules_mgmt.STATE_FW_CONTROL - else: - assert module_obj.final_state == modules_mgmt.STATE_SW_CONTROL - else: - assert module_obj.final_state == modules_mgmt.STATE_HW_PRESENT - else: - assert module_obj.final_state == modules_mgmt.STATE_HW_NOT_PRESENT - POLLER_EXECUTED = True - else: - POLLER_EXECUTED = True - self.modules_mgmt_task_stopping_event.set() - if self.sleep_timeout: - time.sleep(timeout/1000) - return [] - - -def _mock_is_file_indep_mode_disabled_content(): - return { - modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE: True, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD: True, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON: True, - modules_mgmt.SYSFS_INDEPENDENT_FD_HW_RESET: True, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT: True, - modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL: True, - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("0"): True, - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("1"): True, - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("2"): True, - '//usr/share/sonic/platform/ACS-MSN4700/sai.profile' : True - } - -mock_is_file_indep_mode_disabled_content = _mock_is_file_indep_mode_disabled_content() - -def mock_is_file_indep_mode_disabled(file_path, **kwargs): - return mock_is_file_indep_mode_disabled_content[file_path] - -def _mock_is_file_indep_mode_enabled_content(): - return { - modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE: True, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD: True, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON: True, - modules_mgmt.SYSFS_INDEPENDENT_FD_HW_RESET: True, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT: True, - modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL: True, - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("0"): True, - modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("0"): True, - modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("1"): True, - modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("2"): True, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("0"): True, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("1"): True, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("2"): True, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("0"): True, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("1"): True, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("2"): True, - '//usr/share/sonic/platform/ACS-MSN4700/sai.profile' : True - } - -mock_is_file_indep_mode_enabled_content = _mock_is_file_indep_mode_enabled_content() - - -def mock_is_file_indep_mode_enabled(file_path, **kwargs): - return mock_is_file_indep_mode_enabled_content[file_path] - - -def mock_read_int_from_file(filename, *args): - return_dict = { - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("0") : 1, - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("1") : 1, - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("2") : 1 - } - - return return_dict[filename] - - -class MockXcvrEeprom(): - def __init__(self, is_flat_memory, mem_map): - self.is_flat_memory = is_flat_memory - self.mem_map = mem_map - - def is_cmis_api(self): - return self.is_cmis_api - - def is_flat_memory(self): - return self.is_flat_memory - - def read(self, field): - if consts.FLAT_MEM_FIELD == field: - return 0 if self.is_flat_memory else 1 - else: - return 0 - - -class MockXcvrapi: - def __init__(self, is_cmis_api=True, is_flat_memory_bool=False): - self.is_cmis_api = is_cmis_api - self.is_flat_memory_bool = is_flat_memory_bool - self.xcvr_eeprom = MagicMock(autospec=XcvrEeprom, return_value=MockXcvrEeprom(is_flat_memory_bool, CmisMemMap(CmisCodes))) - - def is_flat_memory(self): - return self.is_flat_memory_bool - - def xcvr_eeprom(self): - return self.xcvr_eeprom - - -class MockSFPxcvrapi: - def __init__(self, xcvr_api_is_cmis_api=True, xcvr_eeprom_is_flat_memory=False): - self.xcvr_api = Mock(spec=CmisApi(MockXcvrEeprom(False, CmisMemMap(CmisCodes))), return_value=MockXcvrapi(xcvr_api_is_cmis_api, xcvr_eeprom_is_flat_memory)) - self.xcvr_api_is_cmis_api = xcvr_api_is_cmis_api - self.xcvr_eeprom_is_flat_memory = xcvr_eeprom_is_flat_memory - self.xcvr_api.is_flat_memory = types.MethodType(self.is_flat_memory, self) - - def get_xcvr_api(self): - return self.xcvr_api - - def is_flat_memory(self, ref): - return self.xcvr_eeprom_is_flat_memory - - -def check_power_cap(port, module_sm_obj): - pass - -SAI_PROFILE_FD_FILENO = 99 - - -class TestModulesMgmt(unittest.TestCase): - """Test class to test modules_mgmt.py. The test cases covers: - 1. cables detection for 1 to 3 ports - feature disabled / enabled / poller - 2. cable disconnection - plug out - 3. cable reconnection - plug in - 4. warm reboot normal flow with FW ports - 5. warm reboot flow with FW ports plugged out - 6. warm reboot flow with FW ports plugged out and then plugged in (stays FW controlled, no SFP mock change) - 7. test 32 FW controlled (non cmis flat mem) cables powered off - 8. test 32 SW controlled (cmis active non flat mem) cables powered off - """ - - def _mock_sysfs_file_content(self): - return { - modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE : "1", - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD : "1", - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON : "0", - modules_mgmt.SYSFS_INDEPENDENT_FD_HW_RESET : "", - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT : "48", - modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL : "1", - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("0") : "1", - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("1") : "1", - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("2") : "1", - modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("0"): "0" - } - - def mock_open_builtin(self, file_name, feature_enabled=True): - return_dict = { - (modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("0"), 'r') : MockOpen(modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("0"), 100), - (modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("1"), 'r') : MockOpen(modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("1"), 101), - (modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("2"), 'r') : MockOpen(modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("2"), 102), - '//usr/share/sonic/platform/ACS-MSN4700/sai.profile' : MockOpen('//usr/share/sonic/platform/ACS-MSN4700/sai.profile' - , SAI_PROFILE_FD_FILENO, feature_enabled), - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("0") : MockOpen(modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("0"), 100), - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("1") : MockOpen(modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("1"), 101), - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("2") : MockOpen(modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("2"), 102), - modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("0"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("0"), 0), - modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("1"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("1"), 1), - modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("2"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("2"), 2), - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("0"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("0"), 200), - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("1"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("1"), 201), - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("2"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("2"), 202), - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("0"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("0"), 300), - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("1"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("1"), 301), - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("2"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("2"), 302), - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("0"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("0"), 500), - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("1"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("1"), 501), - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("2"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("2"), 502), - modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("0"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("0"), 602), - modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("1"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("1"), 602), - modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("2"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("2"), 602), - modules_mgmt.PROC_CMDLINE: MockOpen(modules_mgmt.PROC_CMDLINE, self.fd_number_by_fd_name_dict[modules_mgmt.PROC_CMDLINE]) - } - return return_dict[file_name] - - # side effects are used in mock when want to create different mocks per variable, i.e. here it's filename - # see below mock_open_new_side_effect_poller_test where returning a new MockOpen passing it the filename - def mock_open_new_side_effect_feature_disabled(self, filename, *args, **kwargs): - mock_context = MagicMock() - mock_context.__enter__.return_value = self.mock_open_builtin(filename, False) - mock_context.__exit__.return_value = False - return mock_context - - def mock_open_new_side_effect_feature_enabled(self, filename, *args, **kwargs): - mock_context = MagicMock() - mock_context.__enter__.return_value = self.mock_open_builtin(filename) - mock_context.__exit__.return_value = False - return mock_context - - def mock_open_new_side_effect_poller_test(self, filename, *args, **kwargs): - if filename in ['//usr/share/sonic/platform/ACS-MSN4700/sai.profile']: - mock_context = MagicMock() - mock_context.__enter__.return_value = MockOpen(filename, SAI_PROFILE_FD_FILENO) - mock_context.__exit__.return_value = False - return mock_context - else: - mock_context = MagicMock() - mock_open_new = MockOpen(filename, self.fd_number_by_fd_name_dict[filename]) - mock_context.return_value = mock_open_new - mock_context.__enter__.return_value = mock_open_new - mock_context.__exit__.return_value = False - if 'hw_present' in filename or 'power_on' in filename or 'freq' in filename or 'control' in filename: - return mock_context - else: - return mock_context.return_value - - def mock_open_new_side_effect_warm_reboot(self, filename, *args, **kwargs): - if filename in ['//usr/share/sonic/platform/ACS-MSN4700/sai.profile']: - mock_context = MagicMock() - mock_context.__enter__.return_value = MockOpen(filename, SAI_PROFILE_FD_FILENO) - mock_context.__exit__.return_value = False - return mock_context - else: - mock_open_new = MockOpen(filename, self.fd_number_by_fd_name_dict[filename]) - return mock_open_new - - def setUp(cls): - cls.modules_mgmt_task_stopping_event = threading.Event() - cls.modules_changes_queue = queue.Queue() - global POLLER_EXECUTED - POLLER_EXECUTED = False - # start modules_mgmt thread and the test in poller part - cls.modules_mgmt_thrd = ModulesMgmtTask(main_thread_stop_event=cls.modules_mgmt_task_stopping_event, - q=cls.modules_changes_queue) - cls.modules_mgmt_thrd.check_power_cap = check_power_cap - assert cls.modules_mgmt_thrd.sfp_port_dict_initial == {} - - @classmethod - def setup_class(cls): - os.environ["MLNX_PLATFORM_API_UNIT_TESTING"] = "1" - cls.fd_number_by_fd_name_dict = { - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("0") : 100, - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("1") : 101, - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("2") : 102, - '//usr/share/sonic/platform/ACS-MSN4700/sai.profile' : SAI_PROFILE_FD_FILENO, - modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("0") : 0, - modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("1") : 1, - modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("2") : 2, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("0") : 200, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("1") : 201, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("2") : 202, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("0") : 300, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("1") : 301, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("2") : 302, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("0") : 500, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("1") : 501, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("2") : 502, - modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("0") : 600, - modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("1") : 601, - modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("2") : 602, - modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL.format("0") : 700, - modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL.format("1") : 701, - modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL.format("2") : 702, - modules_mgmt.PROC_CMDLINE : 800 - } - # mock the directory holding relevant sai.profile - device_info.get_paths_to_platform_and_hwsku_dirs = mock.MagicMock(return_value=('', '/usr/share/sonic/platform/ACS-MSN4700')) - - - @patch('sonic_platform.device_data.DeviceDataManager.get_sfp_count', MagicMock(return_value=DEFAULT_NUM_OF_PORTS_3)) - @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_disabled)) - @patch('sonic_platform.utils.read_int_from_file', MagicMock(side_effect=mock_read_int_from_file)) - @patch('builtins.open', spec=open) - def test_mdf_all_ports_feature_disabled(self, mock_open): - mock_open.side_effect = self.mock_open_new_side_effect_feature_disabled - num_of_tested_ports = DeviceDataManager.get_sfp_count() - assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_3 - - # start modules_mgmt thread and the test in poller part - with patch('select.poll', MagicMock(return_value=MockPollerStopEvent(self.modules_mgmt_task_stopping_event - , self.modules_mgmt_thrd, feature_enabled=False))): - self.modules_mgmt_thrd.run() - - @patch('sonic_platform.device_data.DeviceDataManager.get_sfp_count', MagicMock(return_value=DEFAULT_NUM_OF_PORTS_3)) - @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) - @patch('builtins.open', spec=open) - @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi())) - def test_mdf_all_ports_feature_enabled(self, mock_open): - mock_open.side_effect = self.mock_open_new_side_effect_feature_enabled - num_of_tested_ports = DeviceDataManager.get_sfp_count() - assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_3 - - # start modules_mgmt thread and the test in poller part - with patch('select.poll', MagicMock(return_value=MockPollerStopEvent(self.modules_mgmt_task_stopping_event - , self.modules_mgmt_thrd))): - self.modules_mgmt_thrd.run() - - @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) - @patch('builtins.open', spec=open) - @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi())) - def test_modules_mgmt_poller_events_3_ports(self, mock_open): - mock_open.side_effect = self.mock_open_new_side_effect_poller_test - DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=DEFAULT_NUM_OF_PORTS_3) - num_of_tested_ports = DeviceDataManager.get_sfp_count() - assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_3 - - # start modules_mgmt thread and the test in poller part - with patch('select.poll', MagicMock(return_value=MockPollerStopEvent(self.modules_mgmt_task_stopping_event - , self.modules_mgmt_thrd))): - self.modules_mgmt_thrd.run() - - @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) - @patch('builtins.open', spec=open) - @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi())) - def test_modules_mgmt_poller_events_single_port(self, mock_open): - mock_open.side_effect = self.mock_open_new_side_effect_poller_test - DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=DEFAULT_NUM_OF_PORTS_1) - num_of_tested_ports = DeviceDataManager.get_sfp_count() - assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_1 - - # start modules_mgmt thread and the test in poller part - with patch('select.poll', MagicMock(return_value=MockPollerStopEvent(self.modules_mgmt_task_stopping_event - , self.modules_mgmt_thrd, num_of_tested_ports))): - #with patch('builtins.open', MagicMock(side_effect=self.mock_open_new_side_effect_poller_test)): - self.modules_mgmt_thrd.run() - - @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) - @patch('builtins.open', spec=open) - @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi(False, True))) - def test_modules_mgmt_normal_warm_reboot(self, mock_open): - mock_open.side_effect = self.mock_open_new_side_effect_warm_reboot - # mock /proc/cmdline with warm reboot boot type key value - mock_file_content[modules_mgmt.PROC_CMDLINE] = f'{modules_mgmt.CMDLINE_STR_TO_LOOK_FOR}{modules_mgmt.CMDLINE_VAL_TO_LOOK_FOR}' - DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=DEFAULT_NUM_OF_PORTS_1) - num_of_tested_ports = DeviceDataManager.get_sfp_count() - assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_1 - # set the port to start with FW controlled before warm reboot takes place - mock_file_content[modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL.format("0")] = "0" - - # start modules_mgmt thread and the test in poller part - with patch('select.poll', MagicMock(return_value=MockPoller(self.modules_mgmt_task_stopping_event - , self.modules_mgmt_thrd, num_of_tested_ports, warm_reboot=True))): - self.modules_mgmt_thrd.run() - - @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) - @patch('builtins.open', spec=open) - @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi(False, True))) - def test_modules_mgmt_plug_out_fw_cable_after_warm_reboot(self, mock_open): - mock_open.side_effect = self.mock_open_new_side_effect_warm_reboot - # mock /proc/cmdline with warm reboot boot type key value - mock_file_content[modules_mgmt.PROC_CMDLINE] = f'{modules_mgmt.CMDLINE_STR_TO_LOOK_FOR}{modules_mgmt.CMDLINE_VAL_TO_LOOK_FOR}' - DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=DEFAULT_NUM_OF_PORTS_1) - num_of_tested_ports = DeviceDataManager.get_sfp_count() - assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_1 - - # set the port to start with FW controlled before warm reboot takes place - mock_file_content[modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL.format("0")] = "0" - - # start modules_mgmt thread and the test in poller part - with patch('select.poll', MagicMock(return_value=MockPoller(self.modules_mgmt_task_stopping_event - , self.modules_mgmt_thrd, num_of_tested_ports, port_plug_out=True, warm_reboot=True))): - self.modules_mgmt_thrd.run() - - @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) - @patch('builtins.open', spec=open) - @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi(False, True))) - def test_modules_mgmt_plug_out_plug_in_fw_cable_after_warm_reboot(self, mock_open): - mock_open.side_effect = self.mock_open_new_side_effect_warm_reboot - # mock /proc/cmdline with warm reboot boot type key value - mock_file_content[modules_mgmt.PROC_CMDLINE] = f'{modules_mgmt.CMDLINE_STR_TO_LOOK_FOR}{modules_mgmt.CMDLINE_VAL_TO_LOOK_FOR}' - DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=DEFAULT_NUM_OF_PORTS_1) - num_of_tested_ports = DeviceDataManager.get_sfp_count() - assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_1 - - mock_file_content[modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL.format("0")] = "0" - - # start modules_mgmt thread and the test in poller part - with patch('select.poll', MagicMock(return_value=MockPoller(self.modules_mgmt_task_stopping_event - , self.modules_mgmt_thrd, num_of_tested_ports, port_plug_out=True, warm_reboot=True, port_plug_in=True))): - self.modules_mgmt_thrd.run() - - @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) - @patch('builtins.open', spec=open) - @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi(False, True))) - def test_modules_mgmt_no_ports(self, mock_open): - mock_open.side_effect = self.mock_open_new_side_effect_poller_test - DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=0) - num_of_tested_ports = DeviceDataManager.get_sfp_count() - assert num_of_tested_ports == 0 - - # start modules_mgmt thread and the test in poller part - with patch('select.poll', MagicMock(return_value=MockPollerStopEvent(self.modules_mgmt_task_stopping_event - , self.modules_mgmt_thrd, num_of_tested_ports))): - self.modules_mgmt_thrd.run() - - @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) - @patch('builtins.open', spec=open) - @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi(False, True))) - def test_modules_mgmt_ports_disconnected(self, mock_open): - mock_open.side_effect = self.mock_open_new_side_effect_poller_test - DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=DEFAULT_NUM_OF_PORTS_3) - num_of_tested_ports = DeviceDataManager.get_sfp_count() - assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_3 - - # update hw_present sysfs with value of 0 for each port - for i in range(num_of_tested_ports): - modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format(f"{i}") - mock_file_content[modules_sysfs] = "0" - - # start modules_mgmt thread and the test in poller part - with patch('select.poll', MagicMock(return_value=MockPollerStopEvent(self.modules_mgmt_task_stopping_event - , self.modules_mgmt_thrd, num_of_tested_ports, ports_connected=False))): - self.modules_mgmt_thrd.run() - - @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) - @patch('builtins.open', spec=open) - @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi(False, True))) - def test_modules_mgmt_bad_flows_port_disconnected(self, mock_open): - mock_open.side_effect = self.mock_open_new_side_effect_poller_test - DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=DEFAULT_NUM_OF_PORTS_1) - num_of_tested_ports = DeviceDataManager.get_sfp_count() - assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_1 - - # update hw_present sysfs with value of 0 for each port - for i in range(num_of_tested_ports): - modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format(f"{i}") - mock_file_content[modules_sysfs] = "0" - - # start modules_mgmt thread and the test in poller part - with patch('select.poll', MagicMock(return_value=MockPollerStopEvent(self.modules_mgmt_task_stopping_event - , self.modules_mgmt_thrd, num_of_tested_ports, ports_connected=False))): - self.modules_mgmt_thrd.run() - - @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) - @patch('builtins.open', spec=open) - @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi(False, True))) - def test_modules_mgmt_bad_flows_power_good(self, mock_open): - mock_open.side_effect = self.mock_open_new_side_effect_poller_test - DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=DEFAULT_NUM_OF_PORTS_1) - num_of_tested_ports = DeviceDataManager.get_sfp_count() - assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_1 - - # update power_good sysfs with value of 0 for each port - for i in range(num_of_tested_ports): - modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format(f"{i}") - mock_file_content[modules_sysfs] = "0" - - # start modules_mgmt thread and the test in poller part - with patch('select.poll', MagicMock(return_value=MockPollerStopEvent(self.modules_mgmt_task_stopping_event - , self.modules_mgmt_thrd, num_of_tested_ports, ports_connected=False))): - self.modules_mgmt_thrd.run() - for i in range(num_of_tested_ports): - modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format(f"{i}") - mock_file_content[modules_sysfs] = "1" - - @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) - @patch('builtins.open', spec=open) - @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi(False, True))) - def test_modules_mgmt_bad_flows_ports_powered_off_fw_controlled(self, mock_open): - mock_open.side_effect = self.mock_open_new_side_effect_poller_test - DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=DEFAULT_NUM_OF_PORTS_32) - num_of_tested_ports = DeviceDataManager.get_sfp_count() - assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_32 - - # create or update different sysfs and is_file mocking with relevant value for each port - for i in range(num_of_tested_ports): - # mock power_on sysfs for all ports - modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format(f"{i}") - mock_file_content[modules_sysfs] = "0" - mock_is_file_indep_mode_enabled_content[modules_sysfs] = True - self.fd_number_by_fd_name_dict[modules_sysfs] = 300 + i - # mock hw_presence sysfs for all ports - modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format(f'{i}') - mock_file_content[modules_sysfs] = "1" - mock_is_file_indep_mode_enabled_content[modules_sysfs] = True - self.fd_number_by_fd_name_dict[modules_sysfs] = i - # mock power_good sysfs for all ports - modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format(f'{i}') - mock_file_content[modules_sysfs] = "1" - mock_is_file_indep_mode_enabled_content[modules_sysfs] = True - self.fd_number_by_fd_name_dict[modules_sysfs] = 200 + i - # mock hw_reset sysfs for all ports - modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_HW_RESET.format(f'{i}') - mock_is_file_indep_mode_enabled_content[modules_sysfs] = True - self.fd_number_by_fd_name_dict[modules_sysfs] = 400 + i - - # start modules_mgmt thread and the test in poller part - with patch('select.poll', MagicMock(return_value=MockPollerStopEvent(self.modules_mgmt_task_stopping_event - , self.modules_mgmt_thrd, num_of_tested_ports, fw_controlled_ports=True))): - self.modules_mgmt_thrd.run() - - # change power_on sysfs values back to the default ones - for i in range(num_of_tested_ports): - modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format(f"{i}") - mock_file_content[modules_sysfs] = "1" - - @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) - @patch('builtins.open', spec=open) - @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi())) - def test_modules_mgmt_bad_flows_ports_powered_off_sw_controlled(self, mock_open): - mock_open.side_effect = self.mock_open_new_side_effect_poller_test - DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=DEFAULT_NUM_OF_PORTS_32) - num_of_tested_ports = DeviceDataManager.get_sfp_count() - assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_32 - - # create or update different sysfs and is_file mocking with relevant value for each port - for i in range(num_of_tested_ports): - # mock power_on sysfs for all ports - modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format(f"{i}") - mock_file_content[modules_sysfs] = "0" - mock_is_file_indep_mode_enabled_content[modules_sysfs] = True - self.fd_number_by_fd_name_dict[modules_sysfs] = 300 + i - # mock hw_presence sysfs for all ports - modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format(f'{i}') - mock_file_content[modules_sysfs] = "1" - mock_is_file_indep_mode_enabled_content[modules_sysfs] = True - self.fd_number_by_fd_name_dict[modules_sysfs] = i - # mock power_good sysfs for all ports - modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format(f'{i}') - mock_file_content[modules_sysfs] = "1" - mock_is_file_indep_mode_enabled_content[modules_sysfs] = True - self.fd_number_by_fd_name_dict[modules_sysfs] = 200 + i - # mock hw_reset sysfs for all ports - modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_HW_RESET.format(f'{i}') - mock_is_file_indep_mode_enabled_content[modules_sysfs] = True - self.fd_number_by_fd_name_dict[modules_sysfs] = 400 + i - # mock frequency_support sysfs for all ports - modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format(f'{i}') - mock_file_content[modules_sysfs] = "0" - mock_is_file_indep_mode_enabled_content[modules_sysfs] = True - self.fd_number_by_fd_name_dict[modules_sysfs] = 600 + i - - # start modules_mgmt thread and the test in poller part - with patch('select.poll', MagicMock(return_value=MockPollerStopEvent(self.modules_mgmt_task_stopping_event - , self.modules_mgmt_thrd, num_of_tested_ports))): - self.modules_mgmt_thrd.run() - - # change power_on sysfs values back to the default ones - for i in range(num_of_tested_ports): - modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format(f"{i}") - mock_file_content[modules_sysfs] = "1" - - def tearDown(cls): - mock_file_content[modules_mgmt.PROC_CMDLINE] = '' - cls.modules_mgmt_thrd = None - # a check that modules mgmt thread ran and got into the poller part where the tests here has all checks - assert POLLER_EXECUTED diff --git a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py index c98a0d27fc14..98246c2959a4 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py @@ -61,10 +61,7 @@ def test_sfp_index(self, mock_max_port): @mock.patch('sonic_platform.chassis.Chassis.get_num_sfps', mock.MagicMock(return_value=2)) @mock.patch('sonic_platform.chassis.extract_RJ45_ports_index', mock.MagicMock(return_value=[])) def test_sfp_get_error_status(self, mock_get_error_code, mock_control): - chassis = Chassis() - - # Fetch an SFP module to test - sfp = chassis.get_sfp(1) + sfp = SFP(1) mock_control.return_value = False description_dict = sfp._get_error_description_dict() for error in description_dict.keys(): @@ -248,18 +245,14 @@ def test_get_page_and_page_offset(self, mock_get_type_str, mock_eeprom_path, moc assert page == '/tmp/1/data' assert page_offset is 0 - @mock.patch('sonic_platform.sfp.SFP.is_sw_control') @mock.patch('sonic_platform.sfp.SFP._read_eeprom') - def test_sfp_get_presence(self, mock_read, mock_control): + def test_sfp_get_presence(self, mock_read): sfp = SFP(0) mock_read.return_value = None assert not sfp.get_presence() mock_read.return_value = 0 assert sfp.get_presence() - - mock_control.side_effect = RuntimeError('') - assert not sfp.get_presence() @mock.patch('sonic_platform.utils.read_int_from_file') def test_rj45_get_presence(self, mock_read_int): @@ -361,34 +354,20 @@ def test_get_temperature_threshold(self): assert sfp.get_temperature_warning_threshold() == 75.0 assert sfp.get_temperature_critical_threshold() == 85.0 - @mock.patch('sonic_platform.sfp.NvidiaSFPCommon.get_logical_port_by_sfp_index') @mock.patch('sonic_platform.utils.read_int_from_file') - @mock.patch('sonic_platform.device_data.DeviceDataManager.is_independent_mode') - @mock.patch('sonic_platform.utils.DbUtils.get_db_instance') - def test_is_sw_control(self, mock_get_db, mock_mode, mock_read, mock_get_logical): + @mock.patch('sonic_platform.device_data.DeviceDataManager.is_module_host_management_mode') + def test_is_sw_control(self, mock_mode, mock_read): sfp = SFP(0) mock_mode.return_value = False assert not sfp.is_sw_control() mock_mode.return_value = True - mock_get_logical.return_value = None - with pytest.raises(Exception): - sfp.is_sw_control() - - mock_get_logical.return_value = 'Ethernet0' - mock_db = mock.MagicMock() - mock_get_db.return_value = mock_db - mock_db.exists = mock.MagicMock(return_value=False) - with pytest.raises(Exception): - sfp.is_sw_control() - - mock_db.exists.return_value = True mock_read.return_value = 0 assert not sfp.is_sw_control() mock_read.return_value = 1 assert sfp.is_sw_control() - @mock.patch('sonic_platform.device_data.DeviceDataManager.is_independent_mode', mock.MagicMock(return_value=False)) + @mock.patch('sonic_platform.device_data.DeviceDataManager.is_module_host_management_mode', mock.MagicMock(return_value=False)) @mock.patch('sonic_platform.sfp.SFP.is_sw_control', mock.MagicMock(return_value=False)) @mock.patch('sonic_platform.utils.is_host', mock.MagicMock(side_effect = [True, True, False, False])) @mock.patch('subprocess.check_output', mock.MagicMock(side_effect = ['True', 'False'])) @@ -401,7 +380,7 @@ def test_get_lpmode(self): assert sfp.get_lpmode() assert not sfp.get_lpmode() - @mock.patch('sonic_platform.device_data.DeviceDataManager.is_independent_mode', mock.MagicMock(return_value=False)) + @mock.patch('sonic_platform.device_data.DeviceDataManager.is_module_host_management_mode', mock.MagicMock(return_value=False)) @mock.patch('sonic_platform.sfp.SFP.is_sw_control', mock.MagicMock(return_value=False)) @mock.patch('sonic_platform.utils.is_host', mock.MagicMock(side_effect = [True, True, False, False])) @mock.patch('subprocess.check_output', mock.MagicMock(side_effect = ['True', 'False'])) @@ -414,7 +393,7 @@ def test_set_lpmode(self): assert sfp.set_lpmode(False) assert not sfp.set_lpmode(False) - @mock.patch('sonic_platform.device_data.DeviceDataManager.is_independent_mode', mock.MagicMock(return_value=True)) + @mock.patch('sonic_platform.device_data.DeviceDataManager.is_module_host_management_mode', mock.MagicMock(return_value=True)) @mock.patch('sonic_platform.utils.read_int_from_file') @mock.patch('sonic_platform.sfp.SFP.is_sw_control') def test_get_lpmode_cmis_host_mangagement(self, mock_control, mock_read): @@ -438,7 +417,7 @@ def test_get_lpmode_cmis_host_mangagement(self, mock_control, mock_read): mock_read.return_value = 2 assert not sfp.get_lpmode() - @mock.patch('sonic_platform.device_data.DeviceDataManager.is_independent_mode', mock.MagicMock(return_value=True)) + @mock.patch('sonic_platform.device_data.DeviceDataManager.is_module_host_management_mode', mock.MagicMock(return_value=True)) @mock.patch('sonic_platform.sfp.SFP.is_sw_control') def test_set_lpmode_cmis_host_mangagement(self, mock_control): mock_control.return_value = True @@ -455,3 +434,115 @@ def test_set_lpmode_cmis_host_mangagement(self, mock_control): mock_control.return_value = False assert not sfp.set_lpmode(True) assert not sfp.set_lpmode(False) + + def test_determine_control_type(self): + sfp = SFP(0) + sfp.get_xcvr_api = mock.MagicMock(return_value=None) + assert sfp.determine_control_type() == 0 + + sfp.get_xcvr_api.return_value = 1 # Just make it not None + sfp.is_supported_for_software_control = mock.MagicMock(return_value=True) + assert sfp.determine_control_type() == 1 + + sfp.is_supported_for_software_control.return_value = False + assert sfp.determine_control_type() == 0 + + def test_check_power_capability(self): + sfp = SFP(0) + sfp.get_module_max_power = mock.MagicMock(return_value=-1) + assert not sfp.check_power_capability() + + sfp.get_module_max_power.return_value = 48 + sfp.get_power_limit = mock.MagicMock(return_value=48) + assert sfp.check_power_capability() + + sfp.get_power_limit.return_value = 1 + assert not sfp.check_power_capability() + + def test_get_module_max_power(self): + sfp = SFP(0) + sfp.is_cmis_api = mock.MagicMock(return_value=True) + sfp.read_eeprom = mock.MagicMock(return_value=bytearray([48])) + assert sfp.get_module_max_power() == 48 + + sfp.is_cmis_api.return_value = False + sfp.is_sff_api = mock.MagicMock(return_value=True) + sfp.read_eeprom.return_value = bytearray([128]) + assert sfp.get_module_max_power() == 2.5 * 4 + + sfp.read_eeprom.return_value = bytearray([32]) + assert sfp.get_module_max_power() == 3.2 * 4 + + # Simulate invalid value + sfp.read_eeprom.return_value = bytearray([33]) + assert sfp.get_module_max_power() == -1 + + # Simulate unsupported module type + sfp.is_sff_api .return_value = False + assert sfp.get_module_max_power() == -1 + + def test_update_i2c_frequency(self): + sfp = SFP(0) + sfp.get_frequency_support = mock.MagicMock(return_value=False) + sfp.set_frequency = mock.MagicMock() + sfp.update_i2c_frequency() + sfp.set_frequency.assert_not_called() + + sfp.get_frequency_support.return_value = True + sfp.update_i2c_frequency() + sfp.set_frequency.assert_not_called() + + sfp.is_cmis_api = mock.MagicMock(return_value=True) + sfp.read_eeprom = mock.MagicMock(return_value=bytearray([0])) + sfp.update_i2c_frequency() + sfp.set_frequency.assert_called_with(0) + + sfp.is_cmis_api.return_value = False + sfp.is_sff_api = mock.MagicMock(return_value=True) + sfp.update_i2c_frequency() + sfp.set_frequency.assert_called_with(0) + + def test_disable_tx_for_sff_optics(self): + sfp = SFP(0) + mock_api = mock.MagicMock() + sfp.get_xcvr_api = mock.MagicMock(return_value=mock_api) + mock_api.tx_disable = mock.MagicMock() + sfp.disable_tx_for_sff_optics() + mock_api.tx_disable.assert_not_called() + + sfp.is_sff_api = mock.MagicMock(return_value=True) + mock_api.get_tx_disable_support = mock.MagicMock(return_value=True) + sfp.disable_tx_for_sff_optics() + mock_api.tx_disable.assert_called_with(True) + + @mock.patch('sonic_platform.utils.read_int_from_file') + def test_get_error_info_from_sdk_error_type(self, mock_read): + sfp = SFP(0) + # Unknown error + mock_read.return_value = -1 + sfp_state, error_desc = sfp.get_error_info_from_sdk_error_type() + assert sfp_state == '2' + assert 'Unknown error' in error_desc + + mock_read.return_value = 2 + sfp_state, error_desc = sfp.get_error_info_from_sdk_error_type() + assert sfp_state == '11' + assert error_desc is None + + @mock.patch('sonic_platform.chassis.extract_RJ45_ports_index', mock.MagicMock(return_value=[])) + @mock.patch('sonic_platform.device_data.DeviceDataManager.get_sfp_count', mock.MagicMock(return_value=1)) + def test_initialize_sfp_modules(self): + c = Chassis() + c.initialize_sfp() + s = c._sfp_list[0] + s.get_hw_present = mock.MagicMock(return_value=True) + s.get_power_on = mock.MagicMock(return_value=False) + s.get_reset_state = mock.MagicMock(return_value=True) + s.get_power_good = mock.MagicMock(return_value=True) + s.determine_control_type = mock.MagicMock(return_value=1) # software control + s.set_control_type = mock.MagicMock() + SFP.initialize_sfp_modules(c._sfp_list) + assert s.in_stable_state() + SFP.wait_ready_task.stop() + SFP.wait_ready_task.join() + SFP.wait_ready_task = None diff --git a/platform/mellanox/mlnx-platform-api/tests/test_sfp_event.py b/platform/mellanox/mlnx-platform-api/tests/test_sfp_event.py deleted file mode 100644 index ef4820ecfd8f..000000000000 --- a/platform/mellanox/mlnx-platform-api/tests/test_sfp_event.py +++ /dev/null @@ -1,61 +0,0 @@ -# -# Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. -# Apache-2.0 -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -import os -import sys - -from mock import MagicMock, patch - -test_path = os.path.dirname(os.path.abspath(__file__)) -modules_path = os.path.dirname(test_path) -sys.path.insert(0, modules_path) - -from sonic_platform_base.sfp_base import SfpBase - -class TestSfpEvent(object): - @classmethod - def setup_class(cls): - os.environ["MLNX_PLATFORM_API_UNIT_TESTING"] = "1" - - @patch('select.select', MagicMock(return_value=([99], None, None))) - def test_check_sfp_status(self): - from sonic_platform.sfp_event import SDK_SFP_STATE_IN, SDK_SFP_STATE_OUT, SDK_SFP_STATE_ERR - from sonic_platform.sfp_event import SDK_ERRORS_TO_ERROR_BITS, SDK_ERRORS_TO_DESCRIPTION, SDK_SFP_BLOCKING_ERRORS - - self.executor(SDK_SFP_STATE_IN, None, SfpBase.SFP_STATUS_BIT_INSERTED) - self.executor(SDK_SFP_STATE_OUT, None, SfpBase.SFP_STATUS_BIT_REMOVED) - for error_type, error_status in SDK_ERRORS_TO_ERROR_BITS.items(): - description = SDK_ERRORS_TO_DESCRIPTION.get(error_type) - if error_type in SDK_SFP_BLOCKING_ERRORS: - error_status |= SfpBase.SFP_ERROR_BIT_BLOCKING - error_status |= SfpBase.SFP_STATUS_BIT_INSERTED - self.executor(SDK_SFP_STATE_ERR, error_type, error_status, description) - - def executor(self, mock_module_state, mock_error_type, expect_status, description=None): - from sonic_platform.sfp_event import sfp_event - - event = sfp_event() - event.on_pmpe = MagicMock(return_value=(True, [0,1], mock_module_state, mock_error_type)) - port_change = {} - error_dict = {} - found = event.check_sfp_status(port_change, error_dict, 0) - assert found - expect_status_str = str(expect_status) - assert 1 in port_change and port_change[1] == expect_status_str - assert 2 in port_change and port_change[2] == expect_status_str - if description: - assert 1 in error_dict and error_dict[1] == description - assert 2 in error_dict and error_dict[2] == description diff --git a/platform/mellanox/mlnx-platform-api/tests/test_sfp_sm.py b/platform/mellanox/mlnx-platform-api/tests/test_sfp_sm.py new file mode 100644 index 000000000000..9f2154173d32 --- /dev/null +++ b/platform/mellanox/mlnx-platform-api/tests/test_sfp_sm.py @@ -0,0 +1,170 @@ +# +# Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. +# Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +import os +import sys +if sys.version_info.major == 3: + from unittest import mock +else: + import mock + +test_path = os.path.dirname(os.path.abspath(__file__)) +modules_path = os.path.dirname(test_path) +sys.path.insert(0, modules_path) + +from sonic_platform import sfp +from sonic_platform import utils + +origin_read = utils.read_from_file +origin_write = utils.write_file + + +class TestSfpStateMachine: + PATH_PREFIX = '/sys/module/sx_core/asic0/module0' + mock_file_content = {} + + @classmethod + def setup_class(cls): + utils.read_from_file = cls.mock_read + utils.write_file = cls.mock_write + + @classmethod + def teardown_class(cls): + utils.read_from_file = origin_read + utils.write_file = origin_write + + @classmethod + def mock_value(cls, file_name, value): + cls.mock_file_content[f'{cls.PATH_PREFIX}/{file_name}'] = value + + @classmethod + def get_value(cls, file_name): + return cls.mock_file_content[f'{cls.PATH_PREFIX}/{file_name}'] + + @classmethod + def mock_write(cls, file_path, value, *args, **kwargs): + cls.mock_file_content[file_path] = value + + @classmethod + def mock_read(cls, file_path, *args, **kwargs): + return cls.mock_file_content[file_path] + + def test_warm_reboot_from_fw_control(self): + self.mock_value('control', 0) + s = sfp.SFP(0) + s.on_event(sfp.EVENT_START) + assert s.get_state() == sfp.STATE_FW_CONTROL + + def test_no_hw_present(self): + self.mock_value('control', 1) + self.mock_value('hw_present', 0) + s = sfp.SFP(0) + s.on_event(sfp.EVENT_START) + assert s.get_state() == sfp.STATE_NOT_PRESENT + + def test_not_powered(self): + self.mock_value('control', 1) + self.mock_value('hw_present', 1) + self.mock_value('power_on', 0) + s = sfp.SFP(0) + s.on_event(sfp.EVENT_START) + assert s.get_state() == sfp.STATE_RESETTING + assert self.get_value('power_on') == 1 + assert self.get_value('hw_reset') == 1 + assert 0 in sfp.SFP.get_wait_ready_task()._wait_dict + sfp.SFP.get_wait_ready_task()._wait_dict.pop(0) + + def test_in_reset_state(self): + self.mock_value('control', 1) + self.mock_value('hw_present', 1) + self.mock_value('power_on', 1) + self.mock_value('hw_reset', 0) + s = sfp.SFP(0) + s.on_event(sfp.EVENT_START) + assert s.get_state() == sfp.STATE_RESETTING + assert self.get_value('hw_reset') == 1 + assert 0 in sfp.SFP.get_wait_ready_task()._wait_dict + s.on_event(sfp.EVENT_NOT_PRESENT) + assert s.get_state() == sfp.STATE_NOT_PRESENT + assert 0 not in sfp.SFP.get_wait_ready_task()._wait_dict + + def test_reset_done(self): + self.mock_value('control', 1) + self.mock_value('hw_present', 1) + self.mock_value('power_on', 1) + self.mock_value('hw_reset', 0) + self.mock_value('power_good', 1) + s = sfp.SFP(0) + s.determine_control_type = mock.MagicMock(return_value=sfp.SFP_FW_CONTROL) + s.on_event(sfp.EVENT_START) + assert s.get_state() == sfp.STATE_RESETTING + s.on_event(sfp.EVENT_RESET_DONE) + assert s.get_state() == sfp.STATE_FW_CONTROL + + def test_no_power_good(self): + self.mock_value('control', 1) + self.mock_value('hw_present', 1) + self.mock_value('power_on', 1) + self.mock_value('hw_reset', 1) + self.mock_value('power_good', 0) + s = sfp.SFP(0) + s.on_event(sfp.EVENT_START) + assert s.get_state() == sfp.STATE_POWER_BAD + s.on_event(sfp.EVENT_NOT_PRESENT) + assert s.get_state() == sfp.STATE_NOT_PRESENT + + def test_fw_control(self): + self.mock_value('control', 1) + self.mock_value('hw_present', 1) + self.mock_value('power_on', 1) + self.mock_value('hw_reset', 1) + self.mock_value('power_good', 1) + s = sfp.SFP(0) + s.determine_control_type = mock.MagicMock(return_value=sfp.SFP_FW_CONTROL) + s.on_event(sfp.EVENT_START) + assert s.get_state() == sfp.STATE_FW_CONTROL + assert self.get_value('control') == sfp.SFP_FW_CONTROL + + def test_power_exceed(self): + self.mock_value('control', 1) + self.mock_value('hw_present', 1) + self.mock_value('power_on', 1) + self.mock_value('hw_reset', 1) + self.mock_value('power_good', 1) + s = sfp.SFP(0) + s.determine_control_type = mock.MagicMock(return_value=sfp.SFP_SW_CONTROL) + s.check_power_capability = mock.MagicMock(return_value=False) + s.on_event(sfp.EVENT_START) + assert s.get_state() == sfp.STATE_POWER_LIMIT_ERROR + assert self.get_value('power_on') == 0 + assert self.get_value('hw_reset') == 0 + s.on_event(sfp.EVENT_NOT_PRESENT) + assert s.get_state() == sfp.STATE_NOT_PRESENT + + def test_sw_control(self): + self.mock_value('control', 1) + self.mock_value('hw_present', 1) + self.mock_value('power_on', 1) + self.mock_value('hw_reset', 1) + self.mock_value('power_good', 1) + s = sfp.SFP(0) + s.determine_control_type = mock.MagicMock(return_value=sfp.SFP_SW_CONTROL) + s.check_power_capability = mock.MagicMock(return_value=True) + s.update_i2c_frequency = mock.MagicMock() + s.disable_tx_for_sff_optics = mock.MagicMock() + s.on_event(sfp.EVENT_START) + assert s.get_state() == sfp.STATE_SW_CONTROL diff --git a/platform/mellanox/mlnx-platform-api/tests/test_statemachine.py b/platform/mellanox/mlnx-platform-api/tests/test_statemachine.py new file mode 100644 index 000000000000..f2193a6866d4 --- /dev/null +++ b/platform/mellanox/mlnx-platform-api/tests/test_statemachine.py @@ -0,0 +1,137 @@ +# +# Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. +# Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +import os +import pytest +import sys + +from mock import MagicMock +if sys.version_info.major == 3: + from unittest import mock +else: + import mock + +test_path = os.path.dirname(os.path.abspath(__file__)) +modules_path = os.path.dirname(test_path) +sys.path.insert(0, modules_path) + +from sonic_platform import state_machine + +STATE_DOWN = 'Down' +STATE_INIT = 'Initializing' +STATE_UP = 'Up' + +ACTION_LEAVE_DOWN = 'Leave Down' +ACTION_INIT = 'Initializing' +ACTION_UP = 'Up' + +EVENT_START = 'Start' +EVENT_INIT_DONE = 'Initialize Done' +EVENT_STOP = 'Stop' + +class StateEntity: + def __init__(self): + self.state = STATE_DOWN + self.current_action = None + self.triggered_actions = [] + + def get_state(self): + return self.state + + def change_state(self, new_state): + self.state = new_state + + def on_event(self, event): + pass + + def on_action(self, action_name): + self.current_action = action_name + self.triggered_actions.append(action_name) + + +class TestStateMachine: + sm = None + @classmethod + def setup_class(cls): + sm = state_machine.StateMachine() + sm.add_state(STATE_DOWN).set_leave_action(ACTION_LEAVE_DOWN) \ + .add_transition(EVENT_START, STATE_INIT) + sm.add_state(STATE_INIT).set_entry_action(ACTION_INIT) \ + .add_transition(EVENT_INIT_DONE, STATE_UP) \ + .add_transition(EVENT_STOP, STATE_DOWN) + sm.add_state(STATE_UP).set_entry_action(ACTION_UP) \ + .add_transition(EVENT_STOP, STATE_DOWN) + cls.sm = sm + + def test_state_machine(self): + state_entity = StateEntity() + + # Start + self.sm.on_event(state_entity, EVENT_START) + assert state_entity.triggered_actions == [ACTION_LEAVE_DOWN, ACTION_INIT] + assert state_entity.get_state() == STATE_INIT + + # Initialize done + self.sm.on_event(state_entity, EVENT_INIT_DONE) + assert state_entity.current_action == ACTION_UP + assert state_entity.get_state() == STATE_UP + + # Stop + self.sm.on_event(state_entity, EVENT_STOP) + assert state_entity.get_state() == STATE_DOWN + + # Quick start/stop + self.sm.on_event(state_entity, EVENT_START) + self.sm.on_event(state_entity, EVENT_STOP) + assert state_entity.get_state() == STATE_DOWN + + # Event not defined for this state, state machine should ignore it + self.sm.on_event(state_entity, EVENT_STOP) + assert state_entity.get_state() == STATE_DOWN + + def test_unknown_state(self): + state_entity = StateEntity() + state_entity.state = 'unknown' + with pytest.raises(RuntimeError): + # Trigger unknown event + self.sm.on_event(state_entity, EVENT_START) + + def test_duplicate_state(self): + sm = state_machine.StateMachine() + sm.add_state(STATE_DOWN) + with pytest.raises(RuntimeError): + # Add duplicate state + sm.add_state(STATE_DOWN) + + def test_duplicate_transition(self): + sm = state_machine.StateMachine() + with pytest.raises(RuntimeError): + # Add duplicate transition + sm.add_state(STATE_DOWN) \ + .add_transition(EVENT_START, STATE_INIT) \ + .add_transition(EVENT_START, STATE_INIT) + + def test_unknown_transition_target(self): + sm = state_machine.StateMachine() + # Add unknown transition target + sm.add_state(STATE_DOWN) \ + .add_transition(EVENT_START, 'unknown') + + state_entity = StateEntity() + with pytest.raises(RuntimeError): + sm.on_event(state_entity, EVENT_START) + \ No newline at end of file diff --git a/platform/mellanox/mlnx-platform-api/tests/test_thermal_updater.py b/platform/mellanox/mlnx-platform-api/tests/test_thermal_updater.py index 8e7509ce9b69..c135395c363b 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_thermal_updater.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_thermal_updater.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2023-2024 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -61,10 +61,8 @@ def test_load_tc_config_mocked(self): @mock.patch('sonic_platform.thermal_updater.ThermalUpdater.update_asic', mock.MagicMock()) @mock.patch('sonic_platform.thermal_updater.ThermalUpdater.update_module', mock.MagicMock()) - @mock.patch('sonic_platform.thermal_updater.ThermalUpdater.wait_all_sfp_ready') @mock.patch('sonic_platform.utils.write_file') - def test_start_stop(self, mock_write, mock_wait): - mock_wait.return_value = True + def test_start_stop(self, mock_write): mock_sfp = mock.MagicMock() mock_sfp.sdk_index = 1 updater = ThermalUpdater([mock_sfp]) @@ -77,21 +75,6 @@ def test_start_stop(self, mock_write, mock_wait): assert not updater._timer.is_alive() mock_write.assert_called_once_with('/run/hw-management/config/suspend', 1) - mock_wait.return_value = False - mock_write.reset_mock() - updater.start() - mock_write.assert_called_once_with('/run/hw-management/config/suspend', 1) - updater.stop() - - @mock.patch('sonic_platform.thermal_updater.time.sleep', mock.MagicMock()) - def test_wait_all_sfp_ready(self): - mock_sfp = mock.MagicMock() - mock_sfp.is_sw_control = mock.MagicMock(return_value=True) - updater = ThermalUpdater([mock_sfp]) - assert updater.wait_all_sfp_ready() - mock_sfp.is_sw_control.side_effect = Exception('') - assert not updater.wait_all_sfp_ready() - @mock.patch('sonic_platform.utils.read_int_from_file') def test_update_asic(self, mock_read): mock_read.return_value = 8 diff --git a/platform/mellanox/mlnx-platform-api/tests/test_wait_sfp_ready_task.py b/platform/mellanox/mlnx-platform-api/tests/test_wait_sfp_ready_task.py new file mode 100644 index 000000000000..16e361f09327 --- /dev/null +++ b/platform/mellanox/mlnx-platform-api/tests/test_wait_sfp_ready_task.py @@ -0,0 +1,51 @@ +# +# Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. +# Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +import os +import sys + +if sys.version_info.major == 3: + from unittest import mock +else: + import mock + +test_path = os.path.dirname(os.path.abspath(__file__)) +modules_path = os.path.dirname(test_path) +sys.path.insert(0, modules_path) + +from sonic_platform import wait_sfp_ready_task +from sonic_platform import utils + + +class TestWaitSfpReadyTask: + def test_schedule(self): + task = wait_sfp_ready_task.WaitSfpReadyTask() + task.schedule_wait(0) + assert not task.empty() + task.cancel_wait(0) + assert task.empty() + + def test_run(self): + task = wait_sfp_ready_task.WaitSfpReadyTask() + task.WAIT_TIME = 1 # Fast the test + task.start() + task.schedule_wait(0) + assert utils.wait_until(lambda: 0 in task.get_ready_set(), 4, 0.5), 'sfp does not reach ready in 4 seconds' + assert 0 not in task._wait_dict + assert len(task._ready_set) == 0 + task.stop() + task.join() From 7da58a7d600c8350b3269e1ed1dccf7f63b76d67 Mon Sep 17 00:00:00 2001 From: jingwenxie Date: Wed, 8 May 2024 12:02:08 +0800 Subject: [PATCH 294/419] [YANG] Add valid v6 address to sonic-dhcp-sever.yang (#18690) #### Why I did it The PR is to allow v6 address in DHCP_SERVER table which was generated from PROD minigraph. This is to pass the YANG validation. #### How I did it Replace ipv4-address with ip-address which is a union of ipv4-address nad ipv6-address #### How to verify it Unit test --- src/sonic-yang-models/tests/files/sample_config_db.json | 3 ++- .../tests/yang_model_tests/tests_config/dhcp_server.json | 6 ++++++ src/sonic-yang-models/yang-models/sonic-dhcp-server.yang | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 0e1ca2bd168a..4ec38d2b1145 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -7,7 +7,8 @@ }, "DHCP_SERVER": { "192.0.0.8": {}, - "192.0.0.8": {} + "192.0.0.8": {}, + "2603:10e1:0:6f4::1": {} }, "DNS_NAMESERVER": { "1.1.1.1": {}, diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/dhcp_server.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/dhcp_server.json index 9fb7ccce99f8..36bf89af1f43 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/dhcp_server.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/dhcp_server.json @@ -8,6 +8,12 @@ }, { "ip": "10.1.9.2" + }, + { + "ip": "2603:10e1:0:6f4::1" + }, + { + "ip": "2603:10e1:0:6f5::1" } ] } diff --git a/src/sonic-yang-models/yang-models/sonic-dhcp-server.yang b/src/sonic-yang-models/yang-models/sonic-dhcp-server.yang index 0ca5e8636c91..5f5039ae2dfc 100644 --- a/src/sonic-yang-models/yang-models/sonic-dhcp-server.yang +++ b/src/sonic-yang-models/yang-models/sonic-dhcp-server.yang @@ -40,7 +40,7 @@ module sonic-dhcp-server { leaf ip { description "IP as DHCP_SERVER"; - type inet:ipv4-address; + type inet:ip-address; } } /* end of list IPS_LIST */ From e7c7c1501c89404ddc69b6fad715d9f8dde12791 Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Wed, 15 May 2024 18:45:26 -0700 Subject: [PATCH 295/419] [202311][FRR]FRR/zebra error messages for routes from kernel default table (#18955) Why I did it Fix issue #18887 Work item tracking Microsoft ADO (number only): How I did it Reintroduced the patch #12912 for 202311 How to verify it Integrate patch and check for error --- ...-fpm-ignore-route-from-default-table.patch | 51 ++++++++++++++----- 1 file changed, 38 insertions(+), 13 deletions(-) diff --git a/src/sonic-frr/patch/0035-fpm-ignore-route-from-default-table.patch b/src/sonic-frr/patch/0035-fpm-ignore-route-from-default-table.patch index e925b9908fb6..b90092446fe7 100644 --- a/src/sonic-frr/patch/0035-fpm-ignore-route-from-default-table.patch +++ b/src/sonic-frr/patch/0035-fpm-ignore-route-from-default-table.patch @@ -1,19 +1,46 @@ -From bb3b003840959adf5b5be52e91bc798007c9857a Mon Sep 17 00:00:00 2001 -From: Ying Xie -Date: Thu, 8 Sep 2022 04:20:36 +0000 -Subject: [PATCH] From 776a29e8ab32c1364ee601a8730aabb773b0c86b Mon Sep 17 - 00:00:00 2001 Subject: [PATCH] ignore route from default table +commit 8b78a43ba243df281f2096a84893ad87cb2a79ff +Author: Stephen Xu +Date: Wed Nov 16 16:07:37 2022 -0500 -Signed-off-by: Ying Xie ---- - zebra/zebra_fpm_netlink.c | 5 +++++ - 1 file changed, 5 insertions(+) + [PATCH] ignore route from default table + Signed-off-by: Stephen Xu + +diff --git a/zebra/zebra_fpm.c b/zebra/zebra_fpm.c +index 43958fdfd..de7e246d4 100644 +--- a/zebra/zebra_fpm.c ++++ b/zebra/zebra_fpm.c +@@ -25,6 +25,7 @@ + + #include "log.h" + #include "libfrr.h" ++#include "rib.h" + #include "stream.h" + #include "thread.h" + #include "network.h" +@@ -1016,8 +1017,15 @@ static int zfpm_build_route_updates(void) + else + zfpm_g->stats.route_dels++; + } else { +- zlog_err("%s: Encoding Prefix: %pRN No valid nexthops", +- __func__, dest->rnode); ++ struct rib_table_info *table_info = ++ rib_table_info(rib_dest_table(dest)); ++ if (table_info && table_info->table_id == RT_TABLE_DEFAULT) { ++ zfpm_debug("%s: Skip encoding default table prefix: %pRN", ++ __func__, dest->rnode); ++ } else { ++ zlog_err("%s: Encoding Prefix: %pRN No valid nexthops", ++ __func__, dest->rnode); ++ } + } + } + diff --git a/zebra/zebra_fpm_netlink.c b/zebra/zebra_fpm_netlink.c -index 34be9fb39..d6c875a7e 100644 +index ec22c5dd4..53e5f59fb 100644 --- a/zebra/zebra_fpm_netlink.c +++ b/zebra/zebra_fpm_netlink.c -@@ -283,6 +283,11 @@ static int netlink_route_info_fill(struct netlink_route_info *ri, int cmd, +@@ -278,6 +278,11 @@ static int netlink_route_info_fill(struct netlink_route_info *ri, int cmd, rib_table_info(rib_dest_table(dest)); struct zebra_vrf *zvrf = table_info->zvrf; @@ -25,5 +52,3 @@ index 34be9fb39..d6c875a7e 100644 memset(ri, 0, sizeof(*ri)); ri->prefix = rib_dest_prefix(dest); --- -2.17.1 From 3fb97f2cc7129347a4a2f49afba21a96cb3800f0 Mon Sep 17 00:00:00 2001 From: Yaqiang Zhu Date: Fri, 17 May 2024 02:55:43 +0800 Subject: [PATCH 296/419] [202311][dhcp_server] Add support for monitoring used but invalid range/option #18945 (#18973) * [dhcp_server] Add support for monitoring used but invalid range --- .../dhcp_utilities/dhcpservd/dhcp_cfggen.py | 4 ++-- src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py index 43b2df38e452..26c839672280 100755 --- a/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py +++ b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py @@ -150,6 +150,7 @@ def _construct_obj_for_template(self, dhcp_server_ipv4, port_ips, hostname, cust curr_options = {} if "customized_options" in dhcp_config: for option in dhcp_config["customized_options"]: + used_options.add(option) if option not in customized_option_keys: syslog.syslog(syslog.LOG_WARNING, "Customized option {} configured for {} is not defined" .format(option, dhcp_interface_name)) @@ -185,7 +186,6 @@ def _construct_obj_for_template(self, dhcp_server_ipv4, port_ips, hostname, cust "lease_time": dhcp_config["lease_time"] if "lease_time" in dhcp_config else DEFAULT_LEASE_TIME, "customized_options": curr_options } - used_options = used_options | set(subnet_obj["customized_options"]) subnets.append(subnet_obj) render_obj = { "subnets": subnets, @@ -377,10 +377,10 @@ def _parse_port(self, port_ipv4, vlan_interfaces, vlan_members, ranges): port_ips) if "ranges" in port_config and len(port_config["ranges"]) != 0: for range_name in list(port_config["ranges"]): + used_ranges.add(range_name) if range_name not in ranges: syslog.syslog(syslog.LOG_WARNING, f"Range {range_name} is not in range table, skip") continue - used_ranges.add(range_name) range = ranges[range_name] # Loop the IP of the dhcp interface and find the network that target range is in this network. self._match_range_network(dhcp_interface, dhcp_interface_name, port, range, port_ips) diff --git a/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py b/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py index cc9358b47c0c..70158d775c86 100644 --- a/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py +++ b/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py @@ -312,7 +312,7 @@ def test_parse_port(test_config_db, mock_swsscommon_dbconnector_init, mock_get_r parsed_port, used_ranges = dhcp_cfg_generator._parse_port(ipv4_port, tested_vlan_interfaces, vlan_members, tested_ranges) assert parsed_port == (expected_parsed_port if test_config_db == "mock_config_db.json" else {}) - assert used_ranges == ({"range1", "range0", "range3"} + assert used_ranges == ({"range1", "range0", "range3", "range2", "range6"} if test_config_db == "mock_config_db.json" else set()) @@ -361,7 +361,7 @@ def test_construct_obj_for_template(mock_swsscommon_dbconnector_init, mock_parse port_ips, tested_hostname, customized_options) assert render_obj == expected_render_obj assert enabled_dhcp_interfaces == {"Vlan1000", "Vlan4000", "Vlan3000", "Vlan6000"} - assert used_options == set(["option223"]) + assert used_options == set(["option223", "option60"]) assert subscribe_table == set(PORT_MODE_CHECKER) From 0b469a988d8c98e7a277c589f649a6969a556e6d Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 17 May 2024 04:07:01 +0800 Subject: [PATCH 297/419] [ci/build]: Upgrade SONiC package versions (#18971) --- files/build/versions/default/versions-git | 10 +- files/build/versions/default/versions-mirror | 20 ++-- files/build/versions/default/versions-web | 104 +++++++++--------- .../versions-deb-buster-arm64 | 2 +- .../versions-deb-buster-armhf | 2 +- .../dockers/docker-ptf/versions-deb-buster | 4 +- .../versions-deb-buster | 2 +- .../sonic-slave-buster/versions-deb-buster | 10 +- 8 files changed, 77 insertions(+), 77 deletions(-) diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index 45c77e7c6384..270114080d32 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==a9b9284faf89cd1a426371237df8307c328cc818 +https://chromium.googlesource.com/chromium/tools/depot_tools.git==5a86d1cc3934b7a388c29b6005f64675c56c9949 https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f https://github.com/CESNET/libyang.git==4c733412e7173219166be7053940326a92699765 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==1a779dbfc5fb7830bea7f229ac08cc69eee7e3a0 -https://github.com/FreeRADIUS/freeradius-server.git==4a9fa0d1794e61b2aac651b3f84e44d579813f67 +https://github.com/flashrom/flashrom.git==e177e77f9fa2ee0a1bd459df27558528d8dabc8e +https://github.com/FreeRADIUS/freeradius-server.git==617420d279e2bccac4ebd601396e32c89332ccfa https://github.com/FreeRADIUS/pam_radius.git==d802da75cbfc3062ae1b18d0bf26ac2a030ffdaa https://github.com/jeroennijhof/pam_tacplus.git==b839c440e33c36eced9dcbc287fcfe6237c4c4ce https://github.com/jpirko/libteam.git==8b843e93cee1dab61fb79b01791201cdad45e1d1 @@ -16,8 +16,8 @@ https://github.com/p4lang/ptf.git==c554f83685186be4cfa9387eb5d6d700d2bbd7c0 https://github.com/p4lang/scapy-vxlan.git==85ffe83da156568ee47a0750f638227e6e1d7479 https://github.com/sflow/host-sflow==6edc82d62a1cf0f7fb821587af67e5520624f50d https://github.com/sflow/sflowtool==c42c49cb80b927a4c02e54fc26430417f18f4833 -https://github.com/thom311/libnl==7cc72d19f84698a194bee843af66be9be6179baa +https://github.com/thom311/libnl==6db85366264c9c83e0d53995bfb68e0150184cb4 https://salsa.debian.org/debian/libteam.git==48142125234a665ad5367b724af36a58fb484d3d -https://salsa.debian.org/kernel-team/initramfs-tools.git==cf964bfb4362019fd7fba1e839e403ff950dca8e +https://salsa.debian.org/kernel-team/initramfs-tools.git==8801fda185d2accf39c4095858f76089799bfc7e https://salsa.debian.org/sk-guest/monit.git==c9da7ebb1f35dfba17b50b5969a6e75e29cbec0d https://salsa.debian.org/ssh-team/openssh.git==703b8198a123f57fd09e555a4c62b2d55273d57b diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index a3f6530e9223..d40c748681ea 100644 --- a/files/build/versions/default/versions-mirror +++ b/files/build/versions/default/versions-mirror @@ -1,14 +1,14 @@ 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==20240511T000214Z -debian-security==20240511T000223Z +debian==20240514T000307Z +debian-security==20240514T000247Z download.docker.com_linux_debian_dists_bullseye==2024-05-10T08:31:56Z download.docker.com_linux_debian_dists_buster==2024-05-09T09:19:41Z -packages.trafficmanager.net_snapshot_debian-security_20240511T000223Z_dists_bullseye-security==2024-05-10T17:15:32Z -packages.trafficmanager.net_snapshot_debian-security_20240511T000223Z_dists_buster_updates==2024-05-10T17:15:32Z -packages.trafficmanager.net_snapshot_debian_20240511T000214Z_dists_bullseye==2024-02-10T12:40:37Z -packages.trafficmanager.net_snapshot_debian_20240511T000214Z_dists_bullseye-backports==2024-05-10T20:24:35Z -packages.trafficmanager.net_snapshot_debian_20240511T000214Z_dists_bullseye-updates==2024-05-10T20:24:35Z -packages.trafficmanager.net_snapshot_debian_20240511T000214Z_dists_buster==2023-06-10T08:53:33Z -packages.trafficmanager.net_snapshot_debian_20240511T000214Z_dists_buster-backports==2024-03-09T20:54:54Z -packages.trafficmanager.net_snapshot_debian_20240511T000214Z_dists_buster-updates==2023-06-10T08:55:10Z +packages.trafficmanager.net_snapshot_debian-security_20240514T000247Z_dists_bullseye-security==2024-05-13T21:03:22Z +packages.trafficmanager.net_snapshot_debian-security_20240514T000247Z_dists_buster_updates==2024-05-13T21:03:21Z +packages.trafficmanager.net_snapshot_debian_20240514T000307Z_dists_bullseye==2024-02-10T12:40:37Z +packages.trafficmanager.net_snapshot_debian_20240514T000307Z_dists_bullseye-backports==2024-05-13T20:15:31Z +packages.trafficmanager.net_snapshot_debian_20240514T000307Z_dists_bullseye-updates==2024-05-13T20:15:31Z +packages.trafficmanager.net_snapshot_debian_20240514T000307Z_dists_buster==2023-06-10T08:53:33Z +packages.trafficmanager.net_snapshot_debian_20240514T000307Z_dists_buster-backports==2024-03-09T20:54:54Z +packages.trafficmanager.net_snapshot_debian_20240514T000307Z_dists_buster-updates==2023-06-10T08:55:10Z diff --git a/files/build/versions/default/versions-web b/files/build/versions/default/versions-web index d1cfb5696717..8c88f081e3c2 100644 --- a/files/build/versions/default/versions-web +++ b/files/build/versions/default/versions-web @@ -101,58 +101,58 @@ https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.1/amd64/golang https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.1/amd64/golang-1.15-src_1.15.15-1~deb11u4%2Bfips_amd64.deb==1c920937aa49b602a1bfec3c49747131 https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.1/arm64/golang-1.15-go_1.15.15-1~deb11u4%2Bfips_arm64.deb==0b70c104b907db13ff2fe5d52b3d0008 https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.1/arm64/golang-1.15-src_1.15.15-1~deb11u4%2Bfips_arm64.deb==1d06900f03424fa5ce34a782605983fe -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/golang-1.15-doc_1.15.15-1~deb11u4+fips_all.deb==72ead09139135d4ecd91b76c89128567 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/golang-1.15-go_1.15.15-1~deb11u4+fips_amd64.deb==145e103357a915cc759cc93de602b631 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/golang-1.15-src_1.15.15-1~deb11u4+fips_amd64.deb==1c1a46d5599be92777702643c37d5751 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/golang-1.15_1.15.15-1~deb11u4+fips_all.deb==847bc1fc5ce9c8ebae5176947ab34d30 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/krb5-multidev_1.18.3-6+deb11u4+fips_amd64.deb==41c7aecaf738ceb8e0348b9420d0aa3f -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libgssapi-krb5-2_1.18.3-6+deb11u4+fips_amd64.deb==9ab263ae9192bf4c964ea3ad86012c9a -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libgssrpc4_1.18.3-6+deb11u4+fips_amd64.deb==4913523ed341663cd9a8bd2ea0e5c64a -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libk5crypto3_1.18.3-6+deb11u4+fips_amd64.deb==5c89f642c4265a2f53d8788f93b37aaf -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libkadm5clnt-mit12_1.18.3-6+deb11u4+fips_amd64.deb==19a7a6eeae8387d4114a6b76ff5fc7c8 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libkadm5srv-mit12_1.18.3-6+deb11u4+fips_amd64.deb==2bdb2e358091302bb66f9208cf082807 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libkrb5-3_1.18.3-6+deb11u4+fips_amd64.deb==ba2b9c93e084c442cb1495eef5979b05 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libkrb5-dev_1.18.3-6+deb11u4+fips_amd64.deb==6ffd25f46089ad674fe20f074454297c -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libkrb5support0_1.18.3-6+deb11u4+fips_amd64.deb==851abebe415c61f98bfc5024ef2e54fb -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libpython3.9-minimal_3.9.2-1+fips_amd64.deb==71b75222c8bcd5ede55693a9223a3246 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libpython3.9-stdlib_3.9.2-1+fips_amd64.deb==f4274260999ba26346dc60f95b1cf91c -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libpython3.9_3.9.2-1+fips_amd64.deb==c405132eacaf059c7c903f853d48be7e -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libssl-dev_1.1.1n-0+deb11u5+fips_amd64.deb==7deccb6cb0197bd9dc257d54505533cf -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libssl-doc_1.1.1n-0+deb11u5+fips_all.deb==3ac7462c370d85e42c03b11d26f35016 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libssl1.1_1.1.1n-0+deb11u5+fips_amd64.deb==6a4505b82957d711e983e03364275521 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/openssh-client_8.4p1-5+deb11u2+fips_amd64.deb==1fb734b040398b0fb9c674385253b993 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/openssh-server_8.4p1-5+deb11u2+fips_amd64.deb==8ec9f1fbfedd6c36312c5181d9950b58 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/openssh-sftp-server_8.4p1-5+deb11u2+fips_amd64.deb==02e8be0633aff33497655261256eadca -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/openssl_1.1.1n-0+deb11u5+fips_amd64.deb==ee086d7e1fb0cfd36513ec242381af53 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/python3.9-minimal_3.9.2-1+fips_amd64.deb==ff2d0b457ef7872e0a9c6da65cd2f146 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/python3.9_3.9.2-1+fips_amd64.deb==30be224443931a2a3428aa270b87384a -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/symcrypt-openssl_0.10_amd64.deb==01bc30a1bc6fc07be723258f7a6566b6 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/golang-1.15-doc_1.15.15-1~deb11u4+fips_all.deb==72ead09139135d4ecd91b76c89128567 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/golang-1.15-go_1.15.15-1~deb11u4+fips_arm64.deb==b59f315800ca2ec31de79136dfb8979d -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/golang-1.15-src_1.15.15-1~deb11u4+fips_arm64.deb==0038c68ed1e3adb1b43434af81cff678 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/golang-1.15_1.15.15-1~deb11u4+fips_all.deb==847bc1fc5ce9c8ebae5176947ab34d30 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/krb5-multidev_1.18.3-6+deb11u4+fips_arm64.deb==53130dd865aeedf3f99cc0deca4ae50a -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libgssapi-krb5-2_1.18.3-6+deb11u4+fips_arm64.deb==49255677e3c149d29d059aa2af18747a -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libgssrpc4_1.18.3-6+deb11u4+fips_arm64.deb==1f939eb23261667a9e920d1acb08969c -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libk5crypto3_1.18.3-6+deb11u4+fips_arm64.deb==5b7eb6aa93b20949d7422ad25fe73549 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libkadm5clnt-mit12_1.18.3-6+deb11u4+fips_arm64.deb==c5d5a81770b64a33d6d87f288fdb974c -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libkadm5srv-mit12_1.18.3-6+deb11u4+fips_arm64.deb==267114332521c5de4c88de464fc098de -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libkrb5-3_1.18.3-6+deb11u4+fips_arm64.deb==ce88c2527f79baa4cd29c71580e57807 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libkrb5-dev_1.18.3-6+deb11u4+fips_arm64.deb==6af1cfd53e8e55b5619365d4a462ee35 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libkrb5support0_1.18.3-6+deb11u4+fips_arm64.deb==86768f22a3d883d9d19a814e075a9a1b -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libpython3.9-minimal_3.9.2-1+fips_arm64.deb==870a96b0d9d7fe753d495ad6574e4c03 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libpython3.9-stdlib_3.9.2-1+fips_arm64.deb==f944ca0b75549d6f24d07deb1ea897d4 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libpython3.9_3.9.2-1+fips_arm64.deb==edae5c269e2c401873e7cff3d4f93a7a -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libssl-dev_1.1.1n-0+deb11u5+fips_arm64.deb==2116b0e949a521b02098f01aee5a33d4 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libssl-doc_1.1.1n-0+deb11u5+fips_all.deb==3ac7462c370d85e42c03b11d26f35016 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libssl1.1_1.1.1n-0+deb11u5+fips_arm64.deb==a6a6a6f2d23d91398f44570da6e2e80c -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/openssh-client_8.4p1-5+deb11u2+fips_arm64.deb==b30c745ca94e392740c67225802e9068 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/openssh-server_8.4p1-5+deb11u2+fips_arm64.deb==8ab6d9e3bac9d486bda5664e40f634ef -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/openssh-sftp-server_8.4p1-5+deb11u2+fips_arm64.deb==73c51fa8f165a014571c2bdbd843c517 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/openssl_1.1.1n-0+deb11u5+fips_arm64.deb==5c16b501e97678e7f55c616afa6423bb -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/python3.9-minimal_3.9.2-1+fips_arm64.deb==3ad5f86b07a3f5794ddee1dcd69c1d7e -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/python3.9_3.9.2-1+fips_arm64.deb==4d6307dabcd3060235d6188cfa0346b8 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/symcrypt-openssl_0.10_arm64.deb==7b709cbe2ccbe62fa207b8cae0f88d46 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/golang-1.15-doc_1.15.15-1~deb11u4+fips_all.deb==72ead09139135d4ecd91b76c89128567 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/golang-1.15-go_1.15.15-1~deb11u4+fips_amd64.deb==145e103357a915cc759cc93de602b631 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/golang-1.15-src_1.15.15-1~deb11u4+fips_amd64.deb==1c1a46d5599be92777702643c37d5751 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/golang-1.15_1.15.15-1~deb11u4+fips_all.deb==847bc1fc5ce9c8ebae5176947ab34d30 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/krb5-multidev_1.18.3-6+deb11u4+fips_amd64.deb==41c7aecaf738ceb8e0348b9420d0aa3f +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/libgssapi-krb5-2_1.18.3-6+deb11u4+fips_amd64.deb==9ab263ae9192bf4c964ea3ad86012c9a +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/libgssrpc4_1.18.3-6+deb11u4+fips_amd64.deb==4913523ed341663cd9a8bd2ea0e5c64a +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/libk5crypto3_1.18.3-6+deb11u4+fips_amd64.deb==5c89f642c4265a2f53d8788f93b37aaf +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/libkadm5clnt-mit12_1.18.3-6+deb11u4+fips_amd64.deb==19a7a6eeae8387d4114a6b76ff5fc7c8 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/libkadm5srv-mit12_1.18.3-6+deb11u4+fips_amd64.deb==2bdb2e358091302bb66f9208cf082807 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/libkrb5-3_1.18.3-6+deb11u4+fips_amd64.deb==ba2b9c93e084c442cb1495eef5979b05 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/libkrb5-dev_1.18.3-6+deb11u4+fips_amd64.deb==6ffd25f46089ad674fe20f074454297c +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/libkrb5support0_1.18.3-6+deb11u4+fips_amd64.deb==851abebe415c61f98bfc5024ef2e54fb +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/libpython3.9-minimal_3.9.2-1+fips_amd64.deb==411d2092cd614dd187bdc0ec0bb9598f +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/libpython3.9-stdlib_3.9.2-1+fips_amd64.deb==050267fce1204d8accd8b551a30a66e6 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/libpython3.9_3.9.2-1+fips_amd64.deb==c405132eacaf059c7c903f853d48be7e +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/libssl-dev_1.1.1n-0+deb11u5+fips_amd64.deb==7deccb6cb0197bd9dc257d54505533cf +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/libssl-doc_1.1.1n-0+deb11u5+fips_all.deb==3ac7462c370d85e42c03b11d26f35016 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/libssl1.1_1.1.1n-0+deb11u5+fips_amd64.deb==6a4505b82957d711e983e03364275521 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/openssh-client_8.4p1-5+deb11u2+fips_amd64.deb==1fb734b040398b0fb9c674385253b993 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/openssh-server_8.4p1-5+deb11u2+fips_amd64.deb==8ec9f1fbfedd6c36312c5181d9950b58 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/openssh-sftp-server_8.4p1-5+deb11u2+fips_amd64.deb==02e8be0633aff33497655261256eadca +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/openssl_1.1.1n-0+deb11u5+fips_amd64.deb==ee086d7e1fb0cfd36513ec242381af53 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/python3.9-minimal_3.9.2-1+fips_amd64.deb==b6a0f0d84c8bec43fe49b12092bf3209 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/python3.9_3.9.2-1+fips_amd64.deb==30be224443931a2a3428aa270b87384a +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/symcrypt-openssl_0.12_amd64.deb==46411c8f45a1382af5d3ee8ef7f150aa +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/golang-1.15-doc_1.15.15-1~deb11u4+fips_all.deb==72ead09139135d4ecd91b76c89128567 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/golang-1.15-go_1.15.15-1~deb11u4+fips_arm64.deb==b59f315800ca2ec31de79136dfb8979d +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/golang-1.15-src_1.15.15-1~deb11u4+fips_arm64.deb==0038c68ed1e3adb1b43434af81cff678 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/golang-1.15_1.15.15-1~deb11u4+fips_all.deb==847bc1fc5ce9c8ebae5176947ab34d30 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/krb5-multidev_1.18.3-6+deb11u4+fips_arm64.deb==53130dd865aeedf3f99cc0deca4ae50a +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/libgssapi-krb5-2_1.18.3-6+deb11u4+fips_arm64.deb==49255677e3c149d29d059aa2af18747a +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/libgssrpc4_1.18.3-6+deb11u4+fips_arm64.deb==1f939eb23261667a9e920d1acb08969c +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/libk5crypto3_1.18.3-6+deb11u4+fips_arm64.deb==5b7eb6aa93b20949d7422ad25fe73549 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/libkadm5clnt-mit12_1.18.3-6+deb11u4+fips_arm64.deb==c5d5a81770b64a33d6d87f288fdb974c +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/libkadm5srv-mit12_1.18.3-6+deb11u4+fips_arm64.deb==267114332521c5de4c88de464fc098de +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/libkrb5-3_1.18.3-6+deb11u4+fips_arm64.deb==ce88c2527f79baa4cd29c71580e57807 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/libkrb5-dev_1.18.3-6+deb11u4+fips_arm64.deb==6af1cfd53e8e55b5619365d4a462ee35 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/libkrb5support0_1.18.3-6+deb11u4+fips_arm64.deb==86768f22a3d883d9d19a814e075a9a1b +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/libpython3.9-minimal_3.9.2-1+fips_arm64.deb==7e6ac5f9bce1ecd59532ed669040436d +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/libpython3.9-stdlib_3.9.2-1+fips_arm64.deb==60615729bf2eada00dab3245c986bb4a +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/libpython3.9_3.9.2-1+fips_arm64.deb==edae5c269e2c401873e7cff3d4f93a7a +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/libssl-dev_1.1.1n-0+deb11u5+fips_arm64.deb==2116b0e949a521b02098f01aee5a33d4 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/libssl-doc_1.1.1n-0+deb11u5+fips_all.deb==3ac7462c370d85e42c03b11d26f35016 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/libssl1.1_1.1.1n-0+deb11u5+fips_arm64.deb==a6a6a6f2d23d91398f44570da6e2e80c +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/openssh-client_8.4p1-5+deb11u2+fips_arm64.deb==b30c745ca94e392740c67225802e9068 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/openssh-server_8.4p1-5+deb11u2+fips_arm64.deb==8ab6d9e3bac9d486bda5664e40f634ef +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/openssh-sftp-server_8.4p1-5+deb11u2+fips_arm64.deb==73c51fa8f165a014571c2bdbd843c517 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/openssl_1.1.1n-0+deb11u5+fips_arm64.deb==5c16b501e97678e7f55c616afa6423bb +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/python3.9-minimal_3.9.2-1+fips_arm64.deb==846cdb2b1b7a5677699128021c4a40f3 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/python3.9_3.9.2-1+fips_arm64.deb==4d6307dabcd3060235d6188cfa0346b8 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/symcrypt-openssl_0.12_arm64.deb==d59b59b4d157feedeaa27a23b35007b4 https://sonicstorage.blob.core.windows.net/public/onie/onie-recovery-x86_64-kvm_x86_64-r0.iso==54e11e450a461b1f4ae39c3ce3f15eff https://sonicstorage.blob.core.windows.net/public/onie/onie-recovery-x86_64-kvm_x86_64_4_asic-r0.iso==1d8b8d3fa37f842d0184b5205be22be9 https://sonicstorage.blob.core.windows.net/public/onie/onie-recovery-x86_64-kvm_x86_64_6_asic-r0.iso==58494305d4ac201daedf9364a1018a1b 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 286c5bf29414..e1f8de2118a0 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 @@ -2,7 +2,7 @@ icu-devtools==63.1-6+deb10u3 libc-dev-bin==2.28-10+deb10u3 libc6-dev==2.28-10+deb10u3 libdpkg-perl==1.19.8 -libglib2.0-0==2.58.3-2+deb10u5 +libglib2.0-0==2.58.3-2+deb10u6 libicu-dev==63.1-6+deb10u3 libicu63==63.1-6+deb10u3 libxml2==2.9.4+dfsg1-7+deb10u6 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 286c5bf29414..e1f8de2118a0 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 @@ -2,7 +2,7 @@ icu-devtools==63.1-6+deb10u3 libc-dev-bin==2.28-10+deb10u3 libc6-dev==2.28-10+deb10u3 libdpkg-perl==1.19.8 -libglib2.0-0==2.58.3-2+deb10u5 +libglib2.0-0==2.58.3-2+deb10u6 libicu-dev==63.1-6+deb10u3 libicu63==63.1-6+deb10u3 libxml2==2.9.4+dfsg1-7+deb10u6 diff --git a/files/build/versions/dockers/docker-ptf/versions-deb-buster b/files/build/versions/dockers/docker-ptf/versions-deb-buster index f87566b1e2e2..8bcdee3e574c 100644 --- a/files/build/versions/dockers/docker-ptf/versions-deb-buster +++ b/files/build/versions/dockers/docker-ptf/versions-deb-buster @@ -174,8 +174,8 @@ libgirepository-1.0-1==1.58.3-2 libgl1==1.1.0-1 libgl1-mesa-dri==18.3.6-2+deb10u1 libglapi-mesa==18.3.6-2+deb10u1 -libglib2.0-0==2.58.3-2+deb10u5 -libglib2.0-data==2.58.3-2+deb10u5 +libglib2.0-0==2.58.3-2+deb10u6 +libglib2.0-data==2.58.3-2+deb10u6 libglvnd0==1.1.0-1 libglx-mesa0==18.3.6-2+deb10u1 libglx0==1.1.0-1 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 84f912677860..9515fdc04786 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 @@ -7,7 +7,7 @@ libcjson1==1.7.10-1.1+deb10u2 libcurl3-gnutls==7.64.0-4+deb10u9 libdw1==0.176-1.1+deb10u1 libedit2==3.1-20181209-1 -libglib2.0-0==2.58.3-2+deb10u5 +libglib2.0-0==2.58.3-2+deb10u6 libgpm2==1.20.7-5 libicu63==63.1-6+deb10u3 libipt2==2.0-2 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 c7789af9c806..ef905e469e58 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster @@ -562,11 +562,11 @@ libgl1-mesa-dri==18.3.6-2+deb10u1 libglapi-mesa==18.3.6-2+deb10u1 libgles1==1.1.0-1 libgles2==1.1.0-1 -libglib2.0-0==2.58.3-2+deb10u5 -libglib2.0-bin==2.58.3-2+deb10u5 -libglib2.0-data==2.58.3-2+deb10u5 -libglib2.0-dev==2.58.3-2+deb10u5 -libglib2.0-dev-bin==2.58.3-2+deb10u5 +libglib2.0-0==2.58.3-2+deb10u6 +libglib2.0-bin==2.58.3-2+deb10u6 +libglib2.0-data==2.58.3-2+deb10u6 +libglib2.0-dev==2.58.3-2+deb10u6 +libglib2.0-dev-bin==2.58.3-2+deb10u6 libglu1-mesa==9.0.0-2.1+b3 libglu1-mesa-dev==9.0.0-2.1+b3 libglvnd-core-dev==1.1.0-1 From 6c137c30d2982d89b6b23202fc8682808e8507d2 Mon Sep 17 00:00:00 2001 From: Rajkumar-Marvell <54936542+rajkumar38@users.noreply.github.com> Date: Fri, 17 May 2024 05:46:35 +0530 Subject: [PATCH 298/419] [Marvell] Update arm64 sai debian (#18963) Bug fixes: Fixed initialization failures on non-MACSEC AC5X platforms. Signed-off-by: Rajkumar P R --- platform/marvell-arm64/sai.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/marvell-arm64/sai.mk b/platform/marvell-arm64/sai.mk index 23be2753a5d5..85609e63b28c 100644 --- a/platform/marvell-arm64/sai.mk +++ b/platform/marvell-arm64/sai.mk @@ -1,6 +1,6 @@ # Marvell SAI -export MRVL_SAI_VERSION = 1.13.3-1 +export MRVL_SAI_VERSION = 1.13.3-2 export MRVL_SAI = mrvllibsai_$(MRVL_SAI_VERSION)_$(PLATFORM_ARCH).deb $(MRVL_SAI)_SRC_PATH = $(PLATFORM_PATH)/sai From c12a749f1649962ae9d0b4d6e04c198823c94beb Mon Sep 17 00:00:00 2001 From: dbarashinvd <105214075+dbarashinvd@users.noreply.github.com> Date: Sun, 14 Apr 2024 09:11:54 +0300 Subject: [PATCH 299/419] [Mellanox] CMIS management feature enablement (#16968) - Why I did it CMIS management feature enablement - How I did it Add new variable with value 1 for CMIS management feature enablement under specific HWSKU folder. Not the default one - How to verify it Install image on switch with same HWSKU and check "show interfaces status" (Type column) --- .../x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/sai.profile | 1 + .../x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/sai.profile | 1 + 2 files changed, 2 insertions(+) diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/sai.profile b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/sai.profile index 8238fae60b4b..84bc4f66adaf 100644 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/sai.profile @@ -1,2 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4700_8x400g_48x100g.xml SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 +SAI_INDEPENDENT_MODULE_MODE=1 diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/sai.profile b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/sai.profile index 0570470af163..c385087822be 100644 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/sai.profile @@ -1,2 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4700_8x400g_48x200g.xml SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 +SAI_INDEPENDENT_MODULE_MODE=1 From 8cca5388ee0c6d3a59d2b413c54ab405f0706461 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 17 May 2024 19:01:00 +0800 Subject: [PATCH 300/419] [submodule] Update submodule sonic-platform-daemons to the latest HEAD automatically (#18985) #### Why I did it src/sonic-platform-daemons ``` * 61df8be - (HEAD -> 202311, origin/202311) [xcvrd] Fix issue: logical_port_name is not defined (#482) (7 hours ago) [Junchao-Mellanox] ``` #### How I did it #### How to verify it #### Description for the changelog --- 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 867b0c7f2e80..61df8bee00cc 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit 867b0c7f2e80f10f1e177415bb2630d9e7041e7f +Subproject commit 61df8bee00ccc65051217c8dd172f0fa191d8a38 From e53d48c889871c4f42c70c37ee24c98b2014ebb6 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 17 May 2024 19:01:05 +0800 Subject: [PATCH 301/419] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#18977) #### Why I did it src/sonic-utilities ``` * 2d557ff9 - (HEAD -> 202311, origin/202311) Update sonic-utilities to support new SKU Mellanox-SN5600-O128 (#3236) (31 hours ago) [Stephen Sun] * 60a0db88 - [chassis][midplane] Add notification to Supervisor when LC is graceful reboot (#3292) (31 hours ago) [Marty Y. Lok] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index 265c9b368f69..2d557ff95dd0 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 265c9b368f690c27185d48c1ee9b7e4318af9b6b +Subproject commit 2d557ff95dd011b2b658595732205978d7de7685 From c1a38385d685e69837cbdc22e834afc9e27c3f6c Mon Sep 17 00:00:00 2001 From: James An <94036556+jamesan47@users.noreply.github.com> Date: Fri, 17 May 2024 21:13:45 -0700 Subject: [PATCH 302/419] [cisco]: Update cisco-8000.ini (#18988) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Why I did it Release notes for Cisco 8102-64H-O, 8101-32FH, and 8111-32EH-O • [8111] Fix for Mac Aging issue - packet drops while running few traffic tests • Optimization for TM PFC reaction for all port speeds • Ether type change for Packet Capture CLI for SDK 1.66.1 • Updated sensors.conf for upstream test_sensors.py mgmt case • SONiC-Mgmt Test Cases: - Several test case failures incurred due to test environment have been addressed. - Will upload test results to Kusto once run analysis is complete How I did it Update platform version to 202311.1.0.1 --- platform/checkout/cisco-8000.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/checkout/cisco-8000.ini b/platform/checkout/cisco-8000.ini index 1f5b7bed02f7..1c6ae9ce1821 100644 --- a/platform/checkout/cisco-8000.ini +++ b/platform/checkout/cisco-8000.ini @@ -1,3 +1,3 @@ [module] repo=git@github.com:Cisco-8000-sonic/platform-cisco-8000.git -ref=202311.main.0.3 +ref=202311.1.0.1 From 014ffa5dd83fdcdb6d20a7edbe41a720289b618b Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 18 May 2024 16:01:08 +0800 Subject: [PATCH 303/419] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#18961) #### Why I did it src/sonic-swss ``` * e69750d9 - (HEAD -> 202311, origin/202311) [portsorch] process only updated APP_DB fields when port is already created (#3025) (4 days ago) [Stepan Blyshchak] * 10c6b9a2 - [VRF]Fixing vrf orch to update state_db when evpn nvo arrives late (#3140) (4 days ago) [Sudharsan Dhamal Gopalarathnam] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index a821af0421de..e69750d99925 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit a821af0421de316555146615cffd4108ec566e20 +Subproject commit e69750d99925b14d48bd5727544f05b5d5a33625 From b049787ff97d66d4b477101f87b3656fad437340 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sun, 19 May 2024 02:53:02 +0800 Subject: [PATCH 304/419] [ci/build]: Upgrade SONiC package versions (#18995) --- .../versions-py3-all-arm64 | 1 - files/build/versions/default/versions-git | 12 +++++----- files/build/versions/default/versions-mirror | 24 +++++++++---------- .../versions-deb-bullseye | 8 +++---- .../sonic-slave-buster/versions-deb-buster | 2 +- .../versions/host-image/versions-deb-bullseye | 10 ++++---- .../host-image/versions-deb-bullseye-arm64 | 5 ---- .../host-image/versions-deb-bullseye-armhf | 2 +- 8 files changed, 29 insertions(+), 35 deletions(-) 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 44a337154808..b80f4ad9b36d 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 @@ -3,4 +3,3 @@ bitarray==1.5.3 click==7.0 requests==2.31.0 urllib3==2.0.5 -zipp==1.2.0 diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index 270114080d32..99b1f492ed2a 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==5a86d1cc3934b7a388c29b6005f64675c56c9949 +https://chromium.googlesource.com/chromium/tools/depot_tools.git==6708d95ec6d819098093cd57c746636a5bb9a4ea https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f https://github.com/CESNET/libyang.git==4c733412e7173219166be7053940326a92699765 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==e177e77f9fa2ee0a1bd459df27558528d8dabc8e -https://github.com/FreeRADIUS/freeradius-server.git==617420d279e2bccac4ebd601396e32c89332ccfa +https://github.com/flashrom/flashrom.git==643ae4d1fcb9b3bda6f35e8ff6f5b71b1104f600 +https://github.com/FreeRADIUS/freeradius-server.git==66cf26be5e195b56c70288c98a3e62680ff38154 https://github.com/FreeRADIUS/pam_radius.git==d802da75cbfc3062ae1b18d0bf26ac2a030ffdaa https://github.com/jeroennijhof/pam_tacplus.git==b839c440e33c36eced9dcbc287fcfe6237c4c4ce https://github.com/jpirko/libteam.git==8b843e93cee1dab61fb79b01791201cdad45e1d1 @@ -16,8 +16,8 @@ https://github.com/p4lang/ptf.git==c554f83685186be4cfa9387eb5d6d700d2bbd7c0 https://github.com/p4lang/scapy-vxlan.git==85ffe83da156568ee47a0750f638227e6e1d7479 https://github.com/sflow/host-sflow==6edc82d62a1cf0f7fb821587af67e5520624f50d https://github.com/sflow/sflowtool==c42c49cb80b927a4c02e54fc26430417f18f4833 -https://github.com/thom311/libnl==6db85366264c9c83e0d53995bfb68e0150184cb4 +https://github.com/thom311/libnl==49f7822961f5bc6b18cd2a2d3f3b8d2ab0896d3f https://salsa.debian.org/debian/libteam.git==48142125234a665ad5367b724af36a58fb484d3d -https://salsa.debian.org/kernel-team/initramfs-tools.git==8801fda185d2accf39c4095858f76089799bfc7e +https://salsa.debian.org/kernel-team/initramfs-tools.git==15311e6282434f184fb306c38d415f2217239214 https://salsa.debian.org/sk-guest/monit.git==c9da7ebb1f35dfba17b50b5969a6e75e29cbec0d -https://salsa.debian.org/ssh-team/openssh.git==703b8198a123f57fd09e555a4c62b2d55273d57b +https://salsa.debian.org/ssh-team/openssh.git==d150d0d69246f55c711684078f47f999a4bfd6bc diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index d40c748681ea..47d4714e319b 100644 --- a/files/build/versions/default/versions-mirror +++ b/files/build/versions/default/versions-mirror @@ -1,14 +1,14 @@ 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==20240514T000307Z -debian-security==20240514T000247Z -download.docker.com_linux_debian_dists_bullseye==2024-05-10T08:31:56Z -download.docker.com_linux_debian_dists_buster==2024-05-09T09:19:41Z -packages.trafficmanager.net_snapshot_debian-security_20240514T000247Z_dists_bullseye-security==2024-05-13T21:03:22Z -packages.trafficmanager.net_snapshot_debian-security_20240514T000247Z_dists_buster_updates==2024-05-13T21:03:21Z -packages.trafficmanager.net_snapshot_debian_20240514T000307Z_dists_bullseye==2024-02-10T12:40:37Z -packages.trafficmanager.net_snapshot_debian_20240514T000307Z_dists_bullseye-backports==2024-05-13T20:15:31Z -packages.trafficmanager.net_snapshot_debian_20240514T000307Z_dists_bullseye-updates==2024-05-13T20:15:31Z -packages.trafficmanager.net_snapshot_debian_20240514T000307Z_dists_buster==2023-06-10T08:53:33Z -packages.trafficmanager.net_snapshot_debian_20240514T000307Z_dists_buster-backports==2024-03-09T20:54:54Z -packages.trafficmanager.net_snapshot_debian_20240514T000307Z_dists_buster-updates==2023-06-10T08:55:10Z +debian==20240517T000625Z +debian-security==20240517T000237Z +download.docker.com_linux_debian_dists_bullseye==2024-05-16T12:25:40Z +download.docker.com_linux_debian_dists_buster==2024-05-16T12:25:40Z +packages.trafficmanager.net_snapshot_debian-security_20240517T000237Z_dists_bullseye-security==2024-05-16T19:15:12Z +packages.trafficmanager.net_snapshot_debian-security_20240517T000237Z_dists_buster_updates==2024-05-16T19:15:12Z +packages.trafficmanager.net_snapshot_debian_20240517T000625Z_dists_bullseye==2024-02-10T12:40:37Z +packages.trafficmanager.net_snapshot_debian_20240517T000625Z_dists_bullseye-backports==2024-05-16T20:19:56Z +packages.trafficmanager.net_snapshot_debian_20240517T000625Z_dists_bullseye-updates==2024-05-16T20:19:56Z +packages.trafficmanager.net_snapshot_debian_20240517T000625Z_dists_buster==2023-06-10T08:53:33Z +packages.trafficmanager.net_snapshot_debian_20240517T000625Z_dists_buster-backports==2024-03-09T20:54:54Z +packages.trafficmanager.net_snapshot_debian_20240517T000625Z_dists_buster-updates==2023-06-10T08:55:10Z diff --git a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye index cb9e3fa4063e..55b1e4593435 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye @@ -101,7 +101,7 @@ docbook-xsl==1.79.2+dfsg-1 docker-buildx-plugin==0.10.5-1~debian.11~bullseye docker-ce==5:24.0.2-1~debian.11~bullseye docker-ce-cli==5:24.0.2-1~debian.11~bullseye -docker-ce-rootless-extras==5:26.1.2-1~debian.11~bullseye +docker-ce-rootless-extras==5:26.1.3-1~debian.11~bullseye docker-compose-plugin==2.18.1-1~debian.11~bullseye docutils-common==0.16+dfsg-4 dosfstools==4.2-1 @@ -155,7 +155,7 @@ gem2deb==1.4 gem2deb-test-runner==1.4 gettext==0.21-4 gettext-base==0.21-4 -ghostscript==9.53.3~dfsg-7+deb11u6 +ghostscript==9.53.3~dfsg-7+deb11u7 gir1.2-atk-1.0==2.36.0-2 gir1.2-atspi-2.0==2.38.0-4+deb11u1 gir1.2-freedesktop==1.66.1-1+b1 @@ -639,8 +639,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+deb11u6 -libgs9-common==9.53.3~dfsg-7+deb11u6 +libgs9==9.53.3~dfsg-7+deb11u7 +libgs9-common==9.53.3~dfsg-7+deb11u7 libgsasl7==1.10.0-4+deb11u1 libgsm1==1.0.18-2 libgssrpc4==1.18.3-6+deb11u4 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 ef905e469e58..57b8096f0d4e 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster @@ -94,7 +94,7 @@ docbook-xml==4.5-8 docker-buildx-plugin==0.10.5-1~debian.10~buster docker-ce==5:24.0.2-1~debian.10~buster docker-ce-cli==5:24.0.2-1~debian.10~buster -docker-ce-rootless-extras==5:26.1.2-1~debian.10~buster +docker-ce-rootless-extras==5:26.1.3-1~debian.10~buster docker-compose-plugin==2.18.1-1~debian.10~buster docutils-common==0.14+dfsg-4 docutils-doc==0.14+dfsg-4 diff --git a/files/build/versions/host-image/versions-deb-bullseye b/files/build/versions/host-image/versions-deb-bullseye index f1de04ddc7b6..d32e401da4af 100644 --- a/files/build/versions/host-image/versions-deb-bullseye +++ b/files/build/versions/host-image/versions-deb-bullseye @@ -270,14 +270,14 @@ 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 +ntp==1:4.2.8p15+dfsg-1+deb10u2 ntpdate==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+deb11u3 -openssh-server==1:8.4p1-5+deb11u3 -openssh-sftp-server==1:8.4p1-5+deb11u3 -openssl==1.1.1w-0+deb11u1 +openssh-client==1:8.4p1-5+deb11u2+fips +openssh-server==1:8.4p1-5+deb11u2+fips +openssh-sftp-server==1:8.4p1-5+deb11u2+fips +openssl==1.1.1n-0+deb11u5+fips pci.ids==0.0~2021.02.08-1 pciutils==1:3.7.0-5 perl==5.32.1-4+deb11u3 diff --git a/files/build/versions/host-image/versions-deb-bullseye-arm64 b/files/build/versions/host-image/versions-deb-bullseye-arm64 index 8db4768eb28b..12e498f88d20 100644 --- a/files/build/versions/host-image/versions-deb-bullseye-arm64 +++ b/files/build/versions/host-image/versions-deb-bullseye-arm64 @@ -14,12 +14,7 @@ libxslt1-dev==1.1.34-4+deb11u1 libxslt1.1==1.1.34-4+deb11u1 linux-image-5.10.0-23-2-arm64-unsigned==5.10.179-3 linux-libc-dev==5.10.216-1 -ntp==1:4.2.8p15+dfsg-1+deb10u2 ntpstat==0.0.0.1-2 -openssh-client==1:8.4p1-5+deb11u2+fips -openssh-server==1:8.4p1-5+deb11u2+fips -openssh-sftp-server==1:8.4p1-5+deb11u2+fips -openssl==1.1.1n-0+deb11u5+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 5e8afc3a26fb..8b59b1ebe9ee 100644 --- a/files/build/versions/host-image/versions-deb-bullseye-armhf +++ b/files/build/versions/host-image/versions-deb-bullseye-armhf @@ -15,10 +15,10 @@ libxslt1.1==1.1.34-4+deb11u1 linux-image-5.10.0-23-2-armmp==5.10.179-3 linux-libc-dev==5.10.216-1 mrvlprestera==1.0 -ntp==1:4.2.8p15+dfsg-1+deb10u2 ntpstat==0.0.0.1-2 openssh-client==1:8.4p1-5+deb11u2 openssh-server==1:8.4p1-5+deb11u2 openssh-sftp-server==1:8.4p1-5+deb11u2 +openssl==1.1.1w-0+deb11u1 picocom==3.1-2 zlib1g-dev==1:1.2.11.dfsg-2+deb11u2 From bd399c38d76cfc37dc509fee69f1fddd4bed446a Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sun, 19 May 2024 16:00:56 +0800 Subject: [PATCH 305/419] [submodule] Update submodule sonic-platform-daemons to the latest HEAD automatically (#19001) #### Why I did it src/sonic-platform-daemons ``` * df0ff63 - (HEAD -> 202311, origin/202311) CMIS 'ConfigSuccess" failure while changing default ApSel code for 800G DR8/FR8 modules (#459) (22 hours ago) [Anoop Kamath] ``` #### How I did it #### How to verify it #### Description for the changelog --- 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 61df8bee00cc..df0ff63099d9 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit 61df8bee00ccc65051217c8dd172f0fa191d8a38 +Subproject commit df0ff63099d954ad53516b77295fb4366820f59f From 596b2bef9a892d774c0c89605b0352e1f5ad8bb2 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sun, 19 May 2024 16:01:07 +0800 Subject: [PATCH 306/419] [submodule] Update submodule sonic-platform-common to the latest HEAD automatically (#18999) #### Why I did it src/sonic-platform-common ``` * 13cf28e - (HEAD -> 202311, origin/202311) Added API to decommison all datapaths of a CMIS compliant module (#471) (22 hours ago) [Prince George] ``` #### How I did it #### How to verify it #### Description for the changelog --- 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 b9fa9ed69e54..13cf28e71850 160000 --- a/src/sonic-platform-common +++ b/src/sonic-platform-common @@ -1 +1 @@ -Subproject commit b9fa9ed69e54035b0ef7ed9713ead16ed3997d5f +Subproject commit 13cf28e71850af20d997da04c4424324dcec1aa4 From 8ea1659963c39a468ac403b9f29888bcba41de0a Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sun, 19 May 2024 23:59:21 +0800 Subject: [PATCH 307/419] [ci/build]: Upgrade SONiC package versions (#19005) --- .../build/build-sonic-slave-bullseye/versions-py3-all-arm64 | 1 + files/build/versions/default/versions-git | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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 b80f4ad9b36d..44a337154808 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 @@ -3,3 +3,4 @@ bitarray==1.5.3 click==7.0 requests==2.31.0 urllib3==2.0.5 +zipp==1.2.0 diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index 99b1f492ed2a..b5bf6aed7a3b 100644 --- a/files/build/versions/default/versions-git +++ b/files/build/versions/default/versions-git @@ -18,6 +18,6 @@ https://github.com/sflow/host-sflow==6edc82d62a1cf0f7fb821587af67e5520624f50d https://github.com/sflow/sflowtool==c42c49cb80b927a4c02e54fc26430417f18f4833 https://github.com/thom311/libnl==49f7822961f5bc6b18cd2a2d3f3b8d2ab0896d3f https://salsa.debian.org/debian/libteam.git==48142125234a665ad5367b724af36a58fb484d3d -https://salsa.debian.org/kernel-team/initramfs-tools.git==15311e6282434f184fb306c38d415f2217239214 +https://salsa.debian.org/kernel-team/initramfs-tools.git==3436c177b9f362de9687a3afb1b3c7273899db80 https://salsa.debian.org/sk-guest/monit.git==c9da7ebb1f35dfba17b50b5969a6e75e29cbec0d https://salsa.debian.org/ssh-team/openssh.git==d150d0d69246f55c711684078f47f999a4bfd6bc From e1bc0f3eb2e0aaeaac4f3db9e86450ac661359f8 Mon Sep 17 00:00:00 2001 From: Senthil Kumar Guruswamy <75792349+sg893052@users.noreply.github.com> Date: Thu, 16 May 2024 10:55:26 +0530 Subject: [PATCH 308/419] Remove services mentioned in exclude service list for system monitoring (#18911) - Why I did it To address #18814 - How I did it Introduce exclude service list in the code to be parsed and remove the services from the system ready tracking. In this case, it is ztp.service - How to verify it show system-health sysready-status output --- src/system-health/health_checker/sysmonitor.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/system-health/health_checker/sysmonitor.py b/src/system-health/health_checker/sysmonitor.py index 5312603d7365..115dbfbe9ea0 100755 --- a/src/system-health/health_checker/sysmonitor.py +++ b/src/system-health/health_checker/sysmonitor.py @@ -23,7 +23,7 @@ QUEUE_TIMEOUT = 15 TASK_STOP_TIMEOUT = 10 logger = Logger(log_identifier=SYSLOG_IDENTIFIER) - +exclude_srv_list = ['ztp.service'] #Subprocess which subscribes to STATE_DB FEATURE table for any update #and push service events to main process via queue @@ -158,6 +158,11 @@ def get_all_service_list(self): if srv in dir_list: dir_list.remove(srv) + #Remove services from exclude list Eg.ztp.service + for srv in exclude_srv_list: + if srv in dir_list: + dir_list.remove(srv) + dir_list.sort() return dir_list From e37b78ae59bd2c93eb650a463c024ed41c626011 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 22 May 2024 18:27:04 +0800 Subject: [PATCH 309/419] [submodule] Update submodule sonic-host-services to the latest HEAD automatically (#19037) #### Why I did it src/sonic-host-services ``` * 860f386 - (HEAD -> 202311, origin/202311) Fix hostcfgd crash when delete entire config table. (#106) (4 hours ago) [Hua Liu] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-host-services | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-host-services b/src/sonic-host-services index 4caed1137a4b..860f386fff9f 160000 --- a/src/sonic-host-services +++ b/src/sonic-host-services @@ -1 +1 @@ -Subproject commit 4caed1137a4b26113124ab7771c18b0708ebe168 +Subproject commit 860f386fff9ff77a2dfa036e1a4d67d3bc3b6fa4 From f1cbb9014227ce636f99d1513cdaa22b71e6ba1d Mon Sep 17 00:00:00 2001 From: Andriy Yurkiv <70649192+ayurkiv-nvda@users.noreply.github.com> Date: Tue, 7 May 2024 13:38:19 +0300 Subject: [PATCH 310/419] [Mellanox][SN4410] Add missing interfaces to hwsku (#18791) - Why I did it Logic of config generation changed recently Command : sonic-cfggen -H -k ACS-MSN4410 --preset t1 will fail after ONIE installation. There are missing interfaces for 4410 HWSKU. Need to add them. - How I did it Update file device/mellanox/x86_64-mlnx_msn4410-r0/ACS-MSN4410/hwsku.json - How to verify it sonic-cfggen -H -k ACS-MSN4410 --preset t1 will pass successfully on 4410 platform after ONIE installation. Signed-off-by: Andriy Yurkiv --- .../ACS-MSN4410/hwsku.json | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/device/mellanox/x86_64-mlnx_msn4410-r0/ACS-MSN4410/hwsku.json b/device/mellanox/x86_64-mlnx_msn4410-r0/ACS-MSN4410/hwsku.json index 6e1c31705bd4..52d9c481a8cf 100644 --- a/device/mellanox/x86_64-mlnx_msn4410-r0/ACS-MSN4410/hwsku.json +++ b/device/mellanox/x86_64-mlnx_msn4410-r0/ACS-MSN4410/hwsku.json @@ -3,75 +3,147 @@ "Ethernet0": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet4": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet8": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet12": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet16": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet20": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet24": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet28": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet32": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet36": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet40": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet44": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet48": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet52": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet56": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet60": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet64": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet68": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet72": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet76": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet80": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet84": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet88": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet92": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet96": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet100": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet104": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet108": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet112": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet116": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet120": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet124": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet128": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet132": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet136": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet140": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet144": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet148": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet152": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet156": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet160": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet164": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet168": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet172": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet176": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet180": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet184": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet188": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet192": { "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" }, From f0db44a017c20417a957cec282768fadefdb195a Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 22 May 2024 18:27:36 +0800 Subject: [PATCH 311/419] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#19025) #### Why I did it src/sonic-utilities ``` * 673da6bb - (HEAD -> 202311, origin/202311) [cherry-pick][202311] Show running config when bgp is down (#3315) (8 hours ago) [jingwenxie] * 34f01f92 - Migrate AAA table per-command authorization in db_migrator (#3296) (22 hours ago) [Hua Liu] * 3e1ae910 - Migrate AAA table in db_migrator (#3284) (25 hours ago) [Hua Liu] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index 2d557ff95dd0..673da6bb5e29 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 2d557ff95dd011b2b658595732205978d7de7685 +Subproject commit 673da6bb5e29b58294f9c0b71760289a65217af2 From 9f181554289ceb89c0732ff62bc604a1bd48709d Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 23 May 2024 00:52:31 +0800 Subject: [PATCH 312/419] [ci/build]: Upgrade SONiC package versions (#19040) --- files/build/versions/default/versions-git | 10 +++---- files/build/versions/default/versions-mirror | 22 +++++++------- .../sonic-slave-buster/versions-deb-buster | 30 +++++++++---------- 3 files changed, 31 insertions(+), 31 deletions(-) diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index b5bf6aed7a3b..396e71f048d5 100644 --- a/files/build/versions/default/versions-git +++ b/files/build/versions/default/versions-git @@ -1,14 +1,14 @@ -https://chromium.googlesource.com/chromium/tools/depot_tools.git==6708d95ec6d819098093cd57c746636a5bb9a4ea +https://chromium.googlesource.com/chromium/tools/depot_tools.git==ce7ceeb5ad97dd1d85a6ba7799f621cd496364c8 https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f https://github.com/CESNET/libyang.git==4c733412e7173219166be7053940326a92699765 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==643ae4d1fcb9b3bda6f35e8ff6f5b71b1104f600 -https://github.com/FreeRADIUS/freeradius-server.git==66cf26be5e195b56c70288c98a3e62680ff38154 +https://github.com/flashrom/flashrom.git==85b977151b8f5717ad00b7b7204521a823ac1ad2 +https://github.com/FreeRADIUS/freeradius-server.git==0af5ab4593e30ff39c4d20be027b4d489f835986 https://github.com/FreeRADIUS/pam_radius.git==d802da75cbfc3062ae1b18d0bf26ac2a030ffdaa https://github.com/jeroennijhof/pam_tacplus.git==b839c440e33c36eced9dcbc287fcfe6237c4c4ce -https://github.com/jpirko/libteam.git==8b843e93cee1dab61fb79b01791201cdad45e1d1 +https://github.com/jpirko/libteam.git==337125ce8d24ed66d7f4c7e6eef50458f3e7d154 https://github.com/lguohan/gnxi.git==3adf8b97755b49947e465b5a14645f11e79fa0cd https://github.com/Marvell-switching/mrvl-prestera.git==5834b7338ff9ac6f03d45ab85568048be1f62199 https://github.com/Mellanox/libpsample.git==62bb27d9a49424e45191eee81df7ce0d8c74e774 @@ -18,6 +18,6 @@ https://github.com/sflow/host-sflow==6edc82d62a1cf0f7fb821587af67e5520624f50d https://github.com/sflow/sflowtool==c42c49cb80b927a4c02e54fc26430417f18f4833 https://github.com/thom311/libnl==49f7822961f5bc6b18cd2a2d3f3b8d2ab0896d3f https://salsa.debian.org/debian/libteam.git==48142125234a665ad5367b724af36a58fb484d3d -https://salsa.debian.org/kernel-team/initramfs-tools.git==3436c177b9f362de9687a3afb1b3c7273899db80 +https://salsa.debian.org/kernel-team/initramfs-tools.git==2b3148526012c95e1faf0832faa19b9de8c8b67b https://salsa.debian.org/sk-guest/monit.git==c9da7ebb1f35dfba17b50b5969a6e75e29cbec0d https://salsa.debian.org/ssh-team/openssh.git==d150d0d69246f55c711684078f47f999a4bfd6bc diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index 47d4714e319b..5cfcf804f0cd 100644 --- a/files/build/versions/default/versions-mirror +++ b/files/build/versions/default/versions-mirror @@ -1,14 +1,14 @@ 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==20240517T000625Z -debian-security==20240517T000237Z -download.docker.com_linux_debian_dists_bullseye==2024-05-16T12:25:40Z +debian==20240521T063439Z +debian-security==20240521T063453Z +download.docker.com_linux_debian_dists_bullseye==2024-05-20T09:06:01Z download.docker.com_linux_debian_dists_buster==2024-05-16T12:25:40Z -packages.trafficmanager.net_snapshot_debian-security_20240517T000237Z_dists_bullseye-security==2024-05-16T19:15:12Z -packages.trafficmanager.net_snapshot_debian-security_20240517T000237Z_dists_buster_updates==2024-05-16T19:15:12Z -packages.trafficmanager.net_snapshot_debian_20240517T000625Z_dists_bullseye==2024-02-10T12:40:37Z -packages.trafficmanager.net_snapshot_debian_20240517T000625Z_dists_bullseye-backports==2024-05-16T20:19:56Z -packages.trafficmanager.net_snapshot_debian_20240517T000625Z_dists_bullseye-updates==2024-05-16T20:19:56Z -packages.trafficmanager.net_snapshot_debian_20240517T000625Z_dists_buster==2023-06-10T08:53:33Z -packages.trafficmanager.net_snapshot_debian_20240517T000625Z_dists_buster-backports==2024-03-09T20:54:54Z -packages.trafficmanager.net_snapshot_debian_20240517T000625Z_dists_buster-updates==2023-06-10T08:55:10Z +packages.trafficmanager.net_snapshot_debian-security_20240521T063453Z_dists_bullseye-security==2024-05-19T12:12:19Z +packages.trafficmanager.net_snapshot_debian-security_20240521T063453Z_dists_buster_updates==2024-05-19T12:12:19Z +packages.trafficmanager.net_snapshot_debian_20240521T063439Z_dists_bullseye==2024-02-10T12:40:37Z +packages.trafficmanager.net_snapshot_debian_20240521T063439Z_dists_bullseye-backports==2024-05-21T02:21:11Z +packages.trafficmanager.net_snapshot_debian_20240521T063439Z_dists_bullseye-updates==2024-05-21T02:21:11Z +packages.trafficmanager.net_snapshot_debian_20240521T063439Z_dists_buster==2023-06-10T08:53:33Z +packages.trafficmanager.net_snapshot_debian_20240521T063439Z_dists_buster-backports==2024-03-09T20:54:54Z +packages.trafficmanager.net_snapshot_debian_20240521T063439Z_dists_buster-updates==2023-06-10T08:55:10Z 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 57b8096f0d4e..958c8b33ce89 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster @@ -23,7 +23,7 @@ autopoint==0.19.8.1-9 autotools-dev==20180224.1 bash-completion==1:2.8-6 bc==1.07.1-2+b1 -bind9-host==1:9.11.5.P4+dfsg-5.1+deb10u10 +bind9-host==1:9.11.5.P4+dfsg-5.1+deb10u11 binfmt-support==2.2.0-2 binutils==2.31.1-16 binutils-common==2.31.1-16 @@ -85,7 +85,7 @@ distro-info-data==0.41+deb10u9 dkms==2.6.1-4 dmeventd==2:1.02.155-3 dmsetup==2:1.02.155-3 -dnsutils==1:9.11.5.P4+dfsg-5.1+deb10u10 +dnsutils==1:9.11.5.P4+dfsg-5.1+deb10u11 docbook==4.5-6 docbook-dsssl==1.79-9.1 docbook-to-man==1:2.0.0-42 @@ -286,8 +286,8 @@ libbabeltrace-dev==1.5.6-2+deb10u1 libbabeltrace1==1.5.6-2+deb10u1 libbatik-java==1.10-2+deb10u3 libbdplus0==0.1.2-3 -libbind-export-dev==1:9.11.5.P4+dfsg-5.1+deb10u10 -libbind9-161==1:9.11.5.P4+dfsg-5.1+deb10u10 +libbind-export-dev==1:9.11.5.P4+dfsg-5.1+deb10u11 +libbind9-161==1:9.11.5.P4+dfsg-5.1+deb10u11 libbinutils==2.31.1-16 libbison-dev==2:3.3.2.dfsg-1 libbit-vector-perl==7.4-1+b5 @@ -452,8 +452,8 @@ libdist-checkconflicts-perl==0.11-1 libdistro-info-perl==0.21+deb10u1 libdjvulibre-text==3.5.27.1-10+deb10u1 libdjvulibre21==3.5.27.1-10+deb10u1 -libdns-export1104==1:9.11.5.P4+dfsg-5.1+deb10u10 -libdns1104==1:9.11.5.P4+dfsg-5.1+deb10u10 +libdns-export1104==1:9.11.5.P4+dfsg-5.1+deb10u11 +libdns1104==1:9.11.5.P4+dfsg-5.1+deb10u11 libdom4j-java==2.1.1-2 libdouble-conversion1==3.1.0-3 libdoxia-core-java==1.7-2 @@ -670,14 +670,14 @@ libipc-system-simple-perl==1.25-4 libipt2==2.0-2 libiptc-dev==1.8.2-4 libiptc0==1.8.2-4 -libirs-export161==1:9.11.5.P4+dfsg-5.1+deb10u10 -libirs161==1:9.11.5.P4+dfsg-5.1+deb10u10 -libisc-export1100==1:9.11.5.P4+dfsg-5.1+deb10u10 -libisc1100==1:9.11.5.P4+dfsg-5.1+deb10u10 -libisccc-export161==1:9.11.5.P4+dfsg-5.1+deb10u10 -libisccc161==1:9.11.5.P4+dfsg-5.1+deb10u10 -libisccfg-export163==1:9.11.5.P4+dfsg-5.1+deb10u10 -libisccfg163==1:9.11.5.P4+dfsg-5.1+deb10u10 +libirs-export161==1:9.11.5.P4+dfsg-5.1+deb10u11 +libirs161==1:9.11.5.P4+dfsg-5.1+deb10u11 +libisc-export1100==1:9.11.5.P4+dfsg-5.1+deb10u11 +libisc1100==1:9.11.5.P4+dfsg-5.1+deb10u11 +libisccc-export161==1:9.11.5.P4+dfsg-5.1+deb10u11 +libisccc161==1:9.11.5.P4+dfsg-5.1+deb10u11 +libisccfg-export163==1:9.11.5.P4+dfsg-5.1+deb10u11 +libisccfg163==1:9.11.5.P4+dfsg-5.1+deb10u11 libisl19==0.20-2 libitext1-java==1.4-7 libitm1==8.3.0-6 @@ -757,7 +757,7 @@ liblua5.1-0-dev==5.1.5-8.1+b2 liblvm2cmd2.03==2.03.02-3 liblwp-mediatypes-perl==6.02-1 liblwp-protocol-https-perl==6.07-2 -liblwres161==1:9.11.5.P4+dfsg-5.1+deb10u10 +liblwres161==1:9.11.5.P4+dfsg-5.1+deb10u11 liblzma-dev==5.2.4-1+deb10u1 liblzo2-2==2.10-0.1 liblzo2-dev==2.10-0.1 From 0b5893f3dda4a1b3490b7c507797dd418b8c1a3e Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 23 May 2024 16:01:21 +0800 Subject: [PATCH 313/419] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#19043) #### Why I did it src/sonic-utilities ``` * 804e053a - (HEAD -> 202311, origin/202311) [sonic-package-manager] remove leftovers from featured on uninstall (#3305) (10 hours ago) [Stepan Blyshchak] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index 673da6bb5e29..804e053a876e 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 673da6bb5e29b58294f9c0b71760289a65217af2 +Subproject commit 804e053a876eb11a60db9ae42002c4c17b0fbbf8 From 6f33c6195b32920d61a7472d7c86781bb6a761ae Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Wed, 22 May 2024 23:52:59 +0800 Subject: [PATCH 314/419] [Mellanox] Block setting the watchdog in the case that watchdog period is longer than the max period supported by the platform #18980) - Why I did it Currently the platform API will arm the watchdog w/o checking the required watchdog period. If the watchdog period is longer than the max period supported by the platform, it will cause issue on some specific platform. - How I did it Verify whether the required watchdog period is longer than the max period supported, if yes then return failure. - How to verify it test with watchdog util to set the watchdog period to different values including larger than the max supported period, all case passed. Signed-off-by: Kebo Liu --- .../sonic_platform/device_data.py | 21 +++++++++++++++++++ .../sonic_platform/watchdog.py | 5 +++-- .../mlnx-platform-api/tests/test_watchdog.py | 4 +++- 3 files changed, 27 insertions(+), 3 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 6a67c0e6238b..62792919385e 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py @@ -21,6 +21,8 @@ from . import utils +DEFAULT_WD_PERIOD = 65535 + DEVICE_DATA = { 'x86_64-mlnx_msn2700-r0': { 'thermal': { @@ -54,6 +56,9 @@ "cpu_pack": False, "comex_amb": False } + }, + 'watchdog': { + "max_period": 32 } }, 'x86_64-mlnx_msn2410-r0': { @@ -69,6 +74,9 @@ "cpu_pack": False, "comex_amb": False } + }, + 'watchdog': { + "max_period": 32 } }, 'x86_64-mlnx_msn4700_simx-r0': { @@ -276,3 +284,16 @@ def wait_platform_ready(cls): for sysfs_node in sysfs_nodes: conditions.append(lambda: os.path.exists(f'/sys/module/sx_core/asic0/module{sfp_index}/{sysfs_node}')) return utils.wait_until_conditions(conditions, 300, 1) + + @classmethod + @utils.read_only_cache() + def get_watchdog_max_period(cls): + platform_data = DEVICE_DATA.get(cls.get_platform_name(), None) + if not platform_data: + return DEFAULT_WD_PERIOD + + watchdog_data = platform_data.get('watchdog', None) + if not watchdog_data: + return DEFAULT_WD_PERIOD + + return watchdog_data.get('max_period', None) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/watchdog.py b/platform/mellanox/mlnx-platform-api/sonic_platform/watchdog.py index 9e16b6d69cf8..efa626e548ad 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/watchdog.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/watchdog.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2023 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -28,6 +28,7 @@ from sonic_platform_base.watchdog_base import WatchdogBase from . import utils +from .device_data import DeviceDataManager """ ioctl constants """ IO_WRITE = 0x40000000 @@ -150,7 +151,7 @@ def arm(self, seconds): """ ret = WD_COMMON_ERROR - if seconds < 0: + if seconds < 0 or seconds > DeviceDataManager.get_watchdog_max_period(): return ret try: diff --git a/platform/mellanox/mlnx-platform-api/tests/test_watchdog.py b/platform/mellanox/mlnx-platform-api/tests/test_watchdog.py index 6e925d594708..4b5f6c972293 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_watchdog.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_watchdog.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -97,9 +97,11 @@ def test_is_armed(self, mock_read): @mock.patch('sonic_platform.watchdog.WatchdogImplBase.open_handle', mock.MagicMock()) @mock.patch('sonic_platform.watchdog.fcntl.ioctl', mock.MagicMock()) @mock.patch('sonic_platform.watchdog.WatchdogImplBase.is_armed') + @mock.patch('sonic_platform.device_data.DeviceDataManager.get_watchdog_max_period', mock.MagicMock(return_value=32)) def test_arm_disarm_watchdog2(self, mock_is_armed): watchdog = WatchdogType2('watchdog2') assert watchdog.arm(-1) == -1 + assert watchdog.arm(33) == -1 mock_is_armed.return_value = False watchdog.arm(10) mock_is_armed.return_value = True From f790611dab13829f57a9e26c97084c9c6dd63b98 Mon Sep 17 00:00:00 2001 From: Stephen Sun <5379172+stephenxs@users.noreply.github.com> Date: Tue, 21 May 2024 21:57:28 +0800 Subject: [PATCH 315/419] [Mellanox] Avoid returning NoneType while reading 0 byte from SPF's EEPROM (#18964) - Why I did it Avoid returning NoneType while reading 0 byte from SFP's EEPROM In CMIS CDB it is possible to read 0 byte from SFP's EEPROM. It will throw an exception if the platform API returns' NoneType'. We would like to return bytearray(0) here to avoid such exceptions. Signed-off-by: Stephen Sun --- platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py | 2 +- platform/mellanox/mlnx-platform-api/tests/test_sfp.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index b7c4d34a18b3..bc07009c93e1 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -507,7 +507,7 @@ def _read_eeprom(self, offset, num_bytes, log_on_error=True): Returns: bytearray: the content of EEPROM """ - result = None + result = bytearray(0) while num_bytes > 0: _, page, page_offset = self._get_page_and_page_offset(offset) if not page: diff --git a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py index 98246c2959a4..92f5d0d51616 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py @@ -149,6 +149,8 @@ def test_sfp_read_eeprom(self, mock_get_page): mo = mock.mock_open() with mock.patch('sonic_platform.sfp.open', mo): handle = mo() + assert sfp.read_eeprom(0, 0) == bytearray(0) + handle.read.return_value = b'\x00' assert sfp.read_eeprom(0, 1) == bytearray([0]) handle.seek.assert_called_once_with(0) From 2a351f61aa61ec4955ee42a9177d1debe029cd5b Mon Sep 17 00:00:00 2001 From: noaOrMlnx <58519608+noaOrMlnx@users.noreply.github.com> Date: Wed, 22 May 2024 17:37:16 +0300 Subject: [PATCH 316/419] Add the ability to enable CMIS host mgmt. feature to Mellanox-SN4700-O8C48, Mellanox-SN4700-O8V48 SKUs (#18737) - Why I did it To enable CMIS host mgmt feature - How I did it Update information on the relevant fields on each SKU - How to verify it Load the system with the relevant SKU, verify CMIS host management is enabled, and per supported module check SW control is on. --- .../Mellanox-SN4700-O8C48/media_settings.json | 506 ++++++++++++++++++ .../optics_si_settings.json | 108 ++++ .../pmon_daemon_control.json | 6 + .../Mellanox-SN4700-O8V48/media_settings.json | 506 ++++++++++++++++++ .../optics_si_settings.json | 108 ++++ .../pmon_daemon_control.json | 6 + 6 files changed, 1240 insertions(+) create mode 100644 device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/media_settings.json create mode 100644 device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/optics_si_settings.json create mode 100644 device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/pmon_daemon_control.json create mode 100644 device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/media_settings.json create mode 100644 device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/optics_si_settings.json create mode 100644 device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/pmon_daemon_control.json diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/media_settings.json b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/media_settings.json new file mode 100644 index 000000000000..372b1cb2861c --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/media_settings.json @@ -0,0 +1,506 @@ +{ + "GLOBAL_MEDIA_SETTINGS": { + "1-32": { + "QSFP-DD-sm_media_interface": { + "speed:400GAUI-8": { + "idriver": { + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "pre1": { + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre2": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "main": { + "lane0": "0x00000020", + "lane1": "0x00000020", + "lane2": "0x00000020", + "lane3": "0x00000020", + "lane4": "0x00000020", + "lane5": "0x00000020", + "lane6": "0x00000020", + "lane7": "0x00000020" + }, + "post1": { + "lane0": "0x00000006", + "lane1": "0x00000006", + "lane2": "0x00000006", + "lane3": "0x00000006", + "lane4": "0x00000006", + "lane5": "0x00000006", + "lane6": "0x00000006", + "lane7": "0x00000006" + }, + "ob_m2lp": { + "lane0": "0x00000004", + "lane1": "0x00000004", + "lane2": "0x00000004", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + }, + "ob_alev_out": { + "lane0": "0x0000000f", + "lane1": "0x0000000f", + "lane2": "0x0000000f", + "lane3": "0x0000000f", + "lane4": "0x0000000f", + "lane5": "0x0000000f", + "lane6": "0x0000000f", + "lane7": "0x0000000f" + }, + "obplev": { + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "obnlev": { + "lane0": "0x0000005f", + "lane1": "0x0000005f", + "lane2": "0x0000005f", + "lane3": "0x0000005f", + "lane4": "0x0000005f", + "lane5": "0x0000005f", + "lane6": "0x0000005f", + "lane7": "0x0000005f" + }, + "regn_bfm1p": { + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "regn_bfm1n": { + "lane0": "0x000000aa", + "lane1": "0x000000aa", + "lane2": "0x000000aa", + "lane3": "0x000000aa", + "lane4": "0x000000aa", + "lane5": "0x000000aa", + "lane6": "0x000000aa", + "lane7": "0x000000aa" + } + }, + "speed:100GAUI-2": { + "idriver": { + "lane0": "0x0000003c", + "lane1": "0x0000003c" + }, + "pre1": { + "lane0": "0xfffffffe", + "lane1": "0xfffffffe" + }, + "pre2": { + "lane0": "0x00000000", + "lane1": "0x00000000" + }, + "main": { + "lane0": "0x00000020", + "lane1": "0x00000020" + }, + "post1": { + "lane0": "0x00000006", + "lane1": "0x00000006" + }, + "ob_m2lp": { + "lane0": "0x00000004", + "lane1": "0x00000004" + }, + "ob_alev_out": { + "lane0": "0x0000000f", + "lane1": "0x0000000f" + }, + "obplev": { + "lane0": "0x00000069", + "lane1": "0x00000069" + }, + "obnlev": { + "lane0": "0x0000005f", + "lane1": "0x0000005f" + }, + "regn_bfm1p": { + "lane0": "0x0000001e", + "lane1": "0x0000001e" + }, + "regn_bfm1n": { + "lane0": "0x000000aa", + "lane1": "0x000000aa" + } + } + }, + "QSFP-DD-active_cable_media_interface": { + "speed:400GAUI-8": { + "idriver": { + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "pre1": { + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre2": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "main": { + "lane0": "0x00000020", + "lane1": "0x00000020", + "lane2": "0x00000020", + "lane3": "0x00000020", + "lane4": "0x00000020", + "lane5": "0x00000020", + "lane6": "0x00000020", + "lane7": "0x00000020" + }, + "post1": { + "lane0": "0x00000006", + "lane1": "0x00000006", + "lane2": "0x00000006", + "lane3": "0x00000006", + "lane4": "0x00000006", + "lane5": "0x00000006", + "lane6": "0x00000006", + "lane7": "0x00000006" + }, + "ob_m2lp": { + "lane0": "0x00000004", + "lane1": "0x00000004", + "lane2": "0x00000004", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + }, + "ob_alev_out": { + "lane0": "0x0000000f", + "lane1": "0x0000000f", + "lane2": "0x0000000f", + "lane3": "0x0000000f", + "lane4": "0x0000000f", + "lane5": "0x0000000f", + "lane6": "0x0000000f", + "lane7": "0x0000000f" + }, + "obplev": { + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "obnlev": { + "lane0": "0x0000005f", + "lane1": "0x0000005f", + "lane2": "0x0000005f", + "lane3": "0x0000005f", + "lane4": "0x0000005f", + "lane5": "0x0000005f", + "lane6": "0x0000005f", + "lane7": "0x0000005f" + }, + "regn_bfm1p": { + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "regn_bfm1n": { + "lane0": "0x000000aa", + "lane1": "0x000000aa", + "lane2": "0x000000aa", + "lane3": "0x000000aa", + "lane4": "0x000000aa", + "lane5": "0x000000aa", + "lane6": "0x000000aa", + "lane7": "0x000000aa" + } + }, + "speed:CAUI-4": { + "idriver": { + "lane0": "0x00000028", + "lane1": "0x00000028", + "lane2": "0x00000028", + "lane3": "0x00000028", + "lane4": "0x00000028", + "lane5": "0x00000028", + "lane6": "0x00000028", + "lane7": "0x00000028" + }, + "pre1": { + "lane0": "0xfffffff3", + "lane1": "0xfffffff3", + "lane2": "0xfffffff3", + "lane3": "0xfffffff3", + "lane4": "0xfffffff3", + "lane5": "0xfffffff3", + "lane6": "0xfffffff3", + "lane7": "0xfffffff3" + }, + "pre2": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "main": { + "lane0": "0x00000033", + "lane1": "0x00000033", + "lane2": "0x00000033", + "lane3": "0x00000033", + "lane4": "0x00000033", + "lane5": "0x00000033", + "lane6": "0x00000033", + "lane7": "0x00000033" + }, + "post1": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "ob_m2lp": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "ob_alev_out": { + "lane0": "0x0000000f", + "lane1": "0x0000000f", + "lane2": "0x0000000f", + "lane3": "0x0000000f", + "lane4": "0x0000000f", + "lane5": "0x0000000f", + "lane6": "0x0000000f", + "lane7": "0x0000000f" + }, + "obplev": { + "lane0": "0x00000050", + "lane1": "0x00000050", + "lane2": "0x00000050", + "lane3": "0x00000050", + "lane4": "0x00000050", + "lane5": "0x00000050", + "lane6": "0x00000050", + "lane7": "0x00000050" + }, + "obnlev": { + "lane0": "0x00000078", + "lane1": "0x00000078", + "lane2": "0x00000078", + "lane3": "0x00000078", + "lane4": "0x00000078", + "lane5": "0x00000078", + "lane6": "0x00000078", + "lane7": "0x00000078" + }, + "regn_bfm1p": { + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "regn_bfm1n": { + "lane0": "0x0000008c", + "lane1": "0x0000008c", + "lane2": "0x0000008c", + "lane3": "0x0000008c", + "lane4": "0x0000008c", + "lane5": "0x0000008c", + "lane6": "0x0000008c", + "lane7": "0x0000008c" + } + } + }, + "QSFP+-active_cable_media_interface": { + "speed:CAUI-4": { + "idriver": { + "lane0": "0x00000028", + "lane1": "0x00000028", + "lane2": "0x00000028", + "lane3": "0x00000028", + "lane4": "0x00000028", + "lane5": "0x00000028", + "lane6": "0x00000028", + "lane7": "0x00000028" + }, + "pre1": { + "lane0": "0xfffffff3", + "lane1": "0xfffffff3", + "lane2": "0xfffffff3", + "lane3": "0xfffffff3", + "lane4": "0xfffffff3", + "lane5": "0xfffffff3", + "lane6": "0xfffffff3", + "lane7": "0xfffffff3" + }, + "pre2": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "main": { + "lane0": "0x00000033", + "lane1": "0x00000033", + "lane2": "0x00000033", + "lane3": "0x00000033", + "lane4": "0x00000033", + "lane5": "0x00000033", + "lane6": "0x00000033", + "lane7": "0x00000033" + }, + "post1": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "ob_m2lp": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "ob_alev_out": { + "lane0": "0x0000000f", + "lane1": "0x0000000f", + "lane2": "0x0000000f", + "lane3": "0x0000000f", + "lane4": "0x0000000f", + "lane5": "0x0000000f", + "lane6": "0x0000000f", + "lane7": "0x0000000f" + }, + "obplev": { + "lane0": "0x00000050", + "lane1": "0x00000050", + "lane2": "0x00000050", + "lane3": "0x00000050", + "lane4": "0x00000050", + "lane5": "0x00000050", + "lane6": "0x00000050", + "lane7": "0x00000050" + }, + "obnlev": { + "lane0": "0x00000078", + "lane1": "0x00000078", + "lane2": "0x00000078", + "lane3": "0x00000078", + "lane4": "0x00000078", + "lane5": "0x00000078", + "lane6": "0x00000078", + "lane7": "0x00000078" + }, + "regn_bfm1p": { + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "regn_bfm1n": { + "lane0": "0x0000008c", + "lane1": "0x0000008c", + "lane2": "0x0000008c", + "lane3": "0x0000008c", + "lane4": "0x0000008c", + "lane5": "0x0000008c", + "lane6": "0x0000008c", + "lane7": "0x0000008c" + } + } + } + } + } +} diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/optics_si_settings.json b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/optics_si_settings.json new file mode 100644 index 000000000000..bf71e818a869 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/optics_si_settings.json @@ -0,0 +1,108 @@ +{ + "GLOBAL_MEDIA_SETTINGS": { + "1-32": { + "50G_SPEED": { + "Default": { + "OutputAmplitudeTargetRx": { + "OutputAmplitudeTargetRx1": 0, + "OutputAmplitudeTargetRx2": 0, + "OutputAmplitudeTargetRx3": 0, + "OutputAmplitudeTargetRx4": 0, + "OutputAmplitudeTargetRx5": 0, + "OutputAmplitudeTargetRx6": 0, + "OutputAmplitudeTargetRx7": 0, + "OutputAmplitudeTargetRx8": 0 + }, + "OutputEqPreCursorTargetRx": { + "OutputEqPreCursorTargetRx1": 0, + "OutputEqPreCursorTargetRx2": 0, + "OutputEqPreCursorTargetRx3": 0, + "OutputEqPreCursorTargetRx4": 0, + "OutputEqPreCursorTargetRx5": 0, + "OutputEqPreCursorTargetRx6": 0, + "OutputEqPreCursorTargetRx7": 0, + "OutputEqPreCursorTargetRx8": 0 + }, + "OutputEqPostCursorTargetRx": { + "OutputEqPostCursorTargetRx1": 0, + "OutputEqPostCursorTargetRx2": 0, + "OutputEqPostCursorTargetRx3": 0, + "OutputEqPostCursorTargetRx4": 0, + "OutputEqPostCursorTargetRx5": 0, + "OutputEqPostCursorTargetRx6": 0, + "OutputEqPostCursorTargetRx7": 0, + "OutputEqPostCursorTargetRx8": 0 + } + } + }, + "25G_SPEED": { + "Default": { + "OutputAmplitudeTargetRx": { + "OutputAmplitudeTargetRx1": 0, + "OutputAmplitudeTargetRx2": 0, + "OutputAmplitudeTargetRx3": 0, + "OutputAmplitudeTargetRx4": 0, + "OutputAmplitudeTargetRx5": 0, + "OutputAmplitudeTargetRx6": 0, + "OutputAmplitudeTargetRx7": 0, + "OutputAmplitudeTargetRx8": 0 + }, + "OutputEqPreCursorTargetRx": { + "OutputEqPreCursorTargetRx1": 0, + "OutputEqPreCursorTargetRx2": 0, + "OutputEqPreCursorTargetRx3": 0, + "OutputEqPreCursorTargetRx4": 0, + "OutputEqPreCursorTargetRx5": 0, + "OutputEqPreCursorTargetRx6": 0, + "OutputEqPreCursorTargetRx7": 0, + "OutputEqPreCursorTargetRx8": 0 + }, + "OutputEqPostCursorTargetRx": { + "OutputEqPostCursorTargetRx1": 0, + "OutputEqPostCursorTargetRx2": 0, + "OutputEqPostCursorTargetRx3": 0, + "OutputEqPostCursorTargetRx4": 0, + "OutputEqPostCursorTargetRx5": 0, + "OutputEqPostCursorTargetRx6": 0, + "OutputEqPostCursorTargetRx7": 0, + "OutputEqPostCursorTargetRx8": 0 + } + } + }, + "10G_SPEED": { + "Default": { + "OutputAmplitudeTargetRx": { + "OutputAmplitudeTargetRx1": 0, + "OutputAmplitudeTargetRx2": 0, + "OutputAmplitudeTargetRx3": 0, + "OutputAmplitudeTargetRx4": 0, + "OutputAmplitudeTargetRx5": 0, + "OutputAmplitudeTargetRx6": 0, + "OutputAmplitudeTargetRx7": 0, + "OutputAmplitudeTargetRx8": 0 + }, + "OutputEqPreCursorTargetRx": { + "OutputEqPreCursorTargetRx1": 0, + "OutputEqPreCursorTargetRx2": 0, + "OutputEqPreCursorTargetRx3": 0, + "OutputEqPreCursorTargetRx4": 0, + "OutputEqPreCursorTargetRx5": 0, + "OutputEqPreCursorTargetRx6": 0, + "OutputEqPreCursorTargetRx7": 0, + "OutputEqPreCursorTargetRx8": 0 + }, + "OutputEqPostCursorTargetRx": { + "OutputEqPostCursorTargetRx1": 0, + "OutputEqPostCursorTargetRx2": 0, + "OutputEqPostCursorTargetRx3": 0, + "OutputEqPostCursorTargetRx4": 0, + "OutputEqPostCursorTargetRx5": 0, + "OutputEqPostCursorTargetRx6": 0, + "OutputEqPostCursorTargetRx7": 0, + "OutputEqPostCursorTargetRx8": 0 + } + } + } + } + } +} diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/pmon_daemon_control.json b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/pmon_daemon_control.json new file mode 100644 index 000000000000..ac8cc05f63dc --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/pmon_daemon_control.json @@ -0,0 +1,6 @@ +{ + "skip_ledd": true, + "skip_fancontrol": true, + "delay_xcvrd": true, + "skip_xcvrd_cmis_mgr": false +} diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/media_settings.json b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/media_settings.json new file mode 100644 index 000000000000..372b1cb2861c --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/media_settings.json @@ -0,0 +1,506 @@ +{ + "GLOBAL_MEDIA_SETTINGS": { + "1-32": { + "QSFP-DD-sm_media_interface": { + "speed:400GAUI-8": { + "idriver": { + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "pre1": { + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre2": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "main": { + "lane0": "0x00000020", + "lane1": "0x00000020", + "lane2": "0x00000020", + "lane3": "0x00000020", + "lane4": "0x00000020", + "lane5": "0x00000020", + "lane6": "0x00000020", + "lane7": "0x00000020" + }, + "post1": { + "lane0": "0x00000006", + "lane1": "0x00000006", + "lane2": "0x00000006", + "lane3": "0x00000006", + "lane4": "0x00000006", + "lane5": "0x00000006", + "lane6": "0x00000006", + "lane7": "0x00000006" + }, + "ob_m2lp": { + "lane0": "0x00000004", + "lane1": "0x00000004", + "lane2": "0x00000004", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + }, + "ob_alev_out": { + "lane0": "0x0000000f", + "lane1": "0x0000000f", + "lane2": "0x0000000f", + "lane3": "0x0000000f", + "lane4": "0x0000000f", + "lane5": "0x0000000f", + "lane6": "0x0000000f", + "lane7": "0x0000000f" + }, + "obplev": { + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "obnlev": { + "lane0": "0x0000005f", + "lane1": "0x0000005f", + "lane2": "0x0000005f", + "lane3": "0x0000005f", + "lane4": "0x0000005f", + "lane5": "0x0000005f", + "lane6": "0x0000005f", + "lane7": "0x0000005f" + }, + "regn_bfm1p": { + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "regn_bfm1n": { + "lane0": "0x000000aa", + "lane1": "0x000000aa", + "lane2": "0x000000aa", + "lane3": "0x000000aa", + "lane4": "0x000000aa", + "lane5": "0x000000aa", + "lane6": "0x000000aa", + "lane7": "0x000000aa" + } + }, + "speed:100GAUI-2": { + "idriver": { + "lane0": "0x0000003c", + "lane1": "0x0000003c" + }, + "pre1": { + "lane0": "0xfffffffe", + "lane1": "0xfffffffe" + }, + "pre2": { + "lane0": "0x00000000", + "lane1": "0x00000000" + }, + "main": { + "lane0": "0x00000020", + "lane1": "0x00000020" + }, + "post1": { + "lane0": "0x00000006", + "lane1": "0x00000006" + }, + "ob_m2lp": { + "lane0": "0x00000004", + "lane1": "0x00000004" + }, + "ob_alev_out": { + "lane0": "0x0000000f", + "lane1": "0x0000000f" + }, + "obplev": { + "lane0": "0x00000069", + "lane1": "0x00000069" + }, + "obnlev": { + "lane0": "0x0000005f", + "lane1": "0x0000005f" + }, + "regn_bfm1p": { + "lane0": "0x0000001e", + "lane1": "0x0000001e" + }, + "regn_bfm1n": { + "lane0": "0x000000aa", + "lane1": "0x000000aa" + } + } + }, + "QSFP-DD-active_cable_media_interface": { + "speed:400GAUI-8": { + "idriver": { + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "pre1": { + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre2": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "main": { + "lane0": "0x00000020", + "lane1": "0x00000020", + "lane2": "0x00000020", + "lane3": "0x00000020", + "lane4": "0x00000020", + "lane5": "0x00000020", + "lane6": "0x00000020", + "lane7": "0x00000020" + }, + "post1": { + "lane0": "0x00000006", + "lane1": "0x00000006", + "lane2": "0x00000006", + "lane3": "0x00000006", + "lane4": "0x00000006", + "lane5": "0x00000006", + "lane6": "0x00000006", + "lane7": "0x00000006" + }, + "ob_m2lp": { + "lane0": "0x00000004", + "lane1": "0x00000004", + "lane2": "0x00000004", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + }, + "ob_alev_out": { + "lane0": "0x0000000f", + "lane1": "0x0000000f", + "lane2": "0x0000000f", + "lane3": "0x0000000f", + "lane4": "0x0000000f", + "lane5": "0x0000000f", + "lane6": "0x0000000f", + "lane7": "0x0000000f" + }, + "obplev": { + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "obnlev": { + "lane0": "0x0000005f", + "lane1": "0x0000005f", + "lane2": "0x0000005f", + "lane3": "0x0000005f", + "lane4": "0x0000005f", + "lane5": "0x0000005f", + "lane6": "0x0000005f", + "lane7": "0x0000005f" + }, + "regn_bfm1p": { + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "regn_bfm1n": { + "lane0": "0x000000aa", + "lane1": "0x000000aa", + "lane2": "0x000000aa", + "lane3": "0x000000aa", + "lane4": "0x000000aa", + "lane5": "0x000000aa", + "lane6": "0x000000aa", + "lane7": "0x000000aa" + } + }, + "speed:CAUI-4": { + "idriver": { + "lane0": "0x00000028", + "lane1": "0x00000028", + "lane2": "0x00000028", + "lane3": "0x00000028", + "lane4": "0x00000028", + "lane5": "0x00000028", + "lane6": "0x00000028", + "lane7": "0x00000028" + }, + "pre1": { + "lane0": "0xfffffff3", + "lane1": "0xfffffff3", + "lane2": "0xfffffff3", + "lane3": "0xfffffff3", + "lane4": "0xfffffff3", + "lane5": "0xfffffff3", + "lane6": "0xfffffff3", + "lane7": "0xfffffff3" + }, + "pre2": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "main": { + "lane0": "0x00000033", + "lane1": "0x00000033", + "lane2": "0x00000033", + "lane3": "0x00000033", + "lane4": "0x00000033", + "lane5": "0x00000033", + "lane6": "0x00000033", + "lane7": "0x00000033" + }, + "post1": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "ob_m2lp": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "ob_alev_out": { + "lane0": "0x0000000f", + "lane1": "0x0000000f", + "lane2": "0x0000000f", + "lane3": "0x0000000f", + "lane4": "0x0000000f", + "lane5": "0x0000000f", + "lane6": "0x0000000f", + "lane7": "0x0000000f" + }, + "obplev": { + "lane0": "0x00000050", + "lane1": "0x00000050", + "lane2": "0x00000050", + "lane3": "0x00000050", + "lane4": "0x00000050", + "lane5": "0x00000050", + "lane6": "0x00000050", + "lane7": "0x00000050" + }, + "obnlev": { + "lane0": "0x00000078", + "lane1": "0x00000078", + "lane2": "0x00000078", + "lane3": "0x00000078", + "lane4": "0x00000078", + "lane5": "0x00000078", + "lane6": "0x00000078", + "lane7": "0x00000078" + }, + "regn_bfm1p": { + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "regn_bfm1n": { + "lane0": "0x0000008c", + "lane1": "0x0000008c", + "lane2": "0x0000008c", + "lane3": "0x0000008c", + "lane4": "0x0000008c", + "lane5": "0x0000008c", + "lane6": "0x0000008c", + "lane7": "0x0000008c" + } + } + }, + "QSFP+-active_cable_media_interface": { + "speed:CAUI-4": { + "idriver": { + "lane0": "0x00000028", + "lane1": "0x00000028", + "lane2": "0x00000028", + "lane3": "0x00000028", + "lane4": "0x00000028", + "lane5": "0x00000028", + "lane6": "0x00000028", + "lane7": "0x00000028" + }, + "pre1": { + "lane0": "0xfffffff3", + "lane1": "0xfffffff3", + "lane2": "0xfffffff3", + "lane3": "0xfffffff3", + "lane4": "0xfffffff3", + "lane5": "0xfffffff3", + "lane6": "0xfffffff3", + "lane7": "0xfffffff3" + }, + "pre2": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "main": { + "lane0": "0x00000033", + "lane1": "0x00000033", + "lane2": "0x00000033", + "lane3": "0x00000033", + "lane4": "0x00000033", + "lane5": "0x00000033", + "lane6": "0x00000033", + "lane7": "0x00000033" + }, + "post1": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "ob_m2lp": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "ob_alev_out": { + "lane0": "0x0000000f", + "lane1": "0x0000000f", + "lane2": "0x0000000f", + "lane3": "0x0000000f", + "lane4": "0x0000000f", + "lane5": "0x0000000f", + "lane6": "0x0000000f", + "lane7": "0x0000000f" + }, + "obplev": { + "lane0": "0x00000050", + "lane1": "0x00000050", + "lane2": "0x00000050", + "lane3": "0x00000050", + "lane4": "0x00000050", + "lane5": "0x00000050", + "lane6": "0x00000050", + "lane7": "0x00000050" + }, + "obnlev": { + "lane0": "0x00000078", + "lane1": "0x00000078", + "lane2": "0x00000078", + "lane3": "0x00000078", + "lane4": "0x00000078", + "lane5": "0x00000078", + "lane6": "0x00000078", + "lane7": "0x00000078" + }, + "regn_bfm1p": { + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "regn_bfm1n": { + "lane0": "0x0000008c", + "lane1": "0x0000008c", + "lane2": "0x0000008c", + "lane3": "0x0000008c", + "lane4": "0x0000008c", + "lane5": "0x0000008c", + "lane6": "0x0000008c", + "lane7": "0x0000008c" + } + } + } + } + } +} diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/optics_si_settings.json b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/optics_si_settings.json new file mode 100644 index 000000000000..bf71e818a869 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/optics_si_settings.json @@ -0,0 +1,108 @@ +{ + "GLOBAL_MEDIA_SETTINGS": { + "1-32": { + "50G_SPEED": { + "Default": { + "OutputAmplitudeTargetRx": { + "OutputAmplitudeTargetRx1": 0, + "OutputAmplitudeTargetRx2": 0, + "OutputAmplitudeTargetRx3": 0, + "OutputAmplitudeTargetRx4": 0, + "OutputAmplitudeTargetRx5": 0, + "OutputAmplitudeTargetRx6": 0, + "OutputAmplitudeTargetRx7": 0, + "OutputAmplitudeTargetRx8": 0 + }, + "OutputEqPreCursorTargetRx": { + "OutputEqPreCursorTargetRx1": 0, + "OutputEqPreCursorTargetRx2": 0, + "OutputEqPreCursorTargetRx3": 0, + "OutputEqPreCursorTargetRx4": 0, + "OutputEqPreCursorTargetRx5": 0, + "OutputEqPreCursorTargetRx6": 0, + "OutputEqPreCursorTargetRx7": 0, + "OutputEqPreCursorTargetRx8": 0 + }, + "OutputEqPostCursorTargetRx": { + "OutputEqPostCursorTargetRx1": 0, + "OutputEqPostCursorTargetRx2": 0, + "OutputEqPostCursorTargetRx3": 0, + "OutputEqPostCursorTargetRx4": 0, + "OutputEqPostCursorTargetRx5": 0, + "OutputEqPostCursorTargetRx6": 0, + "OutputEqPostCursorTargetRx7": 0, + "OutputEqPostCursorTargetRx8": 0 + } + } + }, + "25G_SPEED": { + "Default": { + "OutputAmplitudeTargetRx": { + "OutputAmplitudeTargetRx1": 0, + "OutputAmplitudeTargetRx2": 0, + "OutputAmplitudeTargetRx3": 0, + "OutputAmplitudeTargetRx4": 0, + "OutputAmplitudeTargetRx5": 0, + "OutputAmplitudeTargetRx6": 0, + "OutputAmplitudeTargetRx7": 0, + "OutputAmplitudeTargetRx8": 0 + }, + "OutputEqPreCursorTargetRx": { + "OutputEqPreCursorTargetRx1": 0, + "OutputEqPreCursorTargetRx2": 0, + "OutputEqPreCursorTargetRx3": 0, + "OutputEqPreCursorTargetRx4": 0, + "OutputEqPreCursorTargetRx5": 0, + "OutputEqPreCursorTargetRx6": 0, + "OutputEqPreCursorTargetRx7": 0, + "OutputEqPreCursorTargetRx8": 0 + }, + "OutputEqPostCursorTargetRx": { + "OutputEqPostCursorTargetRx1": 0, + "OutputEqPostCursorTargetRx2": 0, + "OutputEqPostCursorTargetRx3": 0, + "OutputEqPostCursorTargetRx4": 0, + "OutputEqPostCursorTargetRx5": 0, + "OutputEqPostCursorTargetRx6": 0, + "OutputEqPostCursorTargetRx7": 0, + "OutputEqPostCursorTargetRx8": 0 + } + } + }, + "10G_SPEED": { + "Default": { + "OutputAmplitudeTargetRx": { + "OutputAmplitudeTargetRx1": 0, + "OutputAmplitudeTargetRx2": 0, + "OutputAmplitudeTargetRx3": 0, + "OutputAmplitudeTargetRx4": 0, + "OutputAmplitudeTargetRx5": 0, + "OutputAmplitudeTargetRx6": 0, + "OutputAmplitudeTargetRx7": 0, + "OutputAmplitudeTargetRx8": 0 + }, + "OutputEqPreCursorTargetRx": { + "OutputEqPreCursorTargetRx1": 0, + "OutputEqPreCursorTargetRx2": 0, + "OutputEqPreCursorTargetRx3": 0, + "OutputEqPreCursorTargetRx4": 0, + "OutputEqPreCursorTargetRx5": 0, + "OutputEqPreCursorTargetRx6": 0, + "OutputEqPreCursorTargetRx7": 0, + "OutputEqPreCursorTargetRx8": 0 + }, + "OutputEqPostCursorTargetRx": { + "OutputEqPostCursorTargetRx1": 0, + "OutputEqPostCursorTargetRx2": 0, + "OutputEqPostCursorTargetRx3": 0, + "OutputEqPostCursorTargetRx4": 0, + "OutputEqPostCursorTargetRx5": 0, + "OutputEqPostCursorTargetRx6": 0, + "OutputEqPostCursorTargetRx7": 0, + "OutputEqPostCursorTargetRx8": 0 + } + } + } + } + } +} diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/pmon_daemon_control.json b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/pmon_daemon_control.json new file mode 100644 index 000000000000..ac8cc05f63dc --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/pmon_daemon_control.json @@ -0,0 +1,6 @@ +{ + "skip_ledd": true, + "skip_fancontrol": true, + "delay_xcvrd": true, + "skip_xcvrd_cmis_mgr": false +} From b4747a87febb06a28e3882cb2d598b3c8b8528e0 Mon Sep 17 00:00:00 2001 From: Yuanzhe <150663541+yuazhe@users.noreply.github.com> Date: Tue, 21 May 2024 13:52:33 +0800 Subject: [PATCH 317/419] [Mellanox] Fix 4600c sensors.conf inverted psu number designation (#18722) - Why I did it This PR is used to standardize several sensors.conf psu section I. Fix 4600/4600c inverted psu number designation II. Fix 5600 second psu miss set_power_cap label III. Standardized comments - How to verify it check sensors command output Signed-off-by: Yuanzhe, Liu --- .../x86_64-mlnx_msn2010-r0/sensors.conf | 2 +- .../x86_64-mlnx_msn4600-r0/sensors.conf | 28 +++++++-------- .../x86_64-mlnx_msn4600c-r0/sensors.conf | 34 +++++++++---------- .../sensors_respin.conf | 34 +++++++++---------- .../x86_64-nvidia_sn2201-r0/sensors.conf | 2 +- .../x86_64-nvidia_sn5600-r0/sensors.conf | 1 + 6 files changed, 51 insertions(+), 50 deletions(-) diff --git a/device/mellanox/x86_64-mlnx_msn2010-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn2010-r0/sensors.conf index 9bcfcbe21138..92d742c18453 100644 --- a/device/mellanox/x86_64-mlnx_msn2010-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn2010-r0/sensors.conf @@ -15,7 +15,7 @@ bus "i2c-7" "i2c-1-mux (chan_id 6)" chip "lm75-i2c-*-4b" label temp1 "Ambient Fan Side Temp (air intake)" -# Power supplies +# Power controllers bus "i2c-5" "i2c-1-mux (chan_id 4)" chip "tps53679-i2c-*-70" label in1 "PMIC-1 PSU 12V Rail (in1)" diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn4600-r0/sensors.conf index 8443e1b11c82..4c374a839be9 100644 --- a/device/mellanox/x86_64-mlnx_msn4600-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/sensors.conf @@ -162,20 +162,6 @@ bus "i2c-15" "i2c-1-mux (chan_id 6)" # Power supplies bus "i2c-4" "i2c-1-mux (chan_id 3)" chip "dps460-i2c-*-58" - label in1 "PSU-1(L) 220V Rail (in)" - ignore in2 - label in3 "PSU-1(L) 12V Rail (out)" - label fan1 "PSU-1(L) Fan 1" - ignore fan2 - ignore fan3 - label temp1 "PSU-1(L) Temp 1" - label temp2 "PSU-1(L) Temp 2" - label temp3 "PSU-1(L) Temp 3" - label power1 "PSU-1(L) 220V Rail Pwr (in)" - label power2 "PSU-1(L) 12V Rail Pwr (out)" - label curr1 "PSU-1(L) 220V Rail Curr (in)" - label curr2 "PSU-1(L) 12V Rail Curr (out)" - chip "dps460-i2c-*-59" label in1 "PSU-2(R) 220V Rail (in)" ignore in2 label in3 "PSU-2(R) 12V Rail (out)" @@ -189,6 +175,20 @@ bus "i2c-4" "i2c-1-mux (chan_id 3)" label power2 "PSU-2(R) 12V Rail Pwr (out)" label curr1 "PSU-2(R) 220V Rail Curr (in)" label curr2 "PSU-2(R) 12V Rail Curr (out)" + chip "dps460-i2c-*-59" + label in1 "PSU-1(L) 220V Rail (in)" + ignore in2 + label in3 "PSU-1(L) 12V Rail (out)" + label fan1 "PSU-1(L) Fan 1" + ignore fan2 + ignore fan3 + label temp1 "PSU-1(L) Temp 1" + label temp2 "PSU-1(L) Temp 2" + label temp3 "PSU-1(L) Temp 3" + label power1 "PSU-1(L) 220V Rail Pwr (in)" + label power2 "PSU-1(L) 12V Rail Pwr (out)" + label curr1 "PSU-1(L) 220V Rail Curr (in)" + label curr2 "PSU-1(L) 12V Rail Curr (out)" # Chassis fans chip "mlxreg_fan-isa-*" diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors.conf index 02f811b6c795..4f60ceb02167 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors.conf @@ -220,23 +220,6 @@ bus "i2c-15" "i2c-1-mux (chan_id 6)" # Power supplies bus "i2c-4" "i2c-1-mux (chan_id 3)" chip "dps460-i2c-*-58" - label in1 "PSU-1(L) 220V Rail (in)" - ignore in2 - label in3 "PSU-1(L) 12V Rail (out)" - label fan1 "PSU-1(L) Fan 1" - ignore fan2 - ignore fan3 - label temp1 "PSU-1(L) Temp 1" - label temp2 "PSU-1(L) Temp 2" - label temp3 "PSU-1(L) Temp 3" - label power1 "PSU-1(L) 220V Rail Pwr (in)" - label power2 "PSU-1(L) 12V Rail Pwr (out)" - label curr1 "PSU-1(L) 220V Rail Curr (in)" - label curr2 "PSU-1(L) 12V Rail Curr (out)" - set in3_lcrit in3_crit * 0.662 - set in3_min in3_crit * 0.745 - set in3_max in3_crit * 0.952 - chip "dps460-i2c-*-59" label in1 "PSU-2(R) 220V Rail (in)" ignore in2 label in3 "PSU-2(R) 12V Rail (out)" @@ -253,6 +236,23 @@ bus "i2c-4" "i2c-1-mux (chan_id 3)" set in3_lcrit in3_crit * 0.662 set in3_min in3_crit * 0.745 set in3_max in3_crit * 0.952 + chip "dps460-i2c-*-59" + label in1 "PSU-1(L) 220V Rail (in)" + ignore in2 + label in3 "PSU-1(L) 12V Rail (out)" + label fan1 "PSU-1(L) Fan 1" + ignore fan2 + ignore fan3 + label temp1 "PSU-1(L) Temp 1" + label temp2 "PSU-1(L) Temp 2" + label temp3 "PSU-1(L) Temp 3" + label power1 "PSU-1(L) 220V Rail Pwr (in)" + label power2 "PSU-1(L) 12V Rail Pwr (out)" + label curr1 "PSU-1(L) 220V Rail Curr (in)" + label curr2 "PSU-1(L) 12V Rail Curr (out)" + set in3_lcrit in3_crit * 0.662 + set in3_min in3_crit * 0.745 + set in3_max in3_crit * 0.952 # Chassis fans chip "mlxreg_fan-isa-*" diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors_respin.conf b/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors_respin.conf index 4cf7b71ef80b..0e346b31e28f 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors_respin.conf +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors_respin.conf @@ -255,23 +255,6 @@ bus "i2c-15" "i2c-1-mux (chan_id 6)" # Power supplies bus "i2c-4" "i2c-1-mux (chan_id 3)" chip "dps460-i2c-*-58" - label in1 "PSU-1(L) 220V Rail (in)" - ignore in2 - label in3 "PSU-1(L) 12V Rail (out)" - label fan1 "PSU-1(L) Fan 1" - ignore fan2 - ignore fan3 - label temp1 "PSU-1(L) Temp 1" - label temp2 "PSU-1(L) Temp 2" - label temp3 "PSU-1(L) Temp 3" - label power1 "PSU-1(L) 220V Rail Pwr (in)" - label power2 "PSU-1(L) 12V Rail Pwr (out)" - label curr1 "PSU-1(L) 220V Rail Curr (in)" - label curr2 "PSU-1(L) 12V Rail Curr (out)" - set in3_lcrit in3_crit * 0.662 - set in3_min in3_crit * 0.745 - set in3_max in3_crit * 0.952 - chip "dps460-i2c-*-59" label in1 "PSU-2(R) 220V Rail (in)" ignore in2 label in3 "PSU-2(R) 12V Rail (out)" @@ -288,6 +271,23 @@ bus "i2c-4" "i2c-1-mux (chan_id 3)" set in3_lcrit in3_crit * 0.662 set in3_min in3_crit * 0.745 set in3_max in3_crit * 0.952 + chip "dps460-i2c-*-59" + label in1 "PSU-1(L) 220V Rail (in)" + ignore in2 + label in3 "PSU-1(L) 12V Rail (out)" + label fan1 "PSU-1(L) Fan 1" + ignore fan2 + ignore fan3 + label temp1 "PSU-1(L) Temp 1" + label temp2 "PSU-1(L) Temp 2" + label temp3 "PSU-1(L) Temp 3" + label power1 "PSU-1(L) 220V Rail Pwr (in)" + label power2 "PSU-1(L) 12V Rail Pwr (out)" + label curr1 "PSU-1(L) 220V Rail Curr (in)" + label curr2 "PSU-1(L) 12V Rail Curr (out)" + set in3_lcrit in3_crit * 0.662 + set in3_min in3_crit * 0.745 + set in3_max in3_crit * 0.952 # Chassis fans chip "mlxreg_fan-isa-*" diff --git a/device/mellanox/x86_64-nvidia_sn2201-r0/sensors.conf b/device/mellanox/x86_64-nvidia_sn2201-r0/sensors.conf index 908ebe7c1ccd..5024abd70017 100644 --- a/device/mellanox/x86_64-nvidia_sn2201-r0/sensors.conf +++ b/device/mellanox/x86_64-nvidia_sn2201-r0/sensors.conf @@ -130,7 +130,7 @@ bus "i2c-8" "i2c-1-mux (chan_id 6)" label in8 "MONITOR CPU Board V1P8" label in9 "MONITOR CPU Board V1P24" -# PSU PMBus sensors +# Power supplies bus "i2c-3" "i2c-1-mux (chan_id 1)" chip "pmbus-i2c-3-58" label in1 "PSU-1 220V Rail(in)" diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/sensors.conf b/device/mellanox/x86_64-nvidia_sn5600-r0/sensors.conf index 2a78b7cd65f2..e64aabae645f 100644 --- a/device/mellanox/x86_64-nvidia_sn5600-r0/sensors.conf +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/sensors.conf @@ -288,6 +288,7 @@ chip "dps460-i2c-*-5a" label power2 "PSU-2(R) 12V Rail Pwr (out)" label curr1 "PSU-2(R) 220V Rail Curr (in)" label curr2 "PSU-2(R) 12V Rail Curr (out)" + set power2_cap 0 # Power converters chip "pmbus-i2c-*-10" From ef65c9653dc7a088b7e9de596baa14d5608bae92 Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Fri, 24 May 2024 17:03:00 +0200 Subject: [PATCH 318/419] [202311][Arista] Update platform library submodules (#19057) Add SFP+ support for 7060X6 --- 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 c8924f32a3cf..af03fbd9f672 160000 --- a/platform/barefoot/sonic-platform-modules-arista +++ b/platform/barefoot/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit c8924f32a3cff45e35dcdfd9f0b7dd9d37cecf60 +Subproject commit af03fbd9f67260ba764c833aaaa65b2ff07762d7 diff --git a/platform/broadcom/sonic-platform-modules-arista b/platform/broadcom/sonic-platform-modules-arista index c8924f32a3cf..af03fbd9f672 160000 --- a/platform/broadcom/sonic-platform-modules-arista +++ b/platform/broadcom/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit c8924f32a3cff45e35dcdfd9f0b7dd9d37cecf60 +Subproject commit af03fbd9f67260ba764c833aaaa65b2ff07762d7 From ff362bb749efb539ea51788b33d4a3688a111e25 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 25 May 2024 16:01:02 +0800 Subject: [PATCH 319/419] [submodule] Update submodule sonic-linux-kernel to the latest HEAD automatically (#19072) #### Why I did it src/sonic-linux-kernel ``` * 55e845d - (HEAD -> 202311, origin/202311) [202311] [Mellanox] Integrate HW-MGMT 7.0030.4002 (#393) (3 hours ago) [Vivek] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-linux-kernel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-linux-kernel b/src/sonic-linux-kernel index 59e5ea16e831..55e845d60bd6 160000 --- a/src/sonic-linux-kernel +++ b/src/sonic-linux-kernel @@ -1 +1 @@ -Subproject commit 59e5ea16e831d08e37f663327bf165255b60b98e +Subproject commit 55e845d60bd62f55316e0de956df5c2589e00853 From ee79638a6cc5ddded311e783ae8af377b5166888 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sun, 26 May 2024 01:07:33 +0800 Subject: [PATCH 320/419] [ci/build]: Upgrade SONiC package versions (#19075) --- files/build/versions/default/versions-docker | 18 +++++++------- files/build/versions/default/versions-git | 8 +++---- files/build/versions/default/versions-mirror | 24 +++++++++---------- .../versions-deb-bullseye | 1 - .../versions-deb-bullseye | 1 - .../sonic-slave-buster/versions-deb-buster | 1 - 6 files changed, 25 insertions(+), 28 deletions(-) diff --git a/files/build/versions/default/versions-docker b/files/build/versions/default/versions-docker index 3b9e07256828..3dd16678bda2 100644 --- a/files/build/versions/default/versions-docker +++ b/files/build/versions/default/versions-docker @@ -1,12 +1,12 @@ -amd64:amd64/debian:bullseye==sha256:38fb0f1618bfa65b0cf1dd279293ebc70ef94aab2f2dc49274a2efc6ee29880e +amd64:amd64/debian:bullseye==sha256:5f2875f43c30349791f096598cbc96a774c422eeb2405e09ac4a7fc97492b623 amd64:amd64/debian:buster==sha256:255eec9d157d35e00a81a45f1e958fd19437d504139e8eb4ea6cc380ea741ed4 -amd64:debian:bullseye==sha256:f860cec7ccaf31b42cd60b6a409f9dad9510ea27fca9c2864741087b4298a1e3 -amd64:debian:buster==sha256:bce46a1c39574f98c845df4a5acc6c70c211df5a6182e428c1155c33317d4920 -arm64:arm64v8/debian:bullseye==sha256:284d075b0fd0350198c79fcb19b9b0fccac6ade8ada1b1309aee35dd223fc802 +amd64:debian:bullseye==sha256:2c7a92a41cb814c00e7d455b2bc0c90ccdb9a4ced2ffdc10e562c7a84a186032 +amd64:debian:buster==sha256:6e7bd55a5705914837aad8db01b349f4617510c11e47ccae8e87f6f14e489626 +arm64:arm64v8/debian:bullseye==sha256:2fcb4b943d3c026dff3bb55f470140bea8c1ce2e05a03e62185d6f12dd131ac2 arm64:arm64v8/debian:buster==sha256:4d104dd705ba3cba521271fae2d7259e4bc078c5f4855de32dab30acc9a5d3c5 -arm64:debian:bullseye==sha256:f860cec7ccaf31b42cd60b6a409f9dad9510ea27fca9c2864741087b4298a1e3 -arm64:debian:buster==sha256:bce46a1c39574f98c845df4a5acc6c70c211df5a6182e428c1155c33317d4920 -armhf:arm32v7/debian:bullseye==sha256:c1205d95cc1479322f5c34df0a98f62ede571d041cb02a48ccca34209b3f7be9 +arm64:debian:bullseye==sha256:2c7a92a41cb814c00e7d455b2bc0c90ccdb9a4ced2ffdc10e562c7a84a186032 +arm64:debian:buster==sha256:6e7bd55a5705914837aad8db01b349f4617510c11e47ccae8e87f6f14e489626 +armhf:arm32v7/debian:bullseye==sha256:de07db284fdd71abd806c3b84c8766566fe8b211a9a5d2af99848c16d50f8da4 armhf:arm32v7/debian:buster==sha256:540d61b391864b97f3ee3d9d0ded73d21e35b23c3db56c6400ac789118d0f47c -armhf:debian:bullseye==sha256:f860cec7ccaf31b42cd60b6a409f9dad9510ea27fca9c2864741087b4298a1e3 -armhf:debian:buster==sha256:bce46a1c39574f98c845df4a5acc6c70c211df5a6182e428c1155c33317d4920 +armhf:debian:bullseye==sha256:2c7a92a41cb814c00e7d455b2bc0c90ccdb9a4ced2ffdc10e562c7a84a186032 +armhf:debian:buster==sha256:6e7bd55a5705914837aad8db01b349f4617510c11e47ccae8e87f6f14e489626 diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index 396e71f048d5..2b9580843783 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==ce7ceeb5ad97dd1d85a6ba7799f621cd496364c8 +https://chromium.googlesource.com/chromium/tools/depot_tools.git==09c232e7c0d5670695d1f8f70d05ed1a215e438c https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f https://github.com/CESNET/libyang.git==4c733412e7173219166be7053940326a92699765 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==85b977151b8f5717ad00b7b7204521a823ac1ad2 -https://github.com/FreeRADIUS/freeradius-server.git==0af5ab4593e30ff39c4d20be027b4d489f835986 +https://github.com/flashrom/flashrom.git==2f8e64372a80115d7905e6e45194034e3082273a +https://github.com/FreeRADIUS/freeradius-server.git==04618796bdb8a52f489ff70cb99fd8eabeeba6ca https://github.com/FreeRADIUS/pam_radius.git==d802da75cbfc3062ae1b18d0bf26ac2a030ffdaa https://github.com/jeroennijhof/pam_tacplus.git==b839c440e33c36eced9dcbc287fcfe6237c4c4ce https://github.com/jpirko/libteam.git==337125ce8d24ed66d7f4c7e6eef50458f3e7d154 @@ -20,4 +20,4 @@ https://github.com/thom311/libnl==49f7822961f5bc6b18cd2a2d3f3b8d2ab0896d3f https://salsa.debian.org/debian/libteam.git==48142125234a665ad5367b724af36a58fb484d3d https://salsa.debian.org/kernel-team/initramfs-tools.git==2b3148526012c95e1faf0832faa19b9de8c8b67b https://salsa.debian.org/sk-guest/monit.git==c9da7ebb1f35dfba17b50b5969a6e75e29cbec0d -https://salsa.debian.org/ssh-team/openssh.git==d150d0d69246f55c711684078f47f999a4bfd6bc +https://salsa.debian.org/ssh-team/openssh.git==096572ea878f93fe2c85d8e86e43e2281f3f46d7 diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index 5cfcf804f0cd..733e23ec15cd 100644 --- a/files/build/versions/default/versions-mirror +++ b/files/build/versions/default/versions-mirror @@ -1,14 +1,14 @@ 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==20240521T063439Z -debian-security==20240521T063453Z -download.docker.com_linux_debian_dists_bullseye==2024-05-20T09:06:01Z -download.docker.com_linux_debian_dists_buster==2024-05-16T12:25:40Z -packages.trafficmanager.net_snapshot_debian-security_20240521T063453Z_dists_bullseye-security==2024-05-19T12:12:19Z -packages.trafficmanager.net_snapshot_debian-security_20240521T063453Z_dists_buster_updates==2024-05-19T12:12:19Z -packages.trafficmanager.net_snapshot_debian_20240521T063439Z_dists_bullseye==2024-02-10T12:40:37Z -packages.trafficmanager.net_snapshot_debian_20240521T063439Z_dists_bullseye-backports==2024-05-21T02:21:11Z -packages.trafficmanager.net_snapshot_debian_20240521T063439Z_dists_bullseye-updates==2024-05-21T02:21:11Z -packages.trafficmanager.net_snapshot_debian_20240521T063439Z_dists_buster==2023-06-10T08:53:33Z -packages.trafficmanager.net_snapshot_debian_20240521T063439Z_dists_buster-backports==2024-03-09T20:54:54Z -packages.trafficmanager.net_snapshot_debian_20240521T063439Z_dists_buster-updates==2023-06-10T08:55:10Z +debian==20240524T000458Z +debian-security==20240524T000400Z +download.docker.com_linux_debian_dists_bullseye==2024-05-23T13:29:25Z +download.docker.com_linux_debian_dists_buster==2024-05-23T13:29:25Z +packages.trafficmanager.net_snapshot_debian-security_20240524T000400Z_dists_bullseye-security==2024-05-22T16:44:08Z +packages.trafficmanager.net_snapshot_debian-security_20240524T000400Z_dists_buster_updates==2024-05-22T16:44:09Z +packages.trafficmanager.net_snapshot_debian_20240524T000458Z_dists_bullseye==2024-02-10T12:40:37Z +packages.trafficmanager.net_snapshot_debian_20240524T000458Z_dists_bullseye-backports==2024-05-23T20:13:01Z +packages.trafficmanager.net_snapshot_debian_20240524T000458Z_dists_bullseye-updates==2024-05-23T20:13:01Z +packages.trafficmanager.net_snapshot_debian_20240524T000458Z_dists_buster==2023-06-10T08:53:33Z +packages.trafficmanager.net_snapshot_debian_20240524T000458Z_dists_buster-backports==2024-03-09T20:54:54Z +packages.trafficmanager.net_snapshot_debian_20240524T000458Z_dists_buster-updates==2023-06-10T08:55:10Z 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 1a43c5332ff9..f27b2dcab27a 100644 --- a/files/build/versions/dockers/docker-base-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-base-bullseye/versions-deb-bullseye @@ -7,7 +7,6 @@ libatomic1==10.2.1-6 libbpf0==1:0.3-2 libbrotli1==1.0.9-2+b2 libbsd0==0.11.3-1+deb11u1 -libc6==2.31-13+deb11u10 libcap2==1:2.44-1 libcap2-bin==1:2.44-1 libcurl4==7.74.0-1.3+deb11u11 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 55b1e4593435..d73886530503 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye @@ -375,7 +375,6 @@ libc-ares2==1.17.1-1+deb11u3 libc-dev-bin==2.31-13+deb11u10 libc-devtools==2.31-13+deb11u10 libc-l10n==2.31-13+deb11u10 -libc6==2.31-13+deb11u10 libc6-dbg==2.31-13+deb11u10 libc6-dev==2.31-13+deb11u10 libc6-dev-i386==2.31-13+deb11u10 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 958c8b33ce89..79402bc638a0 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster @@ -343,7 +343,6 @@ libc-ares-dev==1.14.0-1+deb10u4 libc-ares2==1.14.0-1+deb10u4 libc-dev-bin==2.28-10+deb10u3 libc-l10n==2.28-10+deb10u3 -libc6==2.28-10+deb10u3 libc6-dbg==2.28-10+deb10u3 libc6-dev==2.28-10+deb10u3 libc6-dev-i386==2.28-10+deb10u3 From df8c02182be34c9f2549e3b03b4839081fc5a4a8 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 28 May 2024 16:01:09 +0800 Subject: [PATCH 321/419] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#19095) #### Why I did it src/sonic-swss ``` * 5075e660 - (HEAD -> 202311, origin/202311) Parse subport value added to config_db (#3161) (8 seconds ago) [Bobby McGonigle] * 92fd1b88 - revert requests from 2.32.0 to 2.31.0 (#3154) (#3169) (8 hours ago) [Guohan Lu] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index e69750d99925..5075e660fb56 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit e69750d99925b14d48bd5727544f05b5d5a33625 +Subproject commit 5075e660fb56c3447da9118f3820e618687b8889 From 10831ac02fcf899d2125f0715a0c2228e51480e6 Mon Sep 17 00:00:00 2001 From: Vivek Date: Tue, 28 May 2024 11:28:20 -0700 Subject: [PATCH 322/419] [202311] [Mellanox] Integrate HW-MGMT 7.0030.4002 Changes (#18954) * Integrate HW-MGMT 7.0030.4000 Changes * Integrate HW-MGMT 7.0030.4001 Changes * Integrate HW-MGMT 7.0030.4002 Changes * Add LM_SENSORS flag to hw-mgmt compilation Signed-off-by: Vivek Reddy --------- Signed-off-by: Vivek Reddy --- platform/mellanox/hw-management.mk | 2 +- platform/mellanox/hw-management/Makefile | 2 +- platform/mellanox/hw-management/hw-mgmt | 2 +- .../hw-management/hwmgmt_nonup_patches | 166 - .../external-changes.patch | 242 - ...ide-conversion-for-hardware-LED-colo.patch | 96 - ...-setting-LED-color-during-initializa.patch | 38 - ...w-multi-instantiation-of-same-name-L.patch | 77 - ...t-mlxsw-Use-u16-for-local_port-field.patch | 771 -- ...ert-mlxsw-i2c-Fix-chunk-size-setting.patch | 26 - ...core_hwmon-Adjust-module-label-names.patch | 28 - ...-Fix-variable-names-for-hwmon-attrib.patch | 256 - ...al-Rename-labels-according-to-naming.patch | 162 - ...al-Remove-obsolete-API-for-query-res.patch | 111 - ...pir_-prefix-to-MGPIR-fields-comments.patch | 52 - ...lxsw-core-Remove-unnecessary-asserts.patch | 102 - ...-MTMP-register-with-new-slot-number-.patch | 147 - ...-MTBR-register-with-new-slot-number-.patch | 88 - ...-MCIA-register-with-new-slot-number-.patch | 109 - ...-MCION-register-with-new-slot-number.patch | 69 - ...-PMMP-register-with-new-slot-number-.patch | 68 - ...-MGPIR-register-with-new-slot-fields.patch | 199 - ...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 | 122 - ...-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 | 138 - ...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 | 49 - ...ort-to-create-line-card-and-expose-t.patch | 532 - ...ink-implement-line-card-provisioning.patch | 555 - ...ink-implement-line-card-active-state.patch | 99 - ...d-port-to-line-card-relationship-set.patch | 102 - ...-introduce-linecard-info-get-message.patch | 246 - ...-introduce-linecard-info-get-message.patch | 316 - ...rts-Mapping-event-Configuration-Regi.patch | 99 - ...nagement-DownStream-Device-Query-Reg.patch | 268 - ...nagement-DownStream-Device-Control-R.patch | 71 - ...nagement-Binary-Code-Transfer-Regist.patch | 155 - ...ards-Add-line-card-objects-and-imple.patch | 1062 -- ...ards-Implement-line-card-activation-.patch | 206 - ...d-driver-ops-by-remove-selected-port.patch | 99 - ...pectrum-Add-port-to-linecard-mapping.patch | 153 - ...uce-Management-Temperature-Extended-.patch | 105 - ...-Add-APIs-for-thermal-sensor-mapping.patch | 114 - ...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 | 244 - ...ID-value-using-op-instead-of-passing.patch | 200 - ...ards-Implement-line-card-device-flas.patch | 401 - ...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 | 496 - ...d-bus-init-function-with-event-handl.patch | 90 - ...d-support-for-system-events-handling.patch | 199 - ...0154-mlxsw-core-Export-line-card-API.patch | 27 - ...xsw-minimal-Add-system-event-handler.patch | 62 - ...d-interfaces-for-line-card-initializ.patch | 119 - ...DS-lan743x-Add-support-for-fixed-phy.patch | 97 - ...l-Ignore-error-reading-SPAD-register.patch | 34 - ...x-mlxreg-lc-Fix-cleanup-on-failure-a.patch | 194 - ...necards-Skip-devlink-and-provisionin.patch | 93 - ...of-bounds-memory-accesses-in-thermal.patch | 99 - ...mellanox-i2c-mlxbf-convert-txt-to-YA.patch | 169 - .../0203-i2c-mlxbf-remove-IRQF_ONESHOT.patch | 37 - ...-mlxbf-add-multi-slave-functionality.patch | 549 - ...07-i2c-mlxbf-support-BlueField-3-SoC.patch | 967 -- ...i2c-mlxbf-remove-device-tree-support.patch | 211 - ...SAUCE-i2c-mlxbf.c-Add-driver-version.patch | 37 - ...x-Typo-fix-in-the-file-mlxbf-bootctl.patch | 32 - ...tform-mellanox-Updates-to-mlxbf-boot.patch | 1719 --- ...x-mlxbf-pmc-Add-Mellanox-BlueField-P.patch | 1560 --- ...ox-mlxbf-pmc-fix-kernel-doc-notation.patch | 94 - ...x-mlxbf-pmc-Fix-an-IS_ERR-vs-NULL-bu.patch | 42 - ...atform-mellanox-Updates-to-mlxbf-pmc.patch | 2674 ---- ...-mlxbf_pmc-Fix-references-to-sprintf.patch | 69 - ...bf-pmc-Fix-error-when-reading-unprog.patch | 140 - ...latform-mellanox-Add-mlx-trio-driver.patch | 954 -- ...tform-mellanox-mlxbf-tmfifo-Add-Blue.patch | 245 - ...0220-UBUNTU-SAUCE-pka-Add-pka-driver.patch | 10218 ---------------- ...tform-mellanox-Add-mlxbf-livefish-dr.patch | 339 - ...source-managed-version-of-delayed-wo.patch | 84 - ...-devm_delayed_work_autocancel-kernel.patch | 50 - ...-resource-managed-version-of-work-in.patch | 59 - ...CE-Add-support-to-pwr-mlxbf.c-driver.patch | 158 - ...ox-BlueField-Gigabit-Ethernet-driver.patch | 2206 ---- ..._gige-clear-valid_polarity-upon-open.patch | 53 - ...bf_gige-Replace-non-standard-interru.patch | 368 - ...ge-increase-MDIO-polling-rate-to-5us.patch | 52 - ...move-driver-managed-interrupt-counts.patch | 97 - ...e-own-module-name-define-and-use-KBU.patch | 46 - ...bf_gige-add-ethtool-mlxbf_gige_set_r.patch | 78 - ...-OOB-handling-RX-packets-in-heavy-tr.patch | 108 - ...bf_gige-clear-MDIO-gateway-lock-afte.patch | 46 - ...e-compute-MDIO-period-based-on-i1clk.patch | 244 - ...ix-an-IS_ERR-vs-NULL-bug-in-mlxbf_gi.patch | 42 - ...bf_gige-add-MDIO-support-for-BlueFie.patch | 484 - ...bf_gige-support-10M-100M-1G-speeds-o.patch | 237 - ...SAUCE-bluefield_edac-Add-SMC-support.patch | 291 - ...efield_edac-Update-license-and-copyr.patch | 40 - ...gpio-mlxbf2-Convert-to-device-PM-ops.patch | 93 - ...io-mlxbf2-Drop-wrong-use-of-ACPI_PTR.patch | 50 - ...2-Use-devm_platform_ioremap_resource.patch | 48 - ...se-DEFINE_RES_MEM_NAMED-helper-macro.patch | 37 - ...49-gpio-mlxbf2-Introduce-IRQ-support.patch | 222 - ...gpio-mlxbf2.c-support-driver-version.patch | 35 - ...wcmshc-add-rockchip-platform-support.patch | 395 - ...mshc-add-ACPI-support-for-BlueField-.patch | 130 - ...mshc-fix-error-return-code-in-dwcmsh.patch | 37 - ...-dwcmshc-set-MMC_CAP_WAIT_WHILE_BUSY.patch | 32 - ...mshc-Re-enable-support-for-the-BlueF.patch | 77 - ...AUCE-Support-BlueField-3-GPIO-driver.patch | 402 - ...nable-writing-to-the-regmap-debugfs-.patch | 27 - ...-bootctl-support-icm-carveout-eeprom.patch | 118 - ...mshc-Enable-host-V4-support-for-Blue.patch | 35 - ...bf-pka-Fix-kernel-crash-with-pka-TRN.patch | 67 - ...and-thermal-management-debugfs-drive.patch | 256 - ...AUCE-mlxbf-pmc-Fix-event-string-typo.patch | 36 - ...bf-pmc-Support-for-BlueField-3-perfo.patch | 929 -- ...tform-mellanox-Add-ctrl-message-and-.patch | 275 - ...bf-pmc-Bug-fix-for-BlueField-3-count.patch | 94 - ...-sdhci-of-dwcmshc-add-the-missing-de.patch | 36 - ...necards-Disable-firmware-bundling-ma.patch | 30 - ...6-for-local_port-field-instead-of-u8.patch | 61 - ...w-minimal-Change-type-for-local-port.patch | 41 - ...unk-size-setting-in-output-mailbox-b.patch | 41 - ...bf-gige-Fix-intermittent-no-ip-issue.patch | 85 - ...e-struct-pinfunction-and-PINCTRL_PIN.patch | 60 - ...rl-mlxbf3-Add-pinctrl-driver-support.patch | 393 - ...o-mmio-handle-ngpios-properly-in-bgp.patch | 125 - ...-gpio-mlxbf3-Add-gpio-driver-support.patch | 488 - ...-Align-modules-label-name-assignment.patch | 50 - ...Limit-single-transaction-buffer-size.patch | 45 - ...MTBR-register-records-buffer-by-one-.patch | 33 - ...-sdhci-of-dwcmshc-Add-runtime-PM-ope.patch | 159 - ...lxbf-ptm-use-0444-instead-of-S_IRUGO.patch | 64 - ...AUCE-mlxbf-ptm-add-atx-debugfs-nodes.patch | 83 - ...AUCE-mlxbf-ptm-update-module-version.patch | 31 - ...bf-gige-Fix-kernel-panic-at-shutdown.patch | 48 - ...bf-bootctl-support-SMC-call-for-sett.patch | 94 - ...-BF3-related-ACPI-config-and-Ring-de.patch | 135 - ...ivial-devices-Add-infineon-xdpe1a2g7.patch | 29 - ...support-for-new-flavour-of-capabilit.patch | 53 - ...reg-Remove-code-for-amber-LED-colour.patch | 50 - ...xreg-Add-capability-bit-and-mask-fie.patch | 60 - ...-Add-support-for-new-flavour-of-capa.patch | 101 - ...-fan-Extend-number-of-supporetd-fans.patch | 47 - ...x-Introduce-support-for-switches-equ.patch | 312 - ...ellanox-Relocate-mlx-platform-driver.patch | 98 - ...AUCE-mlxbf-tmfifo-fix-potential-race.patch | 63 - ...bf-tmfifo-Drop-the-Rx-packet-if-no-m.patch | 177 - ...SAUCE-mlxbf-tmfifo-Drop-jumbo-frames.patch | 100 - ...bf-tmfifo.c-Amend-previous-tmfifo-pa.patch | 37 - ...-set_link_ksettings-ethtool-callback.patch | 39 - ...-white-space-in-mlxbf_gige_eth_ioctl.patch | 41 - ...bf-bootctl-Fix-kernel-panic-due-to-b.patch | 57 - ...x-mlxreg-hotplug-Add-support-for-new.patch | 88 - ...ox-mlx-platform-Change-register-name.patch | 57 - ...x-mlx-platform-Add-support-for-new-X.patch | 1383 --- .../9002-TMP-fix-for-fan-minimum-speed.patch | 26 - 171 files changed, 3 insertions(+), 47093 deletions(-) delete mode 100644 platform/mellanox/non-upstream-patches/patches/0049-leds-mlxreg-Provide-conversion-for-hardware-LED-colo.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0050-leds-mlxreg-Skip-setting-LED-color-during-initializa.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0051-leds-mlxreg-Allow-multi-instantiation-of-same-name-L.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0098-1-Revert-mlxsw-Use-u16-for-local_port-field.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0098-2-Revert-mlxsw-i2c-Fix-chunk-size-setting.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0098-3-Revert-mlxsw-core_hwmon-Adjust-module-label-names.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0099-mlxsw-core_hwmon-Fix-variable-names-for-hwmon-attrib.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0100-mlxsw-core_thermal-Rename-labels-according-to-naming.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0101-mlxsw-core_thermal-Remove-obsolete-API-for-query-res.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0102-mlxsw-reg-Add-mgpir_-prefix-to-MGPIR-fields-comments.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0103-mlxsw-core-Remove-unnecessary-asserts.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0104-mlxsw-reg-Extend-MTMP-register-with-new-slot-number-.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0105-mlxsw-reg-Extend-MTBR-register-with-new-slot-number-.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0106-mlxsw-reg-Extend-MCIA-register-with-new-slot-number-.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0107-mlxsw-reg-Extend-MCION-register-with-new-slot-number.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0108-mlxsw-reg-Extend-PMMP-register-with-new-slot-number-.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0109-mlxsw-reg-Extend-MGPIR-register-with-new-slot-fields.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0110-mlxsw-core_env-Pass-slot-index-during-PMAOS-register.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0111-mlxsw-reg-Add-new-field-to-Management-General-Periph.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0112-mlxsw-core-Extend-interfaces-for-cable-info-access-w.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0113-mlxsw-core-Extend-port-module-data-structures-for-li.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0114-mlxsw-core-Move-port-module-events-enablement-to-a-s.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0115-mlxsw-core_hwmon-Split-gearbox-initialization.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0116-mlxsw-core_hwmon-Extend-internal-structures-to-suppo.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0117-mlxsw-core_hwmon-Introduce-slot-parameter-in-hwmon-i.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0118-mlxsw-core_hwmon-Extend-hwmon-device-with-gearbox-ma.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0119-mlxsw-core_thermal-Extend-internal-structures-to-sup.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0120-mlxsw-core_thermal-Split-gearbox-initialization.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0121-mlxsw-core_thermal-Extend-thermal-area-with-gearbox-.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0122-mlxsw-core_thermal-Add-line-card-id-prefix-to-line-c.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0123-mlxsw-core_thermal-Use-exact-name-of-cooling-devices.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0124-mlxsw-core_thermal-Use-common-define-for-thermal-zon.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0125-devlink-add-support-to-create-line-card-and-expose-t.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0126-devlink-implement-line-card-provisioning.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0127-devlink-implement-line-card-active-state.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0128-devlink-add-port-to-line-card-relationship-set.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0129-devlink-introduce-linecard-info-get-message.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0130-devlink-introduce-linecard-info-get-message.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0131-mlxsw-reg-Add-Ports-Mapping-event-Configuration-Regi.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0132-mlxsw-reg-Add-Management-DownStream-Device-Query-Reg.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0133-mlxsw-reg-Add-Management-DownStream-Device-Control-R.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0134-mlxsw-reg-Add-Management-Binary-Code-Transfer-Regist.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0135-mlxsw-core_linecards-Add-line-card-objects-and-imple.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0136-mlxsw-core_linecards-Implement-line-card-activation-.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0137-mlxsw-core-Extend-driver-ops-by-remove-selected-port.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0138-mlxsw-spectrum-Add-port-to-linecard-mapping.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0139-mlxsw-reg-Introduce-Management-Temperature-Extended-.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0140-mlxsw-core-Add-APIs-for-thermal-sensor-mapping.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0141-mlxsw-reg-Add-Management-DownStream-Device-Tunneling.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0142-mlxsw-core_linecards-Probe-devices-for-provisioned-l.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0143-mlxsw-core_linecards-Expose-device-FW-version-over-d.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0144-mlxsw-core-Introduce-flash-update-components.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0145-mlxfw-Get-the-PSID-value-using-op-instead-of-passing.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0146-mlxsw-core_linecards-Implement-line-card-device-flas.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0147-mlxsw-core_linecards-Introduce-ops-for-linecards-sta.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0148-mlxsw-core-Add-interfaces-for-line-card-initializati.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0149-mlxsw-core_thermal-Add-interfaces-for-line-card-init.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0150-mlxsw-core_hwmon-Add-interfaces-for-line-card-initia.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0151-mlxsw-minimal-Prepare-driver-for-modular-system-supp.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0152-mlxsw-core-Extend-bus-init-function-with-event-handl.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0153-mlxsw-i2c-Add-support-for-system-events-handling.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0154-mlxsw-core-Export-line-card-API.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0155-mlxsw-minimal-Add-system-event-handler.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0156-mlxsw-minimal-Add-interfaces-for-line-card-initializ.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0167-DS-lan743x-Add-support-for-fixed-phy.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0168-TMP-mlxsw-minimal-Ignore-error-reading-SPAD-register.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0171-platform-mellanox-mlxreg-lc-Fix-cleanup-on-failure-a.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0174-DS-mlxsw-core_linecards-Skip-devlink-and-provisionin.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0181-Revert-Fix-out-of-bounds-memory-accesses-in-thermal.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0200-dt-bindings-i2c-mellanox-i2c-mlxbf-convert-txt-to-YA.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0203-i2c-mlxbf-remove-IRQF_ONESHOT.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0206-i2c-mlxbf-add-multi-slave-functionality.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0207-i2c-mlxbf-support-BlueField-3-SoC.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0208-i2c-mlxbf-remove-device-tree-support.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0209-UBUNTU-SAUCE-i2c-mlxbf.c-Add-driver-version.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0210-platform-mellanox-Typo-fix-in-the-file-mlxbf-bootctl.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0211-UBUNTU-SAUCE-platform-mellanox-Updates-to-mlxbf-boot.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0212-platform-mellanox-mlxbf-pmc-Add-Mellanox-BlueField-P.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0213-platform-mellanox-mlxbf-pmc-fix-kernel-doc-notation.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0214-platform-mellanox-mlxbf-pmc-Fix-an-IS_ERR-vs-NULL-bu.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0215-UBUNTU-SAUCE-platform-mellanox-Updates-to-mlxbf-pmc.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0216-UBUNTU-SAUCE-mlxbf_pmc-Fix-references-to-sprintf.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0217-UBUNTU-SAUCE-mlxbf-pmc-Fix-error-when-reading-unprog.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0218-UBUNTU-SAUCE-platform-mellanox-Add-mlx-trio-driver.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0219-UBUNTU-SAUCE-platform-mellanox-mlxbf-tmfifo-Add-Blue.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0220-UBUNTU-SAUCE-pka-Add-pka-driver.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0221-UBUNTU-SAUCE-platform-mellanox-Add-mlxbf-livefish-dr.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0222-workqueue-Add-resource-managed-version-of-delayed-wo.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0223-devm-helpers-Fix-devm_delayed_work_autocancel-kernel.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0224-devm-helpers-Add-resource-managed-version-of-work-in.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0225-UBUNTU-SAUCE-Add-support-to-pwr-mlxbf.c-driver.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0226-Add-Mellanox-BlueField-Gigabit-Ethernet-driver.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0227-mlxbf_gige-clear-valid_polarity-upon-open.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0228-net-mellanox-mlxbf_gige-Replace-non-standard-interru.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0229-mlxbf_gige-increase-MDIO-polling-rate-to-5us.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0230-mlxbf_gige-remove-driver-managed-interrupt-counts.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0231-mlxbf_gige-remove-own-module-name-define-and-use-KBU.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0232-UBUNTU-SAUCE-mlxbf_gige-add-ethtool-mlxbf_gige_set_r.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0233-UBUNTU-SAUCE-Fix-OOB-handling-RX-packets-in-heavy-tr.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0236-UBUNTU-SAUCE-mlxbf_gige-clear-MDIO-gateway-lock-afte.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0237-mlxbf_gige-compute-MDIO-period-based-on-i1clk.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0238-net-mlxbf_gige-Fix-an-IS_ERR-vs-NULL-bug-in-mlxbf_gi.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0239-UBUNTU-SAUCE-mlxbf_gige-add-MDIO-support-for-BlueFie.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0240-UBUNTU-SAUCE-mlxbf_gige-support-10M-100M-1G-speeds-o.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0243-UBUNTU-SAUCE-bluefield_edac-Add-SMC-support.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0244-UBUNTU-SAUCE-bluefield_edac-Update-license-and-copyr.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0245-gpio-mlxbf2-Convert-to-device-PM-ops.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0246-gpio-mlxbf2-Drop-wrong-use-of-ACPI_PTR.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0247-gpio-mlxbf2-Use-devm_platform_ioremap_resource.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0248-gpio-mlxbf2-Use-DEFINE_RES_MEM_NAMED-helper-macro.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0249-gpio-mlxbf2-Introduce-IRQ-support.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0250-UBUNTU-SAUCE-gpio-mlxbf2.c-support-driver-version.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0251-mmc-sdhci-of-dwcmshc-add-rockchip-platform-support.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0252-mmc-sdhci-of-dwcmshc-add-ACPI-support-for-BlueField-.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0253-mmc-sdhci-of-dwcmshc-fix-error-return-code-in-dwcmsh.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0254-mmc-sdhci-of-dwcmshc-set-MMC_CAP_WAIT_WHILE_BUSY.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0255-mmc-sdhci-of-dwcmshc-Re-enable-support-for-the-BlueF.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0256-UBUNTU-SAUCE-Support-BlueField-3-GPIO-driver.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0257-regmap-debugfs-Enable-writing-to-the-regmap-debugfs-.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0258-UBUNTU-SAUCE-mlx-bootctl-support-icm-carveout-eeprom.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0259-mmc-sdhci-of-dwcmshc-Enable-host-V4-support-for-Blue.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0260-UBUNTU-SAUCE-mlxbf-pka-Fix-kernel-crash-with-pka-TRN.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0261-mlxbf-ptm-power-and-thermal-management-debugfs-drive.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0262-UBUNTU-SAUCE-mlxbf-pmc-Fix-event-string-typo.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0263-UBUNTU-SAUCE-mlxbf-pmc-Support-for-BlueField-3-perfo.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0264-UBUNTU-SAUCE-platform-mellanox-Add-ctrl-message-and-.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0266-UBUNTU-SAUCE-mlxbf-pmc-Bug-fix-for-BlueField-3-count.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0267-UBUNTU-SAUCE-mmc-sdhci-of-dwcmshc-add-the-missing-de.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0268-DS-mlxsw-core_linecards-Disable-firmware-bundling-ma.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0275-mlxsw-Use-u16-for-local_port-field-instead-of-u8.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0276-mlxsw-minimal-Change-type-for-local-port.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0277-mlxsw-i2c-Fix-chunk-size-setting-in-output-mailbox-b.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0285-UBUNTU-SAUCE-mlxbf-gige-Fix-intermittent-no-ip-issue.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0286-pinctrl-Introduce-struct-pinfunction-and-PINCTRL_PIN.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0287-pinctrl-mlxbf3-Add-pinctrl-driver-support.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0288-UBUNTU-SAUCE-gpio-mmio-handle-ngpios-properly-in-bgp.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0289-UBUNTU-SAUCE-gpio-mlxbf3-Add-gpio-driver-support.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0291-mlxsw-core_hwmon-Align-modules-label-name-assignment.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0292-mlxsw-i2c-Limit-single-transaction-buffer-size.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0293-mlxsw-reg-Limit-MTBR-register-records-buffer-by-one-.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0296-UBUNTU-SAUCE-mmc-sdhci-of-dwcmshc-Add-runtime-PM-ope.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0298-UBUNTU-SAUCE-mlxbf-ptm-use-0444-instead-of-S_IRUGO.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0299-UBUNTU-SAUCE-mlxbf-ptm-add-atx-debugfs-nodes.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0300-UBUNTU-SAUCE-mlxbf-ptm-update-module-version.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0301-UBUNTU-SAUCE-mlxbf-gige-Fix-kernel-panic-at-shutdown.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0302-UBUNTU-SAUCE-mlxbf-bootctl-support-SMC-call-for-sett.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0303-UBUNTU-SAUCE-Add-BF3-related-ACPI-config-and-Ring-de.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0306-dt-bindings-trivial-devices-Add-infineon-xdpe1a2g7.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0307-leds-mlxreg-Add-support-for-new-flavour-of-capabilit.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0308-leds-mlxreg-Remove-code-for-amber-LED-colour.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0308-platform_data-mlxreg-Add-capability-bit-and-mask-fie.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0309-hwmon-mlxreg-fan-Add-support-for-new-flavour-of-capa.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0310-hwmon-mlxreg-fan-Extend-number-of-supporetd-fans.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0317-platform-mellanox-Introduce-support-for-switches-equ.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0318-mellanox-Relocate-mlx-platform-driver.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0319-UBUNTU-SAUCE-mlxbf-tmfifo-fix-potential-race.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0320-UBUNTU-SAUCE-mlxbf-tmfifo-Drop-the-Rx-packet-if-no-m.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0321-UBUNTU-SAUCE-mlxbf-tmfifo-Drop-jumbo-frames.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0322-UBUNTU-SAUCE-mlxbf-tmfifo.c-Amend-previous-tmfifo-pa.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0323-mlxbf_gige-add-set_link_ksettings-ethtool-callback.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0324-mlxbf_gige-fix-white-space-in-mlxbf_gige_eth_ioctl.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0325-UBUNTU-SAUCE-mlxbf-bootctl-Fix-kernel-panic-due-to-b.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0326-platform-mellanox-mlxreg-hotplug-Add-support-for-new.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0327-platform-mellanox-mlx-platform-Change-register-name.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/0328-platform-mellanox-mlx-platform-Add-support-for-new-X.patch delete mode 100644 platform/mellanox/non-upstream-patches/patches/9002-TMP-fix-for-fan-minimum-speed.patch diff --git a/platform/mellanox/hw-management.mk b/platform/mellanox/hw-management.mk index 7f28a8a927a8..c449e253aadb 100644 --- a/platform/mellanox/hw-management.mk +++ b/platform/mellanox/hw-management.mk @@ -16,7 +16,7 @@ # # Mellanox HW Management -MLNX_HW_MANAGEMENT_VERSION = 7.0030.2008 +MLNX_HW_MANAGEMENT_VERSION = 7.0030.4002 export MLNX_HW_MANAGEMENT_VERSION diff --git a/platform/mellanox/hw-management/Makefile b/platform/mellanox/hw-management/Makefile index 3ada49920413..a42bcdfeafb7 100644 --- a/platform/mellanox/hw-management/Makefile +++ b/platform/mellanox/hw-management/Makefile @@ -9,7 +9,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : git stash git apply -3 ../*.patch || exit 1 chmod +x ./debian/rules - KVERSION=$(KVERSION) dpkg-buildpackage -us -uc -b -rfakeroot -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) + KVERSION=$(KVERSION) LM_DEPENDS=0 dpkg-buildpackage -us -uc -b -rfakeroot -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) popd mv $* $(DEST)/ diff --git a/platform/mellanox/hw-management/hw-mgmt b/platform/mellanox/hw-management/hw-mgmt index f0cbd0e61f77..2b65d4c35c3c 160000 --- a/platform/mellanox/hw-management/hw-mgmt +++ b/platform/mellanox/hw-management/hw-mgmt @@ -1 +1 @@ -Subproject commit f0cbd0e61f77ca0d8ca37612abc5fe8339e0f884 +Subproject commit 2b65d4c35c3c6a1025954ff9b3dc66a406b7db2d diff --git a/platform/mellanox/hw-management/hwmgmt_nonup_patches b/platform/mellanox/hw-management/hwmgmt_nonup_patches index f3cd270a0d95..a247853ce55a 100644 --- a/platform/mellanox/hw-management/hwmgmt_nonup_patches +++ b/platform/mellanox/hw-management/hwmgmt_nonup_patches @@ -1,167 +1 @@ # Current non-upstream patch list, should be updated by hwmgmt_kernel_patches.py script -0049-leds-mlxreg-Provide-conversion-for-hardware-LED-colo.patch -0050-leds-mlxreg-Skip-setting-LED-color-during-initializa.patch -0051-leds-mlxreg-Allow-multi-instantiation-of-same-name-L.patch -0098-1-Revert-mlxsw-Use-u16-for-local_port-field.patch -0098-2-Revert-mlxsw-i2c-Fix-chunk-size-setting.patch -0098-3-Revert-mlxsw-core_hwmon-Adjust-module-label-names.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 -0167-DS-lan743x-Add-support-for-fixed-phy.patch -0168-TMP-mlxsw-minimal-Ignore-error-reading-SPAD-register.patch -0171-platform-mellanox-mlxreg-lc-Fix-cleanup-on-failure-a.patch -0174-DS-mlxsw-core_linecards-Skip-devlink-and-provisionin.patch -0181-Revert-Fix-out-of-bounds-memory-accesses-in-thermal.patch -0200-dt-bindings-i2c-mellanox-i2c-mlxbf-convert-txt-to-YA.patch -0203-i2c-mlxbf-remove-IRQF_ONESHOT.patch -0206-i2c-mlxbf-add-multi-slave-functionality.patch -0207-i2c-mlxbf-support-BlueField-3-SoC.patch -0208-i2c-mlxbf-remove-device-tree-support.patch -0209-UBUNTU-SAUCE-i2c-mlxbf.c-Add-driver-version.patch -0210-platform-mellanox-Typo-fix-in-the-file-mlxbf-bootctl.patch -0211-UBUNTU-SAUCE-platform-mellanox-Updates-to-mlxbf-boot.patch -0212-platform-mellanox-mlxbf-pmc-Add-Mellanox-BlueField-P.patch -0213-platform-mellanox-mlxbf-pmc-fix-kernel-doc-notation.patch -0214-platform-mellanox-mlxbf-pmc-Fix-an-IS_ERR-vs-NULL-bu.patch -0215-UBUNTU-SAUCE-platform-mellanox-Updates-to-mlxbf-pmc.patch -0216-UBUNTU-SAUCE-mlxbf_pmc-Fix-references-to-sprintf.patch -0217-UBUNTU-SAUCE-mlxbf-pmc-Fix-error-when-reading-unprog.patch -0218-UBUNTU-SAUCE-platform-mellanox-Add-mlx-trio-driver.patch -0219-UBUNTU-SAUCE-platform-mellanox-mlxbf-tmfifo-Add-Blue.patch -0220-UBUNTU-SAUCE-pka-Add-pka-driver.patch -0221-UBUNTU-SAUCE-platform-mellanox-Add-mlxbf-livefish-dr.patch -0222-workqueue-Add-resource-managed-version-of-delayed-wo.patch -0223-devm-helpers-Fix-devm_delayed_work_autocancel-kernel.patch -0224-devm-helpers-Add-resource-managed-version-of-work-in.patch -0225-UBUNTU-SAUCE-Add-support-to-pwr-mlxbf.c-driver.patch -0226-Add-Mellanox-BlueField-Gigabit-Ethernet-driver.patch -0227-mlxbf_gige-clear-valid_polarity-upon-open.patch -0228-net-mellanox-mlxbf_gige-Replace-non-standard-interru.patch -0229-mlxbf_gige-increase-MDIO-polling-rate-to-5us.patch -0230-mlxbf_gige-remove-driver-managed-interrupt-counts.patch -0231-mlxbf_gige-remove-own-module-name-define-and-use-KBU.patch -0232-UBUNTU-SAUCE-mlxbf_gige-add-ethtool-mlxbf_gige_set_r.patch -0233-UBUNTU-SAUCE-Fix-OOB-handling-RX-packets-in-heavy-tr.patch -0236-UBUNTU-SAUCE-mlxbf_gige-clear-MDIO-gateway-lock-afte.patch -0237-mlxbf_gige-compute-MDIO-period-based-on-i1clk.patch -0238-net-mlxbf_gige-Fix-an-IS_ERR-vs-NULL-bug-in-mlxbf_gi.patch -0239-UBUNTU-SAUCE-mlxbf_gige-add-MDIO-support-for-BlueFie.patch -0240-UBUNTU-SAUCE-mlxbf_gige-support-10M-100M-1G-speeds-o.patch -0243-UBUNTU-SAUCE-bluefield_edac-Add-SMC-support.patch -0244-UBUNTU-SAUCE-bluefield_edac-Update-license-and-copyr.patch -0245-gpio-mlxbf2-Convert-to-device-PM-ops.patch -0246-gpio-mlxbf2-Drop-wrong-use-of-ACPI_PTR.patch -0247-gpio-mlxbf2-Use-devm_platform_ioremap_resource.patch -0248-gpio-mlxbf2-Use-DEFINE_RES_MEM_NAMED-helper-macro.patch -0249-gpio-mlxbf2-Introduce-IRQ-support.patch -0250-UBUNTU-SAUCE-gpio-mlxbf2.c-support-driver-version.patch -0251-mmc-sdhci-of-dwcmshc-add-rockchip-platform-support.patch -0252-mmc-sdhci-of-dwcmshc-add-ACPI-support-for-BlueField-.patch -0253-mmc-sdhci-of-dwcmshc-fix-error-return-code-in-dwcmsh.patch -0254-mmc-sdhci-of-dwcmshc-set-MMC_CAP_WAIT_WHILE_BUSY.patch -0255-mmc-sdhci-of-dwcmshc-Re-enable-support-for-the-BlueF.patch -0256-UBUNTU-SAUCE-Support-BlueField-3-GPIO-driver.patch -0257-regmap-debugfs-Enable-writing-to-the-regmap-debugfs-.patch -0258-UBUNTU-SAUCE-mlx-bootctl-support-icm-carveout-eeprom.patch -0259-mmc-sdhci-of-dwcmshc-Enable-host-V4-support-for-Blue.patch -0260-UBUNTU-SAUCE-mlxbf-pka-Fix-kernel-crash-with-pka-TRN.patch -0261-mlxbf-ptm-power-and-thermal-management-debugfs-drive.patch -0262-UBUNTU-SAUCE-mlxbf-pmc-Fix-event-string-typo.patch -0263-UBUNTU-SAUCE-mlxbf-pmc-Support-for-BlueField-3-perfo.patch -0264-UBUNTU-SAUCE-platform-mellanox-Add-ctrl-message-and-.patch -0266-UBUNTU-SAUCE-mlxbf-pmc-Bug-fix-for-BlueField-3-count.patch -0267-UBUNTU-SAUCE-mmc-sdhci-of-dwcmshc-add-the-missing-de.patch -0268-DS-mlxsw-core_linecards-Disable-firmware-bundling-ma.patch -0275-mlxsw-Use-u16-for-local_port-field-instead-of-u8.patch -0276-mlxsw-minimal-Change-type-for-local-port.patch -0277-mlxsw-i2c-Fix-chunk-size-setting-in-output-mailbox-b.patch -0285-UBUNTU-SAUCE-mlxbf-gige-Fix-intermittent-no-ip-issue.patch -0286-pinctrl-Introduce-struct-pinfunction-and-PINCTRL_PIN.patch -0287-pinctrl-mlxbf3-Add-pinctrl-driver-support.patch -0288-UBUNTU-SAUCE-gpio-mmio-handle-ngpios-properly-in-bgp.patch -0289-UBUNTU-SAUCE-gpio-mlxbf3-Add-gpio-driver-support.patch -0291-mlxsw-core_hwmon-Align-modules-label-name-assignment.patch -0292-mlxsw-i2c-Limit-single-transaction-buffer-size.patch -0293-mlxsw-reg-Limit-MTBR-register-records-buffer-by-one-.patch -0296-UBUNTU-SAUCE-mmc-sdhci-of-dwcmshc-Add-runtime-PM-ope.patch -0298-UBUNTU-SAUCE-mlxbf-ptm-use-0444-instead-of-S_IRUGO.patch -0299-UBUNTU-SAUCE-mlxbf-ptm-add-atx-debugfs-nodes.patch -0300-UBUNTU-SAUCE-mlxbf-ptm-update-module-version.patch -0301-UBUNTU-SAUCE-mlxbf-gige-Fix-kernel-panic-at-shutdown.patch -0302-UBUNTU-SAUCE-mlxbf-bootctl-support-SMC-call-for-sett.patch -0303-UBUNTU-SAUCE-Add-BF3-related-ACPI-config-and-Ring-de.patch -0306-dt-bindings-trivial-devices-Add-infineon-xdpe1a2g7.patch -0307-leds-mlxreg-Add-support-for-new-flavour-of-capabilit.patch -0308-leds-mlxreg-Remove-code-for-amber-LED-colour.patch -0308-platform_data-mlxreg-Add-capability-bit-and-mask-fie.patch -0309-hwmon-mlxreg-fan-Add-support-for-new-flavour-of-capa.patch -0310-hwmon-mlxreg-fan-Extend-number-of-supporetd-fans.patch -0317-platform-mellanox-Introduce-support-for-switches-equ.patch -0318-mellanox-Relocate-mlx-platform-driver.patch -0319-UBUNTU-SAUCE-mlxbf-tmfifo-fix-potential-race.patch -0320-UBUNTU-SAUCE-mlxbf-tmfifo-Drop-the-Rx-packet-if-no-m.patch -0321-UBUNTU-SAUCE-mlxbf-tmfifo-Drop-jumbo-frames.patch -0322-UBUNTU-SAUCE-mlxbf-tmfifo.c-Amend-previous-tmfifo-pa.patch -0323-mlxbf_gige-add-set_link_ksettings-ethtool-callback.patch -0324-mlxbf_gige-fix-white-space-in-mlxbf_gige_eth_ioctl.patch -0325-UBUNTU-SAUCE-mlxbf-bootctl-Fix-kernel-panic-due-to-b.patch -0326-platform-mellanox-mlxreg-hotplug-Add-support-for-new.patch -0327-platform-mellanox-mlx-platform-Change-register-name.patch -0328-platform-mellanox-mlx-platform-Add-support-for-new-X.patch -9002-TMP-fix-for-fan-minimum-speed.patch diff --git a/platform/mellanox/non-upstream-patches/external-changes.patch b/platform/mellanox/non-upstream-patches/external-changes.patch index 0cda6fd9f7bf..8b137891791f 100644 --- a/platform/mellanox/non-upstream-patches/external-changes.patch +++ b/platform/mellanox/non-upstream-patches/external-changes.patch @@ -1,243 +1 @@ ---- a/patch/series -+++ b/patch/series -@@ -115,6 +115,9 @@ - 0045-i2c-mlxcpld-Fix-criteria-for-frequency-setting.patch - 0046-i2c-mlxcpld-Reduce-polling-time-for-performance-impr.patch - 0047-i2c-mlxcpld-Allow-flexible-polling-time-setting-for-.patch -+0049-leds-mlxreg-Provide-conversion-for-hardware-LED-colo.patch -+0050-leds-mlxreg-Skip-setting-LED-color-during-initializa.patch -+0051-leds-mlxreg-Allow-multi-instantiation-of-same-name-L.patch - 0053-mlxsw-core-Avoid-creation-virtual-hwmon-objects-by-t.patch - 0054-mlxsw-minimal-Simplify-method-of-modules-number-dete.patch - 0055-platform_data-mlxreg-Add-new-type-to-support-modular.patch -@@ -162,7 +165,68 @@ - 0097-1-mlxsw-Use-u16-for-local_port-field.patch - 0097-2-mlxsw-i2c-Fix-chunk-size-setting.patch - 0097-3-mlxsw-core_hwmon-Adjust-module-label-names.patch -+0098-1-Revert-mlxsw-Use-u16-for-local_port-field.patch -+0098-2-Revert-mlxsw-i2c-Fix-chunk-size-setting.patch -+0098-3-Revert-mlxsw-core_hwmon-Adjust-module-label-names.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 - 0152-mlxsw-i2c-Prevent-transaction-execution-for-spec.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 -@@ -173,14 +237,19 @@ - 0164-hwmon-jc42-Add-support-for-Seiko-Instruments-S-34TS0.patch - 0165-platform-mellanox-mlxreg-io-Add-locking-for-io-opera.patch - 0166-DS-leds-leds-mlxreg-Send-udev-event-from-leds-mlxreg.patch -+0167-DS-lan743x-Add-support-for-fixed-phy.patch -+0168-TMP-mlxsw-minimal-Ignore-error-reading-SPAD-register.patch - 0170-i2c-mlxcpld-Fix-register-setting-for-400KHz-frequenc.patch -+0171-platform-mellanox-mlxreg-lc-Fix-cleanup-on-failure-a.patch - 0172-DS-platform-mlx-platform-Add-SPI-path-for-rack-switc.patch - 0173-mlxsw-core-Add-support-for-OSFP-transceiver-modules.patch -+0174-DS-mlxsw-core_linecards-Skip-devlink-and-provisionin.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 -+0181-Revert-Fix-out-of-bounds-memory-accesses-in-thermal.patch - 0182-platform-mellanox-Introduce-support-of-new-Nvidia-L1.patch - 0183-platform-mellanox-Split-initialization-procedure.patch - 0184-platform-mellanox-Split-logic-in-init-and-exit-flow.patch -@@ -198,24 +267,121 @@ - 0197-platform-mellanox-Fix-order-in-exit-flow.patch - 0198-platform-mellanox-Add-new-attributes.patch - 0199-platform-mellanox-Change-register-offset-addresses.patch -+0200-dt-bindings-i2c-mellanox-i2c-mlxbf-convert-txt-to-YA.patch -+0203-i2c-mlxbf-remove-IRQF_ONESHOT.patch -+0206-i2c-mlxbf-add-multi-slave-functionality.patch -+0207-i2c-mlxbf-support-BlueField-3-SoC.patch -+0208-i2c-mlxbf-remove-device-tree-support.patch -+0209-UBUNTU-SAUCE-i2c-mlxbf.c-Add-driver-version.patch -+0210-platform-mellanox-Typo-fix-in-the-file-mlxbf-bootctl.patch -+0211-UBUNTU-SAUCE-platform-mellanox-Updates-to-mlxbf-boot.patch -+0212-platform-mellanox-mlxbf-pmc-Add-Mellanox-BlueField-P.patch -+0213-platform-mellanox-mlxbf-pmc-fix-kernel-doc-notation.patch -+0214-platform-mellanox-mlxbf-pmc-Fix-an-IS_ERR-vs-NULL-bu.patch -+0215-UBUNTU-SAUCE-platform-mellanox-Updates-to-mlxbf-pmc.patch -+0216-UBUNTU-SAUCE-mlxbf_pmc-Fix-references-to-sprintf.patch -+0217-UBUNTU-SAUCE-mlxbf-pmc-Fix-error-when-reading-unprog.patch -+0218-UBUNTU-SAUCE-platform-mellanox-Add-mlx-trio-driver.patch -+0219-UBUNTU-SAUCE-platform-mellanox-mlxbf-tmfifo-Add-Blue.patch -+0220-UBUNTU-SAUCE-pka-Add-pka-driver.patch -+0221-UBUNTU-SAUCE-platform-mellanox-Add-mlxbf-livefish-dr.patch -+0222-workqueue-Add-resource-managed-version-of-delayed-wo.patch -+0223-devm-helpers-Fix-devm_delayed_work_autocancel-kernel.patch -+0224-devm-helpers-Add-resource-managed-version-of-work-in.patch -+0225-UBUNTU-SAUCE-Add-support-to-pwr-mlxbf.c-driver.patch -+0226-Add-Mellanox-BlueField-Gigabit-Ethernet-driver.patch -+0227-mlxbf_gige-clear-valid_polarity-upon-open.patch -+0228-net-mellanox-mlxbf_gige-Replace-non-standard-interru.patch -+0229-mlxbf_gige-increase-MDIO-polling-rate-to-5us.patch -+0230-mlxbf_gige-remove-driver-managed-interrupt-counts.patch -+0231-mlxbf_gige-remove-own-module-name-define-and-use-KBU.patch -+0232-UBUNTU-SAUCE-mlxbf_gige-add-ethtool-mlxbf_gige_set_r.patch -+0233-UBUNTU-SAUCE-Fix-OOB-handling-RX-packets-in-heavy-tr.patch -+0236-UBUNTU-SAUCE-mlxbf_gige-clear-MDIO-gateway-lock-afte.patch -+0237-mlxbf_gige-compute-MDIO-period-based-on-i1clk.patch -+0238-net-mlxbf_gige-Fix-an-IS_ERR-vs-NULL-bug-in-mlxbf_gi.patch -+0239-UBUNTU-SAUCE-mlxbf_gige-add-MDIO-support-for-BlueFie.patch -+0240-UBUNTU-SAUCE-mlxbf_gige-support-10M-100M-1G-speeds-o.patch -+0243-UBUNTU-SAUCE-bluefield_edac-Add-SMC-support.patch -+0244-UBUNTU-SAUCE-bluefield_edac-Update-license-and-copyr.patch -+0245-gpio-mlxbf2-Convert-to-device-PM-ops.patch -+0246-gpio-mlxbf2-Drop-wrong-use-of-ACPI_PTR.patch -+0247-gpio-mlxbf2-Use-devm_platform_ioremap_resource.patch -+0248-gpio-mlxbf2-Use-DEFINE_RES_MEM_NAMED-helper-macro.patch -+0249-gpio-mlxbf2-Introduce-IRQ-support.patch -+0250-UBUNTU-SAUCE-gpio-mlxbf2.c-support-driver-version.patch -+0251-mmc-sdhci-of-dwcmshc-add-rockchip-platform-support.patch -+0252-mmc-sdhci-of-dwcmshc-add-ACPI-support-for-BlueField-.patch -+0253-mmc-sdhci-of-dwcmshc-fix-error-return-code-in-dwcmsh.patch -+0254-mmc-sdhci-of-dwcmshc-set-MMC_CAP_WAIT_WHILE_BUSY.patch -+0255-mmc-sdhci-of-dwcmshc-Re-enable-support-for-the-BlueF.patch -+0256-UBUNTU-SAUCE-Support-BlueField-3-GPIO-driver.patch -+0257-regmap-debugfs-Enable-writing-to-the-regmap-debugfs-.patch -+0258-UBUNTU-SAUCE-mlx-bootctl-support-icm-carveout-eeprom.patch -+0259-mmc-sdhci-of-dwcmshc-Enable-host-V4-support-for-Blue.patch -+0260-UBUNTU-SAUCE-mlxbf-pka-Fix-kernel-crash-with-pka-TRN.patch -+0261-mlxbf-ptm-power-and-thermal-management-debugfs-drive.patch -+0262-UBUNTU-SAUCE-mlxbf-pmc-Fix-event-string-typo.patch -+0263-UBUNTU-SAUCE-mlxbf-pmc-Support-for-BlueField-3-perfo.patch -+0264-UBUNTU-SAUCE-platform-mellanox-Add-ctrl-message-and-.patch -+0266-UBUNTU-SAUCE-mlxbf-pmc-Bug-fix-for-BlueField-3-count.patch -+0267-UBUNTU-SAUCE-mmc-sdhci-of-dwcmshc-add-the-missing-de.patch -+0268-DS-mlxsw-core_linecards-Disable-firmware-bundling-ma.patch - 0269-platform-mellanox-Add-field-upgrade-capability-regis.patch - 0270-platform-mellanox-Modify-reset-causes-description.patch -+0275-mlxsw-Use-u16-for-local_port-field-instead-of-u8.patch -+0276-mlxsw-minimal-Change-type-for-local-port.patch -+0277-mlxsw-i2c-Fix-chunk-size-setting-in-output-mailbox-b.patch - 0278-platform-mellanox-mlx-platform-Modify-graceful-shutd.patch - 0279-platform-mellanox-mlx-platform-Fix-signals-polarity-.patch - 0280-platform-mellanox-mlxreg-hotplug-Extend-condition-fo.patch - 0281-platform-mellanox-mlx-platform-Modify-health-and-pow.patch - 0282-platform-mellanox-mlx-platform-Add-reset-cause-attri.patch - 0284-platform-mellanox-mlx-platform-add-support-for-addit.patch -+0285-UBUNTU-SAUCE-mlxbf-gige-Fix-intermittent-no-ip-issue.patch -+0286-pinctrl-Introduce-struct-pinfunction-and-PINCTRL_PIN.patch -+0287-pinctrl-mlxbf3-Add-pinctrl-driver-support.patch -+0288-UBUNTU-SAUCE-gpio-mmio-handle-ngpios-properly-in-bgp.patch -+0289-UBUNTU-SAUCE-gpio-mlxbf3-Add-gpio-driver-support.patch -+0291-mlxsw-core_hwmon-Align-modules-label-name-assignment.patch -+0292-mlxsw-i2c-Limit-single-transaction-buffer-size.patch -+0293-mlxsw-reg-Limit-MTBR-register-records-buffer-by-one-.patch - 0294-hwmon-pmbus-Add-support-for-MPS-Multi-phase-mp2891-c.patch - 0295-dt-bindings-trivial-devices-Add-mps-mp2891.patch -+0296-UBUNTU-SAUCE-mmc-sdhci-of-dwcmshc-Add-runtime-PM-ope.patch -+0298-UBUNTU-SAUCE-mlxbf-ptm-use-0444-instead-of-S_IRUGO.patch -+0299-UBUNTU-SAUCE-mlxbf-ptm-add-atx-debugfs-nodes.patch -+0300-UBUNTU-SAUCE-mlxbf-ptm-update-module-version.patch -+0301-UBUNTU-SAUCE-mlxbf-gige-Fix-kernel-panic-at-shutdown.patch -+0302-UBUNTU-SAUCE-mlxbf-bootctl-support-SMC-call-for-sett.patch -+0303-UBUNTU-SAUCE-Add-BF3-related-ACPI-config-and-Ring-de.patch - 0304-platform-mellanox-mlx-platform-Modify-power-off-call.patch - 0305-Extend-driver-to-support-Infineon-Digital-Multi-phas.patch -+0306-dt-bindings-trivial-devices-Add-infineon-xdpe1a2g7.patch -+0307-leds-mlxreg-Add-support-for-new-flavour-of-capabilit.patch -+0308-leds-mlxreg-Remove-code-for-amber-LED-colour.patch -+0308-platform_data-mlxreg-Add-capability-bit-and-mask-fie.patch -+0309-hwmon-mlxreg-fan-Add-support-for-new-flavour-of-capa.patch -+0310-hwmon-mlxreg-fan-Extend-number-of-supporetd-fans.patch - 0311-platform-mellanox-nvsw-sn2201-change-fans-i2c-busses.patch - 0312-platform-mellanox-mlx-platform-Add-reset-callback.patch - 0313-platform-mellanox-mlx-platform-Prepare-driver-to-all.patch - 0314-platform-mellanox-mlx-platform-Introduce-ACPI-init-f.patch - 0315-platform-mellanox-mlx-platform-Get-interrupt-line-th.patch - 0316-platform-mellanox-Add-initial-support-for-PCIe-based.patch -+0317-platform-mellanox-Introduce-support-for-switches-equ.patch -+0318-mellanox-Relocate-mlx-platform-driver.patch -+0319-UBUNTU-SAUCE-mlxbf-tmfifo-fix-potential-race.patch -+0320-UBUNTU-SAUCE-mlxbf-tmfifo-Drop-the-Rx-packet-if-no-m.patch -+0321-UBUNTU-SAUCE-mlxbf-tmfifo-Drop-jumbo-frames.patch -+0322-UBUNTU-SAUCE-mlxbf-tmfifo.c-Amend-previous-tmfifo-pa.patch -+0323-mlxbf_gige-add-set_link_ksettings-ethtool-callback.patch -+0324-mlxbf_gige-fix-white-space-in-mlxbf_gige_eth_ioctl.patch -+0325-UBUNTU-SAUCE-mlxbf-bootctl-Fix-kernel-panic-due-to-b.patch -+0326-platform-mellanox-mlxreg-hotplug-Add-support-for-new.patch -+0327-platform-mellanox-mlx-platform-Change-register-name.patch -+0328-platform-mellanox-mlx-platform-Add-support-for-new-X.patch -+9002-TMP-fix-for-fan-minimum-speed.patch - ###-> mellanox_hw_mgmt-end - - # Cisco patches for 5.10 kernel ---- a/patch/kconfig-inclusions -+++ b/patch/kconfig-inclusions -@@ -206,4 +206,15 @@ - [mellanox-arm64] - CONFIG_THERMAL_STATISTICS=n - CONFIG_THERMAL_WRITABLE_TRIPS=y -- -+CONFIG_SENSORS_MP2891=m -+CONFIG_MMC_SDHCI_OF_DWCMSHC=m -+CONFIG_VFIO_PLATFORM=m -+CONFIG_SENSORS_ARM_SCMI=m -+CONFIG_MLXBF_GIGE=m -+CONFIG_I2C_MLXBF=m -+CONFIG_GPIO_MLXBF3=m -+CONFIG_MLXBF_TMFIFO=m -+CONFIG_MLXBF_BOOTCTL=m -+CONFIG_MLXBF_PMC=m -+CONFIG_MLXBF_PTM=m -+ diff --git a/platform/mellanox/non-upstream-patches/patches/0049-leds-mlxreg-Provide-conversion-for-hardware-LED-colo.patch b/platform/mellanox/non-upstream-patches/patches/0049-leds-mlxreg-Provide-conversion-for-hardware-LED-colo.patch deleted file mode 100644 index 7842ae66e611..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0049-leds-mlxreg-Provide-conversion-for-hardware-LED-colo.patch +++ /dev/null @@ -1,96 +0,0 @@ -From 4db801c656712234c840883b68429e6d45080ea3 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Tue, 6 Jul 2021 18:38:29 +0000 -Subject: [PATCH backport v5.10.43 49/67] leds: mlxreg: Provide conversion for - hardware LED color code - -In case register is set by hardware, convert hardware color code to -expose correct color to "sysfs". -For some LED color at initial state is set by hardware. Hardware -controls LED color until the first software write access to any LED -register - the first software access cancels hardware control. -If LED is under hardware control - detect the color in brightness_get() -function. - -Signed-off-by: Vadim Pasternak ---- - drivers/leds/leds-mlxreg.c | 27 ++++++++++++++++++++++----- - 1 file changed, 22 insertions(+), 5 deletions(-) - -diff --git a/drivers/leds/leds-mlxreg.c b/drivers/leds/leds-mlxreg.c -index 82aea1cd0c12..aa82f6a521f8 100644 ---- a/drivers/leds/leds-mlxreg.c -+++ b/drivers/leds/leds-mlxreg.c -@@ -17,7 +17,9 @@ - #define MLXREG_LED_OFFSET_BLINK_3HZ 0x01 /* Offset from solid: 3Hz blink */ - #define MLXREG_LED_OFFSET_BLINK_6HZ 0x02 /* Offset from solid: 6Hz blink */ - #define MLXREG_LED_IS_OFF 0x00 /* Off */ --#define MLXREG_LED_RED_SOLID 0x05 /* Solid red */ -+#define MLXREG_LED_RED_SOLID_HW 0x01 /* Solid red or orange by hardware */ -+#define MLXREG_LED_RED_SOLID 0x05 /* Solid red or orange */ -+#define MLXREG_LED_GREEN_SOLID_HW 0x09 /* Solid green by hardware */ - #define MLXREG_LED_GREEN_SOLID 0x0D /* Solid green */ - #define MLXREG_LED_AMBER_SOLID 0x09 /* Solid amber */ - #define MLXREG_LED_BLINK_3HZ 167 /* ~167 msec off/on - HW support */ -@@ -30,6 +32,7 @@ - * @data: led configuration data; - * @led_classdev: led class data; - * @base_color: base led color (other colors have constant offset from base); -+ * @base_color_hw: base led color set by hardware; - * @led_data: led data; - * @data_parent: pointer to private device control data of parent; - */ -@@ -37,6 +40,7 @@ struct mlxreg_led_data { - struct mlxreg_core_data *data; - struct led_classdev led_cdev; - u8 base_color; -+ u8 base_color_hw; - void *data_parent; - char led_cdev_name[MLXREG_CORE_LABEL_MAX_SIZE]; - }; -@@ -124,8 +128,17 @@ mlxreg_led_get_hw(struct mlxreg_led_data *led_data) - regval = regval & ~data->mask; - regval = (ror32(data->mask, data->bit) == 0xf0) ? ror32(regval, - data->bit) : ror32(regval, data->bit + 4); -- if (regval >= led_data->base_color && -- regval <= (led_data->base_color + MLXREG_LED_OFFSET_BLINK_6HZ)) -+ -+ /* -+ * For some LED color at initial state is set by hardware. Hardware controls LED color -+ * until the first write access to any LED register. If LED is under hardware control - -+ * convert the value to the software mask to expose correct color. The first LED set by -+ * software cancels hardware control. -+ */ -+ if ((regval >= led_data->base_color && -+ regval <= (led_data->base_color + MLXREG_LED_OFFSET_BLINK_6HZ)) || -+ (led_data->base_color_hw && regval >= led_data->base_color_hw && -+ regval <= (led_data->base_color_hw + MLXREG_LED_OFFSET_BLINK_6HZ))) - return LED_FULL; - - return LED_OFF; -@@ -217,16 +230,20 @@ static int mlxreg_led_config(struct mlxreg_led_priv_data *priv) - - led_cdev = &led_data->led_cdev; - led_data->data_parent = priv; -- if (strstr(data->label, "red") || -- strstr(data->label, "orange")) { -+ if (strstr(data->label, "red")) { -+ brightness = LED_OFF; -+ led_data->base_color = MLXREG_LED_RED_SOLID; -+ } else if (strstr(data->label, "orange")) { - brightness = LED_OFF; - led_data->base_color = MLXREG_LED_RED_SOLID; -+ led_data->base_color_hw = MLXREG_LED_RED_SOLID_HW; - } else if (strstr(data->label, "amber")) { - brightness = LED_OFF; - led_data->base_color = MLXREG_LED_AMBER_SOLID; - } else { - brightness = LED_OFF; - led_data->base_color = MLXREG_LED_GREEN_SOLID; -+ led_data->base_color_hw = MLXREG_LED_GREEN_SOLID_HW; - } - snprintf(led_data->led_cdev_name, sizeof(led_data->led_cdev_name), - "mlxreg:%s", data->label); --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0050-leds-mlxreg-Skip-setting-LED-color-during-initializa.patch b/platform/mellanox/non-upstream-patches/patches/0050-leds-mlxreg-Skip-setting-LED-color-during-initializa.patch deleted file mode 100644 index 8c1da27b3548..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0050-leds-mlxreg-Skip-setting-LED-color-during-initializa.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 3d0e396f29b5da17385c279946b70ee5cd373efe Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Wed, 7 Jul 2021 10:18:14 +0000 -Subject: [PATCH backport 5.10 050/182] leds: mlxreg: Skip setting LED color - during initialization - -Hardware controls LED through CPLD device and LED control ownership -passes to the software after it performs the first write operation for -any LED on a system. -For example, hardware sets "system" LED "green blink" during boot and -might change it to "red", in case something is went wrong from hardware -point of view. -The motivation for not setting LED during kernel initialization is for -keeping hardware settings visible for user, until user will not decide -to set LEDs according to user OS specific requirements. - -Signed-off-by: Vadim Pasternak ---- - drivers/leds/leds-mlxreg.c | 3 --- - 1 file changed, 3 deletions(-) - -diff --git a/drivers/leds/leds-mlxreg.c b/drivers/leds/leds-mlxreg.c -index 82aea1cd0c12..7df4653a80d7 100644 ---- a/drivers/leds/leds-mlxreg.c -+++ b/drivers/leds/leds-mlxreg.c -@@ -243,9 +243,6 @@ static int mlxreg_led_config(struct mlxreg_led_priv_data *priv) - if (err) - return err; - -- if (led_cdev->brightness) -- mlxreg_led_brightness_set(led_cdev, -- led_cdev->brightness); - dev_info(led_cdev->dev, "label: %s, mask: 0x%02x, offset:0x%02x\n", - data->label, data->mask, data->reg); - } --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0051-leds-mlxreg-Allow-multi-instantiation-of-same-name-L.patch b/platform/mellanox/non-upstream-patches/patches/0051-leds-mlxreg-Allow-multi-instantiation-of-same-name-L.patch deleted file mode 100644 index d546eaf4b138..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0051-leds-mlxreg-Allow-multi-instantiation-of-same-name-L.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 6782d682cb0510d0fee33f456ed3492834bad97d Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Wed, 7 Jul 2021 10:29:27 +0000 -Subject: leds: mlxreg: Allow multi-instantiation of same name LED for modular - systems - -It could be more than one instance of LED with the same name in the -modular systems. For example, "status" or "uid" LED can be located -on chassis and on each line card of modular system. -In order to avoid conflicts with duplicated names, append platform -device Id, which is unique, to LED name after driver name. -Thus, for example, "status" LED on chassis is to be called, like it is -called now on non-modular systems, on which platform device Id is not -specified: "mlxreg:status:green". While for the line cards LEDs it will -be called like: "pcicard48:status:green", "ibcard66:status:green", -etc. Where line card prefix is specified according to the type of bus -connecting line card to the chassis. - -LED driver works on top of register space of the programmable devices -(CPLD or FPGA), providing the logic for LED control. The programmable -devices on the line cards are connected through I2C bus and LED driver -will work over I2C. On main board programmable device is connected -through LPC, and LED driver works over LPC. - -The motivation it to provide support for new modular systems which -could be equipped with the different types of replaceable line cards -and management board. - -Line cards are connected to the chassis through I2C interface for the -chassis management operations and through PCIe for the networking -operations. - -The first type of line card supports 16x100GbE QSFP28 Ethernet ports. -Those line cards equipped with the programmable devices aimed for -system control of Nvidia Ethernet switch ASIC control, Nvidia FPGA, -Nvidia gearboxes (PHYs). -The next coming card generations are supposed to support: -- Line cards with 8x200Gbe QSFP28 Ethernet ports. -- Line cards with 4x400Gbe QSFP-DD Ethernet ports. -- Smart cards equipped with Nvidia ARM CPU for offloading and for fast - access to the storage (EBoF). -- Fabric cards for inter-connection. - -Signed-off-by: Vadim Pasternak ---- - drivers/leds/leds-mlxreg.c | 15 +++++++++++++-- - 1 file changed, 13 insertions(+), 2 deletions(-) - -diff --git a/drivers/leds/leds-mlxreg.c b/drivers/leds/leds-mlxreg.c -index 0f2608a34..099ff4be2 100644 ---- a/drivers/leds/leds-mlxreg.c -+++ b/drivers/leds/leds-mlxreg.c -@@ -245,8 +245,19 @@ static int mlxreg_led_config(struct mlxreg_led_priv_data *priv) - led_data->base_color = MLXREG_LED_GREEN_SOLID; - led_data->base_color_hw = MLXREG_LED_GREEN_SOLID_HW; - } -- snprintf(led_data->led_cdev_name, sizeof(led_data->led_cdev_name), -- "mlxreg:%s", data->label); -+ -+ /* -+ * Id greater than zero is used for LEDs located on replaceable unit, -+ * like line card or fabric card. In this case Id is set to I2C bus -+ * number. Otherwise LEDs located on the main board. The field "identity" -+ * specifies the type of bus connecting line card to the chassis. -+ */ -+ if (priv->pdev->id > 0) -+ sprintf(led_data->led_cdev_name, "%scard%d:%s", led_pdata->identity, -+ priv->pdev->id, data->label); -+ else -+ sprintf(led_data->led_cdev_name, "%s:%s", "mlxreg", -+ data->label); - led_cdev->name = led_data->led_cdev_name; - led_cdev->brightness = brightness; - led_cdev->max_brightness = LED_ON; --- -2.14.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0098-1-Revert-mlxsw-Use-u16-for-local_port-field.patch b/platform/mellanox/non-upstream-patches/patches/0098-1-Revert-mlxsw-Use-u16-for-local_port-field.patch deleted file mode 100644 index 9d8488161fd1..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0098-1-Revert-mlxsw-Use-u16-for-local_port-field.patch +++ /dev/null @@ -1,771 +0,0 @@ -From 3a6322534307154e067d0596f52f287ecd0f599e Mon Sep 17 00:00:00 2001 -From: Ciju Rajan K -Date: Thu, 17 Aug 2023 10:00:25 +0000 -Subject: Revert "mlxsw: Use u16 for local_port field instead of u8" - -This reverts commit 0639995c2017338c563db36f631e94d19ae45c74. ---- - drivers/net/ethernet/mellanox/mlxsw/core.c | 32 ++++---- - drivers/net/ethernet/mellanox/mlxsw/core.h | 34 ++++----- - drivers/net/ethernet/mellanox/mlxsw/minimal.c | 6 +- - drivers/net/ethernet/mellanox/mlxsw/reg.h | 106 +++++++++++++------------- - 4 files changed, 89 insertions(+), 89 deletions(-) - -diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c -index 631c19222fc4..7938bad70e37 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/core.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/core.c -@@ -47,7 +47,7 @@ static struct workqueue_struct *mlxsw_owq; - struct mlxsw_core_port { - struct devlink_port devlink_port; - void *port_driver_priv; -- u16 local_port; -+ u8 local_port; - }; - - void *mlxsw_core_port_driver_priv(struct mlxsw_core_port *mlxsw_core_port) -@@ -669,7 +669,7 @@ static void mlxsw_emad_process_response(struct mlxsw_core *mlxsw_core, - } - - /* called with rcu read lock held */ --static void mlxsw_emad_rx_listener_func(struct sk_buff *skb, u16 local_port, -+static void mlxsw_emad_rx_listener_func(struct sk_buff *skb, u8 local_port, - void *priv) - { - struct mlxsw_core *mlxsw_core = priv; -@@ -2094,7 +2094,7 @@ int mlxsw_core_skb_transmit(struct mlxsw_core *mlxsw_core, struct sk_buff *skb, - EXPORT_SYMBOL(mlxsw_core_skb_transmit); - - void mlxsw_core_ptp_transmitted(struct mlxsw_core *mlxsw_core, -- struct sk_buff *skb, u16 local_port) -+ struct sk_buff *skb, u8 local_port) - { - if (mlxsw_core->driver->ptp_transmitted) - mlxsw_core->driver->ptp_transmitted(mlxsw_core, skb, -@@ -2172,7 +2172,7 @@ mlxsw_core_rx_listener_state_set(struct mlxsw_core *mlxsw_core, - rxl_item->enabled = enabled; - } - --static void mlxsw_core_event_listener_func(struct sk_buff *skb, u16 local_port, -+static void mlxsw_core_event_listener_func(struct sk_buff *skb, u8 local_port, - void *priv) - { - struct mlxsw_event_listener_item *event_listener_item = priv; -@@ -2599,7 +2599,7 @@ void mlxsw_core_skb_receive(struct mlxsw_core *mlxsw_core, struct sk_buff *skb, - { - struct mlxsw_rx_listener_item *rxl_item; - const struct mlxsw_rx_listener *rxl; -- u16 local_port; -+ u8 local_port; - bool found = false; - - if (rx_info->is_lag) { -@@ -2657,7 +2657,7 @@ static int mlxsw_core_lag_mapping_index(struct mlxsw_core *mlxsw_core, - } - - void mlxsw_core_lag_mapping_set(struct mlxsw_core *mlxsw_core, -- u16 lag_id, u8 port_index, u16 local_port) -+ u16 lag_id, u8 port_index, u8 local_port) - { - int index = mlxsw_core_lag_mapping_index(mlxsw_core, - lag_id, port_index); -@@ -2677,7 +2677,7 @@ u8 mlxsw_core_lag_mapping_get(struct mlxsw_core *mlxsw_core, - EXPORT_SYMBOL(mlxsw_core_lag_mapping_get); - - void mlxsw_core_lag_mapping_clear(struct mlxsw_core *mlxsw_core, -- u16 lag_id, u16 local_port) -+ u16 lag_id, u8 local_port) - { - int i; - -@@ -2705,7 +2705,7 @@ u64 mlxsw_core_res_get(struct mlxsw_core *mlxsw_core, - } - EXPORT_SYMBOL(mlxsw_core_res_get); - --static int __mlxsw_core_port_init(struct mlxsw_core *mlxsw_core, u16 local_port, -+static int __mlxsw_core_port_init(struct mlxsw_core *mlxsw_core, u8 local_port, - enum devlink_port_flavour flavour, - u32 port_number, bool split, - u32 split_port_subnumber, -@@ -2736,7 +2736,7 @@ static int __mlxsw_core_port_init(struct mlxsw_core *mlxsw_core, u16 local_port, - return err; - } - --static void __mlxsw_core_port_fini(struct mlxsw_core *mlxsw_core, u16 local_port) -+static void __mlxsw_core_port_fini(struct mlxsw_core *mlxsw_core, u8 local_port) - { - struct mlxsw_core_port *mlxsw_core_port = - &mlxsw_core->ports[local_port]; -@@ -2746,7 +2746,7 @@ static void __mlxsw_core_port_fini(struct mlxsw_core *mlxsw_core, u16 local_port - memset(mlxsw_core_port, 0, sizeof(*mlxsw_core_port)); - } - --int mlxsw_core_port_init(struct mlxsw_core *mlxsw_core, u16 local_port, -+int mlxsw_core_port_init(struct mlxsw_core *mlxsw_core, u8 local_port, - u32 port_number, bool split, - u32 split_port_subnumber, - bool splittable, u32 lanes, -@@ -2761,7 +2761,7 @@ int mlxsw_core_port_init(struct mlxsw_core *mlxsw_core, u16 local_port, - } - EXPORT_SYMBOL(mlxsw_core_port_init); - --void mlxsw_core_port_fini(struct mlxsw_core *mlxsw_core, u16 local_port) -+void mlxsw_core_port_fini(struct mlxsw_core *mlxsw_core, u8 local_port) - { - __mlxsw_core_port_fini(mlxsw_core, local_port); - } -@@ -2794,7 +2794,7 @@ void mlxsw_core_cpu_port_fini(struct mlxsw_core *mlxsw_core) - } - EXPORT_SYMBOL(mlxsw_core_cpu_port_fini); - --void mlxsw_core_port_eth_set(struct mlxsw_core *mlxsw_core, u16 local_port, -+void mlxsw_core_port_eth_set(struct mlxsw_core *mlxsw_core, u8 local_port, - void *port_driver_priv, struct net_device *dev) - { - struct mlxsw_core_port *mlxsw_core_port = -@@ -2806,7 +2806,7 @@ void mlxsw_core_port_eth_set(struct mlxsw_core *mlxsw_core, u16 local_port, - } - EXPORT_SYMBOL(mlxsw_core_port_eth_set); - --void mlxsw_core_port_ib_set(struct mlxsw_core *mlxsw_core, u16 local_port, -+void mlxsw_core_port_ib_set(struct mlxsw_core *mlxsw_core, u8 local_port, - void *port_driver_priv) - { - struct mlxsw_core_port *mlxsw_core_port = -@@ -2818,7 +2818,7 @@ void mlxsw_core_port_ib_set(struct mlxsw_core *mlxsw_core, u16 local_port, - } - EXPORT_SYMBOL(mlxsw_core_port_ib_set); - --void mlxsw_core_port_clear(struct mlxsw_core *mlxsw_core, u16 local_port, -+void mlxsw_core_port_clear(struct mlxsw_core *mlxsw_core, u8 local_port, - void *port_driver_priv) - { - struct mlxsw_core_port *mlxsw_core_port = -@@ -2831,7 +2831,7 @@ void mlxsw_core_port_clear(struct mlxsw_core *mlxsw_core, u16 local_port, - EXPORT_SYMBOL(mlxsw_core_port_clear); - - enum devlink_port_type mlxsw_core_port_type_get(struct mlxsw_core *mlxsw_core, -- u16 local_port) -+ u8 local_port) - { - struct mlxsw_core_port *mlxsw_core_port = - &mlxsw_core->ports[local_port]; -@@ -2844,7 +2844,7 @@ EXPORT_SYMBOL(mlxsw_core_port_type_get); - - struct devlink_port * - mlxsw_core_port_devlink_port_get(struct mlxsw_core *mlxsw_core, -- u16 local_port) -+ u8 local_port) - { - struct mlxsw_core_port *mlxsw_core_port = - &mlxsw_core->ports[local_port]; -diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.h b/drivers/net/ethernet/mellanox/mlxsw/core.h -index 1fc783174292..56efb8e48022 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/core.h -+++ b/drivers/net/ethernet/mellanox/mlxsw/core.h -@@ -49,7 +49,7 @@ int mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info, - void mlxsw_core_bus_device_unregister(struct mlxsw_core *mlxsw_core, bool reload); - - struct mlxsw_tx_info { -- u16 local_port; -+ u8 local_port; - bool is_emad; - }; - -@@ -58,11 +58,11 @@ bool mlxsw_core_skb_transmit_busy(struct mlxsw_core *mlxsw_core, - int mlxsw_core_skb_transmit(struct mlxsw_core *mlxsw_core, struct sk_buff *skb, - const struct mlxsw_tx_info *tx_info); - void mlxsw_core_ptp_transmitted(struct mlxsw_core *mlxsw_core, -- struct sk_buff *skb, u16 local_port); -+ struct sk_buff *skb, u8 local_port); - - struct mlxsw_rx_listener { -- void (*func)(struct sk_buff *skb, u16 local_port, void *priv); -- u16 local_port; -+ void (*func)(struct sk_buff *skb, u8 local_port, void *priv); -+ u8 local_port; - u8 mirror_reason; - u16 trap_id; - }; -@@ -194,35 +194,35 @@ void mlxsw_core_skb_receive(struct mlxsw_core *mlxsw_core, struct sk_buff *skb, - struct mlxsw_rx_info *rx_info); - - void mlxsw_core_lag_mapping_set(struct mlxsw_core *mlxsw_core, -- u16 lag_id, u8 port_index, u16 local_port); -+ u16 lag_id, u8 port_index, u8 local_port); - u8 mlxsw_core_lag_mapping_get(struct mlxsw_core *mlxsw_core, - u16 lag_id, u8 port_index); - void mlxsw_core_lag_mapping_clear(struct mlxsw_core *mlxsw_core, -- u16 lag_id, u16 local_port); -+ u16 lag_id, u8 local_port); - - void *mlxsw_core_port_driver_priv(struct mlxsw_core_port *mlxsw_core_port); --int mlxsw_core_port_init(struct mlxsw_core *mlxsw_core, u16 local_port, -+int mlxsw_core_port_init(struct mlxsw_core *mlxsw_core, u8 local_port, - u32 port_number, bool split, u32 split_port_subnumber, - bool splittable, u32 lanes, - const unsigned char *switch_id, - unsigned char switch_id_len); --void mlxsw_core_port_fini(struct mlxsw_core *mlxsw_core, u16 local_port); -+void mlxsw_core_port_fini(struct mlxsw_core *mlxsw_core, u8 local_port); - int mlxsw_core_cpu_port_init(struct mlxsw_core *mlxsw_core, - void *port_driver_priv, - const unsigned char *switch_id, - unsigned char switch_id_len); - void mlxsw_core_cpu_port_fini(struct mlxsw_core *mlxsw_core); --void mlxsw_core_port_eth_set(struct mlxsw_core *mlxsw_core, u16 local_port, -+void mlxsw_core_port_eth_set(struct mlxsw_core *mlxsw_core, u8 local_port, - void *port_driver_priv, struct net_device *dev); --void mlxsw_core_port_ib_set(struct mlxsw_core *mlxsw_core, u16 local_port, -+void mlxsw_core_port_ib_set(struct mlxsw_core *mlxsw_core, u8 local_port, - void *port_driver_priv); --void mlxsw_core_port_clear(struct mlxsw_core *mlxsw_core, u16 local_port, -+void mlxsw_core_port_clear(struct mlxsw_core *mlxsw_core, u8 local_port, - void *port_driver_priv); - enum devlink_port_type mlxsw_core_port_type_get(struct mlxsw_core *mlxsw_core, -- u16 local_port); -+ u8 local_port); - struct devlink_port * - mlxsw_core_port_devlink_port_get(struct mlxsw_core *mlxsw_core, -- u16 local_port); -+ u8 local_port); - 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); - -@@ -290,11 +290,11 @@ struct mlxsw_driver { - struct netlink_ext_ack *extack); - void (*fini)(struct mlxsw_core *mlxsw_core); - int (*basic_trap_groups_set)(struct mlxsw_core *mlxsw_core); -- int (*port_type_set)(struct mlxsw_core *mlxsw_core, u16 local_port, -+ int (*port_type_set)(struct mlxsw_core *mlxsw_core, u8 local_port, - enum devlink_port_type new_type); -- int (*port_split)(struct mlxsw_core *mlxsw_core, u16 local_port, -+ int (*port_split)(struct mlxsw_core *mlxsw_core, u8 local_port, - unsigned int count, struct netlink_ext_ack *extack); -- int (*port_unsplit)(struct mlxsw_core *mlxsw_core, u16 local_port, -+ int (*port_unsplit)(struct mlxsw_core *mlxsw_core, u8 local_port, - struct netlink_ext_ack *extack); - int (*sb_pool_get)(struct mlxsw_core *mlxsw_core, - unsigned int sb_index, u16 pool_index, -@@ -368,7 +368,7 @@ struct mlxsw_driver { - * is responsible for freeing the passed-in SKB. - */ - void (*ptp_transmitted)(struct mlxsw_core *mlxsw_core, -- struct sk_buff *skb, u16 local_port); -+ struct sk_buff *skb, u8 local_port); - - u8 txhdr_len; - const struct mlxsw_config_profile *profile; -diff --git a/drivers/net/ethernet/mellanox/mlxsw/minimal.c b/drivers/net/ethernet/mellanox/mlxsw/minimal.c -index 1ddd11320b99..3d07c2dcf08d 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/minimal.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/minimal.c -@@ -38,7 +38,7 @@ struct mlxsw_m { - struct mlxsw_m_port { - struct net_device *dev; - struct mlxsw_m *mlxsw_m; -- u16 local_port; -+ u8 local_port; - u8 module; - }; - -@@ -201,7 +201,7 @@ mlxsw_m_port_dev_addr_get(struct mlxsw_m_port *mlxsw_m_port) - } - - static int --mlxsw_m_port_create(struct mlxsw_m *mlxsw_m, u16 local_port, u8 module) -+mlxsw_m_port_create(struct mlxsw_m *mlxsw_m, u8 local_port, u8 module) - { - struct mlxsw_m_port *mlxsw_m_port; - struct net_device *dev; -@@ -264,7 +264,7 @@ mlxsw_m_port_create(struct mlxsw_m *mlxsw_m, u16 local_port, u8 module) - return err; - } - --static void mlxsw_m_port_remove(struct mlxsw_m *mlxsw_m, u16 local_port) -+static void mlxsw_m_port_remove(struct mlxsw_m *mlxsw_m, u8 local_port) - { - struct mlxsw_m_port *mlxsw_m_port = mlxsw_m->ports[local_port]; - -diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h -index 2ec9ec6078e2..a9119451d999 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/reg.h -+++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h -@@ -161,7 +161,7 @@ MLXSW_ITEM32(reg, sspr, sub_port, 0x00, 8, 8); - */ - MLXSW_ITEM32(reg, sspr, system_port, 0x04, 0, 16); - --static inline void mlxsw_reg_sspr_pack(char *payload, u16 local_port) -+static inline void mlxsw_reg_sspr_pack(char *payload, u8 local_port) - { - MLXSW_REG_ZERO(sspr, payload); - mlxsw_reg_sspr_m_set(payload, 1); -@@ -407,7 +407,7 @@ static inline void mlxsw_reg_sfd_uc_pack(char *payload, int rec_index, - enum mlxsw_reg_sfd_rec_policy policy, - const char *mac, u16 fid_vid, - enum mlxsw_reg_sfd_rec_action action, -- u16 local_port) -+ u8 local_port) - { - mlxsw_reg_sfd_rec_pack(payload, rec_index, - MLXSW_REG_SFD_REC_TYPE_UNICAST, mac, action); -@@ -419,7 +419,7 @@ static inline void mlxsw_reg_sfd_uc_pack(char *payload, int rec_index, - - static inline void mlxsw_reg_sfd_uc_unpack(char *payload, int rec_index, - char *mac, u16 *p_fid_vid, -- u16 *p_local_port) -+ u8 *p_local_port) - { - mlxsw_reg_sfd_rec_mac_memcpy_from(payload, rec_index, mac); - *p_fid_vid = mlxsw_reg_sfd_uc_fid_vid_get(payload, rec_index); -@@ -685,7 +685,7 @@ MLXSW_ITEM32_INDEXED(reg, sfn, mac_system_port, MLXSW_REG_SFN_BASE_LEN, 0, 16, - - static inline void mlxsw_reg_sfn_mac_unpack(char *payload, int rec_index, - char *mac, u16 *p_vid, -- u16 *p_local_port) -+ u8 *p_local_port) - { - mlxsw_reg_sfn_rec_mac_memcpy_from(payload, rec_index, mac); - *p_vid = mlxsw_reg_sfn_mac_fid_get(payload, rec_index); -@@ -800,7 +800,7 @@ enum mlxsw_reg_spms_state { - */ - MLXSW_ITEM_BIT_ARRAY(reg, spms, state, 0x04, 0x400, 2); - --static inline void mlxsw_reg_spms_pack(char *payload, u16 local_port) -+static inline void mlxsw_reg_spms_pack(char *payload, u8 local_port) - { - MLXSW_REG_ZERO(spms, payload); - mlxsw_reg_spms_local_port_set(payload, local_port); -@@ -840,7 +840,7 @@ MLXSW_ITEM32(reg, spvid, sub_port, 0x00, 8, 8); - */ - MLXSW_ITEM32(reg, spvid, pvid, 0x04, 0, 12); - --static inline void mlxsw_reg_spvid_pack(char *payload, u16 local_port, u16 pvid) -+static inline void mlxsw_reg_spvid_pack(char *payload, u8 local_port, u16 pvid) - { - MLXSW_REG_ZERO(spvid, payload); - mlxsw_reg_spvid_local_port_set(payload, local_port); -@@ -929,7 +929,7 @@ MLXSW_ITEM32_INDEXED(reg, spvm, rec_vid, - MLXSW_REG_SPVM_BASE_LEN, 0, 12, - MLXSW_REG_SPVM_REC_LEN, 0, false); - --static inline void mlxsw_reg_spvm_pack(char *payload, u16 local_port, -+static inline void mlxsw_reg_spvm_pack(char *payload, u8 local_port, - u16 vid_begin, u16 vid_end, - bool is_member, bool untagged) - { -@@ -991,7 +991,7 @@ MLXSW_ITEM32(reg, spaft, allow_prio_tagged, 0x04, 30, 1); - */ - MLXSW_ITEM32(reg, spaft, allow_tagged, 0x04, 29, 1); - --static inline void mlxsw_reg_spaft_pack(char *payload, u16 local_port, -+static inline void mlxsw_reg_spaft_pack(char *payload, u8 local_port, - bool allow_untagged) - { - MLXSW_REG_ZERO(spaft, payload); -@@ -1317,7 +1317,7 @@ MLXSW_ITEM32(reg, sldr, num_ports, 0x04, 24, 8); - MLXSW_ITEM32_INDEXED(reg, sldr, system_port, 0x08, 0, 16, 4, 0, false); - - static inline void mlxsw_reg_sldr_lag_add_port_pack(char *payload, u8 lag_id, -- u16 local_port) -+ u8 local_port) - { - MLXSW_REG_ZERO(sldr, payload); - mlxsw_reg_sldr_op_set(payload, MLXSW_REG_SLDR_OP_LAG_ADD_PORT_LIST); -@@ -1327,7 +1327,7 @@ static inline void mlxsw_reg_sldr_lag_add_port_pack(char *payload, u8 lag_id, - } - - static inline void mlxsw_reg_sldr_lag_remove_port_pack(char *payload, u8 lag_id, -- u16 local_port) -+ u8 local_port) - { - MLXSW_REG_ZERO(sldr, payload); - mlxsw_reg_sldr_op_set(payload, MLXSW_REG_SLDR_OP_LAG_REMOVE_PORT_LIST); -@@ -1501,7 +1501,7 @@ MLXSW_ITEM32(reg, slcor, lag_id, 0x00, 0, 10); - MLXSW_ITEM32(reg, slcor, port_index, 0x04, 0, 10); - - static inline void mlxsw_reg_slcor_pack(char *payload, -- u16 local_port, u16 lag_id, -+ u8 local_port, u16 lag_id, - enum mlxsw_reg_slcor_col col) - { - MLXSW_REG_ZERO(slcor, payload); -@@ -1511,7 +1511,7 @@ static inline void mlxsw_reg_slcor_pack(char *payload, - } - - static inline void mlxsw_reg_slcor_port_add_pack(char *payload, -- u16 local_port, u16 lag_id, -+ u8 local_port, u16 lag_id, - u8 port_index) - { - mlxsw_reg_slcor_pack(payload, local_port, lag_id, -@@ -1520,21 +1520,21 @@ static inline void mlxsw_reg_slcor_port_add_pack(char *payload, - } - - static inline void mlxsw_reg_slcor_port_remove_pack(char *payload, -- u16 local_port, u16 lag_id) -+ u8 local_port, u16 lag_id) - { - mlxsw_reg_slcor_pack(payload, local_port, lag_id, - MLXSW_REG_SLCOR_COL_LAG_REMOVE_PORT); - } - - static inline void mlxsw_reg_slcor_col_enable_pack(char *payload, -- u16 local_port, u16 lag_id) -+ u8 local_port, u16 lag_id) - { - mlxsw_reg_slcor_pack(payload, local_port, lag_id, - MLXSW_REG_SLCOR_COL_LAG_COLLECTOR_ENABLED); - } - - static inline void mlxsw_reg_slcor_col_disable_pack(char *payload, -- u16 local_port, u16 lag_id) -+ u8 local_port, u16 lag_id) - { - mlxsw_reg_slcor_pack(payload, local_port, lag_id, - MLXSW_REG_SLCOR_COL_LAG_COLLECTOR_ENABLED); -@@ -1581,7 +1581,7 @@ enum mlxsw_reg_spmlr_learn_mode { - */ - MLXSW_ITEM32(reg, spmlr, learn_mode, 0x04, 30, 2); - --static inline void mlxsw_reg_spmlr_pack(char *payload, u16 local_port, -+static inline void mlxsw_reg_spmlr_pack(char *payload, u8 local_port, - enum mlxsw_reg_spmlr_learn_mode mode) - { - MLXSW_REG_ZERO(spmlr, payload); -@@ -1666,7 +1666,7 @@ MLXSW_ITEM32(reg, svfa, counter_set_type, 0x08, 24, 8); - */ - MLXSW_ITEM32(reg, svfa, counter_index, 0x08, 0, 24); - --static inline void mlxsw_reg_svfa_pack(char *payload, u16 local_port, -+static inline void mlxsw_reg_svfa_pack(char *payload, u8 local_port, - enum mlxsw_reg_svfa_mt mt, bool valid, - u16 fid, u16 vid) - { -@@ -1705,7 +1705,7 @@ MLXSW_ITEM32(reg, svpe, local_port, 0x00, 16, 8); - */ - MLXSW_ITEM32(reg, svpe, vp_en, 0x00, 8, 1); - --static inline void mlxsw_reg_svpe_pack(char *payload, u16 local_port, -+static inline void mlxsw_reg_svpe_pack(char *payload, u8 local_port, - bool enable) - { - MLXSW_REG_ZERO(svpe, payload); -@@ -1838,7 +1838,7 @@ MLXSW_ITEM32_INDEXED(reg, spvmlr, rec_learn_enable, MLXSW_REG_SPVMLR_BASE_LEN, - MLXSW_ITEM32_INDEXED(reg, spvmlr, rec_vid, MLXSW_REG_SPVMLR_BASE_LEN, 0, 12, - MLXSW_REG_SPVMLR_REC_LEN, 0x00, false); - --static inline void mlxsw_reg_spvmlr_pack(char *payload, u16 local_port, -+static inline void mlxsw_reg_spvmlr_pack(char *payload, u8 local_port, - u16 vid_begin, u16 vid_end, - bool learn_enable) - { -@@ -1907,7 +1907,7 @@ MLXSW_ITEM32_INDEXED(reg, cwtp, profile_max, MLXSW_REG_CWTP_BASE_LEN, - #define MLXSW_REG_CWTP_MAX_PROFILE 2 - #define MLXSW_REG_CWTP_DEFAULT_PROFILE 1 - --static inline void mlxsw_reg_cwtp_pack(char *payload, u16 local_port, -+static inline void mlxsw_reg_cwtp_pack(char *payload, u8 local_port, - u8 traffic_class) - { - int i; -@@ -2025,7 +2025,7 @@ MLXSW_ITEM32(reg, cwtpm, ntcp_r, 64, 0, 2); - - #define MLXSW_REG_CWTPM_RESET_PROFILE 0 - --static inline void mlxsw_reg_cwtpm_pack(char *payload, u16 local_port, -+static inline void mlxsw_reg_cwtpm_pack(char *payload, u8 local_port, - u8 traffic_class, u8 profile, - bool wred, bool ecn) - { -@@ -2116,7 +2116,7 @@ MLXSW_ITEM32(reg, ppbt, acl_info, 0x10, 0, 16); - - static inline void mlxsw_reg_ppbt_pack(char *payload, enum mlxsw_reg_pxbt_e e, - enum mlxsw_reg_pxbt_op op, -- u16 local_port, u16 acl_info) -+ u8 local_port, u16 acl_info) - { - MLXSW_REG_ZERO(ppbt, payload); - mlxsw_reg_ppbt_e_set(payload, e); -@@ -3260,7 +3260,7 @@ enum mlxsw_reg_qpts_trust_state { - */ - MLXSW_ITEM32(reg, qpts, trust_state, 0x04, 0, 3); - --static inline void mlxsw_reg_qpts_pack(char *payload, u16 local_port, -+static inline void mlxsw_reg_qpts_pack(char *payload, u8 local_port, - enum mlxsw_reg_qpts_trust_state ts) - { - MLXSW_REG_ZERO(qpts, payload); -@@ -3476,7 +3476,7 @@ MLXSW_ITEM32(reg, qtct, switch_prio, 0x00, 0, 4); - */ - MLXSW_ITEM32(reg, qtct, tclass, 0x04, 0, 4); - --static inline void mlxsw_reg_qtct_pack(char *payload, u16 local_port, -+static inline void mlxsw_reg_qtct_pack(char *payload, u8 local_port, - u8 switch_prio, u8 tclass) - { - MLXSW_REG_ZERO(qtct, payload); -@@ -3643,7 +3643,7 @@ MLXSW_ITEM32(reg, qeec, max_shaper_bs, 0x1C, 0, 6); - #define MLXSW_REG_QEEC_LOWEST_SHAPER_BS_SP2 11 - #define MLXSW_REG_QEEC_LOWEST_SHAPER_BS_SP3 11 - --static inline void mlxsw_reg_qeec_pack(char *payload, u16 local_port, -+static inline void mlxsw_reg_qeec_pack(char *payload, u8 local_port, - enum mlxsw_reg_qeec_hr hr, u8 index, - u8 next_index) - { -@@ -3654,7 +3654,7 @@ static inline void mlxsw_reg_qeec_pack(char *payload, u16 local_port, - mlxsw_reg_qeec_next_element_index_set(payload, next_index); - } - --static inline void mlxsw_reg_qeec_ptps_pack(char *payload, u16 local_port, -+static inline void mlxsw_reg_qeec_ptps_pack(char *payload, u8 local_port, - bool ptps) - { - MLXSW_REG_ZERO(qeec, payload); -@@ -3692,7 +3692,7 @@ MLXSW_ITEM32(reg, qrwe, dscp, 0x04, 1, 1); - */ - MLXSW_ITEM32(reg, qrwe, pcp, 0x04, 0, 1); - --static inline void mlxsw_reg_qrwe_pack(char *payload, u16 local_port, -+static inline void mlxsw_reg_qrwe_pack(char *payload, u8 local_port, - bool rewrite_pcp, bool rewrite_dscp) - { - MLXSW_REG_ZERO(qrwe, payload); -@@ -3772,7 +3772,7 @@ MLXSW_ITEM32_INDEXED(reg, qpdsm, prio_entry_color2_dscp, - MLXSW_REG_QPDSM_BASE_LEN, 8, 6, - MLXSW_REG_QPDSM_PRIO_ENTRY_REC_LEN, 0x00, false); - --static inline void mlxsw_reg_qpdsm_pack(char *payload, u16 local_port) -+static inline void mlxsw_reg_qpdsm_pack(char *payload, u8 local_port) - { - MLXSW_REG_ZERO(qpdsm, payload); - mlxsw_reg_qpdsm_local_port_set(payload, local_port); -@@ -3813,7 +3813,7 @@ MLXSW_ITEM32(reg, qpdp, local_port, 0x00, 16, 8); - */ - MLXSW_ITEM32(reg, qpdp, switch_prio, 0x04, 0, 4); - --static inline void mlxsw_reg_qpdp_pack(char *payload, u16 local_port, -+static inline void mlxsw_reg_qpdp_pack(char *payload, u8 local_port, - u8 switch_prio) - { - MLXSW_REG_ZERO(qpdp, payload); -@@ -3859,7 +3859,7 @@ MLXSW_ITEM16_INDEXED(reg, qpdpm, dscp_entry_prio, - MLXSW_REG_QPDPM_BASE_LEN, 0, 4, - MLXSW_REG_QPDPM_DSCP_ENTRY_REC_LEN, 0x00, false); - --static inline void mlxsw_reg_qpdpm_pack(char *payload, u16 local_port) -+static inline void mlxsw_reg_qpdpm_pack(char *payload, u8 local_port) - { - MLXSW_REG_ZERO(qpdpm, payload); - mlxsw_reg_qpdpm_local_port_set(payload, local_port); -@@ -3901,7 +3901,7 @@ MLXSW_ITEM32(reg, qtctm, local_port, 0x00, 16, 8); - MLXSW_ITEM32(reg, qtctm, mc, 0x04, 0, 1); - - static inline void --mlxsw_reg_qtctm_pack(char *payload, u16 local_port, bool mc) -+mlxsw_reg_qtctm_pack(char *payload, u8 local_port, bool mc) - { - MLXSW_REG_ZERO(qtctm, payload); - mlxsw_reg_qtctm_local_port_set(payload, local_port); -@@ -4065,7 +4065,7 @@ MLXSW_ITEM32_INDEXED(reg, pmlp, tx_lane, 0x04, 16, 4, 0x04, 0x00, false); - */ - MLXSW_ITEM32_INDEXED(reg, pmlp, rx_lane, 0x04, 24, 4, 0x04, 0x00, false); - --static inline void mlxsw_reg_pmlp_pack(char *payload, u16 local_port) -+static inline void mlxsw_reg_pmlp_pack(char *payload, u8 local_port) - { - MLXSW_REG_ZERO(pmlp, payload); - mlxsw_reg_pmlp_local_port_set(payload, local_port); -@@ -4112,7 +4112,7 @@ MLXSW_ITEM32(reg, pmtu, admin_mtu, 0x08, 16, 16); - */ - MLXSW_ITEM32(reg, pmtu, oper_mtu, 0x0C, 16, 16); - --static inline void mlxsw_reg_pmtu_pack(char *payload, u16 local_port, -+static inline void mlxsw_reg_pmtu_pack(char *payload, u8 local_port, - u16 new_mtu) - { - MLXSW_REG_ZERO(pmtu, payload); -@@ -4306,7 +4306,7 @@ enum mlxsw_reg_ptys_connector_type { - */ - MLXSW_ITEM32(reg, ptys, connector_type, 0x2C, 0, 4); - --static inline void mlxsw_reg_ptys_eth_pack(char *payload, u16 local_port, -+static inline void mlxsw_reg_ptys_eth_pack(char *payload, u8 local_port, - u32 proto_admin, bool autoneg) - { - MLXSW_REG_ZERO(ptys, payload); -@@ -4316,7 +4316,7 @@ static inline void mlxsw_reg_ptys_eth_pack(char *payload, u16 local_port, - mlxsw_reg_ptys_an_disable_admin_set(payload, !autoneg); - } - --static inline void mlxsw_reg_ptys_ext_eth_pack(char *payload, u16 local_port, -+static inline void mlxsw_reg_ptys_ext_eth_pack(char *payload, u8 local_port, - u32 proto_admin, bool autoneg) - { - MLXSW_REG_ZERO(ptys, payload); -@@ -4358,7 +4358,7 @@ static inline void mlxsw_reg_ptys_ext_eth_unpack(char *payload, - mlxsw_reg_ptys_ext_eth_proto_oper_get(payload); - } - --static inline void mlxsw_reg_ptys_ib_pack(char *payload, u16 local_port, -+static inline void mlxsw_reg_ptys_ib_pack(char *payload, u8 local_port, - u16 proto_admin, u16 link_width) - { - MLXSW_REG_ZERO(ptys, payload); -@@ -4416,7 +4416,7 @@ MLXSW_ITEM32(reg, ppad, local_port, 0x00, 16, 8); - MLXSW_ITEM_BUF(reg, ppad, mac, 0x02, 6); - - static inline void mlxsw_reg_ppad_pack(char *payload, bool single_base_mac, -- u16 local_port) -+ u8 local_port) - { - MLXSW_REG_ZERO(ppad, payload); - mlxsw_reg_ppad_single_base_mac_set(payload, !!single_base_mac); -@@ -4490,7 +4490,7 @@ MLXSW_ITEM32(reg, paos, ee, 0x04, 30, 1); - */ - MLXSW_ITEM32(reg, paos, e, 0x04, 0, 2); - --static inline void mlxsw_reg_paos_pack(char *payload, u16 local_port, -+static inline void mlxsw_reg_paos_pack(char *payload, u8 local_port, - enum mlxsw_port_admin_status status) - { - MLXSW_REG_ZERO(paos, payload); -@@ -4633,7 +4633,7 @@ static inline void mlxsw_reg_pfcc_prio_pack(char *payload, u8 pfc_en) - mlxsw_reg_pfcc_pfcrx_set(payload, pfc_en); - } - --static inline void mlxsw_reg_pfcc_pack(char *payload, u16 local_port) -+static inline void mlxsw_reg_pfcc_pack(char *payload, u8 local_port) - { - MLXSW_REG_ZERO(pfcc, payload); - mlxsw_reg_pfcc_local_port_set(payload, local_port); -@@ -5132,7 +5132,7 @@ MLXSW_ITEM64(reg, ppcnt, tc_no_buffer_discard_uc, - MLXSW_ITEM64(reg, ppcnt, wred_discard, - MLXSW_REG_PPCNT_COUNTERS_OFFSET + 0x00, 0, 64); - --static inline void mlxsw_reg_ppcnt_pack(char *payload, u16 local_port, -+static inline void mlxsw_reg_ppcnt_pack(char *payload, u8 local_port, - enum mlxsw_reg_ppcnt_grp grp, - u8 prio_tc) - { -@@ -5243,7 +5243,7 @@ MLXSW_ITEM_BIT_ARRAY(reg, pptb, prio_to_buff_msb, 0x0C, 0x04, 4); - - #define MLXSW_REG_PPTB_ALL_PRIO 0xFF - --static inline void mlxsw_reg_pptb_pack(char *payload, u16 local_port) -+static inline void mlxsw_reg_pptb_pack(char *payload, u8 local_port) - { - MLXSW_REG_ZERO(pptb, payload); - mlxsw_reg_pptb_mm_set(payload, MLXSW_REG_PPTB_MM_UM); -@@ -5340,7 +5340,7 @@ MLXSW_ITEM32_INDEXED(reg, pbmc, buf_xoff_threshold, 0x0C, 16, 16, - MLXSW_ITEM32_INDEXED(reg, pbmc, buf_xon_threshold, 0x0C, 0, 16, - 0x08, 0x04, false); - --static inline void mlxsw_reg_pbmc_pack(char *payload, u16 local_port, -+static inline void mlxsw_reg_pbmc_pack(char *payload, u8 local_port, - u16 xoff_timer_value, u16 xoff_refresh) - { - MLXSW_REG_ZERO(pbmc, payload); -@@ -5398,7 +5398,7 @@ MLXSW_ITEM32(reg, pspa, local_port, 0x00, 16, 8); - */ - MLXSW_ITEM32(reg, pspa, sub_port, 0x00, 8, 8); - --static inline void mlxsw_reg_pspa_pack(char *payload, u8 swid, u16 local_port) -+static inline void mlxsw_reg_pspa_pack(char *payload, u8 swid, u8 local_port) - { - MLXSW_REG_ZERO(pspa, payload); - mlxsw_reg_pspa_swid_set(payload, swid); -@@ -5513,7 +5513,7 @@ MLXSW_ITEM32(reg, pplr, local_port, 0x00, 16, 8); - */ - MLXSW_ITEM32(reg, pplr, lb_en, 0x04, 0, 8); - --static inline void mlxsw_reg_pplr_pack(char *payload, u16 local_port, -+static inline void mlxsw_reg_pplr_pack(char *payload, u8 local_port, - bool phy_local) - { - MLXSW_REG_ZERO(pplr, payload); -@@ -5609,7 +5609,7 @@ MLXSW_ITEM32(reg, pddr, trblsh_group_opcode, 0x08, 0, 16); - */ - MLXSW_ITEM32(reg, pddr, trblsh_status_opcode, 0x0C, 0, 16); - --static inline void mlxsw_reg_pddr_pack(char *payload, u16 local_port, -+static inline void mlxsw_reg_pddr_pack(char *payload, u8 local_port, - u8 page_select) - { - MLXSW_REG_ZERO(pddr, payload); -@@ -9160,7 +9160,7 @@ MLXSW_ITEM32(reg, mpar, enable, 0x04, 31, 1); - */ - MLXSW_ITEM32(reg, mpar, pa_id, 0x04, 0, 4); - --static inline void mlxsw_reg_mpar_pack(char *payload, u16 local_port, -+static inline void mlxsw_reg_mpar_pack(char *payload, u8 local_port, - enum mlxsw_reg_mpar_i_e i_e, - bool enable, u8 pa_id) - { -@@ -9281,7 +9281,7 @@ MLXSW_ITEM32(reg, mlcr, beacon_duration, 0x04, 0, 16); - */ - MLXSW_ITEM32(reg, mlcr, beacon_remain, 0x08, 0, 16); - --static inline void mlxsw_reg_mlcr_pack(char *payload, u16 local_port, -+static inline void mlxsw_reg_mlcr_pack(char *payload, u8 local_port, - bool active) - { - MLXSW_REG_ZERO(mlcr, payload); -@@ -9671,7 +9671,7 @@ MLXSW_ITEM32(reg, mpsc, e, 0x04, 30, 1); - */ - MLXSW_ITEM32(reg, mpsc, rate, 0x08, 0, 32); - --static inline void mlxsw_reg_mpsc_pack(char *payload, u16 local_port, bool e, -+static inline void mlxsw_reg_mpsc_pack(char *payload, u8 local_port, bool e, - u32 rate) - { - MLXSW_REG_ZERO(mpsc, payload); -@@ -9904,7 +9904,7 @@ MLXSW_ITEM32(reg, momte, type, 0x04, 0, 8); - */ - MLXSW_ITEM_BIT_ARRAY(reg, momte, tclass_en, 0x08, 0x08, 1); - --static inline void mlxsw_reg_momte_pack(char *payload, u16 local_port, -+static inline void mlxsw_reg_momte_pack(char *payload, u8 local_port, - enum mlxsw_reg_momte_type type) - { - MLXSW_REG_ZERO(momte, payload); -@@ -10574,7 +10574,7 @@ MLXSW_ITEM32(reg, tnqdr, local_port, 0x00, 16, 8); - */ - MLXSW_ITEM32(reg, tnqdr, dscp, 0x04, 0, 6); - --static inline void mlxsw_reg_tnqdr_pack(char *payload, u16 local_port) -+static inline void mlxsw_reg_tnqdr_pack(char *payload, u8 local_port) - { - MLXSW_REG_ZERO(tnqdr, payload); - mlxsw_reg_tnqdr_local_port_set(payload, local_port); -@@ -10963,7 +10963,7 @@ MLXSW_ITEM32(reg, sbcm, max_buff, 0x1C, 0, 24); - */ - MLXSW_ITEM32(reg, sbcm, pool, 0x24, 0, 4); - --static inline void mlxsw_reg_sbcm_pack(char *payload, u16 local_port, u8 pg_buff, -+static inline void mlxsw_reg_sbcm_pack(char *payload, u8 local_port, u8 pg_buff, - enum mlxsw_reg_sbxx_dir dir, - u32 min_buff, u32 max_buff, - bool infi_max, u8 pool) -@@ -11049,7 +11049,7 @@ MLXSW_ITEM32(reg, sbpm, min_buff, 0x18, 0, 24); - */ - MLXSW_ITEM32(reg, sbpm, max_buff, 0x1C, 0, 24); - --static inline void mlxsw_reg_sbpm_pack(char *payload, u16 local_port, u8 pool, -+static inline void mlxsw_reg_sbpm_pack(char *payload, u8 local_port, u8 pool, - enum mlxsw_reg_sbxx_dir dir, bool clr, - u32 min_buff, u32 max_buff) - { -@@ -11244,7 +11244,7 @@ MLXSW_ITEM32(reg, sbib, local_port, 0x00, 16, 8); - */ - MLXSW_ITEM32(reg, sbib, buff_size, 0x08, 0, 24); - --static inline void mlxsw_reg_sbib_pack(char *payload, u16 local_port, -+static inline void mlxsw_reg_sbib_pack(char *payload, u8 local_port, - u32 buff_size) - { - MLXSW_REG_ZERO(sbib, payload); --- -2.14.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0098-2-Revert-mlxsw-i2c-Fix-chunk-size-setting.patch b/platform/mellanox/non-upstream-patches/patches/0098-2-Revert-mlxsw-i2c-Fix-chunk-size-setting.patch deleted file mode 100644 index 513c6962c19d..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0098-2-Revert-mlxsw-i2c-Fix-chunk-size-setting.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 0dda3bcede5f26c2bd44edbd90c7e9f0aab9ccf0 Mon Sep 17 00:00:00 2001 -From: Ciju Rajan K -Date: Thu, 17 Aug 2023 10:00:59 +0000 -Subject: Revert "mlxsw: i2c: Fix chunk size setting in output mailbox buffer" - -This reverts commit ac91378962238d34030bb4035308f88ba173165f. ---- - drivers/net/ethernet/mellanox/mlxsw/i2c.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/net/ethernet/mellanox/mlxsw/i2c.c b/drivers/net/ethernet/mellanox/mlxsw/i2c.c -index cc99ec3f4e96..b8a5c0cbb6b5 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/i2c.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/i2c.c -@@ -447,7 +447,7 @@ mlxsw_i2c_cmd(struct device *dev, u16 opcode, u32 in_mod, size_t in_mbox_size, - } else { - /* No input mailbox is case of initialization query command. */ - reg_size = MLXSW_I2C_MAX_DATA_SIZE; -- num = DIV_ROUND_UP(reg_size, mlxsw_i2c->block_size); -+ num = reg_size / mlxsw_i2c->block_size; - - if (mutex_lock_interruptible(&mlxsw_i2c->cmd.lock) < 0) { - dev_err(&client->dev, "Could not acquire lock"); --- -2.14.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0098-3-Revert-mlxsw-core_hwmon-Adjust-module-label-names.patch b/platform/mellanox/non-upstream-patches/patches/0098-3-Revert-mlxsw-core_hwmon-Adjust-module-label-names.patch deleted file mode 100644 index 353cc4a008b3..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0098-3-Revert-mlxsw-core_hwmon-Adjust-module-label-names.patch +++ /dev/null @@ -1,28 +0,0 @@ -From e0f5c6c6572fd70ad8fa0d268ee95fb8aba1bd98 Mon Sep 17 00:00:00 2001 -From: Ciju Rajan K -Date: Thu, 17 Aug 2023 10:01:22 +0000 -Subject: Revert "mlxsw: core_hwmon: Adjust module label names based on MTCAP - sensor counter" - -This reverts commit 33aa62a331425d5828d417eeac7fab697eb45286. ---- - drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c -index 464787b10b73..d41afdfbd085 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c -@@ -377,8 +377,7 @@ mlxsw_hwmon_module_temp_label_show(struct device *dev, - container_of(attr, struct mlxsw_hwmon_attr, dev_attr); - - return sprintf(buf, "front panel %03u\n", -- mlwsw_hwmon_attr->type_index + 1 - -- mlwsw_hwmon_attr->hwmon->sensor_count); -+ mlwsw_hwmon_attr->type_index); - } - - static ssize_t --- -2.14.1 - 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 deleted file mode 100644 index 34822879ad42..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0099-mlxsw-core_hwmon-Fix-variable-names-for-hwmon-attrib.patch +++ /dev/null @@ -1,256 +0,0 @@ -From 320a964b80a8f9245da0515a26c2d41e035b3d10 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Fri, 3 Dec 2021 11:48:41 +0200 -Subject: [PATCH backport 5.10 099/182] 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 d41afdfbd085..3788d02b5244 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.20.1 - 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 deleted file mode 100644 index fcab6bb552b9..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0100-mlxsw-core_thermal-Rename-labels-according-to-naming.patch +++ /dev/null @@ -1,162 +0,0 @@ -From 2f12c9f7cd1d91732ee64d11611cc4cb6baf69a6 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Fri, 3 Dec 2021 11:48:42 +0200 -Subject: [PATCH backport 5.10 100/182] 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 91abc7a3f7ea..f471f03e0094 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c -@@ -393,11 +393,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; -@@ -766,7 +766,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++) { -@@ -775,12 +775,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); -@@ -871,12 +872,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); -@@ -920,7 +921,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); - -@@ -934,14 +935,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++) { -@@ -954,7 +955,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; - } -@@ -978,38 +979,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.20.1 - 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 deleted file mode 100644 index f1edc13f6e04..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0101-mlxsw-core_thermal-Remove-obsolete-API-for-query-res.patch +++ /dev/null @@ -1,111 +0,0 @@ -From d0a94e237cb6d2020a0a1c27f357a9c3bfc0b1d5 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Fri, 3 Dec 2021 11:48:43 +0200 -Subject: [PATCH backport 5.10 101/182] 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 7938bad70e37..0b1888318ef1 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 56efb8e48022..0ceb7dae95f6 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 3788d02b5244..8b170ad92302 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 f471f03e0094..80942c78d9e5 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c -@@ -746,9 +746,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) -@@ -793,9 +790,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); -@@ -843,9 +837,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) -@@ -889,9 +880,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.20.1 - 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 deleted file mode 100644 index 197eb7843e88..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0102-mlxsw-reg-Add-mgpir_-prefix-to-MGPIR-fields-comments.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 2e6cd3d593c0bf1cc38093a73ec7777a5b806bfe Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Fri, 3 Dec 2021 11:48:44 +0200 -Subject: [PATCH backport 5.10 102/182] 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 7f9b902049db..c3fb2e4d4458 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/reg.h -+++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h -@@ -10130,24 +10130,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.20.1 - 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 deleted file mode 100644 index 438d496fb938..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0103-mlxsw-core-Remove-unnecessary-asserts.patch +++ /dev/null @@ -1,102 +0,0 @@ -From 7b7f5f88374c3377fc28e48a0bc77ae4aa783fda Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Tue, 7 Dec 2021 16:07:31 +0200 -Subject: [PATCH backport 5.10 103/182] 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 6dd4ae2f45f4..c1d51b4b6b36 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/core_env.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/core_env.c -@@ -414,9 +414,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) { -@@ -456,9 +453,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; -@@ -560,9 +554,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"); -@@ -901,9 +892,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); -@@ -916,9 +904,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); -@@ -929,9 +914,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); -@@ -943,9 +925,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 != -@@ -975,9 +954,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.20.1 - 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 deleted file mode 100644 index 97ee7b4112f6..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0104-mlxsw-reg-Extend-MTMP-register-with-new-slot-number-.patch +++ /dev/null @@ -1,147 +0,0 @@ -From 58426cf3ccba63cbc0b9ddc2abfc1173ca8ba368 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Fri, 3 Dec 2021 11:48:45 +0200 -Subject: [PATCH backport 5.10 104/182] 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 c1d51b4b6b36..32faedfd2ea8 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/core_env.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/core_env.c -@@ -142,7 +142,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 8b170ad92302..71ca3b561e62 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 80942c78d9e5..f4f0f8ce8597 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c -@@ -272,7 +272,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) { -@@ -432,7 +432,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 -@@ -577,7 +577,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 c3fb2e4d4458..0428904b99d2 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.20.1 - 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 deleted file mode 100644 index c5412a8ddb71..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0105-mlxsw-reg-Extend-MTBR-register-with-new-slot-number-.patch +++ /dev/null @@ -1,88 +0,0 @@ -From c9c07da3e3dadf102a25e27f49d0ce4f414c096c Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Fri, 3 Dec 2021 11:48:46 +0200 -Subject: [PATCH backport 5.10 105/182] 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 32faedfd2ea8..c2aa05be5bcc 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/core_env.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/core_env.c -@@ -591,8 +591,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 71ca3b561e62..f4bc711a16cf 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 0428904b99d2..df210bd9a29c 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.20.1 - 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 deleted file mode 100644 index 56fe2c80c407..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0106-mlxsw-reg-Extend-MCIA-register-with-new-slot-number-.patch +++ /dev/null @@ -1,109 +0,0 @@ -From 4f10b61f33bdaee774b31b7fe37a76058b755561 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Fri, 3 Dec 2021 11:48:47 +0200 -Subject: [PATCH backport 5.10 106/182] 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 c2aa05be5bcc..a516c04ad19b 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; -@@ -110,7 +110,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) -@@ -184,12 +185,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); -@@ -369,7 +370,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 df210bd9a29c..bdbe198a9053 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. */ -@@ -8896,11 +8902,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.20.1 - 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 deleted file mode 100644 index d03711b1c0ec..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0107-mlxsw-reg-Extend-MCION-register-with-new-slot-number.patch +++ /dev/null @@ -1,69 +0,0 @@ -From aba06998f55ba715e6161a427356fccc17b466fc Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Fri, 3 Dec 2021 11:48:50 +0200 -Subject: [PATCH backport 5.10 107/182] 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 a516c04ad19b..2ac8444aa8b2 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/core_env.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/core_env.c -@@ -458,7 +458,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 bdbe198a9053..acde0cd00944 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/reg.h -+++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h -@@ -9327,6 +9327,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), -@@ -9338,9 +9344,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.20.1 - 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 deleted file mode 100644 index 721b79aa4ccd..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0108-mlxsw-reg-Extend-PMMP-register-with-new-slot-number-.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 0aebe300b70a084161c12e813396025b255d91d7 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Fri, 3 Dec 2021 11:48:51 +0200 -Subject: [PATCH backport 5.10 108/182] 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 2ac8444aa8b2..ad27a1c90f92 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/core_env.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/core_env.c -@@ -501,7 +501,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 acde0cd00944..aad0cb1497aa 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.20.1 - 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 deleted file mode 100644 index acd11709cce7..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0109-mlxsw-reg-Extend-MGPIR-register-with-new-slot-fields.patch +++ /dev/null @@ -1,199 +0,0 @@ -From 441a7861ef61f4d0d55dee542d4704487694f68c Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Wed, 22 Dec 2021 06:11:50 +0000 -Subject: [PATCH backport 5.10 109/182] 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 ad27a1c90f92..8ab15d5bd7f5 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/core_env.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/core_env.c -@@ -983,12 +983,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 f4bc711a16cf..2bc4c4556895 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 f4f0f8ce8597..21a7415c8ef5 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c -@@ -746,13 +746,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), -@@ -837,13 +837,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 3d07c2dcf08d..b2ffcfda8374 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 aad0cb1497aa..a5fa25d4bd8f 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/reg.h -+++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h -@@ -10166,6 +10166,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 - */ -@@ -10183,21 +10189,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); -@@ -10208,6 +10222,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.20.1 - 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 deleted file mode 100644 index 110f94ebebb9..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0110-mlxsw-core_env-Pass-slot-index-during-PMAOS-register.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 7c2049bccef11b265fd4a4458b92277ea8ea97fc Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Fri, 3 Dec 2021 11:48:52 +0200 -Subject: [PATCH backport 5.10 110/182] 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 8ab15d5bd7f5..b7c1fd3dbf45 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/core_env.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/core_env.c -@@ -398,7 +398,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); -@@ -486,7 +486,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); -@@ -876,7 +876,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 a5fa25d4bd8f..07f68fd1a4e5 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.20.1 - 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 deleted file mode 100644 index d73ec6067a2a..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0111-mlxsw-reg-Add-new-field-to-Management-General-Periph.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 4b630e780a6fa8b387e79e252169d5743faf5321 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Fri, 3 Dec 2021 11:48:49 +0200 -Subject: [PATCH backport 5.10 111/182] 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 07f68fd1a4e5..98c627ffe039 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/reg.h -+++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h -@@ -10190,6 +10190,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.20.1 - 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 deleted file mode 100644 index 5e44880f26b9..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0112-mlxsw-core-Extend-interfaces-for-cable-info-access-w.patch +++ /dev/null @@ -1,828 +0,0 @@ -From 0b0f4813bdd0b4ed70074d616f68bb6c774662bc Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Fri, 3 Dec 2021 11:48:53 +0200 -Subject: [PATCH backport 5.10 112/182] 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 b7c1fd3dbf45..fc4468a6b0f6 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; -@@ -64,8 +66,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]; -@@ -110,7 +112,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); -@@ -128,8 +130,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 { -@@ -143,8 +146,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; -@@ -173,7 +177,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; - -@@ -185,12 +190,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); -@@ -207,8 +212,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; -@@ -216,8 +221,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; - -@@ -246,9 +252,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; - -@@ -286,8 +293,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; -@@ -300,12 +308,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) { -@@ -351,7 +361,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) - { -@@ -370,7 +381,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); -@@ -394,18 +405,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; -@@ -430,7 +443,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; -@@ -445,7 +458,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) - { -@@ -458,7 +472,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"); -@@ -481,12 +495,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); -@@ -496,12 +510,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; -@@ -514,24 +529,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; -@@ -540,14 +557,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) - { -@@ -571,8 +590,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; - -@@ -585,14 +604,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) -@@ -613,13 +632,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) -@@ -627,6 +648,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, -@@ -654,14 +676,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; - -@@ -669,7 +691,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; - } -@@ -776,6 +799,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; - }; -@@ -796,7 +820,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. -@@ -808,7 +834,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); -@@ -835,6 +862,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); -@@ -869,14 +897,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); -@@ -888,8 +916,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); - -@@ -901,7 +929,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); - -@@ -911,7 +940,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); - -@@ -921,7 +951,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; -@@ -938,8 +969,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; - -@@ -951,7 +982,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); - -@@ -969,7 +1001,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); -@@ -1014,12 +1047,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 da121b1a84b4..03d027870d65 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 2bc4c4556895..5df54a5bf292 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 21a7415c8ef5..4f84c4bb66af 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c -@@ -151,13 +151,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 b2ffcfda8374..104f1ba0242f 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 4110e15c22c7..e0424f490c6f 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 369b9d0dc5d4..c9298b236182 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.20.1 - 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 deleted file mode 100644 index ad8bd09c4594..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0113-mlxsw-core-Extend-port-module-data-structures-for-li.patch +++ /dev/null @@ -1,520 +0,0 @@ -From fe0bf4454c709fa1ddb5fa105e88f2d57cb5ef5a Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Tue, 14 Dec 2021 10:57:27 +0200 -Subject: [PATCH backport 5.10 113/182] 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 fc4468a6b0f6..606d89b6f50f 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) -@@ -405,6 +411,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) - { -@@ -421,6 +436,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; - -@@ -428,15 +444,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; -@@ -452,7 +469,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); -@@ -464,13 +481,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); -@@ -489,7 +508,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); -@@ -571,6 +590,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; - -@@ -580,13 +600,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; -@@ -596,9 +617,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); -@@ -709,6 +730,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; -@@ -717,7 +739,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) -@@ -725,9 +747,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)) { -@@ -735,21 +758,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); - } - } - -@@ -807,6 +830,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; -@@ -816,9 +840,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, -@@ -845,12 +872,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); -@@ -862,7 +891,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); -@@ -920,10 +949,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; - } -@@ -933,10 +964,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); - -@@ -944,10 +977,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); - -@@ -955,15 +990,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 -@@ -975,9 +1012,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); -@@ -986,16 +1023,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 -@@ -1005,38 +1044,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); -@@ -1047,13 +1131,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; - -@@ -1065,7 +1153,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; - } -@@ -1076,6 +1166,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.20.1 - 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 deleted file mode 100644 index d8e3d30a4bad..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0114-mlxsw-core-Move-port-module-events-enablement-to-a-s.patch +++ /dev/null @@ -1,92 +0,0 @@ -From 3c3be37747cb938fff1178f88d611eb00159297b Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Tue, 14 Dec 2021 10:57:28 +0200 -Subject: [PATCH backport 5.10 114/182] 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 606d89b6f50f..4553dfa68f96 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/core_env.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/core_env.c -@@ -1087,6 +1087,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; -@@ -1135,20 +1161,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); -@@ -1162,6 +1185,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.20.1 - 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 deleted file mode 100644 index b5876fa61204..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0115-mlxsw-core_hwmon-Split-gearbox-initialization.patch +++ /dev/null @@ -1,122 +0,0 @@ -From 1a451b46c16494cfa38bb47495ad632626502681 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Tue, 14 Dec 2021 10:57:29 +0200 -Subject: [PATCH backport 5.10 115/182] 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 5df54a5bf292..7061c18b7edc 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.20.1 - 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 deleted file mode 100644 index 7c37fc22bbaf..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0116-mlxsw-core_hwmon-Extend-internal-structures-to-suppo.patch +++ /dev/null @@ -1,541 +0,0 @@ -From a18e5112ed12150e245e275e187ecd6d87d66b0e Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Tue, 14 Dec 2021 10:57:30 +0200 -Subject: [PATCH backport 5.10 116/182] 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 7061c18b7edc..31b370862131 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.20.1 - 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 deleted file mode 100644 index bc0bc548a19b..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0117-mlxsw-core_hwmon-Introduce-slot-parameter-in-hwmon-i.patch +++ /dev/null @@ -1,129 +0,0 @@ -From 15f2f79bffb77324a389b7e174f32406924d3a3a Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Tue, 14 Dec 2021 10:57:31 +0200 -Subject: [PATCH backport 5.10 117/182] 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 31b370862131..0d7edabf19a4 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.20.1 - 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 deleted file mode 100644 index 7d0491b84079..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0118-mlxsw-core_hwmon-Extend-hwmon-device-with-gearbox-ma.patch +++ /dev/null @@ -1,136 +0,0 @@ -From c627292817e68e29abdf5fd9be93340251d71f7a Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Tue, 14 Dec 2021 10:57:32 +0200 -Subject: [PATCH backport 5.10 118/182] 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 0d7edabf19a4..6af23f4724e4 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.20.1 - 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 deleted file mode 100644 index 0ff18202c1b2..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0119-mlxsw-core_thermal-Extend-internal-structures-to-sup.patch +++ /dev/null @@ -1,367 +0,0 @@ -From 8851888004e82e73629f031e8af592c36b12c469 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Tue, 14 Dec 2021 10:57:33 +0200 -Subject: [PATCH backport 5.10 119/182] 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 4f84c4bb66af..5f8b1e92475b 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c -@@ -83,6 +83,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 { -@@ -93,10 +102,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; - }; -@@ -151,13 +157,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) -@@ -424,15 +432,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 -@@ -463,6 +472,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; -@@ -577,7 +587,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) -@@ -704,25 +714,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, -@@ -740,34 +753,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); -@@ -779,20 +797,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 -@@ -828,7 +847,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; -@@ -848,19 +868,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; -@@ -870,19 +891,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, -@@ -902,9 +924,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) { -@@ -970,11 +999,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; - -@@ -986,9 +1015,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); -@@ -1001,6 +1030,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; - } -@@ -1009,8 +1040,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; -@@ -1023,5 +1054,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.20.1 - 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 deleted file mode 100644 index b0cb21b8a4aa..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0120-mlxsw-core_thermal-Split-gearbox-initialization.patch +++ /dev/null @@ -1,138 +0,0 @@ -From ed83386ce79974230c5fa59245efe760046d944c Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Tue, 14 Dec 2021 10:57:34 +0200 -Subject: [PATCH backport 5.10 120/182] 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 5f8b1e92475b..313856b88f6c 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c -@@ -846,15 +846,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); -@@ -864,8 +861,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; -@@ -875,6 +875,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, -@@ -892,7 +912,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; - } - -@@ -904,7 +923,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, -@@ -1003,6 +1021,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; -@@ -1017,6 +1039,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) { -@@ -1041,6 +1065,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.20.1 - 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 deleted file mode 100644 index 8e9d6e621a80..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0121-mlxsw-core_thermal-Extend-thermal-area-with-gearbox-.patch +++ /dev/null @@ -1,127 +0,0 @@ -From 13a7ef7fcdc09def9d9756510f49da82283d78df Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Tue, 14 Dec 2021 10:57:35 +0200 -Subject: [PATCH backport 5.10 121/182] 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 313856b88f6c..bde5489d9240 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c -@@ -77,9 +77,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 */ -@@ -92,6 +94,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 { -@@ -586,7 +589,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); -@@ -727,6 +730,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, -@@ -851,36 +855,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); - } - -@@ -901,6 +917,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.20.1 - 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 deleted file mode 100644 index c08ac6d23557..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0122-mlxsw-core_thermal-Add-line-card-id-prefix-to-line-c.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 901e0ed6354f716b23854ad2f8e4eeb9a74414ab Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Tue, 14 Dec 2021 10:57:36 +0200 -Subject: [PATCH backport 5.10 122/182] 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 bde5489d9240..4964c9164c2d 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c -@@ -689,8 +689,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, -@@ -824,8 +828,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.20.1 - 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 deleted file mode 100644 index ebe8c96cf744..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0123-mlxsw-core_thermal-Use-exact-name-of-cooling-devices.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 7e5f922bac5153137a8b1f486728d9d95b4922bc Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Tue, 14 Dec 2021 10:57:37 +0200 -Subject: [PATCH backport 5.10 123/182] 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 4964c9164c2d..64c6a78f3aa0 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c -@@ -133,8 +133,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.20.1 - 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 deleted file mode 100644 index 624ab7170dd8..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0124-mlxsw-core_thermal-Use-common-define-for-thermal-zon.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 8d06868f51917926f99299eaac26d6f86eff3593 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Wed, 13 Apr 2022 18:17:33 +0300 -Subject: [PATCH backport 5.10 124/182] 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 -Signed-off-by: David S. Miller ---- - 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 64c6a78f3aa0..b9253c9f70d9 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_MIN_STATE 2 -@@ -685,7 +684,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) -@@ -824,7 +823,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.20.1 - 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 deleted file mode 100644 index 13d23671a13e..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0125-devlink-add-support-to-create-line-card-and-expose-t.patch +++ /dev/null @@ -1,532 +0,0 @@ -From 36a2e4e93d7d1ca2ed670b4cf827400ba367e290 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Wed, 22 Dec 2021 08:57:27 +0000 -Subject: [PATCH backport 5.10 125/182] 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 b01bb9bca5a2..e8f046590579 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 cf89c318f2ac..ff07ad596035 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 72047750dcd9..645fe0612b53 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.20.1 - 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 deleted file mode 100644 index d95308acabd8..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0126-devlink-implement-line-card-provisioning.patch +++ /dev/null @@ -1,555 +0,0 @@ -From 37d223fa389636092d519ca903f186d608eed3c8 Mon Sep 17 00:00:00 2001 -From: Jiri Pirko -Date: Thu, 31 Dec 2020 17:35:08 +0100 -Subject: [PATCH backport 5.10 126/182] 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 e8f046590579..44b60085ec16 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 ff07ad596035..d8833664522f 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 645fe0612b53..943973ffc450 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.20.1 - 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 deleted file mode 100644 index 548b8f4a6af8..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0127-devlink-implement-line-card-active-state.patch +++ /dev/null @@ -1,99 +0,0 @@ -From 9edffb671d73df181e382930bda0a3870e6ac120 Mon Sep 17 00:00:00 2001 -From: Jiri Pirko -Date: Wed, 6 Jan 2021 16:03:43 +0100 -Subject: [PATCH backport 5.10 127/182] 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 44b60085ec16..d9b2b559c9a2 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 d8833664522f..5ace55666d27 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 943973ffc450..724633810758 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.20.1 - 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 deleted file mode 100644 index 41628c616e96..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0128-devlink-add-port-to-line-card-relationship-set.patch +++ /dev/null @@ -1,102 +0,0 @@ -From fb810d890bd142a7cfc14fb7e5f1519eee366208 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Wed, 22 Dec 2021 14:10:14 +0000 -Subject: [PATCH backport 5.10 128/182] 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 d9b2b559c9a2..3d4ceb2902b8 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 724633810758..b43e93ccc672 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.20.1 - 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 deleted file mode 100644 index 3ea32fc35e6c..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0129-devlink-introduce-linecard-info-get-message.patch +++ /dev/null @@ -1,246 +0,0 @@ -From 13e29cf4f38755ae717615071b07cd438e8819e6 Mon Sep 17 00:00:00 2001 -From: Jiri Pirko -Date: Fri, 19 Feb 2021 09:36:15 +0100 -Subject: [PATCH backport 5.10 129/182] 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 3d4ceb2902b8..059bed6aef3c 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 5ace55666d27..2c9f7d584b48 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 b43e93ccc672..04f8038f8e23 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.20.1 - 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 deleted file mode 100644 index d2f92f77e3c5..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0130-devlink-introduce-linecard-info-get-message.patch +++ /dev/null @@ -1,316 +0,0 @@ -From b8243b5c2fdb9871cd55a864b95e197ced9ad532 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Wed, 22 Dec 2021 15:11:36 +0000 -Subject: [PATCH backport 5.10 130/182] 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 059bed6aef3c..06b61c1d7938 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 2c9f7d584b48..bac94c3c1bb0 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 04f8038f8e23..ca014f40ac02 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.20.1 - 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 deleted file mode 100644 index 179d95f44347..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0131-mlxsw-reg-Add-Ports-Mapping-event-Configuration-Regi.patch +++ /dev/null @@ -1,99 +0,0 @@ -From 4a49468e7fc7e94a83703215445d9b3919642eb9 Mon Sep 17 00:00:00 2001 -From: Jiri Pirko -Date: Fri, 29 Jan 2021 08:45:09 +0100 -Subject: [PATCH backport 5.10 131/182] 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 98c627ffe039..93e3366cfcb9 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. -@@ -11375,6 +11438,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.20.1 - 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 deleted file mode 100644 index 730e1f8980ee..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0132-mlxsw-reg-Add-Management-DownStream-Device-Query-Reg.patch +++ /dev/null @@ -1,268 +0,0 @@ -From 5d8d4899f493e3b18712fc96a45eb020985740b1 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Mon, 3 Jan 2022 10:20:49 +0000 -Subject: [PATCH backport 5.10 132/182] 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 93e3366cfcb9..ad7faeb95646 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/reg.h -+++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h -@@ -10296,6 +10296,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 - * ----------------------------------- - */ -@@ -11495,6 +11728,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.20.1 - 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 deleted file mode 100644 index 22f63a05581b..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0133-mlxsw-reg-Add-Management-DownStream-Device-Control-R.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 14d65a09a9b77a5ed632a73ff006042d26be3226 Mon Sep 17 00:00:00 2001 -From: Jiri Pirko -Date: Tue, 19 Jan 2021 12:16:58 +0100 -Subject: [PATCH backport 5.10 133/182] 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 ad7faeb95646..cddfe5702140 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/reg.h -+++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h -@@ -10529,6 +10529,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 - * ----------------------------------- - */ -@@ -11729,6 +11765,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.20.1 - 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 deleted file mode 100644 index 9aefc453b81b..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0134-mlxsw-reg-Add-Management-Binary-Code-Transfer-Regist.patch +++ /dev/null @@ -1,155 +0,0 @@ -From e9afbd683a14e3369ba25dcb9c8147a8b478b5c0 Mon Sep 17 00:00:00 2001 -From: Jiri Pirko -Date: Thu, 10 Dec 2020 18:27:38 +0100 -Subject: [PATCH backport 5.10 134/182] 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 cddfe5702140..e060f054e0a9 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/reg.h -+++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h -@@ -10296,6 +10296,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 -@@ -11764,6 +11883,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.20.1 - 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 deleted file mode 100644 index f35efc3b2b64..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0135-mlxsw-core_linecards-Add-line-card-objects-and-imple.patch +++ /dev/null @@ -1,1062 +0,0 @@ -From 59c953deed31161dc358e6d397af2b5b0f5ee61c Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Wed, 22 Dec 2021 16:06:54 +0000 -Subject: [PATCH backport 5.10 135/182] 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 892724380ea2..ca7260a145f5 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 0b1888318ef1..246db548f011 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 0ceb7dae95f6..d3c5d8289a85 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 000000000000..a324ce2436e8 ---- /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 e0424f490c6f..bc233a5c8a79 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 57f9e24602d0..f3e522de2f68 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.20.1 - 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 deleted file mode 100644 index 50e93d73a841..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0136-mlxsw-core_linecards-Implement-line-card-activation-.patch +++ /dev/null @@ -1,206 +0,0 @@ -From e7379493c9f7e30f7d20459ed07a435095e9a889 Mon Sep 17 00:00:00 2001 -From: Jiri Pirko -Date: Fri, 22 Jan 2021 14:45:06 +0100 -Subject: [PATCH backport 5.10 136/182] 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 d3c5d8289a85..ecd91bb8ca77 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 a324ce2436e8..134437f49219 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.20.1 - 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 deleted file mode 100644 index 77348d45f2c2..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0137-mlxsw-core-Extend-driver-ops-by-remove-selected-port.patch +++ /dev/null @@ -1,99 +0,0 @@ -From a0e62e8df42c4ae6eabba2ea0c2d076d8c8d06fb Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Wed, 22 Dec 2021 16:26:43 +0000 -Subject: [PATCH backport 5.10 137/182] 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 246db548f011..2b4f9844b1d6 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 ecd91bb8ca77..70f97ef74a2c 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 bc233a5c8a79..82acff318dcd 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.20.1 - 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 deleted file mode 100644 index 5a56db150d8d..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0138-mlxsw-spectrum-Add-port-to-linecard-mapping.patch +++ /dev/null @@ -1,153 +0,0 @@ -From 718b7aec4ec4c7e3c327b2ffbf43b27126688836 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Mon, 3 Jan 2022 11:22:42 +0000 -Subject: [PATCH backport 5.10 138/182] 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 2b4f9844b1d6..68ef007ac48c 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 70f97ef74a2c..8e738ddb39c8 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 104f1ba0242f..30925f57362e 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 82acff318dcd..c87267d002c6 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 1e561132eb1e..090b9a103c04 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 131b2a53d261..bf8a54776861 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.20.1 - 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 deleted file mode 100644 index 8f7fc94e0394..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0139-mlxsw-reg-Introduce-Management-Temperature-Extended-.patch +++ /dev/null @@ -1,105 +0,0 @@ -From 44b270551552a48c2a0799f1660b7bfdd0c10519 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Wed, 12 May 2021 22:57:37 +0300 -Subject: [PATCH backport 5.10 139/182] 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 e060f054e0a9..5757c4f40277 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/reg.h -+++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h -@@ -10296,6 +10296,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 -@@ -11883,6 +11949,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.20.1 - 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 deleted file mode 100644 index 35b85c12d36d..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0140-mlxsw-core-Add-APIs-for-thermal-sensor-mapping.patch +++ /dev/null @@ -1,114 +0,0 @@ -From 3614c1e72e48e03c64ce88d269d97ee4743f9cc4 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Mon, 13 Dec 2021 12:29:10 +0000 -Subject: [PATCH backport 5.10 140/182] 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 4553dfa68f96..4f3fc25af013 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/core_env.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/core_env.c -@@ -624,6 +624,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 03d027870d65..336c9ee579cb 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.20.1 - 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 deleted file mode 100644 index 1d0966082dbf..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0141-mlxsw-reg-Add-Management-DownStream-Device-Tunneling.patch +++ /dev/null @@ -1,126 +0,0 @@ -From d7353e41900e4d6fa44fa5e51a483b9f01432846 Mon Sep 17 00:00:00 2001 -From: Jiri Pirko -Date: Thu, 25 Feb 2021 10:17:53 +0100 -Subject: [PATCH backport 5.10 141/182] 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 5757c4f40277..7b71e9ae3d51 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/reg.h -+++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h -@@ -10481,6 +10481,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 -@@ -11951,6 +12041,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.20.1 - 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 deleted file mode 100644 index c08636be7697..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0142-mlxsw-core_linecards-Probe-devices-for-provisioned-l.patch +++ /dev/null @@ -1,224 +0,0 @@ -From 51f5cf36b8b2c94d8a71bfa17d5f71257048c314 Mon Sep 17 00:00:00 2001 -From: Jiri Pirko -Date: Fri, 26 Feb 2021 13:15:09 +0100 -Subject: [PATCH backport 5.10 142/182] 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 8e738ddb39c8..593470d14815 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 134437f49219..720ad6d82798 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.20.1 - 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 deleted file mode 100644 index 78fe94419a05..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0143-mlxsw-core_linecards-Expose-device-FW-version-over-d.patch +++ /dev/null @@ -1,177 +0,0 @@ -From e4830f23af9d14fac42764dd077f49de8de7bff2 Mon Sep 17 00:00:00 2001 -From: Jiri Pirko -Date: Thu, 10 Jun 2021 15:32:00 +0200 -Subject: [PATCH backport 5.10 143/182] 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 720ad6d82798..cb872f918f01 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.20.1 - 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 deleted file mode 100644 index 87018bd867cb..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0144-mlxsw-core-Introduce-flash-update-components.patch +++ /dev/null @@ -1,244 +0,0 @@ -From 1eb0843255d6e92aa96d0ea11a15ab1f86b20e4f Mon Sep 17 00:00:00 2001 -From: Jiri Pirko -Date: Fri, 26 Feb 2021 18:40:28 +0100 -Subject: [PATCH backport 5.10 144/182] 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 68ef007ac48c..f55071982271 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 593470d14815..30f00da0a48d 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 06b61c1d7938..fafbec26d2c4 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.20.1 - 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 deleted file mode 100644 index de282a124f82..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0145-mlxfw-Get-the-PSID-value-using-op-instead-of-passing.patch +++ /dev/null @@ -1,200 +0,0 @@ -From 81cb237570a4d0251455d17e073337f73c1b4aa9 Mon Sep 17 00:00:00 2001 -From: Jiri Pirko -Date: Fri, 4 Jun 2021 10:25:35 +0200 -Subject: [PATCH backport 5.10 145/182] 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 02558ac2ace6..06edfd5b12e0 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 7654841a05c2..b83651246c1f 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 bcd166911d44..329ddf1b3b89 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 f55071982271..8c128078105a 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.20.1 - 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 deleted file mode 100644 index 8855ba192e82..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0146-mlxsw-core_linecards-Implement-line-card-device-flas.patch +++ /dev/null @@ -1,401 +0,0 @@ -From 0e642e558b98e1a686b39acb53f53c1fb9735b02 Mon Sep 17 00:00:00 2001 -From: Jiri Pirko -Date: Fri, 5 Mar 2021 09:33:21 +0100 -Subject: [PATCH backport 5.10 146/182] 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 cb872f918f01..9f9ee582fce2 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.20.1 - 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 deleted file mode 100644 index 22c42d0ce4d3..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0147-mlxsw-core_linecards-Introduce-ops-for-linecards-sta.patch +++ /dev/null @@ -1,277 +0,0 @@ -From 5e3bebf1e096e4770cad3aaf3d03fa22429fe5f9 Mon Sep 17 00:00:00 2001 -From: Jiri Pirko -Date: Fri, 22 Jan 2021 15:01:06 +0100 -Subject: [PATCH backport 5.10 147/182] 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 30f00da0a48d..10ea541bb19d 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 9f9ee582fce2..3a2fdd22dc21 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.20.1 - 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 deleted file mode 100644 index e5e39186aab1..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0148-mlxsw-core-Add-interfaces-for-line-card-initializati.patch +++ /dev/null @@ -1,133 +0,0 @@ -From d037308b118ee4a1ccf557dc3f1c47b81bb62c4c Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Mon, 13 Dec 2021 12:54:36 +0000 -Subject: [PATCH backport 5.10 148/182] 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 4f3fc25af013..98f7cf672d9e 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/core_env.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/core_env.c -@@ -1160,6 +1160,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; -@@ -1196,6 +1267,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; -@@ -1223,6 +1298,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: -@@ -1237,6 +1314,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.20.1 - 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 deleted file mode 100644 index e688440377b9..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0149-mlxsw-core_thermal-Add-interfaces-for-line-card-init.patch +++ /dev/null @@ -1,213 +0,0 @@ -From 71416a2dd1900ac8eb9b7d5cd08911d331b074ff Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Wed, 12 May 2021 22:57:39 +0300 -Subject: [PATCH backport 5.10 149/182] 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 b9253c9f70d9..529108aea3c6 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c -@@ -88,6 +88,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; -@@ -105,6 +106,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; - }; -@@ -948,6 +950,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) -@@ -1052,6 +1174,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; -@@ -1060,6 +1186,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); -@@ -1087,6 +1215,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.20.1 - 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 deleted file mode 100644 index 3c229622de6f..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0150-mlxsw-core_hwmon-Add-interfaces-for-line-card-initia.patch +++ /dev/null @@ -1,235 +0,0 @@ -From 7405ad4281c96aedcf879357d03487556abed05d Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Wed, 12 May 2021 22:57:42 +0300 -Subject: [PATCH backport 5.10 150/182] 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 6af23f4724e4..a27146ccafc5 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.20.1 - 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 deleted file mode 100644 index 8aeb3848a05b..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0151-mlxsw-minimal-Prepare-driver-for-modular-system-supp.patch +++ /dev/null @@ -1,496 +0,0 @@ -From e3a3f15e69b566577c2ebe0b6f3bc019476c6879 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Thu, 30 Dec 2021 16:02:59 +0000 -Subject: [PATCH backport 5.10 151/182] 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 30925f57362e..59c5053dc5fd 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.20.1 - 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 deleted file mode 100644 index d81e11aa190f..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0152-mlxsw-core-Extend-bus-init-function-with-event-handl.patch +++ /dev/null @@ -1,90 +0,0 @@ -From da7c615b231402e3084dae855468be117538535c Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Wed, 15 Dec 2021 08:59:14 +0000 -Subject: [PATCH backport 5.10 152/182] 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 8c128078105a..a9bb43837b33 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 10ea541bb19d..b09f9013db77 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 ce843ea91464..0cdb9b9d8353 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/i2c.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/i2c.c -@@ -509,7 +509,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 dbb16ce25bdf..e8e91130cdf5 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.20.1 - 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 deleted file mode 100644 index 8a0bc5f28060..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0153-mlxsw-i2c-Add-support-for-system-events-handling.patch +++ /dev/null @@ -1,199 +0,0 @@ -From 8d7807e7b8326c537aa7db4fe31b2ca183d32248 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Sun, 19 Dec 2021 09:12:58 +0000 -Subject: [PATCH backport v5.10.164 1/1] 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 cc99ec3f4e96..02f5733cfcc6 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; -@@ -63,6 +70,12 @@ - * @core: switch core pointer; - * @bus_info: bus info block; - * @block_size: maximum block size allowed to pass to under layer; -+ * @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; - * @status: status to indicate chip reset or in-service update; - */ - struct mlxsw_i2c { -@@ -77,6 +90,12 @@ struct mlxsw_i2c { - struct mlxsw_core *core; - struct mlxsw_bus_info bus_info; - u16 block_size; -+ 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; - u8 status; - }; - -@@ -537,6 +556,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) -@@ -567,6 +587,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, -@@ -661,6 +762,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, -@@ -670,6 +772,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: -@@ -683,6 +791,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.20.1 - 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 deleted file mode 100644 index fca84d737fa8..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0154-mlxsw-core-Export-line-card-API.patch +++ /dev/null @@ -1,27 +0,0 @@ -From a89d212954b74f3169e3061a3623eadfb86441e6 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Sun, 19 Dec 2021 09:31:32 +0000 -Subject: [PATCH backport 5.10 154/182] 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 a9bb43837b33..a26c6d880928 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.20.1 - 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 deleted file mode 100644 index da23b7086206..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0155-mlxsw-minimal-Add-system-event-handler.patch +++ /dev/null @@ -1,62 +0,0 @@ -From deb4f328672850d9ac4d8d51be7e0d8e727387af Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Sun, 19 Dec 2021 09:25:35 +0000 -Subject: [PATCH backport 5.10 155/182] 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 59c5053dc5fd..27afb28e439f 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.20.1 - 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 deleted file mode 100644 index 421536ead3d8..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0156-mlxsw-minimal-Add-interfaces-for-line-card-initializ.patch +++ /dev/null @@ -1,119 +0,0 @@ -From 933a623916a00d83616d653a82329750d94de0f1 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Sun, 19 Dec 2021 09:40:34 +0000 -Subject: [PATCH backport 5.10 156/182] 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 27afb28e439f..0b605c6aa637 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.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0167-DS-lan743x-Add-support-for-fixed-phy.patch b/platform/mellanox/non-upstream-patches/patches/0167-DS-lan743x-Add-support-for-fixed-phy.patch deleted file mode 100644 index b1dea0121144..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0167-DS-lan743x-Add-support-for-fixed-phy.patch +++ /dev/null @@ -1,97 +0,0 @@ -From 12b2a85b4b3bb17f44611b9c320fd4e84915b122 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Fri, 6 May 2022 16:52:53 +0300 -Subject: [PATCH backport 5.10 167/182] DS: lan743x: Add support for fixed phy - -Add support for fixed phy for non DTS architecture. - -Signed-off-by: Vadim Pasternak ---- - drivers/net/ethernet/microchip/Kconfig | 11 ++++++++ - drivers/net/ethernet/microchip/lan743x_main.c | 26 ++++++++++++++++--- - 2 files changed, 33 insertions(+), 4 deletions(-) - -diff --git a/drivers/net/ethernet/microchip/Kconfig b/drivers/net/ethernet/microchip/Kconfig -index d0f6dfe0dcf3..6c66b55bc811 100644 ---- a/drivers/net/ethernet/microchip/Kconfig -+++ b/drivers/net/ethernet/microchip/Kconfig -@@ -54,4 +54,15 @@ config LAN743X - To compile this driver as a module, choose M here. The module will be - called lan743x. - -+config LAN743X_FIXED_PHY -+ bool "Direct R/G/MII connection without PHY" -+ default n -+ depends on LAN743X -+ select FIXED_PHY -+ help -+ Direct R/G/MII connection to a remote MII device without PHY in between. -+ No mdio bus will be used in this case and no auto-negotiation takes place. -+ The configuration settings below need to mirror the configuration of the -+ remote MII device. -+ - endif # NET_VENDOR_MICROCHIP -diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c -index 481f89d193f7..b6250a7469da 100644 ---- a/drivers/net/ethernet/microchip/lan743x_main.c -+++ b/drivers/net/ethernet/microchip/lan743x_main.c -@@ -798,6 +798,7 @@ static int lan743x_mac_init(struct lan743x_adapter *adapter) - - /* disable auto duplex, and speed detection. Phylib does that */ - data = lan743x_csr_read(adapter, MAC_CR); -+ - data &= ~(MAC_CR_ADD_ | MAC_CR_ASD_); - data |= MAC_CR_CNTR_RST_; - lan743x_csr_write(adapter, MAC_CR, data); -@@ -1002,7 +1003,10 @@ static void lan743x_phy_close(struct lan743x_adapter *adapter) - struct net_device *netdev = adapter->netdev; - - phy_stop(netdev->phydev); -- phy_disconnect(netdev->phydev); -+ if (IS_REACHABLE(CONFIG_LAN743X_FIXED_PHY)) -+ fixed_phy_unregister(netdev->phydev); -+ else -+ phy_disconnect(netdev->phydev); - netdev->phydev = NULL; - } - -@@ -1038,11 +1042,24 @@ static int lan743x_phy_open(struct lan743x_adapter *adapter) - - if (!phydev) { - /* try internal phy */ -- phydev = phy_find_first(adapter->mdiobus); -+ if (IS_REACHABLE(CONFIG_LAN743X_FIXED_PHY)) { -+ struct fixed_phy_status phy_status; -+ -+ phy_status.link = 1; -+ phy_status.speed = 1000; -+ phy_status.duplex = DUPLEX_FULL; -+ phy_status.pause = 0; -+ phy_status.asym_pause = 0; -+ adapter->phy_mode = PHY_INTERFACE_MODE_RGMII; -+ phydev = fixed_phy_register(PHY_POLL, &phy_status, 0); -+ } else { -+ adapter->phy_mode = PHY_INTERFACE_MODE_GMII; -+ phydev = phy_find_first(adapter->mdiobus); -+ } -+ - if (!phydev) - goto return_error; - -- adapter->phy_mode = PHY_INTERFACE_MODE_GMII; - ret = phy_connect_direct(netdev, phydev, - lan743x_phy_link_status_change, - adapter->phy_mode); -@@ -1059,7 +1076,8 @@ static int lan743x_phy_open(struct lan743x_adapter *adapter) - phy->fc_autoneg = phydev->autoneg; - - phy_start(phydev); -- phy_start_aneg(phydev); -+ if (!IS_REACHABLE(CONFIG_LAN743X_FIXED_PHY)) -+ phy_start_aneg(phydev); - return 0; - - return_error: --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0168-TMP-mlxsw-minimal-Ignore-error-reading-SPAD-register.patch b/platform/mellanox/non-upstream-patches/patches/0168-TMP-mlxsw-minimal-Ignore-error-reading-SPAD-register.patch deleted file mode 100644 index 1a180318dd38..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0168-TMP-mlxsw-minimal-Ignore-error-reading-SPAD-register.patch +++ /dev/null @@ -1,34 +0,0 @@ -From cbb77f161d60964733f332e4ccfb9f240947c3ef Mon Sep 17 00:00:00 2001 -From: root -Date: Tue, 5 Apr 2022 21:35:55 +0300 -Subject: [PATCH backport 5.10 168/182] TMP: mlxsw: minimal: Ignore error - reading SPAD register - -WA until FW will add support for SPAD register for all systems. - -Signed-off-by: Vadim Pasternak ---- - drivers/net/ethernet/mellanox/mlxsw/minimal.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/drivers/net/ethernet/mellanox/mlxsw/minimal.c b/drivers/net/ethernet/mellanox/mlxsw/minimal.c -index 0b605c6aa637..5fd319697c94 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/minimal.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/minimal.c -@@ -64,11 +64,12 @@ static int mlxsw_m_base_mac_get(struct mlxsw_m *mlxsw_m) - { - char spad_pl[MLXSW_REG_SPAD_LEN] = {0}; - int err; -- -+#if 0 - err = mlxsw_reg_query(mlxsw_m->core, MLXSW_REG(spad), spad_pl); - if (err) - return err; - mlxsw_reg_spad_base_mac_memcpy_from(spad_pl, mlxsw_m->base_mac); -+#endif - return 0; - } - --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0171-platform-mellanox-mlxreg-lc-Fix-cleanup-on-failure-a.patch b/platform/mellanox/non-upstream-patches/patches/0171-platform-mellanox-mlxreg-lc-Fix-cleanup-on-failure-a.patch deleted file mode 100644 index 0632d1bc3647..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0171-platform-mellanox-mlxreg-lc-Fix-cleanup-on-failure-a.patch +++ /dev/null @@ -1,194 +0,0 @@ -From 7a45b6a2a14c292e89a09afde8fcc7d1ceb20ebd Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Wed, 22 Jun 2022 13:01:15 +0300 -Subject: [PATCH backport 5.10 171/182] platform/mellanox: mlxreg-lc: Fix - cleanup on failure and add more verbosity in error flow - -Clean client object in case of probing failure. -Prevent running remove routine in case probing failed. -Add error log for each kind of failures during probing. - -Fixes: 62f9529b8d5c ("platform/mellanox: mlxreg-lc: Add initial support for Nvidia line card devices") -Signed-off-by: Vadim Pasternak ---- - drivers/platform/mellanox/mlxreg-lc.c | 85 ++++++++++++++++++++------- - 1 file changed, 63 insertions(+), 22 deletions(-) - -diff --git a/drivers/platform/mellanox/mlxreg-lc.c b/drivers/platform/mellanox/mlxreg-lc.c -index 75c28179dd07..e3caccb1a528 100644 ---- a/drivers/platform/mellanox/mlxreg-lc.c -+++ b/drivers/platform/mellanox/mlxreg-lc.c -@@ -569,9 +569,6 @@ static int mlxreg_lc_event_handler(void *handle, enum mlxreg_hotplug_kind kind, - dev_info(mlxreg_lc->dev, "linecard#%d state %d event kind %d action %d\n", - mlxreg_lc->data->slot, mlxreg_lc->state, kind, action); - -- if (!(mlxreg_lc->state & MLXREG_LC_INITIALIZED)) -- return 0; -- - switch (kind) { - case MLXREG_HOTPLUG_LC_SYNCED: - /* -@@ -725,8 +722,12 @@ mlxreg_lc_config_init(struct mlxreg_lc *mlxreg_lc, void *regmap, - switch (regval) { - case MLXREG_LC_SN4800_C16: - err = mlxreg_lc_sn4800_c16_config_init(mlxreg_lc, regmap, data); -- if (err) -+ if (err) { -+ dev_err(dev, "Failed to config client %s at bus %d at addr 0x%02x\n", -+ data->hpdev.brdinfo->type, data->hpdev.nr, -+ data->hpdev.brdinfo->addr); - return err; -+ } - break; - default: - return -ENODEV; -@@ -739,8 +740,11 @@ mlxreg_lc_config_init(struct mlxreg_lc *mlxreg_lc, void *regmap, - mlxreg_lc->mux = platform_device_register_resndata(dev, "i2c-mux-mlxcpld", data->hpdev.nr, - NULL, 0, mlxreg_lc->mux_data, - sizeof(*mlxreg_lc->mux_data)); -- if (IS_ERR(mlxreg_lc->mux)) -+ if (IS_ERR(mlxreg_lc->mux)) { -+ dev_err(dev, "Failed to create mux infra for client %s at bus %d at addr 0x%02x\n", -+ data->hpdev.brdinfo->type, data->hpdev.nr, data->hpdev.brdinfo->addr); - return PTR_ERR(mlxreg_lc->mux); -+ } - - /* Register IO access driver. */ - if (mlxreg_lc->io_data) { -@@ -749,6 +753,9 @@ mlxreg_lc_config_init(struct mlxreg_lc *mlxreg_lc, void *regmap, - platform_device_register_resndata(dev, "mlxreg-io", data->hpdev.nr, NULL, 0, - mlxreg_lc->io_data, sizeof(*mlxreg_lc->io_data)); - if (IS_ERR(mlxreg_lc->io_regs)) { -+ dev_err(dev, "Failed to create regio for client %s at bus %d at addr 0x%02x\n", -+ data->hpdev.brdinfo->type, data->hpdev.nr, -+ data->hpdev.brdinfo->addr); - err = PTR_ERR(mlxreg_lc->io_regs); - goto fail_register_io; - } -@@ -762,6 +769,9 @@ mlxreg_lc_config_init(struct mlxreg_lc *mlxreg_lc, void *regmap, - mlxreg_lc->led_data, - sizeof(*mlxreg_lc->led_data)); - if (IS_ERR(mlxreg_lc->led)) { -+ dev_err(dev, "Failed to create LED objects for client %s at bus %d at addr 0x%02x\n", -+ data->hpdev.brdinfo->type, data->hpdev.nr, -+ data->hpdev.brdinfo->addr); - err = PTR_ERR(mlxreg_lc->led); - goto fail_register_led; - } -@@ -818,7 +828,8 @@ static int mlxreg_lc_probe(struct platform_device *pdev) - if (!data->hpdev.adapter) { - dev_err(&pdev->dev, "Failed to get adapter for bus %d\n", - data->hpdev.nr); -- return -EFAULT; -+ err = -EFAULT; -+ goto i2c_get_adapter_fail; - } - - /* Create device at the top of line card I2C tree.*/ -@@ -827,32 +838,40 @@ static int mlxreg_lc_probe(struct platform_device *pdev) - if (IS_ERR(data->hpdev.client)) { - dev_err(&pdev->dev, "Failed to create client %s at bus %d at addr 0x%02x\n", - data->hpdev.brdinfo->type, data->hpdev.nr, data->hpdev.brdinfo->addr); -- -- i2c_put_adapter(data->hpdev.adapter); -- data->hpdev.adapter = NULL; -- return PTR_ERR(data->hpdev.client); -+ err = PTR_ERR(data->hpdev.client); -+ goto i2c_new_device_fail; - } - - regmap = devm_regmap_init_i2c(data->hpdev.client, - &mlxreg_lc_regmap_conf); - if (IS_ERR(regmap)) { -+ dev_err(&pdev->dev, "Failed to create regmap for client %s at bus %d at addr 0x%02x\n", -+ data->hpdev.brdinfo->type, data->hpdev.nr, data->hpdev.brdinfo->addr); - err = PTR_ERR(regmap); -- goto mlxreg_lc_probe_fail; -+ goto devm_regmap_init_i2c_fail; - } - - /* Set default registers. */ - for (i = 0; i < mlxreg_lc_regmap_conf.num_reg_defaults; i++) { - err = regmap_write(regmap, mlxreg_lc_regmap_default[i].reg, - mlxreg_lc_regmap_default[i].def); -- if (err) -- goto mlxreg_lc_probe_fail; -+ if (err) { -+ dev_err(&pdev->dev, "Failed to set default regmap %d for client %s at bus %d at addr 0x%02x\n", -+ i, data->hpdev.brdinfo->type, data->hpdev.nr, -+ data->hpdev.brdinfo->addr); -+ goto regmap_write_fail; -+ } - } - - /* Sync registers with hardware. */ - regcache_mark_dirty(regmap); - err = regcache_sync(regmap); -- if (err) -- goto mlxreg_lc_probe_fail; -+ if (err) { -+ dev_err(&pdev->dev, "Failed to sync regmap for client %s at bus %d at addr 0x%02x\n", -+ data->hpdev.brdinfo->type, data->hpdev.nr, data->hpdev.brdinfo->addr); -+ err = PTR_ERR(regmap); -+ goto regcache_sync_fail; -+ } - - par_pdata = data->hpdev.brdinfo->platform_data; - mlxreg_lc->par_regmap = par_pdata->regmap; -@@ -863,12 +882,27 @@ static int mlxreg_lc_probe(struct platform_device *pdev) - /* Configure line card. */ - err = mlxreg_lc_config_init(mlxreg_lc, regmap, data); - if (err) -- goto mlxreg_lc_probe_fail; -+ goto mlxreg_lc_config_init_fail; - - return err; - --mlxreg_lc_probe_fail: -+mlxreg_lc_config_init_fail: -+regcache_sync_fail: -+regmap_write_fail: -+devm_regmap_init_i2c_fail: -+ if (data->hpdev.client) { -+ i2c_unregister_device(data->hpdev.client); -+ data->hpdev.client = NULL; -+ } -+i2c_new_device_fail: - i2c_put_adapter(data->hpdev.adapter); -+ data->hpdev.adapter = NULL; -+i2c_get_adapter_fail: -+ /* Clear event notification callback and handle. */ -+ if (data->notifier) { -+ data->notifier->user_handler = NULL; -+ data->notifier->handle = NULL; -+ } - return err; - } - -@@ -877,11 +911,18 @@ static int mlxreg_lc_remove(struct platform_device *pdev) - struct mlxreg_core_data *data = dev_get_platdata(&pdev->dev); - struct mlxreg_lc *mlxreg_lc = platform_get_drvdata(pdev); - -- /* Clear event notification callback. */ -- if (data->notifier) { -- data->notifier->user_handler = NULL; -- data->notifier->handle = NULL; -- } -+ /* -+ * Probing and removing are invoked by hotplug events raised on line card insertion and -+ * removing. If probing procedure fails all data is cleared. However, hotplug event still -+ * will be raised on line card removing and activate removing procedure. In this case there -+ * is nothing to remove. -+ */ -+ if (!data->notifier || !data->notifier->handle) -+ return 0; -+ -+ /* Clear event notification callback and handle. */ -+ data->notifier->user_handler = NULL; -+ data->notifier->handle = NULL; - - /* Destroy static I2C device feeding by main power. */ - mlxreg_lc_destroy_static_devices(mlxreg_lc, mlxreg_lc->main_devs, --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0174-DS-mlxsw-core_linecards-Skip-devlink-and-provisionin.patch b/platform/mellanox/non-upstream-patches/patches/0174-DS-mlxsw-core_linecards-Skip-devlink-and-provisionin.patch deleted file mode 100644 index 6c0b43981373..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0174-DS-mlxsw-core_linecards-Skip-devlink-and-provisionin.patch +++ /dev/null @@ -1,93 +0,0 @@ -From 8b0f2061c6f8d799b7da9b7f50edb18208e67bb8 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Fri, 22 Jul 2022 01:15:43 +0300 -Subject: [PATCH backport 5.10 174/182] DS: mlxsw: core_linecards: Skip devlink - and provisioning operation - -Do not execute provisioning / unprovisioning flow in not upstream -environment. - -Signed-off-by: Vadim Pasternak ---- - .../net/ethernet/mellanox/mlxsw/core_linecards.c | 13 +++++++++++++ - 1 file changed, 13 insertions(+) - -diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c b/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c -index 3a2fdd22dc21..30665a6f3e4d 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c -@@ -651,8 +651,11 @@ mlxsw_linecard_provision_set(struct mlxsw_core *mlxsw_core, - linecard); - if (err) - goto err_cbs_call; -+ - linecard->provisioned = true; -+#if 0 - devlink_linecard_provision_set(linecard->devlink_linecard, type); -+#endif - return 0; - - err_cbs_call: -@@ -670,12 +673,15 @@ static void mlxsw_linecard_provision_clear(struct mlxsw_core *mlxsw_core, - linecard); - mlxsw_linecard_devices_detach(linecard->linecards->mlxsw_core, - linecard); -+#if 0 - devlink_linecard_provision_clear(linecard->devlink_linecard); -+#endif - } - - static int mlxsw_linecard_ready_set(struct mlxsw_core *mlxsw_core, - struct mlxsw_linecard *linecard) - { -+#if 0 - char mddc_pl[MLXSW_REG_MDDC_LEN]; - int err; - -@@ -683,6 +689,7 @@ static int mlxsw_linecard_ready_set(struct mlxsw_core *mlxsw_core, - err = mlxsw_reg_write(mlxsw_core, MLXSW_REG(mddc), mddc_pl); - if (err) - return err; -+#endif - linecard->ready = true; - return 0; - } -@@ -690,6 +697,7 @@ static int mlxsw_linecard_ready_set(struct mlxsw_core *mlxsw_core, - static int mlxsw_linecard_ready_clear(struct mlxsw_core *mlxsw_core, - struct mlxsw_linecard *linecard) - { -+#if 0 - char mddc_pl[MLXSW_REG_MDDC_LEN]; - int err; - -@@ -697,6 +705,7 @@ static int mlxsw_linecard_ready_clear(struct mlxsw_core *mlxsw_core, - err = mlxsw_reg_write(mlxsw_core, MLXSW_REG(mddc), mddc_pl); - if (err) - return err; -+#endif - linecard->ready = false; - return 0; - } -@@ -722,7 +731,9 @@ static int mlxsw_linecard_active_set(struct mlxsw_core *mlxsw_core, - item->event_ops->got_active(mlxsw_core, linecard->slot_index, - linecard, item->priv); - } -+#if 0 - devlink_linecard_activate(linecard->devlink_linecard); -+#endif - return 0; - } - -@@ -739,7 +750,9 @@ static void mlxsw_linecard_active_clear(struct mlxsw_core *mlxsw_core, - item->event_ops->got_inactive(mlxsw_core, linecard->slot_index, - linecard, item->priv); - } -+#if 0 - devlink_linecard_deactivate(linecard->devlink_linecard); -+#endif - } - - static int __mlxsw_linecard_status_process(struct mlxsw_core *mlxsw_core, --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0181-Revert-Fix-out-of-bounds-memory-accesses-in-thermal.patch b/platform/mellanox/non-upstream-patches/patches/0181-Revert-Fix-out-of-bounds-memory-accesses-in-thermal.patch deleted file mode 100644 index 9580965684e0..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0181-Revert-Fix-out-of-bounds-memory-accesses-in-thermal.patch +++ /dev/null @@ -1,99 +0,0 @@ -From f2dffe0f83a05dfbf0190316f0d260f7d7ff76a8 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Mon, 23 Jan 2023 21:38:24 +0200 -Subject: [PATCH backport 5.10 181/182] Revert "mlxsw: thermal: Fix - out-of-bounds memory accesses" - -This reverts commit e59d839743b50cb1d3f42a786bea48cc5621d254. ---- - .../ethernet/mellanox/mlxsw/core_thermal.c | 52 +++++++++++++++++-- - 1 file changed, 47 insertions(+), 5 deletions(-) - -diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c -index 529108aea3c6..88a2f63c8839 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c -@@ -23,8 +23,16 @@ - #define MLXSW_THERMAL_MODULE_TEMP_SHIFT (MLXSW_THERMAL_HYSTERESIS_TEMP * 2) - #define MLXSW_THERMAL_TEMP_SCORE_MAX GENMASK(31, 0) - #define MLXSW_THERMAL_MAX_STATE 10 --#define MLXSW_THERMAL_MIN_STATE 2 - #define MLXSW_THERMAL_MAX_DUTY 255 -+/* Minimum and maximum fan allowed speed in percent: from 20% to 100%. Values -+ * MLXSW_THERMAL_MAX_STATE + x, where x is between 2 and 10 are used for -+ * setting fan speed dynamic minimum. For example, if value is set to 14 (40%) -+ * cooling levels vector will be set to 4, 4, 4, 4, 4, 5, 6, 7, 8, 9, 10 to -+ * introduce PWM speed in percent: 40, 40, 40, 40, 40, 50, 60. 70, 80, 90, 100. -+ */ -+#define MLXSW_THERMAL_SPEED_MIN (MLXSW_THERMAL_MAX_STATE + 2) -+#define MLXSW_THERMAL_SPEED_MAX (MLXSW_THERMAL_MAX_STATE * 2) -+#define MLXSW_THERMAL_SPEED_MIN_LEVEL 2 /* 20% */ - - /* External cooling devices, allowed for binding to mlxsw thermal zones. */ - static char * const mlxsw_thermal_external_allowed_cdev[] = { -@@ -656,16 +664,49 @@ static int mlxsw_thermal_set_cur_state(struct thermal_cooling_device *cdev, - struct mlxsw_thermal *thermal = cdev->devdata; - struct device *dev = thermal->bus_info->dev; - char mfsc_pl[MLXSW_REG_MFSC_LEN]; -+ unsigned long cur_state, i; - int idx; -+ u8 duty; - int err; - -- if (state > MLXSW_THERMAL_MAX_STATE) -- return -EINVAL; -- - idx = mlxsw_get_cooling_device_idx(thermal, cdev); - if (idx < 0) - return idx; - -+ /* Verify if this request is for changing allowed fan dynamical -+ * minimum. If it is - update cooling levels accordingly and update -+ * state, if current state is below the newly requested minimum state. -+ * For example, if current state is 5, and minimal state is to be -+ * changed from 4 to 6, thermal->cooling_levels[0 to 5] will be changed -+ * all from 4 to 6. And state 5 (thermal->cooling_levels[4]) should be -+ * overwritten. -+ */ -+ if (state >= MLXSW_THERMAL_SPEED_MIN && -+ state <= MLXSW_THERMAL_SPEED_MAX) { -+ state -= MLXSW_THERMAL_MAX_STATE; -+ for (i = 0; i <= MLXSW_THERMAL_MAX_STATE; i++) -+ thermal->cooling_levels[i] = max(state, i); -+ -+ mlxsw_reg_mfsc_pack(mfsc_pl, idx, 0); -+ err = mlxsw_reg_query(thermal->core, MLXSW_REG(mfsc), mfsc_pl); -+ if (err) -+ return err; -+ -+ duty = mlxsw_reg_mfsc_pwm_duty_cycle_get(mfsc_pl); -+ cur_state = mlxsw_duty_to_state(duty); -+ -+ /* If current fan state is lower than requested dynamical -+ * minimum, increase fan speed up to dynamical minimum. -+ */ -+ if (state < cur_state) -+ return 0; -+ -+ state = cur_state; -+ } -+ -+ if (state > MLXSW_THERMAL_MAX_STATE) -+ return -EINVAL; -+ - /* Normalize the state to the valid speed range. */ - state = thermal->cooling_levels[state]; - mlxsw_reg_mfsc_pack(mfsc_pl, idx, mlxsw_state_to_duty(state)); -@@ -1143,7 +1184,8 @@ int mlxsw_thermal_init(struct mlxsw_core *core, - - /* Initialize cooling levels per PWM state. */ - for (i = 0; i < MLXSW_THERMAL_MAX_STATE; i++) -- thermal->cooling_levels[i] = max(MLXSW_THERMAL_MIN_STATE, i); -+ thermal->cooling_levels[i] = max(MLXSW_THERMAL_SPEED_MIN_LEVEL, -+ i); - - thermal->polling_delay = bus_info->low_frequency ? - MLXSW_THERMAL_SLOW_POLL_INT : --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0200-dt-bindings-i2c-mellanox-i2c-mlxbf-convert-txt-to-YA.patch b/platform/mellanox/non-upstream-patches/patches/0200-dt-bindings-i2c-mellanox-i2c-mlxbf-convert-txt-to-YA.patch deleted file mode 100644 index 48fb3ea22063..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0200-dt-bindings-i2c-mellanox-i2c-mlxbf-convert-txt-to-YA.patch +++ /dev/null @@ -1,169 +0,0 @@ -From d10a96f08067a214b2de469b406155d6604930f2 Mon Sep 17 00:00:00 2001 -From: Khalil Blaiech -Date: Fri, 20 Nov 2020 18:06:06 -0500 -Subject: [PATCH backport 5.10 01/63] dt-bindings: i2c: mellanox,i2c-mlxbf: - convert txt to YAML schema - -Write the devicetree binding text file associated with -the Mellanox BlueField I2C controller in schema file, -JSON compatible subset of YAML. Besides, add an entry -within MAINTAINERS file. - -Signed-off-by: Khalil Blaiech -Reviewed-by: Rob Herring -Signed-off-by: Wolfram Sang ---- - .../bindings/i2c/mellanox,i2c-mlxbf.txt | 42 ---------- - .../bindings/i2c/mellanox,i2c-mlxbf.yaml | 78 +++++++++++++++++++ - MAINTAINERS | 1 + - 3 files changed, 79 insertions(+), 42 deletions(-) - delete mode 100644 Documentation/devicetree/bindings/i2c/mellanox,i2c-mlxbf.txt - create mode 100644 Documentation/devicetree/bindings/i2c/mellanox,i2c-mlxbf.yaml - -diff --git a/Documentation/devicetree/bindings/i2c/mellanox,i2c-mlxbf.txt b/Documentation/devicetree/bindings/i2c/mellanox,i2c-mlxbf.txt -deleted file mode 100644 -index 566ea861a..000000000 ---- a/Documentation/devicetree/bindings/i2c/mellanox,i2c-mlxbf.txt -+++ /dev/null -@@ -1,42 +0,0 @@ --Device tree configuration for the Mellanox I2C SMBus on BlueField SoCs -- --Required Properties: -- --- compatible : should be "mellanox,i2c-mlxbf1" or "mellanox,i2c-mlxbf2". -- --- reg : address offset and length of the device registers. The -- registers consist of the following set of resources: -- 1) Smbus block registers. -- 2) Cause master registers. -- 3) Cause slave registers. -- 4) Cause coalesce registers (if compatible isn't set -- to "mellanox,i2c-mlxbf1"). -- --- interrupts : interrupt number. -- --Optional Properties: -- --- clock-frequency : bus frequency used to configure timing registers; -- allowed values are 100000, 400000 and 1000000; -- those are expressed in Hz. Default is 100000. -- --Example: -- --i2c@2804000 { -- compatible = "mellanox,i2c-mlxbf1"; -- reg = <0x02804000 0x800>, -- <0x02801200 0x020>, -- <0x02801260 0x020>; -- interrupts = <57>; -- clock-frequency = <100000>; --}; -- --i2c@2808800 { -- compatible = "mellanox,i2c-mlxbf2"; -- reg = <0x02808800 0x600>, -- <0x02808e00 0x020>, -- <0x02808e20 0x020>, -- <0x02808e40 0x010>; -- interrupts = <57>; -- clock-frequency = <400000>; --}; -diff --git a/Documentation/devicetree/bindings/i2c/mellanox,i2c-mlxbf.yaml b/Documentation/devicetree/bindings/i2c/mellanox,i2c-mlxbf.yaml -new file mode 100644 -index 000000000..d2b401d06 ---- /dev/null -+++ b/Documentation/devicetree/bindings/i2c/mellanox,i2c-mlxbf.yaml -@@ -0,0 +1,78 @@ -+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -+%YAML 1.2 -+--- -+$id: http://devicetree.org/schemas/i2c/mellanox,i2c-mlxbf.yaml# -+$schema: http://devicetree.org/meta-schemas/core.yaml# -+ -+title: Mellanox I2C SMBus on BlueField SoCs -+ -+maintainers: -+ - Khalil Blaiech -+ -+allOf: -+ - $ref: /schemas/i2c/i2c-controller.yaml# -+ -+properties: -+ compatible: -+ enum: -+ - mellanox,i2c-mlxbf1 -+ - mellanox,i2c-mlxbf2 -+ -+ reg: -+ minItems: 3 -+ maxItems: 4 -+ items: -+ - description: Smbus block registers -+ - description: Cause master registers -+ - description: Cause slave registers -+ - description: Cause coalesce registers -+ -+ interrupts: -+ maxItems: 1 -+ -+ clock-frequency: -+ enum: [ 100000, 400000, 1000000 ] -+ description: -+ bus frequency used to configure timing registers; -+ The frequency is expressed in Hz. Default is 100000. -+ -+required: -+ - compatible -+ - reg -+ - interrupts -+ -+unevaluatedProperties: false -+ -+if: -+ properties: -+ compatible: -+ contains: -+ enum: -+ - mellanox,i2c-mlxbf1 -+ -+then: -+ properties: -+ reg: -+ maxItems: 3 -+ -+examples: -+ - | -+ i2c@2804000 { -+ compatible = "mellanox,i2c-mlxbf1"; -+ reg = <0x02804000 0x800>, -+ <0x02801200 0x020>, -+ <0x02801260 0x020>; -+ interrupts = <57>; -+ clock-frequency = <100000>; -+ }; -+ -+ - | -+ i2c@2808800 { -+ compatible = "mellanox,i2c-mlxbf2"; -+ reg = <0x02808800 0x600>, -+ <0x02808e00 0x020>, -+ <0x02808e20 0x020>, -+ <0x02808e40 0x010>; -+ interrupts = <57>; -+ clock-frequency = <400000>; -+ }; -diff --git a/MAINTAINERS b/MAINTAINERS -index 4fef10dd2..7db3e06ec 100644 ---- a/MAINTAINERS -+++ b/MAINTAINERS -@@ -11177,6 +11177,7 @@ MELLANOX BLUEFIELD I2C DRIVER - M: Khalil Blaiech - L: linux-i2c@vger.kernel.org - S: Supported -+F: Documentation/devicetree/bindings/i2c/mellanox,i2c-mlxbf.yaml - F: drivers/i2c/busses/i2c-mlxbf.c - - MELLANOX ETHERNET DRIVER (mlx4_en) --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0203-i2c-mlxbf-remove-IRQF_ONESHOT.patch b/platform/mellanox/non-upstream-patches/patches/0203-i2c-mlxbf-remove-IRQF_ONESHOT.patch deleted file mode 100644 index 369776a08aa1..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0203-i2c-mlxbf-remove-IRQF_ONESHOT.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 9cd9614ce49f3c793efcc47dbbbfa90d793ed543 Mon Sep 17 00:00:00 2001 -From: Asmaa Mnebhi -Date: Thu, 8 Sep 2022 13:35:37 -0400 -Subject: [PATCH backport 5.10 04/63] i2c: mlxbf: remove IRQF_ONESHOT - -BugLink: https://bugs.launchpad.net/bugs/1991551 - -IRQF_ONESHOT is not needed so remove it. - -Reviewed-by: Khalil Blaiech -Signed-off-by: Asmaa Mnebhi -Signed-off-by: Wolfram Sang -(cherry picked from commit 92be2c122e495f0249090c0048f4fd05fe1efa9e) -Signed-off-by: Asmaa Mnebhi -Acked-by: Tim Gardner -Acked-by: Bartlomiej Zolnierkiewicz -Signed-off-by: Bartlomiej Zolnierkiewicz ---- - drivers/i2c/busses/i2c-mlxbf.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/i2c/busses/i2c-mlxbf.c b/drivers/i2c/busses/i2c-mlxbf.c -index d78fb24d5..066bfeb8a 100644 ---- a/drivers/i2c/busses/i2c-mlxbf.c -+++ b/drivers/i2c/busses/i2c-mlxbf.c -@@ -2382,7 +2382,7 @@ static int mlxbf_i2c_probe(struct platform_device *pdev) - if (irq < 0) - return irq; - ret = devm_request_irq(dev, irq, mlxbf_smbus_irq, -- IRQF_ONESHOT | IRQF_SHARED | IRQF_PROBE_SHARED, -+ IRQF_SHARED | IRQF_PROBE_SHARED, - dev_name(dev), priv); - if (ret < 0) { - dev_err(dev, "Cannot get irq %d\n", irq); --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0206-i2c-mlxbf-add-multi-slave-functionality.patch b/platform/mellanox/non-upstream-patches/patches/0206-i2c-mlxbf-add-multi-slave-functionality.patch deleted file mode 100644 index a940755c9785..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0206-i2c-mlxbf-add-multi-slave-functionality.patch +++ /dev/null @@ -1,549 +0,0 @@ -From 19c72b4450f4f76cec6030c2eabb87507a90f316 Mon Sep 17 00:00:00 2001 -From: Asmaa Mnebhi -Date: Mon, 26 Sep 2022 15:45:05 -0400 -Subject: [PATCH backport 5.10 07/63] i2c: mlxbf: add multi slave functionality - -BugLink: https://bugs.launchpad.net/bugs/1991551 - -Support the multi slave functionality which enables the BlueField -to be registered at up to 16 i2c slave addresses. - -Reviewed-by: Khalil Blaiech -Signed-off-by: Asmaa Mnebhi -Signed-off-by: Wolfram Sang -(cherry picked from commit bdc4af281b70b7fe2881fd08f1aa1b15f2b6adf0) -Signed-off-by: Asmaa Mnebhi -Acked-by: Tim Gardner -Acked-by: Bartlomiej Zolnierkiewicz -Signed-off-by: Bartlomiej Zolnierkiewicz ---- - drivers/i2c/busses/i2c-mlxbf.c | 320 +++++++++++++++------------------ - 1 file changed, 149 insertions(+), 171 deletions(-) - -diff --git a/drivers/i2c/busses/i2c-mlxbf.c b/drivers/i2c/busses/i2c-mlxbf.c -index 30b798e92..32dbe1dab 100644 ---- a/drivers/i2c/busses/i2c-mlxbf.c -+++ b/drivers/i2c/busses/i2c-mlxbf.c -@@ -304,9 +304,6 @@ static u64 mlxbf_i2c_corepll_frequency; - #define MLXBF_I2C_SMBUS_SLAVE_ADDR_EN_BIT 7 - #define MLXBF_I2C_SMBUS_SLAVE_ADDR_MASK GENMASK(6, 0) - --#define MLXBF_I2C_SLAVE_ADDR_ENABLED(addr) \ -- ((addr) & (1 << MLXBF_I2C_SMBUS_SLAVE_ADDR_EN_BIT)) -- - /* - * Timeout is given in microsends. Note also that timeout handling is not - * exact. -@@ -432,7 +429,7 @@ struct mlxbf_i2c_priv { - u64 frequency; /* Core frequency in Hz. */ - int bus; /* Physical bus identifier. */ - int irq; -- struct i2c_client *slave; -+ struct i2c_client *slave[MLXBF_I2C_SMBUS_SLAVE_ADDR_CNT]; - }; - - static struct mlxbf_i2c_resource mlxbf_i2c_coalesce_res[] = { -@@ -1549,25 +1546,23 @@ static int mlxbf_i2c_calculate_corepll_freq(struct platform_device *pdev, - return 0; - } - --static int mlxbf_slave_enable(struct mlxbf_i2c_priv *priv, u8 addr) -+static int mlxbf_i2c_slave_enable(struct mlxbf_i2c_priv *priv, -+ struct i2c_client *slave) - { -- u32 slave_reg, slave_reg_tmp, slave_reg_avail, slave_addr_mask; -- u8 reg, reg_cnt, byte, addr_tmp, reg_avail, byte_avail; -- bool avail, disabled; -- -- disabled = false; -- avail = false; -+ u8 reg, reg_cnt, byte, addr_tmp; -+ u32 slave_reg, slave_reg_tmp; - - if (!priv) - return -EPERM; - - reg_cnt = MLXBF_I2C_SMBUS_SLAVE_ADDR_CNT >> 2; -- slave_addr_mask = MLXBF_I2C_SMBUS_SLAVE_ADDR_MASK; - - /* - * Read the slave registers. There are 4 * 32-bit slave registers. -- * Each slave register can hold up to 4 * 8-bit slave configuration -- * (7-bit address, 1 status bit (1 if enabled, 0 if not)). -+ * Each slave register can hold up to 4 * 8-bit slave configuration: -+ * 1) A 7-bit address -+ * 2) And a status bit (1 if enabled, 0 if not). -+ * Look for the next available slave register slot. - */ - for (reg = 0; reg < reg_cnt; reg++) { - slave_reg = readl(priv->smbus->io + -@@ -1582,121 +1577,87 @@ static int mlxbf_slave_enable(struct mlxbf_i2c_priv *priv, u8 addr) - addr_tmp = slave_reg_tmp & GENMASK(7, 0); - - /* -- * Mark the first available slave address slot, i.e. its -- * enabled bit should be unset. This slot might be used -- * later on to register our slave. -- */ -- if (!avail && !MLXBF_I2C_SLAVE_ADDR_ENABLED(addr_tmp)) { -- avail = true; -- reg_avail = reg; -- byte_avail = byte; -- slave_reg_avail = slave_reg; -- } -- -- /* -- * Parse slave address bytes and check whether the -- * slave address already exists and it's enabled, -- * i.e. most significant bit is set. -+ * If an enable bit is not set in the -+ * MLXBF_I2C_SMBUS_SLAVE_ADDR_CFG register, then the -+ * slave address slot associated with that bit is -+ * free. So set the enable bit and write the -+ * slave address bits. - */ -- if ((addr_tmp & slave_addr_mask) == addr) { -- if (MLXBF_I2C_SLAVE_ADDR_ENABLED(addr_tmp)) -- return 0; -- disabled = true; -- break; -+ if (!(addr_tmp & MLXBF_I2C_SMBUS_SLAVE_ADDR_EN_BIT)) { -+ slave_reg &= ~(MLXBF_I2C_SMBUS_SLAVE_ADDR_MASK << (byte * 8)); -+ slave_reg |= (slave->addr << (byte * 8)); -+ slave_reg |= MLXBF_I2C_SMBUS_SLAVE_ADDR_EN_BIT << (byte * 8); -+ writel(slave_reg, priv->smbus->io + -+ MLXBF_I2C_SMBUS_SLAVE_ADDR_CFG + -+ (reg * 0x4)); -+ -+ /* -+ * Set the slave at the corresponding index. -+ */ -+ priv->slave[(reg * 4) + byte] = slave; -+ -+ return 0; - } - - /* Parse next byte. */ - slave_reg_tmp >>= 8; - } -- -- /* Exit the loop if the slave address is found. */ -- if (disabled) -- break; - } - -- if (!avail && !disabled) -- return -EINVAL; /* No room for a new slave address. */ -- -- if (avail && !disabled) { -- reg = reg_avail; -- byte = byte_avail; -- /* Set the slave address. */ -- slave_reg_avail &= ~(slave_addr_mask << (byte * 8)); -- slave_reg_avail |= addr << (byte * 8); -- slave_reg = slave_reg_avail; -- } -- -- /* Enable the slave address and update the register. */ -- slave_reg |= (1 << MLXBF_I2C_SMBUS_SLAVE_ADDR_EN_BIT) << (byte * 8); -- writel(slave_reg, priv->smbus->io + MLXBF_I2C_SMBUS_SLAVE_ADDR_CFG + -- reg * 0x4); -- -- return 0; -+ return -EBUSY; - } - --static int mlxbf_slave_disable(struct mlxbf_i2c_priv *priv) -+static int mlxbf_i2c_slave_disable(struct mlxbf_i2c_priv *priv, u8 addr) - { -- u32 slave_reg, slave_reg_tmp, slave_addr_mask; -- u8 addr, addr_tmp, reg, reg_cnt, slave_byte; -- struct i2c_client *client = priv->slave; -- bool exist; -+ u8 addr_tmp, reg, reg_cnt, byte; -+ u32 slave_reg, slave_reg_tmp; - -- exist = false; -- -- addr = client->addr; - reg_cnt = MLXBF_I2C_SMBUS_SLAVE_ADDR_CNT >> 2; -- slave_addr_mask = MLXBF_I2C_SMBUS_SLAVE_ADDR_MASK; - - /* - * Read the slave registers. There are 4 * 32-bit slave registers. -- * Each slave register can hold up to 4 * 8-bit slave configuration -- * (7-bit address, 1 status bit (1 if enabled, 0 if not)). -+ * Each slave register can hold up to 4 * 8-bit slave configuration: -+ * 1) A 7-bit address -+ * 2) And a status bit (1 if enabled, 0 if not). -+ * Check if addr is present in the registers. - */ - for (reg = 0; reg < reg_cnt; reg++) { - slave_reg = readl(priv->smbus->io + - MLXBF_I2C_SMBUS_SLAVE_ADDR_CFG + reg * 0x4); - - /* Check whether the address slots are empty. */ -- if (slave_reg == 0) -+ if (!slave_reg) - continue; - - /* -- * Each register holds 4 slave addresses. So, we have to keep -- * the byte order consistent with the value read in order to -- * update the register correctly, if needed. -+ * Check if addr matches any of the 4 slave addresses -+ * in the register. - */ - slave_reg_tmp = slave_reg; -- slave_byte = 0; -- while (slave_reg_tmp != 0) { -- addr_tmp = slave_reg_tmp & slave_addr_mask; -+ for (byte = 0; byte < 4; byte++) { -+ addr_tmp = slave_reg_tmp & MLXBF_I2C_SMBUS_SLAVE_ADDR_MASK; - /* - * Parse slave address bytes and check whether the - * slave address already exists. - */ - if (addr_tmp == addr) { -- exist = true; -- break; -+ /* Clear the slave address slot. */ -+ slave_reg &= ~(GENMASK(7, 0) << (byte * 8)); -+ writel(slave_reg, priv->smbus->io + -+ MLXBF_I2C_SMBUS_SLAVE_ADDR_CFG + -+ (reg * 0x4)); -+ /* Free slave at the corresponding index */ -+ priv->slave[(reg * 4) + byte] = NULL; -+ -+ return 0; - } - - /* Parse next byte. */ - slave_reg_tmp >>= 8; -- slave_byte += 1; - } -- -- /* Exit the loop if the slave address is found. */ -- if (exist) -- break; - } - -- if (!exist) -- return 0; /* Slave is not registered, nothing to do. */ -- -- /* Cleanup the slave address slot. */ -- slave_reg &= ~(GENMASK(7, 0) << (slave_byte * 8)); -- writel(slave_reg, priv->smbus->io + MLXBF_I2C_SMBUS_SLAVE_ADDR_CFG + -- reg * 0x4); -- -- return 0; -+ return -ENXIO; - } - - static int mlxbf_i2c_init_coalesce(struct platform_device *pdev, -@@ -1858,72 +1819,81 @@ static bool mlxbf_smbus_slave_wait_for_idle(struct mlxbf_i2c_priv *priv, - return false; - } - --/* Send byte to 'external' smbus master. */ --static int mlxbf_smbus_irq_send(struct mlxbf_i2c_priv *priv, u8 recv_bytes) -+static struct i2c_client *mlxbf_i2c_get_slave_from_addr( -+ struct mlxbf_i2c_priv *priv, u8 addr) - { -- u8 data_desc[MLXBF_I2C_SLAVE_DATA_DESC_SIZE] = { 0 }; -- u8 write_size, pec_en, addr, byte, value, byte_cnt, desc_size; -- struct i2c_client *slave = priv->slave; -- u32 control32, data32; -- int ret; -+ int i; - -- if (!slave) -- return -EINVAL; -+ for (i = 0; i < MLXBF_I2C_SMBUS_SLAVE_ADDR_CNT; i++) { -+ if (!priv->slave[i]) -+ continue; - -- addr = 0; -- byte = 0; -- desc_size = MLXBF_I2C_SLAVE_DATA_DESC_SIZE; -+ if (priv->slave[i]->addr == addr) -+ return priv->slave[i]; -+ } -+ -+ return NULL; -+} -+ -+/* -+ * Send byte to 'external' smbus master. This function is executed when -+ * an external smbus master wants to read data from the BlueField. -+ */ -+static int mlxbf_i2c_irq_send(struct mlxbf_i2c_priv *priv, u8 recv_bytes) -+{ -+ u8 data_desc[MLXBF_I2C_SLAVE_DATA_DESC_SIZE] = { 0 }; -+ u8 write_size, pec_en, addr, value, byte_cnt; -+ struct i2c_client *slave; -+ u32 control32, data32; -+ int ret = 0; - - /* -- * Read bytes received from the external master. These bytes should -- * be located in the first data descriptor register of the slave GW. -- * These bytes are the slave address byte and the internal register -- * address, if supplied. -+ * Read the first byte received from the external master to -+ * determine the slave address. This byte is located in the -+ * first data descriptor register of the slave GW. - */ -- if (recv_bytes > 0) { -- data32 = ioread32be(priv->smbus->io + -- MLXBF_I2C_SLAVE_DATA_DESC_ADDR); -- -- /* Parse the received bytes. */ -- switch (recv_bytes) { -- case 2: -- byte = (data32 >> 8) & GENMASK(7, 0); -- fallthrough; -- case 1: -- addr = (data32 & GENMASK(7, 0)) >> 1; -- } -+ data32 = ioread32be(priv->smbus->io + -+ MLXBF_I2C_SLAVE_DATA_DESC_ADDR); -+ addr = (data32 & GENMASK(7, 0)) >> 1; - -- /* Check whether it's our slave address. */ -- if (slave->addr != addr) -- return -EINVAL; -+ /* -+ * Check if the slave address received in the data descriptor register -+ * matches any of the slave addresses registered. If there is a match, -+ * set the slave. -+ */ -+ slave = mlxbf_i2c_get_slave_from_addr(priv, addr); -+ if (!slave) { -+ ret = -ENXIO; -+ goto clear_csr; - } - - /* -- * I2C read transactions may start by a WRITE followed by a READ. -- * Indeed, most slave devices would expect the internal address -- * following the slave address byte. So, write that byte first, -- * and then, send the requested data bytes to the master. -+ * An I2C read can consist of a WRITE bit transaction followed by -+ * a READ bit transaction. Indeed, slave devices often expect -+ * the slave address to be followed by the internal address. -+ * So, write the internal address byte first, and then, send the -+ * requested data to the master. - */ - if (recv_bytes > 1) { - i2c_slave_event(slave, I2C_SLAVE_WRITE_REQUESTED, &value); -- value = byte; -+ value = (data32 >> 8) & GENMASK(7, 0); - ret = i2c_slave_event(slave, I2C_SLAVE_WRITE_RECEIVED, - &value); - i2c_slave_event(slave, I2C_SLAVE_STOP, &value); - - if (ret < 0) -- return ret; -+ goto clear_csr; - } - - /* -- * Now, send data to the master; currently, the driver supports -- * READ_BYTE, READ_WORD and BLOCK READ protocols. Note that the -- * hardware can send up to 128 bytes per transfer. That is the -- * size of its data registers. -+ * Send data to the master. Currently, the driver supports -+ * READ_BYTE, READ_WORD and BLOCK READ protocols. The -+ * hardware can send up to 128 bytes per transfer which is -+ * the total size of the data registers. - */ - i2c_slave_event(slave, I2C_SLAVE_READ_REQUESTED, &value); - -- for (byte_cnt = 0; byte_cnt < desc_size; byte_cnt++) { -+ for (byte_cnt = 0; byte_cnt < MLXBF_I2C_SLAVE_DATA_DESC_SIZE; byte_cnt++) { - data_desc[byte_cnt] = value; - i2c_slave_event(slave, I2C_SLAVE_READ_PROCESSED, &value); - } -@@ -1931,8 +1901,6 @@ static int mlxbf_smbus_irq_send(struct mlxbf_i2c_priv *priv, u8 recv_bytes) - /* Send a stop condition to the backend. */ - i2c_slave_event(slave, I2C_SLAVE_STOP, &value); - -- /* Handle the actual transfer. */ -- - /* Set the number of bytes to write to master. */ - write_size = (byte_cnt - 1) & 0x7f; - -@@ -1955,38 +1923,44 @@ static int mlxbf_smbus_irq_send(struct mlxbf_i2c_priv *priv, u8 recv_bytes) - */ - mlxbf_smbus_slave_wait_for_idle(priv, MLXBF_I2C_SMBUS_TIMEOUT); - -+clear_csr: - /* Release the Slave GW. */ - writel(0x0, priv->smbus->io + MLXBF_I2C_SMBUS_SLAVE_RS_MASTER_BYTES); - writel(0x0, priv->smbus->io + MLXBF_I2C_SMBUS_SLAVE_PEC); - writel(0x1, priv->smbus->io + MLXBF_I2C_SMBUS_SLAVE_READY); - -- return 0; -+ return ret; - } - --/* Receive bytes from 'external' smbus master. */ --static int mlxbf_smbus_irq_recv(struct mlxbf_i2c_priv *priv, u8 recv_bytes) -+/* -+ * Receive bytes from 'external' smbus master. This function is executed when -+ * an external smbus master wants to write data to the BlueField. -+ */ -+static int mlxbf_i2c_irq_recv(struct mlxbf_i2c_priv *priv, u8 recv_bytes) - { - u8 data_desc[MLXBF_I2C_SLAVE_DATA_DESC_SIZE] = { 0 }; -- struct i2c_client *slave = priv->slave; -+ struct i2c_client *slave; - u8 value, byte, addr; - int ret = 0; - -- if (!slave) -- return -EINVAL; -- - /* Read data from Slave GW data descriptor. */ - mlxbf_i2c_smbus_read_data(priv, data_desc, recv_bytes, - MLXBF_I2C_SLAVE_DATA_DESC_ADDR); -- -- /* Check whether its our slave address. */ - addr = data_desc[0] >> 1; -- if (slave->addr != addr) -- return -EINVAL; - - /* -- * Notify the slave backend; another I2C master wants to write data -- * to us. This event is sent once the slave address and the write bit -- * is detected. -+ * Check if the slave address received in the data descriptor register -+ * matches any of the slave addresses registered. -+ */ -+ slave = mlxbf_i2c_get_slave_from_addr(priv, addr); -+ if (!slave) { -+ ret = -EINVAL; -+ goto clear_csr; -+ } -+ -+ /* -+ * Notify the slave backend that an smbus master wants to write data -+ * to the BlueField. - */ - i2c_slave_event(slave, I2C_SLAVE_WRITE_REQUESTED, &value); - -@@ -1999,9 +1973,13 @@ static int mlxbf_smbus_irq_recv(struct mlxbf_i2c_priv *priv, u8 recv_bytes) - break; - } - -- /* Send a stop condition to the backend. */ -+ /* -+ * Send a stop event to the slave backend, to signal -+ * the end of the write transactions. -+ */ - i2c_slave_event(slave, I2C_SLAVE_STOP, &value); - -+clear_csr: - /* Release the Slave GW. */ - writel(0x0, priv->smbus->io + MLXBF_I2C_SMBUS_SLAVE_RS_MASTER_BYTES); - writel(0x0, priv->smbus->io + MLXBF_I2C_SMBUS_SLAVE_PEC); -@@ -2010,7 +1988,7 @@ static int mlxbf_smbus_irq_recv(struct mlxbf_i2c_priv *priv, u8 recv_bytes) - return ret; - } - --static irqreturn_t mlxbf_smbus_irq(int irq, void *ptr) -+static irqreturn_t mlxbf_i2c_irq(int irq, void *ptr) - { - struct mlxbf_i2c_priv *priv = ptr; - bool read, write, irq_is_set; -@@ -2058,9 +2036,9 @@ static irqreturn_t mlxbf_smbus_irq(int irq, void *ptr) - MLXBF_I2C_SLAVE_DATA_DESC_SIZE : recv_bytes; - - if (read) -- mlxbf_smbus_irq_send(priv, recv_bytes); -+ mlxbf_i2c_irq_send(priv, recv_bytes); - else -- mlxbf_smbus_irq_recv(priv, recv_bytes); -+ mlxbf_i2c_irq_recv(priv, recv_bytes); - - return IRQ_HANDLED; - } -@@ -2155,23 +2133,21 @@ static s32 mlxbf_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr, - static int mlxbf_i2c_reg_slave(struct i2c_client *slave) - { - struct mlxbf_i2c_priv *priv = i2c_get_adapdata(slave->adapter); -+ struct device *dev = &slave->dev; - int ret; - -- if (priv->slave) -- return -EBUSY; -- - /* - * Do not support ten bit chip address and do not use Packet Error - * Checking (PEC). - */ -- if (slave->flags & (I2C_CLIENT_TEN | I2C_CLIENT_PEC)) -+ if (slave->flags & (I2C_CLIENT_TEN | I2C_CLIENT_PEC)) { -+ dev_err(dev, "SMBus PEC and 10 bit address not supported\n"); - return -EAFNOSUPPORT; -+ } - -- ret = mlxbf_slave_enable(priv, slave->addr); -- if (ret < 0) -- return ret; -- -- priv->slave = slave; -+ ret = mlxbf_i2c_slave_enable(priv, slave); -+ if (ret) -+ dev_err(dev, "Surpassed max number of registered slaves allowed\n"); - - return 0; - } -@@ -2179,18 +2155,19 @@ static int mlxbf_i2c_reg_slave(struct i2c_client *slave) - static int mlxbf_i2c_unreg_slave(struct i2c_client *slave) - { - struct mlxbf_i2c_priv *priv = i2c_get_adapdata(slave->adapter); -+ struct device *dev = &slave->dev; - int ret; - -- WARN_ON(!priv->slave); -- -- /* Unregister slave, i.e. disable the slave address in hardware. */ -- ret = mlxbf_slave_disable(priv); -- if (ret < 0) -- return ret; -- -- priv->slave = NULL; -+ /* -+ * Unregister slave by: -+ * 1) Disabling the slave address in hardware -+ * 2) Freeing priv->slave at the corresponding index -+ */ -+ ret = mlxbf_i2c_slave_disable(priv, slave->addr); -+ if (ret) -+ dev_err(dev, "Unable to find slave 0x%x\n", slave->addr); - -- return 0; -+ return ret; - } - - static u32 mlxbf_i2c_functionality(struct i2c_adapter *adap) -@@ -2398,7 +2375,7 @@ static int mlxbf_i2c_probe(struct platform_device *pdev) - irq = platform_get_irq(pdev, 0); - if (irq < 0) - return irq; -- ret = devm_request_irq(dev, irq, mlxbf_smbus_irq, -+ ret = devm_request_irq(dev, irq, mlxbf_i2c_irq, - IRQF_SHARED | IRQF_PROBE_SHARED, - dev_name(dev), priv); - if (ret < 0) { -@@ -2493,4 +2470,5 @@ module_exit(mlxbf_i2c_exit); - - MODULE_DESCRIPTION("Mellanox BlueField I2C bus driver"); - MODULE_AUTHOR("Khalil Blaiech "); -+MODULE_AUTHOR("Asmaa Mnebhi "); - MODULE_LICENSE("GPL v2"); --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0207-i2c-mlxbf-support-BlueField-3-SoC.patch b/platform/mellanox/non-upstream-patches/patches/0207-i2c-mlxbf-support-BlueField-3-SoC.patch deleted file mode 100644 index e31600265607..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0207-i2c-mlxbf-support-BlueField-3-SoC.patch +++ /dev/null @@ -1,967 +0,0 @@ -From 047991847c5ab4bc9763bb111f05bde863dac8b3 Mon Sep 17 00:00:00 2001 -From: Asmaa Mnebhi -Date: Tue, 27 Sep 2022 16:39:23 -0400 -Subject: [PATCH backport 5.10 08/63] i2c: mlxbf: support BlueField-3 SoC - -BugLink: https://bugs.launchpad.net/bugs/1991551 - -BlueField-3 SoC has the same I2C IP logic as previous -BlueField-1 and 2 SoCs but it has different registers' addresses. -This is an effort to keep this driver generic across all -BlueField generations. -This patch breaks down the "smbus" resource into 3 separate -resources to enable us to use common registers' offsets for all -BlueField SoCs: -struct mlxbf_i2c_resource *timer; -struct mlxbf_i2c_resource *mst; -struct mlxbf_i2c_resource *slv; - -Of course, all offsets had to be adjusted accordingly, and we took -this chance to reorganize the macros depending on the register block -they target. - -There are only 2 registers' offsets that do not fit within this -schema so their offsets are passed as SoC-specific parameters: -smbus_master_rs_bytes_off -smbus_master_fsm_off - -Reviewed-by: Khalil Blaiech -Signed-off-by: Asmaa Mnebhi -Signed-off-by: Wolfram Sang -(cherry picked from commit 19e13e1330c63506452eed80f473f344e6779b94) -Signed-off-by: Asmaa Mnebhi -Acked-by: Tim Gardner -Acked-by: Bartlomiej Zolnierkiewicz -Signed-off-by: Bartlomiej Zolnierkiewicz ---- - MAINTAINERS | 1 + - drivers/i2c/busses/i2c-mlxbf.c | 461 ++++++++++++++++++++------------- - 2 files changed, 285 insertions(+), 177 deletions(-) - -diff --git a/MAINTAINERS b/MAINTAINERS -index 7db3e06ec..f6a974ade 100644 ---- a/MAINTAINERS -+++ b/MAINTAINERS -@@ -11175,6 +11175,7 @@ F: drivers/input/touchscreen/melfas_mip4.c - - MELLANOX BLUEFIELD I2C DRIVER - M: Khalil Blaiech -+M: Asmaa Mnebhi - L: linux-i2c@vger.kernel.org - S: Supported - F: Documentation/devicetree/bindings/i2c/mellanox,i2c-mlxbf.yaml -diff --git a/drivers/i2c/busses/i2c-mlxbf.c b/drivers/i2c/busses/i2c-mlxbf.c -index 32dbe1dab..75d8d00d1 100644 ---- a/drivers/i2c/busses/i2c-mlxbf.c -+++ b/drivers/i2c/busses/i2c-mlxbf.c -@@ -32,8 +32,6 @@ - (MLXBF_I2C_FUNC_SMBUS_DEFAULT | MLXBF_I2C_FUNC_SMBUS_BLOCK | \ - I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SLAVE) - --#define MLXBF_I2C_SMBUS_MAX 3 -- - /* Shared resources info in BlueField platforms. */ - - #define MLXBF_I2C_COALESCE_TYU_ADDR 0x02801300 -@@ -48,6 +46,9 @@ - #define MLXBF_I2C_COREPLL_YU_ADDR 0x02800c30 - #define MLXBF_I2C_COREPLL_YU_SIZE 0x00c - -+#define MLXBF_I2C_COREPLL_RSH_YU_ADDR 0x13409824 -+#define MLXBF_I2C_COREPLL_RSH_YU_SIZE 0x00c -+ - #define MLXBF_I2C_SHARED_RES_MAX 3 - - /* -@@ -131,14 +132,10 @@ - /* Slave busy bit reset. */ - #define MLXBF_I2C_CAUSE_S_GW_BUSY_FALL BIT(18) - --#define MLXBF_I2C_CAUSE_SLAVE_ARBITER_BITS_MASK GENMASK(20, 0) -- - /* Cause coalesce registers. */ - #define MLXBF_I2C_CAUSE_COALESCE_0 0x00 --#define MLXBF_I2C_CAUSE_COALESCE_1 0x04 --#define MLXBF_I2C_CAUSE_COALESCE_2 0x08 - --#define MLXBF_I2C_CAUSE_TYU_SLAVE_BIT MLXBF_I2C_SMBUS_MAX -+#define MLXBF_I2C_CAUSE_TYU_SLAVE_BIT 3 - #define MLXBF_I2C_CAUSE_YU_SLAVE_BIT 1 - - /* Functional enable register. */ -@@ -165,21 +162,6 @@ - #define MLXBF_I2C_GPIO_SMBUS_GW_ASSERT_PINS(num, val) \ - ((val) | (0x3 << MLXBF_I2C_GPIO_SMBUS_GW_PINS(num))) - --/* SMBus timing parameters. */ --#define MLXBF_I2C_SMBUS_TIMER_SCL_LOW_SCL_HIGH 0x00 --#define MLXBF_I2C_SMBUS_TIMER_FALL_RISE_SPIKE 0x04 --#define MLXBF_I2C_SMBUS_TIMER_THOLD 0x08 --#define MLXBF_I2C_SMBUS_TIMER_TSETUP_START_STOP 0x0c --#define MLXBF_I2C_SMBUS_TIMER_TSETUP_DATA 0x10 --#define MLXBF_I2C_SMBUS_THIGH_MAX_TBUF 0x14 --#define MLXBF_I2C_SMBUS_SCL_LOW_TIMEOUT 0x18 -- --enum { -- MLXBF_I2C_TIMING_100KHZ = 100000, -- MLXBF_I2C_TIMING_400KHZ = 400000, -- MLXBF_I2C_TIMING_1000KHZ = 1000000, --}; -- - /* - * Defines SMBus operating frequency and core clock frequency. - * According to ADB files, default values are compliant to 100KHz SMBus -@@ -198,26 +180,37 @@ enum { - #define MLXBF_I2C_COREPLL_CORE_OD_YU_MASK GENMASK(3, 0) - #define MLXBF_I2C_COREPLL_CORE_R_YU_MASK GENMASK(31, 26) - -+/* SMBus timing parameters. */ -+#define MLXBF_I2C_SMBUS_TIMER_SCL_LOW_SCL_HIGH 0x00 -+#define MLXBF_I2C_SMBUS_TIMER_FALL_RISE_SPIKE 0x04 -+#define MLXBF_I2C_SMBUS_TIMER_THOLD 0x08 -+#define MLXBF_I2C_SMBUS_TIMER_TSETUP_START_STOP 0x0c -+#define MLXBF_I2C_SMBUS_TIMER_TSETUP_DATA 0x10 -+#define MLXBF_I2C_SMBUS_THIGH_MAX_TBUF 0x14 -+#define MLXBF_I2C_SMBUS_SCL_LOW_TIMEOUT 0x18 - --/* Core PLL frequency. */ --static u64 mlxbf_i2c_corepll_frequency; -+#define MLXBF_I2C_SHIFT_0 0 -+#define MLXBF_I2C_SHIFT_8 8 -+#define MLXBF_I2C_SHIFT_16 16 -+#define MLXBF_I2C_SHIFT_24 24 -+ -+#define MLXBF_I2C_MASK_8 GENMASK(7, 0) -+#define MLXBF_I2C_MASK_16 GENMASK(15, 0) -+ -+#define MLXBF_I2C_MST_ADDR_OFFSET 0x200 - - /* SMBus Master GW. */ --#define MLXBF_I2C_SMBUS_MASTER_GW 0x200 -+#define MLXBF_I2C_SMBUS_MASTER_GW 0x0 - /* Number of bytes received and sent. */ --#define MLXBF_I2C_SMBUS_RS_BYTES 0x300 -+#define MLXBF_I2C_YU_SMBUS_RS_BYTES 0x100 -+#define MLXBF_I2C_RSH_YU_SMBUS_RS_BYTES 0x10c - /* Packet error check (PEC) value. */ --#define MLXBF_I2C_SMBUS_MASTER_PEC 0x304 -+#define MLXBF_I2C_SMBUS_MASTER_PEC 0x104 - /* Status bits (ACK/NACK/FW Timeout). */ --#define MLXBF_I2C_SMBUS_MASTER_STATUS 0x308 -+#define MLXBF_I2C_SMBUS_MASTER_STATUS 0x108 - /* SMbus Master Finite State Machine. */ --#define MLXBF_I2C_SMBUS_MASTER_FSM 0x310 -- --/* -- * When enabled, the master will issue a stop condition in case of -- * timeout while waiting for FW response. -- */ --#define MLXBF_I2C_SMBUS_EN_FW_TIMEOUT 0x31c -+#define MLXBF_I2C_YU_SMBUS_MASTER_FSM 0x110 -+#define MLXBF_I2C_RSH_YU_SMBUS_MASTER_FSM 0x100 - - /* SMBus master GW control bits offset in MLXBF_I2C_SMBUS_MASTER_GW[31:3]. */ - #define MLXBF_I2C_MASTER_LOCK_BIT BIT(31) /* Lock bit. */ -@@ -237,14 +230,14 @@ static u64 mlxbf_i2c_corepll_frequency; - #define MLXBF_I2C_MASTER_ENABLE_READ \ - (MLXBF_I2C_MASTER_ENABLE | MLXBF_I2C_MASTER_CTL_READ_BIT) - --#define MLXBF_I2C_MASTER_SLV_ADDR_SHIFT 12 /* Slave address shift. */ --#define MLXBF_I2C_MASTER_WRITE_SHIFT 21 /* Control write bytes shift. */ --#define MLXBF_I2C_MASTER_SEND_PEC_SHIFT 20 /* Send PEC byte shift. */ --#define MLXBF_I2C_MASTER_PARSE_EXP_SHIFT 11 /* Parse expected bytes shift. */ --#define MLXBF_I2C_MASTER_READ_SHIFT 4 /* Control read bytes shift. */ -+#define MLXBF_I2C_MASTER_WRITE_SHIFT 21 /* Control write bytes */ -+#define MLXBF_I2C_MASTER_SEND_PEC_SHIFT 20 /* Send PEC byte when set to 1 */ -+#define MLXBF_I2C_MASTER_PARSE_EXP_SHIFT 11 /* Control parse expected bytes */ -+#define MLXBF_I2C_MASTER_SLV_ADDR_SHIFT 12 /* Slave address */ -+#define MLXBF_I2C_MASTER_READ_SHIFT 4 /* Control read bytes */ - - /* SMBus master GW Data descriptor. */ --#define MLXBF_I2C_MASTER_DATA_DESC_ADDR 0x280 -+#define MLXBF_I2C_MASTER_DATA_DESC_ADDR 0x80 - #define MLXBF_I2C_MASTER_DATA_DESC_SIZE 0x80 /* Size in bytes. */ - - /* Maximum bytes to read/write per SMBus transaction. */ -@@ -270,19 +263,21 @@ static u64 mlxbf_i2c_corepll_frequency; - #define MLXBF_I2C_SMBUS_MASTER_FSM_STOP_MASK BIT(31) - #define MLXBF_I2C_SMBUS_MASTER_FSM_PS_STATE_MASK BIT(15) - -+#define MLXBF_I2C_SLV_ADDR_OFFSET 0x400 -+ - /* SMBus slave GW. */ --#define MLXBF_I2C_SMBUS_SLAVE_GW 0x400 -+#define MLXBF_I2C_SMBUS_SLAVE_GW 0x0 - /* Number of bytes received and sent from/to master. */ --#define MLXBF_I2C_SMBUS_SLAVE_RS_MASTER_BYTES 0x500 -+#define MLXBF_I2C_SMBUS_SLAVE_RS_MASTER_BYTES 0x100 - /* Packet error check (PEC) value. */ --#define MLXBF_I2C_SMBUS_SLAVE_PEC 0x504 -+#define MLXBF_I2C_SMBUS_SLAVE_PEC 0x104 - /* SMBus slave Finite State Machine (FSM). */ --#define MLXBF_I2C_SMBUS_SLAVE_FSM 0x510 -+#define MLXBF_I2C_SMBUS_SLAVE_FSM 0x110 - /* - * Should be set when all raised causes handled, and cleared by HW on - * every new cause. - */ --#define MLXBF_I2C_SMBUS_SLAVE_READY 0x52c -+#define MLXBF_I2C_SMBUS_SLAVE_READY 0x12c - - /* SMBus slave GW control bits offset in MLXBF_I2C_SMBUS_SLAVE_GW[31:19]. */ - #define MLXBF_I2C_SLAVE_BUSY_BIT BIT(30) /* Busy bit. */ -@@ -295,13 +290,13 @@ static u64 mlxbf_i2c_corepll_frequency; - #define MLXBF_I2C_SLAVE_SEND_PEC_SHIFT 21 /* Send PEC byte shift. */ - - /* SMBus slave GW Data descriptor. */ --#define MLXBF_I2C_SLAVE_DATA_DESC_ADDR 0x480 -+#define MLXBF_I2C_SLAVE_DATA_DESC_ADDR 0x80 - #define MLXBF_I2C_SLAVE_DATA_DESC_SIZE 0x80 /* Size in bytes. */ - - /* SMbus slave configuration registers. */ --#define MLXBF_I2C_SMBUS_SLAVE_ADDR_CFG 0x514 -+#define MLXBF_I2C_SMBUS_SLAVE_ADDR_CFG 0x114 - #define MLXBF_I2C_SMBUS_SLAVE_ADDR_CNT 16 --#define MLXBF_I2C_SMBUS_SLAVE_ADDR_EN_BIT 7 -+#define MLXBF_I2C_SMBUS_SLAVE_ADDR_EN_BIT BIT(7) - #define MLXBF_I2C_SMBUS_SLAVE_ADDR_MASK GENMASK(6, 0) - - /* -@@ -311,6 +306,59 @@ static u64 mlxbf_i2c_corepll_frequency; - #define MLXBF_I2C_SMBUS_TIMEOUT (300 * 1000) /* 300ms */ - #define MLXBF_I2C_SMBUS_LOCK_POLL_TIMEOUT (300 * 1000) /* 300ms */ - -+/* Polling frequency in microseconds. */ -+#define MLXBF_I2C_POLL_FREQ_IN_USEC 200 -+ -+#define MLXBF_I2C_SMBUS_OP_CNT_1 1 -+#define MLXBF_I2C_SMBUS_OP_CNT_2 2 -+#define MLXBF_I2C_SMBUS_OP_CNT_3 3 -+#define MLXBF_I2C_SMBUS_MAX_OP_CNT MLXBF_I2C_SMBUS_OP_CNT_3 -+ -+/* Helper macro to define an I2C resource parameters. */ -+#define MLXBF_I2C_RES_PARAMS(addr, size, str) \ -+ { \ -+ .start = (addr), \ -+ .end = (addr) + (size) - 1, \ -+ .name = (str) \ -+ } -+ -+enum { -+ MLXBF_I2C_TIMING_100KHZ = 100000, -+ MLXBF_I2C_TIMING_400KHZ = 400000, -+ MLXBF_I2C_TIMING_1000KHZ = 1000000, -+}; -+ -+enum { -+ MLXBF_I2C_F_READ = BIT(0), -+ MLXBF_I2C_F_WRITE = BIT(1), -+ MLXBF_I2C_F_NORESTART = BIT(3), -+ MLXBF_I2C_F_SMBUS_OPERATION = BIT(4), -+ MLXBF_I2C_F_SMBUS_BLOCK = BIT(5), -+ MLXBF_I2C_F_SMBUS_PEC = BIT(6), -+ MLXBF_I2C_F_SMBUS_PROCESS_CALL = BIT(7), -+}; -+ -+/* Mellanox BlueField chip type. */ -+enum mlxbf_i2c_chip_type { -+ MLXBF_I2C_CHIP_TYPE_1, /* Mellanox BlueField-1 chip. */ -+ MLXBF_I2C_CHIP_TYPE_2, /* Mellanox BlueField-2 chip. */ -+ MLXBF_I2C_CHIP_TYPE_3 /* Mellanox BlueField-3 chip. */ -+}; -+ -+/* List of chip resources that are being accessed by the driver. */ -+enum { -+ MLXBF_I2C_SMBUS_RES, -+ MLXBF_I2C_MST_CAUSE_RES, -+ MLXBF_I2C_SLV_CAUSE_RES, -+ MLXBF_I2C_COALESCE_RES, -+ MLXBF_I2C_SMBUS_TIMER_RES, -+ MLXBF_I2C_SMBUS_MST_RES, -+ MLXBF_I2C_SMBUS_SLV_RES, -+ MLXBF_I2C_COREPLL_RES, -+ MLXBF_I2C_GPIO_RES, -+ MLXBF_I2C_END_RES -+}; -+ - /* Encapsulates timing parameters. */ - struct mlxbf_i2c_timings { - u16 scl_high; /* Clock high period. */ -@@ -330,27 +378,12 @@ struct mlxbf_i2c_timings { - u32 timeout; /* Detect clock low timeout. */ - }; - --enum { -- MLXBF_I2C_F_READ = BIT(0), -- MLXBF_I2C_F_WRITE = BIT(1), -- MLXBF_I2C_F_NORESTART = BIT(3), -- MLXBF_I2C_F_SMBUS_OPERATION = BIT(4), -- MLXBF_I2C_F_SMBUS_BLOCK = BIT(5), -- MLXBF_I2C_F_SMBUS_PEC = BIT(6), -- MLXBF_I2C_F_SMBUS_PROCESS_CALL = BIT(7), --}; -- - struct mlxbf_i2c_smbus_operation { - u32 flags; - u32 length; /* Buffer length in bytes. */ - u8 *buffer; - }; - --#define MLXBF_I2C_SMBUS_OP_CNT_1 1 --#define MLXBF_I2C_SMBUS_OP_CNT_2 2 --#define MLXBF_I2C_SMBUS_OP_CNT_3 3 --#define MLXBF_I2C_SMBUS_MAX_OP_CNT MLXBF_I2C_SMBUS_OP_CNT_3 -- - struct mlxbf_i2c_smbus_request { - u8 slave; - u8 operation_cnt; -@@ -364,24 +397,38 @@ struct mlxbf_i2c_resource { - u8 type; - }; - --/* List of chip resources that are being accessed by the driver. */ --enum { -- MLXBF_I2C_SMBUS_RES, -- MLXBF_I2C_MST_CAUSE_RES, -- MLXBF_I2C_SLV_CAUSE_RES, -- MLXBF_I2C_COALESCE_RES, -- MLXBF_I2C_COREPLL_RES, -- MLXBF_I2C_GPIO_RES, -- MLXBF_I2C_END_RES, -+struct mlxbf_i2c_chip_info { -+ enum mlxbf_i2c_chip_type type; -+ /* Chip shared resources that are being used by the I2C controller. */ -+ struct mlxbf_i2c_resource *shared_res[MLXBF_I2C_SHARED_RES_MAX]; -+ -+ /* Callback to calculate the core PLL frequency. */ -+ u64 (*calculate_freq)(struct mlxbf_i2c_resource *corepll_res); -+ -+ /* Registers' address offset */ -+ u32 smbus_master_rs_bytes_off; -+ u32 smbus_master_fsm_off; - }; - --/* Helper macro to define an I2C resource parameters. */ --#define MLXBF_I2C_RES_PARAMS(addr, size, str) \ -- { \ -- .start = (addr), \ -- .end = (addr) + (size) - 1, \ -- .name = (str) \ -- } -+struct mlxbf_i2c_priv { -+ const struct mlxbf_i2c_chip_info *chip; -+ struct i2c_adapter adap; -+ struct mlxbf_i2c_resource *smbus; -+ struct mlxbf_i2c_resource *timer; -+ struct mlxbf_i2c_resource *mst; -+ struct mlxbf_i2c_resource *slv; -+ struct mlxbf_i2c_resource *mst_cause; -+ struct mlxbf_i2c_resource *slv_cause; -+ struct mlxbf_i2c_resource *coalesce; -+ u64 frequency; /* Core frequency in Hz. */ -+ int bus; /* Physical bus identifier. */ -+ int irq; -+ struct i2c_client *slave[MLXBF_I2C_SMBUS_SLAVE_ADDR_CNT]; -+ u32 resource_version; -+}; -+ -+/* Core PLL frequency. */ -+static u64 mlxbf_i2c_corepll_frequency; - - static struct resource mlxbf_i2c_coalesce_tyu_params = - MLXBF_I2C_RES_PARAMS(MLXBF_I2C_COALESCE_TYU_ADDR, -@@ -395,6 +442,10 @@ static struct resource mlxbf_i2c_corepll_yu_params = - MLXBF_I2C_RES_PARAMS(MLXBF_I2C_COREPLL_YU_ADDR, - MLXBF_I2C_COREPLL_YU_SIZE, - "COREPLL_MEM"); -+static struct resource mlxbf_i2c_corepll_rsh_yu_params = -+ MLXBF_I2C_RES_PARAMS(MLXBF_I2C_COREPLL_RSH_YU_ADDR, -+ MLXBF_I2C_COREPLL_RSH_YU_SIZE, -+ "COREPLL_MEM"); - static struct resource mlxbf_i2c_gpio_tyu_params = - MLXBF_I2C_RES_PARAMS(MLXBF_I2C_GPIO_TYU_ADDR, - MLXBF_I2C_GPIO_TYU_SIZE, -@@ -404,34 +455,6 @@ static struct mutex mlxbf_i2c_coalesce_lock; - static struct mutex mlxbf_i2c_corepll_lock; - static struct mutex mlxbf_i2c_gpio_lock; - --/* Mellanox BlueField chip type. */ --enum mlxbf_i2c_chip_type { -- MLXBF_I2C_CHIP_TYPE_1, /* Mellanox BlueField-1 chip. */ -- MLXBF_I2C_CHIP_TYPE_2, /* Mallanox BlueField-2 chip. */ --}; -- --struct mlxbf_i2c_chip_info { -- enum mlxbf_i2c_chip_type type; -- /* Chip shared resources that are being used by the I2C controller. */ -- struct mlxbf_i2c_resource *shared_res[MLXBF_I2C_SHARED_RES_MAX]; -- -- /* Callback to calculate the core PLL frequency. */ -- u64 (*calculate_freq)(struct mlxbf_i2c_resource *corepll_res); --}; -- --struct mlxbf_i2c_priv { -- const struct mlxbf_i2c_chip_info *chip; -- struct i2c_adapter adap; -- struct mlxbf_i2c_resource *smbus; -- struct mlxbf_i2c_resource *mst_cause; -- struct mlxbf_i2c_resource *slv_cause; -- struct mlxbf_i2c_resource *coalesce; -- u64 frequency; /* Core frequency in Hz. */ -- int bus; /* Physical bus identifier. */ -- int irq; -- struct i2c_client *slave[MLXBF_I2C_SMBUS_SLAVE_ADDR_CNT]; --}; -- - static struct mlxbf_i2c_resource mlxbf_i2c_coalesce_res[] = { - [MLXBF_I2C_CHIP_TYPE_1] = { - .params = &mlxbf_i2c_coalesce_tyu_params, -@@ -451,6 +474,11 @@ static struct mlxbf_i2c_resource mlxbf_i2c_corepll_res[] = { - .params = &mlxbf_i2c_corepll_yu_params, - .lock = &mlxbf_i2c_corepll_lock, - .type = MLXBF_I2C_COREPLL_RES, -+ }, -+ [MLXBF_I2C_CHIP_TYPE_3] = { -+ .params = &mlxbf_i2c_corepll_rsh_yu_params, -+ .lock = &mlxbf_i2c_corepll_lock, -+ .type = MLXBF_I2C_COREPLL_RES, - } - }; - -@@ -467,24 +495,13 @@ static u8 mlxbf_i2c_bus_count; - - static struct mutex mlxbf_i2c_bus_lock; - --/* Polling frequency in microseconds. */ --#define MLXBF_I2C_POLL_FREQ_IN_USEC 200 -- --#define MLXBF_I2C_SHIFT_0 0 --#define MLXBF_I2C_SHIFT_8 8 --#define MLXBF_I2C_SHIFT_16 16 --#define MLXBF_I2C_SHIFT_24 24 -- --#define MLXBF_I2C_MASK_8 GENMASK(7, 0) --#define MLXBF_I2C_MASK_16 GENMASK(15, 0) -- - /* - * Function to poll a set of bits at a specific address; it checks whether - * the bits are equal to zero when eq_zero is set to 'true', and not equal - * to zero when eq_zero is set to 'false'. - * Note that the timeout is given in microseconds. - */ --static u32 mlxbf_smbus_poll(void __iomem *io, u32 addr, u32 mask, -+static u32 mlxbf_i2c_poll(void __iomem *io, u32 addr, u32 mask, - bool eq_zero, u32 timeout) - { - u32 bits; -@@ -506,13 +523,13 @@ static u32 mlxbf_smbus_poll(void __iomem *io, u32 addr, u32 mask, - * a transaction. Accordingly, this function polls the Master FSM stop - * bit; it returns false when the bit is asserted, true if not. - */ --static bool mlxbf_smbus_master_wait_for_idle(struct mlxbf_i2c_priv *priv) -+static bool mlxbf_i2c_smbus_master_wait_for_idle(struct mlxbf_i2c_priv *priv) - { - u32 mask = MLXBF_I2C_SMBUS_MASTER_FSM_STOP_MASK; -- u32 addr = MLXBF_I2C_SMBUS_MASTER_FSM; -+ u32 addr = priv->chip->smbus_master_fsm_off; - u32 timeout = MLXBF_I2C_SMBUS_TIMEOUT; - -- if (mlxbf_smbus_poll(priv->smbus->io, addr, mask, true, timeout)) -+ if (mlxbf_i2c_poll(priv->mst->io, addr, mask, true, timeout)) - return true; - - return false; -@@ -523,7 +540,7 @@ static bool mlxbf_smbus_master_wait_for_idle(struct mlxbf_i2c_priv *priv) - */ - static bool mlxbf_i2c_smbus_master_lock(struct mlxbf_i2c_priv *priv) - { -- if (mlxbf_smbus_poll(priv->smbus->io, MLXBF_I2C_SMBUS_MASTER_GW, -+ if (mlxbf_i2c_poll(priv->mst->io, MLXBF_I2C_SMBUS_MASTER_GW, - MLXBF_I2C_MASTER_LOCK_BIT, true, - MLXBF_I2C_SMBUS_LOCK_POLL_TIMEOUT)) - return true; -@@ -534,7 +551,7 @@ static bool mlxbf_i2c_smbus_master_lock(struct mlxbf_i2c_priv *priv) - static void mlxbf_i2c_smbus_master_unlock(struct mlxbf_i2c_priv *priv) - { - /* Clear the gw to clear the lock */ -- writel(0, priv->smbus->io + MLXBF_I2C_SMBUS_MASTER_GW); -+ writel(0, priv->mst->io + MLXBF_I2C_SMBUS_MASTER_GW); - } - - static bool mlxbf_i2c_smbus_transaction_success(u32 master_status, -@@ -574,7 +591,7 @@ static int mlxbf_i2c_smbus_check_status(struct mlxbf_i2c_priv *priv) - * then read the cause and master status bits to determine if - * errors occurred during the transaction. - */ -- mlxbf_smbus_poll(priv->smbus->io, MLXBF_I2C_SMBUS_MASTER_GW, -+ mlxbf_i2c_poll(priv->mst->io, MLXBF_I2C_SMBUS_MASTER_GW, - MLXBF_I2C_MASTER_BUSY_BIT, true, - MLXBF_I2C_SMBUS_TIMEOUT); - -@@ -587,7 +604,7 @@ static int mlxbf_i2c_smbus_check_status(struct mlxbf_i2c_priv *priv) - * Parse both Cause and Master GW bits, then return transaction status. - */ - -- master_status_bits = readl(priv->smbus->io + -+ master_status_bits = readl(priv->mst->io + - MLXBF_I2C_SMBUS_MASTER_STATUS); - master_status_bits &= MLXBF_I2C_SMBUS_MASTER_STATUS_MASK; - -@@ -612,7 +629,8 @@ static int mlxbf_i2c_smbus_check_status(struct mlxbf_i2c_priv *priv) - } - - static void mlxbf_i2c_smbus_write_data(struct mlxbf_i2c_priv *priv, -- const u8 *data, u8 length, u32 addr) -+ const u8 *data, u8 length, u32 addr, -+ bool is_master) - { - u8 offset, aligned_length; - u32 data32; -@@ -629,12 +647,16 @@ static void mlxbf_i2c_smbus_write_data(struct mlxbf_i2c_priv *priv, - */ - for (offset = 0; offset < aligned_length; offset += sizeof(u32)) { - data32 = *((u32 *)(data + offset)); -- iowrite32be(data32, priv->smbus->io + addr + offset); -+ if (is_master) -+ iowrite32be(data32, priv->mst->io + addr + offset); -+ else -+ iowrite32be(data32, priv->slv->io + addr + offset); - } - } - - static void mlxbf_i2c_smbus_read_data(struct mlxbf_i2c_priv *priv, -- u8 *data, u8 length, u32 addr) -+ u8 *data, u8 length, u32 addr, -+ bool is_master) - { - u32 data32, mask; - u8 byte, offset; -@@ -650,14 +672,20 @@ static void mlxbf_i2c_smbus_read_data(struct mlxbf_i2c_priv *priv, - */ - - for (offset = 0; offset < (length & ~mask); offset += sizeof(u32)) { -- data32 = ioread32be(priv->smbus->io + addr + offset); -+ if (is_master) -+ data32 = ioread32be(priv->mst->io + addr + offset); -+ else -+ data32 = ioread32be(priv->slv->io + addr + offset); - *((u32 *)(data + offset)) = data32; - } - - if (!(length & mask)) - return; - -- data32 = ioread32be(priv->smbus->io + addr + offset); -+ if (is_master) -+ data32 = ioread32be(priv->mst->io + addr + offset); -+ else -+ data32 = ioread32be(priv->slv->io + addr + offset); - - for (byte = 0; byte < (length & mask); byte++) { - data[offset + byte] = data32 & GENMASK(7, 0); -@@ -683,16 +711,16 @@ static int mlxbf_i2c_smbus_enable(struct mlxbf_i2c_priv *priv, u8 slave, - command |= rol32(pec_en, MLXBF_I2C_MASTER_SEND_PEC_SHIFT); - - /* Clear status bits. */ -- writel(0x0, priv->smbus->io + MLXBF_I2C_SMBUS_MASTER_STATUS); -+ writel(0x0, priv->mst->io + MLXBF_I2C_SMBUS_MASTER_STATUS); - /* Set the cause data. */ - writel(~0x0, priv->mst_cause->io + MLXBF_I2C_CAUSE_OR_CLEAR); - /* Zero PEC byte. */ -- writel(0x0, priv->smbus->io + MLXBF_I2C_SMBUS_MASTER_PEC); -+ writel(0x0, priv->mst->io + MLXBF_I2C_SMBUS_MASTER_PEC); - /* Zero byte count. */ -- writel(0x0, priv->smbus->io + MLXBF_I2C_SMBUS_RS_BYTES); -+ writel(0x0, priv->mst->io + priv->chip->smbus_master_rs_bytes_off); - - /* GW activation. */ -- writel(command, priv->smbus->io + MLXBF_I2C_SMBUS_MASTER_GW); -+ writel(command, priv->mst->io + MLXBF_I2C_SMBUS_MASTER_GW); - - /* - * Poll master status and check status bits. An ACK is sent when -@@ -736,7 +764,7 @@ mlxbf_i2c_smbus_start_transaction(struct mlxbf_i2c_priv *priv, - return -EBUSY; - - /* Check whether the HW is idle */ -- if (WARN_ON(!mlxbf_smbus_master_wait_for_idle(priv))) { -+ if (WARN_ON(!mlxbf_i2c_smbus_master_wait_for_idle(priv))) { - ret = -EBUSY; - goto out_unlock; - } -@@ -793,7 +821,7 @@ mlxbf_i2c_smbus_start_transaction(struct mlxbf_i2c_priv *priv, - * must be written to the data registers. - */ - mlxbf_i2c_smbus_write_data(priv, (const u8 *)data_desc, data_len, -- MLXBF_I2C_MASTER_DATA_DESC_ADDR); -+ MLXBF_I2C_MASTER_DATA_DESC_ADDR, true); - - if (write_en) { - ret = mlxbf_i2c_smbus_enable(priv, slave, write_len, block_en, -@@ -805,13 +833,13 @@ mlxbf_i2c_smbus_start_transaction(struct mlxbf_i2c_priv *priv, - if (read_en) { - /* Write slave address to Master GW data descriptor. */ - mlxbf_i2c_smbus_write_data(priv, (const u8 *)&addr, 1, -- MLXBF_I2C_MASTER_DATA_DESC_ADDR); -+ MLXBF_I2C_MASTER_DATA_DESC_ADDR, true); - ret = mlxbf_i2c_smbus_enable(priv, slave, read_len, block_en, - pec_en, 1); - if (!ret) { - /* Get Master GW data descriptor. */ - mlxbf_i2c_smbus_read_data(priv, data_desc, read_len + 1, -- MLXBF_I2C_MASTER_DATA_DESC_ADDR); -+ MLXBF_I2C_MASTER_DATA_DESC_ADDR, true); - - /* Get data from Master GW data descriptor. */ - memcpy(read_buf, data_desc, read_len + 1); -@@ -823,7 +851,7 @@ mlxbf_i2c_smbus_start_transaction(struct mlxbf_i2c_priv *priv, - * next tag integration. - */ - writel(MLXBF_I2C_SMBUS_MASTER_FSM_PS_STATE_MASK, -- priv->smbus->io + MLXBF_I2C_SMBUS_MASTER_FSM); -+ priv->mst->io + priv->chip->smbus_master_fsm_off); - } - - out_unlock: -@@ -1115,7 +1143,7 @@ static void mlxbf_i2c_set_timings(struct mlxbf_i2c_priv *priv, - timer |= mlxbf_i2c_set_timer(priv, timings->scl_low, - false, MLXBF_I2C_MASK_16, - MLXBF_I2C_SHIFT_16); -- writel(timer, priv->smbus->io + -+ writel(timer, priv->timer->io + - MLXBF_I2C_SMBUS_TIMER_SCL_LOW_SCL_HIGH); - - timer = mlxbf_i2c_set_timer(priv, timings->sda_rise, false, -@@ -1126,34 +1154,34 @@ static void mlxbf_i2c_set_timings(struct mlxbf_i2c_priv *priv, - MLXBF_I2C_MASK_8, MLXBF_I2C_SHIFT_16); - timer |= mlxbf_i2c_set_timer(priv, timings->scl_fall, false, - MLXBF_I2C_MASK_8, MLXBF_I2C_SHIFT_24); -- writel(timer, priv->smbus->io + -+ writel(timer, priv->timer->io + - MLXBF_I2C_SMBUS_TIMER_FALL_RISE_SPIKE); - - timer = mlxbf_i2c_set_timer(priv, timings->hold_start, true, - MLXBF_I2C_MASK_16, MLXBF_I2C_SHIFT_0); - timer |= mlxbf_i2c_set_timer(priv, timings->hold_data, true, - MLXBF_I2C_MASK_16, MLXBF_I2C_SHIFT_16); -- writel(timer, priv->smbus->io + MLXBF_I2C_SMBUS_TIMER_THOLD); -+ writel(timer, priv->timer->io + MLXBF_I2C_SMBUS_TIMER_THOLD); - - timer = mlxbf_i2c_set_timer(priv, timings->setup_start, true, - MLXBF_I2C_MASK_16, MLXBF_I2C_SHIFT_0); - timer |= mlxbf_i2c_set_timer(priv, timings->setup_stop, true, - MLXBF_I2C_MASK_16, MLXBF_I2C_SHIFT_16); -- writel(timer, priv->smbus->io + -+ writel(timer, priv->timer->io + - MLXBF_I2C_SMBUS_TIMER_TSETUP_START_STOP); - - timer = mlxbf_i2c_set_timer(priv, timings->setup_data, true, - MLXBF_I2C_MASK_16, MLXBF_I2C_SHIFT_0); -- writel(timer, priv->smbus->io + MLXBF_I2C_SMBUS_TIMER_TSETUP_DATA); -+ writel(timer, priv->timer->io + MLXBF_I2C_SMBUS_TIMER_TSETUP_DATA); - - timer = mlxbf_i2c_set_timer(priv, timings->buf, false, - MLXBF_I2C_MASK_16, MLXBF_I2C_SHIFT_0); - timer |= mlxbf_i2c_set_timer(priv, timings->thigh_max, false, - MLXBF_I2C_MASK_16, MLXBF_I2C_SHIFT_16); -- writel(timer, priv->smbus->io + MLXBF_I2C_SMBUS_THIGH_MAX_TBUF); -+ writel(timer, priv->timer->io + MLXBF_I2C_SMBUS_THIGH_MAX_TBUF); - - timer = timings->timeout; -- writel(timer, priv->smbus->io + MLXBF_I2C_SMBUS_SCL_LOW_TIMEOUT); -+ writel(timer, priv->timer->io + MLXBF_I2C_SMBUS_SCL_LOW_TIMEOUT); - } - - enum mlxbf_i2c_timings_config { -@@ -1565,7 +1593,7 @@ static int mlxbf_i2c_slave_enable(struct mlxbf_i2c_priv *priv, - * Look for the next available slave register slot. - */ - for (reg = 0; reg < reg_cnt; reg++) { -- slave_reg = readl(priv->smbus->io + -+ slave_reg = readl(priv->slv->io + - MLXBF_I2C_SMBUS_SLAVE_ADDR_CFG + reg * 0x4); - /* - * Each register holds 4 slave addresses. So, we have to keep -@@ -1587,7 +1615,7 @@ static int mlxbf_i2c_slave_enable(struct mlxbf_i2c_priv *priv, - slave_reg &= ~(MLXBF_I2C_SMBUS_SLAVE_ADDR_MASK << (byte * 8)); - slave_reg |= (slave->addr << (byte * 8)); - slave_reg |= MLXBF_I2C_SMBUS_SLAVE_ADDR_EN_BIT << (byte * 8); -- writel(slave_reg, priv->smbus->io + -+ writel(slave_reg, priv->slv->io + - MLXBF_I2C_SMBUS_SLAVE_ADDR_CFG + - (reg * 0x4)); - -@@ -1622,7 +1650,7 @@ static int mlxbf_i2c_slave_disable(struct mlxbf_i2c_priv *priv, u8 addr) - * Check if addr is present in the registers. - */ - for (reg = 0; reg < reg_cnt; reg++) { -- slave_reg = readl(priv->smbus->io + -+ slave_reg = readl(priv->slv->io + - MLXBF_I2C_SMBUS_SLAVE_ADDR_CFG + reg * 0x4); - - /* Check whether the address slots are empty. */ -@@ -1643,7 +1671,7 @@ static int mlxbf_i2c_slave_disable(struct mlxbf_i2c_priv *priv, u8 addr) - if (addr_tmp == addr) { - /* Clear the slave address slot. */ - slave_reg &= ~(GENMASK(7, 0) << (byte * 8)); -- writel(slave_reg, priv->smbus->io + -+ writel(slave_reg, priv->slv->io + - MLXBF_I2C_SMBUS_SLAVE_ADDR_CFG + - (reg * 0x4)); - /* Free slave at the corresponding index */ -@@ -1747,7 +1775,7 @@ static int mlxbf_i2c_init_slave(struct platform_device *pdev, - int ret; - - /* Reset FSM. */ -- writel(0, priv->smbus->io + MLXBF_I2C_SMBUS_SLAVE_FSM); -+ writel(0, priv->slv->io + MLXBF_I2C_SMBUS_SLAVE_FSM); - - /* - * Enable slave cause interrupt bits. Drive -@@ -1762,7 +1790,7 @@ static int mlxbf_i2c_init_slave(struct platform_device *pdev, - writel(int_reg, priv->slv_cause->io + MLXBF_I2C_CAUSE_OR_EVTEN0); - - /* Finally, set the 'ready' bit to start handling transactions. */ -- writel(0x1, priv->smbus->io + MLXBF_I2C_SMBUS_SLAVE_READY); -+ writel(0x1, priv->slv->io + MLXBF_I2C_SMBUS_SLAVE_READY); - - /* Initialize the cause coalesce resource. */ - ret = mlxbf_i2c_init_coalesce(pdev, priv); -@@ -1807,13 +1835,13 @@ static bool mlxbf_i2c_has_coalesce(struct mlxbf_i2c_priv *priv, bool *read, - return true; - } - --static bool mlxbf_smbus_slave_wait_for_idle(struct mlxbf_i2c_priv *priv, -+static bool mlxbf_i2c_slave_wait_for_idle(struct mlxbf_i2c_priv *priv, - u32 timeout) - { - u32 mask = MLXBF_I2C_CAUSE_S_GW_BUSY_FALL; - u32 addr = MLXBF_I2C_CAUSE_ARBITER; - -- if (mlxbf_smbus_poll(priv->slv_cause->io, addr, mask, false, timeout)) -+ if (mlxbf_i2c_poll(priv->slv_cause->io, addr, mask, false, timeout)) - return true; - - return false; -@@ -1852,7 +1880,7 @@ static int mlxbf_i2c_irq_send(struct mlxbf_i2c_priv *priv, u8 recv_bytes) - * determine the slave address. This byte is located in the - * first data descriptor register of the slave GW. - */ -- data32 = ioread32be(priv->smbus->io + -+ data32 = ioread32be(priv->slv->io + - MLXBF_I2C_SLAVE_DATA_DESC_ADDR); - addr = (data32 & GENMASK(7, 0)) >> 1; - -@@ -1906,7 +1934,7 @@ static int mlxbf_i2c_irq_send(struct mlxbf_i2c_priv *priv, u8 recv_bytes) - - /* Write data to Slave GW data descriptor. */ - mlxbf_i2c_smbus_write_data(priv, data_desc, byte_cnt, -- MLXBF_I2C_SLAVE_DATA_DESC_ADDR); -+ MLXBF_I2C_SLAVE_DATA_DESC_ADDR, false); - - pec_en = 0; /* Disable PEC since it is not supported. */ - -@@ -1915,19 +1943,19 @@ static int mlxbf_i2c_irq_send(struct mlxbf_i2c_priv *priv, u8 recv_bytes) - control32 |= rol32(write_size, MLXBF_I2C_SLAVE_WRITE_BYTES_SHIFT); - control32 |= rol32(pec_en, MLXBF_I2C_SLAVE_SEND_PEC_SHIFT); - -- writel(control32, priv->smbus->io + MLXBF_I2C_SMBUS_SLAVE_GW); -+ writel(control32, priv->slv->io + MLXBF_I2C_SMBUS_SLAVE_GW); - - /* - * Wait until the transfer is completed; the driver will wait - * until the GW is idle, a cause will rise on fall of GW busy. - */ -- mlxbf_smbus_slave_wait_for_idle(priv, MLXBF_I2C_SMBUS_TIMEOUT); -+ mlxbf_i2c_slave_wait_for_idle(priv, MLXBF_I2C_SMBUS_TIMEOUT); - - clear_csr: - /* Release the Slave GW. */ -- writel(0x0, priv->smbus->io + MLXBF_I2C_SMBUS_SLAVE_RS_MASTER_BYTES); -- writel(0x0, priv->smbus->io + MLXBF_I2C_SMBUS_SLAVE_PEC); -- writel(0x1, priv->smbus->io + MLXBF_I2C_SMBUS_SLAVE_READY); -+ writel(0x0, priv->slv->io + MLXBF_I2C_SMBUS_SLAVE_RS_MASTER_BYTES); -+ writel(0x0, priv->slv->io + MLXBF_I2C_SMBUS_SLAVE_PEC); -+ writel(0x1, priv->slv->io + MLXBF_I2C_SMBUS_SLAVE_READY); - - return ret; - } -@@ -1945,7 +1973,7 @@ static int mlxbf_i2c_irq_recv(struct mlxbf_i2c_priv *priv, u8 recv_bytes) - - /* Read data from Slave GW data descriptor. */ - mlxbf_i2c_smbus_read_data(priv, data_desc, recv_bytes, -- MLXBF_I2C_SLAVE_DATA_DESC_ADDR); -+ MLXBF_I2C_SLAVE_DATA_DESC_ADDR, false); - addr = data_desc[0] >> 1; - - /* -@@ -1981,9 +2009,9 @@ static int mlxbf_i2c_irq_recv(struct mlxbf_i2c_priv *priv, u8 recv_bytes) - - clear_csr: - /* Release the Slave GW. */ -- writel(0x0, priv->smbus->io + MLXBF_I2C_SMBUS_SLAVE_RS_MASTER_BYTES); -- writel(0x0, priv->smbus->io + MLXBF_I2C_SMBUS_SLAVE_PEC); -- writel(0x1, priv->smbus->io + MLXBF_I2C_SMBUS_SLAVE_READY); -+ writel(0x0, priv->slv->io + MLXBF_I2C_SMBUS_SLAVE_RS_MASTER_BYTES); -+ writel(0x0, priv->slv->io + MLXBF_I2C_SMBUS_SLAVE_PEC); -+ writel(0x1, priv->slv->io + MLXBF_I2C_SMBUS_SLAVE_READY); - - return ret; - } -@@ -2018,7 +2046,7 @@ static irqreturn_t mlxbf_i2c_irq(int irq, void *ptr) - * slave, if the higher 8 bits are sent then the slave expect N bytes - * from the master. - */ -- rw_bytes_reg = readl(priv->smbus->io + -+ rw_bytes_reg = readl(priv->slv->io + - MLXBF_I2C_SMBUS_SLAVE_RS_MASTER_BYTES); - recv_bytes = (rw_bytes_reg >> 8) & GENMASK(7, 0); - -@@ -2183,14 +2211,27 @@ static struct mlxbf_i2c_chip_info mlxbf_i2c_chip[] = { - [1] = &mlxbf_i2c_corepll_res[MLXBF_I2C_CHIP_TYPE_1], - [2] = &mlxbf_i2c_gpio_res[MLXBF_I2C_CHIP_TYPE_1] - }, -- .calculate_freq = mlxbf_i2c_calculate_freq_from_tyu -+ .calculate_freq = mlxbf_i2c_calculate_freq_from_tyu, -+ .smbus_master_rs_bytes_off = MLXBF_I2C_YU_SMBUS_RS_BYTES, -+ .smbus_master_fsm_off = MLXBF_I2C_YU_SMBUS_MASTER_FSM - }, - [MLXBF_I2C_CHIP_TYPE_2] = { - .type = MLXBF_I2C_CHIP_TYPE_2, - .shared_res = { - [0] = &mlxbf_i2c_corepll_res[MLXBF_I2C_CHIP_TYPE_2] - }, -- .calculate_freq = mlxbf_i2c_calculate_freq_from_yu -+ .calculate_freq = mlxbf_i2c_calculate_freq_from_yu, -+ .smbus_master_rs_bytes_off = MLXBF_I2C_YU_SMBUS_RS_BYTES, -+ .smbus_master_fsm_off = MLXBF_I2C_YU_SMBUS_MASTER_FSM -+ }, -+ [MLXBF_I2C_CHIP_TYPE_3] = { -+ .type = MLXBF_I2C_CHIP_TYPE_3, -+ .shared_res = { -+ [0] = &mlxbf_i2c_corepll_res[MLXBF_I2C_CHIP_TYPE_3] -+ }, -+ .calculate_freq = mlxbf_i2c_calculate_freq_from_yu, -+ .smbus_master_rs_bytes_off = MLXBF_I2C_RSH_YU_SMBUS_RS_BYTES, -+ .smbus_master_fsm_off = MLXBF_I2C_RSH_YU_SMBUS_MASTER_FSM - } - }; - -@@ -2215,6 +2256,10 @@ static const struct of_device_id mlxbf_i2c_dt_ids[] = { - .compatible = "mellanox,i2c-mlxbf2", - .data = &mlxbf_i2c_chip[MLXBF_I2C_CHIP_TYPE_2] - }, -+ { -+ .compatible = "mellanox,i2c-mlxbf3", -+ .data = &mlxbf_i2c_chip[MLXBF_I2C_CHIP_TYPE_3] -+ }, - {}, - }; - -@@ -2224,6 +2269,7 @@ MODULE_DEVICE_TABLE(of, mlxbf_i2c_dt_ids); - static const struct acpi_device_id mlxbf_i2c_acpi_ids[] = { - { "MLNXBF03", (kernel_ulong_t)&mlxbf_i2c_chip[MLXBF_I2C_CHIP_TYPE_1] }, - { "MLNXBF23", (kernel_ulong_t)&mlxbf_i2c_chip[MLXBF_I2C_CHIP_TYPE_2] }, -+ { "MLNXBF31", (kernel_ulong_t)&mlxbf_i2c_chip[MLXBF_I2C_CHIP_TYPE_3] }, - {}, - }; - -@@ -2299,6 +2345,7 @@ static int mlxbf_i2c_probe(struct platform_device *pdev) - struct device *dev = &pdev->dev; - struct mlxbf_i2c_priv *priv; - struct i2c_adapter *adap; -+ u32 resource_version; - int irq, ret; - - priv = devm_kzalloc(dev, sizeof(struct mlxbf_i2c_priv), GFP_KERNEL); -@@ -2312,11 +2359,60 @@ static int mlxbf_i2c_probe(struct platform_device *pdev) - if (ret < 0) - return ret; - -- ret = mlxbf_i2c_init_resource(pdev, &priv->smbus, -- MLXBF_I2C_SMBUS_RES); -- if (ret < 0) { -- dev_err(dev, "Cannot fetch smbus resource info"); -- return ret; -+ /* This property allows the driver to stay backward compatible with older -+ * ACPI table and device trees versions. -+ * Starting BlueField-3 SoC, the "smbus" resource was broken down into 3 -+ * separate resources "timer", "master" and "slave". -+ */ -+ if (device_property_read_u32(dev, "resource_version", &resource_version)) -+ resource_version = 0; -+ -+ priv->resource_version = resource_version; -+ -+ if (priv->chip->type < MLXBF_I2C_CHIP_TYPE_3 && resource_version == 0) { -+ priv->timer = devm_kzalloc(dev, sizeof(struct mlxbf_i2c_resource), GFP_KERNEL); -+ if (!priv->timer) -+ return -ENOMEM; -+ -+ priv->mst = devm_kzalloc(dev, sizeof(struct mlxbf_i2c_resource), GFP_KERNEL); -+ if (!priv->mst) -+ return -ENOMEM; -+ -+ priv->slv = devm_kzalloc(dev, sizeof(struct mlxbf_i2c_resource), GFP_KERNEL); -+ if (!priv->slv) -+ return -ENOMEM; -+ -+ ret = mlxbf_i2c_init_resource(pdev, &priv->smbus, -+ MLXBF_I2C_SMBUS_RES); -+ if (ret < 0) { -+ dev_err(dev, "Cannot fetch smbus resource info"); -+ return ret; -+ } -+ -+ priv->timer->io = priv->smbus->io; -+ priv->mst->io = priv->smbus->io + MLXBF_I2C_MST_ADDR_OFFSET; -+ priv->slv->io = priv->smbus->io + MLXBF_I2C_SLV_ADDR_OFFSET; -+ } else { -+ ret = mlxbf_i2c_init_resource(pdev, &priv->timer, -+ MLXBF_I2C_SMBUS_TIMER_RES); -+ if (ret < 0) { -+ dev_err(dev, "Cannot fetch timer resource info"); -+ return ret; -+ } -+ -+ ret = mlxbf_i2c_init_resource(pdev, &priv->mst, -+ MLXBF_I2C_SMBUS_MST_RES); -+ if (ret < 0) { -+ dev_err(dev, "Cannot fetch master resource info"); -+ return ret; -+ } -+ -+ ret = mlxbf_i2c_init_resource(pdev, &priv->slv, -+ MLXBF_I2C_SMBUS_SLV_RES); -+ if (ret < 0) { -+ dev_err(dev, "Cannot fetch slave resource info"); -+ return ret; -+ } - } - - ret = mlxbf_i2c_init_resource(pdev, &priv->mst_cause, -@@ -2404,8 +2500,19 @@ static int mlxbf_i2c_remove(struct platform_device *pdev) - struct device *dev = &pdev->dev; - struct resource *params; - -- params = priv->smbus->params; -- devm_release_mem_region(dev, params->start, resource_size(params)); -+ if (priv->chip->type < MLXBF_I2C_CHIP_TYPE_3 && priv->resource_version == 0) { -+ params = priv->smbus->params; -+ devm_release_mem_region(dev, params->start, resource_size(params)); -+ } else { -+ params = priv->timer->params; -+ devm_release_mem_region(dev, params->start, resource_size(params)); -+ -+ params = priv->mst->params; -+ devm_release_mem_region(dev, params->start, resource_size(params)); -+ -+ params = priv->slv->params; -+ devm_release_mem_region(dev, params->start, resource_size(params)); -+ } - - params = priv->mst_cause->params; - devm_release_mem_region(dev, params->start, resource_size(params)); --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0208-i2c-mlxbf-remove-device-tree-support.patch b/platform/mellanox/non-upstream-patches/patches/0208-i2c-mlxbf-remove-device-tree-support.patch deleted file mode 100644 index c2642e7a90d2..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0208-i2c-mlxbf-remove-device-tree-support.patch +++ /dev/null @@ -1,211 +0,0 @@ -From e2f59de3801d0899bb4622079b2d927aaf2404b7 Mon Sep 17 00:00:00 2001 -From: Asmaa Mnebhi -Date: Tue, 27 Sep 2022 16:39:24 -0400 -Subject: [PATCH backport 5.10 09/63] i2c: mlxbf: remove device tree support - -BugLink: https://bugs.launchpad.net/bugs/1991551 - -BlueField customers have to use the BlueField firmware with -UEFI ACPI tables so there is no need to have device tree -support in the i2c-mlxbf.c driver. Remove the device tree -binding documentation as well. - -Signed-off-by: Asmaa Mnebhi -Reviewed-by: Khalil Blaiech -Signed-off-by: Wolfram Sang -(cherry picked from commit be18c5ede25da39a0eda541f6de3620a30cf731f) -Signed-off-by: Asmaa Mnebhi -Acked-by: Tim Gardner -Acked-by: Bartlomiej Zolnierkiewicz -Signed-off-by: Bartlomiej Zolnierkiewicz ---- - .../bindings/i2c/mellanox,i2c-mlxbf.yaml | 78 ------------------- - MAINTAINERS | 1 - - drivers/i2c/busses/i2c-mlxbf.c | 49 +----------- - 3 files changed, 1 insertion(+), 127 deletions(-) - delete mode 100644 Documentation/devicetree/bindings/i2c/mellanox,i2c-mlxbf.yaml - -diff --git a/Documentation/devicetree/bindings/i2c/mellanox,i2c-mlxbf.yaml b/Documentation/devicetree/bindings/i2c/mellanox,i2c-mlxbf.yaml -deleted file mode 100644 -index d2b401d06..000000000 ---- a/Documentation/devicetree/bindings/i2c/mellanox,i2c-mlxbf.yaml -+++ /dev/null -@@ -1,78 +0,0 @@ --# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) --%YAML 1.2 ----- --$id: http://devicetree.org/schemas/i2c/mellanox,i2c-mlxbf.yaml# --$schema: http://devicetree.org/meta-schemas/core.yaml# -- --title: Mellanox I2C SMBus on BlueField SoCs -- --maintainers: -- - Khalil Blaiech -- --allOf: -- - $ref: /schemas/i2c/i2c-controller.yaml# -- --properties: -- compatible: -- enum: -- - mellanox,i2c-mlxbf1 -- - mellanox,i2c-mlxbf2 -- -- reg: -- minItems: 3 -- maxItems: 4 -- items: -- - description: Smbus block registers -- - description: Cause master registers -- - description: Cause slave registers -- - description: Cause coalesce registers -- -- interrupts: -- maxItems: 1 -- -- clock-frequency: -- enum: [ 100000, 400000, 1000000 ] -- description: -- bus frequency used to configure timing registers; -- The frequency is expressed in Hz. Default is 100000. -- --required: -- - compatible -- - reg -- - interrupts -- --unevaluatedProperties: false -- --if: -- properties: -- compatible: -- contains: -- enum: -- - mellanox,i2c-mlxbf1 -- --then: -- properties: -- reg: -- maxItems: 3 -- --examples: -- - | -- i2c@2804000 { -- compatible = "mellanox,i2c-mlxbf1"; -- reg = <0x02804000 0x800>, -- <0x02801200 0x020>, -- <0x02801260 0x020>; -- interrupts = <57>; -- clock-frequency = <100000>; -- }; -- -- - | -- i2c@2808800 { -- compatible = "mellanox,i2c-mlxbf2"; -- reg = <0x02808800 0x600>, -- <0x02808e00 0x020>, -- <0x02808e20 0x020>, -- <0x02808e40 0x010>; -- interrupts = <57>; -- clock-frequency = <400000>; -- }; -diff --git a/MAINTAINERS b/MAINTAINERS -index f6a974ade..1d43cd482 100644 ---- a/MAINTAINERS -+++ b/MAINTAINERS -@@ -11178,7 +11178,6 @@ M: Khalil Blaiech - M: Asmaa Mnebhi - L: linux-i2c@vger.kernel.org - S: Supported --F: Documentation/devicetree/bindings/i2c/mellanox,i2c-mlxbf.yaml - F: drivers/i2c/busses/i2c-mlxbf.c - - MELLANOX ETHERNET DRIVER (mlx4_en) -diff --git a/drivers/i2c/busses/i2c-mlxbf.c b/drivers/i2c/busses/i2c-mlxbf.c -index 75d8d00d1..67548702f 100644 ---- a/drivers/i2c/busses/i2c-mlxbf.c -+++ b/drivers/i2c/busses/i2c-mlxbf.c -@@ -2247,24 +2247,6 @@ static struct i2c_adapter_quirks mlxbf_i2c_quirks = { - .max_write_len = MLXBF_I2C_MASTER_DATA_W_LENGTH, - }; - --static const struct of_device_id mlxbf_i2c_dt_ids[] = { -- { -- .compatible = "mellanox,i2c-mlxbf1", -- .data = &mlxbf_i2c_chip[MLXBF_I2C_CHIP_TYPE_1] -- }, -- { -- .compatible = "mellanox,i2c-mlxbf2", -- .data = &mlxbf_i2c_chip[MLXBF_I2C_CHIP_TYPE_2] -- }, -- { -- .compatible = "mellanox,i2c-mlxbf3", -- .data = &mlxbf_i2c_chip[MLXBF_I2C_CHIP_TYPE_3] -- }, -- {}, --}; -- --MODULE_DEVICE_TABLE(of, mlxbf_i2c_dt_ids); -- - #ifdef CONFIG_ACPI - static const struct acpi_device_id mlxbf_i2c_acpi_ids[] = { - { "MLNXBF03", (kernel_ulong_t)&mlxbf_i2c_chip[MLXBF_I2C_CHIP_TYPE_1] }, -@@ -2315,31 +2297,6 @@ static int mlxbf_i2c_acpi_probe(struct device *dev, struct mlxbf_i2c_priv *priv) - } - #endif /* CONFIG_ACPI */ - --static int mlxbf_i2c_of_probe(struct device *dev, struct mlxbf_i2c_priv *priv) --{ -- const struct of_device_id *oid; -- int bus_id = -1; -- -- if (IS_ENABLED(CONFIG_OF) && dev->of_node) { -- oid = of_match_node(mlxbf_i2c_dt_ids, dev->of_node); -- if (!oid) -- return -ENODEV; -- -- priv->chip = oid->data; -- -- bus_id = of_alias_get_id(dev->of_node, "i2c"); -- if (bus_id >= 0) -- priv->bus = bus_id; -- } -- -- if (bus_id < 0) { -- dev_err(dev, "Cannot get bus id"); -- return bus_id; -- } -- -- return 0; --} -- - static int mlxbf_i2c_probe(struct platform_device *pdev) - { - struct device *dev = &pdev->dev; -@@ -2353,14 +2310,11 @@ static int mlxbf_i2c_probe(struct platform_device *pdev) - return -ENOMEM; - - ret = mlxbf_i2c_acpi_probe(dev, priv); -- if (ret < 0 && ret != -ENOENT && ret != -ENXIO) -- ret = mlxbf_i2c_of_probe(dev, priv); -- - if (ret < 0) - return ret; - - /* This property allows the driver to stay backward compatible with older -- * ACPI table and device trees versions. -+ * ACPI tables. - * Starting BlueField-3 SoC, the "smbus" resource was broken down into 3 - * separate resources "timer", "master" and "slave". - */ -@@ -2544,7 +2498,6 @@ static struct platform_driver mlxbf_i2c_driver = { - .remove = mlxbf_i2c_remove, - .driver = { - .name = "i2c-mlxbf", -- .of_match_table = mlxbf_i2c_dt_ids, - #ifdef CONFIG_ACPI - .acpi_match_table = ACPI_PTR(mlxbf_i2c_acpi_ids), - #endif /* CONFIG_ACPI */ --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0209-UBUNTU-SAUCE-i2c-mlxbf.c-Add-driver-version.patch b/platform/mellanox/non-upstream-patches/patches/0209-UBUNTU-SAUCE-i2c-mlxbf.c-Add-driver-version.patch deleted file mode 100644 index 50e96af71c61..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0209-UBUNTU-SAUCE-i2c-mlxbf.c-Add-driver-version.patch +++ /dev/null @@ -1,37 +0,0 @@ -From c78abc95294213920e386abb941df6e23ba1ede3 Mon Sep 17 00:00:00 2001 -From: Asmaa Mnebhi -Date: Tue, 11 Oct 2022 14:28:57 -0400 -Subject: [PATCH backport 5.10 10/63] UBUNTU: SAUCE: i2c-mlxbf.c: Add driver - version - -BugLink: https://bugs.launchpad.net/bugs/1991551 - -Signed-off-by: Asmaa Mnebhi -Acked-by: Tim Gardner -Acked-by: Bartlomiej Zolnierkiewicz -Signed-off-by: Bartlomiej Zolnierkiewicz ---- - drivers/i2c/busses/i2c-mlxbf.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/drivers/i2c/busses/i2c-mlxbf.c b/drivers/i2c/busses/i2c-mlxbf.c -index 67548702f..0eb92bbc1 100644 ---- a/drivers/i2c/busses/i2c-mlxbf.c -+++ b/drivers/i2c/busses/i2c-mlxbf.c -@@ -19,6 +19,8 @@ - #include - #include - -+#define DRV_VERSION "3.2" -+ - /* Defines what functionality is present. */ - #define MLXBF_I2C_FUNC_SMBUS_BLOCK \ - (I2C_FUNC_SMBUS_BLOCK_DATA | I2C_FUNC_SMBUS_BLOCK_PROC_CALL) -@@ -2532,3 +2534,4 @@ MODULE_DESCRIPTION("Mellanox BlueField I2C bus driver"); - MODULE_AUTHOR("Khalil Blaiech "); - MODULE_AUTHOR("Asmaa Mnebhi "); - MODULE_LICENSE("GPL v2"); -+MODULE_VERSION(DRV_VERSION); --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0210-platform-mellanox-Typo-fix-in-the-file-mlxbf-bootctl.patch b/platform/mellanox/non-upstream-patches/patches/0210-platform-mellanox-Typo-fix-in-the-file-mlxbf-bootctl.patch deleted file mode 100644 index 43b606c2695a..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0210-platform-mellanox-Typo-fix-in-the-file-mlxbf-bootctl.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 4c700c6b83fa8bf6347537279a0a5134d09cf004 Mon Sep 17 00:00:00 2001 -From: Bhaskar Chowdhury -Date: Wed, 17 Mar 2021 15:26:50 +0530 -Subject: [PATCH backport 5.10 11/63] platform/mellanox: Typo fix in the file - mlxbf-bootctl.c - -s/progamming/programming/ - -Signed-off-by: Bhaskar Chowdhury -Acked-by: Randy Dunlap -Link: https://lore.kernel.org/r/20210317095650.2036419-1-unixbhaskar@gmail.com -Signed-off-by: Hans de Goede ---- - drivers/platform/mellanox/mlxbf-bootctl.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/platform/mellanox/mlxbf-bootctl.c b/drivers/platform/mellanox/mlxbf-bootctl.c -index 5d21c6adf..1c7a288b5 100644 ---- a/drivers/platform/mellanox/mlxbf-bootctl.c -+++ b/drivers/platform/mellanox/mlxbf-bootctl.c -@@ -208,7 +208,7 @@ static ssize_t secure_boot_fuse_state_show(struct device *dev, - * 0011 = version 1, 0111 = version 2, 1111 = version 3). Upper 4 bits - * are a thermometer code indicating key programming has completed for - * key n (same encodings as the start bits). This allows for detection -- * of an interruption in the progamming process which has left the key -+ * of an interruption in the programming process which has left the key - * partially programmed (and thus invalid). The process is to burn the - * eFuse for the new key start bit, burn the key eFuses, then burn the - * eFuse for the new key complete bit. --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0211-UBUNTU-SAUCE-platform-mellanox-Updates-to-mlxbf-boot.patch b/platform/mellanox/non-upstream-patches/patches/0211-UBUNTU-SAUCE-platform-mellanox-Updates-to-mlxbf-boot.patch deleted file mode 100644 index d2f8e5ef2543..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0211-UBUNTU-SAUCE-platform-mellanox-Updates-to-mlxbf-boot.patch +++ /dev/null @@ -1,1719 +0,0 @@ -From 988b360c98ef157e37818f5f7db322c129d3dfb9 Mon Sep 17 00:00:00 2001 -From: Shravan Kumar Ramani -Date: Wed, 6 Jul 2022 07:37:22 -0400 -Subject: [PATCH backport 5.10 12/63] UBUNTU: SAUCE: platform/mellanox: Updates - to mlxbf-bootctl - -BugLink: https://launchpad.net/bugs/1980832 - -The driver supports the VPD fields in the EEPROM and exposes -sysfs files for configuring and reading the same. -Also address buffer overflow and exclusion issues. - -Signed-off-by: Shravan Kumar Ramani -Signed-off-by: Ike Panhc ---- - drivers/platform/mellanox/mlxbf-bootctl.c | 1410 ++++++++++++++++++--- - drivers/platform/mellanox/mlxbf-bootctl.h | 88 +- - 2 files changed, 1268 insertions(+), 230 deletions(-) - -diff --git a/drivers/platform/mellanox/mlxbf-bootctl.c b/drivers/platform/mellanox/mlxbf-bootctl.c -index 1c7a288b5..2302e1e09 100644 ---- a/drivers/platform/mellanox/mlxbf-bootctl.c -+++ b/drivers/platform/mellanox/mlxbf-bootctl.c -@@ -1,51 +1,129 @@ --// SPDX-License-Identifier: GPL-2.0+ -+// SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause - /* -- * Mellanox boot control driver -+ * Mellanox boot control driver -+ * This driver provides a sysfs interface for systems management -+ * software to manage reset-time actions. - * -- * This driver provides a sysfs interface for systems management -- * software to manage reset-time actions. -+ * Copyright (C) 2020 Mellanox Technologies. All rights reserved. - * -- * Copyright (C) 2019 Mellanox Technologies -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License v2.0 as published by -+ * the Free Software Foundation. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. - */ - - #include - #include -+#include -+#include - #include - #include -- - #include "mlxbf-bootctl.h" - --#define MLXBF_BOOTCTL_SB_SECURE_MASK 0x03 --#define MLXBF_BOOTCTL_SB_TEST_MASK 0x0c -+#define DRIVER_NAME "mlxbf-bootctl" -+#define DRIVER_VERSION "1.5" -+#define DRIVER_DESCRIPTION "Mellanox boot control driver" -+ -+#define SB_MODE_SECURE_MASK 0x03 -+#define SB_MODE_TEST_MASK 0x0c -+#define SB_MODE_DEV_MASK 0x10 - --#define MLXBF_SB_KEY_NUM 4 -+#define SB_KEY_NUM 4 -+ -+struct boot_name { -+ int value; -+ const char name[12]; -+}; - --/* UUID used to probe ATF service. */ --static const char *mlxbf_bootctl_svc_uuid_str = -- "89c036b4-e7d7-11e6-8797-001aca00bfc4"; -+static struct boot_name boot_names[] = { -+ { MLNX_BOOT_EXTERNAL, "external" }, -+ { MLNX_BOOT_EMMC, "emmc" }, -+ { MLNX_BOOT_SWAP_EMMC, "swap_emmc" }, -+ { MLNX_BOOT_EMMC_LEGACY, "emmc_legacy" }, -+ { MLNX_BOOT_NONE, "none" }, -+ { -1, "" } -+}; - --struct mlxbf_bootctl_name { -- u32 value; -- const char *name; -+enum { -+ SB_LIFECYCLE_PRODUCTION = 0, -+ SB_LIFECYCLE_GA_SECURE = 1, -+ SB_LIFECYCLE_GA_NON_SECURE = 2, -+ SB_LIFECYCLE_RMA = 3 - }; - --static struct mlxbf_bootctl_name boot_names[] = { -- { MLXBF_BOOTCTL_EXTERNAL, "external" }, -- { MLXBF_BOOTCTL_EMMC, "emmc" }, -- { MLNX_BOOTCTL_SWAP_EMMC, "swap_emmc" }, -- { MLXBF_BOOTCTL_EMMC_LEGACY, "emmc_legacy" }, -- { MLXBF_BOOTCTL_NONE, "none" }, -+static char lifecycle_states[][16] = { -+ [SB_LIFECYCLE_PRODUCTION] = "Production", -+ [SB_LIFECYCLE_GA_SECURE] = "GA Secured", -+ [SB_LIFECYCLE_GA_NON_SECURE] = "GA Non-Secured", -+ [SB_LIFECYCLE_RMA] = "RMA", - }; - --static const char * const mlxbf_bootctl_lifecycle_states[] = { -- [0] = "Production", -- [1] = "GA Secured", -- [2] = "GA Non-Secured", -- [3] = "RMA", -+/* ctl/data register within the resource. */ -+#define RSH_SCRATCH_BUF_CTL_OFF 0 -+#define RSH_SCRATCH_BUF_DATA_OFF 0x10 -+ -+static void __iomem *rsh_boot_data; -+static void __iomem *rsh_boot_cnt; -+static void __iomem *rsh_semaphore; -+static void __iomem *rsh_scratch_buf_ctl; -+static void __iomem *rsh_scratch_buf_data; -+ -+static int rsh_log_clear_on_read; -+module_param(rsh_log_clear_on_read, int, 0644); -+MODULE_PARM_DESC(rsh_log_clear_on_read, "Clear rshim logging buffer after read."); -+ -+/* -+ * Objects are stored within the MFG partition per type. Type 0 is not -+ * supported. -+ */ -+enum { -+ MLNX_MFG_TYPE_OOB_MAC = 1, -+ MLNX_MFG_TYPE_OPN_0, -+ MLNX_MFG_TYPE_OPN_1, -+ MLNX_MFG_TYPE_OPN_2, -+ MLNX_MFG_TYPE_SKU_0, -+ MLNX_MFG_TYPE_SKU_1, -+ MLNX_MFG_TYPE_SKU_2, -+ MLNX_MFG_TYPE_MODL_0, -+ MLNX_MFG_TYPE_MODL_1, -+ MLNX_MFG_TYPE_MODL_2, -+ MLNX_MFG_TYPE_SN_0, -+ MLNX_MFG_TYPE_SN_1, -+ MLNX_MFG_TYPE_SN_2, -+ MLNX_MFG_TYPE_UUID_0, -+ MLNX_MFG_TYPE_UUID_1, -+ MLNX_MFG_TYPE_UUID_2, -+ MLNX_MFG_TYPE_UUID_3, -+ MLNX_MFG_TYPE_UUID_4, -+ MLNX_MFG_TYPE_REV, - }; - --/* ARM SMC call which is atomic and no need for lock. */ --static int mlxbf_bootctl_smc(unsigned int smc_op, int smc_arg) -+/* This mutex is used to serialize MFG write and lock operations. */ -+static DEFINE_MUTEX(mfg_ops_lock); -+ -+#define MLNX_MFG_OOB_MAC_LEN ETH_ALEN -+#define MLNX_MFG_OPN_VAL_LEN 24 -+#define MLNX_MFG_SKU_VAL_LEN 24 -+#define MLNX_MFG_MODL_VAL_LEN 24 -+#define MLNX_MFG_SN_VAL_LEN 24 -+#define MLNX_MFG_UUID_VAL_LEN 40 -+#define MLNX_MFG_REV_VAL_LEN 8 -+#define MLNX_MFG_VAL_QWORD_CNT(type) \ -+ (MLNX_MFG_##type##_VAL_LEN / sizeof(u64)) -+ -+/* -+ * The MAC address consists of 6 bytes (2 digits each) separated by ':'. -+ * The expected format is: "XX:XX:XX:XX:XX:XX" -+ */ -+#define MLNX_MFG_OOB_MAC_FORMAT_LEN \ -+ ((MLNX_MFG_OOB_MAC_LEN * 2) + (MLNX_MFG_OOB_MAC_LEN - 1)) -+ -+/* The SMC calls in question are atomic, so we don't have to lock here. */ -+static int smc_call1(unsigned int smc_op, int smc_arg) - { - struct arm_smccc_res res; - -@@ -54,268 +132,1212 @@ static int mlxbf_bootctl_smc(unsigned int smc_op, int smc_arg) - return res.a0; - } - --/* Return the action in integer or an error code. */ --static int mlxbf_bootctl_reset_action_to_val(const char *action) -+/* Syntactic sugar to avoid having to specify an unused argument. */ -+#define smc_call0(smc_op) smc_call1(smc_op, 0) -+ -+static int reset_action_to_val(const char *action, size_t len) - { -- int i; -+ struct boot_name *bn; -+ -+ /* Accept string either with or without a newline terminator */ -+ if (action[len-1] == '\n') -+ --len; - -- for (i = 0; i < ARRAY_SIZE(boot_names); i++) -- if (sysfs_streq(boot_names[i].name, action)) -- return boot_names[i].value; -+ for (bn = boot_names; bn->value >= 0; ++bn) -+ if (strncmp(bn->name, action, len) == 0) -+ break; - -- return -EINVAL; -+ return bn->value; - } - --/* Return the action in string. */ --static const char *mlxbf_bootctl_action_to_string(int action) -+static const char *reset_action_to_string(int action) - { -- int i; -+ struct boot_name *bn; - -- for (i = 0; i < ARRAY_SIZE(boot_names); i++) -- if (boot_names[i].value == action) -- return boot_names[i].name; -+ for (bn = boot_names; bn->value >= 0; ++bn) -+ if (bn->value == action) -+ break; - -- return "invalid action"; -+ return bn->name; - } - --static ssize_t post_reset_wdog_show(struct device *dev, -- struct device_attribute *attr, char *buf) -+static ssize_t post_reset_wdog_show(struct device_driver *drv, -+ char *buf) - { -- int ret; -+ return snprintf(buf, PAGE_SIZE, "%d\n", -+ smc_call0(MLNX_GET_POST_RESET_WDOG)); -+} - -- ret = mlxbf_bootctl_smc(MLXBF_BOOTCTL_GET_POST_RESET_WDOG, 0); -- if (ret < 0) -- return ret; -+static ssize_t post_reset_wdog_store(struct device_driver *drv, -+ const char *buf, size_t count) -+{ -+ int err; -+ unsigned long watchdog; -+ -+ err = kstrtoul(buf, 10, &watchdog); -+ if (err) -+ return err; -+ -+ if (smc_call1(MLNX_SET_POST_RESET_WDOG, watchdog) < 0) -+ return -EINVAL; - -- return sprintf(buf, "%d\n", ret); -+ return count; - } - --static ssize_t post_reset_wdog_store(struct device *dev, -- struct device_attribute *attr, -- const char *buf, size_t count) -+static ssize_t reset_action_show(struct device_driver *drv, -+ char *buf) - { -- unsigned long value; -- int ret; -+ return snprintf(buf, PAGE_SIZE, "%s\n", reset_action_to_string( -+ smc_call0(MLNX_GET_RESET_ACTION))); -+} - -- ret = kstrtoul(buf, 10, &value); -- if (ret) -- return ret; -+static ssize_t reset_action_store(struct device_driver *drv, -+ const char *buf, size_t count) -+{ -+ int action = reset_action_to_val(buf, count); - -- ret = mlxbf_bootctl_smc(MLXBF_BOOTCTL_SET_POST_RESET_WDOG, value); -- if (ret < 0) -- return ret; -+ if (action < 0 || action == MLNX_BOOT_NONE) -+ return -EINVAL; -+ -+ if (smc_call1(MLNX_SET_RESET_ACTION, action) < 0) -+ return -EINVAL; - - return count; - } - --static ssize_t mlxbf_bootctl_show(int smc_op, char *buf) -+static ssize_t second_reset_action_show(struct device_driver *drv, -+ char *buf) - { -- int action; -+ return snprintf(buf, PAGE_SIZE, "%s\n", reset_action_to_string( -+ smc_call0(MLNX_GET_SECOND_RESET_ACTION))); -+} -+ -+static ssize_t second_reset_action_store(struct device_driver *drv, -+ const char *buf, size_t count) -+{ -+ int action = reset_action_to_val(buf, count); - -- action = mlxbf_bootctl_smc(smc_op, 0); - if (action < 0) -- return action; -+ return -EINVAL; -+ -+ if (smc_call1(MLNX_SET_SECOND_RESET_ACTION, action) < 0) -+ return -EINVAL; - -- return sprintf(buf, "%s\n", mlxbf_bootctl_action_to_string(action)); -+ return count; - } - --static int mlxbf_bootctl_store(int smc_op, const char *buf, size_t count) -+static ssize_t lifecycle_state_show(struct device_driver *drv, -+ char *buf) - { -- int ret, action; -+ int lc_state = smc_call1(MLNX_GET_TBB_FUSE_STATUS, -+ MLNX_FUSE_STATUS_LIFECYCLE); - -- action = mlxbf_bootctl_reset_action_to_val(buf); -- if (action < 0) -- return action; -+ if (lc_state < 0) -+ return -EINVAL; -+ -+ lc_state &= (SB_MODE_TEST_MASK | -+ SB_MODE_SECURE_MASK | -+ SB_MODE_DEV_MASK); - -- ret = mlxbf_bootctl_smc(smc_op, action); -- if (ret < 0) -- return ret; -+ /* -+ * If the test bits are set, we specify that the current state may be -+ * due to using the test bits. -+ */ -+ if ((lc_state & SB_MODE_TEST_MASK) != 0) { -+ -+ lc_state &= SB_MODE_SECURE_MASK; -+ -+ return snprintf(buf, PAGE_SIZE, "%s(test)\n", -+ lifecycle_states[lc_state]); -+ } else if ((lc_state & SB_MODE_SECURE_MASK) == SB_LIFECYCLE_GA_SECURE -+ && (lc_state & SB_MODE_DEV_MASK)) { -+ return snprintf(buf, PAGE_SIZE, "Secured (development)\n"); -+ } -+ -+ return snprintf(buf, PAGE_SIZE, "%s\n", lifecycle_states[lc_state]); -+} -+ -+static ssize_t secure_boot_fuse_state_show(struct device_driver *drv, -+ char *buf) -+{ -+ int key; -+ int buf_len = 0; -+ int upper_key_used = 0; -+ int sb_key_state = smc_call1(MLNX_GET_TBB_FUSE_STATUS, -+ MLNX_FUSE_STATUS_KEYS); -+ -+ if (sb_key_state < 0) -+ return -EINVAL; -+ -+ for (key = SB_KEY_NUM - 1; key >= 0; key--) { -+ int burnt = ((sb_key_state & (1 << key)) != 0); -+ int valid = ((sb_key_state & (1 << (key + SB_KEY_NUM))) != 0); -+ -+ buf_len += sprintf(buf + buf_len, "Ver%d:", key); -+ if (upper_key_used) { -+ if (burnt) { -+ if (valid) -+ buf_len += sprintf(buf + buf_len, -+ "Used"); -+ else -+ buf_len += sprintf(buf + buf_len, -+ "Wasted"); -+ } else { -+ if (valid) -+ buf_len += sprintf(buf + buf_len, -+ "Invalid"); -+ else -+ buf_len += sprintf(buf + buf_len, -+ "Skipped"); -+ } -+ } else { -+ if (burnt) { -+ if (valid) { -+ upper_key_used = 1; -+ buf_len += sprintf(buf + buf_len, -+ "In use"); -+ } else -+ buf_len += sprintf(buf + buf_len, -+ "Burn incomplete"); -+ } else { -+ if (valid) -+ buf_len += sprintf(buf + buf_len, -+ "Invalid"); -+ else -+ buf_len += sprintf(buf + buf_len, -+ "Free"); -+ } -+ } -+ buf_len += sprintf(buf + buf_len, "\n"); -+ } -+ -+ return buf_len; -+} -+ -+static ssize_t fw_reset_store(struct device_driver *drv, -+ const char *buf, size_t count) -+{ -+ int err; -+ unsigned long key; -+ -+ err = kstrtoul(buf, 16, &key); -+ if (err) -+ return err; -+ -+ if (smc_call1(MLNX_HANDLE_FW_RESET, key) < 0) -+ return -EINVAL; - - return count; - } - --static ssize_t reset_action_show(struct device *dev, -- struct device_attribute *attr, char *buf) -+static ssize_t oob_mac_show(struct device_driver *drv, char *buf) - { -- return mlxbf_bootctl_show(MLXBF_BOOTCTL_GET_RESET_ACTION, buf); -+ char mac_str[MLNX_MFG_OOB_MAC_FORMAT_LEN + 1] = { 0 }; -+ struct arm_smccc_res res; -+ u8 *mac_byte_ptr; -+ -+ mutex_lock(&mfg_ops_lock); -+ arm_smccc_smc(MLNX_HANDLE_GET_MFG_INFO, MLNX_MFG_TYPE_OOB_MAC, 0, 0, 0, -+ 0, 0, 0, &res); -+ mutex_unlock(&mfg_ops_lock); -+ if (res.a0) -+ return -EPERM; -+ -+ mac_byte_ptr = (u8 *)&res.a1; -+ -+ sprintf(mac_str, "%02X:%02X:%02X:%02X:%02X:%02X", -+ mac_byte_ptr[0], mac_byte_ptr[1], mac_byte_ptr[2], -+ mac_byte_ptr[3], mac_byte_ptr[4], mac_byte_ptr[5]); -+ -+ return snprintf(buf, PAGE_SIZE, "%s", mac_str); - } - --static ssize_t reset_action_store(struct device *dev, -- struct device_attribute *attr, -- const char *buf, size_t count) -+static ssize_t oob_mac_store(struct device_driver *drv, const char *buf, -+ size_t count) -+{ -+ int byte[MLNX_MFG_OOB_MAC_FORMAT_LEN] = { 0 }; -+ struct arm_smccc_res res; -+ u64 mac_addr = 0; -+ u8 *mac_byte_ptr; -+ int byte_idx, len; -+ -+ if ((count - 1) != MLNX_MFG_OOB_MAC_FORMAT_LEN) -+ return -EINVAL; -+ -+ len = sscanf(buf, "%02x:%02x:%02x:%02x:%02x:%02x", -+ &byte[0], &byte[1], &byte[2], -+ &byte[3], &byte[4], &byte[5]); -+ if (len != MLNX_MFG_OOB_MAC_LEN) -+ return -EINVAL; -+ -+ mac_byte_ptr = (u8 *)&mac_addr; -+ -+ for (byte_idx = 0; byte_idx < MLNX_MFG_OOB_MAC_LEN; byte_idx++) -+ mac_byte_ptr[byte_idx] = (u8) byte[byte_idx]; -+ -+ mutex_lock(&mfg_ops_lock); -+ arm_smccc_smc(MLNX_HANDLE_SET_MFG_INFO, MLNX_MFG_TYPE_OOB_MAC, -+ MLNX_MFG_OOB_MAC_LEN, mac_addr, 0, 0, 0, 0, &res); -+ mutex_unlock(&mfg_ops_lock); -+ -+ return res.a0 ? -EPERM : count; -+} -+ -+static ssize_t opn_show(struct device_driver *drv, char *buf) - { -- return mlxbf_bootctl_store(MLXBF_BOOTCTL_SET_RESET_ACTION, buf, count); -+ u64 opn_data[MLNX_MFG_VAL_QWORD_CNT(OPN)] = { 0 }; -+ char opn[MLNX_MFG_OPN_VAL_LEN + 1] = { 0 }; -+ struct arm_smccc_res res; -+ int word; -+ -+ mutex_lock(&mfg_ops_lock); -+ for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(OPN); word++) { -+ arm_smccc_smc(MLNX_HANDLE_GET_MFG_INFO, -+ MLNX_MFG_TYPE_OPN_0 + word, -+ 0, 0, 0, 0, 0, 0, &res); -+ if (res.a0) { -+ mutex_unlock(&mfg_ops_lock); -+ return -EPERM; -+ } -+ opn_data[word] = res.a1; -+ } -+ mutex_unlock(&mfg_ops_lock); -+ memcpy(opn, opn_data, MLNX_MFG_OPN_VAL_LEN); -+ -+ return snprintf(buf, PAGE_SIZE, "%s", opn); - } - --static ssize_t second_reset_action_show(struct device *dev, -- struct device_attribute *attr, -- char *buf) -+static ssize_t opn_store(struct device_driver *drv, const char *buf, -+ size_t count) - { -- return mlxbf_bootctl_show(MLXBF_BOOTCTL_GET_SECOND_RESET_ACTION, buf); -+ u64 opn[MLNX_MFG_VAL_QWORD_CNT(OPN)] = { 0 }; -+ struct arm_smccc_res res; -+ int word; -+ -+ if (count > MLNX_MFG_OPN_VAL_LEN) -+ return -EINVAL; -+ -+ memcpy(opn, buf, count); -+ -+ mutex_lock(&mfg_ops_lock); -+ for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(OPN); word++) { -+ arm_smccc_smc(MLNX_HANDLE_SET_MFG_INFO, -+ MLNX_MFG_TYPE_OPN_0 + word, -+ sizeof(u64), opn[word], 0, 0, 0, 0, &res); -+ if (res.a0) { -+ mutex_unlock(&mfg_ops_lock); -+ return -EPERM; -+ } -+ } -+ mutex_unlock(&mfg_ops_lock); -+ -+ return count; - } - --static ssize_t second_reset_action_store(struct device *dev, -- struct device_attribute *attr, -- const char *buf, size_t count) -+static ssize_t sku_show(struct device_driver *drv, char *buf) - { -- return mlxbf_bootctl_store(MLXBF_BOOTCTL_SET_SECOND_RESET_ACTION, buf, -- count); -+ u64 sku_data[MLNX_MFG_VAL_QWORD_CNT(SKU)] = { 0 }; -+ char sku[MLNX_MFG_SKU_VAL_LEN + 1] = { 0 }; -+ struct arm_smccc_res res; -+ int word; -+ -+ mutex_lock(&mfg_ops_lock); -+ for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(SKU); word++) { -+ arm_smccc_smc(MLNX_HANDLE_GET_MFG_INFO, -+ MLNX_MFG_TYPE_SKU_0 + word, -+ 0, 0, 0, 0, 0, 0, &res); -+ if (res.a0) { -+ mutex_unlock(&mfg_ops_lock); -+ return -EPERM; -+ } -+ sku_data[word] = res.a1; -+ } -+ mutex_unlock(&mfg_ops_lock); -+ memcpy(sku, sku_data, MLNX_MFG_SKU_VAL_LEN); -+ -+ return snprintf(buf, PAGE_SIZE, "%s", sku); - } - --static ssize_t lifecycle_state_show(struct device *dev, -- struct device_attribute *attr, char *buf) -+static ssize_t sku_store(struct device_driver *drv, const char *buf, -+ size_t count) - { -- int lc_state; -+ u64 sku[MLNX_MFG_VAL_QWORD_CNT(SKU)] = { 0 }; -+ struct arm_smccc_res res; -+ int word; - -- lc_state = mlxbf_bootctl_smc(MLXBF_BOOTCTL_GET_TBB_FUSE_STATUS, -- MLXBF_BOOTCTL_FUSE_STATUS_LIFECYCLE); -- if (lc_state < 0) -- return lc_state; -+ if (count > MLNX_MFG_SKU_VAL_LEN) -+ return -EINVAL; - -- lc_state &= -- MLXBF_BOOTCTL_SB_TEST_MASK | MLXBF_BOOTCTL_SB_SECURE_MASK; -+ memcpy(sku, buf, count); - -- /* -- * If the test bits are set, we specify that the current state may be -- * due to using the test bits. -- */ -- if (lc_state & MLXBF_BOOTCTL_SB_TEST_MASK) { -- lc_state &= MLXBF_BOOTCTL_SB_SECURE_MASK; -+ mutex_lock(&mfg_ops_lock); -+ for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(SKU); word++) { -+ arm_smccc_smc(MLNX_HANDLE_SET_MFG_INFO, -+ MLNX_MFG_TYPE_SKU_0 + word, -+ sizeof(u64), sku[word], 0, 0, 0, 0, &res); -+ if (res.a0) { -+ mutex_unlock(&mfg_ops_lock); -+ return -EPERM; -+ } -+ } -+ mutex_unlock(&mfg_ops_lock); - -- return sprintf(buf, "%s(test)\n", -- mlxbf_bootctl_lifecycle_states[lc_state]); -+ return count; -+} -+ -+static ssize_t modl_show(struct device_driver *drv, char *buf) -+{ -+ u64 modl_data[MLNX_MFG_VAL_QWORD_CNT(MODL)] = { 0 }; -+ char modl[MLNX_MFG_MODL_VAL_LEN + 1] = { 0 }; -+ struct arm_smccc_res res; -+ int word; -+ -+ mutex_lock(&mfg_ops_lock); -+ for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(MODL); word++) { -+ arm_smccc_smc(MLNX_HANDLE_GET_MFG_INFO, -+ MLNX_MFG_TYPE_MODL_0 + word, -+ 0, 0, 0, 0, 0, 0, &res); -+ if (res.a0) { -+ mutex_unlock(&mfg_ops_lock); -+ return -EPERM; -+ } -+ modl_data[word] = res.a1; - } -+ mutex_unlock(&mfg_ops_lock); -+ memcpy(modl, modl_data, MLNX_MFG_MODL_VAL_LEN); - -- return sprintf(buf, "%s\n", mlxbf_bootctl_lifecycle_states[lc_state]); -+ return snprintf(buf, PAGE_SIZE, "%s", modl); - } - --static ssize_t secure_boot_fuse_state_show(struct device *dev, -- struct device_attribute *attr, -- char *buf) -+static ssize_t modl_store(struct device_driver *drv, const char *buf, -+ size_t count) - { -- int burnt, valid, key, key_state, buf_len = 0, upper_key_used = 0; -- const char *status; -+ u64 modl[MLNX_MFG_VAL_QWORD_CNT(MODL)] = { 0 }; -+ struct arm_smccc_res res; -+ int word; -+ -+ if (count > MLNX_MFG_MODL_VAL_LEN) -+ return -EINVAL; -+ -+ memcpy(modl, buf, count); -+ -+ mutex_lock(&mfg_ops_lock); -+ for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(MODL); word++) { -+ arm_smccc_smc(MLNX_HANDLE_SET_MFG_INFO, -+ MLNX_MFG_TYPE_MODL_0 + word, -+ sizeof(u64), modl[word], 0, 0, 0, 0, &res); -+ if (res.a0) { -+ mutex_unlock(&mfg_ops_lock); -+ return -EPERM; -+ } -+ } -+ mutex_unlock(&mfg_ops_lock); -+ -+ return count; -+} -+ -+static ssize_t sn_show(struct device_driver *drv, char *buf) -+{ -+ u64 sn_data[MLNX_MFG_VAL_QWORD_CNT(SN)] = { 0 }; -+ char sn[MLNX_MFG_SN_VAL_LEN + 1] = { 0 }; -+ struct arm_smccc_res res; -+ int word; -+ -+ mutex_lock(&mfg_ops_lock); -+ for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(SN); word++) { -+ arm_smccc_smc(MLNX_HANDLE_GET_MFG_INFO, -+ MLNX_MFG_TYPE_SN_0 + word, -+ 0, 0, 0, 0, 0, 0, &res); -+ if (res.a0) { -+ mutex_unlock(&mfg_ops_lock); -+ return -EPERM; -+ } -+ sn_data[word] = res.a1; -+ } -+ mutex_unlock(&mfg_ops_lock); -+ memcpy(sn, sn_data, MLNX_MFG_SN_VAL_LEN); -+ -+ return snprintf(buf, PAGE_SIZE, "%s", sn); -+} -+ -+static ssize_t sn_store(struct device_driver *drv, const char *buf, -+ size_t count) -+{ -+ u64 sn[MLNX_MFG_VAL_QWORD_CNT(SN)] = { 0 }; -+ struct arm_smccc_res res; -+ int word; -+ -+ if (count > MLNX_MFG_SN_VAL_LEN) -+ return -EINVAL; -+ -+ memcpy(sn, buf, count); -+ -+ mutex_lock(&mfg_ops_lock); -+ for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(SN); word++) { -+ arm_smccc_smc(MLNX_HANDLE_SET_MFG_INFO, -+ MLNX_MFG_TYPE_SN_0 + word, -+ sizeof(u64), sn[word], 0, 0, 0, 0, &res); -+ if (res.a0) { -+ mutex_unlock(&mfg_ops_lock); -+ return -EPERM; -+ } -+ } -+ mutex_unlock(&mfg_ops_lock); -+ -+ return count; -+} -+ -+static ssize_t uuid_show(struct device_driver *drv, char *buf) -+{ -+ u64 uuid_data[MLNX_MFG_VAL_QWORD_CNT(UUID)] = { 0 }; -+ char uuid[MLNX_MFG_UUID_VAL_LEN + 1] = { 0 }; -+ struct arm_smccc_res res; -+ int word; -+ -+ mutex_lock(&mfg_ops_lock); -+ for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(UUID); word++) { -+ arm_smccc_smc(MLNX_HANDLE_GET_MFG_INFO, -+ MLNX_MFG_TYPE_UUID_0 + word, -+ 0, 0, 0, 0, 0, 0, &res); -+ if (res.a0) { -+ mutex_unlock(&mfg_ops_lock); -+ return -EPERM; -+ } -+ uuid_data[word] = res.a1; -+ } -+ mutex_unlock(&mfg_ops_lock); -+ memcpy(uuid, uuid_data, MLNX_MFG_UUID_VAL_LEN); -+ -+ return snprintf(buf, PAGE_SIZE, "%s", uuid); -+} -+ -+static ssize_t uuid_store(struct device_driver *drv, const char *buf, -+ size_t count) -+{ -+ u64 uuid[MLNX_MFG_VAL_QWORD_CNT(UUID)] = { 0 }; -+ struct arm_smccc_res res; -+ int word; - -- key_state = mlxbf_bootctl_smc(MLXBF_BOOTCTL_GET_TBB_FUSE_STATUS, -- MLXBF_BOOTCTL_FUSE_STATUS_KEYS); -- if (key_state < 0) -- return key_state; -+ if (count > MLNX_MFG_UUID_VAL_LEN) -+ return -EINVAL; -+ -+ memcpy(uuid, buf, count); -+ -+ mutex_lock(&mfg_ops_lock); -+ for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(UUID); word++) { -+ arm_smccc_smc(MLNX_HANDLE_SET_MFG_INFO, -+ MLNX_MFG_TYPE_UUID_0 + word, -+ sizeof(u64), uuid[word], 0, 0, 0, 0, &res); -+ if (res.a0) { -+ mutex_unlock(&mfg_ops_lock); -+ return -EPERM; -+ } -+ } -+ mutex_unlock(&mfg_ops_lock); -+ -+ return count; -+} -+ -+static ssize_t rev_show(struct device_driver *drv, char *buf) -+{ -+ u64 rev_data[MLNX_MFG_VAL_QWORD_CNT(REV)] = { 0 }; -+ char rev[MLNX_MFG_REV_VAL_LEN + 1] = { 0 }; -+ struct arm_smccc_res res; -+ int word; -+ -+ mutex_lock(&mfg_ops_lock); -+ for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(REV); word++) { -+ arm_smccc_smc(MLNX_HANDLE_GET_MFG_INFO, -+ MLNX_MFG_TYPE_REV + word, -+ 0, 0, 0, 0, 0, 0, &res); -+ if (res.a0) { -+ mutex_unlock(&mfg_ops_lock); -+ return -EPERM; -+ } -+ rev_data[word] = res.a1; -+ } -+ mutex_unlock(&mfg_ops_lock); -+ memcpy(rev, rev_data, MLNX_MFG_REV_VAL_LEN); -+ -+ return snprintf(buf, PAGE_SIZE, "%s", rev); -+} -+ -+static ssize_t rev_store(struct device_driver *drv, const char *buf, -+ size_t count) -+{ -+ u64 rev[MLNX_MFG_VAL_QWORD_CNT(REV)] = { 0 }; -+ struct arm_smccc_res res; -+ int word; -+ -+ if (count > MLNX_MFG_REV_VAL_LEN) -+ return -EINVAL; -+ -+ memcpy(rev, buf, count); -+ -+ mutex_lock(&mfg_ops_lock); -+ for (word = 0; word < MLNX_MFG_VAL_QWORD_CNT(REV); word++) { -+ arm_smccc_smc(MLNX_HANDLE_SET_MFG_INFO, -+ MLNX_MFG_TYPE_REV + word, -+ sizeof(u64), rev[word], 0, 0, 0, 0, &res); -+ if (res.a0) { -+ mutex_unlock(&mfg_ops_lock); -+ return -EPERM; -+ } -+ } -+ mutex_unlock(&mfg_ops_lock); -+ -+ return count; -+} -+ -+static ssize_t mfg_lock_store(struct device_driver *drv, const char *buf, -+ size_t count) -+{ -+ unsigned long val; -+ int err; -+ -+ err = kstrtoul(buf, 10, &val); -+ if (err) -+ return err; -+ -+ if (val != 1) -+ return -EINVAL; -+ -+ mutex_lock(&mfg_ops_lock); -+ smc_call0(MLNX_HANDLE_LOCK_MFG_INFO); -+ mutex_unlock(&mfg_ops_lock); -+ -+ return count; -+} -+ -+/* Log header format. */ -+#define RSH_LOG_TYPE_SHIFT 56 -+#define RSH_LOG_LEN_SHIFT 48 -+#define RSH_LOG_LEVEL_SHIFT 0 -+ -+/* Module ID and type used here. */ -+#define BF_RSH_LOG_TYPE_UNKNOWN 0x00ULL -+#define BF_RSH_LOG_TYPE_PANIC 0x01ULL -+#define BF_RSH_LOG_TYPE_EXCEPTION 0x02ULL -+#define BF_RSH_LOG_TYPE_UNUSED 0x03ULL -+#define BF_RSH_LOG_TYPE_MSG 0x04ULL -+ -+/* Utility macro. */ -+#define BF_RSH_LOG_MOD_MASK 0x0FULL -+#define BF_RSH_LOG_MOD_SHIFT 60 -+#define BF_RSH_LOG_TYPE_MASK 0x0FULL -+#define BF_RSH_LOG_TYPE_SHIFT 56 -+#define BF_RSH_LOG_LEN_MASK 0x7FULL -+#define BF_RSH_LOG_LEN_SHIFT 48 -+#define BF_RSH_LOG_ARG_MASK 0xFFFFFFFFULL -+#define BF_RSH_LOG_ARG_SHIFT 16 -+#define BF_RSH_LOG_HAS_ARG_MASK 0xFFULL -+#define BF_RSH_LOG_HAS_ARG_SHIFT 8 -+#define BF_RSH_LOG_LEVEL_MASK 0xFFULL -+#define BF_RSH_LOG_LEVEL_SHIFT 0 -+#define BF_RSH_LOG_PC_MASK 0xFFFFFFFFULL -+#define BF_RSH_LOG_PC_SHIFT 0 -+#define BF_RSH_LOG_SYNDROME_MASK 0xFFFFFFFFULL -+#define BF_RSH_LOG_SYNDROME_SHIFT 0 -+ -+#define BF_RSH_LOG_HEADER_GET(f, h) \ -+ (((h) >> BF_RSH_LOG_##f##_SHIFT) & BF_RSH_LOG_##f##_MASK) -+ -+/* Log message level. */ -+enum { -+ RSH_LOG_INFO, -+ RSH_LOG_WARN, -+ RSH_LOG_ERR -+}; -+ -+/* Log module */ -+const char * const rsh_log_mod[] = { -+ "MISC", "BL1", "BL2", "BL2R", "BL31", "UEFI" -+}; -+ -+const char *rsh_log_level[] = {"INFO", "WARN", "ERR", "ASSERT"}; -+ -+#define AARCH64_MRS_REG_SHIFT 5 -+#define AARCH64_MRS_REG_MASK 0xffff -+#define AARCH64_ESR_ELX_EXCEPTION_CLASS_SHIFT 26 -+ -+struct rsh_log_reg { -+ char *name; -+ u32 opcode; -+} rsh_log_reg; -+ -+static struct rsh_log_reg rsh_log_regs[] = { -+ {"actlr_el1", 0b1100000010000001}, -+ {"actlr_el2", 0b1110000010000001}, -+ {"actlr_el3", 0b1111000010000001}, -+ {"afsr0_el1", 0b1100001010001000}, -+ {"afsr0_el2", 0b1110001010001000}, -+ {"afsr0_el3", 0b1111001010001000}, -+ {"afsr1_el1", 0b1100001010001001}, -+ {"afsr1_el2", 0b1110001010001001}, -+ {"afsr1_el3", 0b1111001010001001}, -+ {"amair_el1", 0b1100010100011000}, -+ {"amair_el2", 0b1110010100011000}, -+ {"amair_el3", 0b1111010100011000}, -+ {"ccsidr_el1", 0b1100100000000000}, -+ {"clidr_el1", 0b1100100000000001}, -+ {"cntkctl_el1", 0b1100011100001000}, -+ {"cntp_ctl_el0", 0b1101111100010001}, -+ {"cntp_cval_el0", 0b1101111100010010}, -+ {"cntv_ctl_el0", 0b1101111100011001}, -+ {"cntv_cval_el0", 0b1101111100011010}, -+ {"contextidr_el1", 0b1100011010000001}, -+ {"cpacr_el1", 0b1100000010000010}, -+ {"cptr_el2", 0b1110000010001010}, -+ {"cptr_el3", 0b1111000010001010}, -+ {"vtcr_el2", 0b1110000100001010}, -+ {"ctr_el0", 0b1101100000000001}, -+ {"currentel", 0b1100001000010010}, -+ {"dacr32_el2", 0b1110000110000000}, -+ {"daif", 0b1101101000010001}, -+ {"dczid_el0", 0b1101100000000111}, -+ {"dlr_el0", 0b1101101000101001}, -+ {"dspsr_el0", 0b1101101000101000}, -+ {"elr_el1", 0b1100001000000001}, -+ {"elr_el2", 0b1110001000000001}, -+ {"elr_el3", 0b1111001000000001}, -+ {"esr_el1", 0b1100001010010000}, -+ {"esr_el2", 0b1110001010010000}, -+ {"esr_el3", 0b1111001010010000}, -+ {"esselr_el1", 0b1101000000000000}, -+ {"far_el1", 0b1100001100000000}, -+ {"far_el2", 0b1110001100000000}, -+ {"far_el3", 0b1111001100000000}, -+ {"fpcr", 0b1101101000100000}, -+ {"fpexc32_el2", 0b1110001010011000}, -+ {"fpsr", 0b1101101000100001}, -+ {"hacr_el2", 0b1110000010001111}, -+ {"har_el2", 0b1110000010001000}, -+ {"hpfar_el2", 0b1110001100000100}, -+ {"hstr_el2", 0b1110000010001011}, -+ {"far_el1", 0b1100001100000000}, -+ {"far_el2", 0b1110001100000000}, -+ {"far_el3", 0b1111001100000000}, -+ {"hcr_el2", 0b1110000010001000}, -+ {"hpfar_el2", 0b1110001100000100}, -+ {"id_aa64afr0_el1", 0b1100000000101100}, -+ {"id_aa64afr1_el1", 0b1100000000101101}, -+ {"id_aa64dfr0_el1", 0b1100000000101100}, -+ {"id_aa64isar0_el1", 0b1100000000110000}, -+ {"id_aa64isar1_el1", 0b1100000000110001}, -+ {"id_aa64mmfr0_el1", 0b1100000000111000}, -+ {"id_aa64mmfr1_el1", 0b1100000000111001}, -+ {"id_aa64pfr0_el1", 0b1100000000100000}, -+ {"id_aa64pfr1_el1", 0b1100000000100001}, -+ {"ifsr32_el2", 0b1110001010000001}, -+ {"isr_el1", 0b1100011000001000}, -+ {"mair_el1", 0b1100010100010000}, -+ {"mair_el2", 0b1110010100010000}, -+ {"mair_el3", 0b1111010100010000}, -+ {"midr_el1", 0b1100000000000000}, -+ {"mpidr_el1", 0b1100000000000101}, -+ {"nzcv", 0b1101101000010000}, -+ {"revidr_el1", 0b1100000000000110}, -+ {"rmr_el3", 0b1111011000000010}, -+ {"par_el1", 0b1100001110100000}, -+ {"rvbar_el3", 0b1111011000000001}, -+ {"scr_el3", 0b1111000010001000}, -+ {"sctlr_el1", 0b1100000010000000}, -+ {"sctlr_el2", 0b1110000010000000}, -+ {"sctlr_el3", 0b1111000010000000}, -+ {"sp_el0", 0b1100001000001000}, -+ {"sp_el1", 0b1110001000001000}, -+ {"spsel", 0b1100001000010000}, -+ {"spsr_abt", 0b1110001000011001}, -+ {"spsr_el1", 0b1100001000000000}, -+ {"spsr_el2", 0b1110001000000000}, -+ {"spsr_el3", 0b1111001000000000}, -+ {"spsr_fiq", 0b1110001000011011}, -+ {"spsr_irq", 0b1110001000011000}, -+ {"spsr_und", 0b1110001000011010}, -+ {"tcr_el1", 0b1100000100000010}, -+ {"tcr_el2", 0b1110000100000010}, -+ {"tcr_el3", 0b1111000100000010}, -+ {"tpidr_el0", 0b1101111010000010}, -+ {"tpidr_el1", 0b1100011010000100}, -+ {"tpidr_el2", 0b1110011010000010}, -+ {"tpidr_el3", 0b1111011010000010}, -+ {"tpidpro_el0", 0b1101111010000011}, -+ {"vbar_el1", 0b1100011000000000}, -+ {"vbar_el2", 0b1110011000000000}, -+ {"vbar_el3", 0b1111011000000000}, -+ {"vmpidr_el2", 0b1110000000000101}, -+ {"vpidr_el2", 0b1110000000000000}, -+ {"ttbr0_el1", 0b1100000100000000}, -+ {"ttbr0_el2", 0b1110000100000000}, -+ {"ttbr0_el3", 0b1111000100000000}, -+ {"ttbr1_el1", 0b1100000100000001}, -+ {"vtcr_el2", 0b1110000100001010}, -+ {"vttbr_el2", 0b1110000100001000}, -+ {NULL, 0b0000000000000000}, -+}; -+ -+/* Size(8-byte words) of the log buffer. */ -+#define RSH_SCRATCH_BUF_CTL_IDX_MASK 0x7f -+ -+static int rsh_log_sem_lock(void) -+{ -+ unsigned long timeout; -+ -+ /* Take the semaphore. */ -+ timeout = jiffies + msecs_to_jiffies(100); -+ while (readq(rsh_semaphore)) { -+ if (time_after(jiffies, timeout)) -+ return -ETIMEDOUT; -+ } -+ -+ return 0; -+} -+ -+static void rsh_log_sem_unlock(void) -+{ -+ writeq(0, rsh_semaphore); -+} -+ -+static ssize_t rsh_log_store(struct device_driver *drv, const char *buf, -+ size_t count) -+{ -+ int idx, num, len, size = (int)count, level = RSH_LOG_INFO, rc; -+ u64 data; -+ -+ if (!size) -+ return -EINVAL; -+ -+ if (!rsh_semaphore || !rsh_scratch_buf_ctl) -+ return -EOPNOTSUPP; -+ -+ /* Ignore line break at the end. */ -+ if (buf[size-1] == 0xa) -+ size--; -+ -+ /* Check the message prefix. */ -+ for (idx = 0; idx < ARRAY_SIZE(rsh_log_level); idx++) { -+ len = strlen(rsh_log_level[idx]); -+ if (len + 1 < size && !strncmp(buf, rsh_log_level[idx], len)) { -+ buf += len + 1; -+ size -= len + 1; -+ level = idx; -+ break; -+ } -+ } -+ -+ /* Ignore leading spaces. */ -+ while (size > 0 && buf[0] == ' ') { -+ size--; -+ buf++; -+ } -+ -+ /* Take the semaphore. */ -+ rc = rsh_log_sem_lock(); -+ if (rc) -+ return rc; -+ -+ /* Calculate how many words are available. */ -+ num = (size + sizeof(u64) - 1) / sizeof(u64); -+ idx = readq(rsh_scratch_buf_ctl); -+ if (idx + num + 1 >= RSH_SCRATCH_BUF_CTL_IDX_MASK) -+ num = RSH_SCRATCH_BUF_CTL_IDX_MASK - idx - 1; -+ if (num <= 0) -+ goto done; -+ -+ /* Write Header. */ -+ data = (BF_RSH_LOG_TYPE_MSG << RSH_LOG_TYPE_SHIFT) | -+ ((u64)num << RSH_LOG_LEN_SHIFT) | -+ ((u64)level << RSH_LOG_LEVEL_SHIFT); -+ writeq(data, rsh_scratch_buf_data); -+ -+ /* Write message. */ -+ for (idx = 0, len = size; idx < num && len > 0; idx++) { -+ if (len <= sizeof(u64)) { -+ data = 0; -+ memcpy(&data, buf, len); -+ len = 0; -+ } else { -+ memcpy(&data, buf, sizeof(u64)); -+ len -= sizeof(u64); -+ buf += sizeof(u64); -+ } -+ writeq(data, rsh_scratch_buf_data); -+ } -+ -+done: -+ /* Release the semaphore. */ -+ rsh_log_sem_unlock(); -+ -+ /* Ignore the rest if no more space. */ -+ return count; -+} -+ -+static char *rsh_log_get_reg_name(u64 opcode) -+{ -+ struct rsh_log_reg *reg = rsh_log_regs; -+ -+ while (reg->name) { -+ if (reg->opcode == opcode) -+ return reg->name; -+ reg++; -+ } -+ -+ return "unknown"; -+} -+ -+static int rsh_log_show_crash(u64 hdr, char *buf, int size) -+{ -+ int i, module, type, len, n = 0; -+ u32 pc, syndrome, ec; -+ u64 opcode, data; -+ char *p = buf; -+ -+ module = BF_RSH_LOG_HEADER_GET(MOD, hdr); -+ if (module >= ARRAY_SIZE(rsh_log_mod)) -+ module = 0; -+ type = BF_RSH_LOG_HEADER_GET(TYPE, hdr); -+ len = BF_RSH_LOG_HEADER_GET(LEN, hdr); -+ -+ if (type == BF_RSH_LOG_TYPE_EXCEPTION) { -+ syndrome = BF_RSH_LOG_HEADER_GET(SYNDROME, hdr); -+ ec = syndrome >> AARCH64_ESR_ELX_EXCEPTION_CLASS_SHIFT; -+ n = snprintf(p, size, " Exception(%s): syndrome = 0x%x%s\n", -+ rsh_log_mod[module], syndrome, -+ (ec == 0x24 || ec == 0x25) ? "(Data Abort)" : -+ (ec == 0x2f) ? "(SError)" : ""); -+ } else if (type == BF_RSH_LOG_TYPE_PANIC) { -+ pc = BF_RSH_LOG_HEADER_GET(PC, hdr); -+ n = snprintf(p, size, -+ " PANIC(%s): PC = 0x%x\n", rsh_log_mod[module], -+ pc); -+ } -+ if (n > 0) { -+ p += n; -+ size -= n; -+ } - - /* -- * key_state contains the bits for 4 Key versions, loaded from eFuses -- * after a hard reset. Lower 4 bits are a thermometer code indicating -- * key programming has started for key n (0000 = none, 0001 = version 0, -- * 0011 = version 1, 0111 = version 2, 1111 = version 3). Upper 4 bits -- * are a thermometer code indicating key programming has completed for -- * key n (same encodings as the start bits). This allows for detection -- * of an interruption in the programming process which has left the key -- * partially programmed (and thus invalid). The process is to burn the -- * eFuse for the new key start bit, burn the key eFuses, then burn the -- * eFuse for the new key complete bit. -- * -- * For example 0000_0000: no key valid, 0001_0001: key version 0 valid, -- * 0011_0011: key 1 version valid, 0011_0111: key version 2 started -- * programming but did not complete, etc. The most recent key for which -- * both start and complete bit is set is loaded. On soft reset, this -- * register is not modified. -+ * Read the registers in a loop. 'len' is the total number of words in -+ * 8-bytes. Two words are read in each loop. - */ -- for (key = MLXBF_SB_KEY_NUM - 1; key >= 0; key--) { -- burnt = key_state & BIT(key); -- valid = key_state & BIT(key + MLXBF_SB_KEY_NUM); -+ for (i = 0; i < len/2; i++) { -+ opcode = readq(rsh_scratch_buf_data); -+ data = readq(rsh_scratch_buf_data); -+ -+ opcode = (opcode >> AARCH64_MRS_REG_SHIFT) & -+ AARCH64_MRS_REG_MASK; -+ n = snprintf(p, size, -+ " %-16s0x%llx\n", rsh_log_get_reg_name(opcode), -+ (unsigned long long)data); -+ if (n > 0) { -+ p += n; -+ size -= n; -+ } -+ } - -- if (burnt && valid) -- upper_key_used = 1; -+ return p - buf; -+} - -- if (upper_key_used) { -- if (burnt) -- status = valid ? "Used" : "Wasted"; -- else -- status = valid ? "Invalid" : "Skipped"; -- } else { -- if (burnt) -- status = valid ? "InUse" : "Incomplete"; -- else -- status = valid ? "Invalid" : "Free"; -+static int rsh_log_format_msg(char *buf, int size, const char *msg, ...) -+{ -+ va_list args; -+ int len; -+ -+ va_start(args, msg); -+ len = vsnprintf(buf, size, msg, args); -+ va_end(args); -+ -+ return len; -+} -+ -+static int rsh_log_show_msg(u64 hdr, char *buf, int size) -+{ -+ int has_arg = BF_RSH_LOG_HEADER_GET(HAS_ARG, hdr); -+ int level = BF_RSH_LOG_HEADER_GET(LEVEL, hdr); -+ int module = BF_RSH_LOG_HEADER_GET(MOD, hdr); -+ int len = BF_RSH_LOG_HEADER_GET(LEN, hdr); -+ u32 arg = BF_RSH_LOG_HEADER_GET(ARG, hdr); -+ char *msg, *p; -+ u64 data; -+ -+ if (len <= 0) -+ return -EINVAL; -+ -+ if (module >= ARRAY_SIZE(rsh_log_mod)) -+ module = 0; -+ -+ if (level >= ARRAY_SIZE(rsh_log_level)) -+ level = 0; -+ -+ msg = kmalloc(len * sizeof(u64) + 1, GFP_KERNEL); -+ if (!msg) -+ return 0; -+ p = msg; -+ -+ while (len--) { -+ data = readq(rsh_scratch_buf_data); -+ memcpy(p, &data, sizeof(data)); -+ p += sizeof(data); -+ } -+ *p = '\0'; -+ if (!has_arg) { -+ len = snprintf(buf, size, " %s[%s]: %s\n", rsh_log_level[level], -+ rsh_log_mod[module], msg); -+ } else { -+ len = snprintf(buf, size, " %s[%s]: ", rsh_log_level[level], -+ rsh_log_mod[module]); -+ len += rsh_log_format_msg(buf + len, size - len, msg, arg); -+ len += snprintf(buf + len, size - len, "\n"); -+ } -+ -+ kfree(msg); -+ return len; -+} -+ -+static ssize_t rsh_log_show(struct device_driver *drv, char *buf) -+{ -+ u64 hdr; -+ char *p = buf; -+ int i, n, rc, idx, type, len, size = PAGE_SIZE; -+ -+ if (!rsh_semaphore || !rsh_scratch_buf_ctl) -+ return -EOPNOTSUPP; -+ -+ /* Take the semaphore. */ -+ rc = rsh_log_sem_lock(); -+ if (rc) -+ return rc; -+ -+ /* Save the current index and read from 0. */ -+ idx = readq(rsh_scratch_buf_ctl) & RSH_SCRATCH_BUF_CTL_IDX_MASK; -+ if (!idx) -+ goto done; -+ writeq(0, rsh_scratch_buf_ctl); -+ -+ i = 0; -+ while (i < idx) { -+ hdr = readq(rsh_scratch_buf_data); -+ type = BF_RSH_LOG_HEADER_GET(TYPE, hdr); -+ len = BF_RSH_LOG_HEADER_GET(LEN, hdr); -+ i += 1 + len; -+ if (i > idx) -+ break; -+ -+ switch (type) { -+ case BF_RSH_LOG_TYPE_PANIC: -+ case BF_RSH_LOG_TYPE_EXCEPTION: -+ n = rsh_log_show_crash(hdr, p, size); -+ p += n; -+ size -= n; -+ break; -+ case BF_RSH_LOG_TYPE_MSG: -+ n = rsh_log_show_msg(hdr, p, size); -+ p += n; -+ size -= n; -+ break; -+ default: -+ /* Drain this message. */ -+ while (len--) -+ (void) readq(rsh_scratch_buf_data); -+ break; - } -- buf_len += sprintf(buf + buf_len, "%d:%s ", key, status); - } -- buf_len += sprintf(buf + buf_len, "\n"); - -- return buf_len; -+ if (rsh_log_clear_on_read) -+ writeq(0, rsh_scratch_buf_ctl); -+ else -+ writeq(idx, rsh_scratch_buf_ctl); -+ -+done: -+ /* Release the semaphore. */ -+ rsh_log_sem_unlock(); -+ -+ return p - buf; - } - --static DEVICE_ATTR_RW(post_reset_wdog); --static DEVICE_ATTR_RW(reset_action); --static DEVICE_ATTR_RW(second_reset_action); --static DEVICE_ATTR_RO(lifecycle_state); --static DEVICE_ATTR_RO(secure_boot_fuse_state); -+static DRIVER_ATTR_RW(post_reset_wdog); -+static DRIVER_ATTR_RW(reset_action); -+static DRIVER_ATTR_RW(second_reset_action); -+static DRIVER_ATTR_RO(lifecycle_state); -+static DRIVER_ATTR_RO(secure_boot_fuse_state); -+static DRIVER_ATTR_WO(fw_reset); -+static DRIVER_ATTR_RW(oob_mac); -+static DRIVER_ATTR_RW(opn); -+static DRIVER_ATTR_RW(sku); -+static DRIVER_ATTR_RW(modl); -+static DRIVER_ATTR_RW(sn); -+static DRIVER_ATTR_RW(uuid); -+static DRIVER_ATTR_RW(rev); -+static DRIVER_ATTR_WO(mfg_lock); -+static DRIVER_ATTR_RW(rsh_log); - --static struct attribute *mlxbf_bootctl_attrs[] = { -- &dev_attr_post_reset_wdog.attr, -- &dev_attr_reset_action.attr, -- &dev_attr_second_reset_action.attr, -- &dev_attr_lifecycle_state.attr, -- &dev_attr_secure_boot_fuse_state.attr, -+static struct attribute *mbc_dev_attrs[] = { -+ &driver_attr_post_reset_wdog.attr, -+ &driver_attr_reset_action.attr, -+ &driver_attr_second_reset_action.attr, -+ &driver_attr_lifecycle_state.attr, -+ &driver_attr_secure_boot_fuse_state.attr, -+ &driver_attr_fw_reset.attr, -+ &driver_attr_oob_mac.attr, -+ &driver_attr_opn.attr, -+ &driver_attr_sku.attr, -+ &driver_attr_modl.attr, -+ &driver_attr_sn.attr, -+ &driver_attr_uuid.attr, -+ &driver_attr_rev.attr, -+ &driver_attr_mfg_lock.attr, -+ &driver_attr_rsh_log.attr, - NULL - }; - --ATTRIBUTE_GROUPS(mlxbf_bootctl); -+static struct attribute_group mbc_attr_group = { -+ .attrs = mbc_dev_attrs -+}; - --static const struct acpi_device_id mlxbf_bootctl_acpi_ids[] = { -+static const struct attribute_group *mbc_attr_groups[] = { -+ &mbc_attr_group, -+ NULL -+}; -+ -+static const struct of_device_id mbc_dt_ids[] = { -+ {.compatible = "mellanox,bootctl"}, -+ {}, -+}; -+ -+MODULE_DEVICE_TABLE(of, mbc_dt_ids); -+ -+static const struct acpi_device_id mbc_acpi_ids[] = { - {"MLNXBF04", 0}, -- {} -+ {}, - }; - --MODULE_DEVICE_TABLE(acpi, mlxbf_bootctl_acpi_ids); -+MODULE_DEVICE_TABLE(acpi, mbc_acpi_ids); - --static bool mlxbf_bootctl_guid_match(const guid_t *guid, -- const struct arm_smccc_res *res) -+static ssize_t mbc_bootfifo_read_raw(struct file *filp, struct kobject *kobj, -+ struct bin_attribute *bin_attr, -+ char *buf, loff_t pos, size_t count) - { -- guid_t id = GUID_INIT(res->a0, res->a1, res->a1 >> 16, -- res->a2, res->a2 >> 8, res->a2 >> 16, -- res->a2 >> 24, res->a3, res->a3 >> 8, -- res->a3 >> 16, res->a3 >> 24); -+ unsigned long timeout = jiffies + HZ / 2; -+ char *p = buf; -+ int cnt = 0; -+ u64 data; - -- return guid_equal(guid, &id); -+ /* Give up reading if no more data within 500ms. */ -+ while (count >= sizeof(data)) { -+ if (!cnt) { -+ cnt = readq(rsh_boot_cnt); -+ if (!cnt) { -+ if (time_after(jiffies, timeout)) -+ break; -+ udelay(10); -+ continue; -+ } -+ } -+ -+ data = readq(rsh_boot_data); -+ memcpy(p, &data, sizeof(data)); -+ count -= sizeof(data); -+ p += sizeof(data); -+ cnt--; -+ timeout = jiffies + HZ / 2; -+ } -+ -+ return p - buf; - } - --static int mlxbf_bootctl_probe(struct platform_device *pdev) -+static struct bin_attribute mbc_bootfifo_sysfs_attr = { -+ .attr = { .name = "bootfifo", .mode = 0400 }, -+ .read = mbc_bootfifo_read_raw, -+}; -+ -+static int mbc_probe(struct platform_device *pdev) - { -- struct arm_smccc_res res = { 0 }; -- guid_t guid; -- int ret; -+ struct resource *resource; -+ struct arm_smccc_res res; -+ void __iomem *data; -+ int err; - -- /* Ensure we have the UUID we expect for this service. */ -- arm_smccc_smc(MLXBF_BOOTCTL_SIP_SVC_UID, 0, 0, 0, 0, 0, 0, 0, &res); -- guid_parse(mlxbf_bootctl_svc_uuid_str, &guid); -- if (!mlxbf_bootctl_guid_match(&guid, &res)) -+ resource = platform_get_resource(pdev, IORESOURCE_MEM, 0); -+ if (!resource) - return -ENODEV; -+ rsh_boot_data = devm_ioremap_resource(&pdev->dev, resource); -+ if (IS_ERR(rsh_boot_data)) -+ return PTR_ERR(rsh_boot_data); -+ -+ resource = platform_get_resource(pdev, IORESOURCE_MEM, 1); -+ if (!resource) -+ return -ENODEV; -+ rsh_boot_cnt = devm_ioremap_resource(&pdev->dev, resource); -+ if (IS_ERR(rsh_boot_cnt)) -+ return PTR_ERR(rsh_boot_cnt); -+ -+ resource = platform_get_resource(pdev, IORESOURCE_MEM, 2); -+ if (resource) { -+ data = devm_ioremap_resource(&pdev->dev, resource); -+ if (!IS_ERR(data)) -+ rsh_semaphore = data; -+ } -+ -+ resource = platform_get_resource(pdev, IORESOURCE_MEM, 3); -+ if (resource) { -+ data = devm_ioremap_resource(&pdev->dev, resource); -+ if (!IS_ERR(data)) { -+ rsh_scratch_buf_ctl = data + RSH_SCRATCH_BUF_CTL_OFF; -+ rsh_scratch_buf_data = data + RSH_SCRATCH_BUF_DATA_OFF; -+ } -+ } - - /* -- * When watchdog is used, it sets boot mode to MLXBF_BOOTCTL_SWAP_EMMC -+ * Ensure we have the UUID we expect for this service. -+ * Note that the functionality we want is present in the first -+ * released version of this service, so we don't check the version. -+ */ -+ arm_smccc_smc(MLNX_SIP_SVC_UID, 0, 0, 0, 0, 0, 0, 0, &res); -+ if (res.a0 != 0x89c036b4 || res.a1 != 0x11e6e7d7 || -+ res.a2 != 0x1a009787 || res.a3 != 0xc4bf00ca) -+ return -ENODEV; -+ -+ /* -+ * When watchdog is used, it sets the boot mode to MLNX_BOOT_SWAP_EMMC - * in case of boot failures. However it doesn't clear the state if there - * is no failure. Restore the default boot mode here to avoid any - * unnecessary boot partition swapping. - */ -- ret = mlxbf_bootctl_smc(MLXBF_BOOTCTL_SET_RESET_ACTION, -- MLXBF_BOOTCTL_EMMC); -- if (ret < 0) -- dev_warn(&pdev->dev, "Unable to reset the EMMC boot mode\n"); -+ if (smc_call1(MLNX_SET_RESET_ACTION, MLNX_BOOT_EMMC) < 0) -+ pr_err("Unable to reset the EMMC boot mode\n"); -+ -+ err = sysfs_create_bin_file(&pdev->dev.kobj, &mbc_bootfifo_sysfs_attr); -+ if (err) { -+ pr_err("Unable to create bootfifo sysfs file, error %d\n", err); -+ return err; -+ } -+ -+ pr_info("%s (version %s)\n", DRIVER_DESCRIPTION, DRIVER_VERSION); -+ -+ return 0; -+} -+ -+static int mbc_remove(struct platform_device *pdev) -+{ -+ sysfs_remove_bin_file(&pdev->dev.kobj, &mbc_bootfifo_sysfs_attr); - - return 0; - } - --static struct platform_driver mlxbf_bootctl_driver = { -- .probe = mlxbf_bootctl_probe, -+static struct platform_driver mbc_driver = { -+ .probe = mbc_probe, -+ .remove = mbc_remove, - .driver = { -- .name = "mlxbf-bootctl", -- .dev_groups = mlxbf_bootctl_groups, -- .acpi_match_table = mlxbf_bootctl_acpi_ids, -+ .name = DRIVER_NAME, -+ .groups = mbc_attr_groups, -+ .of_match_table = mbc_dt_ids, -+ .acpi_match_table = ACPI_PTR(mbc_acpi_ids), - } - }; - --module_platform_driver(mlxbf_bootctl_driver); -+module_platform_driver(mbc_driver); - --MODULE_DESCRIPTION("Mellanox boot control driver"); --MODULE_LICENSE("GPL v2"); --MODULE_AUTHOR("Mellanox Technologies"); -+MODULE_DESCRIPTION(DRIVER_DESCRIPTION); -+MODULE_VERSION(DRIVER_VERSION); -+MODULE_AUTHOR("Shravan Kumar Ramani "); -+MODULE_LICENSE("Dual BSD/GPL"); -diff --git a/drivers/platform/mellanox/mlxbf-bootctl.h b/drivers/platform/mellanox/mlxbf-bootctl.h -index 148fdb43b..3e9dda829 100644 ---- a/drivers/platform/mellanox/mlxbf-bootctl.h -+++ b/drivers/platform/mellanox/mlxbf-bootctl.h -@@ -1,11 +1,22 @@ --/* SPDX-License-Identifier: GPL-2.0 */ -+// SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause - /* -- * Copyright (c) 2019, Mellanox Technologies. All rights reserved. -+ * Copyright (C) 2020 Mellanox Technologies. All rights reserved. -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License v2.0 as published by -+ * the Free Software Foundation. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. - */ - - #ifndef __MLXBF_BOOTCTL_H__ - #define __MLXBF_BOOTCTL_H__ - -+/* BlueField-specific SMC function IDs */ -+ - /* - * Request that the on-chip watchdog be enabled, or disabled, after - * the next chip soft reset. This call does not affect the current -@@ -14,14 +25,14 @@ - * will not be enabled after the next soft reset. Non-zero errors are - * returned as documented below. - */ --#define MLXBF_BOOTCTL_SET_POST_RESET_WDOG 0x82000000 -+#define MLNX_SET_POST_RESET_WDOG 0x82000000 - - /* - * Query the status which has been requested for the on-chip watchdog - * after the next chip soft reset. Returns the interval as set by -- * MLXBF_BOOTCTL_SET_POST_RESET_WDOG. -+ * MLNX_SET_POST_RESET_WDOG. - */ --#define MLXBF_BOOTCTL_GET_POST_RESET_WDOG 0x82000001 -+#define MLNX_GET_POST_RESET_WDOG 0x82000001 - - /* - * Request that a specific boot action be taken at the next soft -@@ -32,72 +43,77 @@ - * invoked. See below for the available MLNX_BOOT_xxx parameter - * values. Non-zero errors are returned as documented below. - */ --#define MLXBF_BOOTCTL_SET_RESET_ACTION 0x82000002 -+#define MLNX_SET_RESET_ACTION 0x82000002 - - /* - * Return the specific boot action which will be taken at the next - * soft reset. Returns the reset action (see below for the parameter -- * values for MLXBF_BOOTCTL_SET_RESET_ACTION). -+ * values for MLNX_SET_RESET_ACTION). - */ --#define MLXBF_BOOTCTL_GET_RESET_ACTION 0x82000003 -+#define MLNX_GET_RESET_ACTION 0x82000003 - - /* - * Request that a specific boot action be taken at the soft reset - * after the next soft reset. For a specified valid boot mode, the - * effect of this call is identical to that of invoking -- * MLXBF_BOOTCTL_SET_RESET_ACTION after the next chip soft reset; in -+ * MLNX_SET_RESET_ACTION after the next chip soft reset; in - * particular, after that reset, the action for the now next reset can -- * be queried with MLXBF_BOOTCTL_GET_RESET_ACTION and modified with -- * MLXBF_BOOTCTL_SET_RESET_ACTION. You may also specify the parameter as -+ * be queried with MLNX_GET_RESET_ACTION and modified with -+ * MLNX_SET_RESET_ACTION. You may also specify the parameter as - * MLNX_BOOT_NONE, which is equivalent to specifying that no call to -- * MLXBF_BOOTCTL_SET_RESET_ACTION be taken after the next chip soft reset. -+ * MLNX_SET_RESET_ACTION be taken after the next chip soft reset. - * This call does not affect the action to be taken at the next soft - * reset. Non-zero errors are returned as documented below. - */ --#define MLXBF_BOOTCTL_SET_SECOND_RESET_ACTION 0x82000004 -+#define MLNX_SET_SECOND_RESET_ACTION 0x82000004 - - /* - * Return the specific boot action which will be taken at the soft - * reset after the next soft reset; this will be one of the valid -- * actions for MLXBF_BOOTCTL_SET_SECOND_RESET_ACTION. -+ * actions for MLNX_SET_SECOND_RESET_ACTION. - */ --#define MLXBF_BOOTCTL_GET_SECOND_RESET_ACTION 0x82000005 -+#define MLNX_GET_SECOND_RESET_ACTION 0x82000005 - - /* - * Return the fuse status of the current chip. The caller should specify - * with the second argument if the state of the lifecycle fuses or the - * version of secure boot fuse keys left should be returned. - */ --#define MLXBF_BOOTCTL_GET_TBB_FUSE_STATUS 0x82000006 -+#define MLNX_GET_TBB_FUSE_STATUS 0x82000006 - --/* Reset eMMC by programming the RST_N register. */ --#define MLXBF_BOOTCTL_SET_EMMC_RST_N 0x82000007 -+/* -+ * Initiate Firmware Reset via TYU. This might be invoked during the reset -+ * flow in isolation mode. -+ */ -+#define MLNX_HANDLE_FW_RESET 0x8200000D - --#define MLXBF_BOOTCTL_GET_DIMM_INFO 0x82000008 -+/* -+ * SMC function IDs to set, get and reset the manufacturing information -+ * stored within the eeprom. -+ */ -+#define MLNX_HANDLE_SET_MFG_INFO 0x8200000E -+#define MLNX_HANDLE_GET_MFG_INFO 0x8200000F -+#define MLNX_HANDLE_LOCK_MFG_INFO 0x82000011 - - /* SMC function IDs for SiP Service queries */ --#define MLXBF_BOOTCTL_SIP_SVC_CALL_COUNT 0x8200ff00 --#define MLXBF_BOOTCTL_SIP_SVC_UID 0x8200ff01 --#define MLXBF_BOOTCTL_SIP_SVC_VERSION 0x8200ff03 -- --/* ARM Standard Service Calls version numbers */ --#define MLXBF_BOOTCTL_SVC_VERSION_MAJOR 0x0 --#define MLXBF_BOOTCTL_SVC_VERSION_MINOR 0x2 -+#define MLNX_SIP_SVC_CALL_COUNT 0x8200ff00 -+#define MLNX_SIP_SVC_UID 0x8200ff01 -+#define MLNX_SIP_SVC_VERSION 0x8200ff03 - - /* Number of svc calls defined. */ --#define MLXBF_BOOTCTL_NUM_SVC_CALLS 12 -+#define MLNX_NUM_SVC_CALLS 16 - --/* Valid reset actions for MLXBF_BOOTCTL_SET_RESET_ACTION. */ --#define MLXBF_BOOTCTL_EXTERNAL 0 /* Not boot from eMMC */ --#define MLXBF_BOOTCTL_EMMC 1 /* From primary eMMC boot partition */ --#define MLNX_BOOTCTL_SWAP_EMMC 2 /* Swap eMMC boot partitions and reboot */ --#define MLXBF_BOOTCTL_EMMC_LEGACY 3 /* From primary eMMC in legacy mode */ -+/* Valid reset actions for MLNX_SET_RESET_ACTION. */ -+#define MLNX_BOOT_EXTERNAL 0 /* Do not boot from eMMC */ -+#define MLNX_BOOT_EMMC 1 /* Boot from primary eMMC boot partition */ -+#define MLNX_BOOT_SWAP_EMMC 2 /* Swap eMMC boot partitions and reboot */ -+#define MLNX_BOOT_EMMC_LEGACY 3 /* Boot from primary eMMC in legacy mode */ - - /* Valid arguments for requesting the fuse status. */ --#define MLXBF_BOOTCTL_FUSE_STATUS_LIFECYCLE 0 /* Return lifecycle status. */ --#define MLXBF_BOOTCTL_FUSE_STATUS_KEYS 1 /* Return secure boot key status */ -+#define MLNX_FUSE_STATUS_LIFECYCLE 0 /* Return the lifecycle status. */ -+#define MLNX_FUSE_STATUS_KEYS 1 /* Return secure boot key status */ - --/* Additional value to disable the MLXBF_BOOTCTL_SET_SECOND_RESET_ACTION. */ --#define MLXBF_BOOTCTL_NONE 0x7fffffff /* Don't change next boot action */ -+/* Additional parameter value to disable the MLNX_SET_SECOND_RESET_ACTION. */ -+#define MLNX_BOOT_NONE 0x7fffffff /* Don't change next boot action */ - - #endif /* __MLXBF_BOOTCTL_H__ */ --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0212-platform-mellanox-mlxbf-pmc-Add-Mellanox-BlueField-P.patch b/platform/mellanox/non-upstream-patches/patches/0212-platform-mellanox-mlxbf-pmc-Add-Mellanox-BlueField-P.patch deleted file mode 100644 index a7b97a234dc3..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0212-platform-mellanox-mlxbf-pmc-Add-Mellanox-BlueField-P.patch +++ /dev/null @@ -1,1560 +0,0 @@ -From 4a2c58ddcfdcff3afbc62c170c4fc7bbf73a5a9f Mon Sep 17 00:00:00 2001 -From: Shravan Kumar Ramani -Date: Thu, 8 Oct 2020 08:37:17 -0400 -Subject: [PATCH backport 5.10 13/63] platform/mellanox: mlxbf-pmc: Add - Mellanox BlueField PMC driver - -The performance modules in BlueField are present in several hardware -blocks and each block provides access to these stats either through -counters that can be programmed to monitor supported events or -through memory-mapped registers that hold the relevant information. -The hardware blocks that include a performance module are: - * Tile (block containing 2 cores and a shared L2 cache) - * TRIO (PCIe root complex) - * MSS (Memory Sub-system containing the Memory Controller and L3 cache) - * GIC (Interrupt controller) - * SMMU (System Memory Management Unit) -The mlx_pmc driver provides access to all of these performance modules -through a hwmon sysfs interface. - -v2 --> v3 -Update copyright info. - -v1 --> v2 -Remove unused headers. -Add comma to arrays where last line is not a termination. -Use kstrtoint in place of sscanf. -UUID manipulation follows drivers/platform/mellanox/mlxbf-bootctl.c - -Signed-off-by: Shravan Kumar Ramani -Reviewed-by: Vadim Pasternak -Reviewed-by: Jiri Pirko -Link: https://lore.kernel.org/r/4e19a1e5bf4197ad27fc57981fd280eaebd23577.1602160468.git.shravankr@nvidia.com -Signed-off-by: Hans de Goede ---- - drivers/platform/mellanox/Kconfig | 10 + - drivers/platform/mellanox/Makefile | 1 + - drivers/platform/mellanox/mlxbf-pmc.c | 1478 +++++++++++++++++++++++++ - 3 files changed, 1489 insertions(+) - create mode 100644 drivers/platform/mellanox/mlxbf-pmc.c - -diff --git a/drivers/platform/mellanox/Kconfig b/drivers/platform/mellanox/Kconfig -index 5bd6ddd42..b0d2c3343 100644 ---- a/drivers/platform/mellanox/Kconfig -+++ b/drivers/platform/mellanox/Kconfig -@@ -80,6 +80,16 @@ config MLXBF_BOOTCTL - to the userspace tools, to be used in conjunction with the eMMC - device driver to do necessary initial swap of the boot partition. - -+config MLXBF_PMC -+ tristate "Mellanox BlueField Performance Monitoring Counters driver" -+ depends on ARM64 -+ depends on HWMON -+ depends on ACPI -+ help -+ Say y here to enable PMC support. The PMC driver provides access -+ to performance monitoring counters within various blocks in the -+ Mellanox BlueField SoC via a sysfs interface. -+ - config NVSW_SN2201 - tristate "Nvidia SN2201 platform driver support" - depends on REGMAP -diff --git a/drivers/platform/mellanox/Makefile b/drivers/platform/mellanox/Makefile -index 499623ccf2fe..000ddaa74c98 100644 ---- a/drivers/platform/mellanox/Makefile -+++ b/drivers/platform/mellanox/Makefile -@@ -4,6 +4,7 @@ - # Mellanox Platform-Specific Drivers - # - obj-$(CONFIG_MLXBF_BOOTCTL) += mlxbf-bootctl.o -+obj-$(CONFIG_MLXBF_PMC) += mlxbf-pmc.o - obj-$(CONFIG_MLXBF_TMFIFO) += mlxbf-tmfifo.o - obj-$(CONFIG_MLXREG_HOTPLUG) += mlxreg-hotplug.o - obj-$(CONFIG_MLXREG_IO) += mlxreg-io.o -diff --git a/drivers/platform/mellanox/mlxbf-pmc.c b/drivers/platform/mellanox/mlxbf-pmc.c -new file mode 100644 -index 000000000..358839842 ---- /dev/null -+++ b/drivers/platform/mellanox/mlxbf-pmc.c -@@ -0,0 +1,1478 @@ -+// SPDX-License-Identifier: GPL-2.0-only OR Linux-OpenIB -+/* -+ * Mellanox BlueField Performance Monitoring Counters driver -+ * -+ * This driver provides a sysfs interface for monitoring -+ * performance statistics in BlueField SoC. -+ * -+ * Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#define MLXBF_PMC_WRITE_REG_32 0x82000009 -+#define MLXBF_PMC_READ_REG_32 0x8200000A -+#define MLXBF_PMC_WRITE_REG_64 0x8200000B -+#define MLXBF_PMC_READ_REG_64 0x8200000C -+#define MLXBF_PMC_SIP_SVC_UID 0x8200ff01 -+#define MLXBF_PMC_SIP_SVC_VERSION 0x8200ff03 -+#define MLXBF_PMC_SVC_REQ_MAJOR 0 -+#define MLXBF_PMC_SVC_MIN_MINOR 3 -+ -+#define MLXBF_PMC_SMCCC_ACCESS_VIOLATION -4 -+ -+#define MLXBF_PMC_EVENT_SET_BF1 0 -+#define MLXBF_PMC_EVENT_SET_BF2 1 -+#define MLXBF_PMC_EVENT_INFO_LEN 100 -+ -+#define MLXBF_PMC_MAX_BLOCKS 30 -+#define MLXBF_PMC_MAX_ATTRS 30 -+#define MLXBF_PMC_INFO_SZ 4 -+#define MLXBF_PMC_REG_SIZE 8 -+#define MLXBF_PMC_L3C_REG_SIZE 4 -+ -+#define MLXBF_PMC_TYPE_COUNTER 1 -+#define MLXBF_PMC_TYPE_REGISTER 0 -+ -+#define MLXBF_PMC_PERFCTL 0 -+#define MLXBF_PMC_PERFEVT 1 -+#define MLXBF_PMC_PERFACC0 4 -+ -+#define MLXBF_PMC_PERFMON_CONFIG_WR_R_B BIT(0) -+#define MLXBF_PMC_PERFMON_CONFIG_STROBE BIT(1) -+#define MLXBF_PMC_PERFMON_CONFIG_ADDR GENMASK_ULL(4, 2) -+#define MLXBF_PMC_PERFMON_CONFIG_WDATA GENMASK_ULL(60, 5) -+ -+#define MLXBF_PMC_PERFCTL_FM0 GENMASK_ULL(18, 16) -+#define MLXBF_PMC_PERFCTL_MS0 GENMASK_ULL(21, 20) -+#define MLXBF_PMC_PERFCTL_ACCM0 GENMASK_ULL(26, 24) -+#define MLXBF_PMC_PERFCTL_AD0 BIT(27) -+#define MLXBF_PMC_PERFCTL_ETRIG0 GENMASK_ULL(29, 28) -+#define MLXBF_PMC_PERFCTL_EB0 BIT(30) -+#define MLXBF_PMC_PERFCTL_EN0 BIT(31) -+ -+#define MLXBF_PMC_PERFEVT_EVTSEL GENMASK_ULL(31, 24) -+ -+#define MLXBF_PMC_L3C_PERF_CNT_CFG 0x0 -+#define MLXBF_PMC_L3C_PERF_CNT_SEL 0x10 -+#define MLXBF_PMC_L3C_PERF_CNT_SEL_1 0x14 -+#define MLXBF_PMC_L3C_PERF_CNT_LOW 0x40 -+#define MLXBF_PMC_L3C_PERF_CNT_HIGH 0x60 -+ -+#define MLXBF_PMC_L3C_PERF_CNT_CFG_EN BIT(0) -+#define MLXBF_PMC_L3C_PERF_CNT_CFG_RST BIT(1) -+#define MLXBF_PMC_L3C_PERF_CNT_SEL_CNT_0 GENMASK(5, 0) -+#define MLXBF_PMC_L3C_PERF_CNT_SEL_CNT_1 GENMASK(13, 8) -+#define MLXBF_PMC_L3C_PERF_CNT_SEL_CNT_2 GENMASK(21, 16) -+#define MLXBF_PMC_L3C_PERF_CNT_SEL_CNT_3 GENMASK(29, 24) -+ -+#define MLXBF_PMC_L3C_PERF_CNT_SEL_1_CNT_4 GENMASK(5, 0) -+ -+#define MLXBF_PMC_L3C_PERF_CNT_LOW_VAL GENMASK(31, 0) -+#define MLXBF_PMC_L3C_PERF_CNT_HIGH_VAL GENMASK(24, 0) -+ -+/** -+ * Structure to hold attribute and block info for each sysfs entry -+ * @dev_attr: Device attribute struct -+ * @index: index to identify counter number within a block -+ * @nr: block number to which the sysfs belongs -+ */ -+struct mlxbf_pmc_attribute { -+ struct device_attribute dev_attr; -+ int index; -+ int nr; -+}; -+ -+/** -+ * Structure to hold info for each HW block -+ * -+ * @mmio_base: The VA at which the PMC block is mapped -+ * @blk_size: Size of each mapped region -+ * @counters: Number of counters in the block -+ * @type: Type of counters in the block -+ * @attr_counter: Attributes for "counter" sysfs files -+ * @attr_event: Attributes for "event" sysfs files -+ * @attr_event_list: Attributes for "event_list" sysfs files -+ * @attr_enable: Attributes for "enable" sysfs files -+ * @block_attr: All attributes needed for the block -+ * @blcok_attr_grp: Attribute group for the block -+ */ -+struct mlxbf_pmc_block_info { -+ void __iomem *mmio_base; -+ size_t blk_size; -+ size_t counters; -+ int type; -+ struct mlxbf_pmc_attribute *attr_counter; -+ struct mlxbf_pmc_attribute *attr_event; -+ struct mlxbf_pmc_attribute attr_event_list; -+ struct mlxbf_pmc_attribute attr_enable; -+ struct attribute *block_attr[MLXBF_PMC_MAX_ATTRS]; -+ struct attribute_group block_attr_grp; -+}; -+ -+/** -+ * Structure to hold PMC context info -+ * -+ * @pdev: The kernel structure representing the device -+ * @total_blocks: Total number of blocks -+ * @tile_count: Number of tiles in the system -+ * @hwmon_dev: Hwmon device for bfperf -+ * @block_name: Block name -+ * @block: Block info -+ * @groups: Attribute groups from each block -+ * @sv_sreg_support: Whether SMCs are used to access performance registers -+ * @sreg_tbl_perf: Secure register access table number -+ * @event_set: Event set to use -+ */ -+struct mlxbf_pmc_context { -+ struct platform_device *pdev; -+ uint32_t total_blocks; -+ uint32_t tile_count; -+ struct device *hwmon_dev; -+ const char *block_name[MLXBF_PMC_MAX_BLOCKS]; -+ struct mlxbf_pmc_block_info block[MLXBF_PMC_MAX_BLOCKS]; -+ const struct attribute_group *groups[MLXBF_PMC_MAX_BLOCKS]; -+ bool svc_sreg_support; -+ uint32_t sreg_tbl_perf; -+ unsigned int event_set; -+}; -+ -+/** -+ * Structure to hold supported events for each block -+ * @evt_num: Event number used to program counters -+ * @evt_name: Name of the event -+ */ -+struct mlxbf_pmc_events { -+ int evt_num; -+ char *evt_name; -+}; -+ -+static const struct mlxbf_pmc_events mlxbf_pmc_pcie_events[] = { -+ { 0x0, "IN_P_PKT_CNT" }, -+ { 0x10, "IN_NP_PKT_CNT" }, -+ { 0x18, "IN_C_PKT_CNT" }, -+ { 0x20, "OUT_P_PKT_CNT" }, -+ { 0x28, "OUT_NP_PKT_CNT" }, -+ { 0x30, "OUT_C_PKT_CNT" }, -+ { 0x38, "IN_P_BYTE_CNT" }, -+ { 0x40, "IN_NP_BYTE_CNT" }, -+ { 0x48, "IN_C_BYTE_CNT" }, -+ { 0x50, "OUT_P_BYTE_CNT" }, -+ { 0x58, "OUT_NP_BYTE_CNT" }, -+ { 0x60, "OUT_C_BYTE_CNT" }, -+}; -+ -+static const struct mlxbf_pmc_events mlxbf_pmc_smgen_events[] = { -+ { 0x0, "AW_REQ" }, -+ { 0x1, "AW_BEATS" }, -+ { 0x2, "AW_TRANS" }, -+ { 0x3, "AW_RESP" }, -+ { 0x4, "AW_STL" }, -+ { 0x5, "AW_LAT" }, -+ { 0x6, "AW_REQ_TBU" }, -+ { 0x8, "AR_REQ" }, -+ { 0x9, "AR_BEATS" }, -+ { 0xa, "AR_TRANS" }, -+ { 0xb, "AR_STL" }, -+ { 0xc, "AR_LAT" }, -+ { 0xd, "AR_REQ_TBU" }, -+ { 0xe, "TBU_MISS" }, -+ { 0xf, "TX_DAT_AF" }, -+ { 0x10, "RX_DAT_AF" }, -+ { 0x11, "RETRYQ_CRED" }, -+}; -+ -+static const struct mlxbf_pmc_events mlxbf_pmc_trio_events_1[] = { -+ { 0xa0, "TPIO_DATA_BEAT" }, -+ { 0xa1, "TDMA_DATA_BEAT" }, -+ { 0xa2, "MAP_DATA_BEAT" }, -+ { 0xa3, "TXMSG_DATA_BEAT" }, -+ { 0xa4, "TPIO_DATA_PACKET" }, -+ { 0xa5, "TDMA_DATA_PACKET" }, -+ { 0xa6, "MAP_DATA_PACKET" }, -+ { 0xa7, "TXMSG_DATA_PACKET" }, -+ { 0xa8, "TDMA_RT_AF" }, -+ { 0xa9, "TDMA_PBUF_MAC_AF" }, -+ { 0xaa, "TRIO_MAP_WRQ_BUF_EMPTY" }, -+ { 0xab, "TRIO_MAP_CPL_BUF_EMPTY" }, -+ { 0xac, "TRIO_MAP_RDQ0_BUF_EMPTY" }, -+ { 0xad, "TRIO_MAP_RDQ1_BUF_EMPTY" }, -+ { 0xae, "TRIO_MAP_RDQ2_BUF_EMPTY" }, -+ { 0xaf, "TRIO_MAP_RDQ3_BUF_EMPTY" }, -+ { 0xb0, "TRIO_MAP_RDQ4_BUF_EMPTY" }, -+ { 0xb1, "TRIO_MAP_RDQ5_BUF_EMPTY" }, -+ { 0xb2, "TRIO_MAP_RDQ6_BUF_EMPTY" }, -+ { 0xb3, "TRIO_MAP_RDQ7_BUF_EMPTY" }, -+}; -+ -+static const struct mlxbf_pmc_events mlxbf_pmc_trio_events_2[] = { -+ { 0xa0, "TPIO_DATA_BEAT" }, -+ { 0xa1, "TDMA_DATA_BEAT" }, -+ { 0xa2, "MAP_DATA_BEAT" }, -+ { 0xa3, "TXMSG_DATA_BEAT" }, -+ { 0xa4, "TPIO_DATA_PACKET" }, -+ { 0xa5, "TDMA_DATA_PACKET" }, -+ { 0xa6, "MAP_DATA_PACKET" }, -+ { 0xa7, "TXMSG_DATA_PACKET" }, -+ { 0xa8, "TDMA_RT_AF" }, -+ { 0xa9, "TDMA_PBUF_MAC_AF" }, -+ { 0xaa, "TRIO_MAP_WRQ_BUF_EMPTY" }, -+ { 0xab, "TRIO_MAP_CPL_BUF_EMPTY" }, -+ { 0xac, "TRIO_MAP_RDQ0_BUF_EMPTY" }, -+ { 0xad, "TRIO_MAP_RDQ1_BUF_EMPTY" }, -+ { 0xae, "TRIO_MAP_RDQ2_BUF_EMPTY" }, -+ { 0xaf, "TRIO_MAP_RDQ3_BUF_EMPTY" }, -+ { 0xb0, "TRIO_MAP_RDQ4_BUF_EMPTY" }, -+ { 0xb1, "TRIO_MAP_RDQ5_BUF_EMPTY" }, -+ { 0xb2, "TRIO_MAP_RDQ6_BUF_EMPTY" }, -+ { 0xb3, "TRIO_MAP_RDQ7_BUF_EMPTY" }, -+ { 0xb4, "TRIO_RING_TX_FLIT_CH0" }, -+ { 0xb5, "TRIO_RING_TX_FLIT_CH1" }, -+ { 0xb6, "TRIO_RING_TX_FLIT_CH2" }, -+ { 0xb7, "TRIO_RING_TX_FLIT_CH3" }, -+ { 0xb8, "TRIO_RING_TX_FLIT_CH4" }, -+ { 0xb9, "TRIO_RING_RX_FLIT_CH0" }, -+ { 0xba, "TRIO_RING_RX_FLIT_CH1" }, -+ { 0xbb, "TRIO_RING_RX_FLIT_CH2" }, -+ { 0xbc, "TRIO_RING_RX_FLIT_CH3" }, -+}; -+ -+static const struct mlxbf_pmc_events mlxbf_pmc_ecc_events[] = { -+ { 0x100, "ECC_SINGLE_ERROR_CNT" }, -+ { 0x104, "ECC_DOUBLE_ERROR_CNT" }, -+ { 0x114, "SERR_INJ" }, -+ { 0x118, "DERR_INJ" }, -+ { 0x124, "ECC_SINGLE_ERROR_0" }, -+ { 0x164, "ECC_DOUBLE_ERROR_0" }, -+ { 0x340, "DRAM_ECC_COUNT" }, -+ { 0x344, "DRAM_ECC_INJECT" }, -+ { 0x348, "DRAM_ECC_ERROR" }, -+}; -+ -+static const struct mlxbf_pmc_events mlxbf_pmc_mss_events[] = { -+ { 0xc0, "RXREQ_MSS" }, -+ { 0xc1, "RXDAT_MSS" }, -+ { 0xc2, "TXRSP_MSS" }, -+ { 0xc3, "TXDAT_MSS" }, -+}; -+ -+static const struct mlxbf_pmc_events mlxbf_pmc_hnf_events[] = { -+ { 0x45, "HNF_REQUESTS" }, -+ { 0x46, "HNF_REJECTS" }, -+ { 0x47, "ALL_BUSY" }, -+ { 0x48, "MAF_BUSY" }, -+ { 0x49, "MAF_REQUESTS" }, -+ { 0x4a, "RNF_REQUESTS" }, -+ { 0x4b, "REQUEST_TYPE" }, -+ { 0x4c, "MEMORY_READS" }, -+ { 0x4d, "MEMORY_WRITES" }, -+ { 0x4e, "VICTIM_WRITE" }, -+ { 0x4f, "POC_FULL" }, -+ { 0x50, "POC_FAIL" }, -+ { 0x51, "POC_SUCCESS" }, -+ { 0x52, "POC_WRITES" }, -+ { 0x53, "POC_READS" }, -+ { 0x54, "FORWARD" }, -+ { 0x55, "RXREQ_HNF" }, -+ { 0x56, "RXRSP_HNF" }, -+ { 0x57, "RXDAT_HNF" }, -+ { 0x58, "TXREQ_HNF" }, -+ { 0x59, "TXRSP_HNF" }, -+ { 0x5a, "TXDAT_HNF" }, -+ { 0x5b, "TXSNP_HNF" }, -+ { 0x5c, "INDEX_MATCH" }, -+ { 0x5d, "A72_ACCESS" }, -+ { 0x5e, "IO_ACCESS" }, -+ { 0x5f, "TSO_WRITE" }, -+ { 0x60, "TSO_CONFLICT" }, -+ { 0x61, "DIR_HIT" }, -+ { 0x62, "HNF_ACCEPTS" }, -+ { 0x63, "REQ_BUF_EMPTY" }, -+ { 0x64, "REQ_BUF_IDLE_MAF" }, -+ { 0x65, "TSO_NOARB" }, -+ { 0x66, "TSO_NOARB_CYCLES" }, -+ { 0x67, "MSS_NO_CREDIT" }, -+ { 0x68, "TXDAT_NO_LCRD" }, -+ { 0x69, "TXSNP_NO_LCRD" }, -+ { 0x6a, "TXRSP_NO_LCRD" }, -+ { 0x6b, "TXREQ_NO_LCRD" }, -+ { 0x6c, "TSO_CL_MATCH" }, -+ { 0x6d, "MEMORY_READS_BYPASS" }, -+ { 0x6e, "TSO_NOARB_TIMEOUT" }, -+ { 0x6f, "ALLOCATE" }, -+ { 0x70, "VICTIM" }, -+ { 0x71, "A72_WRITE" }, -+ { 0x72, "A72_READ" }, -+ { 0x73, "IO_WRITE" }, -+ { 0x74, "IO_READ" }, -+ { 0x75, "TSO_REJECT" }, -+ { 0x80, "TXREQ_RN" }, -+ { 0x81, "TXRSP_RN" }, -+ { 0x82, "TXDAT_RN" }, -+ { 0x83, "RXSNP_RN" }, -+ { 0x84, "RXRSP_RN" }, -+ { 0x85, "RXDAT_RN" }, -+}; -+ -+static const struct mlxbf_pmc_events mlxbf_pmc_hnfnet_events[] = { -+ { 0x12, "CDN_REQ" }, -+ { 0x13, "DDN_REQ" }, -+ { 0x14, "NDN_REQ" }, -+ { 0x15, "CDN_DIAG_N_OUT_OF_CRED" }, -+ { 0x16, "CDN_DIAG_S_OUT_OF_CRED" }, -+ { 0x17, "CDN_DIAG_E_OUT_OF_CRED" }, -+ { 0x18, "CDN_DIAG_W_OUT_OF_CRED" }, -+ { 0x19, "CDN_DIAG_C_OUT_OF_CRED" }, -+ { 0x1a, "CDN_DIAG_N_EGRESS" }, -+ { 0x1b, "CDN_DIAG_S_EGRESS" }, -+ { 0x1c, "CDN_DIAG_E_EGRESS" }, -+ { 0x1d, "CDN_DIAG_W_EGRESS" }, -+ { 0x1e, "CDN_DIAG_C_EGRESS" }, -+ { 0x1f, "CDN_DIAG_N_INGRESS" }, -+ { 0x20, "CDN_DIAG_S_INGRESS" }, -+ { 0x21, "CDN_DIAG_E_INGRESS" }, -+ { 0x22, "CDN_DIAG_W_INGRESS" }, -+ { 0x23, "CDN_DIAG_C_INGRESS" }, -+ { 0x24, "CDN_DIAG_CORE_SENT" }, -+ { 0x25, "DDN_DIAG_N_OUT_OF_CRED" }, -+ { 0x26, "DDN_DIAG_S_OUT_OF_CRED" }, -+ { 0x27, "DDN_DIAG_E_OUT_OF_CRED" }, -+ { 0x28, "DDN_DIAG_W_OUT_OF_CRED" }, -+ { 0x29, "DDN_DIAG_C_OUT_OF_CRED" }, -+ { 0x2a, "DDN_DIAG_N_EGRESS" }, -+ { 0x2b, "DDN_DIAG_S_EGRESS" }, -+ { 0x2c, "DDN_DIAG_E_EGRESS" }, -+ { 0x2d, "DDN_DIAG_W_EGRESS" }, -+ { 0x2e, "DDN_DIAG_C_EGRESS" }, -+ { 0x2f, "DDN_DIAG_N_INGRESS" }, -+ { 0x30, "DDN_DIAG_S_INGRESS" }, -+ { 0x31, "DDN_DIAG_E_INGRESS" }, -+ { 0x32, "DDN_DIAG_W_INGRESS" }, -+ { 0x33, "DDN_DIAG_C_INGRESS" }, -+ { 0x34, "DDN_DIAG_CORE_SENT" }, -+ { 0x35, "NDN_DIAG_S_OUT_OF_CRED" }, -+ { 0x36, "NDN_DIAG_S_OUT_OF_CRED" }, -+ { 0x37, "NDN_DIAG_E_OUT_OF_CRED" }, -+ { 0x38, "NDN_DIAG_W_OUT_OF_CRED" }, -+ { 0x39, "NDN_DIAG_C_OUT_OF_CRED" }, -+ { 0x3a, "NDN_DIAG_N_EGRESS" }, -+ { 0x3b, "NDN_DIAG_S_EGRESS" }, -+ { 0x3c, "NDN_DIAG_E_EGRESS" }, -+ { 0x3d, "NDN_DIAG_W_EGRESS" }, -+ { 0x3e, "NDN_DIAG_C_EGRESS" }, -+ { 0x3f, "NDN_DIAG_N_INGRESS" }, -+ { 0x40, "NDN_DIAG_S_INGRESS" }, -+ { 0x41, "NDN_DIAG_E_INGRESS" }, -+ { 0x42, "NDN_DIAG_W_INGRESS" }, -+ { 0x43, "NDN_DIAG_C_INGRESS" }, -+ { 0x44, "NDN_DIAG_CORE_SENT" }, -+}; -+ -+static const struct mlxbf_pmc_events mlxbf_pmc_l3c_events[] = { -+ { 0x00, "DISABLE" }, -+ { 0x01, "CYCLES" }, -+ { 0x02, "TOTAL_RD_REQ_IN" }, -+ { 0x03, "TOTAL_WR_REQ_IN" }, -+ { 0x04, "TOTAL_WR_DBID_ACK" }, -+ { 0x05, "TOTAL_WR_DATA_IN" }, -+ { 0x06, "TOTAL_WR_COMP" }, -+ { 0x07, "TOTAL_RD_DATA_OUT" }, -+ { 0x08, "TOTAL_CDN_REQ_IN_BANK0" }, -+ { 0x09, "TOTAL_CDN_REQ_IN_BANK1" }, -+ { 0x0a, "TOTAL_DDN_REQ_IN_BANK0" }, -+ { 0x0b, "TOTAL_DDN_REQ_IN_BANK1" }, -+ { 0x0c, "TOTAL_EMEM_RD_RES_IN_BANK0" }, -+ { 0x0d, "TOTAL_EMEM_RD_RES_IN_BANK1" }, -+ { 0x0e, "TOTAL_CACHE_RD_RES_IN_BANK0" }, -+ { 0x0f, "TOTAL_CACHE_RD_RES_IN_BANK1" }, -+ { 0x10, "TOTAL_EMEM_RD_REQ_BANK0" }, -+ { 0x11, "TOTAL_EMEM_RD_REQ_BANK1" }, -+ { 0x12, "TOTAL_EMEM_WR_REQ_BANK0" }, -+ { 0x13, "TOTAL_EMEM_WR_REQ_BANK1" }, -+ { 0x14, "TOTAL_RD_REQ_OUT" }, -+ { 0x15, "TOTAL_WR_REQ_OUT" }, -+ { 0x16, "TOTAL_RD_RES_IN" }, -+ { 0x17, "HITS_BANK0" }, -+ { 0x18, "HITS_BANK1" }, -+ { 0x19, "MISSES_BANK0" }, -+ { 0x1a, "MISSES_BANK1" }, -+ { 0x1b, "ALLOCATIONS_BANK0" }, -+ { 0x1c, "ALLOCATIONS_BANK1" }, -+ { 0x1d, "EVICTIONS_BANK0" }, -+ { 0x1e, "EVICTIONS_BANK1" }, -+ { 0x1f, "DBID_REJECT" }, -+ { 0x20, "WRDB_REJECT_BANK0" }, -+ { 0x21, "WRDB_REJECT_BANK1" }, -+ { 0x22, "CMDQ_REJECT_BANK0" }, -+ { 0x23, "CMDQ_REJECT_BANK1" }, -+ { 0x24, "COB_REJECT_BANK0" }, -+ { 0x25, "COB_REJECT_BANK1" }, -+ { 0x26, "TRB_REJECT_BANK0" }, -+ { 0x27, "TRB_REJECT_BANK1" }, -+ { 0x28, "TAG_REJECT_BANK0" }, -+ { 0x29, "TAG_REJECT_BANK1" }, -+ { 0x2a, "ANY_REJECT_BANK0" }, -+ { 0x2b, "ANY_REJECT_BANK1" }, -+}; -+ -+static struct mlxbf_pmc_context *pmc; -+ -+/* UUID used to probe ATF service. */ -+static const char *mlxbf_pmc_svc_uuid_str = "89c036b4-e7d7-11e6-8797-001aca00bfc4"; -+ -+/* Calls an SMC to access a performance register */ -+static int mlxbf_pmc_secure_read(void __iomem *addr, uint32_t command, -+ uint64_t *result) -+{ -+ struct arm_smccc_res res; -+ int status, err = 0; -+ -+ arm_smccc_smc(command, pmc->sreg_tbl_perf, (uintptr_t)addr, 0, 0, 0, 0, -+ 0, &res); -+ -+ status = res.a0; -+ -+ switch (status) { -+ case PSCI_RET_NOT_SUPPORTED: -+ err = -EINVAL; -+ break; -+ case MLXBF_PMC_SMCCC_ACCESS_VIOLATION: -+ err = -EACCES; -+ break; -+ default: -+ *result = res.a1; -+ break; -+ } -+ -+ return err; -+} -+ -+/* Read from a performance counter */ -+static int mlxbf_pmc_read(void __iomem *addr, uint32_t command, -+ uint64_t *result) -+{ -+ if (pmc->svc_sreg_support) -+ return mlxbf_pmc_secure_read(addr, command, result); -+ -+ if (command == MLXBF_PMC_READ_REG_32) -+ *result = readl(addr); -+ else -+ *result = readq(addr); -+ -+ return 0; -+} -+ -+/* Convenience function for 32-bit reads */ -+static int mlxbf_pmc_readl(void __iomem *addr, uint32_t *result) -+{ -+ uint64_t read_out; -+ int status; -+ -+ status = mlxbf_pmc_read(addr, MLXBF_PMC_READ_REG_32, &read_out); -+ if (status) -+ return status; -+ *result = (uint32_t)read_out; -+ -+ return 0; -+} -+ -+/* Calls an SMC to access a performance register */ -+static int mlxbf_pmc_secure_write(void __iomem *addr, uint32_t command, -+ uint64_t value) -+{ -+ struct arm_smccc_res res; -+ int status, err = 0; -+ -+ arm_smccc_smc(command, pmc->sreg_tbl_perf, value, (uintptr_t)addr, 0, 0, -+ 0, 0, &res); -+ -+ status = res.a0; -+ -+ switch (status) { -+ case PSCI_RET_NOT_SUPPORTED: -+ err = -EINVAL; -+ break; -+ case MLXBF_PMC_SMCCC_ACCESS_VIOLATION: -+ err = -EACCES; -+ break; -+ } -+ -+ return err; -+} -+ -+/* Write to a performance counter */ -+static int mlxbf_pmc_write(void __iomem *addr, int command, uint64_t value) -+{ -+ if (pmc->svc_sreg_support) -+ return mlxbf_pmc_secure_write(addr, command, value); -+ -+ if (command == MLXBF_PMC_WRITE_REG_32) -+ writel(value, addr); -+ else -+ writeq(value, addr); -+ -+ return 0; -+} -+ -+/* Check if the register offset is within the mapped region for the block */ -+static bool mlxbf_pmc_valid_range(int blk_num, uint32_t offset) -+{ -+ if ((offset >= 0) && !(offset % MLXBF_PMC_REG_SIZE) && -+ (offset + MLXBF_PMC_REG_SIZE <= pmc->block[blk_num].blk_size)) -+ return true; /* inside the mapped PMC space */ -+ -+ return false; -+} -+ -+/* Get the event list corresponding to a certain block */ -+static const struct mlxbf_pmc_events *mlxbf_pmc_event_list(const char *blk, -+ int *size) -+{ -+ const struct mlxbf_pmc_events *events; -+ -+ if (strstr(blk, "tilenet")) { -+ events = mlxbf_pmc_hnfnet_events; -+ *size = ARRAY_SIZE(mlxbf_pmc_hnfnet_events); -+ } else if (strstr(blk, "tile")) { -+ events = mlxbf_pmc_hnf_events; -+ *size = ARRAY_SIZE(mlxbf_pmc_hnf_events); -+ } else if (strstr(blk, "triogen")) { -+ events = mlxbf_pmc_smgen_events; -+ *size = ARRAY_SIZE(mlxbf_pmc_smgen_events); -+ } else if (strstr(blk, "trio")) { -+ switch (pmc->event_set) { -+ case MLXBF_PMC_EVENT_SET_BF1: -+ events = mlxbf_pmc_trio_events_1; -+ *size = ARRAY_SIZE(mlxbf_pmc_trio_events_1); -+ break; -+ case MLXBF_PMC_EVENT_SET_BF2: -+ events = mlxbf_pmc_trio_events_2; -+ *size = ARRAY_SIZE(mlxbf_pmc_trio_events_2); -+ break; -+ default: -+ events = NULL; -+ *size = 0; -+ break; -+ } -+ } else if (strstr(blk, "mss")) { -+ events = mlxbf_pmc_mss_events; -+ *size = ARRAY_SIZE(mlxbf_pmc_mss_events); -+ } else if (strstr(blk, "ecc")) { -+ events = mlxbf_pmc_ecc_events; -+ *size = ARRAY_SIZE(mlxbf_pmc_ecc_events); -+ } else if (strstr(blk, "pcie")) { -+ events = mlxbf_pmc_pcie_events; -+ *size = ARRAY_SIZE(mlxbf_pmc_pcie_events); -+ } else if (strstr(blk, "l3cache")) { -+ events = mlxbf_pmc_l3c_events; -+ *size = ARRAY_SIZE(mlxbf_pmc_l3c_events); -+ } else if (strstr(blk, "gic")) { -+ events = mlxbf_pmc_smgen_events; -+ *size = ARRAY_SIZE(mlxbf_pmc_smgen_events); -+ } else if (strstr(blk, "smmu")) { -+ events = mlxbf_pmc_smgen_events; -+ *size = ARRAY_SIZE(mlxbf_pmc_smgen_events); -+ } else { -+ events = NULL; -+ *size = 0; -+ } -+ -+ return events; -+} -+ -+/* Get the event number given the name */ -+static int mlxbf_pmc_get_event_num(const char *blk, const char *evt) -+{ -+ const struct mlxbf_pmc_events *events; -+ int i, size; -+ -+ events = mlxbf_pmc_event_list(blk, &size); -+ if (!events) -+ return -EINVAL; -+ -+ for (i = 0; i < size; ++i) { -+ if (!strcmp(evt, events[i].evt_name)) -+ return events[i].evt_num; -+ } -+ -+ return -ENODEV; -+} -+ -+/* Get the event number given the name */ -+static char *mlxbf_pmc_get_event_name(const char *blk, int evt) -+{ -+ const struct mlxbf_pmc_events *events; -+ int i, size; -+ -+ events = mlxbf_pmc_event_list(blk, &size); -+ if (!events) -+ return NULL; -+ -+ for (i = 0; i < size; ++i) { -+ if (evt == events[i].evt_num) -+ return events[i].evt_name; -+ } -+ -+ return NULL; -+} -+ -+/* Method to enable/disable/reset l3cache counters */ -+static int mlxbf_pmc_config_l3_counters(int blk_num, bool enable, bool reset) -+{ -+ uint32_t perfcnt_cfg = 0; -+ -+ if (enable) -+ perfcnt_cfg |= MLXBF_PMC_L3C_PERF_CNT_CFG_EN; -+ if (reset) -+ perfcnt_cfg |= MLXBF_PMC_L3C_PERF_CNT_CFG_RST; -+ -+ return mlxbf_pmc_write(pmc->block[blk_num].mmio_base + -+ MLXBF_PMC_L3C_PERF_CNT_CFG, -+ MLXBF_PMC_WRITE_REG_32, perfcnt_cfg); -+} -+ -+/* Method to handle l3cache counter programming */ -+static int mlxbf_pmc_program_l3_counter(int blk_num, uint32_t cnt_num, -+ uint32_t evt) -+{ -+ uint32_t perfcnt_sel_1 = 0; -+ uint32_t perfcnt_sel = 0; -+ uint32_t *wordaddr; -+ void __iomem *pmcaddr; -+ int ret; -+ -+ /* Disable all counters before programming them */ -+ if (mlxbf_pmc_config_l3_counters(blk_num, false, false)) -+ return -EINVAL; -+ -+ /* Select appropriate register information */ -+ switch (cnt_num) { -+ case 0 ... 3: -+ pmcaddr = pmc->block[blk_num].mmio_base + -+ MLXBF_PMC_L3C_PERF_CNT_SEL; -+ wordaddr = &perfcnt_sel; -+ break; -+ case 4: -+ pmcaddr = pmc->block[blk_num].mmio_base + -+ MLXBF_PMC_L3C_PERF_CNT_SEL_1; -+ wordaddr = &perfcnt_sel_1; -+ break; -+ default: -+ return -EINVAL; -+ } -+ -+ ret = mlxbf_pmc_readl(pmcaddr, wordaddr); -+ if (ret) -+ return ret; -+ -+ switch (cnt_num) { -+ case 0: -+ perfcnt_sel &= ~MLXBF_PMC_L3C_PERF_CNT_SEL_CNT_0; -+ perfcnt_sel |= FIELD_PREP(MLXBF_PMC_L3C_PERF_CNT_SEL_CNT_0, -+ evt); -+ break; -+ case 1: -+ perfcnt_sel &= ~MLXBF_PMC_L3C_PERF_CNT_SEL_CNT_1; -+ perfcnt_sel |= FIELD_PREP(MLXBF_PMC_L3C_PERF_CNT_SEL_CNT_1, -+ evt); -+ break; -+ case 2: -+ perfcnt_sel &= ~MLXBF_PMC_L3C_PERF_CNT_SEL_CNT_2; -+ perfcnt_sel |= FIELD_PREP(MLXBF_PMC_L3C_PERF_CNT_SEL_CNT_2, -+ evt); -+ break; -+ case 3: -+ perfcnt_sel &= ~MLXBF_PMC_L3C_PERF_CNT_SEL_CNT_3; -+ perfcnt_sel |= FIELD_PREP(MLXBF_PMC_L3C_PERF_CNT_SEL_CNT_3, -+ evt); -+ break; -+ case 4: -+ perfcnt_sel_1 &= ~MLXBF_PMC_L3C_PERF_CNT_SEL_1_CNT_4; -+ perfcnt_sel_1 |= FIELD_PREP(MLXBF_PMC_L3C_PERF_CNT_SEL_1_CNT_4, -+ evt); -+ break; -+ default: -+ return -EINVAL; -+ } -+ -+ return mlxbf_pmc_write(pmcaddr, MLXBF_PMC_WRITE_REG_32, *wordaddr); -+} -+ -+/* Method to program a counter to monitor an event */ -+static int mlxbf_pmc_program_counter(int blk_num, uint32_t cnt_num, -+ uint32_t evt, bool is_l3) -+{ -+ uint64_t perfctl, perfevt, perfmon_cfg; -+ -+ if (cnt_num >= pmc->block[blk_num].counters) -+ return -ENODEV; -+ -+ if (is_l3) -+ return mlxbf_pmc_program_l3_counter(blk_num, cnt_num, evt); -+ -+ /* Configure the counter */ -+ perfctl = FIELD_PREP(MLXBF_PMC_PERFCTL_EN0, 1); -+ perfctl |= FIELD_PREP(MLXBF_PMC_PERFCTL_EB0, 0); -+ perfctl |= FIELD_PREP(MLXBF_PMC_PERFCTL_ETRIG0, 1); -+ perfctl |= FIELD_PREP(MLXBF_PMC_PERFCTL_AD0, 0); -+ perfctl |= FIELD_PREP(MLXBF_PMC_PERFCTL_ACCM0, 0); -+ perfctl |= FIELD_PREP(MLXBF_PMC_PERFCTL_MS0, 0); -+ perfctl |= FIELD_PREP(MLXBF_PMC_PERFCTL_FM0, 0); -+ -+ perfmon_cfg = FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_WDATA, perfctl); -+ perfmon_cfg |= FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_ADDR, -+ MLXBF_PMC_PERFCTL); -+ perfmon_cfg |= FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_STROBE, 1); -+ perfmon_cfg |= FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_WR_R_B, 1); -+ -+ if (mlxbf_pmc_write(pmc->block[blk_num].mmio_base + -+ cnt_num * MLXBF_PMC_REG_SIZE, -+ MLXBF_PMC_WRITE_REG_64, perfmon_cfg)) -+ return -EFAULT; -+ -+ /* Select the event */ -+ perfevt = FIELD_PREP(MLXBF_PMC_PERFEVT_EVTSEL, evt); -+ -+ perfmon_cfg = FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_WDATA, perfevt); -+ perfmon_cfg |= FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_ADDR, -+ MLXBF_PMC_PERFEVT); -+ perfmon_cfg |= FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_STROBE, 1); -+ perfmon_cfg |= FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_WR_R_B, 1); -+ -+ if (mlxbf_pmc_write(pmc->block[blk_num].mmio_base + -+ cnt_num * MLXBF_PMC_REG_SIZE, -+ MLXBF_PMC_WRITE_REG_64, perfmon_cfg)) -+ return -EFAULT; -+ -+ /* Clear the accumulator */ -+ perfmon_cfg = FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_ADDR, -+ MLXBF_PMC_PERFACC0); -+ perfmon_cfg |= FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_STROBE, 1); -+ perfmon_cfg |= FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_WR_R_B, 1); -+ -+ if (mlxbf_pmc_write(pmc->block[blk_num].mmio_base + -+ cnt_num * MLXBF_PMC_REG_SIZE, -+ MLXBF_PMC_WRITE_REG_64, perfmon_cfg)) -+ return -EFAULT; -+ -+ return 0; -+} -+ -+/* Method to handle l3 counter reads */ -+static int mlxbf_pmc_read_l3_counter(int blk_num, uint32_t cnt_num, -+ uint64_t *result) -+{ -+ uint32_t perfcnt_low = 0, perfcnt_high = 0; -+ uint64_t value; -+ int status = 0; -+ -+ status = mlxbf_pmc_readl(pmc->block[blk_num].mmio_base + -+ MLXBF_PMC_L3C_PERF_CNT_LOW + -+ cnt_num * MLXBF_PMC_L3C_REG_SIZE, -+ &perfcnt_low); -+ -+ if (status) -+ return status; -+ -+ status = mlxbf_pmc_readl(pmc->block[blk_num].mmio_base + -+ MLXBF_PMC_L3C_PERF_CNT_HIGH + -+ cnt_num * MLXBF_PMC_L3C_REG_SIZE, -+ &perfcnt_high); -+ -+ if (status) -+ return status; -+ -+ value = perfcnt_high; -+ value = value << 32; -+ value |= perfcnt_low; -+ *result = value; -+ -+ return 0; -+} -+ -+/* Method to read the counter value */ -+static int mlxbf_pmc_read_counter(int blk_num, uint32_t cnt_num, bool is_l3, -+ uint64_t *result) -+{ -+ uint32_t perfcfg_offset, perfval_offset; -+ uint64_t perfmon_cfg; -+ int status; -+ -+ if (cnt_num >= pmc->block[blk_num].counters) -+ return -EINVAL; -+ -+ if (is_l3) -+ return mlxbf_pmc_read_l3_counter(blk_num, cnt_num, result); -+ -+ perfcfg_offset = cnt_num * MLXBF_PMC_REG_SIZE; -+ perfval_offset = perfcfg_offset + -+ pmc->block[blk_num].counters * MLXBF_PMC_REG_SIZE; -+ -+ /* Set counter in "read" mode */ -+ perfmon_cfg = FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_ADDR, -+ MLXBF_PMC_PERFACC0); -+ perfmon_cfg |= FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_STROBE, 1); -+ perfmon_cfg |= FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_WR_R_B, 0); -+ -+ status = mlxbf_pmc_write(pmc->block[blk_num].mmio_base + perfcfg_offset, -+ MLXBF_PMC_WRITE_REG_64, perfmon_cfg); -+ -+ if (status) -+ return status; -+ -+ /* Get the counter value */ -+ return mlxbf_pmc_read(pmc->block[blk_num].mmio_base + perfval_offset, -+ MLXBF_PMC_READ_REG_64, result); -+} -+ -+/* Method to read L3 block event */ -+static int mlxbf_pmc_read_l3_event(int blk_num, uint32_t cnt_num, -+ uint64_t *result) -+{ -+ uint32_t perfcnt_sel = 0, perfcnt_sel_1 = 0; -+ uint32_t *wordaddr; -+ void __iomem *pmcaddr; -+ uint64_t evt; -+ -+ /* Select appropriate register information */ -+ switch (cnt_num) { -+ case 0 ... 3: -+ pmcaddr = pmc->block[blk_num].mmio_base + -+ MLXBF_PMC_L3C_PERF_CNT_SEL; -+ wordaddr = &perfcnt_sel; -+ break; -+ case 4: -+ pmcaddr = pmc->block[blk_num].mmio_base + -+ MLXBF_PMC_L3C_PERF_CNT_SEL_1; -+ wordaddr = &perfcnt_sel_1; -+ break; -+ default: -+ return -EINVAL; -+ } -+ -+ if (mlxbf_pmc_readl(pmcaddr, wordaddr)) -+ return -EINVAL; -+ -+ /* Read from appropriate register field for the counter */ -+ switch (cnt_num) { -+ case 0: -+ evt = FIELD_GET(MLXBF_PMC_L3C_PERF_CNT_SEL_CNT_0, perfcnt_sel); -+ break; -+ case 1: -+ evt = FIELD_GET(MLXBF_PMC_L3C_PERF_CNT_SEL_CNT_1, perfcnt_sel); -+ break; -+ case 2: -+ evt = FIELD_GET(MLXBF_PMC_L3C_PERF_CNT_SEL_CNT_2, perfcnt_sel); -+ break; -+ case 3: -+ evt = FIELD_GET(MLXBF_PMC_L3C_PERF_CNT_SEL_CNT_3, perfcnt_sel); -+ break; -+ case 4: -+ evt = FIELD_GET(MLXBF_PMC_L3C_PERF_CNT_SEL_1_CNT_4, -+ perfcnt_sel_1); -+ break; -+ default: -+ return -EINVAL; -+ } -+ *result = evt; -+ -+ return 0; -+} -+ -+/* Method to find the event currently being monitored by a counter */ -+static int mlxbf_pmc_read_event(int blk_num, uint32_t cnt_num, bool is_l3, -+ uint64_t *result) -+{ -+ uint32_t perfcfg_offset, perfval_offset; -+ uint64_t perfmon_cfg, perfevt, perfctl; -+ -+ if (cnt_num >= pmc->block[blk_num].counters) -+ return -EINVAL; -+ -+ if (is_l3) -+ return mlxbf_pmc_read_l3_event(blk_num, cnt_num, result); -+ -+ perfcfg_offset = cnt_num * MLXBF_PMC_REG_SIZE; -+ perfval_offset = perfcfg_offset + -+ pmc->block[blk_num].counters * MLXBF_PMC_REG_SIZE; -+ -+ /* Set counter in "read" mode */ -+ perfmon_cfg = FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_ADDR, -+ MLXBF_PMC_PERFCTL); -+ perfmon_cfg |= FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_STROBE, 1); -+ perfmon_cfg |= FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_WR_R_B, 0); -+ -+ if (mlxbf_pmc_write(pmc->block[blk_num].mmio_base + perfcfg_offset, -+ MLXBF_PMC_WRITE_REG_64, perfmon_cfg)) -+ return -EFAULT; -+ -+ /* Check if the counter is enabled */ -+ -+ if (mlxbf_pmc_read(pmc->block[blk_num].mmio_base + perfval_offset, -+ MLXBF_PMC_READ_REG_64, &perfctl)) -+ return -EFAULT; -+ -+ if (!FIELD_GET(MLXBF_PMC_PERFCTL_EN0, perfctl)) -+ return -EINVAL; -+ -+ /* Set counter in "read" mode */ -+ perfmon_cfg = FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_ADDR, -+ MLXBF_PMC_PERFEVT); -+ perfmon_cfg |= FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_STROBE, 1); -+ perfmon_cfg |= FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_WR_R_B, 0); -+ -+ if (mlxbf_pmc_write(pmc->block[blk_num].mmio_base + perfcfg_offset, -+ MLXBF_PMC_WRITE_REG_64, perfmon_cfg)) -+ return -EFAULT; -+ -+ /* Get the event number */ -+ if (mlxbf_pmc_read(pmc->block[blk_num].mmio_base + perfval_offset, -+ MLXBF_PMC_READ_REG_64, &perfevt)) -+ return -EFAULT; -+ -+ *result = FIELD_GET(MLXBF_PMC_PERFEVT_EVTSEL, perfevt); -+ -+ return 0; -+} -+ -+/* Method to read a register */ -+static int mlxbf_pmc_read_reg(int blk_num, uint32_t offset, uint64_t *result) -+{ -+ uint32_t ecc_out; -+ -+ if (strstr(pmc->block_name[blk_num], "ecc")) { -+ if (mlxbf_pmc_readl(pmc->block[blk_num].mmio_base + offset, -+ &ecc_out)) -+ return -EFAULT; -+ -+ *result = ecc_out; -+ return 0; -+ } -+ -+ if (mlxbf_pmc_valid_range(blk_num, offset)) -+ return mlxbf_pmc_read(pmc->block[blk_num].mmio_base + offset, -+ MLXBF_PMC_READ_REG_64, result); -+ -+ return -EINVAL; -+} -+ -+/* Method to write to a register */ -+static int mlxbf_pmc_write_reg(int blk_num, uint32_t offset, uint64_t data) -+{ -+ if (strstr(pmc->block_name[blk_num], "ecc")) { -+ return mlxbf_pmc_write(pmc->block[blk_num].mmio_base + offset, -+ MLXBF_PMC_WRITE_REG_32, data); -+ } -+ -+ if (mlxbf_pmc_valid_range(blk_num, offset)) -+ return mlxbf_pmc_write(pmc->block[blk_num].mmio_base + offset, -+ MLXBF_PMC_WRITE_REG_64, data); -+ -+ return -EINVAL; -+} -+ -+/* Show function for "counter" sysfs files */ -+static ssize_t mlxbf_pmc_counter_show(struct device *dev, -+ struct device_attribute *attr, char *buf) -+{ -+ struct mlxbf_pmc_attribute *attr_counter = container_of( -+ attr, struct mlxbf_pmc_attribute, dev_attr); -+ int blk_num, cnt_num, offset; -+ bool is_l3 = false; -+ uint64_t value; -+ -+ blk_num = attr_counter->nr; -+ cnt_num = attr_counter->index; -+ -+ if (strstr(pmc->block_name[blk_num], "l3cache")) -+ is_l3 = true; -+ -+ if (pmc->block[blk_num].type == MLXBF_PMC_TYPE_COUNTER) { -+ if (mlxbf_pmc_read_counter(blk_num, cnt_num, is_l3, &value)) -+ return -EINVAL; -+ } else if (pmc->block[blk_num].type == MLXBF_PMC_TYPE_REGISTER) { -+ offset = mlxbf_pmc_get_event_num(pmc->block_name[blk_num], -+ attr->attr.name); -+ if (offset < 0) -+ return -EINVAL; -+ if (mlxbf_pmc_read_reg(blk_num, offset, &value)) -+ return -EINVAL; -+ } else -+ return -EINVAL; -+ -+ return sprintf(buf, "0x%llx\n", value); -+} -+ -+/* Store function for "counter" sysfs files */ -+static ssize_t mlxbf_pmc_counter_store(struct device *dev, -+ struct device_attribute *attr, -+ const char *buf, size_t count) -+{ -+ struct mlxbf_pmc_attribute *attr_counter = container_of( -+ attr, struct mlxbf_pmc_attribute, dev_attr); -+ int blk_num, cnt_num, offset, err, data; -+ bool is_l3 = false; -+ uint64_t evt_num; -+ -+ blk_num = attr_counter->nr; -+ cnt_num = attr_counter->index; -+ -+ err = kstrtoint(buf, 0, &data); -+ if (err < 0) -+ return err; -+ -+ /* Allow non-zero writes only to the ecc regs */ -+ if (!(strstr(pmc->block_name[blk_num], "ecc")) && data) -+ return -EINVAL; -+ -+ /* Do not allow writes to the L3C regs */ -+ if (strstr(pmc->block_name[blk_num], "l3cache")) -+ return -EINVAL; -+ -+ if (pmc->block[blk_num].type == MLXBF_PMC_TYPE_COUNTER) { -+ err = mlxbf_pmc_read_event(blk_num, cnt_num, is_l3, &evt_num); -+ if (err) -+ return err; -+ err = mlxbf_pmc_program_counter(blk_num, cnt_num, evt_num, -+ is_l3); -+ if (err) -+ return err; -+ } else if (pmc->block[blk_num].type == MLXBF_PMC_TYPE_REGISTER) { -+ offset = mlxbf_pmc_get_event_num(pmc->block_name[blk_num], -+ attr->attr.name); -+ if (offset < 0) -+ return -EINVAL; -+ err = mlxbf_pmc_write_reg(blk_num, offset, data); -+ if (err) -+ return err; -+ } else -+ return -EINVAL; -+ -+ return count; -+} -+ -+/* Show function for "event" sysfs files */ -+static ssize_t mlxbf_pmc_event_show(struct device *dev, -+ struct device_attribute *attr, char *buf) -+{ -+ struct mlxbf_pmc_attribute *attr_event = container_of( -+ attr, struct mlxbf_pmc_attribute, dev_attr); -+ int blk_num, cnt_num, err; -+ bool is_l3 = false; -+ uint64_t evt_num; -+ char *evt_name; -+ -+ blk_num = attr_event->nr; -+ cnt_num = attr_event->index; -+ -+ if (strstr(pmc->block_name[blk_num], "l3cache")) -+ is_l3 = true; -+ -+ err = mlxbf_pmc_read_event(blk_num, cnt_num, is_l3, &evt_num); -+ if (err) -+ return sprintf(buf, "No event being monitored\n"); -+ -+ evt_name = mlxbf_pmc_get_event_name(pmc->block_name[blk_num], evt_num); -+ if (!evt_name) -+ return -EINVAL; -+ -+ return sprintf(buf, "0x%llx: %s\n", evt_num, evt_name); -+} -+ -+/* Store function for "event" sysfs files */ -+static ssize_t mlxbf_pmc_event_store(struct device *dev, -+ struct device_attribute *attr, -+ const char *buf, size_t count) -+{ -+ struct mlxbf_pmc_attribute *attr_event = container_of( -+ attr, struct mlxbf_pmc_attribute, dev_attr); -+ int blk_num, cnt_num, evt_num, err; -+ bool is_l3 = false; -+ -+ blk_num = attr_event->nr; -+ cnt_num = attr_event->index; -+ -+ if (isalpha(buf[0])) { -+ evt_num = mlxbf_pmc_get_event_num(pmc->block_name[blk_num], -+ buf); -+ if (evt_num < 0) -+ return -EINVAL; -+ } else { -+ err = kstrtoint(buf, 0, &evt_num); -+ if (err < 0) -+ return err; -+ } -+ -+ if (strstr(pmc->block_name[blk_num], "l3cache")) -+ is_l3 = true; -+ -+ err = mlxbf_pmc_program_counter(blk_num, cnt_num, evt_num, is_l3); -+ if (err) -+ return err; -+ -+ return count; -+} -+ -+/* Show function for "event_list" sysfs files */ -+static ssize_t mlxbf_pmc_event_list_show(struct device *dev, -+ struct device_attribute *attr, -+ char *buf) -+{ -+ struct mlxbf_pmc_attribute *attr_event_list = container_of( -+ attr, struct mlxbf_pmc_attribute, dev_attr); -+ int blk_num, i, size, len = 0, ret = 0; -+ const struct mlxbf_pmc_events *events; -+ char e_info[MLXBF_PMC_EVENT_INFO_LEN]; -+ -+ blk_num = attr_event_list->nr; -+ -+ events = mlxbf_pmc_event_list(pmc->block_name[blk_num], &size); -+ if (!events) -+ return -EINVAL; -+ -+ for (i = 0, buf[0] = '\0'; i < size; ++i) { -+ len += sprintf(e_info, "0x%x: %s\n", events[i].evt_num, -+ events[i].evt_name); -+ if (len > PAGE_SIZE) -+ break; -+ strcat(buf, e_info); -+ ret = len; -+ } -+ -+ return ret; -+} -+ -+/* Show function for "enable" sysfs files - only for l3cache */ -+static ssize_t mlxbf_pmc_enable_show(struct device *dev, -+ struct device_attribute *attr, char *buf) -+{ -+ struct mlxbf_pmc_attribute *attr_enable = container_of( -+ attr, struct mlxbf_pmc_attribute, dev_attr); -+ uint32_t perfcnt_cfg; -+ int blk_num, value; -+ -+ blk_num = attr_enable->nr; -+ -+ if (mlxbf_pmc_readl(pmc->block[blk_num].mmio_base + -+ MLXBF_PMC_L3C_PERF_CNT_CFG, -+ &perfcnt_cfg)) -+ return -EINVAL; -+ -+ value = FIELD_GET(MLXBF_PMC_L3C_PERF_CNT_CFG_EN, perfcnt_cfg); -+ -+ return sprintf(buf, "%d\n", value); -+} -+ -+/* Store function for "enable" sysfs files - only for l3cache */ -+static ssize_t mlxbf_pmc_enable_store(struct device *dev, -+ struct device_attribute *attr, -+ const char *buf, size_t count) -+{ -+ struct mlxbf_pmc_attribute *attr_enable = container_of( -+ attr, struct mlxbf_pmc_attribute, dev_attr); -+ int err, en, blk_num; -+ -+ blk_num = attr_enable->nr; -+ -+ err = kstrtoint(buf, 0, &en); -+ if (err < 0) -+ return err; -+ -+ if (!en) { -+ err = mlxbf_pmc_config_l3_counters(blk_num, false, false); -+ if (err) -+ return err; -+ } else if (en == 1) { -+ err = mlxbf_pmc_config_l3_counters(blk_num, false, true); -+ if (err) -+ return err; -+ err = mlxbf_pmc_config_l3_counters(blk_num, true, false); -+ if (err) -+ return err; -+ } else -+ return -EINVAL; -+ -+ return count; -+} -+ -+/* Populate attributes for blocks with counters to monitor performance */ -+static int mlxbf_pmc_init_perftype_counter(struct device *dev, int blk_num) -+{ -+ struct mlxbf_pmc_attribute *attr; -+ int i = 0, j = 0; -+ -+ /* "event_list" sysfs to list events supported by the block */ -+ attr = &pmc->block[blk_num].attr_event_list; -+ attr->dev_attr.attr.mode = 0444; -+ attr->dev_attr.show = mlxbf_pmc_event_list_show; -+ attr->nr = blk_num; -+ attr->dev_attr.attr.name = devm_kasprintf(dev, GFP_KERNEL, "event_list"); -+ pmc->block[blk_num].block_attr[i] = &attr->dev_attr.attr; -+ attr = NULL; -+ -+ /* "enable" sysfs to start/stop the counters. Only in L3C blocks */ -+ if (strstr(pmc->block_name[blk_num], "l3cache")) { -+ attr = &pmc->block[blk_num].attr_enable; -+ attr->dev_attr.attr.mode = 0644; -+ attr->dev_attr.show = mlxbf_pmc_enable_show; -+ attr->dev_attr.store = mlxbf_pmc_enable_store; -+ attr->nr = blk_num; -+ attr->dev_attr.attr.name = devm_kasprintf(dev, GFP_KERNEL, -+ "enable"); -+ pmc->block[blk_num].block_attr[++i] = &attr->dev_attr.attr; -+ attr = NULL; -+ } -+ -+ pmc->block[blk_num].attr_counter = devm_kcalloc( -+ dev, pmc->block[blk_num].counters, -+ sizeof(struct mlxbf_pmc_attribute), GFP_KERNEL); -+ if (!pmc->block[blk_num].attr_counter) -+ return -ENOMEM; -+ -+ pmc->block[blk_num].attr_event = devm_kcalloc( -+ dev, pmc->block[blk_num].counters, -+ sizeof(struct mlxbf_pmc_attribute), GFP_KERNEL); -+ if (!pmc->block[blk_num].attr_event) -+ return -ENOMEM; -+ -+ /* "eventX" and "counterX" sysfs to program and read counter values */ -+ for (j = 0; j < pmc->block[blk_num].counters; ++j) { -+ attr = &pmc->block[blk_num].attr_counter[j]; -+ attr->dev_attr.attr.mode = 0644; -+ attr->dev_attr.show = mlxbf_pmc_counter_show; -+ attr->dev_attr.store = mlxbf_pmc_counter_store; -+ attr->index = j; -+ attr->nr = blk_num; -+ attr->dev_attr.attr.name = devm_kasprintf(dev, GFP_KERNEL, -+ "counter%d", j); -+ pmc->block[blk_num].block_attr[++i] = &attr->dev_attr.attr; -+ attr = NULL; -+ -+ attr = &pmc->block[blk_num].attr_event[j]; -+ attr->dev_attr.attr.mode = 0644; -+ attr->dev_attr.show = mlxbf_pmc_event_show; -+ attr->dev_attr.store = mlxbf_pmc_event_store; -+ attr->index = j; -+ attr->nr = blk_num; -+ attr->dev_attr.attr.name = devm_kasprintf(dev, GFP_KERNEL, -+ "event%d", j); -+ pmc->block[blk_num].block_attr[++i] = &attr->dev_attr.attr; -+ attr = NULL; -+ } -+ -+ return 0; -+} -+ -+/* Populate attributes for blocks with registers to monitor performance */ -+static int mlxbf_pmc_init_perftype_reg(struct device *dev, int blk_num) -+{ -+ struct mlxbf_pmc_attribute *attr; -+ const struct mlxbf_pmc_events *events; -+ int i = 0, j = 0; -+ -+ events = mlxbf_pmc_event_list(pmc->block_name[blk_num], &j); -+ if (!events) -+ return -EINVAL; -+ -+ pmc->block[blk_num].attr_event = devm_kcalloc( -+ dev, j, sizeof(struct mlxbf_pmc_attribute), GFP_KERNEL); -+ if (!pmc->block[blk_num].attr_event) -+ return -ENOMEM; -+ -+ while (j > 0) { -+ --j; -+ attr = &pmc->block[blk_num].attr_event[j]; -+ attr->dev_attr.attr.mode = 0644; -+ attr->dev_attr.show = mlxbf_pmc_counter_show; -+ attr->dev_attr.store = mlxbf_pmc_counter_store; -+ attr->nr = blk_num; -+ attr->dev_attr.attr.name = devm_kasprintf(dev, GFP_KERNEL, -+ events[j].evt_name); -+ pmc->block[blk_num].block_attr[i] = &attr->dev_attr.attr; -+ attr = NULL; -+ i++; -+ } -+ -+ return 0; -+} -+ -+/* Helper to create the bfperf sysfs sub-directories and files */ -+static int mlxbf_pmc_create_groups(struct device *dev, int blk_num) -+{ -+ int err; -+ -+ /* Populate attributes based on counter type */ -+ if (pmc->block[blk_num].type == MLXBF_PMC_TYPE_COUNTER) -+ err = mlxbf_pmc_init_perftype_counter(dev, blk_num); -+ else if (pmc->block[blk_num].type == MLXBF_PMC_TYPE_REGISTER) -+ err = mlxbf_pmc_init_perftype_reg(dev, blk_num); -+ else -+ err = -EINVAL; -+ -+ if (err) -+ return err; -+ -+ /* Add a new attribute_group for the block */ -+ pmc->block[blk_num].block_attr_grp.attrs = pmc->block[blk_num].block_attr; -+ pmc->block[blk_num].block_attr_grp.name = devm_kasprintf( -+ dev, GFP_KERNEL, pmc->block_name[blk_num]); -+ pmc->groups[blk_num] = &pmc->block[blk_num].block_attr_grp; -+ -+ return 0; -+} -+ -+static bool mlxbf_pmc_guid_match(const guid_t *guid, -+ const struct arm_smccc_res *res) -+{ -+ guid_t id = GUID_INIT(res->a0, res->a1, res->a1 >> 16, res->a2, -+ res->a2 >> 8, res->a2 >> 16, res->a2 >> 24, -+ res->a3, res->a3 >> 8, res->a3 >> 16, -+ res->a3 >> 24); -+ -+ return guid_equal(guid, &id); -+} -+ -+/* Helper to map the Performance Counters from the varios blocks */ -+static int mlxbf_pmc_map_counters(struct device *dev) -+{ -+ uint64_t info[MLXBF_PMC_INFO_SZ]; -+ int i, tile_num, ret; -+ -+ for (i = 0; i < pmc->total_blocks; ++i) { -+ if (strstr(pmc->block_name[i], "tile")) { -+ ret = sscanf(pmc->block_name[i], "tile%d", &tile_num); -+ if (ret < 0) -+ return ret; -+ -+ if (tile_num >= pmc->tile_count) -+ continue; -+ } -+ ret = device_property_read_u64_array(dev, pmc->block_name[i], -+ info, MLXBF_PMC_INFO_SZ); -+ if (ret) -+ return ret; -+ -+ /* -+ * Do not remap if the proper SMC calls are supported, -+ * since the SMC calls expect physical addresses. -+ */ -+ if (pmc->svc_sreg_support) -+ pmc->block[i].mmio_base = (void __iomem *)info[0]; -+ else -+ pmc->block[i].mmio_base = -+ devm_ioremap(dev, info[0], info[1]); -+ -+ pmc->block[i].blk_size = info[1]; -+ pmc->block[i].counters = info[2]; -+ pmc->block[i].type = info[3]; -+ -+ if (IS_ERR(pmc->block[i].mmio_base)) -+ return PTR_ERR(pmc->block[i].mmio_base); -+ -+ ret = mlxbf_pmc_create_groups(dev, i); -+ if (ret) -+ return ret; -+ } -+ -+ return 0; -+} -+ -+static int mlxbf_pmc_probe(struct platform_device *pdev) -+{ -+ struct acpi_device *acpi_dev = ACPI_COMPANION(&pdev->dev); -+ const char *hid = acpi_device_hid(acpi_dev); -+ struct device *dev = &pdev->dev; -+ struct arm_smccc_res res; -+ guid_t guid; -+ int ret; -+ -+ /* Ensure we have the UUID we expect for this service. */ -+ arm_smccc_smc(MLXBF_PMC_SIP_SVC_UID, 0, 0, 0, 0, 0, 0, 0, &res); -+ guid_parse(mlxbf_pmc_svc_uuid_str, &guid); -+ if (!mlxbf_pmc_guid_match(&guid, &res)) -+ return -ENODEV; -+ -+ pmc = devm_kzalloc(dev, sizeof(struct mlxbf_pmc_context), GFP_KERNEL); -+ if (!pmc) -+ return -ENOMEM; -+ -+ /* -+ * ACPI indicates whether we use SMCs to access registers or not. -+ * If sreg_tbl_perf is not present, just assume we're not using SMCs. -+ */ -+ ret = device_property_read_u32(dev, "sec_reg_block", -+ &pmc->sreg_tbl_perf); -+ if (ret) { -+ pmc->svc_sreg_support = false; -+ } else { -+ /* -+ * Check service version to see if we actually do support the -+ * needed SMCs. If we have the calls we need, mark support for -+ * them in the pmc struct. -+ */ -+ arm_smccc_smc(MLXBF_PMC_SIP_SVC_VERSION, 0, 0, 0, 0, 0, 0, 0, -+ &res); -+ if (res.a0 == MLXBF_PMC_SVC_REQ_MAJOR && -+ res.a1 >= MLXBF_PMC_SVC_MIN_MINOR) -+ pmc->svc_sreg_support = true; -+ else -+ return -EINVAL; -+ } -+ -+ if (!strcmp(hid, "MLNXBFD0")) -+ pmc->event_set = MLXBF_PMC_EVENT_SET_BF1; -+ else if (!strcmp(hid, "MLNXBFD1")) -+ pmc->event_set = MLXBF_PMC_EVENT_SET_BF2; -+ else -+ return -ENODEV; -+ -+ ret = device_property_read_u32(dev, "block_num", &pmc->total_blocks); -+ if (ret) -+ return ret; -+ -+ ret = device_property_read_string_array(dev, "block_name", -+ pmc->block_name, -+ pmc->total_blocks); -+ if (ret != pmc->total_blocks) -+ return -EFAULT; -+ -+ ret = device_property_read_u32(dev, "tile_num", &pmc->tile_count); -+ if (ret) -+ return ret; -+ -+ pmc->pdev = pdev; -+ -+ ret = mlxbf_pmc_map_counters(dev); -+ if (ret) -+ return ret; -+ -+ pmc->hwmon_dev = devm_hwmon_device_register_with_groups( -+ dev, "bfperf", pmc, pmc->groups); -+ platform_set_drvdata(pdev, pmc); -+ -+ return 0; -+} -+ -+static const struct acpi_device_id mlxbf_pmc_acpi_ids[] = { { "MLNXBFD0", 0 }, -+ { "MLNXBFD1", 0 }, -+ {}, }; -+ -+MODULE_DEVICE_TABLE(acpi, mlxbf_pmc_acpi_ids); -+static struct platform_driver pmc_driver = { -+ .driver = { .name = "mlxbf-pmc", -+ .acpi_match_table = ACPI_PTR(mlxbf_pmc_acpi_ids), }, -+ .probe = mlxbf_pmc_probe, -+}; -+ -+module_platform_driver(pmc_driver); -+ -+MODULE_AUTHOR("Shravan Kumar Ramani "); -+MODULE_DESCRIPTION("Mellanox PMC driver"); -+MODULE_LICENSE("Dual BSD/GPL"); --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0213-platform-mellanox-mlxbf-pmc-fix-kernel-doc-notation.patch b/platform/mellanox/non-upstream-patches/patches/0213-platform-mellanox-mlxbf-pmc-fix-kernel-doc-notation.patch deleted file mode 100644 index cfb80ac326e9..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0213-platform-mellanox-mlxbf-pmc-fix-kernel-doc-notation.patch +++ /dev/null @@ -1,94 +0,0 @@ -From 1494c3af245d1298a2fc7027c0724f8703820396 Mon Sep 17 00:00:00 2001 -From: Randy Dunlap -Date: Sun, 22 Aug 2021 10:17:42 -0700 -Subject: [PATCH backport 5.10 14/63] platform/mellanox: mlxbf-pmc: fix - kernel-doc notation - -Fix kernel-doc warnings reported by the kernel test robot: - -drivers/platform/mellanox/mlxbf-pmc.c:82: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst - * Structure to hold attribute and block info for each sysfs entry -drivers/platform/mellanox/mlxbf-pmc.c:94: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst - * Structure to hold info for each HW block -drivers/platform/mellanox/mlxbf-pmc.c:121: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst - * Structure to hold PMC context info -drivers/platform/mellanox/mlxbf-pmc.c:148: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst - * Structure to hold supported events for each block - -Also fix typos in a few struct member names. - -Signed-off-by: Randy Dunlap -Reported-by: kernel test robot -Cc: Aditya Srivastava -Cc: Hans de Goede -Cc: Mark Gross -Cc: Vadim Pasternak -Cc: platform-driver-x86@vger.kernel.org -Link: https://lore.kernel.org/r/20210822171742.26921-1-rdunlap@infradead.org -Signed-off-by: Hans de Goede ---- - drivers/platform/mellanox/mlxbf-pmc.c | 13 +++++++------ - 1 file changed, 7 insertions(+), 6 deletions(-) - -diff --git a/drivers/platform/mellanox/mlxbf-pmc.c b/drivers/platform/mellanox/mlxbf-pmc.c -index 358839842..04bc3b50a 100644 ---- a/drivers/platform/mellanox/mlxbf-pmc.c -+++ b/drivers/platform/mellanox/mlxbf-pmc.c -@@ -79,7 +79,8 @@ - #define MLXBF_PMC_L3C_PERF_CNT_HIGH_VAL GENMASK(24, 0) - - /** -- * Structure to hold attribute and block info for each sysfs entry -+ * struct mlxbf_pmc_attribute - Structure to hold attribute and block info -+ * for each sysfs entry - * @dev_attr: Device attribute struct - * @index: index to identify counter number within a block - * @nr: block number to which the sysfs belongs -@@ -91,7 +92,7 @@ struct mlxbf_pmc_attribute { - }; - - /** -- * Structure to hold info for each HW block -+ * struct mlxbf_pmc_block_info - Structure to hold info for each HW block - * - * @mmio_base: The VA at which the PMC block is mapped - * @blk_size: Size of each mapped region -@@ -102,7 +103,7 @@ struct mlxbf_pmc_attribute { - * @attr_event_list: Attributes for "event_list" sysfs files - * @attr_enable: Attributes for "enable" sysfs files - * @block_attr: All attributes needed for the block -- * @blcok_attr_grp: Attribute group for the block -+ * @block_attr_grp: Attribute group for the block - */ - struct mlxbf_pmc_block_info { - void __iomem *mmio_base; -@@ -118,7 +119,7 @@ struct mlxbf_pmc_block_info { - }; - - /** -- * Structure to hold PMC context info -+ * struct mlxbf_pmc_context - Structure to hold PMC context info - * - * @pdev: The kernel structure representing the device - * @total_blocks: Total number of blocks -@@ -127,7 +128,7 @@ struct mlxbf_pmc_block_info { - * @block_name: Block name - * @block: Block info - * @groups: Attribute groups from each block -- * @sv_sreg_support: Whether SMCs are used to access performance registers -+ * @svc_sreg_support: Whether SMCs are used to access performance registers - * @sreg_tbl_perf: Secure register access table number - * @event_set: Event set to use - */ -@@ -145,7 +146,7 @@ struct mlxbf_pmc_context { - }; - - /** -- * Structure to hold supported events for each block -+ * struct mlxbf_pmc_events - Structure to hold supported events for each block - * @evt_num: Event number used to program counters - * @evt_name: Name of the event - */ --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0214-platform-mellanox-mlxbf-pmc-Fix-an-IS_ERR-vs-NULL-bu.patch b/platform/mellanox/non-upstream-patches/patches/0214-platform-mellanox-mlxbf-pmc-Fix-an-IS_ERR-vs-NULL-bu.patch deleted file mode 100644 index b1308c8f63ec..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0214-platform-mellanox-mlxbf-pmc-Fix-an-IS_ERR-vs-NULL-bu.patch +++ /dev/null @@ -1,42 +0,0 @@ -From fd81d5b65715344eeb492dfb3d818551446021c9 Mon Sep 17 00:00:00 2001 -From: Miaoqian Lin -Date: Fri, 10 Dec 2021 07:07:53 +0000 -Subject: [PATCH backport 5.10 15/63] platform/mellanox: mlxbf-pmc: Fix an - IS_ERR() vs NULL bug in mlxbf_pmc_map_counters - -BugLink: https://bugs.launchpad.net/bugs/1956926 - -[ Upstream commit 804034c4ffc502795cea9b3867acb2ec7fad99ba ] - -The devm_ioremap() function returns NULL on error, it doesn't return -error pointers. Also according to doc of device_property_read_u64_array, -values in info array are properties of device or NULL. - -Signed-off-by: Miaoqian Lin -Link: https://lore.kernel.org/r/20211210070753.10761-1-linmq006@gmail.com -Reviewed-by: Hans de Goede -Signed-off-by: Hans de Goede -Signed-off-by: Sasha Levin -Signed-off-by: Paolo Pisati ---- - drivers/platform/mellanox/mlxbf-pmc.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/drivers/platform/mellanox/mlxbf-pmc.c b/drivers/platform/mellanox/mlxbf-pmc.c -index 04bc3b50a..65b4a819f 100644 ---- a/drivers/platform/mellanox/mlxbf-pmc.c -+++ b/drivers/platform/mellanox/mlxbf-pmc.c -@@ -1374,8 +1374,8 @@ static int mlxbf_pmc_map_counters(struct device *dev) - pmc->block[i].counters = info[2]; - pmc->block[i].type = info[3]; - -- if (IS_ERR(pmc->block[i].mmio_base)) -- return PTR_ERR(pmc->block[i].mmio_base); -+ if (!pmc->block[i].mmio_base) -+ return -ENOMEM; - - ret = mlxbf_pmc_create_groups(dev, i); - if (ret) --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0215-UBUNTU-SAUCE-platform-mellanox-Updates-to-mlxbf-pmc.patch b/platform/mellanox/non-upstream-patches/patches/0215-UBUNTU-SAUCE-platform-mellanox-Updates-to-mlxbf-pmc.patch deleted file mode 100644 index 91d0f9e7a39c..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0215-UBUNTU-SAUCE-platform-mellanox-Updates-to-mlxbf-pmc.patch +++ /dev/null @@ -1,2674 +0,0 @@ -From cc23dfd2e05d8e9ef59bcd5f760cc613e72bb80b Mon Sep 17 00:00:00 2001 -From: Shravan Kumar Ramani -Date: Tue, 5 Jul 2022 10:52:05 -0400 -Subject: [PATCH backport 5.10 16/63] UBUNTU: SAUCE: platform/mellanox: Updates - to mlxbf-pmc - -BugLink: https://launchpad.net/bugs/1980746 - -This commit reorganizes the code by moving all the macros -to a header file, and fixes bugs with reprogramming the -counters. - -Signed-off-by: Shravan Kumar Ramani -Signed-off-by: Ike Panhc ---- - drivers/platform/mellanox/mlxbf-pmc.c | 1722 +++++++++++-------------- - drivers/platform/mellanox/mlxbf-pmc.h | 428 ++++++ - 2 files changed, 1176 insertions(+), 974 deletions(-) - create mode 100644 drivers/platform/mellanox/mlxbf-pmc.h - -diff --git a/drivers/platform/mellanox/mlxbf-pmc.c b/drivers/platform/mellanox/mlxbf-pmc.c -index 65b4a819f..a9debcdf9 100644 ---- a/drivers/platform/mellanox/mlxbf-pmc.c -+++ b/drivers/platform/mellanox/mlxbf-pmc.c -@@ -1,482 +1,111 @@ --// SPDX-License-Identifier: GPL-2.0-only OR Linux-OpenIB --/* -- * Mellanox BlueField Performance Monitoring Counters driver -- * -- * This driver provides a sysfs interface for monitoring -- * performance statistics in BlueField SoC. -- * -- * Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. -- */ -+// SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause - - #include - #include - #include - #include - #include -+#include -+#include -+#include -+#include -+#include - #include --#include -+#include -+#include -+#include -+#include - #include - --#define MLXBF_PMC_WRITE_REG_32 0x82000009 --#define MLXBF_PMC_READ_REG_32 0x8200000A --#define MLXBF_PMC_WRITE_REG_64 0x8200000B --#define MLXBF_PMC_READ_REG_64 0x8200000C --#define MLXBF_PMC_SIP_SVC_UID 0x8200ff01 --#define MLXBF_PMC_SIP_SVC_VERSION 0x8200ff03 --#define MLXBF_PMC_SVC_REQ_MAJOR 0 --#define MLXBF_PMC_SVC_MIN_MINOR 3 -- --#define MLXBF_PMC_SMCCC_ACCESS_VIOLATION -4 -- --#define MLXBF_PMC_EVENT_SET_BF1 0 --#define MLXBF_PMC_EVENT_SET_BF2 1 --#define MLXBF_PMC_EVENT_INFO_LEN 100 -- --#define MLXBF_PMC_MAX_BLOCKS 30 --#define MLXBF_PMC_MAX_ATTRS 30 --#define MLXBF_PMC_INFO_SZ 4 --#define MLXBF_PMC_REG_SIZE 8 --#define MLXBF_PMC_L3C_REG_SIZE 4 -- --#define MLXBF_PMC_TYPE_COUNTER 1 --#define MLXBF_PMC_TYPE_REGISTER 0 -- --#define MLXBF_PMC_PERFCTL 0 --#define MLXBF_PMC_PERFEVT 1 --#define MLXBF_PMC_PERFACC0 4 -- --#define MLXBF_PMC_PERFMON_CONFIG_WR_R_B BIT(0) --#define MLXBF_PMC_PERFMON_CONFIG_STROBE BIT(1) --#define MLXBF_PMC_PERFMON_CONFIG_ADDR GENMASK_ULL(4, 2) --#define MLXBF_PMC_PERFMON_CONFIG_WDATA GENMASK_ULL(60, 5) -- --#define MLXBF_PMC_PERFCTL_FM0 GENMASK_ULL(18, 16) --#define MLXBF_PMC_PERFCTL_MS0 GENMASK_ULL(21, 20) --#define MLXBF_PMC_PERFCTL_ACCM0 GENMASK_ULL(26, 24) --#define MLXBF_PMC_PERFCTL_AD0 BIT(27) --#define MLXBF_PMC_PERFCTL_ETRIG0 GENMASK_ULL(29, 28) --#define MLXBF_PMC_PERFCTL_EB0 BIT(30) --#define MLXBF_PMC_PERFCTL_EN0 BIT(31) -- --#define MLXBF_PMC_PERFEVT_EVTSEL GENMASK_ULL(31, 24) -- --#define MLXBF_PMC_L3C_PERF_CNT_CFG 0x0 --#define MLXBF_PMC_L3C_PERF_CNT_SEL 0x10 --#define MLXBF_PMC_L3C_PERF_CNT_SEL_1 0x14 --#define MLXBF_PMC_L3C_PERF_CNT_LOW 0x40 --#define MLXBF_PMC_L3C_PERF_CNT_HIGH 0x60 -- --#define MLXBF_PMC_L3C_PERF_CNT_CFG_EN BIT(0) --#define MLXBF_PMC_L3C_PERF_CNT_CFG_RST BIT(1) --#define MLXBF_PMC_L3C_PERF_CNT_SEL_CNT_0 GENMASK(5, 0) --#define MLXBF_PMC_L3C_PERF_CNT_SEL_CNT_1 GENMASK(13, 8) --#define MLXBF_PMC_L3C_PERF_CNT_SEL_CNT_2 GENMASK(21, 16) --#define MLXBF_PMC_L3C_PERF_CNT_SEL_CNT_3 GENMASK(29, 24) -- --#define MLXBF_PMC_L3C_PERF_CNT_SEL_1_CNT_4 GENMASK(5, 0) -- --#define MLXBF_PMC_L3C_PERF_CNT_LOW_VAL GENMASK(31, 0) --#define MLXBF_PMC_L3C_PERF_CNT_HIGH_VAL GENMASK(24, 0) -- --/** -- * struct mlxbf_pmc_attribute - Structure to hold attribute and block info -- * for each sysfs entry -- * @dev_attr: Device attribute struct -- * @index: index to identify counter number within a block -- * @nr: block number to which the sysfs belongs -- */ --struct mlxbf_pmc_attribute { -- struct device_attribute dev_attr; -- int index; -- int nr; --}; -- --/** -- * struct mlxbf_pmc_block_info - Structure to hold info for each HW block -- * -- * @mmio_base: The VA at which the PMC block is mapped -- * @blk_size: Size of each mapped region -- * @counters: Number of counters in the block -- * @type: Type of counters in the block -- * @attr_counter: Attributes for "counter" sysfs files -- * @attr_event: Attributes for "event" sysfs files -- * @attr_event_list: Attributes for "event_list" sysfs files -- * @attr_enable: Attributes for "enable" sysfs files -- * @block_attr: All attributes needed for the block -- * @block_attr_grp: Attribute group for the block -- */ --struct mlxbf_pmc_block_info { -- void __iomem *mmio_base; -- size_t blk_size; -- size_t counters; -- int type; -- struct mlxbf_pmc_attribute *attr_counter; -- struct mlxbf_pmc_attribute *attr_event; -- struct mlxbf_pmc_attribute attr_event_list; -- struct mlxbf_pmc_attribute attr_enable; -- struct attribute *block_attr[MLXBF_PMC_MAX_ATTRS]; -- struct attribute_group block_attr_grp; --}; -- --/** -- * struct mlxbf_pmc_context - Structure to hold PMC context info -- * -- * @pdev: The kernel structure representing the device -- * @total_blocks: Total number of blocks -- * @tile_count: Number of tiles in the system -- * @hwmon_dev: Hwmon device for bfperf -- * @block_name: Block name -- * @block: Block info -- * @groups: Attribute groups from each block -- * @svc_sreg_support: Whether SMCs are used to access performance registers -- * @sreg_tbl_perf: Secure register access table number -- * @event_set: Event set to use -- */ --struct mlxbf_pmc_context { -- struct platform_device *pdev; -- uint32_t total_blocks; -- uint32_t tile_count; -- struct device *hwmon_dev; -- const char *block_name[MLXBF_PMC_MAX_BLOCKS]; -- struct mlxbf_pmc_block_info block[MLXBF_PMC_MAX_BLOCKS]; -- const struct attribute_group *groups[MLXBF_PMC_MAX_BLOCKS]; -- bool svc_sreg_support; -- uint32_t sreg_tbl_perf; -- unsigned int event_set; --}; -- --/** -- * struct mlxbf_pmc_events - Structure to hold supported events for each block -- * @evt_num: Event number used to program counters -- * @evt_name: Name of the event -- */ --struct mlxbf_pmc_events { -- int evt_num; -- char *evt_name; --}; -- --static const struct mlxbf_pmc_events mlxbf_pmc_pcie_events[] = { -- { 0x0, "IN_P_PKT_CNT" }, -- { 0x10, "IN_NP_PKT_CNT" }, -- { 0x18, "IN_C_PKT_CNT" }, -- { 0x20, "OUT_P_PKT_CNT" }, -- { 0x28, "OUT_NP_PKT_CNT" }, -- { 0x30, "OUT_C_PKT_CNT" }, -- { 0x38, "IN_P_BYTE_CNT" }, -- { 0x40, "IN_NP_BYTE_CNT" }, -- { 0x48, "IN_C_BYTE_CNT" }, -- { 0x50, "OUT_P_BYTE_CNT" }, -- { 0x58, "OUT_NP_BYTE_CNT" }, -- { 0x60, "OUT_C_BYTE_CNT" }, --}; -- --static const struct mlxbf_pmc_events mlxbf_pmc_smgen_events[] = { -- { 0x0, "AW_REQ" }, -- { 0x1, "AW_BEATS" }, -- { 0x2, "AW_TRANS" }, -- { 0x3, "AW_RESP" }, -- { 0x4, "AW_STL" }, -- { 0x5, "AW_LAT" }, -- { 0x6, "AW_REQ_TBU" }, -- { 0x8, "AR_REQ" }, -- { 0x9, "AR_BEATS" }, -- { 0xa, "AR_TRANS" }, -- { 0xb, "AR_STL" }, -- { 0xc, "AR_LAT" }, -- { 0xd, "AR_REQ_TBU" }, -- { 0xe, "TBU_MISS" }, -- { 0xf, "TX_DAT_AF" }, -- { 0x10, "RX_DAT_AF" }, -- { 0x11, "RETRYQ_CRED" }, --}; -- --static const struct mlxbf_pmc_events mlxbf_pmc_trio_events_1[] = { -- { 0xa0, "TPIO_DATA_BEAT" }, -- { 0xa1, "TDMA_DATA_BEAT" }, -- { 0xa2, "MAP_DATA_BEAT" }, -- { 0xa3, "TXMSG_DATA_BEAT" }, -- { 0xa4, "TPIO_DATA_PACKET" }, -- { 0xa5, "TDMA_DATA_PACKET" }, -- { 0xa6, "MAP_DATA_PACKET" }, -- { 0xa7, "TXMSG_DATA_PACKET" }, -- { 0xa8, "TDMA_RT_AF" }, -- { 0xa9, "TDMA_PBUF_MAC_AF" }, -- { 0xaa, "TRIO_MAP_WRQ_BUF_EMPTY" }, -- { 0xab, "TRIO_MAP_CPL_BUF_EMPTY" }, -- { 0xac, "TRIO_MAP_RDQ0_BUF_EMPTY" }, -- { 0xad, "TRIO_MAP_RDQ1_BUF_EMPTY" }, -- { 0xae, "TRIO_MAP_RDQ2_BUF_EMPTY" }, -- { 0xaf, "TRIO_MAP_RDQ3_BUF_EMPTY" }, -- { 0xb0, "TRIO_MAP_RDQ4_BUF_EMPTY" }, -- { 0xb1, "TRIO_MAP_RDQ5_BUF_EMPTY" }, -- { 0xb2, "TRIO_MAP_RDQ6_BUF_EMPTY" }, -- { 0xb3, "TRIO_MAP_RDQ7_BUF_EMPTY" }, --}; -- --static const struct mlxbf_pmc_events mlxbf_pmc_trio_events_2[] = { -- { 0xa0, "TPIO_DATA_BEAT" }, -- { 0xa1, "TDMA_DATA_BEAT" }, -- { 0xa2, "MAP_DATA_BEAT" }, -- { 0xa3, "TXMSG_DATA_BEAT" }, -- { 0xa4, "TPIO_DATA_PACKET" }, -- { 0xa5, "TDMA_DATA_PACKET" }, -- { 0xa6, "MAP_DATA_PACKET" }, -- { 0xa7, "TXMSG_DATA_PACKET" }, -- { 0xa8, "TDMA_RT_AF" }, -- { 0xa9, "TDMA_PBUF_MAC_AF" }, -- { 0xaa, "TRIO_MAP_WRQ_BUF_EMPTY" }, -- { 0xab, "TRIO_MAP_CPL_BUF_EMPTY" }, -- { 0xac, "TRIO_MAP_RDQ0_BUF_EMPTY" }, -- { 0xad, "TRIO_MAP_RDQ1_BUF_EMPTY" }, -- { 0xae, "TRIO_MAP_RDQ2_BUF_EMPTY" }, -- { 0xaf, "TRIO_MAP_RDQ3_BUF_EMPTY" }, -- { 0xb0, "TRIO_MAP_RDQ4_BUF_EMPTY" }, -- { 0xb1, "TRIO_MAP_RDQ5_BUF_EMPTY" }, -- { 0xb2, "TRIO_MAP_RDQ6_BUF_EMPTY" }, -- { 0xb3, "TRIO_MAP_RDQ7_BUF_EMPTY" }, -- { 0xb4, "TRIO_RING_TX_FLIT_CH0" }, -- { 0xb5, "TRIO_RING_TX_FLIT_CH1" }, -- { 0xb6, "TRIO_RING_TX_FLIT_CH2" }, -- { 0xb7, "TRIO_RING_TX_FLIT_CH3" }, -- { 0xb8, "TRIO_RING_TX_FLIT_CH4" }, -- { 0xb9, "TRIO_RING_RX_FLIT_CH0" }, -- { 0xba, "TRIO_RING_RX_FLIT_CH1" }, -- { 0xbb, "TRIO_RING_RX_FLIT_CH2" }, -- { 0xbc, "TRIO_RING_RX_FLIT_CH3" }, --}; -- --static const struct mlxbf_pmc_events mlxbf_pmc_ecc_events[] = { -- { 0x100, "ECC_SINGLE_ERROR_CNT" }, -- { 0x104, "ECC_DOUBLE_ERROR_CNT" }, -- { 0x114, "SERR_INJ" }, -- { 0x118, "DERR_INJ" }, -- { 0x124, "ECC_SINGLE_ERROR_0" }, -- { 0x164, "ECC_DOUBLE_ERROR_0" }, -- { 0x340, "DRAM_ECC_COUNT" }, -- { 0x344, "DRAM_ECC_INJECT" }, -- { 0x348, "DRAM_ECC_ERROR" }, --}; -+#include "mlxbf-pmc.h" - --static const struct mlxbf_pmc_events mlxbf_pmc_mss_events[] = { -- { 0xc0, "RXREQ_MSS" }, -- { 0xc1, "RXDAT_MSS" }, -- { 0xc2, "TXRSP_MSS" }, -- { 0xc3, "TXDAT_MSS" }, --}; -- --static const struct mlxbf_pmc_events mlxbf_pmc_hnf_events[] = { -- { 0x45, "HNF_REQUESTS" }, -- { 0x46, "HNF_REJECTS" }, -- { 0x47, "ALL_BUSY" }, -- { 0x48, "MAF_BUSY" }, -- { 0x49, "MAF_REQUESTS" }, -- { 0x4a, "RNF_REQUESTS" }, -- { 0x4b, "REQUEST_TYPE" }, -- { 0x4c, "MEMORY_READS" }, -- { 0x4d, "MEMORY_WRITES" }, -- { 0x4e, "VICTIM_WRITE" }, -- { 0x4f, "POC_FULL" }, -- { 0x50, "POC_FAIL" }, -- { 0x51, "POC_SUCCESS" }, -- { 0x52, "POC_WRITES" }, -- { 0x53, "POC_READS" }, -- { 0x54, "FORWARD" }, -- { 0x55, "RXREQ_HNF" }, -- { 0x56, "RXRSP_HNF" }, -- { 0x57, "RXDAT_HNF" }, -- { 0x58, "TXREQ_HNF" }, -- { 0x59, "TXRSP_HNF" }, -- { 0x5a, "TXDAT_HNF" }, -- { 0x5b, "TXSNP_HNF" }, -- { 0x5c, "INDEX_MATCH" }, -- { 0x5d, "A72_ACCESS" }, -- { 0x5e, "IO_ACCESS" }, -- { 0x5f, "TSO_WRITE" }, -- { 0x60, "TSO_CONFLICT" }, -- { 0x61, "DIR_HIT" }, -- { 0x62, "HNF_ACCEPTS" }, -- { 0x63, "REQ_BUF_EMPTY" }, -- { 0x64, "REQ_BUF_IDLE_MAF" }, -- { 0x65, "TSO_NOARB" }, -- { 0x66, "TSO_NOARB_CYCLES" }, -- { 0x67, "MSS_NO_CREDIT" }, -- { 0x68, "TXDAT_NO_LCRD" }, -- { 0x69, "TXSNP_NO_LCRD" }, -- { 0x6a, "TXRSP_NO_LCRD" }, -- { 0x6b, "TXREQ_NO_LCRD" }, -- { 0x6c, "TSO_CL_MATCH" }, -- { 0x6d, "MEMORY_READS_BYPASS" }, -- { 0x6e, "TSO_NOARB_TIMEOUT" }, -- { 0x6f, "ALLOCATE" }, -- { 0x70, "VICTIM" }, -- { 0x71, "A72_WRITE" }, -- { 0x72, "A72_READ" }, -- { 0x73, "IO_WRITE" }, -- { 0x74, "IO_READ" }, -- { 0x75, "TSO_REJECT" }, -- { 0x80, "TXREQ_RN" }, -- { 0x81, "TXRSP_RN" }, -- { 0x82, "TXDAT_RN" }, -- { 0x83, "RXSNP_RN" }, -- { 0x84, "RXRSP_RN" }, -- { 0x85, "RXDAT_RN" }, --}; -- --static const struct mlxbf_pmc_events mlxbf_pmc_hnfnet_events[] = { -- { 0x12, "CDN_REQ" }, -- { 0x13, "DDN_REQ" }, -- { 0x14, "NDN_REQ" }, -- { 0x15, "CDN_DIAG_N_OUT_OF_CRED" }, -- { 0x16, "CDN_DIAG_S_OUT_OF_CRED" }, -- { 0x17, "CDN_DIAG_E_OUT_OF_CRED" }, -- { 0x18, "CDN_DIAG_W_OUT_OF_CRED" }, -- { 0x19, "CDN_DIAG_C_OUT_OF_CRED" }, -- { 0x1a, "CDN_DIAG_N_EGRESS" }, -- { 0x1b, "CDN_DIAG_S_EGRESS" }, -- { 0x1c, "CDN_DIAG_E_EGRESS" }, -- { 0x1d, "CDN_DIAG_W_EGRESS" }, -- { 0x1e, "CDN_DIAG_C_EGRESS" }, -- { 0x1f, "CDN_DIAG_N_INGRESS" }, -- { 0x20, "CDN_DIAG_S_INGRESS" }, -- { 0x21, "CDN_DIAG_E_INGRESS" }, -- { 0x22, "CDN_DIAG_W_INGRESS" }, -- { 0x23, "CDN_DIAG_C_INGRESS" }, -- { 0x24, "CDN_DIAG_CORE_SENT" }, -- { 0x25, "DDN_DIAG_N_OUT_OF_CRED" }, -- { 0x26, "DDN_DIAG_S_OUT_OF_CRED" }, -- { 0x27, "DDN_DIAG_E_OUT_OF_CRED" }, -- { 0x28, "DDN_DIAG_W_OUT_OF_CRED" }, -- { 0x29, "DDN_DIAG_C_OUT_OF_CRED" }, -- { 0x2a, "DDN_DIAG_N_EGRESS" }, -- { 0x2b, "DDN_DIAG_S_EGRESS" }, -- { 0x2c, "DDN_DIAG_E_EGRESS" }, -- { 0x2d, "DDN_DIAG_W_EGRESS" }, -- { 0x2e, "DDN_DIAG_C_EGRESS" }, -- { 0x2f, "DDN_DIAG_N_INGRESS" }, -- { 0x30, "DDN_DIAG_S_INGRESS" }, -- { 0x31, "DDN_DIAG_E_INGRESS" }, -- { 0x32, "DDN_DIAG_W_INGRESS" }, -- { 0x33, "DDN_DIAG_C_INGRESS" }, -- { 0x34, "DDN_DIAG_CORE_SENT" }, -- { 0x35, "NDN_DIAG_S_OUT_OF_CRED" }, -- { 0x36, "NDN_DIAG_S_OUT_OF_CRED" }, -- { 0x37, "NDN_DIAG_E_OUT_OF_CRED" }, -- { 0x38, "NDN_DIAG_W_OUT_OF_CRED" }, -- { 0x39, "NDN_DIAG_C_OUT_OF_CRED" }, -- { 0x3a, "NDN_DIAG_N_EGRESS" }, -- { 0x3b, "NDN_DIAG_S_EGRESS" }, -- { 0x3c, "NDN_DIAG_E_EGRESS" }, -- { 0x3d, "NDN_DIAG_W_EGRESS" }, -- { 0x3e, "NDN_DIAG_C_EGRESS" }, -- { 0x3f, "NDN_DIAG_N_INGRESS" }, -- { 0x40, "NDN_DIAG_S_INGRESS" }, -- { 0x41, "NDN_DIAG_E_INGRESS" }, -- { 0x42, "NDN_DIAG_W_INGRESS" }, -- { 0x43, "NDN_DIAG_C_INGRESS" }, -- { 0x44, "NDN_DIAG_CORE_SENT" }, --}; -- --static const struct mlxbf_pmc_events mlxbf_pmc_l3c_events[] = { -- { 0x00, "DISABLE" }, -- { 0x01, "CYCLES" }, -- { 0x02, "TOTAL_RD_REQ_IN" }, -- { 0x03, "TOTAL_WR_REQ_IN" }, -- { 0x04, "TOTAL_WR_DBID_ACK" }, -- { 0x05, "TOTAL_WR_DATA_IN" }, -- { 0x06, "TOTAL_WR_COMP" }, -- { 0x07, "TOTAL_RD_DATA_OUT" }, -- { 0x08, "TOTAL_CDN_REQ_IN_BANK0" }, -- { 0x09, "TOTAL_CDN_REQ_IN_BANK1" }, -- { 0x0a, "TOTAL_DDN_REQ_IN_BANK0" }, -- { 0x0b, "TOTAL_DDN_REQ_IN_BANK1" }, -- { 0x0c, "TOTAL_EMEM_RD_RES_IN_BANK0" }, -- { 0x0d, "TOTAL_EMEM_RD_RES_IN_BANK1" }, -- { 0x0e, "TOTAL_CACHE_RD_RES_IN_BANK0" }, -- { 0x0f, "TOTAL_CACHE_RD_RES_IN_BANK1" }, -- { 0x10, "TOTAL_EMEM_RD_REQ_BANK0" }, -- { 0x11, "TOTAL_EMEM_RD_REQ_BANK1" }, -- { 0x12, "TOTAL_EMEM_WR_REQ_BANK0" }, -- { 0x13, "TOTAL_EMEM_WR_REQ_BANK1" }, -- { 0x14, "TOTAL_RD_REQ_OUT" }, -- { 0x15, "TOTAL_WR_REQ_OUT" }, -- { 0x16, "TOTAL_RD_RES_IN" }, -- { 0x17, "HITS_BANK0" }, -- { 0x18, "HITS_BANK1" }, -- { 0x19, "MISSES_BANK0" }, -- { 0x1a, "MISSES_BANK1" }, -- { 0x1b, "ALLOCATIONS_BANK0" }, -- { 0x1c, "ALLOCATIONS_BANK1" }, -- { 0x1d, "EVICTIONS_BANK0" }, -- { 0x1e, "EVICTIONS_BANK1" }, -- { 0x1f, "DBID_REJECT" }, -- { 0x20, "WRDB_REJECT_BANK0" }, -- { 0x21, "WRDB_REJECT_BANK1" }, -- { 0x22, "CMDQ_REJECT_BANK0" }, -- { 0x23, "CMDQ_REJECT_BANK1" }, -- { 0x24, "COB_REJECT_BANK0" }, -- { 0x25, "COB_REJECT_BANK1" }, -- { 0x26, "TRB_REJECT_BANK0" }, -- { 0x27, "TRB_REJECT_BANK1" }, -- { 0x28, "TAG_REJECT_BANK0" }, -- { 0x29, "TAG_REJECT_BANK1" }, -- { 0x2a, "ANY_REJECT_BANK0" }, -- { 0x2b, "ANY_REJECT_BANK1" }, --}; -+#define DRIVER_VERSION 2.2 - - static struct mlxbf_pmc_context *pmc; - --/* UUID used to probe ATF service. */ --static const char *mlxbf_pmc_svc_uuid_str = "89c036b4-e7d7-11e6-8797-001aca00bfc4"; -+#define SIZE_64 0 -+#define SIZE_32 1 - - /* Calls an SMC to access a performance register */ --static int mlxbf_pmc_secure_read(void __iomem *addr, uint32_t command, -- uint64_t *result) -+static int mlxbf_pmc_secure_read(void *addr, int size, uint64_t *result) - { - struct arm_smccc_res res; -- int status, err = 0; -+ uint32_t command; -+ int status; -+ -+ switch (size) { -+ case SIZE_32: -+ command = MLNX_READ_REG_32; -+ break; -+ case SIZE_64: -+ command = MLNX_READ_REG_64; -+ break; -+ default: -+ dev_err(pmc->hwmon_dev, -+ "%s: invalid size: %d\n", __func__, size); -+ return -EINVAL; -+ } - -- arm_smccc_smc(command, pmc->sreg_tbl_perf, (uintptr_t)addr, 0, 0, 0, 0, -- 0, &res); -+ arm_smccc_smc( -+ command, -+ pmc->sreg_tbl_perf, -+ (uintptr_t) addr, -+ 0, 0, 0, 0, 0, &res); - - status = res.a0; - - switch (status) { -+ /* -+ * Note: PSCI_RET_NOT_SUPPORTED is used here to maintain compatibility -+ * with older kernels that do not have SMCCC_RET_NOT_SUPPORTED -+ */ - case PSCI_RET_NOT_SUPPORTED: -- err = -EINVAL; -- break; -- case MLXBF_PMC_SMCCC_ACCESS_VIOLATION: -- err = -EACCES; -- break; -+ dev_err(pmc->hwmon_dev, -+ "%s: required SMC unsupported", __func__); -+ return -EINVAL; -+ case SMCCC_ACCESS_VIOLATION: -+ dev_err(pmc->hwmon_dev, -+ "%s: could not read register %p. Is it perf?", -+ __func__, -+ addr); -+ return -EACCES; - default: -- *result = res.a1; -- break; -+ *result = (uint64_t)res.a1; -+ return 0; - } -- -- return err; - } - - /* Read from a performance counter */ --static int mlxbf_pmc_read(void __iomem *addr, uint32_t command, -- uint64_t *result) -+static int mlxbf_pmc_read(void *addr, int size, uint64_t *result) - { -- if (pmc->svc_sreg_support) -- return mlxbf_pmc_secure_read(addr, command, result); -- -- if (command == MLXBF_PMC_READ_REG_32) -- *result = readl(addr); -- else -- *result = readq(addr); -- -- return 0; -+ if (pmc->svc_sreg_support) { -+ if (mlxbf_pmc_secure_read(addr, size, result)) -+ return -EINVAL; -+ else -+ return 0; -+ } else { -+ switch (size) { -+ case SIZE_32: -+ *result = (uint64_t)readl(addr); -+ return 0; -+ case SIZE_64: -+ *result = readq(addr); -+ return 0; -+ default: -+ dev_err(pmc->hwmon_dev, -+ "%s: invalid size: %d\n", __func__, size); -+ return -EINVAL; -+ } -+ } - } - - /* Convenience function for 32-bit reads */ --static int mlxbf_pmc_readl(void __iomem *addr, uint32_t *result) -+static int mlxbf_pmc_readl(uint32_t *result, void *addr) - { - uint64_t read_out; - int status; - -- status = mlxbf_pmc_read(addr, MLXBF_PMC_READ_REG_32, &read_out); -+ status = mlxbf_pmc_read(addr, SIZE_32, &read_out); - if (status) - return status; - *result = (uint32_t)read_out; -@@ -484,231 +113,274 @@ static int mlxbf_pmc_readl(void __iomem *addr, uint32_t *result) - return 0; - } - -+/* Convenience function for 64-bit reads */ -+static int mlxbf_pmc_readq(uint64_t *result, void *addr) -+{ -+ return mlxbf_pmc_read(addr, SIZE_64, result); -+} -+ - /* Calls an SMC to access a performance register */ --static int mlxbf_pmc_secure_write(void __iomem *addr, uint32_t command, -- uint64_t value) -+static int mlxbf_pmc_secure_write(uint64_t value, void *addr, int size) - { - struct arm_smccc_res res; -- int status, err = 0; -+ uint32_t command; -+ int status; - -- arm_smccc_smc(command, pmc->sreg_tbl_perf, value, (uintptr_t)addr, 0, 0, -- 0, 0, &res); -+ switch (size) { -+ case SIZE_32: -+ command = MLNX_WRITE_REG_32; -+ break; -+ case SIZE_64: -+ command = MLNX_WRITE_REG_64; -+ break; -+ default: -+ dev_err(pmc->hwmon_dev, -+ "%s: invalid size: %d\n", __func__, size); -+ return -EINVAL; -+ } -+ -+ arm_smccc_smc( -+ command, -+ pmc->sreg_tbl_perf, -+ value, -+ (uintptr_t) addr, -+ 0, 0, 0, 0, &res); - - status = res.a0; - - switch (status) { - case PSCI_RET_NOT_SUPPORTED: -- err = -EINVAL; -- break; -- case MLXBF_PMC_SMCCC_ACCESS_VIOLATION: -- err = -EACCES; -- break; -+ dev_err(pmc->hwmon_dev, -+ "%s: required SMC unsupported", __func__); -+ return -EINVAL; -+ case SMCCC_ACCESS_VIOLATION: -+ dev_err(pmc->hwmon_dev, -+ "%s: could not write register %p. Is it perf?", -+ __func__, -+ addr); -+ return -EACCES; -+ default: -+ return 0; - } -- -- return err; - } - - /* Write to a performance counter */ --static int mlxbf_pmc_write(void __iomem *addr, int command, uint64_t value) -+static int mlxbf_pmc_write(uint64_t value, void *addr, int size) - { - if (pmc->svc_sreg_support) -- return mlxbf_pmc_secure_write(addr, command, value); -+ return mlxbf_pmc_secure_write(value, addr, size); - -- if (command == MLXBF_PMC_WRITE_REG_32) -- writel(value, addr); -- else -+ switch (size) { -+ case SIZE_32: -+ writel((uint32_t)value, addr); -+ return 0; -+ case SIZE_64: - writeq(value, addr); -+ return 0; -+ default: -+ dev_err(pmc->hwmon_dev, -+ "%s: invalid size: %d\n", __func__, size); -+ return -EINVAL; -+ } -+} - -- return 0; -+/* Convenience function for 32-bit writes */ -+static int mlxbf_pmc_writel(uint32_t value, void *addr) -+{ -+ return mlxbf_pmc_write((uint64_t) value, addr, SIZE_32); -+} -+ -+/* Convenience function for 64-bit writes */ -+static int mlxbf_pmc_writeq(uint64_t value, void *addr) -+{ -+ return mlxbf_pmc_write(value, addr, SIZE_64); - } - - /* Check if the register offset is within the mapped region for the block */ - static bool mlxbf_pmc_valid_range(int blk_num, uint32_t offset) - { -- if ((offset >= 0) && !(offset % MLXBF_PMC_REG_SIZE) && -- (offset + MLXBF_PMC_REG_SIZE <= pmc->block[blk_num].blk_size)) -- return true; /* inside the mapped PMC space */ -+ if (offset % 8 != 0) -+ return false; /* unaligned */ -+ if (offset >= 0 && offset + 8 <= pmc->block[blk_num].blk_size) -+ return true; /* inside the mapped PMC space */ - - return false; - } - -+/* Get the block number using the name */ -+static int mlxbf_pmc_get_block_num(const char *name) -+{ -+ int i; -+ -+ for (i = 0; i < pmc->total_blocks; ++i) -+ if (strcmp((char *)name, pmc->block_name[i]) == 0) -+ return i; -+ -+ return -ENODEV; -+} -+ - /* Get the event list corresponding to a certain block */ --static const struct mlxbf_pmc_events *mlxbf_pmc_event_list(const char *blk, -- int *size) -+struct mlxbf_pmc_events *mlxbf_pmc_event_list(char *blk) - { -- const struct mlxbf_pmc_events *events; -- -- if (strstr(blk, "tilenet")) { -- events = mlxbf_pmc_hnfnet_events; -- *size = ARRAY_SIZE(mlxbf_pmc_hnfnet_events); -- } else if (strstr(blk, "tile")) { -- events = mlxbf_pmc_hnf_events; -- *size = ARRAY_SIZE(mlxbf_pmc_hnf_events); -- } else if (strstr(blk, "triogen")) { -- events = mlxbf_pmc_smgen_events; -- *size = ARRAY_SIZE(mlxbf_pmc_smgen_events); -- } else if (strstr(blk, "trio")) { -+ struct mlxbf_pmc_events *events; -+ -+ if (strstr(blk, "tilenet")) -+ events = mlxbf2_hnfnet_events; -+ else if (strstr(blk, "tile")) -+ events = mlxbf_hnf_events; -+ else if (strstr(blk, "triogen")) -+ events = mlxbf_smgen_events; -+ else if (strstr(blk, "trio")) - switch (pmc->event_set) { -- case MLXBF_PMC_EVENT_SET_BF1: -- events = mlxbf_pmc_trio_events_1; -- *size = ARRAY_SIZE(mlxbf_pmc_trio_events_1); -+ case MLNX_EVENT_SET_BF1: -+ events = mlxbf1_trio_events; - break; -- case MLXBF_PMC_EVENT_SET_BF2: -- events = mlxbf_pmc_trio_events_2; -- *size = ARRAY_SIZE(mlxbf_pmc_trio_events_2); -+ case MLNX_EVENT_SET_BF2: -+ events = mlxbf2_trio_events; - break; - default: - events = NULL; -- *size = 0; - break; - } -- } else if (strstr(blk, "mss")) { -- events = mlxbf_pmc_mss_events; -- *size = ARRAY_SIZE(mlxbf_pmc_mss_events); -- } else if (strstr(blk, "ecc")) { -- events = mlxbf_pmc_ecc_events; -- *size = ARRAY_SIZE(mlxbf_pmc_ecc_events); -- } else if (strstr(blk, "pcie")) { -- events = mlxbf_pmc_pcie_events; -- *size = ARRAY_SIZE(mlxbf_pmc_pcie_events); -- } else if (strstr(blk, "l3cache")) { -- events = mlxbf_pmc_l3c_events; -- *size = ARRAY_SIZE(mlxbf_pmc_l3c_events); -- } else if (strstr(blk, "gic")) { -- events = mlxbf_pmc_smgen_events; -- *size = ARRAY_SIZE(mlxbf_pmc_smgen_events); -- } else if (strstr(blk, "smmu")) { -- events = mlxbf_pmc_smgen_events; -- *size = ARRAY_SIZE(mlxbf_pmc_smgen_events); -- } else { -+ else if (strstr(blk, "mss")) -+ events = mlxbf_mss_events; -+ else if (strstr(blk, "ecc")) -+ events = mlxbf_ecc_events; -+ else if (strstr(blk, "pcie")) -+ events = mlxbf_pcie_events; -+ else if (strstr(blk, "l3cache")) -+ events = mlxbf_l3cache_events; -+ else if (strstr(blk, "gic")) -+ events = mlxbf_smgen_events; -+ else if (strstr(blk, "smmu")) -+ events = mlxbf_smgen_events; -+ else - events = NULL; -- *size = 0; -- } - - return events; - } - - /* Get the event number given the name */ --static int mlxbf_pmc_get_event_num(const char *blk, const char *evt) -+static int mlxbf_pmc_get_event_num(char *blk, char *evt) - { -- const struct mlxbf_pmc_events *events; -- int i, size; -+ struct mlxbf_pmc_events *events; -+ int i = 0; - -- events = mlxbf_pmc_event_list(blk, &size); -- if (!events) -+ events = mlxbf_pmc_event_list(blk); -+ if (events == NULL) - return -EINVAL; - -- for (i = 0; i < size; ++i) { -- if (!strcmp(evt, events[i].evt_name)) -+ while (events[i].evt_name != NULL) { -+ if (strcmp(evt, events[i].evt_name) == 0) - return events[i].evt_num; -+ ++i; - } - - return -ENODEV; - } - - /* Get the event number given the name */ --static char *mlxbf_pmc_get_event_name(const char *blk, int evt) -+static char *mlxbf_pmc_get_event_name(char *blk, int evt) - { -- const struct mlxbf_pmc_events *events; -- int i, size; -+ struct mlxbf_pmc_events *events; -+ int i = 0; - -- events = mlxbf_pmc_event_list(blk, &size); -- if (!events) -+ events = mlxbf_pmc_event_list(blk); -+ if (events == NULL) - return NULL; - -- for (i = 0; i < size; ++i) { -+ while (events[i].evt_name != NULL) { - if (evt == events[i].evt_num) - return events[i].evt_name; -+ ++i; - } - - return NULL; - } - - /* Method to enable/disable/reset l3cache counters */ --static int mlxbf_pmc_config_l3_counters(int blk_num, bool enable, bool reset) -+int mlxbf_config_l3_counters(int blk_num, bool enable, bool reset) - { - uint32_t perfcnt_cfg = 0; - - if (enable) -- perfcnt_cfg |= MLXBF_PMC_L3C_PERF_CNT_CFG_EN; -+ perfcnt_cfg |= MLXBF_L3C_PERF_CNT_CFG__EN; - if (reset) -- perfcnt_cfg |= MLXBF_PMC_L3C_PERF_CNT_CFG_RST; -+ perfcnt_cfg |= MLXBF_L3C_PERF_CNT_CFG__RST; - -- return mlxbf_pmc_write(pmc->block[blk_num].mmio_base + -- MLXBF_PMC_L3C_PERF_CNT_CFG, -- MLXBF_PMC_WRITE_REG_32, perfcnt_cfg); -+ return mlxbf_pmc_writel(perfcnt_cfg, pmc->block[blk_num].mmio_base + -+ MLXBF_L3C_PERF_CNT_CFG); - } - -+ - /* Method to handle l3cache counter programming */ --static int mlxbf_pmc_program_l3_counter(int blk_num, uint32_t cnt_num, -- uint32_t evt) -+int mlxbf_program_l3_counter(int blk_num, uint32_t cnt_num, uint32_t evt) - { - uint32_t perfcnt_sel_1 = 0; - uint32_t perfcnt_sel = 0; - uint32_t *wordaddr; -- void __iomem *pmcaddr; -+ void *pmcaddr; - int ret; - - /* Disable all counters before programming them */ -- if (mlxbf_pmc_config_l3_counters(blk_num, false, false)) -+ if (mlxbf_config_l3_counters(blk_num, false, false)) - return -EINVAL; - - /* Select appropriate register information */ - switch (cnt_num) { -- case 0 ... 3: -+ case 0: -+ case 1: -+ case 2: -+ case 3: - pmcaddr = pmc->block[blk_num].mmio_base + -- MLXBF_PMC_L3C_PERF_CNT_SEL; -+ MLXBF_L3C_PERF_CNT_SEL; - wordaddr = &perfcnt_sel; - break; - case 4: - pmcaddr = pmc->block[blk_num].mmio_base + -- MLXBF_PMC_L3C_PERF_CNT_SEL_1; -+ MLXBF_L3C_PERF_CNT_SEL_1; - wordaddr = &perfcnt_sel_1; - break; - default: - return -EINVAL; - } - -- ret = mlxbf_pmc_readl(pmcaddr, wordaddr); -+ ret = mlxbf_pmc_readl(wordaddr, pmcaddr); - if (ret) - return ret; - - switch (cnt_num) { - case 0: -- perfcnt_sel &= ~MLXBF_PMC_L3C_PERF_CNT_SEL_CNT_0; -- perfcnt_sel |= FIELD_PREP(MLXBF_PMC_L3C_PERF_CNT_SEL_CNT_0, -- evt); -+ perfcnt_sel &= ~MLXBF_L3C_PERF_CNT_SEL__CNT_0; -+ perfcnt_sel |= FIELD_PREP(MLXBF_L3C_PERF_CNT_SEL__CNT_0, evt); - break; - case 1: -- perfcnt_sel &= ~MLXBF_PMC_L3C_PERF_CNT_SEL_CNT_1; -- perfcnt_sel |= FIELD_PREP(MLXBF_PMC_L3C_PERF_CNT_SEL_CNT_1, -- evt); -+ perfcnt_sel &= ~MLXBF_L3C_PERF_CNT_SEL__CNT_1; -+ perfcnt_sel |= FIELD_PREP(MLXBF_L3C_PERF_CNT_SEL__CNT_1, evt); - break; - case 2: -- perfcnt_sel &= ~MLXBF_PMC_L3C_PERF_CNT_SEL_CNT_2; -- perfcnt_sel |= FIELD_PREP(MLXBF_PMC_L3C_PERF_CNT_SEL_CNT_2, -- evt); -+ perfcnt_sel &= ~MLXBF_L3C_PERF_CNT_SEL__CNT_2; -+ perfcnt_sel |= FIELD_PREP(MLXBF_L3C_PERF_CNT_SEL__CNT_2, evt); - break; - case 3: -- perfcnt_sel &= ~MLXBF_PMC_L3C_PERF_CNT_SEL_CNT_3; -- perfcnt_sel |= FIELD_PREP(MLXBF_PMC_L3C_PERF_CNT_SEL_CNT_3, -- evt); -+ perfcnt_sel &= ~MLXBF_L3C_PERF_CNT_SEL__CNT_3; -+ perfcnt_sel |= FIELD_PREP(MLXBF_L3C_PERF_CNT_SEL__CNT_3, evt); - break; - case 4: -- perfcnt_sel_1 &= ~MLXBF_PMC_L3C_PERF_CNT_SEL_1_CNT_4; -- perfcnt_sel_1 |= FIELD_PREP(MLXBF_PMC_L3C_PERF_CNT_SEL_1_CNT_4, -+ perfcnt_sel_1 &= ~MLXBF_L3C_PERF_CNT_SEL_1__CNT_4; -+ perfcnt_sel_1 |= FIELD_PREP(MLXBF_L3C_PERF_CNT_SEL_1__CNT_4, - evt); - break; - default: - return -EINVAL; - } - -- return mlxbf_pmc_write(pmcaddr, MLXBF_PMC_WRITE_REG_32, *wordaddr); -+ return mlxbf_pmc_writel(*wordaddr, pmcaddr); - } - - /* Method to program a counter to monitor an event */ --static int mlxbf_pmc_program_counter(int blk_num, uint32_t cnt_num, -- uint32_t evt, bool is_l3) -+int mlxbf_program_counter(int blk_num, uint32_t cnt_num, uint32_t evt, -+ bool is_l3) - { - uint64_t perfctl, perfevt, perfmon_cfg; - -@@ -716,76 +388,73 @@ static int mlxbf_pmc_program_counter(int blk_num, uint32_t cnt_num, - return -ENODEV; - - if (is_l3) -- return mlxbf_pmc_program_l3_counter(blk_num, cnt_num, evt); -+ return mlxbf_program_l3_counter(blk_num, cnt_num, evt); - - /* Configure the counter */ -- perfctl = FIELD_PREP(MLXBF_PMC_PERFCTL_EN0, 1); -- perfctl |= FIELD_PREP(MLXBF_PMC_PERFCTL_EB0, 0); -- perfctl |= FIELD_PREP(MLXBF_PMC_PERFCTL_ETRIG0, 1); -- perfctl |= FIELD_PREP(MLXBF_PMC_PERFCTL_AD0, 0); -- perfctl |= FIELD_PREP(MLXBF_PMC_PERFCTL_ACCM0, 0); -- perfctl |= FIELD_PREP(MLXBF_PMC_PERFCTL_MS0, 0); -- perfctl |= FIELD_PREP(MLXBF_PMC_PERFCTL_FM0, 0); -- -- perfmon_cfg = FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_WDATA, perfctl); -- perfmon_cfg |= FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_ADDR, -- MLXBF_PMC_PERFCTL); -- perfmon_cfg |= FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_STROBE, 1); -- perfmon_cfg |= FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_WR_R_B, 1); -- -- if (mlxbf_pmc_write(pmc->block[blk_num].mmio_base + -- cnt_num * MLXBF_PMC_REG_SIZE, -- MLXBF_PMC_WRITE_REG_64, perfmon_cfg)) -+ perfctl = 0; -+ perfctl |= FIELD_PREP(MLXBF_GEN_PERFCTL__EN0, 1); -+ perfctl |= FIELD_PREP(MLXBF_GEN_PERFCTL__EB0, 0); -+ perfctl |= FIELD_PREP(MLXBF_GEN_PERFCTL__ETRIG0, 1); -+ perfctl |= FIELD_PREP(MLXBF_GEN_PERFCTL__AD0, 0); -+ perfctl |= FIELD_PREP(MLXBF_GEN_PERFCTL__ACCM0, 0); -+ perfctl |= FIELD_PREP(MLXBF_GEN_PERFCTL__MS0, 0); -+ perfctl |= FIELD_PREP(MLXBF_GEN_PERFCTL__FM0, 0); -+ -+ perfmon_cfg = 0; -+ perfmon_cfg |= FIELD_PREP(MLXBF_GEN_PERFMON_CONFIG__WDATA, perfctl); -+ perfmon_cfg |= FIELD_PREP(MLXBF_GEN_PERFMON_CONFIG__ADDR, -+ MLXBF_PERFCTL); -+ perfmon_cfg |= FIELD_PREP(MLXBF_GEN_PERFMON_CONFIG__STROBE, 1); -+ perfmon_cfg |= FIELD_PREP(MLXBF_GEN_PERFMON_CONFIG__WR_R_B, 1); -+ -+ if (mlxbf_pmc_writeq(perfmon_cfg, -+ pmc->block[blk_num].mmio_base + cnt_num * 8)) - return -EFAULT; - - /* Select the event */ -- perfevt = FIELD_PREP(MLXBF_PMC_PERFEVT_EVTSEL, evt); -- -- perfmon_cfg = FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_WDATA, perfevt); -- perfmon_cfg |= FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_ADDR, -- MLXBF_PMC_PERFEVT); -- perfmon_cfg |= FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_STROBE, 1); -- perfmon_cfg |= FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_WR_R_B, 1); -- -- if (mlxbf_pmc_write(pmc->block[blk_num].mmio_base + -- cnt_num * MLXBF_PMC_REG_SIZE, -- MLXBF_PMC_WRITE_REG_64, perfmon_cfg)) -+ perfevt = 0; -+ perfevt |= FIELD_PREP(MLXBF_GEN_PERFEVT__EVTSEL, evt); -+ -+ perfmon_cfg = 0; -+ perfmon_cfg |= FIELD_PREP(MLXBF_GEN_PERFMON_CONFIG__WDATA, perfevt); -+ perfmon_cfg |= FIELD_PREP(MLXBF_GEN_PERFMON_CONFIG__ADDR, -+ MLXBF_PERFEVT); -+ perfmon_cfg |= FIELD_PREP(MLXBF_GEN_PERFMON_CONFIG__STROBE, 1); -+ perfmon_cfg |= FIELD_PREP(MLXBF_GEN_PERFMON_CONFIG__WR_R_B, 1); -+ -+ if (mlxbf_pmc_writeq(perfmon_cfg, -+ pmc->block[blk_num].mmio_base + cnt_num * 8)) - return -EFAULT; - - /* Clear the accumulator */ -- perfmon_cfg = FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_ADDR, -- MLXBF_PMC_PERFACC0); -- perfmon_cfg |= FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_STROBE, 1); -- perfmon_cfg |= FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_WR_R_B, 1); -- -- if (mlxbf_pmc_write(pmc->block[blk_num].mmio_base + -- cnt_num * MLXBF_PMC_REG_SIZE, -- MLXBF_PMC_WRITE_REG_64, perfmon_cfg)) -+ perfmon_cfg = 0; -+ perfmon_cfg |= FIELD_PREP(MLXBF_GEN_PERFMON_CONFIG__ADDR, -+ MLXBF_PERFACC0); -+ perfmon_cfg |= FIELD_PREP(MLXBF_GEN_PERFMON_CONFIG__STROBE, 1); -+ perfmon_cfg |= FIELD_PREP(MLXBF_GEN_PERFMON_CONFIG__WR_R_B, 1); -+ -+ if (mlxbf_pmc_writeq(perfmon_cfg, pmc->block[blk_num].mmio_base -+ + cnt_num * 8)) - return -EFAULT; - - return 0; - } - - /* Method to handle l3 counter reads */ --static int mlxbf_pmc_read_l3_counter(int blk_num, uint32_t cnt_num, -- uint64_t *result) -+int mlxbf_read_l3_counter(int blk_num, uint32_t cnt_num, uint64_t *result) - { - uint32_t perfcnt_low = 0, perfcnt_high = 0; - uint64_t value; - int status = 0; - -- status = mlxbf_pmc_readl(pmc->block[blk_num].mmio_base + -- MLXBF_PMC_L3C_PERF_CNT_LOW + -- cnt_num * MLXBF_PMC_L3C_REG_SIZE, -- &perfcnt_low); -+ status = mlxbf_pmc_readl(&perfcnt_low, pmc->block[blk_num].mmio_base + -+ MLXBF_L3C_PERF_CNT_LOW + cnt_num * 4); - - if (status) - return status; - -- status = mlxbf_pmc_readl(pmc->block[blk_num].mmio_base + -- MLXBF_PMC_L3C_PERF_CNT_HIGH + -- cnt_num * MLXBF_PMC_L3C_REG_SIZE, -- &perfcnt_high); -+ status = mlxbf_pmc_readl(&perfcnt_high, pmc->block[blk_num].mmio_base + -+ MLXBF_L3C_PERF_CNT_HIGH + cnt_num * 4); - - if (status) - return status; -@@ -799,8 +468,8 @@ static int mlxbf_pmc_read_l3_counter(int blk_num, uint32_t cnt_num, - } - - /* Method to read the counter value */ --static int mlxbf_pmc_read_counter(int blk_num, uint32_t cnt_num, bool is_l3, -- uint64_t *result) -+int mlxbf_read_counter(int blk_num, uint32_t cnt_num, bool is_l3, -+ uint64_t *result) - { - uint32_t perfcfg_offset, perfval_offset; - uint64_t perfmon_cfg; -@@ -810,73 +479,74 @@ static int mlxbf_pmc_read_counter(int blk_num, uint32_t cnt_num, bool is_l3, - return -EINVAL; - - if (is_l3) -- return mlxbf_pmc_read_l3_counter(blk_num, cnt_num, result); -+ return mlxbf_read_l3_counter(blk_num, cnt_num, result); - -- perfcfg_offset = cnt_num * MLXBF_PMC_REG_SIZE; -- perfval_offset = perfcfg_offset + -- pmc->block[blk_num].counters * MLXBF_PMC_REG_SIZE; -+ perfcfg_offset = cnt_num * 8; -+ perfval_offset = perfcfg_offset + pmc->block[blk_num].counters * 8; - - /* Set counter in "read" mode */ -- perfmon_cfg = FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_ADDR, -- MLXBF_PMC_PERFACC0); -- perfmon_cfg |= FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_STROBE, 1); -- perfmon_cfg |= FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_WR_R_B, 0); -+ perfmon_cfg = 0; -+ perfmon_cfg |= FIELD_PREP(MLXBF_GEN_PERFMON_CONFIG__ADDR, -+ MLXBF_PERFACC0); -+ perfmon_cfg |= FIELD_PREP(MLXBF_GEN_PERFMON_CONFIG__STROBE, 1); -+ perfmon_cfg |= FIELD_PREP(MLXBF_GEN_PERFMON_CONFIG__WR_R_B, 0); - -- status = mlxbf_pmc_write(pmc->block[blk_num].mmio_base + perfcfg_offset, -- MLXBF_PMC_WRITE_REG_64, perfmon_cfg); -+ status = mlxbf_pmc_writeq(perfmon_cfg, pmc->block[blk_num].mmio_base + -+ perfcfg_offset); - - if (status) - return status; - - /* Get the counter value */ -- return mlxbf_pmc_read(pmc->block[blk_num].mmio_base + perfval_offset, -- MLXBF_PMC_READ_REG_64, result); -+ return mlxbf_pmc_readq(result, -+ pmc->block[blk_num].mmio_base + perfval_offset); - } - --/* Method to read L3 block event */ --static int mlxbf_pmc_read_l3_event(int blk_num, uint32_t cnt_num, -- uint64_t *result) -+int mlxbf_read_l3_event(int blk_num, uint32_t cnt_num, uint64_t *result) - { - uint32_t perfcnt_sel = 0, perfcnt_sel_1 = 0; - uint32_t *wordaddr; -- void __iomem *pmcaddr; -+ void *pmcaddr; - uint64_t evt; - - /* Select appropriate register information */ - switch (cnt_num) { -- case 0 ... 3: -+ case 0: -+ case 1: -+ case 2: -+ case 3: - pmcaddr = pmc->block[blk_num].mmio_base + -- MLXBF_PMC_L3C_PERF_CNT_SEL; -+ MLXBF_L3C_PERF_CNT_SEL; - wordaddr = &perfcnt_sel; - break; - case 4: - pmcaddr = pmc->block[blk_num].mmio_base + -- MLXBF_PMC_L3C_PERF_CNT_SEL_1; -+ MLXBF_L3C_PERF_CNT_SEL_1; - wordaddr = &perfcnt_sel_1; - break; - default: - return -EINVAL; - } - -- if (mlxbf_pmc_readl(pmcaddr, wordaddr)) -+ if (mlxbf_pmc_readl(wordaddr, pmcaddr)) - return -EINVAL; - - /* Read from appropriate register field for the counter */ - switch (cnt_num) { - case 0: -- evt = FIELD_GET(MLXBF_PMC_L3C_PERF_CNT_SEL_CNT_0, perfcnt_sel); -+ evt = FIELD_GET(MLXBF_L3C_PERF_CNT_SEL__CNT_0, perfcnt_sel); - break; - case 1: -- evt = FIELD_GET(MLXBF_PMC_L3C_PERF_CNT_SEL_CNT_1, perfcnt_sel); -+ evt = FIELD_GET(MLXBF_L3C_PERF_CNT_SEL__CNT_1, perfcnt_sel); - break; - case 2: -- evt = FIELD_GET(MLXBF_PMC_L3C_PERF_CNT_SEL_CNT_2, perfcnt_sel); -+ evt = FIELD_GET(MLXBF_L3C_PERF_CNT_SEL__CNT_2, perfcnt_sel); - break; - case 3: -- evt = FIELD_GET(MLXBF_PMC_L3C_PERF_CNT_SEL_CNT_3, perfcnt_sel); -+ evt = FIELD_GET(MLXBF_L3C_PERF_CNT_SEL__CNT_3, perfcnt_sel); - break; - case 4: -- evt = FIELD_GET(MLXBF_PMC_L3C_PERF_CNT_SEL_1_CNT_4, -+ evt = FIELD_GET(MLXBF_L3C_PERF_CNT_SEL_1__CNT_4, - perfcnt_sel_1); - break; - default: -@@ -888,8 +558,8 @@ static int mlxbf_pmc_read_l3_event(int blk_num, uint32_t cnt_num, - } - - /* Method to find the event currently being monitored by a counter */ --static int mlxbf_pmc_read_event(int blk_num, uint32_t cnt_num, bool is_l3, -- uint64_t *result) -+int mlxbf_read_event(int blk_num, uint32_t cnt_num, bool is_l3, -+ uint64_t *result) - { - uint32_t perfcfg_offset, perfval_offset; - uint64_t perfmon_cfg, perfevt, perfctl; -@@ -898,112 +568,115 @@ static int mlxbf_pmc_read_event(int blk_num, uint32_t cnt_num, bool is_l3, - return -EINVAL; - - if (is_l3) -- return mlxbf_pmc_read_l3_event(blk_num, cnt_num, result); -+ return mlxbf_read_l3_event(blk_num, cnt_num, result); - -- perfcfg_offset = cnt_num * MLXBF_PMC_REG_SIZE; -- perfval_offset = perfcfg_offset + -- pmc->block[blk_num].counters * MLXBF_PMC_REG_SIZE; -+ perfcfg_offset = cnt_num * 8; -+ perfval_offset = perfcfg_offset + pmc->block[blk_num].counters * 8; - - /* Set counter in "read" mode */ -- perfmon_cfg = FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_ADDR, -- MLXBF_PMC_PERFCTL); -- perfmon_cfg |= FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_STROBE, 1); -- perfmon_cfg |= FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_WR_R_B, 0); -- -- if (mlxbf_pmc_write(pmc->block[blk_num].mmio_base + perfcfg_offset, -- MLXBF_PMC_WRITE_REG_64, perfmon_cfg)) -+ perfmon_cfg = 0; -+ perfmon_cfg |= FIELD_PREP(MLXBF_GEN_PERFMON_CONFIG__ADDR, -+ MLXBF_PERFCTL); -+ perfmon_cfg |= FIELD_PREP(MLXBF_GEN_PERFMON_CONFIG__STROBE, 1); -+ perfmon_cfg |= FIELD_PREP(MLXBF_GEN_PERFMON_CONFIG__WR_R_B, 0); -+ -+ if (mlxbf_pmc_writeq(perfmon_cfg, -+ pmc->block[blk_num].mmio_base + perfcfg_offset)) - return -EFAULT; - - /* Check if the counter is enabled */ - -- if (mlxbf_pmc_read(pmc->block[blk_num].mmio_base + perfval_offset, -- MLXBF_PMC_READ_REG_64, &perfctl)) -+ if (mlxbf_pmc_readq(&perfctl, -+ pmc->block[blk_num].mmio_base + perfval_offset)) - return -EFAULT; - -- if (!FIELD_GET(MLXBF_PMC_PERFCTL_EN0, perfctl)) -+ if (FIELD_GET(MLXBF_GEN_PERFCTL__EN0, perfctl) == 0) - return -EINVAL; - - /* Set counter in "read" mode */ -- perfmon_cfg = FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_ADDR, -- MLXBF_PMC_PERFEVT); -- perfmon_cfg |= FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_STROBE, 1); -- perfmon_cfg |= FIELD_PREP(MLXBF_PMC_PERFMON_CONFIG_WR_R_B, 0); -- -- if (mlxbf_pmc_write(pmc->block[blk_num].mmio_base + perfcfg_offset, -- MLXBF_PMC_WRITE_REG_64, perfmon_cfg)) -+ perfmon_cfg = 0; -+ perfmon_cfg |= FIELD_PREP(MLXBF_GEN_PERFMON_CONFIG__ADDR, -+ MLXBF_PERFEVT); -+ perfmon_cfg |= FIELD_PREP(MLXBF_GEN_PERFMON_CONFIG__STROBE, 1); -+ perfmon_cfg |= FIELD_PREP(MLXBF_GEN_PERFMON_CONFIG__WR_R_B, 0); -+ -+ if (mlxbf_pmc_writeq(perfmon_cfg, pmc->block[blk_num].mmio_base + -+ perfcfg_offset)) - return -EFAULT; - - /* Get the event number */ -- if (mlxbf_pmc_read(pmc->block[blk_num].mmio_base + perfval_offset, -- MLXBF_PMC_READ_REG_64, &perfevt)) -+ if (mlxbf_pmc_readq(&perfevt, pmc->block[blk_num].mmio_base + -+ perfval_offset)) - return -EFAULT; - -- *result = FIELD_GET(MLXBF_PMC_PERFEVT_EVTSEL, perfevt); -+ *result = FIELD_GET(MLXBF_GEN_PERFEVT__EVTSEL, perfevt); - - return 0; - } - - /* Method to read a register */ --static int mlxbf_pmc_read_reg(int blk_num, uint32_t offset, uint64_t *result) -+int mlxbf_read_reg(int blk_num, uint32_t offset, uint64_t *result) - { - uint32_t ecc_out; - - if (strstr(pmc->block_name[blk_num], "ecc")) { -- if (mlxbf_pmc_readl(pmc->block[blk_num].mmio_base + offset, -- &ecc_out)) -+ if (mlxbf_pmc_readl(&ecc_out, -+ pmc->block[blk_num].mmio_base + offset)) - return -EFAULT; - -- *result = ecc_out; -+ *result = (uint64_t) ecc_out; - return 0; - } - - if (mlxbf_pmc_valid_range(blk_num, offset)) -- return mlxbf_pmc_read(pmc->block[blk_num].mmio_base + offset, -- MLXBF_PMC_READ_REG_64, result); -+ return mlxbf_pmc_readq(result, -+ pmc->block[blk_num].mmio_base + offset); - - return -EINVAL; - } - - /* Method to write to a register */ --static int mlxbf_pmc_write_reg(int blk_num, uint32_t offset, uint64_t data) -+int mlxbf_write_reg(int blk_num, uint32_t offset, uint64_t data) - { - if (strstr(pmc->block_name[blk_num], "ecc")) { -- return mlxbf_pmc_write(pmc->block[blk_num].mmio_base + offset, -- MLXBF_PMC_WRITE_REG_32, data); -+ return mlxbf_pmc_writel((uint32_t)data, -+ pmc->block[blk_num].mmio_base + offset); - } - - if (mlxbf_pmc_valid_range(blk_num, offset)) -- return mlxbf_pmc_write(pmc->block[blk_num].mmio_base + offset, -- MLXBF_PMC_WRITE_REG_64, data); -+ return mlxbf_pmc_writeq(data, -+ pmc->block[blk_num].mmio_base + offset); - - return -EINVAL; - } - - /* Show function for "counter" sysfs files */ --static ssize_t mlxbf_pmc_counter_show(struct device *dev, -- struct device_attribute *attr, char *buf) -+static ssize_t mlxbf_counter_read(struct kobject *ko, -+ struct kobj_attribute *attr, char *buf) - { -- struct mlxbf_pmc_attribute *attr_counter = container_of( -- attr, struct mlxbf_pmc_attribute, dev_attr); -- int blk_num, cnt_num, offset; -+ int blk_num, cnt_num, offset, err; - bool is_l3 = false; - uint64_t value; - -- blk_num = attr_counter->nr; -- cnt_num = attr_counter->index; -+ blk_num = mlxbf_pmc_get_block_num(ko->name); -+ if (blk_num < 0) -+ return -EINVAL; - -- if (strstr(pmc->block_name[blk_num], "l3cache")) -+ if (strstr(ko->name, "l3cache")) - is_l3 = true; - -- if (pmc->block[blk_num].type == MLXBF_PMC_TYPE_COUNTER) { -- if (mlxbf_pmc_read_counter(blk_num, cnt_num, is_l3, &value)) -+ if (pmc->block[blk_num].type == MLXBF_PERFTYPE_COUNTER) { -+ err = sscanf(attr->attr.name, "counter%d", &cnt_num); -+ if (err < 0) -+ return -EINVAL; -+ if (mlxbf_read_counter(blk_num, cnt_num, is_l3, &value)) - return -EINVAL; -- } else if (pmc->block[blk_num].type == MLXBF_PMC_TYPE_REGISTER) { -- offset = mlxbf_pmc_get_event_num(pmc->block_name[blk_num], -- attr->attr.name); -+ } else if (pmc->block[blk_num].type == MLXBF_PERFTYPE_REGISTER) { -+ offset = mlxbf_pmc_get_event_num((char *)ko->name, -+ (char *)attr->attr.name); - if (offset < 0) - return -EINVAL; -- if (mlxbf_pmc_read_reg(blk_num, offset, &value)) -+ if (mlxbf_read_reg(blk_num, offset, &value)) - return -EINVAL; - } else - return -EINVAL; -@@ -1012,47 +685,47 @@ static ssize_t mlxbf_pmc_counter_show(struct device *dev, - } - - /* Store function for "counter" sysfs files */ --static ssize_t mlxbf_pmc_counter_store(struct device *dev, -- struct device_attribute *attr, -- const char *buf, size_t count) -+static ssize_t mlxbf_counter_clear(struct kobject *ko, -+ struct kobj_attribute *attr, -+ const char *buf, size_t count) - { -- struct mlxbf_pmc_attribute *attr_counter = container_of( -- attr, struct mlxbf_pmc_attribute, dev_attr); - int blk_num, cnt_num, offset, err, data; - bool is_l3 = false; - uint64_t evt_num; - -- blk_num = attr_counter->nr; -- cnt_num = attr_counter->index; -+ blk_num = mlxbf_pmc_get_block_num(ko->name); -+ if (blk_num < 0) -+ return -EINVAL; - -- err = kstrtoint(buf, 0, &data); -+ err = sscanf(buf, "%x\n", &data); - if (err < 0) -- return err; -+ return -EINVAL; - - /* Allow non-zero writes only to the ecc regs */ -- if (!(strstr(pmc->block_name[blk_num], "ecc")) && data) -+ if (!(strstr(ko->name, "ecc")) && (data != 0)) - return -EINVAL; - -- /* Do not allow writes to the L3C regs */ -- if (strstr(pmc->block_name[blk_num], "l3cache")) -+ if (strstr(ko->name, "l3cache")) - return -EINVAL; - -- if (pmc->block[blk_num].type == MLXBF_PMC_TYPE_COUNTER) { -- err = mlxbf_pmc_read_event(blk_num, cnt_num, is_l3, &evt_num); -- if (err) -- return err; -- err = mlxbf_pmc_program_counter(blk_num, cnt_num, evt_num, -- is_l3); -- if (err) -- return err; -- } else if (pmc->block[blk_num].type == MLXBF_PMC_TYPE_REGISTER) { -- offset = mlxbf_pmc_get_event_num(pmc->block_name[blk_num], -- attr->attr.name); -+ if (pmc->block[blk_num].type == MLXBF_PERFTYPE_COUNTER) { -+ err = sscanf(attr->attr.name, "counter%d", &cnt_num); -+ if (err < 0) -+ return -EINVAL; -+ err = mlxbf_read_event(blk_num, cnt_num, is_l3, &evt_num); -+ if (err < 0) -+ return -EINVAL; -+ err = mlxbf_program_counter(blk_num, cnt_num, evt_num, is_l3); -+ if (err < 0) -+ return -EINVAL; -+ } else if (pmc->block[blk_num].type == MLXBF_PERFTYPE_REGISTER) { -+ offset = mlxbf_pmc_get_event_num((char *)ko->name, -+ (char *)attr->attr.name); - if (offset < 0) - return -EINVAL; -- err = mlxbf_pmc_write_reg(blk_num, offset, data); -- if (err) -- return err; -+ err = mlxbf_write_reg(blk_num, offset, data); -+ if (err < 0) -+ return -EINVAL; - } else - return -EINVAL; - -@@ -1060,141 +733,140 @@ static ssize_t mlxbf_pmc_counter_store(struct device *dev, - } - - /* Show function for "event" sysfs files */ --static ssize_t mlxbf_pmc_event_show(struct device *dev, -- struct device_attribute *attr, char *buf) -+static ssize_t mlxbf_event_find(struct kobject *ko, -+ struct kobj_attribute *attr, char *buf) - { -- struct mlxbf_pmc_attribute *attr_event = container_of( -- attr, struct mlxbf_pmc_attribute, dev_attr); - int blk_num, cnt_num, err; - bool is_l3 = false; - uint64_t evt_num; - char *evt_name; - -- blk_num = attr_event->nr; -- cnt_num = attr_event->index; -+ blk_num = mlxbf_pmc_get_block_num(ko->name); -+ if (blk_num < 0) -+ return -EINVAL; - -- if (strstr(pmc->block_name[blk_num], "l3cache")) -+ if (strstr(ko->name, "l3cache")) - is_l3 = true; - -- err = mlxbf_pmc_read_event(blk_num, cnt_num, is_l3, &evt_num); -- if (err) -- return sprintf(buf, "No event being monitored\n"); -+ err = sscanf(attr->attr.name, "event%d", &cnt_num); -+ if (err < 0) -+ return -EINVAL; - -- evt_name = mlxbf_pmc_get_event_name(pmc->block_name[blk_num], evt_num); -- if (!evt_name) -+ err = mlxbf_read_event(blk_num, cnt_num, is_l3, &evt_num); -+ if (err < 0) - return -EINVAL; - -+ evt_name = mlxbf_pmc_get_event_name((char *)ko->name, evt_num); -+ - return sprintf(buf, "0x%llx: %s\n", evt_num, evt_name); - } - - /* Store function for "event" sysfs files */ --static ssize_t mlxbf_pmc_event_store(struct device *dev, -- struct device_attribute *attr, -- const char *buf, size_t count) -+static ssize_t mlxbf_event_set(struct kobject *ko, struct kobj_attribute *attr, -+ const char *buf, size_t count) - { -- struct mlxbf_pmc_attribute *attr_event = container_of( -- attr, struct mlxbf_pmc_attribute, dev_attr); - int blk_num, cnt_num, evt_num, err; - bool is_l3 = false; - -- blk_num = attr_event->nr; -- cnt_num = attr_event->index; -- - if (isalpha(buf[0])) { -- evt_num = mlxbf_pmc_get_event_num(pmc->block_name[blk_num], -- buf); -+ evt_num = mlxbf_pmc_get_event_num((char *)ko->name, -+ (char *)buf); - if (evt_num < 0) - return -EINVAL; - } else { -- err = kstrtoint(buf, 0, &evt_num); -+ err = sscanf(buf, "%x\n", &evt_num); - if (err < 0) -- return err; -+ return -EINVAL; - } - -- if (strstr(pmc->block_name[blk_num], "l3cache")) -+ blk_num = mlxbf_pmc_get_block_num(ko->name); -+ if (blk_num < 0) -+ return -EINVAL; -+ -+ err = sscanf(attr->attr.name, "event%d", &cnt_num); -+ if (err < 0) -+ return -EINVAL; -+ -+ if (strstr(ko->name, "l3cache")) - is_l3 = true; - -- err = mlxbf_pmc_program_counter(blk_num, cnt_num, evt_num, is_l3); -- if (err) -- return err; -+ err = mlxbf_program_counter(blk_num, cnt_num, evt_num, is_l3); -+ if (err < 0) -+ return -EINVAL; - - return count; - } - - /* Show function for "event_list" sysfs files */ --static ssize_t mlxbf_pmc_event_list_show(struct device *dev, -- struct device_attribute *attr, -- char *buf) -+static ssize_t mlxbf_print_event_list(struct kobject *ko, -+ struct kobj_attribute *attr, char *buf) - { -- struct mlxbf_pmc_attribute *attr_event_list = container_of( -- attr, struct mlxbf_pmc_attribute, dev_attr); -- int blk_num, i, size, len = 0, ret = 0; -- const struct mlxbf_pmc_events *events; -- char e_info[MLXBF_PMC_EVENT_INFO_LEN]; -- -- blk_num = attr_event_list->nr; -+ struct mlxbf_pmc_events *events; -+ int i = 0, size = 0, ret = 0; -+ char e_info[100]; - -- events = mlxbf_pmc_event_list(pmc->block_name[blk_num], &size); -- if (!events) -+ events = mlxbf_pmc_event_list((char *)ko->name); -+ if (events == NULL) - return -EINVAL; - -- for (i = 0, buf[0] = '\0'; i < size; ++i) { -- len += sprintf(e_info, "0x%x: %s\n", events[i].evt_num, -- events[i].evt_name); -- if (len > PAGE_SIZE) -+ buf[0] = '\0'; -+ while (events[i].evt_name != NULL) { -+ size += sprintf(e_info, "%x: %s\n", events[i].evt_num, -+ events[i].evt_name); -+ if (size > PAGE_SIZE) - break; - strcat(buf, e_info); -- ret = len; -+ ret = size; -+ ++i; - } - - return ret; - } - - /* Show function for "enable" sysfs files - only for l3cache */ --static ssize_t mlxbf_pmc_enable_show(struct device *dev, -- struct device_attribute *attr, char *buf) -+static ssize_t mlxbf_show_counter_state(struct kobject *ko, -+ struct kobj_attribute *attr, char *buf) - { -- struct mlxbf_pmc_attribute *attr_enable = container_of( -- attr, struct mlxbf_pmc_attribute, dev_attr); - uint32_t perfcnt_cfg; - int blk_num, value; - -- blk_num = attr_enable->nr; -+ blk_num = mlxbf_pmc_get_block_num(ko->name); -+ if (blk_num < 0) -+ return -EINVAL; - -- if (mlxbf_pmc_readl(pmc->block[blk_num].mmio_base + -- MLXBF_PMC_L3C_PERF_CNT_CFG, -- &perfcnt_cfg)) -+ if (mlxbf_pmc_readl(&perfcnt_cfg, -+ pmc->block[blk_num].mmio_base + MLXBF_L3C_PERF_CNT_CFG)) - return -EINVAL; - -- value = FIELD_GET(MLXBF_PMC_L3C_PERF_CNT_CFG_EN, perfcnt_cfg); -+ value = FIELD_GET(MLXBF_L3C_PERF_CNT_CFG__EN, perfcnt_cfg); - - return sprintf(buf, "%d\n", value); - } - - /* Store function for "enable" sysfs files - only for l3cache */ --static ssize_t mlxbf_pmc_enable_store(struct device *dev, -- struct device_attribute *attr, -- const char *buf, size_t count) -+static ssize_t mlxbf_enable_counters(struct kobject *ko, -+ struct kobj_attribute *attr, -+ const char *buf, size_t count) - { -- struct mlxbf_pmc_attribute *attr_enable = container_of( -- attr, struct mlxbf_pmc_attribute, dev_attr); - int err, en, blk_num; - -- blk_num = attr_enable->nr; -+ blk_num = mlxbf_pmc_get_block_num(ko->name); -+ if (blk_num < 0) -+ return -EINVAL; - -- err = kstrtoint(buf, 0, &en); -+ err = sscanf(buf, "%x\n", &en); - if (err < 0) - return err; - -- if (!en) { -- err = mlxbf_pmc_config_l3_counters(blk_num, false, false); -+ if (en == 0) { -+ err = mlxbf_config_l3_counters(blk_num, false, false); - if (err) - return err; - } else if (en == 1) { -- err = mlxbf_pmc_config_l3_counters(blk_num, false, true); -+ err = mlxbf_config_l3_counters(blk_num, false, true); - if (err) - return err; -- err = mlxbf_pmc_config_l3_counters(blk_num, true, false); -+ err = mlxbf_config_l3_counters(blk_num, true, false); - if (err) - return err; - } else -@@ -1203,277 +875,379 @@ static ssize_t mlxbf_pmc_enable_store(struct device *dev, - return count; - } - --/* Populate attributes for blocks with counters to monitor performance */ --static int mlxbf_pmc_init_perftype_counter(struct device *dev, int blk_num) -+/* Helper to create the bfperf sysfs sub-directories and files */ -+int mlxbf_pmc_create_sysfs(struct device *dev, struct kobject *ko, int blk_num) - { -- struct mlxbf_pmc_attribute *attr; -- int i = 0, j = 0; -- -- /* "event_list" sysfs to list events supported by the block */ -- attr = &pmc->block[blk_num].attr_event_list; -- attr->dev_attr.attr.mode = 0444; -- attr->dev_attr.show = mlxbf_pmc_event_list_show; -- attr->nr = blk_num; -- attr->dev_attr.attr.name = devm_kasprintf(dev, GFP_KERNEL, "event_list"); -- pmc->block[blk_num].block_attr[i] = &attr->dev_attr.attr; -- attr = NULL; -- -- /* "enable" sysfs to start/stop the counters. Only in L3C blocks */ -- if (strstr(pmc->block_name[blk_num], "l3cache")) { -- attr = &pmc->block[blk_num].attr_enable; -- attr->dev_attr.attr.mode = 0644; -- attr->dev_attr.show = mlxbf_pmc_enable_show; -- attr->dev_attr.store = mlxbf_pmc_enable_store; -- attr->nr = blk_num; -- attr->dev_attr.attr.name = devm_kasprintf(dev, GFP_KERNEL, -- "enable"); -- pmc->block[blk_num].block_attr[++i] = &attr->dev_attr.attr; -- attr = NULL; -+ int err = 0, j = 0; -+ -+ pmc->block[blk_num].block_dir = -+ kobject_create_and_add(pmc->block_name[blk_num], ko); -+ if (pmc->block[blk_num].block_dir == NULL) { -+ dev_err(dev, -+ "PMC: Error creating subdirectories\n"); -+ return -EFAULT; - } - -- pmc->block[blk_num].attr_counter = devm_kcalloc( -- dev, pmc->block[blk_num].counters, -- sizeof(struct mlxbf_pmc_attribute), GFP_KERNEL); -- if (!pmc->block[blk_num].attr_counter) -- return -ENOMEM; -+ if (pmc->block[blk_num].type == MLXBF_PERFTYPE_COUNTER) { -+ pmc->block[blk_num].attr_event_list.attr.mode = 0444; -+ pmc->block[blk_num].attr_event_list.show = -+ mlxbf_print_event_list; -+ pmc->block[blk_num].attr_event_list.attr.name = -+ kzalloc(20, GFP_KERNEL); -+ snprintf((char *)pmc->block[blk_num].attr_event_list.attr.name, -+ 20, "event_list"); -+ -+ err = sysfs_create_file(pmc->block[blk_num].block_dir, -+ &pmc->block[blk_num].attr_event_list.attr); -+ if (err < 0) { -+ dev_err(dev, -+ "PMC: Error creating sysfs entries\n"); -+ return err; -+ } - -- pmc->block[blk_num].attr_event = devm_kcalloc( -- dev, pmc->block[blk_num].counters, -- sizeof(struct mlxbf_pmc_attribute), GFP_KERNEL); -- if (!pmc->block[blk_num].attr_event) -- return -ENOMEM; -+ if (strstr(pmc->block_name[blk_num], "l3cache")) { -+ pmc->block[blk_num].attr_enable.attr.mode = -+ 0644; -+ pmc->block[blk_num].attr_enable.show = -+ mlxbf_show_counter_state; -+ pmc->block[blk_num].attr_enable.store = -+ mlxbf_enable_counters; -+ pmc->block[blk_num].attr_enable.attr.name = -+ kzalloc(20, GFP_KERNEL); -+ snprintf((char *) -+ pmc->block[blk_num].attr_enable.attr.name, -+ 20, "enable"); -+ -+ err = sysfs_create_file( -+ pmc->block[blk_num].block_dir, -+ &pmc->block[blk_num].attr_enable.attr); -+ if (err < 0) { -+ dev_err(dev, -+ "PMC: Error creating sysfs entries\n"); -+ return err; -+ } - -- /* "eventX" and "counterX" sysfs to program and read counter values */ -- for (j = 0; j < pmc->block[blk_num].counters; ++j) { -- attr = &pmc->block[blk_num].attr_counter[j]; -- attr->dev_attr.attr.mode = 0644; -- attr->dev_attr.show = mlxbf_pmc_counter_show; -- attr->dev_attr.store = mlxbf_pmc_counter_store; -- attr->index = j; -- attr->nr = blk_num; -- attr->dev_attr.attr.name = devm_kasprintf(dev, GFP_KERNEL, -- "counter%d", j); -- pmc->block[blk_num].block_attr[++i] = &attr->dev_attr.attr; -- attr = NULL; -- -- attr = &pmc->block[blk_num].attr_event[j]; -- attr->dev_attr.attr.mode = 0644; -- attr->dev_attr.show = mlxbf_pmc_event_show; -- attr->dev_attr.store = mlxbf_pmc_event_store; -- attr->index = j; -- attr->nr = blk_num; -- attr->dev_attr.attr.name = devm_kasprintf(dev, GFP_KERNEL, -- "event%d", j); -- pmc->block[blk_num].block_attr[++i] = &attr->dev_attr.attr; -- attr = NULL; -- } -+ } - -- return 0; -+ pmc->block[blk_num].attr_counter = -+ kcalloc(pmc->block[blk_num].counters, -+ sizeof(struct kobj_attribute), GFP_KERNEL); -+ if (!pmc->block[blk_num].attr_counter) -+ return -ENOMEM; -+ pmc->block[blk_num].attr_event = -+ kcalloc(pmc->block[blk_num].counters, -+ sizeof(struct kobj_attribute), GFP_KERNEL); -+ if (!pmc->block[blk_num].attr_event) -+ return -ENOMEM; -+ pmc->block[blk_num].sysfs_event_cnt = -+ pmc->block[blk_num].counters; -+ -+ for (j = 0; j < pmc->block[blk_num].counters; ++j) { -+ pmc->block[blk_num].attr_counter[j].attr.mode = 0644; -+ pmc->block[blk_num].attr_counter[j].show = -+ mlxbf_counter_read; -+ pmc->block[blk_num].attr_counter[j].store = -+ mlxbf_counter_clear; -+ pmc->block[blk_num].attr_counter[j].attr.name = -+ kzalloc(20, GFP_KERNEL); -+ snprintf((char *) -+ pmc->block[blk_num].attr_counter[j].attr.name, -+ 20, "counter%d", j); -+ -+ err = sysfs_create_file( -+ pmc->block[blk_num].block_dir, -+ &pmc->block[blk_num].attr_counter[j].attr); -+ if (err < 0) { -+ dev_err(dev, -+ "PMC: Error creating sysfs entries\n"); -+ return err; -+ } -+ -+ pmc->block[blk_num].attr_event[j].attr.mode = 0644; -+ pmc->block[blk_num].attr_event[j].show = -+ mlxbf_event_find; -+ pmc->block[blk_num].attr_event[j].store = -+ mlxbf_event_set; -+ pmc->block[blk_num].attr_event[j].attr.name = -+ kzalloc(20, GFP_KERNEL); -+ snprintf((char *) -+ pmc->block[blk_num].attr_event[j].attr.name, -+ 20, "event%d", j); -+ -+ err = sysfs_create_file( -+ pmc->block[blk_num].block_dir, -+ &pmc->block[blk_num].attr_event[j].attr); -+ if (err < 0) { -+ dev_err(dev, -+ "PMC: Error creating sysfs entries\n"); -+ return err; -+ } -+ } -+ } else if (pmc->block[blk_num].type == MLXBF_PERFTYPE_REGISTER) { -+ struct mlxbf_pmc_events *events; -+ -+ events = mlxbf_pmc_event_list((char *)pmc->block_name[blk_num]); -+ if (events == NULL) -+ return -EINVAL; -+ -+ while (events[j].evt_name != NULL) -+ ++j; -+ -+ pmc->block[blk_num].sysfs_event_cnt = j; -+ pmc->block[blk_num].attr_event = -+ kcalloc(j, sizeof(struct kobj_attribute), GFP_KERNEL); -+ if (!pmc->block[blk_num].attr_event) -+ return -ENOMEM; -+ -+ while (j > 0) { -+ --j; -+ pmc->block[blk_num].attr_event[j].attr.mode = 0644; -+ pmc->block[blk_num].attr_event[j].show = -+ mlxbf_counter_read; -+ pmc->block[blk_num].attr_event[j].store = -+ mlxbf_counter_clear; -+ pmc->block[blk_num].attr_event[j].attr.name = -+ kzalloc(30, GFP_KERNEL); -+ strcpy((char *) -+ pmc->block[blk_num].attr_event[j].attr.name, -+ events[j].evt_name); -+ -+ err = sysfs_create_file( -+ pmc->block[blk_num].block_dir, -+ &pmc->block[blk_num].attr_event[j].attr); -+ if (err < 0) { -+ dev_err(dev, -+ "PMC: Error creating sysfs entries\n"); -+ return err; -+ } -+ } -+ } else -+ err = -EINVAL; -+ -+ return err; - } - --/* Populate attributes for blocks with registers to monitor performance */ --static int mlxbf_pmc_init_perftype_reg(struct device *dev, int blk_num) -+void mlxbf_pmc_delete(void) - { -- struct mlxbf_pmc_attribute *attr; -- const struct mlxbf_pmc_events *events; -- int i = 0, j = 0; -+ hwmon_device_unregister(pmc->hwmon_dev); -+ kfree(pmc); -+} - -- events = mlxbf_pmc_event_list(pmc->block_name[blk_num], &j); -- if (!events) -- return -EINVAL; -+static int mlxbf_pmc_probe(struct platform_device *pdev) -+{ -+ struct acpi_device *acpi_dev = ACPI_COMPANION(&pdev->dev); -+ const char *hid = acpi_device_hid(acpi_dev); -+ int i, version, err = 0, ret = 0; -+ struct device *dev = &pdev->dev; -+ struct arm_smccc_res res; -+ uint64_t info[4]; - -- pmc->block[blk_num].attr_event = devm_kcalloc( -- dev, j, sizeof(struct mlxbf_pmc_attribute), GFP_KERNEL); -- if (!pmc->block[blk_num].attr_event) -+ /* -+ * Ensure we have the UUID we expect for the Mellanox service. -+ */ -+ arm_smccc_smc(MLNX_SIP_SVC_UID, 0, 0, 0, 0, 0, 0, 0, &res); -+ if (res.a0 != 0x89c036b4 || res.a1 != 0x11e6e7d7 || -+ res.a2 != 0x1a009787 || res.a3 != 0xc4bf00ca) -+ return -ENODEV; -+ -+ pmc = kzalloc(sizeof(struct mlxbf_pmc_context), GFP_KERNEL); -+ if (!pmc) - return -ENOMEM; - -- while (j > 0) { -- --j; -- attr = &pmc->block[blk_num].attr_event[j]; -- attr->dev_attr.attr.mode = 0644; -- attr->dev_attr.show = mlxbf_pmc_counter_show; -- attr->dev_attr.store = mlxbf_pmc_counter_store; -- attr->nr = blk_num; -- attr->dev_attr.attr.name = devm_kasprintf(dev, GFP_KERNEL, -- events[j].evt_name); -- pmc->block[blk_num].block_attr[i] = &attr->dev_attr.attr; -- attr = NULL; -- i++; -- } -+ platform_set_drvdata(pdev, pmc); -+ pmc->pdev = pdev; - -- return 0; --} -+ pmc->hwmon_dev = hwmon_device_register_with_info(dev, "bfperf", pmc, -+ NULL, NULL); -+ pmc->ko = &pmc->hwmon_dev->kobj; - --/* Helper to create the bfperf sysfs sub-directories and files */ --static int mlxbf_pmc_create_groups(struct device *dev, int blk_num) --{ -- int err; -+ /* -+ * ACPI indicates whether we use SMCs to access registers or not. -+ * If sreg_tbl_perf is not present, just assume we're not using SMCs. -+ */ -+ if (device_property_read_u32(dev, -+ "sec_reg_block", &pmc->sreg_tbl_perf)) { -+ pmc->svc_sreg_support = false; -+ } else { -+ /* -+ * Check service version to see if we actually do support the -+ * needed SMCs. If we have the calls we need, mark support for -+ * them in the pmc struct. -+ */ -+ arm_smccc_smc(MLNX_SIP_SVC_VERSION, 0, 0, 0, 0, 0, 0, 0, &res); -+ if (res.a0 == MLNX_PMC_SVC_REQ_MAJOR && -+ res.a1 >= MLNX_PMC_SVC_MIN_MINOR) -+ pmc->svc_sreg_support = true; -+ else { -+ dev_err(dev, "Required SMCs are not supported.\n"); - -- /* Populate attributes based on counter type */ -- if (pmc->block[blk_num].type == MLXBF_PMC_TYPE_COUNTER) -- err = mlxbf_pmc_init_perftype_counter(dev, blk_num); -- else if (pmc->block[blk_num].type == MLXBF_PMC_TYPE_REGISTER) -- err = mlxbf_pmc_init_perftype_reg(dev, blk_num); -- else -- err = -EINVAL; -+ err = -EINVAL; -+ goto error; -+ } -+ } - -- if (err) -- return err; -+ if (pmc->ko == NULL) { -+ dev_err(dev, "Sysfs creation failed\n"); -+ err = -EFAULT; -+ goto error; -+ } - -- /* Add a new attribute_group for the block */ -- pmc->block[blk_num].block_attr_grp.attrs = pmc->block[blk_num].block_attr; -- pmc->block[blk_num].block_attr_grp.name = devm_kasprintf( -- dev, GFP_KERNEL, pmc->block_name[blk_num]); -- pmc->groups[blk_num] = &pmc->block[blk_num].block_attr_grp; -+ if (device_property_read_u32(dev, "version", &version)) { -+ dev_err(dev, "Version Info not found\n"); -+ err = -EINVAL; -+ goto error; -+ } - -- return 0; --} -+ if (version != (int)DRIVER_VERSION) { -+ dev_err(dev, "Version Mismatch. Expected %d Returned %d\n", -+ (int)DRIVER_VERSION, version); -+ err = -EINVAL; -+ goto error; -+ } - --static bool mlxbf_pmc_guid_match(const guid_t *guid, -- const struct arm_smccc_res *res) --{ -- guid_t id = GUID_INIT(res->a0, res->a1, res->a1 >> 16, res->a2, -- res->a2 >> 8, res->a2 >> 16, res->a2 >> 24, -- res->a3, res->a3 >> 8, res->a3 >> 16, -- res->a3 >> 24); -+ if (strcmp(hid, "MLNXBFD0") == 0) -+ pmc->event_set = MLNX_EVENT_SET_BF1; -+ else if (strcmp(hid, "MLNXBFD1") == 0) -+ pmc->event_set = MLNX_EVENT_SET_BF2; -+ else { -+ dev_err(dev, "Invalid device ID %s\n", hid); -+ err = -ENODEV; -+ goto error; -+ } - -- return guid_equal(guid, &id); --} -+ if (device_property_read_u32(dev, "block_num", &pmc->total_blocks)) { -+ dev_err(dev, "Number of performance blocks undefined\n"); -+ err = -EINVAL; -+ goto error; -+ } - --/* Helper to map the Performance Counters from the varios blocks */ --static int mlxbf_pmc_map_counters(struct device *dev) --{ -- uint64_t info[MLXBF_PMC_INFO_SZ]; -- int i, tile_num, ret; -+ ret = device_property_read_string_array(dev, "block_name", -+ pmc->block_name, pmc->total_blocks); -+ if (ret != pmc->total_blocks) { -+ dev_err(dev, -+ "Block count mismatch. Expected %d Returned %d\n", -+ pmc->total_blocks, ret); -+ err = -EFAULT; -+ goto error; -+ } -+ -+ if (device_property_read_u32(dev, "tile_num", &pmc->tile_count)) { -+ dev_err(dev, "Number of tiles undefined\n"); -+ err = -EINVAL; -+ goto error; -+ } - -+ /* Map the Performance Counters from the varios blocks */ - for (i = 0; i < pmc->total_blocks; ++i) { - if (strstr(pmc->block_name[i], "tile")) { -- ret = sscanf(pmc->block_name[i], "tile%d", &tile_num); -- if (ret < 0) -- return ret; -+ int tile_num; - -+ ret = sscanf(pmc->block_name[i], "tile%d", &tile_num); -+ if (ret < 0) { -+ err = -EINVAL; -+ goto error; -+ } - if (tile_num >= pmc->tile_count) - continue; - } -- ret = device_property_read_u64_array(dev, pmc->block_name[i], -- info, MLXBF_PMC_INFO_SZ); -- if (ret) -- return ret; -+ err = device_property_read_u64_array(dev, pmc->block_name[i], -+ info, 4); -+ if (err) { -+ dev_err(dev, "Failed to find %s block info\n", -+ pmc->block_name[i]); -+ goto error; -+ } - - /* - * Do not remap if the proper SMC calls are supported, - * since the SMC calls expect physical addresses. - */ - if (pmc->svc_sreg_support) -- pmc->block[i].mmio_base = (void __iomem *)info[0]; -+ pmc->block[i].mmio_base = (void *)info[0]; - else -- pmc->block[i].mmio_base = -- devm_ioremap(dev, info[0], info[1]); -+ pmc->block[i].mmio_base = ioremap(info[0], info[1]); - - pmc->block[i].blk_size = info[1]; - pmc->block[i].counters = info[2]; - pmc->block[i].type = info[3]; - -- if (!pmc->block[i].mmio_base) -- return -ENOMEM; -+ if (IS_ERR(pmc->block[i].mmio_base)) { -+ dev_err(dev, "%s: ioremap failed base %llx err %p\n", -+ __func__, info[0], pmc->block[i].mmio_base); -+ err = PTR_ERR(pmc->block[i].mmio_base); -+ goto error; -+ } - -- ret = mlxbf_pmc_create_groups(dev, i); -- if (ret) -- return ret; -+ err = mlxbf_pmc_create_sysfs(dev, pmc->ko, i); - } - -+ dev_info(&pdev->dev, "v%d probed\n", (int)DRIVER_VERSION); - return 0; -+ -+error: -+ mlxbf_pmc_delete(); -+ return err; - } - --static int mlxbf_pmc_probe(struct platform_device *pdev) -+static int mlxbf_pmc_remove(struct platform_device *pdev) - { -- struct acpi_device *acpi_dev = ACPI_COMPANION(&pdev->dev); -- const char *hid = acpi_device_hid(acpi_dev); -- struct device *dev = &pdev->dev; -- struct arm_smccc_res res; -- guid_t guid; -- int ret; -- -- /* Ensure we have the UUID we expect for this service. */ -- arm_smccc_smc(MLXBF_PMC_SIP_SVC_UID, 0, 0, 0, 0, 0, 0, 0, &res); -- guid_parse(mlxbf_pmc_svc_uuid_str, &guid); -- if (!mlxbf_pmc_guid_match(&guid, &res)) -- return -ENODEV; -- -- pmc = devm_kzalloc(dev, sizeof(struct mlxbf_pmc_context), GFP_KERNEL); -- if (!pmc) -- return -ENOMEM; -- -- /* -- * ACPI indicates whether we use SMCs to access registers or not. -- * If sreg_tbl_perf is not present, just assume we're not using SMCs. -- */ -- ret = device_property_read_u32(dev, "sec_reg_block", -- &pmc->sreg_tbl_perf); -- if (ret) { -- pmc->svc_sreg_support = false; -- } else { -- /* -- * Check service version to see if we actually do support the -- * needed SMCs. If we have the calls we need, mark support for -- * them in the pmc struct. -- */ -- arm_smccc_smc(MLXBF_PMC_SIP_SVC_VERSION, 0, 0, 0, 0, 0, 0, 0, -- &res); -- if (res.a0 == MLXBF_PMC_SVC_REQ_MAJOR && -- res.a1 >= MLXBF_PMC_SVC_MIN_MINOR) -- pmc->svc_sreg_support = true; -- else -- return -EINVAL; -- } -+ struct mlxbf_pmc_context *pmc = platform_get_drvdata(pdev); -+ int i, j, err; - -- if (!strcmp(hid, "MLNXBFD0")) -- pmc->event_set = MLXBF_PMC_EVENT_SET_BF1; -- else if (!strcmp(hid, "MLNXBFD1")) -- pmc->event_set = MLXBF_PMC_EVENT_SET_BF2; -- else -- return -ENODEV; -- -- ret = device_property_read_u32(dev, "block_num", &pmc->total_blocks); -- if (ret) -- return ret; -- -- ret = device_property_read_string_array(dev, "block_name", -- pmc->block_name, -- pmc->total_blocks); -- if (ret != pmc->total_blocks) -- return -EFAULT; -+ for (i = 0; i < pmc->total_blocks; ++i) { -+ if (strstr(pmc->block_name[i], "tile")) { -+ int tile_num; - -- ret = device_property_read_u32(dev, "tile_num", &pmc->tile_count); -- if (ret) -- return ret; -+ err = sscanf(pmc->block_name[i], "tile%d", &tile_num); -+ if (err < 0) -+ return -EINVAL; -+ if (tile_num >= pmc->tile_count) -+ continue; -+ } -+ kfree(pmc->block[i].attr_event_list.attr.name); -+ if (pmc->block[i].type == MLXBF_PERFTYPE_COUNTER) { -+ for (j = 0; j < pmc->block[i].counters; ++j) { -+ kfree(pmc->block[i].attr_counter[j].attr.name); -+ kfree(pmc->block[i].attr_event[j].attr.name); -+ } -+ } else if (pmc->block[i].type == MLXBF_PERFTYPE_REGISTER) { -+ for (j = 0; j < pmc->block[i].sysfs_event_cnt; ++j) -+ kfree(pmc->block[i].attr_event[j].attr.name); -+ } - -- pmc->pdev = pdev; -+ /* Unmap if SMCs weren't used for access */ -+ if (pmc->block[i].mmio_base && !(pmc->svc_sreg_support)) -+ iounmap(pmc->block[i].mmio_base); - -- ret = mlxbf_pmc_map_counters(dev); -- if (ret) -- return ret; -+ kobject_put(pmc->block[i].block_dir); -+ kfree(pmc->block[i].attr_event); -+ kfree(pmc->block[i].attr_counter); -+ } - -- pmc->hwmon_dev = devm_hwmon_device_register_with_groups( -- dev, "bfperf", pmc, pmc->groups); -- platform_set_drvdata(pdev, pmc); -+ mlxbf_pmc_delete(); - - return 0; - } - --static const struct acpi_device_id mlxbf_pmc_acpi_ids[] = { { "MLNXBFD0", 0 }, -- { "MLNXBFD1", 0 }, -- {}, }; -+static const struct acpi_device_id pmc_acpi_ids[] = { -+ {"MLNXBFD0", 0}, -+ {"MLNXBFD1", 0}, -+ {}, -+}; - --MODULE_DEVICE_TABLE(acpi, mlxbf_pmc_acpi_ids); -+MODULE_DEVICE_TABLE(acpi, pmc_acpi_ids); - static struct platform_driver pmc_driver = { -- .driver = { .name = "mlxbf-pmc", -- .acpi_match_table = ACPI_PTR(mlxbf_pmc_acpi_ids), }, -+ .driver = { -+ .name = "mlxbf-pmc", -+ .acpi_match_table = ACPI_PTR(pmc_acpi_ids), -+ }, - .probe = mlxbf_pmc_probe, -+ .remove = mlxbf_pmc_remove, - }; - - module_platform_driver(pmc_driver); - --MODULE_AUTHOR("Shravan Kumar Ramani "); -+MODULE_AUTHOR("Shravan Kumar Ramani "); - MODULE_DESCRIPTION("Mellanox PMC driver"); - MODULE_LICENSE("Dual BSD/GPL"); -+MODULE_VERSION(__stringify(DRIVER_VERSION)); -diff --git a/drivers/platform/mellanox/mlxbf-pmc.h b/drivers/platform/mellanox/mlxbf-pmc.h -new file mode 100644 -index 000000000..b15614e90 ---- /dev/null -+++ b/drivers/platform/mellanox/mlxbf-pmc.h -@@ -0,0 +1,428 @@ -+// SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause -+ -+#ifndef __MLXBF_PMC_H__ -+#define __MLXBF_PMC_H__ -+ -+#define MLNX_WRITE_REG_32 (0x82000009) -+#define MLNX_READ_REG_32 (0x8200000A) -+#define MLNX_WRITE_REG_64 (0x8200000B) -+#define MLNX_READ_REG_64 (0x8200000C) -+#define MLNX_SIP_SVC_UID (0x8200ff01) -+#define MLNX_SIP_SVC_VERSION (0x8200ff03) -+ -+#define SMCCC_INVALID_PARAMETERS (-2) -+#define SMCCC_OUT_OF_RANGE (-3) -+#define SMCCC_ACCESS_VIOLATION (-4) -+ -+#define MLNX_EVENT_SET_BF1 0 -+#define MLNX_EVENT_SET_BF2 1 -+ -+#define MLNX_PMC_SVC_REQ_MAJOR 0 -+#define MLNX_PMC_SVC_MIN_MINOR 3 -+ -+#define MLXBF_PMC_MAX_BLOCKS 30 -+ -+/** -+ * Structure to hold info for each HW block -+ * -+ * @mmio_base: The VA at which the PMC block is mapped -+ * @blk_size: Size of each mapped region -+ * @counters: Number of counters in the block -+ * @type: Type of counters in the block -+ * @block_dir: Kobjects to create sub-directories -+ * @attr_counter: Attributes for "counter" sysfs files -+ * @attr_event: Attributes for "event" sysfs files -+ * @attr_event_list: Attributes for "event_list" sysfs files -+ * @attr_enable: Attributes for "enable" sysfs files -+ * @sysfs_event_cnt: Number of sysfs event files in the block -+ */ -+struct mlxbf_pmc_block_info { -+ void *mmio_base; -+ size_t blk_size; -+ size_t counters; -+ int type; -+ struct kobject *block_dir; -+ struct kobj_attribute *attr_counter; -+ struct kobj_attribute *attr_event; -+ struct kobj_attribute attr_event_list; -+ struct kobj_attribute attr_enable; -+ int sysfs_event_cnt; -+}; -+ -+/** -+ * Structure to hold PMC context info -+ * -+ * @pdev: The kernel structure representing the device -+ * @total_blocks: Total number of blocks -+ * @tile_count: Number of tiles in the system -+ * @hwmon_dev: Hwmon device for bfperf -+ * @ko: Kobject for bfperf -+ * @block_name: Block name -+ * @block_name: Block info -+ * @sv_sreg_support: Whether SMCs are used to access performance registers -+ * @sreg_tbl_perf: Secure register access table number -+ * @event_set: Event set to use -+ */ -+struct mlxbf_pmc_context { -+ struct platform_device *pdev; -+ uint32_t total_blocks; -+ uint32_t tile_count; -+ struct device *hwmon_dev; -+ struct kobject *ko; -+ const char *block_name[MLXBF_PMC_MAX_BLOCKS]; -+ struct mlxbf_pmc_block_info block[MLXBF_PMC_MAX_BLOCKS]; -+ bool svc_sreg_support; -+ uint32_t sreg_tbl_perf; -+ unsigned int event_set; -+}; -+ -+#define MLXBF_PERFTYPE_COUNTER 1 -+#define MLXBF_PERFTYPE_REGISTER 0 -+ -+#define MLXBF_PERFCTL 0 -+#define MLXBF_PERFEVT 1 -+#define MLXBF_PERFVALEXT 2 -+#define MLXBF_PERFACC0 4 -+#define MLXBF_PERFACC1 5 -+#define MLXBF_PERFMVAL0 6 -+#define MLXBF_PERFMVAL1 7 -+ -+#define MLXBF_GEN_PERFMON_CONFIG__WR_R_B BIT(0) -+#define MLXBF_GEN_PERFMON_CONFIG__STROBE BIT(1) -+#define MLXBF_GEN_PERFMON_CONFIG__ADDR GENMASK_ULL(4, 2) -+#define MLXBF_GEN_PERFMON_CONFIG__WDATA GENMASK_ULL(60, 5) -+ -+#define MLXBF_GEN_PERFCTL__FM1 GENMASK_ULL(2, 0) -+#define MLXBF_GEN_PERFCTL__MS1 GENMASK_ULL(5, 4) -+#define MLXBF_GEN_PERFCTL__ACCM1 GENMASK_ULL(10, 8) -+#define MLXBF_GEN_PERFCTL__AD1 BIT(11) -+#define MLXBF_GEN_PERFCTL__ETRIG1 GENMASK_ULL(13, 12) -+#define MLXBF_GEN_PERFCTL__EB1 BIT(14) -+#define MLXBF_GEN_PERFCTL__EN1 BIT(15) -+#define MLXBF_GEN_PERFCTL__FM0 GENMASK_ULL(18, 16) -+#define MLXBF_GEN_PERFCTL__MS0 GENMASK_ULL(21, 20) -+#define MLXBF_GEN_PERFCTL__ACCM0 GENMASK_ULL(26, 24) -+#define MLXBF_GEN_PERFCTL__AD0 BIT(27) -+#define MLXBF_GEN_PERFCTL__ETRIG0 GENMASK_ULL(29, 28) -+#define MLXBF_GEN_PERFCTL__EB0 BIT(30) -+#define MLXBF_GEN_PERFCTL__EN0 BIT(31) -+ -+#define MLXBF_GEN_PERFEVT__PVALSEL GENMASK_ULL(19, 16) -+#define MLXBF_GEN_PERFEVT__MODSEL GENMASK_ULL(23, 20) -+#define MLXBF_GEN_PERFEVT__EVTSEL GENMASK_ULL(31, 24) -+ -+#define MLXBF_L3C_PERF_CNT_CFG 0x0 -+#define MLXBF_L3C_PERF_CNT_CFG_1 0x4 -+#define MLXBF_L3C_PERF_CNT_CFG_2 0x8 -+#define MLXBF_L3C_PERF_CNT_SEL 0x10 -+#define MLXBF_L3C_PERF_CNT_SEL_1 0x14 -+#define MLXBF_L3C_PERF_CNT_LOW 0x40 -+#define MLXBF_L3C_PERF_CNT_HIGH 0x60 -+ -+#define MLXBF_L3C_PERF_CNT_CFG__EN BIT(0) -+#define MLXBF_L3C_PERF_CNT_CFG__RST BIT(1) -+#define MLXBF_L3C_PERF_CNT_CFG__SRCID_SEL GENMASK(14, 8) -+#define MLXBF_L3C_PERF_CNT_CFG__SRCID_MASK GENMASK(22, 16) -+#define MLXBF_L3C_PERF_CNT_CFG__PRF_SEL GENMASK(27, 24) -+#define MLXBF_L3C_PERF_CNT_CFG__PRF_MASK GENMASK(31, 28) -+ -+#define MLXBF_L3C_PERF_CNT_CFG_1__SET_SEL GENMASK(10,0) -+#define MLXBF_L3C_PERF_CNT_CFG_1__SET_MASK GENMASK(22,12) -+#define MLXBF_L3C_PERF_CNT_CFG_1__EMEM_USAGE_TH GENMASK(30, 24) -+ -+#define MLXBF_L3C_PERF_CNT_CFG_2__STRM_SEL GENMASK(7, 0) -+#define MLXBF_L3C_PERF_CNT_CFG_2__STRM_MASK GENMASK(15, 8) -+ -+#define MLXBF_L3C_PERF_CNT_SEL__CNT_0 GENMASK(5, 0) -+#define MLXBF_L3C_PERF_CNT_SEL__CNT_1 GENMASK(13, 8) -+#define MLXBF_L3C_PERF_CNT_SEL__CNT_2 GENMASK(21, 16) -+#define MLXBF_L3C_PERF_CNT_SEL__CNT_3 GENMASK(29, 24) -+ -+#define MLXBF_L3C_PERF_CNT_SEL_1__CNT_4 GENMASK(5, 0) -+ -+#define MLXBF_L3C_PERF_CNT_LOW__VAL GENMASK(31, 0) -+#define MLXBF_L3C_PERF_CNT_HIGH__VAL GENMASK(24, 0) -+ -+struct mlxbf_pmc_events { -+ uint32_t evt_num; -+ char *evt_name; -+}; -+ -+struct mlxbf_pmc_events mlxbf_pcie_events[] = { -+{0x0, "IN_P_PKT_CNT"}, -+{0x10, "IN_NP_PKT_CNT"}, -+{0x18, "IN_C_PKT_CNT"}, -+{0x20, "OUT_P_PKT_CNT"}, -+{0x28, "OUT_NP_PKT_CNT"}, -+{0x30, "OUT_C_PKT_CNT"}, -+{0x38, "IN_P_BYTE_CNT"}, -+{0x40, "IN_NP_BYTE_CNT"}, -+{0x48, "IN_C_BYTE_CNT"}, -+{0x50, "OUT_P_BYTE_CNT"}, -+{0x58, "OUT_NP_BYTE_CNT"}, -+{0x60, "OUT_C_BYTE_CNT"}, -+{-1, NULL} -+}; -+ -+struct mlxbf_pmc_events mlxbf_smgen_events[] = { -+{0x0, "AW_REQ"}, -+{0x1, "AW_BEATS"}, -+{0x2, "AW_TRANS"}, -+{0x3, "AW_RESP"}, -+{0x4, "AW_STL"}, -+{0x5, "AW_LAT"}, -+{0x6, "AW_REQ_TBU"}, -+{0x8, "AR_REQ"}, -+{0x9, "AR_BEATS"}, -+{0xa, "AR_TRANS"}, -+{0xb, "AR_STL"}, -+{0xc, "AR_LAT"}, -+{0xd, "AR_REQ_TBU"}, -+{0xe, "TBU_MISS"}, -+{0xf, "TX_DAT_AF"}, -+{0x10, "RX_DAT_AF"}, -+{0x11, "RETRYQ_CRED"}, -+{-1, NULL} -+}; -+ -+struct mlxbf_pmc_events mlxbf1_trio_events[] = { -+{0xa0, "TPIO_DATA_BEAT"}, -+{0xa1, "TDMA_DATA_BEAT"}, -+{0xa2, "MAP_DATA_BEAT"}, -+{0xa3, "TXMSG_DATA_BEAT"}, -+{0xa4, "TPIO_DATA_PACKET"}, -+{0xa5, "TDMA_DATA_PACKET"}, -+{0xa6, "MAP_DATA_PACKET"}, -+{0xa7, "TXMSG_DATA_PACKET"}, -+{0xa8, "TDMA_RT_AF"}, -+{0xa9, "TDMA_PBUF_MAC_AF"}, -+{0xaa, "TRIO_MAP_WRQ_BUF_EMPTY"}, -+{0xab, "TRIO_MAP_CPL_BUF_EMPTY"}, -+{0xac, "TRIO_MAP_RDQ0_BUF_EMPTY"}, -+{0xad, "TRIO_MAP_RDQ1_BUF_EMPTY"}, -+{0xae, "TRIO_MAP_RDQ2_BUF_EMPTY"}, -+{0xaf, "TRIO_MAP_RDQ3_BUF_EMPTY"}, -+{0xb0, "TRIO_MAP_RDQ4_BUF_EMPTY"}, -+{0xb1, "TRIO_MAP_RDQ5_BUF_EMPTY"}, -+{0xb2, "TRIO_MAP_RDQ6_BUF_EMPTY"}, -+{0xb3, "TRIO_MAP_RDQ7_BUF_EMPTY"}, -+{-1, NULL} -+}; -+ -+struct mlxbf_pmc_events mlxbf2_trio_events[] = { -+{0xa0, "TPIO_DATA_BEAT"}, -+{0xa1, "TDMA_DATA_BEAT"}, -+{0xa2, "MAP_DATA_BEAT"}, -+{0xa3, "TXMSG_DATA_BEAT"}, -+{0xa4, "TPIO_DATA_PACKET"}, -+{0xa5, "TDMA_DATA_PACKET"}, -+{0xa6, "MAP_DATA_PACKET"}, -+{0xa7, "TXMSG_DATA_PACKET"}, -+{0xa8, "TDMA_RT_AF"}, -+{0xa9, "TDMA_PBUF_MAC_AF"}, -+{0xaa, "TRIO_MAP_WRQ_BUF_EMPTY"}, -+{0xab, "TRIO_MAP_CPL_BUF_EMPTY"}, -+{0xac, "TRIO_MAP_RDQ0_BUF_EMPTY"}, -+{0xad, "TRIO_MAP_RDQ1_BUF_EMPTY"}, -+{0xae, "TRIO_MAP_RDQ2_BUF_EMPTY"}, -+{0xaf, "TRIO_MAP_RDQ3_BUF_EMPTY"}, -+{0xb0, "TRIO_MAP_RDQ4_BUF_EMPTY"}, -+{0xb1, "TRIO_MAP_RDQ5_BUF_EMPTY"}, -+{0xb2, "TRIO_MAP_RDQ6_BUF_EMPTY"}, -+{0xb3, "TRIO_MAP_RDQ7_BUF_EMPTY"}, -+{0xb4, "TRIO_RING_TX_FLIT_CH0"}, -+{0xb5, "TRIO_RING_TX_FLIT_CH1"}, -+{0xb6, "TRIO_RING_TX_FLIT_CH2"}, -+{0xb7, "TRIO_RING_TX_FLIT_CH3"}, -+{0xb8, "TRIO_RING_TX_FLIT_CH4"}, -+{0xb9, "TRIO_RING_RX_FLIT_CH0"}, -+{0xba, "TRIO_RING_RX_FLIT_CH1"}, -+{0xbb, "TRIO_RING_RX_FLIT_CH2"}, -+{0xbc, "TRIO_RING_RX_FLIT_CH3"}, -+{-1, NULL} -+}; -+ -+struct mlxbf_pmc_events mlxbf_ecc_events[] = { -+{0x100, "ECC_SINGLE_ERROR_CNT"}, -+{0x104, "ECC_DOUBLE_ERROR_CNT"}, -+{0x114, "SERR_INJ"}, -+{0x118, "DERR_INJ"}, -+{0x124, "ECC_SINGLE_ERROR_0"}, -+{0x164, "ECC_DOUBLE_ERROR_0"}, -+{0x340, "DRAM_ECC_COUNT"}, -+{0x344, "DRAM_ECC_INJECT"}, -+{0x348, "DRAM_ECC_ERROR",}, -+{-1, NULL} -+}; -+ -+struct mlxbf_pmc_events mlxbf_mss_events[] = { -+{0xc0, "RXREQ_MSS"}, -+{0xc1, "RXDAT_MSS"}, -+{0xc2, "TXRSP_MSS"}, -+{0xc3, "TXDAT_MSS"}, -+{-1, NULL} -+}; -+ -+struct mlxbf_pmc_events mlxbf_hnf_events[] = { -+{0x45, "HNF_REQUESTS"}, -+{0x46, "HNF_REJECTS"}, -+{0x47, "ALL_BUSY"}, -+{0x48, "MAF_BUSY"}, -+{0x49, "MAF_REQUESTS"}, -+{0x4a, "RNF_REQUESTS"}, -+{0x4b, "REQUEST_TYPE"}, -+{0x4c, "MEMORY_READS"}, -+{0x4d, "MEMORY_WRITES"}, -+{0x4e, "VICTIM_WRITE"}, -+{0x4f, "POC_FULL"}, -+{0x50, "POC_FAIL"}, -+{0x51, "POC_SUCCESS"}, -+{0x52, "POC_WRITES"}, -+{0x53, "POC_READS"}, -+{0x54, "FORWARD"}, -+{0x55, "RXREQ_HNF"}, -+{0x56, "RXRSP_HNF"}, -+{0x57, "RXDAT_HNF"}, -+{0x58, "TXREQ_HNF"}, -+{0x59, "TXRSP_HNF"}, -+{0x5a, "TXDAT_HNF"}, -+{0x5b, "TXSNP_HNF"}, -+{0x5c, "INDEX_MATCH"}, -+{0x5d, "A72_ACCESS"}, -+{0x5e, "IO_ACCESS"}, -+{0x5f, "TSO_WRITE"}, -+{0x60, "TSO_CONFLICT"}, -+{0x61, "DIR_HIT"}, -+{0x62, "HNF_ACCEPTS"}, -+{0x63, "REQ_BUF_EMPTY"}, -+{0x64, "REQ_BUF_IDLE_MAF"}, -+{0x65, "TSO_NOARB"}, -+{0x66, "TSO_NOARB_CYCLES"}, -+{0x67, "MSS_NO_CREDIT"}, -+{0x68, "TXDAT_NO_LCRD"}, -+{0x69, "TXSNP_NO_LCRD"}, -+{0x6a, "TXRSP_NO_LCRD"}, -+{0x6b, "TXREQ_NO_LCRD"}, -+{0x6c, "TSO_CL_MATCH"}, -+{0x6d, "MEMORY_READS_BYPASS"}, -+{0x6e, "TSO_NOARB_TIMEOUT"}, -+{0x6f, "ALLOCATE"}, -+{0x70, "VICTIM"}, -+{0x71, "A72_WRITE"}, -+{0x72, "A72_Read"}, -+{0x73, "IO_WRITE"}, -+{0x74, "IO_READ"}, -+{0x75, "TSO_REJECT"}, -+{0x80, "TXREQ_RN"}, -+{0x81, "TXRSP_RN"}, -+{0x82, "TXDAT_RN"}, -+{0x83, "RXSNP_RN"}, -+{0x84, "RXRSP_RN"}, -+{0x85, "RXDAT_RN"}, -+{-1, NULL} -+}; -+ -+struct mlxbf_pmc_events mlxbf2_hnfnet_events[] = { -+{0x12, "CDN_REQ"}, -+{0x13, "DDN_REQ"}, -+{0x14, "NDN_REQ"}, -+{0x15, "CDN_DIAG_N_OUT_OF_CRED"}, -+{0x16, "CDN_DIAG_S_OUT_OF_CRED"}, -+{0x17, "CDN_DIAG_E_OUT_OF_CRED"}, -+{0x18, "CDN_DIAG_W_OUT_OF_CRED"}, -+{0x19, "CDN_DIAG_C_OUT_OF_CRED"}, -+{0x1a, "CDN_DIAG_N_EGRESS"}, -+{0x1b, "CDN_DIAG_S_EGRESS"}, -+{0x1c, "CDN_DIAG_E_EGRESS"}, -+{0x1d, "CDN_DIAG_W_EGRESS"}, -+{0x1e, "CDN_DIAG_C_EGRESS"}, -+{0x1f, "CDN_DIAG_N_INGRESS"}, -+{0x20, "CDN_DIAG_S_INGRESS"}, -+{0x21, "CDN_DIAG_E_INGRESS"}, -+{0x22, "CDN_DIAG_W_INGRESS"}, -+{0x23, "CDN_DIAG_C_INGRESS"}, -+{0x24, "CDN_DIAG_CORE_SENT"}, -+{0x25, "DDN_DIAG_N_OUT_OF_CRED"}, -+{0x26, "DDN_DIAG_S_OUT_OF_CRED"}, -+{0x27, "DDN_DIAG_E_OUT_OF_CRED"}, -+{0x28, "DDN_DIAG_W_OUT_OF_CRED"}, -+{0x29, "DDN_DIAG_C_OUT_OF_CRED"}, -+{0x2a, "DDN_DIAG_N_EGRESS"}, -+{0x2b, "DDN_DIAG_S_EGRESS"}, -+{0x2c, "DDN_DIAG_E_EGRESS"}, -+{0x2d, "DDN_DIAG_W_EGRESS"}, -+{0x2e, "DDN_DIAG_C_EGRESS"}, -+{0x2f, "DDN_DIAG_N_INGRESS"}, -+{0x30, "DDN_DIAG_S_INGRESS"}, -+{0x31, "DDN_DIAG_E_INGRESS"}, -+{0x32, "DDN_DIAG_W_INGRESS"}, -+{0x33, "DDN_DIAG_C_INGRESS"}, -+{0x34, "DDN_DIAG_CORE_SENT"}, -+{0x35, "NDN_DIAG_S_OUT_OF_CRED"}, -+{0x36, "NDN_DIAG_S_OUT_OF_CRED"}, -+{0x37, "NDN_DIAG_E_OUT_OF_CRED"}, -+{0x38, "NDN_DIAG_W_OUT_OF_CRED"}, -+{0x39, "NDN_DIAG_C_OUT_OF_CRED"}, -+{0x3a, "NDN_DIAG_N_EGRESS"}, -+{0x3b, "NDN_DIAG_S_EGRESS"}, -+{0x3c, "NDN_DIAG_E_EGRESS"}, -+{0x3d, "NDN_DIAG_W_EGRESS"}, -+{0x3e, "NDN_DIAG_C_EGRESS"}, -+{0x3f, "NDN_DIAG_N_INGRESS"}, -+{0x40, "NDN_DIAG_S_INGRESS"}, -+{0x41, "NDN_DIAG_E_INGRESS"}, -+{0x42, "NDN_DIAG_W_INGRESS"}, -+{0x43, "NDN_DIAG_C_INGRESS"}, -+{0x44, "NDN_DIAG_CORE_SENT"}, -+{-1, NULL} -+}; -+ -+struct mlxbf_pmc_events mlxbf_l3cache_events[] = { -+{0x00, "DISABLE"}, -+{0x01, "CYCLES"}, -+{0x02, "TOTAL_RD_REQ_IN"}, -+{0x03, "TOTAL_WR_REQ_IN"}, -+{0x04, "TOTAL_WR_DBID_ACK"}, -+{0x05, "TOTAL_WR_DATA_IN"}, -+{0x06, "TOTAL_WR_COMP"}, -+{0x07, "TOTAL_RD_DATA_OUT"}, -+{0x08, "TOTAL_CDN_REQ_IN_BANK0"}, -+{0x09, "TOTAL_CDN_REQ_IN_BANK1"}, -+{0x0a, "TOTAL_DDN_REQ_IN_BANK0"}, -+{0x0b, "TOTAL_DDN_REQ_IN_BANK1"}, -+{0x0c, "TOTAL_EMEM_RD_RES_IN_BANK0"}, -+{0x0d, "TOTAL_EMEM_RD_RES_IN_BANK1"}, -+{0x0e, "TOTAL_CACHE_RD_RES_IN_BANK0"}, -+{0x0f, "TOTAL_CACHE_RD_RES_IN_BANK1"}, -+{0x10, "TOTAL_EMEM_RD_REQ_BANK0"}, -+{0x11, "TOTAL_EMEM_RD_REQ_BANK1"}, -+{0x12, "TOTAL_EMEM_WR_REQ_BANK0"}, -+{0x13, "TOTAL_EMEM_WR_REQ_BANK1"}, -+{0x14, "TOTAL_RD_REQ_OUT"}, -+{0x15, "TOTAL_WR_REQ_OUT"}, -+{0x16, "TOTAL_RD_RES_IN"}, -+{0x17, "HITS_BANK0"}, -+{0x18, "HITS_BANK1"}, -+{0x19, "MISSES_BANK0"}, -+{0x1a, "MISSES_BANK1"}, -+{0x1b, "ALLOCATIONS_BANK0"}, -+{0x1c, "ALLOCATIONS_BANK1"}, -+{0x1d, "EVICTIONS_BANK0"}, -+{0x1e, "EVICTIONS_BANK1"}, -+{0x1f, "DBID_REJECT"}, -+{0x20, "WRDB_REJECT_BANK0"}, -+{0x21, "WRDB_REJECT_BANK1"}, -+{0x22, "CMDQ_REJECT_BANK0"}, -+{0x23, "CMDQ_REJECT_BANK1"}, -+{0x24, "COB_REJECT_BANK0"}, -+{0x25, "COB_REJECT_BANK1"}, -+{0x26, "TRB_REJECT_BANK0"}, -+{0x27, "TRB_REJECT_BANK1"}, -+{0x28, "TAG_REJECT_BANK0"}, -+{0x29, "TAG_REJECT_BANK1"}, -+{0x2a, "ANY_REJECT_BANK0"}, -+{0x2b, "ANY_REJECT_BANK1"}, -+{-1, NULL} -+}; -+ -+#endif /* __MLXBF_PMC_H__ */ --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0216-UBUNTU-SAUCE-mlxbf_pmc-Fix-references-to-sprintf.patch b/platform/mellanox/non-upstream-patches/patches/0216-UBUNTU-SAUCE-mlxbf_pmc-Fix-references-to-sprintf.patch deleted file mode 100644 index 8aa9cf2917d0..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0216-UBUNTU-SAUCE-mlxbf_pmc-Fix-references-to-sprintf.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 597a665f88fd16c595dd804c7567ccd5aab34ad9 Mon Sep 17 00:00:00 2001 -From: Jitendra Lanka -Date: Tue, 16 Aug 2022 16:18:39 -0400 -Subject: [PATCH backport 5.10 17/63] UBUNTU: SAUCE: mlxbf_pmc: Fix references - to sprintf - -BugLink: https://bugs.launchpad.net/bugs/1986849 - -Replace sprintf with snprintf with a defined upper boundary of -PAGE_SIZE for sysfs store/show functions and max array size defined -otherwise. - -Change-Id: If586302684d60a435abc9f5aaf28b08de9b2df16 -Signed-off-by: Jitendra Lanka -Signed-off-by: Ike Panhc ---- - drivers/platform/mellanox/mlxbf-pmc.c | 15 +++++++++------ - 1 file changed, 9 insertions(+), 6 deletions(-) - -diff --git a/drivers/platform/mellanox/mlxbf-pmc.c b/drivers/platform/mellanox/mlxbf-pmc.c -index a9debcdf9..3305d2a5d 100644 ---- a/drivers/platform/mellanox/mlxbf-pmc.c -+++ b/drivers/platform/mellanox/mlxbf-pmc.c -@@ -681,7 +681,7 @@ static ssize_t mlxbf_counter_read(struct kobject *ko, - } else - return -EINVAL; - -- return sprintf(buf, "0x%llx\n", value); -+ return snprintf(buf, PAGE_SIZE, "0x%llx\n", value); - } - - /* Store function for "counter" sysfs files */ -@@ -758,7 +758,7 @@ static ssize_t mlxbf_event_find(struct kobject *ko, - - evt_name = mlxbf_pmc_get_event_name((char *)ko->name, evt_num); - -- return sprintf(buf, "0x%llx: %s\n", evt_num, evt_name); -+ return snprintf(buf, PAGE_SIZE, "0x%llx: %s\n", evt_num, evt_name); - } - - /* Store function for "event" sysfs files */ -@@ -811,9 +811,12 @@ static ssize_t mlxbf_print_event_list(struct kobject *ko, - - buf[0] = '\0'; - while (events[i].evt_name != NULL) { -- size += sprintf(e_info, "%x: %s\n", events[i].evt_num, -- events[i].evt_name); -- if (size > PAGE_SIZE) -+ size += snprintf(e_info, -+ sizeof(e_info), -+ "%x: %s\n", -+ events[i].evt_num, -+ events[i].evt_name); -+ if (size >= PAGE_SIZE) - break; - strcat(buf, e_info); - ret = size; -@@ -840,7 +843,7 @@ static ssize_t mlxbf_show_counter_state(struct kobject *ko, - - value = FIELD_GET(MLXBF_L3C_PERF_CNT_CFG__EN, perfcnt_cfg); - -- return sprintf(buf, "%d\n", value); -+ return snprintf(buf, PAGE_SIZE, "%d\n", value); - } - - /* Store function for "enable" sysfs files - only for l3cache */ --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0217-UBUNTU-SAUCE-mlxbf-pmc-Fix-error-when-reading-unprog.patch b/platform/mellanox/non-upstream-patches/patches/0217-UBUNTU-SAUCE-mlxbf-pmc-Fix-error-when-reading-unprog.patch deleted file mode 100644 index 3607501b5455..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0217-UBUNTU-SAUCE-mlxbf-pmc-Fix-error-when-reading-unprog.patch +++ /dev/null @@ -1,140 +0,0 @@ -From f88fbeabee18fbd15de2e717fe45d9bf2c287468 Mon Sep 17 00:00:00 2001 -From: Shravan Kumar Ramani -Date: Fri, 9 Sep 2022 05:31:43 -0400 -Subject: [PATCH backport 5.10 18/63] UBUNTU: SAUCE: mlxbf-pmc: Fix error when - reading unprogrammed events - -BugLink: https://bugs.launchpad.net/bugs/1989172 - -Firstly, all events have a reset value of 0, which is not a valid -event as per the event_list for most blocks and hence seen as an -error. Add a "disable" event with event_number 0 for all blocks. -Second, the enable bit for each counter need not be checked before -reading the event info, and hence removed. - -Signed-off-by: Shravan Kumar Ramani -Signed-off-by: Ike Panhc ---- - drivers/platform/mellanox/mlxbf-pmc.c | 32 +++++---------------------- - drivers/platform/mellanox/mlxbf-pmc.h | 6 +++++ - 2 files changed, 12 insertions(+), 26 deletions(-) - -diff --git a/drivers/platform/mellanox/mlxbf-pmc.c b/drivers/platform/mellanox/mlxbf-pmc.c -index 3305d2a5d..106acea8c 100644 ---- a/drivers/platform/mellanox/mlxbf-pmc.c -+++ b/drivers/platform/mellanox/mlxbf-pmc.c -@@ -19,7 +19,7 @@ - - #include "mlxbf-pmc.h" - --#define DRIVER_VERSION 2.2 -+#define DRIVER_VERSION 2.3 - - static struct mlxbf_pmc_context *pmc; - -@@ -562,7 +562,7 @@ int mlxbf_read_event(int blk_num, uint32_t cnt_num, bool is_l3, - uint64_t *result) - { - uint32_t perfcfg_offset, perfval_offset; -- uint64_t perfmon_cfg, perfevt, perfctl; -+ uint64_t perfmon_cfg, perfevt; - - if (cnt_num >= pmc->block[blk_num].counters) - return -EINVAL; -@@ -573,26 +573,6 @@ int mlxbf_read_event(int blk_num, uint32_t cnt_num, bool is_l3, - perfcfg_offset = cnt_num * 8; - perfval_offset = perfcfg_offset + pmc->block[blk_num].counters * 8; - -- /* Set counter in "read" mode */ -- perfmon_cfg = 0; -- perfmon_cfg |= FIELD_PREP(MLXBF_GEN_PERFMON_CONFIG__ADDR, -- MLXBF_PERFCTL); -- perfmon_cfg |= FIELD_PREP(MLXBF_GEN_PERFMON_CONFIG__STROBE, 1); -- perfmon_cfg |= FIELD_PREP(MLXBF_GEN_PERFMON_CONFIG__WR_R_B, 0); -- -- if (mlxbf_pmc_writeq(perfmon_cfg, -- pmc->block[blk_num].mmio_base + perfcfg_offset)) -- return -EFAULT; -- -- /* Check if the counter is enabled */ -- -- if (mlxbf_pmc_readq(&perfctl, -- pmc->block[blk_num].mmio_base + perfval_offset)) -- return -EFAULT; -- -- if (FIELD_GET(MLXBF_GEN_PERFCTL__EN0, perfctl) == 0) -- return -EINVAL; -- - /* Set counter in "read" mode */ - perfmon_cfg = 0; - perfmon_cfg |= FIELD_PREP(MLXBF_GEN_PERFMON_CONFIG__ADDR, -@@ -812,10 +792,10 @@ static ssize_t mlxbf_print_event_list(struct kobject *ko, - buf[0] = '\0'; - while (events[i].evt_name != NULL) { - size += snprintf(e_info, -- sizeof(e_info), -- "%x: %s\n", -- events[i].evt_num, -- events[i].evt_name); -+ sizeof(e_info), -+ "%x: %s\n", -+ events[i].evt_num, -+ events[i].evt_name); - if (size >= PAGE_SIZE) - break; - strcat(buf, e_info); -diff --git a/drivers/platform/mellanox/mlxbf-pmc.h b/drivers/platform/mellanox/mlxbf-pmc.h -index b15614e90..894c3cc88 100644 ---- a/drivers/platform/mellanox/mlxbf-pmc.h -+++ b/drivers/platform/mellanox/mlxbf-pmc.h -@@ -186,6 +186,7 @@ struct mlxbf_pmc_events mlxbf_smgen_events[] = { - }; - - struct mlxbf_pmc_events mlxbf1_trio_events[] = { -+{0x00, "DISABLE"}, - {0xa0, "TPIO_DATA_BEAT"}, - {0xa1, "TDMA_DATA_BEAT"}, - {0xa2, "MAP_DATA_BEAT"}, -@@ -210,6 +211,7 @@ struct mlxbf_pmc_events mlxbf1_trio_events[] = { - }; - - struct mlxbf_pmc_events mlxbf2_trio_events[] = { -+{0x00, "DISABLE"}, - {0xa0, "TPIO_DATA_BEAT"}, - {0xa1, "TDMA_DATA_BEAT"}, - {0xa2, "MAP_DATA_BEAT"}, -@@ -243,6 +245,7 @@ struct mlxbf_pmc_events mlxbf2_trio_events[] = { - }; - - struct mlxbf_pmc_events mlxbf_ecc_events[] = { -+{0x00, "DISABLE"}, - {0x100, "ECC_SINGLE_ERROR_CNT"}, - {0x104, "ECC_DOUBLE_ERROR_CNT"}, - {0x114, "SERR_INJ"}, -@@ -256,6 +259,7 @@ struct mlxbf_pmc_events mlxbf_ecc_events[] = { - }; - - struct mlxbf_pmc_events mlxbf_mss_events[] = { -+{0x00, "DISABLE"}, - {0xc0, "RXREQ_MSS"}, - {0xc1, "RXDAT_MSS"}, - {0xc2, "TXRSP_MSS"}, -@@ -264,6 +268,7 @@ struct mlxbf_pmc_events mlxbf_mss_events[] = { - }; - - struct mlxbf_pmc_events mlxbf_hnf_events[] = { -+{0x00, "DISABLE"}, - {0x45, "HNF_REQUESTS"}, - {0x46, "HNF_REJECTS"}, - {0x47, "ALL_BUSY"}, -@@ -323,6 +328,7 @@ struct mlxbf_pmc_events mlxbf_hnf_events[] = { - }; - - struct mlxbf_pmc_events mlxbf2_hnfnet_events[] = { -+{0x00, "DISABLE"}, - {0x12, "CDN_REQ"}, - {0x13, "DDN_REQ"}, - {0x14, "NDN_REQ"}, --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0218-UBUNTU-SAUCE-platform-mellanox-Add-mlx-trio-driver.patch b/platform/mellanox/non-upstream-patches/patches/0218-UBUNTU-SAUCE-platform-mellanox-Add-mlx-trio-driver.patch deleted file mode 100644 index 582c3e27d38b..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0218-UBUNTU-SAUCE-platform-mellanox-Add-mlx-trio-driver.patch +++ /dev/null @@ -1,954 +0,0 @@ -From 15bbb9ee03e015587b9bd704f36c85177fba563a Mon Sep 17 00:00:00 2001 -From: Shravan Kumar Ramani -Date: Tue, 5 Jul 2022 11:11:45 -0400 -Subject: [PATCH backport 5.10 19/63] UBUNTU: SAUCE: platform/mellanox: Add - mlx-trio driver - -BugLink: https://bugs.launchpad.net/bugs/1980754 - -The mlx-trio driver allows users to configure the TRIO PCIe root -complex of Mellanox BlueField SoCs to select an L3 cache profile. -It also handles TRIO IRQs and prints debug info. - -Signed-off-by: Shravan Kumar Ramani -Signed-off-by: Ike Panhc ---- - drivers/platform/mellanox/Kconfig | 7 + - drivers/platform/mellanox/Makefile | 1 + - drivers/platform/mellanox/mlx-trio.c | 651 ++++++++++++++++++++++++++ - drivers/platform/mellanox/trio_regs.h | 236 ++++++++++ - 4 files changed, 895 insertions(+) - create mode 100644 drivers/platform/mellanox/mlx-trio.c - create mode 100644 drivers/platform/mellanox/trio_regs.h - -diff --git a/drivers/platform/mellanox/Kconfig b/drivers/platform/mellanox/Kconfig -index b0d2c3343..5d329350a 100644 ---- a/drivers/platform/mellanox/Kconfig -+++ b/drivers/platform/mellanox/Kconfig -@@ -90,6 +90,13 @@ config MLXBF_PMC - to performance monitoring counters within various blocks in the - Mellanox BlueField SoC via a sysfs interface. - -+config MLXBF_TRIO -+ tristate "Mellanox TRIO driver" -+ depends on ARM64 -+ help -+ This driver supports the TRIO PCIe root complex interface on -+ Mellanox BlueField SoCs. -+ - config NVSW_SN2201 - tristate "Nvidia SN2201 platform driver support" - depends on REGMAP -diff --git a/drivers/platform/mellanox/Makefile b/drivers/platform/mellanox/Makefile -index 000ddaa74c98..837b748db1f6 100644 ---- a/drivers/platform/mellanox/Makefile -+++ b/drivers/platform/mellanox/Makefile -@@ -6,5 +6,6 @@ - obj-$(CONFIG_MLXBF_BOOTCTL) += mlxbf-bootctl.o - obj-$(CONFIG_MLXBF_PMC) += mlxbf-pmc.o - obj-$(CONFIG_MLXBF_TMFIFO) += mlxbf-tmfifo.o -+obj-$(CONFIG_MLXBF_TRIO) += mlx-trio.o - obj-$(CONFIG_MLXREG_HOTPLUG) += mlxreg-hotplug.o - obj-$(CONFIG_MLXREG_IO) += mlxreg-io.o -diff --git a/drivers/platform/mellanox/mlx-trio.c b/drivers/platform/mellanox/mlx-trio.c -new file mode 100644 -index 000000000..849006e9c ---- /dev/null -+++ b/drivers/platform/mellanox/mlx-trio.c -@@ -0,0 +1,651 @@ -+// SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause -+/* -+ * TRIO driver for Mellanox BlueField SoC -+ * -+ * Copyright (c) 2018, Mellanox Technologies. All rights reserved. -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * as published by the Free Software Foundation; either version -+ * 2 of the License, or (at your option) any later version. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+ -+#include "trio_regs.h" -+ -+#define DRIVER_NAME "mlx-trio" -+#define DRIVER_VERSION "0.4" -+#define DRIVER_DESCRIPTION "Mellanox TRIO PCIe host controller driver" -+ -+/* SMC return codes */ -+#define SMCCC_ACCESS_VIOLATION (-4) -+ -+/* SMC function identifiers */ -+#define MLNX_WRITE_REG_64 (0x8200000B) -+#define MLNX_READ_REG_64 (0x8200000C) -+#define MLNX_SIP_SVC_UID (0x8200ff01) -+#define MLNX_SIP_SVC_VERSION (0x8200ff03) -+ -+#define MLNX_TRIO_SVC_REQ_MAJOR 0 -+#define MLNX_TRIO_SVC_MIN_MINOR 4 -+ -+#define TRIO_NUM_IRQS 17 -+#define L3_PROFILE_NUM (L3C_PROF_RD_MISS__LENGTH / L3C_PROF_RD_MISS__STRIDE) -+ -+/* The PUSH_DMA_EVT_CTR wrapped. */ -+#define TRIO_PUSH_DMA_EVT_CTR_INT_BIT 10 -+ -+/* The MAP_EVT_CTR wrapped. */ -+#define TRIO_MAP_EVT_CTR_INT_BIT 11 -+ -+enum trio_int_events { -+ TRIO_MAC_INT = 0, -+ TRIO_RSH_FULL_ERR_INT, -+ TRIO_MSG_Q_FULL_ERR_INT, -+ TRIO_MSG_Q_ARRIVED_INT, -+ TRIO_MMIO_ERR_INT, -+ TRIO_MAP_UNCLAIMED_INT, -+ TRIO_RSH_SIZE_ERR_INT, -+ TRIO_PIO_ECAM_ERR_INT, -+ TRIO_PIO_CPL_ERR_INT, -+ TRIO_MMIO_PROT_ERR_INT, -+ TRIO_PUSH_DMA_EVT_CTR_INT, -+ TRIO_MAP_EVT_CTR_INT, -+ TRIO_PIO_DISABLED_INT, -+ TRIO_REM_MMIO_ERR_INT, -+ TRIO_ERR_MSG_COR_INT, -+ TRIO_ERR_MSG_NONFATAL_INT, -+ TRIO_ERR_MSG_FATAL_INT, -+}; -+ -+struct trio_event_info { -+ const char *name; -+ int additional_info; -+}; -+ -+static const struct trio_event_info trio_events[TRIO_NUM_IRQS] = { -+ [TRIO_MAC_INT] = { -+ .name = "MAC Interrupt", -+ .additional_info = -1, -+ }, -+ [TRIO_RSH_FULL_ERR_INT] = { -+ .name = "RShim Full Error", -+ .additional_info = -1, -+ }, -+ [TRIO_MSG_Q_FULL_ERR_INT] = { -+ .name = "Msg Queue Full Error", -+ .additional_info = -1, -+ }, -+ [TRIO_MSG_Q_ARRIVED_INT] = { -+ .name = "Msg Arrived Interrupt", -+ .additional_info = -1, -+ }, -+ [TRIO_MMIO_ERR_INT] = { -+ .name = "MMIO Error", -+ .additional_info = TRIO_MMIO_ERROR_INFO, -+ }, -+ [TRIO_MAP_UNCLAIMED_INT] = { -+ .name = "Packet Unclaimed Error", -+ .additional_info = TRIO_MAP_ERR_STS, -+ }, -+ [TRIO_RSH_SIZE_ERR_INT] = { -+ .name = "RShim Size Error", -+ .additional_info = -1, -+ }, -+ [TRIO_PIO_ECAM_ERR_INT] = { -+ .name = "PIO ECAM Error", -+ .additional_info = -1, -+ }, -+ [TRIO_PIO_CPL_ERR_INT] = { -+ .name = "PIO Completion Error", -+ .additional_info = TRIO_TILE_PIO_CPL_ERR_STS, -+ }, -+ [TRIO_MMIO_PROT_ERR_INT] = { -+ .name = "MMIO Protection level Violation", -+ .additional_info = -1, -+ }, -+ [TRIO_PUSH_DMA_EVT_CTR_INT] = { -+ .name = "PUSH_DMA_CTR wrapped", -+ .additional_info = -1, -+ }, -+ [TRIO_MAP_EVT_CTR_INT] = { -+ .name = "MAP_EVT_CTR wrapped", -+ .additional_info = -1, -+ }, -+ [TRIO_PIO_DISABLED_INT] = { -+ .name = "Access to disabled PIO region", -+ .additional_info = -1, -+ }, -+ [TRIO_REM_MMIO_ERR_INT] = { -+ .name = "Remote Buffer MMIO Error", -+ .additional_info = -1, -+ }, -+ [TRIO_ERR_MSG_COR_INT] = { -+ .name = "Correctable error message received", -+ .additional_info = -1, -+ }, -+ [TRIO_ERR_MSG_NONFATAL_INT] = { -+ .name = "Nonfatal error message received", -+ .additional_info = -1, -+ }, -+ [TRIO_ERR_MSG_FATAL_INT] = { -+ .name = "Fatal error message received", -+ .additional_info = -1, -+ }, -+}; -+ -+enum l3_profile_type { -+ LRU_PROFILE = 0, /* 0 is the default behavior. */ -+ NVME_PROFILE, -+ L3_PROFILE_TYPE_NUM, -+}; -+ -+static const char *l3_profiles[L3_PROFILE_TYPE_NUM] = { -+ [LRU_PROFILE] = "Strict_LRU", -+ [NVME_PROFILE] = "NVMeOF_suitable" -+}; -+ -+/* -+ * The default profile each L3 profile would get. -+ * The current setting would make profile 1 the NVMe suitable profile -+ * and the rest of the profiles LRU profile. -+ * Note that profile 0 should be configured as LRU as this is the -+ * default profile. -+ */ -+static const enum l3_profile_type default_profile[L3_PROFILE_NUM] = { -+ [1] = NVME_PROFILE, -+}; -+ -+struct event_context { -+ int event_num; -+ int irq; -+ struct trio_context *trio; -+}; -+ -+struct trio_context { -+ /* The kernel structure representing the device. */ -+ struct platform_device *pdev; -+ -+ /* Argument to be passed back to the IRQ handler */ -+ struct event_context *events; -+ -+ /* -+ * Reg base addr, will be memmapped if sreg_use_smcs is false. -+ * Otherwise, this is a physical address. -+ */ -+ void __iomem *mmio_base; -+ -+ int trio_index; -+ -+ /* Name of the bus this TRIO corresponds to */ -+ const char *bus; -+ -+ /* The PCI device this TRIO corresponds to */ -+ struct pci_dev *trio_pci; -+ -+ /* Number of platform_irqs for this device */ -+ uint32_t num_irqs; -+ -+ /* Access regs with smcs if true */ -+ bool sreg_use_smcs; -+ -+ /* verification table for trio */ -+ uint32_t sreg_trio_tbl; -+}; -+ -+static int secure_writeq(struct trio_context *trio, uint64_t value, -+ void __iomem *addr) -+{ -+ struct arm_smccc_res res; -+ int status; -+ -+ arm_smccc_smc(MLNX_WRITE_REG_64, trio->sreg_trio_tbl, value, -+ (uintptr_t) addr, 0, 0, 0, 0, &res); -+ -+ status = res.a0; -+ -+ switch (status) { -+ /* -+ * Note: PSCI_RET_NOT_SUPPORTED is used here to maintain compatibility -+ * with older kernels that do not have SMCCC_RET_NOT_SUPPORTED -+ */ -+ case PSCI_RET_NOT_SUPPORTED: -+ dev_err(&trio->pdev->dev, -+ "%s: required SMC unsupported\n", -+ __func__); -+ return -1; -+ case SMCCC_ACCESS_VIOLATION: -+ dev_err(&trio->pdev->dev, -+ "%s: could not access register at %px\n", -+ __func__, -+ addr); -+ return -1; -+ default: -+ return 0; -+ } -+} -+ -+static int trio_writeq(struct trio_context *trio, uint64_t value, -+ void __iomem *addr) -+{ -+ if (trio->sreg_use_smcs) -+ return secure_writeq(trio, value, addr); -+ else { -+ writeq(value, addr); -+ return 0; -+ } -+} -+ -+static int secure_readq(struct trio_context *trio, void __iomem *addr, -+ uint64_t *result) -+{ -+ struct arm_smccc_res res; -+ int status; -+ -+ arm_smccc_smc(MLNX_READ_REG_64, trio->sreg_trio_tbl, (uintptr_t) addr, -+ 0, 0, 0, 0, 0, &res); -+ -+ status = res.a0; -+ -+ switch (status) { -+ /* -+ * Note: PSCI_RET_NOT_SUPPORTED is used here to maintain compatibility -+ * with older kernels that do not have SMCCC_RET_NOT_SUPPORTED -+ */ -+ case PSCI_RET_NOT_SUPPORTED: -+ dev_err(&trio->pdev->dev, -+ "%s: required SMC unsupported\n", __func__); -+ return -1; -+ case SMCCC_ACCESS_VIOLATION: -+ dev_err(&trio->pdev->dev, -+ "%s: could not read register %px\n", -+ __func__, -+ addr); -+ return -1; -+ default: -+ *result = (uint64_t)res.a1; -+ return 0; -+ } -+} -+ -+static int trio_readq(struct trio_context *trio, void __iomem *addr, -+ uint64_t *result) -+{ -+ if (trio->sreg_use_smcs) -+ return secure_readq(trio, addr, result); -+ else { -+ *result = readq(addr); -+ return 0; -+ } -+} -+ -+static irqreturn_t trio_irq_handler(int irq, void *arg) -+{ -+ struct event_context *ctx = (struct event_context *)arg; -+ struct trio_context *trio = ctx->trio; -+ -+ pr_debug("mlx_trio: TRIO %d received IRQ %d event %d (%s)\n", -+ trio->trio_index, irq, ctx->event_num, -+ trio_events[ctx->event_num].name); -+ -+ if (trio_events[ctx->event_num].additional_info != -1) { -+ uint64_t info; -+ trio_readq(trio, trio->mmio_base + -+ trio_events[ctx->event_num].additional_info, -+ &info); -+ pr_debug("mlx_trio: Addition IRQ info: %llx\n", info); -+ } -+ -+ return IRQ_HANDLED; -+} -+ -+static ssize_t current_profile_show(struct device *dev, -+ struct device_attribute *attr, -+ char *buf) -+{ -+ int profile_num; -+ struct trio_context *trio; -+ struct platform_device *pdev; -+ -+ TRIO_DEV_CTL_t tdc; -+ -+ pdev = to_platform_device(dev); -+ trio = platform_get_drvdata(pdev); -+ -+ if (trio_readq(trio, trio->mmio_base + TRIO_DEV_CTL, &tdc.word)) { -+ return -EIO; -+ } -+ -+ if (tdc.l3_profile_ovd == 0) -+ profile_num = -1; -+ else -+ profile_num = tdc.l3_profile_val; -+ -+ return sprintf(buf, "%d\n", profile_num); -+} -+ -+static int set_l3cache_profile(struct trio_context *trio, long profile_num) -+{ -+ TRIO_DEV_CTL_t tdc; -+ -+ if (trio_readq(trio, trio->mmio_base + TRIO_DEV_CTL, &tdc.word)) { -+ return -EIO; -+ } -+ -+ if (profile_num == -1) { -+ dev_info(&trio->pdev->dev, "Unlink %s profile\n", trio->bus); -+ -+ tdc.l3_profile_ovd = 0; -+ } else if (profile_num < L3_PROFILE_NUM && profile_num >= 0) { -+ dev_info(&trio->pdev->dev, "Change %s to profile %ld\n", -+ trio->bus, profile_num); -+ -+ tdc.l3_profile_ovd = 1; -+ tdc.l3_profile_val = profile_num; -+ } else { -+ dev_err(&trio->pdev->dev, "Profile number out of range."); -+ return -EINVAL; -+ } -+ -+ if (trio_writeq(trio, tdc.word, trio->mmio_base + TRIO_DEV_CTL)) { -+ return -EIO; -+ } -+ -+ return 0; -+} -+ -+static ssize_t current_profile_store(struct device *dev, -+ struct device_attribute *attr, -+ const char *buf, size_t count) -+{ -+ int err; -+ long profile_num; -+ struct trio_context *trio; -+ struct platform_device *pdev; -+ -+ pdev = container_of(dev, struct platform_device, dev); -+ trio = platform_get_drvdata(pdev); -+ -+ err = kstrtol(buf, 10, &profile_num); -+ if (err) -+ return err; -+ -+ err = set_l3cache_profile(trio, profile_num); -+ if (err) -+ return err; -+ -+ return count; -+} -+ -+static DEVICE_ATTR_RW(current_profile); -+ -+static ssize_t available_profiles_show(struct device *dev, -+ struct device_attribute *attr, -+ char *buf) -+{ -+ int i; -+ ssize_t line_size; -+ ssize_t len = 0; -+ -+ for (i = 0; i < L3_PROFILE_NUM; i++) { -+ line_size = sprintf(buf, "%d %s\n", i, -+ l3_profiles[default_profile[i]]); -+ buf += line_size; -+ len += line_size; -+ } -+ return len; -+} -+ -+static DEVICE_ATTR_RO(available_profiles); -+ -+static int trio_probe(struct platform_device *pdev) -+{ -+ struct device *dev = &pdev->dev; -+ struct trio_context *trio; -+ int i, j, ret, irq; -+ int trio_bus, trio_device, trio_function; -+ struct resource *res; -+ struct arm_smccc_res smc_res; -+ -+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -+ if (!res) { -+ dev_warn(dev, "%s: failed to find reg resource 0\n", __func__); -+ return -ENODEV; -+ } -+ -+ trio = kzalloc(sizeof(struct trio_context), GFP_KERNEL); -+ if (!trio) -+ return -ENOMEM; -+ -+ platform_set_drvdata(pdev, trio); -+ trio->pdev = pdev; -+ -+ /* Determine whether to use SMCs or not. */ -+ if (device_property_read_u32(&pdev->dev, "sec_reg_block", -+ &trio->sreg_trio_tbl)) { -+ trio->sreg_use_smcs = false; -+ } else { -+ /* -+ * Ensure we have the UUID we expect for the Mellanox service. -+ */ -+ arm_smccc_smc(MLNX_SIP_SVC_UID, 0, 0, 0, 0, 0, 0, 0, &smc_res); -+ if (smc_res.a0 != 0x89c036b4 || smc_res.a1 != 0x11e6e7d7 || -+ smc_res.a2 != 0x1a009787 || smc_res.a3 != 0xc4bf00ca) { -+ dev_err(&pdev->dev, -+ "Mellanox SMC service not available\n"); -+ return -EINVAL; -+ } -+ -+ /* -+ * Check service version to see if we actually do support the -+ * needed SMCs. If we have the calls we need, mark support for -+ * them in the trio struct. -+ */ -+ arm_smccc_smc(MLNX_SIP_SVC_VERSION, 0, 0, 0, 0, 0, 0, 0, -+ &smc_res); -+ if (smc_res.a0 == MLNX_TRIO_SVC_REQ_MAJOR && -+ smc_res.a1 >= MLNX_TRIO_SVC_MIN_MINOR) { -+ trio->sreg_use_smcs = true; -+ } else { -+ dev_err(&pdev->dev, -+ "Required SMCs are not supported.\n"); -+ -+ return -EINVAL; -+ } -+ } -+ -+ if (device_property_read_string(dev, "bus_number", &trio->bus)) { -+ dev_warn(dev, "%s: failed to retrieve Trio bus name\n", -+ __func__); -+ ret = -ENODEV; -+ goto err; -+ } -+ -+ if (device_property_read_u32(dev, "num_irqs", &trio->num_irqs)) -+ trio->num_irqs = TRIO_NUM_IRQS; -+ trio->events = kzalloc(sizeof(struct event_context) * trio->num_irqs, -+ GFP_KERNEL); -+ if (!trio->events) { -+ ret = -ENOMEM; -+ goto err; -+ } -+ -+ /* Map registers */ -+ if (!trio->sreg_use_smcs) { -+ trio->mmio_base = devm_ioremap_resource(&pdev->dev, res); -+ -+ if (IS_ERR(trio->mmio_base)) { -+ dev_warn(dev, "%s: ioremap failed for mmio_base %llx err %p\n", -+ __func__, res->start, trio->mmio_base); -+ ret = PTR_ERR(trio->mmio_base); -+ goto err; -+ } -+ } else -+ trio->mmio_base = (void __iomem *) res->start; -+ -+ for (i = 0; i < trio->num_irqs; ++i) { -+ struct event_context *ctx = &trio->events[i]; -+ int dri_ret; -+ -+ switch (i) { -+ case TRIO_PUSH_DMA_EVT_CTR_INT_BIT: -+ case TRIO_MAP_EVT_CTR_INT_BIT: -+ /* -+ * These events are not errors, they just indicate -+ * that a performance counter wrapped. We may want -+ * the performance counter driver to register for them. -+ */ -+ continue; -+ default: -+ break; -+ } -+ -+ irq = platform_get_irq(pdev, i); -+ if (irq < 0) { -+ dev_warn(dev, "%s: failed to get plat irq %d ret %d\n", -+ __func__, i, irq); -+ for (j = i - 1; j >= 0; j--) { -+ ctx = &trio->events[j]; -+ devm_free_irq(&pdev->dev, ctx->irq, ctx); -+ } -+ ret = -ENXIO; -+ goto err; -+ } -+ ctx->event_num = i; -+ ctx->trio = trio; -+ ctx->irq = irq; -+ dri_ret = devm_request_irq(&pdev->dev, irq, trio_irq_handler, 0, -+ dev_name(dev), ctx); -+ -+ dev_dbg(dev, "%s: request_irq returns %d %d->%d\n", __func__, -+ dri_ret, i, irq); -+ } -+ -+ /* Create the L3 cache profile on this device */ -+ device_create_file(dev, &dev_attr_current_profile); -+ device_create_file(dev, &dev_attr_available_profiles); -+ -+ /* -+ * Get the corresponding PCI device this trio maps to. -+ * If the bus number can't be read properly, no symlinks are created. -+ */ -+ if (sscanf(trio->bus, "%d:%d.%d", &trio_bus, &trio_device, -+ &trio_function) != 3) { -+ dev_warn(dev, "Device [%s] not valid\n", trio->bus); -+ return 0; -+ } -+ -+ /* trio_device is also the index of the TRIO */ -+ trio->trio_index = trio_device; -+ -+ /* The PCI domain/segment would always be 0 here. */ -+ trio->trio_pci = -+ pci_get_domain_bus_and_slot(0, trio_bus, -+ (trio_device << 3) + trio_function); -+ -+ /* Add the symlink from the TRIO to the PCI device */ -+ if (trio->trio_pci != NULL) { -+ if (sysfs_create_link(&dev->kobj, &trio->trio_pci->dev.kobj, -+ "pcie_slot")) { -+ pci_dev_put(trio->trio_pci); -+ trio->trio_pci = NULL; -+ dev_warn(dev, "Failed to create symblink for %s\n", -+ trio->bus); -+ } -+ } else -+ dev_warn(dev, "Device %s not found\n", trio->bus); -+ -+ dev_info(dev, "v" DRIVER_VERSION " probed\n"); -+ return 0; -+err: -+ dev_warn(dev, "Error probing trio\n"); -+ if (trio->events) -+ kfree(trio->events); -+ kfree(trio); -+ platform_set_drvdata(pdev, NULL); -+ return ret; -+} -+ -+static int trio_remove(struct platform_device *pdev) -+{ -+ struct trio_context *trio = platform_get_drvdata(pdev); -+ struct device *dev = &pdev->dev; -+ int i; -+ -+ for (i = 0; i < trio->num_irqs; ++i) { -+ struct event_context *ctx = &trio->events[i]; -+ -+ if (ctx->irq) -+ devm_free_irq(&pdev->dev, ctx->irq, ctx); -+ } -+ device_remove_file(dev, &dev_attr_current_profile); -+ device_remove_file(dev, &dev_attr_available_profiles); -+ -+ /* Delete the symlink and decrement the reference count. */ -+ if (trio->trio_pci != NULL) { -+ sysfs_remove_link(&dev->kobj, "pcie_slot"); -+ pci_dev_put(trio->trio_pci); -+ } -+ platform_set_drvdata(pdev, NULL); -+ kfree(trio->events); -+ kfree(trio); -+ -+ return 0; -+} -+ -+static const struct acpi_device_id trio_acpi_ids[] = { -+ {"MLNXBF06", 0}, -+ {}, -+}; -+ -+MODULE_DEVICE_TABLE(acpi, trio_acpi_ids); -+static struct platform_driver mlx_trio_driver = { -+ .driver = { -+ .name = DRIVER_NAME, -+ .acpi_match_table = ACPI_PTR(trio_acpi_ids), -+ }, -+ .probe = trio_probe, -+ .remove = trio_remove, -+}; -+ -+static int __init trio_init(void) -+{ -+ int ret; -+ -+ ret = platform_driver_register(&mlx_trio_driver); -+ if (ret) -+ pr_err("Failed to register trio driver.\n"); -+ -+ return ret; -+} -+ -+static void __exit trio_exit(void) -+{ -+ platform_driver_unregister(&mlx_trio_driver); -+} -+ -+module_init(trio_init); -+module_exit(trio_exit); -+ -+MODULE_DESCRIPTION(DRIVER_DESCRIPTION); -+MODULE_AUTHOR("Shravan Kumar Ramani "); -+MODULE_LICENSE("Dual BSD/GPL"); -+MODULE_VERSION(DRIVER_VERSION); -diff --git a/drivers/platform/mellanox/trio_regs.h b/drivers/platform/mellanox/trio_regs.h -new file mode 100644 -index 000000000..cc2f2003d ---- /dev/null -+++ b/drivers/platform/mellanox/trio_regs.h -@@ -0,0 +1,236 @@ -+/* SPDX-License-Identifier: GPL-2.0 */ -+/* -+ * Copyright (c) 2019, Mellanox Technologies. All rights reserved. -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ */ -+#ifndef __TRIO_REGS_H__ -+#define __TRIO_REGS_H__ -+ -+#ifdef __ASSEMBLER__ -+#define _64bit(x) x -+#else /* __ASSEMBLER__ */ -+#define _64bit(x) x ## ULL -+#endif /* __ASSEMBLER */ -+ -+#include -+ -+#define L3C_PROF_RD_MISS__FIRST_WORD 0x0600 -+#define L3C_PROF_RD_MISS__LAST_WORD 0x063c -+#define L3C_PROF_RD_MISS__LENGTH 0x0040 -+#define L3C_PROF_RD_MISS__STRIDE 0x0004 -+ -+#define L3C_PROF_RD_MISS__LOW_ORDER_SHIFT 0 -+#define L3C_PROF_RD_MISS__LOW_ORDER_WIDTH 5 -+#define L3C_PROF_RD_MISS__LOW_ORDER_RESET_VAL 11 -+#define L3C_PROF_RD_MISS__LOW_ORDER_RMASK 0x1f -+#define L3C_PROF_RD_MISS__LOW_ORDER_MASK 0x1f -+ -+#define L3C_PROF_RD_MISS__HIGH_ORDER_SHIFT 5 -+#define L3C_PROF_RD_MISS__HIGH_ORDER_WIDTH 5 -+#define L3C_PROF_RD_MISS__HIGH_ORDER_RESET_VAL 0 -+#define L3C_PROF_RD_MISS__HIGH_ORDER_RMASK 0x1f -+#define L3C_PROF_RD_MISS__HIGH_ORDER_MASK 0x3e0 -+ -+#define L3C_PROF_RD_MISS__ALLOC_STATE_SHIFT 12 -+#define L3C_PROF_RD_MISS__ALLOC_STATE_WIDTH 1 -+#define L3C_PROF_RD_MISS__ALLOC_STATE_RESET_VAL 0 -+#define L3C_PROF_RD_MISS__ALLOC_STATE_RMASK 0x1 -+#define L3C_PROF_RD_MISS__ALLOC_STATE_MASK 0x1000 -+ -+#define L3C_PROF_RD_MISS__LOW_STATE_BLK_ALLOC_SHIFT 13 -+#define L3C_PROF_RD_MISS__LOW_STATE_BLK_ALLOC_WIDTH 1 -+#define L3C_PROF_RD_MISS__LOW_STATE_BLK_ALLOC_RESET_VAL 0 -+#define L3C_PROF_RD_MISS__LOW_STATE_BLK_ALLOC_RMASK 0x1 -+#define L3C_PROF_RD_MISS__LOW_STATE_BLK_ALLOC_MASK 0x2000 -+ -+#define L3C_PROF_RD_MISS__HIGH_STATE_BLK_ALLOC_SHIFT 14 -+#define L3C_PROF_RD_MISS__HIGH_STATE_BLK_ALLOC_WIDTH 1 -+#define L3C_PROF_RD_MISS__HIGH_STATE_BLK_ALLOC_RESET_VAL 0 -+#define L3C_PROF_RD_MISS__HIGH_STATE_BLK_ALLOC_RMASK 0x1 -+#define L3C_PROF_RD_MISS__HIGH_STATE_BLK_ALLOC_MASK 0x4000 -+ -+#define L3C_PROF_RD_MISS__PROB_SHIFT 16 -+#define L3C_PROF_RD_MISS__PROB_WIDTH 16 -+#define L3C_PROF_RD_MISS__PROB_RESET_VAL 0 -+#define L3C_PROF_RD_MISS__PROB_RMASK 0xffff -+#define L3C_PROF_RD_MISS__PROB_MASK 0xffff0000 -+ -+#define TRIO_DEV_CTL 0x0008 -+#define TRIO_DEV_CTL__LENGTH 0x0001 -+ -+#define TRIO_DEV_CTL__NDN_ROUTE_ORDER_SHIFT 0 -+#define TRIO_DEV_CTL__NDN_ROUTE_ORDER_WIDTH 1 -+#define TRIO_DEV_CTL__NDN_ROUTE_ORDER_RESET_VAL 0 -+#define TRIO_DEV_CTL__NDN_ROUTE_ORDER_RMASK 0x1 -+#define TRIO_DEV_CTL__NDN_ROUTE_ORDER_MASK 0x1 -+ -+#define TRIO_DEV_CTL__CDN_ROUTE_ORDER_SHIFT 1 -+#define TRIO_DEV_CTL__CDN_ROUTE_ORDER_WIDTH 1 -+#define TRIO_DEV_CTL__CDN_ROUTE_ORDER_RESET_VAL 1 -+#define TRIO_DEV_CTL__CDN_ROUTE_ORDER_RMASK 0x1 -+#define TRIO_DEV_CTL__CDN_ROUTE_ORDER_MASK 0x2 -+ -+#define TRIO_DEV_CTL__DDN_ROUTE_ORDER_SHIFT 2 -+#define TRIO_DEV_CTL__DDN_ROUTE_ORDER_WIDTH 1 -+#define TRIO_DEV_CTL__DDN_ROUTE_ORDER_RESET_VAL 1 -+#define TRIO_DEV_CTL__DDN_ROUTE_ORDER_RMASK 0x1 -+#define TRIO_DEV_CTL__DDN_ROUTE_ORDER_MASK 0x4 -+ -+#define TRIO_DEV_CTL__DMA_RD_CA_ENA_SHIFT 3 -+#define TRIO_DEV_CTL__DMA_RD_CA_ENA_WIDTH 1 -+#define TRIO_DEV_CTL__DMA_RD_CA_ENA_RESET_VAL 1 -+#define TRIO_DEV_CTL__DMA_RD_CA_ENA_RMASK 0x1 -+#define TRIO_DEV_CTL__DMA_RD_CA_ENA_MASK 0x8 -+ -+#define TRIO_DEV_CTL__L3_PROFILE_OVD_SHIFT 4 -+#define TRIO_DEV_CTL__L3_PROFILE_OVD_WIDTH 1 -+#define TRIO_DEV_CTL__L3_PROFILE_OVD_RESET_VAL 0 -+#define TRIO_DEV_CTL__L3_PROFILE_OVD_RMASK 0x1 -+#define TRIO_DEV_CTL__L3_PROFILE_OVD_MASK 0x10 -+ -+#define TRIO_DEV_CTL__L3_PROFILE_VAL_SHIFT 5 -+#define TRIO_DEV_CTL__L3_PROFILE_VAL_WIDTH 4 -+#define TRIO_DEV_CTL__L3_PROFILE_VAL_RESET_VAL 0 -+#define TRIO_DEV_CTL__L3_PROFILE_VAL_RMASK 0xf -+#define TRIO_DEV_CTL__L3_PROFILE_VAL_MASK 0x1e0 -+ -+#define TRIO_DEV_CTL__WR_SLVERR_MAP_SHIFT 9 -+#define TRIO_DEV_CTL__WR_SLVERR_MAP_WIDTH 2 -+#define TRIO_DEV_CTL__WR_SLVERR_MAP_RESET_VAL 2 -+#define TRIO_DEV_CTL__WR_SLVERR_MAP_RMASK 0x3 -+#define TRIO_DEV_CTL__WR_SLVERR_MAP_MASK 0x600 -+#define TRIO_DEV_CTL__WR_SLVERR_MAP_VAL_OKAY 0x0 -+#define TRIO_DEV_CTL__WR_SLVERR_MAP_VAL_DATAERROR 0x2 -+#define TRIO_DEV_CTL__WR_SLVERR_MAP_VAL_NONDATAERROR 0x3 -+ -+#define TRIO_DEV_CTL__WR_DECERR_MAP_SHIFT 11 -+#define TRIO_DEV_CTL__WR_DECERR_MAP_WIDTH 2 -+#define TRIO_DEV_CTL__WR_DECERR_MAP_RESET_VAL 3 -+#define TRIO_DEV_CTL__WR_DECERR_MAP_RMASK 0x3 -+#define TRIO_DEV_CTL__WR_DECERR_MAP_MASK 0x1800 -+#define TRIO_DEV_CTL__WR_DECERR_MAP_VAL_OKAY 0x0 -+#define TRIO_DEV_CTL__WR_DECERR_MAP_VAL_DATAERROR 0x2 -+#define TRIO_DEV_CTL__WR_DECERR_MAP_VAL_NONDATAERROR 0x3 -+ -+#define TRIO_DEV_CTL__RD_SLVERR_MAP_SHIFT 13 -+#define TRIO_DEV_CTL__RD_SLVERR_MAP_WIDTH 2 -+#define TRIO_DEV_CTL__RD_SLVERR_MAP_RESET_VAL 2 -+#define TRIO_DEV_CTL__RD_SLVERR_MAP_RMASK 0x3 -+#define TRIO_DEV_CTL__RD_SLVERR_MAP_MASK 0x6000 -+#define TRIO_DEV_CTL__RD_SLVERR_MAP_VAL_OKAY 0x0 -+#define TRIO_DEV_CTL__RD_SLVERR_MAP_VAL_DATAERROR 0x2 -+#define TRIO_DEV_CTL__RD_SLVERR_MAP_VAL_NONDATAERROR 0x3 -+ -+#define TRIO_DEV_CTL__RD_DECERR_MAP_SHIFT 15 -+#define TRIO_DEV_CTL__RD_DECERR_MAP_WIDTH 2 -+#define TRIO_DEV_CTL__RD_DECERR_MAP_RESET_VAL 3 -+#define TRIO_DEV_CTL__RD_DECERR_MAP_RMASK 0x3 -+#define TRIO_DEV_CTL__RD_DECERR_MAP_MASK 0x18000 -+#define TRIO_DEV_CTL__RD_DECERR_MAP_VAL_OKAY 0x0 -+#define TRIO_DEV_CTL__RD_DECERR_MAP_VAL_DATAERROR 0x2 -+#define TRIO_DEV_CTL__RD_DECERR_MAP_VAL_NONDATAERROR 0x3 -+ -+#define TRIO_DEV_CTL__CDN_REQ_BUF_ENA_SHIFT 17 -+#define TRIO_DEV_CTL__CDN_REQ_BUF_ENA_WIDTH 1 -+#define TRIO_DEV_CTL__CDN_REQ_BUF_ENA_RESET_VAL 1 -+#define TRIO_DEV_CTL__CDN_REQ_BUF_ENA_RMASK 0x1 -+#define TRIO_DEV_CTL__CDN_REQ_BUF_ENA_MASK 0x20000 -+ -+#define TRIO_DEV_CTL__DMA_WRQ_HWM_SHIFT 20 -+#define TRIO_DEV_CTL__DMA_WRQ_HWM_WIDTH 8 -+#define TRIO_DEV_CTL__DMA_WRQ_HWM_RESET_VAL 255 -+#define TRIO_DEV_CTL__DMA_WRQ_HWM_RMASK 0xff -+#define TRIO_DEV_CTL__DMA_WRQ_HWM_MASK 0xff00000 -+ -+#define TRIO_DEV_CTL__GTHR_DELAY_ADJ_SHIFT 28 -+#define TRIO_DEV_CTL__GTHR_DELAY_ADJ_WIDTH 4 -+#define TRIO_DEV_CTL__GTHR_DELAY_ADJ_RESET_VAL 0 -+#define TRIO_DEV_CTL__GTHR_DELAY_ADJ_RMASK 0xf -+#define TRIO_DEV_CTL__GTHR_DELAY_ADJ_MASK 0xf0000000 -+ -+#ifndef __ASSEMBLER__ -+__extension__ -+typedef union { -+ struct { -+ /* -+ * When 1, packets sent on the NDN will be routed x-first. -+ * When 0, packets will be routed y-first. This setting must -+ * match the setting in the Tiles. Devices may have -+ * additional interfaces with customized route-order settings -+ * used in addition to or instead of this field. -+ */ -+ u64 ndn_route_order : 1; -+ /* -+ * When 1, packets sent on the CDN will be routed x-first. -+ * When 0, packets will be routed y-first. This setting must -+ * match the setting in the Tiles. Devices may have -+ * additional interfaces with customized route-order settings -+ * used in addition to or instead of this field. -+ */ -+ u64 cdn_route_order : 1; -+ /* -+ * When 1, packets sent on the DDN will be routed x-first. -+ * When 0, packets will be routed y-first. This setting must -+ * match the setting in the Tiles. Devices may have -+ * additional interfaces with customized route-order settings -+ * used in addition to or instead of this field. -+ */ -+ u64 ddn_route_order : 1; -+ /* -+ * When 1, the ExpCompAck flow will be used on DMA reads -+ * which allows read-data-bypass for lower latency. Must only -+ * be changed if no DMA read traffic is inflight. -+ */ -+ u64 dma_rd_ca_ena : 1; -+ /* -+ * For devices with DMA. When 1, the L3 cache profile will be -+ * forced to L3_PROFILE_VAL. When 0, the L3 profile is -+ * selected by the device. -+ */ -+ u64 l3_profile_ovd : 1; -+ /* -+ * For devices with DMA. L3 cache profile to be used when -+ * L3_PROFILE_OVD is 1. -+ */ -+ u64 l3_profile_val : 4; -+ /* Write response mapping for MMIO slave errors */ -+ u64 wr_slverr_map : 2; -+ /* Write response mapping for MMIO decode errors */ -+ u64 wr_decerr_map : 2; -+ /* Read response mapping for MMIO slave errors */ -+ u64 rd_slverr_map : 2; -+ /* Read response mapping for MMIO decode errors */ -+ u64 rd_decerr_map : 2; -+ /* -+ * When 1, the CDN sync FIFO is allowed to back pressure -+ * until full to avoid retries and improve performance -+ */ -+ u64 cdn_req_buf_ena : 1; -+ /* Reserved. */ -+ u64 __reserved_0 : 2; -+ /* -+ * For diagnostics only. Block new traffic when WRQ_INFL -+ * count exceeds this threshold. This register field does not -+ * exist in the PKA or Tile or MSS. -+ */ -+ u64 dma_wrq_hwm : 8; -+ /* For diagnostics only. Adjust packet gather delay on RNF */ -+ u64 gthr_delay_adj : 4; -+ /* Reserved. */ -+ u64 __reserved_1 : 32; -+ }; -+ -+ u64 word; -+} TRIO_DEV_CTL_t; -+#endif /* !defined(__ASSEMBLER__) */ -+ -+#define TRIO_MMIO_ERROR_INFO 0x0608 -+ -+#define TRIO_MAP_ERR_STS 0x0810 -+ -+#define TRIO_TILE_PIO_CPL_ERR_STS 0x09f0 -+ -+#endif /* !defined(__TRIO_REGS_H__) */ --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0219-UBUNTU-SAUCE-platform-mellanox-mlxbf-tmfifo-Add-Blue.patch b/platform/mellanox/non-upstream-patches/patches/0219-UBUNTU-SAUCE-platform-mellanox-mlxbf-tmfifo-Add-Blue.patch deleted file mode 100644 index 2ca8f8617f2e..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0219-UBUNTU-SAUCE-platform-mellanox-mlxbf-tmfifo-Add-Blue.patch +++ /dev/null @@ -1,245 +0,0 @@ -From 9a21e6cf3c87954516a7933539fbcb5b373f9fa2 Mon Sep 17 00:00:00 2001 -From: Liming Sun -Date: Sun, 26 Jun 2022 01:10:07 -0400 -Subject: [PATCH backport 5.10 20/63] UBUNTU: SAUCE: platform/mellanox: - mlxbf-tmfifo: Add BlueField-3 support - -BugLink: https://launchpad.net/bugs/1980847 - -This commit adds BlueField-3 support which has different resource -mapping and is identified by the ACPI UID. - -Signed-off-by: Liming Sun -Change-Id: I104472a89741c1083168bacb4a7652c7767cceff -Signed-off-by: Ike Panhc ---- - drivers/platform/mellanox/mlxbf-tmfifo-regs.h | 10 +++ - drivers/platform/mellanox/mlxbf-tmfifo.c | 82 ++++++++++++++----- - 2 files changed, 70 insertions(+), 22 deletions(-) - -diff --git a/drivers/platform/mellanox/mlxbf-tmfifo-regs.h b/drivers/platform/mellanox/mlxbf-tmfifo-regs.h -index e4f0d2eda..1358dad0c 100644 ---- a/drivers/platform/mellanox/mlxbf-tmfifo-regs.h -+++ b/drivers/platform/mellanox/mlxbf-tmfifo-regs.h -@@ -60,4 +60,14 @@ - #define MLXBF_TMFIFO_RX_CTL__MAX_ENTRIES_RMASK GENMASK_ULL(8, 0) - #define MLXBF_TMFIFO_RX_CTL__MAX_ENTRIES_MASK GENMASK_ULL(40, 32) - -+/* BF3 resource 0 register offset. */ -+#define MLXBF_TMFIFO_RX_DATA_BF3 0x0000 -+#define MLXBF_TMFIFO_TX_DATA_BF3 0x1000 -+ -+/* BF3 resource 1 register offset. */ -+#define MLXBF_TMFIFO_RX_STS_BF3 0x0000 -+#define MLXBF_TMFIFO_RX_CTL_BF3 0x0008 -+#define MLXBF_TMFIFO_TX_STS_BF3 0x0100 -+#define MLXBF_TMFIFO_TX_CTL_BF3 0x0108 -+ - #endif /* !defined(__MLXBF_TMFIFO_REGS_H__) */ -diff --git a/drivers/platform/mellanox/mlxbf-tmfifo.c b/drivers/platform/mellanox/mlxbf-tmfifo.c -index 38800e86e..f401bbbd0 100644 ---- a/drivers/platform/mellanox/mlxbf-tmfifo.c -+++ b/drivers/platform/mellanox/mlxbf-tmfifo.c -@@ -47,6 +47,9 @@ - /* Message with data needs at least two words (for header & data). */ - #define MLXBF_TMFIFO_DATA_MIN_WORDS 2 - -+/* ACPI chip identifier for BlueField-3. */ -+#define MLXBF_TMFIFO_BF3_UID "1" -+ - struct mlxbf_tmfifo; - - /** -@@ -140,8 +143,14 @@ struct mlxbf_tmfifo_irq_info { - * mlxbf_tmfifo - Structure of the TmFifo - * @vdev: array of the virtual devices running over the TmFifo - * @lock: lock to protect the TmFifo access -- * @rx_base: mapped register base address for the Rx FIFO -- * @tx_base: mapped register base address for the Tx FIFO -+ * @res0: mapped register base for resource 0 -+ * @res1: mapped register base for resource 1 -+ * @rx_ctl: TMFIFO_RX_CTL register -+ * @rx_sts: TMFIFO_RX_STS register -+ * @rx_data: TMFIFO_RX_DATA register -+ * @tx_ctl: TMFIFO_TX_CTL register -+ * @tx_sts: TMFIFO_TX_STS register -+ * @tx_data: TMFIFO_TX_DATA register - * @rx_fifo_size: number of entries of the Rx FIFO - * @tx_fifo_size: number of entries of the Tx FIFO - * @pend_events: pending bits for deferred events -@@ -155,8 +164,14 @@ struct mlxbf_tmfifo_irq_info { - struct mlxbf_tmfifo { - struct mlxbf_tmfifo_vdev *vdev[MLXBF_TMFIFO_VDEV_MAX]; - struct mutex lock; /* TmFifo lock */ -- void __iomem *rx_base; -- void __iomem *tx_base; -+ void __iomem *res0; -+ void __iomem *res1; -+ void __iomem *rx_ctl; -+ void __iomem *rx_sts; -+ void __iomem *rx_data; -+ void __iomem *tx_ctl; -+ void __iomem *tx_sts; -+ void __iomem *tx_data; - int rx_fifo_size; - int tx_fifo_size; - unsigned long pend_events; -@@ -472,7 +487,7 @@ static int mlxbf_tmfifo_get_rx_avail(struct mlxbf_tmfifo *fifo) - { - u64 sts; - -- sts = readq(fifo->rx_base + MLXBF_TMFIFO_RX_STS); -+ sts = readq(fifo->rx_sts); - return FIELD_GET(MLXBF_TMFIFO_RX_STS__COUNT_MASK, sts); - } - -@@ -489,7 +504,7 @@ static int mlxbf_tmfifo_get_tx_avail(struct mlxbf_tmfifo *fifo, int vdev_id) - else - tx_reserve = 1; - -- sts = readq(fifo->tx_base + MLXBF_TMFIFO_TX_STS); -+ sts = readq(fifo->tx_sts); - count = FIELD_GET(MLXBF_TMFIFO_TX_STS__COUNT_MASK, sts); - return fifo->tx_fifo_size - tx_reserve - count; - } -@@ -525,7 +540,7 @@ static void mlxbf_tmfifo_console_tx(struct mlxbf_tmfifo *fifo, int avail) - /* Write header. */ - hdr.type = VIRTIO_ID_CONSOLE; - hdr.len = htons(size); -- writeq(*(u64 *)&hdr, fifo->tx_base + MLXBF_TMFIFO_TX_DATA); -+ writeq(*(u64 *)&hdr, fifo->tx_data); - - /* Use spin-lock to protect the 'cons->tx_buf'. */ - spin_lock_irqsave(&fifo->spin_lock[0], flags); -@@ -542,7 +557,7 @@ static void mlxbf_tmfifo_console_tx(struct mlxbf_tmfifo *fifo, int avail) - memcpy((u8 *)&data + seg, cons->tx_buf.buf, - sizeof(u64) - seg); - } -- writeq(data, fifo->tx_base + MLXBF_TMFIFO_TX_DATA); -+ writeq(data, fifo->tx_data); - - if (size >= sizeof(u64)) { - cons->tx_buf.tail = (cons->tx_buf.tail + sizeof(u64)) % -@@ -573,7 +588,7 @@ static void mlxbf_tmfifo_rxtx_word(struct mlxbf_tmfifo_vring *vring, - - /* Read a word from FIFO for Rx. */ - if (is_rx) -- data = readq(fifo->rx_base + MLXBF_TMFIFO_RX_DATA); -+ data = readq(fifo->rx_data); - - if (vring->cur_len + sizeof(u64) <= len) { - /* The whole word. */ -@@ -595,7 +610,7 @@ static void mlxbf_tmfifo_rxtx_word(struct mlxbf_tmfifo_vring *vring, - - /* Write the word into FIFO for Tx. */ - if (!is_rx) -- writeq(data, fifo->tx_base + MLXBF_TMFIFO_TX_DATA); -+ writeq(data, fifo->tx_data); - } - - /* -@@ -617,7 +632,7 @@ static void mlxbf_tmfifo_rxtx_header(struct mlxbf_tmfifo_vring *vring, - /* Read/Write packet header. */ - if (is_rx) { - /* Drain one word from the FIFO. */ -- *(u64 *)&hdr = readq(fifo->rx_base + MLXBF_TMFIFO_RX_DATA); -+ *(u64 *)&hdr = readq(fifo->rx_data); - - /* Skip the length 0 packets (keepalive). */ - if (hdr.len == 0) -@@ -661,7 +676,7 @@ static void mlxbf_tmfifo_rxtx_header(struct mlxbf_tmfifo_vring *vring, - hdr.type = (vring->vdev_id == VIRTIO_ID_NET) ? - VIRTIO_ID_NET : VIRTIO_ID_CONSOLE; - hdr.len = htons(vring->pkt_len - hdr_len); -- writeq(*(u64 *)&hdr, fifo->tx_base + MLXBF_TMFIFO_TX_DATA); -+ writeq(*(u64 *)&hdr, fifo->tx_data); - } - - vring->cur_len = hdr_len; -@@ -1155,7 +1170,7 @@ static void mlxbf_tmfifo_set_threshold(struct mlxbf_tmfifo *fifo) - u64 ctl; - - /* Get Tx FIFO size and set the low/high watermark. */ -- ctl = readq(fifo->tx_base + MLXBF_TMFIFO_TX_CTL); -+ ctl = readq(fifo->tx_ctl); - fifo->tx_fifo_size = - FIELD_GET(MLXBF_TMFIFO_TX_CTL__MAX_ENTRIES_MASK, ctl); - ctl = (ctl & ~MLXBF_TMFIFO_TX_CTL__LWM_MASK) | -@@ -1164,17 +1179,17 @@ static void mlxbf_tmfifo_set_threshold(struct mlxbf_tmfifo *fifo) - ctl = (ctl & ~MLXBF_TMFIFO_TX_CTL__HWM_MASK) | - FIELD_PREP(MLXBF_TMFIFO_TX_CTL__HWM_MASK, - fifo->tx_fifo_size - 1); -- writeq(ctl, fifo->tx_base + MLXBF_TMFIFO_TX_CTL); -+ writeq(ctl, fifo->tx_ctl); - - /* Get Rx FIFO size and set the low/high watermark. */ -- ctl = readq(fifo->rx_base + MLXBF_TMFIFO_RX_CTL); -+ ctl = readq(fifo->rx_ctl); - fifo->rx_fifo_size = - FIELD_GET(MLXBF_TMFIFO_RX_CTL__MAX_ENTRIES_MASK, ctl); - ctl = (ctl & ~MLXBF_TMFIFO_RX_CTL__LWM_MASK) | - FIELD_PREP(MLXBF_TMFIFO_RX_CTL__LWM_MASK, 0); - ctl = (ctl & ~MLXBF_TMFIFO_RX_CTL__HWM_MASK) | - FIELD_PREP(MLXBF_TMFIFO_RX_CTL__HWM_MASK, 1); -- writeq(ctl, fifo->rx_base + MLXBF_TMFIFO_RX_CTL); -+ writeq(ctl, fifo->rx_ctl); - } - - static void mlxbf_tmfifo_cleanup(struct mlxbf_tmfifo *fifo) -@@ -1194,9 +1209,15 @@ static int mlxbf_tmfifo_probe(struct platform_device *pdev) - { - struct virtio_net_config net_config; - struct device *dev = &pdev->dev; -+ struct acpi_device *device; - struct mlxbf_tmfifo *fifo; -+ const char *uid; - int i, rc; - -+ device = ACPI_COMPANION(dev); -+ if (!device) -+ return -ENODEV; -+ - fifo = devm_kzalloc(dev, sizeof(*fifo), GFP_KERNEL); - if (!fifo) - return -ENOMEM; -@@ -1207,14 +1228,31 @@ static int mlxbf_tmfifo_probe(struct platform_device *pdev) - mutex_init(&fifo->lock); - - /* Get the resource of the Rx FIFO. */ -- fifo->rx_base = devm_platform_ioremap_resource(pdev, 0); -- if (IS_ERR(fifo->rx_base)) -- return PTR_ERR(fifo->rx_base); -+ fifo->res0 = devm_platform_ioremap_resource(pdev, 0); -+ if (IS_ERR(fifo->res0)) -+ return PTR_ERR(fifo->res0); - - /* Get the resource of the Tx FIFO. */ -- fifo->tx_base = devm_platform_ioremap_resource(pdev, 1); -- if (IS_ERR(fifo->tx_base)) -- return PTR_ERR(fifo->tx_base); -+ fifo->res1 = devm_platform_ioremap_resource(pdev, 1); -+ if (IS_ERR(fifo->res1)) -+ return PTR_ERR(fifo->res1); -+ -+ uid = acpi_device_uid(device); -+ if (uid && !strcmp(uid, MLXBF_TMFIFO_BF3_UID)) { -+ fifo->rx_data = fifo->res0 + MLXBF_TMFIFO_RX_DATA_BF3; -+ fifo->tx_data = fifo->res0 + MLXBF_TMFIFO_TX_DATA_BF3; -+ fifo->rx_sts = fifo->res1 + MLXBF_TMFIFO_RX_STS_BF3; -+ fifo->rx_ctl = fifo->res1 + MLXBF_TMFIFO_RX_CTL_BF3; -+ fifo->tx_sts = fifo->res1 + MLXBF_TMFIFO_TX_STS_BF3; -+ fifo->tx_ctl = fifo->res1 + MLXBF_TMFIFO_TX_CTL_BF3; -+ } else { -+ fifo->rx_ctl = fifo->res0 + MLXBF_TMFIFO_RX_CTL; -+ fifo->rx_sts = fifo->res0 + MLXBF_TMFIFO_RX_STS; -+ fifo->rx_data = fifo->res0 + MLXBF_TMFIFO_RX_DATA; -+ fifo->tx_ctl = fifo->res1 + MLXBF_TMFIFO_TX_CTL; -+ fifo->tx_sts = fifo->res1 + MLXBF_TMFIFO_TX_STS; -+ fifo->tx_data = fifo->res1 + MLXBF_TMFIFO_TX_DATA; -+ } - - platform_set_drvdata(pdev, fifo); - --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0220-UBUNTU-SAUCE-pka-Add-pka-driver.patch b/platform/mellanox/non-upstream-patches/patches/0220-UBUNTU-SAUCE-pka-Add-pka-driver.patch deleted file mode 100644 index 9cf8e26254d1..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0220-UBUNTU-SAUCE-pka-Add-pka-driver.patch +++ /dev/null @@ -1,10218 +0,0 @@ -From c1e48283efef4faeee6b601fc679ea228bd8d6ef Mon Sep 17 00:00:00 2001 -From: Mahantesh Salimath -Date: Thu, 30 Jun 2022 16:46:50 -0400 -Subject: [PATCH backport 5.10 21/63] UBUNTU: SAUCE: pka: Add pka driver. - -BugLink: https://bugs.launchpad.net/bugs/1980415 - -* This driver is picked from internal linux repo;bfdev-5.4.60 branch. - For commit history, please refer to above repo and branch. - -Signed-off-by: Mahantesh Salimath -Reviewed-by: Khalil Blaiech -Signed-off-by: Mahantesh Salimath -Signed-off-by: Ike Panhc ---- - drivers/platform/mellanox/Kconfig | 2 + - drivers/platform/mellanox/Makefile | 1 + - drivers/platform/mellanox/mlxbf_pka/Kconfig | 14 + - drivers/platform/mellanox/mlxbf_pka/Makefile | 9 + - .../mellanox/mlxbf_pka/mlxbf_pka_addrs.h | 284 + - .../mellanox/mlxbf_pka/mlxbf_pka_config.h | 226 + - .../mellanox/mlxbf_pka/mlxbf_pka_cpu.h | 72 + - .../mellanox/mlxbf_pka/mlxbf_pka_debug.h | 66 + - .../mellanox/mlxbf_pka/mlxbf_pka_dev.c | 2414 +++++++++ - .../mellanox/mlxbf_pka/mlxbf_pka_dev.h | 310 ++ - .../mellanox/mlxbf_pka/mlxbf_pka_drv.c | 1398 +++++ - .../mellanox/mlxbf_pka/mlxbf_pka_firmware.h | 4823 +++++++++++++++++ - .../mellanox/mlxbf_pka/mlxbf_pka_ioctl.h | 127 + - .../mellanox/mlxbf_pka/mlxbf_pka_mmio.h | 49 + - .../mellanox/mlxbf_pka/mlxbf_pka_ring.h | 276 + - 15 files changed, 10071 insertions(+) - create mode 100644 drivers/platform/mellanox/mlxbf_pka/Kconfig - create mode 100644 drivers/platform/mellanox/mlxbf_pka/Makefile - create mode 100644 drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_addrs.h - create mode 100644 drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_config.h - create mode 100644 drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_cpu.h - create mode 100644 drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_debug.h - create mode 100644 drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_dev.c - create mode 100644 drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_dev.h - create mode 100644 drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_drv.c - create mode 100644 drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_firmware.h - create mode 100644 drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_ioctl.h - create mode 100644 drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_mmio.h - create mode 100644 drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_ring.h - -diff --git a/drivers/platform/mellanox/Kconfig b/drivers/platform/mellanox/Kconfig -index 5d329350a..946bc2375 100644 ---- a/drivers/platform/mellanox/Kconfig -+++ b/drivers/platform/mellanox/Kconfig -@@ -97,6 +97,8 @@ config MLXBF_TRIO - This driver supports the TRIO PCIe root complex interface on - Mellanox BlueField SoCs. - -+source "drivers/platform/mellanox/mlxbf_pka/Kconfig" -+ - config NVSW_SN2201 - tristate "Nvidia SN2201 platform driver support" - depends on REGMAP -diff --git a/drivers/platform/mellanox/Makefile b/drivers/platform/mellanox/Makefile -index a0a073adb..d89931e36 100644 ---- a/drivers/platform/mellanox/Makefile -+++ b/drivers/platform/mellanox/Makefile -@@ -9,5 +9,6 @@ obj-$(CONFIG_MLXBF_TMFIFO) += mlxbf-tmfifo.o - obj-$(CONFIG_MLXBF_TRIO) += mlx-trio.o - obj-$(CONFIG_MLXREG_HOTPLUG) += mlxreg-hotplug.o - obj-$(CONFIG_MLXREG_IO) += mlxreg-io.o -+obj-$(CONFIG_MLXBF_PKA) += mlxbf_pka/ - obj-$(CONFIG_MLXREG_LC) += mlxreg-lc.o - obj-$(CONFIG_NVSW_SN2201) += nvsw-sn2201.o -diff --git a/drivers/platform/mellanox/mlxbf_pka/Kconfig b/drivers/platform/mellanox/mlxbf_pka/Kconfig -new file mode 100644 -index 000000000..ebc038ec7 ---- /dev/null -+++ b/drivers/platform/mellanox/mlxbf_pka/Kconfig -@@ -0,0 +1,14 @@ -+# SPDX-License-Identifier: GPL-2.0-only OR Linux-OpenIB -+# -+# Platform support for Mellanox BlueField PKA -+# -+ -+config MLXBF_PKA -+ tristate "Mellanox BlueField Public Key Accelerator driver" -+ depends on ARM64 && IOMMU_API && VFIO_IOMMU_TYPE1 && VFIO_PLATFORM -+ help -+ If you say yes to this option, support will be included for the -+ Public Key Accelerator device on Mellanox BlueField SoCs. -+ -+ This driver can also be built as a module. If so, the module will -+ be called pka-mlxbf. -diff --git a/drivers/platform/mellanox/mlxbf_pka/Makefile b/drivers/platform/mellanox/mlxbf_pka/Makefile -new file mode 100644 -index 000000000..d9f5be4d6 ---- /dev/null -+++ b/drivers/platform/mellanox/mlxbf_pka/Makefile -@@ -0,0 +1,9 @@ -+# SPDX-License-Identifier: GPL-2.0-only OR Linux-OpenIB -+# -+# Makefile for Mellanox BlueField PKA Driver -+# -+ -+obj-m += mlxbf-pka.o -+ -+mlxbf-pka-y := mlxbf_pka_drv.o -+mlxbf-pka-y += mlxbf_pka_dev.o -diff --git a/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_addrs.h b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_addrs.h -new file mode 100644 -index 000000000..cd2a4d814 ---- /dev/null -+++ b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_addrs.h -@@ -0,0 +1,284 @@ -+// -+// BSD LICENSE -+// -+// Copyright(c) 2016 Mellanox Technologies, Ltd. All rights reserved. -+// All rights reserved. -+// -+// Redistribution and use in source and binary forms, with or without -+// modification, are permitted provided that the following conditions -+// are met: -+// -+// * Redistributions of source code must retain the above copyright -+// notice, this list of conditions and the following disclaimer. -+// * Redistributions in binary form must reproduce the above copyright -+// notice, this list of conditions and the following disclaimer in -+// the documentation and/or other materials provided with the -+// distribution. -+// * Neither the name of Mellanox Technologies nor the names of its -+// contributors may be used to endorse or promote products derived -+// from this software without specific prior written permission. -+// -+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+// -+ -+#ifndef __PKA_ADDRS_H__ -+#define __PKA_ADDRS_H__ -+ -+// Define memory size in bytes -+#define MEM_SIZE_4KB 0x1000 -+#define MEM_SIZE_8KB 0x2000 -+#define MEM_SIZE_16KB 0x4000 -+#define MEM_SIZE_32KB 0x8000 -+#define MEM_SIZE_64KB 0x10000 -+ -+// -+// COMMON SPACE -+// -+#define CRYPTO_COMMON_BASE 0x0 -+ -+// Common IO CSR addresses/offsets: These are all addressed as 8-byte registers. -+#define DEV_INFO_ADDR (0x00 | CRYPTO_COMMON_BASE) -+#define DEV_CTL_ADDR (0x08 | CRYPTO_COMMON_BASE) -+#define MMIO_INFO_ADDR (0x10 | CRYPTO_COMMON_BASE) -+#define SCRATCHPAD_ADDR (0x20 | CRYPTO_COMMON_BASE) -+#define SEMAPHORE0_ADDR (0x28 | CRYPTO_COMMON_BASE) -+#define SEMAPHORE1_ADDR (0x30 | CRYPTO_COMMON_BASE) -+#define CLOCK_COUNT_ADDR (0x38 | CRYPTO_COMMON_BASE) -+#define INT_SETUP_ADDR (0x40 | CRYPTO_COMMON_BASE) -+#define CRED_CTL_ADDR (0x50 | CRYPTO_COMMON_BASE) -+#define SAM_CTL_ADDR (0x58 | CRYPTO_COMMON_BASE) -+ -+// -+// CRYPTO SPACE -+// -+ -+// All addresses/offsets herein are BYTE addresses. -+ -+// EIP154 CSRS: -+ -+// Global Control Space CSR addresses/offsets. These are accessed from the -+// ARM as 8 byte reads/writes however only the bottom 32 bits are implemented. -+#define PKA_CLOCK_SWITCH_ADDR 0x11C68 -+#define PKA_CLK_FORCE_ADDR 0x11C80 -+#define MODE_SELECTION_ADDR 0x11C88 -+#define PKA_PROT_STATUS_ADDR 0x11C90 -+#define PKA_OPTIONS_ADDR 0x11DF0 -+#define PKA_VERSION_ADDR 0x11DF8 -+ -+// Advanced Interrupt Controller CSR addresses/offsets. These are accessed -+// from the ARM as 8 byte reads/writes however only the bottom 32 bits are -+// implemented. -+#define AIC_POL_CTRL_ADDR 0x11E00 -+#define AIC_TYPE_CTRL_ADDR 0x11E08 -+#define AIC_ENABLE_CTRL_ADDR 0x11E10 -+#define AIC_RAW_STAT_ADDR 0x11E18 -+#define AIC_ENABLE_SET_ADDR 0x11E18 -+#define AIC_ENABLED_STAT_ADDR 0x11E20 -+#define AIC_ACK_ADDR 0x11E20 -+#define AIC_ENABLE_CLR_ADDR 0x11E28 -+#define AIC_OPTIONS_ADDR 0x11E30 -+#define AIC_VERSION_ADDR 0x11E38 -+ -+// The True Random Number Generator CSR addresses/offsets. These are accessed -+// from the ARM as 8 byte reads/writes however only the bottom 32 bits are -+// implemented. -+#define TRNG_OUTPUT_0_ADDR 0x12000 -+#define TRNG_OUTPUT_1_ADDR 0x12008 -+#define TRNG_OUTPUT_2_ADDR 0x12010 -+#define TRNG_OUTPUT_3_ADDR 0x12018 -+#define TRNG_STATUS_ADDR 0x12020 -+#define TRNG_INTACK_ADDR 0x12020 -+#define TRNG_CONTROL_ADDR 0x12028 -+#define TRNG_CONFIG_ADDR 0x12030 -+#define TRNG_ALARMCNT_ADDR 0x12038 -+#define TRNG_FROENABLE_ADDR 0x12040 -+#define TRNG_FRODETUNE_ADDR 0x12048 -+#define TRNG_ALARMMASK_ADDR 0x12050 -+#define TRNG_ALARMSTOP_ADDR 0x12058 -+#define TRNG_BLOCKCNT_ADDR 0x120E8 -+#define TRNG_OPTIONS_ADDR 0x120F0 -+#define TRNG_TEST_ADDR 0x120E0 -+#define TRNG_RAW_L_ADDR 0x12060 -+#define TRNG_RAW_H_ADDR 0x12068 -+#define TRNG_RUN_CNT_ADDR 0x12080 -+#define TRNG_MONOBITCNT_ADDR 0x120B8 -+#define TRNG_POKER_3_0_ADDR 0x120C0 -+#define TRNG_POKER_7_4 0x120C8 -+#define TRNG_POKER_B_8 0x120D0 -+#define TRNG_POKER_F_C 0x120D8 -+ -+#define TRNG_PS_AI_0_ADDR 0x12080 -+#define TRNG_PS_AI_1_ADDR 0x12088 -+#define TRNG_PS_AI_2_ADDR 0x12090 -+#define TRNG_PS_AI_3_ADDR 0x12098 -+#define TRNG_PS_AI_4_ADDR 0x120A0 -+#define TRNG_PS_AI_5_ADDR 0x120A8 -+#define TRNG_PS_AI_6_ADDR 0x120B0 -+#define TRNG_PS_AI_7_ADDR 0x120B8 -+#define TRNG_PS_AI_8_ADDR 0x120C0 -+#define TRNG_PS_AI_9_ADDR 0x120C8 -+#define TRNG_PS_AI_10_ADDR 0x120D0 -+#define TRNG_PS_AI_11_ADDR 0x120D8 -+ -+// Control register address/offset. This is accessed from the ARM using 8 -+// byte reads/writes however only the bottom 32 bits are implemented. -+#define PKA_MASTER_SEQ_CTRL_ADDR 0x27F90 -+ -+// Ring CSRs: These are all accessed from the ARM using 8 byte reads/writes -+// however only the bottom 32 bits are implemented. -+ -+// Ring 0 CSRS -+#define COMMAND_COUNT_0_ADDR 0x80080 -+#define RESULT_COUNT_0_ADDR 0x80088 -+#define IRQ_THRESH_0_ADDR 0x80090 -+ -+// Ring 1 CSRS: -+#define COMMAND_COUNT_1_ADDR 0x90080 -+#define RESULT_COUNT_1_ADDR 0x90088 -+#define IRQ_THRESH_1_ADDR 0x90090 -+ -+// Ring 2 CSRS: -+#define COMMAND_COUNT_2_ADDR 0xA0080 -+#define RESULT_COUNT_2_ADDR 0xA0088 -+#define IRQ_THRESH_2_ADDR 0xA0090 -+ -+// Ring 3 CSRS: -+#define COMMAND_COUNT_3_ADDR 0xB0080 -+#define RESULT_COUNT_3_ADDR 0xB0088 -+#define IRQ_THRESH_3_ADDR 0xB0090 -+ -+// EIP154 RAM regions: Note that the FARM_PROG_RAM_X address range overlaps -+// with the FARM_DATA_RAM_X and FARM_DATA_RAM_X_EXT address ranges. This -+// conflict is resolved by using the FARM_PROG_RAM_X only when the -+// Sequencer is in SW reset, and the DATA_RAMs are picked only when the -+// engine is operation. -+// -+// Note: -+// The FARM_DATA_RAM_X_EXT RAMs may also be -+// called the LNME FIFO RAMs in some of the documentation. -+// -+// PKA_BUFFER_RAM : 1024 x 64 - 8K bytes -+// PKA_SECURE_RAM : 1536 x 64 - 12K bytes -+// PKA_MASTER_PROG_RAM : 8192 x 32 - 32K bytes -+// FARM_DATA_RAM_X : 1024 x 64 - 8K bytes -+// FARM_DATA_RAM_X_EXT : 256 x 32 - 1K bytes -+// FARM_PROG_RAM_X : 2048 x 32 - 8K bytes -+// -+// Note: -+// *TBD* Since hardware guys multiplied the address per 2, the size of -+// each memory/registers group increased and become two times larger. -+// Memory size should be adjusted accordingly: -+// PKA Buffer RAM size : 8KB --> 16KB -+// PKA Secure RAM size : 8KB --> 16KB -+// PKA Master Program RAM size : 32KB --> 64KB -+// PKA Farm Data RAM size : 4KB --> 8KB -+// PKA Farm Data RAM extension size : 4KB --> 8KB -+// PKA Farm Program RAM size : 8KB --> 16KB -+// -+#define PKA_BUFFER_RAM_BASE 0x00000 -+#define PKA_BUFFER_RAM_SIZE MEM_SIZE_16KB // 0x00000...0x03FFF -+ -+#define PKA_SECURE_RAM_BASE 0x20000 -+#define PKA_SECURE_RAM_SIZE MEM_SIZE_16KB // 0x20000...0x23FFF -+ -+#define PKA_MASTER_PROG_RAM_BASE 0x30000 -+#define PKA_MASTER_PROG_RAM_SIZE MEM_SIZE_64KB // 0x30000...0x3FFFF -+ -+#define FARM_DATA_RAM_0_BASE 0x40000 -+#define FARM_DATA_RAM_0_SIZE MEM_SIZE_8KB // 0x40000...0x41FFF -+#define FARM_DATA_RAM_0_EXT_BASE 0x42000 -+#define FARM_DATA_RAM_0_EXT_SIZE MEM_SIZE_8KB // 0x42000...0x43FFF -+#define FARM_PROG_RAM_0_BASE 0x40000 -+#define FARM_PROG_RAM_0_SIZE MEM_SIZE_16KB // 0x40000...0x43FFF -+#define FARM_DATA_RAM_1_BASE 0x44000 -+#define FARM_DATA_RAM_1_SIZE MEM_SIZE_8KB // 0x44000...0x45FFF -+#define FARM_DATA_RAM_1_EXT_BASE 0x46000 -+#define FARM_DATA_RAM_1_EXT_SIZE MEM_SIZE_8KB // 0x46000...0x47FFF -+#define FARM_PROG_RAM_1_BASE 0x44000 -+#define FARM_PROG_RAM_1_SIZE MEM_SIZE_16KB // 0x44000...0x47FFF -+#define FARM_DATA_RAM_2_BASE 0x48000 -+#define FARM_DATA_RAM_2_SIZE MEM_SIZE_8KB // 0x48000...0x49FFF -+#define FARM_DATA_RAM_2_EXT_BASE 0x4A000 -+#define FARM_DATA_RAM_2_EXT_SIZE MEM_SIZE_8KB // 0x4A000...0x4BFFF -+#define FARM_PROG_RAM_2_BASE 0x48000 -+#define FARM_PROG_RAM_2_SIZE MEM_SIZE_16KB // 0x48000...0x4BFFF -+#define FARM_DATA_RAM_3_BASE 0x4C000 -+#define FARM_DATA_RAM_3_SIZE MEM_SIZE_8KB // 0x4C000...0x4DFFF -+#define FARM_DATA_RAM_3_EXT_BASE 0x4E000 -+#define FARM_DATA_RAM_3_EXT_SIZE MEM_SIZE_8KB // 0x4E000...0x4FFFF -+#define FARM_PROG_RAM_3_BASE 0x4C000 -+#define FARM_PROG_RAM_3_SIZE MEM_SIZE_16KB // 0x4C000...0x4FFFF -+#define FARM_DATA_RAM_4_BASE 0x50000 -+#define FARM_DATA_RAM_4_SIZE MEM_SIZE_8KB // 0x50000...0x51FFF -+#define FARM_DATA_RAM_4_EXT_BASE 0x52000 -+#define FARM_DATA_RAM_4_EXT_SIZE MEM_SIZE_8KB // 0x52000...0x53FFF -+#define FARM_PROG_RAM_4_BASE 0x50000 -+#define FARM_PROG_RAM_4_SIZE MEM_SIZE_16KB // 0x50000...0x53FFF -+#define FARM_DATA_RAM_5_BASE 0x54000 -+#define FARM_DATA_RAM_5_SIZE MEM_SIZE_8KB // 0x54000...0x55FFF -+#define FARM_DATA_RAM_5_EXT_BASE 0x56000 -+#define FARM_DATA_RAM_5_EXT_SIZE MEM_SIZE_8KB // 0x56000...0x57FFF -+#define FARM_PROG_RAM_5_BASE 0x54000 -+#define FARM_PROG_RAM_5_SIZE MEM_SIZE_16KB // 0x54000...0x57FFF -+ -+// PKA Buffer RAM offsets. These are NOT real CSR's but instead are -+// specific offset/addresses within the EIP154 PKA_BUFFER_RAM. -+ -+// Ring 0: -+#define RING_CMMD_BASE_0_ADDR 0x00000 -+#define RING_RSLT_BASE_0_ADDR 0x00010 -+#define RING_SIZE_TYPE_0_ADDR 0x00020 -+#define RING_RW_PTRS_0_ADDR 0x00028 -+#define RING_RW_STAT_0_ADDR 0x00030 -+ -+// Ring 1 -+#define RING_CMMD_BASE_1_ADDR 0x00040 -+#define RING_RSLT_BASE_1_ADDR 0x00050 -+#define RING_SIZE_TYPE_1_ADDR 0x00060 -+#define RING_RW_PTRS_1_ADDR 0x00068 -+#define RING_RW_STAT_1_ADDR 0x00070 -+ -+// Ring 2 -+#define RING_CMMD_BASE_2_ADDR 0x00080 -+#define RING_RSLT_BASE_2_ADDR 0x00090 -+#define RING_SIZE_TYPE_2_ADDR 0x000A0 -+#define RING_RW_PTRS_2_ADDR 0x000A8 -+#define RING_RW_STAT_2_ADDR 0x000B0 -+ -+// Ring 3 -+#define RING_CMMD_BASE_3_ADDR 0x000C0 -+#define RING_RSLT_BASE_3_ADDR 0x000D0 -+#define RING_SIZE_TYPE_3_ADDR 0x000E0 -+#define RING_RW_PTRS_3_ADDR 0x000E8 -+#define RING_RW_STAT_3_ADDR 0x000F0 -+ -+// Ring Options -+#define PKA_RING_OPTIONS_ADDR 0x07FF8 -+ -+// Alternate Window RAM size -+#define PKA_WINDOW_RAM_REGION_SIZE MEM_SIZE_16KB -+ -+// Currently, we do not use these MiCA specific CSRs. -+ -+// The PKI (not EIP154) CSR address/offsets: These are all addressed as -+// 8-byte registers. -+#define PKA_INT_MASK_ADDR 0x00 -+#define PKA_INT_MASK_SET_ADDR 0x08 -+#define PKA_INT_MASK_RESET_ADDR 0x10 -+#define PKA_ZEROIZE_ADDR 0x40 -+#define TST_FRO_ADDR 0x50 -+#define FRO_COUNT_ADDR 0x58 -+#define PKA_PARITY_CTL_ADDR 0x60 -+#define PKA_PARITY_STAT_ADDR 0x68 -+ -+#endif // __PKA_ADDRS_H__ -diff --git a/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_config.h b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_config.h -new file mode 100644 -index 000000000..5b69d55be ---- /dev/null -+++ b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_config.h -@@ -0,0 +1,226 @@ -+// -+// BSD LICENSE -+// -+// Copyright(c) 2016 Mellanox Technologies, Ltd. All rights reserved. -+// All rights reserved. -+// -+// Redistribution and use in source and binary forms, with or without -+// modification, are permitted provided that the following conditions -+// are met: -+// -+// * Redistributions of source code must retain the above copyright -+// notice, this list of conditions and the following disclaimer. -+// * Redistributions in binary form must reproduce the above copyright -+// notice, this list of conditions and the following disclaimer in -+// the documentation and/or other materials provided with the -+// distribution. -+// * Neither the name of Mellanox Technologies nor the names of its -+// contributors may be used to endorse or promote products derived -+// from this software without specific prior written permission. -+// -+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+// -+ -+#ifndef __PKA_CONFIG_H__ -+#define __PKA_CONFIG_H__ -+ -+#include "mlxbf_pka_addrs.h" -+ -+// The maximum number of PKA shims refered to as IO blocks. -+#define PKA_MAX_NUM_IO_BLOCKS 8 -+// The maximum number of Rings supported by IO block (shim). -+#define PKA_MAX_NUM_IO_BLOCK_RINGS 4 -+ -+#define PKA_MAX_NUM_RINGS \ -+ (PKA_MAX_NUM_IO_BLOCK_RINGS * PKA_MAX_NUM_IO_BLOCKS) -+ -+// Resources are regions which include info control/status words, -+// count registers and host window ram. -+#define PKA_MAX_NUM_RING_RESOURCES 3 -+ -+// PKA Ring resources. -+// Define Ring resources parameters including base address, size (in bytes) -+// and ring spacing. -+#define PKA_RING_WORDS_ADDR PKA_BUFFER_RAM_BASE -+#define PKA_RING_CNTRS_ADDR COMMAND_COUNT_0_ADDR -+ -+#define PKA_RING_WORDS_SIZE 0x40 // 64 bytes -+#define PKA_RING_CNTRS_SIZE 0x20 // 32 bytes (3 count registers) -+#define PKA_RING_MEM_SIZE 0x4000 // 16K bytes -+ -+#define PKA_RING_WORDS_SPACING 0x40 // 64 bytes -+#define PKA_RING_CNTRS_SPACING 0x10000 // 64K bytes -+#define PKA_RING_MEM_0_SPACING 0x4000 // 16K bytes -+#define PKA_RING_MEM_1_SPACING 0x10000 // 64K bytes -+ -+// PKA Window RAM parameters. -+// Define whether to split or not Window RAM during PKA device creation phase. -+#define SPLIT_WINDOW_RAM_MODE_ENABLED 1 -+#define SPLIT_WINDOW_RAM_MODE_DISABLED 0 -+#define PKA_SPLIT_WINDOW_RAM_MODE SPLIT_WINDOW_RAM_MODE_DISABLED -+// Defines for Window RAM partition. It is valid for 16K memory. -+#define PKA_WINDOW_RAM_RING_MEM_SIZE 0x0800 // 2KB -+#define PKA_WINDOW_RAM_DATA_MEM_SIZE 0x3800 // 14KB -+ -+// Offset mask, common to both Window and Alternate Window RAM. -+#define PKA_WINDOW_RAM_OFFSET_MASK1 0x730000 -+ -+// Macro for mapping PKA Ring address into Window RAM address. It converts the -+// ring address, either physical address or virtual address, to valid address -+// into the Window RAM. This is done assuming the Window RAM base, size and -+// mask. Here, base is the actual physical address of the Window RAM, with the -+// help of mask it is reduced to Window RAM offset within that PKA block. -+// Further, with the help of addr and size, we arrive at the Window RAM -+// offset address for a PKA Ring within the given Window RAM. -+#define PKA_RING_MEM_ADDR(base, mask, addr, size) \ -+ ((base & mask) | (((addr) & 0xffff) | \ -+ ((((addr) & ~((size) - 1)) & 0xf0000) >> 2))) -+ -+// PKA Master Sequencer Control/Status Register -+// Write '1' to bit [31] puts the Master controller Sequencer in a reset -+// reset state. Resetting the Sequencer (in order to load other firmware) -+// should only be done when the EIP-154 is not performing any operations. -+#define PKA_MASTER_SEQ_CTRL_RESET_VAL 0x80000000 -+// Write '1' to bit [30] will reset all Command and Result counters. This -+// bit is write-only and self clearing and can only be set if the ‘Reset’ -+// bit [31] is ‘1’. -+#define PKA_MASTER_SEQ_CTRL_CLEAR_COUNTERS_VAL 0x40000000 -+// Bit [8] in the PKA Master Sequencer Control/Status Register is tied to -+// the 'pka_master_irq interrupt' on the EIP-154 interrupt controller. -+#define PKA_MASTER_SEQ_CTRL_MASTER_IRQ_BIT 8 -+// Sequencer status bits are used by the Master controller Sequencer to -+// reflect status. Bit [0] is tied to the 'pka_master_irq' interrupt on -+// the EIP-154 interrupt controller. -+#define PKA_MASTER_SEQ_CTRL_STATUS_BYTE 0x01 -+// 'pka_master_irq' mask for the Master controller Sequencer Status Register. -+#define PKA_MASTER_SEQ_CTRL_MASTER_IRQ_MASK 0x100 -+ -+// Advanced Interrupt Controller (AIC) configuration -+// AIC Polarity Control Register is used to set each individual interrupt -+// signal (High Level / Rising Edge) during the initialization phase. -+// '0' = Low level or falling edge. -+// '1' = High level or rising edge. -+#define PKA_AIC_POL_CTRL_REG_VAL 0x000FFFFF -+// AIC Type Control Register is used to set each interrupt to level or edge. -+// '0' = Level. -+// '1' = Edge. -+#define PKA_AIC_TYPE_CTRL_REG_VAL 0x000FFFFF -+// AIC Enable Control Register is used to enable interrupt inputs. -+// '0' = Disabled. -+// '1' = Enabled. -+#define PKA_AIC_ENABLE_CTRL_REG_VAL 0x000F030F -+// AIC Enabled Status Register bits reflect the status of the interrupts -+// gated with the enable bits of the AIC_ENABLE_CTRL Register. -+// '0' = Inactive. -+// '1' = Pending. -+#define PKA_AIC_ENABLE_STAT_REG_VAL 0x000F030F -+ -+// 'pka_master_irq' mask for the AIC Enabled Status Register. -+#define PKA_AIC_ENABLED_STAT_MASTER_IRQ_MASK 0x100 -+ -+// PKA_RING_OPTIONS field to specify the priority in which rings are handled: -+// '00' = full rotating priority, -+// '01' = fixed priority (ring 0 lowest), -+// '10' = ring 0 has the highest priority and the remaining rings have -+// rotating priority, -+// '11' = reserved, do not use. -+#define PKA_FULL_ROTATING_PRIORITY 0x0 -+#define PKA_FIXED_PRIORITY 0x1 -+#define PKA_RING_0_HAS_THE_HIGHEST_PRIORITY 0x2 -+#define PKA_RESERVED 0x3 -+#define PKA_RING_OPTIONS_PRIORITY PKA_FULL_ROTATING_PRIORITY -+ -+// 'Signature' byte used because the ring options are transferred through RAM -+// which does not have a defined reset value. The EIP-154 master controller -+// keeps reading the PKA_RING_OPTIONS word at start-up until the ‘Signature’ -+// byte contains 0x46 and the ‘Reserved’ field contains zero. -+#define PKA_RING_OPTIONS_SIGNATURE_BYTE 0x46 -+ -+// Order of the result reporting: Two schemas are available: -+// InOrder - This means that the results will be reported in the same order -+// as the commands were provided. -+// OutOfOrder - This means that the results are reported as soon as they are -+// available -+#define PKA_RING_TYPE_IN_ORDER_BIT 1 -+#define PKA_RING_TYPE_OUT_OF_ORDER_BIT 0 -+#define PKA_RING_TYPE_IN_ORDER PKA_RING_TYPE_OUT_OF_ORDER_BIT -+ -+// Byte order of the data written/read to/from Rings. -+// Little Endian (LE) - The least significant bytes have the lowest address. -+// Big Endian (BE) - The most significant bytes come first. -+#define PKA_RING_BYTE_ORDER_LE 0 -+#define PKA_RING_BYTE_ORDER_BE 1 -+#define PKA_RING_BYTE_ORDER PKA_RING_BYTE_ORDER_LE -+ -+// 'trng_clk_on' mask for PKA Clock Switch Forcing Register. Turn on the -+// TRNG clock. When the TRNG is controlled via the Host slave interface, -+// this engine needs to be turned on by setting bit 11. -+#define PKA_CLK_FORCE_TRNG_ON 0x800 -+ -+// Number of TRNG Output registers -+#define PKA_TRNG_OUTPUT_CNT 4 -+ -+// TRNG Configuration -+#define PKA_TRNG_CONFIG_REG_VAL 0x00020008 -+// TRNG Alarm Counter Register Value -+#define PKA_TRNG_ALARMCNT_REG_VAL 0x000200FF -+// TRNG FRO Enable Register Value -+#define PKA_TRNG_FROENABLE_REG_VAL 0x00FFFFFF -+// TRNG Control Register Value; Set bit 10 to start the EIP-76 a.k.a TRNG -+// engine, gathering entropy from the FROs. -+#define PKA_TRNG_CONTROL_REG_VAL 0x00000400 -+ -+// TRNG Control bit -+#define PKA_TRNG_CONTROL_TEST_MODE 0x100 -+ -+// TRNG Control Register Value; Set bit 10 and 12 to start the EIP-76 a.k.a TRNG -+// engine with DRBG enabled, gathering entropy from the FROs. -+#define PKA_TRNG_CONTROL_DRBG_REG_VAL 0x00001400 -+ -+// DRBG enabled TRNG 'request_data' value. REQ_DATA_VAL (in accordance with -+// DATA_BLOCK_MASK) requests 256 blocks of 128-bit random output. -+// 4095 blocks is the max number that can be requested for the TRNG(with DRBG) -+// configuration on Bluefield platforms. -+#define PKA_TRNG_CONTROL_REQ_DATA_VAL 0x10010000 -+ -+// Mask for 'Data Block' in TRNG Control Register. -+#define PKA_TRNG_DRBG_DATA_BLOCK_MASK 0xfff00000 -+ -+// Set bit 12 of TRNG Control Register to enable DRBG functionality. -+#define PKA_TRNG_CONTROL_DRBG_ENABLE_VAL 0x00001000 -+ -+// Set bit 8 a.ka 'test_sp_800_90 DRBG' bit in the TRNG Test Register. -+#define PKA_TRNG_TEST_DRBG_VAL 0x00000080 -+ -+// Number of Personalization String/Additional Input Registers -+#define PKA_TRNG_PS_AI_REG_COUNT 12 -+ -+// DRBG Reseed enable -+#define PKA_TRNG_CONTROL_DRBG_RESEED 0x00008000 -+ -+// TRNG Status bits -+#define PKA_TRNG_STATUS_READY 0x1 -+#define PKA_TRNG_STATUS_SHUTDOWN_OFLO 0x2 -+#define PKA_TRNG_STATUS_TEST_READY 0x100 -+#define PKA_TRNG_STATUS_MONOBIT_FAIL 0x80 -+#define PKA_TRNG_STATUS_RUN_FAIL 0x10 -+#define PKA_TRNG_STATUS_POKER_FAIL 0x40 -+ -+// TRNG Alarm Counter bits -+#define PKA_TRNG_ALARMCNT_STALL_RUN_POKER 0x8000 -+ -+// TRNG Test bits -+#define PKA_TRNG_TEST_KNOWN_NOISE 0x20 -+#define PKA_TRNG_TEST_NOISE 0x2000 -+ -+#endif // __PKA_CONFIG_H__ -diff --git a/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_cpu.h b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_cpu.h -new file mode 100644 -index 000000000..12a368c13 ---- /dev/null -+++ b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_cpu.h -@@ -0,0 +1,72 @@ -+// -+// BSD LICENSE -+// -+// Copyright(c) 2016 Mellanox Technologies, Ltd. All rights reserved. -+// All rights reserved. -+// -+// Redistribution and use in source and binary forms, with or without -+// modification, are permitted provided that the following conditions -+// are met: -+// -+// * Redistributions of source code must retain the above copyright -+// notice, this list of conditions and the following disclaimer. -+// * Redistributions in binary form must reproduce the above copyright -+// notice, this list of conditions and the following disclaimer in -+// the documentation and/or other materials provided with the -+// distribution. -+// * Neither the name of Mellanox Technologies nor the names of its -+// contributors may be used to endorse or promote products derived -+// from this software without specific prior written permission. -+// -+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+// -+ -+#ifndef __PKA_CPU_H__ -+#define __PKA_CPU_H__ -+ -+#include -+#include -+ -+#define PKA_AARCH_64 -+#define MAX_CPU_NUMBER 16 // BlueField specific -+ -+#define MEGA 1000000 -+#define GIGA 1000000000 -+ -+#define MS_PER_S 1000 -+#define US_PER_S 1000000 -+#define NS_PER_S 1000000000 -+ -+// Initial guess at our CPU speed. We set this to be larger than any -+// possible real speed, so that any calculated delays will be too long, -+// rather than too short. -+// -+//*Warning: use dummy value for frequency -+//#define CPU_HZ_MAX (2 * GIGA) // Cortex A72 : 2 GHz max -> 2.5 GHz max -+#define CPU_HZ_MAX (1255 * MEGA) // CPU Freq for High/Bin Chip -+ -+// YIELD hints the CPU to switch to another thread if possible -+// and executes as a NOP otherwise. -+#define pka_cpu_yield() ({ asm volatile("yield" : : : "memory"); }) -+// ISB flushes the pipeline, then restarts. This is guaranteed to -+// stall the CPU a number of cycles. -+#define pka_cpu_relax() ({ asm volatile("isb" : : : "memory"); }) -+ -+// Processor speed in hertz; used in routines which might be called very -+// early in boot. -+static inline uint64_t pka_early_cpu_speed(void) -+{ -+ return CPU_HZ_MAX; -+} -+ -+#endif // __PKA_CPU_H__ -diff --git a/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_debug.h b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_debug.h -new file mode 100644 -index 000000000..a44af6eb1 ---- /dev/null -+++ b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_debug.h -@@ -0,0 +1,66 @@ -+// -+// BSD LICENSE -+// -+// Copyright(c) 2016 Mellanox Technologies, Ltd. All rights reserved. -+// All rights reserved. -+// -+// Redistribution and use in source and binary forms, with or without -+// modification, are permitted provided that the following conditions -+// are met: -+// -+// * Redistributions of source code must retain the above copyright -+// notice, this list of conditions and the following disclaimer. -+// * Redistributions in binary form must reproduce the above copyright -+// notice, this list of conditions and the following disclaimer in -+// the documentation and/or other materials provided with the -+// distribution. -+// * Neither the name of Mellanox Technologies nor the names of its -+// contributors may be used to endorse or promote products derived -+// from this software without specific prior written permission. -+// -+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+// -+ -+#ifndef __PKA_DEBUG_H__ -+#define __PKA_DEBUG_H__ -+ -+// PKA library bitmask. Use those bits to enable debug messages -+#define PKA_DRIVER 0x0001 -+#define PKA_DEV 0x0002 -+#define PKA_RING 0x0004 -+#define PKA_QUEUE 0x0008 -+#define PKA_MEM 0x0010 -+#define PKA_USER 0x0020 -+#define PKA_TESTS 0x0040 -+// PKA debug mask. This indicates the debug/verbosity level. -+#define PKA_DEBUG_LIB_MASK 0x0040 -+ -+#define PKA_PRINT(lib, fmt, args...) \ -+ ({ pr_info(#lib": "fmt, ##args); }) -+ -+#define PKA_ERROR(lib, fmt, args...) \ -+ ({ pr_err(#lib": %s: error: "fmt, __func__, ##args); }) -+ -+#define PKA_DEBUG(lib, fmt, args...) \ -+ ({ \ -+ if (lib & PKA_DEBUG_LIB_MASK) \ -+ pr_debug(#lib": %s: "fmt, __func__, ##args); \ -+ }) -+ -+#define PKA_PANIC(lib, msg, args...) \ -+ ({ \ -+ pr_info(#lib": %s: panic: "msg, __func__, ##args); \ -+ panic(msg, ##args); \ -+ }) -+ -+#endif // __PKA_DEBUG_H__ -diff --git a/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_dev.c b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_dev.c -new file mode 100644 -index 000000000..c90c70134 ---- /dev/null -+++ b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_dev.c -@@ -0,0 +1,2414 @@ -+// -+// BSD LICENSE -+// -+// Copyright(c) 2016 Mellanox Technologies, Ltd. All rights reserved. -+// All rights reserved. -+// -+// Redistribution and use in source and binary forms, with or without -+// modification, are permitted provided that the following conditions -+// are met: -+// -+// * Redistributions of source code must retain the above copyright -+// notice, this list of conditions and the following disclaimer. -+// * Redistributions in binary form must reproduce the above copyright -+// notice, this list of conditions and the following disclaimer in -+// the documentation and/or other materials provided with the -+// distribution. -+// * Neither the name of Mellanox Technologies nor the names of its -+// contributors may be used to endorse or promote products derived -+// from this software without specific prior written permission. -+// -+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+// -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "mlxbf_pka_dev.h" -+ -+#define BYTES_PER_WORD 4 -+#define BYTES_PER_DOUBLE_WORD 8 -+ -+// Personalization string "NVIDIA-MELLANOX-BLUEFIELD-TRUE_RANDOM_NUMBER_GEN" -+uint32_t pka_trng_drbg_ps_str[] = -+{ -+ 0x4e564944, 0x49412d4d, 0x454c4c41, 0x4e4f582d, -+ 0x424c5545, 0x4649454c, 0x442d5452, 0x55455f52, -+ 0x414e444f, 0x4d5f4e55, 0x4d424552, 0x5f47454e -+}; -+ -+// Personalization string for DRBG test -+uint32_t pka_trng_drbg_test_ps_str[] = -+{ -+ 0x64299d83, 0xc34d7098, 0x5bd1f51d, 0xddccfdc1, -+ 0xdd0455b7, 0x166279e5, 0x0974cb1b, 0x2f2cd100, -+ 0x59a5060a, 0xca79940d, 0xd4e29a40, 0x56b7b779 -+}; -+ -+// First Entropy string for DRBG test -+uint32_t pka_trng_drbg_test_etpy_str1[] = -+{ -+ 0xaa6bbcab, 0xef45e339, 0x136ca1e7, 0xbce1c881, -+ 0x9fa37b09, 0x63b53667, 0xb36e0053, 0xa202ed81, -+ 0x4650d90d, 0x8eed6127, 0x666f2402, 0x0dfd3af9 -+}; -+ -+// Second Entropy string for DRBG test -+uint32_t pka_trng_drbg_test_etpy_str2[] = -+{ -+ 0x35c1b7a1, 0x0154c52b, 0xd5777390, 0x226a4fdb, -+ 0x5f16080d, 0x06b68369, 0xd0c93d00, 0x3336e27f, -+ 0x1abf2c37, 0xe6ab006c, 0xa4adc6e1, 0x8e1907a2 -+}; -+ -+// Known answer for DRBG test -+uint32_t pka_trng_drbg_test_output[] = -+{ -+ 0xb663b9f1, 0x24943e13, 0x80f7dce5, 0xaba1a16f -+}; -+ -+pka_dev_gbl_config_t pka_gbl_config; -+ -+// Global PKA shim resource info table -+static pka_dev_gbl_shim_res_info_t pka_gbl_res_tbl[PKA_MAX_NUM_IO_BLOCKS]; -+ -+// Start a PKA device timer. -+static uint64_t pka_dev_timer_start(uint32_t usec) -+{ -+ uint64_t cur_time = get_cycles(); -+ return (cur_time + (pka_early_cpu_speed() * usec) / 1000000ULL); -+} -+ -+// Test a PKA device timer for completion. -+static int pka_dev_timer_done(uint64_t timer) -+{ -+ return (get_cycles() >= timer); -+} -+ -+// Return register base address -+static uint64_t pka_dev_get_register_base(uint64_t base, uint64_t reg_addr) -+{ -+ return (base + reg_addr) & PAGE_MASK; -+} -+ -+// Return register offset -+static uint64_t pka_dev_get_register_offset(uint64_t base, uint64_t reg_addr) -+{ -+ return (base + reg_addr) & ~PAGE_MASK; -+} -+ -+// Return word offset within io memory -+static uint64_t pka_dev_get_word_offset(uint64_t mem_base, uint64_t word_addr, -+ uint64_t mem_size) -+{ -+ return (mem_base + word_addr) & (mem_size - 1); -+} -+ -+static uint64_t pka_dev_io_read(void *mem_ptr, uint64_t mem_off) -+{ -+ uint64_t data; -+ -+ data = pka_mmio_read(mem_ptr + mem_off); -+ -+ return data; -+} -+ -+static void pka_dev_io_write(void *mem_ptr, uint64_t mem_off, uint64_t value) -+{ -+ pka_mmio_write(mem_ptr + mem_off, value); -+} -+ -+// Add the resource to the global resource table -+static int pka_dev_add_resource(pka_dev_res_t *res_ptr, uint32_t shim_idx) -+{ -+ uint8_t res_cnt; -+ -+ res_cnt = pka_gbl_res_tbl[shim_idx].res_cnt; -+ -+ if (res_cnt >= PKA_DEV_SHIM_RES_CNT) -+ return -ENOMEM; -+ -+ pka_gbl_res_tbl[shim_idx].res_tbl[res_cnt] = res_ptr; -+ pka_gbl_res_tbl[shim_idx].res_cnt++; -+ -+ return 0; -+} -+ -+// Remove the resource from the global resource table -+static int pka_dev_put_resource(pka_dev_res_t *res, uint32_t shim_idx) -+{ -+ pka_dev_res_t *res_ptr; -+ uint8_t res_idx; -+ -+ for (res_idx = 0; res_idx < PKA_DEV_SHIM_RES_CNT; res_idx++) -+ { -+ res_ptr = pka_gbl_res_tbl[shim_idx].res_tbl[res_idx]; -+ if (res_ptr && strcmp(res_ptr->name, res->name) == 0) -+ { -+ pka_gbl_res_tbl[shim_idx].res_tbl[res_idx] = NULL; -+ pka_gbl_res_tbl[shim_idx].res_cnt--; -+ break; -+ } -+ } -+ -+ // Check whether the resource shares the same memory map; If so, -+ // the memory map shouldn't be released. -+ for (res_idx = 0; res_idx < PKA_DEV_SHIM_RES_CNT; res_idx++) -+ { -+ res_ptr = pka_gbl_res_tbl[shim_idx].res_tbl[res_idx]; -+ if (res_ptr && (res_ptr->base == res->base)) -+ return -EBUSY; -+ } -+ -+ return 0; -+} -+ -+static void* pka_dev_get_resource_ioaddr(uint64_t res_base, uint32_t shim_idx) -+{ -+ pka_dev_res_t *res_ptr; -+ uint8_t res_cnt, res_idx; -+ -+ res_cnt = pka_gbl_res_tbl[shim_idx].res_cnt; -+ -+ if (res_cnt == 0) -+ return NULL; -+ -+ for (res_idx = 0; res_idx < res_cnt; res_idx++) -+ { -+ res_ptr = pka_gbl_res_tbl[shim_idx].res_tbl[res_idx]; -+ if (res_ptr->base == res_base) -+ return res_ptr->ioaddr; -+ } -+ -+ return NULL; -+} -+ -+// Set PKA device resource config - - map io memory if needed. -+static int pka_dev_set_resource_config(pka_dev_shim_t *shim, -+ pka_dev_res_t *res_ptr, -+ uint64_t res_base, -+ uint64_t res_size, -+ uint64_t res_type, -+ char *res_name) -+{ -+ int ret = 0; -+ -+ if (res_ptr->status == PKA_DEV_RES_STATUS_MAPPED) -+ return -EPERM; -+ -+ if (res_type == PKA_DEV_RES_TYPE_REG) -+ res_ptr->base = res_base; -+ -+ if (res_type == PKA_DEV_RES_TYPE_MEM) -+ res_ptr->base = shim->mem_res.eip154_base + res_base; -+ -+ res_ptr->size = res_size; -+ res_ptr->type = res_type; -+ res_ptr->name = res_name; -+ res_ptr->status = PKA_DEV_RES_STATUS_UNMAPPED; -+ res_ptr->ioaddr = pka_dev_get_resource_ioaddr(res_ptr->base, -+ shim->shim_id); -+ if (!res_ptr->ioaddr) -+ { -+ if (!request_mem_region(res_ptr->base, res_ptr->size, res_ptr->name)) -+ { -+ PKA_ERROR(PKA_DEV, "failed to get io memory region\n"); -+ return -EPERM; -+ } -+ -+ res_ptr->ioaddr = ioremap(res_ptr->base, res_ptr->size); -+ } -+ -+ res_ptr->status = PKA_DEV_RES_STATUS_MAPPED; -+ -+ if (!res_ptr->ioaddr || pka_dev_add_resource(res_ptr, shim->shim_id)) -+ { -+ PKA_ERROR(PKA_DEV, "unable to map io memory\n"); -+ release_mem_region(res_ptr->base, res_ptr->size); -+ return -ENOMEM; -+ } -+ return ret; -+} -+ -+// Unset PKA device resource config - unmap io memory if needed. -+static void pka_dev_unset_resource_config(pka_dev_shim_t *shim, -+ pka_dev_res_t *res_ptr) -+{ -+ int ret = -EBUSY; -+ -+ if (res_ptr->status != PKA_DEV_RES_STATUS_MAPPED) -+ return; -+ -+ if (res_ptr->ioaddr && -+ ret != pka_dev_put_resource(res_ptr, shim->shim_id)) -+ { -+ iounmap(res_ptr->ioaddr); -+ release_mem_region(res_ptr->base, res_ptr->size); -+ } -+ -+ res_ptr->status = PKA_DEV_RES_STATUS_UNMAPPED; -+} -+ -+int pka_dev_clear_ring_counters(pka_dev_ring_t *ring) -+{ -+ pka_dev_shim_t *shim; -+ pka_dev_res_t *master_seq_ctrl_ptr; -+ void *master_reg_ptr; -+ uint64_t master_reg_base, master_reg_off; -+ -+ shim = ring->shim; -+ master_seq_ctrl_ptr = &shim->resources.master_seq_ctrl; -+ master_reg_base = master_seq_ctrl_ptr->base; -+ master_reg_ptr = master_seq_ctrl_ptr->ioaddr; -+ master_reg_off = pka_dev_get_register_offset(master_reg_base, -+ PKA_MASTER_SEQ_CTRL_ADDR); -+ -+ // push the EIP-154 master controller into reset. -+ pka_dev_io_write(master_reg_ptr, master_reg_off, -+ PKA_MASTER_SEQ_CTRL_RESET_VAL); -+ -+ // clear counters. -+ pka_dev_io_write(master_reg_ptr, master_reg_off, -+ PKA_MASTER_SEQ_CTRL_CLEAR_COUNTERS_VAL); -+ -+ // take the EIP-154 master controller out of reset. -+ pka_dev_io_write(master_reg_ptr, master_reg_off, 0); -+ -+ return 0; -+} -+ -+// Initialize ring. Set ring parameters and configure ring resources. -+// It returns 0 on success, a negative error code on failure. -+static int pka_dev_init_ring(pka_dev_ring_t *ring, uint32_t ring_id, -+ pka_dev_shim_t *shim) -+{ -+ int ret = 0; -+ -+ pka_dev_res_t *ring_info_words_ptr; -+ pka_dev_res_t *ring_counters_ptr; -+ pka_dev_res_t *ring_window_ram_ptr; -+ -+ uint32_t ring_words_off; -+ uint32_t ring_cntrs_off; -+ uint32_t ring_mem_off; -+ uint32_t ring_mem_base; -+ -+ uint32_t shim_ring_id; -+ uint8_t window_ram_split; -+ -+ if (ring->status != PKA_DEV_RING_STATUS_UNDEFINED) -+ { -+ PKA_ERROR(PKA_DEV, "PKA ring must be undefined\n"); -+ return -EPERM; -+ } -+ -+ if (ring_id > PKA_MAX_NUM_RINGS - 1) -+ { -+ PKA_ERROR(PKA_DEV, "invalid ring identifier\n"); -+ return -EINVAL; -+ } -+ -+ ring->ring_id = ring_id; -+ ring->shim = shim; -+ ring->resources_num = PKA_MAX_NUM_RING_RESOURCES; -+ -+ shim_ring_id = ring_id % PKA_MAX_NUM_IO_BLOCK_RINGS; -+ shim->rings[shim_ring_id] = ring; -+ -+ // Configure ring information control/status words resource -+ ring_info_words_ptr = &ring->resources.info_words; -+ ring_words_off = shim_ring_id * PKA_RING_WORDS_SPACING; -+ ring_info_words_ptr->base = ring_words_off + shim->mem_res.eip154_base + -+ PKA_RING_WORDS_ADDR; -+ ring_info_words_ptr->size = PKA_RING_WORDS_SIZE; -+ ring_info_words_ptr->type = PKA_DEV_RES_TYPE_MEM; -+ ring_info_words_ptr->status = PKA_DEV_RES_STATUS_UNMAPPED; -+ ring_info_words_ptr->name = "PKA_RING_INFO"; -+ -+ // Configure ring counters registers resource -+ ring_counters_ptr = &ring->resources.counters; -+ ring_cntrs_off = shim_ring_id * PKA_RING_CNTRS_SPACING; -+ ring_counters_ptr->base = ring_cntrs_off + shim->mem_res.eip154_base + -+ PKA_RING_CNTRS_ADDR; -+ ring_counters_ptr->size = PKA_RING_CNTRS_SIZE; -+ ring_counters_ptr->type = PKA_DEV_RES_TYPE_REG; -+ ring_counters_ptr->status = PKA_DEV_RES_STATUS_UNMAPPED; -+ ring_counters_ptr->name = "PKA_RING_CNTRS"; -+ -+ // Configure ring window RAM resource -+ window_ram_split = shim->window_ram_split; -+ if (window_ram_split == PKA_SHIM_WINDOW_RAM_SPLIT_ENABLED) -+ { -+ ring_mem_off = shim_ring_id * PKA_RING_MEM_1_SPACING; -+ ring_mem_base = ring_mem_off + shim->mem_res.alt_wndw_ram_0_base; -+ } -+ else -+ { -+ ring_mem_off = shim_ring_id * PKA_RING_MEM_0_SPACING; -+ ring_mem_base = ring_mem_off + shim->mem_res.wndw_ram_base; -+ } -+ -+ ring_window_ram_ptr = &ring->resources.window_ram; -+ ring_window_ram_ptr->base = ring_mem_base; -+ ring_window_ram_ptr->size = PKA_RING_MEM_SIZE; -+ ring_window_ram_ptr->type = PKA_DEV_RES_TYPE_MEM; -+ ring_window_ram_ptr->status = PKA_DEV_RES_STATUS_UNMAPPED; -+ ring_window_ram_ptr->name = "PKA_RING_WINDOW"; -+ -+ ring->ring_info = kzalloc(sizeof(pka_dev_hw_ring_info_t), GFP_KERNEL); -+ if (!ring->ring_info) -+ { -+ PKA_ERROR(PKA_DEV, "unable to kmalloc\n"); -+ kfree(ring->ring_info); -+ return -ENOMEM; -+ } -+ -+ mutex_init(&ring->mutex); -+ ring->status = PKA_DEV_RING_STATUS_INITIALIZED; -+ -+ return ret; -+} -+ -+// Release a given Ring. -+static int pka_dev_release_ring(pka_dev_ring_t *ring) -+{ -+ int ret = 0; -+ -+ pka_dev_shim_t *shim; -+ uint32_t shim_ring_id; -+ -+ if (ring->status == PKA_DEV_RING_STATUS_UNDEFINED) -+ return ret; -+ -+ if (ring->status == PKA_DEV_RING_STATUS_BUSY) -+ { -+ PKA_ERROR(PKA_DEV, "PKA ring is busy\n"); -+ return -EBUSY; -+ } -+ -+ shim = ring->shim; -+ -+ if (shim->status == PKA_SHIM_STATUS_RUNNING) -+ { -+ PKA_ERROR(PKA_DEV, "PKA shim is running\n"); -+ return -EPERM; -+ } -+ -+ pka_dev_unset_resource_config(shim, &ring->resources.info_words); -+ pka_dev_unset_resource_config(shim, &ring->resources.counters); -+ pka_dev_unset_resource_config(shim, &ring->resources.window_ram); -+ -+ kfree(ring->ring_info); -+ -+ ring->status = PKA_DEV_RING_STATUS_UNDEFINED; -+ shim_ring_id = ring->ring_id % PKA_MAX_NUM_IO_BLOCK_RINGS; -+ shim->rings[shim_ring_id] = NULL; -+ shim->rings_num--; -+ -+ return ret; -+} -+ -+// Partition the window RAM for a given PKA ring. Here we statically divide -+// the 16K memory region into three partitions: First partition is reserved -+// for command descriptor ring (1K), second partition is reserved for result -+// descriptor ring (1K), and the remaining 14K are reserved for vector data. -+// Through this memroy partition scheme, command/result descriptor rings hold -+// a total of 1KB/64B = 16 descriptors each. The adresses for the rings start -+// at offset 0x3800. Also note that it is possible to have rings full while -+// the vector data can support more data, the opposite can also happen, but -+// it is not suitable. For instance ECC point multiplication requires 8 input -+// vectors and 2 output vectors, a total of 10 vectors. If each vector has a -+// length of 24 words (24x4B = 96B), we can process 14KB/960B = 14 operations -+// which is close to 16 the total descriptors supported by rings. On the other -+// hand, using 12K vector data region, allows to process only 12 operations, -+// while rings can hold 32 descriptors (ring usage is significantly low). -+// For ECDSA verify, we have 12 vectors which require 1152B, with 14KB we can -+// handle 12 operations, against 10 operations with 12KB vector data memory. -+// We believe that the aformentionned memory partition help us to leverage -+// the trade-off between supported descriptors and required vectors. Note -+// that these examples gives approximative values and does not include buffer -+// word padding across vectors. -+// -+// The function also writes the result descriptor rings base addresses, size -+// and type, and initialize the read and write pointers and statistics. It -+// returns 0 on success, a negative error code on failure. -+// -+// This function must be called once per ring, at initialization before any -+// other fonctions are called. -+static int pka_dev_partition_mem(pka_dev_ring_t *ring) -+{ -+ int ret = 0; -+ -+ pka_dev_shim_t *shim; -+ pka_dev_hw_ring_info_t *ring_info; -+ -+ uint32_t ring_mem_base; -+ uint32_t ring_mem_size; -+ uint32_t data_mem_base; -+ uint32_t data_mem_size; -+ -+ uint64_t cmd_desc_ring_base; -+ uint32_t cmd_desc_ring_size; -+ uint64_t rslt_desc_ring_base; -+ uint32_t rslt_desc_ring_size; -+ -+ uint16_t num_cmd_desc; -+ uint16_t host_desc_size; -+ uint8_t ring_in_order; -+ -+ uint64_t window_ram_base; -+ uint64_t window_ram_size; -+ -+ shim = ring->shim; -+ -+ if (!ring->shim || -+ ring->status != PKA_DEV_RING_STATUS_INITIALIZED) -+ return -EPERM; -+ -+ ring_in_order = shim->ring_type; -+ window_ram_base = ring->resources.window_ram.base; -+ window_ram_size = ring->resources.window_ram.size; -+ // Partition ring memory. Give ring pair (cmmd descriptor ring and rslt -+ // descriptor ring) an equal portion of the memory. The cmmd descriptor -+ // ring and result descriptor ring are used as "non-overlapping" ring. -+ // Currently set aside 1/8 of the window RAM for command/result descriptor -+ // rings - giving a total of 1K/64B = 16 descriptors per ring. -+ // The remaining memory is "Data Memory" - i.e. memory to hold the command -+ // operands and results - also called input/output vectors (in all cases -+ // these vectors are just single large integers - often in the range of -+ // hundreds to thousands of bits long). -+ ring_mem_size = PKA_WINDOW_RAM_RING_MEM_SIZE / 2; -+ data_mem_size = PKA_WINDOW_RAM_DATA_MEM_SIZE; -+ data_mem_base = window_ram_base; -+ ring_mem_base = data_mem_base + data_mem_size; -+ -+ num_cmd_desc = ring_mem_size / CMD_DESC_SIZE; -+ host_desc_size = CMD_DESC_SIZE / BYTES_PER_WORD; -+ -+ cmd_desc_ring_size = num_cmd_desc * CMD_DESC_SIZE; -+ rslt_desc_ring_size = cmd_desc_ring_size; -+ -+ ring->num_cmd_desc = num_cmd_desc; -+ -+ // The command and result descriptor rings may be placed at different -+ // (non-overlapping) locations in Window RAM memory space. PKI command -+ // interface: Most of the functionality is defined by the EIP-154 master -+ // firmware on the EIP-154 master controller Sequencer. -+ cmd_desc_ring_base = ring_mem_base; -+ rslt_desc_ring_base = ring_mem_base + cmd_desc_ring_size; -+ -+ cmd_desc_ring_base = -+ PKA_RING_MEM_ADDR(window_ram_base, shim->mem_res.wndw_ram_off_mask, -+ cmd_desc_ring_base, window_ram_size); -+ rslt_desc_ring_base = -+ PKA_RING_MEM_ADDR(window_ram_base, shim->mem_res.wndw_ram_off_mask, -+ rslt_desc_ring_base, window_ram_size); -+ -+ ring_info = ring->ring_info; -+ // Fill ring information. -+ ring_info->cmmd_base = cmd_desc_ring_base; -+ ring_info->rslt_base = rslt_desc_ring_base; -+ ring_info->size = num_cmd_desc - 1; -+ ring_info->host_desc_size = host_desc_size; -+ ring_info->in_order = ring_in_order; -+ ring_info->cmmd_rd_ptr = 0x0; -+ ring_info->rslt_wr_ptr = 0x0; -+ ring_info->cmmd_rd_stats = 0x0; -+ ring_info->rslt_wr_stats = 0x0; -+ -+ return ret; -+} -+ -+// Write the ring base address, ring size and type, and initialize (clear) -+// the read and write pointers and statistics. -+static int pka_dev_write_ring_info(pka_dev_res_t *buffer_ram_ptr, -+ uint8_t ring_id, -+ uint32_t ring_cmmd_base_val, -+ uint32_t ring_rslt_base_val, -+ uint32_t ring_size_type_val) -+{ -+ uint32_t ring_spacing; -+ uint64_t word_off; -+ int ret = 0; -+ -+ if (buffer_ram_ptr->status != PKA_DEV_RES_STATUS_MAPPED || -+ buffer_ram_ptr->type != PKA_DEV_RES_TYPE_MEM) -+ return -EPERM; -+ -+ PKA_DEBUG(PKA_DEV, "Writing ring information control/status words\n"); -+ -+ ring_spacing = ring_id * PKA_RING_WORDS_SPACING; -+ -+ // Write the command ring base address that the EIP-154 -+ // master firmware uses with the command ring read pointer -+ // to get command descriptors from the Host ring. After the -+ // initialization, although the word is writeable it should -+ // be regarded as read-only. -+ word_off = pka_dev_get_word_offset(buffer_ram_ptr->base, -+ RING_CMMD_BASE_0_ADDR + ring_spacing, -+ PKA_BUFFER_RAM_SIZE); -+ pka_dev_io_write(buffer_ram_ptr->ioaddr, word_off, ring_cmmd_base_val); -+ -+ // Write the result ring base address that the EIP-154 -+ // master firmware uses with the result ring write pointer -+ // to put the result descriptors in the Host ring. After -+ // the initialization, although the word is writeable it -+ // should be regarded as read-only. -+ word_off = pka_dev_get_word_offset(buffer_ram_ptr->base, -+ RING_RSLT_BASE_0_ADDR + ring_spacing, -+ PKA_BUFFER_RAM_SIZE); -+ pka_dev_io_write(buffer_ram_ptr->ioaddr, word_off, ring_rslt_base_val); -+ -+ // Write the ring size (number of descriptors), the size of -+ // the descriptor and the result reporting scheme. After the -+ // initialization, although the word is writeable it should -+ // be regarded as read-only. -+ word_off = pka_dev_get_word_offset(buffer_ram_ptr->base, -+ RING_SIZE_TYPE_0_ADDR + ring_spacing, -+ PKA_BUFFER_RAM_SIZE); -+ pka_dev_io_write(buffer_ram_ptr->ioaddr, word_off, ring_size_type_val); -+ -+ // Write the command and result ring indices that the EIP-154 -+ // master firmware uses. This word should be written with zero -+ // when the ring information is initialized. After the -+ // initialization, although the word is writeable it should be -+ // regarded as read-only. -+ word_off = pka_dev_get_word_offset(buffer_ram_ptr->base, -+ RING_RW_PTRS_0_ADDR + ring_spacing, -+ PKA_BUFFER_RAM_SIZE); -+ pka_dev_io_write(buffer_ram_ptr->ioaddr, word_off, 0); -+ -+ // Write the ring statistics (two 16-bit counters, one for -+ // commands and one for results) from EIP-154 master firmware -+ // point of view. This word should be written with zero when -+ // the ring information is initialized. After the initializa- -+ // -tion, although the word is writeable it should be regarded -+ // as read-only. -+ word_off = pka_dev_get_word_offset(buffer_ram_ptr->base, -+ RING_RW_STAT_0_ADDR + ring_spacing, -+ PKA_BUFFER_RAM_SIZE); -+ pka_dev_io_write(buffer_ram_ptr->ioaddr, word_off, 0); -+ -+ return ret; -+} -+ -+// Set up the control/status words. Upon a PKI command the EIP-154 master -+// firmware will read and partially update the ring information. -+static int pka_dev_set_ring_info(pka_dev_ring_t *ring) -+{ -+ int ret = 0; -+ -+ pka_dev_shim_t *shim; -+ pka_dev_hw_ring_info_t *ring_info; -+ pka_dev_res_t *buffer_ram_ptr; -+ -+ uint32_t ring_cmmd_base_val; -+ uint32_t ring_rslt_base_val; -+ uint32_t ring_size_type_val; -+ -+ uint8_t ring_id; -+ -+ shim = ring->shim; -+ // Ring info configuration MUST be done when the PKA ring -+ // is initilaized. -+ if ((shim->status != PKA_SHIM_STATUS_INITIALIZED && -+ shim->status != PKA_SHIM_STATUS_RUNNING && -+ shim->status != PKA_SHIM_STATUS_STOPPED) || -+ ring->status != PKA_DEV_RING_STATUS_INITIALIZED) -+ return -EPERM; -+ -+ ring_id = ring->ring_id % PKA_MAX_NUM_IO_BLOCK_RINGS; -+ -+ // Partition ring memory. -+ ret = pka_dev_partition_mem(ring); -+ if (ret) -+ { -+ PKA_ERROR(PKA_DEV, "failed to initialize ring memory\n"); -+ return ret; -+ } -+ -+ // Fill ring infomation. -+ ring_info = ring->ring_info; -+ -+ ring_cmmd_base_val = ring_info->cmmd_base; -+ ring_rslt_base_val = ring_info->rslt_base; -+ -+ ring_size_type_val = (ring_info->in_order & 0x0001) << 31; -+ ring_size_type_val |= (ring_info->host_desc_size & 0x03FF) << 18; -+ ring_size_type_val |= (ring->num_cmd_desc - 1) & 0xFFFF; -+ -+ buffer_ram_ptr = &shim->resources.buffer_ram; -+ // Write ring information status/control words in the PKA Buffer RAM -+ ret = pka_dev_write_ring_info(buffer_ram_ptr, ring_id, ring_cmmd_base_val, -+ ring_rslt_base_val, ring_size_type_val); -+ if (ret) -+ { -+ PKA_ERROR(PKA_DEV, "failed to wirte ring information\n"); -+ return ret; -+ } -+ -+ ring->status = PKA_DEV_RING_STATUS_READY; -+ -+ return ret; -+} -+ -+// Create shim. Set shim parameters and configure shim resources. -+// It returns 0 on success, a negative error code on failure. -+static int pka_dev_create_shim(pka_dev_shim_t *shim, uint32_t shim_id, -+ uint8_t split, struct pka_dev_mem_res *mem_res) -+{ -+ int ret = 0; -+ -+ uint64_t reg_base; -+ uint64_t reg_size; -+ -+ if (shim->status == PKA_SHIM_STATUS_CREATED) -+ return ret; -+ -+ if (shim->status != PKA_SHIM_STATUS_UNDEFINED) -+ { -+ PKA_ERROR(PKA_DEV, "PKA device must be undefined\n"); -+ return -EPERM; -+ } -+ -+ if (shim_id > PKA_MAX_NUM_IO_BLOCKS - 1) -+ { -+ PKA_ERROR(PKA_DEV, "invalid shim identifier\n"); -+ return -EINVAL; -+ } -+ -+ shim->shim_id = shim_id; -+ shim->mem_res = *mem_res; -+ -+ if (split) -+ shim->window_ram_split = PKA_SHIM_WINDOW_RAM_SPLIT_ENABLED; -+ else -+ shim->window_ram_split = PKA_SHIM_WINDOW_RAM_SPLIT_DISABLED; -+ -+ shim->ring_type = PKA_RING_TYPE_IN_ORDER; -+ shim->ring_priority = PKA_RING_OPTIONS_PRIORITY; -+ shim->rings_num = PKA_MAX_NUM_IO_BLOCK_RINGS; -+ shim->rings = kzalloc(sizeof(pka_dev_ring_t) * shim->rings_num, -+ GFP_KERNEL); -+ if (!shim->rings) -+ { -+ PKA_ERROR(PKA_DEV, "unable to kmalloc\n"); -+ return -ENOMEM; -+ } -+ -+ // Set PKA device Buffer RAM config -+ ret = pka_dev_set_resource_config(shim, &shim->resources.buffer_ram, -+ PKA_BUFFER_RAM_BASE, -+ PKA_BUFFER_RAM_SIZE, -+ PKA_DEV_RES_TYPE_MEM, -+ "PKA_BUFFER_RAM"); -+ if (ret) -+ { -+ PKA_ERROR(PKA_DEV, "unable to set Buffer RAM config\n"); -+ return ret; -+ } -+ -+ // Set PKA device Master Program RAM config -+ ret = pka_dev_set_resource_config(shim, &shim->resources.master_prog_ram, -+ PKA_MASTER_PROG_RAM_BASE, -+ PKA_MASTER_PROG_RAM_SIZE, -+ PKA_DEV_RES_TYPE_MEM, -+ "PKA_MASTER_PROG_RAM"); -+ if (ret) -+ { -+ PKA_ERROR(PKA_DEV, "unable to set Master Program RAM config\n"); -+ return ret; -+ } -+ -+ // Set PKA device Master Controller register -+ reg_size = PAGE_SIZE; -+ reg_base = pka_dev_get_register_base(shim->mem_res.eip154_base, -+ PKA_MASTER_SEQ_CTRL_ADDR); -+ ret = pka_dev_set_resource_config(shim, &shim->resources.master_seq_ctrl, -+ reg_base, reg_size, -+ PKA_DEV_RES_TYPE_REG, -+ "PKA_MASTER_SEQ_CTRL"); -+ if (ret) -+ { -+ PKA_ERROR(PKA_DEV, "unable to set Master Controller register " -+ "config\n"); -+ return ret; -+ } -+ -+ // Set PKA device AIC registers -+ reg_size = PAGE_SIZE; -+ reg_base = pka_dev_get_register_base(shim->mem_res.eip154_base, -+ AIC_POL_CTRL_ADDR); -+ ret = pka_dev_set_resource_config(shim, &shim->resources.aic_csr, -+ reg_base, reg_size, -+ PKA_DEV_RES_TYPE_REG, -+ "PKA_AIC_CSR"); -+ if (ret) -+ { -+ PKA_ERROR(PKA_DEV, "unable to set AIC registers config\n"); -+ return ret; -+ } -+ -+ // Set PKA device TRNG registers -+ reg_size = PAGE_SIZE; -+ reg_base = pka_dev_get_register_base(shim->mem_res.eip154_base, -+ TRNG_OUTPUT_0_ADDR); -+ ret = pka_dev_set_resource_config(shim, &shim->resources.trng_csr, -+ reg_base, reg_size, -+ PKA_DEV_RES_TYPE_REG, -+ "PKA_TRNG_CSR"); -+ if (ret) -+ { -+ PKA_ERROR(PKA_DEV, "unable to setup the TRNG\n"); -+ return ret; -+ } -+ -+ // Set PKA device 'glue' logic registers -+ reg_size = PAGE_SIZE; -+ reg_base = pka_dev_get_register_base(shim->mem_res.csr_base, -+ PKA_INT_MASK_ADDR); -+ ret = pka_dev_set_resource_config(shim, &shim->resources.ext_csr, -+ reg_base, reg_size, -+ PKA_DEV_RES_TYPE_REG, -+ "PKA_EXT_CSR"); -+ if (ret) -+ { -+ PKA_ERROR(PKA_DEV, "unable to setup the MiCA specific registers\n"); -+ return ret; -+ } -+ -+ shim->status = PKA_SHIM_STATUS_CREATED; -+ -+ return ret; -+} -+ -+// Delete shim and unset shim resources. -+static int pka_dev_delete_shim(pka_dev_shim_t *shim) -+{ -+ int ret = 0; -+ pka_dev_res_t *res_buffer_ram, *res_master_prog_ram; -+ pka_dev_res_t *res_master_seq_ctrl, *res_aic_csr, *res_trng_csr; -+ -+ PKA_DEBUG(PKA_DEV, "PKA device delete shim\n"); -+ -+ if (shim->status == PKA_SHIM_STATUS_UNDEFINED) -+ return ret; -+ -+ if (shim->status != PKA_SHIM_STATUS_FINALIZED && -+ shim->status != PKA_SHIM_STATUS_CREATED) -+ { -+ PKA_ERROR(PKA_DEV, "PKA device status must be finalized\n"); -+ return -EPERM; -+ } -+ -+ res_buffer_ram = &shim->resources.buffer_ram; -+ res_master_prog_ram = &shim->resources.master_prog_ram; -+ res_master_seq_ctrl = &shim->resources.master_seq_ctrl; -+ res_aic_csr = &shim->resources.aic_csr; -+ res_trng_csr = &shim->resources.trng_csr; -+ -+ pka_dev_unset_resource_config(shim, res_buffer_ram); -+ pka_dev_unset_resource_config(shim, res_master_prog_ram); -+ pka_dev_unset_resource_config(shim, res_master_seq_ctrl); -+ pka_dev_unset_resource_config(shim, res_aic_csr); -+ pka_dev_unset_resource_config(shim, res_trng_csr); -+ -+ kfree(shim->rings); -+ -+ shim->status = PKA_SHIM_STATUS_UNDEFINED; -+ -+ return ret; -+} -+ -+static int pka_dev_config_aic_interrupts(pka_dev_res_t *aic_csr_ptr) -+{ -+ int ret = 0; -+ -+ uint64_t csr_reg_base, csr_reg_off; -+ void *csr_reg_ptr; -+ -+ if (aic_csr_ptr->status != PKA_DEV_RES_STATUS_MAPPED || -+ aic_csr_ptr->type != PKA_DEV_RES_TYPE_REG) -+ return -EPERM; -+ -+ PKA_DEBUG(PKA_DEV, "configure the AIC so that all interrupts " -+ "are properly recognized\n"); -+ -+ csr_reg_base = aic_csr_ptr->base; -+ csr_reg_ptr = aic_csr_ptr->ioaddr; -+ -+ // Configure the signal polarity for each interrupt. -+ csr_reg_off = -+ pka_dev_get_register_offset(csr_reg_base, AIC_POL_CTRL_ADDR); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, PKA_AIC_POL_CTRL_REG_VAL); -+ -+ // Configure the signal type for each interrupt -+ csr_reg_off = -+ pka_dev_get_register_offset(csr_reg_base, AIC_TYPE_CTRL_ADDR); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, PKA_AIC_TYPE_CTRL_REG_VAL); -+ -+ // Set the enable control register -+ csr_reg_off = -+ pka_dev_get_register_offset(csr_reg_base, AIC_ENABLE_CTRL_ADDR); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, PKA_AIC_ENABLE_CTRL_REG_VAL); -+ -+ // Set the enabled status register -+ csr_reg_off = -+ pka_dev_get_register_offset(csr_reg_base, AIC_ENABLED_STAT_ADDR); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, PKA_AIC_ENABLE_STAT_REG_VAL); -+ -+ // *TBD* Write PKA_INT_MASK_RESET with 1's for each interrupt bit -+ // to allow them to propagate out the interrupt controller. -+ // EIP-154 interrupts can still be programmed and observed via polling -+ // regardless of whether PKA_INT_MASK is masking out the interrupts or -+ // not. The mask is for system propagation, i.e. propagate to the GIC. -+ // Bit positions are as follows: -+ // Bit 10 - parity_error_irq (non EIP-154 interrupt) -+ // Bit 9 - trng_irq -+ // Bit 8 - pka_master_irq -+ // Bits 7:4 - pka_queue_*_result_irq -+ // Bits 3:0 - pka_queue_*_empty_irq -+ -+ return ret; -+} -+ -+static int pka_dev_load_image(pka_dev_res_t *res_ptr, const uint32_t *data_buf, -+ uint32_t size) -+{ -+ uint64_t data_rd; -+ int mismatches; -+ int i, j, ret = 0; -+ -+ if (res_ptr->status != PKA_DEV_RES_STATUS_MAPPED || -+ res_ptr->type != PKA_DEV_RES_TYPE_MEM) -+ return -EPERM; -+ -+ // Note that the image size is in word of 4 bytes and memory 'writes' -+ // are 8 bytes aligned, thus the memory start address and end address -+ // are shifted. -+ if (res_ptr->size < (size * BYTES_PER_WORD) << 1) -+ { -+ PKA_ERROR(PKA_DEV, "image size greater than memory size\n"); -+ return -EINVAL; -+ } -+ -+ for (i = 0, j = 0; i < size; i++, j += BYTES_PER_DOUBLE_WORD) -+ pka_dev_io_write(res_ptr->ioaddr, j, -+ (uint64_t) data_buf[i]); -+ -+ mismatches = 0; -+ PKA_DEBUG(PKA_DEV, "PKA DEV: verifying image (%u words)\n", size); -+ for (i = 0, j = 0; i < size; i++, j += BYTES_PER_DOUBLE_WORD) -+ { -+ data_rd = pka_dev_io_read(res_ptr->ioaddr, j); -+ if (data_rd != (uint64_t) data_buf[i]) -+ { -+ mismatches += 1; -+ PKA_DEBUG(PKA_DEV, "error while loading image: " -+ "addr:0x%llx expected data: 0x%x actual data: 0x%llx\n", -+ res_ptr->base + j, -+ data_buf[i], data_rd); -+ } -+ } -+ -+ if (mismatches > 0) -+ { -+ PKA_PANIC(PKA_DEV, "error while loading image: mismatches: %d\n", -+ mismatches); -+ return -EAGAIN; -+ } -+ -+ return ret; -+} -+ -+static int -+pka_dev_config_master_seq_controller(pka_dev_shim_t *shim, -+ pka_dev_res_t *master_seq_ctrl_ptr) -+{ -+ pka_dev_res_t *aic_csr_ptr, *master_prog_ram; -+ void *aic_reg_ptr, *master_reg_ptr; -+ -+ uint64_t aic_reg_base, aic_reg_off; -+ uint64_t master_reg_base, master_reg_off; -+ -+ const uint32_t *boot_img_ptr, *master_img_ptr; -+ uint32_t boot_img_size, master_img_size; -+ -+ uint32_t pka_master_irq; -+ -+ uint64_t timer; -+ uint8_t status_bits; -+ uint8_t shim_fw_id; -+ int ret = 0; -+ -+ if (master_seq_ctrl_ptr->status != PKA_DEV_RES_STATUS_MAPPED || -+ master_seq_ctrl_ptr->type != PKA_DEV_RES_TYPE_REG) -+ return -EPERM; -+ -+ master_reg_base = master_seq_ctrl_ptr->base; -+ master_reg_ptr = master_seq_ctrl_ptr->ioaddr; -+ master_reg_off = pka_dev_get_register_offset(master_reg_base, -+ PKA_MASTER_SEQ_CTRL_ADDR); -+ -+ PKA_DEBUG(PKA_DEV, "push the EIP-154 master controller into reset\n"); -+ pka_dev_io_write(master_reg_ptr, master_reg_off, -+ PKA_MASTER_SEQ_CTRL_RESET_VAL); -+ -+ shim_fw_id = pka_firmware_get_id(); -+ -+ // Load boot image into PKA_MASTER_PROG_RAM -+ boot_img_size = pka_firmware_array[shim_fw_id].boot_img_size; -+ PKA_DEBUG(PKA_DEV, "loading boot image (%d words)\n", boot_img_size); -+ -+ boot_img_ptr = pka_firmware_array[shim_fw_id].boot_img; -+ ret = pka_dev_load_image(&shim->resources.master_prog_ram, -+ boot_img_ptr, boot_img_size); -+ if (ret) -+ { -+ PKA_ERROR(PKA_DEV, "failed to load boot image\n"); -+ return ret; -+ } -+ -+ PKA_DEBUG(PKA_DEV, "take the EIP-154 master controller out of reset\n"); -+ pka_dev_io_write(master_reg_ptr, master_reg_off, 0); -+ -+ // Poll for 'pka_master_irq' bit in AIC_ENABLED_STAT register to indicate -+ // sequencer is initialized -+ aic_csr_ptr = &shim->resources.aic_csr; -+ if (aic_csr_ptr->status != PKA_DEV_RES_STATUS_MAPPED || -+ aic_csr_ptr->type != PKA_DEV_RES_TYPE_REG) -+ return -EPERM; -+ -+ aic_reg_base = aic_csr_ptr->base; -+ aic_reg_ptr = aic_csr_ptr->ioaddr; -+ aic_reg_off = pka_dev_get_register_offset(aic_reg_base, -+ AIC_ENABLED_STAT_ADDR); -+ -+ pka_master_irq = 0; -+ PKA_DEBUG(PKA_DEV, "poll for 'pka_master_irq'\n"); -+ timer = pka_dev_timer_start(100000); // 100 msec -+ while (pka_master_irq == 0) -+ { -+ pka_master_irq |= pka_dev_io_read(aic_reg_ptr, aic_reg_off) -+ & PKA_AIC_ENABLED_STAT_MASTER_IRQ_MASK; -+ if (pka_dev_timer_done(timer)) -+ { -+ //PKA_PANIC(PKA_DEV, "failed to load firmware\n"); -+ return -EAGAIN; -+ } -+ } -+ PKA_DEBUG(PKA_DEV, "'pka_master_irq' is active\n"); -+ -+ // Verify that the EIP-154 boot firmware has finished without errors -+ status_bits = (uint8_t)((pka_dev_io_read(master_reg_ptr, -+ master_reg_off) >> PKA_MASTER_SEQ_CTRL_MASTER_IRQ_BIT) -+ & 0xff); -+ if (status_bits != PKA_MASTER_SEQ_CTRL_STATUS_BYTE) -+ { -+ // If the error indication (bit [15]) is set, -+ // the EIP-154 boot firmware encountered an error and is stopped. -+ if ((status_bits >> (PKA_MASTER_SEQ_CTRL_MASTER_IRQ_BIT - 1)) == 1) -+ { -+ PKA_ERROR(PKA_DEV, -+ "boot firmware encountered an error 0x%x and is stopped\n", -+ status_bits); -+ return -EAGAIN; -+ } -+ PKA_DEBUG(PKA_DEV, "boot firmware in progress %d", status_bits); -+ } -+ PKA_DEBUG(PKA_DEV, "boot firmware has finished successfully\n"); -+ -+ PKA_DEBUG(PKA_DEV, "push the EIP-154 master controller into reset\n"); -+ pka_dev_io_write(master_reg_ptr, master_reg_off, -+ PKA_MASTER_SEQ_CTRL_RESET_VAL); -+ -+ // Load Master image into PKA_MASTER_PROG_RAM -+ master_img_size = pka_firmware_array[shim_fw_id].master_img_size; -+ PKA_DEBUG(PKA_DEV, "loading master image (%d words)\n", -+ master_img_size); -+ master_prog_ram = &shim->resources.master_prog_ram; -+ master_img_ptr = pka_firmware_array[shim_fw_id].master_img; -+ ret = pka_dev_load_image(master_prog_ram, master_img_ptr, -+ master_img_size); -+ if (ret) -+ { -+ pr_err("PKA DEV: failed to load master image\n"); -+ return ret; -+ } -+ -+ PKA_DEBUG(PKA_DEV, "take the EIP-154 master controller out of reset\n"); -+ pka_dev_io_write(master_reg_ptr, master_reg_off, 0); -+ -+ return ret; -+} -+ -+// Configure ring options. -+static int pka_dev_config_ring_options(pka_dev_res_t *buffer_ram_ptr, -+ uint32_t rings_num, uint8_t ring_priority) -+{ -+ uint64_t control_word; -+ uint64_t word_off; -+ int ret = 0; -+ -+ if (buffer_ram_ptr->status != PKA_DEV_RES_STATUS_MAPPED || -+ buffer_ram_ptr->type != PKA_DEV_RES_TYPE_MEM) -+ return -EPERM; -+ -+ if (rings_num > PKA_MAX_NUM_RINGS || -+ rings_num < 1) -+ { -+ PKA_ERROR(PKA_DEV, "invalid rings number\n"); -+ return -EINVAL; -+ } -+ -+ PKA_DEBUG(PKA_DEV, "Configure PKA ring options control word\n"); -+ -+ // Write PKA_RING_OPTIONS control word located in the PKA_BUFFER_RAM. The -+ // value of this word is determined by the PKA I/O block (Shim). Set the -+ // number of implemented command/result ring pairs that is available in -+ // this EIP-154, encoded as binary value, which is 4. -+ control_word = (uint64_t) 0x0; -+ control_word |= ring_priority & 0xff; -+ control_word |= ((rings_num - 1) << 8) & 0xff00; -+ control_word |= (PKA_RING_OPTIONS_SIGNATURE_BYTE << 24) & 0xff000000; -+ word_off = pka_dev_get_word_offset(buffer_ram_ptr->base, -+ PKA_RING_OPTIONS_ADDR, PKA_BUFFER_RAM_SIZE); -+ pka_dev_io_write(buffer_ram_ptr->ioaddr, word_off, control_word); -+ -+ return ret; -+} -+ -+static int pka_dev_config_trng_clk(pka_dev_res_t *aic_csr_ptr) -+{ -+ int ret = 0; -+ -+ uint64_t csr_reg_base, csr_reg_off; -+ uint64_t timer; -+ uint32_t trng_clk_en = 0; -+ void *csr_reg_ptr; -+ -+ if (aic_csr_ptr->status != PKA_DEV_RES_STATUS_MAPPED || -+ aic_csr_ptr->type != PKA_DEV_RES_TYPE_REG) -+ return -EPERM; -+ -+ PKA_DEBUG(PKA_DEV, "Turn on TRNG clock\n"); -+ -+ csr_reg_base = aic_csr_ptr->base; -+ csr_reg_ptr = aic_csr_ptr->ioaddr; -+ -+ // Enable the TRNG clock in PKA_CLK_FORCE. -+ // In general, this register should be left in its default state of all -+ // zeroes! Only when the TRNG is directly controlled via the Host slave -+ // interface, the engine needs to be turned on using the ’trng_clk_on’ -+ // bit in this register. In case the TRNG is controlled via internal -+ // firmware, this is not required. -+ csr_reg_off = -+ pka_dev_get_register_offset(csr_reg_base, PKA_CLK_FORCE_ADDR); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, PKA_CLK_FORCE_TRNG_ON); -+ // Check whether the system clock for TRNG engine is enabled. The clock -+ // MUST be running to provide access to the TRNG. -+ timer = pka_dev_timer_start(100000); // 100 msec -+ while (trng_clk_en == 0) -+ { -+ trng_clk_en |= pka_dev_io_read(csr_reg_ptr, csr_reg_off) -+ & PKA_CLK_FORCE_TRNG_ON; -+ if (pka_dev_timer_done(timer)) -+ { -+ PKA_DEBUG(PKA_DEV, "Failed to enable TRNG clock\n"); -+ return -EAGAIN; -+ } -+ } -+ PKA_DEBUG(PKA_DEV, "'trng_clk_on' is enabled\n"); -+ -+ return ret; -+} -+ -+static int pka_dev_trng_wait_test_ready(void *csr_reg_ptr, uint64_t csr_reg_base) -+{ -+ uint64_t csr_reg_off, timer, test_ready, csr_reg_val; -+ -+ test_ready = 0; -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, TRNG_STATUS_ADDR); -+ timer = pka_dev_timer_start(1000000); // 1000 ms -+ -+ while (!test_ready) -+ { -+ csr_reg_val = pka_dev_io_read(csr_reg_ptr, csr_reg_off); -+ test_ready = csr_reg_val & PKA_TRNG_STATUS_TEST_READY; -+ -+ if (pka_dev_timer_done(timer)) -+ { -+ PKA_DEBUG(PKA_DEV, "TRNG: TEST ready timer done, 0x%llx\n", csr_reg_val); -+ return 1; -+ } -+ } -+ -+ return 0; -+} -+ -+static int pka_dev_trng_enable_test(void *csr_reg_ptr, uint64_t csr_reg_base, -+ uint32_t test) -+{ -+ uint64_t csr_reg_val, csr_reg_off; -+ -+ // Set the ‘test_mode’ bit in the TRNG_CONTROL register and the -+ // ‘test_known_noise’ bit in the TRNG_TEST register – this will -+ // immediately set the ‘test_ready’ bit (in the TRNG_STATUS register) -+ // to indicate that data can be written. It will also reset the -+ // ‘monobit test’, ‘run test’ and ‘poker test’ circuits to their -+ // initial states. Note that the TRNG need not be enabled for this -+ // test. -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, TRNG_CONTROL_ADDR); -+ csr_reg_val = pka_dev_io_read(csr_reg_ptr, csr_reg_off); -+ -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, TRNG_CONTROL_ADDR); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, -+ csr_reg_val | PKA_TRNG_CONTROL_TEST_MODE); -+ -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, TRNG_TEST_ADDR); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, test); -+ -+ // Wait until the 'test_ready' bit is set -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, TRNG_STATUS_ADDR); -+ do -+ { -+ csr_reg_val = pka_dev_io_read(csr_reg_ptr, csr_reg_off); -+ } while((csr_reg_val & PKA_TRNG_STATUS_TEST_READY) == 0); -+ -+ // Check whether the 'monobit test', 'run test' and 'poker test' -+ // are reset. -+ if (csr_reg_val & (PKA_TRNG_STATUS_MONOBIT_FAIL -+ | PKA_TRNG_STATUS_RUN_FAIL -+ | PKA_TRNG_STATUS_POKER_FAIL)) -+ { -+ PKA_ERROR(PKA_DEV, "Test bits aren't reset, TRNG_STATUS:0x%llx\n", -+ csr_reg_val); -+ return -EAGAIN; -+ } -+ -+ // Set 'stall_run_poker' bit to allow inspecting the state of the -+ // result counters which would otherwise be reset immediately for -+ // the next 20,000 bits block to test. -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, TRNG_ALARMCNT_ADDR); -+ csr_reg_val = pka_dev_io_read(csr_reg_ptr, csr_reg_off); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, -+ csr_reg_val | PKA_TRNG_ALARMCNT_STALL_RUN_POKER); -+ -+ return 0; -+} -+ -+static int pka_dev_trng_test_circuits(void *csr_reg_ptr, uint64_t csr_reg_base, -+ uint64_t datal, uint64_t datah, -+ int count, uint8_t add_half, -+ uint64_t *monobit_fail_cnt, -+ uint64_t *run_fail_cnt, -+ uint64_t *poker_fail_cnt) -+{ -+ uint64_t status, csr_reg_off; -+ int test_idx, error; -+ -+ if (monobit_fail_cnt == NULL || run_fail_cnt == NULL || poker_fail_cnt == NULL) -+ return -EINVAL; -+ -+ error = 0; -+ -+ for (test_idx = 0; test_idx < count; test_idx++) -+ { -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, TRNG_RAW_L_ADDR); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, datal); -+ -+ if (add_half) -+ { -+ if (test_idx < count - 1) -+ { -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, TRNG_RAW_H_ADDR); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, datah); -+ } -+ } -+ else -+ { -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, TRNG_RAW_H_ADDR); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, datah); -+ } -+ -+ // Wait until the ‘test_ready’ bit in the TRNG_STATUS register -+ // becomes ‘1’ again, signaling readiness for the next 64 bits -+ // of test data. At this point, the previous test data has -+ // been handled so the counter states can be inspected. -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, TRNG_STATUS_ADDR); -+ do -+ { -+ status = pka_dev_io_read(csr_reg_ptr, csr_reg_off); -+ } while((status & PKA_TRNG_STATUS_TEST_READY) == 0); -+ -+ // Check test status bits. -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, TRNG_INTACK_ADDR); -+ if (status & PKA_TRNG_STATUS_MONOBIT_FAIL) -+ { -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, PKA_TRNG_STATUS_MONOBIT_FAIL); -+ *monobit_fail_cnt += 1; -+ } -+ else if (status & PKA_TRNG_STATUS_RUN_FAIL) -+ { -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, PKA_TRNG_STATUS_RUN_FAIL); -+ *run_fail_cnt += 1; -+ } -+ else if (status & PKA_TRNG_STATUS_POKER_FAIL) -+ { -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, PKA_TRNG_STATUS_POKER_FAIL); -+ *poker_fail_cnt += 1; -+ } -+ -+ } -+ -+ error = (*monobit_fail_cnt || *poker_fail_cnt || *run_fail_cnt) ? -EIO : 0; -+ -+ return error; -+} -+ -+static void pka_dev_trng_disable_test(void *csr_reg_ptr, uint64_t csr_reg_base) -+{ -+ uint64_t status, val, csr_reg_off; -+ -+ // When done, clear the ‘test_known_noise’ bit in the TRNG_TEST -+ // register (will immediately clear the ‘test_ready’ bit in the -+ // TRNG_STATUS register and reset the ‘monobit test’, ‘run test’ -+ // and ‘poker test’ circuits) and clear the ‘test_mode’ bit in -+ // the TRNG_CONTROL register. -+ -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, TRNG_TEST_ADDR); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, 0); -+ -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, TRNG_STATUS_ADDR); -+ status = pka_dev_io_read(csr_reg_ptr, csr_reg_off); -+ -+ if (status & PKA_TRNG_STATUS_TEST_READY) -+ PKA_PRINT(PKA_DEV, "Warning: Test ready bit is still set\n"); -+ -+ if (status & (PKA_TRNG_STATUS_MONOBIT_FAIL -+ | PKA_TRNG_STATUS_RUN_FAIL -+ | PKA_TRNG_STATUS_POKER_FAIL)) -+ PKA_PRINT(PKA_DEV, -+ "Warning: Test bits are still set, TRNG_STATUS:0x%llx\n", status); -+ -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, TRNG_CONTROL_ADDR); -+ val = pka_dev_io_read(csr_reg_ptr, csr_reg_off); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, -+ (val & ~PKA_TRNG_STATUS_TEST_READY)); -+ -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, TRNG_ALARMCNT_ADDR); -+ val = pka_dev_io_read(csr_reg_ptr, csr_reg_off); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, -+ (val & ~PKA_TRNG_ALARMCNT_STALL_RUN_POKER)); -+ -+ return; -+} -+ -+static int pka_dev_trng_test_known_answer_basic(void *csr_reg_ptr, -+ uint64_t csr_reg_base) -+{ -+ int ret, cnt_idx, cnt_off; -+ uint64_t monobit_fail_cnt, run_fail_cnt, poker_fail_cnt, monobit_cnt; -+ uint64_t poker_cnt[4], csr_reg_off; -+ uint64_t poker_test_exp_cnt[4] = { -+ 0x20f42bf4, 0xaf415f4, 0xf4f4fff4, 0xfff4f4f4 -+ }; -+ -+ PKA_DEBUG(PKA_DEV, "Run known-answer test circuits\n"); -+ -+ monobit_fail_cnt = 0; -+ run_fail_cnt = 0; -+ poker_fail_cnt = 0; -+ -+ ret = pka_dev_trng_enable_test(csr_reg_ptr, csr_reg_base, -+ PKA_TRNG_TEST_KNOWN_NOISE); -+ if (ret) -+ return ret; -+ -+ ret = pka_dev_trng_test_circuits(csr_reg_ptr, csr_reg_base, 0x11111333, -+ 0x3555779f, 11, 0, &monobit_fail_cnt, &run_fail_cnt, -+ &poker_fail_cnt); -+ -+ ret |= pka_dev_trng_test_circuits(csr_reg_ptr, csr_reg_base, 0x01234567, -+ 0x89abcdef, 302, 1, &monobit_fail_cnt, &run_fail_cnt, -+ &poker_fail_cnt); -+ -+ PKA_DEBUG(PKA_DEV, "monobit_fail_cnt : 0x%llx\n", monobit_fail_cnt); -+ PKA_DEBUG(PKA_DEV, "poker_fail_cnt : 0x%llx\n", poker_fail_cnt); -+ PKA_DEBUG(PKA_DEV, "run_fail_cnt : 0x%llx\n", run_fail_cnt); -+ -+ for (cnt_idx = 0, cnt_off = 0; cnt_idx < 4; cnt_idx++, cnt_off += 8) -+ { -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, -+ (TRNG_POKER_3_0_ADDR + cnt_off)); -+ poker_cnt[cnt_idx] = pka_dev_io_read(csr_reg_ptr, csr_reg_off); -+ } -+ -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, -+ TRNG_MONOBITCNT_ADDR); -+ monobit_cnt = pka_dev_io_read(csr_reg_ptr, csr_reg_off); -+ -+ if (!ret) -+ { -+ if (memcmp(poker_cnt, poker_test_exp_cnt, sizeof(poker_test_exp_cnt))) -+ { -+ PKA_DEBUG(PKA_DEV, "invalid poker counters!\n"); -+ ret = -EIO; -+ } -+ -+ if (monobit_cnt != 9978) -+ { -+ PKA_DEBUG(PKA_DEV, "invalid sum of squares!\n"); -+ ret = -EIO; -+ } -+ } -+ -+ pka_dev_trng_disable_test(csr_reg_ptr, csr_reg_base); -+ -+ return ret; -+} -+ -+static int pka_dev_trng_test_known_answer_poker_fail(void *csr_reg_ptr, -+ uint64_t csr_reg_base) -+{ -+ uint64_t monobit_fail_cnt, run_fail_cnt, poker_fail_cnt; -+ int ret; -+ -+ monobit_fail_cnt = 0; -+ run_fail_cnt = 0; -+ poker_fail_cnt = 0; -+ -+ PKA_DEBUG(PKA_DEV, "Run known-answer test circuits (poker fail)\n"); -+ -+ pka_dev_trng_enable_test(csr_reg_ptr, csr_reg_base, -+ PKA_TRNG_TEST_KNOWN_NOISE); -+ -+ // Ignore the return value here as it is expected that poker test should -+ // fail. Check failure counts thereafter to assert only poker test has failed. -+ pka_dev_trng_test_circuits(csr_reg_ptr, csr_reg_base, 0xffffffff, -+ 0xffffffff, 11, 0, &monobit_fail_cnt, &run_fail_cnt, &poker_fail_cnt); -+ -+ PKA_DEBUG(PKA_DEV, "monobit_fail_cnt : 0x%llx\n", monobit_fail_cnt); -+ PKA_DEBUG(PKA_DEV, "poker_fail_cnt : 0x%llx\n", poker_fail_cnt); -+ PKA_DEBUG(PKA_DEV, "run_fail_cnt : 0x%llx\n", run_fail_cnt); -+ -+ if (poker_fail_cnt && !run_fail_cnt && !monobit_fail_cnt) -+ ret = 0; -+ else -+ ret = -EIO; -+ -+ pka_dev_trng_disable_test(csr_reg_ptr, csr_reg_base); -+ -+ return ret; -+} -+ -+static int pka_dev_trng_test_unknown_answer(void *csr_reg_ptr, -+ uint64_t csr_reg_base) -+{ -+ uint64_t datal, datah, csr_reg_off; -+ int ret, test_idx; -+ -+ datah = 0; -+ datal = 0; -+ ret = 0; -+ -+ PKA_DEBUG(PKA_DEV, "Run unknown-answer self test\n"); -+ -+ // First reset, the RAW registers. -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, -+ TRNG_RAW_L_ADDR); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, 0); -+ -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, -+ TRNG_RAW_H_ADDR); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, 0); -+ -+ // There is a small probability for this test to fail, -+ // So run the test 10 times, if it succeeds once then -+ // assume that the test passed. -+ for (test_idx = 0; test_idx < 10; test_idx++) -+ { -+ pka_dev_trng_enable_test(csr_reg_ptr, csr_reg_base, PKA_TRNG_TEST_NOISE); -+ -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, -+ TRNG_RAW_L_ADDR); -+ datal = pka_dev_io_read(csr_reg_ptr, csr_reg_off); -+ -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, -+ TRNG_RAW_H_ADDR); -+ datah = pka_dev_io_read(csr_reg_ptr, csr_reg_off); -+ -+ PKA_DEBUG(PKA_DEV, "datal=0x%llx\n", datal); -+ PKA_DEBUG(PKA_DEV, "datah=0x%llx\n", datah); -+ -+ if (!datah && !datal) -+ { -+ ret = -EIO; -+ } -+ else -+ { -+ ret = 0; -+ break; -+ } -+ -+ pka_dev_trng_disable_test(csr_reg_ptr, csr_reg_base); -+ } -+ -+ return ret; -+} -+ -+// Test TRNG -+static int pka_dev_test_trng(void *csr_reg_ptr, uint64_t csr_reg_base) -+{ -+ int ret; -+ -+ ret = 0; -+ -+ ret = pka_dev_trng_test_known_answer_basic(csr_reg_ptr, csr_reg_base); -+ if (ret) -+ goto exit; -+ -+ ret = pka_dev_trng_test_known_answer_poker_fail(csr_reg_ptr, csr_reg_base); -+ if (ret) -+ goto exit; -+ -+ ret = pka_dev_trng_test_unknown_answer(csr_reg_ptr, csr_reg_base); -+ if (ret) -+ goto exit; -+ -+exit: -+ return ret; -+} -+ -+static void pka_dev_trng_write_ps_ai_str(void *csr_reg_ptr, -+ uint64_t csr_reg_base, -+ uint32_t input_str[]) -+{ -+ uint64_t csr_reg_off; -+ int i; -+ -+ for (i = 0; i < PKA_TRNG_PS_AI_REG_COUNT; i++) -+ { -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, -+ TRNG_PS_AI_0_ADDR + (i * 0x8)); -+ -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, input_str[i]); -+ } -+} -+ -+static void pka_dev_trng_drbg_generate(void *csr_reg_ptr, uint64_t csr_reg_base) -+{ -+ uint64_t csr_reg_off; -+ -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, TRNG_CONTROL_ADDR); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, PKA_TRNG_CONTROL_REQ_DATA_VAL); -+} -+ -+static int pka_dev_test_trng_drbg(void *csr_reg_ptr, uint64_t csr_reg_base) -+{ -+ uint64_t csr_reg_off, csr_reg_val; -+ int i, ret; -+ -+ ret = 0; -+ -+ // Make sure the engine is idle. -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, TRNG_CONTROL_ADDR); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, 0); -+ -+ // Enable DRBG, TRNG need not be enabled for this test. -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, TRNG_CONTROL_ADDR); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, PKA_TRNG_CONTROL_DRBG_ENABLE_VAL); -+ -+ // Set 'test_sp_800_90' bit in the TRNG_TEST register -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, TRNG_TEST_ADDR); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, PKA_TRNG_TEST_DRBG_VAL); -+ -+ // Wait for 'test_ready' bit to be set. -+ ret = pka_dev_trng_wait_test_ready(csr_reg_ptr, csr_reg_base); -+ if (ret) -+ goto exit; -+ -+ // Instantiate -+ pka_dev_trng_write_ps_ai_str(csr_reg_ptr, csr_reg_base, pka_trng_drbg_test_ps_str); -+ ret = pka_dev_trng_wait_test_ready(csr_reg_ptr, csr_reg_base); -+ if (ret) -+ goto exit; -+ -+ // Generate -+ pka_dev_trng_write_ps_ai_str(csr_reg_ptr, csr_reg_base, pka_trng_drbg_test_etpy_str1); -+ ret = pka_dev_trng_wait_test_ready(csr_reg_ptr, csr_reg_base); -+ if (ret) -+ goto exit; -+ -+ // A standard NIST SP 800-90A DRBG known-answer test discards -+ // the result of the first 'Generate' function and only checks -+ // the result of the second 'Generate' function. Hence 'Generate' -+ // is performed again. -+ -+ // Generate -+ pka_dev_trng_write_ps_ai_str(csr_reg_ptr, csr_reg_base, pka_trng_drbg_test_etpy_str2); -+ ret = pka_dev_trng_wait_test_ready(csr_reg_ptr, csr_reg_base); -+ if (ret) -+ goto exit; -+ -+ // Check output registers -+ for (i = 0; i < PKA_TRNG_OUTPUT_CNT; i++) -+ { -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, -+ TRNG_OUTPUT_0_ADDR + (i * 0x8)); -+ -+ csr_reg_val = pka_dev_io_read(csr_reg_ptr, csr_reg_off); -+ -+ if ((uint32_t)csr_reg_val != pka_trng_drbg_test_output[i]) -+ { -+ PKA_DEBUG(PKA_DEV, -+ "DRBG known answer test failed for output register:%d, 0x%x\n", -+ i, (uint32_t)csr_reg_val); -+ ret = 1; -+ goto exit; -+ } -+ } -+ -+ // Clear 'test_sp_800_90' bit in the TRNG_TEST register. -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, TRNG_TEST_ADDR); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, 0); -+ -+exit: -+ return ret; -+} -+ -+// Configure the TRNG. -+static int pka_dev_config_trng_drbg(pka_dev_res_t *aic_csr_ptr, -+ pka_dev_res_t *trng_csr_ptr) -+{ -+ int ret = 0; -+ -+ uint64_t csr_reg_base, csr_reg_off; -+ void *csr_reg_ptr; -+ -+ if (trng_csr_ptr->status != PKA_DEV_RES_STATUS_MAPPED || -+ trng_csr_ptr->type != PKA_DEV_RES_TYPE_REG) -+ return -EPERM; -+ -+ PKA_DEBUG(PKA_DEV, "Starting up the TRNG\n"); -+ -+ ret = pka_dev_config_trng_clk(aic_csr_ptr); -+ if (ret) -+ return ret; -+ -+ csr_reg_base = trng_csr_ptr->base; -+ csr_reg_ptr = trng_csr_ptr->ioaddr; -+ -+ // Perform NIST known-answer tests on the complete SP 800-90A DRBG -+ // without BC_DF functionality. -+ ret = pka_dev_test_trng_drbg(csr_reg_ptr, csr_reg_base); -+ if (ret) -+ return ret; -+ -+ // Starting up the TRNG with a DRBG -+ -+ // Make sure the engine is idle. -+ csr_reg_off = -+ pka_dev_get_register_offset(csr_reg_base, TRNG_CONTROL_ADDR); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, 0); -+ -+ // Disable all FROs initially -+ csr_reg_off = -+ pka_dev_get_register_offset(csr_reg_base, TRNG_FROENABLE_ADDR); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, 0); -+ csr_reg_off = -+ pka_dev_get_register_offset(csr_reg_base, TRNG_FRODETUNE_ADDR); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, 0); -+ -+ // Write all configuration values in the TRNG_CONFIG and TRNG_ALARMCNT, -+ // write zeroes to the TRNG_ALARMMASK and TRNG_ALARMSTOP registers. -+ csr_reg_off = -+ pka_dev_get_register_offset(csr_reg_base, TRNG_CONFIG_ADDR); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, PKA_TRNG_CONFIG_REG_VAL); -+ csr_reg_off = -+ pka_dev_get_register_offset(csr_reg_base, TRNG_ALARMCNT_ADDR); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, PKA_TRNG_ALARMCNT_REG_VAL); -+ -+ csr_reg_off = -+ pka_dev_get_register_offset(csr_reg_base, TRNG_ALARMMASK_ADDR); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, 0); -+ csr_reg_off = -+ pka_dev_get_register_offset(csr_reg_base, TRNG_ALARMSTOP_ADDR); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, 0); -+ -+ // Enable all FROs in the TRNG_FROENABLE register. Note that this can -+ // only be done after clearing the TRNG_ALARMSTOP register. -+ csr_reg_off = -+ pka_dev_get_register_offset(csr_reg_base, TRNG_FROENABLE_ADDR); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, PKA_TRNG_FROENABLE_REG_VAL); -+ -+ // Optionally, write 'Personalization string' of upto 384 bits in -+ // TRNG_PS_AI_... registers. The contents of these registers will be -+ // XOR-ed into the output of the SHA-256 'Conditioning Function' to be -+ // used as seed value for the actual DRBG. -+ pka_dev_trng_write_ps_ai_str(csr_reg_ptr, csr_reg_base, pka_trng_drbg_ps_str); -+ -+ -+ // Run TRNG tests after configuring TRNG. -+ // NOTE: TRNG need not be enabled to carry out these tests. -+ ret = pka_dev_test_trng(csr_reg_ptr, csr_reg_base); -+ if (ret) -+ return ret; -+ -+ // Start the actual engine by setting the 'enable_trng' and 'drbg_en' bit -+ // in the TRNG_CONTROL register (also a nice point to set the interrupt mask -+ // bits). -+ csr_reg_off = -+ pka_dev_get_register_offset(csr_reg_base, TRNG_CONTROL_ADDR); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, PKA_TRNG_CONTROL_DRBG_REG_VAL); -+ -+ // The engine is now ready to handle the first 'Generate' request using -+ // the 'request_data' bit of the TRNG_CONTROL register. The first output -+ // for these requests will take a while, as Noise Source and Conditioning -+ // Function must first generate seed entropy for the DRBG. -+ -+ -+ // Optionally, when buffer RAM is configured: Set a data available -+ // interrupt threshold using the 'load_thresh' and 'blocks_thresh' -+ // fields of the TRNG_INTACK register. This allows delaying the data -+ // available interrupt until the indicated number of 128-bit words are -+ // available in the buffer RAM. -+ -+ // Start the actual 'Generate' operation using the 'request_data' and 'data_blocks' -+ // fields of the TRNG_CONTROL register. -+ -+ pka_dev_trng_drbg_generate(csr_reg_ptr, csr_reg_base); -+ -+ mdelay(200); -+ -+ return ret; -+} -+ -+// Triggers hardaware zeorize to initialize PKA internal memories -+static int pka_dev_ram_zeroize(pka_dev_res_t *ext_csr_ptr) -+{ -+ uint64_t csr_reg_base, csr_reg_off, csr_reg_value; -+ uint64_t timer; -+ void *csr_reg_ptr; -+ -+ if (ext_csr_ptr->status != PKA_DEV_RES_STATUS_MAPPED || -+ ext_csr_ptr->type != PKA_DEV_RES_TYPE_REG) -+ return -EPERM; -+ -+ PKA_DEBUG(PKA_DEV, "Starting memory zeroize\n"); -+ -+ csr_reg_base = ext_csr_ptr->base; -+ csr_reg_ptr = ext_csr_ptr->ioaddr; -+ -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, -+ PKA_ZEROIZE_ADDR); -+ // When PKA_ZEROIZE register is written (with any value) -+ // sensitive data in the PKA is zeroed out. -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, 1); -+ -+ // Now wait until the zeroize completes -+ timer = pka_dev_timer_start(10000000); // 10000 ms -+ csr_reg_value = pka_dev_io_read(csr_reg_ptr, csr_reg_off); -+ while (csr_reg_value != 0) -+ { -+ csr_reg_value = pka_dev_io_read(csr_reg_ptr, csr_reg_off); -+ -+ if (pka_dev_timer_done(timer)) -+ { -+ PKA_DEBUG(PKA_DEV, "Timeout while PKA zeorize\n"); -+ return -EBUSY; -+ } -+ } -+ -+ return 0; -+} -+ -+// Initialize PKA IO block refered to as shim. It configures shim's -+// parameters and prepare resources by mapping corresponding memory. -+// The function also configures shim registers and load firmware to -+// shim internal rams. The pka_dev_shim_t passed as input is also an -+// output. It returns 0 on success, a negative error code on failure. -+static int pka_dev_init_shim(pka_dev_shim_t *shim) -+{ -+ const uint32_t *farm_img_ptr; -+ uint32_t farm_img_size, data[4], i; -+ uint8_t shim_fw_id; -+ -+ int ret = 0; -+ -+ if (shim->status != PKA_SHIM_STATUS_CREATED) -+ { -+ PKA_ERROR(PKA_DEV, "PKA device must be created\n"); -+ return -EPERM; -+ } -+ -+ // First of all, trigger a hardware zeroize to initialize internal -+ // RAM memories -+ ret = pka_dev_ram_zeroize(&shim->resources.ext_csr); -+ if (ret) -+ { -+ PKA_ERROR(PKA_DEV, "failed to zeroize PKA\n"); -+ return ret; -+ } -+ -+ // Configure AIC registers -+ ret = pka_dev_config_aic_interrupts(&shim->resources.aic_csr); -+ if (ret) -+ { -+ PKA_ERROR(PKA_DEV, "failed to configure AIC\n"); -+ return ret; -+ } -+ -+ shim_fw_id = pka_firmware_get_id(); -+ -+ // Load Farm image into PKA_BUFFER_RAM for non-High Assurance mode -+ // or into PKA_SECURE_RAM for High Assurance mode. -+ farm_img_size = pka_firmware_array[shim_fw_id].farm_img_size; -+ PKA_DEBUG(PKA_DEV, "loading farm image (%d words)\n", farm_img_size); -+ -+ farm_img_ptr = pka_firmware_array[shim_fw_id].farm_img; -+ // The IP provider suggests using the zeroize function to initialize -+ // the Buffer RAM. But a bug has been detected when writing ECC bits. -+ // Thus a workaround is used, and has already been shown to work; it -+ // consists of padding the farm image. Then all RAM locations will be -+ // written with correct ECC before the IP reads the image out. -+ ret = pka_dev_load_image(&shim->resources.buffer_ram, farm_img_ptr, -+ farm_img_size); -+ if (ret) -+ { -+ PKA_ERROR(PKA_DEV, "failed to load farm image\n"); -+ return ret; -+ } -+ -+ // Configure EIP-154 Master controller Sequencer -+ ret = pka_dev_config_master_seq_controller(shim, -+ &shim->resources.master_seq_ctrl); -+ if (ret) -+ { -+ PKA_ERROR(PKA_DEV, "failed to configure Master controller " -+ "Sequencer\n"); -+ return ret; -+ } -+ -+ // Configure PKA Ring options control word -+ ret = pka_dev_config_ring_options(&shim->resources.buffer_ram, -+ shim->rings_num, shim->ring_priority); -+ if (ret) -+ { -+ PKA_ERROR(PKA_DEV, "failed to configure ring options\n"); -+ return ret; -+ } -+ -+ shim->trng_enabled = PKA_SHIM_TRNG_ENABLED; -+ shim->trng_err_cycle = 0; -+ -+ // Configure the TRNG -+ ret = pka_dev_config_trng_drbg(&shim->resources.aic_csr, -+ &shim->resources.trng_csr); -+ -+ // Pull out data from the content of the TRNG buffer RAM and -+ // start the re-generation of new numbers; read and drop 512 -+ // words. The read must be done over the 4 TRNG_OUTPUT_X registers -+ // at a time. -+ i = 0; -+ while (i < 128) -+ { -+ pka_dev_trng_read(shim, data, sizeof(data)); -+ i++; -+ } -+ -+ if (ret) -+ { -+ // Keep running without TRNG since it does not hurt, but -+ // notify users. -+ PKA_ERROR(PKA_DEV, "failed to configure TRNG\n"); -+ shim->trng_enabled = PKA_SHIM_TRNG_DISABLED; -+ } -+ -+ mutex_init(&shim->mutex); -+ shim->busy_ring_num = 0; -+ shim->status = PKA_SHIM_STATUS_INITIALIZED; -+ -+ return ret; -+} -+ -+// Release a given shim. -+static int pka_dev_release_shim(pka_dev_shim_t *shim) -+{ -+ int ret = 0; -+ -+ uint32_t ring_idx; -+ -+ if (shim->status != PKA_SHIM_STATUS_INITIALIZED && -+ shim->status != PKA_SHIM_STATUS_STOPPED) -+ { -+ PKA_ERROR(PKA_DEV, "PKA device must be initialized or stopped\n"); -+ return -EPERM; -+ } -+ -+ // Release rings which belong to the shim. The operating system might -+ // release ring devices before shim devices. The global configuration -+ // must be checked before proceeding to the release of ring devices. -+ if (pka_gbl_config.dev_rings_cnt) -+ { -+ for (ring_idx = 0; ring_idx < shim->rings_num; ring_idx++) -+ { -+ ret = pka_dev_release_ring(shim->rings[ring_idx]); -+ if (ret) -+ { -+ PKA_ERROR(PKA_DEV, "failed to release ring %d\n", ring_idx); -+ return ret; -+ } -+ } -+ } -+ -+ shim->busy_ring_num = 0; -+ shim->status = PKA_SHIM_STATUS_FINALIZED; -+ -+ return ret; -+} -+ -+// Return the ring associated with the given identifier. -+pka_dev_ring_t *pka_dev_get_ring(uint32_t ring_id) -+{ -+ return pka_gbl_config.dev_rings[ring_id]; -+} -+ -+// Return the shim associated with the given identifier. -+pka_dev_shim_t *pka_dev_get_shim(uint32_t shim_id) -+{ -+ return pka_gbl_config.dev_shims[shim_id]; -+} -+ -+ -+static pka_dev_ring_t *__pka_dev_register_ring(uint32_t ring_id, -+ uint32_t shim_id) -+{ -+ pka_dev_shim_t *shim; -+ pka_dev_ring_t *ring; -+ -+ int ret; -+ -+ shim = pka_dev_get_shim(shim_id); -+ if (!shim) -+ return NULL; -+ -+ ring = kzalloc(sizeof(pka_dev_ring_t), GFP_KERNEL); -+ if (!ring) -+ return ring; -+ -+ ring->status = PKA_DEV_RING_STATUS_UNDEFINED; -+ -+ // Initialize ring. -+ ret = pka_dev_init_ring(ring, ring_id, shim); -+ if (ret) -+ { -+ PKA_ERROR(PKA_DEV, "failed to initialize ring %d\n", ring_id); -+ pka_dev_release_ring(ring); -+ kfree(ring); -+ return NULL; -+ } -+ -+ return ring; -+} -+ -+pka_dev_ring_t *pka_dev_register_ring(uint32_t ring_id, uint32_t shim_id) -+{ -+ pka_dev_ring_t *ring; -+ -+ ring = __pka_dev_register_ring(ring_id, shim_id); -+ if (ring) -+ { -+ pka_gbl_config.dev_rings[ring->ring_id] = ring; -+ pka_gbl_config.dev_rings_cnt += 1; -+ } -+ -+ return ring; -+} -+ -+static int __pka_dev_unregister_ring(pka_dev_ring_t *ring) -+{ -+ int ret; -+ -+ if (!ring) -+ return -EINVAL; -+ -+ // Release ring -+ ret = pka_dev_release_ring(ring); -+ if (ret) -+ return ret; -+ -+ kfree(ring); -+ -+ return ret; -+} -+ -+int pka_dev_unregister_ring(pka_dev_ring_t *ring) -+{ -+ pka_gbl_config.dev_rings[ring->ring_id] = NULL; -+ pka_gbl_config.dev_rings_cnt -= 1; -+ -+ return __pka_dev_unregister_ring(ring); -+} -+ -+static pka_dev_shim_t *__pka_dev_register_shim(uint32_t shim_id, -+ struct pka_dev_mem_res *mem_res) -+{ -+ pka_dev_shim_t *shim; -+ -+ uint8_t split; -+ int ret = 0; -+ -+ PKA_DEBUG(PKA_DEV, "register shim id=%u\n", shim_id); -+ -+ shim = kzalloc(sizeof(pka_dev_shim_t), GFP_KERNEL); -+ if (!shim) -+ return shim; -+ -+ // Shim state MUST be set to undefined before calling 'pka_dev_create_shim' -+ // function -+ shim->status = PKA_SHIM_STATUS_UNDEFINED; -+ -+ // Set the Window RAM user mode -+ split = PKA_SPLIT_WINDOW_RAM_MODE; -+ -+ // Create PKA shim -+ ret = pka_dev_create_shim(shim, shim_id, split, mem_res); -+ if (ret) -+ { -+ PKA_ERROR(PKA_DEV, "failed to create shim %u\n", shim_id); -+ pka_dev_delete_shim(shim); -+ kfree(shim); -+ return NULL; -+ } -+ -+ // Initialize PKA shim -+ ret = pka_dev_init_shim(shim); -+ if (ret) -+ { -+ PKA_ERROR(PKA_DEV, "failed to init shim %u\n", shim_id); -+ pka_dev_release_shim(shim); -+ pka_dev_delete_shim(shim); -+ kfree(shim); -+ return NULL; -+ } -+ -+ return shim; -+} -+ -+pka_dev_shim_t *pka_dev_register_shim(uint32_t shim_id, uint8_t shim_fw_id, -+ struct pka_dev_mem_res *mem_res) -+{ -+ pka_dev_shim_t *shim; -+ -+ pka_firmware_set_id(shim_fw_id); -+ -+ shim = __pka_dev_register_shim(shim_id, mem_res); -+ if (shim) -+ { -+ pka_gbl_config.dev_shims[shim->shim_id] = shim; -+ pka_gbl_config.dev_shims_cnt += 1; -+ } -+ -+ return shim; -+} -+ -+static int __pka_dev_unregister_shim(pka_dev_shim_t *shim) -+{ -+ int ret = 0; -+ -+ if (!shim) -+ return -EINVAL; -+ -+ // Release shim -+ ret = pka_dev_release_shim(shim); -+ if (ret) -+ return ret; -+ -+ // Delete shim -+ ret = pka_dev_delete_shim(shim); -+ if (ret) -+ return ret; -+ -+ kfree(shim); -+ -+ return ret; -+} -+ -+int pka_dev_unregister_shim(pka_dev_shim_t *shim) -+{ -+ pka_gbl_config.dev_shims[shim->shim_id] = NULL; -+ pka_gbl_config.dev_shims_cnt -= 1; -+ -+ return __pka_dev_unregister_shim(shim); -+} -+ -+static bool pka_dev_trng_shutdown_oflo(pka_dev_res_t *trng_csr_ptr, -+ uint64_t *err_cycle) -+{ -+ uint64_t csr_reg_base, csr_reg_off, csr_reg_value; -+ uint64_t curr_cycle_cnt, fro_stopped_mask, fro_enabled_mask; -+ void *csr_reg_ptr; -+ -+ csr_reg_base = trng_csr_ptr->base; -+ csr_reg_ptr = trng_csr_ptr->ioaddr; -+ -+ csr_reg_off = -+ pka_dev_get_register_offset(csr_reg_base, TRNG_STATUS_ADDR); -+ csr_reg_value = pka_dev_io_read(csr_reg_ptr, csr_reg_off); -+ -+ if (csr_reg_value & PKA_TRNG_STATUS_SHUTDOWN_OFLO) -+ { -+ curr_cycle_cnt = get_cycles(); -+ // See if any FROs were shut down. If they were, toggle bits in the -+ // FRO detune register and reenable the FROs. -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, -+ TRNG_ALARMSTOP_ADDR); -+ fro_stopped_mask = pka_dev_io_read(csr_reg_ptr, csr_reg_off); -+ if (fro_stopped_mask) -+ { -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, -+ TRNG_FROENABLE_ADDR); -+ fro_enabled_mask = pka_dev_io_read(csr_reg_ptr, csr_reg_off); -+ -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, -+ TRNG_FRODETUNE_ADDR); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, fro_stopped_mask); -+ -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, -+ TRNG_FROENABLE_ADDR); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, -+ fro_stopped_mask | fro_enabled_mask); -+ } -+ -+ // Reset the error -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, -+ TRNG_ALARMMASK_ADDR); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, 0); -+ -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, -+ TRNG_ALARMSTOP_ADDR); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, 0); -+ -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, -+ TRNG_INTACK_ADDR); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, -+ PKA_TRNG_STATUS_SHUTDOWN_OFLO); -+ -+ // If we're seeing this error again within about a second, -+ // the hardware is malfunctioning. Disable the trng and return -+ // an error. -+ if (*err_cycle && (curr_cycle_cnt - *err_cycle < 1000000000)) -+ { -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, -+ TRNG_CONTROL_ADDR); -+ csr_reg_value = pka_dev_io_read(csr_reg_ptr, csr_reg_off); -+ csr_reg_value &= ~PKA_TRNG_CONTROL_REG_VAL; -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, csr_reg_value); -+ return false; -+ } -+ -+ *err_cycle = curr_cycle_cnt; -+ } -+ -+ return true; -+} -+ -+static int pka_dev_trng_drbg_reseed(void *csr_reg_ptr, uint64_t csr_reg_base) -+{ -+ uint64_t csr_reg_off; -+ int ret; -+ -+ ret = 0; -+ -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, TRNG_CONTROL_ADDR); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, PKA_TRNG_CONTROL_DRBG_RESEED); -+ -+ ret = pka_dev_trng_wait_test_ready(csr_reg_ptr, csr_reg_base); -+ if (ret) -+ return ret; -+ -+ // Write personalization string -+ pka_dev_trng_write_ps_ai_str(csr_reg_ptr, csr_reg_base, pka_trng_drbg_ps_str); -+ -+ return ret; -+} -+ -+// Read from DRBG enabled TRNG -+int pka_dev_trng_read(pka_dev_shim_t *shim, uint32_t *data, uint32_t cnt) -+{ -+ int ret = 0; -+ -+ pka_dev_res_t *trng_csr_ptr; -+ uint64_t csr_reg_base, csr_reg_off, csr_reg_value; -+ uint64_t timer; -+ uint32_t data_idx, word_cnt; -+ uint8_t output_idx, trng_ready = 0; -+ void *csr_reg_ptr; -+ -+ if (!shim || !data || (cnt % PKA_TRNG_OUTPUT_CNT != 0)) -+ return -EINVAL; -+ -+ if (!cnt) -+ return ret; -+ -+ mutex_lock(&shim->mutex); -+ -+ trng_csr_ptr = &shim->resources.trng_csr; -+ -+ if (trng_csr_ptr->status != PKA_DEV_RES_STATUS_MAPPED || -+ trng_csr_ptr->type != PKA_DEV_RES_TYPE_REG) -+ { -+ ret = -EPERM; -+ goto exit; -+ } -+ -+ csr_reg_base = trng_csr_ptr->base; -+ csr_reg_ptr = trng_csr_ptr->ioaddr; -+ -+ if (!pka_dev_trng_shutdown_oflo(trng_csr_ptr, -+ &shim->trng_err_cycle)) -+ { -+ ret = -EWOULDBLOCK; -+ goto exit; -+ } -+ -+ // Determine the number of 32-bit words. -+ word_cnt = cnt >> 2; -+ -+ for (data_idx = 0; data_idx < word_cnt; data_idx++) -+ { -+ output_idx = data_idx % PKA_TRNG_OUTPUT_CNT; -+ -+ // Tell the hardware to advance -+ if (output_idx == 0) -+ { -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, -+ TRNG_INTACK_ADDR); -+ pka_dev_io_write(csr_reg_ptr, csr_reg_off, PKA_TRNG_STATUS_READY); -+ trng_ready = 0; -+ -+ // Check if 'data_blocks' field is zero in TRNG_CONTROL register, -+ // if it is then we have to issue a 'Reseed' and Generate' request -+ // for DRBG enabled TRNG. -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, -+ TRNG_CONTROL_ADDR); -+ csr_reg_value = pka_dev_io_read(csr_reg_ptr, csr_reg_off); -+ -+ if (!((uint32_t)csr_reg_value & PKA_TRNG_DRBG_DATA_BLOCK_MASK)) -+ { -+ // Issue reseed -+ ret = pka_dev_trng_drbg_reseed(csr_reg_ptr, csr_reg_base); -+ if (ret) -+ { -+ ret = -EBUSY; -+ goto exit; -+ } -+ -+ // Issue generate request -+ pka_dev_trng_drbg_generate(csr_reg_ptr, csr_reg_base); -+ } -+ -+ } -+ -+ // Wait until a data word is available in the TRNG_OUTPUT_X -+ // registers (using the interrupt and/or 'ready' status bit in the -+ // TRNG_STATUS register. The only way this would hang if the TRNG -+ // never initialized, and we would not call this function if that -+ // happened. -+ timer = pka_dev_timer_start(1000000); // 1000 ms -+ csr_reg_off = -+ pka_dev_get_register_offset(csr_reg_base, TRNG_STATUS_ADDR); -+ while (trng_ready == 0) -+ { -+ csr_reg_value = pka_dev_io_read(csr_reg_ptr, csr_reg_off); -+ trng_ready = csr_reg_value & PKA_TRNG_STATUS_READY; -+ -+ if (pka_dev_timer_done(timer)) -+ { -+ PKA_DEBUG(PKA_DEV, -+ "Shim %u got error obtaining random number\n", -+ shim->shim_id); -+ ret = -EBUSY; -+ goto exit; -+ } -+ } -+ -+ // Read the registers -+ csr_reg_off = pka_dev_get_register_offset(csr_reg_base, -+ TRNG_OUTPUT_0_ADDR + (output_idx * 0x8)); -+ csr_reg_value = pka_dev_io_read(csr_reg_ptr, csr_reg_off); -+ data[data_idx] = (uint32_t) csr_reg_value; -+ } -+ -+exit: -+ mutex_unlock(&shim->mutex); -+ return ret; -+} -+ -+bool pka_dev_has_trng(pka_dev_shim_t *shim) -+{ -+ if (!shim) -+ return false; -+ -+ return (shim->trng_enabled == PKA_SHIM_TRNG_ENABLED); -+} -+ -+// Syscall to open ring. -+int __pka_dev_open_ring(uint32_t ring_id) -+{ -+ pka_dev_shim_t *shim; -+ pka_dev_ring_t *ring; -+ -+ int ret = 0; -+ -+ if (pka_gbl_config.dev_rings_cnt == 0) -+ return -EPERM; -+ -+ ring = pka_dev_get_ring(ring_id); -+ if (!ring || !ring->shim) -+ return -ENXIO; -+ -+ shim = ring->shim; -+ -+ mutex_lock(&ring->mutex); -+ -+ if (shim->status == PKA_SHIM_STATUS_UNDEFINED || -+ shim->status == PKA_SHIM_STATUS_CREATED || -+ shim->status == PKA_SHIM_STATUS_FINALIZED) -+ { -+ ret = -EPERM; -+ goto unlock_return; -+ } -+ -+ if (ring->status == PKA_DEV_RING_STATUS_BUSY) -+ { -+ ret = -EBUSY; -+ goto unlock_return; -+ } -+ -+ if (ring->status != PKA_DEV_RING_STATUS_INITIALIZED) -+ { -+ ret = -EPERM; -+ goto unlock_return; -+ } -+ -+ // Set ring information words. -+ ret = pka_dev_set_ring_info(ring); -+ if (ret) -+ { -+ PKA_ERROR(PKA_DEV, "failed to set ring information\n"); -+ ret = -EWOULDBLOCK; -+ goto unlock_return; -+ } -+ -+ if (shim->busy_ring_num == 0) -+ shim->status = PKA_SHIM_STATUS_RUNNING; -+ -+ ring->status = PKA_DEV_RING_STATUS_BUSY; -+ shim->busy_ring_num += 1; -+ -+unlock_return: -+ mutex_unlock(&ring->mutex); -+ return ret; -+} -+ -+// Open ring. -+int pka_dev_open_ring(pka_ring_info_t *ring_info) -+{ -+ return __pka_dev_open_ring(ring_info->ring_id); -+} -+ -+// Syscall to close ring. -+int __pka_dev_close_ring(uint32_t ring_id) -+{ -+ pka_dev_shim_t *shim; -+ pka_dev_ring_t *ring; -+ -+ int ret = 0; -+ -+ if (pka_gbl_config.dev_rings_cnt == 0) -+ return -EPERM; -+ -+ ring = pka_dev_get_ring(ring_id); -+ if (!ring || !ring->shim) -+ return -ENXIO; -+ -+ shim = ring->shim; -+ -+ mutex_lock(&ring->mutex); -+ -+ if (shim->status != PKA_SHIM_STATUS_RUNNING && -+ ring->status != PKA_DEV_RING_STATUS_BUSY) -+ { -+ ret = -EPERM; -+ goto unlock_return; -+ } -+ -+ ring->status = PKA_DEV_RING_STATUS_INITIALIZED; -+ shim->busy_ring_num -= 1; -+ -+ if (shim->busy_ring_num == 0) -+ shim->status = PKA_SHIM_STATUS_STOPPED; -+ -+unlock_return: -+ mutex_unlock(&ring->mutex); -+ return ret; -+} -+ -+// Close ring. -+int pka_dev_close_ring(pka_ring_info_t *ring_info) -+{ -+ if (ring_info) -+ { -+ return __pka_dev_close_ring(ring_info->ring_id); -+ } -+ -+ return 0; -+} -+ -+// Syscall to map ring into memory (kernel-space). -+static int __pka_dev_mmap_ring(uint32_t ring_id) -+{ -+ //not implemented -+ return -1; -+} -+ -+// Map ring into memory (user-space). -+int pka_dev_mmap_ring(pka_ring_info_t *ring_info) -+{ -+ return __pka_dev_mmap_ring(ring_info->ring_id); -+} -+ -+// Syscall to unmap ring (kernel-space). -+static int __pka_dev_munmap_ring(uint32_t ring_id) -+{ -+ //not implemented -+ return -1; -+} -+ -+// Unmap ring (user-space). -+int pka_dev_munmap_ring(pka_ring_info_t *ring_info) -+{ -+ if (ring_info) -+ { -+ return __pka_dev_munmap_ring(ring_info->ring_id); -+ } -+ -+ return 0; -+} -+ -diff --git a/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_dev.h b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_dev.h -new file mode 100644 -index 000000000..06ac28623 ---- /dev/null -+++ b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_dev.h -@@ -0,0 +1,310 @@ -+// -+// BSD LICENSE -+// -+// Copyright(c) 2016 Mellanox Technologies, Ltd. All rights reserved. -+// All rights reserved. -+// -+// Redistribution and use in source and binary forms, with or without -+// modification, are permitted provided that the following conditions -+// are met: -+// -+// * Redistributions of source code must retain the above copyright -+// notice, this list of conditions and the following disclaimer. -+// * Redistributions in binary form must reproduce the above copyright -+// notice, this list of conditions and the following disclaimer in -+// the documentation and/or other materials provided with the -+// distribution. -+// * Neither the name of Mellanox Technologies nor the names of its -+// contributors may be used to endorse or promote products derived -+// from this software without specific prior written permission. -+// -+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+// -+ -+#ifndef __PKA_DEV_H__ -+#define __PKA_DEV_H__ -+ -+/// -+/// @file -+/// -+/// API to handle the PKA EIP-154 I/O block (shim). It provides functions -+/// and data structures to initialize and configure the PKA shim. It's the -+/// "southband interface" for communication with PKA hardware resources. -+/// -+ -+#include -+#include -+#include "mlxbf_pka_firmware.h" -+ -+#include -+ -+#include "mlxbf_pka_config.h" -+#include "mlxbf_pka_cpu.h" -+#include "mlxbf_pka_debug.h" -+#include "mlxbf_pka_ioctl.h" -+#include "mlxbf_pka_mmio.h" -+#include "mlxbf_pka_ring.h" -+ -+#define PKA_SYSFS_RING_DEVICES "/sys/bus/platform/devices" -+#define PKA_VFIO_DIR "/dev/vfio" -+#define PKA_VFIO_CONTAINER_PATH "/dev/vfio/vfio" -+#define PKA_VFIO_GROUP_FMT "/dev/vfio/%d" -+ -+#define PKA_DEVFS_RING_DEVICES "/dev/pka/%d" -+ -+// Defines specific to device-tree and Linux operating system. -+// Careful, all constants MUST be conform with both devicetree -+// (DTS) and ACPI tables (SSDT). -+// *TBD* Better to be detected automatically (or passed as arg -+// so far). -+#define PKA_DEV_RING_DT_PREFIX_0 "45000000.eip154:ring@%d" -+#define PKA_DEV_RING_DT_PREFIX_1 "47000000.eip154:ring@%d" -+#define PKA_DEV_RING_DT_PREFIX_2 "4d000000.eip154:ring@%d" -+#define PKA_DEV_RING_DT_PREFIX_3 "4f000000.eip154:ring@%d" -+#define PKA_DEV_RING_DT_PREFIX_4 "44000000.eip154:ring@%d" -+#define PKA_DEV_RING_DT_PREFIX_5 "46000000.eip154:ring@%d" -+#define PKA_DEV_RING_DT_PREFIX_6 "4c000000.eip154:ring@%d" -+#define PKA_DEV_RING_DT_PREFIX_7 "4e000000.eip154:ring@%d" -+ -+#define PKA_DEV_RING_ACPI_PREFIX "MLNXBF11:%02x" -+ -+/// Device resource structure -+typedef struct -+{ -+ void *ioaddr; ///< (iore)map-ped version of addr, for -+ /// driver internal use. -+ -+ uint64_t base; ///< base address of the device's -+ /// resource -+ -+ uint64_t size; ///< size of IO -+ -+ uint8_t type; ///< type of resource addr points to -+ int8_t status; ///< status of the resource -+ -+ char *name; ///< name of the resource -+} pka_dev_res_t; -+ -+/// defines for pka_dev_res->type -+#define PKA_DEV_RES_TYPE_MEM 1 // resource type is memory -+#define PKA_DEV_RES_TYPE_REG 2 // resource type is register -+ -+/// defines for pka_dev_res->status -+#define PKA_DEV_RES_STATUS_MAPPED 1 // the resource is (iore)-mapped -+#define PKA_DEV_RES_STATUS_UNMAPPED -1 // the resource is unmapped -+ -+/// PKA Ring resources structure -+typedef struct -+{ -+ pka_dev_res_t info_words; // ring information words -+ pka_dev_res_t counters; // ring counters -+ pka_dev_res_t window_ram; // window RAM -+} pka_dev_ring_res_t; -+ -+typedef struct pka_dev_shim_s pka_dev_shim_t; -+ -+/// PKA Ring structure -+typedef struct -+{ -+ uint32_t ring_id; ///< ring identifier. -+ -+ pka_dev_shim_t *shim; ///< pointer to the shim associated -+ /// to the ring. -+ -+ uint32_t resources_num; ///< number of ring ressources. -+ pka_dev_ring_res_t resources; ///< ring resources. -+ -+ pka_dev_hw_ring_info_t *ring_info; ///< ring information. -+ uint32_t num_cmd_desc; ///< number of command descriptors. -+ -+ int8_t status; ///< status of the ring. -+ -+ struct mutex mutex; ///< mutex lock for sharing ring device -+} pka_dev_ring_t; -+ -+/// defines for pka_dev_ring->status -+#define PKA_DEV_RING_STATUS_UNDEFINED -1 -+#define PKA_DEV_RING_STATUS_INITIALIZED 1 -+#define PKA_DEV_RING_STATUS_READY 2 -+#define PKA_DEV_RING_STATUS_BUSY 3 -+#define PKA_DEV_RING_STATUS_FINALIZED 4 -+ -+/// PKA Shim resources structure -+typedef struct -+{ -+ pka_dev_res_t buffer_ram; // buffer RAM -+ pka_dev_res_t master_prog_ram; // master controller program RAM -+ pka_dev_res_t master_seq_ctrl; // master sequencer controller CSR -+ pka_dev_res_t aic_csr; // interrupt controller CSRs -+ pka_dev_res_t trng_csr; // TRNG module CSRs -+ pka_dev_res_t ext_csr; // MiCA specific CSRs (glue logic) -+} pka_dev_shim_res_t; -+ -+#define PKA_DEV_SHIM_RES_CNT 6 // Number of PKA device resources -+ -+/// Platform global shim resource information -+typedef struct -+{ -+ pka_dev_res_t *res_tbl[PKA_DEV_SHIM_RES_CNT]; -+ uint8_t res_cnt; -+} pka_dev_gbl_shim_res_info_t; -+ -+struct pka_dev_mem_res -+{ -+ uint64_t eip154_base; ///< base address for eip154 mmio registers -+ uint64_t eip154_size; ///< eip154 mmio register region size -+ -+ uint64_t wndw_ram_off_mask; ///< common offset mask for alt window ram and window ram -+ uint64_t wndw_ram_base; ///< base address for window ram -+ uint64_t wndw_ram_size; ///< window ram region size -+ -+ uint64_t alt_wndw_ram_0_base; ///< base address for alternate window ram 0 -+ uint64_t alt_wndw_ram_1_base; ///< base address for alternate window ram 1 -+ uint64_t alt_wndw_ram_2_base; ///< base address for alternate window ram 2 -+ uint64_t alt_wndw_ram_3_base; ///< base address for alternate window ram 3 -+ uint64_t alt_wndw_ram_size; ///< alternate window ram regions size -+ -+ uint64_t csr_base; ///< base address for csr registers -+ uint64_t csr_size; ///< csr area size -+}; -+ -+ -+/// PKA Shim structure -+struct pka_dev_shim_s -+{ -+ struct pka_dev_mem_res mem_res; -+ -+ uint64_t trng_err_cycle; ///< TRNG error cycle -+ -+ uint32_t shim_id; ///< shim identifier -+ -+ uint32_t rings_num; ///< Number of supported rings (hw -+ /// specific) -+ -+ pka_dev_ring_t **rings; ///< pointer to rings which belong to -+ /// the shim. -+ -+ uint8_t ring_priority; ///< specify the priority in which -+ /// rings are handled. -+ -+ uint8_t ring_type; ///< indicates whether the result -+ /// ring delivers results strictly -+ /// in-order. -+ -+ pka_dev_shim_res_t resources; ///< shim resources -+ -+ uint8_t window_ram_split; ///< Window RAM mode. if non-zero, -+ /// the splitted window RAM scheme -+ /// is used. -+ -+ uint32_t busy_ring_num; ///< Number of active rings (rings in -+ /// busy state) -+ -+ uint8_t trng_enabled; ///< Whether the TRNG engine is -+ /// enabled. -+ -+ int8_t status; ///< status of the shim -+ -+ struct mutex mutex; ///< mutex lock for sharing shim -+}; -+ -+/// defines for pka_dev_shim->status -+#define PKA_SHIM_STATUS_UNDEFINED -1 -+#define PKA_SHIM_STATUS_CREATED 1 -+#define PKA_SHIM_STATUS_INITIALIZED 2 -+#define PKA_SHIM_STATUS_RUNNING 3 -+#define PKA_SHIM_STATUS_STOPPED 4 -+#define PKA_SHIM_STATUS_FINALIZED 5 -+ -+/// defines for pka_dev_shim->window_ram_split -+#define PKA_SHIM_WINDOW_RAM_SPLIT_ENABLED 1 // window RAM is splitted into -+ // 4 * 16KB blocks -+ -+#define PKA_SHIM_WINDOW_RAM_SPLIT_DISABLED 2 // window RAM is not splitted -+ // and occupies 64KB -+ -+/// defines for pka_dev_shim->trng_enabled -+#define PKA_SHIM_TRNG_ENABLED 1 -+#define PKA_SHIM_TRNG_DISABLED 0 -+ -+/// Platform global configuration structure -+typedef struct -+{ -+ uint32_t dev_shims_cnt; ///< number of registered PKA shims. -+ uint32_t dev_rings_cnt; ///< number of registered Rings. -+ -+ pka_dev_shim_t *dev_shims[PKA_MAX_NUM_IO_BLOCKS]; ///< table of registered -+ /// PKA shims. -+ -+ pka_dev_ring_t *dev_rings[PKA_MAX_NUM_RINGS]; ///< table of registered -+ /// Rings. -+} pka_dev_gbl_config_t; -+ -+extern pka_dev_gbl_config_t pka_gbl_config; -+ -+/// Ring getter for pka_dev_gbl_config_t structure which holds all system -+/// global configuration. This configuration is shared and common to kernel -+/// device driver associated with PKA hardware. -+pka_dev_ring_t *pka_dev_get_ring(uint32_t ring_id); -+ -+/// Shim getter for pka_dev_gbl_config_t structure which holds all system -+/// global configuration. This configuration is shared and common to kernel -+/// device driver associated with PKA hardware. -+pka_dev_shim_t *pka_dev_get_shim(uint32_t shim_id); -+ -+/// Register a Ring. This function initializes a Ring and configures its -+/// related resources, and returns a pointer to that ring. -+pka_dev_ring_t *pka_dev_register_ring(uint32_t ring_id, uint32_t shim_id); -+ -+/// Unregister a Ring -+int pka_dev_unregister_ring(pka_dev_ring_t *ring); -+ -+/// Register PKA IO block. This function initializes a shim and configures its -+/// related resources, and returns a pointer to that ring. -+pka_dev_shim_t *pka_dev_register_shim(uint32_t shim_id, uint8_t shim_fw_id, -+ struct pka_dev_mem_res *mem_res); -+ -+/// Unregister PKA IO block -+int pka_dev_unregister_shim(pka_dev_shim_t *shim); -+ -+/// Reset a Ring. -+int pka_dev_reset_ring(pka_dev_ring_t *ring); -+ -+/// Clear ring counters. This function resets the master sequencer controller -+/// to clear the command and result counters. -+int pka_dev_clear_ring_counters(pka_dev_ring_t *ring); -+ -+/// Read data from the TRNG. Drivers can fill up to 'cnt' bytes of data into -+/// the buffer 'data'. The buffer 'data' is aligned for any type and 'cnt' is -+/// a multiple of 4. -+int pka_dev_trng_read(pka_dev_shim_t *shim, uint32_t *data, uint32_t cnt); -+ -+/// Return true if the TRNG engine is enabled, false if not. -+bool pka_dev_has_trng(pka_dev_shim_t *shim); -+ -+/// Open the file descriptor associated with ring. It returns an integer value, -+/// which is used to refer to the file. If un-successful, it returns a negative -+/// error. -+int pka_dev_open_ring(pka_ring_info_t *ring_info); -+ -+/// Close the file descriptor associated with ring. The function returns 0 if -+/// successful, negative value to indicate an error. -+int pka_dev_close_ring(pka_ring_info_t *ring_info); -+ -+/// Map ring resources. -+int pka_dev_mmap_ring(pka_ring_info_t *ring_info); -+ -+/// Unmap ring resources. -+int pka_dev_munmap_ring(pka_ring_info_t *ring_info); -+ -+#endif /// __PKA_DEV_H__ -diff --git a/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_drv.c b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_drv.c -new file mode 100644 -index 000000000..b8b5a465e ---- /dev/null -+++ b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_drv.c -@@ -0,0 +1,1398 @@ -+// SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "mlxbf_pka_dev.h" -+ -+ -+#define PKA_DRIVER_VERSION "v3.0" -+#define PKA_DRIVER_NAME "pka-mlxbf" -+ -+#define PKA_DRIVER_DESCRIPTION "BlueField PKA driver" -+ -+#define PKA_DEVICE_COMPAT "mlx,mlxbf-pka" -+#define PKA_RING_DEVICE_COMPAT "mlx,mlxbf-pka-ring" -+ -+#define PKA_DEVICE_ACPIHID_BF1 "MLNXBF10" -+#define PKA_RING_DEVICE_ACPIHID_BF1 "MLNXBF11" -+ -+#define PKA_DEVICE_ACPIHID_BF2 "MLNXBF20" -+#define PKA_RING_DEVICE_ACPIHID_BF2 "MLNXBF21" -+ -+#define PKA_DEVICE_ACCESS_MODE 0666 -+ -+#define PKA_DEVICE_RES_CNT 7 -+enum pka_mem_res_idx { -+ PKA_ACPI_EIP154_IDX = 0, -+ PKA_ACPI_WNDW_RAM_IDX, -+ PKA_ACPI_ALT_WNDW_RAM_0_IDX, -+ PKA_ACPI_ALT_WNDW_RAM_1_IDX, -+ PKA_ACPI_ALT_WNDW_RAM_2_IDX, -+ PKA_ACPI_ALT_WNDW_RAM_3_IDX, -+ PKA_ACPI_CSR_IDX -+}; -+ -+enum pka_plat_type { -+ PKA_PLAT_TYPE_BF1 = 0, /* Platform type Bluefield-1 */ -+ PKA_PLAT_TYPE_BF2 /* Platform type Bluefield-2 */ -+}; -+ -+static DEFINE_MUTEX(pka_drv_lock); -+ -+static uint32_t pka_device_cnt; -+static uint32_t pka_ring_device_cnt; -+ -+const char pka_compat[] = PKA_DEVICE_COMPAT; -+const char pka_ring_compat[] = PKA_RING_DEVICE_COMPAT; -+ -+const char pka_acpihid_bf1[] = PKA_DEVICE_ACPIHID_BF1; -+const char pka_ring_acpihid_bf1[] = PKA_RING_DEVICE_ACPIHID_BF1; -+ -+const char pka_acpihid_bf2[] = PKA_DEVICE_ACPIHID_BF2; -+const char pka_ring_acpihid_bf2[] = PKA_RING_DEVICE_ACPIHID_BF2; -+ -+struct pka_drv_plat_info { -+ enum pka_plat_type type; -+ uint8_t fw_id; -+}; -+ -+static struct pka_drv_plat_info pka_drv_plat[] = { -+ [PKA_PLAT_TYPE_BF1] = { -+ .type = PKA_PLAT_TYPE_BF1, -+ .fw_id = PKA_FIRMWARE_IMAGE_0_ID -+ }, -+ [PKA_PLAT_TYPE_BF2] = { -+ .type = PKA_PLAT_TYPE_BF2, -+ .fw_id = PKA_FIRMWARE_IMAGE_2_ID -+ } -+}; -+ -+static const struct acpi_device_id pka_drv_acpi_ids[] = { -+ { PKA_DEVICE_ACPIHID_BF1, (kernel_ulong_t)&pka_drv_plat[PKA_PLAT_TYPE_BF1] }, -+ { PKA_RING_DEVICE_ACPIHID_BF1, 0 }, -+ { PKA_DEVICE_ACPIHID_BF2, (kernel_ulong_t)&pka_drv_plat[PKA_PLAT_TYPE_BF2] }, -+ { PKA_RING_DEVICE_ACPIHID_BF2, 0 }, -+ {}, -+}; -+ -+struct pka_info { -+ struct device *dev; /* the device this info belongs to */ -+ const char *name; /* device name */ -+ const char *version; /* device driver version */ -+ const char *compat; -+ const char *acpihid; -+ uint8_t flag; -+ struct module *module; -+ void *priv; /* optional private data */ -+}; -+ -+/* defines for pka_info->flags */ -+#define PKA_DRIVER_FLAG_RING_DEVICE 1 -+#define PKA_DRIVER_FLAG_DEVICE 2 -+ -+struct pka_platdata { -+ struct platform_device *pdev; -+ struct pka_info *info; -+ spinlock_t lock; -+ unsigned long irq_flags; -+}; -+ -+/* Bits in pka_platdata.irq_flags */ -+enum { -+ PKA_IRQ_DISABLED = 0, -+}; -+ -+struct pka_ring_region { -+ u64 off; -+ u64 addr; -+ resource_size_t size; -+ u32 flags; -+ u32 type; -+ void __iomem *ioaddr; -+}; -+ -+/* defines for pka_ring_region->flags */ -+#define PKA_RING_REGION_FLAG_READ (1 << 0) /* Region supports read */ -+#define PKA_RING_REGION_FLAG_WRITE (1 << 1) /* Region supports write */ -+#define PKA_RING_REGION_FLAG_MMAP (1 << 2) /* Region supports mmap */ -+ -+/* defines for pka_ring_region->type */ -+#define PKA_RING_RES_TYPE_NONE 0 -+#define PKA_RING_RES_TYPE_WORDS 1 /* info control/status words */ -+#define PKA_RING_RES_TYPE_CNTRS 2 /* count registers */ -+#define PKA_RING_RES_TYPE_MEM 4 /* window RAM region */ -+ -+#define PKA_DRIVER_RING_DEV_MAX PKA_MAX_NUM_RINGS -+ -+struct pka_ring_device { -+ struct pka_info *info; -+ struct device *device; -+ struct iommu_group *group; -+ int32_t group_id; -+ uint32_t device_id; -+ uint32_t parent_device_id; -+ struct mutex mutex; -+ uint32_t flags; -+ struct module *parent_module; -+ pka_dev_ring_t *ring; -+ int minor; -+ uint32_t num_regions; -+ struct pka_ring_region *regions; -+}; -+ -+#define PKA_DRIVER_DEV_MAX PKA_MAX_NUM_IO_BLOCKS -+#define PKA_DRIVER_RING_NUM_REGIONS_MAX PKA_MAX_NUM_RING_RESOURCES -+ -+/* defines for region index */ -+#define PKA_RING_REGION_WORDS_IDX 0 -+#define PKA_RING_REGION_CNTRS_IDX 1 -+#define PKA_RING_REGION_MEM_IDX 2 -+ -+#define PKA_RING_REGION_OFFSET_SHIFT 40 -+#define PKA_RING_REGION_OFFSET_MASK \ -+ (((u64)(1) << PKA_RING_REGION_OFFSET_SHIFT) - 1) -+ -+#define PKA_RING_OFFSET_TO_INDEX(off) \ -+ (off >> PKA_RING_REGION_OFFSET_SHIFT) -+ -+#define PKA_RING_REGION_INDEX_TO_OFFSET(index) \ -+ ((u64)(index) << PKA_RING_REGION_OFFSET_SHIFT) -+ -+struct pka_device { -+ struct pka_info *info; -+ struct device *device; -+ uint32_t device_id; -+ uint8_t fw_id; /* firmware identifier */ -+ struct mutex mutex; -+ struct resource *resource[PKA_DEVICE_RES_CNT]; -+ pka_dev_shim_t *shim; -+ long irq; /* interrupt number */ -+ struct hwrng rng; -+}; -+ -+/* defines for pka_device->irq */ -+#define PKA_IRQ_CUSTOM -1 -+#define PKA_IRQ_NONE 0 -+ -+/* Hardware interrupt handler */ -+static irqreturn_t pka_drv_irq_handler(int irq, void *device) -+{ -+ struct pka_device *pka_dev = (struct pka_device *)device; -+ struct platform_device *pdev = to_platform_device(pka_dev->device); -+ struct pka_platdata *priv = platform_get_drvdata(pdev); -+ -+ PKA_DEBUG(PKA_DRIVER, -+ "handle irq in device %u\n", pka_dev->device_id); -+ -+ /* Just disable the interrupt in the interrupt controller */ -+ -+ spin_lock(&priv->lock); -+ if (!__test_and_set_bit(PKA_IRQ_DISABLED, &priv->irq_flags)) -+ disable_irq_nosync(irq); -+ spin_unlock(&priv->lock); -+ -+ return IRQ_HANDLED; -+} -+ -+static int pka_drv_register_irq(struct pka_device *pka_dev) -+{ -+ if (pka_dev->irq && (pka_dev->irq != PKA_IRQ_CUSTOM)) { -+ /* -+ * Allow sharing the irq among several devices (child devices -+ * so far) -+ */ -+ return request_irq(pka_dev->irq, -+ (irq_handler_t) pka_drv_irq_handler, -+ IRQF_SHARED, pka_dev->info->name, -+ pka_dev); -+ } -+ -+ return -ENXIO; -+} -+ -+static int pka_drv_ring_regions_init(struct pka_ring_device *ring_dev) -+{ -+ struct pka_ring_region *region; -+ pka_dev_ring_t *ring; -+ pka_dev_res_t *res; -+ uint32_t num_regions; -+ -+ ring = ring_dev->ring; -+ if (!ring || !ring->shim) -+ return -ENXIO; -+ -+ num_regions = ring->resources_num; -+ ring_dev->num_regions = num_regions; -+ ring_dev->regions = kcalloc(num_regions, -+ sizeof(struct pka_ring_region), -+ GFP_KERNEL); -+ if (!ring_dev->regions) -+ return -ENOMEM; -+ -+ /* Information words region */ -+ res = &ring->resources.info_words; -+ region = &ring_dev->regions[PKA_RING_REGION_WORDS_IDX]; -+ /* map offset to the physical address */ -+ region->off = -+ PKA_RING_REGION_INDEX_TO_OFFSET(PKA_RING_REGION_WORDS_IDX); -+ region->addr = res->base; -+ region->size = res->size; -+ region->type = PKA_RING_RES_TYPE_WORDS; -+ region->flags |= (PKA_RING_REGION_FLAG_MMAP | -+ PKA_RING_REGION_FLAG_READ | -+ PKA_RING_REGION_FLAG_WRITE); -+ -+ /* Count regiters region */ -+ res = &ring->resources.counters; -+ region = &ring_dev->regions[PKA_RING_REGION_CNTRS_IDX]; -+ /* map offset to the physical address */ -+ region->off = -+ PKA_RING_REGION_INDEX_TO_OFFSET(PKA_RING_REGION_CNTRS_IDX); -+ region->addr = res->base; -+ region->size = res->size; -+ region->type = PKA_RING_RES_TYPE_CNTRS; -+ region->flags |= (PKA_RING_REGION_FLAG_MMAP | -+ PKA_RING_REGION_FLAG_READ | -+ PKA_RING_REGION_FLAG_WRITE); -+ -+ /* Window ram region */ -+ res = &ring->resources.window_ram; -+ region = &ring_dev->regions[PKA_RING_REGION_MEM_IDX]; -+ /* map offset to the physical address */ -+ region->off = -+ PKA_RING_REGION_INDEX_TO_OFFSET(PKA_RING_REGION_MEM_IDX); -+ region->addr = res->base; -+ region->size = res->size; -+ region->type = PKA_RING_RES_TYPE_MEM; -+ region->flags |= (PKA_RING_REGION_FLAG_MMAP | -+ PKA_RING_REGION_FLAG_READ | -+ PKA_RING_REGION_FLAG_WRITE); -+ -+ return 0; -+} -+ -+static void pka_drv_ring_regions_cleanup(struct pka_ring_device *ring_dev) -+{ -+ /* clear vfio device regions */ -+ ring_dev->num_regions = 0; -+ kfree(ring_dev->regions); -+} -+ -+static int pka_drv_ring_open(void *device_data) -+{ -+ struct pka_ring_device *ring_dev = device_data; -+ struct pka_info *info = ring_dev->info; -+ pka_ring_info_t ring_info; -+ -+ int error; -+ -+ PKA_DEBUG(PKA_DRIVER, -+ "open ring device %u (device_data:%p)\n", -+ ring_dev->device_id, ring_dev); -+ -+ if (!try_module_get(info->module)) -+ return -ENODEV; -+ -+ ring_info.ring_id = ring_dev->device_id; -+ error = pka_dev_open_ring(&ring_info); -+ if (error) { -+ PKA_DEBUG(PKA_DRIVER, -+ "failed to open ring %u\n", ring_dev->device_id); -+ module_put(info->module); -+ return error; -+ } -+ -+ /* Initialize regions */ -+ error = pka_drv_ring_regions_init(ring_dev); -+ if (error) { -+ PKA_DEBUG(PKA_DRIVER, "failed to initialize regions\n"); -+ pka_dev_close_ring(&ring_info); -+ module_put(info->module); -+ return error; -+ } -+ -+ return 0; -+} -+ -+static void pka_drv_ring_release(void *device_data) -+{ -+ struct pka_ring_device *ring_dev = device_data; -+ struct pka_info *info = ring_dev->info; -+ pka_ring_info_t ring_info; -+ -+ int error; -+ -+ PKA_DEBUG(PKA_DRIVER, -+ "release ring device %u (device_data:%p)\n", -+ ring_dev->device_id, ring_dev); -+ -+ pka_drv_ring_regions_cleanup(ring_dev); -+ -+ ring_info.ring_id = ring_dev->device_id; -+ error = pka_dev_close_ring(&ring_info); -+ if (error) -+ PKA_DEBUG(PKA_DRIVER, -+ "failed to close ring %u\n", -+ ring_dev->device_id); -+ -+ module_put(info->module); -+} -+ -+static int pka_drv_ring_mmap_region(struct pka_ring_region region, -+ struct vm_area_struct *vma) -+{ -+ u64 req_len, pgoff, req_start; -+ -+ req_len = vma->vm_end - vma->vm_start; -+ pgoff = vma->vm_pgoff & -+ ((1U << (PKA_RING_REGION_OFFSET_SHIFT - PAGE_SHIFT)) - 1); -+ req_start = pgoff << PAGE_SHIFT; -+ -+ region.size = roundup(region.size, PAGE_SIZE); -+ -+ if (req_start + req_len > region.size) -+ return -EINVAL; -+ -+ vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); -+ vma->vm_pgoff = (region.addr >> PAGE_SHIFT) + pgoff; -+ -+ return remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, -+ req_len, vma->vm_page_prot); -+} -+ -+static int pka_drv_ring_mmap(void *device_data, struct vm_area_struct *vma) -+{ -+ struct pka_ring_device *ring_dev = device_data; -+ struct pka_ring_region *region; -+ unsigned int index; -+ -+ PKA_DEBUG(PKA_DRIVER, "mmap device %u\n", ring_dev->device_id); -+ -+ index = vma->vm_pgoff >> (PKA_RING_REGION_OFFSET_SHIFT - PAGE_SHIFT); -+ -+ if (vma->vm_end < vma->vm_start) -+ return -EINVAL; -+ if (!(vma->vm_flags & VM_SHARED)) -+ return -EINVAL; -+ if (index >= ring_dev->num_regions) -+ return -EINVAL; -+ if (vma->vm_start & ~PAGE_MASK) -+ return -EINVAL; -+ if (vma->vm_end & ~PAGE_MASK) -+ return -EINVAL; -+ -+ region = &ring_dev->regions[index]; -+ -+ if (!(region->flags & PKA_RING_REGION_FLAG_MMAP)) -+ return -EINVAL; -+ -+ if (!(region->flags & PKA_RING_REGION_FLAG_READ) -+ && (vma->vm_flags & VM_READ)) -+ return -EINVAL; -+ -+ if (!(region->flags & PKA_RING_REGION_FLAG_WRITE) -+ && (vma->vm_flags & VM_WRITE)) -+ return -EINVAL; -+ -+ vma->vm_private_data = ring_dev; -+ -+ if (region->type & PKA_RING_RES_TYPE_CNTRS || -+ region->type & PKA_RING_RES_TYPE_MEM) -+ return pka_drv_ring_mmap_region(ring_dev->regions[index], vma); -+ -+ if (region->type & PKA_RING_RES_TYPE_WORDS) -+ /* -+ * Currently user space is not allowed to access this -+ * region. -+ */ -+ return -EINVAL; -+ -+ return -EINVAL; -+} -+ -+static long pka_drv_ring_ioctl(void *device_data, -+ unsigned int cmd, unsigned long arg) -+{ -+ struct pka_ring_device *ring_dev = device_data; -+ -+ int error = -ENOTTY; -+ -+ if (cmd == PKA_RING_GET_REGION_INFO) { -+ pka_dev_region_info_t info; -+ -+ info.mem_index = PKA_RING_REGION_MEM_IDX; -+ info.mem_offset = ring_dev->regions[info.mem_index].off; -+ info.mem_size = ring_dev->regions[info.mem_index].size; -+ -+ info.reg_index = PKA_RING_REGION_CNTRS_IDX; -+ info.reg_offset = ring_dev->regions[info.reg_index].off; -+ info.reg_size = ring_dev->regions[info.reg_index].size; -+ -+ return copy_to_user((void __user *)arg, &info, sizeof(info)) ? -+ -EFAULT : 0; -+ -+ } else if (cmd == PKA_GET_RING_INFO) { -+ pka_dev_hw_ring_info_t *this_ring_info; -+ pka_dev_hw_ring_info_t hw_ring_info; -+ -+ this_ring_info = ring_dev->ring->ring_info; -+ -+ hw_ring_info.cmmd_base = this_ring_info->cmmd_base; -+ hw_ring_info.rslt_base = this_ring_info->rslt_base; -+ hw_ring_info.size = this_ring_info->size; -+ hw_ring_info.host_desc_size = this_ring_info->host_desc_size; -+ hw_ring_info.in_order = this_ring_info->in_order; -+ hw_ring_info.cmmd_rd_ptr = this_ring_info->cmmd_rd_ptr; -+ hw_ring_info.rslt_wr_ptr = this_ring_info->rslt_wr_ptr; -+ hw_ring_info.cmmd_rd_stats = this_ring_info->cmmd_rd_ptr; -+ hw_ring_info.rslt_wr_stats = this_ring_info->rslt_wr_stats; -+ -+ return copy_to_user((void __user *)arg, &hw_ring_info, -+ sizeof(hw_ring_info)) ? -EFAULT : 0; -+ } else if (cmd == PKA_CLEAR_RING_COUNTERS) { -+ return pka_dev_clear_ring_counters(ring_dev->ring); -+ } else if (cmd == PKA_GET_RANDOM_BYTES) { -+ pka_dev_trng_info_t *trng_data; -+ pka_dev_shim_t *shim; -+ bool trng_present; -+ uint32_t byte_cnt; -+ uint32_t *data; -+ int ret; -+ -+ ret = -ENOENT; -+ shim = ring_dev->ring->shim; -+ trng_data = (pka_dev_trng_info_t *)arg; -+ /* -+ * We need byte count which is multiple of 4 as -+ * required by pka_dev_trng_read() interface. -+ */ -+ byte_cnt = round_up(trng_data->count, 4); -+ -+ data = kzalloc(byte_cnt, GFP_KERNEL); -+ if (data == NULL) { -+ PKA_DEBUG(PKA_DRIVER, "failed to allocate memory.\n"); -+ return -ENOMEM; -+ } -+ -+ trng_present = pka_dev_has_trng(shim); -+ if (!trng_present) { -+ kfree(data); -+ return ret; -+ } -+ -+ ret = pka_dev_trng_read(shim, data, byte_cnt); -+ if (ret) { -+ PKA_DEBUG(PKA_DRIVER, "TRNG failed %d\n", ret); -+ kfree(data); -+ return ret; -+ } -+ -+ ret = copy_to_user((void __user *)(trng_data->data), data, trng_data->count); -+ kfree(data); -+ return ret ? -EFAULT : 0; -+ } -+ -+ return error; -+} -+ -+#ifdef CONFIG_PKA_VFIO_IOMMU -+static const struct vfio_device_ops pka_ring_vfio_ops = { -+ .name = PKA_DRIVER_NAME, -+ .open = pka_drv_ring_open, -+ .release = pka_drv_ring_release, -+ .ioctl = pka_drv_ring_ioctl, -+ .mmap = pka_drv_ring_mmap, -+}; -+ -+static int pka_drv_add_ring_device(struct pka_ring_device *ring_dev) -+{ -+ struct device *dev = ring_dev->device; -+ int ret; -+ -+ ring_dev->parent_module = THIS_MODULE; -+ ring_dev->flags = VFIO_DEVICE_FLAGS_PLATFORM; -+ -+ ring_dev->group = vfio_iommu_group_get(dev); -+ if (!ring_dev->group) { -+ PKA_DEBUG(PKA_DRIVER, -+ "failed to get IOMMU group for device %d\n", -+ ring_dev->device_id); -+ return -EINVAL; -+ } -+ -+ /* -+ * Note that this call aims to add the given child device to a vfio -+ * group. This function creates a new driver data for the device -+ * different from the structure passed as a 3rd argument - i.e. -+ * pka_ring_dev. The struct newly created corresponds to 'vfio_device' -+ * structure which includes a field called 'device_data' that holds -+ * the initialized 'pka_ring_dev'. So to retrieve our private data, -+ * we must call 'dev_get_drvdata()' which returns the 'vfio_device' -+ * struct and access its 'device_data' field. Here one can use -+ * 'pka_platdata' structure instead to be consistent with the parent -+ * devices, and have a common driver data structure which will be used -+ * to manage devices - 'pka_drv_remove()' for instance. Since the VFIO -+ * framework alters the driver data and introduce an indirection, it -+ * is no more relevant to have a common driver data structure. Hence, -+ * we prefer to set the struct 'pka_vfio_dev' instead to avoid -+ * indirection when we have to retrieve this structure during the -+ * open(), mmap(), and ioctl() calls. Since, this structure is used -+ * as driver data here, it will be immediately reachable for these -+ * functions (see first argument passed (void *device_data) passed -+ * to those functions). -+ */ -+ ret = vfio_add_group_dev(dev, &pka_ring_vfio_ops, ring_dev); -+ if (ret) { -+ PKA_DEBUG(PKA_DRIVER, -+ "failed to add group device %d\n", -+ ring_dev->device_id); -+ vfio_iommu_group_put(ring_dev->group, dev); -+ return ret; -+ } -+ -+ ring_dev->group_id = iommu_group_id(ring_dev->group); -+ -+ PKA_DEBUG(PKA_DRIVER, -+ "ring device %d bus:%p iommu_ops:%p group:%p\n", -+ ring_dev->device_id, -+ dev->bus, -+ dev->bus->iommu_ops, -+ ring_dev->group); -+ -+ return 0; -+} -+ -+static struct pka_ring_device *pka_drv_del_ring_device(struct device *dev) -+{ -+ struct pka_ring_device *ring_dev; -+ -+ ring_dev = vfio_del_group_dev(dev); -+ if (ring_dev) -+ vfio_iommu_group_put(dev->iommu_group, dev); -+ -+ return ring_dev; -+} -+ -+static int pka_drv_init_class(void) -+{ -+ return 0; -+} -+ -+static void pka_drv_destroy_class(void) -+{ -+} -+#else -+static struct pka { -+ struct class *class; -+ struct idr ring_idr; -+ struct mutex ring_lock; -+ struct cdev ring_cdev; -+ dev_t ring_devt; -+} pka; -+ -+static int pka_drv_open(struct inode *inode, struct file *filep) -+{ -+ struct pka_ring_device *ring_dev; -+ int ret; -+ -+ ring_dev = idr_find(&pka.ring_idr, iminor(inode)); -+ if (!ring_dev) { -+ PKA_ERROR(PKA_DRIVER, -+ "failed to find idr for device %d\n", -+ ring_dev->device_id); -+ return -ENODEV; -+ } -+ -+ ret = pka_drv_ring_open(ring_dev); -+ if (ret) -+ return ret; -+ -+ filep->private_data = ring_dev; -+ return 0; -+} -+ -+static int pka_drv_release(struct inode *inode, struct file *filep) -+{ -+ struct pka_ring_device *ring_dev = filep->private_data; -+ -+ filep->private_data = NULL; -+ pka_drv_ring_release(ring_dev); -+ -+ return 0; -+} -+ -+static int pka_drv_mmap(struct file *filep, struct vm_area_struct *vma) -+{ -+ return pka_drv_ring_mmap(filep->private_data, vma); -+} -+ -+static long pka_drv_unlocked_ioctl(struct file *filep, -+ unsigned int cmd, unsigned long arg) -+{ -+ return pka_drv_ring_ioctl(filep->private_data, cmd, arg); -+} -+ -+static const struct file_operations pka_ring_fops = { -+ .owner = THIS_MODULE, -+ .open = pka_drv_open, -+ .release = pka_drv_release, -+ .unlocked_ioctl = pka_drv_unlocked_ioctl, -+ .mmap = pka_drv_mmap, -+}; -+ -+static int pka_drv_add_ring_device(struct pka_ring_device *ring_dev) -+{ -+ struct device *dev = ring_dev->device; -+ -+ ring_dev->minor = idr_alloc(&pka.ring_idr, -+ ring_dev, 0, MINORMASK + 1, GFP_KERNEL); -+ if (ring_dev->minor < 0) { -+ PKA_DEBUG(PKA_DRIVER, -+ "failed to alloc minor to device %d\n", -+ ring_dev->device_id); -+ return ring_dev->minor; -+ } -+ -+ dev = device_create(pka.class, NULL, -+ MKDEV(MAJOR(pka.ring_devt), ring_dev->minor), -+ ring_dev, "%d", ring_dev->device_id); -+ if (IS_ERR(dev)) { -+ PKA_DEBUG(PKA_DRIVER, -+ "failed to create device %d\n", -+ ring_dev->device_id); -+ idr_remove(&pka.ring_idr, ring_dev->minor); -+ return PTR_ERR(dev); -+ } -+ -+ PKA_DEBUG(PKA_DRIVER, -+ "ring device %d minor:%d\n", -+ ring_dev->device_id, ring_dev->minor); -+ -+ return 0; -+} -+ -+static struct pka_ring_device *pka_drv_del_ring_device(struct device *dev) -+{ -+ struct platform_device *pdev = -+ container_of(dev, struct platform_device, dev); -+ struct pka_platdata *priv = platform_get_drvdata(pdev); -+ struct pka_info *info = priv->info; -+ struct pka_ring_device *ring_dev = info->priv; -+ -+ if (ring_dev) { -+ device_destroy(pka.class, MKDEV(MAJOR(pka.ring_devt), -+ ring_dev->minor)); -+ idr_remove(&pka.ring_idr, ring_dev->minor); -+ } -+ -+ return ring_dev; -+} -+ -+static char *pka_drv_devnode(struct device *dev, umode_t *mode) -+{ -+ if (mode != NULL) -+ *mode = PKA_DEVICE_ACCESS_MODE; -+ return kasprintf(GFP_KERNEL, "pka/%s", dev_name(dev)); -+} -+ -+static int pka_drv_init_class(void) -+{ -+ int ret; -+ -+ idr_init(&pka.ring_idr); -+ /* /sys/class/pka/$RING */ -+ pka.class = class_create(THIS_MODULE, "pka"); -+ if (IS_ERR(pka.class)) -+ return PTR_ERR(pka.class); -+ -+ /* /dev/pka/$RING */ -+ pka.class->devnode = pka_drv_devnode; -+ -+ ret = alloc_chrdev_region(&pka.ring_devt, 0, MINORMASK, "pka"); -+ if (ret) -+ goto err_alloc_chrdev; -+ -+ cdev_init(&pka.ring_cdev, &pka_ring_fops); -+ ret = cdev_add(&pka.ring_cdev, pka.ring_devt, MINORMASK); -+ if (ret) -+ goto err_cdev_add; -+ -+ return 0; -+ -+err_cdev_add: -+ unregister_chrdev_region(pka.ring_devt, MINORMASK); -+err_alloc_chrdev: -+ class_destroy(pka.class); -+ pka.class = NULL; -+ return ret; -+} -+ -+static void pka_drv_destroy_class(void) -+{ -+ idr_destroy(&pka.ring_idr); -+ cdev_del(&pka.ring_cdev); -+ unregister_chrdev_region(pka.ring_devt, MINORMASK); -+ class_destroy(pka.class); -+ pka.class = NULL; -+} -+#endif -+ -+static void pka_drv_get_mem_res(struct pka_device *pka_dev, -+ struct pka_dev_mem_res *mem_res, -+ uint64_t wndw_ram_off_mask) -+{ -+ enum pka_mem_res_idx acpi_mem_idx; -+ -+ acpi_mem_idx = PKA_ACPI_EIP154_IDX; -+ mem_res->wndw_ram_off_mask = wndw_ram_off_mask; -+ -+ /* PKA EIP154 MMIO base address*/ -+ mem_res->eip154_base = pka_dev->resource[acpi_mem_idx]->start; -+ mem_res->eip154_size = pka_dev->resource[acpi_mem_idx]->end - -+ mem_res->eip154_base + 1; -+ acpi_mem_idx++; -+ -+ /* PKA window ram base address*/ -+ mem_res->wndw_ram_base = pka_dev->resource[acpi_mem_idx]->start; -+ mem_res->wndw_ram_size = pka_dev->resource[acpi_mem_idx]->end - -+ mem_res->wndw_ram_base + 1; -+ acpi_mem_idx++; -+ -+ /* PKA alternate window ram base address -+ * Note: Here the size of all the alt window ram is same, depicted by -+ * 'alt_wndw_ram_size' variable. All alt window ram resources are read -+ * here even though not all of them are used currently. -+ */ -+ mem_res->alt_wndw_ram_0_base = pka_dev->resource[acpi_mem_idx]->start; -+ mem_res->alt_wndw_ram_size = pka_dev->resource[acpi_mem_idx]->end - -+ mem_res->alt_wndw_ram_0_base + 1; -+ -+ if (mem_res->alt_wndw_ram_size != PKA_WINDOW_RAM_REGION_SIZE) -+ PKA_ERROR(PKA_DRIVER, -+ "Alternate Window RAM size read from ACPI is incorrect.\n"); -+ -+ acpi_mem_idx++; -+ -+ mem_res->alt_wndw_ram_1_base = pka_dev->resource[acpi_mem_idx]->start; -+ acpi_mem_idx++; -+ -+ mem_res->alt_wndw_ram_2_base = pka_dev->resource[acpi_mem_idx]->start; -+ acpi_mem_idx++; -+ -+ mem_res->alt_wndw_ram_3_base = pka_dev->resource[acpi_mem_idx]->start; -+ acpi_mem_idx++; -+ -+ /* PKA CSR base address*/ -+ mem_res->csr_base = pka_dev->resource[acpi_mem_idx]->start; -+ mem_res->csr_size = pka_dev->resource[acpi_mem_idx]->end - -+ mem_res->csr_base + 1; -+} -+ -+/* -+ * Note that this function must be serialized because it calls -+ * 'pka_dev_register_shim' which manipulates common counters for -+ * pka devices. -+ */ -+static int pka_drv_register_device(struct pka_device *pka_dev, -+ uint64_t wndw_ram_off_mask) -+{ -+ uint32_t pka_shim_id; -+ uint8_t pka_shim_fw_id; -+ struct pka_dev_mem_res mem_res; -+ -+ /* Register Shim */ -+ pka_shim_id = pka_dev->device_id; -+ pka_shim_fw_id = pka_dev->fw_id; -+ -+ pka_drv_get_mem_res(pka_dev, &mem_res, wndw_ram_off_mask); -+ -+ pka_dev->shim = pka_dev_register_shim(pka_shim_id, pka_shim_fw_id, -+ &mem_res); -+ if (!pka_dev->shim) { -+ PKA_DEBUG(PKA_DRIVER, -+ "failed to register shim id=%u\n", pka_shim_id); -+ return -EFAULT; -+ } -+ -+ return 0; -+} -+ -+static int pka_drv_unregister_device(struct pka_device *pka_dev) -+{ -+ if (!pka_dev) -+ return -EINVAL; -+ -+ if (pka_dev->shim) { -+ PKA_DEBUG(PKA_DRIVER, -+ "unregister device shim %u\n", -+ pka_dev->shim->shim_id); -+ return pka_dev_unregister_shim(pka_dev->shim); -+ } -+ -+ return 0; -+} -+ -+/* -+ * Note that this function must be serialized because it calls -+ * 'pka_dev_register_ring' which manipulates common counters for -+ * vfio devices. -+ */ -+static int pka_drv_register_ring_device(struct pka_ring_device *ring_dev) -+{ -+ uint32_t ring_id; -+ uint32_t shim_id; -+ -+ ring_id = ring_dev->device_id; -+ shim_id = ring_dev->parent_device_id; -+ -+ ring_dev->ring = pka_dev_register_ring(ring_id, shim_id); -+ if (!ring_dev->ring) { -+ PKA_DEBUG(PKA_DRIVER, -+ "failed to register ring device %u\n", ring_id); -+ return -EFAULT; -+ } -+ -+ return 0; -+} -+ -+static int pka_drv_unregister_ring_device(struct pka_ring_device *ring_dev) -+{ -+ uint32_t ring_id; -+ -+ if (!ring_dev) -+ return -EINVAL; -+ -+ ring_id = ring_dev->ring->ring_id; -+ -+ if (ring_dev->ring) { -+ PKA_DEBUG(PKA_DRIVER, "unregister ring device %u\n", ring_id); -+ return pka_dev_unregister_ring(ring_dev->ring); -+ } -+ -+ return 0; -+} -+ -+static const struct of_device_id pka_ring_match[] = { -+ { .compatible = PKA_RING_DEVICE_COMPAT }, -+ {}, -+}; -+ -+static int pka_drv_rng_read(struct hwrng *rng, void *data, size_t max, -+ bool wait) -+{ -+ int ret; -+ -+ struct pka_device *pka_dev = container_of(rng, struct pka_device, rng); -+ uint32_t *buffer = data; -+ -+ ret = pka_dev_trng_read(pka_dev->shim, buffer, max); -+ if (ret) { -+ PKA_DEBUG(PKA_DRIVER, -+ "%s: failed to read random bytes ret=%d", -+ rng->name, ret); -+ return 0; -+ } -+ -+ return max; -+} -+ -+static int pka_drv_probe_device(struct pka_info *info) -+{ -+ struct pka_device *pka_dev; -+ struct device *dev = info->dev; -+ struct device_node *of_node = dev->of_node; -+ struct platform_device *pdev = to_platform_device(dev); -+ struct hwrng *trng; -+ const struct acpi_device_id *aid; -+ struct pka_drv_plat_info *plat_info; -+ uint64_t wndw_ram_off_mask; -+ int ret; -+ enum pka_mem_res_idx acpi_mem_idx; -+ -+ if (!info) -+ return -EINVAL; -+ -+ pka_dev = kzalloc(sizeof(*pka_dev), GFP_KERNEL); -+ if (!pka_dev) -+ return -ENOMEM; -+ -+ mutex_lock(&pka_drv_lock); -+ pka_device_cnt += 1; -+ if (pka_device_cnt > PKA_DRIVER_DEV_MAX) { -+ PKA_DEBUG(PKA_DRIVER, -+ "cannot support %u devices\n", pka_device_cnt); -+ kfree(pka_dev); -+ mutex_unlock(&pka_drv_lock); -+ return -EPERM; -+ } -+ pka_dev->device_id = pka_device_cnt - 1; -+ mutex_unlock(&pka_drv_lock); -+ -+ pka_dev->info = info; -+ pka_dev->device = dev; -+ info->flag = PKA_DRIVER_FLAG_DEVICE; -+ mutex_init(&pka_dev->mutex); -+ -+ for (acpi_mem_idx = PKA_ACPI_EIP154_IDX; -+ acpi_mem_idx < PKA_DEVICE_RES_CNT; acpi_mem_idx++) { -+ pka_dev->resource[acpi_mem_idx] = -+ platform_get_resource(pdev, IORESOURCE_MEM, acpi_mem_idx); -+ } -+ -+ /* Window ram offset mask is platform dependent */ -+ aid = acpi_match_device(pka_drv_acpi_ids, dev); -+ if (!aid) -+ return -ENODEV; -+ -+ plat_info = (struct pka_drv_plat_info *)aid->driver_data; -+ if (plat_info->type <= PKA_PLAT_TYPE_BF2) { -+ wndw_ram_off_mask = PKA_WINDOW_RAM_OFFSET_MASK1; -+ } else { -+ PKA_ERROR(PKA_DRIVER, "Invalid platform type: %d\n", -+ (int)plat_info->type); -+ return -EINVAL; -+ } -+ -+ /* Set interrupts */ -+ ret = platform_get_irq(pdev, 0); -+ pka_dev->irq = ret; -+ if (ret == -ENXIO && of_node) { -+ pka_dev->irq = PKA_IRQ_NONE; -+ } else if (ret < 0) { -+ PKA_ERROR(PKA_DRIVER, -+ "failed to get device %u IRQ\n", pka_dev->device_id); -+ return ret; -+ } -+ -+ /* Register IRQ */ -+ ret = pka_drv_register_irq(pka_dev); -+ if (ret) { -+ PKA_ERROR(PKA_DRIVER, -+ "failed to register device %u IRQ\n", -+ pka_dev->device_id); -+ return ret; -+ } -+ -+ /* Firmware version */ -+ pka_dev->fw_id = plat_info->fw_id; -+ -+ mutex_lock(&pka_drv_lock); -+ ret = pka_drv_register_device(pka_dev, wndw_ram_off_mask); -+ if (ret) { -+ PKA_DEBUG(PKA_DRIVER, "failed to register shim id=%u\n", -+ pka_dev->device_id); -+ mutex_unlock(&pka_drv_lock); -+ return ret; -+ } -+ mutex_unlock(&pka_drv_lock); -+ -+ /* Setup the TRNG, if needed */ -+ if (pka_dev_has_trng(pka_dev->shim)) { -+ trng = &pka_dev->rng; -+ trng->name = pdev->name; -+ trng->read = pka_drv_rng_read; -+ -+ ret = hwrng_register(&pka_dev->rng); -+ if (ret) { -+ PKA_ERROR(PKA_DRIVER, -+ "failed to register trng\n"); -+ return ret; -+ } -+ } -+ -+ info->priv = pka_dev; -+ -+#ifdef BUG_SW_1127083_FIXED -+ /* -+ * Create platform devices (pka-ring) from current node. -+ * This code is reserverd for DT. -+ */ -+ if (of_node) { -+ ret = of_platform_populate(of_node, pka_ring_match, -+ NULL, dev); -+ if (ret) { -+ PKA_ERROR(PKA_DRIVER, -+ "failed to create platform devices\n"); -+ return ret; -+ } -+ } -+#endif -+ -+ return 0; -+} -+ -+static int pka_drv_remove_device(struct platform_device *pdev) -+{ -+ struct pka_platdata *priv = platform_get_drvdata(pdev); -+ struct pka_info *info = priv->info; -+ struct pka_device *pka_dev = (struct pka_device *)info->priv; -+ -+ if (!pka_dev) { -+ PKA_ERROR(PKA_DRIVER, "failed to unregister device\n"); -+ return -EINVAL; -+ } -+ -+ if (pka_dev_has_trng(pka_dev->shim)) -+ hwrng_unregister(&pka_dev->rng); -+ -+ if (pka_drv_unregister_device(pka_dev)) -+ PKA_ERROR(PKA_DRIVER, "failed to unregister device\n"); -+ -+ return 0; -+} -+ -+static int pka_drv_probe_ring_device(struct pka_info *info) -+{ -+ struct pka_ring_device *ring_dev; -+ struct device *dev = info->dev; -+ -+ int ret; -+ -+ if (!info) -+ return -EINVAL; -+ -+ ring_dev = kzalloc(sizeof(*ring_dev), GFP_KERNEL); -+ if (!ring_dev) -+ return -ENOMEM; -+ -+ mutex_lock(&pka_drv_lock); -+ pka_ring_device_cnt += 1; -+ if (pka_ring_device_cnt > PKA_DRIVER_RING_DEV_MAX) { -+ PKA_DEBUG(PKA_DRIVER, "cannot support %u ring devices\n", -+ pka_ring_device_cnt); -+ kfree(ring_dev); -+ mutex_unlock(&pka_drv_lock); -+ return -EPERM; -+ } -+ ring_dev->device_id = pka_ring_device_cnt - 1; -+ ring_dev->parent_device_id = pka_device_cnt - 1; -+ mutex_unlock(&pka_drv_lock); -+ -+ ring_dev->info = info; -+ ring_dev->device = dev; -+ info->flag = PKA_DRIVER_FLAG_RING_DEVICE; -+ mutex_init(&ring_dev->mutex); -+ -+ ret = pka_drv_add_ring_device(ring_dev); -+ if (ret) { -+ PKA_DEBUG(PKA_DRIVER, -+ "failed to add ring device %u\n", -+ ring_dev->device_id); -+ kfree(ring_dev); -+ return ret; -+ } -+ -+ mutex_lock(&pka_drv_lock); -+ /* Register ring device */ -+ ret = pka_drv_register_ring_device(ring_dev); -+ if (ret) { -+ PKA_DEBUG(PKA_DRIVER, -+ "failed to register ring device %u\n", -+ ring_dev->device_id); -+ mutex_unlock(&pka_drv_lock); -+ goto err_register_ring; -+ } -+ mutex_unlock(&pka_drv_lock); -+ -+ info->priv = ring_dev; -+ -+ return 0; -+ -+ err_register_ring: -+ pka_drv_del_ring_device(dev); -+ kfree(ring_dev); -+ return ret; -+} -+ -+static int pka_drv_remove_ring_device(struct platform_device *pdev) -+{ -+ struct pka_ring_device *ring_dev; -+ struct device *dev = &pdev->dev; -+ int ret; -+ -+ ring_dev = pka_drv_del_ring_device(dev); -+ if (ring_dev) { -+ ret = pka_drv_unregister_ring_device(ring_dev); -+ if (ret) { -+ PKA_ERROR(PKA_DRIVER, -+ "failed to unregister vfio device\n"); -+ return ret; -+ } -+ kfree(ring_dev); -+ } -+ -+ return 0; -+} -+ -+static int pka_drv_of_probe(struct platform_device *pdev, -+ struct pka_info *info) -+{ -+#ifdef BUG_SW_1127083_FIXED -+ struct device *dev = &pdev->dev; -+ -+ int error; -+ -+ error = device_property_read_string(dev, "compatible", &info->compat); -+ if (error) { -+ PKA_DEBUG(PKA_DRIVER, "cannot retrieve compat for %s\n", -+ pdev->name); -+ return -EINVAL; -+ } -+ -+ if (!strcmp(info->compat, pka_ring_compat)) { -+ PKA_PRINT(PKA_DRIVER, "probe ring device %s\n", -+ pdev->name); -+ error = pka_drv_probe_ring_device(info); -+ if (error) { -+ PKA_DEBUG(PKA_DRIVER, -+ "failed to register ring device compat=%s\n", -+ info->compat); -+ return error; -+ } -+ -+ } else if (!strcmp(info->compat, pka_compat)) { -+ PKA_PRINT(PKA_DRIVER, "probe device %s\n", pdev->name); -+ error = pka_drv_probe_device(info); -+ if (error) { -+ PKA_DEBUG(PKA_DRIVER, -+ "failed to register device compat=%s\n", -+ info->compat); -+ return error; -+ } -+ } -+ -+ return 0; -+#endif -+ return -EPERM; -+} -+ -+static int pka_drv_acpi_probe(struct platform_device *pdev, -+ struct pka_info *info) -+{ -+ struct acpi_device *adev; -+ struct device *dev = &pdev->dev; -+ -+ int error; -+ -+ if (acpi_disabled) -+ return -ENOENT; -+ -+ adev = ACPI_COMPANION(dev); -+ if (!adev) { -+ PKA_DEBUG(PKA_DRIVER, -+ "ACPI companion device not found for %s\n", -+ pdev->name); -+ return -ENODEV; -+ } -+ -+ info->acpihid = acpi_device_hid(adev); -+ if (WARN_ON(!info->acpihid)) -+ return -EINVAL; -+ -+ if (!strcmp(info->acpihid, pka_ring_acpihid_bf1) -+ || !strcmp(info->acpihid, pka_ring_acpihid_bf2)) { -+ error = pka_drv_probe_ring_device(info); -+ if (error) { -+ PKA_DEBUG(PKA_DRIVER, -+ "failed to register ring device %s\n", -+ pdev->name); -+ return error; -+ } -+ PKA_DEBUG(PKA_DRIVER, "ring device %s probed\n", -+ pdev->name); -+ -+ } else if (!strcmp(info->acpihid, pka_acpihid_bf1) -+ || !strcmp(info->acpihid, pka_acpihid_bf2)) { -+ error = pka_drv_probe_device(info); -+ if (error) { -+ PKA_DEBUG(PKA_DRIVER, -+ "failed to register device %s\n", -+ pdev->name); -+ return error; -+ } -+ PKA_PRINT(PKA_DRIVER, "device %s probed\n", pdev->name); -+ } -+ -+ return 0; -+} -+ -+static int pka_drv_probe(struct platform_device *pdev) -+{ -+ struct pka_platdata *priv; -+ struct pka_info *info; -+ struct device *dev = &pdev->dev; -+ -+ int ret; -+ -+ priv = kzalloc(sizeof(*priv), GFP_KERNEL); -+ if (!priv) -+ return -ENOMEM; -+ -+ spin_lock_init(&priv->lock); -+ priv->pdev = pdev; -+ /* interrupt is disabled to begin with */ -+ priv->irq_flags = 0; -+ -+ info = kzalloc(sizeof(*info), GFP_KERNEL); -+ if (!info) -+ return -ENOMEM; -+ -+ info->name = pdev->name; -+ info->version = PKA_DRIVER_VERSION; -+ info->module = THIS_MODULE; -+ info->dev = dev; -+ -+ priv->info = info; -+ -+ platform_set_drvdata(pdev, priv); -+ -+ /* -+ * There can be two kernel build combinations. One build where -+ * ACPI is not selected and another one with the ACPI. -+ * -+ * In the first case, 'pka_drv_acpi_probe' will return since -+ * acpi_disabled is 1. DT user will not see any kind of messages -+ * from ACPI. -+ * -+ * In the second case, both DT and ACPI is compiled in but the -+ * system is booting with any of these combinations. -+ * -+ * If the firmware is DT type, then acpi_disabled is 1. The ACPI -+ * probe routine terminates immediately without any messages. -+ * -+ * If the firmware is ACPI type, then acpi_disabled is 0. All other -+ * checks are valid checks. We cannot claim that this system is DT. -+ */ -+ ret = pka_drv_acpi_probe(pdev, info); -+ if (ret) -+ ret = pka_drv_of_probe(pdev, info); -+ -+ if (ret) { -+ PKA_DEBUG(PKA_DRIVER, "unknown device\n"); -+ return ret; -+ } -+ -+ return 0; -+} -+ -+static int pka_drv_remove(struct platform_device *pdev) -+{ -+ struct device *dev = &pdev->dev; -+ -+ /* -+ * Little hack here: -+ * The issue here is that the driver data structure which holds our -+ * initialized private data cannot be used when the 'pdev' arguments -+ * points to child device -i.e. vfio device. Indeed, during the probe -+ * function we set an initialized structure called 'priv' as driver -+ * data for all platform devices including parents devices and child -+ * devices. This driver data is unique to each device - see call to -+ * 'platform_set_drvdata()'. However, when we add the child device to -+ * a vfio group through 'vfio_add_group_dev()' call, this function -+ * creates a new driver data for the device - i.e. a 'vfio_device' -+ * structure which includes a field called 'device_data' to hold the -+ * aforementionned initialized private data. So, to retrieve our -+ * private data, we must call 'dev_get_drvdata()' which returns the -+ * 'vfio_device' struct and access its 'device_data' field. However, -+ * this cannot be done before determining if the 'pdev' is associated -+ * with a child device or a parent device. -+ * In order to deal with that we propose this little hack which uses -+ * the iommu_group to distinguich between parent and child devices. -+ * For now, let's say it is a customized solution that works for our -+ * case. Indeed, in the current design, the private data holds some -+ * infos that defines the type of the device. The intuitive way to do -+ * that is as following: -+ * -+ * struct pka_platdata *priv = platform_get_drvdata(pdev); -+ * struct pka_info *info = priv->info; -+ * -+ * if (info->flag == PKA_DRIVER_FLAG_RING_DEVICE) -+ * return pka_drv_remove_ring_device(info); -+ * if (info->flag == PKA_DRIVER_FLAG_DEVICE) -+ * return pka_drv_remove_ring_device(info); -+ * -+ * Since the returned private data of child devices -i.e vfio devices -+ * corresponds to 'vfio_device' structure, we cannot use it to -+ * differentiate between parent and child devices. This alternative -+ * solution is used instead. -+ */ -+ if (dev->iommu_group) { -+ PKA_PRINT(PKA_DRIVER, "remove ring device %s\n", -+ pdev->name); -+ return pka_drv_remove_ring_device(pdev); -+ } -+ -+ PKA_PRINT(PKA_DRIVER, "remove device %s\n", pdev->name); -+ return pka_drv_remove_device(pdev); -+} -+ -+static const struct of_device_id pka_drv_match[] = { -+ { .compatible = PKA_DEVICE_COMPAT }, -+ { .compatible = PKA_RING_DEVICE_COMPAT }, -+ {} -+}; -+ -+MODULE_DEVICE_TABLE(of, pka_drv_match); -+ -+MODULE_DEVICE_TABLE(acpi, pka_drv_acpi_ids); -+ -+static struct platform_driver pka_drv = { -+ .driver = { -+ .name = PKA_DRIVER_NAME, -+ .of_match_table = of_match_ptr(pka_drv_match), -+ .acpi_match_table = ACPI_PTR(pka_drv_acpi_ids), -+ }, -+ .probe = pka_drv_probe, -+ .remove = pka_drv_remove, -+}; -+ -+/* Initialize the module - Register the pka platform driver */ -+static int __init pka_drv_register(void) -+{ -+ int ret; -+ -+ ret = pka_drv_init_class(); -+ if (ret) { -+ PKA_ERROR(PKA_DRIVER, "failed to create class\n"); -+ return ret; -+ } -+ -+ ret = platform_driver_register(&pka_drv); -+ if (ret) { -+ PKA_ERROR(PKA_DRIVER, "failed to register platform driver\n"); -+ return ret; -+ } -+ -+ PKA_PRINT(PKA_DRIVER, "version: " PKA_DRIVER_VERSION "\n"); -+ -+ return 0; -+} -+ -+/* Cleanup the module - unregister the pka platform driver */ -+static void __exit pka_drv_unregister(void) -+{ -+ platform_driver_unregister(&pka_drv); -+ pka_drv_destroy_class(); -+} -+ -+module_init(pka_drv_register); -+module_exit(pka_drv_unregister); -+ -+MODULE_DESCRIPTION(PKA_DRIVER_DESCRIPTION); -+MODULE_VERSION(PKA_DRIVER_VERSION); -+MODULE_LICENSE("Dual BSD/GPL"); -diff --git a/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_firmware.h b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_firmware.h -new file mode 100644 -index 000000000..29ea27ce0 ---- /dev/null -+++ b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_firmware.h -@@ -0,0 +1,4823 @@ -+// -+// BSD LICENSE -+// -+// Copyright(c) 2016 Mellanox Technologies, Ltd. All rights reserved. -+// All rights reserved. -+// -+// Redistribution and use in source and binary forms, with or without -+// modification, are permitted provided that the following conditions -+// are met: -+// -+// * Redistributions of source code must retain the above copyright -+// notice, this list of conditions and the following disclaimer. -+// * Redistributions in binary form must reproduce the above copyright -+// notice, this list of conditions and the following disclaimer in -+// the documentation and/or other materials provided with the -+// distribution. -+// * Neither the name of Mellanox Technologies nor the names of its -+// contributors may be used to endorse or promote products derived -+// from this software without specific prior written permission. -+// -+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+// -+ -+#ifndef __DRIVERS_MICA_PKA_FW_H__ -+#define __DRIVERS_MICA_PKA_FW_H__ -+ -+#include -+ -+// -+// Program binaries -+// -+ -+// Align to PKA_BUFFER_RAM_SIZE. This is greater than the actual buffer -+// length so that the image is zero padded. -+static const uint32_t fw0_farm_img_data_buf[2048] = -+{ -+ 0x137001C9, 0x692040FA, 0x55502301, 0x328C0200, -+ 0x5E7000C9, 0x3D7000C8, 0x3670001D, 0x5370001F, -+ 0x746A4010, 0x046B4014, 0x3C621FF8, 0x4B631FF4, -+ 0x2A684000, 0x5A694004, 0x4F601FF6, 0x3F611FF2, -+ 0x5A6A4008, 0x2A6B400C, 0x19621FFA, 0x6D631FF0, -+ 0x0F684034, 0x7070001E, 0x5D34003F, 0x08601FFE, -+ 0x0328000B, 0x52C40047, 0x69240027, 0x04880000, -+ 0x76800047, 0x3380002E, 0x36800047, 0x7A800039, -+ 0xB6800047, 0xDF80003B, 0xD7800027, 0x9B800035, -+ 0xDC80003D, 0xB980003F, 0xB5800041, 0xF36A4018, -+ 0xDA621FFC, 0x9997017D, 0xA4300002, 0xD9D00061, -+ 0xBC30FFFE, 0xFC800056, 0xF36A4018, 0x9A621FFC, -+ 0xD59701CC, 0xA4300002, 0x99D00061, 0xFC30FFFE, -+ 0x99800062, 0xD097026C, 0xD38C0400, 0x8B614018, -+ 0xBC800056, 0xFF97039F, 0xFC800056, 0x9A97039D, -+ 0xFC800056, 0x9D9703A3, 0xBC800056, 0xF89703A1, -+ 0xBC800056, 0xDC970367, 0xFC800056, 0x9D200003, -+ 0xFC800056, 0xB7200023, 0xBC800056, 0xFD7000C8, -+ 0xD2200021, 0xBA8C5000, 0x9B80006F, 0xF5707FC8, -+ 0x84702084, 0xF670001D, 0xDB200000, 0xB6010000, -+ 0xCF220001, 0xB197007F, 0xA0684084, 0xD3340020, -+ 0xA7CC0052, 0xFC20000F, 0xF18C0100, 0xA4300002, -+ 0x99D00061, 0xED601FFC, 0xD5681FF0, 0x926A4014, -+ 0xF6010000, 0xB18C0100, 0x9260400C, 0xF197007F, -+ 0x34681FFC, 0x7C30FFFE, 0x616A1FF6, 0x336B1FF8, -+ 0x44624000, 0x3B634010, 0x076A1FF2, 0x526B1FF4, -+ 0x62624004, 0x1D634014, 0x006A1FFA, 0x7A230000, -+ 0x03624008, 0x7A8C5000, 0x5A63401C, 0x086440C9, -+ 0x5B800003, 0x3B6B1FE4, 0x118B4000, 0x7F8C0480, -+ 0x17BC004B, 0x6D61401C, 0x518B4000, 0x36010000, -+ 0x3C30FFFE, 0x66500000, 0x66500000, 0x26500000, -+ 0x66500000, 0x24300002, 0x102A0002, 0x65614000, -+ 0xAD624010, 0xF4604008, 0xEE218808, 0x93800073, -+ 0xE5631FEC, 0x8B6B4000, 0x846A1FF4, 0xF3604000, -+ 0xC3614004, 0x95634008, 0xAD624010, 0xCB624014, -+ 0xBB218001, 0xD0970073, 0xFA068000, 0x8C6B4008, -+ 0xE6691FF2, 0x92634000, 0x83614004, 0xF4604008, -+ 0xAD624010, 0xD6218200, 0xD0970073, 0xBC6B1FEC, -+ 0x918B4000, 0xE2631FE4, 0xF0681FF2, 0xB56040A0, -+ 0xE5691FF4, 0xB3604000, 0xB4604008, 0xCC614010, -+ 0x138C0400, 0x6470081C, 0x5270881D, 0x20F000A3, -+ 0x7C30FFFE, 0x33490000, 0x34310001, 0x5D200003, -+ 0x48D40071, 0x0931FFFF, 0x146540B4, 0x706B1FFE, -+ 0x216A1FF6, 0x7E33FFFF, 0x56D000BA, 0x336B1FF8, -+ 0x44624000, 0x03624008, 0x3B634010, 0x7F8C0480, -+ 0x17BC004B, 0x5E70011F, 0x6470081C, 0x1270881D, -+ 0x08F000B8, 0x538000BC, 0x7F8C0480, 0x17BC004B, -+ 0x6C6840A0, 0x30694024, 0x2F090000, 0x7FC8017A, -+ 0x23024000, 0x6E2E0001, 0x4B624014, 0x2F31FFFB, -+ 0x47684028, 0x1370001F, 0x3734001F, 0x57184000, -+ 0x592C0001, 0x17020000, 0x24240008, 0x6934FFE0, -+ 0x04300005, 0x65691FF4, 0x506040A2, 0x366040A6, -+ 0x592C0001, 0x2F090000, 0x10C400DF, 0x7A6940A0, -+ 0x0E050000, 0x722DFFFF, 0x6A31FFFE, 0x30510000, -+ 0x30510000, 0x61691FFA, 0x4E050000, 0x322DFFFF, -+ 0x6A31FFFE, 0x30510000, 0x30510000, 0x592C0001, -+ 0x8434FFFE, 0xC4601FEC, 0xF526000C, 0xB0621FEA, -+ 0xD126005F, 0xBA200060, 0xBA230000, 0xCB0B2000, -+ 0xF22DFFFF, 0x816140AA, 0x8F2D0001, 0xEA072000, -+ 0xBF6B1FEA, 0xD4004000, 0xFA30FFFD, 0xAF0AC000, -+ 0xFA230000, 0xA6631FEA, 0x8B0B2000, 0xFA20000C, -+ 0xBA230000, 0xF4290007, 0xF9C400F9, 0x95250007, -+ 0x9B8000FA, 0xED210007, 0xCD084000, 0xB61B4000, -+ 0xF9634088, 0x986940AA, 0xBA30FFFD, 0xCF2D0001, -+ 0xAA072000, 0xF22A0008, 0xD5621FE8, 0xB5008000, -+ 0xEE2E0001, 0xA934FFE0, 0x84300005, 0xD92C0001, -+ 0xF46B1FF0, 0x8B691FEC, 0xA1601FEE, 0xCD074000, -+ 0x92634000, 0xDD33FFFE, 0xC7530000, 0x87530000, -+ 0xC7530000, 0x87530000, 0x85330002, 0xD5634008, -+ 0xB9070000, 0xE52B0003, 0xE4280004, 0x8FC00130, -+ 0x992C0001, 0xDA604010, 0xFF8C0480, 0x97BC004B, -+ 0xDE70011F, 0x9570001C, 0x9270881D, 0xE3F0011F, -+ 0x07691FFE, 0x66684024, 0x4931FFFF, 0x1BD0012F, -+ 0x40691FF6, 0x02140000, 0x3ED00177, 0x4D084000, -+ 0x51694028, 0x2135001F, 0x3930FFFB, 0x57184000, -+ 0x3BC80174, 0x592C0001, 0x40601FE2, 0x1370001F, -+ 0x75008000, 0x3E3CFFFF, 0x18218000, 0x6C110000, -+ 0x1D33FFFE, 0x50340010, 0x57C8013B, 0x0B41C000, -+ 0x27270002, 0x47530000, 0x5180013D, 0x07530000, -+ 0x4B41C000, 0x38681FEE, 0x3A6940A0, 0x5A604010, -+ 0x0B6B4000, 0x7904C000, 0x592C0001, 0x0434FFFE, -+ 0x43614004, 0x34604008, 0x2268401C, 0x7F8C0480, -+ 0x57BC004B, 0x1E70011F, 0x1570001C, 0x6D70821D, -+ 0x07F0014C, 0x7E340008, 0x73C8015E, 0x07691FFE, -+ 0x66684024, 0x0931FFFF, 0x30D0015E, 0x40691FF6, -+ 0x02140000, 0x7ED00177, 0x4D084000, 0x11694028, -+ 0x3930FFFB, 0x6135001F, 0x57184000, 0x3BC80174, -+ 0x592C0001, 0x00601FE2, 0x1370001F, 0x6D691FE8, -+ 0x9F20000E, 0xF4310001, 0xC931FFFF, 0xB4D00166, -+ 0xE42CFFFF, 0x94800162, 0xBC694000, 0xC62207FA, -+ 0xCC6B4008, 0xA46140A8, 0xB26340A4, 0xE36240AC, -+ 0xB16040AE, 0xD77000B2, 0xFF8C0480, 0x97BC004B, -+ 0xF8700484, 0x9CE00171, 0xB8200001, 0xF6800071, -+ 0xBF200009, 0xD370001F, 0xF6800071, 0x9E200005, -+ 0x9370001F, 0xF6800071, 0xFB200007, 0x9370001F, -+ 0xF3C80071, 0x84631FE0, 0xBA230000, 0xE9631FFE, -+ 0x3F970099, 0x433C0001, 0x7CC80185, 0x033C0001, -+ 0x558001CA, 0x37681FFA, 0x136040A4, 0x5D8C0180, -+ 0x57BC004B, 0x1A700184, 0x39E0018A, 0x7D6940A8, -+ 0x096840A2, 0x65614000, 0x592C0001, 0x346B1FF0, -+ 0x5A604010, 0x15634008, 0x1D8C0180, 0x57BC004B, -+ 0x1570001C, 0x5270881D, 0x62691FFC, 0x322DFFFF, -+ 0x17C801AE, 0x54004000, 0x4034FFF0, 0x1A20000B, -+ 0x68CC01CA, 0x2A6A1FEC, 0x0100C000, 0x4D048000, -+ 0x936340A8, 0xF26340A4, 0xFF8C0480, 0x97BC004B, -+ 0xDA700184, 0xB4E001A5, 0xB26040A8, 0xCD048000, -+ 0xDD8C0180, 0x97BC004B, 0x99700284, 0xF0E001AB, -+ 0xB22DFFFF, 0xE8CC01A6, 0xD5681FF0, 0x8B691FEC, -+ 0xCE050000, 0xA16A1FF6, 0xB86B1FE2, 0xF26040A8, -+ 0x856140A4, 0xE36240AC, 0xF4681FFC, 0x862B0002, -+ 0xA42CFFFF, 0xD06340AE, 0xF96040B2, 0x968C5080, -+ 0xD7BC004B, 0xB8700484, 0x9CE001BE, 0xFE201FE8, -+ 0x85500001, 0xE4300002, 0xD36040A4, 0x9B200000, -+ 0xF66040A6, 0x9D8C0180, 0x97BC004B, 0xDA700184, -+ 0xD7E001C8, 0xB8200001, 0x9D6B1FE0, 0xD18B4000, -+ 0x87631FE6, 0xE6691FF2, 0xC06A1FFA, 0x83614004, -+ 0xE5691FF4, 0xB3621FDA, 0xAA614014, 0xD4004000, -+ 0x86240002, 0xC434FFFE, 0xE1601FD8, 0xBA054000, -+ 0xA26A1FF0, 0xCC614010, 0xC4624000, 0xAF060000, -+ 0xEF060000, 0xB1260002, 0x83624008, 0xD6218200, -+ 0x10970073, 0x516B1FF2, 0x6F060000, 0x39070000, -+ 0x74634004, 0x03624008, 0x10970073, 0x57020000, -+ 0x7B694008, 0x15681FF0, 0x3A098000, 0x7A068000, -+ 0x3197007F, 0x78681FD8, 0x476A1FF2, 0x00691FF6, -+ 0x736B1FF8, 0x2F060000, 0x21270001, 0x6537FFFE, -+ 0x2F05C000, 0x746B1FF0, 0x59611FF6, 0x3904C000, -+ 0x1E621FF2, 0x6E601FFA, 0x4C601FF0, 0x138C0400, -+ 0x5997017D, 0x01030000, 0x223F0001, 0x6DCC026A, -+ 0xB18C0100, 0xCF6A1FD8, 0xC3691FF0, 0x94004000, -+ 0xFA098000, 0x8D048000, 0xB197007F, 0xF6010000, -+ 0xEA684000, 0xBA098000, 0xBA068000, 0xF197007F, -+ 0xB36B1FF8, 0xC0691FF6, 0xE1270001, 0xA537FFFE, -+ 0xCE09C000, 0x996B1FD8, 0x876A1FF2, 0xD9611FF6, -+ 0xAF0AC000, 0xDE621FF2, 0xD38C0400, 0x9997017D, -+ 0xBC6B1FDA, 0xCF6A1FD8, 0xC3691FF0, 0x8F631FFA, -+ 0xFA098000, 0x9A611FF0, 0x81030000, 0xE23F0001, -+ 0x2DCC026A, 0x718C0100, 0x54004000, 0x0D048000, -+ 0x5260400C, 0x0D048000, 0x06240002, 0x66691FF2, -+ 0x446A1FF4, 0x3C30FFFE, 0x26500000, 0x66500000, -+ 0x24300002, 0x7197007F, 0x4B624014, 0x2A6B400C, -+ 0x77260001, 0x03691FF0, 0x21280001, 0x6D624010, -+ 0x34604008, 0x43614004, 0x52634000, 0x162A0001, -+ 0x1B058000, 0x6A31FFFE, 0x70510000, 0x30510000, -+ 0x6C078000, 0x1D33FFFE, 0x07530000, 0x47530000, -+ 0x3D218002, 0x50970073, 0x71260002, 0x2D624010, -+ 0x61691FFA, 0x1A6A4008, 0x03614004, 0x43624008, -+ 0x7B218001, 0x10970073, 0x30681FF2, 0x7C694000, -+ 0x04624000, 0x55604004, 0x526B1FF4, 0x22614008, -+ 0x5807C000, 0x27270002, 0x3B634010, 0x56218200, -+ 0x10970073, 0x7B694008, 0x43624008, 0x196B1FD8, -+ 0x25614000, 0x79070000, 0x73681FF4, 0x34634004, -+ 0x5A604010, 0x3B218001, 0x10970073, 0x62624004, -+ 0xA26A1FF0, 0xD8040000, 0xC4624000, 0x83624008, -+ 0xFC604014, 0xB6218018, 0x90970073, 0xE562400C, -+ 0xD38C0400, 0xB8200001, 0x9E6B1FE6, 0xD18B4000, -+ 0xA2631FE4, 0xD5681FF0, 0xD260400C, 0x84691FF8, -+ 0xF4611FDE, 0x846A1FF4, 0xB0621FDC, 0xFA0A4000, -+ 0x820E4000, 0xC5D40277, 0xE3024000, 0x92260003, -+ 0xB336FFFE, 0xC0601FE2, 0xCD048000, 0xA5601FE0, -+ 0xCD048000, 0xBA068000, 0xBB621FF0, 0xCD048000, -+ 0x25601FD6, 0x4B68400C, 0x76970077, 0x226A1FF0, -+ 0x4B68400C, 0x0D048000, 0x36970077, 0x656A1FF8, -+ 0x59681FE2, 0x346B1FF0, 0x3904C000, 0x40691FF6, -+ 0x3197007F, 0x538C0400, 0x476B4024, 0x22631FD2, -+ 0x4D378000, 0x23CC035A, 0x3C681FE0, 0x746B1FF0, -+ 0x3904C000, 0x66691FF2, 0x446A1FF4, 0x3197007F, -+ 0x19681FE2, 0x7C30FFFE, 0x45500001, 0x3C681FE0, -+ 0x66691FF2, 0x3197007F, 0x3D201FD8, 0x66500000, -+ 0xA6500000, 0xE6691FF2, 0xEA31FFFE, 0x87494000, -+ 0xF4310001, 0x80D4035D, 0x8931FFFF, 0xDB200000, -+ 0xC0601FD4, 0x99230001, 0x8F220001, 0xC100C000, -+ 0x97148000, 0xDCC802B2, 0xD9681FD4, 0x8D048000, -+ 0xC0601FD4, 0x8D074000, 0xBA054000, 0xFA068000, -+ 0xA9CC02AB, 0xD9681FE2, 0xF46B1FF0, 0xB904C000, -+ 0x8D210000, 0xCC6A1FDE, 0xDF970361, 0xBC30FFFE, -+ 0xE5480000, 0x8D388000, 0xA2300001, 0xD7D002C2, -+ 0x96250001, 0xF88002BE, 0xF63D0000, 0x94C802F4, -+ 0xD38C0400, 0x8B614018, 0x93218040, 0xD0970073, -+ 0xD9681FD4, 0x8F691FE2, 0xAA31FFFE, 0xC7494000, -+ 0xAA072000, 0xEE210001, 0xE56B4018, 0x9F3FFFFF, -+ 0xE1270001, 0x8D11C000, 0xB22DFFFF, 0xC1164000, -+ 0x996B1FD8, 0xD38C0400, 0xF0694024, 0x95611FD2, -+ 0xBAC802EC, 0xEF1F8000, 0xDEC802E5, 0x96621FD8, -+ 0xF0681FF2, 0x862107F6, 0xBC970360, 0xCF220001, -+ 0x0B624014, 0x7C681FD6, 0x74604008, 0x3B218001, -+ 0x50970073, 0x2A691FD6, 0x19681FE2, 0x446A1FF4, -+ 0x77260001, 0x1F970361, 0x31218010, 0x50970073, -+ 0x19681FE2, 0x4D210000, 0x446A1FF4, 0x37260001, -+ 0x5F970361, 0x13218040, 0x10970073, 0x798002B5, -+ 0x3C681FE0, 0x746B1FF0, 0x7904C000, 0x15604004, -+ 0x19681FE2, 0x7904C000, 0x73604000, 0x0C6A1FDE, -+ 0x7F6B1FDC, 0x1D634014, 0x2F0AC000, 0x570EC000, -+ 0x05D40302, 0x7602C000, 0x6D624010, 0x37218400, -+ 0x50970073, 0x0C691FD2, 0x2F1C4000, 0x44CC030F, -+ 0x6A31FFFE, 0x11484000, 0x033C0001, 0x492D0002, -+ 0x07494000, 0x57184000, 0x79C80350, 0x138C0400, -+ 0x40684020, 0x22300001, 0x18D0035A, 0x64300002, -+ 0x33D0031D, 0x6A684000, 0x5A694004, 0x15604004, -+ 0x25614000, 0x43684010, 0x73694014, 0x3C604014, -+ 0x4C614010, 0x0B6B4000, 0x15634008, 0x47631FD0, -+ 0xB2218020, 0xD0970073, 0xF1D00326, 0xBC681FE0, -+ 0xCF691FE2, 0xB3800328, 0x99681FE2, 0xEA691FE0, -+ 0xC46A1FF4, 0xB7260001, 0x9F970361, 0xD38C0400, -+ 0x916A4024, 0xF2218020, 0xD0970073, 0xBF681FD0, -+ 0xCE0A0000, 0xB7260001, 0xAA691FE0, 0xF46B1FF0, -+ 0xAF05C000, 0xCD1D0000, 0xE2CC033D, 0x99681FE2, -+ 0xAA691FE0, 0xE5601FE0, 0xD6611FE2, 0xBB681FDE, -+ 0xC7601FDC, 0x95621FDE, 0x99681FE2, 0xE6691FF2, -+ 0xBC970360, 0xF46A4010, 0xCD048000, 0xBC30FFFE, -+ 0xD38C0400, 0x844B0000, 0xA6500000, 0xE6500000, -+ 0xC13F0000, 0xBCC802B5, 0xB1218010, 0xD0970073, -+ 0xA22CFFFC, 0xD38C0400, 0xE6500000, 0xB98002B5, -+ 0xCF691FE2, 0xBC681FE0, 0x846A1FF4, 0xF197007F, -+ 0x8B624014, 0xF8200001, 0xCD210000, 0xAA6B400C, -+ 0xAD631FF0, 0xF6800071, 0xD2200017, 0xAD210007, -+ 0xDC800357, 0x9D200003, 0x8321001F, 0xDC800357, -+ 0x046A1FF4, 0x6D624010, 0x4B624014, 0x33604000, -+ 0x43614004, 0x34604008, 0x118B4000, 0x47631FE6, -+ 0x56681FF6, 0x04691FF8, 0x046A1FF4, 0x6E601FCC, -+ 0x3B611FCA, 0x7C621FF8, 0x52260003, 0x3336FFFE, -+ 0x7C621FCE, 0x346B1FF0, 0x2C078000, 0x6C078000, -+ 0x2E631FF6, 0x6C078000, 0x6D631FF0, 0x1097026C, -+ 0x033C0001, 0x72C8037C, 0x433C0001, 0x3980039A, -+ 0x55681FF0, 0x256A1FCE, 0x2C088000, 0x76970077, -+ 0x83691FF0, 0xE56A1FCE, 0xF5034000, 0x94004000, -+ 0xEC078000, 0x92634000, 0xAC088000, 0xEC088000, -+ 0xD4970084, 0x83691FF0, 0xA56A1FCE, 0xD4004000, -+ 0xAC088000, 0xFC30FFFE, 0xC5500001, 0xA7280002, -+ 0xE4300002, 0xAC088000, 0xAC088000, 0xCC601FF0, -+ 0x94970084, 0xE1691FCC, 0xC36A1FCA, 0x99611FF6, -+ 0xBC621FF8, 0xF8200001, 0xD38C0400, 0x9E6B1FE6, -+ 0xD18B4000, 0xAC220000, 0xBE8003A4, 0xD8224000, -+ 0x3E8003A4, 0x79228000, 0x7E8003A4, 0x0D22C000, -+ 0x7F621FFE, 0x07631FE6, 0x3F970099, 0x526B1FF4, -+ 0x44270003, 0x2537FFFE, 0x22631FBE, 0x76010000, -+ 0x033C0001, 0x718C0100, 0x67CC04E2, 0x3E6A40A2, -+ 0x6B6840A8, 0x37260001, 0x1A970658, 0x70681FF2, -+ 0x046A1FF4, 0x5A970658, 0x77260001, 0x3336FFFE, -+ 0x276240A2, 0x416240A6, 0x7D6940A8, 0x2D6A1FBE, -+ 0x70611FBC, 0x13201FC0, 0x13230010, 0x5B058000, -+ 0x2A410000, 0x5F2C0002, 0x452FFFFF, 0x2BCC03BF, -+ 0x56681FC0, 0x2E32FFFC, 0x36970077, 0x7B970638, -+ 0x4F691FD4, 0x30681FF2, 0x0F220001, 0x7197061F, -+ 0x306B1FFE, 0x7E33FFFF, 0x74D0052F, 0x3B6B1FBE, -+ 0x66691FF2, 0x0B6A1FD6, 0x2F05C000, 0x7797062A, -+ 0x00691FC0, 0x4F220001, 0x7E97063D, 0x2D691FDE, -+ 0x0A220004, 0x7E97063D, 0x6A6A1FDA, 0x21691FFA, -+ 0x7797062A, 0x2E691FD8, 0x3B6B1FBE, 0x70681FF2, -+ 0x89220002, 0xF904C000, 0xF904C000, 0xB197061F, -+ 0xD2970628, 0xB06B1FFE, 0xA1691FFA, 0xE31BC000, -+ 0xCAD403EF, 0xBB6B1FBE, 0xA26A1FC6, 0xEF05C000, -+ 0xAF05C000, 0xF797062A, 0xDF8003F2, 0x80691FC0, -+ 0xD5681FC6, 0xB0970614, 0x8B691FDA, 0xF0681FC4, -+ 0xA26A1FC6, 0xD46040AC, 0xE46140A8, 0xA46240A4, -+ 0xBA8C5000, 0xD4700384, 0xFA970605, 0x8D21889C, -+ 0xC5614092, 0xBA8C5000, 0xB1700080, 0xCF691FE2, -+ 0xB597064B, 0xE9204096, 0xC0502A27, 0xA15030A7, -+ 0xE9204096, 0xAA504A52, 0x995024A5, 0xD1970642, -+ 0xEF502E27, 0xBF502084, 0xB7970646, 0xC450292F, -+ 0x91970642, 0xE76B4080, 0xF2370020, 0xA2CC0444, -+ 0xE9503548, 0xA1501CE4, 0xB7970646, 0xF85024A9, -+ 0x91970642, 0xE150A148, 0xC55035A4, 0xB7970646, -+ 0x94502530, 0xD1970642, 0xC7502929, 0x8C5035B3, -+ 0xF7970646, 0xBF502108, 0x91970642, 0xF55025A9, -+ 0x2E502CA6, 0x77970646, 0x4A50288A, 0x11970642, -+ 0x7150B4EB, 0x0C509525, 0x37970646, 0x7B501086, -+ 0x51970642, 0x27502D67, 0x215035AD, 0x77970646, -+ 0x2350198F, 0x51970642, 0x676B4080, 0x00631FEE, -+ 0x715098C4, 0x1E509DB1, 0x37970646, 0x4A50316C, -+ 0x11970642, 0x40509148, 0x4F502CC6, 0x37970646, -+ 0x20503590, 0x51970642, 0x7A5099AB, 0x01194000, -+ 0x5CC80447, 0x3597064B, 0x2D204098, 0x615030A7, -+ 0x37970646, 0x595024A5, 0x51970642, 0x35800408, -+ 0x7A8C5000, 0x34200013, 0x398004E3, 0x7A8C5000, -+ 0x716A4080, 0x3B681FDE, 0x24360020, 0x4ECC04F2, -+ 0x2D6A1FBE, 0x76970077, 0x7B970638, 0x0F220001, -+ 0x6D691FDE, 0x3E97063D, 0x0C691FD2, 0x7B6B1FBE, -+ 0x37681FFA, 0x4F220001, 0x7904C000, 0x3197061F, -+ 0x12970628, 0x7B6B1FBE, 0x66691FF2, 0x086A1FD0, -+ 0x6F05C000, 0x2F05C000, 0x3797062A, 0x6E691FD8, -+ 0xBB6B1FBE, 0xF0681FF2, 0xCF220001, 0xB904C000, -+ 0xF904C000, 0xB197061F, 0x92970628, 0xD8700090, -+ 0xFA970605, 0xBA8C5000, 0xA9204096, 0xEA504A52, -+ 0x815029E5, 0xE9204096, 0xEA504A52, 0xBC502491, -+ 0xD1970642, 0x8150292A, 0xB95020B1, 0xF7970646, -+ 0x9D501264, 0xD1970642, 0xC0502D04, 0xBD5040B0, -+ 0xB7970646, 0xD25024E5, 0xD1970642, 0x8B50A088, -+ 0xDC504130, 0xB7970646, 0xAC502D4B, 0xD1970642, -+ 0x2A504A52, 0x45502924, 0x77970646, 0x27502CEB, -+ 0x51970642, 0x24502E0B, 0x3D5011AA, 0x77970646, -+ 0x7F502108, 0x11970642, 0x2A504A52, 0x45502E6B, -+ 0x37970646, 0x555020C8, 0x51970642, 0x3250AD0B, -+ 0x66502925, 0x11970642, 0x03501E52, 0x5550166B, -+ 0x37970646, 0x4C5019AA, 0x51970642, 0x2A504A52, -+ 0x115020C6, 0x77970646, 0x595024A5, 0x11970642, -+ 0x6A504A52, 0x01502D0F, 0x37970646, 0x4E502884, -+ 0x91970642, 0xCA50296A, 0xD3502188, 0x91970642, -+ 0xE650A509, 0xA4502944, 0x91970642, 0xEA504A52, -+ 0xD95024C9, 0x91970642, 0xAD50A549, 0xD5502144, -+ 0xB7970646, 0xD1502669, 0xD1970642, 0x95681FC6, -+ 0xFA8C5000, 0xA76B4080, 0xBC30FFFE, 0xDF370008, -+ 0x80CC04B7, 0xF320001B, 0xF98004E3, 0x85500001, -+ 0xB06B1FFE, 0xED204098, 0xE31BC000, 0x8DD404C4, -+ 0xFF5010E4, 0xAD204098, 0xB35014E5, 0xF7970646, -+ 0xAB5018E6, 0xD1970642, 0xF18C0100, 0xB180051F, -+ 0xEB5018E6, 0xB46B1FF0, 0x96681FF6, 0xC4691FF8, -+ 0xCC631FCA, 0xAE601FCC, 0x9D611FCE, 0xF0681FC4, -+ 0xA5691FF4, 0xF46B1FC6, 0xCF2D0001, 0x9D611FF8, -+ 0xED631FF0, 0x8F601FF6, 0xBA8C5000, 0xD097026C, -+ 0x956B1FCA, 0xC06A1FCC, 0xC4691FCE, 0xAD631FF0, -+ 0xB8621FF6, 0xDD611FF8, 0xD38C0400, 0x833C0001, -+ 0xE7CC04E2, 0x80691FC0, 0xBA97065F, 0xE5691FC2, -+ 0x3A97065F, 0x7180051F, 0x433C0001, 0x3423001F, -+ 0x44601FEC, 0x00631FEE, 0x2D6A1FBE, 0x47691FFE, -+ 0x55681FF0, 0x01194000, 0x14038000, 0x43D404ED, -+ 0x3A068000, 0x4E06C000, 0x76970077, 0x1D681FEC, -+ 0x596B1FEE, 0x1480052B, 0x0F6A1FEE, 0x4E6B4090, -+ 0x33320005, 0x4D1EC000, 0x6D360001, 0x12C804FB, -+ 0x1920000D, 0x5A230007, 0x598004E4, 0x2D6A1FBE, -+ 0x55681FF0, 0x07691FFE, 0x14038000, 0x7A068000, -+ 0x01194000, 0x47D40503, 0x4E06C000, 0x36970077, -+ 0x61691FFA, 0x15681FF0, 0x046A1FF4, 0x55970616, -+ 0x6D6A1FBE, 0x166B1FFA, 0x15681FF0, 0x6C078000, -+ 0x34634004, 0x4D048000, 0x74604008, 0x26691FF2, -+ 0x446A1FF4, 0x25614000, 0x0B624014, 0x72218020, -+ 0x266A1FFE, 0x50970073, 0x411A8000, 0x0FD40529, -+ 0x3B6B1FBE, 0x55681FF0, 0x5807C000, 0x3904C000, -+ 0x7C30FFFE, 0x05500001, 0x31800529, 0x6D6A1FBE, -+ 0x80691FC0, 0xD1681FFE, 0xD4038000, 0xA3180000, -+ 0xE8D40526, 0xBA068000, 0x8E06C000, 0xD5681FF0, -+ 0xD5970616, 0xBA230000, 0xB8200001, 0xD38C0400, -+ 0xBC634018, 0xDE6B1FE6, 0xD18B4000, 0xAD691FDE, -+ 0xCF220001, 0xBE97063D, 0xA16A1FC0, 0xE1691FFA, -+ 0xB797062A, 0xFB6B1FBE, 0xE1691FFA, 0x8F6A1FD8, -+ 0xAF05C000, 0xF797062A, 0xC76A1FC4, 0x80691FF6, -+ 0xF797062A, 0xBB6B1FBE, 0x80691FF6, 0xEA6A1FDA, -+ 0xAF05C000, 0xF797062A, 0xD1681FFE, 0xA3180000, -+ 0xD3D0054C, 0xAD691FDE, 0xB3681FC2, 0xF6970617, -+ 0xED691FDE, 0x95681FC6, 0xB6970617, 0xDA800558, -+ 0xBB6B1FBE, 0xE1691FFA, 0xC46A1FC2, 0xAF05C000, -+ 0xEF05C000, 0xB797062A, 0xBB6B1FBE, 0xC0691FF6, -+ 0xA26A1FC6, 0xEF05C000, 0xEF05C000, 0xB797062A, -+ 0x98700090, 0xFA970605, 0xFA8C5000, 0xB1700080, -+ 0xE9204096, 0xAA504A52, 0xB15024E4, 0xE9204096, -+ 0x2A504A52, 0x425030A6, 0x51970642, 0x1450B12C, -+ 0x515020F0, 0x37970646, 0x085028B1, 0x51970642, -+ 0x7E50A90A, 0x3E50AD8C, 0x11970642, 0x5050456B, -+ 0x2850BD4A, 0x77970646, 0x676B4080, 0x00631FEE, -+ 0x71700080, 0x0E50352B, 0x11970642, 0x596B1FEE, -+ 0x316A4080, 0x63330006, 0x6BD4057A, 0x35320006, -+ 0x35D005B1, 0x518004F8, 0x6A504A52, 0x0B502D8B, -+ 0x77970646, 0x37502531, 0x11970642, 0x7C50252B, -+ 0xB950210B, 0xF7970646, 0xED5018E5, 0x91970642, -+ 0xEA504A52, 0x99503CCF, 0xB7970646, 0xD1502669, -+ 0xD1970642, 0x8F50A52F, 0x835018CB, 0xD1970642, -+ 0xAA504A52, 0xD2503E69, 0xF7970646, 0x9250112C, -+ 0xD1970642, 0xBF50B5ED, 0x8950326C, 0xD1970642, -+ 0xAA504A52, 0xC15035AA, 0xD1970642, 0xB250B50D, -+ 0x92502533, 0xD1970642, 0xC3501E52, 0x9650166D, -+ 0xD1970642, 0xBB970638, 0xBB6B1FBE, 0xE6691FF2, -+ 0x0B6A1FD6, 0x6F05C000, 0x7797062A, 0x3B6B1FBE, -+ 0x66691FF2, 0x086A1FD0, 0x2F05C000, 0x6F05C000, -+ 0x7797062A, 0x3A970605, 0x3A8C5000, 0x69204096, -+ 0x2A504A52, 0x515020C6, 0x69204096, 0x2A504A52, -+ 0x5580049A, 0x3B970638, 0x3B6B1FBE, 0x66691FF2, -+ 0x0B6A1FD6, 0x6F05C000, 0x7797062A, 0x08691FDC, -+ 0x1D681FDA, 0x70970614, 0x4B691FDA, 0x09220002, -+ 0x7E97063D, 0x08691FDC, 0x15681FC6, 0x76970617, -+ 0x03691FC6, 0x6A220003, 0x7E97063D, 0x3A970605, -+ 0x7A8C5000, 0x31700080, 0x29204096, 0x6A504A52, -+ 0x7F502084, 0x29204096, 0x2A504A52, 0x6C503611, -+ 0x11970642, 0x6A504A52, 0x46502D07, 0x37970646, -+ 0x6C5034AD, 0x11970642, 0x2A504A52, 0x595024A5, -+ 0x37970646, 0x665029B0, 0x51970642, 0x27503144, -+ 0x1A50252F, 0x77970646, 0x4150194A, 0x11970642, -+ 0x745010C8, 0x0750318C, 0x37970646, 0x695028D1, -+ 0x91970642, 0xD2502569, 0xEC5019AD, 0xB7970646, -+ 0xDD501264, 0x91970642, 0x9F50B08C, 0xE8502D29, -+ 0xF7970646, 0xAD5019A6, 0x91970642, 0xEA504A52, -+ 0xB550166C, 0xF7970646, 0xDE502191, 0x91970642, -+ 0xF250AD0B, 0xAD502953, 0x91970642, 0xEA504A52, -+ 0xA950326B, 0xF7970646, 0xDE5011AB, 0x91970642, -+ 0x9950B585, 0xD2502533, 0xD1970642, 0xAA504A52, -+ 0xC75035A9, 0x91970642, 0xB950B54D, 0xC5502E6B, -+ 0x11970642, 0x43501E52, 0x5650166D, 0x11970642, -+ 0x7880059D, 0x2D6A1FBE, 0x00691FC0, 0x4B624014, -+ 0x4B32FFFE, 0x3A098000, 0x25614000, 0x456140A4, -+ 0x0F691FD4, 0x696A1FDC, 0x62614008, 0x25691FF4, -+ 0x62624004, 0x0F2D0001, 0x0C614010, 0x518B4000, -+ 0x046A1FF4, 0x6E2E0001, 0x6D624010, 0x25614000, -+ 0x34604008, 0x538C0400, 0x5570001C, 0x1270881D, -+ 0x5B058000, 0x0D048000, 0x118B4000, 0x73604000, -+ 0xB3681FF4, 0xE2614008, 0xDA604010, 0x938C0400, -+ 0xEA624018, 0x97020000, 0xB4218080, 0xD3800073, -+ 0xED684008, 0x99800634, 0xA5631FEC, 0xE5614000, -+ 0x83624008, 0xF5008000, 0xE9218800, 0x90970073, -+ 0xC46A1FF4, 0x9A970658, 0xAD684008, 0xFC6B1FEC, -+ 0xB26040A8, 0xFA8C5000, 0xDA700184, 0x918B4000, -+ 0x846A1FF4, 0xE9691FBC, 0xED624010, 0x856140A4, -+ 0xD18B4000, 0x94004000, 0xAA31FFFE, 0xD38C0400, -+ 0xBF424000, 0xD9800634, 0xD68C5080, 0x97BC004B, -+ 0xE9204096, 0x918B4000, 0x968C5080, 0xD7BC004B, -+ 0xE9204096, 0xAA504A52, 0x918B4000, 0xD6681FF6, -+ 0xB22DFFFF, 0xE3024000, 0xF736FFF0, 0xB0320003, -+ 0xFC30FFFE, 0xAF060000, 0x874A8000, 0xD4004000, -+ 0x9E34000F, 0xCD120000, 0xC1624090, 0x918B4000, -+ 0x8D048000, 0xFC30FFFE, 0xE6500000, 0xA6500000, -+ 0xE6500000, 0xA6500000, 0x918B4000, 0xE26A1FC6, -+ 0x246140A8, 0x646240A4, 0x718C0100, 0x1A700184, -+ 0x476A1FF2, 0x22624004, 0x046A1FF4, 0x4B624014, -+ 0x65614000, 0x22614008, 0x318C0100, 0x50694080, -+ 0x0C350001, 0x47CC066F, 0x518B4000, 0x2E2E0001, -+ 0x6D624010, 0x32218020, 0x13800073, 0x0079084F -+}; -+ -+static const uint32_t fw0_boot_img_data_buf[] = -+{ -+ 0x3F200503, 0x6E210001, 0x6A710249, 0x38200001, -+ 0x5460B41C, 0x1397008C, 0x0D210000, 0x4931FFFF, -+ 0x6D390001, 0x242CFFFF, 0x00CC0007, 0x736AB1F8, -+ 0x2361B140, 0x6F3A0000, 0x4FCC0013, 0x1F200777, -+ 0x5860B438, 0x1F60B45C, 0x14800017, 0x5D200333, -+ 0x1860B438, 0x5F60B45C, 0x7E60B43C, 0x0520FFFF, -+ 0x3660B420, 0x4D210000, 0x6F68B420, 0x0561B422, -+ 0x4934FEFE, 0x22300001, 0x3660B420, 0x4661B424, -+ 0xA361B426, 0xE761B428, 0xC261B42A, 0x8161B42C, -+ 0xE461B42E, 0xAF61B434, 0x8A61B436, 0xD397008C, -+ 0xCE21A0CA, 0xB9228000, 0xBF424000, 0xE12D0100, -+ 0xA42CFFFF, 0xE8CC002A, 0xCB710449, 0x83B80032, -+ 0xD8224000, 0x98800033, 0xAC220000, 0xC3210045, -+ 0x8661B424, 0xFA230000, 0xF663B42C, 0x9397008C, -+ 0xA9232000, 0xC662B428, 0xD863B434, 0x9269B1F8, -+ 0xCE390000, 0xABCC0040, 0x89210777, 0xF5800041, -+ 0x8B210333, 0xF38C0078, 0xD6BC0076, 0x8E61B438, -+ 0xE42CFFFF, 0x87CC0039, 0x85710649, 0xD397008C, -+ 0xEB21A0C8, 0xAC220000, 0xBF424000, 0xC92D0002, -+ 0xBF424000, 0xCC2D00FE, 0xE42CFFFF, 0x89CC004A, -+ 0xC468B1F8, 0x8D223000, 0x98380000, 0xC0CC005D, -+ 0x96711049, 0xE5B8005A, 0xEF204000, 0xBF222000, -+ 0x91230071, 0xD2800078, 0xDB200000, 0x91230071, -+ 0xD2800078, 0xB7712049, 0x82B80063, 0xF9214000, -+ 0x3A230000, 0x7F222000, 0x79800065, 0x0D210000, -+ 0x7A230000, 0x0C20B424, 0x2C500011, 0x45500001, -+ 0x6850C400, 0x05500001, 0x0161B42C, 0x5363B42E, -+ 0x0E62B434, 0x7C230333, 0x738C0078, 0x16BC0076, -+ 0x7963B438, 0x1B200000, 0x3560B140, 0x69710149, -+ 0x3C8C0000, 0x73800074, 0x7971FF49, 0x33800074, -+ 0x15320001, 0x45367FFF, 0x75C8008B, 0x322A0008, -+ 0x4DC00087, 0x26500000, 0x26500000, 0x66500000, -+ 0xA6500000, 0xE6500000, 0xE6500000, 0xA6500000, -+ 0xE6500000, 0xB5C8008B, 0x9480007B, 0xD3260008, -+ 0xE6500000, 0x932EFFFF, 0x8BCC0088, 0xD18B4000, -+ 0x8468B1F8, 0xDE34000F, 0xDBC80093, 0xA028000A, -+ 0xFAC40093, 0x8124000A, 0x918B4000, 0xF920000A, -+ 0x918B4000, 0xE0000000, 0xE0000000, 0xA0000000 -+}; -+ -+static const uint32_t fw0_master_img_data_buf[] = -+{ -+ 0x3F200503, 0x6E210001, 0x5E605FF4, 0x2D615FF6, -+ 0x5B200000, 0x3260B148, 0x0D205FE0, 0x5C215FE8, -+ 0x7D230008, 0x2F090000, 0x23C000F3, 0x78200001, -+ 0x1460B41C, 0x719700B0, 0x539700BA, 0x0E208000, -+ 0x7560B140, 0x20000000, 0x20000000, 0x60000000, -+ 0x25685FFE, 0x5269B1F8, 0x626B5FFA, 0x353C4600, -+ 0x2CCC0012, 0x793B0000, 0x48D4001D, 0x1B3700FF, -+ 0x5763B47A, 0x1D200333, 0x1860B438, 0x5F60B45C, -+ 0xBE60B43C, 0xFC230003, 0xF722B400, 0x8520FFFF, -+ 0xE9408000, 0x8D210000, 0xB0488000, 0xF1260002, -+ 0xFF418000, 0x8934FEFE, 0xA2300001, 0xD02A0002, -+ 0xA9408000, 0xFE260020, 0xC52FFFFF, 0x8CCC0023, -+ 0xDB200000, 0x9F60B406, 0xB660B416, 0xF560B426, -+ 0x9C60B436, 0xD460B446, 0xFD60B456, 0xA16B5FFC, -+ 0x80210100, 0xE2222F00, 0xF4370080, 0x9FC8003E, -+ 0xCD210000, 0x8D223000, 0x8C20B424, 0xEC500011, -+ 0x85500001, 0xE850C400, 0xC5500001, 0xAA410000, -+ 0xDF2C0002, 0xA6500000, 0x8E62B434, 0xC8205E90, -+ 0xE6220164, 0xAF970F80, 0x9269B1F8, 0xEA220333, -+ 0x9B200000, 0xF38C0078, 0xD1BC00EB, 0xAF62B438, -+ 0xD060B424, 0xB560B426, 0xB9610102, 0xC835000F, -+ 0x9C610100, 0xC568B400, 0xF969B420, 0x99605FCA, -+ 0xA9615FCE, 0xFA3400FF, 0xD6380200, 0x9A605FCC, -+ 0xF235FF00, 0xAB390002, 0x84615FD0, 0xC1970F0D, -+ 0x38200001, 0x57605EA0, 0x502001A0, 0x2B60010C, -+ 0x7A203000, 0x0E60010E, 0x38200001, 0x7260B148, -+ 0x58695EA0, 0x39228000, 0x14004000, 0x433C0001, -+ 0x26CC006F, 0x4262B140, 0x50800075, 0x14004000, -+ 0x463C0004, 0x2DCC0075, 0x2C68B140, 0x543C4000, -+ 0x3560B140, 0x4835000F, 0x4931FFFF, 0x002D0079, -+ 0x26894000, 0x528C1D78, 0x5F800098, 0x378C1D7A, -+ 0x5F800098, 0x3E8C1DF8, 0x1F800098, 0x5B8C1DFA, -+ 0x9F800098, 0xF48C1D7C, 0xDF800098, 0x918C1D7E, -+ 0xDF800098, 0x988C1DFC, 0x9F800098, 0xFD8C1DFE, -+ 0xDF800098, 0xB18C1D79, 0x9F800098, 0xD48C1D7B, -+ 0x9F800098, 0xDD8C1DF9, 0xDF800098, 0xB88C1DFB, -+ 0xDF800098, 0x978C1D7D, 0x9F800098, 0xF28C1D7F, -+ 0x9F800098, 0xFB8C1DFD, 0xDF800098, 0x9E8C1DFF, -+ 0x95B000E9, 0xC8BC0BF6, 0xFDD80CC3, 0x90A00BF7, -+ 0xEBA40C1D, 0xA5A80C38, 0x8CF80EFB, 0xD3E80CE1, -+ 0x17E00107, 0x796A5EA0, 0x7F2300A6, 0x2B360002, -+ 0x5DC800A6, 0x38AC0E86, 0x38215EA2, 0x63220014, -+ 0x44970F9D, 0x3EC80068, 0x30884000, 0x58380000, -+ 0x36C80101, 0x78215EA2, 0x63220014, 0x27800FC0, -+ 0x5B200000, 0x3360B000, 0x3460B008, 0x4F220001, -+ 0x2B2D0008, 0x6D62B010, 0x7B60B01C, 0x08228800, -+ 0x0C62B01C, 0x518B4000, 0x4468B1F8, 0x36635E96, -+ 0x5E34000F, 0x01030000, 0x012B000A, 0x45C000C1, -+ 0x3920000A, 0x41030000, 0x4D210000, 0x0931FFFF, -+ 0x6D390001, 0x242CFFFF, 0x01CC00C3, 0x6361B140, -+ 0x79228000, 0x36010000, 0x10310008, 0x4D39A0CA, -+ 0x3F424000, 0x6C220000, 0x7F424000, 0x06220020, -+ 0x7C2DFFBA, 0x3F424000, 0x2C220000, 0x582DFF7C, -+ 0x3F424000, 0x6B2D0008, 0x7F424000, 0x0F220001, -+ 0x2B2D0008, 0x7F424000, 0x6C220000, 0x0D2D000C, -+ 0x7F424000, 0x08228800, 0x3F424000, 0x43220400, -+ 0xA462B144, 0xD7020000, 0xE13A0200, 0xA462B144, -+ 0xD92C0001, 0x852FFFFF, 0x80CC00C8, 0xEF6B5E96, -+ 0xD18B4000, 0x8222008D, 0x988000FC, 0xE4220089, -+ 0x988000FC, 0xC6220083, 0xD88000FC, 0x85220085, -+ 0xD88000FC, 0xA9220005, 0x988000FC, 0xE0220087, -+ 0x988000FC, 0xCC220007, 0xD88000FC, 0xA6220011, -+ 0x988000FC, 0xC122008B, 0xD88000FC, 0xAD22000B, -+ 0xEA625FF2, 0x99635FF0, 0xB1320008, 0xC562B148, -+ 0xB3D00102, 0xD18B4000, 0xF8200001, 0xB19700B0, -+ 0xD39700BA, 0xBC8C0000, 0x95800105, 0xF9695F20, -+ 0xFE20011B, 0x8E35C000, 0x91C8010E, 0xC9685F24, -+ 0x823D4000, 0xC5CC00A1, 0xDF2300A1, 0xB96A5EA0, -+ 0xE1210080, 0xB336FFFE, 0xA0625EA0, 0xFB655F21, -+ 0x9A8000AB, 0xF9695F20, 0xC9685F24, 0x8E35C000, -+ 0x973DC000, 0xF2C8010F, 0xD18B4000, 0xA9970F20, -+ 0xFBC801BB, 0x90605F24, 0x80685FFC, 0xCD210000, -+ 0x24615F2E, 0x7F340003, 0x5F2C012D, 0x30884000, -+ 0x5B200000, 0x3160B122, 0x30800131, 0x4A6BB124, -+ 0x5C695F22, 0x1B200000, 0x3B370001, 0x4ECC0137, -+ 0x3C65B123, 0x70800131, 0x5C800124, 0x1A800127, -+ 0x7B9700FB, 0x2868B122, 0x3D69B124, 0x7734001F, -+ 0x34310001, 0x6C110000, 0x62D401B1, 0x216B5FFC, -+ 0x0E645F20, 0x4537FF00, 0x67330008, 0x180B0000, -+ 0x4EC001AE, 0x3E6A5F24, 0x3F215F26, 0x462E0040, -+ 0x29408000, 0x7930FFFB, 0x4E2C4000, 0x0F970FDD, -+ 0x7A695F26, 0x1B2C000C, 0x29350003, 0x49CC01AA, -+ 0x7F215F26, 0x1122FFFE, 0x21970FF3, 0x5F695F24, -+ 0x1C2C0004, 0x524A0000, 0x422D0042, 0x3F424000, -+ 0x6E2E0001, 0x0B420000, 0x26971027, 0x64970C53, -+ 0x2C685F26, 0x7E695F28, 0x5B60B408, 0x2861B40A, -+ 0x09685F24, 0x5221B40E, 0x7D60B40C, 0x30510000, -+ 0x52200021, 0x3A60B404, 0x10200040, 0x5360B414, -+ 0x91200164, 0xC7210152, 0xFF2300A6, 0xA9800C7A, -+ 0xEF685F20, 0xB86A5FE8, 0xBA3400FF, 0xD3605F22, -+ 0xEE2E0001, 0xA1625FE8, 0x81030000, 0xF930FFFB, -+ 0xA72C4010, 0xD24A0000, 0xDC2C0004, 0xB3490000, -+ 0xD63B0400, 0x8F2D0001, 0xBA0A4000, 0xF9C40175, -+ 0x8D210000, 0xEA410000, 0xC9685F24, 0xB563B120, -+ 0xBE2C0038, 0xE6500000, 0xE6500000, 0xA6500000, -+ 0xE6500000, 0x802CFFF6, 0x924A0000, 0xE22CFFCA, -+ 0x0A6B5F2E, 0x5B368000, 0x63CC018A, 0x393B0000, -+ 0x50C801A6, 0x392F003C, 0x1D40C000, 0x46685F30, -+ 0x50605F24, 0x158001A6, 0x32605F2E, 0x793B0000, -+ 0x26CC018F, 0x5F605F30, 0x76800191, 0x392F003C, -+ 0x5D40C000, 0x39695F20, 0x2B68B124, 0x4F220001, -+ 0x3A230000, 0x6C3500FF, 0x6C0B4000, 0x2C12C000, -+ 0x17148000, 0x4FCC019F, 0x5A9700F7, 0x11230191, -+ 0x71635F24, 0x10200040, 0x198001B4, 0x69970F20, -+ 0x9EC801B9, 0xD0605F24, 0xEF685F20, 0xBE6A5F24, -+ 0xFA3400FF, 0x9780013E, 0xBA215FDA, 0xE4970F39, -+ 0xDE2301B3, 0xB78001C0, 0xAF685F20, 0xFF9700F5, -+ 0xBA3400FF, 0xF18001AF, 0xFB9700FB, 0xB7380400, -+ 0xD460B120, 0x89685F24, 0x86970F33, 0xDB200000, -+ 0xB96A5EA0, 0xED645F21, 0xCC3A0001, 0xA0625EA0, -+ 0x988000A6, 0xD523019F, 0xDE8001BC, 0x9F23011B, -+ 0xF1635F24, 0xBC2000C0, 0xAD645F21, 0xD88000A6, -+ 0xB5695F32, 0xCE208000, 0xD4150000, 0xB7C801C5, -+ 0xD18B4000, 0xBA605F32, 0xB62001C8, 0xDA8000AB, -+ 0xCC685FD8, 0x9F215FD8, 0x98380000, 0xDAC801ED, -+ 0xA0970F5B, 0xF9605F34, 0xF6010000, 0x9F2C0034, -+ 0xE5480000, 0x9E6A5FEC, 0x81030000, 0xDE34000F, -+ 0xAE2E0001, 0xC7625FEC, 0xEC220000, 0x8A625F3A, -+ 0xBA62013E, 0xC6330004, 0xFF37000F, 0x9A2F01DD, -+ 0xD18B4000, 0xB48003B5, 0x9B80053F, 0xF08006DD, -+ 0x138006EA, 0x53800200, 0x53800200, 0x13800200, -+ 0x53800200, 0x13800200, 0x13800200, 0x53800200, -+ 0x53800200, 0x13800200, 0x13800200, 0x4B800BC6, -+ 0x13800200, 0x79605F34, 0x7A605F32, 0x188000A6, -+ 0x682200C1, 0x15800203, 0x2C2200A3, 0x55800203, -+ 0x2722008F, 0x55800203, 0x45220085, 0x15800203, -+ 0x0B2200C0, 0x55800203, 0x6A2200A0, 0x15800203, -+ 0x492200A1, 0x15800203, 0x23220081, 0x55800203, -+ 0xA0220087, 0xD5800203, 0xEC220000, 0xA3685F32, -+ 0xEF625F38, 0xB3230208, 0x8B341000, 0xE8CC02A0, -+ 0xFB97035E, 0xA0685F34, 0xB66A5F38, 0xDA230218, -+ 0xBC2C0035, 0xF3460000, 0xF6695F34, 0x9D800273, -+ 0xE860013C, 0xB5635F46, 0xBB97035E, 0xF9200215, -+ 0x9C605F36, 0xDE970393, 0xC9CC0263, 0x90970236, -+ 0x856A010C, 0xFA680110, 0xFE2A01A0, 0xB5C801C8, -+ 0xD8380000, 0x8DCC01C8, 0x94620110, 0xE7970C63, -+ 0x0D6A0110, 0x4C20B424, 0x6C500011, 0x05500001, -+ 0x6850C400, 0x05500001, 0x2D5001A0, 0x66500000, -+ 0x4E62B434, 0x0821022C, 0x172301C8, 0x6B940C7D, -+ 0x3E6B0112, 0x672201A0, 0x5C62010C, 0x1B200000, -+ 0x4D6A0110, 0x06600112, 0x23600110, 0x793B0000, -+ 0x0ACC0385, 0x588000A6, 0x79635F38, 0x201A4000, -+ 0x0262B140, 0x6F6B5EA0, 0x57020000, 0x1F3B0004, -+ 0x76635EA0, 0x0D388000, 0x3A605F32, 0x75008000, -+ 0x07300003, 0x75605F4A, 0x75008000, 0x3F30FFF8, -+ 0x4F384001, 0x36605F4C, 0x2832FFFF, 0x5D2E0D06, -+ 0x5D23024A, 0x078A4000, 0x13605F4E, 0x456A010C, -+ 0x102001A0, 0x4D210000, 0x4E0A0000, 0x26970DE4, -+ 0x6B970E02, 0x026B5F32, 0x0A685F4E, 0x7F37000F, -+ 0x343B0100, 0x576A5F34, 0x7263B144, 0x0B420000, -+ 0x1B695F46, 0x5F2C0002, 0x6A410000, 0x136A5F3A, -+ 0x5F2C0002, 0x0B420000, 0x31695F3C, 0x606B5F38, -+ 0x9F2C0002, 0xEA410000, 0xD18B4000, 0xBA20C000, -+ 0xFA605F32, 0xAE970C74, 0xA7220040, 0xCC20B424, -+ 0xEC500011, 0xA0500003, 0xA850C400, 0xC5500001, -+ 0x87500180, 0xE6500000, 0xCE62B434, 0x9E2000A6, -+ 0xC82100A6, 0xBF2300A6, 0x89800C7D, 0xD4635E9C, -+ 0xAD6B5FEE, 0xC5615E98, 0xEC2D0036, 0x91484000, -+ 0xB82F0001, 0xF4635FEE, 0xC0349FFF, 0x88404000, -+ 0xEC348000, 0xB9C80286, 0x912DFFFE, 0xE64A4000, -+ 0x2B2D0008, 0x51484000, 0x41625E9A, 0x30510000, -+ 0x58380000, 0x32C8029C, 0x10605E9E, 0x4A685E98, -+ 0x79215FDC, 0x2A970F4A, 0x21970E86, 0x49685E9E, -+ 0x0D6B5E9C, 0x58380000, 0x6BCC0290, 0x118B4000, -+ 0x586A5E9A, 0x1F215FD8, 0x1336FF00, 0x70D00297, -+ 0x2A970F4A, 0x4D6B5E9C, 0x778001C0, 0x31320008, -+ 0x3C2C0035, 0x73460000, 0x5F695E9E, 0x3D800274, -+ 0x7C9700F3, 0x3C209000, 0x3A605F32, 0x4480101D, -+ 0x8E208000, 0xFA605F32, 0xE480102C, 0xBD635F36, -+ 0xEC685F4A, 0xB9695F4C, 0x8B32FFFE, 0xCD048000, -+ 0xF0C402AB, 0x8F2D0001, 0xA0615F4C, 0xF5605F4A, -+ 0x93320002, 0xE4685F3A, 0xD88002B9, 0xBD635F36, -+ 0xD8380000, 0xBCD002B3, 0x99970354, 0xE4685F3A, -+ 0x8E390000, 0xDDC802B9, 0xE4300002, 0x88404000, -+ 0xBC30FFFE, 0xF6010000, 0xE72D01A0, 0x9F610106, -+ 0xCB32FFFE, 0x9CC80352, 0x94038000, 0xC3330001, -+ 0xAFD402C2, 0xEB2E0004, 0xD40C8000, 0xBD605F3A, -+ 0xD4038000, 0xBF37000F, 0x95C802C9, 0xF736FFF0, -+ 0xE42E0010, 0xAF6B5F40, 0xAC625F3E, 0xCD0B8000, -+ 0x94C402CE, 0xE0625F40, 0xDC6A5F42, 0x9B200000, -+ 0xE93600C0, 0xB5320006, 0x9BC802D6, 0xF12C0040, -+ 0x932EFFFF, 0xF88002D2, 0xEC600104, 0x85970CA6, -+ 0x9E2000A6, 0xE1970CAF, 0xEC970CB6, 0xA7970C63, -+ 0xE3690104, 0xB5680104, 0xAF2D0030, 0xE64A4000, -+ 0x092D0002, 0x704B4000, 0x493EFFFF, 0x0D1EC000, -+ 0x6CCC0322, 0x1A21B424, 0x18510041, 0x7160B428, -+ 0x4A2D0004, 0x30510000, 0x3851C010, 0x53510001, -+ 0x28220038, 0x4E62B434, 0x4C2102DB, 0x3F2300A6, -+ 0x6B940C7D, 0x3920003C, 0x3C60B348, 0x64970C53, -+ 0x27970C63, 0x50680106, 0x7B21B428, 0x356A5F3E, -+ 0x2A6B5FD0, 0x4251E000, 0x53510001, 0x1760B42C, -+ 0x492D0002, 0x30510000, 0x12200311, 0x5763B420, -+ 0x1060B424, 0x4E62B434, 0x6C685F4A, 0x39695F4C, -+ 0x5B60B408, 0x2861B40A, 0x226B5FCC, 0x7721B40C, -+ 0x4251E000, 0x13510001, 0x2B201061, 0x7D63B400, -+ 0x3A60B404, 0x6462B414, 0x5D200003, 0x3E605F50, -+ 0x7020031B, 0x21210325, 0x0A970C7D, 0x7F2300A6, -+ 0x0B940C7A, 0x67685F50, 0x4434FFFE, 0x3E605F50, -+ 0x18380000, 0x71C80320, 0x588000A6, 0x27685F50, -+ 0x4234FFFD, 0x3E605F50, 0x18380000, 0x65CC00A6, -+ 0xA46B5F36, 0xEE800CBD, 0xEA970C83, 0xB62301F2, -+ 0xEE800CBD, 0xBB2302DB, 0xA9800C83, 0xFD635F36, -+ 0xD8380000, 0xB3D0032B, 0x99970354, 0xE4685F3A, -+ 0x8E390000, 0xFBC80331, 0xE4300002, 0x88404000, -+ 0xFC30FFFE, 0xB6010000, 0xA72D01A0, 0xDF610106, -+ 0x8B32FFFE, 0xDCC80352, 0xEF6B5F40, 0xAC625F3E, -+ 0x8D0B8000, 0xF8C4033B, 0xE0625F40, 0x94038000, -+ 0xE6330003, 0x84D4033F, 0xAB2E0004, 0xD40C8000, -+ 0xBD605F3A, 0xE4970C53, 0xEC685F4A, 0xB9695F4C, -+ 0xDB60B408, 0xA861B40A, 0x90680106, 0xF56A5F3E, -+ 0xD221B40E, 0xB0510000, 0xBD60B40C, 0xD2200021, -+ 0xBA60B404, 0xE462B414, 0xC5685F36, 0xA6210341, -+ 0xFF2300A6, 0xA9800C7A, 0xA46B5F36, 0xF88000FB, -+ 0xB5635E90, 0xC16B5F34, 0xE00CC000, 0x844B0000, -+ 0x9F2C0002, 0xE5480000, 0xD4635F4A, 0xAC6B5E90, -+ 0xF6605F4C, 0x918B4000, 0xB96A5F40, 0xDB200000, -+ 0x17605F40, 0x6F3A0000, 0x7ECC0C95, 0x118B4000, -+ 0x4520FFFF, 0x2C2D0036, 0x264A4000, 0x772DFFFA, -+ 0x45625F42, 0x1D34003F, 0x17148000, 0x6CCC01F2, -+ 0x118B4000, 0x664A4000, 0x492D0002, 0x273607FC, -+ 0x57C801F4, 0x13320002, 0x2C088000, 0x4EC001F4, -+ 0x35008000, 0x62300001, 0x6FD40378, 0x2E2E0001, -+ 0x1F30FFFF, 0x518B4000, 0x76635E96, 0x33200102, -+ 0x7E97036D, 0x09600130, 0x06625F44, 0x73200102, -+ 0xBE97036D, 0xEF6B5E96, 0xEF600134, 0xA3625F46, -+ 0xD18B4000, 0xA469010C, 0x9768010E, 0xFD3D01A0, -+ 0xE6CC0390, 0x862E01A0, 0x9C62010C, 0xD8380000, -+ 0x90C8038F, 0xEC088000, 0xE8C001F0, 0x918B4000, -+ 0xD4620110, 0xA7630112, 0x988000A6, 0xD3680100, -+ 0xB6635E96, 0xDB6AB140, 0xEE210001, 0xBA230000, -+ 0xA1280001, 0xD80B0000, 0xCD11C000, 0x94038000, -+ 0xD7174000, 0xBEC803A1, 0xB4310001, 0xE1280001, -+ 0x3EC4039B, 0x6F6B5E96, 0x518B4000, 0x36635E96, -+ 0x6C220000, 0x05625E94, 0x0D6BB140, 0x45690100, -+ 0x78200001, 0x3602C000, 0x35160000, 0x5C6A5E94, -+ 0x02CC03AF, 0x6E2E0001, 0x45625E94, 0x1F30FFFF, -+ 0x722DFFFF, 0x01CC03A9, 0x2F6B5E96, 0x5C6A5E94, -+ 0x118B4000, 0x64625F4E, 0x512C03B8, 0x30884000, -+ 0x13800200, 0x7E8003C8, 0x5C800442, 0x3C800445, -+ 0x56800465, 0x1D800486, 0x3E8004EB, 0x7B8004EE, -+ 0x1B800509, 0x5E80050C, 0x7780052A, 0x13800200, -+ 0x53800200, 0x13800200, 0x13800200, 0x53800200, -+ 0x54230018, 0x0963013C, 0x1A970364, 0x7797037A, -+ 0x276A0130, 0x41030000, 0x4D0B8000, 0x2FC003D1, -+ 0x57020000, 0x106B013C, 0x28685F44, 0x5B695F46, -+ 0x32370020, 0x4DCC03D7, 0x6E2E0001, 0x09625F3C, -+ 0x360E0000, 0x420E4000, 0x4B32FFFE, 0x34970385, -+ 0x5797029D, 0x1B200000, 0x2A210120, 0x5F6A5F44, -+ 0x97970327, 0xDC200008, 0xCC210124, 0xBA6A5F46, -+ 0xD7970327, 0x969702A0, 0xA4685F3A, 0xE4210010, -+ 0xE4300002, 0xA7600128, 0xBA610104, 0xFB97035E, -+ 0xA6970CCB, 0xD0680130, 0xE0690134, 0x8E6A0120, -+ 0xFE6B0124, 0x9A60B010, 0xAA61B014, 0xFE680128, -+ 0x8E69012C, 0xEB2E0068, 0xC462B000, 0xBD2F0068, -+ 0xB463B004, 0xE06A0138, 0xDC2C0068, 0xB460B008, -+ 0xCA2D0068, 0x8461B00C, 0xAA62B018, 0xF168013C, -+ 0xBF2300A6, 0xCD388000, 0xFB60B01C, 0xAF940CD0, -+ 0xCA685F4E, 0x976A5F34, 0x98380000, 0xF5C8040D, -+ 0xF0884000, 0x8E208000, 0xA9408000, 0xDB200000, -+ 0xBF800419, 0xE4685F3A, 0xF069B024, 0xA02E0028, -+ 0xCE390000, 0x90D00409, 0xA4300002, 0xDC2C0068, -+ 0xAF090000, 0xEA31FFFE, 0xC768B028, 0xBF418000, -+ 0xB734001F, 0xE82E0002, 0xE9408000, 0xB5008000, -+ 0xDF2C0002, 0xA6500000, 0xA6500000, 0xC9970CD8, -+ 0x106A5F3C, 0x60685F34, 0x4B32FFFE, 0x33C80202, -+ 0x546B0104, 0x32695F3A, 0x09625F3C, 0x60625F40, -+ 0x600CC000, 0x272D01A0, 0x3A610104, 0x73490000, -+ 0x1F2C0002, 0x65480000, 0x63615F4A, 0x36605F4C, -+ 0x64970C53, 0x2C685F4A, 0x39695F4C, 0x7D60B40C, -+ 0x0E61B40E, 0x75680104, 0x4D210000, 0x2861B40A, -+ 0x1B60B408, 0x506A5F3C, 0x54200081, 0x3A60B404, -+ 0x6462B414, 0x21210430, 0x3F2300A6, 0x4B940C7A, -+ 0x11230202, 0x7880035E, 0x57230028, 0x0963013C, -+ 0x5B8003CA, 0x1A970364, 0x33200102, 0x7E97036D, -+ 0x49600130, 0x06625F44, 0x192C0001, 0x7E605F3C, -+ 0x2E32FFFC, 0x6B2E0004, 0x74970385, 0x1797029D, -+ 0x5B200000, 0x2A210120, 0x1F6A5F44, 0x57970327, -+ 0x1F6A5F44, 0x5C200008, 0x4C210124, 0x17970327, -+ 0x1F6A5F44, 0x72200010, 0x6D210128, 0x17970327, -+ 0x569702A0, 0x24685F3A, 0x23210018, 0x64300002, -+ 0x8160012C, 0xFA610104, 0xD823000A, 0x8963013C, -+ 0xD28003EB, 0x9A970364, 0xB797037A, 0xE8685F44, -+ 0xF60E0000, 0x8B32FFFE, 0xB4970385, 0xD797029D, -+ 0x9B200000, 0xEA210120, 0xDF6A5F44, 0x97970327, -+ 0xFA6A5F46, 0x9C200008, 0x8C210124, 0xD7970327, -+ 0x969702A0, 0xE4685F3A, 0xE76A0130, 0x976B0134, -+ 0xA4300002, 0xE7600128, 0xD70EC000, 0x8B32FFFE, -+ 0xC9625F3C, 0xAA208009, 0xB9970210, 0xC1970D7E, -+ 0x1F680148, 0x61970E49, 0x4D210000, 0x316A5F5C, -+ 0x72200010, 0x2F800E66, 0x03208100, 0x6860013C, -+ 0x5A970364, 0x3797037A, 0x316B0130, 0x7E695F44, -+ 0x180B0000, 0x4EC001F4, 0x4434FFFE, 0x17C801F4, -+ 0x420E4000, 0x0B32FFFE, 0x34970385, 0x5797029D, -+ 0x1B200000, 0x6A210120, 0x5F6A5F44, 0x17970327, -+ 0x3A6A5F46, 0x5C200008, 0x4C210124, 0x17970327, -+ 0x569702A0, 0x016A0134, 0x09690124, 0x532EFFFF, -+ 0x820D8000, 0xEA31FFFE, 0xE72D01A0, 0xA64A4000, -+ 0xC92D0002, 0x87494000, 0xB168013C, 0xE01A4000, -+ 0xD3C801FA, 0xB2695F3A, 0x816A0134, 0xF2310002, -+ 0xB1610128, 0xF4340100, 0xFAC804BA, 0xB16B0130, -+ 0xF5008000, 0x8D0B8000, 0xB82F0001, 0xEE2E0001, -+ 0xA2300001, 0xFBD004B7, 0xEE2E0001, 0x820D8000, -+ 0x9761012C, 0xD70EC000, 0xCB32FFFE, 0x89625F3C, -+ 0xF168013C, 0xB9970210, 0x81970D7E, 0xC669015C, -+ 0xB968014C, 0xE2350100, 0xDCC804E4, 0xA1970E49, -+ 0xD1520000, 0xAB2E0004, 0xA3690168, 0xDF680148, -+ 0xCE390000, 0x91D004CD, 0xAF090000, 0xEA31FFFE, -+ 0x918004CE, 0xD8218000, 0xC2685F52, 0x952EFFFC, -+ 0xFF418000, 0xAA381000, 0x9B605F52, 0xC797101D, -+ 0xA06A0154, 0xD068015C, 0xCD210000, 0x8B32FFFE, -+ 0xB4340100, 0xF2200010, 0xFCC804E3, 0x8F970E67, -+ 0xDF680148, 0xAF69014C, 0xB16A5F5C, 0xEF090000, -+ 0x2A31FFFE, 0x7A0A4000, 0x75200018, 0x2F800E66, -+ 0x576A5F58, 0x202E0028, 0x11520000, 0x51520000, -+ 0x51520000, 0x11520000, 0x168004C6, 0x40208200, -+ 0x2860013C, 0x59800488, 0x70200088, 0x2860013C, -+ 0x5A970364, 0x21361F00, 0x31320008, 0x79620138, -+ 0x33200102, 0x7E97036D, 0x49600130, 0x366B0138, -+ 0x06625F44, 0x793B0000, 0x506B013C, 0x29CC04FD, -+ 0x7F800500, 0x13370040, 0x02CC0500, 0x592C0001, -+ 0x3E605F3C, 0x760E0000, 0x4B32FFFE, 0x34970385, -+ 0x5B200000, 0x2A210120, 0x1F6A5F44, 0x772303E6, -+ 0x54800327, 0x17200048, 0x2860013C, 0x568004F0, -+ 0x1A970364, 0x73200102, 0x7E97036D, 0x09600130, -+ 0x46625F44, 0x0D32FFFD, 0x34970385, 0x5797029D, -+ 0x1B200000, 0x6A210120, 0x5F6A5F44, 0x17970327, -+ 0x1F6A5F44, 0x5C200008, 0x4C210124, 0x17970327, -+ 0x569702A0, 0x36200522, 0x13605F4E, 0x55230400, -+ 0x8963013C, 0xD28003EB, 0xD669B020, 0xA02E0028, -+ 0xD1520000, 0x91520000, 0x91520000, 0xFF418000, -+ 0xD1230202, 0x8A800CD8, 0x9A970364, 0xD52001FF, -+ 0xBE97036D, 0xC9600130, 0xFE605F3C, 0x97020000, -+ 0xC6625F44, 0x8B32FFFE, 0xB4970385, 0xDB200000, -+ 0xAA210120, 0xDF6A5F44, 0xD7970327, 0x9B200000, -+ 0xBD605F3A, 0xE7600128, 0xE4210010, 0xBA610104, -+ 0xCC230808, 0x8963013C, 0x928003EB, 0xC1030000, -+ 0xA637FFF8, 0xEECC0200, 0xF52C0544, 0xB0884000, -+ 0xD580054C, 0xBC800593, 0x9A800604, 0xD3800200, -+ 0xD780061D, 0xB380064E, 0x93800200, 0xD3800200, -+ 0x8320FFFC, 0xF9970365, 0xE1361F00, 0xB2C801F6, -+ 0xF1320008, 0xB9620138, 0xBF2A0011, 0xD3C401F6, -+ 0xB797037A, 0xE2300001, 0xDCD00558, 0xA82E0002, -+ 0xB2347FFF, 0xD7C801F4, 0xD7680138, 0xA3625F46, -+ 0xF6010000, 0x92290003, 0xBAC40560, 0xDD200003, -+ 0x3C2C0003, 0x63018000, 0x6A072000, 0x393B0000, -+ 0x4ECC01F8, 0x3E695F44, 0x242E0010, 0x420E4000, -+ 0x442A0800, 0x3A6A5F46, 0x17C401F8, 0x6832FFFF, -+ 0x020E4000, 0x4B32FFFE, 0x74970385, 0x1797029D, -+ 0x5B200000, 0x2A210120, 0x0A6B5F42, 0x5F6A5F44, -+ 0x03330001, 0x76D00578, 0x74230579, 0x14800327, -+ 0x319702AF, 0x4A6B5F42, 0x5C200008, 0x0C210124, -+ 0x7A6A5F46, 0x05330002, 0x36D00581, 0x51230582, -+ 0x94800327, 0xF19702AF, 0xC56B5F3A, 0xBA6A5F46, -+ 0xED210128, 0xB5635F46, 0xB2200010, 0xD7970327, -+ 0xD69702A0, 0xAC6B5F46, 0xBE680128, 0xC16A0134, -+ 0x8160012C, 0xCB32FFFE, 0xDC635F3A, 0x89625F3C, -+ 0xE920E000, 0xBE2305FD, 0xBA800210, 0xE520FFF8, -+ 0xB9970365, 0xE1361F00, 0xF2C801F6, 0xB1320008, -+ 0xB9620138, 0xFF2A0011, 0xD3C401F6, 0x92200082, -+ 0xFE97036D, 0x89600130, 0x86625F44, 0xD2200082, -+ 0x3E97036D, 0x6F600134, 0x62300001, 0x3AD005A5, -+ 0x682E0002, 0x32347FFF, 0x17C801F4, 0x57680138, -+ 0x63625F46, 0x36010000, 0x12290003, 0x5FC405AD, -+ 0x1D200003, 0x792C0006, 0x63018000, 0x2A072000, -+ 0x793B0000, 0x0ECC01F8, 0x3E695F44, 0x76680134, -+ 0x242E0010, 0x4931FFFF, 0x420E4000, 0x042A0800, -+ 0x17C401F8, 0x57020000, 0x4B32FFFE, 0x360E0000, -+ 0x420E4000, 0x082E0005, 0x0B32FFFE, 0x74970385, -+ 0x1797029D, 0x5B200000, 0x6A210120, 0x0A6B5F42, -+ 0x5F6A5F44, 0x03330001, 0x3CD005CA, 0x6832FFFF, -+ 0x7D2305CD, 0x14800327, 0x319702AF, 0x5F6A5F44, -+ 0x109702A3, 0x4A6B5F42, 0x5C200008, 0x0C210124, -+ 0x7A6A5F46, 0x05330002, 0x34D005D6, 0x6832FFFF, -+ 0x322305D9, 0x54800327, 0x719702AF, 0x3A6A5F46, -+ 0x109702A3, 0x49690124, 0x7A6A5F46, 0x2A31FFFE, -+ 0x672D01A0, 0x11484000, 0x0B32FFFE, 0x420D8000, -+ 0xB04B4000, 0xDA340001, 0xF5C801FE, 0xBB370001, -+ 0xF5C801FE, 0x816A0134, 0xB2200010, 0xCA6B5F42, -+ 0xED210128, 0xA6330003, 0xB6D005ED, 0xD12305EE, -+ 0x94800327, 0xF19702AF, 0xE4685F3A, 0x816A0134, -+ 0xD3605F4E, 0xB6200028, 0x8B21012C, 0xE832FFFF, -+ 0x97970327, 0xD69702A0, 0xCA685F4E, 0x816A0134, -+ 0xBD605F3A, 0xFC209000, 0xCD32FFFD, 0x89625F3C, -+ 0xF9970210, 0x81970D7E, 0xB968014C, 0xE1970E49, -+ 0x0D210000, 0x716A5F5C, 0x75200018, 0x2F800E66, -+ 0x5A970364, 0x3797037A, 0x096B5F44, 0x570EC000, -+ 0x4B32FFFE, 0x34970385, 0x1797029D, 0x5B200000, -+ 0x2A210120, 0x5F6A5F44, 0x57970327, 0x1C200008, -+ 0x4C210124, 0x3A6A5F46, 0x17970327, 0x569702A0, -+ 0x056B5F3A, 0x416A0134, 0x45330002, 0x2063012C, -+ 0x0B32FFFE, 0x49625F3C, 0x5B20F000, 0x3E2305FD, -+ 0x7A800210, 0x0620FFF9, 0x39970365, 0x45625F42, -+ 0x892D0002, 0xF5200018, 0xFE97036D, 0xAF600134, -+ 0xC434FFFE, 0x97C801F4, 0xA82E0002, 0xE3625F46, -+ 0xF420013C, 0xB3508000, 0x85500001, 0xF1290002, -+ 0x91484000, 0xD4038000, 0xCD32FFFD, 0x970EC000, -+ 0xFF340003, 0x90605F48, 0x8B32FFFE, 0xF4970385, -+ 0x9797029D, 0xFA6A5F46, 0xE86B5F48, 0xB5008000, -+ 0xA832FFFF, 0xFB370001, 0xDBC8063C, 0xB60E0000, -+ 0xEA210120, 0x9B200000, 0x97970327, 0xE86B5F48, -+ 0xBA6A5F46, 0xFB370001, 0xCCCC0675, 0x96230675, -+ 0xE4685F3A, 0x9701C000, 0xB12C01A0, 0xC5500001, -+ 0xCB32FFFE, 0x902A0002, 0xAF970F80, 0xC92801A0, -+ 0xBD605F3A, 0xE6894000, 0xE520FFF8, 0xB9970365, -+ 0xC5625F42, 0xB5200018, 0xBE97036D, 0xC9600130, -+ 0x86625F44, 0xF5200018, 0xFE97036D, 0xAF600134, -+ 0x8434FFFE, 0xD7C801F4, 0xE82E0002, 0xA3625F46, -+ 0xF420013C, 0x81509000, 0x85500001, 0xF1290002, -+ 0x11484000, 0x7E695F44, 0x5C340002, 0x10605F48, -+ 0x6832FFFF, 0x14038000, 0x170EC000, 0x570EC000, -+ 0x420E4000, 0x0B32FFFE, 0x34970385, 0x5797029D, -+ 0x1B200000, 0x6A210120, 0x4A6B5F42, 0x1F6A5F44, -+ 0x43330001, 0x14D00674, 0x16230675, 0x54800327, -+ 0x319702AF, 0x4A6B5F42, 0x7A6A5F46, 0x1C200008, -+ 0x05330002, 0x56D00680, 0x63018000, 0x2832FFFF, -+ 0x420E4000, 0x0C210124, 0x34230686, 0x54800327, -+ 0x8C210124, 0xF19702AF, 0xFA6A5F46, 0x909702A3, -+ 0xFA6A5F46, 0x909702A3, 0x8A6B5F42, 0xFA6A5F46, -+ 0xED210128, 0xA6330003, 0xBED006AD, 0xE86B5F48, -+ 0xB5008000, 0xE832FFFF, 0xFB370001, 0x9FC80691, -+ 0xF60E0000, 0xB2200010, 0x97970327, 0xE86B5F48, -+ 0xBA6A5F46, 0xFB370001, 0xEDCC06B6, 0xA769013C, -+ 0xA0685F34, 0xFA6A5F46, 0xD13D9000, 0x86CC06AB, -+ 0xD72C0028, 0x844B0000, 0x9F2C0002, 0xF3490000, -+ 0x1F2C0002, 0x761B4000, 0x73490000, 0x1F2C0002, -+ 0x761B4000, 0x33490000, 0x36200028, 0x761B4000, -+ 0x7EC806AB, 0x372306B6, 0x14800327, 0x772306B6, -+ 0x11800644, 0x72200010, 0x719702AF, 0x3A6A5F46, -+ 0x509702A3, 0x286B5F48, 0x3A6A5F46, 0x7B370001, -+ 0x1CC80697, 0x509702A3, 0x569702A0, 0x3E6A5F48, -+ 0x24685F3A, 0x6B360002, 0x5EC806C0, 0x3A6A5F46, -+ 0x60690134, 0x2832FFFF, 0x020E4000, 0x4B32FFFE, -+ 0x09625F3C, 0x64300002, 0x4160012C, 0x3168013C, -+ 0x79970210, 0x36695F58, 0x0A2D0032, 0x51484000, -+ 0x5C340002, 0x0CCC06D6, 0x206A0154, 0x5D20A000, -+ 0x14038000, 0x43330001, 0x4CD406D0, 0x2E2E0001, -+ 0x682E0002, 0x3E33FFFF, 0x170EC000, 0x4B32FFFE, -+ 0x28625F5C, 0x4E970D6A, 0x41970D7E, 0x3968014C, -+ 0x21970E49, 0x4D210000, 0x716A5F5C, 0x35200018, -+ 0x6F800E66, 0x01030000, 0x2637FFF8, 0x6ECC0200, -+ 0xB32C06E2, 0xF0884000, 0xF38006ED, 0x978007A7, -+ 0xE38009AE, 0xAE800A87, 0x93800200, 0xD78007A7, -+ 0xD3800200, 0xAE800A87, 0x98380000, 0xEECC0200, -+ 0x8D800BC5, 0xC320FFFC, 0xF9970365, 0x892D0002, -+ 0xF5200018, 0xBE97036D, 0x89600130, 0xEF600134, -+ 0x8434FFFE, 0xD7C801F4, 0xE82E0002, 0xB1290002, -+ 0x91484000, 0xE3625F46, 0xDA340001, 0x90605F48, -+ 0xF5008000, 0xBA30FFFD, 0xB60E0000, 0xF60E0000, -+ 0x8B32FFFE, 0xF4970385, 0xD797029D, 0x9B200000, -+ 0xEA210120, 0x8A6B5F42, 0xBA6A5F46, 0xC3330001, -+ 0xF6D0070B, 0xB723070C, 0x94800327, 0xF19702AF, -+ 0xA897097D, 0xFA6A5F46, 0xF6200028, 0x8D210000, -+ 0xD7970327, 0x969702A0, 0x8D685F46, 0xDB695F46, -+ 0xBA30FFFD, 0xF50C4000, 0xE0600120, 0xAA31FFFE, -+ 0x90610124, 0xC16A0134, 0xFC30FFFE, 0xB12C01A0, -+ 0xE832FFFF, 0x8D210000, 0x844B0000, 0xDF2C0002, -+ 0x1419C000, 0x532EFFFF, 0x61CC071E, 0x1235FFFE, -+ 0x50C801FC, 0x26970CCB, 0x20690134, 0x4E6A0120, -+ 0x7E6B0124, 0x21208400, 0x2B2E0068, 0x7D2F0068, -+ 0x0C61B010, 0x4462B000, 0x7463B004, 0x3B60B01C, -+ 0x7F2300A6, 0x2F940CD0, 0x1669B020, 0x72310002, -+ 0x14D00737, 0x49970CD8, 0x558001FC, 0x09970CD8, -+ 0x0D685F46, 0x6C220000, 0x46600124, 0x36010000, -+ 0x6A31FFFE, 0x170D0000, 0x31610128, 0x630D4000, -+ 0x170D0000, 0x5761012C, 0x49625F3C, 0x38200001, -+ 0x4D60013E, 0x3C209000, 0x39970210, 0x5D20A000, -+ 0x4E970D6A, 0x14680164, 0x286A0148, 0x58380000, -+ 0x20D00E47, 0x6F69014C, 0x630E8000, 0x17610140, -+ 0x71620148, 0x3A098000, 0x3661014C, 0x6A31FFFE, -+ 0x31610144, 0x40208200, 0x4D970D6C, 0x35680168, -+ 0x0E6A014C, 0x58380000, 0x60D00E47, 0x09690148, -+ 0x71620148, 0x3A098000, 0x17610140, 0x7A098000, -+ 0x8B32FFFE, 0xC20D8000, 0xF661014C, 0x9B20F000, -+ 0xCD970D6C, 0x9F680148, 0x8E690140, 0xEC220000, -+ 0xD0620144, 0xA060014C, 0x970D0000, 0xD7610140, -+ 0x9930FFFC, 0xC6600148, 0xED208001, 0x8D970D6C, -+ 0xE86A0148, 0xB968014C, 0xB66B0154, 0xF6620140, -+ 0xB6010000, 0xFA30FFFD, 0xE7600144, 0xA2300001, -+ 0x8E0A0000, 0xC20D8000, 0xD0610148, 0x810FC000, -+ 0xC9630150, 0xA7208010, 0x8D970D6C, 0xD4680164, -+ 0x0E690140, 0x58380000, 0x60D00E47, 0x286A0148, -+ 0x7968014C, 0x106B0150, 0x10610148, 0x76620140, -+ 0x782F0001, 0x09630150, 0x0E0A0000, 0x50620144, -+ 0x2D208001, 0x4D970D6C, 0x466A0150, 0x366B0154, -+ 0x7968014C, 0x09690148, 0x170EC000, 0x5F620150, -+ 0x096A0144, 0x57610140, 0x4E0A0000, 0x31620148, -+ 0x200F0000, 0x5D33FFFE, 0x7E635F5C, 0x3C30FFFE, -+ 0x67600144, 0x00208200, 0x0D970D6C, 0x41970D7E, -+ 0xA3690168, 0xF16A5F5C, 0xCE390000, 0xA0D00E47, -+ 0xE8970E5E, 0xB5200018, 0xAF800E66, 0xE020FFFD, -+ 0xF9970365, 0x892D0002, 0xB5200018, 0xFE97036D, -+ 0x89600130, 0xEF600134, 0xC434FFFE, 0x97C801F4, -+ 0xE82E0002, 0xB1290002, 0x91484000, 0xE3625F46, -+ 0x9C340002, 0xD0605F48, 0xF5008000, 0xA3018000, -+ 0xBC30FFFE, 0xCD32FFFD, 0xF60E0000, 0x820E4000, -+ 0xCB32FFFE, 0xB4970385, 0x9797029D, 0xE897097D, -+ 0xBA6A5F46, 0xF6200028, 0xCD210000, 0xA832FFFF, -+ 0xD7970327, 0x9B200000, 0xBA6A5F46, 0xCD210000, -+ 0xE832FFFF, 0x97970327, 0x969702A0, 0xFA6A5F46, -+ 0x92970644, 0xDB695F46, 0xCD685F46, 0xAC31FFFD, -+ 0xF6610120, 0xB4310001, 0xAF090000, 0xD0610124, -+ 0xA6970CCB, 0xE0690134, 0xCE6A0120, 0x8C61B010, -+ 0xAB2E0068, 0xC462B000, 0xC362B008, 0xB8208808, -+ 0xFB60B01C, 0xBF2300A6, 0xAF940CD0, 0xF069B024, -+ 0x0E390000, 0x62D00889, 0x49690124, 0x21208400, -+ 0x4A2D0068, 0x0361B004, 0x3B60B01C, 0x7F2300A6, -+ 0x6F940CD0, 0x1669B020, 0x32310002, 0x5AD40889, -+ 0x1B695F46, 0x4E6A0120, 0x78208808, 0x020E4000, -+ 0x57620120, 0x2B2E0068, 0x0462B000, 0x4362B008, -+ 0x3B60B01C, 0x7F2300A6, 0x6F940CD0, 0x3069B024, -+ 0x0E390000, 0x62D00889, 0x61208400, 0x3B60B01C, -+ 0x7F2300A6, 0x2F940CD0, 0x1669B020, 0x72310002, -+ 0x9AD40889, 0xC9970CD8, 0xCD685F46, 0xAF690120, -+ 0xE7600128, 0xBC30FFFE, 0x970D0000, 0xD761012C, -+ 0xDD9703A3, 0xA8615F3C, 0x9B20F000, 0xD02A0002, -+ 0xA5C4088B, 0xDF695F48, 0xCA350002, 0xBCCC088B, -+ 0xF9970210, 0x83970956, 0xA0970961, 0xE06A0154, -+ 0xB968014C, 0xF96B0140, 0xDF620150, 0x89690148, -+ 0xA7630148, 0xD80B0000, 0xC6630144, 0x9F30FFFF, -+ 0xEF090000, 0x97610140, 0xAD208001, 0xCD970D6C, -+ 0x2A970970, 0x7968014C, 0x6F6A0140, 0x09690148, -+ 0x766B0154, 0x0E0A0000, 0x1762014C, 0x5F30FFFF, -+ 0x570D0000, 0x17610140, 0x22300001, 0x570D0000, -+ 0x10610148, 0x5B200000, 0x67600144, 0x09630150, -+ 0x7C209000, 0x0E970D6A, 0x1F680148, 0x4E690140, -+ 0x0E6A014C, 0x4D084000, 0x6060014C, 0x10610148, -+ 0x36620140, 0x76010000, 0x5F30FFFF, 0x170D0000, -+ 0x7E610150, 0x3F208800, 0x0D970D6C, 0x7968014C, -+ 0x2F6A0140, 0x49690148, 0x766B0154, 0x0E0A0000, -+ 0x5762014C, 0x1F30FFFF, 0x2F090000, 0x57610140, -+ 0x7C30FFFE, 0x0E0A0000, 0x31620148, 0x49630150, -+ 0x3C209000, 0x4E970D6A, 0x7968014C, 0x09690148, -+ 0x6F6A0140, 0x06600148, 0x0D084000, 0x54038000, -+ 0x360E0000, 0x5762014C, 0x64300002, 0x200F0000, -+ 0x20630140, 0x4E208000, 0x4E970D6A, 0x1D20A000, -+ 0x4E970D6A, 0x17680154, 0x0E6A014C, 0x76010000, -+ 0xB4310001, 0xF5D40863, 0xD92C0001, 0x9F2C0002, -+ 0xE060014C, 0xB6620140, 0xB6010000, 0xDF30FFFF, -+ 0xF50C4000, 0xA7600144, 0xB6010000, 0xDF30FFFF, -+ 0x970D0000, 0xD0610148, 0xC0208200, 0x8D970D6C, -+ 0xDF680148, 0x986B014C, 0xA06A0154, 0xC1600140, -+ 0xB6010000, 0xFC30FFFE, 0xDC605F5A, 0x8E09C000, -+ 0xB1610144, 0xCB32FFFE, 0xE8625F5C, 0xA1208400, -+ 0xCD970D6C, 0x81970D7E, 0xA8970E5E, 0xC16B5F58, -+ 0x056A0160, 0x7E2F0034, 0x654BC000, 0x0B420000, -+ 0x7E370004, 0x34CC0D3E, 0x316A5F5C, 0x75200018, -+ 0x6F800E66, 0x09970CD8, 0x168001FA, 0x6860013C, -+ 0x3B97035E, 0x61230939, 0x75635F46, 0x0C200891, -+ 0x5C605F36, 0x1E970393, 0x09CC0263, 0x50970236, -+ 0x2E230897, 0x75635F46, 0x7C800213, 0x1F680148, -+ 0x0E6A014C, 0x4E690140, 0x6060014C, 0x10620144, -+ 0x760E0000, 0x1F30FFFF, 0x2F090000, 0x57610140, -+ 0xB1620148, 0xED208001, 0xCD970D6C, 0xAA970970, -+ 0xC9690148, 0xB968014C, 0xAF6A0140, 0xF66B0154, -+ 0xD7610140, 0x8E0A0000, 0x8E0A0000, 0xD762014C, -+ 0xBC30FFFE, 0xC6600148, 0xDB200000, 0xA7600144, -+ 0xC9630150, 0xBC209000, 0x8E970D6A, 0xF968014C, -+ 0x89690148, 0xEF6A0140, 0xC6600148, 0x8D084000, -+ 0xA4300002, 0xF60E0000, 0xF6620140, 0xA2300001, -+ 0xE060014C, 0xB2200010, 0x94695F52, 0xEC220000, -+ 0xB5190000, 0xCD615F52, 0xD3695F6C, 0xAF238000, -+ 0xDC635F56, 0x91484000, 0x816B5F34, 0xC92D0002, -+ 0xFF424000, 0xBA1F0000, 0xA0C80D47, 0xCB235F7A, -+ 0x9249C000, 0xFE2F0002, 0xCD1D0000, 0xBFCC08D7, -+ 0xD249C000, 0x8E390000, 0x98CC0D47, 0xF2695F56, -+ 0x8E390000, 0xFED408DA, 0xCA625F56, 0x982F0006, -+ 0xAE2E0001, 0xEA8008CC, 0xC2685F52, 0xA36B5F52, -+ 0xDE34000F, 0xBC3700F0, 0xB9CC08E2, 0xCE1C8000, -+ 0x3ACC08E4, 0x628008E6, 0x4E1C8000, 0x1FCC08E6, -+ 0x6E32FFFC, 0x018008E7, 0x0F31FFFC, 0x60198000, -+ 0x6B615F56, 0x236B5F52, 0x31310004, 0x4835000F, -+ 0x3F37000F, 0x4E1F4000, 0x6CC808FC, 0x14004000, -+ 0x63645F52, 0x2931FFF8, 0x19394001, 0x49615F6A, -+ 0x36010000, 0x51310003, 0x6C615F68, 0x1F30FFFF, -+ 0x2A2C0D06, 0x6E2308FB, 0x70884000, 0x1C605F6C, -+ 0x686A0148, 0x2F69014C, 0x18680140, 0x420D8000, -+ 0x2A31FFFE, 0x6B615F60, 0x7E6B0148, 0x0E0A0000, -+ 0x750F8000, 0x0163014C, 0x3C30FFFE, 0x58605F62, -+ 0x4B32FFFE, 0x09625F66, 0x05970C69, 0x5A200051, -+ 0x3160B444, 0x64685F56, 0x456B5F60, 0x1E34000F, -+ 0x47300003, 0x36010000, 0x2434FF00, 0x600CC000, -+ 0x1060B448, 0x6C3500FF, 0x6361B44A, 0x23685F68, -+ 0x206B5F62, 0x506A5F66, 0x76010000, 0x2434FF00, -+ 0x600CC000, 0x3660B44C, 0x2C3500FF, 0x4561B44E, -+ 0xAF62B454, 0xC8200925, 0xD321090A, 0xBF2300A6, -+ 0xEF800C80, 0xAE210001, 0xBA61015E, 0xCE208000, -+ 0xC960015C, 0x89970E08, 0xA36B5F52, 0xC5685F6C, -+ 0xBF37000F, 0xF43B0100, 0xF263B144, 0x9F21085B, -+ 0xDF2C0002, 0xAA410000, 0xA4685F56, 0xC2230D47, -+ 0x9E34000F, 0xE3645F52, 0xC7300003, 0xBA605F68, -+ 0x82800D7E, 0xC3970956, 0xE0970961, 0xB968014C, -+ 0xEF6A0140, 0x89690148, 0xB66B0154, 0xCE0A0000, -+ 0x9762014C, 0xEF6A0140, 0xC9630150, 0x97610140, -+ 0xFC30FFFE, 0x8E0A0000, 0xB1620148, 0xDB200000, -+ 0xE7600144, 0xBC209000, 0x8E970D6A, 0xCE690140, -+ 0x9F680148, 0xE86A0148, 0xD7610140, 0x8D084000, -+ 0xE060014C, 0x9F30FFFF, 0xB60E0000, 0xF1620148, -+ 0x9B200000, 0xC78008BE, 0xDF680148, 0x8E6A014C, -+ 0x8E690140, 0xE060014C, 0xD0620144, 0xAF090000, -+ 0xF60E0000, 0x97610140, 0xB1620148, 0xED208001, -+ 0x0E800D6C, 0x7968014C, 0x49690148, 0x2F6A0140, -+ 0x57610140, 0x360E0000, 0x31620148, 0x57020000, -+ 0x4B32FFFE, 0x0E0A0000, 0x17680154, 0x50620144, -+ 0x010C0000, 0x68600150, 0x40208200, 0x0E800D6C, -+ 0x6F6A0140, 0x09690148, 0x3968014C, 0x71620148, -+ 0x17610140, 0x7C30FFFE, 0x4E0A0000, 0x17680154, -+ 0x10620144, 0x410C0000, 0x68600150, 0x00208200, -+ 0x4E800D6C, 0x32635F4E, 0x0A6B5F42, 0x7A6A5F46, -+ 0x9C200008, 0xCD210000, 0xC5330002, 0xA9D0098A, -+ 0xD4038000, 0x8B32FFFE, 0xBE33FFFF, 0xD70EC000, -+ 0xC6230995, 0x94800327, 0xB19702AF, 0xFA6A5F46, -+ 0x909702A3, 0xFA6A5F46, 0xD09702A3, 0xBA6A5F46, -+ 0xD09702A3, 0xBA6A5F46, 0x909702A3, 0xFA6A5F46, -+ 0x909702A3, 0xDF695F48, 0xFA6A5F46, 0x8C350001, -+ 0xA5C809A8, 0xF6200028, 0xD9970354, 0xAC685F4A, -+ 0xF9695F4C, 0x8B32FFFE, 0x8D048000, 0xE6C409A2, -+ 0x0F2D0001, 0x60615F4C, 0x75605F4A, 0x0520FFFF, -+ 0x4D210000, 0x3A6A5F46, 0x242309A9, 0x54800327, -+ 0x52970644, 0x3A6A5F46, 0x32200010, 0x4D210000, -+ 0x2B6B5F4E, 0x54800327, 0x4320FFFC, 0x39970365, -+ 0x61361F00, 0x32C801F6, 0x31320008, 0x79620138, -+ 0x3F2A0011, 0x53C401F6, 0x7797037A, 0x316B0130, -+ 0x36010000, 0x5235FFFE, 0x57C801F4, 0x1808C000, -+ 0x56C009BE, 0x2FCC01F4, 0x096B5F44, 0x682E0002, -+ 0x23625F46, 0x7E2F0002, 0x50635F44, 0x3E33FFFF, -+ 0x4B32FFFE, 0x170EC000, 0x0B32FFFE, 0x74970385, -+ 0x57680138, 0x3E695F44, 0x01030000, 0x652B0003, -+ 0x26C409CE, 0x5D200003, 0x7C2C0003, 0x2A072000, -+ 0x793B0000, 0x0ECC01F8, 0x1B695F46, 0x642E0010, -+ 0x35034000, 0x6C31FFFD, 0x4E09C000, 0x020E4000, -+ 0x042A0800, 0x57C401F8, 0x5797029D, 0x1B200000, -+ 0x6A210120, 0x0A6B5F42, 0x3A6A5F46, 0x43330001, -+ 0xACD009E3, 0xED2309E4, 0xD4800327, 0xB19702AF, -+ 0xCC970BA4, 0xBA6A5F46, 0xB6200028, 0xCD210000, -+ 0xD7970327, 0x969702A0, 0xBE695F44, 0xCD685F46, -+ 0x8931FFFF, 0xD70D0000, 0xD0610124, 0x9F30FFFF, -+ 0xD70D0000, 0xB6610120, 0xA6970CCB, 0xE0690134, -+ 0x8E6A0120, 0xCC61B010, 0xEB2E0068, 0x8462B000, -+ 0x8362B008, 0xF8208808, 0xFB60B01C, 0xBF2300A6, -+ 0xEF940CD0, 0xB069B024, 0x8E390000, 0xC6D00A0A, -+ 0x09690124, 0x61208400, 0x4A2D0068, 0x0361B004, -+ 0x7B60B01C, 0x3F2300A6, 0x2F940CD0, 0x5669B020, -+ 0x72310002, 0x05D00A0C, 0x09970CD8, 0x558001FC, -+ 0x09970CD8, 0x4D685F46, 0x7E695F44, 0x0E6A0120, -+ 0x46600124, 0x170D0000, 0x31610128, 0x46690130, -+ 0x176B0134, 0x7C30FFFE, 0x760E0000, 0x3662012C, -+ 0x28630130, 0x79610134, 0x6C220000, 0x09625F3C, -+ 0x6920E000, 0x39970210, 0x14680164, 0x67690150, -+ 0x98380000, 0xE0D00E47, 0xF66B0154, 0x896A0144, -+ 0xF968014C, 0x98610154, 0xB82F0001, 0xC9630150, -+ 0xCE690140, 0x9762014C, 0x81600140, 0xD4004000, -+ 0x820D8000, 0xD0610148, 0xE832FFFF, 0xAC088000, -+ 0xE7600144, 0x80208200, 0x8D970D6C, 0xF5680168, -+ 0xB66B0154, 0xD8380000, 0xE0D00E47, 0x8E6A014C, -+ 0x89690148, 0xC9630150, 0xF1620148, 0xBA098000, -+ 0xD7610140, 0x820D8000, 0xA832FFFF, 0xC20D8000, -+ 0xB661014C, 0xDB20F000, 0xCD970D6C, 0x9F680148, -+ 0xEF69014C, 0xAF6A0140, 0xBA230000, 0xC6630144, -+ 0xE060014C, 0x970D0000, 0x90610148, 0xF60E0000, -+ 0xB6620140, 0xED208001, 0xCD970D6C, 0xA86A0148, -+ 0xF968014C, 0x8E690140, 0xB66B0154, 0xF6620140, -+ 0xB60E0000, 0xDF30FFFF, 0xF60E0000, 0xB1620148, -+ 0xAF090000, 0xF1610144, 0xFE33FFFF, 0x89630150, -+ 0xE7208010, 0x8D970D6C, 0x82690164, 0xF968014C, -+ 0x0E390000, 0x60D00E47, 0x4E690140, 0x286A0148, -+ 0x506B0150, 0x10610148, 0x36620140, 0x782F0001, -+ 0x49630150, 0x2F090000, 0x31610144, 0x6D208001, -+ 0x0D970D6C, 0x466A0150, 0x766B0154, 0x3968014C, -+ 0x49690148, 0x170EC000, 0x1F620150, 0x600F0000, -+ 0x1D33FFFE, 0x7E635F5C, 0x5F6B0144, 0x17610140, -+ 0x180B0000, 0x67630148, 0x7C30FFFE, 0x180B0000, -+ 0x46630144, 0x00208200, 0x0D970D6C, 0x41970D7E, -+ 0xA3690168, 0xF16A5F5C, 0xCE390000, 0xA0D00E47, -+ 0xE8970E5E, 0xB5200018, 0xAF800E66, 0xE020FFFD, -+ 0xF9970365, 0xA1361F00, 0xB2C801F6, 0xF1320008, -+ 0xB9620138, 0xFF2A0011, 0xD3C401F6, 0xB797037A, -+ 0xF16B0130, 0xB6010000, 0x9235FFFE, 0xD7C801F4, -+ 0x9808C000, 0xDBC00A97, 0xEFCC01F4, 0x896B5F44, -+ 0xA82E0002, 0xE3625F46, 0xFE2F0002, 0x90635F44, -+ 0xC100C000, 0xBE33FFFF, 0xA00F0000, 0xCB32FFFE, -+ 0x170EC000, 0x4B32FFFE, 0x74970385, 0x17680138, -+ 0x7E695F44, 0x01030000, 0x252B0003, 0x64C40AA9, -+ 0x5D200003, 0x3F2C0005, 0x2A072000, 0x793B0000, -+ 0x0ECC01F8, 0x5B695F46, 0x642E0010, 0x2A31FFFE, -+ 0x420E4000, 0x042A0800, 0x17C401F8, 0x5797029D, -+ 0x1B200000, 0x4D210000, 0x5F6A5F44, 0x17970327, -+ 0x0C970BA4, 0x7A6A5F46, 0x76200028, 0x0D210000, -+ 0x6832FFFF, 0x17970327, 0x169702A0, 0x68685F44, -+ 0x1B695F46, 0x57020000, 0x75034000, 0x1F30FFFF, -+ 0x4931FFFF, 0x140C8000, 0x06600124, 0x750C4000, -+ 0x67600128, 0x200CC000, 0x20600120, 0x66970CCB, -+ 0x20690134, 0x496A0128, 0x5F610130, 0x0C61B010, -+ 0x6B2E0068, 0x0462B000, 0x0362B008, 0x78208808, -+ 0x3B60B01C, 0x7F2300A6, 0x6F940CD0, 0x3069B024, -+ 0x0E390000, 0x73D40ADC, 0x49970CD8, 0x168001FA, -+ 0x49690124, 0x21208400, 0x0A2D0068, 0x4361B004, -+ 0xBB60B01C, 0xFF2300A6, 0xEF940CD0, 0x9669B020, -+ 0xF2310002, 0xB0D40ADA, 0x8E6A0120, 0xF8208808, -+ 0xEB2E0068, 0x8462B000, 0x8362B008, 0xFB60B01C, -+ 0xBF2300A6, 0xEF940CD0, 0xF069B024, 0x8E390000, -+ 0xC8D00ADA, 0xA1208400, 0xBB60B01C, 0xFF2300A6, -+ 0xAF940CD0, 0xD669B020, 0xF2310002, 0xB0D40ADA, -+ 0x89970CD8, 0xCD685F46, 0xEF690120, 0xA7600128, -+ 0xD70D0000, 0x9761012C, 0xAC220000, 0xC9625F3C, -+ 0x9B20F000, 0xF9970210, 0xDF680148, 0x8E6A014C, -+ 0xCE690140, 0xA060014C, 0x90620144, 0xEF090000, -+ 0xD7610140, 0xB60E0000, 0xB1620148, 0xED208001, -+ 0x8D970D6C, 0xF968014C, 0xC9690148, 0xAF6A0140, -+ 0xD7610140, 0xA3018000, 0x970D0000, 0xD0610148, -+ 0x9F30FFFF, 0xCE0A0000, 0xD7680154, 0x90620144, -+ 0x810C0000, 0xE8600150, 0xC0208200, 0x8D970D6C, -+ 0xE06A0154, 0xB968014C, 0xB96B0140, 0xDF620150, -+ 0x09690148, 0x67630148, 0x580B0000, 0x06630144, -+ 0x5F30FFFF, 0x2F090000, 0x17610140, 0x6D208001, -+ 0x4D970D6C, 0x3968014C, 0x2F6A0140, 0x49690148, -+ 0x31620148, 0x4E0A0000, 0x57680154, 0x10620144, -+ 0x57610140, 0x010C0000, 0x28600150, 0x40208200, -+ 0x0D970D6C, 0x7968014C, 0x766B0154, 0x09690148, -+ 0x2F6A0140, 0x49630150, 0x57610140, 0x36695F58, -+ 0x4E0A0000, 0x1762014C, 0x2F2D0030, 0x664A4000, -+ 0x2F2D0006, 0x47494000, 0x673607FC, 0x13320002, -+ 0x79620154, 0x14038000, 0x03330001, 0x7ED40B49, -+ 0x6E2E0001, 0x282E0002, 0x10620144, 0x6832FFFF, -+ 0x31620148, 0x40351F00, 0x50310008, 0x39610158, -+ 0x6920E000, 0x0D970D6C, 0x3E680144, 0x4E6A014C, -+ 0x0E690140, 0x506B0150, 0x760E0000, 0x1762014C, -+ 0x0100C000, 0x43330001, 0x52D40B5C, 0x192C0001, -+ 0x5F2C0002, 0x1F30FFFF, 0x170D0000, 0x57610140, -+ 0x8D210000, 0xD0610148, 0xE920E000, 0x8D970D6C, -+ 0xD06B0150, 0x97680154, 0x8E6A014C, 0xC163014C, -+ 0xE8600150, 0x8E600154, 0x81030000, 0xC3330001, -+ 0xB4D40B6E, 0xD92C0001, 0xDF2C0002, 0x90620144, -+ 0xCE0A0000, 0xB6620140, 0x9F30FFFF, 0xF60E0000, -+ 0xB1620148, 0xED208001, 0xCD970D6C, 0x89690148, -+ 0x896A0144, 0xD06B0150, 0xD7610140, 0xB1620148, -+ 0xC100C000, 0xBE33FFFF, 0x89630150, 0xCE600154, -+ 0x01030000, 0x43330001, 0x5BD40B84, 0x192C0001, -+ 0x5F2C0002, 0x27600144, 0x00208200, 0x4D970D6C, -+ 0x68690144, 0x286A0148, 0x3968014C, 0x766B0154, -+ 0x36620140, 0x49630150, 0x4E600154, 0x01030000, -+ 0x43330001, 0x12D40B93, 0x192C0001, 0x5F2C0002, -+ 0x2060014C, 0x7A0A4000, 0x71620148, 0x3C30FFFE, -+ 0x0E0A0000, 0x50620144, 0x40208200, 0x0D970D6C, -+ 0x49690148, 0x206A0154, 0x186B014C, 0x57610140, -+ 0x9F620150, 0xFE33FFFF, 0xCE09C000, 0xA3800878, -+ 0xF2635F4E, 0x8A6B5F42, 0x9C200008, 0xCD210000, -+ 0xDF6A5F44, 0x85330002, 0x86D00BB0, 0xEC6B5F46, -+ 0xA832FFFF, 0xD70EC000, 0xEF230BC0, 0x94800327, -+ 0xF19702AF, 0x9F6A5F44, 0x909702A3, 0xDF6A5F44, -+ 0xAC685F4A, 0xF9695F4C, 0xCB32FFFE, 0x8D048000, -+ 0xA5C40BBB, 0xCF2D0001, 0xE0615F4C, 0xB5605F4A, -+ 0xFA6A5F46, 0x8520FFFF, 0x8D210000, 0xF19702AF, -+ 0xBA6A5F46, 0xF2200010, 0xCD210000, 0xAB6B5F4E, -+ 0xD4800327, 0x93800200, 0x81030000, 0xC637FFFF, -+ 0xEECC0200, 0xAE2C0BCB, 0xB0884000, 0xE9800BCC, -+ 0x9A970364, 0xDF20000E, 0xFE97036D, 0xA43C000E, -+ 0xEFCC01F4, 0x952001FF, 0xBE97036D, 0xFE605F3C, -+ 0xBF340003, 0xEFCC01F4, 0xC92E000E, 0x8B32FFFE, -+ 0xB4970385, 0xD797029D, 0xE822000E, 0x9B200000, -+ 0xCD210000, 0x97970327, 0xA0685F34, 0xC92101D8, -+ 0x1F610106, 0x7D2C0008, 0x73490000, 0x1F2C0002, -+ 0x65480000, 0x23615F4A, 0x36605F4C, 0x67685F3C, -+ 0x58695F40, 0x3C30FFFE, 0x1B605F3E, 0x6F090000, -+ 0x02C40BEE, 0x57605F40, 0x502001A0, 0x2A230BF3, -+ 0x6C600104, 0x3D635F36, 0x3D8002D7, 0x72200010, -+ 0x2C600104, 0x58800420, 0x529700EB, 0x2A220003, -+ 0x2F62B438, 0x56695FCA, 0x42685EDE, 0x2C220000, -+ 0x4A61B400, 0x2862B406, 0x18380000, 0x7CC8009C, -+ 0x15340080, 0x43C80C05, 0x6F200C16, 0x27230C06, -+ 0x5A8000AB, 0x1B605EDE, 0x24685EEC, 0x5E23009C, -+ 0x6C220000, 0x0A625EEC, 0x14695EDE, 0x5B6A5EF0, -+ 0x18380000, 0x7AC800F3, 0x60198000, 0x176A5F02, -+ 0x60198000, 0x396A5EA0, 0x1CD000AB, 0x5E36FDFF, -+ 0x20625EA0, 0x5A8000AB, 0x51215EDE, 0x2F220006, -+ 0x04970F9D, 0x77215EEC, 0x70510000, 0x30510000, -+ 0x70884000, 0x2F220030, 0x2F62B438, 0x70695FCE, -+ 0xAC685EF0, 0xEC220000, 0xE061B420, 0x8262B426, -+ 0xD8380000, 0x9FC8009D, 0x95340080, 0xEDC80C2B, -+ 0xE5200C31, 0xAF230C2C, 0x9A8000AB, 0xF5605EF0, -+ 0xA8685EFE, 0xFD23009D, 0xEC220000, 0x86625EFE, -+ 0xE1800C0A, 0xBF215EF0, 0xAF220006, 0xC4970F9D, -+ 0xBB215EFE, 0xF0510000, 0xF0510000, 0xB0884000, -+ 0xAF220300, 0xEF62B438, 0xF0695FCE, 0xA0685F02, -+ 0xEC220000, 0x8161B440, 0xA362B446, 0xD8380000, -+ 0x99C8009E, 0xD5340080, 0xCEC80C46, 0xAF200C4C, -+ 0xCF230C47, 0x9A8000AB, 0xB9605F02, 0xEC685F10, -+ 0xFB23009E, 0xAC220000, 0x82625F10, 0xE1800C0A, -+ 0xB3215F02, 0xEF220006, 0xC4970F9D, 0xBF215F10, -+ 0xF0510000, 0xB0510000, 0xB0884000, 0xC2685EDE, -+ 0x91215EDE, 0xD8380000, 0xC0D00C5F, 0xA1205EEC, -+ 0xA5518000, 0xE6500000, 0xD8695EA0, 0xA6500000, -+ 0xC0390200, 0x81615EA0, 0x918B4000, 0xC100C000, -+ 0x2F220006, 0x7F2300A6, 0x67800FC0, 0x2C685EF0, -+ 0x7F215EF0, 0x18380000, 0x00D00C5F, 0x6D205EFE, -+ 0x66800C58, 0x20685F02, 0x33215F02, 0x58380000, -+ 0x00D00C5F, 0x69205F10, 0x66800C58, 0x02685EDE, -+ 0x51215EDE, 0x18380000, 0x3FD40C57, 0x588000A6, -+ 0x2C685EF0, 0x7F215EF0, 0x58380000, 0x1ED000A6, -+ 0x2D205EFE, 0x66800C58, 0x7D605EEC, 0x0E615EEE, -+ 0x518B4000, 0x31605EFE, 0x0A615F00, 0x518B4000, -+ 0xB5605F10, 0xC6615F12, 0xD18B4000, 0xAC685EF0, -+ 0xCD210000, 0x98380000, 0xA5C80C94, 0xEF61B434, -+ 0xD16A5FCE, 0xA361B426, 0x8162B420, 0xD5340080, -+ 0x85C80C93, 0xD4635E9C, 0xFF215EF0, 0xAF220006, -+ 0xC4970F9D, 0x8D6B5E9C, 0x9A8000AB, 0xE3615EF0, -+ 0x918B4000, 0xD7620116, 0xC7200C98, 0x9A8000AB, -+ 0x86970C6F, 0xCE6A0116, 0xE620B404, 0xAC500011, -+ 0xE0500003, 0xA850C400, 0x85500001, 0xC7500180, -+ 0x26500000, 0x6462B414, 0x5E2000A6, 0x082100A6, -+ 0x7F2300A6, 0x29800C7A, 0x20690102, 0x5B200000, -+ 0x45350020, 0x14C801F2, 0x18218000, 0x6F615ED4, -+ 0x3D605EDA, 0x7E605EDC, 0x518B4000, 0x36695ED4, -+ 0x58380000, 0x3AC800F3, 0x0E390000, 0x49D400EF, -+ 0x3D605EDA, 0x518B4000, 0x76695ED4, 0x18380000, -+ 0x3AC800F3, 0x4E390000, 0x49D400EF, 0x3E605EDC, -+ 0x518B4000, 0x20685ED4, 0x33215ED4, 0x58380000, -+ 0x24D400F1, 0x70510000, 0x518B4000, 0x18695ECC, -+ 0x63685ED2, 0x0E390000, 0x27D4009B, 0x58380000, -+ 0x5CC8009B, 0x3E23009B, 0x1A8000AB, 0x5D215ECC, -+ 0x25518000, 0x5B200000, 0x7A605ED2, 0x118B4000, -+ 0x58695ECC, 0x3A605ED2, 0x0E390000, 0x58695EA0, -+ 0x09D400EF, 0x49390008, 0x41615EA0, 0x118B4000, -+ 0x396A5EA0, 0x4E685ECC, 0x5D215ECC, 0x1736FFF7, -+ 0x60625EA0, 0x18380000, 0x24D400F1, 0x70510000, -+ 0x918B4000, 0xC2685F52, 0xD8218000, 0xB6144000, -+ 0xE6CC00A0, 0x8D615F52, 0xBC2300A0, 0xEC200CE9, -+ 0xDA8000AB, 0xB4200400, 0x9360B144, 0xC3210200, -+ 0x8A68B144, 0xDE34000F, 0xF5190000, 0x8561B144, -+ 0xE3645F52, 0xB6010000, 0x90310008, 0xE839A0C8, -+ 0xB04B4000, 0xE72D002C, 0xC7494000, 0x97020000, -+ 0x83330001, 0xD0377F00, 0xC963010A, 0xB0320003, -+ 0xCD625F68, 0x97020000, 0x8832FFF8, 0xF83A4001, -+ 0xA8625F6A, 0xD7020000, 0xE832FFFF, 0x9D2E0D06, -+ 0xE2230D1A, 0x878A4000, 0xAA205F7A, 0xD18B4000, -+ 0xC9205F82, 0x918B4000, 0x8E205F8A, 0xD18B4000, -+ 0xA0205F92, 0xD18B4000, 0xE7205F9A, 0x918B4000, -+ 0xE3205FA2, 0x918B4000, 0xA4205FAA, 0xD18B4000, -+ 0x8A205FB2, 0xD18B4000, 0xCD205FBA, 0x918B4000, -+ 0x82205FC2, 0xD18B4000, 0xDC605F6C, 0xB3490000, -+ 0xDF2C0002, 0x844B0000, 0x9F2C0002, 0xD24A0000, -+ 0x1F2C0002, 0x65480000, 0x6F615F58, 0x1C635F56, -+ 0x6B625F5A, 0x1F605F5C, 0x27970E26, 0x716A5F5C, -+ 0x536B010C, 0x2F3A0000, 0x0BC80D36, 0x6C213000, -+ 0x3A098000, 0x6C0B4000, 0x5861010E, 0x32C00D31, -+ 0x7ECC0E45, 0x05685F5A, 0x29230D36, 0x79635F54, -+ 0x026B5F68, 0x66800E2B, 0x6769010A, 0x056B5F56, -+ 0x10310008, 0x4AC80D67, 0x576A5F58, 0x22390080, -+ 0x4B2E0035, 0x07458000, 0x01970D7E, 0x42685F52, -+ 0x24230D43, 0x4B341000, 0x59CC102C, 0x1D2000A0, -+ 0x40645F53, 0x36695F58, 0x1E970273, 0x4169010E, -+ 0x4D223000, 0x3A0A4000, 0x2CC80D63, 0x54680108, -+ 0x32620114, 0x58380000, 0x69C80D50, 0x00970C95, -+ 0x45970C69, 0x0169010E, 0x2D20B444, 0x6C500011, -+ 0x05500001, 0x6850C400, 0x45500001, 0x3135FFFF, -+ 0x2A410000, 0x6B6A0114, 0x5F2C0002, 0x26500000, -+ 0x6F62B454, 0x0A200D61, 0x1C210D61, 0x7F2300A6, -+ 0xAF800C80, 0xFA203000, 0xCE60010E, 0x8D210000, -+ 0xDB610108, 0x8D615F52, 0x988000A6, 0xEC220000, -+ 0xDB62015E, 0x918B4000, 0xAE210001, 0xFA61015E, -+ 0x8960015C, 0xDC635F56, 0xC9970E08, 0xA36B5F52, -+ 0xC5685F6C, 0xBF37000F, 0xB43B0100, 0xF263B144, -+ 0xB2695F56, 0xDF2C0002, 0xEA410000, 0x93695F5A, -+ 0x9F2C0002, 0xEA410000, 0xD0695F5C, 0x9F2C0002, -+ 0xEA410000, 0xA5800D47, 0x82685F52, 0xFA69B140, -+ 0x3C30FFFE, 0x53D0038F, 0x79635F54, 0x24300002, -+ 0x41030000, 0x1E34000F, 0x3E3CFFFF, 0x79228000, -+ 0x4D120000, 0x181D8000, 0x2361B140, 0x796A5EA0, -+ 0x38CC0D8F, 0x7636FFFB, 0x60625EA0, 0x2A3B2000, -+ 0x63685F32, 0x3A635F52, 0x0D344000, 0x6AC80D99, -+ 0x05685F36, 0x599700AB, 0x41685F54, 0x3F2300A6, -+ 0x1A8000AB, 0x42685F52, 0x7A69B140, 0x2F238000, -+ 0x5E34000F, 0x17020000, 0x093EFFFF, 0x4E138000, -+ 0x9419C000, 0xE361B140, 0xFF30FFF8, 0x9438A084, -+ 0xCC500020, 0xBD680118, 0x97695F54, 0xC218C000, -+ 0xE4600118, 0xBA1CC000, 0xB8CC0DE3, 0xF161011E, -+ 0xA3685F68, 0xE363011C, 0xC160011A, 0x85970C69, -+ 0xF96B011A, 0xAD20B444, 0x8E500041, 0xC5500001, -+ 0x87500180, 0xE6500000, 0xF602C000, 0x9336FF00, -+ 0x8162B44C, 0xDB3700FF, 0xF263B44E, 0xBF222000, -+ 0xEF62B454, 0x9F6B011E, 0x9B200000, 0xE760011E, -+ 0xB93B0000, 0xD2CC0DC3, 0xFF2300A6, 0xAC200DC6, -+ 0xFA210DC6, 0xAF800C80, 0x9B68011C, 0xFA69B140, -+ 0xCA6A0118, 0x8D1D0000, 0xA361B140, 0xEC1E0000, -+ 0x93620118, 0xE2C80DDF, 0xDB200000, 0xAE210001, -+ 0xD4038000, 0x97174000, 0xBECC0DD6, 0xD92C0001, -+ 0x8931FFFF, 0xC0800DD0, 0xD461011C, 0x87300003, -+ 0xB5695F32, 0xC160011A, 0xDB354000, 0xAAC80DAF, -+ 0xE9200DAF, 0xA46B5F36, 0x9A8000AB, 0xE3685F32, -+ 0x13695F36, 0x4D344000, 0x5DC800A6, 0x26894000, -+ 0x6F3A0000, 0x10C8038F, 0x3D635F36, 0x4D6B5F4A, -+ 0x6C600104, 0x1F610106, 0x2C625F3E, 0x71635F48, -+ 0x27970C63, 0x75680104, 0x676A0106, 0x286B5F48, -+ 0x7160B428, 0x1E21B42A, 0x30510000, 0x4100C000, -+ 0x2434FF00, 0x541A0000, 0x6062B42C, 0x1B3700FF, -+ 0x1363B42E, 0x756A5F3E, 0x73200041, 0x1060B424, -+ 0x4E62B434, 0x32210DEC, 0x3F2300A6, 0x6B940C7D, -+ 0xA46B5F36, 0xD18B4000, 0xFD635F36, 0xBC200120, -+ 0xCD210000, 0x86220020, 0x8E6B5F4C, 0xC4800DE8, -+ 0xF9635F54, 0xA76B5F6A, 0x9D200140, 0xCD210000, -+ 0x86220020, 0xFD605F60, 0xCE615F62, 0x89625F66, -+ 0xDB635F5E, 0x85970C69, 0xA4685F60, 0xF66A5F62, -+ 0x826B5F5E, 0xD060B448, 0xFF21B44A, 0xB0510000, -+ 0x8100C000, 0xE434FF00, 0xD41A0000, 0x8162B44C, -+ 0xDB3700FF, 0xB263B44E, 0x906A5F66, 0xF3200041, -+ 0x3160B444, 0x6F62B454, 0x46200E43, 0x17210E11, -+ 0x7F2300A6, 0x2F800C80, 0x39635F54, 0x5B200000, -+ 0x4B210140, 0x2722002C, 0x276B5F6A, 0x7D605F60, -+ 0x0E615F62, 0x49625F66, 0x5B635F5E, 0x05970C69, -+ 0x546A5F5E, 0x24685F60, 0x17695F62, 0x54038000, -+ 0x0537FF00, 0x4218C000, 0x5060B448, 0x0D3600FF, -+ 0x0262B44A, 0x6061B44C, 0x5B200000, 0x1360B44E, -+ 0x506A5F66, 0x11200011, 0x3160B444, 0x6F62B454, -+ 0x10210E2F, 0x7F2300A6, 0x4D940C80, 0x206B5F54, -+ 0x518B4000, 0x25210041, 0x2F800D3A, 0x44210021, -+ 0x6F800D3A, 0x176A5F58, 0x02690164, 0x602E0028, -+ 0x0E390000, 0x4BD00E5A, 0x6F090000, 0x2A31FFFE, -+ 0x75680168, 0x3F418000, 0x3734001F, 0x682E0002, -+ 0x29408000, 0x75008000, 0x5F2C0002, 0x26500000, -+ 0x26500000, 0x518B4000, 0x4E208000, 0x29408000, -+ 0x5B200000, 0x29800E53, 0x20685F58, 0x4D210000, -+ 0x972C0028, 0xE6500000, 0xE6500000, 0xA6500000, -+ 0xEA410000, 0x918B4000, 0xAE230D3E, 0xE73607FC, -+ 0xD0C8038F, 0xB9635F54, 0x816B5F58, 0xC9625F66, -+ 0xA00CC000, 0xC44B0000, 0xDF2C0002, 0xA5480000, -+ 0xF9635F62, 0xB66B010E, 0x9B605F64, 0xF60DC000, -+ 0x9B610108, 0xE4970C53, 0xC1685F62, 0x94695F64, -+ 0xBD60B40C, 0xCE61B40E, 0xD4680108, 0x906A5F66, -+ 0xF421B40A, 0x9B60B408, 0xB0510000, 0xD4200081, -+ 0x3A60B404, 0x6462B414, 0x41685F54, 0x10210E75, -+ 0x7F2300A6, 0x29800C7A, 0x36695F6E, 0x4E208000, -+ 0x54150000, 0x25C80E8B, 0x118B4000, 0x796A5EA0, -+ 0x39605F6E, 0x6D200E91, 0x7536FFFD, 0x20625EA0, -+ 0x5A8000AB, 0x2A685FDC, 0x36695F6E, 0x58380000, -+ 0x0AC80EF4, 0x54605F70, 0x712C0040, 0x33490000, -+ 0x17655F6E, 0x5C65B112, 0x6F31FFFB, 0x312D4010, -+ 0x664A4000, 0x2F6BB110, 0x092D0002, 0x6F0AC000, -+ 0x9BC00EE8, 0xF04B4000, 0xD62DFFF6, 0xB93B0000, -+ 0xF7D40EAD, 0x8D685F70, 0xA02D0012, 0xE64A4000, -+ 0xD42C0042, 0x844B0000, 0xB82DFFEE, 0xEF1F8000, -+ 0x9FCC0EEA, 0xD4004000, 0xFB215F72, 0x8F970FDD, -+ 0xFE695F72, 0xB92C0006, 0xA9350003, 0xDACC0EEF, -+ 0xBB215F72, 0xF422FFFC, 0xE1970FF3, 0x8D685F70, -+ 0xB9215FDC, 0xE0970F5B, 0xE6971027, 0xA4970C53, -+ 0xEC6B5F70, 0xA8685F72, 0xBD695F74, 0xD522B40A, -+ 0xBA63B408, 0xD1520000, 0xFD60B40C, 0x8E61B40E, -+ 0xD4200081, 0xBA60B404, 0x90200040, 0xD360B414, -+ 0xD0210EBA, 0xBF2300A6, 0x8B940C7A, 0xE0685F6E, -+ 0xBC695FEA, 0xFA3400FF, 0xF930FFFB, 0x852C401A, -+ 0xC44B0000, 0x8F2D0001, 0xB82F0001, 0xDD430000, -+ 0x802CFFF6, 0xD24A0000, 0xF92C0006, 0x844B0000, -+ 0xA5615FEA, 0xF82F0001, 0xEF0AC000, 0xA5C40EDD, -+ 0xFA230000, 0x9D430000, 0x976A5F6E, 0xCD685F70, -+ 0x0D3600FF, 0x5D3A1000, 0x4A62B130, 0x06970F33, -+ 0x4E208000, 0x39605F6E, 0x0C230E91, 0x7C800115, -+ 0x66210088, 0x34655F6F, 0x0D685F70, 0x76695F6E, -+ 0x3E2C0038, 0x65480000, 0x4E800E93, 0x3F9700F5, -+ 0x4D685F70, 0x39215FDC, 0x21230EE3, 0x63800F5B, -+ 0x396A5EA0, 0x5E350800, 0x6F615F6E, 0x1DC800A6, -+ 0x0A3A0002, 0x60625EA0, 0x588000A6, 0x2B68B148, -+ 0x62300001, 0x20D00F04, 0x21300007, 0x62D00F09, -+ 0x06300008, 0x7E3CFFFF, 0x4A64B148, 0x3F80009F, -+ 0x7A230000, 0x1363B148, 0x3C635FF2, 0x59635FF0, -+ 0x6D800EFE, 0x07710048, 0x29710149, 0x5471804B, -+ 0x01800F0B, 0x40685FFC, 0x736AB1F8, 0x2434FF00, -+ 0x46300008, 0x192C0001, 0x21361F00, 0x71320008, -+ 0x0E0A0000, 0x41C000F9, 0x7F225E90, 0x3930FFFB, -+ 0x0E2C4000, 0x4E0A0000, 0x63C000F3, 0x37605FD2, -+ 0x43625FD4, 0x122A000F, 0x0EC000ED, 0x518B4000, -+ 0x88685FD6, 0xFB695FD4, 0xD8380000, 0x8FC80F27, -+ 0xF3490000, 0x87615FD6, 0x918B4000, 0xF9290044, -+ 0xD1C00F2F, 0xAE685FD2, 0xA2615FD4, 0xF6010000, -+ 0x812D0044, 0xE1615FD2, 0xD18B4000, 0x9B1C0000, -+ 0xF7605FD2, 0xB4605FD4, 0x918B4000, 0xDE695FD6, -+ 0x98380000, 0xFAC800F3, 0xEA410000, 0x91605FD6, -+ 0x918B4000, 0xCE390000, 0xD7C800ED, 0xA64A4000, -+ 0xD8380000, 0xBAC800F3, 0x88404000, 0xEF3A0000, -+ 0xAEC80F47, 0xDB2C003A, 0xCB420000, 0x892E0038, -+ 0xC32CFFC6, 0xA9408000, 0x918B4000, 0xD12DFFFE, -+ 0xC8404000, 0x918B4000, 0x8E390000, 0xD7C800ED, -+ 0xA64A4000, 0xD8380000, 0xFAC800F3, 0x88404000, -+ 0xEF3A0000, 0xA0C80F58, 0xBE2C0038, 0xCB420000, -+ 0xAC2E003A, 0xC72CFFC8, 0xE9408000, 0x918B4000, -+ 0x892D0002, 0xC8404000, 0xD18B4000, 0x8E390000, -+ 0xD7C800ED, 0x98380000, 0xBAC800F3, 0xF6635E96, -+ 0x1B2C003A, 0x444B0000, 0x472CFFFE, 0x124A0000, -+ 0x793B0000, 0x20C80F6E, 0x2F3A0000, 0x4CC80F7B, -+ 0x5F2F0038, 0x2A42C000, 0x2C2E003A, 0x662FFFC8, -+ 0x08438000, 0x4B800F76, 0x7F424000, 0x2F3A0000, -+ 0x6BC80F74, 0x2C2E003A, 0x08438000, 0x4B800F76, -+ 0x092D0002, 0x7F424000, 0x66500000, 0x26500000, -+ 0x2F6B5E96, 0x662CFFC4, 0x518B4000, 0x092D0002, -+ 0x7F424000, 0x1F2F0038, 0x2A42C000, 0x4B800F76, -+ 0x95320001, 0xC5367FFF, 0xC6C80F93, 0xB22A0008, -+ 0xD7C00F8F, 0xA6500000, 0xA6500000, 0xE6500000, -+ 0xE6500000, 0xA6500000, 0xA6500000, 0xE6500000, -+ 0xA6500000, 0xC6C80F93, 0xEA800F83, 0x93260008, -+ 0xE6500000, 0x932EFFFF, 0xB8CC0F90, 0xD18B4000, -+ 0x93635E94, 0xC4970F9D, 0xCA6B5E94, 0x9A8000AB, -+ 0x93635E94, 0xC4970F9D, 0xC1030000, 0xAB685E94, -+ 0xDA8000AB, 0x91484000, 0xA7615E92, 0xD4605E90, -+ 0x06300008, 0x55D40FBE, 0x76635E96, 0x1634007F, -+ 0x5F30FFFF, 0x092D0002, 0x170D0000, 0x704B4000, -+ 0x62300001, 0x192C0001, 0x1B695E90, 0x6C1E0000, -+ 0x3FCC0FAE, 0x5B200000, 0x63024000, 0x1B368000, -+ 0x4035007F, 0x0D1D0000, 0x3E695E92, 0x4BC80FBC, -+ 0x31320008, 0x541A0000, 0x4F2D0001, 0x07464000, -+ 0x0100C000, 0x6F6B5E96, 0x58380000, 0x118B4000, -+ 0x7F424000, 0x28800FB8, 0x1B1C0000, 0x518B4000, -+ 0x14605E90, 0x51484000, 0x45625E94, 0x06300008, -+ 0x71D40FDB, 0x17020000, 0x06300008, 0x5634007F, -+ 0x6136007F, 0x2C1E0000, 0x17C800ED, 0x5F30FFFF, -+ 0x3A6A5E90, 0x67615E92, 0x492D0002, 0x170D0000, -+ 0x7F424000, 0x1C6A5E94, 0x3E695E92, 0x62300001, -+ 0x192C0001, 0x6C1E0000, 0x74CC0FD8, 0x1B200000, -+ 0x34380080, 0x70444000, 0x518B4000, 0x1B200000, -+ 0x46800FCC, 0x36635E96, 0x044B0000, 0x5F2C0002, -+ 0xA9434000, 0xD24A0000, 0xC92D0002, 0xBF424000, -+ 0xD71B8000, 0x9F2C0002, 0x924A0000, 0xC92D0002, -+ 0xFF424000, 0x971B8000, 0x9F2C0002, 0xD24A0000, -+ 0x892D0002, 0xFF424000, 0xF51AC000, 0xAF6B5E96, -+ 0xDF2C0002, 0x892D0002, 0x918B4000, 0xD4605E90, -+ 0xA7615E92, 0xF6635E96, 0xF3490000, 0x940C8000, -+ 0xA5480000, 0xCE390000, 0xE1C8101A, 0xA1340FFC, -+ 0xCFC81002, 0xAA280041, 0x96C01002, 0xCB240041, -+ 0xAA072000, 0xCF801007, 0xCC31FFFA, 0xA3024000, -+ 0xF436FFC0, 0xB5034000, 0xBC37003F, 0xFE695E92, -+ 0xD1484000, 0x8D048000, 0x88404000, 0xC92D0002, -+ 0x91484000, 0xD604C400, 0xC8404000, 0x80C4101A, -+ 0xC92D0002, 0x91484000, 0xAC220000, 0xE2048400, -+ 0x88404000, 0xC0C4101A, 0xC92D0002, 0x91484000, -+ 0xA2048400, 0xC8404000, 0xEF6B5E96, 0x8D685E90, -+ 0xD18B4000, 0x8A685F14, 0x99215F14, 0xD8380000, -+ 0x05D01023, 0x65518000, 0x518B4000, 0x0100C000, -+ 0x49220002, 0x3F2300A6, 0x27800FC0, 0x4A685F14, -+ 0x5D215F1A, 0x18380000, 0x05D01023, 0x518B4000, -+ 0x0A685F14, 0x59215F14, 0x58380000, 0x24D400F1, -+ 0x55340080, 0x0FC81034, 0x09220002, 0x42800F98, -+ 0x30510000, 0x4E685F1A, 0x54635E9C, 0x18380000, -+ 0x33CC103A, 0x518B4000, 0x5D215F1A, 0x09220002, -+ 0x60970F94, 0x0D6B5E9C, 0x29801035, 0x60000000, -+ 0x20000000 -+}; -+ -+// Align to PKA_BUFFER_RAM_SIZE. This is greater than the actual buffer -+// length so that the image is zero padded. -+static const uint32_t fw1_farm_img_data_buf[2048] = -+{ -+ 0x267001C9, 0x132040FA, 0x26502421, 0x032040D0, -+ 0x295046C7, 0x0D500000, 0x258C0200, 0x0F70AAC9, -+ 0x3B7000C8, 0x2D70001D, 0x2670001F, 0x296A4010, -+ 0x086B4014, 0x39621FF8, 0x16631FF4, 0x15684000, -+ 0x34694004, 0x1E601FF6, 0x3F611FF2, 0x346A4008, -+ 0x156B400C, 0x32621FFA, 0x1B631FF0, 0x219700BB, -+ 0x1E684034, 0x2170001E, 0x3A34003F, 0x281A0000, -+ 0x3F621FFE, 0x0628000B, 0x20C4004A, 0x1124002C, -+ 0x21884000, 0x2980004A, 0x30800033, 0x22800048, -+ 0x3480003E, 0x2980004A, 0x2C800040, 0x2C80002C, -+ 0x3980003A, 0x27800042, 0x21800044, 0x2A800046, -+ 0x276A4018, 0x34621FFC, 0x339701D9, 0x09300002, -+ 0x39D00063, 0x3930FFFE, 0x36800059, 0x276A4018, -+ 0x34621FFC, 0x2A97025F, 0x09300002, 0x39D00063, -+ 0x3930FFFE, 0x34800064, 0x2E970327, 0x268C0400, -+ 0x16614018, 0x36800059, 0x2F970733, 0x36800059, -+ 0x2A9706EF, 0x36800059, 0x29970735, 0x36800059, -+ 0x319706F1, 0x36800059, 0x3D970422, 0x36800059, -+ 0x27970767, 0x36800059, 0x3B7000C8, 0x24200021, -+ 0x358C5000, 0x26800073, 0x2B707FC8, 0x08702084, -+ 0x2D70001D, 0x36200000, 0x2D010000, 0x1E220001, -+ 0x2F970085, 0x01684084, 0x26340020, 0x0ECC0055, -+ 0x3920000F, 0x238C0100, 0x09300002, 0x39D00063, -+ 0x1B601FFC, 0x2A681FF0, 0x246A4014, 0x2D010000, -+ 0x2460400C, 0x2F970085, 0x29681FFC, 0x3930FFFE, -+ 0x036A1FF6, 0x276B1FF8, 0x08624000, 0x37634010, -+ 0x0D6A1FFE, 0x3F9700C3, 0x0E6A1FF2, 0x246B1FF4, -+ 0x05624004, 0x3A634014, 0x006A1FFA, 0x35230000, -+ 0x06624008, 0x358C5000, 0x3463401C, 0x106440C9, -+ 0x3C800006, 0x376B1FE4, 0x228B4000, 0x3C6B1FE6, -+ 0x228B4000, 0x3F8C0480, 0x24BC004E, 0x1B61401C, -+ 0x228B4000, 0x2D010000, 0x3930FFFE, 0x0D500000, -+ 0x0D500000, 0x0D500000, 0x0D500000, 0x09300002, -+ 0x202A0002, 0x0B614000, 0x1B624010, 0x29604008, -+ 0x1D218808, 0x23800079, 0x0B631FEC, 0x166B4000, -+ 0x086A1FF4, 0x27604000, 0x06614004, 0x2A634008, -+ 0x1B624010, 0x16624014, 0x37218001, 0x25970079, -+ 0x35068000, 0x186B4008, 0x0D691FF2, 0x24634000, -+ 0x06614004, 0x29604008, 0x1B624010, 0x2A320001, -+ 0x262EFFFF, 0x36058000, 0x1531FFFE, 0x214B4000, -+ 0x20250002, 0x0E494000, 0x2819C000, 0x07CC00A5, -+ 0x16624014, 0x2C218200, 0x25970079, 0x396B1FEC, -+ 0x228B4000, 0x37694008, 0x268C0400, 0x0D684024, -+ 0x04140000, 0x18D400B0, 0x36200000, 0x228B4000, -+ 0x00240001, 0x1A084000, 0x228B4000, 0x13684030, -+ 0x37380001, 0x21604030, 0x228B4000, 0x13684030, -+ 0x0834FFFE, 0x21604030, 0x228B4000, 0x386A40C4, -+ 0x3F694030, 0x1B360001, 0x1732FFF9, 0x18350001, -+ 0x1831FFFA, 0x011A4000, 0x228B4000, 0x07018000, -+ 0x28310006, 0x18350001, 0x0D614030, 0x2C320007, -+ 0x1B360001, 0x0A6240C4, 0x228B4000, 0x29604008, -+ 0x06614004, 0x16624014, 0x37218001, 0x268C0400, -+ 0x1B61401C, 0x2A694010, 0x27604000, 0x36064000, -+ 0x1B624010, 0x228B4000, 0x29604008, 0x06614004, -+ 0x16624014, 0x2D218018, 0x268C0400, 0x1B61401C, -+ 0x296A4010, 0x27604000, 0x2F260001, 0x1B624010, -+ 0x228B4000, 0x29604008, 0x06614004, 0x16624014, -+ 0x2C218200, 0x268C0400, 0x1B61401C, 0x246A4014, -+ 0x27604000, 0x1B624010, 0x228B4000, 0x1C2100FF, -+ 0x288000EE, 0x1A210000, 0x05631FE4, 0x24611FEC, -+ 0x21681FF2, 0x2B6040A0, 0x0B691FF4, 0x27604000, -+ 0x29604008, 0x18614010, 0x268C0400, 0x0970081C, -+ 0x2470881D, 0x01F000F9, 0x3930FFFE, 0x27490000, -+ 0x29310001, 0x3A200003, 0x1DD40075, 0x1231FFFF, -+ 0x286540B4, 0x216B1FFE, 0x036A1FF6, 0x3D33FFFF, -+ 0x3FD00110, 0x276B1FF8, 0x08624000, 0x06624008, -+ 0x37634010, 0x3F8C0480, 0x24BC004E, 0x3C70011F, -+ 0x0970081C, 0x2470881D, 0x13F0010E, 0x38800112, -+ 0x3F8C0480, 0x24BC004E, 0x196840A0, 0x21694024, -+ 0x1F090000, 0x30C801D6, 0x07024000, 0x1D2E0001, -+ 0x16624014, 0x1F31FFFB, 0x0E684028, 0x2670001F, -+ 0x2F34001F, 0x2E184000, 0x322C0001, 0x2E020000, -+ 0x09240008, 0x1334FFE0, 0x08300005, 0x0B691FF4, -+ 0x206040A2, 0x2D6040A6, 0x322C0001, 0x1F090000, -+ 0x25C40135, 0x356940A0, 0x1C050000, 0x252DFFFF, -+ 0x1531FFFE, 0x21510000, 0x21510000, 0x03691FFA, -+ 0x1C050000, 0x252DFFFF, 0x1531FFFE, 0x21510000, -+ 0x21510000, 0x322C0001, 0x16691FEC, 0x0834FFFE, -+ 0x2B3D00FF, 0x19CC013D, 0x27681FF4, 0x0B240003, -+ 0x0834FFFE, 0x08601FEC, 0x2B26000C, 0x21621FEA, -+ 0x2226005F, 0x35200060, 0x35230000, 0x160B2000, -+ 0x252DFFFF, 0x026140AA, 0x1E2D0001, 0x15072000, -+ 0x3F6B1FEA, 0x28004000, 0x3530FFFD, 0x1F0AC000, -+ 0x35230000, 0x0D631FEA, 0x160B2000, 0x3520000C, -+ 0x35230000, 0x29290007, 0x26C40155, 0x2A250007, -+ 0x23800156, 0x1B210007, 0x1A084000, 0x2D1B4000, -+ 0x33634088, 0x306940AA, 0x3530FFFD, 0x1E2D0001, -+ 0x15072000, 0x252A0008, 0x2A621FE8, 0x2B008000, -+ 0x1D2E0001, 0x1334FFE0, 0x08300005, 0x322C0001, -+ 0x296B1FF0, 0x16691FEC, 0x03601FEE, 0x1A074000, -+ 0x24634000, 0x3A33FFFE, 0x0E530000, 0x0E530000, -+ 0x0E530000, 0x0E530000, 0x0A330002, 0x2A634008, -+ 0x33070000, 0x0B2B0003, 0x09280004, 0x02C0018C, -+ 0x322C0001, 0x34604010, 0x3F8C0480, 0x24BC004E, -+ 0x3C70011F, 0x2A70001C, 0x2470881D, 0x09F0017B, -+ 0x0E691FFE, 0x0D684024, 0x1231FFFF, 0x37D0018B, -+ 0x00691FF6, 0x04140000, 0x3CD001D3, 0x1A084000, -+ 0x22694028, 0x0335001F, 0x3330FFFB, 0x2E184000, -+ 0x36C801D0, 0x322C0001, 0x00601FE2, 0x2670001F, -+ 0x2B008000, 0x3D3CFFFF, 0x30218000, 0x19110000, -+ 0x3A33FFFE, 0x20340010, 0x21C80197, 0x1641C000, -+ 0x0F270002, 0x0E530000, 0x23800199, 0x0E530000, -+ 0x1641C000, 0x31681FEE, 0x356940A0, 0x34604010, -+ 0x166B4000, 0x3304C000, 0x322C0001, 0x0834FFFE, -+ 0x06614004, 0x29604008, 0x0568401C, 0x3F8C0480, -+ 0x24BC004E, 0x3C70011F, 0x2A70001C, 0x1B70821D, -+ 0x19F001A8, 0x3D340008, 0x30C801BA, 0x0E691FFE, -+ 0x0D684024, 0x1231FFFF, 0x36D001BA, 0x00691FF6, -+ 0x04140000, 0x3CD001D3, 0x1A084000, 0x22694028, -+ 0x3330FFFB, 0x0335001F, 0x2E184000, 0x36C801D0, -+ 0x322C0001, 0x00601FE2, 0x2670001F, 0x1B691FE8, -+ 0x3E20000E, 0x29310001, 0x1231FFFF, 0x28D001C2, -+ 0x092CFFFF, 0x378001BE, 0x39694000, 0x0C2207FA, -+ 0x186B4008, 0x096140A8, 0x256340A4, 0x076240AC, -+ 0x236040AE, 0x2E7000B2, 0x3F8C0480, 0x24BC004E, -+ 0x31700484, 0x24E001CD, 0x31200001, 0x20800075, -+ 0x3F200009, 0x2670001F, 0x20800075, 0x3C200005, -+ 0x2670001F, 0x20800075, 0x37200007, 0x2670001F, -+ 0x20800075, 0x08631FE0, 0x35230000, 0x25671FFF, -+ 0x227001C4, 0x229700ED, 0x063C0001, 0x3BC801E2, -+ 0x063C0001, 0x3180022B, 0x2F681FFA, 0x266040A4, -+ 0x3A8C0180, 0x24BC004E, 0x34700184, 0x34E001E7, -+ 0x3B6940A8, 0x126840A2, 0x0B614000, 0x322C0001, -+ 0x296B1FF0, 0x34604010, 0x2A634008, 0x3A8C0180, -+ 0x24BC004E, 0x2A70001C, 0x2470881D, 0x05691FFC, -+ 0x2D3D0000, 0x3DC8022D, 0x252DFFFF, 0x28C8020D, -+ 0x28004000, 0x0034FFF0, 0x3420000B, 0x0ACC022B, -+ 0x156A1FEC, 0x0200C000, 0x1A048000, 0x266340A8, -+ 0x256340A4, 0x3F8C0480, 0x24BC004E, 0x34700184, -+ 0x24E00204, 0x256040A8, 0x1A048000, 0x3A8C0180, -+ 0x24BC004E, 0x32700284, 0x2CE0020A, 0x252DFFFF, -+ 0x17CC0205, 0x2A681FF0, 0x16691FEC, 0x1C050000, -+ 0x036A1FF6, 0x316B1FE2, 0x256040A8, 0x0A6140A4, -+ 0x076240AC, 0x29681FFC, 0x0C2B0002, 0x092CFFFF, -+ 0x206340AE, 0x336040B2, 0x2C8C5080, 0x24BC004E, -+ 0x31700484, 0x3EE0021D, 0x06691FF0, 0x3D201FE8, -+ 0x096140A8, 0x0A500001, 0x09300002, 0x266040A4, -+ 0x36200000, 0x2D6040A6, 0x3A8C0180, 0x24BC004E, -+ 0x34700184, 0x35E00229, 0x31200001, 0x3A6B1FE0, -+ 0x228B4000, 0x06691FF0, 0x156A1FEC, 0x28004000, -+ 0x1A048000, 0x03601FEE, 0x268C0400, 0x2F970085, -+ 0x2D010000, 0x268C0400, 0x2C970259, 0x1E691FE2, -+ 0x252DFFFF, 0x37C8021E, 0x2C611FE2, 0x3297024D, -+ 0x1B360001, 0x0DCC0246, 0x28200078, 0x31681FEE, -+ 0x06691FF0, 0x2C970259, 0x2A681FF0, 0x2E230237, -+ 0x2D010000, 0x2A800259, 0x2A681FF0, 0x1D691FEE, -+ 0x2C970259, 0x31681FEE, 0x2E230237, 0x2D010000, -+ 0x2A800259, 0x2C681FF6, 0x252DFFFF, 0x07024000, -+ 0x2F36FFF0, 0x21320003, 0x3930FFFE, 0x1F060000, -+ 0x0E4A8000, 0x28004000, 0x3C34000F, 0x1A120000, -+ 0x228B4000, 0x0A6140A4, 0x256040A8, 0x3A8C0180, -+ 0x24BC004E, 0x34700184, 0x228B4000, 0x0E631FE6, -+ 0x2B9702A1, 0x239702AF, 0x39681FD6, 0x0E6A1FF2, -+ 0x00691FF6, 0x276B1FF8, 0x1F060000, 0x03270001, -+ 0x0B37FFFE, 0x1F05C000, 0x296B1FF0, 0x32611FF6, -+ 0x3304C000, 0x3C621FF2, 0x1D601FFA, 0x18601FF0, -+ 0x268C0400, 0x339701D9, 0x02030000, 0x053F0001, -+ 0x1FCC029E, 0x238C0100, 0x166A1FD6, 0x06691FF0, -+ 0x28004000, 0x35098000, 0x1A048000, 0x2F970085, -+ 0x2D010000, 0x15684000, 0x35098000, 0x35068000, -+ 0x2F970085, 0x276B1FF8, 0x00691FF6, 0x03270001, -+ 0x0B37FFFE, 0x1C09C000, 0x3A6B1FD6, 0x0E6A1FF2, -+ 0x32611FF6, 0x1F0AC000, 0x3C621FF2, 0x268C0400, -+ 0x339701D9, 0x326B1FD8, 0x166A1FD6, 0x06691FF0, -+ 0x1E631FFA, 0x35098000, 0x34611FF0, 0x02030000, -+ 0x053F0001, 0x1FCC029E, 0x238C0100, 0x1A210000, -+ 0x3C9702E6, 0x22970312, 0x2A681FF0, 0x2460400C, -+ 0x268C0400, 0x31200001, 0x2B800077, 0x37200007, -+ 0x2480029E, 0x0B631FEC, 0x0D691FF2, 0x006A1FFA, -+ 0x06614004, 0x0B691FF4, 0x2C621FD8, 0x15614014, -+ 0x2D3D0000, 0x29C8029F, 0x28004000, 0x0C240002, -+ 0x0834FFFE, 0x0B601FD6, 0x228B4000, 0x0B631FEC, -+ 0x39681FD6, 0x0D691FF2, 0x086A1FF4, 0x28004000, -+ 0x2F970085, 0x399700A9, 0x0F280002, 0x1BC0029F, -+ 0x0C240002, 0x39604014, 0x2F9700B3, 0x0B691FF4, -+ 0x39681FD6, 0x35054000, 0x056A1FF0, 0x18614010, -+ 0x08624000, 0x1F060000, 0x1F060000, 0x23260002, -+ 0x06624008, 0x0B62400C, 0x2C218200, 0x25970079, -+ 0x226B1FF2, 0x086A1FF4, 0x3304C000, 0x2D010000, -+ 0x2F970085, 0x399700A9, 0x0F280002, 0x1BC0029F, -+ 0x0C240002, 0x39604014, 0x35068000, 0x1B624010, -+ 0x39681FD6, 0x396A400C, 0x186B4008, 0x1F060000, -+ 0x2A681FF0, 0x29634004, 0x06624008, 0x27604000, -+ 0x2C218200, 0x25970079, 0x166A1FD6, 0x3A69400C, -+ 0x2A681FF0, 0x35068000, 0x2F970085, 0x229700B7, -+ 0x396B1FEC, 0x228B4000, 0x0B631FEC, 0x2A681FF0, -+ 0x1A048000, 0x2460400C, 0x1A048000, 0x0C240002, -+ 0x19044000, 0x086A1FF4, 0x0D691FF2, 0x3930FFFE, -+ 0x0D500000, 0x0D500000, 0x09300002, 0x2F970085, -+ 0x399700A9, 0x39604014, 0x1B684008, 0x156B400C, -+ 0x2F260001, 0x06691FF0, 0x03280001, 0x1B624010, -+ 0x29604008, 0x06614004, 0x24634000, 0x2C2A0001, -+ 0x36058000, 0x1531FFFE, 0x21510000, 0x21510000, -+ 0x19078000, 0x3A33FFFE, 0x0E530000, 0x0E530000, -+ 0x3B218002, 0x25970079, 0x23260002, 0x1B624010, -+ 0x246A4014, 0x03691FFA, 0x1B684008, 0x319700CB, -+ 0x396B1FEC, 0x228B4000, 0x0B631FEC, 0x2F9700B3, -+ 0x166B4000, 0x1668400C, 0x2763400C, 0x0D691FF2, -+ 0x246A4014, 0x219700E1, 0x3A6B1FD6, 0x0D691FF2, -+ 0x1668400C, 0x1F05C000, 0x086A1FF4, 0x319700CB, -+ 0x2A681FF0, 0x086A1FF4, 0x2D010000, 0x269700D6, -+ 0x229700B7, 0x396B1FEC, 0x228B4000, 0x05631FE4, -+ 0x2A681FF0, 0x2460400C, 0x08691FF8, 0x29611FDE, -+ 0x086A1FF4, 0x21621FDC, 0x350A4000, 0x040E4000, -+ 0x0CD40332, 0x07024000, 0x24260003, 0x2736FFFE, -+ 0x00601FE2, 0x1A048000, 0x0B601FE0, 0x1A048000, -+ 0x35068000, 0x37621FF0, 0x1A048000, 0x0B601FD6, -+ 0x1668400C, 0x2897007D, 0x056A1FF0, 0x1668400C, -+ 0x1A048000, 0x2897007D, 0x0B6A1FF8, 0x32681FE2, -+ 0x296B1FF0, 0x3304C000, 0x00691FF6, 0x2F970085, -+ 0x268C0400, 0x0E6B4024, 0x05631FD2, 0x1A378000, -+ 0x07CC0415, 0x39681FE0, 0x296B1FF0, 0x3304C000, -+ 0x0D691FF2, 0x086A1FF4, 0x2F970085, 0x32681FE2, -+ 0x3930FFFE, 0x0A500001, 0x39681FE0, 0x0D691FF2, -+ 0x2F970085, 0x3B201FD8, 0x0D500000, 0x0D500000, -+ 0x0D691FF2, 0x1531FFFE, 0x0E494000, 0x29310001, -+ 0x05D40418, 0x1231FFFF, 0x36200000, 0x00601FD4, -+ 0x32230001, 0x1E220001, 0x0200C000, 0x2E148000, -+ 0x31C8036D, 0x32681FD4, 0x1A048000, 0x00601FD4, -+ 0x1A074000, 0x35054000, 0x35068000, 0x02CC0366, -+ 0x32681FE2, 0x296B1FF0, 0x3304C000, 0x1A210000, -+ 0x186A1FDE, 0x3397041C, 0x3930FFFE, 0x0B480000, -+ 0x1A388000, 0x05300001, 0x24D0037D, 0x2C250001, -+ 0x25800379, 0x2D3D0000, 0x35C803AF, 0x268C0400, -+ 0x16614018, 0x26218040, 0x25970079, 0x32681FD4, -+ 0x1E691FE2, 0x1531FFFE, 0x0E494000, 0x15072000, -+ 0x1D210001, 0x0B6B4018, 0x3E3FFFFF, 0x03270001, -+ 0x1A11C000, 0x252DFFFF, 0x02164000, 0x326B1FD8, -+ 0x268C0400, 0x21694024, 0x2A611FD2, 0x3BC803A7, -+ 0x1F1F8000, 0x3AC803A0, 0x2C621FD8, 0x21681FF2, -+ 0x0C2107F6, 0x3297041B, 0x1E220001, 0x16624014, -+ 0x39681FD6, 0x29604008, 0x37218001, 0x25970079, -+ 0x15691FD6, 0x32681FE2, 0x086A1FF4, 0x2F260001, -+ 0x3397041C, 0x23218010, 0x25970079, 0x32681FE2, -+ 0x1A210000, 0x086A1FF4, 0x2F260001, 0x3397041C, -+ 0x26218040, 0x25970079, 0x2C800370, 0x39681FE0, -+ 0x296B1FF0, 0x3304C000, 0x2A604004, 0x32681FE2, -+ 0x3304C000, 0x27604000, 0x186A1FDE, 0x3F6B1FDC, -+ 0x3A634014, 0x1F0AC000, 0x2E0EC000, 0x1AD403BD, -+ 0x2D02C000, 0x1B624010, 0x2F218400, 0x25970079, -+ 0x18691FD2, 0x1F1C4000, 0x0DCC03CA, 0x1531FFFE, -+ 0x22484000, 0x063C0001, 0x122D0002, 0x0E494000, -+ 0x2E184000, 0x2DC8040B, 0x268C0400, 0x00684020, -+ 0x05300001, 0x30D00415, 0x09300002, 0x22D003D8, -+ 0x15684000, 0x34694004, 0x2A604004, 0x0B614000, -+ 0x06684010, 0x27694014, 0x39604014, 0x18614010, -+ 0x166B4000, 0x2A634008, 0x0E631FD0, 0x25218020, -+ 0x25970079, 0x2DD003E1, 0x39681FE0, 0x1E691FE2, -+ 0x2A8003E3, 0x32681FE2, 0x15691FE0, 0x086A1FF4, -+ 0x2F260001, 0x3397041C, 0x268C0400, 0x226A4024, -+ 0x25218020, 0x25970079, 0x3F681FD0, 0x1C0A0000, -+ 0x2F260001, 0x15691FE0, 0x296B1FF0, 0x1F05C000, -+ 0x1A1D0000, 0x00CC03F8, 0x32681FE2, 0x15691FE0, -+ 0x0B601FE0, 0x2C611FE2, 0x37681FDE, 0x0E601FDC, -+ 0x2A621FDE, 0x32681FE2, 0x0D691FF2, 0x3297041B, -+ 0x296A4010, 0x1A048000, 0x3930FFFE, 0x268C0400, -+ 0x084B0000, 0x0D500000, 0x0D500000, 0x023F0000, -+ 0x26C80370, 0x23218010, 0x25970079, 0x052CFFFC, -+ 0x268C0400, 0x0D500000, 0x2C800370, 0x1E691FE2, -+ 0x39681FE0, 0x086A1FF4, 0x2F970085, 0x16624014, -+ 0x31200001, 0x1A210000, 0x156B400C, 0x1B631FF0, -+ 0x20800075, 0x24200017, 0x1B210007, 0x3D800412, -+ 0x3A200003, 0x0621001F, 0x3D800412, 0x086A1FF4, -+ 0x1B624010, 0x16624014, 0x27604000, 0x06614004, -+ 0x29604008, 0x228B4000, 0x0E631FE6, 0x2C681FF6, -+ 0x08691FF8, 0x086A1FF4, 0x1D601FCC, 0x37611FCA, -+ 0x39621FF8, 0x24260003, 0x2736FFFE, 0x39621FCE, -+ 0x296B1FF0, 0x19078000, 0x19078000, 0x1D631FF6, -+ 0x19078000, 0x1B631FF0, 0x2E970327, 0x063C0001, -+ 0x28C80437, 0x063C0001, 0x2A800455, 0x2A681FF0, -+ 0x0B6A1FCE, 0x19088000, 0x2897007D, 0x06691FF0, -+ 0x0B6A1FCE, 0x2B034000, 0x28004000, 0x19078000, -+ 0x24634000, 0x19088000, 0x19088000, 0x2097008A, -+ 0x06691FF0, 0x0B6A1FCE, 0x28004000, 0x19088000, -+ 0x3930FFFE, 0x0A500001, 0x0F280002, 0x09300002, -+ 0x19088000, 0x19088000, 0x18601FF0, 0x2097008A, -+ 0x03691FCC, 0x066A1FCA, 0x32611FF6, 0x39621FF8, -+ 0x31200001, 0x268C0400, 0x2B800077, 0x0D601FD0, -+ 0x296A4010, 0x15684000, 0x2C621FD8, 0x08601FDA, -+ 0x10691FDC, 0x2A681FF0, 0x07024000, 0x36064000, -+ 0x36064000, 0x2897007D, 0x1E6A1FD8, 0x3A681FDA, -+ 0x1B624010, 0x27604000, 0x3F681FD0, 0x063C0001, -+ 0x09CC0471, 0x216B1FFE, 0x071BC000, 0x25D0046F, -+ 0x229706BB, 0x0D601FD0, 0x33800476, 0x379706AD, -+ 0x33800476, 0x0D3C0003, 0x08CC0476, 0x36970483, -+ 0x31200001, 0x0D601FD0, 0x3F681FD0, 0x35230000, -+ 0x2D010000, 0x293D000D, 0x0ACC047D, 0x34230007, -+ 0x3C800480, 0x2E3D000C, 0x36C80480, 0x2923001F, -+ 0x268C0400, 0x39634018, 0x2B800077, 0x08631FD6, -+ 0x37681FB2, 0x03691FFA, 0x086A1FF4, 0x2F970085, -+ 0x16624014, 0x2F681FFA, 0x226B1FF2, 0x136A1FDC, -+ 0x1D691FB4, 0x1A048000, 0x2A604004, 0x05614008, -+ 0x24634000, 0x25218020, 0x25970079, 0x3A681FB6, -+ 0x3930FFFE, 0x0A500001, 0x3A6B1FD6, 0x228B4000, -+ 0x1A048000, 0x3930FFFE, 0x0D500000, 0x0D500000, -+ 0x0D500000, 0x0D500000, 0x228B4000, 0x086A1FF4, -+ 0x1D2E0001, 0x1B624010, 0x0B614000, 0x29604008, -+ 0x268C0400, 0x2A70001C, 0x2470881D, 0x36058000, -+ 0x1A048000, 0x228B4000, 0x27604000, 0x27681FF4, -+ 0x05614008, 0x34604010, 0x268C0400, 0x15624018, -+ 0x2E020000, 0x29218080, 0x23800079, 0x08631FD6, -+ 0x387000C4, 0x249700EB, 0x246B1FF4, 0x08270003, -+ 0x0B37FFFE, 0x0D631FDC, 0x2D010000, 0x2A3D0001, -+ 0x238C0100, 0x1ACC0457, 0x3D6A40A2, 0x176840A8, -+ 0x2F260001, 0x27970498, 0x21681FF2, 0x086A1FF4, -+ 0x27970498, 0x2F260001, 0x2736FFFE, 0x0F6240A2, -+ 0x026240A6, 0x3A6B1FD6, 0x228B4000, 0x08631FD6, -+ 0x3A6B1FD6, 0x228B4000, 0x08631FD6, 0x136A1FDC, -+ 0x06691FF0, 0x3D201FB2, 0x2D230012, 0x35098000, -+ 0x36058000, 0x15410000, 0x3E2C0002, 0x0A2FFFFF, -+ 0x0FCC04D4, 0x37681FB2, 0x2897007D, 0x136A1FDC, -+ 0x3A681FB6, 0x1D32FFFC, 0x2897007D, 0x2E97052B, -+ 0x16691FB6, 0x21681FF2, 0x1E220001, 0x2A9704AA, -+ 0x1E220001, 0x1B691FB2, 0x3F970530, 0x3A6B1FD6, -+ 0x228B4000, 0x08631FD6, 0x3F6B1FDC, 0x0D691FF2, -+ 0x1D6A1FD4, 0x1F05C000, 0x2E97051D, 0x15691FBA, -+ 0x1E220001, 0x3F970530, 0x106A1FD0, 0x03691FFA, -+ 0x2E97051D, 0x216B1FFE, 0x03691FFA, 0x071BC000, -+ 0x1ED404FF, 0x3F6B1FDC, 0x036A1FC0, 0x1F05C000, -+ 0x1F05C000, 0x2E97051D, 0x34800502, 0x15691FBA, -+ 0x2C681FC0, 0x2697049F, 0x13691FD0, 0x34681FBE, -+ 0x036A1FC0, 0x286040AC, 0x096140A8, 0x096240A4, -+ 0x358C5000, 0x28700384, 0x3A6B1FD6, 0x228B4000, -+ 0x136A1FDC, 0x15691FBA, 0x16624014, 0x1632FFFE, -+ 0x35098000, 0x0B614000, 0x0A6140A4, 0x16691FB6, -+ 0x1D6A1FB8, 0x05614008, 0x0B691FF4, 0x05624004, -+ 0x1E2D0001, 0x18614010, 0x228B4000, 0x1B684008, -+ 0x2B800527, 0x0B631FEC, 0x0B614000, 0x06624008, -+ 0x2B008000, 0x13218800, 0x25970079, 0x086A1FF4, -+ 0x27970498, 0x1B684008, 0x396B1FEC, 0x256040A8, -+ 0x358C5000, 0x34700184, 0x228B4000, 0x086A1FF4, -+ 0x1D691FB4, 0x1B624010, 0x0A6140A4, 0x228B4000, -+ 0x28004000, 0x1531FFFE, 0x268C0400, 0x3F424000, -+ 0x2B800527, 0x2C8C5080, 0x24BC004E, 0x13204096, -+ 0x228B4000, 0x2C8C5080, 0x24BC004E, 0x13204096, -+ 0x3E500C63, 0x228B4000, 0x2C681FF6, 0x252DFFFF, -+ 0x07024000, 0x2F36FFF0, 0x21320003, 0x3930FFFE, -+ 0x1F060000, 0x0E4A8000, 0x28004000, 0x3C34000F, -+ 0x1A120000, 0x02624090, 0x228B4000, 0x036A1FC0, -+ 0x096140A8, 0x096240A4, 0x238C0100, 0x34700184, -+ 0x0E6A1FF2, 0x05624004, 0x086A1FF4, 0x16624014, -+ 0x0B614000, 0x05614008, 0x238C0100, 0x20694080, -+ 0x18350001, 0x03CC055B, 0x228B4000, 0x1D2E0001, -+ 0x1B624010, 0x25218020, 0x23800079, 0x08631FD6, -+ 0x16502DE7, 0x3F502084, 0x36970539, 0x13502931, -+ 0x35970535, 0x0F6B4080, 0x25370020, 0x0FCC071D, -+ 0x13503548, 0x03501CE4, 0x36970539, 0x315024A9, -+ 0x35970535, 0x0350A148, 0x0A5035A4, 0x36970539, -+ 0x3350252E, 0x35970535, 0x0E502929, 0x145035B0, -+ 0x36970539, 0x3F502108, 0x35970535, 0x2B5025A9, -+ 0x1D502CA6, 0x36970539, 0x1450288A, 0x35970535, -+ 0x2350B4EB, 0x18509525, 0x36970539, 0x37501086, -+ 0x35970535, 0x0F502D67, 0x035035AD, 0x36970539, -+ 0x1C501991, 0x35970535, 0x0F6B4080, 0x00631FEE, -+ 0x235098C4, 0x27509DAF, 0x36970539, 0x1450316C, -+ 0x35970535, 0x00509148, 0x1E502CC6, 0x36970539, -+ 0x1A50358E, 0x35970535, 0x355099AB, 0x3A6B1FD6, -+ 0x228B4000, 0x08631FD6, 0x30700090, 0x3A97050C, -+ 0x358C5000, 0x23700080, 0x13204096, 0x3E500C63, -+ 0x235024E4, 0x13204096, 0x3E500C63, 0x045030A6, -+ 0x35970535, 0x2850B12C, 0x395020EE, 0x36970539, -+ 0x0B5028AF, 0x35970535, 0x3D50A90A, 0x3D50AD8C, -+ 0x35970535, 0x29503D6B, 0x1850C54A, 0x36970539, -+ 0x0F6B4080, 0x00631FEE, 0x23700080, 0x1C50352B, -+ 0x35970535, 0x326B1FEE, 0x236A4080, 0x07330006, -+ 0x14D405B9, 0x2B320006, 0x27D005DE, 0x3220000D, -+ 0x21800457, 0x3E500C63, 0x16502D8B, 0x36970539, -+ 0x3450252F, 0x35970535, 0x3950252B, 0x3350210B, -+ 0x36970539, 0x1B5018E5, 0x35970535, 0x3E500C63, -+ 0x205044D1, 0x36970539, 0x3D502409, 0x35970535, -+ 0x0550A531, 0x065018CB, 0x35970535, 0x3E500C63, -+ 0x32504409, 0x36970539, 0x2450112C, 0x35970535, -+ 0x3650B62D, 0x0D50300C, 0x35970535, 0x3E500C63, -+ 0x025035AA, 0x35970535, 0x2550B50D, 0x3B502520, -+ 0x35970535, 0x1B501C63, 0x3350140D, 0x35970535, -+ 0x3A6B1FD6, 0x228B4000, 0x2E97052B, 0x3F6B1FDC, -+ 0x0D691FF2, 0x1D6A1FD4, 0x1F05C000, 0x2E97051D, -+ 0x1E691FB8, 0x3F681FD0, 0x2697049F, 0x13691FD0, -+ 0x12220002, 0x3F970530, 0x1E691FB8, 0x2C681FC0, -+ 0x249704A2, 0x00691FC0, 0x15220003, 0x3F970530, -+ 0x3A97050C, 0x358C5000, 0x23700080, 0x13204096, -+ 0x3E500C63, 0x3F502084, 0x13204096, 0x3E500C63, -+ 0x0B5035CF, 0x35970535, 0x3E500C63, 0x0C502D07, -+ 0x36970539, 0x195034AD, 0x35970535, 0x3E500C63, -+ 0x325024A5, 0x36970539, 0x165029AE, 0x35970535, -+ 0x0F503144, 0x2F502531, 0x36970539, 0x0250194A, -+ 0x35970535, 0x295010C8, 0x0E50318C, 0x36970539, -+ 0x085028CF, 0x35970535, 0x24502569, 0x195019AD, -+ 0x36970539, 0x25501004, 0x35970535, 0x3E50B08C, -+ 0x11502D29, 0x36970539, 0x1B5019A6, 0x35970535, -+ 0x3E500C63, 0x3450140C, 0x36970539, 0x2750218F, -+ 0x35970535, 0x2550AD0B, 0x04502940, 0x35970535, -+ 0x3E500C63, 0x0C50300B, 0x36970539, 0x3C5011AB, -+ 0x35970535, 0x3250B585, 0x3B502520, 0x35970535, -+ 0x3E500C63, 0x0E5035A9, 0x35970535, 0x3350B54D, -+ 0x15502C0B, 0x35970535, 0x1B501C63, 0x3350140D, -+ 0x35970535, 0x3A6B1FD6, 0x228B4000, 0x08631FD6, -+ 0x2E97052B, 0x03691FCC, 0x3F6B1FDC, 0x2F681FFA, -+ 0x1E220001, 0x3304C000, 0x2A9704AA, 0x2897051B, -+ 0x08691FCE, 0x3F6B1FDC, 0x21681FF2, 0x1E220001, -+ 0x3304C000, 0x3304C000, 0x2A9704AA, 0x2897051B, -+ 0x30700090, 0x3A97050C, 0x358C5000, 0x13204096, -+ 0x3E500C63, 0x0B502A25, 0x13204096, 0x3E500C63, -+ 0x2250248F, 0x35970535, 0x0250292A, 0x285020AF, -+ 0x36970539, 0x25501004, 0x35970535, 0x00502D04, -+ 0x295038AE, 0x36970539, 0x245024E5, 0x35970535, -+ 0x1650A088, 0x2A50392E, 0x36970539, 0x19502D4B, -+ 0x35970535, 0x3E500C63, 0x0A502924, 0x36970539, -+ 0x0F502CEB, 0x35970535, 0x00502DCB, 0x3B5011AA, -+ 0x36970539, 0x3F502108, 0x35970535, 0x3E500C63, -+ 0x15502C0B, 0x36970539, 0x2A5020C8, 0x35970535, -+ 0x2550AD0B, 0x0D502925, 0x35970535, 0x1B501C63, -+ 0x3550140B, 0x36970539, 0x185019AA, 0x35970535, -+ 0x3A6B1FD6, 0x228B4000, 0x08631FD6, 0x21681FF2, -+ 0x10691FDC, 0x086A1FF4, 0x19044000, 0x27604000, -+ 0x27970498, 0x21681FF2, 0x35054000, 0x19044000, -+ 0x27970498, 0x07024000, 0x39694000, 0x29681FCA, -+ 0x2F970085, 0x3A97050C, 0x13204096, 0x268C0400, -+ 0x3E500C63, 0x225020C6, 0x36970539, 0x325024A5, -+ 0x35970535, 0x3E500C63, 0x0E502D0C, 0x36970539, -+ 0x1C502884, 0x35970535, 0x3E500C63, 0x335021A8, -+ 0x36970539, 0x00502C2B, 0x35970535, 0x1450296A, -+ 0x30502028, 0x35970535, 0x0D50A509, 0x09502944, -+ 0x35970535, 0x3E500C63, 0x325024C9, 0x35970535, -+ 0x1B50A549, 0x2A502144, 0x36970539, 0x3D502409, -+ 0x35970535, 0x358C5000, 0x0F6B4080, 0x3E370008, -+ 0x0CCC06AB, 0x2720001B, 0x21800457, 0x3A6B1FD6, -+ 0x228B4000, 0x08631FD6, 0x2C681FC0, 0x3930FFFE, -+ 0x0A500001, 0x1B204098, 0x1A5000E4, 0x1B204098, -+ 0x025004E5, 0x36970539, 0x325008E6, 0x35970535, -+ 0x238C0100, 0x3A6B1FD6, 0x228B4000, 0x08631FD6, -+ 0x2C681FC0, 0x3930FFFE, 0x358C5000, 0x0A500001, -+ 0x1B204098, 0x175018E6, 0x296B1FF0, 0x2C681FF6, -+ 0x08691FF8, 0x10631FC4, 0x18601FC6, 0x3C611FC8, -+ 0x3F6B1FDC, 0x39681FD6, 0x18631FCA, 0x1D601FCC, -+ 0x34681FBE, 0x0B691FF4, 0x2F6B1FC0, 0x1E2D0001, -+ 0x3A611FF8, 0x1B631FF0, 0x1E601FF6, 0x358C5000, -+ 0x2E970327, 0x226B1FC4, 0x056A1FC6, 0x0E691FC8, -+ 0x1B631FF0, 0x31621FF6, 0x3A611FF8, 0x2A6B1FCA, -+ 0x006A1FCC, 0x0D631FDC, 0x24621FD6, 0x268C0400, -+ 0x02030000, 0x053F0001, 0x1CCC06ED, 0x15691FBA, -+ 0x2D97054B, 0x13691FBC, 0x2D97054B, 0x136A1FDC, -+ 0x15691FBA, 0x2A681FF0, 0x35068000, 0x2F970085, -+ 0x31200001, 0x3A6B1FD6, 0x228B4000, 0x19220000, -+ 0x3C8006F3, 0x00220080, 0x3C8006F3, 0x09661FFF, -+ 0x0E631FE6, 0x309704B3, 0x249704CE, 0x2E9704CB, -+ 0x309704E9, 0x2E97052B, 0x18691FD2, 0x14220004, -+ 0x3F970530, 0x08691FCE, 0x3F6B1FDC, 0x21681FF2, -+ 0x12220002, 0x3304C000, 0x3304C000, 0x2A9704AA, -+ 0x2897051B, 0x3A97050C, 0x1A21889C, 0x0A614092, -+ 0x358C5000, 0x23700080, 0x1E691FE2, 0x3797053E, -+ 0x13204096, 0x095029E7, 0x035030A7, 0x13204096, -+ 0x095029E7, 0x325024A5, 0x35970535, 0x3397055F, -+ 0x02194000, 0x3CC80720, 0x3797053E, 0x1B204098, -+ 0x035030A7, 0x36970539, 0x325024A5, 0x35970535, -+ 0x3C800713, 0x358C5000, 0x29200013, 0x21800457, -+ 0x358C5000, 0x236A4080, 0x09360020, 0x04CC0729, -+ 0x35970633, 0x358C5000, 0x29970676, 0x31200001, -+ 0x21800457, 0x1E6A1FEE, 0x1C6B4090, 0x27320005, -+ 0x1A1EC000, 0x1B360001, 0x28C80731, 0x3220000D, -+ 0x21800457, 0x3D200002, 0x21800457, 0x0F220040, -+ 0x24800737, 0x162200C0, 0x24800737, 0x09661FFF, -+ 0x0E631FE6, 0x309704B3, 0x249704CE, 0x2E9704CB, -+ 0x166A1FBA, 0x03691FFA, 0x2E97051D, 0x3F6B1FDC, -+ 0x03691FFA, 0x0B6A1FCE, 0x1F05C000, 0x2E97051D, -+ 0x1B6A1FBE, 0x00691FF6, 0x2E97051D, 0x3F6B1FDC, -+ 0x00691FF6, 0x106A1FD0, 0x1F05C000, 0x2E97051D, -+ 0x22681FFE, 0x07180000, 0x2CD00756, 0x1B691FB2, -+ 0x3F681FBC, 0x249704A2, 0x1B691FB2, 0x2C681FC0, -+ 0x249704A2, 0x2B800762, 0x3F6B1FDC, 0x03691FFA, -+ 0x106A1FBC, 0x1F05C000, 0x1F05C000, 0x2E97051D, -+ 0x3F6B1FDC, 0x00691FF6, 0x036A1FC0, 0x1F05C000, -+ 0x1F05C000, 0x2E97051D, 0x39970595, 0x358C5000, -+ 0x29970676, 0x31200001, 0x21800457, 0x0C220020, -+ 0x29800769, 0x09661FFF, 0x0E631FE6, 0x309704B3, -+ 0x249704CE, 0x2E9704CB, 0x309704E9, 0x2E97052B, -+ 0x18691FD2, 0x12220002, 0x3F970530, 0x32681FD4, -+ 0x18691FD2, 0x27604000, 0x06614004, 0x24681FCE, -+ 0x29604008, 0x238C0100, 0x25218020, 0x1B61401C, -+ 0x27604000, 0x29604008, 0x12220002, 0x268C0400, -+ 0x15624018, 0x26218040, 0x1B61401C, 0x3A97050C, -+ 0x1A21889C, 0x0A614092, 0x358C5000, 0x23700080, -+ 0x1E691FE2, 0x3797053E, 0x13204096, 0x358C5000, -+ 0x2A5020A4, 0x13204096, 0x1F50A4A4, 0x35970535, -+ 0x145028E6, 0x1A503108, 0x35970535, 0x358C5000, -+ 0x2150ACE6, 0x17503529, 0x0F6B4080, 0x13204096, -+ 0x25370020, 0x0FCC071D, 0x1B50C1AC, 0x31502549, -+ 0x35970535, 0x3E500C63, 0x3C502168, 0x35970535, -+ 0x04502D09, 0x3D5011AC, 0x35970535, 0x0D50A509, -+ 0x0E5029D0, 0x35970535, 0x2450214C, 0x1050196B, -+ 0x35970535, 0x3E500C63, 0x12501D29, 0x35970535, -+ 0x3E500C63, 0x14509510, 0x35970535, 0x3E500C63, -+ 0x3F509DE7, 0x35970535, 0x0F6B4080, 0x00631FEE, -+ 0x02194000, 0x38C807B8, 0x3797053E, 0x3F80078A, -+ 0x358C5000, 0x236A4080, 0x09360020, 0x16CC07C7, -+ 0x30700090, 0x02501865, 0x35970535, 0x1B501C63, -+ 0x35970535, 0x38501463, 0x35970535, 0x2C681FC0, -+ 0x268C0400, 0x31200001, 0x21800457, 0x1E6A1FEE, -+ 0x1C6B4090, 0x27320005, 0x1A1EC000, 0x1B360001, -+ 0x35C807BC, 0x3220000D, 0x21800457, 0x1E79084F -+}; -+ -+static const uint32_t fw1_boot_img_data_buf[] = -+{ -+ 0x36200000, 0x11210002, 0x15710249, 0x31200001, -+ 0x2860B41C, 0x21970074, 0x1A210000, 0x1231FFFF, -+ 0x1B390001, 0x092CFFFF, 0x00CC0007, 0x0761B140, -+ 0x3A200333, 0x3060B438, 0x3E60B45C, 0x3D60B43C, -+ 0x0A20FFFF, 0x2D60B420, 0x1A210000, 0x1F68B420, -+ 0x0A61B422, 0x1234FEFE, 0x05300001, 0x2D60B420, -+ 0x0C61B424, 0x0761B426, 0x0F61B428, 0x0461B42A, -+ 0x0261B42C, 0x0961B42E, 0x1F61B434, 0x1461B436, -+ 0x21970074, 0x1C21A0CA, 0x33228000, 0x3F424000, -+ 0x032D0100, 0x092CFFFF, 0x18CC0023, 0x16710449, -+ 0x1CB8002B, 0x30224000, 0x2C80002C, 0x19220000, -+ 0x06210045, 0x0C61B424, 0x35230000, 0x2D63B42C, -+ 0x21970074, 0x13232000, 0x0C62B428, 0x3063B434, -+ 0x16210333, 0x278C0078, 0x37BC005E, 0x1C61B438, -+ 0x092CFFFF, 0x0CCC0032, 0x0A710649, 0x21970074, -+ 0x1721A0C8, 0x19220000, 0x3F424000, 0x122D0002, -+ 0x3F424000, 0x182D00FE, 0x092CFFFF, 0x0FCC003E, -+ 0x1A223000, 0x2F712049, 0x1FB8004B, 0x33214000, -+ 0x35230000, 0x3F222000, 0x2880004D, 0x1A210000, -+ 0x35230000, 0x1820B424, 0x19500011, 0x0A500001, -+ 0x1150C400, 0x0A500001, 0x0261B42C, 0x2663B42E, -+ 0x1C62B434, 0x39230333, 0x278C0078, 0x37BC005E, -+ 0x3363B438, 0x36200000, 0x2B60B140, 0x13710149, -+ 0x398C0000, 0x3C80005C, 0x3371FF49, 0x3C80005C, -+ 0x2A320001, 0x0A367FFF, 0x2CC80073, 0x252A0008, -+ 0x0EC0006F, 0x0D500000, 0x0D500000, 0x0D500000, -+ 0x0D500000, 0x0D500000, 0x0D500000, 0x0D500000, -+ 0x0D500000, 0x2CC80073, 0x35800063, 0x26260008, -+ 0x0D500000, 0x262EFFFF, 0x11CC0070, 0x228B4000, -+ 0x0868B1F8, 0x3C34000F, 0x0128000A, 0x26C4007A, -+ 0x0224000A, 0x228B4000, 0x3320000A, 0x228B4000, -+ 0x01000000, 0x01000000, 0x01000000 -+}; -+ -+static const uint32_t fw1_master_img_data_buf[] = -+{ -+ 0x36200000, 0x11210002, 0x3C605FF4, 0x1B615FF6, -+ 0x36200000, 0x2560B148, 0x1A205FE0, 0x38215FE8, -+ 0x3B230008, 0x1F090000, 0x15C00104, 0x31200001, -+ 0x2860B41C, 0x2A9700B9, 0x329700C7, 0x1C208000, -+ 0x2B60B140, 0x01000000, 0x19220000, 0x0B685FFE, -+ 0x2469B1F8, 0x2B3C4600, 0x1ECC0013, 0x1D2E0001, -+ 0x28038000, 0x01000000, 0x0A2FFFFF, 0x1BCC0019, -+ 0x0B685FFE, 0x2469B1F8, 0x2B3C4600, 0x22C80021, -+ 0x25800013, 0x056B5FFA, 0x333B0000, 0x14D40026, -+ 0x363700FF, 0x2E63B47A, 0x3A200333, 0x3060B438, -+ 0x3E60B45C, 0x3D60B43C, 0x39230003, 0x2F22B400, -+ 0x0A20FFFF, 0x13408000, 0x1A210000, 0x21488000, -+ 0x23260002, 0x3F418000, 0x1234FEFE, 0x05300001, -+ 0x202A0002, 0x13408000, 0x3D260020, 0x0A2FFFFF, -+ 0x17CC002C, 0x36200000, 0x3E60B406, 0x2D60B416, -+ 0x2B60B426, 0x3860B436, 0x2860B446, 0x3B60B456, -+ 0x036B5FFC, 0x00210100, 0x05222F00, 0x29370080, -+ 0x27C80047, 0x1A210000, 0x1A223000, 0x1820B424, -+ 0x19500011, 0x0A500001, 0x1150C400, 0x0A500001, -+ 0x15410000, 0x3E2C0002, 0x0D500000, 0x1C62B434, -+ 0x10205E90, 0x0D220164, 0x0D970F97, 0x2469B1F8, -+ 0x15220333, 0x36200000, 0x278C0078, 0x30BC00FC, -+ 0x1F62B438, 0x2060B424, 0x2B60B426, 0x33610102, -+ 0x1035000F, 0x38610100, 0x0A68B400, 0x3369B420, -+ 0x32605FCA, 0x13615FCE, 0x353400FF, 0x2C380200, -+ 0x34605FCC, 0x2535FF00, 0x17390002, 0x08615FD0, -+ 0x1E970F24, 0x31200001, 0x2E605EA0, 0x202001A0, -+ 0x1760010C, 0x35203000, 0x1C60010E, 0x31200001, -+ 0x2560B148, 0x30695EA0, 0x33228000, 0x28004000, -+ 0x063C0001, 0x1FCC0078, 0x0462B140, 0x2280007E, -+ 0x28004000, 0x0C3C0004, 0x19CC007E, 0x1968B140, -+ 0x283C4000, 0x2B60B140, 0x1035000F, 0x1231FFFF, -+ 0x0B2D0082, 0x0D894000, 0x248C1D78, 0x318000A1, -+ 0x2F8C1D7A, 0x318000A1, 0x3D8C1DF8, 0x318000A1, -+ 0x368C1DFA, 0x318000A1, 0x298C1D7C, 0x318000A1, -+ 0x228C1D7E, 0x318000A1, 0x308C1DFC, 0x318000A1, -+ 0x3B8C1DFE, 0x318000A1, 0x238C1D79, 0x318000A1, -+ 0x288C1D7B, 0x318000A1, 0x3A8C1DF9, 0x318000A1, -+ 0x318C1DFB, 0x318000A1, 0x2E8C1D7D, 0x318000A1, -+ 0x258C1D7F, 0x318000A1, 0x378C1DFD, 0x318000A1, -+ 0x3C8C1DFF, 0x35B000FA, 0x07BC0C07, 0x29D80CD4, -+ 0x3FA00C08, 0x1DA40C2E, 0x1CA80C49, 0x11F80F12, -+ 0x39E80CF2, 0x32E00118, 0x336A5EA0, 0x362300AF, -+ 0x17360002, 0x33C800AF, 0x20AC0E9D, 0x31215EA2, -+ 0x07220014, 0x14970FB4, 0x27C80071, 0x21884000, -+ 0x30380000, 0x32C80112, 0x31215EA2, 0x07220014, -+ 0x1D800FD7, 0x36200000, 0x0D500000, 0x0D500000, -+ 0x0D500000, 0x0D500000, 0x36200000, 0x2760B000, -+ 0x2960B008, 0x1E220001, 0x1B62B010, 0x3760B01C, -+ 0x10228800, 0x1862B01C, 0x228B4000, 0x0868B1F8, -+ 0x2D635E96, 0x3C34000F, 0x02030000, 0x022B000A, -+ 0x05C000CE, 0x3320000A, 0x02030000, 0x1A210000, -+ 0x1231FFFF, 0x1B390001, 0x092CFFFF, 0x1DCC00D0, -+ 0x0761B140, 0x33228000, 0x2D010000, 0x20310008, -+ 0x1A39A0CA, 0x3F424000, 0x19220000, 0x3F424000, -+ 0x0C220020, 0x392DFFBA, 0x3F424000, 0x3860B150, -+ 0x1A22C000, 0x22520000, 0x22520000, 0x19220000, -+ 0x302DFF7C, 0x3F424000, 0x172D0008, 0x3F424000, -+ 0x1E220001, 0x172D0008, 0x3F424000, 0x19220000, -+ 0x1A2D000C, 0x3F424000, 0x10228800, 0x3F424000, -+ 0x06220400, 0x0962B144, 0x2E020000, 0x033A0200, -+ 0x0962B144, 0x322C0001, 0x0A2FFFFF, 0x17CC00D5, -+ 0x1F6B5E96, 0x228B4000, 0x0422008D, 0x2480010D, -+ 0x09220089, 0x2480010D, 0x0C220083, 0x2480010D, -+ 0x0A220085, 0x2480010D, 0x13220005, 0x2480010D, -+ 0x01220087, 0x2480010D, 0x18220007, 0x2480010D, -+ 0x0D220011, 0x2480010D, 0x0222008B, 0x2480010D, -+ 0x1B22000B, 0x15625FF2, 0x32635FF0, 0x23320008, -+ 0x0A62B148, 0x33D00113, 0x228B4000, 0x31200001, -+ 0x2A9700B9, 0x329700C7, 0x398C0000, 0x35800116, -+ 0x33695F20, 0x3A20012C, 0x1C35C000, 0x36C8011F, -+ 0x12685F24, 0x043D4000, 0x08CC00AA, 0x3C2300AA, -+ 0x336A5EA0, 0x03210080, 0x2736FFFE, 0x01625EA0, -+ 0x37655F21, 0x288000B4, 0x33695F20, 0x12685F24, -+ 0x1C35C000, 0x2E3DC000, 0x3FC80120, 0x228B4000, -+ 0x01970F37, 0x26C801CC, 0x20605F24, 0x00685FFC, -+ 0x1A210000, 0x09615F2E, 0x3F340003, 0x212C013E, -+ 0x21884000, 0x36200000, 0x2360B122, 0x3D800142, -+ 0x146BB124, 0x38695F22, 0x36200000, 0x37370001, -+ 0x03CC0148, 0x3965B123, 0x3D800142, 0x2C800135, -+ 0x28800138, 0x2597010C, 0x1168B122, 0x3B69B124, -+ 0x2F34001F, 0x29310001, 0x19110000, 0x19D401C2, -+ 0x036B5FFC, 0x1C645F20, 0x0A37FF00, 0x0F330008, -+ 0x300B0000, 0x08C001BF, 0x3D6A5F24, 0x3F215F26, -+ 0x0C2E0040, 0x13408000, 0x3330FFFB, 0x1C2C4000, -+ 0x02970FF4, 0x35695F26, 0x362C000C, 0x13350003, -+ 0x06CC01BB, 0x3F215F26, 0x2222FFFE, 0x1C97100A, -+ 0x3E695F24, 0x382C0004, 0x244A0000, 0x042D0042, -+ 0x3F424000, 0x1D2E0001, 0x16420000, 0x1797103E, -+ 0x0E970C64, 0x19685F26, 0x3D695F28, 0x3660B408, -+ 0x1161B40A, 0x12685F24, 0x2421B40E, 0x3B60B40C, -+ 0x21510000, 0x24200021, 0x3560B404, 0x20200040, -+ 0x2660B414, 0x36200175, 0x0F210163, 0x362300AF, -+ 0x1D800C8B, 0x1F685F20, 0x316A5FE8, 0x353400FF, -+ 0x26605F22, 0x1D2E0001, 0x03625FE8, 0x02030000, -+ 0x3330FFFB, 0x0F2C4010, 0x244A0000, 0x382C0004, -+ 0x27490000, 0x2C3B0400, 0x1E2D0001, 0x350A4000, -+ 0x36C40186, 0x1A210000, 0x15410000, 0x12685F24, -+ 0x2B63B120, 0x3D2C0038, 0x0D500000, 0x0D500000, -+ 0x0D500000, 0x0D500000, 0x002CFFF6, 0x244A0000, -+ 0x052CFFCA, 0x146B5F2E, 0x36368000, 0x13CC019B, -+ 0x333B0000, 0x34C801B7, 0x332F003C, 0x3A40C000, -+ 0x0C685F30, 0x20605F24, 0x3E8001B7, 0x25605F2E, -+ 0x333B0000, 0x17CC01A0, 0x3E605F30, 0x278001A2, -+ 0x332F003C, 0x3A40C000, 0x33695F20, 0x1768B124, -+ 0x1E220001, 0x35230000, 0x193500FF, 0x190B4000, -+ 0x1912C000, 0x2E148000, 0x04CC01B0, 0x28970108, -+ 0x282301A2, 0x23635F24, 0x20200040, 0x258001C5, -+ 0x01970F37, 0x20C801CA, 0x20605F24, 0x1F685F20, -+ 0x3D6A5F24, 0x353400FF, 0x3980014F, 0x35215FDA, -+ 0x03970F50, 0x2D2301C4, 0x3B8001D1, 0x1F685F20, -+ 0x20970106, 0x353400FF, 0x2F8001C0, 0x2597010C, -+ 0x2F380400, 0x2860B120, 0x12685F24, 0x15970F4A, -+ 0x36200000, 0x336A5EA0, 0x1B645F21, 0x183A0001, -+ 0x01625EA0, 0x398000AF, 0x302301B0, 0x2B8001CD, -+ 0x3923012C, 0x23635F24, 0x392000C0, 0x1B645F21, -+ 0x398000AF, 0x2B695F32, 0x1C208000, 0x28150000, -+ 0x30C801D6, 0x228B4000, 0x35605F32, 0x392001D9, -+ 0x288000B4, 0x18685FD8, 0x3E215FD8, 0x30380000, -+ 0x2BC801FE, 0x1D970F72, 0x33605F34, 0x2D010000, -+ 0x3E2C0034, 0x0B480000, 0x3C6A5FEC, 0x02030000, -+ 0x3C34000F, 0x1D2E0001, 0x0E625FEC, 0x19220000, -+ 0x14625F3A, 0x3562013E, 0x0C330004, 0x3F37000F, -+ 0x3E2F01EE, 0x228B4000, 0x358003C6, 0x3A800550, -+ 0x2B8006EE, 0x328006FB, 0x32800211, 0x32800211, -+ 0x32800211, 0x32800211, 0x32800211, 0x32800211, -+ 0x32800211, 0x32800211, 0x32800211, 0x32800211, -+ 0x02800BD7, 0x32800211, 0x33605F34, 0x35605F32, -+ 0x398000AF, 0x112200C1, 0x38800214, 0x192200A3, -+ 0x38800214, 0x0F22008F, 0x38800214, 0x0A220085, -+ 0x38800214, 0x162200C0, 0x38800214, 0x152200A0, -+ 0x38800214, 0x122200A1, 0x38800214, 0x07220081, -+ 0x38800214, 0x01220087, 0x38800214, 0x19220000, -+ 0x07685F32, 0x1F625F38, 0x33230219, 0x16341000, -+ 0x05CC02B1, 0x3697036F, 0x01685F34, 0x2D6A5F38, -+ 0x35230229, 0x392C0035, 0x27460000, 0x2D695F34, -+ 0x32800284, 0x1160013C, 0x2B635F46, 0x3697036F, -+ 0x39200226, 0x38605F36, 0x3B9703A4, 0x00CC0274, -+ 0x37970247, 0x0A6A010C, 0x35680110, 0x3D2A01A0, -+ 0x3FC801D9, 0x30380000, 0x0ECC01D9, 0x28620110, -+ 0x1D970C74, 0x1A6A0110, 0x1820B424, 0x19500011, -+ 0x0A500001, 0x1150C400, 0x0A500001, 0x1B5001A0, -+ 0x0D500000, 0x1C62B434, 0x0421023D, 0x3A2301D9, -+ 0x12940C8E, 0x3D6B0112, 0x0F2201A0, 0x3862010C, -+ 0x36200000, 0x1A6A0110, 0x0C600112, 0x07600110, -+ 0x333B0000, 0x0BCC0396, 0x398000AF, 0x33635F38, -+ 0x011A4000, 0x0462B140, 0x1F6B5EA0, 0x2E020000, -+ 0x3E3B0004, 0x2D635EA0, 0x1A388000, 0x35605F32, -+ 0x2B008000, 0x0E300003, 0x2B605F4A, 0x2B008000, -+ 0x3F30FFF8, 0x1E384001, 0x2D605F4C, 0x1132FFFF, -+ 0x2E2E0D17, 0x2E23025B, 0x0E8A4000, 0x26605F4E, -+ 0x0A6A010C, 0x202001A0, 0x1A210000, 0x1C0A0000, -+ 0x11970DFB, 0x06970E19, 0x046B5F32, 0x14685F4E, -+ 0x3F37000F, 0x293B0100, 0x2E6A5F34, 0x2563B144, -+ 0x16420000, 0x36695F46, 0x3E2C0002, 0x15410000, -+ 0x266A5F3A, 0x3E2C0002, 0x16420000, 0x23695F3C, -+ 0x016B5F38, 0x3E2C0002, 0x15410000, 0x228B4000, -+ 0x3520C000, 0x35605F32, 0x13970C85, 0x0F220040, -+ 0x1820B424, 0x19500011, 0x01500003, 0x1150C400, -+ 0x0A500001, 0x0E500180, 0x0D500000, 0x1C62B434, -+ 0x352000AF, 0x192100AF, 0x362300AF, 0x17800C8E, -+ 0x28635E9C, 0x1B6B5FEE, 0x0A615E98, 0x192D0036, -+ 0x22484000, 0x312F0001, 0x29635FEE, 0x00349FFF, -+ 0x10404000, 0x19348000, 0x27C80297, 0x222DFFFE, -+ 0x0D4A4000, 0x172D0008, 0x22484000, 0x02625E9A, -+ 0x21510000, 0x30380000, 0x24C802AD, 0x20605E9E, -+ 0x14685E98, 0x33215FDC, 0x02970F61, 0x12970E9D, -+ 0x12685E9E, 0x1A6B5E9C, 0x30380000, 0x16CC02A1, -+ 0x228B4000, 0x306A5E9A, 0x3E215FD8, 0x2636FF00, -+ 0x28D002A8, 0x02970F61, 0x1A6B5E9C, 0x3B8001D1, -+ 0x23320008, 0x392C0035, 0x27460000, 0x3E695E9E, -+ 0x35800285, 0x2B970104, 0x39209000, 0x35605F32, -+ 0x14801034, 0x1C208000, 0x35605F32, 0x05801043, -+ 0x3B635F36, 0x19685F4A, 0x33695F4C, 0x1632FFFE, -+ 0x1A048000, 0x33C402BC, 0x1E2D0001, 0x01615F4C, -+ 0x2B605F4A, 0x26320002, 0x09685F3A, 0x2C8002CA, -+ 0x3B635F36, 0x30380000, 0x28D002C4, 0x33970365, -+ 0x09685F3A, 0x1C390000, 0x26C802CA, 0x09300002, -+ 0x10404000, 0x3930FFFE, 0x2D010000, 0x0F2D01A0, -+ 0x3E610106, 0x1632FFFE, 0x39C80363, 0x28038000, -+ 0x06330001, 0x0BD402D3, 0x172E0004, 0x280C8000, -+ 0x3B605F3A, 0x28038000, 0x3F37000F, 0x35C802DA, -+ 0x2F36FFF0, 0x092E0010, 0x1F6B5F40, 0x19625F3E, -+ 0x1A0B8000, 0x3CC402DF, 0x01625F40, 0x386A5F42, -+ 0x36200000, 0x133600C0, 0x2B320006, 0x37C802E7, -+ 0x232C0040, 0x262EFFFF, 0x308002E3, 0x19600104, -+ 0x1E970CB7, 0x352000AF, 0x0F970CC0, 0x0E970CC7, -+ 0x1D970C74, 0x07690104, 0x2B680104, 0x1F2D0030, -+ 0x0D4A4000, 0x122D0002, 0x214B4000, 0x123EFFFF, -+ 0x1A1EC000, 0x0DCC0333, 0x3421B424, 0x30510041, -+ 0x2360B428, 0x142D0004, 0x21510000, 0x3151C010, -+ 0x26510001, 0x11220038, 0x1C62B434, 0x1F2102EC, -+ 0x362300AF, 0x12940C8E, 0x3320003C, 0x3960B348, -+ 0x0E970C64, 0x1D970C74, 0x20680106, 0x3721B428, -+ 0x2B6A5F3E, 0x156B5FD0, 0x0451E000, 0x26510001, -+ 0x2E60B42C, 0x122D0002, 0x21510000, 0x24200311, -+ 0x2E63B420, 0x2060B424, 0x1C62B434, 0x19685F4A, -+ 0x33695F4C, 0x3660B408, 0x1161B40A, 0x056B5FCC, -+ 0x2F21B40C, 0x0451E000, 0x26510001, 0x17201061, -+ 0x3B63B400, 0x3560B404, 0x0962B414, 0x3A200003, -+ 0x3D605F50, 0x2620032C, 0x1C210336, 0x11970C8E, -+ 0x362300AF, 0x18940C8B, 0x0F685F50, 0x0834FFFE, -+ 0x3D605F50, 0x30380000, 0x37C80331, 0x398000AF, -+ 0x0F685F50, 0x0434FFFD, 0x3D605F50, 0x30380000, -+ 0x02CC00AF, 0x096B5F36, 0x01800CCE, 0x07970C94, -+ 0x25230203, 0x01800CCE, 0x302302EC, 0x01800C94, -+ 0x3B635F36, 0x30380000, 0x35D0033C, 0x33970365, -+ 0x09685F3A, 0x1C390000, 0x2BC80342, 0x09300002, -+ 0x10404000, 0x3930FFFE, 0x2D010000, 0x0F2D01A0, -+ 0x3E610106, 0x1632FFFE, 0x39C80363, 0x1F6B5F40, -+ 0x19625F3E, 0x1A0B8000, 0x20C4034C, 0x01625F40, -+ 0x28038000, 0x0D330003, 0x04D40350, 0x172E0004, -+ 0x280C8000, 0x3B605F3A, 0x0E970C64, 0x19685F4A, -+ 0x33695F4C, 0x3660B408, 0x1161B40A, 0x20680106, -+ 0x2B6A5F3E, 0x2421B40E, 0x21510000, 0x3B60B40C, -+ 0x24200021, 0x3560B404, 0x0962B414, 0x0A685F36, -+ 0x12210352, 0x362300AF, 0x1D800C8B, 0x096B5F36, -+ 0x2380010C, 0x2B635E90, 0x026B5F34, 0x010CC000, -+ 0x084B0000, 0x3E2C0002, 0x0B480000, 0x28635F4A, -+ 0x196B5E90, 0x2D605F4C, 0x228B4000, 0x336A5F40, -+ 0x36200000, 0x2E605F40, 0x1F3A0000, 0x37CC0CA6, -+ 0x228B4000, 0x0A20FFFF, 0x192D0036, 0x0D4A4000, -+ 0x2F2DFFFA, 0x0A625F42, 0x3A34003F, 0x2E148000, -+ 0x11CC0203, 0x228B4000, 0x0D4A4000, 0x122D0002, -+ 0x0F3607FC, 0x26C80205, 0x26320002, 0x19088000, -+ 0x14C00205, 0x2B008000, 0x05300001, 0x11D40389, -+ 0x1D2E0001, 0x3E30FFFF, 0x228B4000, 0x2D635E96, -+ 0x27200102, 0x2297037E, 0x12600130, 0x0C625F44, -+ 0x27200102, 0x2297037E, 0x1F6B5E96, 0x1F600134, -+ 0x07625F46, 0x228B4000, 0x0969010C, 0x2E68010E, -+ 0x3B3D01A0, 0x0CCC03A1, 0x0C2E01A0, 0x3862010C, -+ 0x30380000, 0x3AC803A0, 0x19088000, 0x19C00201, -+ 0x228B4000, 0x28620110, 0x0F630112, 0x398000AF, -+ 0x26680100, 0x2D635E96, 0x366AB140, 0x1D210001, -+ 0x35230000, 0x03280001, 0x300B0000, 0x1A11C000, -+ 0x28038000, 0x2E174000, 0x22C803B2, 0x29310001, -+ 0x03280001, 0x3AC403AC, 0x1F6B5E96, 0x228B4000, -+ 0x2D635E96, 0x19220000, 0x0A625E94, 0x1A6BB140, -+ 0x0A690100, 0x31200001, 0x2D02C000, 0x2B160000, -+ 0x386A5E94, 0x08CC03C0, 0x1D2E0001, 0x0A625E94, -+ 0x3E30FFFF, 0x252DFFFF, 0x1DCC03BA, 0x1F6B5E96, -+ 0x386A5E94, 0x228B4000, 0x09625F4E, 0x352C03C9, -+ 0x21884000, 0x32800211, 0x298003D9, 0x2C800453, -+ 0x26800456, 0x33800476, 0x2E800497, 0x2F8004FC, -+ 0x238004FF, 0x2980051A, 0x2880051D, 0x3B80053B, -+ 0x32800211, 0x32800211, 0x32800211, 0x32800211, -+ 0x32800211, 0x28230018, 0x1263013C, 0x20970375, -+ 0x2197038B, 0x0F6A0130, 0x02030000, 0x1A0B8000, -+ 0x15C003E2, 0x2E020000, 0x206B013C, 0x11685F44, -+ 0x36695F46, 0x25370020, 0x13CC03E8, 0x1D2E0001, -+ 0x12625F3C, 0x2D0E0000, 0x040E4000, 0x1632FFFE, -+ 0x36970396, 0x249702AE, 0x36200000, 0x15210120, -+ 0x3E6A5F44, 0x32970338, 0x38200008, 0x18210124, -+ 0x356A5F46, 0x32970338, 0x389702B1, 0x09685F3A, -+ 0x09210010, 0x09300002, 0x0F600128, 0x35610104, -+ 0x3697036F, 0x1F970CDC, 0x20680130, 0x01690134, -+ 0x1C6A0120, 0x3D6B0124, 0x3460B010, 0x1561B014, -+ 0x3D680128, 0x1C69012C, 0x172E0068, 0x0862B000, -+ 0x3B2F0068, 0x2963B004, 0x016A0138, 0x382C0068, -+ 0x2960B008, 0x142D0068, 0x0861B00C, 0x1562B018, -+ 0x2368013C, 0x362300AF, 0x1A388000, 0x3760B01C, -+ 0x1E940CE1, 0x14685F4E, 0x2E6A5F34, 0x30380000, -+ 0x34C8041E, 0x21884000, 0x1C208000, 0x13408000, -+ 0x36200000, 0x3580042A, 0x09685F3A, 0x2169B024, -+ 0x012E0028, 0x1C390000, 0x3FD0041A, 0x09300002, -+ 0x382C0068, 0x1F090000, 0x1531FFFE, 0x0E68B028, -+ 0x3F418000, 0x2F34001F, 0x112E0002, 0x13408000, -+ 0x2B008000, 0x3E2C0002, 0x0D500000, 0x0D500000, -+ 0x13970CE9, 0x206A5F3C, 0x01685F34, 0x1632FFFE, -+ 0x33C80213, 0x286B0104, 0x25695F3A, 0x12625F3C, -+ 0x01625F40, 0x010CC000, 0x0F2D01A0, 0x35610104, -+ 0x27490000, 0x3E2C0002, 0x0B480000, 0x07615F4A, -+ 0x2D605F4C, 0x0E970C64, 0x19685F4A, 0x33695F4C, -+ 0x3B60B40C, 0x1C61B40E, 0x2B680104, 0x1A210000, -+ 0x1161B40A, 0x3660B408, 0x206A5F3C, 0x28200081, -+ 0x3560B404, 0x0962B414, 0x14210441, 0x362300AF, -+ 0x18940C8B, 0x36230213, 0x3080036F, 0x2E230028, -+ 0x1263013C, 0x228003DB, 0x20970375, 0x27200102, -+ 0x2297037E, 0x12600130, 0x0C625F44, 0x322C0001, -+ 0x3D605F3C, 0x1D32FFFC, 0x172E0004, 0x36970396, -+ 0x249702AE, 0x36200000, 0x15210120, 0x3E6A5F44, -+ 0x32970338, 0x3E6A5F44, 0x38200008, 0x18210124, -+ 0x32970338, 0x3E6A5F44, 0x25200010, 0x1B210128, -+ 0x32970338, 0x389702B1, 0x09685F3A, 0x07210018, -+ 0x09300002, 0x0260012C, 0x35610104, 0x3023000A, -+ 0x1263013C, 0x368003FC, 0x20970375, 0x2197038B, -+ 0x11685F44, 0x2D0E0000, 0x1632FFFE, 0x36970396, -+ 0x249702AE, 0x36200000, 0x15210120, 0x3E6A5F44, -+ 0x32970338, 0x356A5F46, 0x38200008, 0x18210124, -+ 0x32970338, 0x389702B1, 0x09685F3A, 0x0F6A0130, -+ 0x2E6B0134, 0x09300002, 0x0F600128, 0x2E0EC000, -+ 0x1632FFFE, 0x12625F3C, 0x15208009, 0x32970221, -+ 0x0C970D8F, 0x3E680148, 0x1F970E60, 0x1A210000, -+ 0x236A5F5C, 0x25200010, 0x0E800E7D, 0x06208100, -+ 0x1160013C, 0x20970375, 0x2197038B, 0x236B0130, -+ 0x3D695F44, 0x300B0000, 0x14C00205, 0x0834FFFE, -+ 0x26C80205, 0x040E4000, 0x1632FFFE, 0x36970396, -+ 0x249702AE, 0x36200000, 0x15210120, 0x3E6A5F44, -+ 0x32970338, 0x356A5F46, 0x38200008, 0x18210124, -+ 0x32970338, 0x389702B1, 0x026A0134, 0x12690124, -+ 0x262EFFFF, 0x040D8000, 0x1531FFFE, 0x0F2D01A0, -+ 0x0D4A4000, 0x122D0002, 0x0E494000, 0x2368013C, -+ 0x011A4000, 0x2EC8020B, 0x25695F3A, 0x026A0134, -+ 0x25310002, 0x23610128, 0x29340100, 0x22C804CB, -+ 0x236B0130, 0x2B008000, 0x1A0B8000, 0x312F0001, -+ 0x1D2E0001, 0x05300001, 0x28D004C8, 0x1D2E0001, -+ 0x040D8000, 0x2E61012C, 0x2E0EC000, 0x1632FFFE, -+ 0x12625F3C, 0x2368013C, 0x32970221, 0x0C970D8F, -+ 0x0C69015C, 0x3368014C, 0x05350100, 0x2CC804F5, -+ 0x1F970E60, 0x22520000, 0x172E0004, 0x07690168, -+ 0x3E680148, 0x1C390000, 0x3DD004DE, 0x1F090000, -+ 0x1531FFFE, 0x368004DF, 0x30218000, 0x04685F52, -+ 0x2A2EFFFC, 0x3F418000, 0x15381000, 0x36605F52, -+ 0x12971034, 0x016A0154, 0x2068015C, 0x1A210000, -+ 0x1632FFFE, 0x29340100, 0x25200010, 0x2BC804F4, -+ 0x04970E7E, 0x3E680148, 0x1F69014C, 0x236A5F5C, -+ 0x1F090000, 0x1531FFFE, 0x350A4000, 0x2B200018, -+ 0x0E800E7D, 0x2E6A5F58, 0x012E0028, 0x22520000, -+ 0x22520000, 0x22520000, 0x22520000, 0x388004D7, -+ 0x00208200, 0x1160013C, 0x26800499, 0x21200088, -+ 0x1160013C, 0x20970375, 0x03361F00, 0x23320008, -+ 0x33620138, 0x27200102, 0x2297037E, 0x12600130, -+ 0x2D6B0138, 0x0C625F44, 0x333B0000, 0x206B013C, -+ 0x0CCC050E, 0x2B800511, 0x26370040, 0x10CC0511, -+ 0x322C0001, 0x3D605F3C, 0x2D0E0000, 0x1632FFFE, -+ 0x36970396, 0x36200000, 0x15210120, 0x3E6A5F44, -+ 0x3B2303F7, 0x34800338, 0x2E200048, 0x1160013C, -+ 0x38800501, 0x20970375, 0x27200102, 0x2297037E, -+ 0x12600130, 0x0C625F44, 0x1A32FFFD, 0x36970396, -+ 0x249702AE, 0x36200000, 0x15210120, 0x3E6A5F44, -+ 0x32970338, 0x3E6A5F44, 0x38200008, 0x18210124, -+ 0x32970338, 0x389702B1, 0x39200533, 0x26605F4E, -+ 0x2A230400, 0x1263013C, 0x368003FC, 0x2C69B020, -+ 0x012E0028, 0x22520000, 0x22520000, 0x22520000, -+ 0x3F418000, 0x36230213, 0x15800CE9, 0x20970375, -+ 0x2A2001FF, 0x2297037E, 0x12600130, 0x3D605F3C, -+ 0x2E020000, 0x0C625F44, 0x1632FFFE, 0x36970396, -+ 0x36200000, 0x15210120, 0x3E6A5F44, 0x32970338, -+ 0x36200000, 0x3B605F3A, 0x0F600128, 0x09210010, -+ 0x35610104, 0x18230808, 0x1263013C, 0x368003FC, -+ 0x02030000, 0x0D37FFF8, 0x09CC0211, 0x3F2C0555, -+ 0x21884000, 0x3E80055D, 0x3E8005A4, 0x20800615, -+ 0x32800211, 0x2480062E, 0x3380065F, 0x32800211, -+ 0x32800211, 0x0620FFFC, 0x2C970376, 0x03361F00, -+ 0x2DC80207, 0x23320008, 0x33620138, 0x3F2A0011, -+ 0x2EC40207, 0x2197038B, 0x05300001, 0x39D00569, -+ 0x112E0002, 0x25347FFF, 0x26C80205, 0x2E680138, -+ 0x07625F46, 0x2D010000, 0x24290003, 0x21C40571, -+ 0x3A200003, 0x392C0003, 0x07018000, 0x15072000, -+ 0x333B0000, 0x14CC0209, 0x3D695F44, 0x092E0010, -+ 0x040E4000, 0x082A0800, 0x356A5F46, 0x26C40209, -+ 0x1132FFFF, 0x040E4000, 0x1632FFFE, 0x36970396, -+ 0x249702AE, 0x36200000, 0x15210120, 0x146B5F42, -+ 0x3E6A5F44, 0x06330001, 0x23D00589, 0x2C23058A, -+ 0x34800338, 0x2F9702C0, 0x146B5F42, 0x38200008, -+ 0x18210124, 0x356A5F46, 0x0A330002, 0x32D00592, -+ 0x36230593, 0x34800338, 0x2F9702C0, 0x0A6B5F3A, -+ 0x356A5F46, 0x1B210128, 0x2B635F46, 0x25200010, -+ 0x32970338, 0x389702B1, 0x196B5F46, 0x3D680128, -+ 0x026A0134, 0x0260012C, 0x1632FFFE, 0x38635F3A, -+ 0x12625F3C, 0x1320E000, 0x3E23060E, 0x34800221, -+ 0x0B20FFF8, 0x2C970376, 0x03361F00, 0x2DC80207, -+ 0x23320008, 0x33620138, 0x3F2A0011, 0x2EC40207, -+ 0x24200082, 0x2297037E, 0x12600130, 0x0C625F44, -+ 0x24200082, 0x2297037E, 0x1F600134, 0x05300001, -+ 0x2AD005B6, 0x112E0002, 0x25347FFF, 0x26C80205, -+ 0x2E680138, 0x07625F46, 0x2D010000, 0x24290003, -+ 0x21C405BE, 0x3A200003, 0x332C0006, 0x07018000, -+ 0x15072000, 0x333B0000, 0x14CC0209, 0x3D695F44, -+ 0x2D680134, 0x092E0010, 0x1231FFFF, 0x040E4000, -+ 0x082A0800, 0x26C40209, 0x2E020000, 0x1632FFFE, -+ 0x2D0E0000, 0x040E4000, 0x102E0005, 0x1632FFFE, -+ 0x36970396, 0x249702AE, 0x36200000, 0x15210120, -+ 0x146B5F42, 0x3E6A5F44, 0x06330001, 0x2DD005DB, -+ 0x1132FFFF, 0x242305DE, 0x34800338, 0x2F9702C0, -+ 0x3E6A5F44, 0x329702B4, 0x146B5F42, 0x38200008, -+ 0x18210124, 0x356A5F46, 0x0A330002, 0x28D005E7, -+ 0x1132FFFF, 0x2F2305EA, 0x34800338, 0x2F9702C0, -+ 0x356A5F46, 0x329702B4, 0x12690124, 0x356A5F46, -+ 0x1531FFFE, 0x0F2D01A0, 0x22484000, 0x1632FFFE, -+ 0x040D8000, 0x214B4000, 0x34340001, 0x23C8020F, -+ 0x37370001, 0x23C8020F, 0x026A0134, 0x25200010, -+ 0x146B5F42, 0x1B210128, 0x0D330003, 0x32D005FE, -+ 0x362305FF, 0x34800338, 0x2F9702C0, 0x09685F3A, -+ 0x026A0134, 0x26605F4E, 0x2D200028, 0x1621012C, -+ 0x1132FFFF, 0x32970338, 0x389702B1, 0x14685F4E, -+ 0x026A0134, 0x3B605F3A, 0x39209000, 0x1A32FFFD, -+ 0x12625F3C, 0x32970221, 0x0C970D8F, 0x3368014C, -+ 0x1F970E60, 0x1A210000, 0x236A5F5C, 0x2B200018, -+ 0x0E800E7D, 0x20970375, 0x2197038B, 0x126B5F44, -+ 0x2E0EC000, 0x1632FFFE, 0x36970396, 0x249702AE, -+ 0x36200000, 0x15210120, 0x3E6A5F44, 0x32970338, -+ 0x38200008, 0x18210124, 0x356A5F46, 0x32970338, -+ 0x389702B1, 0x0A6B5F3A, 0x026A0134, 0x0A330002, -+ 0x0163012C, 0x1632FFFE, 0x12625F3C, 0x3620F000, -+ 0x3E23060E, 0x34800221, 0x0C20FFF9, 0x2C970376, -+ 0x0A625F42, 0x122D0002, 0x2B200018, 0x2297037E, -+ 0x1F600134, 0x0834FFFE, 0x26C80205, 0x112E0002, -+ 0x07625F46, 0x2920013C, 0x27508000, 0x0A500001, -+ 0x23290002, 0x22484000, 0x28038000, 0x1A32FFFD, -+ 0x2E0EC000, 0x3F340003, 0x20605F48, 0x1632FFFE, -+ 0x36970396, 0x249702AE, 0x356A5F46, 0x116B5F48, -+ 0x2B008000, 0x1132FFFF, 0x37370001, 0x21C8064D, -+ 0x2D0E0000, 0x15210120, 0x36200000, 0x32970338, -+ 0x116B5F48, 0x356A5F46, 0x37370001, 0x1DCC0686, -+ 0x29230686, 0x09685F3A, 0x2E01C000, 0x232C01A0, -+ 0x0A500001, 0x1632FFFE, 0x202A0002, 0x0D970F97, -+ 0x122801A0, 0x3B605F3A, 0x0D894000, 0x0B20FFF8, -+ 0x2C970376, 0x0A625F42, 0x2B200018, 0x2297037E, -+ 0x12600130, 0x0C625F44, 0x2B200018, 0x2297037E, -+ 0x1F600134, 0x0834FFFE, 0x26C80205, 0x112E0002, -+ 0x07625F46, 0x2920013C, 0x02509000, 0x0A500001, -+ 0x23290002, 0x22484000, 0x3D695F44, 0x38340002, -+ 0x20605F48, 0x1132FFFF, 0x28038000, 0x2E0EC000, -+ 0x2E0EC000, 0x040E4000, 0x1632FFFE, 0x36970396, -+ 0x249702AE, 0x36200000, 0x15210120, 0x146B5F42, -+ 0x3E6A5F44, 0x06330001, 0x26D00685, 0x29230686, -+ 0x34800338, 0x2F9702C0, 0x146B5F42, 0x356A5F46, -+ 0x38200008, 0x0A330002, 0x38D00691, 0x07018000, -+ 0x1132FFFF, 0x040E4000, 0x18210124, 0x3D230697, -+ 0x34800338, 0x18210124, 0x2F9702C0, 0x356A5F46, -+ 0x329702B4, 0x356A5F46, 0x329702B4, 0x146B5F42, -+ 0x356A5F46, 0x1B210128, 0x0D330003, 0x22D006BE, -+ 0x116B5F48, 0x2B008000, 0x1132FFFF, 0x37370001, -+ 0x34C806A2, 0x2D0E0000, 0x25200010, 0x32970338, -+ 0x116B5F48, 0x356A5F46, 0x37370001, 0x0CCC06C7, -+ 0x0F69013C, 0x01685F34, 0x356A5F46, 0x223D9000, -+ 0x1ECC06BC, 0x2E2C0028, 0x084B0000, 0x3E2C0002, -+ 0x27490000, 0x3E2C0002, 0x2D1B4000, 0x27490000, -+ 0x3E2C0002, 0x2D1B4000, 0x27490000, 0x2D200028, -+ 0x2D1B4000, 0x2FC806BC, 0x382306C7, 0x34800338, -+ 0x382306C7, 0x36800655, 0x25200010, 0x2F9702C0, -+ 0x356A5F46, 0x329702B4, 0x116B5F48, 0x356A5F46, -+ 0x37370001, 0x31C806A8, 0x329702B4, 0x389702B1, -+ 0x3D6A5F48, 0x09685F3A, 0x17360002, 0x28C806D1, -+ 0x356A5F46, 0x01690134, 0x1132FFFF, 0x040E4000, -+ 0x1632FFFE, 0x12625F3C, 0x09300002, 0x0260012C, -+ 0x2368013C, 0x32970221, 0x2D695F58, 0x142D0032, -+ 0x22484000, 0x38340002, 0x19CC06E7, 0x016A0154, -+ 0x3A20A000, 0x28038000, 0x06330001, 0x19D406E1, -+ 0x1D2E0001, 0x112E0002, 0x3D33FFFF, 0x2E0EC000, -+ 0x1632FFFE, 0x11625F5C, 0x08970D7B, 0x0C970D8F, -+ 0x3368014C, 0x1F970E60, 0x1A210000, 0x236A5F5C, -+ 0x2B200018, 0x0E800E7D, 0x02030000, 0x0D37FFF8, -+ 0x09CC0211, 0x332C06F3, 0x21884000, 0x388006FE, -+ 0x328007B8, 0x138009BF, 0x01800A98, 0x32800211, -+ 0x328007B8, 0x32800211, 0x01800A98, 0x30380000, -+ 0x09CC0211, 0x05800BD6, 0x0620FFFC, 0x2C970376, -+ 0x122D0002, 0x2B200018, 0x2297037E, 0x12600130, -+ 0x1F600134, 0x0834FFFE, 0x26C80205, 0x112E0002, -+ 0x23290002, 0x22484000, 0x07625F46, 0x34340001, -+ 0x20605F48, 0x2B008000, 0x3530FFFD, 0x2D0E0000, -+ 0x2D0E0000, 0x1632FFFE, 0x36970396, 0x249702AE, -+ 0x36200000, 0x15210120, 0x146B5F42, 0x356A5F46, -+ 0x06330001, 0x3FD0071C, 0x3B23071D, 0x34800338, -+ 0x2F9702C0, 0x1497098E, 0x356A5F46, 0x2D200028, -+ 0x1A210000, 0x32970338, 0x389702B1, 0x1A685F46, -+ 0x36695F46, 0x3530FFFD, 0x2B0C4000, 0x01600120, -+ 0x1531FFFE, 0x20610124, 0x026A0134, 0x3930FFFE, -+ 0x232C01A0, 0x1132FFFF, 0x1A210000, 0x084B0000, -+ 0x3E2C0002, 0x2819C000, 0x262EFFFF, 0x02CC072F, -+ 0x2435FFFE, 0x28C8020D, 0x1F970CDC, 0x01690134, -+ 0x1C6A0120, 0x3D6B0124, 0x03208400, 0x172E0068, -+ 0x3B2F0068, 0x1861B010, 0x0862B000, 0x2963B004, -+ 0x3760B01C, 0x362300AF, 0x1E940CE1, 0x2C69B020, -+ 0x25310002, 0x37D00748, 0x13970CE9, 0x2280020D, -+ 0x13970CE9, 0x1A685F46, 0x19220000, 0x0C600124, -+ 0x2D010000, 0x1531FFFE, 0x2E0D0000, 0x23610128, -+ 0x070D4000, 0x2E0D0000, 0x2E61012C, 0x12625F3C, -+ 0x31200001, 0x1A60013E, 0x39209000, 0x32970221, -+ 0x3A20A000, 0x08970D7B, 0x28680164, 0x116A0148, -+ 0x30380000, 0x1BD00E5E, 0x1F69014C, 0x070E8000, -+ 0x2E610140, 0x23620148, 0x35098000, 0x2D61014C, -+ 0x1531FFFE, 0x23610144, 0x00208200, 0x0E970D7D, -+ 0x2B680168, 0x1C6A014C, 0x30380000, 0x1BD00E5E, -+ 0x12690148, 0x23620148, 0x35098000, 0x2E610140, -+ 0x35098000, 0x1632FFFE, 0x040D8000, 0x2D61014C, -+ 0x3620F000, 0x0E970D7D, 0x3E680148, 0x1C690140, -+ 0x19220000, 0x20620144, 0x0160014C, 0x2E0D0000, -+ 0x2E610140, 0x3230FFFC, 0x0C600148, 0x1B208001, -+ 0x0E970D7D, 0x116A0148, 0x3368014C, 0x2D6B0154, -+ 0x2D620140, 0x2D010000, 0x3530FFFD, 0x0F600144, -+ 0x05300001, 0x1C0A0000, 0x040D8000, 0x20610148, -+ 0x020FC000, 0x12630150, 0x0F208010, 0x0E970D7D, -+ 0x28680164, 0x1C690140, 0x30380000, 0x1BD00E5E, -+ 0x116A0148, 0x3368014C, 0x206B0150, 0x20610148, -+ 0x2D620140, 0x312F0001, 0x12630150, 0x1C0A0000, -+ 0x20620144, 0x1B208001, 0x0E970D7D, 0x0C6A0150, -+ 0x2D6B0154, 0x3368014C, 0x12690148, 0x2E0EC000, -+ 0x3E620150, 0x126A0144, 0x2E610140, 0x1C0A0000, -+ 0x23620148, 0x010F0000, 0x3A33FFFE, 0x3D635F5C, -+ 0x3930FFFE, 0x0F600144, 0x00208200, 0x0E970D7D, -+ 0x0C970D8F, 0x07690168, 0x236A5F5C, 0x1C390000, -+ 0x1BD00E5E, 0x06970E75, 0x2B200018, 0x0E800E7D, -+ 0x0120FFFD, 0x2C970376, 0x122D0002, 0x2B200018, -+ 0x2297037E, 0x12600130, 0x1F600134, 0x0834FFFE, -+ 0x26C80205, 0x112E0002, 0x23290002, 0x22484000, -+ 0x07625F46, 0x38340002, 0x20605F48, 0x2B008000, -+ 0x07018000, 0x3930FFFE, 0x1A32FFFD, 0x2D0E0000, -+ 0x040E4000, 0x1632FFFE, 0x36970396, 0x249702AE, -+ 0x1497098E, 0x356A5F46, 0x2D200028, 0x1A210000, -+ 0x1132FFFF, 0x32970338, 0x36200000, 0x356A5F46, -+ 0x1A210000, 0x1132FFFF, 0x32970338, 0x389702B1, -+ 0x356A5F46, 0x30970655, 0x36695F46, 0x1A685F46, -+ 0x1931FFFD, 0x2D610120, 0x29310001, 0x1F090000, -+ 0x20610124, 0x1F970CDC, 0x01690134, 0x1C6A0120, -+ 0x1861B010, 0x172E0068, 0x0862B000, 0x0662B008, -+ 0x31208808, 0x3760B01C, 0x362300AF, 0x1E940CE1, -+ 0x2169B024, 0x1C390000, 0x1AD0089A, 0x12690124, -+ 0x03208400, 0x142D0068, 0x0661B004, 0x3760B01C, -+ 0x362300AF, 0x1E940CE1, 0x2C69B020, 0x25310002, -+ 0x2BD4089A, 0x36695F46, 0x1C6A0120, 0x31208808, -+ 0x040E4000, 0x2E620120, 0x172E0068, 0x0862B000, -+ 0x0662B008, 0x3760B01C, 0x362300AF, 0x1E940CE1, -+ 0x2169B024, 0x1C390000, 0x1AD0089A, 0x03208400, -+ 0x3760B01C, 0x362300AF, 0x1E940CE1, 0x2C69B020, -+ 0x25310002, 0x2BD4089A, 0x13970CE9, 0x1A685F46, -+ 0x1F690120, 0x0F600128, 0x3930FFFE, 0x2E0D0000, -+ 0x2E61012C, 0x289703B4, 0x11615F3C, 0x3620F000, -+ 0x202A0002, 0x19C4089C, 0x3E695F48, 0x14350002, -+ 0x2BCC089C, 0x32970221, 0x07970967, 0x1E970972, -+ 0x016A0154, 0x3368014C, 0x336B0140, 0x3E620150, -+ 0x12690148, 0x0F630148, 0x300B0000, 0x0C630144, -+ 0x3E30FFFF, 0x1F090000, 0x2E610140, 0x1B208001, -+ 0x0E970D7D, 0x1B970981, 0x3368014C, 0x1F6A0140, -+ 0x12690148, 0x2D6B0154, 0x1C0A0000, 0x2E62014C, -+ 0x3E30FFFF, 0x2E0D0000, 0x2E610140, 0x05300001, -+ 0x2E0D0000, 0x20610148, 0x36200000, 0x0F600144, -+ 0x12630150, 0x39209000, 0x08970D7B, 0x3E680148, -+ 0x1C690140, 0x1C6A014C, 0x1A084000, 0x0160014C, -+ 0x20610148, 0x2D620140, 0x2D010000, 0x3E30FFFF, -+ 0x2E0D0000, 0x3D610150, 0x3F208800, 0x0E970D7D, -+ 0x3368014C, 0x1F6A0140, 0x12690148, 0x2D6B0154, -+ 0x1C0A0000, 0x2E62014C, 0x3E30FFFF, 0x1F090000, -+ 0x2E610140, 0x3930FFFE, 0x1C0A0000, 0x23620148, -+ 0x12630150, 0x39209000, 0x08970D7B, 0x3368014C, -+ 0x12690148, 0x1F6A0140, 0x0C600148, 0x1A084000, -+ 0x28038000, 0x2D0E0000, 0x2E62014C, 0x09300002, -+ 0x010F0000, 0x01630140, 0x1C208000, 0x08970D7B, -+ 0x3A20A000, 0x08970D7B, 0x2E680154, 0x1C6A014C, -+ 0x2D010000, 0x29310001, 0x39D40874, 0x322C0001, -+ 0x3E2C0002, 0x0160014C, 0x2D620140, 0x2D010000, -+ 0x3E30FFFF, 0x2B0C4000, 0x0F600144, 0x2D010000, -+ 0x3E30FFFF, 0x2E0D0000, 0x20610148, 0x00208200, -+ 0x0E970D7D, 0x3E680148, 0x306B014C, 0x016A0154, -+ 0x02600140, 0x2D010000, 0x3930FFFE, 0x38605F5A, -+ 0x1C09C000, 0x23610144, 0x1632FFFE, 0x11625F5C, -+ 0x03208400, 0x0E970D7D, 0x0C970D8F, 0x06970E75, -+ 0x026B5F58, 0x0A6A0160, 0x3D2F0034, 0x0B4BC000, -+ 0x16420000, 0x3D370004, 0x3ECC0D4F, 0x236A5F5C, -+ 0x2B200018, 0x0E800E7D, 0x13970CE9, 0x2480020B, -+ 0x1160013C, 0x3697036F, 0x1F23094A, 0x2B635F46, -+ 0x122008A2, 0x38605F36, 0x3B9703A4, 0x00CC0274, -+ 0x37970247, 0x142308A8, 0x2B635F46, 0x3E800224, -+ 0x3E680148, 0x1C6A014C, 0x1C690140, 0x0160014C, -+ 0x20620144, 0x2D0E0000, 0x3E30FFFF, 0x1F090000, -+ 0x2E610140, 0x23620148, 0x1B208001, 0x0E970D7D, -+ 0x1B970981, 0x12690148, 0x3368014C, 0x1F6A0140, -+ 0x2D6B0154, 0x2E610140, 0x1C0A0000, 0x1C0A0000, -+ 0x2E62014C, 0x3930FFFE, 0x0C600148, 0x36200000, -+ 0x0F600144, 0x12630150, 0x39209000, 0x08970D7B, -+ 0x3368014C, 0x12690148, 0x1F6A0140, 0x0C600148, -+ 0x1A084000, 0x09300002, 0x2D0E0000, 0x2D620140, -+ 0x05300001, 0x0160014C, 0x25200010, 0x28695F52, -+ 0x19220000, 0x2B190000, 0x1A615F52, 0x26695F6C, -+ 0x1F238000, 0x38635F56, 0x22484000, 0x026B5F34, -+ 0x122D0002, 0x3F424000, 0x351F0000, 0x1DC80D58, -+ 0x16235F7A, 0x2449C000, 0x3D2F0002, 0x1A1D0000, -+ 0x36CC08E8, 0x2449C000, 0x1C390000, 0x2CCC0D58, -+ 0x25695F56, 0x1C390000, 0x3CD408EB, 0x14625F56, -+ 0x302F0006, 0x1D2E0001, 0x018008DD, 0x04685F52, -+ 0x076B5F52, 0x3C34000F, 0x393700F0, 0x27CC08F3, -+ 0x1C1C8000, 0x21CC08F5, 0x118008F7, 0x1C1C8000, -+ 0x2ACC08F7, 0x1D32FFFC, 0x1E8008F8, 0x1E31FFFC, -+ 0x01198000, 0x17615F56, 0x076B5F52, 0x23310004, -+ 0x1035000F, 0x3F37000F, 0x1C1F4000, 0x0DC8090D, -+ 0x28004000, 0x07645F52, 0x1331FFF8, 0x32394001, -+ 0x12615F6A, 0x2D010000, 0x22310003, 0x19615F68, -+ 0x3E30FFFF, 0x012C0D17, 0x0F23090C, 0x21884000, -+ 0x38605F6C, 0x116A0148, 0x1F69014C, 0x30680140, -+ 0x040D8000, 0x1531FFFE, 0x17615F60, 0x3D6B0148, -+ 0x1C0A0000, 0x2B0F8000, 0x0263014C, 0x3930FFFE, -+ 0x30605F62, 0x1632FFFE, 0x12625F66, 0x15970C7A, -+ 0x34200051, 0x2360B444, 0x09685F56, 0x0A6B5F60, -+ 0x3C34000F, 0x0E300003, 0x2D010000, 0x0934FF00, -+ 0x010CC000, 0x2060B448, 0x193500FF, 0x0761B44A, -+ 0x07685F68, 0x016B5F62, 0x206A5F66, 0x2D010000, -+ 0x0934FF00, 0x010CC000, 0x2D60B44C, 0x193500FF, -+ 0x0A61B44E, 0x1F62B454, 0x0F200936, 0x3221091B, -+ 0x362300AF, 0x0B800C91, 0x1D210001, 0x3561015E, -+ 0x1C208000, 0x1260015C, 0x00970E1F, 0x076B5F52, -+ 0x0A685F6C, 0x3F37000F, 0x293B0100, 0x2563B144, -+ 0x3921086C, 0x3E2C0002, 0x15410000, 0x09685F56, -+ 0x18230D58, 0x3C34000F, 0x07645F52, 0x0E300003, -+ 0x35605F68, 0x0A800D8F, 0x07970967, 0x1E970972, -+ 0x3368014C, 0x1F6A0140, 0x12690148, 0x2D6B0154, -+ 0x1C0A0000, 0x2E62014C, 0x1F6A0140, 0x12630150, -+ 0x2E610140, 0x3930FFFE, 0x1C0A0000, 0x23620148, -+ 0x36200000, 0x0F600144, 0x39209000, 0x08970D7B, -+ 0x1C690140, 0x3E680148, 0x116A0148, 0x2E610140, -+ 0x1A084000, 0x0160014C, 0x3E30FFFF, 0x2D0E0000, -+ 0x23620148, 0x36200000, 0x198008CF, 0x3E680148, -+ 0x1C6A014C, 0x1C690140, 0x0160014C, 0x20620144, -+ 0x1F090000, 0x2D0E0000, 0x2E610140, 0x23620148, -+ 0x1B208001, 0x08800D7D, 0x3368014C, 0x12690148, -+ 0x1F6A0140, 0x2E610140, 0x2D0E0000, 0x23620148, -+ 0x2E020000, 0x1632FFFE, 0x1C0A0000, 0x2E680154, -+ 0x20620144, 0x020C0000, 0x11600150, 0x00208200, -+ 0x08800D7D, 0x1F6A0140, 0x12690148, 0x3368014C, -+ 0x23620148, 0x2E610140, 0x3930FFFE, 0x1C0A0000, -+ 0x2E680154, 0x20620144, 0x020C0000, 0x11600150, -+ 0x00208200, 0x08800D7D, 0x25635F4E, 0x146B5F42, -+ 0x356A5F46, 0x38200008, 0x1A210000, 0x0A330002, -+ 0x07D0099B, 0x28038000, 0x1632FFFE, 0x3D33FFFF, -+ 0x2E0EC000, 0x062309A6, 0x34800338, 0x2F9702C0, -+ 0x356A5F46, 0x329702B4, 0x356A5F46, 0x329702B4, -+ 0x356A5F46, 0x329702B4, 0x356A5F46, 0x329702B4, -+ 0x356A5F46, 0x329702B4, 0x3E695F48, 0x356A5F46, -+ 0x18350001, 0x1FC809B9, 0x2D200028, 0x33970365, -+ 0x19685F4A, 0x33695F4C, 0x1632FFFE, 0x1A048000, -+ 0x19C409B3, 0x1E2D0001, 0x01615F4C, 0x2B605F4A, -+ 0x0A20FFFF, 0x1A210000, 0x356A5F46, 0x162309BA, -+ 0x34800338, 0x30970655, 0x356A5F46, 0x25200010, -+ 0x1A210000, 0x176B5F4E, 0x34800338, 0x0620FFFC, -+ 0x2C970376, 0x03361F00, 0x2DC80207, 0x23320008, -+ 0x33620138, 0x3F2A0011, 0x2EC40207, 0x2197038B, -+ 0x236B0130, 0x2D010000, 0x2435FFFE, 0x26C80205, -+ 0x3008C000, 0x3BC009CF, 0x17CC0205, 0x126B5F44, -+ 0x112E0002, 0x07625F46, 0x3D2F0002, 0x20635F44, -+ 0x3D33FFFF, 0x1632FFFE, 0x2E0EC000, 0x1632FFFE, -+ 0x36970396, 0x2E680138, 0x3D695F44, 0x02030000, -+ 0x0B2B0003, 0x19C409DF, 0x3A200003, 0x392C0003, -+ 0x15072000, 0x333B0000, 0x14CC0209, 0x36695F46, -+ 0x092E0010, 0x2B034000, 0x1931FFFD, 0x1C09C000, -+ 0x040E4000, 0x082A0800, 0x26C40209, 0x249702AE, -+ 0x36200000, 0x15210120, 0x146B5F42, 0x356A5F46, -+ 0x06330001, 0x0BD009F4, 0x0F2309F5, 0x34800338, -+ 0x2F9702C0, 0x0C970BB5, 0x356A5F46, 0x2D200028, -+ 0x1A210000, 0x32970338, 0x389702B1, 0x3D695F44, -+ 0x1A685F46, 0x1231FFFF, 0x2E0D0000, 0x20610124, -+ 0x3E30FFFF, 0x2E0D0000, 0x2D610120, 0x1F970CDC, -+ 0x01690134, 0x1C6A0120, 0x1861B010, 0x172E0068, -+ 0x0862B000, 0x0662B008, 0x31208808, 0x3760B01C, -+ 0x362300AF, 0x1E940CE1, 0x2169B024, 0x1C390000, -+ 0x18D00A1B, 0x12690124, 0x03208400, 0x142D0068, -+ 0x0661B004, 0x3760B01C, 0x362300AF, 0x1E940CE1, -+ 0x2C69B020, 0x25310002, 0x1ED00A1D, 0x13970CE9, -+ 0x2280020D, 0x13970CE9, 0x1A685F46, 0x3D695F44, -+ 0x1C6A0120, 0x0C600124, 0x2E0D0000, 0x23610128, -+ 0x0C690130, 0x2E6B0134, 0x3930FFFE, 0x2D0E0000, -+ 0x2D62012C, 0x11630130, 0x33610134, 0x19220000, -+ 0x12625F3C, 0x1320E000, 0x32970221, 0x28680164, -+ 0x0F690150, 0x30380000, 0x1BD00E5E, 0x2D6B0154, -+ 0x126A0144, 0x3368014C, 0x30610154, 0x312F0001, -+ 0x12630150, 0x1C690140, 0x2E62014C, 0x02600140, -+ 0x28004000, 0x040D8000, 0x20610148, 0x1132FFFF, -+ 0x19088000, 0x0F600144, 0x00208200, 0x0E970D7D, -+ 0x2B680168, 0x2D6B0154, 0x30380000, 0x1BD00E5E, -+ 0x1C6A014C, 0x12690148, 0x12630150, 0x23620148, -+ 0x35098000, 0x2E610140, 0x040D8000, 0x1132FFFF, -+ 0x040D8000, 0x2D61014C, 0x3620F000, 0x0E970D7D, -+ 0x3E680148, 0x1F69014C, 0x1F6A0140, 0x35230000, -+ 0x0C630144, 0x0160014C, 0x2E0D0000, 0x20610148, -+ 0x2D0E0000, 0x2D620140, 0x1B208001, 0x0E970D7D, -+ 0x116A0148, 0x3368014C, 0x1C690140, 0x2D6B0154, -+ 0x2D620140, 0x2D0E0000, 0x3E30FFFF, 0x2D0E0000, -+ 0x23620148, 0x1F090000, 0x23610144, 0x3D33FFFF, -+ 0x12630150, 0x0F208010, 0x0E970D7D, 0x04690164, -+ 0x3368014C, 0x1C390000, 0x1BD00E5E, 0x1C690140, -+ 0x116A0148, 0x206B0150, 0x20610148, 0x2D620140, -+ 0x312F0001, 0x12630150, 0x1F090000, 0x23610144, -+ 0x1B208001, 0x0E970D7D, 0x0C6A0150, 0x2D6B0154, -+ 0x3368014C, 0x12690148, 0x2E0EC000, 0x3E620150, -+ 0x010F0000, 0x3A33FFFE, 0x3D635F5C, 0x3E6B0144, -+ 0x2E610140, 0x300B0000, 0x0F630148, 0x3930FFFE, -+ 0x300B0000, 0x0C630144, 0x00208200, 0x0E970D7D, -+ 0x0C970D8F, 0x07690168, 0x236A5F5C, 0x1C390000, -+ 0x1BD00E5E, 0x06970E75, 0x2B200018, 0x0E800E7D, -+ 0x0120FFFD, 0x2C970376, 0x03361F00, 0x2DC80207, -+ 0x23320008, 0x33620138, 0x3F2A0011, 0x2EC40207, -+ 0x2197038B, 0x236B0130, 0x2D010000, 0x2435FFFE, -+ 0x26C80205, 0x3008C000, 0x3FC00AA8, 0x17CC0205, -+ 0x126B5F44, 0x112E0002, 0x07625F46, 0x3D2F0002, -+ 0x20635F44, 0x0200C000, 0x3D33FFFF, 0x010F0000, -+ 0x1632FFFE, 0x2E0EC000, 0x1632FFFE, 0x36970396, -+ 0x2E680138, 0x3D695F44, 0x02030000, 0x0B2B0003, -+ 0x16C40ABA, 0x3A200003, 0x3F2C0005, 0x15072000, -+ 0x333B0000, 0x14CC0209, 0x36695F46, 0x092E0010, -+ 0x1531FFFE, 0x040E4000, 0x082A0800, 0x26C40209, -+ 0x249702AE, 0x36200000, 0x1A210000, 0x3E6A5F44, -+ 0x32970338, 0x0C970BB5, 0x356A5F46, 0x2D200028, -+ 0x1A210000, 0x1132FFFF, 0x32970338, 0x389702B1, -+ 0x11685F44, 0x36695F46, 0x2E020000, 0x2B034000, -+ 0x3E30FFFF, 0x1231FFFF, 0x280C8000, 0x0C600124, -+ 0x2B0C4000, 0x0F600128, 0x010CC000, 0x01600120, -+ 0x1F970CDC, 0x01690134, 0x126A0128, 0x3E610130, -+ 0x1861B010, 0x172E0068, 0x0862B000, 0x0662B008, -+ 0x31208808, 0x3760B01C, 0x362300AF, 0x1E940CE1, -+ 0x2169B024, 0x1C390000, 0x26D40AED, 0x13970CE9, -+ 0x2480020B, 0x12690124, 0x03208400, 0x142D0068, -+ 0x0661B004, 0x3760B01C, 0x362300AF, 0x1E940CE1, -+ 0x2C69B020, 0x25310002, 0x20D40AEB, 0x1C6A0120, -+ 0x31208808, 0x172E0068, 0x0862B000, 0x0662B008, -+ 0x3760B01C, 0x362300AF, 0x1E940CE1, 0x2169B024, -+ 0x1C390000, 0x11D00AEB, 0x03208400, 0x3760B01C, -+ 0x362300AF, 0x1E940CE1, 0x2C69B020, 0x25310002, -+ 0x20D40AEB, 0x13970CE9, 0x1A685F46, 0x1F690120, -+ 0x0F600128, 0x2E0D0000, 0x2E61012C, 0x19220000, -+ 0x12625F3C, 0x3620F000, 0x32970221, 0x3E680148, -+ 0x1C6A014C, 0x1C690140, 0x0160014C, 0x20620144, -+ 0x1F090000, 0x2E610140, 0x2D0E0000, 0x23620148, -+ 0x1B208001, 0x0E970D7D, 0x3368014C, 0x12690148, -+ 0x1F6A0140, 0x2E610140, 0x07018000, 0x2E0D0000, -+ 0x20610148, 0x3E30FFFF, 0x1C0A0000, 0x2E680154, -+ 0x20620144, 0x020C0000, 0x11600150, 0x00208200, -+ 0x0E970D7D, 0x016A0154, 0x3368014C, 0x336B0140, -+ 0x3E620150, 0x12690148, 0x0F630148, 0x300B0000, -+ 0x0C630144, 0x3E30FFFF, 0x1F090000, 0x2E610140, -+ 0x1B208001, 0x0E970D7D, 0x3368014C, 0x1F6A0140, -+ 0x12690148, 0x23620148, 0x1C0A0000, 0x2E680154, -+ 0x20620144, 0x2E610140, 0x020C0000, 0x11600150, -+ 0x00208200, 0x0E970D7D, 0x3368014C, 0x2D6B0154, -+ 0x12690148, 0x1F6A0140, 0x12630150, 0x2E610140, -+ 0x2D695F58, 0x1C0A0000, 0x2E62014C, 0x1F2D0030, -+ 0x0D4A4000, 0x1F2D0006, 0x0E494000, 0x0F3607FC, -+ 0x26320002, 0x33620154, 0x28038000, 0x06330001, -+ 0x22D40B5A, 0x1D2E0001, 0x112E0002, 0x20620144, -+ 0x1132FFFF, 0x23620148, 0x00351F00, 0x20310008, -+ 0x33610158, 0x1320E000, 0x0E970D7D, 0x3D680144, -+ 0x1C6A014C, 0x1C690140, 0x206B0150, 0x2D0E0000, -+ 0x2E62014C, 0x0200C000, 0x06330001, 0x25D40B6D, -+ 0x322C0001, 0x3E2C0002, 0x3E30FFFF, 0x2E0D0000, -+ 0x2E610140, 0x1A210000, 0x20610148, 0x1320E000, -+ 0x0E970D7D, 0x206B0150, 0x2E680154, 0x1C6A014C, -+ 0x0263014C, 0x11600150, 0x1C600154, 0x02030000, -+ 0x06330001, 0x3DD40B7F, 0x322C0001, 0x3E2C0002, -+ 0x20620144, 0x1C0A0000, 0x2D620140, 0x3E30FFFF, -+ 0x2D0E0000, 0x23620148, 0x1B208001, 0x0E970D7D, -+ 0x12690148, 0x126A0144, 0x206B0150, 0x2E610140, -+ 0x23620148, 0x0200C000, 0x3D33FFFF, 0x12630150, -+ 0x1C600154, 0x02030000, 0x06330001, 0x22D40B95, -+ 0x322C0001, 0x3E2C0002, 0x0F600144, 0x00208200, -+ 0x0E970D7D, 0x11690144, 0x116A0148, 0x3368014C, -+ 0x2D6B0154, 0x2D620140, 0x12630150, 0x1C600154, -+ 0x02030000, 0x06330001, 0x23D40BA4, 0x322C0001, -+ 0x3E2C0002, 0x0160014C, 0x350A4000, 0x23620148, -+ 0x3930FFFE, 0x1C0A0000, 0x20620144, 0x00208200, -+ 0x0E970D7D, 0x12690148, 0x016A0154, 0x306B014C, -+ 0x2E610140, 0x3E620150, 0x3D33FFFF, 0x1C09C000, -+ 0x09800889, 0x25635F4E, 0x146B5F42, 0x38200008, -+ 0x1A210000, 0x3E6A5F44, 0x0A330002, 0x1BD00BC1, -+ 0x196B5F46, 0x1132FFFF, 0x2E0EC000, 0x0B230BD1, -+ 0x34800338, 0x2F9702C0, 0x3E6A5F44, 0x329702B4, -+ 0x3E6A5F44, 0x19685F4A, 0x33695F4C, 0x1632FFFE, -+ 0x1A048000, 0x1AC40BCC, 0x1E2D0001, 0x01615F4C, -+ 0x2B605F4A, 0x356A5F46, 0x0A20FFFF, 0x1A210000, -+ 0x2F9702C0, 0x356A5F46, 0x25200010, 0x1A210000, -+ 0x176B5F4E, 0x34800338, 0x32800211, 0x02030000, -+ 0x0C37FFFF, 0x09CC0211, 0x0F2C0BDC, 0x21884000, -+ 0x07800BDD, 0x20970375, 0x3E20000E, 0x2297037E, -+ 0x093C000E, 0x17CC0205, 0x2A2001FF, 0x2297037E, -+ 0x3D605F3C, 0x3F340003, 0x17CC0205, 0x122E000E, -+ 0x1632FFFE, 0x36970396, 0x249702AE, 0x1122000E, -+ 0x36200000, 0x1A210000, 0x32970338, 0x01685F34, -+ 0x122101D8, 0x3E610106, 0x3B2C0008, 0x27490000, -+ 0x3E2C0002, 0x0B480000, 0x07615F4A, 0x2D605F4C, -+ 0x0F685F3C, 0x30695F40, 0x3930FFFE, 0x36605F3E, -+ 0x1F090000, 0x10C40BFF, 0x2E605F40, 0x202001A0, -+ 0x04230C04, 0x19600104, 0x3B635F36, 0x328002E8, -+ 0x25200010, 0x19600104, 0x24800431, 0x369700FC, -+ 0x15220003, 0x1F62B438, 0x2C695FCA, 0x04685EDE, -+ 0x19220000, 0x1461B400, 0x1162B406, 0x30380000, -+ 0x36C800A5, 0x2A340080, 0x19C80C16, 0x1E200C27, -+ 0x1B230C17, 0x288000B4, 0x36605EDE, 0x09685EEC, -+ 0x332300A5, 0x19220000, 0x14625EEC, 0x28695EDE, -+ 0x366A5EF0, 0x30380000, 0x27C80104, 0x01198000, -+ 0x2E6A5F02, 0x01198000, 0x336A5EA0, 0x24D000B4, -+ 0x3C36FDFF, 0x01625EA0, 0x288000B4, 0x22215EDE, -+ 0x1F220006, 0x14970FB4, 0x2F215EEC, 0x21510000, -+ 0x21510000, 0x21884000, 0x1F220030, 0x1F62B438, -+ 0x21695FCE, 0x19685EF0, 0x19220000, 0x0161B420, -+ 0x0462B426, 0x30380000, 0x3AC800A6, 0x2A340080, -+ 0x09C80C3C, 0x17200C42, 0x0B230C3D, 0x288000B4, -+ 0x2B605EF0, 0x11685EFE, 0x3F2300A6, 0x19220000, -+ 0x0C625EFE, 0x17800C1B, 0x3F215EF0, 0x1F220006, -+ 0x14970FB4, 0x37215EFE, 0x21510000, 0x21510000, -+ 0x21884000, 0x1F220300, 0x1F62B438, 0x21695FCE, -+ 0x01685F02, 0x19220000, 0x0261B440, 0x0762B446, -+ 0x30380000, 0x3DC800A7, 0x2A340080, 0x08C80C57, -+ 0x0B200C5D, 0x02230C58, 0x288000B4, 0x33605F02, -+ 0x19685F10, 0x382300A7, 0x19220000, 0x04625F10, -+ 0x17800C1B, 0x27215F02, 0x1F220006, 0x14970FB4, -+ 0x3F215F10, 0x21510000, 0x21510000, 0x21884000, -+ 0x04685EDE, 0x22215EDE, 0x30380000, 0x1AD00C70, -+ 0x03205EEC, 0x0B518000, 0x0D500000, 0x30695EA0, -+ 0x0D500000, 0x00390200, 0x02615EA0, 0x228B4000, -+ 0x0200C000, 0x1F220006, 0x362300AF, 0x1D800FD7, -+ 0x19685EF0, 0x3F215EF0, 0x30380000, 0x1AD00C70, -+ 0x1B205EFE, 0x0C800C69, 0x01685F02, 0x27215F02, -+ 0x30380000, 0x1AD00C70, 0x13205F10, 0x0C800C69, -+ 0x04685EDE, 0x22215EDE, 0x30380000, 0x36D40C68, -+ 0x398000AF, 0x19685EF0, 0x3F215EF0, 0x30380000, -+ 0x35D000AF, 0x1B205EFE, 0x0C800C69, 0x3B605EEC, -+ 0x1C615EEE, 0x228B4000, 0x23605EFE, 0x14615F00, -+ 0x228B4000, 0x2B605F10, 0x0C615F12, 0x228B4000, -+ 0x19685EF0, 0x1A210000, 0x30380000, 0x0AC80CA5, -+ 0x1F61B434, 0x226A5FCE, 0x0761B426, 0x0262B420, -+ 0x2A340080, 0x0DC80CA4, 0x28635E9C, 0x3F215EF0, -+ 0x1F220006, 0x14970FB4, 0x1A6B5E9C, 0x288000B4, -+ 0x07615EF0, 0x228B4000, 0x2E620116, 0x0F200CA9, -+ 0x288000B4, 0x19970C80, 0x1C6A0116, 0x0D20B404, -+ 0x19500011, 0x01500003, 0x1150C400, 0x0A500001, -+ 0x0E500180, 0x0D500000, 0x0962B414, 0x352000AF, -+ 0x192100AF, 0x362300AF, 0x1D800C8B, 0x01690102, -+ 0x36200000, 0x0A350020, 0x20C80203, 0x30218000, -+ 0x1F615ED4, 0x3B605EDA, 0x3D605EDC, 0x228B4000, -+ 0x2D695ED4, 0x30380000, 0x27C80104, 0x1C390000, -+ 0x1DD40100, 0x3B605EDA, 0x228B4000, 0x2D695ED4, -+ 0x30380000, 0x27C80104, 0x1C390000, 0x1DD40100, -+ 0x3D605EDC, 0x228B4000, 0x01685ED4, 0x27215ED4, -+ 0x30380000, 0x16D40102, 0x21510000, 0x228B4000, -+ 0x30695ECC, 0x07685ED2, 0x1C390000, 0x06D400A4, -+ 0x30380000, 0x31C800A4, 0x342300A4, 0x288000B4, -+ 0x3A215ECC, 0x0B518000, 0x36200000, 0x35605ED2, -+ 0x228B4000, 0x30695ECC, 0x35605ED2, 0x1C390000, -+ 0x30695EA0, 0x1DD40100, 0x12390008, 0x02615EA0, -+ 0x228B4000, 0x336A5EA0, 0x1C685ECC, 0x3A215ECC, -+ 0x2E36FFF7, 0x01625EA0, 0x30380000, 0x16D40102, -+ 0x21510000, 0x228B4000, 0x04685F52, 0x30218000, -+ 0x2D144000, 0x04CC00A9, 0x1A615F52, 0x302300A9, -+ 0x06200CFA, 0x288000B4, 0x29200400, 0x2660B144, -+ 0x06210200, 0x1468B144, 0x3C34000F, 0x2B190000, -+ 0x0A61B144, 0x07645F52, 0x2D010000, 0x20310008, -+ 0x1139A0C8, 0x214B4000, 0x0F2D002C, 0x0E494000, -+ 0x2E020000, 0x06330001, 0x20377F00, 0x1263010A, -+ 0x21320003, 0x1A625F68, 0x2E020000, 0x1032FFF8, -+ 0x313A4001, 0x11625F6A, 0x2E020000, 0x1132FFFF, -+ 0x2E2E0D17, 0x04230D2B, 0x0E8A4000, 0x15205F7A, -+ 0x228B4000, 0x12205F82, 0x228B4000, 0x1C205F8A, -+ 0x228B4000, 0x01205F92, 0x228B4000, 0x0F205F9A, -+ 0x228B4000, 0x07205FA2, 0x228B4000, 0x09205FAA, -+ 0x228B4000, 0x14205FB2, 0x228B4000, 0x1A205FBA, -+ 0x228B4000, 0x04205FC2, 0x228B4000, 0x38605F6C, -+ 0x27490000, 0x3E2C0002, 0x084B0000, 0x3E2C0002, -+ 0x244A0000, 0x3E2C0002, 0x0B480000, 0x1F615F58, -+ 0x38635F56, 0x17625F5A, 0x3E605F5C, 0x1E970E3D, -+ 0x236A5F5C, 0x266B010C, 0x1F3A0000, 0x01C80D47, -+ 0x19213000, 0x35098000, 0x190B4000, 0x3061010E, -+ 0x39C00D42, 0x27CC0E5C, 0x0A685F5A, 0x04230D47, -+ 0x33635F54, 0x046B5F68, 0x07800E42, 0x0F69010A, -+ 0x0A6B5F56, 0x20310008, 0x08C80D78, 0x2E6A5F58, -+ 0x05390080, 0x162E0035, 0x0E458000, 0x0C970D8F, -+ 0x04685F52, 0x1B230D54, 0x16341000, 0x3ECC1043, -+ 0x3A2000A0, 0x00645F53, 0x2D695F58, 0x34970284, -+ 0x0269010E, 0x1A223000, 0x350A4000, 0x0BC80D74, -+ 0x28680108, 0x25620114, 0x30380000, 0x12C80D61, -+ 0x0A970CA6, 0x15970C7A, 0x0269010E, 0x1B20B444, -+ 0x19500011, 0x0A500001, 0x1150C400, 0x0A500001, -+ 0x2335FFFF, 0x15410000, 0x176A0114, 0x3E2C0002, -+ 0x0D500000, 0x1F62B454, 0x0B200D72, 0x27210D72, -+ 0x362300AF, 0x0B800C91, 0x35203000, 0x1C60010E, -+ 0x1A210000, 0x36610108, 0x1A615F52, 0x398000AF, -+ 0x19220000, 0x3662015E, 0x228B4000, 0x1D210001, -+ 0x3561015E, 0x1260015C, 0x38635F56, 0x00970E1F, -+ 0x076B5F52, 0x0A685F6C, 0x3F37000F, 0x293B0100, -+ 0x2563B144, 0x25695F56, 0x3E2C0002, 0x15410000, -+ 0x26695F5A, 0x3E2C0002, 0x15410000, 0x20695F5C, -+ 0x3E2C0002, 0x15410000, 0x17800D58, 0x04685F52, -+ 0x3569B140, 0x3930FFFE, 0x3CD003A0, 0x33635F54, -+ 0x09300002, 0x02030000, 0x3C34000F, 0x3D3CFFFF, -+ 0x33228000, 0x1A120000, 0x301D8000, 0x0761B140, -+ 0x336A5EA0, 0x2BCC0DA0, 0x2D36FFFB, 0x01625EA0, -+ 0x3D3CFFFF, 0x3A225F7A, 0x3530FFFD, 0x1F060000, -+ 0x22520000, 0x22520000, 0x153B2000, 0x07685F32, -+ 0x35635F52, 0x1A344000, 0x09C80DB0, 0x0A685F36, -+ 0x2E9700B4, 0x02685F54, 0x362300AF, 0x288000B4, -+ 0x04685F52, 0x3569B140, 0x1F238000, 0x3C34000F, -+ 0x2E020000, 0x123EFFFF, 0x1C138000, 0x2819C000, -+ 0x0761B140, 0x3F30FFF8, 0x2838A084, 0x18500020, -+ 0x3B680118, 0x2E695F54, 0x0418C000, 0x09600118, -+ 0x351CC000, 0x2BCC0DFA, 0x2361011E, 0x07685F68, -+ 0x0763011C, 0x0260011A, 0x15970C7A, 0x336B011A, -+ 0x1B20B444, 0x1C500041, 0x0A500001, 0x0E500180, -+ 0x0D500000, 0x2D02C000, 0x2636FF00, 0x0262B44C, -+ 0x363700FF, 0x2563B44E, 0x3F222000, 0x1F62B454, -+ 0x3E6B011E, 0x36200000, 0x0F60011E, 0x333B0000, -+ 0x3ECC0DDA, 0x362300AF, 0x08200DDD, 0x24210DDD, -+ 0x0B800C91, 0x3668011C, 0x3569B140, 0x146A0118, -+ 0x1A1D0000, 0x0761B140, 0x191E0000, 0x26620118, -+ 0x19C80DF6, 0x36200000, 0x1D210001, 0x28038000, -+ 0x2E174000, 0x39CC0DED, 0x322C0001, 0x1231FFFF, -+ 0x07800DE7, 0x2861011C, 0x0E300003, 0x2B695F32, -+ 0x0260011A, 0x36354000, 0x1FC80DC6, 0x19200DC6, -+ 0x096B5F36, 0x288000B4, 0x07685F32, 0x26695F36, -+ 0x1A344000, 0x33C800AF, 0x0D894000, 0x1F3A0000, -+ 0x3AC803A0, 0x3B635F36, 0x1A6B5F4A, 0x19600104, -+ 0x3E610106, 0x19625F3E, 0x23635F48, 0x1D970C74, -+ 0x2B680104, 0x0F6A0106, 0x116B5F48, 0x2360B428, -+ 0x3C21B42A, 0x21510000, 0x0200C000, 0x0934FF00, -+ 0x281A0000, 0x0162B42C, 0x363700FF, 0x2663B42E, -+ 0x2B6A5F3E, 0x27200041, 0x2060B424, 0x1C62B434, -+ 0x36210E03, 0x362300AF, 0x12940C8E, 0x096B5F36, -+ 0x228B4000, 0x3B635F36, 0x39200120, 0x1A210000, -+ 0x0C220020, 0x1C6B5F4C, 0x1A800DFF, 0x33635F54, -+ 0x0F6B5F6A, 0x3A200140, 0x1A210000, 0x0C220020, -+ 0x3B605F60, 0x1C615F62, 0x12625F66, 0x36635F5E, -+ 0x15970C7A, 0x09685F60, 0x2D6A5F62, 0x046B5F5E, -+ 0x2060B448, 0x3F21B44A, 0x21510000, 0x0200C000, -+ 0x0934FF00, 0x281A0000, 0x0262B44C, 0x363700FF, -+ 0x2563B44E, 0x206A5F66, 0x27200041, 0x2360B444, -+ 0x1F62B454, 0x16200E5A, 0x21210E28, 0x362300AF, -+ 0x0B800C91, 0x33635F54, 0x36200000, 0x16210140, -+ 0x0F22002C, 0x0F6B5F6A, 0x3B605F60, 0x1C615F62, -+ 0x12625F66, 0x36635F5E, 0x15970C7A, 0x286A5F5E, -+ 0x09685F60, 0x2E695F62, 0x28038000, 0x0A37FF00, -+ 0x0418C000, 0x2060B448, 0x1A3600FF, 0x0462B44A, -+ 0x0161B44C, 0x36200000, 0x2660B44E, 0x206A5F66, -+ 0x22200011, 0x2360B444, 0x1F62B454, 0x2A210E46, -+ 0x362300AF, 0x0E940C91, 0x016B5F54, 0x228B4000, -+ 0x0B210041, 0x08800D4B, 0x08210021, 0x08800D4B, -+ 0x2E6A5F58, 0x04690164, 0x012E0028, 0x1C390000, -+ 0x01D00E71, 0x1F090000, 0x1531FFFE, 0x2B680168, -+ 0x3F418000, 0x2F34001F, 0x112E0002, 0x13408000, -+ 0x2B008000, 0x3E2C0002, 0x0D500000, 0x0D500000, -+ 0x228B4000, 0x1C208000, 0x13408000, 0x36200000, -+ 0x1C800E6A, 0x01685F58, 0x1A210000, 0x2E2C0028, -+ 0x0D500000, 0x0D500000, 0x0D500000, 0x15410000, -+ 0x228B4000, 0x0A230D4F, 0x0F3607FC, 0x3AC803A0, -+ 0x33635F54, 0x026B5F58, 0x12625F66, 0x010CC000, -+ 0x084B0000, 0x3E2C0002, 0x0B480000, 0x33635F62, -+ 0x2D6B010E, 0x36605F64, 0x2D0DC000, 0x36610108, -+ 0x0E970C64, 0x02685F62, 0x28695F64, 0x3B60B40C, -+ 0x1C61B40E, 0x28680108, 0x206A5F66, 0x2921B40A, -+ 0x3660B408, 0x21510000, 0x28200081, 0x3560B404, -+ 0x0962B414, 0x02685F54, 0x20210E8C, 0x362300AF, -+ 0x1D800C8B, 0x2D695F6E, 0x1C208000, 0x28150000, -+ 0x17C80EA2, 0x228B4000, 0x336A5EA0, 0x33605F6E, -+ 0x14200EA8, 0x2B36FFFD, 0x01625EA0, 0x288000B4, -+ 0x15685FDC, 0x2D695F6E, 0x30380000, 0x08C80F0B, -+ 0x28605F70, 0x232C0040, 0x27490000, 0x2E655F6E, -+ 0x3865B112, 0x1F31FFFB, 0x232D4010, 0x0D4A4000, -+ 0x1F6BB110, 0x122D0002, 0x1F0AC000, 0x24C00EFF, -+ 0x214B4000, 0x2C2DFFF6, 0x333B0000, 0x25D40EC4, -+ 0x1A685F70, 0x012D0012, 0x0D4A4000, 0x282C0042, -+ 0x084B0000, 0x312DFFEE, 0x1F1F8000, 0x3CCC0F01, -+ 0x28004000, 0x37215F72, 0x02970FF4, 0x3D695F72, -+ 0x332C0006, 0x13350003, 0x3DCC0F06, 0x37215F72, -+ 0x2922FFFC, 0x1C97100A, 0x1A685F70, 0x33215FDC, -+ 0x1D970F72, 0x1797103E, 0x0E970C64, 0x196B5F70, -+ 0x11685F72, 0x3B695F74, 0x2A22B40A, 0x3563B408, -+ 0x22520000, 0x3B60B40C, 0x1C61B40E, 0x28200081, -+ 0x3560B404, 0x20200040, 0x2660B414, 0x21210ED1, -+ 0x362300AF, 0x18940C8B, 0x01685F6E, 0x39695FEA, -+ 0x353400FF, 0x3330FFFB, 0x0A2C401A, 0x084B0000, -+ 0x1E2D0001, 0x312F0001, 0x3A430000, 0x002CFFF6, -+ 0x244A0000, 0x332C0006, 0x084B0000, 0x0B615FEA, -+ 0x312F0001, 0x1F0AC000, 0x17C40EF4, 0x35230000, -+ 0x3A430000, 0x2E6A5F6E, 0x1A685F70, 0x1A3600FF, -+ 0x3A3A1000, 0x1462B130, 0x15970F4A, 0x1C208000, -+ 0x33605F6E, 0x17230EA8, 0x33800126, 0x0D210088, -+ 0x29655F6F, 0x1A685F70, 0x2D695F6E, 0x3D2C0038, -+ 0x0B480000, 0x13800EAA, 0x20970106, 0x1A685F70, -+ 0x33215FDC, 0x19230EFA, 0x1B800F72, 0x336A5EA0, -+ 0x3C350800, 0x1F615F6E, 0x33C800AF, 0x143A0002, -+ 0x01625EA0, 0x398000AF, 0x1768B148, 0x05300001, -+ 0x1DD00F1B, 0x03300007, 0x19D00F20, 0x0C300008, -+ 0x3D3CFFFF, 0x1464B148, 0x388000A8, 0x35230000, -+ 0x2663B148, 0x39635FF2, 0x32635FF0, 0x19800F15, -+ 0x0E710048, 0x13710149, 0x2871804B, 0x1E800F22, -+ 0x00685FFC, 0x276AB1F8, 0x0934FF00, 0x0C300008, -+ 0x322C0001, 0x03361F00, 0x23320008, 0x1C0A0000, -+ 0x1DC0010A, 0x3F225E90, 0x3330FFFB, 0x1C2C4000, -+ 0x1C0A0000, 0x15C00104, 0x2F605FD2, 0x06625FD4, -+ 0x242A000F, 0x03C000FE, 0x228B4000, 0x10685FD6, -+ 0x37695FD4, 0x30380000, 0x04C80F3E, 0x27490000, -+ 0x0E615FD6, 0x228B4000, 0x33290044, 0x28C00F46, -+ 0x1D685FD2, 0x05615FD4, 0x2D010000, 0x022D0044, -+ 0x03615FD2, 0x228B4000, 0x361C0000, 0x2F605FD2, -+ 0x29605FD4, 0x228B4000, 0x3C695FD6, 0x30380000, -+ 0x27C80104, 0x15410000, 0x22605FD6, 0x228B4000, -+ 0x1C390000, 0x31C800FE, 0x0D4A4000, 0x30380000, -+ 0x27C80104, 0x10404000, 0x1F3A0000, 0x07C80F5E, -+ 0x362C003A, 0x16420000, 0x122E0038, 0x062CFFC6, -+ 0x13408000, 0x228B4000, 0x222DFFFE, 0x10404000, -+ 0x228B4000, 0x1C390000, 0x31C800FE, 0x0D4A4000, -+ 0x30380000, 0x27C80104, 0x10404000, 0x1F3A0000, -+ 0x06C80F6F, 0x3D2C0038, 0x16420000, 0x192E003A, -+ 0x0E2CFFC8, 0x13408000, 0x228B4000, 0x122D0002, -+ 0x10404000, 0x228B4000, 0x1C390000, 0x31C800FE, -+ 0x30380000, 0x27C80104, 0x2D635E96, 0x362C003A, -+ 0x084B0000, 0x0E2CFFFE, 0x244A0000, 0x333B0000, -+ 0x19C80F85, 0x1F3A0000, 0x0BC80F92, 0x3E2F0038, -+ 0x1542C000, 0x192E003A, 0x0D2FFFC8, 0x10438000, -+ 0x1D800F8D, 0x3F424000, 0x1F3A0000, 0x11C80F8B, -+ 0x192E003A, 0x10438000, 0x1D800F8D, 0x122D0002, -+ 0x3F424000, 0x0D500000, 0x0D500000, 0x1F6B5E96, -+ 0x0D2CFFC4, 0x228B4000, 0x122D0002, 0x3F424000, -+ 0x3E2F0038, 0x1542C000, 0x1D800F8D, 0x2A320001, -+ 0x0A367FFF, 0x03C80FAA, 0x252A0008, 0x32C00FA6, -+ 0x0D500000, 0x0D500000, 0x0D500000, 0x0D500000, -+ 0x0D500000, 0x0D500000, 0x0D500000, 0x0D500000, -+ 0x03C80FAA, 0x0F800F9A, 0x26260008, 0x0D500000, -+ 0x262EFFFF, 0x36CC0FA7, 0x228B4000, 0x26635E94, -+ 0x14970FB4, 0x146B5E94, 0x288000B4, 0x26635E94, -+ 0x14970FB4, 0x02030000, 0x17685E94, 0x288000B4, -+ 0x22484000, 0x0F615E92, 0x28605E90, 0x0C300008, -+ 0x2BD40FD5, 0x2D635E96, 0x2C34007F, 0x3E30FFFF, -+ 0x122D0002, 0x2E0D0000, 0x214B4000, 0x05300001, -+ 0x322C0001, 0x36695E90, 0x191E0000, 0x3ECC0FC5, -+ 0x36200000, 0x07024000, 0x36368000, 0x0035007F, -+ 0x1A1D0000, 0x3D695E92, 0x1AC80FD3, 0x23320008, -+ 0x281A0000, 0x1E2D0001, 0x0E464000, 0x0200C000, -+ 0x1F6B5E96, 0x30380000, 0x228B4000, 0x3F424000, -+ 0x00800FCF, 0x361C0000, 0x228B4000, 0x28605E90, -+ 0x22484000, 0x0A625E94, 0x0C300008, 0x3FD40FF2, -+ 0x2E020000, 0x0C300008, 0x2C34007F, 0x0336007F, -+ 0x191E0000, 0x31C800FE, 0x3E30FFFF, 0x356A5E90, -+ 0x0F615E92, 0x122D0002, 0x2E0D0000, 0x3F424000, -+ 0x386A5E94, 0x3D695E92, 0x05300001, 0x322C0001, -+ 0x191E0000, 0x2ECC0FEF, 0x36200000, 0x29380080, -+ 0x21444000, 0x228B4000, 0x36200000, 0x16800FE3, -+ 0x2D635E96, 0x084B0000, 0x3E2C0002, 0x13434000, -+ 0x244A0000, 0x122D0002, 0x3F424000, 0x2E1B8000, -+ 0x3E2C0002, 0x244A0000, 0x122D0002, 0x3F424000, -+ 0x2E1B8000, 0x3E2C0002, 0x244A0000, 0x122D0002, -+ 0x3F424000, 0x2B1AC000, 0x1F6B5E96, 0x3E2C0002, -+ 0x122D0002, 0x228B4000, 0x28605E90, 0x0F615E92, -+ 0x2D635E96, 0x27490000, 0x280C8000, 0x0B480000, -+ 0x1C390000, 0x14C81031, 0x03340FFC, 0x0FC81019, -+ 0x15280041, 0x3DC01019, 0x16240041, 0x15072000, -+ 0x0480101E, 0x1831FFFA, 0x07024000, 0x2936FFC0, -+ 0x2B034000, 0x3937003F, 0x3D695E92, 0x22484000, -+ 0x1A048000, 0x10404000, 0x122D0002, 0x22484000, -+ 0x2C04C400, 0x10404000, 0x17C41031, 0x122D0002, -+ 0x22484000, 0x19220000, 0x05048400, 0x10404000, -+ 0x17C41031, 0x122D0002, 0x22484000, 0x05048400, -+ 0x10404000, 0x1F6B5E96, 0x1A685E90, 0x228B4000, -+ 0x14685F14, 0x32215F14, 0x30380000, 0x10D0103A, -+ 0x0B518000, 0x228B4000, 0x0200C000, 0x12220002, -+ 0x362300AF, 0x1D800FD7, 0x14685F14, 0x3A215F1A, -+ 0x30380000, 0x10D0103A, 0x228B4000, 0x14685F14, -+ 0x32215F14, 0x30380000, 0x16D40102, 0x2A340080, -+ 0x01C8104B, 0x12220002, 0x03800FAF, 0x21510000, -+ 0x1C685F1A, 0x28635E9C, 0x30380000, 0x26CC1051, -+ 0x228B4000, 0x3A215F1A, 0x12220002, 0x08970FAB, -+ 0x1A6B5E9C, 0x0A80104C, 0x3DFFFFFF, 0x01000000, -+ 0x01000000, 0x01000000 -+}; -+ -+static const uint32_t fw2_farm_img_data_buf[2048] = -+{ -+ 0x132040FA, 0x29502501, 0x032040D0, 0x295046C7, -+ 0x0D500000, 0x267001C9, 0x258C0200, 0x0F70AAC9, -+ 0x176B40C8, 0x3B7000C8, 0x2D70001D, 0x2670001F, -+ 0x18631FFC, 0x3370C033, 0x296A4010, 0x086B4014, -+ 0x39621FF8, 0x16631FF4, 0x15684000, 0x34694004, -+ 0x1E601FF6, 0x3F611FF2, 0x346A4008, 0x156B400C, -+ 0x32621FFA, 0x1B631FF0, 0x3A9700C9, 0x1E684034, -+ 0x2170001E, 0x3A34003F, 0x281A0000, 0x3F621FFE, -+ 0x0628000B, 0x2AC4004F, 0x1D24002F, 0x21884000, -+ 0x2380004F, 0x3A800036, 0x2880004D, 0x2B800041, -+ 0x2380004F, 0x20800043, 0x2080002F, 0x3880003D, -+ 0x26800045, 0x2D800047, 0x25800049, 0x276A4018, -+ 0x34621FFC, 0x3E9701EB, 0x09300002, 0x31D0006D, -+ 0x3930FFFE, 0x3080005F, 0x276A4018, 0x34621FFC, -+ 0x3A970275, 0x09300002, 0x31D0006D, 0x3930FFFE, -+ 0x3180006E, 0x2097032F, 0x268C0400, 0x16614018, -+ 0x3080005F, 0x2297075B, 0x3080005F, 0x3B970714, -+ 0x3080005F, 0x2497075D, 0x3080005F, 0x30970716, -+ 0x3080005F, 0x38230004, 0x29671FFC, 0x3397042A, -+ 0x3080005F, 0x3397078F, 0x3080005F, 0x3B7000C8, -+ 0x24200021, 0x358C5000, 0x2E80007D, 0x2B707FC8, -+ 0x08702084, 0x2D70001D, 0x36200000, 0x2D010000, -+ 0x1E220001, 0x3997009F, 0x01684084, 0x26340020, -+ 0x01CC005A, 0x3920000F, 0x3080005F, 0x238C0100, -+ 0x376A4032, 0x1F36C000, 0x3EC80064, 0x2120002B, -+ 0x09300002, 0x31D0006D, 0x1B601FFC, 0x2A681FF0, -+ 0x246A4014, 0x2D010000, 0x2460400C, 0x3997009F, -+ 0x29681FFC, 0x3930FFFE, 0x036A1FF6, 0x276B1FF8, -+ 0x08624000, 0x37634010, 0x0D6A1FFE, 0x279700D1, -+ 0x0E6A1FF2, 0x246B1FF4, 0x05624004, 0x3A634014, -+ 0x006A1FFA, 0x35230000, 0x06624008, 0x358C5000, -+ 0x3463401C, 0x106440C9, 0x3C800006, 0x376B1FE4, -+ 0x228B4000, 0x3C6B1FE6, 0x228B4000, 0x2C681FF6, -+ 0x252DFFFF, 0x07024000, 0x2F36FFF0, 0x21320003, -+ 0x3930FFFE, 0x1F060000, 0x0E4A8000, 0x28004000, -+ 0x3C34000F, 0x1A120000, 0x228B4000, 0x24681FF8, -+ 0x3330FFFB, 0x00601FE2, 0x228B4000, 0x3F8C0480, -+ 0x33BC0053, 0x1B61401C, 0x228B4000, 0x2D010000, -+ 0x3930FFFE, 0x0D500000, 0x0D500000, 0x0D500000, -+ 0x0D500000, 0x09300002, 0x202A0002, 0x0B614000, -+ 0x1B624010, 0x29604008, 0x1D218808, 0x3C800093, -+ 0x0B631FEC, 0x0B614000, 0x086A1FF4, 0x2D010000, -+ 0x1668400C, 0x1B624010, 0x299700D9, 0x18684004, -+ 0x0D691FF2, 0x086A1FF4, 0x396B1FEC, 0x2F8000EF, -+ 0x37694008, 0x268C0400, 0x0D684024, 0x04140000, -+ 0x19D400B7, 0x36200000, 0x228B4000, 0x00240001, -+ 0x1A084000, 0x228B4000, 0x3930FFFE, 0x15410000, -+ 0x0C240002, 0x0D500000, 0x09300002, 0x262EFFFF, -+ 0x31800097, 0x13684030, 0x37380001, 0x21604030, -+ 0x228B4000, 0x13684030, 0x0834FFFE, 0x21604030, -+ 0x228B4000, 0x386A40C4, 0x3F694030, 0x1B360001, -+ 0x1732FFF9, 0x18350001, 0x1831FFFA, 0x011A4000, -+ 0x228B4000, 0x07018000, 0x28310006, 0x18350001, -+ 0x0D614030, 0x2C320007, 0x1B360001, 0x0A6240C4, -+ 0x228B4000, 0x29604008, 0x06614004, 0x16624014, -+ 0x37218001, 0x268C0400, 0x1B61401C, 0x2A694010, -+ 0x27604000, 0x36064000, 0x1B624010, 0x228B4000, -+ 0x29604008, 0x06614004, 0x16624014, 0x2D218018, -+ 0x268C0400, 0x1B61401C, 0x296A4010, 0x27604000, -+ 0x2F260001, 0x1B624010, 0x228B4000, 0x29604008, -+ 0x06614004, 0x16624014, 0x262EFFFF, 0x36058000, -+ 0x1531FFFE, 0x22484000, 0x20250002, 0x0E494000, -+ 0x2B190000, 0x0ACC00FB, 0x16624014, 0x1B684008, -+ 0x2C218200, 0x268C0400, 0x1B61401C, 0x246A4014, -+ 0x27604000, 0x1B624010, 0x228B4000, 0x1C2100FF, -+ 0x26800106, 0x1A210000, 0x05631FE4, 0x24611FEC, -+ 0x21681FF2, 0x2B6040A0, 0x0B691FF4, 0x27604000, -+ 0x29604008, 0x18614010, 0x268C0400, 0x0970081C, -+ 0x2470881D, 0x0FF00111, 0x3930FFFE, 0x27490000, -+ 0x29310001, 0x3A200003, 0x18D4007F, 0x1231FFFF, -+ 0x286540B4, 0x216B1FFE, 0x036A1FF6, 0x3D33FFFF, -+ 0x38D00127, 0x276B1FF8, 0x08624000, 0x06624008, -+ 0x37634010, 0x268C0400, 0x3C70011F, 0x0970081C, -+ 0x2470881D, 0x04F00125, 0x3B800128, 0x268C0400, -+ 0x196840A0, 0x21694024, 0x1F090000, 0x39C801E9, -+ 0x07024000, 0x1D2E0001, 0x16624014, 0x1F31FFFB, -+ 0x0E684028, 0x2670001F, 0x2F34001F, 0x2E184000, -+ 0x322C0001, 0x2E020000, 0x09240008, 0x1334FFE0, -+ 0x08300005, 0x0B691FF4, 0x206040A2, 0x2D6040A6, -+ 0x322C0001, 0x1F090000, 0x3DC4014B, 0x356940A0, -+ 0x1C050000, 0x252DFFFF, 0x1531FFFE, 0x21510000, -+ 0x21510000, 0x03691FFA, 0x1C050000, 0x252DFFFF, -+ 0x1531FFFE, 0x21510000, 0x21510000, 0x322C0001, -+ 0x16691FEC, 0x0834FFFE, 0x2B3D00FF, 0x12CC0153, -+ 0x27681FF4, 0x0B240003, 0x0834FFFE, 0x08601FEC, -+ 0x2B26000C, 0x21621FEA, 0x2226005F, 0x35200060, -+ 0x35230000, 0x160B2000, 0x252DFFFF, 0x026140AA, -+ 0x1E2D0001, 0x15072000, 0x3F6B1FEA, 0x28004000, -+ 0x3530FFFD, 0x1F0AC000, 0x35230000, 0x0D631FEA, -+ 0x160B2000, 0x3520000C, 0x35230000, 0x29290007, -+ 0x28C4016B, 0x2A250007, 0x2080016C, 0x1B210007, -+ 0x1A084000, 0x2D1B4000, 0x33634088, 0x306940AA, -+ 0x3530FFFD, 0x1E2D0001, 0x15072000, 0x252A0008, -+ 0x2A621FE8, 0x2B008000, 0x1D2E0001, 0x1334FFE0, -+ 0x08300005, 0x322C0001, 0x296B1FF0, 0x16691FEC, -+ 0x03601FEE, 0x1A074000, 0x24634000, 0x3A33FFFE, -+ 0x0E530000, 0x0E530000, 0x0E530000, 0x0E530000, -+ 0x0A330002, 0x2A634008, 0x33070000, 0x0B2B0003, -+ 0x09280004, 0x13C001A1, 0x322C0001, 0x34604010, -+ 0x268C0400, 0x3C70011F, 0x2A70001C, 0x2470881D, -+ 0x11F00190, 0x0E691FFE, 0x0D684024, 0x1231FFFF, -+ 0x20D001A0, 0x00691FF6, 0x04140000, 0x37D001E7, -+ 0x1A084000, 0x22694028, 0x0335001F, 0x3330FFFB, -+ 0x2E184000, 0x3DC801E4, 0x322C0001, 0x00601FE2, -+ 0x2670001F, 0x2B008000, 0x3D3CFFFF, 0x30218000, -+ 0x19110000, 0x3A33FFFE, 0x20340010, 0x25C801AC, -+ 0x1641C000, 0x0F270002, 0x0E530000, 0x248001AE, -+ 0x0E530000, 0x1641C000, 0x31681FEE, 0x356940A0, -+ 0x34604010, 0x166B4000, 0x3304C000, 0x322C0001, -+ 0x0834FFFE, 0x06614004, 0x29604008, 0x0568401C, -+ 0x268C0400, 0x3C70011F, 0x2A70001C, 0x1B70821D, -+ 0x07F001BC, 0x3D340008, 0x2DC801CE, 0x0E691FFE, -+ 0x0D684024, 0x1231FFFF, 0x2BD001CE, 0x00691FF6, -+ 0x04140000, 0x37D001E7, 0x1A084000, 0x22694028, -+ 0x3330FFFB, 0x0335001F, 0x2E184000, 0x3DC801E4, -+ 0x322C0001, 0x00601FE2, 0x2670001F, 0x1B691FE8, -+ 0x3E20000E, 0x29310001, 0x1231FFFF, 0x36D001D6, -+ 0x092CFFFF, 0x378001D2, 0x39694000, 0x0C2207FA, -+ 0x186B4008, 0x096140A8, 0x256340A4, 0x076240AC, -+ 0x236040AE, 0x2E7000B2, 0x3F8C0480, 0x33BC0053, -+ 0x31700484, 0x32E001E1, 0x31200001, 0x2580007F, -+ 0x3F200009, 0x2670001F, 0x2580007F, 0x3C200005, -+ 0x308001E5, 0x37200007, 0x308001E5, 0x08631FE0, -+ 0x35230000, 0x25671FFF, 0x227001C4, 0x2C970105, -+ 0x063C0001, 0x2EC801F4, 0x063C0001, 0x2F80023F, -+ 0x2F681FFA, 0x05691FFC, 0x266040A4, 0x3A8C0180, -+ 0x33BC0053, 0x2D3D0000, 0x3DC80241, 0x34700184, -+ 0x25E001FC, 0x3B6940A8, 0x126840A2, 0x0B614000, -+ 0x322C0001, 0x296B1FF0, 0x34604010, 0x2A634008, -+ 0x3A8C0180, 0x33BC0053, 0x2A70001C, 0x2470881D, -+ 0x05691FFC, 0x252DFFFF, 0x39C80220, 0x28004000, -+ 0x0034FFF0, 0x3420000B, 0x14CC023F, 0x156A1FEC, -+ 0x0200C000, 0x1A048000, 0x266340A8, 0x256340A4, -+ 0x3F8C0480, 0x33BC0053, 0x34700184, 0x3BE00217, -+ 0x256040A8, 0x1A048000, 0x3A8C0180, 0x33BC0053, -+ 0x32700284, 0x3EE0021D, 0x252DFFFF, 0x00CC0218, -+ 0x2A681FF0, 0x16691FEC, 0x1C050000, 0x036A1FF6, -+ 0x316B1FE2, 0x256040A8, 0x0A6140A4, 0x076240AC, -+ 0x29681FFC, 0x0C2B0002, 0x092CFFFF, 0x206340AE, -+ 0x336040B2, 0x2C8C5080, 0x33BC0053, 0x31700484, -+ 0x2FE00230, 0x06691FF0, 0x3D201FE8, 0x096140A8, -+ 0x0A500001, 0x0F280002, 0x09300002, 0x266040A4, -+ 0x36200000, 0x2D6040A6, 0x3A8C0180, 0x33BC0053, -+ 0x34700184, 0x2BE0023D, 0x31200001, 0x3A6B1FE0, -+ 0x228B4000, 0x06691FF0, 0x156A1FEC, 0x28004000, -+ 0x1A048000, 0x03601FEE, 0x2D010000, 0x1A048000, -+ 0x3D6A40A2, 0x266040A4, 0x1D2E0001, 0x3997009F, -+ 0x03691FFA, 0x31681FEE, 0x3997009F, 0x2A681FF0, -+ 0x1D210001, 0x269700BA, 0x31681FEE, 0x386940A4, -+ 0x2C97026F, 0x2A681FF0, 0x268C0400, 0x2C97026F, -+ 0x2A97008F, 0x1E691FE2, 0x2D3D0000, 0x2DC80231, -+ 0x29970083, 0x2C611FE2, 0x1B360001, 0x10CC0268, -+ 0x38200008, 0x31681FEE, 0x06691FF0, 0x2C97026F, -+ 0x2A681FF0, 0x25230259, 0x2D010000, 0x2A80026F, -+ 0x2A681FF0, 0x1D691FEE, 0x2C97026F, 0x31681FEE, -+ 0x25230259, 0x2D010000, 0x2A80026F, 0x0A6140A4, -+ 0x256040A8, 0x3A8C0180, 0x33BC0053, 0x34700184, -+ 0x228B4000, 0x0E631FE6, 0x3E9702B7, 0x259702C5, -+ 0x39681FD6, 0x0E6A1FF2, 0x00691FF6, 0x276B1FF8, -+ 0x1F060000, 0x03270001, 0x0B37FFFE, 0x1F05C000, -+ 0x296B1FF0, 0x32611FF6, 0x3304C000, 0x3C621FF2, -+ 0x1D601FFA, 0x18601FF0, 0x268C0400, 0x3E9701EB, -+ 0x02030000, 0x053F0001, 0x0FCC02B4, 0x238C0100, -+ 0x166A1FD6, 0x06691FF0, 0x28004000, 0x35098000, -+ 0x1A048000, 0x3997009F, 0x2D010000, 0x15684000, -+ 0x35098000, 0x35068000, 0x3997009F, 0x276B1FF8, -+ 0x00691FF6, 0x03270001, 0x0B37FFFE, 0x1C09C000, -+ 0x3A6B1FD6, 0x0E6A1FF2, 0x32611FF6, 0x1F0AC000, -+ 0x3C621FF2, 0x268C0400, 0x3E9701EB, 0x326B1FD8, -+ 0x166A1FD6, 0x06691FF0, 0x1E631FFA, 0x35098000, -+ 0x34611FF0, 0x02030000, 0x053F0001, 0x0FCC02B4, -+ 0x238C0100, 0x1A210000, 0x299702F0, 0x2B97031B, -+ 0x2A681FF0, 0x2460400C, 0x268C0400, 0x31200001, -+ 0x24800081, 0x37200007, 0x348002B4, 0x0B631FEC, -+ 0x0D691FF2, 0x006A1FFA, 0x06614004, 0x0B691FF4, -+ 0x2C621FD8, 0x15614014, 0x2D3D0000, 0x39C802B5, -+ 0x28004000, 0x0C240002, 0x0834FFFE, 0x0B601FD6, -+ 0x228B4000, 0x0B631FEC, 0x349700C1, 0x39681FD6, -+ 0x296B1FF0, 0x30040000, 0x33070000, 0x0F270002, -+ 0x2763400C, 0x19220000, 0x21681FF2, 0x16624014, -+ 0x1A048000, 0x2A604004, 0x086A1FF4, 0x2D010000, -+ 0x3997009F, 0x239700B0, 0x0F280002, 0x0BC002B5, -+ 0x0C240002, 0x246A4014, 0x39604014, 0x0B691FF4, -+ 0x296B1FF0, 0x35054000, 0x24634000, 0x18614010, -+ 0x156B400C, 0x2C218200, 0x19078000, 0x2A634008, -+ 0x3A970093, 0x18684004, 0x0D691FF2, 0x166A1FD6, -+ 0x1A1D0000, 0x2BC802CE, 0x3A69400C, 0x2A681FF0, -+ 0x35068000, 0x3997009F, 0x396B1FEC, 0x3F8000C5, -+ 0x0B631FEC, 0x2A681FF0, 0x1A048000, 0x2460400C, -+ 0x1A048000, 0x0C240002, 0x19044000, 0x086A1FF4, -+ 0x0D691FF2, 0x3930FFFE, 0x0D500000, 0x0D500000, -+ 0x09300002, 0x3997009F, 0x239700B0, 0x39604014, -+ 0x1B684008, 0x156B400C, 0x2F260001, 0x06691FF0, -+ 0x03280001, 0x1B624010, 0x29604008, 0x06614004, -+ 0x24634000, 0x2C2A0001, 0x36058000, 0x1531FFFE, -+ 0x21510000, 0x21510000, 0x19078000, 0x3A33FFFE, -+ 0x0E530000, 0x0E530000, 0x3B218002, 0x3A970093, -+ 0x23260002, 0x1B624010, 0x246A4014, 0x03691FFA, -+ 0x1B684008, 0x396B1FEC, 0x2F8000D9, 0x0B631FEC, -+ 0x349700C1, 0x166B4000, 0x1668400C, 0x2763400C, -+ 0x0D691FF2, 0x246A4014, 0x299700EF, 0x3A6B1FD6, -+ 0x0D691FF2, 0x1668400C, 0x1F05C000, 0x086A1FF4, -+ 0x299700D9, 0x2A681FF0, 0x086A1FF4, 0x2D010000, -+ 0x2B9700E4, 0x396B1FEC, 0x3F8000C5, 0x05631FE4, -+ 0x2A681FF0, 0x2460400C, 0x08691FF8, 0x29611FDE, -+ 0x086A1FF4, 0x21621FDC, 0x350A4000, 0x040E4000, -+ 0x02D4033A, 0x07024000, 0x24260003, 0x2736FFFE, -+ 0x00601FE2, 0x1A048000, 0x0B601FE0, 0x1A048000, -+ 0x35068000, 0x37621FF0, 0x1A048000, 0x0B601FD6, -+ 0x1668400C, 0x37970097, 0x056A1FF0, 0x1668400C, -+ 0x1A048000, 0x37970097, 0x0B6A1FF8, 0x32681FE2, -+ 0x296B1FF0, 0x3304C000, 0x00691FF6, 0x3997009F, -+ 0x268C0400, 0x0E6B4024, 0x05631FD2, 0x1A378000, -+ 0x09CC041D, 0x39681FE0, 0x296B1FF0, 0x3304C000, -+ 0x0D691FF2, 0x086A1FF4, 0x3997009F, 0x32681FE2, -+ 0x3930FFFE, 0x0A500001, 0x39681FE0, 0x0D691FF2, -+ 0x3997009F, 0x3B201FD8, 0x0D500000, 0x0D500000, -+ 0x0D691FF2, 0x1531FFFE, 0x0E494000, 0x29310001, -+ 0x0DD40420, 0x1231FFFF, 0x36200000, 0x00601FD4, -+ 0x32230001, 0x1E220001, 0x0200C000, 0x2E148000, -+ 0x2CC80375, 0x32681FD4, 0x1A048000, 0x00601FD4, -+ 0x1A074000, 0x35054000, 0x35068000, 0x0CCC036E, -+ 0x32681FE2, 0x296B1FF0, 0x3304C000, 0x1A210000, -+ 0x186A1FDE, 0x3B970424, 0x3930FFFE, 0x0B480000, -+ 0x1A388000, 0x05300001, 0x23D00385, 0x2C250001, -+ 0x22800381, 0x2D3D0000, 0x28C803B7, 0x268C0400, -+ 0x16614018, 0x26218040, 0x3A970093, 0x32681FD4, -+ 0x1E691FE2, 0x1531FFFE, 0x0E494000, 0x15072000, -+ 0x1D210001, 0x0B6B4018, 0x3E3FFFFF, 0x03270001, -+ 0x1A11C000, 0x252DFFFF, 0x02164000, 0x326B1FD8, -+ 0x268C0400, 0x21694024, 0x2A611FD2, 0x35C803AF, -+ 0x1F1F8000, 0x34C803A8, 0x2C621FD8, 0x21681FF2, -+ 0x0C2107F6, 0x3A970423, 0x1E220001, 0x16624014, -+ 0x39681FD6, 0x29604008, 0x37218001, 0x3A970093, -+ 0x15691FD6, 0x32681FE2, 0x086A1FF4, 0x2F260001, -+ 0x3B970424, 0x23218010, 0x3A970093, 0x32681FE2, -+ 0x1A210000, 0x086A1FF4, 0x2F260001, 0x3B970424, -+ 0x26218040, 0x3A970093, 0x22800378, 0x39681FE0, -+ 0x296B1FF0, 0x3304C000, 0x2A604004, 0x32681FE2, -+ 0x3304C000, 0x27604000, 0x186A1FDE, 0x3F6B1FDC, -+ 0x3A634014, 0x1F0AC000, 0x2E0EC000, 0x04D403C5, -+ 0x2D02C000, 0x1B624010, 0x2F218400, 0x3A970093, -+ 0x18691FD2, 0x1F1C4000, 0x10CC03D2, 0x1531FFFE, -+ 0x22484000, 0x063C0001, 0x122D0002, 0x0E494000, -+ 0x2E184000, 0x30C80413, 0x268C0400, 0x00684020, -+ 0x05300001, 0x3ED0041D, 0x09300002, 0x2AD003E0, -+ 0x15684000, 0x34694004, 0x2A604004, 0x0B614000, -+ 0x06684010, 0x27694014, 0x39604014, 0x18614010, -+ 0x166B4000, 0x2A634008, 0x0E631FD0, 0x25218020, -+ 0x3A970093, 0x23D003E9, 0x39681FE0, 0x1E691FE2, -+ 0x248003EB, 0x32681FE2, 0x15691FE0, 0x086A1FF4, -+ 0x2F260001, 0x3B970424, 0x268C0400, 0x226A4024, -+ 0x25218020, 0x3A970093, 0x3F681FD0, 0x1C0A0000, -+ 0x2F260001, 0x15691FE0, 0x296B1FF0, 0x1F05C000, -+ 0x1A1D0000, 0x1ECC0400, 0x32681FE2, 0x15691FE0, -+ 0x0B601FE0, 0x2C611FE2, 0x37681FDE, 0x0E601FDC, -+ 0x2A621FDE, 0x32681FE2, 0x0D691FF2, 0x3A970423, -+ 0x296A4010, 0x1A048000, 0x3930FFFE, 0x268C0400, -+ 0x084B0000, 0x0D500000, 0x0D500000, 0x023F0000, -+ 0x28C80378, 0x23218010, 0x3A970093, 0x052CFFFC, -+ 0x268C0400, 0x0D500000, 0x22800378, 0x1E691FE2, -+ 0x39681FE0, 0x086A1FF4, 0x3997009F, 0x16624014, -+ 0x31200001, 0x1A210000, 0x156B400C, 0x1B631FF0, -+ 0x2580007F, 0x24200017, 0x1B210007, 0x3380041A, -+ 0x3A200003, 0x0621001F, 0x3380041A, 0x086A1FF4, -+ 0x1B624010, 0x16624014, 0x27604000, 0x06614004, -+ 0x29604008, 0x228B4000, 0x0E631FE6, 0x2C681FF6, -+ 0x08691FF8, 0x086A1FF4, 0x1D601FCC, 0x37611FCA, -+ 0x24260003, 0x2736FFFE, 0x39621FCE, 0x2A681FF0, -+ 0x1A048000, 0x1A048000, 0x0B691FF4, 0x0E6A1FF2, -+ 0x3A9706F3, 0x063C0001, 0x2DC8043D, 0x063C0001, -+ 0x2E800458, 0x06691FF0, 0x0B6A1FCE, 0x28004000, -+ 0x1A048000, 0x2460400C, 0x19088000, 0x19088000, -+ 0x358C5000, 0x3D9700A4, 0x06691FF0, 0x0B6A1FCE, -+ 0x28004000, 0x19088000, 0x19088000, 0x18601FF0, -+ 0x3D9700A4, 0x2A681FF0, 0x0B6A1FCE, 0x1D210001, -+ 0x1A048000, 0x1A048000, 0x269700BA, 0x03691FCC, -+ 0x066A1FCA, 0x32611FF6, 0x39621FF8, 0x31200001, -+ 0x268C0400, 0x24800081, 0x0D601FD0, 0x296A4010, -+ 0x15684000, 0x2C621FD8, 0x08601FDA, 0x10691FDC, -+ 0x2A681FF0, 0x216B1FFE, 0x07024000, 0x36064000, -+ 0x071BC000, 0x1AD40467, 0x36064000, 0x37970097, -+ 0x1E6A1FD8, 0x3A681FDA, 0x1B624010, 0x27604000, -+ 0x3F681FD0, 0x063C0001, 0x0FCC0477, 0x216B1FFE, -+ 0x071BC000, 0x33D00475, 0x269706B6, 0x0D601FD0, -+ 0x3680047C, 0x389706A2, 0x3680047C, 0x0D3C0003, -+ 0x0DCC047C, 0x33970489, 0x31200001, 0x0D601FD0, -+ 0x3F681FD0, 0x35230000, 0x2D010000, 0x293D000D, -+ 0x0BCC0483, 0x34230007, 0x3A800486, 0x2E3D000C, -+ 0x30C80486, 0x2923001F, 0x268C0400, 0x39634018, -+ 0x24800081, 0x08631FD6, 0x2A681FF0, 0x03691FFA, -+ 0x086A1FF4, 0x3997009F, 0x16624014, 0x136A1FDC, -+ 0x03691FFA, 0x226B1FF2, 0x1A048000, 0x36058000, -+ 0x06614004, 0x29604008, 0x24634000, 0x25218020, -+ 0x3A970093, 0x0E691FFE, 0x1A048000, 0x02194000, -+ 0x1DD4049F, 0x3930FFFE, 0x0A500001, 0x3A6B1FD6, -+ 0x228B4000, 0x1A048000, 0x3930FFFE, 0x0D500000, -+ 0x0D500000, 0x0D500000, 0x0D500000, 0x228B4000, -+ 0x086A1FF4, 0x1D2E0001, 0x1B624010, 0x0B614000, -+ 0x29604008, 0x268C0400, 0x2A70001C, 0x2470881D, -+ 0x36058000, 0x1A048000, 0x228B4000, 0x27604000, -+ 0x27681FF4, 0x05614008, 0x34604010, 0x268C0400, -+ 0x15624018, 0x2E020000, 0x29218080, 0x3C800093, -+ 0x08631FD6, 0x387000C4, 0x30700090, 0x2A970103, -+ 0x246B1FF4, 0x08270003, 0x0B37FFFE, 0x0D631FDC, -+ 0x2D010000, 0x2A3D0001, 0x238C0100, 0x1ECC045A, -+ 0x3D6A40A2, 0x176840A8, 0x2F260001, 0x289704A1, -+ 0x21681FF2, 0x086A1FF4, 0x289704A1, 0x2F260001, -+ 0x2736FFFE, 0x0F6240A2, 0x026240A6, 0x3A6B1FD6, -+ 0x228B4000, 0x08631FD6, 0x136A1FDC, 0x06691FF0, -+ 0x3D201FB2, 0x2D230012, 0x35098000, 0x36058000, -+ 0x15410000, 0x3E2C0002, 0x0A2FFFFF, 0x00CC04DB, -+ 0x37681FB2, 0x37970097, 0x136A1FDC, 0x3A681FB6, -+ 0x1D32FFFC, 0x37970097, 0x2397052F, 0x16691FB6, -+ 0x21681FF2, 0x1E220001, 0x309704B3, 0x1E220001, -+ 0x1B691FB2, 0x3A6B1FD6, 0x34800534, 0x08631FD6, -+ 0x3F6B1FDC, 0x0D691FF2, 0x1D6A1FD4, 0x1F05C000, -+ 0x20970523, 0x15691FBA, 0x1E220001, 0x32970534, -+ 0x106A1FD0, 0x03691FFA, 0x20970523, 0x216B1FFE, -+ 0x03691FFA, 0x071BC000, 0x08D40505, 0x3F6B1FDC, -+ 0x036A1FC0, 0x1F05C000, 0x1F05C000, 0x20970523, -+ 0x31800508, 0x15691FBA, 0x2C681FC0, 0x219704A8, -+ 0x13691FD0, 0x34681FBE, 0x036A1FC0, 0x286040AC, -+ 0x096140A8, 0x096240A4, 0x358C5000, 0x28700384, -+ 0x3A6B1FD6, 0x228B4000, 0x136A1FDC, 0x15691FBA, -+ 0x16624014, 0x1632FFFE, 0x35098000, 0x0B614000, -+ 0x0A6140A4, 0x16691FB6, 0x1D6A1FB8, 0x05614008, -+ 0x0B691FF4, 0x05624004, 0x1E2D0001, 0x18614010, -+ 0x228B4000, 0x1B684008, 0x2880052B, 0x0B631FEC, -+ 0x2B008000, 0x296A4010, 0x3997009F, 0x086A1FF4, -+ 0x289704A1, 0x1B684008, 0x396B1FEC, 0x256040A8, -+ 0x358C5000, 0x34700184, 0x228B4000, 0x086A1FF4, -+ 0x1D691FB4, 0x1B624010, 0x0A6140A4, 0x228B4000, -+ 0x28004000, 0x1531FFFE, 0x268C0400, 0x3F424000, -+ 0x2880052B, 0x2C8C5080, 0x33BC0053, 0x13204096, -+ 0x228B4000, 0x2C8C5080, 0x33BC0053, 0x13204096, -+ 0x3E500C63, 0x228B4000, 0x1B6A1FBE, 0x096140A8, -+ 0x096240A4, 0x238C0100, 0x34700184, 0x0E6A1FF2, -+ 0x0B614000, 0x05624004, 0x086A1FF4, 0x05614008, -+ 0x16624014, 0x238C0100, 0x20694080, 0x18350001, -+ 0x0ACC0552, 0x228B4000, 0x1D2E0001, 0x1B624010, -+ 0x25218020, 0x3C800093, 0x08631FD6, 0x16502DE7, -+ 0x3F502084, 0x3B97053D, 0x13502931, 0x36970539, -+ 0x23700080, 0x13503548, 0x03501CE4, 0x3B97053D, -+ 0x315024A9, 0x36970539, 0x0350A148, 0x0A5035A4, -+ 0x3B97053D, 0x3350252E, 0x36970539, 0x0E502929, -+ 0x145035B0, 0x3B97053D, 0x3F502108, 0x36970539, -+ 0x2B5025A9, 0x1D502CA6, 0x3B97053D, 0x1450288A, -+ 0x36970539, 0x2350B4EB, 0x18509525, 0x3B97053D, -+ 0x37501086, 0x36970539, 0x0F502D67, 0x035035AD, -+ 0x3B97053D, 0x1C501991, 0x36970539, 0x0F6B4080, -+ 0x00631FEE, 0x235098C4, 0x27509DAF, 0x3B97053D, -+ 0x1450316C, 0x36970539, 0x00509148, 0x1E502CC6, -+ 0x3B97053D, 0x1A50358E, 0x36970539, 0x355099AB, -+ 0x3A6B1FD6, 0x228B4000, 0x08631FD6, 0x30700090, -+ 0x21970512, 0x358C5000, 0x23700080, 0x13204096, -+ 0x3E500C63, 0x235024E4, 0x13204096, 0x3E500C63, -+ 0x045030A6, 0x36970539, 0x2850B12C, 0x395020EE, -+ 0x3B97053D, 0x0B5028AF, 0x36970539, 0x3D50A90A, -+ 0x3D50AD8C, 0x36970539, 0x29503D6B, 0x1850C54A, -+ 0x3B97053D, 0x0F6B4080, 0x00631FEE, 0x23700080, -+ 0x1C50352B, 0x36970539, 0x326B1FEE, 0x236A4080, -+ 0x07330006, 0x06D405AE, 0x2B320006, 0x23D005D3, -+ 0x3220000D, 0x2580045A, 0x3E500C63, 0x16502D8B, -+ 0x3B97053D, 0x3450252F, 0x36970539, 0x3950252B, -+ 0x3350210B, 0x3B97053D, 0x1B5018E5, 0x36970539, -+ 0x3E500C63, 0x205044D1, 0x3B97053D, 0x3D502409, -+ 0x36970539, 0x0550A531, 0x065018CB, 0x36970539, -+ 0x3E500C63, 0x32504409, 0x3B97053D, 0x2450112C, -+ 0x36970539, 0x3650B62D, 0x0D50300C, 0x36970539, -+ 0x3E500C63, 0x025035AA, 0x36970539, 0x2550B50D, -+ 0x3B502520, 0x36970539, 0x1B501C63, 0x3350140D, -+ 0x36970539, 0x3A6B1FD6, 0x228B4000, 0x2397052F, -+ 0x3F6B1FDC, 0x0D691FF2, 0x1D6A1FD4, 0x1F05C000, -+ 0x20970523, 0x1E691FB8, 0x3F681FD0, 0x219704A8, -+ 0x13691FD0, 0x12220002, 0x32970534, 0x1E691FB8, -+ 0x2C681FC0, 0x2D9704AB, 0x00691FC0, 0x15220003, -+ 0x32970534, 0x21970512, 0x358C5000, 0x23700080, -+ 0x13204096, 0x3E500C63, 0x3F502084, 0x13204096, -+ 0x3E500C63, 0x0B5035CF, 0x36970539, 0x3E500C63, -+ 0x0C502D07, 0x3B97053D, 0x195034AD, 0x36970539, -+ 0x3E500C63, 0x325024A5, 0x3B97053D, 0x165029AE, -+ 0x36970539, 0x0F503144, 0x2F502531, 0x3B97053D, -+ 0x0250194A, 0x36970539, 0x295010C8, 0x0E50318C, -+ 0x3B97053D, 0x085028CF, 0x36970539, 0x24502569, -+ 0x195019AD, 0x3B97053D, 0x25501004, 0x36970539, -+ 0x3E50B08C, 0x11502D29, 0x3B97053D, 0x1B5019A6, -+ 0x36970539, 0x3E500C63, 0x3450140C, 0x3B97053D, -+ 0x2750218F, 0x36970539, 0x2550AD0B, 0x04502940, -+ 0x36970539, 0x3E500C63, 0x0C50300B, 0x3B97053D, -+ 0x3C5011AB, 0x36970539, 0x3250B585, 0x3B502520, -+ 0x36970539, 0x3E500C63, 0x0E5035A9, 0x36970539, -+ 0x3350B54D, 0x15502C0B, 0x36970539, 0x1B501C63, -+ 0x3350140D, 0x36970539, 0x3A6B1FD6, 0x228B4000, -+ 0x08631FD6, 0x2397052F, 0x03691FCC, 0x3F6B1FDC, -+ 0x2F681FFA, 0x1E220001, 0x3304C000, 0x309704B3, -+ 0x2B970521, 0x08691FCE, 0x3F6B1FDC, 0x21681FF2, -+ 0x1E220001, 0x3304C000, 0x3304C000, 0x309704B3, -+ 0x2B970521, 0x30700090, 0x21970512, 0x358C5000, -+ 0x13204096, 0x3E500C63, 0x0B502A25, 0x13204096, -+ 0x3E500C63, 0x2250248F, 0x36970539, 0x0250292A, -+ 0x285020AF, 0x3B97053D, 0x25501004, 0x36970539, -+ 0x00502D04, 0x295038AE, 0x3B97053D, 0x245024E5, -+ 0x36970539, 0x1650A088, 0x2A50392E, 0x3B97053D, -+ 0x19502D4B, 0x36970539, 0x3E500C63, 0x0A502924, -+ 0x3B97053D, 0x0F502CEB, 0x36970539, 0x00502DCB, -+ 0x3B5011AA, 0x3B97053D, 0x3F502108, 0x36970539, -+ 0x3E500C63, 0x15502C0B, 0x3B97053D, 0x2A5020C8, -+ 0x36970539, 0x2550AD0B, 0x0D502925, 0x36970539, -+ 0x1B501C63, 0x3550140B, 0x3B97053D, 0x185019AA, -+ 0x36970539, 0x3A6B1FD6, 0x228B4000, 0x08631FD6, -+ 0x21681FF2, 0x10691FDC, 0x086A1FF4, 0x19044000, -+ 0x27604000, 0x289704A1, 0x21681FF2, 0x35054000, -+ 0x19044000, 0x289704A1, 0x07024000, 0x39694000, -+ 0x29681FCA, 0x3997009F, 0x21970512, 0x13204096, -+ 0x268C0400, 0x3E500C63, 0x225020C6, 0x3B97053D, -+ 0x325024A5, 0x36970539, 0x3E500C63, 0x0E502D0C, -+ 0x3B97053D, 0x1C502884, 0x36970539, 0x3E500C63, -+ 0x335021A8, 0x3B97053D, 0x00502C2B, 0x36970539, -+ 0x1450296A, 0x30502028, 0x36970539, 0x0D50A509, -+ 0x09502944, 0x36970539, 0x3E500C63, 0x325024C9, -+ 0x36970539, 0x1B50A549, 0x2A502144, 0x3B97053D, -+ 0x3D502409, 0x36970539, 0x358C5000, 0x0F6B4080, -+ 0x3E370008, 0x0ECC06A0, 0x2720001B, 0x2580045A, -+ 0x3A6B1FD6, 0x228B4000, 0x1E631FCC, 0x2C681FC0, -+ 0x3930FFFE, 0x0A500001, 0x1B204098, 0x3F5010E4, -+ 0x01000000, 0x1B204098, 0x358C5000, 0x275014E5, -+ 0x01000000, 0x1B204098, 0x358C5000, 0x175018E6, -+ 0x136A1FDC, 0x07018000, 0x35068000, 0x36064000, -+ 0x36970539, 0x278006ED, 0x1E631FCC, 0x036A1FC0, -+ 0x1632FFFE, 0x358C5000, 0x25520001, 0x1B204098, -+ 0x175018E6, 0x296B1FF0, 0x2C681FF6, 0x08691FF8, -+ 0x10631FC4, 0x18601FC6, 0x3C611FC8, 0x3F6B1FDC, -+ 0x126840A2, 0x03691FFA, 0x18631FCA, 0x15601FC2, -+ 0x3A611FCE, 0x02684088, 0x306940AA, 0x0D601FD0, -+ 0x2A611FD2, 0x34681FBE, 0x0B691FF4, 0x0E6A1FF2, -+ 0x3A9706F3, 0x387000C4, 0x226B1FC4, 0x056A1FC6, -+ 0x0E691FC8, 0x1B631FF0, 0x31621FF6, 0x3A611FF8, -+ 0x2A6B1FCA, 0x086A1FC2, 0x08691FCE, 0x0D631FDC, -+ 0x0F6240A2, 0x026240A6, 0x1B6A1FD2, 0x31611FFA, -+ 0x016240AA, 0x358C5000, 0x13691FD0, 0x02030000, -+ 0x1C614088, 0x053F0001, 0x0CCC06F1, 0x15691FBA, -+ 0x24970542, 0x13691FBC, 0x24970542, 0x136A1FDC, -+ 0x35068000, 0x15691FBA, 0x2A681FF0, 0x3997009F, -+ 0x31200001, 0x2C6B1FCC, 0x228B4000, 0x1D601FFA, -+ 0x18601FF0, 0x39611FF4, 0x3A611FF8, 0x3C621FF2, -+ 0x18614010, 0x08624000, 0x20250002, 0x2435FFFE, -+ 0x19044000, 0x1531FFFE, 0x19044000, 0x1E601FF6, -+ 0x2A604004, 0x29604008, 0x3930FFFE, 0x1E220001, -+ 0x16624014, 0x26228020, 0x2A694010, 0x358C5000, -+ 0x06500002, 0x0D500000, 0x1862401C, 0x15614014, -+ 0x066A1FFC, 0x268C0400, 0x2B008000, 0x2D36FFFB, -+ 0x32C801EB, 0x3E340004, 0x1B601FFC, 0x388001EB, -+ 0x19220000, 0x31800717, 0x00220080, 0x09661FFF, -+ 0x0E631FE6, 0x19220000, 0x05661FFC, 0x3F9704BC, -+ 0x2A97008F, 0x359704D5, 0x369704EF, 0x2397052F, -+ 0x18691FD2, 0x14220004, 0x32970534, 0x08691FCE, -+ 0x3F6B1FDC, 0x21681FF2, 0x12220002, 0x3304C000, -+ 0x3304C000, 0x309704B3, 0x2B970521, 0x21970512, -+ 0x1A21889C, 0x0A614092, 0x358C5000, 0x23700080, -+ 0x1E691FE2, 0x29970083, 0x02624090, 0x13204096, -+ 0x095029E7, 0x035030A7, 0x13204096, 0x095029E7, -+ 0x325024A5, 0x36970539, 0x3A970556, 0x02194000, -+ 0x31C80748, 0x29970083, 0x02624090, 0x1B204098, -+ 0x035030A7, 0x3B97053D, 0x325024A5, 0x36970539, -+ 0x2080073A, 0x358C5000, 0x29200013, 0x2580045A, -+ 0x358C5000, 0x236A4080, 0x09360020, 0x1ACC0751, -+ 0x24970628, 0x358C5000, 0x3E97066B, 0x31200001, -+ 0x2580045A, 0x1E6A1FEE, 0x1C6B4090, 0x27320005, -+ 0x1A1EC000, 0x1B360001, 0x25C80759, 0x3220000D, -+ 0x2580045A, 0x3D200002, 0x2580045A, 0x0F220040, -+ 0x2E80075E, 0x162200C0, 0x09661FFF, 0x0E631FE6, -+ 0x14220004, 0x05661FFC, 0x3F9704BC, 0x359704D5, -+ 0x166A1FBA, 0x03691FFA, 0x20970523, 0x3F6B1FDC, -+ 0x03691FFA, 0x0B6A1FCE, 0x1F05C000, 0x20970523, -+ 0x1B6A1FBE, 0x00691FF6, 0x20970523, 0x3F6B1FDC, -+ 0x00691FF6, 0x106A1FD0, 0x1F05C000, 0x20970523, -+ 0x22681FFE, 0x07180000, 0x37D0077E, 0x1B691FB2, -+ 0x3F681FBC, 0x2D9704AB, 0x1B691FB2, 0x2C681FC0, -+ 0x2D9704AB, 0x3F80078A, 0x3F6B1FDC, 0x03691FFA, -+ 0x106A1FBC, 0x1F05C000, 0x1F05C000, 0x20970523, -+ 0x3F6B1FDC, 0x00691FF6, 0x036A1FC0, 0x1F05C000, -+ 0x1F05C000, 0x20970523, 0x2597058A, 0x358C5000, -+ 0x3E97066B, 0x31200001, 0x2580045A, 0x0C220020, -+ 0x2E800791, 0x09661FFF, 0x0E631FE6, 0x3F9704BC, -+ 0x359704D5, 0x369704EF, 0x2397052F, 0x18691FD2, -+ 0x12220002, 0x32970534, 0x32681FD4, 0x18691FD2, -+ 0x27604000, 0x06614004, 0x24681FCE, 0x29604008, -+ 0x238C0100, 0x25218020, 0x1B61401C, 0x27604000, -+ 0x29604008, 0x12220002, 0x268C0400, 0x15624018, -+ 0x26218040, 0x1B61401C, 0x21970512, 0x1A21889C, -+ 0x0A614092, 0x358C5000, 0x23700080, 0x1E691FE2, -+ 0x29970083, 0x02624090, 0x13204096, 0x358C5000, -+ 0x2A5020A4, 0x13204096, 0x1F50A4A4, 0x36970539, -+ 0x145028E6, 0x1A503108, 0x36970539, 0x358C5000, -+ 0x2150ACE6, 0x17503529, 0x0F6B4080, 0x13204096, -+ 0x25370020, 0x04CC0745, 0x1B50C1AC, 0x31502549, -+ 0x36970539, 0x3E500C63, 0x3C502168, 0x36970539, -+ 0x04502D09, 0x3D5011AC, 0x36970539, 0x0D50A509, -+ 0x0E5029D0, 0x36970539, 0x2450214C, 0x1050196B, -+ 0x36970539, 0x3E500C63, 0x12501D29, 0x36970539, -+ 0x3E500C63, 0x14509510, 0x36970539, 0x3E500C63, -+ 0x3F509DE7, 0x36970539, 0x0F6B4080, 0x00631FEE, -+ 0x02194000, 0x34C807E1, 0x29970083, 0x02624090, -+ 0x378007B2, 0x358C5000, 0x236A4080, 0x09360020, -+ 0x1ACC07F2, 0x30700090, 0x02501865, 0x36970539, -+ 0x1B501C63, 0x36970539, 0x38501463, 0x36970539, -+ 0x2C681FC0, 0x268C0400, 0x36200000, 0x2A641FFC, -+ 0x31200001, 0x2580045A, 0x1E6A1FEE, 0x1C6B4090, -+ 0x27320005, 0x1A1EC000, 0x1B360001, 0x39C807E5, -+ 0x3220000D, 0x2580045A, 0x01000000, 0x01000000, -+ 0x1E79084F -+}; -+ -+static const uint32_t fw2_boot_img_data_buf[] = -+{ -+ 0x36200000, 0x16210003, 0x15710249, 0x31200001, -+ 0x2860B41C, 0x2A97008F, 0x1A210000, 0x1231FFFF, -+ 0x1B390001, 0x092CFFFF, 0x00CC0007, 0x0761B140, -+ 0x3A200333, 0x3060B438, 0x3E60B45C, 0x3D60B43C, -+ 0x0A20FFFF, 0x2D60B420, 0x1A210000, 0x1F68B420, -+ 0x0A61B422, 0x1234FEFE, 0x05300001, 0x2D60B420, -+ 0x0C61B424, 0x0761B426, 0x0F61B428, 0x0461B42A, -+ 0x0261B42C, 0x0961B42E, 0x1F61B434, 0x1461B436, -+ 0x2A97008F, 0x1C21A0CA, 0x33228000, 0x3F424000, -+ 0x032D0100, 0x092CFFFF, 0x18CC0023, 0x156AA0CA, -+ 0x2C320007, 0x133600C0, 0x123A0004, 0x3C66B149, -+ 0x11B8002F, 0x30224000, 0x3C800030, 0x19220000, -+ 0x06210045, 0x0C61B424, 0x35230000, 0x2D63B42C, -+ 0x2A97008F, 0x13232000, 0x0C62B428, 0x3063B434, -+ 0x16210333, 0x278C0078, 0x2BBC0077, 0x1C61B438, -+ 0x092CFFFF, 0x01CC0036, 0x386AB148, 0x2636FF00, -+ 0x193A0300, 0x0A62B148, 0x268C0400, 0x3B69B148, -+ 0x343E0100, 0x0A62B148, 0x06350080, 0x09CC0054, -+ 0x1C21A0CA, 0x0D4A4000, 0x2A97008F, 0x0E262000, -+ 0x1ED40079, 0x3F424000, 0x032D0100, 0x092CFFFF, -+ 0x13CC004D, 0x2E60B42C, 0x2560B42E, 0x2E800027, -+ 0x2A97008F, 0x1721A0C8, 0x19220000, 0x3F424000, -+ 0x122D0002, 0x3F424000, 0x182D00FE, 0x092CFFFF, -+ 0x05CC0057, 0x1A223000, 0x2F712049, 0x05B80064, -+ 0x33214000, 0x35230000, 0x3F222000, 0x3F800066, -+ 0x1A210000, 0x35230000, 0x1820B424, 0x19500011, -+ 0x0A500001, 0x1150C400, 0x0A500001, 0x0261B42C, -+ 0x2663B42E, 0x1C62B434, 0x39230333, 0x278C0078, -+ 0x2BBC0077, 0x3363B438, 0x36200000, 0x2B60B140, -+ 0x13710149, 0x398C0000, 0x20800075, 0x3371FF49, -+ 0x20800075, 0x2F71FD49, 0x20800075, 0x2A320001, -+ 0x0A367FFF, 0x21C8008E, 0x252A0008, 0x1EC0008A, -+ 0x0D500000, 0x0D500000, 0x0D500000, 0x0D500000, -+ 0x0D500000, 0x0D500000, 0x0D500000, 0x0D500000, -+ 0x21C8008E, 0x2280007E, 0x26260008, 0x0D500000, -+ 0x262EFFFF, 0x1ACC008B, 0x228B4000, 0x0868B1F8, -+ 0x3C34000F, 0x0128000A, 0x33C40095, 0x0224000A, -+ 0x228B4000, 0x3320000A, 0x228B4000, 0x01000000, -+ 0x01000000, 0x01000000 -+}; -+ -+static const uint32_t fw2_master_img_data_buf[] = -+{ -+ 0x36200000, 0x16210003, 0x3C605FF4, 0x1B615FF6, -+ 0x36200000, 0x2560B148, 0x1A205FE0, 0x38215FE8, -+ 0x3B230008, 0x1F090000, 0x10C0010E, 0x31200001, -+ 0x2860B41C, 0x2A9700B9, 0x329700C7, 0x1C208000, -+ 0x2B60B140, 0x01000000, 0x19220000, 0x0B685FFE, -+ 0x2469B1F8, 0x2B3C4600, 0x1ECC0013, 0x1D2E0001, -+ 0x28038000, 0x01000000, 0x0A2FFFFF, 0x1BCC0019, -+ 0x0B685FFE, 0x2469B1F8, 0x2B3C4600, 0x22C80021, -+ 0x25800013, 0x056B5FFA, 0x333B0000, 0x14D40026, -+ 0x363700FF, 0x2E63B47A, 0x3A200333, 0x3060B438, -+ 0x3E60B45C, 0x3D60B43C, 0x39230003, 0x2F22B400, -+ 0x0A20FFFF, 0x13408000, 0x1A210000, 0x21488000, -+ 0x23260002, 0x3F418000, 0x1234FEFE, 0x05300001, -+ 0x202A0002, 0x13408000, 0x3D260020, 0x0A2FFFFF, -+ 0x17CC002C, 0x36200000, 0x3E60B406, 0x2D60B416, -+ 0x2B60B426, 0x3860B436, 0x2860B446, 0x3B60B456, -+ 0x036B5FFC, 0x00210100, 0x05222F00, 0x29370080, -+ 0x27C80047, 0x1A210000, 0x1A223000, 0x1820B424, -+ 0x19500011, 0x0A500001, 0x1150C400, 0x0A500001, -+ 0x15410000, 0x3E2C0002, 0x0D500000, 0x1C62B434, -+ 0x10205E90, 0x0D220164, 0x0F970FF0, 0x2469B1F8, -+ 0x15220333, 0x36200000, 0x278C0078, 0x26BC0106, -+ 0x1F62B438, 0x2060B424, 0x2B60B426, 0x33610102, -+ 0x1035000F, 0x38610100, 0x0A68B400, 0x3369B420, -+ 0x32605FCA, 0x13615FCE, 0x353400FF, 0x2C380200, -+ 0x34605FCC, 0x2535FF00, 0x17390002, 0x08615FD0, -+ 0x12970F7D, 0x31200001, 0x2E605EA0, 0x202001A0, -+ 0x1760010C, 0x35203000, 0x1C60010E, 0x31200001, -+ 0x2560B148, 0x30695EA0, 0x33228000, 0x28004000, -+ 0x063C0001, 0x1FCC0078, 0x0462B140, 0x2280007E, -+ 0x28004000, 0x0C3C0004, 0x19CC007E, 0x1968B140, -+ 0x283C4000, 0x2B60B140, 0x1035000F, 0x1231FFFF, -+ 0x0B2D0082, 0x0D894000, 0x248C1D78, 0x318000A1, -+ 0x2F8C1D7A, 0x318000A1, 0x3D8C1DF8, 0x318000A1, -+ 0x368C1DFA, 0x318000A1, 0x298C1D7C, 0x318000A1, -+ 0x228C1D7E, 0x318000A1, 0x308C1DFC, 0x318000A1, -+ 0x3B8C1DFE, 0x318000A1, 0x238C1D79, 0x318000A1, -+ 0x288C1D7B, 0x318000A1, 0x3A8C1DF9, 0x318000A1, -+ 0x318C1DFB, 0x318000A1, 0x2E8C1D7D, 0x318000A1, -+ 0x258C1D7F, 0x318000A1, 0x378C1DFD, 0x318000A1, -+ 0x3C8C1DFF, 0x2EB00104, 0x05BC0C60, 0x33D80D2D, -+ 0x35A00C61, 0x18A40C87, 0x04A80CA2, 0x08F80F6B, -+ 0x35E80D4B, 0x31E00122, 0x336A5EA0, 0x362300AF, -+ 0x17360002, 0x33C800AF, 0x21AC0EF6, 0x31215EA2, -+ 0x07220014, 0x1D97100D, 0x27C80071, 0x21884000, -+ 0x30380000, 0x3AC8011C, 0x31215EA2, 0x07220014, -+ 0x19801030, 0x36200000, 0x0D500000, 0x0D500000, -+ 0x0D500000, 0x0D500000, 0x36200000, 0x2760B000, -+ 0x2960B008, 0x1E220001, 0x1B62B010, 0x3760B01C, -+ 0x10228800, 0x1862B01C, 0x228B4000, 0x0868B1F8, -+ 0x2D635E96, 0x3C34000F, 0x02030000, 0x022B000A, -+ 0x05C000CE, 0x3320000A, 0x02030000, 0x1A210000, -+ 0x1231FFFF, 0x1B390001, 0x092CFFFF, 0x1DCC00D0, -+ 0x0761B140, 0x33228000, 0x2D010000, 0x20310008, -+ 0x1A39A0CA, 0x3F424000, 0x19220000, 0x3F424000, -+ 0x0C220020, 0x392DFFBA, 0x3F424000, 0x3860B150, -+ 0x022D0044, 0x28200014, 0x0D4A4000, 0x092CFFFF, -+ 0x2BC800E7, 0x06360100, 0x21C800E2, 0x28004000, -+ 0x0C300008, 0x3C34000F, 0x1A22C000, 0x22520000, -+ 0x22520000, 0x19220000, 0x2B2DFF38, 0x3F424000, -+ 0x172D0008, 0x3F424000, 0x1E220001, 0x172D0008, -+ 0x3F424000, 0x19220000, 0x1A2D000C, 0x3F424000, -+ 0x10228800, 0x3F424000, 0x06220400, 0x0962B144, -+ 0x2E020000, 0x033A0200, 0x0962B144, 0x322C0001, -+ 0x0A2FFFFF, 0x17CC00D5, 0x1F6B5E96, 0x228B4000, -+ 0x0422008D, 0x32800117, 0x09220089, 0x32800117, -+ 0x0C220083, 0x32800117, 0x0A220085, 0x32800117, -+ 0x13220005, 0x32800117, 0x01220087, 0x32800117, -+ 0x18220007, 0x32800117, 0x0D220011, 0x32800117, -+ 0x0222008B, 0x32800117, 0x1B22000B, 0x15625FF2, -+ 0x32635FF0, 0x23320008, 0x0A62B148, 0x3BD0011D, -+ 0x228B4000, 0x31200001, 0x2A9700B9, 0x329700C7, -+ 0x398C0000, 0x35800120, 0x33695F20, 0x2C200136, -+ 0x1C35C000, 0x36C80129, 0x12685F24, 0x043D4000, -+ 0x08CC00AA, 0x3C2300AA, 0x336A5EA0, 0x03210080, -+ 0x2736FFFE, 0x01625EA0, 0x37655F21, 0x288000B4, -+ 0x33695F20, 0x12685F24, 0x1C35C000, 0x2E3DC000, -+ 0x3AC8012A, 0x228B4000, 0x0C970F90, 0x30C801D6, -+ 0x20605F24, 0x00685FFC, 0x1A210000, 0x09615F2E, -+ 0x3F340003, 0x372C0148, 0x21884000, 0x36200000, -+ 0x2360B122, 0x3580014C, 0x146BB124, 0x38695F22, -+ 0x36200000, 0x37370001, 0x15CC0152, 0x3965B123, -+ 0x3580014C, 0x2980013F, 0x3D800142, 0x33970116, -+ 0x1168B122, 0x3B69B124, 0x2F34001F, 0x29310001, -+ 0x19110000, 0x11D401CC, 0x036B5FFC, 0x1C645F20, -+ 0x0A37FF00, 0x0F330008, 0x300B0000, 0x1EC001C9, -+ 0x3D6A5F24, 0x3F215F26, 0x0C2E0040, 0x13408000, -+ 0x3330FFFB, 0x1C2C4000, 0x0B97104D, 0x35695F26, -+ 0x362C000C, 0x13350003, 0x1ECC01C5, 0x3F215F26, -+ 0x2222FFFE, 0x16971063, 0x3E695F24, 0x382C0004, -+ 0x244A0000, 0x042D0042, 0x3F424000, 0x1D2E0001, -+ 0x16420000, 0x12971097, 0x1B970CBD, 0x19685F26, -+ 0x3D695F28, 0x3660B408, 0x1161B40A, 0x12685F24, -+ 0x2421B40E, 0x3B60B40C, 0x21510000, 0x24200021, -+ 0x3560B404, 0x20200040, 0x2660B414, 0x3320017F, -+ 0x0721016D, 0x362300AF, 0x11800CE4, 0x1F685F20, -+ 0x316A5FE8, 0x353400FF, 0x26605F22, 0x1D2E0001, -+ 0x03625FE8, 0x02030000, 0x3330FFFB, 0x0F2C4010, -+ 0x244A0000, 0x382C0004, 0x27490000, 0x2C3B0400, -+ 0x1E2D0001, 0x350A4000, 0x23C40190, 0x1A210000, -+ 0x15410000, 0x12685F24, 0x2B63B120, 0x3D2C0038, -+ 0x0D500000, 0x0D500000, 0x0D500000, 0x0D500000, -+ 0x002CFFF6, 0x244A0000, 0x052CFFCA, 0x146B5F2E, -+ 0x36368000, 0x1DCC01A5, 0x333B0000, 0x22C801C1, -+ 0x332F003C, 0x3A40C000, 0x0C685F30, 0x20605F24, -+ 0x288001C1, 0x25605F2E, 0x333B0000, 0x12CC01AA, -+ 0x3E605F30, 0x2F8001AC, 0x332F003C, 0x3A40C000, -+ 0x33695F20, 0x1768B124, 0x1E220001, 0x35230000, -+ 0x193500FF, 0x190B4000, 0x1912C000, 0x2E148000, -+ 0x01CC01BA, 0x3E970112, 0x202301AC, 0x23635F24, -+ 0x20200040, 0x208001CF, 0x0C970F90, 0x3BC801D4, -+ 0x20605F24, 0x1F685F20, 0x3D6A5F24, 0x353400FF, -+ 0x2C800159, 0x35215FDA, 0x03970FA9, 0x282301CE, -+ 0x3E8001DB, 0x1F685F20, 0x35970110, 0x353400FF, -+ 0x2A8001CA, 0x33970116, 0x2F380400, 0x2860B120, -+ 0x12685F24, 0x06970FA3, 0x36200000, 0x336A5EA0, -+ 0x1B645F21, 0x183A0001, 0x01625EA0, 0x398000AF, -+ 0x352301BA, 0x3D8001D7, 0x2F230136, 0x23635F24, -+ 0x392000C0, 0x1B645F21, 0x398000AF, 0x2B695F32, -+ 0x1C208000, 0x28150000, 0x30C801E0, 0x228B4000, -+ 0x35605F32, 0x3A2001E3, 0x288000B4, 0x18685FD8, -+ 0x3E215FD8, 0x30380000, 0x22C80208, 0x0B970FCB, -+ 0x33605F34, 0x2D010000, 0x3E2C0034, 0x0B480000, -+ 0x3C6A5FEC, 0x02030000, 0x3C34000F, 0x1D2E0001, -+ 0x0E625FEC, 0x19220000, 0x14625F3A, 0x3562013E, -+ 0x0C330004, 0x3F37000F, 0x2B2F01F8, 0x228B4000, -+ 0x2C8003D3, 0x3E80055D, 0x2A80073F, 0x3A80074F, -+ 0x3780021B, 0x3780021B, 0x3780021B, 0x3780021B, -+ 0x3780021B, 0x3780021B, 0x3780021B, 0x3780021B, -+ 0x3780021B, 0x3780021B, 0x00800C30, 0x3780021B, -+ 0x33605F34, 0x35605F32, 0x398000AF, 0x112200C1, -+ 0x3D80021E, 0x192200A3, 0x3D80021E, 0x0F22008F, -+ 0x3D80021E, 0x0A220085, 0x3D80021E, 0x162200C0, -+ 0x3D80021E, 0x152200A0, 0x3D80021E, 0x122200A1, -+ 0x3D80021E, 0x07220081, 0x3D80021E, 0x01220087, -+ 0x3D80021E, 0x19220000, 0x07685F32, 0x1F625F38, -+ 0x30230223, 0x16341000, 0x00CC02BB, 0x2997037C, -+ 0x01685F34, 0x2D6A5F38, 0x23230233, 0x392C0035, -+ 0x27460000, 0x2D695F34, 0x3780028E, 0x1160013C, -+ 0x2B635F46, 0x2997037C, 0x2C200230, 0x38605F36, -+ 0x229703B1, 0x05CC027E, 0x22970251, 0x0A6A010C, -+ 0x35680110, 0x3D2A01A0, 0x3CC801E3, 0x30380000, -+ 0x0DCC01E3, 0x28620110, 0x0B970CCD, 0x1A6A0110, -+ 0x1820B424, 0x19500011, 0x0A500001, 0x1150C400, -+ 0x0A500001, 0x1B5001A0, 0x0D500000, 0x1C62B434, -+ 0x11210247, 0x392301E3, 0x18940CE7, 0x3D6B0112, -+ 0x0F2201A0, 0x3862010C, 0x36200000, 0x1A6A0110, -+ 0x0C600112, 0x07600110, 0x333B0000, 0x07CC03A3, -+ 0x398000AF, 0x33635F38, 0x011A4000, 0x0462B140, -+ 0x1F6B5EA0, 0x2E020000, 0x3E3B0004, 0x2D635EA0, -+ 0x1A388000, 0x35605F32, 0x2B008000, 0x0E300003, -+ 0x2B605F4A, 0x2B008000, 0x3F30FFF8, 0x1E384001, -+ 0x2D605F4C, 0x1132FFFF, 0x2C2E0D70, 0x20230265, -+ 0x0E8A4000, 0x26605F4E, 0x0A6A010C, 0x202001A0, -+ 0x1A210000, 0x1C0A0000, 0x14970E54, 0x07970E72, -+ 0x046B5F32, 0x14685F4E, 0x3F37000F, 0x293B0100, -+ 0x2E6A5F34, 0x2563B144, 0x16420000, 0x36695F46, -+ 0x3E2C0002, 0x15410000, 0x266A5F3A, 0x3E2C0002, -+ 0x16420000, 0x23695F3C, 0x016B5F38, 0x3E2C0002, -+ 0x15410000, 0x228B4000, 0x3520C000, 0x35605F32, -+ 0x14970CDE, 0x0F220040, 0x1820B424, 0x19500011, -+ 0x01500003, 0x1150C400, 0x0A500001, 0x0E500180, -+ 0x0D500000, 0x1C62B434, 0x352000AF, 0x192100AF, -+ 0x362300AF, 0x1D800CE7, 0x28635E9C, 0x1B6B5FEE, -+ 0x0A615E98, 0x192D0036, 0x22484000, 0x312F0001, -+ 0x29635FEE, 0x00349FFF, 0x10404000, 0x19348000, -+ 0x27C802A1, 0x222DFFFE, 0x0D4A4000, 0x172D0008, -+ 0x22484000, 0x02625E9A, 0x21510000, 0x30380000, -+ 0x32C802B7, 0x20605E9E, 0x14685E98, 0x33215FDC, -+ 0x1C970FBA, 0x13970EF6, 0x12685E9E, 0x1A6B5E9C, -+ 0x30380000, 0x13CC02AB, 0x228B4000, 0x306A5E9A, -+ 0x3E215FD8, 0x2636FF00, 0x3ED002B2, 0x1C970FBA, -+ 0x1A6B5E9C, 0x3E8001DB, 0x23320008, 0x392C0035, -+ 0x27460000, 0x3E695E9E, 0x3080028F, 0x2E97010E, -+ 0x39209000, 0x35605F32, 0x0280108D, 0x1C208000, -+ 0x35605F32, 0x1680109C, 0x19685F4A, 0x33695F4C, -+ 0x1632FFFE, 0x1A048000, 0x19220000, 0x29058400, -+ 0x2B605F4A, 0x01615F4C, 0x228B4000, 0x3B635F36, -+ 0x0A625E94, 0x379702BE, 0x386A5E94, 0x09685F3A, -+ 0x3B8002D7, 0x3B635F36, 0x30380000, 0x31D002D1, -+ 0x21970372, 0x09685F3A, 0x1C390000, 0x31C802D7, -+ 0x09300002, 0x10404000, 0x3930FFFE, 0x2D010000, -+ 0x0F2D01A0, 0x3E610106, 0x1632FFFE, 0x26C80370, -+ 0x28038000, 0x06330001, 0x01D402E0, 0x172E0004, -+ 0x280C8000, 0x3B605F3A, 0x28038000, 0x3F37000F, -+ 0x37C802E7, 0x2F36FFF0, 0x092E0010, 0x1F6B5F40, -+ 0x19625F3E, 0x1A0B8000, 0x36C402EC, 0x01625F40, -+ 0x386A5F42, 0x36200000, 0x133600C0, 0x2B320006, -+ 0x28C802F4, 0x232C0040, 0x262EFFFF, 0x2F8002F0, -+ 0x19600104, 0x09970D10, 0x352000AF, 0x00970D19, -+ 0x0F970D20, 0x0B970CCD, 0x07690104, 0x2B680104, -+ 0x1F2D0030, 0x0D4A4000, 0x122D0002, 0x214B4000, -+ 0x123EFFFF, 0x1A1EC000, 0x11CC0340, 0x3421B424, -+ 0x30510041, 0x2360B428, 0x142D0004, 0x21510000, -+ 0x3151C010, 0x26510001, 0x11220038, 0x1C62B434, -+ 0x062102F9, 0x362300AF, 0x18940CE7, 0x3320003C, -+ 0x3960B348, 0x1B970CBD, 0x0B970CCD, 0x20680106, -+ 0x3721B428, 0x2B6A5F3E, 0x156B5FD0, 0x0451E000, -+ 0x26510001, 0x2E60B42C, 0x122D0002, 0x21510000, -+ 0x24200311, 0x2E63B420, 0x2060B424, 0x1C62B434, -+ 0x19685F4A, 0x33695F4C, 0x3660B408, 0x1161B40A, -+ 0x056B5FCC, 0x2F21B40C, 0x0451E000, 0x26510001, -+ 0x17201061, 0x3B63B400, 0x3560B404, 0x0962B414, -+ 0x3A200003, 0x3D605F50, 0x3F200339, 0x06210343, -+ 0x1B970CE7, 0x362300AF, 0x14940CE4, 0x0F685F50, -+ 0x0834FFFE, 0x3D605F50, 0x30380000, 0x38C8033E, -+ 0x398000AF, 0x0F685F50, 0x0434FFFD, 0x3D605F50, -+ 0x30380000, 0x02CC00AF, 0x096B5F36, 0x08800D27, -+ 0x1E970CED, 0x2D23020D, 0x08800D27, 0x292302F9, -+ 0x18800CED, 0x3B635F36, 0x30380000, 0x2FD00349, -+ 0x21970372, 0x09685F3A, 0x1C390000, 0x2FC8034F, -+ 0x09300002, 0x10404000, 0x3930FFFE, 0x2D010000, -+ 0x0F2D01A0, 0x3E610106, 0x1632FFFE, 0x26C80370, -+ 0x1F6B5F40, 0x19625F3E, 0x1A0B8000, 0x39C40359, -+ 0x01625F40, 0x28038000, 0x0D330003, 0x00D4035D, -+ 0x172E0004, 0x280C8000, 0x3B605F3A, 0x1B970CBD, -+ 0x19685F4A, 0x33695F4C, 0x3660B408, 0x1161B40A, -+ 0x20680106, 0x2B6A5F3E, 0x2421B40E, 0x21510000, -+ 0x3B60B40C, 0x24200021, 0x3560B404, 0x0962B414, -+ 0x0A685F36, 0x1621035F, 0x362300AF, 0x11800CE4, -+ 0x096B5F36, 0x35800116, 0x2B635E90, 0x026B5F34, -+ 0x010CC000, 0x084B0000, 0x3E2C0002, 0x0B480000, -+ 0x28635F4A, 0x196B5E90, 0x2D605F4C, 0x228B4000, -+ 0x336A5F40, 0x36200000, 0x2E605F40, 0x1F3A0000, -+ 0x3BCC0CFF, 0x228B4000, 0x0A20FFFF, 0x192D0036, -+ 0x0D4A4000, 0x2F2DFFFA, 0x0A625F42, 0x3A34003F, -+ 0x2E148000, 0x19CC020D, 0x228B4000, 0x0D4A4000, -+ 0x122D0002, 0x0F3607FC, 0x23C8020F, 0x26320002, -+ 0x19088000, 0x11C0020F, 0x2B008000, 0x05300001, -+ 0x0DD40396, 0x1D2E0001, 0x3E30FFFF, 0x228B4000, -+ 0x2D635E96, 0x27200102, 0x2197038B, 0x12600130, -+ 0x0C625F44, 0x27200102, 0x2197038B, 0x1F6B5E96, -+ 0x1F600134, 0x07625F46, 0x228B4000, 0x0969010C, -+ 0x2E68010E, 0x3B3D01A0, 0x03CC03AE, 0x0C2E01A0, -+ 0x3862010C, 0x30380000, 0x3EC803AD, 0x19088000, -+ 0x1CC0020B, 0x228B4000, 0x28620110, 0x0F630112, -+ 0x398000AF, 0x26680100, 0x2D635E96, 0x366AB140, -+ 0x1D210001, 0x35230000, 0x03280001, 0x300B0000, -+ 0x1A11C000, 0x28038000, 0x2E174000, 0x26C803BF, -+ 0x29310001, 0x03280001, 0x23C403B9, 0x1F6B5E96, -+ 0x228B4000, 0x2D635E96, 0x19220000, 0x0A625E94, -+ 0x1A6BB140, 0x0A690100, 0x31200001, 0x2D02C000, -+ 0x2B160000, 0x386A5E94, 0x0CCC03CD, 0x1D2E0001, -+ 0x0A625E94, 0x3E30FFFF, 0x252DFFFF, 0x09CC03C7, -+ 0x1F6B5E96, 0x386A5E94, 0x228B4000, 0x09625F4E, -+ 0x292C03D6, 0x21884000, 0x3780021B, 0x208003E6, -+ 0x26800460, 0x2A800463, 0x30800483, 0x248004A4, -+ 0x36800509, 0x3C80050C, 0x2B800527, 0x2F80052A, -+ 0x27800548, 0x3780021B, 0x3780021B, 0x3780021B, -+ 0x3780021B, 0x3780021B, 0x28230018, 0x1263013C, -+ 0x28970382, 0x3E970398, 0x0F6A0130, 0x02030000, -+ 0x1A0B8000, 0x11C003EF, 0x2E020000, 0x206B013C, -+ 0x11685F44, 0x36695F46, 0x25370020, 0x04CC03F5, -+ 0x1D2E0001, 0x12625F3C, 0x2D0E0000, 0x040E4000, -+ 0x1632FFFE, 0x3A9703A3, 0x319702B8, 0x36200000, -+ 0x15210120, 0x3E6A5F44, 0x26970345, 0x38200008, -+ 0x18210124, 0x356A5F46, 0x26970345, 0x3D9702BB, -+ 0x09685F3A, 0x09210010, 0x09300002, 0x0F600128, -+ 0x35610104, 0x2997037C, 0x16970D35, 0x20680130, -+ 0x01690134, 0x1C6A0120, 0x3D6B0124, 0x3460B010, -+ 0x1561B014, 0x3D680128, 0x1C69012C, 0x172E0068, -+ 0x0862B000, 0x3B2F0068, 0x2963B004, 0x016A0138, -+ 0x382C0068, 0x2960B008, 0x142D0068, 0x0861B00C, -+ 0x1562B018, 0x2368013C, 0x362300AF, 0x1A388000, -+ 0x3760B01C, 0x1A940D3A, 0x14685F4E, 0x2E6A5F34, -+ 0x30380000, 0x38C8042B, 0x21884000, 0x1C208000, -+ 0x13408000, 0x36200000, 0x22800437, 0x09685F3A, -+ 0x2169B024, 0x012E0028, 0x1C390000, 0x3DD00427, -+ 0x09300002, 0x382C0068, 0x1F090000, 0x1531FFFE, -+ 0x0E68B028, 0x3F418000, 0x2F34001F, 0x112E0002, -+ 0x13408000, 0x2B008000, 0x3E2C0002, 0x0D500000, -+ 0x0D500000, 0x07970D42, 0x206A5F3C, 0x01685F34, -+ 0x1632FFFE, 0x3BC8021D, 0x286B0104, 0x25695F3A, -+ 0x12625F3C, 0x01625F40, 0x010CC000, 0x0F2D01A0, -+ 0x35610104, 0x27490000, 0x3E2C0002, 0x0B480000, -+ 0x07615F4A, 0x2D605F4C, 0x1B970CBD, 0x19685F4A, -+ 0x33695F4C, 0x3B60B40C, 0x1C61B40E, 0x2B680104, -+ 0x1A210000, 0x1161B40A, 0x3660B408, 0x206A5F3C, -+ 0x28200081, 0x3560B404, 0x0962B414, 0x1B21044E, -+ 0x362300AF, 0x14940CE4, 0x3E23021D, 0x2F80037C, -+ 0x2E230028, 0x1263013C, 0x288003E8, 0x28970382, -+ 0x27200102, 0x2197038B, 0x12600130, 0x0C625F44, -+ 0x322C0001, 0x3D605F3C, 0x1D32FFFC, 0x172E0004, -+ 0x3A9703A3, 0x319702B8, 0x36200000, 0x15210120, -+ 0x3E6A5F44, 0x26970345, 0x3E6A5F44, 0x38200008, -+ 0x18210124, 0x26970345, 0x3E6A5F44, 0x25200010, -+ 0x1B210128, 0x26970345, 0x3D9702BB, 0x09685F3A, -+ 0x07210018, 0x09300002, 0x0260012C, 0x35610104, -+ 0x3023000A, 0x1263013C, 0x2C800409, 0x28970382, -+ 0x3E970398, 0x11685F44, 0x2D0E0000, 0x1632FFFE, -+ 0x3A9703A3, 0x319702B8, 0x36200000, 0x15210120, -+ 0x3E6A5F44, 0x26970345, 0x356A5F46, 0x38200008, -+ 0x18210124, 0x26970345, 0x3D9702BB, 0x09685F3A, -+ 0x0F6A0130, 0x2E6B0134, 0x09300002, 0x0F600128, -+ 0x2E0EC000, 0x1632FFFE, 0x12625F3C, 0x15208009, -+ 0x3797022B, 0x0E970DE8, 0x3E680148, 0x0A970EB9, -+ 0x1A210000, 0x236A5F5C, 0x25200010, 0x00800ED6, -+ 0x06208100, 0x1160013C, 0x28970382, 0x3E970398, -+ 0x236B0130, 0x3D695F44, 0x300B0000, 0x11C0020F, -+ 0x0834FFFE, 0x23C8020F, 0x040E4000, 0x1632FFFE, -+ 0x3A9703A3, 0x319702B8, 0x36200000, 0x15210120, -+ 0x3E6A5F44, 0x26970345, 0x356A5F46, 0x38200008, -+ 0x18210124, 0x26970345, 0x3D9702BB, 0x026A0134, -+ 0x12690124, 0x262EFFFF, 0x040D8000, 0x1531FFFE, -+ 0x0F2D01A0, 0x0D4A4000, 0x122D0002, 0x0E494000, -+ 0x2368013C, 0x011A4000, 0x35C80215, 0x25695F3A, -+ 0x026A0134, 0x25310002, 0x23610128, 0x29340100, -+ 0x3DC804D8, 0x236B0130, 0x2B008000, 0x1A0B8000, -+ 0x312F0001, 0x1D2E0001, 0x05300001, 0x3FD004D5, -+ 0x1D2E0001, 0x040D8000, 0x2E61012C, 0x2E0EC000, -+ 0x1632FFFE, 0x12625F3C, 0x2368013C, 0x3797022B, -+ 0x0E970DE8, 0x0C69015C, 0x3368014C, 0x05350100, -+ 0x3EC80502, 0x0A970EB9, 0x22520000, 0x172E0004, -+ 0x07690168, 0x3E680148, 0x1C390000, 0x31D004EB, -+ 0x1F090000, 0x1531FFFE, 0x3C8004EC, 0x30218000, -+ 0x04685F52, 0x2A2EFFFC, 0x3F418000, 0x15381000, -+ 0x36605F52, 0x0497108D, 0x016A0154, 0x2068015C, -+ 0x1A210000, 0x1632FFFE, 0x29340100, 0x25200010, -+ 0x32C80501, 0x01970ED7, 0x3E680148, 0x1F69014C, -+ 0x236A5F5C, 0x1F090000, 0x1531FFFE, 0x350A4000, -+ 0x2B200018, 0x00800ED6, 0x2E6A5F58, 0x012E0028, -+ 0x22520000, 0x22520000, 0x22520000, 0x22520000, -+ 0x328004E4, 0x00208200, 0x1160013C, 0x2F8004A6, -+ 0x21200088, 0x1160013C, 0x28970382, 0x03361F00, -+ 0x23320008, 0x33620138, 0x27200102, 0x2197038B, -+ 0x12600130, 0x2D6B0138, 0x0C625F44, 0x333B0000, -+ 0x206B013C, 0x15CC051B, 0x2480051E, 0x26370040, -+ 0x1FCC051E, 0x322C0001, 0x3D605F3C, 0x2D0E0000, -+ 0x1632FFFE, 0x3A9703A3, 0x36200000, 0x15210120, -+ 0x3E6A5F44, 0x27230404, 0x20800345, 0x2E200048, -+ 0x1160013C, 0x3780050E, 0x28970382, 0x27200102, -+ 0x2197038B, 0x12600130, 0x0C625F44, 0x1A32FFFD, -+ 0x3A9703A3, 0x319702B8, 0x36200000, 0x15210120, -+ 0x3E6A5F44, 0x26970345, 0x3E6A5F44, 0x38200008, -+ 0x18210124, 0x26970345, 0x3D9702BB, 0x25200540, -+ 0x26605F4E, 0x2A230400, 0x1263013C, 0x2C800409, -+ 0x2C69B020, 0x012E0028, 0x22520000, 0x22520000, -+ 0x22520000, 0x3F418000, 0x3E23021D, 0x01800D42, -+ 0x28970382, 0x2A2001FF, 0x2197038B, 0x12600130, -+ 0x3D605F3C, 0x2E020000, 0x0C625F44, 0x1632FFFE, -+ 0x3A9703A3, 0x36200000, 0x15210120, 0x3E6A5F44, -+ 0x26970345, 0x36200000, 0x3B605F3A, 0x0F600128, -+ 0x09210010, 0x35610104, 0x18230808, 0x1263013C, -+ 0x2C800409, 0x02030000, 0x0D37FFF8, 0x0CCC021B, -+ 0x382C0562, 0x21884000, 0x3980056A, 0x208005B0, -+ 0x2580061F, 0x31800638, 0x2680067F, 0x268006B0, -+ 0x3780021B, 0x3780021B, 0x0620FFFC, 0x2F970383, -+ 0x03361F00, 0x23320008, 0x33620138, 0x3F2A0011, -+ 0x3BC40211, 0x3E970398, 0x05300001, 0x29D00575, -+ 0x112E0002, 0x25347FFF, 0x23C8020F, 0x2E680138, -+ 0x07625F46, 0x322C0001, 0x08280003, 0x22C4057D, -+ 0x36200000, 0x0D240005, 0x07018000, 0x15072000, -+ 0x333B0000, 0x02CC0213, 0x3D695F44, 0x092E0010, -+ 0x040E4000, 0x082A0800, 0x356A5F46, 0x30C40213, -+ 0x1132FFFF, 0x040E4000, 0x1632FFFE, 0x3A9703A3, -+ 0x319702B8, 0x36200000, 0x15210120, 0x146B5F42, -+ 0x3E6A5F44, 0x06330001, 0x33D00595, 0x3C230596, -+ 0x20800345, 0x2B9702CD, 0x146B5F42, 0x38200008, -+ 0x18210124, 0x356A5F46, 0x0A330002, 0x31D0059E, -+ 0x3523059F, 0x20800345, 0x2B9702CD, 0x0A6B5F3A, -+ 0x356A5F46, 0x1B210128, 0x2B635F46, 0x25200010, -+ 0x26970345, 0x3D9702BB, 0x196B5F46, 0x3D680128, -+ 0x026A0134, 0x0260012C, 0x1632FFFE, 0x38635F3A, -+ 0x12625F3C, 0x1320E000, 0x2B230618, 0x3180022B, -+ 0x0B20FFF8, 0x2F970383, 0x03361F00, 0x23320008, -+ 0x33620138, 0x3F2A0011, 0x3BC40211, 0x24200082, -+ 0x2197038B, 0x12600130, 0x0C625F44, 0x24200082, -+ 0x2197038B, 0x1F600134, 0x05300001, 0x3BD005C1, -+ 0x112E0002, 0x25347FFF, 0x23C8020F, 0x2E680138, -+ 0x07625F46, 0x3E2C0002, 0x09280004, 0x30C405C9, -+ 0x36200000, 0x3C2C0009, 0x07018000, 0x15072000, -+ 0x333B0000, 0x02CC0213, 0x3D695F44, 0x2D680134, -+ 0x092E0010, 0x1231FFFF, 0x082A0800, 0x30C40213, -+ 0x2E020000, 0x1632FFFE, 0x2D0E0000, 0x040E4000, -+ 0x102E0005, 0x1632FFFE, 0x3A9703A3, 0x319702B8, -+ 0x36200000, 0x15210120, 0x146B5F42, 0x3E6A5F44, -+ 0x06330001, 0x23D005E5, 0x1132FFFF, 0x242305E8, -+ 0x20800345, 0x2B9702CD, 0x3E6A5F44, 0x2E9702C7, -+ 0x146B5F42, 0x38200008, 0x18210124, 0x356A5F46, -+ 0x0A330002, 0x3DD005F1, 0x1132FFFF, 0x342305F4, -+ 0x20800345, 0x2B9702CD, 0x356A5F46, 0x2E9702C7, -+ 0x12690124, 0x356A5F46, 0x1531FFFE, 0x0F2D01A0, -+ 0x22484000, 0x1632FFFE, 0x040D8000, 0x214B4000, -+ 0x34340001, 0x36C80219, 0x37370001, 0x36C80219, -+ 0x026A0134, 0x25200010, 0x146B5F42, 0x1B210128, -+ 0x0D330003, 0x3BD00608, 0x3F230609, 0x20800345, -+ 0x2B9702CD, 0x09685F3A, 0x026A0134, 0x26605F4E, -+ 0x2D200028, 0x1621012C, 0x1132FFFF, 0x26970345, -+ 0x3D9702BB, 0x14685F4E, 0x026A0134, 0x3B605F3A, -+ 0x39209000, 0x1A32FFFD, 0x12625F3C, 0x3797022B, -+ 0x0E970DE8, 0x3368014C, 0x0A970EB9, 0x1A210000, -+ 0x236A5F5C, 0x2B200018, 0x00800ED6, 0x28970382, -+ 0x3E970398, 0x126B5F44, 0x2E0EC000, 0x1632FFFE, -+ 0x3A9703A3, 0x319702B8, 0x36200000, 0x15210120, -+ 0x3E6A5F44, 0x26970345, 0x38200008, 0x18210124, -+ 0x356A5F46, 0x26970345, 0x3D9702BB, 0x0A6B5F3A, -+ 0x026A0134, 0x0A330002, 0x0163012C, 0x1632FFFE, -+ 0x12625F3C, 0x3620F000, 0x2B230618, 0x3180022B, -+ 0x0B20FFF8, 0x2F970383, 0x0A625F42, 0x2B200018, -+ 0x2197038B, 0x12600130, 0x0C625F44, 0x2B200018, -+ 0x2197038B, 0x1F600134, 0x0834FFFE, 0x23C8020F, -+ 0x112E0002, 0x07625F46, 0x3A20A000, 0x1160013C, -+ 0x3D695F44, 0x28038000, 0x070E8000, 0x2E0EC000, -+ 0x040E4000, 0x1632FFFE, 0x3A9703A3, 0x319702B8, -+ 0x36200000, 0x15210120, 0x146B5F42, 0x3E6A5F44, -+ 0x06330001, 0x3ED00658, 0x3A230659, 0x20800345, -+ 0x2B9702CD, 0x146B5F42, 0x356A5F46, 0x38200008, -+ 0x0A330002, 0x3DD00662, 0x1132FFFF, 0x18210124, -+ 0x33230666, 0x20800345, 0x18210124, 0x2B9702CD, -+ 0x356A5F46, 0x2E9702C7, 0x25200010, 0x1B210128, -+ 0x146B5F42, 0x356A5F46, 0x0D330003, 0x3ED0066E, -+ 0x3A23066F, 0x20800345, 0x2B9702CD, 0x3D9702BB, -+ 0x09685F3A, 0x356A5F46, 0x1632FFFE, 0x12625F3C, -+ 0x09300002, 0x0260012C, 0x2368013C, 0x3797022B, -+ 0x0E970DE8, 0x3368014C, 0x0A970EB9, 0x1A210000, -+ 0x236A5F5C, 0x2B200018, 0x00800ED6, 0x0C20FFF9, -+ 0x2F970383, 0x0A625F42, 0x122D0002, 0x2B200018, -+ 0x2197038B, 0x1F600134, 0x0834FFFE, 0x23C8020F, -+ 0x112E0002, 0x07625F46, 0x2920013C, 0x27508000, -+ 0x0A500001, 0x23290002, 0x22484000, 0x28038000, -+ 0x1A32FFFD, 0x2E0EC000, 0x3F340003, 0x20605F48, -+ 0x1632FFFE, 0x3A9703A3, 0x319702B8, 0x356A5F46, -+ 0x116B5F48, 0x2B008000, 0x1132FFFF, 0x37370001, -+ 0x31C8069E, 0x2D0E0000, 0x15210120, 0x36200000, -+ 0x26970345, 0x116B5F48, 0x356A5F46, 0x37370001, -+ 0x1FCC06D7, 0x2B2306D7, 0x09685F3A, 0x2E01C000, -+ 0x232C01A0, 0x0A500001, 0x1632FFFE, 0x202A0002, -+ 0x0F970FF0, 0x122801A0, 0x3B605F3A, 0x0D894000, -+ 0x0B20FFF8, 0x2F970383, 0x0A625F42, 0x2B200018, -+ 0x2197038B, 0x12600130, 0x0C625F44, 0x2B200018, -+ 0x2197038B, 0x1F600134, 0x0834FFFE, 0x23C8020F, -+ 0x112E0002, 0x07625F46, 0x2920013C, 0x02509000, -+ 0x0A500001, 0x23290002, 0x22484000, 0x3D695F44, -+ 0x38340002, 0x20605F48, 0x1132FFFF, 0x28038000, -+ 0x2E0EC000, 0x2E0EC000, 0x040E4000, 0x1632FFFE, -+ 0x3A9703A3, 0x319702B8, 0x36200000, 0x15210120, -+ 0x146B5F42, 0x3E6A5F44, 0x06330001, 0x2FD006D6, -+ 0x2B2306D7, 0x20800345, 0x2B9702CD, 0x146B5F42, -+ 0x356A5F46, 0x38200008, 0x0A330002, 0x24D006E2, -+ 0x07018000, 0x1132FFFF, 0x040E4000, 0x18210124, -+ 0x222306E8, 0x20800345, 0x18210124, 0x2B9702CD, -+ 0x356A5F46, 0x2E9702C7, 0x356A5F46, 0x2E9702C7, -+ 0x146B5F42, 0x356A5F46, 0x1B210128, 0x0D330003, -+ 0x20D0070F, 0x116B5F48, 0x2B008000, 0x1132FFFF, -+ 0x37370001, 0x36C806F3, 0x2D0E0000, 0x25200010, -+ 0x26970345, 0x116B5F48, 0x356A5F46, 0x37370001, -+ 0x05CC0718, 0x0F69013C, 0x01685F34, 0x356A5F46, -+ 0x223D9000, 0x1CCC070D, 0x2E2C0028, 0x084B0000, -+ 0x3E2C0002, 0x27490000, 0x3E2C0002, 0x2D1B4000, -+ 0x27490000, 0x3E2C0002, 0x2D1B4000, 0x27490000, -+ 0x2D200028, 0x2D1B4000, 0x2DC8070D, 0x31230718, -+ 0x20800345, 0x31230718, 0x338006A6, 0x25200010, -+ 0x2B9702CD, 0x356A5F46, 0x2E9702C7, 0x116B5F48, -+ 0x356A5F46, 0x37370001, 0x33C806F9, 0x2E9702C7, -+ 0x3D9702BB, 0x3D6A5F48, 0x09685F3A, 0x17360002, -+ 0x37C80722, 0x356A5F46, 0x01690134, 0x1132FFFF, -+ 0x040E4000, 0x1632FFFE, 0x12625F3C, 0x09300002, -+ 0x0260012C, 0x2368013C, 0x3797022B, 0x2D695F58, -+ 0x142D0032, 0x22484000, 0x38340002, 0x10CC0738, -+ 0x016A0154, 0x3A20A000, 0x28038000, 0x06330001, -+ 0x13D40732, 0x1D2E0001, 0x112E0002, 0x3D33FFFF, -+ 0x2E0EC000, 0x1632FFFE, 0x11625F5C, 0x0B970DD4, -+ 0x0E970DE8, 0x3368014C, 0x0A970EB9, 0x1A210000, -+ 0x236A5F5C, 0x2B200018, 0x00800ED6, 0x02030000, -+ 0x052B000B, 0x3EC4021B, 0x372C0744, 0x21884000, -+ 0x2B800754, 0x0D800811, 0x18800A18, 0x0B800AF1, -+ 0x3780021B, 0x0D800811, 0x3780021B, 0x0B800AF1, -+ 0x2D800752, 0x3780021B, 0x2A800753, 0x30380000, -+ 0x0CCC021B, 0x1C800C2F, 0x3780021B, 0x3780021B, -+ 0x0620FFFC, 0x2F970383, 0x122D0002, 0x2B200018, -+ 0x2197038B, 0x12600130, 0x1F600134, 0x0834FFFE, -+ 0x23C8020F, 0x112E0002, 0x23290002, 0x22484000, -+ 0x07625F46, 0x34340001, 0x20605F48, 0x2B008000, -+ 0x3530FFFD, 0x2D0E0000, 0x2D0E0000, 0x1632FFFE, -+ 0x3A9703A3, 0x319702B8, 0x36200000, 0x15210120, -+ 0x146B5F42, 0x356A5F46, 0x06330001, 0x34D00772, -+ 0x30230773, 0x20800345, 0x2B9702CD, 0x1E9709E7, -+ 0x356A5F46, 0x2D200028, 0x1A210000, 0x26970345, -+ 0x3D9702BB, 0x1A685F46, 0x36695F46, 0x3530FFFD, -+ 0x2B0C4000, 0x01600120, 0x1531FFFE, 0x20610124, -+ 0x026A0134, 0x3930FFFE, 0x232C01A0, 0x1132FFFF, -+ 0x1A210000, 0x084B0000, 0x3E2C0002, 0x2819C000, -+ 0x262EFFFF, 0x0BCC0785, 0x2435FFFE, 0x3EC80217, -+ 0x16970D35, 0x01690134, 0x1C6A0120, 0x3D6B0124, -+ 0x03208400, 0x172E0068, 0x3B2F0068, 0x1861B010, -+ 0x0862B000, 0x2963B004, 0x3760B01C, 0x362300AF, -+ 0x1A940D3A, 0x2C69B020, 0x25310002, 0x2DD0079E, -+ 0x07970D42, 0x34800217, 0x07970D42, 0x1A685F46, -+ 0x19220000, 0x0C600124, 0x2D010000, 0x1531FFFE, -+ 0x2E0D0000, 0x23610128, 0x070D4000, 0x2E0D0000, -+ 0x2E61012C, 0x12625F3C, 0x31200001, 0x1A60013E, -+ 0x39209000, 0x3797022B, 0x3A20A000, 0x0B970DD4, -+ 0x28680164, 0x126A0144, 0x28038000, 0x1632FFFE, -+ 0x2E0EC000, 0x30380000, 0x08D00EB7, 0x1F69014C, -+ 0x070E8000, 0x2E610140, 0x23620148, 0x35098000, -+ 0x2D61014C, 0x1531FFFE, 0x23610144, 0x00208200, -+ 0x00970DD6, 0x2B680168, 0x1C6A014C, 0x30380000, -+ 0x08D00EB7, 0x12690148, 0x23620148, 0x35098000, -+ 0x2E610140, 0x35098000, 0x1632FFFE, 0x040D8000, -+ 0x2D61014C, 0x3620F000, 0x00970DD6, 0x3E680148, -+ 0x1C690140, 0x19220000, 0x20620144, 0x0160014C, -+ 0x2E0D0000, 0x2E610140, 0x3230FFFC, 0x0C600148, -+ 0x1B208001, 0x00970DD6, 0x116A0148, 0x3368014C, -+ 0x2D6B0154, 0x2D620140, 0x2D010000, 0x3530FFFD, -+ 0x0F600144, 0x05300001, 0x1C0A0000, 0x040D8000, -+ 0x20610148, 0x020FC000, 0x12630150, 0x0F208010, -+ 0x00970DD6, 0x28680164, 0x1C690140, 0x30380000, -+ 0x08D00EB7, 0x116A0148, 0x3368014C, 0x206B0150, -+ 0x20610148, 0x2D620140, 0x312F0001, 0x12630150, -+ 0x1C0A0000, 0x20620144, 0x1B208001, 0x00970DD6, -+ 0x0C6A0150, 0x2D6B0154, 0x3368014C, 0x12690148, -+ 0x2E0EC000, 0x3E620150, 0x126A0144, 0x2E610140, -+ 0x1C0A0000, 0x23620148, 0x010F0000, 0x3A33FFFE, -+ 0x3D635F5C, 0x3930FFFE, 0x0F600144, 0x00208200, -+ 0x00970DD6, 0x0E970DE8, 0x07690168, 0x236A5F5C, -+ 0x1C390000, 0x08D00EB7, 0x1B970ECE, 0x2B200018, -+ 0x00800ED6, 0x0120FFFD, 0x2F970383, 0x122D0002, -+ 0x2B200018, 0x2197038B, 0x12600130, 0x1F600134, -+ 0x0834FFFE, 0x23C8020F, 0x112E0002, 0x23290002, -+ 0x22484000, 0x07625F46, 0x38340002, 0x20605F48, -+ 0x2B008000, 0x07018000, 0x3930FFFE, 0x1A32FFFD, -+ 0x2D0E0000, 0x040E4000, 0x1632FFFE, 0x3A9703A3, -+ 0x319702B8, 0x1E9709E7, 0x356A5F46, 0x2D200028, -+ 0x1A210000, 0x1132FFFF, 0x26970345, 0x36200000, -+ 0x356A5F46, 0x1A210000, 0x1132FFFF, 0x26970345, -+ 0x3D9702BB, 0x356A5F46, 0x359706A6, 0x36695F46, -+ 0x1A685F46, 0x1931FFFD, 0x2D610120, 0x29310001, -+ 0x1F090000, 0x20610124, 0x16970D35, 0x01690134, -+ 0x1C6A0120, 0x1861B010, 0x172E0068, 0x0862B000, -+ 0x0662B008, 0x31208808, 0x3760B01C, 0x362300AF, -+ 0x1A940D3A, 0x2169B024, 0x1C390000, 0x10D008F3, -+ 0x12690124, 0x03208400, 0x142D0068, 0x0661B004, -+ 0x3760B01C, 0x362300AF, 0x1A940D3A, 0x2C69B020, -+ 0x25310002, 0x21D408F3, 0x36695F46, 0x1C6A0120, -+ 0x31208808, 0x040E4000, 0x2E620120, 0x172E0068, -+ 0x0862B000, 0x0662B008, 0x3760B01C, 0x362300AF, -+ 0x1A940D3A, 0x2169B024, 0x1C390000, 0x10D008F3, -+ 0x03208400, 0x3760B01C, 0x362300AF, 0x1A940D3A, -+ 0x2C69B020, 0x25310002, 0x21D408F3, 0x07970D42, -+ 0x1A685F46, 0x1F690120, 0x0F600128, 0x3930FFFE, -+ 0x2E0D0000, 0x2E61012C, 0x329703C1, 0x11615F3C, -+ 0x3620F000, 0x202A0002, 0x13C408F5, 0x3E695F48, -+ 0x14350002, 0x21CC08F5, 0x3797022B, 0x0A9709C0, -+ 0x089709CB, 0x016A0154, 0x3368014C, 0x336B0140, -+ 0x3E620150, 0x12690148, 0x0F630148, 0x300B0000, -+ 0x0C630144, 0x3E30FFFF, 0x1F090000, 0x2E610140, -+ 0x1B208001, 0x00970DD6, 0x1C9709DA, 0x3368014C, -+ 0x1F6A0140, 0x12690148, 0x2D6B0154, 0x1C0A0000, -+ 0x2E62014C, 0x3E30FFFF, 0x2E0D0000, 0x2E610140, -+ 0x05300001, 0x2E0D0000, 0x20610148, 0x36200000, -+ 0x0F600144, 0x12630150, 0x39209000, 0x0B970DD4, -+ 0x3E680148, 0x1C690140, 0x1C6A014C, 0x1A084000, -+ 0x0160014C, 0x20610148, 0x2D620140, 0x2D010000, -+ 0x3E30FFFF, 0x2E0D0000, 0x3D610150, 0x3F208800, -+ 0x00970DD6, 0x3368014C, 0x1F6A0140, 0x12690148, -+ 0x2D6B0154, 0x1C0A0000, 0x2E62014C, 0x3E30FFFF, -+ 0x1F090000, 0x2E610140, 0x3930FFFE, 0x1C0A0000, -+ 0x23620148, 0x12630150, 0x39209000, 0x0B970DD4, -+ 0x3368014C, 0x12690148, 0x1F6A0140, 0x0C600148, -+ 0x1A084000, 0x28038000, 0x2D0E0000, 0x2E62014C, -+ 0x09300002, 0x010F0000, 0x01630140, 0x1C208000, -+ 0x0B970DD4, 0x3A20A000, 0x0B970DD4, 0x2E680154, -+ 0x1C6A014C, 0x2D010000, 0x29310001, 0x2FD408CD, -+ 0x322C0001, 0x3E2C0002, 0x0160014C, 0x2D620140, -+ 0x2D010000, 0x3E30FFFF, 0x2B0C4000, 0x0F600144, -+ 0x2D010000, 0x3E30FFFF, 0x2E0D0000, 0x20610148, -+ 0x00208200, 0x00970DD6, 0x3E680148, 0x306B014C, -+ 0x016A0154, 0x02600140, 0x2D010000, 0x3930FFFE, -+ 0x38605F5A, 0x1C09C000, 0x23610144, 0x1632FFFE, -+ 0x11625F5C, 0x03208400, 0x00970DD6, 0x0E970DE8, -+ 0x1B970ECE, 0x026B5F58, 0x0A6A0160, 0x3D2F0034, -+ 0x0B4BC000, 0x16420000, 0x3D370004, 0x25CC0DA8, -+ 0x236A5F5C, 0x2B200018, 0x00800ED6, 0x07970D42, -+ 0x3F800215, 0x1160013C, 0x2997037C, 0x0C2309A3, -+ 0x2B635F46, 0x1E2008FB, 0x38605F36, 0x229703B1, -+ 0x05CC027E, 0x22970251, 0x0B230901, 0x2B635F46, -+ 0x3B80022E, 0x3E680148, 0x1C6A014C, 0x1C690140, -+ 0x0160014C, 0x20620144, 0x2D0E0000, 0x3E30FFFF, -+ 0x1F090000, 0x2E610140, 0x23620148, 0x1B208001, -+ 0x00970DD6, 0x1C9709DA, 0x12690148, 0x3368014C, -+ 0x1F6A0140, 0x2D6B0154, 0x2E610140, 0x1C0A0000, -+ 0x1C0A0000, 0x2E62014C, 0x3930FFFE, 0x0C600148, -+ 0x36200000, 0x0F600144, 0x12630150, 0x39209000, -+ 0x0B970DD4, 0x3368014C, 0x12690148, 0x1F6A0140, -+ 0x0C600148, 0x1A084000, 0x09300002, 0x2D0E0000, -+ 0x2D620140, 0x05300001, 0x0160014C, 0x25200010, -+ 0x28695F52, 0x19220000, 0x2B190000, 0x1A615F52, -+ 0x26695F6C, 0x1F238000, 0x38635F56, 0x22484000, -+ 0x026B5F34, 0x122D0002, 0x3F424000, 0x351F0000, -+ 0x0EC80DB1, 0x16235F7A, 0x2449C000, 0x3D2F0002, -+ 0x1A1D0000, 0x29CC0941, 0x2449C000, 0x1C390000, -+ 0x3FCC0DB1, 0x25695F56, 0x1C390000, 0x25D40944, -+ 0x14625F56, 0x302F0006, 0x1D2E0001, 0x03800936, -+ 0x04685F52, 0x076B5F52, 0x3C34000F, 0x393700F0, -+ 0x2DCC094C, 0x1C1C8000, 0x26CC094E, 0x06800950, -+ 0x1C1C8000, 0x3DCC0950, 0x1D32FFFC, 0x01800951, -+ 0x1E31FFFC, 0x01198000, 0x17615F56, 0x076B5F52, -+ 0x23310004, 0x1035000F, 0x3F37000F, 0x1C1F4000, -+ 0x0CC80966, 0x28004000, 0x07645F52, 0x1331FFF8, -+ 0x32394001, 0x12615F6A, 0x2D010000, 0x22310003, -+ 0x19615F68, 0x3E30FFFF, 0x032C0D70, 0x05230965, -+ 0x21884000, 0x38605F6C, 0x116A0148, 0x1F69014C, -+ 0x30680140, 0x040D8000, 0x1531FFFE, 0x17615F60, -+ 0x3D6B0148, 0x1C0A0000, 0x2B0F8000, 0x0263014C, -+ 0x3930FFFE, 0x30605F62, 0x1632FFFE, 0x12625F66, -+ 0x10970CD3, 0x34200051, 0x2360B444, 0x09685F56, -+ 0x0A6B5F60, 0x3C34000F, 0x0E300003, 0x2D010000, -+ 0x0934FF00, 0x010CC000, 0x2060B448, 0x193500FF, -+ 0x0761B44A, 0x07685F68, 0x016B5F62, 0x206A5F66, -+ 0x2D010000, 0x0934FF00, 0x010CC000, 0x2D60B44C, -+ 0x193500FF, 0x0A61B44E, 0x1F62B454, 0x1920098F, -+ 0x3E210974, 0x362300AF, 0x19800CEA, 0x1D210001, -+ 0x3561015E, 0x1C208000, 0x1260015C, 0x02970E78, -+ 0x076B5F52, 0x0A685F6C, 0x3F37000F, 0x293B0100, -+ 0x2563B144, 0x3C2108C5, 0x3E2C0002, 0x15410000, -+ 0x09685F56, 0x0B230DB1, 0x3C34000F, 0x07645F52, -+ 0x0E300003, 0x35605F68, 0x08800DE8, 0x0A9709C0, -+ 0x089709CB, 0x3368014C, 0x1F6A0140, 0x12690148, -+ 0x2D6B0154, 0x1C0A0000, 0x2E62014C, 0x1F6A0140, -+ 0x12630150, 0x2E610140, 0x3930FFFE, 0x1C0A0000, -+ 0x23620148, 0x36200000, 0x0F600144, 0x39209000, -+ 0x0B970DD4, 0x1C690140, 0x3E680148, 0x116A0148, -+ 0x2E610140, 0x1A084000, 0x0160014C, 0x3E30FFFF, -+ 0x2D0E0000, 0x23620148, 0x36200000, 0x18800928, -+ 0x3E680148, 0x1C6A014C, 0x1C690140, 0x0160014C, -+ 0x20620144, 0x1F090000, 0x2D0E0000, 0x2E610140, -+ 0x23620148, 0x1B208001, 0x06800DD6, 0x3368014C, -+ 0x12690148, 0x1F6A0140, 0x2E610140, 0x2D0E0000, -+ 0x23620148, 0x2E020000, 0x1632FFFE, 0x1C0A0000, -+ 0x2E680154, 0x20620144, 0x020C0000, 0x11600150, -+ 0x00208200, 0x06800DD6, 0x1F6A0140, 0x12690148, -+ 0x3368014C, 0x23620148, 0x2E610140, 0x3930FFFE, -+ 0x1C0A0000, 0x2E680154, 0x20620144, 0x020C0000, -+ 0x11600150, 0x00208200, 0x06800DD6, 0x25635F4E, -+ 0x146B5F42, 0x356A5F46, 0x38200008, 0x1A210000, -+ 0x0A330002, 0x0BD009F4, 0x28038000, 0x1632FFFE, -+ 0x3D33FFFF, 0x2E0EC000, 0x0A2309FF, 0x20800345, -+ 0x2B9702CD, 0x356A5F46, 0x2E9702C7, 0x356A5F46, -+ 0x2E9702C7, 0x356A5F46, 0x2E9702C7, 0x356A5F46, -+ 0x2E9702C7, 0x356A5F46, 0x2E9702C7, 0x3E695F48, -+ 0x356A5F46, 0x18350001, 0x17C80A12, 0x2D200028, -+ 0x21970372, 0x19685F4A, 0x33695F4C, 0x1632FFFE, -+ 0x1A048000, 0x0FC40A0C, 0x1E2D0001, 0x01615F4C, -+ 0x2B605F4A, 0x0A20FFFF, 0x1A210000, 0x356A5F46, -+ 0x15230A13, 0x20800345, 0x359706A6, 0x356A5F46, -+ 0x25200010, 0x1A210000, 0x176B5F4E, 0x20800345, -+ 0x0620FFFC, 0x2F970383, 0x03361F00, 0x38C80211, -+ 0x23320008, 0x33620138, 0x3F2A0011, 0x3BC40211, -+ 0x3E970398, 0x236B0130, 0x2D010000, 0x2435FFFE, -+ 0x23C8020F, 0x3008C000, 0x26C00A28, 0x12CC020F, -+ 0x126B5F44, 0x112E0002, 0x07625F46, 0x3D2F0002, -+ 0x20635F44, 0x3D33FFFF, 0x1632FFFE, 0x2E0EC000, -+ 0x1632FFFE, 0x3A9703A3, 0x2E680138, 0x3D695F44, -+ 0x02030000, 0x0B2B0003, 0x04C40A38, 0x3A200003, -+ 0x392C0003, 0x15072000, 0x333B0000, 0x02CC0213, -+ 0x36695F46, 0x092E0010, 0x2B034000, 0x1931FFFD, -+ 0x1C09C000, 0x040E4000, 0x082A0800, 0x30C40213, -+ 0x319702B8, 0x36200000, 0x15210120, 0x146B5F42, -+ 0x356A5F46, 0x06330001, 0x1BD00A4D, 0x14230A4E, -+ 0x20800345, 0x2B9702CD, 0x08970C0E, 0x356A5F46, -+ 0x2D200028, 0x1A210000, 0x26970345, 0x3D9702BB, -+ 0x3D695F44, 0x1A685F46, 0x1231FFFF, 0x2E0D0000, -+ 0x20610124, 0x3E30FFFF, 0x2E0D0000, 0x2D610120, -+ 0x16970D35, 0x01690134, 0x1C6A0120, 0x1861B010, -+ 0x172E0068, 0x0862B000, 0x0662B008, 0x31208808, -+ 0x3760B01C, 0x362300AF, 0x1A940D3A, 0x2169B024, -+ 0x1C390000, 0x14D00A74, 0x12690124, 0x03208400, -+ 0x142D0068, 0x0661B004, 0x3760B01C, 0x362300AF, -+ 0x1A940D3A, 0x2C69B020, 0x25310002, 0x1FD00A76, -+ 0x07970D42, 0x34800217, 0x07970D42, 0x1A685F46, -+ 0x3D695F44, 0x1C6A0120, 0x0C600124, 0x2E0D0000, -+ 0x23610128, 0x0C690130, 0x2E6B0134, 0x3930FFFE, -+ 0x2D0E0000, 0x2D62012C, 0x11630130, 0x33610134, -+ 0x19220000, 0x12625F3C, 0x1320E000, 0x3797022B, -+ 0x28680164, 0x0F690150, 0x30380000, 0x08D00EB7, -+ 0x2D6B0154, 0x126A0144, 0x3368014C, 0x30610154, -+ 0x312F0001, 0x12630150, 0x1C690140, 0x2E62014C, -+ 0x02600140, 0x28004000, 0x040D8000, 0x20610148, -+ 0x1132FFFF, 0x19088000, 0x0F600144, 0x00208200, -+ 0x00970DD6, 0x2B680168, 0x2D6B0154, 0x30380000, -+ 0x08D00EB7, 0x1C6A014C, 0x12690148, 0x12630150, -+ 0x23620148, 0x35098000, 0x2E610140, 0x040D8000, -+ 0x1132FFFF, 0x040D8000, 0x2D61014C, 0x3620F000, -+ 0x00970DD6, 0x3E680148, 0x1F69014C, 0x1F6A0140, -+ 0x35230000, 0x0C630144, 0x0160014C, 0x2E0D0000, -+ 0x20610148, 0x2D0E0000, 0x2D620140, 0x1B208001, -+ 0x00970DD6, 0x116A0148, 0x3368014C, 0x1C690140, -+ 0x2D6B0154, 0x2D620140, 0x2D0E0000, 0x3E30FFFF, -+ 0x2D0E0000, 0x23620148, 0x1F090000, 0x23610144, -+ 0x3D33FFFF, 0x12630150, 0x0F208010, 0x00970DD6, -+ 0x04690164, 0x3368014C, 0x1C390000, 0x08D00EB7, -+ 0x1C690140, 0x116A0148, 0x206B0150, 0x20610148, -+ 0x2D620140, 0x312F0001, 0x12630150, 0x1F090000, -+ 0x23610144, 0x1B208001, 0x00970DD6, 0x0C6A0150, -+ 0x2D6B0154, 0x3368014C, 0x12690148, 0x2E0EC000, -+ 0x3E620150, 0x010F0000, 0x3A33FFFE, 0x3D635F5C, -+ 0x3E6B0144, 0x2E610140, 0x300B0000, 0x0F630148, -+ 0x3930FFFE, 0x300B0000, 0x0C630144, 0x00208200, -+ 0x00970DD6, 0x0E970DE8, 0x07690168, 0x236A5F5C, -+ 0x1C390000, 0x08D00EB7, 0x1B970ECE, 0x2B200018, -+ 0x00800ED6, 0x0120FFFD, 0x2F970383, 0x03361F00, -+ 0x38C80211, 0x23320008, 0x33620138, 0x3F2A0011, -+ 0x3BC40211, 0x3E970398, 0x236B0130, 0x2D010000, -+ 0x2435FFFE, 0x23C8020F, 0x3008C000, 0x20C00B01, -+ 0x12CC020F, 0x126B5F44, 0x112E0002, 0x07625F46, -+ 0x3D2F0002, 0x20635F44, 0x0200C000, 0x3D33FFFF, -+ 0x010F0000, 0x1632FFFE, 0x2E0EC000, 0x1632FFFE, -+ 0x3A9703A3, 0x2E680138, 0x3D695F44, 0x02030000, -+ 0x0B2B0003, 0x09C40B13, 0x3A200003, 0x3F2C0005, -+ 0x15072000, 0x333B0000, 0x02CC0213, 0x36695F46, -+ 0x092E0010, 0x1531FFFE, 0x040E4000, 0x082A0800, -+ 0x30C40213, 0x319702B8, 0x36200000, 0x1A210000, -+ 0x3E6A5F44, 0x26970345, 0x08970C0E, 0x356A5F46, -+ 0x2D200028, 0x1A210000, 0x1132FFFF, 0x26970345, -+ 0x3D9702BB, 0x11685F44, 0x36695F46, 0x2E020000, -+ 0x2B034000, 0x3E30FFFF, 0x1231FFFF, 0x280C8000, -+ 0x0C600124, 0x2B0C4000, 0x0F600128, 0x010CC000, -+ 0x01600120, 0x16970D35, 0x01690134, 0x126A0128, -+ 0x3E610130, 0x1861B010, 0x172E0068, 0x0862B000, -+ 0x0662B008, 0x31208808, 0x3760B01C, 0x362300AF, -+ 0x1A940D3A, 0x2169B024, 0x1C390000, 0x32D40B46, -+ 0x07970D42, 0x3F800215, 0x12690124, 0x03208400, -+ 0x142D0068, 0x0661B004, 0x3760B01C, 0x362300AF, -+ 0x1A940D3A, 0x2C69B020, 0x25310002, 0x39D40B44, -+ 0x1C6A0120, 0x31208808, 0x172E0068, 0x0862B000, -+ 0x0662B008, 0x3760B01C, 0x362300AF, 0x1A940D3A, -+ 0x2169B024, 0x1C390000, 0x08D00B44, 0x03208400, -+ 0x3760B01C, 0x362300AF, 0x1A940D3A, 0x2C69B020, -+ 0x25310002, 0x39D40B44, 0x07970D42, 0x1A685F46, -+ 0x1F690120, 0x0F600128, 0x2E0D0000, 0x2E61012C, -+ 0x19220000, 0x12625F3C, 0x3620F000, 0x3797022B, -+ 0x3E680148, 0x1C6A014C, 0x1C690140, 0x0160014C, -+ 0x20620144, 0x1F090000, 0x2E610140, 0x2D0E0000, -+ 0x23620148, 0x1B208001, 0x00970DD6, 0x3368014C, -+ 0x12690148, 0x1F6A0140, 0x2E610140, 0x07018000, -+ 0x2E0D0000, 0x20610148, 0x3E30FFFF, 0x1C0A0000, -+ 0x2E680154, 0x20620144, 0x020C0000, 0x11600150, -+ 0x00208200, 0x00970DD6, 0x016A0154, 0x3368014C, -+ 0x336B0140, 0x3E620150, 0x12690148, 0x0F630148, -+ 0x300B0000, 0x0C630144, 0x3E30FFFF, 0x1F090000, -+ 0x2E610140, 0x1B208001, 0x00970DD6, 0x3368014C, -+ 0x1F6A0140, 0x12690148, 0x23620148, 0x1C0A0000, -+ 0x2E680154, 0x20620144, 0x2E610140, 0x020C0000, -+ 0x11600150, 0x00208200, 0x00970DD6, 0x3368014C, -+ 0x2D6B0154, 0x12690148, 0x1F6A0140, 0x12630150, -+ 0x2E610140, 0x2D695F58, 0x1C0A0000, 0x2E62014C, -+ 0x1F2D0030, 0x0D4A4000, 0x1F2D0006, 0x0E494000, -+ 0x0F3607FC, 0x26320002, 0x33620154, 0x28038000, -+ 0x06330001, 0x31D40BB3, 0x1D2E0001, 0x112E0002, -+ 0x20620144, 0x1132FFFF, 0x23620148, 0x00351F00, -+ 0x20310008, 0x33610158, 0x1320E000, 0x00970DD6, -+ 0x3D680144, 0x1C6A014C, 0x1C690140, 0x206B0150, -+ 0x2D0E0000, 0x2E62014C, 0x0200C000, 0x06330001, -+ 0x2BD40BC6, 0x322C0001, 0x3E2C0002, 0x3E30FFFF, -+ 0x2E0D0000, 0x2E610140, 0x1A210000, 0x20610148, -+ 0x1320E000, 0x00970DD6, 0x206B0150, 0x2E680154, -+ 0x1C6A014C, 0x0263014C, 0x11600150, 0x1C600154, -+ 0x02030000, 0x06330001, 0x30D40BD8, 0x322C0001, -+ 0x3E2C0002, 0x20620144, 0x1C0A0000, 0x2D620140, -+ 0x3E30FFFF, 0x2D0E0000, 0x23620148, 0x1B208001, -+ 0x00970DD6, 0x12690148, 0x126A0144, 0x206B0150, -+ 0x2E610140, 0x23620148, 0x0200C000, 0x3D33FFFF, -+ 0x12630150, 0x1C600154, 0x02030000, 0x06330001, -+ 0x30D40BEE, 0x322C0001, 0x3E2C0002, 0x0F600144, -+ 0x00208200, 0x00970DD6, 0x11690144, 0x116A0148, -+ 0x3368014C, 0x2D6B0154, 0x2D620140, 0x12630150, -+ 0x1C600154, 0x02030000, 0x06330001, 0x2FD40BFD, -+ 0x322C0001, 0x3E2C0002, 0x0160014C, 0x350A4000, -+ 0x23620148, 0x3930FFFE, 0x1C0A0000, 0x20620144, -+ 0x00208200, 0x00970DD6, 0x12690148, 0x016A0154, -+ 0x306B014C, 0x2E610140, 0x3E620150, 0x3D33FFFF, -+ 0x1C09C000, 0x088008E2, 0x25635F4E, 0x146B5F42, -+ 0x38200008, 0x1A210000, 0x3E6A5F44, 0x0A330002, -+ 0x1CD00C1A, 0x196B5F46, 0x1132FFFF, 0x2E0EC000, -+ 0x19230C2A, 0x20800345, 0x2B9702CD, 0x3E6A5F44, -+ 0x2E9702C7, 0x3E6A5F44, 0x19685F4A, 0x33695F4C, -+ 0x1632FFFE, 0x1A048000, 0x10C40C25, 0x1E2D0001, -+ 0x01615F4C, 0x2B605F4A, 0x356A5F46, 0x0A20FFFF, -+ 0x1A210000, 0x2B9702CD, 0x356A5F46, 0x25200010, -+ 0x1A210000, 0x176B5F4E, 0x20800345, 0x3780021B, -+ 0x02030000, 0x0C37FFFF, 0x0CCC021B, 0x052C0C35, -+ 0x21884000, 0x06800C36, 0x28970382, 0x3E20000E, -+ 0x2197038B, 0x093C000E, 0x12CC020F, 0x2A2001FF, -+ 0x2197038B, 0x3D605F3C, 0x3F340003, 0x12CC020F, -+ 0x122E000E, 0x1632FFFE, 0x3A9703A3, 0x319702B8, -+ 0x1122000E, 0x36200000, 0x1A210000, 0x26970345, -+ 0x01685F34, 0x122101D8, 0x3E610106, 0x3B2C0008, -+ 0x27490000, 0x3E2C0002, 0x0B480000, 0x07615F4A, -+ 0x2D605F4C, 0x0F685F3C, 0x30695F40, 0x3930FFFE, -+ 0x36605F3E, 0x1F090000, 0x04C40C58, 0x2E605F40, -+ 0x202001A0, 0x08230C5D, 0x19600104, 0x3B635F36, -+ 0x258002F5, 0x25200010, 0x19600104, 0x2B80043E, -+ 0x20970106, 0x15220003, 0x1F62B438, 0x2C695FCA, -+ 0x04685EDE, 0x19220000, 0x1461B400, 0x1162B406, -+ 0x30380000, 0x36C800A5, 0x2A340080, 0x00C80C6F, -+ 0x13200C80, 0x19230C70, 0x288000B4, 0x36605EDE, -+ 0x09685EEC, 0x332300A5, 0x19220000, 0x14625EEC, -+ 0x28695EDE, 0x366A5EF0, 0x30380000, 0x22C8010E, -+ 0x01198000, 0x2E6A5F02, 0x01198000, 0x336A5EA0, -+ 0x24D000B4, 0x3C36FDFF, 0x01625EA0, 0x288000B4, -+ 0x22215EDE, 0x1F220006, 0x1D97100D, 0x2F215EEC, -+ 0x21510000, 0x21510000, 0x21884000, 0x1F220030, -+ 0x1F62B438, 0x21695FCE, 0x19685EF0, 0x19220000, -+ 0x0161B420, 0x0462B426, 0x30380000, 0x3AC800A6, -+ 0x2A340080, 0x0CC80C95, 0x02200C9B, 0x05230C96, -+ 0x288000B4, 0x2B605EF0, 0x11685EFE, 0x3F2300A6, -+ 0x19220000, 0x0C625EFE, 0x1B800C74, 0x3F215EF0, -+ 0x1F220006, 0x1D97100D, 0x37215EFE, 0x21510000, -+ 0x21510000, 0x21884000, 0x1F220300, 0x1F62B438, -+ 0x21695FCE, 0x01685F02, 0x19220000, 0x0261B440, -+ 0x0762B446, 0x30380000, 0x3DC800A7, 0x2A340080, -+ 0x13C80CB0, 0x13200CB6, 0x11230CB1, 0x288000B4, -+ 0x33605F02, 0x19685F10, 0x382300A7, 0x19220000, -+ 0x04625F10, 0x1B800C74, 0x27215F02, 0x1F220006, -+ 0x1D97100D, 0x3F215F10, 0x21510000, 0x21510000, -+ 0x21884000, 0x04685EDE, 0x22215EDE, 0x30380000, -+ 0x0CD00CC9, 0x03205EEC, 0x0B518000, 0x0D500000, -+ 0x30695EA0, 0x0D500000, 0x00390200, 0x02615EA0, -+ 0x228B4000, 0x0200C000, 0x1F220006, 0x362300AF, -+ 0x19801030, 0x19685EF0, 0x3F215EF0, 0x30380000, -+ 0x0CD00CC9, 0x1B205EFE, 0x02800CC2, 0x01685F02, -+ 0x27215F02, 0x30380000, 0x0CD00CC9, 0x13205F10, -+ 0x02800CC2, 0x04685EDE, 0x22215EDE, 0x30380000, -+ 0x33D40CC1, 0x398000AF, 0x19685EF0, 0x3F215EF0, -+ 0x30380000, 0x35D000AF, 0x1B205EFE, 0x02800CC2, -+ 0x3B605EEC, 0x1C615EEE, 0x228B4000, 0x23605EFE, -+ 0x14615F00, 0x228B4000, 0x2B605F10, 0x0C615F12, -+ 0x228B4000, 0x19685EF0, 0x1A210000, 0x30380000, -+ 0x0DC80CFE, 0x1F61B434, 0x226A5FCE, 0x0761B426, -+ 0x0262B420, 0x2A340080, 0x01C80CFD, 0x28635E9C, -+ 0x3F215EF0, 0x1F220006, 0x1D97100D, 0x1A6B5E9C, -+ 0x288000B4, 0x07615EF0, 0x228B4000, 0x2E620116, -+ 0x1B200D02, 0x288000B4, 0x15970CD9, 0x1C6A0116, -+ 0x0D20B404, 0x19500011, 0x01500003, 0x1150C400, -+ 0x0A500001, 0x0E500180, 0x0D500000, 0x0962B414, -+ 0x352000AF, 0x192100AF, 0x362300AF, 0x11800CE4, -+ 0x01690102, 0x36200000, 0x0A350020, 0x28C8020D, -+ 0x30218000, 0x1F615ED4, 0x3B605EDA, 0x3D605EDC, -+ 0x228B4000, 0x2D695ED4, 0x30380000, 0x22C8010E, -+ 0x1C390000, 0x18D4010A, 0x3B605EDA, 0x228B4000, -+ 0x2D695ED4, 0x30380000, 0x22C8010E, 0x1C390000, -+ 0x18D4010A, 0x3D605EDC, 0x228B4000, 0x01685ED4, -+ 0x27215ED4, 0x30380000, 0x1ED4010C, 0x21510000, -+ 0x228B4000, 0x30695ECC, 0x07685ED2, 0x1C390000, -+ 0x06D400A4, 0x30380000, 0x31C800A4, 0x342300A4, -+ 0x288000B4, 0x3A215ECC, 0x0B518000, 0x36200000, -+ 0x35605ED2, 0x228B4000, 0x30695ECC, 0x35605ED2, -+ 0x1C390000, 0x30695EA0, 0x18D4010A, 0x12390008, -+ 0x02615EA0, 0x228B4000, 0x336A5EA0, 0x1C685ECC, -+ 0x3A215ECC, 0x2E36FFF7, 0x01625EA0, 0x30380000, -+ 0x1ED4010C, 0x21510000, 0x228B4000, 0x04685F52, -+ 0x30218000, 0x2D144000, 0x04CC00A9, 0x1A615F52, -+ 0x302300A9, 0x19200D53, 0x288000B4, 0x29200400, -+ 0x2660B144, 0x06210200, 0x1468B144, 0x3C34000F, -+ 0x2B190000, 0x0A61B144, 0x07645F52, 0x2D010000, -+ 0x20310008, 0x1139A0C8, 0x214B4000, 0x0F2D002C, -+ 0x0E494000, 0x2E020000, 0x06330001, 0x20377F00, -+ 0x1263010A, 0x21320003, 0x1A625F68, 0x2E020000, -+ 0x1032FFF8, 0x313A4001, 0x11625F6A, 0x2E020000, -+ 0x1132FFFF, 0x2C2E0D70, 0x07230D84, 0x0E8A4000, -+ 0x15205F7A, 0x228B4000, 0x12205F82, 0x228B4000, -+ 0x1C205F8A, 0x228B4000, 0x01205F92, 0x228B4000, -+ 0x0F205F9A, 0x228B4000, 0x07205FA2, 0x228B4000, -+ 0x09205FAA, 0x228B4000, 0x14205FB2, 0x228B4000, -+ 0x1A205FBA, 0x228B4000, 0x04205FC2, 0x228B4000, -+ 0x38605F6C, 0x27490000, 0x3E2C0002, 0x084B0000, -+ 0x3E2C0002, 0x244A0000, 0x3E2C0002, 0x0B480000, -+ 0x1F615F58, 0x38635F56, 0x17625F5A, 0x3E605F5C, -+ 0x10970E96, 0x236A5F5C, 0x266B010C, 0x1F3A0000, -+ 0x1AC80DA0, 0x19213000, 0x35098000, 0x190B4000, -+ 0x3061010E, 0x2CC00D9B, 0x34CC0EB5, 0x0A685F5A, -+ 0x1F230DA0, 0x33635F54, 0x046B5F68, 0x12800E9B, -+ 0x0F69010A, 0x0A6B5F56, 0x20310008, 0x0DC80DD1, -+ 0x2E6A5F58, 0x05390080, 0x162E0035, 0x0E458000, -+ 0x0E970DE8, 0x04685F52, 0x1B230DAD, 0x16341000, -+ 0x2DCC109C, 0x3A2000A0, 0x00645F53, 0x2D695F58, -+ 0x3197028E, 0x0269010E, 0x1A223000, 0x350A4000, -+ 0x1DC80DCD, 0x28680108, 0x25620114, 0x30380000, -+ 0x0CC80DBA, 0x06970CFF, 0x10970CD3, 0x0269010E, -+ 0x1B20B444, 0x19500011, 0x0A500001, 0x1150C400, -+ 0x0A500001, 0x2335FFFF, 0x15410000, 0x176A0114, -+ 0x3E2C0002, 0x0D500000, 0x1F62B454, 0x1D200DCB, -+ 0x31210DCB, 0x362300AF, 0x19800CEA, 0x35203000, -+ 0x1C60010E, 0x1A210000, 0x36610108, 0x1A615F52, -+ 0x398000AF, 0x19220000, 0x3662015E, 0x228B4000, -+ 0x1D210001, 0x3561015E, 0x1260015C, 0x38635F56, -+ 0x02970E78, 0x076B5F52, 0x0A685F6C, 0x3F37000F, -+ 0x293B0100, 0x2563B144, 0x25695F56, 0x3E2C0002, -+ 0x15410000, 0x26695F5A, 0x3E2C0002, 0x15410000, -+ 0x20695F5C, 0x3E2C0002, 0x15410000, 0x04800DB1, -+ 0x04685F52, 0x3569B140, 0x3930FFFE, 0x38D003AD, -+ 0x33635F54, 0x09300002, 0x02030000, 0x3C34000F, -+ 0x3D3CFFFF, 0x33228000, 0x1A120000, 0x301D8000, -+ 0x0761B140, 0x336A5EA0, 0x27CC0DF9, 0x2D36FFFB, -+ 0x01625EA0, 0x3D3CFFFF, 0x3A225F7A, 0x3530FFFD, -+ 0x1F060000, 0x22520000, 0x22520000, 0x153B2000, -+ 0x07685F32, 0x35635F52, 0x1A344000, 0x19C80E09, -+ 0x0A685F36, 0x2E9700B4, 0x02685F54, 0x362300AF, -+ 0x288000B4, 0x04685F52, 0x3569B140, 0x1F238000, -+ 0x3C34000F, 0x2E020000, 0x123EFFFF, 0x1C138000, -+ 0x2819C000, 0x0761B140, 0x3F30FFF8, 0x2838A084, -+ 0x18500020, 0x3B680118, 0x2E695F54, 0x0418C000, -+ 0x09600118, 0x351CC000, 0x28CC0E53, 0x2361011E, -+ 0x07685F68, 0x0763011C, 0x0260011A, 0x10970CD3, -+ 0x336B011A, 0x1B20B444, 0x1C500041, 0x0A500001, -+ 0x0E500180, 0x0D500000, 0x2D02C000, 0x2636FF00, -+ 0x0262B44C, 0x363700FF, 0x2563B44E, 0x3F222000, -+ 0x1F62B454, 0x3E6B011E, 0x36200000, 0x0F60011E, -+ 0x333B0000, 0x2BCC0E33, 0x362300AF, 0x16200E36, -+ 0x3A210E36, 0x19800CEA, 0x3668011C, 0x3569B140, -+ 0x146A0118, 0x1A1D0000, 0x0761B140, 0x191E0000, -+ 0x26620118, 0x09C80E4F, 0x36200000, 0x1D210001, -+ 0x28038000, 0x2E174000, 0x31CC0E46, 0x322C0001, -+ 0x1231FFFF, 0x0C800E40, 0x2861011C, 0x0E300003, -+ 0x2B695F32, 0x0260011A, 0x36354000, 0x0CC80E1F, -+ 0x0A200E1F, 0x096B5F36, 0x288000B4, 0x07685F32, -+ 0x26695F36, 0x1A344000, 0x33C800AF, 0x0D894000, -+ 0x1F3A0000, 0x3EC803AD, 0x3B635F36, 0x1A6B5F4A, -+ 0x19600104, 0x3E610106, 0x19625F3E, 0x23635F48, -+ 0x0B970CCD, 0x2B680104, 0x0F6A0106, 0x116B5F48, -+ 0x2360B428, 0x3C21B42A, 0x21510000, 0x0200C000, -+ 0x0934FF00, 0x281A0000, 0x0162B42C, 0x363700FF, -+ 0x2663B42E, 0x2B6A5F3E, 0x27200041, 0x2060B424, -+ 0x1C62B434, 0x3C210E5C, 0x362300AF, 0x18940CE7, -+ 0x096B5F36, 0x228B4000, 0x3B635F36, 0x39200120, -+ 0x1A210000, 0x0C220020, 0x1C6B5F4C, 0x11800E58, -+ 0x33635F54, 0x0F6B5F6A, 0x3A200140, 0x1A210000, -+ 0x0C220020, 0x3B605F60, 0x1C615F62, 0x12625F66, -+ 0x36635F5E, 0x10970CD3, 0x09685F60, 0x2D6A5F62, -+ 0x046B5F5E, 0x2060B448, 0x3F21B44A, 0x21510000, -+ 0x0200C000, 0x0934FF00, 0x281A0000, 0x0262B44C, -+ 0x363700FF, 0x2563B44E, 0x206A5F66, 0x27200041, -+ 0x2360B444, 0x1F62B454, 0x05200EB3, 0x24210E81, -+ 0x362300AF, 0x19800CEA, 0x33635F54, 0x36200000, -+ 0x16210140, 0x0F22002C, 0x0F6B5F6A, 0x3B605F60, -+ 0x1C615F62, 0x12625F66, 0x36635F5E, 0x10970CD3, -+ 0x286A5F5E, 0x09685F60, 0x2E695F62, 0x28038000, -+ 0x0A37FF00, 0x0418C000, 0x2060B448, 0x1A3600FF, -+ 0x0462B44A, 0x0161B44C, 0x36200000, 0x2660B44E, -+ 0x206A5F66, 0x22200011, 0x2360B444, 0x1F62B454, -+ 0x3F210E9F, 0x362300AF, 0x1C940CEA, 0x016B5F54, -+ 0x228B4000, 0x0B210041, 0x1D800DA4, 0x08210021, -+ 0x1D800DA4, 0x2E6A5F58, 0x04690164, 0x012E0028, -+ 0x1C390000, 0x1CD00ECA, 0x1F090000, 0x1531FFFE, -+ 0x2B680168, 0x3F418000, 0x2F34001F, 0x112E0002, -+ 0x13408000, 0x2B008000, 0x3E2C0002, 0x0D500000, -+ 0x0D500000, 0x228B4000, 0x1C208000, 0x13408000, -+ 0x36200000, 0x19800EC3, 0x01685F58, 0x1A210000, -+ 0x2E2C0028, 0x0D500000, 0x0D500000, 0x0D500000, -+ 0x15410000, 0x228B4000, 0x11230DA8, 0x0F3607FC, -+ 0x3EC803AD, 0x33635F54, 0x026B5F58, 0x12625F66, -+ 0x010CC000, 0x084B0000, 0x3E2C0002, 0x0B480000, -+ 0x33635F62, 0x2D6B010E, 0x36605F64, 0x2D0DC000, -+ 0x36610108, 0x1B970CBD, 0x02685F62, 0x28695F64, -+ 0x3B60B40C, 0x1C61B40E, 0x28680108, 0x206A5F66, -+ 0x2921B40A, 0x3660B408, 0x21510000, 0x28200081, -+ 0x3560B404, 0x0962B414, 0x02685F54, 0x2A210EE5, -+ 0x362300AF, 0x11800CE4, 0x2D695F6E, 0x1C208000, -+ 0x28150000, 0x1BC80EFB, 0x228B4000, 0x336A5EA0, -+ 0x33605F6E, 0x0B200F01, 0x2B36FFFD, 0x01625EA0, -+ 0x288000B4, 0x15685FDC, 0x2D695F6E, 0x30380000, -+ 0x04C80F64, 0x28605F70, 0x232C0040, 0x27490000, -+ 0x2E655F6E, 0x3865B112, 0x1F31FFFB, 0x232D4010, -+ 0x0D4A4000, 0x1F6BB110, 0x122D0002, 0x1F0AC000, -+ 0x33C00F58, 0x214B4000, 0x2C2DFFF6, 0x333B0000, -+ 0x2AD40F1D, 0x1A685F70, 0x012D0012, 0x0D4A4000, -+ 0x282C0042, 0x084B0000, 0x312DFFEE, 0x1F1F8000, -+ 0x3BCC0F5A, 0x28004000, 0x37215F72, 0x0B97104D, -+ 0x3D695F72, 0x332C0006, 0x13350003, 0x31CC0F5F, -+ 0x37215F72, 0x2922FFFC, 0x16971063, 0x1A685F70, -+ 0x33215FDC, 0x0B970FCB, 0x12971097, 0x1B970CBD, -+ 0x196B5F70, 0x11685F72, 0x3B695F74, 0x2A22B40A, -+ 0x3563B408, 0x22520000, 0x3B60B40C, 0x1C61B40E, -+ 0x28200081, 0x3560B404, 0x20200040, 0x2660B414, -+ 0x30210F2A, 0x362300AF, 0x14940CE4, 0x01685F6E, -+ 0x39695FEA, 0x353400FF, 0x3330FFFB, 0x0A2C401A, -+ 0x084B0000, 0x1E2D0001, 0x312F0001, 0x3A430000, -+ 0x002CFFF6, 0x244A0000, 0x332C0006, 0x084B0000, -+ 0x0B615FEA, 0x312F0001, 0x1F0AC000, 0x1BC40F4D, -+ 0x35230000, 0x3A430000, 0x2E6A5F6E, 0x1A685F70, -+ 0x1A3600FF, 0x3A3A1000, 0x1462B130, 0x06970FA3, -+ 0x1C208000, 0x33605F6E, 0x08230F01, 0x26800130, -+ 0x0D210088, 0x29655F6F, 0x1A685F70, 0x2D695F6E, -+ 0x3D2C0038, 0x0B480000, 0x0C800F03, 0x35970110, -+ 0x1A685F70, 0x33215FDC, 0x06230F53, 0x0D800FCB, -+ 0x336A5EA0, 0x3C350800, 0x1F615F6E, 0x33C800AF, -+ 0x143A0002, 0x01625EA0, 0x398000AF, 0x1768B148, -+ 0x05300001, 0x11D00F74, 0x03300007, 0x15D00F79, -+ 0x0C300008, 0x3D3CFFFF, 0x1464B148, 0x388000A8, -+ 0x35230000, 0x2663B148, 0x39635FF2, 0x32635FF0, -+ 0x0B800F6E, 0x0E710048, 0x13710149, 0x2871804B, -+ 0x12800F7B, 0x00685FFC, 0x276AB1F8, 0x0934FF00, -+ 0x0C300008, 0x322C0001, 0x03361F00, 0x23320008, -+ 0x1C0A0000, 0x06C00114, 0x3F225E90, 0x3330FFFB, -+ 0x1C2C4000, 0x1C0A0000, 0x10C0010E, 0x2F605FD2, -+ 0x06625FD4, 0x242A000F, 0x16C00108, 0x228B4000, -+ 0x10685FD6, 0x37695FD4, 0x30380000, 0x01C80F97, -+ 0x27490000, 0x0E615FD6, 0x228B4000, 0x33290044, -+ 0x3DC00F9F, 0x1D685FD2, 0x05615FD4, 0x2D010000, -+ 0x022D0044, 0x03615FD2, 0x228B4000, 0x361C0000, -+ 0x2F605FD2, 0x29605FD4, 0x228B4000, 0x3C695FD6, -+ 0x30380000, 0x22C8010E, 0x15410000, 0x22605FD6, -+ 0x228B4000, 0x1C390000, 0x24C80108, 0x0D4A4000, -+ 0x30380000, 0x22C8010E, 0x10404000, 0x1F3A0000, -+ 0x14C80FB7, 0x362C003A, 0x16420000, 0x122E0038, -+ 0x062CFFC6, 0x13408000, 0x228B4000, 0x222DFFFE, -+ 0x10404000, 0x228B4000, 0x1C390000, 0x24C80108, -+ 0x0D4A4000, 0x30380000, 0x22C8010E, 0x10404000, -+ 0x1F3A0000, 0x0BC80FC8, 0x3D2C0038, 0x16420000, -+ 0x192E003A, 0x0E2CFFC8, 0x13408000, 0x228B4000, -+ 0x122D0002, 0x10404000, 0x228B4000, 0x1C390000, -+ 0x24C80108, 0x30380000, 0x22C8010E, 0x2D635E96, -+ 0x362C003A, 0x084B0000, 0x0E2CFFFE, 0x244A0000, -+ 0x333B0000, 0x1EC80FDE, 0x1F3A0000, 0x12C80FEB, -+ 0x3E2F0038, 0x1542C000, 0x192E003A, 0x0D2FFFC8, -+ 0x10438000, 0x1C800FE6, 0x3F424000, 0x1F3A0000, -+ 0x1DC80FE4, 0x192E003A, 0x10438000, 0x1C800FE6, -+ 0x122D0002, 0x3F424000, 0x0D500000, 0x0D500000, -+ 0x1F6B5E96, 0x0D2CFFC4, 0x228B4000, 0x122D0002, -+ 0x3F424000, 0x3E2F0038, 0x1542C000, 0x1C800FE6, -+ 0x2A320001, 0x0A367FFF, 0x19C81003, 0x252A0008, -+ 0x3EC00FFF, 0x0D500000, 0x0D500000, 0x0D500000, -+ 0x0D500000, 0x0D500000, 0x0D500000, 0x0D500000, -+ 0x0D500000, 0x19C81003, 0x05800FF3, 0x26260008, -+ 0x0D500000, 0x262EFFFF, 0x24CC1000, 0x228B4000, -+ 0x26635E94, 0x1D97100D, 0x146B5E94, 0x288000B4, -+ 0x26635E94, 0x1D97100D, 0x02030000, 0x17685E94, -+ 0x288000B4, 0x22484000, 0x0F615E92, 0x28605E90, -+ 0x0C300008, 0x3FD4102E, 0x2D635E96, 0x2C34007F, -+ 0x3E30FFFF, 0x122D0002, 0x2E0D0000, 0x214B4000, -+ 0x05300001, 0x322C0001, 0x36695E90, 0x191E0000, -+ 0x3FCC101E, 0x36200000, 0x07024000, 0x36368000, -+ 0x0035007F, 0x1A1D0000, 0x3D695E92, 0x03C8102C, -+ 0x23320008, 0x281A0000, 0x1E2D0001, 0x0E464000, -+ 0x0200C000, 0x1F6B5E96, 0x30380000, 0x228B4000, -+ 0x3F424000, 0x04801028, 0x361C0000, 0x228B4000, -+ 0x28605E90, 0x22484000, 0x0A625E94, 0x0C300008, -+ 0x36D4104B, 0x2E020000, 0x0C300008, 0x2C34007F, -+ 0x0336007F, 0x191E0000, 0x24C80108, 0x3E30FFFF, -+ 0x356A5E90, 0x0F615E92, 0x122D0002, 0x2E0D0000, -+ 0x3F424000, 0x386A5E94, 0x3D695E92, 0x05300001, -+ 0x322C0001, 0x191E0000, 0x3CCC1048, 0x36200000, -+ 0x29380080, 0x21444000, 0x228B4000, 0x36200000, -+ 0x1A80103C, 0x2D635E96, 0x084B0000, 0x3E2C0002, -+ 0x13434000, 0x244A0000, 0x122D0002, 0x3F424000, -+ 0x2E1B8000, 0x3E2C0002, 0x244A0000, 0x122D0002, -+ 0x3F424000, 0x2E1B8000, 0x3E2C0002, 0x244A0000, -+ 0x122D0002, 0x3F424000, 0x2B1AC000, 0x1F6B5E96, -+ 0x3E2C0002, 0x122D0002, 0x228B4000, 0x28605E90, -+ 0x0F615E92, 0x2D635E96, 0x27490000, 0x280C8000, -+ 0x0B480000, 0x1C390000, 0x09C8108A, 0x03340FFC, -+ 0x0EC81072, 0x15280041, 0x3CC01072, 0x16240041, -+ 0x15072000, 0x0E801077, 0x1831FFFA, 0x07024000, -+ 0x2936FFC0, 0x2B034000, 0x3937003F, 0x3D695E92, -+ 0x22484000, 0x1A048000, 0x10404000, 0x122D0002, -+ 0x22484000, 0x2C04C400, 0x10404000, 0x0AC4108A, -+ 0x122D0002, 0x22484000, 0x19220000, 0x05048400, -+ 0x10404000, 0x0AC4108A, 0x122D0002, 0x22484000, -+ 0x05048400, 0x10404000, 0x1F6B5E96, 0x1A685E90, -+ 0x228B4000, 0x14685F14, 0x32215F14, 0x30380000, -+ 0x15D01093, 0x0B518000, 0x228B4000, 0x0200C000, -+ 0x12220002, 0x362300AF, 0x19801030, 0x14685F14, -+ 0x3A215F1A, 0x30380000, 0x15D01093, 0x228B4000, -+ 0x14685F14, 0x32215F14, 0x30380000, 0x1ED4010C, -+ 0x2A340080, 0x14C810A4, 0x12220002, 0x11801008, -+ 0x21510000, 0x1C685F1A, 0x28635E9C, 0x30380000, -+ 0x2DCC10AA, 0x228B4000, 0x3A215F1A, 0x12220002, -+ 0x14971004, 0x1A6B5E9C, 0x198010A5, 0x3DFFFFFF, -+ 0x01000000, 0x01000000, 0x01000000 -+}; -+ -+// Encapsulates the PKA firmware images information. -+typedef struct { -+ const uint32_t *farm_img; -+ uint32_t farm_img_size; -+ const uint32_t *boot_img; -+ uint32_t boot_img_size; -+ const uint32_t *master_img; -+ uint32_t master_img_size; -+} pka_firmware_info_t; -+ -+static const pka_firmware_info_t pka_firmware_array[] = -+{ -+ { -+ fw0_farm_img_data_buf, 2048, // actual length is 1652 -+ fw0_boot_img_data_buf, 152, -+ fw0_master_img_data_buf, 4161 -+ }, -+ { -+ fw1_farm_img_data_buf, 2048, // actual length is 2000 -+ fw1_boot_img_data_buf, 127, -+ fw1_master_img_data_buf, 4186 -+ }, -+ { -+ fw2_farm_img_data_buf, 2048, // actual length is 2045 -+ fw2_boot_img_data_buf, 154, -+ fw2_master_img_data_buf, 4275 -+ } -+}; -+ -+#define PKA_FIRMWARE_IMAGE_0_ID 0 -+#define PKA_FIRMWARE_IMAGE_1_ID 1 -+#define PKA_FIRMWARE_IMAGE_2_ID 2 -+ -+// Global storage for the actual firmware identifier -+static uint8_t pka_firmware_id; -+ -+// Setter of pka_firmware_id -+static inline void pka_firmware_set_id(uint8_t id) -+{ -+ pka_firmware_id = id; -+} -+ -+// Getter of pka_firmware_id -+static inline uint8_t pka_firmware_get_id(void) -+{ -+ return pka_firmware_id; -+} -+ -+ -+#endif -diff --git a/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_ioctl.h b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_ioctl.h -new file mode 100644 -index 000000000..8081a01fd ---- /dev/null -+++ b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_ioctl.h -@@ -0,0 +1,127 @@ -+// -+// BSD LICENSE -+// -+// Copyright(c) 2016 Mellanox Technologies, Ltd. All rights reserved. -+// All rights reserved. -+// -+// Redistribution and use in source and binary forms, with or without -+// modification, are permitted provided that the following conditions -+// are met: -+// -+// * Redistributions of source code must retain the above copyright -+// notice, this list of conditions and the following disclaimer. -+// * Redistributions in binary form must reproduce the above copyright -+// notice, this list of conditions and the following disclaimer in -+// the documentation and/or other materials provided with the -+// distribution. -+// * Neither the name of Mellanox Technologies nor the names of its -+// contributors may be used to endorse or promote products derived -+// from this software without specific prior written permission. -+// -+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+// -+ -+#ifndef __PKA_IOCTL_H__ -+#define __PKA_IOCTL_H__ -+ -+ -+#include -+#include -+ -+#define PKA_IOC_TYPE 0xB7 -+ -+/// PKA_RING_GET_REGION_INFO - _IORW(PKA_IOC_TYPE, 0x0, pka_dev_region_info_t) -+/// -+/// Retrieve information about a device region. This is intended to describe -+/// MMIO, I/O port, as well as bus specific regions (ex. PCI config space). -+/// Zero sized regions may be used to describe unimplemented regions. -+/// Return: 0 on success, -errno on failure. -+typedef struct -+{ -+ uint32_t reg_index; ///< Registers region index. -+ uint64_t reg_size; ///< Registers region size (bytes). -+ uint64_t reg_offset; ///< Registers region offset from start of device fd. -+ -+ uint32_t mem_index; ///< Memory region index. -+ uint64_t mem_size; ///< Memory region size (bytes). -+ uint64_t mem_offset; ///< Memeory region offset from start of device fd. -+} pka_dev_region_info_t; -+#define PKA_RING_GET_REGION_INFO _IOWR(PKA_IOC_TYPE, 0x0, pka_dev_region_info_t) -+ -+/// PKA_GET_RING_INFO - _IORW(PKA_IOC_TYPE, 0x1, pka_dev_ring_info_t) -+/// -+/// Retrieve information about a ring. This is intended to describe ring -+/// information words located in PKA_BUFFER_RAM. Ring information includes -+/// base addresses, size and statistics. -+/// Return: 0 on success, -errno on failure. -+typedef struct // Bluefield specific ring information -+{ -+ /// Base address of the command descriptor ring. -+ uint64_t cmmd_base; -+ -+ /// Base address of the result descriptor ring. -+ uint64_t rslt_base; -+ -+ /// Size of a command ring in number of descriptors, minus 1. -+ /// Minimum value is 0 (for 1 descriptor); maximum value is -+ /// 65535 (for 64K descriptors). -+ uint16_t size; -+ -+ /// This field specifies the size (in 32-bit words) of the -+ /// space that PKI command and result descriptor occupies on -+ /// the Host. -+ uint16_t host_desc_size : 10; -+ -+ /// Indicates whether the result ring delivers results strictly -+ /// in-order ('1') or that result descriptors are written to the -+ /// result ring as soon as they become available, so out-of-order -+ /// ('0'). -+ uint8_t in_order : 1; -+ -+ /// Read pointer of the command descriptor ring. -+ uint16_t cmmd_rd_ptr; -+ -+ /// Write pointer of the result descriptor ring. -+ uint16_t rslt_wr_ptr; -+ -+ /// Read statistics of the command descriptor ring. -+ uint16_t cmmd_rd_stats; -+ -+ /// Write statistics of the result descriptor ring. -+ uint16_t rslt_wr_stats; -+ -+} pka_dev_hw_ring_info_t; -+#define PKA_GET_RING_INFO _IOWR(PKA_IOC_TYPE, 0x1, pka_dev_hw_ring_info_t) -+ -+/// PKA_CLEAR_RING_COUNTERS - _IO(PKA_IOC_TYPE, 0x2) -+/// -+/// Clear counters. This is intended to reset all command and result counters. -+/// Return: 0 on success, -errno on failure. -+#define PKA_CLEAR_RING_COUNTERS _IO(PKA_IOC_TYPE, 0x2) -+ -+/// PKA_GET_RANDOM_BYTES - _IOWR(PKA_IOC_TYPE, 0x3, pka_dev_trng_info_t) -+/// -+/// Get random bytes from True Random Number Generator(TRNG). -+/// Return: 0 on success, -errno on failure. -+typedef struct // True Random Number Generator information -+{ -+ /// Number of random bytes in the buffer; Length of the buffer. -+ uint32_t count; -+ -+ /// Data buffer to hold the random bytes. -+ uint8_t *data; -+ -+} pka_dev_trng_info_t; -+#define PKA_GET_RANDOM_BYTES _IOWR(PKA_IOC_TYPE, 0x3, pka_dev_trng_info_t) -+ -+#endif // __PKA_IOCTL_H__ -diff --git a/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_mmio.h b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_mmio.h -new file mode 100644 -index 000000000..c70823c2a ---- /dev/null -+++ b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_mmio.h -@@ -0,0 +1,49 @@ -+// -+// BSD LICENSE -+// -+// Copyright(c) 2016 Mellanox Technologies, Ltd. All rights reserved. -+// All rights reserved. -+// -+// Redistribution and use in source and binary forms, with or without -+// modification, are permitted provided that the following conditions -+// are met: -+// -+// * Redistributions of source code must retain the above copyright -+// notice, this list of conditions and the following disclaimer. -+// * Redistributions in binary form must reproduce the above copyright -+// notice, this list of conditions and the following disclaimer in -+// the documentation and/or other materials provided with the -+// distribution. -+// * Neither the name of Mellanox Technologies nor the names of its -+// contributors may be used to endorse or promote products derived -+// from this software without specific prior written permission. -+// -+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+// -+ -+#ifndef __PKA_MMIO_H__ -+#define __PKA_MMIO_H__ -+ -+ -+/// Macros for standard MMIO functions. -+ -+#include -+#include -+#include -+ -+#define pka_mmio_read64(addr) readq_relaxed(addr) -+#define pka_mmio_write64(addr, val) writeq_relaxed((val), (addr)) -+#define pka_mmio_read(addr) pka_mmio_read64(addr) -+#define pka_mmio_write(addr, val) pka_mmio_write64((addr), (val)) -+ -+#endif // __PKA_MMIO_H__ -diff --git a/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_ring.h b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_ring.h -new file mode 100644 -index 000000000..be56b61ee ---- /dev/null -+++ b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_ring.h -@@ -0,0 +1,276 @@ -+// -+// BSD LICENSE -+// -+// Copyright(c) 2016 Mellanox Technologies, Ltd. All rights reserved. -+// All rights reserved. -+// -+// Redistribution and use in source and binary forms, with or without -+// modification, are permitted provided that the following conditions -+// are met: -+// -+// * Redistributions of source code must retain the above copyright -+// notice, this list of conditions and the following disclaimer. -+// * Redistributions in binary form must reproduce the above copyright -+// notice, this list of conditions and the following disclaimer in -+// the documentation and/or other materials provided with the -+// distribution. -+// * Neither the name of Mellanox Technologies nor the names of its -+// contributors may be used to endorse or promote products derived -+// from this software without specific prior written permission. -+// -+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+// -+ -+#ifndef __PKA_RING_H__ -+#define __PKA_RING_H__ -+ -+/// -+/// @file -+/// -+/// This file forms an interface to the BlueField Public Key Accelerator based -+/// on EIP-154. -+/// -+/// Rings are used as a communication mechanism between ARM cores (controller) -+/// and the farm engines controlled by EIP-154 master firmware. -+/// -+/// Note that the API defines data stuctures and functions to manage rings -+/// within window RAM, and to enqueue/dequeue descriptors. Rings are considered -+/// as a memory of descriptors (command/result descriptors) using finite size -+/// circular queue and a couple of control status registers (count registers). -+/// -+ -+ -+#include -+ -+#ifdef PKA_LIB_RING_DEBUG -+// A structure that stores the ring statistics. -+typedef struct -+{ -+ uint64_t enq_success_cmd; ///< Cmd descriptors successfully enqueued. -+ uint64_t enq_fail_cmd; ///< Cmd descriptors that failed to be enqueued. -+ uint64_t deq_success_rslt; ///< Rslt descriptors successfully dequeued. -+ uint64_t deq_fail_rslt; ///< Rslt descriptors that failed to be dequeued. -+} pka_ring_debug_stats __pka_cache_aligned; -+#endif -+ -+#ifdef PKA_LIB_RING_DEBUG -+#define __RING_STAT_ADD(r, name, n) ({ ##r##->stats.##name += 1; }) -+#else -+#define __RING_STAT_ADD(r, name, n) do {} while(0) -+#endif -+ -+/// Bluefield PKA command descriptor. -+typedef struct // 64 bytes long. 64 bytes aligned -+{ -+ uint64_t pointer_a; -+ uint64_t pointer_b; -+ uint64_t pointer_c; -+ uint64_t pointer_d; -+ uint64_t tag; -+ uint64_t pointer_e; -+ -+#ifdef __AARCH64EB__ -+ uint64_t linked : 1; -+ uint64_t driver_status : 2; -+ uint64_t odd_powers : 5; ///< shiftCnt for shift ops -+ uint64_t kdk : 2; ///< Key Decryption Key number -+ uint64_t encrypted_mask : 6; -+ uint64_t rsvd_3 : 8; -+ uint64_t command : 8; -+ uint64_t rsvd_2 : 5; -+ uint64_t length_b : 9; -+ uint64_t output_attr : 1; -+ uint64_t input_attr : 1; -+ uint64_t rsvd_1 : 5; -+ uint64_t length_a : 9; -+ uint64_t rsvd_0 : 2; -+#else -+ uint64_t rsvd_0 : 2; -+ uint64_t length_a : 9; -+ uint64_t rsvd_1 : 5; -+ uint64_t input_attr : 1; -+ uint64_t output_attr : 1; -+ uint64_t length_b : 9; -+ uint64_t rsvd_2 : 5; -+ uint64_t command : 8; -+ uint64_t rsvd_3 : 8; -+ uint64_t encrypted_mask : 6; -+ uint64_t kdk : 2; ///< Key Decryption Key number -+ uint64_t odd_powers : 5; ///< shiftCnt for shift ops -+ uint64_t driver_status : 2; -+ uint64_t linked : 1; -+#endif -+ -+ uint64_t rsvd_4; -+} pka_ring_hw_cmd_desc_t; -+ -+#define CMD_DESC_SIZE sizeof(pka_ring_hw_cmd_desc_t) // Must be 64 -+ -+/// Bluefield PKA result descriptor. -+typedef struct // 64 bytes long. 64 bytes aligned -+{ -+ uint64_t pointer_a; -+ uint64_t pointer_b; -+ uint64_t pointer_c; -+ uint64_t pointer_d; -+ uint64_t tag; -+ -+#ifdef __AARCH64EB__ -+ uint64_t rsvd_5 : 13; -+ uint64_t cmp_result : 3; -+ uint64_t modulo_is_0 : 1; -+ uint64_t rsvd_4 : 2; -+ uint64_t modulo_msw_offset : 11; -+ uint64_t rsvd_3 : 2; -+ uint64_t rsvd_2 : 11; -+ uint64_t main_result_msb_offset : 5; -+ uint64_t result_is_0 : 1; -+ uint64_t rsvd_1 : 2; -+ uint64_t main_result_msw_offset : 11; -+ uint64_t rsvd_0 : 2; -+ -+ uint64_t linked : 1; -+ uint64_t driver_status : 2; ///< Always written to 0 -+ uint64_t odd_powers : 5; ///< shiftCnt for shift ops -+ uint64_t kdk : 2; ///< Key Decryption Key number -+ uint64_t encrypted_mask : 6; -+ uint64_t result_code : 8; -+ uint64_t command : 8; -+ uint64_t rsvd_8 : 5; -+ uint64_t length_b : 9; -+ uint64_t output_attr : 1; -+ uint64_t input_attr : 1; -+ uint64_t rsvd_7 : 5; -+ uint64_t length_a : 9; -+ uint64_t rsvd_6 : 2; -+#else -+ uint64_t rsvd_0 : 2; -+ uint64_t main_result_msw_offset : 11; -+ uint64_t rsvd_1 : 2; -+ uint64_t result_is_0 : 1; -+ uint64_t main_result_msb_offset : 5; -+ uint64_t rsvd_2 : 11; -+ uint64_t rsvd_3 : 2; -+ uint64_t modulo_msw_offset : 11; -+ uint64_t rsvd_4 : 2; -+ uint64_t modulo_is_0 : 1; -+ uint64_t cmp_result : 3; -+ uint64_t rsvd_5 : 13; -+ -+ uint64_t rsvd_6 : 2; -+ uint64_t length_a : 9; -+ uint64_t rsvd_7 : 5; -+ uint64_t input_attr : 1; -+ uint64_t output_attr : 1; -+ uint64_t length_b : 9; -+ uint64_t rsvd_8 : 5; -+ uint64_t command : 8; -+ uint64_t result_code : 8; -+ uint64_t encrypted_mask : 6; -+ uint64_t kdk : 2; ///< Key Decryption Key number -+ uint64_t odd_powers : 5; ///< shiftCnt for shift ops -+ uint64_t driver_status : 2; ///< Always written to 0 -+ uint64_t linked : 1; -+#endif -+ -+ uint64_t rsvd_9; -+} pka_ring_hw_rslt_desc_t; -+ -+#define RESULT_DESC_SIZE sizeof(pka_ring_hw_rslt_desc_t) // Must be 64 -+ -+/// Describes a PKA command/result ring as used by the hardware. A pair of -+/// command and result rings in PKA window memory, and the data memory used -+/// by the commands. -+typedef struct -+{ -+ uint32_t num_descs; ///< total number of descriptors in the ring. -+ -+ uint32_t cmd_ring_base; ///< base address of the command ring. -+ uint32_t cmd_idx; ///< index of the command in a ring. -+ -+ uint32_t rslt_ring_base; ///< base address of the result ring. -+ uint32_t rslt_idx; ///< index of the result in a ring. -+ -+ uint32_t operands_base; ///< operands memory base address. -+ uint32_t operands_end; ///< end address of operands memory. -+ -+ uint32_t desc_size; ///< size of each element in the ring. -+ -+ uint64_t cmd_desc_mask; ///< bitmask of free(0)/in_use(1) cmd descriptors. -+ uint32_t cmd_desc_cnt; ///< number of command descriptors currently in use. -+ uint32_t rslt_desc_cnt; ///< number of result descriptors currently ready. -+} pka_ring_desc_t; -+ -+/// This structure declares ring parameters which can be used by user interface. -+typedef struct -+{ -+ int fd; ///< file descriptor. -+ int group; ///< iommu group. -+ int container; ///< vfio cointainer -+ -+ uint32_t idx; ///< ring index. -+ uint32_t ring_id; ///< hardware ring identifier. -+ -+ uint64_t mem_off; ///< offset specific to window RAM region. -+ uint64_t mem_addr; ///< window RAM region address. -+ uint64_t mem_size; ///< window RAM region size. -+ -+ uint64_t reg_off; ///< offset specific to count registers region. -+ uint64_t reg_addr; ///< count registers region address. -+ uint64_t reg_size; ///< count registers region size. -+ -+ void *mem_ptr; ///< pointer to map-ped memory region. -+ void *reg_ptr; ///< pointer to map-ped counters region. -+ -+ pka_ring_desc_t ring_desc; ///< ring descriptor. -+ -+#ifdef PKA_LIB_RING_DEBUG -+ struct pka_ring_debug_stats stats; -+#endif -+ -+ uint8_t big_endian; ///< big endian byte order when enabled. -+} pka_ring_info_t; -+ -+typedef struct -+{ -+ uint32_t dst_offset; ///< operands desctination offset. -+ uint32_t max_dst_offset; ///< operands end offset. -+ -+ pka_ring_info_t *ring; -+} pka_ring_alloc_t; -+ -+// This sturcture encapsulates 'user data' information, it also includes -+// additional information useful for command processing and statistics. -+typedef struct -+{ -+ uint64_t valid; ///< if set to 'PKA_UDATA_INFO_VALID' then info is valid -+ uint64_t user_data; ///< opaque user address. -+ uint64_t cmd_num; ///< command request number. -+ uint8_t cmd_desc_idx; ///< index of the cmd descriptor in HW rings -+ uint8_t ring_num; ///< command request number. -+ uint8_t queue_num; ///< queue number. -+} pka_udata_info_t; -+ -+#define PKA_UDATA_INFO_VALID 0xDEADBEEF -+ -+// This structure consists of a data base to store user data information. -+// Note that a data base should be associated with a hardware ring. -+typedef struct -+{ -+ pka_udata_info_t entries[32]; // user data information entries. -+ uint8_t index : 5; // entry index. Wrapping is permitted. -+} pka_udata_db_t; -+ -+#endif /// __PKA_RING_H__ -+ -+ --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0221-UBUNTU-SAUCE-platform-mellanox-Add-mlxbf-livefish-dr.patch b/platform/mellanox/non-upstream-patches/patches/0221-UBUNTU-SAUCE-platform-mellanox-Add-mlxbf-livefish-dr.patch deleted file mode 100644 index d83c31b778d4..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0221-UBUNTU-SAUCE-platform-mellanox-Add-mlxbf-livefish-dr.patch +++ /dev/null @@ -1,339 +0,0 @@ -From 9b0e85d738a43f737ed233e649fcda22b573d372 Mon Sep 17 00:00:00 2001 -From: Shravan Kumar Ramani -Date: Tue, 5 Jul 2022 12:43:45 -0400 -Subject: [PATCH backport 5.10 22/63] UBUNTU: SAUCE: platform/mellanox: Add - mlxbf-livefish driver - -BugLink: https://launchpad.net/bugs/1980761 - -This patch adds the mlxbf-livefish driver which supports update -of the HCA firmware when in livefish mode. - -Signed-off-by: Shravan Kumar Ramani -Signed-off-by: Ike Panhc ---- - drivers/platform/mellanox/Kconfig | 9 + - drivers/platform/mellanox/Makefile | 1 + - drivers/platform/mellanox/mlxbf-livefish.c | 279 +++++++++++++++++++++ - 3 files changed, 289 insertions(+) - create mode 100644 drivers/platform/mellanox/mlxbf-livefish.c - -diff --git a/drivers/platform/mellanox/Kconfig b/drivers/platform/mellanox/Kconfig -index 946bc2375..a5231c23a 100644 ---- a/drivers/platform/mellanox/Kconfig -+++ b/drivers/platform/mellanox/Kconfig -@@ -80,6 +80,15 @@ config MLXBF_BOOTCTL - to the userspace tools, to be used in conjunction with the eMMC - device driver to do necessary initial swap of the boot partition. - -+config MLXBF_LIVEFISH -+ tristate "Mellanox BlueField livefish firmware update driver" -+ depends on ARM64 -+ help -+ If you say yes to this option, support will added for the -+ mlxbf-livefish driver. This driver allows MFT tools to -+ update ConnectX HCA firmware on a Mellanox BlueField SoC -+ when it is in livefish mode. -+ - config MLXBF_PMC - tristate "Mellanox BlueField Performance Monitoring Counters driver" - depends on ARM64 -diff --git a/drivers/platform/mellanox/Makefile b/drivers/platform/mellanox/Makefile -index 837b748db1f6..be5b83bd765e 100644 ---- a/drivers/platform/mellanox/Makefile -+++ b/drivers/platform/mellanox/Makefile -@@ -7,5 +7,6 @@ obj-$(CONFIG_MLXBF_BOOTCTL) += mlxbf-bootctl.o - obj-$(CONFIG_MLXBF_PMC) += mlxbf-pmc.o - obj-$(CONFIG_MLXBF_TMFIFO) += mlxbf-tmfifo.o - obj-$(CONFIG_MLXBF_TRIO) += mlx-trio.o -+obj-$(CONFIG_MLXBF_LIVEFISH) += mlxbf-livefish.o - obj-$(CONFIG_MLXREG_HOTPLUG) += mlxreg-hotplug.o - obj-$(CONFIG_MLXREG_IO) += mlxreg-io.o -diff --git a/drivers/platform/mellanox/mlxbf-livefish.c b/drivers/platform/mellanox/mlxbf-livefish.c -new file mode 100644 -index 000000000..c6150117d ---- /dev/null -+++ b/drivers/platform/mellanox/mlxbf-livefish.c -@@ -0,0 +1,279 @@ -+// SPDX-License-Identifier: GPL-2.0-only OR Linux-OpenIB -+ -+/* -+ * Mellanox BlueField HCA firmware burning driver. -+ * -+ * Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. -+ * -+ * This driver supports burning firmware for the embedded HCA in the -+ * BlueField SoC. Typically firmware is burned through the PCI mlx5 -+ * driver directly, but when the existing firmware is not yet installed -+ * or invalid, the PCI mlx5 driver has no endpoint to bind to, and we -+ * use this driver instead. It provides a character device that gives -+ * access to the same hardware registers at the same offsets as the -+ * mlx5 PCI configuration space does. -+ * -+ * The first 1 MB of the space is available through the TRIO HCA -+ * mapping. However, the efuse area (128 bytes at offset 0x1c1600) is -+ * not available through the HCA mapping, but is available by mapping -+ * the TYU via the RSHIM, so we make it virtually appear at the -+ * correct offset in this driver. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#define DRIVER_VERSION 2.0 -+#define STRINGIFY(s) #s -+ -+static size_t hca_size; -+static phys_addr_t hca_pa; -+static __iomem void *hca_va; -+ -+#define TYU_SIZE 0x80UL -+#define TYU_OFFSET 0x1c1600 -+static phys_addr_t tyu_pa; -+static __iomem void *tyu_va; -+ -+#define MLXBF_LF_BF1 1 -+#define MLXBF_LF_BF2 2 -+static int chip_version; -+ -+#define CRSPACE_SIZE (2 * 1024 * 1024) -+ -+/* -+ * A valid I/O must be entirely within CR space and not extend into -+ * any unmapped areas of CR space. We don't truncate I/O that extends -+ * past the end of the CR space region (unlike the behavior of, for -+ * example, simple_read_from_buffer) but instead just call the whole -+ * I/O invalid. We also enforce 4-byte alignment for all I/O. -+ */ -+static bool valid_range(loff_t offset, size_t len) -+{ -+ if (offset % 4 != 0 || len % 4 != 0) -+ return false; /* unaligned */ -+ if (offset >= 0 && offset + len <= hca_size) -+ return true; /* inside the HCA space */ -+ if (offset >= TYU_OFFSET && offset + len <= TYU_OFFSET + TYU_SIZE) -+ return true; /* inside the TYU space */ -+ return false; -+} -+ -+/* -+ * Read and write to CR space offsets; we assume valid_range(). -+ * Data crossing the TRIO CR Space bridge gets byte-swapped, so we swap -+ * it back. -+ */ -+ -+static u32 crspace_readl(int offset) -+{ -+ u32 data; -+ if (chip_version == MLXBF_LF_BF1) { -+ if (offset < TYU_OFFSET) -+ return swab32(readl_relaxed(hca_va + offset)); -+ else -+ return readl_relaxed(tyu_va + offset - TYU_OFFSET); -+ } else { -+ data = readl_relaxed(hca_va + offset); -+ } -+ return data; -+} -+ -+static void crspace_writel(u32 data, int offset) -+{ -+ if (chip_version == MLXBF_LF_BF1) { -+ if (offset < TYU_OFFSET) -+ writel_relaxed(swab32(data), hca_va + offset); -+ else -+ writel_relaxed(data, tyu_va + offset - TYU_OFFSET); -+ } else { -+ writel_relaxed(data, hca_va + offset); -+ } -+} -+ -+/* -+ * Note that you can seek to illegal areas within the livefish device, -+ * but you won't be able to read or write there. -+ */ -+static loff_t livefish_llseek(struct file *filp, loff_t offset, int whence) -+{ -+ if (offset % 4 != 0) -+ return -EINVAL; -+ return fixed_size_llseek(filp, offset, whence, CRSPACE_SIZE); -+} -+ -+static ssize_t livefish_read(struct file *filp, char __user *to, size_t len, -+ loff_t *ppos) -+{ -+ loff_t pos = *ppos; -+ size_t i; -+ int word; -+ -+ if (!valid_range(pos, len)) -+ return -EINVAL; -+ if (len == 0) -+ return 0; -+ for (i = 0; i < len; i += 4, pos += 4) { -+ word = crspace_readl(pos); -+ if (put_user(word, (int __user *)(to + i)) != 0) -+ break; -+ } -+ *ppos = pos; -+ return i ?: -EFAULT; -+} -+ -+static ssize_t livefish_write(struct file *filp, const char __user *from, -+ size_t len, loff_t *ppos) -+{ -+ loff_t pos = *ppos; -+ size_t i; -+ int word; -+ -+ if (!valid_range(pos, len)) -+ return -EINVAL; -+ if (len == 0) -+ return 0; -+ for (i = 0; i < len; i += 4, pos += 4) { -+ if (get_user(word, (int __user *)(from + i)) != 0) -+ break; -+ crspace_writel(word, pos); -+ } -+ *ppos = pos; -+ return i ?: -EFAULT; -+} -+ -+static const struct file_operations livefish_fops = { -+ .owner = THIS_MODULE, -+ .llseek = livefish_llseek, -+ .read = livefish_read, -+ .write = livefish_write, -+}; -+ -+/* This name causes the correct semantics for the Mellanox MST tools. */ -+static struct miscdevice livefish_dev = { -+ .minor = MISC_DYNAMIC_MINOR, -+ .name = "bf-livefish", -+ .mode = 0600, -+ .fops = &livefish_fops -+}; -+ -+/* Release any VA or PA mappings that have been set up. */ -+static void livefish_cleanup_mappings(void) -+{ -+ if (hca_va) -+ iounmap(hca_va); -+ if (hca_pa) -+ release_mem_region(hca_pa, hca_size); -+ if (tyu_va) -+ iounmap(tyu_va); -+ if (tyu_pa) -+ release_mem_region(tyu_pa, TYU_SIZE); -+} -+ -+static int livefish_probe(struct platform_device *pdev) -+{ -+ struct resource *res; -+ int ret = -EINVAL; -+ struct acpi_device *acpi_dev = ACPI_COMPANION(&pdev->dev); -+ const char *hid = acpi_device_hid(acpi_dev); -+ -+ if (strcmp(hid, "MLNXBF05") == 0) -+ chip_version = MLXBF_LF_BF1; -+ else if (strcmp(hid, "MLNXBF25") == 0) -+ chip_version = MLXBF_LF_BF2; -+ else { -+ dev_err(&pdev->dev, "Invalid device ID %s\n", hid); -+ return -ENODEV; -+ } -+ -+ /* Find and map the HCA region */ -+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -+ if (res == NULL) -+ return -ENODEV; -+ -+ if (request_mem_region(res->start, resource_size(res), -+ "LiveFish (HCA)") == NULL) -+ return -EINVAL; -+ hca_pa = res->start; -+ hca_va = ioremap(res->start, resource_size(res)); -+ hca_size = resource_size(res); -+ dev_info(&pdev->dev, "HCA Region PA: 0x%llx Size: 0x%llx\n", -+ res->start, resource_size(res)); -+ if (hca_va == NULL) -+ goto err; -+ -+ if (chip_version == MLXBF_LF_BF1) { -+ /* Find and map the TYU efuse region */ -+ res = platform_get_resource(pdev, IORESOURCE_MEM, 1); -+ if (res == NULL) -+ goto err; -+ if (resource_size(res) < TYU_SIZE) { -+ dev_warn(&pdev->dev, "TYU space too small: %#lx, not %#lx\n", -+ (long)resource_size(res), TYU_SIZE); -+ goto err; -+ } -+ if (request_mem_region(res->start, TYU_SIZE, -+ "LiveFish (TYU)") == NULL) -+ goto err; -+ tyu_pa = res->start; -+ tyu_va = ioremap(res->start, TYU_SIZE); -+ if (tyu_va == NULL) -+ goto err; -+ } -+ -+ ret = misc_register(&livefish_dev); -+ if (ret) -+ goto err; -+ -+ dev_info(&pdev->dev, "probed\n"); -+ -+ return 0; -+ -+err: -+ livefish_cleanup_mappings(); -+ return ret; -+} -+ -+static int livefish_remove(struct platform_device *pdev) -+{ -+ misc_deregister(&livefish_dev); -+ livefish_cleanup_mappings(); -+ return 0; -+} -+ -+static const struct of_device_id livefish_of_match[] = { -+ { .compatible = "mellanox,mlxbf-livefish" }, -+ {}, -+}; -+ -+MODULE_DEVICE_TABLE(of, livefish_of_match); -+ -+static const struct acpi_device_id livefish_acpi_match[] = { -+ { "MLNXBF05", 0 }, -+ { "MLNXBF25", 0 }, -+ {}, -+}; -+MODULE_DEVICE_TABLE(acpi, livefish_acpi_match); -+ -+static struct platform_driver livefish_driver = { -+ .driver = { -+ .name = "mlxbf-livefish", -+ .of_match_table = livefish_of_match, -+ .acpi_match_table = ACPI_PTR(livefish_acpi_match), -+ }, -+ .probe = livefish_probe, -+ .remove = livefish_remove, -+}; -+ -+module_platform_driver(livefish_driver); -+ -+MODULE_DESCRIPTION("Mellanox BlueField LiveFish driver"); -+MODULE_AUTHOR("Shravan Kumar Ramani "); -+MODULE_VERSION(STRINGIFY(DRIVER_VERSION)); -+MODULE_LICENSE("Dual BSD/GPL"); --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0222-workqueue-Add-resource-managed-version-of-delayed-wo.patch b/platform/mellanox/non-upstream-patches/patches/0222-workqueue-Add-resource-managed-version-of-delayed-wo.patch deleted file mode 100644 index bc42afa80369..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0222-workqueue-Add-resource-managed-version-of-delayed-wo.patch +++ /dev/null @@ -1,84 +0,0 @@ -From 48998b5918e9320b47c26c78d3b14cc3e1faac8a Mon Sep 17 00:00:00 2001 -From: Matti Vaittinen -Date: Tue, 23 Mar 2021 15:56:17 +0200 -Subject: [PATCH backport 5.10 23/63] workqueue: Add resource managed version - of delayed work init - -A few drivers which need a delayed work-queue must cancel work at driver -detach. Some of those implement remove() solely for this purpose. Help -drivers to avoid unnecessary remove and error-branch implementation by -adding managed verision of delayed work initialization. This will also -help drivers to avoid mixing manual and devm based unwinding when other -resources are handled by devm. - -Reviewed-by: Hans de Goede -Signed-off-by: Matti Vaittinen -Link: https://lore.kernel.org/r/51769ea4668198deb798fe47fcfb5f5288d61586.1616506559.git.matti.vaittinen@fi.rohmeurope.com -Signed-off-by: Greg Kroah-Hartman ---- - include/linux/devm-helpers.h | 53 ++++++++++++++++++++++++++++++++++++ - 1 file changed, 53 insertions(+) - create mode 100644 include/linux/devm-helpers.h - -diff --git a/include/linux/devm-helpers.h b/include/linux/devm-helpers.h -new file mode 100644 -index 000000000..f64e0c9f3 ---- /dev/null -+++ b/include/linux/devm-helpers.h -@@ -0,0 +1,53 @@ -+/* SPDX-License-Identifier: GPL-2.0-only */ -+#ifndef __LINUX_DEVM_HELPERS_H -+#define __LINUX_DEVM_HELPERS_H -+ -+/* -+ * Functions which do automatically cancel operations or release resources upon -+ * driver detach. -+ * -+ * These should be helpful to avoid mixing the manual and devm-based resource -+ * management which can be source of annoying, rarely occurring, -+ * hard-to-reproduce bugs. -+ * -+ * Please take into account that devm based cancellation may be performed some -+ * time after the remove() is ran. -+ * -+ * Thus mixing devm and manual resource management can easily cause problems -+ * when unwinding operations with dependencies. IRQ scheduling a work in a queue -+ * is typical example where IRQs are often devm-managed and WQs are manually -+ * cleaned at remove(). If IRQs are not manually freed at remove() (and this is -+ * often the case when we use devm for IRQs) we have a period of time after -+ * remove() - and before devm managed IRQs are freed - where new IRQ may fire -+ * and schedule a work item which won't be cancelled because remove() was -+ * already ran. -+ */ -+ -+#include -+#include -+ -+static inline void devm_delayed_work_drop(void *res) -+{ -+ cancel_delayed_work_sync(res); -+} -+ -+/** -+ * devm_delayed_work_autocancel - Resource-managed work allocation -+ * @dev: Device which lifetime work is bound to -+ * @pdata: work to be cancelled when driver is detached -+ * -+ * Initialize work which is automatically cancelled when driver is detached. -+ * A few drivers need delayed work which must be cancelled before driver -+ * is detached to avoid accessing removed resources. -+ * devm_delayed_work_autocancel() can be used to omit the explicit -+ * cancelleation when driver is detached. -+ */ -+static inline int devm_delayed_work_autocancel(struct device *dev, -+ struct delayed_work *w, -+ work_func_t worker) -+{ -+ INIT_DELAYED_WORK(w, worker); -+ return devm_add_action(dev, devm_delayed_work_drop, w); -+} -+ -+#endif --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0223-devm-helpers-Fix-devm_delayed_work_autocancel-kernel.patch b/platform/mellanox/non-upstream-patches/patches/0223-devm-helpers-Fix-devm_delayed_work_autocancel-kernel.patch deleted file mode 100644 index fde92e039282..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0223-devm-helpers-Fix-devm_delayed_work_autocancel-kernel.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 64006a4de979012d8a55e67690b9ce743d5be433 Mon Sep 17 00:00:00 2001 -From: Matti Vaittinen -Date: Wed, 21 Apr 2021 21:11:32 +0300 -Subject: [PATCH backport 5.10 24/63] devm-helpers: Fix - devm_delayed_work_autocancel() kerneldoc - -The kerneldoc for devm_delayed_work_autocancel() contains invalid -parameter description. - -Fix the parameter description. And while at it - make it more obvous that -this function operates on delayed_work. That helps differentiating with -resource-managed INIT_WORK description (which should follow in near future) - -Fixes: 0341ce544394 ("workqueue: Add resource managed version of delayed work init") -Reviewed-by: Hans de Goede -Signed-off-by: Matti Vaittinen -Link: https://lore.kernel.org/r/db3a8b4b8899fdf109a0cc760807de12d3b4f09b.1619028482.git.matti.vaittinen@fi.rohmeurope.com -Signed-off-by: Greg Kroah-Hartman ---- - include/linux/devm-helpers.h | 13 +++++++------ - 1 file changed, 7 insertions(+), 6 deletions(-) - -diff --git a/include/linux/devm-helpers.h b/include/linux/devm-helpers.h -index f64e0c9f3..f40f77717 100644 ---- a/include/linux/devm-helpers.h -+++ b/include/linux/devm-helpers.h -@@ -32,13 +32,14 @@ static inline void devm_delayed_work_drop(void *res) - } - - /** -- * devm_delayed_work_autocancel - Resource-managed work allocation -- * @dev: Device which lifetime work is bound to -- * @pdata: work to be cancelled when driver is detached -+ * devm_delayed_work_autocancel - Resource-managed delayed work allocation -+ * @dev: Device which lifetime work is bound to -+ * @w: Work item to be queued -+ * @worker: Worker function - * -- * Initialize work which is automatically cancelled when driver is detached. -- * A few drivers need delayed work which must be cancelled before driver -- * is detached to avoid accessing removed resources. -+ * Initialize delayed work which is automatically cancelled when driver is -+ * detached. A few drivers need delayed work which must be cancelled before -+ * driver is detached to avoid accessing removed resources. - * devm_delayed_work_autocancel() can be used to omit the explicit - * cancelleation when driver is detached. - */ --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0224-devm-helpers-Add-resource-managed-version-of-work-in.patch b/platform/mellanox/non-upstream-patches/patches/0224-devm-helpers-Add-resource-managed-version-of-work-in.patch deleted file mode 100644 index b37400e15daf..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0224-devm-helpers-Add-resource-managed-version-of-work-in.patch +++ /dev/null @@ -1,59 +0,0 @@ -From b73a2da62dcb4d975c1b226280868f951533142b Mon Sep 17 00:00:00 2001 -From: Matti Vaittinen -Date: Tue, 8 Jun 2021 13:09:34 +0300 -Subject: [PATCH backport 5.10 25/63] devm-helpers: Add resource managed - version of work init - -A few drivers which need a work-queue must cancel work at driver detach. -Some of those implement remove() solely for this purpose. Help drivers to -avoid unnecessary remove and error-branch implementation by adding managed -verision of work initialization. This will also help drivers to avoid -mixing manual and devm based unwinding when other resources are handled by -devm. - -Signed-off-by: Matti Vaittinen -Reviewed-by: Krzysztof Kozlowski -Reviewed-by: Hans de Goede -Link: https://lore.kernel.org/r/94ff4175e7f2ff134ed2fa7d6e7641005cc9784b.1623146580.git.matti.vaittinen@fi.rohmeurope.com -Signed-off-by: Hans de Goede ---- - include/linux/devm-helpers.h | 25 +++++++++++++++++++++++++ - 1 file changed, 25 insertions(+) - -diff --git a/include/linux/devm-helpers.h b/include/linux/devm-helpers.h -index f40f77717..748918022 100644 ---- a/include/linux/devm-helpers.h -+++ b/include/linux/devm-helpers.h -@@ -51,4 +51,29 @@ static inline int devm_delayed_work_autocancel(struct device *dev, - return devm_add_action(dev, devm_delayed_work_drop, w); - } - -+static inline void devm_work_drop(void *res) -+{ -+ cancel_work_sync(res); -+} -+ -+/** -+ * devm_work_autocancel - Resource-managed work allocation -+ * @dev: Device which lifetime work is bound to -+ * @w: Work to be added (and automatically cancelled) -+ * @worker: Worker function -+ * -+ * Initialize work which is automatically cancelled when driver is detached. -+ * A few drivers need to queue work which must be cancelled before driver -+ * is detached to avoid accessing removed resources. -+ * devm_work_autocancel() can be used to omit the explicit -+ * cancelleation when driver is detached. -+ */ -+static inline int devm_work_autocancel(struct device *dev, -+ struct work_struct *w, -+ work_func_t worker) -+{ -+ INIT_WORK(w, worker); -+ return devm_add_action(dev, devm_work_drop, w); -+} -+ - #endif --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0225-UBUNTU-SAUCE-Add-support-to-pwr-mlxbf.c-driver.patch b/platform/mellanox/non-upstream-patches/patches/0225-UBUNTU-SAUCE-Add-support-to-pwr-mlxbf.c-driver.patch deleted file mode 100644 index a293cc8fa77b..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0225-UBUNTU-SAUCE-Add-support-to-pwr-mlxbf.c-driver.patch +++ /dev/null @@ -1,158 +0,0 @@ -From 66c331a304f41a5f1806a827b42bc97ba090c745 Mon Sep 17 00:00:00 2001 -From: Asmaa Mnebhi -Date: Tue, 5 Jul 2022 14:49:03 -0400 -Subject: [PATCH backport 5.10 26/63] UBUNTU: SAUCE: Add support to pwr-mlxbf.c - driver - -BugLink: https://launchpad.net/bugs/1980768 - -Signed-off-by: Asmaa Mnebhi -Signed-off-by: Ike Panhc - -1 - -Signed-off-by: Ike Panhc ---- - drivers/power/reset/Kconfig | 6 ++ - drivers/power/reset/Makefile | 1 + - drivers/power/reset/pwr-mlxbf.c | 103 ++++++++++++++++++++++++++++++++ - 3 files changed, 110 insertions(+) - create mode 100644 drivers/power/reset/pwr-mlxbf.c - -diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig -index d55b3727e..41ee02f87 100644 ---- a/drivers/power/reset/Kconfig -+++ b/drivers/power/reset/Kconfig -@@ -284,5 +284,11 @@ config NVMEM_REBOOT_MODE - then the bootloader can read it and take different - action according to the mode. - -+config POWER_MLXBF -+ tristate "Mellanox BlueField power handling driver" -+ depends on (GPIO_MLXBF2 && ACPI) -+ help -+ This driver supports reset or low power mode handling for Mellanox BlueField. -+ - endif - -diff --git a/drivers/power/reset/Makefile b/drivers/power/reset/Makefile -index c51eceba9..51801a5b5 100644 ---- a/drivers/power/reset/Makefile -+++ b/drivers/power/reset/Makefile -@@ -33,3 +33,4 @@ obj-$(CONFIG_REBOOT_MODE) += reboot-mode.o - obj-$(CONFIG_SYSCON_REBOOT_MODE) += syscon-reboot-mode.o - obj-$(CONFIG_POWER_RESET_SC27XX) += sc27xx-poweroff.o - obj-$(CONFIG_NVMEM_REBOOT_MODE) += nvmem-reboot-mode.o -+obj-$(CONFIG_POWER_MLXBF) += pwr-mlxbf.o -diff --git a/drivers/power/reset/pwr-mlxbf.c b/drivers/power/reset/pwr-mlxbf.c -new file mode 100644 -index 000000000..3f587a372 ---- /dev/null -+++ b/drivers/power/reset/pwr-mlxbf.c -@@ -0,0 +1,103 @@ -+// SPDX-License-Identifier: GPL-2.0-only or BSD-3-Clause -+ -+/* -+ * Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+ -+#define DRV_VERSION "1.1" -+ -+struct pwr_mlxbf { -+ struct work_struct send_work; -+ const char *hid; -+}; -+ -+static void pwr_mlxbf_send_work(struct work_struct *work) -+{ -+ acpi_bus_generate_netlink_event("button/power.*", "Power Button", 0x80, 1); -+} -+ -+static irqreturn_t pwr_mlxbf_irq(int irq, void *ptr) -+{ -+ const char *rst_pwr_hid = "MLNXBF24"; -+ const char *low_pwr_hid = "MLNXBF29"; -+ struct pwr_mlxbf *priv = ptr; -+ -+ if (!strncmp(priv->hid, rst_pwr_hid, 8)) -+ emergency_restart(); -+ -+ if (!strncmp(priv->hid, low_pwr_hid, 8)) -+ schedule_work(&priv->send_work); -+ -+ return IRQ_HANDLED; -+} -+ -+static int pwr_mlxbf_probe(struct platform_device *pdev) -+{ -+ struct device *dev = &pdev->dev; -+ struct acpi_device *adev; -+ struct pwr_mlxbf *priv; -+ const char *hid; -+ int irq, err; -+ -+ priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); -+ if (!priv) -+ return -ENOMEM; -+ -+ adev = ACPI_COMPANION(dev); -+ if (!adev) -+ return -ENXIO; -+ -+ hid = acpi_device_hid(adev); -+ priv->hid = hid; -+ -+ irq = acpi_dev_gpio_irq_get(ACPI_COMPANION(dev), 0); -+ if (irq < 0) -+ return dev_err_probe(dev, irq, "Error getting %s irq.\n", priv->hid); -+ -+ err = devm_work_autocancel(dev, &priv->send_work, pwr_mlxbf_send_work); -+ if (err) -+ return err; -+ -+ err = devm_request_irq(dev, irq, pwr_mlxbf_irq, 0, hid, priv); -+ if (err) -+ dev_err(dev, "Failed request of %s irq\n", priv->hid); -+ -+ return err; -+} -+ -+static const struct acpi_device_id __maybe_unused pwr_mlxbf_acpi_match[] = { -+ { "MLNXBF24", 0 }, -+ { "MLNXBF29", 0 }, -+ {}, -+}; -+MODULE_DEVICE_TABLE(acpi, pwr_mlxbf_acpi_match); -+ -+static struct platform_driver pwr_mlxbf_driver = { -+ .driver = { -+ .name = "pwr_mlxbf", -+ .acpi_match_table = pwr_mlxbf_acpi_match, -+ }, -+ .probe = pwr_mlxbf_probe, -+}; -+ -+module_platform_driver(pwr_mlxbf_driver); -+ -+MODULE_DESCRIPTION("Mellanox BlueField power driver"); -+MODULE_AUTHOR("Asmaa Mnebhi "); -+MODULE_LICENSE("Dual BSD/GPL"); -+MODULE_VERSION(DRV_VERSION); --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0226-Add-Mellanox-BlueField-Gigabit-Ethernet-driver.patch b/platform/mellanox/non-upstream-patches/patches/0226-Add-Mellanox-BlueField-Gigabit-Ethernet-driver.patch deleted file mode 100644 index eff1c335a0e7..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0226-Add-Mellanox-BlueField-Gigabit-Ethernet-driver.patch +++ /dev/null @@ -1,2206 +0,0 @@ -From 0e3f14e4ef0018a4cd75c0620a58484dae635e5d Mon Sep 17 00:00:00 2001 -From: David Thompson -Date: Thu, 24 Jun 2021 21:11:46 -0400 -Subject: [PATCH backport 5.10 27/63] Add Mellanox BlueField Gigabit Ethernet - driver - -This patch adds build and driver logic for the "mlxbf_gige" -Ethernet driver from Mellanox Technologies. The second -generation BlueField SoC from Mellanox supports an -out-of-band GigaBit Ethernet management port to the Arm -subsystem. This driver supports TCP/IP network connectivity -for that port, and provides back-end routines to handle -basic ethtool requests. - -The driver interfaces to the Gigabit Ethernet block of -BlueField SoC via MMIO accesses to registers, which contain -control information or pointers describing transmit and -receive resources. There is a single transmit queue, and -the port supports transmit ring sizes of 4 to 256 entries. -There is a single receive queue, and the port supports -receive ring sizes of 32 to 32K entries. The transmit and -receive rings are allocated from DMA coherent memory. There -is a 16-bit producer and consumer index per ring to denote -software ownership and hardware ownership, respectively. - -The main driver logic such as probe(), remove(), and netdev -ops are in "mlxbf_gige_main.c". Logic in "mlxbf_gige_rx.c" -and "mlxbf_gige_tx.c" handles the packet processing for -receive and transmit respectively. - -The logic in "mlxbf_gige_ethtool.c" supports the handling -of some basic ethtool requests: get driver info, get ring -parameters, get registers, and get statistics. - -The logic in "mlxbf_gige_mdio.c" is the driver controlling -the Mellanox BlueField hardware that interacts with a PHY -device via MDIO/MDC pins. This driver does the following: - - At driver probe time, it configures several BlueField MDIO - parameters such as sample rate, full drive, voltage and MDC - - It defines functions to read and write MDIO registers and - registers the MDIO bus. - - It defines the phy interrupt handler reporting a - link up/down status change - - This driver's probe is invoked from the main driver logic - while the phy interrupt handler is registered in ndo_open. - -Driver limitations - - Only supports 1Gbps speed - - Only supports GMII protocol - - Supports maximum packet size of 2KB - - Does not support scatter-gather buffering - -Testing - - Successful build of kernel for ARM64, ARM32, X86_64 - - Tested ARM64 build on FastModels & Palladium - - Tested ARM64 build on several Mellanox boards that are built with - the BlueField-2 SoC. The testing includes coverage in the areas - of networking (e.g. ping, iperf, ifconfig, route), file transfers - (e.g. SCP), and various ethtool options relevant to this driver. - -Signed-off-by: David Thompson -Signed-off-by: Asmaa Mnebhi -Reviewed-by: Liming Sun -Signed-off-by: David S. Miller ---- - drivers/net/ethernet/mellanox/Kconfig | 1 + - drivers/net/ethernet/mellanox/Makefile | 1 + - .../net/ethernet/mellanox/mlxbf_gige/Kconfig | 13 + - .../net/ethernet/mellanox/mlxbf_gige/Makefile | 11 + - .../ethernet/mellanox/mlxbf_gige/mlxbf_gige.h | 190 ++++++++ - .../mellanox/mlxbf_gige/mlxbf_gige_ethtool.c | 137 ++++++ - .../mellanox/mlxbf_gige/mlxbf_gige_gpio.c | 212 ++++++++ - .../mellanox/mlxbf_gige/mlxbf_gige_intr.c | 142 ++++++ - .../mellanox/mlxbf_gige/mlxbf_gige_main.c | 452 ++++++++++++++++++ - .../mellanox/mlxbf_gige/mlxbf_gige_mdio.c | 187 ++++++++ - .../mellanox/mlxbf_gige/mlxbf_gige_regs.h | 78 +++ - .../mellanox/mlxbf_gige/mlxbf_gige_rx.c | 320 +++++++++++++ - .../mellanox/mlxbf_gige/mlxbf_gige_tx.c | 284 +++++++++++ - 13 files changed, 2028 insertions(+) - create mode 100644 drivers/net/ethernet/mellanox/mlxbf_gige/Kconfig - create mode 100644 drivers/net/ethernet/mellanox/mlxbf_gige/Makefile - create mode 100644 drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige.h - create mode 100644 drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_ethtool.c - create mode 100644 drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_gpio.c - create mode 100644 drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_intr.c - create mode 100644 drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c - create mode 100644 drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c - create mode 100644 drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_regs.h - create mode 100644 drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_rx.c - create mode 100644 drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_tx.c - -diff --git a/drivers/net/ethernet/mellanox/Kconfig b/drivers/net/ethernet/mellanox/Kconfig -index ff6613a5c..b4f66eb9d 100644 ---- a/drivers/net/ethernet/mellanox/Kconfig -+++ b/drivers/net/ethernet/mellanox/Kconfig -@@ -22,5 +22,6 @@ source "drivers/net/ethernet/mellanox/mlx4/Kconfig" - source "drivers/net/ethernet/mellanox/mlx5/core/Kconfig" - source "drivers/net/ethernet/mellanox/mlxsw/Kconfig" - source "drivers/net/ethernet/mellanox/mlxfw/Kconfig" -+source "drivers/net/ethernet/mellanox/mlxbf_gige/Kconfig" - - endif # NET_VENDOR_MELLANOX -diff --git a/drivers/net/ethernet/mellanox/Makefile b/drivers/net/ethernet/mellanox/Makefile -index 79773ac33..d4b5f547a 100644 ---- a/drivers/net/ethernet/mellanox/Makefile -+++ b/drivers/net/ethernet/mellanox/Makefile -@@ -7,3 +7,4 @@ obj-$(CONFIG_MLX4_CORE) += mlx4/ - obj-$(CONFIG_MLX5_CORE) += mlx5/core/ - obj-$(CONFIG_MLXSW_CORE) += mlxsw/ - obj-$(CONFIG_MLXFW) += mlxfw/ -+obj-$(CONFIG_MLXBF_GIGE) += mlxbf_gige/ -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/Kconfig b/drivers/net/ethernet/mellanox/mlxbf_gige/Kconfig -new file mode 100644 -index 000000000..4cdebafaf ---- /dev/null -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/Kconfig -@@ -0,0 +1,13 @@ -+# SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause -+# -+# Mellanox GigE driver configuration -+# -+ -+config MLXBF_GIGE -+ tristate "Mellanox Technologies BlueField Gigabit Ethernet support" -+ depends on (ARM64 && ACPI) || COMPILE_TEST -+ select PHYLIB -+ help -+ The second generation BlueField SoC from Mellanox Technologies -+ supports an out-of-band Gigabit Ethernet management port to the -+ Arm subsystem. -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/Makefile b/drivers/net/ethernet/mellanox/mlxbf_gige/Makefile -new file mode 100644 -index 000000000..e57c1375f ---- /dev/null -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/Makefile -@@ -0,0 +1,11 @@ -+# SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause -+ -+obj-$(CONFIG_MLXBF_GIGE) += mlxbf_gige.o -+ -+mlxbf_gige-y := mlxbf_gige_ethtool.o \ -+ mlxbf_gige_gpio.o \ -+ mlxbf_gige_intr.o \ -+ mlxbf_gige_main.o \ -+ mlxbf_gige_mdio.o \ -+ mlxbf_gige_rx.o \ -+ mlxbf_gige_tx.o -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige.h b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige.h -new file mode 100644 -index 000000000..e3509e69e ---- /dev/null -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige.h -@@ -0,0 +1,190 @@ -+/* SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause */ -+ -+/* Header file for Gigabit Ethernet driver for Mellanox BlueField SoC -+ * - this file contains software data structures and any chip-specific -+ * data structures (e.g. TX WQE format) that are memory resident. -+ * -+ * Copyright (C) 2020-2021 NVIDIA CORPORATION & AFFILIATES -+ */ -+ -+#ifndef __MLXBF_GIGE_H__ -+#define __MLXBF_GIGE_H__ -+ -+#include -+#include -+#include -+#include -+ -+/* The silicon design supports a maximum RX ring size of -+ * 32K entries. Based on current testing this maximum size -+ * is not required to be supported. Instead the RX ring -+ * will be capped at a realistic value of 1024 entries. -+ */ -+#define MLXBF_GIGE_MIN_RXQ_SZ 32 -+#define MLXBF_GIGE_MAX_RXQ_SZ 1024 -+#define MLXBF_GIGE_DEFAULT_RXQ_SZ 128 -+ -+#define MLXBF_GIGE_MIN_TXQ_SZ 4 -+#define MLXBF_GIGE_MAX_TXQ_SZ 256 -+#define MLXBF_GIGE_DEFAULT_TXQ_SZ 128 -+ -+#define MLXBF_GIGE_DEFAULT_BUF_SZ 2048 -+ -+#define MLXBF_GIGE_DMA_PAGE_SZ 4096 -+#define MLXBF_GIGE_DMA_PAGE_SHIFT 12 -+ -+/* There are four individual MAC RX filters. Currently -+ * two of them are being used: one for the broadcast MAC -+ * (index 0) and one for local MAC (index 1) -+ */ -+#define MLXBF_GIGE_BCAST_MAC_FILTER_IDX 0 -+#define MLXBF_GIGE_LOCAL_MAC_FILTER_IDX 1 -+ -+/* Define for broadcast MAC literal */ -+#define BCAST_MAC_ADDR 0xFFFFFFFFFFFF -+ -+/* There are three individual interrupts: -+ * 1) Errors, "OOB" interrupt line -+ * 2) Receive Packet, "OOB_LLU" interrupt line -+ * 3) LLU and PLU Events, "OOB_PLU" interrupt line -+ */ -+#define MLXBF_GIGE_ERROR_INTR_IDX 0 -+#define MLXBF_GIGE_RECEIVE_PKT_INTR_IDX 1 -+#define MLXBF_GIGE_LLU_PLU_INTR_IDX 2 -+#define MLXBF_GIGE_PHY_INT_N 3 -+ -+#define MLXBF_GIGE_MDIO_DEFAULT_PHY_ADDR 0x3 -+ -+#define MLXBF_GIGE_DEFAULT_PHY_INT_GPIO 12 -+ -+struct mlxbf_gige_stats { -+ u64 hw_access_errors; -+ u64 tx_invalid_checksums; -+ u64 tx_small_frames; -+ u64 tx_index_errors; -+ u64 sw_config_errors; -+ u64 sw_access_errors; -+ u64 rx_truncate_errors; -+ u64 rx_mac_errors; -+ u64 rx_din_dropped_pkts; -+ u64 tx_fifo_full; -+ u64 rx_filter_passed_pkts; -+ u64 rx_filter_discard_pkts; -+}; -+ -+struct mlxbf_gige { -+ void __iomem *base; -+ void __iomem *llu_base; -+ void __iomem *plu_base; -+ struct device *dev; -+ struct net_device *netdev; -+ struct platform_device *pdev; -+ void __iomem *mdio_io; -+ struct mii_bus *mdiobus; -+ void __iomem *gpio_io; -+ struct irq_domain *irqdomain; -+ u32 phy_int_gpio_mask; -+ spinlock_t lock; /* for packet processing indices */ -+ spinlock_t gpio_lock; /* for GPIO bus access */ -+ u16 rx_q_entries; -+ u16 tx_q_entries; -+ u64 *tx_wqe_base; -+ dma_addr_t tx_wqe_base_dma; -+ u64 *tx_wqe_next; -+ u64 *tx_cc; -+ dma_addr_t tx_cc_dma; -+ dma_addr_t *rx_wqe_base; -+ dma_addr_t rx_wqe_base_dma; -+ u64 *rx_cqe_base; -+ dma_addr_t rx_cqe_base_dma; -+ u16 tx_pi; -+ u16 prev_tx_ci; -+ u64 error_intr_count; -+ u64 rx_intr_count; -+ u64 llu_plu_intr_count; -+ struct sk_buff *rx_skb[MLXBF_GIGE_MAX_RXQ_SZ]; -+ struct sk_buff *tx_skb[MLXBF_GIGE_MAX_TXQ_SZ]; -+ int error_irq; -+ int rx_irq; -+ int llu_plu_irq; -+ int phy_irq; -+ int hw_phy_irq; -+ bool promisc_enabled; -+ u8 valid_polarity; -+ struct napi_struct napi; -+ struct mlxbf_gige_stats stats; -+}; -+ -+/* Rx Work Queue Element definitions */ -+#define MLXBF_GIGE_RX_WQE_SZ 8 -+ -+/* Rx Completion Queue Element definitions */ -+#define MLXBF_GIGE_RX_CQE_SZ 8 -+#define MLXBF_GIGE_RX_CQE_PKT_LEN_MASK GENMASK(10, 0) -+#define MLXBF_GIGE_RX_CQE_VALID_MASK GENMASK(11, 11) -+#define MLXBF_GIGE_RX_CQE_PKT_STATUS_MASK GENMASK(15, 12) -+#define MLXBF_GIGE_RX_CQE_PKT_STATUS_MAC_ERR GENMASK(12, 12) -+#define MLXBF_GIGE_RX_CQE_PKT_STATUS_TRUNCATED GENMASK(13, 13) -+#define MLXBF_GIGE_RX_CQE_CHKSUM_MASK GENMASK(31, 16) -+ -+/* Tx Work Queue Element definitions */ -+#define MLXBF_GIGE_TX_WQE_SZ_QWORDS 2 -+#define MLXBF_GIGE_TX_WQE_SZ 16 -+#define MLXBF_GIGE_TX_WQE_PKT_LEN_MASK GENMASK(10, 0) -+#define MLXBF_GIGE_TX_WQE_UPDATE_MASK GENMASK(31, 31) -+#define MLXBF_GIGE_TX_WQE_CHKSUM_LEN_MASK GENMASK(42, 32) -+#define MLXBF_GIGE_TX_WQE_CHKSUM_START_MASK GENMASK(55, 48) -+#define MLXBF_GIGE_TX_WQE_CHKSUM_OFFSET_MASK GENMASK(63, 56) -+ -+/* Macro to return packet length of specified TX WQE */ -+#define MLXBF_GIGE_TX_WQE_PKT_LEN(tx_wqe_addr) \ -+ (*((tx_wqe_addr) + 1) & MLXBF_GIGE_TX_WQE_PKT_LEN_MASK) -+ -+/* Tx Completion Count */ -+#define MLXBF_GIGE_TX_CC_SZ 8 -+ -+/* List of resources in ACPI table */ -+enum mlxbf_gige_res { -+ MLXBF_GIGE_RES_MAC, -+ MLXBF_GIGE_RES_MDIO9, -+ MLXBF_GIGE_RES_GPIO0, -+ MLXBF_GIGE_RES_LLU, -+ MLXBF_GIGE_RES_PLU -+}; -+ -+/* Version of register data returned by mlxbf_gige_get_regs() */ -+#define MLXBF_GIGE_REGS_VERSION 1 -+ -+int mlxbf_gige_mdio_probe(struct platform_device *pdev, -+ struct mlxbf_gige *priv); -+void mlxbf_gige_mdio_remove(struct mlxbf_gige *priv); -+irqreturn_t mlxbf_gige_mdio_handle_phy_interrupt(int irq, void *dev_id); -+void mlxbf_gige_mdio_enable_phy_int(struct mlxbf_gige *priv); -+ -+void mlxbf_gige_set_mac_rx_filter(struct mlxbf_gige *priv, -+ unsigned int index, u64 dmac); -+void mlxbf_gige_get_mac_rx_filter(struct mlxbf_gige *priv, -+ unsigned int index, u64 *dmac); -+void mlxbf_gige_enable_promisc(struct mlxbf_gige *priv); -+void mlxbf_gige_disable_promisc(struct mlxbf_gige *priv); -+int mlxbf_gige_rx_init(struct mlxbf_gige *priv); -+void mlxbf_gige_rx_deinit(struct mlxbf_gige *priv); -+int mlxbf_gige_tx_init(struct mlxbf_gige *priv); -+void mlxbf_gige_tx_deinit(struct mlxbf_gige *priv); -+bool mlxbf_gige_handle_tx_complete(struct mlxbf_gige *priv); -+netdev_tx_t mlxbf_gige_start_xmit(struct sk_buff *skb, -+ struct net_device *netdev); -+struct sk_buff *mlxbf_gige_alloc_skb(struct mlxbf_gige *priv, -+ unsigned int map_len, -+ dma_addr_t *buf_dma, -+ enum dma_data_direction dir); -+int mlxbf_gige_request_irqs(struct mlxbf_gige *priv); -+void mlxbf_gige_free_irqs(struct mlxbf_gige *priv); -+int mlxbf_gige_poll(struct napi_struct *napi, int budget); -+extern const struct ethtool_ops mlxbf_gige_ethtool_ops; -+void mlxbf_gige_update_tx_wqe_next(struct mlxbf_gige *priv); -+ -+int mlxbf_gige_gpio_init(struct platform_device *pdev, struct mlxbf_gige *priv); -+void mlxbf_gige_gpio_free(struct mlxbf_gige *priv); -+ -+#endif /* !defined(__MLXBF_GIGE_H__) */ -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_ethtool.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_ethtool.c -new file mode 100644 -index 000000000..92b798f8e ---- /dev/null -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_ethtool.c -@@ -0,0 +1,137 @@ -+// SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause -+ -+/* Ethtool support for Mellanox Gigabit Ethernet driver -+ * -+ * Copyright (C) 2020-2021 NVIDIA CORPORATION & AFFILIATES -+ */ -+ -+#include -+ -+#include "mlxbf_gige.h" -+#include "mlxbf_gige_regs.h" -+ -+/* Start of struct ethtool_ops functions */ -+static int mlxbf_gige_get_regs_len(struct net_device *netdev) -+{ -+ return MLXBF_GIGE_MMIO_REG_SZ; -+} -+ -+static void mlxbf_gige_get_regs(struct net_device *netdev, -+ struct ethtool_regs *regs, void *p) -+{ -+ struct mlxbf_gige *priv = netdev_priv(netdev); -+ -+ regs->version = MLXBF_GIGE_REGS_VERSION; -+ -+ /* Read entire MMIO register space and store results -+ * into the provided buffer. Each 64-bit word is converted -+ * to big-endian to make the output more readable. -+ * -+ * NOTE: by design, a read to an offset without an existing -+ * register will be acknowledged and return zero. -+ */ -+ memcpy_fromio(p, priv->base, MLXBF_GIGE_MMIO_REG_SZ); -+} -+ -+static void mlxbf_gige_get_ringparam(struct net_device *netdev, -+ struct ethtool_ringparam *ering) -+{ -+ struct mlxbf_gige *priv = netdev_priv(netdev); -+ -+ ering->rx_max_pending = MLXBF_GIGE_MAX_RXQ_SZ; -+ ering->tx_max_pending = MLXBF_GIGE_MAX_TXQ_SZ; -+ ering->rx_pending = priv->rx_q_entries; -+ ering->tx_pending = priv->tx_q_entries; -+} -+ -+static const struct { -+ const char string[ETH_GSTRING_LEN]; -+} mlxbf_gige_ethtool_stats_keys[] = { -+ { "hw_access_errors" }, -+ { "tx_invalid_checksums" }, -+ { "tx_small_frames" }, -+ { "tx_index_errors" }, -+ { "sw_config_errors" }, -+ { "sw_access_errors" }, -+ { "rx_truncate_errors" }, -+ { "rx_mac_errors" }, -+ { "rx_din_dropped_pkts" }, -+ { "tx_fifo_full" }, -+ { "rx_filter_passed_pkts" }, -+ { "rx_filter_discard_pkts" }, -+}; -+ -+static int mlxbf_gige_get_sset_count(struct net_device *netdev, int stringset) -+{ -+ if (stringset != ETH_SS_STATS) -+ return -EOPNOTSUPP; -+ return ARRAY_SIZE(mlxbf_gige_ethtool_stats_keys); -+} -+ -+static void mlxbf_gige_get_strings(struct net_device *netdev, u32 stringset, -+ u8 *buf) -+{ -+ if (stringset != ETH_SS_STATS) -+ return; -+ memcpy(buf, &mlxbf_gige_ethtool_stats_keys, -+ sizeof(mlxbf_gige_ethtool_stats_keys)); -+} -+ -+static void mlxbf_gige_get_ethtool_stats(struct net_device *netdev, -+ struct ethtool_stats *estats, -+ u64 *data) -+{ -+ struct mlxbf_gige *priv = netdev_priv(netdev); -+ -+ /* Fill data array with interface statistics -+ * -+ * NOTE: the data writes must be in -+ * sync with the strings shown in -+ * the mlxbf_gige_ethtool_stats_keys[] array -+ * -+ * NOTE2: certain statistics below are zeroed upon -+ * port disable, so the calculation below -+ * must include the "cached" value of the stat -+ * plus the value read directly from hardware. -+ * Cached statistics are currently: -+ * rx_din_dropped_pkts -+ * rx_filter_passed_pkts -+ * rx_filter_discard_pkts -+ */ -+ *data++ = priv->stats.hw_access_errors; -+ *data++ = priv->stats.tx_invalid_checksums; -+ *data++ = priv->stats.tx_small_frames; -+ *data++ = priv->stats.tx_index_errors; -+ *data++ = priv->stats.sw_config_errors; -+ *data++ = priv->stats.sw_access_errors; -+ *data++ = priv->stats.rx_truncate_errors; -+ *data++ = priv->stats.rx_mac_errors; -+ *data++ = (priv->stats.rx_din_dropped_pkts + -+ readq(priv->base + MLXBF_GIGE_RX_DIN_DROP_COUNTER)); -+ *data++ = priv->stats.tx_fifo_full; -+ *data++ = (priv->stats.rx_filter_passed_pkts + -+ readq(priv->base + MLXBF_GIGE_RX_PASS_COUNTER_ALL)); -+ *data++ = (priv->stats.rx_filter_discard_pkts + -+ readq(priv->base + MLXBF_GIGE_RX_DISC_COUNTER_ALL)); -+} -+ -+static void mlxbf_gige_get_pauseparam(struct net_device *netdev, -+ struct ethtool_pauseparam *pause) -+{ -+ pause->autoneg = AUTONEG_DISABLE; -+ pause->rx_pause = 1; -+ pause->tx_pause = 1; -+} -+ -+const struct ethtool_ops mlxbf_gige_ethtool_ops = { -+ .get_link = ethtool_op_get_link, -+ .get_ringparam = mlxbf_gige_get_ringparam, -+ .get_regs_len = mlxbf_gige_get_regs_len, -+ .get_regs = mlxbf_gige_get_regs, -+ .get_strings = mlxbf_gige_get_strings, -+ .get_sset_count = mlxbf_gige_get_sset_count, -+ .get_ethtool_stats = mlxbf_gige_get_ethtool_stats, -+ .nway_reset = phy_ethtool_nway_reset, -+ .get_pauseparam = mlxbf_gige_get_pauseparam, -+ .get_link_ksettings = phy_ethtool_get_link_ksettings, -+}; -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_gpio.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_gpio.c -new file mode 100644 -index 000000000..a8d966db5 ---- /dev/null -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_gpio.c -@@ -0,0 +1,212 @@ -+// SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause -+ -+/* Initialize and handle GPIO interrupt triggered by INT_N PHY signal. -+ * This GPIO interrupt triggers the PHY state machine to bring the link -+ * up/down. -+ * -+ * Copyright (C) 2021 NVIDIA CORPORATION & AFFILIATES -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "mlxbf_gige.h" -+#include "mlxbf_gige_regs.h" -+ -+#define MLXBF_GIGE_GPIO_CAUSE_FALL_EN 0x48 -+#define MLXBF_GIGE_GPIO_CAUSE_OR_CAUSE_EVTEN0 0x80 -+#define MLXBF_GIGE_GPIO_CAUSE_OR_EVTEN0 0x94 -+#define MLXBF_GIGE_GPIO_CAUSE_OR_CLRCAUSE 0x98 -+ -+static void mlxbf_gige_gpio_enable(struct mlxbf_gige *priv) -+{ -+ unsigned long flags; -+ u32 val; -+ -+ spin_lock_irqsave(&priv->gpio_lock, flags); -+ val = readl(priv->gpio_io + MLXBF_GIGE_GPIO_CAUSE_OR_CLRCAUSE); -+ val |= priv->phy_int_gpio_mask; -+ writel(val, priv->gpio_io + MLXBF_GIGE_GPIO_CAUSE_OR_CLRCAUSE); -+ -+ /* The INT_N interrupt level is active low. -+ * So enable cause fall bit to detect when GPIO -+ * state goes low. -+ */ -+ val = readl(priv->gpio_io + MLXBF_GIGE_GPIO_CAUSE_FALL_EN); -+ val |= priv->phy_int_gpio_mask; -+ writel(val, priv->gpio_io + MLXBF_GIGE_GPIO_CAUSE_FALL_EN); -+ -+ /* Enable PHY interrupt by setting the priority level */ -+ val = readl(priv->gpio_io + MLXBF_GIGE_GPIO_CAUSE_OR_EVTEN0); -+ val |= priv->phy_int_gpio_mask; -+ writel(val, priv->gpio_io + MLXBF_GIGE_GPIO_CAUSE_OR_EVTEN0); -+ spin_unlock_irqrestore(&priv->gpio_lock, flags); -+} -+ -+static void mlxbf_gige_gpio_disable(struct mlxbf_gige *priv) -+{ -+ unsigned long flags; -+ u32 val; -+ -+ spin_lock_irqsave(&priv->gpio_lock, flags); -+ val = readl(priv->gpio_io + MLXBF_GIGE_GPIO_CAUSE_OR_EVTEN0); -+ val &= ~priv->phy_int_gpio_mask; -+ writel(val, priv->gpio_io + MLXBF_GIGE_GPIO_CAUSE_OR_EVTEN0); -+ spin_unlock_irqrestore(&priv->gpio_lock, flags); -+} -+ -+static irqreturn_t mlxbf_gige_gpio_handler(int irq, void *ptr) -+{ -+ struct mlxbf_gige *priv; -+ u32 val; -+ -+ priv = ptr; -+ -+ /* Check if this interrupt is from PHY device. -+ * Return if it is not. -+ */ -+ val = readl(priv->gpio_io + MLXBF_GIGE_GPIO_CAUSE_OR_CAUSE_EVTEN0); -+ if (!(val & priv->phy_int_gpio_mask)) -+ return IRQ_NONE; -+ -+ /* Clear interrupt when done, otherwise, no further interrupt -+ * will be triggered. -+ */ -+ val = readl(priv->gpio_io + MLXBF_GIGE_GPIO_CAUSE_OR_CLRCAUSE); -+ val |= priv->phy_int_gpio_mask; -+ writel(val, priv->gpio_io + MLXBF_GIGE_GPIO_CAUSE_OR_CLRCAUSE); -+ -+ generic_handle_irq(priv->phy_irq); -+ -+ return IRQ_HANDLED; -+} -+ -+static void mlxbf_gige_gpio_mask(struct irq_data *irqd) -+{ -+ struct mlxbf_gige *priv = irq_data_get_irq_chip_data(irqd); -+ -+ mlxbf_gige_gpio_disable(priv); -+} -+ -+static void mlxbf_gige_gpio_unmask(struct irq_data *irqd) -+{ -+ struct mlxbf_gige *priv = irq_data_get_irq_chip_data(irqd); -+ -+ mlxbf_gige_gpio_enable(priv); -+} -+ -+static struct irq_chip mlxbf_gige_gpio_chip = { -+ .name = "mlxbf_gige_phy", -+ .irq_mask = mlxbf_gige_gpio_mask, -+ .irq_unmask = mlxbf_gige_gpio_unmask, -+}; -+ -+static int mlxbf_gige_gpio_domain_map(struct irq_domain *d, -+ unsigned int irq, -+ irq_hw_number_t hwirq) -+{ -+ irq_set_chip_data(irq, d->host_data); -+ irq_set_chip_and_handler(irq, &mlxbf_gige_gpio_chip, handle_simple_irq); -+ irq_set_noprobe(irq); -+ -+ return 0; -+} -+ -+static const struct irq_domain_ops mlxbf_gige_gpio_domain_ops = { -+ .map = mlxbf_gige_gpio_domain_map, -+ .xlate = irq_domain_xlate_twocell, -+}; -+ -+#ifdef CONFIG_ACPI -+static int mlxbf_gige_gpio_resources(struct acpi_resource *ares, -+ void *data) -+{ -+ struct acpi_resource_gpio *gpio; -+ u32 *phy_int_gpio = data; -+ -+ if (ares->type == ACPI_RESOURCE_TYPE_GPIO) { -+ gpio = &ares->data.gpio; -+ *phy_int_gpio = gpio->pin_table[0]; -+ } -+ -+ return 1; -+} -+#endif -+ -+void mlxbf_gige_gpio_free(struct mlxbf_gige *priv) -+{ -+ irq_dispose_mapping(priv->phy_irq); -+ irq_domain_remove(priv->irqdomain); -+} -+ -+int mlxbf_gige_gpio_init(struct platform_device *pdev, -+ struct mlxbf_gige *priv) -+{ -+ struct device *dev = &pdev->dev; -+ struct resource *res; -+ u32 phy_int_gpio = 0; -+ int ret; -+ -+ LIST_HEAD(resources); -+ -+ res = platform_get_resource(pdev, IORESOURCE_MEM, MLXBF_GIGE_RES_GPIO0); -+ if (!res) -+ return -ENODEV; -+ -+ priv->gpio_io = devm_ioremap(dev, res->start, resource_size(res)); -+ if (!priv->gpio_io) -+ return -ENOMEM; -+ -+#ifdef CONFIG_ACPI -+ ret = acpi_dev_get_resources(ACPI_COMPANION(dev), -+ &resources, mlxbf_gige_gpio_resources, -+ &phy_int_gpio); -+ acpi_dev_free_resource_list(&resources); -+ if (ret < 0 || !phy_int_gpio) { -+ dev_err(dev, "Error retrieving the gpio phy pin"); -+ return -EINVAL; -+ } -+#endif -+ -+ priv->phy_int_gpio_mask = BIT(phy_int_gpio); -+ -+ mlxbf_gige_gpio_disable(priv); -+ -+ priv->hw_phy_irq = platform_get_irq(pdev, MLXBF_GIGE_PHY_INT_N); -+ -+ priv->irqdomain = irq_domain_add_simple(NULL, 1, 0, -+ &mlxbf_gige_gpio_domain_ops, -+ priv); -+ if (!priv->irqdomain) { -+ dev_err(dev, "Failed to add IRQ domain\n"); -+ return -ENOMEM; -+ } -+ -+ priv->phy_irq = irq_create_mapping(priv->irqdomain, 0); -+ if (!priv->phy_irq) { -+ irq_domain_remove(priv->irqdomain); -+ priv->irqdomain = NULL; -+ dev_err(dev, "Error mapping PHY IRQ\n"); -+ return -EINVAL; -+ } -+ -+ ret = devm_request_irq(dev, priv->hw_phy_irq, mlxbf_gige_gpio_handler, -+ IRQF_ONESHOT | IRQF_SHARED, "mlxbf_gige_phy", priv); -+ if (ret) { -+ dev_err(dev, "Failed to request PHY IRQ"); -+ mlxbf_gige_gpio_free(priv); -+ return ret; -+ } -+ -+ return ret; -+} -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_intr.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_intr.c -new file mode 100644 -index 000000000..c38795be0 ---- /dev/null -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_intr.c -@@ -0,0 +1,142 @@ -+// SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause -+ -+/* Interrupt related logic for Mellanox Gigabit Ethernet driver -+ * -+ * Copyright (C) 2020-2021 NVIDIA CORPORATION & AFFILIATES -+ */ -+ -+#include -+ -+#include "mlxbf_gige.h" -+#include "mlxbf_gige_regs.h" -+ -+static irqreturn_t mlxbf_gige_error_intr(int irq, void *dev_id) -+{ -+ struct mlxbf_gige *priv; -+ u64 int_status; -+ -+ priv = dev_id; -+ -+ priv->error_intr_count++; -+ -+ int_status = readq(priv->base + MLXBF_GIGE_INT_STATUS); -+ -+ if (int_status & MLXBF_GIGE_INT_STATUS_HW_ACCESS_ERROR) -+ priv->stats.hw_access_errors++; -+ -+ if (int_status & MLXBF_GIGE_INT_STATUS_TX_CHECKSUM_INPUTS) { -+ priv->stats.tx_invalid_checksums++; -+ /* This error condition is latched into MLXBF_GIGE_INT_STATUS -+ * when the GigE silicon operates on the offending -+ * TX WQE. The write to MLXBF_GIGE_INT_STATUS at the bottom -+ * of this routine clears this error condition. -+ */ -+ } -+ -+ if (int_status & MLXBF_GIGE_INT_STATUS_TX_SMALL_FRAME_SIZE) { -+ priv->stats.tx_small_frames++; -+ /* This condition happens when the networking stack invokes -+ * this driver's "start_xmit()" method with a packet whose -+ * size < 60 bytes. The GigE silicon will automatically pad -+ * this small frame up to a minimum-sized frame before it is -+ * sent. The "tx_small_frame" condition is latched into the -+ * MLXBF_GIGE_INT_STATUS register when the GigE silicon -+ * operates on the offending TX WQE. The write to -+ * MLXBF_GIGE_INT_STATUS at the bottom of this routine -+ * clears this condition. -+ */ -+ } -+ -+ if (int_status & MLXBF_GIGE_INT_STATUS_TX_PI_CI_EXCEED_WQ_SIZE) -+ priv->stats.tx_index_errors++; -+ -+ if (int_status & MLXBF_GIGE_INT_STATUS_SW_CONFIG_ERROR) -+ priv->stats.sw_config_errors++; -+ -+ if (int_status & MLXBF_GIGE_INT_STATUS_SW_ACCESS_ERROR) -+ priv->stats.sw_access_errors++; -+ -+ /* Clear all error interrupts by writing '1' back to -+ * all the asserted bits in INT_STATUS. Do not write -+ * '1' back to 'receive packet' bit, since that is -+ * managed separately. -+ */ -+ -+ int_status &= ~MLXBF_GIGE_INT_STATUS_RX_RECEIVE_PACKET; -+ -+ writeq(int_status, priv->base + MLXBF_GIGE_INT_STATUS); -+ -+ return IRQ_HANDLED; -+} -+ -+static irqreturn_t mlxbf_gige_rx_intr(int irq, void *dev_id) -+{ -+ struct mlxbf_gige *priv; -+ -+ priv = dev_id; -+ -+ priv->rx_intr_count++; -+ -+ /* NOTE: GigE silicon automatically disables "packet rx" interrupt by -+ * setting MLXBF_GIGE_INT_MASK bit0 upon triggering the interrupt -+ * to the ARM cores. Software needs to re-enable "packet rx" -+ * interrupts by clearing MLXBF_GIGE_INT_MASK bit0. -+ */ -+ -+ napi_schedule(&priv->napi); -+ -+ return IRQ_HANDLED; -+} -+ -+static irqreturn_t mlxbf_gige_llu_plu_intr(int irq, void *dev_id) -+{ -+ struct mlxbf_gige *priv; -+ -+ priv = dev_id; -+ priv->llu_plu_intr_count++; -+ -+ return IRQ_HANDLED; -+} -+ -+int mlxbf_gige_request_irqs(struct mlxbf_gige *priv) -+{ -+ int err; -+ -+ err = request_irq(priv->error_irq, mlxbf_gige_error_intr, 0, -+ "mlxbf_gige_error", priv); -+ if (err) { -+ dev_err(priv->dev, "Request error_irq failure\n"); -+ return err; -+ } -+ -+ err = request_irq(priv->rx_irq, mlxbf_gige_rx_intr, 0, -+ "mlxbf_gige_rx", priv); -+ if (err) { -+ dev_err(priv->dev, "Request rx_irq failure\n"); -+ goto free_error_irq; -+ } -+ -+ err = request_irq(priv->llu_plu_irq, mlxbf_gige_llu_plu_intr, 0, -+ "mlxbf_gige_llu_plu", priv); -+ if (err) { -+ dev_err(priv->dev, "Request llu_plu_irq failure\n"); -+ goto free_rx_irq; -+ } -+ -+ return 0; -+ -+free_rx_irq: -+ free_irq(priv->rx_irq, priv); -+ -+free_error_irq: -+ free_irq(priv->error_irq, priv); -+ -+ return err; -+} -+ -+void mlxbf_gige_free_irqs(struct mlxbf_gige *priv) -+{ -+ free_irq(priv->error_irq, priv); -+ free_irq(priv->rx_irq, priv); -+ free_irq(priv->llu_plu_irq, priv); -+} -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -new file mode 100644 -index 000000000..a0a059e01 ---- /dev/null -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -@@ -0,0 +1,452 @@ -+// SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause -+ -+/* Gigabit Ethernet driver for Mellanox BlueField SoC -+ * -+ * Copyright (C) 2020-2021 NVIDIA CORPORATION & AFFILIATES -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "mlxbf_gige.h" -+#include "mlxbf_gige_regs.h" -+ -+#define DRV_NAME "mlxbf_gige" -+ -+/* Allocate SKB whose payload pointer aligns with the Bluefield -+ * hardware DMA limitation, i.e. DMA operation can't cross -+ * a 4KB boundary. A maximum packet size of 2KB is assumed in the -+ * alignment formula. The alignment logic overallocates an SKB, -+ * and then adjusts the headroom so that the SKB data pointer is -+ * naturally aligned to a 2KB boundary. -+ */ -+struct sk_buff *mlxbf_gige_alloc_skb(struct mlxbf_gige *priv, -+ unsigned int map_len, -+ dma_addr_t *buf_dma, -+ enum dma_data_direction dir) -+{ -+ struct sk_buff *skb; -+ u64 addr, offset; -+ -+ /* Overallocate the SKB so that any headroom adjustment (to -+ * provide 2KB natural alignment) does not exceed payload area -+ */ -+ skb = netdev_alloc_skb(priv->netdev, MLXBF_GIGE_DEFAULT_BUF_SZ * 2); -+ if (!skb) -+ return NULL; -+ -+ /* Adjust the headroom so that skb->data is naturally aligned to -+ * a 2KB boundary, which is the maximum packet size supported. -+ */ -+ addr = (long)skb->data; -+ offset = (addr + MLXBF_GIGE_DEFAULT_BUF_SZ - 1) & -+ ~(MLXBF_GIGE_DEFAULT_BUF_SZ - 1); -+ offset -= addr; -+ if (offset) -+ skb_reserve(skb, offset); -+ -+ /* Return streaming DMA mapping to caller */ -+ *buf_dma = dma_map_single(priv->dev, skb->data, map_len, dir); -+ if (dma_mapping_error(priv->dev, *buf_dma)) { -+ dev_kfree_skb(skb); -+ *buf_dma = (dma_addr_t)0; -+ return NULL; -+ } -+ -+ return skb; -+} -+ -+static void mlxbf_gige_initial_mac(struct mlxbf_gige *priv) -+{ -+ u8 mac[ETH_ALEN]; -+ u64 local_mac; -+ -+ memset(mac, 0, ETH_ALEN); -+ mlxbf_gige_get_mac_rx_filter(priv, MLXBF_GIGE_LOCAL_MAC_FILTER_IDX, -+ &local_mac); -+ u64_to_ether_addr(local_mac, mac); -+ -+ if (is_valid_ether_addr(mac)) { -+ ether_addr_copy(priv->netdev->dev_addr, mac); -+ } else { -+ /* Provide a random MAC if for some reason the device has -+ * not been configured with a valid MAC address already. -+ */ -+ eth_hw_addr_random(priv->netdev); -+ } -+ -+ local_mac = ether_addr_to_u64(priv->netdev->dev_addr); -+ mlxbf_gige_set_mac_rx_filter(priv, MLXBF_GIGE_LOCAL_MAC_FILTER_IDX, -+ local_mac); -+} -+ -+static void mlxbf_gige_cache_stats(struct mlxbf_gige *priv) -+{ -+ struct mlxbf_gige_stats *p; -+ -+ /* Cache stats that will be cleared by clean port operation */ -+ p = &priv->stats; -+ p->rx_din_dropped_pkts += readq(priv->base + -+ MLXBF_GIGE_RX_DIN_DROP_COUNTER); -+ p->rx_filter_passed_pkts += readq(priv->base + -+ MLXBF_GIGE_RX_PASS_COUNTER_ALL); -+ p->rx_filter_discard_pkts += readq(priv->base + -+ MLXBF_GIGE_RX_DISC_COUNTER_ALL); -+} -+ -+static int mlxbf_gige_clean_port(struct mlxbf_gige *priv) -+{ -+ u64 control; -+ u64 temp; -+ int err; -+ -+ /* Set the CLEAN_PORT_EN bit to trigger SW reset */ -+ control = readq(priv->base + MLXBF_GIGE_CONTROL); -+ control |= MLXBF_GIGE_CONTROL_CLEAN_PORT_EN; -+ writeq(control, priv->base + MLXBF_GIGE_CONTROL); -+ -+ /* Ensure completion of "clean port" write before polling status */ -+ mb(); -+ -+ err = readq_poll_timeout_atomic(priv->base + MLXBF_GIGE_STATUS, temp, -+ (temp & MLXBF_GIGE_STATUS_READY), -+ 100, 100000); -+ -+ /* Clear the CLEAN_PORT_EN bit at end of this loop */ -+ control = readq(priv->base + MLXBF_GIGE_CONTROL); -+ control &= ~MLXBF_GIGE_CONTROL_CLEAN_PORT_EN; -+ writeq(control, priv->base + MLXBF_GIGE_CONTROL); -+ -+ return err; -+} -+ -+static int mlxbf_gige_open(struct net_device *netdev) -+{ -+ struct mlxbf_gige *priv = netdev_priv(netdev); -+ struct phy_device *phydev = netdev->phydev; -+ u64 int_en; -+ int err; -+ -+ err = mlxbf_gige_request_irqs(priv); -+ if (err) -+ return err; -+ mlxbf_gige_cache_stats(priv); -+ err = mlxbf_gige_clean_port(priv); -+ if (err) -+ goto free_irqs; -+ err = mlxbf_gige_rx_init(priv); -+ if (err) -+ goto free_irqs; -+ err = mlxbf_gige_tx_init(priv); -+ if (err) -+ goto rx_deinit; -+ -+ phy_start(phydev); -+ -+ netif_napi_add(netdev, &priv->napi, mlxbf_gige_poll, NAPI_POLL_WEIGHT); -+ napi_enable(&priv->napi); -+ netif_start_queue(netdev); -+ -+ /* Set bits in INT_EN that we care about */ -+ int_en = MLXBF_GIGE_INT_EN_HW_ACCESS_ERROR | -+ MLXBF_GIGE_INT_EN_TX_CHECKSUM_INPUTS | -+ MLXBF_GIGE_INT_EN_TX_SMALL_FRAME_SIZE | -+ MLXBF_GIGE_INT_EN_TX_PI_CI_EXCEED_WQ_SIZE | -+ MLXBF_GIGE_INT_EN_SW_CONFIG_ERROR | -+ MLXBF_GIGE_INT_EN_SW_ACCESS_ERROR | -+ MLXBF_GIGE_INT_EN_RX_RECEIVE_PACKET; -+ -+ /* Ensure completion of all initialization before enabling interrupts */ -+ mb(); -+ -+ writeq(int_en, priv->base + MLXBF_GIGE_INT_EN); -+ -+ return 0; -+ -+rx_deinit: -+ mlxbf_gige_rx_deinit(priv); -+ -+free_irqs: -+ mlxbf_gige_free_irqs(priv); -+ return err; -+} -+ -+static int mlxbf_gige_stop(struct net_device *netdev) -+{ -+ struct mlxbf_gige *priv = netdev_priv(netdev); -+ -+ writeq(0, priv->base + MLXBF_GIGE_INT_EN); -+ netif_stop_queue(netdev); -+ napi_disable(&priv->napi); -+ netif_napi_del(&priv->napi); -+ mlxbf_gige_free_irqs(priv); -+ -+ phy_stop(netdev->phydev); -+ -+ mlxbf_gige_rx_deinit(priv); -+ mlxbf_gige_tx_deinit(priv); -+ mlxbf_gige_cache_stats(priv); -+ mlxbf_gige_clean_port(priv); -+ -+ return 0; -+} -+ -+static int mlxbf_gige_do_ioctl(struct net_device *netdev, -+ struct ifreq *ifr, int cmd) -+{ -+ if (!(netif_running(netdev))) -+ return -EINVAL; -+ -+ return phy_mii_ioctl(netdev->phydev, ifr, cmd); -+} -+ -+static void mlxbf_gige_set_rx_mode(struct net_device *netdev) -+{ -+ struct mlxbf_gige *priv = netdev_priv(netdev); -+ bool new_promisc_enabled; -+ -+ new_promisc_enabled = netdev->flags & IFF_PROMISC; -+ -+ /* Only write to the hardware registers if the new setting -+ * of promiscuous mode is different from the current one. -+ */ -+ if (new_promisc_enabled != priv->promisc_enabled) { -+ priv->promisc_enabled = new_promisc_enabled; -+ -+ if (new_promisc_enabled) -+ mlxbf_gige_enable_promisc(priv); -+ else -+ mlxbf_gige_disable_promisc(priv); -+ } -+} -+ -+static void mlxbf_gige_get_stats64(struct net_device *netdev, -+ struct rtnl_link_stats64 *stats) -+{ -+ struct mlxbf_gige *priv = netdev_priv(netdev); -+ -+ netdev_stats_to_stats64(stats, &netdev->stats); -+ -+ stats->rx_length_errors = priv->stats.rx_truncate_errors; -+ stats->rx_fifo_errors = priv->stats.rx_din_dropped_pkts + -+ readq(priv->base + MLXBF_GIGE_RX_DIN_DROP_COUNTER); -+ stats->rx_crc_errors = priv->stats.rx_mac_errors; -+ stats->rx_errors = stats->rx_length_errors + -+ stats->rx_fifo_errors + -+ stats->rx_crc_errors; -+ -+ stats->tx_fifo_errors = priv->stats.tx_fifo_full; -+ stats->tx_errors = stats->tx_fifo_errors; -+} -+ -+static const struct net_device_ops mlxbf_gige_netdev_ops = { -+ .ndo_open = mlxbf_gige_open, -+ .ndo_stop = mlxbf_gige_stop, -+ .ndo_start_xmit = mlxbf_gige_start_xmit, -+ .ndo_set_mac_address = eth_mac_addr, -+ .ndo_validate_addr = eth_validate_addr, -+ .ndo_do_ioctl = mlxbf_gige_do_ioctl, -+ .ndo_set_rx_mode = mlxbf_gige_set_rx_mode, -+ .ndo_get_stats64 = mlxbf_gige_get_stats64, -+}; -+ -+static void mlxbf_gige_adjust_link(struct net_device *netdev) -+{ -+ struct phy_device *phydev = netdev->phydev; -+ -+ phy_print_status(phydev); -+} -+ -+static int mlxbf_gige_probe(struct platform_device *pdev) -+{ -+ struct phy_device *phydev; -+ struct net_device *netdev; -+ struct resource *mac_res; -+ struct resource *llu_res; -+ struct resource *plu_res; -+ struct mlxbf_gige *priv; -+ void __iomem *llu_base; -+ void __iomem *plu_base; -+ void __iomem *base; -+ u64 control; -+ int addr; -+ int err; -+ -+ mac_res = platform_get_resource(pdev, IORESOURCE_MEM, MLXBF_GIGE_RES_MAC); -+ if (!mac_res) -+ return -ENXIO; -+ -+ base = devm_ioremap_resource(&pdev->dev, mac_res); -+ if (IS_ERR(base)) -+ return PTR_ERR(base); -+ -+ llu_res = platform_get_resource(pdev, IORESOURCE_MEM, MLXBF_GIGE_RES_LLU); -+ if (!llu_res) -+ return -ENXIO; -+ -+ llu_base = devm_ioremap_resource(&pdev->dev, llu_res); -+ if (IS_ERR(llu_base)) -+ return PTR_ERR(llu_base); -+ -+ plu_res = platform_get_resource(pdev, IORESOURCE_MEM, MLXBF_GIGE_RES_PLU); -+ if (!plu_res) -+ return -ENXIO; -+ -+ plu_base = devm_ioremap_resource(&pdev->dev, plu_res); -+ if (IS_ERR(plu_base)) -+ return PTR_ERR(plu_base); -+ -+ /* Perform general init of GigE block */ -+ control = readq(base + MLXBF_GIGE_CONTROL); -+ control |= MLXBF_GIGE_CONTROL_PORT_EN; -+ writeq(control, base + MLXBF_GIGE_CONTROL); -+ -+ netdev = devm_alloc_etherdev(&pdev->dev, sizeof(*priv)); -+ if (!netdev) -+ return -ENOMEM; -+ -+ SET_NETDEV_DEV(netdev, &pdev->dev); -+ netdev->netdev_ops = &mlxbf_gige_netdev_ops; -+ netdev->ethtool_ops = &mlxbf_gige_ethtool_ops; -+ priv = netdev_priv(netdev); -+ priv->netdev = netdev; -+ -+ platform_set_drvdata(pdev, priv); -+ priv->dev = &pdev->dev; -+ priv->pdev = pdev; -+ -+ spin_lock_init(&priv->lock); -+ spin_lock_init(&priv->gpio_lock); -+ -+ /* Attach MDIO device */ -+ err = mlxbf_gige_mdio_probe(pdev, priv); -+ if (err) -+ return err; -+ -+ err = mlxbf_gige_gpio_init(pdev, priv); -+ if (err) { -+ dev_err(&pdev->dev, "PHY IRQ initialization failed\n"); -+ mlxbf_gige_mdio_remove(priv); -+ return -ENODEV; -+ } -+ -+ priv->base = base; -+ priv->llu_base = llu_base; -+ priv->plu_base = plu_base; -+ -+ priv->rx_q_entries = MLXBF_GIGE_DEFAULT_RXQ_SZ; -+ priv->tx_q_entries = MLXBF_GIGE_DEFAULT_TXQ_SZ; -+ -+ /* Write initial MAC address to hardware */ -+ mlxbf_gige_initial_mac(priv); -+ -+ err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)); -+ if (err) { -+ dev_err(&pdev->dev, "DMA configuration failed: 0x%x\n", err); -+ goto out; -+ } -+ -+ priv->error_irq = platform_get_irq(pdev, MLXBF_GIGE_ERROR_INTR_IDX); -+ priv->rx_irq = platform_get_irq(pdev, MLXBF_GIGE_RECEIVE_PKT_INTR_IDX); -+ priv->llu_plu_irq = platform_get_irq(pdev, MLXBF_GIGE_LLU_PLU_INTR_IDX); -+ -+ phydev = phy_find_first(priv->mdiobus); -+ if (!phydev) { -+ err = -ENODEV; -+ goto out; -+ } -+ -+ addr = phydev->mdio.addr; -+ priv->mdiobus->irq[addr] = priv->phy_irq; -+ phydev->irq = priv->phy_irq; -+ -+ err = phy_connect_direct(netdev, phydev, -+ mlxbf_gige_adjust_link, -+ PHY_INTERFACE_MODE_GMII); -+ if (err) { -+ dev_err(&pdev->dev, "Could not attach to PHY\n"); -+ goto out; -+ } -+ -+ /* MAC only supports 1000T full duplex mode */ -+ phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_1000baseT_Half_BIT); -+ phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_100baseT_Full_BIT); -+ phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_100baseT_Half_BIT); -+ phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_10baseT_Full_BIT); -+ phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_10baseT_Half_BIT); -+ -+ /* Only symmetric pause with flow control enabled is supported so no -+ * need to negotiate pause. -+ */ -+ linkmode_clear_bit(ETHTOOL_LINK_MODE_Pause_BIT, phydev->advertising); -+ linkmode_clear_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, phydev->advertising); -+ -+ /* Display information about attached PHY device */ -+ phy_attached_info(phydev); -+ -+ err = register_netdev(netdev); -+ if (err) { -+ dev_err(&pdev->dev, "Failed to register netdev\n"); -+ phy_disconnect(phydev); -+ goto out; -+ } -+ -+ return 0; -+ -+out: -+ mlxbf_gige_gpio_free(priv); -+ mlxbf_gige_mdio_remove(priv); -+ return err; -+} -+ -+static int mlxbf_gige_remove(struct platform_device *pdev) -+{ -+ struct mlxbf_gige *priv = platform_get_drvdata(pdev); -+ -+ unregister_netdev(priv->netdev); -+ phy_disconnect(priv->netdev->phydev); -+ mlxbf_gige_gpio_free(priv); -+ mlxbf_gige_mdio_remove(priv); -+ platform_set_drvdata(pdev, NULL); -+ -+ return 0; -+} -+ -+static void mlxbf_gige_shutdown(struct platform_device *pdev) -+{ -+ struct mlxbf_gige *priv = platform_get_drvdata(pdev); -+ -+ writeq(0, priv->base + MLXBF_GIGE_INT_EN); -+ mlxbf_gige_clean_port(priv); -+} -+ -+static const struct acpi_device_id __maybe_unused mlxbf_gige_acpi_match[] = { -+ { "MLNXBF17", 0 }, -+ {}, -+}; -+MODULE_DEVICE_TABLE(acpi, mlxbf_gige_acpi_match); -+ -+static struct platform_driver mlxbf_gige_driver = { -+ .probe = mlxbf_gige_probe, -+ .remove = mlxbf_gige_remove, -+ .shutdown = mlxbf_gige_shutdown, -+ .driver = { -+ .name = DRV_NAME, -+ .acpi_match_table = ACPI_PTR(mlxbf_gige_acpi_match), -+ }, -+}; -+ -+module_platform_driver(mlxbf_gige_driver); -+ -+MODULE_DESCRIPTION("Mellanox BlueField SoC Gigabit Ethernet Driver"); -+MODULE_AUTHOR("David Thompson "); -+MODULE_AUTHOR("Asmaa Mnebhi "); -+MODULE_LICENSE("Dual BSD/GPL"); -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c -new file mode 100644 -index 000000000..e32dd34fd ---- /dev/null -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c -@@ -0,0 +1,187 @@ -+// SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause -+ -+/* MDIO support for Mellanox Gigabit Ethernet driver -+ * -+ * Copyright (C) 2020-2021 NVIDIA CORPORATION & AFFILIATES -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "mlxbf_gige.h" -+ -+#define MLXBF_GIGE_MDIO_GW_OFFSET 0x0 -+#define MLXBF_GIGE_MDIO_CFG_OFFSET 0x4 -+ -+/* Support clause 22 */ -+#define MLXBF_GIGE_MDIO_CL22_ST1 0x1 -+#define MLXBF_GIGE_MDIO_CL22_WRITE 0x1 -+#define MLXBF_GIGE_MDIO_CL22_READ 0x2 -+ -+/* Busy bit is set by software and cleared by hardware */ -+#define MLXBF_GIGE_MDIO_SET_BUSY 0x1 -+ -+/* MDIO GW register bits */ -+#define MLXBF_GIGE_MDIO_GW_AD_MASK GENMASK(15, 0) -+#define MLXBF_GIGE_MDIO_GW_DEVAD_MASK GENMASK(20, 16) -+#define MLXBF_GIGE_MDIO_GW_PARTAD_MASK GENMASK(25, 21) -+#define MLXBF_GIGE_MDIO_GW_OPCODE_MASK GENMASK(27, 26) -+#define MLXBF_GIGE_MDIO_GW_ST1_MASK GENMASK(28, 28) -+#define MLXBF_GIGE_MDIO_GW_BUSY_MASK GENMASK(30, 30) -+ -+/* MDIO config register bits */ -+#define MLXBF_GIGE_MDIO_CFG_MDIO_MODE_MASK GENMASK(1, 0) -+#define MLXBF_GIGE_MDIO_CFG_MDIO3_3_MASK GENMASK(2, 2) -+#define MLXBF_GIGE_MDIO_CFG_MDIO_FULL_DRIVE_MASK GENMASK(4, 4) -+#define MLXBF_GIGE_MDIO_CFG_MDC_PERIOD_MASK GENMASK(15, 8) -+#define MLXBF_GIGE_MDIO_CFG_MDIO_IN_SAMP_MASK GENMASK(23, 16) -+#define MLXBF_GIGE_MDIO_CFG_MDIO_OUT_SAMP_MASK GENMASK(31, 24) -+ -+/* Formula for encoding the MDIO period. The encoded value is -+ * passed to the MDIO config register. -+ * -+ * mdc_clk = 2*(val + 1)*i1clk -+ * -+ * 400 ns = 2*(val + 1)*(((1/430)*1000) ns) -+ * -+ * val = (((400 * 430 / 1000) / 2) - 1) -+ */ -+#define MLXBF_GIGE_I1CLK_MHZ 430 -+#define MLXBF_GIGE_MDC_CLK_NS 400 -+ -+#define MLXBF_GIGE_MDIO_PERIOD (((MLXBF_GIGE_MDC_CLK_NS * MLXBF_GIGE_I1CLK_MHZ / 1000) / 2) - 1) -+ -+#define MLXBF_GIGE_MDIO_CFG_VAL (FIELD_PREP(MLXBF_GIGE_MDIO_CFG_MDIO_MODE_MASK, 1) | \ -+ FIELD_PREP(MLXBF_GIGE_MDIO_CFG_MDIO3_3_MASK, 1) | \ -+ FIELD_PREP(MLXBF_GIGE_MDIO_CFG_MDIO_FULL_DRIVE_MASK, 1) | \ -+ FIELD_PREP(MLXBF_GIGE_MDIO_CFG_MDC_PERIOD_MASK, \ -+ MLXBF_GIGE_MDIO_PERIOD) | \ -+ FIELD_PREP(MLXBF_GIGE_MDIO_CFG_MDIO_IN_SAMP_MASK, 6) | \ -+ FIELD_PREP(MLXBF_GIGE_MDIO_CFG_MDIO_OUT_SAMP_MASK, 13)) -+ -+static u32 mlxbf_gige_mdio_create_cmd(u16 data, int phy_add, -+ int phy_reg, u32 opcode) -+{ -+ u32 gw_reg = 0; -+ -+ gw_reg |= FIELD_PREP(MLXBF_GIGE_MDIO_GW_AD_MASK, data); -+ gw_reg |= FIELD_PREP(MLXBF_GIGE_MDIO_GW_DEVAD_MASK, phy_reg); -+ gw_reg |= FIELD_PREP(MLXBF_GIGE_MDIO_GW_PARTAD_MASK, phy_add); -+ gw_reg |= FIELD_PREP(MLXBF_GIGE_MDIO_GW_OPCODE_MASK, opcode); -+ gw_reg |= FIELD_PREP(MLXBF_GIGE_MDIO_GW_ST1_MASK, -+ MLXBF_GIGE_MDIO_CL22_ST1); -+ gw_reg |= FIELD_PREP(MLXBF_GIGE_MDIO_GW_BUSY_MASK, -+ MLXBF_GIGE_MDIO_SET_BUSY); -+ -+ return gw_reg; -+} -+ -+static int mlxbf_gige_mdio_read(struct mii_bus *bus, int phy_add, int phy_reg) -+{ -+ struct mlxbf_gige *priv = bus->priv; -+ u32 cmd; -+ int ret; -+ u32 val; -+ -+ if (phy_reg & MII_ADDR_C45) -+ return -EOPNOTSUPP; -+ -+ /* Send mdio read request */ -+ cmd = mlxbf_gige_mdio_create_cmd(0, phy_add, phy_reg, MLXBF_GIGE_MDIO_CL22_READ); -+ -+ writel(cmd, priv->mdio_io + MLXBF_GIGE_MDIO_GW_OFFSET); -+ -+ ret = readl_poll_timeout_atomic(priv->mdio_io + MLXBF_GIGE_MDIO_GW_OFFSET, -+ val, !(val & MLXBF_GIGE_MDIO_GW_BUSY_MASK), 100, 1000000); -+ -+ if (ret) { -+ writel(0, priv->mdio_io + MLXBF_GIGE_MDIO_GW_OFFSET); -+ return ret; -+ } -+ -+ ret = readl(priv->mdio_io + MLXBF_GIGE_MDIO_GW_OFFSET); -+ /* Only return ad bits of the gw register */ -+ ret &= MLXBF_GIGE_MDIO_GW_AD_MASK; -+ -+ return ret; -+} -+ -+static int mlxbf_gige_mdio_write(struct mii_bus *bus, int phy_add, -+ int phy_reg, u16 val) -+{ -+ struct mlxbf_gige *priv = bus->priv; -+ u32 cmd; -+ int ret; -+ u32 temp; -+ -+ if (phy_reg & MII_ADDR_C45) -+ return -EOPNOTSUPP; -+ -+ /* Send mdio write request */ -+ cmd = mlxbf_gige_mdio_create_cmd(val, phy_add, phy_reg, -+ MLXBF_GIGE_MDIO_CL22_WRITE); -+ writel(cmd, priv->mdio_io + MLXBF_GIGE_MDIO_GW_OFFSET); -+ -+ /* If the poll timed out, drop the request */ -+ ret = readl_poll_timeout_atomic(priv->mdio_io + MLXBF_GIGE_MDIO_GW_OFFSET, -+ temp, !(temp & MLXBF_GIGE_MDIO_GW_BUSY_MASK), 100, 1000000); -+ -+ return ret; -+} -+ -+int mlxbf_gige_mdio_probe(struct platform_device *pdev, struct mlxbf_gige *priv) -+{ -+ struct device *dev = &pdev->dev; -+ struct resource *res; -+ int ret; -+ -+ res = platform_get_resource(pdev, IORESOURCE_MEM, MLXBF_GIGE_RES_MDIO9); -+ if (!res) -+ return -ENODEV; -+ -+ priv->mdio_io = devm_ioremap_resource(dev, res); -+ if (IS_ERR(priv->mdio_io)) -+ return PTR_ERR(priv->mdio_io); -+ -+ /* Configure mdio parameters */ -+ writel(MLXBF_GIGE_MDIO_CFG_VAL, -+ priv->mdio_io + MLXBF_GIGE_MDIO_CFG_OFFSET); -+ -+ priv->mdiobus = devm_mdiobus_alloc(dev); -+ if (!priv->mdiobus) { -+ dev_err(dev, "Failed to alloc MDIO bus\n"); -+ return -ENOMEM; -+ } -+ -+ priv->mdiobus->name = "mlxbf-mdio"; -+ priv->mdiobus->read = mlxbf_gige_mdio_read; -+ priv->mdiobus->write = mlxbf_gige_mdio_write; -+ priv->mdiobus->parent = dev; -+ priv->mdiobus->priv = priv; -+ snprintf(priv->mdiobus->id, MII_BUS_ID_SIZE, "%s", -+ dev_name(dev)); -+ -+ ret = mdiobus_register(priv->mdiobus); -+ if (ret) -+ dev_err(dev, "Failed to register MDIO bus\n"); -+ -+ return ret; -+} -+ -+void mlxbf_gige_mdio_remove(struct mlxbf_gige *priv) -+{ -+ mdiobus_unregister(priv->mdiobus); -+} -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_regs.h b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_regs.h -new file mode 100644 -index 000000000..5fb33c929 ---- /dev/null -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_regs.h -@@ -0,0 +1,78 @@ -+/* SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause */ -+ -+/* Header file for Mellanox BlueField GigE register defines -+ * -+ * Copyright (C) 2020-2021 NVIDIA CORPORATION & AFFILIATES -+ */ -+ -+#ifndef __MLXBF_GIGE_REGS_H__ -+#define __MLXBF_GIGE_REGS_H__ -+ -+#define MLXBF_GIGE_STATUS 0x0010 -+#define MLXBF_GIGE_STATUS_READY BIT(0) -+#define MLXBF_GIGE_INT_STATUS 0x0028 -+#define MLXBF_GIGE_INT_STATUS_RX_RECEIVE_PACKET BIT(0) -+#define MLXBF_GIGE_INT_STATUS_RX_MAC_ERROR BIT(1) -+#define MLXBF_GIGE_INT_STATUS_RX_TRN_ERROR BIT(2) -+#define MLXBF_GIGE_INT_STATUS_SW_ACCESS_ERROR BIT(3) -+#define MLXBF_GIGE_INT_STATUS_SW_CONFIG_ERROR BIT(4) -+#define MLXBF_GIGE_INT_STATUS_TX_PI_CI_EXCEED_WQ_SIZE BIT(5) -+#define MLXBF_GIGE_INT_STATUS_TX_SMALL_FRAME_SIZE BIT(6) -+#define MLXBF_GIGE_INT_STATUS_TX_CHECKSUM_INPUTS BIT(7) -+#define MLXBF_GIGE_INT_STATUS_HW_ACCESS_ERROR BIT(8) -+#define MLXBF_GIGE_INT_EN 0x0030 -+#define MLXBF_GIGE_INT_EN_RX_RECEIVE_PACKET BIT(0) -+#define MLXBF_GIGE_INT_EN_RX_MAC_ERROR BIT(1) -+#define MLXBF_GIGE_INT_EN_RX_TRN_ERROR BIT(2) -+#define MLXBF_GIGE_INT_EN_SW_ACCESS_ERROR BIT(3) -+#define MLXBF_GIGE_INT_EN_SW_CONFIG_ERROR BIT(4) -+#define MLXBF_GIGE_INT_EN_TX_PI_CI_EXCEED_WQ_SIZE BIT(5) -+#define MLXBF_GIGE_INT_EN_TX_SMALL_FRAME_SIZE BIT(6) -+#define MLXBF_GIGE_INT_EN_TX_CHECKSUM_INPUTS BIT(7) -+#define MLXBF_GIGE_INT_EN_HW_ACCESS_ERROR BIT(8) -+#define MLXBF_GIGE_INT_MASK 0x0038 -+#define MLXBF_GIGE_INT_MASK_RX_RECEIVE_PACKET BIT(0) -+#define MLXBF_GIGE_CONTROL 0x0040 -+#define MLXBF_GIGE_CONTROL_PORT_EN BIT(0) -+#define MLXBF_GIGE_CONTROL_MAC_ID_RANGE_EN BIT(1) -+#define MLXBF_GIGE_CONTROL_EN_SPECIFIC_MAC BIT(4) -+#define MLXBF_GIGE_CONTROL_CLEAN_PORT_EN BIT(31) -+#define MLXBF_GIGE_RX_WQ_BASE 0x0200 -+#define MLXBF_GIGE_RX_WQE_SIZE_LOG2 0x0208 -+#define MLXBF_GIGE_RX_WQE_SIZE_LOG2_RESET_VAL 7 -+#define MLXBF_GIGE_RX_CQ_BASE 0x0210 -+#define MLXBF_GIGE_TX_WQ_BASE 0x0218 -+#define MLXBF_GIGE_TX_WQ_SIZE_LOG2 0x0220 -+#define MLXBF_GIGE_TX_WQ_SIZE_LOG2_RESET_VAL 7 -+#define MLXBF_GIGE_TX_CI_UPDATE_ADDRESS 0x0228 -+#define MLXBF_GIGE_RX_WQE_PI 0x0230 -+#define MLXBF_GIGE_TX_PRODUCER_INDEX 0x0238 -+#define MLXBF_GIGE_RX_MAC_FILTER 0x0240 -+#define MLXBF_GIGE_RX_MAC_FILTER_STRIDE 0x0008 -+#define MLXBF_GIGE_RX_DIN_DROP_COUNTER 0x0260 -+#define MLXBF_GIGE_TX_CONSUMER_INDEX 0x0310 -+#define MLXBF_GIGE_TX_CONTROL 0x0318 -+#define MLXBF_GIGE_TX_CONTROL_GRACEFUL_STOP BIT(0) -+#define MLXBF_GIGE_TX_STATUS 0x0388 -+#define MLXBF_GIGE_TX_STATUS_DATA_FIFO_FULL BIT(1) -+#define MLXBF_GIGE_RX_MAC_FILTER_DMAC_RANGE_START 0x0520 -+#define MLXBF_GIGE_RX_MAC_FILTER_DMAC_RANGE_END 0x0528 -+#define MLXBF_GIGE_RX_MAC_FILTER_COUNT_DISC 0x0540 -+#define MLXBF_GIGE_RX_MAC_FILTER_COUNT_DISC_EN BIT(0) -+#define MLXBF_GIGE_RX_MAC_FILTER_COUNT_PASS 0x0548 -+#define MLXBF_GIGE_RX_MAC_FILTER_COUNT_PASS_EN BIT(0) -+#define MLXBF_GIGE_RX_PASS_COUNTER_ALL 0x0550 -+#define MLXBF_GIGE_RX_DISC_COUNTER_ALL 0x0560 -+#define MLXBF_GIGE_RX 0x0578 -+#define MLXBF_GIGE_RX_STRIP_CRC_EN BIT(1) -+#define MLXBF_GIGE_RX_DMA 0x0580 -+#define MLXBF_GIGE_RX_DMA_EN BIT(0) -+#define MLXBF_GIGE_RX_CQE_PACKET_CI 0x05b0 -+#define MLXBF_GIGE_MAC_CFG 0x05e8 -+ -+/* NOTE: MLXBF_GIGE_MAC_CFG is the last defined register offset, -+ * so use that plus size of single register to derive total size -+ */ -+#define MLXBF_GIGE_MMIO_REG_SZ (MLXBF_GIGE_MAC_CFG + 8) -+ -+#endif /* !defined(__MLXBF_GIGE_REGS_H__) */ -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_rx.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_rx.c -new file mode 100644 -index 000000000..afa3b92a6 ---- /dev/null -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_rx.c -@@ -0,0 +1,320 @@ -+// SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause -+ -+/* Packet receive logic for Mellanox Gigabit Ethernet driver -+ * -+ * Copyright (C) 2020-2021 NVIDIA CORPORATION & AFFILIATES -+ */ -+ -+#include -+#include -+ -+#include "mlxbf_gige.h" -+#include "mlxbf_gige_regs.h" -+ -+void mlxbf_gige_set_mac_rx_filter(struct mlxbf_gige *priv, -+ unsigned int index, u64 dmac) -+{ -+ void __iomem *base = priv->base; -+ u64 control; -+ -+ /* Write destination MAC to specified MAC RX filter */ -+ writeq(dmac, base + MLXBF_GIGE_RX_MAC_FILTER + -+ (index * MLXBF_GIGE_RX_MAC_FILTER_STRIDE)); -+ -+ /* Enable MAC receive filter mask for specified index */ -+ control = readq(base + MLXBF_GIGE_CONTROL); -+ control |= (MLXBF_GIGE_CONTROL_EN_SPECIFIC_MAC << index); -+ writeq(control, base + MLXBF_GIGE_CONTROL); -+} -+ -+void mlxbf_gige_get_mac_rx_filter(struct mlxbf_gige *priv, -+ unsigned int index, u64 *dmac) -+{ -+ void __iomem *base = priv->base; -+ -+ /* Read destination MAC from specified MAC RX filter */ -+ *dmac = readq(base + MLXBF_GIGE_RX_MAC_FILTER + -+ (index * MLXBF_GIGE_RX_MAC_FILTER_STRIDE)); -+} -+ -+void mlxbf_gige_enable_promisc(struct mlxbf_gige *priv) -+{ -+ void __iomem *base = priv->base; -+ u64 control; -+ u64 end_mac; -+ -+ /* Enable MAC_ID_RANGE match functionality */ -+ control = readq(base + MLXBF_GIGE_CONTROL); -+ control |= MLXBF_GIGE_CONTROL_MAC_ID_RANGE_EN; -+ writeq(control, base + MLXBF_GIGE_CONTROL); -+ -+ /* Set start of destination MAC range check to 0 */ -+ writeq(0, base + MLXBF_GIGE_RX_MAC_FILTER_DMAC_RANGE_START); -+ -+ /* Set end of destination MAC range check to all FFs */ -+ end_mac = BCAST_MAC_ADDR; -+ writeq(end_mac, base + MLXBF_GIGE_RX_MAC_FILTER_DMAC_RANGE_END); -+} -+ -+void mlxbf_gige_disable_promisc(struct mlxbf_gige *priv) -+{ -+ void __iomem *base = priv->base; -+ u64 control; -+ -+ /* Disable MAC_ID_RANGE match functionality */ -+ control = readq(base + MLXBF_GIGE_CONTROL); -+ control &= ~MLXBF_GIGE_CONTROL_MAC_ID_RANGE_EN; -+ writeq(control, base + MLXBF_GIGE_CONTROL); -+ -+ /* NOTE: no need to change DMAC_RANGE_START or END; -+ * those values are ignored since MAC_ID_RANGE_EN=0 -+ */ -+} -+ -+/* Receive Initialization -+ * 1) Configures RX MAC filters via MMIO registers -+ * 2) Allocates RX WQE array using coherent DMA mapping -+ * 3) Initializes each element of RX WQE array with a receive -+ * buffer pointer (also using coherent DMA mapping) -+ * 4) Allocates RX CQE array using coherent DMA mapping -+ * 5) Completes other misc receive initialization -+ */ -+int mlxbf_gige_rx_init(struct mlxbf_gige *priv) -+{ -+ size_t wq_size, cq_size; -+ dma_addr_t *rx_wqe_ptr; -+ dma_addr_t rx_buf_dma; -+ u64 data; -+ int i, j; -+ -+ /* Configure MAC RX filter #0 to allow RX of broadcast pkts */ -+ mlxbf_gige_set_mac_rx_filter(priv, MLXBF_GIGE_BCAST_MAC_FILTER_IDX, -+ BCAST_MAC_ADDR); -+ -+ wq_size = MLXBF_GIGE_RX_WQE_SZ * priv->rx_q_entries; -+ priv->rx_wqe_base = dma_alloc_coherent(priv->dev, wq_size, -+ &priv->rx_wqe_base_dma, -+ GFP_KERNEL); -+ if (!priv->rx_wqe_base) -+ return -ENOMEM; -+ -+ /* Initialize 'rx_wqe_ptr' to point to first RX WQE in array -+ * Each RX WQE is simply a receive buffer pointer, so walk -+ * the entire array, allocating a 2KB buffer for each element -+ */ -+ rx_wqe_ptr = priv->rx_wqe_base; -+ -+ for (i = 0; i < priv->rx_q_entries; i++) { -+ priv->rx_skb[i] = mlxbf_gige_alloc_skb(priv, MLXBF_GIGE_DEFAULT_BUF_SZ, -+ &rx_buf_dma, DMA_FROM_DEVICE); -+ if (!priv->rx_skb[i]) -+ goto free_wqe_and_skb; -+ *rx_wqe_ptr++ = rx_buf_dma; -+ } -+ -+ /* Write RX WQE base address into MMIO reg */ -+ writeq(priv->rx_wqe_base_dma, priv->base + MLXBF_GIGE_RX_WQ_BASE); -+ -+ cq_size = MLXBF_GIGE_RX_CQE_SZ * priv->rx_q_entries; -+ priv->rx_cqe_base = dma_alloc_coherent(priv->dev, cq_size, -+ &priv->rx_cqe_base_dma, -+ GFP_KERNEL); -+ if (!priv->rx_cqe_base) -+ goto free_wqe_and_skb; -+ -+ for (i = 0; i < priv->rx_q_entries; i++) -+ priv->rx_cqe_base[i] |= MLXBF_GIGE_RX_CQE_VALID_MASK; -+ -+ /* Write RX CQE base address into MMIO reg */ -+ writeq(priv->rx_cqe_base_dma, priv->base + MLXBF_GIGE_RX_CQ_BASE); -+ -+ /* Write RX_WQE_PI with current number of replenished buffers */ -+ writeq(priv->rx_q_entries, priv->base + MLXBF_GIGE_RX_WQE_PI); -+ -+ /* Enable removal of CRC during RX */ -+ data = readq(priv->base + MLXBF_GIGE_RX); -+ data |= MLXBF_GIGE_RX_STRIP_CRC_EN; -+ writeq(data, priv->base + MLXBF_GIGE_RX); -+ -+ /* Enable RX MAC filter pass and discard counters */ -+ writeq(MLXBF_GIGE_RX_MAC_FILTER_COUNT_DISC_EN, -+ priv->base + MLXBF_GIGE_RX_MAC_FILTER_COUNT_DISC); -+ writeq(MLXBF_GIGE_RX_MAC_FILTER_COUNT_PASS_EN, -+ priv->base + MLXBF_GIGE_RX_MAC_FILTER_COUNT_PASS); -+ -+ /* Clear MLXBF_GIGE_INT_MASK 'receive pkt' bit to -+ * indicate readiness to receive interrupts -+ */ -+ data = readq(priv->base + MLXBF_GIGE_INT_MASK); -+ data &= ~MLXBF_GIGE_INT_MASK_RX_RECEIVE_PACKET; -+ writeq(data, priv->base + MLXBF_GIGE_INT_MASK); -+ -+ /* Enable RX DMA to write new packets to memory */ -+ data = readq(priv->base + MLXBF_GIGE_RX_DMA); -+ data |= MLXBF_GIGE_RX_DMA_EN; -+ writeq(data, priv->base + MLXBF_GIGE_RX_DMA); -+ -+ writeq(ilog2(priv->rx_q_entries), -+ priv->base + MLXBF_GIGE_RX_WQE_SIZE_LOG2); -+ -+ return 0; -+ -+free_wqe_and_skb: -+ rx_wqe_ptr = priv->rx_wqe_base; -+ for (j = 0; j < i; j++) { -+ dma_unmap_single(priv->dev, *rx_wqe_ptr, -+ MLXBF_GIGE_DEFAULT_BUF_SZ, DMA_FROM_DEVICE); -+ dev_kfree_skb(priv->rx_skb[j]); -+ rx_wqe_ptr++; -+ } -+ dma_free_coherent(priv->dev, wq_size, -+ priv->rx_wqe_base, priv->rx_wqe_base_dma); -+ return -ENOMEM; -+} -+ -+/* Receive Deinitialization -+ * This routine will free allocations done by mlxbf_gige_rx_init(), -+ * namely the RX WQE and RX CQE arrays, as well as all RX buffers -+ */ -+void mlxbf_gige_rx_deinit(struct mlxbf_gige *priv) -+{ -+ dma_addr_t *rx_wqe_ptr; -+ size_t size; -+ u64 data; -+ int i; -+ -+ /* Disable RX DMA to prevent packet transfers to memory */ -+ data = readq(priv->base + MLXBF_GIGE_RX_DMA); -+ data &= ~MLXBF_GIGE_RX_DMA_EN; -+ writeq(data, priv->base + MLXBF_GIGE_RX_DMA); -+ -+ rx_wqe_ptr = priv->rx_wqe_base; -+ -+ for (i = 0; i < priv->rx_q_entries; i++) { -+ dma_unmap_single(priv->dev, *rx_wqe_ptr, MLXBF_GIGE_DEFAULT_BUF_SZ, -+ DMA_FROM_DEVICE); -+ dev_kfree_skb(priv->rx_skb[i]); -+ rx_wqe_ptr++; -+ } -+ -+ size = MLXBF_GIGE_RX_WQE_SZ * priv->rx_q_entries; -+ dma_free_coherent(priv->dev, size, -+ priv->rx_wqe_base, priv->rx_wqe_base_dma); -+ -+ size = MLXBF_GIGE_RX_CQE_SZ * priv->rx_q_entries; -+ dma_free_coherent(priv->dev, size, -+ priv->rx_cqe_base, priv->rx_cqe_base_dma); -+ -+ priv->rx_wqe_base = NULL; -+ priv->rx_wqe_base_dma = 0; -+ priv->rx_cqe_base = NULL; -+ priv->rx_cqe_base_dma = 0; -+ writeq(0, priv->base + MLXBF_GIGE_RX_WQ_BASE); -+ writeq(0, priv->base + MLXBF_GIGE_RX_CQ_BASE); -+} -+ -+static bool mlxbf_gige_rx_packet(struct mlxbf_gige *priv, int *rx_pkts) -+{ -+ struct net_device *netdev = priv->netdev; -+ struct sk_buff *skb = NULL, *rx_skb; -+ u16 rx_pi_rem, rx_ci_rem; -+ dma_addr_t *rx_wqe_addr; -+ dma_addr_t rx_buf_dma; -+ u64 *rx_cqe_addr; -+ u64 datalen; -+ u64 rx_cqe; -+ u16 rx_ci; -+ u16 rx_pi; -+ -+ /* Index into RX buffer array is rx_pi w/wrap based on RX_CQE_SIZE */ -+ rx_pi = readq(priv->base + MLXBF_GIGE_RX_WQE_PI); -+ rx_pi_rem = rx_pi % priv->rx_q_entries; -+ -+ rx_wqe_addr = priv->rx_wqe_base + rx_pi_rem; -+ rx_cqe_addr = priv->rx_cqe_base + rx_pi_rem; -+ rx_cqe = *rx_cqe_addr; -+ -+ if ((!!(rx_cqe & MLXBF_GIGE_RX_CQE_VALID_MASK)) != priv->valid_polarity) -+ return false; -+ -+ if ((rx_cqe & MLXBF_GIGE_RX_CQE_PKT_STATUS_MASK) == 0) { -+ /* Packet is OK, increment stats */ -+ datalen = rx_cqe & MLXBF_GIGE_RX_CQE_PKT_LEN_MASK; -+ netdev->stats.rx_packets++; -+ netdev->stats.rx_bytes += datalen; -+ -+ skb = priv->rx_skb[rx_pi_rem]; -+ -+ skb_put(skb, datalen); -+ -+ skb->ip_summed = CHECKSUM_NONE; /* device did not checksum packet */ -+ -+ skb->protocol = eth_type_trans(skb, netdev); -+ -+ /* Alloc another RX SKB for this same index */ -+ rx_skb = mlxbf_gige_alloc_skb(priv, MLXBF_GIGE_DEFAULT_BUF_SZ, -+ &rx_buf_dma, DMA_FROM_DEVICE); -+ if (!rx_skb) -+ return false; -+ priv->rx_skb[rx_pi_rem] = rx_skb; -+ dma_unmap_single(priv->dev, *rx_wqe_addr, -+ MLXBF_GIGE_DEFAULT_BUF_SZ, DMA_FROM_DEVICE); -+ *rx_wqe_addr = rx_buf_dma; -+ } else if (rx_cqe & MLXBF_GIGE_RX_CQE_PKT_STATUS_MAC_ERR) { -+ priv->stats.rx_mac_errors++; -+ } else if (rx_cqe & MLXBF_GIGE_RX_CQE_PKT_STATUS_TRUNCATED) { -+ priv->stats.rx_truncate_errors++; -+ } -+ -+ /* Let hardware know we've replenished one buffer */ -+ rx_pi++; -+ -+ /* Ensure completion of all writes before notifying HW of replenish */ -+ wmb(); -+ writeq(rx_pi, priv->base + MLXBF_GIGE_RX_WQE_PI); -+ -+ (*rx_pkts)++; -+ -+ rx_pi_rem = rx_pi % priv->rx_q_entries; -+ if (rx_pi_rem == 0) -+ priv->valid_polarity ^= 1; -+ rx_ci = readq(priv->base + MLXBF_GIGE_RX_CQE_PACKET_CI); -+ rx_ci_rem = rx_ci % priv->rx_q_entries; -+ -+ if (skb) -+ netif_receive_skb(skb); -+ -+ return rx_pi_rem != rx_ci_rem; -+} -+ -+/* Driver poll() function called by NAPI infrastructure */ -+int mlxbf_gige_poll(struct napi_struct *napi, int budget) -+{ -+ struct mlxbf_gige *priv; -+ bool remaining_pkts; -+ int work_done = 0; -+ u64 data; -+ -+ priv = container_of(napi, struct mlxbf_gige, napi); -+ -+ mlxbf_gige_handle_tx_complete(priv); -+ -+ do { -+ remaining_pkts = mlxbf_gige_rx_packet(priv, &work_done); -+ } while (remaining_pkts && work_done < budget); -+ -+ /* If amount of work done < budget, turn off NAPI polling -+ * via napi_complete_done(napi, work_done) and then -+ * re-enable interrupts. -+ */ -+ if (work_done < budget && napi_complete_done(napi, work_done)) { -+ /* Clear MLXBF_GIGE_INT_MASK 'receive pkt' bit to -+ * indicate receive readiness -+ */ -+ data = readq(priv->base + MLXBF_GIGE_INT_MASK); -+ data &= ~MLXBF_GIGE_INT_MASK_RX_RECEIVE_PACKET; -+ writeq(data, priv->base + MLXBF_GIGE_INT_MASK); -+ } -+ -+ return work_done; -+} -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_tx.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_tx.c -new file mode 100644 -index 000000000..04982e888 ---- /dev/null -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_tx.c -@@ -0,0 +1,284 @@ -+// SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause -+ -+/* Packet transmit logic for Mellanox Gigabit Ethernet driver -+ * -+ * Copyright (C) 2020-2021 NVIDIA CORPORATION & AFFILIATES -+ */ -+ -+#include -+ -+#include "mlxbf_gige.h" -+#include "mlxbf_gige_regs.h" -+ -+/* Transmit Initialization -+ * 1) Allocates TX WQE array using coherent DMA mapping -+ * 2) Allocates TX completion counter using coherent DMA mapping -+ */ -+int mlxbf_gige_tx_init(struct mlxbf_gige *priv) -+{ -+ size_t size; -+ -+ size = MLXBF_GIGE_TX_WQE_SZ * priv->tx_q_entries; -+ priv->tx_wqe_base = dma_alloc_coherent(priv->dev, size, -+ &priv->tx_wqe_base_dma, -+ GFP_KERNEL); -+ if (!priv->tx_wqe_base) -+ return -ENOMEM; -+ -+ priv->tx_wqe_next = priv->tx_wqe_base; -+ -+ /* Write TX WQE base address into MMIO reg */ -+ writeq(priv->tx_wqe_base_dma, priv->base + MLXBF_GIGE_TX_WQ_BASE); -+ -+ /* Allocate address for TX completion count */ -+ priv->tx_cc = dma_alloc_coherent(priv->dev, MLXBF_GIGE_TX_CC_SZ, -+ &priv->tx_cc_dma, GFP_KERNEL); -+ if (!priv->tx_cc) { -+ dma_free_coherent(priv->dev, size, -+ priv->tx_wqe_base, priv->tx_wqe_base_dma); -+ return -ENOMEM; -+ } -+ -+ /* Write TX CC base address into MMIO reg */ -+ writeq(priv->tx_cc_dma, priv->base + MLXBF_GIGE_TX_CI_UPDATE_ADDRESS); -+ -+ writeq(ilog2(priv->tx_q_entries), -+ priv->base + MLXBF_GIGE_TX_WQ_SIZE_LOG2); -+ -+ priv->prev_tx_ci = 0; -+ priv->tx_pi = 0; -+ -+ return 0; -+} -+ -+/* Transmit Deinitialization -+ * This routine will free allocations done by mlxbf_gige_tx_init(), -+ * namely the TX WQE array and the TX completion counter -+ */ -+void mlxbf_gige_tx_deinit(struct mlxbf_gige *priv) -+{ -+ u64 *tx_wqe_addr; -+ size_t size; -+ int i; -+ -+ tx_wqe_addr = priv->tx_wqe_base; -+ -+ for (i = 0; i < priv->tx_q_entries; i++) { -+ if (priv->tx_skb[i]) { -+ dma_unmap_single(priv->dev, *tx_wqe_addr, -+ priv->tx_skb[i]->len, DMA_TO_DEVICE); -+ dev_kfree_skb(priv->tx_skb[i]); -+ priv->tx_skb[i] = NULL; -+ } -+ tx_wqe_addr += 2; -+ } -+ -+ size = MLXBF_GIGE_TX_WQE_SZ * priv->tx_q_entries; -+ dma_free_coherent(priv->dev, size, -+ priv->tx_wqe_base, priv->tx_wqe_base_dma); -+ -+ dma_free_coherent(priv->dev, MLXBF_GIGE_TX_CC_SZ, -+ priv->tx_cc, priv->tx_cc_dma); -+ -+ priv->tx_wqe_base = NULL; -+ priv->tx_wqe_base_dma = 0; -+ priv->tx_cc = NULL; -+ priv->tx_cc_dma = 0; -+ priv->tx_wqe_next = NULL; -+ writeq(0, priv->base + MLXBF_GIGE_TX_WQ_BASE); -+ writeq(0, priv->base + MLXBF_GIGE_TX_CI_UPDATE_ADDRESS); -+} -+ -+/* Function that returns status of TX ring: -+ * 0: TX ring is full, i.e. there are no -+ * available un-used entries in TX ring. -+ * non-null: TX ring is not full, i.e. there are -+ * some available entries in TX ring. -+ * The non-null value is a measure of -+ * how many TX entries are available, but -+ * it is not the exact number of available -+ * entries (see below). -+ * -+ * The algorithm makes the assumption that if -+ * (prev_tx_ci == tx_pi) then the TX ring is empty. -+ * An empty ring actually has (tx_q_entries-1) -+ * entries, which allows the algorithm to differentiate -+ * the case of an empty ring vs. a full ring. -+ */ -+static u16 mlxbf_gige_tx_buffs_avail(struct mlxbf_gige *priv) -+{ -+ unsigned long flags; -+ u16 avail; -+ -+ spin_lock_irqsave(&priv->lock, flags); -+ -+ if (priv->prev_tx_ci == priv->tx_pi) -+ avail = priv->tx_q_entries - 1; -+ else -+ avail = ((priv->tx_q_entries + priv->prev_tx_ci - priv->tx_pi) -+ % priv->tx_q_entries) - 1; -+ -+ spin_unlock_irqrestore(&priv->lock, flags); -+ -+ return avail; -+} -+ -+bool mlxbf_gige_handle_tx_complete(struct mlxbf_gige *priv) -+{ -+ struct net_device_stats *stats; -+ u16 tx_wqe_index; -+ u64 *tx_wqe_addr; -+ u64 tx_status; -+ u16 tx_ci; -+ -+ tx_status = readq(priv->base + MLXBF_GIGE_TX_STATUS); -+ if (tx_status & MLXBF_GIGE_TX_STATUS_DATA_FIFO_FULL) -+ priv->stats.tx_fifo_full++; -+ tx_ci = readq(priv->base + MLXBF_GIGE_TX_CONSUMER_INDEX); -+ stats = &priv->netdev->stats; -+ -+ /* Transmit completion logic needs to loop until the completion -+ * index (in SW) equals TX consumer index (from HW). These -+ * parameters are unsigned 16-bit values and the wrap case needs -+ * to be supported, that is TX consumer index wrapped from 0xFFFF -+ * to 0 while TX completion index is still < 0xFFFF. -+ */ -+ for (; priv->prev_tx_ci != tx_ci; priv->prev_tx_ci++) { -+ tx_wqe_index = priv->prev_tx_ci % priv->tx_q_entries; -+ /* Each TX WQE is 16 bytes. The 8 MSB store the 2KB TX -+ * buffer address and the 8 LSB contain information -+ * about the TX WQE. -+ */ -+ tx_wqe_addr = priv->tx_wqe_base + -+ (tx_wqe_index * MLXBF_GIGE_TX_WQE_SZ_QWORDS); -+ -+ stats->tx_packets++; -+ stats->tx_bytes += MLXBF_GIGE_TX_WQE_PKT_LEN(tx_wqe_addr); -+ -+ dma_unmap_single(priv->dev, *tx_wqe_addr, -+ priv->tx_skb[tx_wqe_index]->len, DMA_TO_DEVICE); -+ dev_consume_skb_any(priv->tx_skb[tx_wqe_index]); -+ priv->tx_skb[tx_wqe_index] = NULL; -+ -+ /* Ensure completion of updates across all cores */ -+ mb(); -+ } -+ -+ /* Since the TX ring was likely just drained, check if TX queue -+ * had previously been stopped and now that there are TX buffers -+ * available the TX queue can be awakened. -+ */ -+ if (netif_queue_stopped(priv->netdev) && -+ mlxbf_gige_tx_buffs_avail(priv)) -+ netif_wake_queue(priv->netdev); -+ -+ return true; -+} -+ -+/* Function to advance the tx_wqe_next pointer to next TX WQE */ -+void mlxbf_gige_update_tx_wqe_next(struct mlxbf_gige *priv) -+{ -+ /* Advance tx_wqe_next pointer */ -+ priv->tx_wqe_next += MLXBF_GIGE_TX_WQE_SZ_QWORDS; -+ -+ /* Check if 'next' pointer is beyond end of TX ring */ -+ /* If so, set 'next' back to 'base' pointer of ring */ -+ if (priv->tx_wqe_next == (priv->tx_wqe_base + -+ (priv->tx_q_entries * MLXBF_GIGE_TX_WQE_SZ_QWORDS))) -+ priv->tx_wqe_next = priv->tx_wqe_base; -+} -+ -+netdev_tx_t mlxbf_gige_start_xmit(struct sk_buff *skb, -+ struct net_device *netdev) -+{ -+ struct mlxbf_gige *priv = netdev_priv(netdev); -+ long buff_addr, start_dma_page, end_dma_page; -+ struct sk_buff *tx_skb; -+ dma_addr_t tx_buf_dma; -+ unsigned long flags; -+ u64 *tx_wqe_addr; -+ u64 word2; -+ -+ /* If needed, linearize TX SKB as hardware DMA expects this */ -+ if (skb->len > MLXBF_GIGE_DEFAULT_BUF_SZ || skb_linearize(skb)) { -+ dev_kfree_skb(skb); -+ netdev->stats.tx_dropped++; -+ return NETDEV_TX_OK; -+ } -+ -+ buff_addr = (long)skb->data; -+ start_dma_page = buff_addr >> MLXBF_GIGE_DMA_PAGE_SHIFT; -+ end_dma_page = (buff_addr + skb->len - 1) >> MLXBF_GIGE_DMA_PAGE_SHIFT; -+ -+ /* Verify that payload pointer and data length of SKB to be -+ * transmitted does not violate the hardware DMA limitation. -+ */ -+ if (start_dma_page != end_dma_page) { -+ /* DMA operation would fail as-is, alloc new aligned SKB */ -+ tx_skb = mlxbf_gige_alloc_skb(priv, skb->len, -+ &tx_buf_dma, DMA_TO_DEVICE); -+ if (!tx_skb) { -+ /* Free original skb, could not alloc new aligned SKB */ -+ dev_kfree_skb(skb); -+ netdev->stats.tx_dropped++; -+ return NETDEV_TX_OK; -+ } -+ -+ skb_put_data(tx_skb, skb->data, skb->len); -+ -+ /* Free the original SKB */ -+ dev_kfree_skb(skb); -+ } else { -+ tx_skb = skb; -+ tx_buf_dma = dma_map_single(priv->dev, skb->data, -+ skb->len, DMA_TO_DEVICE); -+ if (dma_mapping_error(priv->dev, tx_buf_dma)) { -+ dev_kfree_skb(skb); -+ netdev->stats.tx_dropped++; -+ return NETDEV_TX_OK; -+ } -+ } -+ -+ /* Get address of TX WQE */ -+ tx_wqe_addr = priv->tx_wqe_next; -+ -+ mlxbf_gige_update_tx_wqe_next(priv); -+ -+ /* Put PA of buffer address into first 64-bit word of TX WQE */ -+ *tx_wqe_addr = tx_buf_dma; -+ -+ /* Set TX WQE pkt_len appropriately -+ * NOTE: GigE silicon will automatically pad up to -+ * minimum packet length if needed. -+ */ -+ word2 = tx_skb->len & MLXBF_GIGE_TX_WQE_PKT_LEN_MASK; -+ -+ /* Write entire 2nd word of TX WQE */ -+ *(tx_wqe_addr + 1) = word2; -+ -+ spin_lock_irqsave(&priv->lock, flags); -+ priv->tx_skb[priv->tx_pi % priv->tx_q_entries] = tx_skb; -+ priv->tx_pi++; -+ spin_unlock_irqrestore(&priv->lock, flags); -+ -+ if (!netdev_xmit_more()) { -+ /* Create memory barrier before write to TX PI */ -+ wmb(); -+ writeq(priv->tx_pi, priv->base + MLXBF_GIGE_TX_PRODUCER_INDEX); -+ } -+ -+ /* Check if the last TX entry was just used */ -+ if (!mlxbf_gige_tx_buffs_avail(priv)) { -+ /* TX ring is full, inform stack */ -+ netif_stop_queue(netdev); -+ -+ /* Since there is no separate "TX complete" interrupt, need -+ * to explicitly schedule NAPI poll. This will trigger logic -+ * which processes TX completions, and will hopefully drain -+ * the TX ring allowing the TX queue to be awakened. -+ */ -+ napi_schedule(&priv->napi); -+ } -+ -+ return NETDEV_TX_OK; -+} --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0227-mlxbf_gige-clear-valid_polarity-upon-open.patch b/platform/mellanox/non-upstream-patches/patches/0227-mlxbf_gige-clear-valid_polarity-upon-open.patch deleted file mode 100644 index bfc544b82a9d..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0227-mlxbf_gige-clear-valid_polarity-upon-open.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 245dc6df595b3c11096d96df641fbde3b38f6bb1 Mon Sep 17 00:00:00 2001 -From: David Thompson -Date: Wed, 15 Sep 2021 14:08:48 -0400 -Subject: [PATCH backport 5.10 28/63] mlxbf_gige: clear valid_polarity upon - open - -The network interface managed by the mlxbf_gige driver can -get into a problem state where traffic does not flow. -In this state, the interface will be up and enabled, but -will stop processing received packets. This problem state -will happen if three specific conditions occur: - 1) driver has received more than (N * RxRingSize) packets but - less than (N+1 * RxRingSize) packets, where N is an odd number - Note: the command "ethtool -g " will display the - current receive ring size, which currently defaults to 128 - 2) the driver's interface was disabled via "ifconfig oob_net0 down" - during the window described in #1. - 3) the driver's interface is re-enabled via "ifconfig oob_net0 up" - -This patch ensures that the driver's "valid_polarity" field is -cleared during the open() method so that it always matches the -receive polarity used by hardware. Without this fix, the driver -needs to be unloaded and reloaded to correct this problem state. - -Fixes: f92e1869d74e ("Add Mellanox BlueField Gigabit Ethernet driver") -Reviewed-by: Asmaa Mnebhi -Signed-off-by: David Thompson -Signed-off-by: David S. Miller ---- - drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -index a0a059e01..04c7dc224 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -@@ -142,6 +142,13 @@ static int mlxbf_gige_open(struct net_device *netdev) - err = mlxbf_gige_clean_port(priv); - if (err) - goto free_irqs; -+ -+ /* Clear driver's valid_polarity to match hardware, -+ * since the above call to clean_port() resets the -+ * receive polarity used by hardware. -+ */ -+ priv->valid_polarity = 0; -+ - err = mlxbf_gige_rx_init(priv); - if (err) - goto free_irqs; --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0228-net-mellanox-mlxbf_gige-Replace-non-standard-interru.patch b/platform/mellanox/non-upstream-patches/patches/0228-net-mellanox-mlxbf_gige-Replace-non-standard-interru.patch deleted file mode 100644 index 97702355a35c..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0228-net-mellanox-mlxbf_gige-Replace-non-standard-interru.patch +++ /dev/null @@ -1,368 +0,0 @@ -From cad3deaacd8c633ce18a06a550551f029c3dcef1 Mon Sep 17 00:00:00 2001 -From: Asmaa Mnebhi -Date: Fri, 15 Oct 2021 12:48:09 -0400 -Subject: [PATCH backport 5.10 29/63] net: mellanox: mlxbf_gige: Replace - non-standard interrupt handling - -BugLink: https://bugs.launchpad.net/bugs/1979827 - -Since the GPIO driver (gpio-mlxbf2.c) supports interrupt handling, -replace the custom routine with simple IRQ request. - -Signed-off-by: Asmaa Mnebhi -Acked-by: David S. Miller -Signed-off-by: Bartosz Golaszewski -(cherry picked from commit 6c2a6ddca763271fa583e22bce10c2805c1ea9f6) -Signed-off-by: Ike Panhc ---- - .../net/ethernet/mellanox/mlxbf_gige/Makefile | 1 - - .../ethernet/mellanox/mlxbf_gige/mlxbf_gige.h | 12 - - .../mellanox/mlxbf_gige/mlxbf_gige_gpio.c | 212 ------------------ - .../mellanox/mlxbf_gige/mlxbf_gige_main.c | 22 +- - 4 files changed, 9 insertions(+), 238 deletions(-) - delete mode 100644 drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_gpio.c - -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/Makefile b/drivers/net/ethernet/mellanox/mlxbf_gige/Makefile -index e57c1375f..a97c2bef8 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/Makefile -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/Makefile -@@ -3,7 +3,6 @@ - obj-$(CONFIG_MLXBF_GIGE) += mlxbf_gige.o - - mlxbf_gige-y := mlxbf_gige_ethtool.o \ -- mlxbf_gige_gpio.o \ - mlxbf_gige_intr.o \ - mlxbf_gige_main.o \ - mlxbf_gige_mdio.o \ -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige.h b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige.h -index e3509e69e..86826a70f 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige.h -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige.h -@@ -51,11 +51,6 @@ - #define MLXBF_GIGE_ERROR_INTR_IDX 0 - #define MLXBF_GIGE_RECEIVE_PKT_INTR_IDX 1 - #define MLXBF_GIGE_LLU_PLU_INTR_IDX 2 --#define MLXBF_GIGE_PHY_INT_N 3 -- --#define MLXBF_GIGE_MDIO_DEFAULT_PHY_ADDR 0x3 -- --#define MLXBF_GIGE_DEFAULT_PHY_INT_GPIO 12 - - struct mlxbf_gige_stats { - u64 hw_access_errors; -@@ -81,11 +76,7 @@ struct mlxbf_gige { - struct platform_device *pdev; - void __iomem *mdio_io; - struct mii_bus *mdiobus; -- void __iomem *gpio_io; -- struct irq_domain *irqdomain; -- u32 phy_int_gpio_mask; - spinlock_t lock; /* for packet processing indices */ -- spinlock_t gpio_lock; /* for GPIO bus access */ - u16 rx_q_entries; - u16 tx_q_entries; - u64 *tx_wqe_base; -@@ -184,7 +175,4 @@ int mlxbf_gige_poll(struct napi_struct *napi, int budget); - extern const struct ethtool_ops mlxbf_gige_ethtool_ops; - void mlxbf_gige_update_tx_wqe_next(struct mlxbf_gige *priv); - --int mlxbf_gige_gpio_init(struct platform_device *pdev, struct mlxbf_gige *priv); --void mlxbf_gige_gpio_free(struct mlxbf_gige *priv); -- - #endif /* !defined(__MLXBF_GIGE_H__) */ -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_gpio.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_gpio.c -deleted file mode 100644 -index a8d966db5..000000000 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_gpio.c -+++ /dev/null -@@ -1,212 +0,0 @@ --// SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause -- --/* Initialize and handle GPIO interrupt triggered by INT_N PHY signal. -- * This GPIO interrupt triggers the PHY state machine to bring the link -- * up/down. -- * -- * Copyright (C) 2021 NVIDIA CORPORATION & AFFILIATES -- */ -- --#include --#include --#include --#include --#include --#include --#include --#include --#include --#include --#include --#include -- --#include "mlxbf_gige.h" --#include "mlxbf_gige_regs.h" -- --#define MLXBF_GIGE_GPIO_CAUSE_FALL_EN 0x48 --#define MLXBF_GIGE_GPIO_CAUSE_OR_CAUSE_EVTEN0 0x80 --#define MLXBF_GIGE_GPIO_CAUSE_OR_EVTEN0 0x94 --#define MLXBF_GIGE_GPIO_CAUSE_OR_CLRCAUSE 0x98 -- --static void mlxbf_gige_gpio_enable(struct mlxbf_gige *priv) --{ -- unsigned long flags; -- u32 val; -- -- spin_lock_irqsave(&priv->gpio_lock, flags); -- val = readl(priv->gpio_io + MLXBF_GIGE_GPIO_CAUSE_OR_CLRCAUSE); -- val |= priv->phy_int_gpio_mask; -- writel(val, priv->gpio_io + MLXBF_GIGE_GPIO_CAUSE_OR_CLRCAUSE); -- -- /* The INT_N interrupt level is active low. -- * So enable cause fall bit to detect when GPIO -- * state goes low. -- */ -- val = readl(priv->gpio_io + MLXBF_GIGE_GPIO_CAUSE_FALL_EN); -- val |= priv->phy_int_gpio_mask; -- writel(val, priv->gpio_io + MLXBF_GIGE_GPIO_CAUSE_FALL_EN); -- -- /* Enable PHY interrupt by setting the priority level */ -- val = readl(priv->gpio_io + MLXBF_GIGE_GPIO_CAUSE_OR_EVTEN0); -- val |= priv->phy_int_gpio_mask; -- writel(val, priv->gpio_io + MLXBF_GIGE_GPIO_CAUSE_OR_EVTEN0); -- spin_unlock_irqrestore(&priv->gpio_lock, flags); --} -- --static void mlxbf_gige_gpio_disable(struct mlxbf_gige *priv) --{ -- unsigned long flags; -- u32 val; -- -- spin_lock_irqsave(&priv->gpio_lock, flags); -- val = readl(priv->gpio_io + MLXBF_GIGE_GPIO_CAUSE_OR_EVTEN0); -- val &= ~priv->phy_int_gpio_mask; -- writel(val, priv->gpio_io + MLXBF_GIGE_GPIO_CAUSE_OR_EVTEN0); -- spin_unlock_irqrestore(&priv->gpio_lock, flags); --} -- --static irqreturn_t mlxbf_gige_gpio_handler(int irq, void *ptr) --{ -- struct mlxbf_gige *priv; -- u32 val; -- -- priv = ptr; -- -- /* Check if this interrupt is from PHY device. -- * Return if it is not. -- */ -- val = readl(priv->gpio_io + MLXBF_GIGE_GPIO_CAUSE_OR_CAUSE_EVTEN0); -- if (!(val & priv->phy_int_gpio_mask)) -- return IRQ_NONE; -- -- /* Clear interrupt when done, otherwise, no further interrupt -- * will be triggered. -- */ -- val = readl(priv->gpio_io + MLXBF_GIGE_GPIO_CAUSE_OR_CLRCAUSE); -- val |= priv->phy_int_gpio_mask; -- writel(val, priv->gpio_io + MLXBF_GIGE_GPIO_CAUSE_OR_CLRCAUSE); -- -- generic_handle_irq(priv->phy_irq); -- -- return IRQ_HANDLED; --} -- --static void mlxbf_gige_gpio_mask(struct irq_data *irqd) --{ -- struct mlxbf_gige *priv = irq_data_get_irq_chip_data(irqd); -- -- mlxbf_gige_gpio_disable(priv); --} -- --static void mlxbf_gige_gpio_unmask(struct irq_data *irqd) --{ -- struct mlxbf_gige *priv = irq_data_get_irq_chip_data(irqd); -- -- mlxbf_gige_gpio_enable(priv); --} -- --static struct irq_chip mlxbf_gige_gpio_chip = { -- .name = "mlxbf_gige_phy", -- .irq_mask = mlxbf_gige_gpio_mask, -- .irq_unmask = mlxbf_gige_gpio_unmask, --}; -- --static int mlxbf_gige_gpio_domain_map(struct irq_domain *d, -- unsigned int irq, -- irq_hw_number_t hwirq) --{ -- irq_set_chip_data(irq, d->host_data); -- irq_set_chip_and_handler(irq, &mlxbf_gige_gpio_chip, handle_simple_irq); -- irq_set_noprobe(irq); -- -- return 0; --} -- --static const struct irq_domain_ops mlxbf_gige_gpio_domain_ops = { -- .map = mlxbf_gige_gpio_domain_map, -- .xlate = irq_domain_xlate_twocell, --}; -- --#ifdef CONFIG_ACPI --static int mlxbf_gige_gpio_resources(struct acpi_resource *ares, -- void *data) --{ -- struct acpi_resource_gpio *gpio; -- u32 *phy_int_gpio = data; -- -- if (ares->type == ACPI_RESOURCE_TYPE_GPIO) { -- gpio = &ares->data.gpio; -- *phy_int_gpio = gpio->pin_table[0]; -- } -- -- return 1; --} --#endif -- --void mlxbf_gige_gpio_free(struct mlxbf_gige *priv) --{ -- irq_dispose_mapping(priv->phy_irq); -- irq_domain_remove(priv->irqdomain); --} -- --int mlxbf_gige_gpio_init(struct platform_device *pdev, -- struct mlxbf_gige *priv) --{ -- struct device *dev = &pdev->dev; -- struct resource *res; -- u32 phy_int_gpio = 0; -- int ret; -- -- LIST_HEAD(resources); -- -- res = platform_get_resource(pdev, IORESOURCE_MEM, MLXBF_GIGE_RES_GPIO0); -- if (!res) -- return -ENODEV; -- -- priv->gpio_io = devm_ioremap(dev, res->start, resource_size(res)); -- if (!priv->gpio_io) -- return -ENOMEM; -- --#ifdef CONFIG_ACPI -- ret = acpi_dev_get_resources(ACPI_COMPANION(dev), -- &resources, mlxbf_gige_gpio_resources, -- &phy_int_gpio); -- acpi_dev_free_resource_list(&resources); -- if (ret < 0 || !phy_int_gpio) { -- dev_err(dev, "Error retrieving the gpio phy pin"); -- return -EINVAL; -- } --#endif -- -- priv->phy_int_gpio_mask = BIT(phy_int_gpio); -- -- mlxbf_gige_gpio_disable(priv); -- -- priv->hw_phy_irq = platform_get_irq(pdev, MLXBF_GIGE_PHY_INT_N); -- -- priv->irqdomain = irq_domain_add_simple(NULL, 1, 0, -- &mlxbf_gige_gpio_domain_ops, -- priv); -- if (!priv->irqdomain) { -- dev_err(dev, "Failed to add IRQ domain\n"); -- return -ENOMEM; -- } -- -- priv->phy_irq = irq_create_mapping(priv->irqdomain, 0); -- if (!priv->phy_irq) { -- irq_domain_remove(priv->irqdomain); -- priv->irqdomain = NULL; -- dev_err(dev, "Error mapping PHY IRQ\n"); -- return -EINVAL; -- } -- -- ret = devm_request_irq(dev, priv->hw_phy_irq, mlxbf_gige_gpio_handler, -- IRQF_ONESHOT | IRQF_SHARED, "mlxbf_gige_phy", priv); -- if (ret) { -- dev_err(dev, "Failed to request PHY IRQ"); -- mlxbf_gige_gpio_free(priv); -- return ret; -- } -- -- return ret; --} -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -index 04c7dc224..e4ed38bbd 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -@@ -283,8 +283,8 @@ static int mlxbf_gige_probe(struct platform_device *pdev) - void __iomem *llu_base; - void __iomem *plu_base; - void __iomem *base; -+ int addr, phy_irq; - u64 control; -- int addr; - int err; - - mac_res = platform_get_resource(pdev, IORESOURCE_MEM, MLXBF_GIGE_RES_MAC); -@@ -331,20 +331,12 @@ static int mlxbf_gige_probe(struct platform_device *pdev) - priv->pdev = pdev; - - spin_lock_init(&priv->lock); -- spin_lock_init(&priv->gpio_lock); - - /* Attach MDIO device */ - err = mlxbf_gige_mdio_probe(pdev, priv); - if (err) - return err; - -- err = mlxbf_gige_gpio_init(pdev, priv); -- if (err) { -- dev_err(&pdev->dev, "PHY IRQ initialization failed\n"); -- mlxbf_gige_mdio_remove(priv); -- return -ENODEV; -- } -- - priv->base = base; - priv->llu_base = llu_base; - priv->plu_base = plu_base; -@@ -365,6 +357,12 @@ static int mlxbf_gige_probe(struct platform_device *pdev) - priv->rx_irq = platform_get_irq(pdev, MLXBF_GIGE_RECEIVE_PKT_INTR_IDX); - priv->llu_plu_irq = platform_get_irq(pdev, MLXBF_GIGE_LLU_PLU_INTR_IDX); - -+ phy_irq = acpi_dev_gpio_irq_get_by(ACPI_COMPANION(&pdev->dev), "phy-gpios", 0); -+ if (phy_irq < 0) { -+ dev_err(&pdev->dev, "Error getting PHY irq. Use polling instead"); -+ phy_irq = PHY_POLL; -+ } -+ - phydev = phy_find_first(priv->mdiobus); - if (!phydev) { - err = -ENODEV; -@@ -372,8 +370,8 @@ static int mlxbf_gige_probe(struct platform_device *pdev) - } - - addr = phydev->mdio.addr; -- priv->mdiobus->irq[addr] = priv->phy_irq; -- phydev->irq = priv->phy_irq; -+ priv->mdiobus->irq[addr] = phy_irq; -+ phydev->irq = phy_irq; - - err = phy_connect_direct(netdev, phydev, - mlxbf_gige_adjust_link, -@@ -409,7 +407,6 @@ static int mlxbf_gige_probe(struct platform_device *pdev) - return 0; - - out: -- mlxbf_gige_gpio_free(priv); - mlxbf_gige_mdio_remove(priv); - return err; - } -@@ -420,7 +417,6 @@ static int mlxbf_gige_remove(struct platform_device *pdev) - - unregister_netdev(priv->netdev); - phy_disconnect(priv->netdev->phydev); -- mlxbf_gige_gpio_free(priv); - mlxbf_gige_mdio_remove(priv); - platform_set_drvdata(pdev, NULL); - --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0229-mlxbf_gige-increase-MDIO-polling-rate-to-5us.patch b/platform/mellanox/non-upstream-patches/patches/0229-mlxbf_gige-increase-MDIO-polling-rate-to-5us.patch deleted file mode 100644 index b0020cca17c9..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0229-mlxbf_gige-increase-MDIO-polling-rate-to-5us.patch +++ /dev/null @@ -1,52 +0,0 @@ -From a8ab0bbc8f17a0099c4982f3e0cb78f6c323fa46 Mon Sep 17 00:00:00 2001 -From: David Thompson -Date: Thu, 5 May 2022 12:23:09 -0400 -Subject: [PATCH backport 5.10 30/63] mlxbf_gige: increase MDIO polling rate to - 5us - -BugLink: https://bugs.launchpad.net/bugs/1979827 - -This patch increases the polling rate used by the -mlxbf_gige driver on the MDIO bus. The previous -polling rate was every 100us, and the new rate is -every 5us. With this change the amount of time -spent waiting for the MDIO BUSY signal to de-assert -drops from ~100us to ~27us for each operation. - -Signed-off-by: David Thompson -Signed-off-by: Asmaa Mnebhi -Link: https://lore.kernel.org/r/20220505162309.20050-1-davthompson@nvidia.com -Signed-off-by: Jakub Kicinski -(cherry picked from commit 0a02e282bad4dad455553fc2b9268cf1d003f132) -Signed-off-by: Ike Panhc ---- - drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c -index e32dd34fd..6c8a4a529 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c -@@ -105,7 +105,8 @@ static int mlxbf_gige_mdio_read(struct mii_bus *bus, int phy_add, int phy_reg) - writel(cmd, priv->mdio_io + MLXBF_GIGE_MDIO_GW_OFFSET); - - ret = readl_poll_timeout_atomic(priv->mdio_io + MLXBF_GIGE_MDIO_GW_OFFSET, -- val, !(val & MLXBF_GIGE_MDIO_GW_BUSY_MASK), 100, 1000000); -+ val, !(val & MLXBF_GIGE_MDIO_GW_BUSY_MASK), -+ 5, 1000000); - - if (ret) { - writel(0, priv->mdio_io + MLXBF_GIGE_MDIO_GW_OFFSET); -@@ -137,7 +138,8 @@ static int mlxbf_gige_mdio_write(struct mii_bus *bus, int phy_add, - - /* If the poll timed out, drop the request */ - ret = readl_poll_timeout_atomic(priv->mdio_io + MLXBF_GIGE_MDIO_GW_OFFSET, -- temp, !(temp & MLXBF_GIGE_MDIO_GW_BUSY_MASK), 100, 1000000); -+ temp, !(temp & MLXBF_GIGE_MDIO_GW_BUSY_MASK), -+ 5, 1000000); - - return ret; - } --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0230-mlxbf_gige-remove-driver-managed-interrupt-counts.patch b/platform/mellanox/non-upstream-patches/patches/0230-mlxbf_gige-remove-driver-managed-interrupt-counts.patch deleted file mode 100644 index fb80c63de851..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0230-mlxbf_gige-remove-driver-managed-interrupt-counts.patch +++ /dev/null @@ -1,97 +0,0 @@ -From 4eafb2c053cc5935fe826da97fda42abadab5fc1 Mon Sep 17 00:00:00 2001 -From: David Thompson -Date: Wed, 11 May 2022 09:52:51 -0400 -Subject: [PATCH backport 5.10 31/63] mlxbf_gige: remove driver-managed - interrupt counts - -BugLink: https://bugs.launchpad.net/bugs/1979827 - -The driver currently has three interrupt counters, -which are incremented every time each interrupt handler -executes. These driver-managed counters are not -necessary as the kernel already has logic that manages -interrupt counts and exposes them via /proc/interrupts. -This patch removes the driver-managed counters. - -Signed-off-by: David Thompson -Signed-off-by: Asmaa Mnebhi -Link: https://lore.kernel.org/r/20220511135251.2989-1-davthompson@nvidia.com -Signed-off-by: Jakub Kicinski -(cherry picked from commit f4826443f4d69d2c97c184952c085caf0936a7b8) -Signed-off-by: Ike Panhc ---- - drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige.h | 3 --- - .../ethernet/mellanox/mlxbf_gige/mlxbf_gige_ethtool.c | 8 +++----- - .../net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_intr.c | 9 --------- - 3 files changed, 3 insertions(+), 17 deletions(-) - -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige.h b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige.h -index 86826a70f..5fdf9b717 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige.h -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige.h -@@ -90,9 +90,6 @@ struct mlxbf_gige { - dma_addr_t rx_cqe_base_dma; - u16 tx_pi; - u16 prev_tx_ci; -- u64 error_intr_count; -- u64 rx_intr_count; -- u64 llu_plu_intr_count; - struct sk_buff *rx_skb[MLXBF_GIGE_MAX_RXQ_SZ]; - struct sk_buff *tx_skb[MLXBF_GIGE_MAX_TXQ_SZ]; - int error_irq; -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_ethtool.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_ethtool.c -index 92b798f8e..af46b0cd7 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_ethtool.c -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_ethtool.c -@@ -24,11 +24,9 @@ static void mlxbf_gige_get_regs(struct net_device *netdev, - regs->version = MLXBF_GIGE_REGS_VERSION; - - /* Read entire MMIO register space and store results -- * into the provided buffer. Each 64-bit word is converted -- * to big-endian to make the output more readable. -- * -- * NOTE: by design, a read to an offset without an existing -- * register will be acknowledged and return zero. -+ * into the provided buffer. By design, a read to an -+ * offset without an existing register will be -+ * acknowledged and return zero. - */ - memcpy_fromio(p, priv->base, MLXBF_GIGE_MMIO_REG_SZ); - } -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_intr.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_intr.c -index c38795be0..5b3519f0c 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_intr.c -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_intr.c -@@ -17,8 +17,6 @@ static irqreturn_t mlxbf_gige_error_intr(int irq, void *dev_id) - - priv = dev_id; - -- priv->error_intr_count++; -- - int_status = readq(priv->base + MLXBF_GIGE_INT_STATUS); - - if (int_status & MLXBF_GIGE_INT_STATUS_HW_ACCESS_ERROR) -@@ -75,8 +73,6 @@ static irqreturn_t mlxbf_gige_rx_intr(int irq, void *dev_id) - - priv = dev_id; - -- priv->rx_intr_count++; -- - /* NOTE: GigE silicon automatically disables "packet rx" interrupt by - * setting MLXBF_GIGE_INT_MASK bit0 upon triggering the interrupt - * to the ARM cores. Software needs to re-enable "packet rx" -@@ -90,11 +86,6 @@ static irqreturn_t mlxbf_gige_rx_intr(int irq, void *dev_id) - - static irqreturn_t mlxbf_gige_llu_plu_intr(int irq, void *dev_id) - { -- struct mlxbf_gige *priv; -- -- priv = dev_id; -- priv->llu_plu_intr_count++; -- - return IRQ_HANDLED; - } - --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0231-mlxbf_gige-remove-own-module-name-define-and-use-KBU.patch b/platform/mellanox/non-upstream-patches/patches/0231-mlxbf_gige-remove-own-module-name-define-and-use-KBU.patch deleted file mode 100644 index a21ada96abeb..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0231-mlxbf_gige-remove-own-module-name-define-and-use-KBU.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 62164fc6ed2a1ae28dbf3cf16c9ecfa0c23b2b3d Mon Sep 17 00:00:00 2001 -From: David Thompson -Date: Tue, 14 Jun 2022 17:26:02 -0400 -Subject: [PATCH backport 5.10 32/63] mlxbf_gige: remove own module name define - and use KBUILD_MODNAME instead - -BugLink: https://bugs.launchpad.net/bugs/1979827 - -This patch adds use of KBUILD_MODNAME as defined by the build system, -replacing the definition and use of a custom-defined name. - -Signed-off-by: David Thompson -Signed-off-by: Asmaa Mnebhi -Link: https://lore.kernel.org/r/20220614212602.28061-1-davthompson@nvidia.com -Signed-off-by: Jakub Kicinski -(cherry picked from commit linux-next cfbc80e34e3a905f5e89e7c0bc133a9507b05a28) -Signed-off-by: Ike Panhc ---- - drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -index e4ed38bbd..e8f9290a8 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -@@ -19,8 +19,6 @@ - #include "mlxbf_gige.h" - #include "mlxbf_gige_regs.h" - --#define DRV_NAME "mlxbf_gige" -- - /* Allocate SKB whose payload pointer aligns with the Bluefield - * hardware DMA limitation, i.e. DMA operation can't cross - * a 4KB boundary. A maximum packet size of 2KB is assumed in the -@@ -442,7 +440,7 @@ static struct platform_driver mlxbf_gige_driver = { - .remove = mlxbf_gige_remove, - .shutdown = mlxbf_gige_shutdown, - .driver = { -- .name = DRV_NAME, -+ .name = KBUILD_MODNAME, - .acpi_match_table = ACPI_PTR(mlxbf_gige_acpi_match), - }, - }; --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0232-UBUNTU-SAUCE-mlxbf_gige-add-ethtool-mlxbf_gige_set_r.patch b/platform/mellanox/non-upstream-patches/patches/0232-UBUNTU-SAUCE-mlxbf_gige-add-ethtool-mlxbf_gige_set_r.patch deleted file mode 100644 index ffa4eabcda61..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0232-UBUNTU-SAUCE-mlxbf_gige-add-ethtool-mlxbf_gige_set_r.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 422290c8c36a7a92a64fecea45f431794dc99be6 Mon Sep 17 00:00:00 2001 -From: David Thompson -Date: Thu, 14 Jul 2022 17:47:18 -0400 -Subject: [PATCH backport 5.10 33/63] UBUNTU: SAUCE: mlxbf_gige: add ethtool - mlxbf_gige_set_ringparam - -This patch adds the "set_ringparam" callback, to be used by -ethtool when changing the size of the mlxbf_gige driver rings. - -BugLink: https://launchpad.net/bugs/1981766 - -Change-Id: I0198f6fbf6b8ea13bd34ed152e13298265138c76 -Signed-off-by: David Thompson -Signed-off-by: Asmaa Mnebhi -Signed-off-by: Ike Panhc ---- - .../mellanox/mlxbf_gige/mlxbf_gige_ethtool.c | 38 +++++++++++++++++++ - 1 file changed, 38 insertions(+) - -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_ethtool.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_ethtool.c -index af46b0cd7..257724323 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_ethtool.c -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_ethtool.c -@@ -42,6 +42,43 @@ static void mlxbf_gige_get_ringparam(struct net_device *netdev, - ering->tx_pending = priv->tx_q_entries; - } - -+static int mlxbf_gige_set_ringparam(struct net_device *netdev, -+ struct ethtool_ringparam *ering) -+{ -+ const struct net_device_ops *ops = netdev->netdev_ops; -+ struct mlxbf_gige *priv = netdev_priv(netdev); -+ int new_rx_q_entries, new_tx_q_entries; -+ -+ /* Device does not have separate queues for small/large frames */ -+ if (ering->rx_mini_pending || ering->rx_jumbo_pending) -+ return -EINVAL; -+ -+ /* Round up to supported values */ -+ new_rx_q_entries = roundup_pow_of_two(ering->rx_pending); -+ new_tx_q_entries = roundup_pow_of_two(ering->tx_pending); -+ -+ /* Check against min values, core checks against max values */ -+ if (new_tx_q_entries < MLXBF_GIGE_MIN_TXQ_SZ || -+ new_rx_q_entries < MLXBF_GIGE_MIN_RXQ_SZ) -+ return -EINVAL; -+ -+ /* If queue sizes did not change, exit now */ -+ if (new_rx_q_entries == priv->rx_q_entries && -+ new_tx_q_entries == priv->tx_q_entries) -+ return 0; -+ -+ if (netif_running(netdev)) -+ ops->ndo_stop(netdev); -+ -+ priv->rx_q_entries = new_rx_q_entries; -+ priv->tx_q_entries = new_tx_q_entries; -+ -+ if (netif_running(netdev)) -+ ops->ndo_open(netdev); -+ -+ return 0; -+} -+ - static const struct { - const char string[ETH_GSTRING_LEN]; - } mlxbf_gige_ethtool_stats_keys[] = { -@@ -124,6 +161,7 @@ static void mlxbf_gige_get_pauseparam(struct net_device *netdev, - const struct ethtool_ops mlxbf_gige_ethtool_ops = { - .get_link = ethtool_op_get_link, - .get_ringparam = mlxbf_gige_get_ringparam, -+ .set_ringparam = mlxbf_gige_set_ringparam, - .get_regs_len = mlxbf_gige_get_regs_len, - .get_regs = mlxbf_gige_get_regs, - .get_strings = mlxbf_gige_get_strings, --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0233-UBUNTU-SAUCE-Fix-OOB-handling-RX-packets-in-heavy-tr.patch b/platform/mellanox/non-upstream-patches/patches/0233-UBUNTU-SAUCE-Fix-OOB-handling-RX-packets-in-heavy-tr.patch deleted file mode 100644 index 32338657d43f..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0233-UBUNTU-SAUCE-Fix-OOB-handling-RX-packets-in-heavy-tr.patch +++ /dev/null @@ -1,108 +0,0 @@ -From 30e4a53201f1f1cd9ca90057cd8f191c93fdab15 Mon Sep 17 00:00:00 2001 -From: David Thompson -Date: Wed, 20 Jul 2022 17:50:36 -0400 -Subject: [PATCH backport 5.10 34/63] UBUNTU: SAUCE: Fix OOB handling RX - packets in heavy traffic - -BugLink: https://bugs.launchpad.net/bugs/1982424 - -This is reproducible on systems which already have heavy background -traffic. On top of that, the user issues one of the 2 docker pulls below: -docker pull nvcr.io/ea-doca-hbn/hbn/hbn:latest -OR -docker pull gitlab-master.nvidia.com:5005/dl/dgx/tritonserver:22.02-py3-qa - -The second one is a very large container (17GB) - -When they run docker pull, the OOB interface stops being pingable, -the docker pull is interrupted for a very long time (>3mn) or -times out. - -The main reason for the above is because RX PI = RX CI. I have verified that -by reading RX_CQE_PACKET_CI and RX_WQE_PI. This means the WQEs are full and -HW has nowhere else to put the RX packets. - -I believe there is a race condition after SW receives a RX interrupt, -and the interrupt is disabled. I believe HW still tries to add RX -packets to the RX WQEs. So we need to stop the RX traffic by disabling -the DMA. Also, move reading the RX CI before writing the increased value -of RX PI to MLXBF_GIGE_RX_WQE_PI. Normally RX PI should always be > RX CI. -I suspect that when entering mlxbf_gige_rx_packet, for example we have: -MLXBF_GIGE_RX_WQE_PI = 128 -RX_CQE_PACKET_CI = 128 -(128 being the max size of the WQE) - -Then this code will make MLXBF_GIGE_RX_WQE_PI = 129: -rx_pi++; -/* Ensure completion of all writes before notifying HW of replenish */ -wmb(); -writeq(rx_pi, priv->base + MLXBF_GIGE_RX_WQE_PI); - -which means HW has one more slot to populate and in that time span, the HW -populates that WQE and increases the RX_CQE_PACKET_CI = 129. - -Then this code is subject to a race condition: - -rx_ci = readq(priv->base + MLXBF_GIGE_RX_CQE_PACKET_CI); -rx_ci_rem = rx_ci % priv->rx_q_entries; -return rx_pi_rem != rx_ci_rem; - -because rx_pi_rem will be equal to rx_ci_rem. -so remaining_pkts will be 0 and we will exit mlxbf_gige_poll - -Change-Id: I25a816b9182471643db95b05c803b9f6349bcc87 -Signed-off-by: David Thompson -Signed-off-by: Asmaa Mnebhi -Signed-off-by: Ike Panhc ---- - .../ethernet/mellanox/mlxbf_gige/mlxbf_gige_rx.c | 13 +++++++++++-- - 1 file changed, 11 insertions(+), 2 deletions(-) - -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_rx.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_rx.c -index afa3b92a6..96230763c 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_rx.c -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_rx.c -@@ -266,6 +266,9 @@ static bool mlxbf_gige_rx_packet(struct mlxbf_gige *priv, int *rx_pkts) - priv->stats.rx_truncate_errors++; - } - -+ rx_ci = readq(priv->base + MLXBF_GIGE_RX_CQE_PACKET_CI); -+ rx_ci_rem = rx_ci % priv->rx_q_entries; -+ - /* Let hardware know we've replenished one buffer */ - rx_pi++; - -@@ -278,8 +281,6 @@ static bool mlxbf_gige_rx_packet(struct mlxbf_gige *priv, int *rx_pkts) - rx_pi_rem = rx_pi % priv->rx_q_entries; - if (rx_pi_rem == 0) - priv->valid_polarity ^= 1; -- rx_ci = readq(priv->base + MLXBF_GIGE_RX_CQE_PACKET_CI); -- rx_ci_rem = rx_ci % priv->rx_q_entries; - - if (skb) - netif_receive_skb(skb); -@@ -299,6 +300,10 @@ int mlxbf_gige_poll(struct napi_struct *napi, int budget) - - mlxbf_gige_handle_tx_complete(priv); - -+ data = readq(priv->base + MLXBF_GIGE_RX_DMA); -+ data &= ~MLXBF_GIGE_RX_DMA_EN; -+ writeq(data, priv->base + MLXBF_GIGE_RX_DMA); -+ - do { - remaining_pkts = mlxbf_gige_rx_packet(priv, &work_done); - } while (remaining_pkts && work_done < budget); -@@ -314,6 +319,10 @@ int mlxbf_gige_poll(struct napi_struct *napi, int budget) - data = readq(priv->base + MLXBF_GIGE_INT_MASK); - data &= ~MLXBF_GIGE_INT_MASK_RX_RECEIVE_PACKET; - writeq(data, priv->base + MLXBF_GIGE_INT_MASK); -+ -+ data = readq(priv->base + MLXBF_GIGE_RX_DMA); -+ data |= MLXBF_GIGE_RX_DMA_EN; -+ writeq(data, priv->base + MLXBF_GIGE_RX_DMA); - } - - return work_done; --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0236-UBUNTU-SAUCE-mlxbf_gige-clear-MDIO-gateway-lock-afte.patch b/platform/mellanox/non-upstream-patches/patches/0236-UBUNTU-SAUCE-mlxbf_gige-clear-MDIO-gateway-lock-afte.patch deleted file mode 100644 index 1376f1169c41..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0236-UBUNTU-SAUCE-mlxbf_gige-clear-MDIO-gateway-lock-afte.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 7c7da04799f5fe6f7f5751d413dcdf04abe5ea53 Mon Sep 17 00:00:00 2001 -From: David Thompson -Date: Tue, 13 Sep 2022 13:15:14 -0400 -Subject: [PATCH backport 5.10 37/63] UBUNTU: SAUCE: mlxbf_gige: clear MDIO - gateway lock after read - -BugLink: https://bugs.launchpad.net/bugs/1989495 - -The MDIO gateway (GW) lock in BlueField-2 GIGE logic is -set after read. This patch adds logic to make sure the -lock is always cleared at the end of each MDIO transaction. - -Reviewed-by: Asmaa Mnebhi -Signed-off-by: David Thompson -Signed-off-by: Ike Panhc ---- - drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c -index 6c8a4a529..b7363c6c3 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c -@@ -117,6 +117,9 @@ static int mlxbf_gige_mdio_read(struct mii_bus *bus, int phy_add, int phy_reg) - /* Only return ad bits of the gw register */ - ret &= MLXBF_GIGE_MDIO_GW_AD_MASK; - -+ /* The MDIO lock is set on read. To release it, clear gw register */ -+ writel(0, priv->mdio_io + MLXBF_GIGE_MDIO_GW_OFFSET); -+ - return ret; - } - -@@ -141,6 +144,9 @@ static int mlxbf_gige_mdio_write(struct mii_bus *bus, int phy_add, - temp, !(temp & MLXBF_GIGE_MDIO_GW_BUSY_MASK), - 5, 1000000); - -+ /* The MDIO lock is set on read. To release it, clear gw register */ -+ writel(0, priv->mdio_io + MLXBF_GIGE_MDIO_GW_OFFSET); -+ - return ret; - } - --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0237-mlxbf_gige-compute-MDIO-period-based-on-i1clk.patch b/platform/mellanox/non-upstream-patches/patches/0237-mlxbf_gige-compute-MDIO-period-based-on-i1clk.patch deleted file mode 100644 index fba0668a541f..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0237-mlxbf_gige-compute-MDIO-period-based-on-i1clk.patch +++ /dev/null @@ -1,244 +0,0 @@ -From 793a81817df0dcee08aad3385a6971895437ab80 Mon Sep 17 00:00:00 2001 -From: David Thompson -Date: Fri, 26 Aug 2022 11:59:16 -0400 -Subject: [PATCH backport 5.10 38/63] mlxbf_gige: compute MDIO period based on - i1clk - -BugLink: https://launchpad.net/bugs/1989035 - -This patch adds logic to compute the MDIO period based on -the i1clk, and thereafter write the MDIO period into the YU -MDIO config register. The i1clk resource from the ACPI table -is used to provide addressing to YU bootrecord PLL registers. -The values in these registers are used to compute MDIO period. -If the i1clk resource is not present in the ACPI table, then -the current default hardcorded value of 430Mhz is used. -The i1clk clock value of 430MHz is only accurate for boards -with BF2 mid bin and main bin SoCs. The BF2 high bin SoCs -have i1clk = 500MHz, but can support a slower MDIO period. - -Fixes: f92e1869d74e ("Add Mellanox BlueField Gigabit Ethernet driver") -Reviewed-by: Asmaa Mnebhi -Signed-off-by: David Thompson -Link: https://lore.kernel.org/r/20220826155916.12491-1-davthompson@nvidia.com -Signed-off-by: Jakub Kicinski -(cherry picked from commit 3a1a274e933fca73fdc960cb1f60636cd285a265) -Signed-off-by: Ike Panhc ---- - .../ethernet/mellanox/mlxbf_gige/mlxbf_gige.h | 4 +- - .../mellanox/mlxbf_gige/mlxbf_gige_mdio.c | 121 +++++++++++++++--- - .../mellanox/mlxbf_gige/mlxbf_gige_regs.h | 2 + - 3 files changed, 109 insertions(+), 18 deletions(-) - -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige.h b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige.h -index 5fdf9b717..5a1027b07 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige.h -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige.h -@@ -75,6 +75,7 @@ struct mlxbf_gige { - struct net_device *netdev; - struct platform_device *pdev; - void __iomem *mdio_io; -+ void __iomem *clk_io; - struct mii_bus *mdiobus; - spinlock_t lock; /* for packet processing indices */ - u16 rx_q_entries; -@@ -137,7 +138,8 @@ enum mlxbf_gige_res { - MLXBF_GIGE_RES_MDIO9, - MLXBF_GIGE_RES_GPIO0, - MLXBF_GIGE_RES_LLU, -- MLXBF_GIGE_RES_PLU -+ MLXBF_GIGE_RES_PLU, -+ MLXBF_GIGE_RES_CLK - }; - - /* Version of register data returned by mlxbf_gige_get_regs() */ -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c -index b7363c6c3..736849d07 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c -@@ -22,10 +22,23 @@ - #include - - #include "mlxbf_gige.h" -+#include "mlxbf_gige_regs.h" - - #define MLXBF_GIGE_MDIO_GW_OFFSET 0x0 - #define MLXBF_GIGE_MDIO_CFG_OFFSET 0x4 - -+#define MLXBF_GIGE_MDIO_FREQ_REFERENCE 156250000ULL -+#define MLXBF_GIGE_MDIO_COREPLL_CONST 16384ULL -+#define MLXBF_GIGE_MDC_CLK_NS 400 -+#define MLXBF_GIGE_MDIO_PLL_I1CLK_REG1 0x4 -+#define MLXBF_GIGE_MDIO_PLL_I1CLK_REG2 0x8 -+#define MLXBF_GIGE_MDIO_CORE_F_SHIFT 0 -+#define MLXBF_GIGE_MDIO_CORE_F_MASK GENMASK(25, 0) -+#define MLXBF_GIGE_MDIO_CORE_R_SHIFT 26 -+#define MLXBF_GIGE_MDIO_CORE_R_MASK GENMASK(31, 26) -+#define MLXBF_GIGE_MDIO_CORE_OD_SHIFT 0 -+#define MLXBF_GIGE_MDIO_CORE_OD_MASK GENMASK(3, 0) -+ - /* Support clause 22 */ - #define MLXBF_GIGE_MDIO_CL22_ST1 0x1 - #define MLXBF_GIGE_MDIO_CL22_WRITE 0x1 -@@ -50,27 +63,76 @@ - #define MLXBF_GIGE_MDIO_CFG_MDIO_IN_SAMP_MASK GENMASK(23, 16) - #define MLXBF_GIGE_MDIO_CFG_MDIO_OUT_SAMP_MASK GENMASK(31, 24) - -+#define MLXBF_GIGE_MDIO_CFG_VAL (FIELD_PREP(MLXBF_GIGE_MDIO_CFG_MDIO_MODE_MASK, 1) | \ -+ FIELD_PREP(MLXBF_GIGE_MDIO_CFG_MDIO3_3_MASK, 1) | \ -+ FIELD_PREP(MLXBF_GIGE_MDIO_CFG_MDIO_FULL_DRIVE_MASK, 1) | \ -+ FIELD_PREP(MLXBF_GIGE_MDIO_CFG_MDIO_IN_SAMP_MASK, 6) | \ -+ FIELD_PREP(MLXBF_GIGE_MDIO_CFG_MDIO_OUT_SAMP_MASK, 13)) -+ -+#define MLXBF_GIGE_BF2_COREPLL_ADDR 0x02800c30 -+#define MLXBF_GIGE_BF2_COREPLL_SIZE 0x0000000c -+ -+static struct resource corepll_params[] = { -+ [MLXBF_GIGE_VERSION_BF2] = { -+ .start = MLXBF_GIGE_BF2_COREPLL_ADDR, -+ .end = MLXBF_GIGE_BF2_COREPLL_ADDR + MLXBF_GIGE_BF2_COREPLL_SIZE - 1, -+ .name = "COREPLL_RES" -+ }, -+}; -+ -+/* Returns core clock i1clk in Hz */ -+static u64 calculate_i1clk(struct mlxbf_gige *priv) -+{ -+ u8 core_od, core_r; -+ u64 freq_output; -+ u32 reg1, reg2; -+ u32 core_f; -+ -+ reg1 = readl(priv->clk_io + MLXBF_GIGE_MDIO_PLL_I1CLK_REG1); -+ reg2 = readl(priv->clk_io + MLXBF_GIGE_MDIO_PLL_I1CLK_REG2); -+ -+ core_f = (reg1 & MLXBF_GIGE_MDIO_CORE_F_MASK) >> -+ MLXBF_GIGE_MDIO_CORE_F_SHIFT; -+ core_r = (reg1 & MLXBF_GIGE_MDIO_CORE_R_MASK) >> -+ MLXBF_GIGE_MDIO_CORE_R_SHIFT; -+ core_od = (reg2 & MLXBF_GIGE_MDIO_CORE_OD_MASK) >> -+ MLXBF_GIGE_MDIO_CORE_OD_SHIFT; -+ -+ /* Compute PLL output frequency as follow: -+ * -+ * CORE_F / 16384 -+ * freq_output = freq_reference * ---------------------------- -+ * (CORE_R + 1) * (CORE_OD + 1) -+ */ -+ freq_output = div_u64((MLXBF_GIGE_MDIO_FREQ_REFERENCE * core_f), -+ MLXBF_GIGE_MDIO_COREPLL_CONST); -+ freq_output = div_u64(freq_output, (core_r + 1) * (core_od + 1)); -+ -+ return freq_output; -+} -+ - /* Formula for encoding the MDIO period. The encoded value is - * passed to the MDIO config register. - * -- * mdc_clk = 2*(val + 1)*i1clk -+ * mdc_clk = 2*(val + 1)*(core clock in sec) - * -- * 400 ns = 2*(val + 1)*(((1/430)*1000) ns) -+ * i1clk is in Hz: -+ * 400 ns = 2*(val + 1)*(1/i1clk) - * -- * val = (((400 * 430 / 1000) / 2) - 1) -+ * val = (((400/10^9) / (1/i1clk) / 2) - 1) -+ * val = (400/2 * i1clk)/10^9 - 1 - */ --#define MLXBF_GIGE_I1CLK_MHZ 430 --#define MLXBF_GIGE_MDC_CLK_NS 400 -+static u8 mdio_period_map(struct mlxbf_gige *priv) -+{ -+ u8 mdio_period; -+ u64 i1clk; - --#define MLXBF_GIGE_MDIO_PERIOD (((MLXBF_GIGE_MDC_CLK_NS * MLXBF_GIGE_I1CLK_MHZ / 1000) / 2) - 1) -+ i1clk = calculate_i1clk(priv); - --#define MLXBF_GIGE_MDIO_CFG_VAL (FIELD_PREP(MLXBF_GIGE_MDIO_CFG_MDIO_MODE_MASK, 1) | \ -- FIELD_PREP(MLXBF_GIGE_MDIO_CFG_MDIO3_3_MASK, 1) | \ -- FIELD_PREP(MLXBF_GIGE_MDIO_CFG_MDIO_FULL_DRIVE_MASK, 1) | \ -- FIELD_PREP(MLXBF_GIGE_MDIO_CFG_MDC_PERIOD_MASK, \ -- MLXBF_GIGE_MDIO_PERIOD) | \ -- FIELD_PREP(MLXBF_GIGE_MDIO_CFG_MDIO_IN_SAMP_MASK, 6) | \ -- FIELD_PREP(MLXBF_GIGE_MDIO_CFG_MDIO_OUT_SAMP_MASK, 13)) -+ mdio_period = div_u64((MLXBF_GIGE_MDC_CLK_NS >> 1) * i1clk, 1000000000) - 1; -+ -+ return mdio_period; -+} - - static u32 mlxbf_gige_mdio_create_cmd(u16 data, int phy_add, - int phy_reg, u32 opcode) -@@ -127,9 +189,9 @@ static int mlxbf_gige_mdio_write(struct mii_bus *bus, int phy_add, - int phy_reg, u16 val) - { - struct mlxbf_gige *priv = bus->priv; -+ u32 temp; - u32 cmd; - int ret; -- u32 temp; - - if (phy_reg & MII_ADDR_C45) - return -EOPNOTSUPP; -@@ -150,6 +212,18 @@ static int mlxbf_gige_mdio_write(struct mii_bus *bus, int phy_add, - return ret; - } - -+static void mlxbf_gige_mdio_cfg(struct mlxbf_gige *priv) -+{ -+ u8 mdio_period; -+ u32 val; -+ -+ mdio_period = mdio_period_map(priv); -+ -+ val = MLXBF_GIGE_MDIO_CFG_VAL; -+ val |= FIELD_PREP(MLXBF_GIGE_MDIO_CFG_MDC_PERIOD_MASK, mdio_period); -+ writel(val, priv->mdio_io + MLXBF_GIGE_MDIO_CFG_OFFSET); -+} -+ - int mlxbf_gige_mdio_probe(struct platform_device *pdev, struct mlxbf_gige *priv) - { - struct device *dev = &pdev->dev; -@@ -164,9 +238,22 @@ int mlxbf_gige_mdio_probe(struct platform_device *pdev, struct mlxbf_gige *priv) - if (IS_ERR(priv->mdio_io)) - return PTR_ERR(priv->mdio_io); - -- /* Configure mdio parameters */ -- writel(MLXBF_GIGE_MDIO_CFG_VAL, -- priv->mdio_io + MLXBF_GIGE_MDIO_CFG_OFFSET); -+ /* clk resource shared with other drivers so cannot use -+ * devm_platform_ioremap_resource -+ */ -+ res = platform_get_resource(pdev, IORESOURCE_MEM, MLXBF_GIGE_RES_CLK); -+ if (!res) { -+ /* For backward compatibility with older ACPI tables, also keep -+ * CLK resource internal to the driver. -+ */ -+ res = &corepll_params[MLXBF_GIGE_VERSION_BF2]; -+ } -+ -+ priv->clk_io = devm_ioremap(dev, res->start, resource_size(res)); -+ if (IS_ERR(priv->clk_io)) -+ return PTR_ERR(priv->clk_io); -+ -+ mlxbf_gige_mdio_cfg(priv); - - priv->mdiobus = devm_mdiobus_alloc(dev); - if (!priv->mdiobus) { -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_regs.h b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_regs.h -index 5fb33c929..7be3a7939 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_regs.h -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_regs.h -@@ -8,6 +8,8 @@ - #ifndef __MLXBF_GIGE_REGS_H__ - #define __MLXBF_GIGE_REGS_H__ - -+#define MLXBF_GIGE_VERSION 0x0000 -+#define MLXBF_GIGE_VERSION_BF2 0x0 - #define MLXBF_GIGE_STATUS 0x0010 - #define MLXBF_GIGE_STATUS_READY BIT(0) - #define MLXBF_GIGE_INT_STATUS 0x0028 --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0238-net-mlxbf_gige-Fix-an-IS_ERR-vs-NULL-bug-in-mlxbf_gi.patch b/platform/mellanox/non-upstream-patches/patches/0238-net-mlxbf_gige-Fix-an-IS_ERR-vs-NULL-bug-in-mlxbf_gi.patch deleted file mode 100644 index dbbfa9615488..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0238-net-mlxbf_gige-Fix-an-IS_ERR-vs-NULL-bug-in-mlxbf_gi.patch +++ /dev/null @@ -1,42 +0,0 @@ -From f6a48751ea5c5943d9eb6e0d7711215ac5aad6c3 Mon Sep 17 00:00:00 2001 -From: Peng Wu -Date: Fri, 30 Sep 2022 11:24:45 -0400 -Subject: [PATCH backport 5.10 39/63] net/mlxbf_gige: Fix an IS_ERR() vs NULL - bug in mlxbf_gige_mdio_probe - -BugLink: https://bugs.launchpad.net/bugs/1991403 - -The devm_ioremap() function returns NULL on error, it doesn't return -error pointers. - -Fixes: 3a1a274e933f ("mlxbf_gige: compute MDIO period based on i1clk") -Signed-off-by: Peng Wu -Link: https://lore.kernel.org/r/20220923023640.116057-1-wupeng58@huawei.com -Signed-off-by: Jakub Kicinski -(cherry picked from commit 4774db8dfc6a2e6649920ebb2fc8e2f062c2080d) -Signed-off-by: David Thompson -Acked-by: Tim Gardner -Acked-by: Kleber Sacilotto de Souza -Signed-off-by: Bartlomiej Zolnierkiewicz ---- - drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c -index 736849d07..daa31ddb2 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c -@@ -250,8 +250,8 @@ int mlxbf_gige_mdio_probe(struct platform_device *pdev, struct mlxbf_gige *priv) - } - - priv->clk_io = devm_ioremap(dev, res->start, resource_size(res)); -- if (IS_ERR(priv->clk_io)) -- return PTR_ERR(priv->clk_io); -+ if (!priv->clk_io) -+ return -ENOMEM; - - mlxbf_gige_mdio_cfg(priv); - --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0239-UBUNTU-SAUCE-mlxbf_gige-add-MDIO-support-for-BlueFie.patch b/platform/mellanox/non-upstream-patches/patches/0239-UBUNTU-SAUCE-mlxbf_gige-add-MDIO-support-for-BlueFie.patch deleted file mode 100644 index 9403bb5ba6cc..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0239-UBUNTU-SAUCE-mlxbf_gige-add-MDIO-support-for-BlueFie.patch +++ /dev/null @@ -1,484 +0,0 @@ -From 6073dbcdbce9c9f8e63790217b17913efb5174c5 Mon Sep 17 00:00:00 2001 -From: David Thompson -Date: Tue, 25 Oct 2022 16:25:19 -0400 -Subject: [PATCH backport 5.10 40/63] UBUNTU: SAUCE: mlxbf_gige: add MDIO - support for BlueField-3 - -BugLink: https://bugs.launchpad.net/bugs/1995148 - -This patch adds initial MDIO support for the BlueField-3 -SoC. Separate header files for the BlueField-2 and the -BlueField-3 SoCs have been created. These header files -hold the SoC-specific MDIO macros since the register -offsets and bit fields have changed. Also, in BlueField-3 -there is a separate register for writing and reading the -MDIO data. Finally, instead of having "if" statements -everywhere to differentiate between SoC-specific logic, -a mlxbf_gige_mdio_gw_t struct was created for this purpose. - -Signed-off-by: David Thompson -Signed-off-by: Asmaa Mnebhi ---- - .../ethernet/mellanox/mlxbf_gige/mlxbf_gige.h | 19 ++ - .../mellanox/mlxbf_gige/mlxbf_gige_main.c | 2 + - .../mellanox/mlxbf_gige/mlxbf_gige_mdio.c | 172 +++++++++++++----- - .../mellanox/mlxbf_gige/mlxbf_gige_mdio_bf2.h | 53 ++++++ - .../mellanox/mlxbf_gige/mlxbf_gige_mdio_bf3.h | 54 ++++++ - .../mellanox/mlxbf_gige/mlxbf_gige_regs.h | 1 + - 6 files changed, 251 insertions(+), 50 deletions(-) - create mode 100644 drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio_bf2.h - create mode 100644 drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio_bf3.h - -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige.h b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige.h -index 5a1027b07..421a0b1b7 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige.h -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige.h -@@ -67,6 +67,23 @@ struct mlxbf_gige_stats { - u64 rx_filter_discard_pkts; - }; - -+struct mlxbf_gige_reg_param { -+ u32 mask; -+ u32 shift; -+}; -+ -+struct mlxbf_gige_mdio_gw { -+ u32 gw_address; -+ u32 read_data_address; -+ struct mlxbf_gige_reg_param busy; -+ struct mlxbf_gige_reg_param write_data; -+ struct mlxbf_gige_reg_param read_data; -+ struct mlxbf_gige_reg_param devad; -+ struct mlxbf_gige_reg_param partad; -+ struct mlxbf_gige_reg_param opcode; -+ struct mlxbf_gige_reg_param st1; -+}; -+ - struct mlxbf_gige { - void __iomem *base; - void __iomem *llu_base; -@@ -102,6 +119,8 @@ struct mlxbf_gige { - u8 valid_polarity; - struct napi_struct napi; - struct mlxbf_gige_stats stats; -+ u8 hw_version; -+ struct mlxbf_gige_mdio_gw *mdio_gw; - }; - - /* Rx Work Queue Element definitions */ -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -index 66a50e35f..49695f3e9 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -@@ -351,6 +351,8 @@ static int mlxbf_gige_probe(struct platform_device *pdev) - - spin_lock_init(&priv->lock); - -+ priv->hw_version = readq(base + MLXBF_GIGE_VERSION); -+ - /* Attach MDIO device */ - err = mlxbf_gige_mdio_probe(pdev, priv); - if (err) -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c -index daa31ddb2..4ee3df30c 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c -@@ -23,9 +23,75 @@ - - #include "mlxbf_gige.h" - #include "mlxbf_gige_regs.h" -+#include "mlxbf_gige_mdio_bf2.h" -+#include "mlxbf_gige_mdio_bf3.h" - --#define MLXBF_GIGE_MDIO_GW_OFFSET 0x0 --#define MLXBF_GIGE_MDIO_CFG_OFFSET 0x4 -+static struct mlxbf_gige_mdio_gw mlxbf_gige_mdio_gw_t[] = { -+ [MLXBF_GIGE_VERSION_BF2] = { -+ .gw_address = MLXBF2_GIGE_MDIO_GW_OFFSET, -+ .read_data_address = MLXBF2_GIGE_MDIO_GW_OFFSET, -+ .busy = { -+ .mask = MLXBF2_GIGE_MDIO_GW_BUSY_MASK, -+ .shift = MLXBF2_GIGE_MDIO_GW_BUSY_SHIFT, -+ }, -+ .read_data = { -+ .mask = MLXBF2_GIGE_MDIO_GW_AD_MASK, -+ .shift = MLXBF2_GIGE_MDIO_GW_AD_SHIFT, -+ }, -+ .write_data = { -+ .mask = MLXBF2_GIGE_MDIO_GW_AD_MASK, -+ .shift = MLXBF2_GIGE_MDIO_GW_AD_SHIFT, -+ }, -+ .devad = { -+ .mask = MLXBF2_GIGE_MDIO_GW_DEVAD_MASK, -+ .shift = MLXBF2_GIGE_MDIO_GW_DEVAD_SHIFT, -+ }, -+ .partad = { -+ .mask = MLXBF2_GIGE_MDIO_GW_PARTAD_MASK, -+ .shift = MLXBF2_GIGE_MDIO_GW_PARTAD_SHIFT, -+ }, -+ .opcode = { -+ .mask = MLXBF2_GIGE_MDIO_GW_OPCODE_MASK, -+ .shift = MLXBF2_GIGE_MDIO_GW_OPCODE_SHIFT, -+ }, -+ .st1 = { -+ .mask = MLXBF2_GIGE_MDIO_GW_ST1_MASK, -+ .shift = MLXBF2_GIGE_MDIO_GW_ST1_SHIFT, -+ }, -+ }, -+ [MLXBF_GIGE_VERSION_BF3] = { -+ .gw_address = MLXBF3_GIGE_MDIO_GW_OFFSET, -+ .read_data_address = MLXBF3_GIGE_MDIO_DATA_READ, -+ .busy = { -+ .mask = MLXBF3_GIGE_MDIO_GW_BUSY_MASK, -+ .shift = MLXBF3_GIGE_MDIO_GW_BUSY_SHIFT, -+ }, -+ .read_data = { -+ .mask = MLXBF3_GIGE_MDIO_GW_DATA_READ_MASK, -+ .shift = MLXBF3_GIGE_MDIO_GW_DATA_READ_SHIFT, -+ }, -+ .write_data = { -+ .mask = MLXBF3_GIGE_MDIO_GW_DATA_MASK, -+ .shift = MLXBF3_GIGE_MDIO_GW_DATA_SHIFT, -+ }, -+ .devad = { -+ .mask = MLXBF3_GIGE_MDIO_GW_DEVAD_MASK, -+ .shift = MLXBF3_GIGE_MDIO_GW_DEVAD_SHIFT, -+ }, -+ .partad = { -+ .mask = MLXBF3_GIGE_MDIO_GW_PARTAD_MASK, -+ .shift = MLXBF3_GIGE_MDIO_GW_PARTAD_SHIFT, -+ }, -+ .opcode = { -+ .mask = MLXBF3_GIGE_MDIO_GW_OPCODE_MASK, -+ .shift = MLXBF3_GIGE_MDIO_GW_OPCODE_SHIFT, -+ }, -+ .st1 = { -+ .mask = MLXBF3_GIGE_MDIO_GW_ST1_MASK, -+ .shift = MLXBF3_GIGE_MDIO_GW_ST1_SHIFT, -+ }, -+ }, -+}; - - #define MLXBF_GIGE_MDIO_FREQ_REFERENCE 156250000ULL - #define MLXBF_GIGE_MDIO_COREPLL_CONST 16384ULL -@@ -47,30 +113,10 @@ - /* Busy bit is set by software and cleared by hardware */ - #define MLXBF_GIGE_MDIO_SET_BUSY 0x1 - --/* MDIO GW register bits */ --#define MLXBF_GIGE_MDIO_GW_AD_MASK GENMASK(15, 0) --#define MLXBF_GIGE_MDIO_GW_DEVAD_MASK GENMASK(20, 16) --#define MLXBF_GIGE_MDIO_GW_PARTAD_MASK GENMASK(25, 21) --#define MLXBF_GIGE_MDIO_GW_OPCODE_MASK GENMASK(27, 26) --#define MLXBF_GIGE_MDIO_GW_ST1_MASK GENMASK(28, 28) --#define MLXBF_GIGE_MDIO_GW_BUSY_MASK GENMASK(30, 30) -- --/* MDIO config register bits */ --#define MLXBF_GIGE_MDIO_CFG_MDIO_MODE_MASK GENMASK(1, 0) --#define MLXBF_GIGE_MDIO_CFG_MDIO3_3_MASK GENMASK(2, 2) --#define MLXBF_GIGE_MDIO_CFG_MDIO_FULL_DRIVE_MASK GENMASK(4, 4) --#define MLXBF_GIGE_MDIO_CFG_MDC_PERIOD_MASK GENMASK(15, 8) --#define MLXBF_GIGE_MDIO_CFG_MDIO_IN_SAMP_MASK GENMASK(23, 16) --#define MLXBF_GIGE_MDIO_CFG_MDIO_OUT_SAMP_MASK GENMASK(31, 24) -- --#define MLXBF_GIGE_MDIO_CFG_VAL (FIELD_PREP(MLXBF_GIGE_MDIO_CFG_MDIO_MODE_MASK, 1) | \ -- FIELD_PREP(MLXBF_GIGE_MDIO_CFG_MDIO3_3_MASK, 1) | \ -- FIELD_PREP(MLXBF_GIGE_MDIO_CFG_MDIO_FULL_DRIVE_MASK, 1) | \ -- FIELD_PREP(MLXBF_GIGE_MDIO_CFG_MDIO_IN_SAMP_MASK, 6) | \ -- FIELD_PREP(MLXBF_GIGE_MDIO_CFG_MDIO_OUT_SAMP_MASK, 13)) -- - #define MLXBF_GIGE_BF2_COREPLL_ADDR 0x02800c30 - #define MLXBF_GIGE_BF2_COREPLL_SIZE 0x0000000c -+#define MLXBF_GIGE_BF3_COREPLL_ADDR 0x13409824 -+#define MLXBF_GIGE_BF3_COREPLL_SIZE 0x00000010 - - static struct resource corepll_params[] = { - [MLXBF_GIGE_VERSION_BF2] = { -@@ -78,6 +124,11 @@ static struct resource corepll_params[] = { - .end = MLXBF_GIGE_BF2_COREPLL_ADDR + MLXBF_GIGE_BF2_COREPLL_SIZE - 1, - .name = "COREPLL_RES" - }, -+ [MLXBF_GIGE_VERSION_BF3] = { -+ .start = MLXBF_GIGE_BF3_COREPLL_ADDR, -+ .end = MLXBF_GIGE_BF3_COREPLL_ADDR + MLXBF_GIGE_BF3_COREPLL_SIZE - 1, -+ .name = "COREPLL_RES" -+ } - }; - - /* Returns core clock i1clk in Hz */ -@@ -134,19 +185,23 @@ static u8 mdio_period_map(struct mlxbf_gige *priv) - return mdio_period; - } - --static u32 mlxbf_gige_mdio_create_cmd(u16 data, int phy_add, -+static u32 mlxbf_gige_mdio_create_cmd(struct mlxbf_gige_mdio_gw *mdio_gw, u16 data, int phy_add, - int phy_reg, u32 opcode) - { - u32 gw_reg = 0; - -- gw_reg |= FIELD_PREP(MLXBF_GIGE_MDIO_GW_AD_MASK, data); -- gw_reg |= FIELD_PREP(MLXBF_GIGE_MDIO_GW_DEVAD_MASK, phy_reg); -- gw_reg |= FIELD_PREP(MLXBF_GIGE_MDIO_GW_PARTAD_MASK, phy_add); -- gw_reg |= FIELD_PREP(MLXBF_GIGE_MDIO_GW_OPCODE_MASK, opcode); -- gw_reg |= FIELD_PREP(MLXBF_GIGE_MDIO_GW_ST1_MASK, -- MLXBF_GIGE_MDIO_CL22_ST1); -- gw_reg |= FIELD_PREP(MLXBF_GIGE_MDIO_GW_BUSY_MASK, -- MLXBF_GIGE_MDIO_SET_BUSY); -+ gw_reg |= ((data << mdio_gw->write_data.shift) & -+ mdio_gw->write_data.mask); -+ gw_reg |= ((phy_reg << mdio_gw->devad.shift) & -+ mdio_gw->devad.mask); -+ gw_reg |= ((phy_add << mdio_gw->partad.shift) & -+ mdio_gw->partad.mask); -+ gw_reg |= ((opcode << mdio_gw->opcode.shift) & -+ mdio_gw->opcode.mask); -+ gw_reg |= ((MLXBF_GIGE_MDIO_CL22_ST1 << mdio_gw->st1.shift) & -+ mdio_gw->st1.mask); -+ gw_reg |= ((MLXBF_GIGE_MDIO_SET_BUSY << mdio_gw->busy.shift) & -+ mdio_gw->busy.mask); - - return gw_reg; - } -@@ -162,25 +217,26 @@ static int mlxbf_gige_mdio_read(struct mii_bus *bus, int phy_add, int phy_reg) - return -EOPNOTSUPP; - - /* Send mdio read request */ -- cmd = mlxbf_gige_mdio_create_cmd(0, phy_add, phy_reg, MLXBF_GIGE_MDIO_CL22_READ); -+ cmd = mlxbf_gige_mdio_create_cmd(priv->mdio_gw, 0, phy_add, phy_reg, -+ MLXBF_GIGE_MDIO_CL22_READ); - -- writel(cmd, priv->mdio_io + MLXBF_GIGE_MDIO_GW_OFFSET); -+ writel(cmd, priv->mdio_io + priv->mdio_gw->gw_address); - -- ret = readl_poll_timeout_atomic(priv->mdio_io + MLXBF_GIGE_MDIO_GW_OFFSET, -- val, !(val & MLXBF_GIGE_MDIO_GW_BUSY_MASK), -+ ret = readl_poll_timeout_atomic(priv->mdio_io + priv->mdio_gw->gw_address, -+ val, !(val & priv->mdio_gw->busy.mask), - 5, 1000000); - - if (ret) { -- writel(0, priv->mdio_io + MLXBF_GIGE_MDIO_GW_OFFSET); -+ writel(0, priv->mdio_io + priv->mdio_gw->gw_address); - return ret; - } - -- ret = readl(priv->mdio_io + MLXBF_GIGE_MDIO_GW_OFFSET); -+ ret = readl(priv->mdio_io + priv->mdio_gw->read_data_address); - /* Only return ad bits of the gw register */ -- ret &= MLXBF_GIGE_MDIO_GW_AD_MASK; -+ ret &= priv->mdio_gw->read_data.mask; - - /* The MDIO lock is set on read. To release it, clear gw register */ -- writel(0, priv->mdio_io + MLXBF_GIGE_MDIO_GW_OFFSET); -+ writel(0, priv->mdio_io + priv->mdio_gw->gw_address); - - return ret; - } -@@ -197,17 +253,17 @@ static int mlxbf_gige_mdio_write(struct mii_bus *bus, int phy_add, - return -EOPNOTSUPP; - - /* Send mdio write request */ -- cmd = mlxbf_gige_mdio_create_cmd(val, phy_add, phy_reg, -+ cmd = mlxbf_gige_mdio_create_cmd(priv->mdio_gw, val, phy_add, phy_reg, - MLXBF_GIGE_MDIO_CL22_WRITE); -- writel(cmd, priv->mdio_io + MLXBF_GIGE_MDIO_GW_OFFSET); -+ writel(cmd, priv->mdio_io + priv->mdio_gw->gw_address); - - /* If the poll timed out, drop the request */ -- ret = readl_poll_timeout_atomic(priv->mdio_io + MLXBF_GIGE_MDIO_GW_OFFSET, -- temp, !(temp & MLXBF_GIGE_MDIO_GW_BUSY_MASK), -+ ret = readl_poll_timeout_atomic(priv->mdio_io + priv->mdio_gw->gw_address, -+ temp, !(temp & priv->mdio_gw->busy.mask), - 5, 1000000); - - /* The MDIO lock is set on read. To release it, clear gw register */ -- writel(0, priv->mdio_io + MLXBF_GIGE_MDIO_GW_OFFSET); -+ writel(0, priv->mdio_io + priv->mdio_gw->gw_address); - - return ret; - } -@@ -219,9 +275,20 @@ static void mlxbf_gige_mdio_cfg(struct mlxbf_gige *priv) - - mdio_period = mdio_period_map(priv); - -- val = MLXBF_GIGE_MDIO_CFG_VAL; -- val |= FIELD_PREP(MLXBF_GIGE_MDIO_CFG_MDC_PERIOD_MASK, mdio_period); -- writel(val, priv->mdio_io + MLXBF_GIGE_MDIO_CFG_OFFSET); -+ if (priv->hw_version == MLXBF_GIGE_VERSION_BF2) { -+ val = MLXBF2_GIGE_MDIO_CFG_VAL; -+ val |= FIELD_PREP(MLXBF2_GIGE_MDIO_CFG_MDC_PERIOD_MASK, mdio_period); -+ writel(val, priv->mdio_io + MLXBF2_GIGE_MDIO_CFG_OFFSET); -+ } else { -+ val = FIELD_PREP(MLXBF3_GIGE_MDIO_CFG_MDIO_MODE_MASK, 1) | -+ FIELD_PREP(MLXBF3_GIGE_MDIO_CFG_MDIO_FULL_DRIVE_MASK, 1); -+ writel(val, priv->mdio_io + MLXBF3_GIGE_MDIO_CFG_REG0); -+ val = FIELD_PREP(MLXBF3_GIGE_MDIO_CFG_MDC_PERIOD_MASK, mdio_period); -+ writel(val, priv->mdio_io + MLXBF3_GIGE_MDIO_CFG_REG1); -+ val = FIELD_PREP(MLXBF3_GIGE_MDIO_CFG_MDIO_IN_SAMP_MASK, 6) | -+ FIELD_PREP(MLXBF3_GIGE_MDIO_CFG_MDIO_OUT_SAMP_MASK, 13); -+ writel(val, priv->mdio_io + MLXBF3_GIGE_MDIO_CFG_REG2); -+ } - } - - int mlxbf_gige_mdio_probe(struct platform_device *pdev, struct mlxbf_gige *priv) -@@ -230,6 +297,9 @@ int mlxbf_gige_mdio_probe(struct platform_device *pdev, struct mlxbf_gige *priv) - struct resource *res; - int ret; - -+ if (priv->hw_version > MLXBF_GIGE_VERSION_BF3) -+ return -ENODEV; -+ - res = platform_get_resource(pdev, IORESOURCE_MEM, MLXBF_GIGE_RES_MDIO9); - if (!res) - return -ENODEV; -@@ -246,13 +316,15 @@ int mlxbf_gige_mdio_probe(struct platform_device *pdev, struct mlxbf_gige *priv) - /* For backward compatibility with older ACPI tables, also keep - * CLK resource internal to the driver. - */ -- res = &corepll_params[MLXBF_GIGE_VERSION_BF2]; -+ res = &corepll_params[priv->hw_version]; - } - - priv->clk_io = devm_ioremap(dev, res->start, resource_size(res)); - if (!priv->clk_io) - return -ENOMEM; - -+ priv->mdio_gw = &mlxbf_gige_mdio_gw_t[priv->hw_version]; -+ - mlxbf_gige_mdio_cfg(priv); - - priv->mdiobus = devm_mdiobus_alloc(dev); -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio_bf2.h b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio_bf2.h -new file mode 100644 -index 000000000..7f1ff0ac7 ---- /dev/null -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio_bf2.h -@@ -0,0 +1,53 @@ -+/* SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause */ -+ -+/* MDIO support for Mellanox Gigabit Ethernet driver -+ * -+ * Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES, ALL RIGHTS RESERVED. -+ * -+ * This software product is a proprietary product of NVIDIA CORPORATION & -+ * AFFILIATES (the "Company") and all right, title, and interest in and to the -+ * software product, including all associated intellectual property rights, are -+ * and shall remain exclusively with the Company. -+ * -+ * This software product is governed by the End User License Agreement -+ * provided with the software product. -+ */ -+ -+#ifndef __MLXBF_GIGE_MDIO_BF2_H__ -+#define __MLXBF_GIGE_MDIO_BF2_H__ -+ -+#include -+ -+#define MLXBF2_GIGE_MDIO_GW_OFFSET 0x0 -+#define MLXBF2_GIGE_MDIO_CFG_OFFSET 0x4 -+ -+/* MDIO GW register bits */ -+#define MLXBF2_GIGE_MDIO_GW_AD_MASK GENMASK(15, 0) -+#define MLXBF2_GIGE_MDIO_GW_DEVAD_MASK GENMASK(20, 16) -+#define MLXBF2_GIGE_MDIO_GW_PARTAD_MASK GENMASK(25, 21) -+#define MLXBF2_GIGE_MDIO_GW_OPCODE_MASK GENMASK(27, 26) -+#define MLXBF2_GIGE_MDIO_GW_ST1_MASK GENMASK(28, 28) -+#define MLXBF2_GIGE_MDIO_GW_BUSY_MASK GENMASK(30, 30) -+ -+#define MLXBF2_GIGE_MDIO_GW_AD_SHIFT 0 -+#define MLXBF2_GIGE_MDIO_GW_DEVAD_SHIFT 16 -+#define MLXBF2_GIGE_MDIO_GW_PARTAD_SHIFT 21 -+#define MLXBF2_GIGE_MDIO_GW_OPCODE_SHIFT 26 -+#define MLXBF2_GIGE_MDIO_GW_ST1_SHIFT 28 -+#define MLXBF2_GIGE_MDIO_GW_BUSY_SHIFT 30 -+ -+/* MDIO config register bits */ -+#define MLXBF2_GIGE_MDIO_CFG_MDIO_MODE_MASK GENMASK(1, 0) -+#define MLXBF2_GIGE_MDIO_CFG_MDIO3_3_MASK GENMASK(2, 2) -+#define MLXBF2_GIGE_MDIO_CFG_MDIO_FULL_DRIVE_MASK GENMASK(4, 4) -+#define MLXBF2_GIGE_MDIO_CFG_MDC_PERIOD_MASK GENMASK(15, 8) -+#define MLXBF2_GIGE_MDIO_CFG_MDIO_IN_SAMP_MASK GENMASK(23, 16) -+#define MLXBF2_GIGE_MDIO_CFG_MDIO_OUT_SAMP_MASK GENMASK(31, 24) -+ -+#define MLXBF2_GIGE_MDIO_CFG_VAL (FIELD_PREP(MLXBF2_GIGE_MDIO_CFG_MDIO_MODE_MASK, 1) | \ -+ FIELD_PREP(MLXBF2_GIGE_MDIO_CFG_MDIO3_3_MASK, 1) | \ -+ FIELD_PREP(MLXBF2_GIGE_MDIO_CFG_MDIO_FULL_DRIVE_MASK, 1) | \ -+ FIELD_PREP(MLXBF2_GIGE_MDIO_CFG_MDIO_IN_SAMP_MASK, 6) | \ -+ FIELD_PREP(MLXBF2_GIGE_MDIO_CFG_MDIO_OUT_SAMP_MASK, 13)) -+ -+#endif /* __MLXBF_GIGE_MDIO_BF2_H__ */ -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio_bf3.h b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio_bf3.h -new file mode 100644 -index 000000000..9dd9144b9 ---- /dev/null -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio_bf3.h -@@ -0,0 +1,54 @@ -+/* SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause */ -+ -+/* MDIO support for Mellanox Gigabit Ethernet driver -+ * -+ * Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES, ALL RIGHTS RESERVED. -+ * -+ * This software product is a proprietary product of NVIDIA CORPORATION & -+ * AFFILIATES (the "Company") and all right, title, and interest in and to the -+ * software product, including all associated intellectual property rights, are -+ * and shall remain exclusively with the Company. -+ * -+ * This software product is governed by the End User License Agreement -+ * provided with the software product. -+ */ -+ -+#ifndef __MLXBF_GIGE_MDIO_BF3_H__ -+#define __MLXBF_GIGE_MDIO_BF3_H__ -+ -+#include -+ -+#define MLXBF3_GIGE_MDIO_GW_OFFSET 0x80 -+#define MLXBF3_GIGE_MDIO_DATA_READ 0x8c -+#define MLXBF3_GIGE_MDIO_CFG_REG0 0x100 -+#define MLXBF3_GIGE_MDIO_CFG_REG1 0x104 -+#define MLXBF3_GIGE_MDIO_CFG_REG2 0x108 -+ -+/* MDIO GW register bits */ -+#define MLXBF3_GIGE_MDIO_GW_ST1_MASK GENMASK(1, 1) -+#define MLXBF3_GIGE_MDIO_GW_OPCODE_MASK GENMASK(3, 2) -+#define MLXBF3_GIGE_MDIO_GW_PARTAD_MASK GENMASK(8, 4) -+#define MLXBF3_GIGE_MDIO_GW_DEVAD_MASK GENMASK(13, 9) -+/* For BlueField-3, this field is only used for mdio write */ -+#define MLXBF3_GIGE_MDIO_GW_DATA_MASK GENMASK(29, 14) -+#define MLXBF3_GIGE_MDIO_GW_BUSY_MASK GENMASK(30, 30) -+ -+#define MLXBF3_GIGE_MDIO_GW_DATA_READ_MASK GENMASK(15, 0) -+ -+#define MLXBF3_GIGE_MDIO_GW_ST1_SHIFT 1 -+#define MLXBF3_GIGE_MDIO_GW_OPCODE_SHIFT 2 -+#define MLXBF3_GIGE_MDIO_GW_PARTAD_SHIFT 4 -+#define MLXBF3_GIGE_MDIO_GW_DEVAD_SHIFT 9 -+#define MLXBF3_GIGE_MDIO_GW_DATA_SHIFT 14 -+#define MLXBF3_GIGE_MDIO_GW_BUSY_SHIFT 30 -+ -+#define MLXBF3_GIGE_MDIO_GW_DATA_READ_SHIFT 0 -+ -+/* MDIO config register bits */ -+#define MLXBF3_GIGE_MDIO_CFG_MDIO_MODE_MASK GENMASK(1, 0) -+#define MLXBF3_GIGE_MDIO_CFG_MDIO_FULL_DRIVE_MASK GENMASK(2, 2) -+#define MLXBF3_GIGE_MDIO_CFG_MDC_PERIOD_MASK GENMASK(7, 0) -+#define MLXBF3_GIGE_MDIO_CFG_MDIO_IN_SAMP_MASK GENMASK(7, 0) -+#define MLXBF3_GIGE_MDIO_CFG_MDIO_OUT_SAMP_MASK GENMASK(15, 8) -+ -+#endif /* __MLXBF_GIGE_MDIO_BF3_H__ */ -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_regs.h b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_regs.h -index 7be3a7939..8d52dbef4 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_regs.h -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_regs.h -@@ -10,6 +10,7 @@ - - #define MLXBF_GIGE_VERSION 0x0000 - #define MLXBF_GIGE_VERSION_BF2 0x0 -+#define MLXBF_GIGE_VERSION_BF3 0x1 - #define MLXBF_GIGE_STATUS 0x0010 - #define MLXBF_GIGE_STATUS_READY BIT(0) - #define MLXBF_GIGE_INT_STATUS 0x0028 --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0240-UBUNTU-SAUCE-mlxbf_gige-support-10M-100M-1G-speeds-o.patch b/platform/mellanox/non-upstream-patches/patches/0240-UBUNTU-SAUCE-mlxbf_gige-support-10M-100M-1G-speeds-o.patch deleted file mode 100644 index a8a1d325dfb3..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0240-UBUNTU-SAUCE-mlxbf_gige-support-10M-100M-1G-speeds-o.patch +++ /dev/null @@ -1,237 +0,0 @@ -From b9f0d98629a7720d2b6e34aed529f943cf421c04 Mon Sep 17 00:00:00 2001 -From: David Thompson -Date: Tue, 25 Oct 2022 17:19:27 -0400 -Subject: [PATCH backport 5.10 41/63] UBUNTU: SAUCE: mlxbf_gige: support - 10M/100M/1G speeds on BlueField-3 - -BugLink: https://bugs.launchpad.net/bugs/1995148 - -The BlueField-3 OOB interface supports 10Mbps, 100Mbps, and 1Gbps speeds. -The external PHY is responsible for autonegotiating the speed with the -link partner. Once the autonegotiation is done, the BlueField PLU needs -to be configured accordingly. - -This patch does two things: -1) Initialize the advertised control flow/duplex/speed in the probe - based on the BlueField SoC generation (2 or 3) -2) Adjust the PLU speed config in the PHY interrupt handler - -Signed-off-by: David Thompson -Signed-off-by: Asmaa Mnebhi ---- - .../ethernet/mellanox/mlxbf_gige/mlxbf_gige.h | 8 ++ - .../mellanox/mlxbf_gige/mlxbf_gige_main.c | 109 +++++++++++++++--- - .../mellanox/mlxbf_gige/mlxbf_gige_regs.h | 21 ++++ - 3 files changed, 123 insertions(+), 15 deletions(-) - -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige.h b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige.h -index 421a0b1b7..a453b9cd9 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige.h -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige.h -@@ -14,6 +14,7 @@ - #include - #include - #include -+#include - - /* The silicon design supports a maximum RX ring size of - * 32K entries. Based on current testing this maximum size -@@ -84,6 +85,12 @@ struct mlxbf_gige_mdio_gw { - struct mlxbf_gige_reg_param st1; - }; - -+struct mlxbf_gige_link_cfg { -+ void (*set_phy_link_mode)(struct phy_device *phydev); -+ void (*adjust_link)(struct net_device *netdev); -+ phy_interface_t phy_mode; -+}; -+ - struct mlxbf_gige { - void __iomem *base; - void __iomem *llu_base; -@@ -121,6 +128,7 @@ struct mlxbf_gige { - struct mlxbf_gige_stats stats; - u8 hw_version; - struct mlxbf_gige_mdio_gw *mdio_gw; -+ int prev_speed; - }; - - /* Rx Work Queue Element definitions */ -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -index 49695f3e9..106b83bd6 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -@@ -270,13 +270,103 @@ static const struct net_device_ops mlxbf_gige_netdev_ops = { - .ndo_get_stats64 = mlxbf_gige_get_stats64, - }; - --static void mlxbf_gige_adjust_link(struct net_device *netdev) -+static void mlxbf_gige_bf2_adjust_link(struct net_device *netdev) - { - struct phy_device *phydev = netdev->phydev; - - phy_print_status(phydev); - } - -+static void mlxbf_gige_bf3_adjust_link(struct net_device *netdev) -+{ -+ struct mlxbf_gige *priv = netdev_priv(netdev); -+ struct phy_device *phydev = netdev->phydev; -+ unsigned long flags; -+ u8 sgmii_mode; -+ u16 ipg_size; -+ u32 val; -+ -+ spin_lock_irqsave(&priv->lock, flags); -+ if (phydev->link && phydev->speed != priv->prev_speed) { -+ switch (phydev->speed) { -+ case 1000: -+ ipg_size = MLXBF_GIGE_1G_IPG_SIZE; -+ sgmii_mode = MLXBF_GIGE_1G_SGMII_MODE; -+ break; -+ case 100: -+ ipg_size = MLXBF_GIGE_100M_IPG_SIZE; -+ sgmii_mode = MLXBF_GIGE_100M_SGMII_MODE; -+ break; -+ case 10: -+ ipg_size = MLXBF_GIGE_10M_IPG_SIZE; -+ sgmii_mode = MLXBF_GIGE_10M_SGMII_MODE; -+ break; -+ default: -+ spin_unlock_irqrestore(&priv->lock, flags); -+ return; -+ } -+ -+ val = readl(priv->plu_base + MLXBF_GIGE_PLU_TX_REG0); -+ val &= ~(MLXBF_GIGE_PLU_TX_IPG_SIZE_MASK | MLXBF_GIGE_PLU_TX_SGMII_MODE_MASK); -+ val |= FIELD_PREP(MLXBF_GIGE_PLU_TX_IPG_SIZE_MASK, ipg_size); -+ val |= FIELD_PREP(MLXBF_GIGE_PLU_TX_SGMII_MODE_MASK, sgmii_mode); -+ writel(val, priv->plu_base + MLXBF_GIGE_PLU_TX_REG0); -+ -+ val = readl(priv->plu_base + MLXBF_GIGE_PLU_RX_REG0); -+ val &= ~MLXBF_GIGE_PLU_RX_SGMII_MODE_MASK; -+ val |= FIELD_PREP(MLXBF_GIGE_PLU_RX_SGMII_MODE_MASK, sgmii_mode); -+ writel(val, priv->plu_base + MLXBF_GIGE_PLU_RX_REG0); -+ -+ priv->prev_speed = phydev->speed; -+ } -+ spin_unlock_irqrestore(&priv->lock, flags); -+ -+ phy_print_status(phydev); -+} -+ -+static void mlxbf_gige_bf2_set_phy_link_mode(struct phy_device *phydev) -+{ -+ /* MAC only supports 1000T full duplex mode */ -+ phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_1000baseT_Half_BIT); -+ phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_100baseT_Full_BIT); -+ phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_100baseT_Half_BIT); -+ phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_10baseT_Full_BIT); -+ phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_10baseT_Half_BIT); -+ -+ /* Only symmetric pause with flow control enabled is supported so no -+ * need to negotiate pause. -+ */ -+ linkmode_clear_bit(ETHTOOL_LINK_MODE_Pause_BIT, phydev->advertising); -+ linkmode_clear_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, phydev->advertising); -+} -+ -+static void mlxbf_gige_bf3_set_phy_link_mode(struct phy_device *phydev) -+{ -+ /* MAC only supports full duplex mode */ -+ phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_1000baseT_Half_BIT); -+ phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_100baseT_Half_BIT); -+ phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_10baseT_Half_BIT); -+ -+ /* Only symmetric pause with flow control enabled is supported so no -+ * need to negotiate pause. -+ */ -+ linkmode_clear_bit(ETHTOOL_LINK_MODE_Pause_BIT, phydev->advertising); -+ linkmode_clear_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, phydev->advertising); -+} -+ -+static struct mlxbf_gige_link_cfg mlxbf_gige_link_cfgs[] = { -+ [MLXBF_GIGE_VERSION_BF2] = { -+ .set_phy_link_mode = mlxbf_gige_bf2_set_phy_link_mode, -+ .adjust_link = mlxbf_gige_bf2_adjust_link, -+ .phy_mode = PHY_INTERFACE_MODE_GMII -+ }, -+ [MLXBF_GIGE_VERSION_BF3] = { -+ .set_phy_link_mode = mlxbf_gige_bf3_set_phy_link_mode, -+ .adjust_link = mlxbf_gige_bf3_adjust_link, -+ .phy_mode = PHY_INTERFACE_MODE_SGMII -+ } -+}; -+ - static int mlxbf_gige_probe(struct platform_device *pdev) - { - struct phy_device *phydev; -@@ -395,25 +485,14 @@ static int mlxbf_gige_probe(struct platform_device *pdev) - phydev->irq = phy_irq; - - err = phy_connect_direct(netdev, phydev, -- mlxbf_gige_adjust_link, -- PHY_INTERFACE_MODE_GMII); -+ mlxbf_gige_link_cfgs[priv->hw_version].adjust_link, -+ mlxbf_gige_link_cfgs[priv->hw_version].phy_mode); - if (err) { - dev_err(&pdev->dev, "Could not attach to PHY\n"); - goto out; - } - -- /* MAC only supports 1000T full duplex mode */ -- phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_1000baseT_Half_BIT); -- phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_100baseT_Full_BIT); -- phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_100baseT_Half_BIT); -- phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_10baseT_Full_BIT); -- phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_10baseT_Half_BIT); -- -- /* Only symmetric pause with flow control enabled is supported so no -- * need to negotiate pause. -- */ -- linkmode_clear_bit(ETHTOOL_LINK_MODE_Pause_BIT, phydev->advertising); -- linkmode_clear_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, phydev->advertising); -+ mlxbf_gige_link_cfgs[priv->hw_version].set_phy_link_mode(phydev); - - /* Display information about attached PHY device */ - phy_attached_info(phydev); -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_regs.h b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_regs.h -index 8d52dbef4..cd0973229 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_regs.h -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_regs.h -@@ -8,6 +8,8 @@ - #ifndef __MLXBF_GIGE_REGS_H__ - #define __MLXBF_GIGE_REGS_H__ - -+#include -+ - #define MLXBF_GIGE_VERSION 0x0000 - #define MLXBF_GIGE_VERSION_BF2 0x0 - #define MLXBF_GIGE_VERSION_BF3 0x1 -@@ -78,4 +80,23 @@ - */ - #define MLXBF_GIGE_MMIO_REG_SZ (MLXBF_GIGE_MAC_CFG + 8) - -+#define MLXBF_GIGE_PLU_TX_REG0 0x80 -+#define MLXBF_GIGE_PLU_TX_IPG_SIZE_MASK GENMASK(11, 0) -+#define MLXBF_GIGE_PLU_TX_SGMII_MODE_MASK GENMASK(15, 14) -+ -+#define MLXBF_GIGE_PLU_RX_REG0 0x10 -+#define MLXBF_GIGE_PLU_RX_SGMII_MODE_MASK GENMASK(25, 24) -+ -+#define MLXBF_GIGE_1G_SGMII_MODE 0x0 -+#define MLXBF_GIGE_10M_SGMII_MODE 0x1 -+#define MLXBF_GIGE_100M_SGMII_MODE 0x2 -+ -+/* ipg_size default value for 1G is fixed by HW to 11 + End = 12. -+ * So for 100M it is 12 * 10 - 1 = 119 -+ * For 10M, it is 12 * 100 - 1 = 1199 -+ */ -+#define MLXBF_GIGE_1G_IPG_SIZE 11 -+#define MLXBF_GIGE_100M_IPG_SIZE 119 -+#define MLXBF_GIGE_10M_IPG_SIZE 1199 -+ - #endif /* !defined(__MLXBF_GIGE_REGS_H__) */ --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0243-UBUNTU-SAUCE-bluefield_edac-Add-SMC-support.patch b/platform/mellanox/non-upstream-patches/patches/0243-UBUNTU-SAUCE-bluefield_edac-Add-SMC-support.patch deleted file mode 100644 index 51f40a5b7397..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0243-UBUNTU-SAUCE-bluefield_edac-Add-SMC-support.patch +++ /dev/null @@ -1,291 +0,0 @@ -From 9bebe7236f4e3d956feda9911ffee5f31dfbdb13 Mon Sep 17 00:00:00 2001 -From: Shravan Kumar Ramani -Date: Wed, 6 Jul 2022 03:37:38 -0400 -Subject: [PATCH backport 5.10 44/63] UBUNTU: SAUCE: bluefield_edac: Add SMC - support - -BugLink: https://launchpad.net/bugs/1980812 - -This patch adds secure read/write calls to bluefield_edac. The -ACPI table entry decides whether the secure calls need to be -used for accessing the EMI registers. - -Signed-off-by: Shravan Kumar Ramani -Signed-off-by: Ike Panhc ---- - drivers/edac/bluefield_edac.c | 168 +++++++++++++++++++++++++++++++--- - 1 file changed, 154 insertions(+), 14 deletions(-) - -diff --git a/drivers/edac/bluefield_edac.c b/drivers/edac/bluefield_edac.c -index e4736eb37..8e1127a56 100644 ---- a/drivers/edac/bluefield_edac.c -+++ b/drivers/edac/bluefield_edac.c -@@ -12,6 +12,7 @@ - #include - #include - #include -+#include - - #include "edac_module.h" - -@@ -47,6 +48,18 @@ - #define MLXBF_EDAC_MAX_DIMM_PER_MC 2 - #define MLXBF_EDAC_ERROR_GRAIN 8 - -+#define MLNX_WRITE_REG_32 (0x82000009) -+#define MLNX_READ_REG_32 (0x8200000A) -+#define MLNX_WRITE_REG_64 (0x8200000B) -+#define MLNX_READ_REG_64 (0x8200000C) -+#define MLNX_SIP_SVC_UID (0x8200ff01) -+#define MLNX_SIP_SVC_VERSION (0x8200ff03) -+ -+#define SMCCC_ACCESS_VIOLATION (-4) -+ -+#define MLNX_EDAC_SVC_REQ_MAJOR 0 -+#define MLNX_EDAC_SVC_MIN_MINOR 3 -+ - /* - * Request MLNX_SIP_GET_DIMM_INFO - * -@@ -72,9 +85,12 @@ - #define MLXBF_DIMM_INFO__PACKAGE_X GENMASK_ULL(31, 24) - - struct bluefield_edac_priv { -+ struct device *dev; - int dimm_ranks[MLXBF_EDAC_MAX_DIMM_PER_MC]; - void __iomem *emi_base; - int dimm_per_mc; -+ bool svc_sreg_support; -+ uint32_t sreg_tbl_edac; - }; - - static u64 smc_call1(u64 smc_op, u64 smc_arg) -@@ -86,6 +102,73 @@ static u64 smc_call1(u64 smc_op, u64 smc_arg) - return res.a0; - } - -+static int secure_readl(void __iomem *addr, uint32_t *result, uint32_t sreg_tbl) -+{ -+ struct arm_smccc_res res; -+ int status; -+ -+ arm_smccc_smc(MLNX_READ_REG_32, sreg_tbl, (uintptr_t) addr, -+ 0, 0, 0, 0, 0, &res); -+ -+ status = res.a0; -+ -+ switch (status) { -+ case SMCCC_RET_NOT_SUPPORTED: -+ case SMCCC_ACCESS_VIOLATION: -+ return -1; -+ default: -+ *result = (uint32_t)res.a1; -+ return 0; -+ } -+ -+} -+ -+static int secure_writel(void __iomem *addr, uint32_t data, uint32_t sreg_tbl) -+{ -+ struct arm_smccc_res res; -+ int status; -+ -+ arm_smccc_smc(MLNX_WRITE_REG_32, sreg_tbl, data, (uintptr_t) addr, -+ 0, 0, 0, 0, &res); -+ -+ status = res.a0; -+ -+ switch (status) { -+ case SMCCC_RET_NOT_SUPPORTED: -+ case SMCCC_ACCESS_VIOLATION: -+ return -1; -+ default: -+ return 0; -+ } -+ -+} -+ -+static int edac_readl(void __iomem *addr, uint32_t *result, -+ bool sreg_support, uint32_t sreg_tbl) -+{ -+ int err = 0; -+ -+ if (sreg_support) -+ err = secure_readl(addr, result, sreg_tbl); -+ else -+ *result = readl(addr); -+ -+ return err; -+} -+ -+static int edac_writel(void __iomem *addr, uint32_t data, -+ bool sreg_support, uint32_t sreg_tbl) -+{ -+ int err = 0; -+ -+ if (sreg_support) -+ err = secure_writel(addr, data, sreg_tbl); -+ else -+ writel(data, addr); -+ -+ return err; -+} -+ - /* - * Gather the ECC information from the External Memory Interface registers - * and report it to the edac handler. -@@ -99,7 +182,7 @@ static void bluefield_gather_report_ecc(struct mem_ctl_info *mci, - u32 ecc_latch_select, dram_syndrom, serr, derr, syndrom; - enum hw_event_mc_err_type ecc_type; - u64 ecc_dimm_addr; -- int ecc_dimm; -+ int ecc_dimm, err; - - ecc_type = is_single_ecc ? HW_EVENT_ERR_CORRECTED : - HW_EVENT_ERR_UNCORRECTED; -@@ -109,14 +192,22 @@ static void bluefield_gather_report_ecc(struct mem_ctl_info *mci, - * registers with information about the last ECC error occurrence. - */ - ecc_latch_select = MLXBF_ECC_LATCH_SEL__START; -- writel(ecc_latch_select, priv->emi_base + MLXBF_ECC_LATCH_SEL); -+ err = edac_writel(priv->emi_base + MLXBF_ECC_LATCH_SEL, -+ ecc_latch_select, priv->svc_sreg_support, -+ priv->sreg_tbl_edac); -+ if (err) -+ dev_err(priv->dev, "ECC latch select write failed.\n"); - - /* - * Verify that the ECC reported info in the registers is of the - * same type as the one asked to report. If not, just report the - * error without the detailed information. - */ -- dram_syndrom = readl(priv->emi_base + MLXBF_SYNDROM); -+ err = edac_readl(priv->emi_base + MLXBF_SYNDROM, &dram_syndrom, -+ priv->svc_sreg_support, priv->sreg_tbl_edac); -+ if (err) -+ dev_err(priv->dev, "DRAM syndrom read failed.\n"); -+ - serr = FIELD_GET(MLXBF_SYNDROM__SERR, dram_syndrom); - derr = FIELD_GET(MLXBF_SYNDROM__DERR, dram_syndrom); - syndrom = FIELD_GET(MLXBF_SYNDROM__SYN, dram_syndrom); -@@ -127,13 +218,24 @@ static void bluefield_gather_report_ecc(struct mem_ctl_info *mci, - return; - } - -- dram_additional_info = readl(priv->emi_base + MLXBF_ADD_INFO); -+ err = edac_readl(priv->emi_base + MLXBF_ADD_INFO, &dram_additional_info, -+ priv->svc_sreg_support, priv->sreg_tbl_edac); -+ if (err) -+ dev_err(priv->dev, "DRAM additional info read failed.\n"); -+ - err_prank = FIELD_GET(MLXBF_ADD_INFO__ERR_PRANK, dram_additional_info); - - ecc_dimm = (err_prank >= 2 && priv->dimm_ranks[0] <= 2) ? 1 : 0; - -- edea0 = readl(priv->emi_base + MLXBF_ERR_ADDR_0); -- edea1 = readl(priv->emi_base + MLXBF_ERR_ADDR_1); -+ err = edac_readl(priv->emi_base + MLXBF_ERR_ADDR_0, &edea0, -+ priv->svc_sreg_support, priv->sreg_tbl_edac); -+ if (err) -+ dev_err(priv->dev, "Error addr 0 read failed.\n"); -+ -+ err = edac_readl(priv->emi_base + MLXBF_ERR_ADDR_1, &edea1, -+ priv->svc_sreg_support, priv->sreg_tbl_edac); -+ if (err) -+ dev_err(priv->dev, "Error addr 1 read failed.\n"); - - ecc_dimm_addr = ((u64)edea1 << 32) | edea0; - -@@ -147,6 +249,7 @@ static void bluefield_edac_check(struct mem_ctl_info *mci) - { - struct bluefield_edac_priv *priv = mci->pvt_info; - u32 ecc_count, single_error_count, double_error_count, ecc_error = 0; -+ int err; - - /* - * The memory controller might not be initialized by the firmware -@@ -155,7 +258,11 @@ static void bluefield_edac_check(struct mem_ctl_info *mci) - if (mci->edac_cap == EDAC_FLAG_NONE) - return; - -- ecc_count = readl(priv->emi_base + MLXBF_ECC_CNT); -+ err = edac_readl(priv->emi_base + MLXBF_ECC_CNT, &ecc_count, -+ priv->svc_sreg_support, priv->sreg_tbl_edac); -+ if (err) -+ dev_err(priv->dev, "ECC count read failed.\n"); -+ - single_error_count = FIELD_GET(MLXBF_ECC_CNT__SERR_CNT, ecc_count); - double_error_count = FIELD_GET(MLXBF_ECC_CNT__DERR_CNT, ecc_count); - -@@ -172,8 +279,12 @@ static void bluefield_edac_check(struct mem_ctl_info *mci) - } - - /* Write to clear reported errors. */ -- if (ecc_count) -- writel(ecc_error, priv->emi_base + MLXBF_ECC_ERR); -+ if (ecc_count) { -+ err = edac_writel(priv->emi_base + MLXBF_ECC_ERR, ecc_error, -+ priv->svc_sreg_support, priv->sreg_tbl_edac); -+ if (err) -+ dev_err(priv->dev, "ECC Error write failed.\n"); -+ } - } - - /* Initialize the DIMMs information for the given memory controller. */ -@@ -244,6 +355,7 @@ static int bluefield_edac_mc_probe(struct platform_device *pdev) - struct bluefield_edac_priv *priv; - struct device *dev = &pdev->dev; - struct edac_mc_layer layers[1]; -+ struct arm_smccc_res res; - struct mem_ctl_info *mci; - struct resource *emi_res; - unsigned int mc_idx, dimm_count; -@@ -280,12 +392,40 @@ static int bluefield_edac_mc_probe(struct platform_device *pdev) - - priv = mci->pvt_info; - -+ /* -+ * ACPI indicates whether we use SMCs to access registers or not. -+ * If sreg_tbl_perf is not present, just assume we're not using SMCs. -+ */ -+ if (device_property_read_u32(dev, -+ "sec_reg_block", &priv->sreg_tbl_edac)) { -+ priv->svc_sreg_support = false; -+ } else { -+ /* -+ * Check service version to see if we actually do support the -+ * needed SMCs. If we have the calls we need, mark support for -+ * them in the pmc struct. -+ */ -+ arm_smccc_smc(MLNX_SIP_SVC_VERSION, 0, 0, 0, 0, 0, 0, 0, &res); -+ if (res.a0 == MLNX_EDAC_SVC_REQ_MAJOR && -+ res.a1 >= MLNX_EDAC_SVC_MIN_MINOR) -+ priv->svc_sreg_support = true; -+ else { -+ dev_err(dev, "Required SMCs are not supported.\n"); -+ ret = -EINVAL; -+ goto err; -+ } -+ } -+ - priv->dimm_per_mc = dimm_count; -- priv->emi_base = devm_ioremap_resource(dev, emi_res); -- if (IS_ERR(priv->emi_base)) { -- dev_err(dev, "failed to map EMI IO resource\n"); -- ret = PTR_ERR(priv->emi_base); -- goto err; -+ if (!priv->svc_sreg_support) { -+ priv->emi_base = devm_ioremap_resource(dev, emi_res); -+ if (IS_ERR(priv->emi_base)) { -+ dev_err(dev, "failed to map EMI IO resource\n"); -+ ret = PTR_ERR(priv->emi_base); -+ goto err; -+ } -+ } else { -+ priv->emi_base = (void __iomem *) emi_res->start; - } - - mci->pdev = dev; --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0244-UBUNTU-SAUCE-bluefield_edac-Update-license-and-copyr.patch b/platform/mellanox/non-upstream-patches/patches/0244-UBUNTU-SAUCE-bluefield_edac-Update-license-and-copyr.patch deleted file mode 100644 index 1e80cc4bb36a..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0244-UBUNTU-SAUCE-bluefield_edac-Update-license-and-copyr.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 8f60f2a6f44e75005bb94add0288d2c390870b11 Mon Sep 17 00:00:00 2001 -From: Shravan Kumar Ramani -Date: Thu, 7 Jul 2022 05:13:21 -0400 -Subject: [PATCH backport 5.10 45/63] UBUNTU: SAUCE: bluefield_edac: Update - license and copyright info - -BugLink: https://launchpad.net/bugs/1980812 - -Signed-off-by: Shravan Kumar Ramani -Signed-off-by: Ike Panhc ---- - drivers/edac/bluefield_edac.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/drivers/edac/bluefield_edac.c b/drivers/edac/bluefield_edac.c -index 8e1127a56..c21eb015f 100644 ---- a/drivers/edac/bluefield_edac.c -+++ b/drivers/edac/bluefield_edac.c -@@ -1,8 +1,8 @@ --// SPDX-License-Identifier: GPL-2.0 -+// SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause - /* - * Bluefield-specific EDAC driver. - * -- * Copyright (c) 2019 Mellanox Technologies. -+ * Copyright (c) 2022 NVIDIA Corporation. - */ - - #include -@@ -492,5 +492,5 @@ static struct platform_driver bluefield_edac_mc_driver = { - module_platform_driver(bluefield_edac_mc_driver); - - MODULE_DESCRIPTION("Mellanox BlueField memory edac driver"); --MODULE_AUTHOR("Mellanox Technologies"); --MODULE_LICENSE("GPL v2"); -+MODULE_AUTHOR("Shravan Kumar Ramani "); -+MODULE_LICENSE("Dual BSD/GPL"); --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0245-gpio-mlxbf2-Convert-to-device-PM-ops.patch b/platform/mellanox/non-upstream-patches/patches/0245-gpio-mlxbf2-Convert-to-device-PM-ops.patch deleted file mode 100644 index 18c46477015d..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0245-gpio-mlxbf2-Convert-to-device-PM-ops.patch +++ /dev/null @@ -1,93 +0,0 @@ -From c1facb3e3527a3f0d9125cc2336ae407acbbcc03 Mon Sep 17 00:00:00 2001 -From: Andy Shevchenko -Date: Mon, 16 Aug 2021 14:59:48 +0300 -Subject: [PATCH backport 5.10 46/63] gpio: mlxbf2: Convert to device PM ops - -Convert driver to use modern device PM ops interface. - -Signed-off-by: Andy Shevchenko -Acked-by: Asmaa Mnebhi -Signed-off-by: Bartosz Golaszewski ---- - drivers/gpio/gpio-mlxbf2.c | 21 ++++++--------------- - 1 file changed, 6 insertions(+), 15 deletions(-) - -diff --git a/drivers/gpio/gpio-mlxbf2.c b/drivers/gpio/gpio-mlxbf2.c -index befa5e109..68c471c10 100644 ---- a/drivers/gpio/gpio-mlxbf2.c -+++ b/drivers/gpio/gpio-mlxbf2.c -@@ -47,12 +47,10 @@ - #define YU_GPIO_MODE0_SET 0x54 - #define YU_GPIO_MODE0_CLEAR 0x58 - --#ifdef CONFIG_PM - struct mlxbf2_gpio_context_save_regs { - u32 gpio_mode0; - u32 gpio_mode1; - }; --#endif - - /* BlueField-2 gpio block context structure. */ - struct mlxbf2_gpio_context { -@@ -61,9 +59,7 @@ struct mlxbf2_gpio_context { - /* YU GPIO blocks address */ - void __iomem *gpio_io; - --#ifdef CONFIG_PM - struct mlxbf2_gpio_context_save_regs *csave_regs; --#endif - }; - - /* BlueField-2 gpio shared structure. */ -@@ -284,11 +280,9 @@ mlxbf2_gpio_probe(struct platform_device *pdev) - return 0; - } - --#ifdef CONFIG_PM --static int mlxbf2_gpio_suspend(struct platform_device *pdev, -- pm_message_t state) -+static int __maybe_unused mlxbf2_gpio_suspend(struct device *dev) - { -- struct mlxbf2_gpio_context *gs = platform_get_drvdata(pdev); -+ struct mlxbf2_gpio_context *gs = dev_get_drvdata(dev); - - gs->csave_regs->gpio_mode0 = readl(gs->gpio_io + - YU_GPIO_MODE0); -@@ -298,9 +292,9 @@ static int mlxbf2_gpio_suspend(struct platform_device *pdev, - return 0; - } - --static int mlxbf2_gpio_resume(struct platform_device *pdev) -+static int __maybe_unused mlxbf2_gpio_resume(struct device *dev) - { -- struct mlxbf2_gpio_context *gs = platform_get_drvdata(pdev); -+ struct mlxbf2_gpio_context *gs = dev_get_drvdata(dev); - - writel(gs->csave_regs->gpio_mode0, gs->gpio_io + - YU_GPIO_MODE0); -@@ -309,7 +303,7 @@ static int mlxbf2_gpio_resume(struct platform_device *pdev) - - return 0; - } --#endif -+static SIMPLE_DEV_PM_OPS(mlxbf2_pm_ops, mlxbf2_gpio_suspend, mlxbf2_gpio_resume); - - static const struct acpi_device_id __maybe_unused mlxbf2_gpio_acpi_match[] = { - { "MLNXBF22", 0 }, -@@ -321,12 +315,9 @@ static struct platform_driver mlxbf2_gpio_driver = { - .driver = { - .name = "mlxbf2_gpio", - .acpi_match_table = ACPI_PTR(mlxbf2_gpio_acpi_match), -+ .pm = &mlxbf2_pm_ops, - }, - .probe = mlxbf2_gpio_probe, --#ifdef CONFIG_PM -- .suspend = mlxbf2_gpio_suspend, -- .resume = mlxbf2_gpio_resume, --#endif - }; - - module_platform_driver(mlxbf2_gpio_driver); --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0246-gpio-mlxbf2-Drop-wrong-use-of-ACPI_PTR.patch b/platform/mellanox/non-upstream-patches/patches/0246-gpio-mlxbf2-Drop-wrong-use-of-ACPI_PTR.patch deleted file mode 100644 index 7f5810160199..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0246-gpio-mlxbf2-Drop-wrong-use-of-ACPI_PTR.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 6b12d567b86b79ff28397aa428778d9f159fb8da Mon Sep 17 00:00:00 2001 -From: Andy Shevchenko -Date: Mon, 16 Aug 2021 14:59:49 +0300 -Subject: [PATCH backport 5.10 47/63] gpio: mlxbf2: Drop wrong use of - ACPI_PTR() - -ACPI_PTR() is more harmful than helpful. For example, in this case -if CONFIG_ACPI=n, the ID table left unused which is not what we want. - -Instead of adding ifdeffery here and there, drop ACPI_PTR() and -replace acpi.h with mod_devicetable.h. - -Signed-off-by: Andy Shevchenko -Acked-by: Asmaa Mnehi -Signed-off-by: Bartosz Golaszewski ---- - drivers/gpio/gpio-mlxbf2.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/drivers/gpio/gpio-mlxbf2.c b/drivers/gpio/gpio-mlxbf2.c -index 68c471c10..8e6f78092 100644 ---- a/drivers/gpio/gpio-mlxbf2.c -+++ b/drivers/gpio/gpio-mlxbf2.c -@@ -1,6 +1,5 @@ - // SPDX-License-Identifier: GPL-2.0 - --#include - #include - #include - #include -@@ -8,6 +7,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -314,7 +314,7 @@ MODULE_DEVICE_TABLE(acpi, mlxbf2_gpio_acpi_match); - static struct platform_driver mlxbf2_gpio_driver = { - .driver = { - .name = "mlxbf2_gpio", -- .acpi_match_table = ACPI_PTR(mlxbf2_gpio_acpi_match), -+ .acpi_match_table = mlxbf2_gpio_acpi_match, - .pm = &mlxbf2_pm_ops, - }, - .probe = mlxbf2_gpio_probe, --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0247-gpio-mlxbf2-Use-devm_platform_ioremap_resource.patch b/platform/mellanox/non-upstream-patches/patches/0247-gpio-mlxbf2-Use-devm_platform_ioremap_resource.patch deleted file mode 100644 index dc24c6dc4d23..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0247-gpio-mlxbf2-Use-devm_platform_ioremap_resource.patch +++ /dev/null @@ -1,48 +0,0 @@ -From a75294f3e540e2d76a39583dbae875c428196f79 Mon Sep 17 00:00:00 2001 -From: Andy Shevchenko -Date: Mon, 16 Aug 2021 14:59:50 +0300 -Subject: [PATCH backport 5.10 48/63] gpio: mlxbf2: Use - devm_platform_ioremap_resource() - -Simplify the platform_get_resource() and devm_ioremap_resource() -calls with devm_platform_ioremap_resource(). - -Signed-off-by: Andy Shevchenko -Acked-by: Asmaa Mnebhi -Signed-off-by: Bartosz Golaszewski ---- - drivers/gpio/gpio-mlxbf2.c | 11 +++-------- - 1 file changed, 3 insertions(+), 8 deletions(-) - -diff --git a/drivers/gpio/gpio-mlxbf2.c b/drivers/gpio/gpio-mlxbf2.c -index 8e6f78092..661d5a831 100644 ---- a/drivers/gpio/gpio-mlxbf2.c -+++ b/drivers/gpio/gpio-mlxbf2.c -@@ -228,7 +228,6 @@ mlxbf2_gpio_probe(struct platform_device *pdev) - struct mlxbf2_gpio_context *gs; - struct device *dev = &pdev->dev; - struct gpio_chip *gc; -- struct resource *res; - unsigned int npins; - int ret; - -@@ -237,13 +236,9 @@ mlxbf2_gpio_probe(struct platform_device *pdev) - return -ENOMEM; - - /* YU GPIO block address */ -- res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -- if (!res) -- return -ENODEV; -- -- gs->gpio_io = devm_ioremap(dev, res->start, resource_size(res)); -- if (!gs->gpio_io) -- return -ENOMEM; -+ gs->gpio_io = devm_platform_ioremap_resource(pdev, 0); -+ if (IS_ERR(gs->gpio_io)) -+ return PTR_ERR(gs->gpio_io); - - ret = mlxbf2_gpio_get_lock_res(pdev); - if (ret) { --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0248-gpio-mlxbf2-Use-DEFINE_RES_MEM_NAMED-helper-macro.patch b/platform/mellanox/non-upstream-patches/patches/0248-gpio-mlxbf2-Use-DEFINE_RES_MEM_NAMED-helper-macro.patch deleted file mode 100644 index 441d83e30a48..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0248-gpio-mlxbf2-Use-DEFINE_RES_MEM_NAMED-helper-macro.patch +++ /dev/null @@ -1,37 +0,0 @@ -From e3e44e5389d723c49f187d91c16df0ec1b67ce53 Mon Sep 17 00:00:00 2001 -From: Andy Shevchenko -Date: Mon, 16 Aug 2021 14:59:51 +0300 -Subject: [PATCH backport 5.10 49/63] gpio: mlxbf2: Use DEFINE_RES_MEM_NAMED() - helper macro - -Use DEFINE_RES_MEM_NAMED() to save a couple of lines of code, which makes -the code a bit shorter and easier to read. - -Signed-off-by: Andy Shevchenko -Acked-by: Asmaa Mnebhi -Signed-off-by: Bartosz Golaszewski ---- - drivers/gpio/gpio-mlxbf2.c | 7 ++----- - 1 file changed, 2 insertions(+), 5 deletions(-) - -diff --git a/drivers/gpio/gpio-mlxbf2.c b/drivers/gpio/gpio-mlxbf2.c -index 661d5a831..177d03ef4 100644 ---- a/drivers/gpio/gpio-mlxbf2.c -+++ b/drivers/gpio/gpio-mlxbf2.c -@@ -69,11 +69,8 @@ struct mlxbf2_gpio_param { - struct mutex *lock; - }; - --static struct resource yu_arm_gpio_lock_res = { -- .start = YU_ARM_GPIO_LOCK_ADDR, -- .end = YU_ARM_GPIO_LOCK_ADDR + YU_ARM_GPIO_LOCK_SIZE - 1, -- .name = "YU_ARM_GPIO_LOCK", --}; -+static struct resource yu_arm_gpio_lock_res = -+ DEFINE_RES_MEM_NAMED(YU_ARM_GPIO_LOCK_ADDR, YU_ARM_GPIO_LOCK_SIZE, "YU_ARM_GPIO_LOCK"); - - static DEFINE_MUTEX(yu_arm_gpio_lock_mutex); - --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0249-gpio-mlxbf2-Introduce-IRQ-support.patch b/platform/mellanox/non-upstream-patches/patches/0249-gpio-mlxbf2-Introduce-IRQ-support.patch deleted file mode 100644 index 0bde44f14f0f..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0249-gpio-mlxbf2-Introduce-IRQ-support.patch +++ /dev/null @@ -1,222 +0,0 @@ -From 1eac5d74f7cd42e661479080a47547b657c16a18 Mon Sep 17 00:00:00 2001 -From: Asmaa Mnebhi -Date: Fri, 15 Oct 2021 12:48:08 -0400 -Subject: [PATCH backport 5.10 51/63] gpio: mlxbf2: Introduce IRQ support - -BugLink: https://bugs.launchpad.net/bugs/1979827 - -Introduce standard IRQ handling in the gpio-mlxbf2.c -driver. - -Signed-off-by: Asmaa Mnebhi -Acked-by: David S. Miller -Signed-off-by: Bartosz Golaszewski -(cherry picked from commit 2b725265cb08d6a0001bf81631ccb5728d095229) -Signed-off-by: Ike Panhc ---- - drivers/gpio/gpio-mlxbf2.c | 142 ++++++++++++++++++++++++++++++++++++- - 1 file changed, 140 insertions(+), 2 deletions(-) - -diff --git a/drivers/gpio/gpio-mlxbf2.c b/drivers/gpio/gpio-mlxbf2.c -index 40a052bc6..3d89912a0 100644 ---- a/drivers/gpio/gpio-mlxbf2.c -+++ b/drivers/gpio/gpio-mlxbf2.c -@@ -1,9 +1,14 @@ - // SPDX-License-Identifier: GPL-2.0 - -+/* -+ * Copyright (C) 2020-2021 NVIDIA CORPORATION & AFFILIATES -+ */ -+ - #include - #include - #include - #include -+#include - #include - #include - #include -@@ -43,9 +48,14 @@ - #define YU_GPIO_MODE0 0x0c - #define YU_GPIO_DATASET 0x14 - #define YU_GPIO_DATACLEAR 0x18 -+#define YU_GPIO_CAUSE_RISE_EN 0x44 -+#define YU_GPIO_CAUSE_FALL_EN 0x48 - #define YU_GPIO_MODE1_CLEAR 0x50 - #define YU_GPIO_MODE0_SET 0x54 - #define YU_GPIO_MODE0_CLEAR 0x58 -+#define YU_GPIO_CAUSE_OR_CAUSE_EVTEN0 0x80 -+#define YU_GPIO_CAUSE_OR_EVTEN0 0x94 -+#define YU_GPIO_CAUSE_OR_CLRCAUSE 0x98 - - struct mlxbf2_gpio_context_save_regs { - u32 gpio_mode0; -@@ -55,6 +65,7 @@ struct mlxbf2_gpio_context_save_regs { - /* BlueField-2 gpio block context structure. */ - struct mlxbf2_gpio_context { - struct gpio_chip gc; -+ struct irq_chip irq_chip; - - /* YU GPIO blocks address */ - void __iomem *gpio_io; -@@ -218,15 +229,114 @@ static int mlxbf2_gpio_direction_output(struct gpio_chip *chip, - return ret; - } - -+static void mlxbf2_gpio_irq_enable(struct irq_data *irqd) -+{ -+ struct gpio_chip *gc = irq_data_get_irq_chip_data(irqd); -+ struct mlxbf2_gpio_context *gs = gpiochip_get_data(gc); -+ int offset = irqd_to_hwirq(irqd); -+ unsigned long flags; -+ u32 val; -+ -+ spin_lock_irqsave(&gs->gc.bgpio_lock, flags); -+ val = readl(gs->gpio_io + YU_GPIO_CAUSE_OR_CLRCAUSE); -+ val |= BIT(offset); -+ writel(val, gs->gpio_io + YU_GPIO_CAUSE_OR_CLRCAUSE); -+ -+ val = readl(gs->gpio_io + YU_GPIO_CAUSE_OR_EVTEN0); -+ val |= BIT(offset); -+ writel(val, gs->gpio_io + YU_GPIO_CAUSE_OR_EVTEN0); -+ spin_unlock_irqrestore(&gs->gc.bgpio_lock, flags); -+} -+ -+static void mlxbf2_gpio_irq_disable(struct irq_data *irqd) -+{ -+ struct gpio_chip *gc = irq_data_get_irq_chip_data(irqd); -+ struct mlxbf2_gpio_context *gs = gpiochip_get_data(gc); -+ int offset = irqd_to_hwirq(irqd); -+ unsigned long flags; -+ u32 val; -+ -+ spin_lock_irqsave(&gs->gc.bgpio_lock, flags); -+ val = readl(gs->gpio_io + YU_GPIO_CAUSE_OR_EVTEN0); -+ val &= ~BIT(offset); -+ writel(val, gs->gpio_io + YU_GPIO_CAUSE_OR_EVTEN0); -+ spin_unlock_irqrestore(&gs->gc.bgpio_lock, flags); -+} -+ -+static irqreturn_t mlxbf2_gpio_irq_handler(int irq, void *ptr) -+{ -+ struct mlxbf2_gpio_context *gs = ptr; -+ struct gpio_chip *gc = &gs->gc; -+ unsigned long pending; -+ u32 level; -+ -+ pending = readl(gs->gpio_io + YU_GPIO_CAUSE_OR_CAUSE_EVTEN0); -+ writel(pending, gs->gpio_io + YU_GPIO_CAUSE_OR_CLRCAUSE); -+ -+ for_each_set_bit(level, &pending, gc->ngpio) { -+ int gpio_irq = irq_find_mapping(gc->irq.domain, level); -+ generic_handle_irq(gpio_irq); -+ } -+ -+ return IRQ_RETVAL(pending); -+} -+ -+static int -+mlxbf2_gpio_irq_set_type(struct irq_data *irqd, unsigned int type) -+{ -+ struct gpio_chip *gc = irq_data_get_irq_chip_data(irqd); -+ struct mlxbf2_gpio_context *gs = gpiochip_get_data(gc); -+ int offset = irqd_to_hwirq(irqd); -+ unsigned long flags; -+ bool fall = false; -+ bool rise = false; -+ u32 val; -+ -+ switch (type & IRQ_TYPE_SENSE_MASK) { -+ case IRQ_TYPE_EDGE_BOTH: -+ fall = true; -+ rise = true; -+ break; -+ case IRQ_TYPE_EDGE_RISING: -+ rise = true; -+ break; -+ case IRQ_TYPE_EDGE_FALLING: -+ fall = true; -+ break; -+ default: -+ return -EINVAL; -+ } -+ -+ spin_lock_irqsave(&gs->gc.bgpio_lock, flags); -+ if (fall) { -+ val = readl(gs->gpio_io + YU_GPIO_CAUSE_FALL_EN); -+ val |= BIT(offset); -+ writel(val, gs->gpio_io + YU_GPIO_CAUSE_FALL_EN); -+ } -+ -+ if (rise) { -+ val = readl(gs->gpio_io + YU_GPIO_CAUSE_RISE_EN); -+ val |= BIT(offset); -+ writel(val, gs->gpio_io + YU_GPIO_CAUSE_RISE_EN); -+ } -+ spin_unlock_irqrestore(&gs->gc.bgpio_lock, flags); -+ -+ return 0; -+} -+ - /* BlueField-2 GPIO driver initialization routine. */ - static int - mlxbf2_gpio_probe(struct platform_device *pdev) - { - struct mlxbf2_gpio_context *gs; - struct device *dev = &pdev->dev; -+ struct gpio_irq_chip *girq; - struct gpio_chip *gc; - unsigned int npins; -- int ret; -+ const char *name; -+ int ret, irq; -+ -+ name = dev_name(dev); - - gs = devm_kzalloc(dev, sizeof(*gs), GFP_KERNEL); - if (!gs) -@@ -266,6 +376,34 @@ mlxbf2_gpio_probe(struct platform_device *pdev) - gc->ngpio = npins; - gc->owner = THIS_MODULE; - -+ irq = platform_get_irq(pdev, 0); -+ if (irq >= 0) { -+ gs->irq_chip.name = name; -+ gs->irq_chip.irq_set_type = mlxbf2_gpio_irq_set_type; -+ gs->irq_chip.irq_enable = mlxbf2_gpio_irq_enable; -+ gs->irq_chip.irq_disable = mlxbf2_gpio_irq_disable; -+ -+ girq = &gs->gc.irq; -+ girq->chip = &gs->irq_chip; -+ girq->handler = handle_simple_irq; -+ girq->default_type = IRQ_TYPE_NONE; -+ /* This will let us handle the parent IRQ in the driver */ -+ girq->num_parents = 0; -+ girq->parents = NULL; -+ girq->parent_handler = NULL; -+ -+ /* -+ * Directly request the irq here instead of passing -+ * a flow-handler because the irq is shared. -+ */ -+ ret = devm_request_irq(dev, irq, mlxbf2_gpio_irq_handler, -+ IRQF_SHARED, name, gs); -+ if (ret) { -+ dev_err(dev, "failed to request IRQ"); -+ return ret; -+ } -+ } -+ - platform_set_drvdata(pdev, gs); - - ret = devm_gpiochip_add_data(dev, &gs->gc, gs); -@@ -320,5 +458,5 @@ static struct platform_driver mlxbf2_gpio_driver = { - module_platform_driver(mlxbf2_gpio_driver); - - MODULE_DESCRIPTION("Mellanox BlueField-2 GPIO Driver"); --MODULE_AUTHOR("Mellanox Technologies"); -+MODULE_AUTHOR("Asmaa Mnebhi "); - MODULE_LICENSE("GPL v2"); --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0250-UBUNTU-SAUCE-gpio-mlxbf2.c-support-driver-version.patch b/platform/mellanox/non-upstream-patches/patches/0250-UBUNTU-SAUCE-gpio-mlxbf2.c-support-driver-version.patch deleted file mode 100644 index 1bdc64da2822..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0250-UBUNTU-SAUCE-gpio-mlxbf2.c-support-driver-version.patch +++ /dev/null @@ -1,35 +0,0 @@ -From e71b4be56c799c407a4b8b08528dc3a1bb31cda3 Mon Sep 17 00:00:00 2001 -From: Asmaa Mnebhi -Date: Fri, 8 Jul 2022 16:56:40 -0400 -Subject: [PATCH backport 5.10 52/63] UBUNTU: SAUCE: gpio-mlxbf2.c: support - driver version - -BugLink: https://launchpad.net/bugs/1981108 - -Signed-off-by: Asmaa Mnebhi -Signed-off-by: Ike Panhc ---- - drivers/gpio/gpio-mlxbf2.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/drivers/gpio/gpio-mlxbf2.c b/drivers/gpio/gpio-mlxbf2.c -index 3d89912a0..cf9dbe8e5 100644 ---- a/drivers/gpio/gpio-mlxbf2.c -+++ b/drivers/gpio/gpio-mlxbf2.c -@@ -20,6 +20,8 @@ - #include - #include - -+#define DRV_VERSION "1.5" -+ - /* - * There are 3 YU GPIO blocks: - * gpio[0]: HOST_GPIO0->HOST_GPIO31 -@@ -460,3 +462,4 @@ module_platform_driver(mlxbf2_gpio_driver); - MODULE_DESCRIPTION("Mellanox BlueField-2 GPIO Driver"); - MODULE_AUTHOR("Asmaa Mnebhi "); - MODULE_LICENSE("GPL v2"); -+MODULE_VERSION(DRV_VERSION); --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0251-mmc-sdhci-of-dwcmshc-add-rockchip-platform-support.patch b/platform/mellanox/non-upstream-patches/patches/0251-mmc-sdhci-of-dwcmshc-add-rockchip-platform-support.patch deleted file mode 100644 index 0f4e702ba7dd..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0251-mmc-sdhci-of-dwcmshc-add-rockchip-platform-support.patch +++ /dev/null @@ -1,395 +0,0 @@ -From 6995d23f8b01b24dd6786413f9219334136b6d32 Mon Sep 17 00:00:00 2001 -From: Shawn Lin -Date: Tue, 16 Mar 2021 15:18:22 +0800 -Subject: [PATCH backport 5.10 53/63] mmc: sdhci-of-dwcmshc: add rockchip - platform support - -sdhci based synopsys MMC IP is also used on some rockchip platforms, -so add a basic support here. - -Signed-off-by: Shawn Lin -Link: https://lore.kernel.org/r/1615879102-45919-3-git-send-email-shawn.lin@rock-chips.com -Signed-off-by: Ulf Hansson ---- - drivers/mmc/host/sdhci-of-dwcmshc.c | 261 +++++++++++++++++++++++++++- - 1 file changed, 253 insertions(+), 8 deletions(-) - -diff --git a/drivers/mmc/host/sdhci-of-dwcmshc.c b/drivers/mmc/host/sdhci-of-dwcmshc.c -index 59d8d96ce..06873686d 100644 ---- a/drivers/mmc/host/sdhci-of-dwcmshc.c -+++ b/drivers/mmc/host/sdhci-of-dwcmshc.c -@@ -9,9 +9,11 @@ - - #include - #include -+#include - #include - #include - #include -+#include - #include - - #include "sdhci-pltfm.h" -@@ -21,11 +23,52 @@ - /* DWCMSHC specific Mode Select value */ - #define DWCMSHC_CTRL_HS400 0x7 - -+/* DWC IP vendor area 1 pointer */ -+#define DWCMSHC_P_VENDOR_AREA1 0xe8 -+#define DWCMSHC_AREA1_MASK GENMASK(11, 0) -+/* Offset inside the vendor area 1 */ -+#define DWCMSHC_HOST_CTRL3 0x8 -+#define DWCMSHC_EMMC_CONTROL 0x2c -+#define DWCMSHC_ENHANCED_STROBE BIT(8) -+#define DWCMSHC_EMMC_ATCTRL 0x40 -+ -+/* Rockchip specific Registers */ -+#define DWCMSHC_EMMC_DLL_CTRL 0x800 -+#define DWCMSHC_EMMC_DLL_RXCLK 0x804 -+#define DWCMSHC_EMMC_DLL_TXCLK 0x808 -+#define DWCMSHC_EMMC_DLL_STRBIN 0x80c -+#define DLL_STRBIN_TAPNUM_FROM_SW BIT(24) -+#define DWCMSHC_EMMC_DLL_STATUS0 0x840 -+#define DWCMSHC_EMMC_DLL_START BIT(0) -+#define DWCMSHC_EMMC_DLL_LOCKED BIT(8) -+#define DWCMSHC_EMMC_DLL_TIMEOUT BIT(9) -+#define DWCMSHC_EMMC_DLL_RXCLK_SRCSEL 29 -+#define DWCMSHC_EMMC_DLL_START_POINT 16 -+#define DWCMSHC_EMMC_DLL_INC 8 -+#define DWCMSHC_EMMC_DLL_DLYENA BIT(27) -+#define DLL_TXCLK_TAPNUM_DEFAULT 0x8 -+#define DLL_STRBIN_TAPNUM_DEFAULT 0x8 -+#define DLL_TXCLK_TAPNUM_FROM_SW BIT(24) -+#define DLL_RXCLK_NO_INVERTER 1 -+#define DLL_RXCLK_INVERTER 0 -+#define DLL_LOCK_WO_TMOUT(x) \ -+ ((((x) & DWCMSHC_EMMC_DLL_LOCKED) == DWCMSHC_EMMC_DLL_LOCKED) && \ -+ (((x) & DWCMSHC_EMMC_DLL_TIMEOUT) == 0)) -+#define RK3568_MAX_CLKS 3 -+ - #define BOUNDARY_OK(addr, len) \ - ((addr | (SZ_128M - 1)) == ((addr + len - 1) | (SZ_128M - 1))) - -+struct rk3568_priv { -+ /* Rockchip specified optional clocks */ -+ struct clk_bulk_data rockchip_clks[RK3568_MAX_CLKS]; -+ u8 txclk_tapnum; -+}; -+ - struct dwcmshc_priv { - struct clk *bus_clk; -+ int vendor_specific_area1; /* P_VENDOR_SPECIFIC_AREA reg */ -+ void *priv; /* pointer to SoC private stuff */ - }; - - /* -@@ -100,6 +143,107 @@ static void dwcmshc_set_uhs_signaling(struct sdhci_host *host, - sdhci_writew(host, ctrl_2, SDHCI_HOST_CONTROL2); - } - -+static void dwcmshc_hs400_enhanced_strobe(struct mmc_host *mmc, -+ struct mmc_ios *ios) -+{ -+ u32 vendor; -+ struct sdhci_host *host = mmc_priv(mmc); -+ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); -+ struct dwcmshc_priv *priv = sdhci_pltfm_priv(pltfm_host); -+ int reg = priv->vendor_specific_area1 + DWCMSHC_EMMC_CONTROL; -+ -+ vendor = sdhci_readl(host, reg); -+ if (ios->enhanced_strobe) -+ vendor |= DWCMSHC_ENHANCED_STROBE; -+ else -+ vendor &= ~DWCMSHC_ENHANCED_STROBE; -+ -+ sdhci_writel(host, vendor, reg); -+} -+ -+static void dwcmshc_rk3568_set_clock(struct sdhci_host *host, unsigned int clock) -+{ -+ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); -+ struct dwcmshc_priv *dwc_priv = sdhci_pltfm_priv(pltfm_host); -+ struct rk3568_priv *priv = dwc_priv->priv; -+ u8 txclk_tapnum = DLL_TXCLK_TAPNUM_DEFAULT; -+ u32 extra, reg; -+ int err; -+ -+ host->mmc->actual_clock = 0; -+ -+ /* -+ * DO NOT TOUCH THIS SETTING. RX clk inverter unit is enabled -+ * by default, but it shouldn't be enabled. We should anyway -+ * disable it before issuing any cmds. -+ */ -+ extra = DWCMSHC_EMMC_DLL_DLYENA | -+ DLL_RXCLK_NO_INVERTER << DWCMSHC_EMMC_DLL_RXCLK_SRCSEL; -+ sdhci_writel(host, extra, DWCMSHC_EMMC_DLL_RXCLK); -+ -+ if (clock == 0) -+ return; -+ -+ /* Rockchip platform only support 375KHz for identify mode */ -+ if (clock <= 400000) -+ clock = 375000; -+ -+ err = clk_set_rate(pltfm_host->clk, clock); -+ if (err) -+ dev_err(mmc_dev(host->mmc), "fail to set clock %d", clock); -+ -+ sdhci_set_clock(host, clock); -+ -+ /* Disable cmd conflict check */ -+ reg = dwc_priv->vendor_specific_area1 + DWCMSHC_HOST_CTRL3; -+ extra = sdhci_readl(host, reg); -+ extra &= ~BIT(0); -+ sdhci_writel(host, extra, reg); -+ -+ if (clock <= 400000) { -+ /* Disable DLL to reset sample clock */ -+ sdhci_writel(host, 0, DWCMSHC_EMMC_DLL_CTRL); -+ return; -+ } -+ -+ /* Reset DLL */ -+ sdhci_writel(host, BIT(1), DWCMSHC_EMMC_DLL_CTRL); -+ udelay(1); -+ sdhci_writel(host, 0x0, DWCMSHC_EMMC_DLL_CTRL); -+ -+ /* Init DLL settings */ -+ extra = 0x5 << DWCMSHC_EMMC_DLL_START_POINT | -+ 0x2 << DWCMSHC_EMMC_DLL_INC | -+ DWCMSHC_EMMC_DLL_START; -+ sdhci_writel(host, extra, DWCMSHC_EMMC_DLL_CTRL); -+ err = readl_poll_timeout(host->ioaddr + DWCMSHC_EMMC_DLL_STATUS0, -+ extra, DLL_LOCK_WO_TMOUT(extra), 1, -+ 500 * USEC_PER_MSEC); -+ if (err) { -+ dev_err(mmc_dev(host->mmc), "DLL lock timeout!\n"); -+ return; -+ } -+ -+ extra = 0x1 << 16 | /* tune clock stop en */ -+ 0x2 << 17 | /* pre-change delay */ -+ 0x3 << 19; /* post-change delay */ -+ sdhci_writel(host, extra, dwc_priv->vendor_specific_area1 + DWCMSHC_EMMC_ATCTRL); -+ -+ if (host->mmc->ios.timing == MMC_TIMING_MMC_HS200 || -+ host->mmc->ios.timing == MMC_TIMING_MMC_HS400) -+ txclk_tapnum = priv->txclk_tapnum; -+ -+ extra = DWCMSHC_EMMC_DLL_DLYENA | -+ DLL_TXCLK_TAPNUM_FROM_SW | -+ txclk_tapnum; -+ sdhci_writel(host, extra, DWCMSHC_EMMC_DLL_TXCLK); -+ -+ extra = DWCMSHC_EMMC_DLL_DLYENA | -+ DLL_STRBIN_TAPNUM_DEFAULT | -+ DLL_STRBIN_TAPNUM_FROM_SW; -+ sdhci_writel(host, extra, DWCMSHC_EMMC_DLL_STRBIN); -+} -+ - static const struct sdhci_ops sdhci_dwcmshc_ops = { - .set_clock = sdhci_set_clock, - .set_bus_width = sdhci_set_bus_width, -@@ -109,21 +253,93 @@ static const struct sdhci_ops sdhci_dwcmshc_ops = { - .adma_write_desc = dwcmshc_adma_write_desc, - }; - -+static const struct sdhci_ops sdhci_dwcmshc_rk3568_ops = { -+ .set_clock = dwcmshc_rk3568_set_clock, -+ .set_bus_width = sdhci_set_bus_width, -+ .set_uhs_signaling = dwcmshc_set_uhs_signaling, -+ .get_max_clock = sdhci_pltfm_clk_get_max_clock, -+ .reset = sdhci_reset, -+ .adma_write_desc = dwcmshc_adma_write_desc, -+}; -+ - static const struct sdhci_pltfm_data sdhci_dwcmshc_pdata = { - .ops = &sdhci_dwcmshc_ops, - .quirks = SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN, - .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN, - }; - -+static const struct sdhci_pltfm_data sdhci_dwcmshc_rk3568_pdata = { -+ .ops = &sdhci_dwcmshc_rk3568_ops, -+ .quirks = SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN | -+ SDHCI_QUIRK_BROKEN_TIMEOUT_VAL, -+ .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN | -+ SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN, -+}; -+ -+static int dwcmshc_rk3568_init(struct sdhci_host *host, struct dwcmshc_priv *dwc_priv) -+{ -+ int err; -+ struct rk3568_priv *priv = dwc_priv->priv; -+ -+ priv->rockchip_clks[0].id = "axi"; -+ priv->rockchip_clks[1].id = "block"; -+ priv->rockchip_clks[2].id = "timer"; -+ err = devm_clk_bulk_get_optional(mmc_dev(host->mmc), RK3568_MAX_CLKS, -+ priv->rockchip_clks); -+ if (err) { -+ dev_err(mmc_dev(host->mmc), "failed to get clocks %d\n", err); -+ return err; -+ } -+ -+ err = clk_bulk_prepare_enable(RK3568_MAX_CLKS, priv->rockchip_clks); -+ if (err) { -+ dev_err(mmc_dev(host->mmc), "failed to enable clocks %d\n", err); -+ return err; -+ } -+ -+ if (of_property_read_u8(mmc_dev(host->mmc)->of_node, "rockchip,txclk-tapnum", -+ &priv->txclk_tapnum)) -+ priv->txclk_tapnum = DLL_TXCLK_TAPNUM_DEFAULT; -+ -+ /* Disable cmd conflict check */ -+ sdhci_writel(host, 0x0, dwc_priv->vendor_specific_area1 + DWCMSHC_HOST_CTRL3); -+ /* Reset previous settings */ -+ sdhci_writel(host, 0, DWCMSHC_EMMC_DLL_TXCLK); -+ sdhci_writel(host, 0, DWCMSHC_EMMC_DLL_STRBIN); -+ -+ return 0; -+} -+ -+static const struct of_device_id sdhci_dwcmshc_dt_ids[] = { -+ { -+ .compatible = "rockchip,rk3568-dwcmshc", -+ .data = &sdhci_dwcmshc_rk3568_pdata, -+ }, -+ { -+ .compatible = "snps,dwcmshc-sdhci", -+ .data = &sdhci_dwcmshc_pdata, -+ }, -+ {}, -+}; -+MODULE_DEVICE_TABLE(of, sdhci_dwcmshc_dt_ids); -+ - static int dwcmshc_probe(struct platform_device *pdev) - { - struct sdhci_pltfm_host *pltfm_host; - struct sdhci_host *host; - struct dwcmshc_priv *priv; -+ struct rk3568_priv *rk_priv = NULL; -+ const struct sdhci_pltfm_data *pltfm_data; - int err; - u32 extra; - -- host = sdhci_pltfm_init(pdev, &sdhci_dwcmshc_pdata, -+ pltfm_data = of_device_get_match_data(&pdev->dev); -+ if (!pltfm_data) { -+ dev_err(&pdev->dev, "Error: No device match data found\n"); -+ return -ENODEV; -+ } -+ -+ host = sdhci_pltfm_init(pdev, pltfm_data, - sizeof(struct dwcmshc_priv)); - if (IS_ERR(host)) - return PTR_ERR(host); -@@ -159,7 +375,23 @@ static int dwcmshc_probe(struct platform_device *pdev) - - sdhci_get_of_property(pdev); - -+ priv->vendor_specific_area1 = -+ sdhci_readl(host, DWCMSHC_P_VENDOR_AREA1) & DWCMSHC_AREA1_MASK; -+ - host->mmc_host_ops.request = dwcmshc_request; -+ host->mmc_host_ops.hs400_enhanced_strobe = dwcmshc_hs400_enhanced_strobe; -+ -+ if (pltfm_data == &sdhci_dwcmshc_rk3568_pdata) { -+ rk_priv = devm_kzalloc(&pdev->dev, sizeof(struct rk3568_priv), GFP_KERNEL); -+ if (!rk_priv) -+ goto err_clk; -+ -+ priv->priv = rk_priv; -+ -+ err = dwcmshc_rk3568_init(host, priv); -+ if (err) -+ goto err_clk; -+ } - - err = sdhci_add_host(host); - if (err) -@@ -170,6 +402,9 @@ static int dwcmshc_probe(struct platform_device *pdev) - err_clk: - clk_disable_unprepare(pltfm_host->clk); - clk_disable_unprepare(priv->bus_clk); -+ if (rk_priv) -+ clk_bulk_disable_unprepare(RK3568_MAX_CLKS, -+ rk_priv->rockchip_clks); - free_pltfm: - sdhci_pltfm_free(pdev); - return err; -@@ -180,12 +415,15 @@ static int dwcmshc_remove(struct platform_device *pdev) - struct sdhci_host *host = platform_get_drvdata(pdev); - struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); - struct dwcmshc_priv *priv = sdhci_pltfm_priv(pltfm_host); -+ struct rk3568_priv *rk_priv = priv->priv; - - sdhci_remove_host(host, 0); - - clk_disable_unprepare(pltfm_host->clk); - clk_disable_unprepare(priv->bus_clk); -- -+ if (rk_priv) -+ clk_bulk_disable_unprepare(RK3568_MAX_CLKS, -+ rk_priv->rockchip_clks); - sdhci_pltfm_free(pdev); - - return 0; -@@ -197,6 +435,7 @@ static int dwcmshc_suspend(struct device *dev) - struct sdhci_host *host = dev_get_drvdata(dev); - struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); - struct dwcmshc_priv *priv = sdhci_pltfm_priv(pltfm_host); -+ struct rk3568_priv *rk_priv = priv->priv; - int ret; - - ret = sdhci_suspend_host(host); -@@ -207,6 +446,10 @@ static int dwcmshc_suspend(struct device *dev) - if (!IS_ERR(priv->bus_clk)) - clk_disable_unprepare(priv->bus_clk); - -+ if (rk_priv) -+ clk_bulk_disable_unprepare(RK3568_MAX_CLKS, -+ rk_priv->rockchip_clks); -+ - return ret; - } - -@@ -215,6 +458,7 @@ static int dwcmshc_resume(struct device *dev) - struct sdhci_host *host = dev_get_drvdata(dev); - struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); - struct dwcmshc_priv *priv = sdhci_pltfm_priv(pltfm_host); -+ struct rk3568_priv *rk_priv = priv->priv; - int ret; - - ret = clk_prepare_enable(pltfm_host->clk); -@@ -227,18 +471,19 @@ static int dwcmshc_resume(struct device *dev) - return ret; - } - -+ if (rk_priv) { -+ ret = clk_bulk_prepare_enable(RK3568_MAX_CLKS, -+ rk_priv->rockchip_clks); -+ if (ret) -+ return ret; -+ } -+ - return sdhci_resume_host(host); - } - #endif - - static SIMPLE_DEV_PM_OPS(dwcmshc_pmops, dwcmshc_suspend, dwcmshc_resume); - --static const struct of_device_id sdhci_dwcmshc_dt_ids[] = { -- { .compatible = "snps,dwcmshc-sdhci" }, -- {} --}; --MODULE_DEVICE_TABLE(of, sdhci_dwcmshc_dt_ids); -- - static struct platform_driver sdhci_dwcmshc_driver = { - .driver = { - .name = "sdhci-dwcmshc", --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0252-mmc-sdhci-of-dwcmshc-add-ACPI-support-for-BlueField-.patch b/platform/mellanox/non-upstream-patches/patches/0252-mmc-sdhci-of-dwcmshc-add-ACPI-support-for-BlueField-.patch deleted file mode 100644 index e6d3107e84c1..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0252-mmc-sdhci-of-dwcmshc-add-ACPI-support-for-BlueField-.patch +++ /dev/null @@ -1,130 +0,0 @@ -From 44448fdaef6bbd1b1fd42e41b072d4960d163708 Mon Sep 17 00:00:00 2001 -From: Liming Sun -Date: Mon, 22 Mar 2021 18:46:51 -0400 -Subject: [PATCH backport 5.10 54/63] mmc: sdhci-of-dwcmshc: add ACPI support - for BlueField-3 SoC - -This commit adds ACPI support in the sdhci-of-dwcmshc driver for -BlueField-3 SoC. It has changes to only use the clock hierarchy -for Deviec Tree since the clk is not supported by ACPI. Instead, -ACPI can define 'clock-frequency' which is parsed by existing -sdhci_get_property(). This clock value will be returned in function -dwcmshc_get_max_clock(). - -Signed-off-by: Liming Sun -Reviewed-by: Khalil Blaiech -Link: https://lore.kernel.org/r/1616453211-275165-1-git-send-email-limings@nvidia.com -Signed-off-by: Ulf Hansson ---- - drivers/mmc/host/sdhci-of-dwcmshc.c | 50 +++++++++++++++++++++-------- - 1 file changed, 36 insertions(+), 14 deletions(-) - -diff --git a/drivers/mmc/host/sdhci-of-dwcmshc.c b/drivers/mmc/host/sdhci-of-dwcmshc.c -index 06873686d..1113a56fe 100644 ---- a/drivers/mmc/host/sdhci-of-dwcmshc.c -+++ b/drivers/mmc/host/sdhci-of-dwcmshc.c -@@ -7,6 +7,7 @@ - * Author: Jisheng Zhang - */ - -+#include - #include - #include - #include -@@ -94,6 +95,16 @@ static void dwcmshc_adma_write_desc(struct sdhci_host *host, void **desc, - sdhci_adma_write_desc(host, desc, addr, len, cmd); - } - -+static unsigned int dwcmshc_get_max_clock(struct sdhci_host *host) -+{ -+ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); -+ -+ if (pltfm_host->clk) -+ return sdhci_pltfm_clk_get_max_clock(host); -+ else -+ return pltfm_host->clock; -+} -+ - static void dwcmshc_check_auto_cmd23(struct mmc_host *mmc, - struct mmc_request *mrq) - { -@@ -248,7 +259,7 @@ static const struct sdhci_ops sdhci_dwcmshc_ops = { - .set_clock = sdhci_set_clock, - .set_bus_width = sdhci_set_bus_width, - .set_uhs_signaling = dwcmshc_set_uhs_signaling, -- .get_max_clock = sdhci_pltfm_clk_get_max_clock, -+ .get_max_clock = dwcmshc_get_max_clock, - .reset = sdhci_reset, - .adma_write_desc = dwcmshc_adma_write_desc, - }; -@@ -323,8 +334,16 @@ static const struct of_device_id sdhci_dwcmshc_dt_ids[] = { - }; - MODULE_DEVICE_TABLE(of, sdhci_dwcmshc_dt_ids); - -+#ifdef CONFIG_ACPI -+static const struct acpi_device_id sdhci_dwcmshc_acpi_ids[] = { -+ { .id = "MLNXBF30" }, -+ {} -+}; -+#endif -+ - static int dwcmshc_probe(struct platform_device *pdev) - { -+ struct device *dev = &pdev->dev; - struct sdhci_pltfm_host *pltfm_host; - struct sdhci_host *host; - struct dwcmshc_priv *priv; -@@ -347,7 +366,7 @@ static int dwcmshc_probe(struct platform_device *pdev) - /* - * extra adma table cnt for cross 128M boundary handling. - */ -- extra = DIV_ROUND_UP_ULL(dma_get_required_mask(&pdev->dev), SZ_128M); -+ extra = DIV_ROUND_UP_ULL(dma_get_required_mask(dev), SZ_128M); - if (extra > SDHCI_MAX_SEGS) - extra = SDHCI_MAX_SEGS; - host->adma_table_cnt += extra; -@@ -355,19 +374,21 @@ static int dwcmshc_probe(struct platform_device *pdev) - pltfm_host = sdhci_priv(host); - priv = sdhci_pltfm_priv(pltfm_host); - -- pltfm_host->clk = devm_clk_get(&pdev->dev, "core"); -- if (IS_ERR(pltfm_host->clk)) { -- err = PTR_ERR(pltfm_host->clk); -- dev_err(&pdev->dev, "failed to get core clk: %d\n", err); -- goto free_pltfm; -- } -- err = clk_prepare_enable(pltfm_host->clk); -- if (err) -- goto free_pltfm; -+ if (dev->of_node) { -+ pltfm_host->clk = devm_clk_get(dev, "core"); -+ if (IS_ERR(pltfm_host->clk)) { -+ err = PTR_ERR(pltfm_host->clk); -+ dev_err(dev, "failed to get core clk: %d\n", err); -+ goto free_pltfm; -+ } -+ err = clk_prepare_enable(pltfm_host->clk); -+ if (err) -+ goto free_pltfm; - -- priv->bus_clk = devm_clk_get(&pdev->dev, "bus"); -- if (!IS_ERR(priv->bus_clk)) -- clk_prepare_enable(priv->bus_clk); -+ priv->bus_clk = devm_clk_get(dev, "bus"); -+ if (!IS_ERR(priv->bus_clk)) -+ clk_prepare_enable(priv->bus_clk); -+ } - - err = mmc_of_parse(host->mmc); - if (err) -@@ -489,6 +510,7 @@ static struct platform_driver sdhci_dwcmshc_driver = { - .name = "sdhci-dwcmshc", - .probe_type = PROBE_PREFER_ASYNCHRONOUS, - .of_match_table = sdhci_dwcmshc_dt_ids, -+ .acpi_match_table = ACPI_PTR(sdhci_dwcmshc_acpi_ids), - .pm = &dwcmshc_pmops, - }, - .probe = dwcmshc_probe, --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0253-mmc-sdhci-of-dwcmshc-fix-error-return-code-in-dwcmsh.patch b/platform/mellanox/non-upstream-patches/patches/0253-mmc-sdhci-of-dwcmshc-fix-error-return-code-in-dwcmsh.patch deleted file mode 100644 index 7f49a35cc827..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0253-mmc-sdhci-of-dwcmshc-fix-error-return-code-in-dwcmsh.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 72d369a9be4bc4b92ab1e006dc36c612f0305b46 Mon Sep 17 00:00:00 2001 -From: Wei Yongjun -Date: Tue, 23 Mar 2021 11:29:56 +0000 -Subject: [PATCH backport 5.10 55/63] mmc: sdhci-of-dwcmshc: fix error return - code in dwcmshc_probe() - -Fix to return negative error code -ENOMEM from the error handling -case instead of 0, as done elsewhere in this function. - -Fixes: c2c4da37837e ("mmc: sdhci-of-dwcmshc: add rockchip platform support") -Reported-by: Hulk Robot -Signed-off-by: Wei Yongjun -Link: https://lore.kernel.org/r/20210323112956.1016884-1-weiyongjun1@huawei.com -Signed-off-by: Ulf Hansson ---- - drivers/mmc/host/sdhci-of-dwcmshc.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/drivers/mmc/host/sdhci-of-dwcmshc.c b/drivers/mmc/host/sdhci-of-dwcmshc.c -index 1113a56fe..34d26e388 100644 ---- a/drivers/mmc/host/sdhci-of-dwcmshc.c -+++ b/drivers/mmc/host/sdhci-of-dwcmshc.c -@@ -404,8 +404,10 @@ static int dwcmshc_probe(struct platform_device *pdev) - - if (pltfm_data == &sdhci_dwcmshc_rk3568_pdata) { - rk_priv = devm_kzalloc(&pdev->dev, sizeof(struct rk3568_priv), GFP_KERNEL); -- if (!rk_priv) -+ if (!rk_priv) { -+ err = -ENOMEM; - goto err_clk; -+ } - - priv->priv = rk_priv; - --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0254-mmc-sdhci-of-dwcmshc-set-MMC_CAP_WAIT_WHILE_BUSY.patch b/platform/mellanox/non-upstream-patches/patches/0254-mmc-sdhci-of-dwcmshc-set-MMC_CAP_WAIT_WHILE_BUSY.patch deleted file mode 100644 index 04b8970ebb0e..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0254-mmc-sdhci-of-dwcmshc-set-MMC_CAP_WAIT_WHILE_BUSY.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 17e98239da6fd921a76cbee7ac8dcc3c437ad5d6 Mon Sep 17 00:00:00 2001 -From: Jisheng Zhang -Date: Wed, 24 Mar 2021 15:47:21 +0800 -Subject: [PATCH backport 5.10 56/63] mmc: sdhci-of-dwcmshc: set - MMC_CAP_WAIT_WHILE_BUSY - -The host supports HW busy detection of the device busy signaling over -dat0 line. Set MMC_CAP_wAIT_WHILE_BUSY host capability. - -Signed-off-by: Jisheng Zhang -Link: https://lore.kernel.org/r/20210324154703.69f97fde@xhacker.debian -Signed-off-by: Ulf Hansson ---- - drivers/mmc/host/sdhci-of-dwcmshc.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/drivers/mmc/host/sdhci-of-dwcmshc.c b/drivers/mmc/host/sdhci-of-dwcmshc.c -index 34d26e388..bac874ab0 100644 ---- a/drivers/mmc/host/sdhci-of-dwcmshc.c -+++ b/drivers/mmc/host/sdhci-of-dwcmshc.c -@@ -416,6 +416,8 @@ static int dwcmshc_probe(struct platform_device *pdev) - goto err_clk; - } - -+ host->mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY; -+ - err = sdhci_add_host(host); - if (err) - goto err_clk; --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0255-mmc-sdhci-of-dwcmshc-Re-enable-support-for-the-BlueF.patch b/platform/mellanox/non-upstream-patches/patches/0255-mmc-sdhci-of-dwcmshc-Re-enable-support-for-the-BlueF.patch deleted file mode 100644 index 6f5e6905111a..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0255-mmc-sdhci-of-dwcmshc-Re-enable-support-for-the-BlueF.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 990bb46dc1f0fd103e9d01d8e87c046fbe879d53 Mon Sep 17 00:00:00 2001 -From: Liming Sun -Date: Tue, 9 Aug 2022 13:37:42 -0400 -Subject: [PATCH] mmc: sdhci-of-dwcmshc: Re-enable support for the BlueField-3 - SoC -X-NVConfidentiality: public - -BugLink: https://bugs.launchpad.net/bugs/1991831 - -[ Upstream commit a0753ef66c34c1739580219dca664eda648164b7 ] - -The commit 08f3dff799d4 (mmc: sdhci-of-dwcmshc: add rockchip platform -support") introduces the use of_device_get_match_data() to check for some -chips. Unfortunately, it also breaks the BlueField-3 FW, which uses ACPI. - -To fix the problem, let's add the ACPI match data and the corresponding -quirks to re-enable the support for the BlueField-3 SoC. - -Reviewed-by: David Woods -Signed-off-by: Liming Sun -Acked-by: Adrian Hunter -Fixes: 08f3dff799d4 ("mmc: sdhci-of-dwcmshc: add rockchip platform support") -Cc: stable@vger.kernel.org -Link: https://lore.kernel.org/r/20220809173742.178440-1-limings@nvidia.com -[Ulf: Clarified the commit message a bit] -Signed-off-by: Ulf Hansson -Signed-off-by: Sasha Levin -Signed-off-by: Kamal Mostafa -Signed-off-by: Stefan Bader ---- - drivers/mmc/host/sdhci-of-dwcmshc.c | 16 ++++++++++++++-- - 1 file changed, 14 insertions(+), 2 deletions(-) - -diff --git a/drivers/mmc/host/sdhci-of-dwcmshc.c b/drivers/mmc/host/sdhci-of-dwcmshc.c -index bac874ab0..a0c73ddaa 100644 ---- a/drivers/mmc/host/sdhci-of-dwcmshc.c -+++ b/drivers/mmc/host/sdhci-of-dwcmshc.c -@@ -279,6 +279,15 @@ static const struct sdhci_pltfm_data sdhci_dwcmshc_pdata = { - .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN, - }; - -+#ifdef CONFIG_ACPI -+static const struct sdhci_pltfm_data sdhci_dwcmshc_bf3_pdata = { -+ .ops = &sdhci_dwcmshc_ops, -+ .quirks = SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN, -+ .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN | -+ SDHCI_QUIRK2_ACMD23_BROKEN, -+}; -+#endif -+ - static const struct sdhci_pltfm_data sdhci_dwcmshc_rk3568_pdata = { - .ops = &sdhci_dwcmshc_rk3568_ops, - .quirks = SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN | -@@ -336,7 +345,10 @@ MODULE_DEVICE_TABLE(of, sdhci_dwcmshc_dt_ids); - - #ifdef CONFIG_ACPI - static const struct acpi_device_id sdhci_dwcmshc_acpi_ids[] = { -- { .id = "MLNXBF30" }, -+ { -+ .id = "MLNXBF30", -+ .driver_data = (kernel_ulong_t)&sdhci_dwcmshc_bf3_pdata, -+ }, - {} - }; - #endif -@@ -352,7 +364,7 @@ static int dwcmshc_probe(struct platform_device *pdev) - int err; - u32 extra; - -- pltfm_data = of_device_get_match_data(&pdev->dev); -+ pltfm_data = device_get_match_data(&pdev->dev); - if (!pltfm_data) { - dev_err(&pdev->dev, "Error: No device match data found\n"); - return -ENODEV; --- -2.14.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0256-UBUNTU-SAUCE-Support-BlueField-3-GPIO-driver.patch b/platform/mellanox/non-upstream-patches/patches/0256-UBUNTU-SAUCE-Support-BlueField-3-GPIO-driver.patch deleted file mode 100644 index 976dadb851fb..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0256-UBUNTU-SAUCE-Support-BlueField-3-GPIO-driver.patch +++ /dev/null @@ -1,402 +0,0 @@ -From a97cbefdc2d699a53b9717f4c11aadba176b7987 Mon Sep 17 00:00:00 2001 -From: Asmaa Mnebhi -Date: Thu, 27 Oct 2022 12:36:19 -0400 -Subject: [PATCH 02/12] UBUNTU: SAUCE: Support BlueField-3 GPIO driver -X-NVConfidentiality: public - -BugLink: https://bugs.launchpad.net/bugs/1994897 - -This patch adds support for the BlueField-3 SoC GPIO driver which allows: -- setting certain GPIOs as interrupts from other dependent drivers -- ability to manipulate certain GPIO values from user space - -Signed-off-by: Asmaa Mnebhi -Acked-by: Tim Gardner -Acked-by: Cory Todd -Signed-off-by: Bartlomiej Zolnierkiewicz ---- - drivers/gpio/Kconfig | 7 + - drivers/gpio/Makefile | 1 + - drivers/gpio/gpio-mlxbf3.c | 340 +++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 348 insertions(+) - create mode 100644 drivers/gpio/gpio-mlxbf3.c - -diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig -index d1300fc00..bf1b2b787 100644 ---- a/drivers/gpio/Kconfig -+++ b/drivers/gpio/Kconfig -@@ -1459,6 +1459,13 @@ config GPIO_MLXBF2 - help - Say Y here if you want GPIO support on Mellanox BlueField 2 SoC. - -+config GPIO_MLXBF3 -+ tristate "Mellanox BlueField 3 SoC GPIO" -+ depends on (MELLANOX_PLATFORM && ARM64 && ACPI) || (64BIT && COMPILE_TEST) -+ select GPIO_GENERIC -+ help -+ Say Y here if you want GPIO support on Mellanox BlueField 3 SoC. -+ - config GPIO_ML_IOH - tristate "OKI SEMICONDUCTOR ML7213 IOH GPIO support" - depends on X86 || COMPILE_TEST -diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile -index 09dada80a..f11a9cf0b 100644 ---- a/drivers/gpio/Makefile -+++ b/drivers/gpio/Makefile -@@ -96,6 +96,7 @@ obj-$(CONFIG_GPIO_MERRIFIELD) += gpio-merrifield.o - obj-$(CONFIG_GPIO_ML_IOH) += gpio-ml-ioh.o - obj-$(CONFIG_GPIO_MLXBF) += gpio-mlxbf.o - obj-$(CONFIG_GPIO_MLXBF2) += gpio-mlxbf2.o -+obj-$(CONFIG_GPIO_MLXBF3) += gpio-mlxbf3.o - obj-$(CONFIG_GPIO_MM_LANTIQ) += gpio-mm-lantiq.o - obj-$(CONFIG_GPIO_MOCKUP) += gpio-mockup.o - obj-$(CONFIG_GPIO_MOXTET) += gpio-moxtet.o -diff --git a/drivers/gpio/gpio-mlxbf3.c b/drivers/gpio/gpio-mlxbf3.c -new file mode 100644 -index 000000000..45f0946ac ---- /dev/null -+++ b/drivers/gpio/gpio-mlxbf3.c -@@ -0,0 +1,340 @@ -+// SPDX-License-Identifier: GPL-2.0-only or BSD-3-Clause -+ -+/* -+ * Copyright (C) 2020-2021 NVIDIA CORPORATION & AFFILIATES -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#define DRV_VERSION "1.0" -+ -+/* -+ * There are 2 YU GPIO blocks: -+ * gpio[0]: HOST_GPIO0->HOST_GPIO31 -+ * gpio[1]: HOST_GPIO32->HOST_GPIO55 -+ */ -+#define MLXBF3_GPIO_MAX_PINS_PER_BLOCK 32 -+ -+/* -+ * fw_gpio[x] block registers and their offset -+ */ -+#define YU_GPIO_FW_CONTROL_SET 0x00 -+#define YU_GPIO_FW_OUTPUT_ENABLE_SET 0x04 -+#define YU_GPIO_FW_DATA_OUT_SET 0x08 -+#define YU_GPIO_FW_CONTROL_CLEAR 0x14 -+#define YU_GPIO_FW_OUTPUT_ENABLE_CLEAR 0x18 -+#define YU_GPIO_FW_DATA_OUT_CLEAR 0x1c -+#define YU_GPIO_CAUSE_RISE_EN 0x28 -+#define YU_GPIO_CAUSE_FALL_EN 0x2c -+#define YU_GPIO_READ_DATA_IN 0x30 -+#define YU_GPIO_READ_OUTPUT_ENABLE 0x34 -+#define YU_GPIO_READ_DATA_OUT 0x38 -+#define YU_GPIO_READ_FW_CONTROL 0x44 -+ -+#define YU_GPIO_CAUSE_OR_CAUSE_EVTEN0 0x00 -+#define YU_GPIO_CAUSE_OR_EVTEN0 0x14 -+#define YU_GPIO_CAUSE_OR_CLRCAUSE 0x18 -+ -+/* BlueField-3 gpio block context structure. */ -+struct mlxbf3_gpio_context { -+ struct gpio_chip gc; -+ struct irq_chip irq_chip; -+ -+ /* YU GPIO blocks address */ -+ void __iomem *gpio_io; -+ -+ /* YU GPIO cause block address */ -+ void __iomem *gpio_cause_io; -+ -+ uint32_t ctrl_gpio_mask; -+}; -+ -+static void mlxbf3_gpio_set(struct gpio_chip *chip, unsigned int offset, int val) -+{ -+ struct mlxbf3_gpio_context *gs = gpiochip_get_data(chip); -+ -+ /* Software can only control GPIO pins defined by ctrl_gpio_mask */ -+ if (!(BIT(offset) & gs->ctrl_gpio_mask)) -+ return; -+ -+ if (val) { -+ writel(BIT(offset), gs->gpio_io + YU_GPIO_FW_DATA_OUT_SET); -+ } else { -+ writel(BIT(offset), gs->gpio_io + YU_GPIO_FW_DATA_OUT_CLEAR); -+ } -+ -+ wmb(); -+ -+ /* This needs to be done last to avoid glitches */ -+ writel(BIT(offset), gs->gpio_io + YU_GPIO_FW_CONTROL_SET); -+} -+ -+static int mlxbf3_gpio_direction_input(struct gpio_chip *chip, -+ unsigned int offset) -+{ -+ struct mlxbf3_gpio_context *gs = gpiochip_get_data(chip); -+ unsigned long flags; -+ -+ spin_lock_irqsave(&gs->gc.bgpio_lock, flags); -+ -+ writel(BIT(offset), gs->gpio_io + YU_GPIO_FW_OUTPUT_ENABLE_CLEAR); -+ writel(BIT(offset), gs->gpio_io + YU_GPIO_FW_CONTROL_CLEAR); -+ -+ spin_unlock_irqrestore(&gs->gc.bgpio_lock, flags); -+ -+ return 0; -+} -+ -+static int mlxbf3_gpio_direction_output(struct gpio_chip *chip, -+ unsigned int offset, -+ int value) -+{ -+ struct mlxbf3_gpio_context *gs = gpiochip_get_data(chip); -+ unsigned long flags; -+ -+ spin_lock_irqsave(&gs->gc.bgpio_lock, flags); -+ -+ writel(BIT(offset), gs->gpio_io + YU_GPIO_FW_OUTPUT_ENABLE_SET); -+ -+ spin_unlock_irqrestore(&gs->gc.bgpio_lock, flags); -+ -+ return 0; -+} -+ -+static void mlxbf3_gpio_irq_enable(struct irq_data *irqd) -+{ -+ struct gpio_chip *gc = irq_data_get_irq_chip_data(irqd); -+ struct mlxbf3_gpio_context *gs = gpiochip_get_data(gc); -+ int offset = irqd_to_hwirq(irqd); -+ unsigned long flags; -+ u32 val; -+ -+ spin_lock_irqsave(&gs->gc.bgpio_lock, flags); -+ writel(BIT(offset), gs->gpio_cause_io + YU_GPIO_CAUSE_OR_CLRCAUSE); -+ -+ val = readl(gs->gpio_cause_io + YU_GPIO_CAUSE_OR_EVTEN0); -+ val |= BIT(offset); -+ writel(val, gs->gpio_cause_io + YU_GPIO_CAUSE_OR_EVTEN0); -+ spin_unlock_irqrestore(&gs->gc.bgpio_lock, flags); -+} -+ -+static void mlxbf3_gpio_irq_disable(struct irq_data *irqd) -+{ -+ struct gpio_chip *gc = irq_data_get_irq_chip_data(irqd); -+ struct mlxbf3_gpio_context *gs = gpiochip_get_data(gc); -+ int offset = irqd_to_hwirq(irqd); -+ unsigned long flags; -+ u32 val; -+ -+ spin_lock_irqsave(&gs->gc.bgpio_lock, flags); -+ val = readl(gs->gpio_cause_io + YU_GPIO_CAUSE_OR_EVTEN0); -+ val &= ~BIT(offset); -+ writel(val, gs->gpio_cause_io + YU_GPIO_CAUSE_OR_EVTEN0); -+ spin_unlock_irqrestore(&gs->gc.bgpio_lock, flags); -+} -+ -+static irqreturn_t mlxbf3_gpio_irq_handler(int irq, void *ptr) -+{ -+ struct mlxbf3_gpio_context *gs = ptr; -+ struct gpio_chip *gc = &gs->gc; -+ unsigned long pending; -+ u32 level; -+ -+ pending = readl(gs->gpio_cause_io + YU_GPIO_CAUSE_OR_CAUSE_EVTEN0); -+ writel(pending, gs->gpio_cause_io + YU_GPIO_CAUSE_OR_CLRCAUSE); -+ -+ for_each_set_bit(level, &pending, gc->ngpio) { -+ int gpio_irq = irq_find_mapping(gc->irq.domain, level); -+ generic_handle_irq(gpio_irq); -+ } -+ -+ return IRQ_RETVAL(pending); -+} -+ -+static int -+mlxbf3_gpio_irq_set_type(struct irq_data *irqd, unsigned int type) -+{ -+ struct gpio_chip *gc = irq_data_get_irq_chip_data(irqd); -+ struct mlxbf3_gpio_context *gs = gpiochip_get_data(gc); -+ int offset = irqd_to_hwirq(irqd); -+ unsigned long flags; -+ bool fall = false; -+ bool rise = false; -+ u32 val; -+ -+ switch (type & IRQ_TYPE_SENSE_MASK) { -+ case IRQ_TYPE_EDGE_BOTH: -+ fall = true; -+ rise = true; -+ break; -+ case IRQ_TYPE_EDGE_RISING: -+ rise = true; -+ break; -+ case IRQ_TYPE_EDGE_FALLING: -+ fall = true; -+ break; -+ default: -+ return -EINVAL; -+ } -+ -+ spin_lock_irqsave(&gs->gc.bgpio_lock, flags); -+ if (fall) { -+ val = readl(gs->gpio_io + YU_GPIO_CAUSE_FALL_EN); -+ val |= BIT(offset); -+ writel(val, gs->gpio_io + YU_GPIO_CAUSE_FALL_EN); -+ } -+ -+ if (rise) { -+ val = readl(gs->gpio_io + YU_GPIO_CAUSE_RISE_EN); -+ val |= BIT(offset); -+ writel(val, gs->gpio_io + YU_GPIO_CAUSE_RISE_EN); -+ } -+ spin_unlock_irqrestore(&gs->gc.bgpio_lock, flags); -+ -+ return 0; -+} -+ -+/* BlueField-3 GPIO driver initialization routine. */ -+static int -+mlxbf3_gpio_probe(struct platform_device *pdev) -+{ -+ struct mlxbf3_gpio_context *gs; -+ struct device *dev = &pdev->dev; -+ struct gpio_irq_chip *girq; -+ struct gpio_chip *gc; -+ unsigned int npins; -+ const char *name; -+ int ret, irq; -+ -+ name = dev_name(dev); -+ -+ gs = devm_kzalloc(dev, sizeof(*gs), GFP_KERNEL); -+ if (!gs) -+ return -ENOMEM; -+ -+ /* YU GPIO block address */ -+ gs->gpio_io = devm_platform_ioremap_resource(pdev, 0); -+ if (IS_ERR(gs->gpio_io)) -+ return PTR_ERR(gs->gpio_io); -+ -+ /* YU GPIO block address */ -+ gs->gpio_cause_io = devm_platform_ioremap_resource(pdev, 1); -+ if (IS_ERR(gs->gpio_cause_io)) -+ return PTR_ERR(gs->gpio_cause_io); -+ -+ if (device_property_read_u32(dev, "npins", &npins)) -+ npins = MLXBF3_GPIO_MAX_PINS_PER_BLOCK; -+ -+ if (device_property_read_u32(dev, "ctrl_gpio_mask", &gs->ctrl_gpio_mask)) -+ gs->ctrl_gpio_mask = 0x0; -+ -+ gc = &gs->gc; -+ -+ /* To set the direction to input, just give control to HW by setting -+ * YU_GPIO_FW_CONTROL_CLEAR. -+ * If the GPIO is controlled by HW, read its value via read_data_in register. -+ * -+ * When the direction = output, the GPIO is controlled by SW and -+ * datain=dataout. If software modifies the value of the GPIO pin, -+ * the value can be read from read_data_in without changing the direction. -+ */ -+ ret = bgpio_init(gc, dev, 4, -+ gs->gpio_io + YU_GPIO_READ_DATA_IN, -+ NULL, -+ NULL, -+ NULL, -+ NULL, -+ 0); -+ -+ gc->set = mlxbf3_gpio_set; -+ gc->direction_input = mlxbf3_gpio_direction_input; -+ gc->direction_output = mlxbf3_gpio_direction_output; -+ -+ gc->ngpio = npins; -+ gc->owner = THIS_MODULE; -+ -+ irq = platform_get_irq(pdev, 0); -+ if (irq >= 0) { -+ gs->irq_chip.name = name; -+ gs->irq_chip.irq_set_type = mlxbf3_gpio_irq_set_type; -+ gs->irq_chip.irq_enable = mlxbf3_gpio_irq_enable; -+ gs->irq_chip.irq_disable = mlxbf3_gpio_irq_disable; -+ -+ girq = &gs->gc.irq; -+ girq->chip = &gs->irq_chip; -+ girq->handler = handle_simple_irq; -+ girq->default_type = IRQ_TYPE_NONE; -+ /* This will let us handle the parent IRQ in the driver */ -+ girq->num_parents = 0; -+ girq->parents = NULL; -+ girq->parent_handler = NULL; -+ -+ /* -+ * Directly request the irq here instead of passing -+ * a flow-handler because the irq is shared. -+ */ -+ ret = devm_request_irq(dev, irq, mlxbf3_gpio_irq_handler, -+ IRQF_SHARED, name, gs); -+ if (ret) { -+ dev_err(dev, "failed to request IRQ"); -+ return ret; -+ } -+ } -+ -+ platform_set_drvdata(pdev, gs); -+ -+ ret = devm_gpiochip_add_data(dev, &gs->gc, gs); -+ if (ret) { -+ dev_err(dev, "Failed adding memory mapped gpiochip\n"); -+ return ret; -+ } -+ -+ return 0; -+} -+ -+static int mlxbf3_gpio_remove(struct platform_device *pdev) -+{ -+ struct mlxbf3_gpio_context *gs = platform_get_drvdata(pdev); -+ -+ /* Set the GPIO control back to HW */ -+ writel(gs->ctrl_gpio_mask, gs->gpio_io + YU_GPIO_FW_CONTROL_CLEAR); -+ -+ return 0; -+} -+ -+static const struct acpi_device_id __maybe_unused mlxbf3_gpio_acpi_match[] = { -+ { "MLNXBF33", 0 }, -+ {}, -+}; -+MODULE_DEVICE_TABLE(acpi, mlxbf3_gpio_acpi_match); -+ -+static struct platform_driver mlxbf3_gpio_driver = { -+ .driver = { -+ .name = "mlxbf3_gpio", -+ .acpi_match_table = mlxbf3_gpio_acpi_match, -+ }, -+ .probe = mlxbf3_gpio_probe, -+ .remove = mlxbf3_gpio_remove, -+}; -+ -+module_platform_driver(mlxbf3_gpio_driver); -+ -+MODULE_DESCRIPTION("Mellanox BlueField-3 GPIO Driver"); -+MODULE_AUTHOR("Asmaa Mnebhi "); -+MODULE_LICENSE("Dual BSD/GPL"); -+MODULE_VERSION(DRV_VERSION); --- -2.14.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0257-regmap-debugfs-Enable-writing-to-the-regmap-debugfs-.patch b/platform/mellanox/non-upstream-patches/patches/0257-regmap-debugfs-Enable-writing-to-the-regmap-debugfs-.patch deleted file mode 100644 index 53813dbaf5a0..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0257-regmap-debugfs-Enable-writing-to-the-regmap-debugfs-.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 5a6717305bc0ee08d08dc27f8f3415c4bb1c34c3 Mon Sep 17 00:00:00 2001 -From: Felix Radensky -Date: Sun, 20 Nov 2022 15:25:58 +0200 -Subject: [PATCH backport 5.10 59/63] regmap: debugfs: Enable writing to the - regmap debugfs registers - -Signed-off-by: Felix Radensky ---- - drivers/base/regmap/regmap-debugfs.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c -index 211a335a6..ee3cccaf5 100644 ---- a/drivers/base/regmap/regmap-debugfs.c -+++ b/drivers/base/regmap/regmap-debugfs.c -@@ -290,7 +290,7 @@ static ssize_t regmap_map_read_file(struct file *file, char __user *user_buf, - count, ppos); - } - --#undef REGMAP_ALLOW_WRITE_DEBUGFS -+#define REGMAP_ALLOW_WRITE_DEBUGFS - #ifdef REGMAP_ALLOW_WRITE_DEBUGFS - /* - * This can be dangerous especially when we have clients such as --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0258-UBUNTU-SAUCE-mlx-bootctl-support-icm-carveout-eeprom.patch b/platform/mellanox/non-upstream-patches/patches/0258-UBUNTU-SAUCE-mlx-bootctl-support-icm-carveout-eeprom.patch deleted file mode 100644 index 6448866c0ea7..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0258-UBUNTU-SAUCE-mlx-bootctl-support-icm-carveout-eeprom.patch +++ /dev/null @@ -1,118 +0,0 @@ -From 02aa895d298c83e5e6e0f6e64f04895e50235a33 Mon Sep 17 00:00:00 2001 -From: Asmaa Mnebhi -Date: Mon, 31 Oct 2022 12:18:52 -0400 -Subject: [PATCH backport 5.10 60/63] UBUNTU: SAUCE: mlx-bootctl: support icm - carveout eeprom region read/write - -BugLink: https://bugs.launchpad.net/bugs/1995296 - -The BlueField-3 ICM carveout feature will enable NIC FW to bypass the SMMU block -to access DRAM memory. The amount of memory accessible by FW will be controlled by ARM. -This patch enables setting the size of the large ICM carveout from -userspace. The max size is 1TB, has a granularity of 128MB and will be passed -and printed in hex. The size unit is MB. - -Signed-off-by: Asmaa Mnebhi -Acked-by: Tim Gardner -Acked-by: Cory Todd -Signed-off-by: Bartlomiej Zolnierkiewicz ---- - drivers/platform/mellanox/mlxbf-bootctl.c | 40 +++++++++++++++++++++++ - drivers/platform/mellanox/mlxbf-bootctl.h | 9 +++++ - 2 files changed, 49 insertions(+) - -diff --git a/drivers/platform/mellanox/mlxbf-bootctl.c b/drivers/platform/mellanox/mlxbf-bootctl.c -index 2302e1e09..e8877a19d 100644 ---- a/drivers/platform/mellanox/mlxbf-bootctl.c -+++ b/drivers/platform/mellanox/mlxbf-bootctl.c -@@ -104,6 +104,7 @@ enum { - - /* This mutex is used to serialize MFG write and lock operations. */ - static DEFINE_MUTEX(mfg_ops_lock); -+static DEFINE_MUTEX(icm_ops_lock); - - #define MLNX_MFG_OOB_MAC_LEN ETH_ALEN - #define MLNX_MFG_OPN_VAL_LEN 24 -@@ -383,6 +384,43 @@ static ssize_t oob_mac_store(struct device_driver *drv, const char *buf, - return res.a0 ? -EPERM : count; - } - -+static ssize_t large_icm_show(struct device_driver *drv, char *buf) -+{ -+ char icm_str[MAX_ICM_BUFFER_SIZE] = { 0 }; -+ struct arm_smccc_res res; -+ -+ arm_smccc_smc(MLNX_HANDLE_GET_ICM_INFO, 0, 0, 0, 0, -+ 0, 0, 0, &res); -+ if (res.a0) -+ return -EPERM; -+ -+ sprintf(icm_str, "0x%lx", res.a1); -+ -+ return snprintf(buf, sizeof(icm_str), "%s", icm_str); -+} -+ -+static ssize_t large_icm_store(struct device_driver *drv, const char *buf, -+ size_t count) -+{ -+ struct arm_smccc_res res; -+ unsigned long icm_data; -+ int err; -+ -+ err = kstrtoul(buf, 16, &icm_data); -+ if (err) -+ return err; -+ -+ if (((icm_data != 0) && (icm_data < 0x80)) || -+ (icm_data > 0x100000) || (icm_data % 128)) -+ return -EPERM; -+ -+ mutex_lock(&icm_ops_lock); -+ arm_smccc_smc(MLNX_HANDLE_SET_ICM_INFO, icm_data, 0, 0, 0, 0, 0, 0, &res); -+ mutex_unlock(&icm_ops_lock); -+ -+ return res.a0 ? -EPERM : count; -+} -+ - static ssize_t opn_show(struct device_driver *drv, char *buf) - { - u64 opn_data[MLNX_MFG_VAL_QWORD_CNT(OPN)] = { 0 }; -@@ -1170,6 +1208,7 @@ static DRIVER_ATTR_RW(uuid); - static DRIVER_ATTR_RW(rev); - static DRIVER_ATTR_WO(mfg_lock); - static DRIVER_ATTR_RW(rsh_log); -+static DRIVER_ATTR_RW(large_icm); - - static struct attribute *mbc_dev_attrs[] = { - &driver_attr_post_reset_wdog.attr, -@@ -1187,6 +1226,7 @@ static struct attribute *mbc_dev_attrs[] = { - &driver_attr_rev.attr, - &driver_attr_mfg_lock.attr, - &driver_attr_rsh_log.attr, -+ &driver_attr_large_icm.attr, - NULL - }; - -diff --git a/drivers/platform/mellanox/mlxbf-bootctl.h b/drivers/platform/mellanox/mlxbf-bootctl.h -index 3e9dda829..c70204770 100644 ---- a/drivers/platform/mellanox/mlxbf-bootctl.h -+++ b/drivers/platform/mellanox/mlxbf-bootctl.h -@@ -95,6 +95,15 @@ - #define MLNX_HANDLE_GET_MFG_INFO 0x8200000F - #define MLNX_HANDLE_LOCK_MFG_INFO 0x82000011 - -+/* -+ * SMC function IDs to set and get the large ICM carveout size -+ * stored in the eeprom. -+ */ -+#define MLNX_HANDLE_SET_ICM_INFO 0x82000012 -+#define MLNX_HANDLE_GET_ICM_INFO 0x82000013 -+ -+#define MAX_ICM_BUFFER_SIZE 10 -+ - /* SMC function IDs for SiP Service queries */ - #define MLNX_SIP_SVC_CALL_COUNT 0x8200ff00 - #define MLNX_SIP_SVC_UID 0x8200ff01 --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0259-mmc-sdhci-of-dwcmshc-Enable-host-V4-support-for-Blue.patch b/platform/mellanox/non-upstream-patches/patches/0259-mmc-sdhci-of-dwcmshc-Enable-host-V4-support-for-Blue.patch deleted file mode 100644 index 34103898d310..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0259-mmc-sdhci-of-dwcmshc-Enable-host-V4-support-for-Blue.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 8650b784688c0822951993d98f196e1c7689a5cc Mon Sep 17 00:00:00 2001 -From: Liming Sun -Date: Fri, 25 Nov 2022 22:29:23 -0500 -Subject: [PATCH backport 5.10 61/63] mmc: sdhci-of-dwcmshc: Enable host V4 - support for BlueField-3 SoC - -This commit enables SDHCI Host V4 support on Bluefield-3 SoC to be -consistent with UEFI setting. - -Change-Id: I4d5ea43ca5f36c6c642443b9335c321924cca2ed -Signed-off-by: Liming Sun ---- - drivers/mmc/host/sdhci-of-dwcmshc.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/drivers/mmc/host/sdhci-of-dwcmshc.c b/drivers/mmc/host/sdhci-of-dwcmshc.c -index 173a9167a..ea972bd3c 100644 ---- a/drivers/mmc/host/sdhci-of-dwcmshc.c -+++ b/drivers/mmc/host/sdhci-of-dwcmshc.c -@@ -426,6 +426,12 @@ static int dwcmshc_probe(struct platform_device *pdev) - goto err_clk; - } - -+#ifdef CONFIG_ACPI -+ if (pltfm_data == &sdhci_dwcmshc_bf3_pdata) { -+ sdhci_enable_v4_mode(host); -+ } -+#endif -+ - host->mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY; - - err = sdhci_add_host(host); --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0260-UBUNTU-SAUCE-mlxbf-pka-Fix-kernel-crash-with-pka-TRN.patch b/platform/mellanox/non-upstream-patches/patches/0260-UBUNTU-SAUCE-mlxbf-pka-Fix-kernel-crash-with-pka-TRN.patch deleted file mode 100644 index 6196e707d9f6..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0260-UBUNTU-SAUCE-mlxbf-pka-Fix-kernel-crash-with-pka-TRN.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 9d0cd0fb6fbdf825454b3d9f9518d8b569b0cdea Mon Sep 17 00:00:00 2001 -From: Shih-Yi Chen -Date: Wed, 4 Jan 2023 10:03:06 -0500 -Subject: [PATCH backport 5.10 1/6] UBUNTU: SAUCE: mlxbf-pka: Fix kernel crash - with pka TRNG ioctl call - -BugLink: https://bugs.launchpad.net/bugs/2001564 - -Bluefield encounters kernel crash/oops when HTTPS client uses OpenSSL -with PKA engine during TLS handshake. The issue is with TRNG ioctl call. -The kernel logs show the following errors. - -Unable to handle kernel access to user memory outside uaccess routines at virtual address 0000ffffce65d328 - -Signed-off-by: Shih-Yi Chen -Acked-by: Tim Gardner -Acked-by: Cengiz Can -Signed-off-by: Bartlomiej Zolnierkiewicz ---- - drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_drv.c | 13 +++++++++---- - 1 file changed, 9 insertions(+), 4 deletions(-) - -diff --git a/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_drv.c b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_drv.c -index b8b5a465e..9e26ccf21 100644 ---- a/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_drv.c -+++ b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_drv.c -@@ -467,7 +467,7 @@ static long pka_drv_ring_ioctl(void *device_data, - } else if (cmd == PKA_CLEAR_RING_COUNTERS) { - return pka_dev_clear_ring_counters(ring_dev->ring); - } else if (cmd == PKA_GET_RANDOM_BYTES) { -- pka_dev_trng_info_t *trng_data; -+ pka_dev_trng_info_t trng_data; - pka_dev_shim_t *shim; - bool trng_present; - uint32_t byte_cnt; -@@ -476,12 +476,17 @@ static long pka_drv_ring_ioctl(void *device_data, - - ret = -ENOENT; - shim = ring_dev->ring->shim; -- trng_data = (pka_dev_trng_info_t *)arg; -+ ret = copy_from_user(&trng_data, (void __user *)(arg), sizeof(pka_dev_trng_info_t)); -+ if (ret) { -+ PKA_DEBUG(PKA_DRIVER, "Failed to copy user request.\n"); -+ return -EFAULT; -+ } -+ - /* - * We need byte count which is multiple of 4 as - * required by pka_dev_trng_read() interface. - */ -- byte_cnt = round_up(trng_data->count, 4); -+ byte_cnt = round_up(trng_data.count, 4); - - data = kzalloc(byte_cnt, GFP_KERNEL); - if (data == NULL) { -@@ -502,7 +507,7 @@ static long pka_drv_ring_ioctl(void *device_data, - return ret; - } - -- ret = copy_to_user((void __user *)(trng_data->data), data, trng_data->count); -+ ret = copy_to_user((void __user *)(trng_data.data), data, trng_data.count); - kfree(data); - return ret ? -EFAULT : 0; - } --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0261-mlxbf-ptm-power-and-thermal-management-debugfs-drive.patch b/platform/mellanox/non-upstream-patches/patches/0261-mlxbf-ptm-power-and-thermal-management-debugfs-drive.patch deleted file mode 100644 index 7328cbfdf048..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0261-mlxbf-ptm-power-and-thermal-management-debugfs-drive.patch +++ /dev/null @@ -1,256 +0,0 @@ -From 1193879b92e665c100056085385ffdb4ab2715cb Mon Sep 17 00:00:00 2001 -From: Jitendra Lanka -Date: Fri, 13 Jan 2023 15:21:02 -0500 -Subject: [PATCH backport 5.10 2/6] mlxbf-ptm: power and thermal management - debugfs driver - -mlxbf-ptm driver implements debugfs interface for Bluefield -devices power and thermal management. It provides some parameters -that can be monitored by system software. - -Change-Id: I241e1406962548cef9b33c4b3dea925e675c3c88 -Signed-off-by: Jitendra Lanka ---- - drivers/platform/mellanox/Kconfig | 10 ++ - drivers/platform/mellanox/Makefile | 1 + - drivers/platform/mellanox/mlxbf-ptm.c | 195 ++++++++++++++++++++++++++ - 3 files changed, 206 insertions(+) - create mode 100644 drivers/platform/mellanox/mlxbf-ptm.c - -diff --git a/drivers/platform/mellanox/Kconfig b/drivers/platform/mellanox/Kconfig -index a5231c23a..48bd61f61 100644 ---- a/drivers/platform/mellanox/Kconfig -+++ b/drivers/platform/mellanox/Kconfig -@@ -106,6 +106,16 @@ config MLXBF_TRIO - This driver supports the TRIO PCIe root complex interface on - Mellanox BlueField SoCs. - -+config MLXBF_PTM -+ tristate "BlueField Power and Thermal Management debugfs interface" -+ depends on ARM64 -+ depends on DEBUG_FS -+ help -+ If you say yes to this option, support will be added for the -+ mlxbf-ptm driver. This driver provides debugfs interface -+ to userspace with information related to power and thermal -+ management of the Bluefield device. -+ - source "drivers/platform/mellanox/mlxbf_pka/Kconfig" - - config NVSW_SN2201 -diff --git a/drivers/platform/mellanox/Makefile b/drivers/platform/mellanox/Makefile -index 7a4b90ed5..d30483021 100644 ---- a/drivers/platform/mellanox/Makefile -+++ b/drivers/platform/mellanox/Makefile -@@ -8,6 +8,7 @@ obj-$(CONFIG_MLXBF_PMC) += mlxbf-pmc.o - obj-$(CONFIG_MLXBF_TMFIFO) += mlxbf-tmfifo.o - obj-$(CONFIG_MLXBF_TRIO) += mlx-trio.o - obj-$(CONFIG_MLXBF_LIVEFISH) += mlxbf-livefish.o -+obj-$(CONFIG_MLXBF_PTM) += mlxbf-ptm.o - obj-$(CONFIG_MLXREG_HOTPLUG) += mlxreg-hotplug.o - obj-$(CONFIG_MLXREG_IO) += mlxreg-io.o - obj-$(CONFIG_MLXBF_PKA) += mlxbf_pka/ -diff --git a/drivers/platform/mellanox/mlxbf-ptm.c b/drivers/platform/mellanox/mlxbf-ptm.c -new file mode 100644 -index 000000000..307ba1f33 ---- /dev/null -+++ b/drivers/platform/mellanox/mlxbf-ptm.c -@@ -0,0 +1,195 @@ -+// SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause -+/* -+ * Copyright (C) 2023 NVIDIA Corporation & Affiliates. -+ * -+ * Nvidia Bluefield power and thermal debugfs driver -+ * This driver provides a debugfs interface for systems management -+ * software to monitor power and thermal actions. -+ * -+ */ -+ -+#include -+#include -+#include -+#include -+ -+/* SMC IDs */ -+#define MLNX_PTM_GET_VR0_POWER 0x82000101 -+#define MLNX_PTM_GET_VR1_POWER 0x82000102 -+#define MLNX_PTM_GET_THROTTLE_STATE 0x82000103 -+#define MLNX_PTM_GET_DDR_THLD 0x82000104 -+#define MLNX_PTM_GET_STATUS_REG 0x82000105 -+#define MLNX_PTM_GET_PTHROTTLE 0x82000106 -+#define MLNX_PTM_GET_TTHROTTLE 0x82000107 -+#define MLNX_PTM_GET_MAX_TEMP 0x82000108 -+#define MLNX_PTM_GET_PWR_EVT_CNT 0x82000109 -+#define MLNX_PTM_GET_TEMP_EVT_CNT 0x8200010A -+ -+#define MLNX_POWER_ERROR 300 -+ -+struct dentry *monitors; -+ -+static int smc_call1(unsigned int smc_op, int smc_arg) -+{ -+ struct arm_smccc_res res; -+ -+ arm_smccc_smc(smc_op, smc_arg, 0, 0, 0, 0, 0, 0, &res); -+ -+ return res.a0; -+} -+ -+#define smc_call0(smc_op) smc_call1(smc_op, 0) -+ -+static int throttling_state_show(void *data, u64 *val) -+{ -+ *val = smc_call0(MLNX_PTM_GET_THROTTLE_STATE); -+ -+ return 0; -+} -+DEFINE_SIMPLE_ATTRIBUTE(throttling_state_fops, -+ throttling_state_show, NULL, "%llu\n"); -+ -+static int pthrottling_state_show(void *data, u64 *val) -+{ -+ *val = smc_call0(MLNX_PTM_GET_PTHROTTLE); -+ -+ return 0; -+} -+DEFINE_SIMPLE_ATTRIBUTE(pthrottling_state_fops, -+ pthrottling_state_show, NULL, "%llu\n"); -+ -+static int tthrottling_state_show(void *data, u64 *val) -+{ -+ *val = smc_call0(MLNX_PTM_GET_TTHROTTLE); -+ -+ return 0; -+} -+DEFINE_SIMPLE_ATTRIBUTE(tthrottling_state_fops, -+ tthrottling_state_show, NULL, "%llu\n"); -+ -+static int core_temp_show(void *data, u64 *val) -+{ -+ *val = smc_call0(MLNX_PTM_GET_MAX_TEMP); -+ -+ return 0; -+} -+DEFINE_SIMPLE_ATTRIBUTE(core_temp_fops, -+ core_temp_show, NULL, "%lld\n"); -+ -+static int pwr_evt_counter_show(void *data, u64 *val) -+{ -+ *val = smc_call0(MLNX_PTM_GET_PWR_EVT_CNT); -+ -+ return 0; -+} -+DEFINE_SIMPLE_ATTRIBUTE(pwr_evt_counter_fops, -+ pwr_evt_counter_show, NULL, "%llu\n"); -+ -+static int temp_evt_counter_show(void *data, u64 *val) -+{ -+ *val = smc_call0(MLNX_PTM_GET_TEMP_EVT_CNT); -+ -+ return 0; -+} -+DEFINE_SIMPLE_ATTRIBUTE(temp_evt_counter_fops, -+ temp_evt_counter_show, NULL, "%llu\n"); -+ -+static int vr0_power_show(void *data, u64 *val) -+{ -+ *val = smc_call0(MLNX_PTM_GET_VR0_POWER); -+ -+ return 0; -+} -+DEFINE_SIMPLE_ATTRIBUTE(vr0_power_fops, vr0_power_show, NULL, "%llu\n"); -+ -+static int vr1_power_show(void *data, u64 *val) -+{ -+ *val = smc_call0(MLNX_PTM_GET_VR1_POWER); -+ -+ return 0; -+} -+DEFINE_SIMPLE_ATTRIBUTE(vr1_power_fops, vr1_power_show, NULL, "%llu\n"); -+ -+static int total_power_show(void *data, u64 *val) -+{ -+ u64 v0, v1; -+ -+ v0 = smc_call0(MLNX_PTM_GET_VR0_POWER); -+ if (v0 > MLNX_POWER_ERROR) -+ v0 = 0; -+ v1 = smc_call0(MLNX_PTM_GET_VR1_POWER); -+ if (v1 > MLNX_POWER_ERROR) -+ v1 = 0; -+ *val = (v0 + v1); -+ -+ return 0; -+} -+DEFINE_SIMPLE_ATTRIBUTE(total_power_fops, total_power_show, NULL, "%llu\n"); -+ -+static int ddr_thld_show(void *data, u64 *val) -+{ -+ *val = smc_call0(MLNX_PTM_GET_DDR_THLD); -+ -+ return 0; -+} -+DEFINE_SIMPLE_ATTRIBUTE(ddr_thld_fops, ddr_thld_show, NULL, "%llu\n"); -+ -+static int error_status_show(void *data, u64 *val) -+{ -+ *val = smc_call0(MLNX_PTM_GET_STATUS_REG); -+ -+ return 0; -+} -+DEFINE_SIMPLE_ATTRIBUTE(error_status_fops, -+ error_status_show, NULL, "%llu\n"); -+ -+ -+static int __init mlxbf_ptm_init(void) -+{ -+ struct dentry *ptm_root, *status; -+ -+ ptm_root = debugfs_lookup("mlxbf-ptm", NULL); -+ if (!ptm_root) -+ ptm_root = debugfs_create_dir("mlxbf-ptm", NULL); -+ -+ monitors = debugfs_create_dir("monitors", ptm_root); -+ status = debugfs_create_dir("status", monitors); -+ -+ debugfs_create_file("vr0_power", S_IRUGO, status, NULL, -+ &vr0_power_fops); -+ debugfs_create_file("vr1_power", S_IRUGO, status, NULL, -+ &vr1_power_fops); -+ debugfs_create_file("total_power", S_IRUGO, status, NULL, -+ &total_power_fops); -+ debugfs_create_file("ddr_temp", S_IRUGO, status, -+ NULL, &ddr_thld_fops); -+ debugfs_create_file("core_temp", S_IRUGO, status, -+ NULL, &core_temp_fops); -+ debugfs_create_file("power_throttling_event_count", S_IRUGO, status, -+ NULL, &pwr_evt_counter_fops); -+ debugfs_create_file("thermal_throttling_event_count", S_IRUGO, status, -+ NULL, &temp_evt_counter_fops); -+ debugfs_create_file("throttling_state", S_IRUGO, status, -+ NULL, &throttling_state_fops); -+ debugfs_create_file("power_throttling_state", S_IRUGO, status, -+ NULL, &pthrottling_state_fops); -+ debugfs_create_file("thermal_throttling_state", S_IRUGO, status, -+ NULL, &tthrottling_state_fops); -+ debugfs_create_file("error_state", S_IRUGO, status, -+ NULL, &error_status_fops); -+ -+ return 0; -+} -+ -+static void __exit mlxbf_ptm_exit(void) -+{ -+ debugfs_remove_recursive(monitors); -+} -+ -+module_init(mlxbf_ptm_init); -+module_exit(mlxbf_ptm_exit); -+ -+MODULE_AUTHOR("Jitendra Lanka "); -+MODULE_DESCRIPTION("Nvidia Bluefield power and thermal debugfs driver"); -+MODULE_LICENSE("Dual BSD/GPL"); -+MODULE_VERSION("1.0"); --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0262-UBUNTU-SAUCE-mlxbf-pmc-Fix-event-string-typo.patch b/platform/mellanox/non-upstream-patches/patches/0262-UBUNTU-SAUCE-mlxbf-pmc-Fix-event-string-typo.patch deleted file mode 100644 index 21783e2730ae..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0262-UBUNTU-SAUCE-mlxbf-pmc-Fix-event-string-typo.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 127bcf5d9412ee246b6620d9b38b7fca6fe4d66d Mon Sep 17 00:00:00 2001 -From: James Hurley -Date: Tue, 6 Dec 2022 11:31:55 -0500 -Subject: [PATCH backport 5.10 3/6] UBUNTU: SAUCE: mlxbf-pmc: Fix event string - typo - -BugLink: https://bugs.launchpad.net/bugs/1998863 - -Fix event string typo so that the proper events are displayed. - -Signed-off-by: James hurley -Reviewed-by: David Thompson -Signed-off-by: James hurley -Acked-by: Tim Gardner -Acked-by: Bartlomiej Zolnierkiewicz -Signed-off-by: Bartlomiej Zolnierkiewicz ---- - drivers/platform/mellanox/mlxbf-pmc.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/platform/mellanox/mlxbf-pmc.h b/drivers/platform/mellanox/mlxbf-pmc.h -index 894c3cc88..a6f7aade4 100644 ---- a/drivers/platform/mellanox/mlxbf-pmc.h -+++ b/drivers/platform/mellanox/mlxbf-pmc.h -@@ -364,7 +364,7 @@ struct mlxbf_pmc_events mlxbf2_hnfnet_events[] = { - {0x32, "DDN_DIAG_W_INGRESS"}, - {0x33, "DDN_DIAG_C_INGRESS"}, - {0x34, "DDN_DIAG_CORE_SENT"}, --{0x35, "NDN_DIAG_S_OUT_OF_CRED"}, -+{0x35, "NDN_DIAG_N_OUT_OF_CRED"}, - {0x36, "NDN_DIAG_S_OUT_OF_CRED"}, - {0x37, "NDN_DIAG_E_OUT_OF_CRED"}, - {0x38, "NDN_DIAG_W_OUT_OF_CRED"}, --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0263-UBUNTU-SAUCE-mlxbf-pmc-Support-for-BlueField-3-perfo.patch b/platform/mellanox/non-upstream-patches/patches/0263-UBUNTU-SAUCE-mlxbf-pmc-Support-for-BlueField-3-perfo.patch deleted file mode 100644 index f461a89e474a..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0263-UBUNTU-SAUCE-mlxbf-pmc-Support-for-BlueField-3-perfo.patch +++ /dev/null @@ -1,929 +0,0 @@ -From 9325ac1c6648be97da5b6e2504b70a3f31a66690 Mon Sep 17 00:00:00 2001 -From: Shravan Kumar Ramani -Date: Wed, 11 Jan 2023 04:49:23 -0500 -Subject: [PATCH backport 5.10 4/6] UBUNTU: SAUCE: mlxbf-pmc: Support for - BlueField-3 performance counters - -BugLink: https://bugs.launchpad.net/bugs/2002501 - -Add new mechanism for programming and reading the counters in -BlueField-3, along with the updated event list supported in each block. -Read llt_enable and mss_enable info from the ACPI table entry to -identify the enabled blocks. - -Signed-off-by: Shravan Kumar Ramani -Acked-by: Bartlomiej Zolnierkiewicz -Acked-by: Tim Gardner -Signed-off-by: Bartlomiej Zolnierkiewicz ---- - drivers/platform/mellanox/mlxbf-pmc.c | 252 +++++++++++++-- - drivers/platform/mellanox/mlxbf-pmc.h | 445 +++++++++++++++++++++++++- - 2 files changed, 658 insertions(+), 39 deletions(-) - -diff --git a/drivers/platform/mellanox/mlxbf-pmc.c b/drivers/platform/mellanox/mlxbf-pmc.c -index 106acea8c..285b7433e 100644 ---- a/drivers/platform/mellanox/mlxbf-pmc.c -+++ b/drivers/platform/mellanox/mlxbf-pmc.c -@@ -243,17 +243,32 @@ struct mlxbf_pmc_events *mlxbf_pmc_event_list(char *blk) - break; - } - else if (strstr(blk, "mss")) -- events = mlxbf_mss_events; -+ switch (pmc->event_set) { -+ case MLNX_EVENT_SET_BF1: -+ case MLNX_EVENT_SET_BF2: -+ events = mlxbf_mss_events; -+ break; -+ case MLNX_EVENT_SET_BF3: -+ events = mlxbf3_mss_events; -+ break; -+ default: -+ events = NULL; -+ break; -+ } - else if (strstr(blk, "ecc")) - events = mlxbf_ecc_events; - else if (strstr(blk, "pcie")) - events = mlxbf_pcie_events; - else if (strstr(blk, "l3cache")) - events = mlxbf_l3cache_events; -- else if (strstr(blk, "gic")) -+ else if (strstr(blk, "gic")) - events = mlxbf_smgen_events; -- else if (strstr(blk, "smmu")) -+ else if (strstr(blk, "smmu")) - events = mlxbf_smgen_events; -+ else if (strstr(blk, "llt_miss")) -+ events = mlxbf3_llt_miss_events; -+ else if (strstr(blk, "llt")) -+ events = mlxbf3_llt_events; - else - events = NULL; - -@@ -378,6 +393,46 @@ int mlxbf_program_l3_counter(int blk_num, uint32_t cnt_num, uint32_t evt) - return mlxbf_pmc_writel(*wordaddr, pmcaddr); - } - -+/* Method to handle crspace counter programming */ -+int mlxbf_program_crspace_counter(int blk_num, uint32_t cnt_num, uint32_t evt) -+{ -+ int reg_num, ret; -+ uint32_t word; -+ void *addr; -+ -+ reg_num = (cnt_num / 2); -+ addr = pmc->block[blk_num].mmio_base + (reg_num * 4); -+ -+ ret = mlxbf_pmc_readl(&word, addr); -+ if (ret) -+ return ret; -+ -+ switch(cnt_num % 2) { -+ case 0: -+ word &= ~MLXBF_CRSPACE_PERFSEL0; -+ word |= FIELD_PREP(MLXBF_CRSPACE_PERFSEL0, evt); -+ break; -+ case 1: -+ word &= ~MLXBF_CRSPACE_PERFSEL1; -+ word |= FIELD_PREP(MLXBF_CRSPACE_PERFSEL1, evt); -+ break; -+ default: -+ return -EINVAL; -+ } -+ -+ return mlxbf_pmc_writel(word, addr); -+} -+ -+int mlxbf_clear_crspace_counter(int blk_num, uint32_t cnt_num) -+{ -+ void *addr; -+ -+ addr = pmc->block[blk_num].mmio_base + MLXBF_CRSPACE_PERFMON_VAL0 + -+ (cnt_num * 4); -+ -+ return mlxbf_pmc_writel(0x0, addr); -+} -+ - /* Method to program a counter to monitor an event */ - int mlxbf_program_counter(int blk_num, uint32_t cnt_num, uint32_t evt, - bool is_l3) -@@ -390,6 +445,9 @@ int mlxbf_program_counter(int blk_num, uint32_t cnt_num, uint32_t evt, - if (is_l3) - return mlxbf_program_l3_counter(blk_num, cnt_num, evt); - -+ if (pmc->block[blk_num].type == MLXBF_PERFTYPE_CRSPACE) -+ return mlxbf_program_crspace_counter(blk_num, cnt_num, evt); -+ - /* Configure the counter */ - perfctl = 0; - perfctl |= FIELD_PREP(MLXBF_GEN_PERFCTL__EN0, 1); -@@ -467,6 +525,22 @@ int mlxbf_read_l3_counter(int blk_num, uint32_t cnt_num, uint64_t *result) - return 0; - } - -+/* Method to handle crspace counter reads */ -+int mlxbf_read_crspace_counter(int blk_num, uint32_t cnt_num, uint64_t *result) -+{ -+ uint32_t value; -+ int status = 0; -+ -+ status = mlxbf_pmc_readl(&value, pmc->block[blk_num].mmio_base + -+ MLXBF_CRSPACE_PERFMON_VAL0 + (cnt_num * 4)); -+ if (status) -+ return status; -+ -+ *result = value; -+ -+ return 0; -+} -+ - /* Method to read the counter value */ - int mlxbf_read_counter(int blk_num, uint32_t cnt_num, bool is_l3, - uint64_t *result) -@@ -481,6 +555,9 @@ int mlxbf_read_counter(int blk_num, uint32_t cnt_num, bool is_l3, - if (is_l3) - return mlxbf_read_l3_counter(blk_num, cnt_num, result); - -+ if (pmc->block[blk_num].type == MLXBF_PERFTYPE_CRSPACE) -+ return mlxbf_read_crspace_counter(blk_num, cnt_num, result); -+ - perfcfg_offset = cnt_num * 8; - perfval_offset = perfcfg_offset + pmc->block[blk_num].counters * 8; - -@@ -557,6 +634,34 @@ int mlxbf_read_l3_event(int blk_num, uint32_t cnt_num, uint64_t *result) - return 0; - } - -+int mlxbf_read_crspace_event(int blk_num, uint32_t cnt_num, uint64_t *result) -+{ -+ uint32_t word, evt; -+ int reg_num, ret; -+ void *addr; -+ -+ reg_num = (cnt_num / 2); -+ addr = pmc->block[blk_num].mmio_base + (reg_num * 4); -+ -+ ret = mlxbf_pmc_readl(&word, addr); -+ if (ret) -+ return ret; -+ -+ switch(cnt_num % 2) { -+ case 0: -+ evt = FIELD_GET(MLXBF_CRSPACE_PERFSEL0, word); -+ break; -+ case 1: -+ evt = FIELD_GET(MLXBF_CRSPACE_PERFSEL1, word); -+ break; -+ default: -+ return -EINVAL; -+ } -+ *result = evt; -+ -+ return 0; -+} -+ - /* Method to find the event currently being monitored by a counter */ - int mlxbf_read_event(int blk_num, uint32_t cnt_num, bool is_l3, - uint64_t *result) -@@ -570,6 +675,10 @@ int mlxbf_read_event(int blk_num, uint32_t cnt_num, bool is_l3, - if (is_l3) - return mlxbf_read_l3_event(blk_num, cnt_num, result); - -+ if (pmc->block[blk_num].type == MLXBF_PERFTYPE_CRSPACE) -+ return mlxbf_read_crspace_event(blk_num, cnt_num, result); -+ -+ - perfcfg_offset = cnt_num * 8; - perfval_offset = perfcfg_offset + pmc->block[blk_num].counters * 8; - -@@ -645,7 +754,8 @@ static ssize_t mlxbf_counter_read(struct kobject *ko, - if (strstr(ko->name, "l3cache")) - is_l3 = true; - -- if (pmc->block[blk_num].type == MLXBF_PERFTYPE_COUNTER) { -+ if ((pmc->block[blk_num].type == MLXBF_PERFTYPE_COUNTER) || -+ (pmc->block[blk_num].type == MLXBF_PERFTYPE_CRSPACE)) { - err = sscanf(attr->attr.name, "counter%d", &cnt_num); - if (err < 0) - return -EINVAL; -@@ -706,6 +816,11 @@ static ssize_t mlxbf_counter_clear(struct kobject *ko, - err = mlxbf_write_reg(blk_num, offset, data); - if (err < 0) - return -EINVAL; -+ } else if (pmc->block[blk_num].type == MLXBF_PERFTYPE_CRSPACE) { -+ err = sscanf(attr->attr.name, "counter%d", &cnt_num); -+ if (err < 0) -+ return -EINVAL; -+ err = mlxbf_clear_crspace_counter(blk_num, cnt_num); - } else - return -EINVAL; - -@@ -738,7 +853,8 @@ static ssize_t mlxbf_event_find(struct kobject *ko, - - evt_name = mlxbf_pmc_get_event_name((char *)ko->name, evt_num); - -- return snprintf(buf, PAGE_SIZE, "0x%llx: %s\n", evt_num, evt_name); -+ return snprintf(buf, PAGE_SIZE, -+ "0x%llx: %s\n", evt_num, evt_name); - } - - /* Store function for "event" sysfs files */ -@@ -806,32 +922,41 @@ static ssize_t mlxbf_print_event_list(struct kobject *ko, - return ret; - } - --/* Show function for "enable" sysfs files - only for l3cache */ -+/* Show function for "enable" sysfs files - only for l3cache and crspace */ - static ssize_t mlxbf_show_counter_state(struct kobject *ko, - struct kobj_attribute *attr, char *buf) - { -- uint32_t perfcnt_cfg; -- int blk_num, value; -+ uint32_t perfcnt_cfg, word; -+ int blk_num, value, err; - - blk_num = mlxbf_pmc_get_block_num(ko->name); - if (blk_num < 0) - return -EINVAL; - -- if (mlxbf_pmc_readl(&perfcnt_cfg, -- pmc->block[blk_num].mmio_base + MLXBF_L3C_PERF_CNT_CFG)) -- return -EINVAL; -+ if (pmc->block[blk_num].type == MLXBF_PERFTYPE_CRSPACE) { -+ err = mlxbf_pmc_readl(&word, pmc->block[blk_num].mmio_base + -+ MLXBF_CRSPACE_PERFMON_CTL); -+ if (err) -+ return -EINVAL; -+ value = FIELD_GET(MLXBF_CRSPACE_PERFMON_EN, word); -+ } else { -+ if (mlxbf_pmc_readl(&perfcnt_cfg, pmc->block[blk_num].mmio_base -+ + MLXBF_L3C_PERF_CNT_CFG)) -+ return -EINVAL; - -- value = FIELD_GET(MLXBF_L3C_PERF_CNT_CFG__EN, perfcnt_cfg); -+ value = FIELD_GET(MLXBF_L3C_PERF_CNT_CFG__EN, perfcnt_cfg); -+ } - - return snprintf(buf, PAGE_SIZE, "%d\n", value); - } - --/* Store function for "enable" sysfs files - only for l3cache */ -+/* Store function for "enable" sysfs files - only for l3cache and crspace */ - static ssize_t mlxbf_enable_counters(struct kobject *ko, - struct kobj_attribute *attr, - const char *buf, size_t count) - { - int err, en, blk_num; -+ uint32_t word; - - blk_num = mlxbf_pmc_get_block_num(ko->name); - if (blk_num < 0) -@@ -840,20 +965,32 @@ static ssize_t mlxbf_enable_counters(struct kobject *ko, - err = sscanf(buf, "%x\n", &en); - if (err < 0) - return err; -- -- if (en == 0) { -- err = mlxbf_config_l3_counters(blk_num, false, false); -- if (err) -- return err; -- } else if (en == 1) { -- err = mlxbf_config_l3_counters(blk_num, false, true); -- if (err) -- return err; -- err = mlxbf_config_l3_counters(blk_num, true, false); -+ if (pmc->block[blk_num].type == MLXBF_PERFTYPE_CRSPACE) { -+ err = mlxbf_pmc_readl(&word, pmc->block[blk_num].mmio_base + -+ MLXBF_CRSPACE_PERFMON_CTL); - if (err) -- return err; -- } else -- return -EINVAL; -+ return -EINVAL; -+ word &= ~MLXBF_CRSPACE_PERFMON_EN; -+ word |= FIELD_PREP(MLXBF_CRSPACE_PERFMON_EN, en); -+ if (en) -+ word |= FIELD_PREP(MLXBF_CRSPACE_PERFMON_CLR, 1); -+ mlxbf_pmc_writel(word, pmc->block[blk_num].mmio_base + -+ MLXBF_CRSPACE_PERFMON_CTL); -+ } else { -+ if (en == 0) { -+ err = mlxbf_config_l3_counters(blk_num, false, false); -+ if (err) -+ return err; -+ } else if (en == 1) { -+ err = mlxbf_config_l3_counters(blk_num, false, true); -+ if (err) -+ return err; -+ err = mlxbf_config_l3_counters(blk_num, true, false); -+ if (err) -+ return err; -+ } else -+ return -EINVAL; -+ } - - return count; - } -@@ -871,7 +1008,8 @@ int mlxbf_pmc_create_sysfs(struct device *dev, struct kobject *ko, int blk_num) - return -EFAULT; - } - -- if (pmc->block[blk_num].type == MLXBF_PERFTYPE_COUNTER) { -+ if ((pmc->block[blk_num].type == MLXBF_PERFTYPE_COUNTER) || -+ (pmc->block[blk_num].type == MLXBF_PERFTYPE_CRSPACE)) { - pmc->block[blk_num].attr_event_list.attr.mode = 0444; - pmc->block[blk_num].attr_event_list.show = - mlxbf_print_event_list; -@@ -888,7 +1026,8 @@ int mlxbf_pmc_create_sysfs(struct device *dev, struct kobject *ko, int blk_num) - return err; - } - -- if (strstr(pmc->block_name[blk_num], "l3cache")) { -+ if ((strstr(pmc->block_name[blk_num], "l3cache")) || -+ (pmc->block[blk_num].type == MLXBF_PERFTYPE_CRSPACE)) { - pmc->block[blk_num].attr_enable.attr.mode = - 0644; - pmc->block[blk_num].attr_enable.show = -@@ -1092,6 +1231,8 @@ static int mlxbf_pmc_probe(struct platform_device *pdev) - pmc->event_set = MLNX_EVENT_SET_BF1; - else if (strcmp(hid, "MLNXBFD1") == 0) - pmc->event_set = MLNX_EVENT_SET_BF2; -+ else if (strcmp(hid, "MLNXBFD2") == 0) -+ pmc->event_set = MLNX_EVENT_SET_BF3; - else { - dev_err(dev, "Invalid device ID %s\n", hid); - err = -ENODEV; -@@ -1115,13 +1256,23 @@ static int mlxbf_pmc_probe(struct platform_device *pdev) - } - - if (device_property_read_u32(dev, "tile_num", &pmc->tile_count)) { -- dev_err(dev, "Number of tiles undefined\n"); -- err = -EINVAL; -- goto error; -+ if (device_property_read_u8(dev, "llt_enable", -+ &pmc->llt_enable)) { -+ dev_err(dev, "Number of tiles/LLTs undefined\n"); -+ err = -EINVAL; -+ goto error; -+ } -+ if (device_property_read_u8(dev, "mss_enable", -+ &pmc->mss_enable)) { -+ dev_err(dev, "Number of tiles/MSSs undefined\n"); -+ err = -EINVAL; -+ goto error; -+ } - } - - /* Map the Performance Counters from the varios blocks */ - for (i = 0; i < pmc->total_blocks; ++i) { -+ /* Check if block number is within tile_count */ - if (strstr(pmc->block_name[i], "tile")) { - int tile_num; - -@@ -1133,6 +1284,44 @@ static int mlxbf_pmc_probe(struct platform_device *pdev) - if (tile_num >= pmc->tile_count) - continue; - } -+ -+ /* Create sysfs directories only for enabled MSS blocks */ -+ if (strstr(pmc->block_name[i], "mss") && -+ pmc->event_set == MLNX_EVENT_SET_BF3) { -+ int mss_num; -+ -+ ret = sscanf(pmc->block_name[i], "mss%d", &mss_num); -+ if (ret < 0) { -+ err = -EINVAL; -+ goto error; -+ } -+ if (!((pmc->mss_enable >> mss_num) & 0x1)) -+ continue; -+ } -+ -+ /* Create sysfs directories only for enabled LLTs */ -+ if (strstr(pmc->block_name[i], "llt_miss")) { -+ int llt_num; -+ -+ ret = sscanf(pmc->block_name[i], "llt_miss%d", &llt_num); -+ if (ret < 0) { -+ err = -EINVAL; -+ goto error; -+ } -+ if (!((pmc->llt_enable >> llt_num) & 0x1)) -+ continue; -+ } else if (strstr(pmc->block_name[i], "llt")) { -+ int llt_num; -+ -+ ret = sscanf(pmc->block_name[i], "llt%d", &llt_num); -+ if (ret < 0) { -+ err = -EINVAL; -+ goto error; -+ } -+ if (!((pmc->llt_enable >> llt_num) & 0x1)) -+ continue; -+ } -+ - err = device_property_read_u64_array(dev, pmc->block_name[i], - info, 4); - if (err) { -@@ -1215,6 +1404,7 @@ static int mlxbf_pmc_remove(struct platform_device *pdev) - static const struct acpi_device_id pmc_acpi_ids[] = { - {"MLNXBFD0", 0}, - {"MLNXBFD1", 0}, -+ {"MLNXBFD2", 0}, - {}, - }; - -diff --git a/drivers/platform/mellanox/mlxbf-pmc.h b/drivers/platform/mellanox/mlxbf-pmc.h -index a6f7aade4..fe2516616 100644 ---- a/drivers/platform/mellanox/mlxbf-pmc.h -+++ b/drivers/platform/mellanox/mlxbf-pmc.h -@@ -16,6 +16,7 @@ - - #define MLNX_EVENT_SET_BF1 0 - #define MLNX_EVENT_SET_BF2 1 -+#define MLNX_EVENT_SET_BF3 2 - - #define MLNX_PMC_SVC_REQ_MAJOR 0 - #define MLNX_PMC_SVC_MIN_MINOR 3 -@@ -55,6 +56,8 @@ struct mlxbf_pmc_block_info { - * @pdev: The kernel structure representing the device - * @total_blocks: Total number of blocks - * @tile_count: Number of tiles in the system -+ * @llt_enable: Info on enabled LLTs -+ * @mss_enable: Info on enabled MSSs - * @hwmon_dev: Hwmon device for bfperf - * @ko: Kobject for bfperf - * @block_name: Block name -@@ -67,6 +70,8 @@ struct mlxbf_pmc_context { - struct platform_device *pdev; - uint32_t total_blocks; - uint32_t tile_count; -+ uint8_t llt_enable; -+ uint8_t mss_enable; - struct device *hwmon_dev; - struct kobject *ko; - const char *block_name[MLXBF_PMC_MAX_BLOCKS]; -@@ -76,16 +81,17 @@ struct mlxbf_pmc_context { - unsigned int event_set; - }; - --#define MLXBF_PERFTYPE_COUNTER 1 - #define MLXBF_PERFTYPE_REGISTER 0 -+#define MLXBF_PERFTYPE_COUNTER 1 -+#define MLXBF_PERFTYPE_CRSPACE 2 - --#define MLXBF_PERFCTL 0 --#define MLXBF_PERFEVT 1 --#define MLXBF_PERFVALEXT 2 --#define MLXBF_PERFACC0 4 --#define MLXBF_PERFACC1 5 --#define MLXBF_PERFMVAL0 6 --#define MLXBF_PERFMVAL1 7 -+#define MLXBF_PERFCTL 0 -+#define MLXBF_PERFEVT 1 -+#define MLXBF_PERFVALEXT 2 -+#define MLXBF_PERFACC0 4 -+#define MLXBF_PERFACC1 5 -+#define MLXBF_PERFMVAL0 6 -+#define MLXBF_PERFMVAL1 7 - - #define MLXBF_GEN_PERFMON_CONFIG__WR_R_B BIT(0) - #define MLXBF_GEN_PERFMON_CONFIG__STROBE BIT(1) -@@ -143,6 +149,14 @@ struct mlxbf_pmc_context { - #define MLXBF_L3C_PERF_CNT_LOW__VAL GENMASK(31, 0) - #define MLXBF_L3C_PERF_CNT_HIGH__VAL GENMASK(24, 0) - -+#define MLXBF_CRSPACE_PERFMON_REG0 0x0 -+#define MLXBF_CRSPACE_PERFSEL0 GENMASK(23, 16) -+#define MLXBF_CRSPACE_PERFSEL1 GENMASK(7, 0) -+#define MLXBF_CRSPACE_PERFMON_CTL 0x40 -+#define MLXBF_CRSPACE_PERFMON_EN BIT(30) -+#define MLXBF_CRSPACE_PERFMON_CLR BIT(28) -+#define MLXBF_CRSPACE_PERFMON_VAL0 0x4c -+ - struct mlxbf_pmc_events { - uint32_t evt_num; - char *evt_name; -@@ -431,4 +445,419 @@ struct mlxbf_pmc_events mlxbf_l3cache_events[] = { - {-1, NULL} - }; - -+struct mlxbf_pmc_events mlxbf3_llt_events[] = { -+{0, "HNF0_CYCLES"}, -+{1, "HNF0_REQS_RECEIVED"}, -+{2, "HNF0_REQS_PROCESSED"}, -+{3, "HNF0_DIR_HIT"}, -+{4, "HNF0_DIR_MISS"}, -+{5, "HNF0_DIR_RD_ALLOC"}, -+{6, "HNF0_DIR_WR_ALLOC"}, -+{7, "HNF0_DIR_VICTIM"}, -+{8, "HNF0_CL_HAZARD"}, -+{9, "HNF0_ALL_HAZARD"}, -+{10, "HNF0_PIPE_STALLS"}, -+{11, "HNF0_MEM_READS"}, -+{12, "HNF0_MEM_WRITES"}, -+{13, "HNF0_MEM_ACCESS"}, -+{14, "HNF0_DCL_READ"}, -+{15, "HNF0_DCL_INVAL"}, -+{16, "HNF0_CHI_RXDAT"}, -+{17, "HNF0_CHI_RXRSP"}, -+{18, "HNF0_CHI_TXDAT"}, -+{19, "HNF0_CHI_TXRSP"}, -+{20, "HNF0_CHI_TXSNP"}, -+{21, "HNF0_DCT_SNP"}, -+{22, "HNF0_SNP_FWD_DATA"}, -+{23, "HNF0_SNP_FWD_RSP"}, -+{24, "HNF0_SNP_RSP"}, -+{25, "HNF0_EXCL_FULL"}, -+{26, "HNF0_EXCL_WRITE_F"}, -+{27, "HNF0_EXCL_WRITE_S"}, -+{28, "HNF0_EXCL_WRITE"}, -+{29, "HNF0_EXCL_READ"}, -+{30, "HNF0_REQ_BUF_EMPTY"}, -+{31, "HNF0_ALL_MAFS_BUSY"}, -+{32, "HNF0_TXDAT_NO_LCRD"}, -+{33, "HNF0_TXSNP_NO_LCRD"}, -+{34, "HNF0_TXRSP_NO_LCRD"}, -+{35, "HNF0_TXREQ_NO_LCRD"}, -+{36, "HNF0_WRITE"}, -+{37, "HNF0_READ"}, -+{38, "HNF0_ACCESS"}, -+{39, "HNF0_MAF_N_BUSY"}, -+{40, "HNF0_MAF_N_REQS"}, -+{41, "HNF0_SEL_OPCODE"}, -+{42, "HNF1_CYCLES"}, -+{43, "HNF1_REQS_RECEIVED"}, -+{44, "HNF1_REQS_PROCESSED"}, -+{45, "HNF1_DIR_HIT"}, -+{46, "HNF1_DIR_MISS"}, -+{47, "HNF1_DIR_RD_ALLOC"}, -+{48, "HNF1_DIR_WR_ALLOC"}, -+{49, "HNF1_DIR_VICTIM"}, -+{50, "HNF1_CL_HAZARD"}, -+{51, "HNF1_ALL_HAZARD"}, -+{52, "HNF1_PIPE_STALLS"}, -+{53, "HNF1_MEM_READS"}, -+{54, "HNF1_MEM_WRITES"}, -+{55, "HNF1_MEM_ACCESS"}, -+{56, "HNF1_DCL_READ"}, -+{57, "HNF1_DCL_INVAL"}, -+{58, "HNF1_CHI_RXDAT"}, -+{59, "HNF1_CHI_RXRSP"}, -+{60, "HNF1_CHI_TXDAT"}, -+{61, "HNF1_CHI_TXRSP"}, -+{62, "HNF1_CHI_TXSNP"}, -+{63, "HNF1_DCT_SNP"}, -+{64, "HNF1_SNP_FWD_DATA"}, -+{65, "HNF1_SNP_FWD_RSP"}, -+{66, "HNF1_SNP_RSP"}, -+{67, "HNF1_EXCL_FULL"}, -+{68, "HNF1_EXCL_WRITE_F"}, -+{69, "HNF1_EXCL_WRITE_S"}, -+{70, "HNF1_EXCL_WRITE"}, -+{71, "HNF1_EXCL_READ"}, -+{72, "HNF1_REQ_BUF_EMPTY"}, -+{73, "HNF1_ALL_MAFS_BUSY"}, -+{74, "HNF1_TXDAT_NO_LCRD"}, -+{75, "HNF1_TXSNP_NO_LCRD"}, -+{76, "HNF1_TXRSP_NO_LCRD"}, -+{77, "HNF1_TXREQ_NO_LCRD"}, -+{78, "HNF1_WRITE"}, -+{79, "HNF1_READ"}, -+{80, "HNF1_ACCESS"}, -+{81, "HNF1_MAF_N_BUSY"}, -+{82, "HNF1_MAF_N_REQS"}, -+{83, "HNF1_SEL_OPCODE"}, -+{84, "GDC_BANK0_RD_REQ"}, -+{85, "GDC_BANK0_WR_REQ"}, -+{86, "GDC_BANK0_ALLOCATE"}, -+{87, "GDC_BANK0_HIT"}, -+{88, "GDC_BANK0_MISS"}, -+{89, "GDC_BANK0_INVALIDATE"}, -+{90, "GDC_BANK0_EVICT"}, -+{91, "GDC_BANK0_RD_RESP"}, -+{92, "GDC_BANK0_WR_ACK"}, -+{93, "GDC_BANK0_SNOOP"}, -+{94, "GDC_BANK0_SNOOP_NORMAL"}, -+{95, "GDC_BANK0_SNOOP_FWD"}, -+{96, "GDC_BANK0_SNOOP_STASH"}, -+{97, "GDC_BANK0_SNOOP_STASH_INDPND_RD"}, -+{98, "GDC_BANK0_FOLLOWER"}, -+{99, "GDC_BANK0_FW"}, -+{100, "GDC_BANK0_HIT_DCL_BOTH"}, -+{101, "GDC_BANK0_HIT_DCL_PARTIAL"}, -+{102, "GDC_BANK0_EVICT_DCL"}, -+{103, "GDC_BANK0_G_RSE_PIPE_CACHE_DATA0"}, -+{103, "GDC_BANK0_G_RSE_PIPE_CACHE_DATA1"}, -+{105, "GDC_BANK0_ARB_STRB"}, -+{106, "GDC_BANK0_ARB_WAIT"}, -+{107, "GDC_BANK0_GGA_STRB"}, -+{108, "GDC_BANK0_GGA_WAIT"}, -+{109, "GDC_BANK0_FW_STRB"}, -+{110, "GDC_BANK0_FW_WAIT"}, -+{111, "GDC_BANK0_SNP_STRB"}, -+{112, "GDC_BANK0_SNP_WAIT"}, -+{113, "GDC_BANK0_MISS_INARB_STRB"}, -+{114, "GDC_BANK0_MISS_INARB_WAIT"}, -+{115, "GDC_BANK0_G_FIFO_FF_GGA_RSP_RD0"}, -+{116, "GDC_BANK0_G_FIFO_FF_GGA_RSP_RD1"}, -+{117, "GDC_BANK0_G_FIFO_FF_GGA_RSP_RD2"}, -+{118, "GDC_BANK0_G_FIFO_FF_GGA_RSP_RD3"}, -+{119, "GDC_BANK0_G_FIFO_FF_GGA_RSP_WR0"}, -+{120, "GDC_BANK0_G_FIFO_FF_GGA_RSP_WR1"}, -+{121, "GDC_BANK0_G_FIFO_FF_GGA_RSP_WR2"}, -+{122, "GDC_BANK0_G_FIFO_FF_GGA_RSP_WR3"}, -+{123, "GDC_BANK1_RD_REQ"}, -+{124, "GDC_BANK1_WR_REQ"}, -+{125, "GDC_BANK1_ALLOCATE"}, -+{126, "GDC_BANK1_HIT"}, -+{127, "GDC_BANK1_MISS"}, -+{128, "GDC_BANK1_INVALIDATE"}, -+{129, "GDC_BANK1_EVICT"}, -+{130, "GDC_BANK1_RD_RESP"}, -+{131, "GDC_BANK1_WR_ACK"}, -+{132, "GDC_BANK1_SNOOP"}, -+{133, "GDC_BANK1_SNOOP_NORMAL"}, -+{134, "GDC_BANK1_SNOOP_FWD"}, -+{135, "GDC_BANK1_SNOOP_STASH"}, -+{136, "GDC_BANK1_SNOOP_STASH_INDPND_RD"}, -+{137, "GDC_BANK1_FOLLOWER"}, -+{138, "GDC_BANK1_FW"}, -+{139, "GDC_BANK1_HIT_DCL_BOTH"}, -+{140, "GDC_BANK1_HIT_DCL_PARTIAL"}, -+{141, "GDC_BANK1_EVICT_DCL"}, -+{142, "GDC_BANK1_G_RSE_PIPE_CACHE_DATA0"}, -+{143, "GDC_BANK1_G_RSE_PIPE_CACHE_DATA1"}, -+{144, "GDC_BANK1_ARB_STRB"}, -+{145, "GDC_BANK1_ARB_WAIT"}, -+{146, "GDC_BANK1_GGA_STRB"}, -+{147, "GDC_BANK1_GGA_WAIT"}, -+{148, "GDC_BANK1_FW_STRB"}, -+{149, "GDC_BANK1_FW_WAIT"}, -+{150, "GDC_BANK1_SNP_STRB"}, -+{151, "GDC_BANK1_SNP_WAIT"}, -+{152, "GDC_BANK1_MISS_INARB_STRB"}, -+{153, "GDC_BANK1_MISS_INARB_WAIT"}, -+{154, "GDC_BANK1_G_FIFO_FF_GGA_RSP_RD0"}, -+{155, "GDC_BANK1_G_FIFO_FF_GGA_RSP_RD1"}, -+{156, "GDC_BANK1_G_FIFO_FF_GGA_RSP_RD2"}, -+{157, "GDC_BANK1_G_FIFO_FF_GGA_RSP_RD3"}, -+{158, "GDC_BANK1_G_FIFO_FF_GGA_RSP_WR0"}, -+{159, "GDC_BANK1_G_FIFO_FF_GGA_RSP_WR1"}, -+{160, "GDC_BANK1_G_FIFO_FF_GGA_RSP_WR2"}, -+{161, "GDC_BANK1_G_FIFO_FF_GGA_RSP_WR3"}, -+{162, "HISTOGRAM_HISTOGRAM_BIN0"}, -+{163, "HISTOGRAM_HISTOGRAM_BIN1"}, -+{164, "HISTOGRAM_HISTOGRAM_BIN2"}, -+{165, "HISTOGRAM_HISTOGRAM_BIN3"}, -+{166, "HISTOGRAM_HISTOGRAM_BIN4"}, -+{167, "HISTOGRAM_HISTOGRAM_BIN5"}, -+{168, "HISTOGRAM_HISTOGRAM_BIN6"}, -+{169, "HISTOGRAM_HISTOGRAM_BIN7"}, -+{170, "HISTOGRAM_HISTOGRAM_BIN8"}, -+{171, "HISTOGRAM_HISTOGRAM_BIN9"}, -+{-1, NULL} -+}; -+ -+struct mlxbf_pmc_events mlxbf3_llt_miss_events[] = { -+{0, "GDC_MISS_MACHINE_RD_REQ"}, -+{1, "GDC_MISS_MACHINE_WR_REQ"}, -+{2, "GDC_MISS_MACHINE_SNP_REQ"}, -+{3, "GDC_MISS_MACHINE_EVICT_REQ"}, -+{4, "GDC_MISS_MACHINE_FW_REQ"}, -+{5, "GDC_MISS_MACHINE_RD_RESP"}, -+{6, "GDC_MISS_MACHINE_WR_RESP"}, -+{7, "GDC_MISS_MACHINE_SNP_STASH_DATAPULL_DROP"}, -+{8, "GDC_MISS_MACHINE_SNP_STASH_DATAPULL_DROP_TXDAT"}, -+{9, "GDC_MISS_MACHINE_CHI_TXREQ"}, -+{10, "GDC_MISS_MACHINE_CHI_RXRSP"}, -+{11, "GDC_MISS_MACHINE_CHI_TXDAT"}, -+{12, "GDC_MISS_MACHINE_CHI_RXDAT"}, -+{13, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC0_0"}, -+{14, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC0_1 "}, -+{15, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC0_2"}, -+{16, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC0_3 "}, -+{17, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC1_0 "}, -+{18, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC1_1 "}, -+{19, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC1_2 "}, -+{20, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC1_3 "}, -+{21, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC_DONE0_0"}, -+{22, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC_DONE0_1"}, -+{23, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC_DONE0_2"}, -+{24, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC_DONE0_3"}, -+{25, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC_DONE1_0 "}, -+{26, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC_DONE1_1"}, -+{27, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC_DONE1_2"}, -+{28, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC_DONE1_3"}, -+{29, "GDC_MISS_MACHINE_GDC_LINK_LIST_FF_0"}, -+{30, "GDC_MISS_MACHINE_GDC_LINK_LIST_FF_1"}, -+{31, "GDC_MISS_MACHINE_GDC_LINK_LIST_FF_2"}, -+{32, "GDC_MISS_MACHINE_GDC_LINK_LIST_FF_3"}, -+{33, "GDC_MISS_MACHINE_GDC_LINK_LIST_FF_4"}, -+{34, "GDC_MISS_MACHINE_GDC_LINK_LIST_FF_5"}, -+{35, "GDC_MISS_MACHINE_GDC_LINK_LIST_FF_6"}, -+{36, "GDC_MISS_MACHINE_G_RSE_PIPE_TXREQ_0"}, -+{37, "GDC_MISS_MACHINE_G_RSE_PIPE_TXREQ_1"}, -+{38, "GDC_MISS_MACHINE_G_CREDIT_TXREQ_0"}, -+{39, "GDC_MISS_MACHINE_G_CREDIT_TXREQ_1"}, -+{40, "GDC_MISS_MACHINE_G_RSE_PIPE_TXDAT_0"}, -+{41, "GDC_MISS_MACHINE_G_RSE_PIPE_TXDAT_1"}, -+{42, "GDC_MISS_MACHINE_G_CREDIT_TXDAT_0"}, -+{43, "GDC_MISS_MACHINE_G_CREDIT_TXDAT_1"}, -+{44, "GDC_MISS_MACHINE_G_FIFO_FF_COMPACK_0"}, -+{45, "GDC_MISS_MACHINE_G_FIFO_FF_COMPACK_1"}, -+{46, "GDC_MISS_MACHINE_G_FIFO_FF_COMPACK_2"}, -+{47, "GDC_MISS_MACHINE_G_FIFO_FF_COMPACK_3"}, -+{48, "GDC_MISS_MACHINE_G_RSE_PIPE_TXRSP_0"}, -+{49, "GDC_MISS_MACHINE_G_RSE_PIPE_TXRSP_1"}, -+{50, "GDC_MISS_MACHINE_G_CREDIT_TXRSP_0"}, -+{51, "GDC_MISS_MACHINE_G_CREDIT_TXRSP_1"}, -+{52, "GDC_MISS_MACHINE_G_RSE_PIPE_INARB_0"}, -+{53, "GDC_MISS_MACHINE_G_RSE_PIPE_INARB_1"}, -+{54, "GDC_MISS_MACHINE_G_FIFO_FF_SNOOP_IN_0"}, -+{55, "GDC_MISS_MACHINE_G_FIFO_FF_SNOOP_IN_1"}, -+{56, "GDC_MISS_MACHINE_G_FIFO_FF_SNOOP_IN_2"}, -+{57, "GDC_MISS_MACHINE_G_FIFO_FF_SNOOP_IN_3"}, -+{58, "GDC_MISS_MACHINE_G_FIFO_FF_TXRSP_SNOOP_DATAPULL_0"}, -+{59, "GDC_MISS_MACHINE_G_FIFO_FF_TXRSP_SNOOP_DATAPULL_1"}, -+{60, "GDC_MISS_MACHINE_G_FIFO_FF_TXRSP_SNOOP_DATAPULL_2"}, -+{61, "GDC_MISS_MACHINE_G_FIFO_FF_TXRSP_SNOOP_DATAPULL_3"}, -+{62, "GDC_MISS_MACHINE_G_FIFO_FF_TXDAT_SNOOP_DATAPULL_4"}, -+{63, "GDC_MISS_MACHINE_G_FIFO_FF_TXDAT_SNOOP_DATAPULL_5"}, -+{64, "GDC_MISS_MACHINE_G_FIFO_FF_TXDAT_SNOOP_DATAPULL_6"}, -+{65, "GDC_MISS_MACHINE_G_FIFO_FF_TXDAT_SNOOP_DATAPULL_7"}, -+{66, "HISTOGRAM_HISTOGRAM_BIN0"}, -+{67, "HISTOGRAM_HISTOGRAM_BIN1"}, -+{68, "HISTOGRAM_HISTOGRAM_BIN2"}, -+{69, "HISTOGRAM_HISTOGRAM_BIN3"}, -+{70, "HISTOGRAM_HISTOGRAM_BIN4"}, -+{71, "HISTOGRAM_HISTOGRAM_BIN5"}, -+{72, "HISTOGRAM_HISTOGRAM_BIN6"}, -+{73, "HISTOGRAM_HISTOGRAM_BIN7"}, -+{74, "HISTOGRAM_HISTOGRAM_BIN8"}, -+{75, "HISTOGRAM_HISTOGRAM_BIN9"}, -+{-1, NULL} -+}; -+ -+struct mlxbf_pmc_events mlxbf3_mss_events[] = { -+{0, "SKYLIB_CDN_TX_FLITS"}, -+{1, "SKYLIB_DDN_TX_FLITS"}, -+{2, "SKYLIB_NDN_TX_FLITS"}, -+{3, "SKYLIB_SDN_TX_FLITS"}, -+{4, "SKYLIB_UDN_TX_FLITS"}, -+{5, "SKYLIB_CDN_RX_FLITS"}, -+{6, "SKYLIB_DDN_RX_FLITS"}, -+{7, "SKYLIB_NDN_RX_FLITS"}, -+{8, "SKYLIB_SDN_RX_FLITS"}, -+{9, "SKYLIB_UDN_RX_FLITS"}, -+{10, "SKYLIB_CDN_TX_STALL"}, -+{11, "SKYLIB_DDN_TX_STALL"}, -+{12, "SKYLIB_NDN_TX_STALL"}, -+{13, "SKYLIB_SDN_TX_STALL"}, -+{14, "SKYLIB_UDN_TX_STALL"}, -+{15, "SKYLIB_CDN_RX_STALL"}, -+{16, "SKYLIB_DDN_RX_STALL"}, -+{17, "SKYLIB_NDN_RX_STALL"}, -+{18, "SKYLIB_SDN_RX_STALL"}, -+{19, "SKYLIB_UDN_RX_STALL"}, -+{20, "SKYLIB_CHI_REQ0_TX_FLITS"}, -+{21, "SKYLIB_CHI_DATA0_TX_FLITS"}, -+{22, "SKYLIB_CHI_RESP0_TX_FLITS"}, -+{23, "SKYLIB_CHI_SNP0_TX_FLITS"}, -+{24, "SKYLIB_CHI_REQ1_TX_FLITS"}, -+{25, "SKYLIB_CHI_DATA1_TX_FLITS"}, -+{26, "SKYLIB_CHI_RESP1_TX_FLITS"}, -+{27, "SKYLIB_CHI_SNP1_TX_FLITS"}, -+{28, "SKYLIB_CHI_REQ2_TX_FLITS"}, -+{29, "SKYLIB_CHI_DATA2_TX_FLITS"}, -+{30, "SKYLIB_CHI_RESP2_TX_FLITS"}, -+{31, "SKYLIB_CHI_SNP2_TX_FLITS"}, -+{32, "SKYLIB_CHI_REQ3_TX_FLITS"}, -+{33, "SKYLIB_CHI_DATA3_TX_FLITS"}, -+{34, "SKYLIB_CHI_RESP3_TX_FLITS"}, -+{35, "SKYLIB_CHI_SNP3_TX_FLITS"}, -+{36, "SKYLIB_TLP_REQ_TX_FLITS"}, -+{37, "SKYLIB_TLP_RESP_TX_FLITS"}, -+{38, "SKYLIB_TLP_META_TX_FLITS"}, -+{39, "SKYLIB_AXIS_DATA_TX_FLITS"}, -+{40, "SKYLIB_AXIS_CRED_TX_FLITS"}, -+{41, "SKYLIB_APB_TX_FLITS"}, -+{42, "SKYLIB_VW_TX_FLITS"}, -+{43, "SKYLIB_GGA_MSN_W_TX_FLITS"}, -+{44, "SKYLIB_GGA_MSN_N_TX_FLITS"}, -+{45, "SKYLIB_CR_REQ_TX_FLITS"}, -+{46, "SKYLIB_CR_RESP_TX_FLITS"}, -+{47, "SKYLIB_MSN_PRNF_TX_FLITS"}, -+{48, "SKYLIB_DBG_DATA_TX_FLITS"}, -+{49, "SKYLIB_DBG_CRED_TX_FLITS"}, -+{50, "SKYLIB_CHI_REQ0_RX_FLITS"}, -+{51, "SKYLIB_CHI_DATA0_RX_FLITS"}, -+{52, "SKYLIB_CHI_RESP0_RX_FLITS"}, -+{53, "SKYLIB_CHI_SNP0_RX_FLITS"}, -+{54, "SKYLIB_CHI_REQ1_RX_FLITS"}, -+{55, "SKYLIB_CHI_DATA1_RX_FLITS"}, -+{56, "SKYLIB_CHI_RESP1_RX_FLITS"}, -+{57, "SKYLIB_CHI_SNP1_RX_FLITS"}, -+{58, "SKYLIB_CHI_REQ2_RX_FLITS"}, -+{59, "SKYLIB_CHI_DATA2_RX_FLITS"}, -+{60, "SKYLIB_CHI_RESP2_RX_FLITS"}, -+{61, "SKYLIB_CHI_SNP2_RX_FLITS"}, -+{62, "SKYLIB_CHI_REQ3_RX_FLITS"}, -+{63, "SKYLIB_CHI_DATA3_RX_FLITS"}, -+{64, "SKYLIB_CHI_RESP3_RX_FLITS"}, -+{65, "SKYLIB_CHI_SNP3_RX_FLITS"}, -+{66, "SKYLIB_TLP_REQ_RX_FLITS"}, -+{67, "SKYLIB_TLP_RESP_RX_FLITS"}, -+{68, "SKYLIB_TLP_META_RX_FLITS"}, -+{69, "SKYLIB_AXIS_DATA_RX_FLITS"}, -+{70, "SKYLIB_AXIS_CRED_RX_FLITS"}, -+{71, "SKYLIB_APB_RX_FLITS"}, -+{72, "SKYLIB_VW_RX_FLITS"}, -+{73, "SKYLIB_GGA_MSN_W_RX_FLITS"}, -+{74, "SKYLIB_GGA_MSN_N_RX_FLITS"}, -+{75, "SKYLIB_CR_REQ_RX_FLITS"}, -+{76, "SKYLIB_CR_RESP_RX_FLITS"}, -+{77, "SKYLIB_MSN_PRNF_RX_FLITS"}, -+{78, "SKYLIB_DBG_DATA_RX_FLITS"}, -+{79, "SKYLIB_DBG_CRED_RX_FLITS"}, -+{80, "SKYLIB_CHI_REQ0_TX_STALL"}, -+{81, "SKYLIB_CHI_DATA0_TX_STALL"}, -+{82, "SKYLIB_CHI_RESP0_TX_STALL"}, -+{83, "SKYLIB_CHI_SNP0_TX_STALL"}, -+{84, "SKYLIB_CHI_REQ1_TX_STALL"}, -+{85, "SKYLIB_CHI_DATA1_TX_STALL"}, -+{86, "SKYLIB_CHI_RESP1_TX_STALL"}, -+{87, "SKYLIB_CHI_SNP1_TX_STALL"}, -+{88, "SKYLIB_CHI_REQ2_TX_STALL"}, -+{89, "SKYLIB_CHI_DATA2_TX_STALL"}, -+{90, "SKYLIB_CHI_RESP2_TX_STALL"}, -+{91, "SKYLIB_CHI_SNP2_TX_STALL"}, -+{92, "SKYLIB_CHI_REQ3_TX_STALL"}, -+{93, "SKYLIB_CHI_DATA3_TX_STALL"}, -+{94, "SKYLIB_CHI_RESP3_TX_STALL"}, -+{95, "SKYLIB_CHI_SNP3_TX_STALL"}, -+{96, "SKYLIB_TLP_REQ_TX_STALL"}, -+{97, "SKYLIB_TLP_RESP_TX_STALL"}, -+{98, "SKYLIB_TLP_META_TX_STALL"}, -+{99, "SKYLIB_AXIS_DATA_TX_STALL"}, -+{100, "SKYLIB_AXIS_CRED_TX_STALL"}, -+{101, "SKYLIB_APB_TX_STALL"}, -+{102, "SKYLIB_VW_TX_STALL"}, -+{103, "SKYLIB_GGA_MSN_W_TX_STALL"}, -+{104, "SKYLIB_GGA_MSN_N_TX_STALL"}, -+{105, "SKYLIB_CR_REQ_TX_STALL"}, -+{106, "SKYLIB_CR_RESP_TX_STALL"}, -+{107, "SKYLIB_MSN_PRNF_TX_STALL"}, -+{108, "SKYLIB_DBG_DATA_TX_STALL"}, -+{109, "SKYLIB_DBG_CRED_TX_STALL"}, -+{110, "SKYLIB_CHI_REQ0_RX_STALL"}, -+{111, "SKYLIB_CHI_DATA0_RX_STALL"}, -+{112, "SKYLIB_CHI_RESP0_RX_STALL"}, -+{113, "SKYLIB_CHI_SNP0_RX_STALL"}, -+{114, "SKYLIB_CHI_REQ1_RX_STALL"}, -+{115, "SKYLIB_CHI_DATA1_RX_STALL"}, -+{116, "SKYLIB_CHI_RESP1_RX_STALL"}, -+{117, "SKYLIB_CHI_SNP1_RX_STALL"}, -+{118, "SKYLIB_CHI_REQ2_RX_STALL"}, -+{119, "SKYLIB_CHI_DATA2_RX_STALL"}, -+{120, "SKYLIB_CHI_RESP2_RX_STALL"}, -+{121, "SKYLIB_CHI_SNP2_RX_STALL"}, -+{122, "SKYLIB_CHI_REQ3_RX_STALL"}, -+{123, "SKYLIB_CHI_DATA3_RX_STALL"}, -+{124, "SKYLIB_CHI_RESP3_RX_STALL"}, -+{125, "SKYLIB_CHI_SNP3_RX_STALL"}, -+{126, "SKYLIB_TLP_REQ_RX_STALL"}, -+{127, "SKYLIB_TLP_RESP_RX_STALL"}, -+{128, "SKYLIB_TLP_META_RX_STALL"}, -+{129, "SKYLIB_AXIS_DATA_RX_STALL"}, -+{130, "SKYLIB_AXIS_CRED_RX_STALL"}, -+{131, "SKYLIB_APB_RX_STALL"}, -+{132, "SKYLIB_VW_RX_STALL"}, -+{133, "SKYLIB_GGA_MSN_W_RX_STALL"}, -+{134, "SKYLIB_GGA_MSN_N_RX_STALL"}, -+{135, "SKYLIB_CR_REQ_RX_STALL"}, -+{136, "SKYLIB_CR_RESP_RX_STALL"}, -+{137, "SKYLIB_MSN_PRNF_RX_STALL"}, -+{138, "SKYLIB_DBG_DATA_RX_STALL"}, -+{139, "SKYLIB_DBG_CRED_RX_STALL"}, -+{140, "SKYLIB_CDN_LOOPBACK_FLITS"}, -+{141, "SKYLIB_DDN_LOOPBACK_FLITS"}, -+{142, "SKYLIB_NDN_LOOPBACK_FLITS"}, -+{143, "SKYLIB_SDN_LOOPBACK_FLITS"}, -+{144, "SKYLIB_UDN_LOOPBACK_FLITS"}, -+{145, "HISTOGRAM_HISTOGRAM_BIN0"}, -+{146, "HISTOGRAM_HISTOGRAM_BIN1"}, -+{147, "HISTOGRAM_HISTOGRAM_BIN2"}, -+{148, "HISTOGRAM_HISTOGRAM_BIN3"}, -+{149, "HISTOGRAM_HISTOGRAM_BIN4"}, -+{150, "HISTOGRAM_HISTOGRAM_BIN5"}, -+{151, "HISTOGRAM_HISTOGRAM_BIN6"}, -+{152, "HISTOGRAM_HISTOGRAM_BIN7"}, -+{153, "HISTOGRAM_HISTOGRAM_BIN8"}, -+{154, "HISTOGRAM_HISTOGRAM_BIN9"}, -+{-1, NULL} -+}; -+ - #endif /* __MLXBF_PMC_H__ */ --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0264-UBUNTU-SAUCE-platform-mellanox-Add-ctrl-message-and-.patch b/platform/mellanox/non-upstream-patches/patches/0264-UBUNTU-SAUCE-platform-mellanox-Add-ctrl-message-and-.patch deleted file mode 100644 index 14a99412887e..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0264-UBUNTU-SAUCE-platform-mellanox-Add-ctrl-message-and-.patch +++ /dev/null @@ -1,275 +0,0 @@ -From cafef2e9c3fc7113396fb53f55e0b6dfa6115e6a Mon Sep 17 00:00:00 2001 -From: Liming Sun -Date: Thu, 12 Jan 2023 13:58:47 -0500 -Subject: [PATCH backport 5.10 5/6] UBUNTU: SAUCE: platform/mellanox: Add ctrl - message and MAC configuration - -BugLink: https://bugs.launchpad.net/bugs/2002689 - -This commit adds control message support and MAC configuration -based on the control message. - -Signed-off-by: Liming Sun -Acked-by: Bartlomiej Zolnierkiewicz -Acked-by: Tim Gardner -[bzolnier: use a short URL version for BugLink] -Signed-off-by: Bartlomiej Zolnierkiewicz ---- - drivers/platform/mellanox/mlxbf-tmfifo.c | 172 ++++++++++++++++++++--- - 1 file changed, 151 insertions(+), 21 deletions(-) - -diff --git a/drivers/platform/mellanox/mlxbf-tmfifo.c b/drivers/platform/mellanox/mlxbf-tmfifo.c -index f401bbbd0..97956c9c9 100644 ---- a/drivers/platform/mellanox/mlxbf-tmfifo.c -+++ b/drivers/platform/mellanox/mlxbf-tmfifo.c -@@ -159,7 +159,9 @@ struct mlxbf_tmfifo_irq_info { - * @timer: background timer - * @vring: Tx/Rx ring - * @spin_lock: Tx/Rx spin lock -+ * @ctrl_mac: MAC address received in control message - * @is_ready: ready flag -+ * @send_ctrl: flag to send control message when ready - */ - struct mlxbf_tmfifo { - struct mlxbf_tmfifo_vdev *vdev[MLXBF_TMFIFO_VDEV_MAX]; -@@ -180,7 +182,16 @@ struct mlxbf_tmfifo { - struct timer_list timer; - struct mlxbf_tmfifo_vring *vring[2]; - spinlock_t spin_lock[2]; /* spin lock */ -- bool is_ready; -+ u8 ctrl_mac[ETH_ALEN]; -+ u32 is_ready : 1; -+ u32 send_ctrl : 1; -+}; -+ -+/* Internal message types defined in reverse order starting from 0xFF. */ -+enum { -+ MLXBF_TMFIFO_MSG_CTRL_REQ = 0xFD, -+ MLXBF_TMFIFO_MSG_MAC_1 = 0xFE, -+ MLXBF_TMFIFO_MSG_MAC_2 = 0xFF - }; - - /** -@@ -190,11 +201,17 @@ struct mlxbf_tmfifo { - * will be read by the other side as data stream in the same byte order. - * The length needs to be encoded into network order so both sides - * could understand it. -+ * @mac: first or second half of the MAC address depending on the type. -+ * @checksum: checksum of the message header (only control message for now). - */ - struct mlxbf_tmfifo_msg_hdr { - u8 type; - __be16 len; -- u8 unused[5]; -+ union { -+ u8 mac[3]; -+ u8 unused[4]; -+ } __packed; -+ u8 checksum; - } __packed __aligned(sizeof(u64)); - - /* -@@ -491,6 +508,8 @@ static int mlxbf_tmfifo_get_rx_avail(struct mlxbf_tmfifo *fifo) - return FIELD_GET(MLXBF_TMFIFO_RX_STS__COUNT_MASK, sts); - } - -+ -+ - /* Get the number of available words in the TmFifo for sending. */ - static int mlxbf_tmfifo_get_tx_avail(struct mlxbf_tmfifo *fifo, int vdev_id) - { -@@ -509,6 +528,127 @@ static int mlxbf_tmfifo_get_tx_avail(struct mlxbf_tmfifo *fifo, int vdev_id) - return fifo->tx_fifo_size - tx_reserve - count; - } - -+/* Read the configured network MAC address from efi variable. */ -+static void mlxbf_tmfifo_get_cfg_mac(u8 *mac) -+{ -+ efi_guid_t guid = EFI_GLOBAL_VARIABLE_GUID; -+ unsigned long size = ETH_ALEN; -+ u8 buf[ETH_ALEN]; -+ efi_status_t rc; -+ -+ rc = efi.get_variable(mlxbf_tmfifo_efi_name, &guid, NULL, &size, buf); -+ if (rc == EFI_SUCCESS && size == ETH_ALEN) -+ ether_addr_copy(mac, buf); -+ else -+ ether_addr_copy(mac, mlxbf_tmfifo_net_default_mac); -+} -+ -+/* Set the configured network MAC address into efi variable. */ -+static efi_status_t mlxbf_tmfifo_set_cfg_mac(u8 *mac) -+{ -+ efi_guid_t guid = EFI_GLOBAL_VARIABLE_GUID; -+ efi_status_t status = EFI_SUCCESS; -+ u8 old_mac[ETH_ALEN] = {0}; -+ -+ mlxbf_tmfifo_get_cfg_mac(old_mac); -+ -+ if (memcmp(old_mac, mac, ETH_ALEN)) { -+ status = efi.set_variable(mlxbf_tmfifo_efi_name, &guid, -+ EFI_VARIABLE_NON_VOLATILE | -+ EFI_VARIABLE_BOOTSERVICE_ACCESS | -+ EFI_VARIABLE_RUNTIME_ACCESS, -+ ETH_ALEN, mac); -+ } -+ -+ return status; -+} -+ -+/* Just adds up all the bytes of the header. */ -+static u8 mlxbf_tmfifo_ctrl_checksum(struct mlxbf_tmfifo_msg_hdr *hdr) -+{ -+ u8 checksum = 0; -+ int i; -+ -+ for (i = 0; i < sizeof(*hdr); i++) -+ checksum += ((u8 *)hdr)[i]; -+ -+ return checksum; -+} -+ -+static void mlxbf_tmfifo_ctrl_update_checksum(struct mlxbf_tmfifo_msg_hdr *hdr) -+{ -+ u8 checksum; -+ -+ hdr->checksum = 0; -+ checksum = mlxbf_tmfifo_ctrl_checksum(hdr); -+ hdr->checksum = ~checksum + 1; -+} -+ -+static bool mlxbf_tmfifo_ctrl_verify_checksum(struct mlxbf_tmfifo_msg_hdr *hdr) -+{ -+ u8 checksum = mlxbf_tmfifo_ctrl_checksum(hdr); -+ -+ return checksum ? false : true; -+} -+ -+static void mlxbf_tmfifo_ctrl_rx(struct mlxbf_tmfifo *fifo, -+ struct mlxbf_tmfifo_msg_hdr *hdr) -+{ -+ if (!mlxbf_tmfifo_ctrl_verify_checksum(hdr)) -+ return; -+ -+ switch (hdr->type) { -+ case MLXBF_TMFIFO_MSG_CTRL_REQ: -+ /* -+ * Set a flag to send the MAC address later. It can't be sent -+ * here since another packet might be still in the middle of -+ * transmission. -+ */ -+ fifo->send_ctrl = 1; -+ test_and_set_bit(MLXBF_TM_TX_LWM_IRQ, &fifo->pend_events); -+ schedule_work(&fifo->work); -+ break; -+ case MLXBF_TMFIFO_MSG_MAC_1: -+ /* Get the first half of the MAC address. */ -+ memcpy(fifo->ctrl_mac, hdr->mac, sizeof(hdr->mac)); -+ break; -+ case MLXBF_TMFIFO_MSG_MAC_2: -+ /* Get the second half of the MAC address and update. */ -+ memcpy(fifo->ctrl_mac + sizeof(hdr->mac), hdr->mac, -+ sizeof(hdr->mac)); -+ mlxbf_tmfifo_set_cfg_mac(fifo->ctrl_mac); -+ break; -+ default: -+ break; -+ } -+} -+ -+static void mlxbf_tmfifo_ctrl_tx(struct mlxbf_tmfifo *fifo, int *num_avail) -+{ -+ struct mlxbf_tmfifo_msg_hdr hdr; -+ u8 mac[ETH_ALEN] = { 0 }; -+ -+ /* Send the MAC address with two control messages. */ -+ if (fifo->send_ctrl && *num_avail >= 2) { -+ mlxbf_tmfifo_get_cfg_mac(mac); -+ -+ hdr.type = MLXBF_TMFIFO_MSG_MAC_1; -+ hdr.len = 0; -+ memcpy(hdr.mac, mac, sizeof(hdr.mac)); -+ mlxbf_tmfifo_ctrl_update_checksum(&hdr); -+ writeq(*(u64 *)&hdr, fifo->tx_data); -+ (*num_avail)--; -+ -+ hdr.type = MLXBF_TMFIFO_MSG_MAC_2; -+ memcpy(hdr.mac, mac + sizeof(hdr.mac), sizeof(hdr.mac)); -+ mlxbf_tmfifo_ctrl_update_checksum(&hdr); -+ writeq(*(u64 *)&hdr, fifo->tx_data); -+ (*num_avail)--; -+ -+ fifo->send_ctrl = 0; -+ } -+} -+ - /* Console Tx (move data from the output buffer into the TmFifo). */ - static void mlxbf_tmfifo_console_tx(struct mlxbf_tmfifo *fifo, int avail) - { -@@ -634,9 +774,11 @@ static void mlxbf_tmfifo_rxtx_header(struct mlxbf_tmfifo_vring *vring, - /* Drain one word from the FIFO. */ - *(u64 *)&hdr = readq(fifo->rx_data); - -- /* Skip the length 0 packets (keepalive). */ -- if (hdr.len == 0) -+ /* Handle the zero-length packets (control msg). */ -+ if (hdr.len == 0) { -+ mlxbf_tmfifo_ctrl_rx(fifo, &hdr); - return; -+ } - - /* Check packet type. */ - if (hdr.type == VIRTIO_ID_NET) { -@@ -804,6 +946,9 @@ static void mlxbf_tmfifo_rxtx(struct mlxbf_tmfifo_vring *vring, bool is_rx) - - /* Console output always comes from the Tx buffer. */ - if (!is_rx && devid == VIRTIO_ID_CONSOLE) { -+ /* Check if there is any control data to send. */ -+ mlxbf_tmfifo_ctrl_tx(fifo, &avail); -+ - mlxbf_tmfifo_console_tx(fifo, avail); - break; - } -@@ -1149,21 +1294,6 @@ static int mlxbf_tmfifo_delete_vdev(struct mlxbf_tmfifo *fifo, int vdev_id) - return 0; - } - --/* Read the configured network MAC address from efi variable. */ --static void mlxbf_tmfifo_get_cfg_mac(u8 *mac) --{ -- efi_guid_t guid = EFI_GLOBAL_VARIABLE_GUID; -- unsigned long size = ETH_ALEN; -- u8 buf[ETH_ALEN]; -- efi_status_t rc; -- -- rc = efi.get_variable(mlxbf_tmfifo_efi_name, &guid, NULL, &size, buf); -- if (rc == EFI_SUCCESS && size == ETH_ALEN) -- ether_addr_copy(mac, buf); -- else -- ether_addr_copy(mac, mlxbf_tmfifo_net_default_mac); --} -- - /* Set TmFifo thresolds which is used to trigger interrupts. */ - static void mlxbf_tmfifo_set_threshold(struct mlxbf_tmfifo *fifo) - { -@@ -1196,7 +1326,7 @@ static void mlxbf_tmfifo_cleanup(struct mlxbf_tmfifo *fifo) - { - int i; - -- fifo->is_ready = false; -+ fifo->is_ready = 0; - del_timer_sync(&fifo->timer); - mlxbf_tmfifo_disable_irqs(fifo); - cancel_work_sync(&fifo->work); -@@ -1296,7 +1426,7 @@ static int mlxbf_tmfifo_probe(struct platform_device *pdev) - - mod_timer(&fifo->timer, jiffies + MLXBF_TMFIFO_TIMER_INTERVAL); - -- fifo->is_ready = true; -+ fifo->is_ready = 1; - return 0; - - fail: --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0266-UBUNTU-SAUCE-mlxbf-pmc-Bug-fix-for-BlueField-3-count.patch b/platform/mellanox/non-upstream-patches/patches/0266-UBUNTU-SAUCE-mlxbf-pmc-Bug-fix-for-BlueField-3-count.patch deleted file mode 100644 index 12bd08f7daac..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0266-UBUNTU-SAUCE-mlxbf-pmc-Bug-fix-for-BlueField-3-count.patch +++ /dev/null @@ -1,94 +0,0 @@ -From 8cceb490410ba87b8f50ecbc5576f8eaab9f31bd Mon Sep 17 00:00:00 2001 -From: Shravan Kumar Ramani -Date: Tue, 31 Jan 2023 03:20:57 -0500 -Subject: [PATCH 11/12] UBUNTU: SAUCE: mlxbf-pmc: Bug fix for BlueField-3 - counter offsets -X-NVConfidentiality: public - -BugLink: https://bugs.launchpad.net/bugs/2004235 - -The performance counter modules inside each HW block are not -identical and are dependent on the number of counters present -in each case. Hence the offsets for the control and data regs -should be calculated accordingly. - -Signed-off-by: Shravan Kumar Ramani -Acked-by: Tim Gardner -Acked-by: Bartlomiej Zolnierkiewicz -Signed-off-by: Bartlomiej Zolnierkiewicz ---- - drivers/platform/mellanox/mlxbf-pmc.c | 12 +++++++----- - drivers/platform/mellanox/mlxbf-pmc.h | 4 ++-- - 2 files changed, 9 insertions(+), 7 deletions(-) - -diff --git a/drivers/platform/mellanox/mlxbf-pmc.c b/drivers/platform/mellanox/mlxbf-pmc.c -index 285b7433e..9be5a2d68 100644 ---- a/drivers/platform/mellanox/mlxbf-pmc.c -+++ b/drivers/platform/mellanox/mlxbf-pmc.c -@@ -427,7 +427,8 @@ int mlxbf_clear_crspace_counter(int blk_num, uint32_t cnt_num) - { - void *addr; - -- addr = pmc->block[blk_num].mmio_base + MLXBF_CRSPACE_PERFMON_VAL0 + -+ addr = pmc->block[blk_num].mmio_base + -+ MLXBF_CRSPACE_PERFMON_VAL0(pmc->block[blk_num].counters) + - (cnt_num * 4); - - return mlxbf_pmc_writel(0x0, addr); -@@ -532,7 +533,8 @@ int mlxbf_read_crspace_counter(int blk_num, uint32_t cnt_num, uint64_t *result) - int status = 0; - - status = mlxbf_pmc_readl(&value, pmc->block[blk_num].mmio_base + -- MLXBF_CRSPACE_PERFMON_VAL0 + (cnt_num * 4)); -+ MLXBF_CRSPACE_PERFMON_VAL0(pmc->block[blk_num].counters) + -+ (cnt_num * 4)); - if (status) - return status; - -@@ -935,7 +937,7 @@ static ssize_t mlxbf_show_counter_state(struct kobject *ko, - - if (pmc->block[blk_num].type == MLXBF_PERFTYPE_CRSPACE) { - err = mlxbf_pmc_readl(&word, pmc->block[blk_num].mmio_base + -- MLXBF_CRSPACE_PERFMON_CTL); -+ MLXBF_CRSPACE_PERFMON_CTL(pmc->block[blk_num].counters)); - if (err) - return -EINVAL; - value = FIELD_GET(MLXBF_CRSPACE_PERFMON_EN, word); -@@ -967,7 +969,7 @@ static ssize_t mlxbf_enable_counters(struct kobject *ko, - return err; - if (pmc->block[blk_num].type == MLXBF_PERFTYPE_CRSPACE) { - err = mlxbf_pmc_readl(&word, pmc->block[blk_num].mmio_base + -- MLXBF_CRSPACE_PERFMON_CTL); -+ MLXBF_CRSPACE_PERFMON_CTL(pmc->block[blk_num].counters)); - if (err) - return -EINVAL; - word &= ~MLXBF_CRSPACE_PERFMON_EN; -@@ -975,7 +977,7 @@ static ssize_t mlxbf_enable_counters(struct kobject *ko, - if (en) - word |= FIELD_PREP(MLXBF_CRSPACE_PERFMON_CLR, 1); - mlxbf_pmc_writel(word, pmc->block[blk_num].mmio_base + -- MLXBF_CRSPACE_PERFMON_CTL); -+ MLXBF_CRSPACE_PERFMON_CTL(pmc->block[blk_num].counters)); - } else { - if (en == 0) { - err = mlxbf_config_l3_counters(blk_num, false, false); -diff --git a/drivers/platform/mellanox/mlxbf-pmc.h b/drivers/platform/mellanox/mlxbf-pmc.h -index fe2516616..2ee7efc3b 100644 ---- a/drivers/platform/mellanox/mlxbf-pmc.h -+++ b/drivers/platform/mellanox/mlxbf-pmc.h -@@ -152,10 +152,10 @@ struct mlxbf_pmc_context { - #define MLXBF_CRSPACE_PERFMON_REG0 0x0 - #define MLXBF_CRSPACE_PERFSEL0 GENMASK(23, 16) - #define MLXBF_CRSPACE_PERFSEL1 GENMASK(7, 0) --#define MLXBF_CRSPACE_PERFMON_CTL 0x40 -+#define MLXBF_CRSPACE_PERFMON_CTL(n) (n * 2) - #define MLXBF_CRSPACE_PERFMON_EN BIT(30) - #define MLXBF_CRSPACE_PERFMON_CLR BIT(28) --#define MLXBF_CRSPACE_PERFMON_VAL0 0x4c -+#define MLXBF_CRSPACE_PERFMON_VAL0(n) (MLXBF_CRSPACE_PERFMON_CTL(n) + 0xc) - - struct mlxbf_pmc_events { - uint32_t evt_num; --- -2.14.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0267-UBUNTU-SAUCE-mmc-sdhci-of-dwcmshc-add-the-missing-de.patch b/platform/mellanox/non-upstream-patches/patches/0267-UBUNTU-SAUCE-mmc-sdhci-of-dwcmshc-add-the-missing-de.patch deleted file mode 100644 index c61486cf283b..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0267-UBUNTU-SAUCE-mmc-sdhci-of-dwcmshc-add-the-missing-de.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 51ec31f1bfb39fd87dea8861b4642d03cbd6c887 Mon Sep 17 00:00:00 2001 -From: Liming Sun -Date: Fri, 3 Feb 2023 07:52:18 -0500 -Subject: [PATCH 12/12] UBUNTU: SAUCE: mmc: sdhci-of-dwcmshc: add the missing - device table IDs for acpi -X-NVConfidentiality: public - -BugLink: https://bugs.launchpad.net/bugs/2004645 - -This commit adds the missing MODULE_DEVICE_TABLE for acpi, or else -it won't be loaded automatically when compiled as a kernel module. - -Signed-off-by: Liming Sun -Acked-by: Tim Gardner -Acked-by: Bartlomiej Zolnierkiewicz -[bzolnier: use a short URL version for BugLink] -Signed-off-by: Bartlomiej Zolnierkiewicz ---- - drivers/mmc/host/sdhci-of-dwcmshc.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/drivers/mmc/host/sdhci-of-dwcmshc.c b/drivers/mmc/host/sdhci-of-dwcmshc.c -index ea972bd3c..565489ee7 100644 ---- a/drivers/mmc/host/sdhci-of-dwcmshc.c -+++ b/drivers/mmc/host/sdhci-of-dwcmshc.c -@@ -349,6 +349,7 @@ static const struct acpi_device_id sdhci_dwcmshc_acpi_ids[] = { - }, - {} - }; -+MODULE_DEVICE_TABLE(acpi, sdhci_dwcmshc_acpi_ids); - #endif - - static int dwcmshc_probe(struct platform_device *pdev) --- -2.14.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0268-DS-mlxsw-core_linecards-Disable-firmware-bundling-ma.patch b/platform/mellanox/non-upstream-patches/patches/0268-DS-mlxsw-core_linecards-Disable-firmware-bundling-ma.patch deleted file mode 100644 index aa0911482009..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0268-DS-mlxsw-core_linecards-Disable-firmware-bundling-ma.patch +++ /dev/null @@ -1,30 +0,0 @@ -From a98a8781b6a6fad632a0fcaa3c78a05007b15f2e Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Mon, 20 Feb 2023 15:15:46 +0200 -Subject: [PATCH net backport 5.10 1/1] DS: mlxsw: core_linecards: Disable - firmware bundling macros - -Remove line card firmware bundling flow in non upstream environment to -avoid warning in case path /lib/firmware/mellanox is not available. - -Signed-off-by: Vadim Pasternak ---- - drivers/net/ethernet/mellanox/mlxsw/core_linecards.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c b/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c -index 30665a6f3..4bae0643a 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/core_linecards.c -@@ -1501,5 +1501,7 @@ void mlxsw_linecards_event_ops_unregister(struct mlxsw_core *mlxsw_core, - } - } - EXPORT_SYMBOL(mlxsw_linecards_event_ops_unregister); -- -+/* Skip for non-upstream flow. */ -+#if 0 - MODULE_FIRMWARE(MLXSW_LINECARDS_INI_BUNDLE_FILE); -+#endif --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0275-mlxsw-Use-u16-for-local_port-field-instead-of-u8.patch b/platform/mellanox/non-upstream-patches/patches/0275-mlxsw-Use-u16-for-local_port-field-instead-of-u8.patch deleted file mode 100644 index 02c1a875ea94..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0275-mlxsw-Use-u16-for-local_port-field-instead-of-u8.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 2aa5016c277751bcc11c6874a58abbe194708f9f Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Thu, 9 Mar 2023 22:37:40 +0000 -Subject: [PATCH backport v.5.10 2/3] mlxsw: Use u16 for local_port field - instead of u8 - -Currently, local_port field is saved as u8, which means that maximum 256 -ports can be used. - -As preparation for Spectrum-4, which will support more than 256 ports, -local_port field should be extended. - -Save local_port as u16 to allow use of additional ports. - -Signed-off-by: Amit Cohen -Reviewed-by: Petr Machata -Signed-off-by: Ido Schimmel -Signed-off-by: David S. Miller ---- - drivers/net/ethernet/mellanox/mlxsw/core.c | 4 ++-- - drivers/net/ethernet/mellanox/mlxsw/core.h | 2 +- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c -index a26c6d880..9475cd656 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/core.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/core.c -@@ -2842,7 +2842,7 @@ u64 mlxsw_core_res_get(struct mlxsw_core *mlxsw_core, - } - EXPORT_SYMBOL(mlxsw_core_res_get); - --static int __mlxsw_core_port_init(struct mlxsw_core *mlxsw_core, u8 local_port, -+static int __mlxsw_core_port_init(struct mlxsw_core *mlxsw_core, u16 local_port, - enum devlink_port_flavour flavour, - u8 slot_index, u32 port_number, bool split, - u32 split_port_subnumber, -@@ -2892,7 +2892,7 @@ static void __mlxsw_core_port_fini(struct mlxsw_core *mlxsw_core, u8 local_port) - memset(mlxsw_core_port, 0, sizeof(*mlxsw_core_port)); - } - --int mlxsw_core_port_init(struct mlxsw_core *mlxsw_core, u8 local_port, -+int mlxsw_core_port_init(struct mlxsw_core *mlxsw_core, u16 local_port, - u8 slot_index, u32 port_number, bool split, - u32 split_port_subnumber, - bool splittable, u32 lanes, -diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.h b/drivers/net/ethernet/mellanox/mlxsw/core.h -index b09f9013d..842f365eb 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/core.h -+++ b/drivers/net/ethernet/mellanox/mlxsw/core.h -@@ -213,7 +213,7 @@ void mlxsw_core_lag_mapping_clear(struct mlxsw_core *mlxsw_core, - u16 lag_id, u8 local_port); - - 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, -+int mlxsw_core_port_init(struct mlxsw_core *mlxsw_core, u16 local_port, - u8 slot_index, u32 port_number, bool split, - u32 split_port_subnumber, - bool splittable, u32 lanes, --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0276-mlxsw-minimal-Change-type-for-local-port.patch b/platform/mellanox/non-upstream-patches/patches/0276-mlxsw-minimal-Change-type-for-local-port.patch deleted file mode 100644 index 0a2b7f618899..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0276-mlxsw-minimal-Change-type-for-local-port.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 299ee861fd4b081f0ab5d168048c9696a12de2f5 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Thu, 9 Mar 2023 09:05:38 +0000 -Subject: [PATCH backport v.5.10 1/3] mlxsw: minimal: Change type for local - port - -Since maximum port number available on system has been increased from -128 to 258, change relevant types from u8 to u16: -- 'max_ports' field in structure 'mlxsw_m'; -- 'local_port' argument in mlxsw_m_port_mapping_get(). - -Signed-off-by: Vadim Pasternak ---- - drivers/net/ethernet/mellanox/mlxsw/minimal.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/drivers/net/ethernet/mellanox/mlxsw/minimal.c b/drivers/net/ethernet/mellanox/mlxsw/minimal.c -index 5fd319697..9f74ca704 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/minimal.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/minimal.c -@@ -31,7 +31,7 @@ struct mlxsw_m { - struct mlxsw_core *core; - const struct mlxsw_bus_info *bus_info; - u8 base_mac[ETH_ALEN]; -- u8 max_ports; -+ u16 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; -@@ -230,7 +230,7 @@ mlxsw_m_port_dev_addr_get(struct mlxsw_m_port *mlxsw_m_port) - - static struct - mlxsw_m_port_mapping *mlxsw_m_port_mapping_get(struct mlxsw_m *mlxsw_m, -- u8 slot_index, u8 local_port) -+ u8 slot_index, u16 local_port) - { - return &mlxsw_m->line_cards[slot_index]->port_mapping[local_port]; - } --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0277-mlxsw-i2c-Fix-chunk-size-setting-in-output-mailbox-b.patch b/platform/mellanox/non-upstream-patches/patches/0277-mlxsw-i2c-Fix-chunk-size-setting-in-output-mailbox-b.patch deleted file mode 100644 index 7f3a5143072f..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0277-mlxsw-i2c-Fix-chunk-size-setting-in-output-mailbox-b.patch +++ /dev/null @@ -1,41 +0,0 @@ -From b66ec3f67d61b7e380c61a12771cc2fee2f0a10e Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Thu, 9 Mar 2023 09:16:33 +0000 -Subject: [PATCH backport v.5.10 3/3] mlxsw: i2c: Fix chunk size setting in - output mailbox buffer - -Set output mailbox buffer size multiple of minimal chunk size (32). - -Full buffer size is 256 bytes, while chunk size, which can be sent to -device on some controllers could be for example 32 + 4, 64 + 4, 128 + -4. Thus, last chunk maybe missed, and transaction tail will be lost. - -For example, if transaction size is 256 bytes and chunk size is 64 + 4, -only 204 (68 * 3) bytes will be read instead of 256. - -With this fix chunk size will be multiple of 2^n (where n could be 5, 6, -7) and last chunk will be handled. - -Fixes: 95b75cbd1bc5 ("mlxsw: i2c: Extend input parameters list of command API") -Signed-off-by: Vadim Pasternak ---- - drivers/net/ethernet/mellanox/mlxsw/i2c.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/drivers/net/ethernet/mellanox/mlxsw/i2c.c b/drivers/net/ethernet/mellanox/mlxsw/i2c.c -index ba31540f1..e04557afc 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/i2c.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/i2c.c -@@ -466,7 +466,8 @@ mlxsw_i2c_cmd(struct device *dev, u16 opcode, u32 in_mod, size_t in_mbox_size, - } else { - /* No input mailbox is case of initialization query command. */ - reg_size = MLXSW_I2C_MAX_DATA_SIZE; -- num = reg_size / mlxsw_i2c->block_size; -+ num = reg_size / (mlxsw_i2c->block_size - -+ (mlxsw_i2c->block_size % MLXSW_I2C_BLK_DEF)); - - if (mutex_lock_interruptible(&mlxsw_i2c->cmd.lock) < 0) { - dev_err(&client->dev, "Could not acquire lock"); --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0285-UBUNTU-SAUCE-mlxbf-gige-Fix-intermittent-no-ip-issue.patch b/platform/mellanox/non-upstream-patches/patches/0285-UBUNTU-SAUCE-mlxbf-gige-Fix-intermittent-no-ip-issue.patch deleted file mode 100644 index 90023e1ab3ba..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0285-UBUNTU-SAUCE-mlxbf-gige-Fix-intermittent-no-ip-issue.patch +++ /dev/null @@ -1,85 +0,0 @@ -From c87bfec5830d104e564d536a2f5ff19f46eabf89 Mon Sep 17 00:00:00 2001 -From: Asmaa Mnebhi -Date: Tue, 28 Feb 2023 18:03:12 -0500 -Subject: [PATCH backport v5.10 30/70] UBUNTU: SAUCE: mlxbf-gige: Fix - intermittent no ip issue - -BugLink: https://bugs.launchpad.net/bugs/2008833 - -During the reboot test, the OOB might not get an ip assigned. -This is due to a race condition between phy_startcall and the -RX DMA being enabled and depends on the amount of background -traffic received by the OOB. Enable the RX DMA after teh phy -is started. - -Signed-off-by: Asmaa Mnebhi -Acked-by: Tim Gardner -Acked-by: Bartlomiej Zolnierkiewicz -Signed-off-by: Bartlomiej Zolnierkiewicz ---- - .../ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c | 14 +++++++------- - .../ethernet/mellanox/mlxbf_gige/mlxbf_gige_rx.c | 6 +++--- - 2 files changed, 10 insertions(+), 10 deletions(-) - -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -index e8f9290a8..085240890 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -@@ -147,14 +147,14 @@ static int mlxbf_gige_open(struct net_device *netdev) - */ - priv->valid_polarity = 0; - -- err = mlxbf_gige_rx_init(priv); -+ phy_start(phydev); -+ -+ err = mlxbf_gige_tx_init(priv); - if (err) - goto free_irqs; -- err = mlxbf_gige_tx_init(priv); -+ err = mlxbf_gige_rx_init(priv); - if (err) -- goto rx_deinit; -- -- phy_start(phydev); -+ goto tx_deinit; - - netif_napi_add(netdev, &priv->napi, mlxbf_gige_poll, NAPI_POLL_WEIGHT); - napi_enable(&priv->napi); -@@ -176,8 +176,8 @@ static int mlxbf_gige_open(struct net_device *netdev) - - return 0; - --rx_deinit: -- mlxbf_gige_rx_deinit(priv); -+tx_deinit: -+ mlxbf_gige_tx_deinit(priv); - - free_irqs: - mlxbf_gige_free_irqs(priv); -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_rx.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_rx.c -index 96230763c..f21dafde4 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_rx.c -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_rx.c -@@ -142,6 +142,9 @@ int mlxbf_gige_rx_init(struct mlxbf_gige *priv) - writeq(MLXBF_GIGE_RX_MAC_FILTER_COUNT_PASS_EN, - priv->base + MLXBF_GIGE_RX_MAC_FILTER_COUNT_PASS); - -+ writeq(ilog2(priv->rx_q_entries), -+ priv->base + MLXBF_GIGE_RX_WQE_SIZE_LOG2); -+ - /* Clear MLXBF_GIGE_INT_MASK 'receive pkt' bit to - * indicate readiness to receive interrupts - */ -@@ -154,9 +157,6 @@ int mlxbf_gige_rx_init(struct mlxbf_gige *priv) - data |= MLXBF_GIGE_RX_DMA_EN; - writeq(data, priv->base + MLXBF_GIGE_RX_DMA); - -- writeq(ilog2(priv->rx_q_entries), -- priv->base + MLXBF_GIGE_RX_WQE_SIZE_LOG2); -- - return 0; - - free_wqe_and_skb: --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0286-pinctrl-Introduce-struct-pinfunction-and-PINCTRL_PIN.patch b/platform/mellanox/non-upstream-patches/patches/0286-pinctrl-Introduce-struct-pinfunction-and-PINCTRL_PIN.patch deleted file mode 100644 index c9ca8fc23f0a..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0286-pinctrl-Introduce-struct-pinfunction-and-PINCTRL_PIN.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 6f90ee9b22030be2aaa4e753aa9813adbb6c9814 Mon Sep 17 00:00:00 2001 -From: Andy Shevchenko -Date: Mon, 19 Dec 2022 14:42:33 +0200 -Subject: [PATCH 74/77] pinctrl: Introduce struct pinfunction and - PINCTRL_PINFUNCTION() macro -X-NVConfidentiality: public - -BugLink: https://bugs.launchpad.net/bugs/2012743 - -There are many pin control drivers define their own data type for -pin function representation which is the same or embed the same data -as newly introduced one. Provide the data type and convenient macro -for all pin control drivers. - -Signed-off-by: Andy Shevchenko -Reviewed-by: Linus Walleij -Acked-by: Mika Westerberg -(cherry picked from commit 443a0a0f0cf4f432c7af6654b7f2f920d411d379) -Signed-off-by: Asmaa Mnebhi -Acked-by: Tim Gardner -Acked-by: Bartlomiej Zolnierkiewicz -Signed-off-by: Bartlomiej Zolnierkiewicz ---- - include/linux/pinctrl/pinctrl.h | 20 ++++++++++++++++++++ - 1 file changed, 20 insertions(+) - -diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h -index 2aef59df9..dce7402cd 100644 ---- a/include/linux/pinctrl/pinctrl.h -+++ b/include/linux/pinctrl/pinctrl.h -@@ -186,6 +186,26 @@ extern int pinctrl_get_group_pins(struct pinctrl_dev *pctldev, - const char *pin_group, const unsigned **pins, - unsigned *num_pins); - -+/** -+ * struct pinfunction - Description about a function -+ * @name: Name of the function -+ * @groups: An array of groups for this function -+ * @ngroups: Number of groups in @groups -+ */ -+struct pinfunction { -+ const char *name; -+ const char * const *groups; -+ size_t ngroups; -+}; -+ -+/* Convenience macro to define a single named pinfunction */ -+#define PINCTRL_PINFUNCTION(_name, _groups, _ngroups) \ -+(struct pinfunction) { \ -+ .name = (_name), \ -+ .groups = (_groups), \ -+ .ngroups = (_ngroups), \ -+ } -+ - #if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_PINCTRL) - extern struct pinctrl_dev *of_pinctrl_get(struct device_node *np); - #else --- -2.14.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0287-pinctrl-mlxbf3-Add-pinctrl-driver-support.patch b/platform/mellanox/non-upstream-patches/patches/0287-pinctrl-mlxbf3-Add-pinctrl-driver-support.patch deleted file mode 100644 index 0350d311dd87..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0287-pinctrl-mlxbf3-Add-pinctrl-driver-support.patch +++ /dev/null @@ -1,393 +0,0 @@ -From cbef04cdf39fe364158d0f67053e326c755085ad Mon Sep 17 00:00:00 2001 -From: Asmaa Mnebhi -Date: Wed, 15 Mar 2023 17:50:27 -0400 -Subject: [PATCH 75/77] pinctrl: mlxbf3: Add pinctrl driver support -X-NVConfidentiality: public - -BugLink: https://bugs.launchpad.net/bugs/2012743 - -NVIDIA BlueField-3 SoC has a few pins that can be used as GPIOs -or take the default hardware functionality. Add a driver for -the pin muxing. - -Signed-off-by: Asmaa Mnebhi -Reviewed-by: Andy Shevchenko -Link: https://lore.kernel.org/r/20230315215027.30685-3-asmaa@nvidia.com -Signed-off-by: Linus Walleij -(cherry picked from commit d11f932808dc689717e409bbc81b5093e7902fc9 linux-next) -Signed-off-by: Asmaa Mnebhi -Acked-by: Tim Gardner -Acked-by: Bartlomiej Zolnierkiewicz -Signed-off-by: Bartlomiej Zolnierkiewicz ---- - drivers/pinctrl/Kconfig | 13 ++ - drivers/pinctrl/Makefile | 1 + - drivers/pinctrl/pinctrl-mlxbf3.c | 320 +++++++++++++++++++++++++++++++++++++++ - 3 files changed, 334 insertions(+) - create mode 100644 drivers/pinctrl/pinctrl-mlxbf3.c - -diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig -index 815095326..43dbf5942 100644 ---- a/drivers/pinctrl/Kconfig -+++ b/drivers/pinctrl/Kconfig -@@ -374,6 +374,19 @@ config PINCTRL_OCELOT - select OF_GPIO - select REGMAP_MMIO - -+config PINCTRL_MLXBF3 -+ tristate "NVIDIA BlueField-3 SoC Pinctrl driver" -+ depends on (MELLANOX_PLATFORM && ARM64) || COMPILE_TEST -+ select PINMUX -+ select GPIOLIB -+ select GPIOLIB_IRQCHIP -+ select GPIO_MLXBF3 -+ help -+ Say Y to select the pinctrl driver for BlueField-3 SoCs. -+ This pin controller allows selecting the mux function for -+ each pin. This driver can also be built as a module called -+ pinctrl-mlxbf3. -+ - source "drivers/pinctrl/actions/Kconfig" - source "drivers/pinctrl/aspeed/Kconfig" - source "drivers/pinctrl/bcm/Kconfig" -diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile -index f53933b2f..52c0cdc40 100644 ---- a/drivers/pinctrl/Makefile -+++ b/drivers/pinctrl/Makefile -@@ -25,6 +25,7 @@ obj-$(CONFIG_PINCTRL_MCP23S08_I2C) += pinctrl-mcp23s08_i2c.o - obj-$(CONFIG_PINCTRL_MCP23S08_SPI) += pinctrl-mcp23s08_spi.o - obj-$(CONFIG_PINCTRL_MCP23S08) += pinctrl-mcp23s08.o - obj-$(CONFIG_PINCTRL_MESON) += meson/ -+obj-$(CONFIG_PINCTRL_MLXBF3) += pinctrl-mlxbf3.o - obj-$(CONFIG_PINCTRL_OXNAS) += pinctrl-oxnas.o - obj-$(CONFIG_PINCTRL_PALMAS) += pinctrl-palmas.o - obj-$(CONFIG_PINCTRL_PIC32) += pinctrl-pic32.o -diff --git a/drivers/pinctrl/pinctrl-mlxbf3.c b/drivers/pinctrl/pinctrl-mlxbf3.c -new file mode 100644 -index 000000000..3698f7bbd ---- /dev/null -+++ b/drivers/pinctrl/pinctrl-mlxbf3.c -@@ -0,0 +1,320 @@ -+// SPDX-License-Identifier: GPL-2.0-only or BSD-3-Clause -+/* Copyright (C) 2022 NVIDIA CORPORATION & AFFILIATES */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+ -+#define MLXBF3_NGPIOS_GPIO0 32 -+#define MLXBF3_MAX_GPIO_PINS 56 -+ -+enum { -+ MLXBF3_GPIO_HW_MODE, -+ MLXBF3_GPIO_SW_MODE, -+}; -+ -+struct mlxbf3_pinctrl { -+ void __iomem *fw_ctrl_set0; -+ void __iomem *fw_ctrl_clr0; -+ void __iomem *fw_ctrl_set1; -+ void __iomem *fw_ctrl_clr1; -+ struct device *dev; -+ struct pinctrl_dev *pctl; -+ struct pinctrl_gpio_range gpio_range; -+}; -+ -+#define MLXBF3_GPIO_RANGE(_id, _pinbase, _gpiobase, _npins) \ -+ { \ -+ .name = "mlxbf3_gpio_range", \ -+ .id = _id, \ -+ .base = _gpiobase, \ -+ .pin_base = _pinbase, \ -+ .npins = _npins, \ -+ } -+ -+static struct pinctrl_gpio_range mlxbf3_pinctrl_gpio_ranges[] = { -+ MLXBF3_GPIO_RANGE(0, 0, 480, 32), -+ MLXBF3_GPIO_RANGE(1, 32, 456, 24), -+}; -+ -+static const struct pinctrl_pin_desc mlxbf3_pins[] = { -+ PINCTRL_PIN(0, "gpio0"), -+ PINCTRL_PIN(1, "gpio1"), -+ PINCTRL_PIN(2, "gpio2"), -+ PINCTRL_PIN(3, "gpio3"), -+ PINCTRL_PIN(4, "gpio4"), -+ PINCTRL_PIN(5, "gpio5"), -+ PINCTRL_PIN(6, "gpio6"), -+ PINCTRL_PIN(7, "gpio7"), -+ PINCTRL_PIN(8, "gpio8"), -+ PINCTRL_PIN(9, "gpio9"), -+ PINCTRL_PIN(10, "gpio10"), -+ PINCTRL_PIN(11, "gpio11"), -+ PINCTRL_PIN(12, "gpio12"), -+ PINCTRL_PIN(13, "gpio13"), -+ PINCTRL_PIN(14, "gpio14"), -+ PINCTRL_PIN(15, "gpio15"), -+ PINCTRL_PIN(16, "gpio16"), -+ PINCTRL_PIN(17, "gpio17"), -+ PINCTRL_PIN(18, "gpio18"), -+ PINCTRL_PIN(19, "gpio19"), -+ PINCTRL_PIN(20, "gpio20"), -+ PINCTRL_PIN(21, "gpio21"), -+ PINCTRL_PIN(22, "gpio22"), -+ PINCTRL_PIN(23, "gpio23"), -+ PINCTRL_PIN(24, "gpio24"), -+ PINCTRL_PIN(25, "gpio25"), -+ PINCTRL_PIN(26, "gpio26"), -+ PINCTRL_PIN(27, "gpio27"), -+ PINCTRL_PIN(28, "gpio28"), -+ PINCTRL_PIN(29, "gpio29"), -+ PINCTRL_PIN(30, "gpio30"), -+ PINCTRL_PIN(31, "gpio31"), -+ PINCTRL_PIN(32, "gpio32"), -+ PINCTRL_PIN(33, "gpio33"), -+ PINCTRL_PIN(34, "gpio34"), -+ PINCTRL_PIN(35, "gpio35"), -+ PINCTRL_PIN(36, "gpio36"), -+ PINCTRL_PIN(37, "gpio37"), -+ PINCTRL_PIN(38, "gpio38"), -+ PINCTRL_PIN(39, "gpio39"), -+ PINCTRL_PIN(40, "gpio40"), -+ PINCTRL_PIN(41, "gpio41"), -+ PINCTRL_PIN(42, "gpio42"), -+ PINCTRL_PIN(43, "gpio43"), -+ PINCTRL_PIN(44, "gpio44"), -+ PINCTRL_PIN(45, "gpio45"), -+ PINCTRL_PIN(46, "gpio46"), -+ PINCTRL_PIN(47, "gpio47"), -+ PINCTRL_PIN(48, "gpio48"), -+ PINCTRL_PIN(49, "gpio49"), -+ PINCTRL_PIN(50, "gpio50"), -+ PINCTRL_PIN(51, "gpio51"), -+ PINCTRL_PIN(52, "gpio52"), -+ PINCTRL_PIN(53, "gpio53"), -+ PINCTRL_PIN(54, "gpio54"), -+ PINCTRL_PIN(55, "gpio55"), -+}; -+ -+/* -+ * All single-pin functions can be mapped to any GPIO, however pinmux applies -+ * functions to pin groups and only those groups declared as supporting that -+ * function. To make this work we must put each pin in its own dummy group so -+ * that the functions can be described as applying to all pins. -+ * We use the same name as in the datasheet. -+ */ -+static const char * const mlxbf3_pinctrl_single_group_names[] = { -+ "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", -+ "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", "gpio15", -+ "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21", "gpio22", "gpio23", -+ "gpio24", "gpio25", "gpio26", "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", -+ "gpio32", "gpio33", "gpio34", "gpio35", "gpio36", "gpio37", "gpio38", "gpio39", -+ "gpio40", "gpio41", "gpio42", "gpio43", "gpio44", "gpio45", "gpio46", "gpio47", -+ "gpio48", "gpio49", "gpio50", "gpio51", "gpio52", "gpio53", "gpio54", "gpio55", -+}; -+ -+static int mlxbf3_get_groups_count(struct pinctrl_dev *pctldev) -+{ -+ /* Number single-pin groups */ -+ return MLXBF3_MAX_GPIO_PINS; -+} -+ -+static const char *mlxbf3_get_group_name(struct pinctrl_dev *pctldev, -+ unsigned int selector) -+{ -+ return mlxbf3_pinctrl_single_group_names[selector]; -+} -+ -+static int mlxbf3_get_group_pins(struct pinctrl_dev *pctldev, -+ unsigned int selector, -+ const unsigned int **pins, -+ unsigned int *num_pins) -+{ -+ /* return the dummy group for a single pin */ -+ *pins = &selector; -+ *num_pins = 1; -+ -+ return 0; -+} -+ -+static const struct pinctrl_ops mlxbf3_pinctrl_group_ops = { -+ .get_groups_count = mlxbf3_get_groups_count, -+ .get_group_name = mlxbf3_get_group_name, -+ .get_group_pins = mlxbf3_get_group_pins, -+}; -+ -+/* -+ * Only 2 functions are supported and they apply to all pins: -+ * 1) Default hardware functionality -+ * 2) Software controlled GPIO -+ */ -+static const char * const mlxbf3_gpiofunc_group_names[] = { "swctrl" }; -+static const char * const mlxbf3_hwfunc_group_names[] = { "hwctrl" }; -+ -+struct pinfunction mlxbf3_pmx_funcs[] = { -+ PINCTRL_PINFUNCTION("hwfunc", mlxbf3_hwfunc_group_names, 1), -+ PINCTRL_PINFUNCTION("gpiofunc", mlxbf3_gpiofunc_group_names, 1), -+}; -+ -+static int mlxbf3_pmx_get_funcs_count(struct pinctrl_dev *pctldev) -+{ -+ return ARRAY_SIZE(mlxbf3_pmx_funcs); -+} -+ -+static const char *mlxbf3_pmx_get_func_name(struct pinctrl_dev *pctldev, -+ unsigned int selector) -+{ -+ return mlxbf3_pmx_funcs[selector].name; -+} -+ -+static int mlxbf3_pmx_get_groups(struct pinctrl_dev *pctldev, -+ unsigned int selector, -+ const char * const **groups, -+ unsigned int * const num_groups) -+{ -+ *groups = mlxbf3_pmx_funcs[selector].groups; -+ *num_groups = MLXBF3_MAX_GPIO_PINS; -+ -+ return 0; -+} -+ -+static int mlxbf3_pmx_set(struct pinctrl_dev *pctldev, -+ unsigned int selector, -+ unsigned int group) -+{ -+ struct mlxbf3_pinctrl *priv = pinctrl_dev_get_drvdata(pctldev); -+ -+ if (selector == MLXBF3_GPIO_HW_MODE) { -+ if (group < MLXBF3_NGPIOS_GPIO0) -+ writel(BIT(group), priv->fw_ctrl_clr0); -+ else -+ writel(BIT(group % MLXBF3_NGPIOS_GPIO0), priv->fw_ctrl_clr1); -+ } -+ -+ if (selector == MLXBF3_GPIO_SW_MODE) { -+ if (group < MLXBF3_NGPIOS_GPIO0) -+ writel(BIT(group), priv->fw_ctrl_set0); -+ else -+ writel(BIT(group % MLXBF3_NGPIOS_GPIO0), priv->fw_ctrl_set1); -+ } -+ -+ return 0; -+} -+ -+static int mlxbf3_gpio_request_enable(struct pinctrl_dev *pctldev, -+ struct pinctrl_gpio_range *range, -+ unsigned int offset) -+{ -+ struct mlxbf3_pinctrl *priv = pinctrl_dev_get_drvdata(pctldev); -+ -+ if (offset < MLXBF3_NGPIOS_GPIO0) -+ writel(BIT(offset), priv->fw_ctrl_set0); -+ else -+ writel(BIT(offset % MLXBF3_NGPIOS_GPIO0), priv->fw_ctrl_set1); -+ -+ return 0; -+} -+ -+static void mlxbf3_gpio_disable_free(struct pinctrl_dev *pctldev, -+ struct pinctrl_gpio_range *range, -+ unsigned int offset) -+{ -+ struct mlxbf3_pinctrl *priv = pinctrl_dev_get_drvdata(pctldev); -+ -+ /* disable GPIO functionality by giving control back to hardware */ -+ if (offset < MLXBF3_NGPIOS_GPIO0) -+ writel(BIT(offset), priv->fw_ctrl_clr0); -+ else -+ writel(BIT(offset % MLXBF3_NGPIOS_GPIO0), priv->fw_ctrl_clr1); -+} -+ -+static const struct pinmux_ops mlxbf3_pmx_ops = { -+ .get_functions_count = mlxbf3_pmx_get_funcs_count, -+ .get_function_name = mlxbf3_pmx_get_func_name, -+ .get_function_groups = mlxbf3_pmx_get_groups, -+ .set_mux = mlxbf3_pmx_set, -+ .gpio_request_enable = mlxbf3_gpio_request_enable, -+ .gpio_disable_free = mlxbf3_gpio_disable_free, -+}; -+ -+static struct pinctrl_desc mlxbf3_pin_desc = { -+ .name = "pinctrl-mlxbf3", -+ .pins = mlxbf3_pins, -+ .npins = ARRAY_SIZE(mlxbf3_pins), -+ .pctlops = &mlxbf3_pinctrl_group_ops, -+ .pmxops = &mlxbf3_pmx_ops, -+ .owner = THIS_MODULE, -+}; -+ -+static_assert(ARRAY_SIZE(mlxbf3_pinctrl_single_group_names) == MLXBF3_MAX_GPIO_PINS); -+ -+static int mlxbf3_pinctrl_probe(struct platform_device *pdev) -+{ -+ struct device *dev = &pdev->dev; -+ struct mlxbf3_pinctrl *priv; -+ int ret; -+ -+ priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); -+ if (!priv) -+ return -ENOMEM; -+ -+ priv->dev = &pdev->dev; -+ -+ priv->fw_ctrl_set0 = devm_platform_ioremap_resource(pdev, 0); -+ if (IS_ERR(priv->fw_ctrl_set0)) -+ return PTR_ERR(priv->fw_ctrl_set0); -+ -+ priv->fw_ctrl_clr0 = devm_platform_ioremap_resource(pdev, 1); -+ if (IS_ERR(priv->fw_ctrl_set0)) -+ return PTR_ERR(priv->fw_ctrl_set0); -+ -+ priv->fw_ctrl_set1 = devm_platform_ioremap_resource(pdev, 2); -+ if (IS_ERR(priv->fw_ctrl_set0)) -+ return PTR_ERR(priv->fw_ctrl_set0); -+ -+ priv->fw_ctrl_clr1 = devm_platform_ioremap_resource(pdev, 3); -+ if (IS_ERR(priv->fw_ctrl_set0)) -+ return PTR_ERR(priv->fw_ctrl_set0); -+ -+ ret = devm_pinctrl_register_and_init(dev, -+ &mlxbf3_pin_desc, -+ priv, -+ &priv->pctl); -+ if (ret) -+ return dev_err_probe(dev, ret, "Failed to register pinctrl\n"); -+ -+ ret = pinctrl_enable(priv->pctl); -+ if (ret) -+ return dev_err_probe(dev, ret, "Failed to enable pinctrl\n"); -+ -+ pinctrl_add_gpio_ranges(priv->pctl, mlxbf3_pinctrl_gpio_ranges, 2); -+ -+ return 0; -+} -+ -+static const struct acpi_device_id mlxbf3_pinctrl_acpi_ids[] = { -+ { "MLNXBF34", 0 }, -+ {} -+}; -+MODULE_DEVICE_TABLE(acpi, mlxbf3_pinctrl_acpi_ids); -+ -+static struct platform_driver mlxbf3_pinctrl_driver = { -+ .driver = { -+ .name = "pinctrl-mlxbf3", -+ .acpi_match_table = mlxbf3_pinctrl_acpi_ids, -+ }, -+ .probe = mlxbf3_pinctrl_probe, -+}; -+module_platform_driver(mlxbf3_pinctrl_driver); -+ -+MODULE_DESCRIPTION("NVIDIA pinctrl driver"); -+MODULE_AUTHOR("Asmaa Mnebhi "); -+MODULE_LICENSE("Dual BSD/GPL"); --- -2.14.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0288-UBUNTU-SAUCE-gpio-mmio-handle-ngpios-properly-in-bgp.patch b/platform/mellanox/non-upstream-patches/patches/0288-UBUNTU-SAUCE-gpio-mmio-handle-ngpios-properly-in-bgp.patch deleted file mode 100644 index 560ab260d602..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0288-UBUNTU-SAUCE-gpio-mmio-handle-ngpios-properly-in-bgp.patch +++ /dev/null @@ -1,125 +0,0 @@ -From 99a91873f7fe56dcdb4dc68b5a0766b63465ccbb Mon Sep 17 00:00:00 2001 -From: Asmaa Mnebhi -Date: Thu, 30 Mar 2023 12:25:27 -0400 -Subject: [PATCH 76/77] UBUNTU: SAUCE: gpio: mmio: handle "ngpios" properly in - bgpio_init() -X-NVConfidentiality: public - -BugLink: https://bugs.launchpad.net/bugs/2012743 - -bgpio_init() uses "sz" argument to populate ngpio, which is not -accurate. Instead, read the "ngpios" property from the DT and if it -doesn't exist, use the "sz" argument. With this change, drivers no -longer need to overwrite the ngpio variable after calling bgpio_init(). - -This change has already been approved for upstreaming but has not been -integrated into the linux-next branch yet (or any other branch as a matter -of fact). -There are 2 commits involved: -gpio: mmio: handle "ngpios" properly in bgpio_init() - -gpio: mmio: fix calculation of bgpio_bits - -There is no point in separating these 2 commits into 2 SAUCE patches since -they target the same functionality and will be reverted soon anyways to -cherry-pick the linux-next commits. - -Signed-off-by: Asmaa Mnebhi -Acked-by: Tim Gardner -Acked-by: Bartlomiej Zolnierkiewicz -Signed-off-by: Bartlomiej Zolnierkiewicz ---- - drivers/gpio/gpio-mmio.c | 9 ++++++++- - drivers/gpio/gpiolib.c | 34 ++++++++++++++++++++++++++++++++++ - drivers/gpio/gpiolib.h | 1 + - 3 files changed, 43 insertions(+), 1 deletion(-) - -diff --git a/drivers/gpio/gpio-mmio.c b/drivers/gpio/gpio-mmio.c -index c335a0309..ababc4091 100644 ---- a/drivers/gpio/gpio-mmio.c -+++ b/drivers/gpio/gpio-mmio.c -@@ -60,6 +60,8 @@ o ` ~~~~\___/~~~~ ` controller in FPGA is ,.` - #include - #include - -+#include "gpiolib.h" -+ - static void bgpio_write8(void __iomem *reg, unsigned long data) - { - writeb(data, reg); -@@ -614,10 +616,15 @@ int bgpio_init(struct gpio_chip *gc, struct device *dev, - gc->parent = dev; - gc->label = dev_name(dev); - gc->base = -1; -- gc->ngpio = gc->bgpio_bits; - gc->request = bgpio_request; - gc->be_bits = !!(flags & BGPIOF_BIG_ENDIAN); - -+ ret = gpiochip_get_ngpios(gc, dev); -+ if (ret) -+ gc->ngpio = gc->bgpio_bits; -+ else -+ gc->bgpio_bits = roundup_pow_of_two(round_up(gc->ngpio, 8)); -+ - ret = bgpio_setup_io(gc, dat, set, clr, flags); - if (ret) - return ret; -diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c -index 3e01a3ac6..964f27f4d 100644 ---- a/drivers/gpio/gpiolib.c -+++ b/drivers/gpio/gpiolib.c -@@ -550,6 +550,40 @@ static void machine_gpiochip_add(struct gpio_chip *gc) - mutex_unlock(&gpio_machine_hogs_mutex); - } - -+int gpiochip_get_ngpios(struct gpio_chip *gc, struct device *dev) -+{ -+ u32 ngpios = gc->ngpio; -+ int ret; -+ -+ if (ngpios == 0) { -+ ret = device_property_read_u32(dev, "ngpios", &ngpios); -+ if (ret == -ENODATA) -+ /* -+ * -ENODATA means that there is no property found and -+ * we want to issue the error message to the user. -+ * Besides that, we want to return different error code -+ * to state that supplied value is not valid. -+ */ -+ ngpios = 0; -+ else if (ret) -+ return ret; -+ -+ gc->ngpio = ngpios; -+ } -+ -+ if (gc->ngpio == 0) { -+ chip_err(gc, "tried to insert a GPIO chip with zero lines\n"); -+ return -EINVAL; -+ } -+ -+ if (gc->ngpio > FASTPATH_NGPIO) -+ chip_warn(gc, "line cnt %u is greater than fast path cnt %u\n", -+ gc->ngpio, FASTPATH_NGPIO); -+ -+ return 0; -+} -+EXPORT_SYMBOL_GPL(gpiochip_get_ngpios); -+ - static void gpiochip_setup_devs(void) - { - struct gpio_device *gdev; -diff --git a/drivers/gpio/gpiolib.h b/drivers/gpio/gpiolib.h -index b674b5bb9..7c26a0060 100644 ---- a/drivers/gpio/gpiolib.h -+++ b/drivers/gpio/gpiolib.h -@@ -136,6 +136,7 @@ int gpiod_configure_flags(struct gpio_desc *desc, const char *con_id, - unsigned long lflags, enum gpiod_flags dflags); - int gpiod_hog(struct gpio_desc *desc, const char *name, - unsigned long lflags, enum gpiod_flags dflags); -+int gpiochip_get_ngpios(struct gpio_chip *gc, struct device *dev); - - /* - * Return the GPIO number of the passed descriptor relative to its chip --- -2.14.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0289-UBUNTU-SAUCE-gpio-mlxbf3-Add-gpio-driver-support.patch b/platform/mellanox/non-upstream-patches/patches/0289-UBUNTU-SAUCE-gpio-mlxbf3-Add-gpio-driver-support.patch deleted file mode 100644 index c5c2096917af..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0289-UBUNTU-SAUCE-gpio-mlxbf3-Add-gpio-driver-support.patch +++ /dev/null @@ -1,488 +0,0 @@ -From d189171aa3b9e01b2e2d022f375f999a4a68d525 Mon Sep 17 00:00:00 2001 -From: Asmaa Mnebhi -Date: Thu, 30 Mar 2023 12:38:19 -0400 -Subject: [PATCH 77/77] UBUNTU: SAUCE: gpio: mlxbf3: Add gpio driver support -X-NVConfidentiality: public - -BugLink: https://bugs.launchpad.net/bugs/2012743 - -Add support for the BlueField-3 SoC GPIO driver. -This driver configures and handles GPIO interrupts. It also enables -a user to manipulate certain GPIO pins via libgpiod tools or other kernel drivers. - -The gpio-mlxbf3.c driver has already been approved for upstreaming -but is not yet available for cherry-picking. - -Signed-off-by: Asmaa Mnebhi -Acked-by: Tim Gardner -Acked-by: Bartlomiej Zolnierkiewicz -Signed-off-by: Bartlomiej Zolnierkiewicz ---- - drivers/gpio/Kconfig | 10 +- - drivers/gpio/gpio-mlxbf3.c | 285 +++++++++++++++++---------------------------- - 2 files changed, 116 insertions(+), 179 deletions(-) - -diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig -index bf1b2b787..a31b7ffea 100644 ---- a/drivers/gpio/Kconfig -+++ b/drivers/gpio/Kconfig -@@ -1461,10 +1461,16 @@ config GPIO_MLXBF2 - - config GPIO_MLXBF3 - tristate "Mellanox BlueField 3 SoC GPIO" -- depends on (MELLANOX_PLATFORM && ARM64 && ACPI) || (64BIT && COMPILE_TEST) -+ depends on (MELLANOX_PLATFORM && ARM64) || COMPILE_TEST - select GPIO_GENERIC -+ select GPIOLIB_IRQCHIP - help -- Say Y here if you want GPIO support on Mellanox BlueField 3 SoC. -+ Say Y if you want GPIO support on Mellanox BlueField 3 SoC. -+ This GPIO controller supports interrupt handling and enables the -+ manipulation of certain GPIO pins. -+ This controller should be used in parallel with pinctrl-mlxbf3 to -+ control the desired GPIOs. -+ This driver can also be built as a module called mlxbf3-gpio. - - config GPIO_ML_IOH - tristate "OKI SEMICONDUCTOR ML7213 IOH GPIO support" -diff --git a/drivers/gpio/gpio-mlxbf3.c b/drivers/gpio/gpio-mlxbf3.c -index 45f0946ac..51dce3ae1 100644 ---- a/drivers/gpio/gpio-mlxbf3.c -+++ b/drivers/gpio/gpio-mlxbf3.c -@@ -1,27 +1,20 @@ - // SPDX-License-Identifier: GPL-2.0-only or BSD-3-Clause -+/* Copyright (C) 2021-2023 NVIDIA CORPORATION & AFFILIATES */ - --/* -- * Copyright (C) 2020-2021 NVIDIA CORPORATION & AFFILIATES -- */ -- --#include - #include - #include - #include -+#include - #include - #include - #include --#include --#include --#include - #include - #include --#include --#include - #include - #include -+#include - --#define DRV_VERSION "1.0" -+#define DRV_VERSION "2.0" - - /* - * There are 2 YU GPIO blocks: -@@ -33,103 +26,51 @@ - /* - * fw_gpio[x] block registers and their offset - */ --#define YU_GPIO_FW_CONTROL_SET 0x00 --#define YU_GPIO_FW_OUTPUT_ENABLE_SET 0x04 --#define YU_GPIO_FW_DATA_OUT_SET 0x08 --#define YU_GPIO_FW_CONTROL_CLEAR 0x14 --#define YU_GPIO_FW_OUTPUT_ENABLE_CLEAR 0x18 --#define YU_GPIO_FW_DATA_OUT_CLEAR 0x1c --#define YU_GPIO_CAUSE_RISE_EN 0x28 --#define YU_GPIO_CAUSE_FALL_EN 0x2c --#define YU_GPIO_READ_DATA_IN 0x30 --#define YU_GPIO_READ_OUTPUT_ENABLE 0x34 --#define YU_GPIO_READ_DATA_OUT 0x38 --#define YU_GPIO_READ_FW_CONTROL 0x44 -- --#define YU_GPIO_CAUSE_OR_CAUSE_EVTEN0 0x00 --#define YU_GPIO_CAUSE_OR_EVTEN0 0x14 --#define YU_GPIO_CAUSE_OR_CLRCAUSE 0x18 -- --/* BlueField-3 gpio block context structure. */ -+#define MLXBF_GPIO_FW_OUTPUT_ENABLE_SET 0x00 -+#define MLXBF_GPIO_FW_DATA_OUT_SET 0x04 -+ -+#define MLXBF_GPIO_FW_OUTPUT_ENABLE_CLEAR 0x00 -+#define MLXBF_GPIO_FW_DATA_OUT_CLEAR 0x04 -+ -+#define MLXBF_GPIO_CAUSE_RISE_EN 0x00 -+#define MLXBF_GPIO_CAUSE_FALL_EN 0x04 -+#define MLXBF_GPIO_READ_DATA_IN 0x08 -+ -+#define MLXBF_GPIO_CAUSE_OR_CAUSE_EVTEN0 0x00 -+#define MLXBF_GPIO_CAUSE_OR_EVTEN0 0x14 -+#define MLXBF_GPIO_CAUSE_OR_CLRCAUSE 0x18 -+ - struct mlxbf3_gpio_context { - struct gpio_chip gc; -- struct irq_chip irq_chip; - -- /* YU GPIO blocks address */ -+ /* YU GPIO block address */ -+ void __iomem *gpio_set_io; -+ void __iomem *gpio_clr_io; - void __iomem *gpio_io; - - /* YU GPIO cause block address */ - void __iomem *gpio_cause_io; - -- uint32_t ctrl_gpio_mask; -+ /* Mask of valid gpios that can be accessed by software */ -+ unsigned int valid_mask; - }; - --static void mlxbf3_gpio_set(struct gpio_chip *chip, unsigned int offset, int val) --{ -- struct mlxbf3_gpio_context *gs = gpiochip_get_data(chip); -- -- /* Software can only control GPIO pins defined by ctrl_gpio_mask */ -- if (!(BIT(offset) & gs->ctrl_gpio_mask)) -- return; -- -- if (val) { -- writel(BIT(offset), gs->gpio_io + YU_GPIO_FW_DATA_OUT_SET); -- } else { -- writel(BIT(offset), gs->gpio_io + YU_GPIO_FW_DATA_OUT_CLEAR); -- } -- -- wmb(); -- -- /* This needs to be done last to avoid glitches */ -- writel(BIT(offset), gs->gpio_io + YU_GPIO_FW_CONTROL_SET); --} -- --static int mlxbf3_gpio_direction_input(struct gpio_chip *chip, -- unsigned int offset) --{ -- struct mlxbf3_gpio_context *gs = gpiochip_get_data(chip); -- unsigned long flags; -- -- spin_lock_irqsave(&gs->gc.bgpio_lock, flags); -- -- writel(BIT(offset), gs->gpio_io + YU_GPIO_FW_OUTPUT_ENABLE_CLEAR); -- writel(BIT(offset), gs->gpio_io + YU_GPIO_FW_CONTROL_CLEAR); -- -- spin_unlock_irqrestore(&gs->gc.bgpio_lock, flags); -- -- return 0; --} -- --static int mlxbf3_gpio_direction_output(struct gpio_chip *chip, -- unsigned int offset, -- int value) --{ -- struct mlxbf3_gpio_context *gs = gpiochip_get_data(chip); -- unsigned long flags; -- -- spin_lock_irqsave(&gs->gc.bgpio_lock, flags); -- -- writel(BIT(offset), gs->gpio_io + YU_GPIO_FW_OUTPUT_ENABLE_SET); -- -- spin_unlock_irqrestore(&gs->gc.bgpio_lock, flags); -- -- return 0; --} -- - static void mlxbf3_gpio_irq_enable(struct irq_data *irqd) - { - struct gpio_chip *gc = irq_data_get_irq_chip_data(irqd); - struct mlxbf3_gpio_context *gs = gpiochip_get_data(gc); -- int offset = irqd_to_hwirq(irqd); -+ irq_hw_number_t offset = irqd_to_hwirq(irqd); - unsigned long flags; - u32 val; - -+ gpiochip_enable_irq(gc, offset); -+ - spin_lock_irqsave(&gs->gc.bgpio_lock, flags); -- writel(BIT(offset), gs->gpio_cause_io + YU_GPIO_CAUSE_OR_CLRCAUSE); -+ writel(BIT(offset), gs->gpio_cause_io + MLXBF_GPIO_CAUSE_OR_CLRCAUSE); - -- val = readl(gs->gpio_cause_io + YU_GPIO_CAUSE_OR_EVTEN0); -+ val = readl(gs->gpio_cause_io + MLXBF_GPIO_CAUSE_OR_EVTEN0); - val |= BIT(offset); -- writel(val, gs->gpio_cause_io + YU_GPIO_CAUSE_OR_EVTEN0); -+ writel(val, gs->gpio_cause_io + MLXBF_GPIO_CAUSE_OR_EVTEN0); - spin_unlock_irqrestore(&gs->gc.bgpio_lock, flags); - } - -@@ -137,15 +78,17 @@ static void mlxbf3_gpio_irq_disable(struct irq_data *irqd) - { - struct gpio_chip *gc = irq_data_get_irq_chip_data(irqd); - struct mlxbf3_gpio_context *gs = gpiochip_get_data(gc); -- int offset = irqd_to_hwirq(irqd); -+ irq_hw_number_t offset = irqd_to_hwirq(irqd); - unsigned long flags; - u32 val; - - spin_lock_irqsave(&gs->gc.bgpio_lock, flags); -- val = readl(gs->gpio_cause_io + YU_GPIO_CAUSE_OR_EVTEN0); -+ val = readl(gs->gpio_cause_io + MLXBF_GPIO_CAUSE_OR_EVTEN0); - val &= ~BIT(offset); -- writel(val, gs->gpio_cause_io + YU_GPIO_CAUSE_OR_EVTEN0); -+ writel(val, gs->gpio_cause_io + MLXBF_GPIO_CAUSE_OR_EVTEN0); - spin_unlock_irqrestore(&gs->gc.bgpio_lock, flags); -+ -+ gpiochip_disable_irq(gc, offset); - } - - static irqreturn_t mlxbf3_gpio_irq_handler(int irq, void *ptr) -@@ -155,8 +98,8 @@ static irqreturn_t mlxbf3_gpio_irq_handler(int irq, void *ptr) - unsigned long pending; - u32 level; - -- pending = readl(gs->gpio_cause_io + YU_GPIO_CAUSE_OR_CAUSE_EVTEN0); -- writel(pending, gs->gpio_cause_io + YU_GPIO_CAUSE_OR_CLRCAUSE); -+ pending = readl(gs->gpio_cause_io + MLXBF_GPIO_CAUSE_OR_CAUSE_EVTEN0); -+ writel(pending, gs->gpio_cause_io + MLXBF_GPIO_CAUSE_OR_CLRCAUSE); - - for_each_set_bit(level, &pending, gc->ngpio) { - int gpio_irq = irq_find_mapping(gc->irq.domain, level); -@@ -171,155 +114,145 @@ mlxbf3_gpio_irq_set_type(struct irq_data *irqd, unsigned int type) - { - struct gpio_chip *gc = irq_data_get_irq_chip_data(irqd); - struct mlxbf3_gpio_context *gs = gpiochip_get_data(gc); -- int offset = irqd_to_hwirq(irqd); -+ irq_hw_number_t offset = irqd_to_hwirq(irqd); - unsigned long flags; -- bool fall = false; -- bool rise = false; - u32 val; - -+ spin_lock_irqsave(&gs->gc.bgpio_lock, flags); -+ - switch (type & IRQ_TYPE_SENSE_MASK) { - case IRQ_TYPE_EDGE_BOTH: -- fall = true; -- rise = true; -+ val = readl(gs->gpio_io + MLXBF_GPIO_CAUSE_FALL_EN); -+ val |= BIT(offset); -+ writel(val, gs->gpio_io + MLXBF_GPIO_CAUSE_FALL_EN); -+ val = readl(gs->gpio_io + MLXBF_GPIO_CAUSE_RISE_EN); -+ val |= BIT(offset); -+ writel(val, gs->gpio_io + MLXBF_GPIO_CAUSE_RISE_EN); - break; - case IRQ_TYPE_EDGE_RISING: -- rise = true; -+ val = readl(gs->gpio_io + MLXBF_GPIO_CAUSE_RISE_EN); -+ val |= BIT(offset); -+ writel(val, gs->gpio_io + MLXBF_GPIO_CAUSE_RISE_EN); - break; - case IRQ_TYPE_EDGE_FALLING: -- fall = true; -+ val = readl(gs->gpio_io + MLXBF_GPIO_CAUSE_FALL_EN); -+ val |= BIT(offset); -+ writel(val, gs->gpio_io + MLXBF_GPIO_CAUSE_FALL_EN); - break; - default: -+ spin_unlock_irqrestore(&gs->gc.bgpio_lock, flags); - return -EINVAL; - } - -- spin_lock_irqsave(&gs->gc.bgpio_lock, flags); -- if (fall) { -- val = readl(gs->gpio_io + YU_GPIO_CAUSE_FALL_EN); -- val |= BIT(offset); -- writel(val, gs->gpio_io + YU_GPIO_CAUSE_FALL_EN); -- } -- -- if (rise) { -- val = readl(gs->gpio_io + YU_GPIO_CAUSE_RISE_EN); -- val |= BIT(offset); -- writel(val, gs->gpio_io + YU_GPIO_CAUSE_RISE_EN); -- } - spin_unlock_irqrestore(&gs->gc.bgpio_lock, flags); - -+ irq_set_handler_locked(irqd, handle_edge_irq); -+ - return 0; - } - --/* BlueField-3 GPIO driver initialization routine. */ --static int --mlxbf3_gpio_probe(struct platform_device *pdev) -+/* This function needs to be defined for handle_edge_irq() */ -+static void mlxbf3_gpio_irq_ack(struct irq_data *data) -+{ -+} -+ -+static int mlxbf3_gpio_init_valid_mask(struct gpio_chip *gc, -+ unsigned long *valid_mask, -+ unsigned int ngpios) -+{ -+ struct mlxbf3_gpio_context *gs = gpiochip_get_data(gc); -+ -+ *valid_mask = gs->valid_mask; -+ -+ return 0; -+} -+ -+static struct irq_chip gpio_mlxbf3_irqchip = { -+ .name = "MLNXBF33", -+ .irq_ack = mlxbf3_gpio_irq_ack, -+ .irq_set_type = mlxbf3_gpio_irq_set_type, -+ .irq_enable = mlxbf3_gpio_irq_enable, -+ .irq_disable = mlxbf3_gpio_irq_disable, -+}; -+ -+static int mlxbf3_gpio_probe(struct platform_device *pdev) - { -- struct mlxbf3_gpio_context *gs; - struct device *dev = &pdev->dev; -+ struct mlxbf3_gpio_context *gs; - struct gpio_irq_chip *girq; - struct gpio_chip *gc; -- unsigned int npins; -- const char *name; - int ret, irq; - -- name = dev_name(dev); -- - gs = devm_kzalloc(dev, sizeof(*gs), GFP_KERNEL); - if (!gs) - return -ENOMEM; - -- /* YU GPIO block address */ - gs->gpio_io = devm_platform_ioremap_resource(pdev, 0); - if (IS_ERR(gs->gpio_io)) - return PTR_ERR(gs->gpio_io); - -- /* YU GPIO block address */ - gs->gpio_cause_io = devm_platform_ioremap_resource(pdev, 1); - if (IS_ERR(gs->gpio_cause_io)) - return PTR_ERR(gs->gpio_cause_io); - -- if (device_property_read_u32(dev, "npins", &npins)) -- npins = MLXBF3_GPIO_MAX_PINS_PER_BLOCK; -+ gs->gpio_set_io = devm_platform_ioremap_resource(pdev, 2); -+ if (IS_ERR(gs->gpio_set_io)) -+ return PTR_ERR(gs->gpio_set_io); - -- if (device_property_read_u32(dev, "ctrl_gpio_mask", &gs->ctrl_gpio_mask)) -- gs->ctrl_gpio_mask = 0x0; -+ gs->gpio_clr_io = devm_platform_ioremap_resource(pdev, 3); -+ if (IS_ERR(gs->gpio_clr_io)) -+ return PTR_ERR(gs->gpio_clr_io); -+ -+ gs->valid_mask = 0x0; -+ device_property_read_u32(dev, "valid_mask", &gs->valid_mask); - - gc = &gs->gc; - -- /* To set the direction to input, just give control to HW by setting -- * YU_GPIO_FW_CONTROL_CLEAR. -- * If the GPIO is controlled by HW, read its value via read_data_in register. -- * -- * When the direction = output, the GPIO is controlled by SW and -- * datain=dataout. If software modifies the value of the GPIO pin, -- * the value can be read from read_data_in without changing the direction. -- */ - ret = bgpio_init(gc, dev, 4, -- gs->gpio_io + YU_GPIO_READ_DATA_IN, -- NULL, -- NULL, -- NULL, -- NULL, -- 0); -- -- gc->set = mlxbf3_gpio_set; -- gc->direction_input = mlxbf3_gpio_direction_input; -- gc->direction_output = mlxbf3_gpio_direction_output; -- -- gc->ngpio = npins; -+ gs->gpio_io + MLXBF_GPIO_READ_DATA_IN, -+ gs->gpio_set_io + MLXBF_GPIO_FW_DATA_OUT_SET, -+ gs->gpio_clr_io + MLXBF_GPIO_FW_DATA_OUT_CLEAR, -+ gs->gpio_set_io + MLXBF_GPIO_FW_OUTPUT_ENABLE_SET, -+ gs->gpio_clr_io + MLXBF_GPIO_FW_OUTPUT_ENABLE_CLEAR, 0); -+ -+ gc->request = gpiochip_generic_request; -+ gc->free = gpiochip_generic_free; - gc->owner = THIS_MODULE; -+ gc->init_valid_mask = mlxbf3_gpio_init_valid_mask; - - irq = platform_get_irq(pdev, 0); - if (irq >= 0) { -- gs->irq_chip.name = name; -- gs->irq_chip.irq_set_type = mlxbf3_gpio_irq_set_type; -- gs->irq_chip.irq_enable = mlxbf3_gpio_irq_enable; -- gs->irq_chip.irq_disable = mlxbf3_gpio_irq_disable; -- - girq = &gs->gc.irq; -- girq->chip = &gs->irq_chip; -- girq->handler = handle_simple_irq; -+ girq->chip = &gpio_mlxbf3_irqchip; - girq->default_type = IRQ_TYPE_NONE; - /* This will let us handle the parent IRQ in the driver */ - girq->num_parents = 0; - girq->parents = NULL; - girq->parent_handler = NULL; -+ girq->handler = handle_bad_irq; - - /* - * Directly request the irq here instead of passing - * a flow-handler because the irq is shared. - */ - ret = devm_request_irq(dev, irq, mlxbf3_gpio_irq_handler, -- IRQF_SHARED, name, gs); -- if (ret) { -- dev_err(dev, "failed to request IRQ"); -- return ret; -- } -+ IRQF_SHARED, dev_name(dev), gs); -+ if (ret) -+ return dev_err_probe(dev, ret, "failed to request IRQ"); - } - - platform_set_drvdata(pdev, gs); - - ret = devm_gpiochip_add_data(dev, &gs->gc, gs); -- if (ret) { -- dev_err(dev, "Failed adding memory mapped gpiochip\n"); -- return ret; -- } -- -- return 0; --} -- --static int mlxbf3_gpio_remove(struct platform_device *pdev) --{ -- struct mlxbf3_gpio_context *gs = platform_get_drvdata(pdev); -- -- /* Set the GPIO control back to HW */ -- writel(gs->ctrl_gpio_mask, gs->gpio_io + YU_GPIO_FW_CONTROL_CLEAR); -+ if (ret) -+ dev_err_probe(dev, ret, "Failed adding memory mapped gpiochip\n"); - - return 0; - } - --static const struct acpi_device_id __maybe_unused mlxbf3_gpio_acpi_match[] = { -+static const struct acpi_device_id mlxbf3_gpio_acpi_match[] = { - { "MLNXBF33", 0 }, -- {}, -+ {} - }; - MODULE_DEVICE_TABLE(acpi, mlxbf3_gpio_acpi_match); - -@@ -329,12 +262,10 @@ static struct platform_driver mlxbf3_gpio_driver = { - .acpi_match_table = mlxbf3_gpio_acpi_match, - }, - .probe = mlxbf3_gpio_probe, -- .remove = mlxbf3_gpio_remove, - }; -- - module_platform_driver(mlxbf3_gpio_driver); - --MODULE_DESCRIPTION("Mellanox BlueField-3 GPIO Driver"); -+MODULE_DESCRIPTION("NVIDIA BlueField-3 GPIO Driver"); - MODULE_AUTHOR("Asmaa Mnebhi "); - MODULE_LICENSE("Dual BSD/GPL"); - MODULE_VERSION(DRV_VERSION); --- -2.14.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0291-mlxsw-core_hwmon-Align-modules-label-name-assignment.patch b/platform/mellanox/non-upstream-patches/patches/0291-mlxsw-core_hwmon-Align-modules-label-name-assignment.patch deleted file mode 100644 index e19583d193d8..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0291-mlxsw-core_hwmon-Align-modules-label-name-assignment.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 41dd6c60de14f70908fc03ed2c20aa35ae0d1596 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Mon, 19 Jun 2023 09:53:41 +0000 -Subject: [PATCH backport 5.10 3/3] mlxsw: core_hwmon: Align modules label name - assignment according to the MTCAP sensor counter -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -For some new devices MTCAP register provides the counter of ASIC -ambient sensors plus additional number of platform sensors. -In such case 'sensor count' will be greater then 1 and modules labels -will be shifted by the number of platform sensors. - -Thus utilities sensors will expose incorrect modules labels. -For example, temperatures for module#1, module#2 will be exposed like: -front panel 002: +37.0°C (crit = +70.0°C, emerg = +75.0°C) -front panel 003: +47.0°C (crit = +70.0°C, emerg = +75.0°C) -instead of: -front panel 002: +37.0°C (crit = +70.0°C, emerg = +75.0°C) -front panel 003: +47.0°C (crit = +70.0°C, emerg = +75.0°C) - -Set 'index' used in label name according to the 'sensor_count' value. - -Signed-off-by: Vadim Pasternak ---- - drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c -index a27146cca..f80050cec 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c -@@ -412,6 +412,13 @@ mlxsw_hwmon_module_temp_label_show(struct device *dev, - int index = mlxsw_hwmon_attr->type_index; - - mlxsw_hwmon_dev = mlxsw_hwmon_attr->mlxsw_hwmon_dev; -+ /* For some devices 'sensor count' provides the number of ASIC sensor -+ * plus additional platform sensors. Set 'index' used in label name -+ * according to the 'sensor_count' value to align label name with the -+ * module index. -+ */ -+ if (mlxsw_hwmon_dev->sensor_count > 1) -+ index += 1 - mlxsw_hwmon_dev->sensor_count; - if (strlen(mlxsw_hwmon_dev->name)) - index += 1; - --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0292-mlxsw-i2c-Limit-single-transaction-buffer-size.patch b/platform/mellanox/non-upstream-patches/patches/0292-mlxsw-i2c-Limit-single-transaction-buffer-size.patch deleted file mode 100644 index 1fffd92e5964..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0292-mlxsw-i2c-Limit-single-transaction-buffer-size.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 3363b3f15f1f65c5b33c464c1bb9d71fc044d3a8 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Thu, 6 Jul 2023 04:51:52 +0000 -Subject: [PATH backport 1/2] mlxsw: i2c: Limit single transaction buffer size - -Maximum size of buffer is obtained from underlying I2C adapter and in -case adapter allows I2C transaction buffer size greater than 100 bytes, -transaction will fail due to firmware limitation. -Limit the maximum size of transaction buffer by 100 bytes to fit to -firmware. - -Fixes: 3029a693beda ("mlxsw: i2c: Allow flexible setting of I2C transactions size") -Signed-off-by: Vadim Pasternak ---- - drivers/net/ethernet/mellanox/mlxsw/i2c.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/drivers/net/ethernet/mellanox/mlxsw/i2c.c b/drivers/net/ethernet/mellanox/mlxsw/i2c.c -index e04557afc..9fe03dd9e 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/i2c.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/i2c.c -@@ -48,6 +48,7 @@ - #define MLXSW_I2C_MBOX_SIZE_BITS 12 - #define MLXSW_I2C_ADDR_BUF_SIZE 4 - #define MLXSW_I2C_BLK_DEF 32 -+#define MLXSW_I2C_BLK_MAX 100 - #define MLXSW_I2C_RETRY 5 - #define MLXSW_I2C_TIMEOUT_MSECS 5000 - #define MLXSW_I2C_MAX_DATA_SIZE 256 -@@ -700,9 +701,10 @@ static int mlxsw_i2c_probe(struct i2c_client *client, - return -EOPNOTSUPP; - } - -- mlxsw_i2c->block_size = max_t(u16, MLXSW_I2C_BLK_DEF, -+ mlxsw_i2c->block_size = min_t(u16, MLXSW_I2C_BLK_MAX, -+ max_t(u16, MLXSW_I2C_BLK_DEF, - min_t(u16, quirks->max_read_len, -- quirks->max_write_len)); -+ quirks->max_write_len))); - } else { - mlxsw_i2c->block_size = MLXSW_I2C_BLK_DEF; - } --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0293-mlxsw-reg-Limit-MTBR-register-records-buffer-by-one-.patch b/platform/mellanox/non-upstream-patches/patches/0293-mlxsw-reg-Limit-MTBR-register-records-buffer-by-one-.patch deleted file mode 100644 index ebbdb451d113..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0293-mlxsw-reg-Limit-MTBR-register-records-buffer-by-one-.patch +++ /dev/null @@ -1,33 +0,0 @@ -From d11192c5d4622552cd399194bf90af03ea2495a5 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Thu, 6 Jul 2023 07:40:34 +0000 -Subject: [PATH backport 2/2] mlxsw: reg: Limit MTBR register records buffer by - one record - -The MTBR register is used to obtain specific cable status, so just only -one data record is required in transaction. - -Limit size of MTBR register to avoid sending redundant size of buffer -to firmware. - -Signed-off-by: Vadim Pasternak ---- - drivers/net/ethernet/mellanox/mlxsw/reg.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h -index f8c828e05..81b4278fc 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/reg.h -+++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h -@@ -8771,7 +8771,7 @@ MLXSW_ITEM_BIT_ARRAY(reg, mtwe, sensor_warning, 0x0, 0x10, 1); - #define MLXSW_REG_MTBR_ID 0x900F - #define MLXSW_REG_MTBR_BASE_LEN 0x10 /* base length, without records */ - #define MLXSW_REG_MTBR_REC_LEN 0x04 /* record length */ --#define MLXSW_REG_MTBR_REC_MAX_COUNT 47 /* firmware limitation */ -+#define MLXSW_REG_MTBR_REC_MAX_COUNT 1 - #define MLXSW_REG_MTBR_LEN (MLXSW_REG_MTBR_BASE_LEN + \ - MLXSW_REG_MTBR_REC_LEN * \ - MLXSW_REG_MTBR_REC_MAX_COUNT) --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0296-UBUNTU-SAUCE-mmc-sdhci-of-dwcmshc-Add-runtime-PM-ope.patch b/platform/mellanox/non-upstream-patches/patches/0296-UBUNTU-SAUCE-mmc-sdhci-of-dwcmshc-Add-runtime-PM-ope.patch deleted file mode 100644 index 00f87c6050fa..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0296-UBUNTU-SAUCE-mmc-sdhci-of-dwcmshc-Add-runtime-PM-ope.patch +++ /dev/null @@ -1,159 +0,0 @@ -From 48ac30096b7a3993f8711c0c3e09a0f06ea9639d Mon Sep 17 00:00:00 2001 -From: Liming Sun -Date: Tue, 4 Apr 2023 19:30:00 -0400 -Subject: [PATCH] UBUNTU: SAUCE: mmc: sdhci-of-dwcmshc: Add runtime PM - operations for BlueField-3 -X-NVConfidentiality: public - -BugLink: https://bugs.launchpad.net/bugs/2015307 - -This commit implements the runtime PM operations For BlueField-3 SoC -to disable eMMC card clock when idle. - -Reviewed-by: Khalil Blaiech -Signed-off-by: Liming Sun -Acked-by: Bartlomiej Zolnierkiewicz -Acked-by: Andrei Gherzan -[bzolnier: use a short URL version for BugLink] -Signed-off-by: Bartlomiej Zolnierkiewicz ---- - drivers/mmc/host/sdhci-of-dwcmshc.c | 102 +++++++++++++++++++++++++++++++++++- - 1 file changed, 101 insertions(+), 1 deletion(-) - -diff --git a/drivers/mmc/host/sdhci-of-dwcmshc.c b/drivers/mmc/host/sdhci-of-dwcmshc.c -index af995dc30..cc6b948d4 100644 ---- a/drivers/mmc/host/sdhci-of-dwcmshc.c -+++ b/drivers/mmc/host/sdhci-of-dwcmshc.c -@@ -16,6 +16,7 @@ - #include - #include - #include -+#include - - #include "sdhci-pltfm.h" - -@@ -72,6 +73,21 @@ struct dwcmshc_priv { - void *priv; /* pointer to SoC private stuff */ - }; - -+/* Last jiffies when entering idle state */ -+static uint64_t idle_last_jiffies; -+ -+/* Total jiffies in idle state */ -+static uint64_t idle_total_jiffies; -+ -+/* Total idle time */ -+static int idle_time; -+module_param(idle_time, int, 0444); -+MODULE_PARM_DESC(idle_time, "idle time (seconds)"); -+ -+/* The current idle state */ -+static int idle_state; -+module_param(idle_state, int, 0444); -+MODULE_PARM_DESC(idle_state, "idle state (0: not idle, 1: idle)"); - /* - * If DMA addr spans 128MB boundary, we split the DMA transfer into two - * so that each DMA transfer doesn't exceed the boundary. -@@ -432,6 +448,7 @@ static int dwcmshc_probe(struct platform_device *pdev) - #ifdef CONFIG_ACPI - if (pltfm_data == &sdhci_dwcmshc_bf3_pdata) { - sdhci_enable_v4_mode(host); -+ pm_runtime_enable(dev); - } - #endif - -@@ -526,7 +543,90 @@ static int dwcmshc_resume(struct device *dev) - } - #endif - --static SIMPLE_DEV_PM_OPS(dwcmshc_pmops, dwcmshc_suspend, dwcmshc_resume); -+#ifdef CONFIG_PM -+ -+#ifdef CONFIG_ACPI -+static void dwcmshc_enable_card_clk(struct sdhci_host *host) -+{ -+ u16 ctrl; -+ -+ ctrl = sdhci_readw(host, SDHCI_CLOCK_CONTROL); -+ ctrl |= SDHCI_CLOCK_CARD_EN; -+ sdhci_writew(host, ctrl, SDHCI_CLOCK_CONTROL); -+} -+ -+static void dwcmshc_disable_card_clk(struct sdhci_host *host) -+{ -+ u16 ctrl; -+ -+ ctrl = sdhci_readw(host, SDHCI_CLOCK_CONTROL); -+ ctrl &= ~SDHCI_CLOCK_CARD_EN; -+ sdhci_writew(host, ctrl, SDHCI_CLOCK_CONTROL); -+} -+#endif -+ -+static int dwcmshc_runtime_suspend(struct device *dev) -+{ -+ struct sdhci_host *host = dev_get_drvdata(dev); -+ const struct sdhci_pltfm_data *pltfm_data; -+ int ret = 0; -+ -+ pltfm_data = device_get_match_data(dev); -+ if (!pltfm_data) -+ return -ENODEV; -+ -+#ifdef CONFIG_ACPI -+ if (pltfm_data == &sdhci_dwcmshc_bf3_pdata) { -+ ret = sdhci_runtime_suspend_host(host); -+ if (!ret) { -+ dwcmshc_disable_card_clk(host); -+ -+ if (!idle_state) { -+ idle_state = 1; -+ idle_last_jiffies = jiffies; -+ } -+ } -+ } -+#endif -+ -+ return ret; -+} -+ -+static int dwcmshc_runtime_resume(struct device *dev) -+{ -+ struct sdhci_host *host = dev_get_drvdata(dev); -+ const struct sdhci_pltfm_data *pltfm_data; -+ int ret = 0; -+ -+ pltfm_data = device_get_match_data(dev); -+ if (!pltfm_data) -+ return -ENODEV; -+ -+#ifdef CONFIG_ACPI -+ if (pltfm_data == &sdhci_dwcmshc_bf3_pdata) { -+ dwcmshc_enable_card_clk(host); -+ -+ if (idle_state) { -+ idle_state = 0; -+ idle_total_jiffies = jiffies - idle_last_jiffies; -+ idle_time += jiffies_to_msecs( -+ idle_total_jiffies) / 1000; -+ } -+ -+ ret = sdhci_runtime_resume_host(host, 0); -+ } -+#endif -+ -+ return ret; -+} -+ -+#endif -+ -+static const struct dev_pm_ops dwcmshc_pmops = { -+ SET_SYSTEM_SLEEP_PM_OPS(dwcmshc_suspend, dwcmshc_resume) -+ SET_RUNTIME_PM_OPS(dwcmshc_runtime_suspend, -+ dwcmshc_runtime_resume, NULL) -+}; - - static struct platform_driver sdhci_dwcmshc_driver = { - .driver = { --- -2.14.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0298-UBUNTU-SAUCE-mlxbf-ptm-use-0444-instead-of-S_IRUGO.patch b/platform/mellanox/non-upstream-patches/patches/0298-UBUNTU-SAUCE-mlxbf-ptm-use-0444-instead-of-S_IRUGO.patch deleted file mode 100644 index ce0a48ea7e2b..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0298-UBUNTU-SAUCE-mlxbf-ptm-use-0444-instead-of-S_IRUGO.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 6066741b9491d990cea962e7e56c0d3d4f7bc393 Mon Sep 17 00:00:00 2001 -From: Jitendra Lanka -Date: Wed, 22 Mar 2023 11:39:55 -0400 -Subject: [PATCH] UBUNTU: SAUCE: mlxbf-ptm: use 0444 instead of S_IRUGO -X-NVConfidentiality: public - -BugLink: https://bugs.launchpad.net/bugs/2011738 - -As recommended by checkscript, change S_IRUGO to 0444 - -Signed-off-by: Jitendra Lanka -Acked-by: Tim Gardner -Acked-by: Bartlomiej Zolnierkiewicz -Signed-off-by: Bartlomiej Zolnierkiewicz ---- - drivers/platform/mellanox/mlxbf-ptm.c | 22 +++++++++++----------- - 1 file changed, 11 insertions(+), 11 deletions(-) - -diff --git a/drivers/platform/mellanox/mlxbf-ptm.c b/drivers/platform/mellanox/mlxbf-ptm.c -index 79c3e2902..aeb68dc42 100644 ---- a/drivers/platform/mellanox/mlxbf-ptm.c -+++ b/drivers/platform/mellanox/mlxbf-ptm.c -@@ -154,27 +154,27 @@ static int __init mlxbf_ptm_init(void) - monitors = debugfs_create_dir("monitors", ptm_root); - status = debugfs_create_dir("status", monitors); - -- debugfs_create_file("vr0_power", S_IRUGO, status, NULL, -+ debugfs_create_file("vr0_power", 0444, status, NULL, - &vr0_power_fops); -- debugfs_create_file("vr1_power", S_IRUGO, status, NULL, -+ debugfs_create_file("vr1_power", 0444, status, NULL, - &vr1_power_fops); -- debugfs_create_file("total_power", S_IRUGO, status, NULL, -+ debugfs_create_file("total_power", 0444, status, NULL, - &total_power_fops); -- debugfs_create_file("ddr_temp", S_IRUGO, status, -+ debugfs_create_file("ddr_temp", 0444, status, - NULL, &ddr_thld_fops); -- debugfs_create_file("core_temp", S_IRUGO, status, -+ debugfs_create_file("core_temp", 0444, status, - NULL, &core_temp_fops); -- debugfs_create_file("power_throttling_event_count", S_IRUGO, status, -+ debugfs_create_file("power_throttling_event_count", 0444, status, - NULL, &pwr_evt_counter_fops); -- debugfs_create_file("thermal_throttling_event_count", S_IRUGO, status, -+ debugfs_create_file("thermal_throttling_event_count", 0444, status, - NULL, &temp_evt_counter_fops); -- debugfs_create_file("throttling_state", S_IRUGO, status, -+ debugfs_create_file("throttling_state", 0444, status, - NULL, &throttling_state_fops); -- debugfs_create_file("power_throttling_state", S_IRUGO, status, -+ debugfs_create_file("power_throttling_state", 0444, status, - NULL, &pthrottling_state_fops); -- debugfs_create_file("thermal_throttling_state", S_IRUGO, status, -+ debugfs_create_file("thermal_throttling_state", 0444, status, - NULL, &tthrottling_state_fops); -- debugfs_create_file("error_state", S_IRUGO, status, -+ debugfs_create_file("error_state", 0444, status, - NULL, &error_status_fops); - - return 0; --- -2.14.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0299-UBUNTU-SAUCE-mlxbf-ptm-add-atx-debugfs-nodes.patch b/platform/mellanox/non-upstream-patches/patches/0299-UBUNTU-SAUCE-mlxbf-ptm-add-atx-debugfs-nodes.patch deleted file mode 100644 index dad2943f0586..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0299-UBUNTU-SAUCE-mlxbf-ptm-add-atx-debugfs-nodes.patch +++ /dev/null @@ -1,83 +0,0 @@ -From e6e21f6d79e1ccd2a88817c982f8350e5a1dfa92 Mon Sep 17 00:00:00 2001 -From: Jitendra Lanka -Date: Wed, 22 Mar 2023 11:39:56 -0400 -Subject: [PATCH] UBUNTU: SAUCE: mlxbf-ptm: add atx debugfs nodes -X-NVConfidentiality: public - -BugLink: https://bugs.launchpad.net/bugs/2011738 - -Add additional debugfs nodes that provide ATX status and -power profile data. - -Signed-off-by: Jitendra Lanka -Acked-by: Tim Gardner -Acked-by: Bartlomiej Zolnierkiewicz -Signed-off-by: Bartlomiej Zolnierkiewicz ---- - drivers/platform/mellanox/mlxbf-ptm.c | 36 +++++++++++++++++++++++++++++++++++ - 1 file changed, 36 insertions(+) - -diff --git a/drivers/platform/mellanox/mlxbf-ptm.c b/drivers/platform/mellanox/mlxbf-ptm.c -index aeb68dc42..a2845aa57 100644 ---- a/drivers/platform/mellanox/mlxbf-ptm.c -+++ b/drivers/platform/mellanox/mlxbf-ptm.c -@@ -23,6 +23,9 @@ - #define MLNX_PTM_GET_MAX_TEMP 0x82000108 - #define MLNX_PTM_GET_PWR_EVT_CNT 0x82000109 - #define MLNX_PTM_GET_TEMP_EVT_CNT 0x8200010A -+#define MLNX_PTM_GET_POWER_ENVELOPE 0x8200010B -+#define MLNX_PTM_GET_ATX_PWR_STATE 0x8200010C -+#define MLNX_PTM_GET_CUR_PPROFILE 0x8200010D - - #define MLNX_POWER_ERROR 300 - -@@ -142,6 +145,33 @@ static int error_status_show(void *data, u64 *val) - DEFINE_SIMPLE_ATTRIBUTE(error_status_fops, - error_status_show, NULL, "%llu\n"); - -+static int power_envelope_show(void *data, u64 *val) -+{ -+ *val = smc_call0(MLNX_PTM_GET_POWER_ENVELOPE); -+ -+ return 0; -+} -+DEFINE_SIMPLE_ATTRIBUTE(power_envelope_fops, -+ power_envelope_show, NULL, "%llu\n"); -+ -+static int atx_status_show(void *data, u64 *val) -+{ -+ *val = smc_call0(MLNX_PTM_GET_ATX_PWR_STATE); -+ -+ return 0; -+} -+DEFINE_SIMPLE_ATTRIBUTE(atx_status_fops, -+ atx_status_show, NULL, "%lld\n"); -+ -+static int current_pprofile_show(void *data, u64 *val) -+{ -+ *val = smc_call0(MLNX_PTM_GET_CUR_PPROFILE); -+ -+ return 0; -+} -+DEFINE_SIMPLE_ATTRIBUTE(current_pprofile_fops, -+ current_pprofile_show, NULL, "%llu\n"); -+ - - static int __init mlxbf_ptm_init(void) - { -@@ -176,6 +206,12 @@ static int __init mlxbf_ptm_init(void) - NULL, &tthrottling_state_fops); - debugfs_create_file("error_state", 0444, status, - NULL, &error_status_fops); -+ debugfs_create_file("power_envelope", 0444, status, -+ NULL, &power_envelope_fops); -+ debugfs_create_file("atx_power_available", 0444, status, -+ NULL, &atx_status_fops); -+ debugfs_create_file("active_power_profile", 0444, status, -+ NULL, ¤t_pprofile_fops); - - return 0; - } --- -2.14.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0300-UBUNTU-SAUCE-mlxbf-ptm-update-module-version.patch b/platform/mellanox/non-upstream-patches/patches/0300-UBUNTU-SAUCE-mlxbf-ptm-update-module-version.patch deleted file mode 100644 index 1ff594df611d..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0300-UBUNTU-SAUCE-mlxbf-ptm-update-module-version.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 83e12ab298ef4c328ae0b410412abc9c5bf40678 Mon Sep 17 00:00:00 2001 -From: Jitendra Lanka -Date: Wed, 22 Mar 2023 11:39:57 -0400 -Subject: [PATCH] UBUNTU: SAUCE: mlxbf-ptm: update module version -X-NVConfidentiality: public - -BugLink: https://bugs.launchpad.net/bugs/2011738 - -update module version - -Signed-off-by: Jitendra Lanka -Acked-by: Tim Gardner -Acked-by: Bartlomiej Zolnierkiewicz -Signed-off-by: Bartlomiej Zolnierkiewicz ---- - drivers/platform/mellanox/mlxbf-ptm.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/platform/mellanox/mlxbf-ptm.c b/drivers/platform/mellanox/mlxbf-ptm.c -index a2845aa57..eb4460cb0 100644 ---- a/drivers/platform/mellanox/mlxbf-ptm.c -+++ b/drivers/platform/mellanox/mlxbf-ptm.c -@@ -227,4 +227,4 @@ module_exit(mlxbf_ptm_exit); - MODULE_AUTHOR("Jitendra Lanka "); - MODULE_DESCRIPTION("Nvidia Bluefield power and thermal debugfs driver"); - MODULE_LICENSE("Dual BSD/GPL"); --MODULE_VERSION("1.0"); -+MODULE_VERSION("1.1"); --- -2.14.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0301-UBUNTU-SAUCE-mlxbf-gige-Fix-kernel-panic-at-shutdown.patch b/platform/mellanox/non-upstream-patches/patches/0301-UBUNTU-SAUCE-mlxbf-gige-Fix-kernel-panic-at-shutdown.patch deleted file mode 100644 index 3f98aa9e723a..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0301-UBUNTU-SAUCE-mlxbf-gige-Fix-kernel-panic-at-shutdown.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 4da66721a3e397268fd5070080d44399101ef9e9 Mon Sep 17 00:00:00 2001 -From: Asmaa Mnebhi -Date: Fri, 2 Jun 2023 13:04:25 -0400 -Subject: [PATCH] UBUNTU: SAUCE: mlxbf-gige: Fix kernel panic at shutdown -X-NVConfidentiality: public - -BugLink: https://bugs.launchpad.net/bugs/2022370 - -We occasionally see a race condition (once every 350 reboots) where napi is still -running (mlxbf_gige_poll) while a shutdown has been initiated through "reboot". -Since mlxbf_gige_poll is still running, it tries to access a NULL pointer and as -a result causes a kernel panic. - -The fix is to explicitly disable napi and dequeue it during shutdown. -mlxbf_gige_remove already calls: -unregister_netdev->unregister_netdevice->unregister_netdev_queue-> -rollback_registered->rollback_registered_many->dev_close_many-> -__dev_close_many->ndo_stop->mlxbf_gige_stop which stops napi - -So use mlxbf_gige_remove in place of the existing shutdown logic. - -Signed-off-by: Asmaa Mnebhi -Acked-by: Bartlomiej Zolnierkiewicz -Acked-by: Tim Gardner -Signed-off-by: Bartlomiej Zolnierkiewicz ---- - drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c | 5 +---- - 1 file changed, 1 insertion(+), 4 deletions(-) - -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -index 602260f2b..b7c1a10c4 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -@@ -500,10 +500,7 @@ static int mlxbf_gige_remove(struct platform_device *pdev) - - static void mlxbf_gige_shutdown(struct platform_device *pdev) - { -- struct mlxbf_gige *priv = platform_get_drvdata(pdev); -- -- writeq(0, priv->base + MLXBF_GIGE_INT_EN); -- mlxbf_gige_clean_port(priv); -+ mlxbf_gige_remove(pdev); - } - - static const struct acpi_device_id __maybe_unused mlxbf_gige_acpi_match[] = { --- -2.14.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0302-UBUNTU-SAUCE-mlxbf-bootctl-support-SMC-call-for-sett.patch b/platform/mellanox/non-upstream-patches/patches/0302-UBUNTU-SAUCE-mlxbf-bootctl-support-SMC-call-for-sett.patch deleted file mode 100644 index e2aae0c0d4f2..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0302-UBUNTU-SAUCE-mlxbf-bootctl-support-SMC-call-for-sett.patch +++ /dev/null @@ -1,94 +0,0 @@ -From 76ed90858f09e7be6601053d0654872ab0018379 Mon Sep 17 00:00:00 2001 -From: Asmaa Mnebhi -Date: Thu, 30 Mar 2023 14:42:33 -0400 -Subject: [PATCH] UBUNTU: SAUCE: mlxbf-bootctl: support SMC call for setting - ARM boot state -X-NVConfidentiality: public - -BugLink: https://bugs.launchpad.net/bugs/2013383 - -Add a new SMC call which allows setting the ARM boot progress state to "OS is up". - -Signed-off-by: Asmaa Mnebhi -Acked-by: Tim Gardner -Acked-by: Bartlomiej Zolnierkiewicz -Signed-off-by: Bartlomiej Zolnierkiewicz ---- - drivers/platform/mellanox/mlxbf-bootctl.c | 23 +++++++++++++++++++++++ - drivers/platform/mellanox/mlxbf-bootctl.h | 5 +++++ - 2 files changed, 28 insertions(+) - -diff --git a/drivers/platform/mellanox/mlxbf-bootctl.c b/drivers/platform/mellanox/mlxbf-bootctl.c -index e8877a19d..a68bf5b27 100644 ---- a/drivers/platform/mellanox/mlxbf-bootctl.c -+++ b/drivers/platform/mellanox/mlxbf-bootctl.c -@@ -105,6 +105,7 @@ enum { - /* This mutex is used to serialize MFG write and lock operations. */ - static DEFINE_MUTEX(mfg_ops_lock); - static DEFINE_MUTEX(icm_ops_lock); -+static DEFINE_MUTEX(os_up_lock); - - #define MLNX_MFG_OOB_MAC_LEN ETH_ALEN - #define MLNX_MFG_OPN_VAL_LEN 24 -@@ -747,6 +748,26 @@ static ssize_t mfg_lock_store(struct device_driver *drv, const char *buf, - return count; - } - -+static ssize_t os_up_store(struct device_driver *drv, const char *buf, -+ size_t count) -+{ -+ unsigned long val; -+ int err; -+ -+ err = kstrtoul(buf, 10, &val); -+ if (err) -+ return err; -+ -+ if (val != 1) -+ return -EINVAL; -+ -+ mutex_lock(&os_up_lock); -+ smc_call0(MLNX_HANDLE_OS_UP); -+ mutex_unlock(&os_up_lock); -+ -+ return count; -+} -+ - /* Log header format. */ - #define RSH_LOG_TYPE_SHIFT 56 - #define RSH_LOG_LEN_SHIFT 48 -@@ -1209,6 +1230,7 @@ static DRIVER_ATTR_RW(rev); - static DRIVER_ATTR_WO(mfg_lock); - static DRIVER_ATTR_RW(rsh_log); - static DRIVER_ATTR_RW(large_icm); -+static DRIVER_ATTR_WO(os_up); - - static struct attribute *mbc_dev_attrs[] = { - &driver_attr_post_reset_wdog.attr, -@@ -1227,6 +1249,7 @@ static struct attribute *mbc_dev_attrs[] = { - &driver_attr_mfg_lock.attr, - &driver_attr_rsh_log.attr, - &driver_attr_large_icm.attr, -+ &driver_attr_os_up.attr, - NULL - }; - -diff --git a/drivers/platform/mellanox/mlxbf-bootctl.h b/drivers/platform/mellanox/mlxbf-bootctl.h -index c70204770..dc73f7e88 100644 ---- a/drivers/platform/mellanox/mlxbf-bootctl.h -+++ b/drivers/platform/mellanox/mlxbf-bootctl.h -@@ -102,6 +102,11 @@ - #define MLNX_HANDLE_SET_ICM_INFO 0x82000012 - #define MLNX_HANDLE_GET_ICM_INFO 0x82000013 - -+/* -+ * SMC function ID to set the ARM boot state to up -+ */ -+#define MLNX_HANDLE_OS_UP 0x82000014 -+ - #define MAX_ICM_BUFFER_SIZE 10 - - /* SMC function IDs for SiP Service queries */ --- -2.14.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0303-UBUNTU-SAUCE-Add-BF3-related-ACPI-config-and-Ring-de.patch b/platform/mellanox/non-upstream-patches/patches/0303-UBUNTU-SAUCE-Add-BF3-related-ACPI-config-and-Ring-de.patch deleted file mode 100644 index d73e70262a2a..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0303-UBUNTU-SAUCE-Add-BF3-related-ACPI-config-and-Ring-de.patch +++ /dev/null @@ -1,135 +0,0 @@ -From 8660928fa01c363f1aa826d392de2c6ef4924dcf Mon Sep 17 00:00:00 2001 -From: Shih-Yi Chen -Date: Wed, 5 Apr 2023 14:41:27 -0400 -Subject: [PATCH] UBUNTU: SAUCE: Add BF3 related ACPI config and Ring device - creation code -X-NVConfidentiality: public - -BugLink: https://bugs.launchpad.net/bugs/2015292 - -Fixed Missing ACPI device info in mlxbf_pka module. Added configuration info -and associated code to provision PKA ring devices. - -Signed-off-by: Shih-Yi Chen -Reviewed-by: Khalil Blaiech -Acked-by: Bartlomiej Zolnierkiewicz -Acked-by: Andrei Gherzan -Signed-off-by: Bartlomiej Zolnierkiewicz ---- - .../platform/mellanox/mlxbf_pka/mlxbf_pka_config.h | 9 ++++++--- - .../platform/mellanox/mlxbf_pka/mlxbf_pka_drv.c | 23 +++++++++++++++++++--- - 2 files changed, 26 insertions(+), 6 deletions(-) - -diff --git a/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_config.h b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_config.h -index 5b69d55be..c9543416b 100644 ---- a/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_config.h -+++ b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_config.h -@@ -37,7 +37,7 @@ - #include "mlxbf_pka_addrs.h" - - // The maximum number of PKA shims refered to as IO blocks. --#define PKA_MAX_NUM_IO_BLOCKS 8 -+#define PKA_MAX_NUM_IO_BLOCKS 24 - // The maximum number of Rings supported by IO block (shim). - #define PKA_MAX_NUM_IO_BLOCK_RINGS 4 - -@@ -72,8 +72,11 @@ - #define PKA_WINDOW_RAM_RING_MEM_SIZE 0x0800 // 2KB - #define PKA_WINDOW_RAM_DATA_MEM_SIZE 0x3800 // 14KB - --// Offset mask, common to both Window and Alternate Window RAM. --#define PKA_WINDOW_RAM_OFFSET_MASK1 0x730000 -+// Window RAM/Alternate Window RAM offset mask for BF1 and BF2 -+#define PKA_WINDOW_RAM_OFFSET_MASK1 0x730000 -+// -+// Window RAM/Alternate Window RAM offset mask for BF3 -+#define PKA_WINDOW_RAM_OFFSET_MASK2 0x70000 - - // Macro for mapping PKA Ring address into Window RAM address. It converts the - // ring address, either physical address or virtual address, to valid address -diff --git a/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_drv.c b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_drv.c -index 9e26ccf21..6b171b2a6 100644 ---- a/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_drv.c -+++ b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_drv.c -@@ -34,6 +34,9 @@ - #define PKA_DEVICE_ACPIHID_BF2 "MLNXBF20" - #define PKA_RING_DEVICE_ACPIHID_BF2 "MLNXBF21" - -+#define PKA_DEVICE_ACPIHID_BF3 "MLNXBF51" -+#define PKA_RING_DEVICE_ACPIHID_BF3 "MLNXBF52" -+ - #define PKA_DEVICE_ACCESS_MODE 0666 - - #define PKA_DEVICE_RES_CNT 7 -@@ -49,7 +52,8 @@ enum pka_mem_res_idx { - - enum pka_plat_type { - PKA_PLAT_TYPE_BF1 = 0, /* Platform type Bluefield-1 */ -- PKA_PLAT_TYPE_BF2 /* Platform type Bluefield-2 */ -+ PKA_PLAT_TYPE_BF2, /* Platform type Bluefield-2 */ -+ PKA_PLAT_TYPE_BF3 /* Platform type Bluefield-3 */ - }; - - static DEFINE_MUTEX(pka_drv_lock); -@@ -66,6 +70,9 @@ const char pka_ring_acpihid_bf1[] = PKA_RING_DEVICE_ACPIHID_BF1; - const char pka_acpihid_bf2[] = PKA_DEVICE_ACPIHID_BF2; - const char pka_ring_acpihid_bf2[] = PKA_RING_DEVICE_ACPIHID_BF2; - -+const char pka_acpihid_bf3[] = PKA_DEVICE_ACPIHID_BF3; -+const char pka_ring_acpihid_bf3[] = PKA_RING_DEVICE_ACPIHID_BF3; -+ - struct pka_drv_plat_info { - enum pka_plat_type type; - uint8_t fw_id; -@@ -79,6 +86,10 @@ static struct pka_drv_plat_info pka_drv_plat[] = { - [PKA_PLAT_TYPE_BF2] = { - .type = PKA_PLAT_TYPE_BF2, - .fw_id = PKA_FIRMWARE_IMAGE_2_ID -+ }, -+ [PKA_PLAT_TYPE_BF3] = { -+ .type = PKA_PLAT_TYPE_BF3, -+ .fw_id = PKA_FIRMWARE_IMAGE_2_ID - } - }; - -@@ -87,6 +98,8 @@ static const struct acpi_device_id pka_drv_acpi_ids[] = { - { PKA_RING_DEVICE_ACPIHID_BF1, 0 }, - { PKA_DEVICE_ACPIHID_BF2, (kernel_ulong_t)&pka_drv_plat[PKA_PLAT_TYPE_BF2] }, - { PKA_RING_DEVICE_ACPIHID_BF2, 0 }, -+ { PKA_DEVICE_ACPIHID_BF3, (kernel_ulong_t)&pka_drv_plat[PKA_PLAT_TYPE_BF3] }, -+ { PKA_RING_DEVICE_ACPIHID_BF3, 0 }, - {}, - }; - -@@ -967,6 +980,8 @@ static int pka_drv_probe_device(struct pka_info *info) - plat_info = (struct pka_drv_plat_info *)aid->driver_data; - if (plat_info->type <= PKA_PLAT_TYPE_BF2) { - wndw_ram_off_mask = PKA_WINDOW_RAM_OFFSET_MASK1; -+ } else if (plat_info->type <= PKA_PLAT_TYPE_BF3) { -+ wndw_ram_off_mask = PKA_WINDOW_RAM_OFFSET_MASK2; - } else { - PKA_ERROR(PKA_DRIVER, "Invalid platform type: %d\n", - (int)plat_info->type); -@@ -1210,7 +1225,8 @@ static int pka_drv_acpi_probe(struct platform_device *pdev, - return -EINVAL; - - if (!strcmp(info->acpihid, pka_ring_acpihid_bf1) -- || !strcmp(info->acpihid, pka_ring_acpihid_bf2)) { -+ || !strcmp(info->acpihid, pka_ring_acpihid_bf2) -+ || !strcmp(info->acpihid, pka_ring_acpihid_bf3)) { - error = pka_drv_probe_ring_device(info); - if (error) { - PKA_DEBUG(PKA_DRIVER, -@@ -1222,7 +1238,8 @@ static int pka_drv_acpi_probe(struct platform_device *pdev, - pdev->name); - - } else if (!strcmp(info->acpihid, pka_acpihid_bf1) -- || !strcmp(info->acpihid, pka_acpihid_bf2)) { -+ || !strcmp(info->acpihid, pka_acpihid_bf2) -+ || !strcmp(info->acpihid, pka_acpihid_bf3)) { - error = pka_drv_probe_device(info); - if (error) { - PKA_DEBUG(PKA_DRIVER, --- -2.14.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0306-dt-bindings-trivial-devices-Add-infineon-xdpe1a2g7.patch b/platform/mellanox/non-upstream-patches/patches/0306-dt-bindings-trivial-devices-Add-infineon-xdpe1a2g7.patch deleted file mode 100644 index 509520e0997f..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0306-dt-bindings-trivial-devices-Add-infineon-xdpe1a2g7.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 752f09e963ed92cf6ba69930a26dc4cba674bdd3 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Mon, 17 Jul 2023 16:24:58 +0000 -Subject: [PATCH hwmon-next 2/2] dt-bindings: trivial-devices: Add - infineon,xdpe1a2g7 - -Add new Infineon Multi-phase Digital VR Controller xdpe1a2g7 - -Signed-off-by: Vadim Pasternak ---- - Documentation/devicetree/bindings/trivial-devices.yaml | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml -index adec3a0f6..aa1fa8414 100644 ---- a/Documentation/devicetree/bindings/trivial-devices.yaml -+++ b/Documentation/devicetree/bindings/trivial-devices.yaml -@@ -98,6 +98,8 @@ properties: - - infineon,slb9645tt - # Infineon TLV493D-A1B6 I2C 3D Magnetic Sensor - - infineon,tlv493d-a1b6 -+ # Infineon Multi-phase Digital VR Controller xdpe1a2g7 -+ - infineon,xdpe1a2g7 - # Infineon Multi-phase Digital VR Controller xdpe12254 - - infineon,xdpe12254 - # Infineon Multi-phase Digital VR Controller xdpe12284 --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0307-leds-mlxreg-Add-support-for-new-flavour-of-capabilit.patch b/platform/mellanox/non-upstream-patches/patches/0307-leds-mlxreg-Add-support-for-new-flavour-of-capabilit.patch deleted file mode 100644 index 5ef9bf48369d..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0307-leds-mlxreg-Add-support-for-new-flavour-of-capabilit.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 6f745b2a6cfd48e1e5ab0276665ac1583df263d2 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Thu, 20 Jul 2023 11:01:56 +0000 -Subject: [PATCH] leds: mlxreg: Add support for new flavour of capability - register -X-NVConfidentiality: public - -LED platform data is common across the various systems, while LED -driver should be able to apply only the LED instances relevant -to specific system. - -For example, platform data might contain descriptions for fan1, -fan2, ..., fan{n} LEDs, while some systems equipped with all 'n' fan -LEDs, others with less. - -For detection of the real number of equipped LEDs special capability -register is used. -This register used to indicate presence of LED through the bitmap. - -For some new big modular systems this register will provide presence -data by counter. - -Use slot parameter to distinct whether capability register contains -bitmask or counter. - -Signed-off-by: Vadim Pasternak ---- - drivers/leds/leds-mlxreg.c | 9 ++++++++- - 1 file changed, 8 insertions(+), 1 deletion(-) - -diff --git a/drivers/leds/leds-mlxreg.c b/drivers/leds/leds-mlxreg.c -index 6241a3407..e6b205d31 100644 ---- a/drivers/leds/leds-mlxreg.c -+++ b/drivers/leds/leds-mlxreg.c -@@ -243,7 +243,14 @@ static int mlxreg_led_config(struct mlxreg_led_priv_data *priv) - dev_err(&priv->pdev->dev, "Failed to query capability register\n"); - return err; - } -- if (!(regval & data->bit)) -+ /* -+ * If slot is specified - validate if slot is equipped on system. -+ * In case slot is specified in platform data, capability register -+ * contains the counter of untits. -+ */ -+ if (data->slot && data->slot > regval) -+ continue; -+ else if (!(regval & data->bit) && !data->slot) - continue; - /* - * Field "bit" can contain one capability bit in 0 byte --- -2.14.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0308-leds-mlxreg-Remove-code-for-amber-LED-colour.patch b/platform/mellanox/non-upstream-patches/patches/0308-leds-mlxreg-Remove-code-for-amber-LED-colour.patch deleted file mode 100644 index 690c44b07349..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0308-leds-mlxreg-Remove-code-for-amber-LED-colour.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 76dc17f264b5d1530f110187220923dc8f7db0a4 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Sun, 23 Jul 2023 10:07:15 +0000 -Subject: [PATCH backport 5.10.179 2/2] leds: mlxreg: Remove code for amber LED - colour - -Remove unused code for amber LED colour. - -In case system LED color is "green", "orange" or "amber" same code is -to be used for colour setting. - -Signed-off-by: Vadim Pasternak ---- - drivers/leds/leds-mlxreg.c | 10 ++-------- - 1 file changed, 2 insertions(+), 8 deletions(-) - -diff --git a/drivers/leds/leds-mlxreg.c b/drivers/leds/leds-mlxreg.c -index e6b205d31..26039e187 100644 ---- a/drivers/leds/leds-mlxreg.c -+++ b/drivers/leds/leds-mlxreg.c -@@ -22,7 +22,6 @@ - #define MLXREG_LED_RED_SOLID 0x05 /* Solid red or orange */ - #define MLXREG_LED_GREEN_SOLID_HW 0x09 /* Solid green by hardware */ - #define MLXREG_LED_GREEN_SOLID 0x0D /* Solid green */ --#define MLXREG_LED_AMBER_SOLID 0x09 /* Solid amber */ - #define MLXREG_LED_BLINK_3HZ 167 /* ~167 msec off/on - HW support */ - #define MLXREG_LED_BLINK_6HZ 83 /* ~83 msec off/on - HW support */ - #define MLXREG_LED_CAPABILITY_CLEAR GENMASK(31, 8) /* Clear mask */ -@@ -262,16 +261,11 @@ static int mlxreg_led_config(struct mlxreg_led_priv_data *priv) - - led_cdev = &led_data->led_cdev; - led_data->data_parent = priv; -- if (strstr(data->label, "red")) { -- brightness = LED_OFF; -- led_data->base_color = MLXREG_LED_RED_SOLID; -- } else if (strstr(data->label, "orange")) { -+ if (strstr(data->label, "red") || strstr(data->label, "orange") || -+ strstr(data->label, "amber")) { - brightness = LED_OFF; - led_data->base_color = MLXREG_LED_RED_SOLID; - led_data->base_color_hw = MLXREG_LED_RED_SOLID_HW; -- } else if (strstr(data->label, "amber")) { -- brightness = LED_OFF; -- led_data->base_color = MLXREG_LED_AMBER_SOLID; - } else { - brightness = LED_OFF; - led_data->base_color = MLXREG_LED_GREEN_SOLID; --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0308-platform_data-mlxreg-Add-capability-bit-and-mask-fie.patch b/platform/mellanox/non-upstream-patches/patches/0308-platform_data-mlxreg-Add-capability-bit-and-mask-fie.patch deleted file mode 100644 index dee10dc70a37..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0308-platform_data-mlxreg-Add-capability-bit-and-mask-fie.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 3abc15462d81d65a70734cebbca3f0a4f35a7328 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Thu, 24 Aug 2023 13:20:54 +0000 -Subject: [PATCH] platform_data/mlxreg: Add capability bit and mask fields -X-NVConfidentiality: public - -Some 'capability' registers can be shared between different resources. -Add new fields 'capability_bit' and 'capability_mask' to structs -'mlxreg_core_data' and and 'mlxreg_core_item' for getting only relevant -capability bits. - -Signed-off-by: Vadim Pasternak -Reviewed-by: Felix Radensky ---- - include/linux/platform_data/mlxreg.h | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/include/linux/platform_data/mlxreg.h b/include/linux/platform_data/mlxreg.h -index 0b9f81a6f..d9f679752 100644 ---- a/include/linux/platform_data/mlxreg.h -+++ b/include/linux/platform_data/mlxreg.h -@@ -118,6 +118,8 @@ struct mlxreg_hotplug_device { - * @mask: attribute access mask; - * @bit: attribute effective bit; - * @capability: attribute capability register; -+ * @capability_bit: started bit in attribute capability register; -+ * @capability_mask: mask in attribute capability register; - * @reg_prsnt: attribute presence register; - * @reg_sync: attribute synch register; - * @reg_pwr: attribute power register; -@@ -138,6 +140,8 @@ struct mlxreg_core_data { - u32 mask; - u32 bit; - u32 capability; -+ u32 capability_bit; -+ u32 capability_mask; - u32 reg_prsnt; - u32 reg_sync; - u32 reg_pwr; -@@ -162,6 +166,8 @@ struct mlxreg_core_data { - * @reg: group interrupt status register; - * @mask: group interrupt mask; - * @capability: group capability register; -+ * @capability_bit: started bit in attribute capability register; -+ * @capability_mask: mask in attribute capability register; - * @cache: last status value for elements fro the same group; - * @count: number of available elements in the group; - * @ind: element's index inside the group; -@@ -175,6 +181,8 @@ struct mlxreg_core_item { - u32 reg; - u32 mask; - u32 capability; -+ u32 capability_bit; -+ u32 capability_mask; - u32 cache; - u8 count; - u8 ind; --- -2.14.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0309-hwmon-mlxreg-fan-Add-support-for-new-flavour-of-capa.patch b/platform/mellanox/non-upstream-patches/patches/0309-hwmon-mlxreg-fan-Add-support-for-new-flavour-of-capa.patch deleted file mode 100644 index acf9c1730cda..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0309-hwmon-mlxreg-fan-Add-support-for-new-flavour-of-capa.patch +++ /dev/null @@ -1,101 +0,0 @@ -From 582264258aa3e95f87e33221ff9026899e02d529 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Sun, 23 Jul 2023 06:26:09 +0000 -Subject: [PATCH] hwmon: (mlxreg-fan) Add support for new flavour of capability - register -X-NVConfidentiality: public - -FAN platform data is common across the various systems, while fan -driver should be able to apply only the fan instances relevant -to specific system. - -For example, platform data might contain descriptions for fan1, -fan2, ..., fan{n}, while some systems equipped with all 'n' fans, -others with less. -Also, on some systems fan drawer can be equipped with several -tachometers and on others only with one. - -For detection of the real number of equipped drawers and tachometers -special capability registers are used. -These registers used to indicate presence of drawers and tachometers -through the bitmap. - -For some new big modular systems this register will provide presence -data by counter. - -Use slot parameter to distinct whether capability register contains -bitmask or counter. - -Signed-off-by: Vadim Pasternak ---- - drivers/hwmon/mlxreg-fan.c | 19 ++++++++++++++++--- - 1 file changed, 16 insertions(+), 3 deletions(-) - -diff --git a/drivers/hwmon/mlxreg-fan.c b/drivers/hwmon/mlxreg-fan.c -index acba9d688..c0b42821f 100644 ---- a/drivers/hwmon/mlxreg-fan.c -+++ b/drivers/hwmon/mlxreg-fan.c -@@ -72,12 +72,14 @@ struct mlxreg_fan; - * @reg: register offset; - * @mask: fault mask; - * @prsnt: present register offset; -+ * @shift: tacho presence bit shift; - */ - struct mlxreg_fan_tacho { - bool connected; - u32 reg; - u32 mask; - u32 prsnt; -+ u32 shift; - }; - - /* -@@ -146,8 +148,10 @@ mlxreg_fan_read(struct device *dev, enum hwmon_sensor_types type, u32 attr, - /* - * Map channel to presence bit - drawer can be equipped with - * one or few FANs, while presence is indicated per drawer. -+ * Shift channel value if necessary to align with register value. - */ -- if (BIT(channel / fan->tachos_per_drwr) & regval) { -+ if (BIT(rol32(channel, tacho->shift) / fan->tachos_per_drwr) & -+ regval) { - /* FAN is not connected - return zero for FAN speed. */ - *val = 0; - return 0; -@@ -411,7 +415,7 @@ static int mlxreg_fan_connect_verify(struct mlxreg_fan *fan, - return err; - } - -- return !!(regval & data->bit); -+ return data->slot ? (data->slot <= regval ? 1 : 0) : !!(regval & data->bit); - } - - static int mlxreg_pwm_connect_verify(struct mlxreg_fan *fan, -@@ -486,6 +490,7 @@ static int mlxreg_fan_config(struct mlxreg_fan *fan, - fan->tacho[tacho_num].reg = data->reg; - fan->tacho[tacho_num].mask = data->mask; - fan->tacho[tacho_num].prsnt = data->reg_prsnt; -+ fan->tacho[tacho_num].shift = data->capability_bit; - fan->tacho[tacho_num++].connected = true; - tacho_avail++; - } else if (strnstr(data->label, "pwm", sizeof(data->label))) { -@@ -548,7 +553,15 @@ static int mlxreg_fan_config(struct mlxreg_fan *fan, - return err; - } - -- drwr_avail = hweight32(regval); -+ /* -+ * The number of drawers could be specified in registers by counters for newer -+ * systems, or by bitmasks for older systems. In case the data is provided by -+ * counter, it is indicated through 'version' field. -+ */ -+ if (pdata->version) -+ drwr_avail = regval; -+ else -+ drwr_avail = hweight32(regval); - if (!tacho_avail || !drwr_avail || tacho_avail < drwr_avail) { - dev_err(fan->dev, "Configuration is invalid: drawers num %d tachos num %d\n", - drwr_avail, tacho_avail); --- -2.14.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0310-hwmon-mlxreg-fan-Extend-number-of-supporetd-fans.patch b/platform/mellanox/non-upstream-patches/patches/0310-hwmon-mlxreg-fan-Extend-number-of-supporetd-fans.patch deleted file mode 100644 index b46961465f48..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0310-hwmon-mlxreg-fan-Extend-number-of-supporetd-fans.patch +++ /dev/null @@ -1,47 +0,0 @@ -From bfd3600fe51e7f2fe5f5777936b308c18220b85c Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Sun, 23 Jul 2023 06:49:01 +0000 -Subject: [PATCH] hwmon: (mlxreg-fan) Extend number of supporetd fans -X-NVConfidentiality: public - -Some new big modular systems can be equipped with up to 24 fans. -Extend maximum number of fans accordingly. - -Signed-off-by: Vadim Pasternak ---- - drivers/hwmon/mlxreg-fan.c | 12 +++++++++++- - 1 file changed, 11 insertions(+), 1 deletion(-) - -diff --git a/drivers/hwmon/mlxreg-fan.c b/drivers/hwmon/mlxreg-fan.c -index c0b42821f..298af1d9b 100644 ---- a/drivers/hwmon/mlxreg-fan.c -+++ b/drivers/hwmon/mlxreg-fan.c -@@ -12,7 +12,7 @@ - #include - #include - --#define MLXREG_FAN_MAX_TACHO 14 -+#define MLXREG_FAN_MAX_TACHO 24 - #define MLXREG_FAN_MAX_PWM 4 - #define MLXREG_FAN_PWM_NOT_CONNECTED 0xff - #define MLXREG_FAN_MAX_STATE 10 -@@ -276,6 +276,16 @@ static char *mlxreg_fan_name[] = { - - static const struct hwmon_channel_info *mlxreg_fan_hwmon_info[] = { - HWMON_CHANNEL_INFO(fan, -+ HWMON_F_INPUT | HWMON_F_FAULT, -+ HWMON_F_INPUT | HWMON_F_FAULT, -+ HWMON_F_INPUT | HWMON_F_FAULT, -+ HWMON_F_INPUT | HWMON_F_FAULT, -+ HWMON_F_INPUT | HWMON_F_FAULT, -+ HWMON_F_INPUT | HWMON_F_FAULT, -+ HWMON_F_INPUT | HWMON_F_FAULT, -+ HWMON_F_INPUT | HWMON_F_FAULT, -+ HWMON_F_INPUT | HWMON_F_FAULT, -+ HWMON_F_INPUT | HWMON_F_FAULT, - HWMON_F_INPUT | HWMON_F_FAULT, - HWMON_F_INPUT | HWMON_F_FAULT, - HWMON_F_INPUT | HWMON_F_FAULT, --- -2.14.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0317-platform-mellanox-Introduce-support-for-switches-equ.patch b/platform/mellanox/non-upstream-patches/patches/0317-platform-mellanox-Introduce-support-for-switches-equ.patch deleted file mode 100644 index dec533c3a272..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0317-platform-mellanox-Introduce-support-for-switches-equ.patch +++ /dev/null @@ -1,312 +0,0 @@ -From 6e7badaa478c42acfaef111d799f56ace64783fd Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Mon, 24 Jul 2023 11:10:50 +0000 -Subject: [PATCH backport 5.10.179 25/26] platform: mellanox: Introduce support - for switches equipped with new FPGA device - -Add support for Nvidia MQM97xx and MSN47xx family switches equipped with -new FPGA device. - -These switches are based on previous generation of MQM97xx and MSN47xx -switches, but COMe module uses new FPGA device. - -Platform configuration for new switches is based on the new VMOD0016 -class. Configuration is extended to support new register map with -callbacks supporting indirect addressing for PCIe-to-LPC bridge. -This bridge provides interface between FPGA at COMe board (directly -connected to CPU PCIe root complex) to CPLDs on switch board (which -cannot be connected directly to PCIe root complex). - -Signed-off-by: Vadim Pasternak -Reviewed-by: Michael Shych ---- - drivers/platform/x86/mlx-platform.c | 196 ++++++++++++++++++++++++++++ - 1 file changed, 196 insertions(+) - -diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c -index c4a4afff7..e303b8e5a 100644 ---- a/drivers/platform/x86/mlx-platform.c -+++ b/drivers/platform/x86/mlx-platform.c -@@ -184,6 +184,9 @@ - #define MLXPLAT_CPLD_LPC_REG_CONFIG1_OFFSET 0xfb - #define MLXPLAT_CPLD_LPC_REG_CONFIG2_OFFSET 0xfc - #define MLXPLAT_CPLD_LPC_REG_CONFIG3_OFFSET 0xfd -+#define MLXPLAT_CPLD_LPC_REG_EXT_MIN_OFFSET 0x100 -+#define MLXPLAT_CPLD_LPC_REG_EXT_MID_OFFSET 0x195 -+#define MLXPLAT_CPLD_LPC_REG_EXT_MAX_OFFSET 0x1ff - #define MLXPLAT_CPLD_LPC_IO_RANGE 0x100 - - #define MLXPLAT_CPLD_LPC_PIO_OFFSET 0x10000UL -@@ -278,6 +281,7 @@ - /* Maximum number of possible physical buses equipped on system */ - #define MLXPLAT_CPLD_MAX_PHYS_ADAPTER_NUM 16 - #define MLXPLAT_CPLD_MAX_PHYS_EXT_ADAPTER_NUM 24 -+#define MLXPLAT_CPLD_DEFAULT_MUX_HOTPLUG_VECTOR 0 - - /* Number of channels in group */ - #define MLXPLAT_CPLD_GRP_CHNL_NUM 8 -@@ -339,6 +343,21 @@ - #define PCI_DEVICE_ID_LATTICE_I2C_BRIDGE 0x9c2f - #define PCI_DEVICE_ID_LATTICE_JTAG_BRIDGE 0x9c30 - #define PCI_DEVICE_ID_LATTICE_LPC_BRIDGE 0x9c32 -+#define MLXPLAT_FPGA_PCI_BAR0_SIZE 0x4000 -+#define MLXPLAT_FPGA_PCI_BASE_OFFSET 0x00000000 -+#define MLXPLAT_FPGA_PCI_MSB_ADDR 0x25 -+#define MLXPLAT_FPGA_PCI_MSB_EXT_ADDR 0x20 -+#define MLXPLAT_FPGA_PCI_LSB_ADDR_OFFSET MLXPLAT_FPGA_PCI_BASE_OFFSET -+#define MLXPLAT_FPGA_PCI_MSB_ADDR_OFFSET (MLXPLAT_FPGA_PCI_BASE_OFFSET + 0x01) -+#define MLXPLAT_FPGA_PCI_DATA_OUT_OFFSET (MLXPLAT_FPGA_PCI_BASE_OFFSET + 0x02) -+#define MLXPLAT_FPGA_PCI_DATA_IN_OFFSET (MLXPLAT_FPGA_PCI_BASE_OFFSET + 0x03) -+#define MLXPLAT_FPGA_PCI_CTRL_OFFSET (MLXPLAT_FPGA_PCI_BASE_OFFSET + 0x04) -+#define MLXPLAT_FPGA_PCI_STAT_OFFSET (MLXPLAT_FPGA_PCI_BASE_OFFSET + 0x05) -+ -+#define MLXPLAT_FPGA_PCI_CTRL_READ BIT(0) -+#define MLXPLAT_FPGA_PCI_CTRL_WRITE BIT(1) -+#define MLXPLAT_FPGA_PCI_COMPLETED GENMASK(1, 0) -+#define MLXPLAT_FPGA_PCI_TO 50 /* usec */ - - /* mlxplat_priv - platform private data - * @pdev_i2c - i2c controller platform device -@@ -454,6 +473,28 @@ static struct i2c_mux_reg_platform_data mlxplat_default_mux_data[] = { - - }; - -+/* Default channels vector for regmap mux. */ -+static int mlxplat_default_regmap_mux_chan[] = { 1, 2, 3, 4, 5, 6, 7, 8 }; -+ -+/* Platform regmap mux data */ -+static struct i2c_mux_regmap_platform_data mlxplat_default_regmap_mux_data[] = { -+ { -+ .parent = 1, -+ .chan_ids = mlxplat_default_regmap_mux_chan, -+ .num_adaps = ARRAY_SIZE(mlxplat_default_regmap_mux_chan), -+ .sel_reg_addr = MLXPLAT_CPLD_LPC_REG_I2C_CH1_OFFSET, -+ .reg_size = 1, -+ }, -+ { -+ .parent = 1, -+ .chan_ids = mlxplat_default_regmap_mux_chan, -+ .num_adaps = ARRAY_SIZE(mlxplat_default_regmap_mux_chan), -+ .sel_reg_addr = MLXPLAT_CPLD_LPC_REG_I2C_CH2_OFFSET, -+ .reg_size = 1, -+ }, -+ -+}; -+ - /* Platform mux configuration variables */ - static int mlxplat_max_adap_num; - static int mlxplat_mux_num; -@@ -3769,6 +3810,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { - .mask = GENMASK(7, 0) & ~BIT(2), - .mode = 0444, - }, -+ { -+ .label = "kexec_activated", -+ .reg = MLXPLAT_CPLD_LPC_REG_RESET_GP2_OFFSET, -+ .mask = GENMASK(7, 0) & ~BIT(1), -+ .mode = 0644, -+ }, - { - .label = "erot1_reset", - .reg = MLXPLAT_CPLD_LPC_REG_RESET_GP2_OFFSET, -@@ -5391,6 +5438,7 @@ static bool mlxplat_mlxcpld_writeable_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_REG_PWM3_OFFSET: - case MLXPLAT_CPLD_LPC_REG_PWM4_OFFSET: - case MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_EXT_MIN_OFFSET ... MLXPLAT_CPLD_LPC_REG_EXT_MAX_OFFSET: - return true; - } - return false; -@@ -5556,6 +5604,7 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_REG_CONFIG2_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CONFIG3_OFFSET: - case MLXPLAT_CPLD_LPC_REG_UFM_VERSION_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_EXT_MIN_OFFSET ... MLXPLAT_CPLD_LPC_REG_EXT_MAX_OFFSET: - return true; - } - return false; -@@ -5713,6 +5762,7 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_REG_CONFIG2_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CONFIG3_OFFSET: - case MLXPLAT_CPLD_LPC_REG_UFM_VERSION_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_EXT_MIN_OFFSET ... MLXPLAT_CPLD_LPC_REG_EXT_MAX_OFFSET: - return true; - } - return false; -@@ -5743,6 +5793,14 @@ 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_bf3[] = { -+ { MLXPLAT_CPLD_LPC_REG_GP2_OFFSET, 0xc1 }, -+ { MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET, 0x00 }, -+ { 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_rack_switch[] = { - { MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET, MLXPLAT_REGMAP_NVSWITCH_PWM_DEFAULT }, - { MLXPLAT_CPLD_LPC_REG_WD1_ACT_OFFSET, 0x00 }, -@@ -5871,6 +5929,114 @@ static const struct regmap_config mlxplat_mlxcpld_regmap_config_eth_modular = { - .reg_write = mlxplat_mlxcpld_reg_write, - }; - -+/* Wait completion routine for indirect access for register map */ -+static int mlxplat_fpga_completion_wait(struct mlxplat_mlxcpld_regmap_context *ctx) -+{ -+ unsigned long end; -+ u8 status; -+ -+ end = jiffies + msecs_to_jiffies(MLXPLAT_FPGA_PCI_TO); -+ do { -+ status = ioread8(ctx->base + MLXPLAT_FPGA_PCI_STAT_OFFSET); -+ if (!(status & MLXPLAT_FPGA_PCI_COMPLETED)) -+ return 0; -+ cond_resched(); -+ } while (time_before(jiffies, end)); -+ -+ return -EIO; -+} -+ -+/* Read callback for indirect register map access */ -+static int mlxplat_fpga_reg_read(void *context, unsigned int reg, unsigned int *val) -+{ -+ struct mlxplat_mlxcpld_regmap_context *ctx = context; -+ unsigned int msb_off = MLXPLAT_FPGA_PCI_MSB_ADDR; -+ int err; -+ -+ if (reg >= MLXPLAT_CPLD_LPC_REG_EXT_MIN_OFFSET) { -+ if (reg <= MLXPLAT_CPLD_LPC_REG_EXT_MID_OFFSET) { -+ /* Access to 2-nd FPGA bank */ -+ *val = ioread8(i2c_bridge_addr + reg - -+ MLXPLAT_CPLD_LPC_REG_EXT_MIN_OFFSET); -+ return 0; -+ } -+ /* Access to 3-rd FPGA bank */ -+ reg -= MLXPLAT_CPLD_LPC_REG_EXT_MIN_OFFSET; -+ msb_off = MLXPLAT_FPGA_PCI_MSB_EXT_ADDR; -+ } -+ -+ /* Verify there is no pending transactions */ -+ err = mlxplat_fpga_completion_wait(ctx); -+ if (err) -+ return err; -+ -+ /* Set address in register space */ -+ iowrite8(msb_off, ctx->base + MLXPLAT_FPGA_PCI_MSB_ADDR_OFFSET); -+ iowrite8(reg, ctx->base + MLXPLAT_FPGA_PCI_LSB_ADDR_OFFSET); -+ /* Activate read operation */ -+ iowrite8(MLXPLAT_FPGA_PCI_CTRL_READ, ctx->base + MLXPLAT_FPGA_PCI_CTRL_OFFSET); -+ /* Verify transaction completion */ -+ err = mlxplat_fpga_completion_wait(ctx); -+ if (err) -+ return err; -+ -+ /* Read data */ -+ *val = ioread8(ctx->base + MLXPLAT_FPGA_PCI_DATA_IN_OFFSET); -+ -+ return 0; -+} -+ -+/* Write callback for indirect register map access */ -+static int mlxplat_fpga_reg_write(void *context, unsigned int reg, unsigned int val) -+{ -+ struct mlxplat_mlxcpld_regmap_context *ctx = context; -+ unsigned int msb_off = MLXPLAT_FPGA_PCI_MSB_ADDR; -+ int err; -+ -+ if (reg >= MLXPLAT_CPLD_LPC_REG_EXT_MIN_OFFSET) { -+ if (reg <= MLXPLAT_CPLD_LPC_REG_EXT_MID_OFFSET) { -+ /* Access to 2-nd FPGA bank */ -+ iowrite8(val, i2c_bridge_addr + reg - MLXPLAT_CPLD_LPC_REG_EXT_MIN_OFFSET); -+ /* Flush modification */ -+ wmb(); -+ return 0; -+ } -+ -+ /* Access to 3-rd FPGA bank */ -+ reg -= MLXPLAT_CPLD_LPC_REG_EXT_MIN_OFFSET; -+ msb_off = MLXPLAT_FPGA_PCI_MSB_EXT_ADDR; -+ } -+ -+ /* Verify there is no pending transactions */ -+ err = mlxplat_fpga_completion_wait(ctx); -+ if (err) -+ return err; -+ -+ /* Set address in register space */ -+ iowrite8(msb_off, ctx->base + MLXPLAT_FPGA_PCI_MSB_ADDR_OFFSET); -+ iowrite8(reg, ctx->base + MLXPLAT_FPGA_PCI_LSB_ADDR_OFFSET); -+ /* Set data to be written */ -+ iowrite8(val, ctx->base + MLXPLAT_FPGA_PCI_DATA_OUT_OFFSET); -+ /* Activate write operation */ -+ iowrite8(MLXPLAT_FPGA_PCI_CTRL_WRITE, ctx->base + MLXPLAT_FPGA_PCI_CTRL_OFFSET); -+ -+ return mlxplat_fpga_completion_wait(ctx); -+} -+ -+static const struct regmap_config mlxplat_fpga_regmap_config_bf3_comex_default = { -+ .reg_bits = 9, -+ .val_bits = 8, -+ .max_register = 511, -+ .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_bf3, -+ .num_reg_defaults = ARRAY_SIZE(mlxplat_mlxcpld_regmap_bf3), -+ .reg_read = mlxplat_fpga_reg_read, -+ .reg_write = mlxplat_fpga_reg_write, -+}; -+ - static struct resource mlxplat_mlxcpld_resources[] = { - [0] = DEFINE_RES_IRQ_NAMED(MLXPLAT_CPLD_LPC_SYSIRQ, "mlxreg-hotplug"), - }; -@@ -6282,6 +6448,30 @@ static int __init mlxplat_dmi_l1_switch_matched(const struct dmi_system_id *dmi) - return mlxplat_register_platform_device(); - } - -+static int __init mlxplat_dmi_bf3_comex_default_matched(const struct dmi_system_id *dmi) -+{ -+ int i; -+ -+ mlxplat_max_adap_num = MLXPLAT_CPLD_MAX_PHYS_ADAPTER_NUM; -+ mlxplat_mux_hotplug_num = MLXPLAT_CPLD_DEFAULT_MUX_HOTPLUG_VECTOR; -+ mlxplat_mux_num = ARRAY_SIZE(mlxplat_default_regmap_mux_data); -+ mlxplat_mux_regmap_data = mlxplat_default_regmap_mux_data; -+ mlxplat_hotplug = &mlxplat_mlxcpld_ext_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_fpga_regmap_config_bf3_comex_default; -+ mlxplat_reboot_nb = &mlxplat_reboot_default_nb; -+ pm_power_off = mlxplat_poweroff; -+ -+ return 1; -+} -+ - static const struct dmi_system_id mlxplat_dmi_table[] __initconst = { - { - .callback = mlxplat_dmi_default_wc_matched, -@@ -6377,6 +6567,12 @@ static const struct dmi_system_id mlxplat_dmi_table[] __initconst = { - DMI_MATCH(DMI_BOARD_NAME, "VMOD0015"), - }, - }, -+ { -+ .callback = mlxplat_dmi_bf3_comex_default_matched, -+ .matches = { -+ DMI_MATCH(DMI_BOARD_NAME, "VMOD0016"), -+ }, -+ }, - { - .callback = mlxplat_dmi_l1_switch_matched, - .matches = { --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0318-mellanox-Relocate-mlx-platform-driver.patch b/platform/mellanox/non-upstream-patches/patches/0318-mellanox-Relocate-mlx-platform-driver.patch deleted file mode 100644 index 4f8a1127bad2..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0318-mellanox-Relocate-mlx-platform-driver.patch +++ /dev/null @@ -1,98 +0,0 @@ -From e56aebff93c7c72dab4958e56d518c17057344ff Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Mon, 24 Jul 2023 11:52:56 +0000 -Subject: [PATCH backport 5.10 100/100] mellanox: Relocate mlx-platform driver - -Move 'mlx-platform' driver 'x86' to 'mellanox' folder. - -Motivation to allow running it on systems with ARM architecture. - -Signed-off-by: Vadim Pasternak -Reviewed-by: Michael Shych ---- - drivers/platform/mellanox/Kconfig | 12 ++++++++++++ - drivers/platform/mellanox/Makefile | 1 + - drivers/platform/{x86 => mellanox}/mlx-platform.c | 0 - drivers/platform/x86/Kconfig | 13 ------------- - drivers/platform/x86/Makefile | 1 - - 5 files changed, 13 insertions(+), 14 deletions(-) - rename drivers/platform/{x86 => mellanox}/mlx-platform.c (100%) - -diff --git a/drivers/platform/mellanox/Kconfig b/drivers/platform/mellanox/Kconfig -index d54d36d92..dfa29127e 100644 ---- a/drivers/platform/mellanox/Kconfig -+++ b/drivers/platform/mellanox/Kconfig -@@ -14,6 +14,18 @@ menuconfig MELLANOX_PLATFORM - - if MELLANOX_PLATFORM - -+config MLX_PLATFORM -+ tristate "Mellanox Technologies platform support" -+ depends on I2C && REGMAP -+ help -+ This option enables system support for the Mellanox Technologies -+ platform. The Mellanox systems provide data center networking -+ solutions based on Virtual Protocol Interconnect (VPI) technology -+ enable seamless connectivity to 56/100Gb/s InfiniBand or 10/40/56GbE -+ connection. -+ -+ If you have a Mellanox system, say Y or M here. -+ - config MLXREG_HOTPLUG - tristate "Mellanox platform hotplug driver support" - depends on REGMAP -diff --git a/drivers/platform/mellanox/Makefile b/drivers/platform/mellanox/Makefile -index 51a56ea1b..58ddeab43 100644 ---- a/drivers/platform/mellanox/Makefile -+++ b/drivers/platform/mellanox/Makefile -@@ -3,6 +3,7 @@ - # Makefile for linux/drivers/platform/mellanox - # Mellanox Platform-Specific Drivers - # -+obj-$(CONFIG_MLX_PLATFORM) += mlx-platform.o - obj-$(CONFIG_MLXBF_BOOTCTL) += mlxbf-bootctl.o - obj-$(CONFIG_MLXBF_PMC) += mlxbf-pmc.o - obj-$(CONFIG_MLXBF_TMFIFO) += mlxbf-tmfifo.o -diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/mellanox/mlx-platform.c -similarity index 100% -rename from drivers/platform/x86/mlx-platform.c -rename to drivers/platform/mellanox/mlx-platform.c -diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig -index 84c5b922f..4270d4c17 100644 ---- a/drivers/platform/x86/Kconfig -+++ b/drivers/platform/x86/Kconfig -@@ -1193,19 +1193,6 @@ config I2C_MULTI_INSTANTIATE - To compile this driver as a module, choose M here: the module - will be called i2c-multi-instantiate. - --config MLX_PLATFORM -- tristate "Mellanox Technologies platform support" -- depends on I2C -- select REGMAP -- help -- This option enables system support for the Mellanox Technologies -- platform. The Mellanox systems provide data center networking -- solutions based on Virtual Protocol Interconnect (VPI) technology -- enable seamless connectivity to 56/100Gb/s InfiniBand or 10/40/56GbE -- connection. -- -- If you have a Mellanox system, say Y or M here. -- - config TOUCHSCREEN_DMI - bool "DMI based touchscreen configuration info" - depends on ACPI && DMI && I2C=y && TOUCHSCREEN_SILEAD -diff --git a/drivers/platform/x86/Makefile b/drivers/platform/x86/Makefile -index 5f823f7ef..1db86675f 100644 ---- a/drivers/platform/x86/Makefile -+++ b/drivers/platform/x86/Makefile -@@ -122,7 +122,6 @@ obj-$(CONFIG_TOPSTAR_LAPTOP) += topstar-laptop.o - - # Platform drivers - obj-$(CONFIG_I2C_MULTI_INSTANTIATE) += i2c-multi-instantiate.o --obj-$(CONFIG_MLX_PLATFORM) += mlx-platform.o - obj-$(CONFIG_TOUCHSCREEN_DMI) += touchscreen_dmi.o - - # Intel uncore drivers --- -2.20.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0319-UBUNTU-SAUCE-mlxbf-tmfifo-fix-potential-race.patch b/platform/mellanox/non-upstream-patches/patches/0319-UBUNTU-SAUCE-mlxbf-tmfifo-fix-potential-race.patch deleted file mode 100644 index 868a458630d1..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0319-UBUNTU-SAUCE-mlxbf-tmfifo-fix-potential-race.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 0a853a02d268ae7355e559043e4dea1a1b2be9a5 Mon Sep 17 00:00:00 2001 -From: Liming Sun -Date: Thu, 13 Apr 2023 08:32:24 -0400 -Subject: [PATCH] UBUNTU: SAUCE: mlxbf-tmfifo: fix potential race -X-NVConfidentiality: public - -BugLink: https://bugs.launchpad.net/bugs/2016039 - -The fix adds memory barrier for the 'is_ready' flag and the 'vq' -pointer in mlxbf_tmfifo_virtio_find_vqs() to avoid potential race -due to out-of-order memory write. - -Signed-off-by: Liming Sun -Acked-by: Bartlomiej Zolnierkiewicz -Acked-by: Tim Gardner -[bzolnier: this patch also contains a fix for mlxbf_tmfifo_create_vdev() - failure case] -Signed-off-by: Bartlomiej Zolnierkiewicz ---- - drivers/platform/mellanox/mlxbf-tmfifo.c | 11 +++++++++-- - 1 file changed, 9 insertions(+), 2 deletions(-) - -diff --git a/drivers/platform/mellanox/mlxbf-tmfifo.c b/drivers/platform/mellanox/mlxbf-tmfifo.c -index 97956c9c9d4c..19d539fc99ae 100644 ---- a/drivers/platform/mellanox/mlxbf-tmfifo.c -+++ b/drivers/platform/mellanox/mlxbf-tmfifo.c -@@ -922,7 +922,7 @@ static void mlxbf_tmfifo_rxtx(struct mlxbf_tmfifo_vring *vring, bool is_rx) - fifo = vring->fifo; - - /* Return if vdev is not ready. */ -- if (!fifo->vdev[devid]) -+ if (!fifo || !fifo->vdev[devid]) - return; - - /* Return if another vring is running. */ -@@ -1119,9 +1119,13 @@ static int mlxbf_tmfifo_virtio_find_vqs(struct virtio_device *vdev, - goto error; - } - -+ vq->priv = vring; -+ -+ /* Make vq update visible before using it. */ -+ virtio_mb(false); -+ - vqs[i] = vq; - vring->vq = vq; -- vq->priv = vring; - } - - return 0; -@@ -1426,6 +1430,9 @@ static int mlxbf_tmfifo_probe(struct platform_device *pdev) - - mod_timer(&fifo->timer, jiffies + MLXBF_TMFIFO_TIMER_INTERVAL); - -+ /* Make all updates visible before the 'is_ready' flag. */ -+ virtio_mb(false); -+ - fifo->is_ready = 1; - return 0; - --- -2.14.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0320-UBUNTU-SAUCE-mlxbf-tmfifo-Drop-the-Rx-packet-if-no-m.patch b/platform/mellanox/non-upstream-patches/patches/0320-UBUNTU-SAUCE-mlxbf-tmfifo-Drop-the-Rx-packet-if-no-m.patch deleted file mode 100644 index 591ab5ea6176..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0320-UBUNTU-SAUCE-mlxbf-tmfifo-Drop-the-Rx-packet-if-no-m.patch +++ /dev/null @@ -1,177 +0,0 @@ -From fda66dd5619067846d24d3b30398f7406b10af69 Mon Sep 17 00:00:00 2001 -From: Liming Sun -Date: Sun, 4 Jun 2023 10:28:14 -0400 -Subject: [PATCH] UBUNTU: SAUCE: mlxbf-tmfifo: Drop the Rx packet if no more - descriptors -X-NVConfidentiality: public - -BugLink: https://bugs.launchpad.net/bugs/2021749 - -This commit fixes tmfifo console stuck issue when the virtual -networking interface is in down state. In such case, the network -Rx descriptors runs out which causes the network packet stays -in the tmfifo and couldn't be popped out thus blocking the console -packets. The fix is to drop the receiving packet when no more Rx -descriptors. - -Signed-off-by: Liming Sun -Acked-by: Tim Gardner -Acked-by: Bartlomiej Zolnierkiewicz -Signed-off-by: Bartlomiej Zolnierkiewicz ---- - drivers/platform/mellanox/mlxbf-tmfifo.c | 65 ++++++++++++++++++++++---------- - 1 file changed, 46 insertions(+), 19 deletions(-) - -diff --git a/drivers/platform/mellanox/mlxbf-tmfifo.c b/drivers/platform/mellanox/mlxbf-tmfifo.c -index 19d539fc99ae..88610f45456b 100644 ---- a/drivers/platform/mellanox/mlxbf-tmfifo.c -+++ b/drivers/platform/mellanox/mlxbf-tmfifo.c -@@ -59,6 +59,7 @@ struct mlxbf_tmfifo; - * @vq: pointer to the virtio virtqueue - * @desc: current descriptor of the pending packet - * @desc_head: head descriptor of the pending packet -+ * @drop_desc: dummy desc for packet dropping - * @cur_len: processed length of the current descriptor - * @rem_len: remaining length of the pending packet - * @pkt_len: total length of the pending packet -@@ -75,6 +76,7 @@ struct mlxbf_tmfifo_vring { - struct virtqueue *vq; - struct vring_desc *desc; - struct vring_desc *desc_head; -+ struct vring_desc drop_desc; - int cur_len; - int rem_len; - u32 pkt_len; -@@ -86,6 +88,11 @@ struct mlxbf_tmfifo_vring { - struct mlxbf_tmfifo *fifo; - }; - -+/* Check whether vring is in drop mode. */ -+#define IS_VRING_DROP(_r) ({ \ -+ typeof(_r) (r) = (_r); \ -+ (r->desc_head == &r->drop_desc ? true : false); }) -+ - /* Interrupt types. */ - enum { - MLXBF_TM_RX_LWM_IRQ, -@@ -275,6 +282,7 @@ static int mlxbf_tmfifo_alloc_vrings(struct mlxbf_tmfifo *fifo, - vring->align = SMP_CACHE_BYTES; - vring->index = i; - vring->vdev_id = tm_vdev->vdev.id.device; -+ vring->drop_desc.len = 0xffff; - dev = &tm_vdev->vdev.dev; - - size = vring_size(vring->num, vring->align); -@@ -380,7 +388,7 @@ static u32 mlxbf_tmfifo_get_pkt_len(struct mlxbf_tmfifo_vring *vring, - return len; - } - --static void mlxbf_tmfifo_release_pending_pkt(struct mlxbf_tmfifo_vring *vring) -+static void mlxbf_tmfifo_release_pkt(struct mlxbf_tmfifo_vring *vring) - { - struct vring_desc *desc_head; - u32 len = 0; -@@ -508,8 +516,6 @@ static int mlxbf_tmfifo_get_rx_avail(struct mlxbf_tmfifo *fifo) - return FIELD_GET(MLXBF_TMFIFO_RX_STS__COUNT_MASK, sts); - } - -- -- - /* Get the number of available words in the TmFifo for sending. */ - static int mlxbf_tmfifo_get_tx_avail(struct mlxbf_tmfifo *fifo, int vdev_id) - { -@@ -732,19 +738,25 @@ static void mlxbf_tmfifo_rxtx_word(struct mlxbf_tmfifo_vring *vring, - - if (vring->cur_len + sizeof(u64) <= len) { - /* The whole word. */ -- if (is_rx) -- memcpy(addr + vring->cur_len, &data, sizeof(u64)); -- else -- memcpy(&data, addr + vring->cur_len, sizeof(u64)); -+ if (!IS_VRING_DROP(vring)) { -+ if (is_rx) -+ memcpy(addr + vring->cur_len, &data, -+ sizeof(u64)); -+ else -+ memcpy(&data, addr + vring->cur_len, -+ sizeof(u64)); -+ } - vring->cur_len += sizeof(u64); - } else { - /* Leftover bytes. */ -- if (is_rx) -- memcpy(addr + vring->cur_len, &data, -- len - vring->cur_len); -- else -- memcpy(&data, addr + vring->cur_len, -- len - vring->cur_len); -+ if (!IS_VRING_DROP(vring)) { -+ if (is_rx) -+ memcpy(addr + vring->cur_len, &data, -+ len - vring->cur_len); -+ else -+ memcpy(&data, addr + vring->cur_len, -+ len - vring->cur_len); -+ } - vring->cur_len = len; - } - -@@ -847,8 +859,16 @@ static bool mlxbf_tmfifo_rxtx_one_desc(struct mlxbf_tmfifo_vring *vring, - /* Get the descriptor of the next packet. */ - if (!vring->desc) { - desc = mlxbf_tmfifo_get_next_pkt(vring, is_rx); -- if (!desc) -- return false; -+ if (!desc) { -+ /* Drop next Rx packet to avoid stuck. */ -+ if (is_rx) { -+ desc = &vring->drop_desc; -+ vring->desc_head = desc; -+ vring->desc = desc; -+ } else { -+ return false; -+ } -+ } - } else { - desc = vring->desc; - } -@@ -881,17 +901,24 @@ static bool mlxbf_tmfifo_rxtx_one_desc(struct mlxbf_tmfifo_vring *vring, - vring->rem_len -= len; - - /* Get the next desc on the chain. */ -- if (vring->rem_len > 0 && -+ if (!IS_VRING_DROP(vring) && vring->rem_len > 0 && - (virtio16_to_cpu(vdev, desc->flags) & VRING_DESC_F_NEXT)) { - idx = virtio16_to_cpu(vdev, desc->next); - desc = &vr->desc[idx]; - goto mlxbf_tmfifo_desc_done; - } - -- /* Done and release the pending packet. */ -- mlxbf_tmfifo_release_pending_pkt(vring); -+ /* Done and release the packet. */ - desc = NULL; - fifo->vring[is_rx] = NULL; -+ if (!IS_VRING_DROP(vring)) { -+ mlxbf_tmfifo_release_pkt(vring); -+ } else { -+ vring->pkt_len = 0; -+ vring->desc_head = NULL; -+ vring->desc = NULL; -+ return false; -+ } - - /* - * Make sure the load/store are in order before -@@ -1073,7 +1100,7 @@ static void mlxbf_tmfifo_virtio_del_vqs(struct virtio_device *vdev) - - /* Release the pending packet. */ - if (vring->desc) -- mlxbf_tmfifo_release_pending_pkt(vring); -+ mlxbf_tmfifo_release_pkt(vring); - vq = vring->vq; - if (vq) { - vring->vq = NULL; --- -2.14.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0321-UBUNTU-SAUCE-mlxbf-tmfifo-Drop-jumbo-frames.patch b/platform/mellanox/non-upstream-patches/patches/0321-UBUNTU-SAUCE-mlxbf-tmfifo-Drop-jumbo-frames.patch deleted file mode 100644 index df0e01e79feb..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0321-UBUNTU-SAUCE-mlxbf-tmfifo-Drop-jumbo-frames.patch +++ /dev/null @@ -1,100 +0,0 @@ -From a72d23ea2daedf011b2a3239c7f1dbfe28d36e7d Mon Sep 17 00:00:00 2001 -From: Liming Sun -Date: Sun, 4 Jun 2023 10:28:15 -0400 -Subject: [PATCH] UBUNTU: SAUCE: mlxbf-tmfifo: Drop jumbo frames -X-NVConfidentiality: public - -BugLink: https://bugs.launchpad.net/bugs/2021749 - -This commit drops over-sized network packets to avoid tmfifo -queue stuck. - -Signed-off-by: Liming Sun -Acked-by: Tim Gardner -Acked-by: Bartlomiej Zolnierkiewicz -[bzolnier: removed Change-Id from the commit description] -Signed-off-by: Bartlomiej Zolnierkiewicz ---- - drivers/platform/mellanox/mlxbf-tmfifo.c | 24 +++++++++++++++++------- - 1 file changed, 17 insertions(+), 7 deletions(-) - -diff --git a/drivers/platform/mellanox/mlxbf-tmfifo.c b/drivers/platform/mellanox/mlxbf-tmfifo.c -index 88610f45456b..4f3226007e32 100644 ---- a/drivers/platform/mellanox/mlxbf-tmfifo.c -+++ b/drivers/platform/mellanox/mlxbf-tmfifo.c -@@ -234,7 +234,7 @@ static u8 mlxbf_tmfifo_net_default_mac[ETH_ALEN] = { - static efi_char16_t mlxbf_tmfifo_efi_name[] = L"RshimMacAddr"; - - /* Maximum L2 header length. */ --#define MLXBF_TMFIFO_NET_L2_OVERHEAD 36 -+#define MLXBF_TMFIFO_NET_L2_OVERHEAD (ETH_HLEN + VLAN_HLEN) - - /* Supported virtio-net features. */ - #define MLXBF_TMFIFO_NET_FEATURES \ -@@ -773,13 +773,14 @@ static void mlxbf_tmfifo_rxtx_word(struct mlxbf_tmfifo_vring *vring, - * flag is set. - */ - static void mlxbf_tmfifo_rxtx_header(struct mlxbf_tmfifo_vring *vring, -- struct vring_desc *desc, -+ struct vring_desc **desc, - bool is_rx, bool *vring_change) - { - struct mlxbf_tmfifo *fifo = vring->fifo; - struct virtio_net_config *config; - struct mlxbf_tmfifo_msg_hdr hdr; - int vdev_id, hdr_len; -+ bool drop_rx = false; - - /* Read/Write packet header. */ - if (is_rx) { -@@ -801,8 +802,8 @@ static void mlxbf_tmfifo_rxtx_header(struct mlxbf_tmfifo_vring *vring, - if (ntohs(hdr.len) > - __virtio16_to_cpu(virtio_legacy_is_little_endian(), - config->mtu) + -- MLXBF_TMFIFO_NET_L2_OVERHEAD) -- return; -+ MLXBF_TMFIFO_NET_L2_OVERHEAD) -+ drop_rx = true; - } else { - vdev_id = VIRTIO_ID_CONSOLE; - hdr_len = 0; -@@ -817,16 +818,25 @@ static void mlxbf_tmfifo_rxtx_header(struct mlxbf_tmfifo_vring *vring, - - if (!tm_dev2) - return; -- vring->desc = desc; -+ vring->desc = *desc; - vring = &tm_dev2->vrings[MLXBF_TMFIFO_VRING_RX]; - *vring_change = true; - } -+ -+ if (drop_rx && !IS_VRING_DROP(vring)) { -+ if (vring->desc_head) -+ mlxbf_tmfifo_release_pkt(vring); -+ *desc = &vring->drop_desc; -+ vring->desc_head = *desc; -+ vring->desc = *desc; -+ } -+ - vring->pkt_len = ntohs(hdr.len) + hdr_len; - } else { - /* Network virtio has an extra header. */ - hdr_len = (vring->vdev_id == VIRTIO_ID_NET) ? - sizeof(struct virtio_net_hdr) : 0; -- vring->pkt_len = mlxbf_tmfifo_get_pkt_len(vring, desc); -+ vring->pkt_len = mlxbf_tmfifo_get_pkt_len(vring, *desc); - hdr.type = (vring->vdev_id == VIRTIO_ID_NET) ? - VIRTIO_ID_NET : VIRTIO_ID_CONSOLE; - hdr.len = htons(vring->pkt_len - hdr_len); -@@ -875,7 +885,7 @@ static bool mlxbf_tmfifo_rxtx_one_desc(struct mlxbf_tmfifo_vring *vring, - - /* Beginning of a packet. Start to Rx/Tx packet header. */ - if (vring->pkt_len == 0) { -- mlxbf_tmfifo_rxtx_header(vring, desc, is_rx, &vring_change); -+ mlxbf_tmfifo_rxtx_header(vring, &desc, is_rx, &vring_change); - (*avail)--; - - /* Return if new packet is for another ring. */ --- -2.14.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0322-UBUNTU-SAUCE-mlxbf-tmfifo.c-Amend-previous-tmfifo-pa.patch b/platform/mellanox/non-upstream-patches/patches/0322-UBUNTU-SAUCE-mlxbf-tmfifo.c-Amend-previous-tmfifo-pa.patch deleted file mode 100644 index 1e26f7f8d5d4..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0322-UBUNTU-SAUCE-mlxbf-tmfifo.c-Amend-previous-tmfifo-pa.patch +++ /dev/null @@ -1,37 +0,0 @@ -From b23bb194dc1dbad104f2afce1a8ed202d182b73b Mon Sep 17 00:00:00 2001 -From: Shih-Yi Chen -Date: Thu, 20 Jul 2023 16:39:40 -0400 -Subject: [PATCH] UBUNTU: SAUCE: mlxbf-tmfifo.c: Amend previous tmfifo patch w/ - regard to schedule_work -X-NVConfidentiality: public - -BugLink: https://bugs.launchpad.net/bugs/2028197 - -Fix rshim console output got cutoff due to tmfifo driver not processing all virtio console notifications. - -Signed-off-by: Shih-Yi Chen -Reviewed-by: Liming Sun -Acked-by: Bartlomiej Zolnierkiewicz -Acked-by: Tim Gardner -[bzolnier: use a short URL version for BugLink] -Signed-off-by: Bartlomiej Zolnierkiewicz ---- - drivers/platform/mellanox/mlxbf-tmfifo.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/drivers/platform/mellanox/mlxbf-tmfifo.c b/drivers/platform/mellanox/mlxbf-tmfifo.c -index 4f3226007e32..36b87d5d8baf 100644 ---- a/drivers/platform/mellanox/mlxbf-tmfifo.c -+++ b/drivers/platform/mellanox/mlxbf-tmfifo.c -@@ -1065,6 +1065,8 @@ static bool mlxbf_tmfifo_virtio_notify(struct virtqueue *vq) - tm_vdev = fifo->vdev[VIRTIO_ID_CONSOLE]; - mlxbf_tmfifo_console_output(tm_vdev, vring); - spin_unlock_irqrestore(&fifo->spin_lock[0], flags); -+ test_and_set_bit(MLXBF_TM_TX_LWM_IRQ, -+ &fifo->pend_events); - } else if (test_and_set_bit(MLXBF_TM_TX_LWM_IRQ, - &fifo->pend_events)) { - return true; --- -2.14.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0323-mlxbf_gige-add-set_link_ksettings-ethtool-callback.patch b/platform/mellanox/non-upstream-patches/patches/0323-mlxbf_gige-add-set_link_ksettings-ethtool-callback.patch deleted file mode 100644 index 5198d6e54f4a..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0323-mlxbf_gige-add-set_link_ksettings-ethtool-callback.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 29ebd6bb4afdf9f4aad3019c0ca9892b69dbff40 Mon Sep 17 00:00:00 2001 -From: David Thompson -Date: Thu, 12 Jan 2023 15:26:08 -0500 -Subject: [PATCH] mlxbf_gige: add "set_link_ksettings" ethtool callback -X-NVConfidentiality: public - -BugLink: https://bugs.launchpad.net/bugs/2012649 - -This patch extends the "ethtool_ops" data structure to -include the "set_link_ksettings" callback. This change -enables configuration of the various interface speeds -that the BlueField-3 supports (10Mbps, 100Mbps, and 1Gbps). - -Signed-off-by: David Thompson -Signed-off-by: Asmaa Mnebhi -Reviewed-by: Andrew Lunn -Signed-off-by: Jakub Kicinski -(cherry picked from commit cedd97737a1f302b3d0493d7054a35e0c5997b99) -Signed-off-by: David Thompson -Acked-by: Tim Gardner -Acked-by: Bartlomiej Zolnierkiewicz -Signed-off-by: Bartlomiej Zolnierkiewicz ---- - drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_ethtool.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_ethtool.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_ethtool.c -index 257724323..602537f62 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_ethtool.c -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_ethtool.c -@@ -170,4 +170,5 @@ const struct ethtool_ops mlxbf_gige_ethtool_ops = { - .nway_reset = phy_ethtool_nway_reset, - .get_pauseparam = mlxbf_gige_get_pauseparam, - .get_link_ksettings = phy_ethtool_get_link_ksettings, -+ .set_link_ksettings = phy_ethtool_set_link_ksettings, - }; --- -2.14.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0324-mlxbf_gige-fix-white-space-in-mlxbf_gige_eth_ioctl.patch b/platform/mellanox/non-upstream-patches/patches/0324-mlxbf_gige-fix-white-space-in-mlxbf_gige_eth_ioctl.patch deleted file mode 100644 index b24dc636a5fd..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0324-mlxbf_gige-fix-white-space-in-mlxbf_gige_eth_ioctl.patch +++ /dev/null @@ -1,41 +0,0 @@ -From dc7c16946141474dad808f7bef9c00a547ed0db6 Mon Sep 17 00:00:00 2001 -From: David Thompson -Date: Thu, 12 Jan 2023 15:26:09 -0500 -Subject: [PATCH] mlxbf_gige: fix white space in mlxbf_gige_eth_ioctl -X-NVConfidentiality: public - -BugLink: https://bugs.launchpad.net/bugs/2012649 - -This patch fixes the white space issue raised by checkpatch: -CHECK: Alignment should match open parenthesis -+static int mlxbf_gige_eth_ioctl(struct net_device *netdev, -+ struct ifreq *ifr, int cmd) - -Signed-off-by: David Thompson -Signed-off-by: Asmaa Mnebhi -Signed-off-by: Jakub Kicinski -(cherry picked from commit e1cc8ce46200b3f3026e546053458c6f8046ef27) -Signed-off-by: David Thompson -Acked-by: Tim Gardner -Acked-by: Bartlomiej Zolnierkiewicz -Signed-off-by: Bartlomiej Zolnierkiewicz ---- - drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -index 867248e3c..602260f2b 100644 ---- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c -@@ -205,7 +205,7 @@ static int mlxbf_gige_stop(struct net_device *netdev) - } - - static int mlxbf_gige_do_ioctl(struct net_device *netdev, -- struct ifreq *ifr, int cmd) -+ struct ifreq *ifr, int cmd) - { - if (!(netif_running(netdev))) - return -EINVAL; --- -2.14.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0325-UBUNTU-SAUCE-mlxbf-bootctl-Fix-kernel-panic-due-to-b.patch b/platform/mellanox/non-upstream-patches/patches/0325-UBUNTU-SAUCE-mlxbf-bootctl-Fix-kernel-panic-due-to-b.patch deleted file mode 100644 index f867f38cf679..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0325-UBUNTU-SAUCE-mlxbf-bootctl-Fix-kernel-panic-due-to-b.patch +++ /dev/null @@ -1,57 +0,0 @@ -From aaad0c7201b7f3908e30c529fb5ab83dc9851c83 Mon Sep 17 00:00:00 2001 -From: Asmaa Mnebhi -Date: Thu, 20 Jul 2023 16:37:37 -0400 -Subject: [PATCH] UBUNTU: SAUCE: mlxbf-bootctl: Fix kernel panic due to buffer - overflow -X-NVConfidentiality: public - -BugLink: https://bugs.launchpad.net/bugs/2028309 - -Running the following LTP (linux-test-project) script, causes -a kernel panic and a reboot of the DPU: -ltp/testcases/bin/read_all -d /sys -q -r 10 - -The above test reads all directory and files under /sys. -Reading the sysfs entry "large_icm" causes the kernel panic -due to a garbage value returned via i2c read. That garbage -value causes a buffer overflow in sprintf. - -Replace sprintf with snprintf. And also add missing lock and -increase the buffer size to PAGE_SIZE. - -Signed-off-by: Asmaa Mnebhi -Acked-by: Bartlomiej Zolnierkiewicz -Acked-by: Tim Gardner -Signed-off-by: Bartlomiej Zolnierkiewicz ---- - drivers/platform/mellanox/mlxbf-bootctl.c | 7 +++---- - 1 file changed, 3 insertions(+), 4 deletions(-) - -diff --git a/drivers/platform/mellanox/mlxbf-bootctl.c b/drivers/platform/mellanox/mlxbf-bootctl.c -index a68bf5b27013..52666ee360b2 100644 ---- a/drivers/platform/mellanox/mlxbf-bootctl.c -+++ b/drivers/platform/mellanox/mlxbf-bootctl.c -@@ -387,17 +387,16 @@ static ssize_t oob_mac_store(struct device_driver *drv, const char *buf, - - static ssize_t large_icm_show(struct device_driver *drv, char *buf) - { -- char icm_str[MAX_ICM_BUFFER_SIZE] = { 0 }; - struct arm_smccc_res res; - -+ mutex_lock(&icm_ops_lock); - arm_smccc_smc(MLNX_HANDLE_GET_ICM_INFO, 0, 0, 0, 0, - 0, 0, 0, &res); -+ mutex_unlock(&icm_ops_lock); - if (res.a0) - return -EPERM; - -- sprintf(icm_str, "0x%lx", res.a1); -- -- return snprintf(buf, sizeof(icm_str), "%s", icm_str); -+ return snprintf(buf, PAGE_SIZE, "0x%lx", res.a1); - } - - static ssize_t large_icm_store(struct device_driver *drv, const char *buf, --- -2.14.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0326-platform-mellanox-mlxreg-hotplug-Add-support-for-new.patch b/platform/mellanox/non-upstream-patches/patches/0326-platform-mellanox-mlxreg-hotplug-Add-support-for-new.patch deleted file mode 100644 index 3905bd494ddd..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0326-platform-mellanox-mlxreg-hotplug-Add-support-for-new.patch +++ /dev/null @@ -1,88 +0,0 @@ -From b9d89fb53b5361df87974a223cb4b423a647bc2f Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Thu, 24 Aug 2023 11:47:54 +0000 -Subject: [PATCH] platform/mellanox: mlxreg-hotplug: Add support for new flavor - of capability registers -X-NVConfidentiality: public - -Hotplug platform data is common across the various systems, while -hotplug driver should be able to configure only the instances relevant -to specific system. - -For example, platform hoptplug data might contain descriptions for fan1, -fan2, ..., fan{n}, while some systems equipped with all 'n' fans, -others with less. -Same for power units, power controllers, ASICs and so on. - -For detection of the real number of equipped devices capability -registers are used. -These registers used to indicate presence of hotplug devices through -the bitmap. - -For some new big modular systems, these registers will provide presence -by counters. - -Use slot parameter to determine whether capability register contains -bitmask or counter. - -Some 'capability' registers can be shared between different resources. -Use fields 'capability_bit' and 'capability_mask' for getting only -relevant capability bits. - -Signed-off-by: Vadim Pasternak -Reviewed-by: Felix Radensky ---- - drivers/platform/mellanox/mlxreg-hotplug.c | 23 +++++++++++++++++++++-- - 1 file changed, 21 insertions(+), 2 deletions(-) - -diff --git a/drivers/platform/mellanox/mlxreg-hotplug.c b/drivers/platform/mellanox/mlxreg-hotplug.c -index c5abedd35..3737af0d3 100644 ---- a/drivers/platform/mellanox/mlxreg-hotplug.c -+++ b/drivers/platform/mellanox/mlxreg-hotplug.c -@@ -275,6 +275,13 @@ static int mlxreg_hotplug_attr_init(struct mlxreg_hotplug_priv_data *priv) - if (ret) - return ret; - -+ if (!regval) -+ continue; -+ -+ /* Remove non-relevant bits. */ -+ if (item->capability_mask) -+ regval = rol32(regval & item->capability_mask, -+ item->capability_bit); - item->mask = GENMASK((regval & item->mask) - 1, 0); - } - -@@ -295,7 +302,19 @@ static int mlxreg_hotplug_attr_init(struct mlxreg_hotplug_priv_data *priv) - if (ret) - return ret; - -- if (!(regval & data->bit)) { -+ /* -+ * In case slot field is provided, capability -+ * register contains counter, otherwise bitmask. -+ * Skip non-relevant entries if slot set and -+ * exceeds counter. Othewise validate entry by -+ * matching bitmask. -+ */ -+ if (data->capability_mask) -+ regval = rol32(regval & data->capability_mask, -+ data->capability_bit); -+ if (data->slot > regval) { -+ break; -+ } else if (!(regval & data->bit) && !data->slot) { - data++; - continue; - } -@@ -626,7 +645,7 @@ static int mlxreg_hotplug_set_irq(struct mlxreg_hotplug_priv_data *priv) - if (ret) - goto out; - -- if (!(regval & data->bit)) -+ if (!(regval & data->bit) && !data->slot) - item->mask &= ~BIT(j); - } - } --- -2.14.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0327-platform-mellanox-mlx-platform-Change-register-name.patch b/platform/mellanox/non-upstream-patches/patches/0327-platform-mellanox-mlx-platform-Change-register-name.patch deleted file mode 100644 index 7953c4149461..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0327-platform-mellanox-mlx-platform-Change-register-name.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 45cc492edbf7dc36e20a166355840a5cce0841c9 Mon Sep 17 00:00:00 2001 -From: Felix Radensky -Date: Thu, 21 Sep 2023 05:53:11 +0000 -Subject: [PATCH] platform: mellanox: mlx-platform: Change register name -X-NVConfidentiality: public - -Register 0xd9 was repurposed on new systems. Change its name -to correctly reflect the new functionality. - -Signed-off-by: Felix Radensky -Reviewed-by: Vadim Pasternak ---- - drivers/platform/mellanox/mlx-platform.c | 7 +++---- - 1 file changed, 3 insertions(+), 4 deletions(-) - -diff --git a/drivers/platform/mellanox/mlx-platform.c b/drivers/platform/mellanox/mlx-platform.c -index 20211d28c..4efd06eaf 100644 ---- a/drivers/platform/mellanox/mlx-platform.c -+++ b/drivers/platform/mellanox/mlx-platform.c -@@ -147,7 +147,7 @@ - #define MLXPLAT_CPLD_LPC_REG_WD3_TMR_OFFSET 0xd1 - #define MLXPLAT_CPLD_LPC_REG_WD3_TLEFT_OFFSET 0xd2 - #define MLXPLAT_CPLD_LPC_REG_WD3_ACT_OFFSET 0xd3 --#define MLXPLAT_CPLD_LPC_REG_DBG_CTRL_OFFSET 0xd9 -+#define MLXPLAT_CPLD_LPC_REG_CPLD6_MVER_OFFSET 0xd9 - #define MLXPLAT_CPLD_LPC_REG_I2C_CH1_OFFSET 0xdb - #define MLXPLAT_CPLD_LPC_REG_I2C_CH2_OFFSET 0xda - #define MLXPLAT_CPLD_LPC_REG_I2C_CH3_OFFSET 0xdc -@@ -5428,7 +5428,6 @@ static bool mlxplat_mlxcpld_writeable_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_REG_WD3_TMR_OFFSET: - case MLXPLAT_CPLD_LPC_REG_WD3_TLEFT_OFFSET: - case MLXPLAT_CPLD_LPC_REG_WD3_ACT_OFFSET: -- case MLXPLAT_CPLD_LPC_REG_DBG_CTRL_OFFSET: - case MLXPLAT_CPLD_LPC_REG_I2C_CH1_OFFSET: - case MLXPLAT_CPLD_LPC_REG_I2C_CH2_OFFSET: - case MLXPLAT_CPLD_LPC_REG_I2C_CH3_OFFSET: -@@ -5565,7 +5564,7 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_REG_WD3_TMR_OFFSET: - case MLXPLAT_CPLD_LPC_REG_WD3_TLEFT_OFFSET: - case MLXPLAT_CPLD_LPC_REG_WD3_ACT_OFFSET: -- case MLXPLAT_CPLD_LPC_REG_DBG_CTRL_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_CPLD6_MVER_OFFSET: - case MLXPLAT_CPLD_LPC_REG_I2C_CH1_OFFSET: - case MLXPLAT_CPLD_LPC_REG_I2C_CH2_OFFSET: - case MLXPLAT_CPLD_LPC_REG_I2C_CH3_OFFSET: -@@ -5723,7 +5722,7 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_REG_WD2_TLEFT_OFFSET: - case MLXPLAT_CPLD_LPC_REG_WD3_TMR_OFFSET: - case MLXPLAT_CPLD_LPC_REG_WD3_TLEFT_OFFSET: -- case MLXPLAT_CPLD_LPC_REG_DBG_CTRL_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_CPLD6_MVER_OFFSET: - case MLXPLAT_CPLD_LPC_REG_I2C_CH1_OFFSET: - case MLXPLAT_CPLD_LPC_REG_I2C_CH2_OFFSET: - case MLXPLAT_CPLD_LPC_REG_I2C_CH3_OFFSET: --- -2.14.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/0328-platform-mellanox-mlx-platform-Add-support-for-new-X.patch b/platform/mellanox/non-upstream-patches/patches/0328-platform-mellanox-mlx-platform-Add-support-for-new-X.patch deleted file mode 100644 index ad38b1555460..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/0328-platform-mellanox-mlx-platform-Add-support-for-new-X.patch +++ /dev/null @@ -1,1383 +0,0 @@ -From e1431c088b27f877747f9a74e07c8b158db7ec66 Mon Sep 17 00:00:00 2001 -From: Felix Radensky -Date: Mon, 4 Sep 2023 18:28:37 +0000 -Subject: [PATCH 1/4] From f25ad1918eb613aa315805717603a0960f42e6df Mon Sep 17 - 00:00:00 2001 Subject: [PATCH] platform: mellanox: mlx-platform: Add support - for new XDR systems X-NVConfidentiality: public -X-NVConfidentiality: public - -Add support for QM3400 and QM3000, Nvidia XDR switches. - -QM3400 is a 57.6Tbps switch based on Nvidia Quantum-3 ASIC. -It provides up-to 800Gbps full bidirectional bandwidth per port. -The system supports 36 OSFP cages and fits into standard 2U racks. - -QM3400 Features: - - 36 OSFP ports supporting 2.5Gbps - 800Gbps speeds. - - Air-cooled with 4 + 1 redundant fan units. - - 2 + 2 redundant 2000W PSUs. - - System management board based on Intel Coffee Lake CPU - with secure-boot support. - -QM3000 is a 115.2Tbps switch based on Nvidia Quantum-3 ASIC. -It provides up-to 800Gbps full bidirectional bandwidth per port. -The system supports 72 OSFP cages and fits into standard 4U racks. - -QM3000 Features: - - 72 OSFP ports or 144 aggregated XDR ports supporting 800Gbps speeds. - - Air-cooled with 9 + 1 redundant fan units. - - 4 + 4 redundant 2000W PSUs. - - System management board based on Intel Coffee Lake CPU - with secure-boot support. - -Signed-off-by: Felix Radensky -Reviewed-by: Vadim Pasternak ---- - drivers/platform/mellanox/mlx-platform.c | 1057 +++++++++++++++++++++++++++++- - 1 file changed, 1037 insertions(+), 20 deletions(-) - -diff --git a/drivers/platform/mellanox/mlx-platform.c b/drivers/platform/mellanox/mlx-platform.c -index 20211d28c..66b1f32f5 100644 ---- a/drivers/platform/mellanox/mlx-platform.c -+++ b/drivers/platform/mellanox/mlx-platform.c -@@ -51,6 +51,7 @@ - #define MLXPLAT_CPLD_LPC_REG_LED5_OFFSET 0x24 - #define MLXPLAT_CPLD_LPC_REG_LED6_OFFSET 0x25 - #define MLXPLAT_CPLD_LPC_REG_LED7_OFFSET 0x26 -+#define MLXPLAT_CPLD_LPC_REG_LED8_OFFSET 0x27 - #define MLXPLAT_CPLD_LPC_REG_FAN_DIRECTION 0x2a - #define MLXPLAT_CPLD_LPC_REG_GP0_RO_OFFSET 0x2b - #define MLXPLAT_CPLD_LPC_REG_GPCOM0_OFFSET 0x2d -@@ -96,9 +97,21 @@ - #define MLXPLAT_CPLD_LPC_REG_LC_IN_OFFSET 0x70 - #define MLXPLAT_CPLD_LPC_REG_LC_IN_EVENT_OFFSET 0x71 - #define MLXPLAT_CPLD_LPC_REG_LC_IN_MASK_OFFSET 0x72 -+#define MLXPLAT_CPLD_LPC_REG_CPLD6_VER_OFFSET 0x7c -+#define MLXPLAT_CPLD_LPC_REG_CPLD6_PN_OFFSET 0x7d -+#define MLXPLAT_CPLD_LPC_REG_CPLD6_PN1_OFFSET 0x7e -+#define MLXPLAT_CPLD_LPC_REG_ASIC3_HEALTH_OFFSET 0x82 -+#define MLXPLAT_CPLD_LPC_REG_ASIC3_EVENT_OFFSET 0x83 -+#define MLXPLAT_CPLD_LPC_REG_ASIC3_MASK_OFFSET 0x84 -+#define MLXPLAT_CPLD_LPC_REG_ASIC4_HEALTH_OFFSET 0x85 -+#define MLXPLAT_CPLD_LPC_REG_ASIC4_EVENT_OFFSET 0x86 -+#define MLXPLAT_CPLD_LPC_REG_ASIC4_MASK_OFFSET 0x87 - #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_FAN2_OFFSET 0x8b -+#define MLXPLAT_CPLD_LPC_REG_FAN2_EVENT_OFFSET 0x8c -+#define MLXPLAT_CPLD_LPC_REG_FAN2_MASK_OFFSET 0x8d - #define MLXPLAT_CPLD_LPC_REG_CPLD5_VER_OFFSET 0x8e - #define MLXPLAT_CPLD_LPC_REG_CPLD5_PN_OFFSET 0x8f - #define MLXPLAT_CPLD_LPC_REG_CPLD5_PN1_OFFSET 0x90 -@@ -130,10 +143,15 @@ - #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_TACHO19_OFFSET 0xb4 -+#define MLXPLAT_CPLD_LPC_REG_TACHO20_OFFSET 0xb5 - #define MLXPLAT_CPLD_LPC_REG_DBG1_OFFSET 0xb6 - #define MLXPLAT_CPLD_LPC_REG_DBG2_OFFSET 0xb7 - #define MLXPLAT_CPLD_LPC_REG_DBG3_OFFSET 0xb8 - #define MLXPLAT_CPLD_LPC_REG_DBG4_OFFSET 0xb9 -+#define MLXPLAT_CPLD_LPC_REG_TACHO17_OFFSET 0xba -+#define MLXPLAT_CPLD_LPC_REG_TACHO18_OFFSET 0xbb -+#define MLXPLAT_CPLD_LPC_REG_ASIC_CAP_OFFSET 0xc1 - #define MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET 0xc2 - #define MLXPLAT_CPLD_LPC_REG_SPI_CHNL_SELECT 0xc3 - #define MLXPLAT_CPLD_LPC_REG_CPLD5_MVER_OFFSET 0xc4 -@@ -184,6 +202,8 @@ - #define MLXPLAT_CPLD_LPC_REG_CONFIG1_OFFSET 0xfb - #define MLXPLAT_CPLD_LPC_REG_CONFIG2_OFFSET 0xfc - #define MLXPLAT_CPLD_LPC_REG_CONFIG3_OFFSET 0xfd -+#define MLXPLAT_CPLD_LPC_REG_TACHO15_OFFSET 0xfe -+#define MLXPLAT_CPLD_LPC_REG_TACHO16_OFFSET 0xff - #define MLXPLAT_CPLD_LPC_REG_EXT_MIN_OFFSET 0x100 - #define MLXPLAT_CPLD_LPC_REG_EXT_MID_OFFSET 0x195 - #define MLXPLAT_CPLD_LPC_REG_EXT_MAX_OFFSET 0x1ff -@@ -236,20 +256,30 @@ - #define MLXPLAT_CPLD_LOW_AGGR_MASK_ASIC2 BIT(2) - #define MLXPLAT_CPLD_LOW_AGGR_MASK_PWR_BUT GENMASK(5, 4) - #define MLXPLAT_CPLD_LOW_AGGR_MASK_I2C BIT(6) -+#define MLXPLAT_CPLD_LOW_AGGR_MASK_MULTI_ASICS GENMASK(3, 0) -+#define MLXPLAT_CPLD_LOW_AGGR_MASK_FRU BIT(7) - #define MLXPLAT_CPLD_PSU_MASK GENMASK(1, 0) - #define MLXPLAT_CPLD_PWR_MASK GENMASK(1, 0) - #define MLXPLAT_CPLD_PSU_EXT_MASK GENMASK(3, 0) - #define MLXPLAT_CPLD_PWR_EXT_MASK GENMASK(3, 0) -+#define MLXPLAT_CPLD_PSU_XDR_MASK GENMASK(7, 0) -+#define MLXPLAT_CPLD_PWR_XDR_MASK GENMASK(7, 0) - #define MLXPLAT_CPLD_FAN_MASK GENMASK(3, 0) - #define MLXPLAT_CPLD_ASIC_MASK GENMASK(1, 0) -+#define MLXPLAT_CPLD_ASIC_XDR_MASK GENMASK(3, 0) - #define MLXPLAT_CPLD_FAN_NG_MASK GENMASK(6, 0) - #define MLXPLAT_CPLD_FAN_QMB8700_MASK GENMASK(5, 0) -+#define MLXPLAT_CPLD_FAN_XDR_MASK GENMASK(7, 0) -+#define MLXPLAT_CPLD_FAN_XDR_EXT_MASK GENMASK(1, 0) - #define MLXPLAT_CPLD_LED_LO_NIBBLE_MASK GENMASK(7, 4) - #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_FU_CAP_MASK GENMASK(1, 0) -+#define MLXPLAT_CPLD_PSU_CAP_MASK GENMASK(3, 0) -+#define MLXPLAT_CPLD_FAN_CAP_MASK GENMASK(7, 0) -+#define MLXPLAT_CPLD_ASIC_CAP_MASK GENMASK(7, 0) - #define MLXPLAT_CPLD_PWR_BUTTON_MASK BIT(0) - #define MLXPLAT_CPLD_LATCH_RST_MASK BIT(6) - #define MLXPLAT_CPLD_THERMAL1_PDB_MASK BIT(3) -@@ -295,6 +325,7 @@ - #define MLXPLAT_CPLD_CH4_ETH_MODULAR 51 - #define MLXPLAT_CPLD_CH2_RACK_SWITCH 18 - #define MLXPLAT_CPLD_CH2_NG800 34 -+#define MLXPLAT_CPLD_CH2_XDR 66 - - /* Number of LPC attached MUX platform devices */ - #define MLXPLAT_CPLD_LPC_MUX_DEVS 4 -@@ -303,6 +334,7 @@ - #define MLXPLAT_CPLD_NR_NONE -1 - #define MLXPLAT_CPLD_PSU_DEFAULT_NR 10 - #define MLXPLAT_CPLD_PSU_MSNXXXX_NR 4 -+#define MLXPLAT_CPLD_PSU_XDR_NR 3 - #define MLXPLAT_CPLD_FAN1_DEFAULT_NR 11 - #define MLXPLAT_CPLD_FAN2_DEFAULT_NR 12 - #define MLXPLAT_CPLD_FAN3_DEFAULT_NR 13 -@@ -645,6 +677,38 @@ static struct i2c_mux_reg_platform_data mlxplat_ng800_mux_data[] = { - - }; - -+/* Platform channels for XDR system family */ -+static const int mlxplat_xdr_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, -+ 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, -+ 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64 -+}; -+ -+/* Platform XDR mux data */ -+static struct i2c_mux_reg_platform_data mlxplat_xdr_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_xdr_channels, -+ .n_values = ARRAY_SIZE(mlxplat_xdr_channels), -+ }, -+ { -+ .parent = 1, -+ .base_nr = MLXPLAT_CPLD_CH2_XDR, -+ .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[] = { - { -@@ -664,6 +728,21 @@ static struct i2c_board_info mlxplat_mlxcpld_ext_pwr[] = { - }, - }; - -+static struct i2c_board_info mlxplat_mlxcpld_xdr_pwr[] = { -+ { -+ I2C_BOARD_INFO("dps460", 0x5d), -+ }, -+ { -+ I2C_BOARD_INFO("dps460", 0x5c), -+ }, -+ { -+ I2C_BOARD_INFO("dps460", 0x5e), -+ }, -+ { -+ I2C_BOARD_INFO("dps460", 0x5f), -+ }, -+}; -+ - static struct i2c_board_info mlxplat_mlxcpld_pwr_ng800[] = { - { - I2C_BOARD_INFO("dps460", 0x59), -@@ -1533,6 +1612,430 @@ static struct mlxreg_core_item mlxplat_mlxcpld_ng800_items[] = { - }, - }; - -+/* Platform hotplug XDR system family data */ -+static struct mlxreg_core_data mlxplat_mlxcpld_xdr_psu_items_data[] = { -+ { -+ .label = "psu1", -+ .reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET, -+ .mask = BIT(0), -+ .slot = 1, -+ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, -+ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, -+ }, -+ { -+ .label = "psu2", -+ .reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET, -+ .mask = BIT(1), -+ .slot = 2, -+ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, -+ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, -+ }, -+ { -+ .label = "psu3", -+ .reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET, -+ .mask = BIT(2), -+ .slot = 3, -+ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, -+ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, -+ }, -+ { -+ .label = "psu4", -+ .reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET, -+ .mask = BIT(3), -+ .slot = 4, -+ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, -+ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, -+ }, -+ { -+ .label = "psu5", -+ .reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET, -+ .mask = BIT(4), -+ .slot = 5, -+ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, -+ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, -+ }, -+ { -+ .label = "psu6", -+ .reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET, -+ .mask = BIT(5), -+ .slot = 6, -+ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, -+ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, -+ }, -+ { -+ .label = "psu7", -+ .reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET, -+ .mask = BIT(6), -+ .slot = 7, -+ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, -+ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, -+ }, -+ { -+ .label = "psu8", -+ .reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET, -+ .mask = BIT(7), -+ .slot = 8, -+ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, -+ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, -+ }, -+}; -+ -+static struct mlxreg_core_data mlxplat_mlxcpld_xdr_pwr_items_data[] = { -+ { -+ .label = "pwr1", -+ .reg = MLXPLAT_CPLD_LPC_REG_PWR_OFFSET, -+ .mask = BIT(0), -+ .slot = 1, -+ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, -+ .hpdev.brdinfo = &mlxplat_mlxcpld_pwr[0], -+ .hpdev.nr = MLXPLAT_CPLD_PSU_MSNXXXX_NR, -+ }, -+ { -+ .label = "pwr2", -+ .reg = MLXPLAT_CPLD_LPC_REG_PWR_OFFSET, -+ .mask = BIT(1), -+ .slot = 2, -+ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, -+ .hpdev.brdinfo = &mlxplat_mlxcpld_pwr[1], -+ .hpdev.nr = MLXPLAT_CPLD_PSU_MSNXXXX_NR, -+ }, -+ { -+ .label = "pwr3", -+ .reg = MLXPLAT_CPLD_LPC_REG_PWR_OFFSET, -+ .mask = BIT(2), -+ .slot = 3, -+ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, -+ .hpdev.brdinfo = &mlxplat_mlxcpld_ext_pwr[0], -+ .hpdev.nr = MLXPLAT_CPLD_PSU_MSNXXXX_NR, -+ }, -+ { -+ .label = "pwr4", -+ .reg = MLXPLAT_CPLD_LPC_REG_PWR_OFFSET, -+ .mask = BIT(3), -+ .slot = 4, -+ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, -+ .hpdev.brdinfo = &mlxplat_mlxcpld_ext_pwr[1], -+ .hpdev.nr = MLXPLAT_CPLD_PSU_MSNXXXX_NR, -+ }, -+ { -+ .label = "pwr5", -+ .reg = MLXPLAT_CPLD_LPC_REG_PWR_OFFSET, -+ .mask = BIT(4), -+ .slot = 5, -+ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, -+ .hpdev.brdinfo = &mlxplat_mlxcpld_xdr_pwr[0], -+ .hpdev.nr = MLXPLAT_CPLD_PSU_XDR_NR, -+ }, -+ { -+ .label = "pwr6", -+ .reg = MLXPLAT_CPLD_LPC_REG_PWR_OFFSET, -+ .mask = BIT(5), -+ .slot = 6, -+ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, -+ .hpdev.brdinfo = &mlxplat_mlxcpld_xdr_pwr[1], -+ .hpdev.nr = MLXPLAT_CPLD_PSU_XDR_NR, -+ }, -+ { -+ .label = "pwr7", -+ .reg = MLXPLAT_CPLD_LPC_REG_PWR_OFFSET, -+ .mask = BIT(6), -+ .slot = 7, -+ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, -+ .hpdev.brdinfo = &mlxplat_mlxcpld_xdr_pwr[2], -+ .hpdev.nr = MLXPLAT_CPLD_PSU_XDR_NR, -+ }, -+ { -+ .label = "pwr8", -+ .reg = MLXPLAT_CPLD_LPC_REG_PWR_OFFSET, -+ .mask = BIT(7), -+ .slot = 8, -+ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, -+ .hpdev.brdinfo = &mlxplat_mlxcpld_xdr_pwr[3], -+ .hpdev.nr = MLXPLAT_CPLD_PSU_XDR_NR, -+ }, -+}; -+ -+static struct mlxreg_core_data mlxplat_mlxcpld_xdr_fan_items_data[] = { -+ { -+ .label = "fan1", -+ .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, -+ .mask = BIT(0), -+ .slot = 1, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_FAN_XDR_MASK, -+ .bit = BIT(0), -+ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, -+ }, -+ { -+ .label = "fan2", -+ .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, -+ .mask = BIT(1), -+ .slot = 2, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_FAN_XDR_MASK, -+ .bit = BIT(1), -+ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, -+ }, -+ { -+ .label = "fan3", -+ .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, -+ .mask = BIT(2), -+ .slot = 3, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_FAN_XDR_MASK, -+ .bit = BIT(2), -+ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, -+ }, -+ { -+ .label = "fan4", -+ .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, -+ .mask = BIT(3), -+ .slot = 4, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_FAN_XDR_MASK, -+ .bit = BIT(3), -+ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, -+ }, -+ { -+ .label = "fan5", -+ .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, -+ .mask = BIT(4), -+ .slot = 5, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_FAN_XDR_MASK, -+ .bit = BIT(4), -+ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, -+ }, -+ { -+ .label = "fan6", -+ .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, -+ .mask = BIT(5), -+ .slot = 6, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_FAN_XDR_MASK, -+ .bit = BIT(5), -+ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, -+ }, -+ { -+ .label = "fan7", -+ .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, -+ .mask = BIT(6), -+ .slot = 7, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_FAN_XDR_MASK, -+ .bit = BIT(6), -+ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, -+ }, -+ { -+ .label = "fan8", -+ .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, -+ .mask = BIT(7), -+ .slot = 8, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_FAN_XDR_MASK, -+ .bit = BIT(7), -+ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, -+ }, -+}; -+ -+static struct mlxreg_core_data mlxplat_mlxcpld_xdr_ext_fan_items_data[] = { -+ { -+ .label = "fan9", -+ .reg = MLXPLAT_CPLD_LPC_REG_FAN2_OFFSET, -+ .mask = BIT(0), -+ .slot = 9, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_FAN_XDR_MASK, -+ .bit = BIT(0), -+ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, -+ }, -+ { -+ .label = "fan10", -+ .reg = MLXPLAT_CPLD_LPC_REG_FAN2_OFFSET, -+ .mask = BIT(1), -+ .slot = 10, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_FAN_XDR_MASK, -+ .bit = BIT(1), -+ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, -+ }, -+ { -+ .label = "fan11", -+ .reg = MLXPLAT_CPLD_LPC_REG_FAN2_OFFSET, -+ .mask = BIT(2), -+ .slot = 11, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_FAN_XDR_MASK, -+ .bit = BIT(2), -+ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, -+ }, -+ { -+ .label = "fan12", -+ .reg = MLXPLAT_CPLD_LPC_REG_FAN2_OFFSET, -+ .mask = BIT(3), -+ .slot = 12, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_FAN_XDR_MASK, -+ .bit = BIT(3), -+ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, -+ }, -+}; -+ -+static struct mlxreg_core_data mlxplat_mlxcpld_xdr_asic1_items_data[] = { -+ { -+ .label = "asic1", -+ .reg = MLXPLAT_CPLD_LPC_REG_ASIC_HEALTH_OFFSET, -+ .mask = MLXPLAT_CPLD_ASIC_MASK, -+ .slot = 1, -+ .capability = MLXPLAT_CPLD_LPC_REG_ASIC_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_ASIC_XDR_MASK, -+ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, -+ } -+}; -+ -+static struct mlxreg_core_data mlxplat_mlxcpld_xdr_asic2_items_data[] = { -+ { -+ .label = "asic2", -+ .reg = MLXPLAT_CPLD_LPC_REG_ASIC2_HEALTH_OFFSET, -+ .mask = MLXPLAT_CPLD_ASIC_MASK, -+ .slot = 2, -+ .capability = MLXPLAT_CPLD_LPC_REG_ASIC_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_ASIC_CAP_MASK, -+ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, -+ } -+}; -+ -+static struct mlxreg_core_data mlxplat_mlxcpld_xdr_asic3_items_data[] = { -+ { -+ .label = "asic3", -+ .reg = MLXPLAT_CPLD_LPC_REG_ASIC3_HEALTH_OFFSET, -+ .mask = MLXPLAT_CPLD_ASIC_MASK, -+ .slot = 3, -+ .capability = MLXPLAT_CPLD_LPC_REG_ASIC_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_ASIC_CAP_MASK, -+ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, -+ } -+}; -+ -+static struct mlxreg_core_data mlxplat_mlxcpld_xdr_asic4_items_data[] = { -+ { -+ .label = "asic4", -+ .reg = MLXPLAT_CPLD_LPC_REG_ASIC4_HEALTH_OFFSET, -+ .mask = MLXPLAT_CPLD_ASIC_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_ASIC_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_ASIC_CAP_MASK, -+ .slot = 4, -+ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, -+ } -+}; -+ -+static struct mlxreg_core_item mlxplat_mlxcpld_xdr_items[] = { -+ { -+ .data = mlxplat_mlxcpld_xdr_psu_items_data, -+ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, -+ .reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET, -+ .mask = MLXPLAT_CPLD_PSU_XDR_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, -+ .count = ARRAY_SIZE(mlxplat_mlxcpld_xdr_psu_items_data), -+ .inversed = 1, -+ .health = false, -+ }, -+ { -+ .data = mlxplat_mlxcpld_xdr_pwr_items_data, -+ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, -+ .reg = MLXPLAT_CPLD_LPC_REG_PWR_OFFSET, -+ .mask = MLXPLAT_CPLD_PWR_XDR_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_PSU_CAP_MASK, -+ .count = ARRAY_SIZE(mlxplat_mlxcpld_xdr_pwr_items_data), -+ .inversed = 0, -+ .health = false, -+ }, -+ { -+ .data = mlxplat_mlxcpld_xdr_fan_items_data, -+ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, -+ .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, -+ .mask = MLXPLAT_CPLD_FAN_XDR_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_FAN_CAP_MASK, -+ .count = ARRAY_SIZE(mlxplat_mlxcpld_xdr_fan_items_data), -+ .inversed = 1, -+ .health = false, -+ }, -+ { -+ .data = mlxplat_mlxcpld_xdr_ext_fan_items_data, -+ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, -+ .reg = MLXPLAT_CPLD_LPC_REG_FAN2_OFFSET, -+ .mask = MLXPLAT_CPLD_FAN_XDR_EXT_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_FAN_CAP_MASK, -+ .count = ARRAY_SIZE(mlxplat_mlxcpld_xdr_ext_fan_items_data), -+ .inversed = 1, -+ .health = false, -+ }, -+ { -+ .data = mlxplat_mlxcpld_xdr_asic1_items_data, -+ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, -+ .reg = MLXPLAT_CPLD_LPC_REG_ASIC_HEALTH_OFFSET, -+ .mask = MLXPLAT_CPLD_ASIC_XDR_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_ASIC_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_ASIC_CAP_MASK, -+ .count = ARRAY_SIZE(mlxplat_mlxcpld_xdr_asic1_items_data), -+ .inversed = 0, -+ .health = true, -+ }, -+ { -+ .data = mlxplat_mlxcpld_xdr_asic2_items_data, -+ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, -+ .reg = MLXPLAT_CPLD_LPC_REG_ASIC2_HEALTH_OFFSET, -+ .mask = MLXPLAT_CPLD_ASIC_XDR_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_ASIC_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_ASIC_CAP_MASK, -+ .count = ARRAY_SIZE(mlxplat_mlxcpld_xdr_asic2_items_data), -+ .inversed = 0, -+ .health = true, -+ }, -+ { -+ .data = mlxplat_mlxcpld_xdr_asic3_items_data, -+ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, -+ .reg = MLXPLAT_CPLD_LPC_REG_ASIC3_HEALTH_OFFSET, -+ .mask = MLXPLAT_CPLD_ASIC_XDR_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_ASIC_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_ASIC_XDR_MASK, -+ .count = ARRAY_SIZE(mlxplat_mlxcpld_xdr_asic3_items_data), -+ .inversed = 0, -+ .health = true, -+ }, -+ { -+ .data = mlxplat_mlxcpld_xdr_asic4_items_data, -+ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, -+ .reg = MLXPLAT_CPLD_LPC_REG_ASIC4_HEALTH_OFFSET, -+ .mask = MLXPLAT_CPLD_ASIC_XDR_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_ASIC_CAP_OFFSET, -+ .capability_mask = MLXPLAT_CPLD_ASIC_XDR_MASK, -+ .count = ARRAY_SIZE(mlxplat_mlxcpld_xdr_asic4_items_data), -+ .inversed = 0, -+ .health = true, -+ }, -+}; -+ - static - struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_ext_data = { - .items = mlxplat_mlxcpld_ext_items, -@@ -1553,6 +2056,16 @@ struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_ng800_data = { - .mask_low = MLXPLAT_CPLD_LOW_AGGR_MASK_LOW | MLXPLAT_CPLD_LOW_AGGR_MASK_ASIC2, - }; - -+static -+struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_xdr_data = { -+ .items = mlxplat_mlxcpld_xdr_items, -+ .counter = ARRAY_SIZE(mlxplat_mlxcpld_xdr_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_FRU | MLXPLAT_CPLD_LOW_AGGR_MASK_MULTI_ASICS, -+}; -+ - static struct mlxreg_core_data mlxplat_mlxcpld_modular_pwr_items_data[] = { - { - .label = "pwr1", -@@ -3395,35 +3908,209 @@ static struct mlxreg_core_data mlxplat_mlxcpld_l1_switch_led_data[] = { - .reg = MLXPLAT_CPLD_LPC_REG_LED3_OFFSET, - .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, - .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -- .bit = BIT(3), -+ .bit = BIT(3), -+ }, -+ { -+ .label = "fan5:green", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED4_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .bit = BIT(4), -+ }, -+ { -+ .label = "fan5:orange", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED4_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .bit = BIT(4), -+ }, -+ { -+ .label = "fan6:green", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED4_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .bit = BIT(5), -+ }, -+ { -+ .label = "fan6:orange", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED4_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .bit = BIT(5), -+ }, -+ { -+ .label = "uid:blue", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED5_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, -+ }, -+}; -+ -+static struct mlxreg_core_platform_data mlxplat_l1_switch_led_data = { -+ .data = mlxplat_mlxcpld_l1_switch_led_data, -+ .counter = ARRAY_SIZE(mlxplat_mlxcpld_l1_switch_led_data), -+}; -+ -+/* Platform led data for XDR systems */ -+static struct mlxreg_core_data mlxplat_mlxcpld_xdr_led_data[] = { -+ { -+ .label = "status:green", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED1_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, -+ }, -+ { -+ .label = "status:amber", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED1_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK -+ }, -+ { -+ .label = "psu:green", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED1_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, -+ }, -+ { -+ .label = "psu:amber", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED1_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, -+ }, -+ { -+ .label = "fan1:green", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED2_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .slot = 1, -+ }, -+ { -+ .label = "fan1:amber", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED2_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .slot = 1, -+ }, -+ { -+ .label = "fan2:green", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED2_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .slot = 2, -+ }, -+ { -+ .label = "fan2:amber", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED2_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .slot = 2, -+ }, -+ { -+ .label = "fan3:green", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED3_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .slot = 3, -+ }, -+ { -+ .label = "fan3:amber", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED3_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .slot = 3, -+ }, -+ { -+ .label = "fan4:green", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED3_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .slot = 4, -+ }, -+ { -+ .label = "fan4:amber", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED3_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .slot = 4, -+ }, -+ { -+ .label = "fan5:green", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED4_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .slot = 5, -+ }, -+ { -+ .label = "fan5:amber", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED4_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .slot = 5, -+ }, -+ { -+ .label = "fan6:green", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED4_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .slot = 6, -+ }, -+ { -+ .label = "fan6:amber", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED4_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .slot = 6, -+ }, -+ { -+ .label = "fan7:green", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED6_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .slot = 7, -+ }, -+ { -+ .label = "fan7:amber", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED6_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .slot = 7, - }, - { -- .label = "fan5:green", -- .reg = MLXPLAT_CPLD_LPC_REG_LED4_OFFSET, -+ .label = "fan8:green", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED7_OFFSET, - .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, - .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -- .bit = BIT(4), -+ .slot = 8, - }, - { -- .label = "fan5:orange", -- .reg = MLXPLAT_CPLD_LPC_REG_LED4_OFFSET, -+ .label = "fan8:amber", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED7_OFFSET, - .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, - .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -- .bit = BIT(4), -+ .slot = 8, - }, - { -- .label = "fan6:green", -- .reg = MLXPLAT_CPLD_LPC_REG_LED4_OFFSET, -+ .label = "fan9:green", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED7_OFFSET, - .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, - .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -- .bit = BIT(5), -+ .slot = 9, - }, - { -- .label = "fan6:orange", -- .reg = MLXPLAT_CPLD_LPC_REG_LED4_OFFSET, -+ .label = "fan9:amber", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED7_OFFSET, - .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, - .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -- .bit = BIT(5), -+ .slot = 9, -+ }, -+ { -+ .label = "fan10:green", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED8_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .slot = 10, -+ }, -+ { -+ .label = "fan10:amber", -+ .reg = MLXPLAT_CPLD_LPC_REG_LED8_OFFSET, -+ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .slot = 10, - }, - { - .label = "uid:blue", -@@ -3432,9 +4119,9 @@ static struct mlxreg_core_data mlxplat_mlxcpld_l1_switch_led_data[] = { - }, - }; - --static struct mlxreg_core_platform_data mlxplat_l1_switch_led_data = { -- .data = mlxplat_mlxcpld_l1_switch_led_data, -- .counter = ARRAY_SIZE(mlxplat_mlxcpld_l1_switch_led_data), -+static struct mlxreg_core_platform_data mlxplat_xdr_led_data = { -+ .data = mlxplat_mlxcpld_xdr_led_data, -+ .counter = ARRAY_SIZE(mlxplat_mlxcpld_xdr_led_data), - }; - - /* Platform register access default */ -@@ -3733,6 +4420,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { - .bit = GENMASK(7, 0), - .mode = 0444, - }, -+ { -+ .label = "cpld6_version", -+ .reg = MLXPLAT_CPLD_LPC_REG_CPLD6_VER_OFFSET, -+ .bit = GENMASK(7, 0), -+ .mode = 0444, -+ }, - { - .label = "cpld1_pn", - .reg = MLXPLAT_CPLD_LPC_REG_CPLD1_PN_OFFSET, -@@ -3768,6 +4461,13 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { - .mode = 0444, - .regnum = 2, - }, -+ { -+ .label = "cpld6_pn", -+ .reg = MLXPLAT_CPLD_LPC_REG_CPLD6_PN_OFFSET, -+ .bit = GENMASK(15, 0), -+ .mode = 0444, -+ .regnum = 2, -+ }, - { - .label = "cpld1_version_min", - .reg = MLXPLAT_CPLD_LPC_REG_CPLD1_MVER_OFFSET, -@@ -3798,6 +4498,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { - .bit = GENMASK(7, 0), - .mode = 0444, - }, -+ { -+ .label = "cpld6_version_min", -+ .reg = MLXPLAT_CPLD_LPC_REG_CPLD6_MVER_OFFSET, -+ .bit = GENMASK(7, 0), -+ .mode = 0444, -+ }, - { - .label = "asic_reset", - .reg = MLXPLAT_CPLD_LPC_REG_RESET_GP2_OFFSET, -@@ -3984,6 +4690,43 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { - .mask = GENMASK(7, 0) & ~BIT(1), - .mode = 0200, - }, -+ { -+ .label = "psu3_on", -+ .reg = MLXPLAT_CPLD_LPC_REG_GP1_OFFSET, -+ .mask = GENMASK(7, 0) & ~BIT(4), -+ .mode = 0200, -+ }, -+ { -+ .label = "psu4_on", -+ .reg = MLXPLAT_CPLD_LPC_REG_GP1_OFFSET, -+ .mask = GENMASK(7, 0) & ~BIT(7), -+ .mode = 0200, -+ }, -+ { -+ .label = "psu5_on", -+ .reg = MLXPLAT_CPLD_LPC_REG_WP1_OFFSET, -+ .mask = GENMASK(7, 0) & ~BIT(0), -+ .mode = 0200, -+ }, -+ -+ { -+ .label = "psu6_on", -+ .reg = MLXPLAT_CPLD_LPC_REG_WP1_OFFSET, -+ .mask = GENMASK(7, 0) & ~BIT(1), -+ .mode = 0200, -+ }, -+ { -+ .label = "psu7_on", -+ .reg = MLXPLAT_CPLD_LPC_REG_WP1_OFFSET, -+ .mask = GENMASK(7, 0) & ~BIT(2), -+ .mode = 0200, -+ }, -+ { -+ .label = "psu8_on", -+ .reg = MLXPLAT_CPLD_LPC_REG_WP1_OFFSET, -+ .mask = GENMASK(7, 0) & ~BIT(3), -+ .mode = 0200, -+ }, - { - .label = "pwr_cycle", - .reg = MLXPLAT_CPLD_LPC_REG_GP1_OFFSET, -@@ -4059,6 +4802,20 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { - .bit = 1, - .mode = 0444, - }, -+ { -+ .label = "asic3_health", -+ .reg = MLXPLAT_CPLD_LPC_REG_ASIC3_HEALTH_OFFSET, -+ .mask = MLXPLAT_CPLD_ASIC_MASK, -+ .bit = 1, -+ .mode = 0444, -+ }, -+ { -+ .label = "asic4_health", -+ .reg = MLXPLAT_CPLD_LPC_REG_ASIC4_HEALTH_OFFSET, -+ .mask = MLXPLAT_CPLD_ASIC_MASK, -+ .bit = 1, -+ .mode = 0444, -+ }, - { - .label = "fan_dir", - .reg = MLXPLAT_CPLD_LPC_REG_FAN_DIRECTION, -@@ -5129,6 +5886,193 @@ static struct mlxreg_core_platform_data mlxplat_qmb8700_fan_data = { - .counter = ARRAY_SIZE(mlxplat_mlxcpld_qmb8700_fan_data), - }; - -+/* XDR platform fan data */ -+static struct mlxreg_core_data mlxplat_mlxcpld_xdr_fan_data[] = { -+ { -+ .label = "pwm1", -+ .reg = MLXPLAT_CPLD_LPC_REG_PWM1_OFFSET, -+ }, -+ { -+ .label = "pwm2", -+ .reg = MLXPLAT_CPLD_LPC_REG_PWM2_OFFSET, -+ }, -+ { -+ .label = "pwm3", -+ .reg = MLXPLAT_CPLD_LPC_REG_PWM3_OFFSET, -+ }, -+ { -+ .label = "pwm4", -+ .reg = MLXPLAT_CPLD_LPC_REG_PWM4_OFFSET, -+ }, -+ { -+ .label = "tacho1", -+ .reg = MLXPLAT_CPLD_LPC_REG_TACHO1_OFFSET, -+ .mask = GENMASK(7, 0), -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, -+ .slot = 1, -+ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, -+ }, -+ { -+ .label = "tacho2", -+ .reg = MLXPLAT_CPLD_LPC_REG_TACHO2_OFFSET, -+ .mask = GENMASK(7, 0), -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, -+ .slot = 2, -+ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, -+ }, -+ { -+ .label = "tacho3", -+ .reg = MLXPLAT_CPLD_LPC_REG_TACHO3_OFFSET, -+ .mask = GENMASK(7, 0), -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, -+ .slot = 3, -+ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, -+ }, -+ { -+ .label = "tacho4", -+ .reg = MLXPLAT_CPLD_LPC_REG_TACHO4_OFFSET, -+ .mask = GENMASK(7, 0), -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, -+ .slot = 4, -+ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, -+ }, -+ { -+ .label = "tacho5", -+ .reg = MLXPLAT_CPLD_LPC_REG_TACHO5_OFFSET, -+ .mask = GENMASK(7, 0), -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, -+ .slot = 5, -+ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, -+ }, -+ { -+ .label = "tacho6", -+ .reg = MLXPLAT_CPLD_LPC_REG_TACHO6_OFFSET, -+ .mask = GENMASK(7, 0), -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, -+ .slot = 6, -+ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, -+ }, -+ { -+ .label = "tacho7", -+ .reg = MLXPLAT_CPLD_LPC_REG_TACHO7_OFFSET, -+ .mask = GENMASK(7, 0), -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, -+ .slot = 7, -+ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, -+ }, -+ { -+ .label = "tacho8", -+ .reg = MLXPLAT_CPLD_LPC_REG_TACHO8_OFFSET, -+ .mask = GENMASK(7, 0), -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, -+ .slot = 8, -+ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, -+ }, -+ { -+ .label = "tacho9", -+ .reg = MLXPLAT_CPLD_LPC_REG_TACHO9_OFFSET, -+ .mask = GENMASK(7, 0), -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, -+ .slot = 9, -+ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, -+ }, -+ { -+ .label = "tacho10", -+ .reg = MLXPLAT_CPLD_LPC_REG_TACHO10_OFFSET, -+ .mask = GENMASK(7, 0), -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, -+ .slot = 10, -+ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, -+ }, -+ { -+ .label = "tacho11", -+ .reg = MLXPLAT_CPLD_LPC_REG_TACHO11_OFFSET, -+ .mask = GENMASK(7, 0), -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, -+ .slot = 11, -+ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, -+ }, -+ { -+ .label = "tacho12", -+ .reg = MLXPLAT_CPLD_LPC_REG_TACHO12_OFFSET, -+ .mask = GENMASK(7, 0), -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, -+ .slot = 12, -+ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, -+ }, -+ { -+ .label = "tacho13", -+ .reg = MLXPLAT_CPLD_LPC_REG_TACHO13_OFFSET, -+ .mask = GENMASK(7, 0), -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, -+ .slot = 13, -+ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, -+ }, -+ { -+ .label = "tacho14", -+ .reg = MLXPLAT_CPLD_LPC_REG_TACHO14_OFFSET, -+ .mask = GENMASK(7, 0), -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, -+ .slot = 14, -+ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, -+ }, -+ { -+ .label = "tacho15", -+ .reg = MLXPLAT_CPLD_LPC_REG_TACHO15_OFFSET, -+ .mask = GENMASK(7, 0), -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, -+ .slot = 15, -+ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, -+ }, -+ { -+ .label = "tacho16", -+ .reg = MLXPLAT_CPLD_LPC_REG_TACHO16_OFFSET, -+ .mask = GENMASK(7, 0), -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, -+ .slot = 16, -+ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, -+ }, -+ { -+ .label = "tacho17", -+ .reg = MLXPLAT_CPLD_LPC_REG_TACHO17_OFFSET, -+ .mask = GENMASK(7, 0), -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, -+ .slot = 17, -+ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN2_OFFSET, -+ }, -+ { -+ .label = "tacho18", -+ .reg = MLXPLAT_CPLD_LPC_REG_TACHO18_OFFSET, -+ .mask = GENMASK(7, 0), -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, -+ .slot = 18, -+ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN2_OFFSET, -+ }, -+ { -+ .label = "tacho19", -+ .reg = MLXPLAT_CPLD_LPC_REG_TACHO19_OFFSET, -+ .mask = GENMASK(7, 0), -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, -+ .slot = 19, -+ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN2_OFFSET, -+ }, -+ { -+ .label = "tacho20", -+ .reg = MLXPLAT_CPLD_LPC_REG_TACHO20_OFFSET, -+ .mask = GENMASK(7, 0), -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, -+ .slot = 20, -+ .reg_prsnt = MLXPLAT_CPLD_LPC_REG_FAN2_OFFSET, -+ }, -+}; -+ -+static struct mlxreg_core_platform_data mlxplat_xdr_fan_data = { -+ .data = mlxplat_mlxcpld_xdr_fan_data, -+ .counter = ARRAY_SIZE(mlxplat_mlxcpld_xdr_fan_data), -+ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, -+ .version = 1, -+}; -+ - /* Watchdog type1: hardware implementation version1 - * (MSN2700, MSN2410, MSN2740, MSN2100 and MSN2140 systems). - */ -@@ -5361,6 +6305,7 @@ static bool mlxplat_mlxcpld_writeable_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_REG_LED5_OFFSET: - case MLXPLAT_CPLD_LPC_REG_LED6_OFFSET: - case MLXPLAT_CPLD_LPC_REG_LED7_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_LED8_OFFSET: - case MLXPLAT_CPLD_LPC_REG_GP0_OFFSET: - case MLXPLAT_CPLD_LPC_REG_GP_RST_OFFSET: - case MLXPLAT_CPLD_LPC_REG_GP1_OFFSET: -@@ -5388,12 +6333,18 @@ static bool mlxplat_mlxcpld_writeable_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_REG_ASIC_MASK_OFFSET: - case MLXPLAT_CPLD_LPC_REG_ASIC2_EVENT_OFFSET: - case MLXPLAT_CPLD_LPC_REG_ASIC2_MASK_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_ASIC3_EVENT_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_ASIC3_MASK_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_ASIC4_EVENT_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_ASIC4_MASK_OFFSET: - case MLXPLAT_CPLD_LPC_REG_PSU_EVENT_OFFSET: - case MLXPLAT_CPLD_LPC_REG_PSU_MASK_OFFSET: - case MLXPLAT_CPLD_LPC_REG_PWR_EVENT_OFFSET: - 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_FAN2_EVENT_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_FAN2_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: -@@ -5452,6 +6402,7 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_REG_CPLD3_VER_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD4_VER_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD5_VER_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_CPLD6_VER_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD1_PN_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD1_PN1_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD2_PN_OFFSET: -@@ -5462,6 +6413,8 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_REG_CPLD4_PN1_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD5_PN_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD5_PN1_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_CPLD6_PN_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_CPLD6_PN1_OFFSET: - case MLXPLAT_CPLD_LPC_REG_RESET_GP1_OFFSET: - case MLXPLAT_CPLD_LPC_REG_RESET_GP4_OFFSET: - case MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET: -@@ -5474,6 +6427,7 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_REG_LED5_OFFSET: - case MLXPLAT_CPLD_LPC_REG_LED6_OFFSET: - case MLXPLAT_CPLD_LPC_REG_LED7_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_LED8_OFFSET: - case MLXPLAT_CPLD_LPC_REG_FAN_DIRECTION: - case MLXPLAT_CPLD_LPC_REG_GP0_RO_OFFSET: - case MLXPLAT_CPLD_LPC_REG_GPCOM0_OFFSET: -@@ -5511,6 +6465,12 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_REG_ASIC2_HEALTH_OFFSET: - case MLXPLAT_CPLD_LPC_REG_ASIC2_EVENT_OFFSET: - case MLXPLAT_CPLD_LPC_REG_ASIC2_MASK_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_ASIC3_HEALTH_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_ASIC3_EVENT_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_ASIC3_MASK_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_ASIC4_HEALTH_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_ASIC4_EVENT_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_ASIC4_MASK_OFFSET: - case MLXPLAT_CPLD_LPC_REG_PSU_OFFSET: - case MLXPLAT_CPLD_LPC_REG_PSU_EVENT_OFFSET: - case MLXPLAT_CPLD_LPC_REG_PSU_MASK_OFFSET: -@@ -5520,6 +6480,9 @@ 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_FAN2_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_FAN2_EVENT_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_FAN2_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: -@@ -5593,6 +6556,13 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_REG_TACHO12_OFFSET: - case MLXPLAT_CPLD_LPC_REG_TACHO13_OFFSET: - case MLXPLAT_CPLD_LPC_REG_TACHO14_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_TACHO15_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_TACHO16_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_TACHO17_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_TACHO18_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_TACHO19_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_TACHO20_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_ASIC_CAP_OFFSET: - case MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET: - case MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET: - case MLXPLAT_CPLD_LPC_REG_FAN_CAP2_OFFSET: -@@ -5618,6 +6588,7 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_REG_CPLD3_VER_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD4_VER_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD5_VER_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_CPLD6_VER_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD1_PN_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD1_PN1_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD2_PN_OFFSET: -@@ -5628,6 +6599,8 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_REG_CPLD4_PN1_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD5_PN_OFFSET: - case MLXPLAT_CPLD_LPC_REG_CPLD5_PN1_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_CPLD6_PN_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_CPLD6_PN1_OFFSET: - case MLXPLAT_CPLD_LPC_REG_RESET_GP1_OFFSET: - case MLXPLAT_CPLD_LPC_REG_RESET_GP4_OFFSET: - case MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET: -@@ -5640,6 +6613,7 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_REG_LED5_OFFSET: - case MLXPLAT_CPLD_LPC_REG_LED6_OFFSET: - case MLXPLAT_CPLD_LPC_REG_LED7_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_LED8_OFFSET: - case MLXPLAT_CPLD_LPC_REG_FAN_DIRECTION: - case MLXPLAT_CPLD_LPC_REG_GP0_RO_OFFSET: - case MLXPLAT_CPLD_LPC_REG_GPCOM0_OFFSET: -@@ -5675,6 +6649,12 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_REG_ASIC2_HEALTH_OFFSET: - case MLXPLAT_CPLD_LPC_REG_ASIC2_EVENT_OFFSET: - case MLXPLAT_CPLD_LPC_REG_ASIC2_MASK_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_ASIC3_HEALTH_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_ASIC3_EVENT_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_ASIC3_MASK_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_ASIC4_HEALTH_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_ASIC4_EVENT_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_ASIC4_MASK_OFFSET: - case MLXPLAT_CPLD_LPC_REG_PSU_OFFSET: - case MLXPLAT_CPLD_LPC_REG_PSU_EVENT_OFFSET: - case MLXPLAT_CPLD_LPC_REG_PSU_MASK_OFFSET: -@@ -5684,6 +6664,9 @@ 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_FAN2_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_FAN2_EVENT_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_FAN2_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: -@@ -5751,6 +6734,13 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) - case MLXPLAT_CPLD_LPC_REG_TACHO12_OFFSET: - case MLXPLAT_CPLD_LPC_REG_TACHO13_OFFSET: - case MLXPLAT_CPLD_LPC_REG_TACHO14_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_TACHO15_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_TACHO16_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_TACHO17_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_TACHO18_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_TACHO19_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_TACHO20_OFFSET: -+ case MLXPLAT_CPLD_LPC_REG_ASIC_CAP_OFFSET: - case MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET: - case MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET: - case MLXPLAT_CPLD_LPC_REG_FAN_CAP2_OFFSET: -@@ -6472,6 +7462,27 @@ static int __init mlxplat_dmi_bf3_comex_default_matched(const struct dmi_system_ - return 1; - } - -+static int __init mlxplat_dmi_xdr_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_xdr_mux_data); -+ mlxplat_mux_data = mlxplat_xdr_mux_data; -+ mlxplat_hotplug = &mlxplat_mlxcpld_xdr_data; -+ mlxplat_hotplug->deferred_nr = -+ mlxplat_msn21xx_channels[MLXPLAT_CPLD_GRP_CHNL_NUM - 1]; -+ mlxplat_led = &mlxplat_xdr_led_data; -+ mlxplat_regs_io = &mlxplat_default_ng_regs_io_data; -+ mlxplat_fan = &mlxplat_xdr_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 mlxplat_register_platform_device(); -+} -+ - static const struct dmi_system_id mlxplat_dmi_table[] __initconst = { - { - .callback = mlxplat_dmi_default_wc_matched, -@@ -6579,6 +7590,12 @@ static const struct dmi_system_id mlxplat_dmi_table[] __initconst = { - DMI_MATCH(DMI_BOARD_NAME, "VMOD0017"), - }, - }, -+ { -+ .callback = mlxplat_dmi_xdr_matched, -+ .matches = { -+ DMI_MATCH(DMI_BOARD_NAME, "VMOD0018"), -+ }, -+ }, - { - .callback = mlxplat_dmi_msn274x_matched, - .matches = { --- -2.14.1 - diff --git a/platform/mellanox/non-upstream-patches/patches/9002-TMP-fix-for-fan-minimum-speed.patch b/platform/mellanox/non-upstream-patches/patches/9002-TMP-fix-for-fan-minimum-speed.patch deleted file mode 100644 index fa47c1c914d3..000000000000 --- a/platform/mellanox/non-upstream-patches/patches/9002-TMP-fix-for-fan-minimum-speed.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 91a6100aaadcea0a30d91a32897ef21452e48460 Mon Sep 17 00:00:00 2001 -From: Oleksandr Shamray -Date: Tue, 4 Apr 2023 09:56:48 +0000 -Subject: [PATCH] TMP fix for fan minimum speed - -Signed-off-by: Oleksandr Shamray ---- - drivers/hwmon/mlxreg-fan.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/hwmon/mlxreg-fan.c b/drivers/hwmon/mlxreg-fan.c -index 5a93fc0..b999ca6 100644 ---- a/drivers/hwmon/mlxreg-fan.c -+++ b/drivers/hwmon/mlxreg-fan.c -@@ -364,7 +364,7 @@ static int mlxreg_fan_set_cur_state(struct thermal_cooling_device *cdev, - * For configuration non-zero value is to be returned to avoid thermal - * statistics update. - */ -- config = 1; -+ config = 0; /*1*/; - state -= MLXREG_FAN_MAX_STATE; - for (i = 0; i < state; i++) - pwm->cooling_levels[i] = state; --- -2.14.1 - From 2e1892bf4468a98253b49de003fa15c23f1bdfbb Mon Sep 17 00:00:00 2001 From: Yevhen Fastiuk Date: Tue, 28 May 2024 21:32:48 +0300 Subject: [PATCH 323/419] =?UTF-8?q?=F0=9F=90=9E=20NTP:=20Fix=20config=20te?= =?UTF-8?q?mplate=20to=20init=20default=20parameters=20(#18736)=20(#18981)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes #17906 To fix NTP config generation from the minigraph and save backward compatability Align `ntp.conf.j2` template to generate config out of empty `NTP_SERVER` DB configuration Out of that NTP_SERVER configuration: ```json { "10.210.25.32": {}, "10.75.202.2": {} } ``` The next config in `ntp.conf` file should be produced: ``` server 10.210.25.32 restrict 10.210.25.32 kod limited nomodify notrap noquery nopeer server 10.75.202.2 restrict 10.75.202.2 kod limited nomodify notrap noquery nopeer ``` Signed-off-by: Yevhen Fastiuk --- files/image_config/ntp/ntp.conf.j2 | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/files/image_config/ntp/ntp.conf.j2 b/files/image_config/ntp/ntp.conf.j2 index ff25367f1e16..0f4f47a75e90 100644 --- a/files/image_config/ntp/ntp.conf.j2 +++ b/files/image_config/ntp/ntp.conf.j2 @@ -20,15 +20,17 @@ filegen clockstats file clockstats type day enable {# Adding NTP servers. We need to know if we have some pools, to set proper config -#} {% set ns = namespace(is_pools=false) %} -{% for server in NTP_SERVER if NTP_SERVER[server].admin_state != 'disabled' and - NTP_SERVER[server].resolve_as and - NTP_SERVER[server].association_type -%} +{% for server in NTP_SERVER if NTP_SERVER[server].admin_state != 'disabled' -%} {% set config = NTP_SERVER[server] -%} {# Server options -#} {% set soptions = '' -%} {# Server access control options -#} {% set aoptions = '' -%} + {# Define defaults if not defined -#} + {% set association_type = config.association_type | d('server') -%} + {% set resolve_as = config.resolve_as | d(server) -%} + {# Authentication key -#} {% if global.authentication == 'enabled' -%} {% if config.key -%} @@ -49,17 +51,16 @@ config -#} {# Check if there are any pool configured. BTW it doesn't matter what was configured as "resolve_as" for pools. If they were configured with FQDN they must remain like that -#} - {% set config_as = config.resolve_as -%} - {% if config.association_type == 'pool' -%} + {% if association_type == 'pool' -%} {% set ns.is_pools = true -%} - {% set config_as = server -%} + {% set resolve_as = server -%} {% else -%} {% set aoptions = aoptions ~ ' nopeer' -%} {% endif -%} -{{ config.association_type }} {{ config_as }}{{ soptions }} +{{ association_type }} {{ resolve_as }}{{ soptions }} {% if global.server_role == 'disabled' %} -restrict {{ config_as }} kod limited nomodify notrap noquery{{ aoptions }} +restrict {{ resolve_as }} kod limited nomodify notrap noquery{{ aoptions }} {% endif %} {% endfor -%} From 006f940a5b6d820c9b40f7137d7e37c9b0555831 Mon Sep 17 00:00:00 2001 From: Hua Liu <58683130+liuh-80@users.noreply.github.com> Date: Wed, 29 May 2024 07:47:12 +0800 Subject: [PATCH 324/419] [202311] Fix TACACS local accounting disabled when debug flag disabled. (#19060) * [TACACS] Ignore TACACS accounting trace log when debug disabled. (#16482) Ignore TACACS accounting trace log when debug disabled. #### Why I did it TACACS accounting trace log is only for debug, improve code to not generate trace log when debug disabled. ##### Work item tracking - Microsoft ADO: 25270078 #### How I did it Ignore TACACS accounting trace log when debug disabled. #### How to verify it Pass all UT. Manually verified the auditd-tacplus not generate trace log when debug disabled. ### Description for the changelog Ignore TACACS accounting trace log when debug disabled. * Fix tacacs local accounting break. (#18357) Fix TACACS local accounting disabled when debug flag disabled. #### Why I did it TACACS local accounting use trace() method to output local accounting log, following PR disable trace log when debug flag disabled, https://github.com/sonic-net/sonic-buildimage/pull/16482 Because test case issue, this regression not found. the issue only exists on master branch. ### How I did it Fix TACACS local accounting disabled when debug flag disabled. #### How to verify it Pass all UT. Fix TACACS accounting UT to prevent regression. ### Tested branch (Please provide the tested image version) - [] SONiC.master-16482.360728-2c8b4066f #### Description for the changelog Fix TACACS local accounting disabled when debug flag disabled. --- ...-Remove-user-secret-from-accounting-log.patch | 16 +++++++++++++--- .../patches/0003-Add-local-accounting.patch | 4 ++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/tacacs/audisp/patches/0002-Remove-user-secret-from-accounting-log.patch b/src/tacacs/audisp/patches/0002-Remove-user-secret-from-accounting-log.patch index 1cacaa8a0614..209db4937758 100644 --- a/src/tacacs/audisp/patches/0002-Remove-user-secret-from-accounting-log.patch +++ b/src/tacacs/audisp/patches/0002-Remove-user-secret-from-accounting-log.patch @@ -13,7 +13,7 @@ Subject: [PATCH] Remove user secret from accounting log. regex_helper.h | 17 +++ sudoers_helper.c | 250 +++++++++++++++++++++++++++++++++++++++ sudoers_helper.h | 18 +++ - trace.c | 21 ++++ + trace.c | 31 +++++ trace.h | 10 ++ unittest/Makefile | 21 ++++ unittest/mock.h | 17 +++ @@ -21,7 +21,7 @@ Subject: [PATCH] Remove user secret from accounting log. unittest/mock_helper.h | 48 ++++++++ unittest/password_test.c | 199 +++++++++++++++++++++++++++++++ unittest/sudoers | 5 + - 17 files changed, 931 insertions(+), 4 deletions(-) + 17 files changed, 941 insertions(+), 4 deletions(-) create mode 100644 password.c create mode 100644 password.h create mode 100644 regex_helper.c @@ -700,7 +700,7 @@ new file mode 100644 index 0000000..44bbbc7 --- /dev/null +++ b/trace.c -@@ -0,0 +1,21 @@ +@@ -0,0 +1,31 @@ +#include +#include +#include @@ -709,9 +709,19 @@ index 0000000..44bbbc7 + +#include "trace.h" + ++/* Tacacs+ support lib */ ++#include ++ ++/* Tacacs control flag */ ++extern int tacacs_ctrl; ++ +/* Output trace log. */ +void trace(const char *format, ...) +{ ++ if ((tacacs_ctrl & PAM_TAC_DEBUG) == 0) { ++ return; ++ } ++ + // convert log to a string because va args resoursive issue: + // http://www.c-faq.com/varargs/handoff.html + char logBuffer[MAX_LINE_SIZE]; diff --git a/src/tacacs/audisp/patches/0003-Add-local-accounting.patch b/src/tacacs/audisp/patches/0003-Add-local-accounting.patch index 1883f55914fa..00f7b1349505 100644 --- a/src/tacacs/audisp/patches/0003-Add-local-accounting.patch +++ b/src/tacacs/audisp/patches/0003-Add-local-accounting.patch @@ -70,12 +70,12 @@ index 0000000..e23acec +#include "trace.h" + +/* Accounting log format. */ -+#define ACCOUNTING_LOG_FORMAT "Accounting: user: %s, tty: %s, host: %s, command: %s, type: %d, task ID: %d" ++#define ACCOUNTING_LOG_FORMAT "Audisp-tacplus: Accounting: user: %s, tty: %s, host: %s, command: %s, type: %d, task ID: %d" + +/* Write the accounting information to syslog. */ +void accounting_to_syslog(char *user, char *tty, char *host, char *cmdmsg, int type, uint16_t task_id) +{ -+ trace(ACCOUNTING_LOG_FORMAT, user, tty, host, cmdmsg, type, task_id); ++ syslog(LOG_INFO, ACCOUNTING_LOG_FORMAT, user, tty, host, cmdmsg, type, task_id); +} \ No newline at end of file diff --git a/local_accounting.h b/local_accounting.h From e3160553d815f9173a907633b7ae39025f906dcb Mon Sep 17 00:00:00 2001 From: Tomer Shalvi <116184476+tshalvi@users.noreply.github.com> Date: Tue, 28 May 2024 14:01:01 +0300 Subject: [PATCH 325/419] [Mellanox] Verify the value of the control type sysfs before changing it to FW control (#19046) - Why I did it On Mellanox platforms, changing the control type sysfs value is not supported for ports that are set to firmware control. Therefore, attempting to change this value to firmware control will result in an error log, which we want to avoid. - How I did it I added a check to ensure that the control sysfs value is set to firmware control only if it is not already in firmware control. - How to verify it Ensure that after a warm reboot on the Mellanox platform (an attempt to change the sysfs value from fw_control to fw_control is only applicable in this scenario), the following error does not appear: sxd_kernel: [error] sx_core_set_module_control: Failed control change: module is dependent (FW control). --- platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index bc07009c93e1..34b5fe8004ba 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -1493,8 +1493,9 @@ def action_on_sw_control(cls, sfp): @classmethod def action_on_fw_control(cls, sfp): - logger.log_info(f'SFP {sfp.sdk_index} is set to firmware control') - sfp.set_control_type(SFP_FW_CONTROL) + if sfp.get_control_type() != SFP_FW_CONTROL: + logger.log_info(f'SFP {sfp.sdk_index} is set to firmware control') + sfp.set_control_type(SFP_FW_CONTROL) @classmethod def action_on_cancel_wait(cls, sfp): From 67d8771c546c8cc781ef9aaed3930d1d3e090714 Mon Sep 17 00:00:00 2001 From: Wenda Chu <32250288+w1nda@users.noreply.github.com> Date: Fri, 24 May 2024 01:15:44 +0800 Subject: [PATCH 326/419] Update dhcpservd.py (#19029) After dump new config, send SIGHUP to kea-dhcp4 process to force refresh config. --- .../dhcp_utilities/dhcpservd/dhcpservd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcpservd.py b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcpservd.py index 8911a3341637..76152cd3c205 100644 --- a/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcpservd.py +++ b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcpservd.py @@ -58,8 +58,8 @@ def dump_dhcp4_config(self): self.used_options = used_options with open(self.kea_dhcp4_config_path, "w") as write_file: write_file.write(kea_dhcp4_config) - # After refresh kea-config, we need to SIGHUP kea-dhcp4 process to read new config - self._notify_kea_dhcp4_proc() + # After refresh kea-config, we need to SIGHUP kea-dhcp4 process to read new config + self._notify_kea_dhcp4_proc() def _update_dhcp_server_ip(self): """ From 986f84f0a95782962eb7607f53a63f73b8eca574 Mon Sep 17 00:00:00 2001 From: DavidZagury <32644413+DavidZagury@users.noreply.github.com> Date: Wed, 29 May 2024 23:29:00 +0300 Subject: [PATCH 327/419] [202311] Fix pstore service not running (#19006) * Fix pstore service not running --- build_debian.sh | 4 ++++ files/image_config/system-pstore/override.conf | 12 ++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 files/image_config/system-pstore/override.conf diff --git a/build_debian.sh b/build_debian.sh index 8e6d799e8157..9c3d9d199f82 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -526,6 +526,10 @@ rm /files/lib/systemd/system/rsyslog.service/Service/ExecStart/arguments set /files/lib/systemd/system/rsyslog.service/Service/ExecStart/arguments/1 -n " +# Ensure pstore service is running +sudo mkdir -p $FILESYSTEM_ROOT/lib/systemd/system/systemd-pstore.service.d +sudo cp files/image_config/system-pstore/override.conf $FILESYSTEM_ROOT/lib/systemd/system/systemd-pstore.service.d/override.conf + sudo mkdir -p $FILESYSTEM_ROOT/var/core # Config sysctl diff --git a/files/image_config/system-pstore/override.conf b/files/image_config/system-pstore/override.conf new file mode 100644 index 000000000000..353a3b46dee6 --- /dev/null +++ b/files/image_config/system-pstore/override.conf @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +# +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +After=modprobe@efi_pstore.service +Wants=modprobe@efi_pstore.service \ No newline at end of file From fd6f436f57952967b5205b9ba64b95069214a220 Mon Sep 17 00:00:00 2001 From: DavidZagury <32644413+DavidZagury@users.noreply.github.com> Date: Wed, 22 May 2024 19:51:48 +0300 Subject: [PATCH 328/419] [Mellanox] Update pcie yaml file for SN5600 and SN5400 (#19015) Remove I2C Controller from pcie yaml file for SN5600 and SN5400 --- device/mellanox/x86_64-nvidia_sn5400-r0/pcie.yaml | 6 ------ device/mellanox/x86_64-nvidia_sn5600-r0/pcie.yaml | 8 +------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/pcie.yaml b/device/mellanox/x86_64-nvidia_sn5400-r0/pcie.yaml index 7c08d0aa1e0d..0741f00f1062 100644 --- a/device/mellanox/x86_64-nvidia_sn5400-r0/pcie.yaml +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/pcie.yaml @@ -56,12 +56,6 @@ fn: '2' id: a36f name: 'RAM memory: Intel Corporation Cannon Lake PCH Shared SRAM (rev 10)' -- bus: '00' - dev: '15' - fn: '0' - id: a368 - name: 'Serial bus controller [0c80]: Intel Corporation Cannon Lake PCH Serial IO - I2C Controller #0 (rev 10)' - bus: '00' dev: '16' fn: '0' diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/pcie.yaml b/device/mellanox/x86_64-nvidia_sn5600-r0/pcie.yaml index 30c6a23773d1..ef0d1b3c70d1 100644 --- a/device/mellanox/x86_64-nvidia_sn5600-r0/pcie.yaml +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/pcie.yaml @@ -1,5 +1,5 @@ ## -## Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. +## Copyright (c) 2022-2024 NVIDIA CORPORATION & AFFILIATES. ## Apache-2.0 ## ## Licensed under the Apache License, Version 2.0 (the "License"); @@ -56,12 +56,6 @@ fn: '2' id: a36f name: 'RAM memory: Intel Corporation Cannon Lake PCH Shared SRAM (rev 10)' -- bus: '00' - dev: '15' - fn: '0' - id: a368 - name: 'Serial bus controller [0c80]: Intel Corporation Cannon Lake PCH Serial IO - I2C Controller #0 (rev 10)' - bus: '00' dev: '16' fn: '0' From 5d015fcb5f162c69ef86c0bb7ab6d5f58746210c Mon Sep 17 00:00:00 2001 From: Liu Shilong Date: Thu, 30 May 2024 15:08:04 +0800 Subject: [PATCH 329/419] [ci] Migrate ubuntu and sonicbld agent pool to fix S360 alert. (#19100) Why I did it Migrate agent pool to fix S360 ticket. Work item tracking Microsoft ADO (number only): 27889786 How I did it How to verify it --- .azure-pipelines/azure-pipelines-Official.yml | 2 +- .../azure-pipelines-UpgrateVersion.yml | 2 +- .azure-pipelines/build-template.yml | 4 ++-- .../docker-sonic-mgmt-py3-only.yml | 2 +- .azure-pipelines/docker-sonic-mgmt.yml | 2 +- .../docker-sonic-slave-template.yml | 4 ++-- .azure-pipelines/docker-sonic-slave.yml | 2 +- .azure-pipelines/dpkg-cache-cleanup.yml | 2 +- .azure-pipelines/official-build-cache.yml | 2 +- .azure-pipelines/official-build.yml | 2 +- .azure-pipelines/template-commonlib.yml | 2 +- azure-pipelines.yml | 20 +++++++++---------- 12 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.azure-pipelines/azure-pipelines-Official.yml b/.azure-pipelines/azure-pipelines-Official.yml index a5a08167ca1d..56d88751f690 100644 --- a/.azure-pipelines/azure-pipelines-Official.yml +++ b/.azure-pipelines/azure-pipelines-Official.yml @@ -14,7 +14,7 @@ schedules: - 202012 always: true -pool: sonicbld +pool: sonicbld-1es stages: - stage: Build diff --git a/.azure-pipelines/azure-pipelines-UpgrateVersion.yml b/.azure-pipelines/azure-pipelines-UpgrateVersion.yml index c4d1d9f98db1..049e12bfc1c8 100644 --- a/.azure-pipelines/azure-pipelines-UpgrateVersion.yml +++ b/.azure-pipelines/azure-pipelines-UpgrateVersion.yml @@ -26,7 +26,7 @@ resources: ref: master endpoint: sonic-net -pool: sonicbld +pool: sonicbld-1es parameters: - name: 'jobFilters' diff --git a/.azure-pipelines/build-template.yml b/.azure-pipelines/build-template.yml index 355cfc7aaf9a..813126792e69 100644 --- a/.azure-pipelines/build-template.yml +++ b/.azure-pipelines/build-template.yml @@ -35,9 +35,9 @@ parameters: - name: pool type: string values: - - sonicbld + - sonicbld-1es - sonicbld_8c - default: sonicbld + default: sonicbld-1es - name: dbg_image type: boolean diff --git a/.azure-pipelines/docker-sonic-mgmt-py3-only.yml b/.azure-pipelines/docker-sonic-mgmt-py3-only.yml index d79706bc106d..7bc393eefce5 100644 --- a/.azure-pipelines/docker-sonic-mgmt-py3-only.yml +++ b/.azure-pipelines/docker-sonic-mgmt-py3-only.yml @@ -32,7 +32,7 @@ stages: - stage: Build jobs: - job: Build - pool: sonicbld + pool: sonicbld-1es timeoutInMinutes: 360 steps: - template: cleanup.yml diff --git a/.azure-pipelines/docker-sonic-mgmt.yml b/.azure-pipelines/docker-sonic-mgmt.yml index 27bf970dab13..6efb0aa26aee 100644 --- a/.azure-pipelines/docker-sonic-mgmt.yml +++ b/.azure-pipelines/docker-sonic-mgmt.yml @@ -32,7 +32,7 @@ stages: - stage: Build jobs: - job: Build - pool: sonicbld + pool: sonicbld-1es timeoutInMinutes: 360 steps: - template: cleanup.yml diff --git a/.azure-pipelines/docker-sonic-slave-template.yml b/.azure-pipelines/docker-sonic-slave-template.yml index 063f75453114..909f1ce0bcec 100644 --- a/.azure-pipelines/docker-sonic-slave-template.yml +++ b/.azure-pipelines/docker-sonic-slave-template.yml @@ -28,9 +28,9 @@ parameters: default: sonicdev - name: pool type: string - default: sonicbld + default: sonicbld-1es values: - - sonicbld + - sonicbld-1es - sonicbld-arm64 - sonicbld-armhf diff --git a/.azure-pipelines/docker-sonic-slave.yml b/.azure-pipelines/docker-sonic-slave.yml index 4c679f7f9518..332d6c4932ad 100644 --- a/.azure-pipelines/docker-sonic-slave.yml +++ b/.azure-pipelines/docker-sonic-slave.yml @@ -63,7 +63,7 @@ stages: - ${{ each arch in parameters.arches }}: - template: .azure-pipelines/docker-sonic-slave-template.yml@buildimage parameters: - pool: sonicbld + pool: sonicbld-1es arch: ${{ arch }} dist: ${{ dist }} ${{ if ne(arch, 'amd64') }}: diff --git a/.azure-pipelines/dpkg-cache-cleanup.yml b/.azure-pipelines/dpkg-cache-cleanup.yml index 50bb3a63635b..7bac6997e40a 100644 --- a/.azure-pipelines/dpkg-cache-cleanup.yml +++ b/.azure-pipelines/dpkg-cache-cleanup.yml @@ -16,7 +16,7 @@ pr: none jobs: - job: Amd - pool: sonicbld + pool: sonicbld-1es timeoutInMinutes: 5 steps: - checkout: none diff --git a/.azure-pipelines/official-build-cache.yml b/.azure-pipelines/official-build-cache.yml index c4261a72092c..e6f948e65d20 100644 --- a/.azure-pipelines/official-build-cache.yml +++ b/.azure-pipelines/official-build-cache.yml @@ -24,7 +24,7 @@ pr: none stages: - stage: Build - pool: sonicbld + pool: sonicbld-1es variables: - name: CACHE_MODE value: cache diff --git a/.azure-pipelines/official-build.yml b/.azure-pipelines/official-build.yml index 14308292f4b8..ecc9bd89c697 100644 --- a/.azure-pipelines/official-build.yml +++ b/.azure-pipelines/official-build.yml @@ -34,7 +34,7 @@ variables: stages: - stage: Build - pool: sonicbld + pool: sonicbld-1es variables: - name: CACHE_MODE value: wcache diff --git a/.azure-pipelines/template-commonlib.yml b/.azure-pipelines/template-commonlib.yml index cd7551d83823..c821998ae815 100644 --- a/.azure-pipelines/template-commonlib.yml +++ b/.azure-pipelines/template-commonlib.yml @@ -11,7 +11,7 @@ jobs: - job: Build_${{ arch }} timeoutInMinutes: 120 ${{ if eq(arch,'amd64') }}: - pool: sonicbld + pool: sonicbld-1es ${{ else }}: pool: sonicbld-${{ arch }} variables: diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0a58bc4c0cbc..be3f327a8289 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -46,7 +46,7 @@ variables: stages: - stage: BuildVS - pool: sonicbld + pool: sonicbld-1es jobs: - template: .azure-pipelines/azure-pipelines-build.yml parameters: @@ -55,7 +55,7 @@ stages: - name: vs - stage: Build - pool: sonicbld + pool: sonicbld-1es dependsOn: [] jobs: - template: .azure-pipelines/azure-pipelines-build.yml @@ -154,7 +154,7 @@ stages: testRunTitle: vstest - job: t0_elastictest - pool: ubuntu-20.04 + pool: sonic-ubuntu-1c displayName: "kvmtest-t0 by Elastictest" timeoutInMinutes: 240 continueOnError: false @@ -167,7 +167,7 @@ stages: MGMT_BRANCH: "202311" - job: t0_2vlans_elastictest - pool: ubuntu-20.04 + pool: sonic-ubuntu-1c displayName: "kvmtest-t0-2vlans by Elastictest" timeoutInMinutes: 240 continueOnError: false @@ -182,7 +182,7 @@ stages: DEPLOY_MG_EXTRA_PARAMS: "-e vlan_config=two_vlan_a" - job: t1_lag_elastictest - pool: ubuntu-20.04 + pool: sonic-ubuntu-1c displayName: "kvmtest-t1-lag by Elastictest" timeoutInMinutes: 240 continueOnError: false @@ -196,7 +196,7 @@ stages: - job: multi_asic_elastictest displayName: "kvmtest-multi-asic-t1-lag by Elastictest" - pool: ubuntu-20.04 + pool: sonic-ubuntu-1c timeoutInMinutes: 240 continueOnError: false steps: @@ -210,7 +210,7 @@ stages: MGMT_BRANCH: "202311" - job: dualtor_elastictest - pool: ubuntu-20.04 + pool: sonic-ubuntu-1c displayName: "kvmtest-dualtor-t0 by Elastictest" timeoutInMinutes: 240 continueOnError: false @@ -225,7 +225,7 @@ stages: - job: sonic_t0_elastictest displayName: "kvmtest-t0-sonic by Elastictest" - pool: ubuntu-20.04 + pool: sonic-ubuntu-1c timeoutInMinutes: 240 continueOnError: false steps: @@ -243,7 +243,7 @@ stages: # displayName: "kvmtest-dpu by Elastictest" # timeoutInMinutes: 240 # continueOnError: false -# pool: ubuntu-20.04 +# pool: sonic-ubuntu-1c # steps: # - template: .azure-pipelines/run-test-elastictest-template.yml@sonic-mgmt # parameters: @@ -255,7 +255,7 @@ stages: # - job: wan_elastictest # displayName: "kvmtest-wan by Elastictest" -# pool: ubuntu-20.04 +# pool: sonic-ubuntu-1c # timeoutInMinutes: 240 # continueOnError: false # steps: From 843b2466badf4b3ae97914588c6084c4efbe4d16 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 30 May 2024 16:01:53 +0800 Subject: [PATCH 330/419] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#19117) #### Why I did it src/sonic-utilities ``` * ce699c49 - (HEAD -> 202311, origin/202311) [build] Fix base OS compilation issue caused by incompatibility between urllib3 and requests packages (#3328) (#3337) (33 hours ago) [Oleksandr Ivantsiv] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index 804e053a876e..ce699c49a91e 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 804e053a876eb11a60db9ae42002c4c17b0fbbf8 +Subproject commit ce699c49a91e7f80c321966c0d7cff268473c9c1 From 9cb62826b51d1cae6f5eaed1d97d9c211cff2cf1 Mon Sep 17 00:00:00 2001 From: skumar041 <107456442+skumar041@users.noreply.github.com> Date: Fri, 31 May 2024 06:20:26 +0530 Subject: [PATCH 331/419] [Marvell] Update sai debian (#19124) Update Marvell SAI for arm64 and amd64 to include MACsec feature. Signed-off-by: sandeep kumar --- platform/marvell-arm64/sai.mk | 2 +- platform/marvell/sai.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/marvell-arm64/sai.mk b/platform/marvell-arm64/sai.mk index 85609e63b28c..6d5d49857417 100644 --- a/platform/marvell-arm64/sai.mk +++ b/platform/marvell-arm64/sai.mk @@ -1,6 +1,6 @@ # Marvell SAI -export MRVL_SAI_VERSION = 1.13.3-2 +export MRVL_SAI_VERSION = 1.13.3-3 export MRVL_SAI = mrvllibsai_$(MRVL_SAI_VERSION)_$(PLATFORM_ARCH).deb $(MRVL_SAI)_SRC_PATH = $(PLATFORM_PATH)/sai diff --git a/platform/marvell/sai.mk b/platform/marvell/sai.mk index 0bf366af45ed..a4c4b019890c 100644 --- a/platform/marvell/sai.mk +++ b/platform/marvell/sai.mk @@ -1,6 +1,6 @@ # Marvell SAI -export MRVL_SAI_VERSION = 1.13.3-1 +export MRVL_SAI_VERSION = 1.13.3-2 export MRVL_SAI = mrvllibsai_amd64_$(MRVL_SAI_VERSION).deb $(MRVL_SAI)_SRC_PATH = $(PLATFORM_PATH)/sai From 0bd8c6460165281fd85c651c7d2aed8bf2401fbb Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 31 May 2024 08:58:01 +0800 Subject: [PATCH 332/419] [ci/build]: Upgrade SONiC package versions (#19080) --- .../versions-py3-all-arm64 | 1 - files/build/versions/default/versions-git | 10 ++++----- files/build/versions/default/versions-mirror | 22 +++++++++---------- .../docker-base-buster/versions-deb-buster | 2 +- .../dockers/docker-ptf/versions-deb-buster | 2 +- .../sonic-slave-buster/versions-deb-buster | 4 ++-- .../versions/host-image/versions-deb-bullseye | 10 ++++++++- .../host-image/versions-deb-bullseye-arm64 | 2 -- .../host-image/versions-deb-bullseye-armhf | 2 -- 9 files changed, 29 insertions(+), 26 deletions(-) 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 44a337154808..b80f4ad9b36d 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 @@ -3,4 +3,3 @@ bitarray==1.5.3 click==7.0 requests==2.31.0 urllib3==2.0.5 -zipp==1.2.0 diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index 2b9580843783..570b3cf54678 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==09c232e7c0d5670695d1f8f70d05ed1a215e438c +https://chromium.googlesource.com/chromium/tools/depot_tools.git==73a5b5cf7bb96fe7f56c6892cb887063629b74cc https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f https://github.com/CESNET/libyang.git==4c733412e7173219166be7053940326a92699765 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==2f8e64372a80115d7905e6e45194034e3082273a -https://github.com/FreeRADIUS/freeradius-server.git==04618796bdb8a52f489ff70cb99fd8eabeeba6ca +https://github.com/flashrom/flashrom.git==35a2168c323a30317156eb5b5d5a56b4811dd9af +https://github.com/FreeRADIUS/freeradius-server.git==f1dc7b44fb32830c644feda95003b56bfcca3016 https://github.com/FreeRADIUS/pam_radius.git==d802da75cbfc3062ae1b18d0bf26ac2a030ffdaa https://github.com/jeroennijhof/pam_tacplus.git==b839c440e33c36eced9dcbc287fcfe6237c4c4ce https://github.com/jpirko/libteam.git==337125ce8d24ed66d7f4c7e6eef50458f3e7d154 @@ -14,10 +14,10 @@ https://github.com/Marvell-switching/mrvl-prestera.git==5834b7338ff9ac6f03d45ab8 https://github.com/Mellanox/libpsample.git==62bb27d9a49424e45191eee81df7ce0d8c74e774 https://github.com/p4lang/ptf.git==c554f83685186be4cfa9387eb5d6d700d2bbd7c0 https://github.com/p4lang/scapy-vxlan.git==85ffe83da156568ee47a0750f638227e6e1d7479 -https://github.com/sflow/host-sflow==6edc82d62a1cf0f7fb821587af67e5520624f50d +https://github.com/sflow/host-sflow==a3ce4814bb6673a314142183e22c0e710cd21292 https://github.com/sflow/sflowtool==c42c49cb80b927a4c02e54fc26430417f18f4833 https://github.com/thom311/libnl==49f7822961f5bc6b18cd2a2d3f3b8d2ab0896d3f https://salsa.debian.org/debian/libteam.git==48142125234a665ad5367b724af36a58fb484d3d -https://salsa.debian.org/kernel-team/initramfs-tools.git==2b3148526012c95e1faf0832faa19b9de8c8b67b +https://salsa.debian.org/kernel-team/initramfs-tools.git==4797c54c5f2a1f8659bac53aa6259a63573f0a83 https://salsa.debian.org/sk-guest/monit.git==c9da7ebb1f35dfba17b50b5969a6e75e29cbec0d https://salsa.debian.org/ssh-team/openssh.git==096572ea878f93fe2c85d8e86e43e2281f3f46d7 diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index 733e23ec15cd..65cfe4bac23b 100644 --- a/files/build/versions/default/versions-mirror +++ b/files/build/versions/default/versions-mirror @@ -1,14 +1,14 @@ 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==20240524T000458Z -debian-security==20240524T000400Z -download.docker.com_linux_debian_dists_bullseye==2024-05-23T13:29:25Z +debian==20240528T000406Z +debian-security==20240528T000421Z +download.docker.com_linux_debian_dists_bullseye==2024-05-28T14:05:22Z download.docker.com_linux_debian_dists_buster==2024-05-23T13:29:25Z -packages.trafficmanager.net_snapshot_debian-security_20240524T000400Z_dists_bullseye-security==2024-05-22T16:44:08Z -packages.trafficmanager.net_snapshot_debian-security_20240524T000400Z_dists_buster_updates==2024-05-22T16:44:09Z -packages.trafficmanager.net_snapshot_debian_20240524T000458Z_dists_bullseye==2024-02-10T12:40:37Z -packages.trafficmanager.net_snapshot_debian_20240524T000458Z_dists_bullseye-backports==2024-05-23T20:13:01Z -packages.trafficmanager.net_snapshot_debian_20240524T000458Z_dists_bullseye-updates==2024-05-23T20:13:01Z -packages.trafficmanager.net_snapshot_debian_20240524T000458Z_dists_buster==2023-06-10T08:53:33Z -packages.trafficmanager.net_snapshot_debian_20240524T000458Z_dists_buster-backports==2024-03-09T20:54:54Z -packages.trafficmanager.net_snapshot_debian_20240524T000458Z_dists_buster-updates==2023-06-10T08:55:10Z +packages.trafficmanager.net_snapshot_debian-security_20240528T000421Z_dists_bullseye-security==2024-05-27T18:32:57Z +packages.trafficmanager.net_snapshot_debian-security_20240528T000421Z_dists_buster_updates==2024-05-27T18:32:57Z +packages.trafficmanager.net_snapshot_debian_20240528T000406Z_dists_bullseye==2024-02-10T12:40:37Z +packages.trafficmanager.net_snapshot_debian_20240528T000406Z_dists_bullseye-backports==2024-05-27T20:16:19Z +packages.trafficmanager.net_snapshot_debian_20240528T000406Z_dists_bullseye-updates==2024-05-27T20:16:19Z +packages.trafficmanager.net_snapshot_debian_20240528T000406Z_dists_buster==2023-06-10T08:53:33Z +packages.trafficmanager.net_snapshot_debian_20240528T000406Z_dists_buster-backports==2024-03-09T20:54:54Z +packages.trafficmanager.net_snapshot_debian_20240528T000406Z_dists_buster-updates==2023-06-10T08:55:10Z 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 820ceac71c13..e736fc97dbd8 100644 --- a/files/build/versions/dockers/docker-base-buster/versions-deb-buster +++ b/files/build/versions/dockers/docker-base-buster/versions-deb-buster @@ -1,7 +1,7 @@ ca-certificates==20200601~deb10u2 curl==7.64.0-4+deb10u9 jq==1.5+dfsg-2+b1 -less==487-0.1+b1 +less==487-0.1+deb10u1 libatomic1==8.3.0-6 libcurl4==7.64.0-4+deb10u9 libdaemon0==0.14-7 diff --git a/files/build/versions/dockers/docker-ptf/versions-deb-buster b/files/build/versions/dockers/docker-ptf/versions-deb-buster index 8bcdee3e574c..d5d605ec42d6 100644 --- a/files/build/versions/dockers/docker-ptf/versions-deb-buster +++ b/files/build/versions/dockers/docker-ptf/versions-deb-buster @@ -71,7 +71,7 @@ ipython3==5.8.0-1+deb10u1 iso-codes==4.2-1 javascript-common==11 krb5-locales==1.17-3+deb10u6 -less==487-0.1+b1 +less==487-0.1+deb10u1 libalgorithm-diff-perl==1.19.03-2 libalgorithm-diff-xs-perl==0.04-5+b1 libalgorithm-merge-perl==0.08-3 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 79402bc638a0..39cce43cb3e5 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster @@ -210,7 +210,7 @@ kmod==26-1 krb5-locales==1.17-3+deb10u6 krb5-multidev==1.17-3+deb10u6 lcov==1.13-4 -less==487-0.1+b1 +less==487-0.1+deb10u1 lib32asan5==8.3.0-6 lib32atomic1==8.3.0-6 lib32gcc-8-dev==8.3.0-6 @@ -292,7 +292,7 @@ libbinutils==2.31.1-16 libbison-dev==2:3.3.2.dfsg-1 libbit-vector-perl==7.4-1+b5 libblkid-dev==2.33.1-0.1+deb10u1 -libbluetooth3==5.50-1.2~deb10u4 +libbluetooth3==5.50-1.2~deb10u5 libbluray2==1:1.1.0-1+deb10u1 libboost-atomic1.71-dev==1.71.0-6~bpo10+1 libboost-atomic1.71.0==1.71.0-6~bpo10+1 diff --git a/files/build/versions/host-image/versions-deb-bullseye b/files/build/versions/host-image/versions-deb-bullseye index d32e401da4af..798ccce7dde6 100644 --- a/files/build/versions/host-image/versions-deb-bullseye +++ b/files/build/versions/host-image/versions-deb-bullseye @@ -67,7 +67,7 @@ grub2-common==2.06-3~deb11u6 haveged==1.9.14-1 hdparm==9.60+ds-1 hping3==3.a2.ds2-10 -hw-management==1.mlnx.7.0030.2008 +hw-management==1.mlnx.7.0030.4002 i2c-tools==4.2-1+b1 ifmetric==0.3-5 ifupdown2==3.0.0-1 @@ -94,6 +94,9 @@ libasan6==10.2.1-6 libassuan0==2.5.3-7.1 libatomic1==10.2.1-6 libauparse0==1:3.0-2 +libavahi-client3==0.8-5+deb11u2 +libavahi-common-data==0.8-5+deb11u2 +libavahi-common3==0.8-5+deb11u2 libbabeltrace1==1.5.8-1+b3 libbinutils==2.35.2-2 libblkid-dev==2.36.1-8+deb11u2 @@ -151,6 +154,9 @@ libgrpc10==1.30.2-3 libhavege2==1.9.14-1 libhiredis0.14==0.14.1-1 libi2c0==4.2-1+b1 +libicu67==67.1-7 +libiio-utils==0.21-2+b1 +libiio0==0.21-2+b1 libiniparser1==4.1-4 libip4tc2==1.8.7-1 libip6tc2==1.8.7-1 @@ -222,6 +228,7 @@ libsasl2-2==2.1.27+dfsg-2.1+deb11u1 libsasl2-modules-db==2.1.27+dfsg-2.1+deb11u1 libsensors-config==1:3.6.0-7 libsensors5==1:3.6.0-7 +libserialport0==0.1.1-4 libslang2==2.3.2-5 libsmartcols1==2.36.1-8+deb11u2 libsodium23==1.0.18-1 @@ -241,6 +248,7 @@ libusb-1.0-0==2:1.0.24-3 libutempter0==1.2.1-2 libuuid1==2.36.1-8+deb11u2 libwrap0==7.6.q-31 +libxml2==2.9.10+dfsg-6.7+deb11u4 libxtables12==1.8.7-1 libyaml-0-2==0.2.2-1 libyang==1.0.73 diff --git a/files/build/versions/host-image/versions-deb-bullseye-arm64 b/files/build/versions/host-image/versions-deb-bullseye-arm64 index 12e498f88d20..cdaf12bd710f 100644 --- a/files/build/versions/host-image/versions-deb-bullseye-arm64 +++ b/files/build/versions/host-image/versions-deb-bullseye-arm64 @@ -5,10 +5,8 @@ libc-dev-bin==2.31-13+deb11u10 libc6-dev==2.31-13+deb11u10 libcrypt-dev==1:4.4.18-4 libicu-dev==67.1-7 -libicu67==67.1-7 libnsl-dev==1.3.0-2 libtirpc-dev==1.3.1-1+deb11u1 -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 diff --git a/files/build/versions/host-image/versions-deb-bullseye-armhf b/files/build/versions/host-image/versions-deb-bullseye-armhf index 8b59b1ebe9ee..b12edb44dccd 100644 --- a/files/build/versions/host-image/versions-deb-bullseye-armhf +++ b/files/build/versions/host-image/versions-deb-bullseye-armhf @@ -5,10 +5,8 @@ libc-dev-bin==2.31-13+deb11u10 libc6-dev==2.31-13+deb11u10 libcrypt-dev==1:4.4.18-4 libicu-dev==67.1-7 -libicu67==67.1-7 libnsl-dev==1.3.0-2 libtirpc-dev==1.3.1-1+deb11u1 -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 From 402581432de8dd72433b985956c0c37d530fb5c5 Mon Sep 17 00:00:00 2001 From: Stepan Blyshchak <38952541+stepanblyschak@users.noreply.github.com> Date: Fri, 31 May 2024 03:30:00 +0300 Subject: [PATCH 333/419] [Nvidia] Remove SAI_HOSTIF_OPER_STATUS_UPDATE_BY_APP, set it only for certain SKUs (#19066) * Revert "[Mellanox] enable host interface control by orchagent (#18592)" This reverts commit 3adf3082889dbba697cbec09846bb78ca879109e. Signed-off-by: Stepan Blyschak --- .../x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/sai.profile | 1 + platform/mellanox/docker-syncd-mlnx/sai-common.profile | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/sai.profile b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/sai.profile index a362513c8dd5..73fbbd1609bb 100644 --- a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/sai.profile +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/sai.profile @@ -1 +1,2 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_sn5600_128x400g_1x25g.xml +SAI_HOSTIF_OPER_STATUS_UPDATE_BY_APP=1 diff --git a/platform/mellanox/docker-syncd-mlnx/sai-common.profile b/platform/mellanox/docker-syncd-mlnx/sai-common.profile index d3b91a00e106..3b9e6fe00573 100644 --- a/platform/mellanox/docker-syncd-mlnx/sai-common.profile +++ b/platform/mellanox/docker-syncd-mlnx/sai-common.profile @@ -1,3 +1,2 @@ SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps SAI_DUMP_STORE_AMOUNT=10 -SAI_HOSTIF_OPER_STATUS_UPDATE_BY_APP=1 From 975c2e01476ef41fd18b4035cd85f44b669eb742 Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Wed, 29 May 2024 18:30:36 +0800 Subject: [PATCH 334/419] [Mellanox] enlarge the eeprom ready timeout from 20 to 60 (#18983) - Why I did it Service like ZTP accesses EEPROM very early at the boot stage. It could cause an issue that EEPROM is not ready. The PR enlarge EEPROM ready timeout from 20s to 60s. - How I did it Enlarge EEPROM ready timeout from 20s to 60s. - How to verify it Manual test --- platform/mellanox/mlnx-platform-api/sonic_platform/eeprom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/eeprom.py b/platform/mellanox/mlnx-platform-api/sonic_platform/eeprom.py index 8a2aa058cb42..f72e6bb7301e 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/eeprom.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/eeprom.py @@ -51,7 +51,7 @@ os.makedirs(os.path.dirname(EEPROM_SYMLINK)) subprocess.check_call(['/usr/bin/xxd', '-r', '-p', 'syseeprom.hex', EEPROM_SYMLINK], cwd=platform_path) -WAIT_EEPROM_READY_SEC = 20 +WAIT_EEPROM_READY_SEC = 60 class Eeprom(eeprom_tlvinfo.TlvInfoDecoder): From 4280e777c9e356ff562a34d843af13772ccfd37f Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 31 May 2024 22:00:58 +0800 Subject: [PATCH 335/419] [submodule] Update submodule dhcprelay to the latest HEAD automatically (#19156) #### Why I did it src/dhcprelay ``` * c605cd4 - (HEAD -> 202311, origin/202311) [202311] Backport commit from master into 202311 (#49) (2 hours ago) [Yaqiang Zhu] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/dhcprelay | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dhcprelay b/src/dhcprelay index 5ae186f4a6c2..c605cd48e597 160000 --- a/src/dhcprelay +++ b/src/dhcprelay @@ -1 +1 @@ -Subproject commit 5ae186f4a6c25647f5ce7b4d2c884b08423455e7 +Subproject commit c605cd48e597a59806817e37963ac46b5a3dfaea From 6302aaa779579aeea14601a25a1fc578f16dd1d0 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 31 May 2024 22:01:02 +0800 Subject: [PATCH 336/419] [submodule] Update submodule dhcpmon to the latest HEAD automatically (#19155) #### Why I did it src/dhcpmon ``` * 099e148 - (HEAD -> 202311, origin/202311) Merge pull request #22 from yaqiangz/202311_cherry_pick (2 hours ago) [Ying Xie] * efff8a9 - Fix revert (#21) (2 hours ago) [kellyyeh] * 617066f - Revert DHCP Counter (#20) (2 hours ago) [kellyyeh] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/dhcpmon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dhcpmon b/src/dhcpmon index 244307304688..099e14843c3d 160000 --- a/src/dhcpmon +++ b/src/dhcpmon @@ -1 +1 @@ -Subproject commit 244307304688ada1062a36554acc1fa95610f17d +Subproject commit 099e14843c3dcf5176664a9fa0e9cb44cfedf7ce From 20be464a81a13da8c60d3dcef40e113356eec09f Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 31 May 2024 22:01:09 +0800 Subject: [PATCH 337/419] [submodule] Update submodule sonic-swss-common to the latest HEAD automatically (#19149) #### Why I did it src/sonic-swss-common ``` * 96ad341 - (HEAD -> 202311, origin/202311) [action] [PR:836] add support for binary data read for Table::get() (#836) (8 hours ago) [mssonicbld] * 9d70e50 - [ci] Use requests==2.31.0 instead of latest version to avoid test failure. (#877) (#881) (17 hours ago) [mssonicbld] ``` #### How I did it #### How to verify it #### Description for the changelog --- 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 8dc6218e8ebd..96ad341b1e4e 160000 --- a/src/sonic-swss-common +++ b/src/sonic-swss-common @@ -1 +1 @@ -Subproject commit 8dc6218e8ebdd7ca6f422fbb525137e346aa0ff0 +Subproject commit 96ad341b1e4ed5b5466308ef61f891c0245c4732 From 0cd83ab1bc19f06441b13386e3271553637f2d60 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 1 Jun 2024 16:01:15 +0800 Subject: [PATCH 338/419] [submodule] Update submodule sonic-restapi to the latest HEAD automatically (#19166) #### Why I did it src/sonic-restapi ``` * 5e39692 - (HEAD -> 202311, origin/202311) Fix buster-backports debian mirror issue. (#152) (4 hours ago) [Liu Shilong] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-restapi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-restapi b/src/sonic-restapi index ccad4a24b3ea..5e396923860b 160000 --- a/src/sonic-restapi +++ b/src/sonic-restapi @@ -1 +1 @@ -Subproject commit ccad4a24b3ea2dd1afd3391f7e99864bd1414976 +Subproject commit 5e396923860b646f40d29e71836e34fe9f8d7167 From 499caa697a4380a8a43ff265c83098a5d83aa6ce Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 1 Jun 2024 16:01:19 +0800 Subject: [PATCH 339/419] [submodule] Update submodule sonic-platform-daemons to the latest HEAD automatically (#19165) #### Why I did it src/sonic-platform-daemons ``` * 5bb903c - (HEAD -> 202311, origin/202311) Fix for #19116 [xcvrd] typo "log_notifce" results in port oper down (#493) (62 minutes ago) [Anoop Kamath] ``` #### How I did it #### How to verify it #### Description for the changelog --- 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 df0ff63099d9..5bb903c89604 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit df0ff63099d954ad53516b77295fb4366820f59f +Subproject commit 5bb903c896040e1be7ba028ab915dcbf40fc27c1 From e1f4859bf88f3eac1af84a6ff604851f15e7d906 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Mon, 3 Jun 2024 14:38:53 +0800 Subject: [PATCH 340/419] [submodule] Update submodule sonic-restapi to the latest HEAD automatically (#19176) #### Why I did it src/sonic-restapi ``` * 314e4f6 - (HEAD -> 202311, origin/202311) Fix race build option not supported issue in armhf (#150) (57 minutes ago) [xumia] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-restapi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-restapi b/src/sonic-restapi index 5e396923860b..314e4f64cc16 160000 --- a/src/sonic-restapi +++ b/src/sonic-restapi @@ -1 +1 @@ -Subproject commit 5e396923860b646f40d29e71836e34fe9f8d7167 +Subproject commit 314e4f64cc165f2f4df5eb3c0fc1109597b5fcfb From 0e17142a8fa7b3a80c9d03f570fd038feef37f2e Mon Sep 17 00:00:00 2001 From: Liu Shilong Date: Fri, 15 Dec 2023 16:25:26 +0800 Subject: [PATCH 341/419] [ci] Enable sonic-restapi build in PR validation. (#17397) Why I did it Enable sonic-restapi build in two platform to avoid build break on restapi target. Work item tracking Microsoft ADO (number only): 26048426 How I did it How to verify it --- azure-pipelines.yml | 2 ++ rules/config | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index be3f327a8289..bb316306b20c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -65,6 +65,7 @@ stages: - name: broadcom variables: swi_image: yes + INCLUDE_RESTAPI: y - name: mellanox variables: dbg_image: yes @@ -79,6 +80,7 @@ stages: timeoutInMinutes: 1200 variables: PLATFORM_ARCH: armhf + INCLUDE_RESTAPI: y - stage: Test dependsOn: BuildVS diff --git a/rules/config b/rules/config index 1adaccbc9304..5160b526ca59 100644 --- a/rules/config +++ b/rules/config @@ -147,7 +147,7 @@ INCLUDE_MGMT_FRAMEWORK = y ENABLE_HOST_SERVICE_ON_START = y # INCLUDE_RESTAPI - build docker-sonic-restapi for configuring the switch using REST APIs -INCLUDE_RESTAPI = n +INCLUDE_RESTAPI ?= n # INCLUDE_NAT - build docker-nat for nat support INCLUDE_NAT = y From d99121862a149f74311816af60be17eef3b19626 Mon Sep 17 00:00:00 2001 From: David Meggy Date: Wed, 8 May 2024 10:10:18 -0700 Subject: [PATCH 342/419] Add new 64x400G HwSku for QuicksilverP --- .../Arista-7060X6-64PE-64x400G/hwsku.json | 202 +++ .../port_config.ini | 67 + .../Arista-7060X6-64PE-64x400G/sai.profile | 1 + .../th5-a7060x6-64pe.config.bcm | 1160 +++++++++++++++++ 4 files changed, 1430 insertions(+) create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/hwsku.json create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/port_config.ini create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/sai.profile create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/th5-a7060x6-64pe.config.bcm diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/hwsku.json b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/hwsku.json new file mode 100644 index 000000000000..155c1da1d139 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/hwsku.json @@ -0,0 +1,202 @@ +{ + "interfaces": { + "Ethernet0": { + "default_brkout_mode": "1x400G" + }, + "Ethernet8": { + "default_brkout_mode": "1x400G" + }, + "Ethernet16": { + "default_brkout_mode": "1x400G" + }, + "Ethernet24": { + "default_brkout_mode": "1x400G" + }, + "Ethernet32": { + "default_brkout_mode": "1x400G" + }, + "Ethernet40": { + "default_brkout_mode": "1x400G" + }, + "Ethernet48": { + "default_brkout_mode": "1x400G" + }, + "Ethernet56": { + "default_brkout_mode": "1x400G" + }, + "Ethernet64": { + "default_brkout_mode": "1x400G" + }, + "Ethernet72": { + "default_brkout_mode": "1x400G" + }, + "Ethernet80": { + "default_brkout_mode": "1x400G" + }, + "Ethernet88": { + "default_brkout_mode": "1x400G" + }, + "Ethernet96": { + "default_brkout_mode": "1x400G" + }, + "Ethernet104": { + "default_brkout_mode": "1x400G" + }, + "Ethernet112": { + "default_brkout_mode": "1x400G" + }, + "Ethernet120": { + "default_brkout_mode": "1x400G" + }, + "Ethernet128": { + "default_brkout_mode": "1x400G" + }, + "Ethernet136": { + "default_brkout_mode": "1x400G" + }, + "Ethernet144": { + "default_brkout_mode": "1x400G" + }, + "Ethernet152": { + "default_brkout_mode": "1x400G" + }, + "Ethernet160": { + "default_brkout_mode": "1x400G" + }, + "Ethernet168": { + "default_brkout_mode": "1x400G" + }, + "Ethernet176": { + "default_brkout_mode": "1x400G" + }, + "Ethernet184": { + "default_brkout_mode": "1x400G" + }, + "Ethernet192": { + "default_brkout_mode": "1x400G" + }, + "Ethernet200": { + "default_brkout_mode": "1x400G" + }, + "Ethernet208": { + "default_brkout_mode": "1x400G" + }, + "Ethernet216": { + "default_brkout_mode": "1x400G" + }, + "Ethernet224": { + "default_brkout_mode": "1x400G" + }, + "Ethernet232": { + "default_brkout_mode": "1x400G" + }, + "Ethernet240": { + "default_brkout_mode": "1x400G" + }, + "Ethernet248": { + "default_brkout_mode": "1x400G" + }, + "Ethernet256": { + "default_brkout_mode": "1x400G" + }, + "Ethernet264": { + "default_brkout_mode": "1x400G" + }, + "Ethernet272": { + "default_brkout_mode": "1x400G" + }, + "Ethernet280": { + "default_brkout_mode": "1x400G" + }, + "Ethernet288": { + "default_brkout_mode": "1x400G" + }, + "Ethernet296": { + "default_brkout_mode": "1x400G" + }, + "Ethernet304": { + "default_brkout_mode": "1x400G" + }, + "Ethernet312": { + "default_brkout_mode": "1x400G" + }, + "Ethernet320": { + "default_brkout_mode": "1x400G" + }, + "Ethernet328": { + "default_brkout_mode": "1x400G" + }, + "Ethernet336": { + "default_brkout_mode": "1x400G" + }, + "Ethernet344": { + "default_brkout_mode": "1x400G" + }, + "Ethernet352": { + "default_brkout_mode": "1x400G" + }, + "Ethernet360": { + "default_brkout_mode": "1x400G" + }, + "Ethernet368": { + "default_brkout_mode": "1x400G" + }, + "Ethernet376": { + "default_brkout_mode": "1x400G" + }, + "Ethernet384": { + "default_brkout_mode": "1x400G" + }, + "Ethernet392": { + "default_brkout_mode": "1x400G" + }, + "Ethernet400": { + "default_brkout_mode": "1x400G" + }, + "Ethernet408": { + "default_brkout_mode": "1x400G" + }, + "Ethernet416": { + "default_brkout_mode": "1x400G" + }, + "Ethernet424": { + "default_brkout_mode": "1x400G" + }, + "Ethernet432": { + "default_brkout_mode": "1x400G" + }, + "Ethernet440": { + "default_brkout_mode": "1x400G" + }, + "Ethernet448": { + "default_brkout_mode": "1x400G" + }, + "Ethernet456": { + "default_brkout_mode": "1x400G" + }, + "Ethernet464": { + "default_brkout_mode": "1x400G" + }, + "Ethernet472": { + "default_brkout_mode": "1x400G" + }, + "Ethernet480": { + "default_brkout_mode": "1x400G" + }, + "Ethernet488": { + "default_brkout_mode": "1x400G" + }, + "Ethernet496": { + "default_brkout_mode": "1x400G" + }, + "Ethernet504": { + "default_brkout_mode": "1x400G" + }, + "Ethernet512": { + "default_brkout_mode": "1x10G" + }, + "Ethernet513": { + "default_brkout_mode": "1x10G" + } + } +} diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/port_config.ini b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/port_config.ini new file mode 100644 index 000000000000..d29a307ac8ff --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/port_config.ini @@ -0,0 +1,67 @@ +# name lanes alias index speed fec +Ethernet0 17,18,19,20,21,22,23,24 Ethernet1/1 1 400000 rs +Ethernet8 1,2,3,4,5,6,7,8 Ethernet2/1 2 400000 rs +Ethernet16 9,10,11,12,13,14,15,16 Ethernet3/1 3 400000 rs +Ethernet24 25,26,27,28,29,30,31,32 Ethernet4/1 4 400000 rs +Ethernet32 57,58,59,60,61,62,63,64 Ethernet5/1 5 400000 rs +Ethernet40 41,42,43,44,45,46,47,48 Ethernet6/1 6 400000 rs +Ethernet48 33,34,35,36,37,38,39,40 Ethernet7/1 7 400000 rs +Ethernet56 49,50,51,52,53,54,55,56 Ethernet8/1 8 400000 rs +Ethernet64 89,90,91,92,93,94,95,96 Ethernet9/1 9 400000 rs +Ethernet72 73,74,75,76,77,78,79,80 Ethernet10/1 10 400000 rs +Ethernet80 65,66,67,68,69,70,71,72 Ethernet11/1 11 400000 rs +Ethernet88 81,82,83,84,85,86,87,88 Ethernet12/1 12 400000 rs +Ethernet96 121,122,123,124,125,126,127,128 Ethernet13/1 13 400000 rs +Ethernet104 105,106,107,108,109,110,111,112 Ethernet14/1 14 400000 rs +Ethernet112 97,98,99,100,101,102,103,104 Ethernet15/1 15 400000 rs +Ethernet120 113,114,115,116,117,118,119,120 Ethernet16/1 16 400000 rs +Ethernet128 153,154,155,156,157,158,159,160 Ethernet17/1 17 400000 rs +Ethernet136 137,138,139,140,141,142,143,144 Ethernet18/1 18 400000 rs +Ethernet144 129,130,131,132,133,134,135,136 Ethernet19/1 19 400000 rs +Ethernet152 145,146,147,148,149,150,151,152 Ethernet20/1 20 400000 rs +Ethernet160 185,186,187,188,189,190,191,192 Ethernet21/1 21 400000 rs +Ethernet168 169,170,171,172,173,174,175,176 Ethernet22/1 22 400000 rs +Ethernet176 161,162,163,164,165,166,167,168 Ethernet23/1 23 400000 rs +Ethernet184 177,178,179,180,181,182,183,184 Ethernet24/1 24 400000 rs +Ethernet192 217,218,219,220,221,222,223,224 Ethernet25/1 25 400000 rs +Ethernet200 201,202,203,204,205,206,207,208 Ethernet26/1 26 400000 rs +Ethernet208 193,194,195,196,197,198,199,200 Ethernet27/1 27 400000 rs +Ethernet216 209,210,211,212,213,214,215,216 Ethernet28/1 28 400000 rs +Ethernet224 249,250,251,252,253,254,255,256 Ethernet29/1 29 400000 rs +Ethernet232 233,234,235,236,237,238,239,240 Ethernet30/1 30 400000 rs +Ethernet240 225,226,227,228,229,230,231,232 Ethernet31/1 31 400000 rs +Ethernet248 241,242,243,244,245,246,247,248 Ethernet32/1 32 400000 rs +Ethernet256 273,274,275,276,277,278,279,280 Ethernet33/1 33 400000 rs +Ethernet264 257,258,259,260,261,262,263,264 Ethernet34/1 34 400000 rs +Ethernet272 265,266,267,268,269,270,271,272 Ethernet35/1 35 400000 rs +Ethernet280 281,282,283,284,285,286,287,288 Ethernet36/1 36 400000 rs +Ethernet288 313,314,315,316,317,318,319,320 Ethernet37/1 37 400000 rs +Ethernet296 297,298,299,300,301,302,303,304 Ethernet38/1 38 400000 rs +Ethernet304 289,290,291,292,293,294,295,296 Ethernet39/1 39 400000 rs +Ethernet312 305,306,307,308,309,310,311,312 Ethernet40/1 40 400000 rs +Ethernet320 345,346,347,348,349,350,351,352 Ethernet41/1 41 400000 rs +Ethernet328 329,330,331,332,333,334,335,336 Ethernet42/1 42 400000 rs +Ethernet336 321,322,323,324,325,326,327,328 Ethernet43/1 43 400000 rs +Ethernet344 337,338,339,340,341,342,343,344 Ethernet44/1 44 400000 rs +Ethernet352 377,378,379,380,381,382,383,384 Ethernet45/1 45 400000 rs +Ethernet360 361,362,363,364,365,366,367,368 Ethernet46/1 46 400000 rs +Ethernet368 353,354,355,356,357,358,359,360 Ethernet47/1 47 400000 rs +Ethernet376 369,370,371,372,373,374,375,376 Ethernet48/1 48 400000 rs +Ethernet384 409,410,411,412,413,414,415,416 Ethernet49/1 49 400000 rs +Ethernet392 393,394,395,396,397,398,399,400 Ethernet50/1 50 400000 rs +Ethernet400 385,386,387,388,389,390,391,392 Ethernet51/1 51 400000 rs +Ethernet408 401,402,403,404,405,406,407,408 Ethernet52/1 52 400000 rs +Ethernet416 441,442,443,444,445,446,447,448 Ethernet53/1 53 400000 rs +Ethernet424 425,426,427,428,429,430,431,432 Ethernet54/1 54 400000 rs +Ethernet432 417,418,419,420,421,422,423,424 Ethernet55/1 55 400000 rs +Ethernet440 433,434,435,436,437,438,439,440 Ethernet56/1 56 400000 rs +Ethernet448 473,474,475,476,477,478,479,480 Ethernet57/1 57 400000 rs +Ethernet456 457,458,459,460,461,462,463,464 Ethernet58/1 58 400000 rs +Ethernet464 449,450,451,452,453,454,455,456 Ethernet59/1 59 400000 rs +Ethernet472 465,466,467,468,469,470,471,472 Ethernet60/1 60 400000 rs +Ethernet480 505,506,507,508,509,510,511,512 Ethernet61/1 61 400000 rs +Ethernet488 489,490,491,492,493,494,495,496 Ethernet62/1 62 400000 rs +Ethernet496 481,482,483,484,485,486,487,488 Ethernet63/1 63 400000 rs +Ethernet504 497,498,499,500,501,502,503,504 Ethernet64/1 64 400000 rs +Ethernet512 513 Ethernet65 65 10000 none +Ethernet513 515 Ethernet66 66 10000 none diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/sai.profile b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/sai.profile new file mode 100644 index 000000000000..50c136d97b24 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/sai.profile @@ -0,0 +1 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th5-a7060x6-64pe.config.bcm diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/th5-a7060x6-64pe.config.bcm b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/th5-a7060x6-64pe.config.bcm new file mode 100644 index 000000000000..a8f3023f96ce --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/th5-a7060x6-64pe.config.bcm @@ -0,0 +1,1160 @@ +# +# $Copyright: (c) 2022 Broadcom. +# Broadcom Proprietary and Confidential. All rights reserved.$ +# +# BCM78900 64x800g port configuration. +# +# configuration yaml file +# device: +# : +#
: +# ? +# : +# : +# ... +# : +# : +# : +# : +# ... +# : +# + +--- +bcm_device: + 0: + global: + pktio_mode: 1 + default_cpu_tx_queue: 7 + vlan_flooding_l2mc_num_reserved: 0 + ipv6_lpm_128b_enable: 1 + shared_block_mask_section: uc_bc + skip_protocol_default_entries: 1 + # LTSW uses value 1 for ALPM combined mode + l3_alpm_template: 1 + l3_alpm_hit_skip: 1 + sai_feat_tail_timestamp : 1 + sai_port_phy_time_sync_en : 1 + sai_field_group_auto_prioritize: 1 + #l3_intf_vlan_split_egress for MTU at L3IF + l3_intf_vlan_split_egress : 1 + pfc_deadlock_seq_control : 1 + sai_tunnel_support: 2 + bcm_tunnel_term_compatible_mode: 1 + l3_ecmp_member_first_lkup_mem_size: 12288 +--- +device: + 0: + PC_PM_CORE: + ? + PC_PM_ID: 3 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0x66 + TX_POLARITY_FLIP: 0xaa + ? + PC_PM_ID: 1 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0x26 + TX_POLARITY_FLIP: 0xaa + ? + PC_PM_ID: 2 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x55 + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 4 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x55 + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 8 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 6 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xb6 + ? + PC_PM_ID: 5 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x23016745 + TX_LANE_MAP: 0x54670123 + RX_POLARITY_FLIP: 0x97 + TX_POLARITY_FLIP: 0x35 + ? + PC_PM_ID: 7 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 12 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 10 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 9 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 11 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 16 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 14 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 13 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 15 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 20 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 18 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 17 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 19 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 24 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 22 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 21 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 23 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 28 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x31204675 + TX_LANE_MAP: 0x47561203 + RX_POLARITY_FLIP: 0x11 + TX_POLARITY_FLIP: 0x2b + ? + PC_PM_ID: 26 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 25 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 27 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0x9a + ? + PC_PM_ID: 32 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0xff + ? + PC_PM_ID: 30 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0xff + ? + PC_PM_ID: 29 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 31 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 35 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0x00 + ? + PC_PM_ID: 33 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0x00 + ? + PC_PM_ID: 34 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 36 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 40 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 38 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0x9a + ? + PC_PM_ID: 37 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x31204675 + TX_LANE_MAP: 0x47561203 + RX_POLARITY_FLIP: 0x11 + TX_POLARITY_FLIP: 0x2b + ? + PC_PM_ID: 39 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 44 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 42 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 41 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 43 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 48 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 46 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 45 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 47 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 52 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 50 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 49 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 51 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 56 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 54 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 53 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 55 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 60 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x23016745 + TX_LANE_MAP: 0x54670123 + RX_POLARITY_FLIP: 0x97 + TX_POLARITY_FLIP: 0x35 + ? + PC_PM_ID: 58 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 57 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 59 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xb6 + ? + PC_PM_ID: 64 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x67 + TX_POLARITY_FLIP: 0x55 + ? + PC_PM_ID: 62 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x66 + TX_POLARITY_FLIP: 0x55 + ? + PC_PM_ID: 61 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0xaa + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 63 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0xaa + TX_POLARITY_FLIP: 0x66 +--- +device: + 0: + PC_PORT_PHYS_MAP: + ? + PORT_ID: 1 + : + PC_PHYS_PORT_ID: 1 + ? + PORT_ID: 2 + : + PC_PHYS_PORT_ID: 9 + ? + PORT_ID: 11 + : + PC_PHYS_PORT_ID: 17 + ? + PORT_ID: 12 + : + PC_PHYS_PORT_ID: 25 + ? + PORT_ID: 22 + : + PC_PHYS_PORT_ID: 33 + ? + PORT_ID: 23 + : + PC_PHYS_PORT_ID: 41 + ? + PORT_ID: 33 + : + PC_PHYS_PORT_ID: 49 + ? + PORT_ID: 34 + : + PC_PHYS_PORT_ID: 57 + ? + PORT_ID: 44 + : + PC_PHYS_PORT_ID: 65 + ? + PORT_ID: 45 + : + PC_PHYS_PORT_ID: 73 + ? + PORT_ID: 55 + : + PC_PHYS_PORT_ID: 81 + ? + PORT_ID: 56 + : + PC_PHYS_PORT_ID: 89 + ? + PORT_ID: 66 + : + PC_PHYS_PORT_ID: 97 + ? + PORT_ID: 67 + : + PC_PHYS_PORT_ID: 105 + ? + PORT_ID: 77 + : + PC_PHYS_PORT_ID: 113 + ? + PORT_ID: 78 + : + PC_PHYS_PORT_ID: 121 + ? + PORT_ID: 88 + : + PC_PHYS_PORT_ID: 129 + ? + PORT_ID: 89 + : + PC_PHYS_PORT_ID: 137 + ? + PORT_ID: 99 + : + PC_PHYS_PORT_ID: 145 + ? + PORT_ID: 100 + : + PC_PHYS_PORT_ID: 153 + ? + PORT_ID: 110 + : + PC_PHYS_PORT_ID: 161 + ? + PORT_ID: 111 + : + PC_PHYS_PORT_ID: 169 + ? + PORT_ID: 121 + : + PC_PHYS_PORT_ID: 177 + ? + PORT_ID: 122 + : + PC_PHYS_PORT_ID: 185 + ? + PORT_ID: 132 + : + PC_PHYS_PORT_ID: 193 + ? + PORT_ID: 133 + : + PC_PHYS_PORT_ID: 201 + ? + PORT_ID: 143 + : + PC_PHYS_PORT_ID: 209 + ? + PORT_ID: 144 + : + PC_PHYS_PORT_ID: 217 + ? + PORT_ID: 154 + : + PC_PHYS_PORT_ID: 225 + ? + PORT_ID: 155 + : + PC_PHYS_PORT_ID: 233 + ? + PORT_ID: 165 + : + PC_PHYS_PORT_ID: 241 + ? + PORT_ID: 166 + : + PC_PHYS_PORT_ID: 249 + ? + PORT_ID: 176 + : + PC_PHYS_PORT_ID: 257 + ? + PORT_ID: 177 + : + PC_PHYS_PORT_ID: 265 + ? + PORT_ID: 187 + : + PC_PHYS_PORT_ID: 273 + ? + PORT_ID: 188 + : + PC_PHYS_PORT_ID: 281 + ? + PORT_ID: 198 + : + PC_PHYS_PORT_ID: 289 + ? + PORT_ID: 199 + : + PC_PHYS_PORT_ID: 297 + ? + PORT_ID: 209 + : + PC_PHYS_PORT_ID: 305 + ? + PORT_ID: 210 + : + PC_PHYS_PORT_ID: 313 + ? + PORT_ID: 220 + : + PC_PHYS_PORT_ID: 321 + ? + PORT_ID: 221 + : + PC_PHYS_PORT_ID: 329 + ? + PORT_ID: 231 + : + PC_PHYS_PORT_ID: 337 + ? + PORT_ID: 232 + : + PC_PHYS_PORT_ID: 345 + ? + PORT_ID: 242 + : + PC_PHYS_PORT_ID: 353 + ? + PORT_ID: 243 + : + PC_PHYS_PORT_ID: 361 + ? + PORT_ID: 253 + : + PC_PHYS_PORT_ID: 369 + ? + PORT_ID: 254 + : + PC_PHYS_PORT_ID: 377 + ? + PORT_ID: 264 + : + PC_PHYS_PORT_ID: 385 + ? + PORT_ID: 265 + : + PC_PHYS_PORT_ID: 393 + ? + PORT_ID: 275 + : + PC_PHYS_PORT_ID: 401 + ? + PORT_ID: 276 + : + PC_PHYS_PORT_ID: 409 + ? + PORT_ID: 286 + : + PC_PHYS_PORT_ID: 417 + ? + PORT_ID: 287 + : + PC_PHYS_PORT_ID: 425 + ? + PORT_ID: 297 + : + PC_PHYS_PORT_ID: 433 + ? + PORT_ID: 298 + : + PC_PHYS_PORT_ID: 441 + ? + PORT_ID: 308 + : + PC_PHYS_PORT_ID: 449 + ? + PORT_ID: 309 + : + PC_PHYS_PORT_ID: 457 + ? + PORT_ID: 319 + : + PC_PHYS_PORT_ID: 465 + ? + PORT_ID: 320 + : + PC_PHYS_PORT_ID: 473 + ? + PORT_ID: 330 + : + PC_PHYS_PORT_ID: 481 + ? + PORT_ID: 331 + : + PC_PHYS_PORT_ID: 489 + ? + PORT_ID: 341 + : + PC_PHYS_PORT_ID: 497 + ? + PORT_ID: 342 + : + PC_PHYS_PORT_ID: 505 + ? + PORT_ID: 76 + : + PC_PHYS_PORT_ID: 513 + ? + PORT_ID: 274 + : + PC_PHYS_PORT_ID: 515 +... +--- +device: + 0: + PC_PORT: + ? + PORT_ID: [[1, 2], + [11, 12], + [22, 23], + [33, 34], + [44, 45], + [55, 56], + [66, 67], + [77, 78], + [88, 89], + [99, 100], + [110, 111], + [121, 122], + [132, 133], + [143, 144], + [154, 155], + [165, 166], + [176, 177], + [187, 188], + [198, 199], + [209, 210], + [220, 221], + [231, 232], + [242, 243], + [253, 254], + [264, 265], + [275, 276], + [286, 287], + [297, 298], + [308, 309], + [319, 320], + [330, 331], + [341, 342]] + : + ENABLE: 1 + SPEED: 400000 + NUM_LANES: 8 + FEC_MODE: PC_FEC_RS544_2XN + MAX_FRAME_SIZE: 9416 + ? + PORT_ID: [[76, 76], [274, 274]] + : + ENABLE: 0 + MAX_FRAME_SIZE: 9416 + SPEED: 10000 + NUM_LANES: 1 +... +--- +bcm_device: + 0: + global: + ftem_mem_entries: 65536 +... +--- +device: + 0: + # Per pipe flex counter configuration + CTR_EFLEX_CONFIG: + CTR_ING_EFLEX_OPERMODE_PIPEUNIQUE: 0 + CTR_EGR_EFLEX_OPERMODE_PIPEUNIQUE: 0 + + # IFP mode + FP_CONFIG: + FP_ING_OPERMODE: GLOBAL_PIPE_AWARE +... +--- +device: + 0: + DEVICE_CONFIG: + AUTOLOAD_BOARD_SETTINGS: 0 +... From 45c1ea65dc3cd657c1cdab784d14cc4d592b57bf Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 4 Jun 2024 16:29:02 +0800 Subject: [PATCH 343/419] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#19187) #### Why I did it src/sonic-utilities ``` * f35453ea - (HEAD -> 202311, origin/202311) Backup STATE_DB PORT_TABLE|Ethernet during warm-reboot (#3111) (10 hours ago) [mihirpat1] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index ce699c49a91e..f35453ea9175 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit ce699c49a91e7f80c321966c0d7cff268473c9c1 +Subproject commit f35453ea9175a11ed9ce224ce31e3399e4ab67fd From 37e967f4732bf89e3e68617fb4d1bb73c87f1c06 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 4 Jun 2024 16:29:07 +0800 Subject: [PATCH 344/419] [submodule] Update submodule sonic-swss-common to the latest HEAD automatically (#19186) #### Why I did it src/sonic-swss-common ``` * dea9561 - (HEAD -> 202311, origin/202311) [swig]: Fix swig template memory leak on issue 17025 (#876) (#878) (10 hours ago) [Ze Gan] ``` #### How I did it #### How to verify it #### Description for the changelog --- 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 96ad341b1e4e..dea9561af55c 160000 --- a/src/sonic-swss-common +++ b/src/sonic-swss-common @@ -1 +1 @@ -Subproject commit 96ad341b1e4ed5b5466308ef61f891c0245c4732 +Subproject commit dea9561af55cebecec261490eaaf09c26d53ad9f From fecfcf79d4e1f85a772833e61c9cc6ce8b612a7c Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 4 Jun 2024 16:29:11 +0800 Subject: [PATCH 345/419] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#19185) #### Why I did it src/sonic-swss ``` * e61e95f8 - (HEAD -> 202311, origin/202311) change log level from ERR to WARN for pfc asym sai attribute not supported (#3125) (7 hours ago) [Zhixin Zhu] * 5a998b6e - Handle learning duplicate IPs on different VRFs (#3165) (#3179) (10 hours ago) [Lawrence Lee] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 5075e660fb56..e61e95f86c4f 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 5075e660fb56c3447da9118f3820e618687b8889 +Subproject commit e61e95f86c4f51eac3512222052ab71e9fcfce9f From 9c80122251dd0953e8900140e42db8c72313d0e6 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 5 Jun 2024 01:17:10 +0800 Subject: [PATCH 346/419] [ci/build]: Upgrade SONiC package versions (#19170) --- files/build/versions/default/versions-git | 8 ++++---- files/build/versions/default/versions-mirror | 20 +++++++++---------- .../dockers/docker-ptf/versions-deb-buster | 4 ++-- .../versions-deb-bullseye | 6 +++--- .../sonic-slave-buster/versions-deb-buster | 6 +++--- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index 570b3cf54678..e368772ed091 100644 --- a/files/build/versions/default/versions-git +++ b/files/build/versions/default/versions-git @@ -1,10 +1,10 @@ -https://chromium.googlesource.com/chromium/tools/depot_tools.git==73a5b5cf7bb96fe7f56c6892cb887063629b74cc +https://chromium.googlesource.com/chromium/tools/depot_tools.git==840e538154a92136133a68b33a050e99266f40fd https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f https://github.com/CESNET/libyang.git==4c733412e7173219166be7053940326a92699765 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==35a2168c323a30317156eb5b5d5a56b4811dd9af +https://github.com/flashrom/flashrom.git==47de5d71bc5389554f73382fba82173a295678e0 https://github.com/FreeRADIUS/freeradius-server.git==f1dc7b44fb32830c644feda95003b56bfcca3016 https://github.com/FreeRADIUS/pam_radius.git==d802da75cbfc3062ae1b18d0bf26ac2a030ffdaa https://github.com/jeroennijhof/pam_tacplus.git==b839c440e33c36eced9dcbc287fcfe6237c4c4ce @@ -16,8 +16,8 @@ https://github.com/p4lang/ptf.git==c554f83685186be4cfa9387eb5d6d700d2bbd7c0 https://github.com/p4lang/scapy-vxlan.git==85ffe83da156568ee47a0750f638227e6e1d7479 https://github.com/sflow/host-sflow==a3ce4814bb6673a314142183e22c0e710cd21292 https://github.com/sflow/sflowtool==c42c49cb80b927a4c02e54fc26430417f18f4833 -https://github.com/thom311/libnl==49f7822961f5bc6b18cd2a2d3f3b8d2ab0896d3f +https://github.com/thom311/libnl==5248e1a45576617b349465997822cef34cbc5053 https://salsa.debian.org/debian/libteam.git==48142125234a665ad5367b724af36a58fb484d3d -https://salsa.debian.org/kernel-team/initramfs-tools.git==4797c54c5f2a1f8659bac53aa6259a63573f0a83 +https://salsa.debian.org/kernel-team/initramfs-tools.git==84e5c0f7dac1a17e980ed8dfb0e0e8729d9388db https://salsa.debian.org/sk-guest/monit.git==c9da7ebb1f35dfba17b50b5969a6e75e29cbec0d https://salsa.debian.org/ssh-team/openssh.git==096572ea878f93fe2c85d8e86e43e2281f3f46d7 diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index 65cfe4bac23b..7e021f29436a 100644 --- a/files/build/versions/default/versions-mirror +++ b/files/build/versions/default/versions-mirror @@ -1,14 +1,14 @@ 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==20240528T000406Z -debian-security==20240528T000421Z +debian==20240601T000313Z +debian-security==20240602T000736Z download.docker.com_linux_debian_dists_bullseye==2024-05-28T14:05:22Z download.docker.com_linux_debian_dists_buster==2024-05-23T13:29:25Z -packages.trafficmanager.net_snapshot_debian-security_20240528T000421Z_dists_bullseye-security==2024-05-27T18:32:57Z -packages.trafficmanager.net_snapshot_debian-security_20240528T000421Z_dists_buster_updates==2024-05-27T18:32:57Z -packages.trafficmanager.net_snapshot_debian_20240528T000406Z_dists_bullseye==2024-02-10T12:40:37Z -packages.trafficmanager.net_snapshot_debian_20240528T000406Z_dists_bullseye-backports==2024-05-27T20:16:19Z -packages.trafficmanager.net_snapshot_debian_20240528T000406Z_dists_bullseye-updates==2024-05-27T20:16:19Z -packages.trafficmanager.net_snapshot_debian_20240528T000406Z_dists_buster==2023-06-10T08:53:33Z -packages.trafficmanager.net_snapshot_debian_20240528T000406Z_dists_buster-backports==2024-03-09T20:54:54Z -packages.trafficmanager.net_snapshot_debian_20240528T000406Z_dists_buster-updates==2023-06-10T08:55:10Z +packages.trafficmanager.net_snapshot_debian-security_20240602T000736Z_dists_bullseye-security==2024-06-01T07:16:33Z +packages.trafficmanager.net_snapshot_debian-security_20240602T000736Z_dists_buster_updates==2024-06-01T07:16:33Z +packages.trafficmanager.net_snapshot_debian_20240601T000313Z_dists_bullseye==2024-02-10T12:40:37Z +packages.trafficmanager.net_snapshot_debian_20240601T000313Z_dists_bullseye-backports==2024-05-31T20:12:00Z +packages.trafficmanager.net_snapshot_debian_20240601T000313Z_dists_bullseye-updates==2024-05-31T20:12:00Z +packages.trafficmanager.net_snapshot_debian_20240601T000313Z_dists_buster==2023-06-10T08:53:33Z +packages.trafficmanager.net_snapshot_debian_20240601T000313Z_dists_buster-backports==2024-03-09T20:54:54Z +packages.trafficmanager.net_snapshot_debian_20240601T000313Z_dists_buster-updates==2023-06-10T08:55:10Z diff --git a/files/build/versions/dockers/docker-ptf/versions-deb-buster b/files/build/versions/dockers/docker-ptf/versions-deb-buster index d5d605ec42d6..b264b35a4f05 100644 --- a/files/build/versions/dockers/docker-ptf/versions-deb-buster +++ b/files/build/versions/dockers/docker-ptf/versions-deb-buster @@ -63,7 +63,7 @@ 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+deb10u2 +gstreamer1.0-plugins-base==1.14.4-2+deb10u3 gtk-update-icon-cache==3.24.5-1 hicolor-icon-theme==0.17-2 hping3==3.a2.ds2-7 @@ -187,7 +187,7 @@ libgraphite2-3==1.3.13-7 libgs9==9.27~dfsg-2+deb10u9 libgs9-common==9.27~dfsg-2+deb10u9 libgssapi-krb5-2==1.17-3+deb10u6 -libgstreamer-plugins-base1.0-0==1.14.4-2+deb10u2 +libgstreamer-plugins-base1.0-0==1.14.4-2+deb10u3 libgstreamer1.0-0==1.14.4-1 libgtk-3-0==3.24.5-1 libgtk-3-bin==3.24.5-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 d73886530503..cbae53b68ef0 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye @@ -194,9 +194,9 @@ gsasl-common==1.10.0-4+deb11u1 gsettings-desktop-schemas==3.38.0-2 gsfonts==1:8.11+urwcyr1.0.7~pre44-4.5 gstreamer1.0-libav==1.18.4-3 -gstreamer1.0-plugins-base==1.18.4-2+deb11u1 +gstreamer1.0-plugins-base==1.18.4-2+deb11u2 gstreamer1.0-plugins-good==1.18.4-2+deb11u2 -gstreamer1.0-x==1.18.4-2+deb11u1 +gstreamer1.0-x==1.18.4-2+deb11u2 gtk-update-icon-cache==3.24.24-4+deb11u3 guile-2.2-libs==2.2.7+1-6 hicolor-icon-theme==0.17-2 @@ -643,7 +643,7 @@ libgs9-common==9.53.3~dfsg-7+deb11u7 libgsasl7==1.10.0-4+deb11u1 libgsm1==1.0.18-2 libgssrpc4==1.18.3-6+deb11u4 -libgstreamer-plugins-base1.0-0==1.18.4-2+deb11u1 +libgstreamer-plugins-base1.0-0==1.18.4-2+deb11u2 libgstreamer1.0-0==1.18.4-2.1 libgtest-dev==1.10.0.20201025-1.1 libgtk-3-0==3.24.24-4+deb11u3 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 39cce43cb3e5..fefd5c3294fb 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster @@ -179,10 +179,10 @@ groff-base==1.22.4-3+deb10u1 gsettings-desktop-schemas==3.28.1-1 gsfonts==1:8.11+urwcyr1.0.7~pre44-4.4 gstreamer1.0-libav==1.15.0.1+git20180723+db823502-2+deb10u1 -gstreamer1.0-plugins-base==1.14.4-2+deb10u2 +gstreamer1.0-plugins-base==1.14.4-2+deb10u3 gstreamer1.0-plugins-good==1.14.4-1+deb10u3 gstreamer1.0-plugins-ugly==1.14.4-1+deb10u2 -gstreamer1.0-x==1.14.4-2+deb10u2 +gstreamer1.0-x==1.14.4-2+deb10u3 gtk-update-icon-cache==3.24.5-1 guile-2.0-libs==2.0.13+1-5.1 hicolor-icon-theme==0.17-2 @@ -594,7 +594,7 @@ libgs9-common==9.27~dfsg-2+deb10u9 libgsm1==1.0.18-2 libgssapi-krb5-2==1.17-3+deb10u6 libgssrpc4==1.17-3+deb10u6 -libgstreamer-plugins-base1.0-0==1.14.4-2+deb10u2 +libgstreamer-plugins-base1.0-0==1.14.4-2+deb10u3 libgstreamer1.0-0==1.14.4-1 libgtest-dev==1.8.1-3 libgtk-3-0==3.24.5-1 From 9822879db6bcc2f12852b8361f9bda758b5c2728 Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Tue, 4 Jun 2024 11:12:00 -0700 Subject: [PATCH 347/419] [202311][Mellanox]Updating SDK/FW to 4.6.4062/2012.4062 SAI to SAIBuild2311.28.0.13 (#19194) --- platform/mellanox/fw.mk | 12 ++++++------ platform/mellanox/mlnx-sai.mk | 2 +- platform/mellanox/sdk.mk | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/platform/mellanox/fw.mk b/platform/mellanox/fw.mk index 7bfdee4026b4..66153be91c16 100644 --- a/platform/mellanox/fw.mk +++ b/platform/mellanox/fw.mk @@ -21,33 +21,33 @@ MLNX_FW_BASE_PATH = $(MLNX_SDK_BASE_PATH) # Place an URL here to FW if you want to download FW instead MLNX_FW_BASE_URL = -SIMX_VERSION = 23.10-1123 +SIMX_VERSION = 24.4-1091 FW_FROM_URL = y -MLNX_FW_ASSETS_RELEASE_TAG = fw-2012.2202 +MLNX_FW_ASSETS_RELEASE_TAG = fw-2012.4062 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.2012.2202 +MLNX_SPC_FW_VERSION = 13.2012.4062 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.2012.2202 +MLNX_SPC2_FW_VERSION = 29.2012.4062 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.2012.2202 +MLNX_SPC3_FW_VERSION = 30.2012.4062 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) -MLNX_SPC4_FW_VERSION = 34.2012.2202 +MLNX_SPC4_FW_VERSION = 34.2012.4062 MLNX_SPC4_FW_FILE = fw-SPC4-rel-$(subst .,_,$(MLNX_SPC4_FW_VERSION))-EVB.mfa $(MLNX_SPC4_FW_FILE)_PATH = $(MLNX_FW_BASE_PATH) $(MLNX_SPC4_FW_FILE)_URL = $(MLNX_FW_BASE_URL)/$(MLNX_SPC4_FW_FILE) diff --git a/platform/mellanox/mlnx-sai.mk b/platform/mellanox/mlnx-sai.mk index 89f696bcd238..73ca93a3eb43 100644 --- a/platform/mellanox/mlnx-sai.mk +++ b/platform/mellanox/mlnx-sai.mk @@ -1,6 +1,6 @@ # Mellanox SAI -MLNX_SAI_VERSION = SAIBuild2311.26.0.28 +MLNX_SAI_VERSION = SAIBuild2311.28.0.13 MLNX_SAI_ASSETS_GITHUB_URL = https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins MLNX_SAI_ASSETS_RELEASE_TAG = sai-$(MLNX_SAI_VERSION)-$(BLDENV)-$(CONFIGURED_ARCH) MLNX_SAI_ASSETS_URL = $(MLNX_ASSETS_GITHUB_URL)/releases/download/$(MLNX_SAI_ASSETS_RELEASE_TAG) diff --git a/platform/mellanox/sdk.mk b/platform/mellanox/sdk.mk index d91823d41d46..15ccedc7b606 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.6.2202 +MLNX_SDK_VERSION = 4.6.4062 MLNX_SDK_ISSU_VERSION = 101 MLNX_SDK_DRIVERS_GITHUB_URL = https://github.com/Mellanox/Spectrum-SDK-Drivers From 43bcca75f0eb1d3ef657f623574cb28c1aa59633 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Fri, 31 May 2024 08:49:19 +0800 Subject: [PATCH 348/419] [Mellanox] upgrade MFT tool to 4.28.0-96 (#19139) Upgrade MFT tool to 4.28.0-96 --- platform/mellanox/mft.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/mellanox/mft.mk b/platform/mellanox/mft.mk index c118f63a2aa9..c9d74a4df079 100644 --- a/platform/mellanox/mft.mk +++ b/platform/mellanox/mft.mk @@ -1,5 +1,5 @@ # -# Copyright (c) 2016-2023 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2016-2024 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,8 +16,8 @@ # # Mellanox MFT -MFT_VERSION = 4.27.0 -MFT_REVISION = 83 +MFT_VERSION = 4.28.0 +MFT_REVISION = 96 MLNX_MFT_INTERNAL_SOURCE_BASE_URL = From ae807e06fbcd21c507daa0afbeeec19a52b53a81 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 5 Jun 2024 16:25:44 +0800 Subject: [PATCH 349/419] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#19202) #### Why I did it src/sonic-swss ``` * 9e2df9a9 - (HEAD -> 202311, origin/202311) Do not apply QoS mapping item on the switch until the object is created (#3163) (10 hours ago) [Stephen Sun] * c52f0840 - Update setHostTxReady() to receive Port instead of portId (#3133) (#3157) (10 hours ago) [noaOrMlnx] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index e61e95f86c4f..9e2df9a9d00e 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit e61e95f86c4f51eac3512222052ab71e9fcfce9f +Subproject commit 9e2df9a9d00ed428a7e7854d8d242d214ed38c6c From 35fb0904ea715df79b3918167f8a7ebc18ea7092 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 5 Jun 2024 22:38:38 +0800 Subject: [PATCH 350/419] [ci/build]: Upgrade SONiC package versions (#19205) --- .../versions-deb-bullseye | 36 ++++++------- .../versions-py3-all-arm64 | 1 + files/build/versions/default/versions-git | 6 +-- files/build/versions/default/versions-mirror | 20 +++---- files/build/versions/default/versions-web | 52 +++++++++---------- .../versions-deb-bullseye-arm64 | 2 +- .../versions-deb-bullseye-armhf | 2 +- .../versions-deb-bullseye | 2 +- .../versions-deb-bullseye | 20 +++---- .../docker-platform-monitor/versions-py3 | 2 +- .../docker-sonic-vs/versions-deb-bullseye | 2 +- .../versions-deb-bullseye | 2 +- .../versions-deb-bullseye | 2 +- .../versions-deb-bullseye | 2 +- .../docker-syncd-mlnx/versions-deb-bullseye | 42 +++++++-------- .../dockers/docker-syncd-mlnx/versions-py3 | 2 +- .../versions-deb-bullseye | 12 ++--- .../versions-deb-bullseye-arm64 | 4 +- .../versions-deb-bullseye-armhf | 6 +-- .../versions/host-image/versions-deb-bullseye | 12 ++--- .../host-image/versions-deb-bullseye-arm64 | 2 +- .../host-image/versions-deb-bullseye-armhf | 2 +- 22 files changed, 117 insertions(+), 116 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 413b56edae6a..accd89cab7dc 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,6 +1,6 @@ -applibs==1.mlnx.4.6.2202 -applibs-dev==1.mlnx.4.6.2202 -kernel-mft-dkms==4.27.0-83 +applibs==1.mlnx.4.6.4062 +applibs-dev==1.mlnx.4.6.4062 +kernel-mft-dkms==4.28.0-96 libdashapi==1.0.0 libnl-3-dev==3.5.0-1 libnl-cli-3-200==3.5.0-1 @@ -46,19 +46,19 @@ sonic-mgmt-common==1.0.0 sonic-mgmt-common-codegen==1.0.0 sonic-platform-pddf==1.1 sonic-platform-pddf-sym==1.1 -sx-acl-helper==1.mlnx.4.6.2202 -sx-acl-helper-dev==1.mlnx.4.6.2202 -sx-complib==1.mlnx.4.6.2202 -sx-complib-dev==1.mlnx.4.6.2202 -sx-examples==1.mlnx.4.6.2202 -sx-examples-dev==1.mlnx.4.6.2202 -sx-gen-utils==1.mlnx.4.6.2202 -sx-gen-utils-dev==1.mlnx.4.6.2202 -sx-hash-calc==1.mlnx.4.6.2202 -sx-obj-desc-lib==1.mlnx.4.6.2202 -sx-obj-desc-lib-dev==1.mlnx.4.6.2202 -sxd-libs==1.mlnx.4.6.2202 -sxd-libs-dev==1.mlnx.4.6.2202 +sx-acl-helper==1.mlnx.4.6.4062 +sx-acl-helper-dev==1.mlnx.4.6.4062 +sx-complib==1.mlnx.4.6.4062 +sx-complib-dev==1.mlnx.4.6.4062 +sx-examples==1.mlnx.4.6.4062 +sx-examples-dev==1.mlnx.4.6.4062 +sx-gen-utils==1.mlnx.4.6.4062 +sx-gen-utils-dev==1.mlnx.4.6.4062 +sx-hash-calc==1.mlnx.4.6.4062 +sx-obj-desc-lib==1.mlnx.4.6.4062 +sx-obj-desc-lib-dev==1.mlnx.4.6.4062 +sxd-libs==1.mlnx.4.6.4062 +sxd-libs-dev==1.mlnx.4.6.4062 thrift-compiler==0.11.0-4 -wjh-libs==1.mlnx.4.6.2202 -wjh-libs-dev==1.mlnx.4.6.2202 +wjh-libs==1.mlnx.4.6.4062 +wjh-libs-dev==1.mlnx.4.6.4062 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 b80f4ad9b36d..44a337154808 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 @@ -3,3 +3,4 @@ bitarray==1.5.3 click==7.0 requests==2.31.0 urllib3==2.0.5 +zipp==1.2.0 diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index e368772ed091..34e44d659d41 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==840e538154a92136133a68b33a050e99266f40fd +https://chromium.googlesource.com/chromium/tools/depot_tools.git==ada9211999786073eb44acab46e596311523e0df https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f https://github.com/CESNET/libyang.git==4c733412e7173219166be7053940326a92699765 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==47de5d71bc5389554f73382fba82173a295678e0 -https://github.com/FreeRADIUS/freeradius-server.git==f1dc7b44fb32830c644feda95003b56bfcca3016 +https://github.com/flashrom/flashrom.git==e25129d9b6cf5bc39fed03cbf60af2378a3e745f +https://github.com/FreeRADIUS/freeradius-server.git==3eb4a4b01e4b33a44b07a6ae6b50071fe09ad1f8 https://github.com/FreeRADIUS/pam_radius.git==d802da75cbfc3062ae1b18d0bf26ac2a030ffdaa https://github.com/jeroennijhof/pam_tacplus.git==b839c440e33c36eced9dcbc287fcfe6237c4c4ce https://github.com/jpirko/libteam.git==337125ce8d24ed66d7f4c7e6eef50458f3e7d154 diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index 7e021f29436a..7d4d138ea065 100644 --- a/files/build/versions/default/versions-mirror +++ b/files/build/versions/default/versions-mirror @@ -1,14 +1,14 @@ 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==20240601T000313Z -debian-security==20240602T000736Z +debian==20240604T000236Z +debian-security==20240605T000248Z download.docker.com_linux_debian_dists_bullseye==2024-05-28T14:05:22Z download.docker.com_linux_debian_dists_buster==2024-05-23T13:29:25Z -packages.trafficmanager.net_snapshot_debian-security_20240602T000736Z_dists_bullseye-security==2024-06-01T07:16:33Z -packages.trafficmanager.net_snapshot_debian-security_20240602T000736Z_dists_buster_updates==2024-06-01T07:16:33Z -packages.trafficmanager.net_snapshot_debian_20240601T000313Z_dists_bullseye==2024-02-10T12:40:37Z -packages.trafficmanager.net_snapshot_debian_20240601T000313Z_dists_bullseye-backports==2024-05-31T20:12:00Z -packages.trafficmanager.net_snapshot_debian_20240601T000313Z_dists_bullseye-updates==2024-05-31T20:12:00Z -packages.trafficmanager.net_snapshot_debian_20240601T000313Z_dists_buster==2023-06-10T08:53:33Z -packages.trafficmanager.net_snapshot_debian_20240601T000313Z_dists_buster-backports==2024-03-09T20:54:54Z -packages.trafficmanager.net_snapshot_debian_20240601T000313Z_dists_buster-updates==2023-06-10T08:55:10Z +packages.trafficmanager.net_snapshot_debian-security_20240605T000248Z_dists_bullseye-security==2024-06-02T16:19:06Z +packages.trafficmanager.net_snapshot_debian-security_20240605T000248Z_dists_buster_updates==2024-06-02T16:19:05Z +packages.trafficmanager.net_snapshot_debian_20240604T000236Z_dists_bullseye==2024-02-10T12:40:37Z +packages.trafficmanager.net_snapshot_debian_20240604T000236Z_dists_bullseye-backports==2024-06-03T14:12:58Z +packages.trafficmanager.net_snapshot_debian_20240604T000236Z_dists_bullseye-updates==2024-06-03T14:12:58Z +packages.trafficmanager.net_snapshot_debian_20240604T000236Z_dists_buster==2023-06-10T08:53:33Z +packages.trafficmanager.net_snapshot_debian_20240604T000236Z_dists_buster-backports==2024-03-09T20:54:54Z +packages.trafficmanager.net_snapshot_debian_20240604T000236Z_dists_buster-updates==2023-06-10T08:55:10Z diff --git a/files/build/versions/default/versions-web b/files/build/versions/default/versions-web index 8c88f081e3c2..c36d36da7c36 100644 --- a/files/build/versions/default/versions-web +++ b/files/build/versions/default/versions-web @@ -18,7 +18,7 @@ http://deb.debian.org/debian/pool/main/p/protobuf/protobuf_3.21.12-3.debian.tar. http://deb.debian.org/debian/pool/main/p/protobuf/protobuf_3.21.12-3.dsc==d8e34e7b07473c6903f9d245934524fb http://deb.debian.org/debian/pool/main/p/protobuf/protobuf_3.21.12.orig.tar.gz==d38562490234d8080bdbe8eb7baf937a http://ftp.us.debian.org/debian/pool/main/s/scapy/python3-scapy_2.4.0-2_all.deb==b8717ca83b3b60da54bc3f72018964a7 -http://www.mellanox.com/downloads/MFT/mft-4.27.0-83-x86_64-deb.tgz==e475ca87a9252ba8d0abb6b05d5d94d0 +http://www.mellanox.com/downloads/MFT/mft-4.28.0-96-x86_64-deb.tgz==f552e1faddc8f76fe4eb0b8902606c2a 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+deb11u2.dsc==9a06f5bc186878050305303e14d0bf55 @@ -41,31 +41,31 @@ https://github.com/CentecNetworks/sonic-binaries/raw/master/arm64/sai/libsaictc- https://github.com/CentecNetworks/sonic-binaries/raw/master/arm64/sai/libsaictc_1.13.0-1_arm64.deb==b8b25694a1dc9b4d8dffc2f2c04ddaed 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.13.3-1_armhf.deb==bfeb30fcf6a047040d06a8e6a67b4964 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2012.2202/fw-SPC-rel-13_2012_2202-EVB.mfa==a77569575da124cdcee7d9b4f09dc5f2 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2012.2202/fw-SPC2-rel-29_2012_2202-EVB.mfa==5b1138d4f422eebfdabb17ef15dd9d4b -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2012.2202/fw-SPC3-rel-30_2012_2202-EVB.mfa==006291d10adf09b230ee20317b984379 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2012.2202/fw-SPC4-rel-34_2012_2202-EVB.mfa==99205ae3ecd7f7bab2fd2e5657abd974 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sai-SAIBuild2311.26.0.28-bullseye-amd64/mlnx-sai-dbgsym_1.mlnx.SAIBuild2311.26.0.28_amd64.deb==a54897d02becbfa8e3b57e89d80b1a66 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sai-SAIBuild2311.26.0.28-bullseye-amd64/mlnx-sai_1.mlnx.SAIBuild2311.26.0.28_amd64.deb==dc93d3163e4acd4876de7c4b39175b26 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/applibs-dev_1.mlnx.4.6.2202_amd64.deb==ebfd6c3fc04ffa476a1dce5b66d44596 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/applibs_1.mlnx.4.6.2202_amd64.deb==2acd562c1c28cd373c35bd2f66301339 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/python-sdk-api_1.mlnx.4.6.2202_amd64.deb==69e6543617825b2dbd1a6191ca5cff8e -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/sx-acl-helper-dev_1.mlnx.4.6.2202_amd64.deb==9cc5b35e0a0630b0a8f639cdc039c3c1 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/sx-acl-helper_1.mlnx.4.6.2202_amd64.deb==5187fca944b21b2859e800b39871ddc0 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/sx-complib-dev_1.mlnx.4.6.2202_amd64.deb==1cab8319bdc99a1d620adf3f855affa2 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/sx-complib_1.mlnx.4.6.2202_amd64.deb==2644363c7f0b8832e05329c86c6e9164 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/sx-examples-dev_1.mlnx.4.6.2202_amd64.deb==637b81546cd1bf9dd6cb0f42f3fce846 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/sx-examples_1.mlnx.4.6.2202_amd64.deb==b7cabdf4c84e1cab8a34796e3fe47058 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/sx-gen-utils-dev_1.mlnx.4.6.2202_amd64.deb==7410da8e7603d48378b6d0b8a6a19fed -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/sx-gen-utils_1.mlnx.4.6.2202_amd64.deb==271db53cba7c0bab35599113b8134fce -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/sx-hash-calc_1.mlnx.4.6.2202_amd64.deb==d997b3a9adfa0fa5aef34414d4bc94c9 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/sx-obj-desc-lib-dev_1.mlnx.4.6.2202_amd64.deb==c61007a50d203f0d08cd905909255ef7 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/sx-obj-desc-lib_1.mlnx.4.6.2202_amd64.deb==3ef17ef44493ab90629b5c3a9d39b2cb -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/sxd-libs-dev_1.mlnx.4.6.2202_amd64.deb==fe94691ba8da67928faa50e618242848 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/sxd-libs_1.mlnx.4.6.2202_amd64.deb==d6bb87c432d60d656ad053b9b1d42e44 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/wjh-libs-dev_1.mlnx.4.6.2202_amd64.deb==984e5be1dbb1fb1ab8c15e57eaa979d6 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.2202-bullseye-amd64/wjh-libs_1.mlnx.4.6.2202_amd64.deb==aa1e61b1d91de49c170079ea5b2fca19 -https://github.com/Mellanox/Spectrum-SDK-Drivers/archive/refs/heads/4.6.2202.zip==2d839bdb59974f4018e10296af2a147a +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2012.4062/fw-SPC-rel-13_2012_4062-EVB.mfa==87e0d5b9d0717bd228190a2951bc65eb +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2012.4062/fw-SPC2-rel-29_2012_4062-EVB.mfa==081be39c2ad091fed1cb82e510365930 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2012.4062/fw-SPC3-rel-30_2012_4062-EVB.mfa==3b1a2ac75a71a3c34b5fe3396eb6a2e4 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2012.4062/fw-SPC4-rel-34_2012_4062-EVB.mfa==0a77e12969c47b3480dc48bad4910ec0 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sai-SAIBuild2311.28.0.13-bullseye-amd64/mlnx-sai-dbgsym_1.mlnx.SAIBuild2311.28.0.13_amd64.deb==f66db5009e44d861b1fb24fd93d5e456 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sai-SAIBuild2311.28.0.13-bullseye-amd64/mlnx-sai_1.mlnx.SAIBuild2311.28.0.13_amd64.deb==36f71dcf2c0219bc4cb9240888f6ea63 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.4062-bullseye-amd64/applibs-dev_1.mlnx.4.6.4062_amd64.deb==da7a7046853662b9ac7406cf6dc5e63a +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.4062-bullseye-amd64/applibs_1.mlnx.4.6.4062_amd64.deb==c0fdfaeafef5ce09303b84ce54a35bd5 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.4062-bullseye-amd64/python-sdk-api_1.mlnx.4.6.4062_amd64.deb==e69fa6de548ce10a5d11db747d59fc9c +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.4062-bullseye-amd64/sx-acl-helper-dev_1.mlnx.4.6.4062_amd64.deb==395e4ee1d2c150501c8f81e9a9026165 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.4062-bullseye-amd64/sx-acl-helper_1.mlnx.4.6.4062_amd64.deb==ac198027a96142420ac807aa61b7bac5 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.4062-bullseye-amd64/sx-complib-dev_1.mlnx.4.6.4062_amd64.deb==de66158e95ebe4ccc8fde3001e5fac9f +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.4062-bullseye-amd64/sx-complib_1.mlnx.4.6.4062_amd64.deb==7ed4c92c020385436693a01385188768 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.4062-bullseye-amd64/sx-examples-dev_1.mlnx.4.6.4062_amd64.deb==e79bb9a014beeb8e017f4b8b2657a153 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.4062-bullseye-amd64/sx-examples_1.mlnx.4.6.4062_amd64.deb==5f0b7ccc0ed90083c749febfae79fd2a +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.4062-bullseye-amd64/sx-gen-utils-dev_1.mlnx.4.6.4062_amd64.deb==0e703da8c5c65556772df02a5ab1fd5b +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.4062-bullseye-amd64/sx-gen-utils_1.mlnx.4.6.4062_amd64.deb==3725081fb417ef690e26c5b73a349db6 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.4062-bullseye-amd64/sx-hash-calc_1.mlnx.4.6.4062_amd64.deb==e8fd3a84c693001604ff1bf731049641 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.4062-bullseye-amd64/sx-obj-desc-lib-dev_1.mlnx.4.6.4062_amd64.deb==fd74cca3b9371641fefa98108d4c365a +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.4062-bullseye-amd64/sx-obj-desc-lib_1.mlnx.4.6.4062_amd64.deb==ee964a689ee07c933dfe1c273dd347bc +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.4062-bullseye-amd64/sxd-libs-dev_1.mlnx.4.6.4062_amd64.deb==583a71da82c9432a2427fd897a7cc9a8 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.4062-bullseye-amd64/sxd-libs_1.mlnx.4.6.4062_amd64.deb==802a87282d1f6988c0fcbb9bf2ca2aaa +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.4062-bullseye-amd64/wjh-libs-dev_1.mlnx.4.6.4062_amd64.deb==e127cb18d6000a374b3d9b5b4b2ad838 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.4062-bullseye-amd64/wjh-libs_1.mlnx.4.6.4062_amd64.deb==e18e2e7613ade643e18d93026da5c8ff +https://github.com/Mellanox/Spectrum-SDK-Drivers/archive/refs/heads/4.6.4062.zip==beff8921584b63056b69cc4ed519bfd5 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 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 368e528cff50..d3a5a672bc03 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.216-1 +linux-libc-dev==5.10.218-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 368e528cff50..d3a5a672bc03 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.216-1 +linux-libc-dev==5.10.218-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 99169d93b946..5c4d5df38329 100644 --- a/files/build/versions/dockers/docker-gbsyncd-broncos/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-gbsyncd-broncos/versions-deb-bullseye @@ -28,7 +28,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.216-1 +linux-libc-dev==5.10.218-1 openssh-client==1:8.4p1-5+deb11u3 sshpass==1.09-1+b1 strace==5.10-1 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 08097a85f2ff..99021e7cb641 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.6.2202 -applibs-dev==1.mlnx.4.6.2202 +applibs==1.mlnx.4.6.4062 +applibs-dev==1.mlnx.4.6.4062 dmidecode==3.3-2 ethtool==1:5.9-1 fancontrol==1:3.6.0-7 @@ -65,12 +65,12 @@ libxml2==2.9.10+dfsg-6.7+deb11u4 libxrender1==1:0.9.10-1 lm-sensors==1:3.6.0-7 lm-sensors-dbgsym==1:3.6.0-7 -mft==4.27.0-83 +mft==4.28.0-96 openssh-client==1:8.4p1-5+deb11u3 pci.ids==0.0~2021.02.08-1 pciutils==1:3.7.0-5 psmisc==23.4-2 -python-sdk-api==1.mlnx.4.6.2202 +python-sdk-api==1.mlnx.4.6.4062 python3-attr==20.3.0-1 python3-importlib-metadata==1.6.0-2 python3-jsonschema==3.2.0-3 @@ -88,12 +88,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.6.2202 -sx-complib-dev==1.mlnx.4.6.2202 -sx-gen-utils==1.mlnx.4.6.2202 -sx-gen-utils-dev==1.mlnx.4.6.2202 -sxd-libs==1.mlnx.4.6.2202 -sxd-libs-dev==1.mlnx.4.6.2202 +sx-complib==1.mlnx.4.6.4062 +sx-complib-dev==1.mlnx.4.6.4062 +sx-gen-utils==1.mlnx.4.6.4062 +sx-gen-utils-dev==1.mlnx.4.6.4062 +sxd-libs==1.mlnx.4.6.4062 +sxd-libs-dev==1.mlnx.4.6.4062 ucf==3.0043 udev==247.3-7+deb11u4 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 bda1782a173c..a5194d939a5a 100644 --- a/files/build/versions/dockers/docker-platform-monitor/versions-py3 +++ b/files/build/versions/dockers/docker-platform-monitor/versions-py3 @@ -12,7 +12,7 @@ more-itertools==4.2.0 netifaces==0.11.0 protobuf==4.24.3 pyrsistent==0.15.5 -python_sdk_api==4.6.2202 +python_sdk_api==4.6.4062 requests==2.31.0 thrift==0.13.0 urllib3==2.0.5 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 f82a0965af6e..96d36b59038b 100644 --- a/files/build/versions/dockers/docker-sonic-vs/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-sonic-vs/versions-deb-bullseye @@ -101,7 +101,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+deb11u1 -linux-libc-dev==5.10.216-1 +linux-libc-dev==5.10.218-1 logrotate==3.18.0-2+deb11u2 lsof==4.93.2+dfsg-1.1 mailcap==3.69 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 ccec9b25c822..200b0c679d5e 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 @@ -57,7 +57,7 @@ libtsan0==10.2.1-6 libubsan1==10.2.1-6 libuv1==1.40.0-2+deb11u1 libxml2==2.9.10+dfsg-6.7+deb11u4 -linux-libc-dev==5.10.216-1 +linux-libc-dev==5.10.218-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 ccec9b25c822..200b0c679d5e 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 @@ -57,7 +57,7 @@ libtsan0==10.2.1-6 libubsan1==10.2.1-6 libuv1==1.40.0-2+deb11u1 libxml2==2.9.10+dfsg-6.7+deb11u4 -linux-libc-dev==5.10.216-1 +linux-libc-dev==5.10.218-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 ccec9b25c822..200b0c679d5e 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 @@ -57,7 +57,7 @@ libtsan0==10.2.1-6 libubsan1==10.2.1-6 libuv1==1.40.0-2+deb11u1 libxml2==2.9.10+dfsg-6.7+deb11u4 -linux-libc-dev==5.10.216-1 +linux-libc-dev==5.10.218-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 a0b84e89731c..dc8be23410cd 100644 --- a/files/build/versions/dockers/docker-syncd-mlnx/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-mlnx/versions-deb-bullseye @@ -1,5 +1,5 @@ -applibs==1.mlnx.4.6.2202 -applibs-dev==1.mlnx.4.6.2202 +applibs==1.mlnx.4.6.4062 +applibs-dev==1.mlnx.4.6.4062 gdb==10.1-1.7 gdbserver==10.1-1.7 iproute2==1.mlnx.4.5.4206 @@ -42,13 +42,13 @@ 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.216-1 -mft==4.27.0-83 +linux-libc-dev==5.10.218-1 +mft==4.28.0-96 mft-fwtrace-cfg==1.0.0 -mlnx-sai==1.mlnx.SAIBuild2311.26.0.28 +mlnx-sai==1.mlnx.SAIBuild2311.28.0.13 openssh-client==1:8.4p1-5+deb11u3 python-pip-whl==20.3.4-4+deb11u1 -python-sdk-api==1.mlnx.4.6.2202 +python-sdk-api==1.mlnx.4.6.4062 python3-attr==20.3.0-1 python3-dev==3.9.2-3 python3-importlib-metadata==1.6.0-2 @@ -64,26 +64,26 @@ 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.6.2202 -sx-acl-helper-dev==1.mlnx.4.6.2202 -sx-complib==1.mlnx.4.6.2202 -sx-complib-dev==1.mlnx.4.6.2202 -sx-examples==1.mlnx.4.6.2202 -sx-examples-dev==1.mlnx.4.6.2202 -sx-gen-utils==1.mlnx.4.6.2202 -sx-gen-utils-dev==1.mlnx.4.6.2202 -sx-hash-calc==1.mlnx.4.6.2202 -sx-obj-desc-lib==1.mlnx.4.6.2202 -sx-obj-desc-lib-dev==1.mlnx.4.6.2202 +sx-acl-helper==1.mlnx.4.6.4062 +sx-acl-helper-dev==1.mlnx.4.6.4062 +sx-complib==1.mlnx.4.6.4062 +sx-complib-dev==1.mlnx.4.6.4062 +sx-examples==1.mlnx.4.6.4062 +sx-examples-dev==1.mlnx.4.6.4062 +sx-gen-utils==1.mlnx.4.6.4062 +sx-gen-utils-dev==1.mlnx.4.6.4062 +sx-hash-calc==1.mlnx.4.6.4062 +sx-obj-desc-lib==1.mlnx.4.6.4062 +sx-obj-desc-lib-dev==1.mlnx.4.6.4062 sx-scew==1.mlnx.4.5.5142 sx-scew-dev==1.mlnx.4.5.5142 -sxd-libs==1.mlnx.4.6.2202 -sxd-libs-dev==1.mlnx.4.6.2202 +sxd-libs==1.mlnx.4.6.4062 +sxd-libs-dev==1.mlnx.4.6.4062 syncd==1.0.0 syncd-dbg==1.0.0 syncd-dbgsym==1.0.0 vim==2:8.2.2434-3+deb11u1 vim-runtime==2:8.2.2434-3+deb11u1 -wjh-libs==1.mlnx.4.6.2202 -wjh-libs-dev==1.mlnx.4.6.2202 +wjh-libs==1.mlnx.4.6.4062 +wjh-libs-dev==1.mlnx.4.6.4062 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 d49cf202c9dc..3d5d378c09a8 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.6.2202 +python_sdk_api==4.6.4062 zipp==1.0.0 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 cbae53b68ef0..c2cc57610a56 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye @@ -1400,12 +1400,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.216-1 -linux-headers-5.10.0-29-amd64==5.10.216-1 -linux-headers-5.10.0-29-common==5.10.216-1 -linux-headers-amd64==5.10.216-1 -linux-kbuild-5.10==5.10.216-1 -linux-libc-dev==5.10.216-1 +linux-compiler-gcc-10-x86==5.10.218-1 +linux-headers-5.10.0-30-amd64==5.10.218-1 +linux-headers-5.10.0-30-common==5.10.218-1 +linux-headers-amd64==5.10.218-1 +linux-kbuild-5.10==5.10.218-1 +linux-libc-dev==5.10.218-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 decf51c55779..a2980cdb7d6b 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 @@ -18,6 +18,6 @@ libstdc++6-armhf-cross==10.2.1-6cross1 libubsan1-armhf-cross==10.2.1-6cross1 libunicode-linebreak-perl==0.0.20190101-1+b2 libxslt1-dev==1.1.34-4+deb11u1 -linux-headers-5.10.0-29-arm64==5.10.216-1 -linux-headers-arm64==5.10.216-1 +linux-headers-5.10.0-30-arm64==5.10.218-1 +linux-headers-arm64==5.10.218-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 82d432729f7e..36e53d88ea21 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 @@ -7,8 +7,8 @@ libjpeg-dev==1:2.0.6-4 libjpeg62-turbo-dev==1:2.0.6-4 libunicode-linebreak-perl==0.0.20190101-1+b2 libxslt1-dev==1.1.34-4+deb11u1 -linux-compiler-gcc-10-arm==5.10.216-1 -linux-headers-5.10.0-29-armmp==5.10.216-1 -linux-headers-armmp==5.10.216-1 +linux-compiler-gcc-10-arm==5.10.218-1 +linux-headers-5.10.0-30-armmp==5.10.218-1 +linux-headers-armmp==5.10.218-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 798ccce7dde6..cda1742a06fb 100644 --- a/files/build/versions/host-image/versions-deb-bullseye +++ b/files/build/versions/host-image/versions-deb-bullseye @@ -82,7 +82,7 @@ isc-dhcp-client==4.4.1-2.3+deb11u2 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-23-2-amd64==4.27.0 +kernel-mft-dkms-modules-5.10.0-23-2-amd64==4.28.0 kexec-tools==1:2.0.20-2.1 klibc-utils==2.0.8-6.1 kmod==28-1 @@ -256,8 +256,8 @@ libyang-cpp==1.0.73 libzmq5==4.3.4-1+deb11u1 linux-base==4.6 linux-image-5.10.0-23-2-amd64-unsigned==5.10.179-3 -linux-perf==5.10.216-1 -linux-perf-5.10==5.10.216-1 +linux-perf==5.10.218-1 +linux-perf-5.10==5.10.218-1 locales==2.31-13+deb11u10 logrotate==3.18.0-2+deb11u2 lsb-release==11.1.0 @@ -265,9 +265,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.27.0-83 +mft==4.28.0-96 mft-fwtrace-cfg==1.0.0 -mft-oem==4.27.0-83 +mft-oem==4.28.0-96 mokutil==0.6.0-2~deb11u1 monit==1:5.20.0-6 mount==2.36.1-8+deb11u2 @@ -331,7 +331,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.6.2202 +sx-kernel==1.mlnx.4.6.4062 symcrypt-openssl==0.1 sysfsutils==2.1.0+repack-7 sysstat==12.5.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 cdaf12bd710f..3c98d5a65fce 100644 --- a/files/build/versions/host-image/versions-deb-bullseye-arm64 +++ b/files/build/versions/host-image/versions-deb-bullseye-arm64 @@ -11,7 +11,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-23-2-arm64-unsigned==5.10.179-3 -linux-libc-dev==5.10.216-1 +linux-libc-dev==5.10.218-1 ntpstat==0.0.0.1-2 picocom==3.1-2 tsingma-bsp==1.0 diff --git a/files/build/versions/host-image/versions-deb-bullseye-armhf b/files/build/versions/host-image/versions-deb-bullseye-armhf index b12edb44dccd..cf592e177bfb 100644 --- a/files/build/versions/host-image/versions-deb-bullseye-armhf +++ b/files/build/versions/host-image/versions-deb-bullseye-armhf @@ -11,7 +11,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-23-2-armmp==5.10.179-3 -linux-libc-dev==5.10.216-1 +linux-libc-dev==5.10.218-1 mrvlprestera==1.0 ntpstat==0.0.0.1-2 openssh-client==1:8.4p1-5+deb11u2 From f470eb8fc0d7e7da7f86f839f5f9ac1108f3c3d1 Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Tue, 7 May 2024 11:18:18 -0700 Subject: [PATCH 351/419] Add new 128x400G HwSku for QuicksilverP --- .../Arista-7060X6-64PE-128x400G/hwsku.json | 202 +++ .../port_config.ini | 131 ++ .../Arista-7060X6-64PE-128x400G/sai.profile | 1 + .../th5-a7060x6-64pe.config.bcm | 1416 +++++++++++++++++ 4 files changed, 1750 insertions(+) create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/hwsku.json create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/port_config.ini create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/sai.profile create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/th5-a7060x6-64pe.config.bcm diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/hwsku.json b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/hwsku.json new file mode 100644 index 000000000000..b40939ff01fd --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/hwsku.json @@ -0,0 +1,202 @@ +{ + "interfaces": { + "Ethernet0": { + "default_brkout_mode": "2x400G" + }, + "Ethernet8": { + "default_brkout_mode": "2x400G" + }, + "Ethernet16": { + "default_brkout_mode": "2x400G" + }, + "Ethernet24": { + "default_brkout_mode": "2x400G" + }, + "Ethernet32": { + "default_brkout_mode": "2x400G" + }, + "Ethernet40": { + "default_brkout_mode": "2x400G" + }, + "Ethernet48": { + "default_brkout_mode": "2x400G" + }, + "Ethernet56": { + "default_brkout_mode": "2x400G" + }, + "Ethernet64": { + "default_brkout_mode": "2x400G" + }, + "Ethernet72": { + "default_brkout_mode": "2x400G" + }, + "Ethernet80": { + "default_brkout_mode": "2x400G" + }, + "Ethernet88": { + "default_brkout_mode": "2x400G" + }, + "Ethernet96": { + "default_brkout_mode": "2x400G" + }, + "Ethernet104": { + "default_brkout_mode": "2x400G" + }, + "Ethernet112": { + "default_brkout_mode": "2x400G" + }, + "Ethernet120": { + "default_brkout_mode": "2x400G" + }, + "Ethernet128": { + "default_brkout_mode": "2x400G" + }, + "Ethernet136": { + "default_brkout_mode": "2x400G" + }, + "Ethernet144": { + "default_brkout_mode": "2x400G" + }, + "Ethernet152": { + "default_brkout_mode": "2x400G" + }, + "Ethernet160": { + "default_brkout_mode": "2x400G" + }, + "Ethernet168": { + "default_brkout_mode": "2x400G" + }, + "Ethernet176": { + "default_brkout_mode": "2x400G" + }, + "Ethernet184": { + "default_brkout_mode": "2x400G" + }, + "Ethernet192": { + "default_brkout_mode": "2x400G" + }, + "Ethernet200": { + "default_brkout_mode": "2x400G" + }, + "Ethernet208": { + "default_brkout_mode": "2x400G" + }, + "Ethernet216": { + "default_brkout_mode": "2x400G" + }, + "Ethernet224": { + "default_brkout_mode": "2x400G" + }, + "Ethernet232": { + "default_brkout_mode": "2x400G" + }, + "Ethernet240": { + "default_brkout_mode": "2x400G" + }, + "Ethernet248": { + "default_brkout_mode": "2x400G" + }, + "Ethernet256": { + "default_brkout_mode": "2x400G" + }, + "Ethernet264": { + "default_brkout_mode": "2x400G" + }, + "Ethernet272": { + "default_brkout_mode": "2x400G" + }, + "Ethernet280": { + "default_brkout_mode": "2x400G" + }, + "Ethernet288": { + "default_brkout_mode": "2x400G" + }, + "Ethernet296": { + "default_brkout_mode": "2x400G" + }, + "Ethernet304": { + "default_brkout_mode": "2x400G" + }, + "Ethernet312": { + "default_brkout_mode": "2x400G" + }, + "Ethernet320": { + "default_brkout_mode": "2x400G" + }, + "Ethernet328": { + "default_brkout_mode": "2x400G" + }, + "Ethernet336": { + "default_brkout_mode": "2x400G" + }, + "Ethernet344": { + "default_brkout_mode": "2x400G" + }, + "Ethernet352": { + "default_brkout_mode": "2x400G" + }, + "Ethernet360": { + "default_brkout_mode": "2x400G" + }, + "Ethernet368": { + "default_brkout_mode": "2x400G" + }, + "Ethernet376": { + "default_brkout_mode": "2x400G" + }, + "Ethernet384": { + "default_brkout_mode": "2x400G" + }, + "Ethernet392": { + "default_brkout_mode": "2x400G" + }, + "Ethernet400": { + "default_brkout_mode": "2x400G" + }, + "Ethernet408": { + "default_brkout_mode": "2x400G" + }, + "Ethernet416": { + "default_brkout_mode": "2x400G" + }, + "Ethernet424": { + "default_brkout_mode": "2x400G" + }, + "Ethernet432": { + "default_brkout_mode": "2x400G" + }, + "Ethernet440": { + "default_brkout_mode": "2x400G" + }, + "Ethernet448": { + "default_brkout_mode": "2x400G" + }, + "Ethernet456": { + "default_brkout_mode": "2x400G" + }, + "Ethernet464": { + "default_brkout_mode": "2x400G" + }, + "Ethernet472": { + "default_brkout_mode": "2x400G" + }, + "Ethernet480": { + "default_brkout_mode": "2x400G" + }, + "Ethernet488": { + "default_brkout_mode": "2x400G" + }, + "Ethernet496": { + "default_brkout_mode": "2x400G" + }, + "Ethernet504": { + "default_brkout_mode": "2x400G" + }, + "Ethernet512": { + "default_brkout_mode": "1x10G" + }, + "Ethernet513": { + "default_brkout_mode": "1x10G" + } + } +} diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/port_config.ini b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/port_config.ini new file mode 100644 index 000000000000..4fee0c95baef --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/port_config.ini @@ -0,0 +1,131 @@ +# name lanes alias index speed fec +Ethernet0 17,18,19,20 Ethernet1/1 1 400000 rs +Ethernet4 21,22,23,24 Ethernet1/5 1 400000 rs +Ethernet8 1,2,3,4 Ethernet2/1 2 400000 rs +Ethernet12 5,6,7,8 Ethernet2/5 2 400000 rs +Ethernet16 9,10,11,12 Ethernet3/1 3 400000 rs +Ethernet20 13,14,15,16 Ethernet3/5 3 400000 rs +Ethernet24 25,26,27,28 Ethernet4/1 4 400000 rs +Ethernet28 29,30,31,32 Ethernet4/5 4 400000 rs +Ethernet32 57,58,59,60 Ethernet5/1 5 400000 rs +Ethernet36 61,62,63,64 Ethernet5/5 5 400000 rs +Ethernet40 41,42,43,44 Ethernet6/1 6 400000 rs +Ethernet44 45,46,47,48 Ethernet6/5 6 400000 rs +Ethernet48 33,34,35,36 Ethernet7/1 7 400000 rs +Ethernet52 37,38,39,40 Ethernet7/5 7 400000 rs +Ethernet56 49,50,51,52 Ethernet8/1 8 400000 rs +Ethernet60 53,54,55,56 Ethernet8/5 8 400000 rs +Ethernet64 89,90,91,92 Ethernet9/1 9 400000 rs +Ethernet68 93,94,95,96 Ethernet9/5 9 400000 rs +Ethernet72 73,74,75,76 Ethernet10/1 10 400000 rs +Ethernet76 77,78,79,80 Ethernet10/5 10 400000 rs +Ethernet80 65,66,67,68 Ethernet11/1 11 400000 rs +Ethernet84 69,70,71,72 Ethernet11/5 11 400000 rs +Ethernet88 81,82,83,84 Ethernet12/1 12 400000 rs +Ethernet92 85,86,87,88 Ethernet12/5 12 400000 rs +Ethernet96 121,122,123,124 Ethernet13/1 13 400000 rs +Ethernet100 125,126,127,128 Ethernet13/5 13 400000 rs +Ethernet104 105,106,107,108 Ethernet14/1 14 400000 rs +Ethernet108 109,110,111,112 Ethernet14/5 14 400000 rs +Ethernet112 97,98,99,100 Ethernet15/1 15 400000 rs +Ethernet116 101,102,103,104 Ethernet15/5 15 400000 rs +Ethernet120 113,114,115,116 Ethernet16/1 16 400000 rs +Ethernet124 117,118,119,120 Ethernet16/5 16 400000 rs +Ethernet128 153,154,155,156 Ethernet17/1 17 400000 rs +Ethernet132 157,158,159,160 Ethernet17/5 17 400000 rs +Ethernet136 137,138,139,140 Ethernet18/1 18 400000 rs +Ethernet140 141,142,143,144 Ethernet18/5 18 400000 rs +Ethernet144 129,130,131,132 Ethernet19/1 19 400000 rs +Ethernet148 133,134,135,136 Ethernet19/5 19 400000 rs +Ethernet152 145,146,147,148 Ethernet20/1 20 400000 rs +Ethernet156 149,150,151,152 Ethernet20/5 20 400000 rs +Ethernet160 185,186,187,188 Ethernet21/1 21 400000 rs +Ethernet164 189,190,191,192 Ethernet21/5 21 400000 rs +Ethernet168 169,170,171,172 Ethernet22/1 22 400000 rs +Ethernet172 173,174,175,176 Ethernet22/5 22 400000 rs +Ethernet176 161,162,163,164 Ethernet23/1 23 400000 rs +Ethernet180 165,166,167,168 Ethernet23/5 23 400000 rs +Ethernet184 177,178,179,180 Ethernet24/1 24 400000 rs +Ethernet188 181,182,183,184 Ethernet24/5 24 400000 rs +Ethernet192 217,218,219,220 Ethernet25/1 25 400000 rs +Ethernet196 221,222,223,224 Ethernet25/5 25 400000 rs +Ethernet200 201,202,203,204 Ethernet26/1 26 400000 rs +Ethernet204 205,206,207,208 Ethernet26/5 26 400000 rs +Ethernet208 193,194,195,196 Ethernet27/1 27 400000 rs +Ethernet212 197,198,199,200 Ethernet27/5 27 400000 rs +Ethernet216 209,210,211,212 Ethernet28/1 28 400000 rs +Ethernet220 213,214,215,216 Ethernet28/5 28 400000 rs +Ethernet224 249,250,251,252 Ethernet29/1 29 400000 rs +Ethernet228 253,254,255,256 Ethernet29/5 29 400000 rs +Ethernet232 233,234,235,236 Ethernet30/1 30 400000 rs +Ethernet236 237,238,239,240 Ethernet30/5 30 400000 rs +Ethernet240 225,226,227,228 Ethernet31/1 31 400000 rs +Ethernet244 229,230,231,232 Ethernet31/5 31 400000 rs +Ethernet248 241,242,243,244 Ethernet32/1 32 400000 rs +Ethernet252 245,246,247,248 Ethernet32/5 32 400000 rs +Ethernet256 273,274,275,276 Ethernet33/1 33 400000 rs +Ethernet260 277,278,279,280 Ethernet33/5 33 400000 rs +Ethernet264 257,258,259,260 Ethernet34/1 34 400000 rs +Ethernet268 261,262,263,264 Ethernet34/5 34 400000 rs +Ethernet272 265,266,267,268 Ethernet35/1 35 400000 rs +Ethernet276 269,270,271,272 Ethernet35/5 35 400000 rs +Ethernet280 281,282,283,284 Ethernet36/1 36 400000 rs +Ethernet284 285,286,287,288 Ethernet36/5 36 400000 rs +Ethernet288 313,314,315,316 Ethernet37/1 37 400000 rs +Ethernet292 317,318,319,320 Ethernet37/5 37 400000 rs +Ethernet296 297,298,299,300 Ethernet38/1 38 400000 rs +Ethernet300 301,302,303,304 Ethernet38/5 38 400000 rs +Ethernet304 289,290,291,292 Ethernet39/1 39 400000 rs +Ethernet308 293,294,295,296 Ethernet39/5 39 400000 rs +Ethernet312 305,306,307,308 Ethernet40/1 40 400000 rs +Ethernet316 309,310,311,312 Ethernet40/5 40 400000 rs +Ethernet320 345,346,347,348 Ethernet41/1 41 400000 rs +Ethernet324 349,350,351,352 Ethernet41/5 41 400000 rs +Ethernet328 329,330,331,332 Ethernet42/1 42 400000 rs +Ethernet332 333,334,335,336 Ethernet42/5 42 400000 rs +Ethernet336 321,322,323,324 Ethernet43/1 43 400000 rs +Ethernet340 325,326,327,328 Ethernet43/5 43 400000 rs +Ethernet344 337,338,339,340 Ethernet44/1 44 400000 rs +Ethernet348 341,342,343,344 Ethernet44/5 44 400000 rs +Ethernet352 377,378,379,380 Ethernet45/1 45 400000 rs +Ethernet356 381,382,381,382 Ethernet45/5 45 400000 rs +Ethernet360 361,362,363,364 Ethernet46/1 46 400000 rs +Ethernet364 365,366,367,368 Ethernet46/5 46 400000 rs +Ethernet368 353,354,355,356 Ethernet47/1 47 400000 rs +Ethernet372 357,358,359,360 Ethernet47/5 47 400000 rs +Ethernet376 369,370,371,372 Ethernet48/1 48 400000 rs +Ethernet380 373,374,375,376 Ethernet48/5 48 400000 rs +Ethernet384 409,410,411,412 Ethernet49/1 49 400000 rs +Ethernet388 413,414,415,416 Ethernet49/5 49 400000 rs +Ethernet392 393,394,395,396 Ethernet50/1 50 400000 rs +Ethernet396 397,398,399,400 Ethernet50/5 50 400000 rs +Ethernet400 385,386,387,388 Ethernet51/1 51 400000 rs +Ethernet404 389,390,391,392 Ethernet51/5 51 400000 rs +Ethernet408 401,402,403,404 Ethernet52/1 52 400000 rs +Ethernet412 405,406,407,408 Ethernet52/5 52 400000 rs +Ethernet416 441,442,443,444 Ethernet53/1 53 400000 rs +Ethernet420 445,446,447,448 Ethernet53/5 53 400000 rs +Ethernet424 425,426,427,428 Ethernet54/1 54 400000 rs +Ethernet428 429,430,431,432 Ethernet54/5 54 400000 rs +Ethernet432 417,418,419,420 Ethernet55/1 55 400000 rs +Ethernet436 421,422,423,424 Ethernet55/5 55 400000 rs +Ethernet440 433,434,435,436 Ethernet56/1 56 400000 rs +Ethernet444 437,438,439,430 Ethernet56/5 56 400000 rs +Ethernet448 473,474,475,476 Ethernet57/1 57 400000 rs +Ethernet452 477,478,479,480 Ethernet57/5 57 400000 rs +Ethernet456 457,458,459,460 Ethernet58/1 58 400000 rs +Ethernet460 461,462,463,464 Ethernet58/5 58 400000 rs +Ethernet464 449,450,451,452 Ethernet59/1 59 400000 rs +Ethernet468 453,454,453,454 Ethernet59/5 59 400000 rs +Ethernet472 465,466,467,468 Ethernet60/1 60 400000 rs +Ethernet476 469,470,471,472 Ethernet60/5 60 400000 rs +Ethernet480 505,506,507,508 Ethernet61/1 61 400000 rs +Ethernet484 509,510,511,512 Ethernet61/5 61 400000 rs +Ethernet488 489,490,491,492 Ethernet62/1 62 400000 rs +Ethernet492 493,494,495,496 Ethernet62/5 62 400000 rs +Ethernet496 481,482,483,483 Ethernet63/1 63 400000 rs +Ethernet500 485,486,487,488 Ethernet63/5 63 400000 rs +Ethernet504 497,498,499,500 Ethernet64/1 64 400000 rs +Ethernet508 501,502,503,504 Ethernet64/5 64 400000 rs +Ethernet512 513 Ethernet65 65 10000 none +Ethernet513 515 Ethernet66 66 10000 none diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/sai.profile b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/sai.profile new file mode 100644 index 000000000000..50c136d97b24 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/sai.profile @@ -0,0 +1 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th5-a7060x6-64pe.config.bcm diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/th5-a7060x6-64pe.config.bcm b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/th5-a7060x6-64pe.config.bcm new file mode 100644 index 000000000000..6915862e1966 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/th5-a7060x6-64pe.config.bcm @@ -0,0 +1,1416 @@ +# +# $Copyright: (c) 2022 Broadcom. +# Broadcom Proprietary and Confidential. All rights reserved.$ +# +# BCM78900 64x800g port configuration. +# +# configuration yaml file +# device: +# : +#
: +# ? +# : +# : +# ... +# : +# : +# : +# : +# ... +# : +# + +--- +bcm_device: + 0: + global: + pktio_mode: 1 + default_cpu_tx_queue: 7 + vlan_flooding_l2mc_num_reserved: 0 + ipv6_lpm_128b_enable: 1 + shared_block_mask_section: uc_bc + skip_protocol_default_entries: 1 + # LTSW uses value 1 for ALPM combined mode + l3_alpm_template: 1 + l3_alpm_hit_skip: 1 + sai_feat_tail_timestamp : 1 + sai_port_phy_time_sync_en : 1 + sai_field_group_auto_prioritize: 1 + #l3_intf_vlan_split_egress for MTU at L3IF + l3_intf_vlan_split_egress : 1 + pfc_deadlock_seq_control : 1 + sai_tunnel_support: 2 + bcm_tunnel_term_compatible_mode: 1 + l3_ecmp_member_first_lkup_mem_size: 12288 +--- +device: + 0: + PC_PM_CORE: + ? + PC_PM_ID: 3 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0x66 + TX_POLARITY_FLIP: 0xaa + ? + PC_PM_ID: 1 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0x26 + TX_POLARITY_FLIP: 0xaa + ? + PC_PM_ID: 2 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x55 + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 4 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x55 + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 8 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 6 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xb6 + ? + PC_PM_ID: 5 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x23016745 + TX_LANE_MAP: 0x54670123 + RX_POLARITY_FLIP: 0x97 + TX_POLARITY_FLIP: 0x35 + ? + PC_PM_ID: 7 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 12 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 10 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 9 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 11 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 16 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 14 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 13 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 15 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 20 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 18 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 17 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 19 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 24 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 22 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 21 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 23 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 28 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x31204675 + TX_LANE_MAP: 0x47561203 + RX_POLARITY_FLIP: 0x11 + TX_POLARITY_FLIP: 0x2b + ? + PC_PM_ID: 26 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 25 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 27 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0x9a + ? + PC_PM_ID: 32 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0xff + ? + PC_PM_ID: 30 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0xff + ? + PC_PM_ID: 29 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 31 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 35 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0x00 + ? + PC_PM_ID: 33 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0x00 + ? + PC_PM_ID: 34 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 36 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 40 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 38 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0x9a + ? + PC_PM_ID: 37 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x31204675 + TX_LANE_MAP: 0x47561203 + RX_POLARITY_FLIP: 0x11 + TX_POLARITY_FLIP: 0x2b + ? + PC_PM_ID: 39 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 44 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 42 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 41 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 43 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 48 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 46 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 45 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 47 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 52 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 50 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 49 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 51 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 56 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 54 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 53 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 55 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 60 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x23016745 + TX_LANE_MAP: 0x54670123 + RX_POLARITY_FLIP: 0x97 + TX_POLARITY_FLIP: 0x35 + ? + PC_PM_ID: 58 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 57 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 59 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xb6 + ? + PC_PM_ID: 64 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x67 + TX_POLARITY_FLIP: 0x55 + ? + PC_PM_ID: 62 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x66 + TX_POLARITY_FLIP: 0x55 + ? + PC_PM_ID: 61 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0xaa + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 63 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0xaa + TX_POLARITY_FLIP: 0x66 +--- +device: + 0: + PC_PORT_PHYS_MAP: + ? + PORT_ID: 1 + : + PC_PHYS_PORT_ID: 1 + ? + PORT_ID: 2 + : + PC_PHYS_PORT_ID: 5 + ? + PORT_ID: 3 + : + PC_PHYS_PORT_ID: 9 + ? + PORT_ID: 4 + : + PC_PHYS_PORT_ID: 13 + ? + PORT_ID: 11 + : + PC_PHYS_PORT_ID: 17 + ? + PORT_ID: 12 + : + PC_PHYS_PORT_ID: 21 + ? + PORT_ID: 13 + : + PC_PHYS_PORT_ID: 25 + ? + PORT_ID: 14 + : + PC_PHYS_PORT_ID: 29 + ? + PORT_ID: 22 + : + PC_PHYS_PORT_ID: 33 + ? + PORT_ID: 23 + : + PC_PHYS_PORT_ID: 37 + ? + PORT_ID: 24 + : + PC_PHYS_PORT_ID: 41 + ? + PORT_ID: 25 + : + PC_PHYS_PORT_ID: 45 + ? + PORT_ID: 33 + : + PC_PHYS_PORT_ID: 49 + ? + PORT_ID: 34 + : + PC_PHYS_PORT_ID: 53 + ? + PORT_ID: 35 + : + PC_PHYS_PORT_ID: 57 + ? + PORT_ID: 36 + : + PC_PHYS_PORT_ID: 61 + ? + PORT_ID: 44 + : + PC_PHYS_PORT_ID: 65 + ? + PORT_ID: 45 + : + PC_PHYS_PORT_ID: 69 + ? + PORT_ID: 46 + : + PC_PHYS_PORT_ID: 73 + ? + PORT_ID: 47 + : + PC_PHYS_PORT_ID: 77 + ? + PORT_ID: 55 + : + PC_PHYS_PORT_ID: 81 + ? + PORT_ID: 56 + : + PC_PHYS_PORT_ID: 85 + ? + PORT_ID: 57 + : + PC_PHYS_PORT_ID: 89 + ? + PORT_ID: 58 + : + PC_PHYS_PORT_ID: 93 + ? + PORT_ID: 66 + : + PC_PHYS_PORT_ID: 97 + ? + PORT_ID: 67 + : + PC_PHYS_PORT_ID: 101 + ? + PORT_ID: 68 + : + PC_PHYS_PORT_ID: 105 + ? + PORT_ID: 69 + : + PC_PHYS_PORT_ID: 109 + ? + PORT_ID: 77 + : + PC_PHYS_PORT_ID: 113 + ? + PORT_ID: 78 + : + PC_PHYS_PORT_ID: 117 + ? + PORT_ID: 79 + : + PC_PHYS_PORT_ID: 121 + ? + PORT_ID: 80 + : + PC_PHYS_PORT_ID: 125 + ? + PORT_ID: 88 + : + PC_PHYS_PORT_ID: 129 + ? + PORT_ID: 89 + : + PC_PHYS_PORT_ID: 133 + ? + PORT_ID: 90 + : + PC_PHYS_PORT_ID: 137 + ? + PORT_ID: 91 + : + PC_PHYS_PORT_ID: 141 + ? + PORT_ID: 99 + : + PC_PHYS_PORT_ID: 145 + ? + PORT_ID: 100 + : + PC_PHYS_PORT_ID: 149 + ? + PORT_ID: 101 + : + PC_PHYS_PORT_ID: 153 + ? + PORT_ID: 102 + : + PC_PHYS_PORT_ID: 157 + ? + PORT_ID: 110 + : + PC_PHYS_PORT_ID: 161 + ? + PORT_ID: 111 + : + PC_PHYS_PORT_ID: 165 + ? + PORT_ID: 112 + : + PC_PHYS_PORT_ID: 169 + ? + PORT_ID: 113 + : + PC_PHYS_PORT_ID: 173 + ? + PORT_ID: 121 + : + PC_PHYS_PORT_ID: 177 + ? + PORT_ID: 122 + : + PC_PHYS_PORT_ID: 181 + ? + PORT_ID: 123 + : + PC_PHYS_PORT_ID: 185 + ? + PORT_ID: 124 + : + PC_PHYS_PORT_ID: 189 + ? + PORT_ID: 132 + : + PC_PHYS_PORT_ID: 193 + ? + PORT_ID: 133 + : + PC_PHYS_PORT_ID: 197 + ? + PORT_ID: 134 + : + PC_PHYS_PORT_ID: 201 + ? + PORT_ID: 135 + : + PC_PHYS_PORT_ID: 205 + ? + PORT_ID: 143 + : + PC_PHYS_PORT_ID: 209 + ? + PORT_ID: 144 + : + PC_PHYS_PORT_ID: 213 + ? + PORT_ID: 145 + : + PC_PHYS_PORT_ID: 217 + ? + PORT_ID: 146 + : + PC_PHYS_PORT_ID: 221 + ? + PORT_ID: 154 + : + PC_PHYS_PORT_ID: 225 + ? + PORT_ID: 155 + : + PC_PHYS_PORT_ID: 229 + ? + PORT_ID: 156 + : + PC_PHYS_PORT_ID: 233 + ? + PORT_ID: 157 + : + PC_PHYS_PORT_ID: 237 + ? + PORT_ID: 165 + : + PC_PHYS_PORT_ID: 241 + ? + PORT_ID: 166 + : + PC_PHYS_PORT_ID: 245 + ? + PORT_ID: 167 + : + PC_PHYS_PORT_ID: 249 + ? + PORT_ID: 168 + : + PC_PHYS_PORT_ID: 253 + ? + PORT_ID: 176 + : + PC_PHYS_PORT_ID: 257 + ? + PORT_ID: 177 + : + PC_PHYS_PORT_ID: 261 + ? + PORT_ID: 178 + : + PC_PHYS_PORT_ID: 265 + ? + PORT_ID: 179 + : + PC_PHYS_PORT_ID: 269 + ? + PORT_ID: 187 + : + PC_PHYS_PORT_ID: 273 + ? + PORT_ID: 188 + : + PC_PHYS_PORT_ID: 277 + ? + PORT_ID: 189 + : + PC_PHYS_PORT_ID: 281 + ? + PORT_ID: 190 + : + PC_PHYS_PORT_ID: 285 + ? + PORT_ID: 198 + : + PC_PHYS_PORT_ID: 289 + ? + PORT_ID: 199 + : + PC_PHYS_PORT_ID: 293 + ? + PORT_ID: 200 + : + PC_PHYS_PORT_ID: 297 + ? + PORT_ID: 201 + : + PC_PHYS_PORT_ID: 301 + ? + PORT_ID: 209 + : + PC_PHYS_PORT_ID: 305 + ? + PORT_ID: 210 + : + PC_PHYS_PORT_ID: 309 + ? + PORT_ID: 211 + : + PC_PHYS_PORT_ID: 313 + ? + PORT_ID: 212 + : + PC_PHYS_PORT_ID: 317 + ? + PORT_ID: 220 + : + PC_PHYS_PORT_ID: 321 + ? + PORT_ID: 221 + : + PC_PHYS_PORT_ID: 325 + ? + PORT_ID: 222 + : + PC_PHYS_PORT_ID: 329 + ? + PORT_ID: 223 + : + PC_PHYS_PORT_ID: 333 + ? + PORT_ID: 231 + : + PC_PHYS_PORT_ID: 337 + ? + PORT_ID: 232 + : + PC_PHYS_PORT_ID: 341 + ? + PORT_ID: 233 + : + PC_PHYS_PORT_ID: 345 + ? + PORT_ID: 234 + : + PC_PHYS_PORT_ID: 349 + ? + PORT_ID: 242 + : + PC_PHYS_PORT_ID: 353 + ? + PORT_ID: 243 + : + PC_PHYS_PORT_ID: 357 + ? + PORT_ID: 244 + : + PC_PHYS_PORT_ID: 361 + ? + PORT_ID: 245 + : + PC_PHYS_PORT_ID: 365 + ? + PORT_ID: 253 + : + PC_PHYS_PORT_ID: 369 + ? + PORT_ID: 254 + : + PC_PHYS_PORT_ID: 373 + ? + PORT_ID: 255 + : + PC_PHYS_PORT_ID: 377 + ? + PORT_ID: 256 + : + PC_PHYS_PORT_ID: 381 + ? + PORT_ID: 264 + : + PC_PHYS_PORT_ID: 385 + ? + PORT_ID: 265 + : + PC_PHYS_PORT_ID: 389 + ? + PORT_ID: 266 + : + PC_PHYS_PORT_ID: 393 + ? + PORT_ID: 267 + : + PC_PHYS_PORT_ID: 397 + ? + PORT_ID: 275 + : + PC_PHYS_PORT_ID: 401 + ? + PORT_ID: 276 + : + PC_PHYS_PORT_ID: 405 + ? + PORT_ID: 277 + : + PC_PHYS_PORT_ID: 409 + ? + PORT_ID: 278 + : + PC_PHYS_PORT_ID: 413 + ? + PORT_ID: 286 + : + PC_PHYS_PORT_ID: 417 + ? + PORT_ID: 287 + : + PC_PHYS_PORT_ID: 421 + ? + PORT_ID: 288 + : + PC_PHYS_PORT_ID: 425 + ? + PORT_ID: 289 + : + PC_PHYS_PORT_ID: 429 + ? + PORT_ID: 297 + : + PC_PHYS_PORT_ID: 433 + ? + PORT_ID: 298 + : + PC_PHYS_PORT_ID: 437 + ? + PORT_ID: 299 + : + PC_PHYS_PORT_ID: 441 + ? + PORT_ID: 300 + : + PC_PHYS_PORT_ID: 445 + ? + PORT_ID: 308 + : + PC_PHYS_PORT_ID: 449 + ? + PORT_ID: 309 + : + PC_PHYS_PORT_ID: 453 + ? + PORT_ID: 310 + : + PC_PHYS_PORT_ID: 457 + ? + PORT_ID: 311 + : + PC_PHYS_PORT_ID: 461 + ? + PORT_ID: 319 + : + PC_PHYS_PORT_ID: 465 + ? + PORT_ID: 320 + : + PC_PHYS_PORT_ID: 469 + ? + PORT_ID: 321 + : + PC_PHYS_PORT_ID: 473 + ? + PORT_ID: 322 + : + PC_PHYS_PORT_ID: 477 + ? + PORT_ID: 330 + : + PC_PHYS_PORT_ID: 481 + ? + PORT_ID: 331 + : + PC_PHYS_PORT_ID: 485 + ? + PORT_ID: 332 + : + PC_PHYS_PORT_ID: 489 + ? + PORT_ID: 333 + : + PC_PHYS_PORT_ID: 493 + ? + PORT_ID: 341 + : + PC_PHYS_PORT_ID: 497 + ? + PORT_ID: 342 + : + PC_PHYS_PORT_ID: 501 + ? + PORT_ID: 343 + : + PC_PHYS_PORT_ID: 505 + ? + PORT_ID: 344 + : + PC_PHYS_PORT_ID: 509 + ? + PORT_ID: 76 + : + PC_PHYS_PORT_ID: 513 + ? + PORT_ID: 274 + : + PC_PHYS_PORT_ID: 515 +... +--- +device: + 0: + PC_PORT: + ? + PORT_ID: [[1, 4], + [11, 14], + [22, 25], + [33, 36], + [44, 47], + [55, 58], + [66, 69], + [77, 80], + [88, 91], + [99, 102], + [110, 113], + [121, 124], + [132, 135], + [143, 146], + [154, 157], + [165, 168], + [176, 179], + [187, 190], + [198, 201], + [209, 212], + [220, 223], + [231, 234], + [242, 245], + [253, 256], + [264, 267], + [275, 278], + [286, 289], + [297, 300], + [308, 311], + [319, 322], + [330, 333], + [341, 344]] + : + ENABLE: 0 + SPEED: 400000 + NUM_LANES: 4 + FEC_MODE: PC_FEC_RS544_2XN + MAX_FRAME_SIZE: 9416 + ? + PORT_ID: [[76, 76], [274, 274]] + : + ENABLE: 0 + MAX_FRAME_SIZE: 9416 + SPEED: 10000 + NUM_LANES: 1 +... +--- +bcm_device: + 0: + global: + ftem_mem_entries: 65536 +... +--- +device: + 0: + # Per pipe flex counter configuration + CTR_EFLEX_CONFIG: + CTR_ING_EFLEX_OPERMODE_PIPEUNIQUE: 0 + CTR_EGR_EFLEX_OPERMODE_PIPEUNIQUE: 0 + + # IFP mode + FP_CONFIG: + FP_ING_OPERMODE: GLOBAL_PIPE_AWARE +... +--- +device: + 0: + DEVICE_CONFIG: + AUTOLOAD_BOARD_SETTINGS: 0 +... From df7a52bc3333621717e1ed5656e62a828d312ca3 Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Wed, 1 May 2024 09:57:26 -0700 Subject: [PATCH 352/419] Add a 256x200G profile for QuicksilverP --- .../Arista-7060X6-64PE-256x200G/hwsku.json | 202 ++++++++++++++++++ .../port_config.ini | 2 + .../th5-a7060x6-64pe.config.bcm | 15 ++ 3 files changed, 219 insertions(+) create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/hwsku.json diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/hwsku.json b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/hwsku.json new file mode 100644 index 000000000000..5b1282251efc --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/hwsku.json @@ -0,0 +1,202 @@ +{ + "interfaces": { + "Ethernet0": { + "default_brkout_mode": "4x200G" + }, + "Ethernet8": { + "default_brkout_mode": "4x200G" + }, + "Ethernet16": { + "default_brkout_mode": "4x200G" + }, + "Ethernet24": { + "default_brkout_mode": "4x200G" + }, + "Ethernet32": { + "default_brkout_mode": "4x200G" + }, + "Ethernet40": { + "default_brkout_mode": "4x200G" + }, + "Ethernet48": { + "default_brkout_mode": "4x200G" + }, + "Ethernet56": { + "default_brkout_mode": "4x200G" + }, + "Ethernet64": { + "default_brkout_mode": "4x200G" + }, + "Ethernet72": { + "default_brkout_mode": "4x200G" + }, + "Ethernet80": { + "default_brkout_mode": "4x200G" + }, + "Ethernet88": { + "default_brkout_mode": "4x200G" + }, + "Ethernet96": { + "default_brkout_mode": "4x200G" + }, + "Ethernet104": { + "default_brkout_mode": "4x200G" + }, + "Ethernet112": { + "default_brkout_mode": "4x200G" + }, + "Ethernet120": { + "default_brkout_mode": "4x200G" + }, + "Ethernet128": { + "default_brkout_mode": "4x200G" + }, + "Ethernet136": { + "default_brkout_mode": "4x200G" + }, + "Ethernet144": { + "default_brkout_mode": "4x200G" + }, + "Ethernet152": { + "default_brkout_mode": "4x200G" + }, + "Ethernet160": { + "default_brkout_mode": "4x200G" + }, + "Ethernet168": { + "default_brkout_mode": "4x200G" + }, + "Ethernet176": { + "default_brkout_mode": "4x200G" + }, + "Ethernet184": { + "default_brkout_mode": "4x200G" + }, + "Ethernet192": { + "default_brkout_mode": "4x200G" + }, + "Ethernet200": { + "default_brkout_mode": "4x200G" + }, + "Ethernet208": { + "default_brkout_mode": "4x200G" + }, + "Ethernet216": { + "default_brkout_mode": "4x200G" + }, + "Ethernet224": { + "default_brkout_mode": "4x200G" + }, + "Ethernet232": { + "default_brkout_mode": "4x200G" + }, + "Ethernet240": { + "default_brkout_mode": "4x200G" + }, + "Ethernet248": { + "default_brkout_mode": "4x200G" + }, + "Ethernet256": { + "default_brkout_mode": "4x200G" + }, + "Ethernet264": { + "default_brkout_mode": "4x200G" + }, + "Ethernet272": { + "default_brkout_mode": "4x200G" + }, + "Ethernet280": { + "default_brkout_mode": "4x200G" + }, + "Ethernet288": { + "default_brkout_mode": "4x200G" + }, + "Ethernet296": { + "default_brkout_mode": "4x200G" + }, + "Ethernet304": { + "default_brkout_mode": "4x200G" + }, + "Ethernet312": { + "default_brkout_mode": "4x200G" + }, + "Ethernet320": { + "default_brkout_mode": "4x200G" + }, + "Ethernet328": { + "default_brkout_mode": "4x200G" + }, + "Ethernet336": { + "default_brkout_mode": "4x200G" + }, + "Ethernet344": { + "default_brkout_mode": "4x200G" + }, + "Ethernet352": { + "default_brkout_mode": "4x200G" + }, + "Ethernet360": { + "default_brkout_mode": "4x200G" + }, + "Ethernet368": { + "default_brkout_mode": "4x200G" + }, + "Ethernet376": { + "default_brkout_mode": "4x200G" + }, + "Ethernet384": { + "default_brkout_mode": "4x200G" + }, + "Ethernet392": { + "default_brkout_mode": "4x200G" + }, + "Ethernet400": { + "default_brkout_mode": "4x200G" + }, + "Ethernet408": { + "default_brkout_mode": "4x200G" + }, + "Ethernet416": { + "default_brkout_mode": "4x200G" + }, + "Ethernet424": { + "default_brkout_mode": "4x200G" + }, + "Ethernet432": { + "default_brkout_mode": "4x200G" + }, + "Ethernet440": { + "default_brkout_mode": "4x200G" + }, + "Ethernet448": { + "default_brkout_mode": "4x200G" + }, + "Ethernet456": { + "default_brkout_mode": "4x200G" + }, + "Ethernet464": { + "default_brkout_mode": "4x200G" + }, + "Ethernet472": { + "default_brkout_mode": "4x200G" + }, + "Ethernet480": { + "default_brkout_mode": "4x200G" + }, + "Ethernet488": { + "default_brkout_mode": "4x200G" + }, + "Ethernet496": { + "default_brkout_mode": "4x200G" + }, + "Ethernet504": { + "default_brkout_mode": "4x200G" + }, + "Ethernet512": { + "default_brkout_mode": "1x10G" + }, + "Ethernet513": { + "default_brkout_mode": "1x10G" + } + } +} diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/port_config.ini b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/port_config.ini index 323b8e2612eb..86b32b0bfd91 100644 --- a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/port_config.ini +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/port_config.ini @@ -255,3 +255,5 @@ Ethernet504 497,498 Ethernet64/1 64 200000 rs Ethernet506 499,500 Ethernet64/3 64 200000 rs Ethernet508 501,502 Ethernet64/5 64 200000 rs Ethernet510 503,504 Ethernet64/7 64 200000 rs +Ethernet512 513 Ethernet65 65 10000 none +Ethernet513 515 Ethernet66 66 10000 none diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/th5-a7060x6-64pe.config.bcm b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/th5-a7060x6-64pe.config.bcm index 997636fdcc58..103fff69eb34 100644 --- a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/th5-a7060x6-64pe.config.bcm +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/th5-a7060x6-64pe.config.bcm @@ -1842,6 +1842,14 @@ device: PORT_ID: 348 : PC_PHYS_PORT_ID: 511 + ? + PORT_ID: 76 + : + PC_PHYS_PORT_ID: 513 + ? + PORT_ID: 274 + : + PC_PHYS_PORT_ID: 515 ... --- device: @@ -1886,6 +1894,13 @@ device: NUM_LANES: 2 FEC_MODE: PC_FEC_RS544_2XN MAX_FRAME_SIZE: 9416 + ? + PORT_ID: [[76, 76], [274, 274]] + : + ENABLE: 0 + MAX_FRAME_SIZE: 9416 + SPEED: 10000 + NUM_LANES: 1 ... --- bcm_device: From f99bd1e79b1464d19cafe52a2d30e6c9d4ae26b9 Mon Sep 17 00:00:00 2001 From: Pavan Prakash <120486223+Pavan-Nokia@users.noreply.github.com> Date: Wed, 5 Jun 2024 10:50:46 -0400 Subject: [PATCH 353/419] [Nokia-7215-A1] Update EZB files to support SAI update (#19180) Update EZB to version 1.07 to support Marvell SAI upgrade to 1.13.3-3 --- .../Nokia-7215-A1/ASK-Board-AC5X-xb.md5 | 2 +- .../Nokia-7215-A1/ASK-Board-AC5X-xb.xml | 2 +- .../Nokia-7215-A1/ASK-L1-AC5X-xb.md5 | 2 +- .../Nokia-7215-A1/ASK-L1-AC5X-xb.xml | 2 +- .../Nokia-7215-A1/ASK-PP-AC5X-xb.md5 | 2 +- .../Nokia-7215-A1/ASK-PP-AC5X-xb.xml | 2 +- .../Nokia-7215-A1/SAI-AC5X-xb.md5 | 2 +- .../Nokia-7215-A1/SAI-AC5X-xb.xml | 20 ++++++++++++++++++- 8 files changed, 26 insertions(+), 8 deletions(-) diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-Board-AC5X-xb.md5 b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-Board-AC5X-xb.md5 index b11b209e5598..14beae36ee5a 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-Board-AC5X-xb.md5 +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-Board-AC5X-xb.md5 @@ -1 +1 @@ -c99947340cd205fa728bd418d1ca7a92 \ No newline at end of file +10f152b04dd03f00f0b4f02e19ca8d03 \ No newline at end of file diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-Board-AC5X-xb.xml b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-Board-AC5X-xb.xml index f23c2e9badda..27b4f290173d 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-Board-AC5X-xb.xml +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-Board-AC5X-xb.xml @@ -1,5 +1,5 @@ - + diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-L1-AC5X-xb.md5 b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-L1-AC5X-xb.md5 index 575bbf06a1b2..2ae3134074cd 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-L1-AC5X-xb.md5 +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-L1-AC5X-xb.md5 @@ -1 +1 @@ -83b91095c99529e49619e31e3fd72101 \ No newline at end of file +1df22facf5c5401eb97c7df41aaa80cd \ No newline at end of file diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-L1-AC5X-xb.xml b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-L1-AC5X-xb.xml index eff23c06ff2b..54f465b41930 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-L1-AC5X-xb.xml +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-L1-AC5X-xb.xml @@ -1,5 +1,5 @@ - + diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-PP-AC5X-xb.md5 b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-PP-AC5X-xb.md5 index c043a0d7231f..a30d9c52fd5a 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-PP-AC5X-xb.md5 +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-PP-AC5X-xb.md5 @@ -1 +1 @@ -209426f8b550ddf85db19925f9f202a1 \ No newline at end of file +d4b2285025098a04474115437f0f9816 \ No newline at end of file diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-PP-AC5X-xb.xml b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-PP-AC5X-xb.xml index 9e40492cfe8f..3017e7f816d2 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-PP-AC5X-xb.xml +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-PP-AC5X-xb.xml @@ -1,5 +1,5 @@ - + diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/SAI-AC5X-xb.md5 b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/SAI-AC5X-xb.md5 index 04eaffc09efc..75366b30ee11 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/SAI-AC5X-xb.md5 +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/SAI-AC5X-xb.md5 @@ -1 +1 @@ -8918d787a5ccaa80a481ddb8b169574a \ No newline at end of file +00862292793c57d3cfe035d414e9e1d0 \ No newline at end of file diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/SAI-AC5X-xb.xml b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/SAI-AC5X-xb.xml index 00c77001f56b..4bef0c9dd0be 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/SAI-AC5X-xb.xml +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/SAI-AC5X-xb.xml @@ -1,5 +1,5 @@ - + @@ -56,6 +56,21 @@ 2 + + Feature-enable + enumeration + Feature Enabled/Disabled + + Disabled + Disabled + 0 + + + Enabled + Enabled + 1 + + log-dest-file-path-type string @@ -440,6 +455,9 @@ SAI_LOG_SYSLOG + + Disabled + control-acl 3 From 9e7c85b0fd459cc9bae023f105d8973e54aabbf5 Mon Sep 17 00:00:00 2001 From: Tomer Shalvi <116184476+tshalvi@users.noreply.github.com> Date: Tue, 4 Jun 2024 17:18:52 +0300 Subject: [PATCH 354/419] [Mellanox] Validate Module Presence Via Sysfs Before Accessing EEPROM in Thermal Control Daemon (#19178) - Why I did it Currently, on Mellanox platforms, when trying to read from the EEPROM of an unplugged module from thermalctld, we get the following error: ERR kernel: [ 2446.261799] sxd_kernel: [error] Failed to get module page valid, err: -5 We need to ensure the EEPROM is not accessed if a module is not connected. - How I did it I updated the logic of get_presence() to rely on the present/hw_present sysfs values and called get_presence() from within the relevant methods in thermalctld. - How to verify it Unplug a module and ensure the following error does not appear: ERR kernel: [ 2446.261799] sxd_kernel: [error] Failed to get module page valid, err: -5 --- .../mellanox/mlnx-platform-api/sonic_platform/sfp.py | 3 +++ .../mlnx-platform-api/sonic_platform/thermal.py | 6 ++++++ .../mellanox/mlnx-platform-api/tests/test_sfp.py | 12 ++++++++++-- .../mellanox/mlnx-platform-api/tests/test_thermal.py | 9 +++++++++ 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index 34b5fe8004ba..b55b578459f4 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -483,6 +483,9 @@ def get_presence(self): Returns: bool: True if device is present, False if not """ + presence_sysfs = f'/sys/module/sx_core/asic0/module{self.sdk_index}/hw_present' if self.is_sw_control() else f'/sys/module/sx_core/asic0/module{self.sdk_index}/present' + if utils.read_int_from_file(presence_sysfs) != 1: + return False eeprom_raw = self._read_eeprom(0, 1, log_on_error=False) return eeprom_raw is not None diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py index 7ac703b7841c..219fe2418080 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py @@ -435,6 +435,8 @@ def get_temperature(self): A float number of current temperature in Celsius up to nearest thousandth of one degree Celsius, e.g. 30.125 """ + if not self.sfp.get_presence(): + return None value = self.sfp.get_temperature() return value if (value != 0.0 and value is not None) else None @@ -446,6 +448,8 @@ def get_high_threshold(self): A float number, the high threshold temperature of thermal in Celsius up to nearest thousandth of one degree Celsius, e.g. 30.125 """ + if not self.sfp.get_presence(): + return None value = self.sfp.get_temperature_warning_threshold() return value if (value != 0.0 and value is not None) else None @@ -457,6 +461,8 @@ def get_high_critical_threshold(self): A float number, the high critical threshold temperature of thermal in Celsius up to nearest thousandth of one degree Celsius, e.g. 30.125 """ + if not self.sfp.get_presence(): + return None value = self.sfp.get_temperature_critical_threshold() return value if (value != 0.0 and value is not None) else None diff --git a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py index 92f5d0d51616..947736f3660d 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py @@ -247,15 +247,23 @@ def test_get_page_and_page_offset(self, mock_get_type_str, mock_eeprom_path, moc assert page == '/tmp/1/data' assert page_offset is 0 + @mock.patch('sonic_platform.utils.read_int_from_file') @mock.patch('sonic_platform.sfp.SFP._read_eeprom') - def test_sfp_get_presence(self, mock_read): + def test_sfp_get_presence(self, mock_read, mock_read_int): sfp = SFP(0) + + mock_read_int.return_value = 1 mock_read.return_value = None assert not sfp.get_presence() - mock_read.return_value = 0 assert sfp.get_presence() + mock_read_int.return_value = 0 + mock_read.return_value = None + assert not sfp.get_presence() + mock_read.return_value = 0 + assert not sfp.get_presence() + @mock.patch('sonic_platform.utils.read_int_from_file') def test_rj45_get_presence(self, mock_read_int): sfp = RJ45Port(0) diff --git a/platform/mellanox/mlnx-platform-api/tests/test_thermal.py b/platform/mellanox/mlnx-platform-api/tests/test_thermal.py index e17d91cb0818..a92322264eee 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_thermal.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_thermal.py @@ -159,12 +159,21 @@ def test_sfp_thermal(self): assert thermal.get_name() == rule['name'].format(start_index) assert thermal.get_position_in_parent() == 1 assert thermal.is_replaceable() == False + sfp.get_presence = mock.MagicMock(return_value=True) sfp.get_temperature = mock.MagicMock(return_value=35.4) sfp.get_temperature_warning_threshold = mock.MagicMock(return_value=70) sfp.get_temperature_critical_threshold = mock.MagicMock(return_value=80) assert thermal.get_temperature() == 35.4 assert thermal.get_high_threshold() == 70 assert thermal.get_high_critical_threshold() == 80 + sfp.get_presence = mock.MagicMock(return_value=False) + sfp.get_temperature = mock.MagicMock(return_value=35.4) + sfp.get_temperature_warning_threshold = mock.MagicMock(return_value=70) + sfp.get_temperature_critical_threshold = mock.MagicMock(return_value=80) + assert thermal.get_temperature() is None + assert thermal.get_high_threshold() is None + assert thermal.get_high_critical_threshold() is None + sfp.get_presence = mock.MagicMock(return_value=True) sfp.get_temperature = mock.MagicMock(return_value=0) sfp.get_temperature_warning_threshold = mock.MagicMock(return_value=0) sfp.get_temperature_critical_threshold = mock.MagicMock(return_value=None) From cba1a69555793a3ee10542275d9d87c6dc71f4c4 Mon Sep 17 00:00:00 2001 From: Pavan Prakash <120486223+Pavan-Nokia@users.noreply.github.com> Date: Wed, 5 Jun 2024 17:30:29 -0400 Subject: [PATCH 355/419] [Nokia-7215] Enhance Watchdog (#18851) Mask Watchdog-control.service and make sure only one watchdog service starts on this platform --- .../sonic-platform-nokia/7215/service/cpu_wdt.service | 1 + .../debian/sonic-platform-nokia-7215.postinst | 2 ++ 2 files changed, 3 insertions(+) diff --git a/platform/marvell-armhf/sonic-platform-nokia/7215/service/cpu_wdt.service b/platform/marvell-armhf/sonic-platform-nokia/7215/service/cpu_wdt.service index 761deec569cc..993070a14a2a 100644 --- a/platform/marvell-armhf/sonic-platform-nokia/7215/service/cpu_wdt.service +++ b/platform/marvell-armhf/sonic-platform-nokia/7215/service/cpu_wdt.service @@ -1,5 +1,6 @@ [Unit] Description=CPU WDT +Conflicts=watchdog-control.service After=nokia-7215init.service [Service] ExecStart=/usr/local/bin/cpu_wdt.py diff --git a/platform/marvell-armhf/sonic-platform-nokia/debian/sonic-platform-nokia-7215.postinst b/platform/marvell-armhf/sonic-platform-nokia/debian/sonic-platform-nokia-7215.postinst index 76d40865a0ac..f3250c2696d2 100644 --- a/platform/marvell-armhf/sonic-platform-nokia/debian/sonic-platform-nokia-7215.postinst +++ b/platform/marvell-armhf/sonic-platform-nokia/debian/sonic-platform-nokia-7215.postinst @@ -7,6 +7,8 @@ sh /usr/sbin/nokia-7215_plt_setup.sh systemctl enable nokia-7215init.service systemctl start nokia-7215init.service +systemctl mask --now watchdog-control.service + systemctl enable cpu_wdt.service systemctl start cpu_wdt.service From 900555a421baeb170c45964ec9d03158d2c20efb Mon Sep 17 00:00:00 2001 From: Dror Prital <76714716+dprital@users.noreply.github.com> Date: Thu, 9 May 2024 08:13:52 +0300 Subject: [PATCH 356/419] [Mellanox] Mount /var/log/sdk_dbg folder to host filesystem (#18711) - Why I did it Mellanox SDK Sniffer target path was changed from "/var/log/mellanox/sniffer/" To: "/var/log/sdk_dbg" This PR mount the new folder so it can be accessed from host - How I did it Add /var/log/sdk_dbg to mount - How to verify it Run SDK sniffer and make sure the sniffer output file kept in the new location --- files/build_templates/docker_image_ctl.j2 | 1 + 1 file changed, 1 insertion(+) diff --git a/files/build_templates/docker_image_ctl.j2 b/files/build_templates/docker_image_ctl.j2 index 95c2e1fa52a8..4642764afccf 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -589,6 +589,7 @@ start() { {%- if sonic_asic_platform == "mellanox" %} {%- if docker_container_name == "syncd" %} -v /var/log/mellanox:/var/log/mellanox:rw \ + -v /var/log/sdk_dbg:/var/log/sdk_dbg:rw \ -v mlnx_sdk_socket:/var/run/sx_sdk \ -v /tmp/nv-syncd-shared/:/tmp \ -v /dev/shm:/dev/shm:rw \ From be9c647575c39caeb6aed205194589806237869f Mon Sep 17 00:00:00 2001 From: sophiek Date: Tue, 4 Jun 2024 22:19:25 +0300 Subject: [PATCH 357/419] [Mellanox] Fix SN5400 lane number of service port from 513 to 520 (#19137) Fixed a lane numbering bug with service ports on SN5400 --- device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/hwsku.json | 2 +- .../x86_64-nvidia_sn5400-r0/ACS-SN5400/port_config.ini | 2 +- device/mellanox/x86_64-nvidia_sn5400-r0/platform.json | 4 ++-- device/mellanox/x86_64-nvidia_sn5400_simx-r0/platform.json | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/hwsku.json b/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/hwsku.json index abe6649e7db1..096249718223 100644 --- a/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/hwsku.json +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/hwsku.json @@ -195,7 +195,7 @@ "Ethernet512": { "default_brkout_mode": "1x25G[10G]" }, - "Ethernet513": { + "Ethernet520": { "default_brkout_mode": "1x25G[10G]" } } diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/port_config.ini b/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/port_config.ini index 4b62d3abf172..3fe2027e9052 100644 --- a/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/port_config.ini +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/port_config.ini @@ -81,4 +81,4 @@ Ethernet488 488,489,490,491,492,493,494,495 etp62 62 Ethernet496 496,497,498,499,500,501,502,503 etp63 63 Ethernet504 504,505,506,507,508,509,510,511 etp64 64 Ethernet512 512 etp65 65 -Ethernet513 513 etp66 66 +Ethernet520 520 etp66 66 diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/platform.json b/device/mellanox/x86_64-nvidia_sn5400-r0/platform.json index 274a12d0c715..f4f9ed17d60e 100644 --- a/device/mellanox/x86_64-nvidia_sn5400-r0/platform.json +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/platform.json @@ -1322,9 +1322,9 @@ "1x25G[10G]": ["etp65"] } }, - "Ethernet513": { + "Ethernet520": { "index": "66", - "lanes": "513", + "lanes": "520", "breakout_modes": { "1x25G[10G]": ["etp66"] } diff --git a/device/mellanox/x86_64-nvidia_sn5400_simx-r0/platform.json b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/platform.json index 213822ce5116..79546f1730d8 100644 --- a/device/mellanox/x86_64-nvidia_sn5400_simx-r0/platform.json +++ b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/platform.json @@ -1325,9 +1325,9 @@ "1x25G[10G]": ["etp65"] } }, - "Ethernet513": { + "Ethernet520": { "index": "66", - "lanes": "513", + "lanes": "520", "breakout_modes": { "1x25G[10G]": ["etp66"] } From d07b13cd8cc69f51f2b5ff1f742e435bf3be3715 Mon Sep 17 00:00:00 2001 From: Yaqiang Zhu Date: Thu, 6 Jun 2024 00:22:24 +0800 Subject: [PATCH 358/419] [dhcp_relay] Revert cli for dhcp per-interface counter (#19154) * Revert "add show dhcp_relay ipv4 counter entry, fix interface name offset issue (#16507)" This reverts commit 9c1c82e9ff708616017d391213751a3b02492e6d. * Revert "[dhcp-relay]: dhcp/dhcpv6 per interface counter support (#16377)" This reverts commit a522a63e25e2a17ce04c57540117d339fadfb5c5. * Remove test_show_dhcp_relay_ipv4_counter_with_enabled_dhcp_server --- dockers/docker-dhcp-relay/Dockerfile.j2 | 2 - .../test_show_dhcp6relay_counters.py | 44 +++--- .../cli-plugin-tests/test_show_dhcp_relay.py | 10 -- .../cli/show/plugins/show_dhcp_relay.py | 131 +++--------------- sonic-slave-bullseye/Dockerfile.j2 | 1 - 5 files changed, 38 insertions(+), 150 deletions(-) diff --git a/dockers/docker-dhcp-relay/Dockerfile.j2 b/dockers/docker-dhcp-relay/Dockerfile.j2 index a406af404065..a126e6924a46 100644 --- a/dockers/docker-dhcp-relay/Dockerfile.j2 +++ b/dockers/docker-dhcp-relay/Dockerfile.j2 @@ -19,8 +19,6 @@ RUN apt-get install -y libjsoncpp-dev \ RUN pip3 install psutil -RUN apt-get install -y libjsoncpp-dev - {% if docker_dhcp_relay_debs.strip() -%} # Copy built Debian packages {{ copy_files("debs/", docker_dhcp_relay_debs.split(' '), "/debs/") }} diff --git a/dockers/docker-dhcp-relay/cli-plugin-tests/test_show_dhcp6relay_counters.py b/dockers/docker-dhcp-relay/cli-plugin-tests/test_show_dhcp6relay_counters.py index 7f7edca64d0d..3cb2d2bb5443 100644 --- a/dockers/docker-dhcp-relay/cli-plugin-tests/test_show_dhcp6relay_counters.py +++ b/dockers/docker-dhcp-relay/cli-plugin-tests/test_show_dhcp6relay_counters.py @@ -17,21 +17,24 @@ except KeyError: pass -expected_counts_v6 = """\ - Message Type Vlan1000(RX) --------------- --------------- - - Message Type Vlan1000(TX) --------------- --------------- - -""" - -expected_counts_v4 = """\ - Message Type Vlan1000(RX) --------------- --------------- - - Message Type Vlan1000(TX) --------------- --------------- +expected_counts = """\ + Message Type Vlan1000 +------------------- ----------- + Unknown + Solicit + Advertise + Request + Confirm + Renew + Rebind + Reply + Release + Decline + Reconfigure +Information-Request + Relay-Forward + Relay-Reply + Malformed """ @@ -40,14 +43,5 @@ class TestDhcp6RelayCounters(object): def test_show_counts(self): runner = CliRunner() result = runner.invoke(show.dhcp6relay_counters.commands["counts"], ["-i Vlan1000"]) - print(result.output) - assert result.output == expected_counts_v6 - -class TestDhcpRelayCounters(object): - - def test_show_counts(self): - runner = CliRunner() - result = runner.invoke(show.dhcp4relay_counters.commands["counts"], ["-i Vlan1000"]) - print(result.output) - assert result.output == expected_counts_v4 + assert result.output == expected_counts 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 387e052c143a..de55af82d9d4 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 @@ -173,16 +173,6 @@ def test_show_multi_dhcp_relay(test_name, test_data, fs): assert result == expected_output -def test_show_dhcp_relay_ipv4_counter_with_enabled_dhcp_server(): - with mock.patch.object(show, "is_dhcp_server_enabled", return_value=True), \ - mock.patch.object(swsscommon.ConfigDBConnector, "connect", return_value=None), \ - mock.patch.object(swsscommon.ConfigDBConnector, "get_table", return_value=None), \ - mock.patch.object(click, "echo", return_value=None) as mock_echo: - show.ipv4_counters("Etherner1") - expected_param = "Unsupport to check dhcp_relay ipv4 counter when dhcp_server feature is enabled" - mock_echo.assert_called_once_with(expected_param) - - @pytest.mark.parametrize("enable_dhcp_server", [True, False]) def test_is_dhcp_server_enabled(enable_dhcp_server): result = show.is_dhcp_server_enabled({"dhcp_server": {"state": "enabled" if enable_dhcp_server else "disabled"}}) 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 7f99102f9917..d9e87b2b347c 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,5 +1,4 @@ import click -import ast from natsort import natsorted from tabulate import tabulate import show.vlan as show_vlan @@ -8,20 +7,13 @@ from swsscommon.swsscommon import ConfigDBConnector from swsscommon.swsscommon import SonicV2Connector + # STATE_DB Table -DHCPv4_COUNTER_TABLE = 'DHCP_COUNTER_TABLE' DHCPv6_COUNTER_TABLE = 'DHCPv6_COUNTER_TABLE' -# DHCPv4 Counter Messages -dhcpv4_messages = [ - "Unknown", "Discover", "Offer", "Request", "Decline", "Ack", "Nack", "Release", "Inform" -] - # DHCPv6 Counter Messages -dhcpv6_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' @@ -47,80 +39,6 @@ def get_dhcp_helper_address(ctx, vlan): show_vlan.VlanBrief.register_column('DHCP Helper Address', get_dhcp_helper_address) -class DHCPv4_Counter(object): - def __init__(self): - self.db = SonicV2Connector(use_unix_socket_path=False) - self.db.connect(self.db.STATE_DB) - self.table_name = DHCPv4_COUNTER_TABLE + self.db.get_db_separator(self.db.STATE_DB) - - def get_interface(self): - """ Get all names of all interfaces in DHCPv4_COUNTER_TABLE """ - interfaces = [] - for key in self.db.keys(self.db.STATE_DB): - if DHCPv4_COUNTER_TABLE in key: - interfaces.append(key[19:]) - return interfaces - - def get_dhcp4relay_msg_count(self, interface, dir): - """ Get count of a dhcprelay message """ - value = self.db.get(self.db.STATE_DB, self.table_name + str(interface), str(dir)) - cnts = ast.literal_eval(str(value)) - data = [] - if cnts is not None: - for k, v in cnts.items(): - data.append([k, v]) - return data - - def clear_table(self, interface): - """ Reset all message counts to 0 """ - v4_cnts = {} - for msg in dhcpv4_messages: - v4_cnts[msg] = '0' - self.db.set(self.db.STATE_DB, self.table_name + str(interface), str("RX"), str(v4_cnts)) - self.db.set(self.db.STATE_DB, self.table_name + str(interface), str("TX"), str(v4_cnts)) - -def print_dhcpv4_count(counter, intf): - """Print count of each message""" - rx_data = counter.get_dhcp4relay_msg_count(intf, "RX") - print(tabulate(rx_data, headers=["Message Type", intf+"(RX)"], tablefmt='simple', stralign='right') + "\n") - tx_data = counter.get_dhcp4relay_msg_count(intf, "TX") - print(tabulate(tx_data, headers=["Message Type", intf+"(TX)"], tablefmt='simple', stralign='right') + "\n") - -# -# 'dhcp4relay_counters' group ### -# - - -@click.group(cls=clicommon.AliasedGroup, name="dhcp4relay_counters") -def dhcp4relay_counters(): - """Show DHCPv4 counter""" - pass - - -def ipv4_counters(interface): - config_db.connect() - feature_tbl = config_db.get_table("FEATURE") - if is_dhcp_server_enabled(feature_tbl): - click.echo("Unsupport to check dhcp_relay ipv4 counter when dhcp_server feature is enabled") - return - counter = DHCPv4_Counter() - counter_intf = counter.get_interface() - - if interface: - print_dhcpv4_count(counter, interface) - else: - for intf in counter_intf: - print_dhcpv4_count(counter, intf) - - -# 'counts' subcommand ("show dhcp4relay_counters counts") -@dhcp4relay_counters.command('counts') -@click.option('-i', '--interface', required=False) -@click.option('--verbose', is_flag=True, help="Enable verbose output") -def counts(interface, verbose): - """Show dhcp4relay message counts""" - ipv4_counters(interface) - class DHCPv6_Counter(object): def __init__(self): @@ -130,37 +48,30 @@ def __init__(self): def get_interface(self): """ Get all names of all interfaces in DHCPv6_COUNTER_TABLE """ - interfaces = [] + vlans = [] for key in self.db.keys(self.db.STATE_DB): if DHCPv6_COUNTER_TABLE in key: - interfaces.append(key[21:]) - return interfaces + vlans.append(key[21:]) + return vlans - def get_dhcp6relay_msg_count(self, interface, dir): + def get_dhcp6relay_msg_count(self, interface, msg): """ Get count of a dhcp6relay message """ - value = self.db.get(self.db.STATE_DB, self.table_name + str(interface), str(dir)) - cnts = ast.literal_eval(str(value)) - data = [] - if cnts is not None: - for k, v in cnts.items(): - data.append([k, v]) + count = self.db.get(self.db.STATE_DB, self.table_name + str(interface), str(msg)) + data = [str(msg), count] return data def clear_table(self, interface): """ Reset all message counts to 0 """ - v6_cnts = {} - for msg in dhcpv6_messages: - v6_cnts[msg] = '0' - self.db.set(self.db.STATE_DB, self.table_name + str(interface), str("RX"), str(v6_cnts)) - self.db.set(self.db.STATE_DB, self.table_name + str(interface), str("TX"), str(v6_cnts)) + for msg in messages: + self.db.set(self.db.STATE_DB, self.table_name + str(interface), str(msg), '0') -def print_dhcpv6_count(counter, intf): +def print_count(counter, intf): """Print count of each message""" - rx_data = counter.get_dhcp6relay_msg_count(intf, "RX") - print(tabulate(rx_data, headers=["Message Type", intf+"(RX)"], tablefmt='simple', stralign='right') + "\n") - tx_data = counter.get_dhcp6relay_msg_count(intf, "TX") - print(tabulate(tx_data, headers=["Message Type", intf+"(TX)"], tablefmt='simple', stralign='right') + "\n") + 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") # @@ -179,10 +90,10 @@ def ipv6_counters(interface): counter_intf = counter.get_interface() if interface: - print_dhcpv6_count(counter, interface) + print_count(counter, interface) else: for intf in counter_intf: - print_dhcpv6_count(counter, intf) + print_count(counter, intf) # 'counts' subcommand ("show dhcp6relay_counters counts") @@ -191,6 +102,7 @@ def ipv6_counters(interface): @click.option('--verbose', is_flag=True, help="Enable verbose output") def counts(interface, verbose): """Show dhcp6relay message counts""" + ipv6_counters(interface) @@ -296,10 +208,6 @@ def dhcp_relay_ipv4_destination(): def dhcp_relay_ipv6_destination(): get_dhcp_relay(DHCP_RELAY, DHCPV6_SERVERS, with_header=True) -@dhcp_relay_ipv4.command("counters") -@click.option('-i', '--interface', required=False) -def dhcp_relay_ip4counters(interface): - ipv4_counters(interface) @dhcp_relay_ipv6.command("counters") @click.option('-i', '--interface', required=False) @@ -308,7 +216,6 @@ def dhcp_relay_ip6counters(interface): def register(cli): - cli.add_command(dhcp4relay_counters) cli.add_command(dhcp6relay_counters) cli.add_command(dhcp_relay_helper) cli.add_command(dhcp_relay) diff --git a/sonic-slave-bullseye/Dockerfile.j2 b/sonic-slave-bullseye/Dockerfile.j2 index 7bcf438cca82..786ba28733ed 100644 --- a/sonic-slave-bullseye/Dockerfile.j2 +++ b/sonic-slave-bullseye/Dockerfile.j2 @@ -357,7 +357,6 @@ RUN apt-get update && apt-get install -y eatmydata && eatmydata apt-get install # For DHCP Monitor tool libexplain-dev \ libevent-dev \ - libjsoncpp-dev \ # For libyang swig \ # For build dtb From fea763553ed8cdfb6bf2fb92484ee0c6a7fc3912 Mon Sep 17 00:00:00 2001 From: Bobby McGonigle Date: Wed, 5 Jun 2024 16:56:39 -0700 Subject: [PATCH 359/419] Calulcate subport values and fix key error in hwsku.json (#19216) This pull request merges #18499 to 202311 Automatically populate the correct subport value for an interface and insert into config_db.json How to verify it I verified this by checking the output of sonic-cfggen, updating config_db. and checking that both the host and media lane masks were correct for a 400GBASE-DR4 xcvr in both 2x200G-4 mode and 4x100G-2 mode. All links came up and xcvrd prints the correct lanemasks in logs. I also made sure that portconfig.py no longer causes an exception; it only checks for the optional HWSKU value if childports are present in hwsku.json file (this is to make sure we don't break Mellanox hwsku's) I also changed the unit test for config_db generation and ensured the correct values match. The test passes. --- .../sample_output/sample_new_port_config.json | 96 ++++++++++------ .../vs/tests/breakout/test_breakout_cli.py | 8 +- src/sonic-config-engine/portconfig.py | 15 ++- .../tests/sample_output/platform_output.json | 105 ++++++++++++++++-- .../tests/test_cfggen_platformJson.py | 6 +- 5 files changed, 179 insertions(+), 51 deletions(-) diff --git a/platform/vs/tests/breakout/sample_output/sample_new_port_config.json b/platform/vs/tests/breakout/sample_output/sample_new_port_config.json index 442224ea6d6e..2d4cb86a1e51 100644 --- a/platform/vs/tests/breakout/sample_output/sample_new_port_config.json +++ b/platform/vs/tests/breakout/sample_output/sample_new_port_config.json @@ -4,13 +4,15 @@ "alias": "fortyGigE0/2", "lanes": "27,28", "speed": "50000", - "index": "0" + "index": "0", + "subport": "2" }, "Ethernet0": { "alias": "fortyGigE0/0", "lanes": "25,26", "speed": "50000", - "index": "0" + "index": "0", + "subport": "1" } }, "Ethernet12_1x50G_2x25G": { @@ -18,19 +20,22 @@ "alias": "fortyGigE0/12", "lanes": "37,38", "speed": "50000", - "index": "3" + "index": "3", + "subport": "1" }, "Ethernet14": { "alias": "fortyGigE0/14", "lanes": "39", "speed": "25000", - "index": "3" + "index": "3", + "subport": "2" }, "Ethernet15": { "alias": "fortyGigE0/15", "lanes": "40", "speed": "25000", - "index": "3" + "index": "3", + "subport": "3" } }, "Ethernet0_2x50G": { @@ -38,13 +43,15 @@ "alias": "fortyGigE0/2", "lanes": "27,28", "speed": "50000", - "index": "0" + "index": "0", + "subport": "2" }, "Ethernet0": { "alias": "fortyGigE0/0", "lanes": "25,26", "speed": "50000", - "index": "0" + "index": "0", + "subport": "1" } }, "Ethernet0_1x100G": { @@ -52,7 +59,8 @@ "alias": "fortyGigE0/0", "lanes": "25,26,27,28", "speed": "100000", - "index": "0" + "index": "0", + "subport": "1" } }, "Ethernet0_4x25G": { @@ -60,25 +68,29 @@ "alias": "fortyGigE0/2", "lanes": "27", "speed": "25000", - "index": "0" + "index": "0", + "subport": "3" }, "Ethernet3": { "alias": "fortyGigE0/3", "lanes": "28", "speed": "25000", - "index": "0" + "index": "0", + "subport": "4" }, "Ethernet0": { "alias": "fortyGigE0/0", "lanes": "25", "speed": "25000", - "index": "0" + "index": "0", + "subport": "1" }, "Ethernet1": { "alias": "fortyGigE0/1", "lanes": "26", "speed": "25000", - "index": "0" + "index": "0", + "subport": "2" } }, "Ethernet0_2x25G_1x50G": { @@ -86,19 +98,22 @@ "alias": "fortyGigE0/2", "lanes": "27,28", "speed": "50000", - "index": "0" + "index": "0", + "subport": "3" }, "Ethernet0": { "alias": "fortyGigE0/0", "lanes": "25", "speed": "25000", - "index": "0" + "index": "0", + "subport": "1" }, "Ethernet1": { "alias": "fortyGigE0/1", "lanes": "26", "speed": "25000", - "index": "0" + "index": "0", + "subport": "2" } }, "Ethernet0_1x50G_2x25G": { @@ -106,19 +121,22 @@ "alias": "fortyGigE0/2", "lanes": "27", "speed": "25000", - "index": "0" + "index": "0", + "subport": "2" }, "Ethernet3": { "alias": "fortyGigE0/3", "lanes": "28", "speed": "25000", - "index": "0" + "index": "0", + "subport": "3" }, "Ethernet0": { "alias": "fortyGigE0/0", "lanes": "25,26", "speed": "50000", - "index": "0" + "index": "0", + "subport": "1" } }, "Ethernet4_4x25G": { @@ -126,25 +144,29 @@ "alias": "fortyGigE0/6", "lanes": "31", "speed": "25000", - "index": "1" + "index": "1", + "subport": "3" }, "Ethernet7": { "alias": "fortyGigE0/7", "lanes": "32", "speed": "25000", - "index": "1" + "index": "1", + "subport": "4" }, "Ethernet4": { "alias": "fortyGigE0/4", "lanes": "29", "speed": "25000", - "index": "1" + "index": "1", + "subport": "1" }, "Ethernet5": { "alias": "fortyGigE0/5", "lanes": "30", "speed": "25000", - "index": "1" + "index": "1", + "subport": "2" } }, "Ethernet4_2x50G": { @@ -152,13 +174,15 @@ "alias": "fortyGigE0/6", "lanes": "31,32", "speed": "50000", - "index": "1" + "index": "1", + "subport": "2" }, "Ethernet4": { "alias": "fortyGigE0/4", "lanes": "29,30", "speed": "50000", - "index": "1" + "index": "1", + "subport": "1" } }, "Ethernet8_2x50G": { @@ -166,13 +190,15 @@ "alias": "fortyGigE0/8", "lanes": "33,34", "speed": "50000", - "index": "2" + "index": "2", + "subport": "1" }, "Ethernet10": { "alias": "fortyGigE0/10", "lanes": "35,36", "speed": "50000", - "index": "2" + "index": "2", + "subport": "2" } }, "Ethernet8_1x50G_2x25G": { @@ -180,13 +206,15 @@ "alias": "fortyGigE0/10", "lanes": "35", "speed": "25000", - "index": "2" + "index": "2", + "subport": "1" }, "Ethernet11": { "alias": "fortyGigE0/11", "lanes": "36", "speed": "25000", - "index": "2" + "index": "2", + "subport": "2" } }, "Ethernet8_2x25G_1x50G": { @@ -194,19 +222,22 @@ "alias": "fortyGigE0/8", "lanes": "33", "speed": "25000", - "index": "2" + "index": "2", + "subport": "1" }, "Ethernet9": { "alias": "fortyGigE0/9", "lanes": "34", "speed": "25000", - "index": "2" + "index": "2", + "subport": "2" }, "Ethernet10": { "alias": "fortyGigE0/10", "lanes": "35,36", "speed": "50000", - "index": "2" + "index": "2", + "subport": "3" } }, "Ethernet8_1x100G": { @@ -214,7 +245,8 @@ "alias": "fortyGigE0/8", "lanes": "33,34,35,36", "speed": "100000", - "index": "2" + "index": "2", + "subport": "0" } } } diff --git a/platform/vs/tests/breakout/test_breakout_cli.py b/platform/vs/tests/breakout/test_breakout_cli.py index d93dc0e044a6..5a41aae5c2d3 100755 --- a/platform/vs/tests/breakout/test_breakout_cli.py +++ b/platform/vs/tests/breakout/test_breakout_cli.py @@ -74,22 +74,22 @@ def test_breakout_modes(self, dvs): print("**** Breakout Cli test Starts ****") output_dict = self.breakout(dvs, 'Ethernet0', '2x50G') expected_dict = expected["Ethernet0_2x50G"] - assert output_dict == expected_dict + assert output_dict == expected_dict, "output: {} != expected: {}".format(output_dict, expected_dict) print("**** 1X100G --> 2x50G passed ****") output_dict = self.breakout(dvs, 'Ethernet4', '4x25G[10G]') expected_dict = expected["Ethernet4_4x25G"] - assert output_dict == expected_dict + assert output_dict == expected_dict, "output: {} != expected: {}".format(output_dict, expected_dict) print("**** 1X100G --> 4x25G[10G] passed ****") output_dict = self.breakout(dvs, 'Ethernet8', '2x25G(2)+1x50G(2)') expected_dict = expected["Ethernet8_2x25G_1x50G"] - assert output_dict == expected_dict + assert output_dict == expected_dict, "output: {} != expected: {}".format(output_dict, expected_dict) print("**** 1X100G --> 2x25G(2)+1x50G(2) passed ****") output_dict = self.breakout(dvs, 'Ethernet12', '1x50G(2)+2x25G(2)') expected_dict = expected["Ethernet12_1x50G_2x25G"] - assert output_dict == expected_dict + assert output_dict == expected_dict, "output: {} != expected: {}".format(output_dict, expected_dict) print("**** 1X100G --> 1x50G(2)+2x25G(2) passed ****") # TODOFIX: remove comments once #4442 PR got merged and diff --git a/src/sonic-config-engine/portconfig.py b/src/sonic-config-engine/portconfig.py index 81b3dfb8f5bc..6a1f2b1a5c7e 100644 --- a/src/sonic-config-engine/portconfig.py +++ b/src/sonic-config-engine/portconfig.py @@ -37,7 +37,7 @@ BRKOUT_MODE = "default_brkout_mode" CUR_BRKOUT_MODE = "brkout_mode" INTF_KEY = "interfaces" -OPTIONAL_HWSKU_ATTRIBUTES = ["fec", "autoneg", "subport"] +OPTIONAL_HWSKU_ATTRIBUTES = ["fec", "autoneg"] BRKOUT_PATTERN = r'(\d{1,6})x(\d{1,6}G?)(\[(\d{1,6}G?,?)*\])?(\((\d{1,6})\))?' BRKOUT_PATTERN_GROUPS = 6 @@ -353,8 +353,10 @@ def _str_to_entries(self, bmode): def get_config(self): # Ensure that we have corret number of configured lanes lanes_used = 0 + total_num_ports = 0 for entry in self._breakout_mode_entry: lanes_used += entry.num_assigned_lanes + total_num_ports += entry.num_ports if lanes_used > len(self._lanes): raise RuntimeError("Assigned lines count is more that available!") @@ -376,7 +378,8 @@ def get_config(self): 'alias': self._breakout_capabilities[alias_id], 'lanes': ','.join(lanes), 'speed': str(entry.default_speed), - 'index': self._indexes[lane_id] + 'index': self._indexes[lane_id], + 'subport': "0" if total_num_ports == 1 else str(alias_id + 1) } lane_id += lanes_per_port @@ -422,10 +425,12 @@ def parse_platform_json_file(hwsku_json_file, platform_json_file): child_ports = get_child_ports(intf, brkout_mode, platform_json_file) # take optional fields from hwsku.json + hwsku_entry = hwsku_dict[INTF_KEY] for child_port in child_ports: - for key, item in hwsku_dict[INTF_KEY][child_port].items(): - if key in OPTIONAL_HWSKU_ATTRIBUTES: - child_ports.get(child_port)[key] = item + if child_port in hwsku_entry: + for key, item in hwsku_entry[child_port].items(): + if key in OPTIONAL_HWSKU_ATTRIBUTES: + child_ports.get(child_port)[key] = item ports.update(child_ports) diff --git a/src/sonic-config-engine/tests/sample_output/platform_output.json b/src/sonic-config-engine/tests/sample_output/platform_output.json index 4c6cf197c389..6e8f17385269 100644 --- a/src/sonic-config-engine/tests/sample_output/platform_output.json +++ b/src/sonic-config-engine/tests/sample_output/platform_output.json @@ -7,6 +7,7 @@ "alias": "Eth3/1", "pfc_asym": "off", "speed": "25000", + "subport": "1", "tpid": "0x8100" }, "Ethernet9": { @@ -17,6 +18,7 @@ "alias": "Eth3/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet36": { @@ -27,6 +29,7 @@ "alias": "Eth10/1", "pfc_asym": "off", "speed": "50000", + "subport": "1", "tpid": "0x8100" }, "Ethernet98": { @@ -37,6 +40,7 @@ "alias": "Eth25/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet0": { @@ -49,6 +53,7 @@ "alias": "Eth1", "pfc_asym": "off", "speed": "100000", + "subport": "0", "tpid": "0x8100" }, "Ethernet6": { @@ -60,6 +65,7 @@ "alias": "Eth2/2", "pfc_asym": "off", "speed": "50000", + "subport": "2", "tpid": "0x8100" }, "Ethernet4": { @@ -71,6 +77,7 @@ "alias": "Eth2/1", "pfc_asym": "off", "speed": "50000", + "subport": "1", "tpid": "0x8100" }, "Ethernet109": { @@ -81,6 +88,7 @@ "alias": "Eth28/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet108": { @@ -91,6 +99,7 @@ "alias": "Eth28/1", "pfc_asym": "off", "speed": "25000", + "subport": "1", "tpid": "0x8100" }, "Ethernet18": { @@ -101,6 +110,7 @@ "alias": "Eth5/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet100": { @@ -112,6 +122,7 @@ "alias": "Eth26", "pfc_asym": "off", "speed": "100000", + "subport": "0", "tpid": "0x8100" }, "Ethernet34": { @@ -122,6 +133,7 @@ "alias": "Eth9/3", "pfc_asym": "off", "speed": "50000", + "subport": "3", "tpid": "0x8100" }, "Ethernet104": { @@ -132,6 +144,7 @@ "alias": "Eth27/1", "pfc_asym": "off", "speed": "50000", + "subport": "1", "tpid": "0x8100" }, "Ethernet106": { @@ -142,6 +155,7 @@ "alias": "Eth27/2", "pfc_asym": "off", "speed": "50000", + "subport": "2", "tpid": "0x8100" }, "Ethernet94": { @@ -152,6 +166,7 @@ "alias": "Eth24/3", "pfc_asym": "off", "speed": "50000", + "subport": "3", "tpid": "0x8100" }, "Ethernet126": { @@ -162,6 +177,7 @@ "alias": "Eth32/2", "pfc_asym": "off", "speed": "50000", + "subport": "2", "tpid": "0x8100" }, "Ethernet96": { @@ -172,6 +188,7 @@ "alias": "Eth25/1", "pfc_asym": "off", "speed": "50000", + "subport": "1", "tpid": "0x8100" }, "Ethernet124": { @@ -182,6 +199,7 @@ "alias": "Eth32/1", "pfc_asym": "off", "speed": "50000", + "subport": "1", "tpid": "0x8100" }, "Ethernet90": { @@ -192,6 +210,7 @@ "alias": "Eth23/3", "pfc_asym": "off", "speed": "25000", + "subport": "3", "tpid": "0x8100" }, "Ethernet91": { @@ -202,6 +221,7 @@ "alias": "Eth23/4", "pfc_asym": "off", "speed": "25000", + "subport": "4", "tpid": "0x8100" }, "Ethernet92": { @@ -212,6 +232,7 @@ "alias": "Eth24/1", "pfc_asym": "off", "speed": "25000", + "subport": "1", "tpid": "0x8100" }, "Ethernet93": { @@ -222,6 +243,7 @@ "alias": "Eth24/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet50": { @@ -232,6 +254,7 @@ "alias": "Eth13/3", "pfc_asym": "off", "speed": "25000", + "subport": "3", "tpid": "0x8100" }, "Ethernet51": { @@ -242,6 +265,7 @@ "alias": "Eth13/4", "pfc_asym": "off", "speed": "25000", + "subport": "4", "tpid": "0x8100" }, "Ethernet52": { @@ -252,6 +276,7 @@ "alias": "Eth14/1", "pfc_asym": "off", "speed": "25000", + "subport": "1", "tpid": "0x8100" }, "Ethernet53": { @@ -262,6 +287,7 @@ "alias": "Eth14/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet54": { @@ -272,6 +298,7 @@ "alias": "Eth14/3", "pfc_asym": "off", "speed": "50000", + "subport": "3", "tpid": "0x8100" }, "Ethernet99": { @@ -282,6 +309,7 @@ "alias": "Eth25/3", "pfc_asym": "off", "speed": "25000", + "subport": "3", "tpid": "0x8100" }, "Ethernet56": { @@ -292,6 +320,7 @@ "alias": "Eth15/1", "pfc_asym": "off", "speed": "50000", + "subport": "1", "tpid": "0x8100" }, "Ethernet113": { @@ -302,6 +331,7 @@ "alias": "Eth29/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet76": { @@ -312,6 +342,7 @@ "alias": "Eth20/1", "pfc_asym": "off", "speed": "50000", + "subport": "1", "tpid": "0x8100" }, "Ethernet74": { @@ -322,6 +353,7 @@ "alias": "Eth19/3", "pfc_asym": "off", "speed": "50000", + "subport": "3", "tpid": "0x8100" }, "Ethernet39": { @@ -332,6 +364,7 @@ "alias": "Eth10/3", "pfc_asym": "off", "speed": "25000", + "subport": "3", "tpid": "0x8100" }, "Ethernet72": { @@ -342,6 +375,7 @@ "alias": "Eth19/1", "pfc_asym": "off", "speed": "25000", + "subport": "1", "tpid": "0x8100" }, "Ethernet73": { @@ -352,6 +386,7 @@ "alias": "Eth19/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet70": { @@ -362,6 +397,7 @@ "alias": "Eth18/3", "pfc_asym": "off", "speed": "25000", + "subport": "3", "tpid": "0x8100" }, "Ethernet71": { @@ -372,6 +408,7 @@ "alias": "Eth18/4", "pfc_asym": "off", "speed": "25000", + "subport": "4", "tpid": "0x8100" }, "Ethernet32": { @@ -382,6 +419,7 @@ "alias": "Eth9/1", "pfc_asym": "off", "speed": "25000", + "subport": "1", "tpid": "0x8100" }, "Ethernet33": { @@ -392,6 +430,7 @@ "alias": "Eth9/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet16": { @@ -402,6 +441,7 @@ "alias": "Eth5/1", "pfc_asym": "off", "speed": "50000", + "subport": "1", "tpid": "0x8100" }, "Ethernet111": { @@ -412,6 +452,7 @@ "alias": "Eth28/4", "pfc_asym": "off", "speed": "25000", + "subport": "4", "tpid": "0x8100" }, "Ethernet10": { @@ -422,6 +463,7 @@ "alias": "Eth3/3", "pfc_asym": "off", "speed": "25000", + "subport": "3", "tpid": "0x8100" }, "Ethernet11": { @@ -432,6 +474,7 @@ "alias": "Eth3/4", "pfc_asym": "off", "speed": "25000", + "subport": "4", "tpid": "0x8100" }, "Ethernet12": { @@ -442,6 +485,7 @@ "alias": "Eth4/1", "pfc_asym": "off", "speed": "25000", + "subport": "1", "tpid": "0x8100" }, "Ethernet13": { @@ -452,6 +496,7 @@ "alias": "Eth4/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet58": { @@ -462,6 +507,7 @@ "alias": "Eth15/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet19": { @@ -472,6 +518,7 @@ "alias": "Eth5/3", "pfc_asym": "off", "speed": "25000", + "subport": "3", "tpid": "0x8100" }, "Ethernet59": { @@ -482,6 +529,7 @@ "alias": "Eth15/3", "pfc_asym": "off", "speed": "25000", + "subport": "3", "tpid": "0x8100" }, "Ethernet38": { @@ -492,6 +540,7 @@ "alias": "Eth10/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet78": { @@ -502,6 +551,7 @@ "alias": "Eth20/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet68": { @@ -512,6 +562,7 @@ "alias": "Eth18/1", "pfc_asym": "off", "speed": "25000", + "subport": "1", "tpid": "0x8100" }, "Ethernet14": { @@ -522,6 +573,7 @@ "alias": "Eth4/3", "pfc_asym": "off", "speed": "50000", + "subport": "3", "tpid": "0x8100" }, "Ethernet89": { @@ -532,6 +584,7 @@ "alias": "Eth23/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet88": { @@ -542,6 +595,7 @@ "alias": "Eth23/1", "pfc_asym": "off", "speed": "25000", + "subport": "1", "tpid": "0x8100" }, "Ethernet118": { @@ -552,6 +606,7 @@ "alias": "Eth30/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet119": { @@ -562,6 +617,7 @@ "alias": "Eth30/3", "pfc_asym": "off", "speed": "25000", + "subport": "3", "tpid": "0x8100" }, "Ethernet116": { @@ -572,6 +628,7 @@ "alias": "Eth30/1", "pfc_asym": "off", "speed": "50000", + "subport": "1", "tpid": "0x8100" }, "Ethernet114": { @@ -582,6 +639,7 @@ "alias": "Eth29/3", "pfc_asym": "off", "speed": "50000", + "subport": "3", "tpid": "0x8100" }, "Ethernet80": { @@ -593,6 +651,7 @@ "alias": "Eth21", "pfc_asym": "off", "speed": "100000", + "subport": "0", "tpid": "0x8100" }, "Ethernet112": { @@ -603,6 +662,7 @@ "alias": "Eth29/1", "pfc_asym": "off", "speed": "25000", + "subport": "1", "tpid": "0x8100" }, "Ethernet86": { @@ -613,6 +673,7 @@ "alias": "Eth22/2", "pfc_asym": "off", "speed": "50000", + "subport": "2", "tpid": "0x8100" }, "Ethernet110": { @@ -623,6 +684,7 @@ "alias": "Eth28/3", "pfc_asym": "off", "speed": "25000", + "subport": "3", "tpid": "0x8100" }, "Ethernet84": { @@ -633,6 +695,7 @@ "alias": "Eth22/1", "pfc_asym": "off", "speed": "50000", + "subport": "1", "tpid": "0x8100" }, "Ethernet31": { @@ -643,6 +706,7 @@ "alias": "Eth8/4", "pfc_asym": "off", "speed": "25000", + "subport": "4", "tpid": "0x8100" }, "Ethernet49": { @@ -653,6 +717,7 @@ "alias": "Eth13/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet48": { @@ -663,6 +728,7 @@ "alias": "Eth13/1", "pfc_asym": "off", "speed": "25000", + "subport": "1", "tpid": "0x8100" }, "Ethernet46": { @@ -673,6 +739,7 @@ "alias": "Eth12/2", "pfc_asym": "off", "speed": "50000", + "subport": "2", "tpid": "0x8100" }, "Ethernet30": { @@ -683,6 +750,7 @@ "alias": "Eth8/3", "pfc_asym": "off", "speed": "25000", + "subport": "3", "tpid": "0x8100" }, "Ethernet29": { @@ -693,6 +761,7 @@ "alias": "Eth8/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet40": { @@ -704,6 +773,7 @@ "alias": "Eth11", "pfc_asym": "off", "speed": "100000", + "subport": "0", "tpid": "0x8100" }, "Ethernet120": { @@ -715,6 +785,7 @@ "alias": "Eth31", "pfc_asym": "off", "speed": "100000", + "subport": "0", "tpid": "0x8100" }, "Ethernet28": { @@ -725,6 +796,7 @@ "alias": "Eth8/1", "pfc_asym": "off", "speed": "25000", + "subport": "1", "tpid": "0x8100" }, "Ethernet66": { @@ -735,6 +807,7 @@ "alias": "Eth17/2", "pfc_asym": "off", "speed": "50000", + "subport": "2", "tpid": "0x8100" }, "Ethernet60": { @@ -746,6 +819,7 @@ "alias": "Eth16", "pfc_asym": "off", "speed": "100000", + "subport": "0", "tpid": "0x8100" }, "Ethernet64": { @@ -756,6 +830,7 @@ "alias": "Eth17/1", "pfc_asym": "off", "speed": "50000", + "subport": "1", "tpid": "0x8100" }, "Ethernet44": { @@ -766,6 +841,7 @@ "alias": "Eth12/1", "pfc_asym": "off", "speed": "50000", + "subport": "1", "tpid": "0x8100" }, "Ethernet20": { @@ -778,6 +854,7 @@ "alias": "Eth6", "pfc_asym": "off", "speed": "100000", + "subport": "0", "tpid": "0x8100" }, "Ethernet79": { @@ -788,6 +865,7 @@ "alias": "Eth20/3", "pfc_asym": "off", "speed": "25000", + "subport": "3", "tpid": "0x8100" }, "Ethernet69": { @@ -798,6 +876,7 @@ "alias": "Eth18/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet24": { @@ -808,6 +887,7 @@ "alias": "Eth7/1", "pfc_asym": "off", "speed": "50000", + "subport": "1", "tpid": "0x8100" }, "Ethernet26": { @@ -818,6 +898,7 @@ "alias": "Eth7/2", "pfc_asym": "off", "speed": "50000", + "subport": "2", "tpid": "0x8100" }, "Ethernet128": { @@ -828,7 +909,8 @@ "mtu": "9100", "alias": "Eth33", "pfc_asym": "off", - "speed": "40000" + "speed": "40000", + "subport": "0" }, "Ethernet132": { "index": "34", @@ -838,7 +920,8 @@ "mtu": "9100", "alias": "Eth34", "pfc_asym": "off", - "speed": "25000" + "speed": "25000", + "subport": "0" }, "Ethernet136": { "index": "35", @@ -848,7 +931,8 @@ "mtu": "9100", "alias": "Eth35/1", "pfc_asym": "off", - "speed": "10000" + "speed": "10000", + "subport": "1" }, "Ethernet137": { "index": "35", @@ -858,7 +942,8 @@ "mtu": "9100", "alias": "Eth35/2", "pfc_asym": "off", - "speed": "10000" + "speed": "10000", + "subport": "2" }, "Ethernet138": { "index": "35", @@ -868,7 +953,8 @@ "mtu": "9100", "alias": "Eth35/3", "pfc_asym": "off", - "speed": "10000" + "speed": "10000", + "subport": "3" }, "Ethernet139": { "index": "35", @@ -878,7 +964,8 @@ "mtu": "9100", "alias": "Eth35/4", "pfc_asym": "off", - "speed": "10000" + "speed": "10000", + "subport": "4" }, "Ethernet140": { "index": "36", @@ -888,6 +975,7 @@ "mtu": "9100", "alias": "Eth36/1", "pfc_asym": "off", + "subport": "1", "speed": "25000" }, "Ethernet141": { @@ -898,7 +986,8 @@ "mtu": "9100", "alias": "Eth36/2", "pfc_asym": "off", - "speed": "25000" + "speed": "25000", + "subport": "2" }, "Ethernet142": { "index": "36", @@ -908,6 +997,7 @@ "mtu": "9100", "alias": "Eth36/3", "pfc_asym": "off", + "subport": "3", "speed": "50000" }, "Ethernet144": { @@ -919,6 +1009,7 @@ "alias": "Eth37", "pfc_asym": "off", "speed": "100000", + "subport": "0", "fec": "rs" } } diff --git a/src/sonic-config-engine/tests/test_cfggen_platformJson.py b/src/sonic-config-engine/tests/test_cfggen_platformJson.py index 5d39fd2f3660..4a255ba5d4c1 100644 --- a/src/sonic-config-engine/tests/test_cfggen_platformJson.py +++ b/src/sonic-config-engine/tests/test_cfggen_platformJson.py @@ -79,19 +79,19 @@ def test_platform_json_specific_ethernet_interfaces(self): argument = ['-m', self.platform_sample_graph, '-p', self.platform_json, '-S', self.hwsku_json, '-v', "PORT[\'Ethernet8\']"] output = self.run_script(argument) self.maxDiff = None - expected = "{'index': '3', 'lanes': '8', 'description': 'Eth3/1', 'mtu': '9100', 'alias': 'Eth3/1', 'pfc_asym': 'off', 'speed': '25000', 'tpid': '0x8100'}" + expected = "{'index': '3', 'lanes': '8', 'description': 'Eth3/1', 'mtu': '9100', 'alias': 'Eth3/1', 'pfc_asym': 'off', 'speed': '25000', 'subport': '1', 'tpid': '0x8100'}" self.assertEqual(utils.to_dict(output.strip()), utils.to_dict(expected)) argument = ['-m', self.platform_sample_graph, '-p', self.platform_json, '-S', self.hwsku_json, '-v', "PORT[\'Ethernet112\']"] output = self.run_script(argument) self.maxDiff = None - expected = "{'index': '29', 'lanes': '112', 'description': 'Eth29/1', 'mtu': '9100', 'alias': 'Eth29/1', 'pfc_asym': 'off', 'speed': '25000', 'tpid': '0x8100'}" + expected = "{'index': '29', 'lanes': '112', 'description': 'Eth29/1', 'mtu': '9100', 'alias': 'Eth29/1', 'pfc_asym': 'off', 'speed': '25000', 'subport': '1', 'tpid': '0x8100'}" self.assertEqual(utils.to_dict(output.strip()), utils.to_dict(expected)) argument = ['-m', self.platform_sample_graph, '-p', self.platform_json, '-S', self.hwsku_json, '-v', "PORT[\'Ethernet4\']"] output = self.run_script(argument) self.maxDiff = None - expected = "{'index': '2', 'lanes': '4,5', 'description': 'Eth2/1', 'admin_status': 'up', 'mtu': '9100', 'alias': 'Eth2/1', 'pfc_asym': 'off', 'speed': '50000', 'tpid': '0x8100'}" + expected = "{'index': '2', 'lanes': '4,5', 'description': 'Eth2/1', 'admin_status': 'up', 'mtu': '9100', 'alias': 'Eth2/1', 'pfc_asym': 'off', 'speed': '50000', 'subport': '1', 'tpid': '0x8100'}" print(output.strip()) self.assertEqual(utils.to_dict(output.strip()), utils.to_dict(expected)) From d06ae81137c139b57c3e69480ac1d164b2990f91 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 6 Jun 2024 19:01:17 +0800 Subject: [PATCH 360/419] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#19223) #### Why I did it src/sonic-utilities ``` * 735891cc - (HEAD -> 202311, origin/202311) [Mellanpx] Update SDK Sniffer default folder (#3276) (19 hours ago) [Dror Prital] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index f35453ea9175..735891cc502c 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit f35453ea9175a11ed9ce224ce31e3399e4ab67fd +Subproject commit 735891cc502c17c87817820c163a0b9633b2f663 From a9d4383d0a0d34a48b568c0bdc2fa2404ac75574 Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Thu, 6 Jun 2024 17:27:18 +0800 Subject: [PATCH 361/419] [Mellanox] Disable TPM on SN5600 and SN5400 platform (#19221) Disable TPM module for SN5600 and SN5400 to avoid following error message: ERR kernel: [ 3.434153] tpm tpm0: [Firmware Bug]: TPM interrupt not working, polling instead --- device/mellanox/x86_64-nvidia_sn5400-r0/installer.conf | 1 + device/mellanox/x86_64-nvidia_sn5600-r0/installer.conf | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 device/mellanox/x86_64-nvidia_sn5400-r0/installer.conf diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/installer.conf b/device/mellanox/x86_64-nvidia_sn5400-r0/installer.conf new file mode 100644 index 000000000000..d43a240ee0ad --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/installer.conf @@ -0,0 +1 @@ +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="modprobe.blacklist=tpm_tis,tpm_crb,tpm" diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/installer.conf b/device/mellanox/x86_64-nvidia_sn5600-r0/installer.conf index c46f0eb7a459..306cde03b174 100644 --- a/device/mellanox/x86_64-nvidia_sn5600-r0/installer.conf +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/installer.conf @@ -1 +1 @@ -ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="libata.force=noncq" +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="libata.force=noncq modprobe.blacklist=tpm_tis,tpm_crb,tpm" From 85f8039550c16e4cc39e225318d2cc487ec066d5 Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Fri, 7 Jun 2024 10:38:13 -0700 Subject: [PATCH 362/419] [Mellanox]Enable forwarding of packets with link local SIP/DIP on specific platforms (#18487) (#18692) - Why I did it Enable forwarding of packets with link local SIP/DIP on specific platforms and SKUs. - How I did it Setting SAI key value pair SAI_NOT_DROP_SIP_DIP_LINK_LOCAL=1 - How to verify it Manual test to verify that packets with link local SIP/DIP are not dropped --- .../x86_64-mlnx_msn2700-r0/Mellanox-SN2700-C28D8/sai.profile | 1 + .../x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/sai.profile | 1 + .../x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D44C10/sai.profile | 1 + .../x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/sai.profile | 1 + .../mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/sai.profile | 1 + .../x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/sai.profile | 1 + .../x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/sai.profile | 1 + .../x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/sai.profile | 1 + .../x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/sai.profile | 1 + .../x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/sai.profile | 1 + .../x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/sai.profile | 1 + .../x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/sai.profile | 1 + .../Mellanox-SN4600C-D100C12S2/sai.profile | 1 + .../x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/sai.profile | 1 + .../x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/sai.profile | 1 + .../x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O28/sai.profile | 1 + .../x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/sai.profile | 1 + .../x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/sai.profile | 1 + 18 files changed, 18 insertions(+) diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-C28D8/sai.profile b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-C28D8/sai.profile index 5ee219f34380..d46666d4f401 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-C28D8/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-C28D8/sai.profile @@ -1,2 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_2700_8x50g_28x100g.xml SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 +SAI_NOT_DROP_SIP_DIP_LINK_LOCAL=1 diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/sai.profile b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/sai.profile index 8498641f522a..a5048444f869 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/sai.profile @@ -1,2 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_2700_8x100g_40x50g_8x10g.xml SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 +SAI_NOT_DROP_SIP_DIP_LINK_LOCAL=1 diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D44C10/sai.profile b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D44C10/sai.profile index 7a2add983f13..fa53ebdff536 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D44C10/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D44C10/sai.profile @@ -1,2 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_2700_44x50g_10x100g.xml SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 +SAI_NOT_DROP_SIP_DIP_LINK_LOCAL=1 diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/sai.profile b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/sai.profile index 1d1563cd61a6..d57fccbf9b1c 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/sai.profile @@ -1,2 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_2700_48x50g_8x100g.xml SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 +SAI_NOT_DROP_SIP_DIP_LINK_LOCAL=1 diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/sai.profile b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/sai.profile index f1c554fa521a..6b1de1004f49 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/sai.profile @@ -1,2 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_2700.xml SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 +SAI_NOT_DROP_SIP_DIP_LINK_LOCAL=1 diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/sai.profile b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/sai.profile index 011612d978df..496a9f7e5201 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/sai.profile @@ -1,2 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_3800.xml SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 +SAI_NOT_DROP_SIP_DIP_LINK_LOCAL=1 diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/sai.profile b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/sai.profile index a0d219afc68b..c0e8d6c99263 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/sai.profile @@ -1,2 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_3800_2x10g_100x50g_12x100g.xml SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 +SAI_NOT_DROP_SIP_DIP_LINK_LOCAL=1 diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/sai.profile b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/sai.profile index eba550e54e21..2f7cd86f9cac 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/sai.profile @@ -1,2 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_3800_112x50g_8x100g.xml SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 +SAI_NOT_DROP_SIP_DIP_LINK_LOCAL=1 diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/sai.profile b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/sai.profile index f7d985529020..a1a8a5e9cdd8 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/sai.profile @@ -1,2 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_3800_24x50g_52x100g.xml SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 +SAI_NOT_DROP_SIP_DIP_LINK_LOCAL=1 diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/sai.profile b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/sai.profile index 1ad3746399d6..8c0a39c92f80 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/sai.profile @@ -1,2 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_3800_1x10g_28x50g_49x100g.xml SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 +SAI_NOT_DROP_SIP_DIP_LINK_LOCAL=1 diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/sai.profile b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/sai.profile index 0e989e17cfe9..797fcf20d127 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/sai.profile @@ -1,2 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_3800_28x50g_52x100g.xml SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 +SAI_NOT_DROP_SIP_DIP_LINK_LOCAL=1 diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/sai.profile b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/sai.profile index 3324d5b4b6c9..ed8a39a5478a 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/sai.profile @@ -1,2 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4600C.xml SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 +SAI_NOT_DROP_SIP_DIP_LINK_LOCAL=1 diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/sai.profile b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/sai.profile index acf46cd351f5..f6b3dd881bee 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/sai.profile @@ -1,2 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4600c_100x50g_12x100g_2x10g.xml SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 +SAI_NOT_DROP_SIP_DIP_LINK_LOCAL=1 diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/sai.profile b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/sai.profile index cbe1b241b5f0..5ad44c25f813 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/sai.profile @@ -1,2 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4600c_112x50g_8x100g.xml SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 +SAI_NOT_DROP_SIP_DIP_LINK_LOCAL=1 diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/sai.profile b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/sai.profile index 5d63094db5a7..0a21cefc0908 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/sai.profile @@ -1,2 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4600c_48x50g_40x100g.xml SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 +SAI_NOT_DROP_SIP_DIP_LINK_LOCAL=1 diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O28/sai.profile b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O28/sai.profile index e246cad50ad8..ce681d79ba47 100644 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O28/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O28/sai.profile @@ -1,2 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4700.xml SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 +SAI_NOT_DROP_SIP_DIP_LINK_LOCAL=1 diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/sai.profile b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/sai.profile index 84bc4f66adaf..50dc9ae212cb 100644 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/sai.profile @@ -1,3 +1,4 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4700_8x400g_48x100g.xml SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 +SAI_NOT_DROP_SIP_DIP_LINK_LOCAL=1 SAI_INDEPENDENT_MODULE_MODE=1 diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/sai.profile b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/sai.profile index c385087822be..9e8b5d03d7e8 100644 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/sai.profile @@ -1,3 +1,4 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4700_8x400g_48x200g.xml SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 +SAI_NOT_DROP_SIP_DIP_LINK_LOCAL=1 SAI_INDEPENDENT_MODULE_MODE=1 From a30cbd4f02fff86c5d1a88daa094efe83643fd5d Mon Sep 17 00:00:00 2001 From: Stepan Blyshchak <38952541+stepanblyschak@users.noreply.github.com> Date: Fri, 7 Jun 2024 20:41:36 +0300 Subject: [PATCH 363/419] [202311][Mellanox] Remove pmon delay for certain platforms (#19208) * [nvidia] Remove pmon delay for certain platforms Signed-off-by: Stepan Blyschak * Remove xcvrd delay for SN4700 SKUs Signed-off-by: Stepan Blyschak --------- Signed-off-by: Stepan Blyschak --- .../x86_64-mlnx_msn4410-r0/pmon_daemon_control.json | 2 +- .../x86_64-mlnx_msn4410-r0/pmon_immediate_start | 0 .../x86_64-mlnx_msn4600-r0/pmon_daemon_control.json | 2 +- .../x86_64-mlnx_msn4600-r0/pmon_immediate_start | 0 .../pmon_daemon_control.json | 2 +- .../x86_64-mlnx_msn4600c-r0/pmon_immediate_start | 0 .../Mellanox-SN4700-O8C48/pmon_daemon_control.json | 2 +- .../Mellanox-SN4700-O8V48/pmon_daemon_control.json | 2 +- .../x86_64-mlnx_msn4700-r0/pmon_daemon_control.json | 7 ++++++- .../x86_64-mlnx_msn4700-r0/pmon_immediate_start | 0 .../pmon_immediate_start | 0 .../pmon_daemon_control.json | 2 +- .../x86_64-nvidia_sn4800-r0/pmon_immediate_start | 0 .../pmon_daemon_control.json | 2 +- .../pmon_immediate_start | 0 .../pmon_daemon_control.json | 2 +- .../x86_64-nvidia_sn5400-r0/pmon_immediate_start | 0 .../pmon_daemon_control.json | 2 +- .../pmon_immediate_start | 0 .../pmon_daemon_control.json | 7 ++++++- .../x86_64-nvidia_sn5600-r0/pmon_immediate_start | 0 .../pmon_immediate_start | 0 files/scripts/syncd.sh | 13 +++++-------- 23 files changed, 26 insertions(+), 19 deletions(-) create mode 100644 device/mellanox/x86_64-mlnx_msn4410-r0/pmon_immediate_start create mode 100644 device/mellanox/x86_64-mlnx_msn4600-r0/pmon_immediate_start create mode 100644 device/mellanox/x86_64-mlnx_msn4600c-r0/pmon_immediate_start mode change 120000 => 100644 device/mellanox/x86_64-mlnx_msn4700-r0/pmon_daemon_control.json create mode 100644 device/mellanox/x86_64-mlnx_msn4700-r0/pmon_immediate_start create mode 100644 device/mellanox/x86_64-mlnx_msn4700_simx-r0/pmon_immediate_start create mode 100644 device/mellanox/x86_64-nvidia_sn4800-r0/pmon_immediate_start create mode 100644 device/mellanox/x86_64-nvidia_sn4800_simx-r0/pmon_immediate_start create mode 100644 device/mellanox/x86_64-nvidia_sn5400-r0/pmon_immediate_start create mode 100644 device/mellanox/x86_64-nvidia_sn5400_simx-r0/pmon_immediate_start mode change 120000 => 100644 device/mellanox/x86_64-nvidia_sn5600-r0/pmon_daemon_control.json create mode 100644 device/mellanox/x86_64-nvidia_sn5600-r0/pmon_immediate_start create mode 100644 device/mellanox/x86_64-nvidia_sn5600_simx-r0/pmon_immediate_start diff --git a/device/mellanox/x86_64-mlnx_msn4410-r0/pmon_daemon_control.json b/device/mellanox/x86_64-mlnx_msn4410-r0/pmon_daemon_control.json index 435a2ce7c0ba..af0a90e77603 120000 --- a/device/mellanox/x86_64-mlnx_msn4410-r0/pmon_daemon_control.json +++ b/device/mellanox/x86_64-mlnx_msn4410-r0/pmon_daemon_control.json @@ -1 +1 @@ -../x86_64-mlnx_msn2700-r0/pmon_daemon_control.json \ No newline at end of file +../x86_64-mlnx_msn4700-r0/pmon_daemon_control.json \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4410-r0/pmon_immediate_start b/device/mellanox/x86_64-mlnx_msn4410-r0/pmon_immediate_start new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/pmon_daemon_control.json b/device/mellanox/x86_64-mlnx_msn4600-r0/pmon_daemon_control.json index 435a2ce7c0ba..af0a90e77603 120000 --- a/device/mellanox/x86_64-mlnx_msn4600-r0/pmon_daemon_control.json +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/pmon_daemon_control.json @@ -1 +1 @@ -../x86_64-mlnx_msn2700-r0/pmon_daemon_control.json \ No newline at end of file +../x86_64-mlnx_msn4700-r0/pmon_daemon_control.json \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/pmon_immediate_start b/device/mellanox/x86_64-mlnx_msn4600-r0/pmon_immediate_start new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/pmon_daemon_control.json b/device/mellanox/x86_64-mlnx_msn4600c-r0/pmon_daemon_control.json index 435a2ce7c0ba..af0a90e77603 120000 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/pmon_daemon_control.json +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/pmon_daemon_control.json @@ -1 +1 @@ -../x86_64-mlnx_msn2700-r0/pmon_daemon_control.json \ No newline at end of file +../x86_64-mlnx_msn4700-r0/pmon_daemon_control.json \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/pmon_immediate_start b/device/mellanox/x86_64-mlnx_msn4600c-r0/pmon_immediate_start new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/pmon_daemon_control.json b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/pmon_daemon_control.json index ac8cc05f63dc..3ada0d34478e 100644 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/pmon_daemon_control.json +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/pmon_daemon_control.json @@ -1,6 +1,6 @@ { "skip_ledd": true, "skip_fancontrol": true, - "delay_xcvrd": true, + "delay_xcvrd": false, "skip_xcvrd_cmis_mgr": false } diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/pmon_daemon_control.json b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/pmon_daemon_control.json index ac8cc05f63dc..3ada0d34478e 100644 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/pmon_daemon_control.json +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/pmon_daemon_control.json @@ -1,6 +1,6 @@ { "skip_ledd": true, "skip_fancontrol": true, - "delay_xcvrd": true, + "delay_xcvrd": false, "skip_xcvrd_cmis_mgr": false } diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/pmon_daemon_control.json b/device/mellanox/x86_64-mlnx_msn4700-r0/pmon_daemon_control.json deleted file mode 120000 index 435a2ce7c0ba..000000000000 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/pmon_daemon_control.json +++ /dev/null @@ -1 +0,0 @@ -../x86_64-mlnx_msn2700-r0/pmon_daemon_control.json \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/pmon_daemon_control.json b/device/mellanox/x86_64-mlnx_msn4700-r0/pmon_daemon_control.json new file mode 100644 index 000000000000..fefdfb327396 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/pmon_daemon_control.json @@ -0,0 +1,6 @@ +{ + "skip_ledd": true, + "skip_fancontrol": true, + "skip_xcvrd_cmis_mgr": true +} + diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/pmon_immediate_start b/device/mellanox/x86_64-mlnx_msn4700-r0/pmon_immediate_start new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/device/mellanox/x86_64-mlnx_msn4700_simx-r0/pmon_immediate_start b/device/mellanox/x86_64-mlnx_msn4700_simx-r0/pmon_immediate_start new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/device/mellanox/x86_64-nvidia_sn4800-r0/pmon_daemon_control.json b/device/mellanox/x86_64-nvidia_sn4800-r0/pmon_daemon_control.json index 435a2ce7c0ba..af0a90e77603 120000 --- a/device/mellanox/x86_64-nvidia_sn4800-r0/pmon_daemon_control.json +++ b/device/mellanox/x86_64-nvidia_sn4800-r0/pmon_daemon_control.json @@ -1 +1 @@ -../x86_64-mlnx_msn2700-r0/pmon_daemon_control.json \ No newline at end of file +../x86_64-mlnx_msn4700-r0/pmon_daemon_control.json \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn4800-r0/pmon_immediate_start b/device/mellanox/x86_64-nvidia_sn4800-r0/pmon_immediate_start new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/device/mellanox/x86_64-nvidia_sn4800_simx-r0/pmon_daemon_control.json b/device/mellanox/x86_64-nvidia_sn4800_simx-r0/pmon_daemon_control.json index d9fa54f8d2b9..af0a90e77603 120000 --- a/device/mellanox/x86_64-nvidia_sn4800_simx-r0/pmon_daemon_control.json +++ b/device/mellanox/x86_64-nvidia_sn4800_simx-r0/pmon_daemon_control.json @@ -1 +1 @@ -../x86_64-mlnx_msn2700_simx-r0/pmon_daemon_control.json \ No newline at end of file +../x86_64-mlnx_msn4700-r0/pmon_daemon_control.json \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn4800_simx-r0/pmon_immediate_start b/device/mellanox/x86_64-nvidia_sn4800_simx-r0/pmon_immediate_start new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/pmon_daemon_control.json b/device/mellanox/x86_64-nvidia_sn5400-r0/pmon_daemon_control.json index 435a2ce7c0ba..f56b32678200 120000 --- a/device/mellanox/x86_64-nvidia_sn5400-r0/pmon_daemon_control.json +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/pmon_daemon_control.json @@ -1 +1 @@ -../x86_64-mlnx_msn2700-r0/pmon_daemon_control.json \ No newline at end of file +../x86_64-nvidia_sn5600-r0/pmon_daemon_control.json \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/pmon_immediate_start b/device/mellanox/x86_64-nvidia_sn5400-r0/pmon_immediate_start new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/device/mellanox/x86_64-nvidia_sn5400_simx-r0/pmon_daemon_control.json b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/pmon_daemon_control.json index 435a2ce7c0ba..f56b32678200 120000 --- a/device/mellanox/x86_64-nvidia_sn5400_simx-r0/pmon_daemon_control.json +++ b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/pmon_daemon_control.json @@ -1 +1 @@ -../x86_64-mlnx_msn2700-r0/pmon_daemon_control.json \ No newline at end of file +../x86_64-nvidia_sn5600-r0/pmon_daemon_control.json \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5400_simx-r0/pmon_immediate_start b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/pmon_immediate_start new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/pmon_daemon_control.json b/device/mellanox/x86_64-nvidia_sn5600-r0/pmon_daemon_control.json deleted file mode 120000 index 435a2ce7c0ba..000000000000 --- a/device/mellanox/x86_64-nvidia_sn5600-r0/pmon_daemon_control.json +++ /dev/null @@ -1 +0,0 @@ -../x86_64-mlnx_msn2700-r0/pmon_daemon_control.json \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/pmon_daemon_control.json b/device/mellanox/x86_64-nvidia_sn5600-r0/pmon_daemon_control.json new file mode 100644 index 000000000000..fefdfb327396 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/pmon_daemon_control.json @@ -0,0 +1,6 @@ +{ + "skip_ledd": true, + "skip_fancontrol": true, + "skip_xcvrd_cmis_mgr": true +} + diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/pmon_immediate_start b/device/mellanox/x86_64-nvidia_sn5600-r0/pmon_immediate_start new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/device/mellanox/x86_64-nvidia_sn5600_simx-r0/pmon_immediate_start b/device/mellanox/x86_64-nvidia_sn5600_simx-r0/pmon_immediate_start new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/files/scripts/syncd.sh b/files/scripts/syncd.sh index e9c2cfd494ba..fbd5a2e7acf3 100755 --- a/files/scripts/syncd.sh +++ b/files/scripts/syncd.sh @@ -57,7 +57,7 @@ function startplatform() { platform=$aboot_platform elif [ -n "$onie_platform" ]; then platform=$onie_platform - else + else platform="unknown" fi if [[ x"$platform" == x"x86_64-arista_720dt_48s" ]]; then @@ -92,13 +92,10 @@ function waitplatform() { BOOT_TYPE=`getBootType` if [[ x"$sonic_asic_platform" == x"mellanox" ]]; then - if [[ x"$BOOT_TYPE" = @(x"fast"|x"warm"|x"fastfast") ]]; then - PMON_TIMER_STATUS=$(systemctl is-active pmon.timer) - if [[ x"$PMON_TIMER_STATUS" = x"inactive" ]]; then - systemctl start pmon.timer - else - debug "PMON service is delayed by a timer for better fast/warm boot performance" - fi + PLATFORM=`$SONIC_DB_CLI CONFIG_DB hget 'DEVICE_METADATA|localhost' platform` + PMON_IMMEDIATE_START="/usr/share/sonic/device/$PLATFORM/pmon_immediate_start" + if [[ x"$BOOT_TYPE" = @(x"fast"|x"warm"|x"fastfast") ]] && [[ ! -f $PMON_IMMEDIATE_START ]]; then + debug "PMON service is delayed by for better fast/warm boot performance" else debug "Starting pmon service..." /bin/systemctl start pmon From 4e6edb0fbdb015b4f6913f1ae55fdb12f6c8d46d Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 8 Jun 2024 14:04:22 +0800 Subject: [PATCH 364/419] [Arista]: Add QoS configurations for Quicksilver (#19161) (#19249) These are likely not the optimal configurations but a first draft. Most of QuicksilverP and QuicksilverDD HwSku should be supported. Co-authored-by: rick-arista <148895369+rick-arista@users.noreply.github.com> Co-authored-by: Samuel Angebault --- .../Arista-7060X6-64DE-64x400G/BALANCED | 1 + .../buffers.json.j2 | 2 ++ .../buffers_defaults_t0.j2 | 1 + .../buffers_defaults_t1.j2 | 1 + .../pg_profile_lookup.ini | 1 + .../Arista-7060X6-64DE-64x400G/qos.json.j2 | 1 + .../Arista-7060X6-64DE/BALANCED | 1 + .../Arista-7060X6-64DE/buffers.json.j2 | 2 ++ .../Arista-7060X6-64DE/buffers_defaults_t0.j2 | 1 + .../Arista-7060X6-64DE/buffers_defaults_t1.j2 | 1 + .../Arista-7060X6-64DE/pg_profile_lookup.ini | 1 + .../Arista-7060X6-64DE/qos.json.j2 | 1 + .../Arista-7060X6-64PE-128x400G/BALANCED | 1 + .../buffer_ports.j2 | 6 ++++ .../buffers.json.j2 | 2 ++ .../buffers_defaults_t0.j2 | 1 + .../buffers_defaults_t1.j2 | 1 + .../pg_profile_lookup.ini | 1 + .../Arista-7060X6-64PE-128x400G/qos.json.j2 | 1 + .../Arista-7060X6-64PE-256x200G/BALANCED | 1 + .../buffer_ports.j2 | 6 ++++ .../buffers.json.j2 | 2 ++ .../buffers_defaults_t0.j2 | 1 + .../buffers_defaults_t1.j2 | 1 + .../pg_profile_lookup.ini | 1 + .../Arista-7060X6-64PE-256x200G/qos.json.j2 | 1 + .../Arista-7060X6-64PE-64x400G/BALANCED | 1 + .../buffer_ports.j2 | 6 ++++ .../buffers.json.j2 | 2 ++ .../buffers_defaults_t0.j2 | 1 + .../buffers_defaults_t1.j2 | 1 + .../pg_profile_lookup.ini | 1 + .../Arista-7060X6-64PE-64x400G/qos.json.j2 | 1 + .../Arista-7060X6-64PE/BALANCED | 1 + .../Arista-7060X6-64PE/buffer_ports.j2 | 6 ++++ .../Arista-7060X6-64PE/buffers.json.j2 | 2 ++ .../Arista-7060X6-64PE/buffers_defaults_t0.j2 | 1 + .../Arista-7060X6-64PE/buffers_defaults_t1.j2 | 1 + .../Arista-7060X6-64PE/pg_profile_lookup.ini | 1 + .../Arista-7060X6-64PE/qos.json.j2 | 1 + .../th5/gen/BALANCED/buffers_defaults_t0.j2 | 36 +++++++++++++++++++ .../th5/gen/BALANCED/buffers_defaults_t1.j2 | 36 +++++++++++++++++++ .../th5/gen/BALANCED/pg_profile_lookup.ini | 20 +++++++++++ 43 files changed, 158 insertions(+) create mode 120000 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/BALANCED create mode 100644 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/buffers.json.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/buffers_defaults_t0.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/buffers_defaults_t1.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/pg_profile_lookup.ini create mode 100644 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/qos.json.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/BALANCED create mode 100644 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/buffers.json.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/buffers_defaults_t0.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/buffers_defaults_t1.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/pg_profile_lookup.ini create mode 100644 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/qos.json.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/BALANCED create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/buffer_ports.j2 create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/buffers.json.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/buffers_defaults_t0.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/buffers_defaults_t1.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/pg_profile_lookup.ini create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/qos.json.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/BALANCED create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/buffer_ports.j2 create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/buffers.json.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/buffers_defaults_t0.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/buffers_defaults_t1.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/pg_profile_lookup.ini create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/qos.json.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/BALANCED create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/buffer_ports.j2 create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/buffers.json.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/buffers_defaults_t0.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/buffers_defaults_t1.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/pg_profile_lookup.ini create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/qos.json.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/BALANCED create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/buffer_ports.j2 create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/buffers.json.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/buffers_defaults_t0.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/buffers_defaults_t1.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/pg_profile_lookup.ini create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/qos.json.j2 create mode 100644 device/common/profiles/th5/gen/BALANCED/buffers_defaults_t0.j2 create mode 100644 device/common/profiles/th5/gen/BALANCED/buffers_defaults_t1.j2 create mode 100644 device/common/profiles/th5/gen/BALANCED/pg_profile_lookup.ini diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/BALANCED b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/BALANCED new file mode 120000 index 000000000000..afd21766cc64 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/BALANCED @@ -0,0 +1 @@ +../../../common/profiles/th5/gen/BALANCED \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/buffers.json.j2 b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/buffers.json.j2 new file mode 100644 index 000000000000..0b1cb2c541b6 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/buffers.json.j2 @@ -0,0 +1,2 @@ +{%- set default_topo = 't1' %} +{%- include 'buffers_config.j2' %} diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..9524e6a476ac --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/buffers_defaults_t1.j2 b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/buffers_defaults_t1.j2 new file mode 120000 index 000000000000..c25cc95d6d57 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/buffers_defaults_t1.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/pg_profile_lookup.ini b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/pg_profile_lookup.ini new file mode 120000 index 000000000000..297cddb2d223 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/pg_profile_lookup.ini @@ -0,0 +1 @@ +BALANCED/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/qos.json.j2 b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/qos.json.j2 new file mode 100644 index 000000000000..3e548325ea30 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/qos.json.j2 @@ -0,0 +1 @@ +{%- include 'qos_config.j2' %} diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/BALANCED b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/BALANCED new file mode 120000 index 000000000000..afd21766cc64 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/BALANCED @@ -0,0 +1 @@ +../../../common/profiles/th5/gen/BALANCED \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/buffers.json.j2 b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/buffers.json.j2 new file mode 100644 index 000000000000..0b1cb2c541b6 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/buffers.json.j2 @@ -0,0 +1,2 @@ +{%- set default_topo = 't1' %} +{%- include 'buffers_config.j2' %} diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..9524e6a476ac --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/buffers_defaults_t1.j2 b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/buffers_defaults_t1.j2 new file mode 120000 index 000000000000..c25cc95d6d57 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/buffers_defaults_t1.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/pg_profile_lookup.ini b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/pg_profile_lookup.ini new file mode 120000 index 000000000000..297cddb2d223 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/pg_profile_lookup.ini @@ -0,0 +1 @@ +BALANCED/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/qos.json.j2 b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/qos.json.j2 new file mode 100644 index 000000000000..3e548325ea30 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/qos.json.j2 @@ -0,0 +1 @@ +{%- include 'qos_config.j2' %} diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/BALANCED b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/BALANCED new file mode 120000 index 000000000000..afd21766cc64 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/BALANCED @@ -0,0 +1 @@ +../../../common/profiles/th5/gen/BALANCED \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/buffer_ports.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/buffer_ports.j2 new file mode 100644 index 000000000000..725347049cf1 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/buffer_ports.j2 @@ -0,0 +1,6 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0, 512, 4) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/buffers.json.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/buffers.json.j2 new file mode 100644 index 000000000000..0b1cb2c541b6 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/buffers.json.j2 @@ -0,0 +1,2 @@ +{%- set default_topo = 't1' %} +{%- include 'buffers_config.j2' %} diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..9524e6a476ac --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/buffers_defaults_t1.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/buffers_defaults_t1.j2 new file mode 120000 index 000000000000..c25cc95d6d57 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/buffers_defaults_t1.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/pg_profile_lookup.ini b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/pg_profile_lookup.ini new file mode 120000 index 000000000000..297cddb2d223 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/pg_profile_lookup.ini @@ -0,0 +1 @@ +BALANCED/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/qos.json.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/qos.json.j2 new file mode 100644 index 000000000000..3e548325ea30 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/qos.json.j2 @@ -0,0 +1 @@ +{%- include 'qos_config.j2' %} diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/BALANCED b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/BALANCED new file mode 120000 index 000000000000..afd21766cc64 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/BALANCED @@ -0,0 +1 @@ +../../../common/profiles/th5/gen/BALANCED \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/buffer_ports.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/buffer_ports.j2 new file mode 100644 index 000000000000..55d8aacb3400 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/buffer_ports.j2 @@ -0,0 +1,6 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0, 512, 2) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/buffers.json.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/buffers.json.j2 new file mode 100644 index 000000000000..0b1cb2c541b6 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/buffers.json.j2 @@ -0,0 +1,2 @@ +{%- set default_topo = 't1' %} +{%- include 'buffers_config.j2' %} diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..9524e6a476ac --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/buffers_defaults_t1.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/buffers_defaults_t1.j2 new file mode 120000 index 000000000000..c25cc95d6d57 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/buffers_defaults_t1.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/pg_profile_lookup.ini b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/pg_profile_lookup.ini new file mode 120000 index 000000000000..297cddb2d223 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/pg_profile_lookup.ini @@ -0,0 +1 @@ +BALANCED/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/qos.json.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/qos.json.j2 new file mode 100644 index 000000000000..3e548325ea30 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/qos.json.j2 @@ -0,0 +1 @@ +{%- include 'qos_config.j2' %} diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/BALANCED b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/BALANCED new file mode 120000 index 000000000000..afd21766cc64 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/BALANCED @@ -0,0 +1 @@ +../../../common/profiles/th5/gen/BALANCED \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/buffer_ports.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/buffer_ports.j2 new file mode 100644 index 000000000000..6b6ae10e51c1 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/buffer_ports.j2 @@ -0,0 +1,6 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0, 512, 8) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/buffers.json.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/buffers.json.j2 new file mode 100644 index 000000000000..0b1cb2c541b6 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/buffers.json.j2 @@ -0,0 +1,2 @@ +{%- set default_topo = 't1' %} +{%- include 'buffers_config.j2' %} diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..9524e6a476ac --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/buffers_defaults_t1.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/buffers_defaults_t1.j2 new file mode 120000 index 000000000000..c25cc95d6d57 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/buffers_defaults_t1.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/pg_profile_lookup.ini b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/pg_profile_lookup.ini new file mode 120000 index 000000000000..297cddb2d223 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/pg_profile_lookup.ini @@ -0,0 +1 @@ +BALANCED/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/qos.json.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/qos.json.j2 new file mode 100644 index 000000000000..3e548325ea30 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/qos.json.j2 @@ -0,0 +1 @@ +{%- include 'qos_config.j2' %} diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/BALANCED b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/BALANCED new file mode 120000 index 000000000000..afd21766cc64 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/BALANCED @@ -0,0 +1 @@ +../../../common/profiles/th5/gen/BALANCED \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/buffer_ports.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/buffer_ports.j2 new file mode 100644 index 000000000000..6b6ae10e51c1 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/buffer_ports.j2 @@ -0,0 +1,6 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0, 512, 8) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/buffers.json.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/buffers.json.j2 new file mode 100644 index 000000000000..0b1cb2c541b6 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/buffers.json.j2 @@ -0,0 +1,2 @@ +{%- set default_topo = 't1' %} +{%- include 'buffers_config.j2' %} diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..9524e6a476ac --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/buffers_defaults_t1.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/buffers_defaults_t1.j2 new file mode 120000 index 000000000000..c25cc95d6d57 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/buffers_defaults_t1.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/pg_profile_lookup.ini b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/pg_profile_lookup.ini new file mode 120000 index 000000000000..297cddb2d223 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/pg_profile_lookup.ini @@ -0,0 +1 @@ +BALANCED/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/qos.json.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/qos.json.j2 new file mode 100644 index 000000000000..3e548325ea30 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/qos.json.j2 @@ -0,0 +1 @@ +{%- include 'qos_config.j2' %} diff --git a/device/common/profiles/th5/gen/BALANCED/buffers_defaults_t0.j2 b/device/common/profiles/th5/gen/BALANCED/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..dc707599f70a --- /dev/null +++ b/device/common/profiles/th5/gen/BALANCED/buffers_defaults_t0.j2 @@ -0,0 +1,36 @@ +{%- set default_cable = '5m' %} + +{%- include 'buffer_ports.j2' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "type": "ingress", + "mode": "dynamic", + "size": "60000000", + "xoff": "22600000" + }, + "egress_lossless_pool": { + "type": "egress", + "mode": "static", + "size": "82600000" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool": "ingress_lossless_pool", + "size": "0", + "dynamic_th": "3" + }, + "egress_lossless_profile": { + "pool": "egress_lossless_pool", + "size": "0", + "static_th": "82600000" + }, + "egress_lossy_profile": { + "pool": "egress_lossless_pool", + "size": "0", + "dynamic_th": "3" + } + }, +{%- endmacro %} diff --git a/device/common/profiles/th5/gen/BALANCED/buffers_defaults_t1.j2 b/device/common/profiles/th5/gen/BALANCED/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..dc707599f70a --- /dev/null +++ b/device/common/profiles/th5/gen/BALANCED/buffers_defaults_t1.j2 @@ -0,0 +1,36 @@ +{%- set default_cable = '5m' %} + +{%- include 'buffer_ports.j2' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "type": "ingress", + "mode": "dynamic", + "size": "60000000", + "xoff": "22600000" + }, + "egress_lossless_pool": { + "type": "egress", + "mode": "static", + "size": "82600000" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool": "ingress_lossless_pool", + "size": "0", + "dynamic_th": "3" + }, + "egress_lossless_profile": { + "pool": "egress_lossless_pool", + "size": "0", + "static_th": "82600000" + }, + "egress_lossy_profile": { + "pool": "egress_lossless_pool", + "size": "0", + "dynamic_th": "3" + } + }, +{%- endmacro %} diff --git a/device/common/profiles/th5/gen/BALANCED/pg_profile_lookup.ini b/device/common/profiles/th5/gen/BALANCED/pg_profile_lookup.ini new file mode 100644 index 000000000000..ec695eca62d0 --- /dev/null +++ b/device/common/profiles/th5/gen/BALANCED/pg_profile_lookup.ini @@ -0,0 +1,20 @@ +# PG lossless profiles. +# speed cable size xon xoff threshold xon_offset + 10000 5m 1248 2288 35776 0 2288 + 25000 5m 1248 2288 53248 0 2288 + 40000 5m 1248 2288 66560 0 2288 + 50000 5m 1248 2288 90272 0 2288 + 100000 5m 1248 2288 165568 0 2288 + 400000 5m 1248 2288 165568 0 2288 + 10000 40m 1248 2288 37024 0 2288 + 25000 40m 1248 2288 53248 0 2288 + 40000 40m 1248 2288 71552 0 2288 + 50000 40m 1248 2288 96096 0 2288 + 100000 40m 1248 2288 177632 0 2288 + 400000 40m 1248 2288 177632 0 2288 + 10000 300m 1248 2288 46176 0 2288 + 25000 300m 1248 2288 79040 0 2288 + 40000 300m 1248 2288 108160 0 2288 + 50000 300m 1248 2288 141856 0 2288 + 100000 300m 1248 2288 268736 0 2288 + 400000 300m 1248 2288 268736 0 2288 From 643581906a69d0af331edb6a537800953a11a7a7 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 8 Jun 2024 16:01:23 +0800 Subject: [PATCH 365/419] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#19243) #### Why I did it src/sonic-utilities ``` * 0af03e7c - (HEAD -> 202311, origin/202311) [Mellanox] Update sonic-utilities to support new SKU Mellanox-SN5600-V256 (#3312) (28 hours ago) [DavidZagury] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index 735891cc502c..0af03e7cb3a2 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 735891cc502c17c87817820c163a0b9633b2f663 +Subproject commit 0af03e7cb3a2bb09a7c4ce5f8be12626b1c9ccf2 From fea265792f56ba6ba8dd518b18890981ce4963bf Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 8 Jun 2024 16:01:34 +0800 Subject: [PATCH 366/419] [submodule] Update submodule linkmgrd to the latest HEAD automatically (#19222) #### Why I did it src/linkmgrd ``` * ad39298 - (HEAD -> 202311, origin/202311) [active-standby] add knob to enable/disable oscillation (#250) (2 days ago) [Jing Zhang] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/linkmgrd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linkmgrd b/src/linkmgrd index 746543176654..ad392988af81 160000 --- a/src/linkmgrd +++ b/src/linkmgrd @@ -1 +1 @@ -Subproject commit 746543176654fd6c55a4d94147c832d86317b86a +Subproject commit ad392988af81609fe432eb285641bb51516f2958 From 5853333a886a4b0321f9c2465eac2cb28183956a Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sun, 9 Jun 2024 02:08:32 +0800 Subject: [PATCH 367/419] [ci/build]: Upgrade SONiC package versions (#19251) --- .../versions-py3-all-arm64 | 1 - files/build/versions/default/versions-git | 8 +++---- files/build/versions/default/versions-mirror | 24 +++++++++---------- .../versions-deb-bullseye | 5 ++-- .../sonic-slave-buster/versions-deb-buster | 2 +- 5 files changed, 19 insertions(+), 21 deletions(-) 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 44a337154808..b80f4ad9b36d 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 @@ -3,4 +3,3 @@ bitarray==1.5.3 click==7.0 requests==2.31.0 urllib3==2.0.5 -zipp==1.2.0 diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index 34e44d659d41..1ec2ba1576fa 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==ada9211999786073eb44acab46e596311523e0df +https://chromium.googlesource.com/chromium/tools/depot_tools.git==954a8d771345d12f8920da03359b56c001632a7b https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f https://github.com/CESNET/libyang.git==4c733412e7173219166be7053940326a92699765 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==e25129d9b6cf5bc39fed03cbf60af2378a3e745f -https://github.com/FreeRADIUS/freeradius-server.git==3eb4a4b01e4b33a44b07a6ae6b50071fe09ad1f8 +https://github.com/flashrom/flashrom.git==1ed95233e8872c80575db1666d8cb65dbaf5595b +https://github.com/FreeRADIUS/freeradius-server.git==37368d10fd0da60bca2c55b39c8c2c935d7752fb https://github.com/FreeRADIUS/pam_radius.git==d802da75cbfc3062ae1b18d0bf26ac2a030ffdaa https://github.com/jeroennijhof/pam_tacplus.git==b839c440e33c36eced9dcbc287fcfe6237c4c4ce https://github.com/jpirko/libteam.git==337125ce8d24ed66d7f4c7e6eef50458f3e7d154 @@ -14,7 +14,7 @@ https://github.com/Marvell-switching/mrvl-prestera.git==5834b7338ff9ac6f03d45ab8 https://github.com/Mellanox/libpsample.git==62bb27d9a49424e45191eee81df7ce0d8c74e774 https://github.com/p4lang/ptf.git==c554f83685186be4cfa9387eb5d6d700d2bbd7c0 https://github.com/p4lang/scapy-vxlan.git==85ffe83da156568ee47a0750f638227e6e1d7479 -https://github.com/sflow/host-sflow==a3ce4814bb6673a314142183e22c0e710cd21292 +https://github.com/sflow/host-sflow==66218a3349a16ce826a35f67f845026a5576867a https://github.com/sflow/sflowtool==c42c49cb80b927a4c02e54fc26430417f18f4833 https://github.com/thom311/libnl==5248e1a45576617b349465997822cef34cbc5053 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 7d4d138ea065..51f1ca622c88 100644 --- a/files/build/versions/default/versions-mirror +++ b/files/build/versions/default/versions-mirror @@ -1,14 +1,14 @@ 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==20240604T000236Z -debian-security==20240605T000248Z -download.docker.com_linux_debian_dists_bullseye==2024-05-28T14:05:22Z -download.docker.com_linux_debian_dists_buster==2024-05-23T13:29:25Z -packages.trafficmanager.net_snapshot_debian-security_20240605T000248Z_dists_bullseye-security==2024-06-02T16:19:06Z -packages.trafficmanager.net_snapshot_debian-security_20240605T000248Z_dists_buster_updates==2024-06-02T16:19:05Z -packages.trafficmanager.net_snapshot_debian_20240604T000236Z_dists_bullseye==2024-02-10T12:40:37Z -packages.trafficmanager.net_snapshot_debian_20240604T000236Z_dists_bullseye-backports==2024-06-03T14:12:58Z -packages.trafficmanager.net_snapshot_debian_20240604T000236Z_dists_bullseye-updates==2024-06-03T14:12:58Z -packages.trafficmanager.net_snapshot_debian_20240604T000236Z_dists_buster==2023-06-10T08:53:33Z -packages.trafficmanager.net_snapshot_debian_20240604T000236Z_dists_buster-backports==2024-03-09T20:54:54Z -packages.trafficmanager.net_snapshot_debian_20240604T000236Z_dists_buster-updates==2023-06-10T08:55:10Z +debian==20240607T000355Z +debian-security==20240608T000253Z +download.docker.com_linux_debian_dists_bullseye==2024-06-05T17:09:25Z +download.docker.com_linux_debian_dists_buster==2024-06-05T17:09:25Z +packages.trafficmanager.net_snapshot_debian-security_20240608T000253Z_dists_bullseye-security==2024-06-05T20:30:04Z +packages.trafficmanager.net_snapshot_debian-security_20240608T000253Z_dists_buster_updates==2024-06-05T20:30:04Z +packages.trafficmanager.net_snapshot_debian_20240607T000355Z_dists_bullseye==2024-02-10T12:40:37Z +packages.trafficmanager.net_snapshot_debian_20240607T000355Z_dists_bullseye-backports==2024-06-06T20:22:20Z +packages.trafficmanager.net_snapshot_debian_20240607T000355Z_dists_bullseye-updates==2024-06-06T20:22:20Z +packages.trafficmanager.net_snapshot_debian_20240607T000355Z_dists_buster==2023-06-10T08:53:33Z +packages.trafficmanager.net_snapshot_debian_20240607T000355Z_dists_buster-backports==2024-03-09T20:54:54Z +packages.trafficmanager.net_snapshot_debian_20240607T000355Z_dists_buster-updates==2023-06-10T08:55:10Z diff --git a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye index c2cc57610a56..8686e2085183 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye @@ -101,7 +101,7 @@ docbook-xsl==1.79.2+dfsg-1 docker-buildx-plugin==0.10.5-1~debian.11~bullseye docker-ce==5:24.0.2-1~debian.11~bullseye docker-ce-cli==5:24.0.2-1~debian.11~bullseye -docker-ce-rootless-extras==5:26.1.3-1~debian.11~bullseye +docker-ce-rootless-extras==5:26.1.4-1~debian.11~bullseye docker-compose-plugin==2.18.1-1~debian.11~bullseye docutils-common==0.16+dfsg-4 dosfstools==4.2-1 @@ -757,7 +757,6 @@ libjson-glib-1.0-common==1.6.2-1 libjson-maybexs-perl==1.004003-1 libjson-perl==4.03000-1 libjson-xs-perl==4.030-1+b1 -libjsoncpp-dev==1.9.4-4 libjsoncpp24==1.9.4-4 libjsp-api-java==2.3.4-3 libjsr305-java==0.1~+svn49-11 @@ -1608,7 +1607,7 @@ python3-olefile==0.46-3 python3-openssl==20.0.1-1 python3-packaging==20.9-2 python3-parse==1.6.6-0.2 -python3-pil==8.1.2+dfsg-0.3+deb11u1 +python3-pil==8.1.2+dfsg-0.3+deb11u2 python3-pkg-resources==52.0.0-4 python3-pluggy==0.13.0-6 python3-py==1.10.0-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 fefd5c3294fb..cd4a15ed32d3 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster @@ -94,7 +94,7 @@ docbook-xml==4.5-8 docker-buildx-plugin==0.10.5-1~debian.10~buster docker-ce==5:24.0.2-1~debian.10~buster docker-ce-cli==5:24.0.2-1~debian.10~buster -docker-ce-rootless-extras==5:26.1.3-1~debian.10~buster +docker-ce-rootless-extras==5:26.1.4-1~debian.10~buster docker-compose-plugin==2.18.1-1~debian.10~buster docutils-common==0.14+dfsg-4 docutils-doc==0.14+dfsg-4 From 5fd514caad1efc170344f81a2d1c9d4e21b1c60c Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 11 Jun 2024 16:05:30 +0800 Subject: [PATCH 368/419] [submodule] Update submodule sonic-platform-daemons to the latest HEAD automatically (#19269) #### Why I did it src/sonic-platform-daemons ``` * 3d1d1d9 - (HEAD -> 202311, origin/202311) [202311][CMIS] Skip re-init flow for SW-controlled ports in case of fastboot (#498) (11 hours ago) [Stepan Blyshchak] ``` #### How I did it #### How to verify it #### Description for the changelog --- 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 5bb903c89604..3d1d1d9eff70 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit 5bb903c896040e1be7ba028ab915dcbf40fc27c1 +Subproject commit 3d1d1d9eff708f92badce072fadc744dd485d936 From fc95e70973e279bd29a0c40bab6f67bb9441ba5b Mon Sep 17 00:00:00 2001 From: Dror Prital <76714716+dprital@users.noreply.github.com> Date: Thu, 6 Jun 2024 20:25:34 +0300 Subject: [PATCH 369/419] [Mellanox] route config/set/delete performance improvement(#18801) - Why I did it Increase significantly the rate of routes config/set/delete to HW. - How I did it Add required flag in sai.profile and increase orchagent bulk size. - How to verify it Measure rate of route set/del operations at scale. --- platform/mellanox/docker-syncd-mlnx/sai-common.profile | 1 + 1 file changed, 1 insertion(+) diff --git a/platform/mellanox/docker-syncd-mlnx/sai-common.profile b/platform/mellanox/docker-syncd-mlnx/sai-common.profile index 3b9e6fe00573..62e4323e2e24 100644 --- a/platform/mellanox/docker-syncd-mlnx/sai-common.profile +++ b/platform/mellanox/docker-syncd-mlnx/sai-common.profile @@ -1,2 +1,3 @@ SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps SAI_DUMP_STORE_AMOUNT=10 +SAI_ASYNC_ROUTING_ENABLED=1 From adf9b9c124a1aa25e5fe9861150a9b5ebf1db7e8 Mon Sep 17 00:00:00 2001 From: Nazarii Hnydyn Date: Mon, 10 Jun 2024 14:00:02 +0300 Subject: [PATCH 370/419] [Mellanox] Improve FW upgrade: add locking mechanism. (#18925) User implications: On cold/warm/fast reboot if there is a syncd service start ongoing, the target procedure will stay blocked until the original call is done. This may delay the action in time. - Why I did it Improve the upgrade fw script avoiding errors in the logs when cold reboot is executed during service restart Work item tracking - How I did it Added locking mechanism for Mellanox FW upgrade - How to verify it Run cold reboot after DUT first install Signed-off-by: Nazarii Hnydyn --- platform/mellanox/mlnx-fw-upgrade.j2 | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/platform/mellanox/mlnx-fw-upgrade.j2 b/platform/mellanox/mlnx-fw-upgrade.j2 index 7a36a2ebd92d..e0fcd56c592d 100755 --- a/platform/mellanox/mlnx-fw-upgrade.j2 +++ b/platform/mellanox/mlnx-fw-upgrade.j2 @@ -17,6 +17,8 @@ declare -r SCRIPT_NAME="$(basename "$0")" declare -r SCRIPT_PATH="$(readlink -f "$0")" declare -r SCRIPT_DIR="$(dirname "$SCRIPT_PATH")" +declare -r LOCKFILE="/tmp/mlxfwmanager-lock" + declare -r YES_PARAM="yes" declare -r NO_PARAM="no" @@ -159,6 +161,20 @@ function ExitSuccess() { exit "${EXIT_SUCCESS}" } +function LockStateChange() { + LogInfo "Locking ${LOCKFILE} from ${SCRIPT_NAME}" + + exec {LOCKFD}>${LOCKFILE} + /usr/bin/flock -x ${LOCKFD} + + LogInfo "Locked ${LOCKFILE} (${LOCKFD}) from ${SCRIPT_NAME}" +} + +function UnlockStateChange() { + LogInfo "Unlocking ${LOCKFILE} (${LOCKFD}) from ${SCRIPT_NAME}" + /usr/bin/flock -u ${LOCKFD} +} + function WaitForDevice() { local -i QUERY_RETRY_COUNT_MAX="10" local -i QUERY_RETRY_COUNT="0" @@ -356,10 +372,20 @@ function ExitIfQEMU() { fi } +function Cleanup() { + if [[ -n "${LOCKFD}" ]]; then + UnlockStateChange + fi +} + +trap Cleanup EXIT + ParseArguments "$@" ExitIfQEMU +LockStateChange + WaitForDevice if [ "${IMAGE_UPGRADE}" != "${YES_PARAM}" ]; then From 156b067c875967618232c02cb51b163e5e287e45 Mon Sep 17 00:00:00 2001 From: DavidZagury <32644413+DavidZagury@users.noreply.github.com> Date: Mon, 10 Jun 2024 13:55:46 +0300 Subject: [PATCH 371/419] [Mellanox] Support SKU Mellanox-SN5600-V256 (#18926) - Why I did it Support Mellanox-SN5600-V256 - How I did it Add relevant files to support the new SKU - How to verify it Regression test --- .../Mellanox-SN5600-V256/buffers.json.j2 | 1 + .../buffers_defaults_objects.j2 | 1 + .../buffers_defaults_t0.j2 | 47 ++ .../buffers_defaults_t1.j2 | 47 ++ .../buffers_dynamic.json.j2 | 16 + .../create_only_config_db_buffers.json | 7 + .../Mellanox-SN5600-V256/hwsku.json | 775 ++++++++++++++++++ .../pg_profile_lookup.ini | 42 + .../Mellanox-SN5600-V256/port_config.ini | 275 +++++++ .../Mellanox-SN5600-V256/qos.json.j2 | 1 + .../Mellanox-SN5600-V256/sai.profile | 1 + .../sai_5600_256x200g.xml | 627 ++++++++++++++ 12 files changed, 1840 insertions(+) create mode 120000 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers.json.j2 create mode 120000 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers_defaults_objects.j2 create mode 100644 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers_defaults_t0.j2 create mode 100644 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers_defaults_t1.j2 create mode 100644 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers_dynamic.json.j2 create mode 100644 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/create_only_config_db_buffers.json create mode 100644 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/hwsku.json create mode 100644 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/pg_profile_lookup.ini create mode 100644 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/port_config.ini create mode 120000 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/qos.json.j2 create mode 100644 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/sai.profile create mode 100644 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/sai_5600_256x200g.xml diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers.json.j2 b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers.json.j2 new file mode 120000 index 000000000000..add8bf8bb7c2 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers.json.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers_defaults_objects.j2 b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers_defaults_objects.j2 new file mode 120000 index 000000000000..c01aebb7ae12 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers_defaults_objects.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_objects.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers_defaults_t0.j2 b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..70e701884eea --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers_defaults_t0.j2 @@ -0,0 +1,47 @@ +{# + Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. + Apache-2.0 + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +#} +{% set default_cable = '300m' %} +{% set ingress_lossless_pool_size = '73684992' %} +{% set ingress_lossless_pool_xoff = '60293120' %} +{% set egress_lossless_pool_size = '158229504' %} +{% set egress_lossy_pool_size = '73684992' %} + +{% import 'buffers_defaults_objects.j2' as defs with context %} + +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_queue_buffers_with_extra_lossless_queues_with_inactive_ports(port_names_active, port_names_extra_queues, port_names_inactive) %} +{{ defs.generate_queue_buffers_with_extra_lossless_queues(port_names_active, port_names_extra_queues, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_pg_profiles_with_extra_lossless_pgs_with_inactive_ports(port_names_active, port_names_extra_pgs, port_names_inactive) %} +{{ defs.generate_pg_profiles_with_extra_lossless_pgs(port_names_active, port_names_extra_pgs, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} +{%- endmacro %} diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers_defaults_t1.j2 b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..70e701884eea --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers_defaults_t1.j2 @@ -0,0 +1,47 @@ +{# + Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. + Apache-2.0 + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +#} +{% set default_cable = '300m' %} +{% set ingress_lossless_pool_size = '73684992' %} +{% set ingress_lossless_pool_xoff = '60293120' %} +{% set egress_lossless_pool_size = '158229504' %} +{% set egress_lossy_pool_size = '73684992' %} + +{% import 'buffers_defaults_objects.j2' as defs with context %} + +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_queue_buffers_with_extra_lossless_queues_with_inactive_ports(port_names_active, port_names_extra_queues, port_names_inactive) %} +{{ defs.generate_queue_buffers_with_extra_lossless_queues(port_names_active, port_names_extra_queues, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_pg_profiles_with_extra_lossless_pgs_with_inactive_ports(port_names_active, port_names_extra_pgs, port_names_inactive) %} +{{ defs.generate_pg_profiles_with_extra_lossless_pgs(port_names_active, port_names_extra_pgs, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} +{%- endmacro %} diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers_dynamic.json.j2 b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers_dynamic.json.j2 new file mode 100644 index 000000000000..b2cc958b7c45 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers_dynamic.json.j2 @@ -0,0 +1,16 @@ +{# + Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. + Apache-2.0 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +#} +{%- set default_topo = 't0' %} +{%- set dynamic_mode = 'true' %} +{%- include 'buffers_config.j2' %} diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/create_only_config_db_buffers.json b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/create_only_config_db_buffers.json new file mode 100644 index 000000000000..6feb156714fe --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/create_only_config_db_buffers.json @@ -0,0 +1,7 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "create_only_config_db_buffers": "true" + } + } +} diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/hwsku.json b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/hwsku.json new file mode 100644 index 000000000000..04211490cdf6 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/hwsku.json @@ -0,0 +1,775 @@ +{ + "interfaces": { + "Ethernet0": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet2": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet4": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet6": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet8": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet10": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet12": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet14": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet16": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet18": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet20": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet22": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet24": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet26": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet28": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet30": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet32": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet34": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet36": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet38": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet40": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet42": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet44": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet46": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet48": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet50": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet52": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet54": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet56": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet58": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet60": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet62": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet64": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet66": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet68": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet70": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet72": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet74": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet76": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet78": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet80": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet82": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet84": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet86": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet88": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet90": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet92": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet94": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet96": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet98": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet100": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet102": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet104": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet106": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet108": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet110": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet112": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet114": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet116": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet118": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet120": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet122": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet124": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet126": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet128": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet130": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet132": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet134": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet136": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet138": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet140": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet142": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet144": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet146": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet148": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet150": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet152": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet154": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet156": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet158": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet160": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet162": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet164": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet166": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet168": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet170": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet172": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet174": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet176": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet178": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet180": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet182": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet184": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet186": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet188": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet190": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet192": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet194": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet196": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet198": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet200": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet202": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet204": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet206": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet208": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet210": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet212": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet214": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet216": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet218": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet220": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet222": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet224": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet226": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet228": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet230": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet232": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet234": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet236": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet238": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet240": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet242": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet244": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet246": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet248": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet250": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet252": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet254": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet256": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet258": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet260": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet262": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet264": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet266": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet268": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet270": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet272": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet274": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet276": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet278": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet280": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet282": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet284": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet286": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet288": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet290": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet292": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet294": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet296": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet298": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet300": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet302": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet304": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet306": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet308": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet310": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet312": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet314": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet316": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet318": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet320": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet322": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet324": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet326": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet328": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet330": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet332": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet334": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet336": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet338": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet340": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet342": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet344": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet346": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet348": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet350": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet352": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet354": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet356": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet358": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet360": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet362": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet364": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet366": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet368": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet370": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet372": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet374": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet376": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet378": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet380": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet382": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet384": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet386": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet388": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet390": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet392": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet394": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet396": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet398": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet400": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet402": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet404": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet406": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet408": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet410": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet412": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet414": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet416": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet418": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet420": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet422": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet424": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet426": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet428": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet430": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet432": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet434": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet436": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet438": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet440": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet442": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet444": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet446": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet448": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet450": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet452": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet454": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet456": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet458": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet460": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet462": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet464": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet466": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet468": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet470": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet472": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet474": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet476": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet478": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet480": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet482": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet484": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet486": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet488": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet490": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet492": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet494": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet496": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet498": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet500": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet502": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet504": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet506": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet508": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet510": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet512": { + "default_brkout_mode": "1x25G[10G]" + } + } +} diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/pg_profile_lookup.ini b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/pg_profile_lookup.ini new file mode 100644 index 000000000000..c7d8a3b5ca01 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/pg_profile_lookup.ini @@ -0,0 +1,42 @@ +## +## Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. +## Apache-2.0 +## +## Licensed under the Apache License, Version 2.0 (the "License"); +## you may not use this file except in compliance with the License. +## You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## +# PG lossless profiles. +# speed cable size xon xoff threshold + 10000 5m 19456 19456 33792 0 + 25000 5m 19456 19456 35840 0 + 40000 5m 19456 19456 41984 0 + 50000 5m 19456 19456 46080 0 + 100000 5m 19456 19456 79872 0 + 200000 5m 19456 19456 91136 0 + 400000 5m 19456 19456 157696 0 + 800000 5m 38912 38912 175104 0 + 10000 40m 19456 19456 34816 0 + 25000 40m 19456 19456 37888 0 + 40000 40m 19456 19456 45056 0 + 50000 40m 19456 19456 50176 0 + 100000 40m 19456 19456 88064 0 + 200000 40m 19456 19456 108544 0 + 400000 40m 19456 19456 192512 0 + 800000 40m 38912 38912 245760 0 + 10000 300m 19456 19456 40960 0 + 25000 300m 19456 19456 54272 0 + 40000 300m 19456 19456 71680 0 + 50000 300m 19456 19456 82944 0 + 100000 300m 19456 19456 153600 0 + 200000 300m 19456 19456 240640 0 + 400000 300m 19456 19456 455680 0 + 800000 300m 38912 38912 771072 0 diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/port_config.ini b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/port_config.ini new file mode 100644 index 000000000000..a995d8ed29fe --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/port_config.ini @@ -0,0 +1,275 @@ +## +## Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. +## Apache-2.0 +## +## Licensed under the Apache License, Version 2.0 (the "License"); +## you may not use this file except in compliance with the License. +## You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## + +# name lanes alias index speed fec +Ethernet0 0,1 etp1a 1 200000 rs +Ethernet2 2,3 etp1b 1 200000 rs +Ethernet4 4,5 etp1c 1 200000 rs +Ethernet6 6,7 etp1d 1 200000 rs +Ethernet8 8,9 etp2a 2 200000 rs +Ethernet10 10,11 etp2b 2 200000 rs +Ethernet12 12,13 etp2c 2 200000 rs +Ethernet14 14,15 etp2d 2 200000 rs +Ethernet16 16,17 etp3a 3 200000 rs +Ethernet18 18,19 etp3b 3 200000 rs +Ethernet20 20,21 etp3c 3 200000 rs +Ethernet22 22,23 etp3d 3 200000 rs +Ethernet24 24,25 etp4a 4 200000 rs +Ethernet26 26,27 etp4b 4 200000 rs +Ethernet28 28,29 etp4c 4 200000 rs +Ethernet30 30,31 etp4d 4 200000 rs +Ethernet32 32,33 etp5a 5 200000 rs +Ethernet34 34,35 etp5b 5 200000 rs +Ethernet36 36,37 etp5c 5 200000 rs +Ethernet38 38,39 etp5d 5 200000 rs +Ethernet40 40,41 etp6a 6 200000 rs +Ethernet42 42,43 etp6b 6 200000 rs +Ethernet44 44,45 etp6c 6 200000 rs +Ethernet46 46,47 etp6d 6 200000 rs +Ethernet48 48,49 etp7a 7 200000 rs +Ethernet50 50,51 etp7b 7 200000 rs +Ethernet52 52,53 etp7c 7 200000 rs +Ethernet54 54,55 etp7d 7 200000 rs +Ethernet56 56,57 etp8a 8 200000 rs +Ethernet58 58,59 etp8b 8 200000 rs +Ethernet60 60,61 etp8c 8 200000 rs +Ethernet62 62,63 etp8d 8 200000 rs +Ethernet64 64,65 etp9a 9 200000 rs +Ethernet66 66,67 etp9b 9 200000 rs +Ethernet68 68,69 etp9c 9 200000 rs +Ethernet70 70,71 etp9d 9 200000 rs +Ethernet72 72,73 etp10a 10 200000 rs +Ethernet74 74,75 etp10b 10 200000 rs +Ethernet76 76,77 etp10c 10 200000 rs +Ethernet78 78,79 etp10d 10 200000 rs +Ethernet80 80,81 etp11a 11 200000 rs +Ethernet82 82,83 etp11b 11 200000 rs +Ethernet84 84,85 etp11c 11 200000 rs +Ethernet86 86,87 etp11d 11 200000 rs +Ethernet88 88,89 etp12a 12 200000 rs +Ethernet90 90,91 etp12b 12 200000 rs +Ethernet92 92,93 etp12c 12 200000 rs +Ethernet94 94,95 etp12d 12 200000 rs +Ethernet96 96,97 etp13a 13 200000 rs +Ethernet98 98,99 etp13b 13 200000 rs +Ethernet100 100,101 etp13c 13 200000 rs +Ethernet102 102,103 etp13d 13 200000 rs +Ethernet104 104,105 etp14a 14 200000 rs +Ethernet106 106,107 etp14b 14 200000 rs +Ethernet108 108,109 etp14c 14 200000 rs +Ethernet110 110,111 etp14d 14 200000 rs +Ethernet112 112,113 etp15a 15 200000 rs +Ethernet114 114,115 etp15b 15 200000 rs +Ethernet116 116,117 etp15c 15 200000 rs +Ethernet118 118,119 etp15d 15 200000 rs +Ethernet120 120,121 etp16a 16 200000 rs +Ethernet122 122,123 etp16b 16 200000 rs +Ethernet124 124,125 etp16c 16 200000 rs +Ethernet126 126,127 etp16d 16 200000 rs +Ethernet128 128,129 etp17a 17 200000 rs +Ethernet130 130,131 etp17b 17 200000 rs +Ethernet132 132,133 etp17c 17 200000 rs +Ethernet134 134,135 etp17d 17 200000 rs +Ethernet136 136,137 etp18a 18 200000 rs +Ethernet138 138,139 etp18b 18 200000 rs +Ethernet140 140,141 etp18c 18 200000 rs +Ethernet142 142,143 etp18d 18 200000 rs +Ethernet144 144,145 etp19a 19 200000 rs +Ethernet146 146,147 etp19b 19 200000 rs +Ethernet148 148,149 etp19c 19 200000 rs +Ethernet150 150,151 etp19d 19 200000 rs +Ethernet152 152,153 etp20a 20 200000 rs +Ethernet154 154,155 etp20b 20 200000 rs +Ethernet156 156,157 etp20c 20 200000 rs +Ethernet158 158,159 etp20d 20 200000 rs +Ethernet160 160,161 etp21a 21 200000 rs +Ethernet162 162,163 etp21b 21 200000 rs +Ethernet164 164,165 etp21c 21 200000 rs +Ethernet166 166,167 etp21d 21 200000 rs +Ethernet168 168,169 etp22a 22 200000 rs +Ethernet170 170,171 etp22b 22 200000 rs +Ethernet172 172,173 etp22c 22 200000 rs +Ethernet174 174,175 etp22d 22 200000 rs +Ethernet176 176,177 etp23a 23 200000 rs +Ethernet178 178,179 etp23b 23 200000 rs +Ethernet180 180,181 etp23c 23 200000 rs +Ethernet182 182,183 etp23d 23 200000 rs +Ethernet184 184,185 etp24a 24 200000 rs +Ethernet186 186,187 etp24b 24 200000 rs +Ethernet188 188,189 etp24c 24 200000 rs +Ethernet190 190,191 etp24d 24 200000 rs +Ethernet192 192,193 etp25a 25 200000 rs +Ethernet194 194,195 etp25b 25 200000 rs +Ethernet196 196,197 etp25c 25 200000 rs +Ethernet198 198,199 etp25d 25 200000 rs +Ethernet200 200,201 etp26a 26 200000 rs +Ethernet202 202,203 etp26b 26 200000 rs +Ethernet204 204,205 etp26c 26 200000 rs +Ethernet206 206,207 etp26d 26 200000 rs +Ethernet208 208,209 etp27a 27 200000 rs +Ethernet210 210,211 etp27b 27 200000 rs +Ethernet212 212,213 etp27c 27 200000 rs +Ethernet214 214,215 etp27d 27 200000 rs +Ethernet216 216,217 etp28a 28 200000 rs +Ethernet218 218,219 etp28b 28 200000 rs +Ethernet220 220,221 etp28c 28 200000 rs +Ethernet222 222,223 etp28d 28 200000 rs +Ethernet224 224,225 etp29a 29 200000 rs +Ethernet226 226,227 etp29b 29 200000 rs +Ethernet228 228,229 etp29c 29 200000 rs +Ethernet230 230,231 etp29d 29 200000 rs +Ethernet232 232,233 etp30a 30 200000 rs +Ethernet234 234,235 etp30b 30 200000 rs +Ethernet236 236,237 etp30c 30 200000 rs +Ethernet238 238,239 etp30d 30 200000 rs +Ethernet240 240,241 etp31a 31 200000 rs +Ethernet242 242,243 etp31b 31 200000 rs +Ethernet244 244,245 etp31c 31 200000 rs +Ethernet246 246,247 etp31d 31 200000 rs +Ethernet248 248,249 etp32a 32 200000 rs +Ethernet250 250,251 etp32b 32 200000 rs +Ethernet252 252,253 etp32c 32 200000 rs +Ethernet254 254,255 etp32d 32 200000 rs +Ethernet256 256,257 etp33a 33 200000 rs +Ethernet258 258,259 etp33b 33 200000 rs +Ethernet260 260,261 etp33c 33 200000 rs +Ethernet262 262,263 etp33d 33 200000 rs +Ethernet264 264,265 etp34a 34 200000 rs +Ethernet266 266,267 etp34b 34 200000 rs +Ethernet268 268,269 etp34c 34 200000 rs +Ethernet270 270,271 etp34d 34 200000 rs +Ethernet272 272,273 etp35a 35 200000 rs +Ethernet274 274,275 etp35b 35 200000 rs +Ethernet276 276,277 etp35c 35 200000 rs +Ethernet278 278,279 etp35d 35 200000 rs +Ethernet280 280,281 etp36a 36 200000 rs +Ethernet282 282,283 etp36b 36 200000 rs +Ethernet284 284,285 etp36c 36 200000 rs +Ethernet286 286,287 etp36d 36 200000 rs +Ethernet288 288,289 etp37a 37 200000 rs +Ethernet290 290,291 etp37b 37 200000 rs +Ethernet292 292,293 etp37c 37 200000 rs +Ethernet294 294,295 etp37d 37 200000 rs +Ethernet296 296,297 etp38a 38 200000 rs +Ethernet298 298,299 etp38b 38 200000 rs +Ethernet300 300,301 etp38c 38 200000 rs +Ethernet302 302,303 etp38d 38 200000 rs +Ethernet304 304,305 etp39a 39 200000 rs +Ethernet306 306,307 etp39b 39 200000 rs +Ethernet308 308,309 etp39c 39 200000 rs +Ethernet310 310,311 etp39d 39 200000 rs +Ethernet312 312,313 etp40a 40 200000 rs +Ethernet314 314,315 etp40b 40 200000 rs +Ethernet316 316,317 etp40c 40 200000 rs +Ethernet318 318,319 etp40d 40 200000 rs +Ethernet320 320,321 etp41a 41 200000 rs +Ethernet322 322,323 etp41b 41 200000 rs +Ethernet324 324,325 etp41c 41 200000 rs +Ethernet326 326,327 etp41d 41 200000 rs +Ethernet328 328,329 etp42a 42 200000 rs +Ethernet330 330,331 etp42b 42 200000 rs +Ethernet332 332,333 etp42c 42 200000 rs +Ethernet334 334,335 etp42d 42 200000 rs +Ethernet336 336,337 etp43a 43 200000 rs +Ethernet338 338,339 etp43b 43 200000 rs +Ethernet340 340,341 etp43c 43 200000 rs +Ethernet342 342,343 etp43d 43 200000 rs +Ethernet344 344,345 etp44a 44 200000 rs +Ethernet346 346,347 etp44b 44 200000 rs +Ethernet348 348,349 etp44c 44 200000 rs +Ethernet350 350,351 etp44d 44 200000 rs +Ethernet352 352,353 etp45a 45 200000 rs +Ethernet354 354,355 etp45b 45 200000 rs +Ethernet356 356,357 etp45c 45 200000 rs +Ethernet358 358,359 etp45d 45 200000 rs +Ethernet360 360,361 etp46a 46 200000 rs +Ethernet362 362,363 etp46b 46 200000 rs +Ethernet364 364,365 etp46c 46 200000 rs +Ethernet366 366,367 etp46d 46 200000 rs +Ethernet368 368,369 etp47a 47 200000 rs +Ethernet370 370,371 etp47b 47 200000 rs +Ethernet372 372,373 etp47c 47 200000 rs +Ethernet374 374,375 etp47d 47 200000 rs +Ethernet376 376,377 etp48a 48 200000 rs +Ethernet378 378,379 etp48b 48 200000 rs +Ethernet380 380,381 etp48c 48 200000 rs +Ethernet382 382,383 etp48d 48 200000 rs +Ethernet384 384,385 etp49a 49 200000 rs +Ethernet386 386,387 etp49b 49 200000 rs +Ethernet388 388,389 etp49c 49 200000 rs +Ethernet390 390,391 etp49d 49 200000 rs +Ethernet392 392,393 etp50a 50 200000 rs +Ethernet394 394,395 etp50b 50 200000 rs +Ethernet396 396,397 etp50c 50 200000 rs +Ethernet398 398,399 etp50d 50 200000 rs +Ethernet400 400,401 etp51a 51 200000 rs +Ethernet402 402,403 etp51b 51 200000 rs +Ethernet404 404,405 etp51c 51 200000 rs +Ethernet406 406,407 etp51d 51 200000 rs +Ethernet408 408,409 etp52a 52 200000 rs +Ethernet410 410,411 etp52b 52 200000 rs +Ethernet412 412,413 etp52c 52 200000 rs +Ethernet414 414,415 etp52d 52 200000 rs +Ethernet416 416,417 etp53a 53 200000 rs +Ethernet418 418,419 etp53b 53 200000 rs +Ethernet420 420,421 etp53c 53 200000 rs +Ethernet422 422,423 etp53d 53 200000 rs +Ethernet424 424,425 etp54a 54 200000 rs +Ethernet426 426,427 etp54b 54 200000 rs +Ethernet428 428,429 etp54c 54 200000 rs +Ethernet430 430,431 etp54d 54 200000 rs +Ethernet432 432,433 etp55a 55 200000 rs +Ethernet434 434,435 etp55b 55 200000 rs +Ethernet436 436,437 etp55c 55 200000 rs +Ethernet438 438,439 etp55d 55 200000 rs +Ethernet440 440,441 etp56a 56 200000 rs +Ethernet442 442,443 etp56b 56 200000 rs +Ethernet444 444,445 etp56c 56 200000 rs +Ethernet446 446,447 etp56d 56 200000 rs +Ethernet448 448,449 etp57a 57 200000 rs +Ethernet450 450,451 etp57b 57 200000 rs +Ethernet452 452,453 etp57c 57 200000 rs +Ethernet454 454,455 etp57d 57 200000 rs +Ethernet456 456,457 etp58a 58 200000 rs +Ethernet458 458,459 etp58b 58 200000 rs +Ethernet460 460,461 etp58c 58 200000 rs +Ethernet462 462,463 etp58d 58 200000 rs +Ethernet464 464,465 etp59a 59 200000 rs +Ethernet466 466,467 etp59b 59 200000 rs +Ethernet468 468,469 etp59c 59 200000 rs +Ethernet470 470,471 etp59d 59 200000 rs +Ethernet472 472,473 etp60a 60 200000 rs +Ethernet474 474,475 etp60b 60 200000 rs +Ethernet476 476,477 etp60c 60 200000 rs +Ethernet478 478,479 etp60d 60 200000 rs +Ethernet480 480,481 etp61a 61 200000 rs +Ethernet482 482,483 etp61b 61 200000 rs +Ethernet484 484,485 etp61c 61 200000 rs +Ethernet486 486,487 etp61d 61 200000 rs +Ethernet488 488,489 etp62a 62 200000 rs +Ethernet490 490,491 etp62b 62 200000 rs +Ethernet492 492,493 etp62c 62 200000 rs +Ethernet494 494,495 etp62d 62 200000 rs +Ethernet496 496,497 etp63a 63 200000 rs +Ethernet498 498,499 etp63b 63 200000 rs +Ethernet500 500,501 etp63c 63 200000 rs +Ethernet502 502,503 etp63d 63 200000 rs +Ethernet504 504,505 etp64a 64 200000 rs +Ethernet506 506,507 etp64b 64 200000 rs +Ethernet508 508,509 etp64c 64 200000 rs +Ethernet510 510,511 etp64d 64 200000 rs +Ethernet512 512 etp65 65 25000 rs diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/qos.json.j2 b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/qos.json.j2 new file mode 120000 index 000000000000..eccf286dc879 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/qos.json.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/qos.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/sai.profile b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/sai.profile new file mode 100644 index 000000000000..0d93ea989b31 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/sai.profile @@ -0,0 +1 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_5600_256x200g.xml diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/sai_5600_256x200g.xml b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/sai_5600_256x200g.xml new file mode 100644 index 000000000000..89518aa8cfca --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/sai_5600_256x200g.xml @@ -0,0 +1,627 @@ + + + + + + + 00:02:03:04:05:00 + + + 0 + + + 65 + + + + + 1 + 8 + 34 + 3 + 4096 + 4 + true + + + 5 + 8 + 35 + 3 + 4096 + 4 + true + + + 9 + 8 + 33 + 3 + 4096 + 4 + true + + + 13 + 8 + 32 + 3 + 4096 + 4 + true + + + 17 + 8 + 38 + 3 + 4096 + 4 + true + + + 21 + 8 + 39 + 3 + 4096 + 4 + true + + + 25 + 8 + 37 + 3 + 4096 + 4 + true + + + 29 + 8 + 36 + 3 + 4096 + 4 + true + + + 33 + 8 + 42 + 3 + 4096 + 4 + true + + + 37 + 8 + 43 + 3 + 4096 + 4 + true + + + 41 + 8 + 41 + 3 + 4096 + 4 + true + + + 45 + 8 + 40 + 3 + 4096 + 4 + true + + + 49 + 8 + 46 + 3 + 4096 + 4 + true + + + 53 + 8 + 47 + 3 + 4096 + 4 + true + + + 57 + 8 + 45 + 3 + 4096 + 4 + true + + + 61 + 8 + 44 + 3 + 4096 + 4 + true + + + 65 + 8 + 51 + 3 + 4096 + 4 + true + + + 69 + 8 + 50 + 3 + 4096 + 4 + true + + + 73 + 8 + 48 + 3 + 4096 + 4 + true + + + 77 + 8 + 49 + 3 + 4096 + 4 + true + + + 81 + 8 + 55 + 3 + 4096 + 4 + true + + + 85 + 8 + 54 + 3 + 4096 + 4 + true + + + 89 + 8 + 52 + 3 + 4096 + 4 + true + + + 93 + 8 + 53 + 3 + 4096 + 4 + true + + + 97 + 8 + 59 + 3 + 4096 + 4 + true + + + 101 + 8 + 58 + 3 + 4096 + 4 + true + + + 105 + 8 + 56 + + + 3 + + + 4096 + 4 + true + + + 109 + 8 + 57 + 3 + 4096 + 4 + true + + + 113 + 8 + 63 + 3 + 4096 + 4 + true + + + 117 + 8 + 62 + 3 + 4096 + 4 + true + + + 121 + 8 + 60 + 3 + 4096 + 4 + true + + + 125 + 8 + 61 + 3 + 4096 + 4 + true + + + 129 + 8 + 29 + 3 + 4096 + 4 + true + + + 133 + 8 + 28 + 3 + 4096 + 4 + true + + + 137 + 8 + 30 + 3 + 4096 + 4 + true + + + 141 + 8 + 31 + 3 + 4096 + 4 + true + + + 145 + 8 + 25 + 3 + 4096 + 4 + true + + + 149 + 8 + 24 + 3 + 4096 + 4 + true + + + 153 + 8 + 26 + 3 + 4096 + 4 + true + + + 157 + 8 + 27 + 3 + 4096 + 4 + true + + + 161 + 8 + 21 + 3 + 4096 + 4 + true + + + 165 + 8 + 20 + 3 + 4096 + 4 + true + + + 169 + 8 + 22 + 3 + 4096 + 4 + true + + + 173 + 8 + 23 + 3 + 4096 + 4 + true + + + 177 + 8 + 17 + 3 + 4096 + 4 + true + + + 181 + 8 + 16 + 3 + 4096 + 4 + true + + + 185 + 8 + 18 + 3 + 4096 + 4 + true + + + 189 + 8 + 19 + 3 + 4096 + 4 + true + + + 193 + 8 + 12 + 3 + 4096 + 4 + true + + + 197 + 8 + 13 + 3 + 4096 + 4 + true + + + 201 + 8 + 15 + 3 + 4096 + 4 + true + + + 205 + 8 + 14 + 3 + 4096 + 4 + true + + + 209 + 8 + 8 + 3 + 4096 + 4 + true + + + 213 + 8 + 9 + 3 + 4096 + 4 + true + + + 217 + 8 + 11 + 3 + 4096 + 4 + true + + + 221 + 8 + 10 + 3 + 4096 + 4 + true + + + 225 + 8 + 4 + 3 + 4096 + 4 + true + + + 229 + 8 + 5 + 3 + 4096 + 4 + true + + + 233 + 8 + 7 + + + 3 + + + 4096 + 4 + true + + + 237 + 8 + 6 + 3 + 4096 + 4 + true + + + 241 + 8 + 0 + 3 + 4096 + 4 + true + + + 245 + 8 + 1 + 3 + 4096 + 4 + true + + + 249 + 8 + 3 + 3 + 4096 + 4 + true + + + 253 + 8 + 2 + 3 + 4096 + 4 + true + + + 257 + 1 + 64 + 0 + 64 + true + + + + + From a5af189350c2e9c3f4859924df4cc924e8b0f4d6 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Fri, 14 Jun 2024 10:02:03 +0300 Subject: [PATCH 372/419] [202311_RC.69] Add W/A to not fail when hw_reset to SFP module --- platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index b55b578459f4..b9c930354730 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -1443,6 +1443,14 @@ def get_state_machine(cls): @classmethod def action_on_start(cls, sfp): + + # a W/A to avoid setting hw_reset for service ports from type SFP. + # this W/A is relevant only for moose and hippo systems, and we will have it until FW will provide their fix. + if sfp.sdk_index >= 64: + logger.log_info(f'SFP {sfp.sdk_index} should be automatically FW control. Setting it as FW control as a W/A') + sfp.on_event(EVENT_FW_CONTROL) + return + if sfp.get_control_type() == SFP_FW_CONTROL: logger.log_info(f'SFP {sfp.sdk_index} is already FW control, probably in warm reboot') sfp.on_event(EVENT_FW_CONTROL) From a1844ea16af618d337e9286ac695825b3ba43f36 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Fri, 14 Jun 2024 10:02:05 +0300 Subject: [PATCH 373/419] [202311_RC.69] Fix to use IPv6 linklocal address as snmp agent address --- dockers/docker-snmp/snmpd.conf.j2 | 2 +- src/sonic-config-engine/minigraph.py | 13 +++++++------ src/sonic-config-engine/tests/sample_graph.xml | 8 ++++++++ src/sonic-config-engine/tests/test_cfggen.py | 2 +- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/dockers/docker-snmp/snmpd.conf.j2 b/dockers/docker-snmp/snmpd.conf.j2 index aa04901f0009..b6dd826007a1 100644 --- a/dockers/docker-snmp/snmpd.conf.j2 +++ b/dockers/docker-snmp/snmpd.conf.j2 @@ -17,7 +17,7 @@ # Listen on managment and loopback0 ips for single asic platform # {% macro protocol(ip_addr) %} -{%- if ip_addr|ipv6 -%} +{%- if ip_addr.split('%')[0]|ipv6 -%} {{ 'udp6' }} {%- else -%} {{ 'udp' }} diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index 54d27ad06587..f372de312947 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -1762,12 +1762,13 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw if not is_multi_asic() and asic_name is None: results['SNMP_AGENT_ADDRESS_CONFIG'] = {} port = '161' - for mgmt_intf in mgmt_intf.keys(): - snmp_key = mgmt_intf[1].split('/')[0] + '|' + port + '|' - results['SNMP_AGENT_ADDRESS_CONFIG'][snmp_key] = {} - # Add Loopback IP as agent address for single asic - for loip in lo_intfs.keys(): - snmp_key = loip[1].split('/')[0] + '|' + port + '|' + for intf in list(mgmt_intf.keys()) + list(lo_intfs.keys()): + ip_addr = ipaddress.ip_address(UNICODE_TYPE(intf[1].split('/')[0])) + if ip_addr.version == 6 and ip_addr.is_link_local: + agent_addr = str(ip_addr) + '%' + intf[0] + else: + agent_addr = str(ip_addr) + snmp_key = agent_addr + '|' + port + '|' results['SNMP_AGENT_ADDRESS_CONFIG'][snmp_key] = {} else: results['SNMP_AGENT_ADDRESS_CONFIG'] = {} diff --git a/src/sonic-config-engine/tests/sample_graph.xml b/src/sonic-config-engine/tests/sample_graph.xml index 35247671fa24..a0c41a7f55c3 100644 --- a/src/sonic-config-engine/tests/sample_graph.xml +++ b/src/sonic-config-engine/tests/sample_graph.xml @@ -81,6 +81,14 @@ 192.168.200.15/24 + + ManagementIPv6 + Management0 + + fe80::1/64 + + fe80::1/64 + diff --git a/src/sonic-config-engine/tests/test_cfggen.py b/src/sonic-config-engine/tests/test_cfggen.py index b8480cf81fee..e69e3d1cf701 100644 --- a/src/sonic-config-engine/tests/test_cfggen.py +++ b/src/sonic-config-engine/tests/test_cfggen.py @@ -1150,4 +1150,4 @@ def testsnmp_agent_address_config(self): output = self.run_script(argument) self.assertEqual( utils.liststr_to_dict(output.strip()), - utils.liststr_to_dict("['192.168.200.15|161|', '100.0.0.6|161|', '100.0.0.7|161|']")) + utils.liststr_to_dict("['192.168.200.15|161|', '100.0.0.6|161|', '100.0.0.7|161|', 'fe80::1%Management0|161|']")) From 339624c229fd8fc533d237ef371905836f166572 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Fri, 14 Jun 2024 10:02:07 +0300 Subject: [PATCH 374/419] [202311_RC.69] Improve service checker for gnmi/telemetry container --- .../health_checker/service_checker.py | 47 +++++++++++++++--- .../etc/supervisor/critical_processes | 1 + src/system-health/tests/test_system_health.py | 49 +++++++++++++++++++ 3 files changed, 89 insertions(+), 8 deletions(-) create mode 100644 src/system-health/tests/telemetry/etc/supervisor/critical_processes diff --git a/src/system-health/health_checker/service_checker.py b/src/system-health/health_checker/service_checker.py index bc38bd43a929..10ec7e678595 100644 --- a/src/system-health/health_checker/service_checker.py +++ b/src/system-health/health_checker/service_checker.py @@ -15,6 +15,19 @@ EVENTS_PUBLISHER_SOURCE = "sonic-events-host" EVENTS_PUBLISHER_TAG = "process-not-running" +def check_docker_image(image_name): + """ + @summary: This function will check if docker image exists. + @return: True if the image exists, otherwise False. + """ + try: + DOCKER_CLIENT = docker.DockerClient(base_url='unix://var/run/docker.sock') + DOCKER_CLIENT.images.get(image_name) + return True + except (docker.errors.ImageNotFound, docker.errors.APIError) as err: + logger.log_warning("Failed to get image '{}'. Error: '{}'".format(image_name, err)) + return False + class ServiceChecker(HealthChecker): """ Checker that checks critical system service status via monit service. @@ -84,21 +97,39 @@ def get_expected_running_containers(self, feature_table): # it will be removed from exception list. run_all_instance_list = ['database', 'bgp'] - for feature_name, feature_entry in feature_table.items(): + container_list = [] + for container_name in feature_table.keys(): + # slim image does not have telemetry container and corresponding docker image + if container_name == "telemetry": + ret = check_docker_image("docker-sonic-telemetry") + if not ret: + # If telemetry container image is not present, check gnmi container image + # If gnmi container image is not present, ignore telemetry container check + # if gnmi container image is present, check gnmi container instead of telemetry + ret = check_docker_image("docker-sonic-gnmi") + if not ret: + logger.log_debug("Ignoring telemetry container check on image which has no corresponding docker image") + else: + container_list.append("gnmi") + continue + container_list.append(container_name) + + for container_name in container_list: + feature_entry = feature_table[container_name] if feature_entry["state"] not in ["disabled", "always_disabled"]: if multi_asic.is_multi_asic(): if feature_entry.get("has_global_scope", "True") == "True": - expected_running_containers.add(feature_name) - container_feature_dict[feature_name] = feature_name + expected_running_containers.add(container_name) + container_feature_dict[container_name] = container_name if feature_entry.get("has_per_asic_scope", "False") == "True": num_asics = multi_asic.get_num_asics() for asic_id in range(num_asics): - if asic_id in asics_id_presence or feature_name in run_all_instance_list: - expected_running_containers.add(feature_name + str(asic_id)) - container_feature_dict[feature_name + str(asic_id)] = feature_name + if asic_id in asics_id_presence or container_name in run_all_instance_list: + expected_running_containers.add(container_name + str(asic_id)) + container_feature_dict[container_name + str(asic_id)] = container_name else: - expected_running_containers.add(feature_name) - container_feature_dict[feature_name] = feature_name + expected_running_containers.add(container_name) + container_feature_dict[container_name] = container_name if device_info.is_supervisor(): expected_running_containers.add("database-chassis") diff --git a/src/system-health/tests/telemetry/etc/supervisor/critical_processes b/src/system-health/tests/telemetry/etc/supervisor/critical_processes new file mode 100644 index 000000000000..fd693f80070d --- /dev/null +++ b/src/system-health/tests/telemetry/etc/supervisor/critical_processes @@ -0,0 +1 @@ +program:gnmi-native diff --git a/src/system-health/tests/test_system_health.py b/src/system-health/tests/test_system_health.py index cd9a54e8799f..4ceddf857757 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 +import docker from imp import load_source from swsscommon import swsscommon @@ -23,6 +24,7 @@ swsscommon.SonicV2Connector = MockConnector test_path = os.path.dirname(os.path.abspath(__file__)) +telemetry_path = os.path.join(test_path, 'telemetry') modules_path = os.path.dirname(test_path) scripts_path = os.path.join(modules_path, 'scripts') sys.path.insert(0, modules_path) @@ -163,6 +165,53 @@ def test_service_checker_single_asic(mock_config_db, mock_run, mock_docker_clien assert origin_container_critical_processes == checker.container_critical_processes +@patch('swsscommon.swsscommon.ConfigDBConnector.connect', MagicMock()) +@patch('health_checker.service_checker.ServiceChecker._get_container_folder', MagicMock(return_value=telemetry_path)) +@patch('sonic_py_common.multi_asic.is_multi_asic', MagicMock(return_value=False)) +@patch('docker.DockerClient') +@patch('health_checker.utils.run_command') +@patch('swsscommon.swsscommon.ConfigDBConnector') +def test_service_checker_telemetry(mock_config_db, mock_run, mock_docker_client): + setup() + mock_db_data = MagicMock() + mock_get_table = MagicMock() + mock_db_data.get_table = mock_get_table + mock_config_db.return_value = mock_db_data + mock_get_table.return_value = { + 'gnmi': { + 'state': 'enabled', + 'has_global_scope': 'True', + 'has_per_asic_scope': 'False', + + }, + 'telemetry': { + 'state': 'enabled', + 'has_global_scope': 'True', + 'has_per_asic_scope': 'False', + + } + } + mock_containers = MagicMock() + mock_gnmi_container = MagicMock() + mock_gnmi_container.name = 'gnmi' + mock_containers.list = MagicMock(return_value=[mock_gnmi_container]) + mock_docker_client_object = MagicMock() + mock_docker_client.return_value = mock_docker_client_object + mock_docker_client_object.containers = mock_containers + mock_docker_client_object.images = MagicMock() + mock_docker_client_object.images.get = MagicMock() + except_err = docker.errors.ImageNotFound("Unit test") + mock_docker_client_object.images.get.side_effect = [except_err, None] + + mock_run.return_value = "gnmi-native RUNNING pid 67, uptime 1:03:56" + + checker = ServiceChecker() + assert checker.get_category() == 'Services' + config = Config() + checker.check(config) + assert 'gnmi:gnmi-native' in checker._info + assert checker._info['gnmi:gnmi-native'][HealthChecker.INFO_FIELD_OBJECT_STATUS] == HealthChecker.STATUS_OK + @patch('swsscommon.swsscommon.ConfigDBConnector.connect', MagicMock()) @patch('health_checker.service_checker.ServiceChecker._get_container_folder', MagicMock(return_value=test_path)) From 537a9ee2b8833113c4d304a761f62b2965ff61e2 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Fri, 14 Jun 2024 10:02:09 +0300 Subject: [PATCH 375/419] [202311_RC.69] [docker_image_ctl] flush ASIC_DB on fast boot --- files/build_templates/docker_image_ctl.j2 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/files/build_templates/docker_image_ctl.j2 b/files/build_templates/docker_image_ctl.j2 index 4642764afccf..c6e58209502d 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -243,6 +243,9 @@ function postStartAction() fi if [[ "$BOOT_TYPE" == "fast" ]]; then + # Flush ASIC DB. On fast-boot there should be nothing in there. + # In the older versions there has been an issue where a queued FDB event might get into ASIC_DB causing syncd crash at boot. + $SONIC_DB_CLI ASIC_DB FLUSHDB # this is the case when base OS version does not support fast-reboot with reconciliation logic (dump.rdb is absent) # In this case, we need to set the flag to indicate fast-reboot is in progress. Set the key to expire in 3 minutes $SONIC_DB_CLI STATE_DB SET "FAST_REBOOT|system" "1" "EX" "180" From 543acbcb2122154b66da334eb4c6997f4e51e092 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Fri, 14 Jun 2024 10:02:11 +0300 Subject: [PATCH 376/419] [202311_RC.69] [Mellanox] Enhance is_module_host_management_mode to also check syncd's sai.profile --- .../mlnx-platform-api/sonic_platform/device_data.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 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 62792919385e..b9dc10370fca 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py @@ -259,12 +259,14 @@ def get_cpld_component_list(cls): @classmethod @utils.read_only_cache() def is_module_host_management_mode(cls): - from sonic_py_common import device_info - _, hwsku_dir = device_info.get_paths_to_platform_and_hwsku_dirs() - sai_profile_file = os.path.join(hwsku_dir, 'sai.profile') + sai_profile_file = '/tmp/sai.profile' + if not os.path.exists(sai_profile_file): + from sonic_py_common import device_info + _, hwsku_dir = device_info.get_paths_to_platform_and_hwsku_dirs() + sai_profile_file = os.path.join(hwsku_dir, 'sai.profile') data = utils.read_key_value_file(sai_profile_file, delimeter='=') return data.get('SAI_INDEPENDENT_MODULE_MODE') == '1' - + @classmethod def wait_platform_ready(cls): """ From a38dfe7e9cd92a4fd7e713e9f577084118e82161 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Fri, 14 Jun 2024 10:02:39 +0300 Subject: [PATCH 377/419] [202311_RC.69] update submodule(s): sonic-swss sonic-utilities sonic-platform-daemons --- .gitmodules | 6 +++--- src/sonic-platform-daemons | 2 +- src/sonic-swss | 2 +- src/sonic-utilities | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitmodules b/.gitmodules index e68976c433d9..c43bdffe6efb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -12,7 +12,7 @@ branch = 202311 [submodule "sonic-swss"] path = src/sonic-swss - url = https://github.com/sonic-net/sonic-swss + url = https://github.com/nvidia-sonic/sonic-swss branch = 202311 [submodule "src/p4c-bm/p4c-bm"] path = platform/p4/p4c-bm/p4c-bm @@ -37,7 +37,7 @@ url = https://github.com/p4lang/ptf.git [submodule "src/sonic-utilities"] path = src/sonic-utilities - url = https://github.com/sonic-net/sonic-utilities + url = https://github.com/nvidia-sonic/sonic-utilities branch = 202311 [submodule "platform/broadcom/sonic-platform-modules-arista"] path = platform/broadcom/sonic-platform-modules-arista @@ -48,7 +48,7 @@ branch = 202311 [submodule "src/sonic-platform-daemons"] path = src/sonic-platform-daemons - url = https://github.com/sonic-net/sonic-platform-daemons + url = https://github.com/nvidia-sonic/sonic-platform-daemons branch = 202311 [submodule "src/sonic-platform-pde"] path = src/sonic-platform-pde diff --git a/src/sonic-platform-daemons b/src/sonic-platform-daemons index 3d1d1d9eff70..8822f3ec6294 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit 3d1d1d9eff708f92badce072fadc744dd485d936 +Subproject commit 8822f3ec62947f1b565b831974d3895cbfe745b9 diff --git a/src/sonic-swss b/src/sonic-swss index 9e2df9a9d00e..eefb6de726a4 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 9e2df9a9d00ed428a7e7854d8d242d214ed38c6c +Subproject commit eefb6de726a419973af405db34e72ffba516848a diff --git a/src/sonic-utilities b/src/sonic-utilities index 0af03e7cb3a2..0b6df5fc9d72 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 0af03e7cb3a2bb09a7c4ce5f8be12626b1c9ccf2 +Subproject commit 0b6df5fc9d72ffc980a8fb87624e961f25be0846 From 2ebac917ce17a9f5dbcba60f2981ce9032e65cdc Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Fri, 24 May 2024 13:38:25 +0300 Subject: [PATCH 378/419] [202311_RC.69] update media setting and optics si settings for MSFT SKU --- .../Mellanox-SN4700-O8C48/media_settings.json | 786 +++++++----------- .../optics_si_settings.json | 216 ++--- .../Mellanox-SN4700-O8V48/media_settings.json | 786 +++++++----------- .../optics_si_settings.json | 216 ++--- 4 files changed, 776 insertions(+), 1228 deletions(-) diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/media_settings.json b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/media_settings.json index 372b1cb2861c..a19703e62d10 100644 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/media_settings.json +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/media_settings.json @@ -1,506 +1,280 @@ -{ - "GLOBAL_MEDIA_SETTINGS": { - "1-32": { - "QSFP-DD-sm_media_interface": { - "speed:400GAUI-8": { - "idriver": { - "lane0": "0x0000003c", - "lane1": "0x0000003c", - "lane2": "0x0000003c", - "lane3": "0x0000003c", - "lane4": "0x0000003c", - "lane5": "0x0000003c", - "lane6": "0x0000003c", - "lane7": "0x0000003c" - }, - "pre1": { - "lane0": "0xfffffffe", - "lane1": "0xfffffffe", - "lane2": "0xfffffffe", - "lane3": "0xfffffffe", - "lane4": "0xfffffffe", - "lane5": "0xfffffffe", - "lane6": "0xfffffffe", - "lane7": "0xfffffffe" - }, - "pre2": { - "lane0": "0x00000000", - "lane1": "0x00000000", - "lane2": "0x00000000", - "lane3": "0x00000000", - "lane4": "0x00000000", - "lane5": "0x00000000", - "lane6": "0x00000000", - "lane7": "0x00000000" - }, - "main": { - "lane0": "0x00000020", - "lane1": "0x00000020", - "lane2": "0x00000020", - "lane3": "0x00000020", - "lane4": "0x00000020", - "lane5": "0x00000020", - "lane6": "0x00000020", - "lane7": "0x00000020" - }, - "post1": { - "lane0": "0x00000006", - "lane1": "0x00000006", - "lane2": "0x00000006", - "lane3": "0x00000006", - "lane4": "0x00000006", - "lane5": "0x00000006", - "lane6": "0x00000006", - "lane7": "0x00000006" - }, - "ob_m2lp": { - "lane0": "0x00000004", - "lane1": "0x00000004", - "lane2": "0x00000004", - "lane3": "0x00000004", - "lane4": "0x00000004", - "lane5": "0x00000004", - "lane6": "0x00000004", - "lane7": "0x00000004" - }, - "ob_alev_out": { - "lane0": "0x0000000f", - "lane1": "0x0000000f", - "lane2": "0x0000000f", - "lane3": "0x0000000f", - "lane4": "0x0000000f", - "lane5": "0x0000000f", - "lane6": "0x0000000f", - "lane7": "0x0000000f" - }, - "obplev": { - "lane0": "0x00000069", - "lane1": "0x00000069", - "lane2": "0x00000069", - "lane3": "0x00000069", - "lane4": "0x00000069", - "lane5": "0x00000069", - "lane6": "0x00000069", - "lane7": "0x00000069" - }, - "obnlev": { - "lane0": "0x0000005f", - "lane1": "0x0000005f", - "lane2": "0x0000005f", - "lane3": "0x0000005f", - "lane4": "0x0000005f", - "lane5": "0x0000005f", - "lane6": "0x0000005f", - "lane7": "0x0000005f" - }, - "regn_bfm1p": { - "lane0": "0x0000001e", - "lane1": "0x0000001e", - "lane2": "0x0000001e", - "lane3": "0x0000001e", - "lane4": "0x0000001e", - "lane5": "0x0000001e", - "lane6": "0x0000001e", - "lane7": "0x0000001e" - }, - "regn_bfm1n": { - "lane0": "0x000000aa", - "lane1": "0x000000aa", - "lane2": "0x000000aa", - "lane3": "0x000000aa", - "lane4": "0x000000aa", - "lane5": "0x000000aa", - "lane6": "0x000000aa", - "lane7": "0x000000aa" - } - }, - "speed:100GAUI-2": { - "idriver": { - "lane0": "0x0000003c", - "lane1": "0x0000003c" - }, - "pre1": { - "lane0": "0xfffffffe", - "lane1": "0xfffffffe" - }, - "pre2": { - "lane0": "0x00000000", - "lane1": "0x00000000" - }, - "main": { - "lane0": "0x00000020", - "lane1": "0x00000020" - }, - "post1": { - "lane0": "0x00000006", - "lane1": "0x00000006" - }, - "ob_m2lp": { - "lane0": "0x00000004", - "lane1": "0x00000004" - }, - "ob_alev_out": { - "lane0": "0x0000000f", - "lane1": "0x0000000f" - }, - "obplev": { - "lane0": "0x00000069", - "lane1": "0x00000069" - }, - "obnlev": { - "lane0": "0x0000005f", - "lane1": "0x0000005f" - }, - "regn_bfm1p": { - "lane0": "0x0000001e", - "lane1": "0x0000001e" - }, - "regn_bfm1n": { - "lane0": "0x000000aa", - "lane1": "0x000000aa" - } - } - }, - "QSFP-DD-active_cable_media_interface": { - "speed:400GAUI-8": { - "idriver": { - "lane0": "0x0000003c", - "lane1": "0x0000003c", - "lane2": "0x0000003c", - "lane3": "0x0000003c", - "lane4": "0x0000003c", - "lane5": "0x0000003c", - "lane6": "0x0000003c", - "lane7": "0x0000003c" - }, - "pre1": { - "lane0": "0xfffffffe", - "lane1": "0xfffffffe", - "lane2": "0xfffffffe", - "lane3": "0xfffffffe", - "lane4": "0xfffffffe", - "lane5": "0xfffffffe", - "lane6": "0xfffffffe", - "lane7": "0xfffffffe" - }, - "pre2": { - "lane0": "0x00000000", - "lane1": "0x00000000", - "lane2": "0x00000000", - "lane3": "0x00000000", - "lane4": "0x00000000", - "lane5": "0x00000000", - "lane6": "0x00000000", - "lane7": "0x00000000" - }, - "main": { - "lane0": "0x00000020", - "lane1": "0x00000020", - "lane2": "0x00000020", - "lane3": "0x00000020", - "lane4": "0x00000020", - "lane5": "0x00000020", - "lane6": "0x00000020", - "lane7": "0x00000020" - }, - "post1": { - "lane0": "0x00000006", - "lane1": "0x00000006", - "lane2": "0x00000006", - "lane3": "0x00000006", - "lane4": "0x00000006", - "lane5": "0x00000006", - "lane6": "0x00000006", - "lane7": "0x00000006" - }, - "ob_m2lp": { - "lane0": "0x00000004", - "lane1": "0x00000004", - "lane2": "0x00000004", - "lane3": "0x00000004", - "lane4": "0x00000004", - "lane5": "0x00000004", - "lane6": "0x00000004", - "lane7": "0x00000004" - }, - "ob_alev_out": { - "lane0": "0x0000000f", - "lane1": "0x0000000f", - "lane2": "0x0000000f", - "lane3": "0x0000000f", - "lane4": "0x0000000f", - "lane5": "0x0000000f", - "lane6": "0x0000000f", - "lane7": "0x0000000f" - }, - "obplev": { - "lane0": "0x00000069", - "lane1": "0x00000069", - "lane2": "0x00000069", - "lane3": "0x00000069", - "lane4": "0x00000069", - "lane5": "0x00000069", - "lane6": "0x00000069", - "lane7": "0x00000069" - }, - "obnlev": { - "lane0": "0x0000005f", - "lane1": "0x0000005f", - "lane2": "0x0000005f", - "lane3": "0x0000005f", - "lane4": "0x0000005f", - "lane5": "0x0000005f", - "lane6": "0x0000005f", - "lane7": "0x0000005f" - }, - "regn_bfm1p": { - "lane0": "0x0000001e", - "lane1": "0x0000001e", - "lane2": "0x0000001e", - "lane3": "0x0000001e", - "lane4": "0x0000001e", - "lane5": "0x0000001e", - "lane6": "0x0000001e", - "lane7": "0x0000001e" - }, - "regn_bfm1n": { - "lane0": "0x000000aa", - "lane1": "0x000000aa", - "lane2": "0x000000aa", - "lane3": "0x000000aa", - "lane4": "0x000000aa", - "lane5": "0x000000aa", - "lane6": "0x000000aa", - "lane7": "0x000000aa" - } - }, - "speed:CAUI-4": { - "idriver": { - "lane0": "0x00000028", - "lane1": "0x00000028", - "lane2": "0x00000028", - "lane3": "0x00000028", - "lane4": "0x00000028", - "lane5": "0x00000028", - "lane6": "0x00000028", - "lane7": "0x00000028" - }, - "pre1": { - "lane0": "0xfffffff3", - "lane1": "0xfffffff3", - "lane2": "0xfffffff3", - "lane3": "0xfffffff3", - "lane4": "0xfffffff3", - "lane5": "0xfffffff3", - "lane6": "0xfffffff3", - "lane7": "0xfffffff3" - }, - "pre2": { - "lane0": "0x00000000", - "lane1": "0x00000000", - "lane2": "0x00000000", - "lane3": "0x00000000", - "lane4": "0x00000000", - "lane5": "0x00000000", - "lane6": "0x00000000", - "lane7": "0x00000000" - }, - "main": { - "lane0": "0x00000033", - "lane1": "0x00000033", - "lane2": "0x00000033", - "lane3": "0x00000033", - "lane4": "0x00000033", - "lane5": "0x00000033", - "lane6": "0x00000033", - "lane7": "0x00000033" - }, - "post1": { - "lane0": "0x00000000", - "lane1": "0x00000000", - "lane2": "0x00000000", - "lane3": "0x00000000", - "lane4": "0x00000000", - "lane5": "0x00000000", - "lane6": "0x00000000", - "lane7": "0x00000000" - }, - "ob_m2lp": { - "lane0": "0x00000000", - "lane1": "0x00000000", - "lane2": "0x00000000", - "lane3": "0x00000000", - "lane4": "0x00000000", - "lane5": "0x00000000", - "lane6": "0x00000000", - "lane7": "0x00000000" - }, - "ob_alev_out": { - "lane0": "0x0000000f", - "lane1": "0x0000000f", - "lane2": "0x0000000f", - "lane3": "0x0000000f", - "lane4": "0x0000000f", - "lane5": "0x0000000f", - "lane6": "0x0000000f", - "lane7": "0x0000000f" - }, - "obplev": { - "lane0": "0x00000050", - "lane1": "0x00000050", - "lane2": "0x00000050", - "lane3": "0x00000050", - "lane4": "0x00000050", - "lane5": "0x00000050", - "lane6": "0x00000050", - "lane7": "0x00000050" - }, - "obnlev": { - "lane0": "0x00000078", - "lane1": "0x00000078", - "lane2": "0x00000078", - "lane3": "0x00000078", - "lane4": "0x00000078", - "lane5": "0x00000078", - "lane6": "0x00000078", - "lane7": "0x00000078" - }, - "regn_bfm1p": { - "lane0": "0x0000003c", - "lane1": "0x0000003c", - "lane2": "0x0000003c", - "lane3": "0x0000003c", - "lane4": "0x0000003c", - "lane5": "0x0000003c", - "lane6": "0x0000003c", - "lane7": "0x0000003c" - }, - "regn_bfm1n": { - "lane0": "0x0000008c", - "lane1": "0x0000008c", - "lane2": "0x0000008c", - "lane3": "0x0000008c", - "lane4": "0x0000008c", - "lane5": "0x0000008c", - "lane6": "0x0000008c", - "lane7": "0x0000008c" - } - } - }, - "QSFP+-active_cable_media_interface": { - "speed:CAUI-4": { - "idriver": { - "lane0": "0x00000028", - "lane1": "0x00000028", - "lane2": "0x00000028", - "lane3": "0x00000028", - "lane4": "0x00000028", - "lane5": "0x00000028", - "lane6": "0x00000028", - "lane7": "0x00000028" - }, - "pre1": { - "lane0": "0xfffffff3", - "lane1": "0xfffffff3", - "lane2": "0xfffffff3", - "lane3": "0xfffffff3", - "lane4": "0xfffffff3", - "lane5": "0xfffffff3", - "lane6": "0xfffffff3", - "lane7": "0xfffffff3" - }, - "pre2": { - "lane0": "0x00000000", - "lane1": "0x00000000", - "lane2": "0x00000000", - "lane3": "0x00000000", - "lane4": "0x00000000", - "lane5": "0x00000000", - "lane6": "0x00000000", - "lane7": "0x00000000" - }, - "main": { - "lane0": "0x00000033", - "lane1": "0x00000033", - "lane2": "0x00000033", - "lane3": "0x00000033", - "lane4": "0x00000033", - "lane5": "0x00000033", - "lane6": "0x00000033", - "lane7": "0x00000033" - }, - "post1": { - "lane0": "0x00000000", - "lane1": "0x00000000", - "lane2": "0x00000000", - "lane3": "0x00000000", - "lane4": "0x00000000", - "lane5": "0x00000000", - "lane6": "0x00000000", - "lane7": "0x00000000" - }, - "ob_m2lp": { - "lane0": "0x00000000", - "lane1": "0x00000000", - "lane2": "0x00000000", - "lane3": "0x00000000", - "lane4": "0x00000000", - "lane5": "0x00000000", - "lane6": "0x00000000", - "lane7": "0x00000000" - }, - "ob_alev_out": { - "lane0": "0x0000000f", - "lane1": "0x0000000f", - "lane2": "0x0000000f", - "lane3": "0x0000000f", - "lane4": "0x0000000f", - "lane5": "0x0000000f", - "lane6": "0x0000000f", - "lane7": "0x0000000f" - }, - "obplev": { - "lane0": "0x00000050", - "lane1": "0x00000050", - "lane2": "0x00000050", - "lane3": "0x00000050", - "lane4": "0x00000050", - "lane5": "0x00000050", - "lane6": "0x00000050", - "lane7": "0x00000050" - }, - "obnlev": { - "lane0": "0x00000078", - "lane1": "0x00000078", - "lane2": "0x00000078", - "lane3": "0x00000078", - "lane4": "0x00000078", - "lane5": "0x00000078", - "lane6": "0x00000078", - "lane7": "0x00000078" - }, - "regn_bfm1p": { - "lane0": "0x0000003c", - "lane1": "0x0000003c", - "lane2": "0x0000003c", - "lane3": "0x0000003c", - "lane4": "0x0000003c", - "lane5": "0x0000003c", - "lane6": "0x0000003c", - "lane7": "0x0000003c" - }, - "regn_bfm1n": { - "lane0": "0x0000008c", - "lane1": "0x0000008c", - "lane2": "0x0000008c", - "lane3": "0x0000008c", - "lane4": "0x0000008c", - "lane5": "0x0000008c", - "lane6": "0x0000008c", - "lane7": "0x0000008c" - } - } - } - } - } -} +{ + "GLOBAL_MEDIA_SETTINGS": { + "0-31": { + "QSFP-DD-sm_media_interface": { + "speed:400GAUI-8": { + "idriver": { + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "pre1": { + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre2": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "main": { + "lane0": "0x00000020", + "lane1": "0x00000020", + "lane2": "0x00000020", + "lane3": "0x00000020", + "lane4": "0x00000020", + "lane5": "0x00000020", + "lane6": "0x00000020", + "lane7": "0x00000020" + }, + "post1": { + "lane0": "0x00000006", + "lane1": "0x00000006", + "lane2": "0x00000006", + "lane3": "0x00000006", + "lane4": "0x00000006", + "lane5": "0x00000006", + "lane6": "0x00000006", + "lane7": "0x00000006" + }, + "ob_m2lp": { + "lane0": "0x00000004", + "lane1": "0x00000004", + "lane2": "0x00000004", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + }, + "ob_alev_out": { + "lane0": "0x0000000f", + "lane1": "0x0000000f", + "lane2": "0x0000000f", + "lane3": "0x0000000f", + "lane4": "0x0000000f", + "lane5": "0x0000000f", + "lane6": "0x0000000f", + "lane7": "0x0000000f" + }, + "obplev": { + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "obnlev": { + "lane0": "0x0000005f", + "lane1": "0x0000005f", + "lane2": "0x0000005f", + "lane3": "0x0000005f", + "lane4": "0x0000005f", + "lane5": "0x0000005f", + "lane6": "0x0000005f", + "lane7": "0x0000005f" + }, + "regn_bfm1p": { + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "regn_bfm1n": { + "lane0": "0x000000aa", + "lane1": "0x000000aa", + "lane2": "0x000000aa", + "lane3": "0x000000aa", + "lane4": "0x000000aa", + "lane5": "0x000000aa", + "lane6": "0x000000aa", + "lane7": "0x000000aa" + } + }, + "speed:100GAUI-2": { + "idriver": { + "lane0": "0x0000003c", + "lane1": "0x0000003c" + }, + "pre1": { + "lane0": "0xfffffffe", + "lane1": "0xfffffffe" + }, + "pre2": { + "lane0": "0x00000000", + "lane1": "0x00000000" + }, + "main": { + "lane0": "0x00000020", + "lane1": "0x00000020" + }, + "post1": { + "lane0": "0x00000006", + "lane1": "0x00000006" + }, + "ob_m2lp": { + "lane0": "0x00000004", + "lane1": "0x00000004" + }, + "ob_alev_out": { + "lane0": "0x0000000f", + "lane1": "0x0000000f" + }, + "obplev": { + "lane0": "0x00000069", + "lane1": "0x00000069" + }, + "obnlev": { + "lane0": "0x0000005f", + "lane1": "0x0000005f" + }, + "regn_bfm1p": { + "lane0": "0x0000001e", + "lane1": "0x0000001e" + }, + "regn_bfm1n": { + "lane0": "0x000000aa", + "lane1": "0x000000aa" + } + } + }, + "QSFP-DD-active_cable_media_interface": { + "speed:400GAUI-8": { + "idriver": { + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "pre1": { + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre2": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "main": { + "lane0": "0x00000020", + "lane1": "0x00000020", + "lane2": "0x00000020", + "lane3": "0x00000020", + "lane4": "0x00000020", + "lane5": "0x00000020", + "lane6": "0x00000020", + "lane7": "0x00000020" + }, + "post1": { + "lane0": "0x00000006", + "lane1": "0x00000006", + "lane2": "0x00000006", + "lane3": "0x00000006", + "lane4": "0x00000006", + "lane5": "0x00000006", + "lane6": "0x00000006", + "lane7": "0x00000006" + }, + "ob_m2lp": { + "lane0": "0x00000004", + "lane1": "0x00000004", + "lane2": "0x00000004", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + }, + "ob_alev_out": { + "lane0": "0x0000000f", + "lane1": "0x0000000f", + "lane2": "0x0000000f", + "lane3": "0x0000000f", + "lane4": "0x0000000f", + "lane5": "0x0000000f", + "lane6": "0x0000000f", + "lane7": "0x0000000f" + }, + "obplev": { + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "obnlev": { + "lane0": "0x0000005f", + "lane1": "0x0000005f", + "lane2": "0x0000005f", + "lane3": "0x0000005f", + "lane4": "0x0000005f", + "lane5": "0x0000005f", + "lane6": "0x0000005f", + "lane7": "0x0000005f" + }, + "regn_bfm1p": { + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "regn_bfm1n": { + "lane0": "0x000000aa", + "lane1": "0x000000aa", + "lane2": "0x000000aa", + "lane3": "0x000000aa", + "lane4": "0x000000aa", + "lane5": "0x000000aa", + "lane6": "0x000000aa", + "lane7": "0x000000aa" + } + } + } + } + } +} \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/optics_si_settings.json b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/optics_si_settings.json index bf71e818a869..41227c2179b6 100644 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/optics_si_settings.json +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/optics_si_settings.json @@ -1,108 +1,108 @@ -{ - "GLOBAL_MEDIA_SETTINGS": { - "1-32": { - "50G_SPEED": { - "Default": { - "OutputAmplitudeTargetRx": { - "OutputAmplitudeTargetRx1": 0, - "OutputAmplitudeTargetRx2": 0, - "OutputAmplitudeTargetRx3": 0, - "OutputAmplitudeTargetRx4": 0, - "OutputAmplitudeTargetRx5": 0, - "OutputAmplitudeTargetRx6": 0, - "OutputAmplitudeTargetRx7": 0, - "OutputAmplitudeTargetRx8": 0 - }, - "OutputEqPreCursorTargetRx": { - "OutputEqPreCursorTargetRx1": 0, - "OutputEqPreCursorTargetRx2": 0, - "OutputEqPreCursorTargetRx3": 0, - "OutputEqPreCursorTargetRx4": 0, - "OutputEqPreCursorTargetRx5": 0, - "OutputEqPreCursorTargetRx6": 0, - "OutputEqPreCursorTargetRx7": 0, - "OutputEqPreCursorTargetRx8": 0 - }, - "OutputEqPostCursorTargetRx": { - "OutputEqPostCursorTargetRx1": 0, - "OutputEqPostCursorTargetRx2": 0, - "OutputEqPostCursorTargetRx3": 0, - "OutputEqPostCursorTargetRx4": 0, - "OutputEqPostCursorTargetRx5": 0, - "OutputEqPostCursorTargetRx6": 0, - "OutputEqPostCursorTargetRx7": 0, - "OutputEqPostCursorTargetRx8": 0 - } - } - }, - "25G_SPEED": { - "Default": { - "OutputAmplitudeTargetRx": { - "OutputAmplitudeTargetRx1": 0, - "OutputAmplitudeTargetRx2": 0, - "OutputAmplitudeTargetRx3": 0, - "OutputAmplitudeTargetRx4": 0, - "OutputAmplitudeTargetRx5": 0, - "OutputAmplitudeTargetRx6": 0, - "OutputAmplitudeTargetRx7": 0, - "OutputAmplitudeTargetRx8": 0 - }, - "OutputEqPreCursorTargetRx": { - "OutputEqPreCursorTargetRx1": 0, - "OutputEqPreCursorTargetRx2": 0, - "OutputEqPreCursorTargetRx3": 0, - "OutputEqPreCursorTargetRx4": 0, - "OutputEqPreCursorTargetRx5": 0, - "OutputEqPreCursorTargetRx6": 0, - "OutputEqPreCursorTargetRx7": 0, - "OutputEqPreCursorTargetRx8": 0 - }, - "OutputEqPostCursorTargetRx": { - "OutputEqPostCursorTargetRx1": 0, - "OutputEqPostCursorTargetRx2": 0, - "OutputEqPostCursorTargetRx3": 0, - "OutputEqPostCursorTargetRx4": 0, - "OutputEqPostCursorTargetRx5": 0, - "OutputEqPostCursorTargetRx6": 0, - "OutputEqPostCursorTargetRx7": 0, - "OutputEqPostCursorTargetRx8": 0 - } - } - }, - "10G_SPEED": { - "Default": { - "OutputAmplitudeTargetRx": { - "OutputAmplitudeTargetRx1": 0, - "OutputAmplitudeTargetRx2": 0, - "OutputAmplitudeTargetRx3": 0, - "OutputAmplitudeTargetRx4": 0, - "OutputAmplitudeTargetRx5": 0, - "OutputAmplitudeTargetRx6": 0, - "OutputAmplitudeTargetRx7": 0, - "OutputAmplitudeTargetRx8": 0 - }, - "OutputEqPreCursorTargetRx": { - "OutputEqPreCursorTargetRx1": 0, - "OutputEqPreCursorTargetRx2": 0, - "OutputEqPreCursorTargetRx3": 0, - "OutputEqPreCursorTargetRx4": 0, - "OutputEqPreCursorTargetRx5": 0, - "OutputEqPreCursorTargetRx6": 0, - "OutputEqPreCursorTargetRx7": 0, - "OutputEqPreCursorTargetRx8": 0 - }, - "OutputEqPostCursorTargetRx": { - "OutputEqPostCursorTargetRx1": 0, - "OutputEqPostCursorTargetRx2": 0, - "OutputEqPostCursorTargetRx3": 0, - "OutputEqPostCursorTargetRx4": 0, - "OutputEqPostCursorTargetRx5": 0, - "OutputEqPostCursorTargetRx6": 0, - "OutputEqPostCursorTargetRx7": 0, - "OutputEqPostCursorTargetRx8": 0 - } - } - } - } - } -} +{ + "GLOBAL_MEDIA_SETTINGS": { + "1-32": { + "50G_SPEED": { + "Default": { + "OutputAmplitudeTargetRx": { + "OutputAmplitudeTargetRx1": 0, + "OutputAmplitudeTargetRx2": 0, + "OutputAmplitudeTargetRx3": 0, + "OutputAmplitudeTargetRx4": 0, + "OutputAmplitudeTargetRx5": 0, + "OutputAmplitudeTargetRx6": 0, + "OutputAmplitudeTargetRx7": 0, + "OutputAmplitudeTargetRx8": 0 + }, + "OutputEqPreCursorTargetRx": { + "OutputEqPreCursorTargetRx1": 0, + "OutputEqPreCursorTargetRx2": 0, + "OutputEqPreCursorTargetRx3": 0, + "OutputEqPreCursorTargetRx4": 0, + "OutputEqPreCursorTargetRx5": 0, + "OutputEqPreCursorTargetRx6": 0, + "OutputEqPreCursorTargetRx7": 0, + "OutputEqPreCursorTargetRx8": 0 + }, + "OutputEqPostCursorTargetRx": { + "OutputEqPostCursorTargetRx1": 0, + "OutputEqPostCursorTargetRx2": 0, + "OutputEqPostCursorTargetRx3": 0, + "OutputEqPostCursorTargetRx4": 0, + "OutputEqPostCursorTargetRx5": 0, + "OutputEqPostCursorTargetRx6": 0, + "OutputEqPostCursorTargetRx7": 0, + "OutputEqPostCursorTargetRx8": 0 + } + } + }, + "25G_SPEED": { + "Default": { + "OutputAmplitudeTargetRx": { + "OutputAmplitudeTargetRx1": 0, + "OutputAmplitudeTargetRx2": 0, + "OutputAmplitudeTargetRx3": 0, + "OutputAmplitudeTargetRx4": 0, + "OutputAmplitudeTargetRx5": 0, + "OutputAmplitudeTargetRx6": 0, + "OutputAmplitudeTargetRx7": 0, + "OutputAmplitudeTargetRx8": 0 + }, + "OutputEqPreCursorTargetRx": { + "OutputEqPreCursorTargetRx1": 0, + "OutputEqPreCursorTargetRx2": 0, + "OutputEqPreCursorTargetRx3": 0, + "OutputEqPreCursorTargetRx4": 0, + "OutputEqPreCursorTargetRx5": 0, + "OutputEqPreCursorTargetRx6": 0, + "OutputEqPreCursorTargetRx7": 0, + "OutputEqPreCursorTargetRx8": 0 + }, + "OutputEqPostCursorTargetRx": { + "OutputEqPostCursorTargetRx1": 0, + "OutputEqPostCursorTargetRx2": 0, + "OutputEqPostCursorTargetRx3": 0, + "OutputEqPostCursorTargetRx4": 0, + "OutputEqPostCursorTargetRx5": 0, + "OutputEqPostCursorTargetRx6": 0, + "OutputEqPostCursorTargetRx7": 0, + "OutputEqPostCursorTargetRx8": 0 + } + } + }, + "10G_SPEED": { + "Default": { + "OutputAmplitudeTargetRx": { + "OutputAmplitudeTargetRx1": 0, + "OutputAmplitudeTargetRx2": 0, + "OutputAmplitudeTargetRx3": 0, + "OutputAmplitudeTargetRx4": 0, + "OutputAmplitudeTargetRx5": 0, + "OutputAmplitudeTargetRx6": 0, + "OutputAmplitudeTargetRx7": 0, + "OutputAmplitudeTargetRx8": 0 + }, + "OutputEqPreCursorTargetRx": { + "OutputEqPreCursorTargetRx1": 0, + "OutputEqPreCursorTargetRx2": 0, + "OutputEqPreCursorTargetRx3": 0, + "OutputEqPreCursorTargetRx4": 0, + "OutputEqPreCursorTargetRx5": 0, + "OutputEqPreCursorTargetRx6": 0, + "OutputEqPreCursorTargetRx7": 0, + "OutputEqPreCursorTargetRx8": 0 + }, + "OutputEqPostCursorTargetRx": { + "OutputEqPostCursorTargetRx1": 0, + "OutputEqPostCursorTargetRx2": 0, + "OutputEqPostCursorTargetRx3": 0, + "OutputEqPostCursorTargetRx4": 0, + "OutputEqPostCursorTargetRx5": 0, + "OutputEqPostCursorTargetRx6": 0, + "OutputEqPostCursorTargetRx7": 0, + "OutputEqPostCursorTargetRx8": 0 + } + } + } + } + } +} diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/media_settings.json b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/media_settings.json index 372b1cb2861c..a19703e62d10 100644 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/media_settings.json +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/media_settings.json @@ -1,506 +1,280 @@ -{ - "GLOBAL_MEDIA_SETTINGS": { - "1-32": { - "QSFP-DD-sm_media_interface": { - "speed:400GAUI-8": { - "idriver": { - "lane0": "0x0000003c", - "lane1": "0x0000003c", - "lane2": "0x0000003c", - "lane3": "0x0000003c", - "lane4": "0x0000003c", - "lane5": "0x0000003c", - "lane6": "0x0000003c", - "lane7": "0x0000003c" - }, - "pre1": { - "lane0": "0xfffffffe", - "lane1": "0xfffffffe", - "lane2": "0xfffffffe", - "lane3": "0xfffffffe", - "lane4": "0xfffffffe", - "lane5": "0xfffffffe", - "lane6": "0xfffffffe", - "lane7": "0xfffffffe" - }, - "pre2": { - "lane0": "0x00000000", - "lane1": "0x00000000", - "lane2": "0x00000000", - "lane3": "0x00000000", - "lane4": "0x00000000", - "lane5": "0x00000000", - "lane6": "0x00000000", - "lane7": "0x00000000" - }, - "main": { - "lane0": "0x00000020", - "lane1": "0x00000020", - "lane2": "0x00000020", - "lane3": "0x00000020", - "lane4": "0x00000020", - "lane5": "0x00000020", - "lane6": "0x00000020", - "lane7": "0x00000020" - }, - "post1": { - "lane0": "0x00000006", - "lane1": "0x00000006", - "lane2": "0x00000006", - "lane3": "0x00000006", - "lane4": "0x00000006", - "lane5": "0x00000006", - "lane6": "0x00000006", - "lane7": "0x00000006" - }, - "ob_m2lp": { - "lane0": "0x00000004", - "lane1": "0x00000004", - "lane2": "0x00000004", - "lane3": "0x00000004", - "lane4": "0x00000004", - "lane5": "0x00000004", - "lane6": "0x00000004", - "lane7": "0x00000004" - }, - "ob_alev_out": { - "lane0": "0x0000000f", - "lane1": "0x0000000f", - "lane2": "0x0000000f", - "lane3": "0x0000000f", - "lane4": "0x0000000f", - "lane5": "0x0000000f", - "lane6": "0x0000000f", - "lane7": "0x0000000f" - }, - "obplev": { - "lane0": "0x00000069", - "lane1": "0x00000069", - "lane2": "0x00000069", - "lane3": "0x00000069", - "lane4": "0x00000069", - "lane5": "0x00000069", - "lane6": "0x00000069", - "lane7": "0x00000069" - }, - "obnlev": { - "lane0": "0x0000005f", - "lane1": "0x0000005f", - "lane2": "0x0000005f", - "lane3": "0x0000005f", - "lane4": "0x0000005f", - "lane5": "0x0000005f", - "lane6": "0x0000005f", - "lane7": "0x0000005f" - }, - "regn_bfm1p": { - "lane0": "0x0000001e", - "lane1": "0x0000001e", - "lane2": "0x0000001e", - "lane3": "0x0000001e", - "lane4": "0x0000001e", - "lane5": "0x0000001e", - "lane6": "0x0000001e", - "lane7": "0x0000001e" - }, - "regn_bfm1n": { - "lane0": "0x000000aa", - "lane1": "0x000000aa", - "lane2": "0x000000aa", - "lane3": "0x000000aa", - "lane4": "0x000000aa", - "lane5": "0x000000aa", - "lane6": "0x000000aa", - "lane7": "0x000000aa" - } - }, - "speed:100GAUI-2": { - "idriver": { - "lane0": "0x0000003c", - "lane1": "0x0000003c" - }, - "pre1": { - "lane0": "0xfffffffe", - "lane1": "0xfffffffe" - }, - "pre2": { - "lane0": "0x00000000", - "lane1": "0x00000000" - }, - "main": { - "lane0": "0x00000020", - "lane1": "0x00000020" - }, - "post1": { - "lane0": "0x00000006", - "lane1": "0x00000006" - }, - "ob_m2lp": { - "lane0": "0x00000004", - "lane1": "0x00000004" - }, - "ob_alev_out": { - "lane0": "0x0000000f", - "lane1": "0x0000000f" - }, - "obplev": { - "lane0": "0x00000069", - "lane1": "0x00000069" - }, - "obnlev": { - "lane0": "0x0000005f", - "lane1": "0x0000005f" - }, - "regn_bfm1p": { - "lane0": "0x0000001e", - "lane1": "0x0000001e" - }, - "regn_bfm1n": { - "lane0": "0x000000aa", - "lane1": "0x000000aa" - } - } - }, - "QSFP-DD-active_cable_media_interface": { - "speed:400GAUI-8": { - "idriver": { - "lane0": "0x0000003c", - "lane1": "0x0000003c", - "lane2": "0x0000003c", - "lane3": "0x0000003c", - "lane4": "0x0000003c", - "lane5": "0x0000003c", - "lane6": "0x0000003c", - "lane7": "0x0000003c" - }, - "pre1": { - "lane0": "0xfffffffe", - "lane1": "0xfffffffe", - "lane2": "0xfffffffe", - "lane3": "0xfffffffe", - "lane4": "0xfffffffe", - "lane5": "0xfffffffe", - "lane6": "0xfffffffe", - "lane7": "0xfffffffe" - }, - "pre2": { - "lane0": "0x00000000", - "lane1": "0x00000000", - "lane2": "0x00000000", - "lane3": "0x00000000", - "lane4": "0x00000000", - "lane5": "0x00000000", - "lane6": "0x00000000", - "lane7": "0x00000000" - }, - "main": { - "lane0": "0x00000020", - "lane1": "0x00000020", - "lane2": "0x00000020", - "lane3": "0x00000020", - "lane4": "0x00000020", - "lane5": "0x00000020", - "lane6": "0x00000020", - "lane7": "0x00000020" - }, - "post1": { - "lane0": "0x00000006", - "lane1": "0x00000006", - "lane2": "0x00000006", - "lane3": "0x00000006", - "lane4": "0x00000006", - "lane5": "0x00000006", - "lane6": "0x00000006", - "lane7": "0x00000006" - }, - "ob_m2lp": { - "lane0": "0x00000004", - "lane1": "0x00000004", - "lane2": "0x00000004", - "lane3": "0x00000004", - "lane4": "0x00000004", - "lane5": "0x00000004", - "lane6": "0x00000004", - "lane7": "0x00000004" - }, - "ob_alev_out": { - "lane0": "0x0000000f", - "lane1": "0x0000000f", - "lane2": "0x0000000f", - "lane3": "0x0000000f", - "lane4": "0x0000000f", - "lane5": "0x0000000f", - "lane6": "0x0000000f", - "lane7": "0x0000000f" - }, - "obplev": { - "lane0": "0x00000069", - "lane1": "0x00000069", - "lane2": "0x00000069", - "lane3": "0x00000069", - "lane4": "0x00000069", - "lane5": "0x00000069", - "lane6": "0x00000069", - "lane7": "0x00000069" - }, - "obnlev": { - "lane0": "0x0000005f", - "lane1": "0x0000005f", - "lane2": "0x0000005f", - "lane3": "0x0000005f", - "lane4": "0x0000005f", - "lane5": "0x0000005f", - "lane6": "0x0000005f", - "lane7": "0x0000005f" - }, - "regn_bfm1p": { - "lane0": "0x0000001e", - "lane1": "0x0000001e", - "lane2": "0x0000001e", - "lane3": "0x0000001e", - "lane4": "0x0000001e", - "lane5": "0x0000001e", - "lane6": "0x0000001e", - "lane7": "0x0000001e" - }, - "regn_bfm1n": { - "lane0": "0x000000aa", - "lane1": "0x000000aa", - "lane2": "0x000000aa", - "lane3": "0x000000aa", - "lane4": "0x000000aa", - "lane5": "0x000000aa", - "lane6": "0x000000aa", - "lane7": "0x000000aa" - } - }, - "speed:CAUI-4": { - "idriver": { - "lane0": "0x00000028", - "lane1": "0x00000028", - "lane2": "0x00000028", - "lane3": "0x00000028", - "lane4": "0x00000028", - "lane5": "0x00000028", - "lane6": "0x00000028", - "lane7": "0x00000028" - }, - "pre1": { - "lane0": "0xfffffff3", - "lane1": "0xfffffff3", - "lane2": "0xfffffff3", - "lane3": "0xfffffff3", - "lane4": "0xfffffff3", - "lane5": "0xfffffff3", - "lane6": "0xfffffff3", - "lane7": "0xfffffff3" - }, - "pre2": { - "lane0": "0x00000000", - "lane1": "0x00000000", - "lane2": "0x00000000", - "lane3": "0x00000000", - "lane4": "0x00000000", - "lane5": "0x00000000", - "lane6": "0x00000000", - "lane7": "0x00000000" - }, - "main": { - "lane0": "0x00000033", - "lane1": "0x00000033", - "lane2": "0x00000033", - "lane3": "0x00000033", - "lane4": "0x00000033", - "lane5": "0x00000033", - "lane6": "0x00000033", - "lane7": "0x00000033" - }, - "post1": { - "lane0": "0x00000000", - "lane1": "0x00000000", - "lane2": "0x00000000", - "lane3": "0x00000000", - "lane4": "0x00000000", - "lane5": "0x00000000", - "lane6": "0x00000000", - "lane7": "0x00000000" - }, - "ob_m2lp": { - "lane0": "0x00000000", - "lane1": "0x00000000", - "lane2": "0x00000000", - "lane3": "0x00000000", - "lane4": "0x00000000", - "lane5": "0x00000000", - "lane6": "0x00000000", - "lane7": "0x00000000" - }, - "ob_alev_out": { - "lane0": "0x0000000f", - "lane1": "0x0000000f", - "lane2": "0x0000000f", - "lane3": "0x0000000f", - "lane4": "0x0000000f", - "lane5": "0x0000000f", - "lane6": "0x0000000f", - "lane7": "0x0000000f" - }, - "obplev": { - "lane0": "0x00000050", - "lane1": "0x00000050", - "lane2": "0x00000050", - "lane3": "0x00000050", - "lane4": "0x00000050", - "lane5": "0x00000050", - "lane6": "0x00000050", - "lane7": "0x00000050" - }, - "obnlev": { - "lane0": "0x00000078", - "lane1": "0x00000078", - "lane2": "0x00000078", - "lane3": "0x00000078", - "lane4": "0x00000078", - "lane5": "0x00000078", - "lane6": "0x00000078", - "lane7": "0x00000078" - }, - "regn_bfm1p": { - "lane0": "0x0000003c", - "lane1": "0x0000003c", - "lane2": "0x0000003c", - "lane3": "0x0000003c", - "lane4": "0x0000003c", - "lane5": "0x0000003c", - "lane6": "0x0000003c", - "lane7": "0x0000003c" - }, - "regn_bfm1n": { - "lane0": "0x0000008c", - "lane1": "0x0000008c", - "lane2": "0x0000008c", - "lane3": "0x0000008c", - "lane4": "0x0000008c", - "lane5": "0x0000008c", - "lane6": "0x0000008c", - "lane7": "0x0000008c" - } - } - }, - "QSFP+-active_cable_media_interface": { - "speed:CAUI-4": { - "idriver": { - "lane0": "0x00000028", - "lane1": "0x00000028", - "lane2": "0x00000028", - "lane3": "0x00000028", - "lane4": "0x00000028", - "lane5": "0x00000028", - "lane6": "0x00000028", - "lane7": "0x00000028" - }, - "pre1": { - "lane0": "0xfffffff3", - "lane1": "0xfffffff3", - "lane2": "0xfffffff3", - "lane3": "0xfffffff3", - "lane4": "0xfffffff3", - "lane5": "0xfffffff3", - "lane6": "0xfffffff3", - "lane7": "0xfffffff3" - }, - "pre2": { - "lane0": "0x00000000", - "lane1": "0x00000000", - "lane2": "0x00000000", - "lane3": "0x00000000", - "lane4": "0x00000000", - "lane5": "0x00000000", - "lane6": "0x00000000", - "lane7": "0x00000000" - }, - "main": { - "lane0": "0x00000033", - "lane1": "0x00000033", - "lane2": "0x00000033", - "lane3": "0x00000033", - "lane4": "0x00000033", - "lane5": "0x00000033", - "lane6": "0x00000033", - "lane7": "0x00000033" - }, - "post1": { - "lane0": "0x00000000", - "lane1": "0x00000000", - "lane2": "0x00000000", - "lane3": "0x00000000", - "lane4": "0x00000000", - "lane5": "0x00000000", - "lane6": "0x00000000", - "lane7": "0x00000000" - }, - "ob_m2lp": { - "lane0": "0x00000000", - "lane1": "0x00000000", - "lane2": "0x00000000", - "lane3": "0x00000000", - "lane4": "0x00000000", - "lane5": "0x00000000", - "lane6": "0x00000000", - "lane7": "0x00000000" - }, - "ob_alev_out": { - "lane0": "0x0000000f", - "lane1": "0x0000000f", - "lane2": "0x0000000f", - "lane3": "0x0000000f", - "lane4": "0x0000000f", - "lane5": "0x0000000f", - "lane6": "0x0000000f", - "lane7": "0x0000000f" - }, - "obplev": { - "lane0": "0x00000050", - "lane1": "0x00000050", - "lane2": "0x00000050", - "lane3": "0x00000050", - "lane4": "0x00000050", - "lane5": "0x00000050", - "lane6": "0x00000050", - "lane7": "0x00000050" - }, - "obnlev": { - "lane0": "0x00000078", - "lane1": "0x00000078", - "lane2": "0x00000078", - "lane3": "0x00000078", - "lane4": "0x00000078", - "lane5": "0x00000078", - "lane6": "0x00000078", - "lane7": "0x00000078" - }, - "regn_bfm1p": { - "lane0": "0x0000003c", - "lane1": "0x0000003c", - "lane2": "0x0000003c", - "lane3": "0x0000003c", - "lane4": "0x0000003c", - "lane5": "0x0000003c", - "lane6": "0x0000003c", - "lane7": "0x0000003c" - }, - "regn_bfm1n": { - "lane0": "0x0000008c", - "lane1": "0x0000008c", - "lane2": "0x0000008c", - "lane3": "0x0000008c", - "lane4": "0x0000008c", - "lane5": "0x0000008c", - "lane6": "0x0000008c", - "lane7": "0x0000008c" - } - } - } - } - } -} +{ + "GLOBAL_MEDIA_SETTINGS": { + "0-31": { + "QSFP-DD-sm_media_interface": { + "speed:400GAUI-8": { + "idriver": { + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "pre1": { + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre2": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "main": { + "lane0": "0x00000020", + "lane1": "0x00000020", + "lane2": "0x00000020", + "lane3": "0x00000020", + "lane4": "0x00000020", + "lane5": "0x00000020", + "lane6": "0x00000020", + "lane7": "0x00000020" + }, + "post1": { + "lane0": "0x00000006", + "lane1": "0x00000006", + "lane2": "0x00000006", + "lane3": "0x00000006", + "lane4": "0x00000006", + "lane5": "0x00000006", + "lane6": "0x00000006", + "lane7": "0x00000006" + }, + "ob_m2lp": { + "lane0": "0x00000004", + "lane1": "0x00000004", + "lane2": "0x00000004", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + }, + "ob_alev_out": { + "lane0": "0x0000000f", + "lane1": "0x0000000f", + "lane2": "0x0000000f", + "lane3": "0x0000000f", + "lane4": "0x0000000f", + "lane5": "0x0000000f", + "lane6": "0x0000000f", + "lane7": "0x0000000f" + }, + "obplev": { + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "obnlev": { + "lane0": "0x0000005f", + "lane1": "0x0000005f", + "lane2": "0x0000005f", + "lane3": "0x0000005f", + "lane4": "0x0000005f", + "lane5": "0x0000005f", + "lane6": "0x0000005f", + "lane7": "0x0000005f" + }, + "regn_bfm1p": { + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "regn_bfm1n": { + "lane0": "0x000000aa", + "lane1": "0x000000aa", + "lane2": "0x000000aa", + "lane3": "0x000000aa", + "lane4": "0x000000aa", + "lane5": "0x000000aa", + "lane6": "0x000000aa", + "lane7": "0x000000aa" + } + }, + "speed:100GAUI-2": { + "idriver": { + "lane0": "0x0000003c", + "lane1": "0x0000003c" + }, + "pre1": { + "lane0": "0xfffffffe", + "lane1": "0xfffffffe" + }, + "pre2": { + "lane0": "0x00000000", + "lane1": "0x00000000" + }, + "main": { + "lane0": "0x00000020", + "lane1": "0x00000020" + }, + "post1": { + "lane0": "0x00000006", + "lane1": "0x00000006" + }, + "ob_m2lp": { + "lane0": "0x00000004", + "lane1": "0x00000004" + }, + "ob_alev_out": { + "lane0": "0x0000000f", + "lane1": "0x0000000f" + }, + "obplev": { + "lane0": "0x00000069", + "lane1": "0x00000069" + }, + "obnlev": { + "lane0": "0x0000005f", + "lane1": "0x0000005f" + }, + "regn_bfm1p": { + "lane0": "0x0000001e", + "lane1": "0x0000001e" + }, + "regn_bfm1n": { + "lane0": "0x000000aa", + "lane1": "0x000000aa" + } + } + }, + "QSFP-DD-active_cable_media_interface": { + "speed:400GAUI-8": { + "idriver": { + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "pre1": { + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre2": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "main": { + "lane0": "0x00000020", + "lane1": "0x00000020", + "lane2": "0x00000020", + "lane3": "0x00000020", + "lane4": "0x00000020", + "lane5": "0x00000020", + "lane6": "0x00000020", + "lane7": "0x00000020" + }, + "post1": { + "lane0": "0x00000006", + "lane1": "0x00000006", + "lane2": "0x00000006", + "lane3": "0x00000006", + "lane4": "0x00000006", + "lane5": "0x00000006", + "lane6": "0x00000006", + "lane7": "0x00000006" + }, + "ob_m2lp": { + "lane0": "0x00000004", + "lane1": "0x00000004", + "lane2": "0x00000004", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + }, + "ob_alev_out": { + "lane0": "0x0000000f", + "lane1": "0x0000000f", + "lane2": "0x0000000f", + "lane3": "0x0000000f", + "lane4": "0x0000000f", + "lane5": "0x0000000f", + "lane6": "0x0000000f", + "lane7": "0x0000000f" + }, + "obplev": { + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "obnlev": { + "lane0": "0x0000005f", + "lane1": "0x0000005f", + "lane2": "0x0000005f", + "lane3": "0x0000005f", + "lane4": "0x0000005f", + "lane5": "0x0000005f", + "lane6": "0x0000005f", + "lane7": "0x0000005f" + }, + "regn_bfm1p": { + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "regn_bfm1n": { + "lane0": "0x000000aa", + "lane1": "0x000000aa", + "lane2": "0x000000aa", + "lane3": "0x000000aa", + "lane4": "0x000000aa", + "lane5": "0x000000aa", + "lane6": "0x000000aa", + "lane7": "0x000000aa" + } + } + } + } + } +} \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/optics_si_settings.json b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/optics_si_settings.json index bf71e818a869..41227c2179b6 100644 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/optics_si_settings.json +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/optics_si_settings.json @@ -1,108 +1,108 @@ -{ - "GLOBAL_MEDIA_SETTINGS": { - "1-32": { - "50G_SPEED": { - "Default": { - "OutputAmplitudeTargetRx": { - "OutputAmplitudeTargetRx1": 0, - "OutputAmplitudeTargetRx2": 0, - "OutputAmplitudeTargetRx3": 0, - "OutputAmplitudeTargetRx4": 0, - "OutputAmplitudeTargetRx5": 0, - "OutputAmplitudeTargetRx6": 0, - "OutputAmplitudeTargetRx7": 0, - "OutputAmplitudeTargetRx8": 0 - }, - "OutputEqPreCursorTargetRx": { - "OutputEqPreCursorTargetRx1": 0, - "OutputEqPreCursorTargetRx2": 0, - "OutputEqPreCursorTargetRx3": 0, - "OutputEqPreCursorTargetRx4": 0, - "OutputEqPreCursorTargetRx5": 0, - "OutputEqPreCursorTargetRx6": 0, - "OutputEqPreCursorTargetRx7": 0, - "OutputEqPreCursorTargetRx8": 0 - }, - "OutputEqPostCursorTargetRx": { - "OutputEqPostCursorTargetRx1": 0, - "OutputEqPostCursorTargetRx2": 0, - "OutputEqPostCursorTargetRx3": 0, - "OutputEqPostCursorTargetRx4": 0, - "OutputEqPostCursorTargetRx5": 0, - "OutputEqPostCursorTargetRx6": 0, - "OutputEqPostCursorTargetRx7": 0, - "OutputEqPostCursorTargetRx8": 0 - } - } - }, - "25G_SPEED": { - "Default": { - "OutputAmplitudeTargetRx": { - "OutputAmplitudeTargetRx1": 0, - "OutputAmplitudeTargetRx2": 0, - "OutputAmplitudeTargetRx3": 0, - "OutputAmplitudeTargetRx4": 0, - "OutputAmplitudeTargetRx5": 0, - "OutputAmplitudeTargetRx6": 0, - "OutputAmplitudeTargetRx7": 0, - "OutputAmplitudeTargetRx8": 0 - }, - "OutputEqPreCursorTargetRx": { - "OutputEqPreCursorTargetRx1": 0, - "OutputEqPreCursorTargetRx2": 0, - "OutputEqPreCursorTargetRx3": 0, - "OutputEqPreCursorTargetRx4": 0, - "OutputEqPreCursorTargetRx5": 0, - "OutputEqPreCursorTargetRx6": 0, - "OutputEqPreCursorTargetRx7": 0, - "OutputEqPreCursorTargetRx8": 0 - }, - "OutputEqPostCursorTargetRx": { - "OutputEqPostCursorTargetRx1": 0, - "OutputEqPostCursorTargetRx2": 0, - "OutputEqPostCursorTargetRx3": 0, - "OutputEqPostCursorTargetRx4": 0, - "OutputEqPostCursorTargetRx5": 0, - "OutputEqPostCursorTargetRx6": 0, - "OutputEqPostCursorTargetRx7": 0, - "OutputEqPostCursorTargetRx8": 0 - } - } - }, - "10G_SPEED": { - "Default": { - "OutputAmplitudeTargetRx": { - "OutputAmplitudeTargetRx1": 0, - "OutputAmplitudeTargetRx2": 0, - "OutputAmplitudeTargetRx3": 0, - "OutputAmplitudeTargetRx4": 0, - "OutputAmplitudeTargetRx5": 0, - "OutputAmplitudeTargetRx6": 0, - "OutputAmplitudeTargetRx7": 0, - "OutputAmplitudeTargetRx8": 0 - }, - "OutputEqPreCursorTargetRx": { - "OutputEqPreCursorTargetRx1": 0, - "OutputEqPreCursorTargetRx2": 0, - "OutputEqPreCursorTargetRx3": 0, - "OutputEqPreCursorTargetRx4": 0, - "OutputEqPreCursorTargetRx5": 0, - "OutputEqPreCursorTargetRx6": 0, - "OutputEqPreCursorTargetRx7": 0, - "OutputEqPreCursorTargetRx8": 0 - }, - "OutputEqPostCursorTargetRx": { - "OutputEqPostCursorTargetRx1": 0, - "OutputEqPostCursorTargetRx2": 0, - "OutputEqPostCursorTargetRx3": 0, - "OutputEqPostCursorTargetRx4": 0, - "OutputEqPostCursorTargetRx5": 0, - "OutputEqPostCursorTargetRx6": 0, - "OutputEqPostCursorTargetRx7": 0, - "OutputEqPostCursorTargetRx8": 0 - } - } - } - } - } -} +{ + "GLOBAL_MEDIA_SETTINGS": { + "1-32": { + "50G_SPEED": { + "Default": { + "OutputAmplitudeTargetRx": { + "OutputAmplitudeTargetRx1": 0, + "OutputAmplitudeTargetRx2": 0, + "OutputAmplitudeTargetRx3": 0, + "OutputAmplitudeTargetRx4": 0, + "OutputAmplitudeTargetRx5": 0, + "OutputAmplitudeTargetRx6": 0, + "OutputAmplitudeTargetRx7": 0, + "OutputAmplitudeTargetRx8": 0 + }, + "OutputEqPreCursorTargetRx": { + "OutputEqPreCursorTargetRx1": 0, + "OutputEqPreCursorTargetRx2": 0, + "OutputEqPreCursorTargetRx3": 0, + "OutputEqPreCursorTargetRx4": 0, + "OutputEqPreCursorTargetRx5": 0, + "OutputEqPreCursorTargetRx6": 0, + "OutputEqPreCursorTargetRx7": 0, + "OutputEqPreCursorTargetRx8": 0 + }, + "OutputEqPostCursorTargetRx": { + "OutputEqPostCursorTargetRx1": 0, + "OutputEqPostCursorTargetRx2": 0, + "OutputEqPostCursorTargetRx3": 0, + "OutputEqPostCursorTargetRx4": 0, + "OutputEqPostCursorTargetRx5": 0, + "OutputEqPostCursorTargetRx6": 0, + "OutputEqPostCursorTargetRx7": 0, + "OutputEqPostCursorTargetRx8": 0 + } + } + }, + "25G_SPEED": { + "Default": { + "OutputAmplitudeTargetRx": { + "OutputAmplitudeTargetRx1": 0, + "OutputAmplitudeTargetRx2": 0, + "OutputAmplitudeTargetRx3": 0, + "OutputAmplitudeTargetRx4": 0, + "OutputAmplitudeTargetRx5": 0, + "OutputAmplitudeTargetRx6": 0, + "OutputAmplitudeTargetRx7": 0, + "OutputAmplitudeTargetRx8": 0 + }, + "OutputEqPreCursorTargetRx": { + "OutputEqPreCursorTargetRx1": 0, + "OutputEqPreCursorTargetRx2": 0, + "OutputEqPreCursorTargetRx3": 0, + "OutputEqPreCursorTargetRx4": 0, + "OutputEqPreCursorTargetRx5": 0, + "OutputEqPreCursorTargetRx6": 0, + "OutputEqPreCursorTargetRx7": 0, + "OutputEqPreCursorTargetRx8": 0 + }, + "OutputEqPostCursorTargetRx": { + "OutputEqPostCursorTargetRx1": 0, + "OutputEqPostCursorTargetRx2": 0, + "OutputEqPostCursorTargetRx3": 0, + "OutputEqPostCursorTargetRx4": 0, + "OutputEqPostCursorTargetRx5": 0, + "OutputEqPostCursorTargetRx6": 0, + "OutputEqPostCursorTargetRx7": 0, + "OutputEqPostCursorTargetRx8": 0 + } + } + }, + "10G_SPEED": { + "Default": { + "OutputAmplitudeTargetRx": { + "OutputAmplitudeTargetRx1": 0, + "OutputAmplitudeTargetRx2": 0, + "OutputAmplitudeTargetRx3": 0, + "OutputAmplitudeTargetRx4": 0, + "OutputAmplitudeTargetRx5": 0, + "OutputAmplitudeTargetRx6": 0, + "OutputAmplitudeTargetRx7": 0, + "OutputAmplitudeTargetRx8": 0 + }, + "OutputEqPreCursorTargetRx": { + "OutputEqPreCursorTargetRx1": 0, + "OutputEqPreCursorTargetRx2": 0, + "OutputEqPreCursorTargetRx3": 0, + "OutputEqPreCursorTargetRx4": 0, + "OutputEqPreCursorTargetRx5": 0, + "OutputEqPreCursorTargetRx6": 0, + "OutputEqPreCursorTargetRx7": 0, + "OutputEqPreCursorTargetRx8": 0 + }, + "OutputEqPostCursorTargetRx": { + "OutputEqPostCursorTargetRx1": 0, + "OutputEqPostCursorTargetRx2": 0, + "OutputEqPostCursorTargetRx3": 0, + "OutputEqPostCursorTargetRx4": 0, + "OutputEqPostCursorTargetRx5": 0, + "OutputEqPostCursorTargetRx6": 0, + "OutputEqPostCursorTargetRx7": 0, + "OutputEqPostCursorTargetRx8": 0 + } + } + } + } + } +} From 6e3d1662ee692e894cf7aa38ab7020c43f9aebe2 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Fri, 14 Jun 2024 15:37:45 +0300 Subject: [PATCH 379/419] [202311_RC.69] update submodule(s): sonic-utilities --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index 0b6df5fc9d72..8cc33aae0e5e 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 0b6df5fc9d72ffc980a8fb87624e961f25be0846 +Subproject commit 8cc33aae0e5e363b67c7ae8b2261e5b58622a4f9 From 277c738e086078ce7add4660db8a53eee6037c71 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Mon, 22 Apr 2024 11:50:18 +0300 Subject: [PATCH 380/419] [202311_RC.69] Enable CMIS cable host mgmt on SKU ACS-5600 --- .../ACS-SN5600/media_settings.json | 194 ++++++++++++++++++ .../ACS-SN5600/optics_si_settings.json | 142 +++++++++++++ .../ACS-SN5600/pmon_daemon_control.json | 7 + .../ACS-SN5600/sai.profile | 2 + 4 files changed, 345 insertions(+) create mode 100644 device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/media_settings.json create mode 100644 device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/optics_si_settings.json create mode 100644 device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/pmon_daemon_control.json diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/media_settings.json b/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/media_settings.json new file mode 100644 index 000000000000..67bda1a84390 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/media_settings.json @@ -0,0 +1,194 @@ +{ + "GLOBAL_MEDIA_SETTINGS": { + "0-63": { + "OSFP-8X-sm_media_interface": { + "speed:400GAUI-4-L": { + "pre3": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2": { + "lane0": "0x00000005", + "lane1": "0x00000005", + "lane2": "0x00000005", + "lane3": "0x00000005", + "lane4": "0x00000005", + "lane5": "0x00000005", + "lane6": "0x00000005", + "lane7": "0x00000005" + }, + "pre1": { + "lane0": "0xfffffff1", + "lane1": "0xfffffff1", + "lane2": "0xfffffff1", + "lane3": "0xfffffff1", + "lane4": "0xfffffff1", + "lane5": "0xfffffff1", + "lane6": "0xfffffff1", + "lane7": "0xfffffff1" + }, + "main": { + "lane0": "0x0000002b", + "lane1": "0x0000002b", + "lane2": "0x0000002b", + "lane3": "0x0000002b", + "lane4": "0x0000002b", + "lane5": "0x0000002b", + "lane6": "0x0000002b", + "lane7": "0x0000002b" + }, + "post1": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "idriver": { + "lane0": "0x00000032", + "lane1": "0x00000032", + "lane2": "0x00000032", + "lane3": "0x00000032", + "lane4": "0x00000032", + "lane5": "0x00000032", + "lane6": "0x00000032", + "lane7": "0x00000032" + } + }, + "speed:400GAUI-4-S": { + "pre3": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2": { + "lane0": "0x00000005", + "lane1": "0x00000005", + "lane2": "0x00000005", + "lane3": "0x00000005", + "lane4": "0x00000005", + "lane5": "0x00000005", + "lane6": "0x00000005", + "lane7": "0x00000005" + }, + "pre1": { + "lane0": "0xfffffff1", + "lane1": "0xfffffff1", + "lane2": "0xfffffff1", + "lane3": "0xfffffff1", + "lane4": "0xfffffff1", + "lane5": "0xfffffff1", + "lane6": "0xfffffff1", + "lane7": "0xfffffff1" + }, + "main": { + "lane0": "0x0000002b", + "lane1": "0x0000002b", + "lane2": "0x0000002b", + "lane3": "0x0000002b", + "lane4": "0x0000002b", + "lane5": "0x0000002b", + "lane6": "0x0000002b", + "lane7": "0x0000002b" + }, + "post1": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "idriver": { + "lane0": "0x00000032", + "lane1": "0x00000032", + "lane2": "0x00000032", + "lane3": "0x00000032", + "lane4": "0x00000032", + "lane5": "0x00000032", + "lane6": "0x00000032", + "lane7": "0x00000032" + } + }, + "speed:800G": { + "pre3": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2": { + "lane0": "0x00000005", + "lane1": "0x00000005", + "lane2": "0x00000005", + "lane3": "0x00000005", + "lane4": "0x00000005", + "lane5": "0x00000005", + "lane6": "0x00000005", + "lane7": "0x00000005" + }, + "pre1": { + "lane0": "0xfffffff1", + "lane1": "0xfffffff1", + "lane2": "0xfffffff1", + "lane3": "0xfffffff1", + "lane4": "0xfffffff1", + "lane5": "0xfffffff1", + "lane6": "0xfffffff1", + "lane7": "0xfffffff1" + }, + "main": { + "lane0": "0x0000002b", + "lane1": "0x0000002b", + "lane2": "0x0000002b", + "lane3": "0x0000002b", + "lane4": "0x0000002b", + "lane5": "0x0000002b", + "lane6": "0x0000002b", + "lane7": "0x0000002b" + }, + "post1": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "idriver": { + "lane0": "0x00000032", + "lane1": "0x00000032", + "lane2": "0x00000032", + "lane3": "0x00000032", + "lane4": "0x00000032", + "lane5": "0x00000032", + "lane6": "0x00000032", + "lane7": "0x00000032" + } + } + } + } + } +} diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/optics_si_settings.json b/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/optics_si_settings.json new file mode 100644 index 000000000000..75af8ef13f67 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/optics_si_settings.json @@ -0,0 +1,142 @@ +{ + "GLOBAL_MEDIA_SETTINGS": { + "1-64": { + "100G_SPEED": { + "Default": { + "OutputAmplitudeTargetRx": { + "OutputAmplitudeTargetRx1": 1, + "OutputAmplitudeTargetRx2": 1, + "OutputAmplitudeTargetRx3": 1, + "OutputAmplitudeTargetRx4": 1, + "OutputAmplitudeTargetRx5": 1, + "OutputAmplitudeTargetRx6": 1, + "OutputAmplitudeTargetRx7": 1, + "OutputAmplitudeTargetRx8": 1 + }, + "OutputEqPreCursorTargetRx": { + "OutputEqPreCursorTargetRx1": 0, + "OutputEqPreCursorTargetRx2": 0, + "OutputEqPreCursorTargetRx3": 0, + "OutputEqPreCursorTargetRx4": 0, + "OutputEqPreCursorTargetRx5": 0, + "OutputEqPreCursorTargetRx6": 0, + "OutputEqPreCursorTargetRx7": 0, + "OutputEqPreCursorTargetRx8": 0 + }, + "OutputEqPostCursorTargetRx": { + "OutputEqPostCursorTargetRx1": 0, + "OutputEqPostCursorTargetRx2": 0, + "OutputEqPostCursorTargetRx3": 0, + "OutputEqPostCursorTargetRx4": 0, + "OutputEqPostCursorTargetRx5": 0, + "OutputEqPostCursorTargetRx6": 0, + "OutputEqPostCursorTargetRx7": 0, + "OutputEqPostCursorTargetRx8": 0 + } + } + }, + "50G_SPEED": { + "Default": { + "OutputAmplitudeTargetRx": { + "OutputAmplitudeTargetRx1": 1, + "OutputAmplitudeTargetRx2": 1, + "OutputAmplitudeTargetRx3": 1, + "OutputAmplitudeTargetRx4": 1, + "OutputAmplitudeTargetRx5": 1, + "OutputAmplitudeTargetRx6": 1, + "OutputAmplitudeTargetRx7": 1, + "OutputAmplitudeTargetRx8": 1 + }, + "OutputEqPreCursorTargetRx": { + "OutputEqPreCursorTargetRx1": 0, + "OutputEqPreCursorTargetRx2": 0, + "OutputEqPreCursorTargetRx3": 0, + "OutputEqPreCursorTargetRx4": 0, + "OutputEqPreCursorTargetRx5": 0, + "OutputEqPreCursorTargetRx6": 0, + "OutputEqPreCursorTargetRx7": 0, + "OutputEqPreCursorTargetRx8": 0 + }, + "OutputEqPostCursorTargetRx": { + "OutputEqPostCursorTargetRx1": 0, + "OutputEqPostCursorTargetRx2": 0, + "OutputEqPostCursorTargetRx3": 0, + "OutputEqPostCursorTargetRx4": 0, + "OutputEqPostCursorTargetRx5": 0, + "OutputEqPostCursorTargetRx6": 0, + "OutputEqPostCursorTargetRx7": 0, + "OutputEqPostCursorTargetRx8": 0 + } + } + }, + "25G_SPEED": { + "Default": { + "OutputAmplitudeTargetRx": { + "OutputAmplitudeTargetRx1": 0, + "OutputAmplitudeTargetRx2": 0, + "OutputAmplitudeTargetRx3": 0, + "OutputAmplitudeTargetRx4": 0, + "OutputAmplitudeTargetRx5": 0, + "OutputAmplitudeTargetRx6": 0, + "OutputAmplitudeTargetRx7": 0, + "OutputAmplitudeTargetRx8": 0 + }, + "OutputEqPreCursorTargetRx": { + "OutputEqPreCursorTargetRx1": 0, + "OutputEqPreCursorTargetRx2": 0, + "OutputEqPreCursorTargetRx3": 0, + "OutputEqPreCursorTargetRx4": 0, + "OutputEqPreCursorTargetRx5": 0, + "OutputEqPreCursorTargetRx6": 0, + "OutputEqPreCursorTargetRx7": 0, + "OutputEqPreCursorTargetRx8": 0 + }, + "OutputEqPostCursorTargetRx": { + "OutputEqPostCursorTargetRx1": 0, + "OutputEqPostCursorTargetRx2": 0, + "OutputEqPostCursorTargetRx3": 0, + "OutputEqPostCursorTargetRx4": 0, + "OutputEqPostCursorTargetRx5": 0, + "OutputEqPostCursorTargetRx6": 0, + "OutputEqPostCursorTargetRx7": 0, + "OutputEqPostCursorTargetRx8": 0 + } + } + }, + "10G_SPEED": { + "Default": { + "OutputAmplitudeTargetRx": { + "OutputAmplitudeTargetRx1": 0, + "OutputAmplitudeTargetRx2": 0, + "OutputAmplitudeTargetRx3": 0, + "OutputAmplitudeTargetRx4": 0, + "OutputAmplitudeTargetRx5": 0, + "OutputAmplitudeTargetRx6": 0, + "OutputAmplitudeTargetRx7": 0, + "OutputAmplitudeTargetRx8": 0 + }, + "OutputEqPreCursorTargetRx": { + "OutputEqPreCursorTargetRx1": 0, + "OutputEqPreCursorTargetRx2": 0, + "OutputEqPreCursorTargetRx3": 0, + "OutputEqPreCursorTargetRx4": 0, + "OutputEqPreCursorTargetRx5": 0, + "OutputEqPreCursorTargetRx6": 0, + "OutputEqPreCursorTargetRx7": 0, + "OutputEqPreCursorTargetRx8": 0 + }, + "OutputEqPostCursorTargetRx": { + "OutputEqPostCursorTargetRx1": 0, + "OutputEqPostCursorTargetRx2": 0, + "OutputEqPostCursorTargetRx3": 0, + "OutputEqPostCursorTargetRx4": 0, + "OutputEqPostCursorTargetRx5": 0, + "OutputEqPostCursorTargetRx6": 0, + "OutputEqPostCursorTargetRx7": 0, + "OutputEqPostCursorTargetRx8": 0 + } + } + } + } + } +} diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/pmon_daemon_control.json b/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/pmon_daemon_control.json new file mode 100644 index 000000000000..5aadf8f081f5 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/pmon_daemon_control.json @@ -0,0 +1,7 @@ +{ + "skip_ledd": true, + "skip_fancontrol": true, + "delay_xcvrd": false, + "skip_xcvrd_cmis_mgr": false +} + diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/sai.profile b/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/sai.profile index ace2d70a85e6..8f9da30f83e0 100644 --- a/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/sai.profile +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/sai.profile @@ -1 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_5600.xml +SAI_INDEPENDENT_MODULE_MODE=1 + From 8fa8e7d32cae2976c359e2f88ff1e02505461878 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Sat, 15 Jun 2024 08:26:02 +0300 Subject: [PATCH 381/419] Revert "[202311_RC.69] Enable CMIS cable host mgmt on SKU ACS-5600" This reverts commit 277c738e086078ce7add4660db8a53eee6037c71. --- .../ACS-SN5600/media_settings.json | 194 ------------------ .../ACS-SN5600/optics_si_settings.json | 142 ------------- .../ACS-SN5600/pmon_daemon_control.json | 7 - .../ACS-SN5600/sai.profile | 2 - 4 files changed, 345 deletions(-) delete mode 100644 device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/media_settings.json delete mode 100644 device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/optics_si_settings.json delete mode 100644 device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/pmon_daemon_control.json diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/media_settings.json b/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/media_settings.json deleted file mode 100644 index 67bda1a84390..000000000000 --- a/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/media_settings.json +++ /dev/null @@ -1,194 +0,0 @@ -{ - "GLOBAL_MEDIA_SETTINGS": { - "0-63": { - "OSFP-8X-sm_media_interface": { - "speed:400GAUI-4-L": { - "pre3": { - "lane0": "0x00000000", - "lane1": "0x00000000", - "lane2": "0x00000000", - "lane3": "0x00000000", - "lane4": "0x00000000", - "lane5": "0x00000000", - "lane6": "0x00000000", - "lane7": "0x00000000" - }, - "pre2": { - "lane0": "0x00000005", - "lane1": "0x00000005", - "lane2": "0x00000005", - "lane3": "0x00000005", - "lane4": "0x00000005", - "lane5": "0x00000005", - "lane6": "0x00000005", - "lane7": "0x00000005" - }, - "pre1": { - "lane0": "0xfffffff1", - "lane1": "0xfffffff1", - "lane2": "0xfffffff1", - "lane3": "0xfffffff1", - "lane4": "0xfffffff1", - "lane5": "0xfffffff1", - "lane6": "0xfffffff1", - "lane7": "0xfffffff1" - }, - "main": { - "lane0": "0x0000002b", - "lane1": "0x0000002b", - "lane2": "0x0000002b", - "lane3": "0x0000002b", - "lane4": "0x0000002b", - "lane5": "0x0000002b", - "lane6": "0x0000002b", - "lane7": "0x0000002b" - }, - "post1": { - "lane0": "0x00000000", - "lane1": "0x00000000", - "lane2": "0x00000000", - "lane3": "0x00000000", - "lane4": "0x00000000", - "lane5": "0x00000000", - "lane6": "0x00000000", - "lane7": "0x00000000" - }, - "idriver": { - "lane0": "0x00000032", - "lane1": "0x00000032", - "lane2": "0x00000032", - "lane3": "0x00000032", - "lane4": "0x00000032", - "lane5": "0x00000032", - "lane6": "0x00000032", - "lane7": "0x00000032" - } - }, - "speed:400GAUI-4-S": { - "pre3": { - "lane0": "0x00000000", - "lane1": "0x00000000", - "lane2": "0x00000000", - "lane3": "0x00000000", - "lane4": "0x00000000", - "lane5": "0x00000000", - "lane6": "0x00000000", - "lane7": "0x00000000" - }, - "pre2": { - "lane0": "0x00000005", - "lane1": "0x00000005", - "lane2": "0x00000005", - "lane3": "0x00000005", - "lane4": "0x00000005", - "lane5": "0x00000005", - "lane6": "0x00000005", - "lane7": "0x00000005" - }, - "pre1": { - "lane0": "0xfffffff1", - "lane1": "0xfffffff1", - "lane2": "0xfffffff1", - "lane3": "0xfffffff1", - "lane4": "0xfffffff1", - "lane5": "0xfffffff1", - "lane6": "0xfffffff1", - "lane7": "0xfffffff1" - }, - "main": { - "lane0": "0x0000002b", - "lane1": "0x0000002b", - "lane2": "0x0000002b", - "lane3": "0x0000002b", - "lane4": "0x0000002b", - "lane5": "0x0000002b", - "lane6": "0x0000002b", - "lane7": "0x0000002b" - }, - "post1": { - "lane0": "0x00000000", - "lane1": "0x00000000", - "lane2": "0x00000000", - "lane3": "0x00000000", - "lane4": "0x00000000", - "lane5": "0x00000000", - "lane6": "0x00000000", - "lane7": "0x00000000" - }, - "idriver": { - "lane0": "0x00000032", - "lane1": "0x00000032", - "lane2": "0x00000032", - "lane3": "0x00000032", - "lane4": "0x00000032", - "lane5": "0x00000032", - "lane6": "0x00000032", - "lane7": "0x00000032" - } - }, - "speed:800G": { - "pre3": { - "lane0": "0x00000000", - "lane1": "0x00000000", - "lane2": "0x00000000", - "lane3": "0x00000000", - "lane4": "0x00000000", - "lane5": "0x00000000", - "lane6": "0x00000000", - "lane7": "0x00000000" - }, - "pre2": { - "lane0": "0x00000005", - "lane1": "0x00000005", - "lane2": "0x00000005", - "lane3": "0x00000005", - "lane4": "0x00000005", - "lane5": "0x00000005", - "lane6": "0x00000005", - "lane7": "0x00000005" - }, - "pre1": { - "lane0": "0xfffffff1", - "lane1": "0xfffffff1", - "lane2": "0xfffffff1", - "lane3": "0xfffffff1", - "lane4": "0xfffffff1", - "lane5": "0xfffffff1", - "lane6": "0xfffffff1", - "lane7": "0xfffffff1" - }, - "main": { - "lane0": "0x0000002b", - "lane1": "0x0000002b", - "lane2": "0x0000002b", - "lane3": "0x0000002b", - "lane4": "0x0000002b", - "lane5": "0x0000002b", - "lane6": "0x0000002b", - "lane7": "0x0000002b" - }, - "post1": { - "lane0": "0x00000000", - "lane1": "0x00000000", - "lane2": "0x00000000", - "lane3": "0x00000000", - "lane4": "0x00000000", - "lane5": "0x00000000", - "lane6": "0x00000000", - "lane7": "0x00000000" - }, - "idriver": { - "lane0": "0x00000032", - "lane1": "0x00000032", - "lane2": "0x00000032", - "lane3": "0x00000032", - "lane4": "0x00000032", - "lane5": "0x00000032", - "lane6": "0x00000032", - "lane7": "0x00000032" - } - } - } - } - } -} diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/optics_si_settings.json b/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/optics_si_settings.json deleted file mode 100644 index 75af8ef13f67..000000000000 --- a/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/optics_si_settings.json +++ /dev/null @@ -1,142 +0,0 @@ -{ - "GLOBAL_MEDIA_SETTINGS": { - "1-64": { - "100G_SPEED": { - "Default": { - "OutputAmplitudeTargetRx": { - "OutputAmplitudeTargetRx1": 1, - "OutputAmplitudeTargetRx2": 1, - "OutputAmplitudeTargetRx3": 1, - "OutputAmplitudeTargetRx4": 1, - "OutputAmplitudeTargetRx5": 1, - "OutputAmplitudeTargetRx6": 1, - "OutputAmplitudeTargetRx7": 1, - "OutputAmplitudeTargetRx8": 1 - }, - "OutputEqPreCursorTargetRx": { - "OutputEqPreCursorTargetRx1": 0, - "OutputEqPreCursorTargetRx2": 0, - "OutputEqPreCursorTargetRx3": 0, - "OutputEqPreCursorTargetRx4": 0, - "OutputEqPreCursorTargetRx5": 0, - "OutputEqPreCursorTargetRx6": 0, - "OutputEqPreCursorTargetRx7": 0, - "OutputEqPreCursorTargetRx8": 0 - }, - "OutputEqPostCursorTargetRx": { - "OutputEqPostCursorTargetRx1": 0, - "OutputEqPostCursorTargetRx2": 0, - "OutputEqPostCursorTargetRx3": 0, - "OutputEqPostCursorTargetRx4": 0, - "OutputEqPostCursorTargetRx5": 0, - "OutputEqPostCursorTargetRx6": 0, - "OutputEqPostCursorTargetRx7": 0, - "OutputEqPostCursorTargetRx8": 0 - } - } - }, - "50G_SPEED": { - "Default": { - "OutputAmplitudeTargetRx": { - "OutputAmplitudeTargetRx1": 1, - "OutputAmplitudeTargetRx2": 1, - "OutputAmplitudeTargetRx3": 1, - "OutputAmplitudeTargetRx4": 1, - "OutputAmplitudeTargetRx5": 1, - "OutputAmplitudeTargetRx6": 1, - "OutputAmplitudeTargetRx7": 1, - "OutputAmplitudeTargetRx8": 1 - }, - "OutputEqPreCursorTargetRx": { - "OutputEqPreCursorTargetRx1": 0, - "OutputEqPreCursorTargetRx2": 0, - "OutputEqPreCursorTargetRx3": 0, - "OutputEqPreCursorTargetRx4": 0, - "OutputEqPreCursorTargetRx5": 0, - "OutputEqPreCursorTargetRx6": 0, - "OutputEqPreCursorTargetRx7": 0, - "OutputEqPreCursorTargetRx8": 0 - }, - "OutputEqPostCursorTargetRx": { - "OutputEqPostCursorTargetRx1": 0, - "OutputEqPostCursorTargetRx2": 0, - "OutputEqPostCursorTargetRx3": 0, - "OutputEqPostCursorTargetRx4": 0, - "OutputEqPostCursorTargetRx5": 0, - "OutputEqPostCursorTargetRx6": 0, - "OutputEqPostCursorTargetRx7": 0, - "OutputEqPostCursorTargetRx8": 0 - } - } - }, - "25G_SPEED": { - "Default": { - "OutputAmplitudeTargetRx": { - "OutputAmplitudeTargetRx1": 0, - "OutputAmplitudeTargetRx2": 0, - "OutputAmplitudeTargetRx3": 0, - "OutputAmplitudeTargetRx4": 0, - "OutputAmplitudeTargetRx5": 0, - "OutputAmplitudeTargetRx6": 0, - "OutputAmplitudeTargetRx7": 0, - "OutputAmplitudeTargetRx8": 0 - }, - "OutputEqPreCursorTargetRx": { - "OutputEqPreCursorTargetRx1": 0, - "OutputEqPreCursorTargetRx2": 0, - "OutputEqPreCursorTargetRx3": 0, - "OutputEqPreCursorTargetRx4": 0, - "OutputEqPreCursorTargetRx5": 0, - "OutputEqPreCursorTargetRx6": 0, - "OutputEqPreCursorTargetRx7": 0, - "OutputEqPreCursorTargetRx8": 0 - }, - "OutputEqPostCursorTargetRx": { - "OutputEqPostCursorTargetRx1": 0, - "OutputEqPostCursorTargetRx2": 0, - "OutputEqPostCursorTargetRx3": 0, - "OutputEqPostCursorTargetRx4": 0, - "OutputEqPostCursorTargetRx5": 0, - "OutputEqPostCursorTargetRx6": 0, - "OutputEqPostCursorTargetRx7": 0, - "OutputEqPostCursorTargetRx8": 0 - } - } - }, - "10G_SPEED": { - "Default": { - "OutputAmplitudeTargetRx": { - "OutputAmplitudeTargetRx1": 0, - "OutputAmplitudeTargetRx2": 0, - "OutputAmplitudeTargetRx3": 0, - "OutputAmplitudeTargetRx4": 0, - "OutputAmplitudeTargetRx5": 0, - "OutputAmplitudeTargetRx6": 0, - "OutputAmplitudeTargetRx7": 0, - "OutputAmplitudeTargetRx8": 0 - }, - "OutputEqPreCursorTargetRx": { - "OutputEqPreCursorTargetRx1": 0, - "OutputEqPreCursorTargetRx2": 0, - "OutputEqPreCursorTargetRx3": 0, - "OutputEqPreCursorTargetRx4": 0, - "OutputEqPreCursorTargetRx5": 0, - "OutputEqPreCursorTargetRx6": 0, - "OutputEqPreCursorTargetRx7": 0, - "OutputEqPreCursorTargetRx8": 0 - }, - "OutputEqPostCursorTargetRx": { - "OutputEqPostCursorTargetRx1": 0, - "OutputEqPostCursorTargetRx2": 0, - "OutputEqPostCursorTargetRx3": 0, - "OutputEqPostCursorTargetRx4": 0, - "OutputEqPostCursorTargetRx5": 0, - "OutputEqPostCursorTargetRx6": 0, - "OutputEqPostCursorTargetRx7": 0, - "OutputEqPostCursorTargetRx8": 0 - } - } - } - } - } -} diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/pmon_daemon_control.json b/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/pmon_daemon_control.json deleted file mode 100644 index 5aadf8f081f5..000000000000 --- a/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/pmon_daemon_control.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "skip_ledd": true, - "skip_fancontrol": true, - "delay_xcvrd": false, - "skip_xcvrd_cmis_mgr": false -} - diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/sai.profile b/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/sai.profile index 8f9da30f83e0..ace2d70a85e6 100644 --- a/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/sai.profile +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/sai.profile @@ -1,3 +1 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_5600.xml -SAI_INDEPENDENT_MODULE_MODE=1 - From ecd51a672f15a6aa4c3801439cd21d71d9c7696d Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Wed, 19 Jun 2024 10:01:09 +0300 Subject: [PATCH 382/419] [202311_RC][Mellanox] Enable get_tx_fault support in CMIS cable host mgmt mode --- platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index b9c930354730..cd49dedc3398 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -1055,6 +1055,11 @@ def get_tx_fault(self): list: [False] * channels """ api = self.get_xcvr_api() + try: + if self.is_sw_control(): + return api.get_tx_fault() if api else None + except Exception as e: + print(e) return [False] * api.NUM_CHANNELS if api else None def get_temperature(self): @@ -1155,7 +1160,6 @@ def get_xcvr_api(self): self.refresh_xcvr_api() if self._xcvr_api is not None: self._xcvr_api.get_rx_los = self.get_rx_los - self._xcvr_api.get_tx_fault = self.get_tx_fault return self._xcvr_api def is_sw_control(self): From e44d16b2b601414e009acdf314f56a673ac77b64 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Wed, 19 Jun 2024 10:02:26 +0300 Subject: [PATCH 383/419] [202311_RC] update submodule(s): sonic-linux-kernel --- 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 55e845d60bd6..a0472a791e18 160000 --- a/src/sonic-linux-kernel +++ b/src/sonic-linux-kernel @@ -1 +1 @@ -Subproject commit 55e845d60bd62f55316e0de956df5c2589e00853 +Subproject commit a0472a791e18764b22303a83ca5c45bdb1591f60 From d956a356d7b4c53e3bc65dc206dec5ce1e913bd0 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Wed, 19 Jun 2024 10:20:00 +0300 Subject: [PATCH 384/419] Revert "[202311_RC] update submodule(s): sonic-linux-kernel" This reverts commit e44d16b2b601414e009acdf314f56a673ac77b64. --- 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 a0472a791e18..55e845d60bd6 160000 --- a/src/sonic-linux-kernel +++ b/src/sonic-linux-kernel @@ -1 +1 @@ -Subproject commit a0472a791e18764b22303a83ca5c45bdb1591f60 +Subproject commit 55e845d60bd62f55316e0de956df5c2589e00853 From 5240734c65ce52c004fbbd2d6091df9cfd735c48 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Wed, 19 Jun 2024 10:21:05 +0300 Subject: [PATCH 385/419] [202311_RC] update submodule(s): sonic-platform-daemons --- 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 8822f3ec6294..e49144b83a6b 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit 8822f3ec62947f1b565b831974d3895cbfe745b9 +Subproject commit e49144b83a6b02752e2133aa358264316d7ed0e7 From 37bf97a6ecb1c109a2348b531f07c79ed104b04b Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Wed, 19 Jun 2024 12:48:52 +0300 Subject: [PATCH 386/419] Revert "[202311_RC.69] Add W/A to not fail when hw_reset to SFP module" This reverts commit a5af189350c2e9c3f4859924df4cc924e8b0f4d6. --- platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index cd49dedc3398..cff6ac1571ba 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -1447,14 +1447,6 @@ def get_state_machine(cls): @classmethod def action_on_start(cls, sfp): - - # a W/A to avoid setting hw_reset for service ports from type SFP. - # this W/A is relevant only for moose and hippo systems, and we will have it until FW will provide their fix. - if sfp.sdk_index >= 64: - logger.log_info(f'SFP {sfp.sdk_index} should be automatically FW control. Setting it as FW control as a W/A') - sfp.on_event(EVENT_FW_CONTROL) - return - if sfp.get_control_type() == SFP_FW_CONTROL: logger.log_info(f'SFP {sfp.sdk_index} is already FW control, probably in warm reboot') sfp.on_event(EVENT_FW_CONTROL) From 6426c6b8641b12ee89bac2c6f9d6d015ab742c82 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Thu, 20 Jun 2024 03:28:16 +0300 Subject: [PATCH 387/419] [202311_RC]INTERNAL: Add traceback logs in sfp.py for troubleshooting EEPROM read issues --- .../mlnx-platform-api/sonic_platform/sfp.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index cff6ac1571ba..c10dc7b5b4c7 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -541,6 +541,19 @@ def _read_eeprom(self, offset, num_bytes, log_on_error=True): if log_on_error: logger.log_warning(f'Failed to read sfp={self.sdk_index} EEPROM page={page}, page_offset={page_offset}, '\ f'size={num_bytes}, offset={offset}, error = {e}') + + logger.log_error(f"--- tomer --- {self.sdk_index}: Entered monitored if statement") + logger.log_error(f"--- tomer --- {self.sdk_index}: Stack trace leading to this call:") + stack = traceback.extract_stack() + for frame in stack: + logger.log_error(f"--- tomer --- {self.sdk_index}: File: {frame.filename}") + logger.log_error(f"--- tomer --- {self.sdk_index}: Line number: {frame.lineno}") + logger.log_error(f"--- tomer --- {self.sdk_index}: Function name: {frame.name}") + logger.log_error(f"--- tomer --- {self.sdk_index}: Line of code: {frame.line}") + logger.log_error('-' * 40) + logger.log_error('-' * 40) + logger.log_error('-' * 40) + return None return bytearray(result) From e32f6a406701e6771c21b543e706b58293835598 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Thu, 20 Jun 2024 06:15:23 +0300 Subject: [PATCH 388/419] Revert "[202311_RC]INTERNAL: Add traceback logs in sfp.py for troubleshooting EEPROM read issues" This reverts commit 6426c6b8641b12ee89bac2c6f9d6d015ab742c82. --- .../mlnx-platform-api/sonic_platform/sfp.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index c10dc7b5b4c7..cff6ac1571ba 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -541,19 +541,6 @@ def _read_eeprom(self, offset, num_bytes, log_on_error=True): if log_on_error: logger.log_warning(f'Failed to read sfp={self.sdk_index} EEPROM page={page}, page_offset={page_offset}, '\ f'size={num_bytes}, offset={offset}, error = {e}') - - logger.log_error(f"--- tomer --- {self.sdk_index}: Entered monitored if statement") - logger.log_error(f"--- tomer --- {self.sdk_index}: Stack trace leading to this call:") - stack = traceback.extract_stack() - for frame in stack: - logger.log_error(f"--- tomer --- {self.sdk_index}: File: {frame.filename}") - logger.log_error(f"--- tomer --- {self.sdk_index}: Line number: {frame.lineno}") - logger.log_error(f"--- tomer --- {self.sdk_index}: Function name: {frame.name}") - logger.log_error(f"--- tomer --- {self.sdk_index}: Line of code: {frame.line}") - logger.log_error('-' * 40) - logger.log_error('-' * 40) - logger.log_error('-' * 40) - return None return bytearray(result) From 932716d657b4c996af3195a02950ee75473d76d4 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Mon, 24 Jun 2024 04:36:01 +0300 Subject: [PATCH 389/419] [202311_RC] INTERNAL: Add traceback logs in sfp.py for troubleshooting EEPROM read issues --- .../mlnx-platform-api/sonic_platform/sfp.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index cff6ac1571ba..67a2877419ce 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -29,6 +29,7 @@ import os import threading import time + import traceback from sonic_py_common.logger import Logger from sonic_py_common.general import check_output_pipe from . import utils @@ -541,6 +542,19 @@ def _read_eeprom(self, offset, num_bytes, log_on_error=True): if log_on_error: logger.log_warning(f'Failed to read sfp={self.sdk_index} EEPROM page={page}, page_offset={page_offset}, '\ f'size={num_bytes}, offset={offset}, error = {e}') + + logger.log_error(f"--- tomer --- {self.sdk_index}: Entered monitored if statement") + logger.log_error(f"--- tomer --- {self.sdk_index}: Stack trace leading to this call:") + stack = traceback.extract_stack() + for frame in stack: + logger.log_error(f"--- tomer --- {self.sdk_index}: File: {frame.filename}") + logger.log_error(f"--- tomer --- {self.sdk_index}: Line number: {frame.lineno}") + logger.log_error(f"--- tomer --- {self.sdk_index}: Function name: {frame.name}") + logger.log_error(f"--- tomer --- {self.sdk_index}: Line of code: {frame.line}") + logger.log_error('-' * 40) + logger.log_error('-' * 40) + logger.log_error('-' * 40) + return None return bytearray(result) From 86c2991dbc97cf9ec19671bf9f7ac29071b5b0ad Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Tue, 25 Jun 2024 13:27:32 +0300 Subject: [PATCH 390/419] [202311_RC] [Mellanox] Create counters only for configured buffer objects on SN5400 --- .../ACS-SN5400/create_only_config_db_buffers.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/create_only_config_db_buffers.json diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/create_only_config_db_buffers.json b/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/create_only_config_db_buffers.json new file mode 100644 index 000000000000..6feb156714fe --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/create_only_config_db_buffers.json @@ -0,0 +1,7 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "create_only_config_db_buffers": "true" + } + } +} From 7d7b380170618be68be92f9ef478597994589e89 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Tue, 25 Jun 2024 13:31:33 +0300 Subject: [PATCH 391/419] [202311_RC] update submodule(s): sonic-utilities --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index 8cc33aae0e5e..ed7f660d0e29 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 8cc33aae0e5e363b67c7ae8b2261e5b58622a4f9 +Subproject commit ed7f660d0e290010020fb7b1d42400ed1c1d058a From ccdafd165e1594bee50f70d6d2c2321f01186208 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Tue, 25 Jun 2024 13:59:54 +0300 Subject: [PATCH 392/419] [202311_RC] Align sonic-linux-kernel to a02f738 --- 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 55e845d60bd6..a02f7385dd60 160000 --- a/src/sonic-linux-kernel +++ b/src/sonic-linux-kernel @@ -1 +1 @@ -Subproject commit 55e845d60bd62f55316e0de956df5c2589e00853 +Subproject commit a02f7385dd606abf26dc2a7a325a02a7741b9673 From b3788fd26980d3fef127e4414b1dfd2e54d0eb0b Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Tue, 25 Jun 2024 14:03:24 +0300 Subject: [PATCH 393/419] [202311_RC] Align sonic-platform-daemons to community 52bcf14 --- .gitmodules | 2 +- src/sonic-platform-daemons | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index c43bdffe6efb..0f3addfd19cf 100644 --- a/.gitmodules +++ b/.gitmodules @@ -48,7 +48,7 @@ branch = 202311 [submodule "src/sonic-platform-daemons"] path = src/sonic-platform-daemons - url = https://github.com/nvidia-sonic/sonic-platform-daemons + url = https://github.com/sonic-net/sonic-platform-daemons branch = 202311 [submodule "src/sonic-platform-pde"] path = src/sonic-platform-pde diff --git a/src/sonic-platform-daemons b/src/sonic-platform-daemons index e49144b83a6b..52bcf142f67f 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit e49144b83a6b02752e2133aa358264316d7ed0e7 +Subproject commit 52bcf142f67fdaffdeb1af46fa39731fbd00f26e From c8eb66f447f8773b36e7f7cea7fb1dfd6d6a1988 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Tue, 25 Jun 2024 14:07:01 +0300 Subject: [PATCH 394/419] [202311_RC] Align sonic-swss to community cbd0d6d --- .gitmodules | 2 +- src/sonic-swss | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 0f3addfd19cf..b6d471dff58f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -12,7 +12,7 @@ branch = 202311 [submodule "sonic-swss"] path = src/sonic-swss - url = https://github.com/nvidia-sonic/sonic-swss + url = https://github.com/sonic-net/sonic-swss branch = 202311 [submodule "src/p4c-bm/p4c-bm"] path = platform/p4/p4c-bm/p4c-bm diff --git a/src/sonic-swss b/src/sonic-swss index eefb6de726a4..cbd0d6d87aba 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit eefb6de726a419973af405db34e72ffba516848a +Subproject commit cbd0d6d87abad9eb640c1b5e27929aecb46db218 From 6fa1c5b3a7178658c32a5981f9159c676c219a9f Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Thu, 27 Jun 2024 05:31:03 +0300 Subject: [PATCH 395/419] [202311_RC] Do not mount redis.sock to avoid race condition --- rules/docker-restapi.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/rules/docker-restapi.mk b/rules/docker-restapi.mk index e6dc2dcf47ea..41714de5b7bf 100644 --- a/rules/docker-restapi.mk +++ b/rules/docker-restapi.mk @@ -20,7 +20,6 @@ endif $(DOCKER_RESTAPI)_CONTAINER_NAME = restapi $(DOCKER_RESTAPI)_RUN_OPT += -t -$(DOCKER_RESTAPI)_RUN_OPT += -v /var/run/redis/redis.sock:/var/run/redis/redis.sock $(DOCKER_RESTAPI)_RUN_OPT += -v /etc/sonic/credentials:/etc/sonic/credentials:ro $(DOCKER_RESTAPI)_RUN_OPT += -p=8081:8081/tcp From accd9e04f04ec6ff34a55511627442e123098925 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Thu, 27 Jun 2024 05:32:03 +0300 Subject: [PATCH 396/419] [202311_RC][Mellanox] Use efibootmgr for supported device on fwutil --- platform/mellanox/mlnx-onie-fw-update.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/platform/mellanox/mlnx-onie-fw-update.sh b/platform/mellanox/mlnx-onie-fw-update.sh index 35fdb55dfd93..56b251a96f86 100755 --- a/platform/mellanox/mlnx-onie-fw-update.sh +++ b/platform/mellanox/mlnx-onie-fw-update.sh @@ -68,8 +68,12 @@ enable_onie_fw_update_mode() { fi register_terminate_handler - - grub-editenv ${os_boot}/grub/grubenv set onie_entry="ONIE" || return $? + if [ -d /sys/firmware/efi/efivars ]; then + onie_boot_num=$(efibootmgr | grep "ONIE:" | awk '{ print $1 }' | cut -b 5-8 ) + efibootmgr -n $onie_boot_num + else + grub-editenv ${os_boot}/grub/grubenv set onie_entry="ONIE" || return $? + fi grub-editenv ${onie_mount}/grub/grubenv set onie_mode="update" || return $? return 0 @@ -80,7 +84,12 @@ disable_onie_fw_update_mode() { return 1 fi - grub-editenv ${os_boot}/grub/grubenv unset onie_entry || return $? + if [ -d /sys/firmware/efi/efivars ]; then + sonic_boot_num=$(efibootmgr | grep "SONiC-OS" | awk '{ print $1 }' | cut -b 5-8 ) + efibootmgr -n $sonic_boot_num + else + grub-editenv ${os_boot}/grub/grubenv unset onie_entry || return $? + fi grub-editenv ${onie_mount}/grub/grubenv set onie_mode="install" || return $? return 0 @@ -106,7 +115,7 @@ system_reboot() { sleep 5s # Use SONiC reboot scenario - /usr/local/bin/reboot + /usr/local/bin/reboot -f exit $? } From 7f8fad8d70b77b75025fddd1049b026ed3093fca Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Mon, 1 Jul 2024 05:04:48 +0300 Subject: [PATCH 397/419] [202311_RC] update submodule(s}: sonic-swss --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index cbd0d6d87aba..6a347ab40a38 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit cbd0d6d87abad9eb640c1b5e27929aecb46db218 +Subproject commit 6a347ab40a3844b8326d62bca6ee0eb164f3d682 From 97b26c9b52b06837dc56626389ad23348834007f Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Mon, 1 Jul 2024 05:05:11 +0300 Subject: [PATCH 398/419] Revert "[202311_RC] Do not mount redis.sock to avoid race condition" This reverts commit 6fa1c5b3a7178658c32a5981f9159c676c219a9f. --- rules/docker-restapi.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/rules/docker-restapi.mk b/rules/docker-restapi.mk index 41714de5b7bf..e6dc2dcf47ea 100644 --- a/rules/docker-restapi.mk +++ b/rules/docker-restapi.mk @@ -20,6 +20,7 @@ endif $(DOCKER_RESTAPI)_CONTAINER_NAME = restapi $(DOCKER_RESTAPI)_RUN_OPT += -t +$(DOCKER_RESTAPI)_RUN_OPT += -v /var/run/redis/redis.sock:/var/run/redis/redis.sock $(DOCKER_RESTAPI)_RUN_OPT += -v /etc/sonic/credentials:/etc/sonic/credentials:ro $(DOCKER_RESTAPI)_RUN_OPT += -p=8081:8081/tcp From 7383b9f377b00d31586f2f352b04bbdf4a1e692c Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Tue, 2 Jul 2024 09:46:31 +0300 Subject: [PATCH 399/419] [202311_RC] update submodule(s): sonic-utilities --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index ed7f660d0e29..338a38b4a449 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit ed7f660d0e290010020fb7b1d42400ed1c1d058a +Subproject commit 338a38b4a449eeac031a65e694521a3c1e2a83da From 1476c2d593390fa2efe2b42bc97d7ef39c4b566c Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Tue, 2 Jul 2024 10:17:50 +0300 Subject: [PATCH 400/419] [202311_RC] update submodule(s): sonic-platform-daemons --- .gitmodules | 2 +- src/sonic-platform-daemons | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index b6d471dff58f..ea08ab1a5ab7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -48,7 +48,7 @@ branch = 202311 [submodule "src/sonic-platform-daemons"] path = src/sonic-platform-daemons - url = https://github.com/sonic-net/sonic-platform-daemons + url = https://github.com/nvidia-sonic/sonic-platform-daemons branch = 202311 [submodule "src/sonic-platform-pde"] path = src/sonic-platform-pde diff --git a/src/sonic-platform-daemons b/src/sonic-platform-daemons index 52bcf142f67f..acfe4c61ad2b 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit 52bcf142f67fdaffdeb1af46fa39731fbd00f26e +Subproject commit acfe4c61ad2bdb7d7d4ed02d65797cb5deafac14 From b6ff9306d752d14088fd3bda5a42219e681e8eec Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Wed, 3 Jul 2024 13:31:22 +0300 Subject: [PATCH 401/419] [202311_RC] [Mellanox] implement state machine for always firmware control ports --- .../sonic_platform/device_data.py | 19 +++++++ .../mlnx-platform-api/sonic_platform/sfp.py | 53 +++++++++++++++---- .../mlnx-platform-api/tests/test_sfp_sm.py | 13 +++++ 3 files changed, 74 insertions(+), 11 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 b9dc10370fca..fbe8e2b078de 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py @@ -126,6 +126,9 @@ "comex_amb": False, "pch_temp": True } + }, + 'sfp': { + 'fw_control_ports': [64, 65] # 0 based sfp index list } }, 'x86_64-nvidia_sn5600-r0': { @@ -134,6 +137,9 @@ "comex_amb": False, "pch_temp": True } + }, + 'sfp': { + 'fw_control_ports': [64] # 0 based sfp index list } } } @@ -299,3 +305,16 @@ def get_watchdog_max_period(cls): return DEFAULT_WD_PERIOD return watchdog_data.get('max_period', None) + + @classmethod + @utils.read_only_cache() + def get_always_fw_control_ports(cls): + platform_data = DEVICE_DATA.get(cls.get_platform_name()) + if not platform_data: + return None + + sfp_data = platform_data.get('sfp') + if not sfp_data: + return None + + return sfp_data.get('fw_control_ports') diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index 67a2877419ce..61327c5242f2 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -254,6 +254,14 @@ ACTION_ON_FW_CONTROL = 'On Firmware Control' ACTION_ON_POWER_LIMIT_ERROR = 'On Power Limit Error' ACTION_ON_CANCEL_WAIT = 'On Cancel Wait' + +# States/actions for always firmware control ports +STATE_FCP_DOWN = 'Down(Firmware Control)' +STATE_FCP_INIT = 'Initializing(Firmware Control)' +STATE_FCP_NOT_PRESENT = 'Not Present(Firmware Control)' +STATE_FCP_PRESENT = 'Present(Firmware Control)' + +ACTION_FCP_ON_START = 'On Start(Firmware Control)' # Module host management definitions end # SFP EEPROM limited bytes @@ -464,7 +472,11 @@ def __init__(self, sfp_index, sfp_type=None, slot_id=0, linecard_port_count=0, l self.slot_id = slot_id self._sfp_type_str = None # SFP state, only applicable for module host management - self.state = STATE_DOWN + fw_control_ports = DeviceDataManager.get_always_fw_control_ports() + if not fw_control_ports or self.sdk_index not in fw_control_ports: + self.state = STATE_DOWN + else: + self.state = STATE_FCP_DOWN def __str__(self): return f'SFP {self.sdk_index}' @@ -1445,7 +1457,7 @@ def get_state_machine(cls): sm.add_state(STATE_POWER_LIMIT_ERROR).set_entry_action(ACTION_ON_POWER_LIMIT_ERROR) \ .add_transition(EVENT_POWER_GOOD, STATE_POWERED_ON) \ .add_transition(EVENT_NOT_PRESENT, STATE_NOT_PRESENT) - + cls.action_table = {} cls.action_table[ACTION_ON_START] = cls.action_on_start cls.action_table[ACTION_ON_RESET] = cls.action_on_reset @@ -1455,6 +1467,16 @@ def get_state_machine(cls): cls.action_table[ACTION_ON_CANCEL_WAIT] = cls.action_on_cancel_wait cls.action_table[ACTION_ON_POWER_LIMIT_ERROR] = cls.action_on_power_limit_error + # For always firewire control ports + sm.add_state(STATE_FCP_DOWN).add_transition(EVENT_START, STATE_FCP_INIT) + sm.add_state(STATE_FCP_INIT).set_entry_action(ACTION_FCP_ON_START) \ + .add_transition(EVENT_NOT_PRESENT, STATE_FCP_NOT_PRESENT) \ + .add_transition(EVENT_PRESENT, STATE_FCP_PRESENT) + sm.add_state(STATE_FCP_NOT_PRESENT).add_transition(EVENT_PRESENT, STATE_FCP_PRESENT) + sm.add_state(STATE_FCP_PRESENT).add_transition(EVENT_NOT_PRESENT, STATE_FCP_NOT_PRESENT) + + cls.action_table[ACTION_FCP_ON_START] = cls.action_fcp_on_start + cls.sm = sm return cls.sm @@ -1483,6 +1505,14 @@ def action_on_start(cls, sfp): sfp.on_event(EVENT_RESET) else: sfp.on_event(EVENT_POWER_ON) + + @classmethod + def action_fcp_on_start(cls, sfp): + present = utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{sfp.sdk_index}/present') + if present: + sfp.on_event(EVENT_PRESENT) + else: + sfp.on_event(EVENT_NOT_PRESENT) @classmethod def action_on_reset(cls, sfp): @@ -1579,10 +1609,12 @@ def in_stable_state(self): Returns: bool: True if the module is in a stable state """ - return self.state in (STATE_NOT_PRESENT, STATE_SW_CONTROL, STATE_FW_CONTROL, STATE_POWER_BAD, STATE_POWER_LIMIT_ERROR) + return self.state in (STATE_NOT_PRESENT, STATE_SW_CONTROL, STATE_FW_CONTROL, + STATE_POWER_BAD, STATE_POWER_LIMIT_ERROR, STATE_FCP_NOT_PRESENT, + STATE_FCP_PRESENT) def get_fds_for_poling(self): - if self.state == STATE_FW_CONTROL: + if self.state == STATE_FW_CONTROL or self.state == STATE_FCP_NOT_PRESENT or self.state == STATE_FCP_PRESENT: return { 'present': self.get_fd('present') } @@ -1598,11 +1630,9 @@ def fill_change_event(self, port_dict): Args: port_dict (dict): {:} """ - if self.state == STATE_NOT_PRESENT: + if self.state == STATE_NOT_PRESENT or self.state == STATE_FCP_NOT_PRESENT: port_dict[self.sdk_index + 1] = SFP_STATUS_REMOVED - elif self.state == STATE_SW_CONTROL: - port_dict[self.sdk_index + 1] = SFP_STATUS_INSERTED - elif self.state == STATE_FW_CONTROL: + elif self.state == STATE_SW_CONTROL or self.state == STATE_FW_CONTROL or self.state == STATE_FCP_PRESENT: port_dict[self.sdk_index + 1] = SFP_STATUS_INSERTED elif self.state == STATE_POWER_BAD or self.state == STATE_POWER_LIMIT_ERROR: sfp_state = SFP.SFP_ERROR_BIT_POWER_BUDGET_EXCEEDED | SFP.SFP_STATUS_BIT_INSERTED @@ -1621,7 +1651,7 @@ def refresh_poll_obj(self, poll_obj, all_registered_fds): # find fds registered by this SFP current_registered_fds = {item[2]: (fileno, item[1]) for fileno, item in all_registered_fds.items() if item[0] == self.sdk_index} logger.log_debug(f'SFP {self.sdk_index} registered fds are: {current_registered_fds}') - if self.state == STATE_FW_CONTROL: + if self.state == STATE_FW_CONTROL or self.state == STATE_FCP_NOT_PRESENT or self.state == STATE_FCP_PRESENT: target_poll_types = ['present'] else: target_poll_types = ['hw_present', 'power_good'] @@ -1657,9 +1687,10 @@ def is_dummy_event(self, fd_type, fd_value): """ if fd_type == 'hw_present' or fd_type == 'present': if fd_value == int(SFP_STATUS_INSERTED): - return self.state in (STATE_SW_CONTROL, STATE_FW_CONTROL, STATE_POWER_BAD, STATE_POWER_LIMIT_ERROR) + return self.state in (STATE_SW_CONTROL, STATE_FW_CONTROL, STATE_POWER_BAD, + STATE_POWER_LIMIT_ERROR, STATE_FCP_PRESENT) elif fd_value == int(SFP_STATUS_REMOVED): - return self.state == STATE_NOT_PRESENT + return self.state in (STATE_NOT_PRESENT, STATE_FCP_NOT_PRESENT) elif fd_type == 'power_good': if fd_value == 1: return self.state in (STATE_SW_CONTROL, STATE_NOT_PRESENT, STATE_RESETTING) diff --git a/platform/mellanox/mlnx-platform-api/tests/test_sfp_sm.py b/platform/mellanox/mlnx-platform-api/tests/test_sfp_sm.py index 9f2154173d32..a1e4a0280037 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_sfp_sm.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_sfp_sm.py @@ -168,3 +168,16 @@ def test_sw_control(self): s.disable_tx_for_sff_optics = mock.MagicMock() s.on_event(sfp.EVENT_START) assert s.get_state() == sfp.STATE_SW_CONTROL + + @mock.patch('sonic_platform.device_data.DeviceDataManager.get_always_fw_control_ports', mock.MagicMock(return_value=[0])) + def test_fcp_state(self): + self.mock_value('present', 1) + s = sfp.SFP(0) + s.on_event(sfp.EVENT_START) + assert s.get_state() == sfp.STATE_FCP_PRESENT + + self.mock_value('present', 0) + s = sfp.SFP(0) + s.on_event(sfp.EVENT_START) + assert s.get_state() == sfp.STATE_FCP_NOT_PRESENT + From 9c3c2ffdd73d910f0b42cdfbcf54c556f04f9eec Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Thu, 4 Jul 2024 09:16:19 +0300 Subject: [PATCH 402/419] [202311_RC] update submodule(s): sonic-platform-daemons --- 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 acfe4c61ad2b..bc83c41ba9a9 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit acfe4c61ad2bdb7d7d4ed02d65797cb5deafac14 +Subproject commit bc83c41ba9a993f6638e571205b6c3bc89f429fa From 2e29810d8aa83327811d67439cf76a0af199f0d0 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Thu, 4 Jul 2024 10:44:18 +0300 Subject: [PATCH 403/419] [202311_RC] update submodule(s): sonic-swss --- .gitmodules | 2 +- src/sonic-swss | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index ea08ab1a5ab7..c43bdffe6efb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -12,7 +12,7 @@ branch = 202311 [submodule "sonic-swss"] path = src/sonic-swss - url = https://github.com/sonic-net/sonic-swss + url = https://github.com/nvidia-sonic/sonic-swss branch = 202311 [submodule "src/p4c-bm/p4c-bm"] path = platform/p4/p4c-bm/p4c-bm diff --git a/src/sonic-swss b/src/sonic-swss index 6a347ab40a38..bf31d87b2439 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 6a347ab40a3844b8326d62bca6ee0eb164f3d682 +Subproject commit bf31d87b2439b80a6bf7196e6c13b94e4506093a From e7d79e2416908ad4d30d54073904d7cfa8383a98 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Thu, 4 Jul 2024 10:47:08 +0300 Subject: [PATCH 404/419] [202311_RC] Add default ECMP/LAG hash offset values for T0 and T1 --- dockers/docker-orchagent/switch.json.j2 | 6 ++++++ .../tests/sample_output/t0-switch-masic1.json | 2 ++ .../tests/sample_output/t0-switch-masic3.json | 2 ++ src/sonic-config-engine/tests/sample_output/t0-switch.json | 2 ++ src/sonic-config-engine/tests/sample_output/t1-switch.json | 2 ++ 5 files changed, 14 insertions(+) diff --git a/dockers/docker-orchagent/switch.json.j2 b/dockers/docker-orchagent/switch.json.j2 index 30ad703bc2cf..62dcb1254753 100644 --- a/dockers/docker-orchagent/switch.json.j2 +++ b/dockers/docker-orchagent/switch.json.j2 @@ -2,11 +2,15 @@ {# set default hash seed to 0 #} {% set hash_seed = 0 %} {% set hash_seed_offset = 0 %} +{% set ecmp_hash_offset_value = 0 %} +{% set lag_hash_offset_value = 0 %} {% if DEVICE_METADATA.localhost.type %} {% if "ToRRouter" in DEVICE_METADATA.localhost.type or DEVICE_METADATA.localhost.type in ["EPMS", "MgmtTsToR"] %} {% set hash_seed = 0 %} {% elif "LeafRouter" in DEVICE_METADATA.localhost.type %} {% set hash_seed = 10 %} +{% set ecmp_hash_offset_value = 10 %} +{% set lag_hash_offset_value = 10 %} {% elif "SpineRouter" in DEVICE_METADATA.localhost.type %} {% set hash_seed = 25 %} {% endif %} @@ -21,6 +25,8 @@ "ecmp_hash_seed": "{{ hash_seed_value }}", "lag_hash_seed": "{{ hash_seed_value }}", "fdb_aging_time": "600", + "ecmp_hash_offset": "{{ ecmp_hash_offset_value }}", + "lag_hash_offset": "{{ lag_hash_offset_value }}", {% if DEVICE_METADATA.localhost.type and "LeafRouter" in DEVICE_METADATA.localhost.type %} "ordered_ecmp": "true" {% else %} diff --git a/src/sonic-config-engine/tests/sample_output/t0-switch-masic1.json b/src/sonic-config-engine/tests/sample_output/t0-switch-masic1.json index 83ca9f50aed5..d64c5070fe0d 100644 --- a/src/sonic-config-engine/tests/sample_output/t0-switch-masic1.json +++ b/src/sonic-config-engine/tests/sample_output/t0-switch-masic1.json @@ -4,6 +4,8 @@ "ecmp_hash_seed": "11", "lag_hash_seed": "11", "fdb_aging_time": "600", + "ecmp_hash_offset": "10", + "lag_hash_offset": "10", "ordered_ecmp": "true" }, "OP": "SET" diff --git a/src/sonic-config-engine/tests/sample_output/t0-switch-masic3.json b/src/sonic-config-engine/tests/sample_output/t0-switch-masic3.json index db5d1b6e4aee..2f91d5664d57 100644 --- a/src/sonic-config-engine/tests/sample_output/t0-switch-masic3.json +++ b/src/sonic-config-engine/tests/sample_output/t0-switch-masic3.json @@ -4,6 +4,8 @@ "ecmp_hash_seed": "13", "lag_hash_seed": "13", "fdb_aging_time": "600", + "ecmp_hash_offset": "10", + "lag_hash_offset": "10", "ordered_ecmp": "true" }, "OP": "SET" diff --git a/src/sonic-config-engine/tests/sample_output/t0-switch.json b/src/sonic-config-engine/tests/sample_output/t0-switch.json index d585ca2a52f6..1dda7c549c4a 100644 --- a/src/sonic-config-engine/tests/sample_output/t0-switch.json +++ b/src/sonic-config-engine/tests/sample_output/t0-switch.json @@ -4,6 +4,8 @@ "ecmp_hash_seed": "0", "lag_hash_seed": "0", "fdb_aging_time": "600", + "ecmp_hash_offset": "0", + "lag_hash_offset": "0", "ordered_ecmp": "false" }, "OP": "SET" diff --git a/src/sonic-config-engine/tests/sample_output/t1-switch.json b/src/sonic-config-engine/tests/sample_output/t1-switch.json index 3b3b7959191b..bc5a02b2165a 100644 --- a/src/sonic-config-engine/tests/sample_output/t1-switch.json +++ b/src/sonic-config-engine/tests/sample_output/t1-switch.json @@ -4,6 +4,8 @@ "ecmp_hash_seed": "10", "lag_hash_seed": "10", "fdb_aging_time": "600", + "ecmp_hash_offset": "10", + "lag_hash_offset": "10", "ordered_ecmp": "true" }, "OP": "SET" From 2708da10d817eb589257f76efd3053d082b34673 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Fri, 5 Jul 2024 10:45:56 +0300 Subject: [PATCH 405/419] [202311_RC] update submodule(s): sonic-swss --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index bf31d87b2439..15877405d327 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit bf31d87b2439b80a6bf7196e6c13b94e4506093a +Subproject commit 15877405d327b01491be6f886da64f07925b288f From bad8db604cef2a9db76b611ade6974d8ba0dffa4 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Fri, 5 Jul 2024 13:32:46 +0300 Subject: [PATCH 406/419] [202311_RC] Add debug info for issue 3959003 --- platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index 61327c5242f2..aade4daedd8b 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -498,8 +498,11 @@ def get_presence(self): """ presence_sysfs = f'/sys/module/sx_core/asic0/module{self.sdk_index}/hw_present' if self.is_sw_control() else f'/sys/module/sx_core/asic0/module{self.sdk_index}/present' if utils.read_int_from_file(presence_sysfs) != 1: + self.not_presence_reason = f'{presence_sysfs} value is not 1' return False eeprom_raw = self._read_eeprom(0, 1, log_on_error=False) + if eeprom_raw is None: + self.not_presence_reason = 'eeprom is not available' return eeprom_raw is not None # read eeprom specfic bytes beginning from offset with size as num_bytes From 81445a9f6a36d3463766d2daa5f9d6715a981f62 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Fri, 5 Jul 2024 13:35:49 +0300 Subject: [PATCH 407/419] [202311_RC] update sumodule(s): sonic-platform-daemons --- 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 bc83c41ba9a9..a52bf51c9281 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit bc83c41ba9a993f6638e571205b6c3bc89f429fa +Subproject commit a52bf51c92817b03660344d4cc88a45571bf9d98 From 3b160d3f9dbb9ebf765391bd86e0b154bae3c5af Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Mon, 8 Jul 2024 15:22:48 +0300 Subject: [PATCH 408/419] [202311_RC] [202311][zebra] remove dplane_fpm_nl config from zebra.conf --- dockers/docker-fpm-frr/docker_init.sh | 5 ----- dockers/docker-fpm-frr/frr/zebra/zebra.conf.j2 | 4 ---- platform/vs/docker-sonic-vs/frr/zebra.conf | 2 -- src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/zebra.conf | 4 ---- .../tests/sample_output/py2/t2-chassis-fe-vni-zebra.conf | 4 ---- .../tests/sample_output/py2/t2-chassis-fe-zebra.conf | 4 ---- .../tests/sample_output/py2/zebra_frr.conf | 4 ---- .../tests/sample_output/py2/zebra_frr_dualtor.conf | 4 ---- .../tests/sample_output/py3/t2-chassis-fe-vni-zebra.conf | 4 ---- .../tests/sample_output/py3/t2-chassis-fe-zebra.conf | 4 ---- .../tests/sample_output/py3/zebra_frr.conf | 4 ---- .../tests/sample_output/py3/zebra_frr_dualtor.conf | 4 ---- 12 files changed, 47 deletions(-) diff --git a/dockers/docker-fpm-frr/docker_init.sh b/dockers/docker-fpm-frr/docker_init.sh index 390a403aa598..a504d6975683 100755 --- a/dockers/docker-fpm-frr/docker_init.sh +++ b/dockers/docker-fpm-frr/docker_init.sh @@ -45,11 +45,6 @@ write_default_zebra_config() { FILE_NAME=${1} - grep -q '^no fpm use-next-hop-groups' $FILE_NAME || { - echo "no fpm use-next-hop-groups" >> $FILE_NAME - echo "fpm address 127.0.0.1" >> $FILE_NAME - } - grep -q '^no zebra nexthop kernel enable' $FILE_NAME || { echo "no zebra nexthop kernel enable" >> $FILE_NAME } diff --git a/dockers/docker-fpm-frr/frr/zebra/zebra.conf.j2 b/dockers/docker-fpm-frr/frr/zebra/zebra.conf.j2 index 4543ad8f974e..11ca8c609e64 100644 --- a/dockers/docker-fpm-frr/frr/zebra/zebra.conf.j2 +++ b/dockers/docker-fpm-frr/frr/zebra/zebra.conf.j2 @@ -9,10 +9,6 @@ {% block fpm %} ! Force disable next hop group support no zebra nexthop kernel enable -! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages -no fpm use-next-hop-groups -! -fpm address 127.0.0.1 {% endblock fpm %} ! {% include "common/daemons.common.conf.j2" %} diff --git a/platform/vs/docker-sonic-vs/frr/zebra.conf b/platform/vs/docker-sonic-vs/frr/zebra.conf index 1980a6e159f0..2ff9ee84a7dc 100644 --- a/platform/vs/docker-sonic-vs/frr/zebra.conf +++ b/platform/vs/docker-sonic-vs/frr/zebra.conf @@ -1,3 +1 @@ no zebra nexthop kernel enable -no fpm use-next-hop-groups -fpm address 127.0.0.1 diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/zebra.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/zebra.conf index 38db2964823e..c1450887d52f 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/zebra.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/zebra.conf @@ -6,10 +6,6 @@ ! ! Force disable next hop group support no zebra nexthop kernel enable -! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages -no fpm use-next-hop-groups -! -fpm address 127.0.0.1 ! ! template: common/daemons.common.conf.j2 ! diff --git a/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-vni-zebra.conf b/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-vni-zebra.conf index 120878fe1186..50e1b5eb0356 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-vni-zebra.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-vni-zebra.conf @@ -6,10 +6,6 @@ ! ! Force disable next hop group support no zebra nexthop kernel enable -! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages -no fpm use-next-hop-groups -! -fpm address 127.0.0.1 ! ! template: common/daemons.common.conf.j2 ! diff --git a/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-zebra.conf b/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-zebra.conf index a6e3ad05310f..f110b17bd7e9 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-zebra.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-zebra.conf @@ -6,10 +6,6 @@ ! ! Force disable next hop group support no zebra nexthop kernel enable -! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages -no fpm use-next-hop-groups -! -fpm address 127.0.0.1 ! ! template: common/daemons.common.conf.j2 ! diff --git a/src/sonic-config-engine/tests/sample_output/py2/zebra_frr.conf b/src/sonic-config-engine/tests/sample_output/py2/zebra_frr.conf index 9e438caa0e34..c81611465e59 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/zebra_frr.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/zebra_frr.conf @@ -6,10 +6,6 @@ ! ! Force disable next hop group support no zebra nexthop kernel enable -! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages -no fpm use-next-hop-groups -! -fpm address 127.0.0.1 ! ! template: common/daemons.common.conf.j2 ! diff --git a/src/sonic-config-engine/tests/sample_output/py2/zebra_frr_dualtor.conf b/src/sonic-config-engine/tests/sample_output/py2/zebra_frr_dualtor.conf index 0f49b229b88d..e37edf7c1b94 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/zebra_frr_dualtor.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/zebra_frr_dualtor.conf @@ -6,10 +6,6 @@ ! ! Force disable next hop group support no zebra nexthop kernel enable -! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages -no fpm use-next-hop-groups -! -fpm address 127.0.0.1 ! ! template: common/daemons.common.conf.j2 ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-vni-zebra.conf b/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-vni-zebra.conf index c6c973f7f05c..6bdde0c12b88 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-vni-zebra.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-vni-zebra.conf @@ -6,10 +6,6 @@ ! ! Force disable next hop group support no zebra nexthop kernel enable -! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages -no fpm use-next-hop-groups -! -fpm address 127.0.0.1 ! ! template: common/daemons.common.conf.j2 ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-zebra.conf b/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-zebra.conf index 84e76ecdb01c..7fe82c5794ea 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-zebra.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-zebra.conf @@ -6,10 +6,6 @@ ! ! Force disable next hop group support no zebra nexthop kernel enable -! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages -no fpm use-next-hop-groups -! -fpm address 127.0.0.1 ! ! template: common/daemons.common.conf.j2 ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/zebra_frr.conf b/src/sonic-config-engine/tests/sample_output/py3/zebra_frr.conf index b8adb98787a7..32cf2fb2f1fd 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/zebra_frr.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/zebra_frr.conf @@ -6,10 +6,6 @@ ! ! Force disable next hop group support no zebra nexthop kernel enable -! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages -no fpm use-next-hop-groups -! -fpm address 127.0.0.1 ! ! template: common/daemons.common.conf.j2 ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/zebra_frr_dualtor.conf b/src/sonic-config-engine/tests/sample_output/py3/zebra_frr_dualtor.conf index 2741ba54cf4f..9018444fe48c 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/zebra_frr_dualtor.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/zebra_frr_dualtor.conf @@ -6,10 +6,6 @@ ! ! Force disable next hop group support no zebra nexthop kernel enable -! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages -no fpm use-next-hop-groups -! -fpm address 127.0.0.1 ! ! template: common/daemons.common.conf.j2 ! From 3528872328ef8485809221b1411551047c2eee0d Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Mon, 8 Jul 2024 15:24:49 +0300 Subject: [PATCH 409/419] [202311_RC] [healthd] fix healthd shutdown race --- src/system-health/health_checker/sysmonitor.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/system-health/health_checker/sysmonitor.py b/src/system-health/health_checker/sysmonitor.py index 115dbfbe9ea0..306419512865 100755 --- a/src/system-health/health_checker/sysmonitor.py +++ b/src/system-health/health_checker/sysmonitor.py @@ -507,8 +507,6 @@ def task_worker(self): def task_stop(self): # Signal the process to stop self.task_stopping_event.set() - #Clear the resources of mpmgr- Queue - self.mpmgr.shutdown() # Wait for the process to exit self._task_process.join(self._stop_timeout_secs) From 961d119207f06a38ee180c5a13659ee7233fc60d Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Wed, 10 Jul 2024 12:03:33 +0300 Subject: [PATCH 410/419] Revert "[202311_RC] INTERNAL: Add traceback logs in sfp.py for troubleshooting EEPROM read issues" This reverts commit 932716d657b4c996af3195a02950ee75473d76d4. --- .../mlnx-platform-api/sonic_platform/sfp.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index aade4daedd8b..1606c0dbc54d 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -29,7 +29,6 @@ import os import threading import time - import traceback from sonic_py_common.logger import Logger from sonic_py_common.general import check_output_pipe from . import utils @@ -557,19 +556,6 @@ def _read_eeprom(self, offset, num_bytes, log_on_error=True): if log_on_error: logger.log_warning(f'Failed to read sfp={self.sdk_index} EEPROM page={page}, page_offset={page_offset}, '\ f'size={num_bytes}, offset={offset}, error = {e}') - - logger.log_error(f"--- tomer --- {self.sdk_index}: Entered monitored if statement") - logger.log_error(f"--- tomer --- {self.sdk_index}: Stack trace leading to this call:") - stack = traceback.extract_stack() - for frame in stack: - logger.log_error(f"--- tomer --- {self.sdk_index}: File: {frame.filename}") - logger.log_error(f"--- tomer --- {self.sdk_index}: Line number: {frame.lineno}") - logger.log_error(f"--- tomer --- {self.sdk_index}: Function name: {frame.name}") - logger.log_error(f"--- tomer --- {self.sdk_index}: Line of code: {frame.line}") - logger.log_error('-' * 40) - logger.log_error('-' * 40) - logger.log_error('-' * 40) - return None return bytearray(result) From 878ceeeca1dbbbfc536b45e872638f5d238331fe Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Wed, 10 Jul 2024 12:08:41 +0300 Subject: [PATCH 411/419] [202311_RC] update submodule(s): sonic-platform-daemons to remove the debug logs --- .gitmodules | 2 +- src/sonic-platform-daemons | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index c43bdffe6efb..0f3addfd19cf 100644 --- a/.gitmodules +++ b/.gitmodules @@ -48,7 +48,7 @@ branch = 202311 [submodule "src/sonic-platform-daemons"] path = src/sonic-platform-daemons - url = https://github.com/nvidia-sonic/sonic-platform-daemons + url = https://github.com/sonic-net/sonic-platform-daemons branch = 202311 [submodule "src/sonic-platform-pde"] path = src/sonic-platform-pde diff --git a/src/sonic-platform-daemons b/src/sonic-platform-daemons index a52bf51c9281..52bcf142f67f 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit a52bf51c92817b03660344d4cc88a45571bf9d98 +Subproject commit 52bcf142f67fdaffdeb1af46fa39731fbd00f26e From 4f98651e9fc22fbba86ecc41c7aa2253dfe90142 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Wed, 10 Jul 2024 12:18:40 +0300 Subject: [PATCH 412/419] [202311_RC] update submodule(s): sonic-platform-common --- .gitmodules | 2 +- src/sonic-platform-common | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 0f3addfd19cf..ab413955e55d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -44,7 +44,7 @@ url = https://github.com/aristanetworks/sonic [submodule "src/sonic-platform-common"] path = src/sonic-platform-common - url = https://github.com/sonic-net/sonic-platform-common + url = https://github.com/nvidia-sonic/sonic-platform-common branch = 202311 [submodule "src/sonic-platform-daemons"] path = src/sonic-platform-daemons diff --git a/src/sonic-platform-common b/src/sonic-platform-common index 13cf28e71850..4a44aafa9b6d 160000 --- a/src/sonic-platform-common +++ b/src/sonic-platform-common @@ -1 +1 @@ -Subproject commit 13cf28e71850af20d997da04c4424324dcec1aa4 +Subproject commit 4a44aafa9b6d18f75605462cf349b3af655211d2 From 2ec6385b5d354196b358c1b305396bab38ba9144 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Wed, 10 Jul 2024 12:19:27 +0300 Subject: [PATCH 413/419] Revert "[202311_RC] Add debug info for issue 3959003" This reverts commit bad8db604cef2a9db76b611ade6974d8ba0dffa4. --- platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py | 3 --- 1 file changed, 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 1606c0dbc54d..e140c9b02455 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -497,11 +497,8 @@ def get_presence(self): """ presence_sysfs = f'/sys/module/sx_core/asic0/module{self.sdk_index}/hw_present' if self.is_sw_control() else f'/sys/module/sx_core/asic0/module{self.sdk_index}/present' if utils.read_int_from_file(presence_sysfs) != 1: - self.not_presence_reason = f'{presence_sysfs} value is not 1' return False eeprom_raw = self._read_eeprom(0, 1, log_on_error=False) - if eeprom_raw is None: - self.not_presence_reason = 'eeprom is not available' return eeprom_raw is not None # read eeprom specfic bytes beginning from offset with size as num_bytes From 15d02831f164dfd9f8e8111408520c0636070a77 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Thu, 11 Jul 2024 04:33:29 +0300 Subject: [PATCH 414/419] [202311_RC] [202311][Mellanox] CMIS host management script --- .../build_templates/sonic_debian_extension.j2 | 2 + .../mellanox/cmis_host_mgmt/cmis_host_mgmt.py | 171 ++++++++++++++++++ 2 files changed, 173 insertions(+) create mode 100644 platform/mellanox/cmis_host_mgmt/cmis_host_mgmt.py diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 6ecbcb4bf300..7b74b20e550a 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -974,6 +974,8 @@ 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 sudo cp $files_path/$MLNX_SSD_FW_UPDATE $FILESYSTEM_ROOT/usr/bin/$MLNX_SSD_FW_UPDATE sudo cp $files_path/$MLNX_INSTALL_PENDING_FW $FILESYSTEM_ROOT/usr/bin/$MLNX_INSTALL_PENDING_FW +sudo cp platform/mellanox/cmis_host_mgmt/cmis_host_mgmt.py $FILESYSTEM_ROOT/usr/bin/cmis_host_mgmt.py +sudo chmod 755 $FILESYSTEM_ROOT/usr/bin/cmis_host_mgmt.py j2 platform/mellanox/mlnx-fw-upgrade.j2 | sudo tee $FILESYSTEM_ROOT/usr/bin/mlnx-fw-upgrade.sh sudo chmod 755 $FILESYSTEM_ROOT/usr/bin/mlnx-fw-upgrade.sh diff --git a/platform/mellanox/cmis_host_mgmt/cmis_host_mgmt.py b/platform/mellanox/cmis_host_mgmt/cmis_host_mgmt.py new file mode 100644 index 000000000000..aaedbe4a57ba --- /dev/null +++ b/platform/mellanox/cmis_host_mgmt/cmis_host_mgmt.py @@ -0,0 +1,171 @@ +#!/usr/bin/env python3 +# +# Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. +# Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +import shutil +import click +import re +import os +import subprocess + + +class CMISHostMgmtActivator: + PARAMS = { + "sai_profile": { + "file_name": "sai.profile", + "enabled_param": "SAI_INDEPENDENT_MODULE_MODE=1", + "disabled_param": "SAI_INDEPENDENT_MODULE_MODE=0" + }, + "pmon_daemon_control": { + "file_name": "pmon_daemon_control.json", + "enabled_param": "\"skip_xcvrd_cmis_mgr\": false", + "disabled_param": "\"skip_xcvrd_cmis_mgr\": true", + }, + "sai_xml": { + "file_name": "sai_<>.xml", # will be filled at main, since we can't know the SKU here + "enabled_param": "1", + "disabled_param": "1" # Shouldn't be called + } + } + + @staticmethod + def change_param(param, path, action): + file_path = '{}/{}'.format(path, CMISHostMgmtActivator.PARAMS[param]["file_name"]) + lines = None + + try: + with open(file_path, 'r') as param_file: + lines = param_file.read() + + if lines: + if action == "disable": + lines = re.sub(CMISHostMgmtActivator.PARAMS[param]["enabled_param"], + CMISHostMgmtActivator.PARAMS[param]["disabled_param"], + lines) + elif action == "enable": + if param == "sai_profile" and not re.search(CMISHostMgmtActivator.PARAMS[param]["disabled_param"], lines): + if not re.search(CMISHostMgmtActivator.PARAMS[param]["enabled_param"], lines): + with open(file_path, 'a') as param_file: + param_file.write(CMISHostMgmtActivator.PARAMS[param]["enabled_param"]) + return + + lines = re.sub(CMISHostMgmtActivator.PARAMS[param]["disabled_param"], + CMISHostMgmtActivator.PARAMS[param]["enabled_param"], + lines) + + with open(file_path, 'w') as param_file: + param_file.write(lines) + + except FileNotFoundError as e: + print('Missing file: {}'.format(e.filename)) + + + @staticmethod + def parse_show_platform_summary(): + summary = subprocess.check_output(['show', 'platform', 'summary']) + summary = summary.decode('utf-8') + summary = [x for x in summary.split('\n') if x] + + for field in summary: + key, value = field.split(": ") + + if key == 'Platform': + platform = value + + elif key == 'HwSKU': + sku = value + + return platform, sku + + + @staticmethod + def remove_file(file_path): + if os.path.isfile(file_path): + os.remove(file_path) + + + @staticmethod + def copy_file(src_path, dest_path): + if os.path.isfile(src_path): + shutil.copy(src_path, dest_path) + + + @staticmethod + def is_spc_supported(spc): + return int(spc) >= 4000 + + @staticmethod + def disable(): + platform, sku = CMISHostMgmtActivator.parse_show_platform_summary() + sku_path = '/usr/share/sonic/device/{0}/{1}'.format(platform, sku) + platform_path = '/usr/share/sonic/device/{0}'.format(platform) + CMISHostMgmtActivator.change_param("sai_profile", sku_path, 'disable') + + if os.path.isfile('{0}/{1}'.format(platform_path, 'pmon_daemon_control.json')): + CMISHostMgmtActivator.change_param("pmon_daemon_control", platform_path, 'disable') + CMISHostMgmtActivator.remove_file('{0}/{1}'.format(sku_path, 'pmon_daemon_control.json')) + else: + CMISHostMgmtActivator.change_param("pmon_daemon_control", sku_path, 'disable') + + CMISHostMgmtActivator.remove_file('{0}/{1}'.format(sku_path, 'media_settings.json')) + CMISHostMgmtActivator.remove_file('{0}/{1}'.format(sku_path,'optics_si_settings.json')) + CMISHostMgmtActivator.remove_file('{0}/{1}'.format(platform_path, 'media_settings.json')) + CMISHostMgmtActivator.remove_file('{0}/{1}'.format(platform_path, 'optics_si_settings.json')) + + + @staticmethod + def enable(args): + platform, sku = CMISHostMgmtActivator.parse_show_platform_summary() + sku_path = '/usr/share/sonic/device/{0}/{1}'.format(platform, sku) + platform_path = '/usr/share/sonic/device/{0}'.format(platform) + + sku_num = re.search('[0-9]{4}', sku).group() + + if not CMISHostMgmtActivator.is_spc_supported(sku_num): + print("Error: unsupported platform - feature is supported on SPC3 and higher.") + + CMISHostMgmtActivator.PARAMS["sai_xml"]["file_name"] = "sai_{0}.xml".format(sku_num) + + CMISHostMgmtActivator.copy_file(args[0], sku_path) + CMISHostMgmtActivator.copy_file(args[1], sku_path) + CMISHostMgmtActivator.copy_file('{0}/{1}'.format(platform_path, 'pmon_daemon_control.json'), sku_path) + + CMISHostMgmtActivator.change_param("sai_profile", sku_path, 'enable') + CMISHostMgmtActivator.change_param("pmon_daemon_control", sku_path, 'enable') + CMISHostMgmtActivator.change_param("sai_xml", sku_path, 'enable') + + +@click.command() +@click.option('--disable', is_flag=True, help='Disable CMIS Host Management') +@click.option('--enable', nargs=2, type=click.Path(), help='Enable CMIS Host Management, receives two arguments: media_settings.json path, and optics_si_settings.json path') +def main(disable, enable): + + if disable and enable: + print("Error: can't use both options, please choose one.") + return + + if disable: + CMISHostMgmtActivator.disable() + + elif enable: + CMISHostMgmtActivator.enable(enable) + + else: + print("Error: no option was provided - nothing to execute.") + +if __name__ == '__main__': + main() From 0d6a6f7833211e20686feaff21d1c439f2a66302 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Thu, 11 Jul 2024 13:33:10 +0300 Subject: [PATCH 415/419] [202311_RC] update submodule(s): sonic-swss --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 15877405d327..7ab40aedb1f9 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 15877405d327b01491be6f886da64f07925b288f +Subproject commit 7ab40aedb1f9a04b26f5ed897a2db37d1ae9299d From e56014c1b94aa42fbd344498c14c6ee98c611ea2 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Fri, 12 Jul 2024 06:36:59 +0300 Subject: [PATCH 416/419] [202311_RC]Install dmidecode in the syncd docker container for SDK API --- platform/mellanox/docker-syncd-mlnx-rpc/Dockerfile.j2 | 1 + platform/mellanox/docker-syncd-mlnx/Dockerfile.j2 | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/mellanox/docker-syncd-mlnx-rpc/Dockerfile.j2 b/platform/mellanox/docker-syncd-mlnx-rpc/Dockerfile.j2 index 511e360cb5a5..04c0e2ef58db 100644 --- a/platform/mellanox/docker-syncd-mlnx-rpc/Dockerfile.j2 +++ b/platform/mellanox/docker-syncd-mlnx-rpc/Dockerfile.j2 @@ -28,6 +28,7 @@ RUN apt-get purge -y syncd RUN apt-get update \ && apt-get -y install \ net-tools \ + dmidecode \ build-essential \ libssl-dev \ libffi-dev \ diff --git a/platform/mellanox/docker-syncd-mlnx/Dockerfile.j2 b/platform/mellanox/docker-syncd-mlnx/Dockerfile.j2 index bdc51abca7e7..9fb2abeb6cc9 100755 --- a/platform/mellanox/docker-syncd-mlnx/Dockerfile.j2 +++ b/platform/mellanox/docker-syncd-mlnx/Dockerfile.j2 @@ -34,7 +34,8 @@ RUN apt-get update && \ {%- if ENABLE_ASAN == "y" %} libasan6 \ {%- endif %} - python3-setuptools + python3-setuptools \ + dmidecode RUN pip3 install --upgrade pip RUN apt-get purge -y python-pip From 1e7947e05e44c6663ccf90b28d0075f1a8e63f62 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Fri, 12 Jul 2024 12:45:04 +0300 Subject: [PATCH 417/419] [202311_RC] fix sfp eeprom unreadable after switching from SW to FW control mode --- .../sonic_platform/chassis.py | 6 +++++- .../mlnx-platform-api/sonic_platform/sfp.py | 18 +++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py b/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py index 935a2fa5f1f8..f7d63d60e26a 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py @@ -513,16 +513,20 @@ def get_change_event_for_module_host_management_mode(self, timeout): s.on_event(event) if s.in_stable_state(): + if s.get_control_type() == 0 and not self.sfp_module.SFP.wait_sfp_eeprom_ready([s], 2): + logger.log_error(f'SFP {sfp_index} eeprom is not readable') s.fill_change_event(port_dict) s.refresh_poll_obj(self.poll_obj, self.registered_fds) else: logger.log_debug(f'SFP {sfp_index} does not reach stable state, state={s.state}') - + ready_sfp_set = wait_ready_task.get_ready_set() for sfp_index in ready_sfp_set: s = self._sfp_list[sfp_index] s.on_event(sfp.EVENT_RESET_DONE) if s.in_stable_state(): + if s.get_control_type() == 0 and not self.sfp_module.SFP.wait_sfp_eeprom_ready([s], 2): + logger.log_error(f'SFP {sfp_index} eeprom is not readable') s.fill_change_event(port_dict) s.refresh_poll_obj(self.poll_obj, self.registered_fds) else: diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index e140c9b02455..20bfa997d97a 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -500,6 +500,21 @@ def get_presence(self): return False eeprom_raw = self._read_eeprom(0, 1, log_on_error=False) return eeprom_raw is not None + + @classmethod + def wait_sfp_eeprom_ready(cls, sfp_list, wait_time): + not_ready_list = sfp_list + + while wait_time > 0: + not_ready_list = [s for s in not_ready_list if s.state == STATE_FW_CONTROL and s._read_eeprom(0, 2,False) is None] + if not_ready_list: + time.sleep(0.1) + wait_time -= 0.1 + else: + return + + for s in not_ready_list: + logger.log_error(f'SFP {s.sdk_index} eeprom is not ready') # read eeprom specfic bytes beginning from offset with size as num_bytes def read_eeprom(self, offset, num_bytes): @@ -1724,7 +1739,8 @@ def initialize_sfp_modules(cls, sfp_list): logger.log_error(f'SFP {index} is not in stable state after initializing, state={s.state}') logger.log_notice(f'SFP {index} is in state {s.state} after module initialization') - + cls.wait_sfp_eeprom_ready(sfp_list, 2) + class RJ45Port(NvidiaSFPCommon): """class derived from SFP, representing RJ45 ports""" From b7d52f5640971b00fd1aa3debc460eb1d02508bd Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Mon, 15 Jul 2024 12:42:47 +0300 Subject: [PATCH 418/419] Revert "[202311_RC]Install dmidecode in the syncd docker container for SDK API" This reverts commit e56014c1b94aa42fbd344498c14c6ee98c611ea2. --- platform/mellanox/docker-syncd-mlnx-rpc/Dockerfile.j2 | 1 - platform/mellanox/docker-syncd-mlnx/Dockerfile.j2 | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/platform/mellanox/docker-syncd-mlnx-rpc/Dockerfile.j2 b/platform/mellanox/docker-syncd-mlnx-rpc/Dockerfile.j2 index 04c0e2ef58db..511e360cb5a5 100644 --- a/platform/mellanox/docker-syncd-mlnx-rpc/Dockerfile.j2 +++ b/platform/mellanox/docker-syncd-mlnx-rpc/Dockerfile.j2 @@ -28,7 +28,6 @@ RUN apt-get purge -y syncd RUN apt-get update \ && apt-get -y install \ net-tools \ - dmidecode \ build-essential \ libssl-dev \ libffi-dev \ diff --git a/platform/mellanox/docker-syncd-mlnx/Dockerfile.j2 b/platform/mellanox/docker-syncd-mlnx/Dockerfile.j2 index 9fb2abeb6cc9..bdc51abca7e7 100755 --- a/platform/mellanox/docker-syncd-mlnx/Dockerfile.j2 +++ b/platform/mellanox/docker-syncd-mlnx/Dockerfile.j2 @@ -34,8 +34,7 @@ RUN apt-get update && \ {%- if ENABLE_ASAN == "y" %} libasan6 \ {%- endif %} - python3-setuptools \ - dmidecode + python3-setuptools RUN pip3 install --upgrade pip RUN apt-get purge -y python-pip From 7a2264a360f113c4aa032e0fdab85aa814ec8637 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Tue, 16 Jul 2024 04:45:56 +0300 Subject: [PATCH 419/419] [202311_RC] [Static DNS] Optimize DNS configuration update during interface-config service restart --- .../interfaces/interfaces-config.sh | 21 +++++++++++++++++++ .../resolv-config/update-containers | 7 ++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/files/image_config/interfaces/interfaces-config.sh b/files/image_config/interfaces/interfaces-config.sh index cb2faea91f31..669d12849f10 100755 --- a/files/image_config/interfaces/interfaces-config.sh +++ b/files/image_config/interfaces/interfaces-config.sh @@ -1,4 +1,5 @@ #!/bin/bash +resolvconf_updates=true function wait_networking_service_done() { local -i _WDOG_CNT="1" @@ -23,6 +24,24 @@ function wait_networking_service_done() { systemctl kill networking 2>&1 } +function resolvconf_updates_disable() { + resolvconf --updates-are-enabled + if [[ $? -ne 0 ]]; then + resolvconf_updates=false + fi + resolvconf --disable-updates +} + +function resolvconf_updates_restore() { + if [[ $resolvconf_updates == true ]]; then + resolvconf --enable-updates + fi +} + +# Do not run DNS configuration update during the shutdowning of the management interface. +# This operation is redundant as there will be an update after the start of the interface. +resolvconf_updates_disable + if [[ $(ifquery --running eth0) ]]; then wait_networking_service_done ifdown --force eth0 @@ -61,6 +80,8 @@ for intf_pid in $(ls -1 /var/run/dhclient*.Ethernet*.pid 2> /dev/null); do done /usr/bin/resolv-config.sh cleanup +# Restore DNS configuration update to the previous state. +resolvconf_updates_restore # Read sysctl conf files again sysctl -p /etc/sysctl.d/90-dhcp6-systcl.conf diff --git a/files/image_config/resolv-config/update-containers b/files/image_config/resolv-config/update-containers index 47d8328a80fe..891fd2ea7462 100755 --- a/files/image_config/resolv-config/update-containers +++ b/files/image_config/resolv-config/update-containers @@ -1,6 +1,11 @@ #!/bin/bash -for container in $(docker ps -a --format=" {{ .ID }}"); do +networking_status=$(systemctl is-active networking.service 2>/dev/null) +if [[ $networking_status != "active" ]]; then + exit 0 +fi + +for container in $(docker ps -q); do docker cp -L /etc/resolv.conf ${container}:/_resolv.conf docker exec -t ${container} bash -c "cat /_resolv.conf > /etc/resolv.conf" docker exec -t ${container} bash -c "rm /_resolv.conf"