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 B3F58A0555; Wed, 19 Feb 2020 11:39:20 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7050A1BF78; Wed, 19 Feb 2020 11:39:20 +0100 (CET) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 44BC6397D for ; Wed, 19 Feb 2020 11:39:19 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id E6B522221D; Wed, 19 Feb 2020 05:39:18 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 19 Feb 2020 05:39:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=mesmtp; bh=s5Xy/nniZFMabLvt+KHDtRU Cp3c2EtoZGzNFiXeLnKs=; b=oaz4DvSJmJVbyyRZP84ZSlVCs+Ydx3jDfVgRazc Gb1ejvY18P87+HHs6727CfxlUwTKjnjYrlFDdKvn8nLdU3GwYzvkpQL9I7nUndlB IN2IOeZBiuYyYWMoZst5DVzXT3yYY3g0QWmqtML3uQZcooONR8+pvVoovfERh1H7 KwpU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=s5Xy/nniZFMabLvt+ KHDtRUCp3c2EtoZGzNFiXeLnKs=; b=Y24S7Ih++73fzRQbCF7BJpl1kam5JX0QF RGzd6OM1dBIaE3Bmq9zfpSYnGhAw2eKkk+P+B0MV6J9erxvranY1YQxI/1pdBvhO qW5g0GHPgNTiF1Pfg3vLPpn6d++Q2vzcxHH8EAXzgdScHxevRduZYuWG1BdEc+XX Y5NuLO+vD+jGT16PcY8mBGWjLXMzUpgf4x7IWaSsUG5oegf1xXgyj/hOqhnrVE85 Gf5c+Ofwx5GpiFPeWb/j7x4WRa9A048h2uwWOyCsV9Qj8wzP7F/y2R0lCAq8cyX8 28NotFlmvQB89gHi8PStMRl/jc1jqvA2t3rg9vZeNGJR7uh1eXEFw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrkedtgddukecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghsucfo ohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucfkphepje ejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghm pehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id C7BAD3060F9B; Wed, 19 Feb 2020 05:39:17 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: Declan Doherty Date: Wed, 19 Feb 2020 11:38:48 +0100 Message-Id: <20200219103848.2259134-1-thomas@monjalon.net> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] app/crypto-perf: use common macros for min/max 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" The macros RTE_MIN and RTE_MAX can be used in DPDK applications. Signed-off-by: Thomas Monjalon --- app/test-crypto-perf/cperf_test_latency.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/app/test-crypto-perf/cperf_test_latency.c b/app/test-crypto-perf/cperf_test_latency.c index 62478a2df5..0e4d0e1538 100644 --- a/app/test-crypto-perf/cperf_test_latency.c +++ b/app/test-crypto-perf/cperf_test_latency.c @@ -40,9 +40,6 @@ struct priv_op_data { struct cperf_op_result *result; }; -#define max(a, b) (a > b ? (uint64_t)a : (uint64_t)b) -#define min(a, b) (a < b ? (uint64_t)a : (uint64_t)b) - static void cperf_latency_test_free(struct cperf_latency_ctx *ctx) { @@ -254,13 +251,13 @@ cperf_latency_test_runner(void *arg) (void **)ops_processed, ops_deqd); deqd_tot += ops_deqd; - deqd_max = max(ops_deqd, deqd_max); - deqd_min = min(ops_deqd, deqd_min); + deqd_max = RTE_MAX(ops_deqd, deqd_max); + deqd_min = RTE_MIN(ops_deqd, deqd_min); } enqd_tot += ops_enqd; - enqd_max = max(ops_enqd, enqd_max); - enqd_min = min(ops_enqd, enqd_min); + enqd_max = RTE_MAX(ops_enqd, enqd_max); + enqd_min = RTE_MIN(ops_enqd, enqd_min); b_idx++; } @@ -284,15 +281,15 @@ cperf_latency_test_runner(void *arg) (void **)ops_processed, ops_deqd); deqd_tot += ops_deqd; - deqd_max = max(ops_deqd, deqd_max); - deqd_min = min(ops_deqd, deqd_min); + deqd_max = RTE_MAX(ops_deqd, deqd_max); + deqd_min = RTE_MIN(ops_deqd, deqd_min); } } for (i = 0; i < tsc_idx; i++) { tsc_val = ctx->res[i].tsc_end - ctx->res[i].tsc_start; - tsc_max = max(tsc_val, tsc_max); - tsc_min = min(tsc_val, tsc_min); + tsc_max = RTE_MAX(tsc_val, tsc_max); + tsc_min = RTE_MIN(tsc_val, tsc_min); tsc_tot += tsc_val; } -- 2.25.0