linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Steve Wise" <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
To: 'Sagi Grimberg'
	<sagig-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>,
	'Bart Van Assche'
	<bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: 'Sagi Grimberg' <sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	'Christoph Hellwig' <hch-jcswGhMUV9g@public.gmane.org>,
	'Chuck Lever'
	<chuck.lever-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Subject: RE: [PATCH v2 0/3] new ib_drain_qp() API
Date: Wed, 10 Feb 2016 09:27:57 -0600	[thread overview]
Message-ID: <00ca01d16417$9e9fc030$dbdf4090$@opengridcomputing.com> (raw)
In-Reply-To: <56BB11F0.9090203-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>

> >>> Hello Steve,
> >>>
> >>> How about creating three functions - one that drains the receive queue,
> >>> one that drains the send queue and a third function that drains both ?
> >>> The latter function then can call the two former functions. And since
> >>> only one of these three functions will have a user in your patch series
> >>> (the function that drains the RQ), how about only introducing only that
> >>> function now and to wait with introducing the two other functions until
> >>> these have a user ?
> >>
> >> That sounds reasonable.  Simpler too perhaps.  We'll see if anyone else
> >> has an opinion.
> >
> > Another option is for ib_drain_qp() to just skip queues with IB_POLL_DIRECT CQ processing.
> 
> I'd rather not skip silently anything. ib_drain_qp() semantics is that
> it drains all the pending posts on the queue-pair (i.e. both send and
> receive queues).
> 
> We can split to send and receive, but the fact that srp uses direct
> polling CQ is not sufficient for that, most if not all will benefit from
> both.
>

If we split it into ib_drain_rq(), ib_drain_sq(), and ib_drain_qp(), then srp would only call ib_drain_rq().  Others can call
ib_drain_qp() if they want both SQ and RQ drained.
 
> I'd suggest to look at the CQ context and act accordingly, something
> like:
> 
> 	if (cq->poll_ctx == IB_POLL_DIRECT) {
> 		while (!wait_for_completion_timeout(&sdrain.done,
> 				mescs_to_jiffies(100))
> 			ib_process_cq_direct(cq, 1024)
> 	} else {
> 		wait_for_completion(&sdrain.done);
> 	}
> 
> Thoughts?

I don't like the forced 100ms block.  You could call ib_process_cq_direct() first and check the return code, then block if needed.
But is there utility in providing drain for IB_POLL_DIRECT users?  

--
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:[~2016-02-10 15:27 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-08 22:14 [PATCH v2 0/3] new ib_drain_qp() API Steve Wise
     [not found] ` <cover.1454969695.git.swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2016-01-14 18:24   ` [PATCH 2/3] iw_cxgb4: add drain_qp function Steve Wise
2016-01-27 20:09   ` [PATCH 3/3] IB/srp: use ib_drain_qp() Steve Wise
2016-02-05 21:13   ` [PATCH 1/3] IB: new common API for draining a queue pair Steve Wise
2016-02-09 20:04   ` [PATCH v2 0/3] new ib_drain_qp() API Steve Wise
2016-02-09 20:50     ` Steve Wise
2016-02-09 21:03       ` Bart Van Assche
     [not found]         ` <56BA540B.4040405-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-02-09 21:06           ` Steve Wise
2016-02-09 21:18           ` Chuck Lever
     [not found]             ` <08D51C34-0009-4784-BE80-7BCB85441606-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2016-02-09 21:20               ` Steve Wise
2016-02-09 21:35                 ` Chuck Lever
     [not found]         ` <011901d1637d$b5286400$1f792c00$@opengridcomputing.com>
2016-02-09 21:58           ` Steve Wise
2016-02-09 22:23             ` Chuck Lever
2016-02-10 10:33             ` Sagi Grimberg
     [not found]               ` <56BB11F0.9090203-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2016-02-10 14:08                 ` Bart Van Assche
     [not found]                   ` <56BB4479.8090009-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-02-11 10:46                     ` Sagi Grimberg
     [not found]                       ` <56BC6686.8030301-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2016-02-11 15:15                         ` Bart Van Assche
     [not found]                           ` <56BCA57A.4000500-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-02-11 16:11                             ` Sagi Grimberg
     [not found]                               ` <56BCB2C3.9060408-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2016-02-11 18:54                                 ` Bart Van Assche
2016-02-10 15:27                 ` Steve Wise [this message]
2016-02-10 15:55                   ` Steve Wise
2016-02-11 15:22                   ` Doug Ledford
     [not found]                     ` <56BCA741.6020800-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-02-11 16:09                       ` Sagi Grimberg
     [not found]                         ` <56BCB239.3020505-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2016-02-11 16:10                           ` Steve Wise

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='00ca01d16417$9e9fc030$dbdf4090$@opengridcomputing.com' \
    --to=swise-7bpotxp6k4+p2yhjcf5u+vpxobypeauw@public.gmane.org \
    --cc=bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org \
    --cc=chuck.lever-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    --cc=hch-jcswGhMUV9g@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sagig-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
    --cc=sagig-VPRAkNaXOzVWk0Htik3J/w@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).