On 6/9/26 12:47 PM, Ales Musil via dev wrote:
> Add a Single-Producer, Single-Consumer lock-free ring buffer
> to lib/ for use as a building block in removing pinctrl_mutex
> contention from packet-in processing.
> 
> The ring buffer uses a pre-allocated array with atomic read
> and write indices for synchronization.  Data is copied in
> and out by value (memcpy), making it well suited for small,
> fixed-size structs.  Capacity must be a power of two; the
> implementation uses unsigned 32-bit wraparound arithmetic
> for correct index handling.
> 
> Provide SPSC_RING_INIT() for compile-time capacity checking
> and SPSC_RING_FOR_EACH_POP() for idiomatic drain loops.
> 
> Include unit tests covering basic push/pop, FIFO ordering,
> full ring behavior, index wraparound, the FOR_EACH_POP
> macro, and multi-field struct elements.

Hi, Ales.  Thanks for the patch!  Not a full review, but I wonder why
a new data structure is needed here.  Is the existing mpsc-queue not
sufficient?  It is a bit more general, but serves the same purpose more
or less.

Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to