bpf, docs: Use RFC 2119 language for ISA requirements
Subsystems (3)
PATCH 1/1 bpf, docs: Use RFC 2119 language for ISA requirements
Per IETF convention and discussion at LSF/MM/BPF, use MUST etc. keywords as requested by IETF Area Director review. Also as requested, indicate that documenting BTF is out of scope of this document and will be covered by a separate IETF specification.
Added paragraph about the terminology that is required IETF boilerplate and must be worded exactly as such.
--- .../bpf/standardization/instruction-set.rst | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-)
Documentation/bpf/standardization/instruction-set.rst +16 -8
@@ -14,6 +14,13 @@ set architecture (ISA). Documentation conventions ========================= +The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", +"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and +"OPTIONAL" in this document are to be interpreted as described in +BCP 14 `<https://www.rfc-editor.org/info/rfc2119>`_ +`RFC8174 <https://www.rfc-editor.org/info/rfc8174>`_ +when, and only when, they appear in all capitals, as shown here. + For brevity and consistency, this document refers to families of types using a shorthand syntax and refers to several expository, mnemonic functions when describing the semantics of instructions.
@@ -106,9 +113,9 @@ Conformance groups An implementation does not need to support all instructions specified in this document (e.g., deprecated instructions). Instead, a number of conformance -groups are specified. An implementation must support the base32 conformance -group and may support additional conformance groups, where supporting a -conformance group means it must support all instructions in that conformance +groups are specified. An implementation MUST support the base32 conformance +group and MAY support additional conformance groups, where supporting a +conformance group means it MUST support all instructions in that conformance group. The use of named conformance groups enables interoperability between a runtime
@@ -209,7 +216,7 @@ For example:: 07 1 0 00 00 11 22 33 44 r1 += 0x11223344 // big Note that most instructions do not use all of the fields. -Unused fields shall be cleared to zero. +Unused fields SHALL be cleared to zero. Wide instruction encoding --------------------------
@@ -373,7 +380,7 @@ interpreted as a 64-bit signed value. Note that there are varying definitions of the signed modulo operation when the dividend or divisor are negative, where implementations often vary by language such that Python, Ruby, etc. differ from C, Go, Java, -etc. This specification requires that signed modulo use truncated division +etc. This specification requires that signed modulo MUST use truncated division (where -13 % 3 == -1) as implemented in C, Go, etc.:: a % n = a - n * trunc(a / n)
@@ -403,7 +410,7 @@ only and do not use a separate source register or immediate value. For ``ALU``, the 1-bit source operand field in the opcode is used to select what byte order the operation converts from or to. For ``ALU64``, the 1-bit source operand field in the opcode is reserved -and must be set to 0. +and MUST be set to 0. ===== ======== ===== ================================================= class source value description
@@ -514,7 +521,8 @@ for each program type, but static IDs are unique across all program types. Platforms that support the BPF Type Format (BTF) support identifying a helper function by a BTF ID encoded in the 'imm' field, where the BTF ID -identifies the helper name and type. +identifies the helper name and type. Further documentation of BTF +is outside the scope of this document and is left for future work. Program-local functions ~~~~~~~~~~~~~~~~~~~~~~~
@@ -724,5 +732,5 @@ carried over from classic BPF. These instructions used an instruction class of ``LD``, a size modifier of ``W``, ``H``, or ``B``, and a mode modifier of ``ABS`` or ``IND``. The 'dst_reg' and 'offset' fields were set to zero, and 'src_reg' was set to zero for ``ABS``. However, these -instructions are deprecated and should no longer be used. All legacy packet +instructions are deprecated and SHOULD no longer be used. All legacy packet access instructions belong to the "packet" conformance group.
Signature · 1 line
2.40.1
[...]
Quoted 1 line
Platforms that support the BPF Type Format (BTF) support identifying a
helper
Quoted 1 line
function by a BTF ID encoded in the 'imm' field, where the BTF ID
-identifies the
Review
Quoted 3 lines
helper name and type.
(quoted diff) +2
-0+identifies the helper name and type. Further documentation of BTF is +outside the scope of this document and is left for future work.
Perhaps we should informatively reference
https://www.kernel.org/doc/html/latest/bpf/btf.html for now?
Dave
Quoted 9 lines · Dave Thaler
Per IETF convention and discussion at LSF/MM/BPF, use MUST etc. keywords as requested by IETF Area Director review. Also as requested, indicate that documenting BTF is out of scope of this document and will be covered by a separate IETF specification.
Added paragraph about the terminology that is required IETF boilerplate and must be worded exactly as such.
Signed-off-by Dave Thaler <[email protected]>
We still have "may" in a couple of places, as in e.g.:
Note that there are two flavors of ``JA`` instructions. The ``JMP`` class permits a 16-bit jump offset specified by the 'offset' field, whereas the ``JMP32`` class permits a 32-bit jump offset specified by the 'imm' field. A > 16-bit conditional jump may be converted to a < 16-bit conditional jump plus a 32-bit unconditional jump.
Also in the "Helper functions" and "Maps" sections.
Do we need to fix those as well? Or are they considered semantically different than how RFC 2119 would define the terms?
Thanks,
David
Quoted 19 lines
-----Original Message-----
From: David Vernet <[email protected]>
Sent: Monday, May 20, 2024 4:18 PM
To: Dave Thaler <[email protected]>
Cc: [email protected]; [email protected]; Dave Thaler <[email protected]>
Subject: Re: [PATCH bpf-next] bpf, docs: Use RFC 2119 language for ISA requirementsQuoted 8 lines · Dave Thaler
Per IETF convention and discussion at LSF/MM/BPF, use MUST etc. keywords as requested by IETF Area Director review. Also as requested, indicate that documenting BTF is out of scope of this document and will be covered by a separate IETF specification.
Added paragraph about the terminology that is required IETF boilerplate and must be worded exactly as such.
Quoted 7 lines
Quoted 1 line
Signed-off-by Dave Thaler <[email protected]>Acked-by David Vernet <[email protected]>We still have "may" in a couple of places, as in e.g.:
Note that there are two flavors of ``JA`` instructions. The ``JMP`` class
permits a
Quoted 1 line
16-bit jump offset specified by the 'offset' field, whereas the ``JMP32``
class
Quoted 1 line
permits a 32-bit jump offset specified by the 'imm' field. A > 16-bit
conditional jump
Quoted 1 line
may be converted to a < 16-bit conditional jump plus a 32-bit
unconditional jump.
Quoted 4 lines
Also in the "Helper functions" and "Maps" sections.
Do we need to fix those as well? Or are they considered semantically
different
Quoted 1 line
than how RFC 2119 would define the terms?
Those are semantically different (i.e., I left them intentionally) as they are not
normative statements about what an ISA implementer would choose to do or not do, but rather informative statements to the reader that would be synonymous with
"can" or "might" in my reading.
Dave
Quoted 3 lines
Thanks,
David
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 Fri, 17 May 2024 09:58:55 -0700 you wrote:
Per IETF convention and discussion at LSF/MM/BPF, use MUST etc. keywords as requested by IETF Area Director review. Also as requested, indicate that documenting BTF is out of scope of this document and will be covered by a separate IETF specification.
Added paragraph about the terminology that is required IETF boilerplate and must be worded exactly as such.
[...]
Here is the summary with links:
- [bpf-next] bpf, docs: Use RFC 2119 language for ISA requirements
https://git.kernel.org/bpf/bpf-next/c/a985fdca5e7e
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
Looks good: