From: Ivan Malov Date: Fri, 24 May 2019 14:57:14 +0000 (+0300) Subject: net: fix encapsulation markers for inner L3 offset X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=6bf0912011eed76285a6acf2ddb9b126008b6339;p=dpdk.git net: fix encapsulation markers for inner L3 offset The API to prepare checksum offloads employs outer IP checksum flag to tell regular IPv4 packets from tunnel packets with outer IPv4 encapsulation. This flag cannot serve as a marker for the said purpose because a packet can have outer IPv4 encapsulation and may not have outer IP checksum offload request. Fix the API by changing the said criterion to test outer IPv4 flag rather than outer IP checksum flag. Use simpler spelling of the conditional expression. Fixes: 4fb7e803eb1a ("ethdev: add Tx preparation") Cc: stable@dpdk.org Signed-off-by: Ivan Malov Reviewed-by: Andrew Rybchenko Acked-by: Konstantin Ananyev --- diff --git a/lib/librte_net/rte_net.h b/lib/librte_net/rte_net.h index b83f8c13ad..461f2c81da 100644 --- a/lib/librte_net/rte_net.h +++ b/lib/librte_net/rte_net.h @@ -129,8 +129,7 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags) return 0; #endif - if ((ol_flags & PKT_TX_OUTER_IP_CKSUM) || - (ol_flags & PKT_TX_OUTER_IPV6)) + if (ol_flags & (PKT_TX_OUTER_IPV4 | PKT_TX_OUTER_IPV6)) inner_l3_offset += m->outer_l2_len + m->outer_l3_len; #ifdef RTE_LIBRTE_ETHDEV_DEBUG