李春林
李春林

Reputation: 1

In cilium update map return failed but map updated, and can't lookup map

Source code: in lb.h

ret = map_update_elem(&LB4_UDP_LB_MAP, &msg_keyindex, &slot, 0);
if (!ret) {
    bpfprint("Update success");
}else {
    bpfprint("Update failed");
}
myslot = map_lookup_elem(&LB4_UDP_LB_MAP,&msg_keyindex);
if (!myslot) {
    bpfprint("Catch slot is %d",\*myslot);
}
bpfprint("Slot is %d",myslot);

Then show: "Update failed", but usebpftool map dump id` the map updated; Next, try to lookup the map, no value found.

What is the possible reason?

Can update and lookup the map in funtion defined in lb.h

Upvotes: 0

Views: 20

Answers (0)

Related Questions