[dpdk-dev] [PATCH 2/2] mbuf: reset nb_segs of chained packet
Ilya Matveychikov
matvejchikov at gmail.com
Thu Nov 16 15:05:35 CET 2017
Fixes: 139debc42dc0 ("mbuf: move chaining from ip_frag library")
Cc: simon.kagstrom at netinsight.net
Signed-off-by: Ilya V. Matveychikov <matvejchikov at gmail.com>
---
lib/librte_mbuf/rte_mbuf.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index ce8a05ddf..2126dc94b 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -1828,9 +1828,12 @@ static inline int rte_pktmbuf_chain(struct rte_mbuf *head, struct rte_mbuf *tail
head->nb_segs += tail->nb_segs;
head->pkt_len += tail->pkt_len;
- /* pkt_len is only set in the head */
+ /* nb_segs and pkt_len are only set in the head */
+ tail->nb_segs = 1;
tail->pkt_len = tail->data_len;
+ __rte_mbuf_sanity_check(head, 1);
+
return 0;
}
--
2.15.0
More information about the dev
mailing list