Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Jan 2012 23:38:12 +0100
From:      =?ISO-8859-1?Q?Ermal_Lu=E7i?= <eri@freebsd.org>
To:        Gleb Smirnoff <glebius@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r230265 - head/sys/contrib/pf/net
Message-ID:  <CAPBZQG0YvM-iJsL_qU%2BX3MKrH9ZGSuBSDV90CrB6WCHSOSGChQ@mail.gmail.com>
In-Reply-To: <20120117175323.GH12760@FreeBSD.org>
References:  <201201171214.q0HCEQm8089958@svn.freebsd.org> <CAPBZQG2ChE13p-0ZTrqAKp80evJSG%2B%2Bc5=i9zEautC0YJugmtw@mail.gmail.com> <20120117175323.GH12760@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
2012/1/17 Gleb Smirnoff <glebius@freebsd.org>

> On Tue, Jan 17, 2012 at 05:48:10PM +0100, Ermal Lu?i wrote:
> E> Maybe it does not hurt in general to keep the V_
> E> Some work was done to add it, no?!
>
> The V_ has been left under __FreeBSD__.
>
> E> On Tue, Jan 17, 2012 at 1:14 PM, Gleb Smirnoff <glebius@freebsd.org>
> wrote:
> E>
> E> > Author: glebius
> E> > Date: Tue Jan 17 12:14:26 2012
> E> > New Revision: 230265
> E> > URL: http://svn.freebsd.org/changeset/base/230265
> E> >
> E> > Log:
> E> >  Allocate our mbuf with m_get2().
> E> >
> E> > Modified:
> E> >  head/sys/contrib/pf/net/if_pfsync.c
> E> >
> E> > Modified: head/sys/contrib/pf/net/if_pfsync.c
> E> >
> E> >
> ==============================================================================
> E> > --- head/sys/contrib/pf/net/if_pfsync.c Tue Jan 17 12:13:36 2012
> E> >  (r230264)
> E> > +++ head/sys/contrib/pf/net/if_pfsync.c Tue Jan 17 12:14:26 2012
> E> >  (r230265)
> E> > @@ -2121,9 +2121,6 @@ pfsync_sendout(void)
> E> >  #ifdef notyet
> E> >        struct tdb *t;
> E> >  #endif
> E> > -#ifdef __FreeBSD__
> E> > -       size_t pktlen;
> E> > -#endif
> E> >        int offset;
> E> >        int q, count = 0;
> E> >
> E> > @@ -2145,44 +2142,33 @@ pfsync_sendout(void)
> E> >                return;
> E> >        }
> E> >
> E> > -       MGETHDR(m, M_DONTWAIT, MT_DATA);
> E> > -       if (m == NULL) {
> E> >  #ifdef __FreeBSD__
> E> > +       m = m_get2(M_NOWAIT, MT_DATA, M_PKTHDR, max_linkhdr +
> sc->sc_len);
> E> > +       if (m == NULL) {
> E> >                sc->sc_ifp->if_oerrors++;
> E> > +               V_pfsyncstats.pfsyncs_onomem++;
> E> > +               return;
> E> > +       }
> E> >  #else
> E> > +       MGETHDR(m, M_DONTWAIT, MT_DATA);
> E> > +       if (m == NULL) {
> E> >                sc->sc_if.if_oerrors++;
> E> > -#endif
> E> > -               V_pfsyncstats.pfsyncs_onomem++;
> E> > +               pfsyncstats.pfsyncs_onomem++;
>
^^^^^^^^^^^^^^^^^^
What about this?


> E> >                pfsync_drop(sc);
> E> >                return;
> E> >        }
> E> >
> E> > -#ifdef __FreeBSD__
> E> > -       pktlen = max_linkhdr + sc->sc_len;
> E> > -       if (pktlen > MHLEN) {
> E> > -               /* Find the right pool to allocate from. */
> E> > -               /* XXX: This is ugly. */
> E> > -               m_cljget(m, M_DONTWAIT, pktlen <= MCLBYTES ? MCLBYTES
> :
> E> > -#if MJUMPAGESIZE != MCLBYTES
> E> > -                       pktlen <= MJUMPAGESIZE ? MJUMPAGESIZE :
> E> > -#endif
> E> > -                       pktlen <= MJUM9BYTES ? MJUM9BYTES :
> MJUM16BYTES);
> E> > -#else
> E> >        if (max_linkhdr + sc->sc_len > MHLEN) {
> E> >                MCLGETI(m, M_DONTWAIT, NULL, max_linkhdr + sc->sc_len);
> E> > -#endif
> E> >                if (!ISSET(m->m_flags, M_EXT)) {
> E> >                        m_free(m);
> E> > -#ifdef __FreeBSD__
> E> > -                       sc->sc_ifp->if_oerrors++;
> E> > -#else
> E> >                        sc->sc_if.if_oerrors++;
> E> > -#endif
> E> > -                       V_pfsyncstats.pfsyncs_onomem++;
> E> > +                       pfsyncstats.pfsyncs_onomem++;
>
^^^^^^^^^^^^^^^^^^^^^^^^^^^
What about this?


> E> >                        pfsync_drop(sc);
> E> >                        return;
> E> >                }
> E> >        }
> E> > +#endif
> E> >        m->m_data += max_linkhdr;
> E> >        m->m_len = m->m_pkthdr.len = sc->sc_len;
> E> >
> E> >
> E>
> E>
> E> --
> E> Ermal
>
> --
> Totus tuus, Glebius.
>



-- 
Ermal



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPBZQG0YvM-iJsL_qU%2BX3MKrH9ZGSuBSDV90CrB6WCHSOSGChQ>