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 | return err; | 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 | struct ib_cq *mlx4_ib_create_cq(struct ib_device *ibdev, | 174 | struct 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 | ||
| @@ -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); |
| @@ -1123,8 +1123,8 @@ static inline u32 check_cq_create_flags(u32 flags) · 1122 unmodified lines | |||
| 1123 | * It returns non-zero value for unsupported CQ | 1123 | * 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 | ||
| 1130 | static inline int verify_assign_uidx(u8 cqe_version, u32 cmd_uidx, | 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 | u32 max_sge; | 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 | struct ib_cq_init_attr { | 303 | struct ib_cq_init_attr { |
| 309 | unsigned int cqe; | 304 | unsigned int cqe; |
| 310 | int comp_vector; | 305 | int comp_vector; |
| @@ -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 | ||
| 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 | struct ib_uverbs_ex_create_cq { | 410 | struct 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 | ||