Skip to content

Commit b1a5ad0

Browse files
Chris MooreNicholas Bellinger
Chris Moore
authored and
Nicholas Bellinger
committed
IB/isert: Adjust CQ size to HW limits
isert has an issue of trying to create a CQ with more CQEs than are supported by the hardware, that currently results in failures during isert_device creation during first session login. This is the isert version of the patch that Minh Tran submitted for iser, and is simple a workaround required to function with existing ocrdma hardware. Signed-off-by: Chris Moore <[email protected]> Reviewied-by: Sagi Grimberg <[email protected]> Cc: <[email protected]> # 3.10+ Signed-off-by: Nicholas Bellinger <[email protected]>
1 parent b6932ee commit b1a5ad0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/infiniband/ulp/isert/ib_isert.c

+6-2
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,16 @@ isert_create_device_ib_res(struct isert_device *device)
228228
struct isert_cq_desc *cq_desc;
229229
struct ib_device_attr *dev_attr;
230230
int ret = 0, i, j;
231+
int max_rx_cqe, max_tx_cqe;
231232

232233
dev_attr = &device->dev_attr;
233234
ret = isert_query_device(ib_dev, dev_attr);
234235
if (ret)
235236
return ret;
236237

238+
max_rx_cqe = min(ISER_MAX_RX_CQ_LEN, dev_attr->max_cqe);
239+
max_tx_cqe = min(ISER_MAX_TX_CQ_LEN, dev_attr->max_cqe);
240+
237241
/* asign function handlers */
238242
if (dev_attr->device_cap_flags & IB_DEVICE_MEM_MGT_EXTENSIONS &&
239243
dev_attr->device_cap_flags & IB_DEVICE_SIGNATURE_HANDOVER) {
@@ -275,7 +279,7 @@ isert_create_device_ib_res(struct isert_device *device)
275279
isert_cq_rx_callback,
276280
isert_cq_event_callback,
277281
(void *)&cq_desc[i],
278-
ISER_MAX_RX_CQ_LEN, i);
282+
max_rx_cqe, i);
279283
if (IS_ERR(device->dev_rx_cq[i])) {
280284
ret = PTR_ERR(device->dev_rx_cq[i]);
281285
device->dev_rx_cq[i] = NULL;
@@ -287,7 +291,7 @@ isert_create_device_ib_res(struct isert_device *device)
287291
isert_cq_tx_callback,
288292
isert_cq_event_callback,
289293
(void *)&cq_desc[i],
290-
ISER_MAX_TX_CQ_LEN, i);
294+
max_tx_cqe, i);
291295
if (IS_ERR(device->dev_tx_cq[i])) {
292296
ret = PTR_ERR(device->dev_tx_cq[i]);
293297
device->dev_tx_cq[i] = NULL;

0 commit comments

Comments
 (0)