[openib-general] Re: [PATCH 2/6] [RFC] mthca kernel changes for resizeCQ

Michael S. Tsirkin mst at mellanox.co.il
Tue Jan 31 01:13:43 PST 2006


Quoting r. Roland Dreier <rdreier at cisco.com>:
> Subject: Re: [PATCH 2/6] [RFC] mthca kernel changes for resizeCQ
> 
>  > static inline int ib_poll_cq(struct ib_cq *cq, int num_entries,
>  >                              struct ib_wc *wc)
>  > {
>  > 	unsigned long flags;
>  > 	int ret;
>  > 	spin_lock_irqsave(cq->lock, flags);
>  >         ret = cq->poll_cq(cq, num_entries, wc);
>  > 	spin_unlock_irqrestore(cq->lock, flags);
>  > 	return ret;
>  > }
> 
> Definitely an interesting idea, although it doesn penalize a
> hypothetical device that can do lock-free CQ polling somehow.

True, although documentation/SubmittingPatches does say
"Don't try to anticipate nebulous future cases which may or may not
 be useful" :)

And it seems you'll always need a some kind of lock if you want to detect
queue overruns on post_send/post_recv.

> My bias has been to leave locking to the low-level driver, but if you
> can show an improvement on real hardware with this idea then I would
> be inclined to use this approach.

Sounds sane.
I'm a bit busy now, but I guess this optimization can wait.

-- 
Michael S. Tsirkin
Staff Engineer, Mellanox Technologies



More information about the general mailing list