netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* tc filter flow hash question
@ 2009-06-30  8:12 Badalian Vyacheslav
  2009-06-30  8:57 ` Jarek Poplawski
  0 siblings, 1 reply; 8+ messages in thread
From: Badalian Vyacheslav @ 2009-06-30  8:12 UTC (permalink / raw)
  To: netdev@vger.kernel.org

Hello all.
Sorry for mail to this maillist, but in internet i can't found any
information to understand this situation, lartc list is dead, function
do not documented and only developers understand how it works.

As i understand if i add flow hash i divide speed to KEYs (example to
dst) not for sessions right?

Why if i add simple example my traffic stop and i get DROP at parent class?

This my sample

tc qdisc add dev eth0 root handle 1 htb default 7
class add dev eth0 parent 1: classid 1:7 htb rate 500mbit ceil 1000mbit
prio 3
qdisc add dev eth0 parent 1:7 handle 10: sfq perturb 10
# all normal
tc filter add dev eth0 protocol ip parent 10: handle 2 flow hash keys
src,dst
# all traffic drop

Thanks!
Best regals, Badalian Vyacheslav

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

* Re: tc filter flow hash question
  2009-06-30  8:12 tc filter flow hash question Badalian Vyacheslav
@ 2009-06-30  8:57 ` Jarek Poplawski
  2009-06-30  9:18   ` Badalian Vyacheslav
  0 siblings, 1 reply; 8+ messages in thread
From: Jarek Poplawski @ 2009-06-30  8:57 UTC (permalink / raw)
  To: Badalian Vyacheslav; +Cc: netdev@vger.kernel.org

On 30-06-2009 10:12, Badalian Vyacheslav wrote:
> Hello all.
> Sorry for mail to this maillist, but in internet i can't found any
> information to understand this situation, lartc list is dead, function
> do not documented and only developers understand how it works.

They only pretend they understand how it works...

> 
> As i understand if i add flow hash i divide speed to KEYs (example to
> dst) not for sessions right?
> 
> Why if i add simple example my traffic stop and i get DROP at parent class?
> 
> This my sample
> 
> tc qdisc add dev eth0 root handle 1 htb default 7
> class add dev eth0 parent 1: classid 1:7 htb rate 500mbit ceil 1000mbit
> prio 3
> qdisc add dev eth0 parent 1:7 handle 10: sfq perturb 10
> # all normal
> tc filter add dev eth0 protocol ip parent 10: handle 2 flow hash keys
> src,dst
> # all traffic drop
> 

Here are some hints (if we don't mention google ;-)
http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.29.y.git;a=commitdiff;h=e5dfb815181fcb186d6080ac3a091eadff2d98fe

Regards,
Jarek P.

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

* Re: tc filter flow hash question
  2009-06-30  8:57 ` Jarek Poplawski
@ 2009-06-30  9:18   ` Badalian Vyacheslav
  2009-06-30  9:23     ` Jarek Poplawski
  0 siblings, 1 reply; 8+ messages in thread
From: Badalian Vyacheslav @ 2009-06-30  9:18 UTC (permalink / raw)
  To: Jarek Poplawski; +Cc: netdev@vger.kernel.org

Jarek Poplawski пишет:
> On 30-06-2009 10:12, Badalian Vyacheslav wrote:
>   
>> Hello all.
>> Sorry for mail to this maillist, but in internet i can't found any
>> information to understand this situation, lartc list is dead, function
>> do not documented and only developers understand how it works.
>>     
>
> They only pretend they understand how it works...
>
>   
>> As i understand if i add flow hash i divide speed to KEYs (example to
>> dst) not for sessions right?
>>
>> Why if i add simple example my traffic stop and i get DROP at parent class?
>>
>> This my sample
>>
>> tc qdisc add dev eth0 root handle 1 htb default 7
>> class add dev eth0 parent 1: classid 1:7 htb rate 500mbit ceil 1000mbit
>> prio 3
>> qdisc add dev eth0 parent 1:7 handle 10: sfq perturb 10
>> # all normal
>> tc filter add dev eth0 protocol ip parent 10: handle 2 flow hash keys
>> src,dst
>> # all traffic drop
>>
>>     
>
>   
Yep. I was read this commit and create example based on it.
My question why its drop all traffic after add flow filter? Its simple
must group traffic to sfq qidsc by HASH like equal cost routing by KEY
if i understand. I need balance traffic in class/qdisc by KEY, but not
by sessions.

Any worked example will be great. In commit i see only syntax :)

Thanks!

> Here are some hints (if we don't mention google ;-)
> http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.29.y.git;a=commitdiff;h=e5dfb815181fcb186d6080ac3a091eadff2d98fe
>
> Regards,
> Jarek P.
>
>
>   


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

* Re: tc filter flow hash question
  2009-06-30  9:18   ` Badalian Vyacheslav
@ 2009-06-30  9:23     ` Jarek Poplawski
  2009-06-30  9:49       ` Badalian Vyacheslav
  0 siblings, 1 reply; 8+ messages in thread
From: Jarek Poplawski @ 2009-06-30  9:23 UTC (permalink / raw)
  To: Badalian Vyacheslav; +Cc: netdev@vger.kernel.org

On Tue, Jun 30, 2009 at 01:18:42PM +0400, Badalian Vyacheslav wrote:
> Jarek Poplawski ??????????:
> > On 30-06-2009 10:12, Badalian Vyacheslav wrote:
...
> >> tc qdisc add dev eth0 root handle 1 htb default 7
> >> class add dev eth0 parent 1: classid 1:7 htb rate 500mbit ceil 1000mbit
> >> prio 3
> >> qdisc add dev eth0 parent 1:7 handle 10: sfq perturb 10
> >> # all normal
> >> tc filter add dev eth0 protocol ip parent 10: handle 2 flow hash keys
> >> src,dst
> >> # all traffic drop
> >>
> >>     
> >
> >   
> Yep. I was read this commit and create example based on it.
> My question why its drop all traffic after add flow filter? Its simple
> must group traffic to sfq qidsc by HASH like equal cost routing by KEY
> if i understand. I need balance traffic in class/qdisc by KEY, but not
> by sessions.
> 
> Any worked example will be great. In commit i see only syntax :)

Any non-working example with this syntax? (divisor?)

Jarek P.
> 
> > Here are some hints (if we don't mention google ;-)
> > http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.29.y.git;a=commitdiff;h=e5dfb815181fcb186d6080ac3a091eadff2d98fe
> >
> > Regards,
> > Jarek P.
> >
> >
> >   
> 

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

* Re: tc filter flow hash question
  2009-06-30  9:23     ` Jarek Poplawski
@ 2009-06-30  9:49       ` Badalian Vyacheslav
  2009-06-30  9:56         ` Jarek Poplawski
  0 siblings, 1 reply; 8+ messages in thread
From: Badalian Vyacheslav @ 2009-06-30  9:49 UTC (permalink / raw)
  To: Jarek Poplawski; +Cc: netdev@vger.kernel.org


> On Tue, Jun 30, 2009 at 01:18:42PM +0400, Badalian Vyacheslav wrote:
>   
>> Jarek Poplawski ??????????:
>>     
>>> On 30-06-2009 10:12, Badalian Vyacheslav wrote:
>>>       
> ...
>   
>>>> tc qdisc add dev eth0 root handle 1 htb default 7
>>>> class add dev eth0 parent 1: classid 1:7 htb rate 500mbit ceil 1000mbit
>>>> prio 3
>>>> qdisc add dev eth0 parent 1:7 handle 10: sfq perturb 10
>>>> # all normal
>>>> tc filter add dev eth0 protocol ip parent 10: handle 2 flow hash keys
>>>> src,dst
>>>> # all traffic drop
>>>>
>>>>     
>>>>         
>>>   
>>>       
>> Yep. I was read this commit and create example based on it.
>> My question why its drop all traffic after add flow filter? Its simple
>> must group traffic to sfq qidsc by HASH like equal cost routing by KEY
>> if i understand. I need balance traffic in class/qdisc by KEY, but not
>> by sessions.
>>
>> Any worked example will be great. In commit i see only syntax :)
>>     
>
> Any non-working example with this syntax? (divisor?)
>
>   

This example not approach? 

tc qdisc add dev eth0 root handle 1 htb default 7
tc class add dev eth0 parent 1: classid 1:7 htb rate 500mbit ceil 1000mbit prio 3
tc qdisc add dev eth0 parent 1:7 handle 10: sfq perturb 10

# all traffic go to class 1-7.

# Try group traffic by "src,dst" key

tc filter add dev eth0 protocol ip parent 10: handle 2 flow hash keys src,dst

# all traffic dropped


> Jarek P.
>   
>>> Here are some hints (if we don't mention google ;-)
>>> http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.29.y.git;a=commitdiff;h=e5dfb815181fcb186d6080ac3a091eadff2d98fe
>>>
>>> Regards,
>>> Jarek P

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

* Re: tc filter flow hash question
  2009-06-30  9:49       ` Badalian Vyacheslav
@ 2009-06-30  9:56         ` Jarek Poplawski
  2009-06-30 10:30           ` Badalian Vyacheslav
  0 siblings, 1 reply; 8+ messages in thread
From: Jarek Poplawski @ 2009-06-30  9:56 UTC (permalink / raw)
  To: Badalian Vyacheslav; +Cc: netdev@vger.kernel.org

On Tue, Jun 30, 2009 at 01:49:11PM +0400, Badalian Vyacheslav wrote:
...
> This example not approach? 
> 
> tc qdisc add dev eth0 root handle 1 htb default 7
> tc class add dev eth0 parent 1: classid 1:7 htb rate 500mbit ceil 1000mbit prio 3
> tc qdisc add dev eth0 parent 1:7 handle 10: sfq perturb 10
> 
> # all traffic go to class 1-7.
> 
> # Try group traffic by "src,dst" key
> 
> tc filter add dev eth0 protocol ip parent 10: handle 2 flow hash keys src,dst
> 
> # all traffic dropped

Try:
tc filter add dev eth0 protocol ip parent 10: handle 2 flow hash keys src,dst divisor 1024

Jarek P.
> >   
> >>> Here are some hints (if we don't mention google ;-)
> >>> http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.29.y.git;a=commitdiff;h=e5dfb815181fcb186d6080ac3a091eadff2d98fe
> >>>
> >>> Regards,
> >>> Jarek P

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

* Re: tc filter flow hash question
  2009-06-30  9:56         ` Jarek Poplawski
@ 2009-06-30 10:30           ` Badalian Vyacheslav
  2009-06-30 11:09             ` Jarek Poplawski
  0 siblings, 1 reply; 8+ messages in thread
From: Badalian Vyacheslav @ 2009-06-30 10:30 UTC (permalink / raw)
  To: Jarek Poplawski; +Cc: netdev@vger.kernel.org

Jarek Poplawski пишет:
> On Tue, Jun 30, 2009 at 01:49:11PM +0400, Badalian Vyacheslav wrote:
> ...
>   
>> This example not approach? 
>>
>> tc qdisc add dev eth0 root handle 1 htb default 7
>> tc class add dev eth0 parent 1: classid 1:7 htb rate 500mbit ceil 1000mbit prio 3
>> tc qdisc add dev eth0 parent 1:7 handle 10: sfq perturb 10
>>
>> # all traffic go to class 1-7.
>>
>> # Try group traffic by "src,dst" key
>>
>> tc filter add dev eth0 protocol ip parent 10: handle 2 flow hash keys src,dst
>>
>> # all traffic dropped
>>     
>
> Try:
> tc filter add dev eth0 protocol ip parent 10: handle 2 flow hash keys src,dst divisor 1024
>
>   
Outh! Very thanks! I'm so stupid. its simple :(

Also i look in code and see in flow_classify function this lines:

if (f->divisor)
        classid %= f->divisor;

classid generated in up.
Also i see to SFQ code and see that SFQ create 1024 hashes.
If we do not add divisor when added filter rule we get classid > 1024
and its not go to hash of SFQ (my example).
Also divisor must be > 0 because = NaN as i understand.
I not sure that it must be <= 1024 because it may use not in SFQ and i
don't know MAX size of other qdiscs but if it use only in in SFQ i think
we need to check <= SFQ_HASH_DIVISOR also?

Maybe "if" code must be changed to

if (f->divisor && f->divisor > 0)
        classid %= f->divisor;
else
        classid %= 1024;


How you think?
Best regals, Slavon


> Jarek P.
>   
>>>   
>>>       
>>>>> Here are some hints (if we don't mention google ;-)
>>>>> http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.29.y.git;a=commitdiff;h=e5dfb815181fcb186d6080ac3a091eadff2d98fe
>>>>>
>>>>> Regards,
>>>>> Jarek P
>>>>>           
>
>
>   


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

* Re: tc filter flow hash question
  2009-06-30 10:30           ` Badalian Vyacheslav
@ 2009-06-30 11:09             ` Jarek Poplawski
  0 siblings, 0 replies; 8+ messages in thread
From: Jarek Poplawski @ 2009-06-30 11:09 UTC (permalink / raw)
  To: Badalian Vyacheslav; +Cc: netdev@vger.kernel.org

On Tue, Jun 30, 2009 at 02:30:38PM +0400, Badalian Vyacheslav wrote:
> Jarek Poplawski ??????????:
> > On Tue, Jun 30, 2009 at 01:49:11PM +0400, Badalian Vyacheslav wrote:
> > ...
> >   
> >> This example not approach? 
> >>
> >> tc qdisc add dev eth0 root handle 1 htb default 7
> >> tc class add dev eth0 parent 1: classid 1:7 htb rate 500mbit ceil 1000mbit prio 3
> >> tc qdisc add dev eth0 parent 1:7 handle 10: sfq perturb 10
> >>
> >> # all traffic go to class 1-7.
> >>
> >> # Try group traffic by "src,dst" key
> >>
> >> tc filter add dev eth0 protocol ip parent 10: handle 2 flow hash keys src,dst
> >>
> >> # all traffic dropped
> >>     
> >
> > Try:
> > tc filter add dev eth0 protocol ip parent 10: handle 2 flow hash keys src,dst divisor 1024
> >
> >   
> Outh! Very thanks! I'm so stupid. its simple :(
> 
> Also i look in code and see in flow_classify function this lines:
> 
> if (f->divisor)
>         classid %= f->divisor;
> 
> classid generated in up.
> Also i see to SFQ code and see that SFQ create 1024 hashes.
> If we do not add divisor when added filter rule we get classid > 1024
> and its not go to hash of SFQ (my example).
> Also divisor must be > 0 because = NaN as i understand.
> I not sure that it must be <= 1024 because it may use not in SFQ and i
> don't know MAX size of other qdiscs but if it use only in in SFQ i think
> we need to check <= SFQ_HASH_DIVISOR also?
> 
> Maybe "if" code must be changed to
> 
> if (f->divisor && f->divisor > 0)
>         classid %= f->divisor;
> else
>         classid %= 1024;
> 
> 
> How you think?

I guess the author preferred to signal that something is misconfigured
with drops, but you could try to send a patch or ask him to make sure.

Btw., sfq isn't very useful with real 1024 or even much less flows, so
you should probably start looking for sch_drr with cls_flow examples
(there were a few of them on the list).

Best regards,
Jarek P.

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

end of thread, other threads:[~2009-06-30 11:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-30  8:12 tc filter flow hash question Badalian Vyacheslav
2009-06-30  8:57 ` Jarek Poplawski
2009-06-30  9:18   ` Badalian Vyacheslav
2009-06-30  9:23     ` Jarek Poplawski
2009-06-30  9:49       ` Badalian Vyacheslav
2009-06-30  9:56         ` Jarek Poplawski
2009-06-30 10:30           ` Badalian Vyacheslav
2009-06-30 11:09             ` Jarek Poplawski

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).