app/crypto-perf: increase segment size for IPsec
authorGagandeep Singh <g.singh@nxp.com>
Wed, 17 Nov 2021 07:40:31 +0000 (13:10 +0530)
committerAkhil Goyal <gakhil@marvell.com>
Tue, 23 Nov 2021 19:48:04 +0000 (20:48 +0100)
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 depending on
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>
app/test-crypto-perf/cperf_options_parsing.c

index c244f81..59a9dc5 100644 (file)
@@ -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 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,