Re: [PATCH,v2,net-next 2/2] tun: enable napi_gro_frags() for TUN/TAP driver

2017-09-22 Thread Willem de Bruijn
On Fri, Sep 22, 2017 at 1:48 PM, Petar Penkov wrote: > On Fri, Sep 22, 2017 at 9:51 AM, Mahesh Bandewar (महेश बंडेवार) > wrote: >> On Fri, Sep 22, 2017 at 7:06 AM, Willem de Bruijn >> wrote: @@ -2061,6 +2174,9 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq

Re: [PATCH,v2,net-next 2/2] tun: enable napi_gro_frags() for TUN/TAP driver

2017-09-22 Thread Petar Penkov
On Fri, Sep 22, 2017 at 9:51 AM, Mahesh Bandewar (महेश बंडेवार) wrote: > On Fri, Sep 22, 2017 at 7:06 AM, Willem de Bruijn > wrote: >>> @@ -2061,6 +2174,9 @@ static int tun_set_iff(struct net *net, struct file >>> *file, struct ifreq *ifr) >>> if (tfile->detached) >>> ret

Re: [PATCH,v2,net-next 2/2] tun: enable napi_gro_frags() for TUN/TAP driver

2017-09-22 Thread महेश बंडेवार
On Fri, Sep 22, 2017 at 7:06 AM, Willem de Bruijn wrote: >> @@ -2061,6 +2174,9 @@ static int tun_set_iff(struct net *net, struct file >> *file, struct ifreq *ifr) >> if (tfile->detached) >> return -EINVAL; >> >> + if ((ifr->ifr_flags & IFF_NAPI_FRAGS) && !capable(CAP

Re: [PATCH,v2,net-next 2/2] tun: enable napi_gro_frags() for TUN/TAP driver

2017-09-22 Thread Willem de Bruijn
> @@ -2061,6 +2174,9 @@ static int tun_set_iff(struct net *net, struct file > *file, struct ifreq *ifr) > if (tfile->detached) > return -EINVAL; > > + if ((ifr->ifr_flags & IFF_NAPI_FRAGS) && !capable(CAP_NET_ADMIN)) > + return -EPERM; > + This should p

[PATCH,v2,net-next 2/2] tun: enable napi_gro_frags() for TUN/TAP driver

2017-09-21 Thread Petar Penkov
Add a TUN/TAP receive mode that exercises the napi_gro_frags() interface. This mode is available only in TAP mode, as the interface expects packets with Ethernet headers. Furthermore, packets follow the layout of the iovec_iter that was received. The first iovec is the linear data, and every one a