1. 09 1月, 2019 1 次提交
  2. 25 12月, 2018 1 次提交
  3. 21 12月, 2018 7 次提交
  4. 20 12月, 2018 5 次提交
    • I
      mlxsw: spectrum_router: Make RIF deletion more robust · 965fa8e6
      Ido Schimmel 提交于
      In the past we had multiple instances where RIFs were not properly
      deleted.
      
      One of the reasons for leaking a RIF was that at the time when IP
      addresses were flushed from the respective netdev (prompting the
      destruction of the RIF), the netdev was no longer a mlxsw upper. This
      caused the inet{,6}addr notification blocks to ignore the NETDEV_DOWN
      event and leak the RIF.
      
      Instead of checking whether the netdev is our upper when an IP address
      is removed, we can instead check if the netdev has a RIF configured.
      
      To look up a RIF we need to access mlxsw private data, so the patch
      stores the notification blocks inside a mlxsw struct. This then allows
      us to use container_of() and extract the required private data.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Reviewed-by: NPetr Machata <petrm@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      965fa8e6
    • I
      mlxsw: spectrum: Properly cleanup LAG uppers when removing port from LAG · be2d6f42
      Ido Schimmel 提交于
      When a LAG device or a VLAN device on top of it is enslaved to a bridge,
      the driver propagates the CHANGEUPPER event to the LAG's slaves.
      
      This causes each physical port to increase the reference count of the
      internal representation of the bridge port by calling
      mlxsw_sp_port_bridge_join().
      
      However, when a port is removed from a LAG, the corresponding leave()
      function is not called and the reference count is not decremented. This
      leads to ugly hacks such as mlxsw_sp_bridge_port_should_destroy() that
      try to understand if the bridge port should be destroyed even when its
      reference count is not 0.
      
      Instead, make sure that when a port is unlinked from a LAG it would see
      the same events as if the LAG (or its uppers) were unlinked from a
      bridge.
      
      The above is achieved by walking the LAG's uppers when a port is
      unlinked and calling mlxsw_sp_port_bridge_leave() for each upper that is
      enslaved to a bridge.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Reviewed-by: NPetr Machata <petrm@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      be2d6f42
    • I
      mlxsw: spectrum: Remove reference count from VLAN entries · 635c8c8b
      Ido Schimmel 提交于
      Commit b3529af6 ("spectrum: Reference count VLAN entries") started
      reference counting port-VLAN entries in a similar fashion to the 8021q
      driver.
      
      However, this is not actually needed and only complicates things.
      Instead, the driver should forbid the creation of a VLAN on a port if
      this VLAN already exists. This would also solve the issue fixed by the
      mentioned commit.
      
      Therefore, remove the get()/put() API and use create()/destroy()
      instead.
      
      One place that needs special attention is VLAN addition in a VLAN-aware
      bridge via switchdev operations. In case the VLAN flags (e.g., 'pvid')
      are toggled, then the VLAN entry already exists. To prevent the driver
      from wrongly returning EEXIST, the driver is changed to check in the
      prepare phase whether the entry already exists and only returns an error
      in case it is not associated with the correct bridge port.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Reviewed-by: NPetr Machata <petrm@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      635c8c8b
    • I
      mlxsw: spectrum: Handle VLAN device unlinking · e149113a
      Ido Schimmel 提交于
      In commit 993107fe ("mlxsw: spectrum_switchdev: Fix VLAN device
      deletion via ioctl") I fixed a bug caused by the fact that the driver
      views differently the deletion of a VLAN device when it is deleted via
      an ioctl and netlink.
      
      Instead of relying on a specific order of events (device being
      unregistered vs. VLAN filter being updated), simply make sure that the
      driver performs the necessary cleanup when the VLAN device is unlinked,
      which always happens before the other two events.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Reviewed-by: NPetr Machata <petrm@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e149113a
    • I
      mlxsw: spectrum: Sanitize VLAN interface's uppers · 927d0ef1
      Ido Schimmel 提交于
      Currently, only VRF and macvlan uppers are supported on top of VLAN
      device configured over a bridge, so make sure the driver forbids other
      uppers.
      
      Note that enslavement to a VRF is handled earlier in the notification
      block, so there is no need to check for a VRF upper here.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Reviewed-by: NPetr Machata <petrm@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      927d0ef1
  5. 19 12月, 2018 2 次提交
    • I
      mlxsw: spectrum: Add trap for decapsulated ARP packets · 5d504391
      Ido Schimmel 提交于
      After a packet was decapsulated it is classified to the relevant FID
      based on its VNI and undergoes L2 forwarding.
      
      Unlike regular (non-encapsulated) ARP packets, Spectrum does not trap
      decapsulated ARP packets during L2 forwarding and instead can only trap
      such packets in the underlay router during decapsulation.
      
      Add this missing packet trap, which is required for VXLAN routing when
      the MAC of the target host is not known.
      
      Fixes: b02597d5 ("mlxsw: spectrum: Add NVE packet traps")
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Reviewed-by: NPetr Machata <petrm@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5d504391
    • S
      mlxsw: core: Increase timeout during firmware flash process · cf0b70e7
      Shalom Toledo 提交于
      During the firmware flash process, some of the EMADs get timed out, which
      causes the driver to send them again with a limit of 5 retries. There are
      some situations in which 5 retries is not enough and the EMAD access fails.
      If the failed EMAD was related to the flashing process, the driver fails
      the flashing.
      
      The reason for these timeouts during firmware flashing is cache misses in
      the CPU running the firmware. In case the CPU needs to fetch instructions
      from the flash when a firmware is flashed, it needs to wait for the
      flashing to complete. Since flashing takes time, it is possible for pending
      EMADs to timeout.
      
      Fix by increasing EMADs' timeout while flashing firmware.
      
      Fixes: ce6ef68f ("mlxsw: spectrum: Implement the ethtool flash_device callback")
      Signed-off-by: NShalom Toledo <shalomt@mellanox.com>
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cf0b70e7
  6. 18 12月, 2018 1 次提交
  7. 14 12月, 2018 3 次提交
  8. 12 12月, 2018 1 次提交
  9. 05 12月, 2018 2 次提交
    • I
      mlxsw: spectrum: Mirror loopbacked packets instead of trapping them · 2f4f4494
      Ido Schimmel 提交于
      When the ASIC detects that a unicast packet is routed through the same
      router interface (RIF) from which it ingressed (iRIF == eRIF), it raises
      a trap called loopback error (LBERROR).
      
      Thus far, this trap was configured to send a sole copy of the packet to
      the CPU so that ICMP redirect packets could be potentially generated by
      the kernel.
      
      This is problematic as the CPU cannot forward packets at 3.2Tb/s and
      there are scenarios (e.g., "one-armed router") where iRIF == eRIF is not
      an exception.
      
      Solve this by changing the trap to send a copy of the packet to the CPU.
      To prevent the kernel from forwarding the packet again, it is marked
      with 'offload_l3_fwd_mark'.
      
      The trap is configured in a trap group of its own with a dedicated
      policer in order not to prevent packets trapped by other traps from
      reaching the CPU.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2f4f4494
    • I
      skbuff: Rename 'offload_mr_fwd_mark' to 'offload_l3_fwd_mark' · 875e8939
      Ido Schimmel 提交于
      Commit abf4bb6b ("skbuff: Add the offload_mr_fwd_mark field") added
      the 'offload_mr_fwd_mark' field to indicate that a packet has already
      undergone L3 multicast routing by a capable device. The field is used to
      prevent the kernel from forwarding a packet through a netdev through
      which the device has already forwarded the packet.
      
      Currently, no unicast packet is routed by both the device and the
      kernel, but this is about to change by subsequent patches and we need to
      be able to mark such packets, so that they will no be forwarded twice.
      
      Instead of adding yet another field to 'struct sk_buff', we can just
      rename 'offload_mr_fwd_mark' to 'offload_l3_fwd_mark', as a packet
      either has a multicast or a unicast destination IP.
      
      While at it, add a comment about both 'offload_fwd_mark' and
      'offload_l3_fwd_mark'.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      875e8939
  10. 04 12月, 2018 1 次提交
  11. 01 12月, 2018 3 次提交
  12. 28 11月, 2018 1 次提交
  13. 19 11月, 2018 1 次提交
  14. 04 11月, 2018 1 次提交
  15. 01 11月, 2018 1 次提交
    • P
      mlxsw: spectrum: Set minimum shaper on MC TCs · 0fe64023
      Petr Machata 提交于
      An MC-aware mode was introduced in commit 7b819530 ("mlxsw:
      spectrum: Configure MC-aware mode on mlxsw ports"). In MC-aware mode,
      BUM traffic gets a special treatment by being assigned to a separate set
      of traffic classes 8..15. Pairs of TCs 0 and 8, 1 and 9, etc., are then
      configured to strictly prioritize the lower-numbered ones. The intention
      is to prevent BUM traffic from flooding the switch and push out all UC
      traffic, which would otherwise happen, and instead give UC traffic
      precedence.
      
      However strictly prioritizing UC traffic has the effect that UC overload
      pushes out all BUM traffic, such as legitimate ARP queries. These
      packets are kept in queues for a while, but under sustained UC overload,
      their lifetime eventually expires and these packets are dropped. That is
      detrimental to network performance as well.
      
      Therefore configure the MC TCs (8..15) with minimum shaper of 200Mbps (a
      minimum permitted value) to allow a trickle of necessary control traffic
      to get through.
      
      Fixes: 7b819530 ("mlxsw: spectrum: Configure MC-aware mode on mlxsw ports")
      Signed-off-by: NPetr Machata <petrm@mellanox.com>
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0fe64023
  16. 18 10月, 2018 2 次提交
    • I
      mlxsw: spectrum: Enable VxLAN enslavement to bridges · 1c30d183
      Ido Schimmel 提交于
      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: NIdo Schimmel <idosch@mellanox.com>
      Reviewed-by: NPetr Machata <petrm@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1c30d183
    • I
      mlxsw: spectrum_nve: Implement common NVE core · 6e6030bd
      Ido Schimmel 提交于
      The Spectrum ASIC supports different types of NVE encapsulations (e.g.,
      VxLAN, NVGRE) with more types to be supported by future ASICs.
      
      Despite being different, all these encapsulations share some common
      functionality such as the enablement of NVE encapsulation on a given
      filtering identifier (FID) and the addition of remote VTEPs to the
      linked-list of VTEPs that traffic should be flooded to.
      
      Implement this common core and allow different ASICs to register
      different operations for different encapsulation types.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Reviewed-by: NPetr Machata <petrm@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6e6030bd
  17. 12 10月, 2018 2 次提交
    • I
      mlxsw: spectrum: Add NVE packet traps · b02597d5
      Ido Schimmel 提交于
      The DECAP_ECN0 trap will be used to trap packets where the overlay
      packet is marked with Non-ECT, but the underlay packet is marked with
      either ECT(0), ECT(1) or CE. When trapped, such packets will be counted
      as errors by the VxLAN driver and thus provide better visibility.
      
      The NVE_ENCAP_ARP trap will be used to trap ARP packets undergoing NVE
      encapsulation. This is needed in order to support E-VPN ARP suppression,
      where the Linux bridge does not flood ARP packets through tunnel ports
      in case it can answer the ARP request itself.
      
      Note that all the packets trapped via these traps are marked with
      'offload_fwd_mark', so as to not be re-flooded by the Linux bridge
      through the ASIC ports.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Reviewed-by: NPetr Machata <petrm@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b02597d5
    • I
      mlxsw: spectrum: Seed LAG hash function · beda7f72
      Ido Schimmel 提交于
      Currently, the seed of the LAG hash function is always set to 0, which
      means it is identical across all switches. Instead, use a random number.
      
      This is especially important now that VxLAN is supported, as the LAG
      hash function is used to calculate the UDP source port of the
      encapsulated packet.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Reviewed-by: NPetr Machata <petrm@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      beda7f72
  18. 05 10月, 2018 1 次提交
  19. 24 9月, 2018 1 次提交
    • P
      mlxsw: Make MLXSW_SP1_FWREV_MINOR a hard requirement · 12ba7e10
      Petr Machata 提交于
      Up until now, mlxsw tolerated firmware versions that weren't exactly
      matching the required version, if the branch number matched. That
      allowed the users to test various firmware versions as long as they were
      on the right branch.
      
      On the other hand, it made it impossible for mlxsw to put a hard lower
      bound on a version that fixes all problems known to date. If a user had
      a somewhat older FW version installed, mlxsw would start up just fine,
      possibly performing non-optimally as it would use features that trigger
      problematic behavior.
      
      Therefore tweak the check to accept any FW version that is:
      
      - on the same branch as the preferred version, and
      - the same as or newer than the preferred version.
      Signed-off-by: NPetr Machata <petrm@mellanox.com>
      Reviewed-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      12ba7e10
  20. 20 9月, 2018 2 次提交
  21. 22 8月, 2018 1 次提交