From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.182 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796445540; b=CV7ACSPltQW9x4jgaobmUtB4ZsDAauwfSTA0eTtkIL9x7isoZ1efqoQ9JzIJv98jes3k GmesGobXK7JodTFvv4s/mVSmjz/HKx+Rc7uqX6dNaZJTz4nyBZY1Po/BMSQOcNIUud2Pn s3753215OYTq+nsIqV4/I3l+vNK+L11wA23cHjg+2KpcLDCdrTuIiGN8d1jJk5/YC67KP a18ZB3IsD1fHgxFmX3XPL3Dfb8FxsaQ++g8QspREvoP0HS0jYtS+B6a9lHOg0wyagt8aj mXkecT3JsuWa3QSILfZZSjMRJ3f0x+QA/9BkPpaekP6GCZTfVIMEf78yiygrj6OiCfA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796445540; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Content-Type:Date:Message-Id:From:To:Cc:Subject:In-Reply-To: References:Content-Transfer-Encoding:MIME-Version; bh=dl+nc17p0ogm+udo8qdpTSC4jEgkxfyHbgR2wavd1rk=; b=ZQqB48340U3nyCUCNG8OozsYgBhfG3tmfTitsmww4w1st5ICe3iFYxt5N10dFMbDJqj2 1byLD5KW/7N7VlM7NJbL5M4fczeKy8TKJkVLUY8eujg3UUt4t0wBWZgoJgUYVvu6KAAQd kN1zG8uiKjU/I6Bgu1dHX3yh/s0DwVKPSnj+RxaSzVrSLwBDeIeZBMU3l0OzVyCCxKAAW 1HLluD82xbm6iR7fWTLXhvxZFgN77NGBKSEGwHK34TQsWqGKFCn9sPyAAXthrpJwl2bMD WQ4bRYdG4T0fEyzG68egH34ZV95OIs1iI1z6u8ZwhcAgMJSH3xt+bABff0JrcqeS4HQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=PonUoJQo; arc=none smtp.remote-ip=209.85.210.182 Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A5C12606A330 for ; Sat, 5 Dec 2026 04:38:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A5C12606A330 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=PonUoJQo Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-8a0880a46e7so1111245b3a.1 for ; Fri, 04 Dec 2026 20:38:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796445539; x=1797050339; darn=lists.linux.dev; h=mime-version:content-transfer-encoding:references:in-reply-to :subject:cc:to:from:message-id:date:content-type:from:to:cc:subject :date:message-id:reply-to:content-type; bh=dl+nc17p0ogm+udo8qdpTSC4jEgkxfyHbgR2wavd1rk=; b=PonUoJQoP3VjOOY/bkG417pVEsVdfRA63o38PeUNljHyelU1IDIIBKinxIWiwvhtpB 4kuEVsbsnN6NDF9hWm+z2O4hYzvwdekLbDS1uTAmX5J8YkooTJgrpWpSWiEVgwUDHVJh lw75mtDJ3S2yvJFvOKivc/XWXT0qf78kRhI/cWwDQCodic2KXGz0BSQS0RIV/x8P/oe2 3+xd88mOsDOL+U8sxp6IWu1esj1gLtI+piNUabE+ANg3HKygD9AXmahpSX0FKi+d61Jm vm87RI5D7Rv3dgnYs9mBpQeTzeRmHxlWDOqWf6z87HNCvVD8Bln8SruMS6cnQyK2lnZC eNNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796445539; x=1797050339; h=mime-version:content-transfer-encoding:references:in-reply-to :subject:cc:to:from:message-id:date:content-type:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=dl+nc17p0ogm+udo8qdpTSC4jEgkxfyHbgR2wavd1rk=; b=AASNJIahNdAVp7NMXG9zLEENqej5OWg5w86nZv2twYNZrCf9AcXyZ8q0PStFIzDQEy DF6auBmf7oXhRYrzfjhLjBLaiNp+wHD8ockeRFj+sK8ugK/agMlTA7sqdZvfZwbzgNoR qGT7XsUxRItXkDLpiN9DoSdgP2m0oHVQElMK5wWXcjQAT7slGobkOGumh/hLGEt5nCA6 HazFsNV2svWeOpR+1xNSY6zqkfC5PrPkb0VXAXJcwxD++3DjQtgyfmHoJLiNMUwTm3bU tKe2KTxbj1+R0RfvJtW1Sbdzn4vct1G+axkLbywo9UuBht9zm6k4YLhamseLPngDVh4u ZJCw== X-Forwarded-Encrypted: i=1; AL+hErGs2XpnMaNiq7OJo6Nq1sg62OPhsZfEgz/g0pDxgUxKHuHy0NjbtleR5dKIRYrTOH4+CtYeqzLHW8g=@lists.linux.dev X-Gm-Message-State: APuU4Z9VXqxFliaFhK0y53Gyvdf0lKsGjYARjjpeA0KnWy9cV5tkeXQ4 yAwfxTuQa2UHEqNp1y5bkKespan+kKCXTpOWCiRdknFAN5aGa0zUSdsT5+N64Q== X-Gm-Gg: AZFdTZcOEQcIrpDWm4Jk9T0Nk1xMy4mdwRfvlhMmW6wVG+DTyY0Xw5SKLfz6KpqLDM3 qhGySGeoba1Y8X+e1MGwWGxNq4KgyKq1YIIFeAyNOlB6dM/ruQPTWw1kCDzHyiWqODbJL30G488 3OnFovc3sHZfQNkfFS5SRQNjuBvGH0m0ZrRSrWLbt3CPG82bYdVuMvHlK3627jhSF9OJ452S2vN VhsFgSzFuAXZqvgIN+qjmgbfspwguefwRZDqh3NBHogJ/nlVJoh2jaTs5zv0US2fdC9TVHzBj5z k8zavxiswkLzhEhzqltFlKqhyPWfRs1rTtC1un5N4C4IlUPhOY1NwOcyttt7dagGIskPtYNsJ53 0+K3BP9v8VvWQeNC+OfsfNdU7VOP1cNRqzTVTns/Yvmew7mEX+cRU50YTuSV4nW5Wkjtd93lMD8 hM/GBkgwWGu7qjEoXV46B6qmkfn2zyoplvgt4EuER1/IK+ienxQnbzbFO8mVL9a7rEyr3P+y2hc tbdQVPlHz8FQ7/YKX4fPDj7tEVqrdIX3yxR4O9iFsiGXAWKRrjdPhS7KSWaka1JbdZfDupxZ9D7 i4S9vLjqiWhAVsDeniHCMpaB3WLOrIGKsIr6OMkvAP/IkKB5IhgRZtsLCNxFkox9JbfyMxn3yBo wATSNP84pZg/Ov3t8c+gYPvYgBo9sdETvcw== X-Received: by 2002:a05:6a00:2d1f:b0:8a0:3617:b53a with SMTP id d2e1a72fcca58-8de2d81b197mr2709395b3a.18.1796445538538; Fri, 04 Dec 2026 20:38:58 -0800 (PST) Received: from localhost ([153.61.198.242]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8de1397c685sm2793311b3a.55.2026.12.04.20.38.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Dec 2026 20:38:58 -0800 (PST) Content-Type: text/plain; charset=UTF-8 Date: Sat, 05 Dec 2026 04:38:57 +0000 Message-Id: From: "Alexei Starovoitov" To: "Ihor Solodrai" , "Eduard Zingerman" , "Andrii Nakryiko" , "Daniel Borkmann" , "Kumar Kartikeya Dwivedi" Cc: "Alan Maguire" , "Emil Tsalapatis" , "Jiri Olsa" , "Song Liu" , "Tejun Heo" , "Yonghong Song" , , , Subject: Re: [PATCH bpf-next v3 3/6] libbpf: Resolve kfunc variants by prototype In-Reply-To: References: <20261124224811.16134-1-ihor.solodrai@linux.dev> <20261124224811.16134-4-ihor.solodrai@linux.dev> Content-Transfer-Encoding: 8bit X-Mailing-List: sched-ext@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 On Thu, Dec 03, 2026 at 08:51 PM Ihor Solodrai wrote: > IMO TL;DR given our prior discussions is that we can accept the > breakages. An updated (or additional, depending on what kernels BPF > program tries to cover) kfunc declaration on BPF side fixes them. Thanks for the analysis. The breakage is kinda bad. In the past we beat the drum that libbpf is backward compatible. Ask Andrii about systemd ... I don't think we want to repeat that story. Let's find a way to do it without breaking? > With this series, such a declaration doesn't resolve on v6.1 to > v6.10. No single declaration resolves on both sides of v6.11. A > program that has to run on both sides can declare both prototypes and > choose in the prog: bpf_kfuncs.h in v6.6 has 'struct __sk_buff *' and 'struct bpf_dynptr *' too, and no __weak. commit cce4c40b9606 changed the kernel side in place. That was safe only because bpf_core_types_are_compat() accepts any two structs. v6.1-v6.10 have no variants. There is one candidate and nothing to select. can we use the struct names only as a tie-break ? No candidate passes kfunc_type_match() and exactly one passes bpf_core_types_are_compat(): take that one. libbpf does the same today. foo(struct a *) next to foo___v1(struct b *) still resolves by the name. bpf_cpumask_populate() keeps working on both sides too. > With this series its essential name is scx_bpf_dsq_insert___v2, while > the kernel's scx_bpf_dsq_insert___v2 is a variant of > scx_bpf_dsq_insert. So it stays unresolved, and compat.bpf.h falls > back to scx_bpf_dsq_insert(). Patch 2 makes compat.bpf.h try > scx_bpf_dsq_insert___v2 first; the scx repo needs the same change. can we cut the func name at the first ___ instead of the last ? Then scx_bpf_dsq_insert___v2___compat gets the candidates of scx_bpf_dsq_insert, and the bool return type selects scx_bpf_dsq_insert___v2(). The existing scx binaries keep working. No need for patch 2 and for the change in the scx repo. I haven't actually tested this idea, but sounds plausible.