Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3522034pxf; Mon, 15 Mar 2021 11:25:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIG64eoy5bS9zr/lAzOjk5CctekTNcl3MuvlaAv27q51yKEJIz6ioTLcVOQgeUgtLjLPVc X-Received: by 2002:a17:906:cb18:: with SMTP id lk24mr9012649ejb.70.1615832724054; Mon, 15 Mar 2021 11:25:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832724; cv=none; d=google.com; s=arc-20160816; b=uPIqyI+u+D9Edq1umR+83NqlVyw2GVeSeb8H8z05uBc1yJ8ndFXRtu3yny8v9HcH+t OkzOxbgLFbNUSboo+jUVdcuVeUDH5dRSqmIs2eN1Cz716rtfesO2G2MTVEJs0IL2WPmc MY+Wg8aqzmACRQIsh3LVChiN6oMX8JoSEFu8Ta/4Zs+wm0rHaeZ1x09a/kZXK2zwGeI1 ee980BlAQ6/Zn41WZ/zTzeZ7XrpACAmem/H4EGo/GEMLKznx6gibLWXPk+fWrIVQmGuo 1wtBpcFAOEexguk9COEs5Sy1JWIDSQ+V6xWyMZni5HJrhfPC8kjZBSydJOSzfxkmZjz+ Jl4g== 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=7y5ONyoE8LnmrprhxRUfbeQL9wmgVKlSrOZEcp/0hms=; b=HrgwfJyluNslRkOvmD2MUD8nxo2Hk1yFY9/6Qj+sbJzo7kWFmkZsCvWXEnUwuF2AmF W2cvnz/F2xTwu6a6XH1iy1w2IL6ASENKFwEzYqTAMWd9SDTzPOLU+hlKRFgYs0MxIAsV Q0ejD9W0fm6OM5doJPi6GyfUZoLXcFv9eM/YlfmDuEbpg8fT40rwrDBEgDbc+sYwUDVQ IF8EuqKJXxmA5rBI3f0MkNh4duMPXDWiHEa7MY2aaPuBiOw6hf4iJ6W/iBC44h3m6vWd xgIOn1aMucL6iVBFRqfJaM8gG1bht+9BBqgOBBBZSArjBB3KD+yx5xFvWWCLQgqr1E5j DFrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=EvLfSvOU; 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 ga18si11608868ejb.632.2021.03.15.11.25.00; Mon, 15 Mar 2021 11:25:24 -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=EvLfSvOU; 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 S231765AbhCOOZg (ORCPT + 99 others); Mon, 15 Mar 2021 10:25:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:38284 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232424AbhCON6z (ORCPT ); Mon, 15 Mar 2021 09:58:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B414964EF5; Mon, 15 Mar 2021 13:58:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816713; bh=c70IG+VB8ncOdGxuRJ1obj0Jia9KWRQxTT5aMZpEW70=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EvLfSvOUkRRXXnCMw/5lES0aq7OXNyKCajhfoghc4DsMGS386V21D7/JlIKZsjywG vIKERyeS+6GqsbDpWK7bvllbSLu+//fEFSmvOAEK0RKggZaTYwGgwrbKnxZ7NkMzGN Ktv9eC0FomuNqlHTxEfngB3jab4Yv/r1M7JOcfd0= 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 4.19 022/120] net: sched: avoid duplicates in classes dump Date: Mon, 15 Mar 2021 14:56:13 +0100 Message-Id: <20210315135720.725983786@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135720.002213995@linuxfoundation.org> References: <20210315135720.002213995@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 @@ -2048,7 +2048,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; @@ -2059,7 +2059,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) { @@ -2094,13 +2094,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: