Skip to contentSkip to conversation

bpf: update docs on CONFIG_FUNCTION_ERROR_INJECTION

PATCH Superseded Martin Kelly 2 participants 5 messages Oct 10, 2024 BPF

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bpf: update docs on CONFIG_FUNCTION_ERROR_INJECTION

The documentation says CONFIG_FUNCTION_ERROR_INJECTION is supported only on x86. This was presumably true at the time of writing, but it's now supported on many other architectures too, so drop the part of the statement mentioning x86.

---
 include/uapi/linux/bpf.h       | 3 +--
 tools/include/uapi/linux/bpf.h | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)
include/uapi/linux/bpf.h +1 -2
index 8ab4d8184b9d..a2ddfc8c8ed9 100644
@@ -3105,8 +3105,7 @@ union bpf_attr {
  * 		**ALLOW_ERROR_INJECTION** in the kernel code.
  *
  * 		Also, the helper is only available for the architectures having
- * 		the CONFIG_FUNCTION_ERROR_INJECTION option. As of this writing,
- * 		x86 architecture is the only one to support this feature.
+ * 		the CONFIG_FUNCTION_ERROR_INJECTION option.
  * 	Return
  * 		0
  *
tools/include/uapi/linux/bpf.h +1 -2
index 7610883c8191..15c9364b8d7d 100644
@@ -3105,8 +3105,7 @@ union bpf_attr {
  * 		**ALLOW_ERROR_INJECTION** in the kernel code.
  *
  * 		Also, the helper is only available for the architectures having
- * 		the CONFIG_FUNCTION_ERROR_INJECTION option. As of this writing,
- * 		x86 architecture is the only one to support this feature.
+ * 		the CONFIG_FUNCTION_ERROR_INJECTION option.
  * 	Return
  * 		0
  *
Signature · 1 line
2.34.1
#1 lore raw
Quoted 17 lines · Martin Kelly

The documentation says CONFIG_FUNCTION_ERROR_INJECTION is supported only on x86. This was presumably true at the time of writing, but it's now supported on many other architectures too, so drop the part of the statement mentioning x86.

---
 include/uapi/linux/bpf.h       | 3 +--
 tools/include/uapi/linux/bpf.h | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)
include/uapi/linux/bpf.h +0 -0
index 8ab4d8184b9d..a2ddfc8c8ed9 100644

include/uapi/linux/bpf.h union bpf_attr { · line 3108

Quoted 6 lines
include/uapi/linux/bpf.h +1 -2
@@ -3105,8 +3105,7 @@ union bpf_attr {
  *             **ALLOW_ERROR_INJECTION** in the kernel code.
  *
  *             Also, the helper is only available for the architectures having
- *             the CONFIG_FUNCTION_ERROR_INJECTION option. As of this writing,
- *             x86 architecture is the only one to support this feature.
+ *             the CONFIG_FUNCTION_ERROR_INJECTION option.

Something like this is good to add to Documentation/fault-injection/fault-injection.rst and may be a link to it somewhere in Documentation/bpf/.

But uapi/bpf.h is not such place.

pw-bot: cr

#2 lore raw
Quoted 35 lines · Alexei Starovoitov
Quoted 22 lines · Martin Kelly

The documentation says CONFIG_FUNCTION_ERROR_INJECTION is supported only
on x86. This was presumably true at the time of writing, but it's now
supported on many other architectures too, so drop the part of the statement mentioning x86.

---
 include/uapi/linux/bpf.h       | 3 +--
 tools/include/uapi/linux/bpf.h | 3 +--

 2 files changed, 2 insertions(+), 4 deletions(-)
include/uapi/linux/bpf.h +0 -0
index 8ab4d8184b9d..a2ddfc8c8ed9 100644
@@ -3105,8 +3105,7 @@ union bpf_attr {
   *             **ALLOW_ERROR_INJECTION** in the kernel code.
   *
   *             Also, the helper is only available for the
Quoted 6 lines

architectures having
- *             the CONFIG_FUNCTION_ERROR_INJECTION option. As of this writing,
- *             x86 architecture is the only one to support this feature.
+ *             the CONFIG_FUNCTION_ERROR_INJECTION option.

Something like this is good to add to Documentation/fault-injection/fault-injection.rst and may be a link to it somewhere in Documentation/bpf/.

Quoted 3 lines

But uapi/bpf.h is not such place.

pw-bot: cr

Would you prefer to just remove the sentence altogether? Currently, this statement is already in the headers, so I think it's best to either correct it or remove it, but not leave it the way it is (which is not very accurate).

#3 lore raw
Quoted 37 lines · Martin Kelly
Quoted 35 lines · Alexei Starovoitov
Quoted 22 lines · Martin Kelly

The documentation says CONFIG_FUNCTION_ERROR_INJECTION is supported only
on x86. This was presumably true at the time of writing, but it's now
supported on many other architectures too, so drop the part of the statement mentioning x86.

---
 include/uapi/linux/bpf.h       | 3 +--
 tools/include/uapi/linux/bpf.h | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)
include/uapi/linux/bpf.h +0 -0
index 8ab4d8184b9d..a2ddfc8c8ed9 100644
@@ -3105,8 +3105,7 @@ union bpf_attr {
  *             **ALLOW_ERROR_INJECTION** in the kernel code.
  *
  *             Also, the helper is only available for the
Quoted 6 lines

architectures having
- * the CONFIG_FUNCTION_ERROR_INJECTION option. As of
this writing,
- * x86 architecture is the only one to support this
feature.
+ * the CONFIG_FUNCTION_ERROR_INJECTION option.

Something like this is good to add to Documentation/fault-injection/fault-injection.rst and may be a link to it somewhere in Documentation/bpf/.

Quoted 8 lines
Quoted 3 lines

But uapi/bpf.h is not such place.

pw-bot: cr

Would you prefer to just remove the sentence altogether? Currently, this statement is already in the headers, so I think it's best to either correct it or remove it, but not leave it the way it is (which is not very accurate).

I say let's remove the whole paragraph then.

.h already says
"It is only available if the kernel was compiled
with the **CONFIG_BPF_KPROBE_OVERRIDE** configuration option,"

which in turn depends on:

config BPF_KPROBE_OVERRIDE
bool "Enable BPF programs to override a kprobed function" depends on BPF_EVENTS
depends on FUNCTION_ERROR_INJECTION

No need to duplicate kconfig dependencies as a doc in .h

#4 lore raw
Quoted 62 lines · Alexei Starovoitov
Quoted 45 lines · Martin Kelly
Quoted 43 lines · Alexei Starovoitov
Quoted 26 lines · Martin Kelly

The documentation says CONFIG_FUNCTION_ERROR_INJECTION is supported
only
on x86. This was presumably true at the time of writing, but it's
now
supported on many other architectures too, so drop the part of the
statement mentioning x86.

---
 include/uapi/linux/bpf.h       | 3 +--
 tools/include/uapi/linux/bpf.h | 3 +--

 2 files changed, 2 insertions(+), 4 deletions(-)
include/uapi/linux/bpf.h +0 -0
index 8ab4d8184b9d..a2ddfc8c8ed9 100644
@@ -3105,8 +3105,7 @@ union bpf_attr {
   *             **ALLOW_ERROR_INJECTION** in the kernel code.
   *
   *             Also, the helper is only available for the
Quoted 8 lines

architectures having
- *             the CONFIG_FUNCTION_ERROR_INJECTION option. As of
this writing,
- *             x86 architecture is the only one to support this
feature.
+ *             the CONFIG_FUNCTION_ERROR_INJECTION option.

Something like this is good to add to Documentation/fault-injection/fault-injection.rst and may be a link to it somewhere in Documentation/bpf/.

But uapi/bpf.h is not such place.

Quoted 7 lines
Quoted 1 line

pw-bot: cr

Would you prefer to just remove the sentence altogether? Currently, this statement is already in the headers, so I think it's best to either correct it or remove it, but not leave it the way it is (which
is not very accurate).

I say let's remove the whole paragraph then.

.h already says
"It is only available if the kernel was compiled with the **CONFIG_BPF_KPROBE_OVERRIDE** configuration option,"

Quoted 8 lines

which in turn depends on:

config BPF_KPROBE_OVERRIDE
        bool "Enable BPF programs to override a kprobed function" depends on BPF_EVENTS
        depends on FUNCTION_ERROR_INJECTION

No need to duplicate kconfig dependencies as a doc in .h

Agreed. I sent a v2 with the paragraph removed.