diff mbox

[perftest,v2] Bug fix write latency

Message ID AM5PR0501MB253232900CECAD35B2E47E3BA92D0@AM5PR0501MB2532.eurprd05.prod.outlook.com (mailing list archive)
State Accepted
Headers show

Commit Message

Zohar Ben Aharon March 5, 2017, 3:39 p.m. UTC
Thanks Ram for the quick response!!!
it will be pushed to main branch within a few days.
Do you familiar with Perftest Git-hub repository ?  
	https://github.com/linux-rdma/perftest
you can use it to push patches as well. 


Thanks , 

Zohar Ben Aharon





-----Original Message-----
From: Ram Amrani [mailto:Ram.Amrani@cavium.com] 
Sent: Sunday, March 05, 2017 5:23 PM
To: Zohar Ben Aharon <zoharb@mellanox.com>; Gil Rockah <gilr@mellanox.com>
Cc: linux-rdma@vger.kernel.org; Ariel.Elior@cavium.com; leon@kernel.org; Ram Amrani <Ram.Amrani@cavium.com>
Subject: [PATCH perftest v2] Bug fix write latency

Avoid setting the value '1' in the MR. If this does happen 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 hang in the loop forever, waiting for the value of the first write.

Signed-off-by: Ram Amrani <Ram.Amrani@cavium.com>
---
 src/perftest_resources.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

--
1.8.3.1

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

Patch

diff --git a/src/perftest_resources.c b/src/perftest_resources.c index afae5f2..21ff972 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 + ((unsigned char)rand() % 255);
 	}
 
 	return 0;