aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnish Bhatt <anish@chelsio.com>2014-11-06 15:53:58 -0500
committerChristoph Hellwig <hch@lst.de>2014-11-10 09:25:29 -0500
commit7b07bf244ae33e4ce8d51c23f1359121942a6f3e (patch)
treeb1a5adbcc1a31ebe18a35186d321a37b3fb59fcc
parentd8ae3c33599ac5c7bc758d88529debbbe8c09265 (diff)
cxgb4i: send abort_rpl correctly
Connection retries were not being cleaned up correctly if they failed as a result of link down. Applies on top of drivers-for-3.18. Signed-off-by: Anish Bhatt <anish@chelsio.com> Signed-off-by: Karen Xie <kxie@chelsio.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r--drivers/scsi/cxgbi/cxgb4i/cxgb4i.c15
-rw-r--r--drivers/scsi/cxgbi/libcxgbi.c18
2 files changed, 17 insertions, 16 deletions
diff --git a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
index 3e0a0d315f72..81bb3bd7909d 100644
--- a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
+++ b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
@@ -936,20 +936,23 @@ static void do_abort_req_rss(struct cxgbi_device *cdev, struct sk_buff *skb)
936 cxgbi_sock_get(csk); 936 cxgbi_sock_get(csk);
937 spin_lock_bh(&csk->lock); 937 spin_lock_bh(&csk->lock);
938 938
939 if (!cxgbi_sock_flag(csk, CTPF_ABORT_REQ_RCVD)) { 939 cxgbi_sock_clear_flag(csk, CTPF_ABORT_REQ_RCVD);
940 cxgbi_sock_set_flag(csk, CTPF_ABORT_REQ_RCVD); 940
941 cxgbi_sock_set_state(csk, CTP_ABORTING); 941 if (!cxgbi_sock_flag(csk, CTPF_TX_DATA_SENT)) {
942 goto done; 942 send_tx_flowc_wr(csk);
943 cxgbi_sock_set_flag(csk, CTPF_TX_DATA_SENT);
943 } 944 }
944 945
945 cxgbi_sock_clear_flag(csk, CTPF_ABORT_REQ_RCVD); 946 cxgbi_sock_set_flag(csk, CTPF_ABORT_REQ_RCVD);
947 cxgbi_sock_set_state(csk, CTP_ABORTING);
948
946 send_abort_rpl(csk, rst_status); 949 send_abort_rpl(csk, rst_status);
947 950
948 if (!cxgbi_sock_flag(csk, CTPF_ABORT_RPL_PENDING)) { 951 if (!cxgbi_sock_flag(csk, CTPF_ABORT_RPL_PENDING)) {
949 csk->err = abort_status_to_errno(csk, req->status, &rst_status); 952 csk->err = abort_status_to_errno(csk, req->status, &rst_status);
950 cxgbi_sock_closed(csk); 953 cxgbi_sock_closed(csk);
951 } 954 }
952done: 955
953 spin_unlock_bh(&csk->lock); 956 spin_unlock_bh(&csk->lock);
954 cxgbi_sock_put(csk); 957 cxgbi_sock_put(csk);
955rel_skb: 958rel_skb:
diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c
index 674d498b46ab..13d869a92248 100644
--- a/drivers/scsi/cxgbi/libcxgbi.c
+++ b/drivers/scsi/cxgbi/libcxgbi.c
@@ -905,18 +905,16 @@ void cxgbi_sock_rcv_abort_rpl(struct cxgbi_sock *csk)
905{ 905{
906 cxgbi_sock_get(csk); 906 cxgbi_sock_get(csk);
907 spin_lock_bh(&csk->lock); 907 spin_lock_bh(&csk->lock);
908
909 cxgbi_sock_set_flag(csk, CTPF_ABORT_RPL_RCVD);
908 if (cxgbi_sock_flag(csk, CTPF_ABORT_RPL_PENDING)) { 910 if (cxgbi_sock_flag(csk, CTPF_ABORT_RPL_PENDING)) {
909 if (!cxgbi_sock_flag(csk, CTPF_ABORT_RPL_RCVD)) 911 cxgbi_sock_clear_flag(csk, CTPF_ABORT_RPL_PENDING);
910 cxgbi_sock_set_flag(csk, CTPF_ABORT_RPL_RCVD); 912 if (cxgbi_sock_flag(csk, CTPF_ABORT_REQ_RCVD))
911 else { 913 pr_err("csk 0x%p,%u,0x%lx,%u,ABT_RPL_RSS.\n",
912 cxgbi_sock_clear_flag(csk, CTPF_ABORT_RPL_RCVD); 914 csk, csk->state, csk->flags, csk->tid);
913 cxgbi_sock_clear_flag(csk, CTPF_ABORT_RPL_PENDING); 915 cxgbi_sock_closed(csk);
914 if (cxgbi_sock_flag(csk, CTPF_ABORT_REQ_RCVD))
915 pr_err("csk 0x%p,%u,0x%lx,%u,ABT_RPL_RSS.\n",
916 csk, csk->state, csk->flags, csk->tid);
917 cxgbi_sock_closed(csk);
918 }
919 } 916 }
917
920 spin_unlock_bh(&csk->lock); 918 spin_unlock_bh(&csk->lock);
921 cxgbi_sock_put(csk); 919 cxgbi_sock_put(csk);
922} 920}