• Vladimir Oltean's avatar
    net: mscc: ocelot: don't use NPI tag prefix for the CPU port module · cacea62f
    Vladimir Oltean authored
    Context: Ocelot switches put the injection/extraction frame header in
    front of the Ethernet header. When used in NPI mode, a DSA master would
    see junk instead of the destination MAC address, and it would most
    likely drop the packets. So the Ocelot frame header can have an optional
    prefix, which is just "ff:ff:ff:ff:ff:fe > ff:ff:ff:ff:ff:ff" padding
    put before the actual tag (still before the real Ethernet header) such
    that the DSA master thinks it's looking at a broadcast frame with a
    strange EtherType.
    
    Unfortunately, a lesson learned in commit 69df578c ("net: mscc:
    ocelot: eliminate confusion between CPU and NPI port") seems to have
    been forgotten in the meanwhile.
    
    The CPU port module and the NPI port have independent settings for the
    length of the tag prefix. However, the driver is using the same variable
    to program both of them.
    
    There is no reason really to use any tag prefix with the CPU port
    module, since that is not connected to any Ethernet port. So this patch
    makes the inj_prefix and xtr_prefix variables apply only to the NPI
    port (which the switchdev ocelot_vsc7514 driver does not use).
    Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    cacea62f
ocelot.c 44.6 KB