}
}
- 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);
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;
+ }
+}
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_ */
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
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)
{