Layer 2 length must be updated after the prepend to mbuf to keep
the length right to be used by other Tx offloads.
If the packet has tunnel encapsulation, outer_l2_len should be
updated. Otherwise l2_len should be updated.
Fixes:
c974021a5949 ("ether: add soft vlan encap/decap")
Cc: stable@dpdk.org
Signed-off-by: Dilshod Urazov <dilshod.urazov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
(*m)->ol_flags &= ~(PKT_RX_VLAN_STRIPPED | PKT_TX_VLAN);
+ if ((*m)->ol_flags & PKT_TX_TUNNEL_MASK)
+ (*m)->outer_l2_len += sizeof(struct rte_vlan_hdr);
+ else
+ (*m)->l2_len += sizeof(struct rte_vlan_hdr);
+
return 0;
}