From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0070.outbound.protection.outlook.com [104.47.32.70]) by dpdk.org (Postfix) with ESMTP id 8662998 for ; Tue, 24 Jul 2018 17:40:02 +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=HNKTrt4Pn8QFgZAcoE077mEseLp5wBEuniDOUcJxBWA=; b=g/3jH1Tvr57THb/GY38phAtjL8HrGN7HwBFDE5FAYvElojgJt5ziEVehwJrG52HdNi0pCGTf7m8tKmcr5+CE0AZ27Z4wlGEYiQZ9C7LVh1AMaVAM1cFUhIA6KUHMB9o2VueueSeo/eVthXe1QCC66hiH8vysj55vmOLvo5tAjC8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin (50.233.148.155) by BYAPR07MB4997.namprd07.prod.outlook.com (2603:10b6:a03:5b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.16; Tue, 24 Jul 2018 15:39:59 +0000 Date: Tue, 24 Jul 2018 21:09:52 +0530 From: Jerin Jacob To: Pavan Nikhilesh Cc: dev@dpdk.org Message-ID: <20180724153950.GD11073@jerin> References: <20180717143307.5270-1-pbhagavatula@caviumnetworks.com> <20180724121450.9969-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180724121450.9969-1-pbhagavatula@caviumnetworks.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Originating-IP: [50.233.148.155] X-ClientProxiedBy: CO1PR15CA0101.namprd15.prod.outlook.com (2603:10b6:101:21::21) To BYAPR07MB4997.namprd07.prod.outlook.com (2603:10b6:a03:5b::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f781db9a-8889-4f2f-5595-08d5f17bb7db X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(2017052603328)(7153060)(7193020); SRVR:BYAPR07MB4997; X-Microsoft-Exchange-Diagnostics: 1; BYAPR07MB4997; 3:/BVv6gOtF69TBwwbkz6FkhBrYln5cK3RXH66QlwUZafEe2Z3O58rDBw98QNHQppy+S6hgRD6jLUv+5fO0EonD3JzGIsVtztdBo10BvndyXydFPdQH4Sd12zm7j1ceOAN42sjdPZ4JWw5Z4vfDSYFw+elNTWKvZlTC+IZ26SCqQcTbFc8mZNJ4NSWOm3fcgIu8f8QI0Du62MJrv4snJ2qF9S5lb+sQmLJEOgIs4K2PGLEMelkvOH8A+3WfqKohCTO; 25:2q9ziJ70H8VrNILbpOfhHx9sGQSkib2ASxC5wtccDEMyB+pSJCJBwCy+XiLJ4qQdyZCjsQcT/zYVFNXBeOqklXwGdX+Ln6wTQX3VBl2VZYLaN8sxdDgxEHFNnFBphouO3l0tpHsALiQhY+7PYx3euU/GOPYvYBA8cgpQHACI53dZPIJvZwigtXfkQ0YNUGgSRDH/qrpsLbmgZ+ZoSMoiDLdzj9jdkn0wrxpfWow7hus87g3HR0+V80BL8oz0dvftxcjwtuly/lqokHBP4JBzIDrIjkoA2RaHocnGh5XNvI4/x9UDsKORR1SKgjy6VDzaqvgS2E1VfQdcXvmBn93Rsg==; 31:3c7V0vYnEAO3intMOumxlutQG492ClydV4Wry41dk7wf76o7Gt7NdMAKaqulpIhpCDiBvsWLfAGocIBakKrAUyL78XgV+BHDENXqrufhLrgu236/XRgmSx42l/w8eDgeVVMWKCbl/S6QCjQVFVA5191D0KqTVMFJRAyBujtd7BpcO+JsDPZNGClGnvdOCZ+GKiIiw0CoJXKbLoG2KVJSqzvRWPvgpIRzUctjnF7/9kQ= X-MS-TrafficTypeDiagnostic: BYAPR07MB4997: X-Microsoft-Exchange-Diagnostics: 1; BYAPR07MB4997; 20:qXstWagaeurkvEzcUbsvUveVbSwB9Z3AbsfwiOZm18lzcOYzzAFlmjJhbj5J2Zu950ltmghPpFxP8ua2OllWLLWkuClhF9vSb8WgrAszFGkL6RwnaB5XbJqPN1rAMPRDW5gqx8GPpTFu9aubf0uAGHWRRKpO4kqePQqdX03qyAqh5YwUA652gy/G9BntH91z408m918ZSSTbCQ+oV1k8HuCivfJ3DRAaf/ygVPLv2zLZNLvfIo99ZhmJtUfRqvgqQUx/AxjqW41SuYB1TcEmHQ49XEqVc9Jb9+X3Tz7WGhKU7Blnr3rXq6QJZX+NxysoE3a5eMQflepd+7OQ1wm/8GKbIC+UJGOrftWXsPejrRxt5YeKsD5JT/jJhKPYAdbBwe5sKto9cLqmIBsQ1RTOesfZ58B031hL8ZZr48O0SwU/C3VBiSOmML3XMEAOzDmlftNZ7QRv2elm+vn9vy2oNvDv8OXjaKk6Il+3JnPOkBllEUdYBmaCT9apNZmoGt9uNHA0sufDmbjvoNoG89AWNynE9BtcZXNe3OMfXqUmj7D5wQEgY9n5lNSRy7rpC8nFs2bkaTJgU2bhUoxMJktCPg0DlDFLn9j081o42OM4Qfo=; 4:UjvAAWH1xXjTQK6cluB9HvDF3uh8fiVJK8P+ihxUrZuaLUh2YkS10e6zXSmv0kbzv43UNRXwwz8rtjSZ0ViD3jj/v+k0/8wnQF1WNGlCASWJKFOnnhjBkXlMDVj//sLKjm+oRz7gjSo/WeUvGi4peGkp360unh597FwJIleCn+TmA7eya5dX8BaOJjNWhfNavAGSrY5lg9Ml697f/A9IPJ8b1+anj7Q7Yr/1cXIslecBS/KCxK8OPDjEHeGMhyLH5Z7aGsxNfbKXhEb2wJ5+IA== 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)(93006095)(3231311)(944501410)(52105095)(3002001)(149027)(150027)(6041310)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:BYAPR07MB4997; BCL:0; PCL:0; RULEID:; SRVR:BYAPR07MB4997; X-Forefront-PRVS: 0743E8D0A6 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(346002)(39860400002)(136003)(366004)(396003)(199004)(189003)(13464003)(52116002)(81166006)(81156014)(68736007)(26005)(33656002)(486006)(316002)(8676002)(44832011)(11346002)(956004)(97736004)(16586007)(76176011)(58126008)(106356001)(6666003)(6636002)(476003)(9686003)(229853002)(16526019)(386003)(55016002)(2906002)(8936002)(33896004)(105586002)(6496006)(4326008)(53936002)(6246003)(6862004)(25786009)(14444005)(50466002)(478600001)(6116002)(1076002)(3846002)(5660300001)(23726003)(47776003)(72206003)(42882007)(446003)(33716001)(66066001)(7736002)(305945005)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR07MB4997; 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; BYAPR07MB4997; 23:K27sysxJBsfWBfWvvCDwNIC7yZHmJAd97UOSA4tVi?= =?us-ascii?Q?GRw+1QxPqHEQbBtNpqq+KpOxoxcLyPl0jghEhk2A/2rienIQ9xz0wIKEgC0u?= =?us-ascii?Q?pvXJgPcc464jhgwJJwfNshsKt/wGhgS9+3FqLUlfBa60ytaV3tSAE+03XhN0?= =?us-ascii?Q?Ci8pfOIjtmhyw9fqbpXarELM8ey7bQ0G8Bx/adYbB6AYKzsedYZ/XM8da43F?= =?us-ascii?Q?adz/KVTx7jylTPWZZuF3R8dd0hHQUn6674S/hSxV/16VBZISU+KTMgnbQCH1?= =?us-ascii?Q?bH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o23VS7i9Clvb1ARW+qIOSOmLAz8YP7smkb1yRsn+KUx6NxxXLPQyBIBPWNYQ==; 5:0OGFrH0IOJHa1glFxFeQsWJAQEFPF+5TFWnNfMuWqd0dTQ5qRWnvBp0e0hMiNc97XLagAC8smBEurJOQLOTXkpDCtZI8T+asOdVNPVPGHs7psn/8jOCkaCjyaaiVJpJYQ+eSi1sgIdINJOXXMcLncRSJyqRh1JEzOk4cE4I1y1c=; 7:xSHO3aobWZDpJ1tA+/NL7O3C7JeVZuO8koQh4OLmG8Ope8NbkHXNyUBgPSx8kQg9PCUtVJ+xUFjo3J3Pou/SZTnxA9Q5+Ra5bCNRagnO+cVPrLuQ2MTbUiYyVh8m/IbJFVTzNBDCj9uNEjLI88C+3q2akPTKLJ/Ip3Cuv23S2uz9rGfrsRnOo6fI8Yh8D3wlT3hRr4QffBGDmbfeiWaltVgO7osIlOo3EFfnIstH1x/+BA6W1IHIEj96mKziqPF0 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2018 15:39:59.5825 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f781db9a-8889-4f2f-5595-08d5f17bb7db X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR07MB4997 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: Tue, 24 Jul 2018 15:40:03 -0000 -----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 > --- > 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 >