From owner-freebsd-arch@FreeBSD.ORG Tue Oct 12 15:57:46 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8DAE216A4CE; Tue, 12 Oct 2004 15:57:46 +0000 (GMT) Received: from kane.otenet.gr (kane.otenet.gr [195.170.0.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8706543D2D; Tue, 12 Oct 2004 15:57:45 +0000 (GMT) (envelope-from keramida@freebsd.org) Received: from orion.daedalusnetworks.priv (host5.bedc.ondsl.gr [62.103.39.229])i9CFvf0l001258; Tue, 12 Oct 2004 18:57:41 +0300 Received: from orion.daedalusnetworks.priv (orion [127.0.0.1]) i9CFveeT001936; Tue, 12 Oct 2004 18:57:40 +0300 (EEST) (envelope-from keramida@freebsd.org) Received: (from keramida@localhost)i9CFve8k001935; Tue, 12 Oct 2004 18:57:40 +0300 (EEST) (envelope-from keramida@freebsd.org) Date: Tue, 12 Oct 2004 18:57:40 +0300 From: Giorgos Keramidas To: Dag-Erling Sm?rgrav Message-ID: <20041012155740.GA1648@orion.daedalusnetworks.priv> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: cc: Sam cc: freebsd-current@freebsd.org cc: freebsd-arch@freebsd.org Subject: Re: mbuf w/o pkthdr? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2004 15:57:46 -0000 On 2004-10-12 17:36, Dag-Erling Sm?rgrav wrote: > Sam writes: > > Are all packets supposed to have the M_PKTHDR flag? Why? > > IIRC, M_PKTHDR indicates the first mbuf in a chain when a packet is > split across multiple mbufs. This usually only happens for outgoing > packets, where protocol headers are constructed in separate mbufs > which are prepended to the chain as the packet moves down the stack. AFAIK, all the packets have an M_PKTHDR in the first mbuf of their chain. The presence of an M_PKTHDR flag only means that the beginning of the mbuf contains a (struct pkthdr) before the packet payload. This is not related to the splitting of packets to multiple mbufs or not, though. A small packet might have an M_PKTHDR but still fit in a single mbuf if its payload packet (including protocol headers and data) is less than MHLEN bytes.