Re: [RFC PATCH 2/6] bpf: add BPF_MAP_DUMP command to access more than one entry per call

2019-06-24 Thread Jakub Kicinski
On Mon, 24 Jun 2019 16:35:05 -0700, Brian Vazquez wrote: > On Mon, Jun 24, 2019 at 3:46 PM Jakub Kicinski wrote: > > On Fri, 21 Jun 2019 16:16:46 -0700, Brian Vazquez wrote: > > > @@ -385,6 +386,14 @@ union bpf_attr { > > > __u64 flags; > > > }; > > > > > > + str

Re: [RFC PATCH 2/6] bpf: add BPF_MAP_DUMP command to access more than one entry per call

2019-06-24 Thread Brian Vazquez
On Mon, Jun 24, 2019 at 3:46 PM Jakub Kicinski wrote: > > On Fri, 21 Jun 2019 16:16:46 -0700, Brian Vazquez wrote: > > @@ -385,6 +386,14 @@ union bpf_attr { > > __u64 flags; > > }; > > > > + struct { /* struct used by BPF_MAP_DUMP command */ > > + __u3

Re: [RFC PATCH 2/6] bpf: add BPF_MAP_DUMP command to access more than one entry per call

2019-06-24 Thread Jakub Kicinski
On Fri, 21 Jun 2019 16:16:46 -0700, Brian Vazquez wrote: > @@ -385,6 +386,14 @@ union bpf_attr { > __u64 flags; > }; > > + struct { /* struct used by BPF_MAP_DUMP command */ > + __u32 map_fd; There is a hole here, perhaps flags don't have t

[RFC PATCH 2/6] bpf: add BPF_MAP_DUMP command to access more than one entry per call

2019-06-21 Thread Brian Vazquez
This introduces a new command to retrieve a variable number of entries from a bpf map wrapping the existing bpf methods: map_get_next_key and map_lookup_elem Note that map_dump doesn't guarantee that reading the entire table is consistent since this function is always racing with kernel and user c