ietf-wg-bpf / ebpf-docs

eBPF Standard Documentation
37 stars 5 forks source link

ISA: clarify call local offset #150

Closed dthaler closed 1 month ago

dthaler commented 1 month ago

Under table 7 in the Jump instructions section it (correctly) says (from issue #130):

where 'PC' denotes the program counter, and the offset to increment by is in units of 64-bit instructions relative to the instruction following the jump instruction. Thus 'PC += 1' skips execution of the next instruction if it's a basic instruction or results in undefined behavior if the next instruction is a 128-bit wide instruction.

But then section 4.3.2 says:

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 JA.

It should more correctly say from the instruction following the call instruction.

dthaler commented 1 month ago

Proposed patch posted at https://mailarchive.ietf.org/arch/msg/bpf/ihI1175Pg574h-biBvimsce2ayA/

dthaler commented 1 month ago

Fixed in draft-03