From patchwork Tue Jun 13 21:54:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 107580 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp847224vqr; Tue, 13 Jun 2023 15:00:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6RdubuFNk1lW455Dbk6xA6vd0oZLgIMSx/s3taZKtE/a7IgHfd0aaVESDVHXahYWt6wGMT X-Received: by 2002:a17:906:c156:b0:978:a186:464f with SMTP id dp22-20020a170906c15600b00978a186464fmr16079232ejc.39.1686693615005; Tue, 13 Jun 2023 15:00:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1686693614; cv=pass; d=google.com; s=arc-20160816; b=BYMgi38ofgYiGEkYbp6p+yEpiyPvq8En+6FAfUWXUkX72i3gwsEaJuUjUIxpA3Oxen Br+I4vlBWcOYOrodqon1IqYSrZB0OX95/wH5K1hXGCqUMXa2tH1UOxbIhyvAxoRPwcck ibpzkR2cp/CjTiF8WbBXnEGGUw3c1zBNwVW+zwMFv7XHeIZyna60sd8vxN/S7Stv+b0a qvVy3k/rILEg8ZUJC1qJfOEF3Sn8fjQnoSumvmO4rtQ/RU0u3+6ecKvSEE+qYniF/IkV XndwBLIGiTVnp+5bV+x/Tas8L8kraeBlAV7fUXSAd4TVbgmpN173WG6A/dUa5l8riVuu XNLQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Hn3UpXO7Q00pu73vp9aNHjp4lHyawb9kYjNGwhFg1Go=; b=bf4NT3PoEQfb4LWsz+BiyQtihuOozecCUu/U5bwYOTPSMeuA+iHxOrl757GRSYZu5S AaGeao0QRGjc8e2yx0u1rKrk/jYBzWKmPeVrYfwT9CznhNlCWK5cYhWpiMTYCsDf+P2D 11Az/clJRPN4c5nRc5SZ/oQGXPx2HyKVhmXr/FFG3aFxt3mBRJ7Ih4QDCV1RktY43ZAc 5ENu3m5CkdZ6rC+l6LjWHco5XhDO913NG6Xd/eyG8RyE/QlgmigmQgu1YwF9gMwGz06O gj2izOSZIbaXNYkuVSpcEE3/HP8hewMvri0sYuIYnV1CuCHkWAP+t4BL83QmlvQzuZaL RQgw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=PApYOyTp; 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 jz7-20020a170906bb0700b00978ac2d2bd5si8083781ejb.81.2023.06.13.14.59.49; Tue, 13 Jun 2023 15:00:14 -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=PApYOyTp; 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 S240421AbjFMV5y (ORCPT + 99 others); Tue, 13 Jun 2023 17:57:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233934AbjFMV5V (ORCPT ); Tue, 13 Jun 2023 17:57:21 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2076.outbound.protection.outlook.com [40.107.22.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F06C26AB; Tue, 13 Jun 2023 14:56:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MIuqSQ8f+1PYvrTpLUjUVv9IktO/rsLTYu3QPbQAEa4FV2MopKbmwsX5vmEhBxjSeT5hGl+xkcaqv9/78EqhLFkduVYfO1S2mCFr8gt6SmiLwjJivBZINYKMAMMVBJ3RCjiemNioF9pIILN3ZGokG9KotEx8W/dChqCYUmH/wpfVPZ8RTycqpK+dq4xJd7nwb4i1R/d5XflOE/1yP/slPhoIUlfLHgUibrLTEgpaB0x/TtkC+ZCgnmOdoOozwPYlbLo/5bNH2Csu0cI4NF6ZMWGKe9pkIxkxpqkmi2P+nMoUMB3/vZUmnoJykqRV00CLW+Yg15e4EjMyUmgFcOri/A== 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=Hn3UpXO7Q00pu73vp9aNHjp4lHyawb9kYjNGwhFg1Go=; b=ljyQPAlN+weF/gLkA5IFNsOmcl9LNluBiCVHKKJbHOx/hPaCYscJYK8gPf/2yv1A6Ehf629TQ+HRmGKiuwonCy59s+AolTJsRY/+dNu+FeTKnBUhjP1SCJBTolqFxXnIQK2pyJLt3KMCaj+L9C8CJpjfF2njRN9uG7yYgysr9R6kAVtvnDOJVNB7i9MbreT3XWvolbjFfg93yWaikNOCVRwnkXM4LaXm5WPK5vb1IvuxIm3/JPHJxIsriFsdq3nXAAubWxPGiD+0rkTRqjYWDBL64Siblr+r1rdSiSGBGThRTGRH2YSiuXdAoW/kz+TTeBzwBO0TsSbF5guAZZiozA== 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=Hn3UpXO7Q00pu73vp9aNHjp4lHyawb9kYjNGwhFg1Go=; b=PApYOyTppmBbg7Axee/EN/5rLLspGJEjokgiZes6Qisbr1ozxLi5g6E3KZz/BjNPW5n5xZt4rEYGXnt6pjJeeQ7IVeAcfRER5FMIIdq5/etfcoyiF+zq/saj08m0Ha00DUfsnxvpFD6+aijUTE37ME2BcZHUQSyzj9Rx2+Yngv8= 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 AM9PR04MB8081.eurprd04.prod.outlook.com (2603:10a6:20b:3e2::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.29; Tue, 13 Jun 2023 21:55:02 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::c40e:d76:fd88:f460]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::c40e:d76:fd88:f460%4]) with mapi id 15.20.6455.045; Tue, 13 Jun 2023 21:55:02 +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 , Richard Cochran , Zhengchao Shao , Maxim Georgiev Subject: [PATCH v2 net-next 9/9] selftests/tc-testing: verify that a qdisc can be grafted onto a taprio class Date: Wed, 14 Jun 2023 00:54:40 +0300 Message-Id: <20230613215440.2465708-10-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230613215440.2465708-1-vladimir.oltean@nxp.com> References: <20230613215440.2465708-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AM0PR04CA0044.eurprd04.prod.outlook.com (2603:10a6:208:1::21) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|AM9PR04MB8081:EE_ X-MS-Office365-Filtering-Correlation-Id: a4a82d6d-17ed-4dc6-5a37-08db6c58d722 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nvUdjeURrhh5MeDOyFsQ1IeSQAq+T5BJjcNi6A66BARaz5bcvMYaucoxvML4qA1E3TPLHMXsMU7lDr7kXkcbFhmPNlaU2XMwRz49iAOIK6BXGf9C9FG4t62HN1WyE82PYBo2lQwSsOth+3NCtRrS4xyoTE3KTsFp5iypmhdYOxzN3x81iN3oNnHy18GYeLsVZ0vNxval6kyV2BKKEcPDQdRrDhh//gR6EJmyvCUKJqm+8xs7cZGlEWpwvCkl1djtKIdgFXcmPk9v00R6wgjQmyUMKYALKm2VJPYYiseMBDEMQj9by4HzPxJh6ovUsV+TuR5EXSIQSmCr5MPEotgHarPQjLuOhRJ9Onl9N/kl25pAufBp+EINo8XvNLLGPIy2f3Ep600WbqU6XKPegSxh1W68JmyuGwN7dL0TQrULsGXY3yLVtBx6gqPf2ZOsEX9YGwzDcopjsOhsOtkXwONX+nPlauzPQw3rwZGuhMJKFdDvVveRLqMP/v6hCi2RBUadnd++6/3utezNhTt6jgdXuvXFd2y2z0SGV+XrauBzrC8foM0kbHK6xQqzNu0INdBpE1OOFFHr+t9Yp4QDfOkpvEBjLRjU796/RUJrK4jH5SDi2+7j5kkLbh0Xvuq74ZX9 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)(136003)(39860400002)(366004)(346002)(376002)(451199021)(15650500001)(6916009)(66946007)(4326008)(66556008)(36756003)(186003)(54906003)(478600001)(2616005)(2906002)(66476007)(8676002)(6666004)(316002)(41300700001)(86362001)(6486002)(7416002)(6506007)(1076003)(8936002)(44832011)(83380400001)(26005)(5660300002)(38100700002)(52116002)(38350700002)(6512007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6APviM9EZjXSD7y90t+V+aXQjlPyzR5o8XkEpFk50NRRpg/QHI/SaFYO0WyLPt2YfVzL1ngxEKOazO6l5UXxqN1evCI1atSFBF92Q/yo9m8SB1Pm5mhEkHmPqkLespf7edMsnoN146QnT30nsmfLuSHq/1tZls3ZOQ5vgNzlVnS9wZL+60Jw2P7yABwj02o3Li6Smfobx77nSYDRdqT9zEsjliaiBQu1Q8/sLIEx9LEhydGm/AiRnDFiJo67z8CDavsOfO68Snzbvoyb5gH1sW9Nm5v6gX37RMkp+N24Z+23RDq+T/VUQsi28vR2N8BEQE4Bi/gMp+cNzwD5NT3Ykgjt5v0L08GR837csv9x2SaRjJl8/jiylbsGllKvALQkQG0lQA4hjeZLDT61Mn+pXHMTYP0NvDzkCy/XFy73XJr2BqCAKmHZ+G+OhUpAduDJaaBfgUKF93l145Lyp6M6JbdwrE5jL2ow2oQi2lirUp0MO3k8jzMDxL0dYdKw05gvB0svhbIihM3XdZxhQO1DrX/tPHtkEBOU/8RWrESLU9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w== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a4a82d6d-17ed-4dc6-5a37-08db6c58d722 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2023 21:55:02.6724 (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: 8pVfWFRrPhUJ2bB/6gIXH+DMfTtRM4GIhAQulJ7paTHnU8KORpYzMXnRVWvEfWEECSGqkdZxyElZYS6FMRc+gA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8081 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768626444139258790?= X-GMAIL-MSGID: =?utf-8?q?1768626444139258790?= The reason behind commit af7b29b1deaa ("Revert "net/sched: taprio: make qdisc_leaf() see the per-netdev-queue pfifo child qdiscs"") was that the patch it reverted caused a crash when attaching a CBS shaper to one of the taprio classes. Prevent that from happening again by adding a test case for it, which now passes correctly in both offload and software modes. Signed-off-by: Vladimir Oltean Reviewed-by: Pedro Tammela --- v1->v2: patch is new .../tc-testing/tc-tests/qdiscs/taprio.json | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/tools/testing/selftests/tc-testing/tc-tests/qdiscs/taprio.json b/tools/testing/selftests/tc-testing/tc-tests/qdiscs/taprio.json index 58d4d97f4499..47692335bcf1 100644 --- a/tools/testing/selftests/tc-testing/tc-tests/qdiscs/taprio.json +++ b/tools/testing/selftests/tc-testing/tc-tests/qdiscs/taprio.json @@ -179,5 +179,55 @@ "$TC qdisc del dev $ETH root", "echo \"1\" > /sys/bus/netdevsim/del_device" ] + }, + { + "id": "a7bf", + "name": "Graft cbs as child of software taprio", + "category": [ + "qdisc", + "taprio", + "cbs" + ], + "plugins": { + "requires": "nsPlugin" + }, + "setup": [ + "echo \"1 1 8\" > /sys/bus/netdevsim/new_device", + "$TC qdisc replace dev $ETH 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 base-time 0 sched-entry S ff 20000000 clockid CLOCK_TAI" + ], + "cmdUnderTest": "$TC qdisc replace dev $ETH handle 8002: parent 8001:8 cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470", + "expExitCode": "0", + "verifyCmd": "$TC -d qdisc show dev $ETH", + "matchPattern": "qdisc cbs 8002: parent 8001:8 hicredit 30 locredit -1470 sendslope -980000 idleslope 20000 offload 0", + "matchCount": "1", + "teardown": [ + "$TC qdisc del dev $ETH root", + "echo \"1\" > /sys/bus/netdevsim/del_device" + ] + }, + { + "id": "6a83", + "name": "Graft cbs as child of offloaded taprio", + "category": [ + "qdisc", + "taprio", + "cbs" + ], + "plugins": { + "requires": "nsPlugin" + }, + "setup": [ + "echo \"1 1 8\" > /sys/bus/netdevsim/new_device", + "$TC qdisc replace dev $ETH 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 base-time 0 sched-entry S ff 20000000 flags 0x2" + ], + "cmdUnderTest": "$TC qdisc replace dev $ETH handle 8002: parent 8001:8 cbs idleslope 20000 sendslope -980000 hicredit 30 locredit -1470", + "expExitCode": "0", + "verifyCmd": "$TC -d qdisc show dev $ETH", + "matchPattern": "qdisc cbs 8002: parent 8001:8 hicredit 30 locredit -1470 sendslope -980000 idleslope 20000 offload 0", + "matchCount": "1", + "teardown": [ + "$TC qdisc del dev $ETH root", + "echo \"1\" > /sys/bus/netdevsim/del_device" + ] } ]