netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 1/1] r8169: fix 8168evl frame padding.
@ 2013-04-26 23:49 Francois Romieu
  2013-04-29 18:11 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Francois Romieu @ 2013-04-26 23:49 UTC (permalink / raw)
  To: netdev; +Cc: David Miller, Hayes Wang, Stefan Bader

From: Stefan Bader <stefan.bader@canonical.com>

Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: hayeswang <hayeswang@realtek.com>
---

Stefan reported that Realtek's driver solves his problem as well.
It works differently though: skb_checksum_help vs skb_pad here.

 drivers/net/ethernet/realtek/r8169.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 4ecbe64..15ba8c4 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,
 		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;
 
@@ -5858,6 +5866,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;
 
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net 1/1] r8169: fix 8168evl frame padding.
  2013-04-26 23:49 [PATCH net 1/1] r8169: fix 8168evl frame padding Francois Romieu
@ 2013-04-29 18:11 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-04-29 18:11 UTC (permalink / raw)
  To: romieu; +Cc: netdev, hayeswang, stefan.bader

From: Francois Romieu <romieu@fr.zoreil.com>
Date: Sat, 27 Apr 2013 01:49:32 +0200

> From: Stefan Bader <stefan.bader@canonical.com>
> 
> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
> Acked-by: Francois Romieu <romieu@fr.zoreil.com>
> Cc: hayeswang <hayeswang@realtek.com>

Applied and queued up for -stable, thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-04-29 18:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-26 23:49 [PATCH net 1/1] r8169: fix 8168evl frame padding Francois Romieu
2013-04-29 18:11 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).