|
| 1 | +From cd8e1f340c3e571b78952d4ca2c128d183a47cc2 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Daniel Golle < [email protected]> |
| 3 | +Date: Wed, 28 Sep 2022 02:17:02 +0100 |
| 4 | +Subject: [PATCH] net: ethernet: mtk_eth_soc: fix state in |
| 5 | + __mtk_foe_entry_clear |
| 6 | + |
| 7 | + |
| 8 | + Lorenzo Bianconi < [email protected]> |
| 9 | +Cc: Sujuan Chen < [email protected]>, |
| 10 | + |
| 11 | + Felix Fietkau < [email protected]>, |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + David S. Miller < [email protected]>, |
| 16 | + |
| 17 | + Jakub Kicinski < [email protected]>, |
| 18 | + |
| 19 | + Matthias Brugger < [email protected]>, |
| 20 | + Chen Minqiang < [email protected]>, |
| 21 | + |
| 22 | + |
| 23 | +Setting ib1 state to MTK_FOE_STATE_UNBIND in __mtk_foe_entry_clear |
| 24 | +routine as done by commit 0e80707d94e4c8 ("net: ethernet: mtk_eth_soc: |
| 25 | +fix typo in __mtk_foe_entry_clear") breaks flow offloading, at least |
| 26 | +on older MTK_NETSYS_V1 SoCs, OpenWrt users have confirmed the bug on |
| 27 | +MT7622 and MT7621 systems. |
| 28 | +Felix Fietkau suggested to use MTK_FOE_STATE_INVALID instead which |
| 29 | +works well on both, MTK_NETSYS_V1 and MTK_NETSYS_V2. |
| 30 | + |
| 31 | +Tested on MT7622 (Linksys E8450) and MT7986 (BananaPi BPI-R3). |
| 32 | + |
| 33 | +Suggested-by: Felix Fietkau < [email protected]> |
| 34 | +Fixes: 0e80707d94e4c8 ("net: ethernet: mtk_eth_soc: fix typo in __mtk_foe_entry_clear") |
| 35 | +Fixes: 33fc42de33278 ("net: ethernet: mtk_eth_soc: support creating mac address based offload entries") |
| 36 | +Signed-off-by: Daniel Golle < [email protected]> |
| 37 | +--- |
| 38 | + drivers/net/ethernet/mediatek/mtk_ppe.c | 2 +- |
| 39 | + 1 file changed, 1 insertion(+), 1 deletion(-) |
| 40 | + |
| 41 | +--- a/drivers/net/ethernet/mediatek/mtk_ppe.c |
| 42 | ++++ b/drivers/net/ethernet/mediatek/mtk_ppe.c |
| 43 | +@@ -442,7 +442,7 @@ __mtk_foe_entry_clear(struct mtk_ppe *pp |
| 44 | + struct mtk_foe_entry *hwe = mtk_foe_get_entry(ppe, entry->hash); |
| 45 | + |
| 46 | + hwe->ib1 &= ~MTK_FOE_IB1_STATE; |
| 47 | +- hwe->ib1 |= FIELD_PREP(MTK_FOE_IB1_STATE, MTK_FOE_STATE_UNBIND); |
| 48 | ++ hwe->ib1 |= FIELD_PREP(MTK_FOE_IB1_STATE, MTK_FOE_STATE_INVALID); |
| 49 | + dma_wmb(); |
| 50 | + } |
| 51 | + entry->hash = 0xffff; |
0 commit comments