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 4F9B4A00BE; Mon, 11 Apr 2022 17:17:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E9C80427EE; Mon, 11 Apr 2022 17:17:54 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2071.outbound.protection.outlook.com [40.107.20.71]) by mails.dpdk.org (Postfix) with ESMTP id 0FD76415D7; Mon, 11 Apr 2022 17:17:54 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K1RB+CU23sK38avwhNHCiger0cXBMY8SjyLik6iqZd7qxXdjTEKBv3TPkqnobFHrlCOIEb+6QSFb9bCtgBjkgNPayEBszSmFEVDMTpLfuqFwB8/I3UPy7bHOhOzgrC2taDr+F1rZTkfN+ZmLiHJ49QR15NbHxJBba2eLkIcxT2zqPUdMeAYS2ZK3gKDftFhZ3R3aA7OTc2F3tkkPoXh8fQ9jRwz4j+jIFdAKqEZlMCsWkYJZTs+ZqxvYeJvbj9tNRqBiECTXoVpciPCD6sQT1itPjCl9vHu7U81kDxXqRWF5Asv5zc0W/pWiG3xOKjXJpq2bbdEl4QN/RmivYh6cAA== 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=JQaN9C+BLxBXjwxOoA4nXOfmbS1e0RHOrAojiTZWJK8=; b=TDlwcv7G1lL24nxm2CPpQPpUxkgVeHglbEuU3Avo5f3w/siQD0cJGJapLe51aXX4e1WpEBWAcc5rolg/WB9ZXhO2tq9KkSBCW72VJEQoKx1Z+hRGZXK9q0RB7ULzQ89ASnJXtwP5f+/oyvAa1QJh7PK+B2y5xS938DeSKGffowwOSp5RAmQ+9EqeXzT/ZcyIfxnJJimYJSM7uu6lpgkbNuAfZE/RdR4m4KGzgo6AsJfxLjRSoToZeOINqye12HQcap7V4sRUiZ4lp7wkY1qTL3rbKu8uoZw7sO3jDHenoN3t2kHvwQuYWbsmsfqjQfOzxxdIciyfHGavN2yqHZYwfw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 192.176.1.74) smtp.rcpttodomain=arm.com 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 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=JQaN9C+BLxBXjwxOoA4nXOfmbS1e0RHOrAojiTZWJK8=; b=GnMUA4xlBPpFtlseNNFR2x2yx17OVu2noBB3GH8A6A3dul66C2q5Lnle+g4h8TUbjsRdW7VkE6Qe0KpcWoJh838N7ZjysbaqdgQa214bac2jaCb/uHxx0xyPOI8Xv2prfhpf6Q29T8104/S24PmXua6esW6Ke4AxYqkzi2oPIPE= Received: from AS9PR07CA0027.eurprd07.prod.outlook.com (2603:10a6:20b:46c::29) by AS8PR07MB7078.eurprd07.prod.outlook.com (2603:10a6:20b:253::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.17; Mon, 11 Apr 2022 15:17:52 +0000 Received: from VE1EUR02FT030.eop-EUR02.prod.protection.outlook.com (2603:10a6:20b:46c:cafe::18) by AS9PR07CA0027.outlook.office365.com (2603:10a6:20b:46c::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.17 via Frontend Transport; Mon, 11 Apr 2022 15:17:52 +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; Received: from oa.msg.ericsson.com (192.176.1.74) by VE1EUR02FT030.mail.protection.outlook.com (10.152.12.127) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.5144.20 via Frontend Transport; Mon, 11 Apr 2022 15:17:52 +0000 Received: from ESESSMB505.ericsson.se (153.88.183.166) by ESESSMR503.ericsson.se (153.88.183.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.27; Mon, 11 Apr 2022 17:17:51 +0200 Received: from ESESBMB503.ericsson.se (153.88.183.170) by ESESSMB505.ericsson.se (153.88.183.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.27; Mon, 11 Apr 2022 17:17:51 +0200 Received: from seliiuapp00218.seli.gic.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.186) with Microsoft SMTP Server id 15.1.2308.27 via Frontend Transport; Mon, 11 Apr 2022 17:17:50 +0200 Received: from localhost.localdomain (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliiuapp00218.seli.gic.ericsson.se (Postfix) with ESMTP id 71C3660160; Mon, 11 Apr 2022 17:17:51 +0200 (CEST) From: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= To: CC: Bruce Richardson , Thomas Monjalon , David Marchand , , , , Stephen Hemminger , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= , , , Min Hu Subject: [PATCH 3/3] examples/bond: fix invalid use of trylock Date: Mon, 11 Apr 2022 17:15:59 +0200 Message-ID: <20220411151559.164217-3-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220411151559.164217-1-mattias.ronnblom@ericsson.com> References: <20220411151559.164217-1-mattias.ronnblom@ericsson.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 231d55de-002b-4f9f-f932-08da1bce726e X-MS-TrafficTypeDiagnostic: AS8PR07MB7078:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WPHlnyj/81Tq8TbUyzM3STnLRbENG5DrNMnzq2BtX+ZLTr0/y32HOhSC/fSIQ2d6667T1jTRQflunZmDO4/q/AEgAWicM4xzpppuUEO4xv0leTVHJFE71/UJKiUWj/rSLaFEIjrg9tmnns9Q4u6la0lhg7XLpSV7FknbvzmpkW9z3o6UTTd5rIH+/8C2/vWYaE7DXcPCUAslRIu+HR1gaCnOjvXyMiVdDYKuOnSTElDPhrHleCcQoxQidVmftbN2k26jaJnOvfHZtUQG9zXhdjAbLYy3Sbfpo0kDrczXFA0OVZnzdB32GjW3d+DHWjII4jTlCzJukPQk2Z3XIKpQlc9Vi/FUPbueLq0+Cl3gLn+CbSJ8pDuJE7DRXqqUVVcOxbYZsefnEfa7oag4LQ+VYOKAzsOZc8h+hjeCJVm/IU1wZhduJrk0hDxXa3jCIvY2mOa7O+F3eXDYt/akzQ+ilCqEJQ9NwX/dsd87fV8S6GVeZ7GNrDNmzmeN9MZy+eEZ/L9/9feqlPm5Sar/ShjQgu1q/CpY5/SOgDeJjYoxie2KtuhoUP5Br5Ieb4cXVxBa6wbnIxrSl/V/9esVVjJqod114pyDbd/O+V7xBODnH+IB9FCyO+8IcdJ2ZVhU8winM+3+JtWShgxPkRUdE+ssG0zbC6AgbwpR9fdLyLy472WsJ6vB98OegAqh0Rs9aGdolYOFiu2/c1T0BG3SZLLrlGSS7uDy76zK/U7CKPQ9mrU= 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:(13230001)(4636009)(40470700004)(36840700001)(46966006)(508600001)(86362001)(316002)(6916009)(54906003)(66574015)(83380400001)(47076005)(36756003)(7636003)(36860700001)(40460700003)(82960400001)(356005)(1076003)(82310400005)(336012)(2616005)(6266002)(2906002)(70206006)(5660300002)(70586007)(7416002)(8676002)(186003)(8936002)(26005)(4326008); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2022 15:17:52.2653 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 231d55de-002b-4f9f-f932-08da1bce726e 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: VE1EUR02FT030.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR07MB7078 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 conditional rte_spinlock_trylock() was used as if it is an unconditional lock operation in a number of places. Fixes: cc7e8ae84faa ("examples/bond: add example application for link bonding mode 6") Cc: michalx.k.jastrzebski@intel.com Cc: stable@dpdk.org Acked-by: Bruce Richardson Acked-by: Min Hu (Connor) Signed-off-by: Mattias Rönnblom --- examples/bond/main.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/bond/main.c b/examples/bond/main.c index 335bde5c8d..4efebb3902 100644 --- a/examples/bond/main.c +++ b/examples/bond/main.c @@ -373,7 +373,7 @@ static int lcore_main(__rte_unused void *arg1) bond_ip = BOND_IP_1 | (BOND_IP_2 << 8) | (BOND_IP_3 << 16) | (BOND_IP_4 << 24); - rte_spinlock_trylock(&global_flag_stru_p->lock); + rte_spinlock_lock(&global_flag_stru_p->lock); while (global_flag_stru_p->LcoreMainIsRunning) { rte_spinlock_unlock(&global_flag_stru_p->lock); @@ -456,7 +456,7 @@ static int lcore_main(__rte_unused void *arg1) if (is_free == 0) rte_pktmbuf_free(pkts[i]); } - rte_spinlock_trylock(&global_flag_stru_p->lock); + rte_spinlock_lock(&global_flag_stru_p->lock); } rte_spinlock_unlock(&global_flag_stru_p->lock); printf("BYE lcore_main\n"); @@ -571,7 +571,7 @@ static void cmd_start_parsed(__rte_unused void *parsed_result, { int worker_core_id = rte_lcore_id(); - rte_spinlock_trylock(&global_flag_stru_p->lock); + rte_spinlock_lock(&global_flag_stru_p->lock); if (global_flag_stru_p->LcoreMainIsRunning == 0) { if (rte_eal_get_lcore_state(global_flag_stru_p->LcoreMainCore) != WAIT) { @@ -591,7 +591,7 @@ static void cmd_start_parsed(__rte_unused void *parsed_result, if ((worker_core_id >= RTE_MAX_LCORE) || (worker_core_id == 0)) return; - rte_spinlock_trylock(&global_flag_stru_p->lock); + rte_spinlock_lock(&global_flag_stru_p->lock); global_flag_stru_p->LcoreMainIsRunning = 1; rte_spinlock_unlock(&global_flag_stru_p->lock); cmdline_printf(cl, @@ -659,7 +659,7 @@ static void cmd_stop_parsed(__rte_unused void *parsed_result, struct cmdline *cl, __rte_unused void *data) { - rte_spinlock_trylock(&global_flag_stru_p->lock); + rte_spinlock_lock(&global_flag_stru_p->lock); if (global_flag_stru_p->LcoreMainIsRunning == 0) { cmdline_printf(cl, "lcore_main not running on core:%d\n", @@ -700,7 +700,7 @@ static void cmd_quit_parsed(__rte_unused void *parsed_result, struct cmdline *cl, __rte_unused void *data) { - rte_spinlock_trylock(&global_flag_stru_p->lock); + rte_spinlock_lock(&global_flag_stru_p->lock); if (global_flag_stru_p->LcoreMainIsRunning == 0) { cmdline_printf(cl, "lcore_main not running on core:%d\n", @@ -762,7 +762,7 @@ static void cmd_show_parsed(__rte_unused void *parsed_result, printf("\n"); } - rte_spinlock_trylock(&global_flag_stru_p->lock); + rte_spinlock_lock(&global_flag_stru_p->lock); cmdline_printf(cl, "Active_slaves:%d " "packets received:Tot:%d Arp:%d IPv4:%d\n", -- 2.25.1