From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ilya Matveychikov Subject: [PATCH 2/2] mbuf: reset nb_segs of chained packet Date: Thu, 16 Nov 2017 18:05:35 +0400 Message-ID: Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable To: dev@dpdk.org Return-path: Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by dpdk.org (Postfix) with ESMTP id 436CEDE3 for ; Thu, 16 Nov 2017 15:05:34 +0100 (CET) Received: by mail-wm0-f67.google.com with SMTP id l8so172424wmg.4 for ; Thu, 16 Nov 2017 06:05:34 -0800 (PST) Received: from [10.61.0.167] (bba193485.alshamil.net.ae. [217.165.96.191]) by smtp.gmail.com with ESMTPSA id p91sm1114874edp.69.2017.11.16.06.05.32 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Nov 2017 06:05:33 -0800 (PST) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Fixes: 139debc42dc0 ("mbuf: move chaining from ip_frag library") Cc: simon.kagstrom@netinsight.net Signed-off-by: Ilya V. Matveychikov --- 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 +=3D tail->nb_segs; head->pkt_len +=3D 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 =3D 1; tail->pkt_len =3D tail->data_len; + __rte_mbuf_sanity_check(head, 1); + return 0; } -- 2.15.0=