[openib-general] [PATCH] CQ rearm race in IPoIB

Roland Dreier rdreier at cisco.com
Fri Mar 17 14:18:02 PST 2006


    ralphc> There is a race in IPoIB where it rearms the CQ by calling
    ralphc> ib_req_notify_cq() followed by ib_poll_cq().  The loop can
    ralphc> call ib_poll_cq() multiple times if new packets arrive but
    ralphc> then fail to rearm the CQ properly.

I don't understand the race you're trying to fix.  Right now, the CQ
polling code is:

	ib_req_notify_cq(cq, IB_CQ_NEXT_COMP);
	do {
		n = ib_poll_cq(cq, IPOIB_NUM_WC, priv->ibwc);
		for (i = 0; i < n; ++i)
			ipoib_ib_handle_wc(dev, priv->ibwc + i);
	} while (n == IPOIB_NUM_WC);

The call to ib_req_notify_cq() will result in an event if any entries
are added to the CQ after the call, so I don't see any way that IPoIB
can miss a CQ event.  New entries can indeed arrive and be polled
during the do { } while() loop, but the effect of that is just an
extra CQ event, which might lead to an extra interrupt and polling an
empty CQ once.

Can you give a little more detail about the problem you're fixing?

 - R.



More information about the general mailing list