Lines Matching refs:tc

91 u32 rds_tcp_write_seq(struct rds_tcp_connection *tc)  in rds_tcp_write_seq()  argument
94 return tcp_sk(tc->t_sock->sk)->write_seq; in rds_tcp_write_seq()
97 u32 rds_tcp_snd_una(struct rds_tcp_connection *tc) in rds_tcp_snd_una() argument
99 return tcp_sk(tc->t_sock->sk)->snd_una; in rds_tcp_snd_una()
103 struct rds_tcp_connection *tc) in rds_tcp_restore_callbacks() argument
105 rdsdebug("restoring sock %p callbacks from tc %p\n", sock, tc); in rds_tcp_restore_callbacks()
110 list_del_init(&tc->t_list_item); in rds_tcp_restore_callbacks()
114 if (!tc->t_cpath->cp_conn->c_isv6) in rds_tcp_restore_callbacks()
118 tc->t_sock = NULL; in rds_tcp_restore_callbacks()
120 sock->sk->sk_write_space = tc->t_orig_write_space; in rds_tcp_restore_callbacks()
121 sock->sk->sk_data_ready = tc->t_orig_data_ready; in rds_tcp_restore_callbacks()
122 sock->sk->sk_state_change = tc->t_orig_state_change; in rds_tcp_restore_callbacks()
140 struct rds_tcp_connection *tc = cp->cp_transport_data; in rds_tcp_reset_callbacks() local
141 struct socket *osock = tc->t_sock; in rds_tcp_reset_callbacks()
172 if (tc->t_tinc) { in rds_tcp_reset_callbacks()
173 rds_inc_put(&tc->t_tinc->ti_inc); in rds_tcp_reset_callbacks()
174 tc->t_tinc = NULL; in rds_tcp_reset_callbacks()
176 tc->t_tinc_hdr_rem = sizeof(struct rds_header); in rds_tcp_reset_callbacks()
177 tc->t_tinc_data_rem = 0; in rds_tcp_reset_callbacks()
178 rds_tcp_restore_callbacks(osock, tc); in rds_tcp_reset_callbacks()
194 struct rds_tcp_connection *tc = cp->cp_transport_data; in rds_tcp_set_callbacks() local
196 rdsdebug("setting sock %p callbacks to tc %p\n", sock, tc); in rds_tcp_set_callbacks()
201 list_add_tail(&tc->t_list_item, &rds_tcp_tc_list); in rds_tcp_set_callbacks()
205 if (!tc->t_cpath->cp_conn->c_isv6) in rds_tcp_set_callbacks()
213 tc->t_sock = sock; in rds_tcp_set_callbacks()
214 tc->t_cpath = cp; in rds_tcp_set_callbacks()
215 tc->t_orig_data_ready = sock->sk->sk_data_ready; in rds_tcp_set_callbacks()
216 tc->t_orig_write_space = sock->sk->sk_write_space; in rds_tcp_set_callbacks()
217 tc->t_orig_state_change = sock->sk->sk_state_change; in rds_tcp_set_callbacks()
235 struct rds_tcp_connection *tc; in rds_tcp_tc_info() local
243 list_for_each_entry(tc, &rds_tcp_tc_list, t_list_item) { in rds_tcp_tc_info()
244 struct inet_sock *inet = inet_sk(tc->t_sock->sk); in rds_tcp_tc_info()
246 if (tc->t_cpath->cp_conn->c_isv6) in rds_tcp_tc_info()
254 tsinfo.hdr_rem = tc->t_tinc_hdr_rem; in rds_tcp_tc_info()
255 tsinfo.data_rem = tc->t_tinc_data_rem; in rds_tcp_tc_info()
256 tsinfo.last_sent_nxt = tc->t_last_sent_nxt; in rds_tcp_tc_info()
257 tsinfo.last_expected_una = tc->t_last_expected_una; in rds_tcp_tc_info()
258 tsinfo.last_seen_una = tc->t_last_seen_una; in rds_tcp_tc_info()
259 tsinfo.tos = tc->t_cpath->cp_conn->c_tos; in rds_tcp_tc_info()
281 struct rds_tcp_connection *tc; in rds6_tcp_tc_info() local
289 list_for_each_entry(tc, &rds_tcp_tc_list, t_list_item) { in rds6_tcp_tc_info()
290 struct sock *sk = tc->t_sock->sk; in rds6_tcp_tc_info()
298 tsinfo6.hdr_rem = tc->t_tinc_hdr_rem; in rds6_tcp_tc_info()
299 tsinfo6.data_rem = tc->t_tinc_data_rem; in rds6_tcp_tc_info()
300 tsinfo6.last_sent_nxt = tc->t_last_sent_nxt; in rds6_tcp_tc_info()
301 tsinfo6.last_expected_una = tc->t_last_expected_una; in rds6_tcp_tc_info()
302 tsinfo6.last_seen_una = tc->t_last_seen_una; in rds6_tcp_tc_info()
352 struct rds_tcp_connection *tc = arg; in rds_tcp_conn_free() local
355 rdsdebug("freeing tc %p\n", tc); in rds_tcp_conn_free()
358 if (!tc->t_tcp_node_detached) in rds_tcp_conn_free()
359 list_del(&tc->t_tcp_node); in rds_tcp_conn_free()
362 kmem_cache_free(rds_tcp_conn_slab, tc); in rds_tcp_conn_free()
367 struct rds_tcp_connection *tc; in rds_tcp_conn_alloc() local
372 tc = kmem_cache_alloc(rds_tcp_conn_slab, gfp); in rds_tcp_conn_alloc()
373 if (!tc) { in rds_tcp_conn_alloc()
377 mutex_init(&tc->t_conn_path_lock); in rds_tcp_conn_alloc()
378 tc->t_sock = NULL; in rds_tcp_conn_alloc()
379 tc->t_tinc = NULL; in rds_tcp_conn_alloc()
380 tc->t_tinc_hdr_rem = sizeof(struct rds_header); in rds_tcp_conn_alloc()
381 tc->t_tinc_data_rem = 0; in rds_tcp_conn_alloc()
383 conn->c_path[i].cp_transport_data = tc; in rds_tcp_conn_alloc()
384 tc->t_cpath = &conn->c_path[i]; in rds_tcp_conn_alloc()
385 tc->t_tcp_node_detached = true; in rds_tcp_conn_alloc()
392 tc = conn->c_path[i].cp_transport_data; in rds_tcp_conn_alloc()
393 tc->t_tcp_node_detached = false; in rds_tcp_conn_alloc()
394 list_add_tail(&tc->t_tcp_node, &rds_tcp_conn_list); in rds_tcp_conn_alloc()
407 struct rds_tcp_connection *tc, *_tc; in list_has_conn() local
409 list_for_each_entry_safe(tc, _tc, list, t_tcp_node) { in list_has_conn()
410 if (tc->t_cpath->cp_conn == conn) in list_has_conn()
428 struct rds_tcp_connection *tc, *_tc; in rds_tcp_destroy_conns() local
433 list_for_each_entry_safe(tc, _tc, &rds_tcp_conn_list, t_tcp_node) { in rds_tcp_destroy_conns()
434 if (!list_has_conn(&tmp_list, tc->t_cpath->cp_conn)) in rds_tcp_destroy_conns()
435 list_move_tail(&tc->t_tcp_node, &tmp_list); in rds_tcp_destroy_conns()
439 list_for_each_entry_safe(tc, _tc, &tmp_list, t_tcp_node) in rds_tcp_destroy_conns()
440 rds_conn_destroy(tc->t_cpath->cp_conn); in rds_tcp_destroy_conns()
607 struct rds_tcp_connection *tc, *_tc; in rds_tcp_kill_sock() local
615 list_for_each_entry_safe(tc, _tc, &rds_tcp_conn_list, t_tcp_node) { in rds_tcp_kill_sock()
616 struct net *c_net = read_pnet(&tc->t_cpath->cp_conn->c_net); in rds_tcp_kill_sock()
620 if (!list_has_conn(&tmp_list, tc->t_cpath->cp_conn)) { in rds_tcp_kill_sock()
621 list_move_tail(&tc->t_tcp_node, &tmp_list); in rds_tcp_kill_sock()
623 list_del(&tc->t_tcp_node); in rds_tcp_kill_sock()
624 tc->t_tcp_node_detached = true; in rds_tcp_kill_sock()
628 list_for_each_entry_safe(tc, _tc, &tmp_list, t_tcp_node) in rds_tcp_kill_sock()
629 rds_conn_destroy(tc->t_cpath->cp_conn); in rds_tcp_kill_sock()
670 struct rds_tcp_connection *tc, *_tc; in rds_tcp_sysctl_reset() local
673 list_for_each_entry_safe(tc, _tc, &rds_tcp_conn_list, t_tcp_node) { in rds_tcp_sysctl_reset()
674 struct net *c_net = read_pnet(&tc->t_cpath->cp_conn->c_net); in rds_tcp_sysctl_reset()
676 if (net != c_net || !tc->t_sock) in rds_tcp_sysctl_reset()
680 rds_conn_path_drop(tc->t_cpath, false); in rds_tcp_sysctl_reset()