linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Steve Wise" <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
To: 'Devesh Sharma' <devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org
Subject: RE: [PATCH 1/3] IB: new common API for draining queues
Date: Fri, 12 Feb 2016 09:17:27 -0600	[thread overview]
Message-ID: <005801d165a8$7ba4bd00$72ee3700$@opengridcomputing.com> (raw)
In-Reply-To: <CANjDDBg=B33kRDTZ=NnZ-cZhNwXnpJ950dLy6qY0QZBjDaNisQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

> > +/*
> > + * Post a WR and block until its completion is reaped for the SQ.
> > + */
> > +static void __ib_drain_sq(struct ib_qp *qp)
> > +{
> > +       struct ib_qp_attr attr = { .qp_state = IB_QPS_ERR };
> > +       struct ib_drain_cqe sdrain;
> > +       struct ib_send_wr swr = {}, *bad_swr;
> > +       int ret;
> > +
> > +       swr.wr_cqe = &sdrain.cqe;
> > +       sdrain.cqe.done = ib_drain_qp_done;
> > +       init_completion(&sdrain.done);
> > +
> > +       ret = ib_modify_qp(qp, &attr, IB_QP_STATE);
> > +       if (ret) {
> > +               WARN_ONCE(ret, "failed to drain QP: %d\n", ret);
> > +               return;
> > +       }
> 
> Should it query qp-state and then modify if needed? I am not liking the
> the extra step which is highly unlikely in a normal usage conditions?
> especially for a shared CQ it is really redundant.
>

Hey Devesh, on a previous round of reviews for this series, I thought you agreed that this was fine? 

See: http://www.spinics.net/lists/linux-rdma/msg33202.html

My personal opinion is that calling query_qp() and only modifying if needed is as much work as just calling modify since ERR->ERR is basically a noop.

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

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-11 22:44 [PATCH v3 0/3] new ib_drain_qp() API Steve Wise
     [not found] ` <cover.1455230646.git.swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2016-01-14 18:24   ` [PATCH 2/3] iw_cxgb4: add queue drain functions Steve Wise
2016-01-27 20:09   ` [PATCH 3/3] IB/srp: use ib_drain_rq() Steve Wise
     [not found]     ` <c11baa726a6440549ab46b9525116d9fe74eb5a0.1455230646.git.swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2016-02-11 23:01       ` Bart Van Assche
2016-02-05 21:13   ` [PATCH 1/3] IB: new common API for draining queues Steve Wise
     [not found]     ` <3e7261d1436d33320223d365974ff38945f0d558.1455230646.git.swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2016-02-11 22:59       ` Bart Van Assche
     [not found]         ` <56BD1248.80805-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-02-11 23:15           ` Bart Van Assche
     [not found]             ` <56BD1624.4090309-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-02-11 23:20               ` Steve Wise
2016-02-11 23:23                 ` Bart Van Assche
     [not found]                   ` <56BD1800.9050508-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-02-12  0:32                     ` Steve Wise
2016-02-11 23:18           ` Steve Wise
2016-02-12  5:19       ` Devesh Sharma
     [not found]         ` <CANjDDBg=B33kRDTZ=NnZ-cZhNwXnpJ950dLy6qY0QZBjDaNisQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-02-12 15:17           ` Steve Wise [this message]
2016-02-13 15:41             ` Devesh Sharma
2016-02-15 21:05       ` Doug Ledford
     [not found]         ` <56C23DA8.40905-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-02-15 21:20           ` Steve Wise
2016-02-16 11:00           ` Sagi Grimberg
2016-02-13 16:10   ` [PATCH v3 0/3] new ib_drain_qp() API Leon Romanovsky
     [not found]     ` <20160213161049.GB14741-2ukJVAZIZ/Y@public.gmane.org>
2016-02-13 16:32       ` Christoph Hellwig
     [not found]         ` <20160213163253.GA8843-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2016-02-13 16:50           ` Leon Romanovsky
     [not found]             ` <20160213165001.GC14741-2ukJVAZIZ/Y@public.gmane.org>
2016-02-14 14:51               ` Steve Wise
     [not found]                 ` <56C0946E.50100-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2016-02-14 14:58                   ` Christoph Hellwig

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='005801d165a8$7ba4bd00$72ee3700$@opengridcomputing.com' \
    --to=swise-7bpotxp6k4+p2yhjcf5u+vpxobypeauw@public.gmane.org \
    --cc=bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org \
    --cc=devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@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).