All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
To: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 31/37] librdmacm: provide abstracted verb calls
Date: Wed, 07 Apr 2010 15:38:15 -0500	[thread overview]
Message-ID: <4BBCED37.9040708@opengridcomputing.com> (raw)
In-Reply-To: <411E3A9BECF04B598FFEFFF08505DE6F-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>

Sean Hefty wrote:
>>> +static inline int
>>> +rdma_get_send_comp(struct rdma_cm_id *id, struct ibv_wc *wc)
>>> +{
>>> +	struct ibv_cq *cq;
>>> +	void *context;
>>> +	int ret;
>>> +
>>> +	ret = ibv_poll_cq(id->send_cq, 1, wc);
>>> +	if (ret)
>>> +		return ret;
>>> +
>>> +	ret = ibv_req_notify_cq(id->send_cq, 0);
>>> +	if (ret)
>>> +		return ret;
>>> +
>>> +	ret = ibv_poll_cq(id->send_cq, 1, wc);
>>> +	if (ret)
>>> +		return ret;
>>> +
>>> +	ret = ibv_get_cq_event(id->send_cq_channel, &cq, &context);
>>> +	if (ret)
>>> +		return ret;
>>>
>>>       
>> This doesn't look correct.  If the send isn't complete by the time the
>> 2nd ibv_poll_cq() completes, then this function will return without
>> having filled in the wc.  Or am I missing something?  Shouldn't the
>> ibv_get_cq_event() be the first thing this function does?  The same
>> issue/question exists for rdma_get_recv_comp().
>>     
>
> I think it's possible for the function to return without having filled in a wc.
>   


So its busted?  Or is this intended behavior?


> If the 2nd poll removes a completion, it can leave a cq event on the channel,
> which a subsequent call could retrieve, but then find the cq empty.
>
> The idea for this call is to abstract poll, notify_cq, and get_cq_event, but
> still provide decent performance.  (Scalability is a separate matter.  I
> couldn't find a decent way to abstract a CQ shared across QPs or between the
> receive and send queues.)
>
> To avoid returning from the call without a completion, I think the following
> structure works:
>
> poll()
> notify_cq()
> poll()
> while (no completion) {
> 	get_cq_event()
> 	poll()
> }
>   

Is rdma_get_send_completion() supposed to return exactly one wc?  If so 
then the 2 polls can cause a wc to get silently discarded.   I must 
still not be understanding the intended use?

I would think this should just be:

get_cq_event()
notify_cq()
poll()


> The only drawback I see is that it's theoretically possible to build up a queue
> of cq events in the kernel.  Not sure how to fix that.  Any ideas?
>
>   

That can always happen, yes?


Steve.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2010-04-07 20:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-07 17:12 [PATCH 31/37] librdmacm: provide abstracted verb calls Sean Hefty
     [not found] ` <27A4CFF94530491F88C8E528428FF93E-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2010-04-07 19:39   ` Steve Wise
     [not found]     ` <4BBCDF57.20303-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2010-04-07 20:14       ` Sean Hefty
     [not found]         ` <411E3A9BECF04B598FFEFFF08505DE6F-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2010-04-07 20:38           ` Steve Wise [this message]
     [not found]             ` <4BBCED37.9040708-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2010-04-07 22:01               ` Sean Hefty
     [not found]                 ` <3F9969F0569A431A9B40B8DED7E18FB4-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2010-04-07 22:07                   ` Steve Wise
2010-04-08  0:41   ` [PATCH 31/37 v2] " Sean Hefty

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BBCED37.9040708@opengridcomputing.com \
    --to=swise-7bpotxp6k4+p2yhjcf5u+vpxobypeauw@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.