Skip to content

Commit

Permalink
IB/ipoib: Grab rtnl lock on heavy flush when calling ndo_open/stop
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alex Vesker authored and Saeed Mahameed committed Oct 14, 2017
1 parent dae3745 commit b4b678b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/infiniband/ulp/ipoib/ipoib_ib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit b4b678b

Please sign in to comment.