From e756964ac2595d880304f227dec7bdb424d7d974 Mon Sep 17 00:00:00 2001 From: Chunrong Guo Date: Tue, 18 Apr 2017 15:11:50 +0800 Subject: cryptodev: update to 6c2b61c **include the following changes 6c2b61c - update copyright notes f79d523 - fix: reset finish condition before test start e8f7a91 - Merge remote-tracking branch 'upstream/master' 6818263 - Fix ablkcipher algorithms usage in v4.8+ kernels 26e167f - zc: Use the power of #elif e49fe25 - adjust to API changes in kernel >=4.10 2b29be8 - adjust to API changes in kernel >=4.10 c3afb40 - add support for rsa speed tests c9b7a80 - close the session after every test ba49470 - add support for authenc(hmac(sha1), cbc(aes)) speed tests 690cd62 - Merge branch 'master' into hpe2016 5adf04e - Merge remote-tracking branch 'upstream/master' 840c7ba - remove not used variable 2dbbb23 - do more strict code checking to avoid maintenance issues 88223e4 - avoid implicit conversion between signed and unsigned char 8db6905 - use buf_align macro to reduce code duplication b6d0e0f - rename header file to clarify purpose 1fd6062 - fix warnings of "implicit declaration of function" in async_speed ff3c8ab - remove not used local variables 25a1276 - fix incorrect return code in case of error from openssl_cioccrypt e7ef4ea - Merge pull request #17 from michaelweiser/gup_flags 99c6d21 - fix ignored SIGALRM signals on some platforms 71975fa - setting KERNEL_DIR is not necessary to build tests a96ff97 - fix issues with install target 07748d3 - Merge branch 'master' into hpe2016 cc89148 - Fix ablkcipher algorithms usage in v4.8+ kernels 4d6e4fb - Merge remote-tracking branch 'upstream/master' f126e48 - Adjust to another change in the user page API 4257fce - add -async option to run_crypto_tests.sh f953164 - merge sync and async benchmarks into a single program e7af57b - add % to cpu idle for convenience 1883c95 - add a wrapper script for running all tests 998b66b - add notes about configured limits in SEC driver b1a35f3 - fix ignored SIGALRM signals on some platforms b754517 - use the same algorithm names in sync_speed as in async_speed 8baefa4 - force LC_TIME value to avoid mpstat not using ISO8601 format d0978b5 - add sync speed tests with the same format as async ones 15d890b - graceful exit if cryptodev is not built with ASYNC flags 9a595bf - fix typo, use consistent spacing 9461878 - remove output line because it does not add clarity to the results b09c17f - the C standard used by cryptodev is C90 with GNU extensions 447808d - exit early if cryptodev tests are not installed 493afd3 - fix incorrect handling of error cases... e0d2c88 - make default output tabular abc007a - really fix (again...) the mpstat issue 2696cd5 - use $(...) instead of `...` for consistency e8fb004 - fix the scale of the runtime value 119151b - remove old results to avoid incorrect reports 71ac3d5 - fix the reported unit 8c47a0c - setting KERNEL_DIR is not necessary to build tests 182b307 - fix issues with install target 5021828 - do more strict code checking to avoid maintenance issues ab239d7 - return error code of the test if there is one b5228f2 - remove not used local variables 90d67ce - avoid implicit conversion between signed and unsigned char 4b442ca - fix build warnings on implicit function declarations 2821b92 - add a little space in the output for clarity 9d0ef05 - more precision in running mpstat 0180e2b - fix some issues with parsing mpstat output 4257fce - add -async option to run_crypto_tests.sh f953164 - merge sync and async benchmarks into a single program e7af57b - add % to cpu idle for convenience 7d7a733 - sanity check on /dev/crypto availability 137c0c4 - gracefull stop for async speed tests 600eb70 - fix: set min value when allocating alligned memory buffers 18408c9 - add multithreaded wrapper for async speed test 854cc84 - rename algorithm names for clarity 216f235 - honor the -m flag in async_speed 1023ede - add flag to report in a machine friendly format 219a8b4 - enable async code by default 9def784 - Merge remote-tracking branch 'radualexe/new_tests` 149dc1c - add basic optargs support for async_speed test 9595499 - add support for crc32c hash sync speed test 83e3840 - add support for aes-256-xts sync speed test fff72ae - add support for sha2-256 hash async speed test b961800 - add support for sha1 hash async speed test fea5006 - add support for crc32c hash async speed test 8768fad - add aes-256-xts support for async speed test Signed-off-by: Chunrong Guo Signed-off-by: Otavio Salvador --- ...ultithreaded-wrapper-for-async-speed-test.patch | 173 +++++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100644 recipes-kernel/cryptodev/sdk_patches/0055-add-multithreaded-wrapper-for-async-speed-test.patch (limited to 'recipes-kernel/cryptodev/sdk_patches/0055-add-multithreaded-wrapper-for-async-speed-test.patch') diff --git a/recipes-kernel/cryptodev/sdk_patches/0055-add-multithreaded-wrapper-for-async-speed-test.patch b/recipes-kernel/cryptodev/sdk_patches/0055-add-multithreaded-wrapper-for-async-speed-test.patch new file mode 100644 index 00000000..4129010b --- /dev/null +++ b/recipes-kernel/cryptodev/sdk_patches/0055-add-multithreaded-wrapper-for-async-speed-test.patch @@ -0,0 +1,173 @@ +From 789d3c5ecda60a6dc5d5b3597047ad65c412f10d Mon Sep 17 00:00:00 2001 +From: Cristian Stoica +Date: Tue, 25 Oct 2016 15:30:59 +0300 +Subject: [PATCH 055/104] add multithreaded wrapper for async speed test + +Signed-off-by: Cristian Stoica +--- + tests/Makefile | 1 + + tests/async_speed_multi.sh | 140 +++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 141 insertions(+) + create mode 100755 tests/async_speed_multi.sh + +diff --git a/tests/Makefile b/tests/Makefile +index 683f40b..6424c11 100644 +--- a/tests/Makefile ++++ b/tests/Makefile +@@ -40,6 +40,7 @@ install: + for prog in $(hostprogs); do \ + install -m 755 $$prog $(DESTDIR)/$(bindir)/tests_cryptodev/; \ + done ++ install -m 755 async_speed_multi.sh $(DESTDIR)/$(bindir) + + clean: + rm -f *.o *~ $(hostprogs) +diff --git a/tests/async_speed_multi.sh b/tests/async_speed_multi.sh +new file mode 100755 +index 0000000..761c0cb +--- /dev/null ++++ b/tests/async_speed_multi.sh +@@ -0,0 +1,140 @@ ++#!/bin/bash ++# ++# Copyright 2016 NXP Semiconductors ++# ++# This program is free software: you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation, either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++ ++ ++# no user-configurable options below this line ++ ++NUM_CORES=`nproc` ++OUT_BASENAME="async_speed" ++MPSTAT="mpstat" ++MPSTAT_OUT="mpstat_out" ++ ++function usage ++{ ++cat << EOF ++Usage: `basename $0` [OPTIONS] ++ ++ -m number of threads to run with (defaults to number of cores) ++ -t time to run each test (default 10 secs) ++ -n size of the test buffer (default 256 bytes) ++ -h show this help ++ ++alg_name: null, aes-128-cbc, aes-256-xts, sha1, sha256, crc32c ++EOF ++} ++ ++function SUM { ++ paste -sd+ - | bc -l ++} ++ ++function get_cpu_idle ++{ ++ header_line=`grep %idle ${MPSTAT_OUT} | head -n 1 | sed 's/\s\+/ /g'` ++ idle_column=`echo $header_line | wc -w` ++ ++ all_cpu_idle=`grep all ${MPSTAT_OUT} | tail -n +2 | sed 's/\s\+/ /g' | cut -d' ' -f ${idle_column} | SUM` ++ mpstat_lines=`grep all ${MPSTAT_OUT} | tail -n +2 | wc -l` ++ ++ average_idle=`echo "scale=2; $all_cpu_idle / $mpstat_lines" | bc -l` ++ echo $average_idle ++} ++ ++function run_parallel ++{ ++ trap control_c SIGINT ++ ++ OPTIONS="-t $tvalue -n $nvalue -m" ++ CMD="async_speed $OPTIONS $alg_name" ++ ++ echo "Running $mvalue threads in parallel:" ++ echo " $CMD" ++ ++ $MPSTAT 1 $(($tvalue-1)) &> $MPSTAT_OUT & ++ MPSTAT_PID=$! ++ ++ PIDS="" ++ start=`date +%s.%N` ++ ++ for i in `seq 0 $(($mvalue-1))` ++ do ++ CMD_OUT="${OUT_BASENAME}_${i}" ++ ++ $CMD &> $CMD_OUT & ++ PID=$! ++ AFFINITY=$(($i % $NUM_CORES)) ++ taskset -pc $AFFINITY $PID > /dev/null ++ ++ PIDS="$PID $PIDS" ++ done ++ ++ wait $PIDS ++ end=`date +%s.%N` ++ ++ wait $MPSTAT_PID ++ ++ runtime=$(echo "scale=2; $end - $start" | bc -l ) ++ total_data=`cat ${OUT_BASENAME}_* | cut -f 1 | SUM` ++ avg_speed=$(echo "scale=2; $total_data / $runtime / 1000000000" | bc -l) ++ cpu_idle=`get_cpu_idle` ++ ++ echo ++ echo "buffer size : $nvalue" ++ echo "running time : $runtime" ++ echo "avg_speed : $avg_speed GiB/s" ++ echo "all_cpu idle : $cpu_idle %" ++ echo ++} ++ ++function control_c ++{ ++ killall async_speed > /dev/null ++ killall mpstat > /dev/null ++} ++ ++function main ++{ ++ while getopts hm:t:n: option ++ do ++ case "$option" in ++ m) mvalue="$OPTARG";; ++ t) tvalue="$OPTARG";; ++ n) nvalue="$OPTARG";; ++ *) usage $0; exit 1;; ++ esac ++ done ++ ++ shift $((OPTIND-1)) ++ alg_name=$1 ++ ++ [ -z "$tvalue" ] && tvalue=10 # 10 seconds per test by default ++ [ -z "$mvalue" ] && mvalue=`nproc` # thread count defaults to nproc ++ [ -z "$nvalue" ] && nvalue=256 # 256 bytes default buffer size ++ ++ case "$alg_name" in ++ "null" |\ ++ "aes-128-cbc" |\ ++ "aes-256-xts" |\ ++ "sha1" |\ ++ "sha256" |\ ++ "crc32c" ) run_parallel;; ++ * ) usage && exit 1;; ++ esac ++} ++ ++main "$@" ++ +-- +2.10.2 + -- cgit v1.2.3-54-g00ecf