New pragmas for the xdrgen tool
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest10 patches 1 replyIn review
- v210 patches 1 replySuperseded
- v110 patches 0 repliesSuperseded
Changes in v3 from the cover letter
- Fail svcxdr_encode_opaque_payload() if the prefix overruns the head.
- Count an array of a "pages" type as reaching its payload twice.
- Reject a "pages" type reachable from both an argument and a result.
- Require a maximum size on an aggregate variable-length array.
- Fail the optional-data aggregate decoder instead of consuming nothing.
- Link to v2: https://lore.kernel.org/r/[email protected]
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/10 | SUNRPC: Carry a generated-codec context pointer in struct xdr_streamfs/ include/ include/ +1 more | +6 | 1 reply | |
| 2/10 | SUNRPC: Bind the svc_rqst to its XDR streamsinclude/ | +18 | 0 replies | |
| 3/10 | SUNRPC: Add svcxdr_encode_opaque_payload()include/ | +35 | 0 replies | |
| 4/10 | xdrgen: Pass the containing struct name to member codec emitterstools/ tools/ | +16 | 0 replies | |
| 5/10 | xdrgen: Add a "pragma pages" directivetools/ tools/ tools/ +5 more | +376 | 0 replies | |
| 6/10 | SUNRPC: Add svcxdr_decode_opaque_payload()include/ | +33 | 0 replies | |
| 7/10 | xdrgen: Extend the pages directive to page-resident argumentsinclude/ tools/ tools/ +7 more | +223 | 0 replies | |
| 8/10 | xdrgen: Add hook-driven aggregate codec for variable-length arraysinclude/ tools/ tools/ +5 more | +417 | 0 replies | |
| 9/10 | xdrgen: Extend the aggregate codec to optional-data list memberstools/ tools/ tools/ +2 more | +177 | 0 replies | |
| 10/10 | xdrgen: Stream optional-data aggregate lists during encodeinclude/ tools/ tools/ | +28 | 0 replies |
Reviews trailers per patch
All 10 patches have a Reviewed-by or Acked-by.
| Patch | Jeff Layton | NeilBrown |
|---|---|---|
| 1/10 | A-b | R-b |
| 2/10 | A-b | |
| 3/10 | A-b | |
| 4/10 | A-b | |
| 5/10 | A-b | |
| 6/10 | A-b | |
| 7/10 | A-b | |
| 8/10 | A-b | |
| 9/10 | A-b | |
| 10/10 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v3 00/10] New pragmas for the xdrgen tool
The NFSv2, NFSv3, and NFS_ACL conversions to xdrgen-generated codecs need two important new features in the xdrgen tool to deal with a few of the more complex structures that XDR can express.
The first is a payload that resides in the Linux page cache. Currently the generated codec for a variable-length opaque copies through a data pointer, but a READ result already sits in the pages of rq_res and a WRITE payload arrives in the pages of the Receive buffer. Marshaling and unmarshaling this type of payload needs to avoid copying the payload's content.
The second is an array of non-scalar objects. Examples include the NFS_ACL aclent<> list, which is the on-the-wire form of the kernel's posix_acl, and the READDIR entry list, which is produced from a VFS iteration.
No in-tree XDR specification applies either directive yet, so the generated output remains unchanged across the whole series.
---
Changes in v3:
- Fail svcxdr_encode_opaque_payload() if the prefix overruns the head.
- Count an array of a "pages" type as reaching its payload twice.
- Reject a "pages" type reachable from both an argument and a result.
- Require a maximum size on an aggregate variable-length array.
- Fail the optional-data aggregate decoder instead of consuming nothing.
- Link to v2: https://lore.kernel.org/r/[email protected]
Changes in v2:
- Reject a type whose members reach more than one "pages" payload.
- Reject an aggregate element type with nested variable-length storage.
- Require a pointer element type for an optional-data aggregate.
- Reject an optional-data aggregate in an RPC argument type.
- Document how a producer reports an error that stops the list.
- Link to v1: https://lore.kernel.org/r/[email protected]
Chuck Lever (10):
SUNRPC: Carry a generated-codec context pointer in struct xdr_stream
SUNRPC: Bind the svc_rqst to its XDR streams
SUNRPC: Add svcxdr_encode_opaque_payload()
xdrgen: Pass the containing struct name to member codec emitters
xdrgen: Add a "pragma pages" directive
SUNRPC: Add svcxdr_decode_opaque_payload()
xdrgen: Extend the pages directive to page-resident arguments
xdrgen: Add hook-driven aggregate codec for variable-length arrays
xdrgen: Extend the aggregate codec to optional-data list members
xdrgen: Stream optional-data aggregate lists during encode
fs/nfsd/nfs4xdr.c | 1 + include/linux/sunrpc/svc.h | 86 +++ include/linux/sunrpc/xdr.h | 1 + include/linux/sunrpc/xdrgen/_defs.h | 34 ++ net/sunrpc/xdr.c | 3 + tools/net/sunrpc/xdrgen/README | 152 +++++- tools/net/sunrpc/xdrgen/generators/pointer.py | 68 ++- tools/net/sunrpc/xdrgen/generators/struct.py | 203 ++++++- tools/net/sunrpc/xdrgen/generators/union.py | 69 ++- tools/net/sunrpc/xdrgen/grammars/xdr.lark | 2 + .../C/pointer/decoder/pages_opaque.j2 | 6 + .../C/pointer/definition/pages_opaque.j2 | 5 + .../C/pointer/encoder/pages_opaque.j2 | 10 + .../C/struct/declaration/aggregate_hooks.j2 | 14 + .../C/struct/decoder/aggregate_array.j2 | 33 ++ .../C/struct/decoder/aggregate_optional.j2 | 10 + .../C/struct/decoder/pages_opaque.j2 | 6 + .../C/struct/definition/pages_opaque.j2 | 5 + .../C/struct/encoder/aggregate_array.j2 | 37 ++ .../C/struct/encoder/aggregate_optional.j2 | 29 + .../C/struct/encoder/pages_opaque.j2 | 10 + .../templates/C/union/encoder/pages_opaque.j2 | 10 + tools/net/sunrpc/xdrgen/xdr_ast.py | 501 ++++++++++++++++++ 23 files changed, 1252 insertions(+), 43 deletions(-) create mode 100644 tools/net/sunrpc/xdrgen/templates/C/pointer/decoder/pages_opaque.j2 create mode 100644 tools/net/sunrpc/xdrgen/templates/C/pointer/definition/pages_opaque.j2 create mode 100644 tools/net/sunrpc/xdrgen/templates/C/pointer/encoder/pages_opaque.j2 create mode 100644 tools/net/sunrpc/xdrgen/templates/C/struct/declaration/aggregate_hooks.j2 create mode 100644 tools/net/sunrpc/xdrgen/templates/C/struct/decoder/aggregate_array.j2 create mode 100644 tools/net/sunrpc/xdrgen/templates/C/struct/decoder/aggregate_optional.j2 create mode 100644 tools/net/sunrpc/xdrgen/templates/C/struct/decoder/pages_opaque.j2 create mode 100644 tools/net/sunrpc/xdrgen/templates/C/struct/definition/pages_opaque.j2 create mode 100644 tools/net/sunrpc/xdrgen/templates/C/struct/encoder/aggregate_array.j2 create mode 100644 tools/net/sunrpc/xdrgen/templates/C/struct/encoder/aggregate_optional.j2 create mode 100644 tools/net/sunrpc/xdrgen/templates/C/struct/encoder/pages_opaque.j2 create mode 100644 tools/net/sunrpc/xdrgen/templates/C/union/encoder/pages_opaque.j2
Signature · 1 line
2.55.0