Hi,

I found that if the loop variable "int i" is used in the map lookup as below:
#pragma clang loop unroll(full)
   for (i = 0; i < 8; ++i) {
       struct bpf_flow_keys *mask;
       mask = bpf_map_lookup_elem(&flow_mask, &i);
       if (!mask)
           break;
   }
Then the compiled BPF code does not unrolled the loop, causing errors:
"back-edge from insn 240 to 219"

A workaround for that is to declare another variable "int j", then I
can pass the verifier.

#pragma clang loop unroll(full)
   for (i = 0; i < 8; ++i) {
       int j = i;
       struct bpf_flow_keys *mask;
       mask = bpf_map_lookup_elem(&flow_mask, &j); // ---> use "j"
       if (!mask)
           break;
   }

Does anyone hit similar issue?
Regards,
William
_______________________________________________
iovisor-dev mailing list
[email protected]
https://lists.iovisor.org/mailman/listinfo/iovisor-dev

Reply via email to