DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
To: declan.doherty@intel.com, akhil.goyal@nxp.com
Cc: dev@dpdk.org, Pablo de Lara <pablo.de.lara.guarch@intel.com>
Subject: [dpdk-dev] [PATCH v3 5/7] app/crypto-perf: do not populate the mbufs at init
Date: Fri, 22 Sep 2017 08:55:17 +0100	[thread overview]
Message-ID: <20170922075519.28342-6-pablo.de.lara.guarch@intel.com> (raw)
In-Reply-To: <20170922075519.28342-1-pablo.de.lara.guarch@intel.com>

For throughput and latency tests, it is not required
to populate the mbufs with any test vector.
For verify test, there is already a function that rewrites
the mbufs every time they are going to be used with
crypto operations.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 app/test-crypto-perf/cperf_test_latency.c        | 31 +++++++-----------------
 app/test-crypto-perf/cperf_test_pmd_cyclecount.c | 31 +++++++-----------------
 app/test-crypto-perf/cperf_test_throughput.c     | 31 +++++++-----------------
 app/test-crypto-perf/cperf_test_verify.c         | 31 +++++++-----------------
 4 files changed, 36 insertions(+), 88 deletions(-)

diff --git a/app/test-crypto-perf/cperf_test_latency.c b/app/test-crypto-perf/cperf_test_latency.c
index 7b9dc9f..acd8545 100644
--- a/app/test-crypto-perf/cperf_test_latency.c
+++ b/app/test-crypto-perf/cperf_test_latency.c
@@ -118,15 +118,10 @@ static struct rte_mbuf *
 cperf_mbuf_create(struct rte_mempool *mempool,
 		uint32_t segment_sz,
 		uint16_t segments_nb,
-		const struct cperf_options *options,
-		const struct cperf_test_vector *test_vector)
+		const struct cperf_options *options)
 {
 	struct rte_mbuf *mbuf;
 	uint8_t *mbuf_data;
-	uint8_t *test_data =
-			(options->cipher_op == RTE_CRYPTO_CIPHER_OP_ENCRYPT) ?
-					test_vector->plaintext.data :
-					test_vector->ciphertext.data;
 	uint32_t remaining_bytes = options->max_buffer_size;
 
 	mbuf = rte_pktmbuf_alloc(mempool);
@@ -137,15 +132,11 @@ cperf_mbuf_create(struct rte_mempool *mempool,
 	if (mbuf_data == NULL)
 		goto error;
 
-	if (options->max_buffer_size <= segment_sz) {
-		memcpy(mbuf_data, test_data, options->max_buffer_size);
-		test_data += options->max_buffer_size;
+	if (options->max_buffer_size <= segment_sz)
 		remaining_bytes = 0;
-	} else {
-		memcpy(mbuf_data, test_data, segment_sz);
-		test_data += segment_sz;
+	else
 		remaining_bytes -= segment_sz;
-	}
+
 	segments_nb--;
 
 	while (remaining_bytes) {
@@ -161,15 +152,11 @@ cperf_mbuf_create(struct rte_mempool *mempool,
 		if (mbuf_data == NULL)
 			goto error;
 
-		if (remaining_bytes <= segment_sz) {
-			memcpy(mbuf_data, test_data, remaining_bytes);
+		if (remaining_bytes <= segment_sz)
 			remaining_bytes = 0;
-			test_data += remaining_bytes;
-		} else {
-			memcpy(mbuf_data, test_data, segment_sz);
+		else
 			remaining_bytes -= segment_sz;
-			test_data += segment_sz;
-		}
+
 		segments_nb--;
 	}
 
@@ -257,7 +244,7 @@ cperf_latency_test_constructor(struct rte_mempool *sess_mp,
 				ctx->pkt_mbuf_pool_in,
 				options->segment_sz,
 				segments_nb,
-				options, test_vector);
+				options);
 		if (ctx->mbufs_in[mbuf_idx] == NULL)
 			goto err;
 	}
@@ -286,7 +273,7 @@ cperf_latency_test_constructor(struct rte_mempool *sess_mp,
 		if (options->out_of_place == 1)	{
 			ctx->mbufs_out[mbuf_idx] = cperf_mbuf_create(
 					ctx->pkt_mbuf_pool_out, max_size,
-					1, options, test_vector);
+					1, options);
 			if (ctx->mbufs_out[mbuf_idx] == NULL)
 				goto err;
 		} else {
diff --git a/app/test-crypto-perf/cperf_test_pmd_cyclecount.c b/app/test-crypto-perf/cperf_test_pmd_cyclecount.c
index 872124f..962dc69 100644
--- a/app/test-crypto-perf/cperf_test_pmd_cyclecount.c
+++ b/app/test-crypto-perf/cperf_test_pmd_cyclecount.c
@@ -135,15 +135,10 @@ cperf_pmd_cyclecount_test_free(struct cperf_pmd_cyclecount_ctx *ctx,
 static struct rte_mbuf *
 cperf_mbuf_create(struct rte_mempool *mempool,
 		uint32_t segment_sz, uint16_t segments_nb,
-		const struct cperf_options *options,
-		const struct cperf_test_vector *test_vector)
+		const struct cperf_options *options)
 {
 	struct rte_mbuf *mbuf;
 	uint8_t *mbuf_data;
-	uint8_t *test_data =
-			(options->cipher_op == RTE_CRYPTO_CIPHER_OP_ENCRYPT) ?
-			test_vector->plaintext.data :
-			test_vector->ciphertext.data;
 	uint32_t remaining_bytes = options->max_buffer_size;
 
 	mbuf = rte_pktmbuf_alloc(mempool);
@@ -154,15 +149,11 @@ cperf_mbuf_create(struct rte_mempool *mempool,
 	if (mbuf_data == NULL)
 		goto error;
 
-	if (options->max_buffer_size <= segment_sz) {
-		memcpy(mbuf_data, test_data, options->max_buffer_size);
-		test_data += options->max_buffer_size;
+	if (options->max_buffer_size <= segment_sz)
 		remaining_bytes = 0;
-	} else {
-		memcpy(mbuf_data, test_data, segment_sz);
-		test_data += segment_sz;
+	else
 		remaining_bytes -= segment_sz;
-	}
+
 	segments_nb--;
 
 	while (remaining_bytes) {
@@ -178,15 +169,11 @@ cperf_mbuf_create(struct rte_mempool *mempool,
 		if (mbuf_data == NULL)
 			goto error;
 
-		if (remaining_bytes <= segment_sz) {
-			memcpy(mbuf_data, test_data, remaining_bytes);
+		if (remaining_bytes <= segment_sz)
 			remaining_bytes = 0;
-			test_data += remaining_bytes;
-		} else {
-			memcpy(mbuf_data, test_data, segment_sz);
+		else
 			remaining_bytes -= segment_sz;
-			test_data += segment_sz;
-		}
+
 		segments_nb--;
 	}
 
@@ -274,7 +261,7 @@ cperf_pmd_cyclecount_test_constructor(struct rte_mempool *sess_mp,
 				ctx->pkt_mbuf_pool_in,
 				options->segment_sz,
 				segments_nb,
-				options, test_vector);
+				options);
 		if (ctx->mbufs_in[mbuf_idx] == NULL)
 			goto err;
 	}
@@ -299,7 +286,7 @@ cperf_pmd_cyclecount_test_constructor(struct rte_mempool *sess_mp,
 		if (options->out_of_place == 1) {
 			ctx->mbufs_out[mbuf_idx] = cperf_mbuf_create(
 					ctx->pkt_mbuf_pool_out, max_size,
-					1, options, test_vector);
+					1, options);
 			if (ctx->mbufs_out[mbuf_idx] == NULL)
 				goto err;
 		} else {
diff --git a/app/test-crypto-perf/cperf_test_throughput.c b/app/test-crypto-perf/cperf_test_throughput.c
index fcb82a8..e4da0d5 100644
--- a/app/test-crypto-perf/cperf_test_throughput.c
+++ b/app/test-crypto-perf/cperf_test_throughput.c
@@ -102,15 +102,10 @@ static struct rte_mbuf *
 cperf_mbuf_create(struct rte_mempool *mempool,
 		uint32_t segment_sz,
 		uint16_t segments_nb,
-		const struct cperf_options *options,
-		const struct cperf_test_vector *test_vector)
+		const struct cperf_options *options)
 {
 	struct rte_mbuf *mbuf;
 	uint8_t *mbuf_data;
-	uint8_t *test_data =
-			(options->cipher_op == RTE_CRYPTO_CIPHER_OP_ENCRYPT) ?
-					test_vector->plaintext.data :
-					test_vector->ciphertext.data;
 	uint32_t remaining_bytes = options->max_buffer_size;
 
 	mbuf = rte_pktmbuf_alloc(mempool);
@@ -121,15 +116,11 @@ cperf_mbuf_create(struct rte_mempool *mempool,
 	if (mbuf_data == NULL)
 		goto error;
 
-	if (options->max_buffer_size <= segment_sz) {
-		memcpy(mbuf_data, test_data, options->max_buffer_size);
-		test_data += options->max_buffer_size;
+	if (options->max_buffer_size <= segment_sz)
 		remaining_bytes = 0;
-	} else {
-		memcpy(mbuf_data, test_data, segment_sz);
-		test_data += segment_sz;
+	else
 		remaining_bytes -= segment_sz;
-	}
+
 	segments_nb--;
 
 	while (remaining_bytes) {
@@ -145,15 +136,11 @@ cperf_mbuf_create(struct rte_mempool *mempool,
 		if (mbuf_data == NULL)
 			goto error;
 
-		if (remaining_bytes <= segment_sz) {
-			memcpy(mbuf_data, test_data, remaining_bytes);
+		if (remaining_bytes <= segment_sz)
 			remaining_bytes = 0;
-			test_data += remaining_bytes;
-		} else {
-			memcpy(mbuf_data, test_data, segment_sz);
+		else
 			remaining_bytes -= segment_sz;
-			test_data += segment_sz;
-		}
+
 		segments_nb--;
 	}
 
@@ -239,7 +226,7 @@ cperf_throughput_test_constructor(struct rte_mempool *sess_mp,
 				ctx->pkt_mbuf_pool_in,
 				options->segment_sz,
 				segments_nb,
-				options, test_vector);
+				options);
 		if (ctx->mbufs_in[mbuf_idx] == NULL)
 			goto err;
 	}
@@ -267,7 +254,7 @@ cperf_throughput_test_constructor(struct rte_mempool *sess_mp,
 		if (options->out_of_place == 1)	{
 			ctx->mbufs_out[mbuf_idx] = cperf_mbuf_create(
 					ctx->pkt_mbuf_pool_out, max_size,
-					1, options, test_vector);
+					1, options);
 			if (ctx->mbufs_out[mbuf_idx] == NULL)
 				goto err;
 		} else {
diff --git a/app/test-crypto-perf/cperf_test_verify.c b/app/test-crypto-perf/cperf_test_verify.c
index dbfa661..3159361 100644
--- a/app/test-crypto-perf/cperf_test_verify.c
+++ b/app/test-crypto-perf/cperf_test_verify.c
@@ -106,15 +106,10 @@ static struct rte_mbuf *
 cperf_mbuf_create(struct rte_mempool *mempool,
 		uint32_t segment_sz,
 		uint16_t segments_nb,
-		const struct cperf_options *options,
-		const struct cperf_test_vector *test_vector)
+		const struct cperf_options *options)
 {
 	struct rte_mbuf *mbuf;
 	uint8_t *mbuf_data;
-	uint8_t *test_data =
-			(options->cipher_op == RTE_CRYPTO_CIPHER_OP_ENCRYPT) ?
-					test_vector->plaintext.data :
-					test_vector->ciphertext.data;
 	uint32_t remaining_bytes = options->max_buffer_size;
 
 	mbuf = rte_pktmbuf_alloc(mempool);
@@ -125,15 +120,11 @@ cperf_mbuf_create(struct rte_mempool *mempool,
 	if (mbuf_data == NULL)
 		goto error;
 
-	if (options->max_buffer_size <= segment_sz) {
-		memcpy(mbuf_data, test_data, options->max_buffer_size);
-		test_data += options->max_buffer_size;
+	if (options->max_buffer_size <= segment_sz)
 		remaining_bytes = 0;
-	} else {
-		memcpy(mbuf_data, test_data, segment_sz);
-		test_data += segment_sz;
+	else
 		remaining_bytes -= segment_sz;
-	}
+
 	segments_nb--;
 
 	while (remaining_bytes) {
@@ -149,15 +140,11 @@ cperf_mbuf_create(struct rte_mempool *mempool,
 		if (mbuf_data == NULL)
 			goto error;
 
-		if (remaining_bytes <= segment_sz) {
-			memcpy(mbuf_data, test_data, remaining_bytes);
+		if (remaining_bytes <= segment_sz)
 			remaining_bytes = 0;
-			test_data += remaining_bytes;
-		} else {
-			memcpy(mbuf_data, test_data, segment_sz);
+		else
 			remaining_bytes -= segment_sz;
-			test_data += segment_sz;
-		}
+
 		segments_nb--;
 	}
 
@@ -271,7 +258,7 @@ cperf_verify_test_constructor(struct rte_mempool *sess_mp,
 				ctx->pkt_mbuf_pool_in,
 				options->segment_sz,
 				segments_nb,
-				options, test_vector);
+				options);
 		if (ctx->mbufs_in[mbuf_idx] == NULL)
 			goto err;
 	}
@@ -299,7 +286,7 @@ cperf_verify_test_constructor(struct rte_mempool *sess_mp,
 		if (options->out_of_place == 1)	{
 			ctx->mbufs_out[mbuf_idx] = cperf_mbuf_create(
 					ctx->pkt_mbuf_pool_out, max_size,
-					1, options, test_vector);
+					1, options);
 			if (ctx->mbufs_out[mbuf_idx] == NULL)
 				goto err;
 		} else {
-- 
2.9.4

  parent reply	other threads:[~2017-09-22 15:55 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-18  8:05 [dpdk-dev] [PATCH 0/6] Crypto-perf app improvements Pablo de Lara
2017-08-18  8:05 ` [dpdk-dev] [PATCH 1/6] app/crypto-perf: set AAD after the crypto operation Pablo de Lara
2017-08-18  8:05 ` [dpdk-dev] [PATCH 2/6] app/crypto-perf: parse AEAD data from vectors Pablo de Lara
2017-08-18  8:05 ` [dpdk-dev] [PATCH 3/6] app/crypto-perf: parse segment size Pablo de Lara
2017-08-18  8:05 ` [dpdk-dev] [PATCH 4/6] app/crypto-perf: overwrite mbuf when verifying Pablo de Lara
2017-08-18  8:05 ` [dpdk-dev] [PATCH 5/6] app/crypto-perf: do not populate the mbufs at init Pablo de Lara
2017-08-18  8:05 ` [dpdk-dev] [PATCH 6/6] app/crypto-perf: use single mempool Pablo de Lara
2017-08-30  8:30   ` Akhil Goyal
     [not found]     ` <9F7182E3F746AB4EA17801C148F3C60433039119@IRSMSX101.ger.corp.intel.com>
2017-09-11 11:08       ` De Lara Guarch, Pablo
2017-09-11 13:10         ` Shreyansh Jain
2017-09-11 13:56           ` De Lara Guarch, Pablo
2017-09-04 13:08 ` [dpdk-dev] [PATCH 0/6] Crypto-perf app improvements Zhang, Roy Fan
2017-09-13  7:20 ` [dpdk-dev] [PATCH v2 0/7] " Pablo de Lara
2017-09-13  7:20   ` [dpdk-dev] [PATCH v2 1/7] app/crypto-perf: set AAD after the crypto operation Pablo de Lara
2017-09-13  7:20   ` [dpdk-dev] [PATCH v2 2/7] app/crypto-perf: parse AEAD data from vectors Pablo de Lara
2017-09-13  7:20   ` [dpdk-dev] [PATCH v2 3/7] app/crypto-perf: parse segment size Pablo de Lara
2017-09-13  7:20   ` [dpdk-dev] [PATCH v2 4/7] app/crypto-perf: overwrite mbuf when verifying Pablo de Lara
2017-09-13  7:20   ` [dpdk-dev] [PATCH v2 5/7] app/crypto-perf: do not populate the mbufs at init Pablo de Lara
2017-09-22  7:55   ` [dpdk-dev] [PATCH v3 0/7] Crypto-perf app improvements Pablo de Lara
2017-09-22  7:55     ` [dpdk-dev] [PATCH v3 1/7] app/crypto-perf: set AAD after the crypto operation Pablo de Lara
2017-09-22  7:55     ` [dpdk-dev] [PATCH v3 2/7] app/crypto-perf: parse AEAD data from vectors Pablo de Lara
2017-09-22  7:55     ` [dpdk-dev] [PATCH v3 3/7] app/crypto-perf: parse segment size Pablo de Lara
2017-09-22  7:55     ` [dpdk-dev] [PATCH v3 4/7] app/crypto-perf: overwrite mbuf when verifying Pablo de Lara
2017-09-22  7:55     ` Pablo de Lara [this message]
2017-09-22  7:55     ` [dpdk-dev] [PATCH v3 6/7] app/crypto-perf: support multiple queue pairs Pablo de Lara
2017-09-26  8:42       ` Akhil Goyal
2017-10-04 10:25         ` De Lara Guarch, Pablo
2017-09-22  7:55     ` [dpdk-dev] [PATCH v3 7/7] app/crypto-perf: use single mempool Pablo de Lara
2017-09-26  9:21       ` Akhil Goyal
2017-10-04  7:47         ` De Lara Guarch, Pablo
2017-10-04  3:46     ` [dpdk-dev] [PATCH v4 0/8] Crypto-perf app improvements Pablo de Lara
2017-10-04  3:46       ` [dpdk-dev] [PATCH v4 1/8] app/crypto-perf: refactor common test code Pablo de Lara
2017-10-04  3:46       ` [dpdk-dev] [PATCH v4 2/8] app/crypto-perf: set AAD after the crypto operation Pablo de Lara
2017-10-04  3:46       ` [dpdk-dev] [PATCH v4 3/8] app/crypto-perf: parse AEAD data from vectors Pablo de Lara
2017-10-04  3:46       ` [dpdk-dev] [PATCH v4 4/8] app/crypto-perf: parse segment size Pablo de Lara
2017-10-04  3:46       ` [dpdk-dev] [PATCH v4 5/8] app/crypto-perf: overwrite mbuf when verifying Pablo de Lara
2017-10-04  3:46       ` [dpdk-dev] [PATCH v4 6/8] app/crypto-perf: do not populate the mbufs at init Pablo de Lara
2017-10-04  3:46       ` [dpdk-dev] [PATCH v4 7/8] app/crypto-perf: support multiple queue pairs Pablo de Lara
2017-10-04  3:46       ` [dpdk-dev] [PATCH v4 8/8] app/crypto-perf: use single mempool Pablo de Lara
2017-10-06 11:57       ` [dpdk-dev] [PATCH v4 0/8] Crypto-perf app improvements Akhil Goyal
2017-10-06 12:50       ` De Lara Guarch, Pablo
2017-09-13  7:22 ` [dpdk-dev] [PATCH v2 0/7] " Pablo de Lara
2017-09-13  7:22   ` [dpdk-dev] [PATCH v2 1/7] app/crypto-perf: set AAD after the crypto operation Pablo de Lara
2017-09-13  7:22   ` [dpdk-dev] [PATCH v2 2/7] app/crypto-perf: parse AEAD data from vectors Pablo de Lara
2017-09-13  7:22   ` [dpdk-dev] [PATCH v2 3/7] app/crypto-perf: parse segment size Pablo de Lara
2017-09-13  7:22   ` [dpdk-dev] [PATCH v2 4/7] app/crypto-perf: overwrite mbuf when verifying Pablo de Lara
2017-09-13  7:22   ` [dpdk-dev] [PATCH v2 5/7] app/crypto-perf: do not populate the mbufs at init Pablo de Lara
2017-09-13  7:22   ` [dpdk-dev] [PATCH v2 6/7] app/crypto-perf: support multiple queue pairs Pablo de Lara
2017-09-13  7:22   ` [dpdk-dev] [PATCH v2 7/7] app/crypto-perf: use single mempool Pablo de Lara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170922075519.28342-6-pablo.de.lara.guarch@intel.com \
    --to=pablo.de.lara.guarch@intel.com \
    --cc=akhil.goyal@nxp.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).