[dpdk-dev] [RFC PATCH v2 2/3] lib: add bitrate statistics library

Stephen Hemminger stephen at networkplumber.org
Fri Oct 28 03:12:20 CEST 2016


On Fri, 28 Oct 2016 09:04:30 +0800
Remy Horton <remy.horton at intel.com> wrote:

> +
> +struct rte_stats_bitrate_s {
> +	uint64_t last_ibytes;
> +	uint64_t last_obytes;
> +	uint64_t peak_ibits;
> +	uint64_t peak_obits;
> +	uint64_t ewma_ibits;
> +	uint64_t ewma_obits;
> +};
> +

Reader/write access of 64 bit values is not safe on 32 bit platforms.
I think you need to add a generation counter (see Linux kernel syncp)
to handle 32 bit architecture. If done correctly, it would be a nop
on 64 bit platforms.



More information about the dev mailing list