1. 29 9月, 2015 1 次提交
  2. 31 8月, 2015 10 次提交
    • Y
      IB/uverbs: Enable device removal when there are active user space applications · 036b1063
      Yishai Hadas 提交于
      Enables the uverbs_remove_one to succeed despite the fact that there are
      running IB applications working with the given ib device.  This
      functionality enables a HW device to be unbind/reset despite the fact that
      there are running user space applications using it.
      
      It exposes a new IB kernel API named 'disassociate_ucontext' which lets
      a driver detaching its HW resources from a given user context without
      crashing/terminating the application. In case a driver implemented the
      above API and registered with ib_uverb there will be no dependency between its
      device to its uverbs_device. Upon calling remove_one of ib_uverbs the call
      should return after disassociating the open HW resources without waiting to
      clients disconnecting. In case driver didn't implement this API there will be no
      change to current behaviour and uverbs_remove_one will return only when last
      client has disconnected and reference count on uverbs device became 0.
      
      In case the lower driver device was removed any application will
      continue working over some zombie HCA, further calls will ended with an
      immediate error.
      Signed-off-by: NYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: NShachar Raindel <raindel@mellanox.com>
      Reviewed-by: NJason Gunthorpe <jgunthorpe@obsidianresearch.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      036b1063
    • J
      IB/core: Make ib_dealloc_pd return void · 7dd78647
      Jason Gunthorpe 提交于
      The majority of callers never check the return value, and even if they
      did, they can't do anything about a failure.
      
      All possible failure cases represent a bug in the caller, so just
      WARN_ON inside the function instead.
      
      This fixes a few random errors:
       net/rd/iw.c infinite loops while it fails. (racing with EBUSY?)
      
      This also lays the ground work to get rid of error return from the
      drivers. Most drivers do not error, the few that do are broken since
      it cannot be handled.
      
      Since uverbs can legitimately make use of EBUSY, open code the
      check.
      Signed-off-by: NJason Gunthorpe <jgunthorpe@obsidianresearch.com>
      Reviewed-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      7dd78647
    • J
      IB/core: Guarantee that a local_dma_lkey is available · 96249d70
      Jason Gunthorpe 提交于
      Every single ULP requires a local_dma_lkey to do anything with
      a QP, so let us ensure one exists for every PD created.
      
      If the driver can supply a global local_dma_lkey then use that, otherwise
      ask the driver to create a local use all physical memory MR associated
      with the new PD.
      Signed-off-by: NJason Gunthorpe <jgunthorpe@obsidianresearch.com>
      Reviewed-by: NSagi Grimberg <sagig@dev.mellanox.co.il>
      Acked-by: NChristoph Hellwig <hch@infradead.org>
      Reviewed-by: NSteve Wise <swise@opengridcomputing.com>
      Reviewed-by: NIra Weiny <ira.weiny@intel.com>
      Tested-by: NIra Weiny <ira.weiny@intel.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      96249d70
    • M
      IB/mlx4: Implement ib_device callbacks · e26be1bf
      Moni Shoua 提交于
      get_netdev: get the net_device on the physical port of the IB transport port. In
      port aggregation mode it is required to return the netdev of the active port.
      
      modify_gid: note for a change in the RoCE gid cache. Handle this by writing to
      the harsware GID table. It is possible that indexes in cahce and hardware tables
      won't match so a translation is required when modifying a QP or creating an
      address handle.
      Signed-off-by: NMoni Shoua <monis@mellanox.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      e26be1bf
    • M
      IB/core: Add RoCE GID table management · 03db3a2d
      Matan Barak 提交于
      RoCE GIDs are based on IP addresses configured on Ethernet net-devices
      which relate to the RDMA (RoCE) device port.
      
      Currently, each of the low-level drivers that support RoCE (ocrdma,
      mlx4) manages its own RoCE port GID table. As there's nothing which is
      essentially vendor specific, we generalize that, and enhance the RDMA
      core GID cache to do this job.
      
      In order to populate the GID table, we listen for events:
      
      (a) netdev up/down/change_addr events - if a netdev is built onto
          our RoCE device, we need to add/delete its IPs. This involves
          adding all GIDs related to this ndev, add default GIDs, etc.
      
      (b) inet events - add new GIDs (according to the IP addresses)
          to the table.
      
      For programming the port RoCE GID table, providers must implement
      the add_gid and del_gid callbacks.
      
      RoCE GID management requires us to state the associated net_device
      alongside the GID. This information is necessary in order to manage
      the GID table. For example, when a net_device is removed, its
      associated GIDs need to be removed as well.
      
      RoCE mandates generating a default GID for each port, based on the
      related net-device's IPv6 link local. In contrast to the GID based on
      the regular IPv6 link-local (as we generate GID per IP address),
      the default GID is also available when the net device is down (in
      order to support loopback).
      
      Locking is done as follows:
      The patch modify the GID table code both for new RoCE drivers
      implementing the add_gid/del_gid callbacks and for current RoCE and
      IB drivers that do not. The flows for updating the table are
      different, so the locking requirements are too.
      
      While updating RoCE GID table, protection against multiple writers is
      achieved via mutex_lock(&table->lock). Since writing to a table
      requires us to find an entry (possible a free entry) in the table and
      then modify it, this mutex protects both the find_gid and write_gid
      ensuring the atomicity of the action.
      Each entry in the GID cache is protected by rwlock. In RoCE, writing
      (usually results from netdev notifier) involves invoking the vendor's
      add_gid and del_gid callbacks, which could sleep.
      Therefore, an invalid flag is added for each entry. Updates for RoCE are
      done via a workqueue, thus sleeping is permitted.
      
      In IB, updates are done in write_lock_irq(&device->cache.lock), thus
      write_gid isn't allowed to sleep and add_gid/del_gid are not called.
      
      When passing net-device into/out-of the GID cache, the device
      is always passed held (dev_hold).
      
      The code uses a single work item for updating all RDMA devices,
      following a netdev or inet notifier.
      
      The patch moves the cache from being a client (which was incorrect,
      as the cache is part of the IB infrastructure) to being explicitly
      initialized/freed when a device is registered/removed.
      Signed-off-by: NMatan Barak <matanb@mellanox.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      03db3a2d
    • S
      IB/core: Drop ib_alloc_fast_reg_mr · d9f272c5
      Sagi Grimberg 提交于
      Fully replaced by a more generic and suitable
      ib_alloc_mr.
      Signed-off-by: NSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      d9f272c5
    • S
      IB: Modify ib_create_mr API · 9bee178b
      Sagi Grimberg 提交于
      Use ib_alloc_mr with specific parameters.
      Change the existing callers.
      Signed-off-by: NSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      9bee178b
    • S
      IB/core: Get rid of redundant verb ib_destroy_mr · 8b91ffc1
      Sagi Grimberg 提交于
      This was added in a thought of uniting all mr allocation
      and deallocation routines but the fact is we have a single
      deallocation routine already, ib_dereg_mr.
      
      And, move mlx5_ib_destroy_mr specific logic into mlx5_ib_dereg_mr
      (includes only signature stuff for now).
      
      And, fixup the only callers (iser/isert) accordingly.
      Signed-off-by: NSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      8b91ffc1
    • Y
      IB/core: Find the network device matching connection parameters · 9268f72d
      Yotam Kenneth 提交于
      In the case of IPoIB, and maybe in other cases, the network device is
      managed by an upper-layer protocol (ULP). In order to expose this
      network device to other users of the IB device, let ULPs implement
      a callback that returns network device according to connection parameters.
      
      The IB device and port, together with the P_Key and the GID should
      be enough to uniquely identify the ULP net device. However, in current
      kernels there can be multiple IPoIB interfaces created with the same GID.
      Furthermore, such configuration may be desireable to support ipvlan-like
      configurations for RDMA CM with IPoIB.  To resolve the device in these
      cases the code will also take the IP address as an additional input.
      Reviewed-by: NJason Gunthorpe <jgunthorpe@obsidianresearch.com>
      Signed-off-by: NHaggai Eran <haggaie@mellanox.com>
      Signed-off-by: NYotam Kenneth <yotamke@mellanox.com>
      Signed-off-by: NShachar Raindel <raindel@mellanox.com>
      Signed-off-by: NGuy Shapiro <guysh@mellanox.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      9268f72d
    • H
      IB/core: lock client data with lists_rwsem · 7c1eb45a
      Haggai Eran 提交于
      An ib_client callback that is called with the lists_rwsem locked only for
      read is protected from changes to the IB client lists, but not from
      ib_unregister_device() freeing its client data. This is because
      ib_unregister_device() will remove the device from the device list with
      lists_rwsem locked for write, but perform the rest of the cleanup,
      including the call to remove() without that lock.
      
      Mark client data that is undergoing de-registration with a new going_down
      flag in the client data context. Lock the client data list with lists_rwsem
      for write in addition to using the spinlock, so that functions calling the
      callback would be able to lock only lists_rwsem for read and let callbacks
      sleep.
      
      Since ib_unregister_client() now marks the client data context, no need for
      remove() to search the context again, so pass the client data directly to
      remove() callbacks.
      Reviewed-by: NJason Gunthorpe <jgunthorpe@obsidianresearch.com>
      Signed-off-by: NHaggai Eran <haggaie@mellanox.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      7c1eb45a
  3. 29 8月, 2015 1 次提交
  4. 06 8月, 2015 1 次提交
  5. 15 7月, 2015 1 次提交
  6. 13 6月, 2015 8 次提交
  7. 11 6月, 2015 1 次提交
  8. 02 6月, 2015 3 次提交
  9. 21 5月, 2015 3 次提交
  10. 19 5月, 2015 11 次提交