|
@@ -1315,6 +1315,8 @@ static struct ib_qp *nes_create_qp(struct ib_pd *ibpd,
|
|
nes_debug(NES_DBG_QP, "Invalid QP type: %d\n", init_attr->qp_type);
|
|
nes_debug(NES_DBG_QP, "Invalid QP type: %d\n", init_attr->qp_type);
|
|
return ERR_PTR(-EINVAL);
|
|
return ERR_PTR(-EINVAL);
|
|
}
|
|
}
|
|
|
|
+ init_completion(&nesqp->sq_drained);
|
|
|
|
+ init_completion(&nesqp->rq_drained);
|
|
|
|
|
|
nesqp->sig_all = (init_attr->sq_sig_type == IB_SIGNAL_ALL_WR);
|
|
nesqp->sig_all = (init_attr->sq_sig_type == IB_SIGNAL_ALL_WR);
|
|
init_timer(&nesqp->terminate_timer);
|
|
init_timer(&nesqp->terminate_timer);
|
|
@@ -3452,6 +3454,29 @@ out:
|
|
return err;
|
|
return err;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * nes_drain_sq - drain sq
|
|
|
|
+ * @ibqp: pointer to ibqp
|
|
|
|
+ */
|
|
|
|
+static void nes_drain_sq(struct ib_qp *ibqp)
|
|
|
|
+{
|
|
|
|
+ struct nes_qp *nesqp = to_nesqp(ibqp);
|
|
|
|
+
|
|
|
|
+ if (nesqp->hwqp.sq_tail != nesqp->hwqp.sq_head)
|
|
|
|
+ wait_for_completion(&nesqp->sq_drained);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * nes_drain_rq - drain rq
|
|
|
|
+ * @ibqp: pointer to ibqp
|
|
|
|
+ */
|
|
|
|
+static void nes_drain_rq(struct ib_qp *ibqp)
|
|
|
|
+{
|
|
|
|
+ struct nes_qp *nesqp = to_nesqp(ibqp);
|
|
|
|
+
|
|
|
|
+ if (nesqp->hwqp.rq_tail != nesqp->hwqp.rq_head)
|
|
|
|
+ wait_for_completion(&nesqp->rq_drained);
|
|
|
|
+}
|
|
|
|
|
|
/**
|
|
/**
|
|
* nes_poll_cq
|
|
* nes_poll_cq
|
|
@@ -3582,6 +3607,13 @@ static int nes_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *entry)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (nesqp->iwarp_state > NES_CQP_QP_IWARP_STATE_RTS) {
|
|
|
|
+ if (nesqp->hwqp.sq_tail == nesqp->hwqp.sq_head)
|
|
|
|
+ complete(&nesqp->sq_drained);
|
|
|
|
+ if (nesqp->hwqp.rq_tail == nesqp->hwqp.rq_head)
|
|
|
|
+ complete(&nesqp->rq_drained);
|
|
|
|
+ }
|
|
|
|
+
|
|
entry->wr_id = wrid;
|
|
entry->wr_id = wrid;
|
|
entry++;
|
|
entry++;
|
|
cqe_count++;
|
|
cqe_count++;
|
|
@@ -3754,6 +3786,8 @@ struct nes_ib_device *nes_init_ofa_device(struct net_device *netdev)
|
|
nesibdev->ibdev.req_notify_cq = nes_req_notify_cq;
|
|
nesibdev->ibdev.req_notify_cq = nes_req_notify_cq;
|
|
nesibdev->ibdev.post_send = nes_post_send;
|
|
nesibdev->ibdev.post_send = nes_post_send;
|
|
nesibdev->ibdev.post_recv = nes_post_recv;
|
|
nesibdev->ibdev.post_recv = nes_post_recv;
|
|
|
|
+ nesibdev->ibdev.drain_sq = nes_drain_sq;
|
|
|
|
+ nesibdev->ibdev.drain_rq = nes_drain_rq;
|
|
|
|
|
|
nesibdev->ibdev.iwcm = kzalloc(sizeof(*nesibdev->ibdev.iwcm), GFP_KERNEL);
|
|
nesibdev->ibdev.iwcm = kzalloc(sizeof(*nesibdev->ibdev.iwcm), GFP_KERNEL);
|
|
if (nesibdev->ibdev.iwcm == NULL) {
|
|
if (nesibdev->ibdev.iwcm == NULL) {
|