diff --git a/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/buffers.json.j2 b/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/buffers.json.j2 new file mode 120000 index 000000000000..add8bf8bb7c2 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/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-mlnx_msn2010-r0/ACS-MSN2010/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..7bcae62336f6 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/buffers_defaults_t1.j2 new file mode 120000 index 000000000000..a437d613434d --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/buffers_defaults_t1.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/pg_profile_lookup.ini b/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/pg_profile_lookup.ini new file mode 120000 index 000000000000..3c97f3dcb16f --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/pg_profile_lookup.ini @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/port_config.ini b/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/port_config.ini index 1cb2cb69c592..987720e3b120 100644 --- a/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/port_config.ini +++ b/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/port_config.ini @@ -1,23 +1,33 @@ -# name lanes -Ethernet0 0 -Ethernet4 4 -Ethernet8 8 -Ethernet12 12 -Ethernet16 16 -Ethernet20 20 -Ethernet24 24 -Ethernet28 28 -Ethernet32 32 -Ethernet36 36 -Ethernet40 40 -Ethernet44 44 -Ethernet48 48 -Ethernet52 52 -Ethernet56 56 -Ethernet60 60 -Ethernet64 64 -Ethernet68 68 -Ethernet72 72,73,74,75 -Ethernet76 76,77,78,79 -Ethernet80 80,81,82,83 -Ethernet84 84,85,86,87 \ No newline at end of file +# name lanes index +Ethernet0 0 0 +Ethernet4 4 1 +Ethernet8 8 2 +Ethernet12 12 3 +Ethernet16 16 4 +Ethernet20 20 5 +Ethernet24 24 6 +Ethernet28 28 7 +Ethernet32 32 8 +Ethernet36 36 9 +Ethernet40 40 10 +Ethernet44 44 11 +Ethernet48 48 12 +Ethernet52 52 13 +Ethernet56 56 14 +Ethernet60 60 15 +Ethernet64 64 16 +Ethernet68 68 17 +Ethernet72 72 18 +Ethernet76 73 18 +Ethernet80 74 18 +Ethernet84 75 18 +Ethernet88 76 19 +Ethernet92 77 19 +Ethernet96 78 19 +Ethernet100 79 19 +Ethernet104 80 20 +Ethernet108 81 20 +Ethernet112 82 20 +Ethernet116 83 20 +Ethernet120 84 21 +Ethernet124 86 21 diff --git a/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/qos.json.j2 b/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/qos.json.j2 new file mode 120000 index 000000000000..eccf286dc879 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/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_msn2010-r0/ACS-MSN2010/sai_2010.xml b/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/sai_2010.xml new file mode 100644 index 000000000000..8f4af640ddde --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/sai_2010.xml @@ -0,0 +1,243 @@ + + + + + + 00:02:03:04:05:00 + + + 32 + + + + + 1 + 32 + 1 + + + 0 + + + 939524096 + + + 2 + 33 + 1 + 0 + 939524096 + + + 3 + 34 + 1 + 0 + 939524096 + + + 4 + 35 + 1 + 0 + 939524096 + + + 5 + 36 + 1 + 0 + 4096 + + + 6 + 37 + 1 + 0 + 4096 + + + 7 + 38 + 1 + 0 + 4096 + + + 8 + 39 + 1 + 0 + 4096 + + + 9 + 40 + 1 + 0 + 4096 + + + 10 + 41 + 1 + 0 + 4096 + + + 11 + 42 + 1 + 0 + 4096 + + + 12 + 43 + 1 + 0 + 4096 + + + 13 + 44 + 1 + 0 + 4096 + + + 14 + 45 + 1 + 0 + 4096 + + + 15 + 46 + 1 + 0 + 4096 + + + 16 + 47 + 1 + 0 + 4096 + + + 17 + 48 + 1 + 0 + 4096 + + + 18 + 49 + 1 + 0 + 4096 + + + 19 + 1 + 3 + 0 + 4096 + + + 20 + 1 + 4 + 0 + 4096 + + + 21 + 1 + 5 + 0 + 4096 + + + 22 + 1 + 6 + 0 + 4096 + + + 23 + 1 + 7 + 0 + 4096 + + + 24 + 1 + 8 + 0 + 4096 + + + 25 + 1 + 9 + 0 + 4096 + + + 26 + 1 + 10 + 0 + 4096 + + + 27 + 1 + 11 + 0 + 4096 + + + 28 + 1 + 12 + 0 + 4096 + + + 29 + 1 + 13 + 0 + 4096 + + + 30 + 1 + 14 + 0 + 4096 + + + 31 + 1 + 15 + 0 + 4096 + + + 32 + 1 + 16 + 0 + 4096 + + + + diff --git a/device/mellanox/x86_64-mlnx_msn2010-r0/plugins/psuutil.py b/device/mellanox/x86_64-mlnx_msn2010-r0/plugins/psuutil.py index b1900d173f57..d89a046940d0 100644 --- a/device/mellanox/x86_64-mlnx_msn2010-r0/plugins/psuutil.py +++ b/device/mellanox/x86_64-mlnx_msn2010-r0/plugins/psuutil.py @@ -64,10 +64,11 @@ def get_psu_presence(self, index): if index is None: return False + status = 0 try: with open(self.psu_path + self.psu_presence.format(index), 'r') as presence_status: - return True + status = int(presence_status.read()) except IOError: return False - return False + return status == 1 diff --git a/device/mellanox/x86_64-mlnx_msn2010-r0/plugins/sfputil.py b/device/mellanox/x86_64-mlnx_msn2010-r0/plugins/sfputil.py index d15c11943280..77831b54d2fd 100644 --- a/device/mellanox/x86_64-mlnx_msn2010-r0/plugins/sfputil.py +++ b/device/mellanox/x86_64-mlnx_msn2010-r0/plugins/sfputil.py @@ -10,18 +10,28 @@ except ImportError as e: raise ImportError("%s - required module not found" % str(e)) +# parameters for DB connection +REDIS_HOSTNAME = "localhost" +REDIS_PORT = 6379 +REDIS_TIMEOUT_USECS = 0 class SfpUtil(SfpUtilBase): """Platform-specific SfpUtil class""" - PORT_START = 0 - PORT_END = 55 - PORTS_IN_BLOCK = 56 - + PORT_END = 21 + PORTS_IN_BLOCK = 22 + QSFP_PORT_START = 18 EEPROM_OFFSET = 1 _port_to_eeprom_mapping = {} + db_sel = None + db_sel_timeout = None + db_sel_object = None + db_sel_tbl = None + state_db = None + sfpd_status_tbl = None + @property def port_start(self): return self.PORT_START @@ -32,7 +42,7 @@ def port_end(self): @property def qsfp_ports(self): - return range(0, self.PORTS_IN_BLOCK + 1) + return range(self.QSFP_PORT_START, self.PORTS_IN_BLOCK + 1) @property def port_to_eeprom_mapping(self): @@ -46,6 +56,7 @@ def __init__(self): SfpUtilBase.__init__(self) + def get_presence(self, port_num): # Check for invalid port_num if port_num < self.port_start or port_num > self.port_end: @@ -149,3 +160,39 @@ def reset(self, port_num): return False return False + + def get_transceiver_change_event(self, timeout=0): + phy_port_dict = {} + status = True + + if self.db_sel == None: + from swsscommon import swsscommon + self.state_db = swsscommon.DBConnector(swsscommon.STATE_DB, + REDIS_HOSTNAME, + REDIS_PORT, + REDIS_TIMEOUT_USECS) + + # Subscribe to state table for SFP change notifications + self.db_sel = swsscommon.Select() + self.db_sel_tbl = swsscommon.NotificationConsumer(self.state_db, 'TRANSCEIVER_NOTIFY') + self.db_sel.addSelectable(self.db_sel_tbl) + self.db_sel_timeout = swsscommon.Select.TIMEOUT + self.db_sel_object = swsscommon.Select.OBJECT + self.sfpd_status_tbl = swsscommon.Table(self.state_db, 'MLNX_SFPD_TASK') + + # Check the liveness of mlnx-sfpd, if it failed, return false + keys = self.sfpd_status_tbl.getKeys() + if 'LIVENESS' not in keys: + return False, phy_port_dict + + (state, c) = self.db_sel.select(timeout) + if state == self.db_sel_timeout: + status = True + elif state != self.db_sel_object: + status = False + else: + (key, op, fvp) = self.db_sel_tbl.pop() + phy_port_dict[key] = op + + return status, phy_port_dict + diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/qos.json.j2 b/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/qos.json.j2 index a11c77f7cc24..55fd79a875ea 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/qos.json.j2 +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/qos.json.j2 @@ -177,6 +177,9 @@ } }, "QUEUE": { + "{{ port_names_active }}|0-1" : { + "wred_profile" : "[WRED_PROFILE|AZURE_LOSSY]" + }, "{{ port_names_active }}|3-4" : { "scheduler" : "[SCHEDULER|scheduler.0]", "wred_profile" : "[WRED_PROFILE|AZURE_LOSSLESS]"