[openib-general] [PATCH] [libibverbs] Adding acks to all of the CQ events in the pingpong examples

Dotan Barak dotanb at dev.mellanox.co.il
Thu Jan 11 08:39:34 PST 2007


Adding acks to all of the CQ events in the pingpong examples to show how
completion events should be used.

Signed-off-by: Dotan Barak <dotanb at mellanox.co.il>

---

Index: gen2_devel_user/src/userspace/libibverbs/examples/rc_pingpong.c
===================================================================
--- gen2_devel_user.orig/src/userspace/libibverbs/examples/rc_pingpong.c	2007-01-11 13:50:34.000000000 +0200
+++ gen2_devel_user/src/userspace/libibverbs/examples/rc_pingpong.c	2007-01-11 13:53:23.000000000 +0200
@@ -621,6 +621,7 @@ int main(int argc, char *argv[])
 				fprintf(stderr, "Failed to get cq_event\n");
 				return 1;
 			}
+			ibv_ack_cq_events(ev_cq, 1);
 
 			if (ev_cq != ctx->cq) {
 				fprintf(stderr, "CQ event for unknown CQ %p\n", ev_cq);
Index: gen2_devel_user/src/userspace/libibverbs/examples/srq_pingpong.c
===================================================================
--- gen2_devel_user.orig/src/userspace/libibverbs/examples/srq_pingpong.c	2007-01-10 17:02:24.000000000 +0200
+++ gen2_devel_user/src/userspace/libibverbs/examples/srq_pingpong.c	2007-01-11 13:53:37.000000000 +0200
@@ -709,6 +709,7 @@ int main(int argc, char *argv[])
 				fprintf(stderr, "Failed to get cq_event\n");
 				return 1;
 			}
+			ibv_ack_cq_events(ev_cq, 1);
 
 			if (ev_cq != ctx->cq) {
 				fprintf(stderr, "CQ event for unknown CQ %p\n", ev_cq);
Index: gen2_devel_user/src/userspace/libibverbs/examples/uc_pingpong.c
===================================================================
--- gen2_devel_user.orig/src/userspace/libibverbs/examples/uc_pingpong.c	2007-01-10 17:02:24.000000000 +0200
+++ gen2_devel_user/src/userspace/libibverbs/examples/uc_pingpong.c	2007-01-11 13:53:45.000000000 +0200
@@ -609,6 +609,7 @@ int main(int argc, char *argv[])
 				fprintf(stderr, "Failed to get cq_event\n");
 				return 1;
 			}
+			ibv_ack_cq_events(ev_cq, 1);
 
 			if (ev_cq != ctx->cq) {
 				fprintf(stderr, "CQ event for unknown CQ %p\n", ev_cq);
Index: gen2_devel_user/src/userspace/libibverbs/examples/ud_pingpong.c
===================================================================
--- gen2_devel_user.orig/src/userspace/libibverbs/examples/ud_pingpong.c	2007-01-10 17:02:24.000000000 +0200
+++ gen2_devel_user/src/userspace/libibverbs/examples/ud_pingpong.c	2007-01-11 13:53:30.000000000 +0200
@@ -607,6 +607,7 @@ int main(int argc, char *argv[])
 				fprintf(stderr, "Failed to get cq_event\n");
 				return 1;
 			}
+			ibv_ack_cq_events(ev_cq, 1);
 
 			if (ev_cq != ctx->cq) {
 				fprintf(stderr, "CQ event for unknown CQ %p\n", ev_cq);






More information about the general mailing list