]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
IPoIB: Consolidate rtnl_lock tasks in workqueue
authorDoug Ledford <dledford@redhat.com>
Wed, 10 Dec 2014 16:46:58 +0000 (11:46 -0500)
committerRoland Dreier <roland@purestorage.com>
Tue, 16 Dec 2014 02:11:14 +0000 (18:11 -0800)
Setting the MTU can safely be moved to the carrier_on_task, which keeps
us from needing to take the rtnl lock in the join_finish section.

Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/infiniband/ulp/ipoib/ipoib_multicast.c

index ffb83b5f7e805e411f1506d66a53f8465b90c439..eee66d13e5b9acf9a6c700777a7082f7bbdc8e7e 100644 (file)
@@ -190,12 +190,6 @@ static int ipoib_mcast_join_finish(struct ipoib_mcast *mcast,
                spin_unlock_irq(&priv->lock);
                priv->tx_wr.wr.ud.remote_qkey = priv->qkey;
                set_qkey = 1;
-
-               if (!ipoib_cm_admin_enabled(dev)) {
-                       rtnl_lock();
-                       dev_set_mtu(dev, min(priv->mcast_mtu, priv->admin_mtu));
-                       rtnl_unlock();
-               }
        }
 
        if (!test_bit(IPOIB_MCAST_FLAG_SENDONLY, &mcast->flags)) {
@@ -371,6 +365,8 @@ void ipoib_mcast_carrier_on_task(struct work_struct *work)
        }
 
        rtnl_lock();
+       if (!ipoib_cm_admin_enabled(priv->dev))
+               dev_set_mtu(priv->dev, min(priv->mcast_mtu, priv->admin_mtu));
        netif_carrier_on(priv->dev);
        rtnl_unlock();
 }