diff mbox

[rdma-core,02/17] verbs: Include rdma/ib_user_verbs.h in kern-abi.h

Message ID 20180111221340.965-3-jgg@ziepe.ca (mailing list archive)
State Not Applicable
Headers show

Commit Message

Jason Gunthorpe Jan. 11, 2018, 10:13 p.m. UTC
From: Jason Gunthorpe <jgg@mellanox.com>

There are a few overlapping definitions that are identical in both
headers, delete them from kern-abi.h to make them includable.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
---
 libibverbs/kern-abi.h | 62 ++++++---------------------------------------------
 1 file changed, 7 insertions(+), 55 deletions(-)

Comments

Leon Romanovsky Jan. 12, 2018, 6:34 a.m. UTC | #1
On Thu, Jan 11, 2018 at 03:13:25PM -0700, Jason Gunthorpe wrote:
> From: Jason Gunthorpe <jgg@mellanox.com>
>
> There are a few overlapping definitions that are identical in both
> headers, delete them from kern-abi.h to make them includable.
>
> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
> ---
>  libibverbs/kern-abi.h | 62 ++++++---------------------------------------------
>  1 file changed, 7 insertions(+), 55 deletions(-)
>
> diff --git a/libibverbs/kern-abi.h b/libibverbs/kern-abi.h
> index f53e22fce5303b..d7acdaa9a4bca9 100644
> --- a/libibverbs/kern-abi.h
> +++ b/libibverbs/kern-abi.h
> @@ -37,9 +37,14 @@
>
>  #include <linux/types.h>
>
> +#include <rdma/ib_user_verbs.h>
> +
>  /*
> - * This file must be kept in sync with the kernel's version of
> - * drivers/infiniband/include/ib_user_verbs.h
> + * This file contains copied data from the kernel's include/uapi/rdma/ib_user_verbs.h,
> + * now included above.
> + *
> + * Whenever possible use the definition from the kernel header and avoid
> + * copying from that header into this file.
>   */
>
>  /*
> @@ -48,59 +53,6 @@
>  #define IB_USER_VERBS_MIN_ABI_VERSION	3
>  #define IB_USER_VERBS_MAX_ABI_VERSION	6
>
> -#define IB_USER_VERBS_CMD_THRESHOLD    50
> -
> -enum {
> -	IB_USER_VERBS_CMD_GET_CONTEXT,
> -	IB_USER_VERBS_CMD_QUERY_DEVICE,
> -	IB_USER_VERBS_CMD_QUERY_PORT,
> -	IB_USER_VERBS_CMD_ALLOC_PD,
> -	IB_USER_VERBS_CMD_DEALLOC_PD,
> -	IB_USER_VERBS_CMD_CREATE_AH,
> -	IB_USER_VERBS_CMD_MODIFY_AH,
> -	IB_USER_VERBS_CMD_QUERY_AH,
> -	IB_USER_VERBS_CMD_DESTROY_AH,
> -	IB_USER_VERBS_CMD_REG_MR,
> -	IB_USER_VERBS_CMD_REG_SMR,
> -	IB_USER_VERBS_CMD_REREG_MR,
> -	IB_USER_VERBS_CMD_QUERY_MR,
> -	IB_USER_VERBS_CMD_DEREG_MR,
> -	IB_USER_VERBS_CMD_ALLOC_MW,
> -	IB_USER_VERBS_CMD_BIND_MW,
> -	IB_USER_VERBS_CMD_DEALLOC_MW,
> -	IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL,
> -	IB_USER_VERBS_CMD_CREATE_CQ,
> -	IB_USER_VERBS_CMD_RESIZE_CQ,
> -	IB_USER_VERBS_CMD_DESTROY_CQ,
> -	IB_USER_VERBS_CMD_POLL_CQ,
> -	IB_USER_VERBS_CMD_PEEK_CQ,
> -	IB_USER_VERBS_CMD_REQ_NOTIFY_CQ,
> -	IB_USER_VERBS_CMD_CREATE_QP,
> -	IB_USER_VERBS_CMD_QUERY_QP,
> -	IB_USER_VERBS_CMD_MODIFY_QP,
> -	IB_USER_VERBS_CMD_DESTROY_QP,
> -	IB_USER_VERBS_CMD_POST_SEND,
> -	IB_USER_VERBS_CMD_POST_RECV,
> -	IB_USER_VERBS_CMD_ATTACH_MCAST,
> -	IB_USER_VERBS_CMD_DETACH_MCAST,
> -	IB_USER_VERBS_CMD_CREATE_SRQ,
> -	IB_USER_VERBS_CMD_MODIFY_SRQ,
> -	IB_USER_VERBS_CMD_QUERY_SRQ,
> -	IB_USER_VERBS_CMD_DESTROY_SRQ,
> -	IB_USER_VERBS_CMD_POST_SRQ_RECV,
> -	IB_USER_VERBS_CMD_OPEN_XRCD,
> -	IB_USER_VERBS_CMD_CLOSE_XRCD,
> -	IB_USER_VERBS_CMD_CREATE_XSRQ,
> -	IB_USER_VERBS_CMD_OPEN_QP
> -};
> -
> -#define IB_USER_VERBS_CMD_COMMAND_MASK		0xff
> -#define IB_USER_VERBS_CMD_FLAGS_MASK		0xff000000u
> -#define IB_USER_VERBS_CMD_FLAGS_SHIFT		24
> -
> -
> -#define IB_USER_VERBS_CMD_FLAG_EXTENDED		0x80ul

This define was added to kernel api (rdma/ib_user_verbs.h) in commit
f21519b23c1b ("IB/core: extended command: an improved infrastructure for uverbs commands")

It means that this proposed commit won't compile on the systems with
kernel dated before 2013. I don't think that it is real issue, but worth
to mention it in commit message/comment.

Thanks

> -
>  /* use this mask for creating extended commands */
>  #define IB_USER_VERBS_CMD_EXTENDED_MASK \
>  	(IB_USER_VERBS_CMD_FLAG_EXTENDED << \
> --
> 2.15.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jason Gunthorpe Jan. 12, 2018, 4:28 p.m. UTC | #2
On Fri, Jan 12, 2018 at 08:34:33AM +0200, Leon Romanovsky wrote:

> > -#define IB_USER_VERBS_CMD_FLAG_EXTENDED		0x80ul
> 
> This define was added to kernel api (rdma/ib_user_verbs.h) in commit
> f21519b23c1b ("IB/core: extended command: an improved infrastructure for uverbs commands")
> 
> It means that this proposed commit won't compile on the systems with
> kernel dated before 2013. I don't think that it is real issue, but worth
> to mention it in commit message/comment.

The very first patch in the series updates the internal copy of the
kernel header to 4.15-rc7 and ensures that systems with old distro
copies use the internal header instead.

Just as we have been doing for other kernel headers for a long time.

So it should build on everything. There are far newer needed symbols
than the one above as well..

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/libibverbs/kern-abi.h b/libibverbs/kern-abi.h
index f53e22fce5303b..d7acdaa9a4bca9 100644
--- a/libibverbs/kern-abi.h
+++ b/libibverbs/kern-abi.h
@@ -37,9 +37,14 @@ 
 
 #include <linux/types.h>
 
+#include <rdma/ib_user_verbs.h>
+
 /*
- * This file must be kept in sync with the kernel's version of
- * drivers/infiniband/include/ib_user_verbs.h
+ * This file contains copied data from the kernel's include/uapi/rdma/ib_user_verbs.h,
+ * now included above.
+ *
+ * Whenever possible use the definition from the kernel header and avoid
+ * copying from that header into this file.
  */
 
 /*
@@ -48,59 +53,6 @@ 
 #define IB_USER_VERBS_MIN_ABI_VERSION	3
 #define IB_USER_VERBS_MAX_ABI_VERSION	6
 
-#define IB_USER_VERBS_CMD_THRESHOLD    50
-
-enum {
-	IB_USER_VERBS_CMD_GET_CONTEXT,
-	IB_USER_VERBS_CMD_QUERY_DEVICE,
-	IB_USER_VERBS_CMD_QUERY_PORT,
-	IB_USER_VERBS_CMD_ALLOC_PD,
-	IB_USER_VERBS_CMD_DEALLOC_PD,
-	IB_USER_VERBS_CMD_CREATE_AH,
-	IB_USER_VERBS_CMD_MODIFY_AH,
-	IB_USER_VERBS_CMD_QUERY_AH,
-	IB_USER_VERBS_CMD_DESTROY_AH,
-	IB_USER_VERBS_CMD_REG_MR,
-	IB_USER_VERBS_CMD_REG_SMR,
-	IB_USER_VERBS_CMD_REREG_MR,
-	IB_USER_VERBS_CMD_QUERY_MR,
-	IB_USER_VERBS_CMD_DEREG_MR,
-	IB_USER_VERBS_CMD_ALLOC_MW,
-	IB_USER_VERBS_CMD_BIND_MW,
-	IB_USER_VERBS_CMD_DEALLOC_MW,
-	IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL,
-	IB_USER_VERBS_CMD_CREATE_CQ,
-	IB_USER_VERBS_CMD_RESIZE_CQ,
-	IB_USER_VERBS_CMD_DESTROY_CQ,
-	IB_USER_VERBS_CMD_POLL_CQ,
-	IB_USER_VERBS_CMD_PEEK_CQ,
-	IB_USER_VERBS_CMD_REQ_NOTIFY_CQ,
-	IB_USER_VERBS_CMD_CREATE_QP,
-	IB_USER_VERBS_CMD_QUERY_QP,
-	IB_USER_VERBS_CMD_MODIFY_QP,
-	IB_USER_VERBS_CMD_DESTROY_QP,
-	IB_USER_VERBS_CMD_POST_SEND,
-	IB_USER_VERBS_CMD_POST_RECV,
-	IB_USER_VERBS_CMD_ATTACH_MCAST,
-	IB_USER_VERBS_CMD_DETACH_MCAST,
-	IB_USER_VERBS_CMD_CREATE_SRQ,
-	IB_USER_VERBS_CMD_MODIFY_SRQ,
-	IB_USER_VERBS_CMD_QUERY_SRQ,
-	IB_USER_VERBS_CMD_DESTROY_SRQ,
-	IB_USER_VERBS_CMD_POST_SRQ_RECV,
-	IB_USER_VERBS_CMD_OPEN_XRCD,
-	IB_USER_VERBS_CMD_CLOSE_XRCD,
-	IB_USER_VERBS_CMD_CREATE_XSRQ,
-	IB_USER_VERBS_CMD_OPEN_QP
-};
-
-#define IB_USER_VERBS_CMD_COMMAND_MASK		0xff
-#define IB_USER_VERBS_CMD_FLAGS_MASK		0xff000000u
-#define IB_USER_VERBS_CMD_FLAGS_SHIFT		24
-
-
-#define IB_USER_VERBS_CMD_FLAG_EXTENDED		0x80ul
-
 /* use this mask for creating extended commands */
 #define IB_USER_VERBS_CMD_EXTENDED_MASK \
 	(IB_USER_VERBS_CMD_FLAG_EXTENDED << \