Ebpf map question

Marco <[email protected]> Fri, 28 Apr 2023 11:55:17 +0200
Newsgroups org.kernel.vger.xdp-newbies
Message-ID <CAAVAo4MCYB9LKeDVJ=5Eaiy2gJ00bEvbvnE6PzQEc=U67WPQ4A@mail.gmail.com>
Hi

Assuming to have this struct:

struct hash_elem {
    int cnt;
    };

and kernel space program want read cnt value:

struct hash_elem *val = bpf_map_lookup_elem(&hash_map, &key);

    if (val)
   {

# time fraction

    bpf_printk("My value %d", val->cnt);
    }

What happens if the hash_map is a pinned map and in the same time
space of 'time fraction" a user program deletes the element of the
key?
What happen at val pointer?


Thanks.

Marco