Re: [PATCH bpf-next v4] bpf: increase supported cgroup storage value size

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

 



On Tue, Jul 27, 2021 at 3:23 PM Stanislav Fomichev <sdf@xxxxxxxxxx> wrote:
>
> Current max cgroup storage value size is 4k (PAGE_SIZE). The other local
> storages accept up to 64k (BPF_LOCAL_STORAGE_MAX_VALUE_SIZE). Let's align
> max cgroup value size with the other storages.
>
> For percpu, the max is 32k (PCPU_MIN_UNIT_SIZE) because percpu
> allocator is not happy about larger values.
>
> netcnt test is extended to exercise those maximum values
> (non-percpu max size is close to, but not real max).
>
> v4:
> * remove inner union (Andrii Nakryiko)
> * keep net_cnt on the stack (Andrii Nakryiko)
>
> v3:
> * refine SIZEOF_BPF_LOCAL_STORAGE_ELEM comment (Yonghong Song)
> * anonymous struct in percpu_net_cnt & net_cnt (Yonghong Song)
> * reorder free (Yonghong Song)
>
> v2:
> * cap max_value_size instead of BUILD_BUG_ON (Martin KaFai Lau)
>
> Cc: Martin KaFai Lau <kafai@xxxxxx>
> Cc: Yonghong Song <yhs@xxxxxx>
> Cc: Andrii Nakryiko <andrii@xxxxxxxxxx>
> Signed-off-by: Stanislav Fomichev <sdf@xxxxxxxxxx>
> ---

Added Martin's ack and applied to bpf-next. Please carry over received
Acks between revisions.

It's also a good practice to separate selftest from the kernel (or
libbpf) changes, unless kernel change doesn't immediately break
selftest. Please consider doing that for the future.

I also just noticed that test_netcnt isn't part of test_progs. It
would be great to migrate it under the common test_progs
infrastructure. We've been steadily moving towards that, but there are
still a bunch of tests that are not run in CI.


>  kernel/bpf/local_storage.c                    | 11 +++++-
>  tools/testing/selftests/bpf/netcnt_common.h   | 38 ++++++++++++++-----
>  .../testing/selftests/bpf/progs/netcnt_prog.c |  8 ++--
>  tools/testing/selftests/bpf/test_netcnt.c     |  4 +-
>  4 files changed, 45 insertions(+), 16 deletions(-)
>

[...]



[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