linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: swise@opengridcomputing.com (Steve Wise)
Subject: [PATCH v3 3/6] rdma_cm: add rdma_consumer_reject_data helper function
Date: Mon, 24 Oct 2016 11:59:03 -0700	[thread overview]
Message-ID: <7690d653aefbf9ff51dfa6c1ebef57b47616be23.1477336045.git.swise@opengridcomputing.com> (raw)
In-Reply-To: <cover.1477336045.git.swise@opengridcomputing.com>

rdma_consumer_reject_data() will return the private data pointer
and length if any is available.

Signed-off-by: Steve Wise <swise at opengridcomputing.com>
---
 drivers/infiniband/core/cma.c | 16 ++++++++++++++++
 include/rdma/rdma_cm.h        | 10 ++++++++++
 2 files changed, 26 insertions(+)

diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index 0d88c9d..2536d42 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -128,6 +128,22 @@ bool rdma_is_consumer_reject(struct rdma_cm_id *id, int reason)
 }
 EXPORT_SYMBOL(rdma_is_consumer_reject);
 
+const void *rdma_consumer_reject_data(struct rdma_cm_id *id,
+				      struct rdma_cm_event *ev, u8 *data_len)
+{
+	void *p;
+
+	if (rdma_is_consumer_reject(id, ev->status)) {
+		*data_len = ev->param.conn.private_data_len;
+		p = ev->param.conn.private_data;
+	} else {
+		*data_len = 0;
+		p = NULL;
+	}
+	return p;
+}
+EXPORT_SYMBOL(rdma_consumer_reject_data);
+
 static void cma_add_one(struct ib_device *device);
 static void cma_remove_one(struct ib_device *device, void *client_data);
 
diff --git a/include/rdma/rdma_cm.h b/include/rdma/rdma_cm.h
index 62039c2..d3968b5 100644
--- a/include/rdma/rdma_cm.h
+++ b/include/rdma/rdma_cm.h
@@ -403,4 +403,14 @@ const char *__attribute_const__ rdma_reject_msg(struct rdma_cm_id *id,
  */
 bool rdma_is_consumer_reject(struct rdma_cm_id *id, int reason);
 
+/**
+ * rdma_consumer_reject_data - return the consumer reject private data and
+ *			       length, if any.
+ * @id: Communication identifier that received the REJECT event.
+ * @ev: RDMA CM reject event.
+ * @data_len: Pointer to the resulting length of the consumer data.
+ */
+const void *rdma_consumer_reject_data(struct rdma_cm_id *id,
+				      struct rdma_cm_event *ev, u8 *data_len);
+
 #endif /* RDMA_CM_H */
-- 
2.7.0

  parent reply	other threads:[~2016-10-24 18:59 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-24 19:07 [PATCH v3 0/6] connect reject event helpers Steve Wise
2016-10-24 18:59 ` [PATCH v3 2/6] rdma_cm: add rdma_is_consumer_reject() helper function Steve Wise
2016-10-25 16:36   ` Sagi Grimberg
2016-10-25 17:00   ` Christoph Hellwig
2016-10-24 18:59 ` Steve Wise [this message]
2016-10-25 16:36   ` [PATCH v3 3/6] rdma_cm: add rdma_consumer_reject_data " Sagi Grimberg
2016-10-25 17:01   ` Christoph Hellwig
2016-10-24 18:59 ` [PATCH v3 1/6] rdma_cm: add rdma_reject_msg() " Steve Wise
2016-10-25 16:37   ` Sagi Grimberg
2016-10-25 17:00   ` Christoph Hellwig
2016-10-25 17:58   ` Bart Van Assche
2016-10-25 18:18     ` Steve Wise
2016-10-24 19:07 ` [PATCH v3 4/6] nvme-rdma: use rdma connection reject helper functions Steve Wise
2016-10-25 16:36   ` Sagi Grimberg
2016-10-25 16:58     ` Steve Wise
2016-10-25 17:02     ` Christoph Hellwig
2016-10-25 17:04       ` Sagi Grimberg
2016-10-25 17:01   ` Christoph Hellwig
2016-10-25 18:05   ` Bart Van Assche
2016-10-25 18:20     ` Steve Wise
2016-10-25 18:25       ` Bart Van Assche
2016-10-24 19:07 ` [PATCH v3 5/6] ib_iser: log the connection reject message Steve Wise
2016-10-25 16:34   ` Sagi Grimberg
2016-10-24 19:07 ` [PATCH v3 6/6] rds_rdma: " Steve Wise
2016-10-25 15:51   ` Santosh Shilimkar
2016-10-25 16:04     ` Steve Wise
2016-10-25 16:11       ` Santosh Shilimkar

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=7690d653aefbf9ff51dfa6c1ebef57b47616be23.1477336045.git.swise@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).