Commit 4f0af697 authored by Bart Van Assche's avatar Bart Van Assche Committed by Roland Dreier

IB/srp: Process all error completions

If the RDMA RC connection is closed, tell the SCSI mid-layer to
terminate all pending commands instead of only the first.
Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Acked-by: default avatarDavid Dillow <dillowda@ornl.gov>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent 948d1e88
...@@ -1274,8 +1274,12 @@ static void srp_handle_qp_err(enum ib_wc_status wc_status, ...@@ -1274,8 +1274,12 @@ static void srp_handle_qp_err(enum ib_wc_status wc_status,
enum ib_wc_opcode wc_opcode, enum ib_wc_opcode wc_opcode,
struct srp_target_port *target) struct srp_target_port *target)
{ {
shost_printk(KERN_ERR, target->scsi_host, PFX "failed %s status %d\n", if (!target->qp_in_error) {
wc_opcode & IB_WC_RECV ? "receive" : "send", wc_status); shost_printk(KERN_ERR, target->scsi_host,
PFX "failed %s status %d\n",
wc_opcode & IB_WC_RECV ? "receive" : "send",
wc_status);
}
target->qp_in_error = true; target->qp_in_error = true;
} }
...@@ -1290,7 +1294,6 @@ static void srp_recv_completion(struct ib_cq *cq, void *target_ptr) ...@@ -1290,7 +1294,6 @@ static void srp_recv_completion(struct ib_cq *cq, void *target_ptr)
srp_handle_recv(target, &wc); srp_handle_recv(target, &wc);
} else { } else {
srp_handle_qp_err(wc.status, wc.opcode, target); srp_handle_qp_err(wc.status, wc.opcode, target);
break;
} }
} }
} }
...@@ -1307,7 +1310,6 @@ static void srp_send_completion(struct ib_cq *cq, void *target_ptr) ...@@ -1307,7 +1310,6 @@ static void srp_send_completion(struct ib_cq *cq, void *target_ptr)
list_add(&iu->list, &target->free_tx); list_add(&iu->list, &target->free_tx);
} else { } else {
srp_handle_qp_err(wc.status, wc.opcode, target); srp_handle_qp_err(wc.status, wc.opcode, target);
break;
} }
} }
} }
......
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