Re: [lng-odp] [PATCH 03/10] linux-gen: ring: created common ring implementation

2016-10-21 Thread Savolainen, Petri (Nokia - FI/Espoo)
> -Original Message- > From: Mike Holmes [mailto:mike.hol...@linaro.org] > Sent: Thursday, October 20, 2016 9:17 PM > To: Savolainen, Petri (Nokia - FI/Espoo) labs.com> > Cc: Yi He ; Maxim Uvarov ; lng- > odp > Subject: Re: [lng-odp] [PATCH 03/10] linux-gen: r

Re: [lng-odp] [PATCH 03/10] linux-gen: ring: created common ring implementation

2016-10-20 Thread Mike Holmes
On 20 October 2016 at 08:12, Savolainen, Petri (Nokia - FI/Espoo) wrote: >> >> >> I tested this piece of code, while en-queuing, below ring full condition >> cannot prevent overwriting, take an example, in case not any reader, >> r_tail >> will always be zero, and new_head is keeping increment, th

Re: [lng-odp] [PATCH 03/10] linux-gen: ring: created common ring implementation

2016-10-20 Thread Savolainen, Petri (Nokia - FI/Espoo)
> > > I tested this piece of code, while en-queuing, below ring full condition > cannot prevent overwriting, take an example, in case not any reader, > r_tail > will always be zero, and new_head is keeping increment, this condition is > always false. > odp_atomic_load_acq_u32(&ring->r_tail) =

Re: [lng-odp] [PATCH 03/10] linux-gen: ring: created common ring implementation

2016-10-20 Thread Savolainen, Petri (Nokia - FI/Espoo)
> > +/* Enqueue data into the ring tail */ > > +static inline void ring_enq(ring_t *ring, uint32_t mask, uint32_t data) > > +{ > > + uint32_t old_head, new_head; > > + > > + /* Reserve a slot in the ring for writing */ > > + old_head = odp_atomic_fetch_inc_u32(&ring->w_head); > > + new_hea

Re: [lng-odp] [PATCH 03/10] linux-gen: ring: created common ring implementation

2016-10-19 Thread Yi He
On 19 October 2016 at 20:57, Maxim Uvarov wrote: > On 10/19/16 15:09, Petri Savolainen wrote: > >> Moved scheduler ring code into a new header file, so that >> it can be used also in other parts of the implementation. >> >> Signed-off-by: Petri Savolainen >> --- >> platform/linux-generic/Makef

Re: [lng-odp] [PATCH 03/10] linux-gen: ring: created common ring implementation

2016-10-19 Thread Maxim Uvarov
On 10/19/16 15:09, Petri Savolainen wrote: Moved scheduler ring code into a new header file, so that it can be used also in other parts of the implementation. Signed-off-by: Petri Savolainen --- platform/linux-generic/Makefile.am | 1 + platform/linux-generic/include/odp_ri

[lng-odp] [PATCH 03/10] linux-gen: ring: created common ring implementation

2016-10-19 Thread Petri Savolainen
Moved scheduler ring code into a new header file, so that it can be used also in other parts of the implementation. Signed-off-by: Petri Savolainen --- platform/linux-generic/Makefile.am | 1 + platform/linux-generic/include/odp_ring_internal.h | 109 + plat