Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3509613pxf; Mon, 15 Mar 2021 11:07:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRmjpCOtVotERInOJkZgRX/DLrK4jr9m8U6Yaew6Sq9DjpZKNXx69qvurIh5f3Hr9BPy6Z X-Received: by 2002:aa7:c9d1:: with SMTP id i17mr30537189edt.46.1615831636948; Mon, 15 Mar 2021 11:07:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615831636; cv=none; d=google.com; s=arc-20160816; b=HNQC1uGBpmH45GnJXQW14UllIAGShNNs9Myvfy9poZyqpelPDl9swWRCAymJuck5sd cAwmMx7AwVwI5BzouIZ7nDPtau2Ja31CzYnT2K07DrhDcMLgP3bXRMEAwfW+ZwiI/WJB bSBJDAzqQOePTMjA9QuwU8+PJ1dVrxKzPdWQ18UHUEOst4tMMEn0spJDDHGESIKCdgFF AB/sYMoH1yn4zRqY73+6EZHBCAlMACtj73KpGpb7gvzkyTxUfZ2UAOZ2dDrXQZAahBYP n7q3//CXfvEnyzj5R3TJj0L+/nYVOCsM7Zq3h4TjAPFHm1n5DCsq9txbK8rc3OmOVdF5 e8+Q== 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=wcpAGdqhDVC1BLusWKitXnc6Uad3s19L7Au1+Y4uGDU=; b=O2raDCiDYrGyYKpBsfGpl7mrFcoJRHDaZjmmMYm3ooTA+zQnFdeuf+EGsFIMsKQdqD oEeeYmCJscBHu1eVutTdBIMapVOrNIrI1VDY1Kn0rbMzA7fJ4sUcfiUU3w4cS/TtOhL0 7P//uTQ6WXa1hPTGcxsSIliVQ19dLb22SHMTHs+AHzk/leZjzzF0ZQozGHikrjTCCVXa BLtBE4ijqCXIPvG6/wMZKHKhrLPQWD7cnQmggIwpPbtE9AHI9MYM8xB21qRpAnSSrwUM 6b8ytM4jyJpPY/wzPFuAlGQwqYmvsRFUOKiuCHl6hfJO8hvQ3MepB7OCUKDt196HBz6u MlSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dNCX632x; 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 f16si11844002edj.210.2021.03.15.11.06.50; Mon, 15 Mar 2021 11:07:16 -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=dNCX632x; 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 S234569AbhCOOIH (ORCPT + 99 others); Mon, 15 Mar 2021 10:08:07 -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 S232002AbhCON6D (ORCPT ); Mon, 15 Mar 2021 09:58:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8143664EED; Mon, 15 Mar 2021 13:57:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816674; bh=u5OynKd7iO5/IG2I3kk480sm9gyr1EaQo0TwBUcaQCc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dNCX632xdhiSeDmzGgN6G7vmixF4nrStGTR5+hXbN9Jw3O+jVG/QshuPexn4+6R0S Pp3mExmtjtTwSGkCMY0i0miuK3U2o5yuIt4+wXSh2DOjbVj/oicZjAjshJGGn8Ul8Q zCZbyhH3GsUVnOpleqEpuZ0r6Ltftgq2AVDG0RHw= 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.10 048/290] net: sched: avoid duplicates in classes dump Date: Mon, 15 Mar 2021 14:52:21 +0100 Message-Id: <20210315135543.550617565@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135541.921894249@linuxfoundation.org> References: <20210315135541.921894249@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 @@ -2167,7 +2167,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; @@ -2178,7 +2178,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) { @@ -2213,13 +2213,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: