diff options
author | Willem de Bruijn <willemb@google.com> | 2015-06-08 11:53:08 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-06-08 15:15:13 -0400 |
commit | bbbf2df0039d31c6a0a9708ce4fe220a54bd5379 (patch) | |
tree | 1b6fe886986a7621b4028db18b7fe262ea6ebf97 /net/core | |
parent | afe3f907d20f39c0eaf81f2baec247ba672f34a9 (diff) |
net: replace last open coded skb_orphan_frags with function call
Commit 70008aa50e92 ("skbuff: convert to skb_orphan_frags") replaced
open coded tests of SKBTX_DEV_ZEROCOPY and skb_copy_ubufs with calls
to helper function skb_orphan_frags. Apply that to the last remaining
open coded site.
Signed-off-by: Willem de Bruijn <willemb@google.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/dev.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 2c1c67fad64d..aa82f9ab6a36 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1718,15 +1718,8 @@ EXPORT_SYMBOL_GPL(is_skb_forwardable); | |||
1718 | 1718 | ||
1719 | int __dev_forward_skb(struct net_device *dev, struct sk_buff *skb) | 1719 | int __dev_forward_skb(struct net_device *dev, struct sk_buff *skb) |
1720 | { | 1720 | { |
1721 | if (skb_shinfo(skb)->tx_flags & SKBTX_DEV_ZEROCOPY) { | 1721 | if (skb_orphan_frags(skb, GFP_ATOMIC) || |
1722 | if (skb_copy_ubufs(skb, GFP_ATOMIC)) { | 1722 | unlikely(!is_skb_forwardable(dev, skb))) { |
1723 | atomic_long_inc(&dev->rx_dropped); | ||
1724 | kfree_skb(skb); | ||
1725 | return NET_RX_DROP; | ||
1726 | } | ||
1727 | } | ||
1728 | |||
1729 | if (unlikely(!is_skb_forwardable(dev, skb))) { | ||
1730 | atomic_long_inc(&dev->rx_dropped); | 1723 | atomic_long_inc(&dev->rx_dropped); |
1731 | kfree_skb(skb); | 1724 | kfree_skb(skb); |
1732 | return NET_RX_DROP; | 1725 | return NET_RX_DROP; |