All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net: ethernet: mtk_eth_soc: avoid creating duplicate offload entries
@ 2021-09-22 23:55 ` Ilya Lipnitskiy
  0 siblings, 0 replies; 6+ messages in thread
From: Ilya Lipnitskiy @ 2021-09-22 23:55 UTC (permalink / raw)
  To: Felix Fietkau, John Crispin, Sean Wang, Mark Lee,
	David S. Miller, Jakub Kicinski, Matthias Brugger,
	Pablo Neira Ayuso, netdev, linux-arm-kernel, linux-mediatek,
	linux-kernel
  Cc: Ilya Lipnitskiy

From: Felix Fietkau <nbd@nbd.name>

Sometimes multiple CLS_REPLACE calls are issued for the same connection.
rhashtable_insert_fast does not check for these duplicates, so multiple
hardware flow entries can be created.
Fix this by checking for an existing entry early

Fixes: 502e84e2382d ("net: ethernet: mtk_eth_soc: add flow offloading support")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
---
 drivers/net/ethernet/mediatek/mtk_ppe_offload.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
index b5f68f66d42a..7bb1f20002b5 100644
--- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
+++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
@@ -186,6 +186,9 @@ mtk_flow_offload_replace(struct mtk_eth *eth, struct flow_cls_offload *f)
 	int hash;
 	int i;
 
+	if (rhashtable_lookup(&eth->flow_table, &f->cookie, mtk_flow_ht_params))
+		return -EEXIST;
+
 	if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_META)) {
 		struct flow_match_meta match;
 
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH net] net: ethernet: mtk_eth_soc: avoid creating duplicate offload entries
@ 2021-09-22 23:55 ` Ilya Lipnitskiy
  0 siblings, 0 replies; 6+ messages in thread
From: Ilya Lipnitskiy @ 2021-09-22 23:55 UTC (permalink / raw)
  To: Felix Fietkau, John Crispin, Sean Wang, Mark Lee,
	David S. Miller, Jakub Kicinski, Matthias Brugger,
	Pablo Neira Ayuso, netdev, linux-arm-kernel, linux-mediatek,
	linux-kernel
  Cc: Ilya Lipnitskiy

From: Felix Fietkau <nbd@nbd.name>

Sometimes multiple CLS_REPLACE calls are issued for the same connection.
rhashtable_insert_fast does not check for these duplicates, so multiple
hardware flow entries can be created.
Fix this by checking for an existing entry early

Fixes: 502e84e2382d ("net: ethernet: mtk_eth_soc: add flow offloading support")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
---
 drivers/net/ethernet/mediatek/mtk_ppe_offload.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
index b5f68f66d42a..7bb1f20002b5 100644
--- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
+++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
@@ -186,6 +186,9 @@ mtk_flow_offload_replace(struct mtk_eth *eth, struct flow_cls_offload *f)
 	int hash;
 	int i;
 
+	if (rhashtable_lookup(&eth->flow_table, &f->cookie, mtk_flow_ht_params))
+		return -EEXIST;
+
 	if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_META)) {
 		struct flow_match_meta match;
 
-- 
2.33.0


_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH net] net: ethernet: mtk_eth_soc: avoid creating duplicate offload entries
@ 2021-09-22 23:55 ` Ilya Lipnitskiy
  0 siblings, 0 replies; 6+ messages in thread
From: Ilya Lipnitskiy @ 2021-09-22 23:55 UTC (permalink / raw)
  To: Felix Fietkau, John Crispin, Sean Wang, Mark Lee,
	David S. Miller, Jakub Kicinski, Matthias Brugger,
	Pablo Neira Ayuso, netdev, linux-arm-kernel, linux-mediatek,
	linux-kernel
  Cc: Ilya Lipnitskiy

From: Felix Fietkau <nbd@nbd.name>

Sometimes multiple CLS_REPLACE calls are issued for the same connection.
rhashtable_insert_fast does not check for these duplicates, so multiple
hardware flow entries can be created.
Fix this by checking for an existing entry early

Fixes: 502e84e2382d ("net: ethernet: mtk_eth_soc: add flow offloading support")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
---
 drivers/net/ethernet/mediatek/mtk_ppe_offload.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
index b5f68f66d42a..7bb1f20002b5 100644
--- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
+++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
@@ -186,6 +186,9 @@ mtk_flow_offload_replace(struct mtk_eth *eth, struct flow_cls_offload *f)
 	int hash;
 	int i;
 
+	if (rhashtable_lookup(&eth->flow_table, &f->cookie, mtk_flow_ht_params))
+		return -EEXIST;
+
 	if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_META)) {
 		struct flow_match_meta match;
 
-- 
2.33.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH net] net: ethernet: mtk_eth_soc: avoid creating duplicate offload entries
  2021-09-22 23:55 ` Ilya Lipnitskiy
  (?)
@ 2021-09-23 12:20   ` patchwork-bot+netdevbpf
  -1 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-09-23 12:20 UTC (permalink / raw)
  To: Ilya Lipnitskiy
  Cc: nbd, john, sean.wang, Mark-MC.Lee, davem, kuba, matthias.bgg,
	pablo, netdev, linux-arm-kernel, linux-mediatek, linux-kernel

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Wed, 22 Sep 2021 16:55:48 -0700 you wrote:
> From: Felix Fietkau <nbd@nbd.name>
> 
> Sometimes multiple CLS_REPLACE calls are issued for the same connection.
> rhashtable_insert_fast does not check for these duplicates, so multiple
> hardware flow entries can be created.
> Fix this by checking for an existing entry early
> 
> [...]

Here is the summary with links:
  - [net] net: ethernet: mtk_eth_soc: avoid creating duplicate offload entries
    https://git.kernel.org/netdev/net/c/e68daf61ed13

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] 6+ messages in thread

* Re: [PATCH net] net: ethernet: mtk_eth_soc: avoid creating duplicate offload entries
@ 2021-09-23 12:20   ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-09-23 12:20 UTC (permalink / raw)
  To: Ilya Lipnitskiy
  Cc: nbd, john, sean.wang, Mark-MC.Lee, davem, kuba, matthias.bgg,
	pablo, netdev, linux-arm-kernel, linux-mediatek, linux-kernel

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Wed, 22 Sep 2021 16:55:48 -0700 you wrote:
> From: Felix Fietkau <nbd@nbd.name>
> 
> Sometimes multiple CLS_REPLACE calls are issued for the same connection.
> rhashtable_insert_fast does not check for these duplicates, so multiple
> hardware flow entries can be created.
> Fix this by checking for an existing entry early
> 
> [...]

Here is the summary with links:
  - [net] net: ethernet: mtk_eth_soc: avoid creating duplicate offload entries
    https://git.kernel.org/netdev/net/c/e68daf61ed13

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net] net: ethernet: mtk_eth_soc: avoid creating duplicate offload entries
@ 2021-09-23 12:20   ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-09-23 12:20 UTC (permalink / raw)
  To: Ilya Lipnitskiy
  Cc: nbd, john, sean.wang, Mark-MC.Lee, davem, kuba, matthias.bgg,
	pablo, netdev, linux-arm-kernel, linux-mediatek, linux-kernel

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Wed, 22 Sep 2021 16:55:48 -0700 you wrote:
> From: Felix Fietkau <nbd@nbd.name>
> 
> Sometimes multiple CLS_REPLACE calls are issued for the same connection.
> rhashtable_insert_fast does not check for these duplicates, so multiple
> hardware flow entries can be created.
> Fix this by checking for an existing entry early
> 
> [...]

Here is the summary with links:
  - [net] net: ethernet: mtk_eth_soc: avoid creating duplicate offload entries
    https://git.kernel.org/netdev/net/c/e68daf61ed13

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-09-23 12:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-22 23:55 [PATCH net] net: ethernet: mtk_eth_soc: avoid creating duplicate offload entries Ilya Lipnitskiy
2021-09-22 23:55 ` Ilya Lipnitskiy
2021-09-22 23:55 ` Ilya Lipnitskiy
2021-09-23 12:20 ` patchwork-bot+netdevbpf
2021-09-23 12:20   ` patchwork-bot+netdevbpf
2021-09-23 12:20   ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.