Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Apr 2020 00:27:55 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r359813 - projects/nfs-over-tls/sys/fs/nfsserver
Message-ID:  <202004120027.03C0RtQE094716@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Sun Apr 12 00:27:55 2020
New Revision: 359813
URL: https://svnweb.freebsd.org/changeset/base/359813

Log:
  Update nfs_fha_new.h, which got missed in previous code merges.

Modified:
  projects/nfs-over-tls/sys/fs/nfsserver/nfs_fha_new.h

Modified: projects/nfs-over-tls/sys/fs/nfsserver/nfs_fha_new.h
==============================================================================
--- projects/nfs-over-tls/sys/fs/nfsserver/nfs_fha_new.h	Sun Apr 12 00:01:23 2020	(r359812)
+++ projects/nfs-over-tls/sys/fs/nfsserver/nfs_fha_new.h	Sun Apr 12 00:27:55 2020	(r359813)
@@ -33,9 +33,77 @@
 
 #ifdef	_KERNEL
 
+/* Sysctl defaults. */
+#define FHA_DEF_ENABLE			1
+#define FHA_DEF_READ			1
+#define FHA_DEF_WRITE			1
+#define FHA_DEF_BIN_SHIFT		22 /* 4MB */
+#define FHA_DEF_MAX_NFSDS_PER_FH	8
+#define FHA_DEF_MAX_REQS_PER_NFSD	0  /* Unlimited */
+
+#define FHA_HASH_SIZE	251
+
+struct fha_ctls {
+	int	 enable;
+	int	 read;
+	int	 write;
+	uint32_t bin_shift;
+	uint32_t max_nfsds_per_fh;
+	uint32_t max_reqs_per_nfsd;
+};
+
+/*
+ * These are the entries in the filehandle hash.  They talk about a specific
+ * file, requests against which are being handled by one or more nfsds.  We
+ * keep a chain of nfsds against the file. We only have more than one if reads
+ * are ongoing, and then only if the reads affect disparate regions of the
+ * file.
+ *
+ * In general, we want to assign a new request to an existing nfsd if it is
+ * going to contend with work happening already on that nfsd, or if the
+ * operation is a read and the nfsd is already handling a proximate read.  We
+ * do this to avoid jumping around in the read stream unnecessarily, and to
+ * avoid contention between threads over single files.
+ */
+struct fha_hash_entry {
+	struct mtx *mtx;
+	LIST_ENTRY(fha_hash_entry) link;
+	u_int64_t fh;
+	u_int32_t num_rw;
+	u_int32_t num_exclusive;
+	u_int8_t num_threads;
+	struct svcthread_list threads;
+};
+
+LIST_HEAD(fha_hash_entry_list, fha_hash_entry);
+
+struct fha_hash_slot {
+	struct fha_hash_entry_list list;
+	struct mtx mtx;
+};
+
+/* A structure used for passing around data internally. */
+struct fha_info {
+	u_int64_t fh;
+	off_t offset;
+	int locktype;
+	int read;
+	int write;
+};
+
+struct fha_params {
+	struct fha_hash_slot fha_hash[FHA_HASH_SIZE];
+	struct sysctl_ctx_list sysctl_ctx;
+	struct sysctl_oid *sysctl_tree;
+	struct fha_ctls ctls;
+	char server_name[32];
+	SVCPOOL **pool;
+};
+
 #define	FHANEW_SERVER_NAME	"nfsd"
 
 SVCTHREAD *fhanew_assign(SVCTHREAD *this_thread, struct svc_req *req);
+void fhanew_nd_complete(SVCTHREAD *, struct svc_req *);
 #endif /* _KERNEL */
 
 #endif /* _NFS_FHA_NEW_H */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202004120027.03C0RtQE094716>