1. 24 12月, 2015 1 次提交
  2. 29 10月, 2015 2 次提交
  3. 22 10月, 2015 3 次提交
    • M
      IB/core: Use GID table in AH creation and dmac resolution · dbf727de
      Matan Barak 提交于
      Previously, vlan id and source MAC were used from QP attributes. Since
      the net device is now stored in the GID attributes, they could be used
      instead of getting this information from the QP attributes.
      
      IB_QP_SMAC, IB_QP_ALT_SMAC, IB_QP_VID and IB_QP_ALT_VID were removed
      because there is no known libibverbs that uses them.
      
      This commit also modifies the vendors (mlx4, ocrdma) drivers in order
      to use the new approach.
      
      ocrdma driver changes were done by Somnath Kotur <Somnath.Kotur@Avagotech.Com>
      Signed-off-by: NMatan Barak <matanb@mellanox.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      dbf727de
    • E
      IB/mlx4: Add counter based implementation for QP multicast loopback block · 7b59f0f9
      Eran Ben Elisha 提交于
      Current implementation for MLX4_IB_QP_BLOCK_MULTICAST_LOOPBACK is not
      supported when link layer is Ethernet.
      
      This patch will add counter based implementation for multicast loopback
      prevention. HW can drop multicast loopback packets if sender QP counter
      index is equal to receiver QP counter index. If qp flag
      MLX4_IB_QP_BLOCK_MULTICAST_LOOPBACK is set and link layer is Ethernet,
      create a new counter and attach it to the QP so it will continue
      receiving multicast loopback traffic but it's own.
      
      The decision if to create a new counter is being made at the qp
      modification to RTR after the QP's port is set. When QP is destroyed or
      moved back to reset state, delete the counter.
      Signed-off-by: NEran Ben Elisha <eranbe@mellanox.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      7b59f0f9
    • E
      IB/mlx4: Add IB counters table · 3ba8e31d
      Eran Ben Elisha 提交于
      This is an infrastructure step for allocating and attaching more than
      one counter to QPs on the same port. Allocate a counters table and
      manage the insertion and removals of the counters in load and unload of
      mlx4 IB.
      Signed-off-by: NEran Ben Elisha <eranbe@mellanox.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      3ba8e31d
  4. 31 8月, 2015 5 次提交
  5. 16 6月, 2015 1 次提交
  6. 13 6月, 2015 3 次提交
  7. 02 6月, 2015 1 次提交
  8. 31 5月, 2015 1 次提交
    • M
      net/mlx4: Add EQ pool · c66fa19c
      Matan Barak 提交于
      Previously, mlx4_en allocated EQs and used them exclusively.
      This affected RoCE performance, as applications which are
      events sensitive were limited to use only the legacy EQs.
      
      Change that by introducing an EQ pool. This pool is managed
      by mlx4_core. EQs are assigned to ports (when there are limited
      number of EQs, multiple ports could be assigned to the same EQs).
      
      An exception to this rule is the ASYNC EQ which handles various events.
      
      Legacy EQs are completely removed as all EQs could be shared.
      
      When a consumer (mlx4_ib/mlx4_en) requests an EQ, it asks for
      EQ serving on a specific port. The core driver calculates which
      EQ should be assigned to that request.
      
      Because IRQs are shared between IB and Ethernet modules, their
      names only include the PCI device BDF address.
      Signed-off-by: NMatan Barak <matanb@mellanox.com>
      Signed-off-by: NIdo Shamay <idos@mellanox.com>
      Signed-off-by: NOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c66fa19c
  9. 16 4月, 2015 3 次提交
    • Y
      IB/mlx4: Request alias GUID on demand · ee59fa0d
      Yishai Hadas 提交于
      Request GIDs from the SM on demand, i.e., when a VF actually needs them,
      and release them when the GIDs are no longer in use.
      
      In cloud environments, this is useful for GID migrations, in which a
      GID is assigned to a VF on the destination HCA, while the VF on the
      source HCA is shutdown (but the GID was not administratively released).
      Signed-off-by: NYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: NJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: NOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      ee59fa0d
    • Y
      IB/mlx4: Change init flow to request alias GUIDs for active VFs · f5479601
      Yishai Hadas 提交于
      Change the init flow to ask GUIDs only for active VFs. This is done for
      both SM & HOST modes so that there is no need any more to maintain the
      ownership record type.
      
      In case SM mode is used, the initial value will be 0, ask the SM to assign,
      for the HOST mode the initial value will be the HOST generated GUID.
      
      This will enable out of the box experience for both probed and attached VFs.
      Signed-off-by: NYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: NJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: NOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      f5479601
    • Y
      IB/mlx4: Alias GUID adding persistency support · 99ee4df6
      Yishai Hadas 提交于
      If the SM rejects an alias GUID request the PF driver keeps trying to acquire
      the specified GUID indefinitely, utilizing an exponential backoff scheme.
      
      Retrying is managed per GUID entry. Each entry that wasn't applied holds its
      next retry information. Retry requests to the SM consist of records of 8
      consecutive GUIDS. Each record that contains GUIDs requiring retries holds its
      next time-to-run based on the retry information of all its GUID entries. The
      record having the lowest retry time will run first when that retry time
      arrives.
      
      Since the method (SET or DELETE) as sent to the SM applies to all the GUIDs in
      the record, we must handle SET requests and DELETE requests in separate SM
      messages (one for SETs and the other for DELETEs).
      
      To avoid race conditions where a GUID entry request (set or delete) was
      modified after the SM request was sent, we save the method and the requested
      indices as part of the callback's context -- thus, only the requested indexes
      are evaluated when the response is received.
      
      When an GUID entry is approved we turn off its retry-required bit, this
      prevents redundant SM retries from occurring on that record.
      
      The port down event should be sent only when previously it was up. Likewise,
      the port up event should be sent only if previously the port was down.
      
      Synchronization was added around the flows that change entries and record state
      to prevent race conditions.
      Signed-off-by: NYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: NJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: NOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      99ee4df6
  10. 10 2月, 2015 1 次提交
    • Y
      IB/mlx4: Reset flow support for IB kernel ULPs · 35f05dab
      Yishai Hadas 提交于
      The driver exposes interfaces that directly relate to HW state. Upon fatal
      error, consumers of these interfaces (ULPs) that rely on completion of
      all their posted work-request could hang, thereby introducing dependencies
      in shutdown order.  To prevent this from happening, we manage the
      relevant resources (CQs, QPs) that are used by the device. Upon a fatal error,
      we now generate simulated completions for outstanding WQEs that were not
      completed at the time the HW was reset.
      
      It includes invoking the completion event handler for all involved CQs so that
      the ULPs will poll those CQs. When polled we return simulated CQEs with
      IB_WC_WR_FLUSH_ERR return code enabling ULPs to clean up their resources and
      not wait forever for completions upon receiving remove_one.
      
      The above change requires an extra check in the data path to make sure that when
      device is in error state, the simulated CQEs will be returned and no further
      WQEs will be posted.
      Signed-off-by: NYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: NOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      35f05dab
  11. 05 2月, 2015 2 次提交
  12. 23 9月, 2014 1 次提交
    • J
      IB/mlx4: Avoid accessing netdevice when building RoCE qp1 header · 3e0629cb
      Jack Morgenstein 提交于
      The source MAC is needed in RoCE when building the QP1 header.
      
      Currently, this is obtained from the source net device. However, the net
      device may not yet exist, or can be destroyed in parallel to this QP1 send
      operation (e.g through the VPI port change flow) so accessing it may cause
      a kernel crash.
      
      To fix this, we maintain a source MAC cache per port for the net device in
      struct mlx4_ib_roce.  This cached MAC is initialized to be the default MAC
      address obtained during HCA initialization via QUERY_PORT. This cached MAC
      is updated via the netdev event notifier handler.
      
      Since the cached MAC is held in an atomic64 object, we do not need locking
      when accessing it.
      Signed-off-by: NJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: NOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      3e0629cb
  13. 02 8月, 2014 1 次提交
  14. 03 6月, 2014 1 次提交
  15. 17 5月, 2014 1 次提交
    • M
      IB/mlx4: Invoke UPDATE_QP for proxy QP1 on MAC changes · 9433c188
      Matan Barak 提交于
      When we receive a netdev event indicating a netdev change and/or
      a netdev address change, we must change the MAC index used by the
      proxy QP1 (in the QP context), otherwise RoCE CM packets sent by the
      VF will not carry the same source MAC address as the non-CM packets.
      
      We use the UPDATE_QP command to perform this change.
      
      In order to avoid modifying a QP context based on netdev event,
      while the driver attempts to destroy this QP (e.g either the mlx4_ib
      or ib_mad modules are unloaded), we use mutex locking in both flows.
      
      Since the relevant mlx4 proxy GSI QP is created indirectly by the
      mad module when they create their GSI QP, the mlx4 didn't need to
      keep track on that QP prior to this change.
      
      Now, when QP modifications are needed to this QP from within the
      driver, we added refernece to it.
      Signed-off-by: NMatan Barak <matanb@mellanox.com>
      Signed-off-by: NOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9433c188
  16. 13 3月, 2014 2 次提交
    • J
      mlx4: Implement IP based gids support for RoCE/SRIOV · 5ea8bbfc
      Jack Morgenstein 提交于
      Since there is no connection between the MAC/VLAN and the GID
      when using IP-based addressing, the proxy QP1 (running on the
      slave) must pass the source-mac, destination-mac, and vlan_id
      information separately from the GID. Additionally, the Host
      must pass the remote source-mac and vlan_id back to the slave,
      
      This is achieved as follows:
      Outgoing MADs:
          1. Source MAC: obtained from the CQ completion structure
             (struct ib_wc, smac field).
          2. Destination MAC: obtained from the tunnel header
          3. vlan_id: obtained from the tunnel header.
      Incoming MADs
          1. The source (i.e., remote) MAC and vlan_id are passed in
             the tunnel header to the proxy QP1.
      
      VST mode support:
           For outgoing MADs,  the vlan_id obtained from the header is
              discarded, and the vlan_id specified by the Hypervisor is used
              instead.
           For incoming MADs, the incoming vlan_id (in the wc) is discarded, and the
              "invalid" vlan (0xffff)  is substituted when forwarding to the slave.
      Signed-off-by: NMoni Shoua <monis@mellanox.co.il>
      Signed-off-by: NJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: NOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5ea8bbfc
    • J
      mlx4: Add ref counting to port MAC table for RoCE · 2f5bb473
      Jack Morgenstein 提交于
      The IB side of RoCE requires the MAC table index of the
      MAC address used by its QPs.
      
      To obtain the real MAC index, the IB side registers the
      MAC (increasing its ref count, and also returning the
      real MAC index) during the modify-qp sequence.
      
      This protects against the ETH side deleting or modifying
      that MAC table entry while the QP is active.
      
      Note that until the modify-qp command returns success,
      the MAC and VLAN information only has "candidate" status.
      If the modify-qp succeeds, the "candidate" info is promoted
      to the operational MAC/VLAN info for the qp. If the modify fails,
      the candidate MAC/VLAN is unregistered, and the old qp info
      is preserved.
      
      The patch is a bit complex, because there are multiple qp
      transitions where the primary-path information may be
      modified:  INIT-to-RTR, and SQD-to-SQD.
      
      Similarly for the alternate path information.
      
      Therefore the code must handle cases where path information
      has already been entered into the QP context by previous
      qp transitions.
      
      For the MAC address, the success logic is as follows:
      1. If there was no previous MAC, simply move the candidate
         MAC information to the operational information, and reset
         the candidate MAC info.
      2. If there was a previous MAC, unregister it.  Then move
         the MAC information from candidate to operational, and
         reset the candidate info (as in 1. above).
      
      The MAC address failure logic is the same for all cases:
       - Unregister the candidate MAC, and reset the candidate MAC info.
      
      For Vlan registration, the logic is similar.
      Signed-off-by: NJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: NOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2f5bb473
  17. 19 1月, 2014 2 次提交
  18. 15 1月, 2014 2 次提交
  19. 29 8月, 2013 1 次提交
  20. 26 2月, 2013 3 次提交
  21. 27 11月, 2012 1 次提交
    • O
      mlx4: 64-byte CQE/EQE support · 08ff3235
      Or Gerlitz 提交于
      ConnectX-3 devices can use either 64- or 32-byte completion queue
      entries (CQEs) and event queue entries (EQEs).  Using 64-byte
      EQEs/CQEs performs better because each entry is aligned to a complete
      cacheline.  This patch queries the HCA's capabilities, and if it
      supports 64-byte CQEs and EQES the driver will configure the HW to
      work in 64-byte mode.
      
      The 32-byte vs 64-byte mode is global per HCA and not per CQ or EQ.
      
      Since this mode is global, userspace (libmlx4) must be updated to work
      with the configured CQE size, and guests using SR-IOV virtual
      functions need to know both EQE and CQE size.
      
      In case one of the 64-byte CQE/EQE capabilities is activated, the
      patch makes sure that older guest drivers that use the QUERY_DEV_FUNC
      command (e.g as done in mlx4_core of Linux 3.3..3.6) will notice that
      they need an update to be able to work with the PPF. This is done by
      changing the returned pf_context_behaviour not to be zero any more. In
      case none of these capabilities is activated that value remains zero
      and older guest drivers can run OK.
      
      The SRIOV related flow is as follows
      
      1. the PPF does the detection of the new capabilities using
         QUERY_DEV_CAP command.
      
      2. the PPF activates the new capabilities using INIT_HCA.
      
      3. the VF detects if the PPF activated the capabilities using
         QUERY_HCA, and if this is the case activates them for itself too.
      
      Note that the VF detects that it must be aware to the new PF behaviour
      using QUERY_FUNC_CAP.  Steps 1 and 2 apply also for native mode.
      
      User space notification is done through a new field introduced in
      struct mlx4_ib_ucontext which holds device capabilities for which user
      space must take action. This changes the binary interface so the ABI
      towards libmlx4 exposed through uverbs is bumped from 3 to 4 but only
      when **needed** i.e. only when the driver does use 64-byte CQEs or
      future device capabilities which must be in sync by user space. This
      practice allows to work with unmodified libmlx4 on older devices (e.g
      A0, B0) which don't support 64-byte CQEs.
      
      In order to keep existing systems functional when they update to a
      newer kernel that contains these changes in VF and userspace ABI, a
      module parameter enable_64b_cqe_eqe must be set to enable 64-byte
      mode; the default is currently false.
      Signed-off-by: NEli Cohen <eli@mellanox.com>
      Signed-off-by: NOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      08ff3235
  22. 01 10月, 2012 2 次提交