[v3] app/test-crypto-perf: fix segment size for IPsec operation
Checks
Commit Message
Application calculates segment size based on buffer size plus
digest size only, But if the operation mode is IPsec then
packet length can be increased by some more bytes depends upon
the algorithm.
In this patch, increasing segment size with RTE_PKTMBUF_HEADROOM
when there is no user given segment size.
Fixes: 28dde5da503e ("app/crypto-perf: support lookaside IPsec")
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
---
v2-change-log:
Update commit message with fixline.
v3-change-log:
increasing the segment sizeby headroom size instead of
an algo specific max overhead value.
app/test-crypto-perf/cperf_options_parsing.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
Comments
> Application calculates segment size based on buffer size plus
> digest size only, But if the operation mode is IPsec then
> packet length can be increased by some more bytes depends upon
> the algorithm.
>
> In this patch, increasing segment size with RTE_PKTMBUF_HEADROOM
> when there is no user given segment size.
>
> Fixes: 28dde5da503e ("app/crypto-perf: support lookaside IPsec")
>
> Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Applied to dpdk-next-crypto
Thanks.
@@ -1132,9 +1132,17 @@ cperf_options_check(struct cperf_options *options)
* If segment size is not set, assume only one segment,
* big enough to contain the largest buffer and the digest
*/
- if (options->segment_sz == 0)
+ if (options->segment_sz == 0) {
options->segment_sz = options->max_buffer_size +
options->digest_sz;
+ /* In IPsec operation, packet length will be increased
+ * by some bytes depend upon the algorithm, so increasing
+ * the segment size by headroom to cover the most of
+ * the scenarios.
+ */
+ if (options->op_type == CPERF_IPSEC)
+ options->segment_sz += RTE_PKTMBUF_HEADROOM;
+ }
if (options->segment_sz < options->digest_sz) {
RTE_LOG(ERR, USER1,