From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 17:53:25 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5932A106566C; Tue, 17 Jan 2012 17:53:25 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id E28F08FC20; Tue, 17 Jan 2012 17:53:24 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q0HHrN6J023255; Tue, 17 Jan 2012 21:53:23 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q0HHrNdC023254; Tue, 17 Jan 2012 21:53:23 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 17 Jan 2012 21:53:23 +0400 From: Gleb Smirnoff To: Ermal Lu?i Message-ID: <20120117175323.GH12760@FreeBSD.org> References: <201201171214.q0HCEQm8089958@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 17:53:25 -0000 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 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++; 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++; 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.