diff --git a/device/arista/x86_64-arista_7170_64c/Arista-7170-Q59S20/port_config.ini b/device/arista/x86_64-arista_7170_64c/Arista-7170-Q59S20/port_config.ini index 063d63910ed4..cf01e339b810 100644 --- a/device/arista/x86_64-arista_7170_64c/Arista-7170-Q59S20/port_config.ini +++ b/device/arista/x86_64-arista_7170_64c/Arista-7170-Q59S20/port_config.ini @@ -1,80 +1,80 @@ -# name lanes alias speed index -Ethernet0 0,1,2,3 Ethernet1/1 40000 1 -Ethernet4 4,5,6,7 Ethernet2/1 40000 2 -Ethernet8 8,9,10,11 Ethernet3/1 40000 3 -Ethernet12 12,13,14,15 Ethernet4/1 40000 4 -Ethernet16 16,17,18,19 Ethernet5/1 40000 5 -Ethernet20 20,21,22,23 Ethernet6/1 40000 6 -Ethernet24 24,25,26,27 Ethernet7/1 40000 7 -Ethernet28 28,29,30,31 Ethernet8/1 40000 8 -Ethernet32 32,33,34,35 Ethernet9/1 40000 9 -Ethernet36 36,37,38,39 Ethernet10/1 40000 10 -Ethernet40 40,41,42,43 Ethernet11/1 40000 11 -Ethernet44 44,45,46,47 Ethernet12/1 40000 12 -Ethernet48 48,49,50,51 Ethernet13/1 40000 13 -Ethernet52 52,53,54,55 Ethernet14/1 40000 14 -Ethernet56 56,57,58,59 Ethernet15/1 40000 15 -Ethernet60 60,61,62,63 Ethernet16/1 40000 16 -Ethernet64 64,65,66,67 Ethernet17/1 40000 17 -Ethernet68 68,69,70,71 Ethernet18/1 40000 18 -Ethernet72 72,73,74,75 Ethernet19/1 40000 19 -Ethernet76 76,77,78,79 Ethernet20/1 40000 20 -Ethernet80 80 Ethernet21/1 10000 21 -Ethernet81 81 Ethernet21/2 10000 21 -Ethernet82 82 Ethernet21/3 10000 21 -Ethernet83 83 Ethernet21/4 10000 21 -Ethernet84 84 Ethernet22/1 10000 22 -Ethernet85 85 Ethernet22/2 10000 22 -Ethernet86 86 Ethernet22/3 10000 22 -Ethernet87 87 Ethernet22/4 10000 22 -Ethernet88 88,89,90,91 Ethernet23/1 40000 23 -Ethernet92 92,93,94,95 Ethernet24/1 40000 24 -Ethernet96 96,97,98,99 Ethernet25/1 40000 25 -Ethernet100 100,101,102,103 Ethernet26/1 40000 26 -Ethernet104 104,105,106,107 Ethernet27/1 40000 27 -Ethernet108 108,109,110,111 Ethernet28/1 40000 28 -Ethernet112 112,113,114,115 Ethernet29/1 40000 29 -Ethernet116 116,117,118,119 Ethernet30/1 40000 30 -Ethernet120 120,121,122,123 Ethernet31/1 40000 31 -Ethernet124 124,125,126,127 Ethernet32/1 40000 32 -Ethernet128 128 Ethernet33/1 10000 33 -Ethernet129 129 Ethernet33/2 10000 33 -Ethernet130 130 Ethernet33/3 10000 33 -Ethernet131 131 Ethernet33/4 10000 33 -Ethernet132 132 Ethernet34/1 10000 34 -Ethernet133 133 Ethernet34/2 10000 34 -Ethernet134 134 Ethernet34/3 10000 34 -Ethernet135 135 Ethernet34/4 10000 34 -Ethernet136 136 Ethernet35/1 10000 35 -Ethernet137 137 Ethernet35/2 10000 35 -Ethernet138 138 Ethernet35/3 10000 35 -Ethernet139 139 Ethernet35/4 10000 35 -Ethernet140 140,141,142,143 Ethernet36/1 40000 36 -Ethernet144 144,145,146,147 Ethernet37/1 40000 37 -Ethernet148 148,149,150,151 Ethernet38/1 40000 38 -Ethernet152 152,153,154,155 Ethernet39/1 40000 39 -Ethernet156 156,157,158,159 Ethernet40/1 40000 40 -Ethernet160 160,161,162,163 Ethernet41/1 40000 41 -Ethernet164 164,165,166,167 Ethernet42/1 40000 42 -Ethernet168 168,169,170,171 Ethernet43/1 40000 43 -Ethernet172 172,173,174,175 Ethernet44/1 40000 44 -Ethernet176 176,177,178,179 Ethernet45/1 40000 45 -Ethernet180 180,181,182,183 Ethernet46/1 40000 46 -Ethernet184 184,185,186,187 Ethernet47/1 40000 47 -Ethernet188 188,189,190,191 Ethernet48/1 40000 48 -Ethernet192 192,193,194,195 Ethernet49/1 40000 49 -Ethernet196 196,197,198,199 Ethernet50/1 40000 50 -Ethernet200 200,201,202,203 Ethernet51/1 40000 51 -Ethernet204 204,205,206,207 Ethernet52/1 40000 52 -Ethernet208 208,209,210,211 Ethernet53/1 40000 53 -Ethernet212 212,213,214,215 Ethernet54/1 40000 54 -Ethernet216 216,217,218,219 Ethernet55/1 40000 55 -Ethernet220 220,221,222,223 Ethernet56/1 40000 56 -Ethernet224 224,225,226,227 Ethernet57/1 40000 57 -Ethernet228 228,229,230,231 Ethernet58/1 40000 58 -Ethernet232 232,233,234,235 Ethernet59/1 40000 59 -Ethernet236 236,237,238,239 Ethernet60/1 40000 60 -Ethernet240 240,241,242,243 Ethernet61/1 40000 61 -Ethernet244 244,245,246,247 Ethernet62/1 40000 62 -Ethernet248 248,249,250,251 Ethernet63/1 40000 63 -Ethernet252 252,253,254,255 Ethernet64/1 40000 64 +# name lanes alias speed index autoneg +Ethernet0 0,1,2,3 Ethernet1/1 40000 1 0 +Ethernet4 4,5,6,7 Ethernet2/1 40000 2 0 +Ethernet8 8,9,10,11 Ethernet3/1 40000 3 0 +Ethernet12 12,13,14,15 Ethernet4/1 40000 4 0 +Ethernet16 16,17,18,19 Ethernet5/1 40000 5 0 +Ethernet20 20,21,22,23 Ethernet6/1 40000 6 0 +Ethernet24 24,25,26,27 Ethernet7/1 40000 7 0 +Ethernet28 28,29,30,31 Ethernet8/1 40000 8 0 +Ethernet32 32,33,34,35 Ethernet9/1 40000 9 1 +Ethernet36 36,37,38,39 Ethernet10/1 40000 10 1 +Ethernet40 40,41,42,43 Ethernet11/1 40000 11 1 +Ethernet44 44,45,46,47 Ethernet12/1 40000 12 1 +Ethernet48 48,49,50,51 Ethernet13/1 40000 13 1 +Ethernet52 52,53,54,55 Ethernet14/1 40000 14 1 +Ethernet56 56,57,58,59 Ethernet15/1 40000 15 1 +Ethernet60 60,61,62,63 Ethernet16/1 40000 16 1 +Ethernet64 64,65,66,67 Ethernet17/1 40000 17 1 +Ethernet68 68,69,70,71 Ethernet18/1 40000 18 1 +Ethernet72 72,73,74,75 Ethernet19/1 40000 19 1 +Ethernet76 76,77,78,79 Ethernet20/1 40000 20 1 +Ethernet80 80 Ethernet21/1 10000 21 0 +Ethernet81 81 Ethernet21/2 10000 21 0 +Ethernet82 82 Ethernet21/3 10000 21 0 +Ethernet83 83 Ethernet21/4 10000 21 0 +Ethernet84 84 Ethernet22/1 10000 22 0 +Ethernet85 85 Ethernet22/2 10000 22 0 +Ethernet86 86 Ethernet22/3 10000 22 0 +Ethernet87 87 Ethernet22/4 10000 22 0 +Ethernet88 88,89,90,91 Ethernet23/1 40000 23 0 +Ethernet92 92,93,94,95 Ethernet24/1 40000 24 0 +Ethernet96 96,97,98,99 Ethernet25/1 40000 25 0 +Ethernet100 100,101,102,103 Ethernet26/1 40000 26 0 +Ethernet104 104,105,106,107 Ethernet27/1 40000 27 0 +Ethernet108 108,109,110,111 Ethernet28/1 40000 28 0 +Ethernet112 112,113,114,115 Ethernet29/1 40000 29 0 +Ethernet116 116,117,118,119 Ethernet30/1 40000 30 0 +Ethernet120 120,121,122,123 Ethernet31/1 40000 31 0 +Ethernet124 124,125,126,127 Ethernet32/1 40000 32 0 +Ethernet128 128 Ethernet33/1 10000 33 0 +Ethernet129 129 Ethernet33/2 10000 33 0 +Ethernet130 130 Ethernet33/3 10000 33 0 +Ethernet131 131 Ethernet33/4 10000 33 0 +Ethernet132 132 Ethernet34/1 10000 34 0 +Ethernet133 133 Ethernet34/2 10000 34 0 +Ethernet134 134 Ethernet34/3 10000 34 0 +Ethernet135 135 Ethernet34/4 10000 34 0 +Ethernet136 136 Ethernet35/1 10000 35 0 +Ethernet137 137 Ethernet35/2 10000 35 0 +Ethernet138 138 Ethernet35/3 10000 35 0 +Ethernet139 139 Ethernet35/4 10000 35 0 +Ethernet140 140,141,142,143 Ethernet36/1 40000 36 0 +Ethernet144 144,145,146,147 Ethernet37/1 40000 37 0 +Ethernet148 148,149,150,151 Ethernet38/1 40000 38 0 +Ethernet152 152,153,154,155 Ethernet39/1 40000 39 0 +Ethernet156 156,157,158,159 Ethernet40/1 40000 40 0 +Ethernet160 160,161,162,163 Ethernet41/1 40000 41 1 +Ethernet164 164,165,166,167 Ethernet42/1 40000 42 1 +Ethernet168 168,169,170,171 Ethernet43/1 40000 43 1 +Ethernet172 172,173,174,175 Ethernet44/1 40000 44 1 +Ethernet176 176,177,178,179 Ethernet45/1 40000 45 1 +Ethernet180 180,181,182,183 Ethernet46/1 40000 46 1 +Ethernet184 184,185,186,187 Ethernet47/1 40000 47 1 +Ethernet188 188,189,190,191 Ethernet48/1 40000 48 1 +Ethernet192 192,193,194,195 Ethernet49/1 40000 49 1 +Ethernet196 196,197,198,199 Ethernet50/1 40000 50 1 +Ethernet200 200,201,202,203 Ethernet51/1 40000 51 1 +Ethernet204 204,205,206,207 Ethernet52/1 40000 52 1 +Ethernet208 208,209,210,211 Ethernet53/1 40000 53 1 +Ethernet212 212,213,214,215 Ethernet54/1 40000 54 1 +Ethernet216 216,217,218,219 Ethernet55/1 40000 55 1 +Ethernet220 220,221,222,223 Ethernet56/1 40000 56 1 +Ethernet224 224,225,226,227 Ethernet57/1 40000 57 1 +Ethernet228 228,229,230,231 Ethernet58/1 40000 58 1 +Ethernet232 232,233,234,235 Ethernet59/1 40000 59 1 +Ethernet236 236,237,238,239 Ethernet60/1 40000 60 1 +Ethernet240 240,241,242,243 Ethernet61/1 40000 61 1 +Ethernet244 244,245,246,247 Ethernet62/1 40000 62 1 +Ethernet248 248,249,250,251 Ethernet63/1 40000 63 1 +Ethernet252 252,253,254,255 Ethernet64/1 40000 64 1 diff --git a/device/mellanox/x86_64-mlnx_lssn2700-r0/platform_wait b/device/mellanox/x86_64-mlnx_lssn2700-r0/platform_wait new file mode 120000 index 000000000000..4b30bd429854 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_lssn2700-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-mlnx_msn2010-r0/platform_wait b/device/mellanox/x86_64-mlnx_msn2010-r0/platform_wait new file mode 120000 index 000000000000..4b30bd429854 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2010-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-mlnx_msn2010-r0/plugins/psuutil.py b/device/mellanox/x86_64-mlnx_msn2010-r0/plugins/psuutil.py index 914ef050d2c7..a51a9b07292c 100644 --- a/device/mellanox/x86_64-mlnx_msn2010-r0/plugins/psuutil.py +++ b/device/mellanox/x86_64-mlnx_msn2010-r0/plugins/psuutil.py @@ -20,14 +20,10 @@ class PsuUtil(PsuBase): def __init__(self): PsuBase.__init__(self) - self.psu_path = "" - for index in range(0, 100): - hwmon_path = "/sys/devices/platform/mlxplat/mlxreg-hotplug/hwmon/hwmon{}/".format(index) - if os.path.exists(hwmon_path): - self.psu_path = hwmon_path - break - self.psu_presence = "pwr{}" - self.psu_oper_status = "pwr{}" + + self.psu_path = "/var/run/hw-management/thermal/" + self.psu_presence = "psu{}_pwr_status" + self.psu_oper_status = "psu{}_pwr_status" def get_num_psus(self): """ diff --git a/device/mellanox/x86_64-mlnx_msn2010-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn2010-r0/sensors.conf index 170b0371fb0d..3b68f775df2d 100644 --- a/device/mellanox/x86_64-mlnx_msn2010-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn2010-r0/sensors.conf @@ -17,3 +17,76 @@ chip "tps53679-*" label pout2 "TPS pout2" label iout1 "TPS iout1" label iout2 "TPS iout2" + +chip "mlxsw-*" + 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 + +chip "*-virtual-*" + ignore temp1 + ignore temp2 + +chip "dps460-*" + ignore fan2 + ignore fan3 diff --git a/device/mellanox/x86_64-mlnx_msn2100-r0/platform_wait b/device/mellanox/x86_64-mlnx_msn2100-r0/platform_wait new file mode 120000 index 000000000000..4b30bd429854 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2100-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-mlnx_msn2100-r0/plugins/psuutil.py b/device/mellanox/x86_64-mlnx_msn2100-r0/plugins/psuutil.py index b9bb580d7c57..b14b1d9dac4d 100644 --- a/device/mellanox/x86_64-mlnx_msn2100-r0/plugins/psuutil.py +++ b/device/mellanox/x86_64-mlnx_msn2100-r0/plugins/psuutil.py @@ -21,14 +21,9 @@ class PsuUtil(PsuBase): def __init__(self): PsuBase.__init__(self) - self.psu_path = "" - for index in range(0, 100): - hwmon_path = "/sys/devices/platform/mlxplat/mlxreg-hotplug/hwmon/hwmon{}/".format(index) - if os.path.exists(hwmon_path): - self.psu_path = hwmon_path - break - self.psu_presence = "pwr{}" - self.psu_oper_status = "pwr{}" + self.psu_path = "/var/run/hw-management/thermal/" + self.psu_presence = "psu{}_status" + self.psu_oper_status = "psu{}_pwr_status" def get_num_psus(self): """ diff --git a/device/mellanox/x86_64-mlnx_msn2410-r0/platform_wait b/device/mellanox/x86_64-mlnx_msn2410-r0/platform_wait new file mode 120000 index 000000000000..4b30bd429854 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2410-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-mlnx_msn2410-r0/plugins/psuutil.py b/device/mellanox/x86_64-mlnx_msn2410-r0/plugins/psuutil.py index 954045dde59c..f3cce52b12aa 100644 --- a/device/mellanox/x86_64-mlnx_msn2410-r0/plugins/psuutil.py +++ b/device/mellanox/x86_64-mlnx_msn2410-r0/plugins/psuutil.py @@ -21,14 +21,9 @@ class PsuUtil(PsuBase): def __init__(self): PsuBase.__init__(self) - self.psu_path = "" - for index in range(0, 100): - hwmon_path = "/sys/devices/platform/mlxplat/mlxreg-hotplug/hwmon/hwmon{}/".format(index) - if os.path.exists(hwmon_path): - self.psu_path = hwmon_path - break - self.psu_presence = "psu{}" - self.psu_oper_status = "pwr{}" + self.psu_path = "/var/run/hw-management/thermal/" + self.psu_presence = "psu{}_status" + self.psu_oper_status = "psu{}_pwr_status" def get_num_psus(self): """ diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/platform_wait b/device/mellanox/x86_64-mlnx_msn2700-r0/platform_wait new file mode 100755 index 000000000000..44321184dccc --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/platform_wait @@ -0,0 +1,40 @@ +#!/bin/bash + +declare -r EXIT_SUCCESS="0" +declare -r EXIT_TIMEOUT="1" + +declare -r QSFP_PATH="/var/run/hw-management/qsfp" + +function WaitForQsfpReady() { + local -r _QSFP_PATH="${1}" + + local -i _WDOG_CNT="1" + local -ir _WDOG_MAX="300" + + local -r _TIMEOUT="1s" + + while [[ "${_WDOG_CNT}" -le "${_WDOG_MAX}" ]]; do + for _QSFP in ${_QSFP_PATH}/qsfp*; do + if [[ -e "${_QSFP}" ]]; then + return "${EXIT_SUCCESS}" + fi + done + + let "_WDOG_CNT++" + sleep "${_TIMEOUT}" + done + + return "${EXIT_TIMEOUT}" +} + +echo "Wait for QSFP I2C interface is ready" + +WaitForQsfpReady "${QSFP_PATH}" +EXIT_CODE="$?" +if [[ "${EXIT_CODE}" != "${EXIT_SUCCESS}" ]]; then + echo "QSFP I2C interface is not ready: timeout" + exit "${EXIT_CODE}" +fi + +echo "QSFP I2C interface is ready: mlxsw_minimal has finished initialization" +exit "${EXIT_SUCCESS}" diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/eeprom.py b/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/eeprom.py index 3d7e8d0556d5..63303c13a244 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/eeprom.py +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/eeprom.py @@ -26,7 +26,7 @@ raise ImportError (str(e) + "- required module not found") SYSLOG_IDENTIFIER = "eeprom.py" -EEPROM_SYMLINK = "/bsp/eeprom/vpd_info" +EEPROM_SYMLINK = "/var/run/hw-management/eeprom/vpd_info" CACHE_FILE = "/var/cache/sonic/decode-syseeprom/syseeprom_cache" def log_error(msg): diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/psuutil.py b/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/psuutil.py index 954045dde59c..f3cce52b12aa 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/psuutil.py +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/psuutil.py @@ -21,14 +21,9 @@ class PsuUtil(PsuBase): def __init__(self): PsuBase.__init__(self) - self.psu_path = "" - for index in range(0, 100): - hwmon_path = "/sys/devices/platform/mlxplat/mlxreg-hotplug/hwmon/hwmon{}/".format(index) - if os.path.exists(hwmon_path): - self.psu_path = hwmon_path - break - self.psu_presence = "psu{}" - self.psu_oper_status = "pwr{}" + self.psu_path = "/var/run/hw-management/thermal/" + self.psu_presence = "psu{}_status" + self.psu_oper_status = "psu{}_pwr_status" def get_num_psus(self): """ diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfputil.py b/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfputil.py index 34f285bf7c63..2a69cb63a709 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfputil.py +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfputil.py @@ -22,7 +22,7 @@ # magic code defnition for port number, qsfp port position of each hwsku # port_position_tuple = (PORT_START, QSFP_PORT_START, PORT_END, PORT_IN_BLOCK, EEPROM_OFFSET) -hwsku_dict = {'ACS-MSN2700': 0, "LS-SN2700":0, 'ACS-MSN2740': 0, 'ACS-MSN2100': 1, 'ACS-MSN2410': 2, 'ACS-MSN2010': 3, 'ACS-MSN3700': 0, 'ACS-MSN3700C': 0} +hwsku_dict = {'ACS-MSN2700': 0, "LS-SN2700":0, 'ACS-MSN2740': 0, 'ACS-MSN2100': 1, 'ACS-MSN2410': 2, 'ACS-MSN2010': 3, 'ACS-MSN3700': 0, 'ACS-MSN3700C': 0, 'Mellanox-SN2700': 0, 'Mellanox-SN2700-D48C8': 0} port_position_tuple_list = [(0, 0, 31, 32, 1), (0, 0, 15, 16, 1), (0, 48, 55, 56, 1),(0, 18, 21, 22, 1)] class SfpUtil(SfpUtilBase): @@ -41,7 +41,7 @@ class SfpUtil(SfpUtilBase): db_sel_tbl = None state_db = None sfpd_status_tbl = None - qsfp_sysfs_path = "/sys/devices/platform/i2c_mlxcpld.1/i2c-1/i2c-2/2-0048/" + qsfp_sysfs_path = "/var/run/hw-management/qsfp/" @property def port_start(self): diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn2700-r0/sensors.conf index a3e30391863e..247db54f99d8 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/sensors.conf @@ -19,3 +19,77 @@ chip "ucd9200-i2c-5-41" bus "i2c-17" "i2c-1-mux (chan_id 7)" chip "lm75-i2c-17-49" label temp1 "Ambient Board Temp" + +chip "mlxsw-*" + 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 + +chip "*-virtual-*" + ignore temp1 + ignore temp2 + +chip "dps460-*" + ignore fan2 + ignore fan3 + diff --git a/device/mellanox/x86_64-mlnx_msn2740-r0/platform_wait b/device/mellanox/x86_64-mlnx_msn2740-r0/platform_wait new file mode 120000 index 000000000000..4b30bd429854 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2740-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-mlnx_msn2740-r0/plugins/psuutil.py b/device/mellanox/x86_64-mlnx_msn2740-r0/plugins/psuutil.py index 8c47a0083249..f3cce52b12aa 100644 --- a/device/mellanox/x86_64-mlnx_msn2740-r0/plugins/psuutil.py +++ b/device/mellanox/x86_64-mlnx_msn2740-r0/plugins/psuutil.py @@ -20,14 +20,10 @@ class PsuUtil(PsuBase): def __init__(self): PsuBase.__init__(self) - self.psu_path = "" - for index in range(0, 100): - hwmon_path = "/sys/devices/platform/mlxplat/mlxreg-hotplug/hwmon/hwmon{}/".format(index) - if os.path.exists(hwmon_path): - self.psu_path = hwmon_path - break - self.psu_presence = "psu{}" - self.psu_oper_status = "pwr{}" + + self.psu_path = "/var/run/hw-management/thermal/" + self.psu_presence = "psu{}_status" + self.psu_oper_status = "psu{}_pwr_status" def get_num_psus(self): """ diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/platform_wait b/device/mellanox/x86_64-mlnx_msn3700-r0/platform_wait new file mode 120000 index 000000000000..4b30bd429854 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700-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-mlnx_msn3700-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn3700-r0/sensors.conf index 592964d75c52..376d079390a6 100644 --- a/device/mellanox/x86_64-mlnx_msn3700-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/sensors.conf @@ -1,7 +1,7 @@ ################################################################################ # Copyright (c) 2019 Mellanox Technologies # -# Platform specific sensors config for MSN3700 +# Platform specific sensors config for SN3700 ################################################################################ # Temperature sensors @@ -15,6 +15,10 @@ bus "i2c-7" "i2c-1-mux (chan_id 6)" chip "tmp102-i2c-*-4a" label temp1 "Ambient Port Side Temp (air exhaust)" +bus "i2c-15" "i2c-1-mux (chan_id 6)" + chip "tmp102-i2c-15-49" + label temp1 "Ambient COMEX Temp" + # Power controllers bus "i2c-5" "i2c-1-mux (chan_id 4)" chip "tps53679-i2c-*-70" @@ -30,6 +34,7 @@ bus "i2c-5" "i2c-1-mux (chan_id 4)" chip "tps53679-i2c-*-71" label in1 "PMIC-2 PSU 12V Rail (in)" label in2 "PMIC-2 ASIC 3.3V Rail (out)" + compute in2 (1.5)*@, @/(1.5) label in3 "PMIC-2 ASIC 1.8V Rail (out)" label temp1 "PMIC-2 Temp 1" label temp2 "PMIC-2 Temp 2" @@ -38,6 +43,28 @@ bus "i2c-5" "i2c-1-mux (chan_id 4)" label curr1 "PMIC-2 ASIC 3.3V Rail Curr (out)" label curr2 "PMIC-2 ASIC 1.8V Rail Curr (out)" +bus "i2c-15" "i2c-1-mux (chan_id 6)" + chip "tps53679-i2c-*-58" + label in1 "PMIC-3 PSU 12V Rail (in)" + label in2 "PMIC-3 COMEX 1.8V Rail (out)" + label in3 "PMIC-3 COMEX 1.05V Rail (out)" + label temp1 "PMIC-3 Temp 1" + label temp2 "PMIC-3 Temp 2" + label power1 "PMIC-3 COMEX 1.8V Rail Pwr (out)" + label power2 "PMIC-3 COMEX 1.05V Rail Pwr (out)" + label curr1 "PMIC-3 COMEX 1.8V Rail Curr (out)" + label curr2 "PMIC-3 COMEX 1.05V Rail Curr (out)" + chip "tps53679-i2c-*-61" + label in1 "PMIC-4 PSU 12V Rail (in)" + label in2 "PMIC-4 COMEX 1.2V Rail (out)" + ignore in3 + label temp1 "PMIC-4 Temp 1" + label temp2 "PMIC-4 Temp 2" + label power1 "PMIC-4 COMEX 1.2V Rail Pwr (out)" + ignore power2 + label curr1 "PMIC-4 COMEX 1.2V Rail Curr (out)" + ignore curr2 + # Power supplies bus "i2c-4" "i2c-1-mux (chan_id 3)" chip "dps460-i2c-*-58" diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/platform_wait b/device/mellanox/x86_64-mlnx_msn3700c-r0/platform_wait new file mode 120000 index 000000000000..4b30bd429854 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700c-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-mlnx_msn3700c-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors.conf index 1570ac30b68f..7efcefc5f740 100644 --- a/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors.conf @@ -1,7 +1,7 @@ ################################################################################ # Copyright (c) 2019 Mellanox Technologies # -# Platform specific sensors config for MSN3700C +# Platform specific sensors config for SN3700C ################################################################################ # Temperature sensors @@ -15,6 +15,10 @@ bus "i2c-7" "i2c-1-mux (chan_id 6)" chip "tmp102-i2c-*-4a" label temp1 "Ambient Port Side Temp (air exhaust)" +bus "i2c-15" "i2c-1-mux (chan_id 6)" + chip "tmp102-i2c-15-49" + label temp1 "Ambient COMEX Temp" + # Power controllers bus "i2c-5" "i2c-1-mux (chan_id 4)" chip "tps53679-i2c-*-70" @@ -30,6 +34,7 @@ bus "i2c-5" "i2c-1-mux (chan_id 4)" chip "tps53679-i2c-*-71" label in1 "PMIC-2 PSU 12V Rail (in)" label in2 "PMIC-2 ASIC 3.3V Rail (out)" + compute in2 (1.5)*@, @/(1.5) label in3 "PMIC-2 ASIC 1.8V Rail (out)" label temp1 "PMIC-2 Temp 1" label temp2 "PMIC-2 Temp 2" @@ -38,6 +43,28 @@ bus "i2c-5" "i2c-1-mux (chan_id 4)" label curr1 "PMIC-2 ASIC 3.3V Rail Curr (out)" label curr2 "PMIC-2 ASIC 1.8V Rail Curr (out)" +bus "i2c-15" "i2c-1-mux (chan_id 6)" + chip "tps53679-i2c-*-58" + label in1 "PMIC-3 PSU 12V Rail (in)" + label in2 "PMIC-3 COMEX 1.8V Rail (out)" + label in3 "PMIC-3 COMEX 1.05V Rail (out)" + label temp1 "PMIC-3 Temp 1" + label temp2 "PMIC-3 Temp 2" + label power1 "PMIC-3 COMEX 1.8V Rail Pwr (out)" + label power2 "PMIC-3 COMEX 1.05V Rail Pwr (out)" + label curr1 "PMIC-3 COMEX 1.8V Rail Curr (out)" + label curr2 "PMIC-3 COMEX 1.05V Rail Curr (out)" + chip "tps53679-i2c-*-61" + label in1 "PMIC-4 PSU 12V Rail (in)" + label in2 "PMIC-4 COMEX 1.2V Rail (out)" + ignore in3 + label temp1 "PMIC-4 Temp 1" + label temp2 "PMIC-4 Temp 2" + label power1 "PMIC-4 COMEX 1.2V Rail Pwr (out)" + ignore power2 + label curr1 "PMIC-4 COMEX 1.2V Rail Curr (out)" + ignore curr2 + # Power supplies bus "i2c-4" "i2c-1-mux (chan_id 3)" chip "dps460-i2c-*-58" @@ -79,10 +106,6 @@ chip "mlxreg_fan-isa-*" label fan6 "Chassis Fan Drawer-3 Tach 2" label fan7 "Chassis Fan Drawer-4 Tach 1" label fan8 "Chassis Fan Drawer-4 Tach 2" - ignore fan9 - ignore fan10 - ignore fan11 - ignore fan12 # Miscellaneous chip "*-virtual-*" diff --git a/dockers/docker-platform-monitor/start.sh b/dockers/docker-platform-monitor/start.sh index 18541b80fe18..4744110c66b2 100755 --- a/dockers/docker-platform-monitor/start.sh +++ b/dockers/docker-platform-monitor/start.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +declare -r EXIT_SUCCESS="0" + mkdir -p /var/sonic echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status @@ -7,6 +9,16 @@ rm -f /var/run/rsyslogd.pid supervisorctl start rsyslogd +# If this platform has synchronization script, run it +if [ -e /usr/share/sonic/platform/platform_wait ]; then + /usr/share/sonic/platform/platform_wait + EXIT_CODE="$?" + if [ "${EXIT_CODE}" != "${EXIT_SUCCESS}" ]; then + supervisorctl shutdown + exit "${EXIT_CODE}" + fi +fi + # If this platform has an lm-sensors config file, copy it to it's proper place # and start lm-sensors if [ -e /usr/share/sonic/platform/sensors.conf ]; then diff --git a/dockers/docker-ptf/Dockerfile.j2 b/dockers/docker-ptf/Dockerfile.j2 index 2d9b1544d95a..89460f079811 100644 --- a/dockers/docker-ptf/Dockerfile.j2 +++ b/dockers/docker-ptf/Dockerfile.j2 @@ -35,6 +35,7 @@ RUN sed --in-place 's/httpredir.debian.org/debian-archive.trafficmanager.net/' / cmake \ libqt5core5a \ libqt5network5 \ + libboost-atomic1.55.0 \ less \ git \ iputils-ping \ @@ -43,7 +44,8 @@ RUN sed --in-place 's/httpredir.debian.org/debian-archive.trafficmanager.net/' / tcpdump \ python \ python-dev \ - python-scapy + python-scapy \ + python-six RUN dpkg -i \ {% for deb in docker_ptf_debs.split(' ') -%} diff --git a/files/build_templates/bgp.service.j2 b/files/build_templates/bgp.service.j2 index bc023b7d714d..7200a0e3ecf2 100644 --- a/files/build_templates/bgp.service.j2 +++ b/files/build_templates/bgp.service.j2 @@ -7,7 +7,7 @@ Before=ntp-config.service [Service] User={{ sonicadmin_user }} ExecStartPre=/usr/bin/{{docker_container_name}}.sh start -ExecStart=/usr/bin/{{docker_container_name}}.sh attach +ExecStart=/usr/bin/{{docker_container_name}}.sh wait ExecStop=/usr/bin/{{docker_container_name}}.sh stop [Install] diff --git a/files/build_templates/buffers_config.j2 b/files/build_templates/buffers_config.j2 index 44b5a340fab8..95830cd01a89 100644 --- a/files/build_templates/buffers_config.j2 +++ b/files/build_templates/buffers_config.j2 @@ -29,12 +29,16 @@ def {# Port configuration to cable length look-up table #} {# Each record describes mapping of DUT (DUT port) role and neighbor role to cable length #} {# Roles described in the minigraph #} -{%- set ports2cable = { - 'torrouter_server' : '5m', - 'leafrouter_torrouter' : '40m', - 'spinerouter_leafrouter' : '300m' - } --%} +{%- if defs.ports2cable is defined %} + {%- set ports2cable = defs.ports2cable %} +{%- else %} + {%- set ports2cable = { + 'torrouter_server' : '5m', + 'leafrouter_torrouter' : '40m', + 'spinerouter_leafrouter' : '300m' + } + -%} +{%- endif %} {%- macro cable_length(port_name) %} {%- set cable_len = [] %} @@ -127,10 +131,7 @@ def {{ defs.generate_pg_profils(port_names_active) }} {% else %} "BUFFER_PG": { - "{{ port_names_active }}|0-2": { - "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" - }, - "{{ port_names_active }}|5-6": { + "{{ port_names_active }}|0": { "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" } }, diff --git a/files/build_templates/database.service.j2 b/files/build_templates/database.service.j2 index b248dfc7fecd..efa98b168beb 100644 --- a/files/build_templates/database.service.j2 +++ b/files/build_templates/database.service.j2 @@ -6,7 +6,7 @@ After=docker.service [Service] User=root ExecStartPre=/usr/bin/{{docker_container_name}}.sh start -ExecStart=/usr/bin/{{docker_container_name}}.sh attach +ExecStart=/usr/bin/{{docker_container_name}}.sh wait ExecStop=/usr/bin/{{docker_container_name}}.sh stop [Install] diff --git a/files/build_templates/dhcp_relay.service.j2 b/files/build_templates/dhcp_relay.service.j2 index b4d9ceb38f0c..5a462e53973d 100644 --- a/files/build_templates/dhcp_relay.service.j2 +++ b/files/build_templates/dhcp_relay.service.j2 @@ -7,7 +7,7 @@ Before=ntp-config.service [Service] User={{ sonicadmin_user }} ExecStartPre=/usr/bin/{{ docker_container_name }}.sh start -ExecStart=/usr/bin/{{ docker_container_name }}.sh attach +ExecStart=/usr/bin/{{ docker_container_name }}.sh wait ExecStop=/usr/bin/{{ docker_container_name }}.sh stop [Install] diff --git a/files/build_templates/docker_image_ctl.j2 b/files/build_templates/docker_image_ctl.j2 index a3cbf5adbae7..1676e4624a8e 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -126,12 +126,17 @@ start() { {%- if '--log-driver=json-file' in docker_image_run_opt or '--log-driver' not in docker_image_run_opt %} --log-opt max-size=2M --log-opt max-file=5 \ {%- endif %} -{%- if docker_container_name == "syncd" and sonic_asic_platform == "mellanox" %} +{%- if sonic_asic_platform == "mellanox" %} +{%- if docker_container_name == "syncd" %} -e SX_SNIFFER_ENABLE \ -e SX_SNIFFER_TARGET \ -e PRM_SNIFFER \ -e PRM_SNIFFER_FILE_PATH \ -v /var/log/mellanox/sniffer:/var/log/mellanox/sniffer:rw \ +{%- endif %} +{%- if docker_container_name == "pmon" %} + -v /var/run/hw-management:/var/run/hw-management:rw \ +{%- endif %} {%- endif %} -v /var/run/redis:/var/run/redis:rw \ -v /usr/share/sonic/device/$PLATFORM:/usr/share/sonic/platform:ro \ @@ -150,8 +155,8 @@ start() { postStartAction } -attach() { - docker attach --no-stdin {{docker_container_name}} +wait() { + docker wait {{docker_container_name}} } stop() { @@ -159,11 +164,11 @@ stop() { } case "$1" in - start|stop|attach) + start|wait|stop) $1 ;; *) - echo "Usage: $0 {start|stop|attach}" + echo "Usage: $0 {start|wait|stop}" exit 1 ;; esac diff --git a/files/build_templates/lldp.service.j2 b/files/build_templates/lldp.service.j2 index d294a08900f4..c317e18efc5c 100644 --- a/files/build_templates/lldp.service.j2 +++ b/files/build_templates/lldp.service.j2 @@ -7,7 +7,7 @@ Before=ntp-config.service [Service] User={{ sonicadmin_user }} ExecStartPre=/usr/bin/{{docker_container_name}}.sh start -ExecStart=/usr/bin/{{docker_container_name}}.sh attach +ExecStart=/usr/bin/{{docker_container_name}}.sh wait ExecStop=/usr/bin/{{docker_container_name}}.sh stop [Install] diff --git a/files/build_templates/pmon.service.j2 b/files/build_templates/pmon.service.j2 index de4e62df5e10..33f3173b4887 100644 --- a/files/build_templates/pmon.service.j2 +++ b/files/build_templates/pmon.service.j2 @@ -7,7 +7,7 @@ Before=ntp-config.service [Service] User={{ sonicadmin_user }} ExecStartPre=/usr/bin/{{docker_container_name}}.sh start -ExecStart=/usr/bin/{{docker_container_name}}.sh attach +ExecStart=/usr/bin/{{docker_container_name}}.sh wait ExecStop=/usr/bin/{{docker_container_name}}.sh stop [Install] diff --git a/files/build_templates/qos_config.j2 b/files/build_templates/qos_config.j2 index 18d12d473941..a666367873bd 100644 --- a/files/build_templates/qos_config.j2 +++ b/files/build_templates/qos_config.j2 @@ -38,12 +38,12 @@ "TC_TO_PRIORITY_GROUP_MAP": { "AZURE": { "0": "0", - "1": "1", - "2": "2", + "1": "0", + "2": "0", "3": "3", "4": "4", - "5": "5", - "6": "6", + "5": "0", + "6": "0", "7": "7" } }, diff --git a/files/build_templates/radv.service.j2 b/files/build_templates/radv.service.j2 index 065f01906076..8cda2fdd0afb 100644 --- a/files/build_templates/radv.service.j2 +++ b/files/build_templates/radv.service.j2 @@ -7,7 +7,7 @@ Before=ntp-config.service [Service] User={{ sonicadmin_user }} ExecStartPre=/usr/bin/{{ docker_container_name }}.sh start -ExecStart=/usr/bin/{{ docker_container_name }}.sh attach +ExecStart=/usr/bin/{{ docker_container_name }}.sh wait ExecStop=/usr/bin/{{ docker_container_name }}.sh stop [Install] diff --git a/files/build_templates/snmp.service.j2 b/files/build_templates/snmp.service.j2 index f344f2e805ea..b00c2107702c 100644 --- a/files/build_templates/snmp.service.j2 +++ b/files/build_templates/snmp.service.j2 @@ -6,5 +6,5 @@ Before=ntp-config.service [Service] ExecStartPre=/usr/bin/{{docker_container_name}}.sh start -ExecStart=/usr/bin/{{docker_container_name}}.sh attach +ExecStart=/usr/bin/{{docker_container_name}}.sh wait ExecStop=/usr/bin/{{docker_container_name}}.sh stop diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 0782ff1dc593..43d44dbd8103 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -165,6 +165,7 @@ sudo cp $IMAGE_CONFIGS/interfaces/*.j2 $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATE # Copy initial interfaces configuration file, will be overwritten on first boot sudo cp $IMAGE_CONFIGS/interfaces/init_interfaces $FILESYSTEM_ROOT/etc/network/interfaces +sudo mkdir -p $FILESYSTEM_ROOT/etc/network/interfaces.d # Copy hostcfgd files sudo cp $IMAGE_CONFIGS/hostcfgd/hostcfgd.service $FILESYSTEM_ROOT/etc/systemd/system/ diff --git a/files/build_templates/swss.service.j2 b/files/build_templates/swss.service.j2 index 8bbdc8f32997..b391f95de52d 100644 --- a/files/build_templates/swss.service.j2 +++ b/files/build_templates/swss.service.j2 @@ -14,7 +14,7 @@ Before=ntp-config.service User=root Environment=sonic_asic_platform={{ sonic_asic_platform }} ExecStartPre=/usr/local/bin/swss.sh start -ExecStart=/usr/local/bin/swss.sh attach +ExecStart=/usr/local/bin/swss.sh wait ExecStop=/usr/local/bin/swss.sh stop [Install] diff --git a/files/build_templates/syncd.service.j2 b/files/build_templates/syncd.service.j2 index 6fdbed07f819..bc0c40f7ad54 100644 --- a/files/build_templates/syncd.service.j2 +++ b/files/build_templates/syncd.service.j2 @@ -20,7 +20,7 @@ Before=ntp-config.service User=root Environment=sonic_asic_platform={{ sonic_asic_platform }} ExecStartPre=/usr/local/bin/syncd.sh start -ExecStart=/usr/local/bin/syncd.sh attach +ExecStart=/usr/local/bin/syncd.sh wait ExecStop=/usr/local/bin/syncd.sh stop [Install] diff --git a/files/build_templates/teamd.service.j2 b/files/build_templates/teamd.service.j2 index 5cd36c6748b9..792b8247119f 100644 --- a/files/build_templates/teamd.service.j2 +++ b/files/build_templates/teamd.service.j2 @@ -7,7 +7,7 @@ Before=ntp-config.service [Service] User={{ sonicadmin_user }} ExecStartPre=/usr/bin/{{docker_container_name}}.sh start -ExecStart=/usr/bin/{{docker_container_name}}.sh attach +ExecStart=/usr/bin/{{docker_container_name}}.sh wait ExecStop=/usr/bin/{{docker_container_name}}.sh stop [Install] diff --git a/files/build_templates/telemetry.service.j2 b/files/build_templates/telemetry.service.j2 index 132924b04193..d6f70a13206e 100644 --- a/files/build_templates/telemetry.service.j2 +++ b/files/build_templates/telemetry.service.j2 @@ -7,7 +7,7 @@ Before=ntp-config.service [Service] User={{ sonicadmin_user }} ExecStartPre=/usr/bin/{{docker_container_name}}.sh start -ExecStart=/usr/bin/{{docker_container_name}}.sh attach +ExecStart=/usr/bin/{{docker_container_name}}.sh wait ExecStop=/usr/bin/{{docker_container_name}}.sh stop [Install] diff --git a/files/build_templates/updategraph.service.j2 b/files/build_templates/updategraph.service.j2 index e01fd0146f98..8039f42531cd 100644 --- a/files/build_templates/updategraph.service.j2 +++ b/files/build_templates/updategraph.service.j2 @@ -4,7 +4,7 @@ After=rc-local.service After=database.service Requires=database.service {% if sonic_asic_platform == 'mellanox' -%} -Requires=msn-chassis.service +Requires=hw-management.service {% endif -%} diff --git a/files/image_config/interfaces/interfaces-config.sh b/files/image_config/interfaces/interfaces-config.sh index 29664bcda564..a702917419ca 100755 --- a/files/image_config/interfaces/interfaces-config.sh +++ b/files/image_config/interfaces/interfaces-config.sh @@ -4,18 +4,6 @@ ifdown --force eth0 sonic-cfggen -d -t /usr/share/sonic/templates/interfaces.j2 > /etc/network/interfaces -# Add usb0 interface for bfn platforms -platform=$(sonic-cfggen -H -v 'DEVICE_METADATA["localhost"]["platform"]') -if [[ "$platform" == "x86_64-accton_wedge100bf_32x-r0" || "$platform" == "x86_64-accton_wedge100bf_65x-r0" ]]; then -cat <<'EOF' >> /etc/network/interfaces -# BMC interface -auto usb0 -allow-hotplug usb0 -iface usb0 inet6 auto -up ifconfig usb0 txqueuelen 64 -EOF -fi - [ -f /var/run/dhclient.eth0.pid ] && kill `cat /var/run/dhclient.eth0.pid` && rm -f /var/run/dhclient.eth0.pid systemctl restart networking diff --git a/files/image_config/interfaces/interfaces.j2 b/files/image_config/interfaces/interfaces.j2 index e2ee58e9c320..3245d525977d 100644 --- a/files/image_config/interfaces/interfaces.j2 +++ b/files/image_config/interfaces/interfaces.j2 @@ -47,4 +47,6 @@ iface eth0 {{ 'inet' if prefix | ipv4 else 'inet6' }} static iface eth0 inet dhcp {% endif %} # +source /etc/network/interfaces.d/* +# {% endblock mgmt_interface %} diff --git a/files/scripts/swss.sh b/files/scripts/swss.sh index 107a2e81b4b2..780051def9e6 100755 --- a/files/scripts/swss.sh +++ b/files/scripts/swss.sh @@ -115,9 +115,9 @@ start() { unlock_service_state_change } -attach() { +wait() { startPeerService - /usr/bin/${SERVICE}.sh attach + /usr/bin/${SERVICE}.sh wait } stop() { @@ -142,11 +142,11 @@ stop() { } case "$1" in - start|attach|stop) + start|wait|stop) $1 ;; *) - echo "Usage: $0 {start|attach|stop}" + echo "Usage: $0 {start|wait|stop}" exit 1 ;; esac diff --git a/files/scripts/syncd.sh b/files/scripts/syncd.sh index 7e5ce780e072..0aa33add1632 100755 --- a/files/scripts/syncd.sh +++ b/files/scripts/syncd.sh @@ -94,15 +94,28 @@ start() { # start mellanox drivers regardless of # boot type - if [ x"$sonic_asic_platform" == x"mellanox" ]; then + if [[ x"$sonic_asic_platform" == x"mellanox" ]]; then BOOT_TYPE=`getBootType` if [[ x"$WARM_BOOT" == x"true" || x"$BOOT_TYPE" == x"fast" ]]; then export FAST_BOOT=1 fi + + if [[ x"$WARM_BOOT" != x"true" ]]; then + /bin/systemctl stop pmon + /usr/bin/hw-management.sh chipdown + fi + + if [[ x"$BOOT_TYPE" == x"fast" ]]; then + /usr/bin/hw-management.sh chipupdis + fi + /usr/bin/mst start /usr/bin/mlnx-fw-upgrade.sh /etc/init.d/sxdkernel start - /sbin/modprobe i2c-dev + + if [[ x"$WARM_BOOT" != x"true" ]]; then + /bin/systemctl start pmon + fi fi if [[ x"$WARM_BOOT" != x"true" ]]; then @@ -111,16 +124,19 @@ start() { fi fi - # start service docker /usr/bin/${SERVICE}.sh start debug "Started ${SERVICE} service..." + if [[ x"$sonic_asic_platform" == x"mellanox" && x"$BOOT_TYPE" == x"fast" ]]; then + /usr/bin/hw-management.sh chipupen + fi + unlock_service_state_change } -attach() { - /usr/bin/${SERVICE}.sh attach +wait() { + /usr/bin/${SERVICE}.sh wait } stop() { @@ -168,11 +184,11 @@ stop() { } case "$1" in - start|attach|stop) + start|wait|stop) $1 ;; *) - echo "Usage: $0 {start|attach|stop}" + echo "Usage: $0 {start|wait|stop}" exit 1 ;; esac diff --git a/platform/barefoot/bfn-platform.mk b/platform/barefoot/bfn-platform.mk index 7cf482009ade..ca33fb9fa301 100644 --- a/platform/barefoot/bfn-platform.mk +++ b/platform/barefoot/bfn-platform.mk @@ -1,5 +1,5 @@ -BFN_PLATFORM = bfnplatform_master.c7af495.deb -$(BFN_PLATFORM)_URL = "https://github.com/barefootnetworks/sonic-release-pkgs/raw/vxlan_poc/bfnplatform_master.c7af495.deb +BFN_PLATFORM = bfnplatform_master.df38274.deb +$(BFN_PLATFORM)_URL = "https://github.com/barefootnetworks/sonic-release-pkgs/raw/vxlan_poc/bfnplatform_master.df38274.deb" SONIC_ONLINE_DEBS += $(BFN_PLATFORM) # $(BFN_SAI_DEV) $(BFN_SAI_DEV)_DEPENDS += $(BFN_PLATFORM) diff --git a/platform/barefoot/bfn-sai.mk b/platform/barefoot/bfn-sai.mk index 902cb8ddcf58..6b2cee9082e1 100644 --- a/platform/barefoot/bfn-sai.mk +++ b/platform/barefoot/bfn-sai.mk @@ -1,5 +1,5 @@ -BFN_SAI = bfnsdk_master.c7af495.deb -$(BFN_SAI)_URL = "https://github.com/barefootnetworks/sonic-release-pkgs/raw/vxlan_poc/bfnsdk_master.c7af495.deb" +BFN_SAI = bfnsdk_master.df38274.deb +$(BFN_SAI)_URL = "https://github.com/barefootnetworks/sonic-release-pkgs/raw/vxlan_poc/bfnsdk_master.df38274.deb" SONIC_ONLINE_DEBS += $(BFN_SAI) # $(BFN_SAI_DEV) $(BFN_SAI_DEV)_DEPENDS += $(BFN_SAI) diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/configs/network/interfaces.d/usb0 b/platform/barefoot/sonic-platform-modules-bfn-montara/configs/network/interfaces.d/usb0 new file mode 100644 index 000000000000..f1dd054cc6f6 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/configs/network/interfaces.d/usb0 @@ -0,0 +1,5 @@ +# BMC interface +auto usb0 +allow-hotplug usb0 +iface usb0 inet6 +up ifconfig usb0 txqueuelen 64 diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/debian/rules b/platform/barefoot/sonic-platform-modules-bfn-montara/debian/rules index 479f7f489687..972f49ff91d0 100755 --- a/platform/barefoot/sonic-platform-modules-bfn-montara/debian/rules +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/debian/rules @@ -2,6 +2,7 @@ PACKAGE_NAME := sonic-platform-modules-bfn-montara SCRIPT_SRC := $(shell pwd)/scripts +CONFIGS_SRC := $(shell pwd)/configs %: dh $@ @@ -9,6 +10,8 @@ SCRIPT_SRC := $(shell pwd)/scripts override_dh_auto_install: dh_installdirs -p$(PACKAGE_NAME) usr/local/bin cp -r $(SCRIPT_SRC)/* debian/$(PACKAGE_NAME)/usr/local/bin + dh_installdirs -p$(PACKAGE_NAME) etc/network/interfaces.d/ + cp -r $(CONFIGS_SRC)/network/interfaces.d/* debian/$(PACKAGE_NAME)/etc/network/interfaces.d/ override_dh_usrlocal: diff --git a/platform/barefoot/sonic-platform-modules-bfn/configs/network/interfaces.d/usb0 b/platform/barefoot/sonic-platform-modules-bfn/configs/network/interfaces.d/usb0 new file mode 100644 index 000000000000..f1dd054cc6f6 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-bfn/configs/network/interfaces.d/usb0 @@ -0,0 +1,5 @@ +# BMC interface +auto usb0 +allow-hotplug usb0 +iface usb0 inet6 +up ifconfig usb0 txqueuelen 64 diff --git a/platform/barefoot/sonic-platform-modules-bfn/debian/rules b/platform/barefoot/sonic-platform-modules-bfn/debian/rules index 69946c33571e..83cdefe640ba 100755 --- a/platform/barefoot/sonic-platform-modules-bfn/debian/rules +++ b/platform/barefoot/sonic-platform-modules-bfn/debian/rules @@ -2,6 +2,7 @@ PACKAGE_NAME := sonic-platform-modules-bfn SCRIPT_SRC := $(shell pwd)/scripts +CONFIGS_SRC := $(shell pwd)/configs %: dh $@ @@ -9,6 +10,8 @@ SCRIPT_SRC := $(shell pwd)/scripts override_dh_auto_install: dh_installdirs -p$(PACKAGE_NAME) usr/local/bin cp -r $(SCRIPT_SRC)/* debian/$(PACKAGE_NAME)/usr/local/bin + dh_installdirs -p$(PACKAGE_NAME) etc/network/interfaces.d/ + cp -r $(CONFIGS_SRC)/network/interfaces.d/* debian/$(PACKAGE_NAME)/etc/network/interfaces.d/ override_dh_usrlocal: diff --git a/platform/broadcom/rules.mk b/platform/broadcom/rules.mk index 85eb0df51870..b8fb9ff4ac96 100644 --- a/platform/broadcom/rules.mk +++ b/platform/broadcom/rules.mk @@ -22,10 +22,10 @@ include $(PLATFORM_PATH)/libsaithrift-dev.mk include $(PLATFORM_PATH)/docker-ptf-brcm.mk BCMCMD = bcmcmd -$(BCMCMD)_URL = "https://sonicstorage.blob.core.windows.net/packages/20170518/bcmcmd?sv=2015-04-05&sr=b&sig=OCW4mfmbQ6D0BH8nllpAWrS8XL9uczrw32w3XgL4jws%3D&se=2030-03-31T23%3A06%3A15Z&sp=r" +$(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" DSSERVE = dsserve -$(DSSERVE)_URL = "https://sonicstorage.blob.core.windows.net/packages/20170518/dsserve?sv=2015-04-05&sr=b&sig=gyNbgSL%2FvpMXDdpboVkIJcTKMRdGgEaOR9OukHhEsu8%3D&se=2030-03-31T23%3A06%3A35Z&sp=r" +$(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" SONIC_ONLINE_FILES += $(BCMCMD) $(DSSERVE) diff --git a/platform/mellanox/docker-syncd-mlnx-rpc.mk b/platform/mellanox/docker-syncd-mlnx-rpc.mk index 2924796650fd..1c15e61ac742 100644 --- a/platform/mellanox/docker-syncd-mlnx-rpc.mk +++ b/platform/mellanox/docker-syncd-mlnx-rpc.mk @@ -8,6 +8,7 @@ $(DOCKER_SYNCD_MLNX_RPC)_LOAD_DOCKERS += $(DOCKER_SYNCD_MLNX) SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_MLNX_RPC) ifeq ($(ENABLE_SYNCD_RPC),y) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_MLNX_RPC) +SONIC_STRETCH_DOCKERS += $(DOCKER_SYNCD_MLNX_RPC) endif $(DOCKER_SYNCD_MLNX_RPC)_CONTAINER_NAME = syncd diff --git a/platform/mellanox/docker-syncd-mlnx.mk b/platform/mellanox/docker-syncd-mlnx.mk index 5036726f3b60..c7f5dd0c2d41 100644 --- a/platform/mellanox/docker-syncd-mlnx.mk +++ b/platform/mellanox/docker-syncd-mlnx.mk @@ -4,10 +4,11 @@ DOCKER_SYNCD_MLNX = docker-syncd-mlnx.gz $(DOCKER_SYNCD_MLNX)_PATH = $(PLATFORM_PATH)/docker-syncd-mlnx $(DOCKER_SYNCD_MLNX)_DEPENDS += $(SYNCD) $(PYTHON_SDK_API) $(DOCKER_SYNCD_MLNX)_PYTHON_DEBS += $(MLNX_SFPD) -$(DOCKER_SYNCD_MLNX)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE) +$(DOCKER_SYNCD_MLNX)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_MLNX) ifneq ($(ENABLE_SYNCD_RPC),y) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_MLNX) +SONIC_STRETCH_DOCKERS += $(DOCKER_SYNCD_MLNX) endif $(DOCKER_SYNCD_MLNX)_CONTAINER_NAME = syncd diff --git a/platform/mellanox/docker-syncd-mlnx/Dockerfile.j2 b/platform/mellanox/docker-syncd-mlnx/Dockerfile.j2 index ba0e727f0d7a..179a34bb10bf 100755 --- a/platform/mellanox/docker-syncd-mlnx/Dockerfile.j2 +++ b/platform/mellanox/docker-syncd-mlnx/Dockerfile.j2 @@ -1,4 +1,4 @@ -FROM docker-config-engine +FROM docker-config-engine-stretch ARG docker_container_name RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf diff --git a/platform/mellanox/hw-management.mk b/platform/mellanox/hw-management.mk index 10e6bcd76652..4f6df401758a 100644 --- a/platform/mellanox/hw-management.mk +++ b/platform/mellanox/hw-management.mk @@ -1,6 +1,6 @@ # Mellanox HW Management -MLNX_HW_MANAGEMENT_VERSION = 27.09.2018 +MLNX_HW_MANAGEMENT_VERSION = 18.01.2019 export MLNX_HW_MANAGEMENT_VERSION diff --git a/platform/mellanox/hw-management/0001-Suspend-thermal-control-by-default.patch b/platform/mellanox/hw-management/0001-Suspend-thermal-control-by-default.patch new file mode 100644 index 000000000000..c8db79889610 --- /dev/null +++ b/platform/mellanox/hw-management/0001-Suspend-thermal-control-by-default.patch @@ -0,0 +1,51 @@ +From 45587a19ab4b69e5d1ed84d9910a6b89d0fc5520 Mon Sep 17 00:00:00 2001 +From: Kevin Wang +Date: Thu, 10 Jan 2019 07:22:31 +0200 +Subject: [PATCH] Suspend thermal control by default + +Suspend thermal control and set the default fan speed to 60% + +Signed-off-by: Kevin Wang +--- + usr/usr/bin/hw-management-thermal-control.sh | 5 +++-- + usr/usr/bin/hw-management.sh | 1 + + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/usr/usr/bin/hw-management-thermal-control.sh b/usr/usr/bin/hw-management-thermal-control.sh +index c7274a6..4c5438f 100755 +--- a/usr/usr/bin/hw-management-thermal-control.sh ++++ b/usr/usr/bin/hw-management-thermal-control.sh +@@ -116,6 +116,7 @@ max_ports=${5:-$max_ports_def} + # Local constants + pwm_noact=0 + pwm_max=1 ++pwm_def_rpm=153 + pwm_max_rpm=255 + max_amb=120000 + untrusted_sensor=0 +@@ -893,8 +894,8 @@ disable_zones_max_pwm() { + fi + fi + done +- echo $pwm_max_rpm > $pwm +- log_action_msg "Set fan speed to maximum" ++ echo $pwm_def_rpm > $pwm ++ log_action_msg "Set fan speed to 60% percent" + } + + trip_points_num=4 +diff --git a/usr/usr/bin/hw-management.sh b/usr/usr/bin/hw-management.sh +index 9214a9f..c8261a3 100755 +--- a/usr/usr/bin/hw-management.sh ++++ b/usr/usr/bin/hw-management.sh +@@ -565,6 +565,7 @@ do_start() + echo $asic_bus > $config_path/asic_bus + connect_platform + ++ echo 1 > $config_path/suspend + $THERMAL_CONTROL $thermal_type $max_tachos $max_psus& + } + +-- +1.9.1 + diff --git a/platform/mellanox/hw-management/hw-mgmt b/platform/mellanox/hw-management/hw-mgmt index 498002ba528e..ea86fcb7dfab 160000 --- a/platform/mellanox/hw-management/hw-mgmt +++ b/platform/mellanox/hw-management/hw-mgmt @@ -1 +1 @@ -Subproject commit 498002ba528e5633bf1e9b8e488979ed731ca0f6 +Subproject commit ea86fcb7dfab5373cd982a500ac7d0b7db51d318 diff --git a/platform/vs/docker-sonic-vs/orchagent.sh b/platform/vs/docker-sonic-vs/orchagent.sh index 26dae28a6e15..d9bebf117346 100755 --- a/platform/vs/docker-sonic-vs/orchagent.sh +++ b/platform/vs/docker-sonic-vs/orchagent.sh @@ -1,6 +1,10 @@ #!/usr/bin/env bash -export platform=vs +if [[ -z "$fake_platform" ]]; then + export platform=vs +else + export platform=$fake_platform +fi MAC_ADDRESS=`ip link show eth0 | grep ether | awk '{print $2}'` diff --git a/rules/docker-platform-monitor.mk b/rules/docker-platform-monitor.mk index 317bc9b46c5c..a1000849bc76 100644 --- a/rules/docker-platform-monitor.mk +++ b/rules/docker-platform-monitor.mk @@ -7,6 +7,7 @@ $(DOCKER_PLATFORM_MONITOR)_PYTHON_DEBS += $(SONIC_LEDD) $(SONIC_XCVRD) $(SONIC_P $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PLATFORM_COMMON_PY2) $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SWSSSDK_PY2) $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PLATFORM_API_PY2) +$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_DAEMON_BASE_PY2) $(DOCKER_PLATFORM_MONITOR)_LOAD_DOCKERS = $(DOCKER_CONFIG_ENGINE) SONIC_DOCKER_IMAGES += $(DOCKER_PLATFORM_MONITOR) diff --git a/rules/sonic-daemon-base.mk b/rules/sonic-daemon-base.mk new file mode 100644 index 000000000000..dad0900e75ca --- /dev/null +++ b/rules/sonic-daemon-base.mk @@ -0,0 +1,7 @@ +# SONIC_DAEMON_BASE_PY2 package + +SONIC_DAEMON_BASE_PY2 = sonic_daemon_base-1.0-py2-none-any.whl +$(SONIC_DAEMON_BASE_PY2)_SRC_PATH = $(SRC_PATH)/sonic-daemon-base +$(SONIC_DAEMON_BASE_PY2)_PYTHON_VERSION = 2 +SONIC_PYTHON_WHEELS += $(SONIC_DAEMON_BASE_PY2) + diff --git a/rules/thrift.mk b/rules/thrift.mk index 20b01359a1ee..a22a4b76390c 100644 --- a/rules/thrift.mk +++ b/rules/thrift.mk @@ -1,7 +1,7 @@ # thrift package -THRIFT_VERSION = 0.9.3 -THRIFT_VERSION_FULL = $(THRIFT_VERSION)-2 +THRIFT_VERSION = 0.11.0 +THRIFT_VERSION_FULL = $(THRIFT_VERSION)-4 LIBTHRIFT = libthrift-$(THRIFT_VERSION)_$(THRIFT_VERSION_FULL)_amd64.deb $(LIBTHRIFT)_SRC_PATH = $(SRC_PATH)/thrift diff --git a/sonic-slave-stretch/Dockerfile b/sonic-slave-stretch/Dockerfile index 9ab24a8151b2..878c8683a090 100644 --- a/sonic-slave-stretch/Dockerfile +++ b/sonic-slave-stretch/Dockerfile @@ -96,6 +96,7 @@ RUN apt-get update && apt-get install -y \ libslf4j-java \ libservlet3.1-java \ qt5-default \ + pkg-php-tools \ # For mellanox sdk build libpcre3 \ libpcre3-dev \ diff --git a/sonic-slave/Dockerfile b/sonic-slave/Dockerfile index 014df47d46f1..728c3d40f9f5 100644 --- a/sonic-slave/Dockerfile +++ b/sonic-slave/Dockerfile @@ -99,6 +99,7 @@ RUN apt-get update && apt-get install -y \ libslf4j-java \ libservlet3.1-java \ qt5-default \ + pkg-php-tools \ # For mellanox sdk build libpcre3 \ libpcre3-dev \ diff --git a/src/sonic-config-engine/tests/sample_output/buffers-dell6100.json b/src/sonic-config-engine/tests/sample_output/buffers-dell6100.json index 269c155d68f3..0b6c8cbe19a3 100644 --- a/src/sonic-config-engine/tests/sample_output/buffers-dell6100.json +++ b/src/sonic-config-engine/tests/sample_output/buffers-dell6100.json @@ -105,10 +105,7 @@ } }, "BUFFER_PG": { - "Ethernet0,Ethernet1,Ethernet4,Ethernet5,Ethernet6,Ethernet7,Ethernet8,Ethernet9,Ethernet10,Ethernet11,Ethernet12,Ethernet13,Ethernet14,Ethernet15,Ethernet16,Ethernet17,Ethernet20,Ethernet21,Ethernet22,Ethernet23,Ethernet24,Ethernet25,Ethernet26,Ethernet27,Ethernet28,Ethernet29,Ethernet30,Ethernet31,Ethernet32,Ethernet36,Ethernet37,Ethernet38,Ethernet39,Ethernet40,Ethernet41,Ethernet42,Ethernet48,Ethernet52,Ethernet53,Ethernet54,Ethernet55,Ethernet56,Ethernet57,Ethernet58|0-2": { - "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" - }, - "Ethernet0,Ethernet1,Ethernet4,Ethernet5,Ethernet6,Ethernet7,Ethernet8,Ethernet9,Ethernet10,Ethernet11,Ethernet12,Ethernet13,Ethernet14,Ethernet15,Ethernet16,Ethernet17,Ethernet20,Ethernet21,Ethernet22,Ethernet23,Ethernet24,Ethernet25,Ethernet26,Ethernet27,Ethernet28,Ethernet29,Ethernet30,Ethernet31,Ethernet32,Ethernet36,Ethernet37,Ethernet38,Ethernet39,Ethernet40,Ethernet41,Ethernet42,Ethernet48,Ethernet52,Ethernet53,Ethernet54,Ethernet55,Ethernet56,Ethernet57,Ethernet58|5-6": { + "Ethernet0,Ethernet1,Ethernet4,Ethernet5,Ethernet6,Ethernet7,Ethernet8,Ethernet9,Ethernet10,Ethernet11,Ethernet12,Ethernet13,Ethernet14,Ethernet15,Ethernet16,Ethernet17,Ethernet20,Ethernet21,Ethernet22,Ethernet23,Ethernet24,Ethernet25,Ethernet26,Ethernet27,Ethernet28,Ethernet29,Ethernet30,Ethernet31,Ethernet32,Ethernet36,Ethernet37,Ethernet38,Ethernet39,Ethernet40,Ethernet41,Ethernet42,Ethernet48,Ethernet52,Ethernet53,Ethernet54,Ethernet55,Ethernet56,Ethernet57,Ethernet58|0": { "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" } }, diff --git a/src/sonic-config-engine/tests/sample_output/interfaces b/src/sonic-config-engine/tests/sample_output/interfaces index 4e53e2a5189a..7c726b15ea14 100644 --- a/src/sonic-config-engine/tests/sample_output/interfaces +++ b/src/sonic-config-engine/tests/sample_output/interfaces @@ -47,4 +47,6 @@ iface eth0 inet6 static down ip -6 route delete 2603:10e2:0:2902::/64 dev eth0 table default down ip -6 rule delete from 2603:10e2:0:2902::8/128 table default # +source /etc/network/interfaces.d/* +# diff --git a/src/sonic-config-engine/tests/sample_output/qos-dell6100.json b/src/sonic-config-engine/tests/sample_output/qos-dell6100.json index d1eced032f0d..0387e10dc2f2 100644 --- a/src/sonic-config-engine/tests/sample_output/qos-dell6100.json +++ b/src/sonic-config-engine/tests/sample_output/qos-dell6100.json @@ -2,12 +2,12 @@ "TC_TO_PRIORITY_GROUP_MAP": { "AZURE": { "0": "0", - "1": "1", - "2": "2", + "1": "0", + "2": "0", "3": "3", "4": "4", - "5": "5", - "6": "6", + "5": "0", + "6": "0", "7": "7" } }, diff --git a/src/sonic-daemon-base/setup.py b/src/sonic-daemon-base/setup.py new file mode 100644 index 000000000000..397af04b87dc --- /dev/null +++ b/src/sonic-daemon-base/setup.py @@ -0,0 +1,30 @@ +from setuptools import setup + +setup( + name='sonic-daemon-base', + version='1.0', + description='Sonic daemon base package', + license='Apache 2.0', + author='SONiC Team', + author_email='linuxnetdev@microsoft.com', + url='https://github.com/Azure/sonic-platform-daemons', + maintainer='Kevin Wang', + maintainer_email='kevinw@mellanox.com', + packages=[ + 'sonic_daemon_base', + ], + classifiers=[ + 'Development Status :: 4 - Beta', + 'Environment :: No Input/Output (Daemon)', + 'Intended Audience :: Developers', + 'Intended Audience :: Information Technology', + 'Intended Audience :: System Administrators', + 'License :: OSI Approved :: Apache Software License', + 'Natural Language :: English', + 'Operating System :: POSIX :: Linux', + 'Programming Language :: Python :: 2.7', + 'Topic :: System :: Hardware', + ], + keywords='SONiC sonic PLATFORM platform DAEMON daemon', +) + diff --git a/src/sonic-daemon-base/sonic_daemon_base/__init__.py b/src/sonic-daemon-base/sonic_daemon_base/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/src/sonic-daemon-base/sonic_daemon_base/daemon_base.py b/src/sonic-daemon-base/sonic_daemon_base/daemon_base.py new file mode 100644 index 000000000000..7fc14bf55c1f --- /dev/null +++ b/src/sonic-daemon-base/sonic_daemon_base/daemon_base.py @@ -0,0 +1,136 @@ +#!/usr/bin/env python2 + +try: + import imp + import signal + import subprocess + import sys + import syslog + from swsscommon import swsscommon +except ImportError, e: + raise ImportError (str(e) + " - required module not found") + +#============================= Constants ============================= + +# Platform root directory inside docker +PLATFORM_ROOT_DOCKER = "/usr/share/sonic/platform" +SONIC_CFGGEN_PATH = '/usr/local/bin/sonic-cfggen' +HWSKU_KEY = 'DEVICE_METADATA.localhost.hwsku' +PLATFORM_KEY = 'DEVICE_METADATA.localhost.platform' + +class DaemonBase(object): + # Redis DB information + redis_hostname = "localhost" + redis_port = 6379 + redis_timeout_msecs = 0 + + def __init__(self): + self.log_info("Starting up...") + # Register our signal handlers + signal.signal(signal.SIGHUP, self.signal_handler) + signal.signal(signal.SIGINT, self.signal_handler) + signal.signal(signal.SIGTERM, self.signal_handler) + + def __del__(self): + self.log_error("Return from daemon, exiting...") + + def run(self): + raise NotImplementedError() + + # ========================== Connect to DB ============================ + def db_connect(self, db): + return swsscommon.DBConnector(db, + self.redis_hostname, + self.redis_port, + self.redis_timeout_msecs) + + # ========================== Syslog wrappers ========================== + def log_info(self, msg): + syslog.openlog() + syslog.syslog(syslog.LOG_INFO, msg) + syslog.closelog() + + def log_warning(self, msg): + syslog.openlog() + syslog.syslog(syslog.LOG_WARNING, msg) + syslog.closelog() + + def log_error(self, msg): + syslog.openlog() + syslog.syslog(syslog.LOG_ERR, msg) + syslog.closelog() + + #========================== Signal Handling ========================== + def signal_handler(self, sig, frame): + if sig == signal.SIGHUP: + self.log_info("Caught SIGHUP - ignoring...") + return + elif sig == signal.SIGINT: + self.log_info("Caught SIGINT - exiting...") + sys.exit(128 + sig) + elif sig == signal.SIGTERM: + self.log_info("Caught SIGTERM - exiting...") + sys.exit(128 + sig) + else: + self.log_warning("Caught unhandled signal '" + sig + "'") + return + + #============ Functions to load platform-specific classes ============ + # Returns platform and HW SKU + def get_platform_and_hwsku(self): + try: + proc = subprocess.Popen([SONIC_CFGGEN_PATH, '-H', '-v', PLATFORM_KEY], + stdout=subprocess.PIPE, + shell=False, + stderr=subprocess.STDOUT) + stdout = proc.communicate()[0] + proc.wait() + platform = stdout.rstrip('\n') + + proc = subprocess.Popen([SONIC_CFGGEN_PATH, '-d', '-v', HWSKU_KEY], + stdout=subprocess.PIPE, + shell=False, + stderr=subprocess.STDOUT) + stdout = proc.communicate()[0] + proc.wait() + hwsku = stdout.rstrip('\n') + except OSError, e: + self.log_error("Cannot to detect platform") + raise OSError("Cannot detect platform") + + return (platform, hwsku) + + # Returns path to hwsku + def get_path_to_platform_and_hwsku(self): + # Get platform and hwsku + (platform, hwsku) = self.get_platform_and_hwsku() + + # Load platform module from source + platform_path = PLATFORM_ROOT_DOCKER + hwsku_path = "/".join([platform_path, hwsku]) + + return (platform_path, hwsku_path) + + # Loads platform specific psuutil module from source + def load_platform_util(self, module_name, class_name): + platform_util = None + + # Get path to platform and hwsku + (platform_path, hwsku_path) = self.get_path_to_platform_and_hwsku() + + try: + module_file = "/".join([platform_path, "plugins", module_name + ".py"]) + module = imp.load_source(module_name, module_file) + except IOError, e: + self.log_error("Failed to load platform module '%s': %s" % (module_name, str(e))) + return None + + try: + platform_util_class = getattr(module, class_name) + platform_util = platform_util_class() + except AttributeError, e: + self.log_error("Failed to instantiate '%s' class: %s" % (class_name, str(e))) + return None + + return platform_util + diff --git a/src/sonic-linux-kernel b/src/sonic-linux-kernel index 4cb2f2817c93..69ba0c13f6b9 160000 --- a/src/sonic-linux-kernel +++ b/src/sonic-linux-kernel @@ -1 +1 @@ -Subproject commit 4cb2f2817c9307eb1ed73c11459c409414075230 +Subproject commit 69ba0c13f6b984b554dd83fadfaace4e856239ae diff --git a/src/sonic-sairedis b/src/sonic-sairedis index 501d16477a8e..81f557d07644 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit 501d16477a8ebd840f83867ad0d876b44188989c +Subproject commit 81f557d07644953340ed081d1d66e3723f2be2f3 diff --git a/src/thrift/Makefile b/src/thrift/Makefile index 077b7fb308bd..41c78655c259 100644 --- a/src/thrift/Makefile +++ b/src/thrift/Makefile @@ -2,28 +2,26 @@ SHELL = /bin/bash .ONESHELL: .SHELLFLAGS += -e -THRIFT_VERSION = 0.9.3 -THRIFT_VERSION_FULL = $(THRIFT_VERSION)-2 +THRIFT_VERSION = 0.11.0 +THRIFT_VERSION_FULL = $(THRIFT_VERSION)-4 MAIN_TARGET = libthrift-$(THRIFT_VERSION)_$(THRIFT_VERSION_FULL)_amd64.deb DERIVED_TARGETS = libthrift-dev_$(THRIFT_VERSION_FULL)_amd64.deb \ python-thrift_$(THRIFT_VERSION_FULL)_amd64.deb \ thrift-compiler_$(THRIFT_VERSION_FULL)_amd64.deb -#THRIFT_LINK_PRE = http://http.debian.net/debian/pool/main/t/thrift THRIFT_LINK_PRE = https://sonicstorage.blob.core.windows.net/packages/debian $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : rm -rf thrift-$(THRIFT_VERSION) - wget -NO "thrift_$(THRIFT_VERSION).orig.tar.gz" "$(THRIFT_LINK_PRE)/thrift_$(THRIFT_VERSION).orig.tar.gz?sv=2015-04-05&sr=b&sig=wM3B01UnZQYYr7ZGXmCvRn6MMeS5hn5Oa5G5%2Btub53g%3D&se=2028-11-11T02%3A20%3A36Z&sp=r" - wget -NO "thrift_$(THRIFT_VERSION_FULL).debian.tar.xz" "$(THRIFT_LINK_PRE)/thrift_$(THRIFT_VERSION_FULL).debian.tar.xz?sv=2015-04-05&sr=b&sig=76bx%2BN8uxYbuI%2BEq8uK%2B8cTKTzVmjtjsQ9weejWNINk%3D&se=2028-11-11T02%3A19%3A30Z&sp=r" - wget -NO "thrift_$(THRIFT_VERSION_FULL).dsc" "$(THRIFT_LINK_PRE)/thrift_$(THRIFT_VERSION_FULL).dsc?sv=2015-04-05&sr=b&sig=Vpk1eJ97I5aWrtjAYS8w8AKyLXcJKFGIVFOOBGR3a5I%3D&se=2028-11-11T02%3A20%3A20Z&sp=r" + 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" dpkg-source -x thrift_$(THRIFT_VERSION_FULL).dsc pushd thrift-$(THRIFT_VERSION) - patch -p1 < ../patch/THRIFT-3577-assertion-failed.patch - DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -d -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) + CXXFLAGS="-DFORCE_BOOST_SMART_PTR" DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -d -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) popd mv $(DERIVED_TARGETS) $* $(DEST)/ diff --git a/src/thrift/patch/THRIFT-3577-assertion-failed.patch b/src/thrift/patch/THRIFT-3577-assertion-failed.patch deleted file mode 100644 index ad984ebbdb73..000000000000 --- a/src/thrift/patch/THRIFT-3577-assertion-failed.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 9f96e358fb5bdac8a6570dc3c79e9416e4f407ce Mon Sep 17 00:00:00 2001 -From: Nobuaki Sukegawa -Date: Mon, 22 Feb 2016 01:33:27 +0900 -Subject: [PATCH] THRIFT-3577 assertion failed at line 512 of - testcontainertest.c - ---- - lib/c_glib/test/testcontainertest.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/lib/c_glib/test/testcontainertest.c b/lib/c_glib/test/testcontainertest.c -index 852254b..1cbc55c 100644 ---- a/lib/c_glib/test/testcontainertest.c -+++ b/lib/c_glib/test/testcontainertest.c -@@ -507,9 +507,9 @@ main(int argc, char *argv[]) - - /* Make sure the server stopped only because it was interrupted (by the - child process terminating) */ -- g_assert (g_error_matches (error, -- THRIFT_SERVER_SOCKET_ERROR, -- THRIFT_SERVER_SOCKET_ERROR_ACCEPT)); -+ g_assert(!error || g_error_matches(error, -+ THRIFT_SERVER_SOCKET_ERROR, -+ THRIFT_SERVER_SOCKET_ERROR_ACCEPT)); - - /* Free our resources */ - g_object_unref (server);