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 6C04E470AC for ; Sun, 21 Dec 2025 15:59:46 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6675F402EE; Sun, 21 Dec 2025 15:59:46 +0100 (CET) Received: from CY3PR05CU001.outbound.protection.outlook.com (mail-westcentralusazon11013049.outbound.protection.outlook.com [40.93.201.49]) by mails.dpdk.org (Postfix) with ESMTP id ADA45402BE for ; Sun, 21 Dec 2025 15:59:44 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NiTQJ5g4RK84386q44npU2wWLJUwKzi3zke4Hjen56SqX5fmmlQi4e8yrrynQprtZ9NUomOU/Iph8s2I4o8lNWReOZga1sPrFwrbecNgjjafV+zXSOQKNwcw2q4BBUSTpkNbXwD3NTCjxPVqfUBVtEsesfwRDJehRmdafeb0ynCrjgmv8IB5xeGoj8rCk6gfdCaKwnum9D7erXdDEHinJHlDFhiBq6qpOnkfG+AkZheOoU3bIpwE84XQ0+SLR1JZn8jv0QmKpTF8i7QIQh+G0TgXckyiuR2ONKKaKIsj+Dr+a7IVfZ1YBavZJEujYWnijaVLruVVtWmGLscIYEz8iQ== 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=cbv0vFJz+oy6nfRgwcaNt/Lnj3WQqcmyDH6TWo6cgQ0=; b=mQC00ESLeYubT6APLNEDQmBwTo4X4Bhzj2pPTUdT5L2HJvTFNSivJiuXipyW1iEK3eYa/dy33PgVH18Zzcgo1pfTQxfSujipNoa5vX4POvG6/VsPxepowY2ZW+YxWsRGTagAoQ7gB1+fsMVDt2H5/2JFqVSwVc0rxaHr8FLCj0eAOzhGYWvZoSKXvYU+lgCZotQvPRhm92WD/of13ihANf5gShrZ3ybVQyHSLxOIPbINnMHi6WEjwv64OndRmBW/oGIh3JjmFM6BFyeP4sMeCoAiM9hwNU8paa3656e4YZrZ9nJdTRLy7qQ0X4aJrydkkEjMLo8g5EGKoFHkwAxQZw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=uetpeshawar.edu.pk 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=cbv0vFJz+oy6nfRgwcaNt/Lnj3WQqcmyDH6TWo6cgQ0=; b=lG8hHQGgRsEv6NfQ8QBg0xHprcHs2qOaxtvg0CwI1ALu2fD0pF8xqCSAfjVD4b6br8HdsZYURRtUfeTfnr8vht3tR/zhaEcy+jhiLDX91MfzykzvR+5OO1KjOnn+utVh8jvJSb50Tt0Ygajl8lmfWGQeIOwOLKb2FDUNY+Mf5aBGRTtRrWJysFNo6SwytqR1e2K2hqHmqgi0X2b1A5qia58IP9ttZe2jx2AmF4QkrO5wu2uYeguU9kpMYYxoy1Y0quYWgIaHUlcZanSUobGvgauC/2LhxXtGGtVzrqkZ4Rgyp0sK0R9NLCDR7s6InXbBi3bFkxYrQTrtHbaWP09agQ== Received: from CH0PR03CA0073.namprd03.prod.outlook.com (2603:10b6:610:cc::18) by DM4PR12MB5892.namprd12.prod.outlook.com (2603:10b6:8:68::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9434.10; Sun, 21 Dec 2025 14:59:41 +0000 Received: from CH2PEPF0000013B.namprd02.prod.outlook.com (2603:10b6:610:cc:cafe::7d) by CH0PR03CA0073.outlook.office365.com (2603:10b6:610:cc::18) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9434.11 via Frontend Transport; Sun, 21 Dec 2025 14:59:41 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) 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.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by CH2PEPF0000013B.mail.protection.outlook.com (10.167.244.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9456.9 via Frontend Transport; Sun, 21 Dec 2025 14:59:40 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Sun, 21 Dec 2025 06:59:39 -0800 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Sun, 21 Dec 2025 06:59:38 -0800 Received: from nvidia.com (10.127.8.12) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20 via Frontend Transport; Sun, 21 Dec 2025 06:59:37 -0800 From: Shani Peretz To: Khadem Ullah <14pwcse1224@uetpeshawar.edu.pk> CC: Stephen Hemminger , dpdk stable Subject: patch 'app/testpmd: monitor state of primary process' has been queued to stable release 23.11.6 Date: Sun, 21 Dec 2025 16:56:03 +0200 Message-ID: <20251221145746.763179-15-shperetz@nvidia.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251221145746.763179-1-shperetz@nvidia.com> References: <20251221145746.763179-1-shperetz@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: CH2PEPF0000013B:EE_|DM4PR12MB5892:EE_ X-MS-Office365-Filtering-Correlation-Id: 2c07e133-5264-41a8-41c7-08de40a19125 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|36860700013|82310400026|376014|13003099007|7053199007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?WAAQNiw3ux0qyycpFFGoas9PmsV5WvB2KpUB9Ydl/Rw3ugc7PbJpN4WqFtsG?= =?us-ascii?Q?Y2mcS+YxObIIm6CY25Wm8dSQVbzOeq2lPLqVVfSOztWvML22gUyRwUWJuu+/?= =?us-ascii?Q?/aXY+UY7CR0dyDtUEhAbNVcWLskYgbfRQox5Ev5P9O9SIt87CmG9C+XC2t/8?= =?us-ascii?Q?sYZ/yVIjekhUBrAUXYVg+n+7L7s+gT6gAG0g6zqsBVDmJT4xfUFzB8No2Y3x?= =?us-ascii?Q?Y1ths6m0xQ9QwQApqPt5sJgf/io+26vTXU1s/IaSuZoKmPEcmzc5kLf7nDta?= =?us-ascii?Q?T8uHQvQRbUTv4Ny4rGSzSn9AbH1gMR+QzDBWVyaYpTzEu4l2/xnlFKV8AKga?= =?us-ascii?Q?BEb9WUbN36CMwh/qqjSOHqoHwaX8dhSydf+CYMa4eRC0flo+Lrpnf5bRpoc+?= =?us-ascii?Q?lWn7IZulkpn7Ps9bdpI3F6WzB61d9Vpkd659qEfvh2b7COAU+CwJB3kE/gWZ?= =?us-ascii?Q?wfJkoKiHXJspTXFi1X2F9ZvIi4C5AjquuwXKPJ0Oz4R3HNR5AwWOZDZIV/sq?= =?us-ascii?Q?UY+k82TrSQKcGScapvnfEqh3R12O64BzSt7tZjyJGOqNUpw6uPG6dj1gxYkm?= =?us-ascii?Q?aokVQ52wp/L3gJWIzyrMJQD0LZIOWaRkTj+YtzYtH/iLWZ0jygU5h5ygCYAa?= =?us-ascii?Q?kyr252DmXqbjkut900FhBHRK4sM7D59+CNFAtt1Jn6QG+0htJoq2b2nvn7dF?= =?us-ascii?Q?krsfDPcd49hB9geTQcx/H2lTDWFCbkUcsQr8C1tsHfeZAbauobltcwhJid4y?= =?us-ascii?Q?JYrggDXdl0upSd/hVuZILinOrxZUvPH8lgg598h4U3npE7+fOmhb92tDQv95?= =?us-ascii?Q?OTBfglWDkDlfiE0Auw8khPjRnjEaWssUXRL11X2z0nm8Io9WObUmPliY+nDN?= =?us-ascii?Q?bCc+VeakR9a/5iE2ouwyJWRR//dhKz7sOktAx2EYsKoZ0gghEMhjnvRPVRe1?= =?us-ascii?Q?ex8jXzJH8FXHSNnG9wtErYhlyw3bBuYQ+V5oi3/y5mUynAieArl3223LpBpB?= =?us-ascii?Q?fCtW109cVVHdscItN/XUw6FFsm154ozJimv5/HcgNzOR+P4v2OjP5r+cNa/5?= =?us-ascii?Q?+EX3qnAOSREuVUt5tO/JYiv8IhZQ9bjRLG2v7y6pOAzTgrdUqflfB833ZuAI?= =?us-ascii?Q?xPOxBWnZlKvaXETXJGocEZZ++uIvlJmeibXok1qj56JB4kttTaKdaEvi6HPS?= =?us-ascii?Q?T2W9M+kVb9Rdo+Ctic/kfb5OJZwHRWmi+/qy8yiDlzK0u5QxvW2ow3Ly2i5r?= =?us-ascii?Q?1kB5x04koX4zi2lQNxLGviV0v5TivsIm+eWFd8GY8G0LHFjve80/enASzfYH?= =?us-ascii?Q?qbEzgC7YkRRiBMr6FbmsPjl8eqaVSqQsXEdQH+QPCxJW7Oq+a3/yl7bKr/td?= =?us-ascii?Q?7SXKIlq1onZ9ulDaNyPt7EMEbCSeFCjWmBya0V1QnrJat8aEERx4XZHYhrRD?= =?us-ascii?Q?BsWjg6mliso06vDLjofX/1fm9ERuugjILg/Gcxkv4EYpm4EY5p9HXys1nS51?= =?us-ascii?Q?pEIUNO/suMHkCH7PqDTUMcbHDRIUVaveWxAWYwSmCIuGbnt0EykeSjg85Z5F?= =?us-ascii?Q?/NFcx4dh3SlSKkYCeq1vjsDcRSJEYJKqacM3ziIy?= X-Forefront-Antispam-Report: CIP:216.228.118.232; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge1.nvidia.com; CAT:NONE; SFS:(13230040)(1800799024)(36860700013)(82310400026)(376014)(13003099007)(7053199007); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2025 14:59:40.0703 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2c07e133-5264-41a8-41c7-08de40a19125 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.232]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CH2PEPF0000013B.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5892 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.6 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/26/25. 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/shanipr/dpdk-stable This queued commit can be viewed at: https://github.com/shanipr/dpdk-stable/commit/dbfa8cc202c0101608318ad423e392bb31643352 Thanks. Shani --- >From dbfa8cc202c0101608318ad423e392bb31643352 Mon Sep 17 00:00:00 2001 From: Khadem Ullah <14pwcse1224@uetpeshawar.edu.pk> Date: Mon, 4 Aug 2025 07:33:22 -0400 Subject: [PATCH] app/testpmd: monitor state of primary process [ upstream commit 7628f5bbb7e882e57c956d98731cac12a436c9a7 ] In secondary processes, accessing device after primary has exited will cause crash. This patch adds a mechanism in testpmd to monitor the primary process from the secondary process. When primary process exits it forces secondary to exit avoiding issues from cleanup logic. Fixes: a550baf24af9 ("app/testpmd: support multi-process") Signed-off-by: Khadem Ullah <14pwcse1224@uetpeshawar.edu.pk> Signed-off-by: Stephen Hemminger --- app/test-pmd/testpmd.c | 47 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 9e4e99e53b..d7db1d6afb 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -101,12 +101,14 @@ uint16_t verbose_level = 0; /**< Silent by default. */ int testpmd_logtype; /**< Log type for testpmd logs */ +/* Maximum delay for exiting after primary process. */ +#define MONITOR_INTERVAL (500 * 1000) + /* use main core for command line ? */ uint8_t interactive = 0; uint8_t auto_start = 0; uint8_t tx_first; char cmdline_filename[PATH_MAX] = {0}; - /* * NUMA support configuration. * When set, the NUMA support attempts to dispatch the allocation of the @@ -4524,6 +4526,38 @@ signal_handler(int signum __rte_unused) prompt_exit(); } +#ifndef RTE_EXEC_ENV_WINDOWS +/* Alarm signal handler, used to check that primary process */ +static void +monitor_primary(void *arg __rte_unused) +{ + if (rte_eal_primary_proc_alive(NULL)) { + rte_eal_alarm_set(MONITOR_INTERVAL, monitor_primary, NULL); + } else { + /* + * If primary process exits, then all the device information + * is no longer valid. Calling any cleanup code is going to + * run into use after free. + */ + fprintf(stderr, "\nPrimary process is no longer active, exiting...\n"); + exit(EXIT_FAILURE); + } +} + +/* Setup handler to check when primary exits. */ +static int +enable_primary_monitor(void) +{ + return rte_eal_alarm_set(MONITOR_INTERVAL, monitor_primary, NULL); +} + +static void +disable_primary_monitor(void) +{ + rte_eal_alarm_cancel(monitor_primary, NULL); +} +#endif + int main(int argc, char** argv) { @@ -4555,6 +4589,12 @@ main(int argc, char** argv) rte_exit(EXIT_FAILURE, "Cannot init EAL: %s\n", rte_strerror(rte_errno)); +#ifndef RTE_EXEC_ENV_WINDOWS + if (rte_eal_process_type() == RTE_PROC_SECONDARY && + enable_primary_monitor() < 0) + rte_exit(EXIT_FAILURE, "Cannot setup primary monitor"); +#endif + /* allocate port structures, and init them */ init_port(); @@ -4756,6 +4796,11 @@ main(int argc, char** argv) } } +#ifndef RTE_EXEC_ENV_WINDOWS + if (rte_eal_process_type() == RTE_PROC_SECONDARY) + disable_primary_monitor(); +#endif + pmd_test_exit(); #ifdef RTE_LIB_PDUMP -- 2.43.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-12-21 16:54:18.139306261 +0200 +++ 0015-app-testpmd-monitor-state-of-primary-process.patch 2025-12-21 16:54:16.710076000 +0200 @@ -1 +1 @@ -From 7628f5bbb7e882e57c956d98731cac12a436c9a7 Mon Sep 17 00:00:00 2001 +From dbfa8cc202c0101608318ad423e392bb31643352 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 7628f5bbb7e882e57c956d98731cac12a436c9a7 ] + @@ -15 +16,0 @@ -Cc: stable@dpdk.org @@ -24 +25 @@ -index db52ed22f1..0f58a31eb5 100644 +index 9e4e99e53b..d7db1d6afb 100644 @@ -27 +28 @@ -@@ -102,13 +102,15 @@ +@@ -101,12 +101,14 @@ @@ -39 +39,0 @@ - bool echo_cmdline_file; @@ -44 +44 @@ -@@ -4363,6 +4365,38 @@ signal_handler(int signum __rte_unused) +@@ -4524,6 +4526,38 @@ signal_handler(int signum __rte_unused) @@ -83 +83 @@ -@@ -4394,6 +4428,12 @@ main(int argc, char** argv) +@@ -4555,6 +4589,12 @@ main(int argc, char** argv) @@ -96 +96 @@ -@@ -4587,6 +4627,11 @@ main(int argc, char** argv) +@@ -4756,6 +4796,11 @@ main(int argc, char** argv)