Re: [PATCH 1/2] crypto: tcrypt - fix S/G table for test_aead_speed()

2017-11-09 Thread Herbert Xu
On Fri, Nov 10, 2017 at 06:37:22AM +, Horia Geantă wrote: > On 11/10/2017 12:21 AM, Herbert Xu wrote: > > On Thu, Nov 09, 2017 at 02:37:29PM +, Horia Geantă wrote: > >> > sg_init_table(sg, np + 1); > >> sg_mark_end() marks sg[np]. > >> > -np--; > +if

[PATCH] crypto: algif_aead - skip SGL entries with NULL page

2017-11-09 Thread Stephan Müller
The TX SGL may contain SGL entries that are assigned a NULL page. This may happen if a multi-stage AIO operation is performed where the data for each stage is pointed to by one SGL entry. Upon completion of that stage, af_alg_pull_tsgl will assign NULL to the SGL entry. The NULL cipher used to cop

Re: [PATCH 1/2] crypto: tcrypt - fix S/G table for test_aead_speed()

2017-11-09 Thread Horia Geantă
On 11/10/2017 12:21 AM, Herbert Xu wrote: > On Thu, Nov 09, 2017 at 02:37:29PM +, Horia Geantă wrote: >> sg_init_table(sg, np + 1); >> sg_mark_end() marks sg[np]. >> - np--; + if (rem) + np--; for (k = 0; k < np; k++) sg_set_buf(&sg[k +

Re: [PATCH 1/2] crypto: tcrypt - fix S/G table for test_aead_speed()

2017-11-09 Thread Herbert Xu
On Thu, Nov 09, 2017 at 02:37:29PM +, Horia Geantă wrote: > > >>sg_init_table(sg, np + 1); > sg_mark_end() marks sg[np]. > > >> - np--; > >> + if (rem) > >> + np--; > >>for (k = 0; k < np; k++) > >>sg_set_buf(&sg[k + 1], xbuf[k], PAGE_SIZE); > In case rem == 0, l

[PATCH] crypto: s5p-sss - Remove a stray tab

2017-11-09 Thread Dan Carpenter
This code seems correct, but the goto was indented too far. Signed-off-by: Dan Carpenter diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c index 142c6020cec7..62830a43d959 100644 --- a/drivers/crypto/s5p-sss.c +++ b/drivers/crypto/s5p-sss.c @@ -1461,7 +1461,7 @@ static void s5p_ha

[PATCH] crypto: chelsio - Fix an error code in chcr_hash_dma_map()

2017-11-09 Thread Dan Carpenter
The dma_map_sg() function returns zero on error and positive values on success. We want to return -ENOMEM on failure here and zero on success. Fixes: 2f47d5804311 ("crypto: chelsio - Move DMA un/mapping to chcr from lld cxgb4 driver") Signed-off-by: Dan Carpenter diff --git a/drivers/crypto/ch

Re: [PATCH RESEND 1/4] crypto: caam: add caam-dma node to SEC4.0 device tree binding

2017-11-09 Thread Kim Phillips
On Thu, 9 Nov 2017 11:54:13 + Radu Andrei Alexe wrote: > On 10/30/2017 4:24 PM, Kim Phillips wrote: > > On Mon, 30 Oct 2017 15:46:51 +0200 > > Horia Geantă wrote: > > > >> += > >> +CAAM DMA Node > >> + > >> +Child node

Re: [PATCH v2] tpm: Move Linux RNG connection to hwrng

2017-11-09 Thread Jason Gunthorpe
On Thu, Nov 09, 2017 at 09:49:33PM +0530, PrasannaKumar Muralidharan wrote: > Hi Jason, > > On 7 November 2017 at 21:34, Jason Gunthorpe wrote: > > On Tue, Nov 07, 2017 at 08:50:44AM +0530, PrasannaKumar Muralidharan wrote: > > > >> I am assuming you are talking about the following patches - usin

Re: [PATCH v2] tpm: Move Linux RNG connection to hwrng

2017-11-09 Thread PrasannaKumar Muralidharan
Hi Jason, On 7 November 2017 at 21:34, Jason Gunthorpe wrote: > On Tue, Nov 07, 2017 at 08:50:44AM +0530, PrasannaKumar Muralidharan wrote: > >> I am assuming you are talking about the following patches - using >> struct tpm_chip instead of chip number and this patch. > > yes > >> I won't be able

Re: [PATCH 1/2] crypto: tcrypt - fix S/G table for test_aead_speed()

2017-11-09 Thread Horia Geantă
On 11/3/2017 2:42 PM, Herbert Xu wrote: > On Tue, Oct 10, 2017 at 01:21:59PM +0300, Robert Baronescu wrote: >> In case buffer length is a multiple of PAGE_SIZE, >> the S/G table is incorrectly generated. >> Fix this by handling buflen = k * PAGE_SIZE separately. >> >> Signed-off-by: Robert Baronesc

Re: [PATCH v2 00/10] staging: ccree: fixes and cleanups

2017-11-09 Thread Dan Carpenter
Reviewed-by: Dan Carpenter regards, dan carpenter

Re: [PATCH 6/8] staging: ccree: simplify pm manager using local var

2017-11-09 Thread Dan Carpenter
On Thu, Nov 09, 2017 at 08:27:28AM +0200, Gilad Ben-Yossef wrote: > On Tue, Nov 7, 2017 at 12:43 PM, Dan Carpenter > wrote: > > On Tue, Nov 07, 2017 at 09:40:02AM +, Gilad Ben-Yossef wrote: > >> --- a/drivers/staging/ccree/ssi_pm.c > >> +++ b/drivers/staging/ccree/ssi_pm.c > >> @@ -90,20 +90,

Re: [PATCH RESEND 1/4] crypto: caam: add caam-dma node to SEC4.0 device tree binding

2017-11-09 Thread Radu Andrei Alexe
On 10/30/2017 4:24 PM, Kim Phillips wrote: > On Mon, 30 Oct 2017 15:46:51 +0200 > Horia Geantă wrote: > >> += >> +CAAM DMA Node >> + >> +Child node of the crypto node that enables the use of the DMA >> capabilities >> +o

[PATCH v2 2/2] chcr: Add support for Inline IPSec

2017-11-09 Thread Atul Gupta
register xfrmdev_ops callbacks, Send IPsec tunneled data to HW for inline processing. The driver use hardware crypto accelerator to encrypt and generate ICV for the transmitted packet in Inline mode. Signed-off-by: Atul Gupta Signed-off-by: Harsh Jain Signed-off-by: Ganesh Goudar --- V2: Fixed

[PATCH v2 1/2] cxgb4: Add support for Inline IPSec Tx

2017-11-09 Thread Atul Gupta
Added Tx routine for ULD - define interface for ULD Tx. Export routines used for Tx data - Routines common for data transmit are used by cxgb4 and chcr drivers. - EXPORT routines enable transmit from chcr driver. Signed-off-by: Atul Gupta Signed-off-by: Harsh Jain Signed-off-by: Ganesh Goudar

Re: [PATCH] staging: ccree: remove unused pointer cc_base

2017-11-09 Thread Gilad Ben-Yossef
Hi Colin, Thank you very much for your patch. On Thu, Nov 9, 2017 at 10:13 AM, Colin King wrote: > From: Colin Ian King > > Pointer cc_base is being assigned but is never read, hence it is > redundant and can be removed. Cleans up clang warning: > > drivers/staging/ccree/ssi_driver.c:235:2: war

[PATCH v2 01/10] staging: ccree: fix leak of import() after init()

2017-11-09 Thread Gilad Ben-Yossef
crypto_ahash_import() may be called either after crypto_ahash_init() or without such call. Right now we always internally call init() as part of import(), thus leaking memory and mappings if the user has already called init() herself. Fix this by only calling init() internally if the state is not

[PATCH v2 03/10] staging: ccree: simplify AEAD using local var

2017-11-09 Thread Gilad Ben-Yossef
Make the code more readable by using a local variable for commonly use expression in the AEAD part of the driver. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/staging/ccree/ssi_aead.c b

[PATCH v2 02/10] staging: ccree: make long func call sites readable

2017-11-09 Thread Gilad Ben-Yossef
The driver was using a function naming scheme including common prefixes for driver global functions based on the code module they came from. The combination of long names with long common prefixes made the whole thing too long for a human to parse. Switch to simple and shorter function naming sch

[PATCH v2 05/10] staging: ccree: fold common code into function

2017-11-09 Thread Gilad Ben-Yossef
Fold common code copying MAC to/from a temp. buffer into an inline function instead of keeping multiple open coded versions of same. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_buffer_mgr.c | 89 ++ 1 file changed, 37 insertions(+), 52 deletions(

[PATCH v2 04/10] staging: ccree: simplify buf mgr using local vars

2017-11-09 Thread Gilad Ben-Yossef
Make the code more readable by using a local variables for commonly use expressions in the buffer manager part of the driver. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_buffer_mgr.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers

[PATCH v2 06/10] staging: ccree: simplify pm manager using local var

2017-11-09 Thread Gilad Ben-Yossef
Make the code more readable by using a local variable. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_pm.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/staging/ccree/ssi_pm.c b/drivers/staging/ccree/ssi_pm.c index e1bc4c5..d60143c 100644

[PATCH v2 08/10] staging: ccree: remove compare to none zero

2017-11-09 Thread Gilad Ben-Yossef
The driver was full of code checking "if (x != 0)". Replace by "if (x)" for better readability. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c| 28 +-- drivers/staging/ccree/ssi_buffer_mgr.c | 74 ++--- drivers/staging/ccree/ssi_ciph

[PATCH v2 09/10] staging: ccree: remove braces for single statement

2017-11-09 Thread Gilad Ben-Yossef
Remove necessary braces for single statement blocks to improve code readabilty. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_buffer_mgr.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/ccree/ssi_buffer_mgr.c b/drivers/staging/ccree/ssi

[PATCH v2 07/10] staging: ccree: remove unneeded cast

2017-11-09 Thread Gilad Ben-Yossef
Remove unneeded cast of the return value of dev_get_drvdata() to struct ssi_drvdata * for better readability. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_pm.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/staging/ccree/ssi_pm.c b/drive

[PATCH v2 10/10] staging: ccree: remove unused cc_base parameter

2017-11-09 Thread Gilad Ben-Yossef
Remove a common parameter named cc_base with the pointer to the mapped command registers which was used by the old register access macros that are not longer in use. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c| 2 +- drivers/staging/ccree/ssi_cipher.c | 12

[PATCH v2 00/10] staging: ccree: fixes and cleanups

2017-11-09 Thread Gilad Ben-Yossef
This is another batch of ccree fixes & cleanups. The first patch is a bug fix. All others are pure readability and coding style fixes. Changes from v1: - Fix several coding style issues pointed out by Dan Carpenter. - Added two more patches of similar issues that surfaced during the review.

[PATCH] crypto: chelsio: remove redundant assignments to reqctx and dst_size

2017-11-09 Thread Colin King
From: Colin Ian King Pointer reqctx is assigned the same value twice, once on initialization and again a few statements later, remove the second redundant assignment. Variable dst_size is assigned but it is never read, so the variable is redundant and can be removed. Cleans up clang warnings: dr

[PATCH] staging: ccree: remove unused pointer cc_base

2017-11-09 Thread Colin King
From: Colin Ian King Pointer cc_base is being assigned but is never read, hence it is redundant and can be removed. Cleans up clang warning: drivers/staging/ccree/ssi_driver.c:235:2: warning: Value stored to 'cc_base' is never read Signed-off-by: Colin Ian King --- drivers/staging/ccree/ssi_d