tun: make tun_build_skb() thread safe
authorEric Dumazet <[email protected]>
Wed, 16 Aug 2017 14:14:33 +0000 (22:14 +0800)
committerDavid S. Miller <[email protected]>
Wed, 16 Aug 2017 21:27:35 +0000 (14:27 -0700)
commit0bbd7dad34f81e5e724cb08252160a1796c388b2
treefea2d275e5a381ec4d90bbcf13f5a3840127e344
parentba5c4dac033b3b2f9e6a99793d1284c2dcf98b3f
tun: make tun_build_skb() thread safe

tun_build_skb() is not thread safe since it uses per queue page frag,
this will break things when multiple threads are sending through same
queue. Switch to use per-thread generator (no lock involved).

Fixes: 66ccbc9c87c2 ("tap: use build_skb() for small packet")
Tested-by: Jason Wang <[email protected]>
Signed-off-by: Eric Dumazet <[email protected]>
Signed-off-by: Jason Wang <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
drivers/net/tun.c