1. 13 4月, 2022 3 次提交
  2. 18 3月, 2022 3 次提交
    • T
      net: bridge: mst: Support setting and reporting MST port states · 122c2948
      Tobias Waldekranz 提交于
      Make it possible to change the port state in a given MSTI by extending
      the bridge port netlink interface (RTM_SETLINK on PF_BRIDGE).The
      proposed iproute2 interface would be:
      
          bridge mst set dev <PORT> msti <MSTI> state <STATE>
      
      Current states in all applicable MSTIs can also be dumped via a
      corresponding RTM_GETLINK. The proposed iproute interface looks like
      this:
      
      $ bridge mst
      port              msti
      vb1               0
      		    state forwarding
      		  100
      		    state disabled
      vb2               0
      		    state forwarding
      		  100
      		    state forwarding
      
      The preexisting per-VLAN states are still valid in the MST
      mode (although they are read-only), and can be queried as usual if one
      is interested in knowing a particular VLAN's state without having to
      care about the VID to MSTI mapping (in this example VLAN 20 and 30 are
      bound to MSTI 100):
      
      $ bridge -d vlan
      port              vlan-id
      vb1               10
      		    state forwarding mcast_router 1
      		  20
      		    state disabled mcast_router 1
      		  30
      		    state disabled mcast_router 1
      		  40
      		    state forwarding mcast_router 1
      vb2               10
      		    state forwarding mcast_router 1
      		  20
      		    state forwarding mcast_router 1
      		  30
      		    state forwarding mcast_router 1
      		  40
      		    state forwarding mcast_router 1
      Signed-off-by: NTobias Waldekranz <tobias@waldekranz.com>
      Acked-by: NNikolay Aleksandrov <razor@blackwall.org>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      122c2948
    • T
      net: bridge: mst: Allow changing a VLAN's MSTI · 8c678d60
      Tobias Waldekranz 提交于
      Allow a VLAN to move out of the CST (MSTI 0), to an independent tree.
      
      The user manages the VID to MSTI mappings via a global VLAN
      setting. The proposed iproute2 interface would be:
      
          bridge vlan global set dev br0 vid <VID> msti <MSTI>
      
      Changing the state in non-zero MSTIs is still not supported, but will
      be addressed in upcoming changes.
      Signed-off-by: NTobias Waldekranz <tobias@waldekranz.com>
      Acked-by: NNikolay Aleksandrov <razor@blackwall.org>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      8c678d60
    • T
      net: bridge: mst: Multiple Spanning Tree (MST) mode · ec7328b5
      Tobias Waldekranz 提交于
      Allow the user to switch from the current per-VLAN STP mode to an MST
      mode.
      
      Up to this point, per-VLAN STP states where always isolated from each
      other. This is in contrast to the MSTP standard (802.1Q-2018, Clause
      13.5), where VLANs are grouped into MST instances (MSTIs), and the
      state is managed on a per-MSTI level, rather that at the per-VLAN
      level.
      
      Perhaps due to the prevalence of the standard, many switching ASICs
      are built after the same model. Therefore, add a corresponding MST
      mode to the bridge, which we can later add offloading support for in a
      straight-forward way.
      
      For now, all VLANs are fixed to MSTI 0, also called the Common
      Spanning Tree (CST). That is, all VLANs will follow the port-global
      state.
      
      Upcoming changes will make this actually useful by allowing VLANs to
      be mapped to arbitrary MSTIs and allow individual MSTI states to be
      changed.
      Signed-off-by: NTobias Waldekranz <tobias@waldekranz.com>
      Acked-by: NNikolay Aleksandrov <razor@blackwall.org>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      ec7328b5
  3. 16 2月, 2022 1 次提交
    • V
      net: bridge: switchdev: differentiate new VLANs from changed ones · 8d23a54f
      Vladimir Oltean 提交于
      br_switchdev_port_vlan_add() currently emits a SWITCHDEV_PORT_OBJ_ADD
      event with a SWITCHDEV_OBJ_ID_PORT_VLAN for 2 distinct cases:
      
      - a struct net_bridge_vlan got created
      - an existing struct net_bridge_vlan was modified
      
      This makes it impossible for switchdev drivers to properly balance
      PORT_OBJ_ADD with PORT_OBJ_DEL events, so if we want to allow that to
      happen, we must provide a way for drivers to distinguish between a
      VLAN with changed flags and a new one.
      
      Annotate struct switchdev_obj_port_vlan with a "bool changed" that
      distinguishes the 2 cases above.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8d23a54f
  4. 30 12月, 2021 3 次提交
  5. 08 12月, 2021 1 次提交
  6. 30 10月, 2021 1 次提交
  7. 29 10月, 2021 4 次提交
  8. 27 10月, 2021 2 次提交
  9. 16 10月, 2021 1 次提交
    • N
      net: bridge: mcast: use multicast_membership_interval for IGMPv3 · fac3cb82
      Nikolay Aleksandrov 提交于
      When I added IGMPv3 support I decided to follow the RFC for computing
      the GMI dynamically:
      " 8.4. Group Membership Interval
      
         The Group Membership Interval is the amount of time that must pass
         before a multicast router decides there are no more members of a
         group or a particular source on a network.
      
         This value MUST be ((the Robustness Variable) times (the Query
         Interval)) plus (one Query Response Interval)."
      
      But that actually is inconsistent with how the bridge used to compute it
      for IGMPv2, where it was user-configurable that has a correct default value
      but it is up to user-space to maintain it. This would make it consistent
      with the other timer values which are also maintained correct by the user
      instead of being dynamically computed. It also changes back to the previous
      user-expected GMI behaviour for IGMPv3 queries which were supported before
      IGMPv3 was added. Note that to properly compute it dynamically we would
      need to add support for "Robustness Variable" which is currently missing.
      Reported-by: NHangbin Liu <liuhangbin@gmail.com>
      Fixes: 0436862e ("net: bridge: mcast: support for IGMPv3/MLDv2 ALLOW_NEW_SOURCES report")
      Signed-off-by: NNikolay Aleksandrov <nikolay@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fac3cb82
  10. 29 9月, 2021 1 次提交
  11. 20 8月, 2021 2 次提交
  12. 17 8月, 2021 2 次提交
  13. 14 8月, 2021 3 次提交
    • N
      net: bridge: mcast: dump ipv4 querier state · c7fa1d9b
      Nikolay Aleksandrov 提交于
      Add support for dumping global IPv4 querier state, we dump the state
      only if our own querier is enabled or there has been another external
      querier which has won the election. For the bridge global state we use
      a new attribute IFLA_BR_MCAST_QUERIER_STATE and embed the state inside.
      The structure is:
       [IFLA_BR_MCAST_QUERIER_STATE]
        `[BRIDGE_QUERIER_IP_ADDRESS] - ip address of the querier
        `[BRIDGE_QUERIER_IP_PORT]    - bridge port ifindex where the querier was
                                       seen (set only if external querier)
        `[BRIDGE_QUERIER_IP_OTHER_TIMER]   -  other querier timeout
      Signed-off-by: NNikolay Aleksandrov <nikolay@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c7fa1d9b
    • N
      net: bridge: mcast: make sure querier port/address updates are consistent · 67b746f9
      Nikolay Aleksandrov 提交于
      Use a sequence counter to make sure port/address updates can be read
      consistently without requiring the bridge multicast_lock. We need to
      zero out the port and address when the other querier has expired and
      we're about to select ourselves as querier. br_multicast_read_querier
      will be used later when dumping querier state. Updates are done only
      with the multicast spinlock and softirqs disabled, while reads are done
      from process context and from softirqs (due to notifications).
      Signed-off-by: NNikolay Aleksandrov <nikolay@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      67b746f9
    • N
      net: bridge: mcast: record querier port device ifindex instead of pointer · bb18ef8e
      Nikolay Aleksandrov 提交于
      Currently when a querier port is detected its net_bridge_port pointer is
      recorded, but it's used only for comparisons so it's fine to have stale
      pointer, in order to dereference and use the port pointer a proper
      accounting of its usage must be implemented adding unnecessary
      complexity. To solve the problem we can just store the netdevice ifindex
      instead of the port pointer and retrieve the bridge port. It is a best
      effort and the device needs to be validated that is still part of that
      bridge before use, but that is small price to pay for avoiding querier
      reference counting for each port/vlan.
      Signed-off-by: NNikolay Aleksandrov <nikolay@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bb18ef8e
  14. 11 8月, 2021 13 次提交