app/crypto-perf: increase segment size for IPsec

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: 28dde5da50 ("app/crypto-perf: support lookaside IPsec")

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
This commit is contained in:
Gagandeep Singh 2021-11-17 13:10:31 +05:30 committed by Akhil Goyal
parent 02363e1f2c
commit 8e3c55386f

View 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,