1. 06 6月, 2018 1 次提交
  2. 04 6月, 2018 1 次提交
  3. 02 6月, 2018 5 次提交
  4. 29 5月, 2018 1 次提交
  5. 24 5月, 2018 2 次提交
  6. 23 5月, 2018 1 次提交
  7. 17 5月, 2018 2 次提交
  8. 16 5月, 2018 1 次提交
    • L
      IB/umem: Use the correct mm during ib_umem_release · 8e907ed4
      Lidong Chen 提交于
      User-space may invoke ibv_reg_mr and ibv_dereg_mr in different threads.
      
      If ibv_dereg_mr is called after the thread which invoked ibv_reg_mr has
      exited, get_pid_task will return NULL and ib_umem_release will not
      decrease mm->pinned_vm.
      
      Instead of using threads to locate the mm, use the overall tgid from the
      ib_ucontext struct instead. This matches the behavior of ODP and
      disassociate in handling the mm of the process that called ibv_reg_mr.
      
      Cc: <stable@vger.kernel.org>
      Fixes: 87773dd5 ("IB: ib_umem_release() should decrement mm->pinned_vm from ib_umem_get")
      Signed-off-by: NLidong Chen <lidongchen@tencent.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      8e907ed4
  9. 10 5月, 2018 3 次提交
  10. 04 5月, 2018 2 次提交
    • S
      RDMA/nldev: helper functions to add driver attributes · 73937e8a
      Steve Wise 提交于
      These help rdma drivers to fill out the driver entries.
      Signed-off-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      73937e8a
    • S
      RDMA/nldev: add driver-specific resource tracking · da5c8507
      Steve Wise 提交于
      Each driver can register a "fill entry" function with the restrack core.
      This function will be called when filling out a resource, allowing the
      driver to add driver-specific details.  The details consist of a
      nltable of nested attributes, that are in the form of <key, [print-type],
      value> tuples.  Both key and value attributes are mandatory.  The key
      nlattr must be a string, and the value nlattr can be one of the driver
      attributes that are generic, but typed, allowing the attributes to be
      validated.  Currently the driver nlattr types include string, s32,
      u32, s64, and u64.  The print-type nlattr allows a driver to specify
      an alternative display format for user tools displaying the attribute.
      For example, a u32 attribute will default to "%u", but a print-type
      attribute can be included for it to be displayed in hex.  This allows
      the user tool to print the number in the format desired by the driver
      driver.
      
      More attrs can be defined as they become needed by drivers.
      Signed-off-by: NSteve Wise <swise@opengridcomputing.com>
      Reviewed-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      da5c8507
  11. 18 4月, 2018 1 次提交
    • J
      RDMA/rdma_cm: Delete rdma_addr_client · ee6548d1
      Jason Gunthorpe 提交于
      The only thing it does is block module unload while work is posted from
      rdma_resolve_ip().
      
      However, this is not the right place to do this. The users of
      rdma_resolve_ip() must ensure their own module does not unload until
      rdma_resolve_ip() calls the callback, or until rdma_addr_cancel() is
      called.
      
      Similarly callers to rdma_addr_find_l2_eth_by_grh() must ensure their
      module does not unload while they are calling code.
      
      The only two users are already safe, so there is no need for this.
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      ee6548d1
  12. 06 4月, 2018 3 次提交
  13. 05 4月, 2018 6 次提交
  14. 04 4月, 2018 3 次提交
    • P
      RDMA: Use ib_gid_attr during GID modification · 414448d2
      Parav Pandit 提交于
      Now that ib_gid_attr contains device, port and index, simplify the
      provider APIs add_gid() and del_gid() to use device, port and index
      fields from the ib_gid_attr attributes structure.
      Signed-off-by: NParav Pandit <parav@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      414448d2
    • P
      IB/core: Refactor GID modify code for RoCE · 598ff6ba
      Parav Pandit 提交于
      Code is refactored to prepare separate functions for RoCE which can do more
      complex operations related to reference counting, while still
      maintainining code readability. This includes
      (a) Simplification to not perform netdevice checks and modifications
      for IB link layer.
      (b) Do not add RoCE GID entry which has NULL netdevice; instead return
      an error.
      (c) If GID addition fails at provider level add_gid(), do not add the
      entry in the cache and keep the entry marked as INVALID.
      (d) Simplify and reuse the ib_cache_gid_add()/del() routines so that they
      can be used even for modifying default GIDs. This avoid some code
      duplication in modifying default GIDs.
      (e) find_gid() routine refers to the data entry flags to qualify a GID
      as valid or invalid GID rather than depending on attributes and zeroness
      of the GID content.
      (f) gid_table_reserve_default() sets the GID default attribute at
      beginning while setting up the GID table. There is no need to use
      default_gid flag in low level functions such as write_gid(), add_gid(),
      del_gid(), as they never need to update the DEFAULT property of the GID
      entry while during GID table update.
      
      As as result of this refactor, reserved GID 0:0:0:0:0:0:0:0 is no longer
      searchable as described below.
      
      A unicast GID entry of 0:0:0:0:0:0:0:0 is Reserved GID as per the IB
      spec version 1.3 section 4.1.1, point (6) whose snippet is below.
      
      "The unicast GID address 0:0:0:0:0:0:0:0 is reserved - referred to as
      the Reserved GID. It shall never be assigned to any endport. It shall
      not be used as a destination address or in a global routing header
      (GRH)."
      
      GID table cache now only stores valid GID entries. Before this patch,
      Reserved GID 0:0:0:0:0:0:0:0 was searchable in the GID table using
      ib_find_cached_gid_by_port() and other similar find routines.
      
      Zero GID is no longer searchable as it shall not to be present in GRH or
      path recored entry as described in IB spec version 1.3 section 4.1.1,
      point (6), section 12.7.10 and section 12.7.20.
      
      ib_cache_update() is simplified to check link layer once, use unified
      locking scheme for all link layers, removed temporary gid table
      allocation/free logic.
      
      Additionally,
      (a) Expand ib_gid_attr to store port and index so that GID query
      routines can get port and index information from the attribute structure.
      (b) Expand ib_gid_attr to store device as well so that in future code when
      GID reference counting is done, device is used to reach back to the GID
      table entry.
      Signed-off-by: NParav Pandit <parav@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      598ff6ba
    • P
      RDMA/core: Update query_gid documentation for HCA drivers · 72e1ff0f
      Parav Pandit 提交于
      query_gid() should return right GID value for iWarp and IB link layers.
      It is a no-op for RoCE link layer.  Update the documentation to reflect
      this.
      Signed-off-by: NParav Pandit <parav@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      72e1ff0f
  15. 30 3月, 2018 1 次提交
  16. 29 3月, 2018 3 次提交
  17. 28 3月, 2018 1 次提交
  18. 26 3月, 2018 1 次提交
    • K
      net: Drop NETDEV_UNREGISTER_FINAL · 070f2d7e
      Kirill Tkhai 提交于
      Last user is gone after bdf5bd7f "rds: tcp: remove
      register_netdevice_notifier infrastructure.", so we can
      remove this netdevice command. This allows to delete
      rtnl_lock() in netdev_run_todo(), which is hot path for
      net namespace unregistration.
      
      dev_change_net_namespace() and netdev_wait_allrefs()
      have rcu_barrier() before NETDEV_UNREGISTER_FINAL call,
      and the source commits say they were introduced to
      delemit the call with NETDEV_UNREGISTER, but this patch
      leaves them on the places, since they require additional
      analysis, whether we need in them for something else.
      Signed-off-by: NKirill Tkhai <ktkhai@virtuozzo.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      070f2d7e
  19. 24 3月, 2018 1 次提交
    • P
      IB/cma: Resolve route only while receiving CM requests · 114cc9c4
      Parav Pandit 提交于
      Currently CM request for RoCE follows following flow.
      rdma_create_id()
      rdma_resolve_addr()
      rdma_resolve_route()
      For RC QPs:
      rdma_connect()
      ->cma_connect_ib()
        ->ib_send_cm_req()
          ->cm_init_av_by_path()
            ->ib_init_ah_attr_from_path()
      For UD QPs:
      rdma_connect()
      ->cma_resolve_ib_udp()
        ->ib_send_cm_sidr_req()
          ->cm_init_av_by_path()
            ->ib_init_ah_attr_from_path()
      
      In both the flows, route is already resolved before sending CM requests.
      Therefore, code is refactored to avoid resolving route second time in
      ib_cm layer.
      ib_init_ah_attr_from_path() is extended to resolve route when it is not
      yet resolved for RoCE link layer. This is achieved by caller setting
      route_resolved field in path record whenever it has route already
      resolved.
      Signed-off-by: NParav Pandit <parav@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      114cc9c4
  20. 23 3月, 2018 1 次提交
    • L
      RDMA/restrack: Remove ambiguity in resource track clean logic · 03286030
      Leon Romanovsky 提交于
      The restrack clean routine had simple, but powerful WARN_ON check
      to see if all resources are cleared prior to releasing device.
      
      The WARN_ON check performed very well, but lack of information
      which device caused to resource leak, the object type and origin
      made debug to be fun and challenging at the same time.
      
      The fact that all dumps were the same because restrack_clean() is
      called in dealloc() didn't help either.
      
      So let's fix spelling error and convert WARN_ON to be more debug
      friendly. The dmesg cut below gives example of how the output
      will look output for the case fixed in patch [1]
      
      [  438.421372] restrack: ------------[ cut here ]------------
      [  438.423448] restrack: BUG: RESTRACK detected leak of resources on mlx5_2
      [  438.425600] restrack: Kernel PD object allocated by mlx5_ib is not freed
      [  438.427753] restrack: Kernel CQ object allocated by mlx5_ib is not freed
      [  438.429660] restrack: ------------[ cut here ]------------
      
      [1] https://patchwork.kernel.org/patch/10298695/
      
      Cc: Michal Kalderon <Michal.Kalderon@cavium.com>
      Cc: Chuck Lever <chuck.lever@oracle.com>
      Reviewed-by: NMark Bloch <markb@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      03286030