linux-hardened/drivers/net
Michal Schmidt aee77e4acc r8169: use unlimited DMA burst for TX
The r8169 driver currently limits the DMA burst for TX to 1024 bytes. I have
a box where this prevents the interface from using the gigabit line to its full
potential. This patch solves the problem by setting TX_DMA_BURST to unlimited.

The box has an ASRock B75M motherboard with on-board RTL8168evl/8111evl
(XID 0c900880). TSO is enabled.

I used netperf (TCP_STREAM test) to measure the dependency of TX throughput
on MTU. I did it for three different values of TX_DMA_BURST ('5'=512, '6'=1024,
'7'=unlimited). This chart shows the results:
http://michich.fedorapeople.org/r8169/r8169-effects-of-TX_DMA_BURST.png

Interesting points:
 - With the current DMA burst limit (1024):
   - at the default MTU=1500 I get only 842 Mbit/s.
   - when going from small MTU, the performance rises monotonically with
     increasing MTU only up to a peak at MTU=1076 (908 MBit/s). Then there's
     a sudden drop to 762 MBit/s from which the throughput rises monotonically
     again with further MTU increases.
 - With a smaller DMA burst limit (512):
   - there's a similar peak at MTU=1076 and another one at MTU=564.
 - With unlimited DMA burst:
   - at the default MTU=1500 I get nice 940 Mbit/s.
   - the throughput rises monotonically with increasing MTU with no strange
     peaks.

Notice that the peaks occur at MTU sizes that are multiples of the DMA burst
limit plus 52. Why 52? Because:
  20 (IP header) + 20 (TCP header) + 12 (TCP options) = 52

The Realtek-provided r8168 driver (v8.032.00) uses unlimited TX DMA burst too,
except for CFG_METHOD_1 where the TX DMA burst is set to 512 bytes.
CFG_METHOD_1 appears to be the oldest MAC version of "RTL8168B/8111B",
i.e. RTL_GIGA_MAC_VER_11 in r8169. Not sure if this MAC version really needs
the smaller burst limit, or if any other versions have similar requirements.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Acked-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-09-19 19:19:07 -04:00
..
appletalk net: Use PTR_RET rather than if(IS_ERR(.. [1] 2012-08-06 13:30:02 -07:00
arcnet
bonding bonding: add some slack to arp monitoring time limits 2012-08-31 16:37:12 -04:00
caif caif: fix NULL pointer check 2012-07-24 13:54:16 -07:00
can can: mcp251x: avoid repeated frame bug 2012-09-03 20:12:06 +02:00
cris cris: fix eth_v10.c build error 2012-08-03 20:32:31 -07:00
dsa
ethernet r8169: use unlimited DMA burst for TX 2012-09-19 19:19:07 -04:00
fddi fddi: 64 bit bug in smt_add_para() 2012-09-01 22:44:13 -04:00
hamradio
hippi
hyperv net: move and rename netif_notify_peers() 2012-08-14 14:28:23 -07:00
ieee802154 ieee802154: MRF24J40 driver 2012-09-04 14:43:55 -04:00
irda drivers/net/irda: fix error return code 2012-08-20 02:33:21 -07:00
phy netdev/phy: mdio-mux-mmioreg.c should include of_address.h 2012-09-07 17:32:25 -04:00
plip
ppp Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2012-08-22 14:21:38 -07:00
slip
team netlink: Rename pid to portid to avoid confusion 2012-09-10 15:30:41 -04:00
usb Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2012-09-15 11:43:53 -04:00
vmxnet3 vmxnet3: Fix race between dev_open() and register_netdev() 2012-08-15 15:10:42 -07:00
wan ixp4xx_hss: fix build failure due to missing linux/module.h inclusion 2012-09-10 16:15:05 -04:00
wimax wimax/i2400m: use is_zero_ether_addr() instead of memcmp() 2012-08-24 13:30:26 -04:00
wireless Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2012-09-15 11:43:53 -04:00
xen-netback xen/netback: only non-freed SKB is queued into tx_queue 2012-06-29 00:50:20 -07:00
dummy.c net: fix race condition in several drivers when reading stats 2012-07-22 12:12:32 -07:00
eql.c
ifb.c
Kconfig drivers/ieee802154: move ieee802154 drivers to net folder 2012-08-30 13:23:56 -04:00
LICENSE.SRC
loopback.c net: Loopback ifindex is constant now 2012-08-09 16:18:07 -07:00
macvlan.c netdev: make address const in device address management 2012-09-19 16:35:22 -04:00
macvtap.c macvtap: rcu_dereference outside read-lock section 2012-08-12 13:40:48 -07:00
Makefile drivers/ieee802154: move ieee802154 drivers to net folder 2012-08-30 13:23:56 -04:00
mdio.c
mii.c
netconsole.c netconsole: remove a redundant netconsole_target_put() 2012-08-20 02:59:49 -07:00
rionet.c
sb1000.c
Space.c
sungem_phy.c
tun.c Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2012-08-24 18:54:37 -04:00
veth.c veth: Allow to create peer link with given ifindex 2012-08-09 16:18:07 -07:00
virtio_net.c net: move and rename netif_notify_peers() 2012-08-14 14:28:23 -07:00
xen-netfront.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2012-08-31 15:14:18 -04:00