PERFORCE change 178978 for review

Marko Zec zec at freebsd.org
Sun May 30 19:31:25 UTC 2010


On Sunday 30 May 2010 20:59:33 Garrett Cooper wrote:
> On Sun, May 30, 2010 at 7:44 AM, Marko Zec <zec at freebsd.org> wrote:
> > http://p4web.freebsd.org/@@178978?ac=10
> >
> > Change 178978 by zec at 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;
>
> That's actually a style regression (along with any other return calls
> without parentheses).

Yup - technically you're right, but this particular change was intended to 
minimize the scope of the diff against head - if you'd throw a look at 
ip_mroute.c in head you'd spot a ton of other style violations, including 
this one.  My intention is to do a functional (V_irtualization) change in one 
commit, and then we can do a no-op style sweep on ip_mroute.c later.

Marko


More information about the p4-projects mailing list