From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, rds-devel@oss.oracle.com,
sowmini.varadhan@oracle.com, santosh.shilimkar@oracle.com
Subject: [PATCH net-next 8/9] RDS: TCP: Simplify reconnect to avoid duelling reconnnect attempts
Date: Thu, 30 Jun 2016 16:11:17 -0700 [thread overview]
Message-ID: <02e8cca5a90b5269bec03486dd9f81e2e37f30fe.1467322344.git.sowmini.varadhan@oracle.com> (raw)
In-Reply-To: <cover.1467322344.git.sowmini.varadhan@oracle.com>
In-Reply-To: <cover.1467322344.git.sowmini.varadhan@oracle.com>
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>
---
net/rds/connection.c | 4 +---
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 1b0c2a7..19a4fee 100644
--- a/net/rds/connection.c
+++ b/net/rds/connection.c
@@ -355,9 +355,7 @@ void rds_conn_shutdown(struct rds_conn_path *cp)
rcu_read_lock();
if (!hlist_unhashed(&conn->c_hash_node)) {
rcu_read_unlock();
- if (conn->c_trans->t_type != RDS_TRANS_TCP ||
- cp->cp_outgoing == 1)
- rds_queue_reconnect(cp);
+ rds_queue_reconnect(cp);
} else {
rcu_read_unlock();
}
diff --git a/net/rds/threads.c b/net/rds/threads.c
index e8f0941..bc97d67 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;
--
1.7.1
next prev parent reply other threads:[~2016-06-30 23:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-30 23:11 [PATCH net-next 0/9] RDS:TCP data structure changes for multipath support Sowmini Varadhan
2016-06-30 23:11 ` [PATCH net-next 1/9] RDS: Rework path specific indirections Sowmini Varadhan
2016-06-30 23:11 ` [PATCH net-next 2/9] RDS: TCP: Remove dead logic around c_passive in rds-tcp Sowmini Varadhan
2016-06-30 23:11 ` [PATCH net-next 3/9] RDS: TCP: Make rds_tcp_connection track the rds_conn_path Sowmini Varadhan
2016-06-30 23:11 ` [PATCH net-next 4/9] RDS: TCP: Refactor connection destruction to handle multiple paths Sowmini Varadhan
2016-06-30 23:11 ` [PATCH net-next 5/9] RDS: TCP: make ->sk_user_data point to a rds_conn_path Sowmini Varadhan
2016-06-30 23:11 ` [PATCH net-next 6/9] RDS: TCP: make receive path use the rds_conn_path Sowmini Varadhan
2016-06-30 23:11 ` [PATCH net-next 7/9] RDS: TCP: Hooks to set up a single connection path Sowmini Varadhan
2016-06-30 23:11 ` Sowmini Varadhan [this message]
2016-06-30 23:11 ` [PATCH net-next 9/9] RDS: Do not send a pong to an incoming ping with 0 src port Sowmini Varadhan
2016-07-01 20:46 ` [PATCH net-next 0/9] RDS:TCP data structure changes for multipath support David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=02e8cca5a90b5269bec03486dd9f81e2e37f30fe.1467322344.git.sowmini.varadhan@oracle.com \
--to=sowmini.varadhan@oracle.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=rds-devel@oss.oracle.com \
--cc=santosh.shilimkar@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).