linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH rdma-next 0/3] Introduce new mlx5 CQE format
@ 2018-05-27 10:42 Leon Romanovsky
  2018-05-27 10:42 ` [PATCH mlx5-next 1/3] net/mlx5: Exposing a new mini-CQE format Leon Romanovsky
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Leon Romanovsky @ 2018-05-27 10:42 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe
  Cc: Leon Romanovsky, RDMA mailing list, Guy Levi, Yishai Hadas,
	Yonatan Cohen, Saeed Mahameed, linux-netdev

From: Leon Romanovsky <leonro@mellanox.com>

Introduce new internal to mlx5 CQE format - mini-CQE. It is a CQE in
compressed form that holds data needed to extra a single full CQE.

It stride index, byte count and packet checksum.

Thanks

Yonatan Cohen (3):
  net/mlx5: Exposing a new mini-CQE format
  IB/mlx5: Refactor CQE compression response
  IB/mlx5: Introduce a new mini-CQE format

 drivers/infiniband/hw/mlx5/cq.c   | 42 +++++++++++++++++++++++++++++----------
 drivers/infiniband/hw/mlx5/main.c | 20 +++++++++++++------
 include/linux/mlx5/mlx5_ifc.h     |  3 ++-
 include/uapi/rdma/mlx5-abi.h      |  2 +-
 4 files changed, 49 insertions(+), 18 deletions(-)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH mlx5-next 1/3] net/mlx5: Exposing a new mini-CQE format
  2018-05-27 10:42 [PATCH rdma-next 0/3] Introduce new mlx5 CQE format Leon Romanovsky
@ 2018-05-27 10:42 ` Leon Romanovsky
  2018-05-29 21:01   ` Saeed Mahameed
  2018-05-27 10:42 ` [PATCH rdma-next 2/3] IB/mlx5: Refactor CQE compression response Leon Romanovsky
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 10+ messages in thread
From: Leon Romanovsky @ 2018-05-27 10:42 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe
  Cc: Leon Romanovsky, RDMA mailing list, Guy Levi, Yishai Hadas,
	Yonatan Cohen, Saeed Mahameed, linux-netdev

From: Yonatan Cohen <yonatanc@mellanox.com>

The new mini-CQE format includes byte-count, checksum
and stride index.

Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
Reviewed-by: Guy Levi <guyle@mellanox.com>
Signed-off-by: Yonatan Cohen <yonatanc@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 include/linux/mlx5/mlx5_ifc.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index ee8e5a0d0acf..1ea2827e94be 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -1160,7 +1160,8 @@ struct mlx5_ifc_cmd_hca_cap_bits {
 	u8         flex_parser_protocols[0x20];
 	u8         reserved_at_560[0x20];
 
-	u8         reserved_at_580[0x3d];
+	u8         reserved_at_580[0x3c];
+	u8         mini_cqe_resp_stride_index[0x1];
 	u8         cqe_128_always[0x1];
 	u8         cqe_compression_128[0x1];
 	u8         cqe_compression[0x1];
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH rdma-next 2/3] IB/mlx5: Refactor CQE compression response
  2018-05-27 10:42 [PATCH rdma-next 0/3] Introduce new mlx5 CQE format Leon Romanovsky
  2018-05-27 10:42 ` [PATCH mlx5-next 1/3] net/mlx5: Exposing a new mini-CQE format Leon Romanovsky
@ 2018-05-27 10:42 ` Leon Romanovsky
  2018-05-27 10:42 ` [PATCH rdma-next 3/3] IB/mlx5: Introduce a new mini-CQE format Leon Romanovsky
  2018-05-29 20:05 ` [PATCH rdma-next 0/3] Introduce new mlx5 CQE format Jason Gunthorpe
  3 siblings, 0 replies; 10+ messages in thread
From: Leon Romanovsky @ 2018-05-27 10:42 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe
  Cc: Leon Romanovsky, RDMA mailing list, Guy Levi, Yishai Hadas,
	Yonatan Cohen, Saeed Mahameed, linux-netdev

From: Yonatan Cohen <yonatanc@mellanox.com>

Refactor CQE compression response to be fully set only
when it`s really supported. There is no change from user
perspective because anyway resp.cqe_comp_caps.max_num was
set to zero.

Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Yonatan Cohen <yonatanc@mellanox.com>W
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/infiniband/hw/mlx5/main.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index 59e080da32aa..95e67a85078c 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -982,13 +982,17 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
 	}
 
 	if (field_avail(typeof(resp), cqe_comp_caps, uhw->outlen)) {
-		resp.cqe_comp_caps.max_num =
-			MLX5_CAP_GEN(dev->mdev, cqe_compression) ?
-			MLX5_CAP_GEN(dev->mdev, cqe_compression_max_num) : 0;
-		resp.cqe_comp_caps.supported_format =
-			MLX5_IB_CQE_RES_FORMAT_HASH |
-			MLX5_IB_CQE_RES_FORMAT_CSUM;
 		resp.response_length += sizeof(resp.cqe_comp_caps);
+
+		if (MLX5_CAP_GEN(dev->mdev, cqe_compression)) {
+			resp.cqe_comp_caps.max_num =
+				MLX5_CAP_GEN(dev->mdev,
+					     cqe_compression_max_num);
+
+			resp.cqe_comp_caps.supported_format =
+				MLX5_IB_CQE_RES_FORMAT_HASH |
+				MLX5_IB_CQE_RES_FORMAT_CSUM;
+		}
 	}
 
 	if (field_avail(typeof(resp), packet_pacing_caps, uhw->outlen) &&
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH rdma-next 3/3] IB/mlx5: Introduce a new mini-CQE format
  2018-05-27 10:42 [PATCH rdma-next 0/3] Introduce new mlx5 CQE format Leon Romanovsky
  2018-05-27 10:42 ` [PATCH mlx5-next 1/3] net/mlx5: Exposing a new mini-CQE format Leon Romanovsky
  2018-05-27 10:42 ` [PATCH rdma-next 2/3] IB/mlx5: Refactor CQE compression response Leon Romanovsky
@ 2018-05-27 10:42 ` Leon Romanovsky
  2018-05-28 16:11   ` Jason Gunthorpe
  2018-05-29 20:05 ` [PATCH rdma-next 0/3] Introduce new mlx5 CQE format Jason Gunthorpe
  3 siblings, 1 reply; 10+ messages in thread
From: Leon Romanovsky @ 2018-05-27 10:42 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe
  Cc: Leon Romanovsky, RDMA mailing list, Guy Levi, Yishai Hadas,
	Yonatan Cohen, Saeed Mahameed, linux-netdev

From: Yonatan Cohen <yonatanc@mellanox.com>

The new mini-CQE format includes the stride index, byte count and
packet checksum.
Stride index is needed for striding WQ feature.
This patch exposes this capability and enables its setting
via mlx5 UHW data as part of query device and cq creation.

Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
Reviewed-by: Guy Levi <guyle@mellanox.com>
Signed-off-by: Yonatan Cohen <yonatanc@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/infiniband/hw/mlx5/cq.c   | 42 +++++++++++++++++++++++++++++----------
 drivers/infiniband/hw/mlx5/main.c |  4 ++++
 include/uapi/rdma/mlx5-abi.h      |  2 +-
 3 files changed, 37 insertions(+), 11 deletions(-)

diff --git a/drivers/infiniband/hw/mlx5/cq.c b/drivers/infiniband/hw/mlx5/cq.c
index 7b4ce1a19de0..ad39d64b8108 100644
--- a/drivers/infiniband/hw/mlx5/cq.c
+++ b/drivers/infiniband/hw/mlx5/cq.c
@@ -751,6 +751,28 @@ static int alloc_cq_frag_buf(struct mlx5_ib_dev *dev,
 	return 0;
 }
 
+enum {
+	MLX5_CQE_RES_FORMAT_HASH = 0,
+	MLX5_CQE_RES_FORMAT_CSUM = 1,
+	MLX5_CQE_RES_FORMAT_CSUM_STRIDX = 3,
+};
+
+static int mini_cqe_res_format_to_hw(struct mlx5_ib_dev *dev, u8 format)
+{
+	switch (format) {
+	case MLX5_IB_CQE_RES_FORMAT_HASH:
+		return MLX5_CQE_RES_FORMAT_HASH;
+	case MLX5_IB_CQE_RES_FORMAT_CSUM:
+		return MLX5_CQE_RES_FORMAT_CSUM;
+	case MLX5_IB_CQE_RES_FORMAT_CSUM_STRIDX:
+		if (MLX5_CAP_GEN(dev->mdev, mini_cqe_resp_stride_index))
+			return MLX5_CQE_RES_FORMAT_CSUM_STRIDX;
+		return -EOPNOTSUPP;
+	default:
+		return -EINVAL;
+	}
+}
+
 static int create_cq_user(struct mlx5_ib_dev *dev, struct ib_udata *udata,
 			  struct ib_ucontext *context, struct mlx5_ib_cq *cq,
 			  int entries, u32 **cqb,
@@ -816,6 +838,8 @@ static int create_cq_user(struct mlx5_ib_dev *dev, struct ib_udata *udata,
 	*index = to_mucontext(context)->bfregi.sys_pages[0];
 
 	if (ucmd.cqe_comp_en == 1) {
+		int mini_cqe_format;
+
 		if (!((*cqe_size == 128 &&
 		       MLX5_CAP_GEN(dev->mdev, cqe_compression_128)) ||
 		      (*cqe_size == 64  &&
@@ -826,20 +850,18 @@ static int create_cq_user(struct mlx5_ib_dev *dev, struct ib_udata *udata,
 			goto err_cqb;
 		}
 
-		if (unlikely(!ucmd.cqe_comp_res_format ||
-			     !(ucmd.cqe_comp_res_format <
-			       MLX5_IB_CQE_RES_RESERVED) ||
-			     (ucmd.cqe_comp_res_format &
-			      (ucmd.cqe_comp_res_format - 1)))) {
-			err = -EOPNOTSUPP;
-			mlx5_ib_warn(dev, "CQE compression res format %d is not supported!\n",
-				     ucmd.cqe_comp_res_format);
+		mini_cqe_format =
+			mini_cqe_res_format_to_hw(dev,
+						  ucmd.cqe_comp_res_format);
+		if (mini_cqe_format < 0) {
+			err = mini_cqe_format;
+			mlx5_ib_dbg(dev, "CQE compression res format %d error: %d\n",
+				    ucmd.cqe_comp_res_format, err);
 			goto err_cqb;
 		}
 
 		MLX5_SET(cqc, cqc, cqe_comp_en, 1);
-		MLX5_SET(cqc, cqc, mini_cqe_res_format,
-			 ilog2(ucmd.cqe_comp_res_format));
+		MLX5_SET(cqc, cqc, mini_cqe_res_format, mini_cqe_format);
 	}
 
 	if (ucmd.flags & MLX5_IB_CREATE_CQ_FLAGS_CQE_128B_PAD) {
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index 95e67a85078c..238f1eed714c 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -992,6 +992,10 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
 			resp.cqe_comp_caps.supported_format =
 				MLX5_IB_CQE_RES_FORMAT_HASH |
 				MLX5_IB_CQE_RES_FORMAT_CSUM;
+
+			if (MLX5_CAP_GEN(dev->mdev, mini_cqe_resp_stride_index))
+				resp.cqe_comp_caps.supported_format |=
+					MLX5_IB_CQE_RES_FORMAT_CSUM_STRIDX;
 		}
 	}
 
diff --git a/include/uapi/rdma/mlx5-abi.h b/include/uapi/rdma/mlx5-abi.h
index beec971effef..a03b68b3e26c 100644
--- a/include/uapi/rdma/mlx5-abi.h
+++ b/include/uapi/rdma/mlx5-abi.h
@@ -166,7 +166,7 @@ struct mlx5_ib_rss_caps {
 enum mlx5_ib_cqe_comp_res_format {
 	MLX5_IB_CQE_RES_FORMAT_HASH	= 1 << 0,
 	MLX5_IB_CQE_RES_FORMAT_CSUM	= 1 << 1,
-	MLX5_IB_CQE_RES_RESERVED	= 1 << 2,
+	MLX5_IB_CQE_RES_FORMAT_CSUM_STRIDX = 1 << 2,
 };
 
 struct mlx5_ib_cqe_comp_caps {
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH rdma-next 3/3] IB/mlx5: Introduce a new mini-CQE format
  2018-05-27 10:42 ` [PATCH rdma-next 3/3] IB/mlx5: Introduce a new mini-CQE format Leon Romanovsky
@ 2018-05-28 16:11   ` Jason Gunthorpe
  2018-05-28 16:52     ` Yishai Hadas
  0 siblings, 1 reply; 10+ messages in thread
From: Jason Gunthorpe @ 2018-05-28 16:11 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Doug Ledford, Leon Romanovsky, RDMA mailing list, Guy Levi,
	Yishai Hadas, Yonatan Cohen, Saeed Mahameed, linux-netdev

On Sun, May 27, 2018 at 01:42:34PM +0300, Leon Romanovsky wrote:
> From: Yonatan Cohen <yonatanc@mellanox.com>
> 
> The new mini-CQE format includes the stride index, byte count and
> packet checksum.
> Stride index is needed for striding WQ feature.
> This patch exposes this capability and enables its setting
> via mlx5 UHW data as part of query device and cq creation.
> 
> Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
> Reviewed-by: Guy Levi <guyle@mellanox.com>
> Signed-off-by: Yonatan Cohen <yonatanc@mellanox.com>
> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
>  drivers/infiniband/hw/mlx5/cq.c   | 42 +++++++++++++++++++++++++++++----------
>  drivers/infiniband/hw/mlx5/main.c |  4 ++++
>  include/uapi/rdma/mlx5-abi.h      |  2 +-
>  3 files changed, 37 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/mlx5/cq.c b/drivers/infiniband/hw/mlx5/cq.c
> index 7b4ce1a19de0..ad39d64b8108 100644
> +++ b/drivers/infiniband/hw/mlx5/cq.c
> @@ -751,6 +751,28 @@ static int alloc_cq_frag_buf(struct mlx5_ib_dev *dev,
>  	return 0;
>  }
>  
> +enum {
> +	MLX5_CQE_RES_FORMAT_HASH = 0,
> +	MLX5_CQE_RES_FORMAT_CSUM = 1,
> +	MLX5_CQE_RES_FORMAT_CSUM_STRIDX = 3,
> +};

What is this??

> +static int mini_cqe_res_format_to_hw(struct mlx5_ib_dev *dev, u8 format)
> +{
> +	switch (format) {
> +	case MLX5_IB_CQE_RES_FORMAT_HASH:
> +		return MLX5_CQE_RES_FORMAT_HASH;

Used here..

> +		mini_cqe_format =
> +			mini_cqe_res_format_to_hw(dev,
> +						  ucmd.cqe_comp_res_format);

And format comes from a ucmd, so that enum is upai.

Put it in the right place and put the right comment beside
struct mlx5_ib_create_cq's cqe_comp_res_format..

And what is wrong with the user space patches? Where is the update to
enum mlx5dv_cqe_comp_res_format ? And why is this wrong?

struct mlx5dv_cq_init_attr {
        uint64_t comp_mask; /* Use enum mlx5dv_cq_init_attr_mask */
        uint8_t cqe_comp_res_format; /* Use enum mlx5dv_cqe_comp_res_format */
                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^

No, it isn't, and there isn't even an enum for it. Are you sure this is
designed right? Looks pretty wrong to me.

Fix it all please, and you need to arrange things to share the uapi
header with dv just like verbs is doing.

No more of this lax attitude toward uapi!

Jason

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH rdma-next 3/3] IB/mlx5: Introduce a new mini-CQE format
  2018-05-28 16:11   ` Jason Gunthorpe
@ 2018-05-28 16:52     ` Yishai Hadas
  2018-05-28 17:00       ` Jason Gunthorpe
  0 siblings, 1 reply; 10+ messages in thread
From: Yishai Hadas @ 2018-05-28 16:52 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: Leon Romanovsky, Doug Ledford, Leon Romanovsky,
	RDMA mailing list, Guy Levi, Yishai Hadas, Yonatan Cohen,
	Saeed Mahameed, linux-netdev

On 5/28/2018 7:11 PM, Jason Gunthorpe wrote:
> On Sun, May 27, 2018 at 01:42:34PM +0300, Leon Romanovsky wrote:
>> From: Yonatan Cohen <yonatanc@mellanox.com>
>>
>> The new mini-CQE format includes the stride index, byte count and
>> packet checksum.
>> Stride index is needed for striding WQ feature.
>> This patch exposes this capability and enables its setting
>> via mlx5 UHW data as part of query device and cq creation.
>>
>> Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
>> Reviewed-by: Guy Levi <guyle@mellanox.com>
>> Signed-off-by: Yonatan Cohen <yonatanc@mellanox.com>
>> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
>>   drivers/infiniband/hw/mlx5/cq.c   | 42 +++++++++++++++++++++++++++++----------
>>   drivers/infiniband/hw/mlx5/main.c |  4 ++++
>>   include/uapi/rdma/mlx5-abi.h      |  2 +-
>>   3 files changed, 37 insertions(+), 11 deletions(-)
>>
>> diff --git a/drivers/infiniband/hw/mlx5/cq.c b/drivers/infiniband/hw/mlx5/cq.c
>> index 7b4ce1a19de0..ad39d64b8108 100644
>> +++ b/drivers/infiniband/hw/mlx5/cq.c
>> @@ -751,6 +751,28 @@ static int alloc_cq_frag_buf(struct mlx5_ib_dev *dev,
>>   	return 0;
>>   }
>>   
>> +enum {
>> +	MLX5_CQE_RES_FORMAT_HASH = 0,
>> +	MLX5_CQE_RES_FORMAT_CSUM = 1,
>> +	MLX5_CQE_RES_FORMAT_CSUM_STRIDX = 3,
>> +};
> 
> What is this??

Those are mlx5 device values not uapi.

>> +static int mini_cqe_res_format_to_hw(struct mlx5_ib_dev *dev, u8 format)
>> +{
>> +	switch (format) {
>> +	case MLX5_IB_CQE_RES_FORMAT_HASH:
>> +		return MLX5_CQE_RES_FORMAT_HASH;
> 
> Used here..

This is some conversion between the uapi to the device values.

>> +		mini_cqe_format =
>> +			mini_cqe_res_format_to_hw(dev,
>> +						  ucmd.cqe_comp_res_format);
> 
> And format comes from a ucmd, so that enum is upai.

Correct, see mlx5-abi.h as part of this patch.

> Put it in the right place and put the right comment beside
> struct mlx5_ib_create_cq's cqe_comp_res_format..
> 
> And what is wrong with the user space patches? Where is the update to
> enum mlx5dv_cqe_comp_res_format ? And why is this wrong?
> 

See the first patch from below PR [1], it brings the new enum value to 
the user area as part of kernel-headers/rdma/mlx5-abi.h.

[1] https://github.com/linux-rdma/rdma-core/pull/337

> struct mlx5dv_cq_init_attr {
>          uint64_t comp_mask; /* Use enum mlx5dv_cq_init_attr_mask */
>          uint8_t cqe_comp_res_format; /* Use enum mlx5dv_cqe_comp_res_format */
>                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^
> 

The user space uses the DV prefix (e.g. 
MLX5DV_CQE_RES_FORMAT_CSUM_STRIDX), no change from previous flags around 
enum mlx5dv_cqe_comp_res_format.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH rdma-next 3/3] IB/mlx5: Introduce a new mini-CQE format
  2018-05-28 16:52     ` Yishai Hadas
@ 2018-05-28 17:00       ` Jason Gunthorpe
  0 siblings, 0 replies; 10+ messages in thread
From: Jason Gunthorpe @ 2018-05-28 17:00 UTC (permalink / raw)
  To: Yishai Hadas
  Cc: Leon Romanovsky, Doug Ledford, Leon Romanovsky,
	RDMA mailing list, Guy Levi, Yishai Hadas, Yonatan Cohen,
	Saeed Mahameed, linux-netdev

On Mon, May 28, 2018 at 07:52:03PM +0300, Yishai Hadas wrote:
> On 5/28/2018 7:11 PM, Jason Gunthorpe wrote:
> >On Sun, May 27, 2018 at 01:42:34PM +0300, Leon Romanovsky wrote:
> >>From: Yonatan Cohen <yonatanc@mellanox.com>
> >>
> >>The new mini-CQE format includes the stride index, byte count and
> >>packet checksum.
> >>Stride index is needed for striding WQ feature.
> >>This patch exposes this capability and enables its setting
> >>via mlx5 UHW data as part of query device and cq creation.
> >>
> >>Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
> >>Reviewed-by: Guy Levi <guyle@mellanox.com>
> >>Signed-off-by: Yonatan Cohen <yonatanc@mellanox.com>
> >>Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> >>  drivers/infiniband/hw/mlx5/cq.c   | 42 +++++++++++++++++++++++++++++----------
> >>  drivers/infiniband/hw/mlx5/main.c |  4 ++++
> >>  include/uapi/rdma/mlx5-abi.h      |  2 +-
> >>  3 files changed, 37 insertions(+), 11 deletions(-)
> >>
> >>diff --git a/drivers/infiniband/hw/mlx5/cq.c b/drivers/infiniband/hw/mlx5/cq.c
> >>index 7b4ce1a19de0..ad39d64b8108 100644
> >>+++ b/drivers/infiniband/hw/mlx5/cq.c
> >>@@ -751,6 +751,28 @@ static int alloc_cq_frag_buf(struct mlx5_ib_dev *dev,
> >>  	return 0;
> >>  }
> >>+enum {
> >>+	MLX5_CQE_RES_FORMAT_HASH = 0,
> >>+	MLX5_CQE_RES_FORMAT_CSUM = 1,
> >>+	MLX5_CQE_RES_FORMAT_CSUM_STRIDX = 3,
> >>+};
> >
> >What is this??
> 
> Those are mlx5 device values not uapi.
> 
> >>+static int mini_cqe_res_format_to_hw(struct mlx5_ib_dev *dev, u8 format)
> >>+{
> >>+	switch (format) {
> >>+	case MLX5_IB_CQE_RES_FORMAT_HASH:
> >>+		return MLX5_CQE_RES_FORMAT_HASH;
> >
> >Used here..
> 
> This is some conversion between the uapi to the device values.
> 
> >>+		mini_cqe_format =
> >>+			mini_cqe_res_format_to_hw(dev,
> >>+						  ucmd.cqe_comp_res_format);
> >
> >And format comes from a ucmd, so that enum is upai.
> 
> Correct, see mlx5-abi.h as part of this patch.
> 
> >Put it in the right place and put the right comment beside
> >struct mlx5_ib_create_cq's cqe_comp_res_format..
> >
> >And what is wrong with the user space patches? Where is the update to
> >enum mlx5dv_cqe_comp_res_format ? And why is this wrong?
> >
> 
> See the first patch from below PR [1], it brings the new enum value to the
> user area as part of kernel-headers/rdma/mlx5-abi.h.
> 
> [1] https://github.com/linux-rdma/rdma-core/pull/337
> 
> >struct mlx5dv_cq_init_attr {
> >         uint64_t comp_mask; /* Use enum mlx5dv_cq_init_attr_mask */
> >         uint8_t cqe_comp_res_format; /* Use enum mlx5dv_cqe_comp_res_format */
> >                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^
> >
> 
> The user space uses the DV prefix (e.g. MLX5DV_CQE_RES_FORMAT_CSUM_STRIDX),
> no change from previous flags around enum mlx5dv_cqe_comp_res_format.

This still needs eventual cleaning up in the verbs_abi.h way.

But OK, this is not what I thought.

Jason

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH rdma-next 0/3] Introduce new mlx5 CQE format
  2018-05-27 10:42 [PATCH rdma-next 0/3] Introduce new mlx5 CQE format Leon Romanovsky
                   ` (2 preceding siblings ...)
  2018-05-27 10:42 ` [PATCH rdma-next 3/3] IB/mlx5: Introduce a new mini-CQE format Leon Romanovsky
@ 2018-05-29 20:05 ` Jason Gunthorpe
  3 siblings, 0 replies; 10+ messages in thread
From: Jason Gunthorpe @ 2018-05-29 20:05 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Doug Ledford, Leon Romanovsky, RDMA mailing list, Guy Levi,
	Yishai Hadas, Yonatan Cohen, Saeed Mahameed, linux-netdev

On Sun, May 27, 2018 at 01:42:31PM +0300, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro@mellanox.com>
> 
> Introduce new internal to mlx5 CQE format - mini-CQE. It is a CQE in
> compressed form that holds data needed to extra a single full CQE.
> 
> It stride index, byte count and packet checksum.
> 
> Thanks
> 
> Yonatan Cohen (3):
>   net/mlx5: Exposing a new mini-CQE format
>   IB/mlx5: Refactor CQE compression response
>   IB/mlx5: Introduce a new mini-CQE format

Applied to for-next.

Generally taking new uapi patches that are first the list should have
a few weeks of comment period, but since this is just adding a new bit
to an existing driver private api it seems OK to go this merge window.

Thanks,
Jason

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH mlx5-next 1/3] net/mlx5: Exposing a new mini-CQE format
  2018-05-27 10:42 ` [PATCH mlx5-next 1/3] net/mlx5: Exposing a new mini-CQE format Leon Romanovsky
@ 2018-05-29 21:01   ` Saeed Mahameed
  2018-05-29 21:35     ` Jason Gunthorpe
  0 siblings, 1 reply; 10+ messages in thread
From: Saeed Mahameed @ 2018-05-29 21:01 UTC (permalink / raw)
  To: Jason Gunthorpe, leon, dledford
  Cc: Yonatan Cohen, netdev, Guy Levi(SW),
	Leon Romanovsky, linux-rdma, Yishai Hadas

On Sun, 2018-05-27 at 13:42 +0300, Leon Romanovsky wrote:
> From: Yonatan Cohen <yonatanc@mellanox.com>
> 
> The new mini-CQE format includes byte-count, checksum
> and stride index.
> 
> Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
> Reviewed-by: Guy Levi <guyle@mellanox.com>
> Signed-off-by: Yonatan Cohen <yonatanc@mellanox.com>
> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>


Applied to mlx5-next.

git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux.git  mlx5-
next

commit-id: ab741b2eed3e456cebd2240d4c9c6be003d5ae72

Thanks!


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH mlx5-next 1/3] net/mlx5: Exposing a new mini-CQE format
  2018-05-29 21:01   ` Saeed Mahameed
@ 2018-05-29 21:35     ` Jason Gunthorpe
  0 siblings, 0 replies; 10+ messages in thread
From: Jason Gunthorpe @ 2018-05-29 21:35 UTC (permalink / raw)
  To: Saeed Mahameed
  Cc: leon, dledford, Yonatan Cohen, netdev, Guy Levi(SW),
	Leon Romanovsky, linux-rdma, Yishai Hadas

On Tue, May 29, 2018 at 03:01:27PM -0600, Saeed Mahameed wrote:
> On Sun, 2018-05-27 at 13:42 +0300, Leon Romanovsky wrote:
> > From: Yonatan Cohen <yonatanc@mellanox.com>
> > 
> > The new mini-CQE format includes byte-count, checksum
> > and stride index.
> > 
> > Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
> > Reviewed-by: Guy Levi <guyle@mellanox.com>
> > Signed-off-by: Yonatan Cohen <yonatanc@mellanox.com>
> > Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> 
> 
> Applied to mlx5-next.
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux.git  mlx5-
> next
> 
> commit-id: ab741b2eed3e456cebd2240d4c9c6be003d5ae72

Thanks, everything is now merged as:

https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/commit/?h=wip/jgg-for-next&id=f3ca0ab114e0de3bbad4c4a537d32fb57aa42f81

Jason

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-05-29 21:35 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-27 10:42 [PATCH rdma-next 0/3] Introduce new mlx5 CQE format Leon Romanovsky
2018-05-27 10:42 ` [PATCH mlx5-next 1/3] net/mlx5: Exposing a new mini-CQE format Leon Romanovsky
2018-05-29 21:01   ` Saeed Mahameed
2018-05-29 21:35     ` Jason Gunthorpe
2018-05-27 10:42 ` [PATCH rdma-next 2/3] IB/mlx5: Refactor CQE compression response Leon Romanovsky
2018-05-27 10:42 ` [PATCH rdma-next 3/3] IB/mlx5: Introduce a new mini-CQE format Leon Romanovsky
2018-05-28 16:11   ` Jason Gunthorpe
2018-05-28 16:52     ` Yishai Hadas
2018-05-28 17:00       ` Jason Gunthorpe
2018-05-29 20:05 ` [PATCH rdma-next 0/3] Introduce new mlx5 CQE format Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).