24 Sep, 2016

1 commit

  • 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
     

11 Mar, 2016

1 commit


29 Oct, 2015

1 commit

  • Add support for network namespaces in the ib_cma module. This is
    accomplished by:

    1. Adding network namespace parameter for rdma_create_id. This parameter is
    used to populate the network namespace field in rdma_id_private.
    rdma_create_id keeps a reference on the network namespace.
    2. Using the network namespace from the rdma_id instead of init_net inside
    of ib_cma, when listening on an ID and when looking for an ID for an
    incoming request.
    3. Decrementing the reference count for the appropriate network namespace
    when calling rdma_destroy_id.

    In order to preserve the current behavior init_net is passed when calling
    from other modules.

    Signed-off-by: Guy Shapiro
    Signed-off-by: Haggai Eran
    Signed-off-by: Yotam Kenneth
    Signed-off-by: Shachar Raindel
    Signed-off-by: Doug Ledford

    Guy Shapiro
     

31 Aug, 2015

1 commit


13 Jun, 2015

1 commit


22 Mar, 2015

1 commit


26 Mar, 2014

4 commits

  • When parsing options, make sure we have found a proper token before
    doing a numeric conversion.

    Without this check, the current code will end up following random
    pointers that just happened to be on the stack when this function was
    called, because match_token() will not touch the 'args' list unless a
    valid token is found.

    Signed-off-by: Simon Derr
    Signed-off-by: Eric Van Hensbergen

    Simon Derr
     
  • Take into account posted recv buffers that will never receive their
    reply.

    The RDMA code posts a recv buffer for each request that it sends.
    When a request is flushed, it is possible that this request will
    never receive a reply, and that one recv buffer will stay unused on
    the recv queue.

    It is then possible, if this scenario happens several times, to have the
    recv queue full, and have the 9pnet_rmda module unable to send new requests.

    Signed-off-by: Simon Derr
    Signed-off-by: Eric Van Hensbergen

    Simon Derr
     
  • This will be needed by the flush logic.

    Signed-off-by: Simon Derr
    Signed-off-by: Eric Van Hensbergen

    Simon Derr
     
  • We need barriers to guarantee this pattern works as intended:
    [w] req->rc, 1 [r] req->status, 1
    wmb rmb
    [w] req->status, 1 [r] req->rc

    Where the wmb ensures that rc gets written before status,
    and the rmb ensures that if you observe status == 1, rc is the new value.

    Signed-off-by: Dominique Martinet
    Signed-off-by: Eric Van Hensbergen

    Dominique Martinet
     

25 Jul, 2013

1 commit

  • This patch gets rid of the following warning:

    net/9p/trans_rdma.c:594:12: warning: ‘rdma_cancelled’ defined but not used [-Wunused-function]
    static int rdma_cancelled(struct p9_client *client, struct p9_req_t *req)

    The rdma_cancelled function is not called anywhere in the kernel

    Signed-off-by: Andi Shyti
    Signed-off-by: David S. Miller

    Andi Shyti
     

08 Jul, 2013

8 commits

  • RDMA needs to post a buffer for each incoming reply.
    Hence it needs to keep count of these and needs to be
    aware of whether a flushed request has received a reply
    or not.

    This patch adds the cancelled() callback to the transport modules.
    It is called when RFLUSH has been received and that the corresponding
    request will never receive a reply.

    Signed-off-by: Simon Derr
    Signed-off-by: Eric Van Hensbergen

    Simon Derr
     
  • In rdma_request():

    If an error occurs between posting the recv and the send,
    there will be a reply context posted without a pending
    request.
    Since there is no way to "un-post" it, we remember it and
    skip post_recv() for the next request.

    Signed-off-by: Simon Derr
    Signed-off-by: Eric Van Hensbergen

    Simon Derr
     
  • Most importantly:
    - do not free the recv context (rpl_context) after a successful post_recv()
    - but do free the send context (c) after a failed send.

    Signed-off-by: Simon Derr
    Signed-off-by: Eric Van Hensbergen

    Simon Derr
     
  • rdma_request() should never be in charge of freeing rc.

    When an error occurs:
    * Either the rc buffer has been recv_post()'ed.
    then kfree()'ing it certainly is a bad idea.
    * Or is has not, and in that case req->rc still points to it,
    hence it needs not be freed.

    Signed-off-by: Simon Derr
    Signed-off-by: Eric Van Hensbergen

    Simon Derr
     
  • The current code keeps track of the number of buffers posted in the RQ,
    and will prevent it from overflowing. But it does so by simply dropping
    post requests (And leaking memory in the process).
    When this happens there will actually be too few buffers posted, and
    soon the 9P server will complain about 'RNR retry counter exceeded'
    errors.

    Instead, use a semaphore, and block until the RQ is ready for another
    buffer to be posted.

    Signed-off-by: Simon Derr
    Signed-off-by: Eric Van Hensbergen

    Simon Derr
     
  • A well-behaved server would not send twice the reply to a request.
    But if it ever happens...
    This additional check prevents the kernel from leaking memory
    and possibly more nasty consequences in that unlikely event.

    Signed-off-by: Simon Derr
    Signed-off-by: Eric Van Hensbergen

    Simon Derr
     
  • The current value is too low to get good performance.

    Signed-off-by: Simon Derr
    Signed-off-by: Eric Van Hensbergen

    Simon Derr
     
  • p9_tag_alloc() takes care of that.

    Signed-off-by: Simon Derr
    Signed-off-by: Eric Van Hensbergen

    Simon Derr
     

06 Jan, 2012

1 commit

  • Reduce object size by deduplicating formats.

    Use vsprintf extension %pV.
    Rename P9_DPRINTK uses to p9_debug, align arguments.
    Add function for _p9_debug and macro to add __func__.
    Add missing "\n"s to p9_debug uses.
    Remove embedded function names as p9_debug adds it.
    Remove P9_EPRINTK macro and convert use to pr_.
    Add and use pr_fmt and pr_.

    $ size fs/9p/built-in.o*
    text data bss dec hex filename
    62133 984 16000 79117 1350d fs/9p/built-in.o.new
    67342 984 16928 85254 14d06 fs/9p/built-in.o.old
    $ size net/9p/built-in.o*
    text data bss dec hex filename
    88792 4148 22024 114964 1c114 net/9p/built-in.o.new
    94072 4148 23232 121452 1da6c net/9p/built-in.o.old

    Signed-off-by: Joe Perches
    Signed-off-by: Eric Van Hensbergen

    Joe Perches
     

27 May, 2011

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
    RDMA/cma: Save PID of ID's owner
    RDMA/cma: Add support for netlink statistics export
    RDMA/cma: Pass QP type into rdma_create_id()
    RDMA: Update exported headers list
    RDMA/cma: Export enum cma_state in
    RDMA/nes: Add a check for strict_strtoul()
    RDMA/cxgb3: Don't post zero-byte read if endpoint is going away
    RDMA/cxgb4: Use completion objects for event blocking
    IB/srp: Fix integer -> pointer cast warnings
    IB: Add devnode methods to cm_class and umad_class
    IB/mad: Return EPROTONOSUPPORT when an RDMA device lacks the QP required
    IB/uverbs: Add devnode method to set path/mode
    RDMA/ucma: Add .nodename/.mode to tell userspace where to create device node
    RDMA: Add netlink infrastructure
    RDMA: Add error handling to ib_core_init()

    Linus Torvalds
     

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 May, 2011

1 commit


23 Mar, 2011

1 commit

  • Without this we can cause reclaim allocation in writepage.

    [ 3433.448430] =================================
    [ 3433.449117] [ INFO: inconsistent lock state ]
    [ 3433.449117] 2.6.38-rc5+ #84
    [ 3433.449117] ---------------------------------
    [ 3433.449117] inconsistent {RECLAIM_FS-ON-W} -> {IN-RECLAIM_FS-R} usage.
    [ 3433.449117] kswapd0/505 [HC0[0]:SC0[0]:HE1:SE1] takes:
    [ 3433.449117] (iprune_sem){+++++-}, at: [] shrink_icache_memory+0x45/0x2b1
    [ 3433.449117] {RECLAIM_FS-ON-W} state was registered at:
    [ 3433.449117] [] mark_held_locks+0x52/0x70
    [ 3433.449117] [] lockdep_trace_alloc+0x85/0x9f
    [ 3433.449117] [] slab_pre_alloc_hook+0x18/0x3c
    [ 3433.449117] [] kmem_cache_alloc+0x23/0xa2
    [ 3433.449117] [] idr_pre_get+0x2d/0x6f
    [ 3433.449117] [] p9_idpool_get+0x30/0xae
    [ 3433.449117] [] p9_client_rpc+0xd7/0x9b0
    [ 3433.449117] [] p9_client_clunk+0x88/0xdb
    [ 3433.449117] [] v9fs_evict_inode+0x3c/0x48
    [ 3433.449117] [] evict+0x1f/0x87
    [ 3433.449117] [] dispose_list+0x47/0xe3
    [ 3433.449117] [] evict_inodes+0x138/0x14f
    [ 3433.449117] [] generic_shutdown_super+0x57/0xe8
    [ 3433.449117] [] kill_anon_super+0x11/0x50
    [ 3433.449117] [] v9fs_kill_super+0x49/0xab
    [ 3433.449117] [] deactivate_locked_super+0x21/0x46
    [ 3433.449117] [] deactivate_super+0x40/0x44
    [ 3433.449117] [] mntput_no_expire+0x100/0x109
    [ 3433.449117] [] sys_umount+0x2f1/0x31c
    [ 3433.449117] [] system_call_fastpath+0x16/0x1b
    [ 3433.449117] irq event stamp: 192941
    [ 3433.449117] hardirqs last enabled at (192941): [] _raw_spin_unlock_irq+0x2b/0x30
    [ 3433.449117] hardirqs last disabled at (192940): [] shrink_inactive_list+0x290/0x2f5
    [ 3433.449117] softirqs last enabled at (188470): [] __do_softirq+0x133/0x152
    [ 3433.449117] softirqs last disabled at (188455): [] call_softirq+0x1c/0x28
    [ 3433.449117]
    [ 3433.449117] other info that might help us debug this:
    [ 3433.449117] 1 lock held by kswapd0/505:
    [ 3433.449117] #0: (shrinker_rwsem){++++..}, at: [] shrink_slab+0x38/0x15f
    [ 3433.449117]
    [ 3433.449117] stack backtrace:
    [ 3433.449117] Pid: 505, comm: kswapd0 Not tainted 2.6.38-rc5+ #84
    [ 3433.449117] Call Trace:
    [ 3433.449117] [] ? valid_state+0x17e/0x191
    [ 3433.449117] [] ? save_stack_trace+0x28/0x45
    [ 3433.449117] [] ? check_usage_forwards+0x0/0x87
    [ 3433.449117] [] ? mark_lock+0x113/0x22c
    [ 3433.449117] [] ? __lock_acquire+0x37a/0xcf7
    [ 3433.449117] [] ? mark_lock+0x2d/0x22c
    [ 3433.449117] [] ? __lock_acquire+0x392/0xcf7
    [ 3433.449117] [] ? determine_dirtyable_memory+0x15/0x28
    [ 3433.449117] [] ? lock_acquire+0x57/0x6d
    [ 3433.449117] [] ? shrink_icache_memory+0x45/0x2b1
    [ 3433.449117] [] ? down_read+0x47/0x5c
    [ 3433.449117] [] ? shrink_icache_memory+0x45/0x2b1
    [ 3433.449117] [] ? shrink_icache_memory+0x45/0x2b1
    [ 3433.449117] [] ? shrink_slab+0xdb/0x15f
    [ 3433.449117] [] ? kswapd+0x574/0x96a
    [ 3433.449117] [] ? kswapd+0x0/0x96a
    [ 3433.449117] [] ? kthread+0x7d/0x85
    [ 3433.449117] [] ? kernel_thread_helper+0x4/0x10
    [ 3433.449117] [] ? restore_args+0x0/0x30
    [ 3433.449117] [] ? kthread+0x0/0x85
    [ 3433.449117] [] ? kernel_thread_helper+0x0/0x10

    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Venkateswararao Jujjuri
    Signed-off-by: Eric Van Hensbergen

    Aneesh Kumar K.V
     

20 Jan, 2011

1 commit

  • Clean up some unused macros in net/*.
    1. be left for code change. e.g. PGV_FROM_VMALLOC, PGV_FROM_VMALLOC, KMEM_SAFETYZONE.
    2. never be used since introduced to kernel.
    e.g. P9_RDMA_MAX_SGE, UTIL_CTRL_PKT_SIZE.

    Signed-off-by: Shan Wei
    Acked-by: Sjur Braendeland
    Signed-off-by: David S. Miller

    Shan Wei
     

27 Sep, 2010

1 commit


18 May, 2010

1 commit

  • This patch removes from net/ (but not any netfilter files)
    all the unnecessary return; statements that precede the
    last closing brace of void functions.

    It does not remove the returns that are immediately
    preceded by a label as gcc doesn't like that.

    Done via:
    $ grep -rP --include=*.[ch] -l "return;\n}" net/ | \
    xargs perl -i -e 'local $/ ; while (<>) { s/\n[ \t\n]+return;\n}/\n}/g; print; }'

    Signed-off-by: Joe Perches
    Signed-off-by: David S. Miller

    Joe Perches
     

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
     

09 Feb, 2010

1 commit

  • Options pointer is being moved before calling kfree() which seems
    to cause problems. This uses a separate pointer to track and free
    original allocation.

    Signed-off-by: Venkateswararao Jujjuri
    Signed-off-by: Eric Van Hensbergen w

    Eric Van Hensbergen
     

18 Aug, 2009

1 commit


06 Apr, 2009

1 commit


22 Nov, 2008

1 commit


06 Nov, 2008

2 commits


23 Oct, 2008

1 commit