From patchwork Thu Feb 16 23:21:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 5529 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp582810wrn; Thu, 16 Feb 2023 15:22:46 -0800 (PST) X-Google-Smtp-Source: AK7set8phN7UpWh8sdejPVXs5nv13PAgZYnymchK/ZRCcTQ48D9ePWiecTafvPlu1DalYV9HcOkX X-Received: by 2002:a17:90a:5d:b0:234:c031:45df with SMTP id 29-20020a17090a005d00b00234c03145dfmr1338007pjb.8.1676589766660; Thu, 16 Feb 2023 15:22:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1676589766; cv=pass; d=google.com; s=arc-20160816; b=M/cKnRH84YzVhD+UqMeN/pW+uzmOSFRI6KAba0y+bBcIUOZegDUiikEBIRorv/MMVB 905arVUdZemD80QLW4LTbcO8KgX1HnBz60hVAY99GKNypWOQGwLeai2abSmFXB/A1uh6 5BQoicKR31wCnRCoMh4YVBuXTu1yjDWQID1JqGLcVTsBuMVQghIwSkKG6fIQgx8/OBF+ y6FLGwJHgqyNVXdRm7X4aVbV1+2KHhIumIPExNmJyaCIQYwIdhCVNqByFAWjV1U09Jho WOqt1FlogzhqZpyicSMfyIzee8ZRl1PtWf3f04m3a9IrwKbILq89rtzSUE8r+aLBG9+z vftA== 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=qtUY4vbwbx9PSmMlkrh0xLObLuYtE7R/er+iSSTFwqE=; b=GCr0ZkKfWJoGRaLJFMzqhHVHj8th3Wu4T7y3GcxyPkE+7Y/Dr95X7Fu5qZ/d++Y+wC cJN/yY8K8WTAzeht68hpRxTFpAAy8RrCfH0Wy0oQMCE2hcVGmXmjXkrRhJABDEMvACkA tqAm/B06H8BKzV5IZsjPRh8MINhuZ4av5uU2uJ6vIo6RPBmL+vp4o9jHODvNXMuXmy6g kCIYF2PnPoqmi3P6jsl8VzUsg2D3wyscj93Z3zxEmbD2fF3FKXn4+0G+3UBSlKs5ZKwZ fsYEEADynJLHiT72gOy364clK234G8iQ+iht7a0oRwVS6xXYZqTIN3qMvSdmXB24jBH3 72Kw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=f8xlaZ7b; 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 g12-20020a17090a4b0c00b00233caad2a94si2732433pjh.156.2023.02.16.15.22.29; Thu, 16 Feb 2023 15:22:46 -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=f8xlaZ7b; 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 S229629AbjBPXVr (ORCPT + 99 others); Thu, 16 Feb 2023 18:21:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbjBPXVp (ORCPT ); Thu, 16 Feb 2023 18:21:45 -0500 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2046.outbound.protection.outlook.com [40.107.104.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCF88474DA; Thu, 16 Feb 2023 15:21:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RsLJOcM/1k5NbtdJ0RbsBDO0U/KEUYr7ZJKZYom/WxPFk9XbFIhnRJHuZLR1iUaGCx6O2aZ/fBjFFnxVgBX0Nbn+L4u/FAjVKvm5aMHDj2j/W1tycHXWHgdOI+ADYq9cB4jpa2tOAyDtwEScWLjUF47MVSrR4B/lkZEeCvpOs82p//+uTCvAx2PN/Y+Q+8P2LvZ0OuppinpgVZM7JJ1NMflt4AvNuAgV8xk95KnJI4Ao5SvOcjs6SY4IcrjwvrTyhyPm6P3/oDIrWgRB9FwDupsUuZaG1bnlfreWmIqkJfx7JA4DP4cpKtmgaNAfRSaGqFVdG+gLz0rGl+nNUkHryQ== 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=qtUY4vbwbx9PSmMlkrh0xLObLuYtE7R/er+iSSTFwqE=; b=Y2j6Ffmga09ac+QSt5K+CI37+6Py1Uto2RE0+7FCtt+ZevnQNRecusWcV4JVN2Ql1Uz2P8dNjouNOO7CMYprLZSymf9/SP0LJIN8vlu7m5GotVKBxM5NDCVrvLZtk2ShFQa9LITs+gg5LHkf1zATQyxNWFVjTzmPh1jrve2b/LaE0uvl+Os6YfBGZhtV1C6LO3B44GYuCXR/z/cyq67KSwABT9I7fb6NIRXiglEw3u1FTx+1B9XrXmPkpDbNL5cqmYvQCfvwlRhGMGjYcCbg4pJ2uYotYMf7MHUh6RSDUVmOhMidg8Amr45JI8B1KyWCnldSN+wp2getLnl7Ze4nQA== 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=qtUY4vbwbx9PSmMlkrh0xLObLuYtE7R/er+iSSTFwqE=; b=f8xlaZ7bGIN4t0gaXxfEycuQrjeDXUicbdkTz+CQnRKVp7NPycew6Tc2dLIoSgSa63qm37wVzFEKM+/9oQdlGsogtTbW72lnbReRzNhq/PLQ3nJix6gNDcXCKrCL6ngnIP81XRMDGYSCaadQIBavMOWo0FbQ/yDj6ZQQa5fvnJ8= 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 PR3PR04MB7436.eurprd04.prod.outlook.com (2603:10a6:102:87::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.26; Thu, 16 Feb 2023 23:21:41 +0000 Received: from VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::3cfb:3ae7:1686:a68b]) by VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::3cfb:3ae7:1686:a68b%4]) with mapi id 15.20.6086.026; Thu, 16 Feb 2023 23:21:41 +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 , Gerhard Engleder , Amritha Nambiar , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Andrew Lunn , Florian Fainelli , Ferenc Fejes , Xiaoliang Yang , linux-kernel@vger.kernel.org Subject: [PATCH net-next 00/12] Add tc-mqprio and tc-taprio support for preemptible traffic classes Date: Fri, 17 Feb 2023 01:21:14 +0200 Message-Id: <20230216232126.3402975-1-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: VI1PR0501CA0018.eurprd05.prod.outlook.com (2603:10a6:800:92::28) To VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB5136:EE_|PR3PR04MB7436:EE_ X-MS-Office365-Filtering-Correlation-Id: 63493869-a5d9-4907-3c2c-08db10748f5d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3weF1LUhTf7TRZImVNnND1v/8WGSjYzcot6v5T9EDtiaqFswZPMoS3iwqSpbWazV0z9MhbvW/9WS+vBM/Cldwuo4qeGv5/9PksLI3NAFFx2MsvDN40G43Z5RvX4mjck8oN390cRFQYo+S3rrIFZSvej0YoMt426xVsuxVzKxJtFui81G7pv/3RoInuZ9x8BynoyJq4AYcVXYhtzhjiGePAsyzF1qmjB/Y3A7YGnfmQq7d0jkE31edOfVV12ewvoetbC3SEhYar5E8XfXADgi5LMjJkO16ixSfIs3q3AzmfLzMe+krHF/Se5rhs8e7gcS7IlKbxqL0goGTJZ9SLe5QQ00XasfwSUfsxbUcQnOIDmmpuWkcPIPerNZYTH2JOkR1qSlY5MAjNXAKXZE3JKJ2g4YXZwZFFuiv1rZm+7dRW9kPTeJjN6THdMDA/x7VsmiSi9/1wrbB2ZA/cLZJxu6EwIOnXtCttIQbahChZCuhgNNQ9Uj0nB/1mgJpGqPYm8AbV/xzGqyI5Q5lRIdjjT5kO12HB4peQgJhenBSvxBrbHH/NI9CagIOoGsEn4ktkNa5FTUA5mVZOss0Nf9lQcw0g+KOO6h5flY5ywoOxdFFk/mz7ESOgWNTTsmYaMdPT+3CfmuClBXqo+PeqA7/4VshKcFwlmpKfwhqYocwdxF8fbSchCpQe2cScLVPDm0MatnJC2+ILjcG2Fmbycgsdp8sE9FeBkmswu6ZVtzHYYDPe0= 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)(376002)(366004)(396003)(136003)(39860400002)(346002)(451199018)(38100700002)(2906002)(38350700002)(44832011)(7416002)(83380400001)(66476007)(2616005)(966005)(86362001)(478600001)(6916009)(66556008)(36756003)(5660300002)(41300700001)(6506007)(52116002)(6666004)(4326008)(66946007)(6486002)(54906003)(186003)(316002)(8936002)(26005)(6512007)(1076003)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WOp6uLxxNBaWZWCPLbGVMhn/1yohOgypJBvkUXUylhlMP6x25DV4brqJlfvN3f2BZn+XTmLV6AnuJJQU2Ih56dIixIu+VmKcEQ/qM3/MakqaF9GFsrvwWSEibfgRhl8ZzDhsOuLflN5u5wyBDiz29bE2ywG5D+UrhgDhd4+F3ZILYH2x2P384ReMH5enLdNdvaTZ9YMHHlB/dAp5V5qbtPJNWd7+pM7KC+qVvx6QMJtyCYKpsTZGByr+oBNeNsCUD05k5UrHh4xh381sqhehsMG76U6fE6TwlIp0b5NTko+TUFsLK8qUB1vwmgx7jEW8cyUSqk6Apoeetzf8+pRL5PbelXgqgAIkIMzGw/p3xNfHqAOgAuJpc2+olzE63T+X0zPqaxRGoraGQwXiwEQ3FUNBLBdk/M4FjdLP5NvGAX5ifXRTa4MEMKegpSPp3r7JbkaQuNH7N41dNe7G+L8sqjmV7yDjbCRe4yzmj6YKeDnd4RrNb2B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UOq5H7SzE+3TEFj6uMQI8LhhnEVkRQGgw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 63493869-a5d9-4907-3c2c-08db10748f5d X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2023 23:21:41.3059 (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: 53ETtrItl0q3lr+zpDQ/l0+a0Wm4C6Ts/jDjOoj0ntGD4Jchugt9++qeAdb9Kpz5nbdRo6U4rK4EN/jesZGCKQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7436 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_NONE,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?1758031790673890620?= X-GMAIL-MSGID: =?utf-8?q?1758031790673890620?= The last RFC in August 2022 contained a proposal for the UAPI of both TSN standards which together form Frame Preemption (802.1Q and 802.3): https://patchwork.kernel.org/project/netdevbpf/cover/20220816222920.1952936-1-vladimir.oltean@nxp.com/ It wasn't clear at the time whether the 802.1Q portion of Frame Preemption should be exposed via the tc qdisc (mqprio, taprio) or via some other layer (perhaps also ethtool like the 802.3 portion). So the 802.3 portion got submitted separately and finally was accepted: https://patchwork.kernel.org/project/netdevbpf/cover/20230119122705.73054-1-vladimir.oltean@nxp.com/ leaving the only remaining question: how do we expose the 802.1Q bits? This series proposes that we use the Qdisc layer, through separate (albeit very similar) UAPI in mqprio and taprio, and that both these Qdiscs pass the information down to the offloading device driver through the common mqprio offload structure (which taprio also passes). Implementations are provided for the NXP LS1028A on-board Ethernet (enetc, felix). Some patches should have maybe belonged to separate series, leaving here only patches 09/12 - 12/12, for ease of review. That may be true, however due to a perceived lack of time to wait for the prerequisite cleanup to be merged, here they are all together. Vladimir Oltean (12): net: enetc: rename "mqprio" to "qopt" net: mscc: ocelot: add support for mqprio offload net: dsa: felix: act upon the mqprio qopt in taprio offload net: ethtool: fix __ethtool_dev_mm_supported() implementation net: ethtool: create and export ethtool_dev_mm_supported() net/sched: mqprio: simplify handling of nlattr portion of TCA_OPTIONS net/sched: mqprio: add extack to mqprio_parse_nlattr() net/sched: mqprio: add an extack message to mqprio_parse_opt() net/sched: mqprio: allow per-TC user input of FP adminStatus net/sched: taprio: allow per-TC user input of FP adminStatus net: mscc: ocelot: add support for preemptible traffic classes net: enetc: add support for preemptible traffic classes drivers/net/dsa/ocelot/felix_vsc9959.c | 44 ++++- drivers/net/ethernet/freescale/enetc/enetc.c | 31 ++- drivers/net/ethernet/freescale/enetc/enetc.h | 1 + .../net/ethernet/freescale/enetc/enetc_hw.h | 4 + drivers/net/ethernet/mscc/ocelot.c | 51 +++++ drivers/net/ethernet/mscc/ocelot.h | 2 + drivers/net/ethernet/mscc/ocelot_mm.c | 56 ++++++ include/linux/ethtool_netlink.h | 6 + include/net/pkt_sched.h | 1 + include/soc/mscc/ocelot.h | 6 + include/uapi/linux/pkt_sched.h | 17 ++ net/ethtool/mm.c | 24 ++- net/sched/sch_mqprio.c | 182 +++++++++++++++--- net/sched/sch_mqprio_lib.c | 14 ++ net/sched/sch_mqprio_lib.h | 2 + net/sched/sch_taprio.c | 65 +++++-- 16 files changed, 459 insertions(+), 47 deletions(-)