OSDN Git Service

net: ethernet: mtk_eth_soc: rework hardware flow table management
authorFelix Fietkau <nbd@nbd.name>
Tue, 5 Apr 2022 19:57:53 +0000 (21:57 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 6 Apr 2022 13:08:50 +0000 (14:08 +0100)
commitc4f033d9e03e99fb024b2300d61e099aa7646bb7
tree2fdab2d16c5e519290ab776533a608d61c0fc286
parent1ccc723b5829d63a29627e1d2de2da84efd037c2
net: ethernet: mtk_eth_soc: rework hardware flow table management

The hardware was designed to handle flow detection and creation of flow entries
by itself, relying on the software primarily for filling in egress routing
information.
When there is a hash collision between multiple flows, this allows the hardware
to maintain the entry for the most active flow.
Additionally, the hardware only keeps offloading active for entries with at
least 30 packets per second.

With this rework, the code no longer creates a hardware entries directly.
Instead, the hardware entry is only created when the PPE reports a matching
unbound flow with the minimum target rate.
In order to reduce CPU overhead, looking for flows belonging to a hash entry
is rate limited to once every 100ms.

This rework is also used as preparation for emulating bridge offload by
managing L4 offload entries on demand.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mediatek/mtk_eth_soc.c
drivers/net/ethernet/mediatek/mtk_ppe.c
drivers/net/ethernet/mediatek/mtk_ppe.h
drivers/net/ethernet/mediatek/mtk_ppe_offload.c