Commit 4c8ba94d authored by Steve Wise's avatar Steve Wise Committed by Doug Ledford

IB/iser: Use ib_drain_sq()

Signed-off-by: default avatarSteve Wise <swise@opengridcomputing.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 561392d4
...@@ -458,9 +458,6 @@ struct iser_fr_pool { ...@@ -458,9 +458,6 @@ struct iser_fr_pool {
* @comp: iser completion context * @comp: iser completion context
* @fr_pool: connection fast registration poool * @fr_pool: connection fast registration poool
* @pi_support: Indicate device T10-PI support * @pi_support: Indicate device T10-PI support
* @last: last send wr to signal all flush errors were drained
* @last_cqe: cqe handler for last wr
* @last_comp: completes when all connection completions consumed
*/ */
struct ib_conn { struct ib_conn {
struct rdma_cm_id *cma_id; struct rdma_cm_id *cma_id;
...@@ -472,10 +469,7 @@ struct ib_conn { ...@@ -472,10 +469,7 @@ struct ib_conn {
struct iser_comp *comp; struct iser_comp *comp;
struct iser_fr_pool fr_pool; struct iser_fr_pool fr_pool;
bool pi_support; bool pi_support;
struct ib_send_wr last;
struct ib_cqe last_cqe;
struct ib_cqe reg_cqe; struct ib_cqe reg_cqe;
struct completion last_comp;
}; };
/** /**
...@@ -617,7 +611,6 @@ void iser_cmd_comp(struct ib_cq *cq, struct ib_wc *wc); ...@@ -617,7 +611,6 @@ void iser_cmd_comp(struct ib_cq *cq, struct ib_wc *wc);
void iser_ctrl_comp(struct ib_cq *cq, struct ib_wc *wc); void iser_ctrl_comp(struct ib_cq *cq, struct ib_wc *wc);
void iser_dataout_comp(struct ib_cq *cq, struct ib_wc *wc); void iser_dataout_comp(struct ib_cq *cq, struct ib_wc *wc);
void iser_reg_comp(struct ib_cq *cq, struct ib_wc *wc); void iser_reg_comp(struct ib_cq *cq, struct ib_wc *wc);
void iser_last_comp(struct ib_cq *cq, struct ib_wc *wc);
void iser_task_rdma_init(struct iscsi_iser_task *task); void iser_task_rdma_init(struct iscsi_iser_task *task);
......
...@@ -729,13 +729,6 @@ void iser_dataout_comp(struct ib_cq *cq, struct ib_wc *wc) ...@@ -729,13 +729,6 @@ void iser_dataout_comp(struct ib_cq *cq, struct ib_wc *wc)
kmem_cache_free(ig.desc_cache, desc); kmem_cache_free(ig.desc_cache, desc);
} }
void iser_last_comp(struct ib_cq *cq, struct ib_wc *wc)
{
struct ib_conn *ib_conn = wc->qp->qp_context;
complete(&ib_conn->last_comp);
}
void iser_task_rdma_init(struct iscsi_iser_task *iser_task) void iser_task_rdma_init(struct iscsi_iser_task *iser_task)
{ {
......
...@@ -663,7 +663,6 @@ void iser_conn_release(struct iser_conn *iser_conn) ...@@ -663,7 +663,6 @@ void iser_conn_release(struct iser_conn *iser_conn)
int iser_conn_terminate(struct iser_conn *iser_conn) int iser_conn_terminate(struct iser_conn *iser_conn)
{ {
struct ib_conn *ib_conn = &iser_conn->ib_conn; struct ib_conn *ib_conn = &iser_conn->ib_conn;
struct ib_send_wr *bad_wr;
int err = 0; int err = 0;
/* terminate the iser conn only if the conn state is UP */ /* 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,14 +687,8 @@ int iser_conn_terminate(struct iser_conn *iser_conn)
iser_err("Failed to disconnect, conn: 0x%p err %d\n", iser_err("Failed to disconnect, conn: 0x%p err %d\n",
iser_conn, err); iser_conn, err);
/* post an indication that all flush errors were consumed */ /* block until all flush errors are consumed */
err = ib_post_send(ib_conn->qp, &ib_conn->last, &bad_wr); ib_drain_sq(ib_conn->qp);
if (err) {
iser_err("conn %p failed to post last wr", ib_conn);
return 1;
}
wait_for_completion(&ib_conn->last_comp);
} }
return 1; return 1;
...@@ -954,10 +947,6 @@ void iser_conn_init(struct iser_conn *iser_conn) ...@@ -954,10 +947,6 @@ void iser_conn_init(struct iser_conn *iser_conn)
ib_conn->post_recv_buf_count = 0; ib_conn->post_recv_buf_count = 0;
ib_conn->reg_cqe.done = iser_reg_comp; ib_conn->reg_cqe.done = iser_reg_comp;
ib_conn->last_cqe.done = iser_last_comp;
ib_conn->last.wr_cqe = &ib_conn->last_cqe;
ib_conn->last.opcode = IB_WR_SEND;
init_completion(&ib_conn->last_comp);
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment