提交 e68daf61 编写于 作者: F Felix Fietkau 提交者: David S. Miller

net: ethernet: mtk_eth_soc: avoid creating duplicate offload entries

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: 502e84e2 ("net: ethernet: mtk_eth_soc: add flow offloading support")
Signed-off-by: NFelix Fietkau <nbd@nbd.name>
Signed-off-by: NIlya Lipnitskiy <ilya.lipnitskiy@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 31339440
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册