net: ethernet: mtk_eth_soc: fix state in __mtk_foe_entry_clear
Subsystems (4)
PATCH 1/1 net: ethernet: mtk_eth_soc: fix state in __mtk_foe_entry_clear
Setting ib1 state to MTK_FOE_STATE_UNBIND in __mtk_foe_entry_clear routine as done by commit 0e80707d94e4c8 ("net: ethernet: mtk_eth_soc:
fix typo in __mtk_foe_entry_clear") breaks flow offloading, at least on older MTK_NETSYS_V1 SoCs; OpenWrt users have confirmed the bug on MT7622 and MT7621 systems.
Felix Fietkau suggested to use MTK_FOE_STATE_INVALID instead which works well on both, MTK_NETSYS_V1 and MTK_NETSYS_V2.
Tested on MT7622 (Linksys E8450) and MT7986 (BananaPi BPI-R3).
--- drivers/net/ethernet/mediatek/mtk_ppe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mediatek/mtk_ppe.c +1 -1
@@ -442,7 +442,7 @@ __mtk_foe_entry_clear(struct mtk_ppe *ppe, struct mtk_flow_entry *entry)struct mtk_foe_entry *hwe =mtk_foe_get_entry (ppe, entry->hash); hwe->ib1 &= ~MTK_FOE_IB1_STATE ; - hwe->ib1 |=FIELD_PREP (MTK_FOE_IB1_STATE ,MTK_FOE_STATE_UNBIND ); + hwe->ib1 |=FIELD_PREP (MTK_FOE_IB1_STATE ,MTK_FOE_STATE_INVALID );dma_wmb (); } entry->hash =0xffff ;
Signature · 1 line
2.37.3
Quoted 8 lines
Setting ib1 state to
MTK_FOE_STATE_UNBINDin__mtk_foe_entry_clearroutine as done by commit0e80707d94e4c8("net: ethernet:mtk_eth_soc:
fix typo in__mtk_foe_entry_clear") breaks flow offloading, at least on olderMTK_NETSYS_V1SoCs; OpenWrt users have confirmed the bug on MT7622 and MT7621 systems.
Felix Fietkau suggested to useMTK_FOE_STATE_INVALIDinstead which works well on both,MTK_NETSYS_V1andMTK_NETSYS_V2.
Quoted 6 lines
Tested on MT7622 (Linksys E8450) and MT7986 (BananaPi BPI-R3).
Suggested-by Felix Fietkau <[email protected]>Fixes 0e80707d94e4c8 ("net: ethernet: mtk_eth_soc: fix typo in __mtk_foe_entry_clear")Fixes 33fc42de33278 ("net: ethernet: mtk_eth_soc: support creating mac address based offload entries")Signed-off-by Daniel Golle <[email protected]>
Quoted 20 lines
--- drivers/net/ethernet/mediatek/mtk_ppe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/mediatek/mtk_ppe.c +1
-1@@ -442,7 +442,7 @@ __mtk_foe_entry_clear(struct mtk_ppe *ppe, struct mtk_flow_entry *entry)struct mtk_foe_entry *hwe =mtk_foe_get_entry (ppe, entry->hash); hwe->ib1 &= ~MTK_FOE_IB1_STATE ; - hwe->ib1 |=FIELD_PREP (MTK_FOE_IB1_STATE ,MTK_FOE_STATE_UNBIND ); + hwe->ib1 |=FIELD_PREP (MTK_FOE_IB1_STATE ,MTK_FOE_STATE_INVALID );dma_wmb (); } entry->hash =0xffff ;Signature · 1 line
2.37.3
Jakub Kicinski
maintainerQuoted 8 lines · On Wed, 28 Sep 2022 02:25:15 +0100 Daniel Golle wrote:
Setting ib1 state to
MTK_FOE_STATE_UNBINDin__mtk_foe_entry_clearroutine as done by commit0e80707d94e4c8("net: ethernet:mtk_eth_soc:
fix typo in__mtk_foe_entry_clear") breaks flow offloading, at least on olderMTK_NETSYS_V1SoCs; OpenWrt users have confirmed the bug on MT7622 and MT7621 systems.
Felix Fietkau suggested to useMTK_FOE_STATE_INVALIDinstead which works well on both,MTK_NETSYS_V1andMTK_NETSYS_V2.
Quoted 6 lines
Tested on MT7622 (Linksys E8450) and MT7986 (BananaPi BPI-R3).
Suggested-by Felix Fietkau <[email protected]>Fixes 0e80707d94e4c8 ("net: ethernet: mtk_eth_soc: fix typo in __mtk_foe_entry_clear")Fixes 33fc42de33278 ("net: ethernet: mtk_eth_soc: support creating mac address based offload entries")Signed-off-by Daniel Golle <[email protected]>
Looks like this patch is generated on top of net-next while it fixes a bug in net (judging by mention of 0e80707d94e4c8). Please rebase on top of net and resent, we'll deal with the conflict.
PATCH v2 1/1 net: ethernet: mtk_eth_soc: fix state in __mtk_foe_entry_clear
Setting ib1 state to MTK_FOE_STATE_UNBIND in __mtk_foe_entry_clear routine as done by commit 0e80707d94e4c8 ("net: ethernet: mtk_eth_soc:
fix typo in __mtk_foe_entry_clear") breaks flow offloading, at least on older MTK_NETSYS_V1 SoCs, OpenWrt users have confirmed the bug on MT7622 and MT7621 systems.
Felix Fietkau suggested to use MTK_FOE_STATE_INVALID instead which works well on both, MTK_NETSYS_V1 and MTK_NETSYS_V2.
Tested on MT7622 (Linksys E8450) and MT7986 (BananaPi BPI-R3).
---
v2: rebased on top of netdev/net.git;main
drivers/net/ethernet/mediatek/mtk_ppe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mediatek/mtk_ppe.c +1 -1
@@ -412,7 +412,7 @@ __mtk_foe_entry_clear(struct mtk_ppe *ppe, struct mtk_flow_entry *entry)if (entry->hash !=0xffff ) { ppe->foe_table[entry->hash].ib1 &= ~MTK_FOE_IB1_STATE ; ppe->foe_table[entry->hash].ib1 |=FIELD_PREP (MTK_FOE_IB1_STATE , -MTK_FOE_STATE_UNBIND ); +MTK_FOE_STATE_INVALID );dma_wmb (); } entry->hash =0xffff ;
Signature · 1 line
2.37.3
This patch was applied to netdev/net.git (master) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (master)
by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Fri, 30 Sep 2022 01:56:53 +0100 you wrote:
Setting ib1 state to
MTK_FOE_STATE_UNBINDin__mtk_foe_entry_clearroutine as done by commit0e80707d94e4c8("net: ethernet:mtk_eth_soc:
fix typo in__mtk_foe_entry_clear") breaks flow offloading, at least on olderMTK_NETSYS_V1SoCs, OpenWrt users have confirmed the bug on MT7622 and MT7621 systems.
Felix Fietkau suggested to useMTK_FOE_STATE_INVALIDinstead which works well on both,MTK_NETSYS_V1andMTK_NETSYS_V2.[...]
Here is the summary with links:
- [v2] net: ethernet: mtk_eth_soc: fix state in __mtk_foe_entry_clear
https://git.kernel.org/netdev/net/c/ae3ed15da588
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
Re: [PATCH v2] net: ethernet: mtk_eth_soc: fix state in __mtk_foe_entry_clear: manual merge
In reply to Daniel GolleHello,
Quoted 8 lines · Daniel Golle
Setting ib1 state to
MTK_FOE_STATE_UNBINDin__mtk_foe_entry_clearroutine as done by commit0e80707d94e4c8("net: ethernet:mtk_eth_soc:
fix typo in__mtk_foe_entry_clear") breaks flow offloading, at least on olderMTK_NETSYS_V1SoCs, OpenWrt users have confirmed the bug on MT7622 and MT7621 systems.
Felix Fietkau suggested to useMTK_FOE_STATE_INVALIDinstead which works well on both,MTK_NETSYS_V1andMTK_NETSYS_V2.
Quoted 8 lines
Tested on MT7622 (Linksys E8450) and MT7986 (BananaPi BPI-R3).
Suggested-by Felix Fietkau <[email protected]>Fixes 0e80707d94e4c8 ("net: ethernet: mtk_eth_soc: fix typo in __mtk_foe_entry_clear")Fixes 33fc42de33278b ("net: ethernet: mtk_eth_soc: support creating mac address based offload entries")Signed-off-by Daniel Golle <[email protected]>---
v2: rebased on top of netdev/net.git;main
FYI and as expected when reading this email thread, we got a small conflict when merging -net in net-next in the MPTCP tree due to this patch applied in -net:
ae3ed15da588 ("net: ethernet: mtk_eth_soc: fix state in__mtk_foe_entry_clear")
and this one from net-next:
9d8cb4c096ab ("net: ethernet: mtk_eth_soc: add foe_entry_size tomtk_eth_soc")
The conflict has been resolved on our side[1] inspired by Daniel's v1. The resolution we suggest is attached to this email.
Cheers,
Matt
[1] https://github.com/multipath-tcp/mptcp_net-next/commit/7af5fac658ba
Signature · 2 lines
Tessares | Belgium | Hybrid Access Solutions www.tessares.net
drivers/net/ethernet/mediatek/mtk_ppe.c +0 -0
@@@ -439,10 -410,9 +439,10 @@@ __mtk_foe_entry_clear(struct mtk_ppe *phlist_del_init (&entry->list);if (entry->hash !=0xffff ) { - ppe->foe_table[entry->hash].ib1 &= ~MTK_FOE_IB1_STATE ; - ppe->foe_table[entry->hash].ib1 |=FIELD_PREP (MTK_FOE_IB1_STATE , -MTK_FOE_STATE_INVALID ); + struct mtk_foe_entry *hwe = mtk_foe_get_entry(ppe, entry->hash); + + hwe->ib1 &= ~MTK_FOE_IB1_STATE ; - hwe->ib1 |=FIELD_PREP (MTK_FOE_IB1_STATE ,MTK_FOE_STATE_UNBIND ); ++ hwe->ib1 |=FIELD_PREP (MTK_FOE_IB1_STATE ,MTK_FOE_STATE_INVALID );dma_wmb (); } entry->hash =0xffff ;
Re: [PATCH v2] net: ethernet: mtk_eth_soc: fix state in __mtk_foe_entry_clear: manual merge
Quoted 27 lines · Matthieu Baerts
Hello,
Quoted 8 lines · Daniel Golle
Setting ib1 state to
MTK_FOE_STATE_UNBINDin__mtk_foe_entry_clearroutine as done by commit0e80707d94e4c8("net: ethernet:mtk_eth_soc:
fix typo in__mtk_foe_entry_clear") breaks flow offloading, at least on olderMTK_NETSYS_V1SoCs, OpenWrt users have confirmed the bug on MT7622 and MT7621 systems.
Felix Fietkau suggested to useMTK_FOE_STATE_INVALIDinstead which works well on both,MTK_NETSYS_V1andMTK_NETSYS_V2.Quoted 8 lines
Tested on MT7622 (Linksys E8450) and MT7986 (BananaPi BPI-R3).
Suggested-by Felix Fietkau <[email protected]>Fixes 0e80707d94e4c8 ("net: ethernet: mtk_eth_soc: fix typo in __mtk_foe_entry_clear")Fixes 33fc42de33278b ("net: ethernet: mtk_eth_soc: support creating mac address based offload entries")Signed-off-by Daniel Golle <[email protected]>---
v2: rebased on top of netdev/net.git;mainFYI and as expected when reading this email thread, we got a small conflict when merging -net in net-next in the MPTCP tree due to this patch applied in -net:
ae3ed15da588("net: ethernet:mtk_eth_soc: fix state in__mtk_foe_entry_clear")
Quoted 7 lines
and this one from net-next:
9d8cb4c096ab("net: ethernet:mtk_eth_soc: addfoe_entry_sizetomtk_eth_soc")The conflict has been resolved on our side[1] inspired by Daniel's v1. The resolution we suggest is attached to this email.
conflict resolution: Acked-by: Daniel Golle <[email protected]>
Quoted 28 lines
Cheers,
Matt[1] https://github.com/multipath-tcp/mptcp_net-next/commit/7af5fac658ba
Signature · 2 lines
Tessares | Belgium | Hybrid Access Solutions www.tessares.netdrivers/net/ethernet/mediatek/mtk_ppe.c +1
-1@@@ -439,10 -410,9 +439,10 @@@ __mtk_foe_entry_clear(struct mtk_ppe *phlist_del_init (&entry->list);if (entry->hash !=0xffff ) { - ppe->foe_table[entry->hash].ib1 &= ~MTK_FOE_IB1_STATE ; - ppe->foe_table[entry->hash].ib1 |=FIELD_PREP (MTK_FOE_IB1_STATE , -MTK_FOE_STATE_INVALID ); + struct mtk_foe_entry *hwe = mtk_foe_get_entry(ppe, entry->hash); + + hwe->ib1 &= ~MTK_FOE_IB1_STATE ; - hwe->ib1 |=FIELD_PREP (MTK_FOE_IB1_STATE ,MTK_FOE_STATE_UNBIND ); ++ hwe->ib1 |=FIELD_PREP (MTK_FOE_IB1_STATE ,MTK_FOE_STATE_INVALID );dma_wmb (); } entry->hash =0xffff ;