From: Jason Gunthorpe <jgg-uk2M96/98Pc@public.gmane.org>
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Jason Gunthorpe <jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: [PATCH rdma-core 05/17] verbs: Remove kernel ABI v2 compat cruft
Date: Thu, 11 Jan 2018 15:13:28 -0700 [thread overview]
Message-ID: <20180111221340.965-6-jgg@ziepe.ca> (raw)
In-Reply-To: <20180111221340.965-1-jgg-uk2M96/98Pc@public.gmane.org>
From: Jason Gunthorpe <jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
When verbs extensions were introduced the minimum ABI version was
changed to v3 and abi_ver <= 2 was no longer possible.
Remove everything to do with this support since it hasn't even
been runnable for 5 years.
Fixes: 6be16586e081 ("Infrastructure to support verbs extensions")
Signed-off-by: Jason Gunthorpe <jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
libibverbs/cmd.c | 3 ---
libibverbs/ibverbs.h | 18 +++-----------
libibverbs/kern-abi.h | 67 ---------------------------------------------------
libibverbs/verbs.c | 33 -------------------------
4 files changed, 4 insertions(+), 117 deletions(-)
diff --git a/libibverbs/cmd.c b/libibverbs/cmd.c
index fc58de768d0011..fbd87d475a2751 100644
--- a/libibverbs/cmd.c
+++ b/libibverbs/cmd.c
@@ -48,9 +48,6 @@ int ibv_cmd_get_context(struct verbs_context *context_ex,
struct ibv_get_context *cmd, size_t cmd_size,
struct ibv_get_context_resp *resp, size_t resp_size)
{
- if (abi_ver < IB_USER_VERBS_MIN_ABI_VERSION)
- return ENOSYS;
-
IBV_INIT_CMD_RESP(cmd, cmd_size, GET_CONTEXT, resp, resp_size);
if (write(context_ex->context.cmd_fd, cmd, cmd_size) != cmd_size)
diff --git a/libibverbs/ibverbs.h b/libibverbs/ibverbs.h
index 97d3a4b8dbab91..7755393fe4f3ce 100644
--- a/libibverbs/ibverbs.h
+++ b/libibverbs/ibverbs.h
@@ -64,20 +64,14 @@ struct verbs_ex_private {
#define IBV_INIT_CMD(cmd, size, opcode) \
do { \
- if (abi_ver > 2) \
- (cmd)->command = IB_USER_VERBS_CMD_##opcode; \
- else \
- (cmd)->command = IB_USER_VERBS_CMD_##opcode##_V2; \
+ (cmd)->command = IB_USER_VERBS_CMD_##opcode; \
(cmd)->in_words = (size) / 4; \
(cmd)->out_words = 0; \
} while (0)
#define IBV_INIT_CMD_RESP(cmd, size, opcode, out, outsize) \
do { \
- if (abi_ver > 2) \
- (cmd)->command = IB_USER_VERBS_CMD_##opcode; \
- else \
- (cmd)->command = IB_USER_VERBS_CMD_##opcode##_V2; \
+ (cmd)->command = IB_USER_VERBS_CMD_##opcode; \
(cmd)->in_words = (size) / 4; \
(cmd)->out_words = (outsize) / 4; \
(cmd)->response = (uintptr_t) (out); \
@@ -94,12 +88,8 @@ static inline uint32_t _cmd_ex(uint32_t cmd)
outsize) \
do { \
size_t c_size = cmd_size - sizeof(struct ex_hdr); \
- if (abi_ver > 2) \
- (cmd)->hdr.command = \
- _cmd_ex(IB_USER_VERBS_EX_CMD_##opcode); \
- else \
- (cmd)->hdr.command = \
- IB_USER_VERBS_CMD_##opcode##_V2; \
+ (cmd)->hdr.command = \
+ _cmd_ex(IB_USER_VERBS_EX_CMD_##opcode); \
(cmd)->hdr.in_words = ((c_size) / 8); \
(cmd)->hdr.out_words = ((resp_size) / 8); \
(cmd)->hdr.provider_in_words = (((size) - (cmd_size))/8);\
diff --git a/libibverbs/kern-abi.h b/libibverbs/kern-abi.h
index 92d750e1d26b09..52b6c8f5b3d621 100644
--- a/libibverbs/kern-abi.h
+++ b/libibverbs/kern-abi.h
@@ -1093,73 +1093,6 @@ struct ibv_destroy_srq_resp {
__u32 events_reported;
};
-/*
- * Compatibility with older ABI versions
- */
-
-enum {
- IB_USER_VERBS_CMD_QUERY_PARAMS_V2,
- IB_USER_VERBS_CMD_GET_CONTEXT_V2,
- IB_USER_VERBS_CMD_QUERY_DEVICE_V2,
- IB_USER_VERBS_CMD_QUERY_PORT_V2,
- IB_USER_VERBS_CMD_QUERY_GID_V2,
- IB_USER_VERBS_CMD_QUERY_PKEY_V2,
- IB_USER_VERBS_CMD_ALLOC_PD_V2,
- IB_USER_VERBS_CMD_DEALLOC_PD_V2,
- IB_USER_VERBS_CMD_CREATE_AH_V2,
- IB_USER_VERBS_CMD_MODIFY_AH_V2,
- IB_USER_VERBS_CMD_QUERY_AH_V2,
- IB_USER_VERBS_CMD_DESTROY_AH_V2,
- IB_USER_VERBS_CMD_REG_MR_V2,
- IB_USER_VERBS_CMD_REG_SMR_V2,
- IB_USER_VERBS_CMD_REREG_MR_V2,
- IB_USER_VERBS_CMD_QUERY_MR_V2,
- IB_USER_VERBS_CMD_DEREG_MR_V2,
- IB_USER_VERBS_CMD_ALLOC_MW_V2,
- IB_USER_VERBS_CMD_BIND_MW_V2,
- IB_USER_VERBS_CMD_DEALLOC_MW_V2,
- IB_USER_VERBS_CMD_CREATE_CQ_V2,
- IB_USER_VERBS_CMD_RESIZE_CQ_V2,
- IB_USER_VERBS_CMD_DESTROY_CQ_V2,
- IB_USER_VERBS_CMD_POLL_CQ_V2,
- IB_USER_VERBS_CMD_PEEK_CQ_V2,
- IB_USER_VERBS_CMD_REQ_NOTIFY_CQ_V2,
- IB_USER_VERBS_CMD_CREATE_QP_V2,
- IB_USER_VERBS_CMD_QUERY_QP_V2,
- IB_USER_VERBS_CMD_MODIFY_QP_V2,
- IB_USER_VERBS_CMD_DESTROY_QP_V2,
- IB_USER_VERBS_CMD_POST_SEND_V2,
- IB_USER_VERBS_CMD_POST_RECV_V2,
- IB_USER_VERBS_CMD_ATTACH_MCAST_V2,
- IB_USER_VERBS_CMD_DETACH_MCAST_V2,
- IB_USER_VERBS_CMD_CREATE_SRQ_V2,
- IB_USER_VERBS_CMD_MODIFY_SRQ_V2,
- IB_USER_VERBS_CMD_QUERY_SRQ_V2,
- IB_USER_VERBS_CMD_DESTROY_SRQ_V2,
- IB_USER_VERBS_CMD_POST_SRQ_RECV_V2,
- /*
- * Set commands that didn't exist to -1 so our compile-time
- * trick opcodes in IBV_INIT_CMD() doesn't break.
- */
- IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL_V2 = -1,
- IB_USER_VERBS_CMD_OPEN_XRCD_V2 = -1,
- IB_USER_VERBS_CMD_CLOSE_XRCD_V2 = -1,
- IB_USER_VERBS_CMD_CREATE_XSRQ_V2 = -1,
- IB_USER_VERBS_CMD_OPEN_QP_V2 = -1,
- IB_USER_VERBS_CMD_CREATE_FLOW_V2 = -1,
- IB_USER_VERBS_CMD_DESTROY_FLOW_V2 = -1,
- IB_USER_VERBS_CMD_QUERY_DEVICE_EX_V2 = -1,
- IB_USER_VERBS_CMD_CREATE_QP_EX_V2 = -1,
- IB_USER_VERBS_CMD_CREATE_CQ_EX_V2 = -1,
- IB_USER_VERBS_CMD_CREATE_WQ_V2 = -1,
- IB_USER_VERBS_CMD_MODIFY_WQ_V2 = -1,
- IB_USER_VERBS_CMD_DESTROY_WQ_V2 = -1,
- IB_USER_VERBS_CMD_CREATE_RWQ_IND_TBL_V2 = -1,
- IB_USER_VERBS_CMD_DESTROY_RWQ_IND_TBL_V2 = -1,
- IB_USER_VERBS_CMD_MODIFY_QP_EX_V2 = -1,
- IB_USER_VERBS_CMD_MODIFY_CQ_V2 = -1,
-};
-
struct ibv_modify_srq_v3 {
__u32 command;
__u16 in_words;
diff --git a/libibverbs/verbs.c b/libibverbs/verbs.c
index c772335e06d71a..4b2696e2aac020 100644
--- a/libibverbs/verbs.c
+++ b/libibverbs/verbs.c
@@ -315,33 +315,12 @@ LATEST_SYMVER_FUNC(ibv_dereg_mr, 1_1, "IBVERBS_1.1",
return ret;
}
-static struct ibv_comp_channel *ibv_create_comp_channel_v2(struct ibv_context *context)
-{
- struct ibv_abi_compat_v2 *t = context->abi_compat;
- static int warned;
-
- if (!pthread_mutex_trylock(&t->in_use))
- return &t->channel;
-
- if (!warned) {
- fprintf(stderr, PFX "Warning: kernel's ABI version %d limits capacity.\n"
- " Only one completion channel can be created per context.\n",
- abi_ver);
- ++warned;
- }
-
- return NULL;
-}
-
struct ibv_comp_channel *ibv_create_comp_channel(struct ibv_context *context)
{
struct ibv_comp_channel *channel;
struct ibv_create_comp_channel cmd;
struct ibv_create_comp_channel_resp resp;
- if (abi_ver <= 2)
- return ibv_create_comp_channel_v2(context);
-
channel = malloc(sizeof *channel);
if (!channel)
return NULL;
@@ -361,13 +340,6 @@ struct ibv_comp_channel *ibv_create_comp_channel(struct ibv_context *context)
return channel;
}
-static int ibv_destroy_comp_channel_v2(struct ibv_comp_channel *channel)
-{
- struct ibv_abi_compat_v2 *t = (struct ibv_abi_compat_v2 *) channel;
- pthread_mutex_unlock(&t->in_use);
- return 0;
-}
-
int ibv_destroy_comp_channel(struct ibv_comp_channel *channel)
{
struct ibv_context *context;
@@ -381,11 +353,6 @@ int ibv_destroy_comp_channel(struct ibv_comp_channel *channel)
goto out;
}
- if (abi_ver <= 2) {
- ret = ibv_destroy_comp_channel_v2(channel);
- goto out;
- }
-
close(channel->fd);
free(channel);
ret = 0;
--
2.15.1
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2018-01-11 22:13 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-11 22:13 [PATCH rdma-core 00/17] Use the kernel ABI header instead of kern-abi.h Jason Gunthorpe
[not found] ` <20180111221340.965-1-jgg-uk2M96/98Pc@public.gmane.org>
2018-01-11 22:13 ` [PATCH rdma-core 01/17] Update rdma/ib_user_verbs.h Jason Gunthorpe
[not found] ` <20180111221340.965-2-jgg-uk2M96/98Pc@public.gmane.org>
2018-01-15 17:01 ` Yishai Hadas
[not found] ` <fe2337a1-b02d-cc01-c55d-e6e493ec30ef-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2018-01-15 17:10 ` Jason Gunthorpe
[not found] ` <20180115171033.GA2206-uk2M96/98Pc@public.gmane.org>
2018-01-22 10:48 ` Yishai Hadas
[not found] ` <c4ee82a7-f235-4370-cf64-d5c73a79bd1b-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2018-01-22 15:42 ` Jason Gunthorpe
[not found] ` <20180122154206.GC14372-uk2M96/98Pc@public.gmane.org>
2018-01-22 15:56 ` Yishai Hadas
2018-01-11 22:13 ` [PATCH rdma-core 02/17] verbs: Include rdma/ib_user_verbs.h in kern-abi.h Jason Gunthorpe
[not found] ` <20180111221340.965-3-jgg-uk2M96/98Pc@public.gmane.org>
2018-01-12 6:34 ` Leon Romanovsky
[not found] ` <20180112063433.GH15760-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2018-01-12 16:28 ` Jason Gunthorpe
2018-01-11 22:13 ` [PATCH rdma-core 03/17] verbs: Delete extended command definitions from kern-abi.h Jason Gunthorpe
2018-01-11 22:13 ` [PATCH rdma-core 04/17] verbs: Remove unused structs Jason Gunthorpe
2018-01-11 22:13 ` Jason Gunthorpe [this message]
2018-01-11 22:13 ` [PATCH rdma-core 06/17] verbs: Add missing endian annotations to kern-abi.h Jason Gunthorpe
2018-01-11 22:13 ` [PATCH rdma-core 07/17] verbs: Use kernel uapi names for identical structs Jason Gunthorpe
[not found] ` <20180111221340.965-8-jgg-uk2M96/98Pc@public.gmane.org>
2018-01-15 16:48 ` Yishai Hadas
[not found] ` <2f04c4d8-bc14-9293-2e03-b29074e08637-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2018-01-15 17:01 ` Jason Gunthorpe
2018-01-11 22:13 ` [PATCH rdma-core 08/17] verbs: Use kernel uapi header for ibv_cq_moderation_caps_resp Jason Gunthorpe
2018-01-11 22:13 ` [PATCH rdma-core 09/17] verbs: Use kernel uapi header for ibv_query_device_resp_ex Jason Gunthorpe
2018-01-11 22:13 ` [PATCH rdma-core 10/17] verbs: Use kernel uapi header for ibv_kern_wc and ibv_poll_cq_resp Jason Gunthorpe
2018-01-11 22:13 ` [PATCH rdma-core 11/17] verbs: Use kernel uapi header for ibv_create_ah_resp Jason Gunthorpe
2018-01-11 22:13 ` [PATCH rdma-core 12/17] verbs: Use kernel uapi header for ibv_kern_send_wr Jason Gunthorpe
2018-01-11 22:13 ` [PATCH rdma-core 13/17] verbs: Use kernel uapi header for IBV_CREATE_QP_EX_KERNEL_MASK_IND_TABLE Jason Gunthorpe
2018-01-11 22:13 ` [PATCH rdma-core 14/17] verbs: Use kernel uapi header for flow steering types Jason Gunthorpe
2018-01-11 22:13 ` [PATCH rdma-core 15/17] verbs: Use kernel uapi header for ibv_modify_qp_common Jason Gunthorpe
2018-01-11 22:13 ` [PATCH rdma-core 16/17] verb: Use kernel uapi header in struct ex_hdr Jason Gunthorpe
2018-01-11 22:13 ` [PATCH rdma-core 17/17] verbs: Tidy up the remaining structs in kern-abi.h Jason Gunthorpe
2018-01-22 17:37 ` [PATCH rdma-core 00/17] Use the kernel ABI header instead of kern-abi.h Jason Gunthorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180111221340.965-6-jgg@ziepe.ca \
--to=jgg-uk2m96/98pc@public.gmane.org \
--cc=jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox