• V
    net: dsa: calculate the largest_mtu across all ports in the tree · 4e4ab795
    Vladimir Oltean 提交于
    If we have a cross-chip topology like this:
    
       sw0p0     sw0p1     sw0p2     sw0p3     sw0p4
    [  cpu  ] [  user ] [  user ] [  dsa  ] [  user ]
                                      |
                                      +---------+
                                                |
       sw1p0     sw1p1     sw1p2     sw1p3     sw1p4
    [  user ] [  user ] [  user ] [  dsa  ] [  dsa  ]
    
    and we issue the following commands:
    
    1. ip link set sw0p1 mtu 1700
    2. ip link set sw1p1 mtu 1600
    
    we notice the following happening:
    
    Command 1. emits a non-targeted MTU notifier for the CPU port (sw0p0)
    with the largest_mtu calculated across switch 0, of 1700. This matches
    sw0p0, sw0p3 and sw1p4 (all CPU ports and DSA links).
    Then, it emits a targeted MTU notifier for the user port (sw0p1), again
    with MTU 1700 (this doesn't matter).
    
    Command 2. emits a non-targeted MTU notifier for the CPU port (sw0p0)
    with the largest_mtu calculated across switch 1, of 1600. This matches
    the same group of ports as above, and decreases the MTU for the CPU port
    and the DSA links from 1700 to 1600.
    
    As a result, the sw0p1 user port can no longer communicate with its CPU
    port at MTU 1700.
    
    To address this, we should calculate the largest_mtu across all switches
    that may share a CPU port, and only emit MTU notifiers with that value.
    Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
    Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: NDavid S. Miller <davem@davemloft.net>
    4e4ab795
slave.c 61.3 KB