summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSowmini Varadhan <sowmini.varadhan@oracle.com>2015-05-05 15:20:52 -0400
committerDavid S. Miller <davem@davemloft.net>2015-05-09 16:03:28 -0400
commitc82ac7e69efe6dbe370d6ba84e2666d7692ef1c2 (patch)
tree3202342b6487ecdf0930ba849479f74c163ceb22
parentf711a6ae062caeee46067b2f2f12ffda319ae73c (diff)
net/rds: RDS-TCP: only initiate reconnect attempt on outgoing TCP socket.
When the peer of an RDS-TCP connection restarts, a reconnect attempt should only be made from the active side of the TCP connection, i.e. the side that has a transient TCP port number. Do not add the passive side of the TCP connection to the c_hash_node and thus avoid triggering rds_queue_reconnect() for passive rds connections. Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/rds/connection.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/net/rds/connection.c b/net/rds/connection.c
index 60f0cd6ed15f..da6da57e5f36 100644
--- a/net/rds/connection.c
+++ b/net/rds/connection.c
@@ -234,13 +234,22 @@ new_conn:
234 /* Creating normal conn */ 234 /* Creating normal conn */
235 struct rds_connection *found; 235 struct rds_connection *found;
236 236
237 found = rds_conn_lookup(head, laddr, faddr, trans); 237 if (!is_outgoing && otrans->t_type == RDS_TRANS_TCP)
238 found = NULL;
239 else
240 found = rds_conn_lookup(head, laddr, faddr, trans);
238 if (found) { 241 if (found) {
239 trans->conn_free(conn->c_transport_data); 242 trans->conn_free(conn->c_transport_data);
240 kmem_cache_free(rds_conn_slab, conn); 243 kmem_cache_free(rds_conn_slab, conn);
241 conn = found; 244 conn = found;
242 } else { 245 } else {
243 hlist_add_head_rcu(&conn->c_hash_node, head); 246 if ((is_outgoing && otrans->t_type == RDS_TRANS_TCP) ||
247 (otrans->t_type != RDS_TRANS_TCP)) {
248 /* Only the active side should be added to
249 * reconnect list for TCP.
250 */
251 hlist_add_head_rcu(&conn->c_hash_node, head);
252 }
244 rds_cong_add_conn(conn); 253 rds_cong_add_conn(conn);
245 rds_conn_count++; 254 rds_conn_count++;
246 } 255 }