aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Bader2013-04-26 08:49:32 -0500
committerGreg Kroah-Hartman2013-05-11 15:53:57 -0500
commit7f9cc57937dfbe59c25f66e801bfecf5cb0de031 (patch)
treef1dfabcd0d10aae5a619e07df9f671970313ccb1
parent8f6aad0d018d11878d49603e017d3f6480488f41 (diff)
downloadkernel-omap-7f9cc57937dfbe59c25f66e801bfecf5cb0de031.tar.gz
kernel-omap-7f9cc57937dfbe59c25f66e801bfecf5cb0de031.tar.xz
kernel-omap-7f9cc57937dfbe59c25f66e801bfecf5cb0de031.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>
-rw-r--r--drivers/net/ethernet/realtek/r8169.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 2d849da4c566..2d56d7160a23 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -5779,6 +5779,14 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
5779 goto err_stop_0; 5779 goto err_stop_0;
5780 } 5780 }
5781 5781
5782 /* 8168evl does not automatically pad to minimum length. */
5783 if (unlikely(tp->mac_version == RTL_GIGA_MAC_VER_34 &&
5784 skb->len < ETH_ZLEN)) {
5785 if (skb_padto(skb, ETH_ZLEN))
5786 goto err_update_stats;
5787 skb_put(skb, ETH_ZLEN - skb->len);
5788 }
5789
5782 if (unlikely(le32_to_cpu(txd->opts1) & DescOwn)) 5790 if (unlikely(le32_to_cpu(txd->opts1) & DescOwn))
5783 goto err_stop_0; 5791 goto err_stop_0;
5784 5792
@@ -5850,6 +5858,7 @@ err_dma_1:
5850 rtl8169_unmap_tx_skb(d, tp->tx_skb + entry, txd); 5858 rtl8169_unmap_tx_skb(d, tp->tx_skb + entry, txd);
5851err_dma_0: 5859err_dma_0:
5852 dev_kfree_skb(skb); 5860 dev_kfree_skb(skb);
5861err_update_stats:
5853 dev->stats.tx_dropped++; 5862 dev->stats.tx_dropped++;
5854 return NETDEV_TX_OK; 5863 return NETDEV_TX_OK;
5855 5864