From patchwork Wed May 31 17:39:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 101555 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3063438vqr; Wed, 31 May 2023 10:52:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5hxcJr5QHMkPbu2hpCBEFQrneApS3/EUFf0sSFGUMhMqhUijwRfVKS2jlPKwx6rCRXKyPk X-Received: by 2002:a9d:5e84:0:b0:6af:a42a:f362 with SMTP id f4-20020a9d5e84000000b006afa42af362mr2891597otl.30.1685555572764; Wed, 31 May 2023 10:52:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1685555572; cv=pass; d=google.com; s=arc-20160816; b=pQ1SEP5vuh6uENcFqoXRlgx5gqtAX1XRCuBMHaO/oqOlI0ucg1FsUz92doLfL/VwWH vIzpX697dLIcskoLgRX0q3a0lt7WiD9V3dfmPrRiH6ZS7KiQvXzjzFFRb1E92d6Rhvpx qUMnCsQ3TutrQE3124uugIYZlQXbZGYYrNxpSosjNNAYj8TC6mTADsslfrEEbUgJ2jtZ bw0GSJkd0N1nEYACC2ydY5Nfj++WgSKNKQvQ0+fBONpKtGLyvLCKF9UzNyxi4uGQeY/H cLmj1auf8OOir/VAx+ojEJFdQF4T486bokt5NMbzx6ubIQcqw1rQtxsjPGok8Z3pNsPh q+/g== 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=ndLEqeL2b89Eb7F6s0vTT7jejVC7IkiJnJ7M56MCyXo=; b=m5i6HFcC+5I5niswz//an2x0pMeGuF7X5oq9t+41u1W0iBF8us2cdrlMK6G4yYPpgc PSDTAoNiFopwPjgkxE4xgTokAMHs7CVFyyymQ3y3BOzpPZ0oiHhTYZCtctYnLmzrttg9 uzH1FlX0dcK0XgVDfZwvH2BHtSCnofC7hDGbpCIQh3hpeEn4FnpZdIvJFJfXQoADkuD2 plOPspqaABgqhRazVxOzee03LDuIPG/l7TYgDGYsd8I8Q2pLiuFQI6jVSGjJlL+5PmVV SQTu6XdlD1Oma1utyR+k2A26yDVy/21uFxWZ4aOu0N4KnDdp1TcNkBIG00v7YeWVXQLx zkrQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=PMnkB9tH; 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 l26-20020a63701a000000b00534919e40fcsi1315771pgc.626.2023.05.31.10.52.39; Wed, 31 May 2023 10:52:52 -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=PMnkB9tH; 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 S229714AbjEaRjv (ORCPT + 99 others); Wed, 31 May 2023 13:39:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229473AbjEaRjt (ORCPT ); Wed, 31 May 2023 13:39:49 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on0615.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0c::615]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4D86128; Wed, 31 May 2023 10:39:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jW62Z6LY0HmLCi/BwkIyd5E4uwUp4ayikY0xyCFNQdCly+rn2mUQjYpHkKShCCBXU1CmPa2/EuqdquGwG2BMbbjoipRx2lcVFna9BiDU+M/aE0880of82fRgJBmJW7p1CFH8ku00zNuQEpw3E41DxNZji6lY4BJ2OYq+zjRloIqNO8MhPFR1+vyGcoDdAHoAx/fhUGzidbELLo9P2b+MG9C97akvSs2B5ufTcaHSF6rIi/veJrrsLsrRghgJdfMQCVjZHBd6UX6vW1UztTPfXrBdW/uj/8O9LJV0ma+FzZTJqXP8XBNZJx38ooXJVyLjJnonvz1JaI2X0ZvUI4Ck5g== 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=ndLEqeL2b89Eb7F6s0vTT7jejVC7IkiJnJ7M56MCyXo=; b=cpyPTXGkSYsoSgab3n7Vdto/EvRjgaxPoEzuGjrCn1E/DFzmBmQXo17U90O8bbRGzlDipnUih/0fmiEsnAGKjmwx6wQQDyTdSz+1DfFcemFzxQN3f4FkgIo0w+oBKBSvrfNvM8tJk32cJSr3E4nyycwYRmXeJ5qfAvTi4M7Rsiu3DPycdQ7SLS60GQ7PCkUfizNFIYgzWs6VsH8/43Ufq1XoNeGyu5gJt+ppu1Q00Dw4Uo2YQaYKdKhx9U8KFgljpaet9xix2hmxdlTS0YGxsqHJG8LSXsY+V7OoeNHTxvbchbMjow2O3GSiTTBZgiWCrI5gO4qOH/M3AZXFYgU5Og== 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=ndLEqeL2b89Eb7F6s0vTT7jejVC7IkiJnJ7M56MCyXo=; b=PMnkB9tHemwUleDZCj0z3IDxpdK2GyLXpIzf6wv5MReGOM45OS3B8QZej43n3cZKzpG1RyDi2AIVJ8dROVgVy3DH1VzjvEFlruGl3ggRLMsTDic29CWTmYlc/sJlV5EjoXaDIKWQCSnjXkUm7m7QrSFiwK57XED032nPr0IFPbM= 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 AM9PR04MB8571.eurprd04.prod.outlook.com (2603:10a6:20b:436::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.23; Wed, 31 May 2023 17:39:44 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::47e4:eb1:e83c:fa4a]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::47e4:eb1:e83c:fa4a%4]) with mapi id 15.20.6455.020; Wed, 31 May 2023 17:39:44 +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 , linux-kernel@vger.kernel.org, intel-wired-lan@lists.osuosl.org, Muhammad Husaini Zulkifli , Peilin Ye , Pedro Tammela Subject: [PATCH net-next 1/5] net/sched: taprio: don't access q->qdiscs[] in unoffloaded mode during attach() Date: Wed, 31 May 2023 20:39:24 +0300 Message-Id: <20230531173928.1942027-2-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230531173928.1942027-1-vladimir.oltean@nxp.com> References: <20230531173928.1942027-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: VI1PR08CA0104.eurprd08.prod.outlook.com (2603:10a6:800:d3::30) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|AM9PR04MB8571:EE_ X-MS-Office365-Filtering-Correlation-Id: f2864c92-14b9-42d2-620c-08db61fe04af X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: k0p581ESZcWM8uBthQkcy40wMKjXZ51uAthnCn/M9Jxqd/lSi2YWVvv70AtemOY/RL5KU13PAoZyo2r7+uDmNM2UHmH6zz9L3OP4DEgujDHCumBCtmv5ulQExdTpGnCTVwAxlYQmDWk0oR8iIY/qCIfnQv97XdDd6WCKkbqlXXKJ71sCN88lVB8jg75HrcE88JDm+ggWMgYcFdNyjgmWR/cLcZHo+IGHtFuHFXwWfSlH8TdHNgGzP+OGMHHfoJIcTglOLbkBVXkk57g9744ycQ8E5LZOWWmxAMUzzndXQiZ1pq6CIG8ASnyUyEKFr4juPHsnGTYFQSJ5j8LtQ13UC6C1bWNNv5xrqcz0mAMmWTvO/QuvfPCCiqYGm1c1ATrqrgRpRzORTSoREp6k5LFNx2vU6ZhFPmSnFOcm8bkR7bvkNQ1xCoT8/+qE8s3yGVrTiPxN5vd30m/S1IinZiUQZUXfgP2pnSA+KEI3MS7Y7durJfeWXAs2EC5jJfRlSFoI+iMIr/BJwuTWEFqY1OSvL9vmuPwcUDNQ/TKl8m+Q1dH279KVy+fcn0+QoJxVzQxCIeDWvBE02JwS+REj57qSBhQRl5XYd6OFybfpQGexHnTY7vGUBgQ6Bjrfr4g5FrAsd7co0LVMuQvhNOyx5JNrK+rv+LKoYcbYrhS7rlTbYC4= 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)(396003)(39860400002)(366004)(136003)(346002)(376002)(451199021)(4326008)(86362001)(38350700002)(38100700002)(478600001)(2616005)(66946007)(66476007)(83380400001)(66556008)(54906003)(6916009)(2906002)(6666004)(1076003)(186003)(26005)(6486002)(6512007)(316002)(52116002)(6506007)(36756003)(41300700001)(7416002)(44832011)(5660300002)(8676002)(8936002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: VbXoHy80iEo57Xp3XvmOOOxm/ir9Z62d3AR6eyo2SK95/Zq2FZKnABuL5H8pOX+up8VYfejDNDuHvdVVSJvds1FjmMf9RBfR1b/m4yJyhJEXh9Xtg9wYWGqOZSpLDcePZn8+UrVCD0X97RzzMFKPtRxBdyzRL1ExgPAbTuuYCikvCRLTlb5CseIJVyOcNBwXYvR8HGzb1Nlt54V188dobs1ELAXCkP3H0hvYRsB3KyNujg9AyD/ZIQsgPkYtMzA+CnVMCL0hhD+qZ44BOEE5W0d+x6g47QRC+qjXOE8SRgVb03yXZmr/CGDMdVkVtF/+NqSmE4gpr7jR6ROKdaw51JWe42DdUrCNNazvBZJDwyr4wq8QCVPRNiaD5+4m7DV2ElFTAzpMZoowp8o+sk2SsxNm+EWeHKeLab2B7Cg63ioLTrbHBuMqGKZP8pnR8Cdvu0U85srMZIDcdn0ElTyKGGVs9CmlaKYfFBGJU7nCIBkQ6PDGjYWRslodH3zQ18MoSL8op/qC9o5pxxvB1MxMVzBdjL7qchLlrSeVoW2D07/Hk4jKZD9jTw6omvW7Z0SwmkD+7hPTU9+5EjcND6rjw4BwlbH18i5hcc9CluR4Wn9icA5uH+RMkAH5hqKBiJq5oVUX/dcKWTGNxV+sqhpJ56vUmI/E/m6KOqCyxh5+9Y8pBXqgqzNs4hOxXi+X4DewH5Mb5CHOPV9ThcT0wLlMTF9YG4hF2bGw8Vv5LzB2DYmLwbmX3n9cVvyh+irX0Jp2udm75NrRMwxFGAvDnH59AZbKiKF4Q63TjOqFb0meGiRJeOcockQ6arKmz+273cA+I0v9XZAmO9pl2z1FDwGs0hJXVdHPpWS2rWdEE9enaEhuuyJbO+VEG85SA98DR13W1oDpO1vrcoNzFR+2GG98LWwY9VK60Psaa5cgfXGa/t3R2iGCJCg84t1uU010k2530oV/TXeT8j3UE7i7WPuU4FfOPTGE+W+8A/HOpEnUtA3H2eoxFKjmffWG+hu6pfm68uNByYpdp5r5bse3JUlD+ZC/6mCRPpWlrQSpGF3+JEg3K9URNwxloKEaecc+DRAQQYXqVF+r0f+Z9L+s04Do9StznfWCAOWUVOkOTs16Ei3XHs3RsK1WQzCj3TdQR/M4ldP76+ekP9/zjKmk90aT3Tzu5gYwHMdultjG5/W3tHJtmOT+pnQ02MlWrhKK7Zt427aGfSrY0LLe2wOERKC8UEHAlAxI/BZlgNdYcwOpKlnI3A+XcuM/cNHcmWwn7qNfJWCQ50Lv1mX58LMiz+12tz+mGPV0QaV8fDiblUzyOetSx1NwO8OvNy/fJ1XNQKeZGv6PnfsKCWke8xLqteWeE+2M84wk21NqdiyVS/BBlPNOlujwzsbHCzDgMoV3tfjsxh27fc+XaZo9M/Yhqcvvx0pkTLrbDxiqO93n76KjfgNwZys2T3VrkZJgYiFsO3yPvt/UgnEHhk0aUeRbgYK9FqT7Fz5S9bfojdC5Hf3L+wOtTm6Dz3p95FoHe5HSMhlUgXSAkt9bAgWt6WV/NlkMq3CokFe7KRVAlno8ghBbHTO5Jhf09b2BLbuA4QcN+CPeIygyfWUP6owEWAIam/zL6Q== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f2864c92-14b9-42d2-620c-08db61fe04af X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2023 17:39:43.2737 (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: nSvgYIHBhoAQ4D8L/00hStMn+FjOQWd7WrqiHtIPIB8+ibMxz5WkKuVq+WwJ2Q72dDEBUt7DZjgmRgfDXITbLQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8571 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,SPF_HELO_PASS, T_SCC_BODY_TEXT_LINE,T_SPF_PERMERROR,URIBL_BLOCKED autolearn=no 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?1767433119959103129?= X-GMAIL-MSGID: =?utf-8?q?1767433119959103129?= This is a simple code transformation with no intended behavior change, just to make it absolutely clear that q->qdiscs[] is only attached to the child taprio classes in full offload mode. Right now we use the q->qdiscs[] variable in taprio_attach() for software mode too, but that is quite confusing and avoidable. We use it only to reach the netdev TX queue, but we could as well just use netdev_get_tx_queue() for that. Signed-off-by: Vladimir Oltean --- net/sched/sch_taprio.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c index 3c4c2c334878..b1c611c72aa4 100644 --- a/net/sched/sch_taprio.c +++ b/net/sched/sch_taprio.c @@ -2130,14 +2130,20 @@ static void taprio_attach(struct Qdisc *sch) /* Attach underlying qdisc */ for (ntx = 0; ntx < dev->num_tx_queues; ntx++) { - struct Qdisc *qdisc = q->qdiscs[ntx]; + struct netdev_queue *dev_queue = netdev_get_tx_queue(dev, ntx); struct Qdisc *old; if (FULL_OFFLOAD_IS_ENABLED(q->flags)) { + struct Qdisc *qdisc = q->qdiscs[ntx]; + qdisc->flags |= TCQ_F_ONETXQUEUE | TCQ_F_NOPARENT; - old = dev_graft_qdisc(qdisc->dev_queue, qdisc); + old = dev_graft_qdisc(dev_queue, qdisc); } else { - old = dev_graft_qdisc(qdisc->dev_queue, sch); + /* In software mode, attach the root taprio qdisc + * to all netdev TX queues, so that dev_qdisc_enqueue() + * goes through taprio_enqueue(). + */ + old = dev_graft_qdisc(dev_queue, sch); qdisc_refcount_inc(sch); } if (old) From patchwork Wed May 31 17:39:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 101558 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3068669vqr; Wed, 31 May 2023 11:00:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4s5Y2V5qCx1ju+pWQ4QrspYqAyCo8lADh/+8ShTiK1PpmX5XZCmQ02cNTZFHKzN7MorqU1 X-Received: by 2002:a05:6a00:aca:b0:64b:43d8:a57d with SMTP id c10-20020a056a000aca00b0064b43d8a57dmr6434588pfl.13.1685556033438; Wed, 31 May 2023 11:00:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1685556033; cv=pass; d=google.com; s=arc-20160816; b=ZG+JOYoi1OiIjeWWrL2tXnuiAQymVuKmkn01VlnxkCDWMcsS5103KCXgPkf+w7Xok+ GqfTvMyNq6aYoTnK0j7LFTcqeE3Y2x/dCHpGLRg42tBhpWoezxdsffFqvSZDC3DQ29eM Kc7juU4j4bTKeuRpw6e4+xGPwmC11TwRS2FZR8ijj1+IxJkLEJUG4qIis8VEJcisSSLP aQAY6Z+xDkMa4x1F1w73uIqj/snZZt/7el2ApdHMWcs1Zh/AKoBkOsi3ThGBmkED/Oq8 Ho5646kMdiZiNHRm/fIu9nAKmRN+QWIthyH8SpfE74/knq1aYSPGnAj/FxDeW4tpdIa1 QYKQ== 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=j2NIe3uM/y4O56qmrtdqLZ6MoKG1xfC+qdNDtgfdlP4=; b=S1p6jkX5RhmaDjJuDEvPQwVi7BnHywwayMX/lAJEN7J05htHMFFEoKcYq5baID025s zRro77DlYVXtig4qK2d6aUBRfQ90PiTUxGYl+/UsPzYmI2if90f5nP0f9xpRtnTdfRQW klCt6sagXMdQUJyP09VfsFprDhBblDHhxyHNOF2rKk7YYNE2ioIMmMRVV7QZruPq2pZ3 byN+0Sb8jOnrz1rdjFCLpBAMFlzDJXkgU23E9ocYuoFSAzSBIj5DDawAb6kSWeXKtnZl PardTURyumhyx1XepFD/X8SDqZDjVDm7/7UXaoqMOWGEUBCiytdVuJk4MzXRP9hBkY3z aOAA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=VGwVRj9b; 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 q21-20020aa78435000000b006501b3c200bsi467312pfn.57.2023.05.31.11.00.18; Wed, 31 May 2023 11:00:33 -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=VGwVRj9b; 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 S230192AbjEaRjx (ORCPT + 99 others); Wed, 31 May 2023 13:39:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229787AbjEaRju (ORCPT ); Wed, 31 May 2023 13:39:50 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on0615.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0c::615]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61EB1BE; Wed, 31 May 2023 10:39:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bBL5Wq8VZw0Yllvm7nPkv0GnZDf4N+e+G8RaNWlPKlrISDOH2niKqD95f+vBU9V+GsxYGwgGxIWZXBzRr8kXqiEkKDbu/jN8i/xIowYiphrA89biJm+CThjkbS7WKsdIlJLUJ04OnkWy13OKNO/513pTB3hwKs2Rdymv2IErp4lOOu18fnqfLZOI8K2bMNXOooLkgCy1pQ9aK9k/Z96F83FGnerdnt5b7CEhoig2PbvlIXaC3nSBriKXzcK2cmHapkhVBT9egWdliOxNKe26o/gC0zubhJ+WlrP1ZzWi+ZxqK42bewgIYgBp+DeaXsiw796gZKICsodGw3ow9DZ10w== 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=j2NIe3uM/y4O56qmrtdqLZ6MoKG1xfC+qdNDtgfdlP4=; b=OS4KRO/ANrecVJWosNLhbgnVt50sUZIleRu9K+J1NxjLwx5B3vEchtPBnB077eB5DgTiNC3QbBWZUz//QkXH73ZoK2W3ZNnMcm56+4kDO7rHXW5Yk8RDhFZrRNsZ3a6bFat/Kkt/Nu5j/F2opkudi110ZJNReGgG1OmkCErkkGwgUn/P7gfemP+9yLLRmjkoWAbw+TPR6Qdea5ongli694TMH2WvGp4Ge6cVPpQQWlVgjtZcDD/r5JQIWJZ4WcUd3wMH7nqKbELw8sVsxmP1W7Ky+BSzcI/PXu219gtPeB8b25I2f86Pu0761m//X9vQjKgAUu3phbLvAdRne7HZng== 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=j2NIe3uM/y4O56qmrtdqLZ6MoKG1xfC+qdNDtgfdlP4=; b=VGwVRj9b7ODhCPzMRHiySbjIqrZgdYDnMptwZgrXxsUf33Lc+8tlNODfaBUBe5lh/keaEFgKpAt6WD0nmUzzPtg6AME8Q3wHHmYcJxNA1BJwgpdoaC0L1TfRBM+t8IzghyDWDiy+vpByQhIXRtjNnkTKTzRZ3TegKUn17wJamEM= 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 AM9PR04MB8571.eurprd04.prod.outlook.com (2603:10a6:20b:436::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.23; Wed, 31 May 2023 17:39:44 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::47e4:eb1:e83c:fa4a]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::47e4:eb1:e83c:fa4a%4]) with mapi id 15.20.6455.020; Wed, 31 May 2023 17:39:44 +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 , linux-kernel@vger.kernel.org, intel-wired-lan@lists.osuosl.org, Muhammad Husaini Zulkifli , Peilin Ye , Pedro Tammela Subject: [PATCH net-next 2/5] net/sched: taprio: keep child Qdisc refcount elevated at 2 in offload mode Date: Wed, 31 May 2023 20:39:25 +0300 Message-Id: <20230531173928.1942027-3-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230531173928.1942027-1-vladimir.oltean@nxp.com> References: <20230531173928.1942027-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: VI1PR08CA0104.eurprd08.prod.outlook.com (2603:10a6:800:d3::30) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|AM9PR04MB8571:EE_ X-MS-Office365-Filtering-Correlation-Id: 84939dca-fbd5-4749-1e28-08db61fe054f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MTD2espPGsy94iLpGMzoLEfDb8AwFmUEUCSUj5ua501BOZ7Qz46nLp2gm1ezoC/hBerJolaK0R6ehW5r9/RXyU6KST1RIXJ1E2J6RXjK6moHDM+Lri1M2znXh+Q5bXKBSZdp8lMPSXLP1MaOib0wykBC7rq7BSVAtcZFZZ6H6HCFWCOd287iy/Y+QkJldE4XPudoZ+QZh+zv57XZFHUKTnnZZ8yr6GJQoPRonmKTE0xWLb8cREm6205L1D/K3CenELP3eHWpv6uJh0sAB5tisxGQXKAB+a3qKiWrnuoPsiDTemUqCfsPBE2BvfSQxKreRRzHeIq1vxGuLkCmw4fyphbBwHVCE7MLoIU1smL4dgCbltDMM2KKwfJXB+t9sYWkjYYdlNxojIw/O1zUby0iAwBfl/ZC+32QX0NmfhbY90cCQRpsLuQQyvaVgGYQW2tmxCz9C0XNSuA0xgzEGLHtT2XuxIPc+kmi/L7Woc/MUI/GAiZwWlktIRqas+IUkt6Qhmrh/dJkltRFp2Zch5f4J7dv3QPL0XNpU/sWQvSxFwwuEj7NtUs58VOdx91o6kPg+BHVPyrIqUBRttFCzgGR9myrN3RBZXkI1uHgceTiEvZQpwn0Q5yPl5Qp8u3V+5NXrQ2yDIDO66Wsl2FVj4qcm6pkrMeHeTA0zKjOThNNzCM= 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)(396003)(39860400002)(366004)(136003)(346002)(376002)(451199021)(4326008)(86362001)(38350700002)(38100700002)(478600001)(2616005)(66946007)(66476007)(83380400001)(66556008)(54906003)(6916009)(2906002)(6666004)(1076003)(186003)(26005)(6486002)(6512007)(316002)(52116002)(6506007)(36756003)(41300700001)(7416002)(44832011)(5660300002)(8676002)(8936002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gJVJCApdLkGsa+O4MpwSZbYHaRA6l+GaNuIh4UuBYmzv/FkhfblxNdO9hchkp/Kmzhp2aAzKY5R8p2dv4vJvLAy4+FvJR+eerwW9Cbj3V2mk58Tm3Dhi7KBg/fRMiDzrKfVwte0CAz+k3phx1cGSEU7S58rm7kBceJZiyCHI+1yLaxAm6hECDQ7hd7FT3feG+AINdxZ66yhewlTfC0gldETD7qK6c4qyRj7vCpY9Wu7CCxxqh0l+bcAJdXV9x6LibG+d59iJVcosZ0USNfDF1Zt8eGX/6Lj90OCPFz5jSV5nGvE5nZ1KXEzlAT+7O9ZxtjUmuaPLAyh0/H7uLVra+4W9TxqTKrRWA8OeAuOMDc2iW0+QivweTT6hF+LPDc12nZy3cLzQ9qCydRnau/rMD9J9aRC0VhvSr4HGa1jxjWHFTk1KETa8u0tF4isBRs6UZkYPX4BIbB3r4aVN313RV5y1vRtQeMKJlSfMYoI6prVWBefNxmedFE1BAYMOuYVj3BqOPZH0/B1VGbz65QSE7KNJ/3ciOBghB5V3T64jFzIJbtsGAtLAvvUVo24knYMnBGjZ2TnS1iQ3Bmv5CwlIvljdZzapnVwpSXoN7HzkbE08vPiADVpFMKtPU15A6T84gOIG/VRUCcSBl0q+sHdTww/v78B3bL2K+vhQ6nfRRfxFAyUO90MfSmxjfW3Y+xUP8pzQQ8Mxsa16me0VVsUovTcNajN9igWO68Ev0BkFgmCPIor/3vRgzF1b02I+Jn5O3Zt/DAvPXNCRQG311ruy2zyG03UFqscF0bSAN/NBOxAsUoMEVOw4R4NpXFL+lQajlCcl19IKvpfheBB1ehqJcyhrVqovmPSL5q6jOadqiUuEPr9qPBQrJZU3rETWNuMk8ue62IPaD3H69+MaGDOkwN/R36AkguBZgpeqQQP6M32hUmGiDHbnTjNhstiMw9mNfJDI+mgPbSoOK39g+SD1bcots6cOmhziMnzUBy4qqXoAOS4xK11W5Rbeo/dku042GVGOtmZlEIpd+HfqUdyIlcuqORjar/WoHQ92ft9XPWyq1+fRxbKwUWOMCQO7C+1RO8UehHjS3wkUyVnOkv5ethJvvuiHEPNLlDMKZvp5GB/ijS43eUvvk4Hk+0BSsHs3tnHg9bp00mJmqQn0lu3rz/CiREHAbYjc9yfn7gZaybPPGqqThSPrbmcceXTF9KU8Z0h4FKuWS2N6Vzjt/H+Lwrjd0rNDGCysyLdknblHPf6IbIzOtrNiu9ttjmV1Hkf3CzII2aXFgJTzS/R4N+oAGYdRFvvKyIxNudqsBJwymwdaMAKyfklfy19aQCE3TUCAY0+50dIlLMv0tq2x0ZItn+LUR55cCrXTCfDczjI2IheXVRksk7uI++5dznDfDjIYidMOajAXjQwqFR8VreQaFWAKE5okRP5ra2CdOgBbx3410yexvOZIlOmoaLklUQ70zkZvt7YDlyHrXAobGMGOAeKl0QyYg/jhPWqEGRHTtg7o1/iEDOP14B2fhcaiIj7Hk4C1SoMygFXOh6IH1gAOQjD2RDwU5RUUhPg/S5D5PHWhPvOUccyzPVfJGvEC72wLhy/RYUyQ6jF7OJHSBbvjMQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 84939dca-fbd5-4749-1e28-08db61fe054f X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2023 17:39:44.3423 (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: 3JeTs6GRglSvhlP6QrrA/ZrhIi+PAYP15HzUYIjwR7L9MXljdic11S9Qtcn4TRf62yySjTp9f6PMmTXFjetrLA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8571 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,SPF_HELO_PASS, T_SCC_BODY_TEXT_LINE,T_SPF_PERMERROR,URIBL_BLOCKED autolearn=no 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?1767433603404217364?= X-GMAIL-MSGID: =?utf-8?q?1767433603404217364?= The taprio qdisc currently lives in the following equilibrium. In the software scheduling case, taprio attaches itself to all TXQs, thus having a refcount of 1 + the number of TX queues. In this mode, q->qdiscs[] is not visible directly to the Qdisc API. The lifetime of the Qdiscs from this private array lasts until qdisc_destroy() -> taprio_destroy(). In the fully offloaded case, the root taprio has a refcount of 1, and all child q->qdiscs[] also have a refcount of 1. The child q->qdiscs[] are visible to the Qdisc API (they are attached to the netdev TXQs directly), however taprio loses a reference to them very early - during qdisc_graft(parent==NULL) -> taprio_attach(). At that time, taprio frees the q->qdiscs[] array to not leak memory, but interestingly, it does not release a reference on these qdiscs because it doesn't effectively own them - they are created by taprio but owned by the Qdisc core, and will be freed by qdisc_graft(parent==NULL, new==NULL) -> qdisc_put(old) when the Qdisc is deleted or when the child Qdisc is replaced with something else. My interest is to change this equilibrium such that taprio also owns a reference on the q->qdiscs[] child Qdiscs for the lifetime of the root Qdisc, including in full offload mode. I want this because I would like taprio_leaf(), taprio_dump_class(), taprio_dump_class_stats() to have insight into q->qdiscs[] for the software scheduling mode - currently they look at dev_queue->qdisc_sleeping, which is, as mentioned, the same as the root taprio. The following set of changes is necessary: - don't free q->qdiscs[] early in taprio_attach(), free it late in taprio_destroy() for consistency with software mode. But: - currently that's not possible, because taprio doesn't own a reference on q->qdiscs[]. So hold that reference - once during the initial attach() and once during subsequent graft() calls when the child is changed. - always keep track of the current child in q->qdiscs[], even for full offload mode, so that we free in taprio_destroy() what we should, and not something stale. Signed-off-by: Vladimir Oltean --- net/sched/sch_taprio.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c index b1c611c72aa4..8807fc915b79 100644 --- a/net/sched/sch_taprio.c +++ b/net/sched/sch_taprio.c @@ -2138,23 +2138,20 @@ static void taprio_attach(struct Qdisc *sch) qdisc->flags |= TCQ_F_ONETXQUEUE | TCQ_F_NOPARENT; old = dev_graft_qdisc(dev_queue, qdisc); + /* Keep refcount of q->qdiscs[ntx] at 2 */ + qdisc_refcount_inc(qdisc); } else { /* In software mode, attach the root taprio qdisc * to all netdev TX queues, so that dev_qdisc_enqueue() * goes through taprio_enqueue(). */ old = dev_graft_qdisc(dev_queue, sch); + /* Keep root refcount at 1 + num_tx_queues */ qdisc_refcount_inc(sch); } if (old) qdisc_put(old); } - - /* access to the child qdiscs is not needed in offload mode */ - if (FULL_OFFLOAD_IS_ENABLED(q->flags)) { - kfree(q->qdiscs); - q->qdiscs = NULL; - } } static struct netdev_queue *taprio_queue_get(struct Qdisc *sch, @@ -2183,15 +2180,24 @@ static int taprio_graft(struct Qdisc *sch, unsigned long cl, if (dev->flags & IFF_UP) dev_deactivate(dev); - if (FULL_OFFLOAD_IS_ENABLED(q->flags)) { + /* In software mode, the root taprio qdisc is still the one attached to + * all netdev TX queues, and hence responsible for taprio_enqueue() to + * forward the skbs to the child qdiscs from the private q->qdiscs[] + * array. So only attach the new qdisc to the netdev queue in offload + * mode, where the enqueue must bypass taprio. However, save the + * reference to the new qdisc in the private array in both cases, to + * have an up-to-date reference to our children. + */ + if (FULL_OFFLOAD_IS_ENABLED(q->flags)) *old = dev_graft_qdisc(dev_queue, new); - } else { + else *old = q->qdiscs[cl - 1]; - q->qdiscs[cl - 1] = new; - } - if (new) + q->qdiscs[cl - 1] = new; + if (new) { + qdisc_refcount_inc(new); new->flags |= TCQ_F_ONETXQUEUE | TCQ_F_NOPARENT; + } if (dev->flags & IFF_UP) dev_activate(dev); From patchwork Wed May 31 17:39:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 101553 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3059895vqr; Wed, 31 May 2023 10:47:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6Acfkz8t0lddRdh6FyoZVHbQBtGPbHyIBRjn7LiAbNC9ex7tugRNPlM4stR4mmhlCQNUly X-Received: by 2002:a9d:7ad9:0:b0:6af:8e73:786b with SMTP id m25-20020a9d7ad9000000b006af8e73786bmr1989722otn.5.1685555240317; Wed, 31 May 2023 10:47:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1685555240; cv=pass; d=google.com; s=arc-20160816; b=DUYXl3/OTCvjGDEg8Gs3Z3LjWyUsVJtkfNo8JkZMwVlKrMcxDjwdDTX/WNkdgvoe2l 6Mf/c9tZeaGeereNEzJJ5sCSBuSGnVfN+XplBbm8iNkHCypUS9yd9EZ1gCSofRFcE+Co r5HYUtCbOrDPEZixrUMsEqshL9ly6WipCQ9Oqa51zPNjAkFuRmJp42UfYUKEA09JlHkE WO3bu34TjrClzdrRhg1BWG1WWbKeqBCkA2N6px8O95nyoGvqgAbjpTDvRHYMwQpkNark HOhqEt5mJ34JxJ9AApN/36Igr1zWKsYeuXU8QXJmjgUGcbacZ398YDU9Td4CSYdbhoNL ZSrg== 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=90aNbYjsFEH0b2vRKI+gD4P2mkOvRG3stxDnfBaWs+U=; b=ZaVzsFhfyxSVkLENerBnYfqbvS9BzBhbGicbhBi857XvN26SjEkCV1bySoSHqM4TRI HVmJm8nkRu2Vrawst+5D74XophYryS+l+cAOk5bs1+IB2thJK8BGHGH6fnApIS5rgZps JMqjdXHWAyBHtqwU1Clxn9AGew/AEU41VXK6SADnNk7ejjaW2eRmkFVg6Tnh/7xZP+lI Pillb7vPX/qHN20jsYM1eKntt3m035/vxpZvs1QpVEYhEDQYCtMswaO10Hdyw9jXQ2SA MGdnt1X3qSZgqcu1XBsjfrre+O3zhlMP2qXZe0wfTCX3RwowUgT/Rvam4Xndb8L+OkBr jlSQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=KhgGkPqS; 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 r144-20020a632b96000000b0052ca7192669si1327343pgr.657.2023.05.31.10.47.07; Wed, 31 May 2023 10:47:20 -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=KhgGkPqS; 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 S230266AbjEaRkM (ORCPT + 99 others); Wed, 31 May 2023 13:40:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230198AbjEaRjw (ORCPT ); Wed, 31 May 2023 13:39:52 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2083.outbound.protection.outlook.com [40.107.22.83]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 162B5125; Wed, 31 May 2023 10:39:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nAlCv4ox4bA9xDYZqdPSd4NIxN2E6JTWb6eNw19ZS0omTV7jRgMSFdNoDxQt2a4ZKj3fzU+bJALYS7OKV0bvd3DlxZWYVEbiC7eBJ5y7CuMUchORLEAkFFi4oeUHyo6S8djLY//jNlZyVDSgELSm2eolykOR5Nr/1bgtmpJd+MZ0C7iL2QZn3IloFejWpuLRCqrEVoxnNcVj0DbqQZKIPRg2/idhTfamHbptfFeZSx/jmIdUkgqq7jQKwpIKOKDomUVcs26GnzFdsZdy2nUqZLFqvwgGi1VGIY7Km+o04dZ12tu3O/rKlmk2f39fj8pDuaG/hRbOxaCMCtkv0mcEUA== 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=90aNbYjsFEH0b2vRKI+gD4P2mkOvRG3stxDnfBaWs+U=; b=GV2QRgahxZYJuj3BVJ0xsTaru4DYCLIlWcm1yRZN8/cwdPnLu2LX/fEtHyg6jE2343M5RtGf/LDFPSyGucCOds0hJ6g3uWB/wuat7fX7L+86Wl1nfocNjE6tFjr/k1V8bSOD9vEWPVud8XOCCInPyFnoRwZwjJK9Qs+DhbOp5Rq53tFFaI8oiSgAevhYCJtccGFqxhO0ndsSxXzrB9z1ah4zdXzmq0QYYohF1fmqgWhIp6TOUkgwd4/KMK2W6tihlWax7JhzdvmeuDnO1hha7S7n4qxS4O5nwfZ/lwA4xG4uqeYQPgJOaYhMBdXyMthe9Yny/lzZTyDdQ/DGbEuuYA== 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=90aNbYjsFEH0b2vRKI+gD4P2mkOvRG3stxDnfBaWs+U=; b=KhgGkPqSL9ig16TMLxBXKZ/35IQhtqgYHz+6cG5ObDret59duRq3AlZ9oMZCS24FAvbG7a0UfYQp5pzyWVp8BA9Mg7DiJZ016ecTuoYNmByMStXc7JFWkYU9Fs2epik4hKUqNW4ZQ6H5tNqInrxPkak8vmtIAVdVTySmxuZqeWk= 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 VI1PR04MB10050.eurprd04.prod.outlook.com (2603:10a6:800:1db::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.24; Wed, 31 May 2023 17:39:45 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::47e4:eb1:e83c:fa4a]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::47e4:eb1:e83c:fa4a%4]) with mapi id 15.20.6455.020; Wed, 31 May 2023 17:39:45 +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 , linux-kernel@vger.kernel.org, intel-wired-lan@lists.osuosl.org, Muhammad Husaini Zulkifli , Peilin Ye , Pedro Tammela Subject: [PATCH net-next 3/5] net/sched: taprio: try again to report q->qdiscs[] to qdisc_leaf() Date: Wed, 31 May 2023 20:39:26 +0300 Message-Id: <20230531173928.1942027-4-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230531173928.1942027-1-vladimir.oltean@nxp.com> References: <20230531173928.1942027-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: VI1PR08CA0104.eurprd08.prod.outlook.com (2603:10a6:800:d3::30) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|VI1PR04MB10050:EE_ X-MS-Office365-Filtering-Correlation-Id: bdf7b1cb-ec94-49a7-6396-08db61fe05f8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: T94K+Jg2DiVhsNZiRuthS8k3vw1TfjQBDYkV9kF/gDVvBDbLhtEpuiR909ZZthX2F9ZQNRDM9HctVNaylnCvETplCJs00XCR6J3aSVn/2KSxmqv3Sm2/67kMEp4tNIukW4ZP/BD6AZ/INsin8qmYSn0BN3JXcNFY2BGCvBStls/TkyxIxEW6P6qOE59ukioCGE6wfw57IFYWzcKutsoDQMqBE2+MQciCQbA8AYeULqw2YCP5u3aPu5TcaLRDzKneJOMb9a0HCsrD63MeKWZ7HomR3kEQJqwR9FELjqnPcA/latZitXG0aT/vXIOk7ajSh6cTDKbDREVDjRwNJWGaskS08Y/qKYdz6rGcOoeGtEIAyj3Xmfa7eeyPk7F75w1aK1EL/4f3fbgK5XNcnOrBxnyc0rLD8PjbXNtbusJPo7Fag3PHHY0qKGi4/0KAGtoisFDrEd69RsYkHBSfPqQmHoYNEeRcVk8SNF6f2qf3n/GmcErkCqdRkaRy3LMjHObCnm+u9qcJJ484wRVojpV1W0AjlMtCazeqXMEf/ePPqWsZjWi+wkKyMuM2tuYcE2qIHaLiCKT92s9B2Z4D2djLN7S0XPd3DEAKAn0+uqgDn+9hfM1z4/V8qjjCkW4CFYND 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)(346002)(39860400002)(366004)(136003)(396003)(376002)(451199021)(2616005)(83380400001)(2906002)(186003)(6666004)(6916009)(4326008)(6486002)(66556008)(52116002)(66946007)(316002)(66476007)(54906003)(478600001)(26005)(7416002)(6512007)(5660300002)(1076003)(6506007)(44832011)(8936002)(8676002)(41300700001)(38350700002)(38100700002)(36756003)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jwuC8KjMP/HIqGiHurK1r6Wai/19KJblJiQOZhKyk9BpxD8HwbK0Kg+HmHmu7lG33rbWzfXwPrqAxgPQe3nA52oKcuPfV7QqLqcCYla+a7WRnQuWTl6RAffYKa5YxPHalDvJRWQisFxGfVL/ZHLGDEok+cLpU1hmttteZNvtiqOH5DUevP84rLoT75G9LUDYCZ989NVniLvf5nYd6CzYA7VqC9Ko0LAlbDEnILAk45qK/bqtb2La5r+WGv/cQ5APDNC6OgDXOfQNC8dbQ0PKD8hkwhZGrrhFYpMihDxFisezC2K0c1ofdVnjSyaA0stQvNSELGSrliE4B4xrp93dKxSEWqZinoWDS2/JdWZvmdBn9FKp09F5vRT3JsIWhnfU0PGHz9FrLuQ/aYk9Su+jYlXWgYONGkDeGgZTZ1RHsBXFepHJxCvwQRHJqOWt1VwdjpJiPzXYjy5BJgU/XD+IFAYig3D/MGMb/if1xvu93TyI0RVONZuF3phUmy63MufHwEuvH/Cj5Q1Fbk9tK2GF6rxaFkmYSmmtjrUPTsh0fBJZc7aaM+QUaVWEIQVHZJ+jwuretViVcL7vIoLRGU/1gm7zGW5Qj4cuYfIMEZ+pG0lt5gfHS8hW5zUor1d/Isr8KbOpUCTdnYen5qcKT6NuMjzNoL7hbk+eCvfzB3bX7Rxr33pxzjxiTWhFUD5SYclbLAvVL2LRjJEQSHb68B9DbuYDtSSdoFpJ5LLS8yR/mEVrBtSbYhP19ulv31DBuZUVBOK5VX+smMFotFgTWNtrIzzARfe5WVmqUA0NlxJGdf8RbHYXo6gUP1/3G+X/611ZJDlzJtM4MiNe4yLXPzfjBTB12pfZNKzVIg+lgqQYbfxymwpIgg0WOHlCtfC/HtWdLK33S6zjE42tDHj0pQhjXHlQLDFjtANWXgPjmZYqRTBwcG5kpyD/inicw9DqYwUi+vlXft/uiB2bmKkIAfj/LGC0I5M62zKbzXSkJlw69mHCywSnD8cfM3be9Hjwxa9LAiFRJu/C9JjIBrVG7Gy4sJN8rLznAcFfyz+IWizp19LZqmCDnbw48WWrYFvdVwMc8t6AGDzendIgHLOIZiMvfM5x0YAv8a11AtJeGaqsSkSKT1bHu0mOe65DzUGQoU8zuTxWkdYFxZHzkyPcO7QF4Tx9FHmJn7QOMzOQUtZZwR2bazmE35iVR53vMj8Khh3vPT1JlT8YYcoVTHMyZj59MM7V46ipduUCbZsxce71l1ZOkM5hPEZSC6MQwYzEjOx39Cz0a/2+qTN8fqZCC+Frev5Z0mkcLO3B95vTA7Wl91m16Gfn50DbcB0LTemBw8HoJkcGLaDDVjTnSjr3wI7XLUGZmFGJA8Wv2XD5U6acmI2qORXveMzjBWXqCpaePLbJxKYV3/URzC1AIzhtQf7TwhEDw9VBy3fRXjjwTI/yRBP9hcnSqcfWqK0hFkX/ep2KhWLWFXU7svJurH3Al3xxORuc42+Pfw+eESmqBZ9f/Vs39R8eatnrdQilp5g3PjLrEXArnDsIuTWBEJgkx65LzMZ5dKJvYd98+bM5UcZkdN0cJnXg4PVciYluknSrZexqk3ZpYV7oCL7tdLodU0z2Ng== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: bdf7b1cb-ec94-49a7-6396-08db61fe05f8 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2023 17:39:45.4658 (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: NA4TMc8A0k0G7h8Vcl4LIshVTn2PO/Xi63OFJGfAAJXUXL1TPyIGF0ioeR0S75jpXoXnF6B3ZnfbtY9+lxpTxw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB10050 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?1767432771781836674?= X-GMAIL-MSGID: =?utf-8?q?1767432771781836674?= This is another stab at commit 1461d212ab27 ("net/sched: taprio: make qdisc_leaf() see the per-netdev-queue pfifo child qdiscs"), later reverted in commit af7b29b1deaa ("Revert "net/sched: taprio: make qdisc_leaf() see the per-netdev-queue pfifo child qdiscs""). I believe that the problems that caused the revert were fixed, and thus, this change is identical to the original patch. Its purpose is to properly reject attaching a software taprio child qdisc to a software taprio parent. Because unoffloaded taprio currently reports itself (the root Qdisc) as the return value from qdisc_leaf(), then the process of attaching another taprio as child to a Qdisc class of the root will just result in a Qdisc_ops :: change() call for the root. Whereas that's not we want. We want Qdisc_ops :: init() to be called for the taprio child, in order to give the taprio child a chance to check whether its sch->parent is TC_H_ROOT or not (and reject this configuration). Signed-off-by: Vladimir Oltean --- net/sched/sch_taprio.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c index 8807fc915b79..263306fe38d8 100644 --- a/net/sched/sch_taprio.c +++ b/net/sched/sch_taprio.c @@ -2433,12 +2433,14 @@ static int taprio_dump(struct Qdisc *sch, struct sk_buff *skb) static struct Qdisc *taprio_leaf(struct Qdisc *sch, unsigned long cl) { - struct netdev_queue *dev_queue = taprio_queue_get(sch, cl); + struct taprio_sched *q = qdisc_priv(sch); + struct net_device *dev = qdisc_dev(sch); + unsigned int ntx = cl - 1; - if (!dev_queue) + if (ntx >= dev->num_tx_queues) return NULL; - return dev_queue->qdisc_sleeping; + return q->qdiscs[ntx]; } static unsigned long taprio_find(struct Qdisc *sch, u32 classid) From patchwork Wed May 31 17:39:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 101557 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3068398vqr; Wed, 31 May 2023 11:00:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4r/Y58FlWUoXOqhi1FzPa0QpmRlzqvzJ5sFYqlWik81dDhBBjiojbW/DyEbyxPIWYqH6Zr X-Received: by 2002:a17:902:f686:b0:1ae:9105:10a5 with SMTP id l6-20020a170902f68600b001ae910510a5mr18973134plg.2.1685556015610; Wed, 31 May 2023 11:00:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1685556015; cv=pass; d=google.com; s=arc-20160816; b=pLjrooY0y2f89oIkXb6lqPt379cH7zcQOD4vItLcn24/3X1IYbYcV3gBPDnK8zGFvb QJebH7HKRI4gjoKvu/vObvbpi/TmVPa1GeyYTGvFCCgAqg6dVVjOu0zj4cmnp9uurTAE upN+aqVHgSz881ownSqAzhCNAXMuweHi2L0vG3EBaMlQvRqNS4M+5nRYppRxauakxsP0 jOagv0EJBvpA3rwzg53qXqVzDtnzt62AdZFd7xbbqoUBKd+dmabCDD7wC+ZR3ZmMrlg4 nIBoCZpEa2WF7okWFcsWQKBgpN9hJKBioaDahqWcBnfArtQoiEoNzodd1NzzPDLlycKG wdRw== 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=0+NnOWzbxJHD6HQCG3aosuF8S27pqBRZN6+CHoAK7RI=; b=Ow4dNT+zNnMQNY9Tpq28XQyvvlLYEbgl51AcjK1A+bnsCitovgTGsrFFYdk/WWQc6W lXj3/eMMNxy7n5ndVCgNBFi8Id5DbrWFchfvm20AI7wwq/9jnyqKHYMd/6A5wT2v639C Re7IAm6ovOebRcLCzJ2cnaw1qSEgE4D82+Em5wvNj0ty1prOuPL7mPb8+kcJScOQrUJr UIk1DbKbh50OxD3LYS+xHOKse7szY2I8DY9+DJbkk4aZL51O1OqWUkjZBVRBN2PlvSB/ f7fIy3nf7N/GVlKXVBOBOJ0U01F2uRzLZR0DJ5Zl3LD+ssdF0/B0Kh3iFFWeC2M4DQw/ r/2A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="FUbEG/ZZ"; 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 q3-20020a17090311c300b001adcdac8969si1251399plh.463.2023.05.31.11.00.02; Wed, 31 May 2023 11:00:15 -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="FUbEG/ZZ"; 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 S230234AbjEaRj5 (ORCPT + 99 others); Wed, 31 May 2023 13:39:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230099AbjEaRju (ORCPT ); Wed, 31 May 2023 13:39:50 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2083.outbound.protection.outlook.com [40.107.22.83]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEAA4126; Wed, 31 May 2023 10:39:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S4sp4uf6fvXxKKhZa9I1f1NssXn3h2tBO4TxuraPb6tTVn6k03gvwWwh58P5xIPnI/WB4COTPJKo9WktFgDnlcezfNNpLspAXboRWkIp4VFEouPnxb6jCW1szEvOTkI9YTj04ertGFggvNX5Do1DXLInefWEeNp2atlekp1gQtinCbccgKMCLDWsaHl/YeWJERWSDG4NC08F8exrEickshi2AKOo7xjVGNkUTqQPY0OhszDxz9py3ErZFpe+C7DhMK8bRoeqgFYoZmdqHgAQ9WjeG9xgu9a9ygtqkFcLrg9be+rcoIcwiItERnYijaqMFEeG/YFWmD63XnomXjCKlQ== 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=0+NnOWzbxJHD6HQCG3aosuF8S27pqBRZN6+CHoAK7RI=; b=JU3ROboTG4uwcWzx/YtMuJFMlzWpG5Tti4CanO6PXcQ7QYSxx9yDs0xhe9E8vXsOLp3sGnqfw3IoCXfgJStvP5IJIWuAc5vPXBIRlz6FsKLB6KFYIpzL6H52o4/ZGTn/O+F6syY+Ey9kVhocF81kEdZqxIqCDNUzq+iK0Sli2QA9R62RHqY5al8506X0hsnCMugsVRhCyEghKn49MnnTjQ6StmH27GyP+ZamEPjQbN0oqZ5G3ssbUBnQelkkkYda5xfylUP/ukZxLIXf/dl8NOnW2BrDQsCdQ0JXwZ190sqc9TmiihuVrYytJAYJmM+NSsvLp+y8U4EXz4FtJtoHMA== 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=0+NnOWzbxJHD6HQCG3aosuF8S27pqBRZN6+CHoAK7RI=; b=FUbEG/ZZRPbHyKa/z8SEDOdcQPCZt0DyKUhIiMpVPh4HnilkmIFSUN/OD3TQk9KwZgCpXYgxzF3wIuo8uKBb4AQ3bmA3m/emDFi1958aXEF8yV3WkuIeEyF2IU1lrdsTXciveAMWJJoThaeAEYbXYi8hJK2io5MvUZ7ej7KEtSU= 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 VI1PR04MB10050.eurprd04.prod.outlook.com (2603:10a6:800:1db::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.24; Wed, 31 May 2023 17:39:46 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::47e4:eb1:e83c:fa4a]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::47e4:eb1:e83c:fa4a%4]) with mapi id 15.20.6455.020; Wed, 31 May 2023 17:39:46 +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 , linux-kernel@vger.kernel.org, intel-wired-lan@lists.osuosl.org, Muhammad Husaini Zulkifli , Peilin Ye , Pedro Tammela Subject: [PATCH net-next 4/5] net/sched: taprio: delete misleading comment about preallocating child qdiscs Date: Wed, 31 May 2023 20:39:27 +0300 Message-Id: <20230531173928.1942027-5-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230531173928.1942027-1-vladimir.oltean@nxp.com> References: <20230531173928.1942027-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: VI1PR08CA0104.eurprd08.prod.outlook.com (2603:10a6:800:d3::30) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|VI1PR04MB10050:EE_ X-MS-Office365-Filtering-Correlation-Id: 05455462-aad9-4000-8207-08db61fe069a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kRf5uDQ0nmZtL6I2Vk+T8ghx0TZh5KU4F/2OW52FKQqN2GOM29DilC/tXFVe+gyCYGuFvMcOO7dykltnnSHkHFoiA+1ql43e1PFA/uOoh3srn+kdYTX2JJlhtK6H/qxPrfs0zrmST+IRxM8+fzub9FeSHHe2y92pTsUXMQD00asz9F7sFcV2RBvSAwk0NbR2/rb83eZG7Q/3DnRrCiVKMLJhA9rvqLT/mEqm7VavMABquHw9s22MLEzepQqKWffPPAAYPCKf8OGvhMBd/+KUF77ET/fnRBg7SZyAP+PigbzT1MzDc5Ji40d/+pXOOQX6OeFQ8IntRgGsokASxC3G73YTqvaIFWzmdeGRpAlH6XswQPLfKy6zFeCxH5lZLvi4Bp6M6wFP43AtwBNXA8q5REUogkQW4cmVdu1Aff1YGJ5TqUkdnEd3lCejwzmwKqGniUbbPROf/ywFAzTSqEv2+gXQ9bd8LSyxhPOYJlzCakWoy7earPdK3E5p0blhiqOfyzShWerg1cqgoYlEQRBs/B5kopGkQ56cZSKSe/j1LWiU/dbecQJJh/tqgSgzndPlqcRFZucPfTu/yTBxGwFOWCZgU6FnpB/gmX6F2GB6BU+/OBA2ZlD4m9AkpcdWnK6Z 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)(346002)(39860400002)(366004)(136003)(396003)(376002)(451199021)(2616005)(83380400001)(2906002)(186003)(6666004)(6916009)(4326008)(6486002)(66556008)(52116002)(66946007)(316002)(66476007)(54906003)(478600001)(26005)(7416002)(6512007)(5660300002)(1076003)(6506007)(44832011)(8936002)(8676002)(41300700001)(38350700002)(38100700002)(36756003)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: hqt6eno75ZWlYicS9HZlNgCVWeT/5E/bsAS9jvmfUDJqEteGl+SwOV1gb8a5uVrY7vNIUqGPDHsx4OCppoEXPH4aNNhK//Ox13OMJw1nSRtihnANjZe5zR1zgOwNdTmF0wDYzKkEHoKXdRdIZNGH80ILHgKLNdewkFUpmaDNtDEX4rDZP01haC2tYmHRFknjrWlhziV4GuRnmj0AF//UZZQ5MB8IpY+rmaKIpra4iNCIA6NbaWqmmGnVwdHYq8ABg1q9B/10gThy3Fa6ktmzfknUw8/EEf/R1oG068ZR/3ORJItngzQiqcxAQiU8LLTYsl4EEKOBUXpQxhTC9sRyTCdE3ZNYh1LGdIWph/kCyAZhxF+D8ku5OP3qkRAYxRTXqaXVjnEutCVKs6phODY9NFMmSpxStiU7tg1f0tNxvZf5xXNWoR+nIy0GHGDwdtXU5y+GfFqX1lAtsX3X+fx6+AZ5gADC4GjDS9hrMrsXsOInoDbZ0eVohshVu7o5Z5iekx4ox7HYk0HQuyBK/AAGB3y84d4syu5kpOaBHUcIstNrb3CY50iF0pZeRRtI0mNczQT1OfLwOxqChKcXwDdBknbHld2NLZ02IlD9VnGGXy+5oNP1JpTPBaL3TfdqhNX8V4kYwT1YiBC9UnbxUuTHHqD0wM5wIHfHpZ8b7k92Iix+eipXPZQoXcQCduzYnzRRJUfk3dFt0N2n5yllW3Ldi6rSK6iqR17ofMqCrurFXi5QlVvin2sPfsb6n3872EIpRiMDXkNWsG0soIxM3WbYBe8etETZY/1jg/se3/EPvZTlkys7auLjWUyqPYhJrv65EgsaDEG0Q0B9mV3tMl9L2PBfAy4pd1GjbHRgA9hLbpsITsmdTw5rkTNeRZqvVxO/AUX7HxrEQCpEV8dYLxGDITbEEB8vO5rQGAj0Gl6r218IKmUbC/0JBHSoyPxg901oluQ4LED2lxV7TFOdw2J39EMsdbfigmgMd6DwVxqmyBGf07kxbTEy12peSW2F+5eB+yBPJC/0js5aWTyBMuiEjnzxfJU12qodrMn0hvQHUNL5ddM1lWLgMHqZ4reOf89ZfiQelWI+6ifyQpID2yk1F3hcyDVCMDx1yrtBxfBNyE3W9gx7rrgsDDgJtGNIZzT1CxA1H0SUCYrzKit4pVAcD9g+9wDQOfT/M/AIjay/yatpniXgGNW8DNaGAPm26BaxfsRCEoINkVj0qLMk6+X4//RYA6f3bQG71Tkann81HQmMvbooRjk6xz6vAfrs4Z6o1uJzF+JtLeRa7YCB8KG+tAWXKNsyqBBNpSeGp5sWamrJZ2V4lDi4cX7ICacD+C21HUtjT0pEUYMD+/AeIZIDj5ZZ6MtIC/tiPWxIcEtAHNUkxgKIiWyFL+CUYJOOBUuq96md3lt6WbvO2nXRzDkXczSxk1F0urZCws2bX+g9gUfH1cKFuK5NXgeOQeHz+hIhvLCdARpYoQDdGeCtCV/CE11xA0sZxPcifEOQ/Yz3R/P1JQDS9BVnQdWqLsv8Ic4zdUJMyWsR6i/tRLZD6YbssxRcv/TZAWSrNNZoclBytm0PhKCJsKpJkglX0r1V3uKlkCJQWz+HoihVo8GRVBK+IQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 05455462-aad9-4000-8207-08db61fe069a X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2023 17:39:46.4921 (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: zDNGHYNOfCMaoYeB+uFutYfsq6tsAb+QHhlXQDYfnfz4X36UmNoQ0BLSrXAeXLzEk+U3At9WC0ec2E3xAdLECA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB10050 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?1767433584351685163?= X-GMAIL-MSGID: =?utf-8?q?1767433584351685163?= As mentioned in commit af7b29b1deaa ("Revert "net/sched: taprio: make qdisc_leaf() see the per-netdev-queue pfifo child qdiscs"") - unlike mqprio, taprio doesn't use q->qdiscs[] only as a temporary transport between Qdisc_ops :: init() and Qdisc_ops :: attach(). Delete the comment, which is just stolen from mqprio, but there, the usage patterns are a lot different, and this is nothing but confusing. Signed-off-by: Vladimir Oltean --- net/sched/sch_taprio.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c index 263306fe38d8..cc7ff98e5e86 100644 --- a/net/sched/sch_taprio.c +++ b/net/sched/sch_taprio.c @@ -2084,11 +2084,8 @@ static int taprio_init(struct Qdisc *sch, struct nlattr *opt, return -EOPNOTSUPP; } - /* pre-allocate qdisc, attachment can't fail */ - q->qdiscs = kcalloc(dev->num_tx_queues, - sizeof(q->qdiscs[0]), + q->qdiscs = kcalloc(dev->num_tx_queues, sizeof(q->qdiscs[0]), GFP_KERNEL); - if (!q->qdiscs) return -ENOMEM; From patchwork Wed May 31 17:39:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 101554 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3061021vqr; Wed, 31 May 2023 10:49:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ79yvzJrKvgPB7m4R8Zgg+QWoleKAMCKesh4kWBwqz6YqqFX31+OKc6Ce7zKMCWb/aqZgk3 X-Received: by 2002:a05:6358:3393:b0:123:33e3:cebf with SMTP id i19-20020a056358339300b0012333e3cebfmr838551rwd.16.1685555347372; Wed, 31 May 2023 10:49:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1685555347; cv=pass; d=google.com; s=arc-20160816; b=Z4udDDGcHR8pLfywkvYOhFp2xd3sempAisMHV2d4ubpIfhjh8l7Z/1B5WwTAt31Vvh qiFBdpwts9nEWFZmSGRNjhciT5ObM9eiZn20Tq7Z6I0zp64+ePUW/U4YpRx2i+N7F0Nt VJT6YqVsfq1phFrXxrGqlP7xZt6uySs6uxWfJvFjpveDUyEj+jsM7cPHL+GAcKCdQBDJ dWlgcm8p4pmco9vRdU1jlOAx7jtU3TEgJqKKwDasbHe1GKCf5yJxozwDMwDwgdRwFDMf iDJV95bnUyix8rNPznoGO0J8n4vOvZkUfTvzMwcx3QjjEp0uBb1GNrC8wpn4NnAQy13t ADnA== 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=GXbdk2K45vsjE10Ud3k19fgs/8bgShOPBxRnB3axMrA=; b=V/NpUEt3SGcQUOhx86EzeqE+FQpkiEhMgWxyL+QkAkKinZCS4iumtktZTN2w1cGyz/ cvB0o7alOZXmoEsiiHVNq38hsHc+3VSYvXWn1a1lMN1eTM3Lg62XFQyvvT6mEVgYijwy bR7u9RcUu2zF4BTfKdVRByRf5JTCNAbIR/59cwBCj2mA3XXGFPGc/z/bibNnsMc1Y8Gd 5AUdLcnVCdbWZD4dcYjrObi9763icVDoSsLpa7TNvjJtKfvCFitTDaggrE2uK5FDfiYY 2JJpvEeQAVIAQd35Ki/pBB8a0jezousO+SRwAEEx1qjqjv3T9xkARjAWM97hVMifOOLc IfQg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="nHuOEl/P"; 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 lx12-20020a17090b4b0c00b0024664356ef7si1334615pjb.152.2023.05.31.10.48.52; Wed, 31 May 2023 10:49:07 -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="nHuOEl/P"; 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 S230233AbjEaRkP (ORCPT + 99 others); Wed, 31 May 2023 13:40:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230211AbjEaRjy (ORCPT ); Wed, 31 May 2023 13:39:54 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2083.outbound.protection.outlook.com [40.107.22.83]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93BD2F2; Wed, 31 May 2023 10:39:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I9z88lKlYHBs/GhaM6ZGU1+q11tBXbguT3xiGiVtjchpbOdAVDx6NDXh8xibV2lkpIEcECFJf0EMUP9Wv2vBM3mljBwzupXikVa5ShAiftLttBSH8cA1sf+85ryZcIE2ZUTrpZVfdeYp2CvHsVdaxzDwS+bz7L7JNiAM/V1f7niZ/W5Uz082k2hRGo40wRrMNX6D3oHVMUniOahhthUblNJ8cOYM+mzDqTSlLXkWJAib1/QJv+6hzsON8uXhMD9YcBHmzYGgR2R6y291KSv2n9qg0u2zmW1T23QQM2QEW/Q2SmFaMvQFOyRMBz/uRtJCoMljUaVg3rPdOwtJCkKbSw== 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=GXbdk2K45vsjE10Ud3k19fgs/8bgShOPBxRnB3axMrA=; b=C+tAbvGM3/DvNqAA7I9GyI0Cr1QDm7wTjBki9VwkvckagnCRo6St2bcy84GK3jb/OEQwCJAaTl+7G++sYA9YmCaF13SyFQRuC1iNbc9iZwBeMnWHRrCT656vZUPZN+fWurvzJ3tki2qeLgK6uvJ32Khd9GDn5j8EocQwb5M9KnNfI/IfmBtOkz0x+ySoqXTV9Fp9pIdb4We21xowDUmREzI1lg6bDtsqLibJPDq2A7Jpnn2Tz2Xq9iVFpMg6p7+iVLjXn23B7lnglgFrGZdBZChpV5R0FLqZb+IOpaf7mKnxB25pr5fuPSPzy9czY/S1DZTnJkdGKa+f3im0hWqOBQ== 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=GXbdk2K45vsjE10Ud3k19fgs/8bgShOPBxRnB3axMrA=; b=nHuOEl/PJWt0K2/10JyhHoaZz6DMw8RUBGNnpvdfZ1WEeKiD3skXfc9Y0OZZpax54Y68x+RE8Qv6akdYN5FdOujOKXQ5fU9GKxzi4HGAlibk8pu+AqEBKQvIJJ2NkwH+P4o/VGVsSE6sNehHhNAMgWNsmb8ldB+A0CkaCzRN3jU= 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 VI1PR04MB10050.eurprd04.prod.outlook.com (2603:10a6:800:1db::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.24; Wed, 31 May 2023 17:39:47 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::47e4:eb1:e83c:fa4a]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::47e4:eb1:e83c:fa4a%4]) with mapi id 15.20.6455.020; Wed, 31 May 2023 17:39:47 +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 , linux-kernel@vger.kernel.org, intel-wired-lan@lists.osuosl.org, Muhammad Husaini Zulkifli , Peilin Ye , Pedro Tammela Subject: [PATCH net-next 5/5] net/sched: taprio: dump class stats for the actual q->qdiscs[] Date: Wed, 31 May 2023 20:39:28 +0300 Message-Id: <20230531173928.1942027-6-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230531173928.1942027-1-vladimir.oltean@nxp.com> References: <20230531173928.1942027-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: VI1PR08CA0104.eurprd08.prod.outlook.com (2603:10a6:800:d3::30) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|VI1PR04MB10050:EE_ X-MS-Office365-Filtering-Correlation-Id: 5736c57b-a037-41a0-7983-08db61fe0735 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 483xk2p9slvyJ6DLZ9jWL+BHN9wBSSppKQvss3Hn+18ICe4mbl2cCy2sYscNY5dRFaIn5NE7TJrOyR+DhZuJIA2nrQwTruBGlgGzQd2fCXPpg1oWqGeUlwkOhmBfKFpA222InnLIxGndXfwliigWba0IC4+uxNb/NqeoBqFLnPAiEdWkD788QMogCsPNDCrXQ04jgiUWBFP7T9mUolW8eYjPjUjXgkdrbo6KsaK9emKta0IZ0LBq3lf2hQlduEpnIBpj2uCU/wbzj9UuSS+G+kcvQozXOWXZcR300X8OThuVEuc3INGZFqU6Pcw9UbVOyD85Zp3mBDn7GkwzaYlbEK1eI14de04ZFtcGL1mqCjl6lUzcN85KrDP66okSMfeVXTqTdyHC2OL77QuMbvrBgsUJT6zCKE2+Fmn76Pigh+URImkNlaOJlNqJ3xLWghHbODrjp3aE2616mhgsntdDZJk54/HwaVeSpl2Cda6+baviS4HtLox8cMy29DkQ2VIorJr0KgsqP6GxWzvwsMsn2aSP19ToX1mBGxLOWFSfpe7G/hyqTgvAxur704DxfyUqufNrRNiwA0TMi7/tZA14W7A7FuMUOVYQ0mvenWXsAsax/DPnyeCyF9sJU088FH2p 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)(346002)(39860400002)(366004)(136003)(396003)(376002)(451199021)(2616005)(83380400001)(2906002)(186003)(6666004)(6916009)(4326008)(6486002)(66556008)(52116002)(66946007)(316002)(66476007)(54906003)(478600001)(26005)(7416002)(6512007)(5660300002)(1076003)(6506007)(44832011)(8936002)(8676002)(41300700001)(38350700002)(38100700002)(36756003)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 2is0X1YsdOpldAR79p1DGt76Iyhrh//wm9XVR456YsLf4MuLdTmsyxMYxLk7nh8ERThGax4pFOrlhvtRdqc9gJGn1FcNBalvw5f8mobgadKYqs76ypV91yZlddpgQh1UgEkWpav2VceosnNN8eIjAsT4XOnbfsS19viDKgXcEt44B0otUNsAXbXxWvwRPHS9zkpRHAnCsTeQyxV5XWNfKoeAOBp0rTDNVQQ8dE589stB9R3C5lJNhX0mVvy/ZMIAePJQeQupmDnXyNaZvKB6kKsXtTiu/BEGv1GwvHhLkodijDTjmaBCdPFG9tV4Dl1uIxV/bCmJRbkb2E/LS0Nwr+MoyTyHm4F5MRN520ybPyCWW1WbHOeQFQBi4J0MHZ3dindYO/iyfZVorq4HR75KIDLe6Mm7o0GPAmlE0hSriRbyvPPOu3OxFcGkvPflSmyjrtyvTm4/r7JUgZJtjVhqk41Y7f8V9OarGtgnOrgxCeE0l7k7ELfWUQVfqqnM3n3Ax3D6zY4PYY+DOHvJDWwSYl9NUtINCiSEC43zVEw1SBuguBRN0hRX6a7T/AZsBB2LD3QPosUceNVy1/pqh4LhcxJWHn56yxjpbLEJQI/uBsshS86UxVMuROzWWjZNWTylDSLTcwI2jm8FKsfPMEBKyGZU/bAK0i6VbKaxly+ytbV6OANJ2F6xDUinndjT78aeal6ctBQQvPPHGPiQqo/TnOXrNuqMK5lBwwVaOwtr+9nstnLVc4h5Cl6EMyXrUTONOvvRXc5Ev5A3KrSV7ckSvt2GvATtMJxBA7RN4yi/Mlp4s7UzHxW6KdjFBsIJAdAMcBS7tgjlW4jHEQazCb3b+aoNn/2+yq0cJgG0Kv0e9JtV7fVNFre+XQSD8LC/klglRDM3xOJf4sWDOiLI/9swgJFipTcS5YrTkDPevJjSlhqNIE9YfEoNMbKaI0SljaOSBK3O2RWX+opDb3X+IEijfG5iW7CSITDyxFhP/SI5usFImd1oqR9GDp8ii8nEIeUOYnWgCwktLToK95S/+jyv6L9jfhtnRwO2QJW4+uU1QuDw1vqTp9F+OUbKqdwRZpAxI3/MYsb6VwQCwLSwiwvgY+0vyaker3z4NMKsZHZ5DIsJwwemwoK8K/gGEBex0gIp4vzWidQzXwgiZuWy5bhAP8+m56ZtULso6s3GsHAtx/ZI6tC6DA79VEtfYlL95KTBQgj72MRMkn595bP/ik6I1g4ZEgqalg3RkIew/FODGMXD8/pJ61Xt/BeHHyvZwEYNysbEXDm7ZqHHa/c+rVOu0HRRzYkokfhYTjHWxW0eFXm/MvLMFIO+boHXvc8D7/hpBghP0ubYtcjbenNg+KJXxI5MDdp9Ug71zWBaiyAphCSSCr1f+3xWueshnvtkC3LNmPPTNbCjHEQDQ6jagXjFQBB3NLLCnhwvQpWqje0mf7Dt5GLZzKyMgkWedGvME0P9VoLetEmTv0x03m6/YADO+zXoTtT6TSdrzU24MLFc+uGp5pm/4cDmgvXfFWE6QGRBpZWJwJI1rGH9lceKfpfWy+27i7ojjclSsoXqQBM8mIjxFpefzK9Kvr5A2j/DFG1+oDlGVyXaBh+iaAiaeiktzg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5736c57b-a037-41a0-7983-08db61fe0735 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2023 17:39:47.5287 (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: gV86eZZznbF2a5abegSr6GcXWiMCyyD/lhDditCaSgFd0fYDhu4Nvv7f29M9eb9CM9cfJ0a8Q12y1ndvvK1Ktg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB10050 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?1767432883873206301?= X-GMAIL-MSGID: =?utf-8?q?1767432883873206301?= This makes a difference for the software scheduling mode, where dev_queue->qdisc_sleeping is the same as the taprio root Qdisc itself, but when we're talking about what Qdisc and stats get reported for a traffic class, the root taprio isn't what comes to mind, but q->qdiscs[] is. To understand the difference, I've attempted to send 100 packets in software mode through traffic class 0 (they are in the Qdisc's backlog), and recorded the stats before and after the change. Here is before: $ tc -s class show dev eth0 class taprio 8001:1 root leaf 8001: Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) backlog 9400b 100p requeues 0 Window drops: 0 class taprio 8001:2 root leaf 8001: Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) backlog 9400b 100p requeues 0 Window drops: 0 class taprio 8001:3 root leaf 8001: Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) backlog 9400b 100p requeues 0 Window drops: 0 class taprio 8001:4 root leaf 8001: Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) backlog 9400b 100p requeues 0 Window drops: 0 class taprio 8001:5 root leaf 8001: Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) backlog 9400b 100p requeues 0 Window drops: 0 class taprio 8001:6 root leaf 8001: Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) backlog 9400b 100p requeues 0 Window drops: 0 class taprio 8001:7 root leaf 8001: Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) backlog 9400b 100p requeues 0 Window drops: 0 class taprio 8001:8 root leaf 8001: Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) backlog 9400b 100p requeues 0 Window drops: 0 and here is after: class taprio 8001:1 root Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) backlog 9400b 100p requeues 0 Window drops: 0 class taprio 8001:2 root Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 Window drops: 0 class taprio 8001:3 root Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 Window drops: 0 class taprio 8001:4 root Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 Window drops: 0 class taprio 8001:5 root Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 Window drops: 0 class taprio 8001:6 root Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 Window drops: 0 class taprio 8001:7 root leaf 8010: Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 Window drops: 0 class taprio 8001:8 root Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 Window drops: 0 The most glaring (and expected) difference is that before, all class stats reported the global stats, whereas now, they really report just the counters for that traffic class. Signed-off-by: Vladimir Oltean --- net/sched/sch_taprio.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c index cc7ff98e5e86..23b98c3af8b2 100644 --- a/net/sched/sch_taprio.c +++ b/net/sched/sch_taprio.c @@ -2452,11 +2452,11 @@ static unsigned long taprio_find(struct Qdisc *sch, u32 classid) static int taprio_dump_class(struct Qdisc *sch, unsigned long cl, struct sk_buff *skb, struct tcmsg *tcm) { - struct netdev_queue *dev_queue = taprio_queue_get(sch, cl); + struct Qdisc *child = taprio_leaf(sch, cl); tcm->tcm_parent = TC_H_ROOT; tcm->tcm_handle |= TC_H_MIN(cl); - tcm->tcm_info = dev_queue->qdisc_sleeping->handle; + tcm->tcm_info = child->handle; return 0; } @@ -2466,8 +2466,7 @@ static int taprio_dump_class_stats(struct Qdisc *sch, unsigned long cl, __releases(d->lock) __acquires(d->lock) { - struct netdev_queue *dev_queue = taprio_queue_get(sch, cl); - struct Qdisc *child = dev_queue->qdisc_sleeping; + struct Qdisc *child = taprio_leaf(sch, cl); struct tc_taprio_qopt_offload offload = { .cmd = TAPRIO_CMD_TC_STATS, .tc_stats = {