Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Jun 2009 18:12:17 -0700
From:      Kip Macy <kmacy@freebsd.org>
To:        Robert Watson <rwatson@freebsd.org>
Cc:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   Re: svn commit: r193363 - user/kmacy/releng_7_2_fcs/sys/dev/cxgb
Message-ID:  <3c1674c90906031812r3d5940ffybc1144257359b18d@mail.gmail.com>
In-Reply-To: <alpine.BSF.2.00.0906030829150.52806@fledge.watson.org>
References:  <200906030206.n5326nlY035216@svn.freebsd.org> <alpine.BSF.2.00.0906030829150.52806@fledge.watson.org>

index | next in thread | previous in thread | raw e-mail

On Wed, Jun 3, 2009 at 12:30 AM, Robert Watson <rwatson@freebsd.org> wrote:
> On Wed, 3 Jun 2009, Kip Macy wrote:
>
>>  clear next pointers and set M_PKTHDR when needed
>
> Without looking at the context in detail, in general, you need to allocate
> mbufs intended to be headers as that from inception, or use M_MOVE_PKTHDR().
> MAC, for example, allocates an mbuf tag with each PKTHDR mbuf so that
> there's always storage for the MAC label on a packet, and if you hand assign
> the M_PKTHDR flag to mbufs, that alloation will be missed.  This is only a
> problem if you later inject that header into the stack, but that's usually
> the point of adding headers so I'm guessing that can happen here? :-)

The problem is that by doing that I end up taking cache misses on the
mbuf twice. How does MAC support deferred initialization? I can just
defer the actual mbuf allocation if need be.

-Kip


-Kip


>
> Robert N M Watson
> Computer Laboratory
> University of Cambridge
>
>>
>> Modified:
>>  user/kmacy/releng_7_2_fcs/sys/dev/cxgb/cxgb_sge.c
>>
>> Modified: user/kmacy/releng_7_2_fcs/sys/dev/cxgb/cxgb_sge.c
>>
>> ==============================================================================
>> --- user/kmacy/releng_7_2_fcs/sys/dev/cxgb/cxgb_sge.c   Wed Jun  3
>> 01:59:42 2009        (r193362)
>> +++ user/kmacy/releng_7_2_fcs/sys/dev/cxgb/cxgb_sge.c   Wed Jun  3
>> 02:06:49 2009        (r193363)
>> @@ -2678,6 +2678,8 @@ get_packet(adapter_t *adap, unsigned int
>>                        flags = M_PKTHDR;
>>                if (fl->zone != zone_pack)
>>                        m_cljset(m0, cl, fl->type);
>> +               m0->m_flags |= flags;
>> +               m0->m_next = m0->m_nextpkt = NULL;
>>                m0->m_pkthdr.len = m0->m_len = len;
>>        }
>>        switch(sopeop) {
>>
>



-- 
When bad men combine, the good must associate; else they will fall one
by one, an unpitied sacrifice in a contemptible struggle.

    Edmund Burke


help

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