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: 1788466 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=HI1oOia/; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QWc3H5ZY6z20Py for ; Thu, 1 Jun 2023 03:39:55 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 0F9EF60D72; Wed, 31 May 2023 17:39:54 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 0F9EF60D72 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1685554794; bh=o37FiKKLAxWsS1ANtzOr5kn1bmw5Qe4bbXt7R9k+Khc=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=HI1oOia/s6iwtX5k4uKjHoIj8d28Ccp/dKHYBXJMm/WCjukPEIJAcLHo3nJ3CBAai nG+IJ8jNdIjRJmuX0TniDMXAVOHm6qraMnXw/tXnK5hVAbX1HSRU7TQRAMAvmmwTgv qeZBC2Nk2waFo1UwZwtX8OU/TRQvutd2xSijBuOzwisT6A0l1Na7na6z7YUFX9JQOI 46BXPYwDyU0AsftE/qr5m2BNKekTmdFPUt9Kti+L0orPmRxiZ0pUfMtRhYtfIh8kjc B+1ue9E0SF7VLLSJfZyvW/poxbAF7765CffB5b8cEyg/QfCYn3SmeswPTguuxxgNq8 uy72VijeeRkGA== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yDIznzYq4P1o; Wed, 31 May 2023 17:39:53 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 10CD660F91; Wed, 31 May 2023 17:39:53 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 10CD660F91 X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 4C8261BF5A5 for ; Wed, 31 May 2023 17:39:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 470F941D8E for ; Wed, 31 May 2023 17:39:48 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 470F941D8E X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1NjsxJUW0eGH for ; Wed, 31 May 2023 17:39:47 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 324A841DA3 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2045.outbound.protection.outlook.com [40.107.20.45]) by smtp4.osuosl.org (Postfix) with ESMTPS id 324A841DA3 for ; Wed, 31 May 2023 17:39:47 +0000 (UTC) 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 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 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-Mailman-Original-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= X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (1024-bit key, unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=PMnkB9tH X-Mailman-Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Subject: [Intel-wired-lan] [PATCH net-next 1/5] net/sched: taprio: don't access q->qdiscs[] in unoffloaded mode during attach() X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jiri Pirko , Pedro Tammela , Jamal Hadi Salim , linux-kernel@vger.kernel.org, Eric Dumazet , intel-wired-lan@lists.osuosl.org, Cong Wang , Peilin Ye , Jakub Kicinski , Paolo Abeni , "David S. Miller" Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" 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: 1788467 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=pOsafJn9; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QWc3N0pDHz20Py for ; Thu, 1 Jun 2023 03:40:00 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 617ED611BC; Wed, 31 May 2023 17:39:58 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 617ED611BC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1685554798; bh=s7hxNHK6m4Ns3Gs01pxSsgIeMoNcFA5mnqM7/pfQlr0=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=pOsafJn9CxYiC4t+ggTog5z7P3RmuPftFy9c8Dp5dC0cTA9+LLjzXiVSNU0DSDNjh I2QcgdjE1uY4K063AHu6lxPUMDdyjT689MAUpVjEqBfBInuSVQTKHNvdv9t9f6O+Yx JIw+3/JAG3j0ehODx8hpS9J0to83f+M0GjTQsn4oMBdjMbtcDPXG+9vATpgWXcHKEL mt5uleT35ODtBzZ4KmLlYxmov8VUKhiG0HJ2F78XerasQYDl/Ubb+NgKRIpKdM0Z/x yaW+hOZlOusZ/IuiHH5VZLj1cIw71ak6j8W4hb1v+RDOS4cH3VwXV2HJn3cq2oYp92 LLAmdX13ldv7Q== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7LH1VVtQFCv8; Wed, 31 May 2023 17:39:57 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 40E7A60F91; Wed, 31 May 2023 17:39:57 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 40E7A60F91 X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id B531F1BF5A5 for ; Wed, 31 May 2023 17:39:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 89AA141D8E for ; Wed, 31 May 2023 17:39:49 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 89AA141D8E X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SgC_9ZXjjgYk for ; Wed, 31 May 2023 17:39:48 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org A867641DD0 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2045.outbound.protection.outlook.com [40.107.20.45]) by smtp4.osuosl.org (Postfix) with ESMTPS id A867641DD0 for ; Wed, 31 May 2023 17:39:47 +0000 (UTC) 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 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 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-Mailman-Original-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= X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (1024-bit key, unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=VGwVRj9b X-Mailman-Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Subject: [Intel-wired-lan] [PATCH net-next 2/5] net/sched: taprio: keep child Qdisc refcount elevated at 2 in offload mode X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jiri Pirko , Pedro Tammela , Jamal Hadi Salim , linux-kernel@vger.kernel.org, Eric Dumazet , intel-wired-lan@lists.osuosl.org, Cong Wang , Peilin Ye , Jakub Kicinski , Paolo Abeni , "David S. Miller" Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" 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: 1788470 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=8spldyeR; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QWc3Y4Xlvz20PW for ; Thu, 1 Jun 2023 03:40:09 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id E318461090; Wed, 31 May 2023 17:40:07 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org E318461090 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1685554807; bh=3pntlnq+BQGk+t/Fh7gYbdMJQEg5r/4OkIKplafq3ww=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=8spldyeR2WMGTKM0ok70FbqCPPNzsLpA4w/ZixzQc9h8jeyQJTKMh9ay43tz0Oy+0 9/pDcy1g32W5B4LK0bC0zMgsODw7rHCgELSoOmXWtyB/Dp+sgDjSSe12xnALmgkFrW nTCbkdyh4o3DM79WsTtdZSLCTiuVtZJg+IlapFJu5bx+3Vpy2Nb6pnB8itWwH2mUe/ G+E1S2nYPlISY2ASdmg6/wwV/2POZ0n5k0VRyGENF7Y5xik6AWzgfraAsxt4+dZ3sR BrpGndOwLDwp/fxAOloho+8KYhOKppo6pJXwma8BSDy8NIt8vSOJX+gtM0FSFB397P nQPRXR+3vyR4Q== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0e-YsZTGjrxI; Wed, 31 May 2023 17:40:06 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 1199361197; Wed, 31 May 2023 17:40:06 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 1199361197 X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 2E9371BF5A5 for ; Wed, 31 May 2023 17:39:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 061DA41D8F for ; Wed, 31 May 2023 17:39:52 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 061DA41D8F X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SEc1M0rN9fTL for ; Wed, 31 May 2023 17:39:51 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org E137341D8E Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2042.outbound.protection.outlook.com [40.107.22.42]) by smtp4.osuosl.org (Postfix) with ESMTPS id E137341D8E for ; Wed, 31 May 2023 17:39:50 +0000 (UTC) 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 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 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-Mailman-Original-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= X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (1024-bit key, unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=KhgGkPqS X-Mailman-Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Subject: [Intel-wired-lan] [PATCH net-next 3/5] net/sched: taprio: try again to report q->qdiscs[] to qdisc_leaf() X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jiri Pirko , Pedro Tammela , Jamal Hadi Salim , linux-kernel@vger.kernel.org, Eric Dumazet , intel-wired-lan@lists.osuosl.org, Cong Wang , Peilin Ye , Jakub Kicinski , Paolo Abeni , "David S. Miller" Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" 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: 1788468 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=emzs6lT9; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QWc3T46Btz20QB for ; Thu, 1 Jun 2023 03:40:05 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 9D5C860E2F; Wed, 31 May 2023 17:40:03 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 9D5C860E2F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1685554803; bh=r2sQl4ehJ/4Ni5KRQhDU89EDWFNugPywEXAyTQNHGcA=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=emzs6lT9eL3g3s5aFv5JhBwGrULkqh1bDZsz9ORgfCfaTlAL+koYnhc6sPrPRYPId aKrNG0swJfBJcV6Rol1ci98CUnq6BfITNF2mkUnjJ/iHMK7v8Wy0ab/UnrpnnE5sGi L0p9belulcMd+o8REyxvhRY45D8ynYTn4VaqYHOb4Krd3//uZ21j2SG2DWbCsokGF+ JjuRxFyQNeMt9V1rNlCGnr/vGqypjyGWHLVoSx/NFvdK/BIm5eky2PQb7FBI6ZmQjQ Wzug1n5/9CPQCOMWhI96YRmUvTPRtIL/7j3rTtxm7XXGcoE1sehvowjNo3NNKWHYvE +tRgKO67UQ7Nw== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2E5UTzivuvfx; Wed, 31 May 2023 17:40:02 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id F25D5611B1; Wed, 31 May 2023 17:40:01 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org F25D5611B1 X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 9FC031BF5A5 for ; Wed, 31 May 2023 17:39:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 75ED741DD0 for ; Wed, 31 May 2023 17:39:51 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 75ED741DD0 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JJnqXtcWvdeK for ; Wed, 31 May 2023 17:39:50 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 771FF41D8F Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2042.outbound.protection.outlook.com [40.107.22.42]) by smtp4.osuosl.org (Postfix) with ESMTPS id 771FF41D8F for ; Wed, 31 May 2023 17:39:50 +0000 (UTC) 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 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 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-Mailman-Original-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= X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (1024-bit key, unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=FUbEG/ZZ X-Mailman-Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Subject: [Intel-wired-lan] [PATCH net-next 4/5] net/sched: taprio: delete misleading comment about preallocating child qdiscs X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jiri Pirko , Pedro Tammela , Jamal Hadi Salim , linux-kernel@vger.kernel.org, Eric Dumazet , intel-wired-lan@lists.osuosl.org, Cong Wang , Peilin Ye , Jakub Kicinski , Paolo Abeni , "David S. Miller" Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" 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: 1788471 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=v8LTwNv+; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QWc3d12pLz20PW for ; Thu, 1 Jun 2023 03:40:13 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 5ACE46121A; Wed, 31 May 2023 17:40:11 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 5ACE46121A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1685554811; bh=aHGUpbmzBOJ0h9MfI/0MWWeenh6qgW5wqPVDCmrhEC0=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=v8LTwNv+YyNbP0aySQVZIDZ/ysUOiVy25Y/H73BoZ+VcsSssc4w9wpac4XW/2CLES zrjw35UZa0lBVTUgnNkeL6zeQfwRnaQR5WxZsGX1nw6uuAwowI6CQf1dn8QI+cy7Qc ixsibdDmL23w3qWaP91kVfvuWMSvisj/X5g/77g0GMg8kPgGTeZq/5Zr/AjzYUWf1b LSIFKbJ8Dtz+yzHz5DFI8X8wTczIu+b8IniJV3GiunsWh6zo9OcRUD0lk5fgD1SpvM VYDBOcgkKuEIGVtIOAcOPKcAFWfPTDkBuW39JfW671QNf5kAGZMCwQLKIXg3yk3Qqf zT5IRKlU2dKzg== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ycbc6q1stnqH; Wed, 31 May 2023 17:40:10 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 389FA61197; Wed, 31 May 2023 17:40:10 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 389FA61197 X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id E511F1BF5A5 for ; Wed, 31 May 2023 17:39:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id B7B3A41D78 for ; Wed, 31 May 2023 17:39:52 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org B7B3A41D78 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id szIyDTtvr8Kt for ; Wed, 31 May 2023 17:39:51 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 6DCB841DA3 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2042.outbound.protection.outlook.com [40.107.22.42]) by smtp4.osuosl.org (Postfix) with ESMTPS id 6DCB841DA3 for ; Wed, 31 May 2023 17:39:51 +0000 (UTC) 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 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 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-Mailman-Original-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= X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (1024-bit key, unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=nHuOEl/P X-Mailman-Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Subject: [Intel-wired-lan] [PATCH net-next 5/5] net/sched: taprio: dump class stats for the actual q->qdiscs[] X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jiri Pirko , Pedro Tammela , Jamal Hadi Salim , linux-kernel@vger.kernel.org, Eric Dumazet , intel-wired-lan@lists.osuosl.org, Cong Wang , Peilin Ye , Jakub Kicinski , Paolo Abeni , "David S. Miller" Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" 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 = {