Debian Codegraph @

test/dapltest/scripts/cl.sh

raw
1 #!/bin/sh
2 #
3 # Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved.
4 # Copyright (c) 2014 Intel Corporation. All rights reserved.
5 #
6 # This Software is licensed under one of the following licenses:
7 #
8 # 1) under the terms of the "Common Public License 1.0" a copy of which is
9 # in the file LICENSE.txt in the root directory. The license is also
10 # available from the Open Source Initiative, see
11 # http://www.opensource.org/licenses/cpl.php.
12 #
13 # 2) under the terms of the "The BSD License" a copy of which is in the file
14 # LICENSE2.txt in the root directory. The license is also available from
15 # the Open Source Initiative, see
16 # http://www.opensource.org/licenses/bsd-license.php.
17 #
18 # 3) under the terms of the "GNU General Public License (GPL) Version 2" a
19 # copy of which is in the file LICENSE3.txt in the root directory. The
20 # license is also available from the Open Source Initiative, see
21 # http://www.opensource.org/licenses/gpl-license.php.
22 #
23 # Licensee has the right to choose one of the above licenses.
24 #
25 # Redistributions of source code must retain the above copyright
26 # notice and one of the license notices.
27 #
28 # Redistributions in binary form must reproduce both the above copyright
29 # notice, one of the license notices in the documentation
30 # and/or other materials provided with the distribution.
31 #
32 # Sample DAPLtest client Usage: cl.sh hostname [testname] [device]
33 #
34 # default device = ofa-v2-ib0
35 #
36
37 DT=dapltest
38 D=ofa-v2-ib0
39 L=1
40 X=
41 T=
42 E=
43
44 # need some help?
45 if [ "$1" == "-h" ] ; then
46 T=
47 else
48 S=$1
49 if [ ! "$2" == "" ] ; then
50 T=$2
51 if [ ! "$3" == "" ] ; then
52 D=$3
53 fi
54 fi
55 fi
56
57 if [ ! "$X" == "" ] ; then
58 DAT_OS_DBG_TYPE=$X
59 DAT_DBG_TYPE=$X
60 DAT_DBG_LEVEL=$X
61 DAPL_DBG_LEVEL=$X
62 DAPL_DBG_TYPE=$X
63 else
64 DAT_DBG_TYPE=0x1
65 DAT_DBG_LEVEL=1
66 fi
67
68 echo ""
69 echo "uDAPL client test $DT $T $D -> $S"
70 echo ""
71
72 # Endpoint and Thread stress
73 if [ "$T" == "epa" ] ; then
74 T=10
75 E=10
76 LT=10
77 LE=50
78 for ((T=$T ; $T <= $LT ; $((T++)) )) ; do
79 for ((E=$E ; $E <= $LE ; $((E++)) )) ; do
80 echo $T $E: Multi: Threads[$T] Endpoints[$E] Send/Recv test - 4096 iterations, 3 8K segs
81 $DT -T T -s $S -D $D -i 4096 -t $T -w $E client SR 8192 3 server SR 8192 3
82 if [ $? -ne 0 ] ; then
83 echo failed $X
84 exit 1
85 fi
86 done
87 done
88 echo THREADS $LT and ENDPOINTS $LE loops completed.
89 exit
90 fi
91
92 if [ "$T" == "conn" ] ; then
93 # Connectivity test - client sends one buffer with one 4KB segments, one time.
94 # add '-d' for debug output.
95 $DT -T T -s $S -D $D -i 1 -t 1 -w 1 client SR 4096 server SR 4096
96 exit
97 fi
98
99 if [ "$T" == "trans" ] ; then
100 echo Transaction test - 8192 iterations, 1 thread, SR 4KB buffers
101 $DT -T T -s $S -D $D -i 8192 -t 1 -w 1 client SR 4096 server SR 4096
102 exit
103 fi
104
105 if [ "$T" == "transm" ] ; then
106 echo Multiple RW, RR, SR transactions, 4096 iterations
107 $DT -T T -P -t 1 -w 1 -i 4096 -s $S -D $D client RW 4096 1 server RW 2048 4 server RR 1024 1 client RR 2048 1 client SR 1024 3 -f server SR 256 3 -f
108 exit
109 fi
110
111 if [ "$T" == "transmx" ] ; then
112 echo Multiple RW, RR, SR transactions, 8192 iterations
113 $DT -T T -P -t 1 -w 1 -i 8192 -s $S -D $D \
114 client RW 32768 4 server RW 32768 4 \
115 server RR 32768 1 client RR 32768 1 \
116 client SR 16384 4 -f server SR 16384 4 -f
117 exit
118 fi
119
120 if [ "$T" == "transt" ] ; then
121 echo Multi-threaded[4] Transaction test - 4096 iterations, 1 thread, SR 4KB buffers
122 $DT -T T -s $S -D $D -i 4096 -t 4 -w 1 client SR 8192 3 server SR 8192 3
123 exit
124 fi
125
126 if [ "$T" == "transme" ] ; then
127 echo Multiple endpoints[4] transactions [RW, RR, SR], 4096 iterations
128 $DT -T T -P -t 1 -w 4 -i 4096 -s $S -D $D client RW 4096 1 server RW 2048 4 server RR 1024 1 client RR 2048 1 client SR 1024 3 -f server SR 256 3 -f
129 exit
130 fi
131
132 if [ "$T" == "transmet" ] ; then
133 echo Multiple: threads[2] endpoints[4] transactions[RW, RR, SR], 4096 iterations
134 $DT -T T -P -t 2 -w 4 -i 4096 -s $S -D $D client RW 4096 1 server RW 2048 4 server RR 1024 1 client RR 2048 1 client SR 1024 3 -f server SR 256 3 -f
135 exit
136 fi
137
138 if [ "$T" == "transmete" ] ; then
139 echo Multiple: threads[4] endpoints[4] transactions[RW, RR, SR], 8192 iterations
140 $DT -T T -P -t 4 -w 4 -i 8192 -s $S -D $D client RW 4096 1 server RW 2048 4 server RR 1024 1 client RR 2048 1 client SR 1024 3 -f server SR 256 3 -f
141 exit
142 fi
143
144 if [ "$T" == "threads" ] ; then
145 echo Multi Threaded[6] Send/Recv test - 4096 iterations, 3 8K segs
146 $DT -T T -s $S -D $D -i 4096 -t 6 -w 1 client SR 8192 3 server SR 8192 3
147 exit
148 fi
149
150 if [ "$T" == "threadsm" ] ; then
151 echo Multi: Threads[4] endpoints[4] Send/Recv test - 4096 iterations, 3 8K segs
152 $DT -T T -s $S -D $D -i 4096 -t 4 -w 4 client SR 8192 3 server SR 8192 3
153 exit
154 fi
155
156 if [ "$T" == "perf" ] ; then
157 #echo Performance test
158 $DT -T P -s $S -D $D -i 2048 -m b RW 4096 2
159 exit
160 fi
161
162 if [ "$T" == "rdma-read" ] ; then
163 $DT -T P -s $S -D $D -i 4096 RR 32768 1
164 exit
165 fi
166
167 if [ "$T" == "rdma-write" ] ; then
168 $DT -T P -s $S -D $D -i 4096 RW 32768 4
169 exit
170 fi
171
172 if [ "$T" == "bw" ] ; then
173 echo bandwidth 65K msgs
174 $DT -T P -s $S -D $D -i 4096 -p 16 -m b RW 65536 2
175 exit
176 fi
177
178 if [ "$T" == "latb" ] ; then
179 echo latency test - block for completion events
180 $DT -T P -s $S -D $D -i 8192 -p 1 -m b RW 4 1
181 exit
182 fi
183
184 if [ "$T" == "latp" ] ; then
185 echo latency test - poll completion events
186 $DT -T P -s $S -D $D -i 100000 -p 1 -m p RW 4 1
187 exit
188 fi
189
190 if [ "$T" == "lim" ] ; then
191 echo Resource limit tests
192 $DT -T L -D $D -w 8 -m 100 limit_ia
193 $DT -T L -D $D -w 8 -m 100 limit_pz
194 $DT -T L -D $D -w 8 -m 100 limit_evd
195 $DT -T L -D $D -w 8 -m 100 limit_ep
196 $DT -T L -D $D -w 8 -m 100 limit_psp
197 $DT -T L -D $D -w 8 -m 100 limit_lmr
198 $DT -T L -D $D -w 8 -m 15 limit_rpost
199 exit
200 fi
201
202 if [ "$T" == "regression" ] ; then
203 echo $T testing in $L Loops
204 # rdma-write, read, perf
205 TST="trans perf threads threadsm transm transt transme transmet transmete rdma-write rdma-read bw latb latp "
206 for ((n=1 ; $n <= $L ; $((n++)) )) ; do
207 for X in $TST ; do
208 $0 $1 $X $D
209 if [ $? -ne 0 ] ; then
210 echo failed $X
211 exit 1
212 fi
213 done
214 echo $n $T loops completed.
215 done
216 $DT -T Q -s $S -D $D
217 exit 0
218 fi
219
220 if [ "$T" == "stop" ] ; then
221 $DT -T Q -s $S -D $D
222 exit
223 fi
224
225 echo " usage: cl.sh hostname [testname [-D]]"
226 echo " where testname"
227 echo " stop - request DAPLtest server to exit."
228 echo " conn - simple connection with limited dater transfer"
229 echo " trans - single transaction test"
230 echo " transm - transaction test: multiple transactions [RW SND, RDMA]"
231 echo " transt - transaction test: multi-threaded, single transaction"
232 echo " transme - transaction test: multi-endpoints per thread "
233 echo " transmet - transaction test: multi: threads and endpoints per thread"
234 echo " transmete - transaction test: multi threads == endpoints"
235 echo " perf - Performance test"
236 echo " threads - multi-threaded single transaction test."
237 echo " threadsm - multi: threads and endpoints, single transaction test."
238 echo " rdma-write - RDMA write"
239 echo " rdma-read - RDMA read"
240 echo " bw - bandwidth"
241 echo " latb - latency tests, blocking for events"
242 echo " latp - latency tests, polling for events"
243 echo " lim - limit tests."
244 echo " regression - loop over a collection of all tests."
245
246 exit 0