public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: cel@kernel.org
To: Neil Brown <neilb@suse.de>, Jeff Layton <jlayton@kernel.org>,
	Olga Kornievskaia <okorniev@redhat.com>,
	Dai Ngo <dai.ngo@oracle.com>, Tom Talpey <tom@talpey.com>
Cc: <linux-nfs@vger.kernel.org>, Chuck Lever <chuck.lever@oracle.com>
Subject: [PATCH v2 00/16] xdrgen: Emit maxsize macros
Date: Thu,  3 Oct 2024 14:54:30 -0400	[thread overview]
Message-ID: <20241003185446.82984-1-cel@kernel.org> (raw)

From: Chuck Lever <chuck.lever@oracle.com>

This series implements the generation of "maxsize" values for each
XDR data type defined in a specification. These are emitted as C
pre-processor macros, following the lead of existing XDR functions
in the kernel. The macros are added to the header file containing
C type definitions.

This facility takes xdrgen a step closer to the generation of all
XDR code needed for each RPC protocol implementation in the kernel.

Changes since v1:
- Resend including all 16 patches (d'oh)

Chuck Lever (16):
  xdrgen: Refactor transformer arms
  xdrgen: Track constant values
  xdrgen: Keep track of on-the-wire data type widths
  xdrgen: XDR widths for enum types
  xdrgen: XDR width for fixed-length opaque
  xdrgen: XDR width for variable-length opaque
  xdrgen: XDR width for a string
  xdrgen: XDR width for fixed-length array
  xdrgen: XDR width for variable-length array
  xdrgen: XDR width for optional_data type
  xdrgen: XDR width for typedef
  xdrgen: XDR width for struct types
  xdrgen: XDR width for pointer types
  xdrgen: XDR width for union types
  xdrgen: Add generator code for XDR width macros
  xdrgen: emit maxsize macros

 include/linux/sunrpc/xdrgen/_defs.h           |   9 +
 .../net/sunrpc/xdrgen/generators/__init__.py  |   4 +
 tools/net/sunrpc/xdrgen/generators/enum.py    |  13 +-
 tools/net/sunrpc/xdrgen/generators/pointer.py |  18 +-
 tools/net/sunrpc/xdrgen/generators/struct.py  |  18 +-
 tools/net/sunrpc/xdrgen/generators/typedef.py |  18 +-
 tools/net/sunrpc/xdrgen/generators/union.py   |  20 +-
 .../net/sunrpc/xdrgen/subcmds/definitions.py  |  24 +-
 tools/net/sunrpc/xdrgen/subcmds/source.py     |   3 +-
 .../xdrgen/templates/C/enum/maxsize/enum.j2   |   2 +
 .../templates/C/pointer/maxsize/pointer.j2    |   3 +
 .../templates/C/struct/maxsize/struct.j2      |   3 +
 .../templates/C/typedef/maxsize/basic.j2      |   3 +
 .../C/typedef/maxsize/fixed_length_opaque.j2  |   2 +
 .../templates/C/typedef/maxsize/string.j2     |   2 +
 .../typedef/maxsize/variable_length_array.j2  |   2 +
 .../typedef/maxsize/variable_length_opaque.j2 |   2 +
 .../xdrgen/templates/C/union/maxsize/union.j2 |   3 +
 tools/net/sunrpc/xdrgen/xdr_ast.py            | 292 ++++++++++++++++--
 19 files changed, 406 insertions(+), 35 deletions(-)
 create mode 100644 tools/net/sunrpc/xdrgen/templates/C/enum/maxsize/enum.j2
 create mode 100644 tools/net/sunrpc/xdrgen/templates/C/pointer/maxsize/pointer.j2
 create mode 100644 tools/net/sunrpc/xdrgen/templates/C/struct/maxsize/struct.j2
 create mode 100644 tools/net/sunrpc/xdrgen/templates/C/typedef/maxsize/basic.j2
 create mode 100644 tools/net/sunrpc/xdrgen/templates/C/typedef/maxsize/fixed_length_opaque.j2
 create mode 100644 tools/net/sunrpc/xdrgen/templates/C/typedef/maxsize/string.j2
 create mode 100644 tools/net/sunrpc/xdrgen/templates/C/typedef/maxsize/variable_length_array.j2
 create mode 100644 tools/net/sunrpc/xdrgen/templates/C/typedef/maxsize/variable_length_opaque.j2
 create mode 100644 tools/net/sunrpc/xdrgen/templates/C/union/maxsize/union.j2

-- 
2.46.2


             reply	other threads:[~2024-10-03 18:55 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-03 18:54 cel [this message]
2024-10-03 18:54 ` [PATCH v2 01/16] xdrgen: Refactor transformer arms cel
2024-10-03 18:54 ` [PATCH v2 02/16] xdrgen: Track constant values cel
2024-10-03 18:54 ` [PATCH v2 03/16] xdrgen: Keep track of on-the-wire data type widths cel
2024-10-03 18:54 ` [PATCH v2 04/16] xdrgen: XDR widths for enum types cel
2024-10-03 18:54 ` [PATCH v2 05/16] xdrgen: XDR width for fixed-length opaque cel
2024-10-03 18:54 ` [PATCH v2 06/16] xdrgen: XDR width for variable-length opaque cel
2024-10-03 18:54 ` [PATCH v2 07/16] xdrgen: XDR width for a string cel
2024-10-03 18:54 ` [PATCH v2 08/16] xdrgen: XDR width for fixed-length array cel
2024-10-03 18:54 ` [PATCH v2 09/16] xdrgen: XDR width for variable-length array cel
2024-10-03 18:54 ` [PATCH v2 10/16] xdrgen: XDR width for optional_data type cel
2024-10-03 18:54 ` [PATCH v2 11/16] xdrgen: XDR width for typedef cel
2024-10-03 18:54 ` [PATCH v2 12/16] xdrgen: XDR width for struct types cel
2024-10-03 18:54 ` [PATCH v2 13/16] xdrgen: XDR width for pointer types cel
2024-10-03 18:54 ` [PATCH v2 14/16] xdrgen: XDR width for union types cel
2024-10-03 18:54 ` [PATCH v2 15/16] xdrgen: Add generator code for XDR width macros cel
2024-10-03 18:54 ` [PATCH v2 16/16] xdrgen: emit maxsize macros cel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241003185446.82984-1-cel@kernel.org \
    --to=cel@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=dai.ngo@oracle.com \
    --cc=jlayton@kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=okorniev@redhat.com \
    --cc=tom@talpey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox