aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Wise <swise@opengridcomputing.com>2016-02-17 11:17:12 -0500
committerDoug Ledford <dledford@redhat.com>2016-02-29 17:10:27 -0500
commit4c8ba94d1763e4c46564e59729cc0553ba1fddbb (patch)
tree109bcdc5519033240a33c7c265a7508516dd7b1b
parent561392d42d42c0fefad179a07b6dd1e6e261a572 (diff)
IB/iser: Use ib_drain_sq()
Signed-off-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r--drivers/infiniband/ulp/iser/iscsi_iser.h7
-rw-r--r--drivers/infiniband/ulp/iser/iser_initiator.c7
-rw-r--r--drivers/infiniband/ulp/iser/iser_verbs.c15
3 files changed, 2 insertions, 27 deletions
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h b/drivers/infiniband/ulp/iser/iscsi_iser.h
index 95f0a64e076b..0351059783b1 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.h
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.h
@@ -458,9 +458,6 @@ struct iser_fr_pool {
458 * @comp: iser completion context 458 * @comp: iser completion context
459 * @fr_pool: connection fast registration poool 459 * @fr_pool: connection fast registration poool
460 * @pi_support: Indicate device T10-PI support 460 * @pi_support: Indicate device T10-PI support
461 * @last: last send wr to signal all flush errors were drained
462 * @last_cqe: cqe handler for last wr
463 * @last_comp: completes when all connection completions consumed
464 */ 461 */
465struct ib_conn { 462struct ib_conn {
466 struct rdma_cm_id *cma_id; 463 struct rdma_cm_id *cma_id;
@@ -472,10 +469,7 @@ struct ib_conn {
472 struct iser_comp *comp; 469 struct iser_comp *comp;
473 struct iser_fr_pool fr_pool; 470 struct iser_fr_pool fr_pool;
474 bool pi_support; 471 bool pi_support;
475 struct ib_send_wr last;
476 struct ib_cqe last_cqe;
477 struct ib_cqe reg_cqe; 472 struct ib_cqe reg_cqe;
478 struct completion last_comp;
479}; 473};
480 474
481/** 475/**
@@ -617,7 +611,6 @@ void iser_cmd_comp(struct ib_cq *cq, struct ib_wc *wc);
617void iser_ctrl_comp(struct ib_cq *cq, struct ib_wc *wc); 611void iser_ctrl_comp(struct ib_cq *cq, struct ib_wc *wc);
618void iser_dataout_comp(struct ib_cq *cq, struct ib_wc *wc); 612void iser_dataout_comp(struct ib_cq *cq, struct ib_wc *wc);
619void iser_reg_comp(struct ib_cq *cq, struct ib_wc *wc); 613void iser_reg_comp(struct ib_cq *cq, struct ib_wc *wc);
620void iser_last_comp(struct ib_cq *cq, struct ib_wc *wc);
621 614
622void iser_task_rdma_init(struct iscsi_iser_task *task); 615void iser_task_rdma_init(struct iscsi_iser_task *task);
623 616
diff --git a/drivers/infiniband/ulp/iser/iser_initiator.c b/drivers/infiniband/ulp/iser/iser_initiator.c
index ed54b388e7ad..81ae2e30dd12 100644
--- a/drivers/infiniband/ulp/iser/iser_initiator.c
+++ b/drivers/infiniband/ulp/iser/iser_initiator.c
@@ -729,13 +729,6 @@ void iser_dataout_comp(struct ib_cq *cq, struct ib_wc *wc)
729 kmem_cache_free(ig.desc_cache, desc); 729 kmem_cache_free(ig.desc_cache, desc);
730} 730}
731 731
732void iser_last_comp(struct ib_cq *cq, struct ib_wc *wc)
733{
734 struct ib_conn *ib_conn = wc->qp->qp_context;
735
736 complete(&ib_conn->last_comp);
737}
738
739void iser_task_rdma_init(struct iscsi_iser_task *iser_task) 732void iser_task_rdma_init(struct iscsi_iser_task *iser_task)
740 733
741{ 734{
diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c
index 40c0f4978e2f..47e1159c07c2 100644
--- a/drivers/infiniband/ulp/iser/iser_verbs.c
+++ b/drivers/infiniband/ulp/iser/iser_verbs.c
@@ -663,7 +663,6 @@ void iser_conn_release(struct iser_conn *iser_conn)
663int iser_conn_terminate(struct iser_conn *iser_conn) 663int iser_conn_terminate(struct iser_conn *iser_conn)
664{ 664{
665 struct ib_conn *ib_conn = &iser_conn->ib_conn; 665 struct ib_conn *ib_conn = &iser_conn->ib_conn;
666 struct ib_send_wr *bad_wr;
667 int err = 0; 666 int err = 0;
668 667
669 /* terminate the iser conn only if the conn state is UP */ 668 /* terminate the iser conn only if the conn state is UP */
@@ -688,14 +687,8 @@ int iser_conn_terminate(struct iser_conn *iser_conn)
688 iser_err("Failed to disconnect, conn: 0x%p err %d\n", 687 iser_err("Failed to disconnect, conn: 0x%p err %d\n",
689 iser_conn, err); 688 iser_conn, err);
690 689
691 /* post an indication that all flush errors were consumed */ 690 /* block until all flush errors are consumed */
692 err = ib_post_send(ib_conn->qp, &ib_conn->last, &bad_wr); 691 ib_drain_sq(ib_conn->qp);
693 if (err) {
694 iser_err("conn %p failed to post last wr", ib_conn);
695 return 1;
696 }
697
698 wait_for_completion(&ib_conn->last_comp);
699 } 692 }
700 693
701 return 1; 694 return 1;
@@ -954,10 +947,6 @@ void iser_conn_init(struct iser_conn *iser_conn)
954 947
955 ib_conn->post_recv_buf_count = 0; 948 ib_conn->post_recv_buf_count = 0;
956 ib_conn->reg_cqe.done = iser_reg_comp; 949 ib_conn->reg_cqe.done = iser_reg_comp;
957 ib_conn->last_cqe.done = iser_last_comp;
958 ib_conn->last.wr_cqe = &ib_conn->last_cqe;
959 ib_conn->last.opcode = IB_WR_SEND;
960 init_completion(&ib_conn->last_comp);
961} 950}
962 951
963 /** 952 /**