Skip to contentSkip to conversation

bpf, docs: Clarify call local offset

PATCH Applied Dave Thaler 4 participants 4 messages May 25, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bpf, docs: Clarify call local offset

In the Jump instructions section it explains that the offset is "relative to the instruction following the jump instruction". But the program-local section confusingly said "referenced by offset from the call instruction, similar to JA".

This patch updates that sentence with consistent wording, saying it's relative to the instruction following the call instruction.

---
 Documentation/bpf/standardization/instruction-set.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/bpf/standardization/instruction-set.rst +1 -1
index 00c93eb42..6bb5ae7e4 100644
@@ -520,7 +520,7 @@ identifies the helper name and type.
 Program-local functions
 ~~~~~~~~~~~~~~~~~~~~~~~
 Program-local functions are functions exposed by the same BPF program as the
-caller, and are referenced by offset from the call instruction, similar to
+caller, and are referenced by offset from the instruction following the call instruction, similar to
 ``JA``.  The offset is encoded in the 'imm' field of the call instruction.
 An ``EXIT`` within the program-local function will return to the caller.
 
Signature · 1 line
2.40.1
reviewer Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Dave Thaler

In the Jump instructions section it explains that the offset is "relative to the instruction following the jump instruction". But the program-local section confusingly said "referenced by offset from the call instruction, similar to JA".

This patch updates that sentence with consistent wording, saying it's relative to the instruction following the call instruction.

#2 lore raw
In reply to Dave Thaler
Quoted 19 lines · Dave Thaler

In the Jump instructions section it explains that the offset is "relative to the instruction following the jump instruction". But the program-local section confusingly said "referenced by offset from the call instruction, similar to JA".

This patch updates that sentence with consistent wording, saying it's relative to the instruction following the call instruction.

---
 Documentation/bpf/standardization/instruction-set.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/bpf/standardization/instruction-set.rst +0 -0
index 00c93eb42..6bb5ae7e4 100644

Documentation/bpf/standardization/instruction-set.rst identifies the helper name and type. · line 525

Quoted 7 lines
Documentation/bpf/standardization/instruction-set.rst +1 -1
@@ -520,7 +520,7 @@ identifies the helper name and type.
 Program-local functions
 ~~~~~~~~~~~~~~~~~~~~~~~
 Program-local functions are functions exposed by the same BPF program as the
-caller, and are referenced by offset from the call instruction, similar to
+caller, and are referenced by offset from the instruction following the call instruction, similar to
 ``JA``.  The offset is encoded in the 'imm' field of the call instruction.
 An ``EXIT`` within the program-local function will return to the caller.

I reformatted a few following lines to make it fit into 80 col while applying. Thanks!

#3 lore raw
In reply to Dave Thaler
This patch was applied to bpf/bpf-next.git (master) by Alexei Starovoitov <[email protected]>:

Hello:

This patch was applied to bpf/bpf-next.git (master) by Alexei Starovoitov <[email protected]>:

Quoted 9 lines · On Sat, 25 May 2024 08:33:32 -0700 you wrote:

In the Jump instructions section it explains that the offset is "relative to the instruction following the jump instruction". But the program-local section confusingly said "referenced by offset from the call instruction, similar to JA".

This patch updates that sentence with consistent wording, saying it's relative to the instruction following the call instruction.

[...]

Here is the summary with links:
- [bpf-next] bpf, docs: Clarify call local offset

    https://git.kernel.org/bpf/bpf-next/c/f980f13e4eb2

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html