populate mbuf in latency test
cover populate mbuf in latency test
For decrypt, ICV mismatch can come as data is dummy and latency will be calculated for error path. Hence populate mbuf with test vector data.
Archana Muniganti (2):
app/crypto-perf: populate mbuf in latency test
app/crypto-perf: add vector file for AES-GCM
app/test-crypto-perf/cperf_ops.c | 3 +- app/test-crypto-perf/cperf_test_common.c | 36 ++++++++ app/test-crypto-perf/cperf_test_common.h | 5 ++ app/test-crypto-perf/cperf_test_latency.c | 6 ++ app/test-crypto-perf/cperf_test_verify.c | 36 -------- app/test-crypto-perf/data/aes_gcm_128.data | 97 ++++++++++++++++++++++ 6 files changed, 146 insertions(+), 37 deletions(-) create mode 100644 app/test-crypto-perf/data/aes_gcm_128.data
Signature · 1 line
2.22.0
PATCH 1/2 app/crypto-perf: populate mbuf in latency test
For decrypt, ICV mismatch can come as data is dummy and latency will be calculated for error path. Hence populate mbuf with test vector data.
--- app/test-crypto-perf/cperf_ops.c | 3 +- app/test-crypto-perf/cperf_test_common.c | 36 +++++++++++++++++++++++ app/test-crypto-perf/cperf_test_common.h | 5 ++++ app/test-crypto-perf/cperf_test_latency.c | 6 ++++ app/test-crypto-perf/cperf_test_verify.c | 36 ----------------------- 5 files changed, 49 insertions(+), 37 deletions(-)
app/test-crypto-perf/cperf_ops.c +2 -1
@@ -620,7 +620,8 @@ cperf_set_ops_aead(struct rte_crypto_op **ops, } } -if (options->test ==CPERF_TEST_TYPE_VERIFY ) { +if ((options->test ==CPERF_TEST_TYPE_VERIFY ) || + (options->test ==CPERF_TEST_TYPE_LATENCY )) {for (i =0 ; i < nb_ops; i++) {uint8_t *iv_ptr =rte_crypto_op_ctod_offset (ops[i], uint8_t *, iv_offset);
app/test-crypto-perf/cperf_test_common.c +36 -0
@@ -262,3 +262,39 @@ cperf_alloc_common_memory(const struct cperf_options *options,return 0 ; } + +void +cperf_mbuf_set (struct rte_mbuf *mbuf, +const struct cperf_options *options, +const struct cperf_test_vector *test_vector) +{ +uint32_t segment_sz = options->segment_sz; +uint8_t *mbuf_data; +uint8_t *test_data; +uint32_t remaining_bytes = options->max_buffer_size; + +if (options->op_type ==CPERF_AEAD ) { + test_data = (options->aead_op ==RTE_CRYPTO_AEAD_OP_ENCRYPT ) ? + test_vector->plaintext.data : + test_vector->ciphertext.data; + }else { + test_data = + (options->cipher_op ==RTE_CRYPTO_CIPHER_OP_ENCRYPT ) ? + test_vector->plaintext.data : + test_vector->ciphertext.data; + } + +while (remaining_bytes) { + mbuf_data = rte_pktmbuf_mtod(mbuf, uint8_t *); + +if (remaining_bytes <= segment_sz) { +memcpy (mbuf_data, test_data, remaining_bytes); +return ; + } + +memcpy (mbuf_data, test_data, segment_sz); + remaining_bytes -= segment_sz; + test_data += segment_sz; + mbuf = mbuf->next; + } +}
app/test-crypto-perf/cperf_test_common.h +5 -0
@@ -21,4 +21,9 @@ cperf_alloc_common_memory(const struct cperf_options *options,uint32_t *dst_buf_offset, struct rte_mempool **pool); +void +cperf_mbuf_set (struct rte_mbuf *mbuf, +const struct cperf_options *options, +const struct cperf_test_vector *test_vector); +#endif /* _CPERF_TEST_COMMON_H_ */
app/test-crypto-perf/cperf_test_latency.c +6 -0
@@ -201,6 +201,12 @@ cperf_latency_test_runner(void *arg) ctx->test_vector, iv_offset, &imix_idx, &tsc_start); +/* Populate the mbuf with the test vector */ +for (i =0 ; i < burst_size; i++) +cperf_mbuf_set (ops[i]->sym->m_src, + ctx->options, + ctx->test_vector); + tsc_start =rte_rdtsc_precise ();#ifdef CPERF_LINEARIZATION_ENABLE
app/test-crypto-perf/cperf_test_verify.c +0 -36
@@ -195,42 +195,6 @@ cperf_verify_op(struct rte_crypto_op *op,return !!res; } -static void -cperf_mbuf_set (struct rte_mbuf *mbuf, -const struct cperf_options *options, -const struct cperf_test_vector *test_vector) -{ -uint32_t segment_sz = options->segment_sz; -uint8_t *mbuf_data; -uint8_t *test_data; -uint32_t remaining_bytes = options->max_buffer_size; - -if (options->op_type ==CPERF_AEAD ) { - test_data = (options->aead_op ==RTE_CRYPTO_AEAD_OP_ENCRYPT ) ? - test_vector->plaintext.data : - test_vector->ciphertext.data; - }else { - test_data = - (options->cipher_op ==RTE_CRYPTO_CIPHER_OP_ENCRYPT ) ? - test_vector->plaintext.data : - test_vector->ciphertext.data; - } - -while (remaining_bytes) { - mbuf_data = rte_pktmbuf_mtod(mbuf, uint8_t *); - -if (remaining_bytes <= segment_sz) { -memcpy (mbuf_data, test_data, remaining_bytes); -return ; - } - -memcpy (mbuf_data, test_data, segment_sz); - remaining_bytes -= segment_sz; - test_data += segment_sz; - mbuf = mbuf->next; - } -} -int cperf_verify_test_runner (void *test_ctx) {
Signature · 1 line
2.22.0
RE: [PATCH 1/2] app/crypto-perf: populate mbuf in latency test
Quoted 8 lines
Subject: [PATCH 1/2] app/crypto-perf: populate mbuf in latency test
For decrypt, ICV mismatch can come as data is dummy and latency will be calculated for error path. Hence populate mbuf with test vector data.
Signed-off-by Archana Muniganti <[email protected]>
RE: [PATCH 1/2] app/crypto-perf: populate mbuf in latency test
Quoted 9 lines
Quoted 8 lines
Subject: [PATCH 1/2] app/crypto-perf: populate mbuf in latency test
For decrypt, ICV mismatch can come as data is dummy and latency will be calculated for error path. Hence populate mbuf with test vector data.
Signed-off-by Archana Muniganti <[email protected]>Acked-by Akhil Goyal <[email protected]>
Series Applied to dpdk-next-crypto
Thanks.
PATCH 2/2 app/crypto-perf: add vector file for AES-GCM
In reply to Archana MunigantiAdded test vector file for AES-128-GCM for
64B and 512B length buffers.
--- app/test-crypto-perf/data/aes_gcm_128.data | 97 ++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 app/test-crypto-perf/data/aes_gcm_128.data
app/test-crypto-perf/data/aes_gcm_128.data new file +97 -0
@@ -0,0 +1,97 @@ +# List of tests for AES-128 GCM: +# 1) [aead_buff_64] +# 2) [aead_buff_512] + +########## +# GLOBAL # +########## +plaintext = +0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xa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9b, 0x75, 0xad, 0x5e, 0x33, +0xa5, 0x77, 0xda, 0xfb, 0x7e, 0x57, 0x20, 0x3d, 0xc5, 0xe8, 0x19, 0x3a, 0x92, 0x59, 0xfb, 0xc5, +0xff, 0x47, 0x49, 0x8e, 0xcb, 0x4f, 0x8e, 0x6c, 0xcd, 0x9f, 0x81, 0x27, 0xa4, 0xac, 0xaa, 0xe1, +0xd0, 0x6a, 0xb0, 0x96, 0x05, 0x68, 0x8e, 0xe8, 0x44, 0x63, 0x12, 0x2a, 0xef, 0x3d, 0xc3, 0xf9, +0xcf, 0xd6, 0x31, 0x04, 0x88, 0xbb, 0xfb, 0xe0, 0x44, 0xcc, 0xef, 0x10, 0xb7, 0xaf, 0x5e, 0x90, +0x07, 0x10, 0xd8, 0x85, 0x59, 0x99, 0x29, 0x2a, 0xa8, 0x83, 0x21, 0x8d, 0x5f, 0x02, 0xed, 0xa6, +0x22, 0xa5, 0x9e, 0x09, 0xa6, 0x52, 0x84, 0x88, 0xb8, 0x1f, 0x90, 0x70, 0xab, 0x2c, 0x2c, 0x45, +0x6f, 0xdc, 0xca, 0x38, 0x3a, 0x11, 0xd0, 0x27, 0x24, 0x09, 0xf8, 0xbf, 0xa2, 0x8f, 0xd3, 0x37, +0xb4, 0x08, 0x0a, 0x61, 0xb9, 0x77, 0x92, 0xbd, 0x49, 0x36, 0x67, 0xe7, 0xef, 0x81, 0x50, 0x7f, +0xbb, 0x23, 0x46, 0x4a, 0xb9, 0x34, 0x98, 0xa2, 0xb8, 0x52, 0x86, 0x0e, 0xbd, 0x6d, 0x11, 0x0a, +0x91, 0x5c, 0x6d, 0x68, 0xea, 0x05, 0x47, 0x93, 0x33, 0x09, 0x28, 0x8a, 0xe5, 0x2f, 0x10, 0x9f, +0xd9, 0xb8, 0x4c, 0x7c, 0x23, 0x8e, 0x08, 0x03, 0xe5, 0x8b, 0x07, 0xd9, 0x29, 0x52, 0x96, 0x98, +0xe6, 0x40, 0x55, 0x62, 0xf0, 0x89,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0x78, 0x3c, 0xcf, +0xdc, 0x4d, 0x7a, 0x85, 0x00, 0xf8, 0x2a, 0x5d, 0xb7, 0xdf, 0xdc, 0x47, 0xc9, 0x59, 0x8b, 0x5f, +0x67, 0x0f, 0x66, 0x50, 0x90, 0x1f, 0xd5, 0xac, 0x1a, 0x05, 0xea, 0x45, 0x76, 0xaf, 0xc3, 0x44, +0xe5, 0xc8, 0xb0, 0x22, 0x79, 0x24, 0x99, 0x5d, 0x4b, 0x02, 0x9b, 0x47, 0x26, 0xd7, 0xc3, 0x7e, +0x4c, 0x0d, 0xf1, 0xca, 0xac, 0xaa, 0x76, 0x78, 0x65, 0x8e, 0xd1, 0xac, 0x0a, 0xf3, 0x5a, 0x52, +0x9e, 0xd4, 0x6c, 0xd4, 0xd9, 0x94, 0x90, 0xc4, 0x63, 0x97, 0x39, 0x0b, 0xeb, 0xcd, 0xd5, 0x9d, +0x3a, 0x69, 0x0d, 0xf4, 0x8e, 0x30, 0xc7, 0xf7, 0x87, 0x23, 0xd5, 0x9f, 0x83, 0x87, 0xce, 0xe7, +0x07, 0xd6, 0x39, 0x67, 0xf0, 0x1f, 0xe0, 0xae, 0x78, 0x37, 0xd1, 0xea, 0x16, 0xc0, 0x4f, 0x47, +0xd2, 0x21, 0x2c, 0xc7, 0xc3, 0X94, 0xfc, 0x88, 0x8a, 0xd5, 0xd6, 0xee, 0xf6, 0xb1, 0x0f, 0x79 + +aead_key = +0xd9, 0x52, 0x98, 0x40, 0x20, 0x0e, 0x1c, 0x17, 0x72, 0x5a, 0xb5, 0x2c, 0x9c, 0x92, 0x76, 0x37 + +aead_iv = +0x6e, 0x9a, 0x63, 0x9d, 0x4a, 0xec, 0xc2, 0x55, 0x30, 0xa8, 0xad, 0x75 + +aad = +0x47, 0x2a, 0x6f, 0x4e, 0x77, 0x71, 0xca, 0x39, 0x1e, 0x42, 0x06, 0x50, 0x30, 0xdb, 0x3f, 0xf4 + +################# +# aead_buff_64 # +################# +[aead_buff_64] +digest = +0x4b, 0x84, 0x64, 0x63, 0x82, 0x0a, 0x4a, 0xb0, 0xea, 0xee, 0x50, 0x55, 0xea, 0x94, 0x9c, 0x08 + +################# +# aead_buff_512 # +################# +[aead_buff_512] +digest = +0x9a, 0x09, 0x0c, 0xdd, 0x42, 0x7f, 0xe1, 0x14, 0x9f, 0x09, 0x2c, 0x87, 0xbe, 0xf5, 0x93, 0x24
Signature · 1 line
2.22.0
RE: [PATCH 2/2] app/crypto-perf: add vector file for AES-GCM
Quoted 6 lines
Subject: [PATCH 2/2] app/crypto-perf: add vector file for AES-GCM
Added test vector file for AES-128-GCM for
64B and 512B length buffers.Signed-off-by Archana Muniganti <[email protected]>
From where are these vectors taken?
RE: [PATCH 2/2] app/crypto-perf: add vector file for AES-GCM
Hi Akhil,
Please see inline.
Thanks,
Archana
Quoted 9 lines
-----Original Message-----
From: Akhil Goyal <[email protected]>
Sent: Friday, April 29, 2022 11:31 AM
To: Archana Muniganti <[email protected]>; [email protected]; [email protected]
Cc: Archana Muniganti <[email protected]>; Anoob Joseph <[email protected]>; [email protected]
Subject: RE: [PATCH 2/2] app/crypto-perf: add vector file for AES-GCM
Quoted 7 lines
Quoted 6 lines
Subject: [PATCH 2/2] app/crypto-perf: add vector file for AES-GCM
Added test vector file for AES-128-GCM for 64B and 512B length buffers.
Signed-off-by Archana Muniganti <[email protected]>From where are these vectors taken?
[Archana] The test vectors are self generated from a fips complaint device.
Akhil Goyal
Acked-byRE: [PATCH 2/2] app/crypto-perf: add vector file for AES-GCM
Quoted 10 lines
Quoted 9 lines
Subject: RE: [PATCH 2/2] app/crypto-perf: add vector file for AES-GCM
Quoted 6 lines
Subject: [PATCH 2/2] app/crypto-perf: add vector file for AES-GCM
Added test vector file for AES-128-GCM for 64B and 512B length buffers.
Signed-off-by Archana Muniganti <[email protected]>From where are these vectors taken?
[Archana] The test vectors are self generated from a fips complaint device.
OK