1. 17 7月, 2020 1 次提交
  2. 23 6月, 2020 2 次提交
  3. 19 6月, 2020 1 次提交
  4. 18 6月, 2020 3 次提交
    • L
      RDMA/core: Check that type_attrs is not NULL prior access · 4121fb0d
      Leon Romanovsky 提交于
      In disassociate flow, the type_attrs is set to be NULL, which is in an
      implicit way is checked in alloc_uobj() by "if (!attrs->context)".
      
      Change the logic to rely on that check, to be consistent with other
      alloc_uobj() places that will fix the following kernel splat.
      
       BUG: kernel NULL pointer dereference, address: 0000000000000018
       #PF: supervisor read access in kernel mode
       #PF: error_code(0x0000) - not-present page
       PGD 0 P4D 0
       Oops: 0000 [#1] SMP PTI
       CPU: 3 PID: 2743 Comm: python3 Not tainted 5.7.0-rc6-for-upstream-perf-2020-05-23_19-04-38-5 #1
       Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org 04/01/2014
       RIP: 0010:alloc_begin_fd_uobject+0x18/0xf0 [ib_uverbs]
       Code: 89 43 48 eb 97 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 41 55 49 89 f5 41 54 55 48 89 fd 53 48 83 ec 08 48 8b 1f <48> 8b 43 18 48 8b 80 80 00 00 00 48 3d 20 10 33 a0 74 1c 48 3d 30
       RSP: 0018:ffffc90001127b70 EFLAGS: 00010282
       RAX: ffffffffa0339fe0 RBX: 0000000000000000 RCX: 8000000000000007
       RDX: fffffffffffffffb RSI: ffffc90001127d28 RDI: ffff88843fe1f600
       RBP: ffff88843fe1f600 R08: ffff888461eb06d8 R09: ffff888461eb06f8
       R10: ffff888461eb0700 R11: 0000000000000000 R12: ffff88846a5f6450
       R13: ffffc90001127d28 R14: ffff88845d7d6ea0 R15: ffffc90001127cb8
       FS: 00007f469bff1540(0000) GS:ffff88846f980000(0000) knlGS:0000000000000000
       CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
       CR2: 0000000000000018 CR3: 0000000450018003 CR4: 0000000000760ee0
       DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
       DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
       PKRU: 55555554
       Call Trace:
       ? xa_store+0x28/0x40
       rdma_alloc_begin_uobject+0x4f/0x90 [ib_uverbs]
       ib_uverbs_create_comp_channel+0x87/0xf0 [ib_uverbs]
       ib_uverbs_handler_UVERBS_METHOD_INVOKE_WRITE+0xb1/0xf0 [ib_uverbs]
       ib_uverbs_cmd_verbs.isra.8+0x96d/0xae0 [ib_uverbs]
       ? get_page_from_freelist+0x3bb/0xf70
       ? _copy_to_user+0x22/0x30
       ? uverbs_disassociate_api+0xd0/0xd0 [ib_uverbs]
       ? __wake_up_common_lock+0x87/0xc0
       ib_uverbs_ioctl+0xbc/0x130 [ib_uverbs]
       ksys_ioctl+0x83/0xc0
       ? ksys_write+0x55/0xd0
       __x64_sys_ioctl+0x16/0x20
       do_syscall_64+0x48/0x130
       entry_SYSCALL_64_after_hwframe+0x44/0xa9
       RIP: 0033:0x7f469ac43267
      
      Fixes: 849e1490 ("RDMA/core: Do not allow alloc_commit to fail")
      Link: https://lore.kernel.org/r/20200617061826.2625359-1-leon@kernel.orgSigned-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      4121fb0d
    • M
      RDMA/cma: Protect bind_list and listen_list while finding matching cm id · 730c8912
      Mark Zhang 提交于
      The bind_list and listen_list must be accessed under a lock, add the
      missing locking around the access in cm_ib_id_from_event()
      
      In addition add lockdep asserts to make it clearer what the locking
      semantic is here.
      
        general protection fault: 0000 [#1] SMP NOPTI
        CPU: 226 PID: 126135 Comm: kworker/226:1 Tainted: G OE 4.12.14-150.47-default #1 SLE15
        Hardware name: Cray Inc. Windom/Windom, BIOS 0.8.7 01-10-2020
        Workqueue: ib_cm cm_work_handler [ib_cm]
        task: ffff9c5a60a1d2c0 task.stack: ffffc1d91f554000
        RIP: 0010:cma_ib_req_handler+0x3f1/0x11b0 [rdma_cm]
        RSP: 0018:ffffc1d91f557b40 EFLAGS: 00010286
        RAX: deacffffffffff30 RBX: 0000000000000001 RCX: ffff9c2af5bb6000
        RDX: 00000000000000a9 RSI: ffff9c5aa4ed2f10 RDI: ffffc1d91f557b08
        RBP: ffffc1d91f557d90 R08: ffff9c340cc80000 R09: ffff9c2c0f901900
        R10: 0000000000000000 R11: 0000000000000001 R12: deacffffffffff30
        R13: ffff9c5a48aeec00 R14: ffffc1d91f557c30 R15: ffff9c5c2eea3688
        FS: 0000000000000000(0000) GS:ffff9c5c2fa80000(0000) knlGS:0000000000000000
        CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
        CR2: 00002b5cc03fa320 CR3: 0000003f8500a000 CR4: 00000000003406e0
        Call Trace:
        ? rdma_addr_cancel+0xa0/0xa0 [ib_core]
        ? cm_process_work+0x28/0x140 [ib_cm]
        cm_process_work+0x28/0x140 [ib_cm]
        ? cm_get_bth_pkey.isra.44+0x34/0xa0 [ib_cm]
        cm_work_handler+0xa06/0x1a6f [ib_cm]
        ? __switch_to_asm+0x34/0x70
        ? __switch_to_asm+0x34/0x70
        ? __switch_to_asm+0x40/0x70
        ? __switch_to_asm+0x34/0x70
        ? __switch_to_asm+0x40/0x70
        ? __switch_to_asm+0x34/0x70
        ? __switch_to_asm+0x40/0x70
        ? __switch_to+0x7c/0x4b0
        ? __switch_to_asm+0x40/0x70
        ? __switch_to_asm+0x34/0x70
        process_one_work+0x1da/0x400
        worker_thread+0x2b/0x3f0
        ? process_one_work+0x400/0x400
        kthread+0x118/0x140
        ? kthread_create_on_node+0x40/0x40
        ret_from_fork+0x22/0x40
        Code: 00 66 83 f8 02 0f 84 ca 05 00 00 49 8b 84 24 d0 01 00 00 48 85 c0 0f 84 68 07 00 00 48 2d d0 01
        00 00 49 89 c4 0f 84 59 07 00 00 <41> 0f b7 44 24 20 49 8b 77 50 66 83 f8 0a 75 9e 49 8b 7c 24 28
      
      Fixes: 4c21b5bc ("IB/cma: Add net_dev and private data checks to RDMA CM")
      Link: https://lore.kernel.org/r/20200616104304.2426081-1-leon@kernel.orgSigned-off-by: NMark Zhang <markz@mellanox.com>
      Reviewed-by: NMaor Gottlieb <maorg@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      730c8912
    • L
      RDMA/core: Annotate CMA unlock helper routine · 1ea7c546
      Leon Romanovsky 提交于
      Fix the following sparse error by adding annotation to
      cm_queue_work_unlock() that it releases cm_id_priv->lock lock.
      
       drivers/infiniband/core/cm.c:936:24: warning: context imbalance in
       'cm_queue_work_unlock' - unexpected unlock
      
      Fixes: e83f195a ("RDMA/cm: Pull duplicated code into cm_queue_work_unlock()")
      Link: https://lore.kernel.org/r/20200611130045.1994026-1-leon@kernel.orgReported-by: Nkernel test robot <lkp@intel.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      1ea7c546
  5. 10 6月, 2020 2 次提交
  6. 04 6月, 2020 1 次提交
  7. 03 6月, 2020 5 次提交
  8. 30 5月, 2020 3 次提交
    • Y
      RDMA/core: Introduce shared CQ pool API · c7ff819a
      Yamin Friedman 提交于
      Allow a ULP to ask the core to provide a completion queue based on a
      least-used search on a per-device CQ pools. The device CQ pools grow in a
      lazy fashion when more CQs are requested.
      
      This feature reduces the amount of interrupts when using many QPs.  Using
      shared CQs allows for more effcient completion handling. It also reduces
      the amount of overhead needed for CQ contexts.
      
      Test setup:
      Intel(R) Xeon(R) Platinum 8176M CPU @ 2.10GHz servers.
      Running NVMeoF 4KB read IOs over ConnectX-5EX across Spectrum switch.
      TX-depth = 32. The patch was applied in the nvme driver on both the target
      and initiator. Four controllers are accessed from each core. In the
      current test case we have exposed sixteen NVMe namespaces using four
      different subsystems (four namespaces per subsystem) from one NVM port.
      Each controller allocated X queues (RDMA QPs) and attached to Y CQs.
      Before this series we had X == Y, i.e for four controllers we've created
      total of 4X QPs and 4X CQs. In the shared case, we've created 4X QPs and
      only X CQs which means that we have four controllers that share a
      completion queue per core. Until fourteen cores there is no significant
      change in performance and the number of interrupts per second is less than
      a million in the current case.
      ==================================================
      |Cores|Current KIOPs  |Shared KIOPs  |improvement|
      |-----|---------------|--------------|-----------|
      |14   |2332           |2723          |16.7%      |
      |-----|---------------|--------------|-----------|
      |20   |2086           |2712          |30%        |
      |-----|---------------|--------------|-----------|
      |28   |1971           |2669          |35.4%      |
      |=================================================
      |Cores|Current avg lat|Shared avg lat|improvement|
      |-----|---------------|--------------|-----------|
      |14   |767us          |657us         |14.3%      |
      |-----|---------------|--------------|-----------|
      |20   |1225us         |943us         |23%        |
      |-----|---------------|--------------|-----------|
      |28   |1816us         |1341us        |26.1%      |
      ========================================================
      |Cores|Current interrupts|Shared interrupts|improvement|
      |-----|------------------|-----------------|-----------|
      |14   |1.6M/sec          |0.4M/sec         |72%        |
      |-----|------------------|-----------------|-----------|
      |20   |2.8M/sec          |0.6M/sec         |72.4%      |
      |-----|------------------|-----------------|-----------|
      |28   |2.9M/sec          |0.8M/sec         |63.4%      |
      ====================================================================
      |Cores|Current 99.99th PCTL lat|Shared 99.99th PCTL lat|improvement|
      |-----|------------------------|-----------------------|-----------|
      |14   |67ms                    |6ms                    |90.9%      |
      |-----|------------------------|-----------------------|-----------|
      |20   |5ms                     |6ms                    |-10%       |
      |-----|------------------------|-----------------------|-----------|
      |28   |8.7ms                   |6ms                    |25.9%      |
      |===================================================================
      
      Performance improvement with sixteen disks (sixteen CQs per core) is
      comparable.
      
      Link: https://lore.kernel.org/r/1590568495-101621-3-git-send-email-yaminf@mellanox.comSigned-off-by: NYamin Friedman <yaminf@mellanox.com>
      Reviewed-by: NOr Gerlitz <ogerlitz@mellanox.com>
      Reviewed-by: NMax Gurtovoy <maxg@mellanox.com>
      Reviewed-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      c7ff819a
    • Y
      RDMA/core: Add protection for shared CQs used by ULPs · 3446cbd2
      Yamin Friedman 提交于
      A pre-step for adding shared CQs. Add the infrastructure to prevent shared
      CQ users from altering the CQ configurations. For now all cqs are marked
      as private (non-shared). The core driver should use the new force
      functions to perform resize/destroy/moderation changes that are not
      allowed for users of shared CQs.
      
      Link: https://lore.kernel.org/r/1590568495-101621-2-git-send-email-yaminf@mellanox.comSigned-off-by: NYamin Friedman <yaminf@mellanox.com>
      Reviewed-by: NOr Gerlitz <ogerlitz@mellanox.com>
      Reviewed-by: NMax Gurtovoy <maxg@mellanox.com>
      Reviewed-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      3446cbd2
    • Q
      RDMA/core: Fix several reference count leaks. · 0b8e125e
      Qiushi Wu 提交于
      kobject_init_and_add() takes reference even when it fails.  If this
      function returns an error, kobject_put() must be called to properly clean
      up the memory associated with the object. Previous
      commit b8eb7183 ("net-sysfs: Fix reference count leak in
      rx|netdev_queue_add_kobject") fixed a similar problem.
      
      Link: https://lore.kernel.org/r/20200528030231.9082-1-wu000273@umn.eduSigned-off-by: NQiushi Wu <wu000273@umn.edu>
      Reviewed-by: NJason Gunthorpe <jgg@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      0b8e125e
  9. 28 5月, 2020 7 次提交
  10. 23 5月, 2020 1 次提交
  11. 22 5月, 2020 6 次提交
  12. 18 5月, 2020 3 次提交
  13. 13 5月, 2020 5 次提交