netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarek Poplawski <jarkao2@gmail.com>
To: Badalian Vyacheslav <slavon@bigtelecom.ru>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: tc filter flow hash question
Date: Tue, 30 Jun 2009 11:09:08 +0000	[thread overview]
Message-ID: <20090630110908.GC8592@ff.dom.local> (raw)
In-Reply-To: <4A49E94E.40209@bigtelecom.ru>

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.

      reply	other threads:[~2009-06-30 11:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090630110908.GC8592@ff.dom.local \
    --to=jarkao2@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=slavon@bigtelecom.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).