Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 341744
b: refs/heads/master
c: 5d09710
h: refs/heads/master
v: v3
  • Loading branch information
Michael S. Tsirkin authored and David S. Miller committed Dec 3, 2012
1 parent 692f0b3 commit 1cb23d0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9ba2add3cf5c103b7236f82a023c8ee05a51e4d1
refs/heads/master: 5d097109257c03a71845729f8db6b5770c4bbedc
24 changes: 8 additions & 16 deletions trunk/drivers/net/tun.c
Original file line number Diff line number Diff line change
Expand Up @@ -690,21 +690,8 @@ static netdev_tx_t tun_net_xmit(struct sk_buff *skb, struct net_device *dev)
* number of queues.
*/
if (skb_queue_len(&tfile->socket.sk->sk_receive_queue)
>= dev->tx_queue_len / tun->numqueues){
if (!(tun->flags & TUN_ONE_QUEUE)) {
/* Normal queueing mode. */
/* Packet scheduler handles dropping of further packets. */
netif_stop_subqueue(dev, txq);

/* We won't see all dropped packets individually, so overrun
* error is more appropriate. */
dev->stats.tx_fifo_errors++;
} else {
/* Single queue mode.
* Driver handles dropping of all packets itself. */
goto drop;
}
}
>= dev->tx_queue_len / tun->numqueues)
goto drop;

/* Orphan the skb - required as we might hang on to it
* for indefinite time. */
Expand Down Expand Up @@ -1319,7 +1306,6 @@ static ssize_t tun_do_read(struct tun_struct *tun, struct tun_file *tfile,
schedule();
continue;
}
netif_wake_subqueue(tun->dev, tfile->queue_index);

ret = tun_put_user(tun, tfile, skb, iv, len);
kfree_skb(skb);
Expand Down Expand Up @@ -1482,6 +1468,9 @@ static int tun_flags(struct tun_struct *tun)
if (tun->flags & TUN_NO_PI)
flags |= IFF_NO_PI;

/* This flag has no real effect. We track the value for backwards
* compatibility.
*/
if (tun->flags & TUN_ONE_QUEUE)
flags |= IFF_ONE_QUEUE;

Expand Down Expand Up @@ -1632,6 +1621,9 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
else
tun->flags &= ~TUN_NO_PI;

/* This flag has no real effect. We track the value for backwards
* compatibility.
*/
if (ifr->ifr_flags & IFF_ONE_QUEUE)
tun->flags |= TUN_ONE_QUEUE;
else
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/uapi/linux/if_tun.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#define TUN_FASYNC 0x0010
#define TUN_NOCHECKSUM 0x0020
#define TUN_NO_PI 0x0040
/* This flag has no real effect */
#define TUN_ONE_QUEUE 0x0080
#define TUN_PERSIST 0x0100
#define TUN_VNET_HDR 0x0200
Expand Down Expand Up @@ -60,6 +61,7 @@
#define IFF_TUN 0x0001
#define IFF_TAP 0x0002
#define IFF_NO_PI 0x1000
/* This flag has no real effect */
#define IFF_ONE_QUEUE 0x2000
#define IFF_VNET_HDR 0x4000
#define IFF_TUN_EXCL 0x8000
Expand Down

0 comments on commit 1cb23d0

Please sign in to comment.