All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-rc] RDMA/erdma: Correct the max_qp and max_cq capacities of the device
@ 2022-08-10  1:43 Cheng Xu
  2022-08-10  1:43 ` [PATCH for-rc] RDMA/erdma: Using the key in FMR WR instead of MR structure Cheng Xu
  2022-08-16 13:32 ` [PATCH for-rc] RDMA/erdma: Correct the max_qp and max_cq capacities of the device Leon Romanovsky
  0 siblings, 2 replies; 4+ messages in thread
From: Cheng Xu @ 2022-08-10  1:43 UTC (permalink / raw)
  To: jgg, leon; +Cc: linux-rdma, KaiShen

QP0 in HW is used for CMDQ, and the rest is for RDMA QPs. So the actual
max_qp capacity reported to core should be max_qp (reported by HW) - 1.
So does max_cq.

Fixes: 155055771704 ("RDMA/erdma: Add verbs implementation")
Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com>
---
 drivers/infiniband/hw/erdma/erdma_verbs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/erdma/erdma_verbs.c b/drivers/infiniband/hw/erdma/erdma_verbs.c
index a7a3d42e2016..699bd3f59cd3 100644
--- a/drivers/infiniband/hw/erdma/erdma_verbs.c
+++ b/drivers/infiniband/hw/erdma/erdma_verbs.c
@@ -280,7 +280,7 @@ int erdma_query_device(struct ib_device *ibdev, struct ib_device_attr *attr,
 	attr->vendor_id = PCI_VENDOR_ID_ALIBABA;
 	attr->vendor_part_id = dev->pdev->device;
 	attr->hw_ver = dev->pdev->revision;
-	attr->max_qp = dev->attrs.max_qp;
+	attr->max_qp = dev->attrs.max_qp - 1;
 	attr->max_qp_wr = min(dev->attrs.max_send_wr, dev->attrs.max_recv_wr);
 	attr->max_qp_rd_atom = dev->attrs.max_ord;
 	attr->max_qp_init_rd_atom = dev->attrs.max_ird;
@@ -291,7 +291,7 @@ int erdma_query_device(struct ib_device *ibdev, struct ib_device_attr *attr,
 	attr->max_send_sge = dev->attrs.max_send_sge;
 	attr->max_recv_sge = dev->attrs.max_recv_sge;
 	attr->max_sge_rd = dev->attrs.max_sge_rd;
-	attr->max_cq = dev->attrs.max_cq;
+	attr->max_cq = dev->attrs.max_cq - 1;
 	attr->max_cqe = dev->attrs.max_cqe;
 	attr->max_mr = dev->attrs.max_mr;
 	attr->max_pd = dev->attrs.max_pd;
-- 
2.27.0


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

* [PATCH for-rc] RDMA/erdma: Using the key in FMR WR instead of MR structure
  2022-08-10  1:43 [PATCH for-rc] RDMA/erdma: Correct the max_qp and max_cq capacities of the device Cheng Xu
@ 2022-08-10  1:43 ` Cheng Xu
  2022-08-16 13:32 ` [PATCH for-rc] RDMA/erdma: Correct the max_qp and max_cq capacities of the device Leon Romanovsky
  1 sibling, 0 replies; 4+ messages in thread
From: Cheng Xu @ 2022-08-10  1:43 UTC (permalink / raw)
  To: jgg, leon; +Cc: linux-rdma, KaiShen

RDMA driver should get the MR key from FMR WR, not the MR structure passed
in.

Fixes: 155055771704 ("RDMA/erdma: Add verbs implementation")
Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com>
---
 drivers/infiniband/hw/erdma/erdma_qp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/erdma/erdma_qp.c b/drivers/infiniband/hw/erdma/erdma_qp.c
index 72f08171a28a..bc3ec22a62c5 100644
--- a/drivers/infiniband/hw/erdma/erdma_qp.c
+++ b/drivers/infiniband/hw/erdma/erdma_qp.c
@@ -407,7 +407,7 @@ static int erdma_push_one_sqe(struct erdma_qp *qp, u16 *pi,
 			     to_erdma_access_flags(reg_wr(send_wr)->access);
 		regmr_sge->addr = cpu_to_le64(mr->ibmr.iova);
 		regmr_sge->length = cpu_to_le32(mr->ibmr.length);
-		regmr_sge->stag = cpu_to_le32(mr->ibmr.lkey);
+		regmr_sge->stag = cpu_to_le32(reg_wr(send_wr)->key);
 		attrs = FIELD_PREP(ERDMA_SQE_MR_MODE_MASK, 0) |
 			FIELD_PREP(ERDMA_SQE_MR_ACCESS_MASK, mr->access) |
 			FIELD_PREP(ERDMA_SQE_MR_MTT_CNT_MASK,
-- 
2.27.0


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

* Re: [PATCH for-rc] RDMA/erdma: Correct the max_qp and max_cq capacities of the device
  2022-08-10  1:43 [PATCH for-rc] RDMA/erdma: Correct the max_qp and max_cq capacities of the device Cheng Xu
  2022-08-10  1:43 ` [PATCH for-rc] RDMA/erdma: Using the key in FMR WR instead of MR structure Cheng Xu
@ 2022-08-16 13:32 ` Leon Romanovsky
  2022-08-17  1:46   ` Cheng Xu
  1 sibling, 1 reply; 4+ messages in thread
From: Leon Romanovsky @ 2022-08-16 13:32 UTC (permalink / raw)
  To: Cheng Xu; +Cc: jgg, linux-rdma, KaiShen

On Wed, Aug 10, 2022 at 09:43:19AM +0800, Cheng Xu wrote:
> QP0 in HW is used for CMDQ, and the rest is for RDMA QPs. So the actual
> max_qp capacity reported to core should be max_qp (reported by HW) - 1.
> So does max_cq.
> 
> Fixes: 155055771704 ("RDMA/erdma: Add verbs implementation")
> Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com>
> ---
>  drivers/infiniband/hw/erdma/erdma_verbs.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 

Thanks, applied both patches to -rc.

As a note, please group the patches properly and not as a reply.
Or send them separately, or use cover letter.

Thanks

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

* Re: [PATCH for-rc] RDMA/erdma: Correct the max_qp and max_cq capacities of the device
  2022-08-16 13:32 ` [PATCH for-rc] RDMA/erdma: Correct the max_qp and max_cq capacities of the device Leon Romanovsky
@ 2022-08-17  1:46   ` Cheng Xu
  0 siblings, 0 replies; 4+ messages in thread
From: Cheng Xu @ 2022-08-17  1:46 UTC (permalink / raw)
  To: Leon Romanovsky; +Cc: jgg, linux-rdma, KaiShen



On 8/16/22 9:32 PM, Leon Romanovsky wrote:
> On Wed, Aug 10, 2022 at 09:43:19AM +0800, Cheng Xu wrote:
>> QP0 in HW is used for CMDQ, and the rest is for RDMA QPs. So the actual
>> max_qp capacity reported to core should be max_qp (reported by HW) - 1.
>> So does max_cq.
>>
>> Fixes: 155055771704 ("RDMA/erdma: Add verbs implementation")
>> Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com>
>> ---
>>  drivers/infiniband/hw/erdma/erdma_verbs.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
> 
> Thanks, applied both patches to -rc.
> 
> As a note, please group the patches properly and not as a reply.
> Or send them separately, or use cover letter.

It's my fault. I shouldn't send the two patches together in one git send-email
command.

Thanks,
Cheng Xu

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

end of thread, other threads:[~2022-08-17  1:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-10  1:43 [PATCH for-rc] RDMA/erdma: Correct the max_qp and max_cq capacities of the device Cheng Xu
2022-08-10  1:43 ` [PATCH for-rc] RDMA/erdma: Using the key in FMR WR instead of MR structure Cheng Xu
2022-08-16 13:32 ` [PATCH for-rc] RDMA/erdma: Correct the max_qp and max_cq capacities of the device Leon Romanovsky
2022-08-17  1:46   ` Cheng Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.