From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-174.mta1.migadu.com (out-174.mta1.migadu.com [95.215.58.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0ABF8309DDF for ; Tue, 6 Jan 2026 07:11:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767683485; cv=none; b=n7dTA48GSlIvpKtoIZLrslNUFBHIY68NqyVJyo3AR+bxP6n/4rAPV2wAiOB8A0Z7M88/Fq9coq+/CxpeqSitp4DzhVnvxxc6CN+VCNLu7T5MjLzekQBpuyxfE1RQZIiZ7mif9xGfBoSCstCvQPHHcSEey9Jzg+pXNLRltFJnOGI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767683485; c=relaxed/simple; bh=jgYT2i2P8pq8bGbZujUvHKcViMZU3Be7fZYMxAfYbXE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=CfDWvHXtCxJCKL7t6iuq00QZu3Yg46shc6h+0b+vkBvQ3KbcWLartFhQFeIi3QBgudpqyiZ5b8RBPlMz6dyiijHogb8xHVll08/cPnL0OzX31cJL/Lut7sUXCLDn2oMOwqyPp1zDjJeLxj160f6t8ZmCOCi96IgV0uPBoRQH4Hk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=cc49FAWw; arc=none smtp.client-ip=95.215.58.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="cc49FAWw" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1767683470; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=28Qq+QjhKkT5nfjUH+D1PH1rbkZ7V1ioFFTYQ1iPwgU=; b=cc49FAWwNKaH2uW4saGfL4zWbZkhA4871Jj8iwYrE0p4jq7BeF6Hdrjgojul0PLWXfJRxB JGGL2hrRJQ01UEGGLE1vEPig3cBLMHKgOQK5dDrEoYMxqMhJ4jxyY/iTcshI0cHqVrg62b a2w6WpVM38VJLv5Y7iW+B8jFz7ilgoo= From: Menglong Dong To: Alexei Starovoitov Cc: Menglong Dong , Andrii Nakryiko , Alexei Starovoitov , Andrii Nakryiko , Daniel Borkmann , Martin KaFai Lau , Eduard , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , "David S. Miller" , David Ahern , Thomas Gleixner , Ingo Molnar , jiang.biao@linux.dev, Borislav Petkov , Dave Hansen , X86 ML , "H. Peter Anvin" , bpf , Network Development , LKML Subject: Re: [PATCH bpf-next v6 00/10] bpf: fsession support Date: Tue, 06 Jan 2026 15:10:53 +0800 Message-ID: <8625659.T7Z3S40VBb@7940hx> In-Reply-To: References: <20260104122814.183732-1-dongml2@chinatelecom.cn> <3389151.aeNJFYEL58@7940hx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Migadu-Flow: FLOW_OUT On 2026/1/6 12:20 Alexei Starovoitov write: > On Mon, Jan 5, 2026 at 7:05=E2=80=AFPM Menglong Dong wrote: > > > > On 2026/1/6 05:20 Andrii Nakryiko write: > > > On Sun, Jan 4, 2026 at 4:28=E2=80=AFAM Menglong Dong 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 s= truct > > > > 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? >=20 > I think adding 'void *ctx' to existing kfuncs makes tramp-based > kfuncs faster, since less work needs to be done to store/read > the same data from run_ctx/current. > So that's my preference. Okay, I'll implement it this way in the next version. Thanks! Menglong Dong