How driver can mark the algo implementation Unavailable

2018-11-09 Thread Harsh Jain
LG_DEAD" flag to mark it un-available so that crypto_alg_lookup does not allocate new tfm using dead algo. Regards Harsh Jain

[PATCH 1/1] crypto:chelsio: Fix memory corruption in DMA Mapped buffers.

2018-09-19 Thread Harsh Jain
ome update to avoid mege conficts. Signed-off-by: Harsh Jain --- drivers/crypto/chelsio/chcr_algo.c | 32 ++-- drivers/crypto/chelsio/chcr_crypto.h | 2 ++ 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/cryp

[PATCH 0/3] crypto:chelsio: Fixes and cleanup

2018-05-24 Thread Harsh Jain
It includes Fixes and cleanup . Harsh Jain (3): crypto:chelsio:Return -ENOSPC for transient busy indication. crypt:chelsio:Send IV as Immediate for cipher algo crypto:chelsio: Remove separate buffer used for DMA map B0 block in CCM drivers/crypto/chelsio/chcr_algo.c | 303

[PATCH 1/3] crypto:chelsio:Return -ENOSPC for transient busy indication.

2018-05-24 Thread Harsh Jain
Change the return type based on following patch https://www.mail-archive.com/linux-crypto@vger.kernel.org/msg28552.html Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 56 ++ 1 file changed, 26 insertions(+), 30 del

[PATCH 2/3] crypt:chelsio:Send IV as Immediate for cipher algo

2018-05-24 Thread Harsh Jain
Send IV in WR as immediate instead of dma mapped entry for cipher. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 49 +++- drivers/crypto/chelsio/chcr_algo.h | 3 +-- drivers/crypto/chelsio/chcr_core.h

[PATCH 3/3] crypto:chelsio: Remove separate buffer used for DMA map B0 block in CCM

2018-05-24 Thread Harsh Jain
Extends memory required for IV to include B0 Block and DMA map in single operation. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 198 --- drivers/crypto/chelsio/chcr_crypto.h | 12 +-- 2 files changed, 97 inse

Re: DMA map buffer allocated in ahash_request_ctx

2018-05-09 Thread Harsh Jain
On Wed, May 9, 2018 at 8:37 PM, Herbert Xu <herb...@gondor.apana.org.au> wrote: > On Wed, May 09, 2018 at 04:13:12PM +0300, Gilad Ben-Yossef wrote: >> On Wed, May 9, 2018 at 3:12 PM, Harsh Jain <harshjain.p...@gmail.com> wrote: >> > Hi Herbert, >> > >>

DMA map buffer allocated in ahash_request_ctx

2018-05-09 Thread Harsh Jain
Hi Herbert, Can we use buffer defined in ahash request context(private space for each request) to DMA map it to H/W.? Regards Harsh Jain

Re: [PATCH] crypto: chelsio: move chcr_ahash_continue declation out of header

2018-03-29 Thread Harsh Jain
Hi, Fix for that is already submitted in below patch. https://patchwork.kernel.org/patch/10292333/ Thanks On 28-03-2018 19:35, Arnd Bergmann wrote: > static function declarations don't belong in a header file, as shown > by this compiler warning: > > In file included from

[PATCH 1/1] crypto:chelsio - Remove declaration of static function from header

2018-03-19 Thread Harsh Jain
It fixes compilation warning introduced in commit Introduced by commit 5110e65536f3 ("crypto: chelsio -Split Hash requests for large scatter gather list") Reported-by: Stephen Rothwell <s...@canb.auug.org.au> Signed-off-by: Harsh Jain <ha...@chelsio.com> ---

Re: [PATCH v2 0/5] crypto:chelsio: Bug fixes and cleanup

2018-03-06 Thread Harsh Jain
On Tue, Mar 6, 2018 at 11:22 AM, Herbert Xu <herb...@gondor.apana.org.au> wrote: > On Tue, Mar 06, 2018 at 10:37:47AM +0530, Harsh Jain wrote: >> It includes bug fixes and code cleanup. >> >> Changes from v1: >> >> Remove Redundant soffset initialisation

Re: [PATCH 0/5] crypto: chelsio - Cleanup and bug fixes

2018-03-05 Thread Harsh Jain
Hi Herbert, Please ignore this series. V2 sent with minor change. On 11-01-2018 16:45, Harsh Jain wrote: > This series include cleanup, bug fixes and authenc algo supporting > ctr(aes)-sha operation. > > Harsh Jain (5): > crypto: chelsio - Fix Indentation > crypto: chel

[PATCH v2 1/5] crypto:chelsio: Use kernel round function to align lengths

2018-03-05 Thread Harsh Jain
Replace DIV_ROUND_UP to roundup or rounddown Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 73 ++ drivers/crypto/chelsio/chcr_algo.h | 1 - 2 files changed, 34 insertions(+), 40 deletions(-) diff --git a/d

[PATCH v2 3/5] crypto:chelsio: Update IV before sending request to HW

2018-03-05 Thread Harsh Jain
CBC Decryption requires Last Block as IV. In case src/dst buffer are same last block will be replaced by plain text. This patch copies the Last Block before sending request to HW. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 19 +++-

[PATCH v2 4/5] crypto:chelsio: Fix iv passed in fallback path for rfc3686

2018-03-05 Thread Harsh Jain
We use ctr(aes) to fallback rfc3686(ctr) request. Send updated IV to fallback path. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/

[PATCH v2 5/5] crypto:chelsio:Split Hash requests for large scatter gather list

2018-03-05 Thread Harsh Jain
Send multiple WRs to H/W when No. of entries received in scatter list cannot be sent in single request. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 358 ++- drivers/crypto/chelsio/chcr_algo.h | 10 +- drivers/

[PATCH v2 2/5] crypto:chelsio: Fix src buffer dma length

2018-03-05 Thread Harsh Jain
ulptx header cannot have length > 64k. Adjust length accordingly. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drive

[PATCH v2 0/5] crypto:chelsio: Bug fixes and cleanup

2018-03-05 Thread Harsh Jain
It includes bug fixes and code cleanup. Changes from v1: Remove Redundant soffset initialisation from 2/5. Harsh Jain (5): crypto:chelsio: Use kernel round function to align lengths crypto:chelsio: Fix src buffer dma length crypto:chelsio: Update IV before sending request to HW

Re: error in libkcapi 1.0.3 for aead aio

2018-02-28 Thread Harsh Jain
On 28-02-2018 14:28, Stephan Mueller wrote: > Am Mittwoch, 28. Februar 2018, 08:34:21 CET schrieb Harsh Jain: > > Hi Harsh, > >> Try with gdb. AIO(-x 10) works fine with step by step debugging. Also >> verified by adding print in "af_alg_async_cb" for receive

[PATCH 4/5] crypto:chelsio: Fix iv passed in fallback path for rfc3686

2018-02-24 Thread Harsh Jain
We use ctr(aes) to fallback rfc3686(ctr) request. Send updated IV to fallback path. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/

[PATCH 3/5] crypto:chelsio: Update IV before sending request to HW

2018-02-24 Thread Harsh Jain
CBC Decryption requires Last Block as IV. In case src/dst buffer are same last block will be replaced by plain text. This patch copies the Last Block before sending request to HW. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 19 +++-

[PATCH 5/5] crypto:chelsio:Split Hash requests for large scatter gather list

2018-02-24 Thread Harsh Jain
Send multiple WRs to H/W when No. of entries received in scatter list cannot be sent in single request. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 358 ++- drivers/crypto/chelsio/chcr_algo.h | 10 +- drivers/

[PATCH 2/5] crypto:chelsio: Fix src buffer dma length

2018-02-24 Thread Harsh Jain
ulptx header cannot have length > 64k. Adjust length accordingly. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drive

[PATCH 1/5] crypto:chelsio: Use kernel round function to align lengths

2018-02-24 Thread Harsh Jain
Replace DIV_ROUND_UP to roundup or rounddown Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 73 ++ drivers/crypto/chelsio/chcr_algo.h | 1 - 2 files changed, 34 insertions(+), 40 deletions(-) diff --git a/d

[PATCH 0/5] crypto:chelsio: Bug fixes and cleanup

2018-02-24 Thread Harsh Jain
It includes bug fixes and code cleanup. Harsh Jain (5): crypto:chelsio: Use kernel round function to align lengths crypto:chelsio: Fix src buffer dma length crypto:chelsio: Update IV before sending request ot HW crypto:chelsio: Fix iv passed in fallback path for rfc3686

error in libkcapi 1.0.3 for aead aio

2018-02-24 Thread Harsh Jain
)" -i 7815d4b06ae50c9c56e87bd7 -k ea38ac0c9b9998c80e28fb496a2b88d9 -a "853f98a750098bec1aa7497e979e78098155c877879556bb51ddeb6374cbaefc" -t "c4ce58985b7203094be1d134c1b8ab0b" -q "b03692f86d1b8b39baf2abb255197c98" Thanks & Regards Harsh Jain execve("../bin/kcapi&quo

Re: [PATCH v3 1/4] crypto: AF_ALG AIO - lock context IV

2018-02-15 Thread Harsh Jain
On 15-02-2018 17:15, Stephan Mueller wrote: > Am Donnerstag, 15. Februar 2018, 12:38:12 CET schrieb Harsh Jain: > > Hi Harsh, > >> On 15-02-2018 12:47, Stephan Mueller wrote: >>> Am Donnerstag, 15. Februar 2018, 08:03:20 CET schrieb Harsh Jain: >>> >>

Re: [PATCH v3 1/4] crypto: AF_ALG AIO - lock context IV

2018-02-15 Thread Harsh Jain
On 15-02-2018 12:47, Stephan Mueller wrote: > Am Donnerstag, 15. Februar 2018, 08:03:20 CET schrieb Harsh Jain: > > Hi Harsh, > >> Even after guarantee of serialization, In the end we will get wrong result >> as mentioned above. which destination side cannot

Re: [PATCH v3 1/4] crypto: AF_ALG AIO - lock context IV

2018-02-14 Thread Harsh Jain
On 15-02-2018 11:58, Stephan Mueller wrote: > Am Donnerstag, 15. Februar 2018, 06:30:36 CET schrieb Harsh Jain: > > Hi Harsh, > >> On 14-02-2018 18:22, Stephan Mueller wrote: >>> Am Mittwoch, 14. Februar 2018, 06:43:53 CET schrieb Harsh Jain: >>> >>>

Re: [PATCH v3 1/4] crypto: AF_ALG AIO - lock context IV

2018-02-14 Thread Harsh Jain
On 14-02-2018 18:22, Stephan Mueller wrote: > Am Mittwoch, 14. Februar 2018, 06:43:53 CET schrieb Harsh Jain: > > Hi Harsh, > >> Patch set is working fine with chelsio Driver. > Thank you. > >> Do we really need IV locking mechanism for AEAD algo because AEAD algo's

Re: [PATCH v3 4/4] crypto: add CRYPTO_TFM_REQ_IV_SERIALIZE flag

2018-02-13 Thread Harsh Jain
On 10-02-2018 03:34, Stephan Müller wrote: > Crypto drivers may implement a streamlined serialization support for AIO > requests that is reported by the CRYPTO_ALG_SERIALIZES_IV_ACCESS flag to > the crypto user. When the user decides that he wants to send multiple > AIO requests concurrently and

Re: [PATCH v3 1/4] crypto: AF_ALG AIO - lock context IV

2018-02-13 Thread Harsh Jain
On 10-02-2018 03:33, Stephan Müller wrote: > The kernel crypto API requires the caller to set an IV in the request data > structure. That request data structure shall define one particular cipher > operation. During the cipher operation, the IV is read by the cipher > implementation and

Re: [PATCH v2 0/4] crypto: AF_ALG AIO improvements

2018-02-07 Thread Harsh Jain
On 07-02-2018 13:12, Stephan Müller wrote: > Hi Herbert, > > Herbert, the patch 1 is meant for stable. However, this patch as is > only applies to the new AF_ALG interface implementation. Though, > the issue goes back to the first implementation of AIO support. > Shall I try prepare a patch for

Re: [PATCH] crypto: AF_ALG AIO - lock context IV

2018-02-01 Thread Harsh Jain
On 01-02-2018 15:55, Jonathan Cameron wrote: > On Thu, 1 Feb 2018 12:07:21 +0200 > Gilad Ben-Yossef wrote: > >> On Thu, Feb 1, 2018 at 12:04 PM, Stephan Mueller wrote: >>> Am Donnerstag, 1. Februar 2018, 10:35:07 CET schrieb Gilad Ben-Yossef: >>> >>>

Re: [PATCH] crypto: AF_ALG - inline IV support

2018-01-23 Thread Harsh Jain
On 21-01-2018 17:44, Stephan Müller wrote: > Hi Herbert, > > I tried to summarize the use cases of the AIO support at [1]. > > The use case covering the inline IV support is documented in section [2]. It > naturally would depend on this patch to be accepted. What is your take on > this > use

Re: [PATCH] crypto: chelsio - Delete stray tabs in create_authenc_wr()

2018-01-22 Thread Harsh Jain
On 22-01-2018 15:51, Dan Carpenter wrote: > We removed some if statements but left these statements indented too > far. HI Dan, Change already applied to cryptodev tree. https://www.mail-archive.com/linux-crypto@vger.kernel.org/msg30560.html > > Signed-off-by: Dan Carpenter

[PATCH 1/1] crypto: chelsio - Fix indentation warning

2018-01-18 Thread Harsh Jain
Fix Warning introduced in changeset e1a018e607a3 ("crypto: chelsio - Remove dst sg size zero check") Reported-by: Stephen Rothwell <s...@canb.auug.org.au> Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 10 +- 1 file chang

[PATCH 0/5] crypto: chelsio - Cleanup and bug fixes

2018-01-11 Thread Harsh Jain
This series include cleanup, bug fixes and authenc algo supporting ctr(aes)-sha operation. Harsh Jain (5): crypto: chelsio - Fix Indentation crypto: chelsio - check for sg null crypto: chelsio - Fix IV updated in XTS operation crypto: chelsio - Add authenc versions of ctr and sha

[PATCH 1/5] crypto: chelsio - Fix Indentation

2018-01-11 Thread Harsh Jain
Fix inconsistent Indenting. Reported-by: Dan Carpenter <dan.carpen...@oracle.com> Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 28 +--- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/drivers/cr

[PATCH 3/5] crypto: chelsio - Fix IV updated in XTS operation

2018-01-11 Thread Harsh Jain
Skip decrypt operation on IV received from HW for last request. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) mode change 100644 => 100755 drivers/crypto/chelsio/chcr_algo.c d

[PATCH 2/5] crypto: chelsio - check for sg null

2018-01-11 Thread Harsh Jain
Add warning message if sg is NULL after skipping bytes. Reported-by: Dan Carpenter <dan.carpen...@oracle.com> Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/cr

[PATCH 5/5] crypto: chelsio - Remove dst sg size zero check

2018-01-11 Thread Harsh Jain
sg_nents_xlen will take care of zero length sg list. Remove Destination sg list size zero check. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 43 -- 1 file changed, 13 insertions(+), 30 deletions(-) diff

[PATCH 4/5] crypto: chelsio - Add authenc versions of ctr and sha

2018-01-11 Thread Harsh Jain
Add ctr and sha combination of algo in authenc mode. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 215 +++ drivers/crypto/chelsio/chcr_crypto.h | 7 +- 2 files changed, 199 insertions(+), 23 deletions(-) mode

[PATCH v2 4/7] crypto:chelsio:Use x8_ble gf multiplication to calculate IV.

2017-10-08 Thread Harsh Jain
gf128mul_x8_ble() will reduce gf Multiplication iteration by 8. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 11 +-- drivers/crypto/chelsio/chcr_crypto.h | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/

[PATCH v2 2/7] crypto:chelsio: Check error code with IS_ERR macro

2017-10-08 Thread Harsh Jain
From: Yeshaswi M R Gowda <yesha...@chelsio.com> Check and return proper error code. Signed-off-by: Jitendra Lulla <jlu...@chelsio.com> Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 16 1 file changed, 8 insertio

[PATCH v2 5/7] crypto:chelsio:Remove allocation of sg list to implement 2K limit of dsgl header

2017-10-08 Thread Harsh Jain
Update DMA address index instead of allocating new sg list to impose 2k size limit for each entry. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 237 +++ drivers/crypto/chelsio/chcr_algo.h | 3 +- drivers/

[PATCH v2 6/7] crypto:chelsio:Move DMA un/mapping to chcr from lld cxgb4 driver

2017-10-08 Thread Harsh Jain
Allow chcr to do DMA mapping/Unmapping instead of lld cxgb4. It moves "Copy AAD to dst buffer" requirement from driver to firmware. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 1645 ++ drivers/crypto/che

[PATCH v2 3/7] crypto:gf128mul: The x8_ble multiplication functions

2017-10-08 Thread Harsh Jain
It multiply GF(2^128) elements in the ble format. It will be used by chelsio driver to speed up gf multiplication. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- crypto/gf128mul.c | 13 + include/crypto/gf128mul.h | 2 +- 2 files changed, 14 insertions(+), 1 de

[PATCH v2 7/7] crypto:chelsio: Fix memory leak

2017-10-08 Thread Harsh Jain
Fix memory leak when device does not support crypto. Reported-by: Dan Carpenter <dan.carpen...@oracle.com> Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_core.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/cr

[PATCH v2 1/7] crypto:chelsio: Remove unused parameter

2017-10-08 Thread Harsh Jain
From: Yeshaswi M R Gowda <yesha...@chelsio.com> Remove unused parameter sent to latest fw. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 43 +++--- drivers/crypto/chelsio/chcr_algo.h | 12 +-- 2 files

[PATCH 1/7] crypto:chelsio: Remove unused parameter

2017-10-03 Thread Harsh Jain
Remove unused parameter sent to latest fw. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 43 +++--- drivers/crypto/chelsio/chcr_algo.h | 12 +-- 2 files changed, 23 insertions(+), 32 deletions(-) diff

[PATCH 4/7] crypto:chelsio:Use x8_ble gf multiplication to calculate IV.

2017-10-03 Thread Harsh Jain
gf128mul_x8_ble() will reduce gf Multiplication iteration by 8. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 11 +-- drivers/crypto/chelsio/chcr_crypto.h | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/

[PATCH 3/7] crypto:gf128mul: The x8_ble multiplication functions

2017-10-03 Thread Harsh Jain
It multiply GF(2^128) elements in the ble format. It will be used by chelsio driver to fasten gf multiplication. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- crypto/gf128mul.c | 13 + include/crypto/gf128mul.h | 2 +- 2 files changed, 14 insertions(+), 1 de

[PATCH 0/7]crypto:chelsio: Bugs fixes

2017-10-03 Thread Harsh Jain
It includes bug fix and performance improvement changes. Harsh Jain (7): crypto:gf128mul: The x8_ble multiplication functions crypto:chelsio:Use x8_ble gf multiplication to calculate IV. crypto:chelsio:Remove allocation of sg list to implement 2K limit of dsgl header

[PATCH 6/7] crypto:chelsio:Move DMA un/mapping to chcr from lld cxgb4 driver

2017-10-03 Thread Harsh Jain
Allow chcr to do DMA mapping/Unmapping instead of lld cxgb4. It moves "Copy AAD to dst buffer" requirement from driver to firmware. Signed-off-by: Ganesh Goudar <ganes...@chelsio.com> Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/ch

[PATCH 7/7] crypto:chelsio: Fix memory leak

2017-10-03 Thread Harsh Jain
Fix memory leak when device does not support crypto. Reported-by: Dan Carpenter <dan.carpen...@oracle.com> Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_core.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/cr

[PATCH 2/7] crypto:chelsio: Check error code with IS_ERR macro

2017-10-03 Thread Harsh Jain
Check and return proper error code. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/chcr_algo.c index b

Re: [PATCH] iommu/vt-d: Fix scatterlist offset handling

2017-09-29 Thread Harsh Jain
> To that end, fix the intel_map_sg() path to line up the mapping > correctly (in units of MM pages rather than VT-d pages to match the > aligned_nrpages() calculation) regardless of the offset, and use > sg_phys() consistently for clarity. > > Reported-by: Harsh Jain <ha...@chelsi

Re: DMA error when sg->offset value is greater than PAGE_SIZE in Intel IOMMU

2017-09-28 Thread Harsh Jain
21e9c02fe ro intel_iommu=sp_off crashkernel=auto rhgb quiet rhgb quiet console=ttyS0,115200, console=tty0 LANG=en_US.UTF-8 > > On Thu, Sep 28, 2017 at 07:08:21PM +0530, Harsh Jain wrote: >> >> Today I tried with "Intel_iommu=sp_off" boot option. Traffic runs without >

Re: DMA error when sg->offset value is greater than PAGE_SIZE in Intel IOMMU

2017-09-28 Thread Harsh Jain
On 28-09-2017 02:59, Casey Leedom wrote: > Hey Raj, > > Let us know if you need help in gathering more debugging information. For > the time being we've decided to ERRATA the use of the Intel I/O MMU with > IPsec till we Root Cause the issue. But this is still at the top of Harsh's > bug

Re: DMA error when sg->offset value is greater than PAGE_SIZE in Intel IOMMU

2017-09-26 Thread Harsh Jain
On 26-09-2017 01:41, Dan Williams wrote: > On Mon, Sep 25, 2017 at 1:05 PM, Casey Leedom wrote: >> | From: Dan Williams >> | Sent: Monday, September 25, 2017 12:31 PM >> | ... >> | IIUC it looks like this has been broken ever since commit

Re: DMA error when sg->offset value is greater than PAGE_SIZE in Intel IOMMU

2017-09-26 Thread Harsh Jain
Find attached new set of log. After repeated tries it panics. On 26-09-2017 09:16, Harsh Jain wrote: > On 26-09-2017 00:16, Casey Leedom wrote: >> | From: Raj, Ashok <ashok@intel.com> >> | Sent: Monday, September 25, 2017 8:54 AM >> | >> | Not sure how th

Re: DMA error when sg->offset value is greater than PAGE_SIZE in Intel IOMMU

2017-09-26 Thread Harsh Jain
On 26-09-2017 00:15, David Woodhouse wrote: > On Wed, 2017-09-20 at 16:01 +0800, Herbert Xu wrote: >> Harsh Jain <ha...@chelsio.com> wrote: >>>   >>> While debugging DMA mapping error in chelsio crypto driver we >> observed that when scatter/gather li

Re: DMA error when sg->offset value is greater than PAGE_SIZE in Intel IOMMU

2017-09-25 Thread Harsh Jain
On 26-09-2017 00:16, Casey Leedom wrote: > | From: Raj, Ashok > | Sent: Monday, September 25, 2017 8:54 AM > | > | Not sure how the page->offset would end up being greater than page-size? Refer below > | > | If you have additional traces, please send them by. > | > | Is this

Re: DMA error when sg->offset value is greater than PAGE_SIZE in Intel IOMMU

2017-09-20 Thread Harsh Jain
On 20-09-2017 13:31, Herbert Xu wrote: > Harsh Jain <ha...@chelsio.com> wrote: >> While debugging DMA mapping error in chelsio crypto driver we observed that >> when scatter/gather list received by driver has some entry with page->offset >> > 4096 (PAGE_

Re: DMA error when sg->offset value is greater than PAGE_SIZE in Intel IOMMU

2017-09-20 Thread Harsh Jain
On 20-09-2017 15:42, Robin Murphy wrote: > On 20/09/17 09:01, Herbert Xu wrote: >> Harsh Jain <ha...@chelsio.com> wrote: >>> While debugging DMA mapping error in chelsio crypto driver we observed that >>> when scatter/gather list received by driver has some en

DMA error when sg->offset value is greater than PAGE_SIZE in Intel IOMMU

2017-09-16 Thread Harsh Jain
g list. 3) Since Without IOMMU every thing works fine. We are expecting IOMMU bugs. Regards Harsh Jain

Updated IV for XTS

2017-09-08 Thread Harsh Jain
3 -p `perl -e 'print "e" x  32'` 4ea328cd5b10d0cb3bbc7ab92d54072d 4ea328cd5b10d0cb3bbc7ab92d54072d 4ea328cd5b10d0cb3bbc7ab92d54072d 4ea328cd5b10d0cb3bbc7ab92d54072d Is IV update not required for XTS as we did for cbc,ctr mode. Regards Harsh Jain

Re: [PATCH v7 00/19] simplify crypto wait for async op

2017-09-05 Thread Harsh Jain
On Sun, Sep 3, 2017 at 11:47 AM, Gilad Ben-Yossef <gi...@benyossef.com> wrote: > On Thu, Aug 31, 2017 at 3:31 PM, Harsh Jain <harshjain.p...@gmail.com> wrote: >> HI Gilad, >> >> I think we need an update in ESP also. Now EBUSY return means driver >> has

Re: [PATCH v7 00/19] simplify crypto wait for async op

2017-08-31 Thread Harsh Jain
HI Gilad, I think we need an update in ESP also. Now EBUSY return means driver has accepted, Packet should not be dropped in esp_output_tail() function. . Regards Harsh Jain On Thu, Aug 24, 2017 at 7:48 PM, Gilad Ben-Yossef <gi...@benyossef.com> wrote: > Many users of kernel asyn

Re: [bug report] crypto: chcr - Select device in Round Robin fashion

2017-07-24 Thread Harsh Jain
On 20-07-2017 16:02, Dan Carpenter wrote: > Hello Harsh Jain, > > The patch 14c19b178a01: "crypto: chcr - Select device in Round Robin > fashion" from Jun 15, 2017, leads to the following static checker > warning: > > drivers/crypto/chelsio/chcr_core.c:

[PATCH] crypto: chcr: Avoid algo allocation in softirq.

2017-06-23 Thread Harsh Jain
Thsi patch fixes calling "crypto_alloc_cipher" call in bottom halves. Pre allocate aes cipher required to update Tweak value for XTS. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 23 +++ drivers/crypto/chelsio/ch

[PATCH 0/9] Bug fixes and ctr mode of operation

2017-06-15 Thread Harsh Jain
This series is based on cryptodev2.6 tree and includes bug fix ,ctr(aes), rfc3686(ctr(aes)) algo. Harsh Jain (7): crypto: chcr - Pass lcb bit setting to firmware crypto: chcr - Set fallback key crypto: chcr - Return correct error code crypto: chcr - Avoid changing request structure

[PATCH 2/9] crypto: chcr - Fix fallback key setting

2017-06-15 Thread Harsh Jain
Set key of fallback tfm for rfc4309. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/chcr_algo.c index e

[PATCH 3/9] crypto: chcr - Return correct error code

2017-06-15 Thread Harsh Jain
Return correct error instead of EINVAL. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 76 +- 1 file changed, 42 insertions(+), 34 deletions(-) diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/c

[PATCH 6/9] chcr - Add debug counters

2017-06-15 Thread Harsh Jain
Count types of operation done by HW. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 16 +- drivers/crypto/chelsio/chcr_core.c | 2 ++ drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | 1 + drivers/net/et

[PATCH 7/9] MAINTAINERS:Add maintainer for chelsio crypto driver

2017-06-15 Thread Harsh Jain
Add myself as maintainer for chcr. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 1f20176..504dc65 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3706,6 +3706,13 @@ S: Suppor

[PATCH 5/9] crypto:chcr - Add ctr mode and process large sg entries for cipher

2017-06-15 Thread Harsh Jain
It send multiple WRs to H/W to handle large sg lists. Adds ctr(aes) and rfc(ctr(aes)) modes. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 786 --- drivers/crypto/chelsio/chcr_algo.h | 26 +- drivers/crypto/c

[PATCH 9/9] crypto: chcr - Select device in Round Robin fashion

2017-06-15 Thread Harsh Jain
When multiple devices are present in system select device in round-robin fashion for crypto operations Signed-off-by: Atul Gupta Reviewed-by: Ganesh Goudar --- drivers/crypto/chelsio/chcr_algo.c | 8 ++--

[PATCH 8/9] crypto: chcr - Ensure Destination sg entry size less than 2k

2017-06-15 Thread Harsh Jain
Allocate new sg list in case received destination sg list has entry greater that 2k. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 153 +++ drivers/crypto/chelsio/chcr_crypto.h | 6 ++ 2 files changed, 142 inse

[PATCH 4/9] crypto: chcr - Avoid changing request structure

2017-06-15 Thread Harsh Jain
Do not update assoclen received in aead_request. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 37 ++--- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/

[PATCH 1/9] crypto: chcr - Pass lcb bit setting to firmware

2017-06-15 Thread Harsh Jain
GCM and CBC mode of operation requires Last Cipher Block. This patch set lcb bit in WR header when required. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 18 +++--- drivers/crypto/chelsio/chcr_algo.h | 4 ++-- 2 files changed, 13 inse

Re: [PATCH 1/1] crypto:drbg- Fixes panic in wait_for_completion call.

2017-06-12 Thread Harsh Jain
Hi Herbert, Since It's a panic BUG. Can we push this fix to stable kernel releases? Regards Harsh Jain On Sat, Jun 10, 2017 at 9:47 AM, Herbert Xu <herb...@gondor.apana.org.au> wrote: > On Fri, May 26, 2017 at 12:12:51PM +0200, Stephan Müller wrote: >> Am Donnerstag, 25. Mai

Re: Can someone check linux kernel 4.4, and 4.9 rfc4309 test vectors?

2017-06-09 Thread Harsh Jain
On Wed, Jun 7, 2017 at 7:27 PM, Che-Min Hsieh wrote: > Rfc4309 test vectors in testmgr.h have gone through major changes from linux3 > to linux4. > In linux 4.4, linux4.9, there are vectors as such > > 23194 static struct aead_testvec aes_ccm_rfc4309_enc_tv_template[]

Re: [PATCH 1/1] crypto:drbg- Fixes panic in wait_for_completion call.

2017-05-26 Thread Harsh Jain
On Fri, May 26, 2017 at 3:42 PM, Stephan Müller <smuel...@chronox.de> wrote: > Am Donnerstag, 25. Mai 2017, 17:23:47 CEST schrieb Harsh Jain: > > Hi Harsh, > >> Initialise ctr_completion variable before use. > > Thank you very much for catching this. > > But

[PATCH 1/1] crypto:drbg- Fixes panic in wait_for_completion call.

2017-05-25 Thread Harsh Jain
Initialise ctr_completion variable before use. Signed-off-by: Harsh Jain <harshjain.p...@gmail.com> --- crypto/drbg.c |1 + 1 file changed, 1 insertion(+) diff --git a/crypto/drbg.c b/crypto/drbg.c index fa749f4..f1db29d 100644 --- a/crypto/drbg.c +++ b/crypto/drbg.c @@ -1840,6 +

Re: BUG: drbg: Added nodes from Stack Memory in link list

2017-05-08 Thread Harsh Jain
On Mon, May 8, 2017 at 2:00 PM, Stephan Müller <smuel...@chronox.de> wrote: > Am Montag, 8. Mai 2017, 08:30:13 CEST schrieb Harsh Jain: > > Hi Harsh, >> >> Confusing, I have to dig more for DRBG. Actually we observed following >> panic in Chcr (Chelsio) when drgb

Re: BUG: drbg: Added nodes from Stack Memory in link list

2017-05-08 Thread Harsh Jain
On Wed, May 3, 2017 at 6:41 PM, Stephan Müller <smuel...@chronox.de> wrote: > Am Mittwoch, 3. Mai 2017, 14:47:24 CEST schrieb Harsh Jain: > > Hi Harsh, > >> Hi Stephen, >> >> In drbg driver local variable of function are added as list nodes. one >> insta

BUG: drbg: Added nodes from Stack Memory in link list

2017-05-03 Thread Harsh Jain
s't a BUG? or I missed something. Regards Harsh Jain

Re: [PATCH 08/22] crypto: chcr: Make use of the new sg_map helper function

2017-04-14 Thread Harsh Jain
On Fri, Apr 14, 2017 at 3:35 AM, Logan Gunthorpe wrote: > The get_page in this area looks *highly* suspect due to there being no > corresponding put_page. However, I've left that as is to avoid breaking > things. chcr driver will post the request to LLD driver cxgb4 and

Re: [PATCH 2/2] crypto: chcr - Fix error checking

2017-04-13 Thread Harsh Jain
On Thu, Apr 13, 2017 at 8:20 PM, Christophe JAILLET wrote: > Le 13/04/2017 à 16:04, Dan Carpenter a écrit : >> >> On Thu, Apr 13, 2017 at 02:14:30PM +0200, Christophe JAILLET wrote: >>> >>> If 'chcr_alloc_shash()' a few lines above fails, 'base_hash' can be an >>>

[PATCH 4/4] chcr: Add fallback for AEAD algos

2017-04-10 Thread Harsh Jain
Fallback to sw when I AAD length greater than 511 II Zero length payload II No of sg entries exceeds Request size. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 219 ++ drivers/crypto/chelsio/chcr_

[PATCH 3/4] chcr:Fix txq ids.

2017-04-10 Thread Harsh Jain
The patch fixes a critical issue to map txqid with flows on the hardware appropriately, if tx queues created are more than flows configured then txqid shall map within the range of hardware flows configured. This ensure that un-mapped txqid does not remain un-handled. The patch also segregated

[PATCH 2/4] chcr:Set hmac_ctrl bit to use HW register HMAC_CFG[456]

2017-04-10 Thread Harsh Jain
Use hmac_ctrl bit value saved in setauthsize callback. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 24 +--- 1 files changed, 5 insertions(+), 19 deletions(-) diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/

[PATCH 1/4] chcr: Increase priority of AEAD algos.

2017-04-10 Thread Harsh Jain
-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 12 ++-- drivers/crypto/chelsio/chcr_crypto.h |4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/chcr_algo.c index 4

[PATCH 0/4] Bug fixes and fallback for AEAD

2017-04-10 Thread Harsh Jain
This series based on Herbert cryptodev-2.6. It includes bug fixes and fallback for AEAD algos. Harsh Jain (3): chcr: Increase priority of AEAD algos. chcr:Set hmac_ctrl bit to use HW register HMAC_CFG[456]. chcr: Add fallback for AEAD algos Atul Gupta (1): chcr: Fix txq ids drivers

Re: What should be the algo priority

2017-04-05 Thread Harsh Jain
On Tue, Apr 4, 2017 at 6:07 PM, Stephan Müller <smuel...@chronox.de> wrote: > Am Dienstag, 4. April 2017, 09:53:17 CEST schrieb Harsh Jain: > > Hi Harsh, > >> Hi, >> >> Do we have any guidelines documented to decide what should be the >>

Re: BUG: Seems un-initialed dst pointer received from algif_aead when outlen is zero

2017-03-21 Thread Harsh Jain
On Tue, Mar 21, 2017 at 5:13 PM, Stephan Müller <smuel...@chronox.de> wrote: > Am Dienstag, 21. März 2017, 11:59:54 CET schrieb Harsh Jain: > > Hi Harsh, > >> > Executing this command on a 4.9 kernel, I get: >> > >> > bin/kcapi -x 2

Re: BUG: Seems un-initialed dst pointer received from algif_aead when outlen is zero

2017-03-21 Thread Harsh Jain
On Tue, Mar 21, 2017 at 4:29 PM, Harsh Jain <harshjain.p...@gmail.com> wrote: > On Tue, Mar 21, 2017 at 3:34 PM, Stephan Müller <smuel...@chronox.de> wrote: >> Am Dienstag, 21. März 2017, 07:13:53 CET schrieb Harsh Jain: >> >> Hi Harsh, >> >>> Hi,

Re: BUG: Seems un-initialed dst pointer received from algif_aead when outlen is zero

2017-03-21 Thread Harsh Jain
On Tue, Mar 21, 2017 at 3:34 PM, Stephan Müller <smuel...@chronox.de> wrote: > Am Dienstag, 21. März 2017, 07:13:53 CET schrieb Harsh Jain: > > Hi Harsh, > >> Hi, >> >> For tag only AEAD decrypt operation(Zero length Payload). The dst sg >> list pointer pa

  1   2   >