diff options
author | Stefan Bader <stefan.bader@canonical.com> | 2013-04-26 13:49:32 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-05-11 13:48:09 -0700 |
commit | 1fa3f96b31bbdbfa99e29f6ba47948efc0717f84 (patch) | |
tree | 80243fcd58e0327e32ed71bbaaab07ad5c9755a5 /drivers | |
parent | 5d96a5f6c32bc97f2f2ff8e614de09ce6e2431c0 (diff) | |
download | linux-3.10-1fa3f96b31bbdbfa99e29f6ba47948efc0717f84.tar.gz linux-3.10-1fa3f96b31bbdbfa99e29f6ba47948efc0717f84.tar.bz2 linux-3.10-1fa3f96b31bbdbfa99e29f6ba47948efc0717f84.zip |
r8169: fix 8168evl frame padding.
commit e5195c1f31f399289347e043d6abf3ffa80f0005 upstream.
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: hayeswang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/realtek/r8169.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index 978af217ef0..dd037dda785 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c @@ -5168,6 +5168,14 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb, goto err_stop_0; } + /* 8168evl does not automatically pad to minimum length. */ + if (unlikely(tp->mac_version == RTL_GIGA_MAC_VER_34 && + skb->len < ETH_ZLEN)) { + if (skb_padto(skb, ETH_ZLEN)) + goto err_update_stats; + skb_put(skb, ETH_ZLEN - skb->len); + } + if (unlikely(le32_to_cpu(txd->opts1) & DescOwn)) goto err_stop_0; @@ -5239,6 +5247,7 @@ err_dma_1: rtl8169_unmap_tx_skb(d, tp->tx_skb + entry, txd); err_dma_0: dev_kfree_skb(skb); +err_update_stats: dev->stats.tx_dropped++; return NETDEV_TX_OK; |