IB/ipoib: Set IPOIB_NEIGH_TBL_FLUSH after flushed completion initialization
authorFeras Daoud <ferasda@mellanox.com>
Sun, 16 Jul 2017 08:33:01 +0000 (11:33 +0300)
committerLeon Romanovsky <leon@kernel.org>
Sun, 23 Jul 2017 06:45:11 +0000 (09:45 +0300)
Set IPOIB_NEIGH_TBL_FLUSH bit after initializing the neighbor
flushed completion, otherwise the garbage collector may signal
a completion while it is not initialized yet.

Fixes: b63b70d87741 ("IPoIB: Use a private hash table for path lookup in xmit path")
Signed-off-by: Feras Daoud <ferasda@mellanox.com>
Signed-off-by: Alex Vesker <valex@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/ulp/ipoib/ipoib_main.c

index 8b7ec15a9d6e40208f222d508b03bdc4e1bed5e0..f4403c52cd67f68e62f3bcfe055be4574a59d2f0 100644 (file)
@@ -1560,6 +1560,7 @@ static void ipoib_flush_neighs(struct ipoib_dev_priv *priv)
        int i, wait_flushed = 0;
 
        init_completion(&priv->ntbl.flushed);
+       set_bit(IPOIB_NEIGH_TBL_FLUSH, &priv->flags);
 
        spin_lock_irqsave(&priv->lock, flags);
 
@@ -1604,7 +1605,6 @@ static void ipoib_neigh_hash_uninit(struct net_device *dev)
 
        ipoib_dbg(priv, "ipoib_neigh_hash_uninit\n");
        init_completion(&priv->ntbl.deleted);
-       set_bit(IPOIB_NEIGH_TBL_FLUSH, &priv->flags);
 
        /* Stop GC if called at init fail need to cancel work */
        stopped = test_and_set_bit(IPOIB_STOP_NEIGH_GC, &priv->flags);