27 Dec, 2012

1 commit


23 Mar, 2012

1 commit

  • We should be using the gfp flags the caller specified here, instead of
    GFP_KERNEL. I think this might be a bugfix, depending on the value of
    "sock->sk->sk_allocation" when we call rds_conn_create_outgoing() in
    rds_sendmsg(). Otherwise, it's just a cleanup.

    Signed-off-by: Dan Carpenter
    Acked-by: Venkat Venkatsubra
    Signed-off-by: David S. Miller

    Dan Carpenter
     

15 Sep, 2011

1 commit


17 Jun, 2011

1 commit


26 May, 2011

1 commit

  • The RDMA CM currently infers the QP type from the port space selected
    by the user. In the future (eg with RDMA_PS_IB or XRC), there may not
    be a 1-1 correspondence between port space and QP type. For netlink
    export of RDMA CM state, we want to export the QP type to userspace,
    so it is cleaner to explicitly associate a QP type to an ID.

    Modify rdma_create_id() to allow the user to specify the QP type, and
    use it to make our selections of datagram versus connected mode.

    Signed-off-by: Sean Hefty
    Signed-off-by: Roland Dreier

    Sean Hefty
     

20 Sep, 2010

1 commit


09 Sep, 2010

13 commits

  • This prints the constant identifier for work completion status and rdma
    cm event types, like we already do for IB event types.

    A core string array helper is added that each string type uses.

    Signed-off-by: Zach Brown

    Zach Brown
     
  • It's nice to not have to go digging in the code to see which event
    occurred. It's easy to throw together a quick array that maps the ib
    event enums to their strings. I didn't see anything in the stack that
    does this translation for us, but I also didn't look very hard.

    Signed-off-by: Zach Brown

    Zach Brown
     
  • We're seeing bugs today where IB connection shutdown clears the send
    ring while the tasklet is processing completed sends. Implementation
    details cause this to dereference a null pointer. Shutdown needs to
    wait for send completion to stop before tearing down the connection. We
    can't simply wait for the ring to empty because it may contain
    unsignaled sends that will never be processed.

    This patch tracks the number of signaled sends that we've posted and
    waits for them to complete. It also makes sure that the tasklet has
    finished executing.

    Signed-off-by: Zach Brown

    Zach Brown
     
  • This patch is based heavily on an initial patch by Chris Mason.
    Instead of freeing slab memory and pages, it keeps them, and
    funnels them back to be reused.

    The lock minimization strategy uses xchg and cmpxchg atomic ops
    for manipulation of pointers to list heads. We anchor the lists with a
    pointer to a list_head struct instead of a static list_head struct.
    We just have to carefully use the existing primitives with
    the difference between a pointer and a static head struct.

    For example, 'list_empty()' means that our anchor pointer points to a list with
    a single item instead of meaning that our static head element doesn't point to
    any list items.

    Original patch by Chris, with significant mods and fixes by Andy and Zach.

    Signed-off-by: Chris Mason
    Signed-off-by: Andy Grover
    Signed-off-by: Zach Brown

    Chris Mason
     
  • The RDS IB client .remove callback used to free the rds_ibdev for the given
    device unconditionally. This could race other users of the struct. This patch
    adds refcounting so that we only free the rds_ibdev once all of its users are
    done.

    Many rds_ibdev users are tied to connections. We give the connection a
    reference and change these users to reference the device in the connection
    instead of looking it up in the IB client data. The only user of the IB client
    data remaining is the first lookup of the device as connections are built up.

    Incrementing the reference count of a device found in the IB client data could
    race with final freeing so we use an RCU grace period to make sure that freeing
    won't happen until those lookups are done.

    MRs need the rds_ibdev to get at the pool that they're freed in to. They exist
    outside a connection and many MRs can reference different devices from one
    socket, so it was natural to have each MR hold a reference. MR refs can be
    dropped from interrupt handlers and final device teardown can block so we push
    it off to a work struct. Pool teardown had to be fixed to cancel its pending
    work instead of deadlocking waiting for all queued work, including itself, to
    finish.

    MRs get their reference from the global device list, which gets a reference.
    It is left unprotected by locks and remains racy. A simple global lock would
    be a significant bottleneck. More scalable (complicated) locking should be
    done carefully in a later patch.

    Signed-off-by: Zach Brown

    Zach Brown
     
  • rds_ib_cm_handle_connect() could return without unlocking the c_conn_lock if
    rds_setup_qp() failed. Rather than adding another imbalanced mutex_unlock() to
    this error path we only unlock the mutex once as we exit the function, reducing
    the likelyhood of making this same mistake in the future. We remove the
    previous mulitple return sites, leaving one unambigious return path.

    Signed-off-by: Zach Brown

    Zach Brown
     
  • Allocate send/recv rings in memory that is node-local to the HCA.
    This significantly helps performance.

    Signed-off-by: Andy Grover

    Andy Grover
     
  • Performance is better if we use allocations that don't block
    to refill the receive ring. Since the whole reason we were
    kicking out to the worker thread was so we could do blocking
    allocs, we no longer need to do this.

    Remove gfp params from rds_ib_recv_refill(); we always use
    GFP_NOWAIT.

    Signed-off-by: Andy Grover

    Andy Grover
     
  • Now that we are signaling send completions much less, we are likely
    to have dirty entries in the send queue when the connection is
    shut down (on rmmod, for example.) These are cleaned up a little
    further down in conn_shutdown, but if we wait on the ring_empty_wait
    for them, it'll never happen, and we hand on unload.

    Signed-off-by: Andy Grover

    Andy Grover
     
  • Previously, RDS would wait until the final send WR had completed
    and then handle cleanup. With silent ops, we do not know
    if an atomic, rdma, or data op will be last. This patch
    handles any of these cases by keeping a pointer to the last
    op in the message in m_last_op.

    When the TX completion event fires, rds dispatches to per-op-type
    cleanup functions, and then does whole-message cleanup, if the
    last op equalled m_last_op.

    This patch also moves towards having op-specific functions take
    the op struct, instead of the overall rm struct.

    rds_ib_connection has a pointer to keep track of a a partially-
    completed data send operation. This patch changes it from an
    rds_message pointer to the narrower rm_data_op pointer, and
    modifies places that use this pointer as needed.

    Signed-off-by: Andy Grover

    Andy Grover
     
  • RDS 3.0 connections (in OFED 1.3 and earlier) put the
    header at the end. 3.1 connections put it at the head.
    The code has significant added complexity in order to
    handle both configurations. In OFED 1.6 we can
    drop this and simplify the code by only supporting
    "header-first" configuration.

    This patch checks the protocol version, and if prior
    to 3.1, does not complete the connection.

    Signed-off-by: Andy Grover

    Andy Grover
     
  • Instead of using a constant for initiator_depth and
    responder_resources, read the per-QP values when the
    device is enumerated, and then use these values when creating
    the connection.

    Signed-off-by: Andy Grover

    Andy Grover
     
  • Favor "if (foo)" style over "if (foo != NULL)".

    Signed-off-by: Andy Grover

    Andy Grover
     

29 May, 2010

1 commit

  • Add a mutex_unlock missing on the error path. In each case, whenever the
    label out is reached from elsewhere in the function, mutex is not locked.

    The semantic match that finds this problem is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    expression E1;
    @@

    * mutex_lock(E1);

    * mutex_unlock(E1);
    //

    Signed-off-by: Julia Lawall
    Reviewed-by: Zach Brown
    Acked-by: Andy Grover
    Signed-off-by: David S. Miller

    Julia Lawall
     

12 Apr, 2010

1 commit


30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

17 Mar, 2010

1 commit

  • RDS's error messages when a connection goes down are a little
    extreme. A connection may go down, and it will be re-established,
    and everything is fine. This patch links these messages through
    rdsdebug(), instead of to printk directly.

    Signed-off-by: Andy Grover
    Signed-off-by: David S. Miller

    Andy Grover
     

30 Nov, 2009

1 commit


31 Oct, 2009

1 commit


20 Jul, 2009

6 commits


02 Apr, 2009

2 commits

  • We have a 64bit value that needs to be set atomically.
    This is easy and quick on all 64bit archs, and can also be done
    on x86/32 with set_64bit() (uses cmpxchg8b). However other
    32b archs don't have this.

    I actually changed this to the current state in preparation for
    mainline because the old way (using a spinlock on 32b) resulted in
    unsightly #ifdefs in the code. But obviously, being correct takes
    precedence.

    Signed-off-by: Andy Grover
    Signed-off-by: David S. Miller

    Andy Grover
     
  • This fixes a bug where a connection was unexpectedly
    not on *any* list while being destroyed. It also
    cleans up some code duplication and regularizes some
    function names.

    * Grab appropriate lock in conn_free() and explain in comment
    * Ensure via locking that a conn is never not on either
    a dev's list or the nodev list
    * Add rds_xx_remove_conn() to match rds_xx_add_conn()
    * Make rds_xx_add_conn() return void
    * Rename remove_{,nodev_}conns() to
    destroy_{,nodev_}conns() and unify their implementation
    in a helper function
    * Document lock ordering as nodev conn_lock before
    dev_conn_lock

    Reported-by: Yosef Etigin
    Signed-off-by: Andy Grover
    Signed-off-by: David S. Miller

    Andy Grover
     

27 Feb, 2009

1 commit