Re: [RFC PATCH bpf-next v2 0/4] Implement bpf queue/stack maps

2018-09-11 Thread Mauricio Vasquez
On 09/10/2018 08:04 PM, Alexei Starovoitov wrote: On Fri, Sep 7, 2018 at 1:40 PM, Mauricio Vasquez wrote: I read the Joe's proposal and using that for this problem looks like a nice solution. I think a good trade-off for now would be to go ahead with a queue/stack map without preallocating

Re: [RFC PATCH bpf-next v2 0/4] Implement bpf queue/stack maps

2018-09-10 Thread Alexei Starovoitov
On Fri, Sep 7, 2018 at 1:40 PM, Mauricio Vasquez wrote: > > I read the Joe's proposal and using that for this problem looks like a nice > solution. > > I think a good trade-off for now would be to go ahead with a queue/stack map > without preallocating support (or maybe include it having always in

Re: [RFC PATCH bpf-next v2 0/4] Implement bpf queue/stack maps

2018-09-07 Thread Mauricio Vasquez
On 09/06/2018 07:13 PM, Alexei Starovoitov wrote: On Fri, Aug 31, 2018 at 11:25:48PM +0200, Mauricio Vasquez B wrote: In some applications this is needed have a pool of free elements, like for example the list of free L4 ports in a SNAT. None of the current maps allow to do it as it is not p

Re: [RFC PATCH bpf-next v2 0/4] Implement bpf queue/stack maps

2018-09-06 Thread Joe Stringer
On Thu, 6 Sep 2018 at 17:13, Alexei Starovoitov wrote: > bpf_map_pop_elem() is trying to do lookup_and_delete and preserve > validity of value without races. > With pcpu_freelist I don't think there is a solution. > We can have this queue/stack map without prealloc and use kmalloc/kfree > back and

Re: [RFC PATCH bpf-next v2 0/4] Implement bpf queue/stack maps

2018-09-06 Thread Alexei Starovoitov
On Fri, Aug 31, 2018 at 11:25:48PM +0200, Mauricio Vasquez B wrote: > In some applications this is needed have a pool of free elements, like for > example the list of free L4 ports in a SNAT. None of the current maps allow > to do it as it is not possibleto get an any element without having they k