[PATCH v3 01/29] bpf: replace deprecated SMP barriers with C11 fences

Marat Khalili qm2k21 at gmail.com
Mon Oct 12 20:52:35 CEST 2026


On 09/10/2026 07:05, Wathsala Vithanage wrote:
>>   /*
>>    * Marks given callback as used by datapath.
>>    */
>>   static __rte_always_inline void
>>   bpf_eth_cbi_inuse(struct bpf_eth_cbi *cbi)
>>   {
>> -    cbi->use++;
>> -    /* make sure no store/load reordering could happen */
>> -    rte_smp_mb();
>> +    rte_atomic_store_explicit(&cbi->use,
>> +        rte_atomic_load_explicit(&cbi->use, 
>> rte_memory_order_relaxed) + 1,
>> +        rte_memory_order_relaxed);
>> +
>> +    /* full barrier: count must be visible before cb is read */
>> +    rte_atomic_thread_fence(rte_memory_order_seq_cst);

NAK: optimizing this increment makes little sense when more careful 
analysis shows that it can be simply removed.

I highly recommend keeping this patchset dedicated to removing 
rte_smp_XX barriers and moving other bpf_pkt.c improvements elsewhere.


More information about the dev mailing list