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