Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2597778rwd; Wed, 14 Jun 2023 05:13:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6jg5DfkN7Be4iXw9fjov73Cr70t4AHN0DqoEJwwuX8nqMc4/gjVKLcZMdKVN7a01j7JLFu X-Received: by 2002:a05:6a00:2d83:b0:64d:3e99:83a5 with SMTP id fb3-20020a056a002d8300b0064d3e9983a5mr2222751pfb.26.1686744789589; Wed, 14 Jun 2023 05:13:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1686744789; cv=pass; d=google.com; s=arc-20160816; b=Xdpj3EQnFxYlu+ol4e9ickaQmICgtT7kE00RJWrtlx+gKx0fhQyKwDp1Eng/QS7U28 Ffie7QcUD+BLj6jlNDgt2z2Cz5LrLgQ7zlrTSsDuQJSuQPTZeLKxb6K0k//Bww1YEir9 Y6RD0hhCTHjtz0yphNAvaZx8ler0UaTZAAxVLdjC1Qmfi4jmEswFtyxVvKtwf1k4J3A8 tMorSHVrjVZ1POut8FlpToAMMf96ln+N4yX6rG8IwYtlAuGv0CeZzxEKVfguDe79I2jO YoZeyhTtJyQEV8g1z8XPghgshN81RFdPnI0KoSc3uUdr9F9KVv3Z6VnFuBXbyOrz4oJa yKcQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=nvCd7EA2J+5UnWdxM+dfYavJ1XqdnpKONVHMuz/62tE=; b=zA9RK8mnZiM8vu/NTc4bGOS3eiVAttglvy4I7EJ4SzL4BXsii56af13xqKsV4634+J 5B/2NbKy5TPWErhEkqAhRW5FvWmwe2UbV51IsUWmRcyV+K8kbkFgurIuQxO7nL6sbvYr huq4avh6CJunTMdsSB5aOw9ZtN1erloXw8iWboJe5o+mXfvPBg5yjcOpCfZsJdErakut kq4laXyxNcgR+teOSwE+VLuPXLead05TI/S406P/L6uAIIfcdH2G/nP2+W5NCxnXiD3b sRQbbKpoEHzcwDvU+J9rj8+g1II1s61P4HR8wI/2G1shyw+zukqYrLwEooBkL8bFSbCL E+Qw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@corigine.onmicrosoft.com header.s=selector2-corigine-onmicrosoft-com header.b=lWMSEF5K; arc=pass (i=1 spf=pass spfdomain=corigine.com dkim=pass dkdomain=corigine.com dmarc=pass fromdomain=corigine.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=fail (p=NONE sp=NONE dis=NONE) header.from=corigine.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y9-20020aa79ae9000000b0066669c4e9e9si755903pfp.143.2023.06.14.05.12.57; Wed, 14 Jun 2023 05:13:09 -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=@corigine.onmicrosoft.com header.s=selector2-corigine-onmicrosoft-com header.b=lWMSEF5K; arc=pass (i=1 spf=pass spfdomain=corigine.com dkim=pass dkdomain=corigine.com dmarc=pass fromdomain=corigine.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=fail (p=NONE sp=NONE dis=NONE) header.from=corigine.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244388AbjFNMF2 (ORCPT + 99 others); Wed, 14 Jun 2023 08:05:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244279AbjFNMF1 (ORCPT ); Wed, 14 Jun 2023 08:05:27 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2127.outbound.protection.outlook.com [40.107.243.127]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 346BB19A7; Wed, 14 Jun 2023 05:05:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bP91zbEfEVU6ExxHs4HFPFAQv5jErNfB4oFHZu1AhienoTcNukuE7Kbh9UsrH2Buf97wWvxWkYHFAGPYXHN/tzWUsE391R8IBSlPwFeohLaFlbqkcueLb9itixmkQ95h0IGVzqgWer3w8+U585hJvqAttzp91Zw/IK/t+Fe/PYW7XYbFK1GSm1cgqBDG3+cg0WbPqE+PvhC/mk1f7h7TAoYJr0g/F4BZIVDhxCwC3vtjmp+TvkoYSZhClikKN36HiZ2AC/hhgQRUrYnWO0q1o/loq+NMbqK17BG2j/H0q8WoJI3ceJswZORYIvnYMpmHLnedA1Wowjsx+4UYL4YdRg== 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=nvCd7EA2J+5UnWdxM+dfYavJ1XqdnpKONVHMuz/62tE=; b=fTKKG3veLwr0kWjj1Jj2gPUFK1fJar00Y0agMvbCTgluXL8QnoberpqZ4KeApLJgvHvyYHQmDQhgAf/hQ+mpHxjZtwrSBVlKGpj+faQ2njyh2HG0Tx8ws6UTM9UU3b7GuixwbVSrVYUAyQIpXlRGqNSstJU0cGHcNIfjhyOPhkOstTdT3N0JOvJiO/ZCfG0XAwqsL/zmmpwlNXAxj20wGBsVw8mj+H++8lWqqItRlx1S6fUQT1FWssu8rtQRloAhpmY1OB5mkyvO1Zm/YlnsgK5TVn3+nFA+L6VQc4Ur8GoDmaWGDFqnDgL+hhRPE4bVqDsLTNsHYO4KOBHhsVImUw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nvCd7EA2J+5UnWdxM+dfYavJ1XqdnpKONVHMuz/62tE=; b=lWMSEF5K83wvsCsiCaqW2iPZYM0dygn9zbLgnMaqy6I4WICllUUbTlkIi0jjGWvT1H0pwIJeid4w0/+UGyl2DsU5AVTHqiZ42OMiCe2AzfC+n88TG3RyPEaRh2HOwOtaiRFfiClqFpWpurhhaSaEKKo6UQQUQsqabHEp2mOpNnA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by BL3PR13MB5164.namprd13.prod.outlook.com (2603:10b6:208:33b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.37; Wed, 14 Jun 2023 12:05:22 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::eb8f:e482:76e0:fe6e]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::eb8f:e482:76e0:fe6e%4]) with mapi id 15.20.6477.028; Wed, 14 Jun 2023 12:05:22 +0000 Date: Wed, 14 Jun 2023 14:05:15 +0200 From: Simon Horman To: Vladimir Oltean Cc: netdev@vger.kernel.org, Andrew Lunn , Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Xiaoliang Yang , linux-kernel@vger.kernel.org Subject: Re: [PATCH net] net: dsa: felix: fix taprio guard band overflow at 10Mbps with jumbo frames Message-ID: References: <20230613170907.2413559-1-vladimir.oltean@nxp.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230613170907.2413559-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AS4PR10CA0002.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:5dc::19) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR13MB4842:EE_|BL3PR13MB5164:EE_ X-MS-Office365-Filtering-Correlation-Id: edfcd88f-a503-43ad-01c0-08db6ccfa154 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IYOYco1gjzZDywIVUE75SMVm8FiPz7X7u5O/r5g1t1829/Qq+nOHc/uJy4rUkBIJp2lnjdr6ycjoVkN3MN1Hgo5H64lukQX6/OSgpCREjC7AZ9YXCMbNStNBisrP+jCzt6JA0CgPG1yoYDOwSLtZ9r5T/154I3OQ2OwMzxAQCz5OpGyQMWCvMc6Kub4QuuABqJs9R4p7aoJ4INLjq0g3VocvOUuSHZ53i+rOD8mXycIuwv/YyQnuvWmHd0w1bvrRgV9BuRSoD3Nu5eamgW4Qw6A3KKSdDbwqYEz+zWdeKTCbYn8fdqpnSCObXHIfdBWayXU9/zWaNYh4LWwk9a+UQ57iQjQK8cgCAjOiNpIYdbGCt5EdzjPS4UNFx0DycKvN9BdVsSuICQ0NbgCZHJ0ydXbHE8x9vBpw+GwLYyLNJeKMn+NUjb9kcfDiNzfNhBsMsEitN9s5a2tqZqOEmr7IsUUU3XwdwvlS2ebItaH6mMKvEqax7orHU/96OQ/sDPgxF6Cub8ZFipVAsNxWnZn4Cb6TGErAeJ+Gpmt67kREKTsG6j84yNvi2avtM2B/yD+HVRIU6/pyPeilbLafic9kEnVP1/MWnTQ0iRlDfbIEoNY= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(346002)(396003)(136003)(376002)(39840400004)(451199021)(83380400001)(5660300002)(186003)(6506007)(44832011)(2906002)(2616005)(7416002)(41300700001)(6512007)(8936002)(8676002)(6486002)(316002)(54906003)(6666004)(36756003)(478600001)(38100700002)(86362001)(4326008)(66476007)(66556008)(66946007)(6916009);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?K46lUTkJCKmx1g1UmB2YoLISIEWJjl4vgPVXyLpWil4HY0WIPijy72iHH7Ox?= =?us-ascii?Q?RS+dpYh3AM/PpkIw728ou3LURsndLFJTHCeTUqxgSxR8FoqN7DdIxcc+T8Jz?= =?us-ascii?Q?irPxvjNYvp+Ql0az1M7OXlENW1V3uLWferGd1G7Zu8nnA9NwLPcDlmI5P1Oh?= =?us-ascii?Q?QjvdgRQI/Q+sUbFK8XVjOvwflUnduyklyiyL1NgU/M5s4iUxB16XAkH9OBBS?= =?us-ascii?Q?bj2ivLYJJiIGyziHln8RRW3dccY+B4WDwTL1D9kUjnn47EIqFr6EPpsjVFKy?= =?us-ascii?Q?HvKql9fMdaAdepWXzY/SQ+Cc/cD6eYvGeiq5wRrlII638TskmVONnQCGXGd6?= =?us-ascii?Q?o03ZN0gvBzNEfqvfe3pVB3l/1qU5ZWoMA3H/R/+xkTh3ilIIxQNC/mlqNl+Y?= =?us-ascii?Q?sDH+4qwGWcpa8DJChb13vshk1bvl6aCLm0eJUkJ14ei0mEfHtuoG+7zmMaWq?= =?us-ascii?Q?GMtkUzSBvyQ+lsnbGMGR5OGXFReJ9PMMUxA+sA5Hq8XWFq6qvVQzKpScYXnI?= =?us-ascii?Q?M21mdm+rl6SBzdFiN9AvF/OayS3W7v6wH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us-ascii?Q?VWDODmcTT8TgtCRZ0OOqRGOoZidfHDfGjU+vEnezO438QL0wA91wdt0dXc0o?= =?us-ascii?Q?ag5UlV4EQ9m137dZcQHhu7Qo7Wo5/vKaS1Sm2n7D5Fp6CO1kjjdIQACDCXVj?= =?us-ascii?Q?JihEzgGioYy7GYW3Mf1FusCg5cBi3j4zATYh8inCpM6XcGpUD6VRa1tUEest?= =?us-ascii?Q?5cHIPPNm0z80CG5UAaZA50sD/Bauv9V+PglP7o/4JQX/AYgD2OTk/1isWY8D?= =?us-ascii?Q?pyj0Bw=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: edfcd88f-a503-43ad-01c0-08db6ccfa154 X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2023 12:05:22.5309 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: htt/KK9gpD0cbfKD9XdNiXFStPlz4ir2Lbl8hywciyb/CERjqkmArWL5oRMv2WFKNQloeuhqQZIiiEXI7gL70TNThUc6FHCN/jZ9EqS1eD8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR13MB5164 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 On Tue, Jun 13, 2023 at 08:09:07PM +0300, Vladimir Oltean wrote: > The DEV_MAC_MAXLEN_CFG register contains a 16-bit value - up to 65535. > Plus 2 * VLAN_HLEN (4), that is up to 65543. > > The picos_per_byte variable is the largest when "speed" is lowest - > SPEED_10 = 10. In that case it is (1000000L * 8) / 10 = 800000. > > Their product - 52434400000 - exceeds 32 bits, which is a problem, > because apparently, a multiplication between two 32-bit factors is > evaluated as 32-bit before being assigned to a 64-bit variable. > In fact it's a problem for any MTU value larger than 5368. > > Cast one of the factors of the multiplication to u64 to force the > multiplication to take place on 64 bits. > > Issue found by Coverity. > > Fixes: 55a515b1f5a9 ("net: dsa: felix: drop oversized frames with tc-taprio instead of hanging the port") > Signed-off-by: Vladimir Oltean Reviewed-by: Simon Horman In a similar vein, you may want to consider the following suggestion from Coccinelle. .../felix_vsc9959.c:1382:2-8: WARNING: do_div() does a 64-by-32 division, please consider using div64_u64 instead.