diff options
author | Steve Wise <swise@opengridcomputing.com> | 2016-10-26 15:36:47 -0400 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-12-14 11:38:28 -0500 |
commit | 5f24410408fd093734ce758f2fe3a66fe543de22 (patch) | |
tree | 11bc8d9684f5166d5e449c8189257c30e329cc12 /drivers/infiniband | |
parent | 5042a73d3e9de7bcc2a31adea08ee95bbce998dc (diff) |
rdma_cm: add rdma_consumer_reject_data helper function
rdma_consumer_reject_data() will return the private data pointer
and length if any is available.
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/core/cma.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index bd1d4fe47740..8c30e3dedebe 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) | |||
128 | } | 128 | } |
129 | EXPORT_SYMBOL(rdma_is_consumer_reject); | 129 | EXPORT_SYMBOL(rdma_is_consumer_reject); |
130 | 130 | ||
131 | const void *rdma_consumer_reject_data(struct rdma_cm_id *id, | ||
132 | struct rdma_cm_event *ev, u8 *data_len) | ||
133 | { | ||
134 | const void *p; | ||
135 | |||
136 | if (rdma_is_consumer_reject(id, ev->status)) { | ||
137 | *data_len = ev->param.conn.private_data_len; | ||
138 | p = ev->param.conn.private_data; | ||
139 | } else { | ||
140 | *data_len = 0; | ||
141 | p = NULL; | ||
142 | } | ||
143 | return p; | ||
144 | } | ||
145 | EXPORT_SYMBOL(rdma_consumer_reject_data); | ||
146 | |||
131 | static void cma_add_one(struct ib_device *device); | 147 | static void cma_add_one(struct ib_device *device); |
132 | static void cma_remove_one(struct ib_device *device, void *client_data); | 148 | static void cma_remove_one(struct ib_device *device, void *client_data); |
133 | 149 | ||