2 # SPDX-License-Identifier: GPL-2.0-only
3 # Intel MIC Platform Software Stack (MPSS)
5 # Copyright(c) 2013 Intel Corporation.
7 # Intel MIC User Space Tools.
11 # chkconfig: 2345 95 05
12 # description: start MPSS stack processing.
18 # Short-Description: MPSS stack control
19 # Description: MPSS stack control
22 # Source function library.
23 .
/etc
/init.d
/functions
26 sysfs
="/sys/class/mic"
27 mic_modules
="mic_host mic_x100_dma scif vop"
31 [ -x $exec ] ||
exit 5
33 if [ "`ps -e | awk '{print $4}' | grep mpssd | head -1`" = "mpssd" ]; then
34 echo -e $
"MPSSD already running! "
40 echo -e $
"Starting MPSS Stack"
41 echo -e $
"Loading MIC drivers:" $mic_modules
43 modprobe
-a $mic_modules
45 if [ $RETVAL -ne 0 ]; then
52 echo -n $
"Starting MPSSD "
55 if [ $RETVAL -ne 0 ]; then
68 # Wait till ping works
72 ipaddr
=`cat $f/cmdline`
73 ipaddr
=${ipaddr#*address,}
74 ipaddr
=`echo $ipaddr | cut -d, -f1 | cut -d\; -f1`
75 while [ $count -ge 0 ]
77 echo -e "Pinging "`basename $f`" "
78 ping -c 1 $ipaddr &> /dev
/null
80 if [ $RETVAL -eq 0 ]; then
85 count
=`expr $count - 1`
87 [ $RETVAL -ne 0 ] && failure || success
95 echo -e $
"Shutting down MPSS Stack: "
97 # Bail out if module is unloaded
98 if [ ! -d "$sysfs" ]; then
99 echo -n $
"Module unloaded "
105 # Shut down the cards.
108 # Wait for the cards to go offline
111 while [ "`cat $f/state`" != "ready" ]
114 echo -e "Waiting for "`basename $f`" to become ready"
118 # Display the status of the cards
122 echo -n $
"Killing MPSSD"
123 killall
-9 mpssd
2>/dev
/null
125 [ $RETVAL -ne 0 ] && failure || success
140 if [ "`ps -e | awk '{print $4}' | grep mpssd | head -n 1`" = "mpssd" ]; then
141 echo "mpssd is running"
143 echo "mpssd is stopped"
150 if [ ! -d "$sysfs" ]; then
151 echo -n $
"No MIC_HOST Module: "
160 echo -n $
"Removing MIC drivers:" $mic_modules
161 modprobe
-r $mic_modules
163 [ $RETVAL -ne 0 ] && failure || success
185 echo $
"Usage: $0 {start|stop|restart|status|unload}"