clang $CLANG_ARGS -g -std=c99 -pedantic -Wall -Wextra -Wno-pointer-arith -Wno-unused-variable -Wno-unused-function -O3 -emit-llvm -c xdp.c -o xdp.bc
if [ "$2" != "" ]; then
clang $4 -g -std=c99 -pedantic -Wall -Wextra -Wno-pointer-arith -O3 -emit-llvm -c "$2" -o wrapper.bc
- llvm-link xdp.bc wrapper.bc | llc -O3 -march=bpf -filetype=obj -o xdp
+ llvm-link xdp.bc wrapper.bc | llc -O3 -march=bpf -mcpu=probe -filetype=obj -o xdp
else
- cat xdp.bc | llc -O3 -march=bpf -filetype=obj -o xdp
+ cat xdp.bc | llc -O3 -march=bpf -mcpu=probe -filetype=obj -o xdp
fi
echo "Before unload drop count was:"
struct persrc_rate##IPV##_entry *first_bucket = &buckets->entries[(hash % map_limit) & (~(SRC_HASH_BUCKET_COUNT - 1))]; \
bpf_spin_lock(&buckets->lock); \
\
- int min_sent_idx = 0; \
+ uint64_t min_sent_idx = 0; /* Must be uint64_t or BPF verifier gets lost and thinks it can be any value */ \
uint64_t min_sent_time = UINT64_MAX; \
- for (int i = 0; i < SRC_HASH_BUCKET_COUNT; i++) { \
+ for (uint64_t i = 0; i < SRC_HASH_BUCKET_COUNT; i++) { \
if (first_bucket[i].srcip == key) { \
min_sent_idx = i; \
break; \