From: Jamal Hadi Salim <jhs@mojatatu•com>
To: John Fastabend <john.fastabend@gmail•com>
Cc: Stephen Hemminger <stephen@networkplumber•org>,
Eric Dumazet <eric.dumazet@gmail•com>,
Tom Herbert <therbert@google•com>,
netdev <netdev@vger•kernel.org>
Subject: Re: locating the 'tc actions' hook
Date: Thu, 01 Aug 2013 07:40:44 -0400 [thread overview]
Message-ID: <51FA493C.8080207@mojatatu.com> (raw)
In-Reply-To: <51F97F4E.5070102@gmail.com>
On 13-07-31 05:19 PM, John Fastabend wrote:
> Hi Jamal,
>
> I'm trying to sort out why I would use 'tc actions' and exactly
> what it is doing.
>
> Its clear I think adding one or more actions to filters will be
> used in the classifier via tcf_exts_exec() through the classify
> hook called from a qdisc.
>
> This is your standard
>
> # tc filter add ... {u32|fw|tcindex|route|...} ... action ...
>
> When these actions get configured the specific actions tc_action_ops
> will be used to init the action create the hash 'tcf_hash_create' and
> parse the options. All this I can follow in ./net/sched/
>
> But the actions netlink hook does this,
>
> tc_ctl_action()
> tcf_action_add()
> tcf_action_init() <- inserts action in the table
>
> So at this point we have the entry in the table but I must be missing
> where the tc_action_ops act() is going to be called because its not via
> tcf_exts_exec().
>
There are two ways to add actions.
a) you specify a filter followed by a graph of actions to be executed
on a match (yes, in the kernel 10 years before Openflow and still
expressively more powerful;->)
b) You can add actions first, then later specify the filter followed by
a graph of actions. Actions in such a case are referenced by their
table indices.
#a tends to be more popular way of provisioning.
> Am I missing something obvious here? Is there a way to link them to
> filters? Sorry if it turns out to be a stupid question.
>
I think the second use case is what you are bumping into. I know from
answering questions this is a very popular use case in some eastern
European countries (where one policer with a specific rate is shared
by many flows); i think they have a setup where you share your DSL
connection with your neighbors. Its quiet a clever setup.
> My motivation here is to use the filters/actions outside the qdisc lock
> for mq, mqprio, and the ingress qdisc.
>
Are you trying to offload these actions into hardware?
Is the classifier in hardware?
Please let me know if you need further help. Example, I could send you
a bunch of examples for either
cheers,
jamal
> .John
>
next prev parent reply other threads:[~2013-08-01 11:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-31 21:19 locating the 'tc actions' hook John Fastabend
2013-08-01 11:40 ` Jamal Hadi Salim [this message]
2013-08-01 23:18 ` John Fastabend
2013-08-02 18:46 ` John Fastabend
2013-08-03 11:49 ` Jamal Hadi Salim
2013-08-03 11:47 ` Jamal Hadi Salim
2013-08-05 16:11 ` John Fastabend
2013-08-12 0:55 ` Jamal Hadi Salim
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=51FA493C.8080207@mojatatu.com \
--to=jhs@mojatatu$(echo .)com \
--cc=eric.dumazet@gmail$(echo .)com \
--cc=john.fastabend@gmail$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=stephen@networkplumber$(echo .)org \
--cc=therbert@google$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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