Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp8116136rwn; Wed, 14 Sep 2022 09:09:19 -0700 (PDT) X-Google-Smtp-Source: AA6agR79Ef534D40KNtCND6w/Vg/T/y7Byn3v7SfD0TfM3pnC98EjVzyukiFloc1qnHSUTAwm9r/ X-Received: by 2002:a05:6402:3603:b0:451:fdda:dddd with SMTP id el3-20020a056402360300b00451fddaddddmr10730878edb.81.1663171759292; Wed, 14 Sep 2022 09:09:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1663171759; cv=pass; d=google.com; s=arc-20160816; b=zlLuJLytFsyXUZwbJM7WvwD77/8QM+myd6WGksyIgmdlg26hbeivEl4OvSSEDi2gV9 ZJPz7g/2lqThY17RuzVA7C15efg+o5qI1n14T9AYUs0kcFE032vw9Yj0bhum4WsEDt+j d5z4jrX0CQwTkH9i3p569crwm0xJj3S1Z2bnxff3otQbOmRM2RcCWlRdRdiYPHEBKkwC dYpmJt9X/5BWsOLhvp4gIWoBoeA+VXoZM7AGMIYh1YfGEGm3wRqrIXx/TLGEAkMxN1UZ VzXElbzg0t7rbJX0HPUC1cwNL6ca6v1BmYt3e9LCc3yO/blr4uqU/AUfG3XzDwrn4KpU M8mA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Rqcc9JjhHFretRhuHEGlsXIGH1ZJ7ucmmVhSW7EV9SQ=; b=aU14nCVmWizPpTFDX0h2Vz1vmJ7qXE//y+gFddXcSyE2ftFLs6cH8hleF2eP3lXWwc lHn+xNDHQdJjccH4jY8IRV7TpQeTxS4y4oCxh2EkYrwzYJjUDpZSL5yO7cH+ERP4GwHR vBxFKE0SXqFKgt6vmESo6qf6FkXrsnPT0vL+Yud2ZkWNgMBW89ul2sKwR+MnJX5r2rFs +ES2gkSmSfoMKEGEAYWsDBkoJ6ItSg7uUPv75gDxyYr9/eMMkqsc2zuXB2/+j0HyU0bM pUVcoMuCBCuMTQ0mdNYklBAtaZKeEroofaLDyNjWdR8bqazs7j3xKXDhjioCSsns+Vhl 3VaA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=cOzgWCRB; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sd16-20020a1709076e1000b0077082de48b1si298618ejc.894.2022.09.14.09.08.50; Wed, 14 Sep 2022 09:09:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=cOzgWCRB; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229599AbiINPes (ORCPT + 99 others); Wed, 14 Sep 2022 11:34:48 -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> Content-Transfer-Encoding: 8bit Content-Type: text/plain 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: =?us-ascii?Q?ifgXBnCtACpE6d/Tl8Va8924bVyhLmSUJRrEahbIQaAshlqQ1XtvU/g04n5F?= =?us-ascii?Q?43DN0oKKum8fauNjhyjmoFFAwHMskZndaaD6qT7rUy/xagBJsRVeIe78GTDA?= =?us-ascii?Q?fbRjb7AgGnnX7nPTKBYgCVmt2tWx2xwtntuM3pVmsjfsuuR3KYnQ8wqQHsc1?= =?us-ascii?Q?EknRS2MNSdB6uddbIq5jP7jgoAFq4CpH1oW1nUtwhXZpHgf2BQYV5Vd3LW35?= =?us-ascii?Q?cDOu4g3I2ZIou2VC2w9vnKduuuHSCKMS2t+jVaGMKC/fkrARATNI/tx9fGEk?= =?us-ascii?Q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RggjCrLFbn70pUv1MSHDtS1V6tnGQys8hC?= =?us-ascii?Q?xz4XVAXzMDyRNIqThl245y76a/zvUv4hTU0hNSCGcf4QPF/o93il5uBrT70f?= =?us-ascii?Q?merAY3Kt31A95pdS0gHzVb8+HQPOQsODI/Hnf7LnXqEc6zYBzAMFHSoEED7o?= =?us-ascii?Q?YuqtSaPM0QkT4DqwC0JICXhW9UbkjO00+xiD9UmujCn4+k7hViT590imlC1n?= =?us-ascii?Q?koP4jpMLgUZDAsPHsHJspBHHtSzHr7lmRNe314iof06q/H9dKiqMptC+r+Vt?= =?us-ascii?Q?MU7zK6zjRP2WShnZfPiIgoljMozD2j+eCjeyGmSDDL8ZDCPczg7DwP4ZfhP5?= =?us-ascii?Q?T+iwUCn6T6/v8FrPgCu1Mq4YL9S0eQHa+xcutL29Zh50rjYoEor47Axznvu5?= =?us-ascii?Q?Z6n8PFP2JaucACgD/ZZWJSiFX2zjK/a+HM3vG18yrMafI3W6bkVKZyfMZ0qt?= =?us-ascii?Q?ow=3D=3D?= 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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; -- 2.34.1