Re: [dpdk-dev] [PATCH v3 8/8] app/test: add ARMv8 crypto tests and test vectors
On 1/4/2017 11:03 PM, zbigniew.bo...@caviumnetworks.com wrote: From: Zbigniew Bodek Introduce unit tests for ARMv8 crypto PMD. Add test vectors for short cases such as 160 bytes. These test cases are ARMv8 specific since the code provides different processing paths for different input data sizes. User can validate correctness of algorithms' implementation using: * cryptodev_sw_armv8_autotest For performance test one can use: * cryptodev_sw_armv8_perftest Signed-off-by: Zbigniew Bodek --- app/test/test_cryptodev.c | 63 app/test/test_cryptodev_aes_test_vectors.h | 144 - app/test/test_cryptodev_blockcipher.c | 4 + app/test/test_cryptodev_blockcipher.h | 1 + app/test/test_cryptodev_perf.c | 480 + 5 files changed, 684 insertions(+), 8 deletions(-) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index 872f8b4..a0540d6 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -2422,6 +2449,136 @@ struct crypto_data_params aes_cbc_hmac_sha256_output[MAX_PACKET_SIZE_INDEX] = { return TEST_SUCCESS; } +static int +test_perf_armv8_optimise_cyclecount(struct perf_test_params *pparams) +{ + uint32_t num_to_submit = pparams->total_operations; + struct rte_crypto_op *c_ops[num_to_submit]; + struct rte_crypto_op *proc_ops[num_to_submit]; + uint64_t failed_polls, retries, start_cycles, end_cycles, +total_cycles = 0; + uint32_t burst_sent = 0, burst_received = 0; + uint32_t i, burst_size, num_sent, num_ops_received; + + struct crypto_testsuite_params *ts_params = &testsuite_params; + + static struct rte_cryptodev_sym_session *sess; + + unsigned int digest_length = get_auth_digest_length(pparams->auth_algo); + + if (rte_cryptodev_count() == 0) { + printf("\nNo crypto devices found. Is PMD build configured?\n"); + return TEST_FAILED; + } + + /* Create Crypto session*/ + sess = test_perf_create_armv8_session(ts_params->dev_id, + pparams->chain, pparams->cipher_algo, + pparams->cipher_key_length, pparams->auth_algo); + TEST_ASSERT_NOT_NULL(sess, "Session creation failed"); + + /* Generate Crypto op data structure(s)*/ + for (i = 0; i < num_to_submit ; i++) { + struct rte_mbuf *m = test_perf_create_pktmbuf( + ts_params->mbuf_mp, + pparams->buf_size); + TEST_ASSERT_NOT_NULL(m, "Failed to allocate tx_buf"); + + struct rte_crypto_op *op = + rte_crypto_op_alloc(ts_params->op_mpool, + RTE_CRYPTO_OP_TYPE_SYMMETRIC); + TEST_ASSERT_NOT_NULL(op, "Failed to allocate op"); + + op = test_perf_set_crypto_op_aes(op, m, sess, pparams->buf_size, + digest_length); + TEST_ASSERT_NOT_NULL(op, "Failed to attach op to session"); + + c_ops[i] = op; + } + + printf("\nOn %s dev%u qp%u, %s, cipher algo:%s, cipher key length:%u, " + "auth_algo:%s, Packet Size %u bytes", + pmd_name(gbl_cryptodev_perftest_devtype), + ts_params->dev_id, 0, + chain_mode_name(pparams->chain), + cipher_algo_name(pparams->cipher_algo), + pparams->cipher_key_length, + auth_algo_name(pparams->auth_algo), + pparams->buf_size); + printf("\nOps Tx\tOps Rx\tOps/burst "); + printf("Retries " + "EmptyPolls\tIACycles/CyOp\tIACycles/Burst\tIACycles/Byte"); + + for (i = 2; i <= 128 ; i *= 2) { + num_sent = 0; + num_ops_received = 0; + retries = 0; + failed_polls = 0; + burst_size = i; + total_cycles = 0; + while (num_sent < num_to_submit) { + start_cycles = rte_rdtsc_precise(); + burst_sent = rte_cryptodev_enqueue_burst( + ts_params->dev_id, + 0, &c_ops[num_sent], + ((num_to_submit - num_sent) < burst_size) ? + num_to_submit - num_sent : burst_size); + end_cycles = rte_rdtsc_precise(); + if (burst_sent == 0) + retries++; + num_sent += burst_sent; + total_cycles += (end_cycles - start_cycles); + + /* Wait until requests have been sent. */ + rte_delay_ms(1); + you may remove this delay. + start_cycles = rt
Re: [dpdk-dev] [PATCH v3 8/8] app/test: add ARMv8 crypto tests and test vectors
> -Original Message- > From: Zbigniew Bodek [mailto:zbigniew.bo...@caviumnetworks.com] > Sent: Thursday, January 12, 2017 11:51 AM > To: De Lara Guarch, Pablo; dev@dpdk.org > Cc: Doherty, Declan; jerin.ja...@caviumnetworks.com > Subject: Re: [PATCH v3 8/8] app/test: add ARMv8 crypto tests and test > vectors > > Hello Pablo, > > On 12.01.2017 11:48, De Lara Guarch, Pablo wrote: > > Hi Bodek, > > > >> -Original Message- > >> From: zbigniew.bo...@caviumnetworks.com > >> [mailto:zbigniew.bo...@caviumnetworks.com] > >> Sent: Wednesday, January 04, 2017 5:33 PM > >> To: dev@dpdk.org > >> Cc: De Lara Guarch, Pablo; Doherty, Declan; > >> jerin.ja...@caviumnetworks.com; Zbigniew Bodek > >> Subject: [PATCH v3 8/8] app/test: add ARMv8 crypto tests and test > vectors > >> > >> From: Zbigniew Bodek > >> > >> Introduce unit tests for ARMv8 crypto PMD. > >> Add test vectors for short cases such as 160 bytes. > >> These test cases are ARMv8 specific since the code provides > >> different processing paths for different input data sizes. > >> > >> User can validate correctness of algorithms' implementation using: > >> * cryptodev_sw_armv8_autotest > >> For performance test one can use: > >> * cryptodev_sw_armv8_perftest > >> > >> Signed-off-by: Zbigniew Bodek > > > > Could you rebase this patchset with the dpdk-next-crypto tree? > > There is a compilation error due to a missing parameter in a function that > has recently changed. > > I see. The rebase is done. Should I send full v4 patchset now? > There are some comments from Jianbo Liu. Take a look at them in case you have something to change there. Also, since you are sending a v4 patchset, make the commit name changes too, please. Thanks, Pablo > Kind regards > Zbigniew > > > > > Thanks, > > Pablo > >
Re: [dpdk-dev] [PATCH v3 8/8] app/test: add ARMv8 crypto tests and test vectors
Hello Pablo, On 12.01.2017 11:48, De Lara Guarch, Pablo wrote: Hi Bodek, -Original Message- From: zbigniew.bo...@caviumnetworks.com [mailto:zbigniew.bo...@caviumnetworks.com] Sent: Wednesday, January 04, 2017 5:33 PM To: dev@dpdk.org Cc: De Lara Guarch, Pablo; Doherty, Declan; jerin.ja...@caviumnetworks.com; Zbigniew Bodek Subject: [PATCH v3 8/8] app/test: add ARMv8 crypto tests and test vectors From: Zbigniew Bodek Introduce unit tests for ARMv8 crypto PMD. Add test vectors for short cases such as 160 bytes. These test cases are ARMv8 specific since the code provides different processing paths for different input data sizes. User can validate correctness of algorithms' implementation using: * cryptodev_sw_armv8_autotest For performance test one can use: * cryptodev_sw_armv8_perftest Signed-off-by: Zbigniew Bodek Could you rebase this patchset with the dpdk-next-crypto tree? There is a compilation error due to a missing parameter in a function that has recently changed. I see. The rebase is done. Should I send full v4 patchset now? Kind regards Zbigniew Thanks, Pablo
Re: [dpdk-dev] [PATCH v3 8/8] app/test: add ARMv8 crypto tests and test vectors
Hi Bodek, > -Original Message- > From: zbigniew.bo...@caviumnetworks.com > [mailto:zbigniew.bo...@caviumnetworks.com] > Sent: Wednesday, January 04, 2017 5:33 PM > To: dev@dpdk.org > Cc: De Lara Guarch, Pablo; Doherty, Declan; > jerin.ja...@caviumnetworks.com; Zbigniew Bodek > Subject: [PATCH v3 8/8] app/test: add ARMv8 crypto tests and test vectors > > From: Zbigniew Bodek > > Introduce unit tests for ARMv8 crypto PMD. > Add test vectors for short cases such as 160 bytes. > These test cases are ARMv8 specific since the code provides > different processing paths for different input data sizes. > > User can validate correctness of algorithms' implementation using: > * cryptodev_sw_armv8_autotest > For performance test one can use: > * cryptodev_sw_armv8_perftest > > Signed-off-by: Zbigniew Bodek Could you rebase this patchset with the dpdk-next-crypto tree? There is a compilation error due to a missing parameter in a function that has recently changed. Thanks, Pablo