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 net: better IFF_XMIT_DST_RELEASE support 2014-10-07 13:22:11 -04:00
arcnet ARCNET: enable eae arcnet card support 2014-09-29 14:36:26 -04:00
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 defxx: DEFEA's ESIC port I/O decoding cleanup 2014-09-28 17:22:10 -04:00
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 drivers/net/irda/Kconfig: Let SH_IRDA depend on HAS_IOMEM 2014-10-03 15:52:04 -07:00
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 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-10-08 16:22:22 -04:00
usb qmi_wwan: Add support for HP lt4112 LTE/HSPA+ Gobi 4G Modem 2014-11-16 16:04:09 -05:00
vmxnet3 PCI changes for the v3.18 merge window: 2014-10-09 15:03:49 -04:00
wan net: better IFF_XMIT_DST_RELEASE support 2014-10-07 13:22:11 -04:00
wimax kbuild: remove unnecessary "obj- := dummy.o" trick 2014-10-02 13:55:02 +02:00
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 net: better IFF_XMIT_DST_RELEASE support 2014-10-07 13:22:11 -04:00
ifb.c net: better IFF_XMIT_DST_RELEASE support 2014-10-07 13:22:11 -04:00
Kconfig drivers/net: macvtap and tun depend on INET 2014-10-30 23:50:26 -04:00
LICENSE.SRC
loopback.c net: better IFF_XMIT_DST_RELEASE support 2014-10-07 13:22:11 -04:00
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 sungem: Fix global namespace pollution of phy accessors. 2014-08-27 23:07:12 -07:00
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