30 Jul, 2020

1 commit

  • The header files in RDMA subsystem are dual licensed and can be
    described by simple SPDX tag, so replace all of them at once
    together with making them use the same coding style for header
    guard defines.

    Link: https://lore.kernel.org/r/20200719072521.135260-1-leon@kernel.org
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Jason Gunthorpe

    Leon Romanovsky
     

21 Feb, 2020

1 commit

  • The current codebase makes use of the zero-length array language
    extension to the C90 standard, but the preferred mechanism to declare
    variable-length types such as these ones is a flexible array member[1][2],
    introduced in C99:

    struct foo {
    int stuff;
    struct boo array[];
    };

    By making use of the mechanism above, we will get a compiler warning
    in case the flexible array does not occur last in the structure, which
    will help us prevent some kind of undefined behavior bugs from being
    inadvertently introduced[3] to the codebase from now on.

    Also, notice that, dynamic memory allocations won't be affected by
    this change:

    "Flexible array members have incomplete type, and so the sizeof operator
    may not be applied. As a quirk of the original implementation of
    zero-length arrays, sizeof evaluates to zero."[1]

    This issue was found with the help of Coccinelle.

    [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
    [2] https://github.com/KSPP/linux/issues/21
    [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

    Link: https://lore.kernel.org/r/20200213010425.GA13068@embeddedor.com
    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: Jason Gunthorpe # added a few more

    Gustavo A. R. Silva
     

29 Aug, 2017

1 commit

  • A destroy of an MR prior to destroying the QP can cause the following
    diagnostic if the QP is referencing the MR being de-registered:

    hfi1 0000:05:00.0: hfi1_0: rvt_dereg_mr timeout mr ffff8808562108
    00 pd ffff880859b20b00

    The solution is to when the a non-zero refcount is encountered when
    the MR is destroyed the QPs needs to be iterated looking for QPs in
    the same PD as the MR. If rvt_qp_mr_clean() detects any such QP
    references the rkey/lkey, the QP needs to be put into an error state
    via a call to rvt_qp_error() which will trigger the clean up of any
    stuck references.

    This solution is as specified in IBTA 1.3 Volume 1 11.2.10.5.

    [This is reproduced with the 0.4.9 version of qperf and the rc_bw test]

    Reviewed-by: Dennis Dalessandro
    Signed-off-by: Mike Marciniszyn
    Signed-off-by: Dennis Dalessandro
    Signed-off-by: Doug Ledford

    Mike Marciniszyn
     

19 Feb, 2017

2 commits

  • To improve code reuse, add small SGE state helper routines to rdmavt_mr.h.
    Leverage these in hfi1, including refactoring of hfi1_copy_sge.

    Reviewed-by: Mike Marciniszyn
    Signed-off-by: Brian Welty
    Signed-off-by: Dennis Dalessandro
    Signed-off-by: Doug Ledford

    Brian Welty
     
  • Having per-CPU reference count for each MR prevents
    cache-line bouncing across the system. Thus, it
    prevents bottlenecks. Use per-CPU reference counts
    per MR.

    The per-CPU reference count for FMRs is used in
    atomic mode to allow accurate testing of the busy
    state. Other MR types run in per-CPU mode MR until
    they're freed.

    Reviewed-by: Mike Marciniszyn
    Signed-off-by: Sebastian Sanchez
    Signed-off-by: Mike Marciniszyn
    Signed-off-by: Dennis Dalessandro
    Signed-off-by: Doug Ledford

    Sebastian Sanchez
     

16 Nov, 2016

1 commit

  • Profiling shows that the key validation is susceptible
    to cache line trading when accessing the lkey table.

    Fix by separating out the read mostly fields from the write
    fields. In addition the shift amount, which is function
    of the lkey table size, is precomputed and stored with the
    table pointer. Since both the shift and table pointer
    are in the same read mostly cacheline, this saves a cache
    line in this hot path.

    Reviewed-by: Sebastian Sanchez
    Signed-off-by: Mike Marciniszyn
    Signed-off-by: Dennis Dalessandro
    Signed-off-by: Doug Ledford

    Mike Marciniszyn
     

03 Aug, 2016

1 commit

  • In order to support extended memory management, add the mechanism to
    invalidate MR keys. This includes a flag "lkey_invalid" in the MR data
    structure that is to be checked when validating access to the MR via
    the associated key, and two utility functions to perform fast memory
    registration and memory key invalidate operations.

    Reviewed-by: Mike Marciniszyn
    Reviewed-by: Dennis Dalessandro
    Signed-off-by: Jianxin Xiong
    Signed-off-by: Dennis Dalessandro
    Signed-off-by: Doug Ledford

    Jianxin Xiong
     

11 Mar, 2016

3 commits

  • Update all files added by rdmavt which do not yet have 2016 as the
    copyright year.

    Reviewed-by: Ira Weiny
    Reviewed-by: Harish Chegondi
    Signed-off-by: Dennis Dalessandro
    Signed-off-by: Doug Ledford

    Dennis Dalessandro
     
  • Add modify qp and supporting functions.

    Reviewed-by: Mike Marciniszyn
    Reviewed-by: Ira Weiny
    Signed-off-by: Dennis Dalessandro
    Signed-off-by: Doug Ledford

    Dennis Dalessandro
     
  • Until all functionality is moved over to rdmavt drivers still need to
    access a number of fields in data structures that are predominantly
    meant to be used by rdmavt. Once these rdmavt_.h header
    files are no longer being touched by drivers their content should be
    moved to rdmavt/.h. While here move a couple #defines
    over to more general IB verbs header files because they fit better.

    Reviewed-by: Ira Weiny
    Reviewed-by: Mike Marciniszyn
    Signed-off-by: Dennis Dalessandro
    Signed-off-by: Doug Ledford

    Dennis Dalessandro