1. 27 5月, 2017 2 次提交
    • I
      mlxsw: spectrum: Replace vPorts with Port-VLAN · c57529e1
      Ido Schimmel 提交于
      As explained in the cover letter, since the introduction of the bridge
      offload in the mlxsw driver, information related to the offloaded bridge
      and bridge ports was stored in the individual port struct,
      mlxsw_sp_port.
      
      This lead to a bloated struct storing both physical properties of the
      port (e.g., autoneg status) as well as logical properties of an upper
      bridge port (e.g., learning, mrouter indication). While this might work
      well for simple devices, it proved to be hard to extend when stacked
      devices were taken into account and more advanced use-cases (e.g., IGMP
      snooping) considered.
      
      This patch removes the excess information from the above struct and
      instead stores it in more appropriate structs that represent the bridge
      port, the bridge itself and a VLAN configured on the bridge port.
      
      The membership of a port in a bridge is denoted using the Port-VLAN
      struct, which points to the bridge port and also member in the bridge
      VLAN group of the VLAN it represents. This allows us to completely
      remove the vPort abstraction and consolidate many of the code paths
      relating to VLAN-aware and unaware bridges.
      
      Note that the FID / vFID code is currently duplicated, but this will
      soon go away when the common FID core will be introduced.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c57529e1
    • I
      mlxsw: spectrum: Set port's mode according to FID mappings · 4aafc368
      Ido Schimmel 提交于
      We currently transition the port to "Virtual mode" upon the creation of
      its first VLAN upper, as we need to classify incoming packets to a FID
      using {Port, VID} and not only the VID.
      
      However, it's more appropriate to transition the port to this mode when
      the {Port, VID} are actually mapped to a FID. Either during the
      enslavement of the VLAN upper to a VLAN-unaware bridge or the
      configuration of a router port.
      
      Do this change now in preparation for the introduction of the FID core,
      where this operation will be encapsulated.
      
      To prevent regressions, this patch also explicitly configures an OVS
      slave to "Virtual mode". Otherwise, a packet that didn't hit an ACL rule
      could be classified to an existing FID based on a global VID-to-FID
      mapping, thus not incurring a FID mis-classification, which would
      otherwise trap the packet to the CPU to be processed by the OVS daemon.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4aafc368
  2. 18 5月, 2017 7 次提交
  3. 21 4月, 2017 1 次提交
  4. 25 3月, 2017 1 次提交
  5. 22 3月, 2017 1 次提交
  6. 11 2月, 2017 6 次提交
  7. 01 11月, 2016 1 次提交
  8. 24 10月, 2016 1 次提交
  9. 28 9月, 2016 1 次提交
  10. 21 9月, 2016 1 次提交
  11. 02 9月, 2016 2 次提交
  12. 25 8月, 2016 6 次提交
  13. 18 8月, 2016 2 次提交
  14. 05 7月, 2016 5 次提交
    • I
      mlxsw: spectrum: Enable L3 interfaces on top of bridge devices · 99f44bb3
      Ido Schimmel 提交于
      As with the previously introduced L3 interfaces, listen to 'inetaddr'
      notifications sent for bridges devices configured on top of the port
      netdevs and create / destroy router interfaces (RIFs) accordingly.
      This also includes VLAN devices configured on top of the VLAN-aware
      bridge.
      
      The RIFs will be destroyed either when the last IP address is removed or
      when the underlying FID is is destroyed.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      99f44bb3
    • I
      mlxsw: spectrum: Configure FIDs based on bridge events · 701b186e
      Ido Schimmel 提交于
      Before introducing support for L3 interfaces on top of the VLAN-aware
      bridge we need to add some missing infrastructure.
      
      Such an interface can either be the bridge device itself or a VLAN
      device on top of it. In the first case the router interface (RIF) is
      associated with FID 1, which is created whenever the first port netdev
      joins the bridge. We currently assume the default PVID is 1 and that
      it's already created, as it seems reasonable. This can be extended in
      the future.
      
      However, in the second case it's entirely possible we've yet to create a
      matching FID. This can happen if the VLAN device was configured before
      making any bridge port member in the VLAN.
      
      Prevent such ordering problems by using the VLAN device's CHANGEUPPER
      event to configure the FID. Make the VLAN device hold a reference to the
      FID and prevent it from being destroyed even if none of the port netdevs
      is using it.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      701b186e
    • I
      mlxsw: spectrum: Introduce support for router interfaces · 99724c18
      Ido Schimmel 提交于
      Up until now we only supported bridged interfaces. Packets ingressing
      through the switch ports were either classified to FIDs (in the case of
      the VLAN-aware bridge) or vFIDs (in the case of VLAN-unaware bridges).
      The packets were then forwarded according to the FDB. Routing was done
      entirely in slowpath, by splitting the vFID range in two and using the
      lower 0.5K vFIDs as dummy bridges that simply flooded all incoming
      traffic to the CPU.
      
      Instead, allow packets to be routed in the device by creating router
      interfaces (RIFs) that will direct them to the router block.
      Specifically, the RIFs introduced here are Sub-port RIFs used for VLAN
      devices and port netdevs. Packets ingressing from the {Port / LAG ID, VID}
      with which the RIF was programmed with will be assigned to a special
      kind of FIDs called rFIDs and from there directed to the router.
      
      Create a RIF whenever the first IPv4 address was programmed on a VLAN /
      LAG / port netdev. Destroy it upon removal of the last IPv4 address.
      Receive these notifications by registering for the 'inetaddr'
      notification chain. A non-zero (10) priority is used for the
      notification block, so that RIFs will be created before routes are
      offloaded via FIB code.
      
      Note that another trigger for RIF destruction are CHANGEUPPER
      notifications causing the underlying FID's reference count to go down to
      zero. This can happen, for example, when a VLAN netdev with an IP address
      is put under bridge. While this configuration doesn't make sense it does
      cause the device and the kernel to get out of sync when the netdev is
      unbridged. We intend to address this in the future, hopefully in current
      cycle.
      
      Finally, Remove the lower 0.5K vFIDs, as they are deprecated by the RIFs,
      which will trap packets according to their DIP.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      99724c18
    • I
      mlxsw: spectrum: Edit RIF properties based on netdev events · 6e095fd4
      Ido Schimmel 提交于
      We are just about to introduce router interfaces (RIFs), but before that
      we need to be able update the device with the correct RIF attributes
      whenever they change for the netdev the RIF is backing. Two such
      attributes are MTU and MAC.
      
      The MAC is used both to set the source MAC of packets egressing from the
      RIF and also to program an FDB rule that will direct packets to the
      router block.
      
      Use the existing netdevice notification block and respond to CHANGEADDR
      and CHANGEMTU accordingly. Store both attributes in the RIF struct
      in case we need to revert to old attributes following a failed update.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6e095fd4
    • J
      mlxsw: spectrum_router: Implement fib4 add/del switchdev obj ops · 61c503f9
      Jiri Pirko 提交于
      Implement ipv4 FIB entries addition and removal. Initially, we support
      local and broadcast routes using "ip2me" trap action.
      Also, unicast routes without nexthop are supported using "local" action.
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Reviewed-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      61c503f9
  15. 03 7月, 2016 1 次提交
  16. 21 6月, 2016 2 次提交
    • I
      mlxsw: spectrum: Add debug prints · 22305378
      Ido Schimmel 提交于
      For debug purposes, it's useful to know the order in which the driver
      responds to changes in the topology of its upper devices.
      
      Add debug prints to signal these events.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      22305378
    • I
      mlxsw: spectrum: Refactor FDB flushing logic · fe3f6d14
      Ido Schimmel 提交于
      FDB entries are learned using {Port / LAG ID, FID} and therefore should
      be flushed whenever a port (vPort) leaves its FID (vFID).
      
      However, when the bridge port is a LAG device (or a VLAN device on top),
      then FDB flushing is conditional. Ports removed from such LAG
      configurations must not trigger flushing, as other ports might still be
      members in the LAG and therefore the bridge port is still active.
      
      The decision whether to flush or not was previously computed in the
      netdevice notification block, but in order to flush the entries when a
      port leaves its FID this decision should be computed there.
      
      Strip the notification block from this logic and instead move it to one
      FDB flushing function that is invoked from both the FID / vFID leave
      functions.
      
      When port isn't member in LAG, FDB flushing should always occur.
      Otherwise, it should occur only when the last port (vPort) member in the
      LAG leaves the FID (vFID).
      
      This will allow us - in the next patch - to simplify the cleanup code
      paths that are hit whenever the topology above the port netdevs changes.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fe3f6d14