Date: Wed, 18 Jan 2012 08:33:33 +0400 From: Gleb Smirnoff <glebius@FreeBSD.org> To: Ermal Lu?i <eri@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: <20120118043333.GL12760@FreeBSD.org> In-Reply-To: <CAPBZQG0YvM-iJsL_qU%2BX3MKrH9ZGSuBSDV90CrB6WCHSOSGChQ@mail.gmail.com> References: <201201171214.q0HCEQm8089958@svn.freebsd.org> <CAPBZQG2ChE13p-0ZTrqAKp80evJSG%2B%2Bc5=i9zEautC0YJugmtw@mail.gmail.com> <20120117175323.GH12760@FreeBSD.org> <CAPBZQG0YvM-iJsL_qU%2BX3MKrH9ZGSuBSDV90CrB6WCHSOSGChQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Jan 17, 2012 at 11:38:12PM +0100, Ermal Lu?i wrote: E> > On Tue, Jan 17, 2012 at 05:48:10PM +0100, Ermal Lu?i wrote: E> > E> Maybe it does not hurt in general to keep the V_ E> > E> Some work was done to add it, no?! E> > E> > The V_ has been left under __FreeBSD__. E> > E> > E> On Tue, Jan 17, 2012 at 1:14 PM, Gleb Smirnoff <glebius@freebsd.org> E> > wrote: E> > E> E> > E> > Author: glebius E> > E> > Date: Tue Jan 17 12:14:26 2012 E> > E> > New Revision: 230265 E> > E> > URL: http://svn.freebsd.org/changeset/base/230265 E> > E> > E> > E> > Log: E> > E> > Allocate our mbuf with m_get2(). E> > E> > E> > E> > Modified: E> > E> > head/sys/contrib/pf/net/if_pfsync.c E> > E> > E> > E> > Modified: head/sys/contrib/pf/net/if_pfsync.c E> > E> > E> > E> > E> > ============================================================================== E> > E> > --- head/sys/contrib/pf/net/if_pfsync.c Tue Jan 17 12:13:36 2012 E> > E> > (r230264) E> > E> > +++ head/sys/contrib/pf/net/if_pfsync.c Tue Jan 17 12:14:26 2012 E> > E> > (r230265) E> > E> > @@ -2121,9 +2121,6 @@ pfsync_sendout(void) E> > E> > #ifdef notyet E> > E> > struct tdb *t; E> > E> > #endif E> > E> > -#ifdef __FreeBSD__ E> > E> > - size_t pktlen; E> > E> > -#endif E> > E> > int offset; E> > E> > int q, count = 0; E> > E> > E> > E> > @@ -2145,44 +2142,33 @@ pfsync_sendout(void) E> > E> > return; E> > E> > } E> > E> > E> > E> > - MGETHDR(m, M_DONTWAIT, MT_DATA); E> > E> > - if (m == NULL) { E> > E> > #ifdef __FreeBSD__ E> > E> > + m = m_get2(M_NOWAIT, MT_DATA, M_PKTHDR, max_linkhdr + E> > sc->sc_len); E> > E> > + if (m == NULL) { E> > E> > sc->sc_ifp->if_oerrors++; E> > E> > + V_pfsyncstats.pfsyncs_onomem++; E> > E> > + return; E> > E> > + } E> > E> > #else E> > E> > + MGETHDR(m, M_DONTWAIT, MT_DATA); E> > E> > + if (m == NULL) { E> > E> > sc->sc_if.if_oerrors++; E> > E> > -#endif E> > E> > - V_pfsyncstats.pfsyncs_onomem++; E> > E> > + pfsyncstats.pfsyncs_onomem++; E> > E> ^^^^^^^^^^^^^^^^^^ E> What about this? E> E> E> > E> > pfsync_drop(sc); E> > E> > return; E> > E> > } E> > E> > E> > E> > -#ifdef __FreeBSD__ E> > E> > - pktlen = max_linkhdr + sc->sc_len; E> > E> > - if (pktlen > MHLEN) { E> > E> > - /* Find the right pool to allocate from. */ E> > E> > - /* XXX: This is ugly. */ E> > E> > - m_cljget(m, M_DONTWAIT, pktlen <= MCLBYTES ? MCLBYTES E> > : E> > E> > -#if MJUMPAGESIZE != MCLBYTES E> > E> > - pktlen <= MJUMPAGESIZE ? MJUMPAGESIZE : E> > E> > -#endif E> > E> > - pktlen <= MJUM9BYTES ? MJUM9BYTES : E> > MJUM16BYTES); E> > E> > -#else E> > E> > if (max_linkhdr + sc->sc_len > MHLEN) { E> > E> > MCLGETI(m, M_DONTWAIT, NULL, max_linkhdr + sc->sc_len); E> > E> > -#endif E> > E> > if (!ISSET(m->m_flags, M_EXT)) { E> > E> > m_free(m); E> > E> > -#ifdef __FreeBSD__ E> > E> > - sc->sc_ifp->if_oerrors++; E> > E> > -#else E> > E> > sc->sc_if.if_oerrors++; E> > E> > -#endif E> > E> > - V_pfsyncstats.pfsyncs_onomem++; E> > E> > + pfsyncstats.pfsyncs_onomem++; E> > E> ^^^^^^^^^^^^^^^^^^^^^^^^^^^ E> What about this? E> E> E> > E> > pfsync_drop(sc); E> > E> > return; E> > E> > } E> > E> > } E> > E> > +#endif E> > E> > m->m_data += max_linkhdr; E> > E> > m->m_len = m->m_pkthdr.len = sc->sc_len; E> > E> > E> > E> > These are not under __FreeBSD__. -- Totus tuus, Glebius.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120118043333.GL12760>