numam-dpdk/lib/librte_latencystats
Reshma Pattan 77b7485af7 latency: 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")
Cc: stable@dpdk.org

Reported-by: Bao-Long Tran <longtb5@viettel.com.vn>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Tested-by: Bao-Long Tran <longtb5@viettel.com.vn>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2018-10-25 10:30:13 +02:00
..
Makefile ethdev: remove experimental flag of ports enumeration 2018-04-27 18:00:24 +01:00
meson.build ethdev: remove experimental flag of ports enumeration 2018-04-27 18:00:24 +01:00
rte_latencystats_version.map latency: added new library for latency stats 2017-04-05 18:00:42 +02:00
rte_latencystats.c latency: fix timestamp marking and latency calculation 2018-10-25 10:30:13 +02:00
rte_latencystats.h lib: use SPDX tag for Intel copyright files 2018-01-04 22:41:39 +01:00