]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sdp: tx_ring timer should not be scheduled if the qp is not active anymore.
authorEldad Zinger <eldadz@mellanox.co.il>
Thu, 8 Jul 2010 13:27:20 +0000 (16:27 +0300)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 6 Oct 2015 12:05:10 +0000 (05:05 -0700)
Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
drivers/infiniband/ulp/sdp/sdp_tx.c

index e52f0382addb3eae2b9a1e2b935597f175f40f6f..5c6207bf95e08944a38dbfb275180ff303e71a48 100644 (file)
@@ -50,7 +50,7 @@ int sdp_xmit_poll(struct sdp_sock *ssk, int force)
 
        /* If we don't have a pending timer, set one up to catch our recent
           post in case the interface becomes idle */
-       if (!timer_pending(&ssk->tx_ring.timer))
+       if (likely(ssk->qp_active) && !timer_pending(&ssk->tx_ring.timer))
                mod_timer(&ssk->tx_ring.timer, jiffies + SDP_TX_POLL_TIMEOUT);
 
        ssk->tx_compl_pending = 0;
@@ -421,7 +421,10 @@ static void sdp_tx_irq(struct ib_cq *cq, void *cq_context)
 
        if (sdp_tx_handler_select(ssk)) {
                sdp_prf1(sk, NULL, "poll and post from tasklet");
-               mod_timer(&ssk->tx_ring.timer, jiffies + SDP_TX_POLL_TIMEOUT);
+               if (likely(ssk->qp_active)) {
+                       mod_timer(&ssk->tx_ring.timer,
+                                       jiffies + SDP_TX_POLL_TIMEOUT);
+               }
                tasklet_schedule(&ssk->tx_ring.tasklet);
        }
 }