aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorStefan Bader <stefan.bader@canonical.com>2013-04-26 09:49:32 -0400
committerDavid S. Miller <davem@davemloft.net>2013-04-29 14:10:29 -0400
commite5195c1f31f399289347e043d6abf3ffa80f0005 (patch)
tree9129ee331ae679fa00221ec75c9fefde84ad32ec /drivers/net
parentb424332d0a812799b83ab6e1d3c8c32a3c5ecfb5 (diff)
r8169: fix 8168evl frame padding.
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>
Diffstat (limited to 'drivers/net')
-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 4ecbe64a758d..15ba8c47d79f 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -5787,6 +5787,14 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
5787 goto err_stop_0; 5787 goto err_stop_0;
5788 } 5788 }
5789 5789
5790 /* 8168evl does not automatically pad to minimum length. */
5791 if (unlikely(tp->mac_version == RTL_GIGA_MAC_VER_34 &&
5792 skb->len < ETH_ZLEN)) {
5793 if (skb_padto(skb, ETH_ZLEN))
5794 goto err_update_stats;
5795 skb_put(skb, ETH_ZLEN - skb->len);
5796 }
5797
5790 if (unlikely(le32_to_cpu(txd->opts1) & DescOwn)) 5798 if (unlikely(le32_to_cpu(txd->opts1) & DescOwn))
5791 goto err_stop_0; 5799 goto err_stop_0;
5792 5800
@@ -5858,6 +5866,7 @@ err_dma_1:
5858 rtl8169_unmap_tx_skb(d, tp->tx_skb + entry, txd); 5866 rtl8169_unmap_tx_skb(d, tp->tx_skb + entry, txd);
5859err_dma_0: 5867err_dma_0:
5860 dev_kfree_skb(skb); 5868 dev_kfree_skb(skb);
5869err_update_stats:
5861 dev->stats.tx_dropped++; 5870 dev->stats.tx_dropped++;
5862 return NETDEV_TX_OK; 5871 return NETDEV_TX_OK;
5863 5872