From owner-p4-projects@FreeBSD.ORG Tue Dec 12 12:15:35 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 85BC516A4FD; Tue, 12 Dec 2006 12:15:35 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 41C9616A4D4 for ; Tue, 12 Dec 2006 12:15:35 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4D86443DF4 for ; Tue, 12 Dec 2006 12:09:55 +0000 (GMT) (envelope-from zec@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id kBCCB2W5017984 for ; Tue, 12 Dec 2006 12:11:02 GMT (envelope-from zec@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kBCCB2DG017967 for perforce@freebsd.org; Tue, 12 Dec 2006 12:11:02 GMT (envelope-from zec@FreeBSD.org) Date: Tue, 12 Dec 2006 12:11:02 GMT Message-Id: <200612121211.kBCCB2DG017967@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@FreeBSD.org using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 111542 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: Tue, 12 Dec 2006 12:15:35 -0000 http://perforce.freebsd.org/chv.cgi?CH=111542 Change 111542 by zec@zec_tca51 on 2006/12/12 12:10:03 Virtualize igmpstat. Affected files ... .. //depot/projects/vimage/src/sys/netinet/igmp.c#6 edit .. //depot/projects/vimage/src/sys/netinet/vinet.h#5 edit Differences ... ==== //depot/projects/vimage/src/sys/netinet/igmp.c#6 (text+ko) ==== @@ -81,10 +81,12 @@ static struct router_info *find_rti(struct ifnet *ifp); static void igmp_sendpkt(struct in_multi *, int, unsigned long); +#ifndef VIMAGE static struct igmpstat igmpstat; +#endif -SYSCTL_STRUCT(_net_inet_igmp, IGMPCTL_STATS, stats, CTLFLAG_RW, &igmpstat, - igmpstat, ""); +SYSCTL_V_STRUCT(V_NET, vnet_inet, _net_inet_igmp, IGMPCTL_STATS, + stats, CTLFLAG_RW, igmpstat, igmpstat, ""); /* * igmp_mtx protects all mutable global variables in igmp.c, as well as the @@ -197,7 +199,7 @@ int timer; /** timer value in the igmp query header **/ INIT_VNET_INET(ifp->if_vnetb); - ++igmpstat.igps_rcv_total; + ++V_igmpstat.igps_rcv_total; ip = mtod(m, struct ip *); igmplen = ip->ip_len; @@ -206,14 +208,14 @@ * Validate lengths. */ if (igmplen < IGMP_MINLEN) { - ++igmpstat.igps_rcv_tooshort; + ++V_igmpstat.igps_rcv_tooshort; m_freem(m); return; } minlen = iphlen + IGMP_MINLEN; if ((m->m_flags & M_EXT || m->m_len < minlen) && (m = m_pullup(m, minlen)) == 0) { - ++igmpstat.igps_rcv_tooshort; + ++V_igmpstat.igps_rcv_tooshort; return; } @@ -224,7 +226,7 @@ m->m_len -= iphlen; igmp = mtod(m, struct igmp *); if (in_cksum(m, igmplen)) { - ++igmpstat.igps_rcv_badsum; + ++V_igmpstat.igps_rcv_badsum; m_freem(m); return; } @@ -249,7 +251,7 @@ */ switch (igmp->igmp_type) { case IGMP_MEMBERSHIP_QUERY: - ++igmpstat.igps_rcv_queries; + ++V_igmpstat.igps_rcv_queries; if (ifp->if_flags & IFF_LOOPBACK) break; @@ -276,7 +278,7 @@ if (ip->ip_dst.s_addr != igmp_all_hosts_group || igmp->igmp_group.s_addr != 0) { - ++igmpstat.igps_rcv_badqueries; + ++V_igmpstat.igps_rcv_badqueries; m_freem(m); return; } @@ -287,7 +289,7 @@ if (igmp->igmp_group.s_addr != 0 && !IN_MULTICAST(ntohl(igmp->igmp_group.s_addr))) { - ++igmpstat.igps_rcv_badqueries; + ++V_igmpstat.igps_rcv_badqueries; m_freem(m); return; } @@ -335,13 +337,13 @@ ip->ip_src.s_addr == IA_SIN(ia)->sin_addr.s_addr) break; - ++igmpstat.igps_rcv_reports; + ++V_igmpstat.igps_rcv_reports; if (ifp->if_flags & IFF_LOOPBACK) break; if (!IN_MULTICAST(ntohl(igmp->igmp_group.s_addr))) { - ++igmpstat.igps_rcv_badreports; + ++V_igmpstat.igps_rcv_badreports; m_freem(m); return; } @@ -368,7 +370,7 @@ IN_LOOKUP_MULTI(igmp->igmp_group, ifp, inm); if (inm != NULL) { inm->inm_timer = 0; - ++igmpstat.igps_rcv_ourreports; + ++V_igmpstat.igps_rcv_ourreports; inm->inm_state = IGMP_OTHERMEMBER; } IN_MULTI_UNLOCK(); @@ -530,5 +532,5 @@ */ ip_output(m, router_alert, &igmprt, 0, &imo, NULL); - ++igmpstat.igps_snd_reports; + ++V_igmpstat.igps_snd_reports; } ==== //depot/projects/vimage/src/sys/netinet/vinet.h#5 (text+ko) ==== @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -85,6 +86,7 @@ struct icmpstat _icmpstat; struct ipstat _ipstat; + struct igmpstat _igmpstat; SLIST_HEAD(, router_info) _router_info_head; }; @@ -131,6 +133,7 @@ #define V_icmpstat VNET_INET(icmpstat) #define V_ipstat VNET_INET(ipstat) +#define V_igmpstat VNET_INET(igmpstat) #define V_router_info_head VNET_INET(router_info_head)