lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20121112132241.12bb94e4@nehalam.linuxnetplumber.net>
Date:	Mon, 12 Nov 2012 13:22:41 -0800
From:	Stephen Hemminger <shemminger@...tta.com>
To:	David Miller <davem@...emloft.net>
Cc:	netdev@...r.kernel.org
Subject: [RFC net-next] tun: implement BQL

Add multiqueue BQL to tap device. Tested with VPN, doesn't have a big impact,
most likely because there is little queueing occuring at TAP device except
under case of forwarding.

Signed-off-by: Stephen Hemminger <shemminger@...tta.com>

--- a/drivers/net/tun.c	2012-11-12 07:58:45.527037947 -0800
+++ b/drivers/net/tun.c	2012-11-12 11:20:26.017512742 -0800
@@ -412,6 +412,7 @@ static void __tun_detach(struct tun_file
 		tun_flow_delete_by_queue(tun, tun->numqueues + 1);
 		/* Drop read queue */
 		skb_queue_purge(&tfile->sk.sk_receive_queue);
+		netdev_tx_reset_queue(netdev_get_tx_queue(dev, index));
 		tun_set_real_num_queues(tun);
 
 		if (tun->numqueues == 0 && !(tun->flags & TUN_PERSIST))
@@ -455,6 +456,7 @@ static void tun_detach_all(struct net_de
 						  lockdep_rtnl_is_held());
 		/* Drop read queue */
 		skb_queue_purge(&tfile->sk.sk_receive_queue);
+		netdev_tx_reset_queue(netdev_get_tx_queue(dev, i));
 		sock_put(&tfile->sk);
 	}
 }
@@ -712,6 +714,8 @@ static netdev_tx_t tun_net_xmit(struct s
 	 * for indefinite time. */
 	if (unlikely(skb_orphan_frags(skb, GFP_ATOMIC)))
 		goto drop;
+
+	netdev_tx_sent_queue(netdev_get_tx_queue(dev, txq), skb->len);
 	skb_orphan(skb);
 
 	/* Enqueue packet */
@@ -1324,6 +1328,10 @@ static ssize_t tun_do_read(struct tun_st
 		netif_wake_subqueue(tun->dev, tfile->queue_index);
 
 		ret = tun_put_user(tun, tfile, skb, iv, len);
+
+		netdev_tx_completed_queue(netdev_get_tx_queue(tun->dev,
+							      tfile->queue_index),
+					  1, skb->len);
 		kfree_skb(skb);
 		break;
 	}
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ