From aeace07394c03a48e83f6dd9c63aa17660b4bf33 Mon Sep 17 00:00:00 2001 From: Yi Yang Date: Mon, 4 Jun 2018 14:04:09 +0800 Subject: [PATCH] Fix a segment fault error for DPDK 17.02 I found a segment fault error when I use DPDK 17.02 branch, here is segment fault information: Program terminated with signal SIGSEGV, Segmentation fault. 702 __builtin_ia32_storedqu ((char *)__P, (__v16qi)__B); (gdb) bt at build/production/vrouter/dpdk/x86_64-native-linuxapp-gcc/include/rte_memcpy.h:820 at build/production/vrouter/dpdk/x86_64-native-linuxapp-gcc/include/rte_memcpy.h:896 at vrouter/dpdk/vr_dpdk_host.c:793 at vrouter/dp-core/vr_proto_ip.c:373 (gdb) We encountered it in DPDK 17.11 branch, the issue is rte_mbuf can't be freed if it is copied or cloned from another rtm_mbuf with IND_ATTACHED_MBUF flag, it will result in very weird issues. Change-Id: Iae6d229488225a97ef2f96c52db1dbcaaa32b51a Closes-Bug: #1774903 Signed-off-by: Yi Yang (cherry picked from commit e866729fec6315bb4d62ccc2c3e891f4566644fa) --- dpdk/vr_dpdk_host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dpdk/vr_dpdk_host.c b/dpdk/vr_dpdk_host.c index d4b5c59cb..2233c2326 100644 --- a/dpdk/vr_dpdk_host.c +++ b/dpdk/vr_dpdk_host.c @@ -246,7 +246,7 @@ dpdk_pktmbuf_data_copy(struct rte_mbuf *dst, struct rte_mbuf *src) dst->data_off = src->data_off; dst->port = src->port; dst->ol_flags = src->ol_flags; -#if (RTE_VERSION >= RTE_VERSION_NUM(17, 11, 0, 0)) +#ifdef IND_ATTACHED_MBUF dst->ol_flags &= (~IND_ATTACHED_MBUF); #endif dst->packet_type = src->packet_type;