From owner-svn-src-projects@freebsd.org Mon Jun 29 02:32:08 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B636935BAB0 for ; Mon, 29 Jun 2020 02:32:08 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49wBMr4SgYz4BFV; Mon, 29 Jun 2020 02:32:08 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CDE7205CA; Mon, 29 Jun 2020 02:32:08 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05T2W8aK022794; Mon, 29 Jun 2020 02:32:08 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05T2W7Zl022335; Mon, 29 Jun 2020 02:32:07 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202006290232.05T2W7Zl022335@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 29 Jun 2020 02:32:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r362768 - in projects/nfs-over-tls/sys/fs: nfs nfsclient nfsserver X-SVN-Group: projects X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in projects/nfs-over-tls/sys/fs: nfs nfsclient nfsserver X-SVN-Commit-Revision: 362768 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2020 02:32:08 -0000 Author: rmacklem Date: Mon Jun 29 02:32:07 2020 New Revision: 362768 URL: https://svnweb.freebsd.org/changeset/base/362768 Log: Delete nfs_use_ext_pgs, since it is not needed. This patch also removes the checks for PMAP_HAS_DMAP, since they were only needed for early testing on i386 hardware, when no actual TLS was being done. It also enables use of ext_pgs mbufs for large read replies. Modified: projects/nfs-over-tls/sys/fs/nfs/nfs_commonsubs.c projects/nfs-over-tls/sys/fs/nfsclient/nfs_clkrpc.c projects/nfs-over-tls/sys/fs/nfsclient/nfs_clrpcops.c projects/nfs-over-tls/sys/fs/nfsserver/nfs_nfsdport.c projects/nfs-over-tls/sys/fs/nfsserver/nfs_nfsdserv.c Modified: projects/nfs-over-tls/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- projects/nfs-over-tls/sys/fs/nfs/nfs_commonsubs.c Mon Jun 29 00:34:11 2020 (r362767) +++ projects/nfs-over-tls/sys/fs/nfs/nfs_commonsubs.c Mon Jun 29 02:32:07 2020 (r362768) @@ -100,10 +100,6 @@ int nfs_maxcopyrange = 10 * 1024 * 1024; SYSCTL_INT(_vfs_nfs, OID_AUTO, maxcopyrange, CTLFLAG_RW, &nfs_maxcopyrange, 0, "Max size of a Copy so RPC times reasonable"); -bool nfs_use_ext_pgs = false; -SYSCTL_BOOL(_vfs_nfs, OID_AUTO, use_ext_pgs, CTLFLAG_RW, &nfs_use_ext_pgs, - 0, "Set true to use TCP"); - /* * This array of structures indicates, for V4: * retfh - which of 3 types of calling args are used Modified: projects/nfs-over-tls/sys/fs/nfsclient/nfs_clkrpc.c ============================================================================== --- projects/nfs-over-tls/sys/fs/nfsclient/nfs_clkrpc.c Mon Jun 29 00:34:11 2020 (r362767) +++ projects/nfs-over-tls/sys/fs/nfsclient/nfs_clkrpc.c Mon Jun 29 02:32:07 2020 (r362768) @@ -56,7 +56,6 @@ static int nfs_cbproc(struct nfsrv_descript *, u_int32 extern u_long sb_max_adj; extern int nfs_numnfscbd; extern int nfscl_debuglevel; -extern bool nfs_use_ext_pgs; /* * NFS client system calls for handling callbacks. Modified: projects/nfs-over-tls/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- projects/nfs-over-tls/sys/fs/nfsclient/nfs_clrpcops.c Mon Jun 29 00:34:11 2020 (r362767) +++ projects/nfs-over-tls/sys/fs/nfsclient/nfs_clrpcops.c Mon Jun 29 02:32:07 2020 (r362768) @@ -77,7 +77,6 @@ extern int nfscl_debuglevel; extern int nfs_pnfsiothreads; extern u_long sb_max_adj; extern int nfs_maxcopyrange; -extern bool nfs_use_ext_pgs; NFSCLSTATEMUTEX; int nfstest_outofseq = 0; int nfscl_assumeposixlocks = 1; @@ -1798,8 +1797,7 @@ nfsrpc_writerpc(vnode_t vp, struct uio *uiop, int *iom KASSERT(uiop->uio_iovcnt == 1, ("nfs: writerpc iovcnt > 1")); use_ext = false; - if ((NFSHASTLS(nmp) || nfs_use_ext_pgs) && - PMAP_HAS_DMAP != 0) + if (NFSHASTLS(nmp)) use_ext = true; *attrflagp = 0; tsiz = uiop->uio_resid; @@ -8495,8 +8493,7 @@ nfsrpc_setextattr(vnode_t vp, const char *name, struct *attrflagp = 0; use_ext = false; - if (uiop->uio_resid > MCLBYTES && (NFSHASTLS(nmp) || - nfs_use_ext_pgs) && PMAP_HAS_DMAP != 0) + if (uiop->uio_resid > MCLBYTES && NFSHASTLS(nmp)) use_ext = true; nfscl_reqstart(nd, NFSPROC_SETEXTATTR, nmp, VTONFS(vp)->n_fhp->nfh_fh, VTONFS(vp)->n_fhp->nfh_len, NULL, Modified: projects/nfs-over-tls/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- projects/nfs-over-tls/sys/fs/nfsserver/nfs_nfsdport.c Mon Jun 29 00:34:11 2020 (r362767) +++ projects/nfs-over-tls/sys/fs/nfsserver/nfs_nfsdport.c Mon Jun 29 02:32:07 2020 (r362768) @@ -77,7 +77,6 @@ extern struct nfsdontlisthead nfsrv_dontlisthead; extern volatile int nfsrv_dontlistlen; extern volatile int nfsrv_devidcnt; extern int nfsrv_maxpnfsmirror; -extern bool nfs_use_ext_pgs; struct vfsoptlist nfsv4root_opt, nfsv4root_newopt; NFSDLOCKMUTEX; NFSSTATESPINLOCK; @@ -2115,6 +2114,13 @@ again: vput(vp); /* + * If the siz and cnt are larger than MCLBYTES, use ext_pgs for TLS. + */ + if ((nd->nd_flag & (ND_EXTPG | ND_TLS)) == ND_TLS && siz > MCLBYTES && + cnt > MCLBYTES) + nd->nd_flag |= ND_EXTPG; + + /* * dirlen is the size of the reply, including all XDR and must * not exceed cnt. For NFSv2, RFC1094 didn't clearly indicate * if the XDR should be included in "count", but to be safe, we do. @@ -2432,6 +2438,16 @@ again: } /* + * If the reply is likely to exceed MCLBYTES, then use TLS. + * It is difficult to predict how large each entry will be and + * how many entries have been read, so just assume the directory + * entries grow by a factor of 4 when attributes are included. + */ + if ((nd->nd_flag & (ND_EXTPG | ND_TLS)) == ND_TLS && cnt > MCLBYTES && + siz > MCLBYTES / 4) + nd->nd_flag |= ND_EXTPG; + + /* * Save this position, in case there is an error before one entry * is created. */ @@ -6275,12 +6291,10 @@ nfsvno_getxattr(struct vnode *vp, char *name, uint32_t len = siz; tlen = NFSM_RNDUP(len); /* - * If the cnt is larger than MCLBYTES, use ext_pgs if - * possible. + * If the cnt is larger than MCLBYTES, use ext_pgs for TLS. * Always use ext_pgs if ND_EXTPG is set. */ - if ((flag & ND_EXTPG) != 0 || (tlen > MCLBYTES && - PMAP_HAS_DMAP != 0 && ((flag & ND_TLS) != 0 || nfs_use_ext_pgs))) + if ((flag & ND_EXTPG) != 0 || ((flag & ND_TLS) != 0 && tlen > MCLBYTES)) uiop->uio_iovcnt = nfsrv_createiovec_extpgs(tlen, maxextsiz, &m, &m2, &iv); else Modified: projects/nfs-over-tls/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- projects/nfs-over-tls/sys/fs/nfsserver/nfs_nfsdserv.c Mon Jun 29 00:34:11 2020 (r362767) +++ projects/nfs-over-tls/sys/fs/nfsserver/nfs_nfsdserv.c Mon Jun 29 02:32:07 2020 (r362768) @@ -67,7 +67,6 @@ extern u_long sb_max_adj; extern int nfsrv_pnfsatime; extern int nfsrv_maxpnfsmirror; extern int nfs_maxcopyrange; -extern bool nfs_use_ext_pgs; static int nfs_async = 0; SYSCTL_DECL(_vfs_nfsd); @@ -857,13 +856,11 @@ nfsrvd_read(struct nfsrv_descript *nd, __unused int is m3 = NULL; if (cnt > 0) { /* - * If the cnt is larger than MCLBYTES, use ext_pgs if - * possible. + * If the cnt is larger than MCLBYTES, use ext_pgs for TLS. * Always use ext_pgs if ND_EXTPG is set. */ - if ((nd->nd_flag & ND_EXTPG) != 0 || (PMAP_HAS_DMAP != 0 && - ((nd->nd_flag & ND_TLS) != 0 || (nfs_use_ext_pgs && - cnt > MCLBYTES)))) + if ((nd->nd_flag & ND_EXTPG) != 0 || + ((nd->nd_flag & ND_TLS) != 0 && cnt > MCLBYTES)) nd->nd_repstat = nfsvno_read(vp, off, cnt, nd->nd_cred, nd->nd_maxextsiz, p, &m3, &m2); else