DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] app/crypto-perf-test: fix unset crc algorithm
@ 2024-03-13 14:54 Arkadiusz Kusztal
  2024-03-13 18:22 ` [EXTERNAL] " Akhil Goyal
  2024-03-15 10:44 ` [PATCH v2] " Arkadiusz Kusztal
  0 siblings, 2 replies; 7+ messages in thread
From: Arkadiusz Kusztal @ 2024-03-13 14:54 UTC (permalink / raw)
  To: dev; +Cc: gakhil, ciara.power, Arkadiusz Kusztal

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 <arkadiuszx.kusztal@intel.com>
---
 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 <rte_eal.h>
 #include <rte_errno.h>
 #include <rte_cryptodev.h>
+#include <rte_net_crc.h>
 #ifdef RTE_CRYPTO_SCHEDULER
 #include <rte_cryptodev_scheduler.h>
 #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) {
-- 
2.13.6


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-03-15 10:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-13 14:54 [PATCH] app/crypto-perf-test: fix unset crc algorithm Arkadiusz Kusztal
2024-03-13 18:22 ` [EXTERNAL] " Akhil Goyal
2024-03-13 22:15   ` Kusztal, ArkadiuszX
2024-03-14 12:49     ` Akhil Goyal
2024-03-15  9:56       ` Kusztal, ArkadiuszX
2024-03-15 10:44 ` [PATCH v2] " Arkadiusz Kusztal
2024-03-15 10:49   ` Power, Ciara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).