[Juniper] Platform bug fixes / improvements (#5541)
* [Juniper] Platform bug fixes / improvements This patch set introduces the following changes for the two platforms. - QFX5210 - Fixes a driver bug related to reboot notifier - Disable pcied - Introduces a wrapper script for fast / warm reboots for unloading the driver containing reboot handler - Support for PSM4 optics in media_settings - QFX5200 - BCM configuration file updates - Bug fixes for EM policy - Fixes a driver bug related to reboot notifier - Introduces a wrapper script for fast / warm reboots for unloading the driver containing reboot handler - Disable pcied - Support for PSM4 optics Signed-off-by: Ciju Rajan K <crajank@juniper.net>
This commit is contained in:
parent
8100711531
commit
609cbdd0f3
@ -342,7 +342,7 @@ portmap_38=37:100
|
||||
xgxs_rx_lane_map_127=0x2301
|
||||
xgxs_rx_lane_map_119=0x3120
|
||||
xgxs_tx_lane_map_129=0x3120
|
||||
l2_mem_entries=106496
|
||||
l2_mem_entries=8192
|
||||
os=unix
|
||||
port_phy_addr_26=0xff
|
||||
port_phy_addr_18=0xff
|
||||
@ -536,6 +536,7 @@ phy_xaui_tx_polarity_flip_94=0x01
|
||||
phy_xaui_tx_polarity_flip_86=0x01
|
||||
max_vp_lags=0
|
||||
l3_max_ecmp_mode=1
|
||||
l3_alpm_enable=2
|
||||
portmap_98=95:25:50:i
|
||||
portmap_3=3:25:50:i
|
||||
miim_intr_enable=0x0
|
||||
@ -549,10 +550,9 @@ portmap_100=131:1
|
||||
portmap_99=96:25:i
|
||||
pbmp_oversubscribe=0xC4444451111111144444444422222222
|
||||
portmap_4=4:25:i
|
||||
l3_mem_entries=40960
|
||||
l3_mem_entries=8192
|
||||
xgxs_tx_lane_map_20=0x0213
|
||||
xgxs_tx_lane_map_12=0x3120
|
||||
num_ipv6_lpm_128b_entries=1024
|
||||
port_phy_addr_95=0xff
|
||||
port_phy_addr_87=0xff
|
||||
port_phy_addr_79=0xff
|
||||
|
@ -15,6 +15,146 @@
|
||||
"lane3":"0xa"
|
||||
}
|
||||
},
|
||||
"JUNIPER-AVAGO-AFBR-89CDDZ-JU2": {
|
||||
"preemphasis": {
|
||||
"lane0":"0x0c6400",
|
||||
"lane1":"0x0c6400",
|
||||
"lane2":"0x0c6400",
|
||||
"lane3":"0x0c6400"
|
||||
},
|
||||
"idriver": {
|
||||
"lane0":"0xa",
|
||||
"lane1":"0xa",
|
||||
"lane2":"0xa",
|
||||
"lane3":"0xa"
|
||||
}
|
||||
},
|
||||
"JUNIPER-FINISAR-FCBN425QE1C30-J1": {
|
||||
"preemphasis": {
|
||||
"lane0":"0x0c6400",
|
||||
"lane1":"0x0c6400",
|
||||
"lane2":"0x0c6400",
|
||||
"lane3":"0x0c6400"
|
||||
},
|
||||
"idriver": {
|
||||
"lane0":"0xa",
|
||||
"lane1":"0xa",
|
||||
"lane2":"0xa",
|
||||
"lane3":"0xa"
|
||||
}
|
||||
},
|
||||
"JUNIPER-FINISAR-FCBN425QE1C10-J1": {
|
||||
"preemphasis": {
|
||||
"lane0":"0x0c6400",
|
||||
"lane1":"0x0c6400",
|
||||
"lane2":"0x0c6400",
|
||||
"lane3":"0x0c6400"
|
||||
},
|
||||
"idriver": {
|
||||
"lane0":"0xa",
|
||||
"lane1":"0xa",
|
||||
"lane2":"0xa",
|
||||
"lane3":"0xa"
|
||||
}
|
||||
},
|
||||
"JUNIPER-FINISAR-FTLC9551REPM-J1": {
|
||||
"preemphasis": {
|
||||
"lane0":"0x0c6400",
|
||||
"lane1":"0x0c6400",
|
||||
"lane2":"0x0c6400",
|
||||
"lane3":"0x0c6400"
|
||||
},
|
||||
"idriver": {
|
||||
"lane0":"0xa",
|
||||
"lane1":"0xa",
|
||||
"lane2":"0xa",
|
||||
"lane3":"0xa"
|
||||
}
|
||||
},
|
||||
"JUNIPER-FINISAR-FTLC9551REPM-J3": {
|
||||
"preemphasis": {
|
||||
"lane0":"0x0c6400",
|
||||
"lane1":"0x0c6400",
|
||||
"lane2":"0x0c6400",
|
||||
"lane3":"0x0c6400"
|
||||
},
|
||||
"idriver": {
|
||||
"lane0":"0xa",
|
||||
"lane1":"0xa",
|
||||
"lane2":"0xa",
|
||||
"lane3":"0xa"
|
||||
}
|
||||
},
|
||||
"JUNIPER-INNO-TR-FC13L-NJC": {
|
||||
"preemphasis": {
|
||||
"lane0":"0x0c6400",
|
||||
"lane1":"0x0c6400",
|
||||
"lane2":"0x0c6400",
|
||||
"lane3":"0x0c6400"
|
||||
},
|
||||
"idriver": {
|
||||
"lane0":"0xa",
|
||||
"lane1":"0xa",
|
||||
"lane2":"0xa",
|
||||
"lane3":"0xa"
|
||||
}
|
||||
},
|
||||
"JUNIPER-INNO-TR-FC13R-NJC": {
|
||||
"preemphasis": {
|
||||
"lane0":"0x0c6400",
|
||||
"lane1":"0x0c6400",
|
||||
"lane2":"0x0c6400",
|
||||
"lane3":"0x0c6400"
|
||||
},
|
||||
"idriver": {
|
||||
"lane0":"0xa",
|
||||
"lane1":"0xa",
|
||||
"lane2":"0xa",
|
||||
"lane3":"0xa"
|
||||
}
|
||||
},
|
||||
"JUNIPER-SOURCE-SPQCELRCDFAJ2": {
|
||||
"preemphasis": {
|
||||
"lane0":"0x0c6400",
|
||||
"lane1":"0x0c6400",
|
||||
"lane2":"0x0c6400",
|
||||
"lane3":"0x0c6400"
|
||||
},
|
||||
"idriver": {
|
||||
"lane0":"0xa",
|
||||
"lane1":"0xa",
|
||||
"lane2":"0xa",
|
||||
"lane3":"0xa"
|
||||
}
|
||||
},
|
||||
"JUNIPER-LUXTERA-LUX42604BO": {
|
||||
"preemphasis": {
|
||||
"lane0":"0x0c6400",
|
||||
"lane1":"0x0c6400",
|
||||
"lane2":"0x0c6400",
|
||||
"lane3":"0x0c6400"
|
||||
},
|
||||
"idriver": {
|
||||
"lane0":"0xa",
|
||||
"lane1":"0xa",
|
||||
"lane2":"0xa",
|
||||
"lane3":"0xa"
|
||||
}
|
||||
},
|
||||
"JUNIPER-LUXTERA-LUX42604CO": {
|
||||
"preemphasis": {
|
||||
"lane0":"0x0c6400",
|
||||
"lane1":"0x0c6400",
|
||||
"lane2":"0x0c6400",
|
||||
"lane3":"0x0c6400"
|
||||
},
|
||||
"idriver": {
|
||||
"lane0":"0xa",
|
||||
"lane1":"0xa",
|
||||
"lane2":"0xa",
|
||||
"lane3":"0xa"
|
||||
}
|
||||
},
|
||||
"FINISAR CORP.-FTL4C1QE1C-J1": {
|
||||
"preemphasis": {
|
||||
"lane0":"0x115f00",
|
||||
|
@ -37,22 +37,43 @@ import commands
|
||||
import binascii
|
||||
from sonic_eeprom import eeprom_tlvinfo
|
||||
|
||||
def main():
|
||||
eeprom_qfx5200 = Eeprom()
|
||||
FAN0_TYPE="cat /sys/devices/pci0000:00/0000:00:1c.0/0000:0f:00.0/refpga-tmc.15/fan0_type"
|
||||
|
||||
try:
|
||||
status,fan0_type=commands.getstatusoutput(FAN0_TYPE)
|
||||
except Exception as e:
|
||||
print "Error on refpga-tmc.15 fan0_type e:" + str(e)
|
||||
return False
|
||||
def fantype_detect():
|
||||
|
||||
refpgaTMC_path = "/sys/devices/pci0000:00/0000:00:1c.0/0000:0f:00.0/refpga-tmc.15"
|
||||
|
||||
AFO = "1"
|
||||
AFI = "0"
|
||||
|
||||
#default fan type is AFO
|
||||
default_fantype = "0"
|
||||
|
||||
for filename in os.listdir(refpgaTMC_path):
|
||||
if filename.endswith('_type'):
|
||||
fantype_path = os.path.join(refpgaTMC_path, filename)
|
||||
cat_string = "cat "
|
||||
fantype_string = cat_string + fantype_path
|
||||
status,fan_type=commands.getstatusoutput(fantype_string)
|
||||
if ((fan_type == AFO) or (fan_type == AFI)):
|
||||
return fan_type
|
||||
else:
|
||||
pass
|
||||
|
||||
return default_fantype
|
||||
|
||||
|
||||
|
||||
def main():
|
||||
AFO_value = "1"
|
||||
|
||||
eeprom_qfx5200 = Eeprom()
|
||||
|
||||
fan_type = fantype_detect()
|
||||
|
||||
# creating the "/var/run/eeprom" file and storing values of CPU board EEPROM and MAIN Board EEPROM in this file.
|
||||
eeprom_file = open ("/var/run/eeprom", "a+")
|
||||
eeprom_file.write("\n")
|
||||
if fan0_type == AFO:
|
||||
if fan_type == AFO_value:
|
||||
eeprom_file.write("Fan Type=AFO\r\n")
|
||||
else:
|
||||
eeprom_file.write("Fan Type=AFI\r\n")
|
||||
|
@ -50,7 +50,7 @@ except ImportError as e:
|
||||
|
||||
SYSLOG_IDENTIFIER = "sfputil"
|
||||
|
||||
# Global logger class instance
|
||||
# Global Logger class instance
|
||||
logger = Logger(SYSLOG_IDENTIFIER)
|
||||
|
||||
qfx5200_qsfp_cable_length_tup = ('Length(km)', 'Length OM3(2m)',
|
||||
@ -331,12 +331,16 @@ class SfpUtil(SfpUtilBase):
|
||||
"AFBR-89CDDZ-JU1",
|
||||
"AFBR-89CDDZ-JU2",
|
||||
"FTLC9551REPM-J1",
|
||||
"FCBN425QE1C30-J1",
|
||||
"FCBN425QE1C10-J1",
|
||||
"FTLC9551REPM-J3",
|
||||
"LUX42604CO",
|
||||
"LUX42604BO",
|
||||
"EOLQ-161HG-10-LJ1",
|
||||
"FTLC1151RDPL-J1",
|
||||
"TR-FC13R-NJC",
|
||||
"TR-FC13L-NJC",
|
||||
"TR-FC13R-NJ3",
|
||||
"SPQ-CE-LR-CDFB-J2",
|
||||
"1K1QAC",
|
||||
"SPQCELRCDFAJ2"
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -4,3 +4,5 @@ qfx5200/utils/show_thresholds usr/local/bin
|
||||
qfx5200/utils/temperature_thresholds_AFI.txt usr/local/bin
|
||||
qfx5200/utils/temperature_thresholds_AFO.txt usr/local/bin
|
||||
qfx5200/service/qfx5200-platform-init.service etc/systemd/system
|
||||
qfx5200/utils/wrapper-warm-reboot usr/local/bin
|
||||
qfx5200/utils/wrapper-fast-reboot usr/local/bin
|
||||
|
@ -28,4 +28,10 @@ if [ -f $FIRST_BOOT_FILE ]; then
|
||||
# Creating the UEFI entry for the first time.
|
||||
efibootmgr -c -L "SONiC" -l "\EFI\BOOT\BOOTX64.EFI" > /var/tmp/efi_log 2>&1
|
||||
fi
|
||||
mkdir /usr/bin/qfx5200-warm-reboot
|
||||
mkdir /usr/bin/qfx5200-fast-reboot
|
||||
cp /usr/bin/warm-reboot /usr/bin/qfx5200-warm-reboot
|
||||
cp /usr/bin/fast-reboot /usr/bin/qfx5200-fast-reboot
|
||||
cp /usr/local/bin/wrapper-warm-reboot /usr/bin/warm-reboot
|
||||
cp /usr/local/bin/wrapper-fast-reboot /usr/bin/fast-reboot
|
||||
fi
|
||||
|
@ -2,3 +2,5 @@ qfx5210/utils/juniper_qfx5210_util.py usr/local/bin
|
||||
qfx5210/utils/juniper_qfx5210_monitor.py usr/local/bin
|
||||
qfx5210/utils/platform_poweroff usr/local/bin
|
||||
qfx5210/service/qfx5210-platform-init.service etc/systemd/system
|
||||
qfx5210/utils/wrapper-warm-reboot usr/local/bin
|
||||
qfx5210/utils/wrapper-fast-reboot usr/local/bin
|
||||
|
@ -28,5 +28,10 @@ if [ -f $FIRST_BOOT_FILE ]; then
|
||||
# Creating the UEFI entry for the first time.
|
||||
efibootmgr -c -L "SONiC" -l "\EFI\BOOT\BOOTX64.EFI" > /var/tmp/efi_log 2>&1
|
||||
fi
|
||||
rm -rf /sys/fs/pstore/*
|
||||
mkdir /usr/bin/qfx5210-warm-reboot
|
||||
mkdir /usr/bin/qfx5210-fast-reboot
|
||||
cp /usr/bin/warm-reboot /usr/bin/qfx5210-warm-reboot
|
||||
cp /usr/bin/fast-reboot /usr/bin/qfx5210-fast-reboot
|
||||
cp /usr/local/bin/wrapper-warm-reboot /usr/bin/warm-reboot
|
||||
cp /usr/local/bin/wrapper-fast-reboot /usr/bin/fast-reboot
|
||||
fi
|
||||
|
@ -98,14 +98,15 @@ static int __init refpga_lpcm_init(void)
|
||||
|
||||
static void __exit refpga_lpcm_exit(void)
|
||||
{
|
||||
/*
|
||||
* Unregister the fpga soft reset handler
|
||||
*/
|
||||
if (unregister_reboot_notifier(&qfx5200_nb)) {
|
||||
printk(KERN_CRIT "Failed to uregister reboot notifier\n");
|
||||
return;
|
||||
}
|
||||
iounmap(fpga);
|
||||
release_mem_region(REFPGA_LPC_BASE_ADDRESS, REFPGA_LPC_WINDOW_SIZE);
|
||||
/*
|
||||
* Unregister the cpld soft reset handler
|
||||
*/
|
||||
if (!unregister_restart_handler(&qfx5200_nb)) {
|
||||
printk(KERN_CRIT "Failed to uregister restart handler\n");
|
||||
}
|
||||
printk(KERN_INFO "Re-Fpga lpcm module removed\n");
|
||||
}
|
||||
|
||||
|
@ -56,9 +56,6 @@ log_level = logging.DEBUG
|
||||
|
||||
|
||||
isPlatformAFI = False
|
||||
isFireThresholdReached = False
|
||||
isFireThresholdPrint = True
|
||||
FireThresholdSecsRemaining = 120
|
||||
PrevASICValue = 0
|
||||
|
||||
temp_policy_AFI = {
|
||||
@ -223,6 +220,7 @@ class QFX5200_ThermalUtil(object):
|
||||
CORETEMP_PATH = '/sys/bus/platform/devices/coretemp.0/hwmon/hwmon*/temp{0}_input'
|
||||
MAJORALARM_LED_PATH = '/sys/class/leds/alarm-major/brightness'
|
||||
MINORALARM_LED_PATH = '/sys/class/leds/alarm-minor/brightness'
|
||||
MONITORLOG_PATH = '/var/log/juniper_qfx5200_monitor.log'
|
||||
|
||||
""" Dictionary where
|
||||
key1 = thermal id index (integer) starting from 1
|
||||
@ -449,9 +447,6 @@ class QFX5200_ThermalUtil(object):
|
||||
|
||||
def getSensorTemp(self):
|
||||
global isPlatformAFI
|
||||
global isFireThresholdReached
|
||||
global FireThresholdSecsRemaining
|
||||
global isFireThresholdPrint
|
||||
global PrevASICValue
|
||||
|
||||
sensor_str = ''
|
||||
@ -480,25 +475,6 @@ class QFX5200_ThermalUtil(object):
|
||||
10: [0,0,0,0,0,0,0,0,0,0,0,0],
|
||||
11: [0,0,0,0,0,0,0,0,0,0,0,0],
|
||||
}
|
||||
# if the Firethreshold Flag is set and 120 seconds have elapsed, invoking the "poweroff" to shutdown the box
|
||||
if (isFireThresholdReached == True):
|
||||
firethr = FireThresholdSecsRemaining - 20
|
||||
if firethr == 0:
|
||||
logging.critical('CRITICAL: Fire Threshold reached: System is going to shutdown now')
|
||||
os.system("echo 'CRITICAL: Fire Threshold reached: System is going to shutdown now' > /dev/console")
|
||||
else:
|
||||
logging.critical('CRITICAL: Fire Threshold reached: System is going to shutdown in %s seconds', firethr)
|
||||
os.system("echo 'CRITICAL: Fire Threshold reached: System is going to shutdown in %s seconds' > /dev/console" % firethr)
|
||||
|
||||
FireThresholdSecsRemaining = FireThresholdSecsRemaining - 20
|
||||
logging.critical('CRITICAL: Value of FireThresholdSecsRemaining %s seconds', FireThresholdSecsRemaining)
|
||||
|
||||
if (FireThresholdSecsRemaining == 0):
|
||||
isFireThresholdReached == False
|
||||
time.sleep(20)
|
||||
logging.debug('Executing poweroff command')
|
||||
cmd = "poweroff"
|
||||
os.system(cmd)
|
||||
|
||||
for x in range(self.SENSOR_CORETEMP_NUM_ON_MAIN_BOARD):
|
||||
SEN_str = 'SEN'
|
||||
@ -591,26 +567,29 @@ class QFX5200_ThermalUtil(object):
|
||||
if (SensorFlag[0][11] or SensorFlag[1][11] or SensorFlag[2][11] or SensorFlag[3][11] or SensorFlag[4][11] or SensorFlag[5][11] or SensorFlag[6][11] or SensorFlag[7][11]
|
||||
or SensorFlag[8][11] or SensorFlag[9][11] or SensorFlag[10][11] or SensorFlag[11][11]):
|
||||
|
||||
isFireThresholdReached = True
|
||||
logging.debug('Fire Threshold reached: System is going to shutdown now')
|
||||
os.system("echo 'CRITICAL: Fire Threshold reached: System is going to shutdown now' > /dev/console")
|
||||
|
||||
if (isFireThresholdPrint == True):
|
||||
logging.critical('CRITICAL: Fire Threshold reached: System is going to shutdown in 120 seconds')
|
||||
os.system("echo 'CRITICAL: Fire Threshold reached: System is going to shutdown in 120 seconds' > /dev/console")
|
||||
isFireThresholdPrint = False
|
||||
|
||||
self.set_alarm_led_brightness(2)
|
||||
logging.debug('Setting Red Alarm as one temp sensor is running at soft shutdown temp value')
|
||||
logging.debug('Executing poweroff command')
|
||||
|
||||
time.sleep(1)
|
||||
|
||||
try:
|
||||
monitorlog_file = open(self.MONITORLOG_PATH)
|
||||
except IOError as e:
|
||||
logging.error('get_Sensor_temp: unable to open file: %s', str(e))
|
||||
return False
|
||||
|
||||
monitorlog_file.close()
|
||||
|
||||
cmd = "poweroff"
|
||||
os.system(cmd)
|
||||
|
||||
# CHECK IF ANY TEMPERATURE SENSORS is running at RED warning , IF YES, SET THE ALARM LED TO 'RED'
|
||||
elif (SensorFlag[0][10] or SensorFlag[1][10] or SensorFlag[2][10] or SensorFlag[3][10] or SensorFlag[4][10] or SensorFlag[5][10] or SensorFlag[6][10] or SensorFlag[7][10]
|
||||
or SensorFlag[8][10] or SensorFlag[9][10] or SensorFlag[10][10] or SensorFlag[11][10]):
|
||||
|
||||
if (isFireThresholdReached == True):
|
||||
logging.critical('CRITICAL: System Stabilized, not shutting down')
|
||||
os.system("echo 'CRITICAL: System Stabilized, not shutting down' > /dev/console")
|
||||
FireThresholdSecsRemaining = 120
|
||||
isFireThresholdReached = False
|
||||
|
||||
|
||||
self.set_alarm_led_brightness(2)
|
||||
|
||||
logging.debug('Setting Red Alarm')
|
||||
@ -619,13 +598,8 @@ class QFX5200_ThermalUtil(object):
|
||||
elif (SensorFlag[0][9] or SensorFlag[1][9] or SensorFlag[2][9] or SensorFlag[3][9] or SensorFlag[4][9] or SensorFlag[5][9] or SensorFlag[6][9] or SensorFlag[7][9]
|
||||
or SensorFlag[8][9] or SensorFlag[9][9] or SensorFlag[10][9] or SensorFlag[11][9]):
|
||||
|
||||
if (isFireThresholdReached == True):
|
||||
logging.critical('CRITICAL: System Stabilized, not shutting down')
|
||||
os.system("echo 'CRITICAL: System Stabilized, not shutting down' > /dev/console")
|
||||
FireThresholdSecsRemaining = 120
|
||||
isFireThresholdReached = False
|
||||
|
||||
self.set_alarm_led_brightness(1)
|
||||
|
||||
logging.debug('Setting Yellow Alarm')
|
||||
|
||||
else:
|
||||
@ -641,16 +615,6 @@ class QFX5200_ThermalUtil(object):
|
||||
if (SensorFlag[0][8] or SensorFlag[1][8] or SensorFlag[2][8] or SensorFlag[3][8] or SensorFlag[4][8] or SensorFlag[5][8] or SensorFlag[6][8] or SensorFlag[7][8]
|
||||
or SensorFlag[8][8] or SensorFlag[9][8] or SensorFlag[10][8] or SensorFlag[11][8]):
|
||||
|
||||
if (isFireThresholdReached == True):
|
||||
if (SensorFlag[0][11] or SensorFlag[1][11] or SensorFlag[2][11] or SensorFlag[3][11] or SensorFlag[4][11] or SensorFlag[5][11] or SensorFlag[6][11] or SensorFlag[7][11]
|
||||
or SensorFlag[8][11] or SensorFlag[9][11] or SensorFlag[10][11] or SensorFlag[11][11]):
|
||||
pass
|
||||
else:
|
||||
logging.critical('CRITICAL: System Stabilized, not shutting down')
|
||||
os.system("echo 'CRITICAL: System Stabilized, not shutting down' > /dev/console")
|
||||
FireThresholdSecsRemaining = 120
|
||||
isFireThresholdReached = False
|
||||
|
||||
fan.get_check_fan_dutycycle()
|
||||
if (fan.get_fan_dutycycle() < 100):
|
||||
time.sleep(0.50)
|
||||
@ -661,16 +625,6 @@ class QFX5200_ThermalUtil(object):
|
||||
elif (SensorFlag[0][7] or SensorFlag[1][7] or SensorFlag[2][7] or SensorFlag[3][7] or SensorFlag[4][7] or SensorFlag[5][7] or SensorFlag[6][7] or SensorFlag[7][7]
|
||||
or SensorFlag[8][7] or SensorFlag[9][7] or SensorFlag[10][7] or SensorFlag[11][7]):
|
||||
|
||||
if (isFireThresholdReached == True):
|
||||
if (SensorFlag[0][11] or SensorFlag[1][11] or SensorFlag[2][11] or SensorFlag[3][11] or SensorFlag[4][11] or SensorFlag[5][11] or SensorFlag[6][11] or SensorFlag[7][11]
|
||||
or SensorFlag[8][11] or SensorFlag[9][11] or SensorFlag[10][11] or SensorFlag[11][11]):
|
||||
pass
|
||||
else:
|
||||
logging.critical('CRITICAL: System Stabilized, not shutting down')
|
||||
os.system("echo 'CRITICAL: System Stabilized, not shutting down' > /dev/console")
|
||||
FireThresholdSecsRemaining = 120
|
||||
isFireThresholdReached = False
|
||||
|
||||
fan.get_check_fan_dutycycle()
|
||||
|
||||
if (fan.get_fan_dutycycle() == 100):
|
||||
@ -686,16 +640,6 @@ class QFX5200_ThermalUtil(object):
|
||||
elif (SensorFlag[0][6] or SensorFlag[1][6] or SensorFlag[2][6] or SensorFlag[3][6] or SensorFlag[4][6] or SensorFlag[5][6] or SensorFlag[6][6] or SensorFlag[7][6]
|
||||
or SensorFlag[8][6] or SensorFlag[9][6] or SensorFlag[10][6] or SensorFlag[11][6]):
|
||||
|
||||
if (isFireThresholdReached == True):
|
||||
if (SensorFlag[0][11] or SensorFlag[1][11] or SensorFlag[2][11] or SensorFlag[3][11] or SensorFlag[4][11] or SensorFlag[5][11] or SensorFlag[6][11] or SensorFlag[7][11]
|
||||
or SensorFlag[8][11] or SensorFlag[9][11] or SensorFlag[10][11] or SensorFlag[11][11]):
|
||||
pass
|
||||
else:
|
||||
logging.critical('CRITICAL: System Stabilized, not shutting down')
|
||||
os.system("echo 'CRITICAL: System Stabilized, not shutting down' > /dev/console")
|
||||
FireThresholdSecsRemaining = 120
|
||||
isFireThresholdReached = False
|
||||
|
||||
fan.get_check_fan_dutycycle()
|
||||
|
||||
if (fan.get_fan_dutycycle() < 90):
|
||||
@ -713,16 +657,6 @@ class QFX5200_ThermalUtil(object):
|
||||
elif (SensorFlag[0][5] or SensorFlag[1][5] or SensorFlag[2][5] or SensorFlag[3][5] or SensorFlag[4][5] or SensorFlag[5][5] or SensorFlag[6][5] or SensorFlag[7][5]
|
||||
or SensorFlag[8][5] or SensorFlag[9][5] or SensorFlag[10][5] or SensorFlag[11][5]):
|
||||
|
||||
if (isFireThresholdReached == True):
|
||||
if (SensorFlag[0][11] or SensorFlag[1][11] or SensorFlag[2][11] or SensorFlag[3][11] or SensorFlag[4][11] or SensorFlag[5][11] or SensorFlag[6][11] or SensorFlag[7][11]
|
||||
or SensorFlag[8][11] or SensorFlag[9][11] or SensorFlag[10][11] or SensorFlag[11][11]):
|
||||
pass
|
||||
else:
|
||||
logging.critical('CRITICAL: System Stabilized, not shutting down')
|
||||
os.system("echo 'CRITICAL: System Stabilized, not shutting down' > /dev/console")
|
||||
FireThresholdSecsRemaining = 120
|
||||
isFireThresholdReached = False
|
||||
|
||||
fan.get_check_fan_dutycycle()
|
||||
|
||||
if (fan.get_fan_dutycycle() > 75):
|
||||
@ -742,17 +676,7 @@ class QFX5200_ThermalUtil(object):
|
||||
# CHECK IF ANY TEMPERATURE SENSORS HAS SET 75% DUTY CYCLE FLAG
|
||||
elif (SensorFlag[0][4] or SensorFlag[1][4] or SensorFlag[2][4] or SensorFlag[3][4] or SensorFlag[4][4] or SensorFlag[5][4] or SensorFlag[6][4] or SensorFlag[7][4]
|
||||
or SensorFlag[8][4] or SensorFlag[9][4] or SensorFlag[10][4] or SensorFlag[11][4]):
|
||||
|
||||
if (isFireThresholdReached == True):
|
||||
if (SensorFlag[0][11] or SensorFlag[1][11] or SensorFlag[2][11] or SensorFlag[3][11] or SensorFlag[4][11] or SensorFlag[5][11] or SensorFlag[6][11] or SensorFlag[7][11]
|
||||
or SensorFlag[8][11] or SensorFlag[9][11] or SensorFlag[10][11] or SensorFlag[11][11]):
|
||||
pass
|
||||
else:
|
||||
logging.critical('CRITICAL: System Stabilized, not shutting down')
|
||||
os.system("echo 'CRITICAL: System Stabilized, not shutting down' > /dev/console")
|
||||
FireThresholdSecsRemaining = 120
|
||||
isFireThresholdReached = False
|
||||
|
||||
|
||||
fan.get_check_fan_dutycycle()
|
||||
if (fan.get_fan_dutycycle() < 75):
|
||||
time.sleep(0.25)
|
||||
@ -772,16 +696,6 @@ class QFX5200_ThermalUtil(object):
|
||||
elif (SensorFlag[0][3] or SensorFlag[1][3] or SensorFlag[2][3] or SensorFlag[3][3] or SensorFlag[4][3] or SensorFlag[5][3] or SensorFlag[6][3] or SensorFlag[7][3]
|
||||
or SensorFlag[8][3] or SensorFlag[9][3] or SensorFlag[10][3] or SensorFlag[11][3]):
|
||||
|
||||
if (isFireThresholdReached == True):
|
||||
if (SensorFlag[0][11] or SensorFlag[1][11] or SensorFlag[2][11] or SensorFlag[3][11] or SensorFlag[4][11] or SensorFlag[5][11] or SensorFlag[6][11] or SensorFlag[7][11]
|
||||
or SensorFlag[8][11] or SensorFlag[9][11] or SensorFlag[10][11] or SensorFlag[11][11]):
|
||||
pass
|
||||
else:
|
||||
logging.critical('CRITICAL: System Stabilized, not shutting down')
|
||||
os.system("echo 'CRITICAL: System Stabilized, not shutting down' > /dev/console")
|
||||
FireThresholdSecsRemaining = 120
|
||||
isFireThresholdReached = False
|
||||
|
||||
fan.get_check_fan_dutycycle()
|
||||
|
||||
if (fan.get_fan_dutycycle() > 55):
|
||||
@ -807,16 +721,6 @@ class QFX5200_ThermalUtil(object):
|
||||
elif (SensorFlag[0][2] or SensorFlag[1][2] or SensorFlag[2][2] or SensorFlag[3][2] or SensorFlag[4][2] or SensorFlag[5][2] or SensorFlag[6][2] or SensorFlag[7][2]
|
||||
or SensorFlag[8][2] or SensorFlag[9][2] or SensorFlag[10][2] or SensorFlag[11][2]):
|
||||
|
||||
if (isFireThresholdReached == True):
|
||||
if (SensorFlag[0][11] or SensorFlag[1][11] or SensorFlag[2][11] or SensorFlag[3][11] or SensorFlag[4][11] or SensorFlag[5][11] or SensorFlag[6][11] or SensorFlag[7][11]
|
||||
or SensorFlag[8][11] or SensorFlag[9][11] or SensorFlag[10][11] or SensorFlag[11][11]):
|
||||
pass
|
||||
else:
|
||||
logging.critical('CRITICAL: System Stabilized, not shutting down')
|
||||
os.system("echo 'CRITICAL: System Stabilized, not shutting down' > /dev/console")
|
||||
FireThresholdSecsRemaining = 120
|
||||
isFireThresholdReached = False
|
||||
|
||||
fan.get_check_fan_dutycycle()
|
||||
|
||||
if (fan.get_fan_dutycycle() < 55):
|
||||
@ -833,18 +737,7 @@ class QFX5200_ThermalUtil(object):
|
||||
# CHECK IF ANY TEMPERATURE SENSORS HAS SET 35% PREV DUTY CYCLE FLAG
|
||||
elif (SensorFlag[0][1] or SensorFlag[1][1] or SensorFlag[2][1] or SensorFlag[3][1] or SensorFlag[4][1] or SensorFlag[5][1] or SensorFlag[6][1] or SensorFlag[7][1]
|
||||
or SensorFlag[8][1] or SensorFlag[9][1] or SensorFlag[10][1] or SensorFlag[11][1]):
|
||||
|
||||
if (isFireThresholdReached == True):
|
||||
|
||||
if (SensorFlag[0][11] or SensorFlag[1][11] or SensorFlag[2][11] or SensorFlag[3][11] or SensorFlag[4][11] or SensorFlag[5][11] or SensorFlag[6][11] or SensorFlag[7][11]
|
||||
or SensorFlag[8][11] or SensorFlag[9][11] or SensorFlag[10][11] or SensorFlag[11][11]):
|
||||
pass
|
||||
else:
|
||||
logging.critical('CRITICAL: System Stabilized, not shutting down')
|
||||
os.system("echo 'CRITICAL: System Stabilized, not shutting down' > /dev/console")
|
||||
FireThresholdSecsRemaining = 120
|
||||
isFireThresholdReached = False
|
||||
|
||||
|
||||
fan.get_check_fan_dutycycle()
|
||||
|
||||
if (fan.get_fan_dutycycle() > 35):
|
||||
@ -869,17 +762,6 @@ class QFX5200_ThermalUtil(object):
|
||||
elif (SensorFlag[0][0] or SensorFlag[1][0] or SensorFlag[2][0] or SensorFlag[3][0] or SensorFlag[4][0] or SensorFlag[5][0] or SensorFlag[6][0] or SensorFlag[7][0]
|
||||
or SensorFlag[8][0] or SensorFlag[9][0] or SensorFlag[10][0] or SensorFlag[11][0]):
|
||||
|
||||
if (isFireThresholdReached == True):
|
||||
|
||||
if (SensorFlag[0][11] or SensorFlag[1][11] or SensorFlag[2][11] or SensorFlag[3][11] or SensorFlag[4][11] or SensorFlag[5][11] or SensorFlag[6][11] or SensorFlag[7][11]
|
||||
or SensorFlag[8][11] or SensorFlag[9][11] or SensorFlag[10][11] or SensorFlag[11][11]):
|
||||
pass
|
||||
else:
|
||||
logging.critical('CRITICAL: System Stabilized, not shutting down')
|
||||
os.system("echo 'CRITICAL: System Stabilized, not shutting down' > /dev/console")
|
||||
FireThresholdSecsRemaining = 120
|
||||
isFireThresholdReached = False
|
||||
|
||||
fan.get_check_fan_dutycycle()
|
||||
|
||||
if (fan.get_fan_dutycycle() > 35):
|
||||
@ -939,10 +821,8 @@ class device_monitor(object):
|
||||
# set up logging to file
|
||||
logging.basicConfig(
|
||||
filename=log_file,
|
||||
filemode='w',
|
||||
level=log_level,
|
||||
format= '[%(asctime)s] {%(pathname)s:%(lineno)d} %(levelname)s - %(message)s',
|
||||
datefmt='%H:%M:%S'
|
||||
format= '[%(asctime)s] {%(pathname)s:%(lineno)d} %(levelname)s - %(message)s'
|
||||
)
|
||||
|
||||
if DEBUG == True:
|
||||
|
@ -1,17 +1,36 @@
|
||||
#!/usr/bin/env python
|
||||
import os
|
||||
import commands
|
||||
def main():
|
||||
FAN0_TYPE="cat /sys/devices/pci0000:00/0000:00:1c.0/0000:0f:00.0/refpga-tmc.15/fan0_type"
|
||||
|
||||
try:
|
||||
status,fan0_type=commands.getstatusoutput(FAN0_TYPE)
|
||||
except Exception as e:
|
||||
print "Error on refpga-tmc.15 fan0_type e:" + str(e)
|
||||
return False
|
||||
def fantype_detect():
|
||||
|
||||
refpgaTMC_path = "/sys/devices/pci0000:00/0000:00:1c.0/0000:0f:00.0/refpga-tmc.15"
|
||||
|
||||
AFO = "1"
|
||||
AFI = "0"
|
||||
|
||||
if fan0_type == AFO:
|
||||
#default fan type is AFI
|
||||
default_fantype = 0
|
||||
|
||||
for filename in os.listdir(refpgaTMC_path):
|
||||
if filename.endswith('_type'):
|
||||
fantype_path = os.path.join(refpgaTMC_path, filename)
|
||||
cat_string = "cat "
|
||||
fantype_string = cat_string + fantype_path
|
||||
status,fan_type=commands.getstatusoutput(fantype_string)
|
||||
if ((fan_type == AFO) or (fan_type == AFI)):
|
||||
return fan_type
|
||||
else:
|
||||
pass
|
||||
|
||||
return default_fantype
|
||||
|
||||
def main():
|
||||
AFO_value = "1"
|
||||
|
||||
fan_type = fantype_detect()
|
||||
|
||||
if fan_type == AFO_value:
|
||||
temp_thres_file = open("/usr/local/bin/temperature_thresholds_AFO.txt", "r+")
|
||||
print temp_thres_file.read()
|
||||
else:
|
||||
|
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Disable exit on non zero
|
||||
set +e
|
||||
|
||||
# Unloading this module as it contains the reboot
|
||||
# notifier hook. When the kexec is invoked with platform
|
||||
# reset handlers, it results in a cold reboot. Removing
|
||||
# the reset handlers ensures that kernel does a kexec
|
||||
# based fast reboot
|
||||
rmmod jnx-refpga-lpcm > /dev/null 2>&1
|
||||
|
||||
/usr/bin/qfx5200-fast-reboot/fast-reboot $@
|
||||
|
||||
# Re-load the module if the fast-reboot script returns
|
||||
# here.
|
||||
modprobe jnx-refpga-lpcm > /dev/null 2>&1
|
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Disable exit on non zero
|
||||
set +e
|
||||
|
||||
# Unloading this module as it contains the reboot
|
||||
# notifier hook. When the kexec is invoked with platform
|
||||
# reset handlers, it results in a cold reboot. Removing
|
||||
# the reset handlers ensures that kernel does a kexec
|
||||
# based fast reboot
|
||||
rmmod jnx-refpga-lpcm > /dev/null 2>&1
|
||||
|
||||
/usr/bin/qfx5200-warm-reboot/warm-reboot $@
|
||||
|
||||
# Re-load the module if the warm-reboot script returns
|
||||
# here.
|
||||
modprobe jnx-refpga-lpcm > /dev/null 2>&1
|
@ -306,7 +306,7 @@ static void __exit qfx5210_64x_psu_exit(void)
|
||||
/*
|
||||
* Unregister the cpld soft reset handler
|
||||
*/
|
||||
if (!unregister_restart_handler(&qfx5210_nb)) {
|
||||
if (unregister_reboot_notifier(&qfx5210_nb)) {
|
||||
printk(KERN_CRIT "Failed to uregister restart handler\n");
|
||||
}
|
||||
|
||||
|
@ -484,7 +484,6 @@ def set_device(args):
|
||||
if int(args[1])>100:
|
||||
show_set_help()
|
||||
return
|
||||
#print ALL_DEVICE['fan']
|
||||
#fan1~6 is all fine, all fan share same setting
|
||||
node = ALL_DEVICE['fan'] ['fan1'][0]
|
||||
node = node.replace(node.split("/")[-1], 'fan_duty_cycle_percentage')
|
||||
|
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Disable exit on non zero
|
||||
set +e
|
||||
|
||||
# Unloading this module as it contains the reboot
|
||||
# notifier hook. When the kexec is invoked with platform
|
||||
# reset handlers, it results in a cold reboot. Removing
|
||||
# the reset handlers ensures that kernel does a kexec
|
||||
# based fast reboot
|
||||
rmmod x86-64-juniper-qfx5210-64x-psu > /dev/null 2>&1
|
||||
|
||||
/usr/bin/qfx5210-fast-reboot/fast-reboot $@
|
||||
|
||||
# Re-load the module if the fast-reboot script returns
|
||||
# here
|
||||
modprobe x86-64-juniper-qfx5210-64x-psu > /dev/null 2>&1
|
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Disable exit on non zero
|
||||
set +e
|
||||
|
||||
# Unloading this module as it contains the reboot
|
||||
# notifier hook. When the kexec is invoked with platform
|
||||
# reset handlers, it results in a cold reboot. Removing
|
||||
# the reset handlers ensures that kernel does a kexec
|
||||
# based fast reboot
|
||||
rmmod x86-64-juniper-qfx5210-64x-psu > /dev/null 2>&1
|
||||
|
||||
/usr/bin/qfx5210-warm-reboot/warm-reboot $@
|
||||
|
||||
# Re-load the module if the warm-reboot script returns
|
||||
# here
|
||||
modprobe x86-64-juniper-qfx5210-64x-psu > /dev/null 2>&1
|
@ -270,9 +270,13 @@ class Chassis(ChassisBase):
|
||||
|
||||
elif str(platform_name) == "x86_64-juniper_networks_qfx5200-r0" :
|
||||
log_info("Juniper Platform QFX5200 ")
|
||||
status, major_version = commands.getstatusoutput("busybox devmem 0xFED50000 8")
|
||||
status, minor_version = commands.getstatusoutput("busybox devmem 0xFED50001 8")
|
||||
status, last_reboot_reason = commands.getstatusoutput("busybox devmem 0xFED50004 8")
|
||||
if (status == 0):
|
||||
if last_reboot_reason == "0x80":
|
||||
if (major_version == "0x31") and (minor_version == "0x03") and (last_reboot_reason == "0x80"):
|
||||
return (ChassisBase.REBOOT_CAUSE_NON_HARDWARE, None)
|
||||
elif (major_version == "0x31") and (minor_version == "0x05") and (last_reboot_reason == "0x02"):
|
||||
return (ChassisBase.REBOOT_CAUSE_NON_HARDWARE, None)
|
||||
elif last_reboot_reason == "0x40" or last_reboot_reason == "0x08":
|
||||
return (ChassisBase.REBOOT_CAUSE_WATCHDOG, None)
|
||||
@ -284,16 +288,23 @@ class Chassis(ChassisBase):
|
||||
return (ChassisBase.REBOOT_CAUSE_HARDWARE_OTHER, "Unknown reason")
|
||||
else:
|
||||
time.sleep(3)
|
||||
status, major_version = commands.getstatusoutput("busybox devmem 0xFED50000 8")
|
||||
status, minor_version = commands.getstatusoutput("busybox devmem 0xFED50001 8")
|
||||
status, last_reboot_reason = commands.getstatusoutput("busybox devmem 0xFED50004 8")
|
||||
if last_reboot_reason == "0x80":
|
||||
return (ChassisBase.REBOOT_CAUSE_NON_HARDWARE, None)
|
||||
elif last_reboot_reason == "0x40" or last_reboot_reason == "0x08":
|
||||
return (ChassisBase.REBOOT_CAUSE_WATCHDOG, None)
|
||||
elif last_reboot_reason == "0x20":
|
||||
return (ChassisBase.REBOOT_CAUSE_POWER_LOSS, None)
|
||||
elif last_reboot_reason == "0x10":
|
||||
return (ChassisBase.REBOOT_CAUSE_HARDWARE_OTHER, "Swizzle Reset")
|
||||
else:
|
||||
return (ChassisBase.REBOOT_CAUSE_HARDWARE_OTHER, "Unknown reason")
|
||||
if (status == 0):
|
||||
if (major_version == "0x31") and (minor_version == "0x03") and (last_reboot_reason == "0x80"):
|
||||
return (ChassisBase.REBOOT_CAUSE_NON_HARDWARE, None)
|
||||
elif (major_version == "0x31") and (minor_version == "0x05") and (last_reboot_reason == "0x02"):
|
||||
return (ChassisBase.REBOOT_CAUSE_NON_HARDWARE, None)
|
||||
elif last_reboot_reason == "0x40" or last_reboot_reason == "0x08":
|
||||
return (ChassisBase.REBOOT_CAUSE_WATCHDOG, None)
|
||||
elif last_reboot_reason == "0x20":
|
||||
return (ChassisBase.REBOOT_CAUSE_POWER_LOSS, None)
|
||||
elif last_reboot_reason == "0x10":
|
||||
return (ChassisBase.REBOOT_CAUSE_HARDWARE_OTHER, "Swizzle Reset")
|
||||
else:
|
||||
return (ChassisBase.REBOOT_CAUSE_HARDWARE_OTHER, "Unknown reason")
|
||||
else:
|
||||
log_info("Error while reading Re-Fpga")
|
||||
else:
|
||||
log_info("Juniper QFX5200 and QFX5210 platforms are supported")
|
||||
log_info("Unsupported platform")
|
||||
|
Loading…
Reference in New Issue
Block a user