1. 13 Aug, 2019 11 commits
    • Xi Wang's avatar
      RDMA/hns: bugfix for slab-out-of-bounds when loading hip08 driver · bf8c02f9
      Xi Wang authored
      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: default avatarXi Wang <wangxi11@huawei.com>
      Link: https://lore.kernel.org/r/1565343666-73193-7-git-send-email-oulijun@huawei.comSigned-off-by: default avatarDoug Ledford <dledford@redhat.com>
      bf8c02f9
    • Xi Wang's avatar
      RDMA/hns: Bugfix for slab-out-of-bounds when unloading hip08 driver · 9bba3f0c
      Xi Wang authored
      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: default avatarXi Wang <wangxi11@huawei.com>
      Link: https://lore.kernel.org/r/1565343666-73193-6-git-send-email-oulijun@huawei.comSigned-off-by: default avatarDoug Ledford <dledford@redhat.com>
      9bba3f0c
    • Yangyang Li's avatar
      RDMA/hns: Modify pi vlaue when cq overflows · d7e5ca88
      Yangyang Li authored
      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: default avatarYangyang Li <liyangyang20@huawei.com>
      Link: https://lore.kernel.org/r/1565343666-73193-5-git-send-email-oulijun@huawei.comSigned-off-by: default avatarDoug Ledford <dledford@redhat.com>
      d7e5ca88
    • Lijun Ou's avatar
      RDMA/hns: Bugfix for creating qp attached to srq · 76827087
      Lijun Ou authored
      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: default avatarLijun Ou <oulijun@huawei.com>
      Link: https://lore.kernel.org/r/1565343666-73193-3-git-send-email-oulijun@huawei.comSigned-off-by: default avatarDoug Ledford <dledford@redhat.com>
      76827087
    • Weihang Li's avatar
      RDMA/hns: Logic optimization of wc_flags · 0e1aa6f0
      Weihang Li authored
      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: default avatarWeihang Li <liweihang@hisilicon.com>
      Link: https://lore.kernel.org/r/1565343666-73193-2-git-send-email-oulijun@huawei.comSigned-off-by: default avatarDoug Ledford <dledford@redhat.com>
      0e1aa6f0
    • Leon Romanovsky's avatar
      RDMA/mlx5: Annotate lock dependency in bind/unbind slave port · 9dc4cfff
      Leon Romanovsky authored
      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: default avatarLeon Romanovsky <leonro@mellanox.com>
      Link: https://lore.kernel.org/r/20190813102814.22350-1-leon@kernel.orgSigned-off-by: default avatarDoug Ledford <dledford@redhat.com>
      9dc4cfff
    • Yishai Hadas's avatar
      IB/mlx5: Expose XRQ legacy commands over the DEVX interface · 8293a598
      Yishai Hadas authored
      Expose missing XRQ legacy commands over the DEVX interface.
      Signed-off-by: default avatarYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Link: https://lore.kernel.org/r/20190808084358.29517-5-leon@kernel.orgSigned-off-by: default avatarDoug Ledford <dledford@redhat.com>
      8293a598
    • Yishai Hadas's avatar
      IB/mlx5: Add legacy events to DEVX list · 972d7560
      Yishai Hadas authored
      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: default avatarYishai Hadas <yishaih@mellanox.com>
      Reviewed-by: default avatarEdward Srouji <edwards@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Link: https://lore.kernel.org/r/20190808084358.29517-4-leon@kernel.orgSigned-off-by: default avatarDoug Ledford <dledford@redhat.com>
      972d7560
    • Doug Ledford's avatar
      Merge remote-tracking branch 'mlx5-next/mlx5-next' into wip/dl-for-next · 749b9eef
      Doug Ledford authored
      Merging tip of mlx5-next in order to get changes related to adding
      XRQ support to the DEVX interface needed prior to the following two
      patches.
      Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
      749b9eef
    • Yishai Hadas's avatar
      net/mlx5: Add XRQ legacy commands opcodes · b1635ee6
      Yishai Hadas authored
      Add XRQ legacy commands opcodes, will be used via the DEVX interface.
      Signed-off-by: default avatarYishai Hadas <yishaih@mellanox.com>
      Reviewed-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      b1635ee6
    • Yishai Hadas's avatar
      net/mlx5: Use debug message instead of warn · 647d58a9
      Yishai Hadas authored
      As QP may be created by DEVX, it may be valid to not find the rsn in
      mlx5 core tree, change the level to be debug.
      Signed-off-by: default avatarYishai Hadas <yishaih@mellanox.com>
      Reviewed-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      647d58a9
  2. 12 Aug, 2019 19 commits
  3. 07 Aug, 2019 1 commit
  4. 06 Aug, 2019 1 commit
  5. 05 Aug, 2019 4 commits
  6. 04 Aug, 2019 2 commits
  7. 02 Aug, 2019 1 commit
  8. 01 Aug, 2019 1 commit
    • Parav Pandit's avatar
      net/mlx5: E-switch, Tide up eswitch config sequence · 5896b972
      Parav Pandit authored
      Currently for PF and ECPF vports, representors are created before
      their eswitch hardware ports are initialized in below flow.
      
      mlx5_eswitch_enable()
        esw_offloads_init()
          esw_offloads_load_all_reps()
      [..]
      esw_enable_vport()
      
      However for VFs, vports are initialized before creating their
      respective netdev represnetors in event handling context.
      
      Similarly while disabling eswitch, first hardware vports are disabled,
      followed by destroying their representors.
      Here while underlying vports gets destroyed but its respective user
      facing netdevice can still exist on which user can continue to perform
      more offload operations.
      
      Instead, its more accurate to do
      enable_eswitch switchdev mode:
      1. perform FDB tables initialization
      2. initialize hw vport
      3. create and publish representor for this vport
      
      disable_eswitch switchdev mode:
      1. destroy user facing representor for the vport
      2. disable hw vport
      3. perform FDB tables cleanup
      Signed-off-by: default avatarParav Pandit <parav@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      5896b972