History

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.

Jason Gunthorpe committed 8 years ago

Commit beb801a1 parent 0812ed15 files · +11 −11Browse files

Unified · Split

5 files
  1. drivers/infiniband/hw/mlx4/cq.c +2 −2
  2. drivers/infiniband/hw/mlx5/cq.c +1 −1
  3. drivers/infiniband/hw/mlx5/mlx5_ib.h +2 −2
  4. include/rdma/ib_verbs.h +0 −5
  5. include/uapi/rdma/ib_user_verbs.h +6 −1
drivers/infiniband/hw/mlx4/cq.c+2−2
@@ -170,7 +170,7 @@ err_buf: · 169 unmodified lines
170 return err;170 return err;
171}171}
172 172
173#define CQ_CREATE_FLAGS_SUPPORTED IB_CQ_FLAGS_TIMESTAMP_COMPLETION173#define CQ_CREATE_FLAGS_SUPPORTED IB_UVERBS_CQ_FLAGS_TIMESTAMP_COMPLETION
174struct ib_cq *mlx4_ib_create_cq(struct ib_device *ibdev,174struct ib_cq *mlx4_ib_create_cq(struct ib_device *ibdev,
175 const struct ib_cq_init_attr *attr,175 const struct ib_cq_init_attr *attr,
176 struct ib_ucontext *context,176 struct ib_ucontext *context,
@@ -246,7 +246,7 @@ struct ib_cq *mlx4_ib_create_cq(struct ib_device *ibdev, · 69 unmodified lines
246 246
247 err = mlx4_cq_alloc(dev->dev, entries, &cq->buf.mtt, uar,247 err = mlx4_cq_alloc(dev->dev, entries, &cq->buf.mtt, uar,
248 cq->db.dma, &cq->mcq, vector, 0,248 cq->db.dma, &cq->mcq, vector, 0,
249 !!(cq->create_flags & IB_CQ_FLAGS_TIMESTAMP_COMPLETION));249 !!(cq->create_flags & IB_UVERBS_CQ_FLAGS_TIMESTAMP_COMPLETION));
250 if (err)250 if (err)
251 goto err_dbmap;251 goto err_dbmap;
252 252
drivers/infiniband/hw/mlx5/cq.c+1−1
@@ -1010,7 +1010,7 @@ struct ib_cq *mlx5_ib_create_cq(struct ib_device *ibdev, · 1009 unmodified lines
1010 MLX5_SET(cqc, cqc, uar_page, index);1010 MLX5_SET(cqc, cqc, uar_page, index);
1011 MLX5_SET(cqc, cqc, c_eqn, eqn);1011 MLX5_SET(cqc, cqc, c_eqn, eqn);
1012 MLX5_SET64(cqc, cqc, dbr_addr, cq->db.dma);1012 MLX5_SET64(cqc, cqc, dbr_addr, cq->db.dma);
1013 if (cq->create_flags & IB_CQ_FLAGS_IGNORE_OVERRUN)1013 if (cq->create_flags & IB_UVERBS_CQ_FLAGS_IGNORE_OVERRUN)
1014 MLX5_SET(cqc, cqc, oi, 1);1014 MLX5_SET(cqc, cqc, oi, 1);
1015 1015
1016 err = mlx5_core_create_cq(dev->mdev, &cq->mcq, cqb, inlen);1016 err = mlx5_core_create_cq(dev->mdev, &cq->mcq, cqb, inlen);
drivers/infiniband/hw/mlx5/mlx5_ib.h+2−2
@@ -1123,8 +1123,8 @@ static inline u32 check_cq_create_flags(u32 flags) · 1122 unmodified lines
1123 * It returns non-zero value for unsupported CQ1123 * It returns non-zero value for unsupported CQ
1124 * create flags, otherwise it returns zero.1124 * create flags, otherwise it returns zero.
1125 */1125 */
1126 return (flags & ~(IB_CQ_FLAGS_IGNORE_OVERRUN |1126 return (flags & ~(IB_UVERBS_CQ_FLAGS_IGNORE_OVERRUN |
1127 IB_CQ_FLAGS_TIMESTAMP_COMPLETION));1127 IB_UVERBS_CQ_FLAGS_TIMESTAMP_COMPLETION));
1128}1128}
1129 1129
1130static inline int verify_assign_uidx(u8 cqe_version, u32 cmd_uidx,1130static inline int verify_assign_uidx(u8 cqe_version, u32 cmd_uidx,
include/rdma/ib_verbs.h+0−5
@@ -300,11 +300,6 @@ struct ib_tm_caps { · 299 unmodified lines
300 u32 max_sge;300 u32 max_sge;
301};301};
302 302
303enum ib_cq_creation_flags {
304 IB_CQ_FLAGS_TIMESTAMP_COMPLETION = 1 << 0,
305 IB_CQ_FLAGS_IGNORE_OVERRUN = 1 << 1,
306};
307
308struct ib_cq_init_attr {303struct ib_cq_init_attr {
309 unsigned int cqe;304 unsigned int cqe;
310 int comp_vector;305 int comp_vector;
include/uapi/rdma/ib_user_verbs.h+6−1
@@ -402,13 +402,18 @@ struct ib_uverbs_create_cq { · 401 unmodified lines
402 __u64 driver_data[0];402 __u64 driver_data[0];
403};403};
404 404
405enum ib_uverbs_ex_create_cq_flags {
406 IB_UVERBS_CQ_FLAGS_TIMESTAMP_COMPLETION = 1 << 0,
407 IB_UVERBS_CQ_FLAGS_IGNORE_OVERRUN = 1 << 1,
408};
409
405struct ib_uverbs_ex_create_cq {410struct ib_uverbs_ex_create_cq {
406 __u64 user_handle;411 __u64 user_handle;
407 __u32 cqe;412 __u32 cqe;
408 __u32 comp_vector;413 __u32 comp_vector;
409 __s32 comp_channel;414 __s32 comp_channel;
410 __u32 comp_mask;415 __u32 comp_mask;
411 __u32 flags;416 __u32 flags; /* bitmask of ib_uverbs_ex_create_cq_flags */
412 __u32 reserved;417 __u32 reserved;
413};418};
414 419

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t