Re: [RFC PATCH bpf-next 04/13] xsk: introduce AF_XDP buffer allocation API

2020-05-06 Thread Björn Töpel
On 2020-05-06 11:51, Maxim Mikityanskiy wrote: On 2020-05-04 14:37, Björn Töpel wrote: [] @@ -389,6 +390,11 @@ static void __xdp_return(void *data, struct xdp_mem_info *mem, bool napi_direct,   xa = rhashtable_lookup(mem_id_ht, &mem->id, mem_id_rht_params);   xa->zc_alloc->free

Re: [RFC PATCH bpf-next 04/13] xsk: introduce AF_XDP buffer allocation API

2020-05-06 Thread Maxim Mikityanskiy
On 2020-05-04 14:37, Björn Töpel wrote: From: Björn Töpel In order to simplify AF_XDP zero-copy enablement for NIC driver developers, a new AF_XDP buffer allocation API is added. The implementation is based on a single core (single producer/consumer) buffer pool for the AF_XDP UMEM. A buffer i

Re: [RFC PATCH bpf-next 04/13] xsk: introduce AF_XDP buffer allocation API

2020-05-06 Thread Björn Töpel
On Tue, 5 May 2020 at 16:28, Maxim Mikityanskiy wrote: > [...] > > > > - if (((d->addr + d->len) & q->chunk_mask) != (d->addr & q->chunk_mask) > > || > > - d->options) { > > +static inline bool xskq_cons_is_valid_desc(struct xsk_queue *q, > > +s

Re: [RFC PATCH bpf-next 04/13] xsk: introduce AF_XDP buffer allocation API

2020-05-05 Thread Maxim Mikityanskiy
On 2020-05-04 14:37, Björn Töpel wrote: From: Björn Töpel In order to simplify AF_XDP zero-copy enablement for NIC driver developers, a new AF_XDP buffer allocation API is added. The implementation is based on a single core (single producer/consumer) buffer pool for the AF_XDP UMEM. A buffer i

[RFC PATCH bpf-next 04/13] xsk: introduce AF_XDP buffer allocation API

2020-05-04 Thread Björn Töpel
From: Björn Töpel In order to simplify AF_XDP zero-copy enablement for NIC driver developers, a new AF_XDP buffer allocation API is added. The implementation is based on a single core (single producer/consumer) buffer pool for the AF_XDP UMEM. A buffer is allocated using the xsk_buff_alloc() fun