* Re: [PATCH net v2] net/sched: act_mirred: Don't zero blockid when net device is being deleted
2024-02-07 22:29 [PATCH net v2] net/sched: act_mirred: Don't zero blockid when net device is being deleted Victor Nogueira
@ 2024-02-09 9:41 ` Simon Horman
2024-02-09 10:30 ` Eric Dumazet
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Simon Horman @ 2024-02-09 9:41 UTC (permalink / raw)
To: Victor Nogueira
Cc: jhs, xiyou.wangcong, jiri, davem, edumazet, kuba, pabeni, netdev,
kernel, pctammela
On Wed, Feb 07, 2024 at 07:29:02PM -0300, Victor Nogueira 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.
>
> Fixes: 42f39036cda8 ("net/sched: act_mirred: Allow mirred to block")
> Signed-off-by: Victor Nogueira <victor@mojatatu.com>
> ---
> 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: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH net v2] net/sched: act_mirred: Don't zero blockid when net device is being deleted
2024-02-07 22:29 [PATCH net v2] net/sched: act_mirred: Don't zero blockid when net device is being deleted Victor Nogueira
2024-02-09 9:41 ` Simon Horman
@ 2024-02-09 10:30 ` Eric Dumazet
2024-02-09 11:28 ` Jamal Hadi Salim
2024-02-09 21:00 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: Eric Dumazet @ 2024-02-09 10:30 UTC (permalink / raw)
To: Victor Nogueira
Cc: jhs, xiyou.wangcong, jiri, davem, kuba, pabeni, netdev, kernel,
pctammela
On Wed, Feb 7, 2024 at 11:29 PM Victor Nogueira <victor@mojatatu.com> 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.
>
> Fixes: 42f39036cda8 ("net/sched: act_mirred: Allow mirred to block")
> Signed-off-by: Victor Nogueira <victor@mojatatu.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH net v2] net/sched: act_mirred: Don't zero blockid when net device is being deleted
2024-02-07 22:29 [PATCH net v2] net/sched: act_mirred: Don't zero blockid when net device is being deleted Victor Nogueira
2024-02-09 9:41 ` Simon Horman
2024-02-09 10:30 ` Eric Dumazet
@ 2024-02-09 11:28 ` Jamal Hadi Salim
2024-02-09 21:00 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: Jamal Hadi Salim @ 2024-02-09 11:28 UTC (permalink / raw)
To: Victor Nogueira
Cc: xiyou.wangcong, jiri, davem, edumazet, kuba, pabeni, netdev,
kernel, pctammela
On Wed, Feb 7, 2024 at 5:29 PM Victor Nogueira <victor@mojatatu.com> 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.
>
> Fixes: 42f39036cda8 ("net/sched: act_mirred: Allow mirred to block")
> Signed-off-by: Victor Nogueira <victor@mojatatu.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
cheers,
jamal
> ---
> 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(-)
>
> diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
> index 93a96e9d8d90..6f4bb1c8ce7b 100644
> --- a/net/sched/act_mirred.c
> +++ b/net/sched/act_mirred.c
> @@ -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
>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH net v2] net/sched: act_mirred: Don't zero blockid when net device is being deleted
2024-02-07 22:29 [PATCH net v2] net/sched: act_mirred: Don't zero blockid when net device is being deleted Victor Nogueira
` (2 preceding siblings ...)
2024-02-09 11:28 ` Jamal Hadi Salim
@ 2024-02-09 21:00 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-02-09 21:00 UTC (permalink / raw)
To: Victor Nogueira
Cc: jhs, xiyou.wangcong, jiri, davem, edumazet, kuba, pabeni, netdev,
kernel, pctammela
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
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!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 5+ messages in thread