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
170170 return err;
171171 }
172172
173−#define CQ_CREATE_FLAGS_SUPPORTED IB_CQ_FLAGS_TIMESTAMP_COMPLETION
173+#define CQ_CREATE_FLAGS_SUPPORTED IB_UVERBS_CQ_FLAGS_TIMESTAMP_COMPLETION
174174 struct ib_cq *mlx4_ib_create_cq(struct ib_device *ibdev,
175175 const struct ib_cq_init_attr *attr,
176176 struct ib_ucontext *context,
@@ -246,7 +246,7 @@ struct ib_cq *mlx4_ib_create_cq(struct ib_device *ibdev, · 69 unmodified lines
246246
247247 err = mlx4_cq_alloc(dev->dev, entries, &cq->buf.mtt, uar,
248248 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));
250250 if (err)
251251 goto err_dbmap;
252252
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
10101010 MLX5_SET(cqc, cqc, uar_page, index);
10111011 MLX5_SET(cqc, cqc, c_eqn, eqn);
10121012 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)
10141014 MLX5_SET(cqc, cqc, oi, 1);
10151015
10161016 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
11231123 * It returns non-zero value for unsupported CQ
11241124 * create flags, otherwise it returns zero.
11251125 */
1126− return (flags & ~(IB_CQ_FLAGS_IGNORE_OVERRUN |
1127− IB_CQ_FLAGS_TIMESTAMP_COMPLETION));
1126+ return (flags & ~(IB_UVERBS_CQ_FLAGS_IGNORE_OVERRUN |
1127+ IB_UVERBS_CQ_FLAGS_TIMESTAMP_COMPLETION));
11281128 }
11291129
11301130 static 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
300300 u32 max_sge;
301301 };
302302
303−enum ib_cq_creation_flags {
304− IB_CQ_FLAGS_TIMESTAMP_COMPLETION = 1 << 0,
305− IB_CQ_FLAGS_IGNORE_OVERRUN = 1 << 1,
306−};
307−
308303 struct ib_cq_init_attr {
309304 unsigned int cqe;
310305 int comp_vector;
include/uapi/rdma/ib_user_verbs.h+6−1
@@ -402,13 +402,18 @@ struct ib_uverbs_create_cq { · 401 unmodified lines
402402 __u64 driver_data[0];
403403 };
404404
405+enum 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+
405410 struct ib_uverbs_ex_create_cq {
406411 __u64 user_handle;
407412 __u32 cqe;
408413 __u32 comp_vector;
409414 __s32 comp_channel;
410415 __u32 comp_mask;
411− __u32 flags;
416+ __u32 flags; /* bitmask of ib_uverbs_ex_create_cq_flags */
412417 __u32 reserved;
413418 };
414419

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