From patchwork Tue Feb 7 13:54: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: 5081 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2861884wrn; Tue, 7 Feb 2023 05:57:40 -0800 (PST) X-Google-Smtp-Source: AK7set+GSERjPcNBP27Xb0bQbgVBSzGWn73bWrapErDef/wItYSaMlYDK5Nd7D0Js8rLODY6CAZZ X-Received: by 2002:a50:cc8f:0:b0:4aa:a9c7:4224 with SMTP id q15-20020a50cc8f000000b004aaa9c74224mr3944038edi.30.1675778259961; Tue, 07 Feb 2023 05:57:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1675778259; cv=pass; d=google.com; s=arc-20160816; b=f+mhGe2xqsg1K6jvF/XubCrZxi37PXyCxBJmBQOCXP7MY2G9OLlyLt4QZAK1U4bUHE 9zEOIGRNDfOZRYYlUcp708hZyfCFYAkEebylbDx+i3/JybJt5NLsh3o3nNJ1+f98ARpX 42cluoqOgRO3WEJ+fIWrlR7YTXDzJVDYIYYVKy06KkXk8is/8U9qBx+ESTRa4PGoogK2 GVvb3MDdY1nFHqYu9ddPmYIZQdHYQCmkj13nqVTolEpCZwQFZZcCjuTm4GJWuBFjWOuL N6xUntQ0VlYU5dD5jkMe95FBxqTHUp1mmLskAURtOoU7S9bobO1ceKSH4UPrlmrnJse4 v2LQ== 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=b5p1G6HAb1hNypaegy2b0d9rW7m3NXjhbJuqIVcuxMw=; b=UeCLbc+qteQmv4+A4q9oJejinSC1NzZ4iGkdYt1lBs5k7vL0Lb7cp172M9prJ+ItL9 MkyusGorS/wg7pBSY86QElgTsJYlkupncIWgGWRLghXq8rXLxaAXv5rUAH3vMjTs0V82 zikHq5XpCnFHyuvTesa1M61ibwCfqf5ADZ6fEzqj3dVchKrGubTBBfy+fgcB2CusrjgE xPeie5Q37RJ6YrL9fV0wK1jywMRvhgN5Q+M4YYeRgGR5SrQpSpsDIcoevK+ZE+FKpKaT SVcJmQKZtqhJTDFr2joYQMdpJrwy+3q4Od54hDa7Bc8ctkq4FiOq/7WRg+Lv3fFKiFcr wRJw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="l/i5KWJf"; 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 w11-20020a056402128b00b004aab5e65d97si5552383edv.187.2023.02.07.05.57.16; Tue, 07 Feb 2023 05:57:39 -0800 (PST) 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/i5KWJf"; 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 S231779AbjBGNzI (ORCPT + 99 others); Tue, 7 Feb 2023 08:55:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230194AbjBGNzG (ORCPT ); Tue, 7 Feb 2023 08:55:06 -0500 Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2081.outbound.protection.outlook.com [40.107.249.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 743AA9B; Tue, 7 Feb 2023 05:55:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JWnn8Qn+IzGlOxCU0evRb8i32851Bj2YHRJmhStpglQHmJsM22WudN9a0H/jo674qcSUsBTJTFcK+fT3SMuc7tqjZSzi3PuML5F0+Cut7JtRMGcA3D4nNtmKTGhGT19obR8o8/Ay3nhRfyzb6VBAbmXP8QESHiC+YS7ns5uagNU0htCB7g+kf9KErX86pyIkG89PfJVY0rKZewpOesBScLeg+houEDe6PmmFFt6959q/0YRZ0jcFbxBYZiwliLt8KxVm6x+lhhDn+XtwnwWZCJo3GKZWRIYrJD4xx0NV88utQP9bdEAATSpzz9p6plsQW6xPihSsReRykGgF/UN0wQ== 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=b5p1G6HAb1hNypaegy2b0d9rW7m3NXjhbJuqIVcuxMw=; b=XGUdSzxnn/ezTjZdkAnVZkjo8pazmB7SB3czBs4n+iWAKirJejAIP1Vykj8SxvbuoN1fQtlr/4u7ZpkniIvGKSN7bQAGWS/XsfrYjGTfLVixZdK1VNrweDtRFRI+fRjmJkvcqXaQra+KUc/ZVIUaB56YCZvXeO4pRzD+LnW3YodTni/82LIDXrhENufEBLhTFW35NE3uBNjL0ZBOeG+b8TOXRVpcfCVi4EJY38xX45KHwsnoU07k055yiA4WS3pzmYoqiT9uOvolqaofa01TcnHbWV0v7Sr8oRAMWr4P7iwkT/ebpdSN+vSBSbX7MQelf1ovNnyaypcXXbC7jfDjVA== 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=b5p1G6HAb1hNypaegy2b0d9rW7m3NXjhbJuqIVcuxMw=; b=l/i5KWJfMP/PD2JPcsFjx/Ayu5gGWzPLK3xVyAyVP5FpJFpIa6YQKSzTr4JPTQatOmGxRKChmM4OYRScU4Z7fDXf7x1WvLJUIwaJIPDVFomPnQRJ9Iymj8CLxbG8+rQEhk4e6Qa1/+uv6X8fkGMkLFlE137FgnKdAdOVFyuRH7w= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) by AM9PR04MB8115.eurprd04.prod.outlook.com (2603:10a6:20b:3e8::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.36; Tue, 7 Feb 2023 13:55:02 +0000 Received: from VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::3cfb:3ae7:1686:a68b]) by VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::3cfb:3ae7:1686:a68b%5]) with mapi id 15.20.6064.034; Tue, 7 Feb 2023 13:55:01 +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 , Kurt Kanzenbach , Jacob Keller , Gerhard Engleder , Jesse Brandeburg , Tony Nguyen , intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 net-next 00/15] taprio automatic queueMaxSDU and new TXQ selection procedure Date: Tue, 7 Feb 2023 15:54:25 +0200 Message-Id: <20230207135440.1482856-1-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: AS4PR10CA0023.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:5d8::15) To VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB5136:EE_|AM9PR04MB8115:EE_ X-MS-Office365-Filtering-Correlation-Id: a989b726-989b-45e8-a65c-08db0912e83d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DCMA73mZajFQW2HxDidUr4RtPgGO6qNm6lmI7Ew3Wg+tURsHfhBB7dIP8NFbnYF1whfiMs4lWuQayYadMt7lPCbtwpUeC9qgR3RDkAoJLgYx3hv/aLR7m33NyQkl4hZXMBGy5j+sf1bqeuxk8V3mJe4FIT/zOJsb0L/nfBk3QJGGDOqkiha2NmXUtj7z2gnXyaoizZszeUmx4qvz9BdyRSS3fn5KXh4SMSPcszg7xqtpbrtLVPJZQ5r4PTN+MPB4e+liHim+/jfIdFpBQM8+NrtDflWXi8s/U+vzyAhzXYlPDFt4zJJiaDhFm6+EfPjAleO6YJLb+v0BM9pS5BlFZ5cYmaE8Scauya2/DXoraHzolj/hBx/mszfoGVR/TiJT3u3cYjEsHA9LAAPGmjLLWrM9eJwIXl3+n14cL1NZXfLi/qr3EBQ6c8hzxq8tJw3qDyLQp2LO5Pxbe2VJt+9GIqNuB2a9igN/ciQEsnrRlduMNqgyADh/A4Im0KRW1XaIK+5895kQxnhrwazGwpaQimecDpWy8/gAvfde68KSpamg3hUBUbotsc4jB0ODiDFH08WVVK/EzZn1/ouO0DyeFnhrMSvq4l23v1JJGm/gZU0E2GiShHgg6fv14R/qCw5YKDfUS/VOATmLRaZtqFDcTrbEtrqKAlMoWHBa3Orj18v+V0Vw+UEc3CV9bOjVxggNKhDiIHiZ9rU+Z9YjYFRuUwRMTsOe3qpdVhrogr9rzoY= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5136.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(39860400002)(396003)(346002)(366004)(136003)(376002)(451199018)(2906002)(8676002)(38350700002)(38100700002)(316002)(83380400001)(6916009)(66556008)(66476007)(8936002)(4326008)(41300700001)(44832011)(5660300002)(7416002)(66946007)(966005)(2616005)(6666004)(1076003)(6506007)(478600001)(6486002)(186003)(26005)(6512007)(86362001)(54906003)(52116002)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /Jx+WN4Y1HTuYaCk21jwWUhTfsih/4ZOLVT8Rl06MxrjOxc/DmkyjwEreuDHnrfNiXds2mYfIUcyjTOReaVuKokmdJPSIrChDanDAg4BWKveZ4ix8GF6fbVlI63CHTxCIYjKJNv64Q06Rrk2zPJOcN6UqB/h+DwOwN0CqcMn9X8DrXbhjhB+S9R3xU2HD1/uvZFAKeAdH6wg6nZl3/D5MRE4zFQZXIQlVDHuPS198ElWk4TTx2d8L0N8anZm4uXqTLbHFm2nTazQnyfSALYF3wZNCyWNoAzYlcBeUBZq79rEEAnShta1QQyg7s08tJ/wnJ8H792rmntEqTupCSnMXy0JhuC4trgz7HSu3pZLLLTle5LuwA0jHLwJSxTH1xKuEwP0JeZbC/xQvHAlCo1x/6GiWySqy7lRoY19PnXiWktCxVQfAarJZeK2uylJi3xOUiCxaKUV1cOq9jwZ4R4ifL8OYgU9grwYd0fEGh2SI2XHz6hFA31yWvIy1wpCdRplBNJbkk4fKbtTBocrwlH8sZtSTlf3sA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YKYWw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a989b726-989b-45e8-a65c-08db0912e83d X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2023 13:55:01.7535 (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: LmR8Ia1ZPhAIFak51hPBAg0vylhiueOCzoCIbdzVw74YEu9RkdE6tFCpTeUehnByB4kjmWjdPgJcKJuGFVeZzQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8115 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 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?1757180864509818039?= X-GMAIL-MSGID: =?utf-8?q?1757180864509818039?= This patch set addresses 2 design limitations in the taprio software scheduler: 1. Software scheduling fundamentally prioritizes traffic incorrectly, in a way which was inspired from Intel igb/igc drivers and does not follow the inputs user space gives (traffic classes and TC to TXQ mapping). Patch 05/15 handles this, 01/15 - 04/15 are preparations for this work. 2. Software scheduling assumes that the gate for a traffic class closes as soon as the next interval begins. But this isn't true. If consecutive schedule entries have that traffic class gate open, there is no "gate close" event and taprio should keep dequeuing from that TC without interruptions. Patches 06/15 - 15/15 handle this. Patch 10/15 is a generic Qdisc change required for this to work. Future development directions which depend on this patch set are: - Propagating the automatic queueMaxSDU calculation down to offloading device drivers, instead of letting them calculate this, as vsc9959_tas_guard_bands_update() does today. - A software data path for tc-taprio with preemptible traffic and Hold/Release events. v1 at: https://patchwork.kernel.org/project/netdevbpf/cover/20230128010719.2182346-1-vladimir.oltean@nxp.com/ Vladimir Oltean (15): net/sched: taprio: delete peek() implementation net/sched: taprio: continue with other TXQs if one dequeue() failed net/sched: taprio: refactor one skb dequeue from TXQ to separate function net/sched: taprio: avoid calling child->ops->dequeue(child) twice net/sched: taprio: give higher priority to higher TCs in software dequeue mode net/sched: taprio: calculate tc gate durations net/sched: taprio: rename close_time to end_time net/sched: taprio: calculate budgets per traffic class net/sched: taprio: calculate guard band against actual TC gate close time net/sched: make stab available before ops->init() call net/sched: taprio: warn about missing size table net/sched: keep the max_frm_len information inside struct sched_gate_list net/sched: taprio: automatically calculate queueMaxSDU based on TC gate durations net/sched: taprio: split segmentation logic from qdisc_enqueue() net/sched: taprio: don't segment unnecessarily drivers/net/ethernet/intel/igb/igb_main.c | 18 + drivers/net/ethernet/intel/igc/igc_main.c | 6 +- include/net/pkt_sched.h | 5 + net/sched/sch_api.c | 29 +- net/sched/sch_taprio.c | 639 ++++++++++++++++------ 5 files changed, 500 insertions(+), 197 deletions(-)