Re: [PATCH net-next V2 1/3] tap: use build_skb() for small packet

2017-08-16 Thread David Miller
From: Jason Wang Date: Wed, 16 Aug 2017 17:17:45 +0800 > It looks like full page allocation just produce too much stress on the > page allocator. > > I get 1.58Mpps (full page) vs 1.95Mpps (page frag) with the patches > attached. Yes, this is why drivers doing XDP tend to drift towards implemen

Re: [PATCH net-next V2 1/3] tap: use build_skb() for small packet

2017-08-16 Thread Jason Wang
On 2017年08月16日 18:24, Eric Dumazet wrote: On Wed, 2017-08-16 at 11:55 +0800, Jason Wang wrote: On 2017年08月16日 11:45, Eric Dumazet wrote: You do realize that tun_build_skb() is not thread safe ? Ok, I think the issue if skb_page_frag_refill(), need a spinlock probably. Will prepare a patch.

Re: [PATCH net-next V2 1/3] tap: use build_skb() for small packet

2017-08-16 Thread Eric Dumazet
On Wed, 2017-08-16 at 11:55 +0800, Jason Wang wrote: > > On 2017年08月16日 11:45, Eric Dumazet wrote: > > > > You do realize that tun_build_skb() is not thread safe ? > > Ok, I think the issue if skb_page_frag_refill(), need a spinlock > probably. Will prepare a patch. But since tun is used from p

Re: [PATCH net-next V2 1/3] tap: use build_skb() for small packet

2017-08-16 Thread Jason Wang
On 2017年08月16日 12:07, Jason Wang wrote: On 2017年08月16日 11:59, Michael S. Tsirkin wrote: On Wed, Aug 16, 2017 at 11:57:51AM +0800, Jason Wang wrote: On 2017年08月16日 11:55, Michael S. Tsirkin wrote: On Tue, Aug 15, 2017 at 08:45:20PM -0700, Eric Dumazet wrote: On Fri, 2017-08-11 at 19:41 +0

Re: [PATCH net-next V2 1/3] tap: use build_skb() for small packet

2017-08-15 Thread Jason Wang
On 2017年08月16日 11:59, Michael S. Tsirkin wrote: On Wed, Aug 16, 2017 at 11:57:51AM +0800, Jason Wang wrote: On 2017年08月16日 11:55, Michael S. Tsirkin wrote: On Tue, Aug 15, 2017 at 08:45:20PM -0700, Eric Dumazet wrote: On Fri, 2017-08-11 at 19:41 +0800, Jason Wang wrote: We use tun_alloc_sk

Re: [PATCH net-next V2 1/3] tap: use build_skb() for small packet

2017-08-15 Thread Michael S. Tsirkin
On Wed, Aug 16, 2017 at 11:57:51AM +0800, Jason Wang wrote: > > > On 2017年08月16日 11:55, Michael S. Tsirkin wrote: > > On Tue, Aug 15, 2017 at 08:45:20PM -0700, Eric Dumazet wrote: > > > On Fri, 2017-08-11 at 19:41 +0800, Jason Wang wrote: > > > > We use tun_alloc_skb() which calls sock_alloc_send

Re: [PATCH net-next V2 1/3] tap: use build_skb() for small packet

2017-08-15 Thread Jason Wang
On 2017年08月16日 11:55, Michael S. Tsirkin wrote: On Tue, Aug 15, 2017 at 08:45:20PM -0700, Eric Dumazet wrote: On Fri, 2017-08-11 at 19:41 +0800, Jason Wang wrote: We use tun_alloc_skb() which calls sock_alloc_send_pskb() to allocate skb in the past. This socket based method is not suitable fo

Re: [PATCH net-next V2 1/3] tap: use build_skb() for small packet

2017-08-15 Thread Jason Wang
On 2017年08月16日 11:45, Eric Dumazet wrote: On Fri, 2017-08-11 at 19:41 +0800, Jason Wang wrote: We use tun_alloc_skb() which calls sock_alloc_send_pskb() to allocate skb in the past. This socket based method is not suitable for high speed userspace like virtualization which usually: - ignore s

Re: [PATCH net-next V2 1/3] tap: use build_skb() for small packet

2017-08-15 Thread Michael S. Tsirkin
On Tue, Aug 15, 2017 at 08:45:20PM -0700, Eric Dumazet wrote: > On Fri, 2017-08-11 at 19:41 +0800, Jason Wang wrote: > > We use tun_alloc_skb() which calls sock_alloc_send_pskb() to allocate > > skb in the past. This socket based method is not suitable for high > > speed userspace like virtualizati

Re: [PATCH net-next V2 1/3] tap: use build_skb() for small packet

2017-08-15 Thread Eric Dumazet
On Fri, 2017-08-11 at 19:41 +0800, Jason Wang wrote: > We use tun_alloc_skb() which calls sock_alloc_send_pskb() to allocate > skb in the past. This socket based method is not suitable for high > speed userspace like virtualization which usually: > > - ignore sk_sndbuf (INT_MAX) and expect to rece

[PATCH net-next V2 1/3] tap: use build_skb() for small packet

2017-08-11 Thread Jason Wang
We use tun_alloc_skb() which calls sock_alloc_send_pskb() to allocate skb in the past. This socket based method is not suitable for high speed userspace like virtualization which usually: - ignore sk_sndbuf (INT_MAX) and expect to receive the packet as fast as possible - don't want to be block a