Skip to content

Commit

Permalink
r8169: fix 8168evl frame padding.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stefan Bader authored and David S. Miller committed Apr 29, 2013
1 parent b424332 commit e5195c1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/net/ethernet/realtek/r8169.c
Original file line number Diff line number Diff line change
Expand Up @@ -5787,6 +5787,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;

Expand Down Expand Up @@ -5858,6 +5866,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
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;

Expand Down

0 comments on commit e5195c1

Please sign in to comment.