Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dell]Poller to detecte Intel Rangely C2000 LPC degradation #3065

Merged
merged 1 commit into from
Jun 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash
REV=$(lspci -xxx -s 0:0.0 | grep rev | awk -F 'rev ' '{print $2}' | sed 's/)//')
if [ $REV -gt 2 ]
then
exit 0
fi

test_val=(55 aa)
num_val=${#test_val[@]}
index=0
poll_interval=300
cpld_scratch_reg=0x102
smf_scratch_reg=0x202

function log_crit() {
local msg=$1

`logger -p user.crit -t DELL_LPC_BUS_MON $msg`
}

function validate_lpc() {
local reg=$1
local val=$2
local reg_str="CPLD scratch register"

if [ $reg == $smf_scratch_reg ]
then
reg_str="SMF scratch register"
fi
io_rd_wr.py --set --val $val --offset $reg
get_val=$(io_rd_wr.py --get --offset $reg | cut -d " " -f3)
if [ $val != $get_val ]
then
log_crit "LPC bus has deteriorated on this unit. \
$reg_str has value $get_val while expected is $val \
Please contact technical support"
fi
}
while true
do
val=${test_val[$index]}
validate_lpc $cpld_scratch_reg $val
validate_lpc $smf_scratch_reg $val
index=$(((index+1)%num_val))
sleep $poll_interval
done
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ s6100/scripts/iom_power_*.sh usr/local/bin
s6100/scripts/s6100_platform.sh usr/local/bin
common/dell_i2c_utils.sh usr/local/bin
common/io_rd_wr.py usr/local/bin
common/dell_lpc_mon.sh usr/local/bin
common/platform_reboot usr/share/sonic/device/x86_64-dell_s6100_c2538-r0
s6100/scripts/platform_sensors.py usr/local/bin
s6100/scripts/sensors usr/bin
s6100/systemd/platform-modules-s6100.service etc/systemd/system
s6100/systemd/s6100-lpc-monitor.service etc/systemd/system
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@
depmod -a
systemctl enable platform-modules-s6100.service
systemctl start platform-modules-s6100.service

systemctl enable s6100-lpc-monitor.service
systemctl start s6100-lpc-monitor.service

#DEBHELPER#
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
z9100/scripts/check_qsfp.sh usr/local/bin
z9100/scripts/z9100_platform.sh usr/local/bin
common/dell_i2c_utils.sh usr/local/bin
common/dell_lpc_mon.sh usr/local/bin
common/io_rd_wr.py usr/local/bin
common/platform_reboot usr/share/sonic/device/x86_64-dell_z9100_c2538-r0
z9100/scripts/platform_sensors.py usr/local/bin
z9100/scripts/sensors usr/bin
z9100/cfg/z9100-modules.conf etc/modules-load.d
z9100/systemd/platform-modules-z9100.service etc/systemd/system
z9100/systemd/z9100-lpc-monitor.service etc/systemd/system
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ systemctl enable platform-modules-z9100.service
systemctl start platform-modules-z9100.service


systemctl enable z9100-lpc-monitor.service
systemctl start z9100-lpc-monitor.service

#DEBHELPER#
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=Dell S6100 LPC bus monitoring poller
DefaultDependencies=no

[Service]
User=root
ExecStart=/usr/local/bin/dell_lpc_mon.sh
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=Dell Z9100 LPC bus monitoring poller
DefaultDependencies=no

[Service]
User=root
ExecStart=/usr/local/bin/dell_lpc_mon.sh
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target