From f1458e014358accdb6dc99e2c8ab19e6516461c5 Mon Sep 17 00:00:00 2001 From: Sean Hefty Date: Sat, 20 Sep 2014 01:01:13 -0700 Subject: [PATCH 1/2] Add timeout parameter to EQ wait calls. Signed-off-by: Sean Hefty --- ported/libibverbs/rc_pingpong.c | 8 ++++---- simple/pingpong.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ported/libibverbs/rc_pingpong.c b/ported/libibverbs/rc_pingpong.c index 16ee1cedc37..508c98b8197 100644 --- a/ported/libibverbs/rc_pingpong.c +++ b/ported/libibverbs/rc_pingpong.c @@ -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; @@ -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; @@ -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; @@ -633,7 +633,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); diff --git a/simple/pingpong.c b/simple/pingpong.c index bada4f799ff..0f59d188c07 100644 --- a/simple/pingpong.c +++ b/simple/pingpong.c @@ -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; @@ -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; @@ -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; From f1750c4d30cda2d2c1cc3fc6849f279cf825e1ac Mon Sep 17 00:00:00 2001 From: Sean Hefty Date: Fri, 19 Sep 2014 23:56:49 -0700 Subject: [PATCH 2/2] Update to account to changes to fabric attributes Signed-off-by: Sean Hefty --- ported/libibverbs/rc_pingpong.c | 5 ++--- simple/pingpong.c | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ported/libibverbs/rc_pingpong.c b/ported/libibverbs/rc_pingpong.c index 508c98b8197..df4d9f907a3 100644 --- a/ported/libibverbs/rc_pingpong.c +++ b/ported/libibverbs/rc_pingpong.c @@ -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; @@ -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); diff --git a/simple/pingpong.c b/simple/pingpong.c index 0f59d188c07..b0f627bf09f 100644 --- a/simple/pingpong.c +++ b/simple/pingpong.c @@ -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; @@ -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;