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 8D3ED45B2E; Sun, 13 Oct 2024 14:06:33 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 19D8D402A1; Sun, 13 Oct 2024 14:06:33 +0200 (CEST) Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2072.outbound.protection.outlook.com [40.107.105.72]) by mails.dpdk.org (Postfix) with ESMTP id B70EC40273 for ; Sun, 13 Oct 2024 14:06:31 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MVo2D8wSYsLadrftMTALxAZHiSR51e/VLxkeDZAw8jw3D8BTzPjcRDIDTYVULJSKD9xYp+1+o3daxiXDC5IlX72clyJ25MfASOM15B7Un3GcBSKW5p6Uui5MaQAQXPpbzxRcuPMpB3ntlMsPk8ZWes1rLPylm5HIgzPQotsp4wI4Hc30fcrEvggAci/WTeHNmepC62kd7uReHyT3J19lYrm1lC3t3O86GS+dzmYoegPorAsHi1GonhCGppC2aHbMgHMVxBlaFIH6eP4B+g7PE5C6sWOmgEeSsgbm+a8RCXulTbtxk3O9gY11ESzOB++jHt/2OMmkkIDMFRpC/cPudQ== 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=mVUr7xkwvImewCySyQmOjjguVMJqwJde1OLKP7jM1b4=; b=E718gj17Qi7qu2ty5IRxFKUpCITRhjNQFwgkDy2Vd6L0uw/pyUG4IccCxV7+P6pbUA01xAKwrKzwhKls0rwAlKu2VW5JZIK5MbNGRbrKgrPvYYM8qCxofWMh0lfKw9dD5gGXecMT4jBbPRY5F4eAJnIjY2Jdr2wUa5HuD459y5/PEOgZyGrN/nqY/6dkqn+ZmeCJ1U5AgxOiunc7EYBzqAn9W2f3Z2N2lDPlBAe0QgCqsuSoWxDHiO+fd0taPKj814IGXWKQXGg2TRE1fFjMQmnOW74PoiAjCYj1soaPviSqUZRTpXdYfF8+s9+8Cc9pLcWPS+iPjZ8nVPyMqXchDQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 192.176.1.74) smtp.rcpttodomain=dpdk.org smtp.mailfrom=ericsson.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=ericsson.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mVUr7xkwvImewCySyQmOjjguVMJqwJde1OLKP7jM1b4=; b=ysRHh4hhFfe41ag4VXcGHOy/v7DYDvB1LDB+rhxPMSG0qlT0Hgtby7oIgVjr0Ty9BbHDDWRA6hAdznZp6e+MyBbd7O8DtbfxJcO3D+IJbfsofh1fBsRSxAw7uHmHkpEv6y919Bvi9QSNjhJnYiS3Ub4S4pQa3zcmrlaaP+jQJehZfXaEebdDn6b3aj2QxMDTkuWJ+LIt5KZmh9MEaaqvLzbC3rA2a4ARrChzd9GKi9+CJoFLUa4BI1dexvUCc8HRvmlFEmTYuyxC2ebCYbkno/NuJoSOltjeLW8DlARhtBh3WPzHunF1b35PyKRhdcYPYtWNCGC4RQ2brpv+7KpJ1w== Received: from AS9PR0301CA0052.eurprd03.prod.outlook.com (2603:10a6:20b:469::7) by DU0PR07MB9139.eurprd07.prod.outlook.com (2603:10a6:10:405::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.24; Sun, 13 Oct 2024 12:06:28 +0000 Received: from AM2PEPF0001C715.eurprd05.prod.outlook.com (2603:10a6:20b:469:cafe::8a) by AS9PR0301CA0052.outlook.office365.com (2603:10a6:20b:469::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.24 via Frontend Transport; Sun, 13 Oct 2024 12:06:27 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 192.176.1.74) smtp.mailfrom=ericsson.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ericsson.com; Received-SPF: Pass (protection.outlook.com: domain of ericsson.com designates 192.176.1.74 as permitted sender) receiver=protection.outlook.com; client-ip=192.176.1.74; helo=oa.msg.ericsson.com; pr=C Received: from oa.msg.ericsson.com (192.176.1.74) by AM2PEPF0001C715.mail.protection.outlook.com (10.167.16.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Sun, 13 Oct 2024 12:06:27 +0000 Received: from seliicinfr00050.seli.gic.ericsson.se (153.88.142.248) by smtp-central.internal.ericsson.com (100.87.178.62) with Microsoft SMTP Server id 15.2.1544.11; Sun, 13 Oct 2024 14:06:26 +0200 Received: from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00050.seli.gic.ericsson.se (Postfix) with ESMTP id 932C71C006B; Sun, 13 Oct 2024 14:06:26 +0200 (CEST) From: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= To: David Marchand CC: , , =?UTF-8?q?Morten=20Br=C3=B8rup?= , Luka Jankovic , Thomas Monjalon , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= Subject: [PATCH] bitops: fix issue in parallel atomic tests Date: Sun, 13 Oct 2024 13:57:19 +0200 Message-ID: <20241013115719.820853-1-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM2PEPF0001C715:EE_|DU0PR07MB9139:EE_ X-MS-Office365-Filtering-Correlation-Id: 6364c057-784a-4a0e-c365-08dceb7f771c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?utf-8?B?RjBmUFBoQVc5ZWYzMys1OG8wWm1wY1JZaEk4T1d4cW1wa0xiS3k3MHBKbHQ2?= =?utf-8?B?cUNQb2RaclA0MU9SaEMvb1ozQjFJbk1TMyt3NXlyWG5LdEZoRmphRlJRRlBR?= =?utf-8?B?Mjd0Y25EOGJrMWQwcEo0bWFaLzVMdWl5MEN1VHdKQ1lXL2ZmZy84QlYwT0gv?= =?utf-8?B?YzYwd0FPWnkwR3FOM3U4N2Y1UVoxcCtDOEcrS0JFa21BT0g5ZnB4ZWp4QVdn?= =?utf-8?B?bVZxOTFTdUF2aDJZV3RRWm5jMm5jeHNUQWR0cTdua2hIWjJ6d24zOWFHRGVw?= =?utf-8?B?aE92QnEwNDc4T3JYSmNCdTVTNHpnZGd5RXpSUEZFMlVxbEhPM0NwQWNEenFK?= =?utf-8?B?N2ExRXd5NWhjTW0xRWRYbG5weDR2M3p2eThweHR1TzFGWXVkNXlNMmJCdkNP?= =?utf-8?B?dW0yWHZoR0djUEgySlNRVFJhbXlsUU54d09INFNWaHBYbU9na3VCSDhkTWNR?= =?utf-8?B?VWd3aFlUdytFK2JTTmQxMS9FTTJ5bWlHSDkxSnJRSXM4b01TcFlVU3Fhdk5M?= =?utf-8?B?TGRrT0l5S3ZFRDRaZWJwaUZJK0hLazIyZE5NREUxWFRZakpPYmRoYkRJZTIx?= =?utf-8?B?b3V6Zml5eWQyaWlCNG9oN1BaVytGdStPU0V3TVg5TGxBNGRReU1abnEydmJ6?= =?utf-8?B?L2E2Q1VqNG5mYm5l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-8?B?ZnRHMGJ3MTJzUG85d0lrVCtHb1ZjbFVpZ1VXN0IwNFpwWkt2bE8vcTZHRjNZ?= =?utf-8?B?SDFjSmJpcENic1c1VERLZ3pnT2xoQUl2czhLZ2VTbkVORDVpelZRV05KWjVj?= =?utf-8?B?cFpiN1BGQWJVL0VjL0czUEdrTG1aR1ZXQkREeGJodk52ZjdvdHUvdFZUY2ty?= =?utf-8?B?K3NjR0hNUFYwZ1d5NzVOVmlZU05ITjMybGYvVVBmZGptdVNYclJMZ3V4SG11?= =?utf-8?B?dXllNFFJYWFpUlo5eEtIM2d5QmJaOUZlZnRCNTBkRVVvaSs5dGVtQk9NSWI1?= =?utf-8?Q?QD7K41EeeiSuO?= X-Forefront-Antispam-Report: CIP:192.176.1.74; CTRY:SE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:oa.msg.ericsson.com; PTR:office365.se.ericsson.net; CAT:NONE; SFS:(13230040)(1800799024)(376014)(36860700013)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2024 12:06:27.1046 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6364c057-784a-4a0e-c365-08dceb7f771c X-MS-Exchange-CrossTenant-Id: 92e84ceb-fbfd-47ab-be52-080c6b87953f X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=92e84ceb-fbfd-47ab-be52-080c6b87953f; Ip=[192.176.1.74]; Helo=[oa.msg.ericsson.com] X-MS-Exchange-CrossTenant-AuthSource: AM2PEPF0001C715.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR07MB9139 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 The macros generating the parallel test for atomic test-and- [set|clear|flip] functions used a 64-bit reference word when assuring no neighbouring bits were modified, even when generating code for the 32-bit version of the test. This issue causes spurious test failures on GCC 12.2.0 (the default compiler on for example Debian 12 "bookworm"), when optimization level 2 or higher are used. The test failures do not occur with GCC 11, 12.3 and 13.2. To the author, this looks like a promotion-related compiler bug in GCC 12.2. Fixes: 35326b61aecb ("bitops: add atomic bit operations in new API") Signed-off-by: Mattias Rönnblom --- app/test/test_bitops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/test/test_bitops.c b/app/test/test_bitops.c index 4200073ae4..681e984037 100644 --- a/app/test/test_bitops.c +++ b/app/test/test_bitops.c @@ -227,7 +227,7 @@ test_bit_atomic_parallel_test_and_modify ## size(void) \ bool expected_value = total_flips % 2; \ TEST_ASSERT(expected_value == rte_bit_test(&word, bit), \ "After %"PRId64" flips, the bit value should be %d", total_flips, expected_value); \ - uint64_t expected_word = 0; \ + uint ## size ## _t expected_word = 0; \ rte_bit_assign(&expected_word, bit, expected_value); \ TEST_ASSERT(expected_word == word, "Untouched bits have changed value"); \ return TEST_SUCCESS; \ @@ -275,7 +275,7 @@ test_bit_atomic_parallel_flip ## size(void) \ bool expected_value = total_flips % 2; \ TEST_ASSERT(expected_value == rte_bit_test(&word, bit), \ "After %"PRId64" flips, the bit value should be %d", total_flips, expected_value); \ - uint64_t expected_word = 0; \ + uint ## size ## _t expected_word = 0; \ rte_bit_assign(&expected_word, bit, expected_value); \ TEST_ASSERT(expected_word == word, "Untouched bits have changed value"); \ return TEST_SUCCESS; \ -- 2.43.0