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 C9A64A00C5; Mon, 26 Dec 2022 07:52:39 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6A20440146; Mon, 26 Dec 2022 07:52:39 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2076.outbound.protection.outlook.com [40.107.223.76]) by mails.dpdk.org (Postfix) with ESMTP id ED15640143; Mon, 26 Dec 2022 07:52:37 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kXAqGqWCouqlSJ94zLEEb/6mYseQduX5lqxs6WpYHzO99SD40BxJvrWxdtdoWmv/lw3e9gIcPjuZd4OHJNc+ceKlKdKrRbSxi1hJ6pODlE9+0+m+2R8lIr8duEgYsf+KggWiOHbTBxj4twgZZNmkFDMVXRkOFWe0jdxh8gYIA+o6jbJSSBzeJZ0rxeNVJvl1XNiuNC3X1UrF0jNPldfNL9yF44nBWjdXuWfa+zcnkX1lhRlk7vwFEfo1r2810LgYR0hT4/Bd1ObVLzvQh6NYSUVUMT4Dwo1oPj6TJO+071L88dF7lw5+04hvqiufVWDr7Sd5NUweZUnnhZowg8vR0g== 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=H/IFhw2NtJanwE4UlVgN71/nSqcTVpI09IP/7LU8swYlJljpCtbc3Aw5Sga0ngBk4h1UdGOj2j9RBZl6+lqECxI+MEmjRzXDl+bbSoSZ4Gyr4j9msWz8FB5j/T3IPIQwm0joCdBliZzMkrMf1SjRATnfHIIWoN5mtgs78r9ik8Iu+lq1YikGY6UNGQmD3Bothe/NMX6Oz9uw2aAP8qKCD+yk5HrdCwkjSJOZRtjmTNvlPHFNPzH7aUxos4fW617zbfQOvzR6TUy2PkOjTdRoWxg0rA7CfY2gubIFf5IY4hp0EbkZBwtKtzZQgNo+zxWPbTEKjo4ZxYlF2tVwayqfOA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=redhat.com 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=Q5NH3IleaXjHlxdZTfcezaj4j8Vn1C+QI3ezEvZMiJQ9Pj2zvhvLjc2oWJhLbtR4TVN4pQ2caxJ+v2sUm/+US8HBexdQJv02Vmc/wtKFztq3MkeQh8bvGHvPbAzFIqwnTVGrcJJk8mDWaJAhUQJt/sShUTEcY5nKmfs233d90HPBDMWIIv0tMP1sJM59cLZho6bpvPrLSzS5nvv8MOclY6g5dup0nJ+KSLd5FXn378ySJmjACmLu5iHU4EEsupxDsQKcL2wQi/INnPu5EH/0CjPs+9Xl709BkcLRkSW2bB8BPBdZSoTjL84JNcPZVuBx3fRrBfQFFn3lCpWVA2x5fQ== Received: from BN9PR03CA0050.namprd03.prod.outlook.com (2603:10b6:408:fb::25) by CH3PR12MB7572.namprd12.prod.outlook.com (2603:10b6:610:144::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.14; Mon, 26 Dec 2022 06:52:36 +0000 Received: from BN8NAM11FT064.eop-nam11.prod.protection.outlook.com (2603:10b6:408:fb:cafe::54) by BN9PR03CA0050.outlook.office365.com (2603:10b6:408:fb::25) 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:52:35 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BN8NAM11FT064.mail.protection.outlook.com (10.13.176.160) 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:52:35 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) 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:52:24 -0800 Received: from nvidia.com (10.126.231.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:52:21 -0800 From: Yajun Wu To: , Maxime Coquelin , "Chenbo Xia" , Chengchang Tang CC: , Subject: [PATCH] examples/vdpa: fix devices cleanup Date: Mon, 26 Dec 2022 14:51:06 +0800 Message-ID: <20221226065105.2480103-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.231.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: BN8NAM11FT064:EE_|CH3PR12MB7572:EE_ X-MS-Office365-Filtering-Correlation-Id: d4efec65-f498-4835-5541-08dae70dc531 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: R4IwD4hYaa1v0IXU+RxFu7k17Igjm8swXv/iUEVslkVWl2u5hiwo7GmOElGN+HA63y18AJqTGZNTH3UBJ9+LdDhIUpW6hDaiL70i1p4Jo/sqM1BX3zjjiTwNjkivL80k61KdBY6WFL/FNUJc1H9N/nZxX1X8fjZra1PCELfKB9wSDTsCpM4107lVP6hIw8ISTmlAdUCjHPpOIktIuZXUbpLgB0GllHUewUpFLRpIPbVIFmGx/pfTOwZmSjvS+p5CLALnAzqTDqbzUN3BCgUrKpt1XJKUepNCkCSfzrn1OgmSmhWbbf2PnCVaYgzYbhEtK+nd9wS/x/ZxDMI28938Vu4mo6cBY16pchA5MOEHr/+rIm3eSfrE0GMZb5jI251hS68eEIiQesH59S9eV5hRTmu7r11dghOtD5sb2hUX3poBYIP6mL6j0I1rwzkv/YZxTLbdNu7MK7fKb94+MBUTepXPxPFMMJ8dNoJEPfRuRxZCLxdDmExYpj6JFHibzcLGkpfBI7W7wcNheIVJgcw5Rn5fMACTxiiuMsR8R9VFCdXOZelz4eqixN02wosfkJGwhCV1pOC6yaeXbUp7xSySsQejuGJbSKEQhJe6UzR8Dwqmolpsu5cfrYWTISW0fnoGjW2JqwAbdvdvTxVIxBrcWaEXbXQQgX6uZVw/Qncabz50s3OzjmP+2cjMLo5dxNLGtkB1ocqm9rWNMdDna1481A== X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230022)(4636009)(396003)(346002)(39860400002)(376002)(136003)(451199015)(46966006)(36840700001)(40470700004)(4326008)(8676002)(41300700001)(86362001)(70206006)(70586007)(55016003)(8936002)(5660300002)(40480700001)(6666004)(336012)(36756003)(316002)(2906002)(110136005)(83380400001)(54906003)(40460700003)(4744005)(426003)(47076005)(7636003)(82310400005)(36860700001)(478600001)(1076003)(2616005)(16526019)(356005)(186003)(7696005)(26005)(6286002)(82740400003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2022 06:52:35.3251 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d4efec65-f498-4835-5541-08dae70dc531 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.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT064.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7572 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-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