aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/isert/ib_isert.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/ulp/isert/ib_isert.c')
-rw-r--r--drivers/infiniband/ulp/isert/ib_isert.c39
1 files changed, 4 insertions, 35 deletions
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index 60b30d338a81..411e4464ca23 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -63,7 +63,6 @@ isert_rdma_accept(struct isert_conn *isert_conn);
63struct rdma_cm_id *isert_setup_id(struct isert_np *isert_np); 63struct rdma_cm_id *isert_setup_id(struct isert_np *isert_np);
64 64
65static void isert_release_work(struct work_struct *work); 65static void isert_release_work(struct work_struct *work);
66static void isert_wait4flush(struct isert_conn *isert_conn);
67static void isert_recv_done(struct ib_cq *cq, struct ib_wc *wc); 66static void isert_recv_done(struct ib_cq *cq, struct ib_wc *wc);
68static void isert_send_done(struct ib_cq *cq, struct ib_wc *wc); 67static void isert_send_done(struct ib_cq *cq, struct ib_wc *wc);
69static void isert_login_recv_done(struct ib_cq *cq, struct ib_wc *wc); 68static void isert_login_recv_done(struct ib_cq *cq, struct ib_wc *wc);
@@ -141,7 +140,7 @@ isert_create_qp(struct isert_conn *isert_conn,
141 attr.qp_context = isert_conn; 140 attr.qp_context = isert_conn;
142 attr.send_cq = comp->cq; 141 attr.send_cq = comp->cq;
143 attr.recv_cq = comp->cq; 142 attr.recv_cq = comp->cq;
144 attr.cap.max_send_wr = ISERT_QP_MAX_REQ_DTOS; 143 attr.cap.max_send_wr = ISERT_QP_MAX_REQ_DTOS + 1;
145 attr.cap.max_recv_wr = ISERT_QP_MAX_RECV_DTOS + 1; 144 attr.cap.max_recv_wr = ISERT_QP_MAX_RECV_DTOS + 1;
146 attr.cap.max_send_sge = device->ib_device->attrs.max_sge; 145 attr.cap.max_send_sge = device->ib_device->attrs.max_sge;
147 isert_conn->max_sge = min(device->ib_device->attrs.max_sge, 146 isert_conn->max_sge = min(device->ib_device->attrs.max_sge,
@@ -887,7 +886,7 @@ isert_disconnected_handler(struct rdma_cm_id *cma_id,
887 break; 886 break;
888 case ISER_CONN_UP: 887 case ISER_CONN_UP:
889 isert_conn_terminate(isert_conn); 888 isert_conn_terminate(isert_conn);
890 isert_wait4flush(isert_conn); 889 ib_drain_qp(isert_conn->qp);
891 isert_handle_unbound_conn(isert_conn); 890 isert_handle_unbound_conn(isert_conn);
892 break; 891 break;
893 case ISER_CONN_BOUND: 892 case ISER_CONN_BOUND:
@@ -3213,36 +3212,6 @@ isert_wait4cmds(struct iscsi_conn *conn)
3213 } 3212 }
3214} 3213}
3215 3214
3216static void
3217isert_beacon_done(struct ib_cq *cq, struct ib_wc *wc)
3218{
3219 struct isert_conn *isert_conn = wc->qp->qp_context;
3220
3221 isert_print_wc(wc, "beacon");
3222
3223 isert_info("conn %p completing wait_comp_err\n", isert_conn);
3224 complete(&isert_conn->wait_comp_err);
3225}
3226
3227static void
3228isert_wait4flush(struct isert_conn *isert_conn)
3229{
3230 struct ib_recv_wr *bad_wr;
3231 static struct ib_cqe cqe = { .done = isert_beacon_done };
3232
3233 isert_info("conn %p\n", isert_conn);
3234
3235 init_completion(&isert_conn->wait_comp_err);
3236 isert_conn->beacon.wr_cqe = &cqe;
3237 /* post an indication that all flush errors were consumed */
3238 if (ib_post_recv(isert_conn->qp, &isert_conn->beacon, &bad_wr)) {
3239 isert_err("conn %p failed to post beacon", isert_conn);
3240 return;
3241 }
3242
3243 wait_for_completion(&isert_conn->wait_comp_err);
3244}
3245
3246/** 3215/**
3247 * isert_put_unsol_pending_cmds() - Drop commands waiting for 3216 * isert_put_unsol_pending_cmds() - Drop commands waiting for
3248 * unsolicitate dataout 3217 * unsolicitate dataout
@@ -3288,7 +3257,7 @@ static void isert_wait_conn(struct iscsi_conn *conn)
3288 isert_conn_terminate(isert_conn); 3257 isert_conn_terminate(isert_conn);
3289 mutex_unlock(&isert_conn->mutex); 3258 mutex_unlock(&isert_conn->mutex);
3290 3259
3291 isert_wait4flush(isert_conn); 3260 ib_drain_qp(isert_conn->qp);
3292 isert_put_unsol_pending_cmds(conn); 3261 isert_put_unsol_pending_cmds(conn);
3293 isert_wait4cmds(conn); 3262 isert_wait4cmds(conn);
3294 isert_wait4logout(isert_conn); 3263 isert_wait4logout(isert_conn);
@@ -3300,7 +3269,7 @@ static void isert_free_conn(struct iscsi_conn *conn)
3300{ 3269{
3301 struct isert_conn *isert_conn = conn->context; 3270 struct isert_conn *isert_conn = conn->context;
3302 3271
3303 isert_wait4flush(isert_conn); 3272 ib_drain_qp(isert_conn->qp);
3304 isert_put_conn(isert_conn); 3273 isert_put_conn(isert_conn);
3305} 3274}
3306 3275