Re: [PATCH v2 net 1/2] tuntap: correctly linearize skb when zerocopy is used

2013-07-10 Thread Michael S. Tsirkin
On Wed, Jul 10, 2013 at 01:43:27PM +0800, Jason Wang wrote: > Userspace may produce vectors greater than MAX_SKB_FRAGS. When we try to > linearize parts of the skb to let the rest of iov to be fit in > the frags, we need count copylen into linear when calling tun_alloc_skb() > instead of partly

Re: [PATCH v2 net 1/2] tuntap: correctly linearize skb when zerocopy is used

2013-07-10 Thread Michael S. Tsirkin
On Wed, Jul 10, 2013 at 01:43:27PM +0800, Jason Wang wrote: Userspace may produce vectors greater than MAX_SKB_FRAGS. When we try to linearize parts of the skb to let the rest of iov to be fit in the frags, we need count copylen into linear when calling tun_alloc_skb() instead of partly

[PATCH v2 net 1/2] tuntap: correctly linearize skb when zerocopy is used

2013-07-09 Thread Jason Wang
Userspace may produce vectors greater than MAX_SKB_FRAGS. When we try to linearize parts of the skb to let the rest of iov to be fit in the frags, we need count copylen into linear when calling tun_alloc_skb() instead of partly counting it into data_len. Since this breaks zerocopy_sg_from_iovec()

[PATCH v2 net 1/2] tuntap: correctly linearize skb when zerocopy is used

2013-07-09 Thread Jason Wang
Userspace may produce vectors greater than MAX_SKB_FRAGS. When we try to linearize parts of the skb to let the rest of iov to be fit in the frags, we need count copylen into linear when calling tun_alloc_skb() instead of partly counting it into data_len. Since this breaks zerocopy_sg_from_iovec()