|
|
745326 |
From fccce505db388fbea2d65fb662111702bc60ad25 Mon Sep 17 00:00:00 2001
|
|
|
745326 |
From: Honggang Li <honli@redhat.com>
|
|
|
745326 |
Date: Thu, 4 Jun 2020 14:33:38 +0800
|
|
|
745326 |
Subject: [PATCH 8/8] libibverbs: Fix ABI_placeholder1 and ABI_placeholder2
|
|
|
745326 |
assignment
|
|
|
745326 |
|
|
|
745326 |
The assignment of ABI_placeholder1 and ABI_placeholder2 must be
|
|
|
745326 |
after the provider populated context_ex->ibv_create_flow and
|
|
|
745326 |
context_ex->ibv_destroy_flow.
|
|
|
745326 |
|
|
|
745326 |
Applications, which compiled against old libibverbs released between
|
|
|
745326 |
commit 501b53b30752 and 1111cf9895bb, will fail if they are linked
|
|
|
745326 |
with libibverbs released after 1111cf9895bb and call ibv_create_flow.
|
|
|
745326 |
|
|
|
745326 |
[1] 501b53b30752 ("Fix create/destroy flow API")
|
|
|
745326 |
|
|
|
745326 |
Fixes: 1111cf9895bb ("verbs: Always allocate a verbs_context")
|
|
|
745326 |
Signed-off-by: Honggang Li <honli@redhat.com>
|
|
|
745326 |
(cherry picked from commit 88789b7ba618d55491026c74a9a31699805e5934)
|
|
|
745326 |
Signed-off-by: Honggang Li <honli@redhat.com>
|
|
|
745326 |
---
|
|
|
745326 |
libibverbs/device.c | 34 +++++++++++++++++-----------------
|
|
|
745326 |
1 file changed, 17 insertions(+), 17 deletions(-)
|
|
|
745326 |
|
|
|
745326 |
diff --git a/libibverbs/device.c b/libibverbs/device.c
|
|
|
745326 |
index bc7df1b06435..db97655c2d9e 100644
|
|
|
745326 |
--- a/libibverbs/device.c
|
|
|
745326 |
+++ b/libibverbs/device.c
|
|
|
745326 |
@@ -256,23 +256,6 @@ int verbs_init_context(struct verbs_context *context_ex,
|
|
|
745326 |
context_ex->context.abi_compat = __VERBS_ABI_IS_EXTENDED;
|
|
|
745326 |
context_ex->sz = sizeof(*context_ex);
|
|
|
745326 |
|
|
|
745326 |
- /*
|
|
|
745326 |
- * In order to maintain backward/forward binary compatibility
|
|
|
745326 |
- * with apps compiled against libibverbs-1.1.8 that use the
|
|
|
745326 |
- * flow steering addition, we need to set the two
|
|
|
745326 |
- * ABI_placeholder entries to match the driver set flow
|
|
|
745326 |
- * entries. This is because apps compiled against
|
|
|
745326 |
- * libibverbs-1.1.8 use an inline ibv_create_flow and
|
|
|
745326 |
- * ibv_destroy_flow function that looks in the placeholder
|
|
|
745326 |
- * spots for the proper entry points. For apps compiled
|
|
|
745326 |
- * against libibverbs-1.1.9 and later, the inline functions
|
|
|
745326 |
- * will be looking in the right place.
|
|
|
745326 |
- */
|
|
|
745326 |
- context_ex->ABI_placeholder1 =
|
|
|
745326 |
- (void (*)(void))context_ex->ibv_create_flow;
|
|
|
745326 |
- context_ex->ABI_placeholder2 =
|
|
|
745326 |
- (void (*)(void))context_ex->ibv_destroy_flow;
|
|
|
745326 |
-
|
|
|
745326 |
context_ex->priv = calloc(1, sizeof(*context_ex->priv));
|
|
|
745326 |
if (!context_ex->priv) {
|
|
|
745326 |
errno = ENOMEM;
|
|
|
745326 |
@@ -330,6 +313,23 @@ static void set_lib_ops(struct verbs_context *vctx)
|
|
|
745326 |
#undef ibv_query_port
|
|
|
745326 |
vctx->context.ops._compat_query_port = ibv_query_port;
|
|
|
745326 |
vctx->query_port = __lib_query_port;
|
|
|
745326 |
+
|
|
|
745326 |
+ /*
|
|
|
745326 |
+ * In order to maintain backward/forward binary compatibility
|
|
|
745326 |
+ * with apps compiled against libibverbs-1.1.8 that use the
|
|
|
745326 |
+ * flow steering addition, we need to set the two
|
|
|
745326 |
+ * ABI_placeholder entries to match the driver set flow
|
|
|
745326 |
+ * entries. This is because apps compiled against
|
|
|
745326 |
+ * libibverbs-1.1.8 use an inline ibv_create_flow and
|
|
|
745326 |
+ * ibv_destroy_flow function that looks in the placeholder
|
|
|
745326 |
+ * spots for the proper entry points. For apps compiled
|
|
|
745326 |
+ * against libibverbs-1.1.9 and later, the inline functions
|
|
|
745326 |
+ * will be looking in the right place.
|
|
|
745326 |
+ */
|
|
|
745326 |
+ vctx->ABI_placeholder1 =
|
|
|
745326 |
+ (void (*)(void))vctx->ibv_create_flow;
|
|
|
745326 |
+ vctx->ABI_placeholder2 =
|
|
|
745326 |
+ (void (*)(void))vctx->ibv_destroy_flow;
|
|
|
745326 |
}
|
|
|
745326 |
|
|
|
745326 |
struct ibv_context *verbs_open_device(struct ibv_device *device, void *private_data)
|
|
|
745326 |
--
|
|
|
745326 |
2.25.4
|
|
|
745326 |
|