Skip to content

Commit 1bf9605

Browse files
ikhorndavem330
authored andcommitted
net: ethernet: ti: cpsw: return NET_XMIT_DROP if skb_padto failed
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]>
1 parent 98eb253 commit 1bf9605

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/ti/cpsw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1604,7 +1604,7 @@ static netdev_tx_t cpsw_ndo_start_xmit(struct sk_buff *skb,
16041604
if (skb_padto(skb, CPSW_MIN_PACKET_SIZE)) {
16051605
cpsw_err(priv, tx_err, "packet pad failed\n");
16061606
ndev->stats.tx_dropped++;
1607-
return NETDEV_TX_OK;
1607+
return NET_XMIT_DROP;
16081608
}
16091609

16101610
if (skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP &&

0 commit comments

Comments
 (0)