@@ -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;