Re: [PATCH net-next V3 3/3] tun: rx batching

2017-01-02 Thread Jason Wang
On 2017年01月01日 05:03, Stephen Hemminger wrote: On Fri, 30 Dec 2016 13:20:51 +0800 Jason Wang wrote: diff --git a/drivers/net/tun.c b/drivers/net/tun.c index cd8e02c..a268ed9 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -75,6 +75,10 @@ #include

Re: [PATCH net-next V3 3/3] tun: rx batching

2017-01-02 Thread Jason Wang
On 2017年01月01日 01:31, David Miller wrote: From: Jason Wang Date: Fri, 30 Dec 2016 13:20:51 +0800 @@ -1283,10 +1314,15 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile, skb_probe_transport_header(skb, 0); rxhash =

Re: [PATCH net-next V3 3/3] tun: rx batching

2016-12-31 Thread Stephen Hemminger
On Fri, 30 Dec 2016 13:20:51 +0800 Jason Wang wrote: > diff --git a/drivers/net/tun.c b/drivers/net/tun.c > index cd8e02c..a268ed9 100644 > --- a/drivers/net/tun.c > +++ b/drivers/net/tun.c > @@ -75,6 +75,10 @@ > > #include > > +static int rx_batched; >

Re: [PATCH net-next V3 3/3] tun: rx batching

2016-12-31 Thread David Miller
From: Jason Wang Date: Fri, 30 Dec 2016 13:20:51 +0800 > @@ -1283,10 +1314,15 @@ static ssize_t tun_get_user(struct tun_struct *tun, > struct tun_file *tfile, > skb_probe_transport_header(skb, 0); > > rxhash = skb_get_hash(skb); > + > #ifndef CONFIG_4KSTACKS

[PATCH net-next V3 3/3] tun: rx batching

2016-12-29 Thread Jason Wang
We can only process 1 packet at one time during sendmsg(). This often lead bad cache utilization under heavy load. So this patch tries to do some batching during rx before submitting them to host network stack. This is done through accepting MSG_MORE as a hint from sendmsg() caller, if it was set,