Re: [PATCH v9] eal: add seqlock

2022-06-07 Thread David Marchand
On Mon, May 23, 2022 at 4:24 PM Mattias Rönnblom wrote: > > A sequence lock (seqlock) is a synchronization primitive which allows > for data-race free, low-overhead, high-frequency reads, suitable for > data structures shared across many cores and which are updated > relatively infrequently. > > A

Re: [PATCH v9] eal: add seqlock

2022-06-01 Thread Mattias Rönnblom
On 2022-06-01 18:15, Stephen Hemminger wrote: > On Wed, 1 Jun 2022 08:19:54 + > Mattias Rönnblom wrote: > >> On 2022-06-01 00:45, Stephen Hemminger wrote: >>> On Mon, 23 May 2022 16:23:46 +0200 >>> Mattias Rönnblom wrote: >>> +/** + * The RTE seqcount type. + */ +type

Re: [PATCH v9] eal: add seqlock

2022-06-01 Thread Stephen Hemminger
On Wed, 1 Jun 2022 08:19:54 + Mattias Rönnblom wrote: > On 2022-06-01 00:45, Stephen Hemminger wrote: > > On Mon, 23 May 2022 16:23:46 +0200 > > Mattias Rönnblom wrote: > > > >> +/** > >> + * The RTE seqcount type. > >> + */ > >> +typedef struct { > >> + uint32_t sn; /**< A sequence numb

RE: [PATCH v9] eal: add seqlock

2022-06-01 Thread Morten Brørup
> From: Mattias Rönnblom [mailto:mattias.ronnb...@ericsson.com] > Sent: Wednesday, 1 June 2022 11.02 > > On 2022-05-31 13:52, David Marchand wrote: > > On Mon, May 23, 2022 at 4:24 PM Mattias Rönnblom > > wrote: > >> > >> A sequence lock (seqlock) is a synchronization primitive which > allows > >

Re: [PATCH v9] eal: add seqlock

2022-06-01 Thread Mattias Rönnblom
On 2022-05-31 13:52, David Marchand wrote: > On Mon, May 23, 2022 at 4:24 PM Mattias Rönnblom > wrote: >> >> A sequence lock (seqlock) is a synchronization primitive which allows >> for data-race free, low-overhead, high-frequency reads, suitable for >> data structures shared across many cores and

Re: [PATCH v9] eal: add seqlock

2022-06-01 Thread Mattias Rönnblom
On 2022-06-01 00:45, Stephen Hemminger wrote: > On Mon, 23 May 2022 16:23:46 +0200 > Mattias Rönnblom wrote: > >> +/** >> + * The RTE seqcount type. >> + */ >> +typedef struct { >> +uint32_t sn; /**< A sequence number for the protected data. */ >> +} rte_seqcount_t; > > Don't need structure

RE: [PATCH v9] eal: add seqlock

2022-05-31 Thread Morten Brørup
> From: Stephen Hemminger [mailto:step...@networkplumber.org] > Sent: Wednesday, 1 June 2022 00.46 > > On Mon, 23 May 2022 16:23:46 +0200 > Mattias Rönnblom wrote: > > > +/** > > + * The RTE seqcount type. > > + */ > > +typedef struct { > > + uint32_t sn; /**< A sequence number for the protect

RE: [PATCH v9] eal: add seqlock

2022-05-31 Thread Honnappa Nagarahalli
> > On Mon, 23 May 2022 16:23:46 +0200 > Mattias Rönnblom wrote: > > > + > > + /* make sure the data loads happens before the sn load */ > > + rte_atomic_thread_fence(__ATOMIC_ACQUIRE); > > Why mix __atomic builtin with rte_atomic? > Instead: > __atomic_thread_fence(__ATOMIC_ACQUI

Re: [PATCH v9] eal: add seqlock

2022-05-31 Thread Stephen Hemminger
On Mon, 23 May 2022 16:23:46 +0200 Mattias Rönnblom wrote: > + > + /* make sure the data loads happens before the sn load */ > + rte_atomic_thread_fence(__ATOMIC_ACQUIRE); Why mix __atomic builtin with rte_atomic? Instead: __atomic_thread_fence(__ATOMIC_ACQUIRE);

Re: [PATCH v9] eal: add seqlock

2022-05-31 Thread Stephen Hemminger
On Mon, 23 May 2022 16:23:46 +0200 Mattias Rönnblom wrote: > +/** > + * The RTE seqcount type. > + */ > +typedef struct { > + uint32_t sn; /**< A sequence number for the protected data. */ > +} rte_seqcount_t; Don't need structure for only one element. typedef uint32_t rte_seqcount_t; +

Re: [PATCH v9] eal: add seqlock

2022-05-31 Thread David Marchand
On Mon, May 23, 2022 at 4:24 PM Mattias Rönnblom wrote: > > A sequence lock (seqlock) is a synchronization primitive which allows > for data-race free, low-overhead, high-frequency reads, suitable for > data structures shared across many cores and which are updated > relatively infrequently. > > A

[PATCH v9] eal: add seqlock

2022-05-23 Thread Mattias Rönnblom
A sequence lock (seqlock) is a synchronization primitive which allows for data-race free, low-overhead, high-frequency reads, suitable for data structures shared across many cores and which are updated relatively infrequently. A seqlock permits multiple parallel readers. A spinlock is used to seri