crypto/cnxk: predecrement esn value to be used in session
Checks
Commit Message
ESN provided in the session would be the next sequence number to be
used. Hence predecrement the value, so that in datapath, incremented
value will be as expected.
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
drivers/crypto/cnxk/cn9k_ipsec.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Comments
> ESN provided in the session would be the next sequence number to be
> used. Hence predecrement the value, so that in datapath, incremented
> value will be as expected.
>
> Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Applied to dpdk-next-crypto
Thanks.
@@ -41,7 +41,8 @@ cn9k_ipsec_outb_sa_create(struct cnxk_cpt_qp *qp,
/* Initialize lookaside IPsec private data */
sa->dir = RTE_SECURITY_IPSEC_SA_DIR_EGRESS;
- sa->esn = ipsec->esn.value;
+ if (ipsec->esn.value)
+ sa->esn = ipsec->esn.value - 1;
ret = cnxk_ipsec_outb_rlens_get(&sa->rlens, ipsec, crypto_xform);
if (ret)