From patchwork Thu Jul 28 03:09:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Forrest Shi X-Patchwork-Id: 72924 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp625605qga; Wed, 27 Jul 2016 20:23:24 -0700 (PDT) X-Received: by 10.200.50.82 with SMTP id y18mr50924829qta.29.1469676204510; Wed, 27 Jul 2016 20:23:24 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id i197si6597338qke.82.2016.07.27.20.23.24; Wed, 27 Jul 2016 20:23:24 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 2FC6D617B9; Thu, 28 Jul 2016 03:23:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id C97336850E; Thu, 28 Jul 2016 03:22:31 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 44E81684FF; Thu, 28 Jul 2016 03:22:20 +0000 (UTC) Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0080.outbound.protection.outlook.com [104.47.38.80]) by lists.linaro.org (Postfix) with ESMTPS id 1BF3868514 for ; Thu, 28 Jul 2016 03:20:48 +0000 (UTC) Received: from DM2PR03CA0025.namprd03.prod.outlook.com (10.141.96.24) by MWHPR03MB2496.namprd03.prod.outlook.com (10.169.201.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.549.15; Thu, 28 Jul 2016 03:20:45 +0000 Received: from BN1AFFO11FD038.protection.gbl (2a01:111:f400:7c10::174) by DM2PR03CA0025.outlook.office365.com (2a01:111:e400:2428::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.549.15 via Frontend Transport; Thu, 28 Jul 2016 03:20:46 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning linaro.org discourages use of 192.88.168.50 as permitted sender) Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD038.mail.protection.outlook.com (10.58.52.242) with Microsoft SMTP Server (TLS) id 15.1.539.16 via Frontend Transport; Thu, 28 Jul 2016 03:20:45 +0000 Received: from titan.ap.freescale.net ([10.192.208.233]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u6S3KZOu008139; Wed, 27 Jul 2016 20:20:44 -0700 From: To: Date: Thu, 28 Jul 2016 11:09:31 +0800 Message-ID: <1469675371-20274-3-git-send-email-forrest.shi@linaro.org> X-Mailer: git-send-email 2.1.0.27.g96db324 In-Reply-To: <1469675371-20274-1-git-send-email-forrest.shi@linaro.org> References: <1469675371-20274-1-git-send-email-forrest.shi@linaro.org> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131141496460190168; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(979002)(6009001)(7916002)(2980300002)(189002)(199003)(19580395003)(19580405001)(97736004)(105596002)(33646002)(68736007)(50986999)(76176999)(2906002)(4326007)(50466002)(2876002)(48376002)(87936001)(2950100001)(86362001)(86152002)(8936002)(104016004)(5003940100001)(92566002)(586003)(110136002)(77096005)(36756003)(6806005)(7846002)(356003)(229853001)(189998001)(81166006)(106466001)(81156014)(305945005)(50226002)(2351001)(47776003)(8676002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2496; H:tx30smr01.am.freescale.net; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD038; 1:GVX/N2Go9nWqnIp7TvxDDpbpKea+BZ/fbEuoffq3+sthWvz93GkQSJHdNk+/E6X58GpXbKVbJxmkgVaB6N6YZ5DCmnvXyOVE8CwGLjMgl7Z4KFBMuG0ZQXqVJsopkbxFEHAsBraRRnlJDctgQOJ0LPhCaLKXMNeVHF01QKEhZz7gbTfNfC3+FZ2GzNV2BKYRoSzmNULRjLnqzRqWOuFF91KP98nnTcmv7d7pJz2AIGQG39jR7QLDgVT8o5A+6pMzrOo4nUjXPd+V9JKy3I4RmQlF35EA+3XYFc/TSK0zDvDH6kA6waULzenEufm8pger6FArhpgmdtth+cck7d1+jeUoYEoyi2wD2pv2kSC0e+nQDmrRwv2GQDEaQc71Z3ipchj3mMNQNvHqs4QMeU/naXJGzOzxGlxOqYhqOM6IpkmSvIMqXJdnz/NsDJwpgIyyftHC9j6bTUjz9uKj6SdvFDc30Xw1MOnR5HekQDAZHUzh1D9855rR9c+KY1S01ljRu7g6qO2QLrOC8ASJP4qBF1lp+5UDMjQevkSpfn4Dw2KRkHl9+9eff8m7j5uxNuL+hZkWDMnSRn3JUFmA2msX7yNqJ+GT7lh6GHlagZDVfhXYB/bWZbFqC8b1nLTTSJO17N7b4B94QwLPtbzsVYYtNg== MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 3b4e7f8b-a50a-4cc4-96d0-08d3b6962a36 X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2496; 2:27H9v78HD7ZE0ATZEbr1YPXNUh8Z5aFvQqgHCSN9d718ltH9AcWqrINlmL1HqyWVKovPk7LwJX4qjN1uaE1S/gdCFth8xlwggpZtkoWrCHlH/HpefRjuUEdmUFk1tuqSCGMKY7Z6P3hOXyqmK11EsBbVD9RixZHcBGuuOiuHYY9VWBwYuou/OXCJo/Pp06Dx; 3:hW2GauarWfW+W8HSOyEVPOnT+OflEUcs/HU2EvRf0zArwQweqbVqyQncvTNF3v9CGE4roHWnmlBlN4QtbBJiR7hUAIeIiZ/2DpK1N1LLV41olnDdezytlTgNEgm6bBbD9CHn+nk9Rjb7HVwnBE/uPbKv8h362jxx8DCbUzcItqBKY0BVLakifc2ZvgP7K/XUSMX69yaEB1Ox+fMtvIqBGsQcbgMhMakyA61zOl6YgZo= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:MWHPR03MB2496; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2496; 25:pqaHx9HL0buJYiDWWTmnX7FljigsCS4FlNbjwtR1nQQATytw4dtw8Uj+AgRmi1No7WjY71m2J6sy8LHEZz8Mbjmf/kl95zhw1WtA3aocn3fsrnNiCxJiHPoNTVQCJUgRmHsV7cnUAZ+6ER7czQaad13hSVedKOZLFzffi3oO+qx6RGplMgbvprx0HyjXDW02DGHtTbjW/TBNgCpGEJCY4b7acGblbaUz+mftagR464Bgr3MYmJKbMYuwhiKkG1MOk/neN9dGUT63PwtQl6EvsyETdCthcPNMNH6UzLTQrie11y5GwaRTnn0Wsv3V55FlFU684Y1WBGgf+zCZ91Mpho62x5Ut4z9mp2LwT2HgX5A7AphCRNZyehJ5dMiHXIO+EpTq8L9Bvwx+KHzqZwEVbmouqMP6EQxTWRyufsyra9KxI9o1W1Nv69UV299zIHos22MNUZ+Kh6vJb/GVCQmnsDf10ZsW2ZmYast3Bnkh/yjxciYUpQFBCUxZkikXEYo8J+Lz/sw8zICxKsVpyV2C0w9qVWg4xIAnMzZLxx+S6k5UeIZ/uaoko0DYxn6RdJtkfPRYv0/jS4YZjJntnmBVqdHUJRe2vITg83d6sWfGPctinY18fixri3wTjsDzuzomhvQNsl85FiLY35EhXhmNyxywXKG1iENCfve3hrE2x4rFwfJlUG/WFyf8zl0JabYA7CAJ+mTFwquTI5h9OKJqwA==; 31:FSXY/mf/9CO09HAVgWYuc4WsT/uj9wtCyhjKeEcgqG0fzjMkgIECfv9tAr+1KVVgzU0Lc7dN9qCGkFdcQF6s9twvCoJl66Vxb8ZX0smzXMB2g3LY0bLRfpVdb5ITu31lTtvuhG6wm6W9WpH3aKRH1REfNWJOKAiUzQ8cRLpJ2E6cv1Q9Cm13RAZrDj/j3K3uCOeh2F3Fg4uwAKOFFm5fJA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13024025)(13015025)(13023025)(13018025)(13017025)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:MWHPR03MB2496; BCL:0; PCL:0; RULEID:(400006); SRVR:MWHPR03MB2496; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2496; 4:WP+nXP24fPRIK5pVl+tT1Xxm0yswWkrPBGXHzWSHSVOfFzs6Or4J0AA3YDvRPGPB6Kkk0oBwcr7uYjfQrVmBsqUMaLGy81oZzt+Rnzm+ZlrtEDvx7P3Eh28O50C0k+RYSytRHyTlW7yNhjFJjY76TtBTP1pLW0duXANU5y/VL1N3WhtiDCDPlD2JtENvNNXpXNh0YynXYVBKwCgMdikCR0nUdBSEFCyessO9LAGgX2kbAIVg+qBc6X3kTcp2kCIq4PwWt/ArSUscS7AZQUQP+lyIfI2x705OH6pFmHQ+ySS0rel7HilT3grholo4+5b48SkEyWWuuzcFv4VnEeiUFNols2NhuvYr3B0EqpoJCeEHxyiao53bqoKO12Ca4X2PdlgbNCdzy+x+PvPROezO8962lYXyacw4va5cqk8qXwwBYzDSc9GNznWLUHlgBLMWCDnJALG7NGA6lBXDCSFQTWv9M+UV3gNUp16mRs2Qrck= X-Forefront-PRVS: 00179089FD X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR03MB2496; 23:SIpdG3wdXCARspl/FvkbquqqI3xrw/xeR5kIOWbqY?= =?us-ascii?Q?O+Cu8CUHKP+eGUE9iXXOhU2+gFD5p3Vrsx21ekWZZWt56W8BXIMxfp4uNWEH?= =?us-ascii?Q?FmY+oJxL6gXB/hAOdXkYboPT0taqfUjV0JCX5vE2rbxDBQDDphr9MI92GxdG?= =?us-ascii?Q?tnO5E/RFPEgntsZ73y+l++QqIxa2+d2rYAE2hR68gHyTK9DiJMrKwOB+acHO?= =?us-ascii?Q?sXmRVlU9rtNLnIlVYbK7qq3cUGHxYAu96w/52zXCSwHDKBH/e9WAC/iMFsO5?= =?us-ascii?Q?T3QqUH4b3ypfNSOAyVhTWmELBw+21bhnu24sbN0RQ/mYwjZooIKRDYyxvoAU?= =?us-ascii?Q?C/8C6LTDNQCJQxIlDIvno9FJEPKH4eCc8AZFP8vjoCT1xRKdgBAYFIpklA1t?= =?us-ascii?Q?F0gSKZCEi400gafwm8S/GHpwNh4Z/LWxReSmYgr75Two78tobS8Lfxt1jiZS?= =?us-ascii?Q?/LA+tUVfh+I9+7JxZpSeZt9xjB2NrvonqurhSuj1YwoADl6YDfp3BWzf4m0J?= =?us-ascii?Q?8/C09XuL3qoujXJeQiio4mr7Q7FZ23ROh/c06Kqq9I35hLCmvSV0TQIz5r7p?= =?us-ascii?Q?hNAwR39cHA0+fAae4w7onSCKNQskTLattSumGQJSKCC91IPUjunTgjkPH3FR?= =?us-ascii?Q?d6rlhPWSmaw87FN3xopS6ECFyigZ9BOIjo+fD1raoXJbPPRkSYnzZQsVn7g5?= =?us-ascii?Q?IimXG4dIlj8c487UnPKsHfKZjoLnasj7JrT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f1YrjCpkOHLg6s0OUg59ES9UeP0+DxhPOGvXQaSBzCbw5Ds3f9k08Yms=; 7:cQFCdz5f6FqSjcm5rBnYZPkmxtzIHl7OEeuEWlsN3RdNrdXNEp52ySlN1fookeSnmyWKst4246VWu3+SRLrBHsjY9CGnzsaNHJ90PJx3+dRbDDCTmtREOQPQTmCPam5rV/PK0SXwrzoYs1GS7c3mbZ09FK3wIOFd9W2JvgNClbV6JU13mRq1TSJghDz9sabz4+O2Mv9AkQIIDUj2/30H8Ods5EfNrqrIei9DZyCxq3bnHzFpnnKL9Cl6PQrkTDfd SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2016 03:20:45.7070 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR03MB2496 X-Topics: patch Subject: [lng-odp] [PATCH 3/3] example: traffic_mgmt: add termination path X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Xuelin Shi release resources on exit Signed-off-by: Xuelin Shi --- example/traffic_mgmt/odp_traffic_mgmt.c | 11 +++++++++++ 1 file changed, 11 insertions(+) -- 2.1.0.27.g96db324 diff --git a/example/traffic_mgmt/odp_traffic_mgmt.c b/example/traffic_mgmt/odp_traffic_mgmt.c index ff03542..6b33560 100644 --- a/example/traffic_mgmt/odp_traffic_mgmt.c +++ b/example/traffic_mgmt/odp_traffic_mgmt.c @@ -793,5 +793,16 @@ int main(int argc, char *argv[]) printf("pkts_into_tm=%u pkts_from_tm=%u\n", pkts_into_tm, pkts_from_tm); odp_tm_stats_print(odp_tm_test); + + if (odp_term_local()) { + printf("Error: term local\n"); + exit(EXIT_FAILURE); + } + + if (odp_term_global(instance)) { + printf("Error: term global\n"); + exit(EXIT_FAILURE); + } + return 0; }