diff options
author | Sowmini Varadhan <sowmini.varadhan@oracle.com> | 2015-05-05 15:20:52 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-05-09 16:03:28 -0400 |
commit | c82ac7e69efe6dbe370d6ba84e2666d7692ef1c2 (patch) | |
tree | 3202342b6487ecdf0930ba849479f74c163ceb22 /net/rds/connection.c | |
parent | f711a6ae062caeee46067b2f2f12ffda319ae73c (diff) | |
download | linux-c82ac7e69efe6dbe370d6ba84e2666d7692ef1c2.tar.bz2 |
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>
Diffstat (limited to 'net/rds/connection.c')
-rw-r--r-- | net/rds/connection.c | 13 |
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: /* Creating normal conn */ struct rds_connection *found; - found = rds_conn_lookup(head, laddr, faddr, trans); + if (!is_outgoing && otrans->t_type == RDS_TRANS_TCP) + found = NULL; + else + found = rds_conn_lookup(head, laddr, faddr, trans); if (found) { trans->conn_free(conn->c_transport_data); kmem_cache_free(rds_conn_slab, conn); conn = found; } else { - hlist_add_head_rcu(&conn->c_hash_node, head); + if ((is_outgoing && otrans->t_type == RDS_TRANS_TCP) || + (otrans->t_type != RDS_TRANS_TCP)) { + /* Only the active side should be added to + * reconnect list for TCP. + */ + hlist_add_head_rcu(&conn->c_hash_node, head); + } rds_cong_add_conn(conn); rds_conn_count++; } |