From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by dpdk.org (Postfix) with ESMTP id EB0B51B2E7 for ; Thu, 16 Nov 2017 20:15:18 +0100 (CET) Received: by mail-wm0-f66.google.com with SMTP id z3so2267336wme.3 for ; Thu, 16 Nov 2017 11:15:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=8zXlAxOpuHkjZ5stwG0Kca9ENnKa6bgh94NPbaPoayU=; b=Ro4fpAw6fsmC/JE3INhybeYzC+zybCxvcsC1DwTg8r58vFw8mZruRYyGcIUBQ7UGY/ gnl0SljUcTOxkChx77GLZG6FD3YgO7YiPnyCatdRZRNRnL0o61/ZqtcVuYy/fFNtn7Or 4pT27H4g3vIVec1jU0oBCtSuKnHg3ONcuCFVpHMZ3j8Dvc76LwE1vmMaBe8PJGrTPT18 mnYLroYpvgRY6xuHtuKtE2eqEyKEatNxIwhR+/5Xm1TVUlIrPjbsP9zCeXbvWURLXntR oTdlOAwBKvRa7ICp4sPmGqHkroyRfpeCZgBxTqHd0h3Pw9iqWJpn3tA/HKxWAZcoxLBj XQEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=8zXlAxOpuHkjZ5stwG0Kca9ENnKa6bgh94NPbaPoayU=; b=KnFk+gKNj2tOqreFEGWyPCoDpnloaVqcvsRHpCpFQmKOO1QhSx1l3AMI+L9noTugcc Vb5m6u4KbJBE82xpO/DBf6LNFKXFczjHtE5RTVt81Alr4cBeqx2UufWfLEQFf+rLsvLf RxkIb29bSwp4hKeQ7hK6vyD8SkhDlgn0fO/h20fazEbW+uvnTAdkIQQVateJzIjfJVY+ ZndtDDbSY0ZLRHwMS+tvhoiQyueKhpDA9D8G/GG3BP3cdzkkyPJBjDppvqGCJ6gLLf6T 6Pi3q9dfCwgyUZwTQIMrErI5cHiLvnOtM23wlTImUET9lr27jSKwKa+XbMh6qspAbxwi cdig== X-Gm-Message-State: AJaThX7RytEqfadzc9Dg5uigY9Ggg01AWdgGavwe+hD6p65ULr/Nhjgl vGD5/ADX47sr/7Y1cvbru6quXkP3 X-Google-Smtp-Source: AGs4zMaMRwXOPBpTldw/9gYNnci/mc5p7Vw3pqQqJkeWjaA4s0u3sgqT13y/Iamiz3K2k5cswelwRQ== X-Received: by 10.28.56.5 with SMTP id f5mr2358199wma.159.1510859718441; Thu, 16 Nov 2017 11:15:18 -0800 (PST) Received: from [192.168.1.145] ([94.205.75.192]) by smtp.gmail.com with ESMTPSA id v5sm1188209wme.26.2017.11.16.11.15.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Nov 2017 11:15:17 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) From: Ilya Matveychikov In-Reply-To: <20171116090155.31419fe3@xeon-e3> Date: Thu, 16 Nov 2017 23:15:18 +0400 Cc: dev@dpdk.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <20171116090155.31419fe3@xeon-e3> To: Stephen Hemminger X-Mailer: Apple Mail (2.3273) 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 19:15:19 -0000 > On Nov 16, 2017, at 9:01 PM, Stephen Hemminger = wrote: >=20 > On Thu, 16 Nov 2017 18:05:35 +0400 > Ilya Matveychikov wrote: >=20 >> Fixes: 139debc42dc0 ("mbuf: move chaining from ip_frag library") >> Cc: simon.kagstrom@netinsight.net >>=20 >> Signed-off-by: Ilya V. Matveychikov >> --- >> lib/librte_mbuf/rte_mbuf.h | 5 ++++- >> 1 file changed, 4 insertions(+), 1 deletion(-) >>=20 >> 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; >>=20 >> - /* 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; >>=20 >> + __rte_mbuf_sanity_check(head, 1); >> + >> return 0; >> } >=20 > 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. So why not to keep them in consistency with multi-seg logic? I mean that pkt_len/nb_segs for the head always have meaning but for the rest of chain pkt_len is the same as data_len and nb_segs :=3D 1