[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7b691525-a92c-43e0-985d-555b584723b4@isovalent.com>
Date: Tue, 26 Sep 2023 12:19:02 +0100
From: Quentin Monnet <quentin@...valent.com>
To: Daniel Borkmann <daniel@...earbox.net>, bpf@...r.kernel.org
Cc: netdev@...r.kernel.org, martin.lau@...nel.org, razor@...ckwall.org,
ast@...nel.org, andrii@...nel.org, john.fastabend@...il.com
Subject: Re: [PATCH bpf-next 4/8] libbpf: Add link-based API for meta
On 26/09/2023 06:59, Daniel Borkmann wrote:
> This adds bpf_program__attach_meta() API to libbpf. Overall it is very
> similar to tcx. The API looks as following:
>
> LIBBPF_API struct bpf_link *
> bpf_program__attach_meta(const struct bpf_program *prog, int ifindex,
> bool peer_device, const struct bpf_meta_opts *opts);
>
> The struct bpf_meta_opts is done in similar way as struct bpf_tcx_opts.
> bpf_program__attach_meta() compared to bpf_program__attach_tcx() has one
> additional argument, that is peer_device. The latter denotes whether the
> program should be attached to the relative peer of ifindex or whether it
> should be attached to ifindex itself.
>
> Signed-off-by: Daniel Borkmann <daniel@...earbox.net>
> ---
> tools/lib/bpf/bpf.c | 16 +++++++++++
> tools/lib/bpf/bpf.h | 5 ++++
> tools/lib/bpf/libbpf.c | 61 ++++++++++++++++++++++++++++++++++++----
> tools/lib/bpf/libbpf.h | 15 ++++++++++
> tools/lib/bpf/libbpf.map | 1 +
> 5 files changed, 92 insertions(+), 6 deletions(-)
> diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
> index b4758e54a815..4d4da8ba2179 100644
> --- a/tools/lib/bpf/libbpf.c
> +++ b/tools/lib/bpf/libbpf.c
> @@ -121,6 +121,8 @@ static const char * const attach_type_name[] = {
> [BPF_TCX_INGRESS] = "tcx_ingress",
> [BPF_TCX_EGRESS] = "tcx_egress",
> [BPF_TRACE_UPROBE_MULTI] = "trace_uprobe_multi",
> + [BPF_META_PRIMARY] = "meta",
> + [BPF_META_PEER] = "meta",
"meta_primary" and "meta_peer"? Or is there a particular reason for
making these the only array entries with identical values?
Powered by blists - more mailing lists