All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 bpf-next 0/5] btf_dedup algorithm and test fixes
@ 2019-02-28 23:31 Andrii Nakryiko
  2019-02-28 23:31 ` [PATCH v2 bpf-next 1/5] selftests/bpf: fix btf_dedup testing code Andrii Nakryiko
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Andrii Nakryiko @ 2019-02-28 23:31 UTC (permalink / raw)
  To: andrii.nakryiko, kernel-team, ast, acme, netdev, bpf, daniel,
	songliubraving
  Cc: Andrii Nakryiko

This patchset fixes a bug in btf_dedup() algorithm, which under specific hash
collision causes infinite loop. It also exposes ability to tune BTF
deduplication table size, with double purpose of allowing applications to
adjust size according to the size of BTF data, as well as allowing a simple way
to force hash collisions by setting table size to 1.

- Patch #1 fixes bug in btf_dedup testing code that's checking strings
- Patch #2 fixes pointer arg formatting in btf.h
- Patch #3 adds option to specify custom dedup table size
- Patch #4 fixes aforementioned bug in btf_dedup
- Patch #5 adds test that validates the fix

v1->v2:
- remove "Fixes" from formatting change patch
- extract roundup_pow2_max func for dedup table size
- btf_equal_struct -> btf_shallow_equal_struct
- explain in comment why we can't rely on just btf_dedup_is_equiv

Andrii Nakryiko (5):
  selftests/bpf: fix btf_dedup testing code
  libbpf: fix formatting for btf_ext__get_raw_data
  btf: allow to customize dedup hash table size
  btf: fix bug with resolving STRUCT/UNION into corresponding FWD
  selftests/bpf: add btf_dedup test of FWD/STRUCT resolution

 tools/lib/bpf/btf.c                    | 73 +++++++++++++++++++-------
 tools/lib/bpf/btf.h                    |  3 +-
 tools/testing/selftests/bpf/.gitignore |  1 +
 tools/testing/selftests/bpf/test_btf.c | 49 ++++++++++++++++-
 4 files changed, 103 insertions(+), 23 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-03-01  0:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-28 23:31 [PATCH v2 bpf-next 0/5] btf_dedup algorithm and test fixes Andrii Nakryiko
2019-02-28 23:31 ` [PATCH v2 bpf-next 1/5] selftests/bpf: fix btf_dedup testing code Andrii Nakryiko
2019-02-28 23:31 ` [PATCH v2 bpf-next 2/5] libbpf: fix formatting for btf_ext__get_raw_data Andrii Nakryiko
2019-02-28 23:31 ` [PATCH v2 bpf-next 3/5] btf: allow to customize dedup hash table size Andrii Nakryiko
2019-02-28 23:31 ` [PATCH v2 bpf-next 4/5] btf: fix bug with resolving STRUCT/UNION into corresponding FWD Andrii Nakryiko
2019-02-28 23:31 ` [PATCH v2 bpf-next 5/5] selftests/bpf: add btf_dedup test of FWD/STRUCT resolution Andrii Nakryiko
2019-03-01  0:42 ` [PATCH v2 bpf-next 0/5] btf_dedup algorithm and test fixes Daniel Borkmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.