Re: [PATCH net-next 04/11] tuntap: simplify error handling in tun_build_skb()

2018-09-09 Thread Jason Wang
On 2018年09月07日 22:17, Michael S. Tsirkin wrote: On Fri, Sep 07, 2018 at 11:22:00AM +0800, Jason Wang wrote: @@ -1668,6 +1668,9 @@ static struct sk_buff *tun_build_skb(struct tun_struct *tun, if (copied != len) return ERR_PTR(-EFAULT); +

Re: [PATCH net-next 04/11] tuntap: simplify error handling in tun_build_skb()

2018-09-07 Thread Michael S. Tsirkin
On Fri, Sep 07, 2018 at 11:22:00AM +0800, Jason Wang wrote: > > > @@ -1668,6 +1668,9 @@ static struct sk_buff *tun_build_skb(struct > > > tun_struct *tun, > > > if (copied != len) > > > return ERR_PTR(-EFAULT); > > > + get_page(alloc_frag->page); > > > +

Re: [PATCH net-next 04/11] tuntap: simplify error handling in tun_build_skb()

2018-09-06 Thread Jason Wang
On 2018年09月07日 01:14, Michael S. Tsirkin wrote: On Thu, Sep 06, 2018 at 12:05:19PM +0800, Jason Wang wrote: There's no need to duplicate page get logic in each action. So this patch tries to get page and calculate the offset before processing XDP actions, and undo them when meet errors (we

Re: [PATCH net-next 04/11] tuntap: simplify error handling in tun_build_skb()

2018-09-06 Thread Michael S. Tsirkin
On Thu, Sep 06, 2018 at 12:05:19PM +0800, Jason Wang wrote: > There's no need to duplicate page get logic in each action. So this > patch tries to get page and calculate the offset before processing XDP > actions, and undo them when meet errors (we don't care the performance > on errors). This