From owner-freebsd-current Thu Nov 21 13:55:36 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 57CEE37B401 for ; Thu, 21 Nov 2002 13:55:34 -0800 (PST) Received: from mailtoaster1.pipeline.ch (mailtoaster1.pipeline.ch [62.48.0.70]) by mx1.FreeBSD.org (Postfix) with SMTP id AADA843E8A for ; Thu, 21 Nov 2002 13:55:32 -0800 (PST) (envelope-from oppermann@pipeline.ch) Received: (qmail 41530 invoked from network); 21 Nov 2002 21:55:25 -0000 Received: from unknown (HELO pipeline.ch) ([62.48.0.54]) (envelope-sender ) by mailtoaster1.pipeline.ch (qmail-ldap-1.03) with SMTP for ; 21 Nov 2002 21:55:25 -0000 Message-ID: <3DDD5609.8D158A66@pipeline.ch> Date: Thu, 21 Nov 2002 22:54:17 +0100 From: Andre Oppermann X-Mailer: Mozilla 4.76 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: Luigi Rizzo Cc: current@freebsd.org Subject: Re: mbuf header bloat ? References: <20021121111709.A23435@xorpc.icir.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Luigi Rizzo wrote: > > [Bcc to -net because it is relevant there. This email has been > triggered by a private discussion i was having with other committers > (who will easily recognise themselves :) which suggested the > possibility of adding more fields to mbuf headers] > > Just recently came up to my attention that we have the following > code in > > #define MAC_MAX_POLICIES 4 > struct label { > int l_flags; > union { > void *l_ptr; > long l_long; > } l_perpolicy[MAC_MAX_POLICIES]; > }; > > (what are l_perpolicy[], ints ? Could this be written a bit better ?) > and then in > > struct pkthdr { > struct ifnet *rcvif; /* rcv interface */ > int len; /* total packet length */ > /* variables for ip and tcp reassembly */ > void *header; /* pointer to packet header */ > /* variables for hardware checksum */ > int csum_flags; /* flags regarding checksum */ > int csum_data; /* data field used by csum routines */ > SLIST_HEAD(packet_tags, m_tag) tags; /* list of packet tags */ > struct label label; /* MAC label of data in packet */ > }; > > The label is 5 ints, the pkthdr a total of 11 ints (and m_hdr takes > another 6, for a total of 136 bytes of header info on 64-bit architectures). > > Of the pkthdr, only 3 fields (rcvif, len, tags) are of really general > use, the rest being used only in certain cases and for very specific > purposes (e.g. reassembly of fragments, or hw capabilities, or MAC). > > Now that Sam has done the excellent work of integrating packet tags > to carry annotations around, i really believe that we should try > to move out of the pkthdr all non-general fields, and move them to > m_tags so we only pay the cost when needed and not in all cases. > Also this pays a lot in terms of ABI compatibility and extensibility. > I understand that for 5.0 it is a bit late to act, but i do hope > that we can reconsider this issue for 5.1 and pull out of the pkthdr > at least the MAC label, and possibly also the csum_* fields, much > in the same way it has been done for VLAN labels. Sounds good to me. -- Andre To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message