1. 07 Sep, 2012 2 commits
  2. 03 Aug, 2012 1 commit
  3. 25 Jul, 2012 1 commit
    • Kleber Sacilotto de Souza's avatar
      mlx4: Add support for EEH error recovery · 57dbf29a
      Kleber Sacilotto de Souza authored
      Currently the mlx4 drivers don't have the necessary callbacks to
      implement EEH errors detection and recovery, so the PCI layer uses the
      probe and remove callbacks to try to recover the device after an error on
      the bus. However, these callbacks have race conditions with the internal
      catastrophic error recovery functions, which will also detect the error
      and this can cause the system to crash if both EEH and catas functions
      try to reset the device.
      This patch adds the necessary error recovery callbacks and makes sure
      that the internal catastrophic error functions will not try to reset the
      device in such scenarios. It also adds some calls to
      pci_channel_offline() to suppress reads/writes on the bus when the slot
      cannot accept I/O operations so we prevent unnecessary accesses to the
      bus and speed up the device removal.
      Signed-off-by: default avatarKleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>
      Acked-by: default avatarShlomo Pongratz <shlomop@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  4. 11 Jul, 2012 3 commits
    • Jack Morgenstein's avatar
      mlx4: Put physical GID and P_Key table sizes in mlx4_phys_caps struct and paravirtualize them · 6634961c
      Jack Morgenstein authored
      To allow easy paravirtualization of P_Key and GID table sizes, keep
      paravirtualized sizes in mlx4_dev->caps, but save the actual physical
      sizes from FW in struct: mlx4_dev->phys_cap.
      In addition, in SR-IOV mode, do the following:
      1. Reduce reported P_Key table size by 1.
         This is done to reserve the highest P_Key index for internal use,
         for declaring an invalid P_Key in P_Key paravirtualization.
         We require a P_Key index which always contain an invalid P_Key
         value for this purpose (i.e., one which cannot be modified by
         the subnet manager).  The way to do this is to reduce the
         P_Key table size reported to the subnet manager by 1, so that
         it will not attempt to access the P_Key at index #127.
      2. Paravirtualize the GID table size to 1. Thus, each guest sees
         only a single GID (at its paravirtualized index 0).
      In addition, since we are paravirtualizing the GID table size to 1, we
      add paravirtualization of the master GID event here (i.e., we do not
      do ib_dispatch_event() for the GUID change event on the master, since
      its (only) GUID never changes).
      Signed-off-by: default avatarJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
    • Jack Morgenstein's avatar
      mlx4_core: Allow guests to have IB ports · 105c320f
      Jack Morgenstein authored
      Modify mlx4_dev_cap to allow IB support when SR-IOV is active.  Modify
      mlx4_slave_cap to set the "rdma-supported" bit in its flags area, and
      pass that to the guests (this is done in QUERY_FUNC_CAP and its
      However, we don't activate IB support quite yet -- we leave the error
      return at the start of mlx4_ib_add in the mlx4_ib driver.
      In addition, set "protected fmr supported" bit to zero in the
      QUERY_FUNC_CAP wrapper.
      Finally, in the QUERY_FUNC_CAP wrapper, we needed to add code which
      checks for the port type (IB or Ethernet).  Previously, this was not
      an issue, since only Ethernet ports were supported.
      Signed-off-by: default avatarJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
    • Jack Morgenstein's avatar
      mlx4_core: Implement mechanism for reserved Q_Keys · 396f2feb
      Jack Morgenstein authored
      The SR-IOV special QP tunneling mechanism uses proxy special QPs
      (instead of the real special QPs) for MADs on guests.  These proxy QPs
      send their packets to a "tunnel" QP owned by the master.  The master
      then forwards the MAD (after any required paravirtualization) to the
      real special QP, which sends out the MAD.
      For security reasons (i.e., to prevent guests from sending MADs to
      tunnel QPs belonging to other guests), each proxy-tunnel QP pair is
      assigned a unique, reserved, Q_Key.  These Q_Keys are available only
      for proxy and tunnel QPs -- if the guest tries to use these Q_Keys
      with other QPs, it will fail.
      This patch introduces a mechanism for reserving a block of 64K Q_Keys
      for proxy/tunneling use.
      The patch introduces also two new fields into mlx4_dev: base_sqpn and
      In SR-IOV mode, the QP numbers for the "real," proxy, and tunnel sqps
      are added to the reserved QPN area (so that they will not change).
      There are 8 special QPs per port in the HCA, and each of them is
      assigned both a proxy and a tunnel QP, for each VF and for the PF as
      well in SR-IOV mode.
      The QPNs for these QPs are arranged as follows:
       1. The real SQP numbers (8)
       2. The proxy SQPs (8 * (max number of VFs + max number of PFs)
       3. The tunnel SQPs (8 * (max number of VFs + max number of PFs)
      To support these QPs, two new fields are added to struct mlx4_dev:
        base_sqp:  this is the QP number of the first of the real SQPs
        base_tunnel_sqp: this is the qp number of the first qp in the tunnel
                         sqp region. (On guests, this is the first tunnel
                         sqp of the 8 which are assigned to that guest).
      In addition, in SR-IOV mode, sqp_start is the number of the first
      proxy SQP in the proxy SQP region.  (In guests, this is the first
      proxy SQP of the 8 which are assigned to that guest)
      Note that in non-SR-IOV mode, there are no proxies and no tunnels.
      In this case, sqp_start is set to sqp_base -- which minimizes code
      Signed-off-by: default avatarJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
  5. 10 Jul, 2012 1 commit
  6. 07 Jul, 2012 2 commits
    • Hadar Hen Zion's avatar
      {NET, IB}/mlx4: Add device managed flow steering firmware API · 0ff1fb65
      Hadar Hen Zion authored
      The driver is modified to support three operation modes.
      If supported by firmware use the device managed flow steering
      API, that which we call device managed steering mode. Else, if
      the firmware supports the B0 steering mode use it, and finally,
      if none of the above, use the A0 steering mode.
      When the steering mode is device managed, the code is modified
      such that L2 based rules set by the mlx4_en driver for Ethernet
      unicast and multicast, and the IB stack multicast attach calls
      done through the mlx4_ib driver are all routed to use the device
      managed API.
      When attaching rule using device managed flow steering API,
      the firmware returns a 64 bit registration id, which is to be
      provided during detach.
      Currently the firmware is always programmed during HCA initialization
      to use standard L2 hashing. Future work should be done to allow
      configuring the flow-steering hash function with common, non
      proprietary means.
      Signed-off-by: default avatarHadar Hen Zion <hadarh@mellanox.co.il>
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    • Hadar Hen Zion's avatar
      net/mlx4: Set steering mode according to device capabilities · c96d97f4
      Hadar Hen Zion authored
      Instead of checking the firmware supported steering mode in various
      places in the code, add a dedicated field in the mlx4 device capabilities
      structure which is written once during the initialization flow and read
      across the code.
      This also set the grounds for add new steering modes. Currently two modes
      are supported, and are named after the ConnectX HW versions A0 and B0.
      A0 steering uses mac_index, vlan_index and priority to steer traffic
      into pre-defined range of QPs.
      B0 steering uses Ethernet L2 hashing rules and is enabled only
      if the firmware supports both unicast and multicast B0 steering,
      The current steering modes are relevant for Ethernet traffic only,
      such that Infiniband steering remains untouched.
      Signed-off-by: default avatarHadar Hen Zion <hadarh@mellanox.co.il>
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  7. 05 Jul, 2012 1 commit
  8. 25 Jun, 2012 1 commit
  9. 31 May, 2012 3 commits
  10. 15 May, 2012 3 commits
  11. 08 May, 2012 1 commit
    • Shlomo Pongratz's avatar
      mlx4_core: Add second capabilities flags field · b3416f44
      Shlomo Pongratz authored
      This patch adds a 64-bit flags2 features member to struct mlx4_dev to
      export further features of the hardware.  The original flags field
      tracks features whose support bits are advertised by the firmware in
      offsets 0x40 and 0x44 of the query device capabilities command.
      flags2 will track features whose support bits are scattered at various
      RSS support is the first feature to be exported through flags2.  RSS
      capabilities are located at offset 0x2e.  The size of the RSS
      indirection table is also given in this offset.
      Signed-off-by: default avatarShlomo Pongratz <shlomop@mellanox.com>
      Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
  12. 12 Mar, 2012 2 commits
    • Or Gerlitz's avatar
      mlx4_core: Allow dynamic MTU configuration for IB ports · 096335b3
      Or Gerlitz authored
      Set the MTU for IB ports in the driver instead of using the firmware
      default of 2KB (the driver defaults to 4KB).  Allow for dynamic mtu
      configuration through a new, per-port sysfs entry.
      Since there's a dependency between the port MTU and the max number of
      HW VLs the port can support, apply a mim/max approach, using a loop
      that goes down from the highest possible number of VLs to the lowest,
      using the firmware return status to know whether the requested number
      of VLs is possible with a given MTU.
      For now, as with the dynamic link type change / VPI support, the sysfs
      entry to change the mtu is exposed only when NOT running in SR-IOV
      mode.  To allow changing the MTU for the master in SR-IOV mode,
      primary-function-initiated FLR (Function Level Reset) needs to be
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
    • Roland Dreier's avatar
      mlx4_core: Fix one more static exported function · e10903b0
      Roland Dreier authored
      Commit 22c8bff6
       ("mlx4_core: Exported functions can't be static")
      fixed most of this up, but forgot about mlx4_is_slave_active().  Fix
      this one too.
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
  13. 06 Mar, 2012 1 commit
    • Or Gerlitz's avatar
      mlx4_core: Get rid of redundant ext_port_cap flags · 8154c07f
      Or Gerlitz authored
      While doing the work for commit a6f7feae ("IB/mlx4: pass SMP
      vendor-specific attribute MADs to firmware") we realized that the
      firmware would respond on all sorts of vendor-specific MADs.
      Therefore commit 97285b78 ("mlx4_core: Add extended port
      capabilities support") adds redundant code into the driver, since
      there's no real reaon to maintain the extended capabilities of the
      port, as they can be queried on demand (e.g the FDR10 capability).
      This patch reverts commit 97285b78
       and removes the check for
      extended caps from the mlx4_ib driver port query flow.
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
  14. 26 Feb, 2012 1 commit
  15. 23 Feb, 2012 1 commit
  16. 21 Feb, 2012 2 commits
    • Yevgeny Petrilin's avatar
      mlx4: Setting new port types after all interfaces unregistered · 3d8f9308
      Yevgeny Petrilin authored
      In port type change flow, need to set the new port types only after
      all interfaces have finished the unregister process.
      Otherwise, during unregister, one of the interfaces might issue a SET_PORT
      command with wrong port types, it can cause bad FW behavior.
      Signed-off-by: default avatarYevgeny Petrilin <yevgenyp@mellanox.co.il>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    • Yevgeny Petrilin's avatar
      mlx4: Replacing pool_lock with mutex · 730c41d5
      Yevgeny Petrilin authored
      Under the spinlock we call request_irq(), which allocates memory with GFP_KERNEL,
      This causes the following trace when DEBUG_SPINLOCK is enabled, it can cause
      the following trace:
       BUG: spinlock wrong CPU on CPU#2, ethtool/2595
       lock: ffff8801f9cbc2b0, .magic: dead4ead, .owner: ethtool/2595, .owner_cpu: 0
       Pid: 2595, comm: ethtool Not tainted 3.0.18 #2
       Call Trace:
       mlx4_assign_eq+0x12b/0x190 [mlx4_core]
       mlx4_en_activate_cq+0x252/0x2d0 [mlx4_en]
       ? mlx4_en_activate_rx_rings+0x227/0x370 [mlx4_en]
       mlx4_en_start_port+0x189/0xb90 [mlx4_en]
       mlx4_en_set_ringparam+0x29a/0x340 [mlx4_en]
       ? dev_get_by_name_rcu+0xa4/0xe0
      Replacing with mutex, which is enough in this case.
      Signed-off-by: default avatarYevgeny Petrilin <yevgenyp@mellanox.co.il>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  17. 20 Feb, 2012 1 commit
  18. 14 Feb, 2012 1 commit
  19. 22 Jan, 2012 2 commits
  20. 29 Dec, 2011 1 commit
  21. 19 Dec, 2011 3 commits
  22. 13 Dec, 2011 4 commits
  23. 11 Aug, 2011 1 commit
  24. 03 Aug, 2011 1 commit