[dpdk-dev] [PATCH] net/memif: relax barrier for zero copy path

Ferruh Yigit ferruh.yigit at intel.com
Mon Sep 21 15:27:32 CEST 2020


On 9/21/2020 1:21 PM, Jakub Grajciar -X (jgrajcia - PANTHEON TECH SRO at 
Cisco) wrote:
>>>>>
>>>>> Using 'rte_mb' to synchronize the shared ring head/tail between
>>>>> producer and consumer will stall the pipeline and damage
>>>>> performance on the weak memory model platforms, such like aarch64.
>>>>>
>>>>> Relax the expensive barrier with c11 atomic with explicit memory
>>>>> ordering can improve 3.6% performance on throughput.
>>>
>>> My question here is: `rte_mb` is supposed to make sure that head/tail
>>> pointer are not updated before the packets are written into shared
>> memory.
>>> Does the atomic ensures that the packets are written into shared
>>> memory before head/tail pointers are updated?
>>
>> Yes, it does.
>> The atomic store-release acts as a one-way barrier here to make sure all the
>> memory accesses before the store-release are observed before it.
> 
> Ok then, since the sync is there and the rest seems fine to me.
> 
> Thanks,
> Jakub
> 
> Reviewed-by: Jakub Grajciar <jgrajcia at cisco.com>
> 

Applied to dpdk-next-net/main, thanks.


More information about the dev mailing list