Skip to content

Commit 0eb4634

Browse files
lsgunthjonmason
authored andcommitted
ntb: ntb_test: ensure the link is up before trying to configure the mws
After the link tests, there is a race on one side of the test for the link coming up. It's possible, in some cases, for the test script to write to the 'peer_trans' files before the link has come up. To fix this, we simply use the link event file to ensure both sides see the link as up before continuning. Signed-off-by: Logan Gunthorpe <[email protected]> Acked-by: Allen Hubbe <[email protected]> Signed-off-by: Jon Mason <[email protected]> Fixes: a9c59ef ("ntb_test: Add a selftest script for the NTB subsystem")
1 parent f3fd2af commit 0eb4634

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tools/testing/selftests/ntb/ntb_test.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,10 @@ function ntb_tool_tests()
333333
link_test $LOCAL_TOOL $REMOTE_TOOL
334334
link_test $REMOTE_TOOL $LOCAL_TOOL
335335

336+
#Ensure the link is up on both sides before continuing
337+
write_file Y $LOCAL_TOOL/link_event
338+
write_file Y $REMOTE_TOOL/link_event
339+
336340
for PEER_TRANS in $(ls $LOCAL_TOOL/peer_trans*); do
337341
PT=$(basename $PEER_TRANS)
338342
write_file $MW_SIZE $LOCAL_TOOL/$PT

0 commit comments

Comments
 (0)