Skip to content

Commit

Permalink
tun: report orphan frags errors to zero copy callback
Browse files Browse the repository at this point in the history
When tun transmits a zero copy skb, it orphans the frags
which might need to allocate extra memory, in atomic context.
If that fails, notify ubufs callback before freeing the skb
as a hint that device should disable zerocopy mode.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Michael S. Tsirkin authored and David S. Miller committed Nov 3, 2012
1 parent 2512117 commit 149d36f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/tun.c
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,7 @@ static netdev_tx_t tun_net_xmit(struct sk_buff *skb, struct net_device *dev)

drop:
dev->stats.tx_dropped++;
skb_tx_error(skb);
kfree_skb(skb);
rcu_read_unlock();
return NETDEV_TX_OK;
Expand Down

0 comments on commit 149d36f

Please sign in to comment.