Re: [RFC PATCH v3 21/37] bpf tools: Create eBPF maps defined in an object file

2015-05-25 Thread Wangnan (F)
On 2015/5/19 2:48, Alexei Starovoitov wrote: On 5/17/15 3:56 AM, Wang Nan wrote: This patch creates maps based on 'map' section in object file using bpf_create_map(), and store the fds into an array in 'struct bpf_object'. Since the byte order of the object may differ from the host, swap map d

Re: [RFC PATCH v3 21/37] bpf tools: Create eBPF maps defined in an object file

2015-05-22 Thread Jiri Olsa
On Sun, May 17, 2015 at 10:56:46AM +, Wang Nan wrote: SNIP > + i * sizeof(struct bpf_map_def)); > + > + if (obj->needs_swap) { > + def.type= bswap_32(def.type); > + def.key_size= bswap_32(def.key_size)

Re: [RFC PATCH v3 21/37] bpf tools: Create eBPF maps defined in an object file

2015-05-18 Thread Arnaldo Carvalho de Melo
Em Mon, May 18, 2015 at 11:48:57AM -0700, Alexei Starovoitov escreveu: > On 5/17/15 3:56 AM, Wang Nan wrote: > >This patch creates maps based on 'map' section in object file using > >bpf_create_map(), and store the fds into an array in > >'struct bpf_object'. Since the byte order of the object may

Re: [RFC PATCH v3 21/37] bpf tools: Create eBPF maps defined in an object file

2015-05-18 Thread Alexei Starovoitov
On 5/17/15 3:56 AM, Wang Nan wrote: This patch creates maps based on 'map' section in object file using bpf_create_map(), and store the fds into an array in 'struct bpf_object'. Since the byte order of the object may differ from the host, swap map definition before processing. This is the first

[RFC PATCH v3 21/37] bpf tools: Create eBPF maps defined in an object file

2015-05-17 Thread Wang Nan
This patch creates maps based on 'map' section in object file using bpf_create_map(), and store the fds into an array in 'struct bpf_object'. Since the byte order of the object may differ from the host, swap map definition before processing. This is the first patch in 'loading' phase. Previous pat