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 9606443B6C for ; Thu, 7 Mar 2024 08:01:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2FB4742E62; Thu, 7 Mar 2024 08:01:51 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2085.outbound.protection.outlook.com [40.107.220.85]) by mails.dpdk.org (Postfix) with ESMTP id 7F3CD42E39; Thu, 7 Mar 2024 08:01:49 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=leDy2/PVsjUJwfyTrNQxxayi9WCT8WoeB2vk9YmmpHy78SI83I5AbpO5ZgutkJs8GAXyg8rAR3Xxdk70xjTlliQpzVumachtH9mtMTfssZBkaHTFYPMNRQHVjPpbukrkNvZBOBhwMVVfCObERwTyXyGirpuw9qRLCHA3rCa9QyEREXBNc6K2IcfAy88b5/JOyuWKWPNne1c51fX77/ywS/OpLwCjxVwSSHHkfjQObL2sqny11C/gQHWqyBHE6UZAfX0jGkEdky6Zlf+iWUVRGehFNBr1dwiOey/Oq9EDTLWpWa9Oy7Ob748cHaq3Ns1mhz9UxNnDlxJyDRHJUDyZfA== 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=efO8i5/RvUD6prZ3xBDdEXD6A+w8LJbcPFsSfgbxYrk=; b=TdMUYjaJdZdV4Of5fpX17ZyQmglf3FVGHmD8RHHXOdRXOM58nBJo7bDi7f7FbMrr2qyzum/Pb8ELqhogFyBKQF8cn3upnuEmGEPQRo/pnKxZFwMkJLV2aAk2EFg3yQRtuc6h5ZAsvlasAg/fp40putdFOseucAQKuxHA5CRMrF0nmHCZHHkCijOI79EhGnsw9PnfOcL/VP4Ma7d/YnADLfJ7AgO70Xs0doc4LRbfhokkTLH+/gU5pasfeweMApuId1HEozL25DU2moEMTL0ZPWv8o5LFU8BAiQMdV+z8Yr5u5tyhfLAq6LNwWkkv6QvUH3fTmdRhUB6+efeNCN9h/g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.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=efO8i5/RvUD6prZ3xBDdEXD6A+w8LJbcPFsSfgbxYrk=; b=MfxGtwoubNR79tkLrFKEC8UHTuFYd96DczGljiJKeeIr5qyVoNJiUomy6JKRelqGe9t8rs1J/yo7XJYtf3ddUeDnyjMhNcqUl02ISAxrMBcUDvI4eZzHH/bdDYwEvxz/eOGUpfQadnboVEI4AjHrErmyDt7EZMvMk7cL/yVdMPOnynrKYUTAL2J6wZ12plUgsbgWkwyJ6UtqANl0xx1bGSfqf7u7rz6L/MzXBDsyVZZxQVm3tYOwfwNvhkT8ouczKARrZ1cY1rINpYUrry2voLTlMy8q4Ipyw5DDlGohgPd4oAF939/o5gq9WCjhVLZOjH8Hm2zIOSAjFpZBQCEKrA== Received: from CH0PR04CA0012.namprd04.prod.outlook.com (2603:10b6:610:76::17) by DS0PR12MB8343.namprd12.prod.outlook.com (2603:10b6:8:fd::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.39; Thu, 7 Mar 2024 07:01:46 +0000 Received: from CH1PEPF0000AD7F.namprd04.prod.outlook.com (2603:10b6:610:76:cafe::4) by CH0PR04CA0012.outlook.office365.com (2603:10b6:610:76::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.27 via Frontend Transport; Thu, 7 Mar 2024 07:01:46 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CH1PEPF0000AD7F.mail.protection.outlook.com (10.167.244.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.11 via Frontend Transport; Thu, 7 Mar 2024 07:01:46 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Wed, 6 Mar 2024 23:01:26 -0800 Received: from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12; Wed, 6 Mar 2024 23:01:25 -0800 Received: from nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12 via Frontend Transport; Wed, 6 Mar 2024 23:01:23 -0800 From: Artemy Kovalyov To: CC: Thomas Monjalon , , Anatoly Burakov , David Marchand , Maxime Coquelin Subject: [PATCH v2 3/5] ipc: fix mp channel closure to prevent message loss Date: Thu, 7 Mar 2024 07:01:11 +0000 Message-ID: <20240307070113.29580-4-artemyko@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240307070113.29580-1-artemyko@nvidia.com> References: <20231212042517.164353-2-artemyko@nvidia.com> <20240307070113.29580-1-artemyko@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH1PEPF0000AD7F:EE_|DS0PR12MB8343:EE_ X-MS-Office365-Filtering-Correlation-Id: caeba04d-a7ca-4f88-75d0-08dc3e74742d X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SDFgjMhZbXATjGItPTMzaTGl2S+/7tmeQ2W7FRfvMRAnXLagv0z1c5X6qXPhJDrWENgqcKL7VYxj4ivTazbOfoLG6cJgZkO90I6oXywHWyGEdB0OT8JppEa3vjFDsVo8/b14teR/9H7FAidb+NIHOPdCfzgve9mawUPrqTO4YV9E3AiT0W8mm6JM3b0kpc0VnHPpRgVYYe1pjRL2Qc8Wzg94itrbvY3ZSDPXx3rIp2H7TUvjA8pQBy02bypu6t9BpJwEyBfTyRXfpUhmVegDrgAA5V0WHJG9/Mn5IIpaL2BmpsLob9hapHbp9EFZldNk66EFf4yxqo5D8Uj3pRpa+wIU+89t3QNuLWRPEGBqEs2cvELDfmkwKjCSjWe7oUu0sDc0bFQ5YH4HDqYl1gRYM72mn8kV9oVEB3AdRwPzM2ZnzhrYzPa5zSAQ7ucDePKoQX8HP9IlezR7ViQVdMNpuju/EkBksCTlT8lG9JXKQTpJQz6hgHkywERbTiAnGpnLsEt7nQhJZa1WJjFEo3DB3hpKtqqPVBu5xPCEhjQqNbRbJdiWZxORyJDrGQ56tTj4nhs4KL/jsjJ6mbQ59mnnp2joBJSdfl+6o7lqWIGsn9qlmNZvSK5SrgJctdiPDotwIY7otG3vegdsPuZFQP5QnEXLgrIC5J+LRfmiGy+pvun1OT5ouCW5w4yIOGz5g/Qujng2efL2EuZgFOvR2/dC4RpOW5U5ienD4yseelwU8SwD2Y4HTk2XQ7Wv/DAf/5im X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230031)(36860700004)(376005)(82310400014); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2024 07:01:46.4313 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: caeba04d-a7ca-4f88-75d0-08dc3e74742d 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.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CH1PEPF0000AD7F.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8343 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 This commit addresses an issue related to the cleanup of the multiprocess channel. Previously, when closing the channel, there was a risk of losing trailing messages. This issue was particularly noticeable when broadcast message from primary to secondary processes was sent while a secondary process was closing it's mp channel. In this fix, we delete mp socket file before stopping mp receive thread. Fixes: e7885281ded1 ("ipc: stop mp control thread on cleanup") Cc: stable@dpdk.org Signed-off-by: Artemy Kovalyov --- lib/eal/common/eal_common_proc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/eal/common/eal_common_proc.c b/lib/eal/common/eal_common_proc.c index 728815c..d34fdda 100644 --- a/lib/eal/common/eal_common_proc.c +++ b/lib/eal/common/eal_common_proc.c @@ -593,7 +593,7 @@ enum async_action { } static void -close_socket_fd(int fd) +remove_socket_fd(int fd) { char path[PATH_MAX]; @@ -672,9 +672,9 @@ enum async_action { if (fd < 0) return; + remove_socket_fd(fd); pthread_cancel((pthread_t)mp_handle_tid.opaque_id); rte_thread_join(mp_handle_tid, NULL); - close_socket_fd(fd); } /** -- 1.8.3.1