aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChuck Lever <cel@citi.umich.edu>2005-08-11 16:25:23 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2005-09-23 12:38:12 -0400
commita246b0105bbd9a70a698f69baae2042996f2a0e9 (patch)
tree6c8831d8579a7fdc5201d3e9c20270cb1420eeda /include
parent094bb20b9fcab3a1652a77741caba6b78097d622 (diff)
[PATCH] RPC: introduce client-side transport switch
Move the bulk of client-side socket-specific code into a separate source file, net/sunrpc/xprtsock.c. Test-plan: Millions of fsx operations. Performance characterization such as "sio" or "iozone". Destructive testing (unplugging the network temporarily, server reboots). Connectathon with v2, v3, and v4. Version: Thu, 11 Aug 2005 16:03:38 -0400 Signed-off-by: Chuck Lever <cel@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/sunrpc/xdr.h5
-rw-r--r--include/linux/sunrpc/xprt.h38
2 files changed, 31 insertions, 12 deletions
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index d8b7656bca41..5da968729cf8 100644
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -165,11 +165,6 @@ extern int csum_partial_copy_to_xdr(struct xdr_buf *, struct sk_buff *);
165extern ssize_t xdr_partial_copy_from_skb(struct xdr_buf *, unsigned int, 165extern ssize_t xdr_partial_copy_from_skb(struct xdr_buf *, unsigned int,
166 skb_reader_t *, skb_read_actor_t); 166 skb_reader_t *, skb_read_actor_t);
167 167
168struct socket;
169struct sockaddr;
170extern int xdr_sendpages(struct socket *, struct sockaddr *, int,
171 struct xdr_buf *, unsigned int, int);
172
173extern int xdr_encode_word(struct xdr_buf *, int, u32); 168extern int xdr_encode_word(struct xdr_buf *, int, u32);
174extern int xdr_decode_word(struct xdr_buf *, int, u32 *); 169extern int xdr_decode_word(struct xdr_buf *, int, u32 *);
175 170
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index e618c1649814..d82b47ab73cb 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -59,7 +59,13 @@ extern unsigned int xprt_tcp_slot_table_entries;
59 */ 59 */
60#define RPC_REESTABLISH_TIMEOUT (15*HZ) 60#define RPC_REESTABLISH_TIMEOUT (15*HZ)
61 61
62/* RPC call and reply header size as number of 32bit words (verifier 62/*
63 * RPC transport idle timeout.
64 */
65#define RPC_IDLE_DISCONNECT_TIMEOUT (5*60*HZ)
66
67/*
68 * RPC call and reply header size as number of 32bit words (verifier
63 * size computed separately) 69 * size computed separately)
64 */ 70 */
65#define RPC_CALLHDRSIZE 6 71#define RPC_CALLHDRSIZE 6
@@ -121,12 +127,19 @@ struct rpc_rqst {
121#define rq_svec rq_snd_buf.head 127#define rq_svec rq_snd_buf.head
122#define rq_slen rq_snd_buf.len 128#define rq_slen rq_snd_buf.len
123 129
124#define XPRT_LAST_FRAG (1 << 0) 130struct rpc_task;
125#define XPRT_COPY_RECM (1 << 1) 131struct rpc_xprt;
126#define XPRT_COPY_XID (1 << 2) 132
127#define XPRT_COPY_DATA (1 << 3) 133struct rpc_xprt_ops {
134 void (*set_buffer_size)(struct rpc_xprt *xprt);
135 void (*connect)(struct rpc_task *task);
136 int (*send_request)(struct rpc_task *task);
137 void (*close)(struct rpc_xprt *xprt);
138 void (*destroy)(struct rpc_xprt *xprt);
139};
128 140
129struct rpc_xprt { 141struct rpc_xprt {
142 struct rpc_xprt_ops * ops; /* transport methods */
130 struct socket * sock; /* BSD socket layer */ 143 struct socket * sock; /* BSD socket layer */
131 struct sock * inet; /* INET layer */ 144 struct sock * inet; /* INET layer */
132 145
@@ -199,14 +212,22 @@ struct rpc_xprt {
199 wait_queue_head_t cong_wait; 212 wait_queue_head_t cong_wait;
200}; 213};
201 214
215#define XPRT_LAST_FRAG (1 << 0)
216#define XPRT_COPY_RECM (1 << 1)
217#define XPRT_COPY_XID (1 << 2)
218#define XPRT_COPY_DATA (1 << 3)
219
202#ifdef __KERNEL__ 220#ifdef __KERNEL__
203 221
204struct rpc_xprt * xprt_create_proto(int proto, struct sockaddr_in *addr, 222struct rpc_xprt * xprt_create_proto(int proto, struct sockaddr_in *addr,
205 struct rpc_timeout *toparms); 223 struct rpc_timeout *toparms);
224void xprt_disconnect(struct rpc_xprt *);
206int xprt_destroy(struct rpc_xprt *); 225int xprt_destroy(struct rpc_xprt *);
207void xprt_set_timeout(struct rpc_timeout *, unsigned int, 226void xprt_set_timeout(struct rpc_timeout *, unsigned int,
208 unsigned long); 227 unsigned long);
209 228struct rpc_rqst * xprt_lookup_rqst(struct rpc_xprt *, u32);
229void xprt_complete_rqst(struct rpc_xprt *,
230 struct rpc_rqst *, int);
210void xprt_reserve(struct rpc_task *); 231void xprt_reserve(struct rpc_task *);
211int xprt_prepare_transmit(struct rpc_task *); 232int xprt_prepare_transmit(struct rpc_task *);
212void xprt_transmit(struct rpc_task *); 233void xprt_transmit(struct rpc_task *);
@@ -214,7 +235,10 @@ void xprt_receive(struct rpc_task *);
214int xprt_adjust_timeout(struct rpc_rqst *req); 235int xprt_adjust_timeout(struct rpc_rqst *req);
215void xprt_release(struct rpc_task *); 236void xprt_release(struct rpc_task *);
216void xprt_connect(struct rpc_task *); 237void xprt_connect(struct rpc_task *);
217void xprt_sock_setbufsize(struct rpc_xprt *); 238int xs_setup_udp(struct rpc_xprt *,
239 struct rpc_timeout *);
240int xs_setup_tcp(struct rpc_xprt *,
241 struct rpc_timeout *);
218 242
219#define XPRT_LOCKED 0 243#define XPRT_LOCKED 0
220#define XPRT_CONNECT 1 244#define XPRT_CONNECT 1