On Mon, 1 Jun 2026 18:18:18 +0000
Konstantin Ananyev <[email protected]> wrote:

> > +   /* check that we have enough room in ring */
> > +   if (unlikely(n > *entries))
> > +           n = (behavior == RTE_RING_QUEUE_FIXED) ? 0 : *entries;
> > +
> > +   if (n > 0) {
> > +           *new_head = *old_head + n;
> > +           d->head = *new_head;  
> 
> There is a bit of inconsistency with the 'load' operation above:
> If we use atomic_load(&d->head. ...) then it would be better to use
> atomic_store(&d->head,..., order_relaxed) here.

This is single thread case, so not sure atomic_store is needed.
The old code didn't do it.

There is a little confusion in the ST path.
It is used in two different context SP and SC.

For move_head, it is SC that matters and consumer moves the head;
BUT if using multiple produces MP the tail is also examined to
determine space.

Reply via email to