diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-15 13:46:05 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-15 13:47:35 -0400 |
commit | f4921aff5b174349bc36551f142a5dbac782ea3f (patch) | |
tree | bdff8ca1531977ad1d04ac8d70e10f8dfbb26c38 /include/linux/sunrpc | |
parent | 419217cb1d0266f62cbea6cdc6b1d1324350bc34 (diff) | |
parent | 05c88babab957dfd63bd351b25042d80bd854dd0 (diff) |
Merge git://git.linux-nfs.org/pub/linux/nfs-2.6
* git://git.linux-nfs.org/pub/linux/nfs-2.6: (131 commits)
NFSv4: Fix a typo in nfs_inode_reclaim_delegation
NFS: Add a boot parameter to disable 64 bit inode numbers
NFS: nfs_refresh_inode should clear cache_validity flags on success
NFS: Fix a connectathon regression in NFSv3 and NFSv4
NFS: Use nfs_refresh_inode() in ops that aren't expected to change the inode
SUNRPC: Don't call xprt_release in call refresh
SUNRPC: Don't call xprt_release() if call_allocate fails
SUNRPC: Fix buggy UDP transmission
[23/37] Clean up duplicate includes in
[2.6 patch] net/sunrpc/rpcb_clnt.c: make struct rpcb_program static
SUNRPC: Use correct type in buffer length calculations
SUNRPC: Fix default hostname created in rpc_create()
nfs: add server port to rpc_pipe info file
NFS: Get rid of some obsolete macros
NFS: Simplify filehandle revalidation
NFS: Ensure that nfs_link() returns a hashed dentry
NFS: Be strict about dentry revalidation when doing exclusive create
NFS: Don't zap the readdir caches upon error
NFS: Remove the redundant nfs_reval_fsid()
NFSv3: Always use directory post-op attributes in nfs3_proc_lookup
...
Fix up trivial conflict due to sock_owned_by_user() cleanup manually in
net/sunrpc/xprtsock.c
Diffstat (limited to 'include/linux/sunrpc')
-rw-r--r-- | include/linux/sunrpc/clnt.h | 2 | ||||
-rw-r--r-- | include/linux/sunrpc/debug.h | 5 | ||||
-rw-r--r-- | include/linux/sunrpc/msg_prot.h | 13 | ||||
-rw-r--r-- | include/linux/sunrpc/rpc_rdma.h | 116 | ||||
-rw-r--r-- | include/linux/sunrpc/xdr.h | 5 | ||||
-rw-r--r-- | include/linux/sunrpc/xprt.h | 42 | ||||
-rw-r--r-- | include/linux/sunrpc/xprtrdma.h | 85 | ||||
-rw-r--r-- | include/linux/sunrpc/xprtsock.h | 51 |
8 files changed, 292 insertions, 27 deletions
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index c0d9d14983b3..d9d5c5ad826c 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
@@ -117,7 +117,7 @@ struct rpc_create_args { | |||
117 | 117 | ||
118 | struct rpc_clnt *rpc_create(struct rpc_create_args *args); | 118 | struct rpc_clnt *rpc_create(struct rpc_create_args *args); |
119 | struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, | 119 | struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, |
120 | struct rpc_program *, int); | 120 | struct rpc_program *, u32); |
121 | struct rpc_clnt *rpc_clone_client(struct rpc_clnt *); | 121 | struct rpc_clnt *rpc_clone_client(struct rpc_clnt *); |
122 | void rpc_shutdown_client(struct rpc_clnt *); | 122 | void rpc_shutdown_client(struct rpc_clnt *); |
123 | void rpc_release_client(struct rpc_clnt *); | 123 | void rpc_release_client(struct rpc_clnt *); |
diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h index 3912cf16361e..3347c72b848a 100644 --- a/include/linux/sunrpc/debug.h +++ b/include/linux/sunrpc/debug.h | |||
@@ -88,6 +88,11 @@ enum { | |||
88 | CTL_SLOTTABLE_TCP, | 88 | CTL_SLOTTABLE_TCP, |
89 | CTL_MIN_RESVPORT, | 89 | CTL_MIN_RESVPORT, |
90 | CTL_MAX_RESVPORT, | 90 | CTL_MAX_RESVPORT, |
91 | CTL_SLOTTABLE_RDMA, | ||
92 | CTL_RDMA_MAXINLINEREAD, | ||
93 | CTL_RDMA_MAXINLINEWRITE, | ||
94 | CTL_RDMA_WRITEPADDING, | ||
95 | CTL_RDMA_MEMREG, | ||
91 | }; | 96 | }; |
92 | 97 | ||
93 | #endif /* _LINUX_SUNRPC_DEBUG_H_ */ | 98 | #endif /* _LINUX_SUNRPC_DEBUG_H_ */ |
diff --git a/include/linux/sunrpc/msg_prot.h b/include/linux/sunrpc/msg_prot.h index 784d4c3ef651..c4beb5775111 100644 --- a/include/linux/sunrpc/msg_prot.h +++ b/include/linux/sunrpc/msg_prot.h | |||
@@ -138,6 +138,19 @@ typedef __be32 rpc_fraghdr; | |||
138 | #define RPC_MAX_HEADER_WITH_AUTH \ | 138 | #define RPC_MAX_HEADER_WITH_AUTH \ |
139 | (RPC_CALLHDRSIZE + 2*(2+RPC_MAX_AUTH_SIZE/4)) | 139 | (RPC_CALLHDRSIZE + 2*(2+RPC_MAX_AUTH_SIZE/4)) |
140 | 140 | ||
141 | /* | ||
142 | * RFC1833/RFC3530 rpcbind (v3+) well-known netid's. | ||
143 | */ | ||
144 | #define RPCBIND_NETID_UDP "udp" | ||
145 | #define RPCBIND_NETID_TCP "tcp" | ||
146 | #define RPCBIND_NETID_UDP6 "udp6" | ||
147 | #define RPCBIND_NETID_TCP6 "tcp6" | ||
148 | |||
149 | /* | ||
150 | * Note that RFC 1833 does not put any size restrictions on the | ||
151 | * netid string, but all currently defined netid's fit in 4 bytes. | ||
152 | */ | ||
153 | #define RPCBIND_MAXNETIDLEN (4u) | ||
141 | 154 | ||
142 | #endif /* __KERNEL__ */ | 155 | #endif /* __KERNEL__ */ |
143 | #endif /* _LINUX_SUNRPC_MSGPROT_H_ */ | 156 | #endif /* _LINUX_SUNRPC_MSGPROT_H_ */ |
diff --git a/include/linux/sunrpc/rpc_rdma.h b/include/linux/sunrpc/rpc_rdma.h new file mode 100644 index 000000000000..0013a0d8dc6b --- /dev/null +++ b/include/linux/sunrpc/rpc_rdma.h | |||
@@ -0,0 +1,116 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2003-2007 Network Appliance, Inc. All rights reserved. | ||
3 | * | ||
4 | * This software is available to you under a choice of one of two | ||
5 | * licenses. You may choose to be licensed under the terms of the GNU | ||
6 | * General Public License (GPL) Version 2, available from the file | ||
7 | * COPYING in the main directory of this source tree, or the BSD-type | ||
8 | * license below: | ||
9 | * | ||
10 | * Redistribution and use in source and binary forms, with or without | ||
11 | * modification, are permitted provided that the following conditions | ||
12 | * are met: | ||
13 | * | ||
14 | * Redistributions of source code must retain the above copyright | ||
15 | * notice, this list of conditions and the following disclaimer. | ||
16 | * | ||
17 | * Redistributions in binary form must reproduce the above | ||
18 | * copyright notice, this list of conditions and the following | ||
19 | * disclaimer in the documentation and/or other materials provided | ||
20 | * with the distribution. | ||
21 | * | ||
22 | * Neither the name of the Network Appliance, Inc. nor the names of | ||
23 | * its contributors may be used to endorse or promote products | ||
24 | * derived from this software without specific prior written | ||
25 | * permission. | ||
26 | * | ||
27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
30 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
31 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
32 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
33 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
34 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
35 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
36 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
37 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
38 | */ | ||
39 | |||
40 | #ifndef _LINUX_SUNRPC_RPC_RDMA_H | ||
41 | #define _LINUX_SUNRPC_RPC_RDMA_H | ||
42 | |||
43 | struct rpcrdma_segment { | ||
44 | uint32_t rs_handle; /* Registered memory handle */ | ||
45 | uint32_t rs_length; /* Length of the chunk in bytes */ | ||
46 | uint64_t rs_offset; /* Chunk virtual address or offset */ | ||
47 | }; | ||
48 | |||
49 | /* | ||
50 | * read chunk(s), encoded as a linked list. | ||
51 | */ | ||
52 | struct rpcrdma_read_chunk { | ||
53 | uint32_t rc_discrim; /* 1 indicates presence */ | ||
54 | uint32_t rc_position; /* Position in XDR stream */ | ||
55 | struct rpcrdma_segment rc_target; | ||
56 | }; | ||
57 | |||
58 | /* | ||
59 | * write chunk, and reply chunk. | ||
60 | */ | ||
61 | struct rpcrdma_write_chunk { | ||
62 | struct rpcrdma_segment wc_target; | ||
63 | }; | ||
64 | |||
65 | /* | ||
66 | * write chunk(s), encoded as a counted array. | ||
67 | */ | ||
68 | struct rpcrdma_write_array { | ||
69 | uint32_t wc_discrim; /* 1 indicates presence */ | ||
70 | uint32_t wc_nchunks; /* Array count */ | ||
71 | struct rpcrdma_write_chunk wc_array[0]; | ||
72 | }; | ||
73 | |||
74 | struct rpcrdma_msg { | ||
75 | uint32_t rm_xid; /* Mirrors the RPC header xid */ | ||
76 | uint32_t rm_vers; /* Version of this protocol */ | ||
77 | uint32_t rm_credit; /* Buffers requested/granted */ | ||
78 | uint32_t rm_type; /* Type of message (enum rpcrdma_proc) */ | ||
79 | union { | ||
80 | |||
81 | struct { /* no chunks */ | ||
82 | uint32_t rm_empty[3]; /* 3 empty chunk lists */ | ||
83 | } rm_nochunks; | ||
84 | |||
85 | struct { /* no chunks and padded */ | ||
86 | uint32_t rm_align; /* Padding alignment */ | ||
87 | uint32_t rm_thresh; /* Padding threshold */ | ||
88 | uint32_t rm_pempty[3]; /* 3 empty chunk lists */ | ||
89 | } rm_padded; | ||
90 | |||
91 | uint32_t rm_chunks[0]; /* read, write and reply chunks */ | ||
92 | |||
93 | } rm_body; | ||
94 | }; | ||
95 | |||
96 | #define RPCRDMA_HDRLEN_MIN 28 | ||
97 | |||
98 | enum rpcrdma_errcode { | ||
99 | ERR_VERS = 1, | ||
100 | ERR_CHUNK = 2 | ||
101 | }; | ||
102 | |||
103 | struct rpcrdma_err_vers { | ||
104 | uint32_t rdma_vers_low; /* Version range supported by peer */ | ||
105 | uint32_t rdma_vers_high; | ||
106 | }; | ||
107 | |||
108 | enum rpcrdma_proc { | ||
109 | RDMA_MSG = 0, /* An RPC call or reply msg */ | ||
110 | RDMA_NOMSG = 1, /* An RPC call or reply msg - separate body */ | ||
111 | RDMA_MSGP = 2, /* An RPC call or reply msg with padding */ | ||
112 | RDMA_DONE = 3, /* Client signals reply completion */ | ||
113 | RDMA_ERROR = 4 /* An RPC RDMA encoding error */ | ||
114 | }; | ||
115 | |||
116 | #endif /* _LINUX_SUNRPC_RPC_RDMA_H */ | ||
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index c6b53d181bfa..0751c9464d0f 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h | |||
@@ -70,7 +70,10 @@ struct xdr_buf { | |||
70 | 70 | ||
71 | struct page ** pages; /* Array of contiguous pages */ | 71 | struct page ** pages; /* Array of contiguous pages */ |
72 | unsigned int page_base, /* Start of page data */ | 72 | unsigned int page_base, /* Start of page data */ |
73 | page_len; /* Length of page data */ | 73 | page_len, /* Length of page data */ |
74 | flags; /* Flags for data disposition */ | ||
75 | #define XDRBUF_READ 0x01 /* target of file read */ | ||
76 | #define XDRBUF_WRITE 0x02 /* source of file write */ | ||
74 | 77 | ||
75 | unsigned int buflen, /* Total length of storage buffer */ | 78 | unsigned int buflen, /* Total length of storage buffer */ |
76 | len; /* Length of XDR encoded message */ | 79 | len; /* Length of XDR encoded message */ |
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index d11cedd14f0f..30b17b3bc1a9 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
@@ -19,25 +19,11 @@ | |||
19 | 19 | ||
20 | #ifdef __KERNEL__ | 20 | #ifdef __KERNEL__ |
21 | 21 | ||
22 | extern unsigned int xprt_udp_slot_table_entries; | ||
23 | extern unsigned int xprt_tcp_slot_table_entries; | ||
24 | |||
25 | #define RPC_MIN_SLOT_TABLE (2U) | 22 | #define RPC_MIN_SLOT_TABLE (2U) |
26 | #define RPC_DEF_SLOT_TABLE (16U) | 23 | #define RPC_DEF_SLOT_TABLE (16U) |
27 | #define RPC_MAX_SLOT_TABLE (128U) | 24 | #define RPC_MAX_SLOT_TABLE (128U) |
28 | 25 | ||
29 | /* | 26 | /* |
30 | * Parameters for choosing a free port | ||
31 | */ | ||
32 | extern unsigned int xprt_min_resvport; | ||
33 | extern unsigned int xprt_max_resvport; | ||
34 | |||
35 | #define RPC_MIN_RESVPORT (1U) | ||
36 | #define RPC_MAX_RESVPORT (65535U) | ||
37 | #define RPC_DEF_MIN_RESVPORT (665U) | ||
38 | #define RPC_DEF_MAX_RESVPORT (1023U) | ||
39 | |||
40 | /* | ||
41 | * This describes a timeout strategy | 27 | * This describes a timeout strategy |
42 | */ | 28 | */ |
43 | struct rpc_timeout { | 29 | struct rpc_timeout { |
@@ -53,6 +39,10 @@ enum rpc_display_format_t { | |||
53 | RPC_DISPLAY_PORT, | 39 | RPC_DISPLAY_PORT, |
54 | RPC_DISPLAY_PROTO, | 40 | RPC_DISPLAY_PROTO, |
55 | RPC_DISPLAY_ALL, | 41 | RPC_DISPLAY_ALL, |
42 | RPC_DISPLAY_HEX_ADDR, | ||
43 | RPC_DISPLAY_HEX_PORT, | ||
44 | RPC_DISPLAY_UNIVERSAL_ADDR, | ||
45 | RPC_DISPLAY_NETID, | ||
56 | RPC_DISPLAY_MAX, | 46 | RPC_DISPLAY_MAX, |
57 | }; | 47 | }; |
58 | 48 | ||
@@ -196,14 +186,22 @@ struct rpc_xprt { | |||
196 | char * address_strings[RPC_DISPLAY_MAX]; | 186 | char * address_strings[RPC_DISPLAY_MAX]; |
197 | }; | 187 | }; |
198 | 188 | ||
199 | struct rpc_xprtsock_create { | 189 | struct xprt_create { |
200 | int proto; /* IPPROTO_UDP or IPPROTO_TCP */ | 190 | int ident; /* XPRT_TRANSPORT identifier */ |
201 | struct sockaddr * srcaddr; /* optional local address */ | 191 | struct sockaddr * srcaddr; /* optional local address */ |
202 | struct sockaddr * dstaddr; /* remote peer address */ | 192 | struct sockaddr * dstaddr; /* remote peer address */ |
203 | size_t addrlen; | 193 | size_t addrlen; |
204 | struct rpc_timeout * timeout; /* optional timeout parameters */ | 194 | struct rpc_timeout * timeout; /* optional timeout parameters */ |
205 | }; | 195 | }; |
206 | 196 | ||
197 | struct xprt_class { | ||
198 | struct list_head list; | ||
199 | int ident; /* XPRT_TRANSPORT identifier */ | ||
200 | struct rpc_xprt * (*setup)(struct xprt_create *); | ||
201 | struct module *owner; | ||
202 | char name[32]; | ||
203 | }; | ||
204 | |||
207 | /* | 205 | /* |
208 | * Transport operations used by ULPs | 206 | * Transport operations used by ULPs |
209 | */ | 207 | */ |
@@ -212,7 +210,7 @@ void xprt_set_timeout(struct rpc_timeout *to, unsigned int retr, unsigned long | |||
212 | /* | 210 | /* |
213 | * Generic internal transport functions | 211 | * Generic internal transport functions |
214 | */ | 212 | */ |
215 | struct rpc_xprt * xprt_create_transport(struct rpc_xprtsock_create *args); | 213 | struct rpc_xprt *xprt_create_transport(struct xprt_create *args); |
216 | void xprt_connect(struct rpc_task *task); | 214 | void xprt_connect(struct rpc_task *task); |
217 | void xprt_reserve(struct rpc_task *task); | 215 | void xprt_reserve(struct rpc_task *task); |
218 | int xprt_reserve_xprt(struct rpc_task *task); | 216 | int xprt_reserve_xprt(struct rpc_task *task); |
@@ -235,6 +233,8 @@ static inline __be32 *xprt_skip_transport_header(struct rpc_xprt *xprt, __be32 * | |||
235 | /* | 233 | /* |
236 | * Transport switch helper functions | 234 | * Transport switch helper functions |
237 | */ | 235 | */ |
236 | int xprt_register_transport(struct xprt_class *type); | ||
237 | int xprt_unregister_transport(struct xprt_class *type); | ||
238 | void xprt_set_retrans_timeout_def(struct rpc_task *task); | 238 | void xprt_set_retrans_timeout_def(struct rpc_task *task); |
239 | void xprt_set_retrans_timeout_rtt(struct rpc_task *task); | 239 | void xprt_set_retrans_timeout_rtt(struct rpc_task *task); |
240 | void xprt_wake_pending_tasks(struct rpc_xprt *xprt, int status); | 240 | void xprt_wake_pending_tasks(struct rpc_xprt *xprt, int status); |
@@ -248,14 +248,6 @@ void xprt_release_rqst_cong(struct rpc_task *task); | |||
248 | void xprt_disconnect(struct rpc_xprt *xprt); | 248 | void xprt_disconnect(struct rpc_xprt *xprt); |
249 | 249 | ||
250 | /* | 250 | /* |
251 | * Socket transport setup operations | ||
252 | */ | ||
253 | struct rpc_xprt * xs_setup_udp(struct rpc_xprtsock_create *args); | ||
254 | struct rpc_xprt * xs_setup_tcp(struct rpc_xprtsock_create *args); | ||
255 | int init_socket_xprt(void); | ||
256 | void cleanup_socket_xprt(void); | ||
257 | |||
258 | /* | ||
259 | * Reserved bit positions in xprt->state | 251 | * Reserved bit positions in xprt->state |
260 | */ | 252 | */ |
261 | #define XPRT_LOCKED (0) | 253 | #define XPRT_LOCKED (0) |
diff --git a/include/linux/sunrpc/xprtrdma.h b/include/linux/sunrpc/xprtrdma.h new file mode 100644 index 000000000000..4de56b1d372b --- /dev/null +++ b/include/linux/sunrpc/xprtrdma.h | |||
@@ -0,0 +1,85 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2003-2007 Network Appliance, Inc. All rights reserved. | ||
3 | * | ||
4 | * This software is available to you under a choice of one of two | ||
5 | * licenses. You may choose to be licensed under the terms of the GNU | ||
6 | * General Public License (GPL) Version 2, available from the file | ||
7 | * COPYING in the main directory of this source tree, or the BSD-type | ||
8 | * license below: | ||
9 | * | ||
10 | * Redistribution and use in source and binary forms, with or without | ||
11 | * modification, are permitted provided that the following conditions | ||
12 | * are met: | ||
13 | * | ||
14 | * Redistributions of source code must retain the above copyright | ||
15 | * notice, this list of conditions and the following disclaimer. | ||
16 | * | ||
17 | * Redistributions in binary form must reproduce the above | ||
18 | * copyright notice, this list of conditions and the following | ||
19 | * disclaimer in the documentation and/or other materials provided | ||
20 | * with the distribution. | ||
21 | * | ||
22 | * Neither the name of the Network Appliance, Inc. nor the names of | ||
23 | * its contributors may be used to endorse or promote products | ||
24 | * derived from this software without specific prior written | ||
25 | * permission. | ||
26 | * | ||
27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
30 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
31 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
32 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
33 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
34 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
35 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
36 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
37 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
38 | */ | ||
39 | |||
40 | #ifndef _LINUX_SUNRPC_XPRTRDMA_H | ||
41 | #define _LINUX_SUNRPC_XPRTRDMA_H | ||
42 | |||
43 | /* | ||
44 | * RPC transport identifier for RDMA | ||
45 | */ | ||
46 | #define XPRT_TRANSPORT_RDMA 256 | ||
47 | |||
48 | /* | ||
49 | * rpcbind (v3+) RDMA netid. | ||
50 | */ | ||
51 | #define RPCBIND_NETID_RDMA "rdma" | ||
52 | |||
53 | /* | ||
54 | * Constants. Max RPC/NFS header is big enough to account for | ||
55 | * additional marshaling buffers passed down by Linux client. | ||
56 | * | ||
57 | * RDMA header is currently fixed max size, and is big enough for a | ||
58 | * fully-chunked NFS message (read chunks are the largest). Note only | ||
59 | * a single chunk type per message is supported currently. | ||
60 | */ | ||
61 | #define RPCRDMA_MIN_SLOT_TABLE (2U) | ||
62 | #define RPCRDMA_DEF_SLOT_TABLE (32U) | ||
63 | #define RPCRDMA_MAX_SLOT_TABLE (256U) | ||
64 | |||
65 | #define RPCRDMA_DEF_INLINE (1024) /* default inline max */ | ||
66 | |||
67 | #define RPCRDMA_INLINE_PAD_THRESH (512)/* payload threshold to pad (bytes) */ | ||
68 | |||
69 | #define RDMA_RESOLVE_TIMEOUT (5*HZ) /* TBD 5 seconds */ | ||
70 | #define RDMA_CONNECT_RETRY_MAX (2) /* retries if no listener backlog */ | ||
71 | |||
72 | /* memory registration strategies */ | ||
73 | #define RPCRDMA_PERSISTENT_REGISTRATION (1) | ||
74 | |||
75 | enum rpcrdma_memreg { | ||
76 | RPCRDMA_BOUNCEBUFFERS = 0, | ||
77 | RPCRDMA_REGISTER, | ||
78 | RPCRDMA_MEMWINDOWS, | ||
79 | RPCRDMA_MEMWINDOWS_ASYNC, | ||
80 | RPCRDMA_MTHCAFMR, | ||
81 | RPCRDMA_ALLPHYSICAL, | ||
82 | RPCRDMA_LAST | ||
83 | }; | ||
84 | |||
85 | #endif /* _LINUX_SUNRPC_XPRTRDMA_H */ | ||
diff --git a/include/linux/sunrpc/xprtsock.h b/include/linux/sunrpc/xprtsock.h new file mode 100644 index 000000000000..2c6c2c2783d8 --- /dev/null +++ b/include/linux/sunrpc/xprtsock.h | |||
@@ -0,0 +1,51 @@ | |||
1 | /* | ||
2 | * linux/include/linux/sunrpc/xprtsock.h | ||
3 | * | ||
4 | * Declarations for the RPC transport socket provider. | ||
5 | */ | ||
6 | |||
7 | #ifndef _LINUX_SUNRPC_XPRTSOCK_H | ||
8 | #define _LINUX_SUNRPC_XPRTSOCK_H | ||
9 | |||
10 | #ifdef __KERNEL__ | ||
11 | |||
12 | /* | ||
13 | * Socket transport setup operations | ||
14 | */ | ||
15 | struct rpc_xprt *xs_setup_udp(struct xprt_create *args); | ||
16 | struct rpc_xprt *xs_setup_tcp(struct xprt_create *args); | ||
17 | |||
18 | int init_socket_xprt(void); | ||
19 | void cleanup_socket_xprt(void); | ||
20 | |||
21 | /* | ||
22 | * RPC transport identifiers for UDP, TCP | ||
23 | * | ||
24 | * To preserve compatibility with the historical use of raw IP protocol | ||
25 | * id's for transport selection, these are specified with the previous | ||
26 | * values. No such restriction exists for new transports, except that | ||
27 | * they may not collide with these values (17 and 6, respectively). | ||
28 | */ | ||
29 | #define XPRT_TRANSPORT_UDP IPPROTO_UDP | ||
30 | #define XPRT_TRANSPORT_TCP IPPROTO_TCP | ||
31 | |||
32 | /* | ||
33 | * RPC slot table sizes for UDP, TCP transports | ||
34 | */ | ||
35 | extern unsigned int xprt_udp_slot_table_entries; | ||
36 | extern unsigned int xprt_tcp_slot_table_entries; | ||
37 | |||
38 | /* | ||
39 | * Parameters for choosing a free port | ||
40 | */ | ||
41 | extern unsigned int xprt_min_resvport; | ||
42 | extern unsigned int xprt_max_resvport; | ||
43 | |||
44 | #define RPC_MIN_RESVPORT (1U) | ||
45 | #define RPC_MAX_RESVPORT (65535U) | ||
46 | #define RPC_DEF_MIN_RESVPORT (665U) | ||
47 | #define RPC_DEF_MAX_RESVPORT (1023U) | ||
48 | |||
49 | #endif /* __KERNEL__ */ | ||
50 | |||
51 | #endif /* _LINUX_SUNRPC_XPRTSOCK_H */ | ||