From owner-freebsd-atm Thu May 1 15:08:38 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id PAA20668 for atm-outgoing; Thu, 1 May 1997 15:08:38 -0700 (PDT) Received: from plains.nodak.edu (tinguely@plains.NoDak.edu [134.129.111.64]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id PAA20648; Thu, 1 May 1997 15:08:30 -0700 (PDT) Received: (from tinguely@localhost) by plains.nodak.edu (8.8.5/8.8.5) id RAA03104; Thu, 1 May 1997 17:08:23 -0500 (CDT) Date: Thu, 1 May 1997 17:08:23 -0500 (CDT) From: Mark Tinguely Message-Id: <199705012208.RAA03104@plains.nodak.edu> To: freebsd-atm@freebsd.org, freebsd-hackers@freebsd.org Subject: custom free for external mbuf Sender: owner-atm@freebsd.org X-Loop: FreeBSD.org Precedence: bulk back in October, I said that I wanted to add a permanent association between an external mbuf and the external buffer. I call this M_PERM. below is a context diff from 2.2.1-RELEASE. I have a card that holds hundreds of mbufs until the ATM card gets data, then they will pass through some networks stack and when released they get requeued to the ATM card. I want to lower the cost of making/breaking the mbuf to external connection, and besides since I hold so many mbufs in the ATM queue, I do not want to have other devices fighting the card for resources. This is backward compatible with other external mbuf and should have no impact with existing code. The line: m->m_next = (struct mbuf *) 0; could be put in the ext_free() routine, I added it here to be consistant with the rest of the macro. As a side issue, I still have a concern with others drivers setting the ext_free() routine without checking if there is already a ext_free() routine. we hashed this a bit back in October, I refined my changes. I am sending this to hackers for comments before submitting. If there strong objections to the change, I will keep it only as a local change for the driver. --mark. ---------- sys/sys/mbuf.h and /usr/include/sys/mbuf.h ------------ *** mbuf.h.orig Mon Aug 19 13:30:15 1996 --- mbuf.h Thu May 1 14:37:08 1997 *************** *** 123,128 **** --- 123,129 ---- #define M_PKTHDR 0x0002 /* start of record */ #define M_EOR 0x0004 /* end of record */ #define M_PROTO1 0x0008 /* protocol-specific */ + #define M_PERM 0x0010 /* permanently associated external storage */ /* mbuf pkthdr flags, also in m_flags */ #define M_BCAST 0x0100 /* send/received as link-level broadcast */ *************** *** 287,296 **** } \ } \ (n) = (m)->m_next; \ ! (m)->m_type = MT_FREE; \ ! mbstat.m_mtypes[MT_FREE]++; \ ! (m)->m_next = mmbfree; \ ! mmbfree = (m); \ ) /* --- 288,301 ---- } \ } \ (n) = (m)->m_next; \ ! if ((m)->m_flags & M_PERM) \ ! m->m_next = (struct mbuf *) 0; \ ! else { \ ! (m)->m_type = MT_FREE; \ ! mbstat.m_mtypes[MT_FREE]++; \ ! (m)->m_next = mmbfree; \ ! mmbfree = (m); \ ! } \ ) /* From owner-freebsd-atm Thu May 1 15:54:38 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id PAA23124 for atm-outgoing; Thu, 1 May 1997 15:54:38 -0700 (PDT) Received: from lestat.nas.nasa.gov (lestat.nas.nasa.gov [129.99.50.29]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id PAA23104; Thu, 1 May 1997 15:54:35 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by lestat.nas.nasa.gov (8.7.5/8.6.12) with SMTP id PAA09516; Thu, 1 May 1997 15:42:39 -0700 (PDT) Message-Id: <199705012242.PAA09516@lestat.nas.nasa.gov> X-Authentication-Warning: lestat.nas.nasa.gov: Host localhost [127.0.0.1] didn't use HELO protocol To: Mark Tinguely Cc: freebsd-atm@freebsd.org, freebsd-hackers@freebsd.org Subject: Re: custom free for external mbuf Reply-To: Jason Thorpe From: Jason Thorpe Date: Thu, 01 May 1997 15:42:38 -0700 Sender: owner-atm@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Thu, 1 May 1997 17:08:23 -0500 (CDT) Mark Tinguely wrote: > As a side issue, I still have a concern with others drivers setting the > ext_free() routine without checking if there is already a ext_free() routine. ...you should probably take a look at the changes Matt Thomas and I worked up for NetBSD's mbuf code, to properly deal with external storage. See your nearest NetBSD-current mirror. Jason R. Thorpe thorpej@nas.nasa.gov NASA Ames Research Center Home: 408.866.1912 NAS: M/S 258-6 Work: 415.604.0935 Moffett Field, CA 94035 Pager: 415.428.6939 From owner-freebsd-atm Thu May 1 16:31:42 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id QAA25071 for atm-outgoing; Thu, 1 May 1997 16:31:42 -0700 (PDT) Received: from alpo.whistle.com (alpo.whistle.com [207.76.204.38]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id QAA25034; Thu, 1 May 1997 16:31:21 -0700 (PDT) Received: (from daemon@localhost) by alpo.whistle.com (8.8.5/8.8.5) id QAA23159; Thu, 1 May 1997 16:26:59 -0700 (PDT) Received: from current1.whistle.com(207.76.205.22) via SMTP by alpo.whistle.com, id smtpd023146; Thu May 1 23:26:49 1997 Message-ID: <33692699.ABD322C@whistle.com> Date: Thu, 01 May 1997 16:26:17 -0700 From: Julian Elischer Organization: Whistle Communications X-Mailer: Mozilla 3.0Gold (X11; I; FreeBSD 2.2-CURRENT i386) MIME-Version: 1.0 To: Mark Tinguely CC: freebsd-atm@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG Subject: Re: custom free for external mbuf References: <199705012208.RAA03104@plains.nodak.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-atm@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Mark Tinguely wrote: > > back in October, I said that I wanted to add a permanent association > between an external mbuf and the external buffer. I call this M_PERM. > below is a context diff from 2.2.1-RELEASE. I have a card that holds > hundreds of mbufs until the ATM card gets data, then they will pass > through some networks stack and when released they get requeued to > the ATM card. I want to lower the cost of making/breaking the mbuf > to external connection, and besides since I hold so many mbufs in the > ATM queue, I do not want to have other devices fighting the card for > resources. > > [... chop ...] you should also talk with Matt Thomas (Mr. DEC chips) as he has some changes and such he'd like to see in there too. julian