Skip to content

Commit

Permalink
Merge pull request #20 from shefty/master
Browse files Browse the repository at this point in the history
Updates to fabric attributes
  • Loading branch information
shefty committed Sep 20, 2014
2 parents c2c3790 + f1750c4 commit ca0f0c8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
13 changes: 6 additions & 7 deletions ported/libibverbs/rc_pingpong.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ static int pp_accept_ctx(struct pingpong_context *ctx)
int rc = 0;
int rd = 0;

rd = fi_eq_condread(ctx->eq, &entry, sizeof entry, NULL, 0);
rd = fi_eq_condread(ctx->eq, &entry, sizeof entry, NULL, -1, 0);
if (rd != sizeof entry) {
FI_ERR_LOG("fi_eq_condread %s", -rd);
goto err;
Expand Down Expand Up @@ -230,7 +230,7 @@ static int pp_accept_ctx(struct pingpong_context *ctx)
goto err;
}

rd = fi_eq_condread(ctx->eq, &entry, sizeof entry, NULL, 0);
rd = fi_eq_condread(ctx->eq, &entry, sizeof entry, NULL, -1, 0);
if (rd != sizeof entry) {
FI_ERR_LOG("fi_eq_condread %s", -rd);
goto err;
Expand Down Expand Up @@ -310,7 +310,7 @@ static int pp_connect_ctx(struct pingpong_context *ctx)
goto err;
}

rc = fi_eq_condread(ctx->eq, &entry, sizeof entry, NULL, 0);
rc = fi_eq_condread(ctx->eq, &entry, sizeof entry, NULL, -1, 0);
if (rc != sizeof entry) {
FI_ERR_LOG("fi_eq_condread %s", -rc);
goto err;
Expand Down Expand Up @@ -353,9 +353,8 @@ static struct pingpong_context *pp_init_ctx(struct fi_info *prov, int size,
/* FIXME memset(ctx->buf, 0, size); */
memset(ctx->buf, 0x7b, size);


/* Open the fabric */
rc = fi_fabric(prov->fabric_name, 0, &ctx->fabric, NULL);
rc = fi_fabric(prov->fabric_attr, &ctx->fabric, NULL);
if (rc) {
FI_ERR_LOG("Couldn't open fabric", rc);
return NULL;
Expand Down Expand Up @@ -582,7 +581,7 @@ int main(int argc, char *argv[])
}
} else {
for (prov = prov_list; prov; prov = prov->next)
if (!strcmp(prov->fabric_name, prov_name))
if (!strcmp(prov->fabric_attr->prov_name, prov_name))
break;
if (!prov) {
fprintf(stderr, "Provider %s not found\n", prov_name);
Expand Down Expand Up @@ -633,7 +632,7 @@ int main(int argc, char *argv[])

if (use_event) {
/* Blocking read */
rd = fi_cq_condread(ctx->cq, &wc, sizeof wc, NULL);
rd = fi_cq_condread(ctx->cq, &wc, sizeof wc, NULL, -1);
} else {
do {
rd = fi_cq_read(ctx->cq, &wc, sizeof wc);
Expand Down
10 changes: 5 additions & 5 deletions simple/pingpong.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ static int server_listen(void)
return ret;
}

ret = fi_fabric(fi->fabric_name, 0, &fab, NULL);
ret = fi_fabric(fi->fabric_attr, &fab, NULL);
if (ret) {
printf("fi_fabric %s\n", fi_strerror(-ret));
goto err0;
Expand Down Expand Up @@ -415,7 +415,7 @@ static int server_connect(void)
ssize_t rd;
int ret;

rd = fi_eq_condread(cmeq, &entry, sizeof entry, NULL, 0);
rd = fi_eq_condread(cmeq, &entry, sizeof entry, NULL, -1, 0);
if (rd != sizeof entry) {
printf("fi_eq_condread %zd %s\n", rd, fi_strerror((int) -rd));
return (int) rd;
Expand Down Expand Up @@ -454,7 +454,7 @@ static int server_connect(void)
goto err3;
}

rd = fi_eq_condread(cmeq, &entry, sizeof entry, NULL, 0);
rd = fi_eq_condread(cmeq, &entry, sizeof entry, NULL, -1, 0);
if (rd != sizeof entry) {
printf("fi_eq_condread %zd %s\n", rd, fi_strerror((int) -rd));
return (int) rd;
Expand Down Expand Up @@ -501,7 +501,7 @@ static int client_connect(void)
goto err0;
}

ret = fi_fabric(fi->fabric_name, 0, &fab, NULL);
ret = fi_fabric(fi->fabric_attr, &fab, NULL);
if (ret) {
printf("fi_fabric %s\n", fi_strerror(-ret));
goto err1;
Expand Down Expand Up @@ -534,7 +534,7 @@ static int client_connect(void)
goto err5;
}

rd = fi_eq_condread(cmeq, &entry, sizeof entry, NULL, 0);
rd = fi_eq_condread(cmeq, &entry, sizeof entry, NULL, -1, 0);
if (rd != sizeof entry) {
printf("fi_eq_condread %zd %s\n", rd, fi_strerror((int) -rd));
return (int) rd;
Expand Down

0 comments on commit ca0f0c8

Please sign in to comment.