Skip to content

Commit f57915c

Browse files
ogerlitzNicholas Bellinger
authored and
Nicholas Bellinger
committed
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 <[email protected]> Tested-by: Chris Moore <[email protected]> Signed-off-by: Or Gerlitz <[email protected]> Cc: <[email protected]> # 3.10+ Signed-off-by: Nicholas Bellinger <[email protected]>
1 parent ab477c1 commit f57915c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/infiniband/ulp/isert/ib_isert.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,12 @@ isert_conn_setup_qp(struct isert_conn *isert_conn, struct rdma_cm_id *cma_id,
115115
attr.cap.max_recv_wr = ISERT_QP_MAX_RECV_DTOS;
116116
/*
117117
* 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.
119122
*/
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);
121124
isert_conn->max_sge = attr.cap.max_send_sge;
122125

123126
attr.cap.max_recv_sge = 1;

0 commit comments

Comments
 (0)