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 895A2436CB; Tue, 12 Dec 2023 05:25:56 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F121242DFB; Tue, 12 Dec 2023 05:25:44 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2086.outbound.protection.outlook.com [40.107.92.86]) by mails.dpdk.org (Postfix) with ESMTP id E193042DD8; Tue, 12 Dec 2023 05:25:42 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DLSEV5Wt3GaxktHs59CuYe9GuDw7OmxpCsvAaXKe6t36URtU8AdRn4BroftliZMAFiRHByGgQxbq47iPCVWm+9T8AokyTnu0jpCLqeGBPDDuWQA/bE0RSeOAEIigafaGOdXk31RayGSTlzdaaPxdvSrcyzlLR6xdoaRJJ76nawBibK2fck0wiQ2b6I1JW2HwmhaQ/Ssj0c4qpTdKBGpAIqw5NyOS81bf1PICpucAtcm+Hy+iawUOjXg8+qg4qVgjxLA2qxh1n9V87KTZxAr9ReFZo4dFtN4IwuUewWcsyAAtarnrlhUulYMygz8+425K06Ipwj6BxBUXJ/Z1RYt2vQ== 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=IEL2lckVDcXhebUbmW78vM8LS/PAg3b0QTZMQSrJFNOWXUt6yTM1k9830/mGSCN4rmBfKjm2DOUQp5i7BxqGHLT1pZoYfx49csZj9oAXoCu9uxiJepZGCo6EPzFPrINi+qm+tjtzCuHOK68ZTeuGqicSxZkLlt1zXMtJcDb2/1my/fesmSIHf7s8DIeO2xXOYDOw/U6ZeLYoesx3t+dufeMqXKfjOi2VZIL9Mp6fH4UYbi5XIA6Bmt0+tLvdgaTSx6K4zQsdy8c/mVN6BeD5DDggk6pXj+QUpBPXk3C6+HtXYSU6kD8MNkKGqOXz7PLYrR07izYbTaQP2ANnPaAYfw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) 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=briUc0bpYcs8FkCmAhJcYPkXAblPkua+swcsYZLpuo4+Yugl+Z2313R//o1D9I9gaZXCw2Q6A84WXKPi+ambcHUki4/Vp1tdFK++3ULrqIujnvpiPq4IsKYgi7d4z5FL9YUoZkZewtVNQxMcPgLWtzPws/k2W52wPEuDSthOTd6eDUxpsalxoAQTXP992KmFqgchDEc9afe7/VZ5X6Tg+9K17tQcZ6fohIEK0wHA3EJD7pK5ihoRr1B8/8BIlDobl5TZ2xkICoKZsCIHnqtR2bkovK8pyhXT7YFp/e5nfGDT0jVB/fZn8EQbvGTcLil8ZSy1VGyEI7cq4H1SE+3ebw== Received: from MW4PR03CA0187.namprd03.prod.outlook.com (2603:10b6:303:b8::12) by SA0PR12MB4383.namprd12.prod.outlook.com (2603:10b6:806:94::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.32; Tue, 12 Dec 2023 04:25:40 +0000 Received: from CO1PEPF000042AD.namprd03.prod.outlook.com (2603:10b6:303:b8:cafe::72) by MW4PR03CA0187.outlook.office365.com (2603:10b6:303:b8::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.33 via Frontend Transport; Tue, 12 Dec 2023 04:25:39 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by CO1PEPF000042AD.mail.protection.outlook.com (10.167.243.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.18 via Frontend Transport; Tue, 12 Dec 2023 04:25:39 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Mon, 11 Dec 2023 20:25:29 -0800 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Mon, 11 Dec 2023 20:25:28 -0800 Received: from nvidia.com (10.127.8.9) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41 via Frontend Transport; Mon, 11 Dec 2023 20:25:27 -0800 From: Artemy Kovalyov To: CC: Thomas Monjalon , , Anatoly Burakov , Maxime Coquelin , David Marchand Subject: [PATCH 3/5] ipc: fix mp channel closure to prevent message loss Date: Tue, 12 Dec 2023 06:25:14 +0200 Message-ID: <20231212042517.164353-4-artemyko@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231212042517.164353-1-artemyko@nvidia.com> References: <20231212042517.164353-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: CO1PEPF000042AD:EE_|SA0PR12MB4383:EE_ X-MS-Office365-Filtering-Correlation-Id: 1e15532b-5541-40c0-37a0-08dbfaca6597 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: M8jgXHlnoq2hARDxuB+gw+VzoJnP7fEUaGiVHmWLy71rS+PvIUrrA8bFLq90S6+VQBPymxh3/DybX81dBva7X9Dqej7LaPe6kV80zbFULIiNJgSEFUYlKRRvxstcLX40Y/Ps8pPt37dYxIvS8fE80jArR3/DMWhMoUG+BcDVwxbGaW6A/5SldboisUYJYGfGfJA+WeXoU+lZtplcObY4j8L1Mnb93RHf+maSnLGX7kI2aC4f1hqLQ38SD285usjntVF2qPXZDw0pTpBSbxOCzjDniXLCRWUnKk49FF707G9tUVzLmD9nt33LcBSBjCWP5jwm7wMNdkf9rEKh9IxwaOpylmFKhGe7fvL7pJ3K4M0k4XMJrb1wjObOymGxrDxOHJlOi3Jto5TtH/gJK9w0ntoREArQjFUv9G9JyQdBQ5ybXhnENruKLB9xNtCG64PyBUmFEJwIxHhFAejjIbTKZy5GQylFvauF36Z2qpKoXxjg+eaoZ049IZo8TBy3Aakk6LB9fXfBbtkRfz8FMrv7M7VfhYsAK/dx0rsj3T9G8Kee0z/AP1EJoLZbfw2RcFeDcQpXEzsNUyR6VXDfqPr/3hzM8meqWeoZKOb12sV+RLwdUkP3eTqRmK9Ze9tifcmFVpl09SZ0d5Eppguru2cmf5HO/CIZ7X/zMCzfcUFnk93iaKQsEysA+VE8jbBC3VBlOhXKLH1bB4dhccxkqrY1K7HOu8iePylFlJr3jbg8li0= X-Forefront-Antispam-Report: CIP:216.228.118.233; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge2.nvidia.com; CAT:NONE; SFS:(13230031)(4636009)(39860400002)(376002)(136003)(396003)(346002)(230922051799003)(1800799012)(451199024)(64100799003)(82310400011)(186009)(36840700001)(40470700004)(46966006)(40460700003)(36860700001)(1076003)(47076005)(6286002)(5660300002)(336012)(26005)(2616005)(36756003)(7636003)(426003)(40480700001)(70586007)(70206006)(6916009)(54906003)(2906002)(83380400001)(86362001)(82740400003)(478600001)(41300700001)(356005)(7696005)(8936002)(4326008)(8676002)(55016003)(15650500001)(316002)(6666004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2023 04:25:39.7022 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1e15532b-5541-40c0-37a0-08dbfaca6597 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.233]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000042AD.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4383 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 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