Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1211904

[PATCH net-next] macvtap/macvlan: use IFF_NO_QUEUE

From Jason Wang <jasowang@redhat.com>
Newsgroups linux.kernel
Subject [PATCH net-next] macvtap/macvlan: use IFF_NO_QUEUE
Date 2015-08-24 10:40 +0200
Message-ID <q0Vsl-2pv-1@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


For macvlan, switch to use IFF_NO_QUEUE instead of tx_queue_len = 0.

For macvtap, after commit 6acf54f1cf0a6747bac9fea26f34cfc5a9029523
("macvtap: Add support of packet capture on macvtap
device."). Multiqueue macvtap suffers from single qdisc lock
contention. This is because macvtap claims a non zero tx_queue_len and
it reuses this value as it socket receive queue size.Thanks to
IFF_NO_QUEUE, we can remove the lock contention without breaking
existing socket receive queue length logic.

Cc: Patrick McHardy <kaber@trash.net>
Cc: Vladislav Yasevich <vyasevic@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 drivers/net/macvlan.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 47da435..09d8718 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -1056,7 +1056,7 @@ void macvlan_common_setup(struct net_device *dev)
 
 	dev->priv_flags	       &= ~IFF_TX_SKB_SHARING;
 	netif_keep_dst(dev);
-	dev->priv_flags	       |= IFF_UNICAST_FLT;
+	dev->priv_flags	       |= IFF_UNICAST_FLT | IFF_NO_QUEUE;
 	dev->netdev_ops		= &macvlan_netdev_ops;
 	dev->destructor		= free_netdev;
 	dev->header_ops		= &macvlan_hard_header_ops;
@@ -1067,7 +1067,6 @@ EXPORT_SYMBOL_GPL(macvlan_common_setup);
 static void macvlan_setup(struct net_device *dev)
 {
 	macvlan_common_setup(dev);
-	dev->tx_queue_len	= 0;
 }
 
 static int macvlan_port_create(struct net_device *dev)
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[PATCH net-next] macvtap/macvlan: use IFF_NO_QUEUE Jason Wang <jasowang@redhat.com> - 2015-08-24 10:40 +0200
  Re: [PATCH net-next] macvtap/macvlan: use IFF_NO_QUEUE "Michael S. Tsirkin" <mst@redhat.com> - 2015-08-25 12:20 +0200
    Re: [PATCH net-next] macvtap/macvlan: use IFF_NO_QUEUE Jason Wang <jasowang@redhat.com> - 2015-08-25 13:40 +0200
      Re: [PATCH net-next] macvtap/macvlan: use IFF_NO_QUEUE Vlad Yasevich <vyasevic@redhat.com> - 2015-08-25 18:40 +0200
        Re: [PATCH net-next] macvtap/macvlan: use IFF_NO_QUEUE Jason Wang <jasowang@redhat.com> - 2015-08-26 07:50 +0200
          Re: [PATCH net-next] macvtap/macvlan: use IFF_NO_QUEUE "Michael S. Tsirkin" <mst@redhat.com> - 2015-08-27 12:50 +0200
            Re: [PATCH net-next] macvtap/macvlan: use IFF_NO_QUEUE Jason Wang <jasowang@redhat.com> - 2015-08-28 04:50 +0200
              Re: [PATCH net-next] macvtap/macvlan: use IFF_NO_QUEUE Vlad Yasevich <vyasevic@redhat.com> - 2015-08-28 14:30 +0200
                Re: [PATCH net-next] macvtap/macvlan: use IFF_NO_QUEUE Jason Wang <jasowang@redhat.com> - 2015-08-31 04:50 +0200

csiph-web