xref: /original-bsd/sys/nfs/nfsrtt.h (revision 58b1b499)
1 /*
2  * Copyright (c) 1992, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * This code is derived from software contributed to Berkeley by
6  * Rick Macklem at The University of Guelph.
7  *
8  * %sccs.include.redist.c%
9  *
10  *	@(#)nfsrtt.h	8.2 (Berkeley) 03/30/95
11  */
12 
13 
14 #ifndef _NFS_NFSRTT_H_
15 #define _NFS_NFSRTT_H_
16 
17 /*
18  * Definitions for performance monitor.
19  * The client and server logging are turned on by setting the global
20  * constant "nfsrtton" to 1.
21  */
22 #define	NFSRTTLOGSIZ	128
23 
24 /*
25  * Circular log of client side rpc activity. Each log entry is for one
26  * rpc filled in upon completion. (ie. in order of completion)
27  * The "pos" is the table index for the "next" entry, therefore the
28  * list goes from nfsrtt.rttl[pos] --> nfsrtt.rttl[pos - 1] in
29  * chronological order of completion.
30  */
31 struct nfsrtt {
32 	int pos;			/* Position in array for next entry */
33 	struct rttl {
34 		int	proc;		/* NFS procedure number */
35 		int	rtt;		/* Measured round trip time */
36 		int	rto;		/* Round Trip Timeout */
37 		int	sent;		/* # rpcs in progress */
38 		int	cwnd;		/* Send window */
39 		int	srtt;		/* Ave Round Trip Time */
40 		int	sdrtt;		/* Ave mean deviation of RTT */
41 		fsid_t	fsid;		/* Fsid for mount point */
42 		struct timeval tstamp;	/* Timestamp of log entry */
43 	} rttl[NFSRTTLOGSIZ];
44 };
45 
46 /*
47  * And definitions for server side performance monitor.
48  * The log organization is the same as above except it is filled in at the
49  * time the server sends the rpc reply.
50  */
51 
52 /*
53  * Bits for the flags field.
54  */
55 #define	DRT_NQNFS	0x01	/* Rpc used Nqnfs protocol */
56 #define	DRT_TCP		0x02	/* Client used TCP transport */
57 #define	DRT_CACHEREPLY	0x04	/* Reply was from recent request cache */
58 #define	DRT_CACHEDROP	0x08	/* Rpc request dropped, due to recent reply */
59 #define DRT_NFSV3	0x10	/* Rpc used NFS Version 3 */
60 
61 /*
62  * Server log structure
63  * NB: ipadr == INADDR_ANY indicates a client using a non IP protocol.
64  *	(ISO perhaps?)
65  */
66 struct nfsdrt {
67 	int pos;			/* Position of next log entry */
68 	struct drt {
69 		int	flag;		/* Bits as defined above */
70 		int	proc;		/* NFS procedure number */
71 		u_long	ipadr;		/* IP address of client */
72 		int	resptime;	/* Response time (usec) */
73 		struct timeval tstamp;	/* Timestamp of log entry */
74 	} drt[NFSRTTLOGSIZ];
75 };
76 
77 #endif
78