diff options
author | Alex Vesker <valex@mellanox.com> | 2017-10-10 10:36:41 +0300 |
---|---|---|
committer | Sasha Levin <alexander.levin@microsoft.com> | 2018-01-17 12:55:41 -0500 |
commit | 411934395be9e8074f08876c4b9fcbfee2574f43 (patch) | |
tree | 8bee3f20f979416157b7da3db4f896261bea9e44 | |
parent | 1e6e40c8b310566b8d49c272be4fe1fe550409ff (diff) |
IB/ipoib: Grab rtnl lock on heavy flush when calling ndo_open/stop
[ Upstream commit b4b678b06f6eef18bff44a338c01870234db0bc9 ]
When ndo_open and ndo_stop are called RTNL lock should be held.
In this specific case ipoib_ib_dev_open calls the offloaded ndo_open
which re-sets the number of TX queue assuming RTNL lock is held.
Since RTNL lock is not held, RTNL assert will fail.
Signed-off-by: Alex Vesker <valex@mellanox.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_ib.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c index 63b92cbb29ad..545c7ef480e8 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c @@ -1052,10 +1052,15 @@ static void __ipoib_ib_dev_flush(struct ipoib_dev_priv *priv, ipoib_ib_dev_down(dev); if (level == IPOIB_FLUSH_HEAVY) { + rtnl_lock(); if (test_bit(IPOIB_FLAG_INITIALIZED, &priv->flags)) ipoib_ib_dev_stop(dev); - if (ipoib_ib_dev_open(dev) != 0) + + result = ipoib_ib_dev_open(dev); + rtnl_unlock(); + if (result) return; + if (netif_queue_stopped(dev)) netif_start_queue(dev); } |