diff mbox series

[rdma-core,01/12] verbs: Introduce new inline helpers

Message ID 20190716181840.4579-2-yuval.shaia@oracle.com (mailing list archive)
State Superseded
Headers show
Series Shared PD and MR | expand

Commit Message

Yuval Shaia July 16, 2019, 6:18 p.m. UTC
From: Shamir Rabinovitch <shamir.rabinovitch@oracle.com>

For sharing object an application needs an access to object's hadnle
(such as PD handle).

Add helpers to do that.

Signed-off-by: Shamir Rabinovitch <shamir.rabinovitch@oracle.com>
Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: Shamir Rabinovitch <srabinov7@gmail.com>
---
 libibverbs/verbs.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
diff mbox series

Patch

diff --git a/libibverbs/verbs.h b/libibverbs/verbs.h
index 1b0aef03..ff593d93 100644
--- a/libibverbs/verbs.h
+++ b/libibverbs/verbs.h
@@ -3263,6 +3263,21 @@  static inline int ibv_read_counters(struct ibv_counters *counters,
 	return vctx->read_counters(counters, counters_value, ncounters, flags);
 }
 
+static inline uint32_t ibv_context_to_fd(struct ibv_context *context)
+{
+	return context->cmd_fd;
+}
+
+static inline uint32_t ibv_pd_to_handle(struct ibv_pd *pd)
+{
+	return pd->handle;
+}
+
+static inline uint32_t ibv_mr_to_handle(struct ibv_mr *mr)
+{
+	return mr->handle;
+}
+
 #ifdef __cplusplus
 }
 #endif