From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id ED3A3A49 for ; Fri, 21 Sep 2018 16:58:45 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Sep 2018 07:58:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,285,1534834800"; d="scan'208";a="75155904" Received: from irsmsx101.ger.corp.intel.com ([163.33.3.153]) by orsmga008.jf.intel.com with ESMTP; 21 Sep 2018 07:58:44 -0700 Received: from irsmsx109.ger.corp.intel.com ([169.254.13.156]) by IRSMSX101.ger.corp.intel.com ([169.254.1.40]) with mapi id 14.03.0319.002; Fri, 21 Sep 2018 15:58:43 +0100 From: "Pattan, Reshma" To: "Ananyev, Konstantin" , "longtb5@viettel.com.vn" CC: "dev@dpdk.org" Thread-Topic: Incorrect latencystats implementation Thread-Index: AQHUT/E39/whJiLATkuTiCuR+qc2OqT5JRqAgADHUQCAAJXUQIAAFmCAgAA+U8A= Date: Fri, 21 Sep 2018 14:58:42 +0000 Message-ID: <3AEA2BF9852C6F48A459DA490692831F2A39D993@IRSMSX109.ger.corp.intel.com> References: <1537345496-70207-1-git-send-email-longtb5@viettel.com.vn> <3AEA2BF9852C6F48A459DA490692831F2A39B32D@IRSMSX109.ger.corp.intel.com> <000001d4514f$9f77ecd0$de67c670$@viettel.com.vn> <3AEA2BF9852C6F48A459DA490692831F2A39D6A8@IRSMSX109.ger.corp.intel.com> <2601191342CEEE43887BDE71AB977258EA9598D6@irsmsx105.ger.corp.intel.com> In-Reply-To: <2601191342CEEE43887BDE71AB977258EA9598D6@irsmsx105.ger.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] Incorrect latencystats implementation 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: Fri, 21 Sep 2018 14:58:46 -0000 Hi, > -----Original Message----- > From: Ananyev, Konstantin > Sent: Friday, September 21, 2018 1:14 PM > To: Pattan, Reshma ; longtb5@viettel.com.vn > Cc: dev@dpdk.org > Subject: RE: Incorrect latencystats implementation >=20 > Hi Reshma, >=20 > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Pattan, Reshma > > Sent: Friday, September 21, 2018 12:15 PM > > To: longtb5@viettel.com.vn > > Cc: dev@dpdk.org > > Subject: Re: [dpdk-dev] Incorrect latencystats implementation > > > > Hi, > > > > > -----Original Message----- > > > From: longtb5@viettel.com.vn [mailto:longtb5@viettel.com.vn] > > > Sent: Friday, September 21, 2018 2:58 AM > > > To: Pattan, Reshma > > > Cc: dev@dpdk.org > > > Subject: RE: Incorrect latencystats implementation > > > > > > Hi Reshma, > > > > > > > -----Original Message----- > > > > From: reshma.pattan@intel.com [mailto:reshma.pattan@intel.com] > > > > Sent: Thursday, September 20, 2018 8:09 PM > > > > To: longtb5@viettel.com.vn > > > > Cc: dev@dpdk.org > > > > Subject: RE: Incorrect latencystats implementation > > > > > > > > > > > > > > > > > -----Original Message----- > > > > > From: longtb5@viettel.com.vn [mailto:longtb5@viettel.com.vn] > > > > > Sent: Wednesday, September 19, 2018 9:17 AM > > > > > To: Pattan, Reshma > > > > > Cc: dev@dpdk.org; Bao-Long Tran > > > > > Subject: Incorrect latencystats implementation > > > > > > > > > > > > > > > I have submit a patch to implement the trivial fix. For the drop > > > > > case I can think of 2 options. We can either clear timestamp > > > > > when putting mbufs back to their pool, or change lib > > > > > latencystats implementation to perform packet selection at TX > > > > > callback and let RX callback add > > > timestamp > > > > to every packet. > > > > > Both option could affect performance but I think the second > > > > > option is less aggressive. > > > > > > > > What happens when applications drop the packets? Do they free the > mbuf? > > > > In such case, can application set the timestamp to 0 before > > > > freeing the > > > mbuf, > > > > instead of making these changes in latency library.? > > > > > > > > > > Yes, applications can set the mbuf timestamp before freeing. But in > > > my opinion that would not be a clean solution. Applications should > > > not have to worry about the timestamp field at all, since that is an > > > implementation detail of the library. For simple apps, wrapping > > > rte_pktmbuf_free() to perform timestamp reset could be done without > > > much hassle, but that kind of ad-hoc solution would become messy for > > > more complex ones where packets are dropped at different places. > > > From a usability point of view, as an user I want the lib to provide > > > latency measurements without me having to touch existing codebase > other than adding codes that use the APIs. > > > > > > > I will send a patch to add timestamp reset in rte_pktmbuf_free(). Tha= t will > be a cleaner way I think. > > Let's see what other says on the patch. >=20 > That would probably affect performance. > Actually, looking at rte_mbuf.h - timestamp field supposed to be valid on= ly if > PKT_RX_TIMESTAMP is set. > From other side, as I remember, PMD RX routine should reset RX flags of t= he > received PMD. > So in theory you can rely on PKT_RX_TIMESTAMP to determine use this mbuf > for latency calcs or not. > Would that help? Yes this will work. Thanks for the suggestion. Let me have a further look a= nd send the patch.