netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Song Liu <liu.song.a23@gmail.com>
To: Andrii Nakryiko <andriin@fb.com>
Cc: bpf <bpf@vger.kernel.org>, Networking <netdev@vger.kernel.org>,
	Alexei Starovoitov <ast@fb.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii.nakryiko@gmail.com>,
	Kernel Team <kernel-team@fb.com>
Subject: Re: [PATCH v2 bpf-next 6/7] libbpf: add BPF_CORE_READ/BPF_CORE_READ_INTO helpers
Date: Thu, 3 Oct 2019 13:35:46 -0700	[thread overview]
Message-ID: <CAPhsuW4OOx6nDwPpzjXmnKRj6dBaXuF=GVjG6D4YmF_OWwsKcA@mail.gmail.com> (raw)
In-Reply-To: <20191002215041.1083058-7-andriin@fb.com>

On Wed, Oct 2, 2019 at 3:02 PM Andrii Nakryiko <andriin@fb.com> wrote:
>
> Add few macros simplifying BCC-like multi-level probe reads, while also
> emitting CO-RE relocations for each read.
>
> Acked-by: John Fastabend <john.fastabend@gmail.com>
> Signed-off-by: Andrii Nakryiko <andriin@fb.com>
> ---
>  tools/lib/bpf/bpf_helpers.h | 143 ++++++++++++++++++++++++++++++++++++
>  1 file changed, 143 insertions(+)
>
> diff --git a/tools/lib/bpf/bpf_helpers.h b/tools/lib/bpf/bpf_helpers.h
> index cb9d4d2224af..847dfd7125e4 100644
> --- a/tools/lib/bpf/bpf_helpers.h
> +++ b/tools/lib/bpf/bpf_helpers.h
> @@ -19,6 +19,10 @@
>   */
>  #define SEC(NAME) __attribute__((section(NAME), used))
>
> +#ifndef __always_inline
> +#define __always_inline __attribute__((always_inline))
> +#endif
> +
>  /* helper functions called from eBPF programs written in C */
>  static void *(*bpf_map_lookup_elem)(void *map, const void *key) =
>         (void *) BPF_FUNC_map_lookup_elem;
> @@ -312,4 +316,143 @@ struct bpf_map_def {
>         bpf_probe_read(dst, sz,                                             \
>                        (const void *)__builtin_preserve_access_index(src))
>
> +/*

nit: extra /*.

Well, I actually don't have a strong preference with this. Just to highlight
we are mixing two styles, which we already do in current bpf_helpers.h.

There are multiple other instances below.

Besides these.

Acked-by: Song Liu <songliubraving@fb.com>

  reply	other threads:[~2019-10-03 20:35 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-02 21:50 [PATCH v2 bpf-next 0/7] Move bpf_helpers and add BPF_CORE_READ macros Andrii Nakryiko
2019-10-02 21:50 ` [PATCH v2 bpf-next 1/7] selftests/bpf: undo GCC-specific bpf_helpers.h changes Andrii Nakryiko
2019-10-02 21:50 ` [PATCH v2 bpf-next 2/7] selftests/bpf: samples/bpf: split off legacy stuff from bpf_helpers.h Andrii Nakryiko
2019-10-03  7:35   ` Toke Høiland-Jørgensen
2019-10-03 16:20     ` Andrii Nakryiko
2019-10-03 16:27       ` Toke Høiland-Jørgensen
2019-10-03 17:31   ` John Fastabend
2019-10-03 20:08   ` Song Liu
2019-10-03 21:22     ` Andrii Nakryiko
2019-10-02 21:50 ` [PATCH v2 bpf-next 3/7] selftests/bpf: adjust CO-RE reloc tests for new bpf_core_read() macro Andrii Nakryiko
2019-10-03 20:16   ` Song Liu
2019-10-03 20:28     ` Andrii Nakryiko
2019-10-03 20:41       ` Song Liu
2019-10-03 21:10         ` Andrii Nakryiko
2019-10-02 21:50 ` [PATCH v2 bpf-next 4/7] selftests/bpf: split off tracing-only helpers into bpf_tracing.h Andrii Nakryiko
2019-10-03  7:35   ` Toke Høiland-Jørgensen
2019-10-03 16:22     ` Andrii Nakryiko
2019-10-03 17:21       ` Toke Høiland-Jørgensen
2019-10-03 17:33   ` John Fastabend
2019-10-03 20:18     ` Song Liu
2019-10-02 21:50 ` [PATCH v2 bpf-next 5/7] libbpf: move bpf_{helpers,endian,tracing}.h into libbpf Andrii Nakryiko
2019-10-03 20:22   ` Song Liu
2019-10-02 21:50 ` [PATCH v2 bpf-next 6/7] libbpf: add BPF_CORE_READ/BPF_CORE_READ_INTO helpers Andrii Nakryiko
2019-10-03 20:35   ` Song Liu [this message]
2019-10-03 21:25     ` Andrii Nakryiko
2019-10-02 21:50 ` [PATCH v2 bpf-next 7/7] selftests/bpf: add BPF_CORE_READ and BPF_CORE_READ_STR_INTO macro tests Andrii Nakryiko

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='CAPhsuW4OOx6nDwPpzjXmnKRj6dBaXuF=GVjG6D4YmF_OWwsKcA@mail.gmail.com' \
    --to=liu.song.a23@gmail.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andriin@fb.com \
    --cc=ast@fb.com \
    --cc=bpf@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).