diff options
author | Andy Grover <andy.grover@oracle.com> | 2009-08-21 08:28:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-08-23 22:13:02 -0400 |
commit | 70041088e3b976627ba9a183b812f39ef8a9ba0e (patch) | |
tree | bad7b11763d7b02b185bd705fe5ed292397cbc7a /net/rds/tcp.h | |
parent | 7d6fd5e7e97a2188d56441e4e96494c21c5994a7 (diff) |
RDS: Add TCP transport to RDS
This code allows RDS to be tunneled over a TCP connection.
RDMA operations are disabled when using TCP transport,
but this frees RDS from the IB/RDMA stack dependency, and allows
it to be used with standard Ethernet adapters, or in a VM.
Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rds/tcp.h')
-rw-r--r-- | net/rds/tcp.h | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/net/rds/tcp.h b/net/rds/tcp.h new file mode 100644 index 000000000000..844fa6b9cf5a --- /dev/null +++ b/net/rds/tcp.h | |||
@@ -0,0 +1,93 @@ | |||
1 | #ifndef _RDS_TCP_H | ||
2 | #define _RDS_TCP_H | ||
3 | |||
4 | #define RDS_TCP_PORT 16385 | ||
5 | |||
6 | struct rds_tcp_incoming { | ||
7 | struct rds_incoming ti_inc; | ||
8 | struct sk_buff_head ti_skb_list; | ||
9 | }; | ||
10 | |||
11 | struct rds_tcp_connection { | ||
12 | |||
13 | struct list_head t_tcp_node; | ||
14 | struct rds_connection *conn; | ||
15 | struct socket *t_sock; | ||
16 | void *t_orig_write_space; | ||
17 | void *t_orig_data_ready; | ||
18 | void *t_orig_state_change; | ||
19 | |||
20 | struct rds_tcp_incoming *t_tinc; | ||
21 | size_t t_tinc_hdr_rem; | ||
22 | size_t t_tinc_data_rem; | ||
23 | |||
24 | /* XXX error report? */ | ||
25 | struct work_struct t_conn_w; | ||
26 | struct work_struct t_send_w; | ||
27 | struct work_struct t_down_w; | ||
28 | struct work_struct t_recv_w; | ||
29 | |||
30 | /* for info exporting only */ | ||
31 | struct list_head t_list_item; | ||
32 | u32 t_last_sent_nxt; | ||
33 | u32 t_last_expected_una; | ||
34 | u32 t_last_seen_una; | ||
35 | }; | ||
36 | |||
37 | struct rds_tcp_statistics { | ||
38 | uint64_t s_tcp_data_ready_calls; | ||
39 | uint64_t s_tcp_write_space_calls; | ||
40 | uint64_t s_tcp_sndbuf_full; | ||
41 | uint64_t s_tcp_connect_raced; | ||
42 | uint64_t s_tcp_listen_closed_stale; | ||
43 | }; | ||
44 | |||
45 | /* tcp.c */ | ||
46 | int __init rds_tcp_init(void); | ||
47 | void rds_tcp_exit(void); | ||
48 | void rds_tcp_tune(struct socket *sock); | ||
49 | void rds_tcp_nonagle(struct socket *sock); | ||
50 | void rds_tcp_set_callbacks(struct socket *sock, struct rds_connection *conn); | ||
51 | void rds_tcp_restore_callbacks(struct socket *sock, | ||
52 | struct rds_tcp_connection *tc); | ||
53 | u32 rds_tcp_snd_nxt(struct rds_tcp_connection *tc); | ||
54 | u32 rds_tcp_snd_una(struct rds_tcp_connection *tc); | ||
55 | u64 rds_tcp_map_seq(struct rds_tcp_connection *tc, u32 seq); | ||
56 | extern struct rds_transport rds_tcp_transport; | ||
57 | |||
58 | /* tcp_connect.c */ | ||
59 | int rds_tcp_conn_connect(struct rds_connection *conn); | ||
60 | void rds_tcp_conn_shutdown(struct rds_connection *conn); | ||
61 | void rds_tcp_state_change(struct sock *sk); | ||
62 | |||
63 | /* tcp_listen.c */ | ||
64 | int __init rds_tcp_listen_init(void); | ||
65 | void rds_tcp_listen_stop(void); | ||
66 | void rds_tcp_listen_data_ready(struct sock *sk, int bytes); | ||
67 | |||
68 | /* tcp_recv.c */ | ||
69 | int __init rds_tcp_recv_init(void); | ||
70 | void rds_tcp_recv_exit(void); | ||
71 | void rds_tcp_data_ready(struct sock *sk, int bytes); | ||
72 | int rds_tcp_recv(struct rds_connection *conn); | ||
73 | void rds_tcp_inc_purge(struct rds_incoming *inc); | ||
74 | void rds_tcp_inc_free(struct rds_incoming *inc); | ||
75 | int rds_tcp_inc_copy_to_user(struct rds_incoming *inc, struct iovec *iov, | ||
76 | size_t size); | ||
77 | |||
78 | /* tcp_send.c */ | ||
79 | void rds_tcp_xmit_prepare(struct rds_connection *conn); | ||
80 | void rds_tcp_xmit_complete(struct rds_connection *conn); | ||
81 | int rds_tcp_xmit(struct rds_connection *conn, struct rds_message *rm, | ||
82 | unsigned int hdr_off, unsigned int sg, unsigned int off); | ||
83 | void rds_tcp_write_space(struct sock *sk); | ||
84 | int rds_tcp_xmit_cong_map(struct rds_connection *conn, | ||
85 | struct rds_cong_map *map, unsigned long offset); | ||
86 | |||
87 | /* tcp_stats.c */ | ||
88 | DECLARE_PER_CPU(struct rds_tcp_statistics, rds_tcp_stats); | ||
89 | #define rds_tcp_stats_inc(member) rds_stats_inc_which(rds_tcp_stats, member) | ||
90 | unsigned int rds_tcp_stats_info_copy(struct rds_info_iterator *iter, | ||
91 | unsigned int avail); | ||
92 | |||
93 | #endif | ||