lede/target/linux/generic/pending-5.15/700-net-ethernet-mtk_eth_soc-avoid-creating-duplicate-of.patch
Tianling Shen 8061c8b8f9
mediatek: add support for OpenEmbed SOM7981 (#12524)
* kernel: crypto: add atmel i2c hw accelerator support

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>

* kernel: add led act/polarity select for rtl8221 phy

Signed-off-by: Tianling Shen <cnsztl@gmail.com>

* mediatek: add support for OpenEmbed SOM7981

Hardware specification:
  SoC: MediaTek MT7981B 2x A53
  Flash: 256 MiB SPI-NAND
  RAM: 0.5/1 GB DDR4
  Ethernet: 1x 1GbE, 1x 2.5GbE (RTL8221B)
  WiFi: MediaTek MT7976C
  USB: 1x M.2 B-Key
  GPIO: 26-Pin header
  UART: 6 GND, 8 TX, 10 RX (in Pin header)
  Button: Reset

Installation:
The board comes with a third-party custom OpenWrt image, you can upload
sysupgrade image via LuCI directly WITHOUT keeping configurations.

Or power on the board with pressing reset button for 5 second, then visit
http://192.168.1.1 and upload -factory.bin firmware.

Signed-off-by: Tianling Shen <cnsztl@gmail.com>

---------

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Signed-off-by: Tianling Shen <cnsztl@gmail.com>
2024-10-08 19:42:37 +08:00

27 lines
977 B
Diff

From: Felix Fietkau <nbd@nbd.name>
Date: Thu, 8 Jul 2021 07:08:29 +0200
Subject: [PATCH] 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: 502e84e2382d ("net: ethernet: mtk_eth_soc: add flow offloading support")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
+++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
@@ -255,6 +255,9 @@ mtk_flow_offload_replace(struct mtk_eth
if (rhashtable_lookup(&eth->flow_table, &f->cookie, mtk_flow_ht_params))
return -EEXIST;
+ 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;