From: Martin KaFai Lau <martin.lau@linux.dev>
To: Kui-Feng Lee <kuifeng@meta.com>
Cc: bpf@vger.kernel.org, ast@kernel.org, song@kernel.org,
kernel-team@meta.com, andrii@kernel.org, sdf@google.com
Subject: Re: [PATCH bpf-next v9 6/8] libbpf: Update a bpf_link with another struct_ops.
Date: Tue, 21 Mar 2023 14:04:14 -0700 [thread overview]
Message-ID: <57c40769-52a9-70e4-31f1-8ea6e0e73fa4@linux.dev> (raw)
In-Reply-To: <20230320195644.1953096-7-kuifeng@meta.com>
On 3/20/23 12:56 PM, Kui-Feng Lee wrote:
> diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
> index 56a60ab2ca8f..f84d68c049e3 100644
> --- a/tools/lib/bpf/libbpf.c
> +++ b/tools/lib/bpf/libbpf.c
> @@ -11639,6 +11639,11 @@ struct bpf_link *bpf_map__attach_struct_ops(const struct bpf_map *map)
>
> /* kern_vdata should be prepared during the loading phase. */
> err = bpf_map_update_elem(map->fd, &zero, map->st_ops->kern_vdata, 0);
> + /* It can be EBUSY if the map has been used to create or
> + * update a link before. We don't allow updating the value of
> + * a struct_ops once it is set. That ensures that the value
> + * never changed. So, it is safe to skip EBUSY.
> + */
This belongs to the earlier patch (4?).
> if (err && err != -EBUSY) {
> free(link);
> return libbpf_err_ptr(err);
next prev parent reply other threads:[~2023-03-21 21:04 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-20 19:56 [PATCH bpf-next v9 0/8] Transit between BPF TCP congestion controls Kui-Feng Lee
2023-03-20 19:56 ` [PATCH bpf-next v9 1/8] bpf: Retire the struct_ops map kvalue->refcnt Kui-Feng Lee
2023-03-20 19:56 ` [PATCH bpf-next v9 2/8] net: Update an existing TCP congestion control algorithm Kui-Feng Lee
2023-03-20 19:56 ` [PATCH bpf-next v9 3/8] bpf: Create links for BPF struct_ops maps Kui-Feng Lee
2023-03-20 19:56 ` [PATCH bpf-next v9 4/8] libbpf: Create a bpf_link in bpf_map__attach_struct_ops() Kui-Feng Lee
2023-03-21 17:49 ` Martin KaFai Lau
2023-03-21 23:03 ` Kui-Feng Lee
2023-03-20 19:56 ` [PATCH bpf-next v9 5/8] bpf: Update the struct_ops of a bpf_link Kui-Feng Lee
2023-03-21 18:18 ` Martin KaFai Lau
2023-03-21 23:04 ` Kui-Feng Lee
2023-03-20 19:56 ` [PATCH bpf-next v9 6/8] libbpf: Update a bpf_link with another struct_ops Kui-Feng Lee
2023-03-21 21:04 ` Martin KaFai Lau [this message]
2023-03-21 23:04 ` Kui-Feng Lee
2023-03-20 19:56 ` [PATCH bpf-next v9 7/8] libbpf: Use .struct_ops.link section to indicate a struct_ops with a link Kui-Feng Lee
2023-03-20 19:56 ` [PATCH bpf-next v9 8/8] selftests/bpf: Test switching TCP Congestion Control algorithms Kui-Feng Lee
2023-03-21 21:05 ` Martin KaFai Lau
2023-03-21 23:05 ` Kui-Feng Lee
-- strict thread matches above, loose matches on Subject: below --
2023-03-20 19:24 [PATCH bpf-next v9 0/8] Transit between BPF TCP congestion controls Kui-Feng Lee
2023-03-20 19:24 ` [PATCH bpf-next v9 6/8] libbpf: Update a bpf_link with another struct_ops Kui-Feng Lee
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=57c40769-52a9-70e4-31f1-8ea6e0e73fa4@linux.dev \
--to=martin.lau@linux.dev \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=kernel-team@meta.com \
--cc=kuifeng@meta.com \
--cc=sdf@google.com \
--cc=song@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