Skip to content

Commit

Permalink
Merge pull request #1448 from shefty/cmtime
Browse files Browse the repository at this point in the history
librdmacm/cmtime: Rework of cmtime example
  • Loading branch information
rleon committed Apr 15, 2024
2 parents 3360630 + 212da56 commit 3be5661
Show file tree
Hide file tree
Showing 9 changed files with 576 additions and 295 deletions.
19 changes: 6 additions & 13 deletions librdmacm/examples/cmatose.c
Expand Up @@ -486,11 +486,9 @@ static int migrate_channel(struct rdma_cm_id *listen_id)

printf("migrating to new event channel\n");

channel = rdma_create_event_channel();
if (!channel) {
perror("cmatose: failed to create event channel");
channel = create_event_channel();
if (!channel)
return -1;
}

ret = 0;
if (listen_id)
Expand Down Expand Up @@ -521,10 +519,8 @@ static int run_server(void)
}

ret = get_rdma_addr(src_addr, dst_addr, port, &hints, &test.rai);
if (ret) {
printf("cmatose: getrdmaaddr error: %s\n", gai_strerror(ret));
if (ret)
goto out;
}

ret = rdma_bind_addr(listen_id, test.rai->ai_src_addr);
if (ret) {
Expand Down Expand Up @@ -594,10 +590,8 @@ static int run_client(void)
printf("cmatose: starting client\n");

ret = get_rdma_addr(src_addr, dst_addr, port, &hints, &test.rai);
if (ret) {
printf("cmatose: getaddrinfo error: %s\n", gai_strerror(ret));
if (ret)
return ret;
}

printf("cmatose: connecting\n");
for (i = 0; i < connections; i++) {
Expand Down Expand Up @@ -719,7 +713,7 @@ int main(int argc, char **argv)

test.connects_left = connections;

test.channel = create_first_event_channel();
test.channel = create_event_channel();
if (!test.channel) {
exit(1);
}
Expand All @@ -737,8 +731,7 @@ int main(int argc, char **argv)
printf("test complete\n");
destroy_nodes();
rdma_destroy_event_channel(test.channel);
if (test.rai)
rdma_freeaddrinfo(test.rai);
rdma_freeaddrinfo(test.rai);

printf("return status %d\n", ret);
return ret;
Expand Down

0 comments on commit 3be5661

Please sign in to comment.