Re: [PATCH bpf-next v9 05/11] bpf: support fsession for bpf_session_cookie

From: Alexei Starovoitov

Date: Tue Jan 13 2026 - 21:33:20 EST


On Tue, Jan 13, 2026 at 5:24 PM Andrii Nakryiko
<andrii.nakryiko@xxxxxxxxx> wrote:
>
> On Sat, Jan 10, 2026 at 6:12 AM Menglong Dong <menglong8.dong@xxxxxxxxx> wrote:
> >
> > Implement session cookie for fsession. In order to limit the stack usage,
> > we make 4 as the maximum of the cookie count.
>
> This 4 is so random, tbh. Do we need to artificially limit it? Even if
> all BPF_MAX_TRAMP_LINKS = 38 where using session cookies, it would be
> 304 bytes. Not insignificant, but also not world-ending and IMO so
> unlikely that I wouldn't add extra limits at all.

I forgot that we already have BPF_MAX_TRAMP_LINKS limit for the total
number of progs. I guess extra 8 bytes per fsession prog isn't that bad.