Re: [PATCH v2 0/4] Introduce bulk mode for crypto engine framework

2016-04-18 Thread Milan Broz
On 04/18/2016 03:36 PM, Mike Snitzer wrote: > On Mon, Apr 18 2016 at 1:31am -0400, > Baolin Wang wrote: > >> Hi Herbert, >> >> On 15 April 2016 at 21:48, Herbert Xu wrote: >>> On Tue, Mar 15, 2016 at 03:47:58PM +0800, Baolin Wang wrote: Now some cipher hardware engines prefer to handle bul

Re: [PATCH v2 0/4] Introduce bulk mode for crypto engine framework

2016-04-18 Thread Mike Snitzer
On Mon, Apr 18 2016 at 1:31am -0400, Baolin Wang wrote: > Hi Herbert, > > On 15 April 2016 at 21:48, Herbert Xu wrote: > > On Tue, Mar 15, 2016 at 03:47:58PM +0800, Baolin Wang wrote: > >> Now some cipher hardware engines prefer to handle bulk block by merging > >> requests > >> to increase t

Re: [PATCH v2 0/4] Introduce bulk mode for crypto engine framework

2016-04-18 Thread Baolin Wang
On 18 April 2016 at 16:41, Herbert Xu wrote: > On Mon, Apr 18, 2016 at 04:40:36PM +0800, Baolin Wang wrote: >> >> Simply to say, now there are many different hardware engines for >> different vendors, some engines can support bulk block but some can >> not (or no cipher hardware engine), then the

Re: [PATCH v2 0/4] Introduce bulk mode for crypto engine framework

2016-04-18 Thread Herbert Xu
On Mon, Apr 18, 2016 at 04:40:36PM +0800, Baolin Wang wrote: > > Simply to say, now there are many different hardware engines for > different vendors, some engines can support bulk block but some can > not (or no cipher hardware engine), then the dm-crypt can not know > your hardware engine feature

Re: [PATCH v2 0/4] Introduce bulk mode for crypto engine framework

2016-04-18 Thread Baolin Wang
On 18 April 2016 at 16:31, Herbert Xu wrote: > On Mon, Apr 18, 2016 at 04:28:46PM +0800, Baolin Wang wrote: >> >> What I meaning is if the xts engine can support bulk block, then the >> engine driver can select bulk mode to do encryption, but if their xts >> engine can not support bulk mode, which

Re: [PATCH v2 0/4] Introduce bulk mode for crypto engine framework

2016-04-18 Thread Herbert Xu
On Mon, Apr 18, 2016 at 04:28:46PM +0800, Baolin Wang wrote: > > What I meaning is if the xts engine can support bulk block, then the > engine driver can select bulk mode to do encryption, but if their xts > engine can not support bulk mode, which depends on hardware design, > the engine driver ca

Re: [PATCH v2 0/4] Introduce bulk mode for crypto engine framework

2016-04-18 Thread Baolin Wang
On 18 April 2016 at 16:17, Herbert Xu wrote: > On Mon, Apr 18, 2016 at 04:14:48PM +0800, Baolin Wang wrote: >> On 18 April 2016 at 16:04, Herbert Xu wrote: >> > On Mon, Apr 18, 2016 at 03:58:59PM +0800, Baolin Wang wrote: >> >> >> >> That depends on the hardware engine. Some cipher hardware engin

Re: [PATCH v2 0/4] Introduce bulk mode for crypto engine framework

2016-04-18 Thread Herbert Xu
On Mon, Apr 18, 2016 at 04:14:48PM +0800, Baolin Wang wrote: > On 18 April 2016 at 16:04, Herbert Xu wrote: > > On Mon, Apr 18, 2016 at 03:58:59PM +0800, Baolin Wang wrote: > >> > >> That depends on the hardware engine. Some cipher hardware engines > >> (like xts(aes) engine) can handle the interm

Re: [PATCH v2 0/4] Introduce bulk mode for crypto engine framework

2016-04-18 Thread Baolin Wang
On 18 April 2016 at 16:04, Herbert Xu wrote: > On Mon, Apr 18, 2016 at 03:58:59PM +0800, Baolin Wang wrote: >> >> That depends on the hardware engine. Some cipher hardware engines >> (like xts(aes) engine) can handle the intermediate values (IV) by >> themselves in one bulk block, which means we c

Re: [PATCH v2 0/4] Introduce bulk mode for crypto engine framework

2016-04-18 Thread Herbert Xu
On Mon, Apr 18, 2016 at 03:58:59PM +0800, Baolin Wang wrote: > > That depends on the hardware engine. Some cipher hardware engines > (like xts(aes) engine) can handle the intermediate values (IV) by > themselves in one bulk block, which means we can increase the size of > the request by merging req

Re: [PATCH v2 0/4] Introduce bulk mode for crypto engine framework

2016-04-18 Thread Baolin Wang
On 18 April 2016 at 15:24, Herbert Xu wrote: > On Mon, Apr 18, 2016 at 03:21:16PM +0800, Baolin Wang wrote: >> >> I don't think so, the dm-crypt can not send maximal requests at some >> situations. For example, the 'cbc(aes)' cipher, it must be handled >> sector by sector (IV is dependency for eac

Re: [PATCH v2 0/4] Introduce bulk mode for crypto engine framework

2016-04-18 Thread Herbert Xu
On Mon, Apr 18, 2016 at 03:21:16PM +0800, Baolin Wang wrote: > > I don't think so, the dm-crypt can not send maximal requests at some > situations. For example, the 'cbc(aes)' cipher, it must be handled > sector by sector (IV is dependency for each sector), so the dm-crypt > can not send maximal re

Re: [PATCH v2 0/4] Introduce bulk mode for crypto engine framework

2016-04-18 Thread Baolin Wang
On 18 April 2016 at 15:04, Herbert Xu wrote: > On Mon, Apr 18, 2016 at 02:02:51PM +0800, Baolin Wang wrote: >> >> If the crypto hardware engine can support bulk data >> encryption/decryption, so the engine driver can select bulk mode to >> handle the requests. I think it is a totally driver things

Re: [PATCH v2 0/4] Introduce bulk mode for crypto engine framework

2016-04-18 Thread Herbert Xu
On Mon, Apr 18, 2016 at 02:02:51PM +0800, Baolin Wang wrote: > > If the crypto hardware engine can support bulk data > encryption/decryption, so the engine driver can select bulk mode to > handle the requests. I think it is a totally driver things, not in > dmcrypt. The dmcrypt can not get the har

Re: [PATCH v2 0/4] Introduce bulk mode for crypto engine framework

2016-04-17 Thread Baolin Wang
On 18 April 2016 at 13:45, Herbert Xu wrote: > On Mon, Apr 18, 2016 at 01:31:09PM +0800, Baolin Wang wrote: >> >> We've tried to do this in dm-crypt, but it failed. >> The dm-crypt maintainer explained to me that I should optimize the >> driver, not add strange hw-dependent crypto modes to dm-cryp

Re: [PATCH v2 0/4] Introduce bulk mode for crypto engine framework

2016-04-17 Thread Herbert Xu
On Mon, Apr 18, 2016 at 01:31:09PM +0800, Baolin Wang wrote: > > We've tried to do this in dm-crypt, but it failed. > The dm-crypt maintainer explained to me that I should optimize the > driver, not add strange hw-dependent crypto modes to dm-crypt, this is > not the first crypto accelerator that

Re: [PATCH v2 0/4] Introduce bulk mode for crypto engine framework

2016-04-17 Thread Baolin Wang
Hi Herbert, On 15 April 2016 at 21:48, Herbert Xu wrote: > On Tue, Mar 15, 2016 at 03:47:58PM +0800, Baolin Wang wrote: >> Now some cipher hardware engines prefer to handle bulk block by merging >> requests >> to increase the block size and thus increase the hardware engine processing >> speed.

Re: [PATCH v2 0/4] Introduce bulk mode for crypto engine framework

2016-04-15 Thread Herbert Xu
On Tue, Mar 15, 2016 at 03:47:58PM +0800, Baolin Wang wrote: > Now some cipher hardware engines prefer to handle bulk block by merging > requests > to increase the block size and thus increase the hardware engine processing > speed. > > This patchset introduces request bulk mode to help the cryp

[PATCH v2 0/4] Introduce bulk mode for crypto engine framework

2016-03-15 Thread Baolin Wang
Now some cipher hardware engines prefer to handle bulk block by merging requests to increase the block size and thus increase the hardware engine processing speed. This patchset introduces request bulk mode to help the crypto hardware drivers improve in efficiency. Changes since v1: - Modify th