From 41852b8ff45fdaad7b2a0b819d72a9abe1e62456 Mon Sep 17 00:00:00 2001 From: Sean Hefty Date: Fri, 14 Sep 2012 17:37:25 -0700 Subject: [PATCH] refresh --- meta | 7 ++- patches/compat-ex | 78 ++++++++++++++++++------------- patches/refresh-temp | 107 ------------------------------------------- 3 files changed, 48 insertions(+), 144 deletions(-) delete mode 100644 patches/refresh-temp diff --git a/meta b/meta index 41433e7..46a67e6 100644 --- a/meta +++ b/meta @@ -1,10 +1,9 @@ Version: 1 -Previous: 8e17b817af140db1c4171af6a1023fc64c14c544 -Head: 2f0600df749f3e332fc9f22c374b090c944044eb +Previous: ac3709db015123ce3c40e2cda2194907c1297155 +Head: ec9c0c03ce2fbafefee55520d4c59d29fd2276ed Applied: verbs-ext: 6fbf2b29ca68fc10b7ee47dc0c09f54db0b32320 - compat-ex: 65f6ac353db81b100e49b9a3f94b3f0601c2aa30 - refresh-temp: 2f0600df749f3e332fc9f22c374b090c944044eb + compat-ex: ec9c0c03ce2fbafefee55520d4c59d29fd2276ed Unapplied: xrcd: 0e21cac2fc216f26a141a34cfb9e6ce5adfcd9f0 Hidden: diff --git a/patches/compat-ex b/patches/compat-ex index 74644f8..77447ed 100644 --- a/patches/compat-ex +++ b/patches/compat-ex @@ -1,5 +1,5 @@ Bottom: b2b2b839d978bb240b0641dff8459eaee9553d17 -Top: 453d7a21b37804af4aaa51e88b70520d81d2b697 +Top: 601d3e8eb304fdbdc5bf4f3eb7a1998fa62e9693 Author: Sean Hefty Date: 2012-09-12 11:32:27 -0700 @@ -192,10 +192,10 @@ index a2577d8..4671231 100644 } diff --git a/src/compat-ex.c b/src/compat-ex.c new file mode 100644 -index 0000000..9aede93 +index 0000000..fc5ba96 --- /dev/null +++ b/src/compat-ex.c -@@ -0,0 +1,512 @@ +@@ -0,0 +1,510 @@ +/* + * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2012 Intel Corp., Inc. All rights reserved. @@ -273,9 +273,7 @@ index 0000000..9aede93 + +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; +} + @@ -549,7 +547,7 @@ index 0000000..9aede93 + 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; @@ -676,10 +674,10 @@ index 0000000..9aede93 +{ + 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; @@ -709,7 +707,7 @@ index 0000000..9aede93 + ops->detach_mcast = _ibv_detach_mcast_ex; +} diff --git a/src/device.c b/src/device.c -index 9e43138..bae1384 100644 +index 9e43138..907fda6 100644 --- a/src/device.c +++ b/src/device.c @@ -127,7 +127,9 @@ struct ibv_context *__ibv_open_device(struct ibv_device *device) @@ -787,7 +785,7 @@ index 9e43138..bae1384 100644 + } 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); + } -verbs_err: @@ -806,28 +804,34 @@ index 9e43138..bae1384 100644 return NULL; } default_symver(__ibv_open_device, ibv_open_device); -@@ -199,14 +196,13 @@ int __ibv_close_device(struct ibv_context *context) - struct verbs_context *context_ex; - - context_ex = verbs_get_ctx(context); +@@ -196,17 +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; +- +- context_ex = verbs_get_ctx(context); - if (context_ex) { - struct verbs_device *verbs_device = - verbs_get_device(context->device); - /* Provider supports verbs extension */ -+ 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, context); - free(context_ex); - } else - context->device->ops.free_context(context); ++ struct verbs_context_private *priv_ctx = ibv_private_context(context); ++ ++ if (ibv_support_ex(context)) { ++ struct verbs_device *verbs_device = verbs_get_device(context->device); ++ 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); -@@ -221,6 +217,7 @@ int __ibv_get_async_event(struct ibv_context *context, +@@ -221,6 +216,7 @@ int __ibv_get_async_event(struct ibv_context *context, struct ibv_async_event *event) { struct ibv_kern_async_event ev; @@ -835,7 +839,7 @@ index 9e43138..bae1384 100644 if (read(context->async_fd, &ev, sizeof ev) != sizeof ev) return -1; -@@ -230,6 +227,7 @@ int __ibv_get_async_event(struct ibv_context *context, +@@ -230,6 +226,7 @@ int __ibv_get_async_event(struct ibv_context *context, switch (event->event_type) { case IBV_EVENT_CQ_ERR: event->element.cq = (void *) (uintptr_t) ev.element; @@ -843,7 +847,7 @@ index 9e43138..bae1384 100644 break; case IBV_EVENT_QP_FATAL: -@@ -241,11 +239,13 @@ int __ibv_get_async_event(struct ibv_context *context, +@@ -241,11 +238,13 @@ int __ibv_get_async_event(struct ibv_context *context, case IBV_EVENT_PATH_MIG_ERR: case IBV_EVENT_QP_LAST_WQE_REACHED: event->element.qp = (void *) (uintptr_t) ev.element; @@ -857,7 +861,7 @@ index 9e43138..bae1384 100644 break; default: -@@ -256,6 +256,13 @@ int __ibv_get_async_event(struct ibv_context *context, +@@ -256,6 +255,13 @@ int __ibv_get_async_event(struct ibv_context *context, if (context->ops.async_event) context->ops.async_event(event); @@ -871,7 +875,7 @@ index 9e43138..bae1384 100644 return 0; } default_symver(__ibv_get_async_event, ibv_get_async_event); -@@ -265,7 +272,7 @@ void __ibv_ack_async_event(struct ibv_async_event *event) +@@ -265,7 +271,7 @@ void __ibv_ack_async_event(struct ibv_async_event *event) switch (event->event_type) { case IBV_EVENT_CQ_ERR: { @@ -880,7 +884,7 @@ index 9e43138..bae1384 100644 pthread_mutex_lock(&cq->mutex); ++cq->async_events_completed; -@@ -284,7 +291,7 @@ void __ibv_ack_async_event(struct ibv_async_event *event) +@@ -284,7 +290,7 @@ void __ibv_ack_async_event(struct ibv_async_event *event) case IBV_EVENT_PATH_MIG_ERR: case IBV_EVENT_QP_LAST_WQE_REACHED: { @@ -889,7 +893,7 @@ index 9e43138..bae1384 100644 pthread_mutex_lock(&qp->mutex); ++qp->events_completed; -@@ -297,7 +304,7 @@ void __ibv_ack_async_event(struct ibv_async_event *event) +@@ -297,7 +303,7 @@ void __ibv_ack_async_event(struct ibv_async_event *event) case IBV_EVENT_SRQ_ERR: case IBV_EVENT_SRQ_LIMIT_REACHED: { @@ -899,10 +903,10 @@ index 9e43138..bae1384 100644 pthread_mutex_lock(&srq->mutex); ++srq->events_completed; diff --git a/src/ibverbs.h b/src/ibverbs.h -index fa6cd41..7f8f7ba 100644 +index fa6cd41..33049d4 100644 --- a/src/ibverbs.h +++ b/src/ibverbs.h -@@ -102,4 +102,25 @@ HIDDEN int ibverbs_init(struct ibv_device ***list); +@@ -102,4 +102,33 @@ HIDDEN int ibverbs_init(struct ibv_device ***list); (cmd)->response = (uintptr_t) (out); \ } while (0) @@ -916,10 +920,18 @@ index fa6cd41..7f8f7ba 100644 + +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); diff --git a/patches/refresh-temp b/patches/refresh-temp deleted file mode 100644 index aeb42e0..0000000 --- a/patches/refresh-temp +++ /dev/null @@ -1,107 +0,0 @@ -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); -- 2.46.0