- sym_cop->cipher.iv.data = iv;
- sym_cop->cipher.iv.phys_addr = rte_pktmbuf_mtophys_offset(m,
- ip_hdr_len + sizeof(struct esp_hdr));
+ /* Copy IV at the end of crypto operation */
+ rte_memcpy(iv_ptr, iv, sa->iv_len);
+ sym_cop->cipher.iv.data = iv_ptr;
+ sym_cop->cipher.iv.phys_addr =
+ rte_crypto_op_ctophys_offset(cop, IV_OFFSET);