diff options
| author | Chris Moore <Chris.Moore@Emulex.Com> | 2014-11-04 11:28:29 -0500 |
|---|---|---|
| committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2014-11-20 01:28:42 -0500 |
| commit | b1a5ad006b34ded9dc7ec64988deba1b3ecad367 (patch) | |
| tree | 04564dc1534581d24bc8152b950572699fd1fc5c | |
| parent | b6932ee35f1c1364dcea0e691b2feb912a6777e5 (diff) | |
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 <chris.moore@emulex.com>
Reviewied-by: Sagi Grimberg <sagig@mellanox.com>
Cc: <stable@vger.kernel.org> # 3.10+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
| -rw-r--r-- | drivers/infiniband/ulp/isert/ib_isert.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index a6c7b395c61d..10641b7816f4 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c | |||
| @@ -228,12 +228,16 @@ isert_create_device_ib_res(struct isert_device *device) | |||
| 228 | struct isert_cq_desc *cq_desc; | 228 | struct isert_cq_desc *cq_desc; |
| 229 | struct ib_device_attr *dev_attr; | 229 | struct ib_device_attr *dev_attr; |
| 230 | int ret = 0, i, j; | 230 | int ret = 0, i, j; |
| 231 | int max_rx_cqe, max_tx_cqe; | ||
| 231 | 232 | ||
| 232 | dev_attr = &device->dev_attr; | 233 | dev_attr = &device->dev_attr; |
| 233 | ret = isert_query_device(ib_dev, dev_attr); | 234 | ret = isert_query_device(ib_dev, dev_attr); |
| 234 | if (ret) | 235 | if (ret) |
| 235 | return ret; | 236 | return ret; |
| 236 | 237 | ||
| 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 | |||
| 237 | /* asign function handlers */ | 241 | /* asign function handlers */ |
| 238 | if (dev_attr->device_cap_flags & IB_DEVICE_MEM_MGT_EXTENSIONS && | 242 | if (dev_attr->device_cap_flags & IB_DEVICE_MEM_MGT_EXTENSIONS && |
| 239 | dev_attr->device_cap_flags & IB_DEVICE_SIGNATURE_HANDOVER) { | 243 | dev_attr->device_cap_flags & IB_DEVICE_SIGNATURE_HANDOVER) { |
| @@ -275,7 +279,7 @@ isert_create_device_ib_res(struct isert_device *device) | |||
| 275 | isert_cq_rx_callback, | 279 | isert_cq_rx_callback, |
| 276 | isert_cq_event_callback, | 280 | isert_cq_event_callback, |
| 277 | (void *)&cq_desc[i], | 281 | (void *)&cq_desc[i], |
| 278 | ISER_MAX_RX_CQ_LEN, i); | 282 | max_rx_cqe, i); |
| 279 | if (IS_ERR(device->dev_rx_cq[i])) { | 283 | if (IS_ERR(device->dev_rx_cq[i])) { |
| 280 | ret = PTR_ERR(device->dev_rx_cq[i]); | 284 | ret = PTR_ERR(device->dev_rx_cq[i]); |
| 281 | device->dev_rx_cq[i] = NULL; | 285 | device->dev_rx_cq[i] = NULL; |
| @@ -287,7 +291,7 @@ isert_create_device_ib_res(struct isert_device *device) | |||
| 287 | isert_cq_tx_callback, | 291 | isert_cq_tx_callback, |
| 288 | isert_cq_event_callback, | 292 | isert_cq_event_callback, |
| 289 | (void *)&cq_desc[i], | 293 | (void *)&cq_desc[i], |
| 290 | ISER_MAX_TX_CQ_LEN, i); | 294 | max_tx_cqe, i); |
| 291 | if (IS_ERR(device->dev_tx_cq[i])) { | 295 | if (IS_ERR(device->dev_tx_cq[i])) { |
| 292 | ret = PTR_ERR(device->dev_tx_cq[i]); | 296 | ret = PTR_ERR(device->dev_tx_cq[i]); |
| 293 | device->dev_tx_cq[i] = NULL; | 297 | device->dev_tx_cq[i] = NULL; |
