]> git.baikalelectronics.ru Git - kernel.git/commit
Merge branch 'libbpf: Support uniform BTF-defined key/value specification across...
authorAndrii Nakryiko <andrii@kernel.org>
Fri, 1 Oct 2021 22:31:51 +0000 (15:31 -0700)
committerAndrii Nakryiko <andrii@kernel.org>
Fri, 1 Oct 2021 22:31:51 +0000 (15:31 -0700)
commit3760bb42b9d1bfc3d084f774f7b40a079ea18ee9
tree99c4e3b27c85b415115fb1f648e7d663d4f1f669
parenta06260ed08bd59d5911a7ac2feef2e630b0ee8c0
parent751b64d6c4d607b332908201feae6e017703acf3
Merge branch 'libbpf: Support uniform BTF-defined key/value specification across all BPF maps'

Hengqi Chen says:

====================

Currently a bunch of (usually pretty specialized) BPF maps do not support
specifying BTF types for they key and value. For such maps, specifying
their definition like this:

  struct {
      __uint(type, BPF_MAP_TYPE_PERF_EVENT_ARRAY);
      __type(key, int);
      __type(value, int);
  } my_perf_buf SEC(".maps");

Would actually produce warnings about retrying BPF map creation without BTF.
Users are forced to know such nuances and use __uint(key_size, 4) instead.
This is non-uniform, annoying, and inconvenient.

This patch set teaches libbpf to recognize those specialized maps and removes
BTF type IDs when creating BPF map. Also, update existing BPF selftests to
exericse this change.
====================

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>