search for: bpf_elf_map

Displaying 2 results from an estimated 2 matches for "bpf_elf_map".

2018 Sep 25
2
bpf compilation using clang
...struct vlan_hdr { __be16 h_vlan_TCI; __be16 h_vlan_encapsulated_proto; }; struct virtio_net_hdr_rss { __u32 rss_hash_function; __u32 hash_function_flags; uint8_t rss_hash_key[40]; __u32 rss_indirection_table_length; uint8_t rss_indirection_table[128]; }; struct bpf_elf_map __attribute__((section("maps"), used)) map_rss = { .type = BPF_MAP_TYPE_ARRAY, .id = BPF_MAP_ID_KEY, .size_key = sizeof(__u32), .size_value = sizeof(struct virtio_net_hdr_rss), .max_elem...
2018 Sep 13
4
bpf compilation using clang
Hi all, I am trying to insert instructions into the bpf using the bpf syscall, the instructions were generated using the following command line: clang -I ~/Builds/bpf_rss/iproute2/include -Wall -target bpf -O2 -emit-llvm -c upstream/qemu/hw/net/rss_tap_bpf_program.c -o - | llc -march=bpf -filetype=obj -o tap_bpf_program.o and then were translated to bpf instructions using the BPFCparser tool