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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 11 Apr 2019 08:33:03 +0300
Ilias Apalodimas <ilias.apalodimas@xxxxxxxxxx> 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 was kmalloced
> > + */
> > +struct sk_buff *build_skb_around(struct sk_buff *skb,
> > +				 void *data, unsigned int frag_size)
> > +{
> > +	if (unlikely(!skb))  
>
> Maybe add a warning here, indicating the buffer *must* be there before calling
> this?

No. I actually use this !skb in next patch. Which only happens in case
memory allocation kmem_cache_alloc_bulk() fails.

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux