From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-179.mta1.migadu.com (out-179.mta1.migadu.com [95.215.58.179]) (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 2EF481367 for ; Tue, 6 Jan 2026 03:05:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767668712; cv=none; b=h5aPEa5MNdMsrjuZsGIntEzvtGZGVaO3J7Clkpe9tnS73UHat4KxmSLjuYIFKCiN9z0kOQHjeQDHDneVy/DdjDwMdcHn/dZL4RjQC839wQEevKA0scOYsnyHsYFSutV/Q9iZCZdMAIsC5c1mSBN7qyVJ10NwS2nm/sBAV5b2cU8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767668712; c=relaxed/simple; bh=zxrz2lbJbmIsduvUiQCtmTi2f5ZF/2WlT5NgRfCZPwg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=kl06/RA/icbqyeC2bvnZA/ecf62Z6qbE95PejcryAmCwxKxwz3tiJ4B+Yp4ZJpYR6U6CVevhqDU9+uac5UHPmLq68S8TRW3jsMo0mCoxMN3jmQGhWJxmPFp3Vj9ZZjnszq43Iq2zlYx3lDRoYgi+rds+wdmM7RFy47dKQiT+ibc= 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=xZX8hYSP; arc=none smtp.client-ip=95.215.58.179 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="xZX8hYSP" 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=1767668704; 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=WNt1Of0i9x64BslwslxqHsf9KuidTP+1Zvtct7Ztk+o=; b=xZX8hYSPJDU3aSn7s7JeDOBqOlhwq1BVRqrnm1BSAewy7yeOs77IE1bFZ+ZjdmBNxqOdFb RpjaAlty6u8jnN7r48ZsB2r7kVTPnLItUqy02+FrU+bLjotmzsBRMnZTbuAm79CCYC4/yG FNR4dYJkDxFxD9rkxo4LHqPM0fkZe44= From: Menglong Dong To: Menglong Dong , Andrii Nakryiko , 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 Message-ID: <3389151.aeNJFYEL58@7940hx> In-Reply-To: References: <20260104122814.183732-1-dongml2@chinatelecom.cn> 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 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 struct > > bpf_tramp_run_ctx, as Andrii suggested before. Then, we define the sess= ion > > 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. > > >=20 > 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 >=20 > I think having separate duplicated ksession and fsession specific > bpf_[f]session_{is_return,session_cookie}() APIs is really bad and > confusing long-term. >=20 > > So maybe it's better to use the new kfunc for now? And I'm analyzing th= at >=20 > there is no "for now", this decision will be with us for a really long ti= me... >=20 > > if it is possible to inline "current" in verifier. Maybe we can convert= to > > the solu [......] > > >=20