From: Jamal Hadi Salim <jhs@mojatatu.com>
To: Cong Wang <xiyou.wangcong@gmail.com>, netdev@vger.kernel.org
Cc: Jiri Pirko <jiri@resnulli.us>
Subject: Re: [Patch net v2] net_sched: fix tcm_parent in tc filter dump
Date: Sat, 2 May 2020 05:19:18 -0400 [thread overview]
Message-ID: <a18c1d1a-20a1-7346-4835-6163acb4339b@mojatatu.com> (raw)
In-Reply-To: <7b3e8f90-0e1e-ff59-2378-c6e59c9c1d9e@mojatatu.com>
On 2020-05-02 4:48 a.m., Jamal Hadi Salim wrote:
> On 2020-04-30 11:53 p.m., Cong Wang wrote:
[..]
>> Steps to reproduce this:
>> ip li set dev dummy0 up
>> tc qd add dev dummy0 ingress
>> tc filter add dev dummy0 parent ffff: protocol arp basic action pass
>> tc filter show dev dummy0 root
>>
>> Before this patch:
>> filter protocol arp pref 49152 basic
>> filter protocol arp pref 49152 basic handle 0x1
>> action order 1: gact action pass
>> random type none pass val 0
>> index 1 ref 1 bind 1
>>
>> After this patch:
>> filter parent ffff: protocol arp pref 49152 basic
>> filter parent ffff: protocol arp pref 49152 basic handle 0x1
>> action order 1: gact action pass
>> random type none pass val 0
>> index 1 ref 1 bind 1
>
> Note:
> tc filter show dev dummy0 root
> should not show that filter. OTOH,
> tc filter show dev dummy0 parent ffff:
> should.
>
> root and ffff: are distinct/unique installation hooks.
>
Suprised no one raised this earlier - since it is so
fundamental (we should add a tdc test for it). I went back
to the oldest kernel i have from early 2018 and it was broken..
Cong, your patch is good for the case where we
want to show _all_ filters regardless of where they
were installed but only if no parent is specified. i.e if i did this:
tc filter show dev dummy0
then i am asking to see all the filters for that device.
I am actually not sure if "tc filter show dev dummy0"
ever worked that way - but it makes sense since
no dump-filtering is specified.
To illustrate, I did this:
tc filter add dev dummy0 root protocol arp prio 49151 basic action pass
And now the output looks like:
-------
# tc filter show dev dummy0 ingressfilter protocol arp pref 49151 basic
chain 0
filter protocol arp pref 49151 basic chain 0 handle 0x2
action order 1: gact action pass
random type none pass val 0
index 2 ref 1 bind 1
filter protocol arp pref 49151 basic chain 0 handle 0x1
action order 1: gact action pass
random type none pass val 0
index 1 ref 1 bind 1
# tc filter show dev dummy0 root
filter protocol arp pref 49151 basic chain 0
filter protocol arp pref 49151 basic chain 0 handle 0x2
action order 1: gact action pass
random type none pass val 0
index 2 ref 1 bind 1
filter protocol arp pref 49151 basic chain 0 handle 0x1
action order 1: gact action pass
random type none pass val 0
index 1 ref 1 bind 1
------
If, OTOH, i specified the parent
then only that parents filters should be displayed..
cheers,
jamal
next prev parent reply other threads:[~2020-05-02 9:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-01 3:53 [Patch net v2] net_sched: fix tcm_parent in tc filter dump Cong Wang
2020-05-02 8:48 ` Jamal Hadi Salim
2020-05-02 9:19 ` Jamal Hadi Salim [this message]
2020-05-03 2:28 ` Cong Wang
2020-05-03 12:02 ` Jamal Hadi Salim
2020-05-03 12:48 ` Jamal Hadi Salim
2020-05-04 17:42 ` Cong Wang
2020-05-03 12:50 ` Jamal Hadi Salim
2020-05-04 18:53 ` David Miller
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=a18c1d1a-20a1-7346-4835-6163acb4339b@mojatatu.com \
--to=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=netdev@vger.kernel.org \
--cc=xiyou.wangcong@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.