From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f65.google.com (mail-pg0-f65.google.com [74.125.83.65]) by dpdk.org (Postfix) with ESMTP id 0504F1B2A6 for ; Thu, 16 Nov 2017 18:01:59 +0100 (CET) Received: by mail-pg0-f65.google.com with SMTP id 207so18203413pgc.12 for ; Thu, 16 Nov 2017 09:01:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=h4lUsQAgbdunKrw0ATyJNXXAjn9MHT5bosRMca+wCjA=; b=vjQUGmaUFahWp6NSPDPJOOdmG0ubdElrO9e8JuML6OIboLXT42Is4ZWUKTN7pnbAHZ ag1EZszxPh6HkjA8e6CBOKWOlHWARj8QzcsuGQLvXB4YIuGCdGuegr/cwVVi1PSME/oX Fw7jHKYXSyIn5SoBLF8raIIvWfTVyGYrviL6hZOsLAJn4PTUQpHIv6mm5L/RPGMmYJUG kXZX14EH9RykscZNEmqVRuDO0HiIlXAZTNhVgyIDwe8+Iiq3mVtPcNaWVSsylHGIwTPB 3lwLEkVSuviaOdrQuNWmqMD2lkwANu0M3WO8I2pGCTg8MdGLxOYXLTfG21VAy4r2aLJX j+Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=h4lUsQAgbdunKrw0ATyJNXXAjn9MHT5bosRMca+wCjA=; b=rWDXdWIQ53+tDWlPlNIjd37p2CtfGzun06Fyr7sf8TCbLVDKNTekwCUiV4v6vtq+y7 wzGGYxAcjb5xsIwiZ7u3MJJVhcbzbN82q4egg5yV4q7tyTYHfW7T+l3zuLWJBVs8jYWV eA36f0YeaBTetvFO5aPmnY87gSQMBg3+KuLewmwGu9ereTJ0Xuo5jQ4z8DbxbrykAkTW 6uF2sHXZgFxErgAZPBnx/1dw4jLDaPkn5tJsNZoCJRh4l+RXktWhkOQP2MnXvR/G4deP iPQps1QlwGm/+qMiiQFX3/z7cONMwdRTJJVcE0/x9YvDv7bqouoXwQHorx6N9UF0Dbzo zqtg== X-Gm-Message-State: AJaThX4bBwhmwfosUVm4xUwlit3e0AcOEVFmplcFa8m5vxjvYXVepk5c vlP78JLhrSKFSataHAfLIZNjt+k3qSI= X-Google-Smtp-Source: AGs4zMa+/9pCGs9FDcTuAwQ136Jp+YExvX7MuzWsl5haYA0L7qhyJD7ejSXAHhFdaFFhBXr+bamHVg== X-Received: by 10.84.132.9 with SMTP id 9mr2332378ple.77.1510851719086; Thu, 16 Nov 2017 09:01:59 -0800 (PST) Received: from xeon-e3 (76-14-207-240.or.wavecable.com. [76.14.207.240]) by smtp.gmail.com with ESMTPSA id m69sm4231672pfc.27.2017.11.16.09.01.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 16 Nov 2017 09:01:58 -0800 (PST) Date: Thu, 16 Nov 2017 09:01:55 -0800 From: Stephen Hemminger To: Ilya Matveychikov Cc: dev@dpdk.org Message-ID: <20171116090155.31419fe3@xeon-e3> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [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 17:02:00 -0000 On Thu, 16 Nov 2017 18:05:35 +0400 Ilya Matveychikov wrote: > 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 += 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; > } My understanding is that nb_segs and pkt_len are only valid in head. For other packets in the chain nb_segs and pkt_len can be anything.