* large divisor for flow classifier
@ 2010-10-15 18:14 Jonathan Thibault
2010-10-15 20:01 ` Eric Dumazet
0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Thibault @ 2010-10-15 18:14 UTC (permalink / raw)
To: Patrick McHardy; +Cc: netdev
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
Jonathan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: large divisor for flow classifier
2010-10-15 18:14 large divisor for flow classifier Jonathan Thibault
@ 2010-10-15 20:01 ` Eric Dumazet
2010-10-15 21:10 ` Jarek Poplawski
2010-10-15 23:52 ` Jonathan Thibault
0 siblings, 2 replies; 6+ messages in thread
From: Eric Dumazet @ 2010-10-15 20:01 UTC (permalink / raw)
To: Jonathan Thibault; +Cc: Patrick McHardy, netdev
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;
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: large divisor for flow classifier
2010-10-15 20:01 ` Eric Dumazet
@ 2010-10-15 21:10 ` Jarek Poplawski
2010-10-15 21:45 ` Jarek Poplawski
2010-10-15 23:58 ` Jonathan Thibault
2010-10-15 23:52 ` Jonathan Thibault
1 sibling, 2 replies; 6+ messages in thread
From: Jarek Poplawski @ 2010-10-15 21:10 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Jonathan Thibault, Patrick McHardy, netdev
Eric Dumazet wrote:
> 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.
...
> 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
Because of low SFQ_DEPTH, which limits its queue to 127 packets,
SFQ isn't suitable for serving so many users. There is sch_drr as
a replacement, alas more complex and undocumented, but google should
help you enough.
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=13d2a1d2b032de08d7dcab6a1edcd47802681f96
Jarek P.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: large divisor for flow classifier
2010-10-15 21:10 ` Jarek Poplawski
@ 2010-10-15 21:45 ` Jarek Poplawski
2010-10-15 23:58 ` Jonathan Thibault
1 sibling, 0 replies; 6+ messages in thread
From: Jarek Poplawski @ 2010-10-15 21:45 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Jonathan Thibault, Patrick McHardy, netdev
Jarek Poplawski wrote:
> Because of low SFQ_DEPTH, which limits its queue to 127 packets,
> SFQ isn't suitable for serving so many users. There is sch_drr as
> a replacement, alas more complex and undocumented [...]
Sorry! Actually there is a man page already!
Kudos to Florian!
Jarek P.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: large divisor for flow classifier
2010-10-15 20:01 ` Eric Dumazet
2010-10-15 21:10 ` Jarek Poplawski
@ 2010-10-15 23:52 ` Jonathan Thibault
1 sibling, 0 replies; 6+ messages in thread
From: Jonathan Thibault @ 2010-10-15 23:52 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Patrick McHardy, netdev
Merci beaucoup :),
It at least shows I wasn't just confused about the way it works. In its planned final form, the rate will be set around 175Mbit. I don't need perfect distribution so things should be fine as long as hosts cannot easily cheat their way into having more bandwidth merely by creating more flows.
Jonathan
On 15/10/10 04:01 PM, Eric Dumazet wrote:
> Le vendredi 15 octobre 2010 à 14:14 -0400, Jonathan Thibault a écrit :
>
> 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;
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: large divisor for flow classifier
2010-10-15 21:10 ` Jarek Poplawski
2010-10-15 21:45 ` Jarek Poplawski
@ 2010-10-15 23:58 ` Jonathan Thibault
1 sibling, 0 replies; 6+ messages in thread
From: Jonathan Thibault @ 2010-10-15 23:58 UTC (permalink / raw)
To: Jarek Poplawski; +Cc: Eric Dumazet, Patrick McHardy, netdev
I will certainly look into that.
Jonathan
On 15/10/10 05:10 PM, Jarek Poplawski wrote:
> Eric Dumazet wrote:
>
> Because of low SFQ_DEPTH, which limits its queue to 127 packets,
> SFQ isn't suitable for serving so many users. There is sch_drr as
> a replacement, alas more complex and undocumented, but google should
> help you enough.
>
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=13d2a1d2b032de08d7dcab6a1edcd47802681f96
>
> Jarek P.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-10-15 23:58 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-15 18:14 large divisor for flow classifier Jonathan Thibault
2010-10-15 20:01 ` Eric Dumazet
2010-10-15 21:10 ` Jarek Poplawski
2010-10-15 21:45 ` Jarek Poplawski
2010-10-15 23:58 ` Jonathan Thibault
2010-10-15 23:52 ` Jonathan Thibault
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).