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 048BDA034F for ; Wed, 10 Nov 2021 07:45:42 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EC0814014D; Wed, 10 Nov 2021 07:45:41 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2058.outbound.protection.outlook.com [40.107.244.58]) by mails.dpdk.org (Postfix) with ESMTP id 79ECA4014D for ; Wed, 10 Nov 2021 07:45:40 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q0D4QpJJrTdBQHI+/sKnmiN8jj2PLwwmYstGP8GPVdlpTxR9qOuQb6wefSTVo2JP/sYVw1W5kviL6EsupJABWr8vPW2Nyj1LgYAZmHHQw1A7jaM78I5ycBqMaPaZHCS0z6L2cS8KHvfDfwjCfHIxsz4UTmdGNFsV+tpabTb8swMVVdSmDJialnXE/4U2kJKmgZvFID7lXwYWa49ilhlBYv9NVTpSixdtPFGpHweLHbnSt4SuGu8qSceQwgIv8qfWx1xP3evPAncyDsCAyYmi7xep36LpPLXpiTRacbuY/T8BKzZbcTPdmsK/RTQzPQBXgx5EpIdgTlK7pbRqXeeOvg== 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=feE8rnZey4X3p7LvQFuRhGszSaEjGzFSYLGwVZNOLM8=; b=gqlVG9xvRBkNik/qUnqgVUurrWcYs4gkrHYc8nHBF1wBS35KKoppBdS49Ry9aULlcUfZKog7SPpjWoMFIDfZmwiXZpU+edRKcim6Ec811tzIfrFrOESlTVcUYoq4fQwymz2BJ2BGkyXkqFZB8KsNCD5EIWnlSfq31o1RGBeBX7m7vtCZLBiBWi5i00idphvLSIA+cLu3FlNtilNTzv+vWOTP5mDMsO3fjMRrRhQ39xn7LyI+yNM1FQipj2TbZVzonmK6FLWA5OnFhQ874eiyvMs+csfkZ1Q/s187U++r6h+0YExbwJS4z/LxzYpyAZfKsb8oLNl3ZMdaXG172fVZbQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none 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=feE8rnZey4X3p7LvQFuRhGszSaEjGzFSYLGwVZNOLM8=; b=GlXJRH6CJAz4/emUV1jHIybE6WeGKQWao0sxkDT7I9DUpR9dA/unIn3zAoEjvODz5M/3qNPYo++EBFz7dVJp+TkNWcgjMBUp3T/XpAedASShjFnjZrQuFEmh44HEQxaMLUooJ42DoHyXOLJQG6RNn3/LGGjlNh4P/FVAJP74r8FOr757PEB56AsoT400eNqZ1vMfX3g9vz/muDWPaPML3aZiWkfGBH00mlD6ei7wJ3uPza5AIM9K6+8dN9CRqiB02dHwiIZC7rN7f8SQGmZoLNtX5AKntQ8mCWi+QHz8s8rd2GKz7fyiKkQkIYnnnM5fsNhtpBC9UPngdqToUbkDFg== Received: from BN0PR04CA0155.namprd04.prod.outlook.com (2603:10b6:408:eb::10) by CY4PR12MB1718.namprd12.prod.outlook.com (2603:10b6:903:120::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11; Wed, 10 Nov 2021 06:45:38 +0000 Received: from BN8NAM11FT039.eop-nam11.prod.protection.outlook.com (2603:10b6:408:eb:cafe::9c) by BN0PR04CA0155.outlook.office365.com (2603:10b6:408:eb::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 06:45:38 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT039.mail.protection.outlook.com (10.13.177.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 06:45:37 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 10 Nov 2021 06:45:35 +0000 From: Xueming Li To: David Marchand CC: Luca Boccassi , Aaron Conole , Harry van Haaren , dpdk stable Date: Wed, 10 Nov 2021 14:30:03 +0800 Message-ID: <20211110063216.2744012-120-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211110063216.2744012-1-xuemingl@nvidia.com> References: <20211110063216.2744012-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fcca0845-8589-420a-0eda-08d9a415b430 X-MS-TrafficTypeDiagnostic: CY4PR12MB1718: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: U777InzYN7l5l/+Jd8KS0YH+cOIwBV+gPWwnJwj0EDxrZxPdYOozIF+3r8BZ8qXVocsNm8JmG4bdTi8z13YD5YIcrYRr9An+rw5S8QUFdZ9kgQ29eFBZ2z5Kz90eHbQR1Wja7GTDIdXa1VPqTrGAXIj/4lwTfhTNqJ8czJbefdaTa87JPiIIg5tetFYe8zAete5/1Oj+S/zBAqT1cdnZVM2/UINePZi42aC538pyXT3fxBvz36bmM0rr5cizkPIlP3jgVzZDidbMHaknsfWem2WS40mB43dioWiU55TeKguxyOrTdh2PVxjq9eRL23KPtwJjIEv+FiD+2wr8Xu4c4CZqerx6G9x8RqlhiB3wmOjSxYjBB/fyWZokC+VYqu0PwHPE33ibWooYI0IldMCjQNEI+QzORTqJKbu1M3SVzqaFcgOCKSp4pfXkOVcydllsBlzlvfQ2GTU6VKHMp1FhAII3uKDA8uUbzsjbhvcyow5s9qwhPKzZK5aBuQOJhusxveoTHT0r+0jeklMoJBmSOYXtibD8pme9kCA0SnXWfCcVqAX7YfMd8iaTJEDvgHoXf/6PLMju1CokWUztjEMnfaSnV/KoFb6N4Pj893BHCUJNj3umDCeSX0Y6iknoILA+qD/na95HvjgKiHYsFyyra9rXqIfuhW1INvw023lg1+g7ySltZDBxK9Hnbqvn3Yidzo0vRcaSrD8hZUmlU4ax5xIvkNP+2JoxaojizFwabitPA9wROTXh+h9V7C9lwVNYXiXL6QHlhSdOFzOtrOXZbkgsMS/UGyhuDyzxiCBmQnI2MlrkyVvjLG9JBGNcgVQPoyYMf/qsZoDlKE1bLvEdnw== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(2906002)(426003)(508600001)(6916009)(356005)(1076003)(53546011)(4001150100001)(7696005)(36860700001)(8936002)(6666004)(2616005)(47076005)(336012)(6286002)(966005)(16526019)(316002)(86362001)(55016002)(70206006)(8676002)(36906005)(26005)(36756003)(186003)(4326008)(82310400003)(54906003)(70586007)(5660300002)(7636003)(83380400001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 06:45:37.2173 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fcca0845-8589-420a-0eda-08d9a415b430 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT039.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1718 Subject: [dpdk-stable] patch 'test/service: fix race in attr check' has been queued to stable release 20.11.4 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/12/21. 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://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/cc7ded572d96e2438836ae07bba0473f9aa5f055 Thanks. Xueming Li --- >From cc7ded572d96e2438836ae07bba0473f9aa5f055 Mon Sep 17 00:00:00 2001 From: David Marchand Date: Mon, 11 Oct 2021 16:54:30 +0200 Subject: [PATCH] test/service: fix race in attr check Cc: Xueming Li [ upstream commit 4a985f4e84c56fa6d562b4e920c4912203b95eb6 ] The CI reported rare (and cryptic) failures like: RTE>>service_autotest + ------------------------------------------------------- + + Test Suite : service core test suite + ------------------------------------------------------- + + TestCase [ 0] : unregister_all succeeded + TestCase [ 1] : service_name succeeded + TestCase [ 2] : service_get_by_name succeeded Service dummy_service Summary dummy_service: stats 1 calls 0 cycles 0 avg: 0 Service dummy_service Summary dummy_service: stats 0 calls 0 cycles 0 avg: 0 + TestCase [ 3] : service_dump succeeded + TestCase [ 4] : service_attr_get failed + TestCase [ 5] : service_lcore_attr_get succeeded + TestCase [ 6] : service_probe_capability succeeded + TestCase [ 7] : service_start_stop succeeded + TestCase [ 8] : service_lcore_add_del succeeded + TestCase [ 9] : service_lcore_start_stop succeeded + TestCase [10] : service_lcore_en_dis_able succeeded + TestCase [11] : service_mt_unsafe_poll succeeded + TestCase [12] : service_mt_safe_poll succeeded perf test for MT Safe: 42.7 cycles per call + TestCase [13] : service_app_lcore_mt_safe succeeded perf test for MT Unsafe: 73.3 cycles per call + TestCase [14] : service_app_lcore_mt_unsafe succeeded + TestCase [15] : service_may_be_active succeeded + TestCase [16] : service_active_two_cores succeeded + ------------------------------------------------------- + + Test Suite Summary : service core test suite + ------------------------------------------------------- + + Tests Total : 17 + Tests Skipped : 0 + Tests Executed : 17 + Tests Unsupported: 0 + Tests Passed : 16 + Tests Failed : 1 + ------------------------------------------------------- + Test Failed RTE>> stderr: EAL: Detected CPU lcores: 16 EAL: Detected NUMA nodes: 2 EAL: Detected static linkage of DPDK EAL: Multi-process socket /var/run/dpdk/service_autotest/mp_socket EAL: Selected IOVA mode 'PA' EAL: No available 1048576 kB hugepages reported EAL: VFIO support initialized EAL: Device 0000:03:00.0 is not NUMA-aware, defaulting socket to 0 APP: HPET is not enabled, using TSC as default timer EAL: Test assert service_attr_get line 340 failed: attr_get() call didn't get call count (zero) According to API, trying to stop a service lcore is not possible if this lcore is the only one associated to a service. Doing this will result in a -EBUSY return code from rte_service_lcore_stop() which the service_attr_get subtest was not checking. This left the service lcore running, and a race existed with the main lcore on checking the service attributes which triggered this CI failure. To fix this, dissociate the service lcore with current service. Once fixed this first issue, a race still exists, because the wait_slcore_inactive helper added in a previous fix was not paired with a check that the service lcore _did_ stop. Add missing check on rte_service_lcore_may_be_active. Fixes: 4d55194d76a4 ("service: add attribute get function") Fixes: 52bb6be259ff ("test/service: fix race condition on stopping lcore") Signed-off-by: David Marchand Acked-by: Aaron Conole Acked-by: Harry van Haaren --- app/test/test_service_cores.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/test/test_service_cores.c b/app/test/test_service_cores.c index 8b61dcfd30..0aee8c04e3 100644 --- a/app/test/test_service_cores.c +++ b/app/test/test_service_cores.c @@ -314,10 +314,16 @@ service_attr_get(void) TEST_ASSERT_EQUAL(1, cycles_gt_zero, "attr_get() failed to get cycles (expected > zero)"); - rte_service_lcore_stop(slcore_id); + TEST_ASSERT_EQUAL(0, rte_service_map_lcore_set(id, slcore_id, 0), + "Disabling valid service and core failed"); + TEST_ASSERT_EQUAL(0, rte_service_lcore_stop(slcore_id), + "Failed to stop service lcore"); wait_slcore_inactive(slcore_id); + TEST_ASSERT_EQUAL(0, rte_service_lcore_may_be_active(slcore_id), + "Service lcore not stopped after waiting."); + TEST_ASSERT_EQUAL(0, rte_service_attr_get(id, attr_calls, &attr_value), "Valid attr_get() call didn't return success"); TEST_ASSERT_EQUAL(1, (attr_value > 0), -- 2.33.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-10 14:17:07.269361164 +0800 +++ 0119-test-service-fix-race-in-attr-check.patch 2021-11-10 14:17:01.884079315 +0800 @@ -1 +1 @@ -From 4a985f4e84c56fa6d562b4e920c4912203b95eb6 Mon Sep 17 00:00:00 2001 +From cc7ded572d96e2438836ae07bba0473f9aa5f055 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 4a985f4e84c56fa6d562b4e920c4912203b95eb6 ] @@ -79 +81,0 @@ -Cc: stable@dpdk.org @@ -89 +91 @@ -index 8659a1526c..ced6ed0081 100644 +index 8b61dcfd30..0aee8c04e3 100644 @@ -92 +94 @@ -@@ -318,10 +318,16 @@ service_attr_get(void) +@@ -314,10 +314,16 @@ service_attr_get(void)