From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 47C34A034E; Wed, 6 May 2020 19:15:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A00EA1DA66; Wed, 6 May 2020 19:15:49 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 6CC6A1DA4C for ; Wed, 6 May 2020 19:15:48 +0200 (CEST) IronPort-SDR: lxrWmmYb8J85SbpBHewvHNxtvcAqqHkzmNr7F1uER7sz1SeFA12RLttELL8CcAwkxstVtGdY7n 5+NoGsGJoaiw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2020 10:15:47 -0700 IronPort-SDR: op0yaV5DpMRnNenlBGV1AlgvLJQ/ZTocqK9ZrfK2814usUAV7l4S31C1ABMFf3bOnuVh9ALpAE e8SfL4JvjsGQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,360,1583222400"; d="scan'208";a="260172167" Received: from silpixa00399779.ir.intel.com (HELO silpixa00399779.ger.corp.intel.com) ([10.237.222.209]) by orsmga003.jf.intel.com with ESMTP; 06 May 2020 10:15:46 -0700 From: Harry van Haaren To: dev@dpdk.org Cc: david.marchand@redhat.com, phil.yang@arm.com, honnappa.nagarahalli@arm.com, Harry van Haaren Date: Wed, 6 May 2020 18:16:42 +0100 Message-Id: <20200506171642.32105-1-harry.van.haaren@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200501155649.2959-1-harry.van.haaren@intel.com> References: <20200501155649.2959-1-harry.van.haaren@intel.com> Subject: [dpdk-dev] [PATCH v2] test/service: add perf test for service on app lcore 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This commit adds a basic test to check the cycle cost of related to calling into a service. Signed-off-by: Harry van Haaren --- v2: - Add space at start of output (Phil Yang) - Fix compile error on older GCCs (David Marchand) --- app/test/test_service_cores.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/test/test_service_cores.c b/app/test/test_service_cores.c index a922c7ddc..75a3f8b45 100644 --- a/app/test/test_service_cores.c +++ b/app/test/test_service_cores.c @@ -789,8 +789,19 @@ service_app_lcore_poll_impl(const int mt_safe) "MT Unsafe: App core1 didn't return -EBUSY"); } - unregister_all(); + /* Performance test: call in a loop, and measure tsc() */ + uint32_t i; + const uint32_t perf_iters = (1 << 12); + uint64_t start = rte_rdtsc(); + for (i = 0; i < perf_iters; i++) { + int err = service_run_on_app_core_func(&id); + TEST_ASSERT_EQUAL(0, err, "perf test: returned run failure"); + } + uint64_t end = rte_rdtsc(); + printf("\t\tperf test for %s: %0.1f cycles per call\n", mt_safe ? + "MT Safe" : "MT Unsafe", (end - start)/(float)perf_iters); + unregister_all(); return TEST_SUCCESS; } -- 2.17.1