From: Sean Hefty Date: Sat, 15 Sep 2012 00:37:25 +0000 (-0700) Subject: refresh (create temporary patch) X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=31b76bdf8c433544195f4c55b96e77e29b4d611a;p=~shefty%2Flibibverbs.git refresh (create temporary patch) --- diff --git a/meta b/meta index 1ac867e..41433e7 100644 --- a/meta +++ b/meta @@ -1,9 +1,10 @@ Version: 1 -Previous: a8675243323a577ebc420f67e99d1fb7c084d369 -Head: 65f6ac353db81b100e49b9a3f94b3f0601c2aa30 +Previous: 8e17b817af140db1c4171af6a1023fc64c14c544 +Head: 2f0600df749f3e332fc9f22c374b090c944044eb Applied: verbs-ext: 6fbf2b29ca68fc10b7ee47dc0c09f54db0b32320 compat-ex: 65f6ac353db81b100e49b9a3f94b3f0601c2aa30 + refresh-temp: 2f0600df749f3e332fc9f22c374b090c944044eb Unapplied: xrcd: 0e21cac2fc216f26a141a34cfb9e6ce5adfcd9f0 Hidden: diff --git a/patches/refresh-temp b/patches/refresh-temp new file mode 100644 index 0000000..aeb42e0 --- /dev/null +++ b/patches/refresh-temp @@ -0,0 +1,107 @@ +Bottom: 453d7a21b37804af4aaa51e88b70520d81d2b697 +Top: 601d3e8eb304fdbdc5bf4f3eb7a1998fa62e9693 +Author: Sean Hefty +Date: 2012-09-14 17:37:25 -0700 + +Refresh of compat-ex + +--- + +diff --git a/src/compat-ex.c b/src/compat-ex.c +index 9aede93..fc5ba96 100644 +--- a/src/compat-ex.c ++++ b/src/compat-ex.c +@@ -75,9 +75,7 @@ struct _ibv_ah_ex { + + struct ibv_context *_ibv_real_context(struct ibv_context *context) + { +- struct verbs_context_private *priv_ctx; +- struct verbs_context *context_ex = verbs_get_ctx(context); +- priv_ctx = container_of(context_ex, struct verbs_context_private, context_ex); ++ struct verbs_context_private *priv_ctx = ibv_private_context(context); + return priv_ctx->real_context; + } + +@@ -351,7 +349,7 @@ static struct ibv_qp *_ibv_create_qp_ex(struct ibv_pd *pd, struct ibv_qp_init_at + real_attr.qp_context = qp_ex; + real_attr.send_cq = attr->send_cq ? _ibv_real_cq(attr->send_cq) : NULL; + real_attr.recv_cq = attr->recv_cq ? _ibv_real_cq(attr->recv_cq) : NULL; +- real_attr.srq = attr->srq ? _ibv_real_srq(srq) : NULL; ++ real_attr.srq = attr->srq ? _ibv_real_srq(attr->srq) : NULL; + real_attr.cap = attr->cap; + real_attr.qp_type = attr->qp_type; + real_attr.sq_sig_all = attr->sq_sig_all; +@@ -478,10 +476,10 @@ void _ibv_init_context(struct ibv_device *device, + { + struct ibv_context_ops *ops = &priv_ctx->context_ex.context.ops; + +- priv_ctx->real_context.device = device; +- priv_ctx->real_context.cmd_fd = cmd_fd; +- pthread_mutex_init(&priv_ctx->real_context.mutex, NULL); +- priv_ctx->real_context.abi_compat = NULL; ++ priv_ctx->real_context->device = device; ++ priv_ctx->real_context->cmd_fd = cmd_fd; ++ pthread_mutex_init(&priv_ctx->real_context->mutex, NULL); ++ priv_ctx->real_context->abi_compat = NULL; + + ops->query_device = _ibv_query_device_ex; + ops->query_port = _ibv_query_port_ex; +diff --git a/src/device.c b/src/device.c +index bae1384..907fda6 100644 +--- a/src/device.c ++++ b/src/device.c +@@ -172,7 +172,7 @@ struct ibv_context *__ibv_open_device(struct ibv_device *device) + } else { + priv_ctx->real_context = context; + priv_ctx->context_ex.context.abi_compat = NULL; +- _ibv_init_context(device, &priv_ctx->context_ex, cmd_fd); ++ _ibv_init_context(device, priv_ctx, cmd_fd); + } + + priv_ctx->context_ex.context.device = device; +@@ -193,16 +193,15 @@ int __ibv_close_device(struct ibv_context *context) + int async_fd = context->async_fd; + int cmd_fd = context->cmd_fd; + int cq_fd = -1; +- struct verbs_context *context_ex; ++ struct verbs_context_private *priv_ctx = ibv_private_context(context); + +- context_ex = verbs_get_ctx(context); + if (ibv_support_ex(context)) { + struct verbs_device *verbs_device = verbs_get_device(context->device); +- verbs_device->uninit_context(verbs_device, context); ++ verbs_device->uninit_context(verbs_device, &priv_ctx->context_ex); + } else { +- context->device->ops.free_context(_ibv_real_context(context)); ++ context->device->ops.free_context(priv_ctx->real_context); + } +- free(context_ex); ++ free(priv_ctx); + + close(async_fd); + close(cmd_fd); +diff --git a/src/ibverbs.h b/src/ibverbs.h +index 7f8f7ba..33049d4 100644 +--- a/src/ibverbs.h ++++ b/src/ibverbs.h +@@ -112,10 +112,18 @@ struct verbs_context_private { + + static inline int ibv_support_ex(struct ibv_context *context) + { +- return ctx->abi_compat == IBV_EXTENDED_VERBS; ++ return context->abi_compat == IBV_EXTENDED_VERBS; + } + +-void _ibv_init_contextex(struct verbs_context_private *priv_ctx); ++static inline struct verbs_context_private * ++ibv_private_context(struct ibv_context *context) ++{ ++ return container_of(verbs_get_ctx(context), ++ struct verbs_context_private, context_ex); ++} ++ ++void _ibv_init_context(struct ibv_device *device, ++ struct verbs_context_private *priv_ctx, int cmd_fd); + struct ibv_srq *_ibv_real_srq(struct ibv_srq *srq); + struct ibv_qp *_ibv_real_qp(struct ibv_qp *qp); + struct ibv_cq *_ibv_real_cq(struct ibv_cq *cq);