From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-179.mta0.migadu.com (out-179.mta0.migadu.com [91.218.175.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 6B97B2135B8; Sat, 10 Jan 2026 03:38:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768016294; cv=none; b=tvhGKsyeJ2x7noki5/JHM4rDYFR1QVi22Ag/ORsN/XfAKsKQvIPjg9vnj6jvKJTL9Z87ef5kPcjpCqzPDEf696PSote7bCs6UIoJjQieUWzFDe3b5py0DQC3SSTI3hyGqLrOGsERfV6OxvA6DrNdNQo9XE1v38lV3Sk91k7XS08= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768016294; c=relaxed/simple; bh=rbIr3G/sW7tRGoNZ+lF0F2oYqivDF8mzxOqrDuVr/88=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=A8k+/bdUSDzfjqStrooQijEhhTEusJ4VJzQIxKAV5qClj0O1vfuMJezBae6Lx+YneIcX2868aQL7R1L3wap4LwNlqLSdNQ0eYZzD6ZCZ+oK6fwG2s9SLyBO1M4ohaGyQEcai+GJjwVFmp9+VjgTv1FKTOWIF2ag42MjR2aW/x+I= 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=aN++cn0o; arc=none smtp.client-ip=91.218.175.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="aN++cn0o" 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=1768016280; 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=72prxwM+ojfoTekETnLlr6xQXFg53cmyt9vRtB4B73k=; b=aN++cn0otad3+7YNgPtpf0lvNpW7gJJ0oMPXzKHu4GUOuhen3cS4UWUJL0Z6MNoBt/OSk+ kPJe3RItRF5CtzB15jURXpbkgfkOZUHZ/lQbTAHu0oH+0J29LFdmIv/OSUka/F+E2T4Toh famgV50J0xEwONJg6nubm97gPWpQL1g= From: Menglong Dong To: Menglong Dong , Alexei Starovoitov Cc: 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 v8 04/11] bpf: support fsession for bpf_session_is_return Date: Sat, 10 Jan 2026 11:37:36 +0800 Message-ID: <5075208.31r3eYUQgx@7950hx> In-Reply-To: References: <20260108022450.88086-1-dongml2@chinatelecom.cn> <20260108022450.88086-5-dongml2@chinatelecom.cn> Precedence: bulk X-Mailing-List: bpf@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/10 10:40, Alexei Starovoitov wrote: > On Wed, Jan 7, 2026 at 6:25=E2=80=AFPM Menglong Dong wrote: > > > > + } else if (func_id =3D=3D special_kfunc_list[KF_bpf_session_is_= return]) { > > + if (prog->expected_attach_type =3D=3D BPF_TRACE_FSESSIO= N) > > + addr =3D (unsigned long)bpf_fsession_is_return; >=20 > ... >=20 > > +bool bpf_fsession_is_return(void *ctx) > > +{ > > + /* This helper call is inlined by verifier. */ > > + return !!(((u64 *)ctx)[-1] & (1 << BPF_TRAMP_M_IS_RETURN)); > > +} > > + >=20 > Why do this specialization and introduce a global function > that will never be called, since it will be inlined anyway? Ah, the specialization and the definition of the global function is not unnecessary. I thought that it's kinda fallback solution that we define the function even if it is inlined by the verifier. >=20 > Remove the first hunk and make the 2nd a comment instead of a real functi= on? Agree. So it will be: +static bool bpf_fsession_is_return(void *ctx) +{ + /* This helper call is implemented and inlined by the verifier, and= the logic is: + * return !!(((u64 *)ctx)[-1] & (1 << BPF_TRAMP_M_IS_RETURN)); + */ + return false; +} >=20 >=20