linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vallish Vaidyeshwara <vallish@amazon.com>
To: <trond.myklebust@primarydata.com>, <anna.schumaker@netapp.com>,
	<jlayton@kernel.org>, <bfields@fieldses.org>,
	<linux-nfs@vger.kernel.org>
Cc: <jsstraus@amazon.com>
Subject: [PATCH 0/2] SUNRPC: Clean up port reuse behavior on reconnects
Date: Thu, 10 May 2018 06:12:52 +0000	[thread overview]
Message-ID: <1525932774-98736-1-git-send-email-vallish@amazon.com> (raw)

We have seen examples of NFSv4 client reconnections failing due to
client source port reuse combined with stateful TCP state tracking in
middleboxes.

Commit 0f7a622ca616 ("rpc: xs_bind - do not bind when requesting a
random ephemeral port"), commit 4dda9c8a5e34 ("SUNRPC: Set SO_REUSEPORT
socket option for TCP connections"), and commit 1f4c17a03ba7 ("SUNRPC:
Handle EADDRNOTAVAIL on connection failures") had unintended side effects
of making port reuse dependent on whether that client uses reserved or
non-reserved source ports.

This series fixes the observed NFSv4 client reconnect failures by
choosing a new source port regardless of which port range is in use
for RST or FIN terminating the prior connection. This series does
not restore the original always-reuse behavior that existed prior to
commits mentioned above.

Patch 1:
--------
SUNRPC: Need to reuse non-reserved port for reconnect

This patch restores the original behavior of port reuse in all
scenarios.

Patch 2:
--------
SUNRPC: Reconnect with new port on server initiated connection
    termination

Client uses a new port only in cases where server has terminated
the connection explicitly using RST or FIN.

Proposed outcome with this patch series:
----------------------------------------
------------------------------------------------------------------
| Port type | Connection termination | Current    | With this    |
|           |         type           | behavior   | patch series |
------------------------------------------------------------------
|  Reserved | Network partition-DROP | Reuse port | Reuse port   |
------------------------------------------------------------------
|  Reserved | FIN from server        | Reuse port | New port     |
------------------------------------------------------------------
|  Reserved | RST from server        | Reuse port | New port     |
------------------------------------------------------------------
|  Non-Resv | Network partition-DROP | New port   | Reuse port   |
------------------------------------------------------------------
|  Non-Resv | FIN from server        | New port   | New port     |
------------------------------------------------------------------
|  Non-Resv | RST from server        | New port   | New port     |
------------------------------------------------------------------

 net/sunrpc/xprtsock.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

-- 
2.7.3.AMZN


             reply	other threads:[~2018-05-10  6:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-10  6:12 Vallish Vaidyeshwara [this message]
2018-05-10  6:12 ` [PATCH 1/2] SUNRPC: Need to reuse non-reserved port for reconnect Vallish Vaidyeshwara
2018-05-10 21:18   ` Vallish Vaidyeshwara
2018-05-10  6:12 ` [PATCH 2/2] SUNRPC: Reconnect with new port on server initiated connection termination Vallish Vaidyeshwara
2018-05-10 15:25   ` Trond Myklebust
2018-05-10 16:22     ` Vallish Vaidyeshwara
2018-05-10 17:26       ` Trond Myklebust
2018-05-10 21:12         ` Vallish Vaidyeshwara
2018-05-10 17:37       ` bfields
2018-05-10 21:15         ` Vallish Vaidyeshwara

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=1525932774-98736-1-git-send-email-vallish@amazon.com \
    --to=vallish@amazon.com \
    --cc=anna.schumaker@netapp.com \
    --cc=bfields@fieldses.org \
    --cc=jlayton@kernel.org \
    --cc=jsstraus@amazon.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@primarydata.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).