linux/drivers/net/ethernet
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
..
3com Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-10-08 16:22:22 -04:00
8390
adaptec
adi net: ethernet: Remove superfluous ether_setup after alloc_etherdev 2014-10-03 15:31:40 -07:00
aeroflex
agere et131x: Add PCIe gigabit ethernet driver et131x to drivers/net 2014-10-03 12:22:19 -07:00
allwinner net: ethernet: Remove superfluous ether_setup after alloc_etherdev 2014-10-03 15:31:40 -07:00
alteon
altera Altera TSE: Add support for no PHY 2014-10-05 21:39:40 -04:00
amd amd-xgbe: Fix napi Rx budget accounting 2014-10-22 17:50:31 -04:00
apm drivers: net: xgene: fix: Use separate resources 2014-11-04 17:08:42 -05:00
apple
arc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-09-23 12:09:27 -04:00
atheros
broadcom tg3: fix ring init when there are more TX than RX channels 2014-11-25 15:18:45 -05:00
brocade bna: fix skb->truesize underestimation 2014-10-17 23:56:33 -04:00
cadence net: ethernet: Remove superfluous ether_setup after alloc_etherdev 2014-10-03 15:31:40 -07:00
calxeda net: ethernet: Remove superfluous ether_setup after alloc_etherdev 2014-10-03 15:31:40 -07:00
chelsio cxgb4: Fill in supported link mode for SFP modules 2014-12-02 19:57:49 -08:00
cirrus
cisco enic: update desc properly in rx_copybreak 2014-11-06 16:42:04 -05:00
davicom net: ethernet: Remove superfluous ether_setup after alloc_etherdev 2014-10-03 15:31:40 -07:00
dec
dlink
emulex net: Check for presence of IFLA_AF_SPEC 2014-11-26 15:29:01 -05:00
faraday
freescale net: fec: fix regression on i.MX28 introduced by rx_copybreak support 2014-11-07 12:08:58 -05:00
fujitsu
hisilicon
hp
i825xx
ibm
icplus
intel net: Check for presence of IFLA_AF_SPEC 2014-11-26 15:29:01 -05:00
marvell net: mvneta: fix Tx interrupt delay 2014-12-08 20:41:58 -05:00
mellanox net/mlx4_core: Limit count field to 24 bits in qp_alloc_res 2014-11-26 12:04:49 -05:00
micrel net: ks8842: use dmaengine_terminate_all() API 2014-10-15 21:31:00 +05:30
microchip
moxa net: ethernet: Remove superfluous ether_setup after alloc_etherdev 2014-10-03 15:31:40 -07:00
myricom
natsemi
neterion net: ethernet: neterion: vxge: vxge-main.c: Cleaning up missing null-terminate in conjunction with strncpy 2014-09-15 14:17:00 -04:00
nuvoton net: ethernet: Remove superfluous ether_setup after alloc_etherdev 2014-10-03 15:31:40 -07:00
nvidia
nxp net: ethernet: Remove superfluous ether_setup after alloc_etherdev 2014-10-03 15:31:40 -07:00
octeon
oki-semi pch_gbe: 'select' NET_PTP_CLASSIFY. 2014-09-22 13:25:51 -04:00
packetengines
pasemi
qlogic qlcnic: Implement ndo_gso_check() 2014-11-14 17:12:48 -05:00
qualcomm net: qualcomm: Fix dependency 2014-11-11 18:12:32 -05:00
rdc
realtek r8169:add support for RTL8168EP 2014-10-08 15:58:45 -04:00
renesas sh_eth: Fix sleeping function called from invalid context 2014-11-29 21:16:54 -08:00
samsung
seeq
sfc sfc: don't BUG_ON efx->max_channels == 0 in probe 2014-11-03 15:57:50 -05:00
sgi
silan
sis
smsc smsc911x: power-up phydev before doing a software reset. 2014-11-13 15:09:28 -05:00
stmicro stmmac: platform: Move plat_dat checking earlier 2014-11-29 21:11:16 -08:00
sun sunhme: Add DMA mapping error checks. 2014-11-01 00:23:46 -04:00
tehuti
ti drivers: net: cpsw: Fix TX_IN_SEL offset 2014-11-16 14:20:00 -05:00
tile Merge branch 'for-3.18-consistent-ops' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu 2014-10-15 07:48:18 +02:00
toshiba net: spider_net: avoid using signed char for bitops 2014-10-05 21:15:16 -04:00
tundra
via Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2014-10-07 21:16:26 -04:00
wiznet net: ethernet: Remove superfluous ether_setup after alloc_etherdev 2014-10-03 15:31:40 -07:00
xilinx drivers: net: ethernet: xilinx: xilinx_emaclite: revert the original commit "1db3ddff1602edf2390b7667dcbaa0f71512e3ea" 2014-11-05 16:00:51 -05:00
xircom
xscale
dnet.c
dnet.h
ec_bhf.c
ethoc.c net: ethernet: Remove superfluous ether_setup after alloc_etherdev 2014-10-03 15:31:40 -07:00
fealnx.c
jme.c
jme.h
Kconfig et131x: Add PCIe gigabit ethernet driver et131x to drivers/net 2014-10-03 12:22:19 -07:00
korina.c
lantiq_etop.c net: ethernet: Remove superfluous ether_setup after alloc_etherdev 2014-10-03 15:31:40 -07:00
Makefile et131x: Add PCIe gigabit ethernet driver et131x to drivers/net 2014-10-03 12:22:19 -07:00
netx-eth.c net: ethernet: Remove superfluous ether_setup after alloc_etherdev 2014-10-03 15:31:40 -07:00
s6gmac.c