All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthieu Baerts <matttbe@kernel.org>
To: Geliang Tang <geliang@kernel.org>, mptcp@lists.linux.dev
Cc: Geliang Tang <tanggeliang@kylinos.cn>
Subject: Re: [PATCH mptcp-next 2/2] Squash to "bpf: Export mptcp packet scheduler helpers"
Date: Tue, 20 May 2025 13:23:30 +0200	[thread overview]
Message-ID: <9c1ecdfd-7f75-4437-a6ce-1ccd3c08871f@kernel.org> (raw)
In-Reply-To: <9c089a245833c43d55ec240be1b880909af849ce.1747730598.git.tanggeliang@kylinos.cn>

Hi Geliang,

On 20/05/2025 10:48, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
> 
> Define .filter as Martin suggested.
> 
> Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
> ---
>  net/mptcp/bpf.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/net/mptcp/bpf.c b/net/mptcp/bpf.c
> index 2b0cfb57df8c..4044a8f2c477 100644
> --- a/net/mptcp/bpf.c
> +++ b/net/mptcp/bpf.c
> @@ -317,9 +317,22 @@ BTF_ID_FLAGS(func, bpf_mptcp_subflow_queues_empty)
>  BTF_ID_FLAGS(func, mptcp_pm_subflow_chk_stale, KF_SLEEPABLE)
>  BTF_KFUNCS_END(bpf_mptcp_common_kfunc_ids)
>  
> +static int bpf_mptcp_common_kfunc_filter(const struct bpf_prog *prog, u32 kfunc_id)
> +{
> +	if (!btf_id_set8_contains(&bpf_mptcp_common_kfunc_ids, kfunc_id))
> +		return 0;
> +
> +	if (prog->aux->st_ops &&

See my message on the previous patch: maybe we don't need this condition
then.

> +	    prog->aux->st_ops != &bpf_mptcp_sched_ops)
> +		return -EACCES;
> +
> +	return 0;
> +}
> +
>  static const struct btf_kfunc_id_set bpf_mptcp_common_kfunc_set = {
>  	.owner	= THIS_MODULE,
>  	.set	= &bpf_mptcp_common_kfunc_ids,
> +	.filter	= bpf_mptcp_common_kfunc_filter,
>  };
>  
>  static int __init bpf_mptcp_kfunc_init(void)
Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


  reply	other threads:[~2025-05-20 11:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-20  8:48 [PATCH mptcp-next 0/2] Squash to "BPF packet scheduler" Geliang Tang
2025-05-20  8:48 ` [PATCH mptcp-next 1/2] Squash to "selftests/bpf: Add mptcp_subflow bpf_iter subtest" Geliang Tang
2025-05-20 11:23   ` Matthieu Baerts
2025-05-20  8:48 ` [PATCH mptcp-next 2/2] Squash to "bpf: Export mptcp packet scheduler helpers" Geliang Tang
2025-05-20 11:23   ` Matthieu Baerts [this message]
2025-05-21  0:20   ` kernel test robot
2025-05-20 10:33 ` [PATCH mptcp-next 0/2] Squash to "BPF packet scheduler" MPTCP CI
2025-05-20 11:40 ` MPTCP CI

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=9c1ecdfd-7f75-4437-a6ce-1ccd3c08871f@kernel.org \
    --to=matttbe@kernel.org \
    --cc=geliang@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=tanggeliang@kylinos.cn \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.