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

2018-08-20 Thread David Miller
From: Doron Roberts-Kedes Date: Mon, 20 Aug 2018 17:27:23 -0700 > Given that frag_lists are not unlikely in this case, I believe the only > remaining feedback on the original patch was the recursive > implementation. If you'd like, I can re-submit with an iterative > implementation, but I noticed

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 destination > device features which mea

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

2018-08-11 Thread David Miller
From: Doron Roberts-Kedes Date: Thu, 9 Aug 2018 15:43:44 -0700 > Taking a step back, is there an existing solution for what this function > is trying to do? I was surprised to find that there did not seem to > exist a function for determining the number of scatterlist elements > required to map a

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) > > +{ > > + int start = skb_headlen(skb); >

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

2018-08-08 Thread David Miller
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) > +{ > + int start = skb_headlen(skb); > + int i, copy = start - offset; > + struct sk_buff *frag_iter; >

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

2018-08-07 Thread Doron Roberts-Kedes
decrypt_skb fails if the number of sg elements required to map is greater than MAX_SKB_FRAGS. nsg must always be calculated, but skb_cow_data adds unnecessary memcpy's for the zerocopy case. The new function skb_nsg calculates the number of scatterlist elements required to map the skb without the