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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Shamir Rabinovitch <shamir.rabinovitch@xxxxxxxxxx>

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@xxxxxxxxxx>
Signed-off-by: Yuval Shaia <yuval.shaia@xxxxxxxxxx>
Signed-off-by: Shamir Rabinovitch <srabinov7@xxxxxxxxx>
---
 libibverbs/verbs.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/libibverbs/verbs.h b/libibverbs/verbs.h
index 1e01b5db..eb9df3a4 100644
--- a/libibverbs/verbs.h
+++ b/libibverbs/verbs.h
@@ -3270,6 +3270,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
-- 
2.20.1




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux