Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3514224pxf; Mon, 15 Mar 2021 11:13:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcAI3qVSGqN4QFKE9ogL/adN1FuhKJfNWiXuYvTRIRemu/IDYQKn5c1Kn2CDxCXzS6Uc2M X-Received: by 2002:a17:906:c9c2:: with SMTP id hk2mr25322450ejb.244.1615832021341; Mon, 15 Mar 2021 11:13:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832021; cv=none; d=google.com; s=arc-20160816; b=gnspob/fqlEUe7st3FUyVNXxB79Y38g/GMKfo3RVNQdAjQhwNJgRVV6kO9zvIoaz/4 caD1XtQs8OKEqlWeQfBLb0g9gqURHnjLetsy5Nt7gGCCTfUHN99Qen/brZQHDEvKKIOZ DyB6vY4sldaVF7Baz7bg1KezB8VZiL8m2HStDOl6ZsgjF1gJ+DvBTMO2SsNSct/HuHDC P5A7xrFAYrM61Z5qh05+QDKP6NJjWs1DhsxkAXp5yLHayNSdyNFd0ST1Sprk4O+qquJe 5MoJIDLseVxNlnOPdP7ODiWZtzD10wIrhXUhcoKhATX5DVFSbvwPtNyzn0PfXhf8KJGT lSAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Yzq0xF5AIS7YLHyjVxuVvKC7WPopBl7LWIa/suiki+8=; b=GfLBmRvMIT7kDttZYn+R/6CDaWDdjUUbg+uP63GThf93iJ7k/96N0O5NT9Iz5xO8F6 qLwABPo1YZ7S4Qxdf9aT+BNN39Y4CF6/+pYAdIVtxIHtD18ZI8ABEoQXIK+xi4Y1lYZG aLiGZWXVmp6ItW5lzJOIShptwh1xMc/hg3AKRdHGHbqgqoK9ohWI5AZ84JulXh22qzFr 8soJmVtdHqRu7yj0+fyFmVhZmrPVP96/ix5/UQUGF0TzKzy29N4B+q/kM6T4QPxTBe5o 96Ur+mSeBHmZH4dUgbtHmuEKfABp+SEri4YkCmgD3eX722k9jMnXfr4MR6Kdoyaadjol fqjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=EZaehSNf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i6si11139172ejk.722.2021.03.15.11.13.19; Mon, 15 Mar 2021 11:13:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=EZaehSNf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235904AbhCOOLu (ORCPT + 99 others); Mon, 15 Mar 2021 10:11:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:35090 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232042AbhCON5j (ORCPT ); Mon, 15 Mar 2021 09:57:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AE54064EEA; Mon, 15 Mar 2021 13:57:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816658; bh=+WcOxs2d3bxpu0HAkZoKy1Cz0rLKH4efTSekxj2Rajo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EZaehSNfnbb1h3VAOnMFwnQ1Z6wC6FwmrWgbHVi2V9zCKaQVwptcH7Fh0KC52Tetl UmexN1s8GL+b7xh4oLbwCbIEUCOvCqCF0LdcLSeKEYTpH6yyzwcxV45PBL0ZUh47Y7 CEdMiA7B3RMR/kf0R6RxlWaLynRhYjgyUTpY8St8= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maximilian Heyne , "David S. Miller" Subject: [PATCH 5.4 030/168] net: sched: avoid duplicates in classes dump Date: Mon, 15 Mar 2021 14:54:22 +0100 Message-Id: <20210315135551.337945085@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135550.333963635@linuxfoundation.org> References: <20210315135550.333963635@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: Maximilian Heyne commit bfc2560563586372212b0a8aeca7428975fa91fe upstream. This is a follow up of commit ea3274695353 ("net: sched: avoid duplicates in qdisc dump") which has fixed the issue only for the qdisc dump. The duplicate printing also occurs when dumping the classes via tc class show dev eth0 Fixes: 59cc1f61f09c ("net: sched: convert qdisc linked list to hashtable") Signed-off-by: Maximilian Heyne Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/sched/sch_api.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -2157,7 +2157,7 @@ static int tc_dump_tclass_qdisc(struct Q static int tc_dump_tclass_root(struct Qdisc *root, struct sk_buff *skb, struct tcmsg *tcm, struct netlink_callback *cb, - int *t_p, int s_t) + int *t_p, int s_t, bool recur) { struct Qdisc *q; int b; @@ -2168,7 +2168,7 @@ static int tc_dump_tclass_root(struct Qd if (tc_dump_tclass_qdisc(root, skb, tcm, cb, t_p, s_t) < 0) return -1; - if (!qdisc_dev(root)) + if (!qdisc_dev(root) || !recur) return 0; if (tcm->tcm_parent) { @@ -2203,13 +2203,13 @@ static int tc_dump_tclass(struct sk_buff s_t = cb->args[0]; t = 0; - if (tc_dump_tclass_root(dev->qdisc, skb, tcm, cb, &t, s_t) < 0) + if (tc_dump_tclass_root(dev->qdisc, skb, tcm, cb, &t, s_t, true) < 0) goto done; dev_queue = dev_ingress_queue(dev); if (dev_queue && tc_dump_tclass_root(dev_queue->qdisc_sleeping, skb, tcm, cb, - &t, s_t) < 0) + &t, s_t, false) < 0) goto done; done: