Date: Sun, 30 May 2010 14:44:39 GMT From: Marko Zec <zec@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 178978 for review Message-ID: <201005301444.o4UEidHb057496@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@178978?ac=10 Change 178978 by zec@zec_tpx32 on 2010/05/30 14:43:53 Attempt to reduce the diff against head a bit further and improve style, though Ivor hasn't left much here to be done... Affected files ... .. //depot/projects/vimage/src/sys/net/vnet.c#12 edit .. //depot/projects/vimage/src/sys/netinet/ip_mroute.c#42 edit Differences ... ==== //depot/projects/vimage/src/sys/net/vnet.c#12 (text+ko) ==== @@ -169,7 +169,7 @@ * we want the virtualized global variable space to be page-sized, we may * have more space than that in practice. */ -#define VNET_MODMIN (8192<<2) +#define VNET_MODMIN 32768 #define VNET_SIZE roundup2(VNET_BYTES, PAGE_SIZE) #define VNET_MODSIZE (VNET_SIZE - (VNET_BYTES - VNET_MODMIN)) ==== //depot/projects/vimage/src/sys/netinet/ip_mroute.c#42 (text+ko) ==== @@ -159,9 +159,9 @@ ((g).s_addr >> 20) ^ ((g).s_addr >> 10) ^ (g).s_addr) & V_mfchash) #define MFCHASHSIZE 256 -static VNET_DEFINE(u_char*, nexpire); +static u_long mfchashsize; /* Hash size */ +static VNET_DEFINE(u_char *, nexpire); /* 0..mfchashsize-1 */ #define V_nexpire VNET(nexpire) -static u_long mfchashsize; /* Hash size */ static VNET_DEFINE(LIST_HEAD(mfchashhdr, mfc)*, mfchashtbl); #define V_mfchashtbl VNET(mfchashtbl) @@ -218,7 +218,7 @@ */ static VNET_DEFINE(struct bw_upcall, bw_upcalls[BW_UPCALLS_MAX]); #define V_bw_upcalls VNET(bw_upcalls) -static VNET_DEFINE(u_int, bw_upcalls_n); /* # of pending upcalls */ +static VNET_DEFINE(u_int, bw_upcalls_n) = 0; /* # of pending upcalls */ #define V_bw_upcalls_n VNET(bw_upcalls_n) static VNET_DEFINE(struct callout, bw_upcalls_ch); #define V_bw_upcalls_ch VNET(bw_upcalls_ch) @@ -367,9 +367,9 @@ MRT_MFC_FLAGS_BORDER_VIF | MRT_MFC_RP | MRT_MFC_BW_UPCALL); -static VNET_DEFINE(uint32_t, mrt_api_config); +static VNET_DEFINE(uint32_t, mrt_api_config) = 0; #define V_mrt_api_config VNET(mrt_api_config) -static VNET_DEFINE(int, pim_assert_enabled); +static VNET_DEFINE(int, pim_assert_enabled) = 0; #define V_pim_assert_enabled VNET(pim_assert_enabled) static struct timeval pim_assert_interval = { 3, 0 }; /* Rate limit */ @@ -663,7 +663,7 @@ return EOPNOTSUPP; if (version != 1) - return (ENOPROTOOPT); + return ENOPROTOOPT; MROUTER_LOCK(); @@ -677,7 +677,8 @@ return EADDRINUSE; } - V_mfchashtbl = hashinit_flags(mfchashsize, M_MRTABLE, &V_mfchash, HASH_NOWAIT); + V_mfchashtbl = hashinit_flags(mfchashsize, M_MRTABLE, &V_mfchash, + HASH_NOWAIT); callout_reset(&V_expire_upcalls_ch, EXPIRE_TIMEOUT, expire_upcalls, curvnet); @@ -722,7 +723,7 @@ V_mrt_api_config = 0; VIF_LOCK(); - + /* * For each phyint in use, disable promiscuous reception of all IP * multicasts. @@ -1534,7 +1535,8 @@ PIMSTAT_INC(pims_rcv_registers_wrongiif); /* Get vifi for the incoming packet */ - for (vifi=0; vifi < V_numvifs && V_viftable[vifi].v_ifp != ifp; vifi++) + for (vifi = 0; vifi < V_numvifs && V_viftable[vifi].v_ifp != ifp; + vifi++) ; if (vifi >= V_numvifs) return 0; /* The iif is not found: ignore the packet. */ @@ -2814,13 +2816,8 @@ { MALLOC(V_nexpire, u_char *, mfchashsize, M_MRTABLE, M_WAITOK|M_ZERO); - V_pim_assert_enabled = 0; - V_mrt_api_config = 0; - + bzero(V_bw_meter_timers, sizeof(V_bw_meter_timers)); callout_init(&V_expire_upcalls_ch, CALLOUT_MPSAFE); - - V_bw_upcalls_n = 0; - bzero(V_bw_meter_timers, sizeof(V_bw_meter_timers)); callout_init(&V_bw_upcalls_ch, CALLOUT_MPSAFE); callout_init(&V_bw_meter_ch, CALLOUT_MPSAFE); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201005301444.o4UEidHb057496>