Re: [PATCH v2 bpf-next 4/7] libbpf: add BPF ring buffer support

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

 



On Sun, May 17, 2020 at 12:57:24PM -0700, Andrii Nakryiko wrote:
> +
> +static inline int roundup_len(__u32 len)
> +{
> +	/* clear out top 2 bits */
> +	len <<= 2;
> +	len >>= 2;

what this is for?
Overflow prevention?
but kernel checked the size already?

> +	/* add length prefix */
> +	len += BPF_RINGBUF_HDR_SZ;
> +	/* round up to 8 byte alignment */
> +	return (len + 7) / 8 * 8;
> +}
> +



[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