From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by dpdk.org (Postfix) with ESMTP id 1C0F84C95; Thu, 25 Oct 2018 10:31:44 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 9ED3B12C9; Thu, 25 Oct 2018 04:31:42 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 25 Oct 2018 04:31:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=mW52sHV8yAvXCpe0AEDQxaEFKPRyPbVRLKbgOcUunog=; b=ZI/8BSBQ0ivP w8GNPWXu0dXQkCVD1xKp8a1DQB8j7LFbgbvDdBktIz2gzBuhA063LMVSphxuvtem Cpdj1nyQaj3TYw6j5/tZzoSW/pwLKoYf9mf8Bvy0+rmN196jO2wh8Bt2jaMlKb6I olSptaXOwvLNFfMGF61YHY3CcfoFUxY= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=mW52sHV8yAvXCpe0AEDQxaEFKPRyPbVRLKbgOcUun og=; b=krH8qhe0klM7EVsM6R3ddCCeiEMkndsg18KxwDwFv0+w92PMjqjg0qW7V vz53hMz4gSZ+zVtHdtSimkxRq7zuIBbHO7HDJl8OfJJT04lFGei6cXVxEsZhRE/Z A7u4Iu7KrjWL6ebm12Mw9QV764iUfIiCCCkG1O2FEXi9wkUaiQ3LjE+6n7a3804G W2/yUhy2KWzMkk7Mx18H1ZqNCTAilLpi2kR6ahbgqFt7ITeaN9IO6GhdYVyosSCb b5vmaMQcS3AW/bMJe+tCBAcxiLo0QdGhwED8m5qXlk/Cw6h3NMD1hlH6E1xVPpWX x5+CFU6cxSDqTr3U8jRWUDpfQK7gw== X-ME-Sender: X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id E6E2E102ED; Thu, 25 Oct 2018 04:31:39 -0400 (EDT) From: Thomas Monjalon To: Reshma Pattan Cc: dev@dpdk.org, longtb5@viettel.com.vn, konstantin.ananyev@intel.com, stable@dpdk.org Date: Thu, 25 Oct 2018 10:31:43 +0200 Message-ID: <38519281.CEthSRxIAY@xps> In-Reply-To: <1537887086-19960-1-git-send-email-reshma.pattan@intel.com> 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-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v3] 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: Thu, 25 Oct 2018 08:31:44 -0000 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