diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-02-04 14:13:49 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-02-04 14:13:49 -0500 |
commit | d3658c2266012f270da52e3e0365536e394bd3bd (patch) | |
tree | 3ea28fa631873cb7bbc9eec4e8405ee886cd779a /tools | |
parent | 8ac4840a3c90cf45830b265c0a4d0876358e8f59 (diff) | |
parent | 3b28c987fb9547ca9aac73241d0e281cf646387c (diff) |
Merge tag 'ntb-4.16' of git://github.com/jonmason/ntb
Pull NTB updates from Jon Mason:
"Bug fixes galore, removal of the ntb atom driver, and updates to the
ntb tools and tests to support the multi-port interface"
* tag 'ntb-4.16' of git://github.com/jonmason/ntb: (37 commits)
NTB: ntb_perf: fix cast to restricted __le32
ntb_perf: Fix an error code in perf_copy_chunk()
ntb_hw_switchtec: Make function switchtec_ntb_remove() static
NTB: ntb_tool: fix memory leak on 'buf' on error exit path
NTB: ntb_perf: fix printing of resource_size_t
NTB: ntb_hw_idt: Set NTB_TOPO_SWITCH topology
NTB: ntb_test: Update ntb_perf tests
NTB: ntb_test: Update ntb_tool MW tests
NTB: ntb_test: Add ntb_tool Message tests
NTB: ntb_test: Update ntb_tool Scratchpad tests
NTB: ntb_test: Update ntb_tool DB tests
NTB: ntb_test: Update ntb_tool link tests
NTB: ntb_test: Add ntb_tool port tests
NTB: ntb_test: Safely use paths with whitespace
NTB: ntb_perf: Add full multi-port NTB API support
NTB: ntb_tool: Add full multi-port NTB API support
NTB: ntb_pp: Add full multi-port NTB API support
NTB: Fix UB/bug in ntb_mw_get_align()
NTB: Set dma mask and dma coherent mask to NTB devices
NTB: Rename NTB messaging API methods
...
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/testing/selftests/ntb/ntb_test.sh | 307 |
1 files changed, 232 insertions, 75 deletions
diff --git a/tools/testing/selftests/ntb/ntb_test.sh b/tools/testing/selftests/ntb/ntb_test.sh index 5fc7ad359e21..08cbfbbc7029 100755 --- a/tools/testing/selftests/ntb/ntb_test.sh +++ b/tools/testing/selftests/ntb/ntb_test.sh | |||
@@ -18,7 +18,6 @@ LIST_DEVS=FALSE | |||
18 | 18 | ||
19 | DEBUGFS=${DEBUGFS-/sys/kernel/debug} | 19 | DEBUGFS=${DEBUGFS-/sys/kernel/debug} |
20 | 20 | ||
21 | DB_BITMASK=0x7FFF | ||
22 | PERF_RUN_ORDER=32 | 21 | PERF_RUN_ORDER=32 |
23 | MAX_MW_SIZE=0 | 22 | MAX_MW_SIZE=0 |
24 | RUN_DMA_TESTS= | 23 | RUN_DMA_TESTS= |
@@ -39,15 +38,17 @@ function show_help() | |||
39 | echo "be highly recommended." | 38 | echo "be highly recommended." |
40 | echo | 39 | echo |
41 | echo "Options:" | 40 | echo "Options:" |
42 | echo " -b BITMASK doorbell clear bitmask for ntb_tool" | ||
43 | echo " -C don't cleanup ntb modules on exit" | 41 | echo " -C don't cleanup ntb modules on exit" |
44 | echo " -d run dma tests" | ||
45 | echo " -h show this help message" | 42 | echo " -h show this help message" |
46 | echo " -l list available local and remote PCI ids" | 43 | echo " -l list available local and remote PCI ids" |
47 | echo " -r REMOTE_HOST specify the remote's hostname to connect" | 44 | echo " -r REMOTE_HOST specify the remote's hostname to connect" |
48 | echo " to for the test (using ssh)" | 45 | echo " to for the test (using ssh)" |
49 | echo " -p NUM ntb_perf run order (default: $PERF_RUN_ORDER)" | 46 | echo " -m MW_SIZE memory window size for ntb_tool" |
50 | echo " -w max_mw_size maxmium memory window size" | 47 | echo " (default: $MW_SIZE)" |
48 | echo " -d run dma tests for ntb_perf" | ||
49 | echo " -p ORDER total data order for ntb_perf" | ||
50 | echo " (default: $PERF_RUN_ORDER)" | ||
51 | echo " -w MAX_MW_SIZE maxmium memory window size for ntb_perf" | ||
51 | echo | 52 | echo |
52 | } | 53 | } |
53 | 54 | ||
@@ -56,7 +57,6 @@ function parse_args() | |||
56 | OPTIND=0 | 57 | OPTIND=0 |
57 | while getopts "b:Cdhlm:r:p:w:" opt; do | 58 | while getopts "b:Cdhlm:r:p:w:" opt; do |
58 | case "$opt" in | 59 | case "$opt" in |
59 | b) DB_BITMASK=${OPTARG} ;; | ||
60 | C) DONT_CLEANUP=1 ;; | 60 | C) DONT_CLEANUP=1 ;; |
61 | d) RUN_DMA_TESTS=1 ;; | 61 | d) RUN_DMA_TESTS=1 ;; |
62 | h) show_help; exit 0 ;; | 62 | h) show_help; exit 0 ;; |
@@ -87,7 +87,7 @@ set -e | |||
87 | 87 | ||
88 | function _modprobe() | 88 | function _modprobe() |
89 | { | 89 | { |
90 | modprobe "$@" | 90 | modprobe "$@" |
91 | 91 | ||
92 | if [[ "$REMOTE_HOST" != "" ]]; then | 92 | if [[ "$REMOTE_HOST" != "" ]]; then |
93 | ssh "$REMOTE_HOST" modprobe "$@" | 93 | ssh "$REMOTE_HOST" modprobe "$@" |
@@ -127,15 +127,70 @@ function write_file() | |||
127 | fi | 127 | fi |
128 | } | 128 | } |
129 | 129 | ||
130 | function check_file() | ||
131 | { | ||
132 | split_remote $1 | ||
133 | |||
134 | if [[ "$REMOTE" != "" ]]; then | ||
135 | ssh "$REMOTE" "[[ -e ${VPATH} ]]" | ||
136 | else | ||
137 | [[ -e ${VPATH} ]] | ||
138 | fi | ||
139 | } | ||
140 | |||
141 | function subdirname() | ||
142 | { | ||
143 | echo $(basename $(dirname $1)) 2> /dev/null | ||
144 | } | ||
145 | |||
146 | function find_pidx() | ||
147 | { | ||
148 | PORT=$1 | ||
149 | PPATH=$2 | ||
150 | |||
151 | for ((i = 0; i < 64; i++)); do | ||
152 | PEER_DIR="$PPATH/peer$i" | ||
153 | |||
154 | check_file ${PEER_DIR} || break | ||
155 | |||
156 | PEER_PORT=$(read_file "${PEER_DIR}/port") | ||
157 | if [[ ${PORT} -eq $PEER_PORT ]]; then | ||
158 | echo $i | ||
159 | return 0 | ||
160 | fi | ||
161 | done | ||
162 | |||
163 | return 1 | ||
164 | } | ||
165 | |||
166 | function port_test() | ||
167 | { | ||
168 | LOC=$1 | ||
169 | REM=$2 | ||
170 | |||
171 | echo "Running port tests on: $(basename $LOC) / $(basename $REM)" | ||
172 | |||
173 | LOCAL_PORT=$(read_file "$LOC/port") | ||
174 | REMOTE_PORT=$(read_file "$REM/port") | ||
175 | |||
176 | LOCAL_PIDX=$(find_pidx ${REMOTE_PORT} "$LOC") | ||
177 | REMOTE_PIDX=$(find_pidx ${LOCAL_PORT} "$REM") | ||
178 | |||
179 | echo "Local port ${LOCAL_PORT} with index ${REMOTE_PIDX} on remote host" | ||
180 | echo "Peer port ${REMOTE_PORT} with index ${LOCAL_PIDX} on local host" | ||
181 | |||
182 | echo " Passed" | ||
183 | } | ||
184 | |||
130 | function link_test() | 185 | function link_test() |
131 | { | 186 | { |
132 | LOC=$1 | 187 | LOC=$1 |
133 | REM=$2 | 188 | REM=$2 |
134 | EXP=0 | 189 | EXP=0 |
135 | 190 | ||
136 | echo "Running link tests on: $(basename $LOC) / $(basename $REM)" | 191 | echo "Running link tests on: $(subdirname $LOC) / $(subdirname $REM)" |
137 | 192 | ||
138 | if ! write_file "N" "$LOC/link" 2> /dev/null; then | 193 | if ! write_file "N" "$LOC/../link" 2> /dev/null; then |
139 | echo " Unsupported" | 194 | echo " Unsupported" |
140 | return | 195 | return |
141 | fi | 196 | fi |
@@ -143,12 +198,11 @@ function link_test() | |||
143 | write_file "N" "$LOC/link_event" | 198 | write_file "N" "$LOC/link_event" |
144 | 199 | ||
145 | if [[ $(read_file "$REM/link") != "N" ]]; then | 200 | if [[ $(read_file "$REM/link") != "N" ]]; then |
146 | echo "Expected remote link to be down in $REM/link" >&2 | 201 | echo "Expected link to be down in $REM/link" >&2 |
147 | exit -1 | 202 | exit -1 |
148 | fi | 203 | fi |
149 | 204 | ||
150 | write_file "Y" "$LOC/link" | 205 | write_file "Y" "$LOC/../link" |
151 | write_file "Y" "$LOC/link_event" | ||
152 | 206 | ||
153 | echo " Passed" | 207 | echo " Passed" |
154 | } | 208 | } |
@@ -161,58 +215,136 @@ function doorbell_test() | |||
161 | 215 | ||
162 | echo "Running db tests on: $(basename $LOC) / $(basename $REM)" | 216 | echo "Running db tests on: $(basename $LOC) / $(basename $REM)" |
163 | 217 | ||
164 | write_file "c $DB_BITMASK" "$REM/db" | 218 | DB_VALID_MASK=$(read_file "$LOC/db_valid_mask") |
219 | |||
220 | write_file "c $DB_VALID_MASK" "$REM/db" | ||
165 | 221 | ||
166 | for ((i=1; i <= 8; i++)); do | 222 | for ((i = 0; i < 64; i++)); do |
167 | let DB=$(read_file "$REM/db") || true | 223 | DB=$(read_file "$REM/db") |
168 | if [[ "$DB" != "$EXP" ]]; then | 224 | if [[ "$DB" -ne "$EXP" ]]; then |
169 | echo "Doorbell doesn't match expected value $EXP " \ | 225 | echo "Doorbell doesn't match expected value $EXP " \ |
170 | "in $REM/db" >&2 | 226 | "in $REM/db" >&2 |
171 | exit -1 | 227 | exit -1 |
172 | fi | 228 | fi |
173 | 229 | ||
174 | let "MASK=1 << ($i-1)" || true | 230 | let "MASK = (1 << $i) & $DB_VALID_MASK" || true |
175 | let "EXP=$EXP | $MASK" || true | 231 | let "EXP = $EXP | $MASK" || true |
232 | |||
176 | write_file "s $MASK" "$LOC/peer_db" | 233 | write_file "s $MASK" "$LOC/peer_db" |
177 | done | 234 | done |
178 | 235 | ||
236 | write_file "c $DB_VALID_MASK" "$REM/db_mask" | ||
237 | write_file $DB_VALID_MASK "$REM/db_event" | ||
238 | write_file "s $DB_VALID_MASK" "$REM/db_mask" | ||
239 | |||
240 | write_file "c $DB_VALID_MASK" "$REM/db" | ||
241 | |||
179 | echo " Passed" | 242 | echo " Passed" |
180 | } | 243 | } |
181 | 244 | ||
182 | function read_spad() | 245 | function get_files_count() |
183 | { | 246 | { |
184 | VPATH=$1 | 247 | NAME=$1 |
185 | IDX=$2 | 248 | LOC=$2 |
249 | |||
250 | split_remote $LOC | ||
186 | 251 | ||
187 | ROW=($(read_file "$VPATH" | grep -e "^$IDX")) | 252 | if [[ "$REMOTE" == "" ]]; then |
188 | let VAL=${ROW[1]} || true | 253 | echo $(ls -1 "$LOC"/${NAME}* 2>/dev/null | wc -l) |
189 | echo $VAL | 254 | else |
255 | echo $(ssh "$REMOTE" "ls -1 \"$VPATH\"/${NAME}* | \ | ||
256 | wc -l" 2> /dev/null) | ||
257 | fi | ||
190 | } | 258 | } |
191 | 259 | ||
192 | function scratchpad_test() | 260 | function scratchpad_test() |
193 | { | 261 | { |
194 | LOC=$1 | 262 | LOC=$1 |
195 | REM=$2 | 263 | REM=$2 |
196 | CNT=$(read_file "$LOC/spad" | wc -l) | ||
197 | 264 | ||
198 | echo "Running spad tests on: $(basename $LOC) / $(basename $REM)" | 265 | echo "Running spad tests on: $(subdirname $LOC) / $(subdirname $REM)" |
266 | |||
267 | CNT=$(get_files_count "spad" "$LOC") | ||
268 | |||
269 | if [[ $CNT -eq 0 ]]; then | ||
270 | echo " Unsupported" | ||
271 | return | ||
272 | fi | ||
199 | 273 | ||
200 | for ((i = 0; i < $CNT; i++)); do | 274 | for ((i = 0; i < $CNT; i++)); do |
201 | VAL=$RANDOM | 275 | VAL=$RANDOM |
202 | write_file "$i $VAL" "$LOC/peer_spad" | 276 | write_file "$VAL" "$LOC/spad$i" |
203 | RVAL=$(read_spad "$REM/spad" $i) | 277 | RVAL=$(read_file "$REM/../spad$i") |
204 | 278 | ||
205 | if [[ "$VAL" != "$RVAL" ]]; then | 279 | if [[ "$VAL" -ne "$RVAL" ]]; then |
206 | echo "Scratchpad doesn't match expected value $VAL " \ | 280 | echo "Scratchpad $i value $RVAL doesn't match $VAL" >&2 |
207 | "in $REM/spad, got $RVAL" >&2 | ||
208 | exit -1 | 281 | exit -1 |
209 | fi | 282 | fi |
283 | done | ||
284 | |||
285 | echo " Passed" | ||
286 | } | ||
287 | |||
288 | function message_test() | ||
289 | { | ||
290 | LOC=$1 | ||
291 | REM=$2 | ||
292 | |||
293 | echo "Running msg tests on: $(subdirname $LOC) / $(subdirname $REM)" | ||
294 | |||
295 | CNT=$(get_files_count "msg" "$LOC") | ||
210 | 296 | ||
297 | if [[ $CNT -eq 0 ]]; then | ||
298 | echo " Unsupported" | ||
299 | return | ||
300 | fi | ||
301 | |||
302 | MSG_OUTBITS_MASK=$(read_file "$LOC/../msg_inbits") | ||
303 | MSG_INBITS_MASK=$(read_file "$REM/../msg_inbits") | ||
304 | |||
305 | write_file "c $MSG_OUTBITS_MASK" "$LOC/../msg_sts" | ||
306 | write_file "c $MSG_INBITS_MASK" "$REM/../msg_sts" | ||
307 | |||
308 | for ((i = 0; i < $CNT; i++)); do | ||
309 | VAL=$RANDOM | ||
310 | write_file "$VAL" "$LOC/msg$i" | ||
311 | RVAL=$(read_file "$REM/../msg$i") | ||
312 | |||
313 | if [[ "$VAL" -ne "${RVAL%%<-*}" ]]; then | ||
314 | echo "Message $i value $RVAL doesn't match $VAL" >&2 | ||
315 | exit -1 | ||
316 | fi | ||
211 | done | 317 | done |
212 | 318 | ||
213 | echo " Passed" | 319 | echo " Passed" |
214 | } | 320 | } |
215 | 321 | ||
322 | function get_number() | ||
323 | { | ||
324 | KEY=$1 | ||
325 | |||
326 | sed -n "s/^\(${KEY}\)[ \t]*\(0x[0-9a-fA-F]*\)\(\[p\]\)\?$/\2/p" | ||
327 | } | ||
328 | |||
329 | function mw_alloc() | ||
330 | { | ||
331 | IDX=$1 | ||
332 | LOC=$2 | ||
333 | REM=$3 | ||
334 | |||
335 | write_file $MW_SIZE "$LOC/mw_trans$IDX" | ||
336 | |||
337 | INB_MW=$(read_file "$LOC/mw_trans$IDX") | ||
338 | MW_ALIGNED_SIZE=$(echo "$INB_MW" | get_number "Window Size") | ||
339 | MW_DMA_ADDR=$(echo "$INB_MW" | get_number "DMA Address") | ||
340 | |||
341 | write_file "$MW_DMA_ADDR:$(($MW_ALIGNED_SIZE))" "$REM/peer_mw_trans$IDX" | ||
342 | |||
343 | if [[ $MW_SIZE -ne $MW_ALIGNED_SIZE ]]; then | ||
344 | echo "MW $IDX size aligned to $MW_ALIGNED_SIZE" | ||
345 | fi | ||
346 | } | ||
347 | |||
216 | function write_mw() | 348 | function write_mw() |
217 | { | 349 | { |
218 | split_remote $2 | 350 | split_remote $2 |
@@ -225,17 +357,15 @@ function write_mw() | |||
225 | fi | 357 | fi |
226 | } | 358 | } |
227 | 359 | ||
228 | function mw_test() | 360 | function mw_check() |
229 | { | 361 | { |
230 | IDX=$1 | 362 | IDX=$1 |
231 | LOC=$2 | 363 | LOC=$2 |
232 | REM=$3 | 364 | REM=$3 |
233 | 365 | ||
234 | echo "Running $IDX tests on: $(basename $LOC) / $(basename $REM)" | 366 | write_mw "$LOC/mw$IDX" |
235 | 367 | ||
236 | write_mw "$LOC/$IDX" | 368 | split_remote "$LOC/mw$IDX" |
237 | |||
238 | split_remote "$LOC/$IDX" | ||
239 | if [[ "$REMOTE" == "" ]]; then | 369 | if [[ "$REMOTE" == "" ]]; then |
240 | A=$VPATH | 370 | A=$VPATH |
241 | else | 371 | else |
@@ -243,7 +373,7 @@ function mw_test() | |||
243 | ssh "$REMOTE" cat "$VPATH" > "$A" | 373 | ssh "$REMOTE" cat "$VPATH" > "$A" |
244 | fi | 374 | fi |
245 | 375 | ||
246 | split_remote "$REM/peer_$IDX" | 376 | split_remote "$REM/peer_mw$IDX" |
247 | if [[ "$REMOTE" == "" ]]; then | 377 | if [[ "$REMOTE" == "" ]]; then |
248 | B=$VPATH | 378 | B=$VPATH |
249 | else | 379 | else |
@@ -251,7 +381,7 @@ function mw_test() | |||
251 | ssh "$REMOTE" cat "$VPATH" > "$B" | 381 | ssh "$REMOTE" cat "$VPATH" > "$B" |
252 | fi | 382 | fi |
253 | 383 | ||
254 | cmp -n $MW_SIZE "$A" "$B" | 384 | cmp -n $MW_ALIGNED_SIZE "$A" "$B" |
255 | if [[ $? != 0 ]]; then | 385 | if [[ $? != 0 ]]; then |
256 | echo "Memory window $MW did not match!" >&2 | 386 | echo "Memory window $MW did not match!" >&2 |
257 | fi | 387 | fi |
@@ -263,8 +393,39 @@ function mw_test() | |||
263 | if [[ "$B" == "/tmp/*" ]]; then | 393 | if [[ "$B" == "/tmp/*" ]]; then |
264 | rm "$B" | 394 | rm "$B" |
265 | fi | 395 | fi |
396 | } | ||
397 | |||
398 | function mw_free() | ||
399 | { | ||
400 | IDX=$1 | ||
401 | LOC=$2 | ||
402 | REM=$3 | ||
403 | |||
404 | write_file "$MW_DMA_ADDR:0" "$REM/peer_mw_trans$IDX" | ||
405 | |||
406 | write_file 0 "$LOC/mw_trans$IDX" | ||
407 | } | ||
408 | |||
409 | function mw_test() | ||
410 | { | ||
411 | LOC=$1 | ||
412 | REM=$2 | ||
413 | |||
414 | CNT=$(get_files_count "mw_trans" "$LOC") | ||
415 | |||
416 | for ((i = 0; i < $CNT; i++)); do | ||
417 | echo "Running mw$i tests on: $(subdirname $LOC) / " \ | ||
418 | "$(subdirname $REM)" | ||
419 | |||
420 | mw_alloc $i $LOC $REM | ||
421 | |||
422 | mw_check $i $LOC $REM | ||
423 | |||
424 | mw_free $i $LOC $REM | ||
425 | |||
426 | echo " Passed" | ||
427 | done | ||
266 | 428 | ||
267 | echo " Passed" | ||
268 | } | 429 | } |
269 | 430 | ||
270 | function pingpong_test() | 431 | function pingpong_test() |
@@ -274,13 +435,13 @@ function pingpong_test() | |||
274 | 435 | ||
275 | echo "Running ping pong tests on: $(basename $LOC) / $(basename $REM)" | 436 | echo "Running ping pong tests on: $(basename $LOC) / $(basename $REM)" |
276 | 437 | ||
277 | LOC_START=$(read_file $LOC/count) | 438 | LOC_START=$(read_file "$LOC/count") |
278 | REM_START=$(read_file $REM/count) | 439 | REM_START=$(read_file "$REM/count") |
279 | 440 | ||
280 | sleep 7 | 441 | sleep 7 |
281 | 442 | ||
282 | LOC_END=$(read_file $LOC/count) | 443 | LOC_END=$(read_file "$LOC/count") |
283 | REM_END=$(read_file $REM/count) | 444 | REM_END=$(read_file "$REM/count") |
284 | 445 | ||
285 | if [[ $LOC_START == $LOC_END ]] || [[ $REM_START == $REM_END ]]; then | 446 | if [[ $LOC_START == $LOC_END ]] || [[ $REM_START == $REM_END ]]; then |
286 | echo "Ping pong counter not incrementing!" >&2 | 447 | echo "Ping pong counter not incrementing!" >&2 |
@@ -300,19 +461,19 @@ function perf_test() | |||
300 | WITH="without" | 461 | WITH="without" |
301 | fi | 462 | fi |
302 | 463 | ||
303 | _modprobe ntb_perf run_order=$PERF_RUN_ORDER \ | 464 | _modprobe ntb_perf total_order=$PERF_RUN_ORDER \ |
304 | max_mw_size=$MAX_MW_SIZE use_dma=$USE_DMA | 465 | max_mw_size=$MAX_MW_SIZE use_dma=$USE_DMA |
305 | 466 | ||
306 | echo "Running local perf test $WITH DMA" | 467 | echo "Running local perf test $WITH DMA" |
307 | write_file "" $LOCAL_PERF/run | 468 | write_file "$LOCAL_PIDX" "$LOCAL_PERF/run" |
308 | echo -n " " | 469 | echo -n " " |
309 | read_file $LOCAL_PERF/run | 470 | read_file "$LOCAL_PERF/run" |
310 | echo " Passed" | 471 | echo " Passed" |
311 | 472 | ||
312 | echo "Running remote perf test $WITH DMA" | 473 | echo "Running remote perf test $WITH DMA" |
313 | write_file "" $REMOTE_PERF/run | 474 | write_file "$REMOTE_PIDX" "$REMOTE_PERF/run" |
314 | echo -n " " | 475 | echo -n " " |
315 | read_file $REMOTE_PERF/run | 476 | read_file "$REMOTE_PERF/run" |
316 | echo " Passed" | 477 | echo " Passed" |
317 | 478 | ||
318 | _modprobe -r ntb_perf | 479 | _modprobe -r ntb_perf |
@@ -320,48 +481,44 @@ function perf_test() | |||
320 | 481 | ||
321 | function ntb_tool_tests() | 482 | function ntb_tool_tests() |
322 | { | 483 | { |
323 | LOCAL_TOOL=$DEBUGFS/ntb_tool/$LOCAL_DEV | 484 | LOCAL_TOOL="$DEBUGFS/ntb_tool/$LOCAL_DEV" |
324 | REMOTE_TOOL=$REMOTE_HOST:$DEBUGFS/ntb_tool/$REMOTE_DEV | 485 | REMOTE_TOOL="$REMOTE_HOST:$DEBUGFS/ntb_tool/$REMOTE_DEV" |
325 | 486 | ||
326 | echo "Starting ntb_tool tests..." | 487 | echo "Starting ntb_tool tests..." |
327 | 488 | ||
328 | _modprobe ntb_tool | 489 | _modprobe ntb_tool |
329 | 490 | ||
330 | write_file Y $LOCAL_TOOL/link_event | 491 | port_test "$LOCAL_TOOL" "$REMOTE_TOOL" |
331 | write_file Y $REMOTE_TOOL/link_event | ||
332 | 492 | ||
333 | link_test $LOCAL_TOOL $REMOTE_TOOL | 493 | LOCAL_PEER_TOOL="$LOCAL_TOOL/peer$LOCAL_PIDX" |
334 | link_test $REMOTE_TOOL $LOCAL_TOOL | 494 | REMOTE_PEER_TOOL="$REMOTE_TOOL/peer$REMOTE_PIDX" |
495 | |||
496 | link_test "$LOCAL_PEER_TOOL" "$REMOTE_PEER_TOOL" | ||
497 | link_test "$REMOTE_PEER_TOOL" "$LOCAL_PEER_TOOL" | ||
335 | 498 | ||
336 | #Ensure the link is up on both sides before continuing | 499 | #Ensure the link is up on both sides before continuing |
337 | write_file Y $LOCAL_TOOL/link_event | 500 | write_file "Y" "$LOCAL_PEER_TOOL/link_event" |
338 | write_file Y $REMOTE_TOOL/link_event | 501 | write_file "Y" "$REMOTE_PEER_TOOL/link_event" |
339 | 502 | ||
340 | for PEER_TRANS in $(ls $LOCAL_TOOL/peer_trans*); do | 503 | doorbell_test "$LOCAL_TOOL" "$REMOTE_TOOL" |
341 | PT=$(basename $PEER_TRANS) | 504 | doorbell_test "$REMOTE_TOOL" "$LOCAL_TOOL" |
342 | write_file $MW_SIZE $LOCAL_TOOL/$PT | ||
343 | write_file $MW_SIZE $REMOTE_TOOL/$PT | ||
344 | done | ||
345 | 505 | ||
346 | doorbell_test $LOCAL_TOOL $REMOTE_TOOL | 506 | scratchpad_test "$LOCAL_PEER_TOOL" "$REMOTE_PEER_TOOL" |
347 | doorbell_test $REMOTE_TOOL $LOCAL_TOOL | 507 | scratchpad_test "$REMOTE_PEER_TOOL" "$LOCAL_PEER_TOOL" |
348 | scratchpad_test $LOCAL_TOOL $REMOTE_TOOL | ||
349 | scratchpad_test $REMOTE_TOOL $LOCAL_TOOL | ||
350 | 508 | ||
351 | for MW in $(ls $LOCAL_TOOL/mw*); do | 509 | message_test "$LOCAL_PEER_TOOL" "$REMOTE_PEER_TOOL" |
352 | MW=$(basename $MW) | 510 | message_test "$REMOTE_PEER_TOOL" "$LOCAL_PEER_TOOL" |
353 | 511 | ||
354 | mw_test $MW $LOCAL_TOOL $REMOTE_TOOL | 512 | mw_test "$LOCAL_PEER_TOOL" "$REMOTE_PEER_TOOL" |
355 | mw_test $MW $REMOTE_TOOL $LOCAL_TOOL | 513 | mw_test "$REMOTE_PEER_TOOL" "$LOCAL_PEER_TOOL" |
356 | done | ||
357 | 514 | ||
358 | _modprobe -r ntb_tool | 515 | _modprobe -r ntb_tool |
359 | } | 516 | } |
360 | 517 | ||
361 | function ntb_pingpong_tests() | 518 | function ntb_pingpong_tests() |
362 | { | 519 | { |
363 | LOCAL_PP=$DEBUGFS/ntb_pingpong/$LOCAL_DEV | 520 | LOCAL_PP="$DEBUGFS/ntb_pingpong/$LOCAL_DEV" |
364 | REMOTE_PP=$REMOTE_HOST:$DEBUGFS/ntb_pingpong/$REMOTE_DEV | 521 | REMOTE_PP="$REMOTE_HOST:$DEBUGFS/ntb_pingpong/$REMOTE_DEV" |
365 | 522 | ||
366 | echo "Starting ntb_pingpong tests..." | 523 | echo "Starting ntb_pingpong tests..." |
367 | 524 | ||
@@ -374,8 +531,8 @@ function ntb_pingpong_tests() | |||
374 | 531 | ||
375 | function ntb_perf_tests() | 532 | function ntb_perf_tests() |
376 | { | 533 | { |
377 | LOCAL_PERF=$DEBUGFS/ntb_perf/$LOCAL_DEV | 534 | LOCAL_PERF="$DEBUGFS/ntb_perf/$LOCAL_DEV" |
378 | REMOTE_PERF=$REMOTE_HOST:$DEBUGFS/ntb_perf/$REMOTE_DEV | 535 | REMOTE_PERF="$REMOTE_HOST:$DEBUGFS/ntb_perf/$REMOTE_DEV" |
379 | 536 | ||
380 | echo "Starting ntb_perf tests..." | 537 | echo "Starting ntb_perf tests..." |
381 | 538 | ||