diff options
author | Or Gerlitz <ogerlitz@mellanox.com> | 2014-10-22 17:55:49 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2014-11-03 01:04:29 -0500 |
commit | f57915cfa5b2b14c1cffa2e83c034f55e3f0e70d (patch) | |
tree | 905bfe537db8e8621c8d5dfcf86f6d36400889ab /drivers/infiniband | |
parent | ab477c1ff5e0a744c072404bf7db51bfe1f05b6e (diff) |
ib_isert: Add max_send_sge=2 minimum for control PDU responses
This patch adds a max_send_sge=2 minimum in isert_conn_setup_qp()
to ensure outgoing control PDU responses with tx_desc->num_sge=2
are able to function correctly.
This addresses a bug with RDMA hardware using dev_attr.max_sge=3,
that in the original code with the ConnectX-2 work-around would
result in isert_conn->max_sge=1 being negotiated.
Originally reported by Chris with ocrdma driver.
Reported-by: Chris Moore <Chris.Moore@emulex.com>
Tested-by: Chris Moore <Chris.Moore@emulex.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Cc: <stable@vger.kernel.org> # 3.10+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/ulp/isert/ib_isert.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index 3effa931fce2..ef5b22b3ea83 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c | |||
@@ -115,9 +115,12 @@ isert_conn_setup_qp(struct isert_conn *isert_conn, struct rdma_cm_id *cma_id, | |||
115 | attr.cap.max_recv_wr = ISERT_QP_MAX_RECV_DTOS; | 115 | attr.cap.max_recv_wr = ISERT_QP_MAX_RECV_DTOS; |
116 | /* | 116 | /* |
117 | * FIXME: Use devattr.max_sge - 2 for max_send_sge as | 117 | * FIXME: Use devattr.max_sge - 2 for max_send_sge as |
118 | * work-around for RDMA_READ.. | 118 | * work-around for RDMA_READs with ConnectX-2. |
119 | * | ||
120 | * Also, still make sure to have at least two SGEs for | ||
121 | * outgoing control PDU responses. | ||
119 | */ | 122 | */ |
120 | attr.cap.max_send_sge = device->dev_attr.max_sge - 2; | 123 | attr.cap.max_send_sge = max(2, device->dev_attr.max_sge - 2); |
121 | isert_conn->max_sge = attr.cap.max_send_sge; | 124 | isert_conn->max_sge = attr.cap.max_send_sge; |
122 | 125 | ||
123 | attr.cap.max_recv_sge = 1; | 126 | attr.cap.max_recv_sge = 1; |