Re: [PATCH for-next 1/4] IB/mlx5: Add create_cq extended command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 09, 2015 at 06:30:54PM +0200, Matan Barak wrote:
> 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 <matanb@xxxxxxxxxxxx>
>  drivers/infiniband/hw/mlx5/cq.c   | 7 +++++++
>  drivers/infiniband/hw/mlx5/main.c | 3 ++-
>  2 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/hw/mlx5/cq.c b/drivers/infiniband/hw/mlx5/cq.c
> index 2d0dbbf..674f857 100644
> +++ b/drivers/infiniband/hw/mlx5/cq.c
> @@ -743,6 +743,10 @@ static void destroy_cq_kernel(struct mlx5_ib_dev *dev, struct mlx5_ib_cq *cq)
>  	mlx5_db_free(dev->mdev, &cq->db);
>  }
>  
> +enum {
> +	CQ_CREATE_FLAGS_SUPPORTED = IB_CQ_FLAGS_TIMESTAMP_COMPLETION
> +};
> +
>  struct ib_cq *mlx5_ib_create_cq(struct ib_device *ibdev,
>  				const struct ib_cq_init_attr *attr,
>  				struct ib_ucontext *context,
> @@ -766,6 +770,9 @@ struct ib_cq *mlx5_ib_create_cq(struct ib_device *ibdev,
>  	if (entries < 0)
>  		return ERR_PTR(-EINVAL);
>  
> +	if (attr->flags & ~CQ_CREATE_FLAGS_SUPPORTED)
> +		return ERR_PTR(-EINVAL);

And this is what I was just mentioning to Eli, EINVAL is not the right
return, and this same comment applies to the places where the above
was copy and pasted into drivers during the ex patching.

Try for EOPNOTSUPP maybe?

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux