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

Pavan Nikhilesh Bhagavatula pbhagavatula at caviumnetworks.com
Wed Sep 6 06:32:45 CEST 2017


On Tue, Sep 05, 2017 at 10:29:01AM -0700, Stephen Hemminger wrote:
> 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.
>

Agreed, will remove cache alignment in the next version (v6).

Thanks,
Pavan.


More information about the dev mailing list