1. 21 2月, 2020 4 次提交
  2. 18 2月, 2020 1 次提交
  3. 08 2月, 2020 2 次提交
  4. 19 1月, 2020 1 次提交
  5. 15 1月, 2020 2 次提交
    • I
      mlxsw: spectrum_router: Set hardware flags for routes · ee5a0448
      Ido Schimmel 提交于
      Previous patches added support for two hardware flags for IPv4 and IPv6
      routes: 'RTM_F_OFFLOAD' and 'RTM_F_TRAP'. Both indicate the presence of
      the route in hardware. The first indicates that traffic is actually
      offloaded from the kernel, whereas the second indicates that packets
      hitting such routes are trapped to the kernel for processing (e.g., host
      routes).
      
      Use these two flags in mlxsw. The flags are modified in two places.
      Firstly, whenever a route is updated in the device's table. This
      includes the addition, deletion or update of a route. For example, when
      a host route is promoted to perform NVE decapsulation, its action in the
      device is updated, the 'RTM_F_OFFLOAD' flag set and the 'RTM_F_TRAP'
      flag cleared.
      
      Secondly, when a route is replaced and overwritten by another route, its
      flags are cleared.
      
      v2:
      * Convert to new fib_alias_hw_flags_set() interface
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ee5a0448
    • I
      mlxsw: spectrum_router: Separate nexthop offload indication from route · 8c5a5b9b
      Ido Schimmel 提交于
      The driver currently uses the 'RTNH_F_OFFLOAD' flag for both routes and
      nexthops, which is cumbersome and unnecessary now that we have separate
      flag for the route itself.
      
      Separate the offload indication for nexthops from routes and call it
      whenever the offload state within the nexthop group changes.
      
      Note that IPv6 (unlike IPv4) does not share the same nexthop group
      between different routes, whereas mlxsw does. Therefore, whenever the
      offload indication within an IPv6 nexthop group changes, all the linked
      routes need to be updated.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8c5a5b9b
  6. 30 12月, 2019 1 次提交
    • A
      mlxsw: spectrum_router: Skip loopback RIFs during MAC validation · 314bd842
      Amit Cohen 提交于
      When a router interface (RIF) is created the MAC address of the backing
      netdev is verified to have the same MSBs as existing RIFs. This is
      required in order to avoid changing existing RIF MAC addresses that all
      share the same MSBs.
      
      Loopback RIFs are special in this regard as they do not have a MAC
      address, given they are only used to loop packets from the overlay to
      the underlay.
      
      Without this change, an error is returned when trying to create a RIF
      after the creation of a GRE tunnel that is represented by a loopback
      RIF. 'rif->dev->dev_addr' points to the GRE device's local IP, which
      does not share the same MSBs as physical interfaces. Adding an IP
      address to any physical interface results in:
      
      Error: mlxsw_spectrum: All router interface MAC addresses must have the
      same prefix.
      
      Fix this by skipping loopback RIFs during MAC validation.
      
      Fixes: 74bc9939 ("mlxsw: spectrum_router: Veto unsupported RIF MAC addresses")
      Signed-off-by: NAmit Cohen <amitc@mellanox.com>
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      314bd842
  7. 27 12月, 2019 5 次提交
  8. 25 12月, 2019 2 次提交
  9. 17 12月, 2019 2 次提交
  10. 10 12月, 2019 1 次提交
  11. 25 11月, 2019 2 次提交
  12. 19 11月, 2019 1 次提交
    • P
      mlxsw: spectrum_router: Fix determining underlay for a GRE tunnel · 1fc16577
      Petr Machata 提交于
      The helper mlxsw_sp_ipip_dev_ul_tb_id() determines the underlay VRF of a
      GRE tunnel. For a tunnel without a bound device, it uses the same VRF that
      the tunnel is in. However in Linux, a GRE tunnel without a bound device
      uses the main VRF as the underlay. Fix the function accordingly.
      
      mlxsw further assumed that moving a tunnel to a different VRF could cause
      conflict in local tunnel endpoint address, which cannot be offloaded.
      However, the only way that an underlay could be changed by moving the
      tunnel device itself is if the tunnel device does not have a bound device.
      But in that case the underlay is always the main VRF, so there is no
      opportunity to introduce a conflict by moving such device. Thus this check
      constitutes a dead code, and can be removed, which do.
      
      Fixes: 6ddb7426 ("mlxsw: spectrum_router: Introduce loopback RIFs")
      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>
      1fc16577
  13. 16 11月, 2019 1 次提交
    • I
      mlxsw: spectrum_router: Allocate discard adjacency entry when needed · 983db619
      Ido Schimmel 提交于
      Commit 0c3cbbf9 ("mlxsw: Add specific trap for packets routed via
      invalid nexthops") allocated an adjacency entry during driver
      initialization whose purpose is to discard packets hitting the route
      pointing to it.
      
      These adjacency entries are allocated from a resource called KVD linear
      (KVDL). There are situations in which the user can decide to set the
      size of this resource (via devlink-resource) to 0, in which case the
      driver will not be able to load.
      
      Therefore, instead of pre-allocating this adjacency entry, simply
      allocate it only when needed. A variable indicating the validity of the
      entry is added and is used to ensure it is only allocated and written
      once and that it is freed after all the routes were flushed.
      
      Fixes: 0c3cbbf9 ("mlxsw: Add specific trap for packets routed via invalid nexthops")
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      983db619
  14. 08 11月, 2019 2 次提交
    • A
      mlxsw: Add specific trap for packets routed via invalid nexthops · 0c3cbbf9
      Amit Cohen 提交于
      Currently, mlxsw does not differentiate between these two cases of
      routes with invalid nexthops:
      
      1. Nexthops whose nexthop device is a mlxsw upper (has a RIF), but whose
      neighbour could not be resolved
      
      2. Nexthops whose nexthop device is not a mlxsw upper (e.g., management
      interface)
      
      Up until now this did not matter and mlxsw trapped packets for both
      cases using the same trap ID. However, packets that should have been
      routed in hardware (case 1), but incurred a problem are considered
      exceptions and should be reported to the user. The two cases should
      therefore be split between two different trap IDs.
      
      Allocate a new adjacency entry during initialization and upon the
      insertion of the first route with an invalid mlxsw nexthop, program this
      entry to discard packets. Packets hitting this entry will be reported
      using new trap ID - "DISCARD_ROUTER3".
      
      In the future, the entry could be written during initialization, but
      currently firmware requires a valid RIF, which is not available at this
      stage.
      Signed-off-by: NAmit Cohen <amitc@mellanox.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0c3cbbf9
    • A
      mlxsw: Add new FIB entry type for reject routes · 21151f64
      Amit Cohen 提交于
      Currently, packets that cannot be routed in hardware (e.g., nexthop
      device is not upper of mlxsw), are trapped to the kernel for forwarding.
      Such packets are trapped using "RTR_INGRESS0" trap. This trap also traps
      packets that hit reject routes (e.g., "unreachable") so that the kernel
      will generate the appropriate ICMP error message for them.
      
      Subsequent patch will need to only report to devlink packets that hit a
      reject route, which is impossible as long as "RTR_INGRESS0" is
      overloaded like that.
      
      Solve this by using "RTR_INGRESS1" trap for packets that hit reject
      routes.
      Signed-off-by: NAmit Cohen <amitc@mellanox.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      21151f64
  15. 05 10月, 2019 5 次提交
  16. 26 7月, 2019 1 次提交
  17. 19 6月, 2019 7 次提交