Re: the size of BPF_MAP_TYPE_PERCPU_ARRAY doesn't match the number of CPU

Forrest Chen

On Thu, Aug 1, 2019 at 07:16 PM, Yonghong Song wrote:
I guess you mean value size. here.
When you got the values from kernel, the value size is rounded to 8. See

So if you use 64bit value size, you will get correct value.
If you use 32bit value size, you should iterate through with int64_t
size, but only read the first 4 bytes for each iteration.
Thank you, Yonghong Song

Join to automatically receive all group messages.