PageRenderTime 78ms CodeModel.GetById 67ms app.highlight 9ms RepoModel.GetById 1ms app.codeStats 0ms

/net/rds/tcp.h

http://github.com/mirrors/linux
C Header | 99 lines | 72 code | 15 blank | 12 comment | 0 complexity | 53035a02267c1ccb306777b44991cde1 MD5 | raw file
 1/* SPDX-License-Identifier: GPL-2.0 */
 2#ifndef _RDS_TCP_H
 3#define _RDS_TCP_H
 4
 5#define RDS_TCP_PORT	16385
 6
 7struct rds_tcp_incoming {
 8	struct rds_incoming	ti_inc;
 9	struct sk_buff_head	ti_skb_list;
10};
11
12struct rds_tcp_connection {
13
14	struct list_head	t_tcp_node;
15	bool			t_tcp_node_detached;
16	struct rds_conn_path	*t_cpath;
17	/* t_conn_path_lock synchronizes the connection establishment between
18	 * rds_tcp_accept_one and rds_tcp_conn_path_connect
19	 */
20	struct mutex		t_conn_path_lock;
21	struct socket		*t_sock;
22	void			*t_orig_write_space;
23	void			*t_orig_data_ready;
24	void			*t_orig_state_change;
25
26	struct rds_tcp_incoming	*t_tinc;
27	size_t			t_tinc_hdr_rem;
28	size_t			t_tinc_data_rem;
29
30	/* XXX error report? */
31	struct work_struct	t_conn_w;
32	struct work_struct	t_send_w;
33	struct work_struct	t_down_w;
34	struct work_struct	t_recv_w;
35
36	/* for info exporting only */
37	struct list_head	t_list_item;
38	u32			t_last_sent_nxt;
39	u32			t_last_expected_una;
40	u32			t_last_seen_una;
41};
42
43struct rds_tcp_statistics {
44	uint64_t	s_tcp_data_ready_calls;
45	uint64_t	s_tcp_write_space_calls;
46	uint64_t	s_tcp_sndbuf_full;
47	uint64_t	s_tcp_connect_raced;
48	uint64_t	s_tcp_listen_closed_stale;
49};
50
51/* tcp.c */
52void rds_tcp_tune(struct socket *sock);
53void rds_tcp_nonagle(struct socket *sock);
54void rds_tcp_set_callbacks(struct socket *sock, struct rds_conn_path *cp);
55void rds_tcp_reset_callbacks(struct socket *sock, struct rds_conn_path *cp);
56void rds_tcp_restore_callbacks(struct socket *sock,
57			       struct rds_tcp_connection *tc);
58u32 rds_tcp_write_seq(struct rds_tcp_connection *tc);
59u32 rds_tcp_snd_una(struct rds_tcp_connection *tc);
60u64 rds_tcp_map_seq(struct rds_tcp_connection *tc, u32 seq);
61extern struct rds_transport rds_tcp_transport;
62void rds_tcp_accept_work(struct sock *sk);
63
64/* tcp_connect.c */
65int rds_tcp_conn_path_connect(struct rds_conn_path *cp);
66void rds_tcp_conn_path_shutdown(struct rds_conn_path *conn);
67void rds_tcp_state_change(struct sock *sk);
68
69/* tcp_listen.c */
70struct socket *rds_tcp_listen_init(struct net *net, bool isv6);
71void rds_tcp_listen_stop(struct socket *sock, struct work_struct *acceptor);
72void rds_tcp_listen_data_ready(struct sock *sk);
73int rds_tcp_accept_one(struct socket *sock);
74int rds_tcp_keepalive(struct socket *sock);
75void *rds_tcp_listen_sock_def_readable(struct net *net);
76void rds_tcp_set_linger(struct socket *sock);
77
78/* tcp_recv.c */
79int rds_tcp_recv_init(void);
80void rds_tcp_recv_exit(void);
81void rds_tcp_data_ready(struct sock *sk);
82int rds_tcp_recv_path(struct rds_conn_path *cp);
83void rds_tcp_inc_free(struct rds_incoming *inc);
84int rds_tcp_inc_copy_to_user(struct rds_incoming *inc, struct iov_iter *to);
85
86/* tcp_send.c */
87void rds_tcp_xmit_path_prepare(struct rds_conn_path *cp);
88void rds_tcp_xmit_path_complete(struct rds_conn_path *cp);
89int rds_tcp_xmit(struct rds_connection *conn, struct rds_message *rm,
90		 unsigned int hdr_off, unsigned int sg, unsigned int off);
91void rds_tcp_write_space(struct sock *sk);
92
93/* tcp_stats.c */
94DECLARE_PER_CPU(struct rds_tcp_statistics, rds_tcp_stats);
95#define rds_tcp_stats_inc(member) rds_stats_inc_which(rds_tcp_stats, member)
96unsigned int rds_tcp_stats_info_copy(struct rds_info_iterator *iter,
97				     unsigned int avail);
98
99#endif