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 A5738470AE for ; Sun, 21 Dec 2025 16:04:25 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9EC4E402B5; Sun, 21 Dec 2025 16:04:25 +0100 (CET) Received: from PH8PR06CU001.outbound.protection.outlook.com (mail-westus3azon11012017.outbound.protection.outlook.com [40.107.209.17]) by mails.dpdk.org (Postfix) with ESMTP id C1F0B40612 for ; Sun, 21 Dec 2025 16:04:23 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YihYomf6JUpyceq8P9kN0E+maZSKRdgvASA7euKb/ybrdvqqIcjyq1atHRI9/dvndWH+Pta1mC3rZJxLbQMIJ3p7duD5CNkzo2oW7ttO9j+2vX86Cm52WJOX8ZCLU30FDqMrR6YzbM9v5cdMBtwJbEMZnwvzVw9joZ0E8X2EoKQknYdQrYGDVMHV5TSNKozx/LA5SyqnaJxiYdBgTc36wTYQBcXgzvt0SdMi3W16mGV52qjcUdPfJrO+dNiJk0ucV3T7rIQJkrYj5LoDyXyHehrAnIypw50X0reYOE2nmHVEwwXQT/CepT+p0BtlJnKPflxCwG5oBW01MF8T1Xc85A== 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=d6NiHUsSxyuUzNX/dlP07QTOWXk8yN6JCJkJT8T+ow8=; b=RY4h1ZRbUzsaHwIykfC5E/e6or+R7LQ06v4x2jpKf7+UCPA+EFee13FO9ye82pEEFiicraiAS/0bq/PGk6y5GTXt8aD+OlfALw1YBhbFIP2oChfSljJlELuvG9KFKAL66uibGR0wB+Lwok8VnjszEuqoHCjm5UHdPzZvhKPeOB+2OPoS5MRQzqNE80Cu4T7c2hiPk2gbdb4NVWNWtgr5U7xVqRqFuAmAKdqZoh3xS/do0z35sW12dlJR5zCDg/lOHnrBIT/cALsH1o2eK8NtX6UESG8cm+sYqWo1Fhx7P3P1cmSWKlq217HsjUfL1/9AELPiciDNM1CGlupENA2XPA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) 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=d6NiHUsSxyuUzNX/dlP07QTOWXk8yN6JCJkJT8T+ow8=; b=YL5GWTkGwQafIoYftAJKyXSlMxo1XyrJAAyfr3/e1zBLZj/hI9A6vRPoOvXL74tmqK4iayv/cA/56Saa/yaBjp6PNKbJjNUXu/HVfou/LB/UwEaTxWaMsoIcUii7PR0Y+Y+C6LDVAnhEyzOpfQXUD8XSA+Ae+PG+86SsF8O3r/KFi8QnZTvVegTFNbzpStLEoIJI+NSmqAtYkN72EkvbMcfb+lKZe0dhWh/XorSWyIQ4839nta10SlvqVCeIYcMtS5tTzztQj1FzVkjvTN1vACn4ysyU43oQOxjd5xH8oXVjRsrA27SpxkXZ4ETjC0gkGE5hy1UGb3Ol+VepD5wQIw== Received: from BY5PR16CA0008.namprd16.prod.outlook.com (2603:10b6:a03:1a0::21) by DM3PR12MB9351.namprd12.prod.outlook.com (2603:10b6:8:1ac::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9434.11; Sun, 21 Dec 2025 15:04:18 +0000 Received: from SJ5PEPF00000208.namprd05.prod.outlook.com (2603:10b6:a03:1a0:cafe::58) by BY5PR16CA0008.outlook.office365.com (2603:10b6:a03:1a0::21) 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 15:04:20 +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 SJ5PEPF00000208.mail.protection.outlook.com (10.167.244.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9434.6 via Frontend Transport; Sun, 21 Dec 2025 15:04:17 +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.2562.20; Sun, 21 Dec 2025 07:04:03 -0800 Received: from rnnvmail201.nvidia.com (10.129.68.8) 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.2562.20; Sun, 21 Dec 2025 07:04:03 -0800 Received: from nvidia.com (10.127.8.12) by mail.nvidia.com (10.129.68.8) 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 07:04:01 -0800 From: Shani Peretz To: Khadem Ullah <14pwcse1224@uetpeshawar.edu.pk> CC: Stephen Hemminger , dpdk stable Subject: patch 'app/testpmd: stop forwarding in secondary process' has been queued to stable release 23.11.6 Date: Sun, 21 Dec 2025 16:57:06 +0200 Message-ID: <20251221145746.763179-78-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: SJ5PEPF00000208:EE_|DM3PR12MB9351:EE_ X-MS-Office365-Filtering-Correlation-Id: e43293c3-1f23-4503-5673-08de40a236a2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|82310400026|36860700013|7053199007|13003099007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?EldvZSNTNTnLAs3REX6WjxbsR1BburM31xHo5sBa7EdPbuNFI8oXAfodb7U7?= =?us-ascii?Q?6aYk5rBRGHWO8JQ417aj4q9ebvwqbt8YVD7BCLrBzX96GCLUkFW+GtvyaYfo?= =?us-ascii?Q?zdHZdQcaPqvTUgo0NtvpoVHxSotrurvXNL6PFTl4bdnQ5GGdukAgbJxd30uP?= =?us-ascii?Q?OLFTdcbEyvjWdsR82HNSqE62Fuidqv55PZgEQHLcHBnlsHQvLbjqIi+/52fW?= =?us-ascii?Q?NUZjCcWuKlV1po3SmUkhBivUtlqNef+5/Y63BYP3Y0wDWuvgTFyJMcFf4MMB?= =?us-ascii?Q?hEur4ELaWnXmdUR44SwEt7AXTUlM0gw0wwVkHFKMAUbxeKbdSXB8JRnXvzX4?= =?us-ascii?Q?pyHPVNVma38+Q1jOROAs8AXrAC1qum/Cm5mpFkxucfUxay0Nm+VgCiZmUypd?= =?us-ascii?Q?uyG0nAjozvepgZgE31VYAcKhbRi/pmdCmYorYMvWaAB0xzqbtjYpRZnev1yI?= =?us-ascii?Q?gkApfka2uIn3f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9fQ3JNAfo8RUqufNM?= =?us-ascii?Q?RNdNWe9/6aDYNVxeRrblPjpZ45v2VJh3oBUB9bBt8NmLFo7v6MAv0GDw11W1?= =?us-ascii?Q?WdW06wUTcStxlUehZxZFVX9aGjn+p4oCplwY9a0NQU0kM1WpE54OQD5rDzMO?= =?us-ascii?Q?uEwmWkmAA4wNn6B5Q1Oy3+sQCiyFwlg11RRcu782UZDkdAPr6yaR62kUiPbv?= =?us-ascii?Q?cq6vvcWdK4sQCESyZ/qypMa6Wg57igWFX9P26+E6?= 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:(13230040)(376014)(1800799024)(82310400026)(36860700013)(7053199007)(13003099007); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2025 15:04:17.7368 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e43293c3-1f23-4503-5673-08de40a236a2 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: SJ5PEPF00000208.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR12MB9351 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/2d8360178973a9edbe57b909daca36b023637420 Thanks. Shani --- >From 2d8360178973a9edbe57b909daca36b023637420 Mon Sep 17 00:00:00 2001 From: Khadem Ullah <14pwcse1224@uetpeshawar.edu.pk> Date: Wed, 17 Sep 2025 23:47:03 -0700 Subject: [PATCH] app/testpmd: stop forwarding in secondary process [ upstream commit f96273c8e9d39e472bb07acc05e493b1e712e51b ] When the secondary process testpmd application running any fwd_engine and after that primary has exited will cause a crash. This patch forces secondary process forwarding lcores in fwd_engine to stop before the primary process exits. Fixes: a550baf24af90f ("app/testpmd: support multi-process") Signed-off-by: Khadem Ullah <14pwcse1224@uetpeshawar.edu.pk> Signed-off-by: Stephen Hemminger --- app/test-pmd/testpmd.c | 103 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 99 insertions(+), 4 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index d7db1d6afb..bbd8ad2c2d 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -3778,6 +3778,83 @@ detach_devargs(char *identifier) rte_devargs_reset(&da); } +#ifndef RTE_EXEC_ENV_WINDOWS + +enum testpmd_req_type { + TESTPMD_REQ_TYPE_EXIT, +}; + +struct testpmd_mp_req { + enum testpmd_req_type t; +}; + +struct testpmd_mp_resp { + int result; +}; + +#define TESTPMD_MP "mp_testpmd" + +/* Send reply to this peer when testpmd exits */ +static RTE_ATOMIC(const char *) primary_name; + +static void +reply_to_primary(const char *peer, int result) +{ + struct rte_mp_msg reply = { }; + struct testpmd_mp_resp *resp = (struct testpmd_mp_resp *) &reply.param; + + strlcpy(reply.name, TESTPMD_MP, RTE_MP_MAX_NAME_LEN); + reply.len_param = sizeof(*resp); + resp->result = result; + + printf("Replying %d to primary\n", result); + fflush(stdout); + + if (rte_mp_reply(&reply, peer) < 0) + printf("Failed to send response to primary:%s", strerror(rte_errno)); +} + +/* Primary process is exiting, stop secondary process */ +static void +pmd_notify_secondary(void) +{ + struct testpmd_mp_req request = { + .t = TESTPMD_REQ_TYPE_EXIT, + }; + struct rte_mp_msg mp_req = { + .name = TESTPMD_MP, + .len_param = sizeof(request), + }; + struct rte_mp_reply reply; + struct timespec ts = {.tv_sec = 5, .tv_nsec = 0}; + + printf("\nPrimary: Sending 'stop_req' request to secondary...\n"); + fflush(stdout); + + memcpy(mp_req.param, &request, sizeof(request)); + rte_mp_request_sync(&mp_req, &reply, &ts); +} + +static int +handle_testpmd_request(const struct rte_mp_msg *request, const void *peer) +{ + const struct testpmd_mp_req *req = (const struct testpmd_mp_req *)request->param; + + if (req->t == TESTPMD_REQ_TYPE_EXIT) { + printf("\nReceived notification of primary exiting\n"); + fflush(stdout); + + /* Response is sent after forwarding loop exits */ + rte_atomic_store_explicit(&primary_name, peer, rte_memory_order_relaxed); + + kill(getpid(), SIGINT); + } else { + reply_to_primary(peer, -EINVAL); + } + return 0; +} +#endif + void pmd_test_exit(void) { @@ -3789,6 +3866,10 @@ pmd_test_exit(void) stop_packet_forwarding(); #ifndef RTE_EXEC_ENV_WINDOWS + /* Tell secondary to exit */ + if (rte_eal_process_type() == RTE_PROC_PRIMARY) + pmd_notify_secondary(); + for (i = 0 ; i < RTE_DIM(mempools) ; i++) { if (mempools[i]) { if (mp_alloc_type == MP_ALLOC_ANON) @@ -4590,9 +4671,12 @@ main(int argc, char** argv) 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"); + if (rte_eal_process_type() == RTE_PROC_SECONDARY) { + if (enable_primary_monitor() < 0) + rte_exit(EXIT_FAILURE, "Cannot setup primary monitor"); + if (rte_mp_action_register(TESTPMD_MP, handle_testpmd_request) < 0) + rte_exit(EXIT_FAILURE, "Failed to register message action\n"); + } #endif /* allocate port structures, and init them */ @@ -4797,12 +4881,23 @@ main(int argc, char** argv) } #ifndef RTE_EXEC_ENV_WINDOWS - if (rte_eal_process_type() == RTE_PROC_SECONDARY) + if (rte_eal_process_type() == RTE_PROC_SECONDARY) { disable_primary_monitor(); + rte_mp_action_unregister(TESTPMD_MP); + } #endif pmd_test_exit(); +#ifndef RTE_EXEC_ENV_WINDOWS + if (rte_eal_process_type() == RTE_PROC_SECONDARY) { + const char *peer = rte_atomic_exchange_explicit(&primary_name, NULL, + rte_memory_order_relaxed); + if (peer) + reply_to_primary(peer, 0); + } +#endif + #ifdef RTE_LIB_PDUMP /* uninitialize packet capture framework */ rte_pdump_uninit(); -- 2.43.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-12-21 16:54:21.070781000 +0200 +++ 0078-app-testpmd-stop-forwarding-in-secondary-process.patch 2025-12-21 16:54:17.335110000 +0200 @@ -1 +1 @@ -From f96273c8e9d39e472bb07acc05e493b1e712e51b Mon Sep 17 00:00:00 2001 +From 2d8360178973a9edbe57b909daca36b023637420 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit f96273c8e9d39e472bb07acc05e493b1e712e51b ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -22 +23 @@ -index 1a48b00e93..2360da3a48 100644 +index d7db1d6afb..bbd8ad2c2d 100644 @@ -25 +26 @@ -@@ -3610,6 +3610,83 @@ detach_devargs(char *identifier) +@@ -3778,6 +3778,83 @@ detach_devargs(char *identifier) @@ -109 +110 @@ -@@ -3621,6 +3698,10 @@ pmd_test_exit(void) +@@ -3789,6 +3866,10 @@ pmd_test_exit(void) @@ -120 +121 @@ -@@ -4430,9 +4511,12 @@ main(int argc, char** argv) +@@ -4590,9 +4671,12 @@ main(int argc, char** argv) @@ -136 +137 @@ -@@ -4634,12 +4718,23 @@ main(int argc, char** argv) +@@ -4797,12 +4881,23 @@ main(int argc, char** argv)