1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Thu, 8 Jul 2021 07:08:29 +0200
3 Subject: [PATCH] net: ethernet: mtk_eth_soc: avoid creating duplicate offload
6 Sometimes multiple CLS_REPLACE calls are issued for the same connection.
7 rhashtable_insert_fast does not check for these duplicates, so multiple
8 hardware flow entries can be created.
9 Fix this by checking for an existing entry early
11 Fixes: 502e84e2382d ("net: ethernet: mtk_eth_soc: add flow offloading support")
12 Signed-off-by: Felix Fietkau <nbd@nbd.name>
15 --- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
16 +++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
17 @@ -187,6 +187,9 @@ mtk_flow_offload_replace(struct mtk_eth
21 + if (rhashtable_lookup(ð->flow_table, &f->cookie, mtk_flow_ht_params))
24 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_META)) {
25 struct flow_match_meta match;