sess_priv.roundup_byte = rlens->roundup_byte;
sess_priv.roundup_len = rlens->roundup_len;
sess_priv.partial_len = rlens->partial_len;
+ sess_priv.mode = outb_sa->w2.s.ipsec_mode;
+ sess_priv.outer_ip_ver = outb_sa->w2.s.outer_ip_ver;
/* Pointer from eth_sec -> outb_sa */
eth_sec->sa = outb_sa;
cmd23 = vsetq_lane_u64((uintptr_t)m | 1, cmd23, 1);
dptr += l2_len;
+
+ if (sess_priv.mode == ROC_IE_SA_MODE_TUNNEL) {
+ if (sess_priv.outer_ip_ver == ROC_IE_SA_IP_VERSION_4)
+ *((uint16_t *)(dptr - 2)) =
+ rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4);
+ else
+ *((uint16_t *)(dptr - 2)) =
+ rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6);
+ }
+
ucode_cmd[1] = dptr;
ucode_cmd[2] = dptr;
cmd23 = vsetq_lane_u64((uintptr_t)m | 1, cmd23, 1);
dptr += l2_len;
+
+ if (sess_priv.mode == ROC_IE_SA_MODE_TUNNEL) {
+ if (sess_priv.outer_ip_ver == ROC_IE_SA_IP_VERSION_4)
+ *((uint16_t *)(dptr - 2)) =
+ rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4);
+ else
+ *((uint16_t *)(dptr - 2)) =
+ rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6);
+ }
ucode_cmd[1] = dptr;
ucode_cmd[2] = dptr;