| c61a3753 | 07-Feb-2026 |
Jakub Kicinski <kuba@kernel.org> |
tools: ynltool: add qstats analysis for HW-GRO efficiency / savings
Extend ynltool to compute HW GRO savings metric - how many packets has HW GRO been able to save the kernel from seeing.
Note that
tools: ynltool: add qstats analysis for HW-GRO efficiency / savings
Extend ynltool to compute HW GRO savings metric - how many packets has HW GRO been able to save the kernel from seeing.
Note that this definition does not actually take into account whether the segments were or weren't eligible for HW GRO. If a machine is receiving all-UDP traffic - new metric will show HW-GRO savings of 0%. Conversely since the super-packet still counts as a received packet, savings of 100% is not achievable. Perfect HW-GRO on a machine with 4k MTU and 64kB super-frames would show ~93.75% savings. With 1.5k MTU we may see up to ~97.8% savings (if my math is right).
Example after 10 sec of iperf on a freshly booted machine with 1.5k MTU:
$ ynltool qstats show eth0 rx-packets: 40681280 rx-bytes: 61575208437 rx-alloc-fail: 0 rx-hw-gro-packets: 1225133 rx-hw-gro-wire-packets: 40656633 $ ynltool qstats hw-gro eth0: 96.9% savings
None of the NICs I have access to can report "missed" HW-GRO opportunities so computing a true "effectiveness" metric is not possible. One could also argue that effectiveness metric is inferior in environments where we control both senders and receivers, the savings metrics will capture both regressions in receiver's HW GRO effectiveness but also regressions in senders sending smaller TSO trains. And we care about both. The main downside is that it's hard to tell at a glance how well the NIC is doing because the savings will be dependent on traffic patterns.
Reviewed-by: Petr Machata <petrm@nvidia.com> Link: https://patch.msgid.link/20260207003509.3927744-4-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 6bc85bab | 09-Jan-2026 |
Chuck Lever <chuck.lever@oracle.com> |
xdrgen: Implement pass-through lines in specifications
XDR specification files can contain lines prefixed with '%' that pass through unchanged to generated output. Traditional rpcgen removes the '%'
xdrgen: Implement pass-through lines in specifications
XDR specification files can contain lines prefixed with '%' that pass through unchanged to generated output. Traditional rpcgen removes the '%' and emits the remainder verbatim, allowing direct insertion of C includes, pragma directives, or other language- specific content into the generated code.
Until now, xdrgen silently discarded these lines during parsing. This prevented specifications from including necessary headers or preprocessor directives that might be required for the generated code to compile correctly.
The grammar now captures pass-through lines instead of ignoring them. A new AST node type represents pass-through content, and the AST transformer strips the leading '%' character. Definition and source generators emit pass-through content in document order, preserving the original placement within the specification.
This brings xdrgen closer to feature parity with traditional rpcgen while maintaining the existing document-order processing model.
Existing generated xdrgen source code has been regenerated.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
show more ...
|
| 5288993c | 26-Dec-2025 |
Chuck Lever <chuck.lever@oracle.com> |
xdrgen: Add enum value validation to generated decoders
XDR enum decoders generated by xdrgen do not verify that incoming values are valid members of the enum. Incoming out-of-range values from mali
xdrgen: Add enum value validation to generated decoders
XDR enum decoders generated by xdrgen do not verify that incoming values are valid members of the enum. Incoming out-of-range values from malicious or buggy peers propagate through the system unchecked.
Add validation logic to generated enum decoders using a switch statement that explicitly lists valid enumerator values. The compiler optimizes this to a simple range check when enum values are dense (contiguous), while correctly rejecting invalid values for sparse enums with gaps in their value ranges.
The --no-enum-validation option on the source subcommand disables this validation when not needed.
The minimum and maximum fields in _XdrEnum, which were previously unused placeholders for a range-based validation approach, have been removed since the switch-based validation handles both dense and sparse enums correctly.
Because the new mechanism results in substantive changes to generated code, existing .x files are regenerated. Unrelated white space and semicolon changes in the generated code are due to recent commit 1c873a2fd110 ("xdrgen: Don't generate unnecessary semicolon") and commit 38c4df91242b ("xdrgen: Address some checkpatch whitespace complaints").
Reviewed-by: NeilBrown <neil@brown.name> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
show more ...
|
| 4c53b890 | 26-Dec-2025 |
Chuck Lever <chuck.lever@oracle.com> |
xdrgen: Emit a max_arg_sz macro
struct svc_service has a .vs_xdrsize field that is filled in by servers for each of their RPC programs. This field is supposed to contain the size of the largest proc
xdrgen: Emit a max_arg_sz macro
struct svc_service has a .vs_xdrsize field that is filled in by servers for each of their RPC programs. This field is supposed to contain the size of the largest procedure argument in the RPC program. This value is also sometimes used to size network transport buffers.
Currently, server implementations must manually calculate and hard-code this value, which is error-prone and requires updates when procedure arguments change.
Update xdrgen to determine which procedure argument structure is largest, and emit a macro with a well-known name that contains the size of that structure. Server code then uses this macro when initializing the .vs_xdrsize field.
For NLM version 4, xdrgen now emits:
#define NLM4_MAX_ARGS_SZ (NLM4_nlm4_lockargs_sz)
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
show more ...
|
| 63a5425f | 26-Dec-2025 |
Chuck Lever <chuck.lever@oracle.com> |
xdrgen: Extend error reporting to AST transformation phase
Commit 277df18d7df9 ("xdrgen: Improve parse error reporting") added clean, compiler-style error messages for syntax errors detected during
xdrgen: Extend error reporting to AST transformation phase
Commit 277df18d7df9 ("xdrgen: Improve parse error reporting") added clean, compiler-style error messages for syntax errors detected during parsing. However, semantic errors discovered during AST transformation still produce verbose Python stack traces.
When an XDR specification references an undefined type, the transformer raises a VisitError wrapping a KeyError. Before this change:
Traceback (most recent call last): File ".../lark/visitors.py", line 124, in _call_userfunc return f(children) ... KeyError: 'fsh4_mode' ... lark.exceptions.VisitError: Error trying to process rule "basic": 'fsh4_mode'
After this change:
file.x:156:2: semantic error Undefined type 'fsh4_mode'
fsh4_mode mode; ^
The new handle_transform_error() function extracts position information from the Lark tree node metadata and formats the error consistently with parse error messages.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
show more ...
|
| 9abb3549 | 22-Dec-2025 |
Chuck Lever <chuck.lever@oracle.com> |
xdrgen: Improve parse error reporting
The current verbose Lark exception output makes it difficult to quickly identify and fix syntax errors in XDR specifications. Users must wade through hundreds o
xdrgen: Improve parse error reporting
The current verbose Lark exception output makes it difficult to quickly identify and fix syntax errors in XDR specifications. Users must wade through hundreds of lines of cascading errors to find the root cause.
Replace this with concise, compiler-style error messages showing file, line, column, the unexpected token, and the source line with a caret pointing to the error location.
Before: Unexpected token Token('__ANON_1', '+1') at line 14, column 35. Expected one of: * SEMICOLON Previous tokens: [Token('__ANON_0', 'LM_MAXSTRLEN')] [hundreds more cascading errors...]
After: file.x:14:35: parse error Unexpected number '+1'
const LM_MAXNAMELEN = LM_MAXSTRLEN+1; ^
The error handler now raises XdrParseError on the first error, preventing cascading messages that obscure the root cause.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
show more ...
|
| eb1f3b55 | 22-Dec-2025 |
Chuck Lever <chuck.lever@oracle.com> |
xdrgen: Remove inclusion of nlm4.h header
The client-side source code template mistakenly includes the nlm4.h header file, which is specific to the NLM protocol and should not be present in the gene
xdrgen: Remove inclusion of nlm4.h header
The client-side source code template mistakenly includes the nlm4.h header file, which is specific to the NLM protocol and should not be present in the generic template that generates client stubs for all XDR-based protocols.
Fixes: 903a7d37d9ea ("xdrgen: Update the files included in client-side source code") Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
show more ...
|
| ae78eb49 | 16-Dec-2025 |
Chuck Lever <chuck.lever@oracle.com> |
xdrgen: Implement short (16-bit) integer types
"short" and "unsigned short" types are not defined in RFC 4506, but are supported by the rpcgen program. An upcoming protocol specification includes at
xdrgen: Implement short (16-bit) integer types
"short" and "unsigned short" types are not defined in RFC 4506, but are supported by the rpcgen program. An upcoming protocol specification includes at least one "unsigned short" field, so xdrgen needs to implement support for these types.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
show more ...
|
| bf0fe9ad | 08-Dec-2025 |
Chuck Lever <chuck.lever@oracle.com> |
xdrgen: Fix struct prefix for typedef types in program wrappers
The program templates for decoder/argument.j2 and encoder/result.j2 unconditionally add 'struct' prefix to all types. This is incorrec
xdrgen: Fix struct prefix for typedef types in program wrappers
The program templates for decoder/argument.j2 and encoder/result.j2 unconditionally add 'struct' prefix to all types. This is incorrect when an RPC protocol specification lists a typedef'd basic type or an enum as a procedure argument or result (e.g., NFSv2's fhandle or stat), resulting in compiler errors when building generated C code.
Fixes: 4b132aacb076 ("tools: Add xdrgen") Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
show more ...
|
| 4329010a | 01-Dec-2025 |
Chuck Lever <chuck.lever@oracle.com> |
xdrgen: Address some checkpatch whitespace complaints
This is a roll-up of three template fixes that eliminate noise from checkpatch output so that it's easier to spot non-trivial problems.
To foll
xdrgen: Address some checkpatch whitespace complaints
This is a roll-up of three template fixes that eliminate noise from checkpatch output so that it's easier to spot non-trivial problems.
To follow conventional kernel C style, when a union declaration is marked with "pragma public", there should be a blank line between the emitted "union xxx { ... };" and the decoder and encoder function declarations.
Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
show more ...
|
| 60411ade | 11-Jan-2026 |
Jakub Kicinski <kuba@kernel.org> |
tools: ynl: cli: print reply in combined format if possible
As pointed out during review of the --list-attrs support the GET ops very often return the same attrs from do and dump. Make the output mo
tools: ynl: cli: print reply in combined format if possible
As pointed out during review of the --list-attrs support the GET ops very often return the same attrs from do and dump. Make the output more readable by combining the reply information, from:
Do request attributes: - ifindex: u32 netdev ifindex
Do reply attributes: - ifindex: u32 netdev ifindex [ .. other attrs .. ]
Dump reply attributes: - ifindex: u32 netdev ifindex [ .. other attrs .. ]
To, after:
Do request attributes: - ifindex: u32 netdev ifindex
Do and Dump reply attributes: - ifindex: u32 netdev ifindex [ .. other attrs .. ]
Tested-by: Gal Pressman <gal@nvidia.com> Acked-by: Stanislav Fomichev <sdf@fomichev.me> Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20260110233142.3921386-8-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 6ccc421b | 11-Jan-2026 |
Jakub Kicinski <kuba@kernel.org> |
tools: ynl: cli: extract the event/notify handling in --list-attrs
Event and notify handling is quite different from do / dump handling. Forcing it into print_mode_attrs() doesn't really buy us anyt
tools: ynl: cli: extract the event/notify handling in --list-attrs
Event and notify handling is quite different from do / dump handling. Forcing it into print_mode_attrs() doesn't really buy us anything as events and notifications do not have requests. Call print_attr_list() directly. Apart form subjective code clarity this also removes the word "reply" from the output:
Before:
Event reply attributes:
Now:
Event attributes:
Tested-by: Gal Pressman <gal@nvidia.com> Acked-by: Stanislav Fomichev <sdf@fomichev.me> Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20260110233142.3921386-7-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 45b99bb4 | 11-Jan-2026 |
Jakub Kicinski <kuba@kernel.org> |
tools: ynl: cli: factor out --list-attrs / --doc handling
We'll soon add more code to the --doc handling. Factor it out to avoid making main() too long.
Tested-by: Gal Pressman <gal@nvidia.com> Ack
tools: ynl: cli: factor out --list-attrs / --doc handling
We'll soon add more code to the --doc handling. Factor it out to avoid making main() too long.
Tested-by: Gal Pressman <gal@nvidia.com> Acked-by: Stanislav Fomichev <sdf@fomichev.me> Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20260110233142.3921386-6-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|