On Mon, May 26, 2014 at 05:58:19PM +0200, Marek Vasut wrote: > Hello, > > I'm digging in crypto/algapi.c , in the crypto_enqueue_request() function. I > don't quite understand how the backlog mechanism should work. According to [1], > I suspect it should limit the amount of requests in the queue to $max_qlen and > allow one more request to be enqueued into the $backlog ; and if there is more > requests than $max_qlen, it should start dropping the requests ? > > Inspecting the code, I see these situations: > 1) qlen < max_qlen > -> The request is enqueued, qlen is increased , returns -EINPROGRESS > 2) qlen >= max_qlen > -> The crypto_enqueue_request() returns -EBUSY in this case > 2a) request->flags has CRYPTO_TFM_REQ_MAY_BACKLOG unset > => Request is not enqueued , qlen is not increased > 2b) request->flags has CRYPTO_TFM_REQ_MAY_BACKLOG set > => Request is enqueued , qlen is increased The queue is per-tfm. In this case you never want to share a tfm between two users that do not agree on whether to have backlog or not. Cheers, -- Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html