• Giovanni Cabiddu's avatar
    crypto: qat - refactor submission logic · af88d3c1
    Giovanni Cabiddu authored
    All the algorithms in qat_algs.c and qat_asym_algs.c use the same
    pattern to submit messages to the HW queues. Move the submission loop
    to a new function, qat_alg_send_message(), and share it between the
    symmetric and the asymmetric algorithms.
    
    As part of this rework, since the number of retries before returning an
    error is inconsistent between the symmetric and asymmetric
    implementations, set it to a value that works for both (i.e. 20, was 10
    in qat_algs.c and 100 in qat_asym_algs.c)
    
    In addition fix the return code reported when the HW queues are full.
    In that case return -ENOSPC instead of -EBUSY.
    
    Including stable in CC since (1) the error code returned if the HW queues
    are full is incorrect and (2) to facilitate the backport of the next fix
    "crypto: qat - add backlog mechanism".
    
    Cc: stable@vger.kernel.org
    Signed-off-by: default avatarGiovanni Cabiddu <giovanni.cabiddu@intel.com>
    Reviewed-by: default avatarMarco Chiappero <marco.chiappero@intel.com>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    af88d3c1
Makefile 685 Bytes