[dpdk-dev] [PATCH v4 2/3] eal: add u64 bit variant for reciprocal

Stephen Hemminger stephen at networkplumber.org
Tue Sep 5 19:29:01 CEST 2017


On Tue,  5 Sep 2017 16:18:51 +0530
Pavan Nikhilesh <pbhagavatula at caviumnetworks.com> wrote:

> +/**
> + * Unsigned 32-bit divisor structure.
> + */
> +struct rte_reciprocal_u32 {
>  	uint32_t m;
>  	uint8_t sh1, sh2;
> -};
> +} __rte_cache_aligned;
> +
> +/**
> + * Unsigned 64-bit divisor structure.
> + */
> +struct rte_reciprocal_u64 {
> +	uint64_t m;
> +	uint8_t sh1;
> +} __rte_cache_aligned;

I understand you want to squeeze every cycle out but it is not
required that each of these structures always be cache aligned.

They maybe embedded in other structures and having the structure
padded so that these elements are cache aligned would take up
more space and make cache performance worse.

Better off to not put attributes on the structure definitions, and instead
let usages of this feature align where appropriate.



More information about the dev mailing list