• Giovanni Cabiddu's avatar
    crypto: qat - add resubmit logic for decompression · 3112d0f1
    Giovanni Cabiddu authored
    The acomp API allows to send requests with a NULL destination buffer. In
    this case, the algorithm implementation needs to allocate the
    destination scatter list, perform the operation and return the buffer to
    the user. For decompression, data is likely to expand and be bigger than
    the allocated buffer.
    
    This implements a re-submission mechanism for decompression requests
    that is triggered if the destination buffer, allocated by the driver,
    is not sufficiently big to store the output from decompression.
    
    If an overflow is detected when processing the callback for a
    decompression request with a NULL destination buffer, a workqueue is
    scheduled. This allocates a new scatter list of size CRYPTO_ACOMP_DST_MAX,
    now 128KB, creates a new firmware scatter list and resubmits the job to
    the hardware accelerator.
    Suggested-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: default avatarGiovanni Cabiddu <giovanni.cabiddu@intel.com>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    3112d0f1
qat_bl.h 1.6 KB