[3/3] app/crypto-perf: add check for out-of-place case

Message ID 20190927080315.21981-1-hemant.agrawal@nxp.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series None |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-dpdk_compile_ovs success Compile Testing PASS
ci/iol-dpdk_compile success Compile Testing PASS
ci/iol-dpdk_compile_spdk success Compile Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS

Commit Message

Hemant Agrawal Sept. 27, 2019, 8:03 a.m. UTC
  Segmented frames not supported for out-of-place case.
This patch returns err if such config is requested.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 app/test-crypto-perf/cperf_options_parsing.c | 7 +++++++
 1 file changed, 7 insertions(+)
  

Comments

Akhil Goyal Oct. 4, 2019, 7:03 a.m. UTC | #1
> 
> Segmented frames not supported for out-of-place case.
> This patch returns err if such config is requested.
> 
> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> ---
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>

Applied to dpdk-next-crypto

Thanks.
  

Patch

diff --git a/app/test-crypto-perf/cperf_options_parsing.c b/app/test-crypto-perf/cperf_options_parsing.c
index 7a5aa06a6..eba4cf7a6 100644
--- a/app/test-crypto-perf/cperf_options_parsing.c
+++ b/app/test-crypto-perf/cperf_options_parsing.c
@@ -964,6 +964,13 @@  cperf_options_check(struct cperf_options *options)
 	if (options->op_type == CPERF_CIPHER_ONLY)
 		options->digest_sz = 0;
 
+	if (options->out_of_place &&
+			options->segment_sz <= options->max_buffer_size) {
+		RTE_LOG(ERR, USER1, "Out of place mode can only work "
+					"with non segmented buffers\n");
+		return -EINVAL;
+	}
+
 	/*
 	 * If segment size is not set, assume only one segment,
 	 * big enough to contain the largest buffer and the digest