Skip to content

Commit 972ecb8

Browse files
matanb10dledford
authored andcommitted
IB/mlx5: Add create_cq extended command
In order to create a CQ that supports timestamp, mlx5 needs to support the extended create CQ command with the timestamp flag. Signed-off-by: Matan Barak <[email protected]> Reviewed-by: Eli Cohen <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
1 parent 145d9c5 commit 972ecb8

File tree

1 file changed

+7
-0
lines changed
  • drivers/infiniband/hw/mlx5

1 file changed

+7
-0
lines changed

drivers/infiniband/hw/mlx5/cq.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,10 @@ static void destroy_cq_kernel(struct mlx5_ib_dev *dev, struct mlx5_ib_cq *cq)
757757
mlx5_db_free(dev->mdev, &cq->db);
758758
}
759759

760+
enum {
761+
CQ_CREATE_FLAGS_SUPPORTED = IB_CQ_FLAGS_TIMESTAMP_COMPLETION
762+
};
763+
760764
struct ib_cq *mlx5_ib_create_cq(struct ib_device *ibdev,
761765
const struct ib_cq_init_attr *attr,
762766
struct ib_ucontext *context,
@@ -780,6 +784,9 @@ struct ib_cq *mlx5_ib_create_cq(struct ib_device *ibdev,
780784
if (entries < 0)
781785
return ERR_PTR(-EINVAL);
782786

787+
if (attr->flags & ~CQ_CREATE_FLAGS_SUPPORTED)
788+
return ERR_PTR(-EOPNOTSUPP);
789+
783790
entries = roundup_pow_of_two(entries + 1);
784791
if (entries > (1 << MLX5_CAP_GEN(dev->mdev, log_max_cq_sz)))
785792
return ERR_PTR(-EINVAL);

0 commit comments

Comments
 (0)