Date: Sun, 15 Mar 2009 10:20:11 GMT From: Julian Elischer <julian@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 159240 for review Message-ID: <200903151020.n2FAKB85086611@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=159240 Change 159240 by julian@julian_trafmon1 on 2009/03/15 10:19:29 Allow VIMAGE to compile Affected files ... .. //depot/projects/vimage/src/sys/netinet/igmp.c#28 edit .. //depot/projects/vimage/src/sys/netinet/in.c#29 edit .. //depot/projects/vimage/src/sys/netinet/in_mcast.c#21 edit .. //depot/projects/vimage/src/sys/sys/vimage.h#82 edit Differences ... ==== //depot/projects/vimage/src/sys/netinet/igmp.c#28 (text+ko) ==== @@ -335,6 +335,7 @@ static int sysctl_igmp_default_version(SYSCTL_HANDLER_ARGS) { + INIT_VNET_INET(curvnet); int error; int new; @@ -374,6 +375,7 @@ static int sysctl_igmp_gsr(SYSCTL_HANDLER_ARGS) { + INIT_VNET_INET(curvnet); int error; int i; @@ -415,6 +417,7 @@ sysctl_igmp_ifinfo(SYSCTL_HANDLER_ARGS) { INIT_VNET_NET(curvnet); + INIT_VNET_INET(curvnet); int *name; int error; u_int namelen; @@ -500,6 +503,7 @@ static __inline int igmp_isgroupreported(const struct in_addr addr) { + INIT_VNET_INET(curvnet); if (in_allhosts(addr) || ((!V_igmp_sendlocal && IN_LOCAL_GROUP(ntohl(addr.s_addr))))) @@ -562,6 +566,7 @@ static struct igmp_ifinfo * igi_alloc_locked(/*const*/ struct ifnet *ifp) { + INIT_VNET_INET(curvnet); struct igmp_ifinfo *igi; IGMP_LOCK_ASSERT(); @@ -701,6 +706,7 @@ static void igi_delete_locked(const struct ifnet *ifp) { + INIT_VNET_INET(curvnet); struct igmp_ifinfo *igi, *tigi; CTR3(KTR_IGMPV3, "%s: freeing igmp_ifinfo for ifp %p(%s)", @@ -824,6 +830,7 @@ igmp_input_v2_query(struct ifnet *ifp, const struct ip *ip, const struct igmp *igmp) { + INIT_VNET_INET(curvnet); struct ifmultiaddr *ifma; struct igmp_ifinfo *igi; struct in_multi *inm; @@ -915,6 +922,7 @@ static void igmp_v2_update_group(struct in_multi *inm, const int timer) { + INIT_VNET_INET(curvnet); CTR4(KTR_IGMPV3, "%s: %s/%s timer=%d", __func__, inet_ntoa(inm->inm_addr), inm->inm_ifp->if_xname, timer); @@ -962,6 +970,7 @@ igmp_input_v3_query(struct ifnet *ifp, const struct ip *ip, /*const*/ struct igmpv3 *igmpv3) { + INIT_VNET_INET(curvnet); struct igmp_ifinfo *igi; struct in_multi *inm; uint32_t maxresp, nsrc, qqi; @@ -1106,6 +1115,7 @@ igmp_input_v3_group_query(struct in_multi *inm, struct igmp_ifinfo *igi, int timer, /*const*/ struct igmpv3 *igmpv3) { + INIT_VNET_INET(curvnet); int retval; uint16_t nsrc; @@ -1215,6 +1225,7 @@ igmp_input_v1_report(struct ifnet *ifp, /*const*/ struct ip *ip, /*const*/ struct igmp *igmp) { + INIT_VNET_INET(curvnet); struct in_ifaddr *ia; struct in_multi *inm; @@ -1321,6 +1332,7 @@ igmp_input_v2_report(struct ifnet *ifp, /*const*/ struct ip *ip, /*const*/ struct igmp *igmp) { + INIT_VNET_INET(curvnet); struct in_ifaddr *ia; struct in_multi *inm; @@ -1612,7 +1624,6 @@ VNET_LIST_RLOCK(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); - INIT_VNET_INET(vnet_iter); igmp_fasttimo_vnet(); CURVNET_RESTORE(); } @@ -1632,6 +1643,7 @@ static void igmp_fasttimo_vnet(void) { + INIT_VNET_INET(curvnet); struct ifqueue scq; /* State-change packets */ struct ifqueue qrq; /* Query response packets */ struct ifnet *ifp; @@ -1758,6 +1770,7 @@ static void igmp_v1v2_process_group_timer(struct in_multi *inm, const int version) { + INIT_VNET_INET(curvnet); int report_timer_expired; IN_MULTI_LOCK_ASSERT(); @@ -1806,6 +1819,7 @@ struct ifqueue *qrq, struct ifqueue *scq, struct in_multi *inm, const int uri_fasthz) { + INIT_VNET_INET(curvnet); int query_response_timer_expired; int state_change_retransmit_timer_expired; @@ -1995,6 +2009,7 @@ static void igmp_v3_cancel_link_timers(struct igmp_ifinfo *igi) { + INIT_VNET_INET(curvnet); struct ifmultiaddr *ifma; struct ifnet *ifp; struct in_multi *inm; @@ -2071,6 +2086,7 @@ igmp_v1v2_process_querier_timers(struct igmp_ifinfo *igi) { + INIT_VNET_INET(curvnet); IGMP_LOCK_ASSERT(); if (igi->igi_v1_timer == 0 && igi->igi_v2_timer == 0) { @@ -2152,7 +2168,6 @@ VNET_LIST_RLOCK(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); - INIT_VNET_INET(vnet_iter); igmp_slowtimo_vnet(); CURVNET_RESTORE(); } @@ -2168,6 +2183,7 @@ static void igmp_slowtimo_vnet(void) { + INIT_VNET_INET(curvnet); struct igmp_ifinfo *igi; IGMP_LOCK(); @@ -2195,9 +2211,6 @@ IGMP_LOCK_ASSERT(); ifp = inm->inm_ifp; - /* XXX are these needed ? */ - INIT_VNET_NET(ifp->if_vnet); - INIT_VNET_INET(ifp->if_vnet); MGETHDR(m, M_DONTWAIT, MT_DATA); if (m == NULL) @@ -2335,6 +2348,7 @@ static int igmp_initial_join(struct in_multi *inm, struct igmp_ifinfo *igi) { + INIT_VNET_INET(curvnet); struct ifnet *ifp; struct ifqueue *ifq; int error, retval, syncstates; @@ -2463,6 +2477,7 @@ static int igmp_handle_state_change(struct in_multi *inm, struct igmp_ifinfo *igi) { + INIT_VNET_INET(curvnet); struct ifnet *ifp; int retval; @@ -2522,6 +2537,7 @@ static void igmp_final_leave(struct in_multi *inm, struct igmp_ifinfo *igi) { + INIT_VNET_INET(curvnet); int syncstates; syncstates = 1; @@ -3303,6 +3319,7 @@ static void igmp_v3_dispatch_general_query(struct igmp_ifinfo *igi) { + INIT_VNET_INET(curvnet); struct ifmultiaddr *ifma, *tifma; struct ifnet *ifp; struct in_multi *inm; @@ -3388,7 +3405,9 @@ * indexes to guard against interface detach, they are * unique to each VIMAGE and must be retrieved. */ - CURVNET_SET(m->m_pkthdr.header); + CURVNET_SET((struct vnet *)(m->m_pkthdr.header)); + INIT_VNET_INET(curvnet); + INIT_VNET_NET(curvnet); ifindex = igmp_restore_context(m); /* @@ -3471,7 +3490,6 @@ static struct mbuf * igmp_v3_encap_report(struct ifnet *ifp, struct mbuf *m) { - INIT_VNET_NET(curvnet); INIT_VNET_INET(curvnet); struct igmp_report *igmp; struct ip *ip; @@ -3650,14 +3668,28 @@ return (0); } +struct vnet_igmp { + int dummy; +}; +#ifndef VIMAGE +#ifndef VIMAGE_GLOBALS +struct vnet_igmp vnet_igmp_0; +#endif +#endif + +/* XXX VIMAGE [julian] + * BMS seems unsure if this should be a separate module or not as he's + * put the extra fields into vnet_inet instead of a vnet_igmp. + * yet it has module setup functions.. + */ #ifdef VIMAGE static struct vnet_symmap vnet_igmp_symmap[] = { - VNET_SYMMAP(igmp, igi_head), - VNET_SYMMAP(igmp, igmpstat), + VNET_SYMMAP(inet, igi_head), + VNET_SYMMAP(inet, igmpstat), VNET_SYMMAP_END }; VNET_MOD_DECLARE(IGMP, igmp, vnet_igmp_iattach, vnet_igmp_idetach, - vnet_igmp_symmap); + INET, vnet_igmp_symmap); #endif /* VIMAGE */ static int ==== //depot/projects/vimage/src/sys/netinet/in.c#29 (text+ko) ==== @@ -1024,7 +1024,6 @@ static void in_purgemaddrs(struct ifnet *ifp) { - INIT_VNET_INET(ifp->if_vnet); LIST_HEAD(,in_multi) purgeinms; struct in_multi *inm, *tinm; struct ifmultiaddr *ifma; ==== //depot/projects/vimage/src/sys/netinet/in_mcast.c#21 (text+ko) ==== @@ -394,7 +394,6 @@ in_getmulti(struct ifnet *ifp, const struct in_addr *group, struct in_multi **pinm) { - INIT_VNET_INET(ifp->if_vnet); struct sockaddr_in gsin; struct ifmultiaddr *ifma; struct in_ifinfo *ii; @@ -1825,6 +1824,7 @@ inp_lookup_mcast_ifp(const struct inpcb *inp, const struct sockaddr_in *gsin, const struct in_addr ina) { + INIT_VNET_INET(curvnet); struct ifnet *ifp; KASSERT(gsin->sin_family == AF_INET, ("%s: not AF_INET", __func__)); @@ -1870,7 +1870,6 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt) { INIT_VNET_NET(curvnet); - INIT_VNET_INET(curvnet); struct group_source_req gsr; sockunion_t *gsa, *ssa; struct ifnet *ifp; ==== //depot/projects/vimage/src/sys/sys/vimage.h#82 (text+ko) ==== @@ -181,6 +181,7 @@ #define VNET_MOD_IPX 9 #define VNET_MOD_ATALK 10 #define VNET_MOD_ACCF_HTTP 11 +#define VNET_MOD_IGMP 12 /* stateless modules */ #define VNET_MOD_NG_ETHER 20 #define VNET_MOD_NG_IFACE 21
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903151020.n2FAKB85086611>