• Mike Marciniszyn's avatar
    IB/qib: Optimize pio ack buffer allocation · bb77a077
    Mike Marciniszyn authored
    This patch optimizes pio buffer allocation in the kernel.
    
    For qib, kernel pio buffers are used for sending acks.  The code to
    allocate the buffer would always start at 0 until it found a buffer.
    
    This means that an average of 64 comparisions were done on each
    allocate, since the busy bit won't be cleared until the bits are
    refreshed when buffers are exhausted.
    
    This patch adds two new fields in the devdata struct, last_pio and
    min_kernel_pio.  last_pio is the last buffer that was allocated.
    min_kernel_pio is the lowest potential available buffer.
    
    min_kernel_pio is modifed as contexts are allocated and deallocted.
    Reviewed-by: default avatarRamkrishna Vepa <ramkrishna.vepa@intel.com>
    Signed-off-by: default avatarMike Marciniszyn <mike.marciniszyn@intel.com>
    Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
    bb77a077
qib_tx.c 16.8 KB