linux/drivers/infiniband/hw/amso1100
Roland Dreier ed23a72778 IB: Return "maybe missed event" hint from ib_req_notify_cq()
The semantics defined by the InfiniBand specification say that
completion events are only generated when a completions is added to a
completion queue (CQ) after completion notification is requested.  In
other words, this means that the following race is possible:

	while (CQ is not empty)
		ib_poll_cq(CQ);
	// new completion is added after while loop is exited
	ib_req_notify_cq(CQ);
	// no event is generated for the existing completion

To close this race, the IB spec recommends doing another poll of the
CQ after requesting notification.

However, it is not always possible to arrange code this way (for
example, we have found that NAPI for IPoIB cannot poll after
requesting notification).  Also, some hardware (eg Mellanox HCAs)
actually will generate an event for completions added before the call
to ib_req_notify_cq() -- which is allowed by the spec, since there's
no way for any upper-layer consumer to know exactly when a completion
was really added -- so the extra poll of the CQ is just a waste.

Motivated by this, we add a new flag "IB_CQ_REPORT_MISSED_EVENTS" for
ib_req_notify_cq() so that it can return a hint about whether the a
completion may have been added before the request for notification.
The return value of ib_req_notify_cq() is extended so:

	 < 0	means an error occurred while requesting notification
	== 0	means notification was requested successfully, and if
		IB_CQ_REPORT_MISSED_EVENTS was passed in, then no
		events were missed and it is safe to wait for another
		event.
	 > 0	is only returned if IB_CQ_REPORT_MISSED_EVENTS was
		passed in.  It means that the consumer must poll the
		CQ again to make sure it is empty to avoid the race
		described above.

We add a flag to enable this behavior rather than turning it on
unconditionally, because checking for missed events may incur
significant overhead for some low-level drivers, and consumers that
don't care about the results of this test shouldn't be forced to pay
for the test.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-05-06 21:18:11 -07:00
..
c2_ae.c RDMA/amso1100: Fix build with debugging off 2006-10-10 12:50:38 -07:00
c2_ae.h RDMA/amso1100: Add driver for Ammasso 1100 RNIC 2006-09-22 15:22:48 -07:00
c2_alloc.c IB/amso1100: Use dma_alloc_coherent() instead of kmalloc/dma_map_single 2006-10-30 20:52:52 -08:00
c2_cm.c RDMA/amso1100: Fix error path in c2_llp_accept() 2006-09-28 10:38:32 -07:00
c2_cq.c IB: Return "maybe missed event" hint from ib_req_notify_cq() 2007-05-06 21:18:11 -07:00
c2_intr.c RDMA/amso1100: Add driver for Ammasso 1100 RNIC 2006-09-22 15:22:48 -07:00
c2_mm.c RDMA/amso1100: Add driver for Ammasso 1100 RNIC 2006-09-22 15:22:48 -07:00
c2_mq.c RDMA/amso1100: Add driver for Ammasso 1100 RNIC 2006-09-22 15:22:48 -07:00
c2_mq.h RDMA/amso1100: Add driver for Ammasso 1100 RNIC 2006-09-22 15:22:48 -07:00
c2_pd.c RDMA/amso1100: Add driver for Ammasso 1100 RNIC 2006-09-22 15:22:48 -07:00
c2_provider.c IB: Add CQ comp_vector support 2007-05-06 21:18:11 -07:00
c2_provider.h RDMA/amso1100: Add driver for Ammasso 1100 RNIC 2006-09-22 15:22:48 -07:00
c2_qp.c RDMA/amso1100: Fix memory leak in c2_qp_modify() 2006-12-12 11:50:20 -08:00
c2_rnic.c RDMA/amso1100: Fix section mismatches 2006-11-29 15:33:07 -08:00
c2_status.h RDMA/amso1100: Add driver for Ammasso 1100 RNIC 2006-09-22 15:22:48 -07:00
c2_user.h RDMA/amso1100: Add driver for Ammasso 1100 RNIC 2006-09-22 15:22:48 -07:00
c2_vq.c [PATCH] slab: remove SLAB_ATOMIC 2006-12-07 08:39:24 -08:00
c2_vq.h RDMA/amso1100: Add driver for Ammasso 1100 RNIC 2006-09-22 15:22:48 -07:00
c2_wr.h RDMA/amso1100: Add driver for Ammasso 1100 RNIC 2006-09-22 15:22:48 -07:00
c2.c [SK_BUFF]: Convert skb->tail to sk_buff_data_t 2007-04-25 22:26:28 -07:00
c2.h IB: Return "maybe missed event" hint from ib_req_notify_cq() 2007-05-06 21:18:11 -07:00
Kbuild RDMA/amso1100: Add driver for Ammasso 1100 RNIC 2006-09-22 15:22:48 -07:00
Kconfig RDMA/amso1100: Add driver for Ammasso 1100 RNIC 2006-09-22 15:22:48 -07:00