Re: [PATCH 16/18] crypto: talitos - do hw_context DMA mapping outside the requests

2018-02-22 Thread Herbert Xu
On Thu, Feb 22, 2018 at 12:29:28PM +, Horia Geantă wrote: > > IIUC this means that there is no room for improvement. > This patch needs to be reverted, to restore previous behaviour when the > hw_context was mapped / unmapped for every request. In general we should avoid trying to do batching

Re: [PATCH 16/18] crypto: talitos - do hw_context DMA mapping outside the requests

2018-02-22 Thread Herbert Xu
On Thu, Feb 22, 2018 at 12:29:28PM +, Horia Geantă wrote: > > IIUC this means that there is no room for improvement. > This patch needs to be reverted, to restore previous behaviour when the > hw_context was mapped / unmapped for every request. In general we should avoid trying to do batching

Re: [PATCH 16/18] crypto: talitos - do hw_context DMA mapping outside the requests

2018-02-22 Thread Horia Geantă
On 2/22/2018 1:47 PM, Herbert Xu wrote: > On Tue, Feb 20, 2018 at 11:32:25AM +, Horia Geantă wrote: >> >> If final/finup is optional, how is the final hash supposed to be retrieved? > > Sometimes the computation ends with a partial hash, that's what > export is for. Also it is completely

Re: [PATCH 16/18] crypto: talitos - do hw_context DMA mapping outside the requests

2018-02-22 Thread Horia Geantă
On 2/22/2018 1:47 PM, Herbert Xu wrote: > On Tue, Feb 20, 2018 at 11:32:25AM +, Horia Geantă wrote: >> >> If final/finup is optional, how is the final hash supposed to be retrieved? > > Sometimes the computation ends with a partial hash, that's what > export is for. Also it is completely

Re: [PATCH 16/18] crypto: talitos - do hw_context DMA mapping outside the requests

2018-02-22 Thread Herbert Xu
On Tue, Feb 20, 2018 at 11:32:25AM +, Horia Geantă wrote: > > If final/finup is optional, how is the final hash supposed to be retrieved? Sometimes the computation ends with a partial hash, that's what export is for. Also it is completely legal to abandon the hash state entirely. >

Re: [PATCH 16/18] crypto: talitos - do hw_context DMA mapping outside the requests

2018-02-22 Thread Herbert Xu
On Tue, Feb 20, 2018 at 11:32:25AM +, Horia Geantă wrote: > > If final/finup is optional, how is the final hash supposed to be retrieved? Sometimes the computation ends with a partial hash, that's what export is for. Also it is completely legal to abandon the hash state entirely. >

Re: [PATCH 16/18] crypto: talitos - do hw_context DMA mapping outside the requests

2018-02-20 Thread Horia Geantă
On 2/20/2018 12:34 PM, Herbert Xu wrote: > On Mon, Feb 19, 2018 at 01:16:30PM +, Horia Geantă wrote: >> >>> And what about ALGIF path from user space ? >>> What if the user never calls the last sendmsg() which will call >>> hash_finup() ? >>> >> User is expected to follow the rules of the

Re: [PATCH 16/18] crypto: talitos - do hw_context DMA mapping outside the requests

2018-02-20 Thread Horia Geantă
On 2/20/2018 12:34 PM, Herbert Xu wrote: > On Mon, Feb 19, 2018 at 01:16:30PM +, Horia Geantă wrote: >> >>> And what about ALGIF path from user space ? >>> What if the user never calls the last sendmsg() which will call >>> hash_finup() ? >>> >> User is expected to follow the rules of the

Re: [PATCH 16/18] crypto: talitos - do hw_context DMA mapping outside the requests

2018-02-20 Thread Herbert Xu
On Mon, Feb 19, 2018 at 01:16:30PM +, Horia Geantă wrote: > > > And what about ALGIF path from user space ? > > What if the user never calls the last sendmsg() which will call > > hash_finup() ? > > > User is expected to follow the rules of the crypto API. > Of course, kernel won't (or at

Re: [PATCH 16/18] crypto: talitos - do hw_context DMA mapping outside the requests

2018-02-20 Thread Herbert Xu
On Mon, Feb 19, 2018 at 01:16:30PM +, Horia Geantă wrote: > > > And what about ALGIF path from user space ? > > What if the user never calls the last sendmsg() which will call > > hash_finup() ? > > > User is expected to follow the rules of the crypto API. > Of course, kernel won't (or at

Re: [PATCH 16/18] crypto: talitos - do hw_context DMA mapping outside the requests

2018-02-19 Thread Horia Geantă
On 2/19/2018 11:14 AM, Christophe LEROY wrote: > Le 19/02/2018 à 09:30, Horia Geantă a écrit : >> On 2/19/2018 9:58 AM, Christophe LEROY wrote: >>> Le 18/02/2018 à 18:14, Horia Geantă a écrit : There is no ahash_exit() callback mirroring ahash_init(). The clean-up of request ctx

Re: [PATCH 16/18] crypto: talitos - do hw_context DMA mapping outside the requests

2018-02-19 Thread Horia Geantă
On 2/19/2018 11:14 AM, Christophe LEROY wrote: > Le 19/02/2018 à 09:30, Horia Geantă a écrit : >> On 2/19/2018 9:58 AM, Christophe LEROY wrote: >>> Le 18/02/2018 à 18:14, Horia Geantă a écrit : There is no ahash_exit() callback mirroring ahash_init(). The clean-up of request ctx

Re: [PATCH 16/18] crypto: talitos - do hw_context DMA mapping outside the requests

2018-02-19 Thread Christophe LEROY
Le 19/02/2018 à 09:30, Horia Geantă a écrit : On 2/19/2018 9:58 AM, Christophe LEROY wrote: Le 18/02/2018 à 18:14, Horia Geantă a écrit : There is no ahash_exit() callback mirroring ahash_init(). The clean-up of request ctx should be done in the last states of the hash flows described here:

Re: [PATCH 16/18] crypto: talitos - do hw_context DMA mapping outside the requests

2018-02-19 Thread Christophe LEROY
Le 19/02/2018 à 09:30, Horia Geantă a écrit : On 2/19/2018 9:58 AM, Christophe LEROY wrote: Le 18/02/2018 à 18:14, Horia Geantă a écrit : There is no ahash_exit() callback mirroring ahash_init(). The clean-up of request ctx should be done in the last states of the hash flows described here:

Re: [PATCH 16/18] crypto: talitos - do hw_context DMA mapping outside the requests

2018-02-19 Thread Horia Geantă
On 2/19/2018 9:58 AM, Christophe LEROY wrote: > Le 18/02/2018 à 18:14, Horia Geantă a écrit : >> There is no ahash_exit() callback mirroring ahash_init(). >> >> The clean-up of request ctx should be done in the last states of the hash >> flows >> described here: >>

Re: [PATCH 16/18] crypto: talitos - do hw_context DMA mapping outside the requests

2018-02-19 Thread Horia Geantă
On 2/19/2018 9:58 AM, Christophe LEROY wrote: > Le 18/02/2018 à 18:14, Horia Geantă a écrit : >> There is no ahash_exit() callback mirroring ahash_init(). >> >> The clean-up of request ctx should be done in the last states of the hash >> flows >> described here: >>

Re: [PATCH 16/18] crypto: talitos - do hw_context DMA mapping outside the requests

2018-02-18 Thread Christophe LEROY
Le 18/02/2018 à 18:14, Horia Geantă a écrit : On 2/17/2018 6:32 PM, Christophe LEROY wrote: Le 07/02/2018 à 15:39, Horia Geantă a écrit : On 10/6/2017 4:06 PM, Christophe Leroy wrote: At every request, we map and unmap the same hash hw_context. This patch moves the dma mapping/unmapping

Re: [PATCH 16/18] crypto: talitos - do hw_context DMA mapping outside the requests

2018-02-18 Thread Christophe LEROY
Le 18/02/2018 à 18:14, Horia Geantă a écrit : On 2/17/2018 6:32 PM, Christophe LEROY wrote: Le 07/02/2018 à 15:39, Horia Geantă a écrit : On 10/6/2017 4:06 PM, Christophe Leroy wrote: At every request, we map and unmap the same hash hw_context. This patch moves the dma mapping/unmapping

Re: [PATCH 16/18] crypto: talitos - do hw_context DMA mapping outside the requests

2018-02-18 Thread Horia Geantă
On 2/17/2018 6:32 PM, Christophe LEROY wrote: > > > Le 07/02/2018 à 15:39, Horia Geantă a écrit : >> On 10/6/2017 4:06 PM, Christophe Leroy wrote: >>> At every request, we map and unmap the same hash hw_context. >>> >>> This patch moves the dma mapping/unmapping in functions ahash_init() >>> and

Re: [PATCH 16/18] crypto: talitos - do hw_context DMA mapping outside the requests

2018-02-18 Thread Horia Geantă
On 2/17/2018 6:32 PM, Christophe LEROY wrote: > > > Le 07/02/2018 à 15:39, Horia Geantă a écrit : >> On 10/6/2017 4:06 PM, Christophe Leroy wrote: >>> At every request, we map and unmap the same hash hw_context. >>> >>> This patch moves the dma mapping/unmapping in functions ahash_init() >>> and

Re: [PATCH 16/18] crypto: talitos - do hw_context DMA mapping outside the requests

2018-02-17 Thread Christophe LEROY
Le 07/02/2018 à 15:39, Horia Geantă a écrit : On 10/6/2017 4:06 PM, Christophe Leroy wrote: At every request, we map and unmap the same hash hw_context. This patch moves the dma mapping/unmapping in functions ahash_init() and ahash_import(). Signed-off-by: Christophe Leroy

Re: [PATCH 16/18] crypto: talitos - do hw_context DMA mapping outside the requests

2018-02-17 Thread Christophe LEROY
Le 07/02/2018 à 15:39, Horia Geantă a écrit : On 10/6/2017 4:06 PM, Christophe Leroy wrote: At every request, we map and unmap the same hash hw_context. This patch moves the dma mapping/unmapping in functions ahash_init() and ahash_import(). Signed-off-by: Christophe Leroy ---

Re: [PATCH 16/18] crypto: talitos - do hw_context DMA mapping outside the requests

2018-02-07 Thread Horia Geantă
On 10/6/2017 4:06 PM, Christophe Leroy wrote: > At every request, we map and unmap the same hash hw_context. > > This patch moves the dma mapping/unmapping in functions ahash_init() > and ahash_import(). > > Signed-off-by: Christophe Leroy > --- >

Re: [PATCH 16/18] crypto: talitos - do hw_context DMA mapping outside the requests

2018-02-07 Thread Horia Geantă
On 10/6/2017 4:06 PM, Christophe Leroy wrote: > At every request, we map and unmap the same hash hw_context. > > This patch moves the dma mapping/unmapping in functions ahash_init() > and ahash_import(). > > Signed-off-by: Christophe Leroy > --- > drivers/crypto/talitos.c | 80 >