From patchwork Wed Sep 14 15:32:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 12976305 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0DAFC6FA82 for ; Wed, 14 Sep 2022 15:34:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229459AbiINPdf (ORCPT ); Wed, 14 Sep 2022 11:33:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230057AbiINPd1 (ORCPT ); Wed, 14 Sep 2022 11:33:27 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2081.outbound.protection.outlook.com [40.107.22.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF0BF4CA28; Wed, 14 Sep 2022 08:33:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Lgd4MhsVG3Niv39W7gBrZ/sQ7JppvVPgtQzG1Ifyhym5wzhIb/ZA+4hi7ye81oMebSB0yNUqhxKkY/p+qUxezqvPTB+cDj5r4SrGJymHIq4ECrJAwUmIlSQPJr0xiMEgBeLpd6magO4CbKH7EeEYqFFX7lzPlOVSwVAjWdQxPdnfekaUlMKYvqKJjgx3Sez21ElKYTg7NA+xfOAoU1kIAcZRNpuQlUTzXSjnWFylW8lBRCUcpby0BuE+UkAaAR1c6ORHYTd8FkSWhWrzsD5E/bcjjzIp8LichfvpG0Sy2uxSeUsjUtUwhmxFH8mBlOfKDx3CDfvE+GpItV8tvNxLMA== 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=X5+VtOqX+XGLZL2ynn/k/BcYJSS7PHKoAvPzcr0u+Z8=; b=fvNeg2i3xR2flwTO/rxYe7lmsHrSLg5weLPj/F6i7R4K9ATnQ55qlid2kKBqRkL8m6Nhs7Y7qqHMMv6yFpiL+/Ctq0aG7qjIw2lFxzT107TDRxjN5HppJ2hxLtV6S7wqQd29Ll80rLuJTTI6y9zKV0wvKydDIZwmvLz01TG73Qe9hK5cB46fcNKE3ByCgGIC820QdKmm6v5RY07OFoanEMQ2+zerB66tJ7wDqAob80RNHVJujOK6BGm3XdO0mR6D/o2Ad1gfkOYitHmAlmYwN665iHiuCC2g3xgpr6/Q4nprGS+Kp6W9SYWFlXUn9tkjsAOh2L5TmCoqA2Yt227WNw== 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=X5+VtOqX+XGLZL2ynn/k/BcYJSS7PHKoAvPzcr0u+Z8=; b=VavxdbA5RCVP7r44F494ZzQreIAw4Ax4k39RHxdNeXWQ1Ctj8mZs50FQWyNTYsJp7w0GLJlQ9KtYz28XUq4hl7YGKoNgzSjkasABP+/S36BQsd6QZSQYLbJvsRYCOAY7L5eUgqWoo004KTrdLS7ry2AsPFTK343KNwOszt0sEk0= 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 DU2PR04MB8949.eurprd04.prod.outlook.com (2603:10a6:10:2e0::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Wed, 14 Sep 2022 15:33:25 +0000 Received: from VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::a67a:849c:aeff:cad1]) by VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::a67a:849c:aeff:cad1%7]) with mapi id 15.20.5612.022; Wed, 14 Sep 2022 15:33:25 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Xiaoliang Yang , Rui Sousa , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Andrew Lunn , Vivien Didelot , Florian Fainelli , Michael Walle , Vinicius Costa Gomes , Maxim Kochetkov , Colin Foster , Richie Pearn , Kurt Kanzenbach , Vladimir Oltean , Jesse Brandeburg , Tony Nguyen , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Jamal Hadi Salim , Cong Wang , Jiri Pirko , Gerhard Engleder , Grygorii Strashko , linux-kernel@vger.kernel.org Subject: [PATCH net-next 01/13] net/sched: taprio: remove redundant FULL_OFFLOAD_IS_ENABLED check in taprio_enqueue Date: Wed, 14 Sep 2022 18:32:51 +0300 Message-Id: <20220914153303.1792444-2-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220914153303.1792444-1-vladimir.oltean@nxp.com> References: <20220914153303.1792444-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AS4P250CA0023.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:5e3::11) To VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB5136:EE_|DU2PR04MB8949:EE_ X-MS-Office365-Filtering-Correlation-Id: 771ad24b-6240-4707-037c-08da966676dd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IRN6tYDLcaaFco1i2/jjx3B4/LEdzWP5sHyhL8S9v5/MIqMC5RXBUAsru7Kpk7AFGnrP7NAakPEwx/j4rr6Ximfma3Hj1Y0pZixINWvHg02tzo6+Or6wXNROCdJARuB8SX8mqfcDbOrvTOH68LXeRBYgy9hvWB+8/9OEjXoStEPko3x0U62O3BF3IcWTs5+h10UTXKQEMu+XVvSDwaoc45hUutxTTYlkDVEP7VRSRTguh69wUKkGpt8Hat0+8mdcnaDvNGNSPRXbEz3G5skGrDEVxH1D7PvWPv5bsyQAG5OL0hXM5qWJN7WvKvlOhWPcWc+c/qoivBUT1qTcWyxSoBlZ9XtyTk7Uj2o9NWVkCu9SsnuCzdZng+2S70JpwurE41NgITQZoXvU/FUkloGJw7MAfC3YeF0oPf6NZUuAhUYVau23uhTxloSu6KqbXRzyqMnFwZ0L1KxFMVUBhYzSBafPs7VDc+erwGl2Ki6mTcGBI4wbELa9KMvHgjeZlmv7IpcI6dkqln7AIWJogBeNLqkMIngp5ZHOJEkRznfZzojjBhQQdJWb9waF+F5zbpuSKcHzhblA6AuR80H01MObiQCG+lhnyP91SaCQP+N5rpu7dRKOsPoGOk78mtrkYotAPYdlq2QGzlvyXFhNbJgv0SHYvrIQbzoHz1PpppJydQjj4uCWd09gdPsqwJqvPf+Lx+oVmn1twlMUReoM7wY+FCDcUMSYOj86v2eS99RJWa6o52kJj7Vv54RYYAbgvYZmWUSPKHFduTnez14vcvpFJA== 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:(13230022)(4636009)(346002)(376002)(136003)(396003)(366004)(39860400002)(451199015)(6512007)(2616005)(52116002)(66476007)(44832011)(4326008)(41300700001)(66946007)(316002)(26005)(8936002)(2906002)(36756003)(6916009)(54906003)(6666004)(86362001)(38350700002)(1076003)(38100700002)(5660300002)(6486002)(186003)(66556008)(7416002)(478600001)(83380400001)(6506007)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 32rWqVyS6pNjiV4YCY80QBiPbIVfXhJdKVtweKZwnmQoyNM7J5ix8NXLZk6SRVPJkvMSwL6jImdexU29lf8C/QLIN2Wk7ftJEXjre1lv2FBSuueWqB1OKdgKd/IPxe7mlcLWNWrE1BBEsknWOA1UKpF2oir2vAADC2W+4Zseeb+C0hyRoVakzK54z8pxc6PUAOIiL/0WCFAYww2dldA858FZf0NRpwQS+6QIMA2P5AcvlBAHcioDOisco64TpQL8o9tN3JyOQQP8sReLWZGpuTTylTfjqBwqPR9wXRE1eo0EVbHH78+ChjjVYnUXpnbeOs1MFHTZ62yAfdK98qcGvrasmpL0ZuayIxTT7HKRo+LAuA3T9P+qxqHU7ILP61dJRrWZznGTImXpZ/9UaFmtr2DDV+abyemPp5t2h0jcukcGKuAU8cf+xcYDT2PQ5mFsxEo9aEWK2wfz8hOCjJLV5y6/glxsmpHRet4ZuCOR2C2m814ETDeNNe1gh8AdwrLuU4YRQhSopABlrC1LhMJ+smzjW3RWDa9e799k+/kJTatoQEtlNBJul1z56ZyY70/D4KntwihHgCq8UarJTWyI5D5XoeymJltYxbk/bLtJThuireR3eUS/bfnfzp1paimEehWmToIsDuONrUOVNSPLpzIh2D53c2VoqS2jRhMCUtIyjFUJr8lMKUO273iHondUWlyCpi7ihihEgxksdEW92LL1ykhoBwswpGdDUoObuJVV9/6N4QMBypeY5qNc9uuJ0b5uw75JEdT7elpaV64dAYW74npx14djhOGYmWjcCrwXgIq0wW3OwOOj+eMSWdsPtw85tKtMKsF2cJb2+5U9nge8QgpcIUb8Cr7yN3C/lEvbC0estDDXK/mUmkknteoG78oQwlHQsIGYliDIPypgEtkgwEGzKPZOtth2lZcmH/XzKVBWjkXKTG4KDGQN7KGDglU84PjRmFnI7IFoLyNjmhdHdDbaDSq1oQAlzhQaPwAheBeFJvkOKWLzcZzJEBMmRIANTGS4Wf0WVNH3bU9iQMI58+1FwhNdoAFt7NE+tmN6Zm+T9yYw2BIfBDm+m7btU0w3+oUlm4qBNCmmJ0CuC+yXmV3bjuSU3dWRqhHat8vu2DV+G91vcjSPSux/lX6nRUNfowJ5Qdh+On+2m0DL1tWwyQMgt7cmKraL2603jUoeCce/CLWcxkU8egG8hDXfP+BRlgDVkKr3ZSLxwomy1aI9ElUyfteGDcdpxhwMwGUSlvMU6hbcPPHn2KUcB+zY7ntXe4fLWD9LQvOMpMAxosdBYuTWMvgxZ2f/7LEYHt3l1xsj0An7sSU4dCpd9nVMtwjigTqRsnzxGTkVorHKTMgN7a6nkLqEXAVBEQZLGMHW1Fj7DuUPdylds1NhziQUWKCxXRj3Ch3rB7ddKgMK+TFHkKkA1HuG6ULMZl46DcXyoqkbYrYS8eDAkvUGzXrIEb2/eBved6rT7AmGPI+Os0yeOPnpyu/i7IPqjO7VK7zBS2NPCQ9N4XYE0jiQvygizr6cR3ZuN3PaxIa0DEsC6rweRj5I9KxWYr8D5aowlpZoyucRydKroqNjs7ttatrifJwICyphqQDuFWsBecIhAg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 771ad24b-6240-4707-037c-08da966676dd X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2022 15:33:25.4341 (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: 9Fjds1iepYKwkCsVuIIQ2o+bukVsbgR3DTizxnnr/9mfXmfsSuAJhUmznn44RbR2YD0XrCNYEWfzq5s8/P5r6Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8949 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Since commit 13511704f8d7 ("net: taprio offload: enforce qdisc to netdev queue mapping"), __dev_queue_xmit() will select a txq->qdisc for the full offload case of taprio which isn't the root taprio qdisc, so qdisc enqueues will never pass through taprio_enqueue(). That commit already introduced one safety precaution check for FULL_OFFLOAD_IS_ENABLED(); a second one is really not needed, so simplify the conditional for entering into the GSO segmentation logic. Also reword the comment a little, to appear more natural after the code change. Signed-off-by: Vladimir Oltean --- net/sched/sch_taprio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c index fbf84404408f..a172c1eba995 100644 --- a/net/sched/sch_taprio.c +++ b/net/sched/sch_taprio.c @@ -455,10 +455,10 @@ static int taprio_enqueue(struct sk_buff *skb, struct Qdisc *sch, /* Large packets might not be transmitted when the transmission duration * exceeds any configured interval. Therefore, segment the skb into - * smaller chunks. Skip it for the full offload case, as the driver - * and/or the hardware is expected to handle this. + * smaller chunks. Drivers with full offload are expected to handle + * this in hardware. */ - if (skb_is_gso(skb) && !FULL_OFFLOAD_IS_ENABLED(q->flags)) { + if (skb_is_gso(skb)) { unsigned int slen = 0, numsegs = 0, len = qdisc_pkt_len(skb); netdev_features_t features = netif_skb_features(skb); struct sk_buff *segs, *nskb; From patchwork Wed Sep 14 15:32:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 12976307 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C3A3C6FA8E for ; Wed, 14 Sep 2022 15:34:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230037AbiINPdl (ORCPT ); Wed, 14 Sep 2022 11:33:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230298AbiINPdc (ORCPT ); Wed, 14 Sep 2022 11:33:32 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2055.outbound.protection.outlook.com [40.107.22.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D390048CAB; Wed, 14 Sep 2022 08:33:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a43AXo6QwtxTKroNPO6LORG9Mr61A85cNFMFHUS6VA+B9v6buIIw1mYzbk2h2V+3W/Fk938VD8TaXM7WrYdOWRvwXeJUO+wCU5zDm5v0XcVPUiSZStUeQbymHbEv7BPngDjO9sYSb3Vrv+Eq0axgqCAnZ0PiGHD2e1zKyBrj1UKJOckALujWVk6xoxur0EQZCFzi8BkL3NfScwIKsWMPTnSJLWaQYpeW5nnD5sflDkSOcl8/PnODTbreY8TmV3gJ50SLh24VvBTmvi1q8a2sUVVMkWWMwZ3NFlrRzvmFS6BGPAh+XQHFLCf7tVxxnz/yaQUkr+FK6AnxiWyEKGB0ig== 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=AMFm3xsYutYgfDjln+tMhvPVKymV8/hLvpohHGGAHAw=; b=nKGUsCm1haVnTzzrTDFs71xCmVrR+5svYhfg0xixApmC+Wq/N1zKew3rW5RN0i4G0QCD7B/Ef9hfWZkh1uoY7FwMRgkqxjYOBYjK7yoEHGdmVxRfIwL0AIYFmNOygmYBctFLMLkbZS4fPJEuIUpdGcHlNfn3bWd1PM9qgsBe0+bFtzIidSLfaDRkHjkgDoOmEU/KMAy1WSdKqnOAoBTu5UBC6APHmMmqPLqkX0eYJoip8Tk/grcohr4Q/SsDYP7PGEqiaJYDB83usujlRB+9Rxmhzsj+KtVAlwWzSm2vmSOgWeOjMwvy2B0Kk60oj67jTMKNPAPtqprZ1JwPDzzztg== 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=AMFm3xsYutYgfDjln+tMhvPVKymV8/hLvpohHGGAHAw=; b=pJ47g+7pDYooIJgRLSExcUEl3Sdcypl3ISHVOdrBBA2tJ0CeLfYIi5xq201GSuyDVV73mI0CO0r6v7udjn0e748I7KxZj09FVAX6bOnbE/NdI7dw92uEZ7tk6vGb7hdYxYIkhC9Z4Xj6VMPqsYh+a8KnqL3VyDSwTz+XqJKrKzk= 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 DU2PR04MB8949.eurprd04.prod.outlook.com (2603:10a6:10:2e0::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Wed, 14 Sep 2022 15:33:28 +0000 Received: from VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::a67a:849c:aeff:cad1]) by VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::a67a:849c:aeff:cad1%7]) with mapi id 15.20.5612.022; Wed, 14 Sep 2022 15:33:28 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Xiaoliang Yang , Rui Sousa , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Andrew Lunn , Vivien Didelot , Florian Fainelli , Michael Walle , Vinicius Costa Gomes , Maxim Kochetkov , Colin Foster , Richie Pearn , Kurt Kanzenbach , Vladimir Oltean , Jesse Brandeburg , Tony Nguyen , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Jamal Hadi Salim , Cong Wang , Jiri Pirko , Gerhard Engleder , Grygorii Strashko , linux-kernel@vger.kernel.org Subject: [PATCH net-next 02/13] net/sched: taprio: stop going through private ops for dequeue and peek Date: Wed, 14 Sep 2022 18:32:52 +0300 Message-Id: <20220914153303.1792444-3-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220914153303.1792444-1-vladimir.oltean@nxp.com> References: <20220914153303.1792444-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AS4P250CA0023.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:5e3::11) To VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB5136:EE_|DU2PR04MB8949:EE_ X-MS-Office365-Filtering-Correlation-Id: aa015005-a344-49e1-beab-08da966678a6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: khG2ZerjYFMdRo8mL+wzLVvMJDdxiUTxl/c70jEKhf4lLy5FF82y25VNzbe48e+1JNoH3LdpNyOH0EKjG/2gphXjiReNV6SU/RoseuZHwek43dTk0yT5DjhecGdnmAaoYrH2dvPNBz1kivoAF8R7yUM01LHdFrn7Se9IsL6tbJaTdfKpggQv9I4HcNFsbLFp0/WOXocsj3vdJvHYBbFCkUkyHG9BhOiEIlyt5HVgGA0qml6vGju7OIQ19mXZ+vv3YWuOdchdNf1T7VMJ6CicSqQNG9l9Wvo8SutdzYXZNBN9c8F/JHfGvUdKL/TJKeglF6aMn5/6BrUUr94RnTgiZ1c5S6IWXXdZJLK+YYUcfdpXewQb1WcMEw2ggl4Fvsvjr4VKMo40Gpn+D3mJjzctwAnQc4KiloHUe48QNvskMOguWNu1X6qJlObAydnttVq1A3rzbBXan89+N4W+UuEvYSO68+R2bDvg31r1mN5v2WPlZ1y9lPKYAsZb4p8fsXm5SOxLM/bcHbumrjtXAvDIw6nPm2B8oTQ+lzPMFeR/J+vTVg8zUcrNOY5R5bxa3ELJ8zpiBCVs6OIJIFEG01zaIglQ467LfTut0oTPjg/zSaKI7kI6nNYJa56vzC5huMBToocxCiVnpuJxRtgy6LD5bCf5uGwy9pTOjQGcynMVnMUhZHZcJu4Y2UUcMPXHFOcozKPbdsJ78pTZuQ8h6RrZDYzPwe0yytAkYeztjmAoBn35DlQoxIf6c8Xv2gYAtG7FUI3h5ZyByi9AocnL9qG6Pg== 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:(13230022)(4636009)(346002)(376002)(136003)(396003)(366004)(39860400002)(451199015)(6512007)(2616005)(52116002)(66476007)(44832011)(4326008)(41300700001)(66946007)(316002)(26005)(8936002)(2906002)(36756003)(6916009)(54906003)(6666004)(86362001)(38350700002)(1076003)(38100700002)(5660300002)(6486002)(186003)(66556008)(7416002)(478600001)(83380400001)(6506007)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RW53V8WgBmbiLqSWhpODjwJya7NhR/ADHGgCNccdIiOSojMB1hNtM1C/BOITKS1wxuvamC0PjC4HaVFYE+e5VOecbAXxrSUKI9VnuJOMsTwt7XaKQM55SMczQ5PalYTUBkOdxj6kNAT/xQWJ/6QPo2vFvNikenJyoSONjsXH/7XDYCX/rUwG6YUnFNJqWhjSCMWzWfQogOl6zV8jxUyIEX7lZo22OyFYH374umqFkRO3UBGRre1ESKLLoPsKZu1693FV1qriQeKV0cuhRoVUcUteXihzpt4JCEm2TAvBHBBEkSsx4MF+j6A4ur7A41WzjXbzfkjGJuAR+XfqonfwLvSpBvFfpCEvMHv5mfV8xEIRLnoCBau0Q7LE5wdssk1rHFPAnQ5VzvbBnSSYBgYzjQz++BdSkQnFm2MwhoZvWyQlf4ayQfmLVmtQqJ0hVOyBIJ/A+DD/mwyRMsKBbR1wJ24ziVGJVDQYOd3aEbsCcxsfa+AiMM4Z8q7YIX/tuYfUzHLLH5ObMLss/wP2iRyyk1fRFtjrYvrhzh7R5tSxA4YF6R90ipSYAo5JMEEuWx8noQjucEnqiWRW+E8dLQ5LG9qKPHWHcUmL0lUjggcu8/1VfTeEhmEN/SuYpe/GHtmd7nSR7elWC0p1N+U4TT3GiY8ycZWEckmEZy2LcwjUQCzGHHknikZRWSpnT8UcJaQ4JL3Y9hsydFVC1vp4NJJn1skUPs/SoKBlv+bVMirEJaSTCxVVFuVnMDD9eBuD7CAhdbgUDxm37B0SMkIm2Jlcshak3w0uRjA9N6DyEM0iPK7o/ToQ0EmWE+LT/laEzL7HTboxAlOyLjvH9SM0j9/d0wuWxk1I1tFZy2DjfOgX2igSs3yQBXvMFp8qj2RZ/qKp5OEVyeiZFvQr2YJoqdhZws+5yzigmSI+fafWNAVnF4v/pX527ugGFjd5L3YhItiP0bD2nAaXXXheuB3fh2DlxCWUwkO2E4bR38sHdJdCDMKHIPJN4jN8WxygRmI54xMcoONr0KlcfmsbVOIqYuMSqfT2QSnxi08RUrBBIAUwXN3I4IwvgCka6EQr2jOiG160lrP1vlxJZFoh4ZHdRRkOPMzDe9jAUPOJLTG/3LBI0tSbNL9pfHGSw7DiaeTZAGLNiAXQHyldS990iiQQjuYc4sXVvBgGg7fDeY+D2WtGPyoolgdVUXaqra9OlKppZlo+tE6mJJBvoRKtPDBPIFN6l4xBdOW8dc2X6rYGLG0U5bD78MBOGE/xqS1GUmVYaJckCLyae866ij2cNv01XV83oobSRPrTSwwMhxcfVqNpafqGPUAmXnddyHsr64v2ZAP6Q8rHBgcucIFnu9VaGpVfdyX2os7Mmrwu+jUY7xg+r0lSrSpg7cb5vpXAdQSEKrGDg83UE/YLing3vNZYnlx8x7dmDBxwjEI2fOOjuEgCmv2FTx4aPhxBOUNaWd/GkZZiJ0Wn4fIx1jLSuEzKyfMpRIyWprfZDdBBnq7bbtCZf3QItzBCbX9kaUeilv1dVm/JW4F5usfz9I6p2JoKHmqJYs9UscOuGVyoiKO4Mo8a8OtGLGGTWvvoYZG76lEk3i68zOtJJIEnzxa9gkzX7Vd+jw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: aa015005-a344-49e1-beab-08da966678a6 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2022 15:33:28.3870 (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: 01TLLxxTg7WOHVnj493uj4cOmT9UFH651hYcfRTKJRchiPAF1d7ho2GWSXZcEgzkMKEXL5iVUjHi0L+jiGN0TA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8949 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Since commit 13511704f8d7 ("net: taprio offload: enforce qdisc to netdev queue mapping"), taprio_dequeue_soft() and taprio_peek_soft() are de facto the only implementations for Qdisc_ops :: dequeue and Qdisc_ops :: peek that taprio provides. This is because in full offload mode, __dev_queue_xmit() will select a txq->qdisc which is never root taprio qdisc. So if nothing is enqueued in the root qdisc, it will never be run and nothing will get dequeued from it. Therefore, we can remove the private indirection from taprio, and always point Qdisc_ops :: dequeue to taprio_dequeue_soft (now simply named taprio_dequeue) and Qdisc_ops :: peek to taprio_peek_soft (now simply named taprio_peek). Signed-off-by: Vladimir Oltean --- net/sched/sch_taprio.c | 58 +++++++++--------------------------------- 1 file changed, 12 insertions(+), 46 deletions(-) diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c index a172c1eba995..226aa6efb365 100644 --- a/net/sched/sch_taprio.c +++ b/net/sched/sch_taprio.c @@ -79,8 +79,6 @@ struct taprio_sched { struct sched_gate_list __rcu *admin_sched; struct hrtimer advance_timer; struct list_head taprio_list; - struct sk_buff *(*dequeue)(struct Qdisc *sch); - struct sk_buff *(*peek)(struct Qdisc *sch); u32 txtime_delay; }; @@ -492,7 +490,7 @@ static int taprio_enqueue(struct sk_buff *skb, struct Qdisc *sch, return taprio_enqueue_one(skb, sch, child, to_free); } -static struct sk_buff *taprio_peek_soft(struct Qdisc *sch) +static struct sk_buff *taprio_peek(struct Qdisc *sch) { struct taprio_sched *q = qdisc_priv(sch); struct net_device *dev = qdisc_dev(sch); @@ -501,6 +499,11 @@ static struct sk_buff *taprio_peek_soft(struct Qdisc *sch) u32 gate_mask; int i; + if (unlikely(FULL_OFFLOAD_IS_ENABLED(q->flags))) { + WARN_ONCE(1, "Trying to peek into the root of a taprio qdisc configured with full offload\n"); + return NULL; + } + rcu_read_lock(); entry = rcu_dereference(q->current_entry); gate_mask = entry ? entry->gate_mask : TAPRIO_ALL_GATES_OPEN; @@ -536,20 +539,6 @@ static struct sk_buff *taprio_peek_soft(struct Qdisc *sch) return NULL; } -static struct sk_buff *taprio_peek_offload(struct Qdisc *sch) -{ - WARN_ONCE(1, "Trying to peek into the root of a taprio qdisc configured with full offload\n"); - - return NULL; -} - -static struct sk_buff *taprio_peek(struct Qdisc *sch) -{ - struct taprio_sched *q = qdisc_priv(sch); - - return q->peek(sch); -} - static void taprio_set_budget(struct taprio_sched *q, struct sched_entry *entry) { atomic_set(&entry->budget, @@ -557,7 +546,7 @@ static void taprio_set_budget(struct taprio_sched *q, struct sched_entry *entry) atomic64_read(&q->picos_per_byte))); } -static struct sk_buff *taprio_dequeue_soft(struct Qdisc *sch) +static struct sk_buff *taprio_dequeue(struct Qdisc *sch) { struct taprio_sched *q = qdisc_priv(sch); struct net_device *dev = qdisc_dev(sch); @@ -566,6 +555,11 @@ static struct sk_buff *taprio_dequeue_soft(struct Qdisc *sch) u32 gate_mask; int i; + if (unlikely(FULL_OFFLOAD_IS_ENABLED(q->flags))) { + WARN_ONCE(1, "Trying to dequeue from the root of a taprio qdisc configured with full offload\n"); + return NULL; + } + rcu_read_lock(); entry = rcu_dereference(q->current_entry); /* if there's no entry, it means that the schedule didn't @@ -645,20 +639,6 @@ static struct sk_buff *taprio_dequeue_soft(struct Qdisc *sch) return skb; } -static struct sk_buff *taprio_dequeue_offload(struct Qdisc *sch) -{ - WARN_ONCE(1, "Trying to dequeue from the root of a taprio qdisc configured with full offload\n"); - - return NULL; -} - -static struct sk_buff *taprio_dequeue(struct Qdisc *sch) -{ - struct taprio_sched *q = qdisc_priv(sch); - - return q->dequeue(sch); -} - static bool should_restart_cycle(const struct sched_gate_list *oper, const struct sched_entry *entry) { @@ -1565,17 +1545,6 @@ static int taprio_change(struct Qdisc *sch, struct nlattr *opt, q->advance_timer.function = advance_sched; } - if (FULL_OFFLOAD_IS_ENABLED(q->flags)) { - q->dequeue = taprio_dequeue_offload; - q->peek = taprio_peek_offload; - } else { - /* Be sure to always keep the function pointers - * in a consistent state. - */ - q->dequeue = taprio_dequeue_soft; - q->peek = taprio_peek_soft; - } - err = taprio_get_start_time(sch, new_admin, &start); if (err < 0) { NL_SET_ERR_MSG(extack, "Internal error: failed get start time"); @@ -1694,9 +1663,6 @@ static int taprio_init(struct Qdisc *sch, struct nlattr *opt, hrtimer_init(&q->advance_timer, CLOCK_TAI, HRTIMER_MODE_ABS); q->advance_timer.function = advance_sched; - q->dequeue = taprio_dequeue_soft; - q->peek = taprio_peek_soft; - q->root = sch; /* We only support static clockids. Use an invalid value as default From patchwork Wed Sep 14 15:32:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 12976308 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5ED53C6FA82 for ; Wed, 14 Sep 2022 15:34:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229587AbiINPeD (ORCPT ); Wed, 14 Sep 2022 11:34:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229585AbiINPdf (ORCPT ); Wed, 14 Sep 2022 11:33:35 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2056.outbound.protection.outlook.com [40.107.22.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B073748CAB; Wed, 14 Sep 2022 08:33:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mFRbJ+wJy17UdGAQGAF9V9XIC+UFPOhCOvt8SFJbApECWUbdG1IGmF+PTNihlt82wHgKLsACcnyjqJyE9ndKsWFbtcpVwdnp7XxyVxe0jD93FDJH5l4gOTR4HH5MwGkCR3Aoc/s5UsuzQ1xIe7m/XWg5KayfzjiboQbUF0UH6uKY4LWTja9Ym/2Xd/vvD572IJ46sn29kiStryEjYH/YSIMC6oSectr/VzQTLu/srXWjQVc1a8d9OyAd5XZkIf+YclKlMgH77iTQiFwXe/Si6u9WJgm/aZiIFWlcM2akoO6jGmxL7j/T413aFcVWzp8U9JgNL5qa0b1S5eaxdRoE8w== 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=D1nxBu7zFNRKZDIi1t7Hsqxq59vzmm67YpCQQvlJ2A4=; b=AYc5UJX4jpVMJgeVNLQ/EaD9JW37tSxADIuDfY244qs6wgQnT3+30kJGPqeb2Ph1KpkSCm1fGXxXyXlxPtrjMGRZ9bVv/9PlshGbR+8jEsf627Ef1Yqw+WjORoIUMxDgTyKYi8FfRK9igwA4j3d20JVwjhkkXbMD06HHJRVGgbLbQc0qtfl8JPJfqKH2eGfcxH8hTrTVxWlbHrtM53MimlPanS6k3fnwF1n4eAZVcji9nllg2BFa5c4YjDC0phyHN2q33C0ovfZcvKG0bBTyGTXJdgIKIFrvwl5hgA2RfdaqDb0YoxdEXYIGJJYt+6FO2UcMgDZRGFiIRoz7Am5q2g== 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=D1nxBu7zFNRKZDIi1t7Hsqxq59vzmm67YpCQQvlJ2A4=; b=gsfmzWPSUvtMvM9V4h+0aj3eq938g9j1fwN/D+uuGcZC89tu8W/UVX+UzRcnSdcffPgNcTHRvpkWcreV6KMefzRJ2Y+f8CcDAgyqpW1lcfLp2m+ROvpOrh1wU1xH9kpn0i+OXrd5Fb6+6YZizSJRGDouNIyRiG5U9aFfssQG0yg= 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 DU2PR04MB8949.eurprd04.prod.outlook.com (2603:10a6:10:2e0::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Wed, 14 Sep 2022 15:33:31 +0000 Received: from VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::a67a:849c:aeff:cad1]) by VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::a67a:849c:aeff:cad1%7]) with mapi id 15.20.5612.022; Wed, 14 Sep 2022 15:33:31 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Xiaoliang Yang , Rui Sousa , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Andrew Lunn , Vivien Didelot , Florian Fainelli , Michael Walle , Vinicius Costa Gomes , Maxim Kochetkov , Colin Foster , Richie Pearn , Kurt Kanzenbach , Vladimir Oltean , Jesse Brandeburg , Tony Nguyen , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Jamal Hadi Salim , Cong Wang , Jiri Pirko , Gerhard Engleder , Grygorii Strashko , linux-kernel@vger.kernel.org Subject: [PATCH net-next 03/13] net/sched: taprio: add extack messages in taprio_init Date: Wed, 14 Sep 2022 18:32:53 +0300 Message-Id: <20220914153303.1792444-4-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220914153303.1792444-1-vladimir.oltean@nxp.com> References: <20220914153303.1792444-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AS4P250CA0023.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:5e3::11) To VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB5136:EE_|DU2PR04MB8949:EE_ X-MS-Office365-Filtering-Correlation-Id: bb23f6bd-6a71-4109-f0ac-08da96667a66 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6o7ZsW6QI6gki3k/cgmeUzP/fr4qI9ZhFD+cJBl83KeZtJyQpAoVmOzgpRpUIte0jziHuznk4wVjtabEwIWaVcTlC3iX7vBnCbaqXXXYs2/IwQyyt3IqhpNOkIlb/f5jA3KYfuhfs24EcA3AXqobZzLAr0jUSvSWLbHGORX/QcntD9vdVthsWDZu5mM/O0n7JsZ2gUQXhTL7RRzB8eaAQjHRgVS/2CYU/HRAGduWtDQr6mqPlScobTZoixpKX9sEUPK8wvStx6jxBmX8bU/6KAUpeKUQxFIv2VeGtkb9n31XbN7j96Md8NGFCFxxx8t476GJ1lQhfOexAt3agwPcEss1N3byqP1fe3jUU706kSz5YX7Qvx85k+vemUscIFvU8D+WP12h/l8kCY4jCxHcuLD/0/bsotuil+Mb0xWCuSOwFEqv1vlZXpJGS+TyOCwo0uTTDVTeQ15Lxfyi487VPZywCIeE33G344tQWMNCqP7SPbTCx1Xyf5iOc7W34HVj1jVeuoXBP8W3tfw+F2SYysDeRJdQEAG4foe67Kr2f0T5I7VlI0IM6eKiGkYagnL0gt1z4agDwEeZBW2H3HTMf3waRiEyg69k4L1a6sBnq95CDl0m3xiYrmPy0zTJ1MKiXG1jhUm7tbmM6l/m9NwkYKVoN09cA0ZnBBrMn10z/+zhJWaCkjkzzNuI+Nl8dp/tqkGRFgAHqbFKJtWRvw0sb69RuBloPnhjuX99YtPIbJBZUsph8w3DzAC5iPo6roMcViWLQVeRXFEW4fq0EhfOjA== 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:(13230022)(4636009)(346002)(376002)(136003)(396003)(366004)(39860400002)(451199015)(6512007)(2616005)(52116002)(66476007)(44832011)(4744005)(4326008)(41300700001)(66946007)(316002)(26005)(8936002)(2906002)(36756003)(6916009)(54906003)(6666004)(86362001)(38350700002)(1076003)(38100700002)(5660300002)(6486002)(186003)(66556008)(7416002)(478600001)(83380400001)(6506007)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Y8qkXJfbKSboRzLnJzRyDwuSVAv1FHsijUY7/YPvWMFr8d7ypLDI81BpWunsqtXGX53Rt3axFTRNLPHK1lkQRi7rWHqa5iOW98GcWAEMZgld1jsxBMyCDGjUGgHHr/3eo5urQ0nCHSZaBCnHvFnCoOB8nektuh//TRviyFkzkPuLHFhbTve/SVj2VTDb//sQ/5ppyEHJoOYhoLBJkjJQCREZOh2IcorM82Ck9iD+3RZS9Cj+VJmHGk5t9B8Br0u0SjnBu9EIuNVVaOl5iuqL+XmhPB01VqH5byY7h+iOsUiKmtZytCi94O8fis+j2YCT7c8Vjtx2x5a8QPDcWkeB3U6h67Bit5ZBH0PO467PSBXCLbMKpeJCK36uL2g5p8jnEK8uuLqjwXzJbOnEe1lKocvKXjp8A15PmJYNUsaEa289hfqnXT0eZ3o49VDaJkgml/9DXXQPiq+IUknqlu0k1m2MPSHcm8Iq4+pLRJEySfVDvF6BOXPc1wXMU4Q8do0kcwt+agU0XQD7ImW+qLvhRhhfN15dsZTGXRilHnDrWbc/v8bBPq7+gYkNQCw9+lAtQxbH6URt88CGWqOrhXBlsVC9au21/CpWUc8SXIG58fwDelTi1QKre8xKSTSbmoQ/wLZEZnSJ+B58ZV0dklWA4F4v0+r8TJ+Hcz1zzzwkuEogvU026Mxklv3p4oZ8TIfdT42ptLgWI1dn0kQRR3IvI9aJgLgRZZovzx1SlaEA8OOOJZRYypM9oggg+uBZoId8krPUP8PFt0Y31fNqjlhS0xtSuHbxFm01KuDmhXt/9iqBvQk515k2mi7xy5nR4sT+gC2jEjhxBXsgP6Td8l9Katx9iJ+Q8MyUTw7H4NEwr7qSmFKEu5tm/Tr1xj6DxXRJhpgjLbI8eIWmwuyYzzCvH8FHfJK7reeErvGH0yDqfGGBI/DjuBVACw7oDl1itaJ9MKgJeO9Kpt/F9akXM5A4phLGlEclakQlMZxwWi+eIgOgW/HveNvB3sLexMUK51gGHOUKNfuNYe6iW5P7gIsmKBivXs9rbAR0+roDXJh8j8+6Xl1jF2sFpMONqzONf+n18lGy0FA46ZPuMYO38CK5F4lBHQLN/3t2wZpztxDt1obJ6jKlzt3DLsJMpitiKvEZ7KF64w/y412gyqQV0EsR238KEXjuX8WDgPlt+Q7MqGyI7kCV95OryMNqmp6xqtz23FblunRsbLhIq006Fyvu802YTdafngsQfWeZIS1v78/yrKsrfgAvAij6Qb5vM5zjqJD2qjohu7fDV3xgxmmh7rEOymS8pCLwU95Q0D41rH8IPyCLQkkMwIJEe/vPduPk5u5G+5v4WcMD1Y0cSXoCrMYB2JJslRtjrqFY2Y01sGX8Meveu77EENiBnCDkbNl7p+ugF3kj8mHPvCSdrUalj3R+YbRY+S5X75Xzp6rq+KG4Susk/ngMYORo4OV5JyGCZOx4EUItiwr3d+oct7slF9Fha/+eb63xKnbhpKXmiRcY2QwsinVu2tOzdQuuruy4NpfSBr+eblQ713JnZvfNBVdW4mcVt4xO1tu18gXnQ/R4KwAqeYF6TJb9bW1Z0ELh5MY6s7xtgSPP/NREKDcluQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: bb23f6bd-6a71-4109-f0ac-08da96667a66 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2022 15:33:31.3556 (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: 2+0Mwn1bgcX2xNjLR72SH1Vz6pqxG/XAp++ptMK5lLmQ+0yOXHbfdoTLdzfRkfASL6fXsViH7iO8h8vCASzaeA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8949 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Stop contributing to the proverbial user unfriendliness of tc, and tell the user what is wrong wherever possible. Signed-off-by: Vladimir Oltean --- net/sched/sch_taprio.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c index 226aa6efb365..2a4b8f59f444 100644 --- a/net/sched/sch_taprio.c +++ b/net/sched/sch_taprio.c @@ -1675,11 +1675,15 @@ static int taprio_init(struct Qdisc *sch, struct nlattr *opt, list_add(&q->taprio_list, &taprio_list); spin_unlock(&taprio_list_lock); - if (sch->parent != TC_H_ROOT) + if (sch->parent != TC_H_ROOT) { + NL_SET_ERR_MSG_MOD(extack, "Can only be attached as root qdisc"); return -EOPNOTSUPP; + } - if (!netif_is_multiqueue(dev)) + if (!netif_is_multiqueue(dev)) { + NL_SET_ERR_MSG_MOD(extack, "Multi-queue device is required"); return -EOPNOTSUPP; + } /* pre-allocate qdisc, attachment can't fail */ q->qdiscs = kcalloc(dev->num_tx_queues, From patchwork Wed Sep 14 15:32:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 12976310 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72F46C6FA8A for ; Wed, 14 Sep 2022 15:34:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229473AbiINPeI (ORCPT ); Wed, 14 Sep 2022 11:34:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229963AbiINPdi (ORCPT ); Wed, 14 Sep 2022 11:33:38 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2089.outbound.protection.outlook.com [40.107.22.89]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00B145A880; Wed, 14 Sep 2022 08:33:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OxMVxVyLKywRAKKLfHpJyXARyCm6P8UpFOq4vViQB92kmCvkJav0M3NC6p0YzwdeqhMxxFmiLxzvwyJzZWPThtgA+JjGKDX1R7gqWibt0XNyefNMF3sCk4KjPfEBVYzR2w2ULfxICCwW262rMiP0OzKs/jMJWRpcX/Rep8d2c7JGDqiFDP+ihF0AATgBCOH6H5tLow501epqwlK12w2DEkN4fH0kAVqtCNXh5RwQrg720uexYx4jvvQhOdiNBO9r2e4lN+nXsYioV/Y1n1vLFda3PFiNvzyg0UXWct0Uw4XUpwxyLa3uB03wPLkDIE4bk2lcAAfWkDkKeua4+Ky3AA== 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=lxsWHfVwNlQzMBDUw49GB6WrQxH+DgSHSFu9QWGB5BU=; b=JL6W8z7VCA/EG+dIAOLCKGD+PCJ6r0n/bLYkQa7kcQjm0S3Y/ED6uVu4SEL//kT9g1sC6qF9bjf8hsqe/p3rUFkRRjmTF35CEPEgbWPHvWzDILJMpd6tQ2n9RayREUEim489guxUwHQESz3I1YT/5HZ+Wkn8zMAc3eA7GfWwbC35eSgWkKUCgINxGJgHsK2rWw5uAGtuBc3P+640FBLvrtlrhe0VJK/iJOljkbfviL3xQJZZ1fNN3H5dAO1lLGpxFwuedwzwO/ZKiPlpCEj6Qg4czzJxfij6i6jVm+s7zBOlyEHyRZW9gHPz3tk3oyu+KOX/UO3i75E96J0Zr2zd0Q== 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=lxsWHfVwNlQzMBDUw49GB6WrQxH+DgSHSFu9QWGB5BU=; b=ZHHKiIaL5hnaPYyqOkeaOB5/dx/GbDeXIiz+tK2kVNbgeGulCYpt4Mk2KYV8kbAayRWvNp61ilCyf+gwb2Orbub7KvjF0+jQkEcvSUgRflLkgHiNX6395y3zhIEOyg8Dbgb5K4N9zazTH/oyAXP7Ampc5kCWviNhuPXAd+6+60Y= 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 DU2PR04MB8949.eurprd04.prod.outlook.com (2603:10a6:10:2e0::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Wed, 14 Sep 2022 15:33:34 +0000 Received: from VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::a67a:849c:aeff:cad1]) by VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::a67a:849c:aeff:cad1%7]) with mapi id 15.20.5612.022; Wed, 14 Sep 2022 15:33:34 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Xiaoliang Yang , Rui Sousa , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Andrew Lunn , Vivien Didelot , Florian Fainelli , Michael Walle , Vinicius Costa Gomes , Maxim Kochetkov , Colin Foster , Richie Pearn , Kurt Kanzenbach , Vladimir Oltean , Jesse Brandeburg , Tony Nguyen , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Jamal Hadi Salim , Cong Wang , Jiri Pirko , Gerhard Engleder , Grygorii Strashko , linux-kernel@vger.kernel.org Subject: [PATCH net-next 04/13] net/sched: taprio: allow user input of per-tc max SDU Date: Wed, 14 Sep 2022 18:32:54 +0300 Message-Id: <20220914153303.1792444-5-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220914153303.1792444-1-vladimir.oltean@nxp.com> References: <20220914153303.1792444-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AS4P250CA0023.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:5e3::11) To VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB5136:EE_|DU2PR04MB8949:EE_ X-MS-Office365-Filtering-Correlation-Id: f230365d-733b-4500-e743-08da96667c2b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TriDEO/BkbwO2N88Qluv5C6QRUWjKp0ZVTBaVgmiPycZtoA/Avmp7eE6o3D+igkwNYOXYcUrpCevvlYaEsj+sTXDzYEJjjzUyPjYM/U2UAYTtEZinv3mOlMtAlut5Vg7GQeZOzS/WGueWSvq72o+gnKjY8wnTxpgVgkjsSJdZsWI2iXpxUYiZsYhw7pYOUbcKvk2rEzfHq/zAUVLqJrRavRd13RcXsHvayAplyvmNRmJRbx44ztslFE0Fd+OgxU5XuQCfYR/5FpqJpJAr5TyZeyRt5MoxvizunXkKn394Pmw3a8TwH0FCvpMt3udjMzHZoSEHDB4dHm2X7tL3qNfQT0J/9ccBw/qs+qVrfxIHo37ml35a91LzdBkWhmVVxQZjD4cbX+h51Gyn9c4tH+b/idC5qeRKBFIyppcxZCxjx0AGkiYTZpkFFXJn6EBvc5ZUtwXt7BwUn/0ayjmhHJ/+CmhgIDXsbm0si/0E4yDIqU1MCzO9TSZn4bgkwbkbQVExCMOFMWRCwsjuE75AKm6wnmf5z7WdYUQUJfdVGCKVVfHrBratAwPrcNgXICt4VWBxnvcSK8hDSTEQvDqYnlCV9qt1Lup+IaQDIlxhJUDVQrZH+HibHs/tk6Y9lZiVbxgyr30WdYMmm0jTPP3MyyIQUmrYjh/Nqt4seKEhcrOaKJek+iO+9bCUCZTqSobiXw9lpIbv9CQpw1ioZExLrxAF5qgFzCzzBI0oTHvbtFqfG+7Tpz/At3gchMwEEK186q3p3DEQRjPtOVTe9R8R7Uj3g== 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:(13230022)(4636009)(346002)(376002)(136003)(396003)(366004)(39860400002)(451199015)(6512007)(2616005)(52116002)(66476007)(44832011)(4326008)(41300700001)(66946007)(316002)(26005)(8936002)(2906002)(36756003)(6916009)(54906003)(6666004)(86362001)(38350700002)(1076003)(38100700002)(5660300002)(6486002)(186003)(66556008)(7416002)(478600001)(83380400001)(6506007)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5lURayTaIebdc7OElAU7/CmhDCI4XemBe8tlAMTaSH9vj3jk46TIdHKOc0/T5sb4dbzGEzMzFwiz8ud+ijC2R//Jv13TvNleJkz2vBX7Nla/8M3QVLYRAEGH2C1O9YbirHOasJspvzb6VwGmdBZU6nMSViIk/fow6y89tCcoDr8ilp6x/L+DDfxjcrvyDk3JqrGvNBifW7nOizblZtk6qjZ4SjUCSbgDMTAnYdsiBddWJtozpWVDMSeNE8ZRLRnotfYhqodS4VdRiy9KTmm/wGPOCJ6UiiZ5uLjiiPkSj4La/eBYUpVDGmHX427khyJwy62HOwRm/UXACf3UH12+fvsafnWVW1wRj4KwVgK2g1c1KgvheP1vp2Gl/1s8PpJlJ11Pa71gXVih+oxmTKnwkEJ/fdIkuTKbyXI7nnDcoUuYbwsT6r8q22qYNQ+C/AemmGEWp51v2ejQCc5LW1jt3y+qmveJ+KaXcEjvKUfnhBSCBqr9Nn7FIQuWsKnoJTqXtxMkaudx4u/WRbAUTN5yQ6G59AT5Cekmq/nqtgguvC81ssextJRCPSbo9gOHj6r9saOUBNpLl+in5oQ8OpMy+gLoiRIW58MhSJfJ18ypMC5+yTUl05FVRPDnanXwpAYtwom8hfD4a6BynxUPEiXrEcs7Om3Emuj3rWmP7Sgr21OZ5ErZr2rVa79xrQ6zbfL1CGqRd5TqaBlWj7GSNoEwKY0xYAYAyCxDhGTevwaIl4mJksaBLctdHJq6mERecCcd8zPd9Sey7Y8rdO1qTCqcvxOeZNga6AiJoyYZIGJtxPMYSrlvVa1H2MXNfXWYPTUN+HcfAzO8yNWu49s203UcKlqXWKrCFjeKkE7QLAQ0sFwLtr/3t5ug6DoqCAk5LuuZPNkZS3qSLwblDfzAP5v/g9tUlIfVvCCJLtz+VkVNTzaojexuZoLTi7ui6app2hIrRTUIAOCJct1G/x+ebru+u93spmNiNlM3cCisHPjY8AeT66O9QA5jQTC7aOamvuRQamPINHRdcF2gwLw0Xayez+URglNPhY+pHng4HDNUukLnrOgcyU1zUGrhMxhRXldmsOQRWu7Q8YxrfA8+21DWEPmCC+SAlgnar3WYfaHkRy4uyiGekK3BJMEHvk+9il5TDdUnWvTSqcZsIvNhtVZAKzmr4mcjX3Y2da5t3x9v1SvAZ4h1FFXz+MEGQzGwMEbn4jEc98yJuMb4pTLH67cC4XVK3UYWHUuWjtt212Gm8zTpAuWy1CVp1hNVgYPqE9orqReRfu4EJJGo1Oo1y3LYG2QtuPOuyknsTeOD0n2VeR0glXNVyJu52UHaqngjKE/Y1r0+ySBDLong7/M7f7+GSOKr5V9zBnI+gtpd7fiP6/npfaohqVNX3XvkYXaarbV0gFtp6okFBj+fczocSDc6MW15JU8Wez4cPrKT8waWaAabWVimuUkKtg2y3B9HHGa8KpvqCGBRPFgr6/NY43V0ZH20x8Nm5VD8wkSgauZFhL6E/nxw6fpDZ2SDW9X/dBK8aDuTqInjBzQ+a3ft8ZCk2EH1n8wPw9aGjDVES8ilZCO7OF8A8FePxglGttjj+WZGVCqWSM12V8Z4D0BIt5h4jQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f230365d-733b-4500-e743-08da96667c2b X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2022 15:33:34.2928 (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: tOSDkWl3YmnVsFOKNB00780SMMr1fS86gCsIWnMZhopMnTaxON7kXu2gBQNzDlB48P2kWsKlqsssJjgVLf7ipw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8949 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org IEEE 802.1Q clause 12.29.1.1 "The queueMaxSDUTable structure and data types" and 8.6.8.4 "Enhancements for scheduled traffic" talk about the existence of a per traffic class limitation of maximum frame sizes, with a fallback on the port-based MTU. As far as I am able to understand, the 802.1Q Service Data Unit (SDU) represents the MAC Service Data Unit (MSDU, i.e. L2 payload), excluding any number of prepended VLAN headers which may be otherwise present in the MSDU. Therefore, the queueMaxSDU is directly comparable to the device MTU (1500 means L2 payload sizes are accepted, or frame sizes of 1518 octets, or 1522 plus one VLAN header). Drivers which offload this are directly responsible of translating into other units of measurement. Signed-off-by: Vladimir Oltean --- include/net/pkt_sched.h | 1 + include/uapi/linux/pkt_sched.h | 11 +++ net/sched/sch_taprio.c | 122 ++++++++++++++++++++++++++++++++- 3 files changed, 133 insertions(+), 1 deletion(-) diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h index 29f65632ebc5..88080998557b 100644 --- a/include/net/pkt_sched.h +++ b/include/net/pkt_sched.h @@ -168,6 +168,7 @@ struct tc_taprio_qopt_offload { ktime_t base_time; u64 cycle_time; u64 cycle_time_extension; + u32 max_sdu[TC_MAX_QUEUE]; size_t num_entries; struct tc_taprio_sched_entry entries[]; diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h index f292b467b27f..000eec106856 100644 --- a/include/uapi/linux/pkt_sched.h +++ b/include/uapi/linux/pkt_sched.h @@ -1232,6 +1232,16 @@ enum { #define TCA_TAPRIO_ATTR_FLAG_TXTIME_ASSIST _BITUL(0) #define TCA_TAPRIO_ATTR_FLAG_FULL_OFFLOAD _BITUL(1) +enum { + TCA_TAPRIO_TC_ENTRY_UNSPEC, + TCA_TAPRIO_TC_ENTRY_INDEX, /* u32 */ + TCA_TAPRIO_TC_ENTRY_MAX_SDU, /* u32 */ + + /* add new constants above here */ + __TCA_TAPRIO_TC_ENTRY_CNT, + TCA_TAPRIO_TC_ENTRY_MAX = (__TCA_TAPRIO_TC_ENTRY_CNT - 1) +}; + enum { TCA_TAPRIO_ATTR_UNSPEC, TCA_TAPRIO_ATTR_PRIOMAP, /* struct tc_mqprio_qopt */ @@ -1245,6 +1255,7 @@ enum { TCA_TAPRIO_ATTR_SCHED_CYCLE_TIME_EXTENSION, /* s64 */ TCA_TAPRIO_ATTR_FLAGS, /* u32 */ TCA_TAPRIO_ATTR_TXTIME_DELAY, /* u32 */ + TCA_TAPRIO_ATTR_TC_ENTRY, /* nest */ __TCA_TAPRIO_ATTR_MAX, }; diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c index 2a4b8f59f444..834cbed88e4f 100644 --- a/net/sched/sch_taprio.c +++ b/net/sched/sch_taprio.c @@ -79,6 +79,7 @@ struct taprio_sched { struct sched_gate_list __rcu *admin_sched; struct hrtimer advance_timer; struct list_head taprio_list; + u32 max_sdu[TC_MAX_QUEUE]; u32 txtime_delay; }; @@ -416,6 +417,9 @@ static int taprio_enqueue_one(struct sk_buff *skb, struct Qdisc *sch, struct Qdisc *child, struct sk_buff **to_free) { struct taprio_sched *q = qdisc_priv(sch); + struct net_device *dev = qdisc_dev(sch); + int prio = skb->priority; + u8 tc; /* sk_flags are only safe to use on full sockets. */ if (skb->sk && sk_fullsock(skb->sk) && sock_flag(skb->sk, SOCK_TXTIME)) { @@ -427,6 +431,12 @@ static int taprio_enqueue_one(struct sk_buff *skb, struct Qdisc *sch, return qdisc_drop(skb, sch, to_free); } + /* Devices with full offload are expected to honor this in hardware */ + tc = netdev_get_prio_tc_map(dev, prio); + if (q->max_sdu[tc] && + q->max_sdu[tc] < max_t(int, 0, skb->len - skb_mac_header_len(skb))) + return qdisc_drop(skb, sch, to_free); + qdisc_qstats_backlog_inc(sch, skb); sch->q.qlen++; @@ -761,6 +771,11 @@ static const struct nla_policy entry_policy[TCA_TAPRIO_SCHED_ENTRY_MAX + 1] = { [TCA_TAPRIO_SCHED_ENTRY_INTERVAL] = { .type = NLA_U32 }, }; +static const struct nla_policy taprio_tc_policy[TCA_TAPRIO_TC_ENTRY_MAX + 1] = { + [TCA_TAPRIO_TC_ENTRY_INDEX] = { .type = NLA_U32 }, + [TCA_TAPRIO_TC_ENTRY_MAX_SDU] = { .type = NLA_U32 }, +}; + static const struct nla_policy taprio_policy[TCA_TAPRIO_ATTR_MAX + 1] = { [TCA_TAPRIO_ATTR_PRIOMAP] = { .len = sizeof(struct tc_mqprio_qopt) @@ -773,6 +788,7 @@ static const struct nla_policy taprio_policy[TCA_TAPRIO_ATTR_MAX + 1] = { [TCA_TAPRIO_ATTR_SCHED_CYCLE_TIME_EXTENSION] = { .type = NLA_S64 }, [TCA_TAPRIO_ATTR_FLAGS] = { .type = NLA_U32 }, [TCA_TAPRIO_ATTR_TXTIME_DELAY] = { .type = NLA_U32 }, + [TCA_TAPRIO_ATTR_TC_ENTRY] = { .type = NLA_NESTED }, }; static int fill_sched_entry(struct taprio_sched *q, struct nlattr **tb, @@ -1236,7 +1252,7 @@ static int taprio_enable_offload(struct net_device *dev, { const struct net_device_ops *ops = dev->netdev_ops; struct tc_taprio_qopt_offload *offload; - int err = 0; + int tc, err = 0; if (!ops->ndo_setup_tc) { NL_SET_ERR_MSG(extack, @@ -1253,6 +1269,9 @@ static int taprio_enable_offload(struct net_device *dev, offload->enable = 1; taprio_sched_to_offload(dev, sched, offload); + for (tc = 0; tc < TC_MAX_QUEUE; tc++) + offload->max_sdu[tc] = q->max_sdu[tc]; + err = ops->ndo_setup_tc(dev, TC_SETUP_QDISC_TAPRIO, offload); if (err < 0) { NL_SET_ERR_MSG(extack, @@ -1387,6 +1406,73 @@ static int taprio_parse_clockid(struct Qdisc *sch, struct nlattr **tb, return err; } +static int taprio_parse_tc_entry(struct Qdisc *sch, + struct nlattr *opt, + unsigned long *seen_tcs, + struct netlink_ext_ack *extack) +{ + struct nlattr *tb[TCA_TAPRIO_TC_ENTRY_MAX + 1] = { }; + struct taprio_sched *q = qdisc_priv(sch); + struct net_device *dev = qdisc_dev(sch); + u32 max_sdu = 0; + int err, tc; + + err = nla_parse_nested(tb, TCA_TAPRIO_TC_ENTRY_MAX, opt, + taprio_tc_policy, extack); + if (err < 0) + return err; + + if (!tb[TCA_TAPRIO_TC_ENTRY_INDEX]) { + NL_SET_ERR_MSG_MOD(extack, "TC entry index missing"); + return -EINVAL; + } + + tc = nla_get_u32(tb[TCA_TAPRIO_TC_ENTRY_INDEX]); + if (tc >= TC_QOPT_MAX_QUEUE) { + NL_SET_ERR_MSG_MOD(extack, "TC entry index out of range"); + return -ERANGE; + } + + if (*seen_tcs & BIT(tc)) { + NL_SET_ERR_MSG_MOD(extack, "Duplicate TC entry"); + return -EINVAL; + } + + *seen_tcs |= BIT(tc); + + if (tb[TCA_TAPRIO_TC_ENTRY_MAX_SDU]) + max_sdu = nla_get_u32(tb[TCA_TAPRIO_TC_ENTRY_MAX_SDU]); + + if (max_sdu > dev->max_mtu) { + NL_SET_ERR_MSG_MOD(extack, "TC max SDU exceeds device max MTU"); + return -ERANGE; + } + + q->max_sdu[tc] = max_sdu; + + return 0; +} + +static int taprio_parse_tc_entries(struct Qdisc *sch, + struct nlattr *opt, + struct netlink_ext_ack *extack) +{ + unsigned long seen_tcs = 0; + struct nlattr *n; + int err = 0, rem; + + nla_for_each_nested(n, opt, rem) { + if (nla_type(n) != TCA_TAPRIO_ATTR_TC_ENTRY) + continue; + + err = taprio_parse_tc_entry(sch, n, &seen_tcs, extack); + if (err) + break; + } + + return err; +} + static int taprio_mqprio_cmp(const struct net_device *dev, const struct tc_mqprio_qopt *mqprio) { @@ -1465,6 +1551,10 @@ static int taprio_change(struct Qdisc *sch, struct nlattr *opt, if (err < 0) return err; + err = taprio_parse_tc_entries(sch, opt, extack); + if (err) + return err; + new_admin = kzalloc(sizeof(*new_admin), GFP_KERNEL); if (!new_admin) { NL_SET_ERR_MSG(extack, "Not enough memory for a new schedule"); @@ -1855,6 +1945,33 @@ static int dump_schedule(struct sk_buff *msg, return -1; } +static int taprio_dump_tc_entries(struct taprio_sched *q, struct sk_buff *skb) +{ + struct nlattr *n; + int tc; + + for (tc = 0; tc < TC_MAX_QUEUE; tc++) { + n = nla_nest_start(skb, TCA_TAPRIO_ATTR_TC_ENTRY); + if (!n) + return -EMSGSIZE; + + if (nla_put_u32(skb, TCA_TAPRIO_TC_ENTRY_INDEX, tc)) + goto nla_put_failure; + + if (nla_put_u32(skb, TCA_TAPRIO_TC_ENTRY_MAX_SDU, + q->max_sdu[tc])) + goto nla_put_failure; + + nla_nest_end(skb, n); + } + + return 0; + +nla_put_failure: + nla_nest_cancel(skb, n); + return -EMSGSIZE; +} + static int taprio_dump(struct Qdisc *sch, struct sk_buff *skb) { struct taprio_sched *q = qdisc_priv(sch); @@ -1894,6 +2011,9 @@ static int taprio_dump(struct Qdisc *sch, struct sk_buff *skb) nla_put_u32(skb, TCA_TAPRIO_ATTR_TXTIME_DELAY, q->txtime_delay)) goto options_error; + if (taprio_dump_tc_entries(q, skb)) + goto options_error; + if (oper && dump_schedule(skb, oper)) goto options_error; From patchwork Wed Sep 14 15:32:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 12976309 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 905A8C6FA8B for ; Wed, 14 Sep 2022 15:34:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229915AbiINPeL (ORCPT ); Wed, 14 Sep 2022 11:34:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230023AbiINPdk (ORCPT ); Wed, 14 Sep 2022 11:33:40 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2089.outbound.protection.outlook.com [40.107.22.89]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0961948CAB; Wed, 14 Sep 2022 08:33:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D3bU8H8uXa4/5s4sd3DMe0pNzCJxHoZgVBEz6WiHu0+wHrjRVSjvTLz1qOQCytbVevKQvuJPQOoDPzLUmcqEhuRMGTkaX2hIMhbz620qFsRyr+or+9Ci1VToZXSv4sYWnxbTVtpz6LtzTzwNp5U/IYcx7pMovcfH7tblL6RH/cCTWj2NpbJBiaXCtCkCtthYAJRze3Oxr8QX8jiRB63dmTjmu8aYPF8jy+95NxuSu1YHxEso2T36NHLVRk0dxTE2Ovcwo7bUMKe/6SgW1uuMNP49a+yKDHD5ou7oxSo0gARMLbFCquWL+PGadyY3/8trJEMS8KRc4UDszkgDaPbbXw== 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=gkK9DYZgwlUxmhoatoYAIzomh1elz1DJ6vTt8KpZkqI=; b=RBRYk82DNtktI3lg6n1meV2HNb+72JJra+czB6/iHCLZ//+Ip5YYGGa1ujITjIlh9XY7MERZchgmxjMJ6NTkYg/Bp5apT3W63GAqGhSarUqhV61YWLnaVx0r5mqwOmznObER+E+uvXZmfQYtHDnQNWSasiXj/VmEF7rAdBdao1vMd2FvM9Fpj7/0rbZZ9C4dt6lvpdwd+jHFXvKVGWjCr6XsEQqxhTP5a+dFnXWZTbaMKR2wLHkKojTyrM+kclR/vQRSOn5uQ7qlnqy2E5dfRK8X9ILqqLWNzUMRo5auq2DH8KA5naTYa/OExBbmb5VwDIK4WA0vN0BvBMp+MGR29w== 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=gkK9DYZgwlUxmhoatoYAIzomh1elz1DJ6vTt8KpZkqI=; b=oFbLMnvF5agasc/tTttcolsHTQNYvHngpYW7/NXg908fqwq22R3sqZaXYfx+aDjw9WLzIV0dtl1QVLOsp58PaL2BdoQiYsn88DiTtIvAUcfMW6SC8b7KU9hCXmfvuTTblzDJf7q8pjzNEHJ5Oz1eVbWPfOUdxRtvB04VPvwhnU0= 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 DU2PR04MB8949.eurprd04.prod.outlook.com (2603:10a6:10:2e0::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Wed, 14 Sep 2022 15:33:37 +0000 Received: from VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::a67a:849c:aeff:cad1]) by VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::a67a:849c:aeff:cad1%7]) with mapi id 15.20.5612.022; Wed, 14 Sep 2022 15:33:37 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Xiaoliang Yang , Rui Sousa , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Andrew Lunn , Vivien Didelot , Florian Fainelli , Michael Walle , Vinicius Costa Gomes , Maxim Kochetkov , Colin Foster , Richie Pearn , Kurt Kanzenbach , Vladimir Oltean , Jesse Brandeburg , Tony Nguyen , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Jamal Hadi Salim , Cong Wang , Jiri Pirko , Gerhard Engleder , Grygorii Strashko , linux-kernel@vger.kernel.org Subject: [PATCH net-next 05/13] net: dsa: felix: offload per-tc max SDU from tc-taprio Date: Wed, 14 Sep 2022 18:32:55 +0300 Message-Id: <20220914153303.1792444-6-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220914153303.1792444-1-vladimir.oltean@nxp.com> References: <20220914153303.1792444-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AS4P250CA0023.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:5e3::11) To VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB5136:EE_|DU2PR04MB8949:EE_ X-MS-Office365-Filtering-Correlation-Id: 3261fd48-d474-4d74-04c7-08da96667df8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: f+xP0yr4JvuLCRxdm0IjUCuInYQSdxVcSgYGpyZaU4WdtJFNUHR+b4Yfrc7TSGs1dYHw+679JlvkFCnYYBLLptI/PcK4k6W+faa85ldzKYtOUnTneYoao/xPwo6aS5TIlK7nupBONF1GXgF0McxPE6mSxzILUg5lAnVSUfn1/9aRz3PWFGnKDzWwgTF8Ylzl0nF6RVKPpOuPaqA/vl+lYJxdwe77YVU5sP7zuPJP/njPF3EUcYenPdOnuVziimXDyKYittIePDetr3qk19oJ41i6F+w0maUBdl+D8Qh2Rx+DEaFq8UaEeeSuXRqbKbAGNljPTYZn3m2gzPGEhST/MqI5RQ7wPe2Cmj46O7EUdpnYCYGNlAVkzq2aGHwSrDm78C7H8Vqz0orTHruQE3zscS1HAXxv7CzigGnopbQvYgClKWxQ4pNrGpD+qLVt1g0NekUGhYAHbn51gq4nDEtgQAD+jjQwxRehmMGWhieAcTt7dJ2++AxfjucP5nt0BbJULu2RI2HllsKgzFL2ahCL5aHzStGOL8ntwsHZGyuvP7PugG8UC1+OYk5P+e0hhN97OIUEu1A4Pz6rmDI1XMDJEh+SjJhntN+YBs0EdHywF1oEotU999QNwa0jC2KThOOr4NeBrJVbbif/BmxJWt3yRVDm5wi3aMuvA+cKS75q+9SwR+zejhXMn0bj/qzzpmPb95a5lBbyT7wXZCIln2w2/u+tjTi5uJzDVBeqouWsC5GfY78dUnqSBnGA/G2OEKyBXJZgk8Jt1ICY5Mxv1WISIg== 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:(13230022)(4636009)(346002)(376002)(136003)(396003)(366004)(39860400002)(451199015)(6512007)(2616005)(52116002)(66476007)(44832011)(4326008)(41300700001)(66946007)(316002)(26005)(8936002)(2906002)(36756003)(6916009)(54906003)(6666004)(86362001)(38350700002)(1076003)(38100700002)(5660300002)(6486002)(186003)(66556008)(7416002)(478600001)(83380400001)(6506007)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 282J7k1Sfol99XXwd4/QoKlNHLJtF8SopLFC0YChv1W4UMs+z7x+INC8+HjMglri2Ms5+DUhh64NjqiC2Z9fsccLnw52TU13x/0xUdc70fOi3uiYzuzpzOKwB41reD8hUPvZ1+W3z23uLYKTpBoDsaoreW2Glf1agqnTNGuSucGRUqUVSsfv97awAz8k8zHj56QzQN+wbUWIEmjOvde04G39ScCZaGZrP8jApnSL6l7y2jb3ZTYm3KMkrncWGs0Blx2tfIinBNaKkwGXo1Uc8ecjE8slsQ/PXiQ8F9Zvd0vmPPtunLe+W9QmtxbVZj3ZyPKXberWwU4LOuXDhMIml4vz6Vl2BRoPPNgpOOcU4ElnpgMsxlDZs+xZL8hzWi5jIXOtihPv3Ow8iZRp4hI4hZl0/cJTcwROnAycxKUapTkvw85hv6S8RT4Vxw2IVoPb2IODWOaC5OQwr7vd7cSxeGK4ksKQSB0bflYciXdp8Bm/KFUT53V/ZAO2qCWQtVggibx2dtTh94Zas0CPgaPJ6jTvVERtL/PwxOtRYFEQLeaT1gGymYthFlOkiY+klZGsaXjENVFMCA2daRrBq10auygRef40km1iWSrDCO70IcCe/0++KhUl82ntXZ/ssvRM1QN3I9gXEqp3yeBp33Yw+fxfzTfxZfbdsJUuEwLiX4fvl2EGqOGTKRGdUcoCTHEdrjiy2YqlU2HuIw6FkSOW6a6DjovIHoGwEkA0/Vpj+XPGoRqMmdoMF7Hd+wZsWIjzgzYkJurqDNUJKkcHlM6Km3G2CjwPaqtzjitv/ZGc5Atq1sSJDSe3MtDG6me8GUTY3slkN7ceqY4T5CwemdGZ6RaedfHPohH46FDyMpTdv2lVQHd60e+f73Fweqw2foMvOj7wlIfH2rs+Y1C0bPAn6YmAehJnwmBr6e7a/HJk53Mm8rvOerqRqDl8q0nwArO/8paUG5D6vIbtpC8Ril3p9PIf8MCDzRBB9jN8LtJ4B53KIWOm0n7/Yrmm6LTf+X11cSAcDXGxgo+anfuU7N1PO+SqqC78mkbxBMtrBZjTR2Y0OtfMneBZV5SPEqa4bo0I5dUUwMFjEyQ7tsyXV/Sf9RXi7NtYAJ+ZceiUV0j+detRYsRXi8w6913Ci8O0g7hirWqcegBqy8e3sKV2VhfVZZibF6WuV0qtNmMIN1Q5Qf0ZRccQhf7ENBAahzQFTljqomEUpvr4ESSNPMMTxjmMlEJS8ogG5j2NSQawe14mONEe98UCeVLw4zGKBHE7qxe0Gb7rUa/QqvO10ToF4PQZ4eO0mVZa5olb6Cba0PTjkQ+Fihrs5DkAdEp7AWZUwEPDD+Qh4orOEkco9ycI0IfrAApIByaPIAxbqFsb0ako3D3S01p4MCwVNRFMdhf0t92zFwJ3G3poZ018kNsNZ9kZv1Q3wPREh9U69nm2uWePHA6lrLnw/bqU7IuScZco+FKnt21g4MC6ZNIXHngUthEkmnb3Nn47X9HAYt4T2JquaJLRd5Aa+yh4ldtnJb5SJ0fsppZWZGdCzWpWdr3nTKpSCTvnvAz0FVyKN2iKPJ4gwVNRqGXxLYfONomc69K6ddQEjsQTFocGjODY7Jhm6Xo9Pg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3261fd48-d474-4d74-04c7-08da96667df8 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2022 15:33:37.3239 (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: AcVo/q3At505J+gCYUtzsetPBlGGZ5DLO7kChNWKplIX3Uve5H6lyP43hRXOTmr4vNPMCwRwNCr0ShmAbpca0Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8949 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Our current vsc9959_tas_guard_bands_update() algorithm has a limitation imposed by the hardware design. To avoid packet overruns between one gate interval and the next (which would add jitter for scheduled traffic in the next gate), we configure the switch to use guard bands. These are as large as the largest packet which is possible to be transmitted. The problem is that at tc-taprio intervals of sizes comparable to a guard band, there isn't an obvious place in which to split the interval between the useful portion (for scheduling) and the guard band portion (where scheduling is blocked). For example, a 10 us interval at 1Gbps allows 1225 octets to be transmitted. We currently split the interval between the bare minimum of 33 ns useful time (required to schedule a single packet) and the rest as guard band. But 33 ns of useful scheduling time will only allow a single packet to be sent, be that packet 1200 octets in size, or 60 octets in size. It is impossible to send 2 60 octets frames in the 10 us window. Except that if we reduced the guard band (and therefore the maximum allowable SDU size) to 5 us, the useful time for scheduling is now also 5 us, so more packets could be scheduled. The hardware inflexibility of not scheduling according to individual packet lengths must unfortunately propagate to the user, who needs to tune the queueMaxSDU values if he wants to fit more small packets into a 10 us interval, rather than one large packet. Signed-off-by: Vladimir Oltean --- drivers/net/dsa/ocelot/felix_vsc9959.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/net/dsa/ocelot/felix_vsc9959.c b/drivers/net/dsa/ocelot/felix_vsc9959.c index 459288d6222c..3c9a15dc7f59 100644 --- a/drivers/net/dsa/ocelot/felix_vsc9959.c +++ b/drivers/net/dsa/ocelot/felix_vsc9959.c @@ -1248,6 +1248,14 @@ static u32 vsc9959_port_qmaxsdu_get(struct ocelot *ocelot, int port, int tc) } } +static u32 vsc9959_tas_tc_max_sdu(struct tc_taprio_qopt_offload *taprio, int tc) +{ + if (!taprio || !taprio->max_sdu[tc]) + return 0; + + return taprio->max_sdu[tc] + ETH_HLEN + 2 * VLAN_HLEN + ETH_FCS_LEN; +} + /* Update QSYS_PORT_MAX_SDU to make sure the static guard bands added by the * switch (see the ALWAYS_GUARD_BAND_SCH_Q comment) are correct at all MTU * values (the default value is 1518). Also, for traffic class windows smaller @@ -1257,6 +1265,7 @@ static u32 vsc9959_port_qmaxsdu_get(struct ocelot *ocelot, int port, int tc) static void vsc9959_tas_guard_bands_update(struct ocelot *ocelot, int port) { struct ocelot_port *ocelot_port = ocelot->ports[port]; + struct tc_taprio_qopt_offload *taprio; u64 min_gate_len[OCELOT_NUM_TC]; int speed, picos_per_byte; u64 needed_bit_time_ps; @@ -1266,6 +1275,8 @@ static void vsc9959_tas_guard_bands_update(struct ocelot *ocelot, int port) lockdep_assert_held(&ocelot->tas_lock); + taprio = ocelot_port->taprio; + val = ocelot_read_rix(ocelot, QSYS_TAG_CONFIG, port); tas_speed = QSYS_TAG_CONFIG_LINK_SPEED_X(val); @@ -1302,11 +1313,12 @@ static void vsc9959_tas_guard_bands_update(struct ocelot *ocelot, int port) "port %d: max frame size %d needs %llu ps at speed %d\n", port, maxlen, needed_bit_time_ps, speed); - vsc9959_tas_min_gate_lengths(ocelot_port->taprio, min_gate_len); + vsc9959_tas_min_gate_lengths(taprio, min_gate_len); mutex_lock(&ocelot->fwd_domain_lock); for (tc = 0; tc < OCELOT_NUM_TC; tc++) { + u32 requested_max_sdu = vsc9959_tas_tc_max_sdu(taprio, tc); u64 remaining_gate_len_ps; u32 max_sdu; @@ -1317,7 +1329,7 @@ static void vsc9959_tas_guard_bands_update(struct ocelot *ocelot, int port) /* Setting QMAXSDU_CFG to 0 disables oversized frame * dropping. */ - max_sdu = 0; + max_sdu = requested_max_sdu; dev_dbg(ocelot->dev, "port %d tc %d min gate len %llu" ", sending all frames\n", @@ -1348,6 +1360,10 @@ static void vsc9959_tas_guard_bands_update(struct ocelot *ocelot, int port) */ if (max_sdu > 20) max_sdu -= 20; + + if (requested_max_sdu && requested_max_sdu < max_sdu) + max_sdu = requested_max_sdu; + dev_info(ocelot->dev, "port %d tc %d min gate length %llu" " ns not enough for max frame size %d at %d" From patchwork Wed Sep 14 15:32:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 12976311 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F8FEC6FA90 for ; Wed, 14 Sep 2022 15:34:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230261AbiINPeO (ORCPT ); Wed, 14 Sep 2022 11:34:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230082AbiINPdp (ORCPT ); Wed, 14 Sep 2022 11:33:45 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2072.outbound.protection.outlook.com [40.107.22.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4225448CAB; Wed, 14 Sep 2022 08:33:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IaV0SkpkWoifrYEY/hjX/mRytophlS+MAQzMjP9Ql3U7Av1KAZh93zE3CIa1LHQa4cR4ezjSZCNukASPZx9czJpzE8BGDl9Vgp9zEXHNDsx/d13f7slaIwL/z3V6kNRH83sK1zA8W0K6VklqljLR2NOBt0+qmFKRB3LXoZr88JFaI4fnUubW/XL8Pynqt49ve8jJqCL4evbWZ8zpqBDosyBxgFhGdXn2Z5BvlKVmYsTxDRhSGyN98cdq7hX2HO0ehhlYMrPZV8NAGUg0hAH2oojCeN+mnhjjMC74dDgULmcfJ6sYo8wlvz355bH+TmYEVzHlxPU15XDImRnP0ae4pg== 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=ibKIHBzuhX/omZGa2Ae8nq4GpL5lNpLQGO+1LOZ8IaA=; b=mn0hfsufMmZao+TEwz2t2onN5+DKbW5QLBQv2BaU+ZFR/Uo8M6XTbxASdXQXF5L5SCtj9eOgnaNCcyp1OiF4iz+7VNuq7AChoXvEVLQ5BYPXzD6n3ROUsMM2ZbfBIjDUu/ONfVEWpRU3ytfvcMRR9jnptQ1oV2og+CIrhqr4zPTWUB9ZSHmAJ6wlScEyUgypWjS483mykfHEyaWvqgNAZnORMxAL17+lRX0QB2KiSiZ7Divo5DEqoeKQNd6iPoRtzKZ45JF9yt6LKlMlJXIsIPpMw/j9c8pcxsD7M4REc7bd7YNEsbxCRZ9IkOXZg4cxr76iwizG3dPxZEDPVX04wg== 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=ibKIHBzuhX/omZGa2Ae8nq4GpL5lNpLQGO+1LOZ8IaA=; b=Iu6K4VybN6BwKEGmQA9BhFjnWYdXmC95E3jGiw4H4D0rrGi7OM5uUMNk0jB5yrCpC4Wip9emlgLSAvTl7ltiUJgB17ErbRF+al/A7F8LJa2Xi2dzaImYbwZGZ6doonIL2sAj+z5bpKmf6sW1hJJY/MZH8AUtb3a5IS8pKsz7qjM= 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 DU2PR04MB8949.eurprd04.prod.outlook.com (2603:10a6:10:2e0::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Wed, 14 Sep 2022 15:33:40 +0000 Received: from VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::a67a:849c:aeff:cad1]) by VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::a67a:849c:aeff:cad1%7]) with mapi id 15.20.5612.022; Wed, 14 Sep 2022 15:33:40 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Xiaoliang Yang , Rui Sousa , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Andrew Lunn , Vivien Didelot , Florian Fainelli , Michael Walle , Vinicius Costa Gomes , Maxim Kochetkov , Colin Foster , Richie Pearn , Kurt Kanzenbach , Vladimir Oltean , Jesse Brandeburg , Tony Nguyen , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Jamal Hadi Salim , Cong Wang , Jiri Pirko , Gerhard Engleder , Grygorii Strashko , linux-kernel@vger.kernel.org Subject: [PATCH net-next 06/13] net: enetc: cache accesses to &priv->si->hw Date: Wed, 14 Sep 2022 18:32:56 +0300 Message-Id: <20220914153303.1792444-7-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220914153303.1792444-1-vladimir.oltean@nxp.com> References: <20220914153303.1792444-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AS4P250CA0023.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:5e3::11) To VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB5136:EE_|DU2PR04MB8949:EE_ X-MS-Office365-Filtering-Correlation-Id: b85ffed5-814a-4067-fb62-08da96667fbc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: D4E9lk7LWVyIueOoxjQN0q1iAT0Ysz5qXdfDZ/ZdSY+7BOnxI5MUJIIk+Y3lEaw74oO6OxqSPyd9IBYE2K5lfDzU5COFBxv842RS1Z1WmyaSUOgt6KG1rTUliLy9p+NARniAMntgv213L0/PyqOlLVw0tabyRNTLqAFuecw4aCc5p2Ey/jhOwjvHARGOqCO/9eHgispaVzgLs3pxioWP0F790ByKYu3yyIVdjhP86mr9KZaLNu6guVCVPbTfumQsWQkQjXbtLCQoRiFy1PCfNrfZ5TB1g3hGlUEvD/QdLhX4DH722yQTSeXfK+bOCPgXKQHvWcUtkWFzJExwaiYqVo7xjTa8ZJVyglqtOWg2wN7b1Q3ytQ+c2Za4YcobQzqVZbN8C3hD2x10Tch33/sbeQyL+hh36bIpOuU9nQFobWAjIARcnK0nOyqc4siNa49sBHX3MSZ6ntKDRwu+CQCO0LumZD0RWVmd6EnCrM78vcZh2oE2gUsx2i1M1ukMSOb8njj0meBrlcvw9FXSCW9cnfHFT7VGpk32ChI6SNypKbVyEkD8RwZf6sbZbTlRKu47Nlek+Rl8Xc2p2TLatsvHh2jG7n/XN8gJZ35uPz+IlXc2WjA1J3GPhQmuIwUOzrbwevIgGlpY1uErkvFw1OJ7MBDoVhNTzIfBFmoarOc1L65cNBrGOMm2D1mRgEjcXst0xBdYRdwksFx/+5gD8gL4+mlBBs6hIan7FJ4PsCk7YZCRguCo9j9WcFzpNnMyWM51+KQbZObf9S7p0lfJm/1Jjw== 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:(13230022)(4636009)(346002)(376002)(136003)(396003)(366004)(39860400002)(451199015)(6512007)(2616005)(52116002)(66476007)(44832011)(4326008)(41300700001)(66946007)(316002)(26005)(8936002)(2906002)(30864003)(36756003)(6916009)(54906003)(6666004)(86362001)(38350700002)(1076003)(38100700002)(5660300002)(6486002)(186003)(66556008)(7416002)(478600001)(83380400001)(6506007)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: L7pqMALQP5LpC6wwfHGC2nnjszHI00KZekQqHdRNGXxIsDT7IOz8Z5sQi+rAum+kqgXc/ncAimYLytf6olRDoc+zn1oicrlr/JhPGe4kvO0EndXWJx92a5iDcaMOHfHGZfrbUVRaw48Nx6j4kaaBOHVA/QXuU1i5XzyO4VRv1ItXkf606NAzqykMT41CZDu03ZdO+YUcgmCwBhapIBOJYK+GFHNVEyCUyD8j8ffZcpu38iq8V2TpEOhuzBouVyEi2kDKwN3gM1Wokt7h6hOuRhKr/0kJU1Fa6yU4Y5kOlzHPqjCeLYceHShKJSMCupeFXhRz26GN2zycwYJfMQpx8AKr8CMtLiQBR5e26Mpz85ne84DqF83BUc4ZSteCe3vicjL3SA60uJqnyTViLJcN8X94jaQiJ5EcHsiyf8FX8UJwZv56wK5UayPGpZaSax4QsaywdBdcaaO74qL3EiQB+iRXSVDzzEaBK7bPJ2sSKHmVt2XTL0/dgOf5KZR0Y4x8F2KwmlsL/peyV6zM2YNCtkELZXCkoBt6GstM+ipl8kRw/5GD9AGt2ZK6MZ3dY4rI0uoubK345W1+N0lD7RI5i5HhzG5tb8yI1VCwFr4DXgVojh9M9kJ6MgdvpJEiSqLv+0qcn/FaYEYBuwDn5+Zxk/LbB3avUj4Oz+g4pX72/0HJvtEIe6h1t2Bp6jsDx3u5sEnvVP/2OzJle4H8Uv0T1bnDLTKzNZ1AnVMtPIdOjc8vOYbGQaQtfRsKO6wurldYOmX8grItmFJy9YA3SmMWnGXHQ61NtqGaY/ZnNl3LUpANlWtKNPPkz2YTZa5jJSeYmoKOnbqEo9tC1r7hHBdKLYDv6BJyxLWzJb7PJXT5BMGy3Dl706CPmmJlo3p1Md1pkUiXgnbzCKumsqo1A55whe51l7jhMM0VY33KT1i/z7Noyy1P4cJ4tPvvMP9q0stPXwBY+XccAu7r+jhW03nMyFGP8wYnxH9KDgsXBtgLYgeOp6fbOKKfngrhuzdKJkR0fpdvPx5mu1D+KBWvgu2SVuRJQ/QzQXaoVQRvt2Z1Q5Q3MmTcM6J/uK5cXC+dAOE3puTpwjY56UooMhDZLkg/PjO+XTCCB7Jf1nwdmEkuoxJXjYXbAjY0HAFPKTktXPJ6F6m5WIio5AZZBBZn+32DBZjWa5FNfqSGyCuk1fPrq5/BnRzb1mqh4F/+vh2VEhUfPrZRhuuC1rKjTowJaQecTulbromExyadVRNiyJxOsIHiKvXWgFJsncrVP2cIixRT0MdirTUxKEPhyOiJ+XlTt4BIvIcmg9oGgtk9IOgW/gyOZvO8It1BCgQBnBoaR5uz708+1Ttp1TKRVUziHnYRoEuHE+ayezQMPuREza6uewHp1vN75WgCT6bm6Qn/2mPF1+KeVSlmEkCzpR/mChKotC6MSCCpvHs0JgrrSqTwGSiMyGL7oiUYWiIanG+VBDrBI6+9H/MvFjV+Hrh+WWI69o9V5wlXSqfrSlLi4ThqfGwkylwsNaVB3+aZ09Du9DM2tu0OWyv6bF6jIOvJ1yUFOBfA+Kl6Un8A4Ohc63KdRn4VNb/qZud/jsdFkKog2IvtNdedfKrYIfX3L/oyHg18qQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b85ffed5-814a-4067-fb62-08da96667fbc X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2022 15:33:40.6049 (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: 1JiHAmA019Z6E7cwS0+W4R6IRc1pq8ti7mvc95Ss9g8cHaNcE2iIgWonXJ5A0eiEwTdXfRhmHoXxUg35g0smhQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8949 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The &priv->si->hw construct dereferences 2 pointers and makes lines longer than they need to be, in turn making the code harder to read. Replace &priv->si->hw accesses with a "hw" variable when there are 2 or more accesses within a function that dereference this. This includes loops, since &priv->si->hw is a loop invariant. Signed-off-by: Vladimir Oltean --- drivers/net/ethernet/freescale/enetc/enetc.c | 28 +++++---- drivers/net/ethernet/freescale/enetc/enetc.h | 9 +-- .../net/ethernet/freescale/enetc/enetc_qos.c | 60 +++++++++---------- 3 files changed, 49 insertions(+), 48 deletions(-) diff --git a/drivers/net/ethernet/freescale/enetc/enetc.c b/drivers/net/ethernet/freescale/enetc/enetc.c index 4470a4a3e4c3..850312f00684 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc.c +++ b/drivers/net/ethernet/freescale/enetc/enetc.c @@ -2116,13 +2116,14 @@ static void enetc_setup_rxbdr(struct enetc_hw *hw, struct enetc_bdr *rx_ring) static void enetc_setup_bdrs(struct enetc_ndev_priv *priv) { + struct enetc_hw *hw = &priv->si->hw; int i; for (i = 0; i < priv->num_tx_rings; i++) - enetc_setup_txbdr(&priv->si->hw, priv->tx_ring[i]); + enetc_setup_txbdr(hw, priv->tx_ring[i]); for (i = 0; i < priv->num_rx_rings; i++) - enetc_setup_rxbdr(&priv->si->hw, priv->rx_ring[i]); + enetc_setup_rxbdr(hw, priv->rx_ring[i]); } static void enetc_clear_rxbdr(struct enetc_hw *hw, struct enetc_bdr *rx_ring) @@ -2155,13 +2156,14 @@ static void enetc_clear_txbdr(struct enetc_hw *hw, struct enetc_bdr *tx_ring) static void enetc_clear_bdrs(struct enetc_ndev_priv *priv) { + struct enetc_hw *hw = &priv->si->hw; int i; for (i = 0; i < priv->num_tx_rings; i++) - enetc_clear_txbdr(&priv->si->hw, priv->tx_ring[i]); + enetc_clear_txbdr(hw, priv->tx_ring[i]); for (i = 0; i < priv->num_rx_rings; i++) - enetc_clear_rxbdr(&priv->si->hw, priv->rx_ring[i]); + enetc_clear_rxbdr(hw, priv->rx_ring[i]); udelay(1); } @@ -2169,13 +2171,13 @@ static void enetc_clear_bdrs(struct enetc_ndev_priv *priv) static int enetc_setup_irqs(struct enetc_ndev_priv *priv) { struct pci_dev *pdev = priv->si->pdev; + struct enetc_hw *hw = &priv->si->hw; int i, j, err; for (i = 0; i < priv->bdr_int_num; i++) { int irq = pci_irq_vector(pdev, ENETC_BDR_INT_BASE_IDX + i); struct enetc_int_vector *v = priv->int_vector[i]; int entry = ENETC_BDR_INT_BASE_IDX + i; - struct enetc_hw *hw = &priv->si->hw; snprintf(v->name, sizeof(v->name), "%s-rxtx%d", priv->ndev->name, i); @@ -2263,13 +2265,14 @@ static void enetc_setup_interrupts(struct enetc_ndev_priv *priv) static void enetc_clear_interrupts(struct enetc_ndev_priv *priv) { + struct enetc_hw *hw = &priv->si->hw; int i; for (i = 0; i < priv->num_tx_rings; i++) - enetc_txbdr_wr(&priv->si->hw, i, ENETC_TBIER, 0); + enetc_txbdr_wr(hw, i, ENETC_TBIER, 0); for (i = 0; i < priv->num_rx_rings; i++) - enetc_rxbdr_wr(&priv->si->hw, i, ENETC_RBIER, 0); + enetc_rxbdr_wr(hw, i, ENETC_RBIER, 0); } static int enetc_phylink_connect(struct net_device *ndev) @@ -2436,6 +2439,7 @@ static int enetc_setup_tc_mqprio(struct net_device *ndev, void *type_data) { struct enetc_ndev_priv *priv = netdev_priv(ndev); struct tc_mqprio_qopt *mqprio = type_data; + struct enetc_hw *hw = &priv->si->hw; struct enetc_bdr *tx_ring; int num_stack_tx_queues; u8 num_tc; @@ -2452,7 +2456,7 @@ static int enetc_setup_tc_mqprio(struct net_device *ndev, void *type_data) /* Reset all ring priorities to 0 */ for (i = 0; i < priv->num_tx_rings; i++) { tx_ring = priv->tx_ring[i]; - enetc_set_bdr_prio(&priv->si->hw, tx_ring->index, 0); + enetc_set_bdr_prio(hw, tx_ring->index, 0); } return 0; @@ -2471,7 +2475,7 @@ static int enetc_setup_tc_mqprio(struct net_device *ndev, void *type_data) */ for (i = 0; i < num_tc; i++) { tx_ring = priv->tx_ring[i]; - enetc_set_bdr_prio(&priv->si->hw, tx_ring->index, i); + enetc_set_bdr_prio(hw, tx_ring->index, i); } /* Reset the number of netdev queues based on the TC count */ @@ -2626,19 +2630,21 @@ static int enetc_set_psfp(struct net_device *ndev, int en) static void enetc_enable_rxvlan(struct net_device *ndev, bool en) { struct enetc_ndev_priv *priv = netdev_priv(ndev); + struct enetc_hw *hw = &priv->si->hw; int i; for (i = 0; i < priv->num_rx_rings; i++) - enetc_bdr_enable_rxvlan(&priv->si->hw, i, en); + enetc_bdr_enable_rxvlan(hw, i, en); } static void enetc_enable_txvlan(struct net_device *ndev, bool en) { struct enetc_ndev_priv *priv = netdev_priv(ndev); + struct enetc_hw *hw = &priv->si->hw; int i; for (i = 0; i < priv->num_tx_rings; i++) - enetc_bdr_enable_txvlan(&priv->si->hw, i, en); + enetc_bdr_enable_txvlan(hw, i, en); } int enetc_set_features(struct net_device *ndev, diff --git a/drivers/net/ethernet/freescale/enetc/enetc.h b/drivers/net/ethernet/freescale/enetc/enetc.h index 29922c20531f..f4cf12c743fe 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc.h +++ b/drivers/net/ethernet/freescale/enetc/enetc.h @@ -468,19 +468,20 @@ int enetc_psfp_clean(struct enetc_ndev_priv *priv); static inline void enetc_get_max_cap(struct enetc_ndev_priv *priv) { + struct enetc_hw *hw = &priv->si->hw; u32 reg; - reg = enetc_port_rd(&priv->si->hw, ENETC_PSIDCAPR); + reg = enetc_port_rd(hw, ENETC_PSIDCAPR); priv->psfp_cap.max_streamid = reg & ENETC_PSIDCAPR_MSK; /* Port stream filter capability */ - reg = enetc_port_rd(&priv->si->hw, ENETC_PSFCAPR); + reg = enetc_port_rd(hw, ENETC_PSFCAPR); priv->psfp_cap.max_psfp_filter = reg & ENETC_PSFCAPR_MSK; /* Port stream gate capability */ - reg = enetc_port_rd(&priv->si->hw, ENETC_PSGCAPR); + reg = enetc_port_rd(hw, ENETC_PSGCAPR); priv->psfp_cap.max_psfp_gate = (reg & ENETC_PSGCAPR_SGIT_MSK); priv->psfp_cap.max_psfp_gatelist = (reg & ENETC_PSGCAPR_GCL_MSK) >> 16; /* Port flow meter capability */ - reg = enetc_port_rd(&priv->si->hw, ENETC_PFMCAPR); + reg = enetc_port_rd(hw, ENETC_PFMCAPR); priv->psfp_cap.max_psfp_meter = reg & ENETC_PFMCAPR_MSK; } diff --git a/drivers/net/ethernet/freescale/enetc/enetc_qos.c b/drivers/net/ethernet/freescale/enetc/enetc_qos.c index 582a663ed0ba..29be8a1ecee1 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_qos.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_qos.c @@ -17,8 +17,9 @@ static u16 enetc_get_max_gcl_len(struct enetc_hw *hw) void enetc_sched_speed_set(struct enetc_ndev_priv *priv, int speed) { + struct enetc_hw *hw = &priv->si->hw; u32 old_speed = priv->speed; - u32 pspeed; + u32 pspeed, tmp; if (speed == old_speed) return; @@ -39,16 +40,15 @@ void enetc_sched_speed_set(struct enetc_ndev_priv *priv, int speed) } priv->speed = speed; - enetc_port_wr(&priv->si->hw, ENETC_PMR, - (enetc_port_rd(&priv->si->hw, ENETC_PMR) - & (~ENETC_PMR_PSPEED_MASK)) - | pspeed); + tmp = enetc_port_rd(hw, ENETC_PMR); + enetc_port_wr(hw, ENETC_PMR, (tmp & ~ENETC_PMR_PSPEED_MASK) | pspeed); } static int enetc_setup_taprio(struct net_device *ndev, struct tc_taprio_qopt_offload *admin_conf) { struct enetc_ndev_priv *priv = netdev_priv(ndev); + struct enetc_hw *hw = &priv->si->hw; struct enetc_cbd cbd = {.cmd = 0}; struct tgs_gcl_conf *gcl_config; struct tgs_gcl_data *gcl_data; @@ -61,15 +61,13 @@ static int enetc_setup_taprio(struct net_device *ndev, int err; int i; - if (admin_conf->num_entries > enetc_get_max_gcl_len(&priv->si->hw)) + if (admin_conf->num_entries > enetc_get_max_gcl_len(hw)) return -EINVAL; gcl_len = admin_conf->num_entries; - tge = enetc_rd(&priv->si->hw, ENETC_QBV_PTGCR_OFFSET); + tge = enetc_rd(hw, ENETC_QBV_PTGCR_OFFSET); if (!admin_conf->enable) { - enetc_wr(&priv->si->hw, - ENETC_QBV_PTGCR_OFFSET, - tge & (~ENETC_QBV_TGE)); + enetc_wr(hw, ENETC_QBV_PTGCR_OFFSET, tge & ~ENETC_QBV_TGE); priv->active_offloads &= ~ENETC_F_QBV; @@ -117,14 +115,11 @@ static int enetc_setup_taprio(struct net_device *ndev, cbd.cls = BDCR_CMD_PORT_GCL; cbd.status_flags = 0; - enetc_wr(&priv->si->hw, ENETC_QBV_PTGCR_OFFSET, - tge | ENETC_QBV_TGE); + enetc_wr(hw, ENETC_QBV_PTGCR_OFFSET, tge | ENETC_QBV_TGE); err = enetc_send_cmd(priv->si, &cbd); if (err) - enetc_wr(&priv->si->hw, - ENETC_QBV_PTGCR_OFFSET, - tge & (~ENETC_QBV_TGE)); + enetc_wr(hw, ENETC_QBV_PTGCR_OFFSET, tge & ~ENETC_QBV_TGE); enetc_cbd_free_data_mem(priv->si, data_size, tmp, &dma); @@ -138,6 +133,7 @@ int enetc_setup_tc_taprio(struct net_device *ndev, void *type_data) { struct tc_taprio_qopt_offload *taprio = type_data; struct enetc_ndev_priv *priv = netdev_priv(ndev); + struct enetc_hw *hw = &priv->si->hw; int err; int i; @@ -147,16 +143,14 @@ int enetc_setup_tc_taprio(struct net_device *ndev, void *type_data) return -EBUSY; for (i = 0; i < priv->num_tx_rings; i++) - enetc_set_bdr_prio(&priv->si->hw, - priv->tx_ring[i]->index, + enetc_set_bdr_prio(hw, priv->tx_ring[i]->index, taprio->enable ? i : 0); err = enetc_setup_taprio(ndev, taprio); if (err) for (i = 0; i < priv->num_tx_rings; i++) - enetc_set_bdr_prio(&priv->si->hw, - priv->tx_ring[i]->index, + enetc_set_bdr_prio(hw, priv->tx_ring[i]->index, taprio->enable ? 0 : i); return err; @@ -178,7 +172,7 @@ int enetc_setup_tc_cbs(struct net_device *ndev, void *type_data) struct tc_cbs_qopt_offload *cbs = type_data; u32 port_transmit_rate = priv->speed; u8 tc_nums = netdev_get_num_tc(ndev); - struct enetc_si *si = priv->si; + struct enetc_hw *hw = &priv->si->hw; u32 hi_credit_bit, hi_credit_reg; u32 max_interference_size; u32 port_frame_max_size; @@ -199,15 +193,15 @@ int enetc_setup_tc_cbs(struct net_device *ndev, void *type_data) * lower than this TC have been disabled. */ if (tc == prio_top && - enetc_get_cbs_enable(&si->hw, prio_next)) { + enetc_get_cbs_enable(hw, prio_next)) { dev_err(&ndev->dev, "Disable TC%d before disable TC%d\n", prio_next, tc); return -EINVAL; } - enetc_port_wr(&si->hw, ENETC_PTCCBSR1(tc), 0); - enetc_port_wr(&si->hw, ENETC_PTCCBSR0(tc), 0); + enetc_port_wr(hw, ENETC_PTCCBSR1(tc), 0); + enetc_port_wr(hw, ENETC_PTCCBSR0(tc), 0); return 0; } @@ -224,13 +218,13 @@ int enetc_setup_tc_cbs(struct net_device *ndev, void *type_data) * higher than this TC have been enabled. */ if (tc == prio_next) { - if (!enetc_get_cbs_enable(&si->hw, prio_top)) { + if (!enetc_get_cbs_enable(hw, prio_top)) { dev_err(&ndev->dev, "Enable TC%d first before enable TC%d\n", prio_top, prio_next); return -EINVAL; } - bw_sum += enetc_get_cbs_bw(&si->hw, prio_top); + bw_sum += enetc_get_cbs_bw(hw, prio_top); } if (bw_sum + bw >= 100) { @@ -239,7 +233,7 @@ int enetc_setup_tc_cbs(struct net_device *ndev, void *type_data) return -EINVAL; } - enetc_port_rd(&si->hw, ENETC_PTCMSDUR(tc)); + enetc_port_rd(hw, ENETC_PTCMSDUR(tc)); /* For top prio TC, the max_interfrence_size is maxSizedFrame. * @@ -259,8 +253,8 @@ int enetc_setup_tc_cbs(struct net_device *ndev, void *type_data) u32 m0, ma, r0, ra; m0 = port_frame_max_size * 8; - ma = enetc_port_rd(&si->hw, ENETC_PTCMSDUR(prio_top)) * 8; - ra = enetc_get_cbs_bw(&si->hw, prio_top) * + ma = enetc_port_rd(hw, ENETC_PTCMSDUR(prio_top)) * 8; + ra = enetc_get_cbs_bw(hw, prio_top) * port_transmit_rate * 10000ULL; r0 = port_transmit_rate * 1000000ULL; max_interference_size = m0 + ma + @@ -280,10 +274,10 @@ int enetc_setup_tc_cbs(struct net_device *ndev, void *type_data) hi_credit_reg = (u32)div_u64((ENETC_CLK * 100ULL) * hi_credit_bit, port_transmit_rate * 1000000ULL); - enetc_port_wr(&si->hw, ENETC_PTCCBSR1(tc), hi_credit_reg); + enetc_port_wr(hw, ENETC_PTCCBSR1(tc), hi_credit_reg); /* Set bw register and enable this traffic class */ - enetc_port_wr(&si->hw, ENETC_PTCCBSR0(tc), bw | ENETC_CBSE); + enetc_port_wr(hw, ENETC_PTCCBSR0(tc), bw | ENETC_CBSE); return 0; } @@ -293,6 +287,7 @@ int enetc_setup_tc_txtime(struct net_device *ndev, void *type_data) struct enetc_ndev_priv *priv = netdev_priv(ndev); struct tc_etf_qopt_offload *qopt = type_data; u8 tc_nums = netdev_get_num_tc(ndev); + struct enetc_hw *hw = &priv->si->hw; int tc; if (!tc_nums) @@ -304,12 +299,11 @@ int enetc_setup_tc_txtime(struct net_device *ndev, void *type_data) return -EINVAL; /* TSD and Qbv are mutually exclusive in hardware */ - if (enetc_rd(&priv->si->hw, ENETC_QBV_PTGCR_OFFSET) & ENETC_QBV_TGE) + if (enetc_rd(hw, ENETC_QBV_PTGCR_OFFSET) & ENETC_QBV_TGE) return -EBUSY; priv->tx_ring[tc]->tsd_enable = qopt->enable; - enetc_port_wr(&priv->si->hw, ENETC_PTCTSDR(tc), - qopt->enable ? ENETC_TSDE : 0); + enetc_port_wr(hw, ENETC_PTCTSDR(tc), qopt->enable ? ENETC_TSDE : 0); return 0; } From patchwork Wed Sep 14 15:32:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 12976312 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3C9BC6FA8E for ; Wed, 14 Sep 2022 15:34:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230292AbiINPeR (ORCPT ); Wed, 14 Sep 2022 11:34:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230113AbiINPdq (ORCPT ); Wed, 14 Sep 2022 11:33:46 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2072.outbound.protection.outlook.com [40.107.22.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0105C4CA28; Wed, 14 Sep 2022 08:33:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PEqC1eS9i+rItKpWwVcL0218IX1HyR0qX2Vkt06I4t3fskQbjFOdjrwXw5O/kd8RigzP6puGHEgy92IHvhD72DVVyZxK6qhN7bL33yxKTAqhH/i+gWIxPuLL370/YC6QfOsgLSsVuGnQOIAizXQaxqruHjVk4G3coL97Og6biZXifuu/wx3Zo0xrlYBRqCrUZZmGNatdNkTwDbd7VCSgXeZdr3IrwKG9G1i5Xmp3x31gPLP0fZcOkl5XlDtDBbmce9+pHds8N20pQLELQBagQLgV4Z6yTY0EwGRybiaqZhLq+lebUUeadplCm9sKEjPUZFWFZe06zfjm9TW8mYOEzQ== 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=/tLnJQ82D/S6wt3UqVO8/oCdxwB3FY6YVPwb6n/Cjvs=; b=fvMmm3KsxuP53oHHYY5ySoBzjfKwFsuidUGnXO5QyMYkBlvXKU9M4nX2xZjSLFjAPFdXZa878idfE68HikfggBXR+aJCALb+xjbXKRztmJYBvZqWeYLc5Jtq4aBxIXgNFZbMp2xzplxyUNrxTfatTpWByEDN8k+iiPt31GfN/BHNQ+/vh3ViIAm8B2Ltjs5MXgdLRObqEUgOZfb+E8ODeeFQ0Y4SSID/+ln9bvT2f+x7hObCqRfKrFbILAWBqYl99s/7fOASvuGtbyUou2elmOfXxpZtz/Wy0YIdOAqHWz49X9t1UcaVB8+eP8XBDP0JBCYK1Lorzof/ZLOkpdbdSw== 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=/tLnJQ82D/S6wt3UqVO8/oCdxwB3FY6YVPwb6n/Cjvs=; b=RRLC7P7NxLs7fiZT6GCZ2U2wfLYwpgr75NjZGeuIdfuhQxWhXHkx4rfkUDJ3pWJCTRKpZ/xsKMWRxY37dIe2hx9sY8lLE2cCJxClfQWE2z2qLGUwnnQt6Hyp9POkzcMGmTGMtT39vGFMPgKMsu+Zhc9pJ8vkav+CGIL6J5RYc+g= 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 DU2PR04MB8949.eurprd04.prod.outlook.com (2603:10a6:10:2e0::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Wed, 14 Sep 2022 15:33:43 +0000 Received: from VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::a67a:849c:aeff:cad1]) by VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::a67a:849c:aeff:cad1%7]) with mapi id 15.20.5612.022; Wed, 14 Sep 2022 15:33:43 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Xiaoliang Yang , Rui Sousa , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Andrew Lunn , Vivien Didelot , Florian Fainelli , Michael Walle , Vinicius Costa Gomes , Maxim Kochetkov , Colin Foster , Richie Pearn , Kurt Kanzenbach , Vladimir Oltean , Jesse Brandeburg , Tony Nguyen , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Jamal Hadi Salim , Cong Wang , Jiri Pirko , Gerhard Engleder , Grygorii Strashko , linux-kernel@vger.kernel.org Subject: [PATCH net-next 07/13] net: enetc: offload per-tc max SDU from tc-taprio Date: Wed, 14 Sep 2022 18:32:57 +0300 Message-Id: <20220914153303.1792444-8-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220914153303.1792444-1-vladimir.oltean@nxp.com> References: <20220914153303.1792444-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AS4P250CA0023.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:5e3::11) To VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB5136:EE_|DU2PR04MB8949:EE_ X-MS-Office365-Filtering-Correlation-Id: 363103e8-9f42-4429-db8f-08da966681ac X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YqWm/RaB27+CWGV/ai93rgrLdGtLU1jrEnfk3rFFvoEqSszh1EK+qH/1JD/iBuGPVp8RoQVfEuJ6xDux/kaSfmRBqAe70lVJaccv1la7t3gzGnRWMe7lFF4UoAuJK/h4lAmT8mmn1ftMph7MU0qtfAojo0jbKijaA5glee5jlT4TjBuw2qXhGAbN3a+MgfdctRvB9n1hGdcjUnk4JCawwUiZSX4HBO+m7eHJSvyiAcIKUab8LQg5Ef7RqN6h4INLbw7FEbmHEhK6w8MQ8CkSq1HKicTJU9C1mxlvisQYcYsm/fv2JQmPaMQDLKDChYpVEPXZZusrQuFFU4akv/9Ybqhh6BwyqhJXnTKPp8/0JPV4kcUJlTluxhOBhkM9nUkkc1c/eyOGQ1NXaw1HDQoTm4PQXLbd0sCjPgvy4zfleXcs1XVYTbTPfDRuhw2MLsXPjZ+ODLw02dYZ+0bG2x8PiKt4AwNXrvSLwKeUEGi98uiAlYrtvQG4tuwbsNW32mIUtX/ROhTQ+N3f8GJUcFb2xt3/wA5FrbDjF31mHjw3ZUZkHXZEmpcZiP00s/KRCF0uisQmZ9Y8kgHaf8Fngnu6HIg0QLrLaQJ6hqyuvXKs1qktT+dBk1k+diMlTmhw8HGyEUSg7RuecG4iENuySNeoOM8F9ODAWMkU4V9oJErCC6s3odZbSwNm1jTYXW1uN18caNflBPZp21/8saEDLbiYAP3Mj5FTpSmkaGLZquTEOWcsU4zQmUkiDwpbK3T14w3cT1ohpvwMD1c+mWFJVASH9Q== 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:(13230022)(4636009)(346002)(376002)(136003)(396003)(366004)(39860400002)(451199015)(6512007)(2616005)(52116002)(66476007)(44832011)(4326008)(41300700001)(66946007)(316002)(26005)(8936002)(2906002)(36756003)(6916009)(54906003)(6666004)(86362001)(38350700002)(1076003)(38100700002)(5660300002)(6486002)(186003)(66556008)(7416002)(478600001)(83380400001)(6506007)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7pOt6EE8wv3KY5RcMqsrfH5tDJsjpoG0LaTKunQKmbvaXvC1qakDtysASHpKa1PaMsXl/uF/DJVIY2ONKc5NjJXn7wg8ngOreFfF5ENYk+86nSWwoc0V4CHR/V4TqOf8QWGzOeR1thisuM83Djg+bSd809U4Yza/UEzzbzPLB/HKqSicspqWlDWLsF9BaX6SCyovm8KYCAgK2DP78W+qnhvG2SovZ8t6FTimPjcMRY7uUPoqxQ7WmfkwLSuRtZlM96mrr+MpdQLAUeuXgDwbYdV5tqN2j3N6ose/QB82+wflSjuVG2wyU/ys3IArmF6FkCP35BoaooZEGlCewGKXJT2pP+9v03jxb83SmBncP+dgmMCvy0C6ADaEe1VPh+G9fmCXz2B3D86EtI+aI+a41aHtnklQzYcIfgZP2M2naZmIU0C6FXN7dtRoqv+uRDnorwLR1m/XVuBAIW8SHMGetxyyEg1/Sj+1/acVN0cyx4ssYzAGYw39NpBC+gjCcY29+tq+irr6n6iaQ2bVTUjvtSKFKRT9aIOP6yGCmlt2it1G6Bpekvis7ofjUCABTLgH1BZOiB1slVn0z+fQhYcEtQIJ83fyNSpvBul4i/T0ivu2xdmVuWVcO6fjyomW+hmzf+vaUfBXnUe/gtuGrKd19BdopDrzgTCYLdkqH1Wpu2vfLhtVLEXyZcrmXA/hnzpNvogOdRd20thm5YQRPRGYVAmY/JR6SGF7WAkE1OcgHcuyIBIK1ihnWiyZVrSqbFaDbTDwjMz/kk1gxCd/nxHxDLvl3WwA73goddsJ3O6ztOB/BKXy+E7lMKlftgPB67uoZHRrjvi+lwpDdhMtjuOQ7ouZfOWDwtu8sMygKZMDgS5ZjM3FE+AqSLHqnP/1S3slgADSd2uzjKU9sTy+KP99KhAp/l/kaaNpH6Uudk7DwNto/AK8xIZRZ2SbP51ka+dw1HX51FKJJPTfZwhFIdWm7kWpF2aNFTu+rea51URhM7bSK+LWylfrng+Kwc+57uNLmnJvg11xITRsL2bdi0GZstsYEGNhoOpj1CKYp0Y4k2f02/F68ed3Ul1KoaLuOpzb8zDlURIisLbGGoOL2Samz2Im4bpHbD6kqhxtl3OT4RcSmq1IrDRsSE+p2rVIx4WX0u7Ks0klDDikaqhfcvyAuz6EyWZnJgW1o4YTmd8A/hSW5x1qXBfQ3R2iygyVkDA1cPebroHmCEAtW4Yx9gkg8E+FjDYgXWm0jL4Wa/M6P4WOG3yO/4dbCNT6lZv9p3FadUdCusaDxSaxEja+By4lQTh/Hykm0x0efyx2HuP+JgaDCPruIVLp8sepxzjuv27HYNdyF8tdCP3cO7yprM4Z+GX11DLHPYk/Ww/cUzDijIwVu05KikeEEf7YleL1BXEwNGQgSbmroUMmDfGjDNG8l3CQOA1A2SJreHYiR2LojaJLlAP3RDOeI4mzqT0YT+1eRctgEj9RI/qkzv+yRF7rGukflZuStp7bRvl8pDNwrSH1bBuhuBvypC16C2mWXMEz/PIalJn/edFQgafHFCbVTksPy2K96VGC+eejcgWN3Be4fqKY3RCYwiYTIL/0TDtdjm2Rd78Nmj05Z2LZuITs+w== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 363103e8-9f42-4429-db8f-08da966681ac X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2022 15:33:43.5422 (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: OtzK0/ETnchjo+BW46TdSQ3QSle+bO7EGr1TPU4/C9juX2f/2G7bYUf11WLfDfOIfZjhXgXVRh6rXZO2WuG5Bg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8949 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The driver currently sets the PTCMSDUR register statically to the max MTU supported by the interface. Keep this logic if tc-taprio is absent or if the max_sdu for a traffic class is 0, and follow the requested max SDU size otherwise. Signed-off-by: Vladimir Oltean --- drivers/net/ethernet/freescale/enetc/enetc.h | 3 +++ .../net/ethernet/freescale/enetc/enetc_pf.c | 25 ++++++++++++++++--- .../net/ethernet/freescale/enetc/enetc_qos.c | 10 +++++--- 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/freescale/enetc/enetc.h b/drivers/net/ethernet/freescale/enetc/enetc.h index f4cf12c743fe..4d0bdfef51b7 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc.h +++ b/drivers/net/ethernet/freescale/enetc/enetc.h @@ -455,6 +455,9 @@ static inline void enetc_cbd_free_data_mem(struct enetc_si *si, int size, data, *dma); } +void enetc_reset_ptcmsdur(struct enetc_hw *hw); +void enetc_set_ptcmsdur(struct enetc_hw *hw, u32 *queue_max_sdu); + #ifdef CONFIG_FSL_ENETC_QOS int enetc_setup_tc_taprio(struct net_device *ndev, void *type_data); void enetc_sched_speed_set(struct enetc_ndev_priv *priv, int speed); diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf.c b/drivers/net/ethernet/freescale/enetc/enetc_pf.c index c4a0e836d4f0..03275846f416 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_pf.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_pf.c @@ -516,15 +516,34 @@ static void enetc_port_si_configure(struct enetc_si *si) enetc_port_wr(hw, ENETC_PSIVLANFMR, ENETC_PSIVLANFMR_VS); } -static void enetc_configure_port_mac(struct enetc_hw *hw) +void enetc_set_ptcmsdur(struct enetc_hw *hw, u32 *max_sdu) { int tc; - enetc_port_wr(hw, ENETC_PM0_MAXFRM, - ENETC_SET_MAXFRM(ENETC_RX_MAXFRM_SIZE)); + for (tc = 0; tc < 8; tc++) { + u32 val = ENETC_MAC_MAXFRM_SIZE; + + if (max_sdu[tc]) + val = max_sdu[tc] + VLAN_ETH_HLEN; + + enetc_port_wr(hw, ENETC_PTCMSDUR(tc), val); + } +} + +void enetc_reset_ptcmsdur(struct enetc_hw *hw) +{ + int tc; for (tc = 0; tc < 8; tc++) enetc_port_wr(hw, ENETC_PTCMSDUR(tc), ENETC_MAC_MAXFRM_SIZE); +} + +static void enetc_configure_port_mac(struct enetc_hw *hw) +{ + enetc_port_wr(hw, ENETC_PM0_MAXFRM, + ENETC_SET_MAXFRM(ENETC_RX_MAXFRM_SIZE)); + + enetc_reset_ptcmsdur(hw); enetc_port_wr(hw, ENETC_PM0_CMD_CFG, ENETC_PM0_CMD_PHY_TX_EN | ENETC_PM0_CMD_TXP | ENETC_PM0_PROMISC); diff --git a/drivers/net/ethernet/freescale/enetc/enetc_qos.c b/drivers/net/ethernet/freescale/enetc/enetc_qos.c index 29be8a1ecee1..a412f27bc4a4 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_qos.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_qos.c @@ -68,6 +68,7 @@ static int enetc_setup_taprio(struct net_device *ndev, tge = enetc_rd(hw, ENETC_QBV_PTGCR_OFFSET); if (!admin_conf->enable) { enetc_wr(hw, ENETC_QBV_PTGCR_OFFSET, tge & ~ENETC_QBV_TGE); + enetc_reset_ptcmsdur(hw); priv->active_offloads &= ~ENETC_F_QBV; @@ -123,10 +124,13 @@ static int enetc_setup_taprio(struct net_device *ndev, enetc_cbd_free_data_mem(priv->si, data_size, tmp, &dma); - if (!err) - priv->active_offloads |= ENETC_F_QBV; + if (err) + return err; - return err; + enetc_set_ptcmsdur(hw, admin_conf->max_sdu); + priv->active_offloads |= ENETC_F_QBV; + + return 0; } int enetc_setup_tc_taprio(struct net_device *ndev, void *type_data) From patchwork Wed Sep 14 15:32:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 12976313 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D1FEBC6FA91 for ; Wed, 14 Sep 2022 15:34:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230307AbiINPeT (ORCPT ); Wed, 14 Sep 2022 11:34:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230186AbiINPdt (ORCPT ); Wed, 14 Sep 2022 11:33:49 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2084.outbound.protection.outlook.com [40.107.22.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00EDC48CAB; Wed, 14 Sep 2022 08:33:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OCLrEMoYAqaMfuy/4SjiXc7RyKWKqBEp7gBp6sJARovPyH687fmeZWFdZ45bVXG6atREm/dSJtU/fxdlyRXDIUzE+2Fxt9wO8W35/txEQwHNJGbdbo7I/Znk+SnmMSE0TbhXwrSvHzfE84shsaH1L59SD6y5DFhGkOPm3Pb81CN6BAtYCd7c2ZPJw1w6AcdvydACGhCUrRoVrVbQy+1BlBa+1Tq6YTJOQ1DE2O2IOEVC9bE5A9+172JFrZvuSACT2FM8tPzcpy6H68RAcGWYh13ZgFyJGiy1M6yBqY32RSTXvUnmC0DW8z42niZT5AGJMN/cAM/X427xdhS1OEQ3Hw== 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=b76fAstQe6EFJB6AJYHBY64PgMrJOQ07MepdbHeT2I8=; b=ms9Vgkaw6wzHOywGlyv8L6HoP+mdxwvuT5hToBAEdS/y9S9pqHhBvd+b/hPl2LBfIPycQWzfaOMFRhLOupkK1zyVtwiysOZUxvV7J+KhRBRaf0YWKu1N9/kbxgVF+LncDq971i2jmv1aQgjJHRNO7JWSdnDcLbJogJhDJ1Ijtrg/uymafWt3GL8i0/yaGZ9UmnA0iyEiBERhbTxWl0Q36u0QztkboctEjBhylTDXvMiXhcmo6WwKKRaPApL2GXXlzMVu5DgkIk7Z8HHYcDB3P0G0EIR+GkfkloCNuaLenVYOMv8djpRpL5TCRcCzho8sr2YqtkaPRLlxK/J1R7mWqA== 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=b76fAstQe6EFJB6AJYHBY64PgMrJOQ07MepdbHeT2I8=; b=MqQ79xMZBgOFfWZujl43Eo12eSrqQh4+VyljlmSsYUG/v65szk3Oz5i9TFQh1MXZpsARIiX85zqYDJgq7x4+/qTCrJ1zM8UZTZqZHAmrMgXIpcAXaxFVcTYdI9S6J2oG4nvwQ+n08X7icgb7CjOme7CzkuHa8Zkyq/iEDaD1FAo= 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 DU2PR04MB8949.eurprd04.prod.outlook.com (2603:10a6:10:2e0::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Wed, 14 Sep 2022 15:33:46 +0000 Received: from VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::a67a:849c:aeff:cad1]) by VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::a67a:849c:aeff:cad1%7]) with mapi id 15.20.5612.022; Wed, 14 Sep 2022 15:33:46 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Xiaoliang Yang , Rui Sousa , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Andrew Lunn , Vivien Didelot , Florian Fainelli , Michael Walle , Vinicius Costa Gomes , Maxim Kochetkov , Colin Foster , Richie Pearn , Kurt Kanzenbach , Vladimir Oltean , Jesse Brandeburg , Tony Nguyen , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Jamal Hadi Salim , Cong Wang , Jiri Pirko , Gerhard Engleder , Grygorii Strashko , linux-kernel@vger.kernel.org Subject: [PATCH net-next 08/13] net: dsa: hellcreek: deny tc-taprio changes to per-tc max SDU Date: Wed, 14 Sep 2022 18:32:58 +0300 Message-Id: <20220914153303.1792444-9-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220914153303.1792444-1-vladimir.oltean@nxp.com> References: <20220914153303.1792444-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AS4P250CA0023.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:5e3::11) To VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB5136:EE_|DU2PR04MB8949:EE_ X-MS-Office365-Filtering-Correlation-Id: 2c89729c-ebba-4534-0d8b-08da9666836d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aNRiJTmWVvmJz3XorAbqDFmqHhHSsh9NazMYf7WgMBjoJmCfiynDEpJ2mD6YbpQWCi4zqasAz8HJooHZkW2Et1fn7+XH8e1HbcL9ADkjS59VXJMu3hj0a3axhacseV8e0CH1a39qu16F0HnF78JZUUd7fermwNjRrleyCdY7GstT0SxzPMUw2D6XB5Z1idPFmkJhtptboaJVELPCoxrxGeUuaXpoIlKz2ASCmOyFQp29rPyEA+kYOVdPj2vToHqCGvfq3jofqTUKii+WGv7jLcqoZRPDX9EX1g3vinTSk2cWHQNl+oTf/wazm/kQnXiEmg0DWUCvEauv7/wVtNnAmSkfcby2YJXX7jp5wWfg6dWHKPVfsFW40oivRrYq0lDHMG3pL4PlL/rOg0Wi0t0y0Fhq9+QNb/FD9862C2NCv2246H5kONDYf4feIKzbmIGJ2m94IzZ89EZjdJ6mTFfdFUAM3YyK3AEmnwDZqoiSWMCMufjp8mnzD8+tY5D5Wm1QhUeLfEZyL/eH1ajmVsrA/M8XpH7xx6a7d2HG8Icv6I8rBD9x/b4ThnQscdrPmhXMeO6KWBDVwNlZNePPdhzE7vxUqjIJGZiwOfu6cNwg/F1nzWf3zICwEuqpuBnRgw93oIYpgN0ODJUEzRbqPTZ8tvkiW4Mhwq8Q23gWGuvEv3ev66BgvtX9Zn887jK1Kabwk9ESx4Niln7Lp+B0LS1A/0MzbnP0yp6G1/pEn8z5HW1JafbdMYffdhT9oXxEvvXblHun5871pLeIn506gXPREQ== 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:(13230022)(4636009)(346002)(376002)(136003)(396003)(366004)(39860400002)(451199015)(6512007)(2616005)(52116002)(66476007)(44832011)(4326008)(41300700001)(66946007)(316002)(26005)(8936002)(2906002)(36756003)(6916009)(54906003)(6666004)(86362001)(38350700002)(1076003)(38100700002)(5660300002)(6486002)(186003)(66556008)(7416002)(478600001)(83380400001)(6506007)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: BwNqCMWdREHgLmqsHu8sUW5DTkUHg9iZZFk1exTqnFVey6ngauG4U0QymXhAj6KVTikdd4XTGNOB4i02zb0vzoZMtLwifxRZJPzkouAIrZKAD76oSCLgjaVSC311c3Jdc9Fuo7joOHMOcq+dB90VXylwAyjmeCzS8nVNBQQesnh8+XcsdxN8qyJT0oKQfphCMxQDvZXqb/4xY+rbLtJupIJ0f6QFtYjuir1m1uG+yeWM/1xFQCyJMm8XWpgmBQR7uOcog5qrJr5aOQjfnPnNw1HhGMw/fhIOiKoLh8KQrI9ljYJXRo/P6MintlpaxrY85lAYzgVFhxkL92qLGVJCLm0kVyRz6TYHdTRw0TWDcR+wxXMJZnMLLTLlx9FdfnWVglInkeQ6JjLYw08rVCREmaRj7QAaV4kxJ/lKKSA2hCVVpqRhfV2o8Lc+7e+62wB3MUpQ7nTg6fOPLetjHBbhjveRC466l8Yxx8M3X3fYO5nHHj4dKv93Tw7d6g4j1eVL+QolNzjhUal2QEQzkCDpZxCgiS0EV682z/OSqgH4w14drYJxynFjRkbIJKcAUDXioKtIOwLborkZOG6wHHyvnPX0jxmoko3OmrisuF2Kv07nn+j6RdeiheoPE/hPvq3hBEoN8oFNTh6rcFat0cElpHyaEv5TVLzCP/aRp2JlsZ6MWhlJ/Bg0+ytrHQYf9kS+gYF31WROJJq0SoNMmb+lg/yNqwqmwDYjw6NTsX9io1sMElePKs7KocEha4rrETnXiXA4tOAfVailg9bqNkA9esxu6+tXa+4/1oAAlGdIwg+POmXQCUKI8Y844+NmNIb0fIGoCLp9QJ9j85IPxtMBzWGQ5/PITIal6SOP3+vBzQFXEaA0aOKmiGGBlK6lRGvLjLX+nIhwbNYQcti5ZwyfqL033K28W60QOIHBa3hPD5Lt5DQY7M5nBGgZlv5il3dqonPI3Uy/Yqv+ftdinmxcPWqsZuqQLjqxHKi+I49wXS0Shao/3IszkETb/Adn7Rn7M2ajn0dhFkGCb0IhqiL4Cut5b3MbDPTl2cBFSqZtdeRlVTFjgQpnBPSo1HjDlsssSUUkc9i0R0CPoRCRrkGuPwVtREf60iyqS2OOnO+0hbHQEhDfzq9ERbCHMZhhgIGW8n2p0R4f4u82qyUfkXYOyg6zE4Ep96A4kOkOZnfg/LPEDNazhH0NRH2sWmVg5MtxVQPxE/ufyxHA6Vjs4AJAxSvju7lGiLy5yvEDliHsUtjVZyN/VTdtPli7pxfjvanaYAcBbZKRLhdmeJQi6n2QbpV1AyAN+z0wAKX1EgUJLTLSvS81yW2GNlrLZaw8GFGdV9N48xYro2btTtB9kqfReTWvJ8rOmIUBNfc6kwOxHkgxciUJDdXPNCb1wCQKMZAXga76DzTQw3j2TwkZGjIQOfiBaQYG5rKTcXEXPmO36EeT+SnxvrSeMntnKDmwSqas+53goiB+pv8J6kCYiQvkTcEOIeV6CW8XB3U6n6T2ywrzV5+vtPv457169NZ1tsNB9m84RW52mh3q6OOofwCjB/eFQwQ0YXUFPTAFDKp0if5Jk7iBHpNwIM2Su1MzliPWsS5jGY3cZ0koTTJZ3frmug== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2c89729c-ebba-4534-0d8b-08da9666836d X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2022 15:33:46.6045 (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: Jj74PkJU6+TgVX2Cef1KTaTRg2tt9uWlCCB+pEGMdh9MLWn2ZDoxQvFWx1FtyeFjfvJ9G0C2yQ0U0J12jj69DA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8949 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Since the driver does not act upon the max_sdu argument (which it should, in full offload mode), deny any other values except the default all-zeroes, which means that all traffic classes should use the same MTU as the port itself. Signed-off-by: Vladimir Oltean Signed-off-by: Kurt Kanzenbach Signed-off-by: Kurt Kanzenbach --- drivers/net/dsa/hirschmann/hellcreek.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/dsa/hirschmann/hellcreek.c b/drivers/net/dsa/hirschmann/hellcreek.c index ea8bbfce0f1f..8ef7816627b6 100644 --- a/drivers/net/dsa/hirschmann/hellcreek.c +++ b/drivers/net/dsa/hirschmann/hellcreek.c @@ -1814,10 +1814,15 @@ static int hellcreek_port_setup_tc(struct dsa_switch *ds, int port, { struct tc_taprio_qopt_offload *taprio = type_data; struct hellcreek *hellcreek = ds->priv; + int tc; if (type != TC_SETUP_QDISC_TAPRIO) return -EOPNOTSUPP; + for (tc = 0; tc < TC_MAX_QUEUE; tc++) + if (taprio->max_sdu[tc]) + return -EOPNOTSUPP; + if (!hellcreek_validate_schedule(hellcreek, taprio)) return -EOPNOTSUPP; From patchwork Wed Sep 14 15:32:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 12976314 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0DF8C6FA94 for ; Wed, 14 Sep 2022 15:34:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230316AbiINPeV (ORCPT ); Wed, 14 Sep 2022 11:34:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230215AbiINPdw (ORCPT ); Wed, 14 Sep 2022 11:33:52 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2070.outbound.protection.outlook.com [40.107.22.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C67EE48CAB; Wed, 14 Sep 2022 08:33:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UQ42O+zs2JIfxf8/r18LtWtsH+tGFVlKBQ91bjYKu92Ouex2MI3Qtc2T3FOz0WYa+oq22PdhGTeztJ0zlAhP4dpljzKUV8R14PUF2+btZowhHSpSkytWKs0hvTYIrXJX86frm9tBDUx3i3rMVts3V49Wg5tDzFEM+ZLQgkgh4b5vhq7ZiqReL1KSREH+7T9J2VaVhglCFY6/J/lBMff5Kc8iZHqX6iGp9m85wjOHAoaQjW3v8DghnZ0VhZbR3n3sInwfSPgzzHiWD5WLCc0Mhm/OuuJs3i9S/3SdMgIHGpuL4S9jeV/BuP1WsML4AcAGufWbjS7n0MX9waG1N7KX1Q== 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=Rqcc9JjhHFretRhuHEGlsXIGH1ZJ7ucmmVhSW7EV9SQ=; b=IL3iAGmZuhnf95YnPVe6N3TksA4P+py4TOGD2SMjKA/lWPfoD7CCiUV+srU7tklReDWY2nHOKnC80XJhNmZgzLIpBNt6sxA8NOtuOgl9lQOd49pfQrLpS7C17QFOrylH8EweiAURs078J6jRspT0QeRZWlEnfc6XpOBWaweTjOfMJUuk6JnXDf8qTdUPuXiRtES4Ibx8HmQdhbyxc886/dUroU9UorfMOlVamlRAL9L9N481eUotuUOmKDDRiqmqff3dcLBqdMR+T5ZOxf0CKAHmRwhfzwP0eATkd0of6Lu6gS/a73Nba+NNTWTRK7Q+DRX+ZU4BURRZ8K/upqDK1w== 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=Rqcc9JjhHFretRhuHEGlsXIGH1ZJ7ucmmVhSW7EV9SQ=; b=cOzgWCRBwNL82G0RHLz67fjrtuAqHscOcpcnT+0DLfEjIeNta6Ea1HNzYexbtmO9UoTSQPP0wAkQYdf8cNlhW1+p4xUYtaLJGwAt6VLyq0cdfwpbcLpGeP8M4/H4TOb8QSyg/kiHZeZYV+4f8r/Fe0pgCL0tkS+J1XhMHINux+E= 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 DU2PR04MB8949.eurprd04.prod.outlook.com (2603:10a6:10:2e0::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Wed, 14 Sep 2022 15:33:49 +0000 Received: from VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::a67a:849c:aeff:cad1]) by VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::a67a:849c:aeff:cad1%7]) with mapi id 15.20.5612.022; Wed, 14 Sep 2022 15:33:49 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Xiaoliang Yang , Rui Sousa , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Andrew Lunn , Vivien Didelot , Florian Fainelli , Michael Walle , Vinicius Costa Gomes , Maxim Kochetkov , Colin Foster , Richie Pearn , Kurt Kanzenbach , Vladimir Oltean , Jesse Brandeburg , Tony Nguyen , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Jamal Hadi Salim , Cong Wang , Jiri Pirko , Gerhard Engleder , Grygorii Strashko , linux-kernel@vger.kernel.org Subject: [PATCH net-next 09/13] net: dsa: sja1105: deny tc-taprio changes to per-tc max SDU Date: Wed, 14 Sep 2022 18:32:59 +0300 Message-Id: <20220914153303.1792444-10-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220914153303.1792444-1-vladimir.oltean@nxp.com> References: <20220914153303.1792444-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AS4P250CA0023.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:5e3::11) To VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB5136:EE_|DU2PR04MB8949:EE_ X-MS-Office365-Filtering-Correlation-Id: 51748065-56af-4d60-2b0b-08da96668539 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MDR+djkG+QRtBD1aJuyPBzvFouEbk5l5xy0o+jl9zPz28EiL+FPtc4g4KUC4zKu1kuYYRDFP5XSaMx6z7yyyfJvgvs5k4BKBw0nZOaZfIlhVlIdVlUHh8dA2WZZvniYZp9Im6ng65X5yxYwDIWLZfOtKguDZsxNaTprE6ki3DzL+TO6YUn2fPMHdykl45tgkZAmkOHQvUQvX9fJkTsHzI+8Qmh3vdn+H/9tlxXpNZg1OSNN/5ZJJ3m6MwHv/dzl90G4fE1sAgWU92cnqVJ9uHjfCSLScZa5HAIzATrjRbJRRA/vfSq9U60QM3O9iuI6zXq9QOGkz04htwyK48rP+s02i8BCWddEfxKBKkMU95jlrLIjxmI9JkqL2g1Kq/Uh+AmcZeBbO7++cGibHzfa801SsYNAsONKs78GYZa2ykdztqUgXdjyrMnQjZSMzM4DrsNACvT3G09HwD8U4ZVRk/XmL0ObYD0/usfSs1a0se6FrO78kqX8TucjivlUNf1BKysDhSw9qaKbszmtu+5EAW2bvaZ6tqCxryipAniHsVyGgzp5bo27iNchyODcD2d26NGyD4QTN3MKbueL0m1JGmBoVRBlA0+HnkJE74hTh8r3N8k0i4JbchZCfft9TjZNsMDzZ8/D9d4i3LbwMar2e0vWS8Jfe2teU62zkpNbvg0yuv+atN71IKzWDW3FjfFVpprVm4yG79pWLK9avvmshqaVKrgo4PSHUxUcm5RQ6IEG6h+i0XynIp3X1sCBnCC3l8vLi/pMksd+Ir9j6COU2Wg== 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:(13230022)(4636009)(346002)(376002)(136003)(396003)(366004)(39860400002)(451199015)(6512007)(2616005)(52116002)(66476007)(44832011)(4326008)(41300700001)(66946007)(316002)(26005)(8936002)(2906002)(36756003)(6916009)(54906003)(6666004)(86362001)(38350700002)(1076003)(38100700002)(5660300002)(6486002)(186003)(66556008)(7416002)(478600001)(83380400001)(6506007)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ifgXBnCtACpE6d/Tl8Va8924bVyhLmSUJRrEahbIQaAshlqQ1XtvU/g04n5F43DN0oKKum8fauNjhyjmoFFAwHMskZndaaD6qT7rUy/xagBJsRVeIe78GTDAfbRjb7AgGnnX7nPTKBYgCVmt2tWx2xwtntuM3pVmsjfsuuR3KYnQ8wqQHsc1EknRS2MNSdB6uddbIq5jP7jgoAFq4CpH1oW1nUtwhXZpHgf2BQYV5Vd3LW35cDOu4g3I2ZIou2VC2w9vnKduuuHSCKMS2t+jVaGMKC/fkrARATNI/tx9fGEk8AoaRUGUiCiERlMIBE4hg7xH7S9vOjjPgVZd4iQPaGgLtNMDZ24HxxA6P0MsHMxOeD3x5fAJ3Yfsm1UKLz4y9yKYkX9z7fUEZuC2QpvHiLMyhm18zfj+EK5hx7dgnPCsPTQftuQ9ZU3oueygTWx1vOIlSOYDx7bPc0AeiT7VDgezCuY2IbzqaQhr79FKiea5NaiRW1zJ8aQCkNcQuilxOGY5HhfhUHovb0YSCiTJ4OBLikO8YPu3pKGKszG7M+8REVfnzIW4aB3Kr6fnHrhh4sJy+lkmmUetBcrqNg7+RAAgI199rp5ZjA0Bbn2bGU95KpUCqkJI3iJMQI/n9DuVjmsUz3E0Rnhrdxa1jLfvbEopdJO3k+tbAXwL63/JQWjR8Nn3V8caXl/QKRKIkw8gboPhbni3xvVyCDt3zTwxbmidhBwdDO8Vrvlwm3ulFawjr7mb8O6NSAcBthK1xF7mEE9vBQoe2lPQUO/cxWCmfD2DZiB5a4y5wRQ/gtMUSgelAmG5t8XqjOuIa9M6Ni09fnE5obPTAsxyLKZvCQKr5FE5Gzupy0v5i+aejtGzl6KHjpb+6MYrjohbCmePMr6PFKr2hw8Aw/2DTFB2+g9SUDnUCuP1FPS79BuLyONsh+Nk6AS0S+G2+q/9dIovkwxHKlla2huyz8s9SJGQ40NwdL+/JDk6+9DaiqM7su3p/syK4RPXkeB7bsKQ8MTERD/zJLUEwsPMdfMZr2zMohMX2INp0azRopxYTOyuVcDSMT8jheER7QhVpt1HDgy0uXpKyr/UhHjymijNIwOwC2q19s0dDv5v74Rn9U6Z5+/q2aq6NBXo+gF1FA1+AjfgDlnEJLe0OqgDSWnyEGRggjCrLFbn70pUv1MSHDtS1V6tnGQys8hCxz4XVAXzMDyRNIqThl245y76a/zvUv4hTU0hNSCGcf4QPF/o93il5uBrT70fmerAY3Kt31A95pdS0gHzVb8+HQPOQsODI/Hnf7LnXqEc6zYBzAMFHSoEED7oYuqtSaPM0QkT4DqwC0JICXhW9UbkjO00+xiD9UmujCn4+k7hViT590imlC1nkoP4jpMLgUZDAsPHsHJspBHHtSzHr7lmRNe314iof06q/H9dKiqMptC+r+VtMU7zK6zjRP2WShnZfPiIgoljMozD2j+eCjeyGmSDDL8ZDCPczg7DwP4ZfhP5T+iwUCn6T6/v8FrPgCu1Mq4YL9S0eQHa+xcutL29Zh50rjYoEor47Axznvu5Z6n8PFP2JaucACgD/ZZWJSiFX2zjK/a+HM3vG18yrMafI3W6bkVKZyfMZ0qtow== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 51748065-56af-4d60-2b0b-08da96668539 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2022 15:33:49.4324 (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: sDD/XMa0JlYtHB4WrwyIi6IJZcYb2snW7xsHkMoKMae36uQrLnvhpPM3cd8I/qBlLZuVgEhIEn1LlA2I19rnhQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8949 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Since the driver does not act upon the max_sdu argument (which it should, in full offload mode), deny any other values except the default all-zeroes, which means that all traffic classes should use the same MTU as the port itself. Signed-off-by: Vladimir Oltean --- drivers/net/dsa/sja1105/sja1105_tas.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/sja1105/sja1105_tas.c b/drivers/net/dsa/sja1105/sja1105_tas.c index e6153848a950..607f4714fb01 100644 --- a/drivers/net/dsa/sja1105/sja1105_tas.c +++ b/drivers/net/dsa/sja1105/sja1105_tas.c @@ -511,7 +511,7 @@ int sja1105_setup_tc_taprio(struct dsa_switch *ds, int port, { struct sja1105_private *priv = ds->priv; struct sja1105_tas_data *tas_data = &priv->tas_data; - int other_port, rc, i; + int other_port, rc, i, tc; /* Can't change an already configured port (must delete qdisc first). * Can't delete the qdisc from an unconfigured port. @@ -519,6 +519,10 @@ int sja1105_setup_tc_taprio(struct dsa_switch *ds, int port, if (!!tas_data->offload[port] == admin->enable) return -EINVAL; + for (tc = 0; tc < TC_MAX_QUEUE; tc++) + if (admin->max_sdu[tc]) + return -EOPNOTSUPP; + if (!admin->enable) { taprio_offload_free(tas_data->offload[port]); tas_data->offload[port] = NULL; From patchwork Wed Sep 14 15:33:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 12976315 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F006AC6FA93 for ; Wed, 14 Sep 2022 15:34:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230319AbiINPeX (ORCPT ); Wed, 14 Sep 2022 11:34:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230237AbiINPdz (ORCPT ); Wed, 14 Sep 2022 11:33:55 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2088.outbound.protection.outlook.com [40.107.22.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B30FB4CA28; Wed, 14 Sep 2022 08:33:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NLQQNX4ukfTLPYzjUYgDgNRL8NpFdMVjXk9WCAcYnQkglL/AaqwtmtXlh5tFFdOn8vt8+63DBx7SLqo26TNN7K6B9Rn9gxod4CcF+OzU9HCB/ti1zfODZxJocOA9J/9W/9WyXc5ASQO8mqZJxX78uqxoAG3KqYpPWGZZR5Jyszk3nySusryuI1k4VXNEQhcuqKTCaQtpMEjdAZQKuuSbachbX/ucfKO5lh5QFrVAXSCSXoqgr9HVCC1VV9lFGWazuDg3R66pX4nLC6yspCdEsmnjvXMalD/5bZRrpG0ZMzz23GQACoo0D5BvbUnizWP5S1UwkWCdmT0DPMfFRpdhtg== 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=0El6NQDyc+djYREiGiUdjvu1T8eoTGCj+wgmlZaSVfc=; b=U9ctBXXB7zOyjw2TGy632a4ZekqzpxuFjeh8pxqdGbJhT3slwi98OBTbgf8HM2yffI0oQ8J+jVTCPlr3ycokbzt22MDhbXMny21EkXXOhY3l9UA69jkiaqyElI1TIigX1CMqvJ3PzCYNiLVGTiGL3MnskAVATA9j/xa4LHAmzl1yGS5zQlRyB1fYRlyvDLD6ARQSaB9R7pzhQXNh8vHuVbjTUOpdpLm2Af6wR26Ewnn2uG09eNa4XvJTzRFCpO2q0eC6EpJPGnx6QQDJ5N0QUYKhUlOKHvqmGO1XLqGyuvvNeZB5qLz3D8AePcsf+lo7/rMVW6mWnrQg17ZOUT9lZg== 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=0El6NQDyc+djYREiGiUdjvu1T8eoTGCj+wgmlZaSVfc=; b=KqFCcKwd/N1tOjecCXgz+jekwii6Fr9Xciy5BWq7CFEHzNWJ2v2ri5/y+xgl84tUS43cLeCTHnhWYhOCr287LUIGbUMSqk2lfOcuJZKVAoYbSNP3wx+XzTctZgpd1TZi9puN63hgYtrtGF1/OMzDJ2imPrNQT1FhptNLYmxI6Nw= 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 DU2PR04MB8949.eurprd04.prod.outlook.com (2603:10a6:10:2e0::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Wed, 14 Sep 2022 15:33:52 +0000 Received: from VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::a67a:849c:aeff:cad1]) by VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::a67a:849c:aeff:cad1%7]) with mapi id 15.20.5612.022; Wed, 14 Sep 2022 15:33:52 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Xiaoliang Yang , Rui Sousa , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Andrew Lunn , Vivien Didelot , Florian Fainelli , Michael Walle , Vinicius Costa Gomes , Maxim Kochetkov , Colin Foster , Richie Pearn , Kurt Kanzenbach , Vladimir Oltean , Jesse Brandeburg , Tony Nguyen , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Jamal Hadi Salim , Cong Wang , Jiri Pirko , Gerhard Engleder , Grygorii Strashko , linux-kernel@vger.kernel.org Subject: [PATCH net-next 10/13] tsnep: deny tc-taprio changes to per-tc max SDU Date: Wed, 14 Sep 2022 18:33:00 +0300 Message-Id: <20220914153303.1792444-11-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220914153303.1792444-1-vladimir.oltean@nxp.com> References: <20220914153303.1792444-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AS4P250CA0023.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:5e3::11) To VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB5136:EE_|DU2PR04MB8949:EE_ X-MS-Office365-Filtering-Correlation-Id: 472e6d07-2df2-4dab-4a8e-08da966686e6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mSQjj0QATdPl9bw/4PdB04F31FQBwNXnQ9uWjgZe6rdgefUhepxoK3pT6DNy3SI/7I9ibxYjNtn1AkeU5y46+KmiHR2+OVlOPhAnsy7TR/se0ZmdkU3cKz7Z8S23krWtd70FsCGTkOv7EIT8MBuPpRZfw3i057VpueOchATMmbQLHQ4MLxBj+qeRND6m+YUesLpuRPxlQiMU0YXtyfLrcfOjHpI7sP/5deye4CJ+ePmQUTZ9tkOT19DodCiMcmy1AxZw4VL5D7JJNpyIOI+ywRcp8McLefwXetNTVuGIQAanH/Mbt3H+0wJEPG69BDClmEA9RZhU73RlyZHvqNegu48Kb9YqCHrq+gorBqKfDjGblJhy4v4fjVIyffV6P8zz/hjo7Ox1gy1zUBIY0CztmwCys28kSga2RBNunnoyPGakX6GITW2ivQI/7pXxL0d/1SjCdJ5UTkPRbQ5nJKG+zm4rgWKDp6hUarmqZ79NOn2xlZ7k7lLVNJPLj6H6KKaQxv4yYb3QhdOnmJTZsADaW+mv3kjirMHB5HyNOkRv15qYpxpUcmCJUlxoGDiv1QtS6V83wG4mtUynCy/kpIUgI38JubAJm3FTHKnzbbSpHM7GXQpLVSHmrc4crdLP3HGW41ATl26yyFwVWS7ZRmF+B96ah8lK0t8WFEfLvlnL+phYZ4tT56QtEsVDYC3sfd6h5roTeESObA87QxP2lx+iAx1/BdQHvpt5MkGQiFT+opryHthvzknaV/ywMkJIbG0dpN7uldS4ov1VRQUCDBjSdA== 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:(13230022)(4636009)(346002)(376002)(136003)(396003)(366004)(39860400002)(451199015)(6512007)(2616005)(52116002)(66476007)(44832011)(4744005)(4326008)(41300700001)(66946007)(316002)(26005)(8936002)(2906002)(36756003)(6916009)(54906003)(6666004)(86362001)(38350700002)(1076003)(38100700002)(5660300002)(6486002)(186003)(66556008)(7416002)(478600001)(83380400001)(6506007)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ctfkwiN0GdRpL1pOqxzNe+16PfMbE9ZarSRjitBOQ+TS4LTG/JEzuONGx+o/V+ga31gb+5DMhbPKsY3cicYapeJEpy3Tc6djMCAGFYS87KzPgKYdnrb4NUSE+PRWxhU4EXcNgaeY72kF9njpicskvHV+04mMEu7Jw8as+C0tqDRfXGC74NUl9SHhmmL10b6ubzV4Kq/Yfsh1Pm/5y7Dg0Ojl9H7YqyadVCLnpwOP1dMjJiP0TUOyqzdXGiSmDBxpjhuQROwuwvmb32FOIJxOyt2yfmnU0ni/WSNDQSBRDxk53b9ppESI0GWBk0EtzKl8GI6mto0YrQLDeXflSb5GB8Lf2zFtsZpu2Mx8pXE2p6SBX6THu8VEXA1JiJ+8mJVSXQ4AvSaXYl1bcyWEff7x3Bhn8AKkrzqbCJwGF9lRbBdDDH8V/bFy4LsvbMYV67x6izcAIMhOUIH3StLteBB7j2JKVIRz7UnlkWyee/6jVcYIE2XUTQEilKWtJQnhTec7Lqowq6+nUUCoFs+Mun9crf1mr6aHpoqOTbUlAmwm4LvbdNBWUP1Cmeofkicy0DtpFerpdhsYVAbV1Pw4kZZIjAO0dXLve2bbjaZQavpC66wgKlwEGvmB7x94p5MhQZ79C7KlBQosULYJZcRalP9jPomSzR9dn4lNJ8wh+fPgwfwwgjXMpHb1swtQdoW8mLMviwHpDEAY/kAexMZYqmE4wGcvU/oLrxkeXo6g6XdwWYozH7XIIIr7meFId+TK56Y/PXW+n+UXBq8dDHFNPho+v309VXc6XWz3AYD6+JXLP5mCr0HUSnilZzpzKqbdpbkLCp8uamEq8yxCJqYoNtwR+KRI7FNzSFovkT05+SEafGnct1keu8F6bzQp+bjaLFJ62+XWnd3/+oPNv0zKT0Gxz5iPd9loZxM+8dj9u38taevHuHgIkUitmUEl1i9wq/rM5xUBgSUdPU4nORxx3HKwLo6Fe+je03gBKnaBVbToNUIaMuQv0OUvBq1VyFZmUXRlHDniKEl/BGEH5Mmnj5AUKZykXyzhuXYSBQiZs+C+TyHKIa1KXOADI+08IZC+///t+dTnIUtdz5wS4NUb/sy+0JZNXrxWuZdmv5Il/K+T+W0ccCRykRP+W6hK3p5kJ6Hh5A2mht6gt7wxvsAJ653XCcwwgUegEHGcvcFlhH7ZeKPqNxUGKkjLVMXNalGw+27bnHpEegozqpzN6ynQgSjys/KV4Orer2RY4yDkSmg1aSvcS7qFawkCtazaJJs7rJNS6Sg5IIY+VJcLYHd0yiB9fY0lC3uL/7GrKEZKNMfj1roQ+cInukvK1Q4jsgltuCfxrUPgAWnBujY9OFHNG7uRoeSTjmB8dVJmHMN75eL4Sv1ISuZI2s1zhLZUA94em4fvEB0CFhqDBJXkDlrXRKWIXHZj1twwTI4PwTPgoRnWodiKq1RR15X+sturHYz2KJetGYY2Y+tOd4DaR1ojjs3A+f9SuohwjK7FWoQqeMNhJnARHEx/uZbBHs9LjJ+g0J54zZO5EPWCGaZuiRKiQnNLVSRBqUkhsVAEvxD7Kov9tN+6pWU9yK5p+LFHCxHMUIeDEW7RW54XbrvQ+Kw3JM5AqA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 472e6d07-2df2-4dab-4a8e-08da966686e6 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2022 15:33:52.3072 (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: ha4svWPcbYrseq1S9xKeiUHuJgrxZh1CDf3IasFxv7HcsleyxjTD8qJOo7HjM1MrN2/88gOkXHX2fFM+D56gqA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8949 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Since the driver does not act upon the max_sdu argument, deny any other values except the default all-zeroes, which means that all traffic classes should use the same MTU as the port itself. Signed-off-by: Vladimir Oltean --- drivers/net/ethernet/engleder/tsnep_tc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/engleder/tsnep_tc.c b/drivers/net/ethernet/engleder/tsnep_tc.c index c4c6e1357317..82df837ffc54 100644 --- a/drivers/net/ethernet/engleder/tsnep_tc.c +++ b/drivers/net/ethernet/engleder/tsnep_tc.c @@ -320,11 +320,15 @@ static int tsnep_taprio(struct tsnep_adapter *adapter, { struct tsnep_gcl *gcl; struct tsnep_gcl *curr; - int retval; + int retval, tc; if (!adapter->gate_control) return -EOPNOTSUPP; + for (tc = 0; tc < TC_MAX_QUEUE; tc++) + if (qopt->max_sdu[tc]) + return -EOPNOTSUPP; + if (!qopt->enable) { /* disable gate control if active */ mutex_lock(&adapter->gate_control_lock); From patchwork Wed Sep 14 15:33:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 12976316 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 233AAC6FA97 for ; Wed, 14 Sep 2022 15:34:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230323AbiINPeZ (ORCPT ); Wed, 14 Sep 2022 11:34:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230244AbiINPd6 (ORCPT ); Wed, 14 Sep 2022 11:33:58 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2078.outbound.protection.outlook.com [40.107.20.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B27485A880; Wed, 14 Sep 2022 08:33:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=irPy2czynkLm0r26Ojf+1s2paNe5PScYmOf6vu9oXvVjoHJ0I7dCnfd3ePsL1fG0uVzOh0X7YGbPWGxUDm4zB02QMbJj3gxzKZHpdic8mbFL381d7xuzCwZXRmXQKygurx2ba/Oqk5IImjRLFZuYOd2+hBgF/QMfZfcDrQfqArDtXHYroyc3nK9/Lr05RUoh8BaPSraEH4gi0Vh85tkX56nAwzf3A8a1ZnzUazzHmifr0Koc3553rejhbe3sON5zLEDCjCgYkc5FhLiojiznnx5l3sFm+3ALWaLsMqrvRDkKlcYHf6kvj9QliUA5DzCLk9G+jeHTLnx3RwYBD90GVQ== 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=ubhvkhydI1YwrMu5jzggcAY5wglPzG8YmxLJR7Kg9rw=; b=LUSa9WzM4/MPsI5YgpY9T7SHf3I7SxCQPsxeNtwOILe+kNg2eUPqYc8FscEtMnLJH36C5vd7hW+JDDcaTjchioNc03DpJ1yRKk97idAHcSWAoIiotNNoIFFMtDl4I576YgOxQ4UMVtVbdG7DJR6VzP9vmYB2dMe6wBProVZk/ExVc2cnrgxTuGz/4RI0HoRWftWUJB7u/jksR/PSqusaWE7TELDmfZ992QqrBE9fr0hHDuhjYwtIzOI5sFT1l2d44OsCQf010FpORmxklqb/WWsI7SL+1jG322I6fFRCHkGqOMZXQZi2bko++MzJTOyyUdus/cmnT0Tui5nwGYjgsQ== 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=ubhvkhydI1YwrMu5jzggcAY5wglPzG8YmxLJR7Kg9rw=; b=Ze+0htSAtVbtoq/1nvk6SiowwDS9xBGxY7d32u2lsF8FifpxyfKo17SPp6g9aK6xyTGmeFyV9ilP9rdAH+wLYhv/vg45F5mZQCaNlXKYENNLfHF4+WzughlqDwMiO+jQ+sk2eh5OVW1ji0YgQfsbG5WpdS3OQDcc6YrY1K5rU9c= 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 AM8PR04MB7908.eurprd04.prod.outlook.com (2603:10a6:20b:24c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Wed, 14 Sep 2022 15:33:55 +0000 Received: from VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::a67a:849c:aeff:cad1]) by VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::a67a:849c:aeff:cad1%7]) with mapi id 15.20.5612.022; Wed, 14 Sep 2022 15:33:55 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Xiaoliang Yang , Rui Sousa , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Andrew Lunn , Vivien Didelot , Florian Fainelli , Michael Walle , Vinicius Costa Gomes , Maxim Kochetkov , Colin Foster , Richie Pearn , Kurt Kanzenbach , Vladimir Oltean , Jesse Brandeburg , Tony Nguyen , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Jamal Hadi Salim , Cong Wang , Jiri Pirko , Gerhard Engleder , Grygorii Strashko , linux-kernel@vger.kernel.org Subject: [PATCH net-next 11/13] igc: deny tc-taprio changes to per-tc max SDU Date: Wed, 14 Sep 2022 18:33:01 +0300 Message-Id: <20220914153303.1792444-12-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220914153303.1792444-1-vladimir.oltean@nxp.com> References: <20220914153303.1792444-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AS4P250CA0023.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:5e3::11) To VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB5136:EE_|AM8PR04MB7908:EE_ X-MS-Office365-Filtering-Correlation-Id: fcbbced7-a60d-4ff1-1a4c-08da966688a4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RYEd/kyN+Mq4TKap0CfRHPzrWdxstWPnwqSr2AtuEoUMgTex9qzZi8RqM1fcGt8OdRUVEIbP3sKhU83SHJYiOknwDVYddyua8iIEkMDJwRlQBdzAlZx4gXQz5FqQBrU9WLjf9UtOcfKwEPlKgStJpOX1s24kTxvc1UOjhcGOBmjKzyFeMkxz7hafC4yRtuZ8IQCKCuah36PmIDnQpnieoxZ6ozqU/05WOfg7WeCrgO68tgSg55ZD1xtTXrSBJ/RdMIEA9vZq/rQAEuFj0oFw3NWmRB3E0jIS8ejRP1e3Hiw8+xW4LvYgWidCTtvcrvgqt7o6N2BSx+QifbPPVu7kVk7LIoOXfsADjJZNqYv7kCTi4h5BeTSA57t0llS6v4y6hAthlJu4aQvm7L/+bvMxzfNSXjj6sGlfK29GtafHrPl/QPTOEbBBt8zFqh0m0sZja1HtjBCakQbBG2L5HO6fEkmzAn6TgNCkVj6FKSNyM5rdwAYzssgzbdJ96TN6UaZc9X3HogvY3LJ+U0Jw39KK4VyAsw+O0OipQn26ux9jnrWqmqtCnowRJyGF8+9D26RVTGIcS4DNQpTPkxJVUO2M1VRRmdhROpSAM9pVCdqYwnVf7eMaqKbOPehy74FoO7CRjNDz861a123OkwiMXK1A3y37lI2NUe3Ps1ZYi26xVJQh4CBKBQ0wdqCleLoSHcwb0Nf2R9OYpyDSTSuaGysy0/nHG6o15KoF8XL3g3Y+Yd6PkgCKYHcWVSemfudyx5GiLvJbuXKsoPaLTv0RLNHUT9zLWhV+ithSqOmbE0Kp/um8J07I3X/O4gk5uj4WifGb 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:(13230022)(4636009)(376002)(396003)(39860400002)(366004)(136003)(346002)(451199015)(6486002)(83380400001)(186003)(2616005)(1076003)(8676002)(66476007)(6916009)(54906003)(44832011)(6666004)(4326008)(5660300002)(66556008)(86362001)(52116002)(66946007)(6506007)(7416002)(6512007)(38100700002)(316002)(8936002)(38350700002)(478600001)(2906002)(36756003)(41300700001)(26005)(4744005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: IzL+N7nuJCKItJPOgiEExW3S4mIbsSBUHElUUalow96AVo5fNdD1F3nbYQ3VsmwVfmUVZ+tBTnyhHGmmen5/XV5Kdel6tBjRAF3VRSV1KJOtTp6u7GohrOTh4iXPLTXxuAN/PD473PhYnHgktr3Zi9RwEfYERl+55DYpxXd2YHOQaSCmkoaHIAW3YUQEOmY3FeozxBmgMg5CJQXskehkStPUrddhyJVsUP9x7L+8qluIm1uBMf880nYqIxQAB6XXBeHh0VHPOxj4besUbsIXvG7n5dyV6NnvtD3v34lh5CssuGBE31pzNZYqOyavItCvd8Vjz6CyCjIDa0OZ+ZOc/arVlaYbzca0gLfDunqxh1p4za55zNCP4Se2deDlMn3RVVkLK+diRj3bC1bLLwZ7gO7TwnOtpwMQewdvC6yDSG5khHun+gpc19ep1Ow44sUT0bgrD4Ztx4UvcwFUURgVD7IVd/Bbs4yLcQdRxQZFxO7kP3vobMuf8AhUZNQ6jg6upY3XsRRdOoLhe07MmnGMDB/gPGCX054XkqS0+Iu1L6cPzIos+pqS+hCfcytDSuiIfDbINOtlxE1boYtUgaejoA7KQaEzMdpDYeVjY5JBGsdXPbrBvrUbrxdh2ofgsa0c8cTSgwZf86F+SlBBmwySMlV4yGIF4R6YMpb2piuzIpaOu9nQ+HUlDd4zMGXY2X8eSVsSwY5e9ZyW6e7d3gzpDdRn+ssB/68lf0gK0tBXcZtM/W3f4kHMD6/I4ulT38rfU0igC2BwBpMjZIP29JDV0lRObubudCResvHDURAa7t49LkZNos02aVjXcqc8kHgkfz59FRSCIWhva4dKcQNxJxCr6PK9MZiXvIY70pqlWYiu8TgTMw4xRUg5WlU5cFYUfMjLWXHg4hJ4iacBmd1+QjSjZ34J0dyyVjlxe8TYD+JuTzKXxaK3HyaMdPwgsaU3BdYObmsP74dD6T+/B45Gia9UH9LyafVhsyFyUFy339tCP3AiSrZD+Vf99ibMvwmZr/AoLhZCdTojXvsx8lTyu/Osvse/30RKapayCuLW6iBoApbX6rWXCbdAwuRQ3USFCu6VkFhz9UcF6pe44WnYHc+wColnXMYcbpC0knxGikDMx842wcfVrNlOnhqcVp5dVo1syg7IHrPUnUm2KE8hQb+5l/sqSnnk8k07ekQAzFH4YOvF1j1hyrUK6IPEdRGJMKupCfWCVSVmu85777RLdiCADZl0T1zDlsEq+vTDWEtPrYc0IAP0rxCWfPaEjr6XcUI2YrSUJHeCFP4IpHcNmQYHmBSnPIhFvIwl9t9ASlELmOEzbmygTJp1jzsNh4hSIDKgH2bzQiAvFGeSHlAaQILVZZEOa2iKLloWuCM7hESyDHcPuPaZuXbub6tz9TYASg8d93CQFTbyvCiBkklM3b94Gk5lI5G+BpCeEw2wXwREC1tkASSQ9lhpnq+GxO2uW7dz/MNg0vvURqObtucoUvheNAnwg+8Nn27xF6jRchR4ba56mNHkZ/xKeNBn3aL/IwDByu57rMjzsZsAqrRaV5Oy1/N2ERivv4WXW+4qE5y7St1Kw+v94/D7spPzbanzlCck+kXN9undIIT3k3AM2w== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: fcbbced7-a60d-4ff1-1a4c-08da966688a4 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2022 15:33:55.2914 (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: QXpyx1vLNn9ysZC2SftH8LEZd4QNFqfQQvE8Lk6pmOq8S6EGILS0OzJWkfIehDRyxJJl+W83Umu79BlN+pw2AQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7908 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Since the driver does not act upon the max_sdu argument, deny any other values except the default all-zeroes, which means that all traffic classes should use the same MTU as the port itself. Signed-off-by: Vladimir Oltean --- drivers/net/ethernet/intel/igc/igc_main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c index bf6c461e1a2a..47fae443066c 100644 --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c @@ -5965,11 +5965,15 @@ static int igc_tsn_enable_qbv_scheduling(struct igc_adapter *adapter, struct tc_taprio_qopt_offload *qopt) { struct igc_hw *hw = &adapter->hw; - int err; + int tc, err; if (hw->mac.type != igc_i225) return -EOPNOTSUPP; + for (tc = 0; tc < TC_MAX_QUEUE; tc++) + if (qopt->max_sdu[tc]) + return -EOPNOTSUPP; + err = igc_save_qbv_schedule(adapter, qopt); if (err) return err; From patchwork Wed Sep 14 15:33:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 12976318 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9232EECAAD3 for ; Wed, 14 Sep 2022 15:35:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229602AbiINPee (ORCPT ); Wed, 14 Sep 2022 11:34:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230246AbiINPeB (ORCPT ); Wed, 14 Sep 2022 11:34:01 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2084.outbound.protection.outlook.com [40.107.20.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F28E5A880; Wed, 14 Sep 2022 08:34:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KFgVmkSznY5qI6YYFdAa3uv70hL6bK8/y2wxOQYBs8BPZEiva6DtLdlv+dAPyyQ7hc5emzga8H5plXHaIopRjPisDCIvSVSi/yo65fNQwfJvgaEc38/PTahI6G6h/J9dtGispWzQkLPlu9HSgUccqIloJ491XROSOHTPW8vzXhjPWSc0A5eedlS08xFye1oNJsMbArpcjRXkRk7dCLMbitNLrqJBFgTQfsYWeGlo/1WEWaDaR3oybAo3C/I3U07ZupcZz8Wf8IJM1t3OPX6x4Tt5SSwxDq8bC2Vh1S8/y/9v9MlbqHdsbpUk5LYCYiSumSKPtcE0zoal7l9K1ir7ow== 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=iUNlSxjO/C9Ja7fCE+202VezZwbWskiFJIdooMHS4qU=; b=fdX4dlaOJYYAZ1i/+BBO+DT6Not5y0T3Q1Ogb/OHXuuPa7IhQo489g/Ao168MBPHZxhZEF92DUCkyzZkHIu+blt5/GOIX3Gyw5JKewkew0XnCIikLS01qhf9A7Zh1cj9SUihTi3Zyi0+kL+gHEBUcWRgVQjksYh5uMnyI8+306OczAmkf/IMDkZZt13PZE+PmTdXjdT+ttmHRuQWB36qC3DJFzTrTXMx75pun6ecQHiSs5kyP9xXOtGuwYaN3tUX53gV3cP+tYDcVtr0Er4BpCpAoZyOXJOYbKbKANk/QPYEyySqocuYj5T/FoHcczafTxH3ExV+u3TRRSR9V7nPyg== 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=iUNlSxjO/C9Ja7fCE+202VezZwbWskiFJIdooMHS4qU=; b=no/VtTuN3/9wUsMPZfeNvtECtC+2eveCE7FmIXnXXP43g2PpYSLfJMqnvu/XkcQj36F1jkjV3QJlrKisXbmoBTAJhBaFPCPKQ7LVIeoYReJ+HHjwOWmKdlDIAspXvGJxMraHQ95tRd3YWg62LGZuTMlu9I8NFWftKCyS/u2xPzw= 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 AM8PR04MB7908.eurprd04.prod.outlook.com (2603:10a6:20b:24c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Wed, 14 Sep 2022 15:33:58 +0000 Received: from VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::a67a:849c:aeff:cad1]) by VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::a67a:849c:aeff:cad1%7]) with mapi id 15.20.5612.022; Wed, 14 Sep 2022 15:33:58 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Xiaoliang Yang , Rui Sousa , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Andrew Lunn , Vivien Didelot , Florian Fainelli , Michael Walle , Vinicius Costa Gomes , Maxim Kochetkov , Colin Foster , Richie Pearn , Kurt Kanzenbach , Vladimir Oltean , Jesse Brandeburg , Tony Nguyen , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Jamal Hadi Salim , Cong Wang , Jiri Pirko , Gerhard Engleder , Grygorii Strashko , linux-kernel@vger.kernel.org Subject: [PATCH net-next 12/13] net: stmmac: deny tc-taprio changes to per-tc max SDU Date: Wed, 14 Sep 2022 18:33:02 +0300 Message-Id: <20220914153303.1792444-13-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220914153303.1792444-1-vladimir.oltean@nxp.com> References: <20220914153303.1792444-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AS4P250CA0023.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:5e3::11) To VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB5136:EE_|AM8PR04MB7908:EE_ X-MS-Office365-Filtering-Correlation-Id: 5bef213d-3788-416b-d572-08da96668a6d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WiCKRlsCOT09a40C4hTgrhnMeHa5kT3wnQzs+A52YsmVGDDn6LZqyKbTktGOWcgH8f7UN/xcsjZ4Sjbdw+iZWjLHOxYmIb/ZvJohWGIhj2VDqSrCiPtPz0gOG3e1znLqvAj75/XFeqSk4xLQ/E+ZSzfTjwnyQ7qxnGs/XFPOLeStqY2O4mZYQSdYTat+4grZOECQHWfT9qtB6i4fxE5NfsPAgKbcRMFMJaa+WnWbb59Ay2jbgkabXetUat33cC03qbR+u2PmF62n2zNhe6/Vl74yuU36W9g55QzHAA9jvNW6oBw6pbQzpUumk8XHcFzwfI6aH3yDOonMUN2XKXb6bYnHltdLSWdiUtcnz3jV8ECUwyssoMVMpq0zy6D3kyjZaRzzHF0rtaBfeVx1f2s14Ml93h22DmmEBzoM6DMlSRtLYfZiH8fhJ/GQrgBxUzeaRzoluytXzarLBS5TzBJYaaNoQEOae69/NUp4+xLpgOA9eBvZnyZweod2HGsdEr4h9X2PCf8Q+q91gmkqVLlTvKqpG7kVp0Cp/O5ugd8Wu6IaSSGMmrG3z0zah3sW6j9eL2v2Nyj/MMSMFDMu8aaRFZ4tQu8Rcb4CjvQeaoSDwNw3iMsJB2/YQXbsSR+1KKrF2EwfvULQHNd+vSC3gCl2N95AXfHUxmAWuwnxizGYmG3hfaEZ3INIWYJ7CXu6wCaOMIv5QrXzY+93AKB3+Coz/NvcmXgWT7eog78aWVYWCo9FFnO5dqg3j59FTDBs/+xpZRlxXIWO+PrQTt/R3eE/xlGDZ+goP95pUeKxNqy0E1jEcOzHQ2NG4sN65d2qdv1m 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:(13230022)(4636009)(376002)(396003)(39860400002)(366004)(136003)(346002)(451199015)(6486002)(83380400001)(186003)(2616005)(1076003)(8676002)(66476007)(6916009)(54906003)(44832011)(6666004)(4326008)(5660300002)(66556008)(86362001)(52116002)(66946007)(6506007)(7416002)(6512007)(38100700002)(316002)(8936002)(38350700002)(478600001)(2906002)(36756003)(41300700001)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: uk9ImEY15PtVAz4Qu6STwoTzl24YX9OIYnFtTu00kHP1Cl0Y0EqEri/A2XkLP2mrCfRBkO1Ur6Mau+ZFYlGXjil2ZxwRwyD+u5VzpU7koRYMOatNG0a5eFxekJ4bIUqkRyxFQBS2Xoj+zidspxYZ2v84+N5CMQqqbh27mKx7cMczxgRSkoE7eEvX6rDcvjc7wL+qFaoYm0n69zVKxUcQpz2GJPhRwuilJDUKbVbGZxwo05WDUtjdcCwAlrGqG+OpRZpVRZLVBu+ig/tSfs8dY5LYn8hi+do3HAywQiCMH+28VQUrwEa3A/LXHDUDP0SVWyEsXU8f6Cqogy4khqBnEkW1Q4mG/pmIAZQ5Y9mnr6qrdvhu3BlV9cEvG5mpmb/ofJoTrwE2St3rr4wipl3UoMgkUY5h/8sv+1qqBPT8t8rFg0XM/E3TRNtCVDNarqH8ni0A+segmtdxw0a9x3ocXLDsreZDfOGI6l3mHzKnfy7zNF2Xdu1d+t6URZC7hFfhoBNnTCxFh3yxbrmKaewPMTfuxKT+3KtkVVp2BXCAEjqVxWiLxpo7pebtDiA/YXWJ9WGtbeXBXcGbyWKzlvtMsTBIZQqGFTOycIAYeKV3awEz4CZ6A2eUaGcklvMP3H+qe7MXzCn37Zpz2DsTLZpF0eQlinYsmL1z0YI3pML425DxWwapHsCgUxs/VWUoSPCdogsusjajQvisjBdhWB4hCWY8HCrZv3cqR50HbF4vcKTpPB1l+2ZY+lFqECNBhPVvv/o0t0CTlHah3ZTzHIaM9NuUadPc+8CMgGFqqPKb8bAPWqOh0V5nBY432eJy2LGRCHZvwCdiJo53W9ivTc0DbcPmGS0zAVcNYNl+7l4WWQVCqE9B1j24S22g6S4Ykz2zKBKiHD1A9y3X1hVdLoBkumjRQqgdfoeNeSTPZq88uAsxRkFeYcYjwjhNatgXdxcTvZqJczPfbX2xmjvp2dUmvczFAghrdsrmEU4447QHucFnECbavvFbOlC4HR6qQZaCD+pU1+GjS2vCYN2JKw84NAET5rn9yGmoPtmregLmr+ZZxQ0G01wgqyAglIpKf+LlyQcPmsxDfpLu8eZzQrOnvdrq7e8o1wNv0SoTsxGxJ+v7V0YuHOi1JiV4WFBvf3QJ2HGnbMn3Yb7ywdGIGCFw/MLvE1VDF7Q4Xx6JpE/kNac1f11B2v8fUFjDOXLmDb/YJg71qTuGN0GsFl1BLtOpuZwHZcm4SEyjvXUi+AldpM9QvGs4dMEAxJp2tS2jf/SVlZk3+/TnZ3NN0PDemp1RSkM3ZajW3kpCMBofrBUamQZ0jLH3DCbSRYzJiQK7oSwEykxYCDcVS99842IyJXyLzqJTjjAsh/GqanApNqbWwhhjdyJd2naO1/ELdl1t1PSDak2kvYS/0ezky4HzxXxTPgRJ9YSuoKfamcjNcZXqATte32dL6IaOH4c1z3P123iYWioAr/wXK0A4YIzXlMrg6KkIBgEYMleblXsCou5MCjKKhhlgpWXiwscDDsi8EalNGUsRBz1udGypS2+gvMR7Ro3fuqGmjcnyEvk1pC40yAtuZu8QJJlzE4PDProtakqOcgbJCIF+n2IpkpiCyKlEuw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5bef213d-3788-416b-d572-08da96668a6d X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2022 15:33:58.1505 (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: Ou1p6AlWHkHQoMbN0Da4fgun5AOUtEI1MljTMrYcrlUe9HPSOaf5jn7nfNjwB/6deJ/3m0brmIwyAKxJazmjiQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7908 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Since the driver does not act upon the max_sdu argument, deny any other values except the default all-zeroes, which means that all traffic classes should use the same MTU as the port itself. Signed-off-by: Vladimir Oltean --- drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c index 773e415cc2de..8e9c7d54fb4c 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c @@ -922,13 +922,17 @@ static int tc_setup_taprio(struct stmmac_priv *priv, struct plat_stmmacenet_data *plat = priv->plat; struct timespec64 time, current_time, qopt_time; ktime_t current_time_ns; + int i, tc, ret = 0; bool fpe = false; - int i, ret = 0; u64 ctr; if (!priv->dma_cap.estsel) return -EOPNOTSUPP; + for (tc = 0; tc < TC_MAX_QUEUE; tc++) + if (qopt->max_sdu[tc]) + return -EOPNOTSUPP; + switch (wid) { case 0x1: wid = 16; From patchwork Wed Sep 14 15:33:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 12976317 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3972C6FA8B for ; Wed, 14 Sep 2022 15:35:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229728AbiINPeh (ORCPT ); Wed, 14 Sep 2022 11:34:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230002AbiINPeM (ORCPT ); Wed, 14 Sep 2022 11:34:12 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2074.outbound.protection.outlook.com [40.107.20.74]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1004D80F70; Wed, 14 Sep 2022 08:34:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rka+cbUS9kdcTG/ZSoDswOjpGOgQQ2MO/ycM3ESxkkgcmvIsO/Hl+/HomqpHfpI8Ypk2LOCvOlB5GjkoqXnXbVvKFumaiqjZrmk7PqWaR4lrkEPMOb8A7hl7Rb3sFdcr3qixTUrtZl8yT/LNY1Wem9qRL3kUopLA+n1t6P82BHUlok1bNhX5OkS9skWhWVSwZUkJzQ0sxhud0tzPQFI386XxJNCfVbXDcrDlqNU0h/RB9kEJK9n2VqqkHqKDIB7+k61TnbsrU2InrYa/HS3fBhWmvREMhmnYBF0OsTaWpTbGiSeBBZjWpZrdTgJyv70vlz6q/KbPkgc/5AMviEfU+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=nyMSdRGGI3RUrclLvPKsdhMBO1YIiP4dg5TVeoWkHBc=; b=bP29WfoOGZvDFsu10JVuQ6UmusZoYOGtIMhak6qUrnPb7JRTzY1JRjFH5DtE7cdjYhWrg5OCOKwY+aCp35KDNVjq5Q2kV8R17h6e1683OliLBgG+Q9GF3O2vVes3lr6FHWNMU0KlfBx4zn7Vlxz7ZIbhUL9jm88TrW5SvpU+oeFv2rIVDGvblyY8cAbZ6K9Cqxld7uXPQqzWPPt36SxdAy4xDlR9z4YFmXOuhiZ+SOYq2cCSBxLuHCdtOo/ZovtS6qiS9NkqmSs8jx/yOKtaT4qad6lVeBIzZD6aIoNvnRKEWbZwFzfpK2psiaW8jfHTgGS6rJcsSFFmXZojYvtuLQ== 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=nyMSdRGGI3RUrclLvPKsdhMBO1YIiP4dg5TVeoWkHBc=; b=bownMam7tBrtn87PYoz9kct9EDMajeCcvQAHduXHUQgXrLWD/A8IsPXp91oL+/XEaB598xZKtCtpIFun1DY1F1EsYFQRFu4ZPJVfXYFdj9ivbvD28LnOf0Xjgrxu4Cld3hc7HfpJxvgc/sJeE63ao6fT491JIje/2Rdq2VV9hao= 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 AM8PR04MB7908.eurprd04.prod.outlook.com (2603:10a6:20b:24c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Wed, 14 Sep 2022 15:34:03 +0000 Received: from VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::a67a:849c:aeff:cad1]) by VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::a67a:849c:aeff:cad1%7]) with mapi id 15.20.5612.022; Wed, 14 Sep 2022 15:34:01 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Xiaoliang Yang , Rui Sousa , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Andrew Lunn , Vivien Didelot , Florian Fainelli , Michael Walle , Vinicius Costa Gomes , Maxim Kochetkov , Colin Foster , Richie Pearn , Kurt Kanzenbach , Vladimir Oltean , Jesse Brandeburg , Tony Nguyen , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Jamal Hadi Salim , Cong Wang , Jiri Pirko , Gerhard Engleder , Grygorii Strashko , linux-kernel@vger.kernel.org Subject: [PATCH net-next 13/13] net: am65-cpsw: deny tc-taprio changes to per-tc max SDU Date: Wed, 14 Sep 2022 18:33:03 +0300 Message-Id: <20220914153303.1792444-14-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220914153303.1792444-1-vladimir.oltean@nxp.com> References: <20220914153303.1792444-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AS4P250CA0023.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:5e3::11) To VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB5136:EE_|AM8PR04MB7908:EE_ X-MS-Office365-Filtering-Correlation-Id: 47a7de7d-0457-4acb-b991-08da96668c1f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ymWneJcyEZczRImMOo+giHK0BFWEydNYGP16psG4XOVVx/z5oeB3h3Imv4iBIr6CCCJbiWR2ut8vfCtE6PZzG4WJLEwDImu1hwIhm124nh6WEOvoQyqKeonIQBXpH9VpMadFpP7rknSyrKDOigGSUZcmKD1dvsObmHDGk/5DQ+O5e9O/SzXWIta3cXsGvyt3+30mdkUEreOTphSQkUy9NYNu3LNqdDMLWo/2wGyP+JASpxykUAO4bkhZWabrejjWSaQzOKSinQqn64KIzZL805+Szm3iSn58HjeKE8C4c3HvxC7S+17XyjOqUCMPyBID/2SvAqHKuFCFc4aZbbGZDWRXljDR5il/8yTaOUHKm6/scFrbyQs2dWGxQMr//O0ngWhS9QsGtJVhMBSMbeH8lFt7Pz8d4GxN98ZZHUWJBXgFQz4qeJgh6ugg9bs+2GhRvoHtotPsJ6JD09B18IUTtpvfhRzC76QdCuRoVoKnBhJKX6Hmpnay3W8Of8vRiTA4qzFznMyyFAABO/cK2kvq/UVMNjqK+r5IyZbXKsfnBwcXp1DWxy6FmP/EbpXyRzAy55JmAu4RX/8gYRKQcihe9tmpOCUwDSc73XMQLEhlEycZxnt2RFsgaoB/A3G+FWJMhtb0C57trgiTr/1QLPx6Rb64Zhrfd8KojwbalbmfxV0adp0VROptbnhVqUJt7YNHqVoOxiumGKqUZmPJTweYt9qE31Uz6EaxuDMXcc3nMIRkK4aJ7A8wdzbde6SjaR366dPAgmVwQGLVfulJQvU/ykCBpuk7qT8M2QpOia7SjenNLzIpT16hX4hAooQfHOGc 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:(13230022)(4636009)(376002)(396003)(39860400002)(366004)(136003)(346002)(451199015)(6486002)(83380400001)(186003)(2616005)(1076003)(8676002)(66476007)(6916009)(54906003)(44832011)(4326008)(5660300002)(66556008)(86362001)(52116002)(66946007)(6506007)(7416002)(6512007)(38100700002)(316002)(8936002)(38350700002)(478600001)(2906002)(36756003)(41300700001)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Y1+d+TKKdlE3bHdT8ZGloONkFdoeQA9/MwyMt1LcwMdUe7Yw07qUJ+Q3BoXsLLrNroU6EBBLYsfeBH4nzWqWiPNMWpyP0PLXtEf/9zc5X7mxFpJWKMygpQZfDmVWpqwW8ZValknjbLmx1og/uquAswmFE2xn30bDIGNu+Y219fPLChPy8ox0bHqb61b7oj8P41GK3n7VsQ8WsUxNrQOAlzMFWBjgnvAhaWEt3HSVLkBgdYYckNarBoxqViWj42wYeQutGc5kDUIFmGdwigrLJPhX0cLpiOExb+rpk0cVig9GjXs3bq1a28kmheldUSrStVVukTkQSvFmJP7d7bU1YgBQOUR+xV9tfB5nMQpy4ffr2JR1a99tghtsbHAEkPf3640sd0gi2i3LEIee3HlRZmjX5NZtdAGff3firEzZv7nlMjmSi3ipaZ+769aFi4dXTRDx0FlFwatwG+qrPxLvFpOXRKJG9VGDDHfViCqv5woQInJlYgmYeq39nBp/MnGwuJ1ozd5mr5DQi0wUSXMFn/uJ8IJbcfRo+fQTXIi9aRPLI7q7bL7IXWqVCpsBXe2PukLJWhGTlZMsTyvHQ58bc+ccTX/MDR04UokZv2vZxiOaRDBdSiCzGoLI9cc0QMH9mNBD8pv5+FTxxDR3mA4S9bYSgCGlFwBI5T1AkNak/5BBnaJqDiAnthSwskCVClzsThEZA8c4WijVsenlyl9nfx2rNpEqDzGgKreBCvk6NmKFGr+gOMii6z7xvtDWqU3edt49hkEzr1EhyNtWvj+9h882k1GItbzL/cJB1uDUXGfKXprknN+sPC8mdcZ+jefFn1xv41TsOf/mAkYWIevsQ0/AqCkQqBgsDP/GnQcqQX/q5LQelMnbsU+3N5X22r2uDAfDdg29SKxYYHJvcTrCPJcgMtZLN3y2umeLxP6e9sWYRIXOerqnLJZPsQUUOVV0CrGUYieAhumssaF2FZCejqUSPcwkTCiwKJJro44eUAH+EsVMlobUtbEzHAvxBgIOW/x4nNKg7FruPGyDzAe8MYzydzV91OkycgXb3pKpU9RQzvIgyyW/fR6A5N/rsAVvYu3nxsySQVlUYq2DH6nZ/ZTWRd/OOcDF/TIYnMTDgNo5rpn3JlK8ZOkCrUn5yMC8hrHT5xql+1xWW6QbceJJZ/RHWMZ7mvA4i39tRuiS7HpqcmzrUrcS9kDOINelzqwT7UFQ/yUBYwuLmmY49MR3L9MzxEF54slqnGLXivs0nSOX7nY6dtE1NyIQOz5HthoCMHMuBh42cE/7Q85dPWcEwY+qAWO+xHhs8VuoIX2XIMe8vA3ejy8V7ngFWCvs2qhJoTNsybUXWe6bFKVuluoJiyGhy98oyb7qX9poLd5den36QFjC9al6HwDm7wmRhBIB4c3VflBNzPQgcI+SXK8oIoZQKIPaq4I7HO1/MnNfWZ6LCP4EOm5uqeTf+hiG7hP8SM4soiNtan/Paf2XNdXb4yw9ApD/fNPOUlIH0bpHZ6hl2H+Dc946tCMnoRxzraRbc8GBaa2X7eyHt5/8+TuttN3AKPPykOfgwKYIBfKqXFmpyGvs1PboYUYEKw64BISkwhTH0Yuk3F8Cx5QhCLEWHA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 47a7de7d-0457-4acb-b991-08da96668c1f X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2022 15:34:00.9941 (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: QwAcLvbwVaUYXSmmV822IBtMuEEFPF31Mtdj5ggB1wY3YyZRWBF9F7GuMfk90lMOmvCkpPZ2OHDBZtfFdKGodA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7908 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Since the driver does not act upon the max_sdu argument, deny any other values except the default all-zeroes, which means that all traffic classes should use the same MTU as the port itself. Signed-off-by: Vladimir Oltean --- drivers/net/ethernet/ti/am65-cpsw-qos.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ti/am65-cpsw-qos.c b/drivers/net/ethernet/ti/am65-cpsw-qos.c index e162771893af..bd3b425083aa 100644 --- a/drivers/net/ethernet/ti/am65-cpsw-qos.c +++ b/drivers/net/ethernet/ti/am65-cpsw-qos.c @@ -503,7 +503,11 @@ static int am65_cpsw_set_taprio(struct net_device *ndev, void *type_data) struct am65_cpsw_port *port = am65_ndev_to_port(ndev); struct tc_taprio_qopt_offload *taprio = type_data; struct am65_cpsw_est *est_new; - int ret = 0; + int tc, ret = 0; + + for (tc = 0; tc < TC_MAX_QUEUE; tc++) + if (taprio->max_sdu[tc]) + return -EOPNOTSUPP; if (taprio->cycle_time_extension) { dev_err(&ndev->dev, "Failed to set cycle time extension");