From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0066.outbound.protection.outlook.com [104.47.32.66]) by dpdk.org (Postfix) with ESMTP id F04101C01 for ; Wed, 25 Jul 2018 15:12:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nLhSfWgAp7q2Qi9zhKkzm/vmBmCfRCnCVnEnoVMUCig=; b=FEL0z8SEknFEFnvu1prgea0c2yEEzqRwhmJ9KQ9aviykyYipdCE8QrRqGhkXZmQGxi+3qH7p8dISNwpaO0Tzc51E09nBY6Ar081WMrBiWPCvfiHvNa67FVt5i90YcCk5kUYfuiuOXGZsH/K0W6hL/GvQlvlXSfPHnj+tLl6ebzk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin (223.186.125.239) by DM6PR07MB5001.namprd07.prod.outlook.com (2603:10b6:5:25::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.21; Wed, 25 Jul 2018 13:12:40 +0000 Date: Wed, 25 Jul 2018 18:42:25 +0530 From: Jerin Jacob To: Pavan Nikhilesh Cc: dev@dpdk.org Message-ID: <20180725131224.GA3414@jerin> References: <20180717143307.5270-1-pbhagavatula@caviumnetworks.com> <20180724121450.9969-1-pbhagavatula@caviumnetworks.com> <20180724153950.GD11073@jerin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180724153950.GD11073@jerin> User-Agent: Mutt/1.10.1 (2018-07-13) X-Originating-IP: [223.186.125.239] X-ClientProxiedBy: MA1PR0101CA0068.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:20::30) To DM6PR07MB5001.namprd07.prod.outlook.com (2603:10b6:5:25::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 638fbfba-9acb-437b-6e7e-08d5f2304e06 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(2017052603328)(7153060)(7193020); SRVR:DM6PR07MB5001; X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB5001; 3:3nob9cVCjySS3SMSuMyy308U5v3Qm1icNEc8uIrSw+8X4w6VgAdR7bRdARgUa/mS1gOOJtCaxHmzW/bGtMQPh/fnz7l86+raBbmLO/q4niKv+DNrfzYy4KZJrTXbzDz/fhA7cccLxxfjQGlkClgltRJCnMqaOWrLdW0H4V3n5voivj4m0CEZEnB7j658vvpQG9RbpoeZ4eiAx+c6BQC1mlwkNU/s8KeaTc+oPInpWF1fWKNk77s6iu4jNYD9tByZ; 25:dra6RVhZCKpMUxKIrKKTaNeo6N6+8DPrR99WXHyeAN/eL9ypSiqpxwsjMIXG9OnroFERXizYTCwKUSi7Rgh3ZOvkPYviGmhhCicJjiSSqzygD1dORWDmCMPG9CRKhj6YVSQh99KBvGh2mhKDXl5nO/hqmFsROfIo+ymza6ikKXibiZ5QA30cACNVJtSUMaGGTKL+XUAmY1/uwvTiMwKURSFWD2F+STlBoA7rlqocZqGyTMylXTKk/aqz23+2K4gCPOWUCpKCmpqbLaVecr8TIUuXG77/GYrLIcUvKApjYGZbBsEtIbX46ZZHSKqQiDdcQf0IpG6mC4klCSoPSLNgQQ==; 31:eWbSQLtxJEsoGOZnrqktkOJnBZKTF6XHy0yAe4S5sPHofFEO4UotfE4m3LxEgn5YOAS9eWjYXEmXDbbRZc3VK5hK4bOMU4BL3QjGuNkagANVG8ZTElzGbG9P7ISHF2Bgn1hob+Mtlo4xgn9TgYXwyjzoFh6JT3y93mzbLmHkc7TEMnZIqH1p/GT9aWUx4CLO+zj6iZ/VdgkHI3U9SRrRUfBA/kLYqVAJPtzuechB0mA= X-MS-TrafficTypeDiagnostic: DM6PR07MB5001: X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB5001; 20:b5m6ALHU+VuBnlCWODXFoCscphNW68abtI+eGq7KDE+xNMF+/3P2ce37kg3lCPPTZPjdhe2+6eLzfm+ps6L35nMKDLpy7XNRTcjFwyA5qeWkgn3HARY6taLHDVq25JA2x/FwIpB0dqUeCo62Or8TafFE5qVZJBHLsSDMoKc075TylqlTKswzVE2T3MuSpH2HeeT8pRQEJpbqn+JAQ7DullQNPAiE+tnYoiqsgBUe4+Xko2LrB/f9DwTjELIo/6Vb/IInGY92yAx7QgnjYgILfVJO1q2itNR8jgARUDHfAXuUBhFICl0eDYd2zoDsqotJXP235tFsRpUShW7FeyGcykBzWWrHu8HZ4iPlDGGG0ec6uSIubZvH1SVHnuKELWpADEesKJhk8Zf699o80AgmZL2TcF9yMqHb1byF1KtGq2oD4bQNJlSAx+bReII13bhyQLQsqnfqHADxY25YhiS18SaIqDqI3TGupsCWpSQrzvBgHNRAhNSH/eiPachq2SH6+XJpfIMsdc/zTs1jOzUB4V0CKd4I2fDu2sL+V0hfO23j/O03OMzgnULxevQxAr9Y55vNSKY8KJoJa46SHRs4sjyDOytThz9ck5VsCAEUP00=; 4:dnKrd6IjFqoBgkn11g90t9BbZ6D0Mzpt/JOoaLm2bG7CWP2mK74JJ7omFN0UB7ht8lmiKjkwWTa7yng65mWpDeXD7Wysg2bhMJ4b14++cCpJ/OJpUOXzjfIQm/ypYCioTcqrk8R+d68It2HqKx06TpWJg28VkEiSMEZ7MIfD1hX5/MdHAjpD+kvZMzmGsjA8ujDOsnqYujKnTEC0sy9RRKSjpKCNwyAu859uatLqD/zzNVPOllZVKsMS/8lVqfkrnR0TNtt4xB5LTkEhz6qSVQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(20161123562045)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:DM6PR07MB5001; BCL:0; PCL:0; RULEID:; SRVR:DM6PR07MB5001; X-Forefront-PRVS: 0744CFB5E8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(376002)(136003)(39860400002)(396003)(366004)(13464003)(199004)(189003)(8936002)(305945005)(11346002)(76176011)(81166006)(81156014)(16526019)(72206003)(53936002)(7736002)(44832011)(55016002)(8676002)(52116002)(956004)(66066001)(6862004)(4326008)(33716001)(229853002)(5660300001)(47776003)(486006)(476003)(2906002)(3846002)(6116002)(9686003)(33896004)(26005)(1076002)(33656002)(50466002)(23726003)(25786009)(68736007)(16586007)(478600001)(6496006)(97736004)(105586002)(106356001)(446003)(58126008)(316002)(14444005)(42882007)(386003)(6246003)(6666003)(6636002)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR07MB5001; H:jerin; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM6PR07MB5001; 23:eRo0vJHohJjS3YkjsbMt4MIhTrvi5sDQ0UvW4tLYe?= =?us-ascii?Q?ULTGTeg6A0avHn43v8x3fLEBeu4xaJTaAmMtA+gB7YfKej1BE6qGthpBn/XM?= =?us-ascii?Q?Gl70XyhFi8talrIoUTtcr4JPNC4WCp2pxoU6OkUWL9seRlGmsxn5Ges+gY1R?= =?us-ascii?Q?/oCmdAATTwibYpRCXIRnT1Ejo8OuEHfXGynVzdltlPMc58cL5WP/VmBif6/7?= =?us-ascii?Q?aq+bqJAQHbMFDaHZu9lvYw4UOuIcBRaLyko40pKcBIYbdqsYJrymYN5yuEqz?= =?us-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I7lRH/N0ISKVzRAaNQHj9SrWNp/3okbv5U70OksQ==; 5:33S/1MSnvxgfuC5AVO9VHYDKjKzGxMmckDtMftvyTU7SB+ZFwdPjgVsGf2B106oJHi3zrh/Yv/r39H+B5hD+nn8kSkPx8QWp4gBtIn6eVGwRvdSrGrX/nAsAd2j2ZNFriIP1dhD4A3Qk16bJxaIyN9boYiLRaMI4oTyiZGE4TIA=; 7:q/vdq2wDFHBUbB7+z5sX4LjQ6C00Mgo+D7+CRIcqyyzdC44fPR7zq8z49i0uq/qvW3ivB7hcOTC9hVXKcx0EcXIPdC3DpQD/fW5CVSsarFZ7fy8mq+4I4geDKYIKwyXwT9adC5ZlhTHR+5RDS9bpGXVx4+hVUe3P5aTzDaqu93w4qGmRERPUuY81XVFMA1HMq+DvXUbU+JcIDbgPNUnLRuc2513JjhErZSMQv3fj8F91pfyEU6xK17Pjmhx3eXLC SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2018 13:12:40.4345 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 638fbfba-9acb-437b-6e7e-08d5f2304e06 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR07MB5001 Subject: Re: [dpdk-dev] [PATCH v4] app/eventdev: use proper teardown sequence X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2018 13:12:44 -0000 -----Original Message----- > Date: Tue, 24 Jul 2018 21:09:50 +0530 > From: Jerin Jacob > To: Pavan Nikhilesh > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v4] app/eventdev: use proper teardown > sequence > User-Agent: Mutt/1.10.1 (2018-07-13) > > -----Original Message----- > > Date: Tue, 24 Jul 2018 17:44:50 +0530 > > From: Pavan Nikhilesh > > To: jerin.jacob@caviumnetworks.com > > Cc: dev@dpdk.org, Pavan Nikhilesh > > Subject: [dpdk-dev] [PATCH v4] app/eventdev: use proper teardown sequence > > X-Mailer: git-send-email 2.18.0 > > > > Use proper teardown sequence when SIGINT is caught to prevent > > eventdev from going into undefined state. > > > > Signed-off-by: Pavan Nikhilesh > > Acked-by: Jerin Jacob Applied to dpdk-next-eventdev/master. Thanks. > > > --- > > v4 Changes: > > - Check opts before closing ethdev. > > > > v3 Changes: > > - Segregate ethdev_stop and close to prevent possible SEGFAULT. > > - handle early shutdown. > > > > v2 Changes: > > - Only stopping the ethdev(producer) is sufficient.(Jerin) > > > > app/test-eventdev/evt_main.c | 42 +++++++++++++++--------- > > app/test-eventdev/test_perf_common.c | 1 - > > app/test-eventdev/test_pipeline_common.c | 1 - > > 3 files changed, 27 insertions(+), 17 deletions(-) > > > > diff --git a/app/test-eventdev/evt_main.c b/app/test-eventdev/evt_main.c > > index 57bb94570..a8d304bab 100644 > > --- a/app/test-eventdev/evt_main.c > > +++ b/app/test-eventdev/evt_main.c > > @@ -20,29 +20,41 @@ struct evt_test *test; > > static void > > signal_handler(int signum) > > { > > - if (signum == SIGINT || signum == SIGTERM) { > > + int i; > > + static uint8_t once; > > + > > + if ((signum == SIGINT || signum == SIGTERM) && !once) { > > + once = true; > > printf("\nSignal %d received, preparing to exit...\n", > > signum); > > - /* request all lcores to exit from the main loop */ > > - *(int *)test->test_priv = true; > > - rte_wmb(); > > > > - rte_eal_mp_wait_lcore(); > > + if (test != NULL) { > > + /* request all lcores to exit from the main loop */ > > + *(int *)test->test_priv = true; > > + rte_wmb(); > > + > > + if (test->ops.ethdev_destroy) > > + test->ops.ethdev_destroy(test, &opt); > > > > - if (test->ops.test_result) > > - test->ops.test_result(test, &opt); > > + rte_eal_mp_wait_lcore(); > > > > - if (test->ops.eventdev_destroy) > > - test->ops.eventdev_destroy(test, &opt); > > + if (test->ops.test_result) > > + test->ops.test_result(test, &opt); > > > > - if (test->ops.ethdev_destroy) > > - test->ops.ethdev_destroy(test, &opt); > > + if (opt.prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR) { > > + RTE_ETH_FOREACH_DEV(i) > > + rte_eth_dev_close(i); > > + } > > > > - if (test->ops.mempool_destroy) > > - test->ops.mempool_destroy(test, &opt); > > + if (test->ops.eventdev_destroy) > > + test->ops.eventdev_destroy(test, &opt); > > > > - if (test->ops.test_destroy) > > - test->ops.test_destroy(test, &opt); > > + if (test->ops.mempool_destroy) > > + test->ops.mempool_destroy(test, &opt); > > + > > + if (test->ops.test_destroy) > > + test->ops.test_destroy(test, &opt); > > + } > > > > /* exit with the expected status */ > > signal(signum, SIG_DFL); > > diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c > > index d00f91802..6d39f98e0 100644 > > --- a/app/test-eventdev/test_perf_common.c > > +++ b/app/test-eventdev/test_perf_common.c > > @@ -743,7 +743,6 @@ void perf_ethdev_destroy(struct evt_test *test, struct evt_options *opt) > > RTE_ETH_FOREACH_DEV(i) { > > rte_event_eth_rx_adapter_stop(i); > > rte_eth_dev_stop(i); > > - rte_eth_dev_close(i); > > } > > } > > } > > diff --git a/app/test-eventdev/test_pipeline_common.c b/app/test-eventdev/test_pipeline_common.c > > index 719518ff3..96e7c9882 100644 > > --- a/app/test-eventdev/test_pipeline_common.c > > +++ b/app/test-eventdev/test_pipeline_common.c > > @@ -467,7 +467,6 @@ pipeline_ethdev_destroy(struct evt_test *test, struct evt_options *opt) > > RTE_ETH_FOREACH_DEV(i) { > > rte_event_eth_rx_adapter_stop(i); > > rte_eth_dev_stop(i); > > - rte_eth_dev_close(i); > > } > > } > > > > -- > > 2.18.0 > >