01 Feb, 2017

2 commits

  • commit 828f6fa65ce7e80f77f5ab12942e44eb3d9d174e upstream.

    1. Release pid before enter odp flow
    2. Release pid when fail to allocate memory

    Fixes: 87773dd56d54 ("IB: ib_umem_release() should decrement mm->pinned_vm from ib_umem_get")
    Fixes: 8ada2c1c0c1d ("IB/core: Add support for on demand paging regions")
    Signed-off-by: Kenneth Lee
    Reviewed-by: Haggai Eran
    Reviewed-by: Leon Romanovsky
    Signed-off-by: Doug Ledford
    Signed-off-by: Greg Kroah-Hartman

    Kenneth Lee
     
  • commit b4cfe3971f6eab542dd7ecc398bfa1aeec889934 upstream.

    If IPV6 has not been enabled in the underlying kernel, we must avoid
    calling IPV6 procedures in rdma_cm.ko.

    This requires using "IS_ENABLED(CONFIG_IPV6)" in "if" statements
    surrounding any code which calls external IPV6 procedures.

    In the instance fixed here, procedure cma_bind_addr() called
    ipv6_addr_type() -- which resulted in calling external procedure
    __ipv6_addr_type().

    Fixes: 6c26a77124ff ("RDMA/cma: fix IPv6 address resolution")
    Cc: Spencer Baugh
    Signed-off-by: Jack Morgenstein
    Reviewed-by: Moni Shoua
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Doug Ledford
    Signed-off-by: Greg Kroah-Hartman

    Jack Morgenstein
     

26 Jan, 2017

1 commit


09 Jan, 2017

2 commits

  • commit d3a2418ee36a59bc02e9d454723f3175dcf4bfd9 upstream.

    This patch avoids that Coverity complains about not checking the
    ib_find_pkey() return value.

    Fixes: commit 547af76521b3 ("IB/multicast: Report errors on multicast groups if P_key changes")
    Signed-off-by: Bart Van Assche
    Cc: Sean Hefty
    Signed-off-by: Doug Ledford
    Signed-off-by: Greg Kroah-Hartman

    Bart Van Assche
     
  • commit 2fe2f378dd45847d2643638c07a7658822087836 upstream.

    The array ib_mad_mgmt_class_table.method_table has MAX_MGMT_CLASS
    (80) elements. Hence compare the array index with that value instead
    of with IB_MGMT_MAX_METHODS (128). This patch avoids that Coverity
    reports the following:

    Overrunning array class->method_table of 80 8-byte elements at element index 127 (byte offset 1016) using index convert_mgmt_class(mad_hdr->mgmt_class) (which evaluates to 127).

    Fixes: commit b7ab0b19a85f ("IB/mad: Verify mgmt class in received MADs")
    Signed-off-by: Bart Van Assche
    Cc: Sean Hefty
    Reviewed-by: Hal Rosenstock
    Signed-off-by: Doug Ledford
    Signed-off-by: Greg Kroah-Hartman

    Bart Van Assche
     

18 Nov, 2016

1 commit

  • Pull rmda fixes from Doug Ledford.
    "First round of -rc fixes.

    Due to various issues, I've been away and couldn't send a pull request
    for about three weeks. There were a number of -rc patches that built
    up in the meantime (some where there already from the early -rc
    stages). Obviously, there were way too many to send now, so I tried to
    pare the list down to the more important patches for the -rc cycle.

    Most of the code has had plenty of soak time at the various vendor's
    testing setups, so I doubt there will be another -rc pull request this
    cycle. I also tried to limit the patches to those with smaller
    footprints, so even though a shortlog is longer than I would like, the
    actual diffstat is mostly very small with the exception of just three
    files that had more changes, and a couple files with pure removals.

    Summary:
    - Misc Intel hfi1 fixes
    - Misc Mellanox mlx4, mlx5, and rxe fixes
    - A couple cxgb4 fixes"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma: (34 commits)
    iw_cxgb4: invalidate the mr when posting a read_w_inv wr
    iw_cxgb4: set *bad_wr for post_send/post_recv errors
    IB/rxe: Update qp state for user query
    IB/rxe: Clear queue buffer when modifying QP to reset
    IB/rxe: Fix handling of erroneous WR
    IB/rxe: Fix kernel panic in UDP tunnel with GRO and RX checksum
    IB/mlx4: Fix create CQ error flow
    IB/mlx4: Check gid_index return value
    IB/mlx5: Fix NULL pointer dereference on debug print
    IB/mlx5: Fix fatal error dispatching
    IB/mlx5: Resolve soft lock on massive reg MRs
    IB/mlx5: Use cache line size to select CQE stride
    IB/mlx5: Validate requested RQT size
    IB/mlx5: Fix memory leak in query device
    IB/core: Avoid unsigned int overflow in sg_alloc_table
    IB/core: Add missing check for addr_resolve callback return value
    IB/core: Set routable RoCE gid type for ipv4/ipv6 networks
    IB/cm: Mark stale CM id's whenever the mad agent was unregistered
    IB/uverbs: Fix leak of XRC target QPs
    IB/hfi1: Remove incorrect IS_ERR check
    ...

    Linus Torvalds
     

17 Nov, 2016

5 commits

  • sg_alloc_table gets unsigned int as parameter while the driver
    returns it as size_t. Check npages isn't greater than maximum
    unsigned int.

    Fixes: eeb8461e36c9 ("IB: Refactor umem to use linear SG table")
    Signed-off-by: Mark Bloch
    Signed-off-by: Maor Gottlieb
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Doug Ledford

    Mark Bloch
     
  • When calling rdma_resolve_ip inside rdma_addr_find_l2_eth_by_grh,
    the return status of the request was ignored in the callback function
    causing a successful return and an empty dmac.

    Signed-off-by: Mark Bloch
    Signed-off-by: Alex Vesker
    Reviewed-by: Or Gerlitz
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Doug Ledford

    Mark Bloch
     
  • On Thu, Oct 27, 2016 at 04:36:28PM +0300, Leon Romanovsky wrote:
    > From: Mark Bloch
    >
    > If the underlying netowrk type is ipv4 or ipv6 and the device supports
    > routable RoCE, prefer it so the traffic could cross subnets.
    >
    > Signed-off-by: Mark Bloch
    > Signed-off-by: Maor Gottlieb
    > Signed-off-by: Leon Romanovsky
    > ---

    Hi Doug,

    Please take the following v1 of this patch where I fixed spelling error
    from "netowrk" to be "network".

    Thanks.

    >From 09f96ba3e9b4442cfb44dca04c6726e55525c9c3 Mon Sep 17 00:00:00 2001
    From: Mark Bloch
    Date: Sun, 11 Sep 2016 06:25:10 +0000
    Subject: [PATCH rdma-rc v1 3/6] IB/core: Set routable RoCE gid type for ipv4/ipv6
    networks

    If the underlying network type is ipv4 or ipv6 and the device supports
    routable RoCE, prefer it so the traffic could cross subnets.

    Signed-off-by: Mark Bloch
    Signed-off-by: Maor Gottlieb
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Doug Ledford

    Leon Romanovsky
     
  • When there is a CM id object that has port assigned to it, it means that
    the cm-id asked for the specific port that it should go by it, but if
    that port was removed (hot-unplug event) the cm-id was not updated.
    In order to fix that the port keeps a list of all the cm-id's that are
    planning to go by it, whenever the port is removed it marks all of them
    as invalid.

    This commit fixes a kernel panic which happens when running traffic between
    guests and we force reboot a guest mid traffic, it triggers a kernel panic:

    Call Trace:
    [] ? panic+0xa7/0x16f
    [] ? oops_end+0xe4/0x100
    [] ? no_context+0xfb/0x260
    [] ? del_timer_sync+0x22/0x30
    [] ? __bad_area_nosemaphore+0x125/0x1e0
    [] ? process_timeout+0x0/0x10
    [] ? bad_area_nosemaphore+0x13/0x20
    [] ? __do_page_fault+0x31f/0x480
    [] ? default_wake_function+0x0/0x20
    [] ? free_msg+0x55/0x70 [mlx5_core]
    [] ? cmd_exec+0x124/0x840 [mlx5_core]
    [] ? find_busiest_group+0x244/0x9f0
    [] ? do_page_fault+0x3e/0xa0
    [] ? page_fault+0x25/0x30
    [] ? cm_alloc_msg+0x35/0xc0 [ib_cm]
    [] ? ib_send_cm_dreq+0xb1/0x1e0 [ib_cm]
    [] ? cm_destroy_id+0x176/0x320 [ib_cm]
    [] ? ib_destroy_cm_id+0x10/0x20 [ib_cm]
    [] ? ipoib_cm_free_rx_reap_list+0xa7/0x110 [ib_ipoib]
    [] ? ipoib_cm_rx_reap+0x0/0x20 [ib_ipoib]
    [] ? ipoib_cm_rx_reap+0x15/0x20 [ib_ipoib]
    [] ? worker_thread+0x170/0x2a0
    [] ? autoremove_wake_function+0x0/0x40
    [] ? worker_thread+0x0/0x2a0
    [] ? kthread+0x96/0xa0
    [] ? child_rip+0xa/0x20
    [] ? kthread+0x0/0xa0
    [] ? child_rip+0x0/0x20

    Fixes: a977049dacde ("[PATCH] IB: Add the kernel CM implementation")
    Signed-off-by: Mark Bloch
    Signed-off-by: Erez Shitrit
    Reviewed-by: Maor Gottlieb
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Doug Ledford

    Mark Bloch
     
  • The real QP is destroyed in case of the ref count reaches zero, but
    for XRC target QPs this call was missed and caused to QP leaks.

    Let's call to destroy for all flows.

    Fixes: 0e0ec7e0638e ('RDMA/core: Export ib_open_qp() to share XRC...')
    Signed-off-by: Tariq Toukan
    Signed-off-by: Noa Osherovich
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Doug Ledford

    Tariq Toukan
     

12 Nov, 2016

1 commit

  • Some configurations produce this harmless warning when built with gcc
    -Wmaybe-uninitialized:

    infiniband/core/cma.c: In function 'cma_get_net_dev':
    infiniband/core/cma.c:1242:12: warning: 'src_addr_storage.sin_addr.s_addr' may be used uninitialized in this function [-Wmaybe-uninitialized]

    I previously reported this for the powerpc64 defconfig, but have now
    reproduced the same thing for x86 as well, using gcc-5 or higher.

    The code looks correct to me, and this change just rearranges it by
    making sure we alway initialize the entire address structure to make the
    warning disappear. My first approach added an initialization at the
    time of the declaration, which Doug commented may be too costly, so I
    hope this version doesn't add overhead.

    Link: http://arm-soc.lixom.net/buildlogs/mainline/v4.7-rc6/buildall.powerpc.ppc64_defconfig.log.passed
    Link: https://patchwork.kernel.org/patch/9212825/
    Acked-by: Haggai Eran
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Linus Torvalds

    Arnd Bergmann
     

19 Oct, 2016

2 commits

  • This removes the 'write' and 'force' from get_user_pages_remote() and
    replaces them with 'gup_flags' to make the use of FOLL_FORCE explicit in
    callers as use of this flag can result in surprising behaviour (and
    hence bugs) within the mm subsystem.

    Signed-off-by: Lorenzo Stoakes
    Acked-by: Michal Hocko
    Reviewed-by: Jan Kara
    Signed-off-by: Linus Torvalds

    Lorenzo Stoakes
     
  • This removes the 'write' and 'force' from get_user_pages() and replaces
    them with 'gup_flags' to make the use of FOLL_FORCE explicit in callers
    as use of this flag can result in surprising behaviour (and hence bugs)
    within the mm subsystem.

    Signed-off-by: Lorenzo Stoakes
    Acked-by: Christian König
    Acked-by: Jesper Nilsson
    Acked-by: Michal Hocko
    Reviewed-by: Jan Kara
    Signed-off-by: Linus Torvalds

    Lorenzo Stoakes
     

10 Oct, 2016

1 commit

  • Pull main rdma updates from Doug Ledford:
    "This is the main pull request for the rdma stack this release. The
    code has been through 0day and I had it tagged for linux-next testing
    for a couple days.

    Summary:

    - updates to mlx5

    - updates to mlx4 (two conflicts, both minor and easily resolved)

    - updates to iw_cxgb4 (one conflict, not so obvious to resolve,
    proper resolution is to keep the code in cxgb4_main.c as it is in
    Linus' tree as attach_uld was refactored and moved into
    cxgb4_uld.c)

    - improvements to uAPI (moved vendor specific API elements to uAPI
    area)

    - add hns-roce driver and hns and hns-roce ACPI reset support

    - conversion of all rdma code away from deprecated
    create_singlethread_workqueue

    - security improvement: remove unsafe ib_get_dma_mr (breaks lustre in
    staging)"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma: (75 commits)
    staging/lustre: Disable InfiniBand support
    iw_cxgb4: add fast-path for small REG_MR operations
    cxgb4: advertise support for FR_NSMR_TPTE_WR
    IB/core: correctly handle rdma_rw_init_mrs() failure
    IB/srp: Fix infinite loop when FMR sg[0].offset != 0
    IB/srp: Remove an unused argument
    IB/core: Improve ib_map_mr_sg() documentation
    IB/mlx4: Fix possible vl/sl field mismatch in LRH header in QP1 packets
    IB/mthca: Move user vendor structures
    IB/nes: Move user vendor structures
    IB/ocrdma: Move user vendor structures
    IB/mlx4: Move user vendor structures
    IB/cxgb4: Move user vendor structures
    IB/cxgb3: Move user vendor structures
    IB/mlx5: Move and decouple user vendor structures
    IB/{core,hw}: Add constant for node_desc
    ipoib: Make ipoib_warn ratelimited
    IB/mlx4/alias_GUID: Remove deprecated create_singlethread_workqueue
    IB/ipoib_verbs: Remove deprecated create_singlethread_workqueue
    IB/ipoib: Remove deprecated create_singlethread_workqueue
    ...

    Linus Torvalds
     

08 Oct, 2016

13 commits

  • Function ib_create_qp() was failing to return an error when
    rdma_rw_init_mrs() fails, causing a crash further down in ib_create_qp()
    when trying to dereferece the qp pointer which was actually a negative
    errno.

    The crash:

    crash> log|grep BUG
    [ 136.458121] BUG: unable to handle kernel NULL pointer dereference at 0000000000000098
    crash> bt
    PID: 3736 TASK: ffff8808543215c0 CPU: 2 COMMAND: "kworker/u64:2"
    #0 [ffff88084d323340] machine_kexec at ffffffff8105fbb0
    #1 [ffff88084d3233b0] __crash_kexec at ffffffff81116758
    #2 [ffff88084d323480] crash_kexec at ffffffff8111682d
    #3 [ffff88084d3234b0] oops_end at ffffffff81032bd6
    #4 [ffff88084d3234e0] no_context at ffffffff8106e431
    #5 [ffff88084d323530] __bad_area_nosemaphore at ffffffff8106e610
    #6 [ffff88084d323590] bad_area_nosemaphore at ffffffff8106e6f4
    #7 [ffff88084d3235a0] __do_page_fault at ffffffff8106ebdc
    #8 [ffff88084d323620] do_page_fault at ffffffff8106f057
    #9 [ffff88084d323660] page_fault at ffffffff816e3148
    [exception RIP: ib_create_qp+427]
    RIP: ffffffffa02554fb RSP: ffff88084d323718 RFLAGS: 00010246
    RAX: 0000000000000004 RBX: fffffffffffffff4 RCX: 000000018020001f
    RDX: ffff880830997fc0 RSI: 0000000000000001 RDI: ffff88085f407200
    RBP: ffff88084d323778 R8: 0000000000000001 R9: ffffea0020bae210
    R10: ffffea0020bae218 R11: 0000000000000001 R12: ffff88084d3237c8
    R13: 00000000fffffff4 R14: ffff880859fa5000 R15: ffff88082eb89800
    ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0018
    #10 [ffff88084d323780] rdma_create_qp at ffffffffa0782681 [rdma_cm]
    #11 [ffff88084d3237b0] nvmet_rdma_create_queue_ib at ffffffffa07c43f3 [nvmet_rdma]
    #12 [ffff88084d323860] nvmet_rdma_alloc_queue at ffffffffa07c5ba9 [nvmet_rdma]
    #13 [ffff88084d323900] nvmet_rdma_queue_connect at ffffffffa07c5c96 [nvmet_rdma]
    #14 [ffff88084d323980] nvmet_rdma_cm_handler at ffffffffa07c6450 [nvmet_rdma]
    #15 [ffff88084d3239b0] iw_conn_req_handler at ffffffffa0787480 [rdma_cm]
    #16 [ffff88084d323a60] cm_conn_req_handler at ffffffffa0775f06 [iw_cm]
    #17 [ffff88084d323ab0] process_event at ffffffffa0776019 [iw_cm]
    #18 [ffff88084d323af0] cm_work_handler at ffffffffa0776170 [iw_cm]
    #19 [ffff88084d323cb0] process_one_work at ffffffff810a1483
    #20 [ffff88084d323d90] worker_thread at ffffffff810a211d
    #21 [ffff88084d323ec0] kthread at ffffffff810a6c5c
    #22 [ffff88084d323f50] ret_from_fork at ffffffff816e1ebf

    Fixes: 632bc3f65081 ("IB/core, RDMA RW API: Do not exceed QP SGE send limit")
    Signed-off-by: Steve Wise
    Cc: stable@vger.kernel.org
    Reviewed-by: Bart Van Assche
    Signed-off-by: Doug Ledford

    Steve Wise
     
  • Document that ib_map_mr_sg() is able to map physically discontiguous
    sg-lists as a single MR. Change IB_MR_TYPE_SG_GAPS_REG into
    IB_MR_TYPE_SG_GAPS.

    Signed-off-by: Bart Van Assche
    Cc: Sagi Grimberg
    Cc: Christoph Hellwig
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Sagi Grimberg
    Signed-off-by: Doug Ledford

    Bart Van Assche
     
  • Signed-off-by: Yuval Shaia
    Signed-off-by: Doug Ledford

    Yuval Shaia
     
  • alloc_ordered_workqueue() with WQ_MEM_RECLAIM set, replaces
    deprecated create_singlethread_workqueue(). This is the identity
    conversion.

    The workqueue "iwcm_wq" queues work item &work(maps to cm_work_handler).
    It has been identity converted.

    WQ_MEM_RECLAIM has been set to ensure forward progress under
    memory pressure.

    Signed-off-by: Bhaktipriya Shridhar
    Reviewed-by: Steve Wise
    Signed-off-by: Doug Ledford

    Bhaktipriya Shridhar
     
  • The workqueue "addr_wq" queues a single work item &work and hence
    doesn't require ordering. Also, it is being used on a memory reclaim
    path. Hence, it has been converted to use alloc_workqueue with
    WQ_MEM_RECLAIM set.

    WQ_MEM_RECLAIM has been set to ensure forward progress under
    memory pressure.

    Signed-off-by: Bhaktipriya Shridhar
    Signed-off-by: Doug Ledford

    Bhaktipriya Shridhar
     
  • alloc_ordered_workqueue() with WQ_MEM_RECLAIM set, replaces
    deprecated create_singlethread_workqueue(). This is the identity
    conversion.

    The workqueue "cma_wq" queues work item cma_work_handler. It has been
    identity converted.

    WQ_MEM_RECLAIM has been set to ensure forward progress under
    memory pressure.

    Signed-off-by: Bhaktipriya Shridhar
    Reviewed-by: Steve Wise
    Signed-off-by: Doug Ledford

    Bhaktipriya Shridhar
     
  • alloc_ordered_workqueue() with WQ_MEM_RECLAIM set, replaces
    deprecated create_singlethread_workqueue(). This is the identity
    conversion.

    The workqueue "close_wq" queues work items &ctx->close_work (maps to
    ucma_close_id) and &con_req_eve->close_work (maps to
    ucma_close_event_id). It has been identity converted.

    WQ_MEM_RECLAIM has been set to ensure forward progress under
    memory pressure.

    Signed-off-by: Bhaktipriya Shridhar
    Signed-off-by: Doug Ledford

    Bhaktipriya Shridhar
     
  • alloc_ordered_workqueue() with WQ_MEM_RECLAIM set, replaces
    deprecated create_singlethread_workqueue(). This is the identity
    conversion.

    The workqueue "mcast_wq" queues work item &group->work. It has been
    identity converted.

    WQ_MEM_RECLAIM has been set to ensure forward progress under
    memory pressure.

    Signed-off-by: Bhaktipriya Shridhar
    Signed-off-by: Doug Ledford

    Bhaktipriya Shridhar
     
  • The workqueue "ib_nl" queues work items &ib_nl_timed_work and
    &mad_agent_priv->local_work. It has been identity converted.

    WQ_MEM_RECLAIM has been set to ensure forward progress under
    memory pressure.

    Signed-off-by: Bhaktipriya Shridhar
    Signed-off-by: Doug Ledford

    Bhaktipriya Shridhar
     
  • alloc_ordered_workqueue() with WQ_MEM_RECLAIM set, replaces
    deprecated create_singlethread_workqueue(). This is the identity
    conversion.

    The workqueue "ib_nl" queues work item &ib_nl_timed_work. It has been
    identity converted.

    WQ_MEM_RECLAIM has been set to ensure forward progress under memory
    pressure.

    Signed-off-by: Bhaktipriya Shridhar
    Signed-off-by: Doug Ledford

    Bhaktipriya Shridhar
     
  • Add the following fields to IPv6 flow filter specification:
    1. Traffic Class
    2. Flow Label
    3. Next Header
    4. Hop Limit

    Signed-off-by: Maor Gottlieb
    Reviewed-by: Sagi Grimberg
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Doug Ledford

    Maor Gottlieb
     
  • Flow steering specifications structures were implemented as in an
    extensible way that allows one to add new filters and new fields
    to existing filters.
    These specifications have never been extended, therefore the
    kernel flow specifications size and the user flow specifications size
    were must to be equal.

    In downstream patch, the IPv4 flow specifications type is extended to
    support TOS and TTL fields.

    To support an extension we change the flow specifications size
    condition test to be as following:

    * If the user flow specifications is bigger than the kernel
    specifications, we verify that all the bits which not in the kernel
    specifications are zeros and the flow is added only with the kernel
    specifications fields.

    * Otherwise, we add flow rule only with the user specifications fields.

    User space filters must be aligned with 32bits.

    Signed-off-by: Maor Gottlieb
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Doug Ledford

    Maor Gottlieb
     
  • Query RSS related attributes and return them to user-space via the
    extended query device uverbs command.

    It includes both direct ones (i.e. struct ib_uverbs_rss_caps) and
    max_wq_type_rq which may be used in both RSS and non RSS flows.

    Signed-off-by: Yishai Hadas
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Doug Ledford

    Yishai Hadas
     

24 Sep, 2016

3 commits

  • We now only use it from ib_alloc_pd to create a local DMA lkey if the
    device doesn't provide one, or a global rkey if the ULP requests it.

    This patch removes ib_get_dma_mr and open codes the functionality in
    ib_alloc_pd so that we can simplify the code and prevent abuse of the
    functionality. As a side effect we can also simplify things by removing
    the valid access bit check, and the PD refcounting.

    In the future I hope to also remove the per-PD global MR entirely by
    shifting this work into the HW drivers, as one step towards avoiding
    the struct ib_mr overload for various different use cases.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Sagi Grimberg
    Reviewed-by: Jason Gunthorpe
    Reviewed-by: Steve Wise
    Signed-off-by: Doug Ledford

    Christoph Hellwig
     
  • Instead of exposing ib_get_dma_mr to ULPs and letting them use it more or
    less unchecked, this moves the capability of creating a global rkey into
    the RDMA core, where it can be easily audited. It also prints a warning
    everytime this feature is used as well.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Sagi Grimberg
    Reviewed-by: Jason Gunthorpe
    Reviewed-by: Steve Wise
    Signed-off-by: Doug Ledford

    Christoph Hellwig
     
  • This has two reasons: a) to clearly mark that drivers don't have any
    business using it, and b) because we're going to use it for the
    (dangerous) global rkey soon, so that drivers don't create on themselves.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Sagi Grimberg
    Reviewed-by: Jason Gunthorpe
    Reviewed-by: Steve Wise
    Signed-off-by: Doug Ledford

    Christoph Hellwig
     

03 Sep, 2016

1 commit

  • The function send_leave sets the member: group->query_id
    (group->query_id = ret) after calling the sa_query, but leave_handler
    can be executed before the setting and it might delete the group object,
    and will get a memory corruption.

    Additionally, this patch gets rid of group->query_id variable which is
    not used.

    Fixes: faec2f7b96b5 ('IB/sa: Track multicast join/leave requests')
    Signed-off-by: Erez Shitrit
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Doug Ledford

    Erez Shitrit
     

23 Aug, 2016

1 commit


05 Aug, 2016

2 commits

  • Pull second round of rdma updates from Doug Ledford:
    "This can be split out into just two categories:

    - fixes to the RDMA R/W API in regards to SG list length limits
    (about 5 patches)

    - fixes/features for the Intel hfi1 driver (everything else)

    The hfi1 driver is still being brought to full feature support by
    Intel, and they have a lot of people working on it, so that amounts to
    almost the entirety of this pull request"

    * tag 'for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma: (84 commits)
    IB/hfi1: Add cache evict LRU list
    IB/hfi1: Fix memory leak during unexpected shutdown
    IB/hfi1: Remove unneeded mm argument in remove function
    IB/hfi1: Consistently call ops->remove outside spinlock
    IB/hfi1: Use evict mmu rb operation
    IB/hfi1: Add evict operation to the mmu rb handler
    IB/hfi1: Fix TID caching actions
    IB/hfi1: Make the cache handler own its rb tree root
    IB/hfi1: Make use of mm consistent
    IB/hfi1: Fix user SDMA racy user request claim
    IB/hfi1: Fix error condition that needs to clean up
    IB/hfi1: Release node on insert failure
    IB/hfi1: Validate SDMA user iovector count
    IB/hfi1: Validate SDMA user request index
    IB/hfi1: Use the same capability state for all shared contexts
    IB/hfi1: Prevent null pointer dereference
    IB/hfi1: Rename TID mmu_rb_* functions
    IB/hfi1: Remove unneeded empty check in hfi1_mmu_rb_unregister()
    IB/hfi1: Restructure hfi1_file_open
    IB/hfi1: Make iovec loop index easy to understand
    ...

    Linus Torvalds
     
  • Pull base rdma updates from Doug Ledford:
    "Round one of 4.8 code: while this is mostly normal, there is a new
    driver in here (the driver was hosted outside the kernel for several
    years and is actually a fairly mature and well coded driver). It
    amounts to 13,000 of the 16,000 lines of added code in here.

    Summary:

    - Updates/fixes for iw_cxgb4 driver
    - Updates/fixes for mlx5 driver
    - Add flow steering and RSS API
    - Add hardware stats to mlx4 and mlx5 drivers
    - Add firmware version API for RDMA driver use
    - Add the rxe driver (this is a software RoCE driver that makes any
    Ethernet device a RoCE device)
    - Fixes for i40iw driver
    - Support for send only multicast joins in the cma layer
    - Other minor fixes"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma: (72 commits)
    Soft RoCE driver
    IB/core: Support for CMA multicast join flags
    IB/sa: Add cached attribute containing SM information to SA port
    IB/uverbs: Fix race between uverbs_close and remove_one
    IB/mthca: Clean up error unwind flow in mthca_reset()
    IB/mthca: NULL arg to pci_dev_put is OK
    IB/hfi1: NULL arg to sc_return_credits is OK
    IB/mlx4: Add diagnostic hardware counters
    net/mlx4: Query performance and diagnostics counters
    net/mlx4: Add diagnostic counters capability bit
    Use smaller 512 byte messages for portmapper messages
    IB/ipoib: Report SG feature regardless of HW UD CSUM capability
    IB/mlx4: Don't use GFP_ATOMIC for CQ resize struct
    IB/hfi1: Disable by default
    IB/rdmavt: Disable by default
    IB/mlx5: Fix port counter ID association to QP offset
    IB/mlx5: Fix iteration overrun in GSI qps
    i40iw: Add NULL check for puda buffer
    i40iw: Change dup_ack_thresh to u8
    i40iw: Remove unnecessary check for moving CQ head
    ...

    Linus Torvalds
     

04 Aug, 2016

5 commits

  • Doug Ledford
     
  • The dma-mapping core and the implementations do not change the DMA
    attributes passed by pointer. Thus the pointer can point to const data.
    However the attributes do not have to be a bitfield. Instead unsigned
    long will do fine:

    1. This is just simpler. Both in terms of reading the code and setting
    attributes. Instead of initializing local attributes on the stack
    and passing pointer to it to dma_set_attr(), just set the bits.

    2. It brings safeness and checking for const correctness because the
    attributes are passed by value.

    Semantic patches for this change (at least most of them):

    virtual patch
    virtual context

    @r@
    identifier f, attrs;

    @@
    f(...,
    - struct dma_attrs *attrs
    + unsigned long attrs
    , ...)
    {
    ...
    }

    @@
    identifier r.f;
    @@
    f(...,
    - NULL
    + 0
    )

    and

    // Options: --all-includes
    virtual patch
    virtual context

    @r@
    identifier f, attrs;
    type t;

    @@
    t f(..., struct dma_attrs *attrs);

    @@
    identifier r.f;
    @@
    f(...,
    - NULL
    + 0
    )

    Link: http://lkml.kernel.org/r/1468399300-5399-2-git-send-email-k.kozlowski@samsung.com
    Signed-off-by: Krzysztof Kozlowski
    Acked-by: Vineet Gupta
    Acked-by: Robin Murphy
    Acked-by: Hans-Christian Noren Egtvedt
    Acked-by: Mark Salter [c6x]
    Acked-by: Jesper Nilsson [cris]
    Acked-by: Daniel Vetter [drm]
    Reviewed-by: Bart Van Assche
    Acked-by: Joerg Roedel [iommu]
    Acked-by: Fabien Dessenne [bdisp]
    Reviewed-by: Marek Szyprowski [vb2-core]
    Acked-by: David Vrabel [xen]
    Acked-by: Konrad Rzeszutek Wilk [xen swiotlb]
    Acked-by: Joerg Roedel [iommu]
    Acked-by: Richard Kuo [hexagon]
    Acked-by: Geert Uytterhoeven [m68k]
    Acked-by: Gerald Schaefer [s390]
    Acked-by: Bjorn Andersson
    Acked-by: Hans-Christian Noren Egtvedt [avr32]
    Acked-by: Vineet Gupta [arc]
    Acked-by: Robin Murphy [arm64 and dma-iommu]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Krzysztof Kozlowski
     
  • Added UCMA and CMA support for multicast join flags. Flags are
    passed using UCMA CM join command previously reserved fields.
    Currently supporting two join flags indicating two different
    multicast JoinStates:

    1. Full Member:
    The initiator creates the Multicast group(MCG) if it wasn't
    previously created, can send Multicast messages to the group
    and receive messages from the MCG.

    2. Send Only Full Member:
    The initiator creates the Multicast group(MCG) if it wasn't
    previously created, can send Multicast messages to the group
    but doesn't receive any messages from the MCG.

    IB: Send Only Full Member requires a query of ClassPortInfo
    to determine if SM/SA supports this option. If SM/SA
    doesn't support Send-Only there will be no join request
    sent and an error will be returned.

    ETH: When Send Only Full Member is requested no IGMP join
    will be sent.

    Signed-off-by: Alex Vesker
    Reviewed by: Hal Rosenstock
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Doug Ledford

    Alex Vesker
     
  • Added a new SA port attribute containing SM ClassPortInfo fields,
    (ClassPortInfo fields: Table 126 IB Spec 1.3.). This is useful for
    checking SM support for specific features. The attribute is cached
    to avoid resending queries, caching is done when a successful
    ClassPortInfo reply is received on the port. Invalidation of the
    attribute is done on SM change events, SM re-registration events,
    and SM LID change events. The fields in ClassPortInfo should not
    change during SM runtime without an event.

    Signed-off-by: Alex Vesker
    Reviewed by: Hal Rosenstock
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Doug Ledford

    Alex Vesker
     
  • Fixes an oops that might happen if uverbs_close races with
    remove_one.

    Both contexts may run ib_uverbs_cleanup_ucontext, it depends
    on the flow.

    Currently, there is no protection for a case that remove_one
    didn't make the cleanup it runs to its end, the underlying
    ib_device was freed then uverbs_close will call
    ib_uverbs_cleanup_ucontext and OOPs.

    Above might happen if uverbs_close deleted the file from the list
    then remove_one didn't find it and runs to its end.

    Fixes to protect against that case by a new cleanup lock so that
    ib_uverbs_cleanup_ucontext will be called always before that
    remove_one is ended.

    Fixes: 35d4a0b63dc0 ("IB/uverbs: Fix race between ib_uverbs_open and remove_one")
    Reported-by: Devesh Sharma
    Signed-off-by: Jason Gunthorpe
    Signed-off-by: Yishai Hadas
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Doug Ledford

    Jason Gunthorpe