Re: [PATCH bpf-next 3/5] net: core: introduce build_skb_around

2019-04-11 Thread Song Liu
On Thu, Apr 11, 2019 at 8:39 AM Jesper Dangaard Brouer wrote: > > On Wed, 10 Apr 2019 16:34:29 -0700 > Song Liu wrote: > > > > +struct sk_buff *build_skb_around(struct sk_buff *skb, > > > +void *data, unsigned int frag_size) > > > +{ > > > + if (unlikely(!skb

Re: [PATCH bpf-next 3/5] net: core: introduce build_skb_around

2019-04-11 Thread Jesper Dangaard Brouer
On Wed, 10 Apr 2019 16:34:29 -0700 Song Liu wrote: > > +struct sk_buff *build_skb_around(struct sk_buff *skb, > > +void *data, unsigned int frag_size) > > +{ > > + if (unlikely(!skb)) > > + return NULL; > > + > > + skb = __build_skb_around

Re: [PATCH bpf-next 3/5] net: core: introduce build_skb_around

2019-04-11 Thread Jesper Dangaard Brouer
On Thu, 11 Apr 2019 08:33:03 +0300 Ilias Apalodimas wrote: > > +/** > > + * build_skb_around - build a network buffer around provided skb > > + * @skb: sk_buff provide by caller, must be memset cleared > > + * @data: data buffer provided by caller > > + * @frag_size: size of data, or 0 if head wa

Re: [PATCH bpf-next 3/5] net: core: introduce build_skb_around

2019-04-10 Thread Ilias Apalodimas
On Wed, Apr 10, 2019 at 01:43:47PM +0200, Jesper Dangaard Brouer wrote: > The function build_skb() also have the responsibility to allocate and clear > the SKB structure. Introduce a new function build_skb_around(), that moves > the responsibility of allocation and clearing to the caller. This allo

Re: [PATCH bpf-next 3/5] net: core: introduce build_skb_around

2019-04-10 Thread Song Liu
On Wed, Apr 10, 2019 at 6:02 AM Jesper Dangaard Brouer wrote: > > The function build_skb() also have the responsibility to allocate and clear > the SKB structure. Introduce a new function build_skb_around(), that moves > the responsibility of allocation and clearing to the caller. This allows > ca

[PATCH bpf-next 3/5] net: core: introduce build_skb_around

2019-04-10 Thread Jesper Dangaard Brouer
The function build_skb() also have the responsibility to allocate and clear the SKB structure. Introduce a new function build_skb_around(), that moves the responsibility of allocation and clearing to the caller. This allows caller to use kmem_cache (slab/slub) bulk allocation API. Next patch use t