From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=m214baDJUD2T4aLPJb9bmzSPcwjLhmt92W+5mZoF6Os=; b=KlFaDC1VD0BaWOahQ4tMcg8m2TXlXTcUk+K0Carlo1j6TmiTuGmBaqlF2YZ59LcECS ScJUviYEG03k6Gkx50t6phmdh85F1oO368hzTzn+hLnF0EJBKI4P53+rDco116t1tsaI WR543wuTP7wxm9yba9hPM54qpbFWebB/JCMIUW0vyqoHaC71Ju1X5BiTHZaIbgc9Q5qg rJvdbVJFCBD2UnzO0sYfv60de6T4ji87PmQV1coO7XvnrOKRlPpjFVPDcrGOgtPDQGd6 5qfnlZb03EUzz5ETKOUx0K3l3vN3GZvM+iVjtK0rtlgnTB11ey2t88tH3US2NdFbd6nU rrKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:to; bh=m214baDJUD2T4aLPJb9bmzSPcwjLhmt92W+5mZoF6Os=; b=CAJ4HSrfRs6ET8cK65NWJbFQ5EcUJ5wpMihkTtXf95dqeJ3KxEiIMG69BtkHXdfakR QZiBJqtsm1xXHDDDJA2yM14F4gwOAQERxHy7e46Gicei2KQtLNGI64R7j8zbmfEnpQ3m KhY94GAxIr+0t6qsvuV2/AWhwsruJl2hudD/OeaY8SN/2lB+I2m1hjnkK6Q4/a0PH5mO uzFPjRwG6oKygECXgx/08uSnxBPI7GK7uVrjZG+gnSETu7eqPAFbpCjkLnUBQRbPwIbw sBQioNyE3pNevXjKDv2V6tAkAOUHBigtam3AmREpXjp42hljTysbkZuoORJx4Q7yPBjI jDaA== X-Gm-Message-State: AJaThX5k7zET+n2p15OFgm60Fz/nVBXeumLNtq5WQzk5xAN/53CxkXHP dC6Jh/9P3AiJZmddY3C5oAQaY/XB X-Google-Smtp-Source: AGs4zMYZD4C63zDijRdnV85BmRusRnSzbk4hPcgTeHB9cKVEpi8D9cV11MG9xvQAHg8aNdlnwQ4B9w== X-Received: by 10.80.192.130 with SMTP id k2mr2866484edf.293.1510841133781; Thu, 16 Nov 2017 06:05:33 -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) From: Ilya Matveychikov Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Message-Id: Date: Thu, 16 Nov 2017 18:05:35 +0400 To: dev@dpdk.org X-Mailer: Apple Mail (2.3273) Subject: [dpdk-dev] [PATCH 2/2] mbuf: reset nb_segs of chained packet X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Nov 2017 14:05:34 -0000 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=