Message ID | 20230602103750.2290132-1-vladimir.oltean@nxp.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp953383vqr; Fri, 2 Jun 2023 04:25:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6lQAEeg+zJyp8JbWJagIKNseo3rI0iAj6SDz8YTtr/KXE/TW7i61hUhbz8ySA3wvg/8Co1 X-Received: by 2002:aca:1a06:0:b0:38e:8e21:d044 with SMTP id a6-20020aca1a06000000b0038e8e21d044mr2169791oia.6.1685705139376; Fri, 02 Jun 2023 04:25:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1685705139; cv=pass; d=google.com; s=arc-20160816; b=voen/KEgm6nTJzi/6SQTd5e7AWzU3sJCuhtAzz8ndyrkyMymJ5egl06VQ2/O1gf9A5 qxfkW8J/OMt+RXEUMHNn4YgVSG1ED7JeiafLT3wkM07SfWnzzzHoKlGtUDD9CxY9bESt +F34jIQcaWhC96A/fk8Epn77GMPGBZad9lyBQkuq+lKFOndeZzHW1zmUxWdI30Ydn46L tSY/g6UQK6Tuy0AvDqoNLAdUEWOYAQPGXLRmOdMA5ESjxhmSe/tSsSmyCjjMrxSYm6xc vTHQkMMkZnx6kzZTcIZ7ml2C1qOAd/Lb0tE6Y+RTINNKc5wLeh09OtmCRZszC7vAhN+0 VzNw== 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=H0MGORJcCTGs5zbRwB6zqDXpNBFUcyabH8AIGWtnHX4=; b=i2wA3/OfJ9WuXhQAblHb1lKybFZF+Jv4YoKwLrTETAer96M4j5IIHk82T8aMZ6f3ra tJGn4sm6qMaWbT23LdcW4AnBEywb0X2o5wCKvH0lBB0VcHYRqqtqiukTDFDyDJnp1T0+ VWErXjJ8tceC9qDuWSNWbYFhps0SJA46cgto/LoRB3UEmcvHJWHaUaSfByKNFB5M0940 JwJGyrDaQKk2hGmu2AsDCigQUzhxwrzv4xeXPZu488c1dhM603VyXL5xKSLdcu9b661U 3O0ys/Dbjz9ZdUSPMLbnjIWmfwCsuw2dua7Q3IgafhFGXszKSKPWqT/AHOCIHUXB/swT H49Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=rRamzo1C; 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 lg13-20020a170902fb8d00b001b0499f7a90si705423plb.513.2023.06.02.04.25.24; Fri, 02 Jun 2023 04:25:39 -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=rRamzo1C; 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 S235189AbjFBKkr (ORCPT <rfc822;limurcpp@gmail.com> + 99 others); Fri, 2 Jun 2023 06:40:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235691AbjFBKjc (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 2 Jun 2023 06:39:32 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2044.outbound.protection.outlook.com [40.107.20.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44C96E63; Fri, 2 Jun 2023 03:39:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FQvpGxnUBVHAoDtVVqifZtfl/7hs8N0Iw5EQWCehdnRnGywMVZgxj/jVTku2WLczB/yjkbRA7UqGlGkon8Gc+njHglGQk7FDkEMf9svaTdJaN8tRNDz85BHhoJ6AW50JppaRVTiEInn53ZUffg/N2hCsERdBfrR0gdWAiejWR13qBlf5rELNa8AimxbfmVbBheCXSp6l1moxRg/tUQCPX7GHsCBQirPVPECHF6KUSuc/K0iJo5t/CVZqDAjRhZL9ysWiUMTeGeRdmK3obdKReACJJDspTarjyNG0nIjO3JYonWsRw5mZ58YI834ZbmmyaRQ/jJ2oyLs7bHaGMGJxHQ== 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=H0MGORJcCTGs5zbRwB6zqDXpNBFUcyabH8AIGWtnHX4=; b=Q2oKR0nTKh8voHDPGqdzxuUQv3ix5PTH8dBbY0hhzZ9I5BZZFm078zaxkPWQVFSqOm3ziBBT6J4tlCWtaxAuc88N7W/+xvZ+7OEW7mAkeaX4NIKcdBzWDyt4Ty8kc1HA/UOBfAGHMXK8Mt3EkYmE/w1eD1MvM0SX9bczsJleq53iVcXlZ0a9zdmc52lqppos/nZb3WP3LLD1uPXh91ZqYHFd/lg7ULxLbic78Zj1k26se4ycj+pyLnESlzxH8IZk1Ij9Kb+uHQhYXpyRuo3qbk+DbyWTeV69NO6nRPR85e4DGlhP5dD5oWbSrx05M8ZI1WqPhsKsxfwcOjfHy6rYfg== 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=H0MGORJcCTGs5zbRwB6zqDXpNBFUcyabH8AIGWtnHX4=; b=rRamzo1CT+4YLXO13F44dBl2rwQp0LnZdqAB6si2bZEDCcvRx5ba4nyzyp4Z+tUsg1OcP3kfVqSqDWQo4D1vlprGeBpZafKbTGYu/VBTZQTqmjCq5MmWl2QsBy9DnvXEhSq7aTudD6N5gbYyb1A1geSuNwfSDi0HgAw5DWovxSw= 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 PAXPR04MB8926.eurprd04.prod.outlook.com (2603:10a6:102:20d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.24; Fri, 2 Jun 2023 10:38:17 +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; Fri, 2 Jun 2023 10:38:17 +0000 From: Vladimir Oltean <vladimir.oltean@nxp.com> To: netdev@vger.kernel.org Cc: "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Jamal Hadi Salim <jhs@mojatatu.com>, Cong Wang <xiyou.wangcong@gmail.com>, Jiri Pirko <jiri@resnulli.us>, Vinicius Costa Gomes <vinicius.gomes@intel.com>, linux-kernel@vger.kernel.org, intel-wired-lan@lists.osuosl.org, Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com>, Peilin Ye <yepeilin.cs@gmail.com>, Pedro Tammela <pctammela@mojatatu.com> Subject: [PATCH RESEND net-next 0/5] Improve the taprio qdisc's relationship with its children Date: Fri, 2 Jun 2023 13:37:45 +0300 Message-Id: <20230602103750.2290132-1-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: BE1P281CA0095.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:79::10) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|PAXPR04MB8926:EE_ X-MS-Office365-Filtering-Correlation-Id: 6b29d556-4d77-47a3-a55d-08db635579b4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ga9Nm2SAeU7fW+IEYDOM4lteH7CXYCl1Parx0pgXu6vTUbLAP8GTO7ZM6EPrhUSfgIfNW2yyGbLyKaw4MB7XHo8W/ZcJkIjSrhO6YXn8u2uvgmKw83/n4yyWql6/LSbswla0Xsk9cD3zvhsqlTHoLMgRdvWcmY/QFPw8YEJV/VYwIjH1+/aFye8mVXYNlB77MSBxx84CiXlhEjQf6drWHZKNKW58AB0L5Ob6wcJLWnkFIkgUcVy/QpvAEDhvHmDk5gY4+Q5F89WZ1arwiot0p+kTzevmPKQCqPYYTU4dx8lEspvzLOtK4+UENLyY7qOFr57etPWjpSv16h0Eefp/e6Nw9+TXSAZOQ83EJRDGbfowXrP79xwkW+w7k1vqFUBqZ3SlY7AnpSPYgsMzDBkJ83dcWs7uVMUKdUtVSGFQty64y563WY7UKZHgHCNfREbpHokA+AC8Rdu29yUUi2l1qxsRNarFHulbqYF0iihykao8bmWQHb090a2n+inOTbvC5xlk208/LGhmHW5H+CJxJIg6AxVOwO7TPHsgBPBYY+2Da592smd9TmFYueym3HjFpdyNGv7qUpXEJcwfYAnH9uQ5WeOAGrgQtbiFPQW/6CY= 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)(366004)(346002)(376002)(39860400002)(136003)(396003)(451199021)(8676002)(478600001)(6506007)(1076003)(26005)(186003)(6512007)(6666004)(966005)(52116002)(6486002)(2616005)(41300700001)(83380400001)(316002)(2906002)(44832011)(8936002)(5660300002)(7416002)(66476007)(66556008)(66946007)(6916009)(54906003)(86362001)(36756003)(4326008)(38350700002)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6J6+iuRlUQ080NeWSZtcHEqBrVdDdhKA5tvsWTbNrU+99rgBZ/B22GpKJ3DEIUwgcj+KAeLWibt0y6Zqw967UJ4vfUfroq1IOP+5dr+7d1TP8rhfEafqZ9Acg27pJC6qJuBVF9KoGdeTwQdu8Ot6aRMNy5qkDYJef741+yE6xqw4/FevNRXah2hyutgg2kwIPMWUpeOz20mJnYwToNcu1cQ6nDr1wSLfcJz4xsWpQzn6e1cZOo81/8v3+rzfB8+2zaXqWxeO7EkdXmhPEJ3TMlLfniMFe6dka7kVweNwrBQMH4BpOHLuOQI1G5AnvRtttgx93fvPJ8h+y4xVZwHm/H1ITz18GoLf7340QrmRNCOZCnxfgE5n5yGakq5WziSKtOqbOHq4Iy+a8cCeZeLbz2FzRlw+kXoKc2qbX/EhpSEHrYBoYu3arpEKPRGNOep3fUnj+WysG8QCdOgiALn6AQoN+PEg4XKhMT3cyTgvNgY3iToQtZMnwdI3zSqtFSaG0EohaeJ/sXWNEvG8cuDZqdKc/Lawlu2qX9mKyzVp6hmLn7t4XMtoLlBvqEEK4LVyceyUBJjG1E5Hjbk3Cb6vsneg8IzUguNVcHULyi/Wx+zaBD8tVXZ06qaQ2813FYGkEvbDtkPj/M8r5noPyYgqrm6sYxzVF7MREnF13CuJrZtgpcv59yut0o8vX+MK3lZwKXj0MbpUx5+o1xJoG+opErLThXuf6mgYzDPrt6lJ3EdITddlpSIYrPKjn2VYur6BeQ+uCXp0Ufhmo4ejyqvaZ0Y+1YaAPhnhQxhQsqH22UGbkNxOksQQY1MBiSUmjBF7PHOhPOfNoHneD/DsJys9yV4vmTgQrl01yflp95IVM4Ou1zYqdm7+FrhSlQcScWiiDJJ67OY4G5Jx3wlTZA7ebdVUdG9WORApFnBwvfpsaWK30PE9hrt0N9qYQeR96nTahSv4mDmrAKPthydAQT7oXnOJO0EH6sqvzn6cr45gKDOf9JSOz5UxeZMz+LqcmKP/7FBiBcRe/FeG/BpmR7ag5i44EnDwM0KZTZdJU5x1ouMvRfBKLbs2fm3rCOE+fMOj9UcgW3TtWKaor6IGNJyxrBxg3+uxlZ4MyGKY78f4RuQSF8XumGfaSIDKoMLko8DSMQBWuIeQcupuDuhLVXVwIuoJvvV53F/MlQiKTPLNXwNOlQXnKP0ZlcwKJqEykpa9k6HgX+xfWBOIhjmsMhN4YcrtNlDBDvcUo6M8gMrWd6lvCYI6U2mx8cIrooxLAUADFQqEytAi+rRtSmSSaizUj7VAUyZmIVdt41NABjhRQDqYkqdnHKIkTQjrk77BSPNGdHmQYOuGm1ZgdxVPFmASJr4e9YVM1WY8wW5Qh5t3XpKteL/uGXZLbOCvhgi7p0pNO73vC48DN3jlp636O4p64JR1shBgkJaMX0dAznWDQEcbQ6uakmHuak8+8PzqbcOxp3ilDMTvextqwHqye/rVIE6xlOHb+sUmu4A4xXsXIglcuDoYcf+Lt3WaPnWxsdbEEi3PCoN5bBJqwaxxsvjN+KwjzGYyitO4mf5OOYFoJP0YcGp5DY9M/V9oz2io1IflyGXwA52OTNJAalLRCHpQ4A== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6b29d556-4d77-47a3-a55d-08db635579b4 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jun 2023 10:38:16.9814 (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: qFgIYnM8vOsm2Ot6d4/zbI9XchE7DyKjinFoHIRbvbSHc9mUCPzxcrZbZ98VnxGKZ1J8Oq81FfsVDkCVjpLWdA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8926 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767589952338018024?= X-GMAIL-MSGID: =?utf-8?q?1767589952338018024?= |
Series |
Improve the taprio qdisc's relationship with its children
|
|
Message
Vladimir Oltean
June 2, 2023, 10:37 a.m. UTC
[ Original patch set was lost due to an apparent transient problem with kernel.org's DNSBL setup. This is an identical resend. ] 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(-)
Comments
Hi, On Fri, Jun 02, 2023 at 01:37:45PM +0300, Vladimir Oltean wrote: > [ Original patch set was lost due to an apparent transient problem with > kernel.org's DNSBL setup. This is an identical resend. ] > > 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. I noticed that this patch set has "Changes Requested" in patchwork. I can't completely exclude the fact that maybe someone has requested some changes to be made, but there is no email in my inbox to that end, and for that matter, neither did patchwork or the email archive process any responses to this thread.
On Mon, Jun 05, 2023 at 03:50:42PM +0300, Vladimir Oltean wrote: > Hi, > > On Fri, Jun 02, 2023 at 01:37:45PM +0300, Vladimir Oltean wrote: > > [ Original patch set was lost due to an apparent transient problem with > > kernel.org's DNSBL setup. This is an identical resend. ] > > > > 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. > > I noticed that this patch set has "Changes Requested" in patchwork. > > I can't completely exclude the fact that maybe someone has requested > some changes to be made, but there is no email in my inbox to that end, > and for that matter, neither did patchwork or the email archive process > any responses to this thread. I concur. Let's see if this sets set it to "Under Review".
On Fri, Jun 2, 2023 at 6:38 AM Vladimir Oltean <vladimir.oltean@nxp.com> wrote: > > [ Original patch set was lost due to an apparent transient problem with > kernel.org's DNSBL setup. This is an identical resend. ] > > 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 havent been following - but if you show me sample intended tc configs for both s/w and hardware offloads i can comment. In my cursory look i assumed you wanted to go along the path of mqprio where nothing much happens in the s/w datapath other than requeues when the tx hardware path is busy (notice it is missing an enqueue/deque ops). In that case the hardware selection is essentially of a DMA ring based on skb tags. It seems you took it up a notch by infact having a choice of whether to have pure s/w or offload path. cheers, jamal > 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(-) > > -- > 2.34.1 >
Hi Jamal, On Mon, Jun 05, 2023 at 11:44:17AM -0400, Jamal Hadi Salim wrote: > I havent been following - but if you show me sample intended tc > configs for both s/w and hardware offloads i can comment. There is not much difference in usage between the 2 modes. IMO the software data path logic is only a simulation for demonstrative purposes of what the shaper is intended to do. If hardware offload is available, it is always preferable. Otherwise, I'm not sure if anyone uses the pure software scheduling mode (also without txtime assist) for a real life use case. I was working with something like this for testing the code paths affected by these changes: #!/bin/bash add_taprio() { local offload=$1 local extra_flags case $offload in true) extra_flags="flags 0x2" ;; false) extra_flags="clockid CLOCK_TAI" ;; esac tc qdisc replace dev eno0 handle 8001: parent root stab overhead 24 taprio \ num_tc 8 \ map 0 1 2 3 4 5 6 7 \ queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 \ max-sdu 0 0 0 0 0 200 0 0 \ base-time 200 \ sched-entry S 80 20000 \ sched-entry S a0 20000 \ sched-entry S 5f 60000 \ $extra_flags } add_cbs() { local offload=$1 local extra_flags case $offload in true) extra_flags="offload 1" ;; false) extra_flags="" ;; esac max_frame_size=1500 data_rate_kbps=20000 port_transmit_rate_kbps=1000000 idleslope=$data_rate_kbps sendslope=$(($idleslope - $port_transmit_rate_kbps)) locredit=$(($max_frame_size * $sendslope / $port_transmit_rate_kbps)) hicredit=$(($max_frame_size * $idleslope / $port_transmit_rate_kbps)) tc qdisc replace dev eno0 parent 8001:8 cbs \ idleslope $idleslope \ sendslope $sendslope \ hicredit $hicredit \ locredit $locredit \ $extra_flags } # this should always fail add_second_taprio() { tc qdisc replace dev eno0 parent 8001:7 taprio \ num_tc 8 \ map 0 1 2 3 4 5 6 7 \ queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 \ max-sdu 0 0 0 0 0 200 0 0 \ base-time 200 \ sched-entry S 80 20000 \ sched-entry S a0 20000 \ sched-entry S 5f 60000 \ clockid CLOCK_TAI } ip link set eno0 up echo "Offload:" add_taprio true add_cbs true add_second_taprio mausezahn eno0 -t ip -b 00:04:9f:05:f6:27 -c 100 -p 60 sleep 5 tc -s class show dev eno0 tc qdisc del dev eno0 root echo "Software:" add_taprio false add_cbs false add_second_taprio mausezahn eno0 -t ip -b 00:04:9f:05:f6:27 -c 100 -p 60 sleep 5 tc -s class show dev eno0 tc qdisc del dev eno0 root > In my cursory look i assumed you wanted to go along the path of mqprio > where nothing much happens in the s/w datapath other than requeues > when the tx hardware path is busy (notice it is missing an > enqueue/deque ops). In that case the hardware selection is essentially > of a DMA ring based on skb tags. It seems you took it up a notch by > infact having a choice of whether to have pure s/w or offload path. Yes. Actually the original taprio design always had the enqueue()/dequeue() ops involved in the data path, then commit 13511704f8d7 ("net: taprio offload: enforce qdisc to netdev queue mapping") retrofitted the mqprio model when using the "flags 0x2" argument. If you have time to read, the discussion behind that redesign was here: https://lore.kernel.org/netdev/20210511171829.17181-1-yannick.vignon@oss.nxp.com/
Hi Vladimir, On Mon, Jun 5, 2023 at 12:53 PM Vladimir Oltean <vladimir.oltean@nxp.com> wrote: > > Hi Jamal, > > On Mon, Jun 05, 2023 at 11:44:17AM -0400, Jamal Hadi Salim wrote: > > I havent been following - but if you show me sample intended tc > > configs for both s/w and hardware offloads i can comment. > > There is not much difference in usage between the 2 modes. IMO the software > data path logic is only a simulation for demonstrative purposes of what the > shaper is intended to do. If hardware offload is available, it is always > preferable. Otherwise, I'm not sure if anyone uses the pure software > scheduling mode (also without txtime assist) for a real life use case. > Thanks for the sample. Understood on the software twin being useful for simulation (our standard rule is you need to have a software twin) - it is great you conform to that. I took a cursory glance at the existing kernel code in order to get better context (I will make more time later). Essentially this qdisc is classful and is capable of hardware offload. Initial comments are unrelated to the patchset (all this Klingon DCB thingy configuration like a flag 0x2 is still magic to me). 1)Just some details become confusing in regards to offload vs not; F.e class grafting (taprio_graft()) is de/activating the device but that seems only needed for offload. Would it not be better to have those separate and call graft_offload vs graft_software, etc? We really need to create a generic document on how someone would write code for qdiscs for consistency (I started working on one but never completed it - if there is a volunteer i would be happy to work with one to complete it). 2) It seems like in mqprio this qdisc can only be root qdisc (like mqprio) and you dont want to replace the children with other types of qdiscs i.e the children are always pfifo? i.e is it possible or intended for example to replace 8001:x with bfifo etc? or even change the pfifo queue size, etc? 3) Offload intention seems really to be bypassing enqueue() and going straigth to the driver xmit() for a specific DMA ring that the skb is mapped to. Except for the case where the driver says it's busy and refuses to stash the skb in ring in which case you have to requeue to the appropriate child qdisc/class. I am not sure how that would work here - mqprio gets away with it by not defining any of the en/de/requeue() callbacks - but likely it will be the lack of requeue that makes it work. I will read the other thread you pointed to when i get a moment. cheers, jamal > I was working with something like this for testing the code paths affected > by these changes: > > #!/bin/bash > > add_taprio() > { > local offload=$1 > local extra_flags > > case $offload in > true) > extra_flags="flags 0x2" > ;; > false) > extra_flags="clockid CLOCK_TAI" > ;; > esac > > tc qdisc replace dev eno0 handle 8001: parent root stab overhead 24 taprio \ > num_tc 8 \ > map 0 1 2 3 4 5 6 7 \ > queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 \ > max-sdu 0 0 0 0 0 200 0 0 \ > base-time 200 \ > sched-entry S 80 20000 \ > sched-entry S a0 20000 \ > sched-entry S 5f 60000 \ > $extra_flags > } > > add_cbs() > { > local offload=$1 > local extra_flags > > case $offload in > true) > extra_flags="offload 1" > ;; > false) > extra_flags="" > ;; > esac > > max_frame_size=1500 > data_rate_kbps=20000 > port_transmit_rate_kbps=1000000 > idleslope=$data_rate_kbps > sendslope=$(($idleslope - $port_transmit_rate_kbps)) > locredit=$(($max_frame_size * $sendslope / $port_transmit_rate_kbps)) > hicredit=$(($max_frame_size * $idleslope / $port_transmit_rate_kbps)) > tc qdisc replace dev eno0 parent 8001:8 cbs \ > idleslope $idleslope \ > sendslope $sendslope \ > hicredit $hicredit \ > locredit $locredit \ > $extra_flags > } > > # this should always fail > add_second_taprio() > { > tc qdisc replace dev eno0 parent 8001:7 taprio \ > num_tc 8 \ > map 0 1 2 3 4 5 6 7 \ > queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 \ > max-sdu 0 0 0 0 0 200 0 0 \ > base-time 200 \ > sched-entry S 80 20000 \ > sched-entry S a0 20000 \ > sched-entry S 5f 60000 \ > clockid CLOCK_TAI > } > > ip link set eno0 up > > echo "Offload:" > add_taprio true > add_cbs true > add_second_taprio > mausezahn eno0 -t ip -b 00:04:9f:05:f6:27 -c 100 -p 60 > sleep 5 > tc -s class show dev eno0 > tc qdisc del dev eno0 root > > echo "Software:" > add_taprio false > add_cbs false > add_second_taprio > mausezahn eno0 -t ip -b 00:04:9f:05:f6:27 -c 100 -p 60 > sleep 5 > tc -s class show dev eno0 > tc qdisc del dev eno0 root > > > In my cursory look i assumed you wanted to go along the path of mqprio > > where nothing much happens in the s/w datapath other than requeues > > when the tx hardware path is busy (notice it is missing an > > enqueue/deque ops). In that case the hardware selection is essentially > > of a DMA ring based on skb tags. It seems you took it up a notch by > > infact having a choice of whether to have pure s/w or offload path. > > Yes. Actually the original taprio design always had the enqueue()/dequeue() > ops involved in the data path, then commit 13511704f8d7 ("net: taprio > offload: enforce qdisc to netdev queue mapping") retrofitted the mqprio > model when using the "flags 0x2" argument. > If you have time to read, the discussion behind that redesign was here: > https://lore.kernel.org/netdev/20210511171829.17181-1-yannick.vignon@oss.nxp.com/
On Tue, Jun 06, 2023 at 11:39:32AM -0400, Jamal Hadi Salim wrote: > 1)Just some details become confusing in regards to offload vs not; F.e > class grafting (taprio_graft()) is de/activating the device but that > seems only needed for offload. Would it not be better to have those > separate and call graft_offload vs graft_software, etc? We really need > to create a generic document on how someone would write code for > qdiscs for consistency (I started working on one but never completed > it - if there is a volunteer i would be happy to work with one to > complete it). I would be a happy reader of that document. I haven't studied whether dev_deactivate() and dev_activate() are necessary for the pure software data path, where the root taprio is also directly attached to the netdev TXQs and that fact doesn't change across its lifetime. > 2) It seems like in mqprio this qdisc can only be root qdisc (like > mqprio) so far so good > and you dont want to replace the children with other types of > qdiscs i.e the children are always pfifo? i.e is it possible or > intended for example to replace 8001:x with bfifo etc? or even change > the pfifo queue size, etc? no, this is not true, why do you say this? > 3) Offload intention seems really to be bypassing enqueue() and going > straigth to the driver xmit() for a specific DMA ring that the skb is > mapped to. Except for the case where the driver says it's busy and > refuses to stash the skb in ring in which case you have to requeue to > the appropriate child qdisc/class. I am not sure how that would work > here - mqprio gets away with it by not defining any of the > en/de/requeue() callbacks wait, there is a requeue() callback? where? > - but likely it will be the lack of requeue that makes it work. Looking at dev_requeue_skb(), isn't it always going to be requeued to the same qdisc it was originally dequeued from? I don't see what is the problem. My understanding of the offload intention is not really to bypass dequeue() in general and as a matter of principle, but rather to bypass the root's taprio_dequeue() specifically, as that could do unrelated work, and jump right to the specific child's dequeue(). The child could have its own complex enqueue() and dequeue() and that is perfectly fine - for example cbs_dequeue_soft() is a valid child dequeue procedure - as long as the process isn't blocked in the sendmsg() call by __qdisc_run() processing packets belonging to unrelated traffic classes.
On Tue, Jun 6, 2023 at 12:32 PM Vladimir Oltean <vladimir.oltean@nxp.com> wrote: > > On Tue, Jun 06, 2023 at 11:39:32AM -0400, Jamal Hadi Salim wrote: > > 1)Just some details become confusing in regards to offload vs not; F.e > > class grafting (taprio_graft()) is de/activating the device but that > > seems only needed for offload. Would it not be better to have those > > separate and call graft_offload vs graft_software, etc? We really need > > to create a generic document on how someone would write code for > > qdiscs for consistency (I started working on one but never completed > > it - if there is a volunteer i would be happy to work with one to > > complete it). > > I would be a happy reader of that document. I haven't studied whether > dev_deactivate() and dev_activate() are necessary for the pure software > data path, where the root taprio is also directly attached to the netdev > TXQs and that fact doesn't change across its lifetime. I didnt go that far in the doc but was intending to. It was supposed to be a tutorial somewhere and i ended not doing it. something like htb will be a good example to compare with (it is a classful qdisc which is also capable of offloading). It is not the same as mqprio which can only be root. > > 2) It seems like in mqprio this qdisc can only be root qdisc (like > > mqprio) > > so far so good > > > and you dont want to replace the children with other types of > > qdiscs i.e the children are always pfifo? i.e is it possible or > > intended for example to replace 8001:x with bfifo etc? or even change > > the pfifo queue size, etc? > > no, this is not true, why do you say this? I am just asking questions trying to understand;-> So if can i replace, for example, with a tbf would it make sense even in s/w? > > 3) Offload intention seems really to be bypassing enqueue() and going > > straigth to the driver xmit() for a specific DMA ring that the skb is > > mapped to. Except for the case where the driver says it's busy and > > refuses to stash the skb in ring in which case you have to requeue to > > the appropriate child qdisc/class. I am not sure how that would work > > here - mqprio gets away with it by not defining any of the > > en/de/requeue() callbacks > > wait, there is a requeue() callback? where? Hrm, someone removed that ops i guess at some point - not sure when, need to look at git history. But short answer is yes it used to be there; git will probably reveal from the commit its disappearance. > > > - but likely it will be the lack of requeue that makes it work. > > Looking at dev_requeue_skb(), isn't it always going to be requeued to > the same qdisc it was originally dequeued from? I don't see what is the > problem. In the basic case that approach is sufficient. For pfifo you want it to the first skb dequeued the next opportunity to send to h/w. Basically the idea is/was: if the hardware is busy you may need to run some algorithm (present in requeue but not in enqueu) to decide if you should put the skb at the head, at the tail, somewhere else, drop it, check if some time limit has exceeded and do something funky etc etc. > My understanding of the offload intention is not really to bypass dequeue() > in general and as a matter of principle, but rather to bypass the root's > taprio_dequeue() specifically, as that could do unrelated work, and jump > right to the specific child's dequeue(). > > The child could have its own complex enqueue() and dequeue() and that is > perfectly fine - for example cbs_dequeue_soft() is a valid child dequeue > procedure - as long as the process isn't blocked in the sendmsg() call > by __qdisc_run() processing packets belonging to unrelated traffic > classes. Does it matter what type the child enqueue/dequeue? eg can i attach htb, etc? cheers, jamal
On Tue, Jun 06, 2023 at 01:42:19PM -0400, Jamal Hadi Salim wrote: > > > 2) It seems like in mqprio this qdisc can only be root qdisc (like > > > mqprio) > > > > so far so good > > > > > and you dont want to replace the children with other types of > > > qdiscs i.e the children are always pfifo? i.e is it possible or > > > intended for example to replace 8001:x with bfifo etc? or even change > > > the pfifo queue size, etc? > > > > no, this is not true, why do you say this? > > I am just asking questions trying to understand;-> So if can i > replace, for example, with a tbf would it make sense even in s/w? > > > The child could have its own complex enqueue() and dequeue() and that is > > perfectly fine - for example cbs_dequeue_soft() is a valid child dequeue > > procedure - as long as the process isn't blocked in the sendmsg() call > > by __qdisc_run() processing packets belonging to unrelated traffic > > classes. > > Does it matter what type the child enqueue/dequeue? eg can i attach htb, etc? So in principle, the taprio model is compatible with attaching any child Qdisc to the per-TXQ child classes - with tc-cbs in particular being of interest, because that is a TSN shaper, but also, tbf or htb could be reasonably imagined as children, and taprio doesn't oppose to any Qdisc as its child. That being said, a non-offloaded cbs/htb will not work with an offloaded taprio root anymore after commit 13511704f8d7 ("net: taprio offload: enforce qdisc to netdev queue mapping"), and IMO what should be done there is to reject somehow those child Qdiscs which also can't be offloaded when the root is offloaded. Offloading a taprio qdisc (potentially with offloaded cbs children) also affects the autonomous forwarding data path in case of an Ethernet switch. So it's not just about dev_queue_xmits() from Linux.
On Wed, Jun 07, 2023 at 01:09:01PM +0300, Vladimir Oltean wrote: > That being said, a non-offloaded cbs/htb will not work with an offloaded > taprio root anymore after commit 13511704f8d7 ("net: taprio offload: > enforce qdisc to netdev queue mapping"), and IMO what should be done > there is to reject somehow those child Qdiscs which also can't be > offloaded when the root is offloaded. > > Offloading a taprio qdisc (potentially with offloaded cbs children) also > affects the autonomous forwarding data path in case of an Ethernet switch. > So it's not just about dev_queue_xmits() from Linux. Ah, no, I said something stupid. Non-offloaded child Qdisc should still work with offloaded root (shaping done in software, scheduling in hardware). I was thinking about the autonomous forwarding case in the back of my mind, that's still problematic because the shaping wouldn't affect the packets that Linux didn't originate.