From patchwork Wed May 31 17:39:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 10119 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3078495vqr; Wed, 31 May 2023 11:12:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7bfGpC2VRoREt0IUUG1iercU/K6B4VdrS+yafLPyX+hOcnhwqcNwMeuNheBXjQbQHi3v/E X-Received: by 2002:a05:6a20:4289:b0:104:7a4c:6ca6 with SMTP id o9-20020a056a20428900b001047a4c6ca6mr6603510pzj.13.1685556765900; Wed, 31 May 2023 11:12:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1685556765; cv=pass; d=google.com; s=arc-20160816; b=omizRssvXirdJDvtv6OU32lweI8CLCLxeb+N6f3huHGUyFxiV4Y5QvV478rp+1ny80 EJPFTrP5VXPS/peWs7N6mKwgwqp6iF/wPcXNb0Ns7zrQ4OgwPgmLVApblyzZcvtD8Y7S sJt7Dcnq2zY3d9GQWudnPckczhE2H2Fn0WyxMyF76Nyi66sQ3Qg4zKBzxPrEA6aC1uKG sx9Ml47vuQ5DSwllsTV6n8zsOQ8E3SMQoXDEdgpXIF1oPHVr+UHjHL/uQ91yq2xHMJlS svfpa8voFlwitWjGv0lYVEDyLeYFzkW/nZjjncj7IiOPWRjZ52nO7JUA4J2EbZHgNMtV AXnA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=AQwv0RHs8WcK+V0GOKTuDDxR8K4T44q6HYya0ArJjUw=; b=QOLhOx05VmBjOkKsJTxD6J/ixzo5muMOWiWZpXRZ9kNFTtmxVEQntBGjrOwSDJXtm7 eAAZgg+OPMibs9Xj3qYgRJ2ETuWC4u5ULf3/P+GkFeIy4lMy4m6hoPAHZbYv4Ipos1Xq /f1xXDnekj+pdG1idCLW9iJS02BUkyS1oJBV097R4lKjNFIlGIGoWxQ5jZNUgFCA99ld WPTUH7sqUlwYa5bfNVLGBxPDeHV28TfSjEhs8wOyV0tciRye7eLZeyYb8soEndqO5R7K yVSw2ftLZIXQ8NSF5I0Ycm3osE6hAZvejc8EqjZp15sb69ALY/XDwEa0FOhL9ofIg+qh 2cTA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="L/IN5L4K"; 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 bs130-20020a632888000000b0053f3d04e66bsi1340962pgb.698.2023.05.31.11.12.32; Wed, 31 May 2023 11:12:45 -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="L/IN5L4K"; 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 S229787AbjEaRkE (ORCPT + 99 others); Wed, 31 May 2023 13:40:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230174AbjEaRjv (ORCPT ); Wed, 31 May 2023 13:39:51 -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 D56B911D; Wed, 31 May 2023 10:39:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UFbdid2FevqjWg1iGIZDLpKQH6q0zaegtoziB4R6nopIckbEco+kzUixjZ9HN8sdx9DL6wryVKSEhpGzUcfihW7KAvneY87veWTDJGNhuZUb3CALCSH4ww+EebMDoqfig+G/AQUhwaZyEacwp7nAQ14fSCOtSNiax34JsrDUAcTS0NuRE7uXoN0sUvPzO7Z5nIQPYZWpiTw3zRdFjqqs5YdEh57t6CrgLj/GzyLPMwZ2/Idxyc7cCArwmlpilMzNttXPwsS1uHKna7+h6eihHP+iWmSsMZi7p7a/SVxwpd3MToO2lWzzYNrownLOwAEo65ly445dL993Un2zgXs8bg== 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=AQwv0RHs8WcK+V0GOKTuDDxR8K4T44q6HYya0ArJjUw=; b=HJgN/d91wSo83xFqs6t6NeDcB1zyIRD25lrW5IrSu7tszJbHdPrrm2HbGciBYno7PuxoCfrptHT1AwD5UUxa8ma7wvKv4CpxXfB8HymPaqh/3wv+DHubAbOVK385vu+PuZCLF/jX1vfPbHnn/IgKEFrnWBegWjxJ7jeInVx50bCm+mcpSitpywDaQ03B+b7VwQ5M8TvZGZ7WC+TG+binhIVs0IiRHZKkuIvg80AysLOsblB+Z8e4UR+JPGrgVEJoHCYt2lF21uiWzjpLzy63UbJiiBTmfCB4PDhYXz0llRQB0zcuvdK5eIZMoR9d/ARYAWJFIR/7AJyT8pgvd2uQMA== 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=AQwv0RHs8WcK+V0GOKTuDDxR8K4T44q6HYya0ArJjUw=; b=L/IN5L4KqBc0vWJpHkM58WDKYcH08D+1s6ufgSuncuAzvSpmSwzEb+CHW3CVNLsR63ap1X2dgPksNvIzKbQMkaOPREeL9x/jH2Qi/0lCZD3m/KKk3c6U/3zzqMlHJVN0Z5njjEXFbYjV6EK+oWYQ84iJQPNWzwl2KsZoh3rZViU= 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:43 +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:42 +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 0/5] Improve the taprio qdisc's relationship with its children Date: Wed, 31 May 2023 20:39:23 +0300 Message-Id: <20230531173928.1942027-1-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 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: 94758cc7-832b-41af-e158-08db61fe040a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wJLtl+qF6/MrHrWceP7Cken1lrMdBzpYOFXk490SoIKdjnFRZFZnzxtLK1Psf0Pq6pRMkgoe2KVBBYDwxmMBCO3HqT12cRXCfs3jeSqx1tQhDxA2MnekfvawaCJfMKQ9qGynTfRHBqq8NAto+6ktJv72D7d9udGuv4oWUL3YvChz3Qri+ZGVpHfmn7Gg/hgW2zCdsLjFyozHBzytEk1ylEjU0tW7OM3aouVMpFTqCJoQNzEFniz6bteBKk40K/lmi5LW1wF4Wxtd/e35KVSS8MEerJDWWdkR7kAKm5HeczwWMJRWH39nZGO9BaON9HIV9vtpOgDDc7Yr8vaq8FHS6vWN9HlZvJL+4sjUjXtabmipi+WVk0X9147fKLW7dJNUnxHn5WCjRiqNfapyKKY5OSY162Ur5fnzg7lNqkNX1KoGA/Nq1NrN6mr4DCezWPoG/REeHL3Sre2BCYmYfIxCXLXZ/qOjSszHAcTXmoXoHVChIvWPg0jGiFPVXbzSjW1MkPcRyhQcNPObg8FtXVblZpj6rZm9HGEz1cWxmDUElUiBkLK1jmOPnprUw73ASnDmUUizzztnzv2JossVawcWlMsHLjYvHE/TFnwbWEYg2+T88ukqBoMZDXczCVVP46oM7XcgW9NKb3nsN9nxhRMTAw== 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)(966005)(8676002)(8936002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 06qBbsmIFqNJaD4nTTV11RXcvJKORTbmOsf8bAMRYhiW4VwqLMIaOBBU4tbxjlvpzRJO7fkCMXvjDssRacSa4MBeKb/WckZNv0WDtlxFlIRZ1sXQAdi8moFqq0Lt4bXGDLwABGFO8lAeCuAm/K2gWY8wtxc+F9APOwFlumHjcd5RqZwYDTx4enn4xUho55QZW8zsXJrLyuvG4Yv0CPv23BZvFTtMrMawulXGgPo3etiTnx7H9/2iwRiUkYXQJnRlF1RUSeQ6usBNIh45iP/2MUiBuvAJqIg1w4r1DL0G2qh2opdIxLIv6vTzGVKm4NnXEC/qGNJLi/b6kjVSVX13pfxDm4KMPCi7B4JmU795qXCdC/M1ohLA4Gpvyfh9hcwfFYo/XQ36S6J9urhvblraSvfgeY59k3M/MY2ZF/ymS/EDzXJVzpAS+aXV0wbALDjUQ/2OdRXS7Ry+eg4imp0EyrEqe3T7d7GiIMztuJeLt03OPrQc6ZyXw3D3Sdmz7hbvnTzhj9UeYb/b/g/c9WgJX3OkkNYJRdflqXJWHr4+jWM2O21nxegZHOFI6Pnm8pFuipukabDgRA8NCpdTH+6ITyYR8r1zhploLvSumw6oww0M3JVtr+W1pU5/A0W9ua0x3rzsMLukvD06nPI6eD0B5EkppMTuPurfklvNYMYCmrvfTGY4smu7obkdWNGQBjw2zgzxKxNDS5bjGbkpBRep/wlKcSe44+aViugosV/MkylBr0IgeizCSenkNtyMNSYuwGkIncCSNm8uWNETwHQheJ9ggbLm3vEqmHZr4WS5Qjz8KQkZ2mS+QjfgCM9D5MTOAvBCiEDMIj/4gXVstlT43FJxK7AO82Sw5ciG2Qg+WVkYFyani7y2fLCwGWEa1AET3Zg806SjWzKPa2/bnIe2NhD8aLM74/P4zfdqrd/RrWnSowGtdoubvwLJb16R/1Q5nSHov5n5zzD+vYmc+OnkHVPSPwtH9szspQmK6SEy/8DGtA3xx+W6b/JyBjEv1iOfrElS7u1ZwaS6k4Hlrd3spDl+ZUtqRBg+heF2fk2bDINcBOUyM+HDX4OPiuHKmPP+7eUDMbbyAz2jsATMlehdwq9Kjm3d1o4P00gNyMNzjkwG129LOTP0PFpk42klsGk2Km1uGBaXNuIreEA3JCtcBeknvawjSRye7GM6emxgfJlmtquMIb9Ec3YIRedaSQAEGMfzqdtNeRKKDhQ7CPtHqeO/L1K+PnIIKIZO9tQXA+xyBR0lmF/8QFR+3+atlRl9cZn48LaZ0QUNKIRfxKvOoQ5vp9vqmRVqDTbLLF8D3jWsWOA83fMQXulL+iACtG88+VXj7jAg1f+fbXltpqxywOVNUiJNSVK28Cf097zHvRscbJRJJvsIgKzbvuUJxCc7DdD9xttwkMX2Gs6V1Bxs8A9n7suDnJMjl6bJV3bXP9bnfOiyxnCX8oh/W8U7mB+MHlflQP6p4Xmg359NKSkJ17kb7r2/3xFavplD+TMwMoqjOiPX10jnU32Vt7la0hmw1NdSYzTIwfy1I2+LxbDZQzu7YaIHYz/0AAg7ipRwIVaptb4HNPBpJynsxtAp82fw3RTyqrHgAk2oXFDmac8QxQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 94758cc7-832b-41af-e158-08db61fe040a 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:42.2314 (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: 7rOJIfOgI7rEOUU2rQYGiUdEiMGNs5JGGdz4RJkvea3IjGYl7i96BaCLeo+8nl/xV4M25JA8zoYLxvie7QYhuQ== 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?1767434371174580771?= X-GMAIL-MSGID: =?utf-8?q?1767434371174580771?= Prompted by Vinicius' request to consolidate some child Qdisc dereferences in taprio: https://lore.kernel.org/netdev/87edmxv7x2.fsf@intel.com/ I remembered that I had left some unfinished work in this Qdisc, namely commit af7b29b1deaa ("Revert "net/sched: taprio: make qdisc_leaf() see the per-netdev-queue pfifo child qdiscs""). This patch set represents another stab at, essentially, what's in the title. Not only does taprio not properly detect when it's grafted as a non-root qdisc, but it also returns incorrect per-class stats. Eventually, Vinicius' request is addressed too, although in a different form than the one he requested (which was purely cosmetic). Review from people more experienced with Qdiscs than me would be appreciated. I tried my best to explain what I consider to be problems. I am deliberately targeting net-next because the changes are too invasive for net - they were reverted from stable once already. Vladimir Oltean (5): net/sched: taprio: don't access q->qdiscs[] in unoffloaded mode during attach() net/sched: taprio: keep child Qdisc refcount elevated at 2 in offload mode net/sched: taprio: try again to report q->qdiscs[] to qdisc_leaf() net/sched: taprio: delete misleading comment about preallocating child qdiscs net/sched: taprio: dump class stats for the actual q->qdiscs[] net/sched/sch_taprio.c | 60 ++++++++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 25 deletions(-)