From owner-p4-projects@FreeBSD.ORG Thu Jul 30 18:31:37 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2F7531065672; Thu, 30 Jul 2009 18:31:37 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3986106566C for ; Thu, 30 Jul 2009 18:31:36 +0000 (UTC) (envelope-from pgj@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id D1C728FC0C for ; Thu, 30 Jul 2009 18:31:36 +0000 (UTC) (envelope-from pgj@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n6UIVaWk005373 for ; Thu, 30 Jul 2009 18:31:36 GMT (envelope-from pgj@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n6UIVaRB005371 for perforce@freebsd.org; Thu, 30 Jul 2009 18:31:36 GMT (envelope-from pgj@FreeBSD.org) Date: Thu, 30 Jul 2009 18:31:36 GMT Message-Id: <200907301831.n6UIVaRB005371@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to pgj@FreeBSD.org using -f From: Gabor Pali To: Perforce Change Reviews Cc: Subject: PERFORCE change 166822 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2009 18:31:37 -0000 http://perforce.freebsd.org/chv.cgi?CH=166822 Change 166822 by pgj@petymeg-current on 2009/07/30 18:31:35 - Standardize and add header for SPX statistics. - Expose SPX statistics via sysctl(3) [net.ipx.spx.stats]. Affected files ... .. //depot/projects/soc2009/pgj_libstat/src/sys/netipx/spx_usrreq.c#3 edit .. //depot/projects/soc2009/pgj_libstat/src/sys/netipx/spx_var.h#3 edit Differences ... ==== //depot/projects/soc2009/pgj_libstat/src/sys/netipx/spx_usrreq.c#3 (text+ko) ==== @@ -65,6 +65,7 @@ #include __FBSDID("$FreeBSD: src/sys/netipx/spx_usrreq.c,v 1.96 2009/05/25 11:52:33 rwatson Exp $"); +#include #include #include #include @@ -77,9 +78,13 @@ #include #include #include +#include +#include +#include #include #include +#include #include #include @@ -97,8 +102,17 @@ u_short spx_newchecks[50]; static int spx_hardnosed; static int traceallspxs = 0; +struct stat_header spx_istat_header = { + .sth_version = SPXSTAT_VERSION, + .sth_len = sizeof(struct spx_istat) +}; struct spx_istat spx_istat; +SYSCTL_STRUCT(_net_ipx_spx, OID_AUTO, stats, CTLFLAG_RW, &spx_istat, + spx_istat, "SPX Statistics (struct spx_istat, netipx/spx_var.h)"); +SYSCTL_STRUCT(_net_ipx_spx, OID_AUTO, stats_header, CTLFLAG_RD, + &spx_istat_header, stat_header, "SPX Statistics header"); + #define SPX_LOCK_INIT() mtx_init(&spx_mtx, "spx_mtx", NULL, MTX_DEF) #define SPX_LOCK() mtx_lock(&spx_mtx) #define SPX_UNLOCK() mtx_unlock(&spx_mtx) ==== //depot/projects/soc2009/pgj_libstat/src/sys/netipx/spx_var.h#3 (text+ko) ==== @@ -64,71 +64,73 @@ #ifndef _NETIPX_SPX_VAR_H_ #define _NETIPX_SPX_VAR_H_ +#define SPXSTAT_VERSION 0x00000001 + struct spxstat { - long spxs_connattempt; /* connections initiated */ - long spxs_accepts; /* connections accepted */ - long spxs_connects; /* connections established */ - long spxs_drops; /* connections dropped */ - long spxs_conndrops; /* embryonic connections dropped */ - long spxs_closed; /* conn. closed (includes drops) */ - long spxs_segstimed; /* segs where we tried to get rtt */ - long spxs_rttupdated; /* times we succeeded */ - long spxs_delack; /* delayed acks sent */ - long spxs_timeoutdrop; /* conn. dropped in rxmt timeout */ - long spxs_rexmttimeo; /* retransmit timeouts */ - long spxs_persisttimeo; /* persist timeouts */ - long spxs_keeptimeo; /* keepalive timeouts */ - long spxs_keepprobe; /* keepalive probes sent */ - long spxs_keepdrops; /* connections dropped in keepalive */ + u_int64_t spxs_connattempt; /* connections initiated */ + u_int64_t spxs_accepts; /* connections accepted */ + u_int64_t spxs_connects; /* connections established */ + u_int64_t spxs_drops; /* connections dropped */ + u_int64_t spxs_conndrops; /* embryonic connections dropped */ + u_int64_t spxs_closed; /* conn. closed (includes drops) */ + u_int64_t spxs_segstimed; /* segs where we tried to get rtt */ + u_int64_t spxs_rttupdated; /* times we succeeded */ + u_int64_t spxs_delack; /* delayed acks sent */ + u_int64_t spxs_timeoutdrop; /* conn. dropped in rxmt timeout */ + u_int64_t spxs_rexmttimeo; /* retransmit timeouts */ + u_int64_t spxs_persisttimeo; /* persist timeouts */ + u_int64_t spxs_keeptimeo; /* keepalive timeouts */ + u_int64_t spxs_keepprobe; /* keepalive probes sent */ + u_int64_t spxs_keepdrops; /* connections dropped in keepalive */ - long spxs_sndtotal; /* total packets sent */ - long spxs_sndpack; /* data packets sent */ - long spxs_sndbyte; /* data bytes sent */ - long spxs_sndrexmitpack; /* data packets retransmitted */ - long spxs_sndrexmitbyte; /* data bytes retransmitted */ - long spxs_sndacks; /* ack-only packets sent */ - long spxs_sndprobe; /* window probes sent */ - long spxs_sndurg; /* packets sent with URG only */ - long spxs_sndwinup; /* window update-only packets sent */ - long spxs_sndctrl; /* control (SYN|FIN|RST) packets sent */ - long spxs_sndvoid; /* couldn't find requested packet*/ + u_int64_t spxs_sndtotal; /* total packets sent */ + u_int64_t spxs_sndpack; /* data packets sent */ + u_int64_t spxs_sndbyte; /* data bytes sent */ + u_int64_t spxs_sndrexmitpack; /* data packets retransmitted */ + u_int64_t spxs_sndrexmitbyte; /* data bytes retransmitted */ + u_int64_t spxs_sndacks; /* ack-only packets sent */ + u_int64_t spxs_sndprobe; /* window probes sent */ + u_int64_t spxs_sndurg; /* packets sent with URG only */ + u_int64_t spxs_sndwinup; /* window update-only packets sent */ + u_int64_t spxs_sndctrl; /* control (SYN|FIN|RST) packets sent */ + u_int64_t spxs_sndvoid; /* couldn't find requested packet*/ - long spxs_rcvtotal; /* total packets received */ - long spxs_rcvpack; /* packets received in sequence */ - long spxs_rcvbyte; /* bytes received in sequence */ - long spxs_rcvbadsum; /* packets received with ccksum errs */ - long spxs_rcvbadoff; /* packets received with bad offset */ - long spxs_rcvshort; /* packets received too short */ - long spxs_rcvduppack; /* duplicate-only packets received */ - long spxs_rcvdupbyte; /* duplicate-only bytes received */ - long spxs_rcvpartduppack; /* packets with some duplicate data */ - long spxs_rcvpartdupbyte; /* dup. bytes in part-dup. packets */ - long spxs_rcvoopack; /* out-of-order packets received */ - long spxs_rcvoobyte; /* out-of-order bytes received */ - long spxs_rcvpackafterwin; /* packets with data after window */ - long spxs_rcvbyteafterwin; /* bytes rcvd after window */ - long spxs_rcvafterclose; /* packets rcvd after "close" */ - long spxs_rcvwinprobe; /* rcvd window probe packets */ - long spxs_rcvdupack; /* rcvd duplicate acks */ - long spxs_rcvacktoomuch; /* rcvd acks for unsent data */ - long spxs_rcvackpack; /* rcvd ack packets */ - long spxs_rcvackbyte; /* bytes acked by rcvd acks */ - long spxs_rcvwinupd; /* rcvd window update packets */ + u_int64_t spxs_rcvtotal; /* total packets received */ + u_int64_t spxs_rcvpack; /* packets received in sequence */ + u_int64_t spxs_rcvbyte; /* bytes received in sequence */ + u_int64_t spxs_rcvbadsum; /* packets received with ccksum errs */ + u_int64_t spxs_rcvbadoff; /* packets received with bad offset */ + u_int64_t spxs_rcvshort; /* packets received too short */ + u_int64_t spxs_rcvduppack; /* duplicate-only packets received */ + u_int64_t spxs_rcvdupbyte; /* duplicate-only bytes received */ + u_int64_t spxs_rcvpartduppack; /* packets with some duplicate data */ + u_int64_t spxs_rcvpartdupbyte; /* dup. bytes in part-dup. packets */ + u_int64_t spxs_rcvoopack; /* out-of-order packets received */ + u_int64_t spxs_rcvoobyte; /* out-of-order bytes received */ + u_int64_t spxs_rcvpackafterwin; /* packets with data after window */ + u_int64_t spxs_rcvbyteafterwin; /* bytes rcvd after window */ + u_int64_t spxs_rcvafterclose; /* packets rcvd after "close" */ + u_int64_t spxs_rcvwinprobe; /* rcvd window probe packets */ + u_int64_t spxs_rcvdupack; /* rcvd duplicate acks */ + u_int64_t spxs_rcvacktoomuch; /* rcvd acks for unsent data */ + u_int64_t spxs_rcvackpack; /* rcvd ack packets */ + u_int64_t spxs_rcvackbyte; /* bytes acked by rcvd acks */ + u_int64_t spxs_rcvwinupd; /* rcvd window update packets */ }; struct spx_istat { - short hdrops; - short badsum; - short badlen; - short slotim; - short fastim; - short nonucn; - short noconn; - short notme; - short wrncon; - short bdreas; - short gonawy; - short notyet; - short lstdup; + u_int64_t hdrops; + u_int64_t badsum; + u_int64_t badlen; + u_int64_t slotim; + u_int64_t fastim; + u_int64_t nonucn; + u_int64_t noconn; + u_int64_t notme; + u_int64_t wrncon; + u_int64_t bdreas; + u_int64_t gonawy; + u_int64_t notyet; + u_int64_t lstdup; struct spxstat newstats; }; @@ -144,6 +146,11 @@ #define SSEQ_GEQ(a,b) (((short)((a)-(b))) >= 0) #ifdef _KERNEL + +#ifdef SYSCTL_DECL +SYSCTL_DECL(_net_ipx_spx); +#endif + /* Following was struct spxstat spxstat; */ #ifndef spxstat #define spxstat spx_istat.newstats