net: ethernet: ti: cpsw: return NET_XMIT_DROP if skb_padto failed
authorIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Sat, 11 Feb 2017 01:49:57 +0000 (03:49 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 12 Feb 2017 02:26:57 +0000 (21:26 -0500)
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 <ivan.khoronzhuk@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/cpsw.c

index 4d1c0c3042c75227901578cfdb40ab09907fb649..503fa8af37d73c2f780946a8a25f6b40e8b06033 100644 (file)
@@ -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 &&