Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3510396pxf; Mon, 15 Mar 2021 11:08:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCOptyTtaEHqPQou5v9NcwZ6mcIA6fB/ZM3KOz36J3/fyq5F1biwtbqc1I1KHm1yyqsYCw X-Received: by 2002:aa7:cd0e:: with SMTP id b14mr32007771edw.354.1615831695487; Mon, 15 Mar 2021 11:08:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615831695; cv=none; d=google.com; s=arc-20160816; b=ijbL098gzDt3vm1cVdfFxagZdWXg1XJlUY0gzNm9MynGy+i1YV7PjYa3HSFEw1g7V4 qQl7YxF/hZWniV03Fy0B7q/xFsBLVFrsXYvc2CGnvZUmyd8xEwqMh2XkMblA8Bv3DysT 2VglF+RazGbnekNvaLWI1GHHDCiBS2coBjTgEyhJ2MLbHs7sxnVNyUJcov3ZZyDS+WG9 9Gp4m+RVTvOi6rp6vCv3Z/ZaoOhUsREBWouzytqcHFBJLvtjWj/F1t4JhsNaPIhY+7Fr voR0/5KfFwg/H0bOolPSN6zm8ZRKWxDTa0Lsarv4BxP2gFb4Lg9BH885iJFyFOCNUNgu xmqw== 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=OHBi0sYTOIfnbnvwccYj/ilkcVoHqkwRribGBOIng4W2UlInpLnHYcOD5vA4C4S363 /fjicEIhvdH7xNX5rcxkdkyxgBX/Bk2dpmRi+89VaK32d4MvbYpI1T6KQlzfzFmpvtcH jHu/7+ADFFX3lSHVF1nM++oGxQaI+3yBFw3uuxpzWgCa7HI65utsxwRmgJ4FaC8UdwbF /JFtgk1WsK1B7yubqPxUXgxQQsXRK1NEQNHSGh02NHeJp8/GN8MhBfXrNarF53zoaef8 jWKvrqO9EFXXbvIXdHNg7X0qb+zJj6pYEplVeY4u1WcVS8wxvm5UYkju/95C8wgdrdD5 kdpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HuDydGiR; 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 h1si12089406ejf.242.2021.03.15.11.07.45; Mon, 15 Mar 2021 11:08:15 -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=HuDydGiR; 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 S235300AbhCOOIm (ORCPT + 99 others); Mon, 15 Mar 2021 10:08:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:34900 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231737AbhCON6L (ORCPT ); Mon, 15 Mar 2021 09:58:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A3DE164F0C; Mon, 15 Mar 2021 13:57:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816678; bh=u5OynKd7iO5/IG2I3kk480sm9gyr1EaQo0TwBUcaQCc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HuDydGiRs5PLnVkjZTjNAAMeCzO7l3MXNCJMXVZbvW5iDwzhA75wYEX2OdW/AyrFY LtlIfX+t8J4WTTvWGf2VCAnqNkh0h6jWTn3oSTP0QrLC3++nuu7aMYnlRXFbxbO28z tSSsdu2lcR9037tbQhhKXfQc/VRjv8qhyv6MQRWs= 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.11 059/306] net: sched: avoid duplicates in classes dump Date: Mon, 15 Mar 2021 14:52:02 +0100 Message-Id: <20210315135509.639132900@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135507.611436477@linuxfoundation.org> References: <20210315135507.611436477@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: