Re: [dpdk-dev] [PATCH 2/2] ring: empty optimization

2020-07-01 Thread David Marchand
On Tue, May 19, 2020 at 6:02 PM Morten Brørup wrote: > > Blank line after declarations? > > > > Are the temporary variable even needed? > > Personally, I agree with you, but I was trying to match the existing coding > style of the closely related rte_ring_count() function - only to avoid this >

Re: [dpdk-dev] [PATCH 2/2] ring: empty optimization

2020-05-22 Thread Ananyev, Konstantin
> > Testing if the ring is empty is as simple as comparing the producer and > consumer pointers. > > In theory, this optimization reduces the number of potential cache misses > from 3 to 2 by not having to read r->mask in rte_ring_count(). > > The modification of this function were also discusse

Re: [dpdk-dev] [PATCH 2/2] ring: empty optimization

2020-05-19 Thread Morten Brørup
> From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Stephen Hemminger > Sent: Tuesday, May 19, 2020 5:52 PM > > On Tue, 19 May 2020 15:27:25 + > Morten Brørup wrote: > > > diff --git a/lib/librte_ring/rte_ring.h b/lib/librte_ring/rte_ring.h > > index 9078e7c24..f67141482 100644 > > --- a/

Re: [dpdk-dev] [PATCH 2/2] ring: empty optimization

2020-05-19 Thread Stephen Hemminger
On Tue, 19 May 2020 15:27:25 + Morten Brørup wrote: > diff --git a/lib/librte_ring/rte_ring.h b/lib/librte_ring/rte_ring.h > index 9078e7c24..f67141482 100644 > --- a/lib/librte_ring/rte_ring.h > +++ b/lib/librte_ring/rte_ring.h > @@ -733,7 +733,9 @@ rte_ring_full(const struct rte_ring *r) >