[net] tls/chtls: fix kernel panic with tls_toe

2021-04-13 Thread Rohit Maheshwari
alize tcp_ulp_ops. Also make sure tls context is freed only for listen sockets. Fixes: 95fa145479fb ("bpf: sockmap/tls, close can race with map free") Signed-off-by: Vinay Kumar Yadav Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/chtls/chtls_cm.c| 12 --- .../chelsi

Re: [net] net: feature check mandating HW_CSUM is wrong

2021-01-14 Thread rohit maheshwari
On 13/01/21 10:37 PM, Tariq Toukan wrote: On 1/13/2021 5:35 AM, Alexander Duyck wrote: On Tue, Jan 12, 2021 at 6:43 PM rohit maheshwari wrote: On 07/01/21 12:47 AM, Jakub Kicinski wrote: On Wed,  6 Jan 2021 23:23:27 +0530 Rohit Maheshwari wrote: Mandating NETIF_F_HW_CSUM to enable TLS

Re: [net] net: feature check mandating HW_CSUM is wrong

2021-01-12 Thread rohit maheshwari
On 07/01/21 12:47 AM, Jakub Kicinski wrote: On Wed, 6 Jan 2021 23:23:27 +0530 Rohit Maheshwari wrote: Mandating NETIF_F_HW_CSUM to enable TLS offload feature is wrong. And it broke tls offload feature for the drivers, which are still using NETIF_F_IP_CSUM or NETIF_F_IPV6_CSUM. We should use

[net] net: feature check mandating HW_CSUM is wrong

2021-01-06 Thread Rohit Maheshwari
abled") Signed-off-by: Rohit Maheshwari --- net/core/dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/dev.c b/net/core/dev.c index a46334906c94..b1f99287f280 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -9643,7 +9643,7 @@ static netdev_

[net] cxgb4: advertise NETIF_F_HW_CSUM

2021-01-05 Thread Rohit Maheshwari
rt to hw_features") Signed-off-by: Rohit Maheshwari --- drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c index 7fd264a6d085..f9

[net] net/tls: tls offload is broken

2020-12-01 Thread Rohit Maheshwari
rotocol-aware") Signed-off-by: Rohit Maheshwari --- net/tls/tls_device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c index 6cc9fe778356..f7fb7d2c1de1 100644 --- a/net/tls/tls_device.c +++ b/net/tls/tls_device.c @@ -998,

[net v2] ch_ktls: lock is not freed

2020-11-24 Thread Rohit Maheshwari
Currently lock gets freed only if timeout expires, but missed a case when HW returns failure and goes for cleanup. Fixes: efca3878a5fb ("ch_ktls: Issue if connection offload fails") Signed-off-by: Rohit Maheshwari --- .../net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c|

[net] ch_ktls: lock is not freed

2020-11-18 Thread Rohit Maheshwari
Currently lock gets freed only if timeout expires, but missed a case when HW returns failure and goes for cleanup. Fixes: efca3878a5fb ("ch_ktls: Issue if connection offload fails") Signed-off-by: Rohit Maheshwari --- .../net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c |

[net v6 12/12] ch_ktls: stop the txq if reaches threshold

2020-11-09 Thread Rohit Maheshwari
Stop the queue and ask for the credits if queue reaches to threashold. Fixes: 5a4b9fe7fece ("cxgb4/chcr: complete record tx handling") Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 18 +++--- 1 file changed, 15 insertions(+), 3

[net v6 11/12] ch_ktls: tcb update fails sometimes

2020-11-09 Thread Rohit Maheshwari
context id and port id should be filled while sending tcb update. Fixes: 5a4b9fe7fece ("cxgb4/chcr: complete record tx handling") Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c| 12 1 file changed, 8 insertions(+), 4 deletion

[net v6 07/12] ch_ktls: Correction in middle record handling

2020-11-09 Thread Rohit Maheshwari
time, that's why we need to check if remaining part is smaller than TAG size, then reset TX_MAX to be TAG starting sequence number. Fixes: 5a4b9fe7fece ("cxgb4/chcr: complete record tx handling") Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktls/c

[net v6 01/12] cxgb4/ch_ktls: decrypted bit is not enough

2020-11-09 Thread Rohit Maheshwari
ve it for tls offload handling. v2->v3: - Removed ifdef. Fixes: 5a4b9fe7fece ("cxgb4/chcr: complete record tx handling") Signed-off-by: Rohit Maheshwari --- drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 1 + drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h

[net v6 00/12] cxgb4/ch_ktls: Fixes in nic tls code

2020-11-09 Thread Rohit Maheshwari
;v3: - Replaced GFP_KERNEL with GFP_ATOMIC. - Removed mixed fixes. v3->v4: - Corrected fixes tag issue. v4->v5: - Separated mixed fixes from patch 4. v5-v6: - Fixes tag should be at the end. Rohit Maheshwari (12): cxgb4/ch_ktls: decrypted bit is not enough ch_ktls: Correction in finding

[net v6 10/12] ch_ktls/cxgb4: handle partial tag alone SKBs

2020-11-09 Thread Rohit Maheshwari
iddle part of record") Signed-off-by: Rohit Maheshwari --- .../ethernet/chelsio/cxgb4/cxgb4_debugfs.c| 2 + .../net/ethernet/chelsio/cxgb4/cxgb4_uld.h| 1 + .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 116 +- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.h | 1

[net v6 03/12] ch_ktls: Update cheksum information

2020-11-09 Thread Rohit Maheshwari
Checksum update was missing in the WR. Fixes: 429765a149f1 ("chcr: handle partial end part of a record") Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/d

[net v6 02/12] ch_ktls: Correction in finding correct length

2020-11-09 Thread Rohit Maheshwari
There is a possibility of linear skbs coming in. Correcting the length extraction logic. v2->v3: - Separated un-related changes from this patch. Fixes: 5a4b9fe7fece ("cxgb4/chcr: complete record tx handling") Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktl

[net v6 09/12] ch_ktls: don't free skb before sending FIN

2020-11-09 Thread Rohit Maheshwari
If its a last packet and fin is set. Make sure FIN is informed to HW before skb gets freed. Fixes: 429765a149f1 ("chcr: handle partial end part of a record") Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c| 12 ++-- 1 file changed, 10

[net v6 08/12] ch_ktls: packet handling prior to start marker

2020-11-09 Thread Rohit Maheshwari
dling") Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 38 --- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c b/drivers/net/ethernet/chelsio/inline_cryp

[net v6 05/12] ch_ktls: Correction in trimmed_len calculation

2020-11-09 Thread Rohit Maheshwari
trimmed length calculation goes wrong if skb has only tag part to send. It should be zero if there is no data bytes apart from TAG. Fixes: dc05f3df8fac ("chcr: Handle first or middle part of record") Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c

[net v6 04/12] cxgb4/ch_ktls: creating skbs causes panic

2020-11-09 Thread Rohit Maheshwari
uot;chcr: handle partial end part of a record") Signed-off-by: Rohit Maheshwari --- drivers/net/ethernet/chelsio/cxgb4/cxgb4.h| 3 + drivers/net/ethernet/chelsio/cxgb4/sge.c | 108 +++ .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 284 +++--- 3 files changed, 226 inser

[net v6 06/12] ch_ktls: missing handling of header alone

2020-11-09 Thread Rohit Maheshwari
If an skb has only header part which doesn't start from beginning, is not being handled properly. Fixes: dc05f3df8fac ("chcr: Handle first or middle part of record") Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 25 --- 1 f

[net v5 11/12] ch_ktls: tcb update fails sometimes

2020-11-09 Thread Rohit Maheshwari
context id and port id should be filled while sending tcb update. Fixes: 5a4b9fe7fece ("cxgb4/chcr: complete record tx handling") Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c| 12 1 file changed, 8 insertions(+), 4 deletion

[net v5 10/12] ch_ktls/cxgb4: handle partial tag alone SKBs

2020-11-09 Thread Rohit Maheshwari
iddle part of record") Signed-off-by: Rohit Maheshwari --- .../ethernet/chelsio/cxgb4/cxgb4_debugfs.c| 2 + .../net/ethernet/chelsio/cxgb4/cxgb4_uld.h| 1 + .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 116 +- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.h | 1

[net v5 12/12] ch_ktls: stop the txq if reaches threshold

2020-11-09 Thread Rohit Maheshwari
Stop the queue and ask for the credits if queue reaches to threashold. Fixes: 5a4b9fe7fece ("cxgb4/chcr: complete record tx handling") Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 18 +++--- 1 file changed, 15 insertions(+), 3

[net v5 08/12] ch_ktls: packet handling prior to start marker

2020-11-09 Thread Rohit Maheshwari
dling") Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 38 --- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c b/drivers/net/ethernet/chelsio/inline_cryp

[net v5 09/12] ch_ktls: don't free skb before sending FIN

2020-11-09 Thread Rohit Maheshwari
If its a last packet and fin is set. Make sure FIN is informed to HW before skb gets freed. Fixes: 429765a149f1 ("chcr: handle partial end part of a record") Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c| 12 ++-- 1 file changed, 10

[net v5 02/12] ch_ktls: Correction in finding correct length

2020-11-09 Thread Rohit Maheshwari
There is a possibility of linear skbs coming in. Correcting the length extraction logic. v2->v3: - Separated un-related changes from this patch. Fixes: 5a4b9fe7fece ("cxgb4/chcr: complete record tx handling") Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktl

[net v5 00/12] cxgb4/ch_ktls: Fixes in nic tls code

2020-11-09 Thread Rohit Maheshwari
;v3: - Replaced GFP_KERNEL with GFP_ATOMIC. - Removed mixed fixes. v3->v4: - Corrected fixes tag issue. v4->v5: - Separated mixed fixes from patch 4. Rohit Maheshwari (12): cxgb4/ch_ktls: decrypted bit is not enough ch_ktls: Correction in finding correct length ch_ktls: Update che

[net v5 05/12] ch_ktls: Correction in trimmed_len calculation

2020-11-09 Thread Rohit Maheshwari
trimmed length calculation goes wrong if skb has only tag part to send. It should be zero if there is no data bytes apart from TAG. Fixes: dc05f3df8fac ("chcr: Handle first or middle part of record") Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c

[net v5 07/12] ch_ktls: Correction in middle record handling

2020-11-09 Thread Rohit Maheshwari
time, that's why we need to check if remaining part is smaller than TAG size, then reset TX_MAX to be TAG starting sequence number. Fixes: 5a4b9fe7fece ("cxgb4/chcr: complete record tx handling") Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktls/c

[net v5 06/12] ch_ktls: missing handling of header alone

2020-11-09 Thread Rohit Maheshwari
If an skb has only header part which doesn't start from beginning, is not being handled properly. Fixes: dc05f3df8fac ("chcr: Handle first or middle part of record") Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 25 --- 1 f

[net v5 04/12] cxgb4/ch_ktls: creating skbs causes panic

2020-11-09 Thread Rohit Maheshwari
ecord") v4->v5: - Removed extra changes. Signed-off-by: Rohit Maheshwari --- drivers/net/ethernet/chelsio/cxgb4/cxgb4.h| 3 + drivers/net/ethernet/chelsio/cxgb4/sge.c | 108 +++ .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 284 +++--- 3 files changed, 226 inser

[net v5 03/12] ch_ktls: Update cheksum information

2020-11-09 Thread Rohit Maheshwari
Checksum update was missing in the WR. Fixes: 429765a149f1 ("chcr: handle partial end part of a record") Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/d

[net v5 01/12] cxgb4/ch_ktls: decrypted bit is not enough

2020-11-09 Thread Rohit Maheshwari
ve it for tls offload handling. v2->v3: - Removed ifdef. Fixes: 5a4b9fe7fece ("cxgb4/chcr: complete record tx handling") Signed-off-by: Rohit Maheshwari --- drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 1 + drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h

Re: [net v4 07/10] ch_ktls: packet handling prior to start marker

2020-11-04 Thread rohit maheshwari
On 04/11/20 2:21 AM, Jakub Kicinski wrote: On Fri, 30 Oct 2020 23:32:22 +0530 Rohit Maheshwari wrote: There could be a case where ACK for tls exchanges prior to start marker is missed out, and by the time tls is offloaded. This pkt should not be discarded and handled carefully. It could be

Re: [net v4 05/10] cxgb4/ch_ktls: creating skbs causes panic

2020-11-04 Thread rohit maheshwari
On 04/11/20 2:16 AM, Jakub Kicinski wrote: On Fri, 30 Oct 2020 23:32:20 +0530 Rohit Maheshwari wrote: Creating SKB per tls record and freeing the original one causes panic. There will be race if connection reset is requested. By freeing original skb, refcnt will be decremented and that means

[net v4 07/10] ch_ktls: packet handling prior to start marker

2020-10-30 Thread Rohit Maheshwari
dling") Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 36 +++ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c b/drivers/net/ethernet/chelsio/inline_cryp

[net v4 06/10] ch_ktls: Correction in middle record handling

2020-10-30 Thread Rohit Maheshwari
If a record starts in middle, reset TCB UNA so that we could avoid sending out extra packet which is needed to make it 16 byte aligned to start AES CTR. Fixes: 5a4b9fe7fece ("cxgb4/chcr: complete record tx handling") Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_cryp

[net v4 09/10] ch_ktls: tcb update fails sometimes

2020-10-30 Thread Rohit Maheshwari
context id and port id should be filled while sending tcb update. Fixes: 5a4b9fe7fece ("cxgb4/chcr: complete record tx handling") Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c| 12 1 file changed, 8 insertions(+), 4 deletion

[net v4 08/10] ch_ktls/cxgb4: handle partial tag alone SKBs

2020-10-30 Thread Rohit Maheshwari
iddle part of record") Signed-off-by: Rohit Maheshwari --- .../ethernet/chelsio/cxgb4/cxgb4_debugfs.c| 2 + .../net/ethernet/chelsio/cxgb4/cxgb4_uld.h| 1 + .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 115 +- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.h | 1

[net v4 10/10] ch_ktls: stop the txq if reaches threshold

2020-10-30 Thread Rohit Maheshwari
Stop the queue and ask for the credits if queue reaches to threashold. Fixes: 5a4b9fe7fece ("cxgb4/chcr: complete record tx handling") Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 19 +++ 1 file changed, 15 insertions(+), 4

[net v4 04/10] ch_ktls: incorrect use of GFP_KERNEL

2020-10-30 Thread Rohit Maheshwari
Use of GFP_KERNEL under lock is not correct. Replacing it with GFP_ATOMIC. Signed-off-by: Rohit Maheshwari --- drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls

[net v4 05/10] cxgb4/ch_ktls: creating skbs causes panic

2020-10-30 Thread Rohit Maheshwari
ecord") Signed-off-by: Rohit Maheshwari --- drivers/net/ethernet/chelsio/cxgb4/cxgb4.h| 3 + drivers/net/ethernet/chelsio/cxgb4/sge.c | 108 .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 545 +++--- 3 files changed, 328 insertions(+), 328 deletions(-) diff --git

[net v4 03/10] ch_ktls: Update cheksum information

2020-10-30 Thread Rohit Maheshwari
Checksum update was missing in the WR. Fixes: 429765a149f1 ("chcr: handle partial end part of a record") Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 21 --- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/d

[net v4 01/10] cxgb4/ch_ktls: decrypted bit is not enough

2020-10-30 Thread Rohit Maheshwari
ve it for tls offload handling. v2->v3: - Removed ifdef. Fixes: 5a4b9fe7fece ("cxgb4/chcr: complete record tx handling") Signed-off-by: Rohit Maheshwari --- drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 1 + drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h

[net v4 02/10] ch_ktls: Correction in finding correct length

2020-10-30 Thread Rohit Maheshwari
There is a possibility of linear skbs coming in. Correcting the length extraction logic. v2->v3: - Separated un-related changes from this patch. Fixes: 5a4b9fe7fece ("cxgb4/chcr: complete record tx handling") Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktl

[net v4 00/10] cxgb4/ch_ktls: Fixes in nic tls code

2020-10-30 Thread Rohit Maheshwari
ches threshold value. v1->v2: - Corrected fixes tag issue. - Marked chcr_ktls_sw_fallback() static. v2->v3: - Replaced GFP_KERNEL with GFP_ATOMIC. - Removed mixed fixes. v3->v4: - Corrected fixes tag issue. Rohit Maheshwari (10): cxgb4/ch_ktls: decrypted bit is not enough ch_ktls:

[net v3 01/10] cxgb4/ch_ktls: decrypted bit is not enough

2020-10-30 Thread Rohit Maheshwari
ve it for tls offload handling. v2->v3: - Removed ifdef. Fixes: 5a4b9fe7fece ("cxgb4/chcr: complete record tx handling") Signed-off-by: Rohit Maheshwari --- drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 1 + drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h

[net v3 10/10] ch_ktls: stop the txq if reaches threshold

2020-10-30 Thread Rohit Maheshwari
Stop the queue and ask for the credits if queue reaches to threashold. Fixes: 5a4b9fe7fece ("cxgb4/chcr: complete record tx handling") Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 19 +++ 1 file changed, 15 insertions(+), 4

[net v3 09/10] ch_ktls: tcb update fails sometimes

2020-10-30 Thread Rohit Maheshwari
context id and port id should be filled while sending tcb update. Fixes: 5a4b9fe7fece ("cxgb4/chcr: complete record tx handling") Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c| 12 1 file changed, 8 insertions(+), 4 deletion

[net v3 07/10] ch_ktls: packet handling prior to start marker

2020-10-30 Thread Rohit Maheshwari
dling") Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 36 +++ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c b/drivers/net/ethernet/chelsio/inline_cryp

[net v3 05/10] cxgb4/ch_ktls: creating skbs causes panic

2020-10-30 Thread Rohit Maheshwari
ecord") Signed-off-by: Rohit Maheshwari --- drivers/net/ethernet/chelsio/cxgb4/cxgb4.h| 3 + drivers/net/ethernet/chelsio/cxgb4/sge.c | 108 .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 545 +++--- 3 files changed, 328 insertions(+), 328 deletions(-) diff --git

[net v3 06/10] ch_ktls: Correction in middle record handling

2020-10-30 Thread Rohit Maheshwari
If a record starts in middle, reset TCB UNA so that we could avoid sending out extra packet which is needed to make it 16 byte aligned to start AES CTR. Fixes: 5a4b9fe7fece ("cxgb4/chcr: complete record tx handling") Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_cryp

[net v3 08/10] ch_ktls/cxgb4: handle partial tag alone SKBs

2020-10-30 Thread Rohit Maheshwari
iddle part of record") Signed-off-by: Rohit Maheshwari --- .../ethernet/chelsio/cxgb4/cxgb4_debugfs.c| 2 + .../net/ethernet/chelsio/cxgb4/cxgb4_uld.h| 1 + .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 115 +- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.h | 1

[net v3 00/10] cxgb4/ch_ktls: Fixes in nic tls code

2020-10-30 Thread Rohit Maheshwari
ches threshold value. v1->v2: - Corrected fixes tag issue. - Marked chcr_ktls_sw_fallback() static. v2->v3: - Replaced GFP_KERNEL with GFP_ATOMIC. - Removed mixed fixes. Rohit Maheshwari (10): cxgb4/ch_ktls: decrypted bit is not enough ch_ktls: Correction in finding correct length

[net v3 02/10] ch_ktls: Correction in finding correct length

2020-10-30 Thread Rohit Maheshwari
There is a possibility of linear skbs coming in. Correcting the length extraction logic. v2->v3: - Separated un-related changes from this patch. Fixes: 5a4b9fe7fece ("cxgb4/chcr: complete record tx handling") Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktl

[net v3 04/10] ch_ktls: incorrect use of GFP_KERNEL

2020-10-30 Thread Rohit Maheshwari
Use of GFP_KERNEL under lock is not correct. Replacing it with GFP_ATOMIC. Signed-off-by: Rohit Maheshwari --- drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls

[net v3 03/10] ch_ktls: Update cheksum information

2020-10-30 Thread Rohit Maheshwari
Checksum update was missing in the WR. Fixes: 429765a149f1 ("chcr: handle partial end part of a record") Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 21 --- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/d

[net v3 01/10] cxgb4/ch_ktls: decrypted bit is not enough

2020-10-30 Thread Rohit Maheshwari
ve it for tls offload handling. v2->v3: - Removed ifdef. Fixes: 5a4b9fe7fece ("cxgb4/chcr: complete record tx handling" Signed-off-by: Rohit Maheshwari --- drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 1 + drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h

[net v2 7/7] ch_ktls: tcb update fails sometimes

2020-10-22 Thread Rohit Maheshwari
context id and port id should be filled while sending tcb update. Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c| 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls

[net v2 0/7] cxgb4/ch_ktls: Fixes in nic tls code

2020-10-22 Thread Rohit Maheshwari
has partial TAG bytes only. HW can't handle those, hence using sw crypto for such pkts. Patch 7 corrects the potential tcb update problem. v1->v2: - Corrected fixes tag issue. - Marked chcr_ktls_sw_fallback() static. Rohit Maheshwari (7): cxgb4/ch_ktls: decrypted bit is not enough ch_ktls

[net v2 2/7] ch_ktls: Correction in finding correct length

2020-10-22 Thread Rohit Maheshwari
There is a possibility of linear skbs coming in. Correcting the length extraction logic. Fixes: 5a4b9fe7fece ("cxgb4/chcr: complete record tx handling") Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 62 +++ 1 file changed, 37

[net v2 5/7] ch_ktls: packet handling prior to start marker

2020-10-22 Thread Rohit Maheshwari
There could be a case where ACK for tls exchanges prior to start marker is missed out, and by the time tls is offloaded. This pkt should not be discarded and handled carefully. It could be plaintext alone or plaintext + finish as well. Signed-off-by: Rohit Maheshwari --- .../chelsio

[net v2 6/7] ch_ktls/cxgb4: handle partial tag alone SKBs

2020-10-22 Thread Rohit Maheshwari
If TCP congestion caused a very small packets which only has some part fo the TAG, and that too is not till the end. HW can't handle such case, so falling back to sw crypto in such cases. v1->v2: - Marked chcr_ktls_sw_fallback() static. Signed-off-by: Rohit Maheshwari --- .../ethernet

[net v2 4/7] ch_ktls: Correction in middle record handling

2020-10-22 Thread Rohit Maheshwari
If a record starts in middle, reset TCB UNA so that we could avoid sending out extra packet which is needed to make it 16 byte aligned to start AES CTR. Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 21 +-- 1 file changed, 15 insertions

[net v2 3/7] cxgb4/ch_ktls: creating skbs causes panic

2020-10-22 Thread Rohit Maheshwari
ecord") Signed-off-by: Rohit Maheshwari --- drivers/net/ethernet/chelsio/cxgb4/cxgb4.h| 3 + drivers/net/ethernet/chelsio/cxgb4/sge.c | 108 .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 543 +++--- 3 files changed, 327 insertions(+), 327 deletions(-) diff --git

[net v2 1/7] cxgb4/ch_ktls: decrypted bit is not enough

2020-10-22 Thread Rohit Maheshwari
ve it for tls offload handling. Fixes: 5a4b9fe7fece ("cxgb4/chcr: complete record tx handling") Signed-off-by: Rohit Maheshwari --- drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c| 3 +++ drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h | 7 +++ drivers/net/e

[net 7/7] ch_ktls: tcb update fails sometimes

2020-10-22 Thread Rohit Maheshwari
context id and port id should be filled while sending tcb update. Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c| 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls

[net 6/7] ch_ktls/cxgb4: handle partial tag alone SKBs

2020-10-22 Thread Rohit Maheshwari
If TCP congestion caused a very small packets which only has some part fo the TAG, and that too is not till the end. HW can't handle such case, so falling back to sw crypto in such cases. Signed-off-by: Rohit Maheshwari --- .../ethernet/chelsio/cxgb4/cxgb4_debugfs.c| 2 + .../net/eth

[net 5/7] ch_ktls: packet handling prior to start marker

2020-10-22 Thread Rohit Maheshwari
There could be a case where ACK for tls exchanges prior to start marker is missed out, and by the time tls is offloaded. This pkt should not be discarded and handled carefully. It could be plaintext alone or plaintext + finish as well. Signed-off-by: Rohit Maheshwari --- .../chelsio

[net 4/7] ch_ktls: Correction in middle record handling

2020-10-22 Thread Rohit Maheshwari
If a record starts in middle, reset TCB UNA so that we could avoid sending out extra packet which is needed to make it 16 byte aligned to start AES CTR. Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 21 +-- 1 file changed, 15 insertions

[net 2/7] ch_ktls: Correction in finding correct length

2020-10-22 Thread Rohit Maheshwari
There is a possibility of linear skbs coming in. Correcting the length extraction logic. Fixes: 5a4b9fe7fece ("cxgb4/chcr: complete record tx handling") Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 62 +++ 1 file changed, 37

[net 3/7] cxgb4/ch_ktls: creating skbs causes panic

2020-10-22 Thread Rohit Maheshwari
ecord" Signed-off-by: Rohit Maheshwari --- drivers/net/ethernet/chelsio/cxgb4/cxgb4.h| 3 + drivers/net/ethernet/chelsio/cxgb4/sge.c | 108 .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 543 +++--- 3 files changed, 327 insertions(+), 327 deletions(-) diff --git a/d

[net 0/7] cxgb4/ch_ktls: Fixes in nic tls code

2020-10-22 Thread Rohit Maheshwari
has partial TAG bytes only. HW can't handle those, hence using sw crypto for such pkts. Patch 7 corrects the potential tcb update problem. Rohit Maheshwari (7): cxgb4/ch_ktls: decrypted bit is not enough ch_ktls: Correction in finding correct length cxgb4/ch_ktls: creating skbs ca

[net 1/7] cxgb4/ch_ktls: decrypted bit is not enough

2020-10-22 Thread Rohit Maheshwari
ve it for tls offload handling. Fixes: 5a4b9fe7fece ("cxgb4/chcr: complete record tx handling") Signed-off-by: Rohit Maheshwari --- drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c| 3 +++ drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h | 7 +++ drivers/net/e

[PATCH net v3] net/tls: sendfile fails with ktls offload

2020-10-07 Thread Rohit Maheshwari
sed on more bit. Fixes: d829e9c4112b ("tls: convert to generic sk_msg interface") Signed-off-by: Rohit Maheshwari --- net/tls/tls_device.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c index b74e2741f74f..cec86229

[PATCH net v2] net/tls: sendfile fails with ktls offload

2020-10-05 Thread Rohit Maheshwari
sed on more bit. Also incase if tls_do_allocation() fails, and if record len is only prepend_size, then destroy the record. v1->v2: - handle tls_do_allocation() failure handling. Signed-off-by: Rohit Maheshwari --- net/tls/tls_device.c | 27 +-- 1 file changed, 13 insertion

[net-next v3 3/3] cxgb4/ch_ktls: ktls stats are added at port level

2020-09-29 Thread Rohit Maheshwari
All the ktls stats were at adapter level, but now changing it to port level. Fixes: 62370a4f346d ("cxgb4/chcr: Add ipv6 support and statistics") Signed-off-by: Rohit Maheshwari --- .../ethernet/chelsio/cxgb4/cxgb4_debugfs.c| 35 ++--- .../ethernet/chelsio/cxgb4/cxgb4

[net-next v3 1/3] ch_ktls: Issue if connection offload fails

2020-09-29 Thread Rohit Maheshwari
Fixes: 34aba2c45024 ("cxgb4/chcr : Register to tls add and del callback") Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 283 +- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.h | 17 +- 2 files changed, 153 insertions(+), 147 deletions(

[net-next v3 2/3] cxgb4: Avoid log flood

2020-09-29 Thread Rohit Maheshwari
Changing these logs to dynamic debugs. If issue is seen, these logs can be enabled at run time. Signed-off-by: Rohit Maheshwari --- drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/chelsio/cxgb4

[net-next v3 0/3] cxgb4/ch_ktls: updates in net-next

2020-09-29 Thread Rohit Maheshwari
ktls statistics at port level. v1->v2: - removed conn_up from all places. v2->v3: - Corrected timeout handling. Rohit Maheshwari (3): ch_ktls: Issue if connection offload fails cxgb4: Avoid log flood cxgb4/ch_ktls: ktls stats are added at port level .../ethernet/chelsio/cxgb4/cxgb

Re: Re: [PATCH net] net/tls: sendfile fails with ktls offload

2020-09-26 Thread rohit maheshwari
> -Original Message- > From: Jakub Kicinski > Sent: Friday, September 25, 2020 3:27 AM > To: Rohit Maheshwari > Cc: netdev@vger.kernel.org; da...@davemloft.net; vakul.g...@nxp.com; secdev > Subject: Re: [PATCH net] net/tls: sendfile fails with ktls offload >

Re: FW: [PATCH net] net/tls: sendfile fails with ktls offload

2020-09-25 Thread rohit maheshwari
-Original Message- From: Jakub Kicinski Sent: Friday, September 25, 2020 3:27 AM To: Rohit Maheshwari Cc: netdev@vger.kernel.org; da...@davemloft.net; vakul.g...@nxp.com; secdev Subject: Re: [PATCH net] net/tls: sendfile fails with ktls offload On Thu, 24 Sep 2020 13:20:25 +0530

[PATCH net] net/tls: sendfile fails with ktls offload

2020-09-24 Thread Rohit Maheshwari
sed on more bit. Fixes: d829e9c4112b ("tls: convert to generic sk_msg interface") Signed-off-by: Rohit Maheshwari --- net/tls/tls_device.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c index b74e2741f74f..a02aadef

[PATCH] net/tls: race causes kernel panic

2020-09-23 Thread Rohit Maheshwari
t for async encryption of records for performance") Signed-off-by: Rohit Maheshwari --- net/tls/tls_sw.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c index 9a3d9fedd7aa..95ab5545a931 100644 --- a/net/tls/tls_sw.c +++ b/net/tls/tls_

[net-next v2 3/3] cxgb4/ch_ktls: ktls stats are added at port level

2020-09-23 Thread Rohit Maheshwari
All the ktls stats were at adapter level, but now changing it to port level. Fixes: 62370a4f346d ("cxgb4/chcr: Add ipv6 support and statistics") Signed-off-by: Rohit Maheshwari --- .../ethernet/chelsio/cxgb4/cxgb4_debugfs.c| 35 ++--- .../ethernet/chelsio/cxgb4/cxgb4

[net-next v2 2/3] cxgb4: Avoid log flood

2020-09-23 Thread Rohit Maheshwari
Changing these logs to dynamic debugs. If issue is seen, these logs can be enabled at run time. Signed-off-by: Rohit Maheshwari --- drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/chelsio/cxgb4

[net-next v2 1/3] ch_ktls: Issue if connection offload fails

2020-09-23 Thread Rohit Maheshwari
r to tls add and del callback") Signed-off-by: Rohit Maheshwari --- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 251 -- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.h | 13 +- 2 files changed, 112 insertions(+), 152 deletions(-) diff --git a/drivers/net/ethernet/chelsio/

[net-next v2 0/3] cxgb4/ch_ktls: updates in net-next

2020-09-23 Thread Rohit Maheshwari
ktls statistics at port level. v1->v2: - removed conn_up from all places. Rohit Maheshwari (3): ch_ktls: Issue if connection offload fails cxgb4: Avoid log flood cxgb4/ch_ktls: ktls stats are added at port level .../ethernet/chelsio/cxgb4/cxgb4_debugfs.c| 35 +-- .../ethernet/chels

Re: [net-next 1/3] ch_ktls: Issue if connection offload fails

2020-09-23 Thread rohit maheshwari
On 23/09/20 4:14 AM, Jakub Kicinski wrote: On Tue, 22 Sep 2020 23:14:59 +0530 Rohit Maheshwari wrote: Since driver first return success to tls_dev_add, if req to HW is successful, but later if HW returns failure, that connection traffic fails permanently and connection status remains unknown

[net-next 1/3] ch_ktls: Issue if connection offload fails

2020-09-22 Thread Rohit Maheshwari
Since driver first return success to tls_dev_add, if req to HW is successful, but later if HW returns failure, that connection traffic fails permanently and connection status remains unknown to stack. Fixes: 34aba2c45024 ("cxgb4/chcr : Register to tls add and del callback") Signed-off

[net-next 2/3] cxgb4: Avoid log flood

2020-09-22 Thread Rohit Maheshwari
Changing these logs to dynamic debugs. If issue is seen, these logs can be enabled at run time. Signed-off-by: Rohit Maheshwari --- drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/chelsio/cxgb4

[net-next 3/3] cxgb4/ch_ktls: ktls stats are added at port level

2020-09-22 Thread Rohit Maheshwari
All the ktls stats were at adapter level, but now changing it to port level. Fixes: 62370a4f346d ("cxgb4/chcr: Add ipv6 support and statistics") Signed-off-by: Rohit Maheshwari --- .../ethernet/chelsio/cxgb4/cxgb4_debugfs.c| 35 ++--- .../ethernet/chelsio/cxgb4/cxgb4

[net-next 0/3] cxgb4/ch_ktls: updates in net-next

2020-09-22 Thread Rohit Maheshwari
ktls statistics at port level. Rohit Maheshwari (3): ch_ktls: Issue if connection offload fails cxgb4: Avoid log flood cxgb4/ch_ktls: ktls stats are added at port level .../ethernet/chelsio/cxgb4/cxgb4_debugfs.c| 35 +-- .../ethernet/chelsio/cxgb4/cxgb4_ethtool.c| 50 +++- .../net/eth

[net-next] crypto/chcr: move nic TLS functionality to drivers/net

2020-09-10 Thread Rohit Maheshwari
This patch moves complete nic tls offload (kTLS) code from crypto directory to drivers/net/ethernet/chelsio/inline_crypto/ch_ktls directory. nic TLS is made a separate ULD of cxgb4. Signed-off-by: Rohit Maheshwari --- drivers/crypto/chelsio/Kconfig| 11 -- drivers/crypto

[PATCH net] crypto/chcr: error seen if CONFIG_CHELSIO_TLS_DEVICE isn't set

2020-06-02 Thread Rohit Maheshwari
cxgb4_uld_in_use() is used only by cxgb4_ktls_det_feature() which is under CONFIG_CHELSIO_TLS_DEVICE macro. Fixes: a3ac249a1ab5 ("cxgb4/chcr: Enable ktls settings at run time") Signed-off-by: Rohit Maheshwari --- drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c | 2 +- 1 file changed, 1

[PATCH net] crypto/chcr: error seen if CONFIG_CHELSIO_TLS_DEVICE isn't set

2020-06-01 Thread Rohit Maheshwari
cxgb4_uld_in_use() is used only by cxgb4_ktls_det_feature() which is under CONFIG_CHELSIO_TLS_DEVICE macro. Signed-off-by: Rohit Maheshwari --- drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/chelsio/cxgb4

[PATCH net] crypto/chcr: IPV6 code needs to be in CONFIG_IPV6

2020-06-01 Thread Rohit Maheshwari
Error messages seen while building kernel with CONFIG_IPV6 disabled. Signed-off-by: Rohit Maheshwari --- drivers/crypto/chelsio/chcr_ktls.c | 48 -- 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/drivers/crypto/chelsio/chcr_ktls.c b/drivers/crypto

[PATCH net v4] cxgb4/chcr: Enable ktls settings at run time

2020-06-01 Thread Rohit Maheshwari
is now registering to tlsdev_ops. - module refcount inc/dec in chcr. - refcount is only for connections. - removed new code from cxgb_set_feature(). v3->v4: - fixed warning message. Signed-off-by: Rohit Maheshwari --- drivers/crypto/chelsio/chcr_core.c| 23 +++-- drivers/crypt

[PATCH net v3] cxgb4/chcr: Enable ktls settings at run time

2020-05-31 Thread Rohit Maheshwari
is now registering to tlsdev_ops. - module refcount inc/dec in chcr. - refcount is only for connections. - removed new code from cxgb_set_feature(). Signed-off-by: Rohit Maheshwari --- drivers/crypto/chelsio/chcr_core.c| 23 +++-- drivers/crypto/chelsio/chcr_core.h

  1   2   >