[PATCH v4] eal: add seqlock

Mattias Rönnblom mattias.ronnblom at ericsson.com
Fri Apr 8 18:24:49 CEST 2022


On 2022-04-08 17:17, Stephen Hemminger wrote:
> On Fri, 8 Apr 2022 16:24:42 +0200
> Mattias Rönnblom <mattias.ronnblom at ericsson.com> wrote:
> 
>> +++ b/lib/eal/common/rte_seqlock.c
>> @@ -0,0 +1,12 @@
>> +/* SPDX-License-Identifier: BSD-3-Clause
>> + * Copyright(c) 2022 Ericsson AB
>> + */
>> +
>> +#include <rte_seqlock.h>
>> +
>> +void
>> +rte_seqlock_init(rte_seqlock_t *seqlock)
>> +{
>> +	seqlock->sn = 0;
>> +	rte_spinlock_init(&seqlock->lock);
>> +}
> 
> Why not put init in rte_seqlock.h (like other locks)
> and not need a .c at all?
> 

Non-performance critical functions shouldn't be in header files.


More information about the dev mailing list