From 9a01f346f14869361fb276783404090173d4ee59 Mon Sep 17 00:00:00 2001 From: Sean Hefty Date: Wed, 26 Sep 2012 10:04:52 -0700 Subject: [PATCH] Refresh of srq_ex --- include/infiniband/verbs.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/include/infiniband/verbs.h b/include/infiniband/verbs.h index bb1d54b..c75b239 100644 --- a/include/infiniband/verbs.h +++ b/include/infiniband/verbs.h @@ -1050,7 +1050,11 @@ static inline struct ibv_srq * ibv_create_srq_ex(struct ibv_pd *pd, struct ibv_srq_init_attr_ex *srq_init_attr_ex) { struct verbs_context *vctx = verbs_get_ctx_op(pd->context, create_srq_ex); - return vctx ? vctx->create_srq_ex(pd, srq_init_attr_ex) : NULL; + if (!vctx) { + errno = ENOSYS; + return NULL; + } + return vctx->create_srq_ex(pd, srq_init_attr_ex); } /** @@ -1077,11 +1081,14 @@ int ibv_modify_srq(struct ibv_srq *srq, */ int ibv_query_srq(struct ibv_srq *srq, struct ibv_srq_attr *srq_attr); -static inline struct ibv_srq * -ibv_get_srq_num(struct ibv_srq *srq) +static inline uint32_t ibv_get_srq_num(struct ibv_srq *srq) { struct verbs_context *vctx = verbs_get_ctx_op(pd->context, get_srq_num); - return vctx ? vctx->get_srq_num(srq) : NULL; + if (!vctx) { + errno = ENOSYS; + return 0; + } + return vctx->get_srq_num(srq); } /** -- 2.46.0