Re: IPSec ESN: Packets decryption fail with ESN enabled connection

2019-01-09 Thread Harsh Jain
On 04-01-2019 14:04, Steffen Klassert wrote: > On Thu, Jan 03, 2019 at 04:16:56PM +0530, Harsh Jain wrote: >> On 02-01-2019 18:21, Herbert Xu wrote: >>> Does this occur if you use software crypto on the receiving end >>> while keeping the sending end unchanged? >&

Re: IPSec ESN: Packets decryption fail with ESN enabled connection

2019-01-03 Thread Harsh Jain
On 02-01-2019 18:21, Herbert Xu wrote: > On Wed, Dec 26, 2018 at 03:16:29PM +0530, Harsh Jain wrote: >> +linux-crypto >> >> On 26-12-2018 14:54, Harsh Jain wrote: >>> Hi All, >>> >>> Kernel version on both machines: 4.19.7. >>> &g

[PATCH] crypto:authencesn: Avoid twice completion call in decrypt path

2019-01-03 Thread Harsh Jain
726136] __do_softirq+0xcb/0x280 [ 338.730054] irq_exit+0xde/0xf0 [ 338.733504] do_IRQ+0x54/0xd0 [ 338.736745] common_interrupt+0xf/0xf Signed-off-by: Harsh Jain Cc: sta...@vger.kernel.org --- crypto/authencesn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/

Re: IPSec ESN: Packets decryption fail with ESN enabled connection

2018-12-26 Thread Harsh Jain
+linux-crypto On 26-12-2018 14:54, Harsh Jain wrote: > Hi All, > > Kernel version on both machines: 4.19.7. > > Packet drops with EBADMSG is observed on receive end of connection. It seems > that sometimes crypto driver receives packet with wrong "seq_hi" value in

[PATCH 1/6] crypto:chelsio: Swap location of AAD and IV sent in WR

2018-12-11 Thread Harsh Jain
Send input as IV | AAD | Data. It will allow sending IV as Immediate Data and Creates space in Work request to add more dma mapped entries. Signed-off-by: Harsh Jain --- drivers/crypto/chelsio/chcr_algo.c | 212 +-- drivers/crypto/chelsio/chcr_algo.h | 2

[PATCH 6/6] crypto:chelsio: Fix wrong error counter increments

2018-12-11 Thread Harsh Jain
Fix error counter increment in AEAD decrypt operation when validation of tag is done in Driver instead of H/W. Signed-off-by: Harsh Jain --- drivers/crypto/chelsio/chcr_algo.c | 9 + drivers/crypto/chelsio/chcr_core.c | 11 +-- 2 files changed, 10 insertions(+), 10 deletions

[PATCH 5/6] crypto:chelsio: Reset counters on cxgb4 Detach

2018-12-11 Thread Harsh Jain
Reset the counters on receiving detach from Cxgb4. Signed-off-by: Atul Gupta --- drivers/crypto/chelsio/chcr_core.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/crypto/chelsio/chcr_core.c b/drivers/crypto/chelsio/chcr_core.c index f71a979..e04b3e8 100644 --- a/drivers/crypto/

[PATCH 3/6] crypto:chelsio: cleanup:send addr as value in function argument

2018-12-11 Thread Harsh Jain
Send dma address as value to function arguments instead of pointer. Signed-off-by: Harsh Jain --- 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

[PATCH 4/6] Crypto:Chelsio:Handle PCI shutdown event

2018-12-11 Thread Harsh Jain
chcr receives "CXGB4_STATE_DETACH" event on PCI Shutdown. Wait for processing of inflight request and Mark the device unavailable. Signed-off-by: Harsh Jain --- drivers/crypto/chelsio/chcr_algo.c | 157 ++-- drivers/crypto/chelsio/chcr_co

[PATCH 0/6] crypto:chelsio: Bug Fixes

2018-12-11 Thread Harsh Jain
It includes Bug Fixes Harsh Jain (5): crypto:chcr: Swap location of AAD and IV sent in WR crypto:chcr:Use same value for both channel in single WR crypto:chcr: cleanup:send addr as value in function argument crypto:chelsio: Fix wrong error counter increments Crypto:Chelsio:Handle PCI

[PATCH 2/6] crypto:chelsio:Use same value for both channel in single WR

2018-12-11 Thread Harsh Jain
Use tx_channel_id instead of rx_channel_id. Signed-off-by: Harsh Jain --- drivers/crypto/chelsio/chcr_algo.c | 13 ++--- drivers/crypto/chelsio/chcr_core.h | 1 - 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio

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 v2 1/1] crypto:chelsio: Update ntx queue received from cxgb4

2018-10-13 Thread Harsh Jain
Sanfilippo. Signed-off-by: Harsh Jain --- drivers/crypto/chelsio/chcr_algo.c | 3 +-- drivers/crypto/chelsio/chcr_core.c | 2 +- drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c | 20 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/driv

Re: [PATCH 1/1] crypto:chelsio: Update ntx queue received from cxgb4

2018-10-13 Thread Harsh Jain
On 13-10-2018 05:46, Lino Sanfilippo wrote: > Hi, > >> +if (uld_type == CXGB4_ULD_CRYPTO) { >> +i = min_t(int, adap->vres.ncrypto_fc, >> + num_online_cpus()); >> +txq_info->ntxq = rounddown(i, adap->params.nports); >> +if (txq_info->nt

[PATCH 1/1] crypto:chelsio: Update ntx queue received from cxgb4

2018-10-12 Thread Harsh Jain
Update cxgb4 to send No. of Tx Queue created in lldinfo struct and use the same ntxq in chcr driver. This patch depends on following commit commit add92a817e60e308a419693413a38d9d1e663aff "Fix memory corruption in DMA Mapped buffers" Signed-off-by: Harsh Jain --- drivers/cryp

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

2018-09-19 Thread Harsh Jain
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 --- drivers/crypto/chelsio/chcr_algo.c | 56 ++ 1 file changed, 26 insertions(+), 30 deletions(-) diff --git a

[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 --- drivers/crypto/chelsio/chcr_algo.c | 49 +++- drivers/crypto/chelsio/chcr_algo.h | 3 +-- drivers/crypto/chelsio/chcr_core.h | 2 +- drivers/crypto/chelsio

[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 --- drivers/crypto/chelsio/chcr_algo.c | 198 --- drivers/crypto/chelsio/chcr_crypto.h | 12 +-- 2 files changed, 97 insertions(+), 113 deletions

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 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 wrote: >> > Hi Herbert, >> > >> > Can we use buffer defined in ahash request context(private spa

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 /git/arm-soc/drivers/

[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 Signed-off-by: Harsh Jain --- drivers/crypto/chelsio/chcr_algo

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 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 from 2/5. > > Hmm, the first seri

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 --- drivers/crypto/chelsio/chcr_algo.c | 73 ++ drivers/crypto/chelsio/chcr_algo.h | 1 - 2 files changed, 34 insertions(+), 40 deletions(-) diff --git a/drivers/crypto/chelsio

[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 --- drivers/crypto/chelsio/chcr_algo.c | 19 +++ 1 file changed, 11

[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 --- 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/crypto/chelsio/chcr_algo.c

[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 --- drivers/crypto/chelsio/chcr_algo.c | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/chcr_alg

[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 --- drivers/crypto/chelsio/chcr_algo.c | 358 ++- drivers/crypto/chelsio/chcr_algo.h | 10 +- drivers/crypto/chelsio/chcr_core.h

[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

Re: error in libkcapi 1.0.3 for aead aio

2018-02-27 Thread Harsh Jain
On 28-02-2018 10:29, Harsh Jain wrote: > > On 27-02-2018 20:09, Stephan Müller wrote: >> Am Sonntag, 25. Februar 2018, 06:25:06 CET schrieb Harsh Jain: >> >> Hi Harsh, >> >>> Hi Stephan, >>> >>> 1 of the test mentioned in test.sh is

Re: error in libkcapi 1.0.3 for aead aio

2018-02-27 Thread Harsh Jain
On 27-02-2018 20:09, Stephan Müller wrote: > Am Sonntag, 25. Februar 2018, 06:25:06 CET schrieb Harsh Jain: > > Hi Harsh, > >> Hi Stephan, >> >> 1 of the test mentioned in test.sh is failing for AEAD AIO operation even >> thought driver is returning EBADMS

[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 --- 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/crypto/chelsio/chcr_algo.c

[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 --- drivers/crypto/chelsio/chcr_algo.c | 19 +++ 1 file changed, 11

[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 --- drivers/crypto/chelsio/chcr_algo.c | 358 ++- drivers/crypto/chelsio/chcr_algo.h | 10 +- drivers/crypto/chelsio/chcr_core.h

[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 --- drivers/crypto/chelsio/chcr_algo.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/chcr_alg

[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 --- drivers/crypto/chelsio/chcr_algo.c | 73 ++ drivers/crypto/chelsio/chcr_algo.h | 1 - 2 files changed, 34 insertions(+), 40 deletions(-) diff --git a/drivers/crypto/chelsio

[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: >>> >>&g

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 decry

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&#

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 eventuall

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 t

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: >>> >>> Hi Gilad, >>> > Which works well for t

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 c

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 > > diff --git a/d

[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 Signed-off-by: Harsh Jain --- drivers/crypto/chelsio/chcr_algo.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/driv

[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 Signed-off-by: Harsh Jain --- drivers/crypto/chelsio/chcr_algo.c | 28 +--- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/chcr_algo.c

[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 --- drivers/crypto/chelsio/chcr_algo.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) mode change 100644 => 100755 drivers/crypto/chelsio/chcr_algo.c diff --git a/drivers/crypto/chel

[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 Signed-off-by: Harsh Jain --- drivers/crypto/chelsio/chcr_algo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/chcr_algo.c

[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 --- drivers/crypto/chelsio/chcr_algo.c | 43 -- 1 file changed, 13 insertions(+), 30 deletions(-) diff --git a/drivers/crypto/chelsio

[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 --- drivers/crypto/chelsio/chcr_algo.c | 215 +++ drivers/crypto/chelsio/chcr_crypto.h | 7 +- 2 files changed, 199 insertions(+), 23 deletions(-) mode change 100755 => 100

[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 --- 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/crypto/chelsio/chcr_algo.c b

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

2017-10-08 Thread Harsh Jain
From: Yeshaswi M R Gowda Check and return proper error code. Signed-off-by: Jitendra Lulla Signed-off-by: Harsh Jain --- 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

[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 --- drivers/crypto/chelsio/chcr_algo.c | 237 +++ drivers/crypto/chelsio/chcr_algo.h | 3 +- drivers/crypto/chelsio/chcr_core.h

[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 --- drivers/crypto/chelsio/chcr_algo.c | 1645 ++ drivers/crypto/chelsio/chcr_algo.h

[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 --- crypto/gf128mul.c | 13 + include/crypto/gf128mul.h | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/crypto

[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 Signed-off-by: Harsh Jain --- drivers/crypto/chelsio/chcr_core.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/chelsio/chcr_core.c b/drivers/crypto/chelsio/chcr_core.c

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

2017-10-08 Thread Harsh Jain
From: Yeshaswi M R Gowda Remove unused parameter sent to latest fw. Signed-off-by: Harsh Jain --- drivers/crypto/chelsio/chcr_algo.c | 43 +++--- drivers/crypto/chelsio/chcr_algo.h | 12 +-- 2 files changed, 23 insertions(+), 32 deletions(-) diff --git

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

2017-10-05 Thread Harsh Jain
On 03-10-2017 20:28, David Laight wrote: > From: Harsh Jain >> Sent: 03 October 2017 07:46 >> It multiply GF(2^128) elements in the ble format. >> It will be used by chelsio driver to fasten gf multiplication. >^ speed up ?? It shou

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

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

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

2017-10-02 Thread Harsh Jain
gf128mul_x8_ble() will reduce gf Multiplication iteration by 8. Signed-off-by: Harsh Jain --- 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/crypto/chelsio/chcr_algo.c b

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

2017-10-02 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 --- crypto/gf128mul.c | 13 + include/crypto/gf128mul.h | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/crypto

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

2017-10-02 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-02 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 Signed-off-by: Harsh Jain --- drivers/crypto/chelsio/chcr_algo.c | 1645 ++ drivers/cryp

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

2017-10-02 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 --- drivers/crypto/chelsio/chcr_algo.c | 237 +++ drivers/crypto/chelsio/chcr_algo.h | 3 +- drivers/crypto/chelsio/chcr_core.h

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

2017-10-02 Thread Harsh Jain
Fix memory leak when device does not support crypto. Reported-by: Dan Carpenter Signed-off-by: Harsh Jain --- drivers/crypto/chelsio/chcr_core.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/chelsio/chcr_core.c b/drivers/crypto/chelsio/chcr_core.c

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

2017-10-02 Thread Harsh Jain
Check and return proper error code. Signed-off-by: Harsh Jain --- 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 bdb1014..e4bf32d 100644 --- a

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 > Sign

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 list

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

2017-09-27 Thread Harsh Jain
On 28-09-2017 03:43, Casey Leedom wrote: > | From: Raj, Ashok > | Sent: Wednesday, September 27, 2017 12:07 PM > | > | looking at the debug output i got from Harsh it still looks like a bug in > | the code. > | > | [ 538.284589] __domain_mapping nr_pages 0x1 > | [ 538.284600] __domain_mapping sg

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 e1605495c716 >> | "intel-iommu: Introduce domain_sg_mapp

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 >> | Sent: Monday, September 25, 2017 8:54 AM >> | >> | Not sure how the page->offset would end u

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 wrote: >>>   >>> While debugging DMA mapping error in chelsio crypto driver we >> observed that when scatter/gather list received by driver has some

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 a new driver? wonderi

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 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_SIZE). It starts giving DMA err

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 wrote: >>> While debugging DMA mapping error in chelsio crypto driver we observed that >>> when scatter/gather list received by driver has some entry with >>>

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

2017-09-15 Thread Harsh Jain
received sg 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 wrote: > On Thu, Aug 31, 2017 at 3:31 PM, Harsh Jain wrote: >> 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

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 wrote: > Many users of kernel async. crypto services hav

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 --- drivers/crypto/chelsio/chcr_algo.c | 23 +++ drivers/crypto/chelsio/chcr_crypto.h | 1 + 2 files c

[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 --- 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 e8ff505..14641c6 100644 --- a

[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 --- 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/chelsio/chcr_algo.c index

[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 --- drivers/crypto/chelsio/chcr_algo.c | 16 +- drivers/crypto/chelsio/chcr_core.c | 2 ++ drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | 1 + drivers/net/ethernet/chelsio/cxgb4

[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 --- 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: Supported F: drivers

[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 --- drivers/crypto/chelsio/chcr_algo.c | 786 --- drivers/crypto/chelsio/chcr_algo.h | 26 +- drivers/crypto/chelsio/chcr_core.c | 1

[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 ++-- drivers/crypto/chelsio/chcr_core.c | 53 ++---

[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 --- drivers/crypto/chelsio/chcr_algo.c | 153 +++ drivers/crypto/chelsio/chcr_crypto.h | 6 ++ 2 files changed, 142 insertions(+), 17 deletions

[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 --- 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/crypto/chelsio/chcr_algo.c

  1   2   3   >