alistair23-linux/drivers/net
willy tarreau aebea2ba0f net: mvneta: fix Tx interrupt delay
The mvneta driver sets the amount of Tx coalesce packets to 16 by
default. Normally that does not cause any trouble since the driver
uses a much larger Tx ring size (532 packets). But some sockets
might run with very small buffers, much smaller than the equivalent
of 16 packets. This is what ping is doing for example, by setting
SNDBUF to 324 bytes rounded up to 2kB by the kernel.

The problem is that there is no documented method to force a specific
packet to emit an interrupt (eg: the last of the ring) nor is it
possible to make the NIC emit an interrupt after a given delay.

In this case, it causes trouble, because when ping sends packets over
its raw socket, the few first packets leave the system, and the first
15 packets will be emitted without an IRQ being generated, so without
the skbs being freed. And since the socket's buffer is small, there's
no way to reach that amount of packets, and the ping ends up with
"send: no buffer available" after sending 6 packets. Running with 3
instances of ping in parallel is enough to hide the problem, because
with 6 packets per instance, that's 18 packets total, which is enough
to grant a Tx interrupt before all are sent.

The original driver in the LSP kernel worked around this design flaw
by using a software timer to clean up the Tx descriptors. This timer
was slow and caused terrible network performance on some Tx-bound
workloads (such as routing) but was enough to make tools like ping
work correctly.

Instead here, we simply set the packet counts before interrupt to 1.
This ensures that each packet sent will produce an interrupt. NAPI
takes care of coalescing interrupts since the interrupt is disabled
once generated.

No measurable performance impact nor CPU usage were observed on small
nor large packets, including when saturating the link on Tx, and this
fixes tools like ping which rely on too small a send buffer. If one
wants to increase this value for certain workloads where it is safe
to do so, "ethtool -C $dev tx-frames" will override this default
setting.

This fix needs to be applied to stable kernels starting with 3.10.

Tested-By: Maggie Mae Roxas <maggie.mae.roxas@gmail.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-12-08 20:41:58 -05:00
..
appletalk
arcnet
bonding bond: Check length of IFLA_BOND_ARP_IP_TARGET attributes 2014-11-29 20:46:32 -08:00
caif
can can: m_can: update to support CAN FD features 2014-11-18 21:35:06 +01:00
cris
dsa net: dsa: bcm_sf2: reset switch prior to initialization 2014-11-26 12:03:56 -05:00
ethernet net: mvneta: fix Tx interrupt delay 2014-12-08 20:41:58 -05:00
fddi
hamradio
hippi
hyperv hyperv: Fix the total_data_buflen in send path 2014-10-22 17:58:50 -04:00
ieee802154 ieee802154: fix error handling in ieee802154fake_probe() 2014-11-16 14:45:14 -05:00
irda
phy net: ptp: fix time stamp matching logic for VLAN packets. 2014-11-12 15:06:17 -05:00
plip
ppp pptp: fix stack info leak in pptp_getname() 2014-11-20 22:43:47 -05:00
slip
team
usb qmi_wwan: Add support for HP lt4112 LTE/HSPA+ Gobi 4G Modem 2014-11-16 16:04:09 -05:00
vmxnet3
wan
wimax
wireless rtlwifi: Change order in device startup 2014-11-25 14:22:22 -05:00
xen-netback xen-netback: do not report success if backend_create_xenvif() fails 2014-11-24 16:14:45 -05:00
dummy.c
eql.c
ifb.c
Kconfig drivers/net: macvtap and tun depend on INET 2014-10-30 23:50:26 -04:00
LICENSE.SRC
loopback.c
macvlan.c macvlan: fix a race on port dismantle and possible skb leaks 2014-10-25 16:24:02 -04:00
macvtap.c macvtap: Fix csum_start when VLAN tags are present 2014-11-03 14:52:20 -05:00
Makefile
mdio.c
mii.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tun.c tun: Fix TUN_PKT_STRIP setting 2014-11-03 14:27:06 -05:00
veth.c
virtio_net.c virtio-net: validate features during probe 2014-11-21 00:26:43 -05:00
vxlan.c vxlan: Fix boolean flip in VXLAN_F_UDP_ZERO_CSUM6_[TX|RX] 2014-11-25 14:12:12 -05:00
xen-netfront.c xen-netfront: Remove BUGs on paged skb data which crosses a page boundary 2014-12-02 19:24:13 -08:00