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

Roland Dreier rdreier at cisco.com
Mon Jan 30 09:33:09 PST 2006


    Michael> I think I see a problem with this approach: if a ULP
    Michael> performs CQ poll while mthca_RESIZE_CQ is in progress, it
    Michael> might get a false indication that the CQ is empty since
    Michael> CQEs are being written to the new buffer already.

I tried to handle this in the poll CQ operation:

	int mthca_poll_cq(struct ib_cq *ibcq, int num_entries,
			  struct ib_wc *entry)
	
		/*...*/
	
		/*
		 * If a CQ resize is in progress and we discovered that the
		 * old buffer is empty, then peek in the new buffer, and if
		 * it's not empty, switch to the new buffer and continue
		 * polling there.
		 */
		if (unlikely(cq->resize_buf				&&
			     cq->resize_buf->state == CQ_RESIZE_READY	&&
			     err == -EAGAIN)) {

and so on...

I'm not sure I got it right but it looks OK to me.

I don't really see any other way to do this, because the RESIZE_CQ
command can block, so we can't lock out poll CQ operations while the
firmware command is executing.

 - R.



More information about the general mailing list