* [PATCH net] prestera: matchall: do not rollback if rule exists
@ 2022-10-06 19:04 Maksym Glubokiy
2022-10-07 8:00 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Maksym Glubokiy @ 2022-10-06 19:04 UTC (permalink / raw)
To: Taras Chornyi, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Volodymyr Mytnyk, Serhiy Boiko, Vadym Kochan
Cc: netdev, linux-kernel, Maksym Glubokiy
From: Serhiy Boiko <serhiy.boiko@plvision.eu>
If you try to create a 'mirror' ACL rule on a port that already has a
mirror rule, prestera_span_rule_add() will fail with EEXIST error.
This forces rollback procedure which destroys existing mirror rule on
hardware leaving it visible in linux.
Add an explicit check for EEXIST to prevent the deletion of the existing
rule but keep user seeing error message:
$ tc filter add dev sw1p1 ... skip_sw action mirred egress mirror dev sw1p2
$ tc filter add dev sw1p1 ... skip_sw action mirred egress mirror dev sw1p3
RTNETLINK answers: File exists
We have an error talking to the kernel
Fixes: 13defa275eef ("net: marvell: prestera: Add matchall support")
Signed-off-by: Serhiy Boiko <serhiy.boiko@plvision.eu>
Signed-off-by: Maksym Glubokiy <maksym.glubokiy@plvision.eu>
---
drivers/net/ethernet/marvell/prestera/prestera_matchall.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/marvell/prestera/prestera_matchall.c b/drivers/net/ethernet/marvell/prestera/prestera_matchall.c
index 6f2b95a5263e..1da9c1bc1ee9 100644
--- a/drivers/net/ethernet/marvell/prestera/prestera_matchall.c
+++ b/drivers/net/ethernet/marvell/prestera/prestera_matchall.c
@@ -96,6 +96,8 @@ int prestera_mall_replace(struct prestera_flow_block *block,
list_for_each_entry(binding, &block->binding_list, list) {
err = prestera_span_rule_add(binding, port, block->ingress);
+ if (err == -EEXIST)
+ return err;
if (err)
goto rollback;
}
--
2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH net] prestera: matchall: do not rollback if rule exists
2022-10-06 19:04 [PATCH net] prestera: matchall: do not rollback if rule exists Maksym Glubokiy
@ 2022-10-07 8:00 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-10-07 8:00 UTC (permalink / raw)
To: Maksym Glubokiy
Cc: tchornyi, davem, edumazet, kuba, pabeni, vmytnyk, serhiy.boiko,
vkochan, netdev, linux-kernel
Hello:
This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:
On Thu, 6 Oct 2022 22:04:09 +0300 you wrote:
> From: Serhiy Boiko <serhiy.boiko@plvision.eu>
>
> If you try to create a 'mirror' ACL rule on a port that already has a
> mirror rule, prestera_span_rule_add() will fail with EEXIST error.
>
> This forces rollback procedure which destroys existing mirror rule on
> hardware leaving it visible in linux.
>
> [...]
Here is the summary with links:
- [net] prestera: matchall: do not rollback if rule exists
https://git.kernel.org/netdev/net/c/fb4a5dfca0f0
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] 2+ messages in thread
end of thread, other threads:[~2022-10-07 8:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-06 19:04 [PATCH net] prestera: matchall: do not rollback if rule exists Maksym Glubokiy
2022-10-07 8:00 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome