1. 07 9月, 2018 7 次提交
  2. 06 9月, 2018 18 次提交
  3. 05 9月, 2018 5 次提交
    • M
      {net, RDMA}/mlx5: Rename encap to reformat packet · 60786f09
      Mark Bloch 提交于
      Renames all encap mlx5_{core,ib} code to use the new naming of packet
      reformat. This change doesn't introduce any function change and is
      needed to properly reflect the operation being done by this action.
      For example not only can we encapsulate a packet, but also decapsulate it.
      Signed-off-by: NMark Bloch <markb@mellanox.com>
      Reviewed-by: NSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      60786f09
    • M
      IB/mlx5: Change TX affinity assignment in RoCE LAG mode · c6a21c38
      Majd Dibbiny 提交于
      In the current code, the TX affinity is per RoCE device, which can cause
      unfairness between different contexts. e.g. if we open two contexts, and
      each open 10 QPs concurrently, all of the QPs of the first context might
      end up on the first port instead of distributed on the two ports as
      expected
      
      To overcome this unfairness between processes, we maintain per device TX
      affinity, and per process TX affinity.
      
      The allocation algorithm is as follow:
      
      1. Hold two tx_port_affinity atomic variables, one per RoCE device and one
         per ucontext. Both initialized to 0.
      
      2. In mlx5_ib_alloc_ucontext do:
       2.1. ucontext.tx_port_affinity = device.tx_port_affinity
       2.2. device.tx_port_affinity += 1
      
      3. In modify QP INIT2RST:
       3.1. qp.tx_port_affinity = ucontext.tx_port_affinity % MLX5_PORT_NUM
       3.2. ucontext.tx_port_affinity += 1
      Signed-off-by: NMajd Dibbiny <majd@mellanox.com>
      Reviewed-by: NMoni Shoua <monis@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      c6a21c38
    • S
      iw_cxgb4: only allow 1 flush on user qps · 308aa2b8
      Steve Wise 提交于
      Once the qp has been flushed, it cannot be flushed again.  The user qp
      flush logic wasn't enforcing it however.  The bug can cause
      touch-after-free crashes like:
      
      Unable to handle kernel paging request for data at address 0x000001ec
      Faulting instruction address: 0xc008000016069100
      Oops: Kernel access of bad area, sig: 11 [#1]
      ...
      NIP [c008000016069100] flush_qp+0x80/0x480 [iw_cxgb4]
      LR [c00800001606cd6c] c4iw_modify_qp+0x71c/0x11d0 [iw_cxgb4]
      Call Trace:
      [c00800001606cd6c] c4iw_modify_qp+0x71c/0x11d0 [iw_cxgb4]
      [c00800001606e868] c4iw_ib_modify_qp+0x118/0x200 [iw_cxgb4]
      [c0080000119eae80] ib_security_modify_qp+0xd0/0x3d0 [ib_core]
      [c0080000119c4e24] ib_modify_qp+0xc4/0x2c0 [ib_core]
      [c008000011df0284] iwcm_modify_qp_err+0x44/0x70 [iw_cm]
      [c008000011df0fec] destroy_cm_id+0xcc/0x370 [iw_cm]
      [c008000011ed4358] rdma_destroy_id+0x3c8/0x520 [rdma_cm]
      [c0080000134b0540] ucma_close+0x90/0x1b0 [rdma_ucm]
      [c000000000444da4] __fput+0xe4/0x2f0
      
      So fix flush_qp() to only flush the wq once.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      308aa2b8
    • A
      IB/core: Release object lock if destroy failed · e4ff3d22
      Artemy Kovalyov 提交于
      The object lock was supposed to always be released during destroy, but
      when the destruction retry series was integrated with the destroy series
      it created a failure path that missed the unlock.
      
      Keep with convention, if destroy fails the caller must undo all locking.
      
      Fixes: 87ad80ab ("IB/uverbs: Consolidate uobject destruction")
      Signed-off-by: NArtemy Kovalyov <artemyko@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      e4ff3d22
    • J
      RDMA/ucma: check fd type in ucma_migrate_id() · 0d23ba60
      Jann Horn 提交于
      The current code grabs the private_data of whatever file descriptor
      userspace has supplied and implicitly casts it to a `struct ucma_file *`,
      potentially causing a type confusion.
      
      This is probably fine in practice because the pointer is only used for
      comparisons, it is never actually dereferenced; and even in the
      comparisons, it is unlikely that a file from another filesystem would have
      a ->private_data pointer that happens to also be valid in this context.
      But ->private_data is not always guaranteed to be a valid pointer to an
      object owned by the file's filesystem; for example, some filesystems just
      cram numbers in there.
      
      Check the type of the supplied file descriptor to be safe, analogous to how
      other places in the kernel do it.
      
      Fixes: 88314e4d ("RDMA/cma: add support for rdma_migrate_id()")
      Signed-off-by: NJann Horn <jannh@google.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      0d23ba60
  4. 01 9月, 2018 9 次提交
  5. 31 8月, 2018 1 次提交
    • V
      IB/rxe: fixes for rdma read retry · 030e46e4
      Vijay Immanuel 提交于
      When a read request is retried for the remaining partial
      data, the response may restart from read response first
      or read response only. So support those cases.
      
      Do not advance the comp psn beyond the current wqe's last_psn
      as that could skip over an entire read wqe and will cause the
      req_retry() logic to set an incorrect req psn.
      An example sequence is as follows:
      Write        PSN 40 -- this is the current WQE.
      Read request PSN 41
      Write        PSN 42
      Receive ACK  PSN 42 -- this will complete the current WQE
      for PSN 40, and set the comp psn to 42 which is a problem
      because the read request at PSN 41 has been skipped over.
      So when req_retry() tries to retransmit the read request,
      it sets the req psn to 42 which is incorrect.
      
      When retrying a read request, calculate the number of psns
      completed based on the dma resid instead of the wqe first_psn.
      The wqe first_psn could have moved if the read request was
      retried multiple times.
      
      Set the reth length to the dma resid to handle read retries for
      the remaining partial data.
      Signed-off-by: NVijay Immanuel <vijayi@attalasystems.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      030e46e4