Skip to contentSkip to conversation

net/sched: act_mirred: Don't zero blockid when net device is being deleted

PATCH Applied Victor Nogueira 5 participants 5 messages Feb 7, 2024 – Feb 9, 2024

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

PATCH v2 1/1 net/sched: act_mirred: Don't zero blockid when net device is being deleted

While testing tdc with parallel tests for mirred to block we caught an intermittent bug. The blockid was being zeroed out when a net device was deleted and, thus, giving us an incorrect blockid value whenever we tried to dump the mirred action. Since we don't increment the block refcount in the control path (and only use the ID), we don't need to zero the blockid field whenever a net device is going down.

Fixes 42f39036cda8 ("net/sched: act_mirred: Allow mirred to block")

---
v1 -> v2:
- Reword commit message to emphasise the bug is caused when a net device is being deleted
- Reword subject to emphasise the bug is caused when a net device is being deleted. Original patch subject was:
"net/sched: act_mirred: Don't zero blockid when netns is going down"

 net/sched/act_mirred.c | 2 --
 1 file changed, 2 deletions(-)
net/sched/act_mirred.c +0 -2
index 93a96e9d8d90..6f4bb1c8ce7b 100644
@@ -533,8 +533,6 @@ static int mirred_device_event(struct notifier_block *unused,
 				 * net_device are already rcu protected.
 				 */
 				RCU_INIT_POINTER(m->tcfm_dev, NULL);
-			} else if (m->tcfm_blockid) {
-				m->tcfm_blockid = 0;
 			}
 			spin_unlock_bh(&m->tcf_lock);
 		}
Signature · 1 line
2.34.1
reviewer Reviewed-by on v2 1/1
#1 lore raw
Quoted 9 lines · Victor Nogueira

While testing tdc with parallel tests for mirred to block we caught an intermittent bug. The blockid was being zeroed out when a net device was deleted and, thus, giving us an incorrect blockid value whenever we tried to dump the mirred action. Since we don't increment the block refcount in the control path (and only use the ID), we don't need to zero the blockid field whenever a net device is going down.

Fixes 42f39036cda8 ("net/sched: act_mirred: Allow mirred to block")
Quoted 7 lines

---
v1 -> v2:
- Reword commit message to emphasise the bug is caused when a net device is being deleted
- Reword subject to emphasise the bug is caused when a net device is being deleted. Original patch subject was:
"net/sched: act_mirred: Don't zero blockid when netns is going down"

Thanks for the update.

Reviewed-by on v2 1/1
#2 lore raw
In reply to Victor Nogueira
Quoted 10 lines · Victor Nogueira

While testing tdc with parallel tests for mirred to block we caught an intermittent bug. The blockid was being zeroed out when a net device was deleted and, thus, giving us an incorrect blockid value whenever we tried to dump the mirred action. Since we don't increment the block refcount in the control path (and only use the ID), we don't need to zero the blockid field whenever a net device is going down.

Fixes 42f39036cda8 ("net/sched: act_mirred: Allow mirred to block")
maintainer Acked-by on v2 1/1
#3 lore raw
In reply to Victor Nogueira
Quoted 10 lines · Victor Nogueira

While testing tdc with parallel tests for mirred to block we caught an intermittent bug. The blockid was being zeroed out when a net device was deleted and, thus, giving us an incorrect blockid value whenever we tried to dump the mirred action. Since we don't increment the block refcount in the control path (and only use the ID), we don't need to zero the blockid field whenever a net device is going down.

Fixes 42f39036cda8 ("net/sched: act_mirred: Allow mirred to block")

cheers,
jamal

Quoted 27 lines

---
v1 -> v2:
- Reword commit message to emphasise the bug is caused when a net device is being deleted
- Reword subject to emphasise the bug is caused when a net device is being deleted. Original patch subject was:
"net/sched: act_mirred: Don't zero blockid when netns is going down"

 net/sched/act_mirred.c | 2 --
 1 file changed, 2 deletions(-)
net/sched/act_mirred.c +0 -3
index 93a96e9d8d90..6f4bb1c8ce7b 100644
@@ -533,8 +533,6 @@ static int mirred_device_event(struct notifier_block *unused,
                                 * net_device are already rcu protected.
                                 */
                                RCU_INIT_POINTER(m->tcfm_dev, NULL);
-                       } else if (m->tcfm_blockid) {
-                               m->tcfm_blockid = 0;
                        }
                        spin_unlock_bh(&m->tcf_lock);
                }
--

2.34.1

#4 lore raw
In reply to Victor Nogueira
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Wed, 7 Feb 2024 19:29:02 -0300 you wrote:

While testing tdc with parallel tests for mirred to block we caught an intermittent bug. The blockid was being zeroed out when a net device was deleted and, thus, giving us an incorrect blockid value whenever we tried to dump the mirred action. Since we don't increment the block refcount in the control path (and only use the ID), we don't need to zero the blockid field whenever a net device is going down.

[...]

Here is the summary with links:
- [net,v2] net/sched: act_mirred: Don't zero blockid when net device is being deleted

    https://git.kernel.org/netdev/net/c/aae09a6c7783

You are awesome, thank you!

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