Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

IB/iser: Use ib_drain_sq()

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>

authored by

Steve Wise and committed by
Doug Ledford
4c8ba94d 561392d4

+2 -27
-7
drivers/infiniband/ulp/iser/iscsi_iser.h
··· 458 458 * @comp: iser completion context 459 459 * @fr_pool: connection fast registration poool 460 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 */ 465 462 struct ib_conn { 466 463 struct rdma_cm_id *cma_id; ··· 469 472 struct iser_comp *comp; 470 473 struct iser_fr_pool fr_pool; 471 474 bool pi_support; 472 - struct ib_send_wr last; 473 - struct ib_cqe last_cqe; 474 475 struct ib_cqe reg_cqe; 475 - struct completion last_comp; 476 476 }; 477 477 478 478 /** ··· 611 617 void iser_ctrl_comp(struct ib_cq *cq, struct ib_wc *wc); 612 618 void iser_dataout_comp(struct ib_cq *cq, struct ib_wc *wc); 613 619 void iser_reg_comp(struct ib_cq *cq, struct ib_wc *wc); 614 - void iser_last_comp(struct ib_cq *cq, struct ib_wc *wc); 615 620 616 621 void iser_task_rdma_init(struct iscsi_iser_task *task); 617 622
-7
drivers/infiniband/ulp/iser/iser_initiator.c
··· 729 729 kmem_cache_free(ig.desc_cache, desc); 730 730 } 731 731 732 - void 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 - 739 732 void iser_task_rdma_init(struct iscsi_iser_task *iser_task) 740 733 741 734 {
+2 -13
drivers/infiniband/ulp/iser/iser_verbs.c
··· 663 663 int iser_conn_terminate(struct iser_conn *iser_conn) 664 664 { 665 665 struct ib_conn *ib_conn = &iser_conn->ib_conn; 666 - struct ib_send_wr *bad_wr; 667 666 int err = 0; 668 667 669 668 /* terminate the iser conn only if the conn state is UP */ ··· 687 688 iser_err("Failed to disconnect, conn: 0x%p err %d\n", 688 689 iser_conn, err); 689 690 690 - /* post an indication that all flush errors were consumed */ 691 - err = ib_post_send(ib_conn->qp, &ib_conn->last, &bad_wr); 692 - if (err) { 693 - iser_err("conn %p failed to post last wr", ib_conn); 694 - return 1; 695 - } 696 - 697 - wait_for_completion(&ib_conn->last_comp); 691 + /* block until all flush errors are consumed */ 692 + ib_drain_sq(ib_conn->qp); 698 693 } 699 694 700 695 return 1; ··· 947 954 948 955 ib_conn->post_recv_buf_count = 0; 949 956 ib_conn->reg_cqe.done = iser_reg_comp; 950 - ib_conn->last_cqe.done = iser_last_comp; 951 - ib_conn->last.wr_cqe = &ib_conn->last_cqe; 952 - ib_conn->last.opcode = IB_WR_SEND; 953 - init_completion(&ib_conn->last_comp); 954 957 } 955 958 956 959 /**