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 067D545E41 for ; Sat, 7 Dec 2024 09:10:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F102540281; Sat, 7 Dec 2024 09:10:08 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2050.outbound.protection.outlook.com [40.107.244.50]) by mails.dpdk.org (Postfix) with ESMTP id BC94840281 for ; Sat, 7 Dec 2024 09:10:07 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nfISjW98w2NI3TpImcy8TDLMsabKwPvUZR0ly/87Ly0+/TQqAfHgyxjXfM0D6psr2znhwtAHsaWBXu0o5qrDI3LAdQ6T2qztgaLJ0zS42694W9fh/T3qyWN+EgMh8pre0FRg3aWXyCNNcr4h0W21DgtAc0oP1UIXgZIAuiQMyVdCNNZuF1mH3PkQwMdbmF6cKQxoPKqunv/qDWFUhGJKaScRjkBIBZlUoVt0JI7N6dpep6rPcoyA7+TQJLh3w/JPQCIZF/WWu+Tsf91nt2gf9HtQRbjK5Nc2hRXQ8oPRFUeQKXc19HTtfux0kYx9qIN9G1CxQHIFkfyQ8V1175z5jg== 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=usNfG/59Et9Rqn46vm0r9ffex8/D4sD0/cwwqjeDWZ4=; b=OorUAnTi9X9VgptCAkip0Ag/ov6zNcv9v2H5jTZS1g1U3mvCwgDvwN3V4PRWDh+KtuCnl2mjFryrNmDkY3wQe8JW0M0a0luQgd3KKFzGEcT5dDbFdsfJ5fHexuYJOW3EZRlVGGz9tk3bnW/3Xge21Vc8OjxligLiztO8A8KLbPpMdbCFt7lOlmFOAaGuhO589U6Ws2Il3yTbr4ZCifuVCZsS0mFgpgxQdge9wKKL7YtQQX8Qw++L8HrGLBgByYclaJmmpKQ2o+WamMhrZ8KFHyz38/W1Njr9LF711U9xbK2gsc/u18EudOjuXnS4eiLXR+tNB/R9GL2zBh+I5wcqwA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=networkplumber.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=usNfG/59Et9Rqn46vm0r9ffex8/D4sD0/cwwqjeDWZ4=; b=URrvam31iftNACmYs5MT2hI7RuJ4s2NrTKqszeD0P/HyWqWan5eWt8yd16P9NCukkQGhujzK0XDgQ4IRmqtlrr5rvjjJsasDklu4IRLQK7Ef2OPmP4CxMUz28M0sxT8RCUl/JpsBXRX3F3sQ+3o+r+uFSyBrggQHjHPCMdJU9tWOWSbZ7w7ySxsUEigDItTbTaZGSBEaSdeRm5nJV0g/llvrhKGLF02EBJNncdHMCXWsIP7mYzjmHFaOlS4ugFWL8T7MzDxTTwzalqiCawAq0GhuAtFxVS/En/r6IGZyvtV3jbaEjF/zURGmXHZvz5jaq927IJnXc6ahtfOzRbEO/g== Received: from MN2PR15CA0006.namprd15.prod.outlook.com (2603:10b6:208:1b4::19) by DM6PR12MB4281.namprd12.prod.outlook.com (2603:10b6:5:21e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.15; Sat, 7 Dec 2024 08:10:01 +0000 Received: from BL02EPF00021F6E.namprd02.prod.outlook.com (2603:10b6:208:1b4:cafe::c1) by MN2PR15CA0006.outlook.office365.com (2603:10b6:208:1b4::19) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8230.10 via Frontend Transport; Sat, 7 Dec 2024 08:10:00 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BL02EPF00021F6E.mail.protection.outlook.com (10.167.249.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.7 via Frontend Transport; Sat, 7 Dec 2024 08:10:00 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sat, 7 Dec 2024 00:09:47 -0800 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sat, 7 Dec 2024 00:09:46 -0800 From: Xueming Li To: Stephen Hemminger CC: Xueming Li , Bruce Richardson , dpdk stable Subject: patch 'test/eal: fix loop coverage for alignment macros' has been queued to stable release 23.11.3 Date: Sat, 7 Dec 2024 16:00:50 +0800 Message-ID: <20241207080055.488538-93-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241207080055.488538-1-xuemingl@nvidia.com> References: <20241111062847.216344-122-xuemingl@nvidia.com> <20241207080055.488538-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF00021F6E:EE_|DM6PR12MB4281:EE_ X-MS-Office365-Filtering-Correlation-Id: 775715e2-5071-4d92-61c5-08dd16968c16 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|1800799024|376014|36860700013|7053199007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?MBrB56yiqx94V3K3ZV1U5uYw68JrAy0SlPVs2EaQVw7U+5nwd0euXvvFTa07?= =?us-ascii?Q?MowMqwSu2vh+/B+6vwR08r2Febdv0iVsU631VJCtgnbdW6SmAiue0xhF6Pb7?= =?us-ascii?Q?0OxFMTWpJIvSI1dlomyUx7FBlWE1Iai6b6fMNwqu/yDtsPE1zZdzyNZgUw4a?= =?us-ascii?Q?P1PIuM5t9GJpG0ytltI/Gb3EVw8GNELR8bQ9dXNNhAtckqHtfj2AVtJAt4I4?= =?us-ascii?Q?K89Dr3evxl/jDjkAdWTp84sEQRSL6i4RrSLdMeI9/TQricbnK6DtXLYg7Ydx?= =?us-ascii?Q?DZSazGuo2LDiSt2JVG2C/w4j80XaKNzCs0ulv3a7U/mldgnnSr+CsbL7+VlU?= =?us-ascii?Q?31haYuVpVct6UsxTevZpQzqy9PupzOa+0Sp5ooXNh285J6SMMFivmKbESujs?= =?us-ascii?Q?X7T5SX76CghxyO1JZbtsQkGfBLCME0N1HMDJvMFuJ0y0YJnEfbondlgy4qT/?= =?us-ascii?Q?Y+0JQIsO1P/i+zptWWk4fpePM6q2Py4IL6TZmlbMZRAjssGhHcNcdgl10WGn?= =?us-ascii?Q?x+zO6GpULV5ElZYa4wdBLa0CCJXYxwezU0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rnqctUSqgk9PsPdqpTiA3lc2HdITxKU?= X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230040)(82310400026)(1800799024)(376014)(36860700013)(7053199007); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2024 08:10:00.5004 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 775715e2-5071-4d92-61c5-08dd16968c16 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF00021F6E.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4281 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 23.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/10/24. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=d3a710498373cfe91bbd48ad335fe4bc9c076935 Thanks. Xueming Li --- >From d3a710498373cfe91bbd48ad335fe4bc9c076935 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Thu, 21 Nov 2024 10:23:27 -0800 Subject: [PATCH] test/eal: fix loop coverage for alignment macros Cc: Xueming Li [ upstream commit b3e64fe596a3117edf6d3a79a6c5238a9b92dc4f ] The test loop was much shorter than desired because when MAX_NUM is defined with out paren's the divide operator / takes precedence over shift. But when MAX_NUM is fixed, some tests take too long and have to be modified to avoid running over full N^2 space of 1<<20. Note: this is a very old bug, goes back to 2013. Link: https://pvs-studio.com/en/blog/posts/cpp/1179/ Fixes: 1fb8b07ee511 ("app: add some tests") Signed-off-by: Stephen Hemminger Acked-by: Bruce Richardson --- app/test/test_common.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/app/test/test_common.c b/app/test/test_common.c index 21eb2285e1..6dbd7fc9a9 100644 --- a/app/test/test_common.c +++ b/app/test/test_common.c @@ -9,11 +9,12 @@ #include #include #include +#include #include #include "test.h" -#define MAX_NUM 1 << 20 +#define MAX_NUM (1 << 20) #define FAIL(x)\ {printf(x "() test failed!\n");\ @@ -218,19 +219,21 @@ test_align(void) } } - for (p = 1; p <= MAX_NUM / 2; p++) { - for (i = 1; i <= MAX_NUM / 2; i++) { - val = RTE_ALIGN_MUL_CEIL(i, p); - if (val % p != 0 || val < i) - FAIL_ALIGN("RTE_ALIGN_MUL_CEIL", i, p); - val = RTE_ALIGN_MUL_FLOOR(i, p); - if (val % p != 0 || val > i) - FAIL_ALIGN("RTE_ALIGN_MUL_FLOOR", i, p); - val = RTE_ALIGN_MUL_NEAR(i, p); - if (val % p != 0 || ((val != RTE_ALIGN_MUL_CEIL(i, p)) - & (val != RTE_ALIGN_MUL_FLOOR(i, p)))) - FAIL_ALIGN("RTE_ALIGN_MUL_NEAR", i, p); - } + /* testing the whole space of 2^20^2 takes too long. */ + for (j = 1; j <= MAX_NUM ; j++) { + i = rte_rand_max(MAX_NUM - 1) + 1; + p = rte_rand_max(MAX_NUM - 1) + 1; + + val = RTE_ALIGN_MUL_CEIL(i, p); + if (val % p != 0 || val < i) + FAIL_ALIGN("RTE_ALIGN_MUL_CEIL", i, p); + val = RTE_ALIGN_MUL_FLOOR(i, p); + if (val % p != 0 || val > i) + FAIL_ALIGN("RTE_ALIGN_MUL_FLOOR", i, p); + val = RTE_ALIGN_MUL_NEAR(i, p); + if (val % p != 0 || ((val != RTE_ALIGN_MUL_CEIL(i, p)) + & (val != RTE_ALIGN_MUL_FLOOR(i, p)))) + FAIL_ALIGN("RTE_ALIGN_MUL_NEAR", i, p); } return 0; -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-12-06 23:26:47.120887608 +0800 +++ 0092-test-eal-fix-loop-coverage-for-alignment-macros.patch 2024-12-06 23:26:44.103044826 +0800 @@ -1 +1 @@ -From b3e64fe596a3117edf6d3a79a6c5238a9b92dc4f Mon Sep 17 00:00:00 2001 +From d3a710498373cfe91bbd48ad335fe4bc9c076935 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit b3e64fe596a3117edf6d3a79a6c5238a9b92dc4f ] @@ -18 +20,0 @@ -Cc: stable@dpdk.org