From patchwork Tue May 30 09:19:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 100691 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2048808vqr; Tue, 30 May 2023 02:29:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7G26Lf/2RY5IL9vg2Yq2ZOPbMkEp/KKWh9FNXgtiZeaPcO2eRO2MDjS6IP4jRBJ21veYdH X-Received: by 2002:a17:90a:6f84:b0:255:53b4:278c with SMTP id e4-20020a17090a6f8400b0025553b4278cmr1839927pjk.36.1685438963396; Tue, 30 May 2023 02:29:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1685438963; cv=pass; d=google.com; s=arc-20160816; b=BbkESTBN4LwqeypUmv+3W1ljqPYBymyQuFXotDzxNAPrjUZ9iCME6DLIFIOklyG17q 1qYIKVFTpHWJ7TrxFT7R2uZ9BsMkrMC0ZwUMN1AXGRixKqfDZ05O8pKwTzwzm2XR1im9 8eKYl205m3d7u+IFtKm94iWxJ+zCAgOU/WSlO9OMVApJdDw7J1tgISPDVwVHT+tBh3fu pKcT2FfZ/KS1xSIRqX+uEwnYn/yjN4DJazWZVIcFN9dQoMDeV+RlcDigaJcVGA1PCAzN d2ENXpwtMbcr1MF/gRiMXq/kiY2Sd4k+xqLKWKwbi9gAjL4gQdaBzXEVg5MNfwaVa+ze RLtg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5g/6xap3XUMNtS4JvEw30zPbTYCVwojNm6btWkb+G98=; b=PqXMIvQGLqAHY0jEgkrT9hqlwS2Dss24a2EtL3BHpgCGomBq8209BgtZ4fSWkMV0AG B5mIZzNlkjenKnFq7+VikQg151Hv2Es11YBq+94d3AIPOMSjw78Vz3ErP+YAhajjd75b jZqe/aDwHwQSQdfvuyPL0ZcB1AenfGsPBw3v/rfArZC48UTXU2SJ4KT4uP+avGzyz1d0 sLw9tHpWdCzeVa0pG3lLrj6T4rQDnt1GZ0X6nHX3COiuhNf2kBaYAQ2Fp4563xdEi+Pj jar1m/gy2z5ZXVf+1r2lk34ceS8AwE3cba7TxnJdL6QT7jVoiN08ElxIVnvAmecxTReq cYQQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=qeQsnPDl; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c7-20020a17090a8d0700b002472cd8ded6si1023969pjo.103.2023.05.30.02.29.12; Tue, 30 May 2023 02:29:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=qeQsnPDl; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231143AbjE3JVb (ORCPT + 99 others); Tue, 30 May 2023 05:21:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230464AbjE3JVA (ORCPT ); Tue, 30 May 2023 05:21:00 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2059.outbound.protection.outlook.com [40.107.6.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01254E64; Tue, 30 May 2023 02:20:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fBpLdRWMN+0erOmuY9ehjKK3pMUTeXqN0NKzwUvXiwq5DCbsDnBhduknTRUERP1LCl9yAZX9PspShcZni6mgqOmQqbkhCkQLGOFLhivuN++R/niiQV7WKZebW5Zpl80DW2ZXGjHjZVaB8iaxJvUeRE8+b2JCGaf94YRHtMCxb2buWpAtH7PXD7+6wJs75do53HdpTz7Ju9NLPA4khvwJRps0dckOQhPRn7o7wTOQzSGTj9N4ZpPhKrGqBzfM3IYangVfGrHe1apbBEYAO0ClXee9GIPnBxVPRXbQYeW05LJe47gDe2GwbKyshs8hnS+pJiEN6bp1Ohpcue6VwByR2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5g/6xap3XUMNtS4JvEw30zPbTYCVwojNm6btWkb+G98=; b=a2oPNVgwmq9aBb+sYuDPc9w/kPEIao3gL/vDVHWjgKYi2cqfNTBPpNEKPvHvamc1QKT3S2KQQ7kTHXJfI5pGZXAxWQOc4hc8awjohRg9OQ3RqweWaMNRbNGXnlYPpkaupVW8zXPvCjX22fHrgEvOvu5g3GTz7JCqK9dCpf61zxLNKYqyXgZ/IQrdvBYFdYTesftA9y06KPrurSNhnEsNFnYlRxmw2ZupSaIWSnMbrN5tWp1ssxSuaGS8CwdvBybE0BKZKf9OiPItdDQAqn9ZChPC946gJwxAOwx3S+TqLWLNKLDFTOaih7482fL15gVxqLrucxfq4I9KRJEZi7dApw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5g/6xap3XUMNtS4JvEw30zPbTYCVwojNm6btWkb+G98=; b=qeQsnPDltiqgVj5m9li79rYxGZqhffez+Or0sAAEk0hPQviP3fSO1JxrfoL9YYWGQrZ7a2yE5rlTdTM3eFInRVGhqV31B15G6vf78mQGlErZnQG3a8+oTQRe2RXPom2/+zx6bkN1lY1dYF6ivTsCZ+3Tfn+x+g5JfmV2hEcoUQM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) by VI1PR04MB7167.eurprd04.prod.outlook.com (2603:10a6:800:12a::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.23; Tue, 30 May 2023 09:20:08 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::b027:17aa:e5f5:4fea]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::b027:17aa:e5f5:4fea%6]) with mapi id 15.20.6433.022; Tue, 30 May 2023 09:20:08 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jamal Hadi Salim , Cong Wang , Jiri Pirko , Vinicius Costa Gomes , Kurt Kanzenbach , Gerhard Engleder , Amritha Nambiar , Ferenc Fejes , Xiaoliang Yang , Roger Quadros , Pranavi Somisetty , Harini Katakam , Giuseppe Cavallaro , Alexandre Torgue , Michael Sit Wei Hong , Mohammad Athari Bin Ismail , Oleksij Rempel , Jacob Keller , linux-kernel@vger.kernel.org, Andrew Lunn , Florian Fainelli , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Jesse Brandeburg , Tony Nguyen , Horatiu Vultur , Jose Abreu , Maxime Coquelin , intel-wired-lan@lists.osuosl.org, Muhammad Husaini Zulkifli Subject: [PATCH net-next 1/5] net/sched: taprio: don't overwrite "sch" variable in taprio_dump_class_stats() Date: Tue, 30 May 2023 12:19:44 +0300 Message-Id: <20230530091948.1408477-2-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230530091948.1408477-1-vladimir.oltean@nxp.com> References: <20230530091948.1408477-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: FR0P281CA0155.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:b3::18) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|VI1PR04MB7167:EE_ X-MS-Office365-Filtering-Correlation-Id: 2c747841-e453-4214-f641-08db60ef0fe5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jM8KtKj/+X7u738DVFFvqyer5vNF9mmsHQ1/AQmfT077zzXk5+6UoCBKq53j24bgMMNKw38ahYRJu+1swmHFKn/hCtwxZcF/kRAidPvZglvqUjfbNMVD/53y6cPAOZ7xIZvjm5LXze33GZToAbPd4AvutfkN7bThyb2W5hAP9stp2VTkC6x25w8tgQ4znihehgbAN/w4tYl54sGA3Jaq3pjZeGuB92rIgKhKKo4n5YhS9N9ON6VGuWbznhWMKjdfFcjJ/SkRfS8yb2PY3DVi7UrpBzsGfqRp6mKIoQ381A4f0/UiSD3b9ZZ4hiBkxkk+Suw7Yn7hX7tUAZT98csxJ6joqbsfmqrYrhdSf2PrXDAsaz30ADwUzrx/ldPQzY62qpMHjJRX8M3bB4lyhHpdFHIpLHAFyZxPNXUdI3UwddnIrvSoc7MgkMueHcO5+tiCV21xPNETKzUg4XpPSXu8JOyXneusSBeBE+d0jLoOdm27MIXKpdBEdO6255BlJvkDzMuLSfUFu0tuu2u5ECTnBvntUFBsZqN4i9YI595XLCFsBpdqGhps4iTOZwOsT5rC5pOuqPOjUeJKRcmRYtEa5aHMga8+V1z2IfzvmBS0TIaIlBNg5ptNSP7i5xq/+BVq X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB6452.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(396003)(346002)(366004)(376002)(451199021)(54906003)(478600001)(38100700002)(38350700002)(66946007)(66556008)(66476007)(6486002)(41300700001)(52116002)(7416002)(7406005)(8676002)(8936002)(5660300002)(86362001)(44832011)(26005)(2906002)(186003)(1076003)(6506007)(6512007)(83380400001)(6916009)(4326008)(316002)(6666004)(2616005)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gxmhnbRTluNUeleYUB/RcUPKLISjXoF4i3pwCXhEvTAGZPZ15b8UtLhMuZ+ouf4ofLCMvvXirXhl5CBQq88hTYUVVyzzBaVOByHemGG2YrdNreSbusKjzXtsLpVzHs6ssrGCECZkYSKbE+CFvn53ENKrNgHXPSHxNEs6dNIEVvCQVfZpNnZwzZIvD8g07InCPNpCpzKNKucQdzL5hTu2uVabKQFs4o1y9QQrO+88fUrNGzw2T5HnbhU8948g4yei2POykV/Xuc7QcwThvUABzTTTuDOxcPAu6axHT5Ou07Yl+27/FqPofx4LcqcAnbgYo4fVwWM+yyQSMDjw2lO6OmIdzE2v/L8RwgSrd4S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xhvjfMrfx95Oq+bIX+HMfGQb85XuHAdZ97IRZx0Ra31ckHaLUyeWymejm3UFyd2GBuKtgpvkUt7OHeCo9I/34BGVt6qjiHB3zldGlHskzQ42+lNhkg1dNY1wj+ytZjQwOXfCO01Goq1JowvkEZNpTqV6a6SaVE0E7/9aQuLw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2c747841-e453-4214-f641-08db60ef0fe5 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2023 09:20:08.5461 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pAahR1QXEwl5kAEfxcOEEEt9EzwhGBvZ1RZ66nvZcECuRLL6lprz+Sjr4gMeaidkHMeLi/N4A5T6cZbKChzUdw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB7167 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767310846288075904?= X-GMAIL-MSGID: =?utf-8?q?1767310846288075904?= In taprio_dump_class_stats() we don't need a reference to the root Qdisc once we get the reference to the child corresponding to this traffic class, so it's okay to overwrite "sch". But in a future patch we will need the root Qdisc too, so create a dedicated "child" pointer variable to hold the child reference. This also makes the code adhere to a more conventional coding style. Signed-off-by: Vladimir Oltean Acked-by: Vinicius Costa Gomes --- net/sched/sch_taprio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c index 76db9a10ef50..d29e6785854d 100644 --- a/net/sched/sch_taprio.c +++ b/net/sched/sch_taprio.c @@ -2388,10 +2388,10 @@ static int taprio_dump_class_stats(struct Qdisc *sch, unsigned long cl, __acquires(d->lock) { struct netdev_queue *dev_queue = taprio_queue_get(sch, cl); + struct Qdisc *child = dev_queue->qdisc_sleeping; - sch = dev_queue->qdisc_sleeping; - if (gnet_stats_copy_basic(d, NULL, &sch->bstats, true) < 0 || - qdisc_qstats_copy(d, sch) < 0) + if (gnet_stats_copy_basic(d, NULL, &child->bstats, true) < 0 || + qdisc_qstats_copy(d, child) < 0) return -1; return 0; }