[PATCH] eal: add seqlock

Morten Brørup mb at smartsharesystems.com
Wed Mar 30 12:50:42 CEST 2022


> From: Mattias Rönnblom [mailto:mattias.ronnblom at ericsson.com]
> Sent: Wednesday, 30 March 2022 12.07

> +
> +/**
> + * The RTE seqlock type.
> + */
> +typedef struct {
> +	uint32_t sn; /**< A generation number for the protected data. */
> +	rte_spinlock_t lock; /**< Spinlock used to serialize writers.  */
> +} rte_seqlock_t;
> +

You refer to 'sn' as the sequence number everywhere else, so please document is as such:
"/**< Sequence number for the protected data. */"

Also, consider making 'sn' volatile, although it is only accessed through the __atomic_load_n() function. I don't know if it makes any difference, so I'm just bringing this to the attention of the experts!

Acked-by: Morten Brørup <mb at smartsharesystems.com>



More information about the dev mailing list