From patchwork Wed Mar 13 14:54:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arkadiusz Kusztal X-Patchwork-Id: 138331 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2F45743CA0; Wed, 13 Mar 2024 15:54:58 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B7A4342E1C; Wed, 13 Mar 2024 15:54:57 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18]) by mails.dpdk.org (Postfix) with ESMTP id 79EE9406BC for ; Wed, 13 Mar 2024 15:54:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710341696; x=1741877696; h=from:to:cc:subject:date:message-id; bh=40w6pwqdaArhQlVbpFERUiXckpl3woAxUQ7hTBpdaB4=; b=LM+Pqi0sa51VtMgaovTBsS5euFqiC5bRocMBPsQf3FWlMWT/5XyTi0Pg gtUX3yRH6efNMfx14giknJOgV82qDLwOq0h6mhi6mcSsvhWYrW03c9xZJ zy2DHQ3+SArha2qkaLjNSeUA19sGpuvbiZDfiVO9XOgUTuI6bPAQdeo88 vSYbtZRbvF8SOejDzFf2Q7clA3GRDM8ZqivQVekEJws5mE6PEJ95bBDCo QsIZnAdxY12B10+vXKIMrNqyIbXkBHW4rVa1EL43dexRVgmUBLRzAFTrl U6vPw4ow/PpXuo6S0CHluW1DhgUeR1fjBuSIEsqbxHcMRozeh4PwRfNeo A==; X-IronPort-AV: E=McAfee;i="6600,9927,11011"; a="5235385" X-IronPort-AV: E=Sophos;i="6.07,122,1708416000"; d="scan'208";a="5235385" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Mar 2024 07:54:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,122,1708416000"; d="scan'208";a="11852759" Received: from silpixa00400308.ir.intel.com ([10.237.214.154]) by fmviesa009.fm.intel.com with ESMTP; 13 Mar 2024 07:54:54 -0700 From: Arkadiusz Kusztal To: dev@dpdk.org Cc: gakhil@marvell.com, ciara.power@intel.com, Arkadiusz Kusztal Subject: [PATCH] app/crypto-perf-test: fix unset crc algorithm Date: Wed, 13 Mar 2024 14:54:48 +0000 Message-Id: <20240313145448.26264-1-arkadiuszx.kusztal@intel.com> X-Mailer: git-send-email 2.17.1 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Because net crc api is not thread-safe, setting crc algorithm by the application will prevent race condition in the calc function. Race condition still may occur when any of the threads will call this function again. Function is called with the highest possible SIMD extension, which is AVX512, but if this is not found, CRC API will pick the other highest possible extension, or scalar if no SIMD available. Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test application") Signed-off-by: Arkadiusz Kusztal --- app/test-crypto-perf/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/test-crypto-perf/main.c b/app/test-crypto-perf/main.c index 40c0b4b54f..58496797d7 100644 --- a/app/test-crypto-perf/main.c +++ b/app/test-crypto-perf/main.c @@ -11,6 +11,7 @@ #include #include #include +#include #ifdef RTE_CRYPTO_SCHEDULER #include #endif @@ -599,6 +600,8 @@ main(int argc, char **argv) goto err; } + rte_net_crc_set_alg(RTE_NET_CRC_AVX512); + ret = cperf_verify_devices_capabilities(&opts, enabled_cdevs, nb_cryptodevs); if (ret) {