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 86B1946B72 for ; Mon, 14 Jul 2025 17:13:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 81829402EE; Mon, 14 Jul 2025 17:13:04 +0200 (CEST) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by mails.dpdk.org (Postfix) with ESMTP id 24C87402EE for ; Mon, 14 Jul 2025 17:13:03 +0200 (CEST) Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4560add6cd2so14009365e9.0 for ; Mon, 14 Jul 2025 08:13:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752505983; x=1753110783; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=C7GEMmw88nyXPWNvC3MDoOcwSE13mLR0OavIjZE9KdQ=; b=UB3X7J0LmLbUBHMBhUd7PqpCCZJ5DMtz7ivcj4Vk34kIKQ5J3AZZoKctJt98PQy4v5 c1P0bDEyClErvCMVrhL39IeqIAhnBRQB/zfJU5FbATXxJE+loMaikKyS6xQ21ej7b9jo em6y7HuM5fkJDCQxUHJPTQ/43TdC23AbisJtJwHuWli7/6m/xQnLupKis/sIRC4dsHV0 A1YFy63EZEqfDy2D9TsJjMNmhCbw+pqEjJPk5E/5e9BtUiFGz/fqPXLQwHefbvfjKivC Fh9SxF9qOFr9mOlcrYgflYDD6qWSmUgnNBTMi0ciuVZcgDfdXXJy7QXpuLSdmbbTeDpM ffzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752505983; x=1753110783; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=C7GEMmw88nyXPWNvC3MDoOcwSE13mLR0OavIjZE9KdQ=; b=BjH1KjEP8hEJjm0rvZZiUMHAtoryHATh0xLfRbpVDOBGvAQ2sl1lur+09OQ/C+FFrq MwQNxfuq3te4PfSZrX/gE4wEyowHZvXrYXVb+sUus9k7/0mzUx6tNIIeAkEmCNPnJL2K D6Tg6vHcoi3x6qFD18jHL1FBBRbtmoKxWuEaYoWKVOFgw0mbLXvFqhJBdz47FhQI6n1m jU+uC6Qprxd/ZaP2RGG4clscf71LndPtjdBI2oLRBkeZ0HtXVmJMfYxLsybNHshKzHDs JJ1mbPu/fKpaQ7wOhQeS8bP38KMpTCiD7xSnZx3t6OT/ezK4B1Dj7bNGZRuPzQg78uBe u4qA== X-Forwarded-Encrypted: i=1; AJvYcCXB6fXunvuW1K4M4MF1ou4bHgmzN/2SacdCSXsFwTtqxw1xrfdL0OEDgp4R/PT1eXOsTj4DAkY=@dpdk.org X-Gm-Message-State: AOJu0YxssyCtsJjlsIhg2LGLkFQYnjRAE63G7rwMCSqX0i3kCF2XxwQy cAKaNTvg5FHsCc8BST2J0chD2PovSH3I6Ia1V4Ypjs+Vuk1D79bbLkBl X-Gm-Gg: ASbGncvxxkNrq1USgfVGXx0d/QT6b1IdDkfXPvNOTxnzmhOzxZX12jsWTBShtdMGYmh I0rn7LIQFFrdnwljJjXlUeWDPVGyiXHi5iF6YHRdUC1n+A146b0y5xsXmaGjquwY3Lainh0NZef mYwEU25Ap4h2gOdTsS/eVx7u0pesC8iZDCPmVPVOYvZc/7ywM+B0yR3CSGcvdHM2esaOgkQp2rB YUwYanpTJzmkliX6kOAmAfPBDNAJqkQIjc18gpG/TAs87aTsissypxhjV5JUnCaq/cKfQVJLNzP JwiKIvYtmRodX0X7TErWaNLImqp+2VnmLVMmiwcV3ouHogIgN7YsBfGFZ8hv/+JFpZSapRmJkXy UX8KYrONtgG4TTY+XdB8tt7SJw4tb X-Google-Smtp-Source: AGHT+IE4NhmrvzwoSDojiJUJWuNDiH99L+gnGgFn61ZgVuk/eY+syXBPe26QUCON3n3Pz9yLuT1YWA== X-Received: by 2002:a05:600c:4584:b0:453:5c7e:a806 with SMTP id 5b1f17b1804b1-454db8991bcmr175219695e9.8.1752505982439; Mon, 14 Jul 2025 08:13:02 -0700 (PDT) Received: from localhost ([2a01:4b00:d036:ae00:a923:75e5:f97f:ef33]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-3b5e8e0dbddsm12897519f8f.63.2025.07.14.08.13.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Jul 2025 08:13:01 -0700 (PDT) From: luca.boccassi@gmail.com To: Maayan Kashani Cc: Anatoly Burakov , dpdk stable Subject: patch 'examples/multi_process: fix ports cleanup on exit' has been queued to stable release 22.11.9 Date: Mon, 14 Jul 2025 16:11:14 +0100 Message-ID: <20250714151121.219866-19-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250714151121.219866-1-luca.boccassi@gmail.com> References: <20250630122556.1133654-23-luca.boccassi@gmail.com> <20250714151121.219866-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 22.11.9 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/16/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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/a7b1c6735f340fdb92d114160a9d05af81daebec Thanks. Luca Boccassi --- >From a7b1c6735f340fdb92d114160a9d05af81daebec Mon Sep 17 00:00:00 2001 From: Maayan Kashani Date: Tue, 8 Jul 2025 10:09:54 +0300 Subject: [PATCH] examples/multi_process: fix ports cleanup on exit [ upstream commit 4382d58097b41d1e1229ce5fc2943994bf44bd83 ] Device was started but not stopped on exit signal. Added port stop and close on exit. Fixes: af75078fece3 ("first public release") Signed-off-by: Maayan Kashani Acked-by: Anatoly Burakov --- examples/multi_process/symmetric_mp/main.c | 27 ++++++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c index 1ff85875df..2dbbaa06f5 100644 --- a/examples/multi_process/symmetric_mp/main.c +++ b/examples/multi_process/symmetric_mp/main.c @@ -92,6 +92,25 @@ smp_usage(const char *prgname, const char *errmsg) exit(1); } +static void +exit_cleanup(void) +{ + unsigned int i; + + RTE_LOG(INFO, APP, "Close ports.\n"); + for (i = 0; i < num_ports; i++) { + if (rte_eal_process_type() == RTE_PROC_PRIMARY) { + if (rte_eth_dev_stop(ports[i])) + rte_exit(EXIT_FAILURE, "Error stopping ports\n"); + if (rte_eth_dev_close(ports[i])) + rte_exit(EXIT_FAILURE, "Error closing ports\n"); + } + } + + /* clean up the EAL */ + rte_eal_cleanup(); + exit(0); +} /* signal handler configured for SIGTERM and SIGINT to print stats on exit */ static void @@ -104,9 +123,10 @@ print_stats(int signum) printf("Port %u: RX - %u, TX - %u, Drop - %u\n", (unsigned)p_num, pstats[p_num].rx, pstats[p_num].tx, pstats[p_num].drop); } - exit(0); + exit_cleanup(); } + /* Parse the argument given in the command line of the application */ static int smp_parse_args(int argc, char **argv) @@ -486,8 +506,5 @@ main(int argc, char **argv) rte_eal_mp_remote_launch(lcore_main, NULL, CALL_MAIN); - /* clean up the EAL */ - rte_eal_cleanup(); - - return 0; + exit_cleanup(); } -- 2.47.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-07-14 16:09:41.409143407 +0100 +++ 0019-examples-multi_process-fix-ports-cleanup-on-exit.patch 2025-07-14 16:09:40.720449163 +0100 @@ -1 +1 @@ -From 4382d58097b41d1e1229ce5fc2943994bf44bd83 Mon Sep 17 00:00:00 2001 +From a7b1c6735f340fdb92d114160a9d05af81daebec Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 4382d58097b41d1e1229ce5fc2943994bf44bd83 ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -19 +20 @@ -index f7d8439cd4..de16608a0f 100644 +index 1ff85875df..2dbbaa06f5 100644