Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/perftest_communication.c
Original file line number Diff line number Diff line change
Expand Up @@ -553,13 +553,24 @@ static int rdma_read_keys(struct pingpong_dest *rem_dest,
struct ibv_wc wc;
int ne;

unsigned long timeout_counter = 0;

do {
ne = ibv_poll_cq(comm->rdma_ctx->recv_cq,1,&wc);
ne = ibv_poll_cq(comm->rdma_ctx->recv_cq, 1, &wc);
if (ne == 0) {
timeout_counter++;
usleep(2000); /* sleep 2ms before polling cq again */
if (timeout_counter > MAX_TIMEOUT_ITER) {
fprintf(stderr,
"Error: Timeout waiting for remote data.\n");
return 1;
}
}
} while (ne == 0);

if (wc.status || !(wc.opcode & IBV_WC_RECV) || wc.wr_id != SYNC_SPEC_ID) {
//coverity[uninit_use_in_call]
fprintf(stderr, "Bad wc status -- %d -- %d \n",(int)wc.status,(int)wc.wr_id);
fprintf(stderr, "Bad wc status -- %d -- %d\n", (int)wc.status, (int)wc.wr_id);
return 1;
}

Expand Down
2 changes: 2 additions & 0 deletions src/perftest_communication.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@

#define SYNC_SPEC_ID (5)

#define MAX_TIMEOUT_ITER (30000) /* Max iterations to wait for client to poll cq during handshake. */

#define KEY_PRINT_FMT "%04x:%04x:%06x:%06x:%08x:%016llx:%08x"
#define KEY_PRINT_FMT_DV "%04x:%04x:%06x:%06x:%08x:%016llx:%016llx:%08x"

Expand Down
Loading