From owner-svn-src-user@FreeBSD.ORG  Wed Jun  3 07:31:00 2009
Return-Path: <owner-svn-src-user@FreeBSD.ORG>
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 639D41065670;
	Wed,  3 Jun 2009 07:31:00 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 3F0E18FC1D;
	Wed,  3 Jun 2009 07:31:00 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from fledge.watson.org (fledge.watson.org [65.122.17.41])
	by cyrus.watson.org (Postfix) with ESMTPS id 3C73846B23;
	Wed,  3 Jun 2009 03:30:59 -0400 (EDT)
Date: Wed, 3 Jun 2009 08:30:59 +0100 (BST)
From: Robert Watson <rwatson@FreeBSD.org>
X-X-Sender: robert@fledge.watson.org
To: Kip Macy <kmacy@FreeBSD.org>
In-Reply-To: <200906030206.n5326nlY035216@svn.freebsd.org>
Message-ID: <alpine.BSF.2.00.0906030829150.52806@fledge.watson.org>
References: <200906030206.n5326nlY035216@svn.freebsd.org>
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: Re: svn commit: r193363 - user/kmacy/releng_7_2_fcs/sys/dev/cxgb
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
	src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
	<mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
	<mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 03 Jun 2009 07:31:00 -0000

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? :-)

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) {
>