From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0057.outbound.protection.outlook.com [104.47.41.57]) by dpdk.org (Postfix) with ESMTP id 6F77F7CD9 for ; Sun, 28 May 2017 22:00:44 +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; bh=uyukZdUS6hFtpkfoJ+8VXNxFEXhawV1JoDqUf91/a1o=; b=KS5t9UjG9ijafkPj20cBU3tZhyTlI5ZGDY6DhBuj1RT3kiBJutgsX7jlvPLxl9Y5D+dCQmmEQeLiwffuaMvP/39x2STSwM9ep0mGHtuiOBa/rJ39Q5dI0hDhcrb1hPZCdffF1a/Mz0+RG4AUhlIv/oa0urn2vLMzERcSSM2QTq8= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=caviumnetworks.com; Received: from jerin.domain.name (111.93.218.67) by CY1PR0701MB1725.namprd07.prod.outlook.com (10.163.21.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9; Sun, 28 May 2017 20:00:39 +0000 From: Jerin Jacob To: dev@dpdk.org Cc: bruce.richardson@intel.com, harry.van.haaren@intel.com, hemant.agrawal@nxp.com, gage.eads@intel.com, nipun.gupta@nxp.com, narender.vangati@intel.com, nikhil.rao@intel.com, gprathyusha@caviumnetworks.com, Jerin Jacob Date: Mon, 29 May 2017 01:28:32 +0530 Message-Id: <20170528195854.6064-12-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170528195854.6064-1-jerin.jacob@caviumnetworks.com> References: <20170528195854.6064-1-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BMXPR01CA0003.INDPRD01.PROD.OUTLOOK.COM (10.174.214.141) To CY1PR0701MB1725.namprd07.prod.outlook.com (10.163.21.14) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY1PR0701MB1725: X-MS-Office365-Filtering-Correlation-Id: f2c94a51-7c7b-4443-fb0f-08d4a6043909 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:CY1PR0701MB1725; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 3:X8Xhv0UwFfiWXq3pFHOuToltdKTmU6TWfr1ScUAKi8XXvFN5xK73n81De4+oZ4KbpVF3C7u5UtLdTtpoBx4Nrjqs/buSpVCvbSK/ziV5ZKgVGY7RTeuneo98Gc6tafdpkME2Gfe0K/GoGaerC3MfE4un0V94A6HIyTb3uNeiegHIiGvdklhshhWd4w0/7acwsqDxyqkSGaRHZvq/Fj1q4LFqp6e8DSsG+0HqAuGjfFZVa+3xCn+Lq5BezRka7g8u1Bxcmx5bsbQ+bwm4g+FrpDoFRLmLZWaj5KenhjNeQ00uDGivR2D6nBifGeJNKbGf1b+8WS+ZAN0Nc7jGBAqe3g==; 25:So2WWbV1Pfc66BGkArGx+CxKBqG6K+Fr4xk5LSOWqyLJYs/6l0voYLPQ70G7cgQHszmeHGOkT/Kw49bjC9PGHCZmS0nnRRkZnehJ4QUscGwQOm8qOaPI/1RbMG8+16kmtz+ezrC3CG7JgiFzVq9xbqyvmQZbrBrHVfxiJtLt2aVxGxELM+zzs8sf9PLFjEnOpKkPzQaP2UC9kvKh7AnX7VDn1y4UFThVx91ER/GxL4WvV/8IVsDWwmgwUx246JNu5qatc2EUAyZakfRinBsgYdNr76/u4fZ8Z4JxlM/n8PavJteBA/4c2DC8oPJ+WRrBlYJDf2yyQQ9sLR5kSrk/FN+LtrsMHViB5zrdZlRgTgd5fG3yWvmWTDeh/DnzAx/kZTeQGimv7CDjVny3+hxvi0q4Zc8xQzU/eQz6dJ68CQvaSZqRAY9EV9xFlwZfM6VKUeQ8deYRbGN8nvmYFGMFLt1vgr2PjxQM5pkr10KUNiM= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 31:8bciC3O4bT/kyfLaAatFa41HwFAhrnZwvcm28qUCoaR2cJf3i31Ezw2+g6bttJJpTNAfm1uEbpnMAMIg0X7Y3UivLftFlSQ5G7+j6pemLbxc0geXOHmfC27dPNGvQtQLoKYxElG/abm6ikwsGdT4YSv+TfUfASEwfNKedfeuFSld/CI7rUm66oDUEqEt6M3J1qx4wXZvB6nSDw3Dqv++BU2w/eXB4CQRe2AW8qdFM+c=; 20:yBoVXc0wpR5jARrBg1RjGtBmLUKaHkz8InMw8eO4qJv3WgLrAY442mjIs4icgah34bk/t70k1TUXqrxSjOi6LbFubiEpZ9MMILWRVeP3sMf5xbcJVVkMlNveomXtjgF4UkCUFwygJrgB5/OA37xY+RDyueGyjMO/4iZvr5M8+logNo5oWamMwY+TR2qylRGFlSO9OugHXk8ZXeISKIrL/nuXVO7VsRUaCWVppEPwgGSSwBuOxVS0WzT6OcGDnzQyLo3wb/w0hPQsr2Cm13u+YR+PVG+emteNz2NUlDgaYt+8DRVeJIV/F2S6qbPIvew7gYAaKCG8RL1dRuA5NWdNtwopNPyvWsERXT/EPjP3Bdz6UIkVv1fzHJpmSCbl6GyeFekc9lz2RNRJQW8Sd42kfMQvCEkT7lmN3AAhyCX6NokKvSxtGJTq9z/FAN/+CleqDoD2H0sHnO54v8HY3CTNptDz8MSSvvkug2YgLO0zRSbQKyPBGCQvlDRQkNOejtnLaA+hcbZ0Jl1ZQWhbxTFxPC39zu5qwLpCucjO7LnNitSDv0a3dft/QvkZQX+StApu2JQWQ22iSMBD7oYe6XZrP6qO8O2nxPxIF8oxrPvbTS4= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700073)(100105000095)(100000701073)(100105300095)(100000702073)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(100000703073)(100105400095)(6041248)(20161123562025)(20161123555025)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(6072148)(100000704073)(100105200095)(100000705073)(100105500095); SRVR:CY1PR0701MB1725; BCL:0; PCL:0; RULEID:(100000800073)(100110000095)(100000801073)(100110300095)(100000802073)(100110100095)(100000803073)(100110400095)(100000804073)(100110200095)(100000805073)(100110500095); SRVR:CY1PR0701MB1725; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0701MB1725; 4:cn4TY5fyOobUlwq4/LCHyqR+GA139ECzeVNBM9+P?= =?us-ascii?Q?7c7Ww5fvtAnCYSCGjoSTor3/Kz6J8APDSBwL+QgFvMHvPbv9z80eVlMvINZ0?= =?us-ascii?Q?a8F8qaP9af1TDXI+k/vNrPO5pP0Z4zLx8zOSSZf22Bjiniq2PQ4KSl304sY8?= =?us-ascii?Q?Id80Yg/0KS4KRWHINn3DqGgYb+i//GMIuw6GD8kqG1GdYU8AUnBiEfI8nvln?= =?us-ascii?Q?rk81mLqgMWEepsYsg3UYZLUvvDpLGDX5DAwUZ9i0mkdXKuK2NPmbvWZf2lse?= =?us-ascii?Q?3Az6mC/xIoAXcuEG6Kfnq/DyDygxqQ1dEU40/gDwHjAmjwb9XLAtrgwBAh+h?= =?us-ascii?Q?uL9mnClyyHvkp5J/VZHUMRrxScsK35cBMBCs0l5puDODtoyI7O9mzFZboJR2?= =?us-ascii?Q?1etDHKV3oQZMBD1N+qLDXmEkW9jYwAUCTeb1bU5IFBYBsQ++5whgRY+MtFZu?= =?us-ascii?Q?AntsUhas7798UfGttfpgPVp6OJFd9Q9TsTld88LPmXS98/IoVuatpkidtjzA?= =?us-ascii?Q?WDFWf7svEgxJW7MpHtmVU9jmWitbT9PUY6cgyoWstw2nIuOD/qjTtoHhLc6L?= =?us-ascii?Q?m6j0Yd/6uJOQaA+X1XaLieS95HHD3R5ETaRg8TQ9skNa4nN6CfXfgZ8rz7Ws?= =?us-ascii?Q?neWVnuFfp9H8VGdw7ctecvpvLJnTrk1Acga3VCABUBN4YCykYBQB2cwOt/9H?= =?us-ascii?Q?Z6cCeN2mcu7PL8Od3s6dYhKoHrOY8dpNf11Kb70ZmLfhGj/5pNsAuMP3Nj+n?= =?us-ascii?Q?5fWz5r+FSffFHInePlhCwPrJL5k+MpRWGyinYTLNC1K6jahUDGwnqg8GzZOO?= =?us-ascii?Q?d/DQa5Qk8PXclJUnt8HUJIxKEAw11VKp5GwgHwt8dgKoxnj2HRRs9WZVucIR?= =?us-ascii?Q?WUdQlO1FBChUF6wyUwUdfjZLCMZI0Td8e7rfTphBR3TdJLrxAtWZVk5cN4yZ?= =?us-ascii?Q?EMNTp+Fe+XyhZx6Koal1saGkgCUqOFPLea20j+KeoC/JFb1hjOV73AjQrvC4?= =?us-ascii?Q?Y1supU7TiQcTeg/K3r2chbRzJdzTmv++6qYKmJUFpsnBMx4XVMk9MXf6FLgV?= =?us-ascii?Q?va0hOhCzcZVMWLIhy0ZX5QkVzQZa+znF+cC47jDmkHm/5VcRf+qOSK+SGCS8?= =?us-ascii?Q?4nGb05AkWmY=3D?= X-Forefront-PRVS: 03218BFD9F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39450400003)(39850400002)(39410400002)(39840400002)(39400400002)(81166006)(6486002)(66066001)(4326008)(50986999)(76176999)(50226002)(189998001)(72206003)(36756003)(6506006)(38730400002)(5003940100001)(5009440100003)(110136004)(107886003)(42186005)(53416004)(7736002)(8676002)(48376002)(50466002)(1076002)(3846002)(6116002)(575784001)(6512007)(2361001)(305945005)(2906002)(6666003)(478600001)(25786009)(5660300001)(2351001)(6916009)(42882006)(2950100002)(33646002)(8656002)(47776003)(53936002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1725; H:jerin.domain.name; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0701MB1725; 23:JivlKNUhuIZLePD//FSvl+Nu0WWPXjbWORA9h/N?= =?us-ascii?Q?8cv9dw9pwcYKmlptVFUjWLeIipE4qwOIt31KwYO5TmNh4I5qac1mrcoyB/jH?= =?us-ascii?Q?vfAvsvE4ESGl4PvFlbHg0g3TxfPyQKydohKTlRSK9LysMMGTW3eJwWqRvRaj?= =?us-ascii?Q?RCITUvuO9Ax1OVvxcxrFzE5AlJhaBOlpXH26k+dJVQepfppI7FC0RkHy5o5c?= =?us-ascii?Q?fDWu57Tl8nBsPTPPQ8fXCp4sE41ZmXTYDvlr7TEXtlHfucMDjDaWI14J8vwT?= =?us-ascii?Q?+6pBHuEnbDPDwcttEtHjrX6qm0vV6jN+v11721pL+/XZBX4Oli3Hkd1+LXUc?= =?us-ascii?Q?XNcKK1evECeVsKySsltsaqW64MrYJSpyDRRwqWbLvlhKHKmNT2NJY0TmhHte?= =?us-ascii?Q?lbsVLic4epADHRjz3pO/yrTA8rujx9NMkMIrZT7c6eG3L4FsgEVa05rKW40v?= =?us-ascii?Q?2aR6hPphGwxDp7io4bMq6nwFc6PFglwZth/6uDVTc4kQtrirUiqNDCUG57Mp?= =?us-ascii?Q?sDAN7hMDF48Gnv8s4WpXhCqEM2lDODU7K7gkuGAeprUoRV3gf9PPEj/jRsFQ?= =?us-ascii?Q?OrH7rB+KyOPFTYd63VFsoJ/zl8gdwOcnqivLQ945ovCmCsMOlQSHvE6plDRt?= =?us-ascii?Q?s0McQANVLCmbdXqzkYmOvJx36nxynKkKijO7gNwO2VIIGnhf68XVK453uEz2?= =?us-ascii?Q?ZvCc7ECbj18vKRDzRbdAdmybHsMDzB/CbJGrrKhTM/GmX1kGIogEg3y7XobF?= =?us-ascii?Q?jAcLlxkGzAJ2UC5ZH13Iq+d3+srkM5ZWuyeGC7qR7mAhh51Ll6LAuXsJDQMi?= =?us-ascii?Q?xvvKvgmhOr7F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yg== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 5:4xK+MJtRqetKMUE5ug0LMjvupw6ULifQlvke9ND/w8gdD71dchlu6DEXxyTeIOi/zJyO9d1idB3RahXHcslTimgWY8dWLEVwjY43SpKBi+16cOd1Nz02yE7OkxVD8v38yU6VNG04jC9Kmgr4JPWpZ9dhqHUht3ag88fFTzgq4Ic/KVCWq0Cv0fLf0GwHb9V/ZWdw8EyQhmkZTPigqQBxqskEGgTm1rXEtOMMp/h2QCOpw5UvNcIlmBfcTnNn2xhffSI7u/xQ1uMua4z+rcbNsV+o8lcFgY8+R36gCautjjk4yWeYtQbZu6rXlbVwxhLwbRpgqQjpA3IfzKa0c+cpucxgUg5PLtZTPGnz8OHQkt6pvXxhN9KBB+t+y6c77ZK6Ku2y6Yzx1nlIuctqiODKkARmeYS19b39cq41/3pYK3gPAHtzMY/AXcrq9Ls0f7ciAL3qlyMEyKF+KHh2W6NVrkd/iXVu/kro6JM//ay57qn3mDSu3djEd2iKO6Lgqn13; 24:k6iCqnvj233gSh77OnfG3IWcpDKuz1ZTYS9tFi+5zbpn7NcD+pBA3c6PfAabcrVV895JfBHU0v147KIb6HgZq/EOVZwk/H+e38mMOAOJ60E= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 7:1Q0w1qhqySK2jZlikrsBG6OXzpLMwnSeVZZjJoQ9HiaIQDwIq1xI+y95Vgu1kqkEsL5N3U7vnq/Iix1Mcvub/8dcu5PAKb0y20FZKYR+yck03FWEgrccBYEv0pnn7Kn7BzM0RTAvEYRJhAPZQNl2uMuHj4bblmk7nwPGjjnJmD8QJTu2CUI4xJajXJg7uM9Sneo1nu8Z4kO8WhYXcxNFumryBy75010Vl02Gcrleg/qKkngc7rsxDKc50dFmOYmNuI+rALIUYad4T7vvjx5E/owVC0pJXxEgX63oI+jVEjjll7h332W1E+2k8Ty6QwO6KF8tPq6ZLm84THculm+LYA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2017 20:00:39.5627 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1725 Subject: [dpdk-dev] [PATCH 11/33] app/testeventdev: add the signal handler 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: Sun, 28 May 2017 20:00:46 -0000 Signed-off-by: Jerin Jacob --- app/test-eventdev/evt_main.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/app/test-eventdev/evt_main.c b/app/test-eventdev/evt_main.c index 27d0ae683..56cd137ce 100644 --- a/app/test-eventdev/evt_main.c +++ b/app/test-eventdev/evt_main.c @@ -34,6 +34,7 @@ #include #include +#include #include #include #include @@ -44,6 +45,35 @@ struct evt_options opt; struct evt_test *test; +static void +signal_handler(int signum) +{ + if (signum == SIGINT || signum == SIGTERM) { + 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->ops.eventdev_destroy) + test->ops.eventdev_destroy(test, &opt); + + if (test->ops.ethdev_destroy) + test->ops.ethdev_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); + kill(getpid(), signum); + } +} static inline void evt_options_dump_all(struct evt_test *test, struct evt_options *opts) @@ -59,6 +89,9 @@ main(int argc, char **argv) uint8_t evdevs; int ret; + signal(SIGINT, signal_handler); + signal(SIGTERM, signal_handler); + ret = rte_eal_init(argc, argv); if (ret < 0) rte_panic("invalid EAL arguments\n"); -- 2.13.0