From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
To: santosh shilimkar <santosh.shilimkar@oracle.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
davem@davemloft.net, rds-devel@oss.oracle.com,
ajaykumar.hotchandani@oracle.com, igor.maximov@oracle.com
Subject: Re: [PATCH net-next 1/3] net/rds: Use a single TCP socket for both send and receive.
Date: Wed, 30 Sep 2015 11:58:06 -0400 [thread overview]
Message-ID: <20150930155806.GA8111@oracle.com> (raw)
In-Reply-To: <560C04AA.4050201@oracle.com>
On (09/30/15 08:50), santosh shilimkar wrote:
> minor nit though not a strict rule. Just to be consistent based on
> what we are following.
>
> - core RDS patches "RDS:"
> - RDS IB patches "RDS: IB:" or "RDS/IB:"
> - RDS IW patches "RDS: IW:" or
> - RDS TCP can use "RDS: TCP" or "RDS/TCP:"
Ok, but in this case patch 1/3 the changes affect both core and rds-tcp
modules.
Working on patchv2 that will address Sergei's comments and the
kbuild-test-robot warning as well
>
> $subject
> s/net/rds:/RDS:
>
> On 9/30/2015 6:45 AM, Sowmini Varadhan wrote:
> >Commit f711a6ae062c ("net/rds: RDS-TCP: Always create a new rds_sock
> >for an incoming connection.") modified rds-tcp so that an incoming SYN
> >would ignore an existing "client" TCP connection which had the local
> >port set to the transient port. The motivation for ignoring the existing
> >"client" connection in f711a6ae was to avoid race conditions and an
> >endless duel of reconnect attempts triggered by a restart/abort of one
> >of the nodes in the TCP connection.
> >
> >However, having separate sockets for active and passive sides
> >is avoidable, and the simpler model of a single TCP socket for
> >both send and receives of all RDS connections associated with
> >that tcp socket makes for easier observability. We avoid the race
> >conditions from f711a6ae by attempting reconnects in rds_conn_shutdown
> >if, and only if, the (new) c_outgoing bit is set for RDS_TRANS_TCP.
> >The c_outgoing bit is initialized in __rds_conn_create().
> >
> >A side-effect of re-using the client rds_connection for an incoming
> >SYN is the potential of encountering duelling SYNs, i.e., we
> >have an outgoing RDS_CONN_CONNECTING socket when we get the incoming
> >SYN. The logic to arbitrate this criss-crossing SYN exchange in
> >rds_tcp_accept_one() has been modified to emulate the BGP state
> >machine: the smaller IP address should back off from the connection attempt.
> >
> >Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
> >---
> > net/rds/connection.c | 22 ++++++----------------
> > net/rds/rds.h | 4 +++-
> > net/rds/tcp_listen.c | 19 +++++++------------
> > 3 files changed, 16 insertions(+), 29 deletions(-)
> >
>
> [...]
>
> >diff --git a/net/rds/tcp_listen.c b/net/rds/tcp_listen.c
> >index 444d78d..ee70d13 100644
> >--- a/net/rds/tcp_listen.c
> >+++ b/net/rds/tcp_listen.c
> >@@ -110,28 +110,23 @@ int rds_tcp_accept_one(struct socket *sock)
> > goto out;
> > }
> > /* An incoming SYN request came in, and TCP just accepted it.
> >- * We always create a new conn for listen side of TCP, and do not
> >- * add it to the c_hash_list.
> > *
> > * If the client reboots, this conn will need to be cleaned up.
> > * rds_tcp_state_change() will do that cleanup
> > */
> > rs_tcp = (struct rds_tcp_connection *)conn->c_transport_data;
> >- WARN_ON(!rs_tcp || rs_tcp->t_sock);
> >+ if (rs_tcp->t_sock && inet->inet_saddr < inet->inet_daddr) {
> >+ struct sock *nsk = new_sock->sk;
> >
> Any reason you dropped the WARN_ON. Note that till we got commit
> 74e98eb0 (" RDS: verify the underlying transport exists before creating
> a connection") merged, we had an issue. That guards it now.
>
> Am curious about WARN_ON() and hence the question.
>
> Rest of the patch looks fine to me.
> Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
>
next prev parent reply other threads:[~2015-09-30 15:58 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-30 13:45 [PATCH net-next 0/3] RDS: RDS-TCP perf enhancements Sowmini Varadhan
2015-09-30 13:45 ` [PATCH net-next 1/3] net/rds: Use a single TCP socket for both send and receive Sowmini Varadhan
2015-09-30 14:45 ` kbuild test robot
2015-09-30 15:50 ` santosh shilimkar
2015-09-30 15:58 ` Sowmini Varadhan [this message]
2015-09-30 16:04 ` santosh shilimkar
2015-09-30 16:09 ` Sowmini Varadhan
2015-09-30 16:13 ` santosh shilimkar
2015-09-30 13:45 ` [PATCH net-next 2/3] RDS-TCP: Do not bloat sndbuf/rcvbuf in rds_tcp_tune Sowmini Varadhan
2015-09-30 15:54 ` santosh shilimkar
2015-09-30 13:45 ` [PATCH net-next 3/3] RDS-TCP: Set up MSG_MORE and MSG_SENDPAGE_NOTLAST as appropriate in rds_tcp_xmit Sowmini Varadhan
2015-09-30 14:53 ` Sergei Shtylyov
2015-09-30 15:56 ` santosh shilimkar
2015-09-30 16:00 ` Sowmini Varadhan
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=20150930155806.GA8111@oracle.com \
--to=sowmini.varadhan@oracle.com \
--cc=ajaykumar.hotchandani@oracle.com \
--cc=davem@davemloft.net \
--cc=igor.maximov@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.