]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net: airoha: ppe: Do not invalid PPE entries in case of SW hash collision
authorLorenzo Bianconi <lorenzo@kernel.org>
Mon, 18 Aug 2025 09:58:25 +0000 (11:58 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 21 Aug 2025 09:25:11 +0000 (11:25 +0200)
commit9f6b606b6b37e61427412708411e8e04b1a858e8
tree87a6a3c120a3a34d42a273df983ab3a2bf3520ec
parent184fa9d704bd6b96979ff57eed9e8c51203bec57
net: airoha: ppe: Do not invalid PPE entries in case of SW hash collision

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>
Link: https://patch.msgid.link/20250818-airoha-en7581-hash-collision-fix-v1-1-d190c4b53d1c@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/airoha/airoha_ppe.c