Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Aug 2002 11:00:39 -0700
From:      Luigi Rizzo <luigi@FreeBSD.org>
To:        Bosko Milekic <bmilekic@unixdaemons.com>
Cc:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/kern uipc_mbuf.c
Message-ID:  <20020811110039.A88059@iguana.icir.org>
In-Reply-To: <20020811134830.A95732@unixdaemons.com>; from bmilekic@unixdaemons.com on Sun, Aug 11, 2002 at 01:48:30PM -0400
References:  <200208111017.g7BAHvWK044438@freefall.freebsd.org> <20020811134830.A95732@unixdaemons.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Aug 11, 2002 at 01:48:30PM -0400, Bosko Milekic wrote:
> 
> On Sun, Aug 11, 2002 at 03:17:57AM -0700, Luigi Rizzo wrote:
> > luigi       2002/08/11 03:17:57 PDT
> > 
> >   Modified files:        (Branch: RELENG_4)
> >     sys/kern             uipc_mbuf.c 
> >   Log:
> >   Bring back mcl_pool_max to 0 as default, while i investigate
> >   on some problems people were having with it (likely
> >   some missing initialization of mbuf header fields in the
> >   handling of the free list).
> 
>  Yes, you fail to properly initialize the mbuf when you allocate it from
>  the 'mcl_pool' thing.
> 
>  You need to initialize some of the pkthdr fields as well as the flags
>  field, as MGETHDR() does.

so, apparently 3 fields were not initialized properly (compared
to MGETHDR):
        m_flags (had extra bits set)
        rcvif   (not zeroed)
        csum_flags      not zeroed

in practice only the first one seems to be the source of problems
at least here, but of course all three need to be reset. The following
patch to m_getcl() near line 580 should do the trick:

                        splx(s);
                        mp->m_nextpkt = NULL;
                        mp->m_data = mp->m_ext.ext_buf;
+                       mp->m_flags = (M_PKTHDR|M_EXT);
+                       mp->m_pkthdr.rcvif = NULL;
+                       mp->m_pkthdr.csum_flags = 0;
                        return mp;
                } else
                        MGETHDR(mp, how, type);

	cheers
	luigi

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020811110039.A88059>