* [PATCH net] net: airoha: ppe: Do not invalid PPE entries in case of SW hash collision
@ 2025-08-18 9:58 Lorenzo Bianconi
2025-08-21 9:40 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Lorenzo Bianconi @ 2025-08-18 9:58 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Michal Kubiak
Cc: linux-arm-kernel, linux-mediatek, netdev, Lorenzo Bianconi
SW hash computed by airoha_ppe_foe_get_entry_hash routine (used for
foe_flow hlist) can theoretically produce collisions between two
different HW PPE entries.
In airoha_ppe_foe_insert_entry() if the collision occurs we will mark
the second PPE entry in the list as stale (setting the hw hash to 0xffff).
Stale entries are no more updated in airoha_ppe_foe_flow_entry_update
routine and so they are removed by Netfilter.
Fix the problem not marking the second entry as stale in
airoha_ppe_foe_insert_entry routine if we have already inserted the
brand new entry in the PPE table and let Netfilter remove real stale
entries according to their timestamp.
Please note this is just a theoretical issue spotted reviewing the code
and not faced running the system.
Fixes: cd53f622611f9 ("net: airoha: Add L2 hw acceleration support")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
drivers/net/ethernet/airoha/airoha_ppe.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/airoha/airoha_ppe.c b/drivers/net/ethernet/airoha/airoha_ppe.c
index 47411d2cbd2803c0a448243fb3e92b32d9179bd8..88694b08afa1ce232b34c64f605a151aed137b6d 100644
--- a/drivers/net/ethernet/airoha/airoha_ppe.c
+++ b/drivers/net/ethernet/airoha/airoha_ppe.c
@@ -736,10 +736,8 @@ static void airoha_ppe_foe_insert_entry(struct airoha_ppe *ppe,
continue;
}
- if (commit_done || !airoha_ppe_foe_compare_entry(e, hwe)) {
- e->hash = 0xffff;
+ if (!airoha_ppe_foe_compare_entry(e, hwe))
continue;
- }
airoha_ppe_foe_commit_entry(ppe, &e->data, hash);
commit_done = true;
---
base-commit: 715c7a36d59f54162a26fac1d1ed8dc087a24cf1
change-id: 20250818-airoha-en7581-hash-collision-fix-ff24b677d072
Best regards,
--
Lorenzo Bianconi <lorenzo@kernel.org>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] net: airoha: ppe: Do not invalid PPE entries in case of SW hash collision
2025-08-18 9:58 [PATCH net] net: airoha: ppe: Do not invalid PPE entries in case of SW hash collision Lorenzo Bianconi
@ 2025-08-21 9:40 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-08-21 9:40 UTC (permalink / raw)
To: Lorenzo Bianconi
Cc: andrew+netdev, davem, edumazet, kuba, pabeni, michal.kubiak,
linux-arm-kernel, linux-mediatek, netdev
Hello:
This patch was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Mon, 18 Aug 2025 11:58:25 +0200 you wrote:
> SW hash computed by airoha_ppe_foe_get_entry_hash routine (used for
> foe_flow hlist) can theoretically produce collisions between two
> different HW PPE entries.
> In airoha_ppe_foe_insert_entry() if the collision occurs we will mark
> the second PPE entry in the list as stale (setting the hw hash to 0xffff).
> Stale entries are no more updated in airoha_ppe_foe_flow_entry_update
> routine and so they are removed by Netfilter.
> Fix the problem not marking the second entry as stale in
> airoha_ppe_foe_insert_entry routine if we have already inserted the
> brand new entry in the PPE table and let Netfilter remove real stale
> entries according to their timestamp.
> Please note this is just a theoretical issue spotted reviewing the code
> and not faced running the system.
>
> [...]
Here is the summary with links:
- [net] net: airoha: ppe: Do not invalid PPE entries in case of SW hash collision
https://git.kernel.org/netdev/net/c/9f6b606b6b37
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-08-21 13:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-18 9:58 [PATCH net] net: airoha: ppe: Do not invalid PPE entries in case of SW hash collision Lorenzo Bianconi
2025-08-21 9:40 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).