kernel-ark/net/atm
David Woodhouse ae088d663b atm: br2684: Fix excessive queue bloat
There's really no excuse for an additional wmem_default of buffering
between the netdev queue and the ATM device. Two packets (one in-flight,
and one ready to send) ought to be fine. It's not as if it should take
long to get another from the netdev queue when we need it.

If necessary we can make the queue space configurable later, but I don't
think it's likely to be necessary.

cf. commit 9d02daf754 (pppoatm: Fix
excessive queue bloat) which did something very similar for PPPoATM.

Note that there is a tremendously unlikely race condition which may
result in qspace temporarily going negative. If a CPU running the
br2684_pop() function goes off into the weeds for a long period of time
after incrementing qspace to 1, but before calling netdev_wake_queue()...
and another CPU ends up calling br2684_start_xmit() and *stopping* the
queue again before the first CPU comes back, the netdev queue could
end up being woken when qspace has already reached zero.

An alternative approach to coping with this race would be to check in
br2684_start_xmit() for qspace==0 and return NETDEV_TX_BUSY, but just
using '> 0' and '< 1' for comparison instead of '== 0' and '!= 0' is
simpler. It just warranted a mention of *why* we do it that way...

Move the call to atmvcc->send() to happen *after* the accounting and
potentially stopping the netdev queue, in br2684_xmit_vcc(). This matters
if the ->send() call suffers an immediate failure, because it'll call
br2684_pop() with the offending skb before returning. We want that to
happen *after* we've done the initial accounting for the packet in
question. Also make it return an appropriate success/failure indication
while we're at it.

Tested by running 'ping -l 1000 bottomless.aaisp.net.uk' from within my
network, with only a single PPPoE-over-BR2684 link running. And after
setting txqueuelen on the nas0 interface to something low (5, in fact).
Before the patch, we'd see about 15 packets being queued and a resulting
latency of ~56ms being reached. After the patch, we see only about 8,
which is fairly much what we expect. And a max latency of ~36ms. On this
OpenWRT box, wmem_default is 163840.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Reviewed-by: Krzysztof Mazur <krzysiek@podlesie.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-11-26 17:13:56 -05:00
..
addr.c
addr.h
atm_misc.c atm: eliminate atm_guess_pdu2truesize() 2011-11-26 16:40:30 -05:00
atm_sysfs.c atm: expose ATM device index in sysfs 2011-05-27 13:07:21 -04:00
br2684.c atm: br2684: Fix excessive queue bloat 2012-11-26 17:13:56 -05:00
clip.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
common.c atm: fix info leak in getsockopt(SO_ATMPVC) 2012-08-15 21:36:30 -07:00
common.h atm: Introduce vcc_process_recv_queue 2011-11-22 16:15:42 -05:00
ioctl.c net: Convert net_ratelimit uses to net_<level>_ratelimited 2012-05-15 13:45:03 -04:00
Kconfig
lec_arpc.h
lec.c net: Remove casts to same type 2012-06-04 11:45:11 -04:00
lec.h Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2012-05-22 19:22:50 -07:00
Makefile
mpc.c atm: Convert compare_ether_addr to ether_addr_equal 2012-05-09 20:49:17 -04:00
mpc.h
mpoa_caches.c
mpoa_caches.h
mpoa_proc.c net: cleanup unsigned to unsigned int 2012-04-15 12:44:40 -04:00
pppoatm.c net: use consume_skb() in place of kfree_skb() 2012-06-04 11:27:40 -04:00
proc.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
protocols.h
pvc.c atm: fix info leak via getsockname() 2012-08-15 21:36:30 -07:00
raw.c
resources.c net🏧fix up ENOIOCTLCMD error handling 2012-08-31 16:14:33 -04:00
resources.h
signaling.c net: cleanup unsigned to unsigned int 2012-04-15 12:44:40 -04:00
signaling.h
svc.c net: Add export.h for EXPORT_SYMBOL/THIS_MODULE to non-modules 2011-10-31 19:30:30 -04:00