On Wed, Apr 13, 2016 at 11:04:46AM +0200, Paolo Abeni wrote: > The current tun_net_xmit() implementation don't need any external > lock since it relay on rcu protection for the tun data structure > and on socket queue lock for skb queuing. > > This patch set the NETIF_F_LLTX feature bit in the tun device, so > that on xmit, in absence of qdisc, no serialization lock is acquired > by the caller. > > Signed-off-by: Paolo Abeni <pab...@redhat.com> > --- > drivers/net/tun.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/tun.c b/drivers/net/tun.c > index faf9297..42992dc 100644 > --- a/drivers/net/tun.c > +++ b/drivers/net/tun.c > @@ -1796,7 +1796,7 @@ static int tun_set_iff(struct net *net, struct file > *file, struct ifreq *ifr) > dev->hw_features = NETIF_F_SG | NETIF_F_FRAGLIST | > TUN_USER_FEATURES | NETIF_F_HW_VLAN_CTAG_TX | > NETIF_F_HW_VLAN_STAG_TX; > - dev->features = dev->hw_features; > + dev->features = dev->hw_features | NETIF_F_LLTX;
the documentation says: NETIF_F_LLTX_BIT, /* LockLess TX - deprecated. Please */ /* do not use LLTX in new drivers */ git log gives this explanation: > 1) unnecessary; > 2) causes problems with AF_PACKET seeing things twice. > dev->vlan_features = dev->features & > ~(NETIF_F_HW_VLAN_CTAG_TX | > NETIF_F_HW_VLAN_STAG_TX); > -- > 1.8.3.1