On Tue,  5 Sep 2017 16:18:51 +0530
Pavan Nikhilesh <pbhagavat...@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.

Reply via email to