[PATCH net-next] strparser: Add __strp_unpause and use it in ktls.

2018-06-06 Thread Doron Roberts-Kedes
overhead that results when a receiving thread unpauses the strparser and waits for the next message to be delivered by the workqueue thread. This patch more than doubled the IOPS achieved in a benchmark of NBD traffic encrypted using ktls. Signed-off-by: Doron Roberts-Kedes --- include/net

[PATCH net] strparser: Remove early eaten to fix full tcp receive buffer stall

2018-06-26 Thread Doron Roberts-Kedes
the TCP window to go to zero, so the remainder of the message will never arrive. Incrementing the value returned by __strp_recv by the amount otherwise stored in early_eaten prevents stalls of this nature. Signed-off-by: Doron Roberts-Kedes --- net/strparser/strparser.c | 17 + 1

[PATCH net] tls: fix skb_to_sgvec returning unhandled error.

2018-07-02 Thread Doron Roberts-Kedes
t;tls: RX path for ktls") Acked-by: Dave Watson Signed-off-by: Doron Roberts-Kedes --- net/tls/tls_sw.c | 5 + 1 file changed, 5 insertions(+) diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c index 173d8b89072d..b6e118499083 100644 --- a/net/tls/tls_sw.c +++ b/net/tls/tls_sw.c @@ -701

[PATCH net-next] net/tls: Calculate nsg for zerocopy path without skb_cow_data.

2018-08-02 Thread Doron Roberts-Kedes
to map the skb without the extra overhead of skb_cow_data. This function mimics the structure of skb_to_sgvec. Fixes: c46234ebb4d1 ("tls: RX path for ktls") Signed-off-by: Doron Roberts-Kedes --- net/tls/tls_sw.c | 89 ++-- 1 file changed, 86

Re: [PATCH net-next] net/tls: Always get number of sg entries for skb to be decrypted

2018-08-02 Thread Doron Roberts-Kedes
On Thu, Aug 02, 2018 at 09:50:58AM -0700, Dave Watson wrote: > On 08/02/18 09:50 PM, Vakul Garg wrote: > > Function decrypt_skb() made a bad assumption that number of sg entries > > required for mapping skb to be decrypted would always be less than > > MAX_SKB_FRAGS. The required count of sg

[PATCH net-next v2] tls: Skip zerocopy path for ITER_KVEC

2018-07-25 Thread Doron Roberts-Kedes
for a discussion of why zerocopy for vmalloc data is not a good idea. Discovered while testing NBD traffic encrypted with ktls. Fixes: c46234ebb4d1 ("tls: RX path for ktls") Signed-off-by: Doron Roberts-Kedes --- net/tls/tls_sw.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-)

Re: [PATCH net-next] net/tls: Calculate nsg for zerocopy path without skb_cow_data.

2018-08-03 Thread Doron Roberts-Kedes
On Fri, Aug 03, 2018 at 01:23:33AM +, Vakul Garg wrote: > > > > -Original Message- > > From: Doron Roberts-Kedes [mailto:doro...@fb.com] > > Sent: Friday, August 3, 2018 6:00 AM > > To: David S . Miller > > Cc: Dave Watson ; Vakul Garg >

[PATCH net-next v2 1/2] tls: Remove dead code in tls_sw_sendmsg

2018-07-26 Thread Doron Roberts-Kedes
tls_push_record either returns 0 on success or a negative value on failure. This patch removes code that would only be executed if tls_push_record were to return a positive value. Signed-off-by: Doron Roberts-Kedes --- net/tls/tls_sw.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions

[PATCH net-next v2 2/2] tls: Fix improper revert in zerocopy_from_iter

2018-07-26 Thread Doron Roberts-Kedes
the amount by which the iter was actually advanced. Instead, only revert by the amount that the iter was advanced. Fixes: 4718799817c5 ("tls: Fix zerocopy_from_iter iov handling") Signed-off-by: Doron Roberts-Kedes --- net/tls/tls_sw.c | 12 +--- 1 file changed, 5 insertions(+), 7

[PATCH net-next v2 0/2] tls: Fix improper revert in zerocopy_from_iter

2018-07-26 Thread Doron Roberts-Kedes
This series fixes the improper iov_iter_revert introcded in "tls: Fix zerocopy_from_iter iov handling". Changes from v1: - call iov_iter_revert inside zerocopy_from_iter Doron Roberts-Kedes (2): tls: Remove dead code in tls_sw_sendmsg tls: Fix improper revert in zerocopy_from_

[PATCH net-next,v3] net/tls: Calculate nsg for zerocopy path without skb_cow_data.

2018-08-06 Thread Doron Roberts-Kedes
to map the skb without the extra overhead of skb_cow_data. This function mimics the structure of skb_to_sgvec. Fixes: c46234ebb4d1 ("tls: RX path for ktls") Signed-off-by: Doron Roberts-Kedes --- net/tls/tls_sw.c | 96 ++-- 1 file changed, 93

Re: [PATCH net-next,v3] net/tls: Calculate nsg for zerocopy path without skb_cow_data.

2018-08-07 Thread Doron Roberts-Kedes
On Tue, Aug 07, 2018 at 04:10:50PM +, Vakul Garg wrote: > > > > -Original Message- > > From: Doron Roberts-Kedes [mailto:doro...@fb.com] > > Sent: Tuesday, August 7, 2018 1:18 AM > > To: David S . Miller > > Cc: Vakul Garg ; Dave Watson >

[PATCH net-next,v4] net/tls: Calculate nsg for zerocopy path without skb_cow_data.

2018-08-07 Thread Doron Roberts-Kedes
the extra overhead of skb_cow_data. This function mimics the structure of skb_to_sgvec. Reported-by: Vakul Garg Reviewed-by: Vakul Garg Tested-by: Vakul Garg Fixes: c46234ebb4d1 ("tls: RX path for ktls") Signed-off-by: Doron Roberts-Kedes --- net/tls/tls

Re: [PATCH net-next,v4] net/tls: Calculate nsg for zerocopy path without skb_cow_data.

2018-08-09 Thread Doron Roberts-Kedes
On Wed, Aug 08, 2018 at 12:14:30PM -0700, David Miller wrote: > From: Doron Roberts-Kedes > Date: Tue, 7 Aug 2018 11:09:39 -0700 > > > +static int __skb_nsg(struct sk_buff *skb, int offset, int len, > > +unsigned int recursion_level) > > +{ > >

[PATCH net-next,v2] net/tls: Calculate nsg for zerocopy path without skb_cow_data.

2018-08-06 Thread Doron Roberts-Kedes
to map the skb without the extra overhead of skb_cow_data. This function mimics the structure of skb_to_sgvec. Fixes: c46234ebb4d1 ("tls: RX path for ktls") Signed-off-by: Doron Roberts-Kedes --- net/tls/tls_sw.c | 93 ++-- 1 file changed, 90

Re: [PATCH net-next] net/tls: Calculate nsg for zerocopy path without skb_cow_data.

2018-08-06 Thread Doron Roberts-Kedes
On Fri, Aug 03, 2018 at 11:49:02AM -0700, Doron Roberts-Kedes wrote: > On Fri, Aug 03, 2018 at 01:23:33AM +, Vakul Garg wrote: > > > > > > > -Original Message- > > > From: Doron Roberts-Kedes [mailto:doro...@fb.com] > > > Sent: Friday

Re: [PATCH net-next,v4] net/tls: Calculate nsg for zerocopy path without skb_cow_data.

2018-08-20 Thread Doron Roberts-Kedes
On Sat, Aug 11, 2018 at 11:54:53AM -0700, David Miller wrote: > From: Doron Roberts-Kedes > Date: Thu, 9 Aug 2018 15:43:44 -0700 > > The reason is that we usually never need to "map" an SKB on receive, > and on transmit the SKB geometry is normalized by the destinatio

[PATCH net-next,v5] net/tls: Calculate nsg for zerocopy path without skb_cow_data.

2018-08-28 Thread Doron Roberts-Kedes
the extra overhead of skb_cow_data. This patch reduces memcpy by 50% on my encrypted NBD benchmarks. Reported-by: Vakul Garg Reviewed-by: Vakul Garg Tested-by: Vakul Garg Signed-off-by: Doron Roberts-Kedes --- net/tls/tls_sw.c | 80 +++- 1 file

[PATCH net] tls: check RCV_SHUTDOWN in tls_wait_data

2018-07-18 Thread Doron Roberts-Kedes
hecking sk->sk_shutdown & RCV_SHUTDOWN, as in tcp_recvmsg, fixes this problem. Fixes: c46234ebb4d1 ("tls: RX path for ktls") Acked-by: Dave Watson Signed-off-by: Doron Roberts-Kedes --- net/tls/tls_sw.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/tls/tls_sw

[PATCH net-next] tls: Skip zerocopy path for ITER_KVEC

2018-07-20 Thread Doron Roberts-Kedes
for a discussion of why zerocopy for vmalloc data is not a good idea. Discovered while testing NBD traffic encrypted with ktls. Fixes: c46234ebb4d1 ("tls: RX path for ktls") Signed-off-by: Doron Roberts-Kedes --- net/tls/tls_sw.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-)

[PATCH net-next] tls: Fix improper revert in zerocopy_from_iter

2018-07-23 Thread Doron Roberts-Kedes
the amount by which the iter was actually advanced. Instead, mimic the tx path which reverts by the difference before and after zerocopy_from_iter. Fixes: 4718799817c5 ("tls: Fix zerocopy_from_iter iov handling") Signed-off-by: Doron Roberts-Kedes --- net/tls/tls_sw.c | 13 +++

Re: [PATCH net-next] tls: Fix improper revert in zerocopy_from_iter

2018-07-24 Thread Doron Roberts-Kedes
On Tue, Jul 24, 2018 at 05:13:26AM +, Vakul Garg wrote: > > > -Original Message- > > From: Doron Roberts-Kedes [mailto:doro...@fb.com] > > Sent: Tuesday, July 24, 2018 3:50 AM > > @@ -811,6 +809,7 @@ int tls_sw_recvmsg(struct sock *sk, > >

[PATCH net] strparser: Fix incorrect strp->need_bytes value.

2018-04-11 Thread Doron Roberts-Kedes
en there is sufficient data to complete the partial message. Incrementing stm->accum_len before using it to calculate strp->need_bytes solves this problem. Found while testing net/tls_sw recv path. Fixes: 43a0c6751a322847 ("strparser: Stream parser for messages") Signed-off-by: Do

[PATCH net] strparser: Do not call mod_delayed_work with a timeout of LONG_MAX

2018-04-20 Thread Doron Roberts-Kedes
r for messages") Reviewed-by: Tejun Heo <t...@kernel.org> Signed-off-by: Doron Roberts-Kedes <doro...@fb.com> --- net/strparser/strparser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/strparser/strparser.c b/net/strparser/strparser.c index 805b139..092