···663663int iser_conn_terminate(struct iser_conn *iser_conn)664664{665665 struct ib_conn *ib_conn = &iser_conn->ib_conn;666666- struct ib_send_wr *bad_wr;667666 int err = 0;668667669668 /* terminate the iser conn only if the conn state is UP */···687688 iser_err("Failed to disconnect, conn: 0x%p err %d\n",688689 iser_conn, err);689690690690- /* post an indication that all flush errors were consumed */691691- err = ib_post_send(ib_conn->qp, &ib_conn->last, &bad_wr);692692- if (err) {693693- iser_err("conn %p failed to post last wr", ib_conn);694694- return 1;695695- }696696-697697- wait_for_completion(&ib_conn->last_comp);691691+ /* block until all flush errors are consumed */692692+ ib_drain_sq(ib_conn->qp);698693 }699694700695 return 1;···947954948955 ib_conn->post_recv_buf_count = 0;949956 ib_conn->reg_cqe.done = iser_reg_comp;950950- ib_conn->last_cqe.done = iser_last_comp;951951- ib_conn->last.wr_cqe = &ib_conn->last_cqe;952952- ib_conn->last.opcode = IB_WR_SEND;953953- init_completion(&ib_conn->last_comp);954957}955958956959 /**