1. Feb 22, 2019
    • Moni Shoua's avatar
      IB/core: Abort page fault handler silently during owning process exit · 4438ee3f
      Moni Shoua authored
      
      
      It is possible that during a page fault handling, the process that owns
      the MR is terminating. The indication for it is failure to get the
      task_struct or take reference on the mm_struct. In this case just abort
      the page-fault handler with error but without a warning to the kernel log.
      
      Signed-off-by: default avatarMoni Shoua <monis@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      4438ee3f
    • Moni Shoua's avatar
      IB/mlx5: Validate correct PD before prefetch MR · 81dd4c4b
      Moni Shoua authored
      When prefetching odp mr it is required to verify that pd of the mr is
      identical to the pd for which the advise_mr request arrived with.
      
      This check was missing from synchronous flow and is added now.
      
      Fixes: 813e90b1
      
       ("IB/mlx5: Add advise_mr() support")
      Reported-by: default avatarParav Pandit <parav@mellanox.com>
      Signed-off-by: default avatarMoni Shoua <monis@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      81dd4c4b
    • Moni Shoua's avatar
      IB/mlx5: Protect against prefetch of invalid MR · a6bc3875
      Moni Shoua authored
      When deferring a prefetch request we need to protect against MR or PD
      being destroyed while the request is still enqueued.
      
      The first step is to validate that PD owns the lkey that describes the MR
      and that the MR that the lkey refers to is owned by that PD.
      
      The second step is to dequeue all requests when MR is destroyed.
      
      Since PD can't be destroyed while it owns MRs it is guaranteed that when a
      worker wakes up the request it refers to is still valid.
      
      Now, it is possible to refrain from taking a reference on the device since
      it is assured to be present as pd.
      
      While that, replace the dedicated ordered workqueue with the system
      unbound workqueue to reuse an existing resource and improve
      performance. This will also fix a bug of queueing to the wrong workqueue.
      
      Fixes: 813e90b1
      
       ("IB/mlx5: Add advise_mr() support")
      Reported-by: default avatarParav Pandit <parav@mellanox.com>
      Signed-off-by: default avatarMoni Shoua <monis@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      a6bc3875
    • Leon Romanovsky's avatar
      RDMA/uverbs: Store PR pointer before it is overwritten · 25fd08eb
      Leon Romanovsky authored
      The IB_MR_REREG_PD command rewrites mr->pd after successful
      rereg_user_mr(), such change causes to lost usecnt information and
      produces the following warning:
      
       WARNING: CPU: 1 PID: 1771 at drivers/infiniband/core/verbs.c:336 ib_dealloc_pd+0x4e/0x60 [ib_core]
       CPU: 1 PID: 1771 Comm: rereg_mr Tainted: G        W  OE 5.0.0-rc7-for-upstream-perf-2019-02-20_14-03-40-34 #1
       Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu1 04/01/2014
       RIP: 0010:ib_dealloc_pd+0x4e/0x60 [ib_core]
       RSP: 0018:ffffc90003923dc0 EFLAGS: 00010286
       RAX: 00000000ffffffff RBX: ffff88821f7f0400 RCX: ffff888236a40c00
       RDX: ffff88821f7f0400 RSI: 0000000000000001 RDI: 0000000000000000
       RBP: 0000000000000001 R08: ffff88835f665d80 R09: ffff8882209c90d8
       R10: ffff88835ec003e0 R11: 0000000000000000 R12: ffff888221680ba0
       R13: ffff888221680b00 R14: 00000000ffffffea R15: ffff88821f53c318
       FS:  00007f70db11e740(0000) GS:ffff88835f640000(0000) knlGS:0000000000000000
       CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
       CR2: 0000000001dfd030 CR3: 000000029d9d8000 CR4: 00000000000006e0
       DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
       DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
       Call Trace:
        uverbs_free_pd+0x2d/0x30 [ib_uverbs]
        destroy_hw_idr_uobject+0x16/0x40 [ib_uverbs]
        uverbs_destroy_uobject+0x28/0x170 [ib_uverbs]
        __uverbs_cleanup_ufile+0x6b/0x90 [ib_uverbs]
        uverbs_destroy_ufile_hw+0x8b/0x110 [ib_uverbs]
        ib_uverbs_close+0x1f/0x80 [ib_uverbs]
        __fput+0xb1/0x220
        task_work_run+0x7f/0xa0
        exit_to_usermode_loop+0x6b/0xb2
        do_syscall_64+0xc5/0x100
        entry_SYSCALL_64_after_hwframe+0x44/0xa9
       RIP: 0033:0x7f70dad00664
      
      Fixes: e278173f
      
       ("RDMA/core: Cosmetic change - move member initialization to correct block")
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Reviewed-by: default avatarMajd Dibbiny <majd@mellanox.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      25fd08eb
    • Gustavo A. R. Silva's avatar
      IB/hfi1: Add missing break in switch statement · 7264235e
      Gustavo A. R. Silva authored
      Fix the following warning by adding a missing break:
      
      drivers/infiniband/hw/hfi1/tid_rdma.c: In function ‘hfi1_tid_rdma_wqe_interlock’:
      drivers/infiniband/hw/hfi1/tid_rdma.c:3251:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
         switch (prev->wr.opcode) {
         ^~~~~~
      drivers/infiniband/hw/hfi1/tid_rdma.c:3259:2: note: here
        case IB_WR_RDMA_READ:
        ^~~~
      
      Warning level 3 was used: -Wimplicit-fallthrough=3
      
      This patch is part of the ongoing efforts to enable
      -Wimplicit-fallthrough.
      
      Fixes: c6c23117
      
       ("IB/hfi1: Add interlock between TID RDMA WRITE and other requests")
      Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
      Reviewed-by: default avatarKaike Wan <Kaike.wan@intel.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      7264235e
    • Jason Gunthorpe's avatar
      Merge branch 'mlx5-next' into rdma.git for-next · 815f7480
      Jason Gunthorpe authored
      From
      git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux
      
      
      
      To resolve conflicts with net-next and pick up the first patch.
      
      * branch 'mlx5-next':
        net/mlx5: Factor out HCA capabilities functions
        IB/mlx5: Add support for 50Gbps per lane link modes
        net/mlx5: Add support to ext_* fields introduced in Port Type and Speed register
        net/mlx5: Add new fields to Port Type and Speed register
        net/mlx5: Refactor queries to speed fields in Port Type and Speed register
        net/mlx5: E-Switch, Avoid magic numbers when initializing offloads mode
        net/mlx5: Relocate vport macros to the vport header file
        net/mlx5: E-Switch, Normalize the name of uplink vport number
        net/mlx5: Provide an alternative VF upper bound for ECPF
        net/mlx5: Add host params change event
        net/mlx5: Add query host params command
        net/mlx5: Update enable HCA dependency
        net/mlx5: Introduce Mellanox SmartNIC and modify page management logic
        IB/mlx5: Use unified register/load function for uplink and VF vports
        net/mlx5: Use consistent vport num argument type
        net/mlx5: Use void pointer as the type in address_of macro
        net/mlx5: Align ODP capability function with netdev coding style
        mlx5: use RCU lock in mlx5_eq_cq_get()
      
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      815f7480
  2. Feb 21, 2019
  3. Feb 20, 2019
  4. Feb 19, 2019
  5. Feb 16, 2019