Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Catalin Vasile <cata.vasile@nxp.com>
Cc: linux-crypto@vger.kernel.org, linux-crypto-owner@vger.kernel.org,
	horia.geanta@nxp.com, alexandru.porosanu@nxp.com,
	scott.wood@nxp.com, cata.vasile@nxp.com
Subject: Re: [PATCH] crypto: caam: add backlogging support
Date: Tue, 10 May 2016 17:46:22 +0800	[thread overview]
Message-ID: <20160510094622.GA15860@gondor.apana.org.au> (raw)
In-Reply-To: <1462540733-2170-1-git-send-email-cata.vasile@nxp.com>

Catalin Vasile <cata.vasile@nxp.com> wrote:
> caam_jr_enqueue() function returns -EBUSY once there are no more slots
> available in the JR, but it doesn't actually save the current request.
> This breaks the functionality of users that expect that even if there is
> no more space for the request, it is at least queued for later
> execution. In other words, all crypto transformations that request
> backlogging (i.e. have CRYPTO_TFM_REQ_MAY_BACKLOG set), will hang. Such
> an example is dm-crypt. The current patch solves this issue by setting a
> threshold after which caam_jr_enqueue() returns -EBUSY, but since the HW
> job ring isn't actually full, the job is enqueued.
> 
> Signed-off-by: Alexandru Porosanu <alexandru.porosanu@nxp.com>
> Tested-by: Catalin Vasile <cata.vasile@nxp.com>

This is not acceptable.  The request that triggers EBUSY must
be allowed to queue.  As the number of tfms is unlimited you
can't just put them onto the hardware queue and hope that it
works out.

You should use a software queue instead.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

  parent reply	other threads:[~2016-05-10  9:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-06 13:18 [PATCH] crypto: caam: add backlogging support Catalin Vasile
2016-05-06 13:18 ` [PATCH] crypto: caam: fix caam_jr_alloc() ret code Catalin Vasile
2016-05-10  9:54   ` Herbert Xu
2016-05-09 14:50 ` [PATCH] crypto: caam: add backlogging support Horia Ioan Geanta Neag
2016-05-10 14:59   ` Alexandru Porosanu
2016-05-10  9:46 ` Herbert Xu [this message]
2016-05-11  7:53   ` Catalin Vasile
2016-05-11 10:54     ` Herbert Xu
2016-05-13 12:55       ` Catalin Vasile
2016-05-13 13:50         ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160510094622.GA15860@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=alexandru.porosanu@nxp.com \
    --cc=cata.vasile@nxp.com \
    --cc=horia.geanta@nxp.com \
    --cc=linux-crypto-owner@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=scott.wood@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox