threads.c (82845079160817cc6ac64e5321bbd935e0a47b3a) threads.c (ebeeb1ad9b8adcc37c2ec21a96f39e9d35199b46)
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:

--- 74 unchanged lines hidden (view full) ---

83 }
84
85 rdsdebug("conn %p for %pI4 to %pI4 complete\n",
86 cp->cp_conn, &cp->cp_conn->c_laddr, &cp->cp_conn->c_faddr);
87
88 cp->cp_reconnect_jiffies = 0;
89 set_bit(0, &cp->cp_conn->c_map_queued);
90 rcu_read_lock();
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:

--- 74 unchanged lines hidden (view full) ---

83 }
84
85 rdsdebug("conn %p for %pI4 to %pI4 complete\n",
86 cp->cp_conn, &cp->cp_conn->c_laddr, &cp->cp_conn->c_faddr);
87
88 cp->cp_reconnect_jiffies = 0;
89 set_bit(0, &cp->cp_conn->c_map_queued);
90 rcu_read_lock();
91 if (!test_bit(RDS_DESTROY_PENDING, &cp->cp_flags)) {
91 if (!rds_destroy_pending(cp->cp_conn)) {
92 queue_delayed_work(rds_wq, &cp->cp_send_w, 0);
93 queue_delayed_work(rds_wq, &cp->cp_recv_w, 0);
94 }
95 rcu_read_unlock();
96}
97EXPORT_SYMBOL_GPL(rds_connect_path_complete);
98
99void rds_connect_complete(struct rds_connection *conn)

--- 33 unchanged lines hidden (view full) ---

133 if (conn->c_trans->t_type == RDS_TRANS_TCP &&
134 !IS_CANONICAL(conn->c_laddr, conn->c_faddr))
135 return;
136
137 set_bit(RDS_RECONNECT_PENDING, &cp->cp_flags);
138 if (cp->cp_reconnect_jiffies == 0) {
139 cp->cp_reconnect_jiffies = rds_sysctl_reconnect_min_jiffies;
140 rcu_read_lock();
92 queue_delayed_work(rds_wq, &cp->cp_send_w, 0);
93 queue_delayed_work(rds_wq, &cp->cp_recv_w, 0);
94 }
95 rcu_read_unlock();
96}
97EXPORT_SYMBOL_GPL(rds_connect_path_complete);
98
99void rds_connect_complete(struct rds_connection *conn)

--- 33 unchanged lines hidden (view full) ---

133 if (conn->c_trans->t_type == RDS_TRANS_TCP &&
134 !IS_CANONICAL(conn->c_laddr, conn->c_faddr))
135 return;
136
137 set_bit(RDS_RECONNECT_PENDING, &cp->cp_flags);
138 if (cp->cp_reconnect_jiffies == 0) {
139 cp->cp_reconnect_jiffies = rds_sysctl_reconnect_min_jiffies;
140 rcu_read_lock();
141 if (!test_bit(RDS_DESTROY_PENDING, &cp->cp_flags))
141 if (!rds_destroy_pending(cp->cp_conn))
142 queue_delayed_work(rds_wq, &cp->cp_conn_w, 0);
143 rcu_read_unlock();
144 return;
145 }
146
147 get_random_bytes(&rand, sizeof(rand));
148 rdsdebug("%lu delay %lu ceil conn %p for %pI4 -> %pI4\n",
149 rand % cp->cp_reconnect_jiffies, cp->cp_reconnect_jiffies,
150 conn, &conn->c_laddr, &conn->c_faddr);
151 rcu_read_lock();
142 queue_delayed_work(rds_wq, &cp->cp_conn_w, 0);
143 rcu_read_unlock();
144 return;
145 }
146
147 get_random_bytes(&rand, sizeof(rand));
148 rdsdebug("%lu delay %lu ceil conn %p for %pI4 -> %pI4\n",
149 rand % cp->cp_reconnect_jiffies, cp->cp_reconnect_jiffies,
150 conn, &conn->c_laddr, &conn->c_faddr);
151 rcu_read_lock();
152 if (!test_bit(RDS_DESTROY_PENDING, &cp->cp_flags))
152 if (!rds_destroy_pending(cp->cp_conn))
153 queue_delayed_work(rds_wq, &cp->cp_conn_w,
154 rand % cp->cp_reconnect_jiffies);
155 rcu_read_unlock();
156
157 cp->cp_reconnect_jiffies = min(cp->cp_reconnect_jiffies * 2,
158 rds_sysctl_reconnect_max_jiffies);
159}
160

--- 101 unchanged lines hidden ---
153 queue_delayed_work(rds_wq, &cp->cp_conn_w,
154 rand % cp->cp_reconnect_jiffies);
155 rcu_read_unlock();
156
157 cp->cp_reconnect_jiffies = min(cp->cp_reconnect_jiffies * 2,
158 rds_sysctl_reconnect_max_jiffies);
159}
160

--- 101 unchanged lines hidden ---