Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
  1. Oct 18, 2018
  2. Oct 17, 2018
    • David S. Miller's avatar
      Merge branch 'mlxsw-Add-VxLAN-support' · 53e50a6e
      David S. Miller authored
      
      Ido Schimmel says:
      
      ====================
      mlxsw: Add VxLAN support
      
      This patchset adds support for VxLAN offload in the mlxsw driver.
      
      With regards to the forwarding plane, VxLAN support is composed from two
      main parts: Encapsulation and decapsulation.
      
      In the device, NVE encapsulation (and VxLAN in particular) takes place
      in the bridge. A packet can be encapsulated using VxLAN either because
      it hit an FDB entry that forwards it to the router with the IP of the
      remote VTEP or because it was flooded, in which case it is sent to a
      list of remote VTEPs (in addition to local ports). In either case, the
      VNI is derived from the filtering identifier (FID) the packet was
      classified to at ingress and the underlay source IP is taken from a
      device global configuration.
      
      VxLAN decapsulation takes place in the underlay router, where packets
      that hit a local route that corresponds to the source IP of the local
      VTEP are decapsulated and injected to the bridge. The packets are
      classified to a FID based on the VNI they came with.
      
      The first six patches export the required APIs in the VxLAN and mlxsw
      drivers in order to allow for the introduction of the NVE core in the
      next two patches. The NVE core is designed to support a variety of NVE
      encapsulations (e.g., VxLAN, NVGRE) and different ASICs, but currently
      only VxLAN and Spectrum are supported. Spectrum-2 support will be added
      in the future.
      
      The last 10 patches add support for VxLAN decapsulation and
      encapsulation and include the addition of the required switchdev APIs in
      the VxLAN driver. These APIs allow capable drivers to get a notification
      about the addition / deletion of FDB entries to / from the VxLAN's FDB.
      
      Subsequent patchset will add selftests (generic and mlxsw-specific),
      data plane learning, FDB extack and vetoing and support for VLAN-aware
      bridges (one VNI per VxLAN device model).
      
      v2:
      * Implement netif_is_vxlan() using rtnl_link_ops->kind (Jakub & Stephen)
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      53e50a6e
    • Ido Schimmel's avatar
      mlxsw: spectrum_switchdev: Add support for VxLAN encapsulation · 1231e04f
      Ido Schimmel authored
      
      In the device, VxLAN encapsulation takes place in the FDB table where
      certain {MAC, FID} entries are programmed with an underlay unicast IP.
      MAC addresses that are not programmed in the FDB are flooded to the
      relevant local ports and also to a list of underlay unicast IPs that are
      programmed using the all zeros MAC address in the VxLAN driver.
      
      One difference between the hardware and software data paths is the fact
      that in the software data path there are two FDB lookups prior to the
      encapsulation of the packet. First in the bridge's FDB table using {MAC,
      VID} and another in the VxLAN's FDB table using {MAC, VNI}.
      
      Therefore, when a new VxLAN FDB entry is notified, it is only programmed
      to the device if there is a corresponding entry in the bridge's FDB
      table. Similarly, when a new bridge FDB entry pointing to the VxLAN
      device is notified, it is only programmed to the device if there is a
      corresponding entry in the VxLAN's FDB table.
      
      Note that the above scheme will result in a discrepancy between both
      data paths if only one FDB table is populated in the software data path.
      For example, if only the bridge's FDB is populated with an entry
      pointing to a VxLAN device, then a packet hitting the entry will only be
      flooded by the kernel to remote VTEPs whereas the device will also flood
      the packets to other local ports member in the VLAN.
      
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Reviewed-by: default avatarPetr Machata <petrm@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1231e04f
    • Ido Schimmel's avatar
      mlxsw: spectrum: Enable VxLAN enslavement to bridges · 1c30d183
      Ido Schimmel authored
      
      Enslavement of VxLAN devices to offloaded bridges was never forbidden by
      mlxsw, but this patch makes sure the required configuration is performed
      in order to allow VxLAN encapsulation and decapsulation to take place in
      the device.
      
      The patch handles both the case where a VxLAN device is enslaved to an
      already offloaded bridge and the case where the first mlxsw port is
      enslaved to a bridge that already has VxLAN device configured.
      
      Invalid configurations are sanitized and an error string is returned via
      extack.
      
      Since encapsulation and decapsulation do not occur when the VxLAN device
      is down, the driver makes sure to enable / disable these functionalities
      based on NETDEV_PRE_UP and NETDEV_DOWN events.
      
      Note that NETDEV_PRE_UP is used in favor of NETDEV_UP, as the former
      allows to veto the operation, if necessary.
      
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Reviewed-by: default avatarPetr Machata <petrm@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1c30d183
    • Ido Schimmel's avatar
      bridge: switchdev: Allow clearing FDB entry offload indication · e9ba0fbc
      Ido Schimmel authored
      
      Currently, an FDB entry only ceases being offloaded when it is deleted.
      This changes with VxLAN encapsulation.
      
      Devices capable of performing VxLAN encapsulation usually have only one
      FDB table, unlike the software data path which has two - one in the
      bridge driver and another in the VxLAN driver.
      
      Therefore, bridge FDB entries pointing to a VxLAN device are only
      offloaded if there is a corresponding entry in the VxLAN FDB.
      
      Allow clearing the offload indication in case the corresponding entry
      was deleted from the VxLAN FDB.
      
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Reviewed-by: default avatarPetr Machata <petrm@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e9ba0fbc
    • Petr Machata's avatar
      vxlan: Notify for each remote of a removed FDB entry · 045a5a99
      Petr Machata authored
      
      When notifications are sent about FDB activity, and an FDB entry with
      several remotes is removed, the notification is sent only for the first
      destination. That makes it impossible to distinguish between the case
      where only this first remote is removed, and the one where the FDB entry
      is removed as a whole.
      
      Therefore send one notification for each remote of a removed FDB entry.
      
      Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      045a5a99
    • Petr Machata's avatar
      vxlan: Support marking RDSTs as offloaded · 0efe1173
      Petr Machata authored
      
      Offloaded bridge FDB entries are marked with NTF_OFFLOADED. Implement a
      similar mechanism for VXLAN, where a given remote destination can be
      marked as offloaded.
      
      To that end, introduce a new event, SWITCHDEV_VXLAN_FDB_OFFLOADED,
      through which the marking is communicated to the vxlan driver. To
      identify which RDST should be marked as offloaded, an
      switchdev_notifier_vxlan_fdb_info is passed to the listeners. The
      "offloaded" flag in that object determines whether the offloaded mark
      should be set or cleared.
      
      When sending offloaded FDB entries over netlink, mark them with
      NTF_OFFLOADED.
      
      Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0efe1173