When updating an ingress session update the internal values before
making the virtual channel request.

Fixes: 6bc987ecb860 ("net/iavf: support IPsec inline crypto")
Cc: sta...@dpdk.org

Signed-off-by: Radu Nicolau <radu.nico...@intel.com>
---
 drivers/net/iavf/iavf_ipsec_crypto.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/iavf/iavf_ipsec_crypto.c 
b/drivers/net/iavf/iavf_ipsec_crypto.c
index 75f05ee558..1d465b4419 100644
--- a/drivers/net/iavf/iavf_ipsec_crypto.c
+++ b/drivers/net/iavf/iavf_ipsec_crypto.c
@@ -893,11 +893,12 @@ iavf_ipsec_crypto_session_update(void *device,
                 * iavf_security_session for outbound SA for use
                 * in *iavf_ipsec_crypto_pkt_metadata_set* function.
                 */
+               iavf_sess->esn.hi = conf->ipsec.esn.hi;
+               iavf_sess->esn.low = conf->ipsec.esn.low;
                if (iavf_sess->direction == RTE_SECURITY_IPSEC_SA_DIR_INGRESS)
                        rc = iavf_ipsec_crypto_sa_update_esn(adapter,
                                        iavf_sess);
-               else
-                       iavf_sess->esn.hi = conf->ipsec.esn.hi;
+
        }
 
        return rc;
-- 
2.25.1

Reply via email to