Skip to contentSkip to conversation

rocker: fix a sleeping in atomic bug

PATCH Applied Dan Carpenter 2 participants 2 messages Jan 6, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rocker: fix a sleeping in atomic bug

This code is holding the &ofdpa->flow_tbl_lock spinlock so it is not allowed to sleep. That means we have to pass the OFDPA_OP_FLAG_NOWAIT flag to ofdpa_flow_tbl_del().

Fixes 936bd486564a ("rocker: use FIB notifications instead of switchdev calls")

---
From static analysis. Not tested.

 drivers/net/ethernet/rocker/rocker_ofdpa.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/rocker/rocker_ofdpa.c +2 -1
index 3e1ca7a8d029..bc70c6abd6a5 100644
@@ -2783,7 +2783,8 @@ static void ofdpa_fib4_abort(struct rocker *rocker)
 		if (!ofdpa_port)
 			continue;
 		nh->fib_nh_flags &= ~RTNH_F_OFFLOAD;
-		ofdpa_flow_tbl_del(ofdpa_port, OFDPA_OP_FLAG_REMOVE,
+		ofdpa_flow_tbl_del(ofdpa_port,
+				   OFDPA_OP_FLAG_REMOVE | OFDPA_OP_FLAG_NOWAIT,
 				   flow_entry);
 	}
 	spin_unlock_irqrestore(&ofdpa->flow_tbl_lock, flags);
Signature · 1 line
2.20.1
#1 lore raw
This patch was applied to netdev/net.git (master) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <[email protected]>:

Quoted 8 lines · On Thu, 6 Jan 2022 14:57:54 +0300 you wrote:

This code is holding the &ofdpa->flow_tbl_lock spinlock so it is not allowed to sleep. That means we have to pass the OFDPA_OP_FLAG_NOWAIT flag to ofdpa_flow_tbl_del().

Fixes 936bd486564a ("rocker: use FIB notifications instead of switchdev calls")

[...]

Here is the summary with links:
- [net] rocker: fix a sleeping in atomic bug

    https://git.kernel.org/netdev/net/c/43d012123122

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html