netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* r8169: fix driver drop incoming packets >= 1515 if MTU is set between 1515 and 1536
@ 2009-11-11 18:20 Raimonds Cicans
  2009-11-11 18:33 ` Ben Hutchings
  0 siblings, 1 reply; 5+ messages in thread
From: Raimonds Cicans @ 2009-11-11 18:20 UTC (permalink / raw)
  To: romieu; +Cc: netdev

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: r8169-mtu1536.patch --]
[-- Type: text/plain, Size: 938 bytes --]

Driver drop incoming packets >= 1515(1) if MTU is set between 1515(1) and 1536.

1) exact number depends on some factors:
- VLAN tagged or not
- patch "r8169: Fix card drop incoming VLAN tagged MTU byte large jumbo frames"
  applied or not

Bonus: got rid of magic number 8

Signed-off-by: Raimonds Cicans <ray@apollo.lv>

---

--- linux-2.6.31/drivers/net/r8169.c.orig	2009-11-06 21:52:12.722326601 +0200
+++ linux-2.6.31/drivers/net/r8169.c	2009-11-06 22:09:17.242224014 +0200
@@ -2229,9 +2229,9 @@ static void __devexit rtl8169_remove_one
 static void rtl8169_set_rxbufsize(struct rtl8169_private *tp,
 				  struct net_device *dev)
 {
-	unsigned int mtu = dev->mtu;
+	unsigned int max_frame = dev->mtu + VLAN_ETH_HLEN + ETH_FCS_LEN;
 
-	tp->rx_buf_sz = (mtu > RX_BUF_SIZE) ? mtu + ETH_HLEN + 8 : RX_BUF_SIZE;
+	tp->rx_buf_sz = (max_frame > RX_BUF_SIZE) ? max_frame : RX_BUF_SIZE;
 }
 
 static int rtl8169_open(struct net_device *dev)

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

end of thread, other threads:[~2009-11-11 22:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-11 18:20 r8169: fix driver drop incoming packets >= 1515 if MTU is set between 1515 and 1536 Raimonds Cicans
2009-11-11 18:33 ` Ben Hutchings
2009-11-11 20:05   ` Raimonds Cicans
2009-11-11 20:15     ` Ben Hutchings
2009-11-11 22:36       ` Raimonds Cicans

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).