From: Dilshod Urazov Date: Mon, 24 Jun 2019 13:46:02 +0000 (+0100) Subject: net: adjust L2 length on soft VLAN insertion X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=42caa11b370e17bdbba498766b0fbad0975d8fa9;p=dpdk.git net: adjust L2 length on soft VLAN insertion 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 Signed-off-by: Andrew Rybchenko Acked-by: Olivier Matz --- diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h index 8ac1afecc8..8a040abf56 100644 --- a/lib/librte_net/rte_ether.h +++ b/lib/librte_net/rte_ether.h @@ -405,6 +405,11 @@ static inline int rte_vlan_insert(struct rte_mbuf **m) (*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; }