All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Hannes Frederic Sowa <hannes@stressinduktion.org>
Cc: Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Greg Kurz <gkurz@linux.vnet.ibm.com>,
	Jason Wang <jasowang@redhat.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Herbert Xu <herbert@gondor.apana.org.au>
Subject: Re: [PATCH RFC 1/2] tun: don't require serialization lock on tx
Date: Wed, 13 Apr 2016 15:57:37 +0300	[thread overview]
Message-ID: <20160413155654-mutt-send-email-mst@redhat.com> (raw)
In-Reply-To: <570E15D9.4000308@stressinduktion.org>

On Wed, Apr 13, 2016 at 11:48:09AM +0200, Hannes Frederic Sowa wrote:
> On 13.04.2016 11:41, Michael S. Tsirkin wrote:
> >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 <pabeni@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 */
> 
> In networking/netdev-features.txt
> 
>  * LLTX driver (deprecated for hardware drivers)
> 
> NETIF_F_LLTX should be set in drivers that implement their own locking in
> transmit path or don't need locking at all (e.g. software tunnels).
> In ndo_start_xmit, it is recommended to use a try_lock and return
> NETDEV_TX_LOCKED when the spin lock fails.  The locking should also properly
> protect against other callbacks (the rules you need to find out).
> 
> Don't use it for new drivers.
> 
> I think this is documentation is correct and it is only deprecated for
> hardware drivers.
> 
> Bye,
> Hannes

Fine, but what's the AF_PACKET duplication that Herbert Xu
reported with NETIF_F_LLTX? Does anyone remember?

-- 
MST

  reply	other threads:[~2016-04-13 12:57 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-13  9:04 [PATCH RFC 0/2] tun: lockless xmit Paolo Abeni
2016-04-13  9:04 ` [PATCH RFC 1/2] tun: don't require serialization lock on tx Paolo Abeni
2016-04-13  9:41   ` Michael S. Tsirkin
2016-04-13  9:48     ` Hannes Frederic Sowa
2016-04-13 12:57       ` Michael S. Tsirkin [this message]
2016-04-13 13:27         ` Eric Dumazet
2016-04-13 13:54           ` Michael S. Tsirkin
2016-04-13 14:39             ` Eric Dumazet
2016-04-13 12:52   ` Eric Dumazet
2016-04-13 14:26   ` Sergei Shtylyov
2016-04-14  6:50   ` Jason Wang
2016-04-14 10:27   ` Hannes Frederic Sowa
2016-04-13  9:04 ` [PATCH RFC 2/2] tun: don't set a default qdisc Paolo Abeni
2016-04-13 10:26   ` Michael S. Tsirkin
2016-04-13 15:22     ` David Miller
2016-04-14  6:49     ` Jason Wang
2016-04-14  9:05       ` Michael S. Tsirkin
2016-04-14  9:07         ` Jason Wang
2016-04-14  9:10           ` Michael S. Tsirkin
2016-04-14  9:21             ` Jason Wang
2016-04-14 10:01               ` Michael S. Tsirkin
2016-04-14 10:09                 ` Hannes Frederic Sowa
2016-04-13 11:08 ` [PATCH RFC 0/2] tun: lockless xmit Michael S. Tsirkin
2016-04-13 12:50   ` Eric Dumazet
2016-04-13 12:56     ` Michael S. Tsirkin
2016-04-13 13:09       ` Eric Dumazet
2016-04-13 13:17         ` Michael S. Tsirkin
2016-04-13 13:43           ` Eric Dumazet
2016-04-13 16:42             ` Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160413155654-mutt-send-email-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=davem@davemloft.net \
    --cc=ebiederm@xmission.com \
    --cc=gkurz@linux.vnet.ibm.com \
    --cc=hannes@stressinduktion.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=jasowang@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.