From patchwork Fri Dec 20 04:45:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honnappa Nagarahalli X-Patchwork-Id: 182209 Delivered-To: patch@linaro.org Received: by 2002:a92:1f98:0:0:0:0:0 with SMTP id f24csp58587ilf; Thu, 19 Dec 2019 20:47:28 -0800 (PST) X-Google-Smtp-Source: APXvYqwGcZwCVkLEHAPi22DvhdKzdoS+vLrH1hItq0amQ55ZOlkLc+s74HahnWoe+N7XH+DdAiE4 X-Received: by 2002:aa7:db55:: with SMTP id n21mr13479097edt.31.1576817248115; Thu, 19 Dec 2019 20:47:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576817248; cv=none; d=google.com; s=arc-20160816; b=ol5rMFOpWGofj18uG54Ha4Gb5d0oOj1Kzyj1nYm4EIWrmcxBDzTSwQh53xzMp5k4U7 xCnRbLpTPDcCqUX4D4Z4Cns59oNDt7AhOA0zZCJ2TjZHfvYLoecdocrZprKYplR5icmB kV+jDm1sYuw7rPViNwZcptDa6jN7X1o3bwHEi+M+8OMr0DR6y+uhOIdf7MVwlfO2+qEv N1/MMBATSLBLnn8Jm9ThEV8LmhV2W1BVgymNj/BTqTMpNw9ud+JdROZkKheG6Nk1GtlS GfkkeUBWPtpTuxDHC9SJWlITrGp9tDhoL0y9KW68jrfRij68gHStzfdpR6vIvxNbRBCI 6yxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=ElnT8qjBsSTHRwoGhIcCSTsJYHQmg3tmVwB2l7VrZbk=; b=A2RFlznzSjwpnnDKU2R5wNVegA1nh5beGNhAdPsBG279n7Rg4WHr0vKmHn0JKO6Pa4 vlIUw0vPRTWRXMS5z98huuChHwHgECtYoowxUCl9Zhb2Uw/pOWZzutGpAGVR0wdhZGdC kx425yI+kJBM9nSvECqpZeNCm+zZiWIPb6kQyvrmwZVmOQv9ttTQjwl0I2WjJet6uqhO rz8jHRTyajF49jAfvozu6TQKV8EwylMibxCn6UmLKpP7XWVwqjBK8cQ8zjSGozHdgsbu rTqYdn4AMUhlfM5yuu/+JATQJzNa15N//DPrubgmTI3VuT7r1EWQNCNjhY1KtRGe72b1 33tA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id g3si6158797edu.96.2019.12.19.20.47.27; Thu, 19 Dec 2019 20:47:28 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4556F1BFAD; Fri, 20 Dec 2019 05:46:20 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by dpdk.org (Postfix) with ESMTP id E98C51BF7A for ; Fri, 20 Dec 2019 05:45:58 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 820C613A1; Thu, 19 Dec 2019 20:45:57 -0800 (PST) Received: from qc2400f-1.austin.arm.com (qc2400f-1.austin.arm.com [10.118.14.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6D9173F86C; Thu, 19 Dec 2019 20:45:57 -0800 (PST) From: Honnappa Nagarahalli To: olivier.matz@6wind.com, sthemmin@microsoft.com, jerinj@marvell.com, bruce.richardson@intel.com, david.marchand@redhat.com, pbhagavatula@marvell.com, konstantin.ananyev@intel.com, honnappa.nagarahalli@arm.com Cc: dev@dpdk.org, dharmik.thakkar@arm.com, ruifeng.wang@arm.com, gavin.hu@arm.com, nd@arm.com Date: Thu, 19 Dec 2019 22:45:17 -0600 Message-Id: <20191220044524.32910-11-honnappa.nagarahalli@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191220044524.32910-1-honnappa.nagarahalli@arm.com> References: <20190906190510.11146-1-honnappa.nagarahalli@arm.com> <20191220044524.32910-1-honnappa.nagarahalli@arm.com> Subject: [dpdk-dev] [PATCH v7 10/17] test/ring: modify single element enq/deq perf test cases 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" Add test cases to test rte_ring_xxx_elem APIs for single element enqueue/dequeue test cases. Signed-off-by: Honnappa Nagarahalli Reviewed-by: Gavin Hu --- app/test/test_ring_perf.c | 100 ++++++++++++++++++++++++++++++-------- 1 file changed, 80 insertions(+), 20 deletions(-) -- 2.17.1 diff --git a/app/test/test_ring_perf.c b/app/test/test_ring_perf.c index 6c2aca483..5829718c1 100644 --- a/app/test/test_ring_perf.c +++ b/app/test/test_ring_perf.c @@ -13,6 +13,7 @@ #include #include "test.h" +#include "test_ring.h" /* * Ring @@ -41,6 +42,35 @@ struct lcore_pair { static volatile unsigned lcore_count = 0; +static void +test_ring_print_test_string(unsigned int api_type, int esize, + unsigned int bsz, double value) +{ + if (esize == -1) + printf("legacy APIs"); + else + printf("elem APIs: element size %dB", esize); + + if (api_type == TEST_RING_IGNORE_API_TYPE) + return; + + if ((api_type & TEST_RING_N) == TEST_RING_N) + printf(": default enqueue/dequeue: "); + else if ((api_type & TEST_RING_S) == TEST_RING_S) + printf(": SP/SC: "); + else if ((api_type & TEST_RING_M) == TEST_RING_M) + printf(": MP/MC: "); + + if ((api_type & TEST_RING_SL) == TEST_RING_SL) + printf("single: "); + else if ((api_type & TEST_RING_BL) == TEST_RING_BL) + printf("bulk (size: %u): ", bsz); + else if ((api_type & TEST_RING_BR) == TEST_RING_BR) + printf("burst (size: %u): ", bsz); + + printf("%.2F\n", value); +} + /**** Functions to analyse our core mask to get cores for different tests ***/ static int @@ -335,32 +365,35 @@ run_on_all_cores(struct rte_ring *r) * Test function that determines how long an enqueue + dequeue of a single item * takes on a single lcore. Result is for comparison with the bulk enq+deq. */ -static void -test_single_enqueue_dequeue(struct rte_ring *r) +static int +test_single_enqueue_dequeue(struct rte_ring *r, const int esize, + const unsigned int api_type) { - const unsigned iter_shift = 24; - const unsigned iterations = 1<