Re: [bpf-next V5 PATCH 10/15] xdp: rhashtable with allocator ID to pointer mapping

2018-03-26 Thread Jesper Dangaard Brouer
On Fri, 23 Mar 2018 09:56:50 -0700 Alexander Duyck wrote: > > +void xdp_return_frame(void *data, struct xdp_mem_info *mem) > > +{ > > + struct xdp_mem_allocator *xa; > > + > > + rcu_read_lock(); > > + if (mem->id) > > + xa = rhashtable_lookup(mem_id_ht, &mem->id,

Re: [bpf-next V5 PATCH 10/15] xdp: rhashtable with allocator ID to pointer mapping

2018-03-23 Thread Alexander Duyck
On Fri, Mar 23, 2018 at 11:15 AM, Jesper Dangaard Brouer wrote: > On Fri, 23 Mar 2018 09:56:50 -0700 > Alexander Duyck wrote: > >> On Fri, Mar 23, 2018 at 5:18 AM, Jesper Dangaard Brouer >> wrote: >> > Use the IDA infrastructure for getting a cyclic increasing ID number, >> > that is used for ke

Re: [bpf-next V5 PATCH 10/15] xdp: rhashtable with allocator ID to pointer mapping

2018-03-23 Thread Jesper Dangaard Brouer
On Fri, 23 Mar 2018 09:56:50 -0700 Alexander Duyck wrote: > On Fri, Mar 23, 2018 at 5:18 AM, Jesper Dangaard Brouer > wrote: > > Use the IDA infrastructure for getting a cyclic increasing ID number, > > that is used for keeping track of each registered allocator per > > RX-queue xdp_rxq_info. I

Re: [bpf-next V5 PATCH 10/15] xdp: rhashtable with allocator ID to pointer mapping

2018-03-23 Thread Alexander Duyck
On Fri, Mar 23, 2018 at 5:18 AM, Jesper Dangaard Brouer wrote: > Use the IDA infrastructure for getting a cyclic increasing ID number, > that is used for keeping track of each registered allocator per > RX-queue xdp_rxq_info. Instead of using the IDR infrastructure, which > uses a radix tree, use

[bpf-next V5 PATCH 10/15] xdp: rhashtable with allocator ID to pointer mapping

2018-03-23 Thread Jesper Dangaard Brouer
Use the IDA infrastructure for getting a cyclic increasing ID number, that is used for keeping track of each registered allocator per RX-queue xdp_rxq_info. Instead of using the IDR infrastructure, which uses a radix tree, use a dynamic rhashtable, for creating ID to pointer lookup table, because