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