[openib-general] [PATCH] ib_sync_cq ( was Re: RFC: ib_set_comp_handler)

James Lentini jlentini at netapp.com
Mon Sep 12 14:15:46 PDT 2005



On Mon, 12 Sep 2005, Sean Hefty wrote:

> James Lentini wrote:
> > The purpose of this function would be more obvious if you included the new
> > comp_handler and cq_contex in the function signature. A different name would
> > help as well. 
> > I would suggest:
> > 
> > void ib_modify_cq(struct ib_cq *cq, 		  void (*event_handler)(struct
> > ib_event *, void *),
> >                   void *cq_context);
> 
> I think that this makes more sense.  It keeps the synchronization 
> internal to the verbs layer, and prevents the user from overwriting 
> the event_handler at the same time that it may be read by the hca 
> driver.  Can we rely on a write to the cq->event_handler being 
> atomic wrt a read of the same value?

Along those same lines, we should also ensure that when both the 
event_handler and cq_context are changed at the same time, the update 
is atomic.

james



More information about the general mailing list