From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0055.outbound.protection.outlook.com [104.47.41.55]) by dpdk.org (Postfix) with ESMTP id F3D9C292D for ; Sun, 28 May 2017 22:01:34 +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=FlWLwmMNv2aK7WFrHZ5MZBaWzestzUai/lDB/s4UHpw=; b=GbcvO5H5JdmTEmZepfhWTpqku0CwJyt/ggX9iI92iroItUYsuSCsfATBdoW3yxzEqEuGVJkC7Ekl12xMHYBGLK0JEoC+RajXMA+DtsNIlR/2isRq+78TTaI/Cvvm5vN0vUND8iaUSmoTX/X5/ArYvMd7qWzOkwYynsUT7xUTA2s= 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:01:30 +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:40 +0530 Message-Id: <20170528195854.6064-20-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: ce3e19f6-951c-4b4a-3ee9-08d4a6045722 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:CY1PR0701MB1725; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 3:bfAXlbFueCVtJqi57Nw0fVzUh/vIfTKZ8tyPWjl4EBv6Kaa9IkA9XjwznjSe4pH3itG8TBds08zY+LsnFq35O0ynpc+PnQza9+MEEaxIEXjFlLGmYpxAdngFMaoKzrcDKWsxcAIfSheSa5FNS3g91Aik9sMtk7OoI4kB6ukXdceNPI9x/eDTfQBMley/KwRU6rY+VGsIc+UtH/B2nhw9uochOUHbEOO5fMETrs/VuC+1bl2w+vTgt+b6o4wytouEJ7IH4/GmDQy8sgXjilhDoR0fzOJvGzN8ZFWHSngjLUN1Al67k5cpZYdtX1yyf3+UJUGpg+0KM+oahZRFw4ucxQ==; 25:AcIZKzsvm+WZjdIkbegycMfc8B8p0+B83JI4ug/VvypmQjCRBL91Ya3fggZjr5nT5SScaOWyCxr1Gbk95hwEj2IhS7fZt13LlqVdcwkhUrzT0lMUWVksqN1mUuJG3zaczVMK8UzLwg8kWXiFJlUrFtxMAh/LrSXGpmgLWYQNJuJj4Uj4YNYOUz8D05os/hW9/5ibhqjDTsPd3khnyQDByW/vj60NddlGDOo8Lf7nIxfiVyrTZYG+W3etC9q3y1poz8lM73iBnZSwqqKXZqUJ+MxxOnA/VcolHRT8EKXHTMIA3kBx/xdiMvWUaouSgZcSoFmB3OhX4Ydn7j1jx3bogJ3OM2Q0Wh4yT1JLBAYPaGZINv1yxniwdtceSQ0+4xaXMkWUMQDJAljEWeqfAmkSD3KXiPV268tTEXXQGkEX69J/yxR1MYlkobTo75C3V53T/xKVdhhKRxazdeW49C4qwSPtixJgifBDmg+q3++WFxs= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 31:XEj7DCxf4VNhi2ere+58IwMFpPwnMnV4zF1FrM2Q7u4wHpFusO8BlHubgv/jXBw5547ZPeMDNm5hwJ+UbOz6RhSYE7Ct9tzGSCDe3rTooRKFemzkDnvtpbUI2TVwA+JVDwwpPCNFxFxeGk++dQqIzjSK6yLKW+I23SL3TdZAINfu5NCzWRZXLLyEyv3MRTs55U3k7GGj10fKLbrNPMQBbdHTPnrs55PjTSmR6eoxISI=; 20:yTVYlTsF84GAcFLfJrOspCfGZYkWpd8qoBUYdQ9HMQQSS+dIOAMsZh+eBZ7058wmlWSh+oeM1+iQ7Vy7dcqstK7DdvPBvFWNzTkx7MHpu7vYJWSfAmxE4yJ8QKw6xTnt8NDqpN0BYv92VvHqgk8ylYh4mYmfzMuwSoankQAATw+qE6048sHLoegqpIdfAJGz3nbFFyKEv7WNQkkPDD1GYzqUhWz+9s7i5K5iVx+AFyXEMMineV/KOilmY1d5nDHC9Vb2tNkZb87gL1v5+ZWsmrnHpgUp6WCzo7UtZloz+PP/9zlKUvVc5cVVrVsQ2ae2i3qBNvMEe8tSpzzPORxTVAXO10woI0IDtqU8V8N40SqGi/VTRfCk7MaCIS5HIdBz/VV3u4DYuDaWn9Dkrx1EPfgaLCGvruj8Xe/bU7cm9k578NbNzHpCEMEMO2m09OPenLv5B/OjMRe5PBnerWMpli92u9iuhmWEGkfBzZ0P9XIgBvBITr//heohffKDYvkaAmOhIsQ+Xhy931HNI9YaOowRc1Y8+lkpReVoKH0L8xvVJl0nJBfjRsfv89c/cqLcAo3mljQu+P4mDqp1VPV2K5+w9IiKN/pzjK3pGxfYyb8= 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:phCs5l8vkj1/qWG4psvTy6XaUtQkVcR9tabhI2rw?= =?us-ascii?Q?2A8wV7Fx3iEgekSOV+CbyTeAxBdMK80Hz6ohyjoGtWKedXXihcM5zDyxpj/3?= =?us-ascii?Q?5kKl6PZtCWfl1fC7vi5nneWohz4uPQDvQD5ChBb+ZJpzCRcd+2tk2hfhqUX+?= =?us-ascii?Q?NAgu7GC9As4fcVQqBnSIDt2QBsWAAmm1cXW4dZEK+mlyo/ITh5rkcGFT5MDp?= =?us-ascii?Q?Gls1xEFLE00uBZZ7mHX6er0hn+O8WNcDwrkYD+fN+doMrDvgigPWN65tDrpo?= =?us-ascii?Q?2lL3hpQ3YnjRi+N1UH1WPRQ7rjrhojAjbIDKfrMhw2QkuuuBsi07quKlQGum?= =?us-ascii?Q?CKpl1GhhLxDwx7PXi5jCyW+Zg5qgXTM/fbjtaJFAXSynTq5spAMF90kXS1JO?= =?us-ascii?Q?5k33vSSosZRfYx9/7J73tzD748JftjuNHsulOMh+5kodBsQjWuUv8DNd7UX8?= =?us-ascii?Q?aa2/XYVN6IvOrcEh8HkIsi/DW3jZR27FI9P/+/P0HYouFXM+HcISZlP7Dhg2?= =?us-ascii?Q?RpnAVWmbSjuTrU4Vx6XXJXhPZajxEnsBtGNCGYFqJM3FB3QIdk4gG15KrrJJ?= =?us-ascii?Q?LRCn1gfk+HLOGRtPWg6C7AmgQIlfngXEFyFOWmuB3cPvuFKzQDRLg93/lFEL?= =?us-ascii?Q?HwwYT8dH7SW7s0o+QS6bG7e9r77uv0EIgAk915nDiTUUJNLlad7d/uKQL8as?= =?us-ascii?Q?hQmVUOW9AzVZGH1/a8zwnH/f7XczebmKYgiTyDq57ANCTmsI4LBfbhAnwykI?= =?us-ascii?Q?p/aVSALe+J2F8IVAX7Flv9mvUCSrYbG81AhIjMToUMsBdwPlDpigjsnhJf8j?= =?us-ascii?Q?vBsOknCfIqQcjJX6Bg4AdTqt51veY5skc9oPamEwmduoh5fWMUQbTy0Sjvat?= =?us-ascii?Q?ASa4G+lGEsLstRnJgq3lgnSixHdHn8/38gVnb4D5RFcH2iL7FgMQ4fWZM9m2?= =?us-ascii?Q?EAqzo2LWkVydPaIoMf3aM2cJHRBsCZcsgsEMvewSjE7hWdysHEvNxU6WdN0l?= =?us-ascii?Q?sJOjd5p9bSsTgRgg7AIBQztAzBgyffTprcOr9jJxf54b/8H64s/sYj78Xqpk?= =?us-ascii?Q?wNw/xJmDcikVy6eG7wLuqJFs1yC8XvcVAx31mSGDQBpcIotOCa18tIJtfTij?= =?us-ascii?Q?kRYwNXOmyVE=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)(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:lQuVrAw5/6uDXIuQUkNYoVcULphHBf7AcTrw4Zq?= =?us-ascii?Q?toCLEbYXDGRxB/FTvPDHbzq8Eg9P8oApStqzx4eboq9Hk2db/ilUqQ40gQtR?= =?us-ascii?Q?bDxDHJTYpLY0KhxogCKRdXRH+o0/JsWq2+1+EISs57DCvphKcL5S03LnMiYL?= =?us-ascii?Q?PGV8UrzHAjLNfC/BICh14SZlYyCKDHbHtlbuhsgNcwTO6zL/ZVgKPLfWHBf4?= =?us-ascii?Q?eL7b4Ol6UAySd9K0FPVk8wkEEJ3s5kioFbBsUDDJGyqWjdr0/zL2bAC9rxea?= =?us-ascii?Q?5fcFlVfcS+/uEMA1jLBdQqRvE5SbOjObgjpLRTSA83g7JOswfGtiOkCg6Xhe?= =?us-ascii?Q?30dFHrfkBFEij+JqSP0YL8i1iCaCPVUHqsEq7UjMLgTlnNhOXHFCIiEatiWa?= =?us-ascii?Q?qOrIDd1sjPFvW/Y90sOiNb/giD8gbKatlE2vX38lgKddoewqjkXUlxcQtM+k?= =?us-ascii?Q?laKk3SmF+F1gzLr2nBOHt6qDDJ2vn4JQmnIwpuDd/bAZyVYvWuxFJg3xni5H?= =?us-ascii?Q?UXFEqGY+bPCAilf65e9QzcNMVGayT9sDuMknb1BNp1dnLoakYripLR3pPQy1?= =?us-ascii?Q?lDgOA0nKKpJM3mkIDoCSEkrEcJgtbkEMHVctY3D0Z6sUdABwxku/REjZr7NT?= =?us-ascii?Q?mfNzvRMlR0q7Q4fZGSVu41FQvhjQu7FdwqdlSuKctniNb8kMnMn29GuIgLLq?= =?us-ascii?Q?+zU8kS3PX+omnERwm8UIjommWi90XVHWPibuBAEz6v26Bg8Ng4WnJWB2jv/U?= =?us-ascii?Q?yyp4HN7MRR1JTd6qI0C7NcTMzx71aJ5n9epyBWeBvZmCx7Q5xkLghYy+mNGk?= =?us-ascii?Q?8m48WuOiv/06tbvtdVMNRBwt0IR43KacSryyTzhQ2xgWUJPsXldoHrLyayfi?= =?us-ascii?Q?dRL9SW62WmtwmT+CLhxJ1kYajD2UJGb3p3UOCkjzLTdmp0U6rXM4XZFNCE6g?= =?us-ascii?Q?zjXoBGd3RwzmEFXRXRomHGjGeohCEYuNA70OuWeC8TyRddf+7o76h6aREsvm?= =?us-ascii?Q?c79edYtc5uLSt1uf1G5YzW8ajQqHRGolz3xmTxr/I3/22ebZxUErJ+7uANyR?= =?us-ascii?Q?+Yqvi45eEw+x2btQ+BX9/ppmAblqanM06aS5Al25OBDoXSaKTDqIkkmzat5b?= =?us-ascii?Q?ILpe6/mVOv4v2QtTvKUTbtH0TzMDNbvhIiugF8zhRf4lmEUdLkSCU3kOGs+K?= =?us-ascii?Q?L6zPop7jqroAb6B14ZR0bXpl5KPKBZIy7zuYV?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 6:EpR99mUuNiW7PshO9j7EAftP4MmAC8RGfJme8vOM543DGFNGDPKpQDGa1RmoaBYnn94ecv5A/XSkraVHdKRQMZFVWbz9lHn86prxANM5PE8sA/RyfRLChqaUw6YM016zqjDXSRy5n0+i6KeW4KgWL6AC0xNK+fiHTnzzX72DiYOM5WvFI+SGN/Z6/zSbWlBURH9z5T6tCENDmKgxy6mSK9SPp/h6B0wVDEBpJo/dan4XnDXBD/0eYCiJq/EztQ5lNNKWFKTtEXrmXFGI6yKbWQa2vORluryuuEVGczYvty3OygD1PhMBPjEXM4j7ObsdoXn7j4hr15xGtGoddamsh7kdYzhxNEwR9A9MTY07IU2DgJ+cX/u+JCRROYRTB1S5FzDubuRVj7d3PMeNUi+T0Nhlqc9Cus+H14s47ZwBGmF+E4JIptZGPc9p5Jm+dc0c0tMAZY/6NlMsbbrVHKb6SDIfPhKr7NunBm01YH+gLKu/FPCCTM8fruZG9cgvUAZhCKAt2VtfVnAyPvjJ3GQYTw== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 5:VqsyisTMMUPWVyKvC7wZfqhLG0N+jedr8iymaXuizryX1B5Phsz8hAZuWpV1jgI/MBElF2txEr4j2R5QL2lAL67MAn3lWTXoo1bzw9gnQ6qZPM/XREAIH08lJTZUfE3q+8q0jKYGwTvtRQFp6iAL5qXXk3lHdZsJqKGvo2A5JLvSj/pm897YKXgT+1Iw097QRkkBu4+ameFSxvYImSKReK+pfr2s84CarUQMzBhcyGqd4B66nQaLpQSP6dlhje7N4rxS+CVpuAqmH3USJiY+ecvwEYtK6LcAyLg23OhU8qy4Jxi94hoBV55nq5qmWXbc3L8LFguRjmYmu4LWMMmgWmyMG0A5ZNGlmjhd43mG7bw5O5gtMpbDk9x2wN65pdvGy+UsFTITaEjHdjqWoV+cknp7kzCC9CJf8Qt+vHRpnbuuy4lwd8EZ+QJQhIsqIidz08WjY/+H7YN4ErQGOuv1ed+BqqY8nhlMGpY0+qhAGQ4pafAx8B+v3kalvY1QhC9w; 24:UOHwVnlFkL2wer99zbEmcPdc64qL6YjfDXtKjouZO8LNzFkpjywk82oNbOsJ9bcuw95gGcHKDtZd8odSPsinSRkTnTc1+QGoPlRMlF/GYSo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 7:ttNrdst9vsYIsjo60tAU8GXPNSa4zERNpLwCCMbvHa9OTdJLjgViSm8Omf3d1nr//LseTGqbJAQmTD4mH58+f1H+GkNzAhmgSyeoypA6VCAZiRVmtSd3NAuRyUhzHA4fVABYsb34v+Ilm1pK4hlcx9oEHU6iFn5vC2l/E7Uw3V7btc5ABMVOfwhT47KJVZ9XGkb8UeXsl5lsp+5ApkEdZFMi8xcAC56+X9j++wLYNqA36iTIxZXON9FkNuINmVcx+Le2WopRdkwwE1900BR9mrxJQ6ZIWm5ZGXWMV/AjvpT3YneVbaGmUVIhq+Rl2ngfSvP0pR/KIK1hZaCkIRexlA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2017 20:01:30.0644 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1725 Subject: [dpdk-dev] [PATCH 19/33] app/testeventdev: perf: add test setup and destroy 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:01:35 -0000 perf test has the queue and all types queue variants. Introduce test_perf_common* to share the common code between those tests. Signed-off-by: Jerin Jacob --- app/test-eventdev/Makefile | 2 + app/test-eventdev/test_perf_common.c | 71 +++++++++++++++++++++++++++++ app/test-eventdev/test_perf_common.h | 88 ++++++++++++++++++++++++++++++++++++ 3 files changed, 161 insertions(+) create mode 100644 app/test-eventdev/test_perf_common.c create mode 100644 app/test-eventdev/test_perf_common.h diff --git a/app/test-eventdev/Makefile b/app/test-eventdev/Makefile index 93c36e510..242d3eeac 100644 --- a/app/test-eventdev/Makefile +++ b/app/test-eventdev/Makefile @@ -47,4 +47,6 @@ SRCS-y += test_order_common.c SRCS-y += test_order_queue.c SRCS-y += test_order_atq.c +SRCS-y += test_perf_common.c + include $(RTE_SDK)/mk/rte.app.mk diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c new file mode 100644 index 000000000..d95eb6252 --- /dev/null +++ b/app/test-eventdev/test_perf_common.c @@ -0,0 +1,71 @@ +/* + * BSD LICENSE + * + * Copyright (C) Cavium 2017. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Cavium networks nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "test_perf_common.h" + + +int +perf_test_setup(struct evt_test *test, struct evt_options *opt) +{ + void *test_perf; + + test_perf = rte_zmalloc_socket(test->name, sizeof(struct test_perf), + RTE_CACHE_LINE_SIZE, opt->socket_id); + if (test_perf == NULL) { + evt_err("failed to allocate test_perf memory"); + goto nomem; + } + test->test_priv = test_perf; + + struct test_perf *t = evt_test_priv(test); + + t->outstand_pkts = opt->nb_pkts * evt_nr_active_lcores(opt->plcores); + t->nb_workers = evt_nr_active_lcores(opt->wlcores); + t->done = false; + t->nb_pkts = opt->nb_pkts; + t->nb_flows = opt->nb_flows; + t->result = EVT_TEST_FAILED; + t->opt = opt; + memcpy(t->sched_type_list, opt->sched_type_list, + sizeof(opt->sched_type_list)); + return 0; +nomem: + return -ENOMEM; +} + +void +perf_test_destroy(struct evt_test *test, struct evt_options *opt) +{ + RTE_SET_USED(opt); + + rte_free(test->test_priv); +} diff --git a/app/test-eventdev/test_perf_common.h b/app/test-eventdev/test_perf_common.h new file mode 100644 index 000000000..ab5c082f5 --- /dev/null +++ b/app/test-eventdev/test_perf_common.h @@ -0,0 +1,88 @@ +/* + * BSD LICENSE + * + * Copyright (C) Cavium 2017. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Cavium networks nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _TEST_PERF_COMMON_ +#define _TEST_PERF_COMMON_ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "evt_common.h" +#include "evt_options.h" +#include "evt_test.h" + +struct test_perf; + +struct worker_data { + uint64_t processed_pkts; + uint64_t latency; + uint8_t dev_id; + uint8_t port_id; + struct test_perf *t; +} __rte_cache_aligned; + +struct prod_data { + uint8_t dev_id; + uint8_t port_id; + uint8_t queue_id; + struct test_perf *t; +} __rte_cache_aligned; + +struct test_perf { + /* Don't change the offset of "done". Signal handler use this memory + * to terminate all lcores work. + */ + int done; + uint64_t outstand_pkts; + uint8_t nb_workers; + enum evt_test_result result; + uint32_t nb_flows; + uint64_t nb_pkts; + struct rte_mempool *pool; + struct prod_data prod[EVT_MAX_PORTS]; + struct worker_data worker[EVT_MAX_PORTS]; + struct evt_options *opt; + uint8_t sched_type_list[EVT_MAX_STAGES] __rte_cache_aligned; +} __rte_cache_aligned; + +int perf_test_setup(struct evt_test *test, struct evt_options *opt); +void perf_test_destroy(struct evt_test *test, struct evt_options *opt); + +#endif /* _TEST_PERF_COMMON_ */ -- 2.13.0