public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Martin KaFai Lau <kafai@fb.com>
To: <netdev@vger.kernel.org>
Cc: Alexei Starovoitov <ast@fb.com>,
	Daniel Borkmann <daniel@iogearbox.net>, <kernel-team@fb.com>
Subject: [PATCH v2 bpf 0/3] Introduce BPF_ANNOTATE_KV_PAIR
Date: Sat, 21 Jul 2018 11:20:40 -0700	[thread overview]
Message-ID: <20180721182043.1401089-1-kafai@fb.com> (raw)

The series allows the BPF loader to figure out
the btf_key_id and btf_value_id from a map's name
by using BPF_ANNOTATE_KV_PAIR.  It also removes
the old 'typedef' way which requires two separate
typedefs (one for the key and one for the value).

By doing this, iproute2 and libbpf have one
consistent way to figure out the btf_key_type_id and
btf_value_type_id for a map.

The first two patches are some prep/cleanup works.
The last patch introduces BPF_ANNOTATE_KV_PAIR.

v2:
- Fix the incorrect '&&' check on container_type
  in bpf_map_find_btf_info().
- Expose the existing static btf_type_by_id() instead of
  creating a new one.

Martin KaFai Lau (3):
  bpf: btf: Sync uapi btf.h to tools
  bpf: Replace [u]int32_t and [u]int64_t in libbpf
  bpf: Introduce BPF_ANNOTATE_KV_PAIR

 tools/include/uapi/linux/btf.h               |  2 +-
 tools/lib/bpf/btf.c                          | 33 ++++----
 tools/lib/bpf/btf.h                          | 10 ++-
 tools/lib/bpf/libbpf.c                       | 85 +++++++++++---------
 tools/lib/bpf/libbpf.h                       |  4 +-
 tools/testing/selftests/bpf/bpf_helpers.h    |  9 +++
 tools/testing/selftests/bpf/test_btf_haskv.c |  7 +-
 7 files changed, 80 insertions(+), 70 deletions(-)

-- 
2.17.1

             reply	other threads:[~2018-07-21 19:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-21 18:20 Martin KaFai Lau [this message]
2018-07-21 18:20 ` [PATCH v2 bpf 1/3] bpf: btf: Sync uapi btf.h to tools Martin KaFai Lau
2018-07-23 17:58   ` Yonghong Song
2018-07-21 18:20 ` [PATCH v2 bpf 2/3] bpf: Replace [u]int32_t and [u]int64_t in libbpf Martin KaFai Lau
2018-07-23 18:04   ` Yonghong Song
2018-07-23 18:41     ` Martin KaFai Lau
2018-07-21 18:20 ` [PATCH v2 bpf 3/3] bpf: Introduce BPF_ANNOTATE_KV_PAIR Martin KaFai Lau
2018-07-23 18:31   ` Yonghong Song
2018-07-23 18:41     ` Martin KaFai Lau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180721182043.1401089-1-kafai@fb.com \
    --to=kafai@fb.com \
    --cc=ast@fb.com \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@fb.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox