Re: [PATCH] bpf: selftests: handle sparse CPU allocations

2019-01-31 Thread Martynas
Oops, thanks for noticing the issue with strlen in the for loop. Changing to "int len = strlen(buff); for (i = 0; i < len; i++) <..>" should fix the issue. I'm going to re-submit the patch. Also, I put some testing results: https://gist.github.com/brb/5369b5cfd08babb80cf2c4081dc19762 On Thu, J

Re: [PATCH] bpf: selftests: handle sparse CPU allocations

2019-01-30 Thread Y Song
[ My reply somehow rejected by netdev, this is to send it again. ] On Wed, Jan 30, 2019 at 1:19 AM Martynas Pumputis wrote: > > Previously, bpf_num_possible_cpus() had a bug when calculating a > number of possible CPUs in the case of sparse CPU allocations, as > it was considering only the first

[PATCH] bpf: selftests: handle sparse CPU allocations

2019-01-30 Thread Martynas Pumputis
Previously, bpf_num_possible_cpus() had a bug when calculating a number of possible CPUs in the case of sparse CPU allocations, as it was considering only the first range or element of /sys/devices/system/cpu/possible. E.g. in the case of "0,2-3" (CPU 1 is not available), the function returned 1 i