Skip to content

Commit

Permalink
net: validate_xmit_skb() changes
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Apr 15, 2016
1 parent da37845 commit d21fd63
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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);

Expand All @@ -3420,7 +3418,6 @@ static int __dev_queue_xmit(struct sk_buff *skb, void *accel_priv)
}

rc = -ENETDOWN;
drop:
rcu_read_unlock_bh();

atomic_long_inc(&dev->tx_dropped);
Expand Down

0 comments on commit d21fd63

Please sign in to comment.