Skip to content

Commit

Permalink
net: ethernet: ti: cpsw: return NET_XMIT_DROP if skb_padto failed
Browse files Browse the repository at this point in the history
If skb_padto failed the skb has been dropped already, so it was
consumed, but it doesn't mean it was sent, thus no need to update
queue tx time, etc. So, return NET_XMIT_DROP as more appropriate.

Signed-off-by: Ivan Khoronzhuk <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
ikhorn authored and davem330 committed Feb 12, 2017
1 parent 98eb253 commit 1bf9605
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/ti/cpsw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1604,7 +1604,7 @@ static netdev_tx_t cpsw_ndo_start_xmit(struct sk_buff *skb,
if (skb_padto(skb, CPSW_MIN_PACKET_SIZE)) {
cpsw_err(priv, tx_err, "packet pad failed\n");
ndev->stats.tx_dropped++;
return NETDEV_TX_OK;
return NET_XMIT_DROP;
}

if (skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP &&
Expand Down

0 comments on commit 1bf9605

Please sign in to comment.