Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796076074; b=pDP4lUic5IgyXOqpltc/C9cAINVCoW4qLfSejbJG/VYlQ2Pkqv/+a1VICpqgt122GkjB o4u8CUmYCiwRnOYiS2O8DM8JAq0rhO9ZssJM1lsL5SUeKLZW5CJfC8Mr5rriV7XToHwDE 4sv0+Zjx4M1xBJ2IClciFZhwKJ3BRi6sZ0m90ZHuvxhJqp89sLDUEv/MK4KswvoLdIQ+G ILtyCvWleEbgb2b5H8c8BEuDCCu+FbZOxHmkJZogZ0cKdL2t///rjuyb9DmjEBsn+qYuv fr6O3UHeJP1qTA4R1manlyd6UB+NWCzj+aXeIt5hQwLGiju1GTDu8lj48m8ZbICMXJQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796076074; h=Received:DKIM-Signature:From:Date:Subject:MIME-Version:Content-Type: Content-Transfer-Encoding:Message-Id:References:In-Reply-To:To:Cc: X-Mailer:X-Developer-Signature:X-Developer-Key; bh=rj4gk9E+7W9kCojGZl4256C0OkkhFhWzW7yHQFhbrG4=; b=j4Co8dZSzK9EA5cFxYQsK5lP6lwDgLZxiB/12Wa3NMPBsdkLo+Te+eXHA3cwTNByT0YP uF42iADBe1TmRSwZqdAtRdI/5XAhwsvCVgFmYc5ux0x3b4Qoov5avWmM7tAU0SNeGL18o lEk6kCWfdeWJB4DgYlPJPr4DNtY/1/77/EOAjGuUCngnpAMit9O6z/LkUsZZqPQ4WvMmp e7bBPBZ/xfcILBSMftKskmuK2cK7sthHtZSqiiflYYyNNz/7+1NjlLTm7UIeGTvHT0R0v cpBLJuYjQcJH7U5uO0xeWIN6mc7MzxZHyhxpsdyrbRpECw+XWoG+4Vg1HB7vCJm2WrA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=HStQ7XXL; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 823DF606A31A for ; Mon, 30 Nov 2026 22:01:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=HStQ7XXL Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF8931F00896; Mon, 30 Nov 2026 22:01:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796076074; bh=rj4gk9E+7W9kCojGZl4256C0OkkhFhWzW7yHQFhbrG4=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=HStQ7XXLyMr+C5Kc6GRnzLqJ07Q5LeCpKOSnTO6b0sKFC0555jvDje/m6UZZBxOy+ 2VX7uZ9PYkO/uVuxHLnwQq5bbE+YW53FRbwCOLZJXXUhJScJQR9Id12v3ADNQtLyhG Qq2ov1YwdnknUI7UtDiF7eQ6j0bhxn1IwFmZ8p7/DNf4530Yej5SfT3lVqFq3vCdSw +0gULVX/qETN2x2xhAz04o/flidMSdM9wPKtNqlmutGQMK4oZyKxuTqZDmt+TREgLr tTFhLpRuww8uvj0oWGNFHCe1+vzINYtw78Xst2ps+tX/Xa9m0iHFpmyb2rFD1vSLo0 KGPq08XOp3gIA== From: Chuck Lever Date: Mon, 30 Nov 2026 17:00:59 -0500 Subject: [PATCH 6/7] xdrgen: Document where the grammar departs from RFC 4506 X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20261130-xdrgen-passthru-v1-6-eb16e76fd3ee@kernel.org> References: <20261130-xdrgen-passthru-v1-0-eb16e76fd3ee@kernel.org> In-Reply-To: <20261130-xdrgen-passthru-v1-0-eb16e76fd3ee@kernel.org> To: Jeff Layton , NeilBrown , Olga Kornievskaia , Dai Ngo , Tom Talpey Cc: linux-nfs@vger.kernel.org, Chuck Lever X-Mailer: b4 0.17-dev-9c833 X-Developer-Signature: v=1; a=openpgp-sha256; l=2378; i=cel@kernel.org; h=from:subject:message-id; bh=bQ25F5GsVL9qvU2zwB1rHKWVANc4tZtfZA6y1V7pY9o=; b=owEBbQKS/ZANAwAKATNqszNvZn+XAcsmYgBrDfIi+A4PmLHXwCStajvm77JK8KUDr21utUUTg YUvRhTRTSWJAjMEAAEKAB0WIQQosuWwEobfJDzyPv4zarMzb2Z/lwUCaw3yIgAKCRAzarMzb2Z/ l8YdEAC7BQNusGP/WgZMjZVQ2BoEeBlmblohuRWUvrWqF3uYEaSjMDOgMupVuY/0DYmyUiWplxc 8Fw3Lsu10in8GCAGgxDdcQWyhjXTlJqiSKcljQFcY846XBwPEe8qd8GD/8sYAEDzYKwfj8RZqYz 26GaM0FbDOO2Y4veaJC2PZJOthRHmjj+yQJMqpgmPQj6Z3KgG1ecJJMs1qpZqpLBNRYJUFwxgG3 sEka5nGOIHVCSH/rOaD5F66Cw5h/34C/xSkbE1kAqQHsz5ut39/wECBbHIDwMJBztzMOdPNoIQY 0gf112A+SjZE2KBwsqAcP8LLIH1S5ziYAKJR6VueIUiYRR/gOxGjF37fZBjnCq9FZt5y1jzZe30 nxBkzzMr1OzKD2dwfTmxgwp8blF0q4VCIIPCrR+H8zc0pCb7yh2AWT1K7MmeYjH00CIdN0VAiJ+ LPkwxHwy9hfz9sO6XQeWz/8H3+VLBiOEOYvYI7DQotbn+fucq01s3DgF066q+AUiOdpFGdrWXWw URCp55+HKHPNQSbY64wVUN9lVHwPSp+e6GuQrgopUnr4k9C9mKGTeK0uSdB7/ySRTpm11n5uKPS /kOgyRWxRT6NY9qhRtCeDtmDelLw44tRoQiX3zlQany7vL+aQRSjOBSXJLqNzsFd5bByhL3J29L S7WkTHwDYUVKDrw== X-Developer-Key: i=cel@kernel.org; a=openpgp; fpr=28B2E5B01286DF243CF23EFE336AB3336F667F97 The README states that the RFC 4506 grammar "has been adapted for use by the Python Lark module", but not how. A .x author cannot tell from the README which constructs xdrgen adds to the RFC's language, which RFC constructs xdrgen refuses, or why. Add a section that lists each difference and notes, item by item, whether rpcgen behaves the same way. The additional type specifiers are there because legacy RFCs use them. The pragma directives let a .x file stay close to the RFC it was extracted from while still carrying the requirements of the local implementation. Signed-off-by: Chuck Lever --- tools/net/sunrpc/xdrgen/README | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tools/net/sunrpc/xdrgen/README b/tools/net/sunrpc/xdrgen/README index 9f831b447a59..205a96c0216f 100644 --- a/tools/net/sunrpc/xdrgen/README +++ b/tools/net/sunrpc/xdrgen/README @@ -143,6 +143,33 @@ a compiler that can optimize in a number of ways, including: And so on. +Differences from RFC 4506 +------------------------- + +xdrgen's input language follows RFC 4506 Section 6.3, with these +differences: + + - "long", "short", "unsigned long" and "unsigned short" are accepted + as type specifiers, as rpcgen accepts them. RFC 4506 does not + define them, but legacy RFCs use them. RFC 1813, for example, + defines uint32 as "unsigned long". + - "program" and "version" definitions are accepted, as rpcgen accepts + them. They belong to the RPC language in RFC 5531 Section 12, not + to RFC 4506. + - "pragma" directives are accepted. rpcgen does not accept them. A + pragma states a requirement of the local implementation without + changing the XDR around it, so the .x file stays close to the RFC + it was extracted from. See "Pragmas" below. + - "%" lines are accepted and discarded. rpcgen copies their text to + its output. See "Pass-through lines" below. + - The value of a "const" definition can be an identifier, as in + rpcgen. RFC 4506 requires a constant there. + - A decimal constant can carry a leading "+". rpcgen does not accept + one. + - A struct, enum or union body in place of a type name is rejected, + as rpcgen rejects it. RFC 4506 permits one. Define a named type + instead. + Pass-through lines ------------------ -- 2.56.0