• Chuck Lever's avatar
    xprtrdma: Replace send and receive arrays · 1e465fd4
    Chuck Lever authored
    The rb_send_bufs and rb_recv_bufs arrays are used to implement a
    pair of stacks for keeping track of free rpcrdma_req and rpcrdma_rep
    structs. Replace those arrays with free lists.
    
    To allow more than 512 RPCs in-flight at once, each of these arrays
    would be larger than a page (assuming 8-byte addresses and 4KB
    pages). Allowing up to 64K in-flight RPCs (as TCP now does), each
    buffer array would have to be 128 pages. That's an order-6
    allocation. (Not that we're going there.)
    
    A list is easier to expand dynamically. Instead of allocating a
    larger array of pointers and copying the existing pointers to the
    new array, simply append more buffers to each list.
    
    This also makes it simpler to manage receive buffers that might
    catch backwards-direction calls, or to post receive buffers in
    bulk to amortize the overhead of ib_post_recv.
    Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
    Reviewed-by: default avatarSagi Grimberg <sagig@mellanox.com>
    Reviewed-by: default avatarDevesh Sharma <devesh.sharma@avagotech.com>
    Tested-By: default avatarDevesh Sharma <devesh.sharma@avagotech.com>
    Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
    1e465fd4
verbs.c 32.6 KB