Increasing the server wsize/rsize
Chuck Lever
chucklever at gmail.com
Mon Jul 3 10:24:32 EDT 2006
On 7/3/06, Greg Banks <gnb at melbourne.sgi.com> wrote:
> On Fri, 2006-06-30 at 21:01, Greg Banks wrote:
> Here we go, latest version with all your feedback.
>
> --
> Make knfsd support rsize/wsize of up to 1MB, over TCP.
> The limit over UDP remains at 32K. Also, make some of
> the apparently arbitrary sizing constants clearer.
>
>
> From: Greg Banks <gnb at melbourne.sgi.com>
> Signed-off-by: Greg Banks <gnb at melbourne.sgi.com>
> Index: linux/include/linux/sunrpc/msg_prot.h
> ===================================================================
> --- linux.orig/include/linux/sunrpc/msg_prot.h 2006-06-30 19:40:17.315679992 +1000
> +++ linux/include/linux/sunrpc/msg_prot.h 2006-07-03 18:14:49.673913862 +1000
> @@ -11,6 +11,9 @@
>
> #define RPC_VERSION 2
>
> +/* size of an XDR encoding unit in bytes, i.e. 32bit */
> +#define XDR_UNIT (4)
> +
> /* spec defines authentication flavor as an unsigned 32 bit integer */
> typedef u32 rpc_authflavor_t;
>
> @@ -101,5 +104,39 @@ typedef u32 rpc_fraghdr;
> #define RPC_FRAGMENT_SIZE_MASK (~RPC_LAST_STREAM_FRAGMENT)
> #define RPC_MAX_FRAGMENT_SIZE ((1U << 31) - 1)
>
> +/*
> + * RPC call and reply header size as number of 32bit words (verifier
> + * size computed separately, see below)
> + */
> +#define RPC_CALLHDRSIZE 6
> +#define RPC_REPHDRSIZE 4
Overall this seems a lot cleaner!
Only a small nit: when adding these #defines, can you include
parenthesis around the definitions [eg. (6) and (4)] as you did with
the newly added #defines?
> +/*
> + * Maximum RPC header size, including authentication,
> + * as number of 32bit words (see RFCs 1831, 1832).
> + *
> + * xid 1 xdr unit = 4 bytes
> + * mtype 1
> + * rpc_version 1
> + * program 1
> + * prog_version 1
> + * procedure 1
> + * cred {
> + * flavor 1
> + * length 1
> + * body<RPC_MAX_AUTH_SIZE> 100 xdr units = 400 bytes
> + * }
> + * verf {
> + * flavor 1
> + * length 1
> + * body<RPC_MAX_AUTH_SIZE> 100 xdr units = 400 bytes
> + * }
> + * TOTAL 210 xdr units = 840 bytes
> + */
> +#define RPC_MAX_HEADER_WITH_AUTH \
> + (RPC_CALLHDRSIZE + 2*(2+RPC_MAX_AUTH_SIZE/4))
--
"We who cut mere stones must always be envisioning cathedrals"
-- Quarry worker's creed
More information about the NFSv4
mailing list