public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] IB/isert: Adjust CQ size to HW limits
@ 2014-10-31 19:50 Chris Moore
       [not found] ` <462EF229174FDB4D92ACE4656EA5610051E3C4E6-DWYeeINJQrxExQ8dmkPuX0M9+F4ksjoh@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Moore @ 2014-10-31 19:50 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org


This is the isert version of the patch that Minh Tran submitted for iser.
isert has the same issue of trying to create a CQ with more CQEs than are supported by
the hardware.

Signed-off-by: Chris Moore <chris.moore-laKkSmNT4hbQT0dZR+AlfA@public.gmane.org>

---

diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index 3effa93..f837a23 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -225,12 +225,16 @@ isert_create_device_ib_res(struct isert_device *device)
 	struct isert_cq_desc *cq_desc;
 	struct ib_device_attr *dev_attr;
 	int ret = 0, i, j;
+	int max_rx_cqe, max_tx_cqe;
 
 	dev_attr = &device->dev_attr;
 	ret = isert_query_device(ib_dev, dev_attr);
 	if (ret)
 		return ret;
 
+	max_rx_cqe = min(ISER_MAX_RX_CQ_LEN, dev_attr->max_cqe);
+	max_tx_cqe = min(ISER_MAX_TX_CQ_LEN, dev_attr->max_cqe);
+
 	/* asign function handlers */
 	if (dev_attr->device_cap_flags & IB_DEVICE_MEM_MGT_EXTENSIONS &&
 	    dev_attr->device_cap_flags & IB_DEVICE_SIGNATURE_HANDOVER) {
@@ -272,7 +276,7 @@ isert_create_device_ib_res(struct isert_device *device)
 						isert_cq_rx_callback,
 						isert_cq_event_callback,
 						(void *)&cq_desc[i],
-						ISER_MAX_RX_CQ_LEN, i);
+						max_rx_cqe, i);
 		if (IS_ERR(device->dev_rx_cq[i])) {
 			ret = PTR_ERR(device->dev_rx_cq[i]);
 			device->dev_rx_cq[i] = NULL;
@@ -284,7 +288,7 @@ isert_create_device_ib_res(struct isert_device *device)
 						isert_cq_tx_callback,
 						isert_cq_event_callback,
 						(void *)&cq_desc[i],
-						ISER_MAX_TX_CQ_LEN, i);
+						max_tx_cqe, i);
 		if (IS_ERR(device->dev_tx_cq[i])) {
 			ret = PTR_ERR(device->dev_tx_cq[i]);
 			device->dev_tx_cq[i] = NULL;
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] IB/isert: Adjust CQ size to HW limits
       [not found] ` <462EF229174FDB4D92ACE4656EA5610051E3C4E6-DWYeeINJQrxExQ8dmkPuX0M9+F4ksjoh@public.gmane.org>
@ 2014-11-02 12:37   ` Sagi Grimberg
       [not found]     ` <54562583.9080700-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Sagi Grimberg @ 2014-11-02 12:37 UTC (permalink / raw)
  To: Chris Moore, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
  Cc: Nicholas A. Bellinger

On 10/31/2014 9:50 PM, Chris Moore wrote:
>
> This is the isert version of the patch that Minh Tran submitted for iser.
> isert has the same issue of trying to create a CQ with more CQEs than are supported by
> the hardware.
>

ib_isert is maintained in target-devel. Can you resend it there?

Thanks!

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

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

* RE: [PATCH] IB/isert: Adjust CQ size to HW limits
       [not found]     ` <54562583.9080700-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
@ 2014-11-03 16:22       ` Chris Moore
  0 siblings, 0 replies; 3+ messages in thread
From: Chris Moore @ 2014-11-03 16:22 UTC (permalink / raw)
  To: Sagi Grimberg, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
  Cc: Nicholas A. Bellinger



> -----Original Message-----
> From: Sagi Grimberg [mailto:sagig-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org]
> Sent: Sunday, November 02, 2014 4:37 AM
> To: Chris Moore; linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Cc: Nicholas A. Bellinger
> Subject: Re: [PATCH] IB/isert: Adjust CQ size to HW limits
> 
> On 10/31/2014 9:50 PM, Chris Moore wrote:
> >
> > This is the isert version of the patch that Minh Tran submitted for iser.
> > isert has the same issue of trying to create a CQ with more CQEs than
> > are supported by the hardware.
> >
> 
> ib_isert is maintained in target-devel. Can you resend it there?
> 
> Thanks!
> 
> Sagi.

Yep, no problem, I'll do that.

There was another issue in ib_isert.c that Nic  proposed a fix for in an email back on 10/22.
This was the issue with attr.cap.max_send_sge being set to (device->dev_attr.max_sge - 2)
instead of just device->dev_attr.max_sge.

Should I post that issue to target-devel as well?

Thanks,

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

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

end of thread, other threads:[~2014-11-03 16:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-31 19:50 [PATCH] IB/isert: Adjust CQ size to HW limits Chris Moore
     [not found] ` <462EF229174FDB4D92ACE4656EA5610051E3C4E6-DWYeeINJQrxExQ8dmkPuX0M9+F4ksjoh@public.gmane.org>
2014-11-02 12:37   ` Sagi Grimberg
     [not found]     ` <54562583.9080700-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2014-11-03 16:22       ` Chris Moore

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox