1. 21 2月, 2020 1 次提交
  2. 20 2月, 2020 1 次提交
  3. 19 2月, 2020 1 次提交
  4. 31 1月, 2020 1 次提交
    • J
      RDMA/core: Make the entire API tree static · 8889f6fa
      Jason Gunthorpe 提交于
      Compilation of mlx5 driver without CONFIG_INFINIBAND_USER_ACCESS generates
      the following error.
      
      on x86_64:
      
       ld: drivers/infiniband/hw/mlx5/main.o: in function `mlx5_ib_handler_MLX5_IB_METHOD_VAR_OBJ_ALLOC':
       main.c:(.text+0x186d): undefined reference to `ib_uverbs_get_ucontext_file'
       ld: drivers/infiniband/hw/mlx5/main.o:(.rodata+0x2480): undefined reference to `uverbs_idr_class'
       ld: drivers/infiniband/hw/mlx5/main.o:(.rodata+0x24d8): undefined reference to `uverbs_destroy_def_handler'
      
      This is happening because some parts of the UAPI description are not
      static. This is a hold over from earlier code that relied on struct
      pointers to refer to object types, now object types are referenced by
      number. Remove the unused globals and add statics to the remaining UAPI
      description elements.
      
      Remove the redundent #ifdefs around mlx5_ib_*defs and obsolete
      mlx5_ib_get_devx_tree().
      
      The compiler now trims alot more unused code, including the above
      problematic definitions when !CONFIG_INFINIBAND_USER_ACCESS.
      
      Fixes: 7be76bef ("IB/mlx5: Introduce VAR object and its alloc/destroy methods")
      Reported-by: NRandy Dunlap <rdunlap@infradead.org>
      Acked-by: NRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      8889f6fa
  5. 26 1月, 2020 2 次提交
  6. 17 1月, 2020 3 次提交
  7. 16 1月, 2020 3 次提交
  8. 14 1月, 2020 9 次提交
  9. 08 1月, 2020 4 次提交
  10. 04 1月, 2020 2 次提交
  11. 13 12月, 2019 1 次提交
  12. 24 11月, 2019 1 次提交
    • J
      RDMA/odp: Use mmu_interval_notifier_insert() · f25a546e
      Jason Gunthorpe 提交于
      Replace the internal interval tree based mmu notifier with the new common
      mmu_interval_notifier_insert() API. This removes a lot of code and fixes a
      deadlock that can be triggered in ODP:
      
       zap_page_range()
        mmu_notifier_invalidate_range_start()
         [..]
          ib_umem_notifier_invalidate_range_start()
             down_read(&per_mm->umem_rwsem)
        unmap_single_vma()
          [..]
            __split_huge_page_pmd()
              mmu_notifier_invalidate_range_start()
              [..]
                 ib_umem_notifier_invalidate_range_start()
                    down_read(&per_mm->umem_rwsem)   // DEADLOCK
      
              mmu_notifier_invalidate_range_end()
                 up_read(&per_mm->umem_rwsem)
        mmu_notifier_invalidate_range_end()
           up_read(&per_mm->umem_rwsem)
      
      The umem_rwsem is held across the range_start/end as the ODP algorithm for
      invalidate_range_end cannot tolerate changes to the interval
      tree. However, due to the nested invalidation regions the second
      down_read() can deadlock if there are competing writers. The new core code
      provides an alternative scheme to solve this problem.
      
      Fixes: ca748c39 ("RDMA/umem: Get rid of per_mm->notifier_count")
      Link: https://lore.kernel.org/r/20191112202231.3856-6-jgg@ziepe.caTested-by: NArtemy Kovalyov <artemyko@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      f25a546e
  13. 23 11月, 2019 1 次提交
  14. 17 11月, 2019 1 次提交
  15. 13 11月, 2019 1 次提交
  16. 07 11月, 2019 3 次提交
  17. 29 10月, 2019 3 次提交
    • J
      RDMA/mlx5: Rework implicit ODP destroy · 5256edcb
      Jason Gunthorpe 提交于
      Use SRCU in a sensible way by removing all MRs in the implicit tree from
      the two xarrays (the update operation), then a synchronize, followed by a
      normal single threaded teardown.
      
      This is only a little unusual from the normal pattern as there can still
      be some work pending in the unbound wq that may also require a workqueue
      flush. This is tracked with a single atomic, consolidating the redundant
      existing atomics and wait queue.
      
      For understand-ability the entire ODP implicit create/destroy flow now
      largely exists in a single pair of functions within odp.c, with a few
      support functions for tearing down an unused child.
      
      Link: https://lore.kernel.org/r/20191009160934.3143-13-jgg@ziepe.caReviewed-by: NArtemy Kovalyov <artemyko@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      5256edcb
    • J
      RDMA/mlx5: Use an xarray for the children of an implicit ODP · 423f52d6
      Jason Gunthorpe 提交于
      Currently the child leaves are stored in the shared interval tree and
      every lookup for a child must be done under the interval tree rwsem.
      
      This is further complicated by dropping the rwsem during iteration (ie the
      odp_lookup(), odp_next() pattern), which requires a very tricky an
      difficult to understand locking scheme with SRCU.
      
      Instead reserve the interval tree for the exclusive use of the mmu
      notifier related code in umem_odp.c and give each implicit MR a xarray
      containing all the child MRs.
      
      Since the size of each child is 1GB of VA, a 1 level xarray will index 64G
      of VA, and a 2 level will index 2TB, making xarray a much better
      data structure choice than an interval tree.
      
      The locking properties of xarray will be used in the next patches to
      rework the implicit ODP locking scheme into something simpler.
      
      At this point, the xarray is locked by the implicit MR's umem_mutex, and
      read can also be locked by the odp_srcu.
      
      Link: https://lore.kernel.org/r/20191009160934.3143-10-jgg@ziepe.caReviewed-by: NArtemy Kovalyov <artemyko@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      423f52d6
    • B
      RDMA/core: Fix ib_dma_max_seg_size() · ecdfdfdb
      Bart Van Assche 提交于
      If dev->dma_device->params == NULL then the maximum DMA segment size is 64
      KB. See also the dma_get_max_seg_size() implementation. This patch fixes
      the following kernel warning:
      
        DMA-API: infiniband rxe0: mapping sg segment longer than device claims to support [len=126976] [max=65536]
        WARNING: CPU: 4 PID: 4848 at kernel/dma/debug.c:1220 debug_dma_map_sg+0x3d9/0x450
        RIP: 0010:debug_dma_map_sg+0x3d9/0x450
        Call Trace:
         srp_queuecommand+0x626/0x18d0 [ib_srp]
         scsi_queue_rq+0xd02/0x13e0 [scsi_mod]
         __blk_mq_try_issue_directly+0x2b3/0x3f0
         blk_mq_request_issue_directly+0xac/0xf0
         blk_insert_cloned_request+0xdf/0x170
         dm_mq_queue_rq+0x43d/0x830 [dm_mod]
         __blk_mq_try_issue_directly+0x2b3/0x3f0
         blk_mq_request_issue_directly+0xac/0xf0
         blk_mq_try_issue_list_directly+0xb8/0x170
         blk_mq_sched_insert_requests+0x23c/0x3b0
         blk_mq_flush_plug_list+0x529/0x730
         blk_flush_plug_list+0x21f/0x260
         blk_mq_make_request+0x56b/0xf20
         generic_make_request+0x196/0x660
         submit_bio+0xae/0x290
         blkdev_direct_IO+0x822/0x900
         generic_file_direct_write+0x110/0x200
         __generic_file_write_iter+0x124/0x2a0
         blkdev_write_iter+0x168/0x270
         aio_write+0x1c4/0x310
         io_submit_one+0x971/0x1390
         __x64_sys_io_submit+0x12a/0x390
         do_syscall_64+0x6f/0x2e0
         entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
      Link: https://lore.kernel.org/r/20191025225830.257535-2-bvanassche@acm.org
      Cc: <stable@vger.kernel.org>
      Fixes: 0b5cb330 ("RDMA/srp: Increase max_segment_size")
      Signed-off-by: NBart Van Assche <bvanassche@acm.org>
      Reviewed-by: NJason Gunthorpe <jgg@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      ecdfdfdb
  18. 28 10月, 2019 2 次提交