@@ -92,6 +92,7 @@ enum {
IPOIB_FLAG_ADMIN_CM = 9,
IPOIB_FLAG_UMCAST = 10,
IPOIB_FLAG_CSUM = 11,
+ IPOIB_FLAG_POLL_TIMER = 12,
IPOIB_MAX_BACKOFF_SECONDS = 16,
@@ -481,7 +481,8 @@ void ipoib_send_comp_handler(struct ib_cq *cq, void *dev_ptr)
{
struct ipoib_dev_priv *priv = netdev_priv(dev_ptr);
- mod_timer(&priv->poll_timer, jiffies);
+ if (test_bit(IPOIB_FLAG_POLL_TIMER, &priv->flags))
+ mod_timer(&priv->poll_timer, jiffies);
}
static inline int post_send(struct ipoib_dev_priv *priv,
@@ -860,6 +861,7 @@ int ipoib_ib_dev_stop(struct net_device *dev, int flush)
ipoib_dbg(priv, "All sends and receives done.\n");
timeout:
+ clear_bit(IPOIB_FLAG_POLL_TIMER, &priv->flags);
del_timer_sync(&priv->poll_timer);
qp_attr.qp_state = IB_QPS_RESET;
if (ib_modify_qp(priv->qp, &qp_attr, IB_QP_STATE))
@@ -904,6 +906,7 @@ int ipoib_ib_dev_init(struct net_device *dev, struct ib_device *ca, int port)
setup_timer(&priv->poll_timer, ipoib_ib_tx_timer_func,
(unsigned long) dev);
+ set_bit(IPOIB_FLAG_POLL_TIMER, &priv->flags);
if (dev->flags & IFF_UP) {
if (ipoib_ib_dev_open(dev)) {