Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6959675ybi; Wed, 5 Jun 2019 08:59:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqwEVevWaol8ah92Q3x4JlWPRmAJq+Jqv48NQD26lhskCloZw/vKvjT2kmk913lJz8sUnpTD X-Received: by 2002:a63:158:: with SMTP id 85mr5546939pgb.101.1559750355866; Wed, 05 Jun 2019 08:59:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559750355; cv=none; d=google.com; s=arc-20160816; b=wJcwzy0we9oEnuEcKwtD8y+hBw1EfEHlKA86DfB52cidg7jLNnCitP0f5V45lRlBi/ 6bnBsCWeUBaJvARSkcyBECZRg830kargFRWWn8frqS8jAdVEsnGhq5gA8SKYcwYXjDoY UfT1vmHZQpt3QcB1HkmcT0ntCIISbqx4jAQjDrYHborgRMHCueokuCBtWGOo+uY04iTo foOFinHD0NO3Woh/bS1+daNgh3AI4yR9rmTU12s3PrZEqxdU9qATzKA/lZ4WEhPAzlvf jy70+bftt+HwKs1hAfGrm2aArLlg8N7AIz3CwOeVNpwxqUR72wg8HNBA9xRoBxLWlC4K AKcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=wQ18CZZm3tJZUQ3j6dGO6lJbbSyHo2fJ3H0W6Gvd1XA=; b=KP7+eUUOhvjMvpdj+tiyr36QqAx+s5IuPzXVOxQaFK+Ed82/cdd49CR7JIBLU0KL0c 8YMg+zaLRjQrzbjPXqtPtf/OmwCjh94o6O2F6vIgaGsPBb6+VCq5sBM/3RKWN4idMB9Q KqaTwVBxkp0+k3sIkO9uJRnWCm1fZ7zTkCkDqzfLWMCFuN/kYXDPvZe7jB/CILWUCoqW FCgR2/fCYDHrnmbzHx7jaHrhwPWTFKj8YqmIzt2QElMdcfu9+PzXi+FBwhJnzCAr+r9w 4uBM9QC2bgjCoJBzcI1qOv7zoxuKxvbdC0aT/DAbYnCU2g2tOf1EgAnpVVk1Xf5oXHov 2QWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@umich.edu header.s=google-2016-06-03 header.b=ibkHyhdx; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=umich.edu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v95si3820715pjb.30.2019.06.05.08.58.46; Wed, 05 Jun 2019 08:59:15 -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; dkim=pass header.i=@umich.edu header.s=google-2016-06-03 header.b=ibkHyhdx; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=umich.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728557AbfFEP6I (ORCPT + 99 others); Wed, 5 Jun 2019 11:58:08 -0400 Received: from mail-vs1-f68.google.com ([209.85.217.68]:40183 "EHLO mail-vs1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728386AbfFEP6I (ORCPT ); Wed, 5 Jun 2019 11:58:08 -0400 Received: by mail-vs1-f68.google.com with SMTP id c24so16012667vsp.7; Wed, 05 Jun 2019 08:58:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umich.edu; s=google-2016-06-03; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wQ18CZZm3tJZUQ3j6dGO6lJbbSyHo2fJ3H0W6Gvd1XA=; b=ibkHyhdxgjvgFY4Dmq8LBQSgoY/ugqCmejaCmE+1qeXoQHAqGku4AD6kbXS0CkX2H8 jyyAbPRcKuoODFVOiCG5mUiI8FREcn9OV6mghE5nez/DlI+YnaFFSeUZgg79of/HOdTG utriVYqWDwWDL7Jx21lOuEjfrgENiqaJwnFf2HQiFyY81649BrbqgeBYNFTcwqiyTQoJ BmdIjSYYnkHu4nlg2Am/g8Dka14lmNXolnUpeh6h8XbH4O4F5BBgwqmCx+7knkbcNApg V3fW1TwBOKoErdU1j+TuOeueGgC+BwDBsC8C2c024vhoAA674q+32HQpsDTDFdagUPWb tkaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wQ18CZZm3tJZUQ3j6dGO6lJbbSyHo2fJ3H0W6Gvd1XA=; b=Lu3ubrY6xavzppnhRIylanTe8I76UaoRqCj04KH6spZMTVh0tRfL4bpAL7RmYoHtPa Y/h7b+CKEJS+auF3Pg4rMXS444OyVavDQRVfOhcoMLYER8EFnWElLlKVNRvGriPI0eVy xqT8fDSavhpkPVc0PqsoDaj3JjoK9DvkfX6d4l/q4Lhh+0+vweD11MfTdU+pp2AzLOra q2JDhqTDeNf9cpjavn3R9yysqHDvb0xR0rHPboS8qvB2KasB0BhY9JtP1u631FfKpJyp vk82VkVcx/EwU9QFWX7Wefyvwb6b/C5qqOjWmoj31//X0eQsZsU7nfTsWRyZMYOihBE1 S0sA== X-Gm-Message-State: APjAAAUlCY7OHLP+bD9pf5P82ByRstfnyMDpYvXWtU+RAzq2RDUnaCBx Q09/JZs3nvaMvhU8VQy4wvRLafci+jepvSXLU870mA== X-Received: by 2002:a05:6102:382:: with SMTP id m2mr10152621vsq.134.1559750287084; Wed, 05 Jun 2019 08:58:07 -0700 (PDT) MIME-Version: 1.0 References: <20190605121518.2150.26479.stgit@klimt.1015granger.net> In-Reply-To: <20190605121518.2150.26479.stgit@klimt.1015granger.net> From: Olga Kornievskaia Date: Wed, 5 Jun 2019 11:57:56 -0400 Message-ID: Subject: Re: [PATCH RFC] svcrdma: Ignore source port when computing DRC hash To: Chuck Lever Cc: linux-rdma , linux-nfs Content-Type: text/plain; charset="UTF-8" Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Wed, Jun 5, 2019 at 8:15 AM Chuck Lever wrote: > > The DRC is not working at all after an RPC/RDMA transport reconnect. > The problem is that the new connection uses a different source port, > which defeats DRC hash. > > An NFS/RDMA client's 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"). > > I'm not sure why I never noticed this before. Hi Chuck, I have a question: is the reason for choosing this fix as oppose to fixing the client because it's server's responsibility to design a DRC differently for the NFSoRDMA? > > Signed-off-by: Chuck Lever > Cc: stable@vger.kernel.org > --- > 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..1b3700b 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 > + * ULP. Set it to a fixed value so that the DRC continues to work > + * 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)); > >