]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
scsi: avoid ->change_queue_depth indirection for queue full tracking
[karo-tx-linux.git] / drivers / scsi / cxgbi / cxgb4i / cxgb4i.c
index 18d0d1c145ade62d8e8bcb1d0a31aa4c46a82e19..af86e8f57b842c0703d6f88679e65fff2c31a5c4 100644 (file)
@@ -99,6 +99,7 @@ static struct scsi_host_template cxgb4i_host_template = {
        .target_alloc   = iscsi_target_alloc,
        .use_clustering = DISABLE_CLUSTERING,
        .this_id        = -1,
+       .track_queue_depth = 1,
 };
 
 static struct iscsi_transport cxgb4i_iscsi_transport = {
@@ -259,6 +260,7 @@ static void send_act_open_req(struct cxgbi_sock *csk, struct sk_buff *skb,
        cxgb4_l2t_send(csk->cdev->ports[csk->port_id], skb, csk->l2t);
 }
 
+#if IS_ENABLED(CONFIG_IPV6)
 static void send_act_open_req6(struct cxgbi_sock *csk, struct sk_buff *skb,
                               struct l2t_entry *e)
 {
@@ -344,6 +346,7 @@ static void send_act_open_req6(struct cxgbi_sock *csk, struct sk_buff *skb,
 
        cxgb4_l2t_send(csk->cdev->ports[csk->port_id], skb, csk->l2t);
 }
+#endif
 
 static void send_close_req(struct cxgbi_sock *csk)
 {
@@ -756,7 +759,7 @@ static int act_open_rpl_status_to_errno(int status)
 
 static void csk_act_open_retry_timer(unsigned long data)
 {
-       struct sk_buff *skb;
+       struct sk_buff *skb = NULL;
        struct cxgbi_sock *csk = (struct cxgbi_sock *)data;
        struct cxgb4_lld_info *lldi = cxgbi_cdev_priv(csk->cdev);
        void (*send_act_open_func)(struct cxgbi_sock *, struct sk_buff *,
@@ -781,9 +784,11 @@ static void csk_act_open_retry_timer(unsigned long data)
        if (csk->csk_family == AF_INET) {
                send_act_open_func = send_act_open_req;
                skb = alloc_wr(size, 0, GFP_ATOMIC);
+#if IS_ENABLED(CONFIG_IPV6)
        } else {
                send_act_open_func = send_act_open_req6;
                skb = alloc_wr(size6, 0, GFP_ATOMIC);
+#endif
        }
 
        if (!skb)
@@ -932,20 +937,23 @@ static void do_abort_req_rss(struct cxgbi_device *cdev, struct sk_buff *skb)
        cxgbi_sock_get(csk);
        spin_lock_bh(&csk->lock);
 
-       if (!cxgbi_sock_flag(csk, CTPF_ABORT_REQ_RCVD)) {
-               cxgbi_sock_set_flag(csk, CTPF_ABORT_REQ_RCVD);
-               cxgbi_sock_set_state(csk, CTP_ABORTING);
-               goto done;
+       cxgbi_sock_clear_flag(csk, CTPF_ABORT_REQ_RCVD);
+
+       if (!cxgbi_sock_flag(csk, CTPF_TX_DATA_SENT)) {
+               send_tx_flowc_wr(csk);
+               cxgbi_sock_set_flag(csk, CTPF_TX_DATA_SENT);
        }
 
-       cxgbi_sock_clear_flag(csk, CTPF_ABORT_REQ_RCVD);
+       cxgbi_sock_set_flag(csk, CTPF_ABORT_REQ_RCVD);
+       cxgbi_sock_set_state(csk, CTP_ABORTING);
+
        send_abort_rpl(csk, rst_status);
 
        if (!cxgbi_sock_flag(csk, CTPF_ABORT_RPL_PENDING)) {
                csk->err = abort_status_to_errno(csk, req->status, &rst_status);
                cxgbi_sock_closed(csk);
        }
-done:
+
        spin_unlock_bh(&csk->lock);
        cxgbi_sock_put(csk);
 rel_skb:
@@ -1313,11 +1321,6 @@ static int init_act_open(struct cxgbi_sock *csk)
        cxgbi_sock_set_flag(csk, CTPF_HAS_ATID);
        cxgbi_sock_get(csk);
 
-       n = dst_neigh_lookup(csk->dst, &csk->daddr.sin_addr.s_addr);
-       if (!n) {
-               pr_err("%s, can't get neighbour of csk->dst.\n", ndev->name);
-               goto rel_resource;
-       }
        csk->l2t = cxgb4_l2t_get(lldi->l2t, n, ndev, 0);
        if (!csk->l2t) {
                pr_err("%s, cannot alloc l2t.\n", ndev->name);
@@ -1335,8 +1338,10 @@ static int init_act_open(struct cxgbi_sock *csk)
 
        if (csk->csk_family == AF_INET)
                skb = alloc_wr(size, 0, GFP_NOIO);
+#if IS_ENABLED(CONFIG_IPV6)
        else
                skb = alloc_wr(size6, 0, GFP_NOIO);
+#endif
 
        if (!skb)
                goto rel_resource;
@@ -1370,8 +1375,10 @@ static int init_act_open(struct cxgbi_sock *csk)
        cxgbi_sock_set_state(csk, CTP_ACTIVE_OPEN);
        if (csk->csk_family == AF_INET)
                send_act_open_req(csk, skb, csk->l2t);
+#if IS_ENABLED(CONFIG_IPV6)
        else
                send_act_open_req6(csk, skb, csk->l2t);
+#endif
        neigh_release(n);
 
        return 0;