1. 28 8月, 2019 9 次提交
  2. 26 8月, 2019 1 次提交
  3. 22 8月, 2019 12 次提交
  4. 21 8月, 2019 3 次提交
  5. 14 8月, 2019 10 次提交
    • L
      RDMA/hns: Remove unuseful member · 77905379
      Lang Cheng 提交于
      For struct hns_roce_cmdq, toggle is unused and
      delete it.
      Signed-off-by: NLang Cheng <chenglang@huawei.com>
      Link: https://lore.kernel.org/r/1565343666-73193-8-git-send-email-oulijun@huawei.comSigned-off-by: NDoug Ledford <dledford@redhat.com>
      77905379
    • X
      RDMA/hns: bugfix for slab-out-of-bounds when loading hip08 driver · bf8c02f9
      Xi Wang 提交于
      kasan will report a BUG when run command 'insmod hns_roce_hw_v2.ko', the
      calltrace is as follows:
      
      ==================================================================
      BUG: KASAN: slab-out-of-bounds in hns_roce_v2_init_eq_table+0x1324/0x1948
      [hns_roce_hw_v2]
      Read of size 8 at addr ffff8020e7a10608 by task insmod/256
      
      CPU: 0 PID: 256 Comm: insmod Tainted: G           O      5.2.0-rc4 #1
      Hardware name: Huawei D06 /D06, BIOS Hisilicon D06 UEFI RC0
      Call trace:
      dump_backtrace+0x0/0x1e8
      show_stack+0x14/0x20
      dump_stack+0xc4/0xfc
      print_address_description+0x60/0x270
      __kasan_report+0x164/0x1b8
      kasan_report+0xc/0x18
      __asan_load8+0x84/0xa8
      hns_roce_v2_init_eq_table+0x1324/0x1948 [hns_roce_hw_v2]
      hns_roce_init+0xf8/0xfe0 [hns_roce]
      __hns_roce_hw_v2_init_instance+0x284/0x330 [hns_roce_hw_v2]
      hns_roce_hw_v2_init_instance+0xd0/0x1b8 [hns_roce_hw_v2]
      hclge_init_roce_client_instance+0x180/0x310 [hclge]
      hclge_init_client_instance+0xcc/0x508 [hclge]
      hnae3_init_client_instance.part.3+0x3c/0x80 [hnae3]
      hnae3_register_client+0x134/0x1a8 [hnae3]
      hns_roce_hw_v2_init+0x14/0x10000 [hns_roce_hw_v2]
      do_one_initcall+0x9c/0x3e0
      do_init_module+0xd4/0x2d8
      load_module+0x3284/0x3690
      __se_sys_init_module+0x274/0x308
      __arm64_sys_init_module+0x40/0x50
      el0_svc_handler+0xbc/0x210
      el0_svc+0x8/0xc
      
      Allocated by task 256:
      __kasan_kmalloc.isra.0+0xd0/0x180
      kasan_kmalloc+0xc/0x18
      __kmalloc+0x16c/0x328
      hns_roce_v2_init_eq_table+0x764/0x1948 [hns_roce_hw_v2]
      hns_roce_init+0xf8/0xfe0 [hns_roce]
      __hns_roce_hw_v2_init_instance+0x284/0x330 [hns_roce_hw_v2]
      hns_roce_hw_v2_init_instance+0xd0/0x1b8 [hns_roce_hw_v2]
      hclge_init_roce_client_instance+0x180/0x310 [hclge]
      hclge_init_client_instance+0xcc/0x508 [hclge]
      hnae3_init_client_instance.part.3+0x3c/0x80 [hnae3]
      hnae3_register_client+0x134/0x1a8 [hnae3]
      hns_roce_hw_v2_init+0x14/0x10000 [hns_roce_hw_v2]
      do_one_initcall+0x9c/0x3e0
      do_init_module+0xd4/0x2d8
      load_module+0x3284/0x3690
      __se_sys_init_module+0x274/0x308
      __arm64_sys_init_module+0x40/0x50
      el0_svc_handler+0xbc/0x210
      el0_svc+0x8/0xc
      
      Freed by task 0:
      (stack is not available)
      
      The buggy address belongs to the object at ffff8020e7a10600
      which belongs to the cache kmalloc-128 of size 128
      The buggy address is located 8 bytes inside of
      128-byte region [ffff8020e7a10600, ffff8020e7a10680)
      The buggy address belongs to the page:
      page:ffff7fe00839e840 refcount:1 mapcount:0 mapping:ffff802340020200 index:0x0
      flags: 0x5fffe00000000200(slab)
      raw: 5fffe00000000200 dead000000000100 dead000000000200 ffff802340020200
      raw: 0000000000000000 0000000081000100 00000001ffffffff 0000000000000000
      page dumped because: kasan: bad access detected
      
      Memory state around the buggy address:
      ffff8020e7a10500: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
      ffff8020e7a10580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
      >ffff8020e7a10600: 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
      ^
      ffff8020e7a10680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
      ffff8020e7a10700: 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
      ==================================================================
      Disabling lock debugging due to kernel taint
      
      Fixes: a5073d60 ("RDMA/hns: Add eq support of hip08")
      Signed-off-by: NXi Wang <wangxi11@huawei.com>
      Link: https://lore.kernel.org/r/1565343666-73193-7-git-send-email-oulijun@huawei.comSigned-off-by: NDoug Ledford <dledford@redhat.com>
      bf8c02f9
    • X
      RDMA/hns: Bugfix for slab-out-of-bounds when unloading hip08 driver · 9bba3f0c
      Xi Wang 提交于
      kasan will report a BUG when run command 'rmmod hns_roce_hw_v2', the calltrace
      is as follows:
      
      ==================================================================
      BUG: KASAN: slab-out-of-bounds in hns_roce_table_mhop_put+0x584/0x828
      [hns_roce]
      Read of size 8 at addr ffff802185e08300 by task rmmod/270
      
      Call trace:
      dump_backtrace+0x0/0x1e8
      show_stack+0x14/0x20
      dump_stack+0xc4/0xfc
      print_address_description+0x60/0x270
      __kasan_report+0x164/0x1b8
      kasan_report+0xc/0x18
      __asan_load8+0x84/0xa8
      hns_roce_table_mhop_put+0x584/0x828 [hns_roce]
      hns_roce_table_put+0x174/0x1a0 [hns_roce]
      hns_roce_mr_free+0x124/0x210 [hns_roce]
      hns_roce_dereg_mr+0x90/0xb8 [hns_roce]
      ib_dealloc_pd_user+0x60/0xf0
      ib_mad_port_close+0x128/0x1d8
      ib_mad_remove_device+0x94/0x118
      remove_client_context+0xa0/0xe0
      disable_device+0xfc/0x1c0
      __ib_unregister_device+0x60/0xe0
      ib_unregister_device+0x24/0x38
      hns_roce_exit+0x3c/0x138 [hns_roce]
      __hns_roce_hw_v2_uninit_instance.isra.30+0x28/0x50 [hns_roce_hw_v2]
      hns_roce_hw_v2_uninit_instance+0x44/0x60 [hns_roce_hw_v2]
      hclge_uninit_client_instance+0x15c/0x238 [hclge]
      hnae3_uninit_client_instance+0x84/0xa8 [hnae3]
      hnae3_unregister_client+0x84/0x158 [hnae3]
      hns_roce_hw_v2_exit+0x14/0x20 [hns_roce_hw_v2]
      __arm64_sys_delete_module+0x20c/0x308
      el0_svc_handler+0xbc/0x210
      el0_svc+0x8/0xc
      
      Allocated by task 255:
      __kasan_kmalloc.isra.0+0xd0/0x180
      kasan_kmalloc+0xc/0x18
      __kmalloc+0x16c/0x328
      hns_roce_init_hem_table+0x20c/0x428 [hns_roce]
      hns_roce_init+0x214/0xfe0 [hns_roce]
      __hns_roce_hw_v2_init_instance+0x284/0x330 [hns_roce_hw_v2]
      hns_roce_hw_v2_init_instance+0xd0/0x1b8 [hns_roce_hw_v2]
      hclge_init_roce_client_instance+0x180/0x310 [hclge]
      hclge_init_client_instance+0xcc/0x508 [hclge]
      hnae3_init_client_instance.part.3+0x3c/0x80 [hnae3]
      hnae3_register_client+0x134/0x1a8 [hnae3]
      0xffff200009c00014
      do_one_initcall+0x9c/0x3e0
      do_init_module+0xd4/0x2d8
      load_module+0x3284/0x3690
      __se_sys_init_module+0x274/0x308
      __arm64_sys_init_module+0x40/0x50
      el0_svc_handler+0xbc/0x210
      el0_svc+0x8/0xc
      
      Freed by task 0:
      (stack is not available)
      
      The buggy address belongs to the object at ffff802185e06300
      which belongs to the cache kmalloc-8k of size 8192
      The buggy address is located 0 bytes to the right of
      8192-byte region [ffff802185e06300, ffff802185e08300)
      The buggy address belongs to the page:
      page:ffff7fe008617800 refcount:1 mapcount:0 mapping:ffff802340020e00 index:0x0
      compound_mapcount: 0
      flags: 0x5fffe00000010200(slab|head)
      raw: 5fffe00000010200 dead000000000100 dead000000000200 ffff802340020e00
      raw: 0000000000000000 00000000803e003e 00000001ffffffff 0000000000000000
      page dumped because: kasan: bad access detected
      
      Memory state around the buggy address:
      ffff802185e08200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      ffff802185e08280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      >ffff802185e08300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
      ^
      ffff802185e08380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
      ffff802185e08400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      ==================================================================
      Disabling lock debugging due to kernel taint
      
      Fixes: a25d13cb ("RDMA/hns: Add the interfaces to support multi hop addressing for the contexts in hip08")
      Signed-off-by: NXi Wang <wangxi11@huawei.com>
      Link: https://lore.kernel.org/r/1565343666-73193-6-git-send-email-oulijun@huawei.comSigned-off-by: NDoug Ledford <dledford@redhat.com>
      9bba3f0c
    • Y
      RDMA/hns: Modify pi vlaue when cq overflows · d7e5ca88
      Yangyang Li 提交于
      When exiting "for loop", the actual value of pi will be
      increased by 1, which is compatible with the next calculation.
      But when pi is equal to "ci + hr_cq-> ib_cq.cqe", the "break"
      was called and the pi is actual value, it will lead one cqe
      still existing, so the "==" should be modify to ">".
      Signed-off-by: NYangyang Li <liyangyang20@huawei.com>
      Link: https://lore.kernel.org/r/1565343666-73193-5-git-send-email-oulijun@huawei.comSigned-off-by: NDoug Ledford <dledford@redhat.com>
      d7e5ca88
    • L
      RDMA/hns: Bugfix for creating qp attached to srq · 76827087
      Lijun Ou 提交于
      When create a qp and attached to srq, rq will no longer be used
      and the members of rq will be set zero. As a result, the wrid
      of rq will not be allocated and used.
      
      Fixes: 926a01dc ("RDMA/hns: Add QP operations support for hip08 SoC")
      Signed-off-by: NLijun Ou <oulijun@huawei.com>
      Link: https://lore.kernel.org/r/1565343666-73193-3-git-send-email-oulijun@huawei.comSigned-off-by: NDoug Ledford <dledford@redhat.com>
      76827087
    • W
      RDMA/hns: Logic optimization of wc_flags · 0e1aa6f0
      Weihang Li 提交于
      We should set IB_WC_WITH_VLAN only when VLAN is enabled.
      In addition, move setting of IB_WC_WITH_SMAC below
      setting of wc->smac.
      Signed-off-by: NWeihang Li <liweihang@hisilicon.com>
      Link: https://lore.kernel.org/r/1565343666-73193-2-git-send-email-oulijun@huawei.comSigned-off-by: NDoug Ledford <dledford@redhat.com>
      0e1aa6f0
    • L
      RDMA/mlx5: Annotate lock dependency in bind/unbind slave port · 9dc4cfff
      Leon Romanovsky 提交于
      NULL-ing notifier_call is performed under protection
      of mlx5_ib_multiport_mutex lock. Such protection is
      not easily spotted and better to be guarded by lockdep
      annotation.
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Link: https://lore.kernel.org/r/20190813102814.22350-1-leon@kernel.orgSigned-off-by: NDoug Ledford <dledford@redhat.com>
      9dc4cfff
    • Y
      IB/mlx5: Expose XRQ legacy commands over the DEVX interface · 8293a598
      Yishai Hadas 提交于
      Expose missing XRQ legacy commands over the DEVX interface.
      Signed-off-by: NYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Link: https://lore.kernel.org/r/20190808084358.29517-5-leon@kernel.orgSigned-off-by: NDoug Ledford <dledford@redhat.com>
      8293a598
    • Y
      IB/mlx5: Add legacy events to DEVX list · 972d7560
      Yishai Hadas 提交于
      Add two events that were defined in the device specification but were
      not exposed in the driver list.
      
      Post this patch those events can be read over the DEVX events interface
      once be reported by the firmware.
      Signed-off-by: NYishai Hadas <yishaih@mellanox.com>
      Reviewed-by: NEdward Srouji <edwards@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Link: https://lore.kernel.org/r/20190808084358.29517-4-leon@kernel.orgSigned-off-by: NDoug Ledford <dledford@redhat.com>
      972d7560
    • B
      RDMA/siw: Change CQ flags from 64->32 bits · 2c8ccb37
      Bernard Metzler 提交于
      This patch changes the driver/user shared (mmapped) CQ notification
      flags field from unsigned 64-bits size to unsigned 32-bits size. This
      enables building siw on 32-bit architectures.
      
      This patch changes the siw-abi, but as siw was only just merged in
      this merge window cycle, there are no released kernels with the prior
      abi.  We are making no attempt to be binary compatible with siw user
      space libraries prior to the merge of siw into the upstream kernel,
      only moving forward with upstream kernels and upstream rdma-core
      provided siw libraries are we guaranteeing compatibility.
      Signed-off-by: NBernard Metzler <bmt@zurich.ibm.com>
      Link: https://lore.kernel.org/r/20190809151816.13018-1-bmt@zurich.ibm.comSigned-off-by: NDoug Ledford <dledford@redhat.com>
      2c8ccb37
  6. 12 8月, 2019 5 次提交
    • D
      RDMA/core: Fix error code in stat_get_doit_qp() · 932727c5
      Dan Carpenter 提交于
      We need to set the error codes on these paths.  Currently the only
      possible error code is -EMSGSIZE so that's what the patch uses.
      
      Fixes: 83c2c1fc ("RDMA/nldev: Allow get counter mode through RDMA netlink")
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Reviewed-by: NLeon Romanovsky <leonro@mellanox.com>
      Link: https://lore.kernel.org/r/20190809101311.GA17867@mwandaSigned-off-by: NDoug Ledford <dledford@redhat.com>
      932727c5
    • D
      RDMA/siw: Fix a memory leak in siw_init_cpulist() · 17c19287
      Dan Carpenter 提交于
      The error handling code doesn't free siw_cpu_info.tx_valid_cpus[0].  The
      first iteration through the loop is a no-op so this is sort of an off
      by one bug.  Also Bernard pointed out that we can remove the NULL
      assignment and simplify the code a bit.
      
      Fixes: bdcf26bf ("rdma/siw: network and RDMA core interface")
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Reviewed-by: NBernard Metzler <bmt@zurich.ibm.com>
      Reviewed-by: NBernard Metzler <bmt@zurich.ibm.com>
      Link: https://lore.kernel.org/r/20190809140904.GB3552@mwandaSigned-off-by: NDoug Ledford <dledford@redhat.com>
      17c19287
    • Y
      IB/mlx5: Fix use-after-free error while accessing ev_file pointer · e9eec6a5
      Yishai Hadas 提交于
      Call to uverbs_close_fd() releases file pointer to 'ev_file' and
      mlx5_ib_dev is going to be inaccessible. Cache pointer prior cleaning
      resources to solve the KASAN warning below.
      
      BUG: KASAN: use-after-free in devx_async_event_close+0x391/0x480 [mlx5_ib]
      Read of size 8 at addr ffff888301e3cec0 by task devx_direct_tes/4631
      CPU: 1 PID: 4631 Comm: devx_direct_tes Tainted: G OE 5.3.0-rc1-for-upstream-dbg-2019-07-26_01-19-56-93 #1
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu2 04/01/2014
      Call Trace:
      dump_stack+0x9a/0xeb
      print_address_description+0x1e2/0x400
      ? devx_async_event_close+0x391/0x480 [mlx5_ib]
      __kasan_report+0x15c/0x1df
      ? devx_async_event_close+0x391/0x480 [mlx5_ib]
      kasan_report+0xe/0x20
      devx_async_event_close+0x391/0x480 [mlx5_ib]
      __fput+0x26a/0x7b0
      task_work_run+0x10d/0x180
      exit_to_usermode_loop+0x137/0x160
      do_syscall_64+0x3c7/0x490
      entry_SYSCALL_64_after_hwframe+0x49/0xbe
      RIP: 0033:0x7f5df907d664
      Code: 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f
      80 00 00 00 00 8b 05 6a cd 20 00 48 63 ff 85 c0 75 13 b8
      03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 44 f3 c3 66 90
      48 83 ec 18 48 89 7c 24 08 e8
      RSP: 002b:00007ffd353cb958 EFLAGS: 00000246 ORIG_RAX: 0000000000000003
      RAX: 0000000000000000 RBX: 000056017a88c348 RCX: 00007f5df907d664
      RDX: 00007f5df969d400 RSI: 00007f5de8f1ec90 RDI: 0000000000000006
      RBP: 00007f5df9681dc0 R08: 00007f5de8736410 R09: 000056017a9d2dd0
      R10: 000000000000000b R11: 0000000000000246 R12: 00007f5de899d7d0
      R13: 00007f5df96c4248 R14: 00007f5de8f1ecb0 R15: 000056017ae41308
      
      Allocated by task 4631:
      save_stack+0x19/0x80
      kasan_kmalloc.constprop.3+0xa0/0xd0
      alloc_uobj+0x71/0x230 [ib_uverbs]
      alloc_begin_fd_uobject+0x2e/0xc0 [ib_uverbs]
      rdma_alloc_begin_uobject+0x96/0x140 [ib_uverbs]
      ib_uverbs_run_method+0xdf0/0x1940 [ib_uverbs]
      ib_uverbs_cmd_verbs+0x57e/0xdb0 [ib_uverbs]
      ib_uverbs_ioctl+0x177/0x260 [ib_uverbs]
      do_vfs_ioctl+0x18f/0x1010
      ksys_ioctl+0x70/0x80
      __x64_sys_ioctl+0x6f/0xb0
      do_syscall_64+0x95/0x490
      entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
      Freed by task 4631:
      save_stack+0x19/0x80
      __kasan_slab_free+0x11d/0x160
      slab_free_freelist_hook+0x67/0x1a0
      kfree+0xb9/0x2a0
      uverbs_close_fd+0x118/0x1c0 [ib_uverbs]
      devx_async_event_close+0x28a/0x480 [mlx5_ib]
      __fput+0x26a/0x7b0
      task_work_run+0x10d/0x180
      exit_to_usermode_loop+0x137/0x160
      do_syscall_64+0x3c7/0x490
      entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
      The buggy address belongs to the object at ffff888301e3cda8
      which belongs to the cache kmalloc-512 of size 512
      The buggy address is located 280 bytes inside of 512-byte region
      [ffff888301e3cda8, ffff888301e3cfa8)
      The buggy address belongs to the page:
      page:ffffea000c078e00 refcount:1 mapcount:0
      mapping:ffff888352811300 index:0x0 compound_mapcount: 0
      flags: 0x2fffff80010200(slab|head)
      raw: 002fffff80010200 ffffea000d152608 ffffea000c077808 ffff888352811300
      raw: 0000000000000000 0000000000250025 00000001ffffffff 0000000000000000
      page dumped because: kasan: bad access detected
      Memory state around the buggy address:
      ffff888301e3cd80: fc fc fc fc fc fb fb fb fb fb fb fb fb fb fb fb
      ffff888301e3ce00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      ffff888301e3ce80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      ffff888301e3cf00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      ffff888301e3cf80: fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc
      Disabling lock debugging due to kernel taint
      
      Cc: <stable@vger.kernel.org> # 5.2
      Fixes: 75973853 ("IB/mlx5: Enable subscription for device events over DEVX")
      Signed-off-by: NYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Reviewed-by: NJason Gunthorpe <jgg@mellanox.com>
      Link: https://lore.kernel.org/r/20190808081538.28772-1-leon@kernel.orgSigned-off-by: NDoug Ledford <dledford@redhat.com>
      e9eec6a5
    • L
      RDMA/hns: Use the new APIs for printing log · db50077b
      Lijun Ou 提交于
      Here uses the new APIs instead of some dev print interfaces in
      some functions.
      Signed-off-by: NLijun Ou <oulijun@huawei.com>
      Link: https://lore.kernel.org/r/1565276034-97329-15-git-send-email-oulijun@huawei.comSigned-off-by: NDoug Ledford <dledford@redhat.com>
      db50077b
    • W
      RDMA/hns: Disable alw_lcl_lpbk of SSU · d967e262
      Weihang Li 提交于
      If we enabled alw_lcl_lpbk in promiscuous mode, packet whose source
      and destination mac address is equal will be handled in both inner
      loopback and outer loopback. This will halve performance of roce in
      promiscuous mode.
      Signed-off-by: NWeihang Li <liweihang@hisilicon.com>
      Link: https://lore.kernel.org/r/1565276034-97329-14-git-send-email-oulijun@huawei.comSigned-off-by: NDoug Ledford <dledford@redhat.com>
      d967e262