diff options
author | Greg Banks <gnb@melbourne.sgi.com> | 2006-10-04 05:15:47 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-04 10:55:16 -0400 |
commit | 7adae489fe794e3e203ff168595f635d0b845e59 (patch) | |
tree | f20544b72bdaea7cff0d340b5b4e5bfcaf2ce8fb /include/linux/sunrpc/msg_prot.h | |
parent | 3cc03b164cf01c6f36e64720b58610d292fb26f7 (diff) |
[PATCH] knfsd: Prepare knfsd for support of 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.
The biggest change here involves replacing NFSSVC_MAXBLKSIZE by a function of
the rqstp. This allows it to be different for different protocols (udp/tcp)
and also allows it to depend on the servers declared sv_bufsiz.
Note that we don't actually increase sv_bufsz for nfs yet. That comes next.
Signed-off-by: Greg Banks <gnb@melbourne.sgi.com>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/sunrpc/msg_prot.h')
-rw-r--r-- | include/linux/sunrpc/msg_prot.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/include/linux/sunrpc/msg_prot.h b/include/linux/sunrpc/msg_prot.h index 8d10d148834e..1e65f2dd80e5 100644 --- a/include/linux/sunrpc/msg_prot.h +++ b/include/linux/sunrpc/msg_prot.h | |||
@@ -11,6 +11,9 @@ | |||
11 | 11 | ||
12 | #define RPC_VERSION 2 | 12 | #define RPC_VERSION 2 |
13 | 13 | ||
14 | /* size of an XDR encoding unit in bytes, i.e. 32bit */ | ||
15 | #define XDR_UNIT (4) | ||
16 | |||
14 | /* spec defines authentication flavor as an unsigned 32 bit integer */ | 17 | /* spec defines authentication flavor as an unsigned 32 bit integer */ |
15 | typedef u32 rpc_authflavor_t; | 18 | typedef u32 rpc_authflavor_t; |
16 | 19 | ||
@@ -34,6 +37,9 @@ enum rpc_auth_flavors { | |||
34 | RPC_AUTH_GSS_SPKMP = 390011, | 37 | RPC_AUTH_GSS_SPKMP = 390011, |
35 | }; | 38 | }; |
36 | 39 | ||
40 | /* Maximum size (in bytes) of an rpc credential or verifier */ | ||
41 | #define RPC_MAX_AUTH_SIZE (400) | ||
42 | |||
37 | enum rpc_msg_type { | 43 | enum rpc_msg_type { |
38 | RPC_CALL = 0, | 44 | RPC_CALL = 0, |
39 | RPC_REPLY = 1 | 45 | RPC_REPLY = 1 |
@@ -101,5 +107,39 @@ typedef __be32 rpc_fraghdr; | |||
101 | #define RPC_FRAGMENT_SIZE_MASK (~RPC_LAST_STREAM_FRAGMENT) | 107 | #define RPC_FRAGMENT_SIZE_MASK (~RPC_LAST_STREAM_FRAGMENT) |
102 | #define RPC_MAX_FRAGMENT_SIZE ((1U << 31) - 1) | 108 | #define RPC_MAX_FRAGMENT_SIZE ((1U << 31) - 1) |
103 | 109 | ||
110 | /* | ||
111 | * RPC call and reply header size as number of 32bit words (verifier | ||
112 | * size computed separately, see below) | ||
113 | */ | ||
114 | #define RPC_CALLHDRSIZE (6) | ||
115 | #define RPC_REPHDRSIZE (4) | ||
116 | |||
117 | |||
118 | /* | ||
119 | * Maximum RPC header size, including authentication, | ||
120 | * as number of 32bit words (see RFCs 1831, 1832). | ||
121 | * | ||
122 | * xid 1 xdr unit = 4 bytes | ||
123 | * mtype 1 | ||
124 | * rpc_version 1 | ||
125 | * program 1 | ||
126 | * prog_version 1 | ||
127 | * procedure 1 | ||
128 | * cred { | ||
129 | * flavor 1 | ||
130 | * length 1 | ||
131 | * body<RPC_MAX_AUTH_SIZE> 100 xdr units = 400 bytes | ||
132 | * } | ||
133 | * verf { | ||
134 | * flavor 1 | ||
135 | * length 1 | ||
136 | * body<RPC_MAX_AUTH_SIZE> 100 xdr units = 400 bytes | ||
137 | * } | ||
138 | * TOTAL 210 xdr units = 840 bytes | ||
139 | */ | ||
140 | #define RPC_MAX_HEADER_WITH_AUTH \ | ||
141 | (RPC_CALLHDRSIZE + 2*(2+RPC_MAX_AUTH_SIZE/4)) | ||
142 | |||
143 | |||
104 | #endif /* __KERNEL__ */ | 144 | #endif /* __KERNEL__ */ |
105 | #endif /* _LINUX_SUNRPC_MSGPROT_H_ */ | 145 | #endif /* _LINUX_SUNRPC_MSGPROT_H_ */ |