From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailfilter03.viettel.com.vn (mailfilter03.viettel.com.vn [125.235.240.55]) by dpdk.org (Postfix) with ESMTP id 4B6571AFF for ; Mon, 24 Sep 2018 09:10:22 +0200 (CEST) X-IronPort-AV: E=Sophos;i="5.54,296,1534784400"; d="scan'208";a="96327078" Received: from 125.235.240.45.adsl.viettel.vn (HELO mta2.viettel.com.vn) ([125.235.240.45]) by mailfilter03.viettel.com.vn with ESMTP; 24 Sep 2018 14:10:20 +0700 Received: from localhost (localhost [127.0.0.1]) by mta2.viettel.com.vn (Postfix) with ESMTP id 34C9968D52B; Mon, 24 Sep 2018 14:10:14 +0700 (ICT) Received: from mta2.viettel.com.vn ([127.0.0.1]) by localhost (mta2.viettel.com.vn [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id Vz6Nlup-aYZw; Mon, 24 Sep 2018 14:10:14 +0700 (ICT) Received: from localhost (localhost [127.0.0.1]) by mta2.viettel.com.vn (Postfix) with ESMTP id 1509E68D4E0; Mon, 24 Sep 2018 14:10:14 +0700 (ICT) X-Virus-Scanned: amavisd-new at Received: from mta2.viettel.com.vn ([127.0.0.1]) by localhost (mta2.viettel.com.vn [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id r1pVHAnmdgJ4; Mon, 24 Sep 2018 14:10:14 +0700 (ICT) Received: from ANMLONGTB5 (unknown [27.68.241.28]) by mta2.viettel.com.vn (Postfix) with ESMTPSA id D2D3268D52B; Mon, 24 Sep 2018 14:10:13 +0700 (ICT) To: , , References: <1537545703-9599-1-git-send-email-reshma.pattan@intel.com> In-Reply-To: <1537545703-9599-1-git-send-email-reshma.pattan@intel.com> Message-ID: <000001d453d6$bcea85a0$36bf90e0$@viettel.com.vn> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQEZSjJHjKzSgdwHO1OVrBYHKtcySqZ1GHXA Content-Language: en-us MilterAction: FORWARD Date: Mon, 24 Sep 2018 14:10:14 +0700 (ICT) From: longtb5@viettel.com.vn Subject: Re: [dpdk-dev] [PATCH] latencystats: fix timestamp marking and latency calculation 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: Mon, 24 Sep 2018 07:10:24 -0000 > -----Original Message----- > From: reshma.pattan@intel.com [mailto:reshma.pattan@intel.com] > Sent: Friday, September 21, 2018 11:02 PM > To: longtb5@viettel.com.vn; konstantin.ananyev@intel.com; dev@dpdk.org > Cc: Reshma Pattan > Subject: [PATCH] latencystats: fix timestamp marking and latency calculation > > Latency calculation logic is not correct for the case where packets gets > dropped before TX. As for the dropped packets, the timestamp is not > cleared, and such packets still gets counted for latency calculation in next > runs, that will result in inaccurate latency measurement. > > So fix this issue as below, > > Before setting timestamp in mbuf, check mbuf don't have any prior valid > time stamp flag set and after marking the timestamp, set mbuf flags to > indicate timestamp is valid. > > Before calculating timestamp check mbuf flags are set to indicate timestamp > is valid. > > With the above logic it is guaranteed that correct timestamps have been > used. > > Fixes: 5cd3cac9ed ("latency: added new library for latency stats") > > Reported-by: Bao-Long Tran > Signed-off-by: Reshma Pattan Tested-by: Bao-Long Tran