]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
r8169: Fix receive buffer length when MTU is between 1515 and 1536
authorRaimonds Cicans <ray@apollo.lv>
Fri, 13 Nov 2009 10:52:19 +0000 (10:52 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 1 Apr 2010 22:52:18 +0000 (15:52 -0700)
commite2db86fdddfbf179ebc8e717b50770cf7acf78b6
tree6672ccc787fa8a4d0e54a6d5342e5a0a73fa6037
parent5d0698d14afc8179e681d1baa6a76a814f8f2fcf
r8169: Fix receive buffer length when MTU is between 1515 and 1536

commit 8812304cf1110ae16b0778680f6022216cf4716a upstream.

In r8169 driver MTU is used to calculate receive buffer size.
Receive buffer size is used to configure hardware incoming packet filter.

For jumbo frames:
Receive buffer size = Max frame size = MTU + 14 (ethernet header) + 4
(vlan header) + 4 (ethernet checksum) = MTU + 22

Bug:
driver for all MTU up to 1536 use receive buffer size 1536

As you can see from formula, this mean all IP packets > 1536 - 22
(for vlan tagged, 1536 - 18 for not tagged) are dropped by hardware
filter.

Example:

host_good>  ifconfig eth0 mtu 1536
host_r8169> ifconfig eth0 mtu 1536
host_good>  ping host_r8169
Ok
host_good>  ping -s 1500 host_r8169
Fail
host_good>  ifconfig eth0 mtu 7000
host_r8169> ifconfig eth0 mtu 7000
host_good>  ping -s 1500 host_r8169
Ok

Bonus: got rid of magic number 8

Signed-off-by: Raimonds Cicans <ray@apollo.lv>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/net/r8169.c