[PATCH bpf-next] bpf: Add comment about helper freeze

Levi Zim via B4 Relay posted 1 patch 10 months, 1 week ago
include/uapi/linux/bpf.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
[PATCH bpf-next] bpf: Add comment about helper freeze
Posted by Levi Zim via B4 Relay 10 months, 1 week ago
From: Levi Zim <rsworktech@outlook.com>

Put a comment after the bpf helper list in uapi bpf.h to prevent people
from trying to add new helpers there and direct them to kfuncs.

Link: https://lore.kernel.org/bpf/CAEf4BzZvQF+QQ=oip4vdz5A=9bd+OmN-CXk5YARYieaipK9s+A@mail.gmail.com/
Link: https://lore.kernel.org/bpf/20221231004213.h5fx3loccbs5hyzu@macbook-pro-6.dhcp.thefacebook.com/
Suggested-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Levi Zim <rsworktech@outlook.com>
---
Put a comment after the bpf helper list in uapi bpf.h to prevent people
from trying to add new helpers there and direct them to kfuncs.
---
 include/uapi/linux/bpf.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index 2acf9b33637174bd16b1d12ccc6410c5f55a7ea9..fff6cdb8d11a2c211a6205ae2937b2bdf593cd42 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -6019,7 +6019,10 @@ union bpf_attr {
 	FN(user_ringbuf_drain, 209, ##ctx)		\
 	FN(cgrp_storage_get, 210, ##ctx)		\
 	FN(cgrp_storage_delete, 211, ##ctx)		\
-	/* */
+	/* This helper list is effectively frozen. If you are trying to	\
+	 * add a new helper, you should add a kfunc instead which has	\
+	 * less stability guarantees. See Documentation/bpf/kfuncs.rst	\
+	 */
 
 /* backwards-compatibility macros for users of __BPF_FUNC_MAPPER that don't
  * know or care about integer value that is now passed as second argument

---
base-commit: 03f3aa4a6b664270d502c7fb44c634cbe250261e
change-id: 20250204-bpf-helper-freeze-cf3e0b29fb63

Best regards,
-- 
Levi Zim <rsworktech@outlook.com>
Re: [PATCH bpf-next] bpf: Add comment about helper freeze
Posted by Daniel Xu 10 months, 1 week ago
On Tue, Feb 04, 2025 at 10:00:21AM +0800, Levi Zim via B4 Relay wrote:
> From: Levi Zim <rsworktech@outlook.com>
> 
> Put a comment after the bpf helper list in uapi bpf.h to prevent people
> from trying to add new helpers there and direct them to kfuncs.
> 
> Link: https://lore.kernel.org/bpf/CAEf4BzZvQF+QQ=oip4vdz5A=9bd+OmN-CXk5YARYieaipK9s+A@mail.gmail.com/
> Link: https://lore.kernel.org/bpf/20221231004213.h5fx3loccbs5hyzu@macbook-pro-6.dhcp.thefacebook.com/
> Suggested-by: Andrii Nakryiko <andrii@kernel.org>
> Signed-off-by: Levi Zim <rsworktech@outlook.com>
> ---
> Put a comment after the bpf helper list in uapi bpf.h to prevent people
> from trying to add new helpers there and direct them to kfuncs.
> ---
>  include/uapi/linux/bpf.h | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 

Acked-by: Daniel Xu <dxu@dxuuu.xyz>
Re: [PATCH bpf-next] bpf: Add comment about helper freeze
Posted by Bagas Sanjaya 10 months, 1 week ago
On Tue, Feb 04, 2025 at 10:00:21AM +0800, Levi Zim via B4 Relay wrote:
> -	/* */
> +	/* This helper list is effectively frozen. If you are trying to	\
> +	 * add a new helper, you should add a kfunc instead which has	\
> +	 * less stability guarantees. See Documentation/bpf/kfuncs.rst	\
> +	 */
>  

The wording looks good, thanks!

Reviewed-by: Bagas Sanjaya <bagasdotme@gmail.com>

-- 
An old man doll... just what I always wanted! - Clara