diff mbox

[rdma-core,1/8] Update kernel headers

Message ID 20180313220737.4336-2-jgg@ziepe.ca (mailing list archive)
State Not Applicable
Delegated to: shefty
Headers show

Commit Message

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

To commit d50a8a96ee66 ("IB/mlx4: Move mlx4_uverbs_ex_query_device_resp to
include/uapi/")

The kernel dropped IB_USER_VERBS_CMD_FLAGS_SHIFT and changed
IB_USER_VERBS_CMD_FLAG_EXTENDED, so also adjust to match.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
---
 kernel-headers/rdma/ib_user_verbs.h   |  5 +----
 kernel-headers/rdma/mlx4-abi.h        | 14 ++++++++++++++
 kernel-headers/rdma/rdma_user_ioctl.h |  4 ++--
 libibverbs/cmd_fallback.c             |  4 +---
 libibverbs/ibverbs.h                  |  4 +---
 5 files changed, 19 insertions(+), 12 deletions(-)
diff mbox

Patch

diff --git a/kernel-headers/rdma/ib_user_verbs.h b/kernel-headers/rdma/ib_user_verbs.h
index 04d0e67b13120c..d56fba09dc8ac3 100644
--- a/kernel-headers/rdma/ib_user_verbs.h
+++ b/kernel-headers/rdma/ib_user_verbs.h
@@ -141,10 +141,7 @@  struct ib_uverbs_cq_moderation_caps {
  */
 
 #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 0x80
+#define IB_USER_VERBS_CMD_FLAG_EXTENDED 0x80000000u
 
 struct ib_uverbs_cmd_hdr {
 	__u32 command;
diff --git a/kernel-headers/rdma/mlx4-abi.h b/kernel-headers/rdma/mlx4-abi.h
index 7f9c37346613e0..d84616adff3264 100644
--- a/kernel-headers/rdma/mlx4-abi.h
+++ b/kernel-headers/rdma/mlx4-abi.h
@@ -156,4 +156,18 @@  enum mlx4_ib_rx_hash_fields {
 	MLX4_IB_RX_HASH_INNER		= 1ULL << 31,
 };
 
+struct mlx4_ib_rss_caps {
+	__u64 rx_hash_fields_mask; /* enum mlx4_ib_rx_hash_fields */
+	__u8 rx_hash_function; /* enum mlx4_ib_rx_hash_function_flags */
+	__u8 reserved[7];
+};
+
+struct mlx4_uverbs_ex_query_device_resp {
+	__u32			comp_mask;
+	__u32			response_length;
+	__u64			hca_core_clock_offset;
+	__u32			max_inl_recv_sz;
+	struct mlx4_ib_rss_caps	rss_caps;
+};
+
 #endif /* MLX4_ABI_USER_H */
diff --git a/kernel-headers/rdma/rdma_user_ioctl.h b/kernel-headers/rdma/rdma_user_ioctl.h
index 03557b5f9aa6b8..46de0885e8001d 100644
--- a/kernel-headers/rdma/rdma_user_ioctl.h
+++ b/kernel-headers/rdma/rdma_user_ioctl.h
@@ -65,7 +65,7 @@  struct ib_uverbs_attr {
 	__u16 len;		/* only for pointers */
 	__u16 flags;		/* combination of UVERBS_ATTR_F_XXXX */
 	__u16 reserved;
-	__u64 data;		/* ptr to command, inline data or idr/fd */
+	__aligned_u64 data;	/* ptr to command, inline data or idr/fd */
 };
 
 struct ib_uverbs_ioctl_hdr {
@@ -73,7 +73,7 @@  struct ib_uverbs_ioctl_hdr {
 	__u16 object_id;
 	__u16 method_id;
 	__u16 num_attrs;
-	__u64 reserved;
+	__aligned_u64 reserved;
 	struct ib_uverbs_attr  attrs[0];
 };
 
diff --git a/libibverbs/cmd_fallback.c b/libibverbs/cmd_fallback.c
index 1c217dfb78d00d..2acc40f0159094 100644
--- a/libibverbs/cmd_fallback.c
+++ b/libibverbs/cmd_fallback.c
@@ -242,9 +242,7 @@  int _execute_write_raw_ex(uint32_t cmdnum, struct ibv_context *ctx,
 	size_t resp_bytes =
 		(hdr->hdr.out_words + hdr->ex_hdr.provider_out_words) * 8;
 
-	hdr->hdr.command = (IB_USER_VERBS_CMD_FLAG_EXTENDED
-			    << IB_USER_VERBS_CMD_FLAGS_SHIFT) |
-			   cmdnum;
+	hdr->hdr.command = IB_USER_VERBS_CMD_FLAG_EXTENDED | cmdnum;
 	hdr->ex_hdr.cmd_hdr_reserved = 0;
 	hdr->ex_hdr.response =  ioctl_ptr_to_u64(resp);
 
diff --git a/libibverbs/ibverbs.h b/libibverbs/ibverbs.h
index 98000ff66e4ccc..c9da536ba7bb6b 100644
--- a/libibverbs/ibverbs.h
+++ b/libibverbs/ibverbs.h
@@ -81,9 +81,7 @@  struct verbs_ex_private {
 
 static inline uint32_t _cmd_ex(uint32_t cmd)
 {
-	return (IB_USER_VERBS_CMD_FLAG_EXTENDED
-		<< IB_USER_VERBS_CMD_FLAGS_SHIFT) |
-	       cmd;
+	return IB_USER_VERBS_CMD_FLAG_EXTENDED | cmd;
 }
 
 #define IBV_INIT_CMD_RESP_EX_V(cmd, cmd_size, size, opcode, out, resp_size,\