All of lore.kernel.org
 help / color / mirror / Atom feed
* [STRAW MAN PATCH] sch_teql doesn't load-balance ppp(oatm) slaves
@ 2012-03-22 21:03 David Woodhouse
  2012-03-23  3:03 ` David Miller
  0 siblings, 1 reply; 21+ messages in thread
From: David Woodhouse @ 2012-03-22 21:03 UTC (permalink / raw)
  To: netdev

[-- Attachment #1: Type: text/plain, Size: 2351 bytes --]

ppp_xmit_process() loops, calling skb_dequeue() until it can no longer
push a frame to the channel. In the case of PPPoATM, it's only ever
going to fail to push a frame to the channel when sk->sk_sndbuf is
exceeded on the atm_vcc. We have a *huge* hidden queue there. (Reducing
the send buffer size to 4KiB with a hack in pppoatm_assign_vcc() didn't
fix the teql problem either.)

teql_dequeue() will *always* give up a skb when it's called, if there is
one. If there's *not*, and the tx queue becomes empty, then the device
for which teql_dequeue() was called is 'promoted' to the front of the
line (master->slaves). That device will receive the next packet that
comes in, even if there are other devices which are *also* idle and
waiting for packets. Whenever a new packet comes in, the *last* device
to call teql_dequeue() gets it.

I have a system with two ADSL lines, using PPPoATM and teql. Because of
the behaviour of teql described above, it only seems to use *one* of the
uplinks at a time. One link will be idle for seconds at a time, before
the ATM socket send buffer fills or we get lucky with timing and it
flips to the other device.

My simple 'fix' for this is as follows: if *another* device is already
waiting with its tx queue empty, then teql_dequeue() should *not* return
a new packet to its caller. It may not be the best fix — it may not even
be correct, but it's working and I finally get the full upload bandwidth
of both lines, rather than using only one at a time. The ISP lets me do
a 10-second dump of the traffic on my bonded lines, and I now see it
being properly interleaved between the two lines, making optimal use of
the two uplinks.

Anyone got better ideas?

--- net/sched/sch_teql.c~	2012-03-22 15:21:41.000000000 +0000
+++ net/sched/sch_teql.c	2012-03-22 16:42:28.684436315 +0000
@@ -100,6 +100,10 @@ teql_dequeue(struct Qdisc *sch)
 	struct netdev_queue *dat_queue;
 	struct sk_buff *skb;
 
+	if (dat->m->slaves && dat->m->slaves != sch &&
+	    !qdisc_peek_head(dat->m->slaves)) {
+		return NULL;
+	}
 	skb = __skb_dequeue(&dat->q);
 	dat_queue = netdev_get_tx_queue(dat->m->dev, 0);
 	if (skb == NULL) {

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation



[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 5818 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2012-04-13 17:31 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-22 21:03 [STRAW MAN PATCH] sch_teql doesn't load-balance ppp(oatm) slaves David Woodhouse
2012-03-23  3:03 ` David Miller
2012-03-25 10:43   ` David Woodhouse
2012-03-25 21:36     ` David Miller
2012-03-26  8:32       ` David Woodhouse
2012-03-26  9:45         ` David Woodhouse
2012-03-26 10:03       ` [PATCH] ppp: Don't stop and restart queue on every TX packet David Woodhouse
2012-04-03 21:29         ` David Miller
2012-04-08 19:58           ` David Woodhouse
2012-04-08 20:01             ` ppp: Fix race condition with queue start/stop David Woodhouse
2012-04-13 17:07               ` David Miller
2012-03-27 19:10       ` [STRAW MAN PATCH] sch_teql doesn't load-balance ppp(oatm) slaves David Woodhouse
2012-03-27 19:55         ` Eric Dumazet
2012-03-27 20:35           ` David Woodhouse
2012-04-08 19:53             ` [PATCH] pppoatm: Fix excessive queue bloat David Woodhouse
2012-04-10 14:26               ` chas williams - CONTRACTOR
2012-04-10 20:28                 ` David Woodhouse
2012-04-13 17:04                 ` David Miller
2012-04-13 17:27                   ` David Miller
2012-04-13 17:05               ` David Miller
2012-04-08 19:55             ` David Woodhouse

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.