summaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2016-04-12 21:50:07 -0700
committerDavid S. Miller <davem@davemloft.net>2016-04-14 21:40:24 -0400
commitd21fd63ea3856208c3a1cb9b26d81898a2ccf71b (patch)
treef48f3f0e06688ce66ddc7ef7fb4823db499fec69 /net/core
parentda37845fdce24e174f44d020bc4085ddd1c8a6bd (diff)
downloadlinux-d21fd63ea3856208c3a1cb9b26d81898a2ccf71b.tar.bz2
net: validate_xmit_skb() changes
skbs given to validate_xmit_skb() should not have a next pointer anymore. Also if a packet is dropped, increment dev->tx_dropped __dev_queue_xmit() no longer has to change tx_dropped in this case. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/dev.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 556dd09af3b8..52d446b2cb99 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2959,9 +2959,6 @@ static struct sk_buff *validate_xmit_skb(struct sk_buff *skb, struct net_device
{
netdev_features_t features;
- if (skb->next)
- return skb;
-
features = netif_skb_features(skb);
skb = validate_xmit_vlan(skb, features);
if (unlikely(!skb))
@@ -3004,6 +3001,7 @@ static struct sk_buff *validate_xmit_skb(struct sk_buff *skb, struct net_device
out_kfree_skb:
kfree_skb(skb);
out_null:
+ atomic_long_inc(&dev->tx_dropped);
return NULL;
}
@@ -3393,7 +3391,7 @@ static int __dev_queue_xmit(struct sk_buff *skb, void *accel_priv)
skb = validate_xmit_skb(skb, dev);
if (!skb)
- goto drop;
+ goto out;
HARD_TX_LOCK(dev, txq, cpu);
@@ -3420,7 +3418,6 @@ recursion_alert:
}
rc = -ENETDOWN;
-drop:
rcu_read_unlock_bh();
atomic_long_inc(&dev->tx_dropped);