]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
scsi: cxgb4i: Set completion bit in work request
authorVarun Prakash <varun@chelsio.com>
Fri, 23 Sep 2016 14:37:40 +0000 (20:07 +0530)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 28 Sep 2016 05:25:28 +0000 (01:25 -0400)
If SKCBF_TX_FLAG_COMPL flag is set and unacknowledged credits are >= max
credits / 2, set completion bit in work request to reclaim credits.

Signed-off-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/cxgbi/cxgb4i/cxgb4i.c

index e4ba2d2616cdb4188b6e9d6e7ea4e74b93583086..2487ae6be272b698ea191bd4af411265163c39b7 100644 (file)
@@ -682,6 +682,11 @@ static int push_tx_frames(struct cxgbi_sock *csk, int req_completion)
                                        req_completion);
                        csk->snd_nxt += len;
                        cxgbi_skcb_clear_flag(skb, SKCBF_TX_NEED_HDR);
+               } else if (cxgbi_skcb_test_flag(skb, SKCBF_TX_FLAG_COMPL) &&
+                          (csk->wr_una_cred >= (csk->wr_max_cred / 2))) {
+                       struct cpl_close_con_req *req =
+                               (struct cpl_close_con_req *)skb->data;
+                       req->wr.wr_hi |= htonl(FW_WR_COMPL_F);
                }
                total_size += skb->truesize;
                t4_set_arp_err_handler(skb, csk, arp_failure_skb_discard);