[dpdk-dev] [PATCH] latencystats: fix timestamp marking and latency calculation

longtb5 at viettel.com.vn longtb5 at viettel.com.vn
Mon Sep 24 09:10:14 CEST 2018


> -----Original Message-----
> From: reshma.pattan at intel.com [mailto:reshma.pattan at intel.com]
> Sent: Friday, September 21, 2018 11:02 PM
> To: longtb5 at viettel.com.vn; konstantin.ananyev at intel.com; dev at dpdk.org
> Cc: Reshma Pattan <reshma.pattan at intel.com>
> 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 <longtb5 at viettel.com.vn>
> Signed-off-by: Reshma Pattan <reshma.pattan at intel.com>

Tested-by: Bao-Long Tran <longtb5 at viettel.com.vn>



More information about the dev mailing list