Re: BPF Concurrency


Yonghong Song
 

On Sun, Jun 21, 2020 at 4:17 PM Kanthi P <Pavuluri.kanthi@...> wrote:

Thanks Andrii. __sync_fetch_and_add doesn't seem to work as expected, it is adding the increment, but it is returning the wrong value.
I am actually hitting the same issue mentioned here: https://lists.iovisor.org/g/iovisor-dev/topic/problems_with/23670176?p=,,,20,0,0,0::recentpostdate%2Fsticky,,,20,2,20,23670176

Can anyone suggest if it is fixed recently? I am on 4.15 kernel.
You cannot use the return value. A recent llvm should return an error
if you try to use it.

There is some preliminary work to have more atomic operations in the
BPF ISA. https://reviews.llvm.org/D72184. We could add a version of
fetch_and_add with proper return value. This may take some time as we
need to ensure kernel has proper support.


Thanks,
Kanthi

Join iovisor-dev@lists.iovisor.org to automatically receive all group messages.