[dpdk-stable] [PATCH] latency: clear mbuf timestamp after latency calculation

Luca Boccassi bluca at debian.org
Tue Sep 25 14:37:43 CEST 2018


On Wed, 2018-09-19 at 15:15 +0700, longtb5 at viettel.com.vn wrote:
> The timestamp of a mbuf should be cleared after that mbuf was used
> for
> latency calculation, otherwise future packets which reuse the same
> mbuf
> would inherit that previous timestamp. The latencystats library looks
> for mbuf with non-zero timestamp, thus incorrectly inherited value
> would
> result in incorrect latency measurement.
> 
> Cc: stable at dpdk.org
> 
> Signed-off-by: Bao-Long Tran <longtb5 at viettel.com.vn>
> ---
>  lib/librte_latencystats/rte_latencystats.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/librte_latencystats/rte_latencystats.c
> b/lib/librte_latencystats/rte_latencystats.c
> index 1fdec68..2d5384e 100644
> --- a/lib/librte_latencystats/rte_latencystats.c
> +++ b/lib/librte_latencystats/rte_latencystats.c
> @@ -156,8 +156,10 @@ calc_latency(uint16_t pid __rte_unused,
>  
>  	now = rte_rdtsc();
>  	for (i = 0; i < nb_pkts; i++) {
> -		if (pkts[i]->timestamp)
> +		if (pkts[i]->timestamp) {
>  			latency[cnt++] = now - pkts[i]->timestamp;
> +			pkts[i]->timestamp = 0;
> +		}
>  	}
>  
>  	for (i = 0; i < cnt; i++) {

Hi,

Is this patch only for stable releases? If so, which one? Or was dev@
absent by mistake?

Thanks

-- 
Kind regards,
Luca Boccassi


More information about the stable mailing list