Re: [PATCH bpf-next 1/3] bpf: add bpf queue map

2018-08-09 Thread Alexei Starovoitov
On Thu, Aug 09, 2018 at 06:41:54PM -0500, Mauricio Vasquez wrote: > > > On 08/09/2018 11:23 AM, Alexei Starovoitov wrote: > > On Thu, Aug 09, 2018 at 09:51:49AM -0500, Mauricio Vasquez wrote: > > > > Agree that existing ops are not the right alias, but deferring to user > > > > space as inline

Re: [PATCH bpf-next 1/3] bpf: add bpf queue map

2018-08-09 Thread Mauricio Vasquez
On 08/09/2018 11:23 AM, Alexei Starovoitov wrote: On Thu, Aug 09, 2018 at 09:51:49AM -0500, Mauricio Vasquez wrote: Agree that existing ops are not the right alias, but deferring to user space as inline function also doesn't really seem like a good fit, imho, so I'd prefer rather to have

Re: [PATCH bpf-next 1/3] bpf: add bpf queue map

2018-08-09 Thread Alexei Starovoitov
On Thu, Aug 09, 2018 at 09:51:49AM -0500, Mauricio Vasquez wrote: > > > Agree that existing ops are not the right alias, but deferring to user > > space as inline function also doesn't really seem like a good fit, imho, > > so I'd prefer rather to have something native. (Aside from that, the > >

Re: [PATCH bpf-next 1/3] bpf: add bpf queue map

2018-08-09 Thread Mauricio Vasquez
On 08/09/2018 04:02 AM, Daniel Borkmann wrote: On 08/09/2018 06:48 AM, Alexei Starovoitov wrote: On Wed, Aug 08, 2018 at 10:08:47PM -0500, Mauricio Vasquez wrote: And how about adding three new helpers: push/pop/peek as well? Reusing lookup/update is neat, but does lookup == pop or does

Re: [PATCH bpf-next 1/3] bpf: add bpf queue map

2018-08-09 Thread Daniel Borkmann
On 08/09/2018 06:48 AM, Alexei Starovoitov wrote: > On Wed, Aug 08, 2018 at 10:08:47PM -0500, Mauricio Vasquez wrote: >> >>> And how about adding three new helpers: push/pop/peek as well? >>> Reusing lookup/update is neat, but does lookup == pop >>> or does lookup == peek ? >>> I suspect it will

Re: [PATCH bpf-next 1/3] bpf: add bpf queue map

2018-08-08 Thread Alexei Starovoitov
On Wed, Aug 08, 2018 at 10:08:47PM -0500, Mauricio Vasquez wrote: > > > And how about adding three new helpers: push/pop/peek as well? > > Reusing lookup/update is neat, but does lookup == pop > > or does lookup == peek ? > > I suspect it will be confusing. > > Three new helpers cost nothing, but

Re: [PATCH bpf-next 1/3] bpf: add bpf queue map

2018-08-08 Thread Mauricio Vasquez
On 08/07/2018 09:42 AM, Alexei Starovoitov wrote: On Mon, Aug 06, 2018 at 03:58:30PM +0200, Mauricio Vasquez B wrote: Bpf queue implements a LIFO/FIFO data containers for ebpf programs. queue/stack datastructure would be a great addition. It allows to push an element to the queue by using

Re: [PATCH bpf-next 1/3] bpf: add bpf queue map

2018-08-08 Thread Mauricio Vasquez
On 08/07/2018 08:52 AM, Daniel Borkmann wrote: On 08/06/2018 03:58 PM, Mauricio Vasquez B wrote: Bpf queue implements a LIFO/FIFO data containers for ebpf programs. It allows to push an element to the queue by using the update operation and to pop an element from the queue by using the

Re: [PATCH bpf-next 1/3] bpf: add bpf queue map

2018-08-08 Thread Mauricio Vasquez
On 08/07/2018 08:40 AM, Daniel Borkmann wrote: On 08/06/2018 03:58 PM, Mauricio Vasquez B wrote: Bpf queue implements a LIFO/FIFO data containers for ebpf programs. It allows to push an element to the queue by using the update operation and to pop an element from the queue by using the

Re: [PATCH bpf-next 1/3] bpf: add bpf queue map

2018-08-07 Thread Alexei Starovoitov
On Mon, Aug 06, 2018 at 03:58:30PM +0200, Mauricio Vasquez B wrote: > Bpf queue implements a LIFO/FIFO data containers for ebpf programs. queue/stack datastructure would be a great addition. > It allows to push an element to the queue by using the update operation > and to pop an element from

Re: [PATCH bpf-next 1/3] bpf: add bpf queue map

2018-08-07 Thread Daniel Borkmann
On 08/06/2018 03:58 PM, Mauricio Vasquez B wrote: > Bpf queue implements a LIFO/FIFO data containers for ebpf programs. > > It allows to push an element to the queue by using the update operation > and to pop an element from the queue by using the lookup operation. > > A use case for this is to

Re: [PATCH bpf-next 1/3] bpf: add bpf queue map

2018-08-07 Thread Daniel Borkmann
On 08/06/2018 03:58 PM, Mauricio Vasquez B wrote: > Bpf queue implements a LIFO/FIFO data containers for ebpf programs. > > It allows to push an element to the queue by using the update operation > and to pop an element from the queue by using the lookup operation. > > A use case for this is to