netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC net-next] tun: implement BQL
@ 2012-11-12 21:22 Stephen Hemminger
  2012-11-13 22:19 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2012-11-12 21:22 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

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@vyatta.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;
 	}

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC net-next] tun: implement BQL
  2012-11-12 21:22 [RFC net-next] tun: implement BQL Stephen Hemminger
@ 2012-11-13 22:19 ` David Miller
  2012-11-13 22:39   ` Stephen Hemminger
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2012-11-13 22:19 UTC (permalink / raw)
  To: shemminger; +Cc: netdev

From: Stephen Hemminger <shemminger@vyatta.com>
Date: Mon, 12 Nov 2012 13:22:41 -0800

> 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@vyatta.com>

I think unless we can show it making an impact in a normal
usage scenerio, we should leave it alone for now.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC net-next] tun: implement BQL
  2012-11-13 22:19 ` David Miller
@ 2012-11-13 22:39   ` Stephen Hemminger
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2012-11-13 22:39 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

On Tue, 13 Nov 2012 17:19:39 -0500 (EST)
David Miller <davem@davemloft.net> wrote:

> From: Stephen Hemminger <shemminger@vyatta.com>
> Date: Mon, 12 Nov 2012 13:22:41 -0800
> 
> > 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@vyatta.com>
> 
> I think unless we can show it making an impact in a normal
> usage scenerio, we should leave it alone for now.

Agreed, that is why I submitted as RFC.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-11-13 22:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-12 21:22 [RFC net-next] tun: implement BQL Stephen Hemminger
2012-11-13 22:19 ` David Miller
2012-11-13 22:39   ` Stephen Hemminger

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).