Skip to content

Commit b4b678b

Browse files
alexveskerSaeed Mahameed
authored andcommitted
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 <[email protected]>
1 parent dae3745 commit b4b678b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/infiniband/ulp/ipoib/ipoib_ib.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1203,10 +1203,15 @@ static void __ipoib_ib_dev_flush(struct ipoib_dev_priv *priv,
12031203
ipoib_ib_dev_down(dev);
12041204

12051205
if (level == IPOIB_FLUSH_HEAVY) {
1206+
rtnl_lock();
12061207
if (test_bit(IPOIB_FLAG_INITIALIZED, &priv->flags))
12071208
ipoib_ib_dev_stop(dev);
1208-
if (ipoib_ib_dev_open(dev) != 0)
1209+
1210+
result = ipoib_ib_dev_open(dev);
1211+
rtnl_unlock();
1212+
if (result)
12091213
return;
1214+
12101215
if (netif_queue_stopped(dev))
12111216
netif_start_queue(dev);
12121217
}

0 commit comments

Comments
 (0)