[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <82f9f756-a49b-9aa9-5b1c-52cddf9997a5@mojatatu.com>
Date: Sun, 3 May 2020 08:50:38 -0400
From: Jamal Hadi Salim <jhs@...atatu.com>
To: Cong Wang <xiyou.wangcong@...il.com>, netdev@...r.kernel.org
Cc: Jiri Pirko <jiri@...nulli.us>
Subject: Re: [Patch net v2] net_sched: fix tcm_parent in tc filter dump
On 2020-04-30 11:53 p.m., Cong Wang wrote:
> When we tell kernel to dump filters from root (ffff:ffff),
> those filters on ingress (ffff:0000) are matched, but their
> true parents must be dumped as they are. However, kernel
> dumps just whatever we tell it, that is either ffff:ffff
> or ffff:0000:
>
> $ nl-cls-list --dev=dummy0 --parent=root
> cls basic dev dummy0 id none parent root prio 49152 protocol ip match-all
> cls basic dev dummy0 id :1 parent root prio 49152 protocol ip match-all
> $ nl-cls-list --dev=dummy0 --parent=ffff:
> cls basic dev dummy0 id none parent ffff: prio 49152 protocol ip match-all
> cls basic dev dummy0 id :1 parent ffff: prio 49152 protocol ip match-all
>
> This is confusing and misleading, more importantly this is
> a regression since 4.15, so the old behavior must be restored.
>
> And, when tc filters are installed on a tc class, the parent
> should be the classid, rather than the qdisc handle. Commit
> edf6711c9840 ("net: sched: remove classid and q fields from tcf_proto")
> removed the classid we save for filters, we can just restore
> this classid in tcf_block.
>
> 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
>
> Fixes: a10fa20101ae ("net: sched: propagate q and parent from caller down to tcf_fill_node")
> Fixes: edf6711c9840 ("net: sched: remove classid and q fields from tcf_proto")
> Cc: Jamal Hadi Salim <jhs@...atatu.com>
> Cc: Jiri Pirko <jiri@...nulli.us>
> Signed-off-by: Cong Wang <xiyou.wangcong@...il.com>
Acked-by: Jamal Hadi Salim <jhs@...atatu.com>
cheers,
jamal
Powered by blists - more mailing lists