1. 05 2月, 2019 1 次提交
  2. 31 1月, 2019 4 次提交
  3. 15 1月, 2019 2 次提交
  4. 11 1月, 2019 1 次提交
  5. 09 1月, 2019 1 次提交
  6. 20 12月, 2018 2 次提交
  7. 19 12月, 2018 1 次提交
    • M
      IB/uverbs: Add support to advise_mr · ad8a4496
      Moni Shoua 提交于
      Add new ioctl method for the MR object - ADVISE_MR.
      
      This command can be used by users to give an advice or directions to the
      kernel about an address range that belongs to memory regions.
      
      A new ib_device callback, advise_mr(), is introduced here to suupport the
      new command. This command takes the following arguments:
      
      - pd:		The protection domain to which all memory regions belong
      - advice: 	The type of the advice
      	  	* IB_UVERBS_ADVISE_MR_ADVICE_PREFETCH - Pre-fetch a range of
      		an on-demand paging MR
      	  	* IB_UVERBS_ADVISE_MR_ADVICE_PREFETCH_WRITE - Pre-fetch a range
      		of an on-demand paging MR with write intention
      - flags:	The properties of the advice
      		* IB_UVERBS_ADVISE_MR_FLAG_FLUSH - Operation must end before
      		return to the caller
      - sg_list:	The list of memory ranges
      - num_sge:	The number of memory ranges in the list
      - attrs:	More attributes to be parsed by the provider
      Signed-off-by: NMoni Shoua <monis@mellanox.com>
      Reviewed-by: NGuy Levi <guyle@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      ad8a4496
  8. 12 12月, 2018 5 次提交
  9. 04 12月, 2018 1 次提交
  10. 27 11月, 2018 2 次提交
  11. 23 11月, 2018 2 次提交
    • P
      RDMA/core: Sync unregistration with netlink commands · 01b67117
      Parav Pandit 提交于
      When the rdma device is getting removed, get resource info can race with
      device removal, as below:
      
            CPU-0                                  CPU-1
          --------                               --------
          rdma_nl_rcv_msg()
             nldev_res_get_cq_dumpit()
                mutex_lock(device_lock);
                get device reference
                mutex_unlock(device_lock);        [..]
                                                  ib_unregister_device()
                                                  /* Valid reference to
                                                   * device->dev exists.
                                                   */
                                                   ib_dealloc_device()
      
                [..]
                provider->fill_res_entry();
      
      Even though device object is not freed, fill_res_entry() can get called on
      device which doesn't have a driver anymore. Kernel core device reference
      count is not sufficient, as this only keeps the structure valid, and
      doesn't guarantee the driver is still loaded.
      
      Similar race can occur with device renaming and device removal, where
      device_rename() tries to rename a unregistered device. While this is fine
      for devices of a class which are not net namespace aware, but it is
      incorrect for net namespace aware class coming in subsequent series.  If a
      class is net namespace aware, then the below [1] call trace is observed in
      above situation.
      
      Therefore, to avoid the race, keep a reference count and let device
      unregistration wait until all netlink users drop the reference.
      
      [1] Call trace:
      kernfs: ns required in 'infiniband' for 'mlx5_0'
      WARNING: CPU: 18 PID: 44270 at fs/kernfs/dir.c:842 kernfs_find_ns+0x104/0x120
      libahci i2c_core mlxfw libata dca [last unloaded: devlink]
      RIP: 0010:kernfs_find_ns+0x104/0x120
      Call Trace:
      kernfs_find_and_get_ns+0x2e/0x50
      sysfs_rename_link_ns+0x40/0xb0
      device_rename+0xb2/0xf0
      ib_device_rename+0xb3/0x100 [ib_core]
      nldev_set_doit+0x165/0x190 [ib_core]
      rdma_nl_rcv_msg+0x249/0x250 [ib_core]
      ? netlink_deliver_tap+0x8f/0x3e0
      rdma_nl_rcv+0xd6/0x120 [ib_core]
      netlink_unicast+0x17c/0x230
      netlink_sendmsg+0x2f0/0x3e0
      sock_sendmsg+0x30/0x40
      __sys_sendto+0xdc/0x160
      
      Fixes: da5c8507 ("RDMA/nldev: add driver-specific resource tracking")
      Signed-off-by: NParav Pandit <parav@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      01b67117
    • J
      RDMA/uverbs: Use a linear list to describe the compiled-in uapi · 0cbf432d
      Jason Gunthorpe 提交于
      The 'tree' data structure is very hard to build at compile time, and this
      makes it very limited. The new radix tree based compiler can handle a more
      complex input language that does not require the compiler to perfectly
      group everything into a neat tree structure.
      
      Instead use a simple list to describe to input, where the list elements
      can be of various different 'opcodes' instructing the radix compiler what
      to do. Start out with opcodes chaining to other definition lists and
      chaining to the existing 'tree' definition.
      
      Replace the very top level of the 'object tree' with this list type and
      get rid of struct uverbs_object_tree_def and DECLARE_UVERBS_OBJECT_TREE.
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      0cbf432d
  12. 22 11月, 2018 1 次提交
  13. 07 11月, 2018 1 次提交
  14. 17 10月, 2018 2 次提交
  15. 11 10月, 2018 2 次提交
  16. 04 10月, 2018 2 次提交
  17. 27 9月, 2018 1 次提交
  18. 21 9月, 2018 5 次提交
  19. 18 9月, 2018 1 次提交
    • J
      IB/rxe: Revise the ib_wr_opcode enum · 9a59739b
      Jason Gunthorpe 提交于
      This enum has become part of the uABI, as both RXE and the
      ib_uverbs_post_send() command expect userspace to supply values from this
      enum. So it should be properly placed in include/uapi/rdma.
      
      In userspace this enum is called 'enum ibv_wr_opcode' as part of
      libibverbs.h. That enum defines different values for IB_WR_LOCAL_INV,
      IB_WR_SEND_WITH_INV, and IB_WR_LSO. These were introduced (incorrectly, it
      turns out) into libiberbs in 2015.
      
      The kernel has changed its mind on the numbering for several of the IB_WC
      values over the years, but has remained stable on IB_WR_LOCAL_INV and
      below.
      
      Based on this we can conclude that there is no real user space user of the
      values beyond IB_WR_ATOMIC_FETCH_AND_ADD, as they have never worked via
      rdma-core. This is confirmed by inspection, only rxe uses the kernel enum
      and implements the latter operations. rxe has clearly never worked with
      these attributes from userspace. Other drivers that support these opcodes
      implement the functionality without calling out to the kernel.
      
      To make IB_WR_SEND_WITH_INV and related work for RXE in userspace we
      choose to renumber the IB_WR enum in the kernel to match the uABI that
      userspace has bee using since before Soft RoCE was merged. This is an
      overall simpler configuration for the whole software stack, and obviously
      can't break anything existing.
      Reported-by: NSeth Howell <seth.howell@intel.com>
      Tested-by: NSeth Howell <seth.howell@intel.com>
      Fixes: 8700e3e7 ("Soft RoCE driver")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      9a59739b
  20. 11 9月, 2018 2 次提交
  21. 07 9月, 2018 1 次提交