Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1108989ybi; Wed, 19 Jun 2019 13:43:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwbTBNjqouzNylbU1jMAB35bKbZ+zeOL7aTLOULvyiBOPVbfbcXKUrCdY2zoeKQR+xK20BJ X-Received: by 2002:a17:902:7591:: with SMTP id j17mr11585809pll.200.1560977033202; Wed, 19 Jun 2019 13:43:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560977033; cv=none; d=google.com; s=arc-20160816; b=HP1ju1TG3+1xPWnVVjrgvxRmpbqPRArv8dnqCp0TxYB+DnWuuXXbSoMyM+ALMgjc6v D7LnNzJWXu2uNzfAC/zyufLR8XskYp5V1tv0RbFRrviTMjYgWfn8QmaNAGBLWxMpA++B 8bDKRZLv4eVOP2Uz7hGD2dQK5ietJc5qsRgVSegJuFLaDfcTsRc8iYLQ96473qXqDgYW yGsK7GzWeaKRo5x/3xGazfVkbcU9zBM7XsEy69r58FAxot2eNWu20LNE0/Nf3Yk93gZL RssI6yxQcJprl7rCQ+GuVxlqLCrR6qRtvj1L4CXjhTLx/y6mrDDgPATXiRYmOHtRYMdd DX4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=ppOHAEx7GnMCCBeV/AORCfAdDORg7v2t5Vopid+vuW8=; b=HVBi0rD0fdVw1CLQTYqlfXl7RfdPbIthf2ICXOS5GVqHOV/6zt27GAQAeF8QT4eL9U SotyhfdR454zZKPVL7Ao07HaBCLNLWoHBeuNkzLB5rrT3ZZzKfdPOAFhehwz7NKVVMy+ E+Dseb8nKIt+hHa6D6Y2IBTZAplzVNQDFv3x+GDkXgbJF/pVHQ0g2WY2Pnu3bwNWvTn+ YoL/IfmcSkvfJiUjDbGw4g3uV/DEPhiez3SMW+vn1EnyGOA2ntm2cCxrT6XKmDXf0GMm mfA8idvPMPLvOK28fLVrc4dlQsBKNGja9e0yQNFxsayFEnW/6VCssMQre9TCTKTRcbF+ Mxfg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h125si17530867pfb.176.2019.06.19.13.43.33; Wed, 19 Jun 2019 13:43:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726246AbfFSUnC (ORCPT + 99 others); Wed, 19 Jun 2019 16:43:02 -0400 Received: from fieldses.org ([173.255.197.46]:42490 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726230AbfFSUnC (ORCPT ); Wed, 19 Jun 2019 16:43:02 -0400 Received: by fieldses.org (Postfix, from userid 2815) id 93E818BF; Wed, 19 Jun 2019 16:43:01 -0400 (EDT) Date: Wed, 19 Jun 2019 16:43:01 -0400 From: Bruce Fields To: Chuck Lever Cc: linux-rdma@vger.kernel.org, Linux NFS Mailing List Subject: Re: [PATCH v2] svcrdma: Ignore source port when computing DRC hash Message-ID: <20190619204301.GA3044@fieldses.org> References: <20190611150116.4209.63309.stgit@klimt.1015granger.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Wed, Jun 19, 2019 at 04:25:57PM -0400, Chuck Lever wrote: > > > On Jun 11, 2019, at 11:01 AM, Chuck Lever wrote: > > > > The DRC appears to be effectively empty after an RPC/RDMA transport > > reconnect. The problem is that each connection uses a different > > source port, which defeats the DRC hash. > > > > Clients always have to disconnect before they send retransmissions > > to reset the connection's credit accounting, thus every retransmit > > on NFS/RDMA will miss the DRC. > > > > An NFS/RDMA client's IP source port is meaningless for RDMA > > transports. The transport layer typically sets the source port value > > on the connection to a random ephemeral port. The server already > > ignores it for the "secure port" check. See commit 16e4d93f6de7 > > ("NFSD: Ignore client's source port on RDMA transports"). > > > > The Linux NFS server's DRC resolves XID collisions from the same > > source IP address by using the checksum of the first 200 bytes of > > the RPC call header. > > > > Signed-off-by: Chuck Lever > > Cc: stable@vger.kernel.org # v4.14+ > > --- > > net/sunrpc/xprtrdma/svc_rdma_transport.c | 7 ++++++- > > 1 file changed, 6 insertions(+), 1 deletion(-) > > > > diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c > > index 027a3b0..0004535 100644 > > --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c > > +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c > > @@ -211,9 +211,14 @@ static void handle_connect_req(struct rdma_cm_id *new_cma_id, > > /* Save client advertised inbound read limit for use later in accept. */ > > newxprt->sc_ord = param->initiator_depth; > > > > - /* Set the local and remote addresses in the transport */ > > sa = (struct sockaddr *)&newxprt->sc_cm_id->route.addr.dst_addr; > > svc_xprt_set_remote(&newxprt->sc_xprt, sa, svc_addr_len(sa)); > > + /* The remote port is arbitrary and not under the control of the > > + * client ULP. Set it to a fixed value so that the DRC continues > > + * to be effective after a reconnect. > > + */ > > + rpc_set_port((struct sockaddr *)&newxprt->sc_xprt.xpt_remote, 0); > > + > > sa = (struct sockaddr *)&newxprt->sc_cm_id->route.addr.src_addr; > > svc_xprt_set_local(&newxprt->sc_xprt, sa, svc_addr_len(sa)); > > Hi Bruce, what's the disposition of this patch? I've queued it up locally for 5.2 and stable. Apologies, it got a little buried in my inbox, thanks for the reminder. --b.