public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH perftest] Avoid configuring the MRs with 1's
@ 2017-02-26 12:21 Ram Amrani
       [not found] ` <1488111691-23620-1-git-send-email-Ram.Amrani-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
       [not found] ` <HE1PR05MB11618D7789611C3526FBB791B5540@HE1PR05MB1161.eurprd05.prod.outlook.com>
  0 siblings, 2 replies; 5+ messages in thread
From: Ram Amrani @ 2017-02-26 12:21 UTC (permalink / raw)
  To: gilr-VPRAkNaXOzVWk0Htik3J/w
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	Ariel.Elior-YGCgFSpz5w/QT0dZR+AlfA, Ram Amrani

Avoid setting the value '1' in the MR. If this happens in a write latency
test then the server will send two consecutive packets, regardless of the
client's state. This can cause the application to hang - If the client
reaches the busy-wait loop after the second write then it'll keep waiting
for the value of the first write forever.

Signed-off-by: Ram Amrani <Ram.Amrani-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
---
 src/perftest_resources.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/perftest_resources.c b/src/perftest_resources.c
index afae5f2..dc768c4 100755
--- a/src/perftest_resources.c
+++ b/src/perftest_resources.c
@@ -1252,7 +1252,11 @@ int create_single_mr(struct pingpong_context *ctx, struct perftest_parameters *u
 	/* Initialize buffer with random numbers */
 	srand(time(NULL));
 	for (i = 0; i < ctx->buff_size; i++) {
-		((char*)ctx->buf[qp_index])[i] = (char)rand();
+		/* prevent the value 1 from being written into the buffer so in,
+		 * e.g., write latency test, the server won't send two packets
+		 * consecutively without receiving a packet from the client first.
+		 */ 
+		((char*)ctx->buf[qp_index])[i] = 2 + ((char)rand() % 255);
 	}
 
 	return 0;
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-03-05 15:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-26 12:21 [PATCH perftest] Avoid configuring the MRs with 1's Ram Amrani
     [not found] ` <1488111691-23620-1-git-send-email-Ram.Amrani-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
2017-02-28 20:00   ` Leon Romanovsky
     [not found]     ` <20170228200040.GD2754-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-03-01  9:03       ` Zohar Ben Aharon
     [not found] ` <HE1PR05MB11618D7789611C3526FBB791B5540@HE1PR05MB1161.eurprd05.prod.outlook.com>
     [not found]   ` <AM5PR0501MB2532CD619D600768E58EB1EEA92D0@AM5PR0501MB2532.eurprd05.prod.outlook.com>
     [not found]     ` <AM5PR0501MB2532CD619D600768E58EB1EEA92D0-Z3o2H//EDN6VqDs954T/B8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-03-05 15:14       ` Amrani, Ram
2017-03-05 15:16     ` Amrani, Ram

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox