• Vladimir Oltean's avatar
    net: dsa: felix: enable cut-through forwarding between ports by default · 8abe1970
    Vladimir Oltean authored
    The VSC9959 switch embedded within NXP LS1028A (and that version of
    Ocelot switches only) supports cut-through forwarding - meaning it can
    start the process of looking up the destination ports for a packet, and
    forward towards those ports, before the entire packet has been received
    (as opposed to the store-and-forward mode).
    
    The up side is having lower forwarding latency for large packets. The
    down side is that frames with FCS errors are forwarded instead of being
    dropped. However, erroneous frames do not result in incorrect updates of
    the FDB or incorrect policer updates, since these processes are deferred
    inside the switch to the end of frame. Since the switch starts the
    cut-through forwarding process after all packet headers (including IP,
    if any) have been processed, packets with large headers and small
    payload do not see the benefit of lower forwarding latency.
    
    There are two cases that need special attention.
    
    The first is when a packet is multicast (or flooded) to multiple
    destinations, one of which doesn't have cut-through forwarding enabled.
    The switch deals with this automatically by disabling cut-through
    forwarding for the frame towards all destination ports.
    
    The second is when a packet is forwarded from a port of lower link speed
    towards a port of higher link speed. This is not handled by the hardware
    and needs software intervention.
    
    Since we practically need to update the cut-through forwarding domain
    from paths that aren't serialized by the rtnl_mutex (phylink
    mac_link_down/mac_link_up ops), this means we need to serialize physical
    link events with user space updates of bonding/bridging domains.
    
    Enabling cut-through forwarding is done per {egress port, traffic class}.
    I don't see any reason why this would be a configurable option as long
    as it works without issues, and there doesn't appear to be any user
    space configuration tool to toggle this on/off, so this patch enables
    cut-through forwarding on all eligible ports and traffic classes.
    Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Link: https://lore.kernel.org/r/20211125125808.2383984-2-vladimir.oltean@nxp.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    8abe1970
felix_vsc9959.c 68 KB