Race Condition between BPF_MAP_UPDATE_ELEM and BPF_MAP_LOOKUP_ELEM for BPF_MAP_TYPE_HASH_OF_MAPS?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hey everyone,

I've got a question. I've got an eBPF map that's a
BPF_MAP_TYPE_HASH_OF_MAPS where user space updates elements in the
map, user space will create a new inner map to do map-in-map swapping
in order to update the outer map's values.  My XDP program will then
read the inner maps by using BPF_MAP_LOOKUP_ELEM on the outer map.
Does this create a potential race condition between
BPF_MAP_LOOKUP_ELEM and BPF_MAP_UPDATE_ELEM when one thread is trying
to lookup an existing element while another thread is trying to update
the same existing element? I'm expecting to see either the old value
or the new value, however I'm occasionally seeing the element does not
exist when looking up the element from the eBPF program. Is this
expected?

Thanks,

Cody Haas




[Index of Archives]     [Linux Networking Development]     [Fedora Linux Users]     [Linux SCTP]     [DCCP]     [Gimp]     [Yosemite Campsites]

  Powered by Linux