linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Horia Geantă" <horia.geanta@nxp.com>
To: Andrey Smirnov <andrew.smirnov@gmail.com>,
	"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>
Cc: Chris Healy <cphealy@gmail.com>,
	Lucas Stach <l.stach@pengutronix.de>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Iuliana Prodan <iuliana.prodan@nxp.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	dl-linux-imx <linux-imx@nxp.com>
Subject: Re: [PATCH v8 4/8] crypto: caam - simplify RNG implementation
Date: Tue, 17 Mar 2020 23:37:32 +0200	[thread overview]
Message-ID: <a662c74d-96d9-dd76-2a5c-627973898a89@nxp.com> (raw)
In-Reply-To: <20200316150047.30828-5-andrew.smirnov@gmail.com>

On 3/16/2020 5:01 PM, Andrey Smirnov wrote:
> Rework CAAM RNG implementation as follows:
> 
> - Make use of the fact that HWRNG supports partial reads and will
> handle such cases gracefully by removing recursion in caam_read()
> 
> - Convert blocking caam_read() codepath to do a single blocking job
> read directly into requested buffer, bypassing any intermediary
> buffers
> 
> - Convert async caam_read() codepath into a simple single
> reader/single writer FIFO use-case, thus simplifying concurrency
> handling and delegating buffer read/write position management to KFIFO
> subsystem.
> 
> - Leverage the same low level RNG data extraction code for both async
> and blocking caam_read() scenarios, get rid of the shared job
> descriptor and make non-shared one as a simple as possible (just
> HEADER + ALGORITHM OPERATION + FIFO STORE)
> 
> - Split private context from DMA related memory, so that the former
> could be allocated without GFP_DMA.
> 
> NOTE: On its face value this commit decreased throughput numbers
> reported by
> 
>   dd if=/dev/hwrng of=/dev/null bs=1 count=100K [iflag=nonblock]
> 
> by about 15%, however commits that enable prediction resistance and
> limit JR total size impact the performance so much and move the
> bottleneck such as to make this regression irrelevant.
> 
> NOTE: On the bright side, this commit reduces RNG in kernel DMA buffer
> memory usage from 2 x RN_BUF_SIZE (~256K) to 32K.
> 
> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> Cc: Chris Healy <cphealy@gmail.com>
> Cc: Lucas Stach <l.stach@pengutronix.de>
> Cc: Horia Geantă <horia.geanta@nxp.com>
> Cc: Herbert Xu <herbert@gondor.apana.org.au>
> Cc: Iuliana Prodan <iuliana.prodan@nxp.com>
> Cc: linux-crypto@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Cc: linux-imx@nxp.com
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>

Thanks,
Horia

  reply	other threads:[~2020-03-17 21:37 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-16 15:00 [PATCH v8 0/8] enable CAAM's HWRNG as default Andrey Smirnov
2020-03-16 15:00 ` [PATCH v8 1/8] crypto: caam - allocate RNG instantiation descriptor with GFP_DMA Andrey Smirnov
2020-03-17 15:22   ` Horia Geantă
2020-03-16 15:00 ` [PATCH v8 2/8] crypto: caam - use struct hwrng's .init for initialization Andrey Smirnov
2020-03-16 15:00 ` [PATCH v8 3/8] crypto: caam - drop global context pointer and init_done Andrey Smirnov
2020-03-17 16:45   ` Horia Geantă
2020-03-19 13:00     ` Andrey Smirnov
2020-03-16 15:00 ` [PATCH v8 4/8] crypto: caam - simplify RNG implementation Andrey Smirnov
2020-03-17 21:37   ` Horia Geantă [this message]
2020-03-17 21:58   ` Horia Geantă
2020-03-19 13:07     ` Andrey Smirnov
2020-03-16 15:00 ` [PATCH v8 5/8] crypto: caam - check if RNG job failed Andrey Smirnov
2020-03-17 17:09   ` Horia Geantă
2020-03-16 15:00 ` [PATCH v8 6/8] crypto: caam - invalidate entropy register during RNG initialization Andrey Smirnov
2020-03-16 15:00 ` [PATCH v8 7/8] crypto: caam - enable prediction resistance in HRWNG Andrey Smirnov
2020-03-17 17:41   ` Horia Geantă
2020-03-17 17:59   ` Horia Geantă
2020-03-16 15:00 ` [PATCH v8 8/8] crypto: caam - limit single JD RNG output to maximum of 16 bytes Andrey Smirnov
2020-03-17 21:56   ` Horia Geantă
2020-03-17 11:16 ` [PATCH v8 0/8] enable CAAM's HWRNG as default Horia Geantă

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=a662c74d-96d9-dd76-2a5c-627973898a89@nxp.com \
    --to=horia.geanta@nxp.com \
    --cc=andrew.smirnov@gmail.com \
    --cc=cphealy@gmail.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=iuliana.prodan@nxp.com \
    --cc=l.stach@pengutronix.de \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).