[openib-general] RFC: ib_set_comp_handler

Fab Tillier ftillier at silverstorm.com
Mon Sep 12 09:47:20 PDT 2005


> From: Michael S. Tsirkin [mailto:mst at mellanox.co.il]
> Sent: Sunday, September 11, 2005 1:32 PM
> 
> Hi!
> I'd like to add a capability to change the cq completion handler.
>
> It seems this cant be done in the ULP without introducing additional
> indirection and/or locking, which I'd like to avoid.

You need to have locking to properly synchronize so that the user can know when
their "old" callback handler will cease to be invoked.  I agree however that you
need some help from the verbs layer because only it knows when callbacks are in
progress.

> I'd use it in sdp to disable cq events while a connection is destroyed.

Why not just move the QP to the reset state to suppress any further completions,
then poll the CQ for any prior completions?  Aren't you guaranteed that once the
QP is in reset, all pending CQEs have been written?

> It also seems like ipoib could use such a capability, simply blocking
> completion events instead of waiting for 5 seconds in ipoib_ib_dev_stop.
> I expect this to be useful in other scenarious (IPoIB NAPI?).

It seems that what you really want is a way to disarm a CQ, not change the
completion handler.  Are CQs shared between sockets in SDP, or does each socket
have its own CQ?

- Fab




More information about the general mailing list