• Vladimir Oltean's avatar
    net: mscc: ocelot: don't hardcode the number of the CPU port · c9d2203b
    Vladimir Oltean authored
    VSC7514 is a 10-port switch with 2 extra "CPU ports" (targets in the
    queuing subsystem for terminating traffic locally).
    
    There are 2 issues with hardcoding the CPU port as #10:
    - It is not clear which snippets of the code are configuring something
      for one of the CPU ports, and which snippets are just doing something
      related to the number of physical ports.
    - Actually any physical port can act as a CPU port connected to an
      external CPU (in addition to the local CPU). This is called NPI mode
      (Node Processor Interface) and is the way that the 6-port VSC9959
      (Felix) switch is integrated inside NXP LS1028A (the "local management
      CPU" functionality is not used there).
    
    This patch makes it clear that the ocelot_bridge_stp_state_set function
    operates on the CPU port (by making it an implicit member of the
    bridging domain), and at the same time adds logic for the NPI port (aka
    a physical port) to play the role of a CPU port (it shouldn't be part of
    bridge_fwd_mask, as it's not explicitly enslaved to a bridge).
    Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    c9d2203b
ocelot.c 64.3 KB