Commit beb801ac authored by Jason Gunthorpe's avatar Jason Gunthorpe

RDMA: Move enum ib_cq_creation_flags to uapi headers

The flags field the enum is used with comes directly from the uapi
so it belongs in the uapi headers for clarity and so userspace can
use it.
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 0812ed13
...@@ -170,7 +170,7 @@ static int mlx4_ib_get_cq_umem(struct mlx4_ib_dev *dev, struct ib_ucontext *cont ...@@ -170,7 +170,7 @@ static int mlx4_ib_get_cq_umem(struct mlx4_ib_dev *dev, struct ib_ucontext *cont
return err; return err;
} }
#define CQ_CREATE_FLAGS_SUPPORTED IB_CQ_FLAGS_TIMESTAMP_COMPLETION #define CQ_CREATE_FLAGS_SUPPORTED IB_UVERBS_CQ_FLAGS_TIMESTAMP_COMPLETION
struct ib_cq *mlx4_ib_create_cq(struct ib_device *ibdev, struct ib_cq *mlx4_ib_create_cq(struct ib_device *ibdev,
const struct ib_cq_init_attr *attr, const struct ib_cq_init_attr *attr,
struct ib_ucontext *context, struct ib_ucontext *context,
...@@ -246,7 +246,7 @@ struct ib_cq *mlx4_ib_create_cq(struct ib_device *ibdev, ...@@ -246,7 +246,7 @@ struct ib_cq *mlx4_ib_create_cq(struct ib_device *ibdev,
err = mlx4_cq_alloc(dev->dev, entries, &cq->buf.mtt, uar, err = mlx4_cq_alloc(dev->dev, entries, &cq->buf.mtt, uar,
cq->db.dma, &cq->mcq, vector, 0, cq->db.dma, &cq->mcq, vector, 0,
!!(cq->create_flags & IB_CQ_FLAGS_TIMESTAMP_COMPLETION)); !!(cq->create_flags & IB_UVERBS_CQ_FLAGS_TIMESTAMP_COMPLETION));
if (err) if (err)
goto err_dbmap; goto err_dbmap;
......
...@@ -1010,7 +1010,7 @@ struct ib_cq *mlx5_ib_create_cq(struct ib_device *ibdev, ...@@ -1010,7 +1010,7 @@ struct ib_cq *mlx5_ib_create_cq(struct ib_device *ibdev,
MLX5_SET(cqc, cqc, uar_page, index); MLX5_SET(cqc, cqc, uar_page, index);
MLX5_SET(cqc, cqc, c_eqn, eqn); MLX5_SET(cqc, cqc, c_eqn, eqn);
MLX5_SET64(cqc, cqc, dbr_addr, cq->db.dma); MLX5_SET64(cqc, cqc, dbr_addr, cq->db.dma);
if (cq->create_flags & IB_CQ_FLAGS_IGNORE_OVERRUN) if (cq->create_flags & IB_UVERBS_CQ_FLAGS_IGNORE_OVERRUN)
MLX5_SET(cqc, cqc, oi, 1); MLX5_SET(cqc, cqc, oi, 1);
err = mlx5_core_create_cq(dev->mdev, &cq->mcq, cqb, inlen); err = mlx5_core_create_cq(dev->mdev, &cq->mcq, cqb, inlen);
......
...@@ -1123,8 +1123,8 @@ static inline u32 check_cq_create_flags(u32 flags) ...@@ -1123,8 +1123,8 @@ static inline u32 check_cq_create_flags(u32 flags)
* It returns non-zero value for unsupported CQ * It returns non-zero value for unsupported CQ
* create flags, otherwise it returns zero. * create flags, otherwise it returns zero.
*/ */
return (flags & ~(IB_CQ_FLAGS_IGNORE_OVERRUN | return (flags & ~(IB_UVERBS_CQ_FLAGS_IGNORE_OVERRUN |
IB_CQ_FLAGS_TIMESTAMP_COMPLETION)); IB_UVERBS_CQ_FLAGS_TIMESTAMP_COMPLETION));
} }
static inline int verify_assign_uidx(u8 cqe_version, u32 cmd_uidx, static inline int verify_assign_uidx(u8 cqe_version, u32 cmd_uidx,
......
...@@ -300,11 +300,6 @@ struct ib_tm_caps { ...@@ -300,11 +300,6 @@ struct ib_tm_caps {
u32 max_sge; u32 max_sge;
}; };
enum ib_cq_creation_flags {
IB_CQ_FLAGS_TIMESTAMP_COMPLETION = 1 << 0,
IB_CQ_FLAGS_IGNORE_OVERRUN = 1 << 1,
};
struct ib_cq_init_attr { struct ib_cq_init_attr {
unsigned int cqe; unsigned int cqe;
int comp_vector; int comp_vector;
......
...@@ -402,13 +402,18 @@ struct ib_uverbs_create_cq { ...@@ -402,13 +402,18 @@ struct ib_uverbs_create_cq {
__u64 driver_data[0]; __u64 driver_data[0];
}; };
enum ib_uverbs_ex_create_cq_flags {
IB_UVERBS_CQ_FLAGS_TIMESTAMP_COMPLETION = 1 << 0,
IB_UVERBS_CQ_FLAGS_IGNORE_OVERRUN = 1 << 1,
};
struct ib_uverbs_ex_create_cq { struct ib_uverbs_ex_create_cq {
__u64 user_handle; __u64 user_handle;
__u32 cqe; __u32 cqe;
__u32 comp_vector; __u32 comp_vector;
__s32 comp_channel; __s32 comp_channel;
__u32 comp_mask; __u32 comp_mask;
__u32 flags; __u32 flags; /* bitmask of ib_uverbs_ex_create_cq_flags */
__u32 reserved; __u32 reserved;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment