Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp797148ybe; Thu, 5 Sep 2019 06:10:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqzO2yzRztb+JFuzdkKrAk/Ne4Nj5KnnhJqOl+K8rSKGdzt1EdR3S6KPlQSGqQiL3hmdoCZf X-Received: by 2002:a63:e948:: with SMTP id q8mr2981656pgj.93.1567689056996; Thu, 05 Sep 2019 06:10:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567689056; cv=none; d=google.com; s=arc-20160816; b=tlh+TTdggQylEZ1wUyeBFBHp+st2JCtcvasU5iOXknNrPUDsF0wrvXevOAdv2wuDUx L1PQ0t62az9YUpfdaINC7UxPHeVM3cXzAYZ2zunHZoXl8/qN+7aHs9E+w9YSR+AMzxSQ 3KsVzQXI3dCSjgVSOSL6BZVjgB3xBZKNO1Wk3MkiUEhHW/WsDYe69UV6FKaBRuYwFNKz /oqim4/rZcC/nmQwZyBMI0dYp6GfuEFF6cZpQswoGq+jeXUOG/ss64hsGSfcHCgcvL5W aosLE/W9+kxXOYCKTtt1AT442P0UsqW/sQsshEJJoq1AA5qWwjyG+n27IPwN5tbYbpVi EQXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=UWhL3CbzNHh3/40YexfELL4rQx5Pq2YZIl8EkC/kFe8=; b=qJSEYhHkMGiL1d0Daxgz33jJQTwetcbr6L/LyTFUj+RBbDPtGIq65glK2A8Y3YhjUz bc8N9ISPUU++3BB8grKDiGnjDsimWZmuOeZFi9jhIMrqmZAagd5uNbeSG5hvNh/7LOi8 okGW4b8O520TJmpRwvndn0dQHs3ayyXRZzolAUk6d5xIj2IDsHk7tDnQVNE/uAZfDq0J Vq7d0r3SyQycQ3Gx+TLndtA+byqSILpeR7VjKt6iThTNcyUnHwO51T1ayR82J99/fJlt +g+D3OMDofj6aklCWTygdeHox6/YGmw7yQXEy3DTsWrB92UeXqFdMooZ1qJjIJJFUcih R1OA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o1si1975574plk.67.2019.09.05.06.10.10; Thu, 05 Sep 2019 06:10:56 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732629AbfIELh1 (ORCPT + 99 others); Thu, 5 Sep 2019 07:37:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55356 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731633AbfIELh1 (ORCPT ); Thu, 5 Sep 2019 07:37:27 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A7F402E97D5; Thu, 5 Sep 2019 11:37:26 +0000 (UTC) Received: from madhat.boston.devel.redhat.com (ovpn-116-147.phx2.redhat.com [10.3.116.147]) by smtp.corp.redhat.com (Postfix) with ESMTP id 44E035D9CA; Thu, 5 Sep 2019 11:37:26 +0000 (UTC) Subject: Re: [PATCH 1/1] nfsd: Adjust nfs.conf setting/parsing of rdma port To: Yongcheng Yang Cc: linux-nfs@vger.kernel.org References: <20190830092058.18021-1-yongcheng.yang@gmail.com> From: Steve Dickson Message-ID: Date: Thu, 5 Sep 2019 07:37:25 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190830092058.18021-1-yongcheng.yang@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 05 Sep 2019 11:37:26 +0000 (UTC) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On 8/30/19 5:20 AM, Yongcheng Yang wrote: > The rpc.nfsd program can use option "--rdma" to enable > RDMA on the standard port (nfsrdma/20049) or "--rdma=port" > for an alternate port. > > But now in /etc/nfs.conf, we need to specify the port > number (e.g. rdma=nfsrdma) to enable it, which is not > convenient. > The default setting "rdma=n" may cause more confusion. > > Update to enable RDMA on standard port when setting > boolean YES to "rdma=". And using "rdma-port=" for an > alternate port if necessary. > > Also let previous config (e.g. rdma=nfsrdma) work as well. > > Signed-off-by: Yongcheng Yang Committed.... steved. > --- > Hello SteveD, > > I did some simple test: > ~~~~~~~~~~~~~~~~~~~~~~~ > [root@ rpc-nfsd]# cp rpc.nfsd.new /usr/sbin/rpc.nfsd > cp: overwrite '/usr/sbin/rpc.nfsd'? y > [root@ rpc-nfsd]# vi /etc/nfs.conf > [root@ rpc-nfsd]# cat /etc/nfs.conf > [nfsd] > rdma=nfsrdma <<<<<<<<< previous pattern > [root@ rpc-nfsd]# systemctl restart nfs-server && cat /proc/fs/nfsd/portlist | grep -w rdma > [nfsd] > rdma 20049 > rdma 20049 > [root@ rpc-nfsd]# vi /etc/nfs.conf > [root@ rpc-nfsd]# cat /etc/nfs.conf > [nfsd] > rdma=y <<<<<<<<< boolean YES > [root@ rpc-nfsd]# systemctl restart nfs-server && cat /proc/fs/nfsd/portlist | grep -w rdma > rdma 20049 > rdma 20049 > [root@ rpc-nfsd]# vi /etc/nfs.conf > [root@ rpc-nfsd]# cat /etc/nfs.conf > [nfsd] > rdma=n <<<<<<<<< boolean NO > [root@ rpc-nfsd]# systemctl restart nfs-server && cat /proc/fs/nfsd/portlist | grep -w rdma > [root@ rpc-nfsd]# vi /etc/nfs.conf > [root@ rpc-nfsd]# cat /etc/nfs.conf > [nfsd] > rdma=12345 <<<<<<<<< previous pattern > [root@ rpc-nfsd]# systemctl restart nfs-server && cat /proc/fs/nfsd/portlist | grep -w rdma > rdma 12345 > rdma 12345 > [root@ rpc-nfsd]# vi /etc/nfs.conf > [root@ rpc-nfsd]# cat /etc/nfs.conf > [nfsd] > rdma=yes <<<<<<<<< boolean YES > rdma-port=54321 <<<<<<<<< another port number > [root@ rpc-nfsd]# systemctl restart nfs-server && cat /proc/fs/nfsd/portlist | grep -w rdma > rdma 54321 > rdma 54321 > [root@ rpc-nfsd]# vi /etc/nfs.conf > [root@ rpc-nfsd]# cat /etc/nfs.conf > [nfsd] > rdma=n <<<<<<<<< boolean NO won't enable it even with rdma-port set > rdma-port=54321 > [root@ rpc-nfsd]# systemctl restart nfs-server && cat /proc/fs/nfsd/portlist | grep -w rdma > [root@ rpc-nfsd]# vi /etc/nfs.conf > [root@ rpc-nfsd]# cat /etc/nfs.conf > [nfsd] > #rdma=n > rdma-port=54321 > [root@ rpc-nfsd]# systemctl restart nfs-server && cat /proc/fs/nfsd/portlist | grep -w rdma > [root@ rpc-nfsd]#  > ~~~~~~~~~~~~~~~~~~~~~~~ > > Thanks, > Yongcheng > > --- > nfs.conf | 1 + > utils/nfsd/nfsd.c | 9 ++++++++- > utils/nfsd/nfsd.man | 6 +++++- > 3 files changed, 14 insertions(+), 2 deletions(-) > > diff --git a/nfs.conf b/nfs.conf > index 85097fd1..186a5b19 100644 > --- a/nfs.conf > +++ b/nfs.conf > @@ -63,6 +63,7 @@ > # vers4.1=y > # vers4.2=y > # rdma=n > +# rdma-port=20049 > # > [statd] > # debug=0 > diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c > index b256bd9f..a412a026 100644 > --- a/utils/nfsd/nfsd.c > +++ b/utils/nfsd/nfsd.c > @@ -92,7 +92,14 @@ main(int argc, char **argv) > port = conf_get_str("nfsd", "port"); > if (!port) > port = "nfs"; > - rdma_port = conf_get_str("nfsd", "rdma"); > + if (conf_get_bool("nfsd", "rdma", false)) { > + rdma_port = conf_get_str("nfsd", "rdma-port"); > + if (!rdma_port) > + rdma_port = "nfsrdma"; > + } > + /* backward compatibility - nfs.conf used to set rdma port directly */ > + if (!rdma_port) > + rdma_port = conf_get_str("nfsd", "rdma"); > if (conf_get_bool("nfsd", "udp", NFSCTL_UDPISSET(protobits))) > NFSCTL_UDPSET(protobits); > else > diff --git a/utils/nfsd/nfsd.man b/utils/nfsd/nfsd.man > index d83ef869..2701ba78 100644 > --- a/utils/nfsd/nfsd.man > +++ b/utils/nfsd/nfsd.man > @@ -144,7 +144,11 @@ The lease time for NFSv4, in seconds. > Set the port for TCP/UDP to bind to. > .TP > .B rdma > -Set RDMA port. Use "rdma=nfsrdma" to enable standard port. > +Enable RDMA port (with "on" or "yes" etc) on the standard port > +("nfsrdma", port 20049). > +.TP > +.B rdma-port > +Set an alternate RDMA port. > .TP > .B UDP > Enable (with "on" or "yes" etc) or disable ("off", "no") UDP support. >