21 Aug, 2019

1 commit

  • task_active_pid_ns() is wrong API to check PID namespace because it
    posses some restrictions and return PID namespace where the process
    was allocated. It created mismatches with current namespace, which
    can be different.

    Rewrite whole rdma_is_visible_in_pid_ns() logic to provide reliable
    results without any relation to allocated PID namespace.

    Fixes: 8be565e65fa9 ("RDMA/nldev: Factor out the PID namespace check")
    Fixes: 6a6c306a09b5 ("RDMA/restrack: Make is_visible_in_pid_ns() as an API")
    Reviewed-by: Mark Zhang
    Signed-off-by: Leon Romanovsky
    Link: https://lore.kernel.org/r/20190815083834.9245-4-leon@kernel.org
    Signed-off-by: Doug Ledford

    Leon Romanovsky
     

09 Jul, 2019

1 commit

  • 5.4-rc1 will have new compile time debugging to test that headers can be
    compiled stand alone. Many rdma headers are already broken and excluded
    from the mechanism, however to avoid compile failures during the merge
    window fix enough so that the newly added header compiles clean.

    Fixes: 413d3347503b ("RDMA/counter: Add set/clear per-port auto mode support")
    Reported-by: Stephen Rothwell
    Signed-off-by: Jason Gunthorpe
    Signed-off-by: Mark Zhang

    Jason Gunthorpe
     

05 Jul, 2019

1 commit

  • Introduce statistic counter as a new resource. It allows a user to monitor
    specific objects (e.g., QPs) by binding to a counter.

    In some cases a user counter resource is created with task other then
    "current", because its creation is done as part of rdmatool call.

    Signed-off-by: Mark Zhang
    Reviewed-by: Majd Dibbiny
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Jason Gunthorpe

    Mark Zhang
     

19 Feb, 2019

4 commits


31 Jan, 2019

2 commits


19 Dec, 2018

1 commit


04 Dec, 2018

1 commit


06 Oct, 2018

2 commits


06 Jun, 2018

1 commit


04 May, 2018

2 commits

  • These help rdma drivers to fill out the driver entries.

    Signed-off-by: Steve Wise
    Signed-off-by: Doug Ledford

    Steve Wise
     
  • Each driver can register a "fill entry" function with the restrack core.
    This function will be called when filling out a resource, allowing the
    driver to add driver-specific details. The details consist of a
    nltable of nested attributes, that are in the form of tuples. Both key and value attributes are mandatory. The key
    nlattr must be a string, and the value nlattr can be one of the driver
    attributes that are generic, but typed, allowing the attributes to be
    validated. Currently the driver nlattr types include string, s32,
    u32, s64, and u64. The print-type nlattr allows a driver to specify
    an alternative display format for user tools displaying the attribute.
    For example, a u32 attribute will default to "%u", but a print-type
    attribute can be included for it to be displayed in hex. This allows
    the user tool to print the number in the format desired by the driver
    driver.

    More attrs can be defined as they become needed by drivers.

    Signed-off-by: Steve Wise
    Reviewed-by: Leon Romanovsky
    Signed-off-by: Doug Ledford

    Steve Wise
     

23 Mar, 2018

1 commit

  • The restrack clean routine had simple, but powerful WARN_ON check
    to see if all resources are cleared prior to releasing device.

    The WARN_ON check performed very well, but lack of information
    which device caused to resource leak, the object type and origin
    made debug to be fun and challenging at the same time.

    The fact that all dumps were the same because restrack_clean() is
    called in dealloc() didn't help either.

    So let's fix spelling error and convert WARN_ON to be more debug
    friendly. The dmesg cut below gives example of how the output
    will look output for the case fixed in patch [1]

    [ 438.421372] restrack: ------------[ cut here ]------------
    [ 438.423448] restrack: BUG: RESTRACK detected leak of resources on mlx5_2
    [ 438.425600] restrack: Kernel PD object allocated by mlx5_ib is not freed
    [ 438.427753] restrack: Kernel CQ object allocated by mlx5_ib is not freed
    [ 438.429660] restrack: ------------[ cut here ]------------

    [1] https://patchwork.kernel.org/patch/10298695/

    Cc: Michal Kalderon
    Cc: Chuck Lever
    Reviewed-by: Mark Bloch
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Jason Gunthorpe

    Leon Romanovsky
     

09 Mar, 2018

2 commits

  • Implement the RDMA nldev netlink interface for dumping detailed
    MR information.

    Signed-off-by: Steve Wise
    Reviewed-by: Leon Romanovsky
    Signed-off-by: Doug Ledford

    Steve Wise
     
  • Implement RDMA nldev netlink interface to get detailed CM_ID information.

    Because cm_id's are attached to rdma devices in various work queue
    contexts, the pid and task information at restrak_add() time is sometimes
    not useful. For example, an nvme/f host connection cm_id ends up being
    bound to a device in a work queue context and the resulting pid at attach
    time no longer exists after connection setup. So instead we mark all
    cm_id's created via the rdma_ucm as "user", and all others as "kernel".
    This required tweaking the restrack code a little. It also required
    wrapping some rdma_cm functions to allow passing the module name string.

    Signed-off-by: Steve Wise
    Reviewed-by: Leon Romanovsky
    Signed-off-by: Doug Ledford

    Steve Wise
     

16 Feb, 2018

1 commit


30 Jan, 2018

1 commit

  • The RDMA subsystem has very strict set of objects to work with, but it
    completely lacks tracking facilities and has no visibility of resource
    utilization.

    The following patch adds such infrastructure to keep track of RDMA
    resources to help with debugging of user space applications. The primary
    user of this infrastructure is RDMA nldev netlink (following patches), to
    be exposed to userspace via rdmatool, but it is not limited too that.

    At this stage, the main three objects (PD, CQ and QP) are added, and more
    will be added later.

    Reviewed-by: Mark Bloch
    Signed-off-by: Leon Romanovsky
    Reviewed-by: Steve Wise
    Signed-off-by: Jason Gunthorpe

    Leon Romanovsky