From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [net PATCH] net: sched: Fix for duplicate class dump Date: Thu, 18 Oct 2018 16:00:44 -0700 (PDT) Message-ID: <20181018.160044.75473782850101628.davem@davemloft.net> References: <20181018083426.6623-1-phil@nwl.cc> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, edumazet@google.com To: phil@nwl.cc Return-path: Received: from shards.monkeyblade.net ([23.128.96.9]:42232 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725774AbeJSHD5 (ORCPT ); Fri, 19 Oct 2018 03:03:57 -0400 In-Reply-To: <20181018083426.6623-1-phil@nwl.cc> Sender: netdev-owner@vger.kernel.org List-ID: From: Phil Sutter Date: Thu, 18 Oct 2018 10:34:26 +0200 > 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 Applied and queued up for -stable, thanks Phil.