09 Jan, 2017

1 commit

  • commit fba332b079029c2f4f7e84c1c1cd8e3867310c90 upstream.

    Code that dereferences the struct net_device ip_ptr member must be
    protected with an in_dev_get() / in_dev_put() pair. Hence insert
    calls to these functions.

    Fixes: commit 7b85627b9f02 ("IB/cma: IBoE (RoCE) IP-based GID addressing")
    Signed-off-by: Bart Van Assche
    Reviewed-by: Moni Shoua
    Cc: Or Gerlitz
    Cc: Roland Dreier
    Signed-off-by: Doug Ledford
    Signed-off-by: Greg Kroah-Hartman

    Bart Van Assche
     

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

5 commits

  • Signed-off-by: Yuval Shaia
    Signed-off-by: Doug Ledford

    Yuval Shaia
     
  • 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
     
  • Add the following fields to IPv4 flow filter specification:
    1. Type of Service
    2. Time to Live
    3. Flags
    4. Protocol

    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
     
  • Expose RSS related capabilities, it includes both direct ones (i.e.
    struct ib_rss_caps) and max_wq_type_rq which may be used in both
    RSS and non RSS flows.

    Specifically,
    supported_qpts:
    - QP types that support RSS on the device.

    max_rwq_indirection_tables:
    - Max number of receive work queue indirection tables that
    could be opened on the device.

    max_rwq_indirection_table_size:
    - Max size of a receive work queue indirection table.

    max_wq_type_rq:
    - Max number of work queues of receive type that
    could be opened on the device.

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

    Yishai Hadas
     

07 Oct, 2016

1 commit

  • This patch fixes below kernel crash on memory registration for rxe
    and other transport drivers which has dma_ops extension.

    IB/core invokes ib_map_sg_attrs() in generic manner with dma attributes
    which is used by mlx5 and mthca adapters. However in doing so it
    ignored honoring dma_ops extension of software based transports for
    sg map/unmap operation. This results in calling dma_map_sg_attrs of
    hardware virtual device resulting in crash for null reference.

    We extend the core to support sg_map/unmap_attrs and transport drivers
    to implement those dma_ops callback functions.

    Verified usign perftest applications.

    BUG: unable to handle kernel NULL pointer dereference at (null)
    IP: [] check_addr+0x35/0x60
    ...
    Call Trace:
    [] ? nommu_map_sg+0x99/0xd0
    [] ib_umem_get+0x3d6/0x470 [ib_core]
    [] rxe_mem_init_user+0x49/0x270 [rdma_rxe]
    [] ? rxe_add_index+0xca/0x100 [rdma_rxe]
    [] rxe_reg_user_mr+0x9f/0x130 [rdma_rxe]
    [] ib_uverbs_reg_mr+0x14e/0x2c0 [ib_uverbs]
    [] ib_uverbs_write+0x15b/0x3b0 [ib_uverbs]
    [] ? mem_cgroup_commit_charge+0x76/0xe0
    [] ? page_add_new_anon_rmap+0x89/0xc0
    [] ? lru_cache_add_active_or_unevictable+0x39/0xc0
    [] __vfs_write+0x28/0x120
    [] ? rw_verify_area+0x49/0xb0
    [] vfs_write+0xb2/0x1b0
    [] SyS_write+0x46/0xa0
    [] entry_SYSCALL_64_fastpath+0x1a/0xa4

    Signed-off-by: Parav Pandit
    Signed-off-by: Doug Ledford

    Parav Pandit
     

02 Oct, 2016

1 commit

  • Add IB headers, defines, and accessors that are identical
    in both qib and hfi1 into the core includes.

    The accessors for be maintenance of __be64 fields since
    alignment is potentially invalid and can differ based on
    the presense of the GRH.

    {hfi1,qib}_ib_headers will be ib_headers.
    {hfi1,qib|_other_headers will be ib_other_headers.

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

    Mike Marciniszyn
     

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
     

17 Sep, 2016

1 commit


24 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

4 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
     
  • Doug Ledford
     
  • 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
     

03 Aug, 2016

8 commits

  • The use of the specific opcode test is redundant since
    all ack entry users correctly manipulate the mr pointer
    to selectively trigger the reference clearing.

    The overly specific test hinders the use of implementation
    specific operations.

    The change needs to get rid of the union to insure that
    an atomic value is not seen as an MR pointer.

    Reviewed-by: Ashutosh Dixit
    Signed-off-by: Mike Marciniszyn
    Signed-off-by: Ira Weiny
    Signed-off-by: Doug Ledford

    Ira Weiny
     
  • Hanging has been observed while writing a file over NFSoRDMA. Dmesg on
    the server contains messages like these:

    [ 931.992501] svcrdma: Error -22 posting RDMA_READ
    [ 952.076879] svcrdma: Error -22 posting RDMA_READ
    [ 982.154127] svcrdma: Error -22 posting RDMA_READ
    [ 1012.235884] svcrdma: Error -22 posting RDMA_READ
    [ 1042.319194] svcrdma: Error -22 posting RDMA_READ

    Here is why:

    With the base memory management extension enabled, FRMR is used instead
    of FMR. The xprtrdma server issues each RDMA read request as the following
    bundle:

    (1)IB_WR_REG_MR, signaled;
    (2)IB_WR_RDMA_READ, signaled;
    (3)IB_WR_LOCAL_INV, signaled & fencing.

    These requests are signaled. In order to generate completion, the fast
    register work request is processed by the hfi1 send engine after being
    posted to the work queue, and the corresponding lkey is not valid until
    the request is processed. However, the rdmavt driver validates lkey when
    the RDMA read request is posted and thus it fails immediately with error
    -EINVAL (-22).

    This patch changes the work flow of local operations (fast register and
    local invalidate) so that fast register work requests are always
    processed immediately to ensure that the corresponding lkey is valid
    when subsequent work requests are posted. Local invalidate requests are
    processed immediately if fencing is not required and no previous local
    invalidate request is pending.

    To allow completion generation for signaled local operations that have
    been processed before posting to the work queue, an internal send flag
    RVT_SEND_COMPLETION_ONLY is added. The hfi1 send engine checks this flag
    and only generates completion for such requests.

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

    Jianxin Xiong
     
  • This fix allows for support of in-kernel reserved operations
    without impacting the ULP user.

    The low level driver can register a non-zero value which
    will be transparently added to the send queue size and hidden
    from the ULP in every respect.

    ULP post sends will never see a full queue due to a reserved
    post send and reserved operations will never exceed that
    registered value.

    The s_avail will continue to track the ULP swqe availability
    and the difference between the reserved value and the reserved
    in use will track reserved availabity.

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

    Mike Marciniszyn
     
  • Some work requests are local operations, such as IB_WR_REG_MR and
    IB_WR_LOCAL_INV. They differ from non-local operations in that:

    (1) Local operations can be processed immediately without being posted
    to the send queue if neither fencing nor completion generation is needed.
    However, to ensure correct ordering, once a local operation is posted to
    the work queue due to fencing or completion requiement, all subsequent
    local operations must also be posted to the work queue until all the
    local operations on the work queue have completed.

    (2) Local operations don't send packets over the wire and thus don't
    need (and shouldn't update) the packet sequence numbers.

    Define a new a flag bit for the post send table to identify local
    operations.

    Add a new field to the QP structure to track the number of local
    operations on the send queue to determine if direct processing of new
    local operations should be enabled/disabled.

    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
     
  • 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
     
  • Add flexibility for driver dependent operations in post send
    because different drivers will have differing post send
    operation support.

    This includes data structure definitions to support a table
    driven scheme along with the necessary validation routine
    using the new table.

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

    Mike Marciniszyn
     
  • Compute the SGE limit for RDMA READ and WRITE requests in
    ib_create_qp(). Use that limit in the RDMA RW API implementation.

    Signed-off-by: Bart Van Assche
    Cc: Christoph Hellwig
    Cc: Sagi Grimberg
    Cc: Steve Wise
    Cc: Parav Pandit
    Cc: Nicholas Bellinger
    Cc: Laurence Oberman
    Cc: #v4.7+
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Doug Ledford

    Bart Van Assche
     
  • The definition of port state changed mid development and the
    old structure was kept accidentally. Remove this dead code.

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

    Ira Weiny
     

24 Jun, 2016

2 commits


23 Jun, 2016

7 commits

  • Add IPv6 flow specification support.

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

    Maor Gottlieb
     
  • Extend create QP to get Receive Work Queue (WQ) indirection table.

    QP can be created with external Receive Work Queue indirection table,
    in that case it is ready to receive immediately.

    Signed-off-by: Yishai Hadas
    Signed-off-by: Matan Barak
    Reviewed-by: Sagi Grimberg
    Signed-off-by: Doug Ledford

    Yishai Hadas
     
  • User applications that want to spread traffic on several WQs, need to
    create an indirection table, by using already created WQs.

    Adding uverbs API in order to create and destroy this table.

    Signed-off-by: Yishai Hadas
    Signed-off-by: Matan Barak
    Reviewed-by: Sagi Grimberg
    Signed-off-by: Doug Ledford

    Yishai Hadas
     
  • Introduce Receive Work Queue (WQ) indirection table.
    This object can be used to spread incoming traffic to different
    receive Work Queues.

    A Receive WQ indirection table points to variable size of WQs.
    This table is given to a QP in downstream patches.

    Signed-off-by: Yishai Hadas
    Signed-off-by: Matan Barak
    Reviewed-by: Sagi Grimberg
    Signed-off-by: Doug Ledford

    Yishai Hadas
     
  • User space applications which use RSS functionality need to create
    a work queue object (WQ). The lifetime of such an object is:
    * Create a WQ
    * Modify the WQ from reset to init state.
    * Use the WQ (by downstream patches).
    * Destroy the WQ.

    These commands are added to the uverbs API.

    Signed-off-by: Yishai Hadas
    Signed-off-by: Matan Barak
    Reviewed-by: Sagi Grimberg
    Signed-off-by: Doug Ledford

    Yishai Hadas
     
  • Introduce Work Queue object and its create/destroy/modify verbs.

    QP can be created without internal WQs "packaged" inside it,
    this QP can be configured to use "external" WQ object as its
    receive/send queue.
    WQ is a necessary component for RSS technology since RSS mechanism
    is supposed to distribute the traffic between multiple
    Receive Work Queues.

    WQ associated (many to one) with Completion Queue and it owns WQ
    properties (PD, WQ size, etc.).
    WQ has a type, this patch introduces the IB_WQT_RQ (i.e.receive queue),
    it may be extend to others such as IB_WQT_SQ. (send queue).
    WQ from type IB_WQT_RQ contains receive work requests.

    PD is an attribute of a work queue (i.e. send/receive queue), it's used
    by the hardware for security validation before scattering to a memory
    region which is pointed by the WQ. For that, an external WQ object
    needs a PD, letting the hardware makes that validation.

    When accessing a memory region that is pointed by the WQ its PD
    is used and not the QP's PD, this behavior is similar
    to a SRQ and a QP.

    WQ context is subject to a well-defined state transitions done by
    the modify_wq verb.
    When WQ is created its initial state becomes IB_WQS_RESET.
    >From IB_WQS_RESET it can be modified to itself or to IB_WQS_RDY.
    >From IB_WQS_RDY it can be modified to itself, to IB_WQS_RESET
    or to IB_WQS_ERR.
    >From IB_WQS_ERR it can be modified to IB_WQS_RESET.

    Note: transition to IB_WQS_ERR might occur implicitly in case there
    was some HW error.

    Signed-off-by: Yishai Hadas
    Signed-off-by: Matan Barak
    Reviewed-by: Sagi Grimberg
    Reviewed-by: Sagi Grimberg
    Signed-off-by: Doug Ledford

    Yishai Hadas
     
  • The current drivers return errors from this calldown
    wrapped in an ERR_PTR().

    The rdmavt code incorrectly tests for NULL.

    The code is fixed to use IS_ERR() and change ret according
    to the driver return value.

    Cc: Stable # 4.6+
    Reviewed-by: Dennis Dalessandro
    Signed-off-by: Mike Marciniszyn
    Signed-off-by: Dennis Dalessandro
    Signed-off-by: Doug Ledford

    Mike Marciniszyn
     

07 Jun, 2016

2 commits

  • Replace the few u64 casts with ULL to match the rest of the casts.

    Signed-off-by: Max Gurtovoy
    Signed-off-by: Doug Ledford

    Max Gurtovoy
     
  • ib_device_cap_flags 64-bit expansion caused caps overlapping
    and made consumers read wrong device capabilities. For example
    IB_DEVICE_SG_GAPS_REG was falsely read by the iser driver causing
    it to use a non-existing capability. This happened because signed
    int becomes sign extended when converted it to u64. Fix this by
    casting IB_DEVICE_ON_DEMAND_PAGING enumeration to ULL.

    Fixes: f5aa9159a418 ('IB/core: Add arbitrary sg_list support')
    Reported-by: Robert LeBlanc
    Cc: Stable #[v4.6+]
    Acked-by: Sagi Grimberg
    Signed-off-by: Max Gurtovoy
    Signed-off-by: Matan Barak
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Doug Ledford

    Max Gurtovoy
     

27 May, 2016

1 commit

  • In practice, each RDMA device has a unique set of counters that the
    hardware implements. Having a central set of counters that they must
    all adhere to is limiting and causes many useful counters to not be
    available.

    Therefore we create a dynamic counter registration infrastructure.

    The driver must implement a stats structure allocation routine, in
    which the driver must place the directory name it wants, a list of
    names for all of the counters, an array of u64 counters themselves,
    plus a few generic configuration options.

    We then implement a core routine to create a sysfs file for each
    of the named stats elements, and a core routine to retrieve the
    stats when any of the sysfs attribute files are read.

    To avoid excessive beating on the stats generation routine in the
    drivers, the core code also caches the stats for a short period of
    time so that someone attempting to read all of the stats in a
    given device's directory will not result in a stats generation
    call per file read.

    Future work will attempt to standardize just the shared stats
    elements, and possibly add a method to get the stats via netlink
    in addition to sysfs.

    Signed-off-by: Christoph Lameter
    Signed-off-by: Mark Bloch
    Reviewed-by: Steve Wise
    Signed-off-by: Doug Ledford
    [ Add caching, make structure names more informative, add i40iw support,
    other significant rewrites from the original patch ]

    Christoph Lameter