From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C6E6A45A6D; Tue, 1 Oct 2024 00:07:58 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5ADAA40267; Tue, 1 Oct 2024 00:07:58 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2076.outbound.protection.outlook.com [40.107.243.76]) by mails.dpdk.org (Postfix) with ESMTP id 3A08540150 for ; Tue, 1 Oct 2024 00:07:56 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TCm1iJJDDtkl9zEddbY+Zi9dlg0I5lzqWj4yhRYcY191qaBrn1i0PNBTMksAhjmIj6gPyne01YSEABx2waVey5uFGMVubxlFJCy8HV38IZPSUXGMen3IEonulKrxeJ7Rp9zYCI9YIWGxYdxYXKWuJnhlVI+FZuSqQkwpIm6zWbjACZhbQ6zp++l/2yWdQzUS7xMIwljwKHPj5+YuYXLhVO3UbHvG62ncOeTC+JHLw73QIrQk0pnhdg12CsuF4U6oHV4LxVySPgbv6pJSwveFitKK8lFvGFmgfMvlLIZw89DB6hCAvqfM1sCpeHRjbhkXOilartuBR0oQOLfn37dP+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=yU8VpkgVZSTEqGNuGZDG7CddDP4yAHvP/BzlBQltX+A=; b=F1QKpHBUlG6N7492aeuohoxSh3ZHxFIdKy7RS0L4eklJIuruq72z/6hF+wDclJgkHmDVFQkXXKA8IPKrFZTv6KF/De0gllhQczzJklvNdeiGpeTQ3IrBoKnhPplTDmNBgUT7VgMDNEdGe4jm+OfmzY39VTiRc6QtGlrbe2KrzKzfJir9lKqzD5cDyx84qTK9t9D+lNGP8Mk0eBAAz3IL94kZGyK/jcNa1BsOQjT7LdMOSFHkOFXgDXpAHDdxhHrd6g4bCdNCsurK4nXuEFEMxJ8SQ7w3XNwD4AD7Yu5qjtTK30+to31tYZSpSxj0MhoMnopzMEqs42FQ3BYSL7UI7Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yU8VpkgVZSTEqGNuGZDG7CddDP4yAHvP/BzlBQltX+A=; b=Yc1xTyL0bHy7aDOV+yauD+Ruq1W2rr1zyC12UDpBvP84dhwjY3U3lsUDBel6zuTdlhJXN8sq/bYem2H8i2mba39esnx8jIe/KPnRqozfXskAnZlLRAM4i06zQmqnW5QcClt5ViphjpuGMC4506/2YedBOKaPiJQFOvAr4mc91Ts= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from SJ2PR12MB8830.namprd12.prod.outlook.com (2603:10b6:a03:4d0::9) by LV3PR12MB9267.namprd12.prod.outlook.com (2603:10b6:408:211::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.23; Mon, 30 Sep 2024 22:07:54 +0000 Received: from SJ2PR12MB8830.namprd12.prod.outlook.com ([fe80::c3eb:df02:eaa9:2055]) by SJ2PR12MB8830.namprd12.prod.outlook.com ([fe80::c3eb:df02:eaa9:2055%4]) with mapi id 15.20.8005.026; Mon, 30 Sep 2024 22:07:53 +0000 Message-ID: <338ade8d-bcc3-4e0c-9eb1-963c996b2397@amd.com> Date: Mon, 30 Sep 2024 23:07:48 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 1/1] ethdev: fix int overflow in descriptor count logic To: Niall Meade , Thomas Monjalon , Andrew Rybchenko , Roman Zhukov Cc: dev@dpdk.org References: <20240927132329.296038-1-niall.meade@intel.com> <20240930134002.508717-1-niall.meade@intel.com> Content-Language: en-US From: Ferruh Yigit Autocrypt: addr=ferruh.yigit@amd.com; keydata= xsFNBGJDD3EBEAC/M7Tk/DfQSmP1K96vyzdhfSBzlCaGtcxNXorq4fALruqVsD3oi0yfyEz9 4YN8x7py0o9EL8ZdpOX0skc0AMCDAaw033uWhCn0GLMeGRKUbfOAPvL6ecSDvGD7CJIO9j0J eZUvasBgPdM/435PEr9DmC6Ggzdzt8IuG4PoLi5jpFSfcqxZFCCxLUDEo/w0nuguk2FTuYJg B2zEZ4JTBZrw7hIHiFh8D8hr6YA6a5uTofq1tr+l048lbtdFUl8TR0aIExVzE4Z8qKZlcE+9 RQaewjK5Al1jLE4sHdmd3GN+IvgDF3D/fLsi25SKJDeGSdeHkOmaX0qGeM4WKIfU6iARRCiQ N3AmBIxZ/A7UXBKLaOyZ+/i3sE6Wb53nrO4i8+0K2Qwyh6LjTeiJAIjYKN43ppxz3DaI+QwQ vI+uyHr4Gg0Da9EPPz/YyKauSeOZCfCB5gIfICO0j6x0SCl8uQ2nLpjxcZkf0gjcwUzP3h+S 3x6NfDji9YEij0zczW/dcSpGgZ6vsFpPrtnP9ZXy6J53yp0kJtOJoOlkEFFdU2yCZnCDseum CoudmGLZVvS0/DzHDJejq+3kK3FDGktZBOxZIIpal+nFqS7lVgOZc4+huVv3jyhzoAUOEyXA XK5j6o7g8STUY+z33QNnHpdLvecMwuzmvqy0jR54yAbZ64mB9QARAQABzSNGZXJydWggWWln aXQgPGZlcnJ1aC55aWdpdEBhbWQuY29tPsLBlwQTAQgAQQIbAwULCQgHAgYVCgkICwIEFgID AQIeAQIXgAIZARYhBEm7aYjps5XGsPHCElRTPtCKKm/6B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Scp9dIV7fsS5tpDwIs7BZNVM1l3NAdK+DLHqNxKuyO 8Zk= In-Reply-To: <20240930134002.508717-1-niall.meade@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0424.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18b::15) To SJ2PR12MB8830.namprd12.prod.outlook.com (2603:10b6:a03:4d0::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR12MB8830:EE_|LV3PR12MB9267:EE_ X-MS-Office365-Filtering-Correlation-Id: 414daefa-ba5f-4d3c-3601-08dce19c54e0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|366016|1800799024; X-Microsoft-Antispam-Message-Info: =?utf-8?B?SHpqNTJGK01hZlRaUm9KMk9EVG0vTGYrY29vWVRFVkI4ZlYxbDRIYjdmVk5t?= =?utf-8?B?eHA4WWZuWGpmcUowYVgzTTd5WW1ya0ltWFkxcWZ5djlnS2gzeHppVEpmc2Q3?= =?utf-8?B?TytIdUJFajVEOGFYeXBaWWFSeGhYaXhGdG5hUEhVY2sxa09OTTNXaGxWRVJT?= =?utf-8?B?Z2RBb3ZDM1doMndJTmtjYmF2eWQrWU8zN3JjQmxUVFd5QmhobkxBdkYxQThK?= =?utf-8?B?dkNjSnVTUlhKL2FqYiswZjFnSU1zVTRTdEg0UTJYK0J6M1hLZTgrMGZvK3VS?= =?utf-8?B?SDBXSEdEaFFuQU5YRzFrNjVETTM1UlE0TTdQaW9hbmJ2ZHJaTFM2dHROcEUz?= =?utf-8?B?algycmpHR1ZQYlNjTUFuck5taFFkbTV3K2VDYlJCVENJb2VsdVA0eldGMHJJ?= =?utf-8?B?djhCSmt0V3ROZ2pQU2JSOENpOEFDQUhTNjZiSW5td01KaDIvOU1SalN0Z2FF?= =?utf-8?B?aWRydkRaKzJEU2dtcnB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aG9rV1N6OW9GaGRkVm13WG0vOHJyMXloSzRMUkRjeE41aDlVeTRX?= =?utf-8?B?OXJENU5IcGlMT2RnUjNPNEh2akxGdThsdTd6TUtIbHp3OUZYN2hGZUt6dmJm?= =?utf-8?B?Q0FwN0lDVUt6dzBLVGJiNlFGZml2S3VxYi9xMCt0RzhBY05uVS9SQ0RRRjFq?= =?utf-8?B?WmhrSHZDUitaQ1lNOEYyeFRTOVRwT084V3lqTm5hMytDbUV3TmNBMy9hZnVQ?= =?utf-8?B?UGRMRXJkby91L3VDNmhKNG5WUk5rSXJkd2FBOTJ1RnB0L092UWxNSVd4UVpV?= =?utf-8?B?eGU1SGEyQzZraElNL3c2RnQrZVNSbzBiMlNlVVFYNlBxNmVoTGc0UHFNY0ZC?= =?utf-8?B?QUtDY3JiamRkaGNtcEdkcENJWEh1a2ljTmZwSTZTSk0wNzZwL1g0ZWpaWnZ6?= =?utf-8?B?Y09ncElZMnNSTXdxQzJSdz09?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ2PR12MB8830.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(366016)(1800799024); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Vk9nbUtVOWs0Q21IMk1xL3dNZ1luWDhUU0piUUQzRmFxem1NNXphWkcyNU4x?= =?utf-8?B?YXJWeXphaEtlbmtFS1l4RWgyUEdpdmhobk1uZ0dkc0dmVHYxNjdnRzhJSE81?= =?utf-8?B?SnpyOVRoRkduTWtFaXBDaVJ4cVZURzMvUHJETEFxL0xyVEhtcjhiRTJkZzVX?= =?utf-8?B?Z0IzR0xNd0tUdTg0WUFtb0M5ZlMrTmVGVENFcUorazJTSG9rMmpJM0RRLzRZ?= =?utf-8?B?RkxsU1hncnc2SkRjSVZEcUJaRzRBL1dUdFh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zRFNIdVo1bE9ubi9oL01lenUvODFWWGhUSGZnaE0rRDh4WXczdGgw?= =?utf-8?Q?9veUGCPpF9jNUKA78sH+WT+2E?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 414daefa-ba5f-4d3c-3601-08dce19c54e0 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR12MB8830.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2024 22:07:53.7324 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Mu/MsNxnVwUAKTX5SrlYQi+dEN2nIp9V9LwHIs3MmCsJu1Y/rkFZLaDnSASYF4yh X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR12MB9267 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 9/30/2024 2:40 PM, Niall Meade wrote: > Addressed a specific overflow issue in the eth_dev_adjust_nb_desc() > function where the uint16_t variable nb_desc would overflow when its > value was greater than (2^16 - nb_align). This overflow caused nb_desc > to incorrectly wrap around between 0 and nb_align-1, leading to the > function setting nb_desc to nb_min instead of the expected nb_max. > > To give an example, let nb_desc=UINT16_MAX, nb_align=32, nb_max=4096 and > nb_min=64. RTE_ALIGN_CEIL(nb_desc, nb_align) calls > RTE_ALIGN_FLOOR(nb_desc + nb_align - 1, nb_align). This results in an > overflow of nb_desc, leading to nb_desc being set to 30 and then 0 when > the macros return. As a result of this, nb_desc is then set to nb_min > later on. > > The resolution involves upcasting nb_desc to a uint32_t before the > RTE_ALIGN_CEIL macro is applied. This change ensures that the subsequent > call to RTE_ALIGN_FLOOR(nb_desc + (nb_align - 1), nb_align) does not > result in an overflow, as it would when nb_desc is a uint16_t. By using > a uint32_t for these operations, the correct behavior is maintained > without the risk of overflow. > > Fixes: 0f67fc3baeb9 ("ethdev: add function to adjust number of descriptors") > > Signed-off-by: Niall Meade > Reviewed-by: Ferruh Yigit Applied to dpdk-next-net/main, thanks.