• Felix Fietkau's avatar
    net: ethernet: mtk_eth_soc: rework hardware flow table management · c4f033d9
    Felix Fietkau authored
    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: default avatarFelix Fietkau <nbd@nbd.name>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    c4f033d9
mtk_eth_soc.c 82.7 KB