netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "santosh.shilimkar@oracle.com" <santosh.shilimkar@oracle.com>
To: Sowmini Varadhan <sowmini.varadhan@oracle.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: davem@davemloft.net, rds-devel@oss.oracle.com,
	ajaykumar.hotchandani@oracle.com, igor.maximov@oracle.com
Subject: Re: [PATCH net-next] RDS-TCP: Reset tcp callbacks if re-using an outgoing socket in rds_tcp_accept_one()
Date: Sun, 11 Oct 2015 19:32:22 -0700	[thread overview]
Message-ID: <561B1BB6.2060208@oracle.com> (raw)
In-Reply-To: <20151011204944.GB14646@oracle.com>

On 10/11/15 1:49 PM, Sowmini Varadhan wrote:
>
> Consider the following "duelling syn" sequence between two peers A and B:
>          	A		B
>          	SYN1     -->
>          	    	<--	SYN2
>          	SYN2ACK  -->
>
> Note that the SYN/ACK has already been sent out by TCP before
> rds_tcp_accept_one() gets invoked as part of callbacks.
>
> If the inet_addr(A) is numerically less than inet_addr(B),
> the arbitration scheme in rds_tcp_accept_one() will prefer the
> TCP connection triggered by SYN1, and will send a CLOSE for the
> SYN2 (just after the SYN2ACK was sent).
>
> Since B also follows the same arbitration scheme, it will send the SYN-ACK
> for SYN1 that will set up a healthy ESTABLISHED connection on both sides.
> B will also get a  CLOSE for SYN2, which should result in the cleanup
> of the TCP state machine for SYN2, but it should not trigger any
> stale RDS-TCP callbacks (such as ->writespace, ->state_change etc),
> that would disrupt the progress of the SYN2 based RDS-TCP  connection.
>
> Thus the arbitration scheme in rds_tcp_accept_one() should restore
> rds_tcp callbacks for the winner before setting them up for the
> new accept socket, and also make sure that conn->c_outgoing
> is set to 0 so that we do not trigger any reconnect attempts on the
> passive side of the tcp socket in the future, in conformance with
> commit c82ac7e69efe ("net/rds: RDS-TCP: only initiate reconnect attempt
> on outgoing TCP socket.")
>
> Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
> ---

Looks fine to me.

Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>

  reply	other threads:[~2015-10-12  2:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-11 20:49 [PATCH net-next] RDS-TCP: Reset tcp callbacks if re-using an outgoing socket in rds_tcp_accept_one() Sowmini Varadhan
2015-10-12  2:32 ` santosh.shilimkar [this message]
2015-10-13 11:23 ` 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=561B1BB6.2060208@oracle.com \
    --to=santosh.shilimkar@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=sowmini.varadhan@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).