From patchwork Fri Sep 11 13:04:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 7161581 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 630589F380 for ; Fri, 11 Sep 2015 13:05:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 844F3207B8 for ; Fri, 11 Sep 2015 13:05:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9E57F2034F for ; Fri, 11 Sep 2015 13:04:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752637AbbIKNE4 (ORCPT ); Fri, 11 Sep 2015 09:04:56 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:34639 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752518AbbIKNEz (ORCPT ); Fri, 11 Sep 2015 09:04:55 -0400 Received: by padhy16 with SMTP id hy16so74868858pad.1; Fri, 11 Sep 2015 06:04:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:cc:date:in-reply-to:references :content-type:mime-version:content-transfer-encoding; bh=UUl/7ogxtrEPVDo43PtwCEXG1TLYqB1BR5SxCX2E9V0=; b=eO18TNMI+uz29fC4KgnFh06KHMlAC/oYa5blmNg66RLjFjdPNtHt04Sz/Ud2kXkDij LPDc1HcvkHncMz6me9mAH/Xz+7UqFZNvgFavEHpU0DmS79WW4aYlkLho4fAbHqLkTCHB kgZ02hSpvIvRbgpqu89HzWXXxoHs5dxJqC/XUoVc19cvqy19oQST56aBsKWNBR731yiP J82gAAgGyUToqYMZXl6v7IDJdPebaLx7ttskRJUtrpBjfQ8MbOHt3hLSgo9rihFO6T/2 sXfcrQStRdqz8GmWMWpl5CZCaiBRByttUWX0USLLKHHRLu1l9Wnj1yyI4M35OEK1yh4v kbcQ== X-Received: by 10.66.237.97 with SMTP id vb1mr86976545pac.139.1441976692965; Fri, 11 Sep 2015 06:04:52 -0700 (PDT) Received: from [172.29.161.118] ([172.29.161.118]) by smtp.gmail.com with ESMTPSA id uv5sm398625pbc.12.2015.09.11.06.04.51 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 11 Sep 2015 06:04:52 -0700 (PDT) Message-ID: <1441976691.4619.58.camel@edumazet-glaptop2.roam.corp.google.com> Subject: Re: NFS/TCP/IPv6 acting strangely in 4.2 From: Eric Dumazet To: Russell King - ARM Linux Cc: Trond Myklebust , Anna Schumaker , linux-nfs@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org Date: Fri, 11 Sep 2015 06:04:51 -0700 In-Reply-To: <20150911113839.GO21084@n2100.arm.linux.org.uk> References: <20150911113839.GO21084@n2100.arm.linux.org.uk> X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, 2015-09-11 at 12:38 +0100, Russell King - ARM Linux wrote: > I have a recent Marvell Armada 388 board here which uses the mvneta > driver. I'm seeing some weird effects with NFS with it acting as a > client. Unfortunately, the board does not have a functional RTC. > > The NFS server is the same NFS server that I've used for years with > multiple other clients (it's my main NFS server) and it continues to > support all other clients without any ill effect. The NFS server > kernel is rather old now, being a 3.x kernel. > > The NFS client appears to connect using TCP/IPv6 and initially is > accessible. Everything appears to work normally, and then the NFS > server appears to stop responding. > > Running tcpdump on the NFS server, and then dumping the captured > packets > with tshark (because tcpdump appears not to understand IPv6 SYNs on > the > NFS port) shows: > > 3 0.030036 armada388 -> n2100 TCP 843?nfs [SYN] Seq=936803106 > Win=28800 Len=0 MSS=1440 SACK_PERM=1 TSval=892366 TSecr=0 WS=128 > 4 0.030409 n2100 -> armada388 TCP nfs?843 [SYN, ACK] Seq=409465870 > Ack=936803107 Win=28560 Len=0 MSS=1440 SACK_PERM=1 > TSval=818169117 TSecr=892366 WS=64 > 5 0.030493 armada388 -> n2100 TCP [TCP Port numbers reused] > 843?nfs [SYN] Seq=936803633 Win=28800 Len=0 MSS=1440 SACK_PERM=1 > TSval=892366 TSecr=0 WS=128 Yes, this packet looks very wrong. Like two simultaneous connect with same source port. It is not a retransmit (Seq numbers differ) > 6 0.030699 n2100 -> armada388 TCP nfs?843 [RST, ACK] Seq=0 > Ack=936803634 Win=0 Len=0 > 7 0.030766 armada388 -> n2100 TCP 843?nfs [RST] Seq=936803107 > Win=0 Len=0 I suspect port reuse in NFS being broken. Have you tried to apply commit 099392048cd443349c50310f7fdc96070e40f4e7 Author: Trond Myklebust Date: Sat Aug 29 19:11:21 2015 -0700 SUNRPC: Prevent SYN+SYNACK+RST storms Add a shutdown() call before we release the socket in order to ensure the reset is sent before we try to reconnect. Signed-off-by: Trond Myklebust --- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 214ca9dfb14e..7be90bc1a7c2 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c @@ -822,6 +822,8 @@ static void xs_reset_transport(struct sock_xprt *transport) if (atomic_read(&transport->xprt.swapper)) sk_clear_memalloc(sk); + kernel_sock_shutdown(sock, SHUT_RDWR); + write_lock_bh(&sk->sk_callback_lock); transport->inet = NULL; transport->sock = NULL;