2 # Intel MIC Platform Software Stack (MPSS)
4 # Copyright(c) 2013 Intel Corporation.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License, version 2, as
8 # published by the Free Software Foundation.
10 # This program is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # General Public License for more details.
15 # The full GNU General Public License is included in this distribution in
16 # the file called "COPYING".
18 # Intel MIC User Space Tools.
22 # chkconfig: 2345 95 05
23 # description: start MPSS stack processing.
29 # Short-Description: MPSS stack control
30 # Description: MPSS stack control
33 # Source function library.
34 .
/etc
/init.d
/functions
37 sysfs
="/sys/class/mic"
38 mic_modules
="mic_host mic_x100_dma scif vop"
42 [ -x $exec ] ||
exit 5
44 if [ "`ps -e | awk '{print $4}' | grep mpssd | head -1`" = "mpssd" ]; then
45 echo -e $
"MPSSD already running! "
51 echo -e $
"Starting MPSS Stack"
52 echo -e $
"Loading MIC drivers:" $mic_modules
54 modprobe
-a $mic_modules
56 if [ $RETVAL -ne 0 ]; then
63 echo -n $
"Starting MPSSD "
66 if [ $RETVAL -ne 0 ]; then
79 # Wait till ping works
83 ipaddr
=`cat $f/cmdline`
84 ipaddr
=${ipaddr#*address,}
85 ipaddr
=`echo $ipaddr | cut -d, -f1 | cut -d\; -f1`
86 while [ $count -ge 0 ]
88 echo -e "Pinging "`basename $f`" "
89 ping -c 1 $ipaddr &> /dev
/null
91 if [ $RETVAL -eq 0 ]; then
96 count
=`expr $count - 1`
98 [ $RETVAL -ne 0 ] && failure || success
106 echo -e $
"Shutting down MPSS Stack: "
108 # Bail out if module is unloaded
109 if [ ! -d "$sysfs" ]; then
110 echo -n $
"Module unloaded "
116 # Shut down the cards.
119 # Wait for the cards to go offline
122 while [ "`cat $f/state`" != "ready" ]
125 echo -e "Waiting for "`basename $f`" to become ready"
129 # Display the status of the cards
133 echo -n $
"Killing MPSSD"
134 killall
-9 mpssd
2>/dev
/null
136 [ $RETVAL -ne 0 ] && failure || success
151 if [ "`ps -e | awk '{print $4}' | grep mpssd | head -n 1`" = "mpssd" ]; then
152 echo "mpssd is running"
154 echo "mpssd is stopped"
161 if [ ! -d "$sysfs" ]; then
162 echo -n $
"No MIC_HOST Module: "
171 echo -n $
"Removing MIC drivers:" $mic_modules
172 modprobe
-r $mic_modules
174 [ $RETVAL -ne 0 ] && failure || success
196 echo $
"Usage: $0 {start|stop|restart|status|unload}"