1. 22 11月, 2018 1 次提交
  2. 18 10月, 2018 6 次提交
  3. 12 10月, 2018 3 次提交
  4. 26 8月, 2018 1 次提交
    • I
      mlxsw: spectrum_switchdev: Do not leak RIFs when removing bridge · 602b74ed
      Ido Schimmel 提交于
      When a bridge device is removed, the VLANs are flushed from each
      configured port. This causes the ports to decrement the reference count
      on the associated FIDs (filtering identifier). If the reference count of
      a FID is 1 and it has a RIF (router interface), then this RIF is
      destroyed.
      
      However, if no port is member in the VLAN for which a RIF exists, then
      the RIF will continue to exist after the removal of the bridge. To
      reproduce:
      
      # ip link add name br0 type bridge vlan_filtering 1
      # ip link set dev swp1 master br0
      # ip link add link br0 name br0.10 type vlan id 10
      # ip address add 192.0.2.0/24 dev br0.10
      # ip link del dev br0
      
      The RIF associated with br0.10 continues to exist.
      
      Fix this by iterating over all the bridge device uppers when it is
      destroyed and take care of destroying their RIFs.
      
      Fixes: 99f44bb3 ("mlxsw: spectrum: Enable L3 interfaces on top of bridge devices")
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Reviewed-by: NPetr Machata <petrm@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      602b74ed
  5. 10 8月, 2018 2 次提交
  6. 28 7月, 2018 1 次提交
    • P
      mlxsw: spectrum: Support ieee_setapp, ieee_delapp · b2b1dab6
      Petr Machata 提交于
      The APP TLVs are used for communicating priority-to-protocol ID maps for
      a given netdevice. Support the following APP TLVs:
      
      - DSCP (selector 5) to configure priority-to-DSCP code point maps. Use
        these maps to configure packet priority on ingress, and DSCP code
        point rewrite on egress.
      
      - Default priority (selector 1, PID 0) to configure priority for the
        DSCP code points that don't have one assigned by the DSCP selector. In
        future this could also be used for assigning default port priority
        when a packet arrives without DSCP tagging.
      
      Besides setting up the maps themselves, also configure port trust level
      and rewrite bits.
      
      Port trust level determines whether, for a packet arriving through a
      certain port, the priority should be determined based on PCP or DSCP
      header fields. So far, mlxsw kept the device default of trust-PCP. Now,
      as soon as the first DSCP APP TLV is configured, switch to trust-DSCP.
      Only when all DSCP APP TLVs are removed, switch back to trust-PCP again.
      Note that the default priority APP TLV doesn't impact the trust level
      configuration.
      
      Rewrite bits determine whether DSCP and PCP fields of egressing packets
      should be updated according to switch priority. When port trust is
      switched to DSCP, enable rewrite of DSCP field.
      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>
      b2b1dab6
  7. 26 7月, 2018 1 次提交
  8. 25 7月, 2018 1 次提交
  9. 24 7月, 2018 1 次提交
    • J
      mlxsw: spectrum: Implement chain template hinting · e2f2a1fd
      Jiri Pirko 提交于
      Since cld_flower provides information about the filter template for
      specific chain, use this information in order to prepare a region.
      Use the template to find out what elements are going to be used
      and pass that down to mlxsw_sp_acl_tcam_group_add(). Later on, when the
      first filter is inserted, the mlxsw_sp_acl_tcam_group_use_patterns()
      function would use this element usage information instead of looking
      up a pattern.
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e2f2a1fd
  10. 19 7月, 2018 6 次提交
  11. 15 7月, 2018 1 次提交
    • I
      mlxsw: spectrum_router: Direct macvlans' MACs to router · 2db99378
      Ido Schimmel 提交于
      An IP packet received on a netdev with a macvlan upper whose MAC matches
      the packet's destination MAC will be re-injected to the Rx path as if it
      was received by the macvlan, and perform an L3 lookup.
      
      Reflect this functionality to the ASIC by programming FDB entries that
      will direct MACs of macvlan uppers to the router.
      
      In a similar fashion to router interfaces (RIFs) that are programmed
      upon the addition of the first IP address on an interface and destroyed
      upon the removal of the last IP address, the FDB entries for the macvlan
      are added and destroyed based on the addition of the first and removal
      of the last IP address on the macvlan.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Reviewed-by: NPetr Machata <petrm@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2db99378
  12. 10 7月, 2018 8 次提交
  13. 08 7月, 2018 1 次提交
  14. 01 5月, 2018 1 次提交
  15. 09 4月, 2018 1 次提交
    • J
      devlink: convert occ_get op to separate registration · fc56be47
      Jiri Pirko 提交于
      This resolves race during initialization where the resources with
      ops are registered before driver and the structures used by occ_get
      op is initialized. So keep occ_get callbacks registered only when
      all structs are initialized.
      
      The example flows, as it is in mlxsw:
      1) driver load/asic probe:
         mlxsw_core
            -> mlxsw_sp_resources_register
              -> mlxsw_sp_kvdl_resources_register
                -> devlink_resource_register IDX
         mlxsw_spectrum
            -> mlxsw_sp_kvdl_init
              -> mlxsw_sp_kvdl_parts_init
                -> mlxsw_sp_kvdl_part_init
                  -> devlink_resource_size_get IDX (to get the current setup
                                                    size from devlink)
              -> devlink_resource_occ_get_register IDX (register current
                                                        occupancy getter)
      2) reload triggered by devlink command:
        -> mlxsw_devlink_core_bus_device_reload
          -> mlxsw_sp_fini
            -> mlxsw_sp_kvdl_fini
      	-> devlink_resource_occ_get_unregister IDX
          (struct mlxsw_sp *mlxsw_sp is freed at this point, call to occ get
           which is using mlxsw_sp would cause use-after free)
          -> mlxsw_sp_init
            -> mlxsw_sp_kvdl_init
              -> mlxsw_sp_kvdl_parts_init
                -> mlxsw_sp_kvdl_part_init
                  -> devlink_resource_size_get IDX (to get the current setup
                                                    size from devlink)
              -> devlink_resource_occ_get_register IDX (register current
                                                        occupancy getter)
      
      Fixes: d9f9b9a4 ("devlink: Add support for resource abstraction")
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fc56be47
  16. 01 4月, 2018 2 次提交
  17. 10 3月, 2018 2 次提交
    • P
      mlxsw: spectrum: Prevent duplicate mirrors · 663f1b26
      Petr Machata 提交于
      The Spectrum ASIC doesn't support mirroring more than once from a single
      binding point (which is a port-direction pair). Therefore detect that a
      second binding of a given binding point is attempted.
      
      To that end, extend struct mlxsw_sp_span_inspected_port to track whether
      a given binding point is bound or not. Extend
      mlxsw_sp_span_entry_port_find() to look for ports based on the full
      unique key: port number, direction, and boundness.
      
      Besides fixing the overt bug where configured mirrors are not offloaded,
      this also fixes a more subtle bug: mlxsw_sp_span_inspected_port_del()
      just defers to mlxsw_sp_span_entry_bound_port_find(), and that used to
      find the first port with the right number (disregarding the type). Thus
      by adding and removing egress and ingress mirrors in the right order,
      one could trick the system into believing it has no egress mirrors when
      in fact it did have some. That then caused that
      mlxsw_sp_span_port_mtu_update() didn't update mirroring buffer when MTU
      was changed.
      
      Fixes: 763b4b70 ("mlxsw: spectrum: Add support in matchall mirror TC offloading")
      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>
      663f1b26
    • J
      mlxsw: spectrum: Fix gact_ok offloading · 49bae2f3
      Jiri Pirko 提交于
      For ok GACT action, TERMINATE binding_cmd should be used in action set
      passed down to HW.
      
      Fixes: b2925957 ("mlxsw: spectrum_flower: Offload "ok" termination action")
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Reported-by: NAlexander Petrovskiy <alexpe@mellanox.com>
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      49bae2f3
  18. 01 3月, 2018 1 次提交
    • I
      spectrum: Reference count VLAN entries · b3529af6
      Ido Schimmel 提交于
      One of the basic construct in the device is a port-VLAN pair, which can
      be bound to a FID or a RIF in order to direct packets to the bridge or
      the router, respectively.
      
      Since not all the netdevs are configured with a VLAN (e.g., sw1p1 vs.
      sw1p1.10), VID 1 is used to represent these and thus this VID can be
      used by both upper devices of mlxsw ports and by the driver itself.
      
      However, this VID is not reference counted and therefore might be freed
      prematurely, which can result in various WARNINGs. For example:
      
      $ ip link add name br0 type bridge vlan_filtering 1
      $ teamd -t team0 -d -c '{"runner": {"name": "lacp"}}'
      $ ip link set dev team0 master br0
      $ ip link set dev enp1s0np1 master team0
      $ ip address add 192.0.2.1/24 dev enp1s0np1
      
      The enslavement to team0 will fail because team0 already has an upper
      and thus vlan_vids_del_by_dev() will be executed as part of team's error
      path which will delete VID 1 from enp1s0np1 (added by br0 as PVID). The
      WARNING will be generated when the driver will realize it can't find VID
      1 on the port and bind it to a RIF.
      
      Fix this by adding a reference count to the VLAN entries on the port, in
      a similar fashion to the reference counting used by the corresponding
      'vlan_vid_info' structure in the 8021q driver.
      
      Fixes: c57529e1 ("mlxsw: spectrum: Replace vPorts with Port-VLAN")
      Reported-by: NTal Bar <talb@mellanox.com>
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Tested-by: NTal Bar <talb@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b3529af6