Commit d21fd63e authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

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: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent da37845f
...@@ -2959,9 +2959,6 @@ static struct sk_buff *validate_xmit_skb(struct sk_buff *skb, struct net_device ...@@ -2959,9 +2959,6 @@ static struct sk_buff *validate_xmit_skb(struct sk_buff *skb, struct net_device
{ {
netdev_features_t features; netdev_features_t features;
if (skb->next)
return skb;
features = netif_skb_features(skb); features = netif_skb_features(skb);
skb = validate_xmit_vlan(skb, features); skb = validate_xmit_vlan(skb, features);
if (unlikely(!skb)) if (unlikely(!skb))
...@@ -3004,6 +3001,7 @@ static struct sk_buff *validate_xmit_skb(struct sk_buff *skb, struct net_device ...@@ -3004,6 +3001,7 @@ static struct sk_buff *validate_xmit_skb(struct sk_buff *skb, struct net_device
out_kfree_skb: out_kfree_skb:
kfree_skb(skb); kfree_skb(skb);
out_null: out_null:
atomic_long_inc(&dev->tx_dropped);
return NULL; return NULL;
} }
...@@ -3393,7 +3391,7 @@ static int __dev_queue_xmit(struct sk_buff *skb, void *accel_priv) ...@@ -3393,7 +3391,7 @@ static int __dev_queue_xmit(struct sk_buff *skb, void *accel_priv)
skb = validate_xmit_skb(skb, dev); skb = validate_xmit_skb(skb, dev);
if (!skb) if (!skb)
goto drop; goto out;
HARD_TX_LOCK(dev, txq, cpu); HARD_TX_LOCK(dev, txq, cpu);
...@@ -3420,7 +3418,6 @@ static int __dev_queue_xmit(struct sk_buff *skb, void *accel_priv) ...@@ -3420,7 +3418,6 @@ static int __dev_queue_xmit(struct sk_buff *skb, void *accel_priv)
} }
rc = -ENETDOWN; rc = -ENETDOWN;
drop:
rcu_read_unlock_bh(); rcu_read_unlock_bh();
atomic_long_inc(&dev->tx_dropped); atomic_long_inc(&dev->tx_dropped);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment