[2/3] app/crypto-perf: fix invalid SPI

Message ID 20230102114655.300-2-anoobj@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series [1/3] app/crypto-perf: use right API to free session |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Anoob Joseph Jan. 2, 2023, 11:46 a.m. UTC
  As per IPsec specification (RFC 4303) SPI zero is reserved. Using
lcore_id directly would mean SPI 0 would also be attempted. This may
lead to failure on an otherwise compliant implementation.

Fixes: 28dde5da503e ("app/crypto-perf: support lookaside IPsec")

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
 app/test-crypto-perf/cperf_ops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c
index 61a3967697..4a1c9feb1c 100644
--- a/app/test-crypto-perf/cperf_ops.c
+++ b/app/test-crypto-perf/cperf_ops.c
@@ -722,7 +722,7 @@  create_ipsec_session(struct rte_mempool *sess_mp,
 		.action_type = RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL,
 		.protocol = RTE_SECURITY_PROTOCOL_IPSEC,
 		{.ipsec = {
-			.spi = rte_lcore_id(),
+			.spi = rte_lcore_id() + 1,
 			/**< For testing sake, lcore_id is taken as SPI so that
 			 * for every core a different session is created.
 			 */