[10/11] crypto/dpaa2_sec: initialize esp sequence number

Message ID 20240703102649.3096530-11-g.singh@nxp.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series DPAA and DPAA2 crypto specific fixes |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Gagandeep Singh July 3, 2024, 10:26 a.m. UTC
Initialize the sequence number of ESP to 1.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
---
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 5 +++++
 1 file changed, 5 insertions(+)
  

Patch

diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index e115007cfd..eed66d721f 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -3143,6 +3143,11 @@  dpaa2_sec_set_ipsec_session(struct rte_cryptodev *dev,
 
 		if (ipsec_xform->options.iv_gen_disable == 0)
 			encap_pdb.options |= PDBOPTS_ESP_IVSRC;
+		/* Initializing the sequence number to 1, Security
+		 * engine will choose this sequence number for first packet
+		 * Refer: RFC4303 section: 3.3.3.Sequence Number Generation
+		 */
+		encap_pdb.seq_num = 1;
 		if (ipsec_xform->options.esn) {
 			encap_pdb.options |= PDBOPTS_ESP_ESN;
 			encap_pdb.seq_num_ext_hi = conf->ipsec.esn.hi;