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 376A8A0A0E for ; Mon, 10 May 2021 18:24:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2D1D54003E; Mon, 10 May 2021 18:24:26 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2051.outbound.protection.outlook.com [40.107.244.51]) by mails.dpdk.org (Postfix) with ESMTP id C408D4003E for ; Mon, 10 May 2021 18:24:24 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y8Flx3hCu2juU14XcOjw+3FIPhBYkY93Up4g3ntEmYCXiOmV8fdIIWvhbvLt5of6L8N+EWejueBvJVoH+1kiFSsXb6fsYbg/uvpKs3j9xZ8aEdrsiJrttHfBnoYAjrnm4fbRAumD3ArUR32obXSxhRHpmt3eEc6OCsrbt+Yhmf/TIHX/D42gW+kH35FO31H86BaUHXf0lqiK75xICekiThzOExPtLEVlfpcV97HoNRq6rgIMdl4FA+3UV40wyFFgfyJgF0If7/bwJPn0IpKS0R7juav3Y2bSjLewF78Wd82RSIudLcZNpqhUpN/VaQF+HykvX/Unnh4+3CPffL0l/w== 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-SenderADCheck; bh=NnZgDBhzKf0i57K2oqnQqhKnErrCrzINkACmtjVSsdw=; b=b0bUVo3U6UvthDoZ6ea6oCguS1MMYFDWjmZXE9ry3j/o+Cg39Ut4iFs9BmWtLEAw3ghp+wJnIBRhjj3vVMRYmQpEhl3+YcDZ+fyp1l2M83czQ4O6/X6/zkHB4bF4qYWL2N7+er7//JImvqo5UbcJBvcCBXdPt4xK9qSI0vouDe7uVPwU624ETAzYyI5aIpJKAzJQSd6xSp7iKrkc9/9Np4XAZOrfKzlt+rcU/90mRiCIj3c7sWBU2/MqJ826rL9mTW4e4i5lCdLQ2JIkAovGBYdVhb28V1XiYWXt+ziRfCHAtBBLbs8GxFPBOBM36XpUEtEHPORQ9cGftlfiQ0fx5g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none 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=NnZgDBhzKf0i57K2oqnQqhKnErrCrzINkACmtjVSsdw=; b=EzMLIpvo1P3SGOow6dwSJmChEPUKAha88aClaxHXimvV+tDm5zI6OYsmAjhqzoRyHMacOGXLMvO/VIyafHjvjFLjiIH9Vup0XpIJ8+byau3hIdt818SJIfaW1oPPp65r+Z7KQZFps4lZEhWEDIQMcsJD+abJrK1L2EWcOUJyhy4VbsGdJtbeW05MkBQHDm2rT8J2agls8rF6cFVvzSj33Lzt8KqQBhp5EJQbjPKpHQe97dwwbauWa4s/9LdtN6BZ73uk6iTaFYh6wTCvTNJKBPOkoiwjThICzJoO3jEn13rUpVbgjU2XYY0A5WMw//EpiXaUP+7/D+hdjIMzHqsGbQ== Received: from BN6PR1101CA0011.namprd11.prod.outlook.com (2603:10b6:405:4a::21) by BYAPR12MB4727.namprd12.prod.outlook.com (2603:10b6:a03:99::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.27; Mon, 10 May 2021 16:24:22 +0000 Received: from BN8NAM11FT003.eop-nam11.prod.protection.outlook.com (2603:10b6:405:4a:cafe::b) by BN6PR1101CA0011.outlook.office365.com (2603:10b6:405:4a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.24 via Frontend Transport; Mon, 10 May 2021 16:24:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT003.mail.protection.outlook.com (10.13.177.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 16:24:21 +0000 Received: from nvidia.com (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 10 May 2021 16:24:19 +0000 From: Xueming Li To: Chengchang Tang CC: Luca Boccassi , dpdk stable Date: Tue, 11 May 2021 00:02:41 +0800 Message-ID: <20210510160258.30982-212-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210510160258.30982-1-xuemingl@nvidia.com> References: <20210510160258.30982-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5f58f30f-34ae-4905-f987-08d913d011b8 X-MS-TrafficTypeDiagnostic: BYAPR12MB4727: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2201; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sloDbnMC7cZwmKqwzQ4Hi24qGQnQL7qtZNrT8UGUVFAHaG9XEkOSyYSyYma3DdMhe8GZFFbB98qJIiOOmL4qpUbVJdNMiI9S0EimvaaAJnGPdlm1WhYfzm1Y8fNRsy+cr33IMQOa5t6L/hI+a4V62hM04hTP1rTHsYOt47zVax2y7LLFKRVUN3KR58PIPSUQXxcR0wb0gws1s9nIPXkUBqjdX0RzNyZBlAQ0Vq/WSR+MhG+HzYJzmE3EQ/GZiAtmiQZ7zd2p+DGE8jSOD6eSwQJhlHEq0njiM8IDX2uYUpzHxW4/XZDcPZsVcAQbeSNIs7bTfQJ1jir2xUrtQ8+1LJKwdgiXbhJ3pdKnanfnGXxouXeg2xRG1aMjnyOin2EVDFet3n6kYfO+O49GLrKO5HJHFzdX0SteX6uzk6L5MCAXF/nUPMb31GFBW6EBtvlPM7yn5+wujbIv5BJw4tXOlB7P1Ueg+fDyyq4nd9MiN8nVhTvJVtLGNTVeiRena5UhmRTqF8npkGY9yIuXJWF2AxBQSWhYxzKotdkIHnGm4cjsmwBbHB7zhuGX/gPiH3OjtI75vBEZOXXPZt6g1ZwERVBASiY3l6K11DA28VnVEDNaCf7wgDS5NgGGJRqT4EdAv/okqqpN/apK4Zn3oI3baNZLF3iyekxKGvHLMlIfZlS6WilIyANmwS5ytk6lI/bCHDpsnQVDEIp8teaMpwRljKuDCfGAg06taiOpoHF/VRE= X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(376002)(39860400002)(396003)(346002)(136003)(46966006)(36840700001)(70206006)(70586007)(83380400001)(30864003)(7696005)(55016002)(53546011)(36860700001)(47076005)(82740400003)(966005)(356005)(2616005)(7636003)(1076003)(426003)(336012)(26005)(2906002)(86362001)(16526019)(6286002)(54906003)(8676002)(6666004)(6916009)(316002)(36906005)(4326008)(478600001)(186003)(36756003)(5660300002)(82310400003)(8936002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 16:24:21.9157 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5f58f30f-34ae-4905-f987-08d913d011b8 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT003.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB4727 Subject: [dpdk-stable] patch 'examples: add eal cleanup to examples' has been queued to stable release 20.11.2 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/12/21. 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/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/aa94d640eb5174b0eb0af7ca658a5a76a6bb2d0c Thanks. Xueming Li --- >From aa94d640eb5174b0eb0af7ca658a5a76a6bb2d0c Mon Sep 17 00:00:00 2001 From: Chengchang Tang Date: Thu, 15 Apr 2021 10:26:03 +0800 Subject: [PATCH] examples: add eal cleanup to examples Cc: Luca Boccassi [ upstream commit 10aa375704c148d9e90b5e984066d719f7465357 ] According to the programming guide, the rte_eal_init should be used pairs with rte_eal_cleanup. This patch add rte_eal_cleanup to examples to encourage new users of DPDK to use it. Fixes: aec9c13c5257 ("eal: add function to release internal resources") Fixes: 3d0fad56b74a ("examples/fips_validation: add crypto FIPS application") Fixes: c8e6ceecebc1 ("examples/ioat: add new sample app for ioat driver") Fixes: 4ff457986f76 ("examples/l2fwd-event: add default poll mode routines") Fixes: 08bd1a174461 ("examples/l3fwd-graph: add graph-based l3fwd skeleton") Fixes: c5eebf85badc ("examples/ntb: add example for NTB") Fixes: b77f66002812 ("examples/pipeline: add new example application") Fixes: edbed86d1cc3 ("examples/vdpa: introduce a new sample for vDPA") Fixes: c19beb3f38cd ("examples/vhost_blk: introduce vhost storage sample") Fixes: f5188211c721 ("examples/vhost_crypto: add sample application") Signed-off-by: Chengchang Tang --- examples/bbdev_app/main.c | 3 +++ examples/bond/main.c | 4 ++++ examples/cmdline/main.c | 3 +++ examples/distributor/main.c | 3 +++ examples/ethtool/ethtool-app/main.c | 3 +++ examples/fips_validation/main.c | 3 +++ examples/flow_classify/flow_classify.c | 3 +++ examples/flow_filtering/main.c | 7 ++++++- examples/helloworld/main.c | 4 ++++ examples/ioat/ioatfwd.c | 3 +++ examples/ip_fragmentation/main.c | 3 +++ examples/ip_reassembly/main.c | 3 +++ examples/ipsec-secgw/ipsec-secgw.c | 3 +++ examples/ipv4_multicast/main.c | 3 +++ examples/kni/main.c | 3 +++ examples/l2fwd-cat/l2fwd-cat.c | 3 +++ examples/l2fwd-crypto/main.c | 3 +++ examples/l2fwd-event/main.c | 3 +++ examples/l2fwd-jobstats/main.c | 3 +++ examples/l2fwd-keepalive/main.c | 4 ++++ examples/l2fwd/main.c | 3 +++ examples/l3fwd-acl/main.c | 3 +++ examples/l3fwd-graph/main.c | 3 +++ examples/l3fwd/main.c | 4 ++++ examples/link_status_interrupt/main.c | 3 +++ examples/multi_process/client_server_mp/mp_client/client.c | 3 +++ examples/multi_process/client_server_mp/mp_server/main.c | 4 ++++ examples/multi_process/simple_mp/main.c | 4 ++++ examples/multi_process/symmetric_mp/main.c | 3 +++ examples/ntb/ntb_fwd.c | 3 +++ examples/packet_ordering/main.c | 4 ++++ examples/performance-thread/l3fwd-thread/main.c | 3 +++ examples/performance-thread/pthread_shim/main.c | 4 ++++ examples/pipeline/main.c | 3 +++ examples/ptpclient/ptpclient.c | 3 +++ examples/qos_meter/main.c | 3 +++ examples/qos_sched/main.c | 3 +++ examples/rxtx_callbacks/main.c | 4 ++++ examples/server_node_efd/node/node.c | 3 +++ examples/server_node_efd/server/main.c | 4 ++++ examples/service_cores/main.c | 3 +++ examples/skeleton/basicfwd.c | 3 +++ examples/timer/main.c | 3 +++ examples/vdpa/main.c | 3 +++ examples/vhost/main.c | 4 +++- examples/vhost_blk/vhost_blk.c | 3 +++ examples/vhost_crypto/main.c | 3 +++ examples/vm_power_manager/guest_cli/main.c | 3 +++ examples/vm_power_manager/main.c | 3 +++ examples/vmdq/main.c | 3 +++ examples/vmdq_dcb/main.c | 3 +++ 51 files changed, 166 insertions(+), 2 deletions(-) diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c index 20cfd327fb..5251db0b16 100644 --- a/examples/bbdev_app/main.c +++ b/examples/bbdev_app/main.c @@ -1195,5 +1195,8 @@ main(int argc, char **argv) ret |= rte_eal_wait_lcore(lcore_id); } + /* clean up the EAL */ + rte_eal_cleanup(); + return ret; } diff --git a/examples/bond/main.c b/examples/bond/main.c index 81a6fa976b..f48400e211 100644 --- a/examples/bond/main.c +++ b/examples/bond/main.c @@ -876,5 +876,9 @@ main(int argc, char *argv[]) prompt(NULL); rte_delay_ms(100); + + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/cmdline/main.c b/examples/cmdline/main.c index bb79542452..94002f0582 100644 --- a/examples/cmdline/main.c +++ b/examples/cmdline/main.c @@ -36,5 +36,8 @@ int main(int argc, char **argv) cmdline_interact(cl); cmdline_stdin_exit(cl); + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/distributor/main.c b/examples/distributor/main.c index caa7c46cb1..1b1029660e 100644 --- a/examples/distributor/main.c +++ b/examples/distributor/main.c @@ -932,5 +932,8 @@ main(int argc, char *argv[]) rte_free(pd); rte_free(pr); + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/ethtool/ethtool-app/main.c b/examples/ethtool/ethtool-app/main.c index c6023a1d41..21ed85c7d6 100644 --- a/examples/ethtool/ethtool-app/main.c +++ b/examples/ethtool/ethtool-app/main.c @@ -299,5 +299,8 @@ int main(int argc, char **argv) return -1; } + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c index cad6bcb180..a7259173ec 100644 --- a/examples/fips_validation/main.c +++ b/examples/fips_validation/main.c @@ -483,6 +483,9 @@ exit: fips_test_clear(); cryptodev_fips_validate_app_uninit(); + /* clean up the EAL */ + rte_eal_cleanup(); + return ret; } diff --git a/examples/flow_classify/flow_classify.c b/examples/flow_classify/flow_classify.c index 335d7d2ad8..5c3e111cfa 100644 --- a/examples/flow_classify/flow_classify.c +++ b/examples/flow_classify/flow_classify.c @@ -853,5 +853,8 @@ main(int argc, char *argv[]) /* Call lcore_main on the main core only. */ lcore_main(cls_app); + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/flow_filtering/main.c b/examples/flow_filtering/main.c index 93523d625b..932f49fa7f 100644 --- a/examples/flow_filtering/main.c +++ b/examples/flow_filtering/main.c @@ -259,5 +259,10 @@ main(int argc, char **argv) rte_exit(EXIT_FAILURE, "error in creating flow"); } - return main_loop(); + ret = main_loop(); + + /* clean up the EAL */ + rte_eal_cleanup(); + + return ret; } diff --git a/examples/helloworld/main.c b/examples/helloworld/main.c index 8a4cee60ff..ac72145c73 100644 --- a/examples/helloworld/main.c +++ b/examples/helloworld/main.c @@ -43,5 +43,9 @@ main(int argc, char **argv) lcore_hello(NULL); rte_eal_mp_wait_lcore(); + + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/ioat/ioatfwd.c b/examples/ioat/ioatfwd.c index 6502e4531f..845301a6db 100644 --- a/examples/ioat/ioatfwd.c +++ b/examples/ioat/ioatfwd.c @@ -1011,6 +1011,9 @@ main(int argc, char **argv) rte_ring_free(cfg.ports[i].rx_to_tx_ring); } + /* clean up the EAL */ + rte_eal_cleanup(); + printf("Bye...\n"); return 0; } diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c index 5a96841dfc..77a6a18d19 100644 --- a/examples/ip_fragmentation/main.c +++ b/examples/ip_fragmentation/main.c @@ -1075,5 +1075,8 @@ main(int argc, char **argv) return -1; } + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c index 954a11512a..ce8882a458 100644 --- a/examples/ip_reassembly/main.c +++ b/examples/ip_reassembly/main.c @@ -1201,5 +1201,8 @@ main(int argc, char **argv) return -1; } + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c index 20d69ba813..1efcb5e635 100644 --- a/examples/ipsec-secgw/ipsec-secgw.c +++ b/examples/ipsec-secgw/ipsec-secgw.c @@ -3037,6 +3037,9 @@ main(int32_t argc, char **argv) rte_eth_dev_close(portid); printf(" Done\n"); } + + /* clean up the EAL */ + rte_eal_cleanup(); printf("Bye...\n"); return 0; diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c index e18726a5d2..fd6207a18b 100644 --- a/examples/ipv4_multicast/main.c +++ b/examples/ipv4_multicast/main.c @@ -805,5 +805,8 @@ main(int argc, char **argv) return -1; } + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/kni/main.c b/examples/kni/main.c index fe93b8618a..beabb3c848 100644 --- a/examples/kni/main.c +++ b/examples/kni/main.c @@ -1140,5 +1140,8 @@ main(int argc, char** argv) kni_port_params_array[i] = NULL; } + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/l2fwd-cat/l2fwd-cat.c b/examples/l2fwd-cat/l2fwd-cat.c index 2e632c5cb6..02288a3824 100644 --- a/examples/l2fwd-cat/l2fwd-cat.c +++ b/examples/l2fwd-cat/l2fwd-cat.c @@ -201,5 +201,8 @@ main(int argc, char *argv[]) /* Call lcore_main on the main core only. */ lcore_main(); + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c index 656b140368..05f953e242 100644 --- a/examples/l2fwd-crypto/main.c +++ b/examples/l2fwd-crypto/main.c @@ -2825,5 +2825,8 @@ main(int argc, char **argv) return -1; } + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/l2fwd-event/main.c b/examples/l2fwd-event/main.c index 444ee4e4db..0acfee4c92 100644 --- a/examples/l2fwd-event/main.c +++ b/examples/l2fwd-event/main.c @@ -716,6 +716,9 @@ main(int argc, char **argv) printf(" Done\n"); } } + + /* clean up the EAL */ + rte_eal_cleanup(); printf("Bye...\n"); return 0; diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c index 1151769aa9..58a722669b 100644 --- a/examples/l2fwd-jobstats/main.c +++ b/examples/l2fwd-jobstats/main.c @@ -1022,5 +1022,8 @@ main(int argc, char **argv) return -1; } + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c index e4c2b27933..be6616288f 100644 --- a/examples/l2fwd-keepalive/main.c +++ b/examples/l2fwd-keepalive/main.c @@ -817,5 +817,9 @@ main(int argc, char **argv) if (ka_shm != NULL) rte_keepalive_shm_cleanup(ka_shm); + + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c index 3377b08322..ffb67bb901 100644 --- a/examples/l2fwd/main.c +++ b/examples/l2fwd/main.c @@ -903,6 +903,9 @@ main(int argc, char **argv) rte_eth_dev_close(portid); printf(" Done\n"); } + + /* clean up the EAL */ + rte_eal_cleanup(); printf("Bye...\n"); return ret; diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c index 961594f5fe..a449fc9f1b 100644 --- a/examples/l3fwd-acl/main.c +++ b/examples/l3fwd-acl/main.c @@ -2257,5 +2257,8 @@ main(int argc, char **argv) return -1; } + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/l3fwd-graph/main.c b/examples/l3fwd-graph/main.c index 127c5e8dab..75c2e0ef3f 100644 --- a/examples/l3fwd-graph/main.c +++ b/examples/l3fwd-graph/main.c @@ -1123,6 +1123,9 @@ main(int argc, char **argv) rte_eth_dev_close(portid); printf(" Done\n"); } + + /* clean up the EAL */ + rte_eal_cleanup(); printf("Bye...\n"); return ret; diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index bb49e5faff..ee156d13a6 100644 --- a/examples/l3fwd/main.c +++ b/examples/l3fwd/main.c @@ -1315,6 +1315,10 @@ main(int argc, char **argv) printf(" Done\n"); } } + + /* clean up the EAL */ + rte_eal_cleanup(); + printf("Bye...\n"); return ret; diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c index f1653b4fb8..6cffd5a827 100644 --- a/examples/link_status_interrupt/main.c +++ b/examples/link_status_interrupt/main.c @@ -731,5 +731,8 @@ main(int argc, char **argv) return -1; } + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/multi_process/client_server_mp/mp_client/client.c b/examples/multi_process/client_server_mp/mp_client/client.c index 361d90b54b..6d4c246816 100644 --- a/examples/multi_process/client_server_mp/mp_client/client.c +++ b/examples/multi_process/client_server_mp/mp_client/client.c @@ -268,4 +268,7 @@ main(int argc, char *argv[]) need_flush = 1; } + + /* clean up the EAL */ + rte_eal_cleanup(); } diff --git a/examples/multi_process/client_server_mp/mp_server/main.c b/examples/multi_process/client_server_mp/mp_server/main.c index b18e12dd4b..9bcee460fd 100644 --- a/examples/multi_process/client_server_mp/mp_server/main.c +++ b/examples/multi_process/client_server_mp/mp_server/main.c @@ -304,5 +304,9 @@ main(int argc, char *argv[]) rte_eal_mp_remote_launch(sleep_lcore, NULL, SKIP_MAIN); do_packet_forwarding(); + + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/multi_process/simple_mp/main.c b/examples/multi_process/simple_mp/main.c index 109b8bb45d..a05404f7ed 100644 --- a/examples/multi_process/simple_mp/main.c +++ b/examples/multi_process/simple_mp/main.c @@ -121,5 +121,9 @@ main(int argc, char **argv) cmdline_stdin_exit(cl); rte_eal_mp_wait_lcore(); + + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c index ae7f5e0d50..79e5c61e40 100644 --- a/examples/multi_process/symmetric_mp/main.c +++ b/examples/multi_process/symmetric_mp/main.c @@ -472,5 +472,8 @@ main(int argc, char **argv) rte_eal_mp_remote_launch(lcore_main, NULL, CALL_MAIN); + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/ntb/ntb_fwd.c b/examples/ntb/ntb_fwd.c index 54b7f08964..e9a3887106 100644 --- a/examples/ntb/ntb_fwd.c +++ b/examples/ntb/ntb_fwd.c @@ -1498,5 +1498,8 @@ main(int argc, char **argv) start_pkt_fwd(); } + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c index 963b11d6de..66b5c888a9 100644 --- a/examples/packet_ordering/main.c +++ b/examples/packet_ordering/main.c @@ -776,5 +776,9 @@ main(int argc, char **argv) } print_stats(); + + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c index 4d82fb82ef..9830efb96f 100644 --- a/examples/performance-thread/l3fwd-thread/main.c +++ b/examples/performance-thread/l3fwd-thread/main.c @@ -3777,5 +3777,8 @@ main(int argc, char **argv) } } + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/performance-thread/pthread_shim/main.c b/examples/performance-thread/pthread_shim/main.c index 23e3b5e311..241267fd9e 100644 --- a/examples/performance-thread/pthread_shim/main.c +++ b/examples/performance-thread/pthread_shim/main.c @@ -258,5 +258,9 @@ int main(int argc, char **argv) RTE_LCORE_FOREACH_WORKER(lcore_id) { rte_eal_wait_lcore(lcore_id); } + + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/pipeline/main.c b/examples/pipeline/main.c index fb57ef31fe..8ea19f9dd5 100644 --- a/examples/pipeline/main.c +++ b/examples/pipeline/main.c @@ -190,4 +190,7 @@ main(int argc, char **argv) conn_poll_for_msg(conn); } + + /* clean up the EAL */ + rte_eal_cleanup(); } diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c index 5d4bdbd43f..a8b1b85c6d 100644 --- a/examples/ptpclient/ptpclient.c +++ b/examples/ptpclient/ptpclient.c @@ -781,5 +781,8 @@ main(int argc, char *argv[]) /* Call lcore_main on the main core only. */ lcore_main(); + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c index f2d9c28828..6e724f3783 100644 --- a/examples/qos_meter/main.c +++ b/examples/qos_meter/main.c @@ -460,5 +460,8 @@ main(int argc, char **argv) return -1; } + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/qos_sched/main.c b/examples/qos_sched/main.c index a6071b991c..dc6a17a646 100644 --- a/examples/qos_sched/main.c +++ b/examples/qos_sched/main.c @@ -218,5 +218,8 @@ main(int argc, char **argv) } } + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c index 35c6c39807..b57b2fc6bc 100644 --- a/examples/rxtx_callbacks/main.c +++ b/examples/rxtx_callbacks/main.c @@ -338,5 +338,9 @@ main(int argc, char *argv[]) /* call lcore_main on main core only */ lcore_main(); + + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/server_node_efd/node/node.c b/examples/server_node_efd/node/node.c index 67a55808bf..e68606e0ca 100644 --- a/examples/server_node_efd/node/node.c +++ b/examples/server_node_efd/node/node.c @@ -383,4 +383,7 @@ main(int argc, char *argv[]) need_flush = 1; } + + /* clean up the EAL */ + rte_eal_cleanup(); } diff --git a/examples/server_node_efd/server/main.c b/examples/server_node_efd/server/main.c index 4728960eaf..39b7b6370f 100644 --- a/examples/server_node_efd/server/main.c +++ b/examples/server_node_efd/server/main.c @@ -334,5 +334,9 @@ main(int argc, char *argv[]) rte_eal_mp_remote_launch(sleep_lcore, NULL, SKIP_MAIN); do_packet_forwarding(); + + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/service_cores/main.c b/examples/service_cores/main.c index c7c792810d..c5753cc52d 100644 --- a/examples/service_cores/main.c +++ b/examples/service_cores/main.c @@ -220,5 +220,8 @@ main(int argc, char **argv) i = 0; } + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c index 4b2b6ab4ff..a31b2882ae 100644 --- a/examples/skeleton/basicfwd.c +++ b/examples/skeleton/basicfwd.c @@ -205,5 +205,8 @@ main(int argc, char *argv[]) /* Call lcore_main on the main core only. */ lcore_main(); + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/timer/main.c b/examples/timer/main.c index 5a57e48290..d67301e3c4 100644 --- a/examples/timer/main.c +++ b/examples/timer/main.c @@ -117,5 +117,8 @@ main(int argc, char **argv) /* call it on main lcore too */ (void) lcore_mainloop(NULL); + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/vdpa/main.c b/examples/vdpa/main.c index 97e967b9a2..097a267b8c 100644 --- a/examples/vdpa/main.c +++ b/examples/vdpa/main.c @@ -576,5 +576,8 @@ main(int argc, char *argv[]) vdpa_sample_quit(); } + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/vhost/main.c b/examples/vhost/main.c index 8d8c3038bf..dd1a936f23 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -1647,6 +1647,8 @@ main(int argc, char *argv[]) RTE_LCORE_FOREACH_WORKER(lcore_id) rte_eal_wait_lcore(lcore_id); - return 0; + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/vhost_blk/vhost_blk.c b/examples/vhost_blk/vhost_blk.c index bb293d492f..bdefd66f9e 100644 --- a/examples/vhost_blk/vhost_blk.c +++ b/examples/vhost_blk/vhost_blk.c @@ -893,5 +893,8 @@ int main(int argc, char *argv[]) while (1) sleep(1); + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/vhost_crypto/main.c b/examples/vhost_crypto/main.c index 66bde38c0e..1b01f6f089 100644 --- a/examples/vhost_crypto/main.c +++ b/examples/vhost_crypto/main.c @@ -455,6 +455,9 @@ free_resource(void) } memset(&options, 0, sizeof(options)); + + /* clean up the EAL */ + rte_eal_cleanup(); } int diff --git a/examples/vm_power_manager/guest_cli/main.c b/examples/vm_power_manager/guest_cli/main.c index 4e17f7fb90..b8fa65ef15 100644 --- a/examples/vm_power_manager/guest_cli/main.c +++ b/examples/vm_power_manager/guest_cli/main.c @@ -200,5 +200,8 @@ main(int argc, char **argv) } run_cli(NULL); + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c index 799d7b9bc3..7d5bf68554 100644 --- a/examples/vm_power_manager/main.c +++ b/examples/vm_power_manager/main.c @@ -468,5 +468,8 @@ main(int argc, char **argv) free(ci->cd); + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c index 3cb890fa2b..a19f7db739 100644 --- a/examples/vmdq/main.c +++ b/examples/vmdq/main.c @@ -659,5 +659,8 @@ main(int argc, char *argv[]) return -1; } + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff --git a/examples/vmdq_dcb/main.c b/examples/vmdq_dcb/main.c index 1a74364638..ba992802e9 100644 --- a/examples/vmdq_dcb/main.c +++ b/examples/vmdq_dcb/main.c @@ -707,5 +707,8 @@ main(int argc, char *argv[]) /* call on main too */ (void) lcore_main((void*)i); + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-05-10 23:59:32.040745000 +0800 +++ 0213-examples-add-eal-cleanup-to-examples.patch 2021-05-10 23:59:26.690000000 +0800 @@ -1 +1 @@ -From 10aa375704c148d9e90b5e984066d719f7465357 Mon Sep 17 00:00:00 2001 +From aa94d640eb5174b0eb0af7ca658a5a76a6bb2d0c Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Luca Boccassi + +[ upstream commit 10aa375704c148d9e90b5e984066d719f7465357 ] @@ -22 +24,0 @@ -Cc: stable@dpdk.org @@ -146 +148 @@ -index b73691dd23..c175fe6ac2 100644 +index cad6bcb180..a7259173ec 100644 @@ -149 +151 @@ -@@ -501,6 +501,9 @@ exit: +@@ -483,6 +483,9 @@ exit: @@ -173 +175 @@ -index bc28468f17..f1940bc88d 100644 +index 93523d625b..932f49fa7f 100644 @@ -176 +178 @@ -@@ -258,5 +258,10 @@ main(int argc, char **argv) +@@ -259,5 +259,10 @@ main(int argc, char **argv) @@ -243 +245 @@ -index 59971dc766..a9f9b5859b 100644 +index 20d69ba813..1efcb5e635 100644 @@ -246 +248 @@ -@@ -3076,6 +3076,9 @@ main(int32_t argc, char **argv) +@@ -3037,6 +3037,9 @@ main(int32_t argc, char **argv) @@ -296 +298 @@ -index a957df05db..4f51616492 100644 +index 656b140368..05f953e242 100644 @@ -299 +301 @@ -@@ -2835,5 +2835,8 @@ main(int argc, char **argv) +@@ -2825,5 +2825,8 @@ main(int argc, char **argv) @@ -350 +352 @@ -index be5bf7bc90..32d405e65a 100644 +index 3377b08322..ffb67bb901 100644 @@ -353 +355 @@ -@@ -902,6 +902,9 @@ main(int argc, char **argv) +@@ -903,6 +903,9 @@ main(int argc, char **argv) @@ -364 +366 @@ -index 4a17274379..a1f457b564 100644 +index 961594f5fe..a449fc9f1b 100644 @@ -367 +369 @@ -@@ -2258,5 +2258,8 @@ main(int argc, char **argv) +@@ -2257,5 +2257,8 @@ main(int argc, char **argv) @@ -391 +393 @@ -index 74413052b0..4cb800aa15 100644 +index bb49e5faff..ee156d13a6 100644 @@ -394 +396 @@ -@@ -1405,6 +1405,10 @@ main(int argc, char **argv) +@@ -1315,6 +1315,10 @@ main(int argc, char **argv) @@ -406 +408 @@ -index 8ca3586e05..d8ff5f133b 100644 +index f1653b4fb8..6cffd5a827 100644 @@ -409 +411 @@ -@@ -730,5 +730,8 @@ main(int argc, char **argv) +@@ -731,5 +731,8 @@ main(int argc, char **argv) @@ -485 +487 @@ -index bcbda05f5e..d2fe9f6b50 100644 +index 963b11d6de..66b5c888a9 100644 @@ -488 +490 @@ -@@ -783,5 +783,9 @@ main(int argc, char **argv) +@@ -776,5 +776,9 @@ main(int argc, char **argv) @@ -499 +501 @@ -index b16c19bc96..2f593abf26 100644 +index 4d82fb82ef..9830efb96f 100644 @@ -502 +504 @@ -@@ -3781,5 +3781,8 @@ main(int argc, char **argv) +@@ -3777,5 +3777,8 @@ main(int argc, char **argv) @@ -512 +514 @@ -index 4ce3622e47..257de50692 100644 +index 23e3b5e311..241267fd9e 100644 @@ -515 +517 @@ -@@ -263,5 +263,9 @@ int main(int argc, char **argv) +@@ -258,5 +258,9 @@ int main(int argc, char **argv) @@ -538 +540 @@ -index 878d1a0b99..173451eedc 100644 +index 5d4bdbd43f..a8b1b85c6d 100644 @@ -541 +543 @@ -@@ -784,5 +784,8 @@ main(int argc, char *argv[]) +@@ -781,5 +781,8 @@ main(int argc, char *argv[]) @@ -617 +619 @@ -index 0b3d8c8073..2b57a52b16 100644 +index c7c792810d..c5753cc52d 100644 @@ -669 +671 @@ -index 2ca7d98c58..ff48ba270d 100644 +index 8d8c3038bf..dd1a936f23 100644 @@ -672 +674 @@ -@@ -1781,6 +1781,8 @@ main(int argc, char *argv[]) +@@ -1647,6 +1647,8 @@ main(int argc, char *argv[]) @@ -683 +685 @@ -index 54f81b334d..fe2b4e4803 100644 +index bb293d492f..bdefd66f9e 100644 @@ -686 +688 @@ -@@ -907,5 +907,8 @@ int main(int argc, char *argv[]) +@@ -893,5 +893,8 @@ int main(int argc, char *argv[]) @@ -696 +698 @@ -index 7ed38fedf2..dea7dcbd07 100644 +index 66bde38c0e..1b01f6f089 100644 @@ -699 +701 @@ -@@ -469,6 +469,9 @@ free_resource(void) +@@ -455,6 +455,9 @@ free_resource(void)