linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: swise@opengridcomputing.com (Steve Wise)
Subject: [PATCH RFC v2 2/3] rdma_cm: add rdma_consumer_reject() helper	function
Date: Fri, 21 Oct 2016 09:09:05 -0500	[thread overview]
Message-ID: <005f01d22ba4$aeadeab0$0c09c010$@opengridcomputing.com> (raw)
In-Reply-To: <20161021121428.GB17028@lst.de>

> 
> On Thu, Oct 20, 2016@03:40:26PM -0700, Steve Wise wrote:
> > Return true if the peer consumer application rejected the
> > connection attempt.
> >
> > Signed-off-by: Steve Wise <swise at opengridcomputing.com>
> > ---
> >  drivers/infiniband/core/cma.c | 13 +++++++++++++
> >  include/rdma/ib_cm.h          |  9 +++++++++
> >  include/rdma/iw_cm.h          |  9 +++++++++
> >  include/rdma/rdma_cm.h        |  6 ++++++
> >  4 files changed, 37 insertions(+)
> >
> > diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
> > index 7cc7346..4ec16a3 100644
> > --- a/drivers/infiniband/core/cma.c
> > +++ b/drivers/infiniband/core/cma.c
> > @@ -114,6 +114,19 @@ const char *__attribute_const__
> rdma_reject_msg(struct rdma_cm_id *id,
> >  }
> >  EXPORT_SYMBOL(rdma_reject_msg);
> >
> > +bool rdma_consumer_reject(struct rdma_cm_id *id, int reason)
> > +{
> > +	if (rdma_ib_or_roce(id->device, id->port_num))
> > +		return ib_consumer_reject(reason);
> > +
> > +	if (rdma_protocol_iwarp(id->device, id->port_num))
> > +		return iw_consumer_reject(reason);
> > +
> > +	/* FIXME should we WARN_ONCE() here? */
> > +	return false;
> 
> Yes.  Also I'd just inline the ib_consumer_reject and iw_consumer_reject
> helpers here.
> 
> Aso wouldn't it be better named rdma_consumer_is_reject or similar
> given that we don't reject anything here, but check if the request
> has been rejected?

How about rdma_rejected_by_consumer()?

  reply	other threads:[~2016-10-21 14:09 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-20 22:40 [PATCH RFC v2 0/3] connect reject event helpers Steve Wise
2016-10-20 22:40 ` [PATCH RFC v2 1/3] rdma_cm: add rdma_reject_msg() helper function Steve Wise
2016-10-21 12:12   ` Christoph Hellwig
2016-10-21 14:07     ` Steve Wise
2016-10-21 21:43       ` Sagi Grimberg
2016-10-21 21:51   ` Sagi Grimberg
2016-10-20 22:40 ` [PATCH RFC v2 2/3] rdma_cm: add rdma_consumer_reject() " Steve Wise
2016-10-21 12:14   ` Christoph Hellwig
2016-10-21 14:09     ` Steve Wise [this message]
2016-10-21 15:50       ` Parav Pandit
2016-10-21 21:45         ` Sagi Grimberg
2016-10-22 15:57     ` Steve Wise
2016-10-20 22:40 ` [PATCH RFC v2 3/3] nvme-rdma: use rdma_reject_msg() to log connection rejects Steve Wise
2016-10-21 12:23   ` Christoph Hellwig
2016-10-21 21:48     ` Sagi Grimberg
2016-10-22 16:12     ` Steve Wise
     [not found]     ` <005701d22c7f$0c883ed0$2598bc70$@opengridcomputing.com>
2016-10-24 14:57       ` Steve Wise
2016-10-24 15:09         ` 'Christoph Hellwig'
2016-10-21 21:53 ` [PATCH RFC v2 0/3] connect reject event helpers Sagi Grimberg
2016-10-21 21:58   ` Steve Wise
     [not found]   ` <001701d22be6$4854b8b0$d8fe2a10$@opengridcomputing.com>
2016-10-24 17:44     ` Steve Wise
2016-10-24 17:52       ` Chuck Lever
2016-10-24 17:57         ` 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='005f01d22ba4$aeadeab0$0c09c010$@opengridcomputing.com' \
    --to=swise@opengridcomputing.com \
    /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).