BPF List
 help / color / mirror / Atom feed
From: Kui-Feng Lee <sinquersw@gmail.com>
To: Ming Lei <ming.lei@redhat.com>,
	bpf@vger.kernel.org, ast@kernel.org, martin.lau@linux.dev,
	song@kernel.org, andrii@kernel.org, drosen@google.com,
	kuifeng@meta.com
Cc: thinker.li@gmail.com, Benjamin Tissoires <bentiss@kernel.org>,
	Jiri Kosina <jikos@kernel.org>
Subject: Re: [PATCH] bpf: export btf_find_by_name_kind and bpf_base_func_proto
Date: Tue, 23 Jul 2024 21:43:12 -0700	[thread overview]
Message-ID: <5be6678d-d310-4961-a57c-45b311879017@gmail.com> (raw)
In-Reply-To: <20240724031930.2606568-1-ming.lei@redhat.com>



On 7/23/24 20:19, Ming Lei wrote:
> Export btf_find_by_name_kind and bpf_base_func_proto, so that kernel
> module can use them.
> 
> Almost all existed struct_ops users(hid, sched_ext, ...) need the two APIs.
> 
> Without this change, hid-bpf can't be built as module.

Could you give me more context?
Give me a link of an example code or something?
Or explain the use case?

Thanks!

> 
> Cc: Benjamin Tissoires <bentiss@kernel.org>
> Cc: Jiri Kosina <jikos@kernel.org>
> Signed-off-by: Ming Lei <ming.lei@redhat.com>
> ---
>   kernel/bpf/btf.c     | 1 +
>   kernel/bpf/helpers.c | 1 +
>   2 files changed, 2 insertions(+)
> 
> diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
> index d5019c4454d6..fdc4c0c1829d 100644
> --- a/kernel/bpf/btf.c
> +++ b/kernel/bpf/btf.c
> @@ -567,6 +567,7 @@ s32 btf_find_by_name_kind(const struct btf *btf, const char *name, u8 kind)
>   
>   	return -ENOENT;
>   }
> +EXPORT_SYMBOL_GPL(btf_find_by_name_kind);
>   
>   s32 bpf_find_btf_id(const char *name, u32 kind, struct btf **btf_p)
>   {
> diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c
> index b5f0adae8293..18d1a76f96d2 100644
> --- a/kernel/bpf/helpers.c
> +++ b/kernel/bpf/helpers.c
> @@ -2033,6 +2033,7 @@ bpf_base_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
>   		return NULL;
>   	}
>   }
> +EXPORT_SYMBOL_GPL(bpf_base_func_proto);
>   
>   void bpf_list_head_free(const struct btf_field *field, void *list_head,
>   			struct bpf_spin_lock *spin_lock)

  reply	other threads:[~2024-07-24  4:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-24  3:19 [PATCH] bpf: export btf_find_by_name_kind and bpf_base_func_proto Ming Lei
2024-07-24  4:43 ` Kui-Feng Lee [this message]
2024-07-24  9:13   ` Ming Lei
2024-07-26  3:20     ` Yonghong Song
2024-07-26  3:45       ` Ming Lei
2024-07-26  5:39         ` Yonghong Song
2024-07-26 11:52           ` Ming Lei

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=5be6678d-d310-4961-a57c-45b311879017@gmail.com \
    --to=sinquersw@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bentiss@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=drosen@google.com \
    --cc=jikos@kernel.org \
    --cc=kuifeng@meta.com \
    --cc=martin.lau@linux.dev \
    --cc=ming.lei@redhat.com \
    --cc=song@kernel.org \
    --cc=thinker.li@gmail.com \
    /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