From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752670AbdCHPek (ORCPT ); Wed, 8 Mar 2017 10:34:40 -0500 Received: from mx2.suse.de ([195.135.220.15]:50121 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751387AbdCHPee (ORCPT ); Wed, 8 Mar 2017 10:34:34 -0500 Date: Wed, 8 Mar 2017 16:21:36 +0100 (CET) From: Jiri Kosina X-X-Sender: jkosina@pobox.suse.cz To: Eric Dumazet cc: "David S. Miller" , Stephen Hemminger , Jamal Hadi Salim , Phil Sutter , Cong Wang , Daniel Borkmann , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] net: sched: make default fifo qdiscs appear in the dump In-Reply-To: <1488986279.28631.1.camel@edumazet-glaptop3.roam.corp.google.com> Message-ID: References: <1488986279.28631.1.camel@edumazet-glaptop3.roam.corp.google.com> User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 8 Mar 2017, Eric Dumazet wrote: > > +++ b/net/sched/sch_qfq.c > > @@ -494,6 +494,8 @@ static int qfq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, > > goto destroy_class; > > } > > > > + if (cl->qdisc != &noop_qdisc) > > + qdisc_hash_add(cl->qdisc, true); > > > Please move the test in qdisc_hash_add() instead of copy/pasting it all > over the places ? Well, qdisc_hash_add() has a WARN_ON() (inherited from what qdisc_list_add() used to do) for that particular case to catch cases where singleton qdisc would make it there from other places by mistake. By putting this test there we'll effectively giving up on this warning should it ever point to a bug. Thanks, -- Jiri Kosina SUSE Labs