* [PATCH net-next] tun: don't require serialization lock on tx
@ 2016-04-14 16:39 Paolo Abeni
2016-04-17 10:20 ` Michael S. Tsirkin
2016-04-18 18:36 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Paolo Abeni @ 2016-04-14 16:39 UTC (permalink / raw)
To: netdev
Cc: David S. Miller, Michael S. Tsirkin, Hannes Frederic Sowa,
Eric W. Biederman, Greg Kurz, Jason Wang, Eric Dumazet
The current tun_net_xmit() implementation don't need any external
lock since it relies 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.
The user space can remove the default tun qdisc with:
tc qdisc replace dev <tun device name> root noqueue
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Acked-by: Eric Dumazet <edumazet@google.com>
---
RFC -> v1
- fixed a commit message typo, extended the comment with a
configuration hint
---
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;
dev->vlan_features = dev->features &
~(NETIF_F_HW_VLAN_CTAG_TX |
NETIF_F_HW_VLAN_STAG_TX);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] tun: don't require serialization lock on tx
2016-04-14 16:39 [PATCH net-next] tun: don't require serialization lock on tx Paolo Abeni
@ 2016-04-17 10:20 ` Michael S. Tsirkin
2016-04-18 18:36 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Michael S. Tsirkin @ 2016-04-17 10:20 UTC (permalink / raw)
To: Paolo Abeni
Cc: netdev, David S. Miller, Hannes Frederic Sowa, Eric W. Biederman,
Greg Kurz, Jason Wang, Eric Dumazet
On Thu, Apr 14, 2016 at 06:39:39PM +0200, Paolo Abeni wrote:
> The current tun_net_xmit() implementation don't need any external
> lock since it relies 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.
>
> The user space can remove the default tun qdisc with:
>
> tc qdisc replace dev <tun device name> root noqueue
>
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
> Acked-by: Eric Dumazet <edumazet@google.com>
This one seems transparent to userspace so:
Acked-by: Michael S. Tsirkin <mst@redhat.com>
>
> ---
> RFC -> v1
> - fixed a commit message typo, extended the comment with a
> configuration hint
> ---
> 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;
> dev->vlan_features = dev->features &
> ~(NETIF_F_HW_VLAN_CTAG_TX |
> NETIF_F_HW_VLAN_STAG_TX);
> --
> 1.8.3.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] tun: don't require serialization lock on tx
2016-04-14 16:39 [PATCH net-next] tun: don't require serialization lock on tx Paolo Abeni
2016-04-17 10:20 ` Michael S. Tsirkin
@ 2016-04-18 18:36 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2016-04-18 18:36 UTC (permalink / raw)
To: pabeni; +Cc: netdev, mst, hannes, ebiederm, gkurz, jasowang, edumazet
From: Paolo Abeni <pabeni@redhat.com>
Date: Thu, 14 Apr 2016 18:39:39 +0200
> The current tun_net_xmit() implementation don't need any external
> lock since it relies 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.
>
> The user space can remove the default tun qdisc with:
>
> tc qdisc replace dev <tun device name> root noqueue
>
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
> Acked-by: Eric Dumazet <edumazet@google.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-04-18 18:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-14 16:39 [PATCH net-next] tun: don't require serialization lock on tx Paolo Abeni
2016-04-17 10:20 ` Michael S. Tsirkin
2016-04-18 18:36 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).