Skip to content

Commit 48962f5

Browse files
committed
RDMA/mlx4: Move flag constants to uapi header
MLX4_USER_DEV_CAP_LARGE_CQE (via mlx4_ib_alloc_ucontext_resp.dev_caps) and MLX4_IB_QUERY_DEV_RESP_MASK_CORE_CLOCK_OFFSET (via mlx4_uverbs_ex_query_device_resp.comp_mask) are copied directly to userspace and form part of the uAPI. Move them to the uapi header where they belong. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
1 parent 0c43ab3 commit 48962f5

6 files changed

Lines changed: 11 additions & 9 deletions

File tree

‎drivers/infiniband/hw/mlx4/main.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ static int mlx4_ib_query_device(struct ib_device *ibdev,
575575
if (uhw->outlen >= resp.response_length + sizeof(resp.hca_core_clock_offset)) {
576576
resp.response_length += sizeof(resp.hca_core_clock_offset);
577577
if (!err && !mlx4_is_slave(dev->dev)) {
578-
resp.comp_mask |= QUERY_DEVICE_RESP_MASK_TIMESTAMP;
578+
resp.comp_mask |= MLX4_IB_QUERY_DEV_RESP_MASK_CORE_CLOCK_OFFSET;
579579
resp.hca_core_clock_offset = clock_params.offset % PAGE_SIZE;
580580
}
581581
}

‎drivers/infiniband/hw/mlx4/mlx4_ib.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -641,10 +641,6 @@ struct mlx4_uverbs_ex_query_device {
641641
__u32 reserved;
642642
};
643643

644-
enum query_device_resp_mask {
645-
QUERY_DEVICE_RESP_MASK_TIMESTAMP = 1UL << 0,
646-
};
647-
648644
static inline struct mlx4_ib_dev *to_mdev(struct ib_device *ibdev)
649645
{
650646
return container_of(ibdev, struct mlx4_ib_dev, ib_dev);

‎drivers/net/ethernet/mellanox/mlx4/fw.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include <linux/module.h>
3838
#include <linux/cache.h>
3939
#include <linux/kernel.h>
40+
#include <uapi/rdma/mlx4-abi.h>
4041

4142
#include "fw.h"
4243
#include "icm.h"

‎drivers/net/ethernet/mellanox/mlx4/main.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
#include <linux/etherdevice.h>
4747
#include <net/devlink.h>
4848

49+
#include <uapi/rdma/mlx4-abi.h>
4950
#include <linux/mlx4/device.h>
5051
#include <linux/mlx4/doorbell.h>
5152

‎include/linux/mlx4/device.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,6 @@ enum {
256256
MLX4_DEV_CAP_EQE_STRIDE_ENABLED = 1LL << 3
257257
};
258258

259-
enum {
260-
MLX4_USER_DEV_CAP_LARGE_CQE = 1L << 0
261-
};
262-
263259
enum {
264260
MLX4_FUNC_CAP_64B_EQE_CQE = 1L << 0,
265261
MLX4_FUNC_CAP_EQE_CQE_STRIDE = 1L << 1,

‎include/uapi/rdma/mlx4-abi.h‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ struct mlx4_ib_alloc_ucontext_resp_v3 {
5959
__u16 bf_regs_per_page;
6060
};
6161

62+
enum {
63+
MLX4_USER_DEV_CAP_LARGE_CQE = 1L << 0,
64+
};
65+
6266
struct mlx4_ib_alloc_ucontext_resp {
6367
__u32 dev_caps;
6468
__u32 qp_tab_size;
@@ -162,6 +166,10 @@ struct mlx4_ib_rss_caps {
162166
__u8 reserved[7];
163167
};
164168

169+
enum query_device_resp_mask {
170+
MLX4_IB_QUERY_DEV_RESP_MASK_CORE_CLOCK_OFFSET = 1UL << 0,
171+
};
172+
165173
struct mlx4_uverbs_ex_query_device_resp {
166174
__u32 comp_mask;
167175
__u32 response_length;

0 commit comments

Comments
 (0)