From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v3] latencystats: fix timestamp marking and latency calculation Date: Thu, 25 Oct 2018 10:31:43 +0200 Message-ID: <38519281.CEthSRxIAY@xps> References: <1537545703-9599-1-git-send-email-reshma.pattan@intel.com> <1537887086-19960-1-git-send-email-reshma.pattan@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, longtb5@viettel.com.vn, konstantin.ananyev@intel.com, stable@dpdk.org To: Reshma Pattan Return-path: In-Reply-To: <1537887086-19960-1-git-send-email-reshma.pattan@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 25/09/2018 16:51, Reshma Pattan: > 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") > > CC: stable@dpdk.org > > Reported-by: Bao-Long Tran > Signed-off-by: Reshma Pattan > Tested-by: Bao-Long Tran > Acked-by: Konstantin Ananyev > > --- > v3: style related fix > v2: remove check for mbuf->timestamp > --- Applied, thanks