diff options
author | Sowmini Varadhan <sowmini.varadhan@oracle.com> | 2016-07-01 02:11:17 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-07-01 23:45:17 +0300 |
commit | 8315011ad67670691545ed394968435f0a0bb29e (patch) | |
tree | adbf6708286fac52b03fffe25e3a8f3b4d570197 /net/rds/threads.c | |
parent | b04e8554f7637999af8f54cca4dcfcf49f2ae7c8 (diff) | |
download | linux-8315011ad67670691545ed394968435f0a0bb29e.tar.xz |
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/threads.c')
-rw-r--r-- | net/rds/threads.c | 5 |
1 files changed, 5 insertions, 0 deletions
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) conn, &conn->c_laddr, &conn->c_faddr, cp->cp_reconnect_jiffies); + /* let peer with smaller addr initiate reconnect, to avoid duels */ + if (conn->c_trans->t_type == RDS_TRANS_TCP && + conn->c_laddr > conn->c_faddr) + return; + set_bit(RDS_RECONNECT_PENDING, &cp->cp_flags); if (cp->cp_reconnect_jiffies == 0) { cp->cp_reconnect_jiffies = rds_sysctl_reconnect_min_jiffies; |