diff options
author | Sowmini Varadhan <sowmini.varadhan@oracle.com> | 2016-06-30 19:11:17 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-07-01 16:45:17 -0400 |
commit | 8315011ad67670691545ed394968435f0a0bb29e (patch) | |
tree | adbf6708286fac52b03fffe25e3a8f3b4d570197 /net/rds | |
parent | b04e8554f7637999af8f54cca4dcfcf49f2ae7c8 (diff) |
RDS: TCP: Simplify reconnect to avoid duelling reconnnect attempts
When reconnecting, the peer with the smaller IP address will initiate
the reconnect, to avoid needless duelling SYN issues.
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rds')
-rw-r--r-- | net/rds/connection.c | 4 | ||||
-rw-r--r-- | net/rds/threads.c | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/net/rds/connection.c b/net/rds/connection.c index 1b0c2a783b5e..19a4fee5f4dd 100644 --- a/net/rds/connection.c +++ b/net/rds/connection.c | |||
@@ -355,9 +355,7 @@ void rds_conn_shutdown(struct rds_conn_path *cp) | |||
355 | rcu_read_lock(); | 355 | rcu_read_lock(); |
356 | if (!hlist_unhashed(&conn->c_hash_node)) { | 356 | if (!hlist_unhashed(&conn->c_hash_node)) { |
357 | rcu_read_unlock(); | 357 | rcu_read_unlock(); |
358 | if (conn->c_trans->t_type != RDS_TRANS_TCP || | 358 | rds_queue_reconnect(cp); |
359 | cp->cp_outgoing == 1) | ||
360 | rds_queue_reconnect(cp); | ||
361 | } else { | 359 | } else { |
362 | rcu_read_unlock(); | 360 | rcu_read_unlock(); |
363 | } | 361 | } |
diff --git a/net/rds/threads.c b/net/rds/threads.c index e8f0941f0548..bc97d67f29cc 100644 --- a/net/rds/threads.c +++ b/net/rds/threads.c | |||
@@ -125,6 +125,11 @@ void rds_queue_reconnect(struct rds_conn_path *cp) | |||
125 | conn, &conn->c_laddr, &conn->c_faddr, | 125 | conn, &conn->c_laddr, &conn->c_faddr, |
126 | cp->cp_reconnect_jiffies); | 126 | cp->cp_reconnect_jiffies); |
127 | 127 | ||
128 | /* let peer with smaller addr initiate reconnect, to avoid duels */ | ||
129 | if (conn->c_trans->t_type == RDS_TRANS_TCP && | ||
130 | conn->c_laddr > conn->c_faddr) | ||
131 | return; | ||
132 | |||
128 | set_bit(RDS_RECONNECT_PENDING, &cp->cp_flags); | 133 | set_bit(RDS_RECONNECT_PENDING, &cp->cp_flags); |
129 | if (cp->cp_reconnect_jiffies == 0) { | 134 | if (cp->cp_reconnect_jiffies == 0) { |
130 | cp->cp_reconnect_jiffies = rds_sysctl_reconnect_min_jiffies; | 135 | cp->cp_reconnect_jiffies = rds_sysctl_reconnect_min_jiffies; |