Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1228241rwb; Fri, 23 Sep 2022 09:43:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6+ejb8qC8ni5NB12BSPfG4/HB7zuJNGxCp+EFQvDVh4BmVRAMDlTLFSBM9BWhZ7SH+af5n X-Received: by 2002:a17:907:94d0:b0:77e:c2e5:a35e with SMTP id dn16-20020a17090794d000b0077ec2e5a35emr7994663ejc.648.1663951395938; Fri, 23 Sep 2022 09:43:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1663951395; cv=pass; d=google.com; s=arc-20160816; b=pOvIQnYxemhUUYGVbivE5Z7PzYoUpXZBLdT69+PMmnBMusOwgpedu0nZlow0JwprJJ /XADJoz0AuQIEne8X3C/CTnduuf5C3KIrxzLisTwZ5TMAyCBmQuwobdyCbJDJDkGaoNx aVmHAEQH4Fyta327yDYiQS1VGnzKhXFz+ZYEyqr5lv49DiF5bEbIIvVz4i+/bgsHIk6z GqHLuStyKTdPVImFWzln3D0i1PdPCrDtHKwkt+p9yazXyejIlzm+8pd9wyJ36ZUhZUNh GSetXTpRaHz6Ptax3LLFrKw03t9kEXkvI0XdQXPhMdvCi5HjZKqj2zK5877GmThJGrtd H4+Q== 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=TfYGQB86xdKIbx/pdqoAH4P0uYpNwcIp19SBSo2oYUU=; b=ffpiAq/DxOZEPJqz6cJ59wGlrMc+M8TnBwMpkIXfu3orMX/Ctt/ZNYjSGupRlWiM6f eduPhjJN0Pi6Gw2zfLV0zZeUCG7VStTRGzvugkog4jYmjj4zUyDJKvkfH8y4deOy+Zmb nm56IlWZV0tPxW8kKw12qMI02/OK8Bhtej32XDf7QMaR+UBKBKp3/R7fdyIv+m73wNpz nHAiqoKWA2ZgUnK+uLvgjaTeTZni5ctP9eZYxz/QizhGg1fSFUYYWV5Suvv0GzKDtTPI czj8AYipw+763CwSi6VQN+oG0WbpNIJD4dUBtNj6bt4m4I8brrdPxAKcoZ+HeA9a0YHX AQSA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="Rn0VcFH/"; 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 ji18-20020a170907981200b00782a5657512si1959363ejc.416.2022.09.23.09.42.49; Fri, 23 Sep 2022 09:43:15 -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="Rn0VcFH/"; 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 S232482AbiIWQeu (ORCPT + 99 others); Fri, 23 Sep 2022 12:34:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232989AbiIWQds (ORCPT ); Fri, 23 Sep 2022 12:33:48 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60063.outbound.protection.outlook.com [40.107.6.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45343143291; Fri, 23 Sep 2022 09:33:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c/3TumIs2HGBqcJLxlRaP7bLOHNFwFS2kRswLb6aQnmkMb4O9z4CHGwFhwD+Cra9Q5/BBWjbqjSsv5ULr41Y4UIEA1HQw4s7DQzvh8BNpHgBsrROX8WYXqsDNSzuzx0dtVeWmFPYl+EijHRZcscwFFsrv87r4iFD/cPWJmAxR+Y18VTFSQ+nOCK+zsq/SkGpQDwBPa9gXUN4HiI9pbtmJ5grp7r/0dm521goHsuTgXWRTRLEDHhqjTzyMehKwlrAbRr/t9BB8MkGpv+GLjj6YdNcEgW3OYNv/mjyO5dwYZ9yUyxFci7Pm5KfM/Z7Kdmv/YH+2qbLaUQVAljIR+IhFQ== 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=TfYGQB86xdKIbx/pdqoAH4P0uYpNwcIp19SBSo2oYUU=; b=YKqFauXbSO1NnkOUDl2Ib4L/P+GH+KEtnu7doBA2iAHV/ZuRtWbuzgKYRZK3hkrZITwxU3saWpXDcxIYKsRgAPAbTzpNdMKfJlSPRCk+VMtoSAtEOhq6FFxHzIUgLuGcObpKwsvw9z2KxkGenMrzoK2sQVm4ifL3NW1KPkq9VNuVDhicfXjNdzrRVuypl4I7eTfnN1p0QBgD+y5sH6WMJjBuFTy1VjQA5F5FXXFn9SuJyTkASHAzLl8Wp28GfN/35Soh8m5/5+RW6cWNkC4dPW8D6Eab3bHMBatdRquZCBw4oIEymKOUaCEBKNerjyYEt37M8w3PfjD1H1+wc2FwhQ== 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=TfYGQB86xdKIbx/pdqoAH4P0uYpNwcIp19SBSo2oYUU=; b=Rn0VcFH/1MulZeDCJn2PghO8BcSHX4praq1xZoVm5kB8aG8TIL/2PxVWBBFsg+B/Qy10vb3eDYo0EJhJDg7/0+YPgLDZbW3TNgDTnQyqs/8+sHDZ500XiQ9So06rS1pG/bBqZgMtt48ynJVKhoZ/0Q7qlHRMO3R1s6FqwRPUBgM= 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 VI1PR04MB7023.eurprd04.prod.outlook.com (2603:10a6:800:12f::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.17; Fri, 23 Sep 2022 16:33:42 +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.5632.021; Fri, 23 Sep 2022 16:33:42 +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, Horatiu Vultur , 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 , linux-kernel@vger.kernel.org Subject: [PATCH v2 net-next 07/12] net: dsa: sja1105: deny tc-taprio changes to per-tc max SDU Date: Fri, 23 Sep 2022 19:33:05 +0300 Message-Id: <20220923163310.3192733-8-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220923163310.3192733-1-vladimir.oltean@nxp.com> References: <20220923163310.3192733-1-vladimir.oltean@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: AM0PR10CA0029.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:17c::39) To VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB5136:EE_|VI1PR04MB7023:EE_ X-MS-Office365-Filtering-Correlation-Id: d442722d-9d1a-4b5c-e78d-08da9d816093 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9SitFuDSQIRWAAdWT3uaHND+KHiCPl93oVJ9AxF4Lcvw9G/a3GQSCC+JqQTAyFcni4WjyaukJZuP7IJEC60Rj+Y9lNEBo0jHGR8iZrmqZ6iHK83lWiAMnPoHyPSD0rJT0/S1qH7wFTj1NkcJ7B8DJdnBIpO6v2xmIQ6UXl8mXC2j/Lb+M3UBUBfxjvibJJ4FhbGg3XJMQoWLegOPxc6LSKSKR5+dfSzHLqzSRZ0NOoypCsK47+QREvg/TAbTLijuQqIi3eLrGzB6BPr1qbmThu36k16EDAA/6JLsTioJExJz/FhKHRJuy19Dw31FjWcQJdR+ieExuoVmuyxRjF42UtmFhvqFWGVRSFTNLj+ovWWjuR1UlAEEdZsz1BcFml/2er9pJDvKhi6S3++0Bo8yW+VidycLnEgFquMufqLhBOxNe+Py+HAcgImjWMFu7T9CFoFFqxoxtp5bp14BGni9NzhK9Tpi3V169WjV5PlE+gXHZkPQhjHXIu+5dvBxslDNj6QQaBupBzZcL/oMFPUqybliIDYEMN6uWVrSSUGhsUKQLYx6GB/OXJK04Kb/VHZn0oPYUMrOdrjYs6uCRzPXgMEGuKG5853eYea5JeJgEoLm+osKGtDOH7leAKLhrwRhpPJ3HTe33mzyEU5JuAR6WAc8NL/9YrB503S6CiPL18T5bxCBOCG+jV+HWq/fdvRSx7UygE4SyhsDfykJjL29HcOWUniaRnPjAbZzVXf6BwTGXTTZLQPDV/VUY86+L/3NBUu17spFzM1pC4uv+lf4dw== 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)(366004)(346002)(39860400002)(136003)(376002)(396003)(451199015)(478600001)(6486002)(54906003)(4326008)(66556008)(66946007)(6512007)(6506007)(8936002)(66476007)(41300700001)(6666004)(26005)(7416002)(44832011)(8676002)(316002)(5660300002)(36756003)(6916009)(186003)(2906002)(2616005)(86362001)(52116002)(83380400001)(38350700002)(38100700002)(1076003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?mdp9B6vuBHFVWyiMT+o98J5D/ZjyuyOC+rml8g9x/0kV39MQJQip8o4J16xX?= =?us-ascii?Q?7ZkQWlMNhvk3ynzZRR9d+8rA2v5Ca5jiY5285LfRFFBuH0FNADeLThIlVR9g?= =?us-ascii?Q?jnRPo3FMiF6ym1L5UCSvlk8nRa7pRusFSbS0TWlii1mb0frE6LVUjpyrRbP+?= =?us-ascii?Q?tMj+sGOwE6iFcBfsyPjrPobAV+DGzFKcQSkB7k3I4qjXkQmiy/qCQQHHL1RS?= =?us-ascii?Q?Tl1DoaubAcA5oYi+u5IYE9pcEcuVBPBNKBW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?hIyOj0mglc4s6M0m6mpBAC2mdPrFKwmc76IJjBlynkSDJJiTEeZSQqj6RUlx?= =?us-ascii?Q?rD/37U2Z7Yt3bD2tNyS9QTNvSOR+g7oqS6Ciqne7mtszfDZIZc1O/rcqoJkg?= =?us-ascii?Q?zxvyVDMYbWqaW1A9pw6bIEUTRMPdR63DJDa6O1Q2nIlNPISl31UFzOEQ7X/g?= =?us-ascii?Q?WGhL3DoViveRm/ZVV5D87SfsPb0K/ZWiXKN/bjDJ/YPnxgWp1r+OPxqbYJvM?= =?us-ascii?Q?tZM2LQYo64NexH/JzIj/kjy/ocm7wu9CdKGWQze8c5jx7Lytcu9wFOgC+Cb5?= =?us-ascii?Q?7Pf0IPlAoF5FHr0DM1zqVgV9V5qc3/5YqaJ0SwEgGSiHJ87NhfWzWxyPwM1H?= =?us-ascii?Q?lrsvOuFu/KreDxRILjv49tzLTctJlnXRKPf9S00B3rS3nIpKgLPmWJrlzMP7?= =?us-ascii?Q?JGLDTEXYmBEPCmGeZ+Htg/pa1p6rapoC/zTBFLPW/kJonvzN4tQpMUiFHQZq?= =?us-ascii?Q?rg=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d442722d-9d1a-4b5c-e78d-08da9d816093 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2022 16:33:42.4869 (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: nWE7ybO5DnvfsyCjZtY/ZvAyFXy0VzjuhfzGfRd0GcCi7iNY5eFrwaVjwyoHl7nXxjsGxJuI/bqgvxAZWyKCBQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB7023 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- v1->v2: none 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