]> git.baikalelectronics.ru Git - kernel.git/commit
net: ethernet: mtk_eth_soc: avoid creating duplicate offload entries
authorFelix Fietkau <nbd@nbd.name>
Wed, 22 Sep 2021 23:55:48 +0000 (16:55 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 23 Sep 2021 12:14:19 +0000 (13:14 +0100)
commit172e2ac6f4fa012d7fa2ae8384b4e7a47882aee2
tree7a132333e80fa09ee2e2dd02edacc5b228ae79c6
parent442e2f246794bce85a326ccac9517d3751672cf7
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: f00009ff5a32 ("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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mediatek/mtk_ppe_offload.c