Re: [PATCH 5/5] skbuff: skb_segment: orphan frags before copying

2014-03-11 Thread Herbert Xu
On Tue, Mar 11, 2014 at 08:41:50AM +0200, Michael S. Tsirkin wrote: > On Tue, Mar 11, 2014 at 08:39:41AM +0800, Herbert Xu wrote: > > On Tue, Mar 11, 2014 at 12:30:01AM +0200, Michael S. Tsirkin wrote: > > > > > > How about we do the simple thing as the first step and try to optimize > > > as a sep

Re: [PATCH 5/5] skbuff: skb_segment: orphan frags before copying

2014-03-10 Thread Michael S. Tsirkin
On Tue, Mar 11, 2014 at 08:39:41AM +0800, Herbert Xu wrote: > On Tue, Mar 11, 2014 at 12:30:01AM +0200, Michael S. Tsirkin wrote: > > > > How about we do the simple thing as the first step and try to optimize > > as a separate patch on top? > > Sure let's do that. > > Cheers, Could you send an a

Re: [PATCH 5/5] skbuff: skb_segment: orphan frags before copying

2014-03-10 Thread Herbert Xu
On Tue, Mar 11, 2014 at 12:30:01AM +0200, Michael S. Tsirkin wrote: > > How about we do the simple thing as the first step and try to optimize > as a separate patch on top? Sure let's do that. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.ap

Re: [PATCH 5/5] skbuff: skb_segment: orphan frags before copying

2014-03-10 Thread Michael S. Tsirkin
On Tue, Mar 11, 2014 at 06:12:23AM +0800, Herbert Xu wrote: > On Tue, Mar 11, 2014 at 12:07:17AM +0200, Michael S. Tsirkin wrote: > > > > Once one skb completes the callback is invoked and userspace > > reuses this buffer for something else. > > At that point it's too late to do the copy. > > OK,

Re: [PATCH 5/5] skbuff: skb_segment: orphan frags before copying

2014-03-10 Thread Herbert Xu
On Tue, Mar 11, 2014 at 12:07:17AM +0200, Michael S. Tsirkin wrote: > > Once one skb completes the callback is invoked and userspace > reuses this buffer for something else. > At that point it's too late to do the copy. OK, would it be possible to delay the callback until all generated skbs are c

Re: [PATCH 5/5] skbuff: skb_segment: orphan frags before copying

2014-03-10 Thread Michael S. Tsirkin
On Tue, Mar 11, 2014 at 05:56:40AM +0800, Herbert Xu wrote: > On Mon, Mar 10, 2014 at 11:52:36PM +0200, Michael S. Tsirkin wrote: > > > > The cover letter has more detail: > > For some reason I didn't receive this cover letter. > > skb_segment ... moves frags > > between skbs without orpha

Re: [PATCH 5/5] skbuff: skb_segment: orphan frags before copying

2014-03-10 Thread Herbert Xu
On Mon, Mar 10, 2014 at 11:52:36PM +0200, Michael S. Tsirkin wrote: > > The cover letter has more detail: For some reason I didn't receive this cover letter. > skb_segment ... moves frags > between skbs without orphaning them. > This causes userspace to assume it's safe to >

Re: [PATCH 5/5] skbuff: skb_segment: orphan frags before copying

2014-03-10 Thread Michael S. Tsirkin
On Tue, Mar 11, 2014 at 05:34:05AM +0800, Herbert Xu wrote: > On Mon, Mar 10, 2014 at 06:29:36PM +0200, Michael S. Tsirkin wrote: > > skb_segment copies frags around, so we need > > to copy them carefully to avoid accessing > > user memory after reporting completion to userspace > > through a callb

Re: [PATCH 5/5] skbuff: skb_segment: orphan frags before copying

2014-03-10 Thread Herbert Xu
On Mon, Mar 10, 2014 at 06:29:36PM +0200, Michael S. Tsirkin wrote: > skb_segment copies frags around, so we need > to copy them carefully to avoid accessing > user memory after reporting completion to userspace > through a callback. > > skb_segment doesn't normally happen on datapath: > TSO needs

[PATCH 5/5] skbuff: skb_segment: orphan frags before copying

2014-03-10 Thread Michael S. Tsirkin
skb_segment copies frags around, so we need to copy them carefully to avoid accessing user memory after reporting completion to userspace through a callback. skb_segment doesn't normally happen on datapath: TSO needs to be disabled - so disabling zero copy in this case does not look like a big dea