Patchwork [net-next,6/8] tun: implement byte queue limits

login
register
mail settings
Submitter stephen hemminger
Date Oct. 30, 2012, 12:57 a.m.
Message ID <20121030005835.726919547@vyatta.com>
Download mbox | patch
Permalink /patch/195209/
State Changes Requested
Delegated to: David Miller
Headers show

Comments

stephen hemminger - Oct. 30, 2012, 12:57 a.m.
Add byte queue limits for tun device transmit.

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



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
stephen hemminger - Oct. 30, 2012, 1:09 a.m.
On Mon, 29 Oct 2012 17:57:37 -0700
Stephen Hemminger <shemminger@vyatta.com> wrote:

> Add byte queue limits for tun device transmit.
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

Unrelated patch, that was being tested at same time.
Ignore it.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

--- a/drivers/net/tun.c	2012-10-26 14:29:51.172647696 -0700
+++ b/drivers/net/tun.c	2012-10-26 14:31:46.663487824 -0700
@@ -421,6 +421,9 @@  static netdev_tx_t tun_net_xmit(struct s
 		goto drop;
 	skb_orphan(skb);
 
+	/* Update byte queue limits */
+	netdev_sent_queue(dev, skb->len);
+
 	/* Enqueue packet */
 	skb_queue_tail(&tun->socket.sk->sk_receive_queue, skb);
 
@@ -991,6 +994,8 @@  static ssize_t tun_do_read(struct tun_st
 		netif_wake_queue(tun->dev);
 
 		ret = tun_put_user(tun, skb, iv, len);
+
+		netdev_completed_queue(tun->dev, 1, skb->len);
 		kfree_skb(skb);
 		break;
 	}