From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 23 19:12:23 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DB4A316A4B3 for ; Tue, 23 Sep 2003 19:12:23 -0700 (PDT) Received: from pixies.tirloni.org (pixies.tirloni.org [200.203.183.37]) by mx1.FreeBSD.org (Postfix) with ESMTP id CD23C43FBD for ; Tue, 23 Sep 2003 19:12:22 -0700 (PDT) (envelope-from tirloni@tirloni.org) Received: from localhost (pixies [200.203.183.37]) by pixies.tirloni.org (Postfix) with ESMTP id 5C4201E146F for ; Tue, 23 Sep 2003 23:12:20 -0300 (BRT) Received: from pixies.tirloni.org ([200.203.183.37]) by localhost (pixies.tirloni.org [200.203.183.37]) (amavisd-new, port 10024) with ESMTP id 63486-10 for ; Tue, 23 Sep 2003 23:12:19 -0300 (BRT) Received: by pixies.tirloni.org (Postfix, from userid 1000) id B731E1E1426; Tue, 23 Sep 2003 23:12:19 -0300 (BRT) Date: Tue, 23 Sep 2003 23:12:19 -0300 From: "Giovanni P. Tirloni" To: freebsd-hackers@freebsd.org Message-ID: <20030924021219.GV34641@pixies.tirloni.org> Mail-Followup-To: freebsd-hackers@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at tirloni.org Subject: mbuf doubts X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2003 02:12:24 -0000 Hi, I have been reading the D&I chapter about IPC, specially the mbuf section and *many* doubts were raised by my mind. I sending them here in the hope that someone can clarify some bits for me so I can proceed. Reading sys/param.h and sys/mbuf.h I came to the conclusion that there are four types of mbufs regarding it's allocation of memory for data. Is the listing below correct? struct mbuf *m; 1. Normal mbuf using m->M_databuf 2. Normal mbuf with external storage (cluster?) in m->m_hdr->mh_data 3. Header mbuf using m->m_pktdat; 4. Header mbuf with ext. storage (cluster?) in m->m_ext->ext_buf Other questions: 1. When using ext. storage is the space allocated by M_databuf wasted? 2. How the system decides 256 bytes for each mbuf isn't enough and it needs a mbuf cluster? Isn't chaining useful there? 3. How does changing MSIZE affects the whole thing? 4. What about MCLBYTES? Sorry to make so many questions at once but I find it very interesting and I'm really willing to learn how the building blocks of the network stack work. Perhaps my questions are out of reality.. it's risk. Thanks, -- Giovanni P. Tirloni Fingerprint: 8C3F BEC5 79BD 3E9B EDB8 72F4 16E8 BA5E D031 5C26