[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1287172905.2799.8.camel@edumazet-laptop>
Date: Fri, 15 Oct 2010 22:01:45 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: Jonathan Thibault <jonathan@...igue.com>
Cc: Patrick McHardy <kaber@...sh.net>, netdev@...r.kernel.org
Subject: Re: large divisor for flow classifier
Le vendredi 15 octobre 2010 à 14:14 -0400, Jonathan Thibault a écrit :
> It appears that when setting a fairly large divisor on the flow classifier for sfq, traffic stops altogether.
>
> On my machine, anything above divisor 2200 seems to stop all traffic. If I want to be fair between hosts (but not flows) for a large network (say 6000 hosts), I run into problems. Obviously the rates here are quite low but this is just an example.
>
> I also tested on a real interface with the same results.
>
> Example that works:
>
> tc qdisc add dev ifb0 root handle 3: htb default 10
> tc class add dev ifb0 parent 3: classid 3:1 htb rate 80kbit
> tc class add dev ifb0 parent 3:1 classid 3:10 htb rate 80kbit
> tc qdisc add dev ifb0 parent 3:10 handle 310: sfq perturb 10
> tc filter add dev ifb0 parent 3: protocol all prio 1 u32 match mark 0x000 0xf00 flowid 3:10
> tc filter add dev ifb0 parent 310: protocol all handle 0x310 flow hash keys dst divisor 1024
>
> Example that doesn't work:
>
> tc qdisc add dev ifb0 root handle 3: htb default 10
> tc class add dev ifb0 parent 3: classid 3:1 htb rate 80kbit
> tc class add dev ifb0 parent 3:1 classid 3:10 htb rate 80kbit
> tc qdisc add dev ifb0 parent 3:10 handle 310: sfq perturb 10
> tc filter add dev ifb0 parent 3: protocol all prio 1 u32 match mark 0x000 0xf00 flowid 3:10
> tc filter add dev ifb0 parent 310: protocol all handle 0x310 flow hash keys dst divisor 6144
>
SFQ is limited to a 1024 divisor
You might try following patch :
(8192 is the smallest power of two greater than 6144)
sizeof(struct sfq_sched_data) becomes 0x2ccc instead of 0x10cc
keep in mind hash distribution is not perfect.
What would be the real rate ?
diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c
index 3cf478d..c4a53d6 100644
--- a/net/sched/sch_sfq.c
+++ b/net/sched/sch_sfq.c
@@ -77,7 +77,7 @@
It is easy to increase these values, but not in flight. */
#define SFQ_DEPTH 128
-#define SFQ_HASH_DIVISOR 1024
+#define SFQ_HASH_DIVISOR 8192
/* This type should contain at least SFQ_DEPTH*2 values */
typedef unsigned char sfq_index;
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists