From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 0CE3B11DE for ; Thu, 16 Mar 2017 07:44:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1489646658; x=1521182658; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=2cLHGRx4Sl4D6MdQYI9Hl7DLsgcXOyYIXcKZFchaCZs=; b=IXNc1xlx8a3jnbEuI9HSMIQ8ccWc0P5DWe9xQpE7YLK9HKbdn5GiT06B jfZ0x5MOtistcw5NG5sauIZDf5CEJA==; Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Mar 2017 23:44:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,170,1486454400"; d="scan'208";a="944890596" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga003.jf.intel.com with ESMTP; 15 Mar 2017 23:44:16 -0700 Received: from fmsmsx153.amr.corp.intel.com (10.18.125.6) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 15 Mar 2017 23:44:16 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX153.amr.corp.intel.com (10.18.125.6) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 15 Mar 2017 23:44:15 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.88]) by SHSMSX104.ccr.corp.intel.com ([10.239.4.70]) with mapi id 14.03.0248.002; Thu, 16 Mar 2017 14:44:12 +0800 From: "Chen, Zhaoyan" To: "Yang, GangX" , "dts@dpdk.org" CC: "Yang, GangX" Thread-Topic: [dts] [PATCH] Add crypto performance auto test suit and test plan Thread-Index: AQHSniAmuuOr4sA+6EmIMyp8j4hgy6GXBHGg Date: Thu, 16 Mar 2017 06:44:12 +0000 Message-ID: <9DEEADBC57E43F4DA73B571777FECECA3C8307EE@shsmsx102.ccr.corp.intel.com> References: <1489646084-417205-1-git-send-email-gangx.yang@intel.com> In-Reply-To: <1489646084-417205-1-git-send-email-gangx.yang@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH] Add crypto performance auto test suit and test plan X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Mar 2017 06:44:19 -0000 Gang,=20 Please update the license date to "2016-2017". Regards, Zhaoyan Chen > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of > gangx.yang@intel.com > Sent: Thursday, March 16, 2017 2:35 PM > To: dts@dpdk.org > Cc: Yang, GangX > Subject: [dts] [PATCH] Add crypto performance auto test suit and test pla= n >=20 > From: gangyanx >=20 > - add QAT pmd performance auto test > - add AESNI_MB pmd performance auto test > - add AESNI_GCM pmd performance auto test > - add KASUMI pmd performance auto test > - add SNOW3G pmd performance auto test > - add ZUC pmd performance auto test > - add openssl pmd performance auto test > - add crypto performance test plan > --- > test_plans/crypto_perf_test_plan.rst | 310 +++++++ > tests/TestSuite_crypto_perf.py | 1484 > ++++++++++++++++++++++++++++++++++ > 2 files changed, 1794 insertions(+) > create mode 100755 test_plans/crypto_perf_test_plan.rst > create mode 100755 tests/TestSuite_crypto_perf.py >=20 > diff --git a/test_plans/crypto_perf_test_plan.rst > b/test_plans/crypto_perf_test_plan.rst > new file mode 100755 > index 0000000..7d5ee0d > --- /dev/null > +++ b/test_plans/crypto_perf_test_plan.rst > @@ -0,0 +1,310 @@ > +.. Copyright (c) 2010,2011 Intel Corporation > + All rights reserved. > + > + Redistribution and use in source and binary forms, with or without > + modification, are permitted provided that the following conditions > + are met: > + > + - Redistributions of source code must retain the above copyright > + notice, this list of conditions and the following disclaimer. > + > + - Redistributions in binary form must reproduce the above copyright > + notice, this list of conditions and the following disclaimer in > + the documentation and/or other materials provided with the > + distribution. > + > + - Neither the name of Intel Corporation nor the names of its > + contributors may be used to endorse or promote products derived > + from this software without specific prior written permission. > + > + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND > CONTRIBUTORS > + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT > NOT > + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND > FITNESS > + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE > + COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, > INDIRECT, > + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES > + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE > GOODS OR > + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN > CONTRACT, > + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) > + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF > ADVISED > + OF THE POSSIBILITY OF SUCH DAMAGE. > + > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > +Testing of Cryptodev performance in DPDK > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > + > + > +Description > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > + > +This document provides the test plan for testing Cryptodev performance b= y > +crypto perf application. The crypto perf application is a DPDK app under > +DPDK app folder. > + > +Crypto perf application supports most of Cryptodev PMDs(polling mode > dirver) > +Intel QuickAssist Technology DH895xxC/DH_C62xx hardware > +accelerator (QAT PMD), AESNI MB PMD, AESNI GCM PMD, NULL PMD, > KASUMI PMD, > +SNOW3G PMD,ZUC PMD or OPENSSL library PMD. > + > +AESNI MB PMD algorithm table > +The table below contains AESNI MB algorithms which supported in crypto > perf. > +Part of the algorithms are not supported currently. > + > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +|Algorithm| Mode | Detail = | > +| | = | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +| aes | cbc | Encrypt/Decrypt;Key size: 128, 192, 256= bits > | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +| aes | ctr | Encrypt/Decrypt;Key size: 128, 192, 256= bits > | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +| md | | md5 = | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +| sha | | sha1, sha2-224, sha2-384, sha2-256, sha= 2-512 > | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +| hmac | | Support md5 and sha implementations sha= 1, sha2-224, > sha2-256, | > +| | | sha2-384, sha2-512 = | > +| | | Key Size versus Block size support: Key= Size must be <=3D > block size; | > +| | | Mac Len Supported sha1 10, 12, 16, 20 b= ytes; > | > +| | | Mac Len Supported sha2-256 16, 24, 32 b= ytes; > | > +| | | Mac Len Supported sha2-384 24,32, 40, 4= 8 bytes; > | > +| | | Mac Len Supported sha2-512 32, 40, 48, = 56, 64 bytes; > | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > + > +QAT algorithm table: > +The table below contains QAT Algorithms which supported in crypto perf. > +Part of the algorithms are not supported currently. > + > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +|Algorithm| Mode | Detail = | > +| | = | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +| aes | cbc | Encrypt/Decrypt;Key size: 128, 192, 256= bits > | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +| aes | ctr | Encrypt/Decrypt;Key size: 128, 192, 256= bits > | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +| 3des | cbc | Encrypt/Decrypt;Key size: 128, 192 bits > | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +| 3des | ctr | Encrypt/Decrypt;Key size: 128, 192 bits > | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +| md | | md5 = | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +| sha | | sha1, sha2-224, sha2-256, sha2-384, sha= 2-512 > | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +| hmac | | Support md5 and sha implementations sha= 1, sha2-224, > sha2-256, | > +| | | sha2-384, sha2-512 = | > +| | | Key Size versus Block size support: Key= Size must be <=3D > block size; | > +| | | Mac Len Supported sha1 10, 12, 16, 20 b= ytes; > | > +| | | Mac Len Supported sha2-256 16, 24, 32 b= ytes; > | > +| | | Mac Len Supported sha2-384 24,32, 40, 4= 8 bytes; > | > +| | | Mac Len Supported sha2-512 32, 40, 48, = 56, 64 bytes; > | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +| aes | gcm | Key Sizes:128, 192, 256 bits; = | > +| | | Associated Data Length: 0 ~ 240 bytes; = | > +| | | Payload Length: 0 ~ (2^32 -1) bytes; = | > +| | | IV source: external; = | > +| | | IV Lengths: 96 bits; = | > +| | | Tag Lengths: 8, 12, 16 bytes; = | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +| kasumi | f8 | Encrypt/Decrypt; Key size: 128 = | > ++ +---------+---------+---------+----------+----------+---------= -+----------+----- > -----+----------+ > +| | f9 | Generate/Verify; Key size: 128 = | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +| snow3g | uea2 | Encrypt/Decrypt; Key size: 128 > | > ++ +---------+---------+---------+----------+----------+---------= -+----------+----- > -----+----------+ > +| | uia2 | Generate/Verify; Key size: 128 = | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > + > +AESNI_GCM algorithm table > +The table below contains AESNI GCM PMD algorithms which are supported > +in crypto perf > + > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +|Algorithm| Mode | Detail = | > +| | = | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +| aes | gcm | Encrypt/Decrypt;Key Sizes:128, 256 bits= ; > | > +| | | IV source: external; = | > +| | | IV Lengths: 96 bits; = | > +| | | Generate/Verify;Key Sizes:128,192,256 b= its; > | > +| | | Associated Data Length: 0 ~ 240 bytes; = | > +| | | Payload Length: 0 ~ (2^32 -1) bytes; = | > +| | | Tag Lengths: 8, 12, 16 bytes; = | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +| aes | gmac | Generate/Verify;Key Sizes:128,192,256 b= its; > | > +| | | Associated Data Length: 0 ~ 240 bytes; = | > +| | | Payload Length: 0 ~ (2^32 -1) bytes; = | > +| | | Tag Lengths: 8, 12, 16 bytes; = | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > + > +NULL algorithm table > +The table below contains NULL algorithms which are supported in crypto > perf. > +Part of the algorithms are not supported currently. > + > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +|Algorithm| Mode | Detail = | > +| | = | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +| null | null | Encrypt/Decrypt;Key Sizes:0 bits; = | > +| | | IV Lengths: 0 bits; = | > +| | | Generate/Verify;Key Sizes:0 bits; = | > +| | | Associated Data Length: 1 bytes; = | > +| | | Payload Length: 0 bytes; = | > +| | | Tag Lengths: 0 bytes; = | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > + > +KASUMI algorithm table > +The table below contains KASUMI algorithms which are supported in crypto > perf. > + > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +|Algorithm| Mode | Detail = | > +| | = | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +| kasumi | f8 | Encrypt/Decrypt;Key Sizes:128 bits; > | > +| | | IV source: external; = | > +| | | IV Lengths: 64 bits; = | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +| kasumi | f9 | Generate/Verify;Key Sizes:128 bits; > | > +| | | Payload Length: 64 bytes; = | > +| | | Tag Lengths: 4 bytes; = | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > + > +SNOW3G algorithm table > +The table below contains SNOW3G algorithms which are supported in > crypto perf. > + > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +|Algorithm| Mode | Detail = | > +| | = | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +| snow3g | uea2 | Encrypt/Decrypt;Key Sizes:128 bits; > | > +| | | IV source: external; = | > +| | | IV Lengths: 128 bits; = | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +| snow3g | uia2 | Generate/Verify;Key Sizes:128 bits; > | > +| | | Payload Length: 128 bytes; = | > +| | | Tag Lengths: 4 bytes; = | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > + > +ZUC algorithm table > +The table below contains ZUC algorithms which are supported in crypto pe= rf. > + > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +|Algorithm| Mode | Detail = | > +| | = | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +| zuc | eea3 | Encrypt/Decrypt;Key Sizes:128 bits; > | > +| | | IV source: external; = | > +| | | IV Lengths: 128 bits; = | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +| zuc | eia2 | Generate/Verify;Key Sizes:128 bits; > | > +| | | Payload Length: 128 bytes; = | > +| | | Tag Lengths: 4 bytes; = | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > + > +OPENSSL algorithm table: > +The table below contains OPENSSL algorithms which are supported in crypt= o > perf. > + > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +|Algorithm| Mode | Detail = | > +| | = | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +| aes | cbc | Encrypt/Decrypt;Key size: 128, 192, 256= bits > | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +| aes | ctr | Encrypt/Decrypt;Key size: 128, 192, 256= bits > | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +| 3des | cbc | Encrypt/Decrypt;Key size: 128, 192 bits > | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +| 3des | ctr | Encrypt/Decrypt;Key size: 128, 192 bits > | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +| md | | md5 = | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +| sha | | sha1, sha2-224, sha2-256, sha2-384, sha= 2-512 > | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +| hmac | | Support md5 and sha implementations sha= 1, sha2-224, > sha2-256, | > +| | | sha2-384, sha2-512 = | > +| | | Key Size versus Block size support: Key= Size must be <=3D > block size; | > +| | | Mac Len Supported sha1 10, 12, 16, 20 b= ytes; > | > +| | | Mac Len Supported sha2-256 16, 24, 32 b= ytes; > | > +| | | Mac Len Supported sha2-384 24,32, 40, 4= 8 bytes; > | > +| | | Mac Len Supported sha2-512 32, 40, 48, = 56, 64 bytes; > | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +| aes | gcm | Encrypt/Decrypt;Key Sizes:128 bits; > | > +| | | IV source: external; = | > +| | | IV Lengths: 96 bits; = | > +| | | Associated Data Length: 0 ~ 240 bytes; = | > +| | | Generate/Verify; 128, 192,256 bytes; = | > +| | | Payload Length: 64,128 bytes; = | > +| | | Tag Lengths: 16 bytes; = | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > +| aes | gmac | Generate/Verify;Key Sizes:128,192,256 b= its; > | > +| | | Associated Data Length: 0 ~ 240 bytes; = | > +| | | Payload Length: 8 ~ (2^32 -4) bytes; = | > +| | | Tag Lengths:16 bytes; = | > ++---------+---------+---------+---------+----------+----------+---------= -+----------+-- > --------+----------+ > + > + > +Prerequisites > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > +To test CryptoDev performance, an application > +test_crypto_perf is added into DPDK. > + > +The test commands of test_crypto_perf is below:: > + > + ./build/app/dpdk-test-crypto-perf -c COREMASK --vdev > (AESNI_MB|QAT|AESNI_GCM|OPENSSL|SNOW3G|KASUMI|ZUC|NULL) -w > (PCI:DEVICE:FUNCTION) -w (PCI:DEVICE:FUNCTION) -- --ptest > (throughput|latency) --devtype > (crypto_aesni_mb|crypto_qat|crypto_aes_gcm|crypto_openssl|crypto_sn > ow3g|crypto_kasumi|crypto_zuc|crypto_null) --optype (aead|cipher- > only|auth-only|cipher-then-auth|auth-then-cipher) --cipher-algo (ALGO) -= - > cipher-op (encrypt|decrypt) --cipher-key-sz (key_size) --cipher-iv-sz (iv= _size) > --auth-algo (ALGO) --auth-op (generate|verify) --auth-key-sz (key_size) -= - > auth-aad-sz (aad_size) --auth-digest-sz (digest_size) --total-ops > (ops_number) --burst-sz (burst_size) --buffer-sz (buffer_size) > + > + > + > +Test case: CryptoDev performance test > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > ++----------+ +----------+ > +| | | | > +| | --------------> | | > +| Tester | | DUT | > +| | | | > +| | <-------------> | | > ++----------+ +----------+ > + > +common:: > + > + --vdev > (AESNI_MB|QAT|AESNI_GCM|OPENSSL|SNOW3G|KASUMI|ZUC|NULL) > this value can be set as : crypto_aesni_mb_pmd, crypto_aes_gcm_pmd, > crypto_openssl_pmd, crypto_snow3g_pmd, crypto_kasumi_pmd, > crypto_zuc_pmd or crypto_null_pmd . if pmd is QAT this parameter should > not be set > + > + -w (PCI:DEVICE:FUNCTION) this value is the port whitelist or QAT device > whitelist . if vdev is set and devtype is not crypto_qat , the QAT devic= e > whitelist is not needed , but you also can set it on the cmd line . > + > + --optype (aead|cipher-only|auth-only|cipher-then-auth|auth-then- > cipher): if cipher-algo is aes-gcm or gmac this value must be set to aead= . > otherwise it will be set to others. please notice , null algorithm only = support > cipher-only test. > + > + other parameters please reference above table's parameter . > + > +QAT PMD Commmand line Eg:: > + > + ./build/app/dpdk-test-crypto-perf -c 0xf -w 0000:01:00.0 -w 0000:03= :3d.0 > -- --ptest throughput --devtype crypto_qat --optype cipher-then-auth -- > cipher-algo aes-cbc --cipher-op encrypt --cipher-key-sz 16 --cipher-iv-sz= 16 -- > auth-algo sha1-hmac --auth-op generate --auth-key-sz 64 --auth-aad-sz 0 -= - > auth-digest-sz 20 --total-ops 10000000 --burst-sz 32 --buffer-sz 1024 > + > +AESNI_MB PMD Commmand line Eg:: > + > + ./build/app/dpdk-test-crypto-perf -c 0xf --vdev crypto_aesni_mb_pmd = - > w 0000:01:00.0 -w 0000:03:3d.0 -- --ptest throughput --devtype > crypto_aesni_mb --optype cipher-then-auth --cipher-algo aes-cbc --cipher= - > op encrypt --cipher-key-sz 16 --cipher-iv-sz 16 --auth-algo sha1-hmac --a= uth- > op generate --auth-key-sz 64 --auth-aad-sz 0 --auth-digest-sz 20 --total-= ops > 10000000 --burst-sz 32 --buffer-sz 1024 > + > +AESNI_GCM PMD Commmand line Eg:: > + > + ./build/app/dpdk-test-crypto-perf -c 0xf --vdev crypto_aesni_gcm_pmd > -w 0000:01:00.0 -w 0000:03:3d.0 -- --ptest throughput --devtype > crypto_aesni_gcm --optype aead --cipher-algo aes-gcm --cipher-op encryp= t > --cipher-key-sz 16 --cipher-iv-sz 12 --auth-algo aes-gcm --auth-op genera= te -- > auth-key-sz 16 --auth-aad-sz 4 --auth-digest-sz 12 --total-ops 10000000 -= - > burst-sz 32 --buffer-sz 1024 > + > +OPENSSL PMD Commmand line Eg:: > + > + ./build/app/dpdk-test-crypto-perf -c 0xf --vdev crypto_openssl_pmd = -w > 0000:01:00.0 -w 0000:03:3d.0 -- --ptest throughput --devtype crypto_opens= sl > --optype cipher-then-auth --cipher-algo aes-cbc --cipher-op encrypt -- > cipher-key-sz 16 --cipher-iv-sz 16 --auth-algo sha1-hmac --auth-op genera= te - > -auth-key-sz 64 --auth-aad-sz 0 --auth-digest-sz 20 --total-ops 10000000 = -- > burst-sz 32 --buffer-sz 64 > + > +NULL PMD Commmand line Eg:: > + > + ./build/app/dpdk-test-crypto-perf -c 0xf --vdev crypto_null_pmd -w > 0000:01:00.0 -w 0000:03:3d.0 -- --ptest throughput --devtype crypto_null = -- > optype cipher-only --cipher-algo null --cipher-op encrypt --cipher-key-s= z 0 -- > cipher-iv-sz 0 --total-ops 10000000 --burst-sz 32 --buffer-sz 1024 > + > +KASUMI PMD Commmand line Eg:: > + > + ./build/app/dpdk-test-crypto-perf -c 0xf --vdev crypto_kasumi_pmd -= w > 0000:01:00.0 -w 0000:03:3d.0 -- --ptest throughput --devtype crypto_kasum= i - > -optype cipher-then-auth --cipher-algo kasumi-f8 --cipher-op encrypt -- > cipher-key-sz 16 --cipher-iv-sz 8 --auth-algo kasumi-f9 --auth-op generat= e -- > auth-key-sz 16 --auth-aad-sz 8 --auth-digest-sz 4 --total-ops 10000000 -- > burst-sz 32 --buffer-sz 1024 > + > +SNOW3G PMD Commmand line Eg:: > + > + ./build/app/dpdk-test-crypto-perf -c 0xf --vdev crypto_snow3g_pmd -= w > 0000:01:00.0 -w 0000:03:3d.0 -- --ptest throughput --devtype crypto_snow3= g > --optype cipher-then-auth --cipher-algo snow3g-uea2 --cipher-op encrypt = -- > cipher-key-sz 16 --cipher-iv-sz 16 --auth-algo snow3g-uia2 --auth-op > generate --auth-key-sz 16 --auth-aad-sz 16 --auth-digest-sz 4 --total-ops > 10000000 --burst-sz 32 --buffer-sz 1024 > + > +ZUC PMD Commmand line Eg:: > + > + ./build/app/dpdk-test-crypto-perf -c 0xf --vdev crypto_zuc_pmd -w > 0000:01:00.0 -w 0000:03:3d.0 -- --ptest throughput --devtype crypto_zuc_m= b > --optype cipher-then-auth --cipher-algo zuc-eea3 --cipher-op encrypt -- > cipher-key-sz 16 --cipher-iv-sz 16 --auth-algo zuc-eia3 --auth-op genera= te -- > auth-key-sz 16 --auth-aad-sz 16 --auth-digest-sz 4 --total-ops 10000000 -= - > burst-sz 32 --buffer-sz 1024 > + > + > diff --git a/tests/TestSuite_crypto_perf.py b/tests/TestSuite_crypto_perf= .py > new file mode 100755 > index 0000000..b9e3a7c > --- /dev/null > +++ b/tests/TestSuite_crypto_perf.py > @@ -0,0 +1,1484 @@ > +# BSD LICENSE > +# > +# Copyright(c) 2010-2014 Intel Corporation. All rights reserved. > +# All rights reserved. > +# > +# Redistribution and use in source and binary forms, with or without > +# modification, are permitted provided that the following conditions > +# are met: > +# > +# * Redistributions of source code must retain the above copyright > +# notice, this list of conditions and the following disclaimer. > +# * Redistributions in binary form must reproduce the above copyright > +# notice, this list of conditions and the following disclaimer in > +# the documentation and/or other materials provided with the > +# distribution. > +# * Neither the name of Intel Corporation nor the names of its > +# contributors may be used to endorse or promote products derived > +# from this software without specific prior written permission. > +# > +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND > CONTRIBUTORS > +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT > NOT > +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND > FITNESS FOR > +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE > COPYRIGHT > +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, > INCIDENTAL, > +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT > NOT > +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS > OF USE, > +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED > AND ON ANY > +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF > THE USE > +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH > DAMAGE. > + > +import hmac > +import hashlib > +import binascii > +import time > +import os > +import sys > +import dts > +import utils > +import commands > +import copy > +import time > +import random > +from test_case import TestCase > + > + > +class TestCryptoPerf(TestCase): > + > + def set_up_all(self): > + > + self.filename =3D "" > + self.__LTCY =3D "" > + self.__THPT =3D "" > + self.qat_wilte_list =3D [] > + self.total_buffer_list =3D [] > + self.waiting_to_coll_buf =3D [] > + > + self.core_config =3D "1S/2C/1T" > + self.number_of_ports =3D 1 > + self.dut_ports =3D self.dut.get_ports(self.nic) > + self.verify(len(self.dut_ports) >=3D self.number_of_ports, > + "Not enough ports for " + self.nic) > + self.ports_socket =3D self.dut.get_numa_id(self.dut_ports[0]) > + > + self.logger.info("core config =3D " + self.core_config) > + self.logger.info("number of ports =3D " + str(self.number_of_por= ts)) > + self.logger.info("dut ports =3D " + str(self.dut_ports)) > + self.logger.info("ports_socket =3D " + str(self.ports_socket)) > + > + self.core_mask =3D utils.create_mask(self.dut.get_core_list( > + self.core_config, > + socket=3Dself.ports_socket)) > + self.port_mask =3D utils.create_mask([self.dut_ports[0]]) > + > + self.tx_port =3D self.tester.get_local_port(self.dut_ports[0]) > + self.rx_port =3D self.tester.get_local_port(self.dut_ports[0]) > + > + self.tx_interface =3D self.tester.get_interface(self.tx_port) > + self.rx_interface =3D self.tester.get_interface(self.rx_port) > + > + self.logger.info("core mask =3D " + self.core_mask) > + self.logger.info("port mask =3D " + self.port_mask) > + self.logger.info("tx interface =3D " + self.tx_interface) > + self.logger.info("rx interface =3D " + self.rx_interface) > + > + # Rebuild the dpdk with cryptodev pmds > CONFIG_RTE_LIBRTE_PMD_ZUC=3Dn > + self.dut.send_expect("export > AESNI_MULTI_BUFFER_LIB_PATH=3D/root/ipsec_044/code/", "#") > + self.dut.send_expect("export > LIBSSO_SNOW3G_PATH=3D/root/libsso_snow3g/snow3g/", "#") > + self.dut.send_expect("export > LIBSSO_ZUC_PATH=3D/root/libsso_zuc.1.0.1.1-8/zuc", "#") > + self.dut.send_expect("export > LIBSSO_KASUMI_PATH=3D/root/LibSSO_0_3_1/isg_cid- > wireless_libs/ciphers/kasumi/", "#") > + self.dut.send_expect("sed -i > 's/CONFIG_RTE_LIBRTE_PMD_QAT=3Dn$/CONFIG_RTE_LIBRTE_PMD_QAT=3Dy/' > config/common_base", "# ") > + self.dut.send_expect("sed -i > 's/CONFIG_RTE_LIBRTE_PMD_AESNI_GCM=3Dn$/CONFIG_RTE_LIBRTE_PMD_ > AESNI_GCM=3Dy/' config/common_base", "# ") > + self.dut.send_expect("sed -i > 's/CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO=3Dn$/CONFIG_RTE_LIBRTE_PMD > _NULL_CRYPTO=3Dy/' config/common_base", "# ") > + self.dut.send_expect("sed -i > 's/CONFIG_RTE_LIBRTE_PMD_SNOW3G=3Dn$/CONFIG_RTE_LIBRTE_PMD_SN > OW3G=3Dy/' config/common_base", "# ") > + self.dut.send_expect("sed -i > 's/CONFIG_RTE_LIBRTE_PMD_KASUMI=3Dn$/CONFIG_RTE_LIBRTE_PMD_KAS > UMI=3Dy/' config/common_base", "# ") > + self.dut.send_expect("sed -i > 's/CONFIG_RTE_LIBRTE_PMD_OPENSSL=3Dn$/CONFIG_RTE_LIBRTE_PMD_OPE > NSSL=3Dy/' config/common_base", "# ") > + self.dut.send_expect("sed -i > 's/CONFIG_RTE_LIBRTE_PMD_AESNI_MB=3Dn$/CONFIG_RTE_LIBRTE_PMD_A > ESNI_MB=3Dy/' config/common_base", "# ") > + self.dut.send_expect("sed -i > 's/CONFIG_RTE_LIBRTE_PMD_ZUC=3Dn$/CONFIG_RTE_LIBRTE_PMD_ZUC=3Dy/' > config/common_base", "# ") > + self.dut.skip_setup =3D False > + self.dut.build_install_dpdk(self.dut.target) > + > + # test-crypto-perf compile > + out =3D self.dut.build_dpdk_apps("./app/test-crypto-perf") > + > + # Bind QAT VF devices > + out =3D self.dut.send_expect("lspci -d:37c9|awk '{print $1}'", "= # ", 10) > + self.dut.send_expect('echo "8086 37c9" > > /sys/bus/pci/drivers/igb_uio/new_id', "# ", 10) > + for line in out.replace("\r", "\n").replace("\n\n", "\n").split(= "\n"): > + cmd =3D "echo 0000:{} > > /sys/bus/pci/devices/0000\:{}/driver/unbind".format(line, line.replace(":= ", > "\:")) > + qat_device =3D "0000:{}".format(line, line.replace(":", "\:"= )) > + self.qat_wilte_list.append(qat_device) > + self.dut.send_expect(cmd, "# ", 10) > + cmd =3D "echo 0000:{} > /sys/bus/pci/drivers/igb_uio/bind".f= ormat(line) > + self.dut.send_expect(cmd, "# ", 10) > + self.__check_buffer_size_number() > + > + def set_up(self): > + pass > + > + def test_qat_AES_CBC_perf(self): > + result =3D True > + self.logger.info("Test qat_c_AES_CBC_Perf") > + result =3D self.__execute_crypto_perf_test( > + test_vectors, "qat_c_AES_CBC_Perf") > + self.verify(result, True) > + > + def test_qat_AES_CTR_perf(self): > + result =3D True > + self.logger.info("Test qat_c_AES_CTR_Perf") > + result =3D self.__execute_crypto_perf_test( > + test_vectors, "qat_c_AES_CTR_Perf") > + self.verify(result, True) > + > + def test_qat_AES_GCM_perf(self): > + result =3D True > + self.logger.info("Test qat_c_AES_GCM_Perf") > + result =3D self.__execute_crypto_perf_test( > + test_vectors, "qat_c_AES_GCM_Perf") > + self.verify(result, True) > + > + def test_qat_3DES_CBC_perf(self): > + result =3D True > + self.logger.info("Test qat_c_3DES_CTR_Perf") > + result =3D self.__execute_crypto_perf_test( > + test_vectors, "qat_c_3DES_CTR_Perf") > + self.verify(result, True) > + > + def test_qat_3DES_CTR_perf(self): > + result =3D True > + self.logger.info("Test qat_c_3DES_CBC_Perf") > + result =3D self.__execute_crypto_perf_test( > + test_vectors, "qat_c_3DES_CBC_Perf") > + self.verify(result, True) > + > + def test_qat_KASUMI_perf(self): > + result =3D True > + self.logger.info("Test qat_c_KASUMMI_Perf") > + result =3D self.__execute_crypto_perf_test( > + test_vectors, "qat_c_KASUMMI_Perf") > + self.verify(result, True) > + > + def test_qat_SNOW3G_perf(self): > + result =3D True > + self.logger.info("Test qat_c_SNOW3G_Perf") > + result =3D self.__execute_crypto_perf_test( > + test_vectors, "qat_c_SNOW3G_Perf") > + self.verify(result, True) > + > + def test_qat_HASH_perf(self): > + result =3D True > + self.logger.info("Test qat_h_auto_Perf") > + result =3D self.__execute_crypto_perf_test( > + test_vectors, "qat_h_auto_Perf") > + self.verify(result, True) > + > + def test_qat_NULL_perf(self): > + result =3D True > + self.logger.info("Test qat_NULL_auto_Perf") > + result =3D self.__execute_crypto_perf_test( > + test_vectors, "qat_NULL_auto_Perf") > + self.verify(result, True) > + > + def test_aesni_mb_AES_CBC_perf(self): > + result =3D True > + self.logger.info("Test aesni_mb_c_AES_CBC_Perf") > + result =3D self.__execute_crypto_perf_test( > + test_vectors, "aesni_mb_c_AES_CBC_Perf") > + self.verify(result, True) > + > + def test_aesni_mb_AES_CTR_perf(self): > + result =3D True > + self.logger.info("Test aesni_mb_c_AES_CTR_Perf") > + result =3D self.__execute_crypto_perf_test( > + test_vectors, "aesni_mb_c_AES_CTR_Perf") > + self.verify(result, True) > + > + def test_aesni_mb_HASH_perf(self): > + result =3D True > + self.logger.info("Test aesni_mb_h_auto_Perf") > + result =3D self.__execute_crypto_perf_test( > + test_vectors, "aesni_mb_h_auto_Perf") > + self.verify(result, True) > + > + def test_aesni_gcm_AES_GCM_perf(self): > + result =3D True > + self.logger.info("Test aes_gcm_c_AES_GCM_Perf") > + result =3D self.__execute_crypto_perf_test( > + test_vectors, "aes_gcm_c_AES_GCM_Perf") > + self.verify(result, True) > + > + def test_kasumi_KASUMI_perf(self): > + result =3D True > + self.logger.info("Test kasumi_KASUMI_auto_Perf") > + result =3D self.__execute_crypto_perf_test( > + test_vectors, "kasumi_KASUMI_auto_Perf") > + self.verify(result, True) > + > + def test_snow3g_SNOW3G_perf(self): > + result =3D True > + self.logger.info("Test snow3g_SNOW3G_auto_Perf") > + result =3D self.__execute_crypto_perf_test( > + test_vectors, "snow3g_SNOW3G_auto_Perf") > + self.verify(result, True) > + > + def test_zuc_ZUC_perf(self): > + result =3D True > + self.logger.info("Test zuc_ZUC_auto_Perf") > + result =3D self.__execute_crypto_perf_test( > + test_vectors, "zuc_ZUC_auto_Perf") > + self.verify(result, True) > + > + def test_null_NULL_perf(self): > + result =3D True > + self.logger.info("Test null_NULL_auto_Perf") > + result =3D self.__execute_crypto_perf_test( > + test_vectors, "null_NULL_auto_Perf") > + self.verify(result, True) > + > + def test_openssl_AES_CBC_perf(self): > + result =3D True > + self.logger.info("Test openssl_c_AES_CBC_Perf") > + result =3D self.__execute_crypto_perf_test( > + test_vectors, "openssl_c_AES_CBC_Perf") > + self.verify(result, True) > + > + def test_openssl_AES_CTR_perf(self): > + result =3D True > + self.logger.info("Test openssl_c_AES_CTR_Perf") > + result =3D self.__execute_crypto_perf_test( > + test_vectors, "openssl_c_AES_CTR_Perf") > + self.verify(result, True) > + > + def test_openssl_AES_GCM_perf(self): > + result =3D True > + self.logger.info("Test openssl_c_AES_GCM_Perf") > + result =3D self.__execute_crypto_perf_test( > + test_vectors, "openssl_c_AES_GCM_Perf") > + self.verify(result, True) > + > + def test_openssl_3DES_CBC_perf(self): > + result =3D True > + self.logger.info("Test openssl_c_3DES_CBC_Perf") > + result =3D self.__execute_crypto_perf_test( > + test_vectors, "openssl_c_3DES_CBC_Perf") > + self.verify(result, True) > + > + def test_openssl_3DES_CTR_perf(self): > + result =3D True > + self.logger.info("Test openssl_c_3DES_CTR_Perf") > + result =3D self.__execute_crypto_perf_test( > + test_vectors, "openssl_c_3DES_CTR_Perf") > + self.verify(result, True) > + > + def test_openssl_HASH_perf(self): > + result =3D True > + self.logger.info("Test openssl_h_HASH_auto_Perf") > + result =3D self.__execute_crypto_perf_test( > + test_vectors, "openssl_h_HASH_auto_Perf") > + self.verify(result, True) > + > + def test_calculatr_case_number(self): > + > + self.__calculate_totall_cases_numb() > + > + def __execute_crypto_perf_test(self, test_vectors, test_vector_name)= : > + failed_count =3D 0 > + result =3D True > + > + if test_vector_name not in test_vectors: > + self.logger.warn("SKIP : " + test_vector_name) > + return True > + > + test_vector =3D test_vectors[test_vector_name] > + > + test_vector_list =3D self.__test_vector_to_vector_list(test_vect= or, > + core_mask= =3Dself.core_mask, > + port_mask= =3Dself.port_mask) > + > + currently_time =3D time.strftime('%Y-%m-%d %H:%M:%S', > time.localtime(time.time())) > + case_line =3D "<<<[{time}][{name}] Total Generated: [{num}] > Cases>>>\n".format( > + time=3Dcurrently_time, name=3Dtest_vector_name, > num=3Dlen(test_vector_list)) > + self.logger.info(case_line) > + > + for test_vector in test_vector_list: > + self.logger.debug(test_vector) > + cmd_str =3D self.__test_vector_to_cmd(test_vector, > + core_mask=3Dself.core_ma= sk, > + port_mask=3Dself.port_ma= sk) > + out =3D self.dut.send_expect(cmd_str, "]# ", 600) > + self.logger.info("Test Result:\n*********************\n > {ret}".format(ret=3Dout)) > + ret =3D self.__result_collection(out, test_vector) > + if ret is False: > + failed_count =3D failed_count + 1 > + result =3D result and ret > + self.logger.info(("[{name}] Total Failed cases: [{num}]\n".forma= t( > + name=3Dtest_vector_name, num=3Dfailed_count)= )) > + return result > + > + def tear_down(self): > + pass > + > + def tear_down_all(self): > + f =3D open(self.filename, "a") > + currently_time =3D time.strftime('%Y-%m-%d %H:%M:%S', > time.localtime(time.time())) > + f.write("...Test Finished [{time}]...".format(time=3Dcurrently_t= ime)) > + self.dut.send_expect("sed -i > 's/CONFIG_RTE_LIBRTE_PMD_QAT=3Dy$/CONFIG_RTE_LIBRTE_PMD_QAT=3Dn/' > config/common_base", "# ") > + self.dut.send_expect("sed -i > 's/CONFIG_RTE_LIBRTE_PMD_AESNI_GCM=3Dy$/CONFIG_RTE_LIBRTE_PMD_ > AESNI_GCM=3Dn/' config/common_base", "# ") > + self.dut.send_expect("sed -i > 's/CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO=3Dy$/CONFIG_RTE_LIBRTE_PMD > _NULL_CRYPTO=3Dn/' config/common_base", "# ") > + self.dut.send_expect("sed -i > 's/CONFIG_RTE_LIBRTE_PMD_SNOW3G=3Dy$/CONFIG_RTE_LIBRTE_PMD_SN > OW3G=3Dn/' config/common_base", "# ") > + self.dut.send_expect("sed -i > 's/CONFIG_RTE_LIBRTE_PMD_KASUMI=3Dy$/CONFIG_RTE_LIBRTE_PMD_KAS > UMI=3Dn/' config/common_base", "# ") > + self.dut.send_expect("sed -i > 's/CONFIG_RTE_LIBRTE_PMD_OPENSSL=3Dy$/CONFIG_RTE_LIBRTE_PMD_OPE > NSSL=3Dn/' config/common_base", "# ") > + self.dut.send_expect("sed -i > 's/CONFIG_RTE_LIBRTE_PMD_AESNI_MB=3Dy$/CONFIG_RTE_LIBRTE_PMD_A > ESNI_MB=3Dn/' config/common_base", "# ") > + self.dut.send_expect("sed -i > 's/CONFIG_RTE_LIBRTE_PMD_ZUC=3Dy$/CONFIG_RTE_LIBRTE_PMD_ZUC=3Dn/' > config/common_base", "# ") > + f.close() > + > + def __check_buffer_size_number(self): > + buf_numb =3D 0 > + buf_list =3D [] > + for vector_name in test_vectors: > + temp_numb =3D 0 > + temp_list =3D [] > + vector =3D test_vectors[vector_name] > + if vector["buffer-sz"] !=3D "": > + if vector["buffer-sz"].find(",") !=3D -1: > + buf =3D vector["buffer-sz"].split(",") > + temp_list =3D copy.deepcopy(buf) > + temp_numb =3D len(buf) > + elif vector["buffer-sz"].find(":") !=3D -1: > + buf =3D vector["buffer-sz"].split(":") > + if len(buf) !=3D 3: > + self.logger.info("buffer-sz format is invalid") > + else: > + temp =3D buf[0] > + while temp <=3D buf[2]: > + temp_list.append(temp) > + temp_numb =3D temp_numb + 1 > + temp =3D temp + buf[1] > + else: > + temp_numb =3D 1 > + if temp_numb > buf_numb: > + buf_numb =3D temp_numb > + buf_list =3D copy.deepcopy(temp_list) > + > + head =3D > "PMD,chain,ptest,cipher_algo,cipher_op,cipher_key,iv,auth_algo,auth_op,a > uth_key,aad,digest," > + self.__LTCY =3D head > + self.__THPT =3D head > + self.total_buffer_list =3D copy.deepcopy(buf_list) > + for buf_sz in buf_list: > + self.__LTCY =3D self.__LTCY + "buf{buffer} Ltcy(us),buf{buff= er} > Cyc,".format(buffer=3Dbuf_sz) > + self.__THPT =3D self.__THPT + "buf{buffer} Thpt(Gbps),buf{bu= ffer} > Ops,".format(buffer=3Dbuf_sz) > + self.__LTCY =3D self.__LTCY[:len(self.__LTCY) - 1] + "\n" > + self.__THPT =3D self.__THPT[:len(self.__THPT) - 1] + "\n" > + > + str_pid =3D str(os.getpid()) > + self.filename =3D "/tmp/test_crypto_perf_{0}.csv".format(time.ti= me()) > + f =3D open(self.filename, "a") > + if f is None: > + self.logger.info("open scv file failed.") > + return > + > + current_time =3D time.strftime('%Y-%m-%d %H:%M:%S', > time.localtime(time.time())) > + f.write("...Test Start [{time}]...\n".format(time=3Dcurrent_time= )) > + f.write(self.__THPT) > + f.write(self.__LTCY) > + f.close() > + > + def __calculate_totall_cases_numb(self): > + alg_map =3D {} > + pmd_map =3D {} > + map_combine =3D {} > + count =3D 0 > + alg =3D "" > + pmd =3D "" > + alg_list =3D ["AES_CBC", "AES_CTR", "AES_GCM", "3DES_CBC", > + "3DES_CTR", "SNOW3G", "KASUMI", "ZUC", "NULL", "MD_S= HA"] > + pmd_list =3D ["qat", "aesni_mb", "aesni_gcm", "snow3g", > + "kasumi", "zuc", "openssl", "null"] > + valid_map =3D { > + "qat": ["AES_CBC", "AES_CTR", "AES_GCM", "3DES_CBC", > + "3DES_CTR", "SNOW3G", "KASUMI", "NULL", "MD_= SHA"], > + "aesni_mb": ["AES_CBC", "AES_CTR"], > + "aesni_gcm": ["AES_GCM"], > + "snow3g": ["SNOW3G"], > + "kasumi": ["KASUMI"], > + "zuc": ["ZUC"], > + "openssl": ["AES_CBC", "AES_CTR", "AES_GCM", "3DES_C= BC", > "3DES_CTR", "MD_SHA"], > + "null": ["NULL"] > + } > + > + for index, value in test_vectors.iteritems(): > + test_vector_list =3D self.__test_vector_to_vector_list(value= , > + core_ma= sk=3D"-1", > + port_ma= sk=3Dself.port_mask) > + count =3D count + len(test_vector_list) > + for i in alg_list: > + if (index.upper()).find(i) !=3D -1: > + alg =3D i > + if i in alg_map: > + alg_map[i] +=3D len(test_vector_list) > + else: > + alg_map[i] =3D len(test_vector_list) > + for j in pmd_list: > + if (index).find(j) !=3D -1: > + pmd =3D j > + if j in pmd_map: > + pmd_map[j] +=3D len(test_vector_list) > + else: > + pmd_map[j] =3D len(test_vector_list) > + if (pmd !=3D "") and (alg in valid_map[pmd]): > + temp_str =3D pmd + "_" + alg > + if temp_str in map_combine: > + map_combine[temp_str] +=3D len(test_vector_list) > + else: > + map_combine[temp_str] =3D len(test_vector_list) > + for k, v in alg_map.iteritems(): > + self.logger.info("Total {name} cases:\t\t\t{number}".format(= name=3Dk, > number=3Dv)) > + for k, v in pmd_map.iteritems(): > + self.logger.info("Total {name} cases:\t\t\t{number}".format(= name=3Dk, > number=3Dv)) > + for k, v in map_combine.iteritems(): > + self.logger.info("Total {name} cases:\t\t\t{number}".format(= name=3Dk, > number=3Dv)) > + self.logger.info("Total cases:\t\t\t {0}".format(count)) > + > + def __parse_througuput_data(self, original_out): > + throughPut_line =3D "" > + count =3D 0 > + data_finished =3D False > + index =3D original_out.find("# lcore id") > + if index =3D=3D -1: > + seg_index =3D original_out.find("Segmentation fault") > + throughPut_line =3D "sgtf,sgtf" if seg_index !=3D -1 else "o= tf,otf" > + else: > + value_data =3D (original_out[index:]).replace("\r", "") > + value_list =3D (value_data.replace("\n\n", "\n")).split("\n"= ) > + temp_list =3D filter(lambda x: (x.find("lcore id") =3D=3D -1= ) and (x !=3D ""), > value_list) > + length =3D len(temp_list) > + for data_list in temp_list: > + count =3D count + 1 > + value_data_list =3D (data_list).split(";") > + if length =3D=3D count: > + data_finished =3D True > + throughPut_line =3D throughPut_line + > self.__buffer_size_result_check( > + value_data_list[1], value_dat= a_list[8], > + value_data_list[7], data_fini= shed) > + throughPut_line =3D throughPut_line + "\n" > + return throughPut_line > + > + def __parse_latency_data(self, original_out): > + latency =3D "" > + count =3D 0 > + data_finished =3D False > + index =3D original_out.find("# lcore") > + if index =3D=3D -1: > + seg_index =3D original_out.find("Segmentation fault") > + latency =3D "sgtf,sgtf" if seg_index !=3D -1 else "otf,otf" > + else: > + value_data =3D (original_out[index:]).replace("\r", "") > + value_list =3D (value_data.replace("\r", "")).split("\n") > + temp_list =3D filter(lambda x: (x.find("lcore") =3D=3D -1) a= nd (x !=3D ""), > value_list) > + length =3D len(temp_list) > + for data_list in temp_list: > + count =3D count + 1 > + value_data_list =3D data_list.split(";") > + if length =3D=3D count: > + data_finished =3D True > + latency =3D latency + self.__buffer_size_result_check( > + value_data_list[1], value_data_l= ist[5], > + value_data_list[4], data_finishe= d) > + latency =3D latency + "\n" > + return latency > + > + def __buffer_size_result_check(self, buf_size, thpt_ltcy, ops_cycl, > finished): > + count =3D 0 > + result =3D "" > + buffer_sz =3D copy.deepcopy(self.total_buffer_list) > + > + for buf in self.waiting_to_coll_buf: > + if int(buf_size) > int(buf): > + count =3D count + 1 > + result =3D result + "*,*," > + elif int(buf_size) =3D=3D int(buf): > + count =3D count + 1 > + self.waiting_to_coll_buf =3D self.waiting_to_coll_buf[co= unt:] > + result =3D result + "{throughput_latenct},{ops_cycle},".= format( > + buffer=3Dbuf_size, throughput_latenct=3Dthp= t_ltcy, > ops_cycle=3Dops_cycl) > + else: > + if finished is True: > + result =3D result + "*,*," > + else: > + break > + return result > + > + def __parse_dut_out_data(self, original_out, test_vector): > + perf_data_collect =3D "" > + if test_vector["ptest"] =3D=3D "latency": > + perf_data_collect =3D self.__parse_latency_data(original_out= ) > + else: > + perf_data_collect =3D self.__parse_througuput_data(original_= out) > + > + return perf_data_collect > + > + def __valid_data_write_line(self, test_vector): > + iv =3D "{IV}".format(IV=3Dtest_vector["cipher-iv-sz"]) if test_v= ector["cipher- > iv-sz"] !=3D "" else "/" > + aad =3D "{Aad}".format(Aad=3Dtest_vector["auth-aad-sz"]) if > test_vector["auth-aad-sz"] !=3D "" else "/" > + ptest =3D (test_vector["ptest"]).upper() > + optype =3D test_vector["optype"] > + digest =3D "{dgst}".format(dgst=3Dtest_vector["auth-digest-sz"])= if > test_vector["auth-digest-sz"] !=3D "" else "/" > + auth_op =3D (test_vector["auth-op"]).capitalize() if test_vector= ["auth- > op"] !=3D "" else "/" > + devtype =3D ((test_vector["devtype"]).replace("crypto_", "")).up= per() > + auth_key =3D "{key}".format(key=3Dtest_vector["auth-key-sz"]) if > test_vector["auth-key-sz"] !=3D "" else "/" > + cipher_op =3D (test_vector["cipher-op"]).capitalize() if > test_vector["cipher-op"] !=3D "" else "-" > + auth_algo =3D ((test_vector["auth-algo"]).replace("-", "_")).upp= er() if > test_vector["auth-algo"] !=3D "" else "/" > + cipher_key =3D "{key}".format(key=3Dtest_vector["cipher-key-sz"]= ) if > test_vector["cipher-key-sz"] !=3D "" else "/" > + cipher_algo =3D ((test_vector["cipher-algo"]).replace("-", "_"))= .upper() if > test_vector["cipher-algo"] !=3D "" else "/" > + > + if optype.find("only") !=3D -1: > + chain =3D (optype.replace("-", "_")).upper() > + else: > + chain =3D ((optype.replace("-then-", "_")).replace("auth", > "hash")).upper() > + > + w_line =3D > "{pmd},{Chain},{test_type},{cAlg},{cop},{cKey},{IV},{hAlg},{hop},{hkey},{= Aad > },{dgst},".format( > + pmd=3Ddevtype, Chain=3Dchain, test_type=3Dptest, cAlg=3D= cipher_algo, > cop=3Dcipher_op, cKey=3Dcipher_key, IV=3Div, > + hAlg=3Dauth_algo, hop=3Dauth_op, hkey=3Dauth_key, Aad=3D= aad, > dgst=3Ddigest) > + > + return w_line > + > + def __result_collection(self, original_out, test_vector): > + result =3D True > + perf_line =3D "" > + f =3D open(self.filename, "a") > + if f is None: > + logger.info("open scv file failed.") > + return > + self.waiting_to_coll_buf =3D copy.deepcopy(self.total_buffer_lis= t) > + perf_line =3D self.__valid_data_write_line(test_vector) + > self.__parse_dut_out_data(original_out, test_vector) > + f.write(perf_line) > + > + if (perf_line.find("sgtf") !=3D -1) or (perf_line.find("otf") != =3D -1): > + result =3D False > + return result > + > + def __test_vector_to_cmd(self, test_vector, core_mask=3D"", > port_mask=3D""): > + TEST_CRYPTO_PERF =3D "./app/test-crypto-perf/build/app/dpdk-test= - > crypto-perf" > + EAL_CORE_MASK =3D " -cf" if core_mask =3D=3D "" else " -c" + cor= e_mask > + EAL_SEP =3D " --" > + QUEUE_NUM =3D " " > + CSV_FRIENDLY =3D " --csv-friendly" > + > + # port info > + pci_bus =3D "" > + for port in self.dut.ports_info: > + pci_bus =3D " -w " + port['pci'] > + > + qat_bus =3D "" > + if len(self.qat_wilte_list) > 0: > + qat_bus =3D " -w " + self.qat_wilte_list[random.randint(0, > len(self.qat_wilte_list) - 1)] > + > + vdev =3D "" > + if self.__check_field_in_vector(test_vector, "vdev"): > + vdev =3D " --vdev " + test_vector["vdev"] > + > + ptest =3D "" > + if self.__check_field_in_vector(test_vector, "ptest"): > + ptest =3D " --ptest " + test_vector["ptest"] > + > + devtype =3D "" > + if self.__check_field_in_vector(test_vector, "devtype"): > + devtype =3D " --devtype " + test_vector["devtype"] > + > + chain =3D "" > + if self.__check_field_in_vector(test_vector, "optype"): > + chain =3D " --optype " + test_vector["optype"] > + > + cipher_algo =3D "" > + if self.__check_field_in_vector(test_vector, "cipher-algo"): > + cipher_algo =3D " --cipher-algo " + test_vector["cipher-algo= "] > + > + cipher_op =3D "" > + if self.__check_field_in_vector(test_vector, "cipher-op"): > + cipher_op =3D " --cipher-op " + test_vector["cipher-op"] > + > + cipher_key =3D "" > + if self.__check_field_in_vector(test_vector, "cipher-key-sz"): > + cipher_key =3D " --cipher-key-sz > {size}".format(size=3Dtest_vector["cipher-key-sz"]) > + > + iv =3D "" > + if self.__check_field_in_vector(test_vector, "cipher-iv-sz"): > + iv =3D " --cipher-iv-sz {size}".format(size=3Dtest_vector["c= ipher-iv-sz"]) > + > + auth_algo =3D "" > + if self.__check_field_in_vector(test_vector, "auth-algo"): > + auth_algo =3D " --auth-algo " + test_vector["auth-algo"] > + > + auth_op =3D "" > + if self.__check_field_in_vector(test_vector, "auth-op"): > + auth_op =3D " --auth-op " + test_vector["auth-op"] > + > + auth_key =3D "" > + if self.__check_field_in_vector(test_vector, "auth-key-sz"): > + auth_key =3D " --auth-key-sz {size}".format(size=3Dtest_vect= or["auth- > key-sz"]) > + > + aad =3D "" > + if self.__check_field_in_vector(test_vector, "auth-aad-sz"): > + aad =3D " --auth-aad-sz {size}".format(size=3Dtest_vector["a= uth-aad-sz"]) > + > + digest =3D "" > + if self.__check_field_in_vector(test_vector, "auth-digest-sz"): > + digest =3D " --auth-digest-sz {size}".format(size=3Dtest_vec= tor["auth- > digest-sz"]) > + > + total_ops =3D "" > + if self.__check_field_in_vector(test_vector, "total-ops"): > + total_ops =3D " --total-ops {size}".format(size=3Dtest_vecto= r["total-ops"]) > + > + burst_size =3D "" > + if self.__check_field_in_vector(test_vector, "burst-sz"): > + burst_size =3D " --burst-sz {size}".format(size=3Dtest_vecto= r["burst-sz"]) > + > + buffer_size =3D "" > + if self.__check_field_in_vector(test_vector, "buffer-sz"): > + buffer_size =3D " --buffer-sz {size}".format(size=3Dtest_vec= tor["buffer- > sz"]) > + > + cmd_str =3D "".join([TEST_CRYPTO_PERF, EAL_CORE_MASK, vdev, > pci_bus, qat_bus, EAL_SEP, QUEUE_NUM, > + ptest, devtype, chain, cipher_algo, cipher_op= , cipher_key, iv, > auth_algo, > + auth_op, auth_key, aad, digest, total_ops, bu= rst_size, > buffer_size, CSV_FRIENDLY]) > + > + return cmd_str > + > + def __check_field_in_vector(self, test_vector, field_name): > + if field_name in test_vector and test_vector[field_name]: > + return True > + return False > + > + def __format_hex_to_param(self, hex_str, sep=3D":", prefix=3D""): > + if not hex_str: > + return "" > + if len(hex_str) =3D=3D 1: > + return prefix + "0" + hex_str > + > + result =3D prefix + hex_str[0:2] > + for i in range(2, len(hex_str), 2): > + if len(hex_str) < i + 2: > + result =3D result + sep + "0" + hex_str[i:] > + else: > + result =3D result + sep + hex_str[i:i+2] > + > + return result > + > + def __var2list(self, var): > + var_list =3D var if isinstance(var, list) else [var] > + return var_list > + > + def __is_valid_op(self, chain, op): > + chain_op_map =3D { > + "aead": ["encrypt", "generate"], > + "cipher-only": ["encrypt", "decrypt"], > + "auth-only": ["generate", "verify"], > + "cipher-then-auth": ["encrypt", "generate"], > + "auth-then-cipher": ["decrypt", "verify"], > + } > + if op in chain_op_map[chain]: > + return True > + return False > + > + def __is_valid_size(self, key_type, algo, size): > + algo_size_map =3D { > + "aes-cbc": { > + "cipher-key-sz": [16, 24, 32], > + "cipher-iv-sz": [16] > + }, > + "aes-ctr": { > + "cipher-key-sz": [16, 24, 32], > + "cipher-iv-sz": [16] > + }, > + "3des-cbc": { > + "cipher-key-sz": [16, 24], > + "cipher-iv-sz": [8] > + }, > + "3des-ctr": { > + "cipher-key-sz": [16, 24], > + "cipher-iv-sz": [8] > + }, > + "aes-gcm": { > + "cipher-key-sz": [16, 24, 32], > + "auth-key-sz": [16, 24, 32], > + "auth-aad-sz": [1, 2, 3, 4, 5, 6, 8, 9, 12, 16, 24, = 32, 64, 128, 155, 256, > 1024, 65535], > + "cipher-iv-sz": [12, 16], > + "auth-digest-sz": [16] > + }, > + "snow3g-uea2": { > + "cipher-key-sz": [16], > + "cipher-iv-sz": [16] > + }, > + "kasumi-f8": { > + "cipher-key-sz": [16], > + "cipher-iv-sz": [8] > + }, > + "zuc-eea3": { > + "cipher-key-sz": [16], > + "cipher-iv-sz": [16] > + }, > + "null": { > + "cipher-key-sz": [0], > + "auth-key-sz": [0], > + "auth-aad-sz": [0], > + "cipher-iv-sz": [0], > + "auth-digest-sz": [0] > + }, > + "md5-hmac": { > + "auth-key-sz": [64], > + "auth-aad-sz": [0], > + "auth-digest-sz": [16] > + }, > + "sha1-hmac": { > + "auth-key-sz": [64], > + "auth-aad-sz": [0], > + "auth-digest-sz": [20] > + }, > + "sha2-224-hmac": { > + "auth-key-sz": [64], > + "auth-aad-sz": [0], > + "auth-digest-sz": [28] > + }, > + "sha2-256-hmac": { > + "auth-key-sz": [64], > + "auth-aad-sz": [0], > + "auth-digest-sz": [32] > + }, > + "sha2-384-hmac": { > + "auth-key-sz": [128], > + "auth-aad-sz": [0], > + "auth-digest-sz": [48] > + }, > + "sha2-512-hmac": { > + "auth-key-sz": [128], > + "auth-aad-sz": [0], > + "auth-digest-sz": [64] > + }, > + "aes-gmac": { > + "auth-key-sz": [16, 24, 32], > + "auth-aad-sz": [1, 2, 3, 4, 5, 6, 8, 9, 12, 16, 24, = 32, 64, 128, 155, 256, > 1024, 65535], > + "auth-digest-sz": [16] > + }, > + "aes-xcbc-hmac": { > + "auth-key-sz": [16], > + "auth-aad-sz": [0], > + "auth-digest-sz": [16] > + }, > + "snow3g-uia2": { > + "auth-key-sz": [16], > + "auth-aad-sz": [16], > + "auth-digest-sz": [4] > + }, > + "kasumi-f9": { > + "auth-key-sz": [16], > + "auth-aad-sz": [8], > + "auth-digest-sz": [4] > + }, > + "zuc-eia3": { > + "auth-key-sz": [16], > + "auth-aad-sz": [16], > + "auth-digest-sz": [4] > + }, > + "md5": { > + "auth-key-sz": [0], > + "auth-aad-sz": [0], > + "auth-digest-sz": [16] > + }, > + "sha1": { > + "auth-key-sz": [0], > + "auth-aad-sz": [0], > + "auth-digest-sz": [20] > + }, > + "sha2-224": { > + "auth-key-sz": [0], > + "auth-aad-sz": [0], > + "auth-digest-sz": [28] > + }, > + "sha2-256": { > + "auth-key-sz": [0], > + "auth-aad-sz": [0], > + "auth-digest-sz": [32] > + }, > + "sha2-384": { > + "auth-key-sz": [0], > + "auth-aad-sz": [0], > + "auth-digest-sz": [48] > + }, > + "sha2-512": { > + "auth-key-sz": [0], > + "auth-aad-sz": [0], > + "auth-digest-sz": [64] > + }, > + } > + result =3D False > + if algo in algo_size_map: > + if key_type in algo_size_map[algo]: > + if size in algo_size_map[algo][key_type]: > + result =3D True > + return result > + > + def __actually_aesni_mb_digest(self, vector): > + > + if ((vector["vdev"]).find("crypto_aesni_mb") =3D=3D -1): > + return > + > + auth_algo_dgst_map =3D { > + "md5-hmac": 12, > + "sha1-hamc": 12, > + "sha2-224-hamc": 14, > + "sha2-256-hamc": 16, > + "sha2-384-hamc": 24, > + "sha2-512-hamc": 32 > + } > + if vector["auth-algo"] in auth_algo_dgst_map: > + digest =3D auth_algo_dgst_map[vector["auth-algo"]] > + vector["auth-digest-sz"] =3D digest > + > + def __iter_optype(self, vector, vector_list, core_mask=3D"", port_ma= sk=3D""): > + test_vector =3D vector.copy() > + chain_list =3D self.__var2list(test_vector["optype"]) > + for op_type in chain_list: > + test_vector =3D vector.copy() > + test_vector["optype"] =3D op_type > + self.__iter_cipher_algo(test_vector, vector_list, core_mask, > port_mask) > + > + def __iter_cipher_algo(self, vector, vector_list, core_mask=3D"", > port_mask=3D""): > + test_vector =3D vector.copy() > + if test_vector["optype"] =3D=3D "auth-only": > + test_vector["cipher-algo"] =3D "" > + self.__iter_cipher_op(test_vector, vector_list, core_mask, > port_mask) > + else: > + cipher_algo_list =3D self.__var2list(test_vector["cipher-alg= o"]) > + for cipher_algo in cipher_algo_list: > + test_vector =3D vector.copy() > + test_vector["cipher-algo"] =3D cipher_algo > + self.__iter_cipher_op(test_vector, vector_list, core_mas= k, > port_mask) > + > + def __iter_cipher_op(self, vector, vector_list, core_mask=3D"", > port_mask=3D""): > + test_vector =3D vector.copy() > + if test_vector["optype"] =3D=3D "auth-only": > + test_vector["cipher-op"] =3D "" > + self.__iter_cipher_key(test_vector, vector_list, core_mask, > port_mask) > + else: > + cipher_op_list =3D self.__var2list(test_vector["cipher-op"]) > + for cipher_op in cipher_op_list: > + if self.__is_valid_op(test_vector["optype"], cipher_op): > + test_vector =3D vector.copy() > + test_vector["cipher-op"] =3D cipher_op > + self.__iter_cipher_key(test_vector, vector_list, > + core_mask, port_mask) > + > + def __iter_cipher_key(self, vector, vector_list, core_mask=3D"", > port_mask=3D""): > + test_vector =3D vector.copy() > + if test_vector["optype"] =3D=3D "auth-only": > + test_vector["cipher-key-sz"] =3D "" > + self.__iter_iv(test_vector, vector_list, core_mask, port_mas= k) > + else: > + cipher_key_list =3D self.__var2list(test_vector["cipher-key-= sz"]) > + for cipher_key in cipher_key_list: > + test_vector =3D vector.copy() > + if isinstance(cipher_key, int): > + if self.__is_valid_size("cipher-key-sz", > + test_vector["cipher-algo"], > + cipher_key): > + test_vector["cipher-key-sz"] =3D cipher_key > + self.__iter_iv(test_vector, vector_list, core_ma= sk, port_mask) > + else: > + continue > + else: > + test_vector["cipher-key-sz"] =3D 0 > + self.__iter_iv(test_vector, vector_list, core_mask, = port_mask) > + > + def __iter_iv(self, vector, vector_list, core_mask=3D"", port_mask= =3D""): > + test_vector =3D vector.copy() > + if test_vector["optype"] =3D=3D "auth-only": > + test_vector["cipher-iv-sz"] =3D "" > + self.__iter_auth_algo(test_vector, vector_list, core_mask, p= ort_mask) > + else: > + iv_list =3D self.__var2list(test_vector["cipher-iv-sz"]) > + for iv in iv_list: > + test_vector =3D vector.copy() > + if isinstance(iv, int): > + if self.__is_valid_size("cipher-iv-sz", > + test_vector["cipher-algo"], > + iv): > + test_vector["cipher-iv-sz"] =3D iv > + self.__iter_auth_algo(test_vector, vector_list, = core_mask, > port_mask) > + else: > + continue > + else: > + test_vector["cipher-iv-sz"] =3D 0 > + self.__iter_auth_algo(test_vector, vector_list, > + core_mask, port_mask) > + > + def __iter_auth_algo(self, vector, vector_list, core_mask=3D"", > port_mask=3D""): > + test_vector =3D vector.copy() > + if test_vector["optype"] =3D=3D "cipher-only": > + test_vector["auth-algo"] =3D "" > + self.__iter_auth_op(test_vector, vector_list, core_mask, por= t_mask) > + else: > + auth_algo_list =3D self.__var2list(test_vector["auth-algo"]) > + for auth_algo in auth_algo_list: > + test_vector =3D vector.copy() > + test_vector["auth-algo"] =3D auth_algo > + self.__iter_auth_op(test_vector, vector_list, core_mask, > port_mask) > + > + def __iter_auth_op(self, vector, vector_list, core_mask=3D"", > port_mask=3D""): > + test_vector =3D vector.copy() > + if test_vector["optype"] =3D=3D "cipher-only": > + test_vector["auth-op"] =3D "" > + self.__iter_auth_key(test_vector, vector_list, core_mask, po= rt_mask) > + else: > + auth_op_list =3D self.__var2list(test_vector["auth-op"]) > + for auth_op in auth_op_list: > + if self.__is_valid_op(test_vector["optype"], auth_op): > + test_vector =3D vector.copy() > + test_vector["auth-op"] =3D auth_op > + self.__iter_auth_key(test_vector, vector_list, > + core_mask, port_mask) > + > + def __iter_auth_key(self, vector, vector_list, core_mask=3D"", > port_mask=3D""): > + test_vector =3D vector.copy() > + if test_vector["optype"] =3D=3D "cipher-only": > + test_vector["auth-key-sz"] =3D "" > + self.__iter_aad(test_vector, vector_list, core_mask, port_ma= sk) > + else: > + auth_key_list =3D self.__var2list(test_vector["auth-key-sz"]= ) > + for auth_key in auth_key_list: > + test_vector =3D vector.copy() > + if isinstance(auth_key, int): > + if self.__is_valid_size("auth-key-sz", > + test_vector["auth-algo"], > + auth_key): > + test_vector["auth-key-sz"] =3D auth_key > + self.__iter_aad(test_vector, vector_list, core_m= ask, port_mask) > + else: > + continue > + else: > + test_vector["auth-key-sz"] =3D 0 > + self.__iter_aad(test_vector, vector_list, core_mask,= port_mask) > + > + def __iter_aad(self, vector, vector_list, core_mask=3D"", port_mask= =3D""): > + test_vector =3D vector.copy() > + if test_vector["optype"] =3D=3D "cipher-only": > + test_vector["auth-aad-sz"] =3D "" > + self.__iter_digest(test_vector, vector_list, core_mask, port= _mask) > + else: > + aad_list =3D self.__var2list(test_vector["auth-aad-sz"]) > + for aad in aad_list: > + test_vector =3D vector.copy() > + if isinstance(aad, int): > + if self.__is_valid_size("auth-aad-sz", > + test_vector["auth-algo"], > + aad): > + test_vector["auth-aad-sz"] =3D aad > + self.__iter_digest(test_vector, vector_list, > + core_mask, port_mask) > + else: > + continue > + else: > + test_vector["auth-aad-sz"] =3D 0 > + self.__iter_digest(test_vector, vector_list, > + core_mask, port_mask) > + > + def __iter_digest(self, vector, vector_list, core_mask=3D"", port_ma= sk=3D""): > + test_vector =3D vector.copy() > + if test_vector["optype"] =3D=3D "cipher-only": > + test_vector["auth-digest-sz"] =3D "" > + self.__iter_buffer_size(test_vector, vector_list, > + core_mask, port_mask) > + else: > + digest_list =3D self.__var2list(vector["auth-digest-sz"]) > + for digest in digest_list: > + test_vector =3D vector.copy() > + if isinstance(digest, int): > + if self.__is_valid_size("auth-digest-sz", > + test_vector["auth-algo"], > + digest): > + test_vector["auth-digest-sz"] =3D digest > + else: > + continue > + else: > + test_vector["auth-digest-sz"] =3D 0 > + self.__actually_aesni_mb_digest(test_vector) > + self.__iter_buffer_size(test_vector, vector_list, > + core_mask, port_mask) > + > + def __iter_buffer_size(self, vector, vector_list, core_mask=3D"", > port_mask=3D""): > + test_vector =3D vector.copy() > + buffer_sz_list =3D vector["buffer-sz"] > + if buffer_sz_list =3D=3D "": > + buffer_sz_list =3D "32,64,128,256, 512,768, 1024,1280,1536,1= 792,2048" > + test_vector["buffer-sz"] =3D buffer_sz_list > + vector_list.append(test_vector) > + > + def __test_vector_to_vector_list(self, test_vector, core_mask=3D"", > port_mask=3D""): > + vector_list =3D [] > + ptest_list =3D self.__var2list(test_vector["ptest"]) > + for ptest in ptest_list: > + test_vector["ptest"] =3D ptest > + self.__iter_optype(test_vector, vector_list, core_mask, port= _mask) > + > + return vector_list > + > +test_vectors =3D { > + > + "qat_c_AES_CBC_Perf": { > + "vdev": "", > + "devtype": "crypto_qat", > + "ptest": ["throughput", "latency"], > + "optype": ["cipher-only", "cipher-then-auth"], > + "cipher-algo": ["aes-cbc"], > + "cipher-op": ["encrypt", "decrypt"], > + "cipher-key-sz": [16, 24, 32], > + "cipher-iv-sz": [16], > + "auth-algo": ["md5-hmac", "sha1-hmac", "sha2-224-hmac", "sha2-25= 6- > hmac", > + "sha2-384-hmac", "sha2-512-hmac"], > + "auth-op": ["generate"], > + "auth-key-sz": [8, 16, 24, 32, 40, 48, 56, 64, 128], > + "auth-aad-sz": [0], > + "auth-digest-sz": [16, 20, 28, 32, 48, 64], > + "buffer-sz": "32,64,128,256,512,768,1024,1280,1536,1792,2048", > + "burst-sz": 32, > + "total-ops": 10000000 > + }, > + > + "qat_c_AES_CTR_Perf": { > + "vdev": "", > + "devtype": "crypto_qat", > + "ptest": ["throughput", "latency"], > + "optype": ["cipher-only", "cipher-then-auth"], > + "cipher-algo": ["aes-ctr"], > + "cipher-op": ["encrypt", "decrypt"], > + "cipher-key-sz": [16, 24, 32], > + "cipher-iv-sz": [16], > + "auth-algo": ["md5-hmac", "sha1-hmac", "sha2-224-hmac", "sha2-25= 6- > hmac", > + "sha2-384-hmac", "sha2-512-hmac"], > + "auth-op": ["generate"], > + "auth-key-sz": [16, 24, 32, 40, 48, 56, 64, 128], > + "auth-aad-sz": [0], > + "auth-digest-sz": [16, 20, 28, 32, 48, 64], > + "buffer-sz": "32,64,128,256,512,768,1024,1280,1536,1792,2048", > + "burst-sz": 32, > + "total-ops": 10000000 > + }, > + > + "qat_c_AES_GCM_Perf": { > + "vdev": "", > + "devtype": "crypto_qat", > + "ptest": ["throughput", "latency"], > + "optype": ["aead"], > + "cipher-algo": ["aes-gcm"], > + "cipher-op": ["encrypt", "decrypt"], > + "cipher-key-sz": [16, 24, 32], > + "cipher-iv-sz": [16], > + "auth-algo": ["aes-gcm", "aes-gmac", "md5-hmac", "sha1-hmac", "s= ha2- > 224-hmac", "sha2-256-hmac", > + "sha2-384-hmac", "sha2-512-hmac"], > + "auth-op": ["generate"], > + "auth-key-sz": [8, 16, 24, 32, 40, 48, 56, 64, 128], > + "auth-aad-sz": [0, 8, 12], > + "auth-digest-sz": [8, 12, 16, 20, 28, 32, 48, 64], > + "buffer-sz": "32,64,128,256,512,768,1024,1280,1536,1792,2048", > + "burst-sz": 32, > + "total-ops": 10000000 > + }, > + > + "qat_c_3DES_CBC_Perf": { > + "vdev": "", > + "devtype": "crypto_qat", > + "ptest": ["throughput", "latency"], > + "optype": ["cipher-only", "cipher-then-auth"], > + "cipher-algo": ["3des-cbc"], > + "cipher-op": ["encrypt", "decrypt"], > + "cipher-key-sz": [16, 24], > + "cipher-iv-sz": [8], > + "auth-algo": ["md5-hmac", "sha1-hmac", "sha2-224-hmac", "sha2-25= 6- > hmac", > + "sha2-384-hmac", "sha2-512-hmac"], > + "auth-op": ["generate"], > + "auth-key-sz": [16, 24, 32, 40, 48, 56, 64, 128], > + "auth-aad-sz": [0], > + "auth-digest-sz": [16, 20, 28, 32, 48, 64], > + "buffer-sz": "32,64,128,256,512,768,1024,1280,1536,1792,2048", > + "burst-sz": 32, > + "total-ops": 10000000 > + }, > + > + "qat_c_3DES_CTR_Perf": { > + "vdev": "", > + "devtype": "crypto_qat", > + "ptest": ["throughput", "latency"], > + "optype": ["cipher-only", "cipher-then-auth"], > + "cipher-algo": ["3des-ctr"], > + "cipher-op": ["encrypt", "decrypt"], > + "cipher-key-sz": [16, 24], > + "cipher-iv-sz": [8], > + "auth-algo": ["md5-hmac", "sha1-hmac", "sha2-224-hmac", "sha2-25= 6- > hmac", > + "sha2-384-hmac", "sha2-512-hmac"], > + "auth-op": ["generate"], > + "auth-key-sz": [16, 24, 32, 40, 48, 56, 64, 128], > + "auth-aad-sz": [0], > + "auth-digest-sz": [16, 20, 28, 32, 48, 64], > + "buffer-sz": "32,64,128,256,512,768,1024,1280,1536,1792,2048", > + "burst-sz": 32, > + "total-ops": 10000000 > + }, > + > + "qat_c_KASUMMI_Perf": { > + "vdev": "", > + "devtype": "crypto_qat", > + "ptest": ["throughput", "latency"], > + "optype": ["cipher-only", "cipher-then-auth"], > + "cipher-algo": ["kasumi-f8"], > + "cipher-op": ["encrypt", "decrypt"], > + "cipher-key-sz": [16], > + "cipher-iv-sz": [8], > + "auth-algo": ["kasumi-f9"], > + "auth-op": ["generate"], > + "auth-key-sz": [16], > + "auth-aad-sz": [8], > + "auth-digest-sz": [4], > + "buffer-sz": "32,64,128,256,512,768,1024,1280,1536,1792,2048", > + "burst-sz": 32, > + "total-ops": 10000000 > + }, > + > + "qat_c_SNOW3G_Perf": { > + "vdev": "", > + "devtype": "crypto_qat", > + "ptest": ["throughput", "latency"], > + "optype": ["cipher-only", "cipher-then-auth"], > + "cipher-algo": ["snow3g-uea2"], > + "cipher-op": ["encrypt", "decrypt"], > + "cipher-key-sz": [16], > + "cipher-iv-sz": [16], > + "auth-algo": ["snow3g-uia2"], > + "auth-op": ["generate"], > + "auth-key-sz": [16], > + "auth-aad-sz": [16], > + "auth-digest-sz": [4], > + "buffer-sz": "32,64,128,256,512,768,1024,1280,1536,1792,2048", > + "burst-sz": 32, > + "total-ops": 10000000 > + }, > + > + "qat_h_auto_Perf": { > + "vdev": "", > + "devtype": "crypto_qat", > + "ptest": ["throughput", "latency"], > + "optype": ["auth-only"], > + "cipher-algo": "", > + "cipher-op": "", > + "cipher-key-sz": "", > + "cipher-iv-sz": "", > + "auth-algo": ["aes-gcm", "aes-gmac", "kasumi-f9", "snow3g-uia2", > "md5-hmac", > + "sha1-hmac", "sha2-224-hmac", "sha2-256-hmac", "sh= a2-384- > hmac", > + "sha2-512-hmac"], > + "auth-op": ["generate"], > + "auth-key-sz": [8, 16, 24, 32, 40, 48, 56, 64, 128], > + "auth-aad-sz": [0, 8, 12], > + "auth-digest-sz": [4, 8, 12, 16, 20, 28, 32, 48, 64], > + "buffer-sz": "32,64,128,256,512,768,1024,1280,1536,1792,2048", > + "burst-sz": 32, > + "total-ops": 10000000 > + }, > + > + "qat_NULL_auto_Perf": { > + "vdev": "", > + "devtype": "crypto_qat", > + "ptest": ["throughput", "latency"], > + "optype": ["cipher-only"], > + "cipher-algo": ["null"], > + "cipher-op": ["encrypt", "decrypt"], > + "cipher-key-sz": [0], > + "cipher-iv-sz": [0], > + "auth-algo": ["null"], > + "auth-op": ["generate"], > + "auth-key-sz": [0], > + "auth-aad-sz": [0], > + "auth-digest-sz": [0], > + "buffer-sz": "32,64,128,256,512,768,1024,1280,1536,1792,2048", > + "burst-sz": 32, > + "total-ops": 10000000 > + }, > + > + "aesni_mb_c_AES_CBC_Perf": { > + "vdev": "crypto_aesni_mb_pmd", > + "devtype": "crypto_aesni_mb", > + "ptest": ["throughput", "latency"], > + "optype": ["cipher-only", "cipher-then-auth"], > + "cipher-algo": ["aes-cbc"], > + "cipher-op": ["encrypt", "decrypt"], > + "cipher-key-sz": [16, 24, 32], > + "cipher-iv-sz": [16], > + "auth-algo": ["md5-hmac", "sha1-hmac", "sha2-224-hmac", "sha2-25= 6- > hmac", > + "sha2-384-hmac", "sha2-512-hmac"], > + "auth-op": ["generate"], > + "auth-key-sz": [8, 16, 24, 32, 40, 48, 56, 64, 128], > + "auth-aad-sz": [0], > + "auth-digest-sz": [12, 14, 16, 24, 32], > + "buffer-sz": "32,64,128,256,512,768,1024,1280,1536,1792,2048", > + "burst-sz": 32, > + "total-ops": 10000000 > + }, > + > + "aesni_mb_c_AES_CTR_Perf": { > + "vdev": "crypto_aesni_mb_pmd", > + "devtype": "crypto_aesni_mb", > + "ptest": ["throughput", "latency"], > + "optype": ["cipher-only", "cipher-then-auth"], > + "cipher-algo": ["aes-ctr"], > + "cipher-op": ["encrypt", "decrypt"], > + "cipher-key-sz": [16, 24, 32], > + "cipher-iv-sz": [16], > + "auth-algo": ["md5-hmac", "sha1-hmac", "sha2-224-hmac", "sha2-25= 6- > hmac", > + "sha2-384-hmac", "sha2-512-hmac"], > + "auth-op": ["generate"], > + "auth-key-sz": [8, 16, 24, 32, 40, 48, 56, 64, 128], > + "auth-aad-sz": [0], > + "auth-digest-sz": [12, 14, 16, 24, 32], > + "buffer-sz": "32,64,128,256,512,768,1024,1280,1536,1792,2048", > + "burst-sz": 32, > + "total-ops": 10000000 > + }, > + > + "aesni_mb_h_auto_Perf": { > + "vdev": "crypto_aesni_mb_pmd", > + "devtype": "crypto_aesni_mb", > + "ptest": ["throughput", "latency"], > + "optype": ["auth-only", "cipher-then-auth"], > + "cipher-algo": "", > + "cipher-op": "", > + "cipher-key-sz": "", > + "cipher-iv-sz": "", > + "auth-algo": ["md5-hmac", "sha1-hmac", "sha2-224-hmac", "sha2-25= 6- > hmac", > + "sha2-384-hmac", "sha2-512-hmac"], > + "auth-op": ["generate"], > + "auth-key-sz": [8, 16, 24, 32, 40, 48, 56, 64, 128], > + "auth-aad-sz": [0], > + "auth-digest-sz": [12, 14, 16, 24, 32], > + "buffer-sz": "32,64,128,256,512,768,1024,1280,1536,1792,2048", > + "burst-sz": 32, > + "total-ops": 10000000 > + }, > + > + "aes_gcm_c_AES_GCM_Perf": { > + "vdev": "crypto_aesni_gcm_pmd", > + "devtype": "crypto_aesni_gcm", > + "ptest": ["throughput", "latency"], > + "optype": ["aead"], > + "cipher-algo": ["aes-gcm"], > + "cipher-op": ["encrypt", "decrypt"], > + "cipher-key-sz": [16, 32], > + "cipher-iv-sz": [12], > + "auth-algo": ["aes-gcm", "aes-gmac"], > + "auth-op": ["generate"], > + "auth-key-sz": [16, 32], > + "auth-aad-sz": [1, 4, 8, 12, 16, 65535], > + "auth-digest-sz": [8, 12, 16], > + "buffer-sz": "32,64,128,256,512,768,1024,1280,1536,1792,2048", > + "burst-sz": 32, > + "total-ops": 10000000 > + }, > + > + "kasumi_KASUMI_auto_Perf": { > + "vdev": "crypto_kasumi_pmd", > + "devtype": "crypto_kasumi", > + "ptest": ["throughput", "latency"], > + "optype": ["cipher-only", "auth-only", "cipher-then-auth"], > + "cipher-algo": ["kasumi-f8"], > + "cipher-op": ["encrypt", "decrypt"], > + "cipher-key-sz": [16], > + "cipher-iv-sz": [8], > + "auth-algo": ["kasumi-f9"], > + "auth-op": ["generate"], > + "auth-key-sz": [16], > + "auth-aad-sz": [8], > + "auth-digest-sz": [4], > + "buffer-sz": "32,64,128,256,512,768,1024,1280,1536,1792,2048", > + "burst-sz": 32, > + "total-ops": 10000000 > + }, > + > + "snow3g_SNOW3G_auto_Perf": { > + "vdev": "crypto_snow3g_pmd", > + "devtype": "crypto_snow3g", > + "ptest": ["throughput", "latency"], > + "optype": ["cipher-only", "auth-only", "cipher-then-auth"], > + "cipher-algo": ["snow3g-uea2"], > + "cipher-op": ["encrypt", "decrypt"], > + "cipher-key-sz": [16], > + "cipher-iv-sz": [16], > + "auth-algo": ["snow3g-uia2"], > + "auth-op": ["generate"], > + "auth-key-sz": [16], > + "auth-aad-sz": [16], > + "auth-digest-sz": [4], > + "buffer-sz": "32,64,128,256,512,768,1024,1280,1536,1792,2048", > + "burst-sz": 32, > + "total-ops": 10000000 > + }, > + > + "zuc_ZUC_auto_Perf": { > + "vdev": "crypto_zuc_pmd", > + "devtype": "crypto_zuc", > + "ptest": ["throughput", "latency"], > + "optype": ["cipher-only", "auth-only", "cipher-then-auth"], > + "cipher-algo": ["zuc-eea3"], > + "cipher-op": ["encrypt", "decrypt"], > + "cipher-key-sz": [16], > + "cipher-iv-sz": [16], > + "auth-algo": ["zuc-eia3"], > + "auth-op": ["generate"], > + "auth-key-sz": [16], > + "auth-aad-sz": [16], > + "auth-digest-sz": [4], > + "buffer-sz": "32,64,128,256,512,768,1024,1280,1536,1792,2048", > + "burst-sz": 32, > + "total-ops": 10000000 > + }, > + > + "null_NULL_auto_Perf": { > + "vdev": "", > + "devtype": "crypto_qat", > + "ptest": ["throughput", "latency"], > + "optype": ["cipher-only"], > + "cipher-algo": ["null"], > + "cipher-op": ["encrypt", "decrypt"], > + "cipher-key-sz": [0], > + "cipher-iv-sz": [0], > + "auth-algo": ["null"], > + "auth-op": ["generate"], > + "auth-key-sz": [0], > + "auth-aad-sz": [0], > + "auth-digest-sz": [0], > + "buffer-sz": "32,64,128,256,512,768,1024,1280,1536,1792,2048", > + "burst-sz": 32, > + "total-ops": 10000000 > + }, > + > + "openssl_c_AES_CBC_Perf": { > + "vdev": "crypto_openssl_pmd", > + "devtype": "crypto_openssl", > + "ptest": ["throughput", "latency"], > + "optype": ["cipher-only", "cipher-then-auth"], > + "cipher-algo": ["aes-cbc"], > + "cipher-op": ["encrypt", "decrypt"], > + "cipher-key-sz": [16, 24, 32], > + "cipher-iv-sz": [16], > + "auth-algo": ["md5", "sha1", "sha2-224", "sha2-256", "sha2-384",= "sha2- > 512", > + "md5-hmac", "sha1-hmac", "sha2-224-hmac", "sha2-25= 6-hmac", > + "sha2-384-hmac", "sha2-512-hmac"], > + "auth-op": ["generate"], > + "auth-key-sz": [0, 64, 128], > + "auth-aad-sz": [0], > + "auth-digest-sz": [16, 20, 28, 32, 48, 64], > + "buffer-sz": "32,64,128,256", > + "burst-sz": 32, > + "total-ops": 10000000 > + }, > + > + "openssl_c_AES_CTR_Perf": { > + "vdev": "crypto_openssl_pmd", > + "devtype": "crypto_openssl", > + "ptest": ["throughput", "latency"], > + "optype": ["cipher-only", "cipher-then-auth"], > + "cipher-algo": ["aes-ctr"], > + "cipher-op": ["encrypt", "decrypt"], > + "cipher-key-sz": [16, 24, 32], > + "cipher-iv-sz": [16], > + "auth-algo": ["md5", "sha1", "sha2-224", "sha2-256", "sha2-384",= "sha2- > 512", > + "md5-hmac", "sha1-hmac", "sha2-224-hmac", "sha2-25= 6-hmac", > + "sha2-384-hmac", "sha2-512-hmac"], > + "auth-op": ["generate"], > + "auth-key-sz": [0, 64, 128], > + "auth-aad-sz": [0], > + "auth-digest-sz": [16, 20, 28, 32, 48, 64], > + "buffer-sz": "32,64,128,256", > + "burst-sz": 32, > + "total-ops": 10000000 > + }, > + > + "openssl_c_AES_GCM_Perf": { > + "vdev": "crypto_openssl_pmd", > + "devtype": "crypto_openssl", > + "ptest": ["throughput", "latency"], > + "optype": ["aead"], > + "cipher-algo": ["aes-gcm"], > + "cipher-op": ["aead"], > + "cipher-key-sz": [16], > + "cipher-iv-sz": [12, 16], > + "auth-algo": ["aes-gcm", "aes-gmac", "md5", "sha1", "sha2-224", = "sha2- > 256", > + "sha2-384", "sha2-512", "md5-hmac", "sha1-hmac", "= sha2-224- > hmac", > + "sha2-256-hmac", "sha2-384-hmac", "sha2-512-hmac"]= , > + "auth-op": ["generate"], > + "auth-key-sz": [0, 16, 24, 32, 64, 128], > + "auth-aad-sz": [0, 8, 12], > + "auth-digest-sz": [8, 12, 16, 20, 28, 32, 48, 64], > + "buffer-sz": "32,64,128,256", > + "burst-sz": 32, > + "total-ops": 10000000 > + }, > + > + "openssl_c_3DES_CBC_Perf": { > + "vdev": "crypto_openssl_pmd", > + "devtype": "crypto_openssl", > + "ptest": ["throughput", "latency"], > + "optype": ["cipher-only", "cipher-then-auth"], > + "cipher-algo": ["3des-cbc"], > + "cipher-op": ["encrypt", "decrypt"], > + "cipher-key-sz": [16, 24], > + "cipher-iv-sz": [8], > + "auth-algo": ["md5", "sha1", "sha2-224", "sha2-256", "sha2-384",= "sha2- > 512", > + "md5-hmac", "sha1-hmac", "sha2-224-hmac", "sha2-25= 6-hmac", > + "sha2-384-hmac", "sha2-512-hmac"], > + "auth-op": ["generate"], > + "auth-key-sz": [0, 64, 128], > + "auth-aad-sz": [0], > + "auth-digest-sz": [16, 20, 28, 32, 48, 64], > + "buffer-sz": "32,64", > + "burst-sz": 32, > + "total-ops": 10000000 > + }, > + > + "openssl_c_3DES_CTR_Perf": { > + "vdev": "crypto_openssl_pmd", > + "devtype": "crypto_openssl", > + "ptest": ["throughput", "latency"], > + "optype": ["cipher-only", "cipher-then-auth"], > + "cipher-algo": ["3des-ctr"], > + "cipher-op": ["encrypt", "decrypt"], > + "cipher-key-sz": [16, 24], > + "cipher-iv-sz": [8], > + "auth-algo": ["md5", "sha1", "sha2-224", "sha2-256", "sha2-384",= "sha2- > 512", > + "md5-hmac", "sha1-hmac", "sha2-224-hmac", "sha2-25= 6-hmac", > + "sha2-384-hmac", "sha2-512-hmac"], > + "auth-op": ["generate"], > + "auth-key-sz": [0, 64, 128], > + "auth-aad-sz": [0], > + "auth-digest-sz": [16, 20, 28, 32, 48, 64], > + "buffer-sz": "32,64", > + "burst-sz": 32, > + "total-ops": 10000000 > + }, > + > + "openssl_h_HASH_auto_Perf": { > + "vdev": "crypto_openssl_pmd", > + "devtype": "crypto_openssl", > + "ptest": ["throughput", "latency"], > + "optype": ["auth-only"], > + "cipher-algo": "", > + "cipher-op": "", > + "cipher-key-sz": "", > + "cipher-iv-sz": "", > + "auth-algo": ["md5", "sha1", "sha2-224", "sha2-256", "sha2-384",= "sha2- > 512", > + "md5-hmac", "sha1-hmac", "sha2-224-hmac", "sha2-25= 6-hmac", > + "sha2-384-hmac", "sha2-512-hmac"], > + "auth-op": ["generate"], > + "auth-key-sz": [0, 64, 128], > + "auth-aad-sz": [0], > + "auth-digest-sz": [16, 20, 28, 32, 48, 64], > + "buffer-sz": "32,64", > + "burst-sz": 32, > + "total-ops": 10000000 > + }, > +} > -- > 2.5.5