tcp_send.c (226f7a7d97e37220a442f52eb85ebff2cd6fc0d2) | tcp_send.c (ea3b1ea53930879c9847044f5cb9c97411cae797) |
---|---|
1/* 2 * Copyright (c) 2006 Oracle. 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 8 * OpenIB.org BSD license below: --- 164 unchanged lines hidden (view full) --- 173 if (!test_bit(RDS_MSG_HAS_ACK_SEQ, &rm->m_flags)) 174 return 0; 175 return (__s32)((u32)rm->m_ack_seq - (u32)ack) < 0; 176} 177 178void rds_tcp_write_space(struct sock *sk) 179{ 180 void (*write_space)(struct sock *sk); | 1/* 2 * Copyright (c) 2006 Oracle. 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 8 * OpenIB.org BSD license below: --- 164 unchanged lines hidden (view full) --- 173 if (!test_bit(RDS_MSG_HAS_ACK_SEQ, &rm->m_flags)) 174 return 0; 175 return (__s32)((u32)rm->m_ack_seq - (u32)ack) < 0; 176} 177 178void rds_tcp_write_space(struct sock *sk) 179{ 180 void (*write_space)(struct sock *sk); |
181 struct rds_connection *conn; | 181 struct rds_conn_path *cp; |
182 struct rds_tcp_connection *tc; 183 184 read_lock_bh(&sk->sk_callback_lock); | 182 struct rds_tcp_connection *tc; 183 184 read_lock_bh(&sk->sk_callback_lock); |
185 conn = sk->sk_user_data; 186 if (!conn) { | 185 cp = sk->sk_user_data; 186 if (!cp) { |
187 write_space = sk->sk_write_space; 188 goto out; 189 } 190 | 187 write_space = sk->sk_write_space; 188 goto out; 189 } 190 |
191 tc = conn->c_transport_data; | 191 tc = cp->cp_transport_data; |
192 rdsdebug("write_space for tc %p\n", tc); 193 write_space = tc->t_orig_write_space; 194 rds_tcp_stats_inc(s_tcp_write_space_calls); 195 196 rdsdebug("tcp una %u\n", rds_tcp_snd_una(tc)); 197 tc->t_last_seen_una = rds_tcp_snd_una(tc); | 192 rdsdebug("write_space for tc %p\n", tc); 193 write_space = tc->t_orig_write_space; 194 rds_tcp_stats_inc(s_tcp_write_space_calls); 195 196 rdsdebug("tcp una %u\n", rds_tcp_snd_una(tc)); 197 tc->t_last_seen_una = rds_tcp_snd_una(tc); |
198 rds_send_drop_acked(conn, rds_tcp_snd_una(tc), rds_tcp_is_acked); | 198 rds_send_path_drop_acked(cp, rds_tcp_snd_una(tc), rds_tcp_is_acked); |
199 200 if ((atomic_read(&sk->sk_wmem_alloc) << 1) <= sk->sk_sndbuf) | 199 200 if ((atomic_read(&sk->sk_wmem_alloc) << 1) <= sk->sk_sndbuf) |
201 queue_delayed_work(rds_wq, &conn->c_send_w, 0); | 201 queue_delayed_work(rds_wq, &cp->cp_send_w, 0); |
202 203out: 204 read_unlock_bh(&sk->sk_callback_lock); 205 206 /* 207 * write_space is only called when data leaves tcp's send queue if 208 * SOCK_NOSPACE is set. We set SOCK_NOSPACE every time we put 209 * data in tcp's send queue because we use write_space to parse the --- 13 unchanged lines hidden --- | 202 203out: 204 read_unlock_bh(&sk->sk_callback_lock); 205 206 /* 207 * write_space is only called when data leaves tcp's send queue if 208 * SOCK_NOSPACE is set. We set SOCK_NOSPACE every time we put 209 * data in tcp's send queue because we use write_space to parse the --- 13 unchanged lines hidden --- |