From owner-svn-src-projects@freebsd.org Fri Apr 28 01:36:45 2017 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12D5FD53DDD for ; Fri, 28 Apr 2017 01:36:45 +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 mx1.freebsd.org (Postfix) with ESMTPS id E24091634; Fri, 28 Apr 2017 01:36:44 +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 v3S1ahbg077777; Fri, 28 Apr 2017 01:36:43 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3S1aho4077774; Fri, 28 Apr 2017 01:36:43 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201704280136.v3S1aho4077774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 28 Apr 2017 01:36:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r317539 - projects/pnfs-planb-server/sys/fs/nfs X-SVN-Group: projects 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.23 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: Fri, 28 Apr 2017 01:36:45 -0000 Author: rmacklem Date: Fri Apr 28 01:36:43 2017 New Revision: 317539 URL: https://svnweb.freebsd.org/changeset/base/317539 Log: Fix some of the .h files for the pNFS build. Modified: projects/pnfs-planb-server/sys/fs/nfs/nfs.h projects/pnfs-planb-server/sys/fs/nfs/nfs_var.h projects/pnfs-planb-server/sys/fs/nfs/nfsproto.h Modified: projects/pnfs-planb-server/sys/fs/nfs/nfs.h ============================================================================== --- projects/pnfs-planb-server/sys/fs/nfs/nfs.h Fri Apr 28 00:48:14 2017 (r317538) +++ projects/pnfs-planb-server/sys/fs/nfs/nfs.h Fri Apr 28 01:36:43 2017 (r317539) @@ -96,6 +96,7 @@ #define NFSSESSIONHASHSIZE 20 /* Size of server session hash table */ #endif #define NFSSTATEHASHSIZE 10 /* Size of server stateid hash table */ +#define NFSLAYOUTHASHSIZE 100 /* Size of server layout hash table */ #ifndef NFSCLDELEGHIGHWATER #define NFSCLDELEGHIGHWATER 10000 /* limit for client delegations */ #endif @@ -169,11 +170,26 @@ struct nfsd_addsock_args { /* * nfsd argument for new krpc. + * (New version supports pNFS, indicated by NFSSVC_NEWSTRUCT flag.) */ struct nfsd_nfsd_args { const char *principal; /* GSS-API service principal name */ int minthreads; /* minimum service thread count */ int maxthreads; /* maximum service thread count */ + int version; /* Allow multiple variants */ + char *addr; /* pNFS DS addresses */ + int addrlen; /* Length of addrs */ + char *dnshost; /* DNS names for DS addresses */ + int dnshostlen; /* Length of DNS names */ + char *dspath; /* DS Mount path on MDS */ + int dspathlen; /* Length of DS Mount path on MDS */ +}; + +/* Old version. */ +struct nfsd_nfsd_oargs { + const char *principal; /* GSS-API service principal name */ + int minthreads; /* minimum service thread count */ + int maxthreads; /* maximum service thread count */ }; /* @@ -582,8 +598,8 @@ struct nfsrv_descript { NFSSOCKADDR_T nd_nam2; /* return socket addr */ caddr_t nd_dpos; /* Current dissect pos */ caddr_t nd_bpos; /* Current build pos */ + u_int64_t nd_flag; /* nd_flag */ u_int16_t nd_procnum; /* RPC # */ - u_int32_t nd_flag; /* nd_flag */ u_int32_t nd_repstat; /* Reply status */ int *nd_errp; /* Pointer to ret status */ u_int32_t nd_retxid; /* Reply xid */ @@ -602,6 +618,8 @@ struct nfsrv_descript { uint32_t nd_slotid; /* Slotid for this RPC */ SVCXPRT *nd_xprt; /* Server RPC handle */ uint32_t *nd_sequence; /* Sequence Op. ptr */ + nfsv4stateid_t nd_curstateid; /* Current StateID */ + nfsv4stateid_t nd_savedcurstateid; /* Saved Current StateID */ }; #define nd_princlen nd_gssnamelen @@ -638,6 +656,9 @@ struct nfsrv_descript { #define ND_CACHETHIS 0x08000000 #define ND_LASTOP 0x10000000 #define ND_LOOPBADSESS 0x20000000 +#define ND_DSSERVER 0x40000000 +#define ND_CURSTATEID 0x80000000 +#define ND_SAVEDCURSTATEID 0x100000000 /* * ND_GSS should be the "or" of all GSS type authentications. Modified: projects/pnfs-planb-server/sys/fs/nfs/nfs_var.h ============================================================================== --- projects/pnfs-planb-server/sys/fs/nfs/nfs_var.h Fri Apr 28 00:48:14 2017 (r317538) +++ projects/pnfs-planb-server/sys/fs/nfs/nfs_var.h Fri Apr 28 01:36:43 2017 (r317539) @@ -515,8 +515,8 @@ int nfsrpc_layoutreturn(struct nfsmount int, uint64_t, uint64_t, nfsv4stateid_t *, int, uint32_t *, struct ucred *, NFSPROC_T *, void *); int nfsrpc_reclaimcomplete(struct nfsmount *, struct ucred *, NFSPROC_T *); -int nfscl_doiods(vnode_t, struct uio *, int *, int *, uint32_t, int, - struct ucred *, NFSPROC_T *, struct nfsvattr *, int *); +int nfscl_doiods(vnode_t, struct uio *, int *, int *, uint32_t, + struct ucred *, NFSPROC_T *); int nfscl_findlayoutforio(struct nfscllayout *, uint64_t, uint32_t, struct nfsclflayout **); void nfscl_freenfsclds(struct nfsclds *); Modified: projects/pnfs-planb-server/sys/fs/nfs/nfsproto.h ============================================================================== --- projects/pnfs-planb-server/sys/fs/nfs/nfsproto.h Fri Apr 28 00:48:14 2017 (r317538) +++ projects/pnfs-planb-server/sys/fs/nfs/nfsproto.h Fri Apr 28 01:36:43 2017 (r317539) @@ -56,8 +56,22 @@ #define NFS_MAXDGRAMDATA 16384 #define NFS_MAXPATHLEN 1024 #define NFS_MAXNAMLEN 255 +/* + * Calculating the maximum XDR overhead for an NFS RPC isn't easy. + * NFS_MAXPKTHDR is antiquated and assume AUTH_SYS over UDP. + * NFS_MAXXDR should be sufficient for all NFS versions over TCP. + * It includes: + * - Maximum RPC message header. It can include 2 400byte authenticators plus + * a machine name of unlimited length, although it is usually relatively + * small. + * - XDR overheads for the NFSv4 compound. This can include Owner and + * Owner_group strings, which are usually fairly small, but are allowed + * to be up to 1024 bytes each. + * 4096 is overkill, but should always be sufficient. + */ #define NFS_MAXPKTHDR 404 -#define NFS_MAXPACKET (NFS_SRVMAXIO + 2048) +#define NFS_MAXXDR 4096 +#define NFS_MAXPACKET (NFS_SRVMAXIO + NFS_MAXXDR) #define NFS_MINPACKET 20 #define NFS_FABLKSIZE 512 /* Size in bytes of a block wrt fa_blocks */ #define NFSV4_MINORVERSION 0 /* V4 Minor version */ @@ -244,6 +258,10 @@ #define NFSX_V4SETTIME (NFSX_UNSIGNED + NFSX_V4TIME) #define NFSX_V4SESSIONID 16 #define NFSX_V4DEVICEID 16 +#define NFSX_V4PNFSFH (sizeof(fhandle_t) + 1) +#define NFSX_V4FILELAYOUT (4 * NFSX_UNSIGNED + NFSX_V4DEVICEID + \ + NFSX_HYPER + NFSM_RNDUP(NFSX_V4PNFSFH)) +#define NFSX_V4MAXLAYOUT NFSX_V4FILELAYOUT /* sizes common to multiple NFS versions */ #define NFSX_FHMAX (NFSX_V4FHMAX) @@ -633,6 +651,7 @@ /* Flags for File Layout. */ #define NFSFLAYUTIL_DENSE 0x1 #define NFSFLAYUTIL_COMMIT_THRU_MDS 0x2 +#define NFSFLAYUTIL_STRIPE_MASK 0xffffffc0 /* Conversion macros */ #define vtonfsv2_mode(t,m) \ @@ -1343,4 +1362,14 @@ struct nfsv4stateid { }; typedef struct nfsv4stateid nfsv4stateid_t; +/* Notify bits and notify bitmap size. */ +#define NFSV4NOTIFY_CHANGE 1 +#define NFSV4NOTIFY_DELETE 2 +#define NFSV4_NOTIFYBITMAP 1 /* # of 32bit values needed for bits */ + +/* Layoutreturn kinds. */ +#define NFSV4LAYOUTRET_FILE 1 +#define NFSV4LAYOUTRET_FSID 2 +#define NFSV4LAYOUTRET_ALL 3 + #endif /* _NFS_NFSPROTO_H_ */