- /* Release the anti replay window */
- if (priv->ipsec.dir == RTE_SECURITY_IPSEC_SA_DIR_INGRESS)
- otx2_eth_sec_free_anti_replay(sess_ip->in_sa);
+ if (priv->ipsec.dir == RTE_SECURITY_IPSEC_SA_DIR_INGRESS) {
+ rte_spinlock_lock(&dev->ipsec_tbl_lock);
+ sa = sess_ip->in_sa;
+
+ /* Release the anti replay window */
+ otx2_eth_sec_free_anti_replay(sa);
+
+ /* Clear SA table entry */
+ if (sa != NULL) {
+ sa->ctl.valid = 0;
+ rte_io_wmb();
+ }
+
+ rte_spinlock_unlock(&dev->ipsec_tbl_lock);
+ }