public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Menglong Dong <menglong.dong@linux.dev>
To: Menglong Dong <menglong8.dong@gmail.com>,
	Andrii Nakryiko <andrii.nakryiko@gmail.com>,
	ast@kernel.org
Cc: andrii@kernel.org, daniel@iogearbox.net, martin.lau@linux.dev,
	eddyz87@gmail.com, song@kernel.org, yonghong.song@linux.dev,
	john.fastabend@gmail.com, kpsingh@kernel.org, sdf@fomichev.me,
	haoluo@google.com, jolsa@kernel.org, davem@davemloft.net,
	dsahern@kernel.org, tglx@linutronix.de, mingo@redhat.com,
	jiang.biao@linux.dev, bp@alien8.de, dave.hansen@linux.intel.com,
	x86@kernel.org, hpa@zytor.com, bpf@vger.kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH bpf-next v6 00/10] bpf: fsession support
Date: Tue, 06 Jan 2026 11:04:47 +0800	[thread overview]
Message-ID: <3389151.aeNJFYEL58@7940hx> (raw)
In-Reply-To: <CAEf4BzbCyMWr5tq5i45SB3jPvUFd4zOAYwJG3KBBeaoWmEq8kw@mail.gmail.com>

On 2026/1/6 05:20 Andrii Nakryiko <andrii.nakryiko@gmail.com> write:
> On Sun, Jan 4, 2026 at 4:28 AM Menglong Dong <menglong8.dong@gmail.com> wrote:
> >
> > Hi, all.
> >
[......]
> > Maybe it's possible to reuse the existing bpf_session_cookie() and
> > bpf_session_is_return(). First, we move the nr_regs from stack to struct
> > bpf_tramp_run_ctx, as Andrii suggested before. Then, we define the session
> > cookies as flexible array in bpf_tramp_run_ctx like this:
> >     struct bpf_tramp_run_ctx {
> >         struct bpf_run_ctx run_ctx;
> >         u64 bpf_cookie;
> >         struct bpf_run_ctx *saved_run_ctx;
> >         u64 func_meta; /* nr_args, cookie_index, etc */
> >         u64 fsession_cookies[];
> >     };
> >
> > The problem of this approach is that we can't inlined the bpf helper
> > anymore, such as get_func_arg, get_func_ret, get_func_arg_cnt, etc, as
> > we can't use the "current" in BPF assembly.
> >
> 
> We can, as Alexei suggested on your other patch set. Is this still a
> valid concern?

Yeah, with the support of BPF_MOV64_PERCPU_REG, it's much easier
now.

So what approach should I use now? Change the prototype of
bpf_session_is_return/bpf_session_cookie, as Alexei suggested, or
use the approach here? I think both works, and I'm a little torn
now. Any suggestions?

Thanks!
Menglong Dong

> 
> I think having separate duplicated ksession and fsession specific
> bpf_[f]session_{is_return,session_cookie}() APIs is really bad and
> confusing long-term.
> 
> > So maybe it's better to use the new kfunc for now? And I'm analyzing that
> 
> there is no "for now", this decision will be with us for a really long time...
> 
> > if it is possible to inline "current" in verifier. Maybe we can convert to
> > the solu
[......]
> >
> 





  reply	other threads:[~2026-01-06  3:05 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-04 12:28 [PATCH bpf-next v6 00/10] bpf: fsession support Menglong Dong
2026-01-04 12:28 ` [PATCH bpf-next v6 01/10] bpf: add " Menglong Dong
2026-01-04 12:28 ` [PATCH bpf-next v6 02/10] bpf: use last 8-bits for the nr_args in trampoline Menglong Dong
2026-01-04 12:28 ` [PATCH bpf-next v6 03/10] bpf: add the kfunc bpf_fsession_is_return Menglong Dong
2026-01-04 12:28 ` [PATCH bpf-next v6 04/10] bpf: add the kfunc bpf_fsession_cookie Menglong Dong
2026-01-04 12:28 ` [PATCH bpf-next v6 05/10] bpf,x86: introduce emit_st_r0_imm64() for trampoline Menglong Dong
2026-01-04 12:28 ` [PATCH bpf-next v6 06/10] bpf,x86: add fsession support for x86_64 Menglong Dong
2026-01-04 12:28 ` [PATCH bpf-next v6 07/10] libbpf: add fsession support Menglong Dong
2026-01-04 12:28 ` [PATCH bpf-next v6 08/10] selftests/bpf: add testcases for fsession Menglong Dong
2026-01-04 12:28 ` [PATCH bpf-next v6 09/10] selftests/bpf: add testcases for fsession cookie Menglong Dong
2026-01-04 12:28 ` [PATCH bpf-next v6 10/10] selftests/bpf: test fsession mixed with fentry and fexit Menglong Dong
2026-01-05 21:20 ` [PATCH bpf-next v6 00/10] bpf: fsession support Andrii Nakryiko
2026-01-06  3:04   ` Menglong Dong [this message]
2026-01-06  4:20     ` Alexei Starovoitov
2026-01-06  7:10       ` Menglong Dong
2026-01-05 22:33 ` Alexei Starovoitov
2026-01-05 23:20   ` Andrii Nakryiko
2026-01-06  8:54     ` Jiri Olsa
2026-01-06 12:48       ` Menglong Dong

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=3389151.aeNJFYEL58@7940hx \
    --to=menglong.dong@linux.dev \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bp@alien8.de \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=dave.hansen@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=eddyz87@gmail.com \
    --cc=haoluo@google.com \
    --cc=hpa@zytor.com \
    --cc=jiang.biao@linux.dev \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=menglong8.dong@gmail.com \
    --cc=mingo@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=sdf@fomichev.me \
    --cc=song@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=yonghong.song@linux.dev \
    /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