[openib-general] [librmdacm] fix rping to return a value different than zero when there is a failure
Steve Wise
swise at opengridcomputing.com
Thu May 18 08:59:39 PDT 2006
On Thu, 2006-05-18 at 18:01 +0300, Dotan Barak wrote:
> Hi.
>
> Here is a patch to fix this issue in the test.
> I couldn't find the parameters for executing this test. can you please send me an a command line example which i can use?
> thanks
>
>
[root at bass4 perftest]# rping -?
rping -c|s [-vVd] [-S size] [-C count] -a addr -p port
-c client side
-s server side
-v display ping data to stdout
-V verbosity
-d debug printfs
-S size ping data size
-C count ping count times
-a addr address
-p port port
To ping 100 packets of size 100 and see something, run this on the
server:
# rping -s -S100 -a 0.0.0.0 -p 9999
and this on the client:
# rping -c -Vv -S 100 -C 100 -a <remote rdma ip address> -p 9999
I just noticed that the usage is wrong. -V _validates_ the ping/pong data.
patch comments below:
>
>
> Added checks to the return values of all of the functions that may fail
> (in order to add this test to the regression system).
>
> Signed-off-by: Dotan Barak <dotanb at mellanox.co.il>
>
<snip>
>
> static int rping_accept(struct rping_cb *cb)
> @@ -545,7 +554,9 @@ static void *cm_thread(void *arg)
> fprintf(stderr, "rdma_get_cm_event err %d\n", ret);
> exit(ret);
> }
> - rping_cma_event_handler(event->id, event);
> + ret = rping_cma_event_handler(event->id, event);
> + if (ret)
> + exit(ret);
> rdma_ack_cm_event(event);
Won't the process hang on exit if all the events are not acked? I seem
to remember this happening when I was debugging this program originally.
If it will hang, then fix the patch to ack the events before exiting...
> }
> }
> @@ -559,7 +570,7 @@ static void *cq_thread(void *arg)
>
> DEBUG_LOG("cq_thread started.\n");
>
> - while (1) {
> + while (1) {
> ret = ibv_get_cq_event(cb->channel, &ev_cq, &ev_ctx);
> if (ret) {
> fprintf(stderr, "Failed to get cq event!\n");
> @@ -574,7 +585,9 @@ static void *cq_thread(void *arg)
> fprintf(stderr, "Failed to set notify!\n");
> exit(ret);
> }
> - rping_cq_event_handler(cb);
> + ret = rping_cq_event_handler(cb);
> + if (ret);
> + exit(ret);
> ibv_ack_cq_events(cb->cq, 1);
Same comment.
More information about the general
mailing list