summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/ipoib
diff options
context:
space:
mode:
authorAlex Vesker <valex@mellanox.com>2017-10-10 10:36:41 +0300
committerSaeed Mahameed <saeedm@mellanox.com>2017-10-14 11:22:08 -0700
commitb4b678b06f6eef18bff44a338c01870234db0bc9 (patch)
tree6dd3d2b3e33d16c1261a78a61f78ab86d0954198 /drivers/infiniband/ulp/ipoib
parentdae37456c8ac3afe8d5f306717f2b75ed5ca38d9 (diff)
downloadtalos-obmc-linux-b4b678b06f6eef18bff44a338c01870234db0bc9.tar.gz
talos-obmc-linux-b4b678b06f6eef18bff44a338c01870234db0bc9.zip
IB/ipoib: Grab rtnl lock on heavy flush when calling ndo_open/stop
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>
Diffstat (limited to 'drivers/infiniband/ulp/ipoib')
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_ib.c7
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 6cd61638b441..c97384c914a4 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
@@ -1203,10 +1203,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);
}
OpenPOWER on IntegriCloud