From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 23136A0552; Mon, 27 Jun 2022 10:12:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 06E60400D7; Mon, 27 Jun 2022 10:12:41 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 90958400D5 for ; Mon, 27 Jun 2022 10:12:39 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25QNSaxf004328 for ; Mon, 27 Jun 2022 01:12:38 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=SWgFaEi9ikHdhlsOP7Dqev7xzLAKQ8vQ+7zL5Ebw1J4=; b=UtQmwTOBmZs0SN/sBxx5rwyY/5qfLh5S0FwwgwYkFqnk/p9gkefbyUDLlrZJWbAsUT4L auuCDNAqoxM8mMCWqkv2DdFD9KFJMlMbQT62uzus+EFuQ2oWgAdTyQCzqs/1ruj3onXF tMjVPyj39VcG8uOAC/+hiH1urt9o1UXQC1Nrc59xeXDLcFtJ5B7nqZuHKRp7VoLxIGKL J69ZBTwCAp/IC9PjPJ2xk+5n0epV3DCjAbf0OvhMZMPd78FZwZSfSKQ+VWjfjRsM2UcL fiLDYDbymVT+mtz46Yv9Wr1I4FImlqmT+FLIui/n7ZhK+Q7BWNyv5rj1HyJTj9efBMIV ag== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3gwyqqdyky-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Mon, 27 Jun 2022 01:12:38 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 27 Jun 2022 01:12:37 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 27 Jun 2022 01:12:37 -0700 Received: from HY-LT1002.marvell.com (HY-LT1002.marvell.com [10.28.176.218]) by maili.marvell.com (Postfix) with ESMTP id 194E73F70B9; Mon, 27 Jun 2022 01:12:34 -0700 (PDT) From: Anoob Joseph To: Akhil Goyal , Jerin Jacob CC: Tejasree Kondoj , , Ankur Dwivedi Subject: [PATCH] crypto/cnxk: predecrement esn value to be used in session Date: Mon, 27 Jun 2022 13:42:33 +0530 Message-ID: <20220627081233.409-1-anoobj@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: n8BVJeF-oau9F1VyfTqlK5-vfF5B2rSE X-Proofpoint-ORIG-GUID: n8BVJeF-oau9F1VyfTqlK5-vfF5B2rSE X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-06-27_06,2022-06-24_01,2022-06-22_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- drivers/crypto/cnxk/cn9k_ipsec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/cnxk/cn9k_ipsec.c b/drivers/crypto/cnxk/cn9k_ipsec.c index cb9cf174a4..6d26b0cc01 100644 --- a/drivers/crypto/cnxk/cn9k_ipsec.c +++ b/drivers/crypto/cnxk/cn9k_ipsec.c @@ -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) -- 2.25.1