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 6AE9145D51; Wed, 20 Nov 2024 11:51:36 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5B1C142F55; Wed, 20 Nov 2024 11:51:36 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by mails.dpdk.org (Postfix) with ESMTP id BD2E540E36 for ; Wed, 20 Nov 2024 11:51:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732099895; x=1763635895; h=message-id:date:subject:to:references:from:in-reply-to: mime-version; bh=gEC4o1/LyWULNf5DE6+7GgeY6Uoi0GtQHyG9EkxALrE=; b=jl6wXfTNFJHmw3RX/G8Zq4LPbPkiDPFjN3w1PrymAjFO8wXUGqFKceL1 msyHGEfO4dHFwBSxmRjAkTcXHmZmqwyLpAcmTMvJ6048/sNbkAYnV7NQv ZB+GJn5k1MMVTJ9Zva2IVYIpIf4eLwd/f1ZiUOFMuQ6BdEVSr4FWE52ZH CFpZB52/aG28hPOoB+W26tljcM1SMAz+iy9r3B2mF9kF6WYhSiIBdtfL7 lmRX2xtLKY8x+L/EQgYxTNTotFkmI8VVsNEMTLv6+ej6B3iqZN3JnYdlV XIGXPy/h4rryv81JMsZomYnmYHfh3KH+cJ0hGHhes3lAZdxZE0OoOdFI+ Q==; X-CSE-ConnectionGUID: wIPekr9VRnyq4XCEeKEwbg== X-CSE-MsgGUID: qZy4QTWIQyetdKW4ghJEMQ== X-IronPort-AV: E=McAfee;i="6700,10204,11261"; a="42771406" X-IronPort-AV: E=Sophos;i="6.12,169,1728975600"; d="scan'208,217";a="42771406" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Nov 2024 02:51:33 -0800 X-CSE-ConnectionGUID: CoHERsuqQHy/ihhy3AUeBA== X-CSE-MsgGUID: 0NgvbvSlQsCjCHcEzE7fBQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,169,1728975600"; d="scan'208,217";a="94810291" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orviesa005.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 20 Nov 2024 02:51:33 -0800 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 20 Nov 2024 02:51:32 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Wed, 20 Nov 2024 02:51:32 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.175) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 20 Nov 2024 02:51:32 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vZsLGort8DmyOHFu6fpTOhp07kPhfsfv9uxhDjy/fha7IwqfNB/uVDpRtO5tiIUzAVj78/AzbpfsqTh1ALPjOq0BxG27vlVKT3q5kX0YufI8T9VfzeQynY+YpL10JWnWI+VumV8+GVY7YVEjRk5KurCbz3mWh1gmIvdANd/HcIZCn8HYthi/23SoavHYukffn44rG7pkMjdYvPZNKF2FC+Ben5opVJNozMVp9aAiljsj8c2LgSZ19Wi7CRLn3bJshxC9HtnlnNXVxGFOu6RrOV8OBIvxIfo6OSjyOp/0CMVUCMRZ54lLcOOPnpjiNVzHU2BqTzvSTurMxkJwy+0j3w== 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=I5GihVfClNWWQTXMWSw2U+sdSXWJZzGUeRS0nJsfflk=; b=ppg64afI0EvgoBI9itCwHYHqIsUCltIqW8PC+dNYAmRAY0uHj1Wg8RGQawfwJyQ98xnhKAD9s1UcXrE8Fprma5JC+Xz7pag/abstLUi45TZYfO8ouWvsvm/GLWpuDpWqtzDEhyZ/l3LxZq7He6ifhnMRQxUhIcAf8V/MQSWOmWdYnzi4wUH1nvj0k+HwlXvFDLRZ0LwvIPkWjD/10gI8WoUZDpW4XwcJZZRpZk5ULi+ZEoW2yMByvsDIaeowVXLr09le8Yr7OyTq9VmotYt8kBNkDdFXnQ4BI2ThT8nX0gkq4wNDZbyLUq5uFEE4ldwjY+94LlX7H7FScPK6G2mODg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from SJ0PR11MB5772.namprd11.prod.outlook.com (2603:10b6:a03:422::8) by PH7PR11MB7499.namprd11.prod.outlook.com (2603:10b6:510:278::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.22; Wed, 20 Nov 2024 10:51:29 +0000 Received: from SJ0PR11MB5772.namprd11.prod.outlook.com ([fe80::5851:319:3da6:850b]) by SJ0PR11MB5772.namprd11.prod.outlook.com ([fe80::5851:319:3da6:850b%3]) with mapi id 15.20.8158.023; Wed, 20 Nov 2024 10:51:29 +0000 Content-Type: multipart/alternative; boundary="------------Tv5Kvos1ITOBkr49o20lNT5v" Message-ID: Date: Wed, 20 Nov 2024 10:51:26 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v10 21/21] hash: remove use of VLAs by using standard arrays To: Andre Muezerie , References: <1713397319-26135-1-git-send-email-roretzla@linux.microsoft.com> <1732072401-15962-1-git-send-email-andremue@linux.microsoft.com> <1732072401-15962-22-git-send-email-andremue@linux.microsoft.com> Content-Language: en-US From: "Medvedkin, Vladimir" In-Reply-To: <1732072401-15962-22-git-send-email-andremue@linux.microsoft.com> X-ClientProxiedBy: DU7P194CA0002.EURP194.PROD.OUTLOOK.COM (2603:10a6:10:553::33) To SJ0PR11MB5772.namprd11.prod.outlook.com (2603:10b6:a03:422::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR11MB5772:EE_|PH7PR11MB7499:EE_ X-MS-Office365-Filtering-Correlation-Id: 7be1a84e-1f92-46ef-ad11-08dd095149fe X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|366016|8096899003|7053199007; X-Microsoft-Antispam-Message-Info: =?utf-8?B?K0FSVk1TaElCUkhIU08rMEJ4SFVxV3BLbk54TklzM0JMM0JxM0xaVFZsTzdV?= =?utf-8?B?QU5NMklEVFYrRFluY2h5YVR5MnhHalU1eTJ1TWUremJoVFdLbWRpM3hIbGQy?= =?utf-8?B?YzAvbkJJbysvd2JsMDcvY3I2R0ZMZlF6eDZjVkdDeWVySC9IZzBJVzU4Sm1y?= =?utf-8?B?OXpCa3d1bExVM2RSaVZMd2FSdC9lR0lFcE5SRzRjMW5SUE41Nm1zQTZQS1lV?= =?utf-8?B?Q1lGcGlCaEdQOHR1WEdReXpMWktpY3JwcHIvUWZRcnVCYU13WWNBaXFwMGxU?= =?utf-8?B?ZUVpejJvbmUvZENaZ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2wxTGF1UHNPMHpWUHZCK0ZZMG9qdmQxUVMraWlwQU4wRkxH?= =?utf-8?B?MmhoOTNKOXNSOU8xcjR4dkwrYmJUTk5Ua0wyS1RMVTg3bVM2TVRyaTR4Zm1x?= =?utf-8?B?M1Ntb1BFQmR5S1pVaUR2Y1puWW40b0duT1l4Y0V6S2l4NU1xQVhlY01RclZK?= =?utf-8?B?dFVzRlErdExDdi9Bd09xdHJCb3FZeSszWEMweUEwYzBmZnI0LzFSTVc5Zys4?= =?utf-8?B?VU1Eb1hPeUV0aFlEVEc0R0lodFFrZ1l1akYvRC9wNm1YOFF0T1g0Q1lYdVlk?= =?utf-8?B?WVFCY3VZekU4bktONEdUQjNyMmVUam9DOVh1dHg0d3h3V00vVGk4ajkxYmtO?= =?utf-8?B?T21SUXVPcVg5U3lVODhjV0FRZ3ZCcUZ2NUhzVzNCVmdUc2c2VmlsYnY4enBS?= =?utf-8?B?MnVERlp2L1VBT1VpQWJhVVRTNm5tQ3dFSFIvZU1EdmtGTjE3ZnZGSFRZeFFP?= =?utf-8?B?KzZaQmxUTFJBWFFCbVJhZmphSHV4clpyTlpYYmU5ZnhqTUJwYlFzQ1hVdkFt?= =?utf-8?Q?i3LFll4XxW4VRgdVXqP8yJeGEoejKR+WJJWHPQa?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR11MB5772.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(376014)(366016)(8096899003)(7053199007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RmgzTHFNczRJa3liczFxcjJUbGVhMW9VSkJXWnlGSGJkODRTMjBuYjRyWk9Q?= =?utf-8?B?NFFTd3pSdDF3VHlpZ2d6ZGdyVXdwUkM5QUxvVU91eWg4UUdneHZPMktmeEhI?= =?utf-8?B?K2N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k2SW9S?= =?utf-8?B?d1VsRU4za3p6eTJLbDQ1WU9rNlNKTHF5cXJidlhtVm1lOERJZXB5M0J5NW1D?= =?utf-8?B?OXc5R1poWVlJeXcxdDU4UW1sc2tIc2tDVjFmUW52WnozdmdEdkd3bXpOWVRl?= =?utf-8?B?MEdMUEZOU3Y5VGRVUG1OaUM3WXdoWld6clhscHFyczBNbXNIZC9JMUxMUHBj?= =?utf-8?B?cmVYVjhPaDc2dlJuZzhkQVl4VGRGZ2cxNVdnNURmS3pjTEhjU1pTQUN3U1hM?= =?utf-8?B?dmc9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: 7be1a84e-1f92-46ef-ad11-08dd095149fe X-MS-Exchange-CrossTenant-AuthSource: SJ0PR11MB5772.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Nov 2024 10:51:29.5785 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: z85iJFUdjdLE6IL8cGwm9e4ISPaAhlVuDtP9oaRULRS+216sSzP/uNzbjfCr8ItP8MO6dpElGdaAaExucFyQ/UYAfwqh3vicO2kPdMmr8cQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB7499 X-OriginatorOrg: intel.com 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 --------------Tv5Kvos1ITOBkr49o20lNT5v Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit Hi Andre, On 20/11/2024 03:13, Andre Muezerie wrote: > MSVC does not support VLAs, replace VLAs with standard C arrays. > > Signed-off-by: Andre Muezerie > --- > lib/hash/rte_thash_gf2_poly_math.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/lib/hash/rte_thash_gf2_poly_math.c b/lib/hash/rte_thash_gf2_poly_math.c > index 1c62974e71..cf7c7d396c 100644 > --- a/lib/hash/rte_thash_gf2_poly_math.c > +++ b/lib/hash/rte_thash_gf2_poly_math.c > @@ -8,6 +8,7 @@ > #include > #include > > +#define MAX_POLY_DEGREE 32 > #define MAX_TOEPLITZ_KEY_LENGTH 64 > RTE_LOG_REGISTER_SUFFIX(thash_poly_logtype, thash_poly, INFO); > #define RTE_LOGTYPE_HASH thash_poly_logtype > @@ -149,7 +150,7 @@ gf2_pow(uint32_t a, uint32_t pow, uint32_t r, int degree) > static uint32_t > __thash_get_rand_poly(int poly_degree) > { > - uint32_t roots[poly_degree]; > + uint32_t roots[MAX_POLY_DEGREE]; > uint32_t rnd; > uint32_t ret_poly = 0; > int i, j; > @@ -194,7 +195,7 @@ __thash_get_rand_poly(int poly_degree) > * Get coefficients of the polynomial for > * (x - roots[0])(x - roots[1])...(x - roots[n]) > */ > - uint32_t poly_coefficients[poly_degree + 1]; > + uint32_t poly_coefficients[MAX_POLY_DEGREE + 1]; > for (i = 0; i <= poly_degree; i++) > poly_coefficients[i] = 0; Since poly_coefficients is not a VLA anymore you can initializeit with zeros and get rid of the loop > > @@ -247,7 +248,7 @@ thash_get_rand_poly(uint32_t poly_degree) > { > uint32_t ret_poly; > > - if (poly_degree > 32) { > + if (poly_degree > MAX_POLY_DEGREE) { > HASH_LOG(ERR, "Wrong polynomial degree %d, must be in range [1, 32]", poly_degree); > return 0; > } -- Regards, Vladimir --------------Tv5Kvos1ITOBkr49o20lNT5v Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: 7bit

Hi Andre,

On 20/11/2024 03:13, Andre Muezerie wrote:
MSVC does not support VLAs, replace VLAs with standard C arrays.

Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com>
---
 lib/hash/rte_thash_gf2_poly_math.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/hash/rte_thash_gf2_poly_math.c b/lib/hash/rte_thash_gf2_poly_math.c
index 1c62974e71..cf7c7d396c 100644
--- a/lib/hash/rte_thash_gf2_poly_math.c
+++ b/lib/hash/rte_thash_gf2_poly_math.c
@@ -8,6 +8,7 @@
 #include <rte_thash.h>
 #include <rte_log.h>
 
+#define MAX_POLY_DEGREE 32
 #define MAX_TOEPLITZ_KEY_LENGTH 64
 RTE_LOG_REGISTER_SUFFIX(thash_poly_logtype, thash_poly, INFO);
 #define RTE_LOGTYPE_HASH thash_poly_logtype
@@ -149,7 +150,7 @@ gf2_pow(uint32_t a, uint32_t pow, uint32_t r, int degree)
 static uint32_t
 __thash_get_rand_poly(int poly_degree)
 {
-	uint32_t roots[poly_degree];
+	uint32_t roots[MAX_POLY_DEGREE];
 	uint32_t rnd;
 	uint32_t ret_poly = 0;
 	int i, j;
@@ -194,7 +195,7 @@ __thash_get_rand_poly(int poly_degree)
 	 * Get coefficients of the polynomial for
 	 * (x - roots[0])(x - roots[1])...(x - roots[n])
 	 */
-	uint32_t poly_coefficients[poly_degree + 1];
+	uint32_t poly_coefficients[MAX_POLY_DEGREE + 1];
 	for (i = 0; i <= poly_degree; i++)
 		poly_coefficients[i] = 0;
Since poly_coefficients is not a VLA anymore you can initialize it with zeros and get rid of the loop
 
@@ -247,7 +248,7 @@ thash_get_rand_poly(uint32_t poly_degree)
 {
 	uint32_t ret_poly;
 
-	if (poly_degree > 32) {
+	if (poly_degree > MAX_POLY_DEGREE) {
 		HASH_LOG(ERR, "Wrong polynomial degree %d, must be in range [1, 32]", poly_degree);
 		return 0;
 	}
-- 
Regards,
Vladimir
--------------Tv5Kvos1ITOBkr49o20lNT5v--