From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [net PATCH] net: sched: Fix for duplicate class dump Date: Thu, 18 Oct 2018 14:57:42 +0200 Message-ID: <20181018125742.GE4558@nanopsycho.orion> References: <20181018083426.6623-1-phil@nwl.cc> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: David Miller , netdev@vger.kernel.org, Eric Dumazet To: Phil Sutter Return-path: Received: from mail-wr1-f65.google.com ([209.85.221.65]:36912 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726627AbeJRVER (ORCPT ); Thu, 18 Oct 2018 17:04:17 -0400 Received: by mail-wr1-f65.google.com with SMTP id q1-v6so700950wrs.4 for ; Thu, 18 Oct 2018 06:03:21 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20181018083426.6623-1-phil@nwl.cc> Sender: netdev-owner@vger.kernel.org List-ID: Thu, Oct 18, 2018 at 10:34:26AM CEST, phil@nwl.cc wrote: >When dumping classes by parent, kernel would return classes twice: > >| # tc qdisc add dev lo root prio >| # tc class show dev lo >| class prio 8001:1 parent 8001: >| class prio 8001:2 parent 8001: >| class prio 8001:3 parent 8001: >| # tc class show dev lo parent 8001: >| class prio 8001:1 parent 8001: >| class prio 8001:2 parent 8001: >| class prio 8001:3 parent 8001: >| class prio 8001:1 parent 8001: >| class prio 8001:2 parent 8001: >| class prio 8001:3 parent 8001: > >This comes from qdisc_match_from_root() potentially returning the root >qdisc itself if its handle matched. Though in that case, root's classes >were already dumped a few lines above. > >Fixes: cb395b2010879 ("net: sched: optimize class dumps") >Signed-off-by: Phil Sutter Reviewed-by: Jiri Pirko