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 7B6E1A00C5 for ; Mon, 26 Dec 2022 07:27:58 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 72FD040146; Mon, 26 Dec 2022 07:27:58 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2049.outbound.protection.outlook.com [40.107.244.49]) by mails.dpdk.org (Postfix) with ESMTP id 96DD440143 for ; Mon, 26 Dec 2022 07:27:56 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RHHwhh6huTHcFg6828sZkNCAV9T3DT/+llPhdqsF8QoRknewlJurM9+Y/dxg6UDlfKb0VVrnjvOJLq19JrrBOBF6h2bNBUFvXLd/2OD2d6e/215j3xFP4QHXc2+Pow3xVxFqAWrHzOgCYX/QqeLMByVwyMoIikBmT1DRfPt6PRCkHcmIfz8wGd2woU32rOkdCqkgQuBHDQA6SbdDb4yzJdp8f8B1eG6/oSWW3ooY+Cx4RlfcwOwl5AWt8IuwspIa67rhOhMh19Blqni+k7hNZqjk9XlkExoW+Zflp2iWO5ywKUmbrGKP29233fscTJM5DfNKAnCUytPBxyxCNLnjNg== 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=aK6ZNLC4x/QQ/lw5vLicCsTtLJJx9oMnu4J3XtRPspM=; b=LzLrGndmn6UUyayZkf6pX7e9JPWUiTz8OArAvl7uN70uhdrB6+VbK+gkWfNv57c+y7iZRXT3qhdNAS3twFhKRtGJmIVKKC4bPcNpvrf/qy1R+RPRhVo7OEU6b/R2E48sMB4OQhBbFPlDYhPHHYi9hDfulkYyXPnFVT9slBxQbcMUXgJhiNpO4r/SIrZIYRZPK6ZH4cE4KHkyjhlGRMb2V2GrV4NNlHvV9KowC5YUYpxQVD09xWhwETCZ2GAP69Kx2hXqnqWpvkY4i29Zlz9ommbRAfeOmHYJ2WuTUp94Rt9CcNeAmynrGQUiAACpAiEsfBMosoWPijNbTMa4rKYLxA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) 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 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=aK6ZNLC4x/QQ/lw5vLicCsTtLJJx9oMnu4J3XtRPspM=; b=joBL9dXSDu5gVClhtURFMhhPeNnO5p3cw/EntNFe8CHbtDaOaxsU2A/TKZvsQZmpGzo/91p9uzzFvTqBP9NrJVqvGnMe49p/cYUeD0abaI8WtsAwSwxIGv5eBRk7VrDbfTEmyhTVhuPyXr/9cS1Vpwfk2ffobrRQXpFjr1dFu7SPrPYICAa/oGmx1Q7qKJu/w8OX0PIHvTf3AtzEcm0FrvwuC4cItS5PkqrgYBh4XSty11sZVhqBpyZL7ESHiD6zVomPr79M57AzLiaz+sbRdjY3ZyZbIJElOjHnoFDNOIowDqJ7bK2o0KXnXhRn6/J5SQf5iahYn5mzazr/hCMgbg== Received: from CY5PR15CA0130.namprd15.prod.outlook.com (2603:10b6:930:68::21) by MN0PR12MB5881.namprd12.prod.outlook.com (2603:10b6:208:379::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.16; Mon, 26 Dec 2022 06:27:54 +0000 Received: from CY4PEPF0000C978.namprd02.prod.outlook.com (2603:10b6:930:68:cafe::bb) by CY5PR15CA0130.outlook.office365.com (2603:10b6:930:68::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.16 via Frontend Transport; Mon, 26 Dec 2022 06:27:54 +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 CY4PEPF0000C978.mail.protection.outlook.com (10.167.241.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.10 via Frontend Transport; Mon, 26 Dec 2022 06:27:53 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) 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.986.36; Sun, 25 Dec 2022 22:27:50 -0800 Received: from nvidia.com (10.126.230.37) by rnnvmail201.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.986.36; Sun, 25 Dec 2022 22:27:49 -0800 From: Yajun Wu To: CC: Matan Azrad Subject: [PATCH] examples/vdpa: fix devices cleanup Date: Mon, 26 Dec 2022 14:25:49 +0800 Message-ID: <20221226062548.2474962-1-yajunw@nvidia.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000C978:EE_|MN0PR12MB5881:EE_ X-MS-Office365-Filtering-Correlation-Id: 825b7048-7707-4ade-736b-08dae70a51cb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Dt1Bj5cpqPwfl9OKLpGyM4m8VrTjizRICVy2Y6LwL91cvO7N2V9We62RdBpttV7MoFawDtqPyfEWD5ob6OpsydtsIhi87D5sNsgPto3h15n+qSfJ+XxTw8eoTNZCWHYX6IspGdcPbgoIfBr+iYzi4bgpP/iP6R3mTWrAIpUVrv9df6Myvv5Wm++MPV3QHJ54VrpcKLW/pf86T6LhjPtCpuUwZwRo9VqKP9K6NCocU7yXYBFgq1Kstc3eGVtjrjEIxprArU8zPx8I9xA4RjBxCKTogLPU6GEf5+Erd8VoyvyzH6q+nhcphIsl7fpbFKxvhsVB1H316YLt3sREamZLnIjbaKVfDYGmXqYP1Yyy7NjP0TGoc6o6dw5YSOWLDyLNJljiYUTVUNWxqtJEpHm1ZVi3DC4gpz0lqnx9u62mL3u7Il4NP7ekj+oX/WS6XgV/hjBgckDnd0uSt97FCo4fMBwHBtJyw6KNVHHj0vsUJNMJ+cucHh4+GQIdh5JSPkbx8IjYrSPMlqkxDIS6Elgyh1YDenpMOxvahke4oDjwJzMAwCuT5QtieunpWC85ZgrjLH8dmDDVmWS/zK9avtF8lB3VIUW5ra0vwCNgksbz3V+5m0of4Igx8vsD/90AAtLTKNJCtz4dMLjqWN1eRWgNMJXqQPtw9AxA12u/eq9JPvCBm9wGnkOpf57Mc3IENY78waqc74Ocrn8rgY3tHBYKeg== 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:(13230022)(4636009)(136003)(39860400002)(376002)(346002)(396003)(451199015)(40470700004)(46966006)(36840700001)(426003)(8936002)(4744005)(70206006)(8676002)(55016003)(40480700001)(6916009)(41300700001)(316002)(70586007)(2906002)(36860700001)(7636003)(86362001)(82310400005)(336012)(1076003)(36756003)(356005)(82740400003)(478600001)(26005)(2616005)(6286002)(186003)(5660300002)(47076005)(4326008)(16526019)(83380400001)(40460700003)(107886003)(7696005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2022 06:27:53.2916 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 825b7048-7707-4ade-736b-08dae70a51cb 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: CY4PEPF0000C978.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5881 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 Move rte_eal_cleanup to function vdpa_sample_quit which handling all example app quit. Otherwise rte_eal_cleanup won't be called on receiving signal like SIGINT(control + c). Fixes: 10aa3757 ("examples: add eal cleanup to examples") Cc: stable@dpdk.org Signed-off-by: Yajun Wu Acked-by: Matan Azrad --- examples/vdpa/main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/vdpa/main.c b/examples/vdpa/main.c index 4c7e81d7b6..9149b66538 100644 --- a/examples/vdpa/main.c +++ b/examples/vdpa/main.c @@ -287,6 +287,8 @@ vdpa_sample_quit(void) if (vports[i].ifname[0] != '\0') close_vdpa(&vports[i]); } + /* clean up the EAL */ + rte_eal_cleanup(); } static void @@ -633,8 +635,5 @@ main(int argc, char *argv[]) vdpa_sample_quit(); } - /* clean up the EAL */ - rte_eal_cleanup(); - return 0; } -- 2.27.0