xref: /csrg-svn/sys/nfs/nfsrtt.h (revision 68653)
152138Smckusick /*
263236Sbostic  * Copyright (c) 1992, 1993
363236Sbostic  *	The Regents of the University of California.  All rights reserved.
452138Smckusick  *
552138Smckusick  * This code is derived from software contributed to Berkeley by
652138Smckusick  * Rick Macklem at The University of Guelph.
752138Smckusick  *
852138Smckusick  * %sccs.include.redist.c%
952138Smckusick  *
10*68653Smckusick  *	@(#)nfsrtt.h	8.2 (Berkeley) 03/30/95
1152138Smckusick  */
1252138Smckusick 
13*68653Smckusick 
14*68653Smckusick #ifndef _NFS_NFSRTT_H_
15*68653Smckusick #define _NFS_NFSRTT_H_
16*68653Smckusick 
1752138Smckusick /*
1857777Smckusick  * Definitions for performance monitor.
1957777Smckusick  * The client and server logging are turned on by setting the global
2057777Smckusick  * constant "nfsrtton" to 1.
2152138Smckusick  */
2252138Smckusick #define	NFSRTTLOGSIZ	128
2357777Smckusick 
2457777Smckusick /*
2557777Smckusick  * Circular log of client side rpc activity. Each log entry is for one
2657777Smckusick  * rpc filled in upon completion. (ie. in order of completion)
2757777Smckusick  * The "pos" is the table index for the "next" entry, therefore the
2857777Smckusick  * list goes from nfsrtt.rttl[pos] --> nfsrtt.rttl[pos - 1] in
2957777Smckusick  * chronological order of completion.
3057777Smckusick  */
3152138Smckusick struct nfsrtt {
3257777Smckusick 	int pos;			/* Position in array for next entry */
3352138Smckusick 	struct rttl {
3457777Smckusick 		int	proc;		/* NFS procedure number */
3557777Smckusick 		int	rtt;		/* Measured round trip time */
3657777Smckusick 		int	rto;		/* Round Trip Timeout */
3757777Smckusick 		int	sent;		/* # rpcs in progress */
3857777Smckusick 		int	cwnd;		/* Send window */
3957777Smckusick 		int	srtt;		/* Ave Round Trip Time */
4057777Smckusick 		int	sdrtt;		/* Ave mean deviation of RTT */
4157777Smckusick 		fsid_t	fsid;		/* Fsid for mount point */
4257777Smckusick 		struct timeval tstamp;	/* Timestamp of log entry */
4352138Smckusick 	} rttl[NFSRTTLOGSIZ];
4452138Smckusick };
4557777Smckusick 
4657777Smckusick /*
4757777Smckusick  * And definitions for server side performance monitor.
4857777Smckusick  * The log organization is the same as above except it is filled in at the
4957777Smckusick  * time the server sends the rpc reply.
5057777Smckusick  */
5157777Smckusick 
5257777Smckusick /*
5357777Smckusick  * Bits for the flags field.
5457777Smckusick  */
5557777Smckusick #define	DRT_NQNFS	0x01	/* Rpc used Nqnfs protocol */
5657777Smckusick #define	DRT_TCP		0x02	/* Client used TCP transport */
5757777Smckusick #define	DRT_CACHEREPLY	0x04	/* Reply was from recent request cache */
5857777Smckusick #define	DRT_CACHEDROP	0x08	/* Rpc request dropped, due to recent reply */
59*68653Smckusick #define DRT_NFSV3	0x10	/* Rpc used NFS Version 3 */
6057777Smckusick 
6157777Smckusick /*
6257777Smckusick  * Server log structure
6357777Smckusick  * NB: ipadr == INADDR_ANY indicates a client using a non IP protocol.
6457777Smckusick  *	(ISO perhaps?)
6557777Smckusick  */
6657777Smckusick struct nfsdrt {
6757777Smckusick 	int pos;			/* Position of next log entry */
6857777Smckusick 	struct drt {
6957777Smckusick 		int	flag;		/* Bits as defined above */
7057777Smckusick 		int	proc;		/* NFS procedure number */
7157777Smckusick 		u_long	ipadr;		/* IP address of client */
7257777Smckusick 		int	resptime;	/* Response time (usec) */
7357777Smckusick 		struct timeval tstamp;	/* Timestamp of log entry */
7457777Smckusick 	} drt[NFSRTTLOGSIZ];
7557777Smckusick };
76*68653Smckusick 
77*68653Smckusick #endif
78